initial-commit #1
146
src/gen/api/outline/models/FileOperation.ts
Normal file
146
src/gen/api/outline/models/FileOperation.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { User } from './User';
|
||||
import {
|
||||
UserFromJSON,
|
||||
UserFromJSONTyped,
|
||||
UserToJSON,
|
||||
UserToJSONTyped,
|
||||
} from './User';
|
||||
import type { Collection } from './Collection';
|
||||
import {
|
||||
CollectionFromJSON,
|
||||
CollectionFromJSONTyped,
|
||||
CollectionToJSON,
|
||||
CollectionToJSONTyped,
|
||||
} from './Collection';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface FileOperation
|
||||
*/
|
||||
export interface FileOperation {
|
||||
/**
|
||||
* Unique identifier for the object.
|
||||
* @type {string}
|
||||
* @memberof FileOperation
|
||||
*/
|
||||
readonly id?: string;
|
||||
/**
|
||||
* The type of file operation.
|
||||
* @type {string}
|
||||
* @memberof FileOperation
|
||||
*/
|
||||
readonly type?: FileOperationTypeEnum;
|
||||
/**
|
||||
* The state of the file operation.
|
||||
* @type {string}
|
||||
* @memberof FileOperation
|
||||
*/
|
||||
readonly state?: FileOperationStateEnum;
|
||||
/**
|
||||
*
|
||||
* @type {Collection}
|
||||
* @memberof FileOperation
|
||||
*/
|
||||
collection?: Collection | null;
|
||||
/**
|
||||
*
|
||||
* @type {User}
|
||||
* @memberof FileOperation
|
||||
*/
|
||||
user?: User;
|
||||
/**
|
||||
* The size of the resulting file in bytes
|
||||
* @type {number}
|
||||
* @memberof FileOperation
|
||||
*/
|
||||
readonly size?: number;
|
||||
/**
|
||||
* The date and time that this object was created
|
||||
* @type {Date}
|
||||
* @memberof FileOperation
|
||||
*/
|
||||
readonly createdAt?: Date;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const FileOperationTypeEnum = {
|
||||
Import: 'import',
|
||||
Export: 'export'
|
||||
} as const;
|
||||
export type FileOperationTypeEnum = typeof FileOperationTypeEnum[keyof typeof FileOperationTypeEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const FileOperationStateEnum = {
|
||||
Creating: 'creating',
|
||||
Uploading: 'uploading',
|
||||
Complete: 'complete',
|
||||
Error: 'error',
|
||||
Expired: 'expired'
|
||||
} as const;
|
||||
export type FileOperationStateEnum = typeof FileOperationStateEnum[keyof typeof FileOperationStateEnum];
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the FileOperation interface.
|
||||
*/
|
||||
export function instanceOfFileOperation(value: object): value is FileOperation {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function FileOperationFromJSON(json: any): FileOperation {
|
||||
return FileOperationFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileOperation {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'type': json['type'] == null ? undefined : json['type'],
|
||||
'state': json['state'] == null ? undefined : json['state'],
|
||||
'collection': json['collection'] == null ? undefined : CollectionFromJSON(json['collection']),
|
||||
'user': json['user'] == null ? undefined : UserFromJSON(json['user']),
|
||||
'size': json['size'] == null ? undefined : json['size'],
|
||||
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function FileOperationToJSON(json: any): FileOperation {
|
||||
return FileOperationToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileOperationToJSONTyped(value?: Omit<FileOperation, 'id'|'type'|'state'|'size'|'createdAt'> | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'collection': CollectionToJSON(value['collection']),
|
||||
'user': UserToJSON(value['user']),
|
||||
};
|
||||
}
|
||||
|
||||
73
src/gen/api/outline/models/FileoperationsInfo200Response.ts
Normal file
73
src/gen/api/outline/models/FileoperationsInfo200Response.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { FileOperation } from './FileOperation';
|
||||
import {
|
||||
FileOperationFromJSON,
|
||||
FileOperationFromJSONTyped,
|
||||
FileOperationToJSON,
|
||||
FileOperationToJSONTyped,
|
||||
} from './FileOperation';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface FileoperationsInfo200Response
|
||||
*/
|
||||
export interface FileoperationsInfo200Response {
|
||||
/**
|
||||
*
|
||||
* @type {FileOperation}
|
||||
* @memberof FileoperationsInfo200Response
|
||||
*/
|
||||
data?: FileOperation;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the FileoperationsInfo200Response interface.
|
||||
*/
|
||||
export function instanceOfFileoperationsInfo200Response(value: object): value is FileoperationsInfo200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function FileoperationsInfo200ResponseFromJSON(json: any): FileoperationsInfo200Response {
|
||||
return FileoperationsInfo200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsInfo200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : FileOperationFromJSON(json['data']),
|
||||
};
|
||||
}
|
||||
|
||||
export function FileoperationsInfo200ResponseToJSON(json: any): FileoperationsInfo200Response {
|
||||
return FileoperationsInfo200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsInfo200ResponseToJSONTyped(value?: FileoperationsInfo200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': FileOperationToJSON(value['data']),
|
||||
};
|
||||
}
|
||||
|
||||
66
src/gen/api/outline/models/FileoperationsInfoRequest.ts
Normal file
66
src/gen/api/outline/models/FileoperationsInfoRequest.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface FileoperationsInfoRequest
|
||||
*/
|
||||
export interface FileoperationsInfoRequest {
|
||||
/**
|
||||
* Unique identifier for the file operation.
|
||||
* @type {string}
|
||||
* @memberof FileoperationsInfoRequest
|
||||
*/
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the FileoperationsInfoRequest interface.
|
||||
*/
|
||||
export function instanceOfFileoperationsInfoRequest(value: object): value is FileoperationsInfoRequest {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function FileoperationsInfoRequestFromJSON(json: any): FileoperationsInfoRequest {
|
||||
return FileoperationsInfoRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsInfoRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'],
|
||||
};
|
||||
}
|
||||
|
||||
export function FileoperationsInfoRequestToJSON(json: any): FileoperationsInfoRequest {
|
||||
return FileoperationsInfoRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsInfoRequestToJSONTyped(value?: FileoperationsInfoRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
};
|
||||
}
|
||||
|
||||
88
src/gen/api/outline/models/FileoperationsList200Response.ts
Normal file
88
src/gen/api/outline/models/FileoperationsList200Response.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { Pagination } from './Pagination';
|
||||
import {
|
||||
PaginationFromJSON,
|
||||
PaginationFromJSONTyped,
|
||||
PaginationToJSON,
|
||||
PaginationToJSONTyped,
|
||||
} from './Pagination';
|
||||
import type { FileOperation } from './FileOperation';
|
||||
import {
|
||||
FileOperationFromJSON,
|
||||
FileOperationFromJSONTyped,
|
||||
FileOperationToJSON,
|
||||
FileOperationToJSONTyped,
|
||||
} from './FileOperation';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface FileoperationsList200Response
|
||||
*/
|
||||
export interface FileoperationsList200Response {
|
||||
/**
|
||||
*
|
||||
* @type {Array<FileOperation>}
|
||||
* @memberof FileoperationsList200Response
|
||||
*/
|
||||
data?: Array<FileOperation>;
|
||||
/**
|
||||
*
|
||||
* @type {Pagination}
|
||||
* @memberof FileoperationsList200Response
|
||||
*/
|
||||
pagination?: Pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the FileoperationsList200Response interface.
|
||||
*/
|
||||
export function instanceOfFileoperationsList200Response(value: object): value is FileoperationsList200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function FileoperationsList200ResponseFromJSON(json: any): FileoperationsList200Response {
|
||||
return FileoperationsList200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsList200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(FileOperationFromJSON)),
|
||||
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
|
||||
};
|
||||
}
|
||||
|
||||
export function FileoperationsList200ResponseToJSON(json: any): FileoperationsList200Response {
|
||||
return FileoperationsList200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsList200ResponseToJSONTyped(value?: FileoperationsList200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(FileOperationToJSON)),
|
||||
'pagination': PaginationToJSON(value['pagination']),
|
||||
};
|
||||
}
|
||||
|
||||
118
src/gen/api/outline/models/FileoperationsListRequest.ts
Normal file
118
src/gen/api/outline/models/FileoperationsListRequest.ts
Normal file
@@ -0,0 +1,118 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface FileoperationsListRequest
|
||||
*/
|
||||
export interface FileoperationsListRequest {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileoperationsListRequest
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FileoperationsListRequest
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileoperationsListRequest
|
||||
*/
|
||||
sort?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FileoperationsListRequest
|
||||
*/
|
||||
direction?: FileoperationsListRequestDirectionEnum;
|
||||
/**
|
||||
* The type of fileOperation
|
||||
* @type {string}
|
||||
* @memberof FileoperationsListRequest
|
||||
*/
|
||||
type: FileoperationsListRequestTypeEnum;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const FileoperationsListRequestDirectionEnum = {
|
||||
Asc: 'ASC',
|
||||
Desc: 'DESC'
|
||||
} as const;
|
||||
export type FileoperationsListRequestDirectionEnum = typeof FileoperationsListRequestDirectionEnum[keyof typeof FileoperationsListRequestDirectionEnum];
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const FileoperationsListRequestTypeEnum = {
|
||||
Export: 'export',
|
||||
Import: 'import'
|
||||
} as const;
|
||||
export type FileoperationsListRequestTypeEnum = typeof FileoperationsListRequestTypeEnum[keyof typeof FileoperationsListRequestTypeEnum];
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the FileoperationsListRequest interface.
|
||||
*/
|
||||
export function instanceOfFileoperationsListRequest(value: object): value is FileoperationsListRequest {
|
||||
if (!('type' in value) || value['type'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function FileoperationsListRequestFromJSON(json: any): FileoperationsListRequest {
|
||||
return FileoperationsListRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsListRequest {
|
||||
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'],
|
||||
'type': json['type'],
|
||||
};
|
||||
}
|
||||
|
||||
export function FileoperationsListRequestToJSON(json: any): FileoperationsListRequest {
|
||||
return FileoperationsListRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FileoperationsListRequestToJSONTyped(value?: FileoperationsListRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'offset': value['offset'],
|
||||
'limit': value['limit'],
|
||||
'sort': value['sort'],
|
||||
'direction': value['direction'],
|
||||
'type': value['type'],
|
||||
};
|
||||
}
|
||||
|
||||
93
src/gen/api/outline/models/Group.ts
Normal file
93
src/gen/api/outline/models/Group.ts
Normal file
@@ -0,0 +1,93 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface Group
|
||||
*/
|
||||
export interface Group {
|
||||
/**
|
||||
* Unique identifier for the object.
|
||||
* @type {string}
|
||||
* @memberof Group
|
||||
*/
|
||||
readonly id?: string;
|
||||
/**
|
||||
* The name of this group.
|
||||
* @type {string}
|
||||
* @memberof Group
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* The number of users that are members of the group
|
||||
* @type {number}
|
||||
* @memberof Group
|
||||
*/
|
||||
readonly memberCount?: number;
|
||||
/**
|
||||
* The date and time that this object was created
|
||||
* @type {Date}
|
||||
* @memberof Group
|
||||
*/
|
||||
readonly createdAt?: Date;
|
||||
/**
|
||||
* The date and time that this object was last changed
|
||||
* @type {Date}
|
||||
* @memberof Group
|
||||
*/
|
||||
readonly updatedAt?: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the Group interface.
|
||||
*/
|
||||
export function instanceOfGroup(value: object): value is Group {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupFromJSON(json: any): Group {
|
||||
return GroupFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): Group {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'name': json['name'] == null ? undefined : json['name'],
|
||||
'memberCount': json['memberCount'] == null ? undefined : json['memberCount'],
|
||||
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
||||
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupToJSON(json: any): Group {
|
||||
return GroupToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupToJSONTyped(value?: Omit<Group, 'id'|'memberCount'|'createdAt'|'updatedAt'> | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'name': value['name'],
|
||||
};
|
||||
}
|
||||
|
||||
94
src/gen/api/outline/models/GroupMembership.ts
Normal file
94
src/gen/api/outline/models/GroupMembership.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { User } from './User';
|
||||
import {
|
||||
UserFromJSON,
|
||||
UserFromJSONTyped,
|
||||
UserToJSON,
|
||||
UserToJSONTyped,
|
||||
} from './User';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupMembership
|
||||
*/
|
||||
export interface GroupMembership {
|
||||
/**
|
||||
* Unique identifier for the object.
|
||||
* @type {string}
|
||||
* @memberof GroupMembership
|
||||
*/
|
||||
readonly id?: string;
|
||||
/**
|
||||
* Identifier for the associated group.
|
||||
* @type {string}
|
||||
* @memberof GroupMembership
|
||||
*/
|
||||
readonly groupId?: string;
|
||||
/**
|
||||
* Identifier for the associated user.
|
||||
* @type {string}
|
||||
* @memberof GroupMembership
|
||||
*/
|
||||
readonly userId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {User}
|
||||
* @memberof GroupMembership
|
||||
*/
|
||||
user?: User;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupMembership interface.
|
||||
*/
|
||||
export function instanceOfGroupMembership(value: object): value is GroupMembership {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupMembershipFromJSON(json: any): GroupMembership {
|
||||
return GroupMembershipFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupMembershipFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupMembership {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'groupId': json['groupId'] == null ? undefined : json['groupId'],
|
||||
'userId': json['userId'] == null ? undefined : json['userId'],
|
||||
'user': json['user'] == null ? undefined : UserFromJSON(json['user']),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupMembershipToJSON(json: any): GroupMembership {
|
||||
return GroupMembershipToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupMembershipToJSONTyped(value?: Omit<GroupMembership, 'id'|'groupId'|'userId'> | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'user': UserToJSON(value['user']),
|
||||
};
|
||||
}
|
||||
|
||||
73
src/gen/api/outline/models/GroupsAddUser200Response.ts
Normal file
73
src/gen/api/outline/models/GroupsAddUser200Response.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { GroupsAddUser200ResponseData } from './GroupsAddUser200ResponseData';
|
||||
import {
|
||||
GroupsAddUser200ResponseDataFromJSON,
|
||||
GroupsAddUser200ResponseDataFromJSONTyped,
|
||||
GroupsAddUser200ResponseDataToJSON,
|
||||
GroupsAddUser200ResponseDataToJSONTyped,
|
||||
} from './GroupsAddUser200ResponseData';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsAddUser200Response
|
||||
*/
|
||||
export interface GroupsAddUser200Response {
|
||||
/**
|
||||
*
|
||||
* @type {GroupsAddUser200ResponseData}
|
||||
* @memberof GroupsAddUser200Response
|
||||
*/
|
||||
data?: GroupsAddUser200ResponseData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsAddUser200Response interface.
|
||||
*/
|
||||
export function instanceOfGroupsAddUser200Response(value: object): value is GroupsAddUser200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseFromJSON(json: any): GroupsAddUser200Response {
|
||||
return GroupsAddUser200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsAddUser200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : GroupsAddUser200ResponseDataFromJSON(json['data']),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseToJSON(json: any): GroupsAddUser200Response {
|
||||
return GroupsAddUser200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseToJSONTyped(value?: GroupsAddUser200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': GroupsAddUser200ResponseDataToJSON(value['data']),
|
||||
};
|
||||
}
|
||||
|
||||
103
src/gen/api/outline/models/GroupsAddUser200ResponseData.ts
Normal file
103
src/gen/api/outline/models/GroupsAddUser200ResponseData.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { Group } from './Group';
|
||||
import {
|
||||
GroupFromJSON,
|
||||
GroupFromJSONTyped,
|
||||
GroupToJSON,
|
||||
GroupToJSONTyped,
|
||||
} from './Group';
|
||||
import type { User } from './User';
|
||||
import {
|
||||
UserFromJSON,
|
||||
UserFromJSONTyped,
|
||||
UserToJSON,
|
||||
UserToJSONTyped,
|
||||
} from './User';
|
||||
import type { Membership } from './Membership';
|
||||
import {
|
||||
MembershipFromJSON,
|
||||
MembershipFromJSONTyped,
|
||||
MembershipToJSON,
|
||||
MembershipToJSONTyped,
|
||||
} from './Membership';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsAddUser200ResponseData
|
||||
*/
|
||||
export interface GroupsAddUser200ResponseData {
|
||||
/**
|
||||
*
|
||||
* @type {Array<User>}
|
||||
* @memberof GroupsAddUser200ResponseData
|
||||
*/
|
||||
users?: Array<User>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<Group>}
|
||||
* @memberof GroupsAddUser200ResponseData
|
||||
*/
|
||||
groups?: Array<Group>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<Membership>}
|
||||
* @memberof GroupsAddUser200ResponseData
|
||||
*/
|
||||
groupMemberships?: Array<Membership>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsAddUser200ResponseData interface.
|
||||
*/
|
||||
export function instanceOfGroupsAddUser200ResponseData(value: object): value is GroupsAddUser200ResponseData {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseDataFromJSON(json: any): GroupsAddUser200ResponseData {
|
||||
return GroupsAddUser200ResponseDataFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsAddUser200ResponseData {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'users': json['users'] == null ? undefined : ((json['users'] as Array<any>).map(UserFromJSON)),
|
||||
'groups': json['groups'] == null ? undefined : ((json['groups'] as Array<any>).map(GroupFromJSON)),
|
||||
'groupMemberships': json['groupMemberships'] == null ? undefined : ((json['groupMemberships'] as Array<any>).map(MembershipFromJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseDataToJSON(json: any): GroupsAddUser200ResponseData {
|
||||
return GroupsAddUser200ResponseDataToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsAddUser200ResponseDataToJSONTyped(value?: GroupsAddUser200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'users': value['users'] == null ? undefined : ((value['users'] as Array<any>).map(UserToJSON)),
|
||||
'groups': value['groups'] == null ? undefined : ((value['groups'] as Array<any>).map(GroupToJSON)),
|
||||
'groupMemberships': value['groupMemberships'] == null ? undefined : ((value['groupMemberships'] as Array<any>).map(MembershipToJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
75
src/gen/api/outline/models/GroupsAddUserRequest.ts
Normal file
75
src/gen/api/outline/models/GroupsAddUserRequest.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsAddUserRequest
|
||||
*/
|
||||
export interface GroupsAddUserRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof GroupsAddUserRequest
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof GroupsAddUserRequest
|
||||
*/
|
||||
userId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsAddUserRequest interface.
|
||||
*/
|
||||
export function instanceOfGroupsAddUserRequest(value: object): value is GroupsAddUserRequest {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
if (!('userId' in value) || value['userId'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsAddUserRequestFromJSON(json: any): GroupsAddUserRequest {
|
||||
return GroupsAddUserRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsAddUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsAddUserRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'],
|
||||
'userId': json['userId'],
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsAddUserRequestToJSON(json: any): GroupsAddUserRequest {
|
||||
return GroupsAddUserRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsAddUserRequestToJSONTyped(value?: GroupsAddUserRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'userId': value['userId'],
|
||||
};
|
||||
}
|
||||
|
||||
66
src/gen/api/outline/models/GroupsCreateRequest.ts
Normal file
66
src/gen/api/outline/models/GroupsCreateRequest.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsCreateRequest
|
||||
*/
|
||||
export interface GroupsCreateRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof GroupsCreateRequest
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsCreateRequest interface.
|
||||
*/
|
||||
export function instanceOfGroupsCreateRequest(value: object): value is GroupsCreateRequest {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsCreateRequestFromJSON(json: any): GroupsCreateRequest {
|
||||
return GroupsCreateRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsCreateRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'name': json['name'],
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsCreateRequestToJSON(json: any): GroupsCreateRequest {
|
||||
return GroupsCreateRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsCreateRequestToJSONTyped(value?: GroupsCreateRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'name': value['name'],
|
||||
};
|
||||
}
|
||||
|
||||
88
src/gen/api/outline/models/GroupsInfo200Response.ts
Normal file
88
src/gen/api/outline/models/GroupsInfo200Response.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { Policy } from './Policy';
|
||||
import {
|
||||
PolicyFromJSON,
|
||||
PolicyFromJSONTyped,
|
||||
PolicyToJSON,
|
||||
PolicyToJSONTyped,
|
||||
} from './Policy';
|
||||
import type { Group } from './Group';
|
||||
import {
|
||||
GroupFromJSON,
|
||||
GroupFromJSONTyped,
|
||||
GroupToJSON,
|
||||
GroupToJSONTyped,
|
||||
} from './Group';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsInfo200Response
|
||||
*/
|
||||
export interface GroupsInfo200Response {
|
||||
/**
|
||||
*
|
||||
* @type {Group}
|
||||
* @memberof GroupsInfo200Response
|
||||
*/
|
||||
data?: Group;
|
||||
/**
|
||||
*
|
||||
* @type {Array<Policy>}
|
||||
* @memberof GroupsInfo200Response
|
||||
*/
|
||||
policies?: Array<Policy>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsInfo200Response interface.
|
||||
*/
|
||||
export function instanceOfGroupsInfo200Response(value: object): value is GroupsInfo200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsInfo200ResponseFromJSON(json: any): GroupsInfo200Response {
|
||||
return GroupsInfo200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsInfo200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : GroupFromJSON(json['data']),
|
||||
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsInfo200ResponseToJSON(json: any): GroupsInfo200Response {
|
||||
return GroupsInfo200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsInfo200ResponseToJSONTyped(value?: GroupsInfo200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': GroupToJSON(value['data']),
|
||||
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
66
src/gen/api/outline/models/GroupsInfoRequest.ts
Normal file
66
src/gen/api/outline/models/GroupsInfoRequest.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsInfoRequest
|
||||
*/
|
||||
export interface GroupsInfoRequest {
|
||||
/**
|
||||
* Unique identifier for the group.
|
||||
* @type {string}
|
||||
* @memberof GroupsInfoRequest
|
||||
*/
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsInfoRequest interface.
|
||||
*/
|
||||
export function instanceOfGroupsInfoRequest(value: object): value is GroupsInfoRequest {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsInfoRequestFromJSON(json: any): GroupsInfoRequest {
|
||||
return GroupsInfoRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsInfoRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'],
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsInfoRequestToJSON(json: any): GroupsInfoRequest {
|
||||
return GroupsInfoRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsInfoRequestToJSONTyped(value?: GroupsInfoRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
};
|
||||
}
|
||||
|
||||
103
src/gen/api/outline/models/GroupsList200Response.ts
Normal file
103
src/gen/api/outline/models/GroupsList200Response.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { 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 { GroupsList200ResponseData } from './GroupsList200ResponseData';
|
||||
import {
|
||||
GroupsList200ResponseDataFromJSON,
|
||||
GroupsList200ResponseDataFromJSONTyped,
|
||||
GroupsList200ResponseDataToJSON,
|
||||
GroupsList200ResponseDataToJSONTyped,
|
||||
} from './GroupsList200ResponseData';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsList200Response
|
||||
*/
|
||||
export interface GroupsList200Response {
|
||||
/**
|
||||
*
|
||||
* @type {GroupsList200ResponseData}
|
||||
* @memberof GroupsList200Response
|
||||
*/
|
||||
data?: GroupsList200ResponseData;
|
||||
/**
|
||||
*
|
||||
* @type {Array<Policy>}
|
||||
* @memberof GroupsList200Response
|
||||
*/
|
||||
policies?: Array<Policy>;
|
||||
/**
|
||||
*
|
||||
* @type {Pagination}
|
||||
* @memberof GroupsList200Response
|
||||
*/
|
||||
pagination?: Pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsList200Response interface.
|
||||
*/
|
||||
export function instanceOfGroupsList200Response(value: object): value is GroupsList200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseFromJSON(json: any): GroupsList200Response {
|
||||
return GroupsList200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsList200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : GroupsList200ResponseDataFromJSON(json['data']),
|
||||
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
|
||||
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseToJSON(json: any): GroupsList200Response {
|
||||
return GroupsList200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseToJSONTyped(value?: GroupsList200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': GroupsList200ResponseDataToJSON(value['data']),
|
||||
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
|
||||
'pagination': PaginationToJSON(value['pagination']),
|
||||
};
|
||||
}
|
||||
|
||||
88
src/gen/api/outline/models/GroupsList200ResponseData.ts
Normal file
88
src/gen/api/outline/models/GroupsList200ResponseData.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { Group } from './Group';
|
||||
import {
|
||||
GroupFromJSON,
|
||||
GroupFromJSONTyped,
|
||||
GroupToJSON,
|
||||
GroupToJSONTyped,
|
||||
} from './Group';
|
||||
import type { GroupMembership } from './GroupMembership';
|
||||
import {
|
||||
GroupMembershipFromJSON,
|
||||
GroupMembershipFromJSONTyped,
|
||||
GroupMembershipToJSON,
|
||||
GroupMembershipToJSONTyped,
|
||||
} from './GroupMembership';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsList200ResponseData
|
||||
*/
|
||||
export interface GroupsList200ResponseData {
|
||||
/**
|
||||
*
|
||||
* @type {Array<Group>}
|
||||
* @memberof GroupsList200ResponseData
|
||||
*/
|
||||
groups?: Array<Group>;
|
||||
/**
|
||||
* A preview of memberships in the group, note that this is not all memberships which can be queried from `groups.memberships`.
|
||||
* @type {Array<GroupMembership>}
|
||||
* @memberof GroupsList200ResponseData
|
||||
*/
|
||||
groupMemberships?: Array<GroupMembership>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsList200ResponseData interface.
|
||||
*/
|
||||
export function instanceOfGroupsList200ResponseData(value: object): value is GroupsList200ResponseData {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseDataFromJSON(json: any): GroupsList200ResponseData {
|
||||
return GroupsList200ResponseDataFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsList200ResponseData {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'groups': json['groups'] == null ? undefined : ((json['groups'] as Array<any>).map(GroupFromJSON)),
|
||||
'groupMemberships': json['groupMemberships'] == null ? undefined : ((json['groupMemberships'] as Array<any>).map(GroupMembershipFromJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseDataToJSON(json: any): GroupsList200ResponseData {
|
||||
return GroupsList200ResponseDataToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsList200ResponseDataToJSONTyped(value?: GroupsList200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'groups': value['groups'] == null ? undefined : ((value['groups'] as Array<any>).map(GroupToJSON)),
|
||||
'groupMemberships': value['groupMemberships'] == null ? undefined : ((value['groupMemberships'] as Array<any>).map(GroupMembershipToJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
124
src/gen/api/outline/models/GroupsListRequest.ts
Normal file
124
src/gen/api/outline/models/GroupsListRequest.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsListRequest
|
||||
*/
|
||||
export interface GroupsListRequest {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof GroupsListRequest
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof GroupsListRequest
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof GroupsListRequest
|
||||
*/
|
||||
sort?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof GroupsListRequest
|
||||
*/
|
||||
direction?: GroupsListRequestDirectionEnum;
|
||||
/**
|
||||
* Filter to groups including a specific user
|
||||
* @type {string}
|
||||
* @memberof GroupsListRequest
|
||||
*/
|
||||
userId?: string;
|
||||
/**
|
||||
* Filter to groups matching an external ID
|
||||
* @type {string}
|
||||
* @memberof GroupsListRequest
|
||||
*/
|
||||
externalId?: string;
|
||||
/**
|
||||
* Filter to groups matching a search query
|
||||
* @type {string}
|
||||
* @memberof GroupsListRequest
|
||||
*/
|
||||
query?: string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @export
|
||||
*/
|
||||
export const GroupsListRequestDirectionEnum = {
|
||||
Asc: 'ASC',
|
||||
Desc: 'DESC'
|
||||
} as const;
|
||||
export type GroupsListRequestDirectionEnum = typeof GroupsListRequestDirectionEnum[keyof typeof GroupsListRequestDirectionEnum];
|
||||
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsListRequest interface.
|
||||
*/
|
||||
export function instanceOfGroupsListRequest(value: object): value is GroupsListRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsListRequestFromJSON(json: any): GroupsListRequest {
|
||||
return GroupsListRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsListRequest {
|
||||
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'],
|
||||
'userId': json['userId'] == null ? undefined : json['userId'],
|
||||
'externalId': json['externalId'] == null ? undefined : json['externalId'],
|
||||
'query': json['query'] == null ? undefined : json['query'],
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsListRequestToJSON(json: any): GroupsListRequest {
|
||||
return GroupsListRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsListRequestToJSONTyped(value?: GroupsListRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'offset': value['offset'],
|
||||
'limit': value['limit'],
|
||||
'sort': value['sort'],
|
||||
'direction': value['direction'],
|
||||
'userId': value['userId'],
|
||||
'externalId': value['externalId'],
|
||||
'query': value['query'],
|
||||
};
|
||||
}
|
||||
|
||||
88
src/gen/api/outline/models/GroupsMemberships200Response.ts
Normal file
88
src/gen/api/outline/models/GroupsMemberships200Response.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { GroupsMemberships200ResponseData } from './GroupsMemberships200ResponseData';
|
||||
import {
|
||||
GroupsMemberships200ResponseDataFromJSON,
|
||||
GroupsMemberships200ResponseDataFromJSONTyped,
|
||||
GroupsMemberships200ResponseDataToJSON,
|
||||
GroupsMemberships200ResponseDataToJSONTyped,
|
||||
} from './GroupsMemberships200ResponseData';
|
||||
import type { Pagination } from './Pagination';
|
||||
import {
|
||||
PaginationFromJSON,
|
||||
PaginationFromJSONTyped,
|
||||
PaginationToJSON,
|
||||
PaginationToJSONTyped,
|
||||
} from './Pagination';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsMemberships200Response
|
||||
*/
|
||||
export interface GroupsMemberships200Response {
|
||||
/**
|
||||
*
|
||||
* @type {GroupsMemberships200ResponseData}
|
||||
* @memberof GroupsMemberships200Response
|
||||
*/
|
||||
data?: GroupsMemberships200ResponseData;
|
||||
/**
|
||||
*
|
||||
* @type {Pagination}
|
||||
* @memberof GroupsMemberships200Response
|
||||
*/
|
||||
pagination?: Pagination;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsMemberships200Response interface.
|
||||
*/
|
||||
export function instanceOfGroupsMemberships200Response(value: object): value is GroupsMemberships200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseFromJSON(json: any): GroupsMemberships200Response {
|
||||
return GroupsMemberships200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsMemberships200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : GroupsMemberships200ResponseDataFromJSON(json['data']),
|
||||
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseToJSON(json: any): GroupsMemberships200Response {
|
||||
return GroupsMemberships200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseToJSONTyped(value?: GroupsMemberships200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': GroupsMemberships200ResponseDataToJSON(value['data']),
|
||||
'pagination': PaginationToJSON(value['pagination']),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { User } from './User';
|
||||
import {
|
||||
UserFromJSON,
|
||||
UserFromJSONTyped,
|
||||
UserToJSON,
|
||||
UserToJSONTyped,
|
||||
} from './User';
|
||||
import type { GroupMembership } from './GroupMembership';
|
||||
import {
|
||||
GroupMembershipFromJSON,
|
||||
GroupMembershipFromJSONTyped,
|
||||
GroupMembershipToJSON,
|
||||
GroupMembershipToJSONTyped,
|
||||
} from './GroupMembership';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsMemberships200ResponseData
|
||||
*/
|
||||
export interface GroupsMemberships200ResponseData {
|
||||
/**
|
||||
*
|
||||
* @type {Array<User>}
|
||||
* @memberof GroupsMemberships200ResponseData
|
||||
*/
|
||||
users?: Array<User>;
|
||||
/**
|
||||
*
|
||||
* @type {Array<GroupMembership>}
|
||||
* @memberof GroupsMemberships200ResponseData
|
||||
*/
|
||||
groupMemberships?: Array<GroupMembership>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsMemberships200ResponseData interface.
|
||||
*/
|
||||
export function instanceOfGroupsMemberships200ResponseData(value: object): value is GroupsMemberships200ResponseData {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseDataFromJSON(json: any): GroupsMemberships200ResponseData {
|
||||
return GroupsMemberships200ResponseDataFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsMemberships200ResponseData {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'users': json['users'] == null ? undefined : ((json['users'] as Array<any>).map(UserFromJSON)),
|
||||
'groupMemberships': json['groupMemberships'] == null ? undefined : ((json['groupMemberships'] as Array<any>).map(GroupMembershipFromJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseDataToJSON(json: any): GroupsMemberships200ResponseData {
|
||||
return GroupsMemberships200ResponseDataToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsMemberships200ResponseDataToJSONTyped(value?: GroupsMemberships200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'users': value['users'] == null ? undefined : ((value['users'] as Array<any>).map(UserToJSON)),
|
||||
'groupMemberships': value['groupMemberships'] == null ? undefined : ((value['groupMemberships'] as Array<any>).map(GroupMembershipToJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
90
src/gen/api/outline/models/GroupsMembershipsRequest.ts
Normal file
90
src/gen/api/outline/models/GroupsMembershipsRequest.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsMembershipsRequest
|
||||
*/
|
||||
export interface GroupsMembershipsRequest {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof GroupsMembershipsRequest
|
||||
*/
|
||||
offset?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof GroupsMembershipsRequest
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Group id
|
||||
* @type {string}
|
||||
* @memberof GroupsMembershipsRequest
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Filter memberships by user names
|
||||
* @type {string}
|
||||
* @memberof GroupsMembershipsRequest
|
||||
*/
|
||||
query?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsMembershipsRequest interface.
|
||||
*/
|
||||
export function instanceOfGroupsMembershipsRequest(value: object): value is GroupsMembershipsRequest {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsMembershipsRequestFromJSON(json: any): GroupsMembershipsRequest {
|
||||
return GroupsMembershipsRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsMembershipsRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'offset': json['offset'] == null ? undefined : json['offset'],
|
||||
'limit': json['limit'] == null ? undefined : json['limit'],
|
||||
'id': json['id'],
|
||||
'query': json['query'] == null ? undefined : json['query'],
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsMembershipsRequestToJSON(json: any): GroupsMembershipsRequest {
|
||||
return GroupsMembershipsRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsMembershipsRequestToJSONTyped(value?: GroupsMembershipsRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'offset': value['offset'],
|
||||
'limit': value['limit'],
|
||||
'id': value['id'],
|
||||
'query': value['query'],
|
||||
};
|
||||
}
|
||||
|
||||
73
src/gen/api/outline/models/GroupsRemoveUser200Response.ts
Normal file
73
src/gen/api/outline/models/GroupsRemoveUser200Response.ts
Normal 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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { GroupsRemoveUser200ResponseData } from './GroupsRemoveUser200ResponseData';
|
||||
import {
|
||||
GroupsRemoveUser200ResponseDataFromJSON,
|
||||
GroupsRemoveUser200ResponseDataFromJSONTyped,
|
||||
GroupsRemoveUser200ResponseDataToJSON,
|
||||
GroupsRemoveUser200ResponseDataToJSONTyped,
|
||||
} from './GroupsRemoveUser200ResponseData';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsRemoveUser200Response
|
||||
*/
|
||||
export interface GroupsRemoveUser200Response {
|
||||
/**
|
||||
*
|
||||
* @type {GroupsRemoveUser200ResponseData}
|
||||
* @memberof GroupsRemoveUser200Response
|
||||
*/
|
||||
data?: GroupsRemoveUser200ResponseData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsRemoveUser200Response interface.
|
||||
*/
|
||||
export function instanceOfGroupsRemoveUser200Response(value: object): value is GroupsRemoveUser200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseFromJSON(json: any): GroupsRemoveUser200Response {
|
||||
return GroupsRemoveUser200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsRemoveUser200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : GroupsRemoveUser200ResponseDataFromJSON(json['data']),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseToJSON(json: any): GroupsRemoveUser200Response {
|
||||
return GroupsRemoveUser200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseToJSONTyped(value?: GroupsRemoveUser200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': GroupsRemoveUser200ResponseDataToJSON(value['data']),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { Group } from './Group';
|
||||
import {
|
||||
GroupFromJSON,
|
||||
GroupFromJSONTyped,
|
||||
GroupToJSON,
|
||||
GroupToJSONTyped,
|
||||
} from './Group';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsRemoveUser200ResponseData
|
||||
*/
|
||||
export interface GroupsRemoveUser200ResponseData {
|
||||
/**
|
||||
*
|
||||
* @type {Array<Group>}
|
||||
* @memberof GroupsRemoveUser200ResponseData
|
||||
*/
|
||||
groups?: Array<Group>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsRemoveUser200ResponseData interface.
|
||||
*/
|
||||
export function instanceOfGroupsRemoveUser200ResponseData(value: object): value is GroupsRemoveUser200ResponseData {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseDataFromJSON(json: any): GroupsRemoveUser200ResponseData {
|
||||
return GroupsRemoveUser200ResponseDataFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsRemoveUser200ResponseData {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'groups': json['groups'] == null ? undefined : ((json['groups'] as Array<any>).map(GroupFromJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseDataToJSON(json: any): GroupsRemoveUser200ResponseData {
|
||||
return GroupsRemoveUser200ResponseDataToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsRemoveUser200ResponseDataToJSONTyped(value?: GroupsRemoveUser200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'groups': value['groups'] == null ? undefined : ((value['groups'] as Array<any>).map(GroupToJSON)),
|
||||
};
|
||||
}
|
||||
|
||||
75
src/gen/api/outline/models/GroupsUpdateRequest.ts
Normal file
75
src/gen/api/outline/models/GroupsUpdateRequest.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible.
|
||||
*
|
||||
* The version of the OpenAPI document: 0.1.0
|
||||
* Contact: hello@getoutline.com
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface GroupsUpdateRequest
|
||||
*/
|
||||
export interface GroupsUpdateRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof GroupsUpdateRequest
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof GroupsUpdateRequest
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the GroupsUpdateRequest interface.
|
||||
*/
|
||||
export function instanceOfGroupsUpdateRequest(value: object): value is GroupsUpdateRequest {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function GroupsUpdateRequestFromJSON(json: any): GroupsUpdateRequest {
|
||||
return GroupsUpdateRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsUpdateRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'],
|
||||
'name': json['name'],
|
||||
};
|
||||
}
|
||||
|
||||
export function GroupsUpdateRequestToJSON(json: any): GroupsUpdateRequest {
|
||||
return GroupsUpdateRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function GroupsUpdateRequestToJSONTyped(value?: GroupsUpdateRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'name': value['name'],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user