add apis
This commit is contained in:
194
src/gen/api/outline/apis/AttachmentsApi.ts
Normal file
194
src/gen/api/outline/apis/AttachmentsApi.ts
Normal file
@@ -0,0 +1,194 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsCreate200Response,
|
||||
AttachmentsCreateRequest,
|
||||
AttachmentsDelete200Response,
|
||||
AttachmentsRedirectRequest,
|
||||
InlineObject,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsCreate200ResponseFromJSON,
|
||||
AttachmentsCreate200ResponseToJSON,
|
||||
AttachmentsCreateRequestFromJSON,
|
||||
AttachmentsCreateRequestToJSON,
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
AttachmentsRedirectRequestFromJSON,
|
||||
AttachmentsRedirectRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface AttachmentsCreateOperationRequest {
|
||||
attachmentsCreateRequest?: AttachmentsCreateRequest;
|
||||
}
|
||||
|
||||
export interface AttachmentsDeleteRequest {
|
||||
attachmentsRedirectRequest?: AttachmentsRedirectRequest;
|
||||
}
|
||||
|
||||
export interface AttachmentsRedirectOperationRequest {
|
||||
attachmentsRedirectRequest?: AttachmentsRedirectRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class AttachmentsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creating an attachment object creates a database record and returns the inputs needed to generate a signed url and upload the file from the client to cloud storage.
|
||||
* Create an attachment
|
||||
*/
|
||||
async attachmentsCreateRaw(requestParameters: AttachmentsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsCreate200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/attachments.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: AttachmentsCreateRequestToJSON(requestParameters['attachmentsCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsCreate200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creating an attachment object creates a database record and returns the inputs needed to generate a signed url and upload the file from the client to cloud storage.
|
||||
* Create an attachment
|
||||
*/
|
||||
async attachmentsCreate(requestParameters: AttachmentsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsCreate200Response> {
|
||||
const response = await this.attachmentsCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleting an attachment is permanant. It will not delete references or links to the attachment that may exist in your documents.
|
||||
* Delete an attachment
|
||||
*/
|
||||
async attachmentsDeleteRaw(requestParameters: AttachmentsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/attachments.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: AttachmentsRedirectRequestToJSON(requestParameters['attachmentsRedirectRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleting an attachment is permanant. It will not delete references or links to the attachment that may exist in your documents.
|
||||
* Delete an attachment
|
||||
*/
|
||||
async attachmentsDelete(requestParameters: AttachmentsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.attachmentsDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an attachment from where it is stored based on the id. If the attachment is private then a temporary, signed url with embedded credentials is generated on demand.
|
||||
* Retrieve an attachment
|
||||
*/
|
||||
async attachmentsRedirectRaw(requestParameters: AttachmentsRedirectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/attachments.redirect`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: AttachmentsRedirectRequestToJSON(requestParameters['attachmentsRedirectRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an attachment from where it is stored based on the id. If the attachment is private then a temporary, signed url with embedded credentials is generated on demand.
|
||||
* Retrieve an attachment
|
||||
*/
|
||||
async attachmentsRedirect(requestParameters: AttachmentsRedirectOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.attachmentsRedirectRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
}
|
||||
111
src/gen/api/outline/apis/AuthApi.ts
Normal file
111
src/gen/api/outline/apis/AuthApi.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AuthConfig200Response,
|
||||
AuthInfo200Response,
|
||||
InlineObject,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AuthConfig200ResponseFromJSON,
|
||||
AuthConfig200ResponseToJSON,
|
||||
AuthInfo200ResponseFromJSON,
|
||||
AuthInfo200ResponseToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class AuthApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Retrieve authentication options
|
||||
* Retrieve auth config
|
||||
*/
|
||||
async authConfigRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthConfig200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
|
||||
let urlPath = `/auth.config`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AuthConfig200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve authentication options
|
||||
* Retrieve auth config
|
||||
*/
|
||||
async authConfig(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthConfig200Response> {
|
||||
const response = await this.authConfigRaw(initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve authentication details for the current API key
|
||||
* Retrieve auth
|
||||
*/
|
||||
async authInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AuthInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/auth.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AuthInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve authentication details for the current API key
|
||||
* Retrieve auth
|
||||
*/
|
||||
async authInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AuthInfo200Response> {
|
||||
const response = await this.authInfoRaw(initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
800
src/gen/api/outline/apis/CollectionsApi.ts
Normal file
800
src/gen/api/outline/apis/CollectionsApi.ts
Normal file
@@ -0,0 +1,800 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
CollectionsAddGroup200Response,
|
||||
CollectionsAddGroupRequest,
|
||||
CollectionsAddUser200Response,
|
||||
CollectionsAddUserRequest,
|
||||
CollectionsCreateRequest,
|
||||
CollectionsDeleteRequest,
|
||||
CollectionsDocuments200Response,
|
||||
CollectionsExport200Response,
|
||||
CollectionsExportAllRequest,
|
||||
CollectionsExportRequest,
|
||||
CollectionsGroupMemberships200Response,
|
||||
CollectionsGroupMembershipsRequest,
|
||||
CollectionsInfo200Response,
|
||||
CollectionsInfoRequest,
|
||||
CollectionsList200Response,
|
||||
CollectionsListRequest,
|
||||
CollectionsMemberships200Response,
|
||||
CollectionsMembershipsRequest,
|
||||
CollectionsRemoveGroupRequest,
|
||||
CollectionsRemoveUserRequest,
|
||||
CollectionsUpdateRequest,
|
||||
InlineObject,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
CollectionsAddGroup200ResponseFromJSON,
|
||||
CollectionsAddGroup200ResponseToJSON,
|
||||
CollectionsAddGroupRequestFromJSON,
|
||||
CollectionsAddGroupRequestToJSON,
|
||||
CollectionsAddUser200ResponseFromJSON,
|
||||
CollectionsAddUser200ResponseToJSON,
|
||||
CollectionsAddUserRequestFromJSON,
|
||||
CollectionsAddUserRequestToJSON,
|
||||
CollectionsCreateRequestFromJSON,
|
||||
CollectionsCreateRequestToJSON,
|
||||
CollectionsDeleteRequestFromJSON,
|
||||
CollectionsDeleteRequestToJSON,
|
||||
CollectionsDocuments200ResponseFromJSON,
|
||||
CollectionsDocuments200ResponseToJSON,
|
||||
CollectionsExport200ResponseFromJSON,
|
||||
CollectionsExport200ResponseToJSON,
|
||||
CollectionsExportAllRequestFromJSON,
|
||||
CollectionsExportAllRequestToJSON,
|
||||
CollectionsExportRequestFromJSON,
|
||||
CollectionsExportRequestToJSON,
|
||||
CollectionsGroupMemberships200ResponseFromJSON,
|
||||
CollectionsGroupMemberships200ResponseToJSON,
|
||||
CollectionsGroupMembershipsRequestFromJSON,
|
||||
CollectionsGroupMembershipsRequestToJSON,
|
||||
CollectionsInfo200ResponseFromJSON,
|
||||
CollectionsInfo200ResponseToJSON,
|
||||
CollectionsInfoRequestFromJSON,
|
||||
CollectionsInfoRequestToJSON,
|
||||
CollectionsList200ResponseFromJSON,
|
||||
CollectionsList200ResponseToJSON,
|
||||
CollectionsListRequestFromJSON,
|
||||
CollectionsListRequestToJSON,
|
||||
CollectionsMemberships200ResponseFromJSON,
|
||||
CollectionsMemberships200ResponseToJSON,
|
||||
CollectionsMembershipsRequestFromJSON,
|
||||
CollectionsMembershipsRequestToJSON,
|
||||
CollectionsRemoveGroupRequestFromJSON,
|
||||
CollectionsRemoveGroupRequestToJSON,
|
||||
CollectionsRemoveUserRequestFromJSON,
|
||||
CollectionsRemoveUserRequestToJSON,
|
||||
CollectionsUpdateRequestFromJSON,
|
||||
CollectionsUpdateRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface CollectionsAddGroupOperationRequest {
|
||||
collectionsAddGroupRequest?: CollectionsAddGroupRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsAddUserOperationRequest {
|
||||
collectionsAddUserRequest?: CollectionsAddUserRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsCreateOperationRequest {
|
||||
collectionsCreateRequest?: CollectionsCreateRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsDeleteOperationRequest {
|
||||
collectionsDeleteRequest?: CollectionsDeleteRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsDocumentsRequest {
|
||||
collectionsInfoRequest?: CollectionsInfoRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsExportOperationRequest {
|
||||
collectionsExportRequest?: CollectionsExportRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsExportAllOperationRequest {
|
||||
collectionsExportAllRequest?: CollectionsExportAllRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsGroupMembershipsOperationRequest {
|
||||
collectionsGroupMembershipsRequest?: CollectionsGroupMembershipsRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsInfoOperationRequest {
|
||||
collectionsInfoRequest?: CollectionsInfoRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsListOperationRequest {
|
||||
collectionsListRequest?: CollectionsListRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsMembershipsOperationRequest {
|
||||
collectionsMembershipsRequest?: CollectionsMembershipsRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsRemoveGroupOperationRequest {
|
||||
collectionsRemoveGroupRequest?: CollectionsRemoveGroupRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsRemoveUserOperationRequest {
|
||||
collectionsRemoveUserRequest?: CollectionsRemoveUserRequest;
|
||||
}
|
||||
|
||||
export interface CollectionsUpdateOperationRequest {
|
||||
collectionsUpdateRequest?: CollectionsUpdateRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class CollectionsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* This method allows you to give all members in a group access to a collection.
|
||||
* Add a group to a collection
|
||||
*/
|
||||
async collectionsAddGroupRaw(requestParameters: CollectionsAddGroupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsAddGroup200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.add_group`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsAddGroupRequestToJSON(requestParameters['collectionsAddGroupRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsAddGroup200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to give all members in a group access to a collection.
|
||||
* Add a group to a collection
|
||||
*/
|
||||
async collectionsAddGroup(requestParameters: CollectionsAddGroupOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsAddGroup200Response> {
|
||||
const response = await this.collectionsAddGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to add a user membership to the specified collection.
|
||||
* Add a collection user
|
||||
*/
|
||||
async collectionsAddUserRaw(requestParameters: CollectionsAddUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsAddUser200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.add_user`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsAddUserRequestToJSON(requestParameters['collectionsAddUserRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsAddUser200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to add a user membership to the specified collection.
|
||||
* Add a collection user
|
||||
*/
|
||||
async collectionsAddUser(requestParameters: CollectionsAddUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsAddUser200Response> {
|
||||
const response = await this.collectionsAddUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a collection
|
||||
*/
|
||||
async collectionsCreateRaw(requestParameters: CollectionsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsCreateRequestToJSON(requestParameters['collectionsCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a collection
|
||||
*/
|
||||
async collectionsCreate(requestParameters: CollectionsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsInfo200Response> {
|
||||
const response = await this.collectionsCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a collection and all of its documents. This action can’t be undone so please be careful.
|
||||
* Delete a collection
|
||||
*/
|
||||
async collectionsDeleteRaw(requestParameters: CollectionsDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a collection and all of its documents. This action can’t be undone so please be careful.
|
||||
* Delete a collection
|
||||
*/
|
||||
async collectionsDelete(requestParameters: CollectionsDeleteOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.collectionsDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a collections document structure
|
||||
*/
|
||||
async collectionsDocumentsRaw(requestParameters: CollectionsDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsDocuments200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.documents`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsInfoRequestToJSON(requestParameters['collectionsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsDocuments200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a collections document structure
|
||||
*/
|
||||
async collectionsDocuments(requestParameters: CollectionsDocumentsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsDocuments200Response> {
|
||||
const response = await this.collectionsDocumentsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers a bulk export of the collection in markdown format and their attachments. If documents are nested then they will be nested in folders inside the zip file. The endpoint returns a `FileOperation` that can be queried to track the progress of the export and get the url for the final file.
|
||||
* Export a collection
|
||||
*/
|
||||
async collectionsExportRaw(requestParameters: CollectionsExportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsExport200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.export`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsExportRequestToJSON(requestParameters['collectionsExportRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsExport200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers a bulk export of the collection in markdown format and their attachments. If documents are nested then they will be nested in folders inside the zip file. The endpoint returns a `FileOperation` that can be queried to track the progress of the export and get the url for the final file.
|
||||
* Export a collection
|
||||
*/
|
||||
async collectionsExport(requestParameters: CollectionsExportOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsExport200Response> {
|
||||
const response = await this.collectionsExportRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers a bulk export of all documents in and their attachments. The endpoint returns a `FileOperation` that can be queried through the fileOperations endpoint to track the progress of the export and get the url for the final file.
|
||||
* Export all collections
|
||||
*/
|
||||
async collectionsExportAllRaw(requestParameters: CollectionsExportAllOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsExport200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.export_all`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsExportAllRequestToJSON(requestParameters['collectionsExportAllRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsExport200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers a bulk export of all documents in and their attachments. The endpoint returns a `FileOperation` that can be queried through the fileOperations endpoint to track the progress of the export and get the url for the final file.
|
||||
* Export all collections
|
||||
*/
|
||||
async collectionsExportAll(requestParameters: CollectionsExportAllOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsExport200Response> {
|
||||
const response = await this.collectionsExportAllRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to list a collections group memberships. This is the list of groups that have been given access to the collection.
|
||||
* List all collection group members
|
||||
*/
|
||||
async collectionsGroupMembershipsRaw(requestParameters: CollectionsGroupMembershipsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsGroupMemberships200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.group_memberships`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsGroupMembershipsRequestToJSON(requestParameters['collectionsGroupMembershipsRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsGroupMemberships200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to list a collections group memberships. This is the list of groups that have been given access to the collection.
|
||||
* List all collection group members
|
||||
*/
|
||||
async collectionsGroupMemberships(requestParameters: CollectionsGroupMembershipsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsGroupMemberships200Response> {
|
||||
const response = await this.collectionsGroupMembershipsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a collection
|
||||
*/
|
||||
async collectionsInfoRaw(requestParameters: CollectionsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsInfoRequestToJSON(requestParameters['collectionsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a collection
|
||||
*/
|
||||
async collectionsInfo(requestParameters: CollectionsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsInfo200Response> {
|
||||
const response = await this.collectionsInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all collections
|
||||
*/
|
||||
async collectionsListRaw(requestParameters: CollectionsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsListRequestToJSON(requestParameters['collectionsListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all collections
|
||||
*/
|
||||
async collectionsList(requestParameters: CollectionsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsList200Response> {
|
||||
const response = await this.collectionsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to list a collections individual memberships. It\'s important to note that memberships returned from this endpoint do not include group memberships.
|
||||
* List all collection memberships
|
||||
*/
|
||||
async collectionsMembershipsRaw(requestParameters: CollectionsMembershipsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsMemberships200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.memberships`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsMembershipsRequestToJSON(requestParameters['collectionsMembershipsRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsMemberships200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to list a collections individual memberships. It\'s important to note that memberships returned from this endpoint do not include group memberships.
|
||||
* List all collection memberships
|
||||
*/
|
||||
async collectionsMemberships(requestParameters: CollectionsMembershipsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsMemberships200Response> {
|
||||
const response = await this.collectionsMembershipsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to revoke all members in a group access to a collection. Note that members of the group may still retain access through other groups or individual memberships.
|
||||
* Remove a collection group
|
||||
*/
|
||||
async collectionsRemoveGroupRaw(requestParameters: CollectionsRemoveGroupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.remove_group`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsRemoveGroupRequestToJSON(requestParameters['collectionsRemoveGroupRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to revoke all members in a group access to a collection. Note that members of the group may still retain access through other groups or individual memberships.
|
||||
* Remove a collection group
|
||||
*/
|
||||
async collectionsRemoveGroup(requestParameters: CollectionsRemoveGroupOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.collectionsRemoveGroupRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to remove a user from the specified collection.
|
||||
* Remove a collection user
|
||||
*/
|
||||
async collectionsRemoveUserRaw(requestParameters: CollectionsRemoveUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.remove_user`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsRemoveUserRequestToJSON(requestParameters['collectionsRemoveUserRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to remove a user from the specified collection.
|
||||
* Remove a collection user
|
||||
*/
|
||||
async collectionsRemoveUser(requestParameters: CollectionsRemoveUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.collectionsRemoveUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a collection
|
||||
*/
|
||||
async collectionsUpdateRaw(requestParameters: CollectionsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CollectionsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/collections.update`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsUpdateRequestToJSON(requestParameters['collectionsUpdateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a collection
|
||||
*/
|
||||
async collectionsUpdate(requestParameters: CollectionsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CollectionsInfo200Response> {
|
||||
const response = await this.collectionsUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
312
src/gen/api/outline/apis/CommentsApi.ts
Normal file
312
src/gen/api/outline/apis/CommentsApi.ts
Normal file
@@ -0,0 +1,312 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
CollectionsDeleteRequest,
|
||||
CommentsCreate200Response,
|
||||
CommentsCreateRequest,
|
||||
CommentsInfo200Response,
|
||||
CommentsInfoRequest,
|
||||
CommentsList200Response,
|
||||
CommentsListRequest,
|
||||
CommentsUpdateRequest,
|
||||
InlineObject,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
CollectionsDeleteRequestFromJSON,
|
||||
CollectionsDeleteRequestToJSON,
|
||||
CommentsCreate200ResponseFromJSON,
|
||||
CommentsCreate200ResponseToJSON,
|
||||
CommentsCreateRequestFromJSON,
|
||||
CommentsCreateRequestToJSON,
|
||||
CommentsInfo200ResponseFromJSON,
|
||||
CommentsInfo200ResponseToJSON,
|
||||
CommentsInfoRequestFromJSON,
|
||||
CommentsInfoRequestToJSON,
|
||||
CommentsList200ResponseFromJSON,
|
||||
CommentsList200ResponseToJSON,
|
||||
CommentsListRequestFromJSON,
|
||||
CommentsListRequestToJSON,
|
||||
CommentsUpdateRequestFromJSON,
|
||||
CommentsUpdateRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface CommentsCreateOperationRequest {
|
||||
commentsCreateRequest?: CommentsCreateRequest;
|
||||
}
|
||||
|
||||
export interface CommentsDeleteRequest {
|
||||
collectionsDeleteRequest?: CollectionsDeleteRequest;
|
||||
}
|
||||
|
||||
export interface CommentsInfoOperationRequest {
|
||||
commentsInfoRequest?: CommentsInfoRequest;
|
||||
}
|
||||
|
||||
export interface CommentsListOperationRequest {
|
||||
commentsListRequest?: CommentsListRequest;
|
||||
}
|
||||
|
||||
export interface CommentsUpdateOperationRequest {
|
||||
commentsUpdateRequest?: CommentsUpdateRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class CommentsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Add a comment or reply to a document, either `data` or `text` is required.
|
||||
* Create a comment
|
||||
*/
|
||||
async commentsCreateRaw(requestParameters: CommentsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommentsCreate200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/comments.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CommentsCreateRequestToJSON(requestParameters['commentsCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CommentsCreate200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a comment or reply to a document, either `data` or `text` is required.
|
||||
* Create a comment
|
||||
*/
|
||||
async commentsCreate(requestParameters: CommentsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommentsCreate200Response> {
|
||||
const response = await this.commentsCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a comment. If the comment is a top-level comment, all its children will be deleted as well.
|
||||
* Delete a comment
|
||||
*/
|
||||
async commentsDeleteRaw(requestParameters: CommentsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/comments.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a comment. If the comment is a top-level comment, all its children will be deleted as well.
|
||||
* Delete a comment
|
||||
*/
|
||||
async commentsDelete(requestParameters: CommentsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.commentsDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a comment
|
||||
* Retrieve a comment
|
||||
*/
|
||||
async commentsInfoRaw(requestParameters: CommentsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommentsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/comments.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CommentsInfoRequestToJSON(requestParameters['commentsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CommentsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a comment
|
||||
* Retrieve a comment
|
||||
*/
|
||||
async commentsInfo(requestParameters: CommentsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommentsInfo200Response> {
|
||||
const response = await this.commentsInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will list all comments matching the given properties.
|
||||
* List all comments
|
||||
*/
|
||||
async commentsListRaw(requestParameters: CommentsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommentsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/comments.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CommentsListRequestToJSON(requestParameters['commentsListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CommentsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method will list all comments matching the given properties.
|
||||
* List all comments
|
||||
*/
|
||||
async commentsList(requestParameters: CommentsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommentsList200Response> {
|
||||
const response = await this.commentsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a comment
|
||||
* Update a comment
|
||||
*/
|
||||
async commentsUpdateRaw(requestParameters: CommentsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CommentsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/comments.update`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CommentsUpdateRequestToJSON(requestParameters['commentsUpdateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => CommentsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a comment
|
||||
* Update a comment
|
||||
*/
|
||||
async commentsUpdate(requestParameters: CommentsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CommentsInfo200Response> {
|
||||
const response = await this.commentsUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
1175
src/gen/api/outline/apis/DocumentsApi.ts
Normal file
1175
src/gen/api/outline/apis/DocumentsApi.ts
Normal file
File diff suppressed because it is too large
Load Diff
87
src/gen/api/outline/apis/EventsApi.ts
Normal file
87
src/gen/api/outline/apis/EventsApi.ts
Normal file
@@ -0,0 +1,87 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
EventsList200Response,
|
||||
EventsListRequest,
|
||||
InlineObject,
|
||||
} from '../models/index';
|
||||
import {
|
||||
EventsList200ResponseFromJSON,
|
||||
EventsList200ResponseToJSON,
|
||||
EventsListRequestFromJSON,
|
||||
EventsListRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface EventsListOperationRequest {
|
||||
eventsListRequest?: EventsListRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class EventsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Events are an audit trail of important events that happen in the knowledge base.
|
||||
* List all events
|
||||
*/
|
||||
async eventsListRaw(requestParameters: EventsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EventsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/events.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: EventsListRequestToJSON(requestParameters['eventsListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => EventsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Events are an audit trail of important events that happen in the knowledge base.
|
||||
* List all events
|
||||
*/
|
||||
async eventsList(requestParameters: EventsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EventsList200Response> {
|
||||
const response = await this.eventsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
243
src/gen/api/outline/apis/FileOperationsApi.ts
Normal file
243
src/gen/api/outline/apis/FileOperationsApi.ts
Normal file
@@ -0,0 +1,243 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
FileoperationsInfo200Response,
|
||||
FileoperationsInfoRequest,
|
||||
FileoperationsList200Response,
|
||||
FileoperationsListRequest,
|
||||
InlineObject,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
FileoperationsInfo200ResponseFromJSON,
|
||||
FileoperationsInfo200ResponseToJSON,
|
||||
FileoperationsInfoRequestFromJSON,
|
||||
FileoperationsInfoRequestToJSON,
|
||||
FileoperationsList200ResponseFromJSON,
|
||||
FileoperationsList200ResponseToJSON,
|
||||
FileoperationsListRequestFromJSON,
|
||||
FileoperationsListRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface FileoperationsDeleteRequest {
|
||||
fileoperationsInfoRequest?: FileoperationsInfoRequest;
|
||||
}
|
||||
|
||||
export interface FileoperationsInfoOperationRequest {
|
||||
fileoperationsInfoRequest?: FileoperationsInfoRequest;
|
||||
}
|
||||
|
||||
export interface FileoperationsListOperationRequest {
|
||||
fileoperationsListRequest?: FileoperationsListRequest;
|
||||
}
|
||||
|
||||
export interface FileoperationsRedirectRequest {
|
||||
fileoperationsInfoRequest?: FileoperationsInfoRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class FileOperationsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Delete a file operation
|
||||
*/
|
||||
async fileoperationsDeleteRaw(requestParameters: FileoperationsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/fileOperations.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: FileoperationsInfoRequestToJSON(requestParameters['fileoperationsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a file operation
|
||||
*/
|
||||
async fileoperationsDelete(requestParameters: FileoperationsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.fileoperationsDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a file operation
|
||||
*/
|
||||
async fileoperationsInfoRaw(requestParameters: FileoperationsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileoperationsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/fileOperations.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: FileoperationsInfoRequestToJSON(requestParameters['fileoperationsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => FileoperationsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a file operation
|
||||
*/
|
||||
async fileoperationsInfo(requestParameters: FileoperationsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileoperationsInfo200Response> {
|
||||
const response = await this.fileoperationsInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all file operations
|
||||
*/
|
||||
async fileoperationsListRaw(requestParameters: FileoperationsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FileoperationsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/fileOperations.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: FileoperationsListRequestToJSON(requestParameters['fileoperationsListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => FileoperationsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all file operations
|
||||
*/
|
||||
async fileoperationsList(requestParameters: FileoperationsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FileoperationsList200Response> {
|
||||
const response = await this.fileoperationsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the resulting file from where it is stored based on the id. A temporary, signed url with embedded credentials is generated on demand.
|
||||
* Retrieve the file
|
||||
*/
|
||||
async fileoperationsRedirectRaw(requestParameters: FileoperationsRedirectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Blob>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/fileOperations.redirect`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: FileoperationsInfoRequestToJSON(requestParameters['fileoperationsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.BlobApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the resulting file from where it is stored based on the id. A temporary, signed url with embedded credentials is generated on demand.
|
||||
* Retrieve the file
|
||||
*/
|
||||
async fileoperationsRedirect(requestParameters: FileoperationsRedirectRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Blob> {
|
||||
const response = await this.fileoperationsRedirectRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
472
src/gen/api/outline/apis/GroupsApi.ts
Normal file
472
src/gen/api/outline/apis/GroupsApi.ts
Normal file
@@ -0,0 +1,472 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
CollectionsDeleteRequest,
|
||||
CollectionsRemoveUserRequest,
|
||||
GroupsAddUser200Response,
|
||||
GroupsAddUserRequest,
|
||||
GroupsCreateRequest,
|
||||
GroupsInfo200Response,
|
||||
GroupsInfoRequest,
|
||||
GroupsList200Response,
|
||||
GroupsListRequest,
|
||||
GroupsMemberships200Response,
|
||||
GroupsMembershipsRequest,
|
||||
GroupsRemoveUser200Response,
|
||||
GroupsUpdateRequest,
|
||||
InlineObject,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
CollectionsDeleteRequestFromJSON,
|
||||
CollectionsDeleteRequestToJSON,
|
||||
CollectionsRemoveUserRequestFromJSON,
|
||||
CollectionsRemoveUserRequestToJSON,
|
||||
GroupsAddUser200ResponseFromJSON,
|
||||
GroupsAddUser200ResponseToJSON,
|
||||
GroupsAddUserRequestFromJSON,
|
||||
GroupsAddUserRequestToJSON,
|
||||
GroupsCreateRequestFromJSON,
|
||||
GroupsCreateRequestToJSON,
|
||||
GroupsInfo200ResponseFromJSON,
|
||||
GroupsInfo200ResponseToJSON,
|
||||
GroupsInfoRequestFromJSON,
|
||||
GroupsInfoRequestToJSON,
|
||||
GroupsList200ResponseFromJSON,
|
||||
GroupsList200ResponseToJSON,
|
||||
GroupsListRequestFromJSON,
|
||||
GroupsListRequestToJSON,
|
||||
GroupsMemberships200ResponseFromJSON,
|
||||
GroupsMemberships200ResponseToJSON,
|
||||
GroupsMembershipsRequestFromJSON,
|
||||
GroupsMembershipsRequestToJSON,
|
||||
GroupsRemoveUser200ResponseFromJSON,
|
||||
GroupsRemoveUser200ResponseToJSON,
|
||||
GroupsUpdateRequestFromJSON,
|
||||
GroupsUpdateRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface GroupsAddUserOperationRequest {
|
||||
groupsAddUserRequest?: GroupsAddUserRequest;
|
||||
}
|
||||
|
||||
export interface GroupsCreateOperationRequest {
|
||||
groupsCreateRequest?: GroupsCreateRequest;
|
||||
}
|
||||
|
||||
export interface GroupsDeleteRequest {
|
||||
collectionsDeleteRequest?: CollectionsDeleteRequest;
|
||||
}
|
||||
|
||||
export interface GroupsInfoOperationRequest {
|
||||
groupsInfoRequest?: GroupsInfoRequest;
|
||||
}
|
||||
|
||||
export interface GroupsListOperationRequest {
|
||||
groupsListRequest?: GroupsListRequest;
|
||||
}
|
||||
|
||||
export interface GroupsMembershipsOperationRequest {
|
||||
groupsMembershipsRequest?: GroupsMembershipsRequest;
|
||||
}
|
||||
|
||||
export interface GroupsRemoveUserRequest {
|
||||
collectionsRemoveUserRequest?: CollectionsRemoveUserRequest;
|
||||
}
|
||||
|
||||
export interface GroupsUpdateOperationRequest {
|
||||
groupsUpdateRequest?: GroupsUpdateRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class GroupsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* This method allows you to add a user to the specified group.
|
||||
* Add a group member
|
||||
*/
|
||||
async groupsAddUserRaw(requestParameters: GroupsAddUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GroupsAddUser200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.add_user`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: GroupsAddUserRequestToJSON(requestParameters['groupsAddUserRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => GroupsAddUser200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to add a user to the specified group.
|
||||
* Add a group member
|
||||
*/
|
||||
async groupsAddUser(requestParameters: GroupsAddUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupsAddUser200Response> {
|
||||
const response = await this.groupsAddUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a group
|
||||
*/
|
||||
async groupsCreateRaw(requestParameters: GroupsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GroupsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: GroupsCreateRequestToJSON(requestParameters['groupsCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => GroupsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a group
|
||||
*/
|
||||
async groupsCreate(requestParameters: GroupsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupsInfo200Response> {
|
||||
const response = await this.groupsCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleting a group will cause all of its members to lose access to any collections the group has previously been added to. This action can’t be undone so please be careful.
|
||||
* Delete a group
|
||||
*/
|
||||
async groupsDeleteRaw(requestParameters: GroupsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleting a group will cause all of its members to lose access to any collections the group has previously been added to. This action can’t be undone so please be careful.
|
||||
* Delete a group
|
||||
*/
|
||||
async groupsDelete(requestParameters: GroupsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.groupsDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a group
|
||||
*/
|
||||
async groupsInfoRaw(requestParameters: GroupsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GroupsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: GroupsInfoRequestToJSON(requestParameters['groupsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => GroupsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a group
|
||||
*/
|
||||
async groupsInfo(requestParameters: GroupsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupsInfo200Response> {
|
||||
const response = await this.groupsInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all groups
|
||||
*/
|
||||
async groupsListRaw(requestParameters: GroupsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GroupsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: GroupsListRequestToJSON(requestParameters['groupsListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => GroupsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all groups
|
||||
*/
|
||||
async groupsList(requestParameters: GroupsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupsList200Response> {
|
||||
const response = await this.groupsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List and filter all the members in a group.
|
||||
* List all group members
|
||||
*/
|
||||
async groupsMembershipsRaw(requestParameters: GroupsMembershipsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GroupsMemberships200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.memberships`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: GroupsMembershipsRequestToJSON(requestParameters['groupsMembershipsRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => GroupsMemberships200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List and filter all the members in a group.
|
||||
* List all group members
|
||||
*/
|
||||
async groupsMemberships(requestParameters: GroupsMembershipsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupsMemberships200Response> {
|
||||
const response = await this.groupsMembershipsRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to remove a user from the group.
|
||||
* Remove a group member
|
||||
*/
|
||||
async groupsRemoveUserRaw(requestParameters: GroupsRemoveUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GroupsRemoveUser200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.remove_user`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsRemoveUserRequestToJSON(requestParameters['collectionsRemoveUserRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => GroupsRemoveUser200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* This method allows you to remove a user from the group.
|
||||
* Remove a group member
|
||||
*/
|
||||
async groupsRemoveUser(requestParameters: GroupsRemoveUserRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupsRemoveUser200Response> {
|
||||
const response = await this.groupsRemoveUserRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a group
|
||||
*/
|
||||
async groupsUpdateRaw(requestParameters: GroupsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GroupsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/groups.update`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: GroupsUpdateRequestToJSON(requestParameters['groupsUpdateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => GroupsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a group
|
||||
*/
|
||||
async groupsUpdate(requestParameters: GroupsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GroupsInfo200Response> {
|
||||
const response = await this.groupsUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
340
src/gen/api/outline/apis/OAuthClientsApi.ts
Normal file
340
src/gen/api/outline/apis/OAuthClientsApi.ts
Normal file
@@ -0,0 +1,340 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
InlineObject,
|
||||
OauthClientsCreateRequest,
|
||||
OauthClientsInfo200Response,
|
||||
OauthClientsInfoRequest,
|
||||
OauthClientsList200Response,
|
||||
OauthClientsRotateSecretRequest,
|
||||
OauthClientsUpdateRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
OauthClientsCreateRequestFromJSON,
|
||||
OauthClientsCreateRequestToJSON,
|
||||
OauthClientsInfo200ResponseFromJSON,
|
||||
OauthClientsInfo200ResponseToJSON,
|
||||
OauthClientsInfoRequestFromJSON,
|
||||
OauthClientsInfoRequestToJSON,
|
||||
OauthClientsList200ResponseFromJSON,
|
||||
OauthClientsList200ResponseToJSON,
|
||||
OauthClientsRotateSecretRequestFromJSON,
|
||||
OauthClientsRotateSecretRequestToJSON,
|
||||
OauthClientsUpdateRequestFromJSON,
|
||||
OauthClientsUpdateRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface OauthClientsCreateOperationRequest {
|
||||
oauthClientsCreateRequest?: OauthClientsCreateRequest;
|
||||
}
|
||||
|
||||
export interface OauthClientsDeleteRequest {
|
||||
oauthClientsRotateSecretRequest?: OauthClientsRotateSecretRequest;
|
||||
}
|
||||
|
||||
export interface OauthClientsInfoOperationRequest {
|
||||
oauthClientsInfoRequest?: OauthClientsInfoRequest;
|
||||
}
|
||||
|
||||
export interface OauthClientsRotateSecretOperationRequest {
|
||||
oauthClientsRotateSecretRequest?: OauthClientsRotateSecretRequest;
|
||||
}
|
||||
|
||||
export interface OauthClientsUpdateOperationRequest {
|
||||
oauthClientsUpdateRequest?: OauthClientsUpdateRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class OAuthClientsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Create an OAuth client
|
||||
*/
|
||||
async oauthClientsCreateRaw(requestParameters: OauthClientsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OauthClientsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/oauthClients.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: OauthClientsCreateRequestToJSON(requestParameters['oauthClientsCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an OAuth client
|
||||
*/
|
||||
async oauthClientsCreate(requestParameters: OauthClientsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthClientsInfo200Response> {
|
||||
const response = await this.oauthClientsCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an OAuth client
|
||||
*/
|
||||
async oauthClientsDeleteRaw(requestParameters: OauthClientsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/oauthClients.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: OauthClientsRotateSecretRequestToJSON(requestParameters['oauthClientsRotateSecretRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete an OAuth client
|
||||
*/
|
||||
async oauthClientsDelete(requestParameters: OauthClientsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.oauthClientsDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* To retrieve information about an OAuth client you must pass either an `id` or a `clientId`.
|
||||
* Retrieve an OAuth client
|
||||
*/
|
||||
async oauthClientsInfoRaw(requestParameters: OauthClientsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OauthClientsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/oauthClients.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: OauthClientsInfoRequestToJSON(requestParameters['oauthClientsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* To retrieve information about an OAuth client you must pass either an `id` or a `clientId`.
|
||||
* Retrieve an OAuth client
|
||||
*/
|
||||
async oauthClientsInfo(requestParameters: OauthClientsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthClientsInfo200Response> {
|
||||
const response = await this.oauthClientsInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List accessible OAuth clients
|
||||
*/
|
||||
async oauthClientsListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OauthClientsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/oauthClients.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List accessible OAuth clients
|
||||
*/
|
||||
async oauthClientsList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthClientsList200Response> {
|
||||
const response = await this.oauthClientsListRaw(initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the secret for an OAuth client
|
||||
*/
|
||||
async oauthClientsRotateSecretRaw(requestParameters: OauthClientsRotateSecretOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OauthClientsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/oauthClients.rotate_secret`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: OauthClientsRotateSecretRequestToJSON(requestParameters['oauthClientsRotateSecretRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Rotate the secret for an OAuth client
|
||||
*/
|
||||
async oauthClientsRotateSecret(requestParameters: OauthClientsRotateSecretOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthClientsInfo200Response> {
|
||||
const response = await this.oauthClientsRotateSecretRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an OAuth client
|
||||
*/
|
||||
async oauthClientsUpdateRaw(requestParameters: OauthClientsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OauthClientsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/oauthClients.update`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: OauthClientsUpdateRequestToJSON(requestParameters['oauthClientsUpdateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an OAuth client
|
||||
*/
|
||||
async oauthClientsUpdate(requestParameters: OauthClientsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OauthClientsInfo200Response> {
|
||||
const response = await this.oauthClientsUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
142
src/gen/api/outline/apis/RevisionsApi.ts
Normal file
142
src/gen/api/outline/apis/RevisionsApi.ts
Normal file
@@ -0,0 +1,142 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
InlineObject,
|
||||
RevisionsInfo200Response,
|
||||
RevisionsInfoRequest,
|
||||
RevisionsList200Response,
|
||||
RevisionsListRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
RevisionsInfo200ResponseFromJSON,
|
||||
RevisionsInfo200ResponseToJSON,
|
||||
RevisionsInfoRequestFromJSON,
|
||||
RevisionsInfoRequestToJSON,
|
||||
RevisionsList200ResponseFromJSON,
|
||||
RevisionsList200ResponseToJSON,
|
||||
RevisionsListRequestFromJSON,
|
||||
RevisionsListRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface RevisionsInfoOperationRequest {
|
||||
revisionsInfoRequest?: RevisionsInfoRequest;
|
||||
}
|
||||
|
||||
export interface RevisionsListOperationRequest {
|
||||
revisionsListRequest?: RevisionsListRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class RevisionsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* A revision is a snapshot of a document at a specific point in time. This endpoint allows you to retrieve a specific version of a document by its unique identifier.
|
||||
* Retrieve a revision
|
||||
*/
|
||||
async revisionsInfoRaw(requestParameters: RevisionsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RevisionsInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/revisions.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: RevisionsInfoRequestToJSON(requestParameters['revisionsInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => RevisionsInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* A revision is a snapshot of a document at a specific point in time. This endpoint allows you to retrieve a specific version of a document by its unique identifier.
|
||||
* Retrieve a revision
|
||||
*/
|
||||
async revisionsInfo(requestParameters: RevisionsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RevisionsInfo200Response> {
|
||||
const response = await this.revisionsInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all revisions
|
||||
*/
|
||||
async revisionsListRaw(requestParameters: RevisionsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RevisionsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/revisions.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: RevisionsListRequestToJSON(requestParameters['revisionsListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => RevisionsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all revisions
|
||||
*/
|
||||
async revisionsList(requestParameters: RevisionsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RevisionsList200Response> {
|
||||
const response = await this.revisionsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
305
src/gen/api/outline/apis/SharesApi.ts
Normal file
305
src/gen/api/outline/apis/SharesApi.ts
Normal file
@@ -0,0 +1,305 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
CollectionsDeleteRequest,
|
||||
InlineObject,
|
||||
SharesCreateRequest,
|
||||
SharesInfo200Response,
|
||||
SharesInfoRequest,
|
||||
SharesList200Response,
|
||||
SharesListRequest,
|
||||
SharesUpdateRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
CollectionsDeleteRequestFromJSON,
|
||||
CollectionsDeleteRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
SharesCreateRequestFromJSON,
|
||||
SharesCreateRequestToJSON,
|
||||
SharesInfo200ResponseFromJSON,
|
||||
SharesInfo200ResponseToJSON,
|
||||
SharesInfoRequestFromJSON,
|
||||
SharesInfoRequestToJSON,
|
||||
SharesList200ResponseFromJSON,
|
||||
SharesList200ResponseToJSON,
|
||||
SharesListRequestFromJSON,
|
||||
SharesListRequestToJSON,
|
||||
SharesUpdateRequestFromJSON,
|
||||
SharesUpdateRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface SharesCreateOperationRequest {
|
||||
sharesCreateRequest?: SharesCreateRequest;
|
||||
}
|
||||
|
||||
export interface SharesInfoOperationRequest {
|
||||
sharesInfoRequest?: SharesInfoRequest;
|
||||
}
|
||||
|
||||
export interface SharesListOperationRequest {
|
||||
sharesListRequest?: SharesListRequest;
|
||||
}
|
||||
|
||||
export interface SharesRevokeRequest {
|
||||
collectionsDeleteRequest?: CollectionsDeleteRequest;
|
||||
}
|
||||
|
||||
export interface SharesUpdateOperationRequest {
|
||||
sharesUpdateRequest?: SharesUpdateRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class SharesApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a new share link that can be used by to access a document. If you request multiple shares for the same document with the same API key, the same share object will be returned. By default all shares are unpublished.
|
||||
* Create a share
|
||||
*/
|
||||
async sharesCreateRaw(requestParameters: SharesCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SharesInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/shares.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: SharesCreateRequestToJSON(requestParameters['sharesCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => SharesInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new share link that can be used by to access a document. If you request multiple shares for the same document with the same API key, the same share object will be returned. By default all shares are unpublished.
|
||||
* Create a share
|
||||
*/
|
||||
async sharesCreate(requestParameters: SharesCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SharesInfo200Response> {
|
||||
const response = await this.sharesCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a share object
|
||||
*/
|
||||
async sharesInfoRaw(requestParameters: SharesInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SharesInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/shares.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: SharesInfoRequestToJSON(requestParameters['sharesInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => SharesInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a share object
|
||||
*/
|
||||
async sharesInfo(requestParameters: SharesInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SharesInfo200Response> {
|
||||
const response = await this.sharesInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all shares
|
||||
*/
|
||||
async sharesListRaw(requestParameters: SharesListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SharesList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/shares.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: SharesListRequestToJSON(requestParameters['sharesListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => SharesList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all shares
|
||||
*/
|
||||
async sharesList(requestParameters: SharesListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SharesList200Response> {
|
||||
const response = await this.sharesListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the share link inactive so that it can no longer be used to access the document.
|
||||
* Revoke a share
|
||||
*/
|
||||
async sharesRevokeRaw(requestParameters: SharesRevokeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/shares.revoke`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes the share link inactive so that it can no longer be used to access the document.
|
||||
* Revoke a share
|
||||
*/
|
||||
async sharesRevoke(requestParameters: SharesRevokeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.sharesRevokeRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows changing an existing share\'s published status, which removes authentication and makes it available to anyone with the link.
|
||||
* Update a share
|
||||
*/
|
||||
async sharesUpdateRaw(requestParameters: SharesUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SharesInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/shares.update`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: SharesUpdateRequestToJSON(requestParameters['sharesUpdateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => SharesInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows changing an existing share\'s published status, which removes authentication and makes it available to anyone with the link.
|
||||
* Update a share
|
||||
*/
|
||||
async sharesUpdate(requestParameters: SharesUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SharesInfo200Response> {
|
||||
const response = await this.sharesUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
249
src/gen/api/outline/apis/StarsApi.ts
Normal file
249
src/gen/api/outline/apis/StarsApi.ts
Normal file
@@ -0,0 +1,249 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
CollectionsDeleteRequest,
|
||||
InlineObject,
|
||||
Pagination,
|
||||
StarsCreate200Response,
|
||||
StarsCreateRequest,
|
||||
StarsList200Response,
|
||||
StarsUpdateRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
CollectionsDeleteRequestFromJSON,
|
||||
CollectionsDeleteRequestToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
PaginationFromJSON,
|
||||
PaginationToJSON,
|
||||
StarsCreate200ResponseFromJSON,
|
||||
StarsCreate200ResponseToJSON,
|
||||
StarsCreateRequestFromJSON,
|
||||
StarsCreateRequestToJSON,
|
||||
StarsList200ResponseFromJSON,
|
||||
StarsList200ResponseToJSON,
|
||||
StarsUpdateRequestFromJSON,
|
||||
StarsUpdateRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface StarsCreateOperationRequest {
|
||||
starsCreateRequest?: StarsCreateRequest;
|
||||
}
|
||||
|
||||
export interface StarsDeleteRequest {
|
||||
collectionsDeleteRequest?: CollectionsDeleteRequest;
|
||||
}
|
||||
|
||||
export interface StarsListRequest {
|
||||
pagination?: Pagination;
|
||||
}
|
||||
|
||||
export interface StarsUpdateOperationRequest {
|
||||
starsUpdateRequest?: StarsUpdateRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class StarsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Stars a document or collection so it appears in the users sidebar. One of either `documentId` or `collectionId` must be provided.
|
||||
* Create a star
|
||||
*/
|
||||
async starsCreateRaw(requestParameters: StarsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StarsCreate200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/stars.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: StarsCreateRequestToJSON(requestParameters['starsCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => StarsCreate200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Stars a document or collection so it appears in the users sidebar. One of either `documentId` or `collectionId` must be provided.
|
||||
* Create a star
|
||||
*/
|
||||
async starsCreate(requestParameters: StarsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StarsCreate200Response> {
|
||||
const response = await this.starsCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a star
|
||||
*/
|
||||
async starsDeleteRaw(requestParameters: StarsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/stars.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a star
|
||||
*/
|
||||
async starsDelete(requestParameters: StarsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.starsDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all stars
|
||||
*/
|
||||
async starsListRaw(requestParameters: StarsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StarsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/stars.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: PaginationToJSON(requestParameters['pagination']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => StarsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all stars
|
||||
*/
|
||||
async starsList(requestParameters: StarsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StarsList200Response> {
|
||||
const response = await this.starsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a stars order in the sidebar
|
||||
*/
|
||||
async starsUpdateRaw(requestParameters: StarsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<StarsCreate200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/stars.update`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: StarsUpdateRequestToJSON(requestParameters['starsUpdateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => StarsCreate200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a stars order in the sidebar
|
||||
*/
|
||||
async starsUpdate(requestParameters: StarsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<StarsCreate200Response> {
|
||||
const response = await this.starsUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
461
src/gen/api/outline/apis/UsersApi.ts
Normal file
461
src/gen/api/outline/apis/UsersApi.ts
Normal file
@@ -0,0 +1,461 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AttachmentsDelete200Response,
|
||||
InlineObject,
|
||||
UsersInfo200Response,
|
||||
UsersInfoRequest,
|
||||
UsersInvite200Response,
|
||||
UsersInviteRequest,
|
||||
UsersList200Response,
|
||||
UsersListRequest,
|
||||
UsersUpdateRequest,
|
||||
UsersUpdateRoleRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AttachmentsDelete200ResponseFromJSON,
|
||||
AttachmentsDelete200ResponseToJSON,
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
UsersInfo200ResponseFromJSON,
|
||||
UsersInfo200ResponseToJSON,
|
||||
UsersInfoRequestFromJSON,
|
||||
UsersInfoRequestToJSON,
|
||||
UsersInvite200ResponseFromJSON,
|
||||
UsersInvite200ResponseToJSON,
|
||||
UsersInviteRequestFromJSON,
|
||||
UsersInviteRequestToJSON,
|
||||
UsersList200ResponseFromJSON,
|
||||
UsersList200ResponseToJSON,
|
||||
UsersListRequestFromJSON,
|
||||
UsersListRequestToJSON,
|
||||
UsersUpdateRequestFromJSON,
|
||||
UsersUpdateRequestToJSON,
|
||||
UsersUpdateRoleRequestFromJSON,
|
||||
UsersUpdateRoleRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface UsersActivateRequest {
|
||||
usersInfoRequest?: UsersInfoRequest;
|
||||
}
|
||||
|
||||
export interface UsersDeleteRequest {
|
||||
usersInfoRequest?: UsersInfoRequest;
|
||||
}
|
||||
|
||||
export interface UsersInfoOperationRequest {
|
||||
usersInfoRequest?: UsersInfoRequest;
|
||||
}
|
||||
|
||||
export interface UsersInviteOperationRequest {
|
||||
usersInviteRequest?: UsersInviteRequest;
|
||||
}
|
||||
|
||||
export interface UsersListOperationRequest {
|
||||
usersListRequest?: UsersListRequest;
|
||||
}
|
||||
|
||||
export interface UsersSuspendRequest {
|
||||
usersInfoRequest?: UsersInfoRequest;
|
||||
}
|
||||
|
||||
export interface UsersUpdateOperationRequest {
|
||||
usersUpdateRequest?: UsersUpdateRequest;
|
||||
}
|
||||
|
||||
export interface UsersUpdateRoleOperationRequest {
|
||||
usersUpdateRoleRequest?: UsersUpdateRoleRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class UsersApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Activating a previously suspended user allows them to signin again. Users that are activated will cause billing totals to be re-calculated in the hosted version.
|
||||
* Activate a user
|
||||
*/
|
||||
async usersActivateRaw(requestParameters: UsersActivateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsersInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.activate`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Activating a previously suspended user allows them to signin again. Users that are activated will cause billing totals to be re-calculated in the hosted version.
|
||||
* Activate a user
|
||||
*/
|
||||
async usersActivate(requestParameters: UsersActivateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersInfo200Response> {
|
||||
const response = await this.usersActivateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleting a user removes the object entirely. In almost every circumstance it is preferable to suspend a user, as a deleted user can be recreated by signing in with SSO again.
|
||||
* Delete a user
|
||||
*/
|
||||
async usersDeleteRaw(requestParameters: UsersDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AttachmentsDelete200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.delete`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deleting a user removes the object entirely. In almost every circumstance it is preferable to suspend a user, as a deleted user can be recreated by signing in with SSO again.
|
||||
* Delete a user
|
||||
*/
|
||||
async usersDelete(requestParameters: UsersDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AttachmentsDelete200Response> {
|
||||
const response = await this.usersDeleteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a user
|
||||
*/
|
||||
async usersInfoRaw(requestParameters: UsersInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsersInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.info`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a user
|
||||
*/
|
||||
async usersInfo(requestParameters: UsersInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersInfo200Response> {
|
||||
const response = await this.usersInfoRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Invite users
|
||||
*/
|
||||
async usersInviteRaw(requestParameters: UsersInviteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsersInvite200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.invite`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersInviteRequestToJSON(requestParameters['usersInviteRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => UsersInvite200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Invite users
|
||||
*/
|
||||
async usersInvite(requestParameters: UsersInviteOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersInvite200Response> {
|
||||
const response = await this.usersInviteRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List and filter all the users in the team
|
||||
* List all users
|
||||
*/
|
||||
async usersListRaw(requestParameters: UsersListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsersList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersListRequestToJSON(requestParameters['usersListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => UsersList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List and filter all the users in the team
|
||||
* List all users
|
||||
*/
|
||||
async usersList(requestParameters: UsersListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersList200Response> {
|
||||
const response = await this.usersListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Suspending a user prevents the user from signing in. Users that are suspended are also not counted against billing totals in the hosted version.
|
||||
* Suspend a user
|
||||
*/
|
||||
async usersSuspendRaw(requestParameters: UsersSuspendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsersInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.suspend`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Suspending a user prevents the user from signing in. Users that are suspended are also not counted against billing totals in the hosted version.
|
||||
* Suspend a user
|
||||
*/
|
||||
async usersSuspend(requestParameters: UsersSuspendRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersInfo200Response> {
|
||||
const response = await this.usersSuspendRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a users name or avatar. If no `id` is passed then the user associated with the authentication will be updated by default.
|
||||
* Update a user
|
||||
*/
|
||||
async usersUpdateRaw(requestParameters: UsersUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsersInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.update`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersUpdateRequestToJSON(requestParameters['usersUpdateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a users name or avatar. If no `id` is passed then the user associated with the authentication will be updated by default.
|
||||
* Update a user
|
||||
*/
|
||||
async usersUpdate(requestParameters: UsersUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersInfo200Response> {
|
||||
const response = await this.usersUpdateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the role of a user, only available to admin authorization.
|
||||
* Change a users role
|
||||
*/
|
||||
async usersUpdateRoleRaw(requestParameters: UsersUpdateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<UsersInfo200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/users.update_role`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UsersUpdateRoleRequestToJSON(requestParameters['usersUpdateRoleRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the role of a user, only available to admin authorization.
|
||||
* Change a users role
|
||||
*/
|
||||
async usersUpdateRole(requestParameters: UsersUpdateRoleOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<UsersInfo200Response> {
|
||||
const response = await this.usersUpdateRoleRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
144
src/gen/api/outline/apis/ViewsApi.ts
Normal file
144
src/gen/api/outline/apis/ViewsApi.ts
Normal file
@@ -0,0 +1,144 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
InlineObject,
|
||||
SharesCreateRequest,
|
||||
ViewsCreate200Response,
|
||||
ViewsList200Response,
|
||||
ViewsListRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
InlineObjectFromJSON,
|
||||
InlineObjectToJSON,
|
||||
SharesCreateRequestFromJSON,
|
||||
SharesCreateRequestToJSON,
|
||||
ViewsCreate200ResponseFromJSON,
|
||||
ViewsCreate200ResponseToJSON,
|
||||
ViewsList200ResponseFromJSON,
|
||||
ViewsList200ResponseToJSON,
|
||||
ViewsListRequestFromJSON,
|
||||
ViewsListRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ViewsCreateRequest {
|
||||
sharesCreateRequest?: SharesCreateRequest;
|
||||
}
|
||||
|
||||
export interface ViewsListOperationRequest {
|
||||
viewsListRequest?: ViewsListRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class ViewsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
* Creates a new view for a document. This is documented in the interests of thoroughness however it is recommended that views are not created from outside of the Outline UI.
|
||||
* Create a view
|
||||
*/
|
||||
async viewsCreateRaw(requestParameters: ViewsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ViewsCreate200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/views.create`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: SharesCreateRequestToJSON(requestParameters['sharesCreateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ViewsCreate200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new view for a document. This is documented in the interests of thoroughness however it is recommended that views are not created from outside of the Outline UI.
|
||||
* Create a view
|
||||
*/
|
||||
async viewsCreate(requestParameters: ViewsCreateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ViewsCreate200Response> {
|
||||
const response = await this.viewsCreateRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
* List all users that have viewed a document and the overall view count.
|
||||
* List all views
|
||||
*/
|
||||
async viewsListRaw(requestParameters: ViewsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ViewsList200Response>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
// oauth required
|
||||
headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]);
|
||||
}
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("BearerAuth", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/views.list`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: ViewsListRequestToJSON(requestParameters['viewsListRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => ViewsList200ResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* List all users that have viewed a document and the overall view count.
|
||||
* List all views
|
||||
*/
|
||||
async viewsList(requestParameters: ViewsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ViewsList200Response> {
|
||||
const response = await this.viewsListRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
16
src/gen/api/outline/apis/index.ts
Normal file
16
src/gen/api/outline/apis/index.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from './AttachmentsApi';
|
||||
export * from './AuthApi';
|
||||
export * from './CollectionsApi';
|
||||
export * from './CommentsApi';
|
||||
export * from './DocumentsApi';
|
||||
export * from './EventsApi';
|
||||
export * from './FileOperationsApi';
|
||||
export * from './GroupsApi';
|
||||
export * from './OAuthClientsApi';
|
||||
export * from './RevisionsApi';
|
||||
export * from './SharesApi';
|
||||
export * from './StarsApi';
|
||||
export * from './UsersApi';
|
||||
export * from './ViewsApi';
|
||||
Reference in New Issue
Block a user