add document models

This commit is contained in:
2025-07-15 17:59:55 +02:00
parent cf0f9501ab
commit 245b41ac9d
27 changed files with 2659 additions and 0 deletions

View File

@@ -0,0 +1,218 @@
/* 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 Document
*/
export interface Document {
/**
* Unique identifier for the object.
* @type {string}
* @memberof Document
*/
readonly id?: string;
/**
* Identifier for the associated collection.
* @type {string}
* @memberof Document
*/
collectionId?: string;
/**
* Identifier for the document this is a child of, if any.
* @type {string}
* @memberof Document
*/
parentDocumentId?: string;
/**
* The title of the document.
* @type {string}
* @memberof Document
*/
title?: string;
/**
* Whether this document should be displayed in a full-width view.
* @type {boolean}
* @memberof Document
*/
fullWidth?: boolean;
/**
* An emoji associated with the document.
* @type {string}
* @memberof Document
*/
emoji?: string;
/**
* The text content of the document, contains markdown formatting
* @type {string}
* @memberof Document
*/
text?: string;
/**
* A short unique ID that can be used to identify the document as an alternative to the UUID
* @type {string}
* @memberof Document
*/
urlId?: string;
/**
*
* @type {Array<User>}
* @memberof Document
*/
collaborators?: Array<User>;
/**
* Whether this document is pinned in the collection
* @type {boolean}
* @memberof Document
*/
pinned?: boolean;
/**
* Whether this document is a template
* @type {boolean}
* @memberof Document
*/
template?: boolean;
/**
* Unique identifier for the template this document was created from, if any
* @type {string}
* @memberof Document
*/
templateId?: string;
/**
* A number that is auto incrementing with every revision of the document that is saved
* @type {number}
* @memberof Document
*/
readonly revision?: number;
/**
* The date and time that this object was created
* @type {Date}
* @memberof Document
*/
readonly createdAt?: Date;
/**
*
* @type {User}
* @memberof Document
*/
createdBy?: User;
/**
* The date and time that this object was last changed
* @type {Date}
* @memberof Document
*/
readonly updatedAt?: Date;
/**
*
* @type {User}
* @memberof Document
*/
updatedBy?: User;
/**
* The date and time that this object was published
* @type {Date}
* @memberof Document
*/
readonly publishedAt?: Date | null;
/**
* The date and time that this object was archived
* @type {Date}
* @memberof Document
*/
readonly archivedAt?: Date;
/**
* The date and time that this object was deleted
* @type {Date}
* @memberof Document
*/
readonly deletedAt?: Date | null;
}
/**
* Check if a given object implements the Document interface.
*/
export function instanceOfDocument(value: object): value is Document {
return true;
}
export function DocumentFromJSON(json: any): Document {
return DocumentFromJSONTyped(json, false);
}
export function DocumentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Document {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'],
'title': json['title'] == null ? undefined : json['title'],
'fullWidth': json['fullWidth'] == null ? undefined : json['fullWidth'],
'emoji': json['emoji'] == null ? undefined : json['emoji'],
'text': json['text'] == null ? undefined : json['text'],
'urlId': json['urlId'] == null ? undefined : json['urlId'],
'collaborators': json['collaborators'] == null ? undefined : ((json['collaborators'] as Array<any>).map(UserFromJSON)),
'pinned': json['pinned'] == null ? undefined : json['pinned'],
'template': json['template'] == null ? undefined : json['template'],
'templateId': json['templateId'] == null ? undefined : json['templateId'],
'revision': json['revision'] == null ? undefined : json['revision'],
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
'createdBy': json['createdBy'] == null ? undefined : UserFromJSON(json['createdBy']),
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
'updatedBy': json['updatedBy'] == null ? undefined : UserFromJSON(json['updatedBy']),
'publishedAt': json['publishedAt'] == null ? undefined : (new Date(json['publishedAt'])),
'archivedAt': json['archivedAt'] == null ? undefined : (new Date(json['archivedAt'])),
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
};
}
export function DocumentToJSON(json: any): Document {
return DocumentToJSONTyped(json, false);
}
export function DocumentToJSONTyped(value?: Omit<Document, 'id'|'revision'|'createdAt'|'updatedAt'|'publishedAt'|'archivedAt'|'deletedAt'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'collectionId': value['collectionId'],
'parentDocumentId': value['parentDocumentId'],
'title': value['title'],
'fullWidth': value['fullWidth'],
'emoji': value['emoji'],
'text': value['text'],
'urlId': value['urlId'],
'collaborators': value['collaborators'] == null ? undefined : ((value['collaborators'] as Array<any>).map(UserToJSON)),
'pinned': value['pinned'],
'template': value['template'],
'templateId': value['templateId'],
'createdBy': UserToJSON(value['createdBy']),
'updatedBy': UserToJSON(value['updatedBy']),
};
}

View File

@@ -0,0 +1,93 @@
/* 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 { Permission } from './Permission';
import {
PermissionFromJSON,
PermissionFromJSONTyped,
PermissionToJSON,
PermissionToJSONTyped,
} from './Permission';
/**
*
* @export
* @interface DocumentsAddUserRequest
*/
export interface DocumentsAddUserRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsAddUserRequest
*/
id: string;
/**
*
* @type {string}
* @memberof DocumentsAddUserRequest
*/
userId: string;
/**
*
* @type {Permission}
* @memberof DocumentsAddUserRequest
*/
permission?: Permission;
}
/**
* Check if a given object implements the DocumentsAddUserRequest interface.
*/
export function instanceOfDocumentsAddUserRequest(value: object): value is DocumentsAddUserRequest {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('userId' in value) || value['userId'] === undefined) return false;
return true;
}
export function DocumentsAddUserRequestFromJSON(json: any): DocumentsAddUserRequest {
return DocumentsAddUserRequestFromJSONTyped(json, false);
}
export function DocumentsAddUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsAddUserRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'userId': json['userId'],
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
};
}
export function DocumentsAddUserRequestToJSON(json: any): DocumentsAddUserRequest {
return DocumentsAddUserRequestToJSONTyped(json, false);
}
export function DocumentsAddUserRequestToJSONTyped(value?: DocumentsAddUserRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'userId': value['userId'],
'permission': PermissionToJSON(value['permission']),
};
}

View File

@@ -0,0 +1,103 @@
/* 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 { Policy } from './Policy';
import {
PolicyFromJSON,
PolicyFromJSONTyped,
PolicyToJSON,
PolicyToJSONTyped,
} from './Policy';
import type { SearchResult } from './SearchResult';
import {
SearchResultFromJSON,
SearchResultFromJSONTyped,
SearchResultToJSON,
SearchResultToJSONTyped,
} from './SearchResult';
import type { Document } from './Document';
import {
DocumentFromJSON,
DocumentFromJSONTyped,
DocumentToJSON,
DocumentToJSONTyped,
} from './Document';
/**
*
* @export
* @interface DocumentsAnswerquestion200Response
*/
export interface DocumentsAnswerquestion200Response {
/**
*
* @type {Array<Document>}
* @memberof DocumentsAnswerquestion200Response
*/
documents?: Array<Document>;
/**
*
* @type {Array<Policy>}
* @memberof DocumentsAnswerquestion200Response
*/
policies?: Array<Policy>;
/**
*
* @type {SearchResult}
* @memberof DocumentsAnswerquestion200Response
*/
search?: SearchResult;
}
/**
* Check if a given object implements the DocumentsAnswerquestion200Response interface.
*/
export function instanceOfDocumentsAnswerquestion200Response(value: object): value is DocumentsAnswerquestion200Response {
return true;
}
export function DocumentsAnswerquestion200ResponseFromJSON(json: any): DocumentsAnswerquestion200Response {
return DocumentsAnswerquestion200ResponseFromJSONTyped(json, false);
}
export function DocumentsAnswerquestion200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsAnswerquestion200Response {
if (json == null) {
return json;
}
return {
'documents': json['documents'] == null ? undefined : ((json['documents'] as Array<any>).map(DocumentFromJSON)),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
'search': json['search'] == null ? undefined : SearchResultFromJSON(json['search']),
};
}
export function DocumentsAnswerquestion200ResponseToJSON(json: any): DocumentsAnswerquestion200Response {
return DocumentsAnswerquestion200ResponseToJSONTyped(json, false);
}
export function DocumentsAnswerquestion200ResponseToJSONTyped(value?: DocumentsAnswerquestion200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'documents': value['documents'] == null ? undefined : ((value['documents'] as Array<any>).map(DocumentToJSON)),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
'search': SearchResultToJSON(value['search']),
};
}

View File

@@ -0,0 +1,128 @@
/* 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 DocumentsAnswerquestionRequest
*/
export interface DocumentsAnswerquestionRequest {
/**
*
* @type {string}
* @memberof DocumentsAnswerquestionRequest
*/
query?: string;
/**
* Any documents that have not been edited by the user identifier will be filtered out
* @type {string}
* @memberof DocumentsAnswerquestionRequest
*/
userId?: string;
/**
* A collection to search within
* @type {string}
* @memberof DocumentsAnswerquestionRequest
*/
collectionId?: string;
/**
* A document to search within
* @type {string}
* @memberof DocumentsAnswerquestionRequest
*/
documentId?: string;
/**
* Any documents that are not in the specified status will be filtered out
* @type {string}
* @memberof DocumentsAnswerquestionRequest
*/
statusFilter?: DocumentsAnswerquestionRequestStatusFilterEnum;
/**
* Any documents that have not been updated within the specified period will be filtered out
* @type {string}
* @memberof DocumentsAnswerquestionRequest
*/
dateFilter?: DocumentsAnswerquestionRequestDateFilterEnum;
}
/**
* @export
*/
export const DocumentsAnswerquestionRequestStatusFilterEnum = {
Draft: 'draft',
Archived: 'archived',
Published: 'published'
} as const;
export type DocumentsAnswerquestionRequestStatusFilterEnum = typeof DocumentsAnswerquestionRequestStatusFilterEnum[keyof typeof DocumentsAnswerquestionRequestStatusFilterEnum];
/**
* @export
*/
export const DocumentsAnswerquestionRequestDateFilterEnum = {
Day: 'day',
Week: 'week',
Month: 'month',
Year: 'year'
} as const;
export type DocumentsAnswerquestionRequestDateFilterEnum = typeof DocumentsAnswerquestionRequestDateFilterEnum[keyof typeof DocumentsAnswerquestionRequestDateFilterEnum];
/**
* Check if a given object implements the DocumentsAnswerquestionRequest interface.
*/
export function instanceOfDocumentsAnswerquestionRequest(value: object): value is DocumentsAnswerquestionRequest {
return true;
}
export function DocumentsAnswerquestionRequestFromJSON(json: any): DocumentsAnswerquestionRequest {
return DocumentsAnswerquestionRequestFromJSONTyped(json, false);
}
export function DocumentsAnswerquestionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsAnswerquestionRequest {
if (json == null) {
return json;
}
return {
'query': json['query'] == null ? undefined : json['query'],
'userId': json['userId'] == null ? undefined : json['userId'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'documentId': json['documentId'] == null ? undefined : json['documentId'],
'statusFilter': json['statusFilter'] == null ? undefined : json['statusFilter'],
'dateFilter': json['dateFilter'] == null ? undefined : json['dateFilter'],
};
}
export function DocumentsAnswerquestionRequestToJSON(json: any): DocumentsAnswerquestionRequest {
return DocumentsAnswerquestionRequestToJSONTyped(json, false);
}
export function DocumentsAnswerquestionRequestToJSONTyped(value?: DocumentsAnswerquestionRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'query': value['query'],
'userId': value['userId'],
'collectionId': value['collectionId'],
'documentId': value['documentId'],
'statusFilter': value['statusFilter'],
'dateFilter': value['dateFilter'],
};
}

View File

@@ -0,0 +1,115 @@
/* 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 DocumentsCreateRequest
*/
export interface DocumentsCreateRequest {
/**
*
* @type {string}
* @memberof DocumentsCreateRequest
*/
title: string;
/**
* The body of the document in markdown
* @type {string}
* @memberof DocumentsCreateRequest
*/
text?: string;
/**
*
* @type {string}
* @memberof DocumentsCreateRequest
*/
collectionId: string;
/**
*
* @type {string}
* @memberof DocumentsCreateRequest
*/
parentDocumentId?: string;
/**
*
* @type {string}
* @memberof DocumentsCreateRequest
*/
templateId?: string;
/**
* Whether this document should be considered to be a template.
* @type {boolean}
* @memberof DocumentsCreateRequest
*/
template?: boolean;
/**
* Whether this document should be immediately published and made visible to other team members.
* @type {boolean}
* @memberof DocumentsCreateRequest
*/
publish?: boolean;
}
/**
* Check if a given object implements the DocumentsCreateRequest interface.
*/
export function instanceOfDocumentsCreateRequest(value: object): value is DocumentsCreateRequest {
if (!('title' in value) || value['title'] === undefined) return false;
if (!('collectionId' in value) || value['collectionId'] === undefined) return false;
return true;
}
export function DocumentsCreateRequestFromJSON(json: any): DocumentsCreateRequest {
return DocumentsCreateRequestFromJSONTyped(json, false);
}
export function DocumentsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsCreateRequest {
if (json == null) {
return json;
}
return {
'title': json['title'],
'text': json['text'] == null ? undefined : json['text'],
'collectionId': json['collectionId'],
'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'],
'templateId': json['templateId'] == null ? undefined : json['templateId'],
'template': json['template'] == null ? undefined : json['template'],
'publish': json['publish'] == null ? undefined : json['publish'],
};
}
export function DocumentsCreateRequestToJSON(json: any): DocumentsCreateRequest {
return DocumentsCreateRequestToJSONTyped(json, false);
}
export function DocumentsCreateRequestToJSONTyped(value?: DocumentsCreateRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'title': value['title'],
'text': value['text'],
'collectionId': value['collectionId'],
'parentDocumentId': value['parentDocumentId'],
'templateId': value['templateId'],
'template': value['template'],
'publish': value['publish'],
};
}

View File

@@ -0,0 +1,74 @@
/* 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 DocumentsDeleteRequest
*/
export interface DocumentsDeleteRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsDeleteRequest
*/
id: string;
/**
* If set to true the document will be destroyed with no way to recover rather than moved to the trash.
* @type {boolean}
* @memberof DocumentsDeleteRequest
*/
permanent?: boolean;
}
/**
* Check if a given object implements the DocumentsDeleteRequest interface.
*/
export function instanceOfDocumentsDeleteRequest(value: object): value is DocumentsDeleteRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsDeleteRequestFromJSON(json: any): DocumentsDeleteRequest {
return DocumentsDeleteRequestFromJSONTyped(json, false);
}
export function DocumentsDeleteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsDeleteRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'permanent': json['permanent'] == null ? undefined : json['permanent'],
};
}
export function DocumentsDeleteRequestToJSON(json: any): DocumentsDeleteRequest {
return DocumentsDeleteRequestToJSONTyped(json, false);
}
export function DocumentsDeleteRequestToJSONTyped(value?: DocumentsDeleteRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'permanent': value['permanent'],
};
}

View File

@@ -0,0 +1,127 @@
/* 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 DocumentsDraftsRequest
*/
export interface DocumentsDraftsRequest {
/**
*
* @type {number}
* @memberof DocumentsDraftsRequest
*/
offset?: number;
/**
*
* @type {number}
* @memberof DocumentsDraftsRequest
*/
limit?: number;
/**
*
* @type {string}
* @memberof DocumentsDraftsRequest
*/
sort?: string;
/**
*
* @type {string}
* @memberof DocumentsDraftsRequest
*/
direction?: DocumentsDraftsRequestDirectionEnum;
/**
* A collection to search within
* @type {string}
* @memberof DocumentsDraftsRequest
*/
collectionId?: string;
/**
* Any documents that have not been updated within the specified period will be filtered out
* @type {string}
* @memberof DocumentsDraftsRequest
*/
dateFilter?: DocumentsDraftsRequestDateFilterEnum;
}
/**
* @export
*/
export const DocumentsDraftsRequestDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type DocumentsDraftsRequestDirectionEnum = typeof DocumentsDraftsRequestDirectionEnum[keyof typeof DocumentsDraftsRequestDirectionEnum];
/**
* @export
*/
export const DocumentsDraftsRequestDateFilterEnum = {
Day: 'day',
Week: 'week',
Month: 'month',
Year: 'year'
} as const;
export type DocumentsDraftsRequestDateFilterEnum = typeof DocumentsDraftsRequestDateFilterEnum[keyof typeof DocumentsDraftsRequestDateFilterEnum];
/**
* Check if a given object implements the DocumentsDraftsRequest interface.
*/
export function instanceOfDocumentsDraftsRequest(value: object): value is DocumentsDraftsRequest {
return true;
}
export function DocumentsDraftsRequestFromJSON(json: any): DocumentsDraftsRequest {
return DocumentsDraftsRequestFromJSONTyped(json, false);
}
export function DocumentsDraftsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsDraftsRequest {
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'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'dateFilter': json['dateFilter'] == null ? undefined : json['dateFilter'],
};
}
export function DocumentsDraftsRequestToJSON(json: any): DocumentsDraftsRequest {
return DocumentsDraftsRequestToJSONTyped(json, false);
}
export function DocumentsDraftsRequestToJSONTyped(value?: DocumentsDraftsRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'sort': value['sort'],
'direction': value['direction'],
'collectionId': value['collectionId'],
'dateFilter': value['dateFilter'],
};
}

View File

@@ -0,0 +1,65 @@
/* 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 DocumentsExport200Response
*/
export interface DocumentsExport200Response {
/**
* The document content in Markdown formatting
* @type {string}
* @memberof DocumentsExport200Response
*/
data?: string;
}
/**
* Check if a given object implements the DocumentsExport200Response interface.
*/
export function instanceOfDocumentsExport200Response(value: object): value is DocumentsExport200Response {
return true;
}
export function DocumentsExport200ResponseFromJSON(json: any): DocumentsExport200Response {
return DocumentsExport200ResponseFromJSONTyped(json, false);
}
export function DocumentsExport200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsExport200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : json['data'],
};
}
export function DocumentsExport200ResponseToJSON(json: any): DocumentsExport200Response {
return DocumentsExport200ResponseToJSONTyped(json, false);
}
export function DocumentsExport200ResponseToJSONTyped(value?: DocumentsExport200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': 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 DocumentsExportRequest
*/
export interface DocumentsExportRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsExportRequest
*/
id: string;
}
/**
* Check if a given object implements the DocumentsExportRequest interface.
*/
export function instanceOfDocumentsExportRequest(value: object): value is DocumentsExportRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsExportRequestFromJSON(json: any): DocumentsExportRequest {
return DocumentsExportRequestFromJSONTyped(json, false);
}
export function DocumentsExportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsExportRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
};
}
export function DocumentsExportRequestToJSON(json: any): DocumentsExportRequest {
return DocumentsExportRequestToJSONTyped(json, false);
}
export function DocumentsExportRequestToJSONTyped(value?: DocumentsExportRequest | 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 { Policy } from './Policy';
import {
PolicyFromJSON,
PolicyFromJSONTyped,
PolicyToJSON,
PolicyToJSONTyped,
} from './Policy';
import type { Document } from './Document';
import {
DocumentFromJSON,
DocumentFromJSONTyped,
DocumentToJSON,
DocumentToJSONTyped,
} from './Document';
/**
*
* @export
* @interface DocumentsInfo200Response
*/
export interface DocumentsInfo200Response {
/**
*
* @type {Document}
* @memberof DocumentsInfo200Response
*/
data?: Document;
/**
*
* @type {Array<Policy>}
* @memberof DocumentsInfo200Response
*/
policies?: Array<Policy>;
}
/**
* Check if a given object implements the DocumentsInfo200Response interface.
*/
export function instanceOfDocumentsInfo200Response(value: object): value is DocumentsInfo200Response {
return true;
}
export function DocumentsInfo200ResponseFromJSON(json: any): DocumentsInfo200Response {
return DocumentsInfo200ResponseFromJSONTyped(json, false);
}
export function DocumentsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsInfo200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : DocumentFromJSON(json['data']),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
};
}
export function DocumentsInfo200ResponseToJSON(json: any): DocumentsInfo200Response {
return DocumentsInfo200ResponseToJSONTyped(json, false);
}
export function DocumentsInfo200ResponseToJSONTyped(value?: DocumentsInfo200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': DocumentToJSON(value['data']),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
};
}

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';
/**
*
* @export
* @interface DocumentsInfoRequest
*/
export interface DocumentsInfoRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsInfoRequest
*/
id?: string;
/**
* Unique identifier for a document share, a shareId may be used in place of a document UUID
* @type {string}
* @memberof DocumentsInfoRequest
*/
shareId?: string;
}
/**
* Check if a given object implements the DocumentsInfoRequest interface.
*/
export function instanceOfDocumentsInfoRequest(value: object): value is DocumentsInfoRequest {
return true;
}
export function DocumentsInfoRequestFromJSON(json: any): DocumentsInfoRequest {
return DocumentsInfoRequestFromJSONTyped(json, false);
}
export function DocumentsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsInfoRequest {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'shareId': json['shareId'] == null ? undefined : json['shareId'],
};
}
export function DocumentsInfoRequestToJSON(json: any): DocumentsInfoRequest {
return DocumentsInfoRequestToJSONTyped(json, false);
}
export function DocumentsInfoRequestToJSONTyped(value?: DocumentsInfoRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'shareId': value['shareId'],
};
}

View File

@@ -0,0 +1,103 @@
/* 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 { Policy } from './Policy';
import {
PolicyFromJSON,
PolicyFromJSONTyped,
PolicyToJSON,
PolicyToJSONTyped,
} from './Policy';
import type { Pagination } from './Pagination';
import {
PaginationFromJSON,
PaginationFromJSONTyped,
PaginationToJSON,
PaginationToJSONTyped,
} from './Pagination';
import type { Document } from './Document';
import {
DocumentFromJSON,
DocumentFromJSONTyped,
DocumentToJSON,
DocumentToJSONTyped,
} from './Document';
/**
*
* @export
* @interface DocumentsList200Response
*/
export interface DocumentsList200Response {
/**
*
* @type {Array<Document>}
* @memberof DocumentsList200Response
*/
data?: Array<Document>;
/**
*
* @type {Array<Policy>}
* @memberof DocumentsList200Response
*/
policies?: Array<Policy>;
/**
*
* @type {Pagination}
* @memberof DocumentsList200Response
*/
pagination?: Pagination;
}
/**
* Check if a given object implements the DocumentsList200Response interface.
*/
export function instanceOfDocumentsList200Response(value: object): value is DocumentsList200Response {
return true;
}
export function DocumentsList200ResponseFromJSON(json: any): DocumentsList200Response {
return DocumentsList200ResponseFromJSONTyped(json, false);
}
export function DocumentsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsList200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(DocumentFromJSON)),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
};
}
export function DocumentsList200ResponseToJSON(json: any): DocumentsList200Response {
return DocumentsList200ResponseToJSONTyped(json, false);
}
export function DocumentsList200ResponseToJSONTyped(value?: DocumentsList200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(DocumentToJSON)),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
'pagination': PaginationToJSON(value['pagination']),
};
}

View File

@@ -0,0 +1,140 @@
/* 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 DocumentsListRequest
*/
export interface DocumentsListRequest {
/**
*
* @type {number}
* @memberof DocumentsListRequest
*/
offset?: number;
/**
*
* @type {number}
* @memberof DocumentsListRequest
*/
limit?: number;
/**
*
* @type {string}
* @memberof DocumentsListRequest
*/
sort?: string;
/**
*
* @type {string}
* @memberof DocumentsListRequest
*/
direction?: DocumentsListRequestDirectionEnum;
/**
* Optionally filter to a specific collection
* @type {string}
* @memberof DocumentsListRequest
*/
collectionId?: string;
/**
*
* @type {string}
* @memberof DocumentsListRequest
*/
userId?: string;
/**
*
* @type {string}
* @memberof DocumentsListRequest
*/
backlinkDocumentId?: string;
/**
*
* @type {string}
* @memberof DocumentsListRequest
*/
parentDocumentId?: string;
/**
* Optionally filter to only templates
* @type {boolean}
* @memberof DocumentsListRequest
*/
template?: boolean;
}
/**
* @export
*/
export const DocumentsListRequestDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type DocumentsListRequestDirectionEnum = typeof DocumentsListRequestDirectionEnum[keyof typeof DocumentsListRequestDirectionEnum];
/**
* Check if a given object implements the DocumentsListRequest interface.
*/
export function instanceOfDocumentsListRequest(value: object): value is DocumentsListRequest {
return true;
}
export function DocumentsListRequestFromJSON(json: any): DocumentsListRequest {
return DocumentsListRequestFromJSONTyped(json, false);
}
export function DocumentsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsListRequest {
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'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'userId': json['userId'] == null ? undefined : json['userId'],
'backlinkDocumentId': json['backlinkDocumentId'] == null ? undefined : json['backlinkDocumentId'],
'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'],
'template': json['template'] == null ? undefined : json['template'],
};
}
export function DocumentsListRequestToJSON(json: any): DocumentsListRequest {
return DocumentsListRequestToJSONTyped(json, false);
}
export function DocumentsListRequestToJSONTyped(value?: DocumentsListRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'sort': value['sort'],
'direction': value['direction'],
'collectionId': value['collectionId'],
'userId': value['userId'],
'backlinkDocumentId': value['backlinkDocumentId'],
'parentDocumentId': value['parentDocumentId'],
'template': value['template'],
};
}

View File

@@ -0,0 +1,74 @@
/* 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 DocumentsMembershipsRequest
*/
export interface DocumentsMembershipsRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsMembershipsRequest
*/
id: string;
/**
* If set, will filter the results by user name
* @type {string}
* @memberof DocumentsMembershipsRequest
*/
query?: string;
}
/**
* Check if a given object implements the DocumentsMembershipsRequest interface.
*/
export function instanceOfDocumentsMembershipsRequest(value: object): value is DocumentsMembershipsRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsMembershipsRequestFromJSON(json: any): DocumentsMembershipsRequest {
return DocumentsMembershipsRequestFromJSONTyped(json, false);
}
export function DocumentsMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMembershipsRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'query': json['query'] == null ? undefined : json['query'],
};
}
export function DocumentsMembershipsRequestToJSON(json: any): DocumentsMembershipsRequest {
return DocumentsMembershipsRequestToJSONTyped(json, false);
}
export function DocumentsMembershipsRequestToJSONTyped(value?: DocumentsMembershipsRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'query': value['query'],
};
}

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 { Policy } from './Policy';
import {
PolicyFromJSON,
PolicyFromJSONTyped,
PolicyToJSON,
PolicyToJSONTyped,
} from './Policy';
import type { DocumentsMove200ResponseData } from './DocumentsMove200ResponseData';
import {
DocumentsMove200ResponseDataFromJSON,
DocumentsMove200ResponseDataFromJSONTyped,
DocumentsMove200ResponseDataToJSON,
DocumentsMove200ResponseDataToJSONTyped,
} from './DocumentsMove200ResponseData';
/**
*
* @export
* @interface DocumentsMove200Response
*/
export interface DocumentsMove200Response {
/**
*
* @type {DocumentsMove200ResponseData}
* @memberof DocumentsMove200Response
*/
data?: DocumentsMove200ResponseData;
/**
*
* @type {Array<Policy>}
* @memberof DocumentsMove200Response
*/
policies?: Array<Policy>;
}
/**
* Check if a given object implements the DocumentsMove200Response interface.
*/
export function instanceOfDocumentsMove200Response(value: object): value is DocumentsMove200Response {
return true;
}
export function DocumentsMove200ResponseFromJSON(json: any): DocumentsMove200Response {
return DocumentsMove200ResponseFromJSONTyped(json, false);
}
export function DocumentsMove200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMove200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : DocumentsMove200ResponseDataFromJSON(json['data']),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
};
}
export function DocumentsMove200ResponseToJSON(json: any): DocumentsMove200Response {
return DocumentsMove200ResponseToJSONTyped(json, false);
}
export function DocumentsMove200ResponseToJSONTyped(value?: DocumentsMove200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': DocumentsMove200ResponseDataToJSON(value['data']),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
};
}

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 { Collection } from './Collection';
import {
CollectionFromJSON,
CollectionFromJSONTyped,
CollectionToJSON,
CollectionToJSONTyped,
} from './Collection';
import type { Document } from './Document';
import {
DocumentFromJSON,
DocumentFromJSONTyped,
DocumentToJSON,
DocumentToJSONTyped,
} from './Document';
/**
*
* @export
* @interface DocumentsMove200ResponseData
*/
export interface DocumentsMove200ResponseData {
/**
*
* @type {Array<Document>}
* @memberof DocumentsMove200ResponseData
*/
documents?: Array<Document>;
/**
*
* @type {Array<Collection>}
* @memberof DocumentsMove200ResponseData
*/
collections?: Array<Collection>;
}
/**
* Check if a given object implements the DocumentsMove200ResponseData interface.
*/
export function instanceOfDocumentsMove200ResponseData(value: object): value is DocumentsMove200ResponseData {
return true;
}
export function DocumentsMove200ResponseDataFromJSON(json: any): DocumentsMove200ResponseData {
return DocumentsMove200ResponseDataFromJSONTyped(json, false);
}
export function DocumentsMove200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMove200ResponseData {
if (json == null) {
return json;
}
return {
'documents': json['documents'] == null ? undefined : ((json['documents'] as Array<any>).map(DocumentFromJSON)),
'collections': json['collections'] == null ? undefined : ((json['collections'] as Array<any>).map(CollectionFromJSON)),
};
}
export function DocumentsMove200ResponseDataToJSON(json: any): DocumentsMove200ResponseData {
return DocumentsMove200ResponseDataToJSONTyped(json, false);
}
export function DocumentsMove200ResponseDataToJSONTyped(value?: DocumentsMove200ResponseData | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'documents': value['documents'] == null ? undefined : ((value['documents'] as Array<any>).map(DocumentToJSON)),
'collections': value['collections'] == null ? undefined : ((value['collections'] as Array<any>).map(CollectionToJSON)),
};
}

View File

@@ -0,0 +1,82 @@
/* 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 DocumentsMoveRequest
*/
export interface DocumentsMoveRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsMoveRequest
*/
id: string;
/**
*
* @type {string}
* @memberof DocumentsMoveRequest
*/
collectionId?: string;
/**
*
* @type {string}
* @memberof DocumentsMoveRequest
*/
parentDocumentId?: string;
}
/**
* Check if a given object implements the DocumentsMoveRequest interface.
*/
export function instanceOfDocumentsMoveRequest(value: object): value is DocumentsMoveRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsMoveRequestFromJSON(json: any): DocumentsMoveRequest {
return DocumentsMoveRequestFromJSONTyped(json, false);
}
export function DocumentsMoveRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMoveRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'],
};
}
export function DocumentsMoveRequestToJSON(json: any): DocumentsMoveRequest {
return DocumentsMoveRequestToJSONTyped(json, false);
}
export function DocumentsMoveRequestToJSONTyped(value?: DocumentsMoveRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'collectionId': value['collectionId'],
'parentDocumentId': value['parentDocumentId'],
};
}

View File

@@ -0,0 +1,75 @@
/* 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 DocumentsRemoveUserRequest
*/
export interface DocumentsRemoveUserRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsRemoveUserRequest
*/
id: string;
/**
*
* @type {string}
* @memberof DocumentsRemoveUserRequest
*/
userId: string;
}
/**
* Check if a given object implements the DocumentsRemoveUserRequest interface.
*/
export function instanceOfDocumentsRemoveUserRequest(value: object): value is DocumentsRemoveUserRequest {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('userId' in value) || value['userId'] === undefined) return false;
return true;
}
export function DocumentsRemoveUserRequestFromJSON(json: any): DocumentsRemoveUserRequest {
return DocumentsRemoveUserRequestFromJSONTyped(json, false);
}
export function DocumentsRemoveUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsRemoveUserRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'userId': json['userId'],
};
}
export function DocumentsRemoveUserRequestToJSON(json: any): DocumentsRemoveUserRequest {
return DocumentsRemoveUserRequestToJSONTyped(json, false);
}
export function DocumentsRemoveUserRequestToJSONTyped(value?: DocumentsRemoveUserRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'userId': value['userId'],
};
}

View File

@@ -0,0 +1,74 @@
/* 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 DocumentsRestoreRequest
*/
export interface DocumentsRestoreRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsRestoreRequest
*/
id: string;
/**
* Identifier for the revision to restore to.
* @type {string}
* @memberof DocumentsRestoreRequest
*/
revisionId?: string;
}
/**
* Check if a given object implements the DocumentsRestoreRequest interface.
*/
export function instanceOfDocumentsRestoreRequest(value: object): value is DocumentsRestoreRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsRestoreRequestFromJSON(json: any): DocumentsRestoreRequest {
return DocumentsRestoreRequestFromJSONTyped(json, false);
}
export function DocumentsRestoreRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsRestoreRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'revisionId': json['revisionId'] == null ? undefined : json['revisionId'],
};
}
export function DocumentsRestoreRequestToJSON(json: any): DocumentsRestoreRequest {
return DocumentsRestoreRequestToJSONTyped(json, false);
}
export function DocumentsRestoreRequestToJSONTyped(value?: DocumentsRestoreRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'revisionId': value['revisionId'],
};
}

View File

@@ -0,0 +1,103 @@
/* 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 { Policy } from './Policy';
import {
PolicyFromJSON,
PolicyFromJSONTyped,
PolicyToJSON,
PolicyToJSONTyped,
} from './Policy';
import type { Pagination } from './Pagination';
import {
PaginationFromJSON,
PaginationFromJSONTyped,
PaginationToJSON,
PaginationToJSONTyped,
} from './Pagination';
import type { DocumentsSearch200ResponseDataInner } from './DocumentsSearch200ResponseDataInner';
import {
DocumentsSearch200ResponseDataInnerFromJSON,
DocumentsSearch200ResponseDataInnerFromJSONTyped,
DocumentsSearch200ResponseDataInnerToJSON,
DocumentsSearch200ResponseDataInnerToJSONTyped,
} from './DocumentsSearch200ResponseDataInner';
/**
*
* @export
* @interface DocumentsSearch200Response
*/
export interface DocumentsSearch200Response {
/**
*
* @type {Array<DocumentsSearch200ResponseDataInner>}
* @memberof DocumentsSearch200Response
*/
data?: Array<DocumentsSearch200ResponseDataInner>;
/**
*
* @type {Array<Policy>}
* @memberof DocumentsSearch200Response
*/
policies?: Array<Policy>;
/**
*
* @type {Pagination}
* @memberof DocumentsSearch200Response
*/
pagination?: Pagination;
}
/**
* Check if a given object implements the DocumentsSearch200Response interface.
*/
export function instanceOfDocumentsSearch200Response(value: object): value is DocumentsSearch200Response {
return true;
}
export function DocumentsSearch200ResponseFromJSON(json: any): DocumentsSearch200Response {
return DocumentsSearch200ResponseFromJSONTyped(json, false);
}
export function DocumentsSearch200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsSearch200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(DocumentsSearch200ResponseDataInnerFromJSON)),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
};
}
export function DocumentsSearch200ResponseToJSON(json: any): DocumentsSearch200Response {
return DocumentsSearch200ResponseToJSONTyped(json, false);
}
export function DocumentsSearch200ResponseToJSONTyped(value?: DocumentsSearch200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(DocumentsSearch200ResponseDataInnerToJSON)),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
'pagination': PaginationToJSON(value['pagination']),
};
}

View File

@@ -0,0 +1,89 @@
/* 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 { Document } from './Document';
import {
DocumentFromJSON,
DocumentFromJSONTyped,
DocumentToJSON,
DocumentToJSONTyped,
} from './Document';
/**
*
* @export
* @interface DocumentsSearch200ResponseDataInner
*/
export interface DocumentsSearch200ResponseDataInner {
/**
* A short snippet of context from the document that includes the search query.
* @type {string}
* @memberof DocumentsSearch200ResponseDataInner
*/
context?: string;
/**
* The ranking used to order search results based on relevance.
* @type {number}
* @memberof DocumentsSearch200ResponseDataInner
*/
ranking?: number;
/**
*
* @type {Document}
* @memberof DocumentsSearch200ResponseDataInner
*/
document?: Document;
}
/**
* Check if a given object implements the DocumentsSearch200ResponseDataInner interface.
*/
export function instanceOfDocumentsSearch200ResponseDataInner(value: object): value is DocumentsSearch200ResponseDataInner {
return true;
}
export function DocumentsSearch200ResponseDataInnerFromJSON(json: any): DocumentsSearch200ResponseDataInner {
return DocumentsSearch200ResponseDataInnerFromJSONTyped(json, false);
}
export function DocumentsSearch200ResponseDataInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsSearch200ResponseDataInner {
if (json == null) {
return json;
}
return {
'context': json['context'] == null ? undefined : json['context'],
'ranking': json['ranking'] == null ? undefined : json['ranking'],
'document': json['document'] == null ? undefined : DocumentFromJSON(json['document']),
};
}
export function DocumentsSearch200ResponseDataInnerToJSON(json: any): DocumentsSearch200ResponseDataInner {
return DocumentsSearch200ResponseDataInnerToJSONTyped(json, false);
}
export function DocumentsSearch200ResponseDataInnerToJSONTyped(value?: DocumentsSearch200ResponseDataInner | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'context': value['context'],
'ranking': value['ranking'],
'document': DocumentToJSON(value['document']),
};
}

View 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 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 DocumentsSearchRequest
*/
export interface DocumentsSearchRequest {
/**
*
* @type {number}
* @memberof DocumentsSearchRequest
*/
offset?: number;
/**
*
* @type {number}
* @memberof DocumentsSearchRequest
*/
limit?: number;
/**
*
* @type {string}
* @memberof DocumentsSearchRequest
*/
query?: string;
/**
* Any documents that have not been edited by the user identifier will be filtered out
* @type {string}
* @memberof DocumentsSearchRequest
*/
userId?: string;
/**
* A collection to search within
* @type {string}
* @memberof DocumentsSearchRequest
*/
collectionId?: string;
/**
* A document to search within
* @type {string}
* @memberof DocumentsSearchRequest
*/
documentId?: string;
/**
* Any documents that are not in the specified status will be filtered out
* @type {string}
* @memberof DocumentsSearchRequest
*/
statusFilter?: DocumentsSearchRequestStatusFilterEnum;
/**
* Any documents that have not been updated within the specified period will be filtered out
* @type {string}
* @memberof DocumentsSearchRequest
*/
dateFilter?: DocumentsSearchRequestDateFilterEnum;
}
/**
* @export
*/
export const DocumentsSearchRequestStatusFilterEnum = {
Draft: 'draft',
Archived: 'archived',
Published: 'published'
} as const;
export type DocumentsSearchRequestStatusFilterEnum = typeof DocumentsSearchRequestStatusFilterEnum[keyof typeof DocumentsSearchRequestStatusFilterEnum];
/**
* @export
*/
export const DocumentsSearchRequestDateFilterEnum = {
Day: 'day',
Week: 'week',
Month: 'month',
Year: 'year'
} as const;
export type DocumentsSearchRequestDateFilterEnum = typeof DocumentsSearchRequestDateFilterEnum[keyof typeof DocumentsSearchRequestDateFilterEnum];
/**
* Check if a given object implements the DocumentsSearchRequest interface.
*/
export function instanceOfDocumentsSearchRequest(value: object): value is DocumentsSearchRequest {
return true;
}
export function DocumentsSearchRequestFromJSON(json: any): DocumentsSearchRequest {
return DocumentsSearchRequestFromJSONTyped(json, false);
}
export function DocumentsSearchRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsSearchRequest {
if (json == null) {
return json;
}
return {
'offset': json['offset'] == null ? undefined : json['offset'],
'limit': json['limit'] == null ? undefined : json['limit'],
'query': json['query'] == null ? undefined : json['query'],
'userId': json['userId'] == null ? undefined : json['userId'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'documentId': json['documentId'] == null ? undefined : json['documentId'],
'statusFilter': json['statusFilter'] == null ? undefined : json['statusFilter'],
'dateFilter': json['dateFilter'] == null ? undefined : json['dateFilter'],
};
}
export function DocumentsSearchRequestToJSON(json: any): DocumentsSearchRequest {
return DocumentsSearchRequestToJSONTyped(json, false);
}
export function DocumentsSearchRequestToJSONTyped(value?: DocumentsSearchRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'query': value['query'],
'userId': value['userId'],
'collectionId': value['collectionId'],
'documentId': value['documentId'],
'statusFilter': value['statusFilter'],
'dateFilter': value['dateFilter'],
};
}

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 DocumentsUnpublishRequest
*/
export interface DocumentsUnpublishRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsUnpublishRequest
*/
id: string;
}
/**
* Check if a given object implements the DocumentsUnpublishRequest interface.
*/
export function instanceOfDocumentsUnpublishRequest(value: object): value is DocumentsUnpublishRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsUnpublishRequestFromJSON(json: any): DocumentsUnpublishRequest {
return DocumentsUnpublishRequestFromJSONTyped(json, false);
}
export function DocumentsUnpublishRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUnpublishRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
};
}
export function DocumentsUnpublishRequestToJSON(json: any): DocumentsUnpublishRequest {
return DocumentsUnpublishRequestToJSONTyped(json, false);
}
export function DocumentsUnpublishRequestToJSONTyped(value?: DocumentsUnpublishRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
};
}

View File

@@ -0,0 +1,106 @@
/* 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 DocumentsUpdateRequest
*/
export interface DocumentsUpdateRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsUpdateRequest
*/
id: string;
/**
* The title of the document.
* @type {string}
* @memberof DocumentsUpdateRequest
*/
title?: string;
/**
* The body of the document in markdown.
* @type {string}
* @memberof DocumentsUpdateRequest
*/
text?: string;
/**
* If true the text field will be appended to the end of the existing document, rather than the default behavior of replacing it. This is potentially useful for things like logging into a document.
* @type {boolean}
* @memberof DocumentsUpdateRequest
*/
append?: boolean;
/**
* Whether this document should be published and made visible to other team members, if a draft
* @type {boolean}
* @memberof DocumentsUpdateRequest
*/
publish?: boolean;
/**
* Whether the editing session has finished, this will trigger any notifications. This property will soon be deprecated.
* @type {boolean}
* @memberof DocumentsUpdateRequest
*/
done?: boolean;
}
/**
* Check if a given object implements the DocumentsUpdateRequest interface.
*/
export function instanceOfDocumentsUpdateRequest(value: object): value is DocumentsUpdateRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsUpdateRequestFromJSON(json: any): DocumentsUpdateRequest {
return DocumentsUpdateRequestFromJSONTyped(json, false);
}
export function DocumentsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUpdateRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'title': json['title'] == null ? undefined : json['title'],
'text': json['text'] == null ? undefined : json['text'],
'append': json['append'] == null ? undefined : json['append'],
'publish': json['publish'] == null ? undefined : json['publish'],
'done': json['done'] == null ? undefined : json['done'],
};
}
export function DocumentsUpdateRequestToJSON(json: any): DocumentsUpdateRequest {
return DocumentsUpdateRequestToJSONTyped(json, false);
}
export function DocumentsUpdateRequestToJSONTyped(value?: DocumentsUpdateRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'title': value['title'],
'text': value['text'],
'append': value['append'],
'publish': value['publish'],
'done': value['done'],
};
}

View File

@@ -0,0 +1,103 @@
/* 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 { Policy } from './Policy';
import {
PolicyFromJSON,
PolicyFromJSONTyped,
PolicyToJSON,
PolicyToJSONTyped,
} from './Policy';
import type { Pagination } from './Pagination';
import {
PaginationFromJSON,
PaginationFromJSONTyped,
PaginationToJSON,
PaginationToJSONTyped,
} from './Pagination';
import type { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
UserToJSONTyped,
} from './User';
/**
*
* @export
* @interface DocumentsUsers200Response
*/
export interface DocumentsUsers200Response {
/**
*
* @type {Array<User>}
* @memberof DocumentsUsers200Response
*/
data?: Array<User>;
/**
*
* @type {Pagination}
* @memberof DocumentsUsers200Response
*/
pagination?: Pagination;
/**
*
* @type {Array<Policy>}
* @memberof DocumentsUsers200Response
*/
policies?: Array<Policy>;
}
/**
* Check if a given object implements the DocumentsUsers200Response interface.
*/
export function instanceOfDocumentsUsers200Response(value: object): value is DocumentsUsers200Response {
return true;
}
export function DocumentsUsers200ResponseFromJSON(json: any): DocumentsUsers200Response {
return DocumentsUsers200ResponseFromJSONTyped(json, false);
}
export function DocumentsUsers200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUsers200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(UserFromJSON)),
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
};
}
export function DocumentsUsers200ResponseToJSON(json: any): DocumentsUsers200Response {
return DocumentsUsers200ResponseToJSONTyped(json, false);
}
export function DocumentsUsers200ResponseToJSONTyped(value?: DocumentsUsers200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(UserToJSON)),
'pagination': PaginationToJSON(value['pagination']),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
};
}

View File

@@ -0,0 +1,74 @@
/* 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 DocumentsUsersRequest
*/
export interface DocumentsUsersRequest {
/**
* Unique identifier for the document. Either the UUID or the urlId is acceptable.
* @type {string}
* @memberof DocumentsUsersRequest
*/
id: string;
/**
* If set, will filter the results by user name.
* @type {string}
* @memberof DocumentsUsersRequest
*/
query?: string;
}
/**
* Check if a given object implements the DocumentsUsersRequest interface.
*/
export function instanceOfDocumentsUsersRequest(value: object): value is DocumentsUsersRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function DocumentsUsersRequestFromJSON(json: any): DocumentsUsersRequest {
return DocumentsUsersRequestFromJSONTyped(json, false);
}
export function DocumentsUsersRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUsersRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'query': json['query'] == null ? undefined : json['query'],
};
}
export function DocumentsUsersRequestToJSON(json: any): DocumentsUsersRequest {
return DocumentsUsersRequestToJSONTyped(json, false);
}
export function DocumentsUsersRequestToJSONTyped(value?: DocumentsUsersRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'query': value['query'],
};
}

View File

@@ -0,0 +1,100 @@
/* 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 DocumentsViewedRequest
*/
export interface DocumentsViewedRequest {
/**
*
* @type {number}
* @memberof DocumentsViewedRequest
*/
offset?: number;
/**
*
* @type {number}
* @memberof DocumentsViewedRequest
*/
limit?: number;
/**
*
* @type {string}
* @memberof DocumentsViewedRequest
*/
sort?: string;
/**
*
* @type {string}
* @memberof DocumentsViewedRequest
*/
direction?: DocumentsViewedRequestDirectionEnum;
}
/**
* @export
*/
export const DocumentsViewedRequestDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type DocumentsViewedRequestDirectionEnum = typeof DocumentsViewedRequestDirectionEnum[keyof typeof DocumentsViewedRequestDirectionEnum];
/**
* Check if a given object implements the DocumentsViewedRequest interface.
*/
export function instanceOfDocumentsViewedRequest(value: object): value is DocumentsViewedRequest {
return true;
}
export function DocumentsViewedRequestFromJSON(json: any): DocumentsViewedRequest {
return DocumentsViewedRequestFromJSONTyped(json, false);
}
export function DocumentsViewedRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsViewedRequest {
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'],
};
}
export function DocumentsViewedRequestToJSON(json: any): DocumentsViewedRequest {
return DocumentsViewedRequestToJSONTyped(json, false);
}
export function DocumentsViewedRequestToJSONTyped(value?: DocumentsViewedRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'sort': value['sort'],
'direction': value['direction'],
};
}