Reviewed-on: #1 Co-authored-by: Timo Behrendt <t.behrendt@t00n.de> Co-committed-by: Timo Behrendt <t.behrendt@t00n.de>
801 lines
37 KiB
TypeScript
801 lines
37 KiB
TypeScript
/* 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();
|
||
}
|
||
|
||
}
|