From 497469d0818802373ae7b9092ef6123e46cad89c Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Tue, 15 Jul 2025 18:00:55 +0200 Subject: [PATCH] add star models --- src/gen/api/outline/models/Star.ts | 100 +++++++++++++++++ .../outline/models/StarsCreate200Response.ts | 88 +++++++++++++++ .../api/outline/models/StarsCreateRequest.ts | 81 ++++++++++++++ .../outline/models/StarsList200Response.ts | 103 ++++++++++++++++++ .../models/StarsList200ResponseData.ts | 88 +++++++++++++++ .../api/outline/models/StarsUpdateRequest.ts | 75 +++++++++++++ 6 files changed, 535 insertions(+) create mode 100644 src/gen/api/outline/models/Star.ts create mode 100644 src/gen/api/outline/models/StarsCreate200Response.ts create mode 100644 src/gen/api/outline/models/StarsCreateRequest.ts create mode 100644 src/gen/api/outline/models/StarsList200Response.ts create mode 100644 src/gen/api/outline/models/StarsList200ResponseData.ts create mode 100644 src/gen/api/outline/models/StarsUpdateRequest.ts diff --git a/src/gen/api/outline/models/Star.ts b/src/gen/api/outline/models/Star.ts new file mode 100644 index 0000000..e74e04c --- /dev/null +++ b/src/gen/api/outline/models/Star.ts @@ -0,0 +1,100 @@ +/* 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 Star + */ +export interface Star { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Star + */ + readonly id?: string; + /** + * Index of the star in the list of stars. + * @type {string} + * @memberof Star + */ + index?: string; + /** + * Unique identifier for the starred document. + * @type {string} + * @memberof Star + */ + readonly documentId?: string; + /** + * Unique identifier for the starred collection. + * @type {string} + * @memberof Star + */ + readonly collectionId?: string; + /** + * URL of the original document. + * @type {string} + * @memberof Star + */ + readonly documentUrl?: string; + /** + * Date and time when this star was created + * @type {Date} + * @memberof Star + */ + readonly createdAt?: Date; +} + +/** + * Check if a given object implements the Star interface. + */ +export function instanceOfStar(value: object): value is Star { + return true; +} + +export function StarFromJSON(json: any): Star { + return StarFromJSONTyped(json, false); +} + +export function StarFromJSONTyped(json: any, ignoreDiscriminator: boolean): Star { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'index': json['index'] == null ? undefined : json['index'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'documentUrl': json['documentUrl'] == null ? undefined : json['documentUrl'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + }; +} + +export function StarToJSON(json: any): Star { + return StarToJSONTyped(json, false); +} + +export function StarToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'index': value['index'], + }; +} + diff --git a/src/gen/api/outline/models/StarsCreate200Response.ts b/src/gen/api/outline/models/StarsCreate200Response.ts new file mode 100644 index 0000000..47b2fc6 --- /dev/null +++ b/src/gen/api/outline/models/StarsCreate200Response.ts @@ -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 { Star } from './Star'; +import { + StarFromJSON, + StarFromJSONTyped, + StarToJSON, + StarToJSONTyped, +} from './Star'; + +/** + * + * @export + * @interface StarsCreate200Response + */ +export interface StarsCreate200Response { + /** + * + * @type {Star} + * @memberof StarsCreate200Response + */ + data?: Star; + /** + * + * @type {Array} + * @memberof StarsCreate200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the StarsCreate200Response interface. + */ +export function instanceOfStarsCreate200Response(value: object): value is StarsCreate200Response { + return true; +} + +export function StarsCreate200ResponseFromJSON(json: any): StarsCreate200Response { + return StarsCreate200ResponseFromJSONTyped(json, false); +} + +export function StarsCreate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsCreate200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : StarFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function StarsCreate200ResponseToJSON(json: any): StarsCreate200Response { + return StarsCreate200ResponseToJSONTyped(json, false); +} + +export function StarsCreate200ResponseToJSONTyped(value?: StarsCreate200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': StarToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/StarsCreateRequest.ts b/src/gen/api/outline/models/StarsCreateRequest.ts new file mode 100644 index 0000000..1a6ec89 --- /dev/null +++ b/src/gen/api/outline/models/StarsCreateRequest.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of 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 StarsCreateRequest + */ +export interface StarsCreateRequest { + /** + * + * @type {string} + * @memberof StarsCreateRequest + */ + documentId?: string; + /** + * + * @type {string} + * @memberof StarsCreateRequest + */ + collectionId?: string; + /** + * + * @type {string} + * @memberof StarsCreateRequest + */ + index?: string; +} + +/** + * Check if a given object implements the StarsCreateRequest interface. + */ +export function instanceOfStarsCreateRequest(value: object): value is StarsCreateRequest { + return true; +} + +export function StarsCreateRequestFromJSON(json: any): StarsCreateRequest { + return StarsCreateRequestFromJSONTyped(json, false); +} + +export function StarsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsCreateRequest { + if (json == null) { + return json; + } + return { + + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'index': json['index'] == null ? undefined : json['index'], + }; +} + +export function StarsCreateRequestToJSON(json: any): StarsCreateRequest { + return StarsCreateRequestToJSONTyped(json, false); +} + +export function StarsCreateRequestToJSONTyped(value?: StarsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'documentId': value['documentId'], + 'collectionId': value['collectionId'], + 'index': value['index'], + }; +} + diff --git a/src/gen/api/outline/models/StarsList200Response.ts b/src/gen/api/outline/models/StarsList200Response.ts new file mode 100644 index 0000000..09512a0 --- /dev/null +++ b/src/gen/api/outline/models/StarsList200Response.ts @@ -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 { StarsList200ResponseData } from './StarsList200ResponseData'; +import { + StarsList200ResponseDataFromJSON, + StarsList200ResponseDataFromJSONTyped, + StarsList200ResponseDataToJSON, + StarsList200ResponseDataToJSONTyped, +} from './StarsList200ResponseData'; + +/** + * + * @export + * @interface StarsList200Response + */ +export interface StarsList200Response { + /** + * + * @type {StarsList200ResponseData} + * @memberof StarsList200Response + */ + data?: StarsList200ResponseData; + /** + * + * @type {Pagination} + * @memberof StarsList200Response + */ + pagination?: Pagination; + /** + * + * @type {Array} + * @memberof StarsList200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the StarsList200Response interface. + */ +export function instanceOfStarsList200Response(value: object): value is StarsList200Response { + return true; +} + +export function StarsList200ResponseFromJSON(json: any): StarsList200Response { + return StarsList200ResponseFromJSONTyped(json, false); +} + +export function StarsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : StarsList200ResponseDataFromJSON(json['data']), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function StarsList200ResponseToJSON(json: any): StarsList200Response { + return StarsList200ResponseToJSONTyped(json, false); +} + +export function StarsList200ResponseToJSONTyped(value?: StarsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': StarsList200ResponseDataToJSON(value['data']), + 'pagination': PaginationToJSON(value['pagination']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/StarsList200ResponseData.ts b/src/gen/api/outline/models/StarsList200ResponseData.ts new file mode 100644 index 0000000..a320d8d --- /dev/null +++ b/src/gen/api/outline/models/StarsList200ResponseData.ts @@ -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 { Star } from './Star'; +import { + StarFromJSON, + StarFromJSONTyped, + StarToJSON, + StarToJSONTyped, +} from './Star'; +import type { Document } from './Document'; +import { + DocumentFromJSON, + DocumentFromJSONTyped, + DocumentToJSON, + DocumentToJSONTyped, +} from './Document'; + +/** + * + * @export + * @interface StarsList200ResponseData + */ +export interface StarsList200ResponseData { + /** + * + * @type {Array} + * @memberof StarsList200ResponseData + */ + stars?: Array; + /** + * + * @type {Array} + * @memberof StarsList200ResponseData + */ + documents?: Array; +} + +/** + * Check if a given object implements the StarsList200ResponseData interface. + */ +export function instanceOfStarsList200ResponseData(value: object): value is StarsList200ResponseData { + return true; +} + +export function StarsList200ResponseDataFromJSON(json: any): StarsList200ResponseData { + return StarsList200ResponseDataFromJSONTyped(json, false); +} + +export function StarsList200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsList200ResponseData { + if (json == null) { + return json; + } + return { + + 'stars': json['stars'] == null ? undefined : ((json['stars'] as Array).map(StarFromJSON)), + 'documents': json['documents'] == null ? undefined : ((json['documents'] as Array).map(DocumentFromJSON)), + }; +} + +export function StarsList200ResponseDataToJSON(json: any): StarsList200ResponseData { + return StarsList200ResponseDataToJSONTyped(json, false); +} + +export function StarsList200ResponseDataToJSONTyped(value?: StarsList200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'stars': value['stars'] == null ? undefined : ((value['stars'] as Array).map(StarToJSON)), + 'documents': value['documents'] == null ? undefined : ((value['documents'] as Array).map(DocumentToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/StarsUpdateRequest.ts b/src/gen/api/outline/models/StarsUpdateRequest.ts new file mode 100644 index 0000000..c04f4b7 --- /dev/null +++ b/src/gen/api/outline/models/StarsUpdateRequest.ts @@ -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 StarsUpdateRequest + */ +export interface StarsUpdateRequest { + /** + * + * @type {string} + * @memberof StarsUpdateRequest + */ + id: string; + /** + * + * @type {string} + * @memberof StarsUpdateRequest + */ + index: string; +} + +/** + * Check if a given object implements the StarsUpdateRequest interface. + */ +export function instanceOfStarsUpdateRequest(value: object): value is StarsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('index' in value) || value['index'] === undefined) return false; + return true; +} + +export function StarsUpdateRequestFromJSON(json: any): StarsUpdateRequest { + return StarsUpdateRequestFromJSONTyped(json, false); +} + +export function StarsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'index': json['index'], + }; +} + +export function StarsUpdateRequestToJSON(json: any): StarsUpdateRequest { + return StarsUpdateRequestToJSONTyped(json, false); +} + +export function StarsUpdateRequestToJSONTyped(value?: StarsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'index': value['index'], + }; +} +