initial-commit #1

Merged
t.behrendt merged 33 commits from initial-commit into main 2025-07-16 07:21:14 +02:00
5 changed files with 443 additions and 0 deletions
Showing only changes of commit ae054416dd - Show all commits

View File

@@ -0,0 +1,108 @@
/* 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 Outlines 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 thats your jam it can be used to generate clients for most programming languages. # Making requests Outlines 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, heres 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 theres 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 { mapValues } from '../runtime';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
UserToJSONTyped,
} from './User';
/**
*
* @export
* @interface Revision
*/
export interface Revision {
/**
* Unique identifier for the object.
* @type {string}
* @memberof Revision
*/
readonly id?: string;
/**
* Identifier for the associated document.
* @type {string}
* @memberof Revision
*/
readonly documentId?: string;
/**
* Title of the document.
* @type {string}
* @memberof Revision
*/
readonly title?: string;
/**
* Body of the document, may contain markdown formatting
* @type {string}
* @memberof Revision
*/
readonly text?: string;
/**
* Date and time when this revision was created
* @type {Date}
* @memberof Revision
*/
readonly createdAt?: Date;
/**
*
* @type {User}
* @memberof Revision
*/
createdBy?: User;
}
/**
* Check if a given object implements the Revision interface.
*/
export function instanceOfRevision(value: object): value is Revision {
return true;
}
export function RevisionFromJSON(json: any): Revision {
return RevisionFromJSONTyped(json, false);
}
export function RevisionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Revision {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'documentId': json['documentId'] == null ? undefined : json['documentId'],
'title': json['title'] == null ? undefined : json['title'],
'text': json['text'] == null ? undefined : json['text'],
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
'createdBy': json['createdBy'] == null ? undefined : UserFromJSON(json['createdBy']),
};
}
export function RevisionToJSON(json: any): Revision {
return RevisionToJSONTyped(json, false);
}
export function RevisionToJSONTyped(value?: Omit<Revision, 'id'|'documentId'|'title'|'text'|'createdAt'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'createdBy': UserToJSON(value['createdBy']),
};
}

View File

@@ -0,0 +1,73 @@
/* 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 Outlines 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 thats your jam it can be used to generate clients for most programming languages. # Making requests Outlines 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, heres 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 theres 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 { mapValues } from '../runtime';
import type { Revision } from './Revision';
import {
RevisionFromJSON,
RevisionFromJSONTyped,
RevisionToJSON,
RevisionToJSONTyped,
} from './Revision';
/**
*
* @export
* @interface RevisionsInfo200Response
*/
export interface RevisionsInfo200Response {
/**
*
* @type {Revision}
* @memberof RevisionsInfo200Response
*/
data?: Revision;
}
/**
* Check if a given object implements the RevisionsInfo200Response interface.
*/
export function instanceOfRevisionsInfo200Response(value: object): value is RevisionsInfo200Response {
return true;
}
export function RevisionsInfo200ResponseFromJSON(json: any): RevisionsInfo200Response {
return RevisionsInfo200ResponseFromJSONTyped(json, false);
}
export function RevisionsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsInfo200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : RevisionFromJSON(json['data']),
};
}
export function RevisionsInfo200ResponseToJSON(json: any): RevisionsInfo200Response {
return RevisionsInfo200ResponseToJSONTyped(json, false);
}
export function RevisionsInfo200ResponseToJSONTyped(value?: RevisionsInfo200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': RevisionToJSON(value['data']),
};
}

View File

@@ -0,0 +1,66 @@
/* 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 Outlines 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 thats your jam it can be used to generate clients for most programming languages. # Making requests Outlines 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, heres 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 theres 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 { mapValues } from '../runtime';
/**
*
* @export
* @interface RevisionsInfoRequest
*/
export interface RevisionsInfoRequest {
/**
* Unique identifier for the revision.
* @type {string}
* @memberof RevisionsInfoRequest
*/
id: string;
}
/**
* Check if a given object implements the RevisionsInfoRequest interface.
*/
export function instanceOfRevisionsInfoRequest(value: object): value is RevisionsInfoRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function RevisionsInfoRequestFromJSON(json: any): RevisionsInfoRequest {
return RevisionsInfoRequestFromJSONTyped(json, false);
}
export function RevisionsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsInfoRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
};
}
export function RevisionsInfoRequestToJSON(json: any): RevisionsInfoRequest {
return RevisionsInfoRequestToJSONTyped(json, false);
}
export function RevisionsInfoRequestToJSONTyped(value?: RevisionsInfoRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
};
}

View File

@@ -0,0 +1,88 @@
/* 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 Outlines 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 thats your jam it can be used to generate clients for most programming languages. # Making requests Outlines 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, heres 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 theres 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 { mapValues } from '../runtime';
import type { Pagination } from './Pagination';
import {
PaginationFromJSON,
PaginationFromJSONTyped,
PaginationToJSON,
PaginationToJSONTyped,
} from './Pagination';
import type { Revision } from './Revision';
import {
RevisionFromJSON,
RevisionFromJSONTyped,
RevisionToJSON,
RevisionToJSONTyped,
} from './Revision';
/**
*
* @export
* @interface RevisionsList200Response
*/
export interface RevisionsList200Response {
/**
*
* @type {Array<Revision>}
* @memberof RevisionsList200Response
*/
data?: Array<Revision>;
/**
*
* @type {Pagination}
* @memberof RevisionsList200Response
*/
pagination?: Pagination;
}
/**
* Check if a given object implements the RevisionsList200Response interface.
*/
export function instanceOfRevisionsList200Response(value: object): value is RevisionsList200Response {
return true;
}
export function RevisionsList200ResponseFromJSON(json: any): RevisionsList200Response {
return RevisionsList200ResponseFromJSONTyped(json, false);
}
export function RevisionsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsList200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(RevisionFromJSON)),
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
};
}
export function RevisionsList200ResponseToJSON(json: any): RevisionsList200Response {
return RevisionsList200ResponseToJSONTyped(json, false);
}
export function RevisionsList200ResponseToJSONTyped(value?: RevisionsList200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(RevisionToJSON)),
'pagination': PaginationToJSON(value['pagination']),
};
}

View File

@@ -0,0 +1,108 @@
/* 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 Outlines 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 thats your jam it can be used to generate clients for most programming languages. # Making requests Outlines 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, heres 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 theres 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 { mapValues } from '../runtime';
/**
*
* @export
* @interface RevisionsListRequest
*/
export interface RevisionsListRequest {
/**
*
* @type {number}
* @memberof RevisionsListRequest
*/
offset?: number;
/**
*
* @type {number}
* @memberof RevisionsListRequest
*/
limit?: number;
/**
*
* @type {string}
* @memberof RevisionsListRequest
*/
sort?: string;
/**
*
* @type {string}
* @memberof RevisionsListRequest
*/
direction?: RevisionsListRequestDirectionEnum;
/**
* The document ID to retrieve revisions for
* @type {string}
* @memberof RevisionsListRequest
*/
documentId?: string;
}
/**
* @export
*/
export const RevisionsListRequestDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type RevisionsListRequestDirectionEnum = typeof RevisionsListRequestDirectionEnum[keyof typeof RevisionsListRequestDirectionEnum];
/**
* Check if a given object implements the RevisionsListRequest interface.
*/
export function instanceOfRevisionsListRequest(value: object): value is RevisionsListRequest {
return true;
}
export function RevisionsListRequestFromJSON(json: any): RevisionsListRequest {
return RevisionsListRequestFromJSONTyped(json, false);
}
export function RevisionsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsListRequest {
if (json == null) {
return json;
}
return {
'offset': json['offset'] == null ? undefined : json['offset'],
'limit': json['limit'] == null ? undefined : json['limit'],
'sort': json['sort'] == null ? undefined : json['sort'],
'direction': json['direction'] == null ? undefined : json['direction'],
'documentId': json['documentId'] == null ? undefined : json['documentId'],
};
}
export function RevisionsListRequestToJSON(json: any): RevisionsListRequest {
return RevisionsListRequestToJSONTyped(json, false);
}
export function RevisionsListRequestToJSONTyped(value?: RevisionsListRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'sort': value['sort'],
'direction': value['direction'],
'documentId': value['documentId'],
};
}