add collection models
This commit is contained in:
195
src/gen/api/outline/models/Collection.ts
Normal file
195
src/gen/api/outline/models/Collection.ts
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
/* 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 { CollectionSort } from './CollectionSort';
|
||||||
|
import {
|
||||||
|
CollectionSortFromJSON,
|
||||||
|
CollectionSortFromJSONTyped,
|
||||||
|
CollectionSortToJSON,
|
||||||
|
CollectionSortToJSONTyped,
|
||||||
|
} from './CollectionSort';
|
||||||
|
import type { User } from './User';
|
||||||
|
import {
|
||||||
|
UserFromJSON,
|
||||||
|
UserFromJSONTyped,
|
||||||
|
UserToJSON,
|
||||||
|
UserToJSONTyped,
|
||||||
|
} from './User';
|
||||||
|
import type { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface Collection
|
||||||
|
*/
|
||||||
|
export interface Collection {
|
||||||
|
/**
|
||||||
|
* Unique identifier for the object.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
readonly id?: string;
|
||||||
|
/**
|
||||||
|
* A short unique identifier that can be used to identify the collection instead of the UUID.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
readonly urlId?: string;
|
||||||
|
/**
|
||||||
|
* The name of the collection.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
name?: string;
|
||||||
|
/**
|
||||||
|
* A description of the collection, may contain markdown formatting
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
description?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {CollectionSort}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
sort?: CollectionSort;
|
||||||
|
/**
|
||||||
|
* The position of the collection in the sidebar
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
index?: string;
|
||||||
|
/**
|
||||||
|
* A color representing the collection, this is used to help make collections more identifiable in the UI. It should be in HEX format including the #
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
color?: string;
|
||||||
|
/**
|
||||||
|
* A string that represents an icon in the outline-icons package or an emoji
|
||||||
|
* @type {string}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
icon?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
/**
|
||||||
|
* Whether public document sharing is enabled in this collection
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
sharing?: boolean;
|
||||||
|
/**
|
||||||
|
* The date and time that this object was created
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
readonly createdAt?: Date;
|
||||||
|
/**
|
||||||
|
* The date and time that this object was last changed
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
readonly updatedAt?: Date;
|
||||||
|
/**
|
||||||
|
* The date and time that this object was deleted
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
readonly deletedAt?: Date | null;
|
||||||
|
/**
|
||||||
|
* The date and time that this object was archived
|
||||||
|
* @type {Date}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
readonly archivedAt?: Date | null;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {User}
|
||||||
|
* @memberof Collection
|
||||||
|
*/
|
||||||
|
archivedBy?: User;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the Collection interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollection(value: object): value is Collection {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionFromJSON(json: any): Collection {
|
||||||
|
return CollectionFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Collection {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'] == null ? undefined : json['id'],
|
||||||
|
'urlId': json['urlId'] == null ? undefined : json['urlId'],
|
||||||
|
'name': json['name'] == null ? undefined : json['name'],
|
||||||
|
'description': json['description'] == null ? undefined : json['description'],
|
||||||
|
'sort': json['sort'] == null ? undefined : CollectionSortFromJSON(json['sort']),
|
||||||
|
'index': json['index'] == null ? undefined : json['index'],
|
||||||
|
'color': json['color'] == null ? undefined : json['color'],
|
||||||
|
'icon': json['icon'] == null ? undefined : json['icon'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
'sharing': json['sharing'] == null ? undefined : json['sharing'],
|
||||||
|
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
||||||
|
'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])),
|
||||||
|
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||||
|
'archivedAt': json['archivedAt'] == null ? undefined : (new Date(json['archivedAt'])),
|
||||||
|
'archivedBy': json['archivedBy'] == null ? undefined : UserFromJSON(json['archivedBy']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionToJSON(json: any): Collection {
|
||||||
|
return CollectionToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionToJSONTyped(value?: Omit<Collection, 'id'|'urlId'|'createdAt'|'updatedAt'|'deletedAt'|'archivedAt'> | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': value['name'],
|
||||||
|
'description': value['description'],
|
||||||
|
'sort': CollectionSortToJSON(value['sort']),
|
||||||
|
'index': value['index'],
|
||||||
|
'color': value['color'],
|
||||||
|
'icon': value['icon'],
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
'sharing': value['sharing'],
|
||||||
|
'archivedBy': UserToJSON(value['archivedBy']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
96
src/gen/api/outline/models/CollectionGroupMembership.ts
Normal file
96
src/gen/api/outline/models/CollectionGroupMembership.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Outline API
|
||||||
|
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of 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 { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionGroupMembership
|
||||||
|
*/
|
||||||
|
export interface CollectionGroupMembership {
|
||||||
|
/**
|
||||||
|
* Unique identifier for the object.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionGroupMembership
|
||||||
|
*/
|
||||||
|
readonly id?: string;
|
||||||
|
/**
|
||||||
|
* Identifier for the associated group.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionGroupMembership
|
||||||
|
*/
|
||||||
|
readonly groupId?: string;
|
||||||
|
/**
|
||||||
|
* Identifier for the associated collection.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionGroupMembership
|
||||||
|
*/
|
||||||
|
readonly collectionId?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof CollectionGroupMembership
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionGroupMembership interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionGroupMembership(value: object): value is CollectionGroupMembership {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionGroupMembershipFromJSON(json: any): CollectionGroupMembership {
|
||||||
|
return CollectionGroupMembershipFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionGroupMembershipFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionGroupMembership {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'] == null ? undefined : json['id'],
|
||||||
|
'groupId': json['groupId'] == null ? undefined : json['groupId'],
|
||||||
|
'collectionId': json['collectionId'] == null ? undefined : json['collectionId'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionGroupMembershipToJSON(json: any): CollectionGroupMembership {
|
||||||
|
return CollectionGroupMembershipToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionGroupMembershipToJSONTyped(value?: Omit<CollectionGroupMembership, 'id'|'groupId'|'collectionId'> | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
84
src/gen/api/outline/models/CollectionSort.ts
Normal file
84
src/gen/api/outline/models/CollectionSort.ts
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
/* tslint:disable */
|
||||||
|
/* eslint-disable */
|
||||||
|
/**
|
||||||
|
* Outline API
|
||||||
|
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of 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';
|
||||||
|
/**
|
||||||
|
* The sort of documents in the collection. Note that not all API responses respect this and it is left as a frontend concern to implement.
|
||||||
|
* @export
|
||||||
|
* @interface CollectionSort
|
||||||
|
*/
|
||||||
|
export interface CollectionSort {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionSort
|
||||||
|
*/
|
||||||
|
field?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionSort
|
||||||
|
*/
|
||||||
|
direction?: CollectionSortDirectionEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CollectionSortDirectionEnum = {
|
||||||
|
Asc: 'asc',
|
||||||
|
Desc: 'desc'
|
||||||
|
} as const;
|
||||||
|
export type CollectionSortDirectionEnum = typeof CollectionSortDirectionEnum[keyof typeof CollectionSortDirectionEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionSort interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionSort(value: object): value is CollectionSort {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionSortFromJSON(json: any): CollectionSort {
|
||||||
|
return CollectionSortFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionSortFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionSort {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'field': json['field'] == null ? undefined : json['field'],
|
||||||
|
'direction': json['direction'] == null ? undefined : json['direction'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionSortToJSON(json: any): CollectionSort {
|
||||||
|
return CollectionSortToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionSortToJSONTyped(value?: CollectionSort | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'field': value['field'],
|
||||||
|
'direction': value['direction'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
52
src/gen/api/outline/models/CollectionStatus.ts
Normal file
52
src/gen/api/outline/models/CollectionStatus.ts
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CollectionStatus = {
|
||||||
|
Archived: 'archived'
|
||||||
|
} as const;
|
||||||
|
export type CollectionStatus = typeof CollectionStatus[keyof typeof CollectionStatus];
|
||||||
|
|
||||||
|
|
||||||
|
export function instanceOfCollectionStatus(value: any): boolean {
|
||||||
|
for (const key in CollectionStatus) {
|
||||||
|
if (Object.prototype.hasOwnProperty.call(CollectionStatus, key)) {
|
||||||
|
if (CollectionStatus[key as keyof typeof CollectionStatus] === value) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionStatusFromJSON(json: any): CollectionStatus {
|
||||||
|
return CollectionStatusFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionStatus {
|
||||||
|
return json as CollectionStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionStatusToJSON(value?: CollectionStatus | null): any {
|
||||||
|
return value as any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): CollectionStatus {
|
||||||
|
return value as CollectionStatus;
|
||||||
|
}
|
||||||
|
|
||||||
73
src/gen/api/outline/models/CollectionsAddGroup200Response.ts
Normal file
73
src/gen/api/outline/models/CollectionsAddGroup200Response.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 { CollectionsAddGroup200ResponseData } from './CollectionsAddGroup200ResponseData';
|
||||||
|
import {
|
||||||
|
CollectionsAddGroup200ResponseDataFromJSON,
|
||||||
|
CollectionsAddGroup200ResponseDataFromJSONTyped,
|
||||||
|
CollectionsAddGroup200ResponseDataToJSON,
|
||||||
|
CollectionsAddGroup200ResponseDataToJSONTyped,
|
||||||
|
} from './CollectionsAddGroup200ResponseData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsAddGroup200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsAddGroup200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {CollectionsAddGroup200ResponseData}
|
||||||
|
* @memberof CollectionsAddGroup200Response
|
||||||
|
*/
|
||||||
|
data?: CollectionsAddGroup200ResponseData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsAddGroup200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsAddGroup200Response(value: object): value is CollectionsAddGroup200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseFromJSON(json: any): CollectionsAddGroup200Response {
|
||||||
|
return CollectionsAddGroup200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddGroup200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : CollectionsAddGroup200ResponseDataFromJSON(json['data']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseToJSON(json: any): CollectionsAddGroup200Response {
|
||||||
|
return CollectionsAddGroup200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseToJSONTyped(value?: CollectionsAddGroup200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': CollectionsAddGroup200ResponseDataToJSON(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 { CollectionGroupMembership } from './CollectionGroupMembership';
|
||||||
|
import {
|
||||||
|
CollectionGroupMembershipFromJSON,
|
||||||
|
CollectionGroupMembershipFromJSONTyped,
|
||||||
|
CollectionGroupMembershipToJSON,
|
||||||
|
CollectionGroupMembershipToJSONTyped,
|
||||||
|
} from './CollectionGroupMembership';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsAddGroup200ResponseData
|
||||||
|
*/
|
||||||
|
export interface CollectionsAddGroup200ResponseData {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<CollectionGroupMembership>}
|
||||||
|
* @memberof CollectionsAddGroup200ResponseData
|
||||||
|
*/
|
||||||
|
collectionGroupMemberships?: Array<CollectionGroupMembership>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsAddGroup200ResponseData interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsAddGroup200ResponseData(value: object): value is CollectionsAddGroup200ResponseData {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseDataFromJSON(json: any): CollectionsAddGroup200ResponseData {
|
||||||
|
return CollectionsAddGroup200ResponseDataFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddGroup200ResponseData {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'collectionGroupMemberships': json['collectionGroupMemberships'] == null ? undefined : ((json['collectionGroupMemberships'] as Array<any>).map(CollectionGroupMembershipFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseDataToJSON(json: any): CollectionsAddGroup200ResponseData {
|
||||||
|
return CollectionsAddGroup200ResponseDataToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroup200ResponseDataToJSONTyped(value?: CollectionsAddGroup200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'collectionGroupMemberships': value['collectionGroupMemberships'] == null ? undefined : ((value['collectionGroupMemberships'] as Array<any>).map(CollectionGroupMembershipToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
93
src/gen/api/outline/models/CollectionsAddGroupRequest.ts
Normal file
93
src/gen/api/outline/models/CollectionsAddGroupRequest.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';
|
||||||
|
import type { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsAddGroupRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsAddGroupRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsAddGroupRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsAddGroupRequest
|
||||||
|
*/
|
||||||
|
groupId: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof CollectionsAddGroupRequest
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsAddGroupRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsAddGroupRequest(value: object): value is CollectionsAddGroupRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
if (!('groupId' in value) || value['groupId'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroupRequestFromJSON(json: any): CollectionsAddGroupRequest {
|
||||||
|
return CollectionsAddGroupRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddGroupRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'],
|
||||||
|
'groupId': json['groupId'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroupRequestToJSON(json: any): CollectionsAddGroupRequest {
|
||||||
|
return CollectionsAddGroupRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddGroupRequestToJSONTyped(value?: CollectionsAddGroupRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value['id'],
|
||||||
|
'groupId': value['groupId'],
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
73
src/gen/api/outline/models/CollectionsAddUser200Response.ts
Normal file
73
src/gen/api/outline/models/CollectionsAddUser200Response.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 { CollectionsAddUser200ResponseData } from './CollectionsAddUser200ResponseData';
|
||||||
|
import {
|
||||||
|
CollectionsAddUser200ResponseDataFromJSON,
|
||||||
|
CollectionsAddUser200ResponseDataFromJSONTyped,
|
||||||
|
CollectionsAddUser200ResponseDataToJSON,
|
||||||
|
CollectionsAddUser200ResponseDataToJSONTyped,
|
||||||
|
} from './CollectionsAddUser200ResponseData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsAddUser200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsAddUser200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {CollectionsAddUser200ResponseData}
|
||||||
|
* @memberof CollectionsAddUser200Response
|
||||||
|
*/
|
||||||
|
data?: CollectionsAddUser200ResponseData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsAddUser200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsAddUser200Response(value: object): value is CollectionsAddUser200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseFromJSON(json: any): CollectionsAddUser200Response {
|
||||||
|
return CollectionsAddUser200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddUser200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : CollectionsAddUser200ResponseDataFromJSON(json['data']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseToJSON(json: any): CollectionsAddUser200Response {
|
||||||
|
return CollectionsAddUser200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseToJSONTyped(value?: CollectionsAddUser200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': CollectionsAddUser200ResponseDataToJSON(value['data']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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 { Membership } from './Membership';
|
||||||
|
import {
|
||||||
|
MembershipFromJSON,
|
||||||
|
MembershipFromJSONTyped,
|
||||||
|
MembershipToJSON,
|
||||||
|
MembershipToJSONTyped,
|
||||||
|
} from './Membership';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsAddUser200ResponseData
|
||||||
|
*/
|
||||||
|
export interface CollectionsAddUser200ResponseData {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<User>}
|
||||||
|
* @memberof CollectionsAddUser200ResponseData
|
||||||
|
*/
|
||||||
|
users?: Array<User>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Membership>}
|
||||||
|
* @memberof CollectionsAddUser200ResponseData
|
||||||
|
*/
|
||||||
|
memberships?: Array<Membership>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsAddUser200ResponseData interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsAddUser200ResponseData(value: object): value is CollectionsAddUser200ResponseData {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseDataFromJSON(json: any): CollectionsAddUser200ResponseData {
|
||||||
|
return CollectionsAddUser200ResponseDataFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddUser200ResponseData {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'users': json['users'] == null ? undefined : ((json['users'] as Array<any>).map(UserFromJSON)),
|
||||||
|
'memberships': json['memberships'] == null ? undefined : ((json['memberships'] as Array<any>).map(MembershipFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseDataToJSON(json: any): CollectionsAddUser200ResponseData {
|
||||||
|
return CollectionsAddUser200ResponseDataToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUser200ResponseDataToJSONTyped(value?: CollectionsAddUser200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'users': value['users'] == null ? undefined : ((value['users'] as Array<any>).map(UserToJSON)),
|
||||||
|
'memberships': value['memberships'] == null ? undefined : ((value['memberships'] as Array<any>).map(MembershipToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
93
src/gen/api/outline/models/CollectionsAddUserRequest.ts
Normal file
93
src/gen/api/outline/models/CollectionsAddUserRequest.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';
|
||||||
|
import type { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsAddUserRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsAddUserRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsAddUserRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsAddUserRequest
|
||||||
|
*/
|
||||||
|
userId: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof CollectionsAddUserRequest
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsAddUserRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsAddUserRequest(value: object): value is CollectionsAddUserRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
if (!('userId' in value) || value['userId'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUserRequestFromJSON(json: any): CollectionsAddUserRequest {
|
||||||
|
return CollectionsAddUserRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddUserRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'],
|
||||||
|
'userId': json['userId'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUserRequestToJSON(json: any): CollectionsAddUserRequest {
|
||||||
|
return CollectionsAddUserRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsAddUserRequestToJSONTyped(value?: CollectionsAddUserRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value['id'],
|
||||||
|
'userId': value['userId'],
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
116
src/gen/api/outline/models/CollectionsCreateRequest.ts
Normal file
116
src/gen/api/outline/models/CollectionsCreateRequest.ts
Normal file
@@ -0,0 +1,116 @@
|
|||||||
|
/* 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 { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsCreateRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsCreateRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsCreateRequest
|
||||||
|
*/
|
||||||
|
name: string;
|
||||||
|
/**
|
||||||
|
* A brief description of the collection, markdown supported.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsCreateRequest
|
||||||
|
*/
|
||||||
|
description?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof CollectionsCreateRequest
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
/**
|
||||||
|
* A string that represents an icon in the outline-icons package or an emoji
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsCreateRequest
|
||||||
|
*/
|
||||||
|
icon?: string;
|
||||||
|
/**
|
||||||
|
* A hex color code for the collection icon
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsCreateRequest
|
||||||
|
*/
|
||||||
|
color?: string;
|
||||||
|
/**
|
||||||
|
* Whether public sharing of documents is allowed
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CollectionsCreateRequest
|
||||||
|
*/
|
||||||
|
sharing?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsCreateRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsCreateRequest(value: object): value is CollectionsCreateRequest {
|
||||||
|
if (!('name' in value) || value['name'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsCreateRequestFromJSON(json: any): CollectionsCreateRequest {
|
||||||
|
return CollectionsCreateRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsCreateRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': json['name'],
|
||||||
|
'description': json['description'] == null ? undefined : json['description'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
'icon': json['icon'] == null ? undefined : json['icon'],
|
||||||
|
'color': json['color'] == null ? undefined : json['color'],
|
||||||
|
'sharing': json['sharing'] == null ? undefined : json['sharing'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsCreateRequestToJSON(json: any): CollectionsCreateRequest {
|
||||||
|
return CollectionsCreateRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsCreateRequestToJSONTyped(value?: CollectionsCreateRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'name': value['name'],
|
||||||
|
'description': value['description'],
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
'icon': value['icon'],
|
||||||
|
'color': value['color'],
|
||||||
|
'sharing': value['sharing'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
66
src/gen/api/outline/models/CollectionsDeleteRequest.ts
Normal file
66
src/gen/api/outline/models/CollectionsDeleteRequest.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 CollectionsDeleteRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsDeleteRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsDeleteRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsDeleteRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsDeleteRequest(value: object): value is CollectionsDeleteRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDeleteRequestFromJSON(json: any): CollectionsDeleteRequest {
|
||||||
|
return CollectionsDeleteRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDeleteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsDeleteRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDeleteRequestToJSON(json: any): CollectionsDeleteRequest {
|
||||||
|
return CollectionsDeleteRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDeleteRequestToJSONTyped(value?: CollectionsDeleteRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value['id'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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 { NavigationNode } from './NavigationNode';
|
||||||
|
import {
|
||||||
|
NavigationNodeFromJSON,
|
||||||
|
NavigationNodeFromJSONTyped,
|
||||||
|
NavigationNodeToJSON,
|
||||||
|
NavigationNodeToJSONTyped,
|
||||||
|
} from './NavigationNode';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsDocuments200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsDocuments200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<NavigationNode>}
|
||||||
|
* @memberof CollectionsDocuments200Response
|
||||||
|
*/
|
||||||
|
data?: Array<NavigationNode>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsDocuments200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsDocuments200Response(value: object): value is CollectionsDocuments200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDocuments200ResponseFromJSON(json: any): CollectionsDocuments200Response {
|
||||||
|
return CollectionsDocuments200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDocuments200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsDocuments200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(NavigationNodeFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDocuments200ResponseToJSON(json: any): CollectionsDocuments200Response {
|
||||||
|
return CollectionsDocuments200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsDocuments200ResponseToJSONTyped(value?: CollectionsDocuments200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(NavigationNodeToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
73
src/gen/api/outline/models/CollectionsExport200Response.ts
Normal file
73
src/gen/api/outline/models/CollectionsExport200Response.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 { CollectionsExport200ResponseData } from './CollectionsExport200ResponseData';
|
||||||
|
import {
|
||||||
|
CollectionsExport200ResponseDataFromJSON,
|
||||||
|
CollectionsExport200ResponseDataFromJSONTyped,
|
||||||
|
CollectionsExport200ResponseDataToJSON,
|
||||||
|
CollectionsExport200ResponseDataToJSONTyped,
|
||||||
|
} from './CollectionsExport200ResponseData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsExport200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsExport200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {CollectionsExport200ResponseData}
|
||||||
|
* @memberof CollectionsExport200Response
|
||||||
|
*/
|
||||||
|
data?: CollectionsExport200ResponseData;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsExport200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsExport200Response(value: object): value is CollectionsExport200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseFromJSON(json: any): CollectionsExport200Response {
|
||||||
|
return CollectionsExport200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExport200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : CollectionsExport200ResponseDataFromJSON(json['data']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseToJSON(json: any): CollectionsExport200Response {
|
||||||
|
return CollectionsExport200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseToJSONTyped(value?: CollectionsExport200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': CollectionsExport200ResponseDataToJSON(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 { FileOperation } from './FileOperation';
|
||||||
|
import {
|
||||||
|
FileOperationFromJSON,
|
||||||
|
FileOperationFromJSONTyped,
|
||||||
|
FileOperationToJSON,
|
||||||
|
FileOperationToJSONTyped,
|
||||||
|
} from './FileOperation';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsExport200ResponseData
|
||||||
|
*/
|
||||||
|
export interface CollectionsExport200ResponseData {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {FileOperation}
|
||||||
|
* @memberof CollectionsExport200ResponseData
|
||||||
|
*/
|
||||||
|
fileOperation?: FileOperation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsExport200ResponseData interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsExport200ResponseData(value: object): value is CollectionsExport200ResponseData {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseDataFromJSON(json: any): CollectionsExport200ResponseData {
|
||||||
|
return CollectionsExport200ResponseDataFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExport200ResponseData {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'fileOperation': json['fileOperation'] == null ? undefined : FileOperationFromJSON(json['fileOperation']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseDataToJSON(json: any): CollectionsExport200ResponseData {
|
||||||
|
return CollectionsExport200ResponseDataToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExport200ResponseDataToJSONTyped(value?: CollectionsExport200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'fileOperation': FileOperationToJSON(value['fileOperation']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
77
src/gen/api/outline/models/CollectionsExportAllRequest.ts
Normal file
77
src/gen/api/outline/models/CollectionsExportAllRequest.ts
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
/* 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 CollectionsExportAllRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsExportAllRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsExportAllRequest
|
||||||
|
*/
|
||||||
|
format?: CollectionsExportAllRequestFormatEnum;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CollectionsExportAllRequestFormatEnum = {
|
||||||
|
OutlineMarkdown: 'outline-markdown',
|
||||||
|
Json: 'json',
|
||||||
|
Html: 'html'
|
||||||
|
} as const;
|
||||||
|
export type CollectionsExportAllRequestFormatEnum = typeof CollectionsExportAllRequestFormatEnum[keyof typeof CollectionsExportAllRequestFormatEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsExportAllRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsExportAllRequest(value: object): value is CollectionsExportAllRequest {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportAllRequestFromJSON(json: any): CollectionsExportAllRequest {
|
||||||
|
return CollectionsExportAllRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportAllRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExportAllRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'format': json['format'] == null ? undefined : json['format'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportAllRequestToJSON(json: any): CollectionsExportAllRequest {
|
||||||
|
return CollectionsExportAllRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportAllRequestToJSONTyped(value?: CollectionsExportAllRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'format': value['format'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
86
src/gen/api/outline/models/CollectionsExportRequest.ts
Normal file
86
src/gen/api/outline/models/CollectionsExportRequest.ts
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
/* 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 CollectionsExportRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsExportRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsExportRequest
|
||||||
|
*/
|
||||||
|
format?: CollectionsExportRequestFormatEnum;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsExportRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CollectionsExportRequestFormatEnum = {
|
||||||
|
OutlineMarkdown: 'outline-markdown',
|
||||||
|
Json: 'json',
|
||||||
|
Html: 'html'
|
||||||
|
} as const;
|
||||||
|
export type CollectionsExportRequestFormatEnum = typeof CollectionsExportRequestFormatEnum[keyof typeof CollectionsExportRequestFormatEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsExportRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsExportRequest(value: object): value is CollectionsExportRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportRequestFromJSON(json: any): CollectionsExportRequest {
|
||||||
|
return CollectionsExportRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExportRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'format': json['format'] == null ? undefined : json['format'],
|
||||||
|
'id': json['id'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportRequestToJSON(json: any): CollectionsExportRequest {
|
||||||
|
return CollectionsExportRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsExportRequestToJSONTyped(value?: CollectionsExportRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'format': value['format'],
|
||||||
|
'id': value['id'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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 { CollectionsGroupMemberships200ResponseData } from './CollectionsGroupMemberships200ResponseData';
|
||||||
|
import {
|
||||||
|
CollectionsGroupMemberships200ResponseDataFromJSON,
|
||||||
|
CollectionsGroupMemberships200ResponseDataFromJSONTyped,
|
||||||
|
CollectionsGroupMemberships200ResponseDataToJSON,
|
||||||
|
CollectionsGroupMemberships200ResponseDataToJSONTyped,
|
||||||
|
} from './CollectionsGroupMemberships200ResponseData';
|
||||||
|
import type { Pagination } from './Pagination';
|
||||||
|
import {
|
||||||
|
PaginationFromJSON,
|
||||||
|
PaginationFromJSONTyped,
|
||||||
|
PaginationToJSON,
|
||||||
|
PaginationToJSONTyped,
|
||||||
|
} from './Pagination';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsGroupMemberships200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsGroupMemberships200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {CollectionsGroupMemberships200ResponseData}
|
||||||
|
* @memberof CollectionsGroupMemberships200Response
|
||||||
|
*/
|
||||||
|
data?: CollectionsGroupMemberships200ResponseData;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Pagination}
|
||||||
|
* @memberof CollectionsGroupMemberships200Response
|
||||||
|
*/
|
||||||
|
pagination?: Pagination;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsGroupMemberships200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsGroupMemberships200Response(value: object): value is CollectionsGroupMemberships200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseFromJSON(json: any): CollectionsGroupMemberships200Response {
|
||||||
|
return CollectionsGroupMemberships200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsGroupMemberships200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : CollectionsGroupMemberships200ResponseDataFromJSON(json['data']),
|
||||||
|
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseToJSON(json: any): CollectionsGroupMemberships200Response {
|
||||||
|
return CollectionsGroupMemberships200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseToJSONTyped(value?: CollectionsGroupMemberships200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': CollectionsGroupMemberships200ResponseDataToJSON(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 { Group } from './Group';
|
||||||
|
import {
|
||||||
|
GroupFromJSON,
|
||||||
|
GroupFromJSONTyped,
|
||||||
|
GroupToJSON,
|
||||||
|
GroupToJSONTyped,
|
||||||
|
} from './Group';
|
||||||
|
import type { CollectionGroupMembership } from './CollectionGroupMembership';
|
||||||
|
import {
|
||||||
|
CollectionGroupMembershipFromJSON,
|
||||||
|
CollectionGroupMembershipFromJSONTyped,
|
||||||
|
CollectionGroupMembershipToJSON,
|
||||||
|
CollectionGroupMembershipToJSONTyped,
|
||||||
|
} from './CollectionGroupMembership';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsGroupMemberships200ResponseData
|
||||||
|
*/
|
||||||
|
export interface CollectionsGroupMemberships200ResponseData {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Group>}
|
||||||
|
* @memberof CollectionsGroupMemberships200ResponseData
|
||||||
|
*/
|
||||||
|
groups?: Array<Group>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<CollectionGroupMembership>}
|
||||||
|
* @memberof CollectionsGroupMemberships200ResponseData
|
||||||
|
*/
|
||||||
|
collectionGroupMemberships?: Array<CollectionGroupMembership>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsGroupMemberships200ResponseData interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsGroupMemberships200ResponseData(value: object): value is CollectionsGroupMemberships200ResponseData {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseDataFromJSON(json: any): CollectionsGroupMemberships200ResponseData {
|
||||||
|
return CollectionsGroupMemberships200ResponseDataFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsGroupMemberships200ResponseData {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'groups': json['groups'] == null ? undefined : ((json['groups'] as Array<any>).map(GroupFromJSON)),
|
||||||
|
'collectionGroupMemberships': json['collectionGroupMemberships'] == null ? undefined : ((json['collectionGroupMemberships'] as Array<any>).map(CollectionGroupMembershipFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseDataToJSON(json: any): CollectionsGroupMemberships200ResponseData {
|
||||||
|
return CollectionsGroupMemberships200ResponseDataToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMemberships200ResponseDataToJSONTyped(value?: CollectionsGroupMemberships200ResponseData | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'groups': value['groups'] == null ? undefined : ((value['groups'] as Array<any>).map(GroupToJSON)),
|
||||||
|
'collectionGroupMemberships': value['collectionGroupMemberships'] == null ? undefined : ((value['collectionGroupMemberships'] as Array<any>).map(CollectionGroupMembershipToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
108
src/gen/api/outline/models/CollectionsGroupMembershipsRequest.ts
Normal file
108
src/gen/api/outline/models/CollectionsGroupMembershipsRequest.ts
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
/* 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 { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsGroupMembershipsRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsGroupMembershipsRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CollectionsGroupMembershipsRequest
|
||||||
|
*/
|
||||||
|
offset?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CollectionsGroupMembershipsRequest
|
||||||
|
*/
|
||||||
|
limit?: number;
|
||||||
|
/**
|
||||||
|
* Identifier for the collection
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsGroupMembershipsRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* Filter memberships by group names
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsGroupMembershipsRequest
|
||||||
|
*/
|
||||||
|
query?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof CollectionsGroupMembershipsRequest
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsGroupMembershipsRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsGroupMembershipsRequest(value: object): value is CollectionsGroupMembershipsRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMembershipsRequestFromJSON(json: any): CollectionsGroupMembershipsRequest {
|
||||||
|
return CollectionsGroupMembershipsRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsGroupMembershipsRequest {
|
||||||
|
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'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMembershipsRequestToJSON(json: any): CollectionsGroupMembershipsRequest {
|
||||||
|
return CollectionsGroupMembershipsRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsGroupMembershipsRequestToJSONTyped(value?: CollectionsGroupMembershipsRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'offset': value['offset'],
|
||||||
|
'limit': value['limit'],
|
||||||
|
'id': value['id'],
|
||||||
|
'query': value['query'],
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
88
src/gen/api/outline/models/CollectionsInfo200Response.ts
Normal file
88
src/gen/api/outline/models/CollectionsInfo200Response.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 { Collection } from './Collection';
|
||||||
|
import {
|
||||||
|
CollectionFromJSON,
|
||||||
|
CollectionFromJSONTyped,
|
||||||
|
CollectionToJSON,
|
||||||
|
CollectionToJSONTyped,
|
||||||
|
} from './Collection';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsInfo200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsInfo200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Collection}
|
||||||
|
* @memberof CollectionsInfo200Response
|
||||||
|
*/
|
||||||
|
data?: Collection;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Policy>}
|
||||||
|
* @memberof CollectionsInfo200Response
|
||||||
|
*/
|
||||||
|
policies?: Array<Policy>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsInfo200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsInfo200Response(value: object): value is CollectionsInfo200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfo200ResponseFromJSON(json: any): CollectionsInfo200Response {
|
||||||
|
return CollectionsInfo200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsInfo200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : CollectionFromJSON(json['data']),
|
||||||
|
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfo200ResponseToJSON(json: any): CollectionsInfo200Response {
|
||||||
|
return CollectionsInfo200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfo200ResponseToJSONTyped(value?: CollectionsInfo200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': CollectionToJSON(value['data']),
|
||||||
|
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
66
src/gen/api/outline/models/CollectionsInfoRequest.ts
Normal file
66
src/gen/api/outline/models/CollectionsInfoRequest.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 CollectionsInfoRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsInfoRequest {
|
||||||
|
/**
|
||||||
|
* Unique identifier for the collection.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsInfoRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsInfoRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsInfoRequest(value: object): value is CollectionsInfoRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfoRequestFromJSON(json: any): CollectionsInfoRequest {
|
||||||
|
return CollectionsInfoRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsInfoRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfoRequestToJSON(json: any): CollectionsInfoRequest {
|
||||||
|
return CollectionsInfoRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsInfoRequestToJSONTyped(value?: CollectionsInfoRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value['id'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
103
src/gen/api/outline/models/CollectionsList200Response.ts
Normal file
103
src/gen/api/outline/models/CollectionsList200Response.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 { Collection } from './Collection';
|
||||||
|
import {
|
||||||
|
CollectionFromJSON,
|
||||||
|
CollectionFromJSONTyped,
|
||||||
|
CollectionToJSON,
|
||||||
|
CollectionToJSONTyped,
|
||||||
|
} from './Collection';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsList200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsList200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Collection>}
|
||||||
|
* @memberof CollectionsList200Response
|
||||||
|
*/
|
||||||
|
data?: Array<Collection>;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Pagination}
|
||||||
|
* @memberof CollectionsList200Response
|
||||||
|
*/
|
||||||
|
pagination?: Pagination;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Array<Policy>}
|
||||||
|
* @memberof CollectionsList200Response
|
||||||
|
*/
|
||||||
|
policies?: Array<Policy>;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsList200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsList200Response(value: object): value is CollectionsList200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsList200ResponseFromJSON(json: any): CollectionsList200Response {
|
||||||
|
return CollectionsList200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsList200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : ((json['data'] as Array<any>).map(CollectionFromJSON)),
|
||||||
|
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
|
||||||
|
'policies': json['policies'] == null ? undefined : ((json['policies'] as Array<any>).map(PolicyFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsList200ResponseToJSON(json: any): CollectionsList200Response {
|
||||||
|
return CollectionsList200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsList200ResponseToJSONTyped(value?: CollectionsList200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': value['data'] == null ? undefined : ((value['data'] as Array<any>).map(CollectionToJSON)),
|
||||||
|
'pagination': PaginationToJSON(value['pagination']),
|
||||||
|
'policies': value['policies'] == null ? undefined : ((value['policies'] as Array<any>).map(PolicyToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
124
src/gen/api/outline/models/CollectionsListRequest.ts
Normal file
124
src/gen/api/outline/models/CollectionsListRequest.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';
|
||||||
|
import type { CollectionStatus } from './CollectionStatus';
|
||||||
|
import {
|
||||||
|
CollectionStatusFromJSON,
|
||||||
|
CollectionStatusFromJSONTyped,
|
||||||
|
CollectionStatusToJSON,
|
||||||
|
CollectionStatusToJSONTyped,
|
||||||
|
} from './CollectionStatus';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsListRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsListRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CollectionsListRequest
|
||||||
|
*/
|
||||||
|
offset?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CollectionsListRequest
|
||||||
|
*/
|
||||||
|
limit?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsListRequest
|
||||||
|
*/
|
||||||
|
sort?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsListRequest
|
||||||
|
*/
|
||||||
|
direction?: CollectionsListRequestDirectionEnum;
|
||||||
|
/**
|
||||||
|
* If set, will filter the results by collection name.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsListRequest
|
||||||
|
*/
|
||||||
|
query?: string;
|
||||||
|
/**
|
||||||
|
* An optional array of statuses to filter by.
|
||||||
|
* @type {Array<CollectionStatus>}
|
||||||
|
* @memberof CollectionsListRequest
|
||||||
|
*/
|
||||||
|
statusFilter?: Array<CollectionStatus>;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @export
|
||||||
|
*/
|
||||||
|
export const CollectionsListRequestDirectionEnum = {
|
||||||
|
Asc: 'ASC',
|
||||||
|
Desc: 'DESC'
|
||||||
|
} as const;
|
||||||
|
export type CollectionsListRequestDirectionEnum = typeof CollectionsListRequestDirectionEnum[keyof typeof CollectionsListRequestDirectionEnum];
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsListRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsListRequest(value: object): value is CollectionsListRequest {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsListRequestFromJSON(json: any): CollectionsListRequest {
|
||||||
|
return CollectionsListRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsListRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'offset': json['offset'] == null ? undefined : json['offset'],
|
||||||
|
'limit': json['limit'] == null ? undefined : json['limit'],
|
||||||
|
'sort': json['sort'] == null ? undefined : json['sort'],
|
||||||
|
'direction': json['direction'] == null ? undefined : json['direction'],
|
||||||
|
'query': json['query'] == null ? undefined : json['query'],
|
||||||
|
'statusFilter': json['statusFilter'] == null ? undefined : ((json['statusFilter'] as Array<any>).map(CollectionStatusFromJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsListRequestToJSON(json: any): CollectionsListRequest {
|
||||||
|
return CollectionsListRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsListRequestToJSONTyped(value?: CollectionsListRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'offset': value['offset'],
|
||||||
|
'limit': value['limit'],
|
||||||
|
'sort': value['sort'],
|
||||||
|
'direction': value['direction'],
|
||||||
|
'query': value['query'],
|
||||||
|
'statusFilter': value['statusFilter'] == null ? undefined : ((value['statusFilter'] as Array<any>).map(CollectionStatusToJSON)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@@ -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 { CollectionsAddUser200ResponseData } from './CollectionsAddUser200ResponseData';
|
||||||
|
import {
|
||||||
|
CollectionsAddUser200ResponseDataFromJSON,
|
||||||
|
CollectionsAddUser200ResponseDataFromJSONTyped,
|
||||||
|
CollectionsAddUser200ResponseDataToJSON,
|
||||||
|
CollectionsAddUser200ResponseDataToJSONTyped,
|
||||||
|
} from './CollectionsAddUser200ResponseData';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsMemberships200Response
|
||||||
|
*/
|
||||||
|
export interface CollectionsMemberships200Response {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {CollectionsAddUser200ResponseData}
|
||||||
|
* @memberof CollectionsMemberships200Response
|
||||||
|
*/
|
||||||
|
data?: CollectionsAddUser200ResponseData;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Pagination}
|
||||||
|
* @memberof CollectionsMemberships200Response
|
||||||
|
*/
|
||||||
|
pagination?: Pagination;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsMemberships200Response interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsMemberships200Response(value: object): value is CollectionsMemberships200Response {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMemberships200ResponseFromJSON(json: any): CollectionsMemberships200Response {
|
||||||
|
return CollectionsMemberships200ResponseFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMemberships200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsMemberships200Response {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': json['data'] == null ? undefined : CollectionsAddUser200ResponseDataFromJSON(json['data']),
|
||||||
|
'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMemberships200ResponseToJSON(json: any): CollectionsMemberships200Response {
|
||||||
|
return CollectionsMemberships200ResponseToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMemberships200ResponseToJSONTyped(value?: CollectionsMemberships200Response | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'data': CollectionsAddUser200ResponseDataToJSON(value['data']),
|
||||||
|
'pagination': PaginationToJSON(value['pagination']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
108
src/gen/api/outline/models/CollectionsMembershipsRequest.ts
Normal file
108
src/gen/api/outline/models/CollectionsMembershipsRequest.ts
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
/* 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 { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsMembershipsRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsMembershipsRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CollectionsMembershipsRequest
|
||||||
|
*/
|
||||||
|
offset?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof CollectionsMembershipsRequest
|
||||||
|
*/
|
||||||
|
limit?: number;
|
||||||
|
/**
|
||||||
|
* Identifier for the collection
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsMembershipsRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
* Filter memberships by user names
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsMembershipsRequest
|
||||||
|
*/
|
||||||
|
query?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof CollectionsMembershipsRequest
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsMembershipsRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsMembershipsRequest(value: object): value is CollectionsMembershipsRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMembershipsRequestFromJSON(json: any): CollectionsMembershipsRequest {
|
||||||
|
return CollectionsMembershipsRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsMembershipsRequest {
|
||||||
|
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'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMembershipsRequestToJSON(json: any): CollectionsMembershipsRequest {
|
||||||
|
return CollectionsMembershipsRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsMembershipsRequestToJSONTyped(value?: CollectionsMembershipsRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'offset': value['offset'],
|
||||||
|
'limit': value['limit'],
|
||||||
|
'id': value['id'],
|
||||||
|
'query': value['query'],
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
75
src/gen/api/outline/models/CollectionsRemoveGroupRequest.ts
Normal file
75
src/gen/api/outline/models/CollectionsRemoveGroupRequest.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 CollectionsRemoveGroupRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsRemoveGroupRequest {
|
||||||
|
/**
|
||||||
|
* Identifier for the collection
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsRemoveGroupRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsRemoveGroupRequest
|
||||||
|
*/
|
||||||
|
groupId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsRemoveGroupRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsRemoveGroupRequest(value: object): value is CollectionsRemoveGroupRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
if (!('groupId' in value) || value['groupId'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveGroupRequestFromJSON(json: any): CollectionsRemoveGroupRequest {
|
||||||
|
return CollectionsRemoveGroupRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveGroupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsRemoveGroupRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'],
|
||||||
|
'groupId': json['groupId'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveGroupRequestToJSON(json: any): CollectionsRemoveGroupRequest {
|
||||||
|
return CollectionsRemoveGroupRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveGroupRequestToJSONTyped(value?: CollectionsRemoveGroupRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value['id'],
|
||||||
|
'groupId': value['groupId'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
75
src/gen/api/outline/models/CollectionsRemoveUserRequest.ts
Normal file
75
src/gen/api/outline/models/CollectionsRemoveUserRequest.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 CollectionsRemoveUserRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsRemoveUserRequest {
|
||||||
|
/**
|
||||||
|
* Identifier for the collection
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsRemoveUserRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsRemoveUserRequest
|
||||||
|
*/
|
||||||
|
userId: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsRemoveUserRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsRemoveUserRequest(value: object): value is CollectionsRemoveUserRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
if (!('userId' in value) || value['userId'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveUserRequestFromJSON(json: any): CollectionsRemoveUserRequest {
|
||||||
|
return CollectionsRemoveUserRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsRemoveUserRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'],
|
||||||
|
'userId': json['userId'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveUserRequestToJSON(json: any): CollectionsRemoveUserRequest {
|
||||||
|
return CollectionsRemoveUserRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsRemoveUserRequestToJSONTyped(value?: CollectionsRemoveUserRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value['id'],
|
||||||
|
'userId': value['userId'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
124
src/gen/api/outline/models/CollectionsUpdateRequest.ts
Normal file
124
src/gen/api/outline/models/CollectionsUpdateRequest.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';
|
||||||
|
import type { Permission } from './Permission';
|
||||||
|
import {
|
||||||
|
PermissionFromJSON,
|
||||||
|
PermissionFromJSONTyped,
|
||||||
|
PermissionToJSON,
|
||||||
|
PermissionToJSONTyped,
|
||||||
|
} from './Permission';
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @export
|
||||||
|
* @interface CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
export interface CollectionsUpdateRequest {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
id: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
name?: string;
|
||||||
|
/**
|
||||||
|
* A brief description of the collection, markdown supported.
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
description?: string;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {Permission}
|
||||||
|
* @memberof CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
permission?: Permission;
|
||||||
|
/**
|
||||||
|
* A string that represents an icon in the outline-icons package or an emoji
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
icon?: string;
|
||||||
|
/**
|
||||||
|
* A hex color code for the collection icon
|
||||||
|
* @type {string}
|
||||||
|
* @memberof CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
color?: string;
|
||||||
|
/**
|
||||||
|
* Whether public sharing of documents is allowed
|
||||||
|
* @type {boolean}
|
||||||
|
* @memberof CollectionsUpdateRequest
|
||||||
|
*/
|
||||||
|
sharing?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if a given object implements the CollectionsUpdateRequest interface.
|
||||||
|
*/
|
||||||
|
export function instanceOfCollectionsUpdateRequest(value: object): value is CollectionsUpdateRequest {
|
||||||
|
if (!('id' in value) || value['id'] === undefined) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsUpdateRequestFromJSON(json: any): CollectionsUpdateRequest {
|
||||||
|
return CollectionsUpdateRequestFromJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsUpdateRequest {
|
||||||
|
if (json == null) {
|
||||||
|
return json;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': json['id'],
|
||||||
|
'name': json['name'] == null ? undefined : json['name'],
|
||||||
|
'description': json['description'] == null ? undefined : json['description'],
|
||||||
|
'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']),
|
||||||
|
'icon': json['icon'] == null ? undefined : json['icon'],
|
||||||
|
'color': json['color'] == null ? undefined : json['color'],
|
||||||
|
'sharing': json['sharing'] == null ? undefined : json['sharing'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsUpdateRequestToJSON(json: any): CollectionsUpdateRequest {
|
||||||
|
return CollectionsUpdateRequestToJSONTyped(json, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function CollectionsUpdateRequestToJSONTyped(value?: CollectionsUpdateRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||||
|
if (value == null) {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
|
||||||
|
'id': value['id'],
|
||||||
|
'name': value['name'],
|
||||||
|
'description': value['description'],
|
||||||
|
'permission': PermissionToJSON(value['permission']),
|
||||||
|
'icon': value['icon'],
|
||||||
|
'color': value['color'],
|
||||||
|
'sharing': value['sharing'],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user