add rest of models

This commit is contained in:
2025-07-15 18:01:32 +02:00
parent ae054416dd
commit 44168374dd
23 changed files with 2345 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
/* 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.
*/
/**
* @type Ability
* A single permission granted by a policy
* @export
*/
export type Ability = Array<string> | boolean;
export function AbilityFromJSON(json: any): Ability {
return AbilityFromJSONTyped(json, false);
}
export function AbilityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ability {
if (json == null) {
return json;
}
return {} as any;
}
export function AbilityToJSON(json: any): any {
return AbilityToJSONTyped(json, false);
}
export function AbilityToJSONTyped(value?: Ability | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {};
}

View File

@@ -0,0 +1,136 @@
/* 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 Event
*/
export interface Event {
/**
* Unique identifier for the object.
* @type {string}
* @memberof Event
*/
readonly id?: string;
/**
*
* @type {string}
* @memberof Event
*/
readonly name?: string;
/**
* Identifier for the object this event is associated with when it is not one of document, collection, or user.
* @type {string}
* @memberof Event
*/
readonly modelId?: string;
/**
* The user that performed the action.
* @type {string}
* @memberof Event
*/
readonly actorId?: string;
/**
* The ip address the action was performed from. This field is only returned when the `auditLog` boolean is true.
* @type {string}
* @memberof Event
*/
readonly actorIpAddress?: string;
/**
* Identifier for the associated collection, if any
* @type {string}
* @memberof Event
*/
readonly collectionId?: string;
/**
* Identifier for the associated document, if any
* @type {string}
* @memberof Event
*/
readonly documentId?: string;
/**
* The date and time that this event was created
* @type {Date}
* @memberof Event
*/
readonly createdAt?: Date;
/**
* Additional unstructured data associated with the event
* @type {object}
* @memberof Event
*/
readonly data?: object;
/**
*
* @type {User}
* @memberof Event
*/
actor?: User;
}
/**
* Check if a given object implements the Event interface.
*/
export function instanceOfEvent(value: object): value is Event {
return true;
}
export function EventFromJSON(json: any): Event {
return EventFromJSONTyped(json, false);
}
export function EventFromJSONTyped(json: any, ignoreDiscriminator: boolean): Event {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'name': json['name'] == null ? undefined : json['name'],
'modelId': json['modelId'] == null ? undefined : json['modelId'],
'actorId': json['actorId'] == null ? undefined : json['actorId'],
'actorIpAddress': json['actorIpAddress'] == null ? undefined : json['actorIpAddress'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'documentId': json['documentId'] == null ? undefined : json['documentId'],
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
'data': json['data'] == null ? undefined : json['data'],
'actor': json['actor'] == null ? undefined : UserFromJSON(json['actor']),
};
}
export function EventToJSON(json: any): Event {
return EventToJSONTyped(json, false);
}
export function EventToJSONTyped(value?: Omit<Event, 'id'|'name'|'modelId'|'actorId'|'actorIpAddress'|'collectionId'|'documentId'|'createdAt'|'data'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'actor': UserToJSON(value['actor']),
};
}

View File

@@ -0,0 +1,88 @@
/* tslint:disable */
/* eslint-disable */
/**
* Outline API
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outlines data in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if thats your jam it can be used to generate clients for most programming languages. # Making requests Outlines API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, heres an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If theres an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code these can be used in an interface to adjust which elements are visible.
*
* The version of the OpenAPI document: 0.1.0
* Contact: hello@getoutline.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
import { mapValues } from '../runtime';
import type { Pagination } from './Pagination';
import {
PaginationFromJSON,
PaginationFromJSONTyped,
PaginationToJSON,
PaginationToJSONTyped,
} from './Pagination';
import type { Event } from './Event';
import {
EventFromJSON,
EventFromJSONTyped,
EventToJSON,
EventToJSONTyped,
} from './Event';
/**
*
* @export
* @interface EventsList200Response
*/
export interface EventsList200Response {
/**
*
* @type {Array<Event>}
* @memberof EventsList200Response
*/
data?: Array<Event>;
/**
*
* @type {Pagination}
* @memberof EventsList200Response
*/
pagination?: Pagination;
}
/**
* Check if a given object implements the EventsList200Response interface.
*/
export function instanceOfEventsList200Response(value: object): value is EventsList200Response {
return true;
}
export function EventsList200ResponseFromJSON(json: any): EventsList200Response {
return EventsList200ResponseFromJSONTyped(json, false);
}
export function EventsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsList200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(EventFromJSON)),
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
};
}
export function EventsList200ResponseToJSON(json: any): EventsList200Response {
return EventsList200ResponseToJSONTyped(json, false);
}
export function EventsList200ResponseToJSONTyped(value?: EventsList200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(EventToJSON)),
'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 EventsListRequest
*/
export interface EventsListRequest {
/**
*
* @type {number}
* @memberof EventsListRequest
*/
offset?: number;
/**
*
* @type {number}
* @memberof EventsListRequest
*/
limit?: number;
/**
*
* @type {string}
* @memberof EventsListRequest
*/
sort?: string;
/**
*
* @type {string}
* @memberof EventsListRequest
*/
direction?: EventsListRequestDirectionEnum;
/**
* Filter to a specific event, e.g. "collections.create". Event names are in the format "objects.verb"
* @type {string}
* @memberof EventsListRequest
*/
name?: string;
/**
* Filter to events performed by the selected user
* @type {string}
* @memberof EventsListRequest
*/
actorId?: string;
/**
* Filter to events performed in the selected document
* @type {string}
* @memberof EventsListRequest
*/
documentId?: string;
/**
* Filter to events performed in the selected collection
* @type {string}
* @memberof EventsListRequest
*/
collectionId?: string;
/**
* Whether to return detailed events suitable for an audit log. Without this flag less detailed event types will be returned.
* @type {boolean}
* @memberof EventsListRequest
*/
auditLog?: boolean;
}
/**
* @export
*/
export const EventsListRequestDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type EventsListRequestDirectionEnum = typeof EventsListRequestDirectionEnum[keyof typeof EventsListRequestDirectionEnum];
/**
* Check if a given object implements the EventsListRequest interface.
*/
export function instanceOfEventsListRequest(value: object): value is EventsListRequest {
return true;
}
export function EventsListRequestFromJSON(json: any): EventsListRequest {
return EventsListRequestFromJSONTyped(json, false);
}
export function EventsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsListRequest {
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'],
'name': json['name'] == null ? undefined : json['name'],
'actorId': json['actorId'] == null ? undefined : json['actorId'],
'documentId': json['documentId'] == null ? undefined : json['documentId'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'auditLog': json['auditLog'] == null ? undefined : json['auditLog'],
};
}
export function EventsListRequestToJSON(json: any): EventsListRequest {
return EventsListRequestToJSONTyped(json, false);
}
export function EventsListRequestToJSONTyped(value?: EventsListRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'sort': value['sort'],
'direction': value['direction'],
'name': value['name'],
'actorId': value['actorId'],
'documentId': value['documentId'],
'collectionId': value['collectionId'],
'auditLog': value['auditLog'],
};
}

View File

@@ -0,0 +1,81 @@
/* 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 InlineObject
*/
export interface InlineObject {
/**
*
* @type {boolean}
* @memberof InlineObject
*/
ok?: boolean;
/**
*
* @type {string}
* @memberof InlineObject
*/
error?: string;
/**
*
* @type {number}
* @memberof InlineObject
*/
status?: number;
}
/**
* Check if a given object implements the InlineObject interface.
*/
export function instanceOfInlineObject(value: object): value is InlineObject {
return true;
}
export function InlineObjectFromJSON(json: any): InlineObject {
return InlineObjectFromJSONTyped(json, false);
}
export function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineObject {
if (json == null) {
return json;
}
return {
'ok': json['ok'] == null ? undefined : json['ok'],
'error': json['error'] == null ? undefined : json['error'],
'status': json['status'] == null ? undefined : json['status'],
};
}
export function InlineObjectToJSON(json: any): InlineObject {
return InlineObjectToJSONTyped(json, false);
}
export function InlineObjectToJSONTyped(value?: InlineObject | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'ok': value['ok'],
'error': value['error'],
'status': value['status'],
};
}

View File

@@ -0,0 +1,91 @@
/* 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 { UserRole } from './UserRole';
import {
UserRoleFromJSON,
UserRoleFromJSONTyped,
UserRoleToJSON,
UserRoleToJSONTyped,
} from './UserRole';
/**
*
* @export
* @interface Invite
*/
export interface Invite {
/**
* The full name of the user being invited
* @type {string}
* @memberof Invite
*/
name?: string;
/**
* The email address to invite
* @type {string}
* @memberof Invite
*/
email?: string;
/**
*
* @type {UserRole}
* @memberof Invite
*/
role?: UserRole;
}
/**
* Check if a given object implements the Invite interface.
*/
export function instanceOfInvite(value: object): value is Invite {
return true;
}
export function InviteFromJSON(json: any): Invite {
return InviteFromJSONTyped(json, false);
}
export function InviteFromJSONTyped(json: any, ignoreDiscriminator: boolean): Invite {
if (json == null) {
return json;
}
return {
'name': json['name'] == null ? undefined : json['name'],
'email': json['email'] == null ? undefined : json['email'],
'role': json['role'] == null ? undefined : UserRoleFromJSON(json['role']),
};
}
export function InviteToJSON(json: any): Invite {
return InviteToJSONTyped(json, false);
}
export function InviteToJSONTyped(value?: Invite | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'email': value['email'],
'role': UserRoleToJSON(value['role']),
};
}

View File

@@ -0,0 +1,96 @@
/* 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 Membership
*/
export interface Membership {
/**
* Unique identifier for the object.
* @type {string}
* @memberof Membership
*/
readonly id?: string;
/**
* Identifier for the associated user.
* @type {string}
* @memberof Membership
*/
readonly userId?: string;
/**
* Identifier for the associated collection.
* @type {string}
* @memberof Membership
*/
readonly collectionId?: string;
/**
*
* @type {Permission}
* @memberof Membership
*/
permission?: Permission;
}
/**
* Check if a given object implements the Membership interface.
*/
export function instanceOfMembership(value: object): value is Membership {
return true;
}
export function MembershipFromJSON(json: any): Membership {
return MembershipFromJSONTyped(json, false);
}
export function MembershipFromJSONTyped(json: any, ignoreDiscriminator: boolean): Membership {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'userId': json['userId'] == null ? undefined : json['userId'],
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
};
}
export function MembershipToJSON(json: any): Membership {
return MembershipToJSONTyped(json, false);
}
export function MembershipToJSONTyped(value?: Omit<Membership, 'id'|'userId'|'collectionId'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'permission': PermissionToJSON(value['permission']),
};
}

View File

@@ -0,0 +1,97 @@
/* 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 ModelError
*/
export interface ModelError {
/**
*
* @type {boolean}
* @memberof ModelError
*/
ok?: boolean;
/**
*
* @type {string}
* @memberof ModelError
*/
error?: string;
/**
*
* @type {string}
* @memberof ModelError
*/
message?: string;
/**
*
* @type {number}
* @memberof ModelError
*/
status?: number;
/**
*
* @type {object}
* @memberof ModelError
*/
data?: object;
}
/**
* Check if a given object implements the ModelError interface.
*/
export function instanceOfModelError(value: object): value is ModelError {
return true;
}
export function ModelErrorFromJSON(json: any): ModelError {
return ModelErrorFromJSONTyped(json, false);
}
export function ModelErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelError {
if (json == null) {
return json;
}
return {
'ok': json['ok'] == null ? undefined : json['ok'],
'error': json['error'] == null ? undefined : json['error'],
'message': json['message'] == null ? undefined : json['message'],
'status': json['status'] == null ? undefined : json['status'],
'data': json['data'] == null ? undefined : json['data'],
};
}
export function ModelErrorToJSON(json: any): ModelError {
return ModelErrorToJSONTyped(json, false);
}
export function ModelErrorToJSONTyped(value?: ModelError | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'ok': value['ok'],
'error': value['error'],
'message': value['message'],
'status': value['status'],
'data': value['data'],
};
}

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';
/**
*
* @export
* @interface NavigationNode
*/
export interface NavigationNode {
/**
* Unique identifier for the document.
* @type {string}
* @memberof NavigationNode
*/
id?: string;
/**
*
* @type {string}
* @memberof NavigationNode
*/
title?: string;
/**
*
* @type {string}
* @memberof NavigationNode
*/
url?: string;
/**
*
* @type {Array<NavigationNode>}
* @memberof NavigationNode
*/
children?: Array<NavigationNode>;
}
/**
* Check if a given object implements the NavigationNode interface.
*/
export function instanceOfNavigationNode(value: object): value is NavigationNode {
return true;
}
export function NavigationNodeFromJSON(json: any): NavigationNode {
return NavigationNodeFromJSONTyped(json, false);
}
export function NavigationNodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): NavigationNode {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'title': json['title'] == null ? undefined : json['title'],
'url': json['url'] == null ? undefined : json['url'],
'children': json['children'] == null ? undefined : ((json['children'] as Array<any>).map(NavigationNodeFromJSON)),
};
}
export function NavigationNodeToJSON(json: any): NavigationNode {
return NavigationNodeToJSONTyped(json, false);
}
export function NavigationNodeToJSONTyped(value?: NavigationNode | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'title': value['title'],
'url': value['url'],
'children': value['children'] == null ? undefined : ((value['children'] as Array<any>).map(NavigationNodeToJSON)),
};
}

View File

@@ -0,0 +1,148 @@
/* 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 OAuthClient
*/
export interface OAuthClient {
/**
* Unique identifier for the object.
* @type {string}
* @memberof OAuthClient
*/
readonly id?: string;
/**
* The name of this OAuth client.
* @type {string}
* @memberof OAuthClient
*/
name?: string;
/**
* A short description of this OAuth client.
* @type {string}
* @memberof OAuthClient
*/
description?: string;
/**
* The name of the developer who created this OAuth client.
* @type {string}
* @memberof OAuthClient
*/
developerName?: string;
/**
* The URL of the developer who created this OAuth client.
* @type {string}
* @memberof OAuthClient
*/
developerUrl?: string;
/**
* A URL pointing to an image representing the OAuth client.
* @type {string}
* @memberof OAuthClient
*/
avatarUrl?: string;
/**
* The client ID for the OAuth client.
* @type {string}
* @memberof OAuthClient
*/
readonly clientId?: string;
/**
* The client secret for the OAuth client.
* @type {string}
* @memberof OAuthClient
*/
readonly clientSecret?: string;
/**
* The redirect URIs for the OAuth client.
* @type {Array<string>}
* @memberof OAuthClient
*/
redirectUris?: Array<string>;
/**
* Whether the OAuth client is available to other workspaces.
* @type {boolean}
* @memberof OAuthClient
*/
published?: boolean;
/**
* Date and time when this OAuth client was created
* @type {Date}
* @memberof OAuthClient
*/
readonly createdAt?: Date;
/**
* Date and time when this OAuth client was updated
* @type {Date}
* @memberof OAuthClient
*/
readonly updatedAt?: Date;
}
/**
* Check if a given object implements the OAuthClient interface.
*/
export function instanceOfOAuthClient(value: object): value is OAuthClient {
return true;
}
export function OAuthClientFromJSON(json: any): OAuthClient {
return OAuthClientFromJSONTyped(json, false);
}
export function OAuthClientFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuthClient {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'name': json['name'] == null ? undefined : json['name'],
'description': json['description'] == null ? undefined : json['description'],
'developerName': json['developerName'] == null ? undefined : json['developerName'],
'developerUrl': json['developerUrl'] == null ? undefined : json['developerUrl'],
'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'],
'clientId': json['clientId'] == null ? undefined : json['clientId'],
'clientSecret': json['clientSecret'] == null ? undefined : json['clientSecret'],
'redirectUris': json['redirectUris'] == null ? undefined : json['redirectUris'],
'published': json['published'] == null ? undefined : json['published'],
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
};
}
export function OAuthClientToJSON(json: any): OAuthClient {
return OAuthClientToJSONTyped(json, false);
}
export function OAuthClientToJSONTyped(value?: Omit<OAuthClient, 'id'|'clientId'|'clientSecret'|'createdAt'|'updatedAt'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'description': value['description'],
'developerName': value['developerName'],
'developerUrl': value['developerUrl'],
'avatarUrl': value['avatarUrl'],
'redirectUris': value['redirectUris'],
'published': value['published'],
};
}

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 OauthClientsCreateRequest
*/
export interface OauthClientsCreateRequest {
/**
* Name of the OAuth client.
* @type {string}
* @memberof OauthClientsCreateRequest
*/
name: string;
/**
* A short description of this OAuth client.
* @type {string}
* @memberof OauthClientsCreateRequest
*/
description?: string;
/**
* The name of the developer who created this OAuth client.
* @type {string}
* @memberof OauthClientsCreateRequest
*/
developerName?: string;
/**
* The URL of the developer who created this OAuth client.
* @type {string}
* @memberof OauthClientsCreateRequest
*/
developerUrl?: string;
/**
* A URL pointing to an image representing the OAuth client.
* @type {string}
* @memberof OauthClientsCreateRequest
*/
avatarUrl?: string;
/**
* List of redirect URIs for the OAuth client.
* @type {Array<string>}
* @memberof OauthClientsCreateRequest
*/
redirectUris: Array<string>;
/**
* Whether the OAuth client is available to other workspaces.
* @type {boolean}
* @memberof OauthClientsCreateRequest
*/
published?: boolean;
}
/**
* Check if a given object implements the OauthClientsCreateRequest interface.
*/
export function instanceOfOauthClientsCreateRequest(value: object): value is OauthClientsCreateRequest {
if (!('name' in value) || value['name'] === undefined) return false;
if (!('redirectUris' in value) || value['redirectUris'] === undefined) return false;
return true;
}
export function OauthClientsCreateRequestFromJSON(json: any): OauthClientsCreateRequest {
return OauthClientsCreateRequestFromJSONTyped(json, false);
}
export function OauthClientsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsCreateRequest {
if (json == null) {
return json;
}
return {
'name': json['name'],
'description': json['description'] == null ? undefined : json['description'],
'developerName': json['developerName'] == null ? undefined : json['developerName'],
'developerUrl': json['developerUrl'] == null ? undefined : json['developerUrl'],
'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'],
'redirectUris': json['redirectUris'],
'published': json['published'] == null ? undefined : json['published'],
};
}
export function OauthClientsCreateRequestToJSON(json: any): OauthClientsCreateRequest {
return OauthClientsCreateRequestToJSONTyped(json, false);
}
export function OauthClientsCreateRequestToJSONTyped(value?: OauthClientsCreateRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'description': value['description'],
'developerName': value['developerName'],
'developerUrl': value['developerUrl'],
'avatarUrl': value['avatarUrl'],
'redirectUris': value['redirectUris'],
'published': value['published'],
};
}

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 { OAuthClient } from './OAuthClient';
import {
OAuthClientFromJSON,
OAuthClientFromJSONTyped,
OAuthClientToJSON,
OAuthClientToJSONTyped,
} from './OAuthClient';
/**
*
* @export
* @interface OauthClientsInfo200Response
*/
export interface OauthClientsInfo200Response {
/**
*
* @type {OAuthClient}
* @memberof OauthClientsInfo200Response
*/
data?: OAuthClient;
/**
*
* @type {Array<Policy>}
* @memberof OauthClientsInfo200Response
*/
policies?: Array<Policy>;
}
/**
* Check if a given object implements the OauthClientsInfo200Response interface.
*/
export function instanceOfOauthClientsInfo200Response(value: object): value is OauthClientsInfo200Response {
return true;
}
export function OauthClientsInfo200ResponseFromJSON(json: any): OauthClientsInfo200Response {
return OauthClientsInfo200ResponseFromJSONTyped(json, false);
}
export function OauthClientsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsInfo200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : OAuthClientFromJSON(json['data']),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
};
}
export function OauthClientsInfo200ResponseToJSON(json: any): OauthClientsInfo200Response {
return OauthClientsInfo200ResponseToJSONTyped(json, false);
}
export function OauthClientsInfo200ResponseToJSONTyped(value?: OauthClientsInfo200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': OAuthClientToJSON(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 OauthClientsInfoRequest
*/
export interface OauthClientsInfoRequest {
/**
* Unique identifier for the OAuth client.
* @type {string}
* @memberof OauthClientsInfoRequest
*/
id?: string;
/**
* Public identifier for the OAuth client.
* @type {string}
* @memberof OauthClientsInfoRequest
*/
clientId?: string;
}
/**
* Check if a given object implements the OauthClientsInfoRequest interface.
*/
export function instanceOfOauthClientsInfoRequest(value: object): value is OauthClientsInfoRequest {
return true;
}
export function OauthClientsInfoRequestFromJSON(json: any): OauthClientsInfoRequest {
return OauthClientsInfoRequestFromJSONTyped(json, false);
}
export function OauthClientsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsInfoRequest {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'clientId': json['clientId'] == null ? undefined : json['clientId'],
};
}
export function OauthClientsInfoRequestToJSON(json: any): OauthClientsInfoRequest {
return OauthClientsInfoRequestToJSONTyped(json, false);
}
export function OauthClientsInfoRequestToJSONTyped(value?: OauthClientsInfoRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'clientId': value['clientId'],
};
}

View File

@@ -0,0 +1,146 @@
/* 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 { OAuthClient } from './OAuthClient';
import {
OAuthClientFromJSON,
OAuthClientFromJSONTyped,
OAuthClientToJSON,
OAuthClientToJSONTyped,
} from './OAuthClient';
/**
*
* @export
* @interface OauthClientsList200Response
*/
export interface OauthClientsList200Response {
/**
*
* @type {number}
* @memberof OauthClientsList200Response
*/
offset?: number;
/**
*
* @type {number}
* @memberof OauthClientsList200Response
*/
limit?: number;
/**
*
* @type {string}
* @memberof OauthClientsList200Response
*/
sort?: string;
/**
*
* @type {string}
* @memberof OauthClientsList200Response
*/
direction?: OauthClientsList200ResponseDirectionEnum;
/**
*
* @type {Array<OAuthClient>}
* @memberof OauthClientsList200Response
*/
data?: Array<OAuthClient>;
/**
*
* @type {Array<Policy>}
* @memberof OauthClientsList200Response
*/
policies?: Array<Policy>;
/**
*
* @type {Pagination}
* @memberof OauthClientsList200Response
*/
pagination?: Pagination;
}
/**
* @export
*/
export const OauthClientsList200ResponseDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type OauthClientsList200ResponseDirectionEnum = typeof OauthClientsList200ResponseDirectionEnum[keyof typeof OauthClientsList200ResponseDirectionEnum];
/**
* Check if a given object implements the OauthClientsList200Response interface.
*/
export function instanceOfOauthClientsList200Response(value: object): value is OauthClientsList200Response {
return true;
}
export function OauthClientsList200ResponseFromJSON(json: any): OauthClientsList200Response {
return OauthClientsList200ResponseFromJSONTyped(json, false);
}
export function OauthClientsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsList200Response {
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'],
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(OAuthClientFromJSON)),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
};
}
export function OauthClientsList200ResponseToJSON(json: any): OauthClientsList200Response {
return OauthClientsList200ResponseToJSONTyped(json, false);
}
export function OauthClientsList200ResponseToJSONTyped(value?: OauthClientsList200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'sort': value['sort'],
'direction': value['direction'],
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(OAuthClientToJSON)),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
'pagination': PaginationToJSON(value['pagination']),
};
}

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 OauthClientsRotateSecretRequest
*/
export interface OauthClientsRotateSecretRequest {
/**
* Unique identifier for the OAuth client.
* @type {string}
* @memberof OauthClientsRotateSecretRequest
*/
id: string;
}
/**
* Check if a given object implements the OauthClientsRotateSecretRequest interface.
*/
export function instanceOfOauthClientsRotateSecretRequest(value: object): value is OauthClientsRotateSecretRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function OauthClientsRotateSecretRequestFromJSON(json: any): OauthClientsRotateSecretRequest {
return OauthClientsRotateSecretRequestFromJSONTyped(json, false);
}
export function OauthClientsRotateSecretRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsRotateSecretRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
};
}
export function OauthClientsRotateSecretRequestToJSON(json: any): OauthClientsRotateSecretRequest {
return OauthClientsRotateSecretRequestToJSONTyped(json, false);
}
export function OauthClientsRotateSecretRequestToJSONTyped(value?: OauthClientsRotateSecretRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
};
}

View File

@@ -0,0 +1,122 @@
/* 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 OauthClientsUpdateRequest
*/
export interface OauthClientsUpdateRequest {
/**
* Unique identifier for the OAuth client.
* @type {string}
* @memberof OauthClientsUpdateRequest
*/
id: string;
/**
* Name of the OAuth client.
* @type {string}
* @memberof OauthClientsUpdateRequest
*/
name?: string;
/**
* A short description of this OAuth client.
* @type {string}
* @memberof OauthClientsUpdateRequest
*/
description?: string;
/**
* The name of the developer who created this OAuth client.
* @type {string}
* @memberof OauthClientsUpdateRequest
*/
developerName?: string;
/**
* The URL of the developer who created this OAuth client.
* @type {string}
* @memberof OauthClientsUpdateRequest
*/
developerUrl?: string;
/**
* A URL pointing to an image representing the OAuth client.
* @type {string}
* @memberof OauthClientsUpdateRequest
*/
avatarUrl?: string;
/**
* List of redirect URIs for the OAuth client.
* @type {Array<string>}
* @memberof OauthClientsUpdateRequest
*/
redirectUris?: Array<string>;
/**
* Whether the OAuth client is available to other workspaces.
* @type {boolean}
* @memberof OauthClientsUpdateRequest
*/
published?: boolean;
}
/**
* Check if a given object implements the OauthClientsUpdateRequest interface.
*/
export function instanceOfOauthClientsUpdateRequest(value: object): value is OauthClientsUpdateRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function OauthClientsUpdateRequestFromJSON(json: any): OauthClientsUpdateRequest {
return OauthClientsUpdateRequestFromJSONTyped(json, false);
}
export function OauthClientsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsUpdateRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'name': json['name'] == null ? undefined : json['name'],
'description': json['description'] == null ? undefined : json['description'],
'developerName': json['developerName'] == null ? undefined : json['developerName'],
'developerUrl': json['developerUrl'] == null ? undefined : json['developerUrl'],
'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'],
'redirectUris': json['redirectUris'] == null ? undefined : json['redirectUris'],
'published': json['published'] == null ? undefined : json['published'],
};
}
export function OauthClientsUpdateRequestToJSON(json: any): OauthClientsUpdateRequest {
return OauthClientsUpdateRequestToJSONTyped(json, false);
}
export function OauthClientsUpdateRequestToJSONTyped(value?: OauthClientsUpdateRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'name': value['name'],
'description': value['description'],
'developerName': value['developerName'],
'developerUrl': value['developerUrl'],
'avatarUrl': value['avatarUrl'],
'redirectUris': value['redirectUris'],
'published': value['published'],
};
}

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 Pagination
*/
export interface Pagination {
/**
*
* @type {number}
* @memberof Pagination
*/
offset?: number;
/**
*
* @type {number}
* @memberof Pagination
*/
limit?: number;
}
/**
* Check if a given object implements the Pagination interface.
*/
export function instanceOfPagination(value: object): value is Pagination {
return true;
}
export function PaginationFromJSON(json: any): Pagination {
return PaginationFromJSONTyped(json, false);
}
export function PaginationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pagination {
if (json == null) {
return json;
}
return {
'offset': json['offset'] == null ? undefined : json['offset'],
'limit': json['limit'] == null ? undefined : json['limit'],
};
}
export function PaginationToJSON(json: any): Pagination {
return PaginationToJSONTyped(json, false);
}
export function PaginationToJSONTyped(value?: Pagination | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
};
}

View File

@@ -0,0 +1,53 @@
/* 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.
*/
/**
*
* @export
*/
export const Permission = {
Read: 'read',
ReadWrite: 'read_write'
} as const;
export type Permission = typeof Permission[keyof typeof Permission];
export function instanceOfPermission(value: any): boolean {
for (const key in Permission) {
if (Object.prototype.hasOwnProperty.call(Permission, key)) {
if (Permission[key as keyof typeof Permission] === value) {
return true;
}
}
}
return false;
}
export function PermissionFromJSON(json: any): Permission {
return PermissionFromJSONTyped(json, false);
}
export function PermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Permission {
return json as Permission;
}
export function PermissionToJSON(value?: Permission | null): any {
return value as any;
}
export function PermissionToJSONTyped(value: any, ignoreDiscriminator: boolean): Permission {
return value as Permission;
}

View File

@@ -0,0 +1,80 @@
/* 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 { Ability } from './Ability';
import {
AbilityFromJSON,
AbilityFromJSONTyped,
AbilityToJSON,
AbilityToJSONTyped,
} from './Ability';
/**
*
* @export
* @interface Policy
*/
export interface Policy {
/**
* Unique identifier for the object this policy references.
* @type {string}
* @memberof Policy
*/
readonly id?: string;
/**
* The abilities that are allowed by this policy, if an array is returned then the individual ID's in the array represent the memberships that grant the ability.
* @type {{ [key: string]: Ability; }}
* @memberof Policy
*/
abilities?: { [key: string]: Ability; };
}
/**
* Check if a given object implements the Policy interface.
*/
export function instanceOfPolicy(value: object): value is Policy {
return true;
}
export function PolicyFromJSON(json: any): Policy {
return PolicyFromJSONTyped(json, false);
}
export function PolicyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Policy {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'abilities': json['abilities'] == null ? undefined : (mapValues(json['abilities'], AbilityFromJSON)),
};
}
export function PolicyToJSON(json: any): Policy {
return PolicyToJSONTyped(json, false);
}
export function PolicyToJSONTyped(value?: Omit<Policy, 'id'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'abilities': value['abilities'] == null ? undefined : (mapValues(value['abilities'], AbilityToJSON)),
};
}

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';
/**
*
* @export
* @interface SearchResult
*/
export interface SearchResult {
/**
*
* @type {string}
* @memberof SearchResult
*/
readonly id?: string;
/**
* The user-provided search query
* @type {string}
* @memberof SearchResult
*/
readonly query?: string;
/**
* An answer to the query, if possible
* @type {string}
* @memberof SearchResult
*/
readonly answer?: string;
/**
* The source of the query
* @type {string}
* @memberof SearchResult
*/
readonly source?: SearchResultSourceEnum;
/**
* The date and time that this object was created
* @type {Date}
* @memberof SearchResult
*/
readonly createdAt?: Date;
}
/**
* @export
*/
export const SearchResultSourceEnum = {
Api: 'api',
App: 'app'
} as const;
export type SearchResultSourceEnum = typeof SearchResultSourceEnum[keyof typeof SearchResultSourceEnum];
/**
* Check if a given object implements the SearchResult interface.
*/
export function instanceOfSearchResult(value: object): value is SearchResult {
return true;
}
export function SearchResultFromJSON(json: any): SearchResult {
return SearchResultFromJSONTyped(json, false);
}
export function SearchResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchResult {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'query': json['query'] == null ? undefined : json['query'],
'answer': json['answer'] == null ? undefined : json['answer'],
'source': json['source'] == null ? undefined : json['source'],
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
};
}
export function SearchResultToJSON(json: any): SearchResult {
return SearchResultToJSONTyped(json, false);
}
export function SearchResultToJSONTyped(value?: Omit<SearchResult, 'id'|'query'|'answer'|'source'|'createdAt'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
};
}

View File

@@ -0,0 +1,84 @@
/* 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 Sorting
*/
export interface Sorting {
/**
*
* @type {string}
* @memberof Sorting
*/
sort?: string;
/**
*
* @type {string}
* @memberof Sorting
*/
direction?: SortingDirectionEnum;
}
/**
* @export
*/
export const SortingDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type SortingDirectionEnum = typeof SortingDirectionEnum[keyof typeof SortingDirectionEnum];
/**
* Check if a given object implements the Sorting interface.
*/
export function instanceOfSorting(value: object): value is Sorting {
return true;
}
export function SortingFromJSON(json: any): Sorting {
return SortingFromJSONTyped(json, false);
}
export function SortingFromJSONTyped(json: any, ignoreDiscriminator: boolean): Sorting {
if (json == null) {
return json;
}
return {
'sort': json['sort'] == null ? undefined : json['sort'],
'direction': json['direction'] == null ? undefined : json['direction'],
};
}
export function SortingToJSON(json: any): Sorting {
return SortingToJSONTyped(json, false);
}
export function SortingToJSONTyped(value?: Sorting | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'sort': value['sort'],
'direction': value['direction'],
};
}

View File

@@ -0,0 +1,177 @@
/* 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 { UserRole } from './UserRole';
import {
UserRoleFromJSON,
UserRoleFromJSONTyped,
UserRoleToJSON,
UserRoleToJSONTyped,
} from './UserRole';
/**
*
* @export
* @interface Team
*/
export interface Team {
/**
* Unique identifier for the object.
* @type {string}
* @memberof Team
*/
readonly id?: string;
/**
* The name of this team, it is usually auto-generated when the first SSO connection is made but can be changed if neccessary.
* @type {string}
* @memberof Team
*/
name?: string;
/**
* The URL for the image associated with this team, it will be displayed in the team switcher and in the top left of the knowledge base along with the name.
* @type {string}
* @memberof Team
*/
avatarUrl?: string;
/**
* Whether this team has share links globally enabled. If this value is false then all sharing UI and APIs are disabled.
* @type {boolean}
* @memberof Team
*/
sharing?: boolean;
/**
* If set then the referenced collection is where users will be redirected to after signing in instead of the Home screen
* @type {string}
* @memberof Team
*/
defaultCollectionId?: string;
/**
*
* @type {UserRole}
* @memberof Team
*/
defaultUserRole?: UserRole;
/**
* Whether members are allowed to create new collections. If false then only admins can create collections.
* @type {boolean}
* @memberof Team
*/
memberCollectionCreate?: boolean;
/**
* Whether this team has embeds in documents globally enabled. It can be disabled to reduce potential data leakage to third parties.
* @type {boolean}
* @memberof Team
*/
documentEmbeds?: boolean;
/**
* Whether this team has collaborative editing in documents globally enabled.
* @type {boolean}
* @memberof Team
*/
collaborativeEditing?: boolean;
/**
* Whether an invite is required to join this team, if false users may join with a linked SSO provider.
* @type {boolean}
* @memberof Team
*/
inviteRequired?: boolean;
/**
*
* @type {Array<string>}
* @memberof Team
*/
allowedDomains?: Array<string>;
/**
* Whether this team has guest signin enabled. Guests can signin with an email address and are not required to have a Google Workspace/Slack SSO account once invited.
* @type {boolean}
* @memberof Team
*/
guestSignin?: boolean;
/**
* Represents the subdomain at which this team's knowledge base can be accessed.
* @type {string}
* @memberof Team
*/
subdomain?: string;
/**
* The fully qualified URL at which this team's knowledge base can be accessed.
* @type {string}
* @memberof Team
*/
readonly url?: string;
}
/**
* Check if a given object implements the Team interface.
*/
export function instanceOfTeam(value: object): value is Team {
return true;
}
export function TeamFromJSON(json: any): Team {
return TeamFromJSONTyped(json, false);
}
export function TeamFromJSONTyped(json: any, ignoreDiscriminator: boolean): Team {
if (json == null) {
return json;
}
return {
'id': json['id'] == null ? undefined : json['id'],
'name': json['name'] == null ? undefined : json['name'],
'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'],
'sharing': json['sharing'] == null ? undefined : json['sharing'],
'defaultCollectionId': json['defaultCollectionId'] == null ? undefined : json['defaultCollectionId'],
'defaultUserRole': json['defaultUserRole'] == null ? undefined : UserRoleFromJSON(json['defaultUserRole']),
'memberCollectionCreate': json['memberCollectionCreate'] == null ? undefined : json['memberCollectionCreate'],
'documentEmbeds': json['documentEmbeds'] == null ? undefined : json['documentEmbeds'],
'collaborativeEditing': json['collaborativeEditing'] == null ? undefined : json['collaborativeEditing'],
'inviteRequired': json['inviteRequired'] == null ? undefined : json['inviteRequired'],
'allowedDomains': json['allowedDomains'] == null ? undefined : json['allowedDomains'],
'guestSignin': json['guestSignin'] == null ? undefined : json['guestSignin'],
'subdomain': json['subdomain'] == null ? undefined : json['subdomain'],
'url': json['url'] == null ? undefined : json['url'],
};
}
export function TeamToJSON(json: any): Team {
return TeamToJSONTyped(json, false);
}
export function TeamToJSONTyped(value?: Omit<Team, 'id'|'url'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'avatarUrl': value['avatarUrl'],
'sharing': value['sharing'],
'defaultCollectionId': value['defaultCollectionId'],
'defaultUserRole': UserRoleToJSON(value['defaultUserRole']),
'memberCollectionCreate': value['memberCollectionCreate'],
'documentEmbeds': value['documentEmbeds'],
'collaborativeEditing': value['collaborativeEditing'],
'inviteRequired': value['inviteRequired'],
'allowedDomains': value['allowedDomains'],
'guestSignin': value['guestSignin'],
'subdomain': value['subdomain'],
};
}

View File

@@ -0,0 +1,154 @@
/* tslint:disable */
/* eslint-disable */
export * from './Ability';
export * from './Attachment';
export * from './AttachmentsCreate200Response';
export * from './AttachmentsCreate200ResponseData';
export * from './AttachmentsCreateRequest';
export * from './AttachmentsDelete200Response';
export * from './AttachmentsRedirectRequest';
export * from './Auth';
export * from './AuthConfig200Response';
export * from './AuthConfig200ResponseData';
export * from './AuthConfig200ResponseDataServicesInner';
export * from './AuthInfo200Response';
export * from './Collection';
export * from './CollectionGroupMembership';
export * from './CollectionSort';
export * from './CollectionStatus';
export * from './CollectionsAddGroup200Response';
export * from './CollectionsAddGroup200ResponseData';
export * from './CollectionsAddGroupRequest';
export * from './CollectionsAddUser200Response';
export * from './CollectionsAddUser200ResponseData';
export * from './CollectionsAddUserRequest';
export * from './CollectionsCreateRequest';
export * from './CollectionsDeleteRequest';
export * from './CollectionsDocuments200Response';
export * from './CollectionsExport200Response';
export * from './CollectionsExport200ResponseData';
export * from './CollectionsExportAllRequest';
export * from './CollectionsExportRequest';
export * from './CollectionsGroupMemberships200Response';
export * from './CollectionsGroupMemberships200ResponseData';
export * from './CollectionsGroupMembershipsRequest';
export * from './CollectionsInfo200Response';
export * from './CollectionsInfoRequest';
export * from './CollectionsList200Response';
export * from './CollectionsListRequest';
export * from './CollectionsMemberships200Response';
export * from './CollectionsMembershipsRequest';
export * from './CollectionsRemoveGroupRequest';
export * from './CollectionsRemoveUserRequest';
export * from './CollectionsUpdateRequest';
export * from './Comment';
export * from './CommentsCreate200Response';
export * from './CommentsCreateRequest';
export * from './CommentsInfo200Response';
export * from './CommentsInfoRequest';
export * from './CommentsList200Response';
export * from './CommentsListRequest';
export * from './CommentsUpdateRequest';
export * from './Document';
export * from './DocumentsAddUserRequest';
export * from './DocumentsAnswerquestion200Response';
export * from './DocumentsAnswerquestionRequest';
export * from './DocumentsCreateRequest';
export * from './DocumentsDeleteRequest';
export * from './DocumentsDraftsRequest';
export * from './DocumentsExport200Response';
export * from './DocumentsExportRequest';
export * from './DocumentsInfo200Response';
export * from './DocumentsInfoRequest';
export * from './DocumentsList200Response';
export * from './DocumentsListRequest';
export * from './DocumentsMembershipsRequest';
export * from './DocumentsMove200Response';
export * from './DocumentsMove200ResponseData';
export * from './DocumentsMoveRequest';
export * from './DocumentsRemoveUserRequest';
export * from './DocumentsRestoreRequest';
export * from './DocumentsSearch200Response';
export * from './DocumentsSearch200ResponseDataInner';
export * from './DocumentsSearchRequest';
export * from './DocumentsUnpublishRequest';
export * from './DocumentsUpdateRequest';
export * from './DocumentsUsers200Response';
export * from './DocumentsUsersRequest';
export * from './DocumentsViewedRequest';
export * from './Event';
export * from './EventsList200Response';
export * from './EventsListRequest';
export * from './FileOperation';
export * from './FileoperationsInfo200Response';
export * from './FileoperationsInfoRequest';
export * from './FileoperationsList200Response';
export * from './FileoperationsListRequest';
export * from './Group';
export * from './GroupMembership';
export * from './GroupsAddUser200Response';
export * from './GroupsAddUser200ResponseData';
export * from './GroupsAddUserRequest';
export * from './GroupsCreateRequest';
export * from './GroupsInfo200Response';
export * from './GroupsInfoRequest';
export * from './GroupsList200Response';
export * from './GroupsList200ResponseData';
export * from './GroupsListRequest';
export * from './GroupsMemberships200Response';
export * from './GroupsMemberships200ResponseData';
export * from './GroupsMembershipsRequest';
export * from './GroupsRemoveUser200Response';
export * from './GroupsRemoveUser200ResponseData';
export * from './GroupsUpdateRequest';
export * from './InlineObject';
export * from './Invite';
export * from './Membership';
export * from './ModelError';
export * from './NavigationNode';
export * from './OAuthClient';
export * from './OauthClientsCreateRequest';
export * from './OauthClientsInfo200Response';
export * from './OauthClientsInfoRequest';
export * from './OauthClientsList200Response';
export * from './OauthClientsRotateSecretRequest';
export * from './OauthClientsUpdateRequest';
export * from './Pagination';
export * from './Permission';
export * from './Policy';
export * from './Revision';
export * from './RevisionsInfo200Response';
export * from './RevisionsInfoRequest';
export * from './RevisionsList200Response';
export * from './RevisionsListRequest';
export * from './SearchResult';
export * from './Share';
export * from './SharesCreateRequest';
export * from './SharesInfo200Response';
export * from './SharesInfoRequest';
export * from './SharesList200Response';
export * from './SharesListRequest';
export * from './SharesUpdateRequest';
export * from './Sorting';
export * from './Star';
export * from './StarsCreate200Response';
export * from './StarsCreateRequest';
export * from './StarsList200Response';
export * from './StarsList200ResponseData';
export * from './StarsUpdateRequest';
export * from './Team';
export * from './User';
export * from './UserRole';
export * from './UsersInfo200Response';
export * from './UsersInfoRequest';
export * from './UsersInvite200Response';
export * from './UsersInvite200ResponseData';
export * from './UsersInviteRequest';
export * from './UsersList200Response';
export * from './UsersListRequest';
export * from './UsersUpdateRequest';
export * from './UsersUpdateRoleRequest';
export * from './View';
export * from './ViewsCreate200Response';
export * from './ViewsList200Response';
export * from './ViewsListRequest';