add rest of gen

This commit is contained in:
2025-07-15 18:01:46 +02:00
parent 44168374dd
commit 1b7889ba4c
5 changed files with 726 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@@ -0,0 +1,171 @@
.openapi-generator-ignore
apis/AttachmentsApi.ts
apis/AuthApi.ts
apis/CollectionsApi.ts
apis/CommentsApi.ts
apis/DocumentsApi.ts
apis/EventsApi.ts
apis/FileOperationsApi.ts
apis/GroupsApi.ts
apis/OAuthClientsApi.ts
apis/RevisionsApi.ts
apis/SharesApi.ts
apis/StarsApi.ts
apis/UsersApi.ts
apis/ViewsApi.ts
apis/index.ts
index.ts
models/Ability.ts
models/Attachment.ts
models/AttachmentsCreate200Response.ts
models/AttachmentsCreate200ResponseData.ts
models/AttachmentsCreateRequest.ts
models/AttachmentsDelete200Response.ts
models/AttachmentsRedirectRequest.ts
models/Auth.ts
models/AuthConfig200Response.ts
models/AuthConfig200ResponseData.ts
models/AuthConfig200ResponseDataServicesInner.ts
models/AuthInfo200Response.ts
models/Collection.ts
models/CollectionGroupMembership.ts
models/CollectionSort.ts
models/CollectionStatus.ts
models/CollectionsAddGroup200Response.ts
models/CollectionsAddGroup200ResponseData.ts
models/CollectionsAddGroupRequest.ts
models/CollectionsAddUser200Response.ts
models/CollectionsAddUser200ResponseData.ts
models/CollectionsAddUserRequest.ts
models/CollectionsCreateRequest.ts
models/CollectionsDeleteRequest.ts
models/CollectionsDocuments200Response.ts
models/CollectionsExport200Response.ts
models/CollectionsExport200ResponseData.ts
models/CollectionsExportAllRequest.ts
models/CollectionsExportRequest.ts
models/CollectionsGroupMemberships200Response.ts
models/CollectionsGroupMemberships200ResponseData.ts
models/CollectionsGroupMembershipsRequest.ts
models/CollectionsInfo200Response.ts
models/CollectionsInfoRequest.ts
models/CollectionsList200Response.ts
models/CollectionsListRequest.ts
models/CollectionsMemberships200Response.ts
models/CollectionsMembershipsRequest.ts
models/CollectionsRemoveGroupRequest.ts
models/CollectionsRemoveUserRequest.ts
models/CollectionsUpdateRequest.ts
models/Comment.ts
models/CommentsCreate200Response.ts
models/CommentsCreateRequest.ts
models/CommentsInfo200Response.ts
models/CommentsInfoRequest.ts
models/CommentsList200Response.ts
models/CommentsListRequest.ts
models/CommentsUpdateRequest.ts
models/Document.ts
models/DocumentsAddUserRequest.ts
models/DocumentsAnswerquestion200Response.ts
models/DocumentsAnswerquestionRequest.ts
models/DocumentsCreateRequest.ts
models/DocumentsDeleteRequest.ts
models/DocumentsDraftsRequest.ts
models/DocumentsExport200Response.ts
models/DocumentsExportRequest.ts
models/DocumentsInfo200Response.ts
models/DocumentsInfoRequest.ts
models/DocumentsList200Response.ts
models/DocumentsListRequest.ts
models/DocumentsMembershipsRequest.ts
models/DocumentsMove200Response.ts
models/DocumentsMove200ResponseData.ts
models/DocumentsMoveRequest.ts
models/DocumentsRemoveUserRequest.ts
models/DocumentsRestoreRequest.ts
models/DocumentsSearch200Response.ts
models/DocumentsSearch200ResponseDataInner.ts
models/DocumentsSearchRequest.ts
models/DocumentsUnpublishRequest.ts
models/DocumentsUpdateRequest.ts
models/DocumentsUsers200Response.ts
models/DocumentsUsersRequest.ts
models/DocumentsViewedRequest.ts
models/Event.ts
models/EventsList200Response.ts
models/EventsListRequest.ts
models/FileOperation.ts
models/FileoperationsInfo200Response.ts
models/FileoperationsInfoRequest.ts
models/FileoperationsList200Response.ts
models/FileoperationsListRequest.ts
models/Group.ts
models/GroupMembership.ts
models/GroupsAddUser200Response.ts
models/GroupsAddUser200ResponseData.ts
models/GroupsAddUserRequest.ts
models/GroupsCreateRequest.ts
models/GroupsInfo200Response.ts
models/GroupsInfoRequest.ts
models/GroupsList200Response.ts
models/GroupsList200ResponseData.ts
models/GroupsListRequest.ts
models/GroupsMemberships200Response.ts
models/GroupsMemberships200ResponseData.ts
models/GroupsMembershipsRequest.ts
models/GroupsRemoveUser200Response.ts
models/GroupsRemoveUser200ResponseData.ts
models/GroupsUpdateRequest.ts
models/InlineObject.ts
models/Invite.ts
models/Membership.ts
models/ModelError.ts
models/NavigationNode.ts
models/OAuthClient.ts
models/OauthClientsCreateRequest.ts
models/OauthClientsInfo200Response.ts
models/OauthClientsInfoRequest.ts
models/OauthClientsList200Response.ts
models/OauthClientsRotateSecretRequest.ts
models/OauthClientsUpdateRequest.ts
models/Pagination.ts
models/Permission.ts
models/Policy.ts
models/Revision.ts
models/RevisionsInfo200Response.ts
models/RevisionsInfoRequest.ts
models/RevisionsList200Response.ts
models/RevisionsListRequest.ts
models/SearchResult.ts
models/Share.ts
models/SharesCreateRequest.ts
models/SharesInfo200Response.ts
models/SharesInfoRequest.ts
models/SharesList200Response.ts
models/SharesListRequest.ts
models/SharesUpdateRequest.ts
models/Sorting.ts
models/Star.ts
models/StarsCreate200Response.ts
models/StarsCreateRequest.ts
models/StarsList200Response.ts
models/StarsList200ResponseData.ts
models/StarsUpdateRequest.ts
models/Team.ts
models/User.ts
models/UserRole.ts
models/UsersInfo200Response.ts
models/UsersInfoRequest.ts
models/UsersInvite200Response.ts
models/UsersInvite200ResponseData.ts
models/UsersInviteRequest.ts
models/UsersList200Response.ts
models/UsersListRequest.ts
models/UsersUpdateRequest.ts
models/UsersUpdateRoleRequest.ts
models/View.ts
models/ViewsCreate200Response.ts
models/ViewsList200Response.ts
models/ViewsListRequest.ts
models/index.ts
runtime.ts

View File

@@ -0,0 +1 @@
7.14.0

View File

@@ -0,0 +1,5 @@
/* tslint:disable */
/* eslint-disable */
export * from './runtime';
export * from './apis/index';
export * from './models/index';

View File

@@ -0,0 +1,526 @@
/* tslint:disable */
/* eslint-disable */
/**
* Outline API
* # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outlines data in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if thats your jam it can be used to generate clients for most programming languages. # Making requests Outlines API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, heres an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If theres an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code these can be used in an interface to adjust which elements are visible.
*
* The version of the OpenAPI document: 0.1.0
* Contact: hello@getoutline.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
export const BASE_PATH = "https://app.getoutline.com/api".replace(/\/+$/, "");
export interface ConfigurationParameters {
basePath?: string; // override base path
fetchApi?: FetchAPI; // override for fetch implementation
middleware?: Middleware[]; // middleware to apply before/after fetch requests
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
username?: string; // parameter for basic security
password?: string; // parameter for basic security
apiKey?:
| string
| Promise<string>
| ((name: string) => string | Promise<string>); // parameter for apiKey security
accessToken?:
| string
| Promise<string>
| ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
headers?: HTTPHeaders; //header params we want to use on every request
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
}
export class Configuration {
constructor(private configuration: ConfigurationParameters = {}) {}
set config(configuration: Configuration) {
this.configuration = configuration;
}
get basePath(): string {
return this.configuration.basePath != null
? this.configuration.basePath
: BASE_PATH;
}
get fetchApi(): FetchAPI | undefined {
return this.configuration.fetchApi;
}
get middleware(): Middleware[] {
return this.configuration.middleware || [];
}
get queryParamsStringify(): (params: HTTPQuery) => string {
return this.configuration.queryParamsStringify || querystring;
}
get username(): string | undefined {
return this.configuration.username;
}
get password(): string | undefined {
return this.configuration.password;
}
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return undefined;
}
get accessToken():
| ((name?: string, scopes?: string[]) => string | Promise<string>)
| undefined {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function"
? accessToken
: async () => accessToken;
}
return undefined;
}
get headers(): HTTPHeaders | undefined {
return this.configuration.headers;
}
get credentials(): RequestCredentials | undefined {
return this.configuration.credentials;
}
}
export const DefaultConfig = new Configuration();
/**
* This is the base class for all generated API classes.
*/
export class BaseAPI {
private static readonly jsonRegex = new RegExp(
"^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$",
"i"
);
private middleware: Middleware[];
constructor(protected configuration = DefaultConfig) {
this.middleware = configuration.middleware;
}
withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]) {
const next = this.clone<T>();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware<T extends BaseAPI>(
this: T,
...preMiddlewares: Array<Middleware["pre"]>
) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware<T>(...middlewares);
}
withPostMiddleware<T extends BaseAPI>(
this: T,
...postMiddlewares: Array<Middleware["post"]>
) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware<T>(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
protected isJsonMime(mime: string | null | undefined): boolean {
if (!mime) {
return false;
}
return BaseAPI.jsonRegex.test(mime);
}
protected async request(
context: RequestOpts,
initOverrides?: RequestInit | InitOverrideFunction
): Promise<Response> {
const { url, init } = await this.createFetchParams(context, initOverrides);
const response = await this.fetchApi(url, init);
if (response && response.status >= 200 && response.status < 300) {
return response;
}
throw new ResponseError(
response as Response,
"Response returned an error code " + response?.status
);
}
private async createFetchParams(
context: RequestOpts,
initOverrides?: RequestInit | InitOverrideFunction
) {
let url = this.configuration.basePath + context.path;
if (
context.query !== undefined &&
Object.keys(context.query).length !== 0
) {
// only add the querystring to the URL if there are query parameters.
// this is done to avoid urls ending with a "?" character which buggy webservers
// do not handle correctly sometimes.
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign(
{},
this.configuration.headers,
context.headers
);
Object.keys(headers).forEach((key) =>
headers[key] === undefined ? delete headers[key] : {}
);
const initOverrideFn =
typeof initOverrides === "function"
? initOverrides
: async () => initOverrides;
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials,
};
const overriddenInit: RequestInit = {
...initParams,
...(await initOverrideFn({
init: initParams,
context,
})),
};
let body: any;
if (
isFormData(overriddenInit.body) ||
overriddenInit.body instanceof URLSearchParams ||
isBlob(overriddenInit.body)
) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init: RequestInit = {
...overriddenInit,
body,
};
return { url, init };
}
private fetchApi = async (url: string, init: RequestInit) => {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams =
(await middleware.pre({
fetch: this.fetchApi,
...fetchParams,
})) || fetchParams;
}
}
let response: Response | undefined = undefined;
try {
response = await (this.configuration.fetchApi || fetch)(
fetchParams.url,
fetchParams.init
);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response =
(await middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : undefined,
})) || response;
}
}
if (response === undefined) {
if (e instanceof Error) {
throw new FetchError(
e,
"The request failed and the interceptors did not return an alternative response"
);
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response =
(await middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone(),
})) || response;
}
}
return response;
};
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
private clone<T extends BaseAPI>(this: T): T {
const constructor = this.constructor as any;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
}
function isBlob(value: any): value is Blob {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value: any): value is FormData {
return typeof FormData !== "undefined" && value instanceof FormData;
}
export class ResponseError extends Error {
override name: "ResponseError" = "ResponseError";
constructor(public response: Response, msg?: string) {
super(msg);
}
}
export class FetchError extends Error {
override name: "FetchError" = "FetchError";
constructor(public cause: Error, msg?: string) {
super(msg);
}
}
export class RequiredError extends Error {
override name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
}
}
export const COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
export type FetchAPI = WindowOrWorkerGlobalScope["fetch"];
export type Json = any;
export type HTTPMethod =
| "GET"
| "POST"
| "PUT"
| "PATCH"
| "DELETE"
| "OPTIONS"
| "HEAD";
export type HTTPHeaders = { [key: string]: string };
export type HTTPQuery = {
[key: string]:
| string
| number
| null
| boolean
| Array<string | number | null | boolean>
| Set<string | number | null | boolean>
| HTTPQuery;
};
export type HTTPBody = Json | FormData | URLSearchParams;
export type HTTPRequestInit = {
headers?: HTTPHeaders;
method: HTTPMethod;
credentials?: RequestCredentials;
body?: HTTPBody;
};
export type ModelPropertyNaming =
| "camelCase"
| "snake_case"
| "PascalCase"
| "original";
export type InitOverrideFunction = (requestContext: {
init: HTTPRequestInit;
context: RequestOpts;
}) => Promise<RequestInit>;
export interface FetchParams {
url: string;
init: RequestInit;
}
export interface RequestOpts {
path: string;
method: HTTPMethod;
headers: HTTPHeaders;
query?: HTTPQuery;
body?: HTTPBody;
}
export function querystring(params: HTTPQuery, prefix: string = ""): string {
return Object.keys(params)
.map((key) => querystringSingleKey(key, params[key], prefix))
.filter((part) => part.length > 0)
.join("&");
}
function querystringSingleKey(
key: string,
value:
| string
| number
| null
| undefined
| boolean
| Array<string | number | null | boolean>
| Set<string | number | null | boolean>
| HTTPQuery,
keyPrefix: string = ""
): string {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value
.map((singleValue) => encodeURIComponent(String(singleValue)))
.join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(
value.toISOString()
)}`;
}
if (value instanceof Object) {
return querystring(value as HTTPQuery, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
export function exists(json: any, key: string) {
const value = json[key];
return value !== null && value !== undefined;
}
export function mapValues(data: any, fn: (item: any) => any) {
const result: { [key: string]: any } = {};
for (const key of Object.keys(data)) {
result[key] = fn(data[key]);
}
return result;
}
export function canConsumeForm(consumes: Consume[]): boolean {
for (const consume of consumes) {
if ("multipart/form-data" === consume.contentType) {
return true;
}
}
return false;
}
export interface Consume {
contentType: string;
}
export interface RequestContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
}
export interface ResponseContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
response: Response;
}
export interface ErrorContext {
fetch: FetchAPI;
url: string;
init: RequestInit;
error: unknown;
response?: Response;
}
export interface Middleware {
pre?(context: RequestContext): Promise<FetchParams | void>;
post?(context: ResponseContext): Promise<Response | void>;
onError?(context: ErrorContext): Promise<Response | void>;
}
export interface ApiResponse<T> {
raw: Response;
value(): Promise<T>;
}
export interface ResponseTransformer<T> {
(json: any): T;
}
export class JSONApiResponse<T> {
constructor(
public raw: Response,
private transformer: ResponseTransformer<T> = (jsonValue: any) => jsonValue
) {}
async value(): Promise<T> {
return this.transformer(await this.raw.json());
}
}
export class VoidApiResponse {
constructor(public raw: Response) {}
async value(): Promise<void> {
return undefined;
}
}
export class BlobApiResponse {
constructor(public raw: Response) {}
async value(): Promise<Blob> {
return await this.raw.blob();
}
}
export class TextApiResponse {
constructor(public raw: Response) {}
async value(): Promise<string> {
return await this.raw.text();
}
}