add attachment models
This commit is contained in:
97
src/gen/api/outline/models/Attachment.ts
Normal file
97
src/gen/api/outline/models/Attachment.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of 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 Attachment
|
||||
*/
|
||||
export interface Attachment {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Attachment
|
||||
*/
|
||||
contentType?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof Attachment
|
||||
*/
|
||||
size?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Attachment
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof Attachment
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Identifier for the associated document, if any.
|
||||
* @type {string}
|
||||
* @memberof Attachment
|
||||
*/
|
||||
documentId?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the Attachment interface.
|
||||
*/
|
||||
export function instanceOfAttachment(value: object): value is Attachment {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AttachmentFromJSON(json: any): Attachment {
|
||||
return AttachmentFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachment {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'contentType': json['contentType'] == null ? undefined : json['contentType'],
|
||||
'size': json['size'] == null ? undefined : json['size'],
|
||||
'name': json['name'] == null ? undefined : json['name'],
|
||||
'url': json['url'] == null ? undefined : json['url'],
|
||||
'documentId': json['documentId'] == null ? undefined : json['documentId'],
|
||||
};
|
||||
}
|
||||
|
||||
export function AttachmentToJSON(json: any): Attachment {
|
||||
return AttachmentToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentToJSONTyped(value?: Attachment | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'contentType': value['contentType'],
|
||||
'size': value['size'],
|
||||
'name': value['name'],
|
||||
'url': value['url'],
|
||||
'documentId': value['documentId'],
|
||||
};
|
||||
}
|
||||
|
||||
73
src/gen/api/outline/models/AttachmentsCreate200Response.ts
Normal file
73
src/gen/api/outline/models/AttachmentsCreate200Response.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 { AttachmentsCreate200ResponseData } from './AttachmentsCreate200ResponseData';
|
||||
import {
|
||||
AttachmentsCreate200ResponseDataFromJSON,
|
||||
AttachmentsCreate200ResponseDataFromJSONTyped,
|
||||
AttachmentsCreate200ResponseDataToJSON,
|
||||
AttachmentsCreate200ResponseDataToJSONTyped,
|
||||
} from './AttachmentsCreate200ResponseData';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AttachmentsCreate200Response
|
||||
*/
|
||||
export interface AttachmentsCreate200Response {
|
||||
/**
|
||||
*
|
||||
* @type {AttachmentsCreate200ResponseData}
|
||||
* @memberof AttachmentsCreate200Response
|
||||
*/
|
||||
data?: AttachmentsCreate200ResponseData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AttachmentsCreate200Response interface.
|
||||
*/
|
||||
export function instanceOfAttachmentsCreate200Response(value: object): value is AttachmentsCreate200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseFromJSON(json: any): AttachmentsCreate200Response {
|
||||
return AttachmentsCreate200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsCreate200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'data': json['data'] == null ? undefined : AttachmentsCreate200ResponseDataFromJSON(json['data']),
|
||||
};
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseToJSON(json: any): AttachmentsCreate200Response {
|
||||
return AttachmentsCreate200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseToJSONTyped(value?: AttachmentsCreate200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'data': AttachmentsCreate200ResponseDataToJSON(value['data']),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of 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 { Attachment } from './Attachment';
|
||||
import {
|
||||
AttachmentFromJSON,
|
||||
AttachmentFromJSONTyped,
|
||||
AttachmentToJSON,
|
||||
AttachmentToJSONTyped,
|
||||
} from './Attachment';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AttachmentsCreate200ResponseData
|
||||
*/
|
||||
export interface AttachmentsCreate200ResponseData {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AttachmentsCreate200ResponseData
|
||||
*/
|
||||
maxUploadSize?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AttachmentsCreate200ResponseData
|
||||
*/
|
||||
uploadUrl?: string;
|
||||
/**
|
||||
*
|
||||
* @type {object}
|
||||
* @memberof AttachmentsCreate200ResponseData
|
||||
*/
|
||||
form?: object;
|
||||
/**
|
||||
*
|
||||
* @type {Attachment}
|
||||
* @memberof AttachmentsCreate200ResponseData
|
||||
*/
|
||||
attachment?: Attachment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AttachmentsCreate200ResponseData interface.
|
||||
*/
|
||||
export function instanceOfAttachmentsCreate200ResponseData(value: object): value is AttachmentsCreate200ResponseData {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseDataFromJSON(json: any): AttachmentsCreate200ResponseData {
|
||||
return AttachmentsCreate200ResponseDataFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsCreate200ResponseData {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'maxUploadSize': json['maxUploadSize'] == null ? undefined : json['maxUploadSize'],
|
||||
'uploadUrl': json['uploadUrl'] == null ? undefined : json['uploadUrl'],
|
||||
'form': json['form'] == null ? undefined : json['form'],
|
||||
'attachment': json['attachment'] == null ? undefined : AttachmentFromJSON(json['attachment']),
|
||||
};
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseDataToJSON(json: any): AttachmentsCreate200ResponseData {
|
||||
return AttachmentsCreate200ResponseDataToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsCreate200ResponseDataToJSONTyped(value?: AttachmentsCreate200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'maxUploadSize': value['maxUploadSize'],
|
||||
'uploadUrl': value['uploadUrl'],
|
||||
'form': value['form'],
|
||||
'attachment': AttachmentToJSON(value['attachment']),
|
||||
};
|
||||
}
|
||||
|
||||
92
src/gen/api/outline/models/AttachmentsCreateRequest.ts
Normal file
92
src/gen/api/outline/models/AttachmentsCreateRequest.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
/* 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 AttachmentsCreateRequest
|
||||
*/
|
||||
export interface AttachmentsCreateRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AttachmentsCreateRequest
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Identifier for the associated document, if any.
|
||||
* @type {string}
|
||||
* @memberof AttachmentsCreateRequest
|
||||
*/
|
||||
documentId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AttachmentsCreateRequest
|
||||
*/
|
||||
contentType: string;
|
||||
/**
|
||||
* Size of the file attachment in bytes.
|
||||
* @type {number}
|
||||
* @memberof AttachmentsCreateRequest
|
||||
*/
|
||||
size: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AttachmentsCreateRequest interface.
|
||||
*/
|
||||
export function instanceOfAttachmentsCreateRequest(value: object): value is AttachmentsCreateRequest {
|
||||
if (!('name' in value) || value['name'] === undefined) return false;
|
||||
if (!('contentType' in value) || value['contentType'] === undefined) return false;
|
||||
if (!('size' in value) || value['size'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AttachmentsCreateRequestFromJSON(json: any): AttachmentsCreateRequest {
|
||||
return AttachmentsCreateRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsCreateRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'name': json['name'],
|
||||
'documentId': json['documentId'] == null ? undefined : json['documentId'],
|
||||
'contentType': json['contentType'],
|
||||
'size': json['size'],
|
||||
};
|
||||
}
|
||||
|
||||
export function AttachmentsCreateRequestToJSON(json: any): AttachmentsCreateRequest {
|
||||
return AttachmentsCreateRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsCreateRequestToJSONTyped(value?: AttachmentsCreateRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'name': value['name'],
|
||||
'documentId': value['documentId'],
|
||||
'contentType': value['contentType'],
|
||||
'size': value['size'],
|
||||
};
|
||||
}
|
||||
|
||||
65
src/gen/api/outline/models/AttachmentsDelete200Response.ts
Normal file
65
src/gen/api/outline/models/AttachmentsDelete200Response.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Outline API
|
||||
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of 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 AttachmentsDelete200Response
|
||||
*/
|
||||
export interface AttachmentsDelete200Response {
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof AttachmentsDelete200Response
|
||||
*/
|
||||
success?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AttachmentsDelete200Response interface.
|
||||
*/
|
||||
export function instanceOfAttachmentsDelete200Response(value: object): value is AttachmentsDelete200Response {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AttachmentsDelete200ResponseFromJSON(json: any): AttachmentsDelete200Response {
|
||||
return AttachmentsDelete200ResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsDelete200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsDelete200Response {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'success': json['success'] == null ? undefined : json['success'],
|
||||
};
|
||||
}
|
||||
|
||||
export function AttachmentsDelete200ResponseToJSON(json: any): AttachmentsDelete200Response {
|
||||
return AttachmentsDelete200ResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsDelete200ResponseToJSONTyped(value?: AttachmentsDelete200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'success': value['success'],
|
||||
};
|
||||
}
|
||||
|
||||
66
src/gen/api/outline/models/AttachmentsRedirectRequest.ts
Normal file
66
src/gen/api/outline/models/AttachmentsRedirectRequest.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 AttachmentsRedirectRequest
|
||||
*/
|
||||
export interface AttachmentsRedirectRequest {
|
||||
/**
|
||||
* Unique identifier for the attachment.
|
||||
* @type {string}
|
||||
* @memberof AttachmentsRedirectRequest
|
||||
*/
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AttachmentsRedirectRequest interface.
|
||||
*/
|
||||
export function instanceOfAttachmentsRedirectRequest(value: object): value is AttachmentsRedirectRequest {
|
||||
if (!('id' in value) || value['id'] === undefined) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AttachmentsRedirectRequestFromJSON(json: any): AttachmentsRedirectRequest {
|
||||
return AttachmentsRedirectRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsRedirectRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsRedirectRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'],
|
||||
};
|
||||
}
|
||||
|
||||
export function AttachmentsRedirectRequestToJSON(json: any): AttachmentsRedirectRequest {
|
||||
return AttachmentsRedirectRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AttachmentsRedirectRequestToJSONTyped(value?: AttachmentsRedirectRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user