add user models

This commit is contained in:
2025-07-15 18:00:47 +02:00
parent 140d6e5f08
commit b5acba9fce
11 changed files with 990 additions and 0 deletions

View File

@@ -0,0 +1,126 @@
/* 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 User
*/
export interface User {
/**
* Unique identifier for the object.
* @type {string}
* @memberof User
*/
readonly id?: string;
/**
* The name of this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary.
* @type {string}
* @memberof User
*/
name?: string;
/**
* The URL for the image associated with this user, it will be displayed in the application UI and email notifications.
* @type {string}
* @memberof User
*/
avatarUrl?: string;
/**
* The email associated with this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary.
* @type {string}
* @memberof User
*/
readonly email?: string;
/**
*
* @type {UserRole}
* @memberof User
*/
role?: UserRole;
/**
* Whether this user has been suspended.
* @type {boolean}
* @memberof User
*/
readonly isSuspended?: boolean;
/**
* The last time this user made an API request, this value is updated at most every 5 minutes.
* @type {Date}
* @memberof User
*/
readonly lastActiveAt?: Date;
/**
* The date and time that this user first signed in or was invited as a guest.
* @type {Date}
* @memberof User
*/
readonly createdAt?: Date;
}
/**
* Check if a given object implements the User interface.
*/
export function instanceOfUser(value: object): value is User {
return true;
}
export function UserFromJSON(json: any): User {
return UserFromJSONTyped(json, false);
}
export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User {
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'],
'email': json['email'] == null ? undefined : json['email'],
'role': json['role'] == null ? undefined : UserRoleFromJSON(json['role']),
'isSuspended': json['isSuspended'] == null ? undefined : json['isSuspended'],
'lastActiveAt': json['lastActiveAt'] == null ? undefined : (new Date(json['lastActiveAt'])),
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
};
}
export function UserToJSON(json: any): User {
return UserToJSONTyped(json, false);
}
export function UserToJSONTyped(value?: Omit<User, 'id'|'email'|'isSuspended'|'lastActiveAt'|'createdAt'> | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'avatarUrl': value['avatarUrl'],
'role': UserRoleToJSON(value['role']),
};
}

View File

@@ -0,0 +1,55 @@
/* 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 UserRole = {
Admin: 'admin',
Member: 'member',
Viewer: 'viewer',
Guest: 'guest'
} as const;
export type UserRole = typeof UserRole[keyof typeof UserRole];
export function instanceOfUserRole(value: any): boolean {
for (const key in UserRole) {
if (Object.prototype.hasOwnProperty.call(UserRole, key)) {
if (UserRole[key as keyof typeof UserRole] === value) {
return true;
}
}
}
return false;
}
export function UserRoleFromJSON(json: any): UserRole {
return UserRoleFromJSONTyped(json, false);
}
export function UserRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRole {
return json as UserRole;
}
export function UserRoleToJSON(value?: UserRole | null): any {
return value as any;
}
export function UserRoleToJSONTyped(value: any, ignoreDiscriminator: boolean): UserRole {
return value as UserRole;
}

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 { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
UserToJSONTyped,
} from './User';
/**
*
* @export
* @interface UsersInfo200Response
*/
export interface UsersInfo200Response {
/**
*
* @type {User}
* @memberof UsersInfo200Response
*/
data?: User;
/**
*
* @type {Array<Policy>}
* @memberof UsersInfo200Response
*/
policies?: Array<Policy>;
}
/**
* Check if a given object implements the UsersInfo200Response interface.
*/
export function instanceOfUsersInfo200Response(value: object): value is UsersInfo200Response {
return true;
}
export function UsersInfo200ResponseFromJSON(json: any): UsersInfo200Response {
return UsersInfo200ResponseFromJSONTyped(json, false);
}
export function UsersInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInfo200Response {
if (json == null) {
return json;
}
return {
'data': json['data'] == null ? undefined : UserFromJSON(json['data']),
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
};
}
export function UsersInfo200ResponseToJSON(json: any): UsersInfo200Response {
return UsersInfo200ResponseToJSONTyped(json, false);
}
export function UsersInfo200ResponseToJSONTyped(value?: UsersInfo200Response | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'data': UserToJSON(value['data']),
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
};
}

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 UsersInfoRequest
*/
export interface UsersInfoRequest {
/**
* Unique identifier for the user.
* @type {string}
* @memberof UsersInfoRequest
*/
id: string;
}
/**
* Check if a given object implements the UsersInfoRequest interface.
*/
export function instanceOfUsersInfoRequest(value: object): value is UsersInfoRequest {
if (!('id' in value) || value['id'] === undefined) return false;
return true;
}
export function UsersInfoRequestFromJSON(json: any): UsersInfoRequest {
return UsersInfoRequestFromJSONTyped(json, false);
}
export function UsersInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInfoRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
};
}
export function UsersInfoRequestToJSON(json: any): UsersInfoRequest {
return UsersInfoRequestToJSONTyped(json, false);
}
export function UsersInfoRequestToJSONTyped(value?: UsersInfoRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
};
}

View File

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

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 { User } from './User';
import {
UserFromJSON,
UserFromJSONTyped,
UserToJSON,
UserToJSONTyped,
} from './User';
import type { Invite } from './Invite';
import {
InviteFromJSON,
InviteFromJSONTyped,
InviteToJSON,
InviteToJSONTyped,
} from './Invite';
/**
*
* @export
* @interface UsersInvite200ResponseData
*/
export interface UsersInvite200ResponseData {
/**
*
* @type {Array<Invite>}
* @memberof UsersInvite200ResponseData
*/
sent?: Array<Invite>;
/**
*
* @type {Array<User>}
* @memberof UsersInvite200ResponseData
*/
users?: Array<User>;
}
/**
* Check if a given object implements the UsersInvite200ResponseData interface.
*/
export function instanceOfUsersInvite200ResponseData(value: object): value is UsersInvite200ResponseData {
return true;
}
export function UsersInvite200ResponseDataFromJSON(json: any): UsersInvite200ResponseData {
return UsersInvite200ResponseDataFromJSONTyped(json, false);
}
export function UsersInvite200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInvite200ResponseData {
if (json == null) {
return json;
}
return {
'sent': json['sent'] == null ? undefined : ((json['sent'] as Array<any>).map(InviteFromJSON)),
'users': json['users'] == null ? undefined : ((json['users'] as Array<any>).map(UserFromJSON)),
};
}
export function UsersInvite200ResponseDataToJSON(json: any): UsersInvite200ResponseData {
return UsersInvite200ResponseDataToJSONTyped(json, false);
}
export function UsersInvite200ResponseDataToJSONTyped(value?: UsersInvite200ResponseData | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'sent': value['sent'] == null ? undefined : ((value['sent'] as Array<any>).map(InviteToJSON)),
'users': value['users'] == null ? undefined : ((value['users'] as Array<any>).map(UserToJSON)),
};
}

View File

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

View File

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

View File

@@ -0,0 +1,151 @@
/* 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 UsersListRequest
*/
export interface UsersListRequest {
/**
*
* @type {number}
* @memberof UsersListRequest
*/
offset?: number;
/**
*
* @type {number}
* @memberof UsersListRequest
*/
limit?: number;
/**
*
* @type {string}
* @memberof UsersListRequest
*/
sort?: string;
/**
*
* @type {string}
* @memberof UsersListRequest
*/
direction?: UsersListRequestDirectionEnum;
/**
*
* @type {string}
* @memberof UsersListRequest
*/
query?: string;
/**
* Array of emails
* @type {Array<string>}
* @memberof UsersListRequest
*/
emails?: Array<string>;
/**
* The status to filter by
* @type {string}
* @memberof UsersListRequest
*/
filter?: UsersListRequestFilterEnum;
/**
*
* @type {UserRole}
* @memberof UsersListRequest
*/
role?: UserRole;
}
/**
* @export
*/
export const UsersListRequestDirectionEnum = {
Asc: 'ASC',
Desc: 'DESC'
} as const;
export type UsersListRequestDirectionEnum = typeof UsersListRequestDirectionEnum[keyof typeof UsersListRequestDirectionEnum];
/**
* @export
*/
export const UsersListRequestFilterEnum = {
All: 'all',
Invited: 'invited',
Active: 'active',
Suspended: 'suspended'
} as const;
export type UsersListRequestFilterEnum = typeof UsersListRequestFilterEnum[keyof typeof UsersListRequestFilterEnum];
/**
* Check if a given object implements the UsersListRequest interface.
*/
export function instanceOfUsersListRequest(value: object): value is UsersListRequest {
return true;
}
export function UsersListRequestFromJSON(json: any): UsersListRequest {
return UsersListRequestFromJSONTyped(json, false);
}
export function UsersListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersListRequest {
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'],
'query': json['query'] == null ? undefined : json['query'],
'emails': json['emails'] == null ? undefined : json['emails'],
'filter': json['filter'] == null ? undefined : json['filter'],
'role': json['role'] == null ? undefined : UserRoleFromJSON(json['role']),
};
}
export function UsersListRequestToJSON(json: any): UsersListRequest {
return UsersListRequestToJSONTyped(json, false);
}
export function UsersListRequestToJSONTyped(value?: UsersListRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'offset': value['offset'],
'limit': value['limit'],
'sort': value['sort'],
'direction': value['direction'],
'query': value['query'],
'emails': value['emails'],
'filter': value['filter'],
'role': UserRoleToJSON(value['role']),
};
}

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 UsersUpdateRequest
*/
export interface UsersUpdateRequest {
/**
*
* @type {string}
* @memberof UsersUpdateRequest
*/
name?: string;
/**
*
* @type {string}
* @memberof UsersUpdateRequest
*/
language?: string;
/**
*
* @type {string}
* @memberof UsersUpdateRequest
*/
avatarUrl?: string;
}
/**
* Check if a given object implements the UsersUpdateRequest interface.
*/
export function instanceOfUsersUpdateRequest(value: object): value is UsersUpdateRequest {
return true;
}
export function UsersUpdateRequestFromJSON(json: any): UsersUpdateRequest {
return UsersUpdateRequestFromJSONTyped(json, false);
}
export function UsersUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersUpdateRequest {
if (json == null) {
return json;
}
return {
'name': json['name'] == null ? undefined : json['name'],
'language': json['language'] == null ? undefined : json['language'],
'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'],
};
}
export function UsersUpdateRequestToJSON(json: any): UsersUpdateRequest {
return UsersUpdateRequestToJSONTyped(json, false);
}
export function UsersUpdateRequestToJSONTyped(value?: UsersUpdateRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'name': value['name'],
'language': value['language'],
'avatarUrl': value['avatarUrl'],
};
}

View File

@@ -0,0 +1,85 @@
/* 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 UsersUpdateRoleRequest
*/
export interface UsersUpdateRoleRequest {
/**
* Unique identifier for the user.
* @type {string}
* @memberof UsersUpdateRoleRequest
*/
id: string;
/**
*
* @type {UserRole}
* @memberof UsersUpdateRoleRequest
*/
role: UserRole;
}
/**
* Check if a given object implements the UsersUpdateRoleRequest interface.
*/
export function instanceOfUsersUpdateRoleRequest(value: object): value is UsersUpdateRoleRequest {
if (!('id' in value) || value['id'] === undefined) return false;
if (!('role' in value) || value['role'] === undefined) return false;
return true;
}
export function UsersUpdateRoleRequestFromJSON(json: any): UsersUpdateRoleRequest {
return UsersUpdateRoleRequestFromJSONTyped(json, false);
}
export function UsersUpdateRoleRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersUpdateRoleRequest {
if (json == null) {
return json;
}
return {
'id': json['id'],
'role': UserRoleFromJSON(json['role']),
};
}
export function UsersUpdateRoleRequestToJSON(json: any): UsersUpdateRoleRequest {
return UsersUpdateRoleRequestToJSONTyped(json, false);
}
export function UsersUpdateRoleRequestToJSONTyped(value?: UsersUpdateRoleRequest | null, ignoreDiscriminator: boolean = false): any {
if (value == null) {
return value;
}
return {
'id': value['id'],
'role': UserRoleToJSON(value['role']),
};
}