@octabyte-io/paperstack-api-client 0.0.0-stage → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/README.md +48 -2
- package/dist/answer.d.ts +15 -0
- package/dist/answer.js +86 -0
- package/dist/api-reports/experimental.api.md +9 -0
- package/dist/api-reports/index.api.md +6768 -0
- package/dist/api-reports/node.api.md +23 -0
- package/dist/errors.d.ts +38 -0
- package/dist/errors.js +37 -0
- package/dist/events.d.ts +31 -0
- package/dist/events.gen.d.ts +258 -0
- package/dist/events.gen.js +1 -0
- package/dist/events.js +1 -0
- package/dist/experimental/index.d.ts +1 -0
- package/dist/experimental/index.js +1 -0
- package/dist/file-answer.d.ts +13 -0
- package/dist/file-answer.js +55 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +4 -0
- package/dist/node/file-from-path.d.ts +6 -0
- package/dist/node/file-from-path.js +12 -0
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.js +4 -0
- package/dist/node/save-to-file.d.ts +7 -0
- package/dist/node/save-to-file.js +18 -0
- package/dist/operations.gen.d.ts +9252 -0
- package/dist/operations.gen.js +5 -0
- package/dist/paginate.d.ts +25 -0
- package/dist/paginate.js +17 -0
- package/dist/paper-stack.d.ts +45 -0
- package/dist/paper-stack.js +86 -0
- package/dist/resources.d.ts +15 -0
- package/dist/resources.js +9 -0
- package/dist/route-types.d.ts +75 -0
- package/dist/route-types.js +1 -0
- package/dist/routes.gen.d.ts +165 -0
- package/dist/routes.gen.js +177 -0
- package/dist/upload-body.d.ts +9 -0
- package/dist/upload-body.js +141 -0
- package/examples/file-invoice.ts +80 -0
- package/package.json +49 -3
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** One page of a list: its items, and the cursor of the next page, `null` on the last one. */
|
|
2
|
+
export interface Page {
|
|
3
|
+
items: readonly unknown[];
|
|
4
|
+
nextCursor: string | null;
|
|
5
|
+
}
|
|
6
|
+
/** A method whose answer is a page, such as `ps.documents.list` or `ps.folders.list`. */
|
|
7
|
+
export type PagingMethod = (...rest: never[]) => Promise<Page>;
|
|
8
|
+
/** The items array of the method's answer. */
|
|
9
|
+
export type ItemsOf<M extends PagingMethod> = Awaited<ReturnType<M>>['items'];
|
|
10
|
+
/** The arguments after the method: the method's own, ending in an optional `{ signal }`. */
|
|
11
|
+
export type ArgsOf<M extends PagingMethod> = Parameters<M>;
|
|
12
|
+
/** Reads every item of a list, page after page. */
|
|
13
|
+
export interface Paginate {
|
|
14
|
+
/**
|
|
15
|
+
* Every item of a list, across pages, such as
|
|
16
|
+
* `for await (const doc of ps.paginate(ps.documents.list, { query: { folder } }))`. Takes the
|
|
17
|
+
* method's own arguments (`query.limit` sets the page size, `query.cursor` the starting spot) and
|
|
18
|
+
* `{ signal }`. `break` stops fetching more pages.
|
|
19
|
+
*/
|
|
20
|
+
<M extends PagingMethod>(method: M, ...rest: ArgsOf<M>): AsyncGenerator<ItemsOf<M>[number], void, undefined>;
|
|
21
|
+
/** Each page's `items`, page after page, taking the same arguments as `ps.paginate`. */
|
|
22
|
+
pages<M extends PagingMethod>(method: M, ...rest: ArgsOf<M>): AsyncGenerator<ItemsOf<M>, void, undefined>;
|
|
23
|
+
}
|
|
24
|
+
/** `ps.paginate`, with `ps.paginate.pages` on it. */
|
|
25
|
+
export declare const paginate: Paginate;
|
package/dist/paginate.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
async function* pagesOf(method, args = {}, options = {}) {
|
|
2
|
+
let query = args.query;
|
|
3
|
+
for (;;) {
|
|
4
|
+
options.signal?.throwIfAborted();
|
|
5
|
+
const page = await method({ ...args, ...(query === undefined ? {} : { query }) }, options);
|
|
6
|
+
yield page.items;
|
|
7
|
+
if (page.nextCursor === null)
|
|
8
|
+
return;
|
|
9
|
+
query = { ...query, cursor: page.nextCursor };
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
async function* itemsOf(...rest) {
|
|
13
|
+
for await (const items of pagesOf(...rest))
|
|
14
|
+
yield* items;
|
|
15
|
+
}
|
|
16
|
+
/** `ps.paginate`, with `ps.paginate.pages` on it. */
|
|
17
|
+
export const paginate = Object.assign(itemsOf, { pages: pagesOf });
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type Fetch } from './answer.js';
|
|
2
|
+
import { type Paginate } from './paginate.js';
|
|
3
|
+
import type { Answer, RequestRest, Route } from './route-types.js';
|
|
4
|
+
import { type Resources } from './resources.js';
|
|
5
|
+
/** How a client is made. */
|
|
6
|
+
export interface PaperStackOptions {
|
|
7
|
+
/** The install's address, such as `https://dms.example.com`. */
|
|
8
|
+
url: string | URL;
|
|
9
|
+
/**
|
|
10
|
+
* An access token, sent as `Authorization: Bearer <token>` on every call. Left out, no
|
|
11
|
+
* `Authorization` header is sent, so a same-site browser's own session cookie applies. A
|
|
12
|
+
* function is asked for the token as each call starts, so a token that changes (such as one
|
|
13
|
+
* renewed before it runs out) is swapped in without making a new client.
|
|
14
|
+
*/
|
|
15
|
+
token?: string | (() => string);
|
|
16
|
+
/** Used instead of the global `fetch`, for example in tests. */
|
|
17
|
+
fetch?: Fetch;
|
|
18
|
+
/**
|
|
19
|
+
* Stops every call of the client once it fires, unless a call is given a signal of its own.
|
|
20
|
+
*/
|
|
21
|
+
signal?: AbortSignal;
|
|
22
|
+
}
|
|
23
|
+
/** The client without its resource methods, which the constructor adds from the route table. */
|
|
24
|
+
export declare class Client {
|
|
25
|
+
#private;
|
|
26
|
+
/**
|
|
27
|
+
* Every item of a list across pages, such as
|
|
28
|
+
* `for await (const doc of ps.paginate(ps.documents.list, { query: { folder } }))`;
|
|
29
|
+
* `ps.paginate.pages(...)` gives each page's `items` instead.
|
|
30
|
+
*/
|
|
31
|
+
readonly paginate: Paginate;
|
|
32
|
+
constructor(options: PaperStackOptions);
|
|
33
|
+
/**
|
|
34
|
+
* Calls a public endpoint by its route, such as
|
|
35
|
+
* `ps.request('GET /api/v1/documents/{id}', { path: { id } })`, and resolves to its answer body.
|
|
36
|
+
*/
|
|
37
|
+
request<R extends Route>(route: R, ...rest: RequestRest<R>): Promise<Answer<R>>;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A client of one PaperStack install: `ps.request(route, ...)`, a resource method per public
|
|
41
|
+
* endpoint grouped by API area, such as `ps.documents.list(...)` and `ps.documents.addTag(...)`, and
|
|
42
|
+
* `ps.paginate(...)` to read a whole list.
|
|
43
|
+
*/
|
|
44
|
+
export type PaperStack = Client & Resources;
|
|
45
|
+
export declare const PaperStack: new (options: PaperStackOptions) => PaperStack;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { fileAnswerTo, jsonAnswerTo } from './answer.js';
|
|
2
|
+
import { paginate } from './paginate.js';
|
|
3
|
+
import { resourcesOf } from './resources.js';
|
|
4
|
+
import { fileAnswers, routes } from './routes.gen.js';
|
|
5
|
+
import { sentBodyOf } from './upload-body.js';
|
|
6
|
+
const answersFile = new Set(fileAnswers);
|
|
7
|
+
function baseOf(url) {
|
|
8
|
+
let parsed;
|
|
9
|
+
try {
|
|
10
|
+
parsed = new URL(url);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
throw new TypeError(`PaperStack: url ${String(url)} is not a URL`);
|
|
14
|
+
}
|
|
15
|
+
return parsed.href.replace(/\/+$/, '');
|
|
16
|
+
}
|
|
17
|
+
function fillPath(route, path, values = {}) {
|
|
18
|
+
return path.replace(/\{([^}]+)\}/g, (_, name) => {
|
|
19
|
+
const value = values[name];
|
|
20
|
+
if (value === undefined)
|
|
21
|
+
throw new TypeError(`${route}: path.${name} is missing`);
|
|
22
|
+
return encodeURIComponent(String(value));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
/** The query string, `?a=1&tag=x&tag=y` (a list repeats its name), or nothing when empty. */
|
|
26
|
+
function queryOf(query = {}) {
|
|
27
|
+
const search = new URLSearchParams();
|
|
28
|
+
for (const [name, value] of Object.entries(query)) {
|
|
29
|
+
if (value === undefined)
|
|
30
|
+
continue;
|
|
31
|
+
for (const item of Array.isArray(value) ? value : [value])
|
|
32
|
+
search.append(name, String(item));
|
|
33
|
+
}
|
|
34
|
+
const text = search.toString();
|
|
35
|
+
return text === '' ? '' : `?${text}`;
|
|
36
|
+
}
|
|
37
|
+
/** The client without its resource methods, which the constructor adds from the route table. */
|
|
38
|
+
export class Client {
|
|
39
|
+
#base;
|
|
40
|
+
#token;
|
|
41
|
+
#fetch;
|
|
42
|
+
#signal;
|
|
43
|
+
/**
|
|
44
|
+
* Every item of a list across pages, such as
|
|
45
|
+
* `for await (const doc of ps.paginate(ps.documents.list, { query: { folder } }))`;
|
|
46
|
+
* `ps.paginate.pages(...)` gives each page's `items` instead.
|
|
47
|
+
*/
|
|
48
|
+
paginate = paginate;
|
|
49
|
+
constructor(options) {
|
|
50
|
+
if (options.token === '') {
|
|
51
|
+
throw new TypeError('PaperStack: token is empty; leave it out to call without one');
|
|
52
|
+
}
|
|
53
|
+
this.#base = baseOf(options.url);
|
|
54
|
+
this.#token = options.token;
|
|
55
|
+
this.#fetch = options.fetch ?? ((request) => fetch(request));
|
|
56
|
+
this.#signal = options.signal;
|
|
57
|
+
Object.assign(this, resourcesOf(this.request.bind(this)));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Calls a public endpoint by its route, such as
|
|
61
|
+
* `ps.request('GET /api/v1/documents/{id}', { path: { id } })`, and resolves to its answer body.
|
|
62
|
+
*/
|
|
63
|
+
async request(route, ...rest) {
|
|
64
|
+
const [args = {}, options = {}] = rest;
|
|
65
|
+
if (!Object.hasOwn(routes, route)) {
|
|
66
|
+
throw new TypeError(`PaperStack: ${route} is not a public route`);
|
|
67
|
+
}
|
|
68
|
+
const [method = '', path = ''] = route.split(' ');
|
|
69
|
+
const signal = options.signal ?? this.#signal ?? null;
|
|
70
|
+
signal?.throwIfAborted();
|
|
71
|
+
const token = typeof this.#token === 'function' ? this.#token() : this.#token;
|
|
72
|
+
if (token === '')
|
|
73
|
+
throw new TypeError('PaperStack: token is empty');
|
|
74
|
+
const { headers: bodyHeaders, ...body } = sentBodyOf(args.body, signal);
|
|
75
|
+
const isFile = answersFile.has(route);
|
|
76
|
+
// A file answer comes in its own type; a refusal of it is still JSON.
|
|
77
|
+
const accept = isFile ? '*/*' : 'application/json';
|
|
78
|
+
const headers = new Headers({ accept, ...bodyHeaders });
|
|
79
|
+
if (token !== undefined)
|
|
80
|
+
headers.set('authorization', `Bearer ${token}`);
|
|
81
|
+
const request = new Request(this.#base + fillPath(route, path, args.path) + queryOf(args.query), { method, headers, signal, ...body });
|
|
82
|
+
const answer = isFile ? fileAnswerTo(request, this.#fetch) : jsonAnswerTo(request, this.#fetch);
|
|
83
|
+
return (await answer);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
export const PaperStack = Client;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Answer, CallOptions, RequestRest, Route } from './route-types.js';
|
|
2
|
+
import { resources } from './routes.gen.js';
|
|
3
|
+
export type Table = typeof resources;
|
|
4
|
+
/** A resource method: takes what its route takes and resolves to its answer body. */
|
|
5
|
+
export type ResourceMethod<R extends Route> = (...rest: RequestRest<R>) => Promise<Answer<R>>;
|
|
6
|
+
/** Every area's methods, such as `documents.addTag`, each typed by the route it calls. */
|
|
7
|
+
export type Resources = {
|
|
8
|
+
readonly [Area in keyof Table]: {
|
|
9
|
+
readonly [Name in keyof Table[Area] as Table[Area][Name] extends Route ? Name : never]: Table[Area][Name] extends Route ? ResourceMethod<Table[Area][Name]> : never;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/** How a method reaches the client: the same calling path as `ps.request`. */
|
|
13
|
+
export type ResourceCall = (route: string, args?: unknown, options?: CallOptions) => Promise<unknown>;
|
|
14
|
+
/** Every area's methods, each calling its route through `call`. */
|
|
15
|
+
export declare function resourcesOf(call: ResourceCall): Resources;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { resources } from './routes.gen.js';
|
|
2
|
+
/** Every area's methods, each calling its route through `call`. */
|
|
3
|
+
export function resourcesOf(call) {
|
|
4
|
+
const methodsOf = (methods) => Object.fromEntries(Object.entries(methods).map(([name, route]) => [
|
|
5
|
+
name,
|
|
6
|
+
(args, options) => call(route, args, options),
|
|
7
|
+
]));
|
|
8
|
+
return Object.fromEntries(Object.entries(resources).map(([area, methods]) => [area, methodsOf(methods)]));
|
|
9
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { FileAnswer } from './file-answer.js';
|
|
2
|
+
import type { operations } from './operations.gen.js';
|
|
3
|
+
import type { routes } from './routes.gen.js';
|
|
4
|
+
export type PublicRoute = keyof typeof routes;
|
|
5
|
+
export type OperationOf<R extends PublicRoute> = operations[(typeof routes)[R]];
|
|
6
|
+
export type SuccessStatus = 200 | 201 | 202 | 203 | 204 | 205 | 206;
|
|
7
|
+
export type SuccessOf<O> = O extends {
|
|
8
|
+
responses: infer Answers;
|
|
9
|
+
} ? Answers[Extract<keyof Answers, SuccessStatus>] : never;
|
|
10
|
+
export type BodyOf<O> = O extends {
|
|
11
|
+
requestBody?: infer Body;
|
|
12
|
+
} ? NonNullable<Body> : never;
|
|
13
|
+
export type ContentOf<Body> = Body extends {
|
|
14
|
+
content: infer Content;
|
|
15
|
+
} ? Content : never;
|
|
16
|
+
export type ParameterOf<O, In extends 'path' | 'query'> = O extends {
|
|
17
|
+
parameters: {
|
|
18
|
+
[K in In]?: infer Values;
|
|
19
|
+
};
|
|
20
|
+
} ? NonNullable<Values> : never;
|
|
21
|
+
export type IsNever<T> = [T] extends [never] ? true : false;
|
|
22
|
+
export type Json<Content> = Content extends {
|
|
23
|
+
'application/json': infer Value;
|
|
24
|
+
} ? Value : never;
|
|
25
|
+
/** An upload's body: its fields, each file part a `File`. */
|
|
26
|
+
export type Multipart<Content> = Content extends {
|
|
27
|
+
'multipart/form-data': infer Value;
|
|
28
|
+
} ? Value : never;
|
|
29
|
+
/** A body the client can send: JSON, or an upload's fields. */
|
|
30
|
+
export type Sendable<Content> = Json<Content> | Multipart<Content>;
|
|
31
|
+
/**
|
|
32
|
+
* What a success resolves to: its JSON body, a `FileAnswer` when it answers a file (a download, a
|
|
33
|
+
* preview, a picture) rather than JSON, or `undefined` for one with no body.
|
|
34
|
+
*/
|
|
35
|
+
export type AnswerOfSuccess<Success> = Success extends {
|
|
36
|
+
content: infer Content;
|
|
37
|
+
} ? IsNever<Json<Content>> extends true ? FileAnswer : Json<Content> : Success extends {
|
|
38
|
+
content?: never;
|
|
39
|
+
} ? undefined : never;
|
|
40
|
+
/** Whether the client can call the operation: it sends nothing, JSON or an upload, and answers. */
|
|
41
|
+
export type IsCallable<O> = IsNever<AnswerOfSuccess<SuccessOf<O>>> extends true ? false : IsNever<BodyOf<O>> extends true ? true : IsNever<Sendable<ContentOf<BodyOf<O>>>> extends true ? false : true;
|
|
42
|
+
/** Every public route the client can call: `'<METHOD> <path>'`, as in the API docs. */
|
|
43
|
+
export type Route = {
|
|
44
|
+
[R in PublicRoute]: IsCallable<OperationOf<R>> extends true ? R : never;
|
|
45
|
+
}[PublicRoute];
|
|
46
|
+
/** One part (`path`, `query`, `body`) of a call: required, optional, or not taken at all. */
|
|
47
|
+
export type Part<Name extends string, Value, Required extends boolean> = IsNever<Value> extends true ? {
|
|
48
|
+
[K in Name]?: never;
|
|
49
|
+
} : Required extends true ? {
|
|
50
|
+
[K in Name]: Value;
|
|
51
|
+
} : {
|
|
52
|
+
[K in Name]?: Value;
|
|
53
|
+
};
|
|
54
|
+
/** Whether `Value` has a required field (when all are optional, it takes its own `Partial`). */
|
|
55
|
+
export type HasRequired<Value> = IsNever<Value> extends true ? false : Partial<Value> extends Value ? false : true;
|
|
56
|
+
export type PathOf<O> = ParameterOf<O, 'path'>;
|
|
57
|
+
export type QueryOf<O> = ParameterOf<O, 'query'>;
|
|
58
|
+
export type RequestBodyOf<O> = Sendable<ContentOf<BodyOf<O>>>;
|
|
59
|
+
export type BodyRequired<O> = O extends {
|
|
60
|
+
requestBody: unknown;
|
|
61
|
+
} ? true : false;
|
|
62
|
+
export type Flatten<T> = {
|
|
63
|
+
[K in keyof T]: T[K];
|
|
64
|
+
};
|
|
65
|
+
/** What a call to `route` takes: `{ path, query, body }` exactly as the API document describes them. */
|
|
66
|
+
export type RequestArgs<R extends Route> = Flatten<Part<'path', PathOf<OperationOf<R>>, HasRequired<PathOf<OperationOf<R>>>> & Part<'query', QueryOf<OperationOf<R>>, HasRequired<QueryOf<OperationOf<R>>>> & Part<'body', RequestBodyOf<OperationOf<R>>, BodyRequired<OperationOf<R>>>>;
|
|
67
|
+
/** What a call to `route` resolves to: its answer body, or `undefined` when it answers with none. */
|
|
68
|
+
export type Answer<R extends Route> = AnswerOfSuccess<SuccessOf<OperationOf<R>>>;
|
|
69
|
+
/** Options of any single call. */
|
|
70
|
+
export interface CallOptions {
|
|
71
|
+
/** Cancels the call. */
|
|
72
|
+
signal?: AbortSignal;
|
|
73
|
+
}
|
|
74
|
+
/** The arguments after the route: `args` may be left out when the route needs nothing. */
|
|
75
|
+
export type RequestRest<R extends Route> = HasRequired<RequestArgs<R>> extends false ? [args?: RequestArgs<R>, options?: CallOptions] : [args: RequestArgs<R>, options?: CallOptions];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
export declare const routes: {
|
|
2
|
+
readonly 'GET /api/v1/audit-entries': "listAuditEntries";
|
|
3
|
+
readonly 'GET /api/v1/audit-entries/{id}': "getAuditEntry";
|
|
4
|
+
readonly 'GET /api/v1/documents': "listDocuments";
|
|
5
|
+
readonly 'POST /api/v1/documents': "uploadDocument";
|
|
6
|
+
readonly 'POST /api/v1/documents/tags': "changeTagsOnDocuments";
|
|
7
|
+
readonly 'GET /api/v1/documents/{id}': "getDocument";
|
|
8
|
+
readonly 'DELETE /api/v1/documents/{id}': "moveDocumentToTrash";
|
|
9
|
+
readonly 'PATCH /api/v1/documents/{id}': "editDocument";
|
|
10
|
+
readonly 'PUT /api/v1/documents/{id}/tags/{tagId}': "addDocumentTag";
|
|
11
|
+
readonly 'DELETE /api/v1/documents/{id}/tags/{tagId}': "removeDocumentTag";
|
|
12
|
+
readonly 'PUT /api/v1/documents/{id}/fields/{fieldId}': "setDocumentFieldValue";
|
|
13
|
+
readonly 'DELETE /api/v1/documents/{id}/fields/{fieldId}': "clearDocumentFieldValue";
|
|
14
|
+
readonly 'PUT /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}': "addDocumentFieldOption";
|
|
15
|
+
readonly 'DELETE /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}': "removeDocumentFieldOption";
|
|
16
|
+
readonly 'GET /api/v1/documents/{id}/download': "downloadDocument";
|
|
17
|
+
readonly 'GET /api/v1/documents/{id}/preview': "previewDocument";
|
|
18
|
+
readonly 'GET /api/v1/documents/{id}/access': "getDocumentAccess";
|
|
19
|
+
readonly 'PUT /api/v1/documents/{id}/access/limited': "setDocumentAccessLimited";
|
|
20
|
+
readonly 'PUT /api/v1/documents/{id}/access/people/{userId}': "setDocumentAccessPerson";
|
|
21
|
+
readonly 'DELETE /api/v1/documents/{id}/access/people/{userId}': "removeDocumentAccessPerson";
|
|
22
|
+
readonly 'GET /api/v1/documents/{id}/versions': "listDocumentVersions";
|
|
23
|
+
readonly 'POST /api/v1/documents/{id}/versions': "addDocumentVersion";
|
|
24
|
+
readonly 'POST /api/v1/documents/{id}/versions/{number}/restore': "restoreDocumentVersion";
|
|
25
|
+
readonly 'GET /api/v1/documents/{id}/versions/{number}/download': "downloadDocumentVersion";
|
|
26
|
+
readonly 'GET /api/v1/documents/{id}/versions/{number}/preview': "previewDocumentVersion";
|
|
27
|
+
readonly 'GET /api/v1/documents/{id}/versions/{number}/thumbnail': "getVersionThumbnail";
|
|
28
|
+
readonly 'GET /api/v1/documents/{id}/text': "getDocumentText";
|
|
29
|
+
readonly 'GET /api/v1/documents/{id}/versions/{number}/text': "getDocumentVersionText";
|
|
30
|
+
readonly 'PUT /api/v1/documents/{id}/versions/{number}/plugin-text': "setPluginText";
|
|
31
|
+
readonly 'GET /api/v1/exports': "listExports";
|
|
32
|
+
readonly 'POST /api/v1/exports': "startExport";
|
|
33
|
+
readonly 'POST /api/v1/exports/preview': "previewExport";
|
|
34
|
+
readonly 'GET /api/v1/exports/{id}': "getExport";
|
|
35
|
+
readonly 'DELETE /api/v1/exports/{id}': "deleteExport";
|
|
36
|
+
readonly 'POST /api/v1/exports/{id}/cancel': "cancelExport";
|
|
37
|
+
readonly 'GET /api/v1/exports/{id}/download': "downloadExport";
|
|
38
|
+
readonly 'GET /api/v1/fields': "listFields";
|
|
39
|
+
readonly 'POST /api/v1/fields': "createField";
|
|
40
|
+
readonly 'DELETE /api/v1/fields/{id}': "deleteField";
|
|
41
|
+
readonly 'PATCH /api/v1/fields/{id}': "updateField";
|
|
42
|
+
readonly 'POST /api/v1/fields/{id}/options': "addFieldOption";
|
|
43
|
+
readonly 'DELETE /api/v1/fields/{id}/options/{optionId}': "removeFieldOption";
|
|
44
|
+
readonly 'PATCH /api/v1/fields/{id}/options/{optionId}': "updateFieldOption";
|
|
45
|
+
readonly 'GET /api/v1/folders': "listFolders";
|
|
46
|
+
readonly 'POST /api/v1/folders': "createFolder";
|
|
47
|
+
readonly 'DELETE /api/v1/folders/{id}': "deleteFolder";
|
|
48
|
+
readonly 'PATCH /api/v1/folders/{id}': "updateFolder";
|
|
49
|
+
readonly 'GET /api/v1/folders/{id}/access': "getFolderAccess";
|
|
50
|
+
readonly 'PUT /api/v1/folders/{id}/access/limited': "setFolderAccessLimited";
|
|
51
|
+
readonly 'PUT /api/v1/folders/{id}/access/people/{userId}': "setFolderAccessPerson";
|
|
52
|
+
readonly 'DELETE /api/v1/folders/{id}/access/people/{userId}': "removeFolderAccessPerson";
|
|
53
|
+
readonly 'GET /api/v1/invites': "listInvites";
|
|
54
|
+
readonly 'GET /api/v1/memberships': "listMemberships";
|
|
55
|
+
readonly 'GET /api/v1/organization/logo/{logoId}': "getOrganizationLogo";
|
|
56
|
+
readonly 'GET /api/v1/search': "searchDocuments";
|
|
57
|
+
readonly 'GET /api/v1/me': "getMe";
|
|
58
|
+
readonly 'GET /api/v1/tags': "listTags";
|
|
59
|
+
readonly 'POST /api/v1/tags': "createTag";
|
|
60
|
+
readonly 'DELETE /api/v1/tags/{id}': "deleteTag";
|
|
61
|
+
readonly 'PATCH /api/v1/tags/{id}': "updateTag";
|
|
62
|
+
readonly 'GET /api/v1/trash': "listTrash";
|
|
63
|
+
readonly 'DELETE /api/v1/trash': "emptyTrash";
|
|
64
|
+
readonly 'POST /api/v1/trash/{id}/restore': "restoreDocument";
|
|
65
|
+
readonly 'DELETE /api/v1/trash/{id}': "deleteDocumentForGood";
|
|
66
|
+
readonly 'GET /api/v1/uploads/limits': "getUploadLimits";
|
|
67
|
+
readonly 'GET /api/v1/uploads/duplicates': "findDuplicateDocuments";
|
|
68
|
+
readonly 'GET /api/v1/users': "listUsers";
|
|
69
|
+
};
|
|
70
|
+
export declare const resources: {
|
|
71
|
+
readonly auditLog: {
|
|
72
|
+
readonly list: "GET /api/v1/audit-entries";
|
|
73
|
+
readonly get: "GET /api/v1/audit-entries/{id}";
|
|
74
|
+
};
|
|
75
|
+
readonly documents: {
|
|
76
|
+
readonly list: "GET /api/v1/documents";
|
|
77
|
+
readonly upload: "POST /api/v1/documents";
|
|
78
|
+
readonly changeTags: "POST /api/v1/documents/tags";
|
|
79
|
+
readonly get: "GET /api/v1/documents/{id}";
|
|
80
|
+
readonly moveToTrash: "DELETE /api/v1/documents/{id}";
|
|
81
|
+
readonly edit: "PATCH /api/v1/documents/{id}";
|
|
82
|
+
readonly addTag: "PUT /api/v1/documents/{id}/tags/{tagId}";
|
|
83
|
+
readonly removeTag: "DELETE /api/v1/documents/{id}/tags/{tagId}";
|
|
84
|
+
readonly setFieldValue: "PUT /api/v1/documents/{id}/fields/{fieldId}";
|
|
85
|
+
readonly clearFieldValue: "DELETE /api/v1/documents/{id}/fields/{fieldId}";
|
|
86
|
+
readonly addFieldOption: "PUT /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}";
|
|
87
|
+
readonly removeFieldOption: "DELETE /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}";
|
|
88
|
+
readonly download: "GET /api/v1/documents/{id}/download";
|
|
89
|
+
readonly preview: "GET /api/v1/documents/{id}/preview";
|
|
90
|
+
readonly getText: "GET /api/v1/documents/{id}/text";
|
|
91
|
+
readonly getUploadLimits: "GET /api/v1/uploads/limits";
|
|
92
|
+
readonly findDuplicates: "GET /api/v1/uploads/duplicates";
|
|
93
|
+
};
|
|
94
|
+
readonly access: {
|
|
95
|
+
readonly getDocument: "GET /api/v1/documents/{id}/access";
|
|
96
|
+
readonly setDocumentLimited: "PUT /api/v1/documents/{id}/access/limited";
|
|
97
|
+
readonly setDocumentPerson: "PUT /api/v1/documents/{id}/access/people/{userId}";
|
|
98
|
+
readonly removeDocumentPerson: "DELETE /api/v1/documents/{id}/access/people/{userId}";
|
|
99
|
+
readonly getFolder: "GET /api/v1/folders/{id}/access";
|
|
100
|
+
readonly setFolderLimited: "PUT /api/v1/folders/{id}/access/limited";
|
|
101
|
+
readonly setFolderPerson: "PUT /api/v1/folders/{id}/access/people/{userId}";
|
|
102
|
+
readonly removeFolderPerson: "DELETE /api/v1/folders/{id}/access/people/{userId}";
|
|
103
|
+
};
|
|
104
|
+
readonly versions: {
|
|
105
|
+
readonly list: "GET /api/v1/documents/{id}/versions";
|
|
106
|
+
readonly add: "POST /api/v1/documents/{id}/versions";
|
|
107
|
+
readonly restore: "POST /api/v1/documents/{id}/versions/{number}/restore";
|
|
108
|
+
readonly download: "GET /api/v1/documents/{id}/versions/{number}/download";
|
|
109
|
+
readonly preview: "GET /api/v1/documents/{id}/versions/{number}/preview";
|
|
110
|
+
readonly getThumbnail: "GET /api/v1/documents/{id}/versions/{number}/thumbnail";
|
|
111
|
+
readonly getText: "GET /api/v1/documents/{id}/versions/{number}/text";
|
|
112
|
+
readonly setPluginText: "PUT /api/v1/documents/{id}/versions/{number}/plugin-text";
|
|
113
|
+
};
|
|
114
|
+
readonly exports: {
|
|
115
|
+
readonly list: "GET /api/v1/exports";
|
|
116
|
+
readonly start: "POST /api/v1/exports";
|
|
117
|
+
readonly preview: "POST /api/v1/exports/preview";
|
|
118
|
+
readonly get: "GET /api/v1/exports/{id}";
|
|
119
|
+
readonly delete: "DELETE /api/v1/exports/{id}";
|
|
120
|
+
readonly cancel: "POST /api/v1/exports/{id}/cancel";
|
|
121
|
+
readonly download: "GET /api/v1/exports/{id}/download";
|
|
122
|
+
};
|
|
123
|
+
readonly fields: {
|
|
124
|
+
readonly list: "GET /api/v1/fields";
|
|
125
|
+
readonly create: "POST /api/v1/fields";
|
|
126
|
+
readonly delete: "DELETE /api/v1/fields/{id}";
|
|
127
|
+
readonly update: "PATCH /api/v1/fields/{id}";
|
|
128
|
+
readonly addOption: "POST /api/v1/fields/{id}/options";
|
|
129
|
+
readonly removeOption: "DELETE /api/v1/fields/{id}/options/{optionId}";
|
|
130
|
+
readonly updateOption: "PATCH /api/v1/fields/{id}/options/{optionId}";
|
|
131
|
+
};
|
|
132
|
+
readonly folders: {
|
|
133
|
+
readonly list: "GET /api/v1/folders";
|
|
134
|
+
readonly create: "POST /api/v1/folders";
|
|
135
|
+
readonly delete: "DELETE /api/v1/folders/{id}";
|
|
136
|
+
readonly update: "PATCH /api/v1/folders/{id}";
|
|
137
|
+
};
|
|
138
|
+
readonly team: {
|
|
139
|
+
readonly listInvites: "GET /api/v1/invites";
|
|
140
|
+
readonly listMemberships: "GET /api/v1/memberships";
|
|
141
|
+
readonly listUsers: "GET /api/v1/users";
|
|
142
|
+
};
|
|
143
|
+
readonly organization: {
|
|
144
|
+
readonly getLogo: "GET /api/v1/organization/logo/{logoId}";
|
|
145
|
+
};
|
|
146
|
+
readonly search: {
|
|
147
|
+
readonly documents: "GET /api/v1/search";
|
|
148
|
+
};
|
|
149
|
+
readonly me: {
|
|
150
|
+
readonly get: "GET /api/v1/me";
|
|
151
|
+
};
|
|
152
|
+
readonly tags: {
|
|
153
|
+
readonly list: "GET /api/v1/tags";
|
|
154
|
+
readonly create: "POST /api/v1/tags";
|
|
155
|
+
readonly delete: "DELETE /api/v1/tags/{id}";
|
|
156
|
+
readonly update: "PATCH /api/v1/tags/{id}";
|
|
157
|
+
};
|
|
158
|
+
readonly trash: {
|
|
159
|
+
readonly list: "GET /api/v1/trash";
|
|
160
|
+
readonly empty: "DELETE /api/v1/trash";
|
|
161
|
+
readonly restoreDocument: "POST /api/v1/trash/{id}/restore";
|
|
162
|
+
readonly deleteDocumentForGood: "DELETE /api/v1/trash/{id}";
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
export declare const fileAnswers: readonly ["GET /api/v1/documents/{id}/download", "GET /api/v1/documents/{id}/preview", "GET /api/v1/documents/{id}/versions/{number}/download", "GET /api/v1/documents/{id}/versions/{number}/preview", "GET /api/v1/documents/{id}/versions/{number}/thumbnail", "GET /api/v1/exports/{id}/download", "GET /api/v1/organization/logo/{logoId}"];
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// Generated by `pnpm api:types` from the public OpenAPI file; do not edit.
|
|
2
|
+
// Each public operation's `METHOD /path` route and its operation id.
|
|
3
|
+
export const routes = {
|
|
4
|
+
'GET /api/v1/audit-entries': 'listAuditEntries',
|
|
5
|
+
'GET /api/v1/audit-entries/{id}': 'getAuditEntry',
|
|
6
|
+
'GET /api/v1/documents': 'listDocuments',
|
|
7
|
+
'POST /api/v1/documents': 'uploadDocument',
|
|
8
|
+
'POST /api/v1/documents/tags': 'changeTagsOnDocuments',
|
|
9
|
+
'GET /api/v1/documents/{id}': 'getDocument',
|
|
10
|
+
'DELETE /api/v1/documents/{id}': 'moveDocumentToTrash',
|
|
11
|
+
'PATCH /api/v1/documents/{id}': 'editDocument',
|
|
12
|
+
'PUT /api/v1/documents/{id}/tags/{tagId}': 'addDocumentTag',
|
|
13
|
+
'DELETE /api/v1/documents/{id}/tags/{tagId}': 'removeDocumentTag',
|
|
14
|
+
'PUT /api/v1/documents/{id}/fields/{fieldId}': 'setDocumentFieldValue',
|
|
15
|
+
'DELETE /api/v1/documents/{id}/fields/{fieldId}': 'clearDocumentFieldValue',
|
|
16
|
+
'PUT /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}': 'addDocumentFieldOption',
|
|
17
|
+
'DELETE /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}': 'removeDocumentFieldOption',
|
|
18
|
+
'GET /api/v1/documents/{id}/download': 'downloadDocument',
|
|
19
|
+
'GET /api/v1/documents/{id}/preview': 'previewDocument',
|
|
20
|
+
'GET /api/v1/documents/{id}/access': 'getDocumentAccess',
|
|
21
|
+
'PUT /api/v1/documents/{id}/access/limited': 'setDocumentAccessLimited',
|
|
22
|
+
'PUT /api/v1/documents/{id}/access/people/{userId}': 'setDocumentAccessPerson',
|
|
23
|
+
'DELETE /api/v1/documents/{id}/access/people/{userId}': 'removeDocumentAccessPerson',
|
|
24
|
+
'GET /api/v1/documents/{id}/versions': 'listDocumentVersions',
|
|
25
|
+
'POST /api/v1/documents/{id}/versions': 'addDocumentVersion',
|
|
26
|
+
'POST /api/v1/documents/{id}/versions/{number}/restore': 'restoreDocumentVersion',
|
|
27
|
+
'GET /api/v1/documents/{id}/versions/{number}/download': 'downloadDocumentVersion',
|
|
28
|
+
'GET /api/v1/documents/{id}/versions/{number}/preview': 'previewDocumentVersion',
|
|
29
|
+
'GET /api/v1/documents/{id}/versions/{number}/thumbnail': 'getVersionThumbnail',
|
|
30
|
+
'GET /api/v1/documents/{id}/text': 'getDocumentText',
|
|
31
|
+
'GET /api/v1/documents/{id}/versions/{number}/text': 'getDocumentVersionText',
|
|
32
|
+
'PUT /api/v1/documents/{id}/versions/{number}/plugin-text': 'setPluginText',
|
|
33
|
+
'GET /api/v1/exports': 'listExports',
|
|
34
|
+
'POST /api/v1/exports': 'startExport',
|
|
35
|
+
'POST /api/v1/exports/preview': 'previewExport',
|
|
36
|
+
'GET /api/v1/exports/{id}': 'getExport',
|
|
37
|
+
'DELETE /api/v1/exports/{id}': 'deleteExport',
|
|
38
|
+
'POST /api/v1/exports/{id}/cancel': 'cancelExport',
|
|
39
|
+
'GET /api/v1/exports/{id}/download': 'downloadExport',
|
|
40
|
+
'GET /api/v1/fields': 'listFields',
|
|
41
|
+
'POST /api/v1/fields': 'createField',
|
|
42
|
+
'DELETE /api/v1/fields/{id}': 'deleteField',
|
|
43
|
+
'PATCH /api/v1/fields/{id}': 'updateField',
|
|
44
|
+
'POST /api/v1/fields/{id}/options': 'addFieldOption',
|
|
45
|
+
'DELETE /api/v1/fields/{id}/options/{optionId}': 'removeFieldOption',
|
|
46
|
+
'PATCH /api/v1/fields/{id}/options/{optionId}': 'updateFieldOption',
|
|
47
|
+
'GET /api/v1/folders': 'listFolders',
|
|
48
|
+
'POST /api/v1/folders': 'createFolder',
|
|
49
|
+
'DELETE /api/v1/folders/{id}': 'deleteFolder',
|
|
50
|
+
'PATCH /api/v1/folders/{id}': 'updateFolder',
|
|
51
|
+
'GET /api/v1/folders/{id}/access': 'getFolderAccess',
|
|
52
|
+
'PUT /api/v1/folders/{id}/access/limited': 'setFolderAccessLimited',
|
|
53
|
+
'PUT /api/v1/folders/{id}/access/people/{userId}': 'setFolderAccessPerson',
|
|
54
|
+
'DELETE /api/v1/folders/{id}/access/people/{userId}': 'removeFolderAccessPerson',
|
|
55
|
+
'GET /api/v1/invites': 'listInvites',
|
|
56
|
+
'GET /api/v1/memberships': 'listMemberships',
|
|
57
|
+
'GET /api/v1/organization/logo/{logoId}': 'getOrganizationLogo',
|
|
58
|
+
'GET /api/v1/search': 'searchDocuments',
|
|
59
|
+
'GET /api/v1/me': 'getMe',
|
|
60
|
+
'GET /api/v1/tags': 'listTags',
|
|
61
|
+
'POST /api/v1/tags': 'createTag',
|
|
62
|
+
'DELETE /api/v1/tags/{id}': 'deleteTag',
|
|
63
|
+
'PATCH /api/v1/tags/{id}': 'updateTag',
|
|
64
|
+
'GET /api/v1/trash': 'listTrash',
|
|
65
|
+
'DELETE /api/v1/trash': 'emptyTrash',
|
|
66
|
+
'POST /api/v1/trash/{id}/restore': 'restoreDocument',
|
|
67
|
+
'DELETE /api/v1/trash/{id}': 'deleteDocumentForGood',
|
|
68
|
+
'GET /api/v1/uploads/limits': 'getUploadLimits',
|
|
69
|
+
'GET /api/v1/uploads/duplicates': 'findDuplicateDocuments',
|
|
70
|
+
'GET /api/v1/users': 'listUsers',
|
|
71
|
+
};
|
|
72
|
+
// Each public operation's resource method, by area: `ps.<area>.<method>` calls its route.
|
|
73
|
+
export const resources = {
|
|
74
|
+
auditLog: {
|
|
75
|
+
list: 'GET /api/v1/audit-entries',
|
|
76
|
+
get: 'GET /api/v1/audit-entries/{id}',
|
|
77
|
+
},
|
|
78
|
+
documents: {
|
|
79
|
+
list: 'GET /api/v1/documents',
|
|
80
|
+
upload: 'POST /api/v1/documents',
|
|
81
|
+
changeTags: 'POST /api/v1/documents/tags',
|
|
82
|
+
get: 'GET /api/v1/documents/{id}',
|
|
83
|
+
moveToTrash: 'DELETE /api/v1/documents/{id}',
|
|
84
|
+
edit: 'PATCH /api/v1/documents/{id}',
|
|
85
|
+
addTag: 'PUT /api/v1/documents/{id}/tags/{tagId}',
|
|
86
|
+
removeTag: 'DELETE /api/v1/documents/{id}/tags/{tagId}',
|
|
87
|
+
setFieldValue: 'PUT /api/v1/documents/{id}/fields/{fieldId}',
|
|
88
|
+
clearFieldValue: 'DELETE /api/v1/documents/{id}/fields/{fieldId}',
|
|
89
|
+
addFieldOption: 'PUT /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}',
|
|
90
|
+
removeFieldOption: 'DELETE /api/v1/documents/{id}/fields/{fieldId}/options/{optionId}',
|
|
91
|
+
download: 'GET /api/v1/documents/{id}/download',
|
|
92
|
+
preview: 'GET /api/v1/documents/{id}/preview',
|
|
93
|
+
getText: 'GET /api/v1/documents/{id}/text',
|
|
94
|
+
getUploadLimits: 'GET /api/v1/uploads/limits',
|
|
95
|
+
findDuplicates: 'GET /api/v1/uploads/duplicates',
|
|
96
|
+
},
|
|
97
|
+
access: {
|
|
98
|
+
getDocument: 'GET /api/v1/documents/{id}/access',
|
|
99
|
+
setDocumentLimited: 'PUT /api/v1/documents/{id}/access/limited',
|
|
100
|
+
setDocumentPerson: 'PUT /api/v1/documents/{id}/access/people/{userId}',
|
|
101
|
+
removeDocumentPerson: 'DELETE /api/v1/documents/{id}/access/people/{userId}',
|
|
102
|
+
getFolder: 'GET /api/v1/folders/{id}/access',
|
|
103
|
+
setFolderLimited: 'PUT /api/v1/folders/{id}/access/limited',
|
|
104
|
+
setFolderPerson: 'PUT /api/v1/folders/{id}/access/people/{userId}',
|
|
105
|
+
removeFolderPerson: 'DELETE /api/v1/folders/{id}/access/people/{userId}',
|
|
106
|
+
},
|
|
107
|
+
versions: {
|
|
108
|
+
list: 'GET /api/v1/documents/{id}/versions',
|
|
109
|
+
add: 'POST /api/v1/documents/{id}/versions',
|
|
110
|
+
restore: 'POST /api/v1/documents/{id}/versions/{number}/restore',
|
|
111
|
+
download: 'GET /api/v1/documents/{id}/versions/{number}/download',
|
|
112
|
+
preview: 'GET /api/v1/documents/{id}/versions/{number}/preview',
|
|
113
|
+
getThumbnail: 'GET /api/v1/documents/{id}/versions/{number}/thumbnail',
|
|
114
|
+
getText: 'GET /api/v1/documents/{id}/versions/{number}/text',
|
|
115
|
+
setPluginText: 'PUT /api/v1/documents/{id}/versions/{number}/plugin-text',
|
|
116
|
+
},
|
|
117
|
+
exports: {
|
|
118
|
+
list: 'GET /api/v1/exports',
|
|
119
|
+
start: 'POST /api/v1/exports',
|
|
120
|
+
preview: 'POST /api/v1/exports/preview',
|
|
121
|
+
get: 'GET /api/v1/exports/{id}',
|
|
122
|
+
delete: 'DELETE /api/v1/exports/{id}',
|
|
123
|
+
cancel: 'POST /api/v1/exports/{id}/cancel',
|
|
124
|
+
download: 'GET /api/v1/exports/{id}/download',
|
|
125
|
+
},
|
|
126
|
+
fields: {
|
|
127
|
+
list: 'GET /api/v1/fields',
|
|
128
|
+
create: 'POST /api/v1/fields',
|
|
129
|
+
delete: 'DELETE /api/v1/fields/{id}',
|
|
130
|
+
update: 'PATCH /api/v1/fields/{id}',
|
|
131
|
+
addOption: 'POST /api/v1/fields/{id}/options',
|
|
132
|
+
removeOption: 'DELETE /api/v1/fields/{id}/options/{optionId}',
|
|
133
|
+
updateOption: 'PATCH /api/v1/fields/{id}/options/{optionId}',
|
|
134
|
+
},
|
|
135
|
+
folders: {
|
|
136
|
+
list: 'GET /api/v1/folders',
|
|
137
|
+
create: 'POST /api/v1/folders',
|
|
138
|
+
delete: 'DELETE /api/v1/folders/{id}',
|
|
139
|
+
update: 'PATCH /api/v1/folders/{id}',
|
|
140
|
+
},
|
|
141
|
+
team: {
|
|
142
|
+
listInvites: 'GET /api/v1/invites',
|
|
143
|
+
listMemberships: 'GET /api/v1/memberships',
|
|
144
|
+
listUsers: 'GET /api/v1/users',
|
|
145
|
+
},
|
|
146
|
+
organization: {
|
|
147
|
+
getLogo: 'GET /api/v1/organization/logo/{logoId}',
|
|
148
|
+
},
|
|
149
|
+
search: {
|
|
150
|
+
documents: 'GET /api/v1/search',
|
|
151
|
+
},
|
|
152
|
+
me: {
|
|
153
|
+
get: 'GET /api/v1/me',
|
|
154
|
+
},
|
|
155
|
+
tags: {
|
|
156
|
+
list: 'GET /api/v1/tags',
|
|
157
|
+
create: 'POST /api/v1/tags',
|
|
158
|
+
delete: 'DELETE /api/v1/tags/{id}',
|
|
159
|
+
update: 'PATCH /api/v1/tags/{id}',
|
|
160
|
+
},
|
|
161
|
+
trash: {
|
|
162
|
+
list: 'GET /api/v1/trash',
|
|
163
|
+
empty: 'DELETE /api/v1/trash',
|
|
164
|
+
restoreDocument: 'POST /api/v1/trash/{id}/restore',
|
|
165
|
+
deleteDocumentForGood: 'DELETE /api/v1/trash/{id}',
|
|
166
|
+
},
|
|
167
|
+
};
|
|
168
|
+
// The routes whose success answers a file (a download, a preview, a picture), not JSON.
|
|
169
|
+
export const fileAnswers = [
|
|
170
|
+
'GET /api/v1/documents/{id}/download',
|
|
171
|
+
'GET /api/v1/documents/{id}/preview',
|
|
172
|
+
'GET /api/v1/documents/{id}/versions/{number}/download',
|
|
173
|
+
'GET /api/v1/documents/{id}/versions/{number}/preview',
|
|
174
|
+
'GET /api/v1/documents/{id}/versions/{number}/thumbnail',
|
|
175
|
+
'GET /api/v1/exports/{id}/download',
|
|
176
|
+
'GET /api/v1/organization/logo/{logoId}',
|
|
177
|
+
];
|