paperus 0.0.0-stage → 0.0.8
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/README.md +16 -2
- package/dist/generated/client/client.gen.d.ts +2 -0
- package/dist/generated/client/client.gen.js +216 -0
- package/dist/generated/client/index.d.ts +10 -0
- package/dist/generated/client/index.js +6 -0
- package/dist/generated/client/types.gen.d.ts +120 -0
- package/dist/generated/client/types.gen.js +2 -0
- package/dist/generated/client/utils.gen.d.ts +37 -0
- package/dist/generated/client/utils.gen.js +228 -0
- package/dist/generated/client.gen.d.ts +12 -0
- package/dist/generated/client.gen.js +3 -0
- package/dist/generated/core/auth.gen.d.ts +25 -0
- package/dist/generated/core/auth.gen.js +14 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
- package/dist/generated/core/bodySerializer.gen.js +57 -0
- package/dist/generated/core/params.gen.d.ts +43 -0
- package/dist/generated/core/params.gen.js +109 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
- package/dist/generated/core/pathSerializer.gen.js +106 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/generated/core/queryKeySerializer.gen.js +92 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/generated/core/serverSentEvents.gen.js +132 -0
- package/dist/generated/core/types.gen.d.ts +83 -0
- package/dist/generated/core/types.gen.js +2 -0
- package/dist/generated/core/utils.gen.d.ts +19 -0
- package/dist/generated/core/utils.gen.js +87 -0
- package/dist/generated/index.d.ts +2 -0
- package/dist/generated/index.js +2 -0
- package/dist/generated/sdk.gen.d.ts +718 -0
- package/dist/generated/sdk.gen.js +991 -0
- package/dist/generated/types.gen.d.ts +4999 -0
- package/dist/generated/types.gen.js +2 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +19 -0
- package/package.json +38 -5
|
@@ -0,0 +1,991 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
import { client } from './client.gen.js';
|
|
3
|
+
import { formDataBodySerializer } from './client/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Health
|
|
6
|
+
*/
|
|
7
|
+
export const health = (options) => (options?.client ?? client).get({ url: '/api/health', ...options });
|
|
8
|
+
/**
|
|
9
|
+
* Health Db
|
|
10
|
+
*/
|
|
11
|
+
export const healthDb = (options) => (options?.client ?? client).get({ url: '/api/health/db', ...options });
|
|
12
|
+
/**
|
|
13
|
+
* Login
|
|
14
|
+
*/
|
|
15
|
+
export const login = (options) => (options.client ?? client).post({
|
|
16
|
+
url: '/api/auth/login',
|
|
17
|
+
...options,
|
|
18
|
+
headers: {
|
|
19
|
+
'Content-Type': 'application/json',
|
|
20
|
+
...options.headers
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* Login Methods
|
|
25
|
+
*
|
|
26
|
+
* How one may log in (for the login page).
|
|
27
|
+
*/
|
|
28
|
+
export const loginMethods = (options) => (options?.client ?? client).get({ url: '/api/auth/methods', ...options });
|
|
29
|
+
/**
|
|
30
|
+
* Oidc Start
|
|
31
|
+
*
|
|
32
|
+
* Off to the identity provider; it sends the browser back to
|
|
33
|
+
* ``/api/auth/oidc/callback``. With ``link``, the OIDC login is
|
|
34
|
+
* linked to the account logged in now instead (whatever its name).
|
|
35
|
+
*/
|
|
36
|
+
export const oidcStart = (options) => (options?.client ?? client).get({ url: '/api/auth/oidc/start', ...options });
|
|
37
|
+
/**
|
|
38
|
+
* Oidc Callback
|
|
39
|
+
*
|
|
40
|
+
* Back from the identity provider: log the person in.
|
|
41
|
+
*/
|
|
42
|
+
export const oidcCallback = (options) => (options?.client ?? client).get({ url: '/api/auth/oidc/callback', ...options });
|
|
43
|
+
/**
|
|
44
|
+
* Unlink Oidc
|
|
45
|
+
*
|
|
46
|
+
* Unlink one's account from the OIDC login (the password stays).
|
|
47
|
+
*/
|
|
48
|
+
export const unlinkOidc = (options) => (options?.client ?? client).delete({ url: '/api/auth/oidc/link', ...options });
|
|
49
|
+
/**
|
|
50
|
+
* Logout
|
|
51
|
+
*/
|
|
52
|
+
export const logout = (options) => (options?.client ?? client).post({ url: '/api/auth/logout', ...options });
|
|
53
|
+
/**
|
|
54
|
+
* Me
|
|
55
|
+
*/
|
|
56
|
+
export const me = (options) => (options?.client ?? client).get({ url: '/api/auth/me', ...options });
|
|
57
|
+
/**
|
|
58
|
+
* Change Password
|
|
59
|
+
*
|
|
60
|
+
* Change one's password (the current one is needed); other devices are
|
|
61
|
+
* logged out, this one stays logged in.
|
|
62
|
+
*/
|
|
63
|
+
export const changePassword = (options) => (options.client ?? client).post({
|
|
64
|
+
url: '/api/auth/password',
|
|
65
|
+
...options,
|
|
66
|
+
headers: {
|
|
67
|
+
'Content-Type': 'application/json',
|
|
68
|
+
...options.headers
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
/**
|
|
72
|
+
* Mark Hint Seen
|
|
73
|
+
*
|
|
74
|
+
* Remember that the person has seen a tutorial hint.
|
|
75
|
+
*/
|
|
76
|
+
export const markHintSeen = (options) => (options.client ?? client).put({ url: '/api/auth/hints/{hint}', ...options });
|
|
77
|
+
/**
|
|
78
|
+
* Remove Avatar
|
|
79
|
+
*/
|
|
80
|
+
export const removeAvatar = (options) => (options?.client ?? client).delete({ url: '/api/me/avatar', ...options });
|
|
81
|
+
/**
|
|
82
|
+
* Set Avatar
|
|
83
|
+
*
|
|
84
|
+
* One's profile picture: PNG, JPEG or WebP, up to 256 KB (the website
|
|
85
|
+
* sends it square, 256 pixels wide).
|
|
86
|
+
*/
|
|
87
|
+
export const setAvatar = (options) => (options.client ?? client).put({
|
|
88
|
+
...formDataBodySerializer,
|
|
89
|
+
url: '/api/me/avatar',
|
|
90
|
+
...options,
|
|
91
|
+
headers: {
|
|
92
|
+
'Content-Type': null,
|
|
93
|
+
...options.headers
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
/**
|
|
97
|
+
* Get Avatar
|
|
98
|
+
*
|
|
99
|
+
* A person's profile picture (404 without one). Its address carries
|
|
100
|
+
* the picture's version, so it may be kept for long.
|
|
101
|
+
*/
|
|
102
|
+
export const getAvatar = (options) => (options.client ?? client).get({ url: '/api/users/{user_id}/avatar', ...options });
|
|
103
|
+
/**
|
|
104
|
+
* List Items
|
|
105
|
+
*
|
|
106
|
+
* Items the person can read, newest first; ``before`` = last ``id`` for
|
|
107
|
+
* the next page. ``library`` shows one library only. ``sort=recent``:
|
|
108
|
+
* by the latest of the item's last change and the reader's last opening,
|
|
109
|
+
* newest first, paged with ``offset`` instead of ``before``;
|
|
110
|
+
* ``sort=opened``: only items the reader opened, by when.
|
|
111
|
+
*
|
|
112
|
+
* ``trashed=true`` lists the trash instead. ``unsorted=true``: only papers
|
|
113
|
+
* with a PDF whose details could not be found (all guessed from the file;
|
|
114
|
+
* papers still being read, and notes or other files without a DOI to
|
|
115
|
+
* find, are left out). ``tag`` (repeatable: items
|
|
116
|
+
* with all of them) and ``collection`` (with its subcollections unless
|
|
117
|
+
* ``nested=false``) filter the list, and ``title`` to items with all of its
|
|
118
|
+
* words in their title (any case). ``X-Total-Count`` is the number of
|
|
119
|
+
* matching items, for showing the total while paging.
|
|
120
|
+
* ``since=N`` is for syncing:
|
|
121
|
+
* every item changed after change number N, trashed or not, in change
|
|
122
|
+
* order; ``limit`` and ``before`` do not apply. The ``Last-Change`` header
|
|
123
|
+
* is the number to pass as ``since`` next time.
|
|
124
|
+
*/
|
|
125
|
+
export const listItems = (options) => (options?.client ?? client).get({ url: '/api/items', ...options });
|
|
126
|
+
/**
|
|
127
|
+
* Add Item
|
|
128
|
+
*
|
|
129
|
+
* A new item; if one of its identifiers is known among the items the
|
|
130
|
+
* person can see, the existing item (200).
|
|
131
|
+
*/
|
|
132
|
+
export const addItem = (options) => (options.client ?? client).post({
|
|
133
|
+
url: '/api/items',
|
|
134
|
+
...options,
|
|
135
|
+
headers: {
|
|
136
|
+
'Content-Type': 'application/json',
|
|
137
|
+
...options.headers
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
/**
|
|
141
|
+
* Add Version
|
|
142
|
+
*
|
|
143
|
+
* Another version of an item, e.g. the published one of a preprint.
|
|
144
|
+
*/
|
|
145
|
+
export const addVersion = (options) => (options.client ?? client).post({
|
|
146
|
+
url: '/api/items/{item_id}/versions',
|
|
147
|
+
...options,
|
|
148
|
+
headers: {
|
|
149
|
+
'Content-Type': 'application/json',
|
|
150
|
+
...options.headers
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
/**
|
|
154
|
+
* Pin Version
|
|
155
|
+
*
|
|
156
|
+
* Cite this version, whatever its kind.
|
|
157
|
+
*/
|
|
158
|
+
export const pinVersion = (options) => (options.client ?? client).post({ url: '/api/versions/{version_id}/pin', ...options });
|
|
159
|
+
/**
|
|
160
|
+
* Set Overrides
|
|
161
|
+
*
|
|
162
|
+
* Replace the manual edits to the metadata for citing.
|
|
163
|
+
*
|
|
164
|
+
* Fields set here win over every version's metadata and survive new
|
|
165
|
+
* lookups; ``null`` hides a field. Needs ``If-Match`` with the ETag from the
|
|
166
|
+
* last read, so concurrent edits are not lost (412 if the item changed).
|
|
167
|
+
*/
|
|
168
|
+
export const setOverrides = (options) => (options.client ?? client).put({
|
|
169
|
+
url: '/api/items/{item_id}/overrides',
|
|
170
|
+
...options,
|
|
171
|
+
headers: {
|
|
172
|
+
'Content-Type': 'application/json',
|
|
173
|
+
...options.headers
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
/**
|
|
177
|
+
* Trash Item
|
|
178
|
+
*
|
|
179
|
+
* Move to the trash; restorable with ``POST …/restore``.
|
|
180
|
+
*/
|
|
181
|
+
export const trashItem = (options) => (options.client ?? client).delete({ url: '/api/items/{item_id}', ...options });
|
|
182
|
+
/**
|
|
183
|
+
* Get Item
|
|
184
|
+
*/
|
|
185
|
+
export const getItem = (options) => (options.client ?? client).get({ url: '/api/items/{item_id}', ...options });
|
|
186
|
+
/**
|
|
187
|
+
* Set Owner
|
|
188
|
+
*
|
|
189
|
+
* Give the item to another owner the person may add to: share it with a
|
|
190
|
+
* group, or take a group's paper for oneself (members may delete it
|
|
191
|
+
* anyway). Tags and collections of the group that gave it up come off.
|
|
192
|
+
*/
|
|
193
|
+
export const setOwner = (options) => (options.client ?? client).put({
|
|
194
|
+
url: '/api/items/{item_id}/owner',
|
|
195
|
+
...options,
|
|
196
|
+
headers: {
|
|
197
|
+
'Content-Type': 'application/json',
|
|
198
|
+
...options.headers
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
/**
|
|
202
|
+
* Restore Item
|
|
203
|
+
*/
|
|
204
|
+
export const restoreItem = (options) => (options.client ?? client).post({ url: '/api/items/{item_id}/restore', ...options });
|
|
205
|
+
/**
|
|
206
|
+
* Unstar Item
|
|
207
|
+
*/
|
|
208
|
+
export const unstarItem = (options) => (options.client ?? client).delete({ url: '/api/items/{item_id}/favourite', ...options });
|
|
209
|
+
/**
|
|
210
|
+
* Star Item
|
|
211
|
+
*
|
|
212
|
+
* Star the paper (for the person only; any paper they can see).
|
|
213
|
+
*/
|
|
214
|
+
export const starItem = (options) => (options.client ?? client).put({ url: '/api/items/{item_id}/favourite', ...options });
|
|
215
|
+
/**
|
|
216
|
+
* Mark Viewed
|
|
217
|
+
*
|
|
218
|
+
* Remember that the person opened the item (for their recent papers).
|
|
219
|
+
*/
|
|
220
|
+
export const markViewed = (options) => (options.client ?? client).post({ url: '/api/items/{item_id}/viewed', ...options });
|
|
221
|
+
/**
|
|
222
|
+
* List Duplicates
|
|
223
|
+
*
|
|
224
|
+
* Papers the person can see that share an identifier or a file with
|
|
225
|
+
* this one: candidates for merging.
|
|
226
|
+
*/
|
|
227
|
+
export const listDuplicates = (options) => (options.client ?? client).get({ url: '/api/items/{item_id}/duplicates', ...options });
|
|
228
|
+
/**
|
|
229
|
+
* Preview Merge
|
|
230
|
+
*
|
|
231
|
+
* What merging this paper into ``into`` would move and leave behind.
|
|
232
|
+
*/
|
|
233
|
+
export const previewMerge = (options) => (options.client ?? client).get({ url: '/api/items/{item_id}/merge-preview', ...options });
|
|
234
|
+
/**
|
|
235
|
+
* Merge Item
|
|
236
|
+
*
|
|
237
|
+
* Merge this paper into another one (the same paper twice). Needs the
|
|
238
|
+
* right to change this one; what may move to the other depends on the
|
|
239
|
+
* person's rights there (see docs/permissions.md).
|
|
240
|
+
*/
|
|
241
|
+
export const mergeItem = (options) => (options.client ?? client).post({
|
|
242
|
+
url: '/api/items/{item_id}/merge',
|
|
243
|
+
...options,
|
|
244
|
+
headers: {
|
|
245
|
+
'Content-Type': 'application/json',
|
|
246
|
+
...options.headers
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
/**
|
|
250
|
+
* Find Upload
|
|
251
|
+
*
|
|
252
|
+
* The item in a library the person can read that already has a file
|
|
253
|
+
* with this SHA-256 (hex), so a client can skip uploading it again; 404 if
|
|
254
|
+
* there is none.
|
|
255
|
+
*/
|
|
256
|
+
export const findUpload = (options) => (options.client ?? client).get({ url: '/api/uploads/{sha256}', ...options });
|
|
257
|
+
/**
|
|
258
|
+
* Upload New Item
|
|
259
|
+
*
|
|
260
|
+
* A new item from a file, titled after the file until its text tells more.
|
|
261
|
+
*
|
|
262
|
+
* The background job looks for a DOI or arXiv ID in the file and replaces
|
|
263
|
+
* the placeholder metadata (see ``paperus.identify``). A file that is
|
|
264
|
+
* already in a library the person can read makes no new item: the answer
|
|
265
|
+
* (200, ``existing``) names the item that has it. ``library_id`` (the
|
|
266
|
+
* owner): the person's default if not given.
|
|
267
|
+
*/
|
|
268
|
+
export const uploadNewItem = (options) => (options.client ?? client).post({
|
|
269
|
+
...formDataBodySerializer,
|
|
270
|
+
url: '/api/uploads',
|
|
271
|
+
...options,
|
|
272
|
+
headers: {
|
|
273
|
+
'Content-Type': null,
|
|
274
|
+
...options.headers
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
/**
|
|
278
|
+
* Upload To Version
|
|
279
|
+
*/
|
|
280
|
+
export const uploadToVersion = (options) => (options.client ?? client).post({
|
|
281
|
+
...formDataBodySerializer,
|
|
282
|
+
url: '/api/versions/{version_id}/files',
|
|
283
|
+
...options,
|
|
284
|
+
headers: {
|
|
285
|
+
'Content-Type': null,
|
|
286
|
+
...options.headers
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
/**
|
|
290
|
+
* Upload To Item
|
|
291
|
+
*
|
|
292
|
+
* Upload to the item's preferred version.
|
|
293
|
+
*/
|
|
294
|
+
export const uploadToItem = (options) => (options.client ?? client).post({
|
|
295
|
+
...formDataBodySerializer,
|
|
296
|
+
url: '/api/items/{item_id}/files',
|
|
297
|
+
...options,
|
|
298
|
+
headers: {
|
|
299
|
+
'Content-Type': null,
|
|
300
|
+
...options.headers
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
/**
|
|
304
|
+
* Download File
|
|
305
|
+
*/
|
|
306
|
+
export const downloadFile = (options) => (options.client ?? client).get({ url: '/api/files/{file_id}/content', ...options });
|
|
307
|
+
/**
|
|
308
|
+
* Trash File
|
|
309
|
+
*
|
|
310
|
+
* Move to the trash; restorable with ``POST …/restore``.
|
|
311
|
+
*/
|
|
312
|
+
export const trashFile = (options) => (options.client ?? client).delete({ url: '/api/files/{file_id}', ...options });
|
|
313
|
+
/**
|
|
314
|
+
* Restore File
|
|
315
|
+
*/
|
|
316
|
+
export const restoreFile = (options) => (options.client ?? client).post({ url: '/api/files/{file_id}/restore', ...options });
|
|
317
|
+
/**
|
|
318
|
+
* Search
|
|
319
|
+
*
|
|
320
|
+
* Passages for ``q`` in the libraries the person can read (or one
|
|
321
|
+
* ``library``): its words (quotes for phrases, ``-`` to exclude), its
|
|
322
|
+
* meaning, or both; ``type`` (repeatable, CSL types) limits the items.
|
|
323
|
+
* ``per_item`` keeps the best few per paper or note, so more papers fit;
|
|
324
|
+
* ``item`` searches within one paper. The ``X-Search-Mode`` header says
|
|
325
|
+
* what was used: without the ML service, hybrid search falls back to
|
|
326
|
+
* keywords.
|
|
327
|
+
*/
|
|
328
|
+
export const search = (options) => (options.client ?? client).get({ url: '/api/search', ...options });
|
|
329
|
+
/**
|
|
330
|
+
* Export Citations
|
|
331
|
+
*
|
|
332
|
+
* Citations for the given papers (``item``, repeatable), a collection
|
|
333
|
+
* (with its subcollections unless ``nested=false``) or, with neither,
|
|
334
|
+
* everything the person can read. ``download=true`` offers it as a file
|
|
335
|
+
* (``.bib`` or ``.json``).
|
|
336
|
+
*/
|
|
337
|
+
export const exportCitations = (options) => (options?.client ?? client).get({ url: '/api/citations', ...options });
|
|
338
|
+
/**
|
|
339
|
+
* List Notes
|
|
340
|
+
*
|
|
341
|
+
* Notes the person can read, last changed first: all of them, those
|
|
342
|
+
* about a paper (``item``) or in a collection (with its subcollections
|
|
343
|
+
* unless ``nested=false``); ``trashed=true`` lists the trash instead.
|
|
344
|
+
* ``X-Total-Count`` is the number of matching notes.
|
|
345
|
+
*/
|
|
346
|
+
export const listNotes = (options) => (options?.client ?? client).get({ url: '/api/notes', ...options });
|
|
347
|
+
/**
|
|
348
|
+
* Create Note
|
|
349
|
+
*
|
|
350
|
+
* A new note for the given owner (or the person's default owner), about
|
|
351
|
+
* the given papers, optionally put into a collection.
|
|
352
|
+
*/
|
|
353
|
+
export const createNote = (options) => (options.client ?? client).post({
|
|
354
|
+
url: '/api/notes',
|
|
355
|
+
...options,
|
|
356
|
+
headers: {
|
|
357
|
+
'Content-Type': 'application/json',
|
|
358
|
+
...options.headers
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
/**
|
|
362
|
+
* Trash Note
|
|
363
|
+
*/
|
|
364
|
+
export const trashNote = (options) => (options.client ?? client).delete({ url: '/api/notes/{note_id}', ...options });
|
|
365
|
+
/**
|
|
366
|
+
* Read Note
|
|
367
|
+
*
|
|
368
|
+
* The note with its text; the ``ETag`` goes into ``If-Match`` when saving.
|
|
369
|
+
*/
|
|
370
|
+
export const readNote = (options) => (options.client ?? client).get({ url: '/api/notes/{note_id}', ...options });
|
|
371
|
+
/**
|
|
372
|
+
* Change Note
|
|
373
|
+
*
|
|
374
|
+
* Save the text. Needs ``If-Match`` with the ETag the editor started
|
|
375
|
+
* from: 412 if someone else saved in between (then reload and merge).
|
|
376
|
+
*/
|
|
377
|
+
export const changeNote = (options) => (options.client ?? client).patch({
|
|
378
|
+
url: '/api/notes/{note_id}',
|
|
379
|
+
...options,
|
|
380
|
+
headers: {
|
|
381
|
+
'Content-Type': 'application/json',
|
|
382
|
+
...options.headers
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
/**
|
|
386
|
+
* Unlink Item
|
|
387
|
+
*/
|
|
388
|
+
export const unlinkItem = (options) => (options.client ?? client).delete({ url: '/api/notes/{note_id}/items/{item_id}', ...options });
|
|
389
|
+
/**
|
|
390
|
+
* Link Item
|
|
391
|
+
*
|
|
392
|
+
* Say the note is about the paper (at a page); changes the page if it
|
|
393
|
+
* is linked already.
|
|
394
|
+
*/
|
|
395
|
+
export const linkItem = (options) => (options.client ?? client).put({
|
|
396
|
+
url: '/api/notes/{note_id}/items/{item_id}',
|
|
397
|
+
...options,
|
|
398
|
+
headers: {
|
|
399
|
+
'Content-Type': 'application/json',
|
|
400
|
+
...options.headers
|
|
401
|
+
}
|
|
402
|
+
});
|
|
403
|
+
/**
|
|
404
|
+
* Set Note Owner
|
|
405
|
+
*
|
|
406
|
+
* Give the note to another owner the person may add to. Collections of a
|
|
407
|
+
* group that no longer owns it let it go.
|
|
408
|
+
*/
|
|
409
|
+
export const setNoteOwner = (options) => (options.client ?? client).put({
|
|
410
|
+
url: '/api/notes/{note_id}/owner',
|
|
411
|
+
...options,
|
|
412
|
+
headers: {
|
|
413
|
+
'Content-Type': 'application/json',
|
|
414
|
+
...options.headers
|
|
415
|
+
}
|
|
416
|
+
});
|
|
417
|
+
/**
|
|
418
|
+
* Restore Note
|
|
419
|
+
*/
|
|
420
|
+
export const restoreNote = (options) => (options.client ?? client).post({ url: '/api/notes/{note_id}/restore', ...options });
|
|
421
|
+
/**
|
|
422
|
+
* Note History
|
|
423
|
+
*
|
|
424
|
+
* Earlier texts of the note, newest first.
|
|
425
|
+
*/
|
|
426
|
+
export const noteHistory = (options) => (options.client ?? client).get({ url: '/api/notes/{note_id}/history', ...options });
|
|
427
|
+
/**
|
|
428
|
+
* Note Markdown
|
|
429
|
+
*
|
|
430
|
+
* The note as a Markdown file.
|
|
431
|
+
*/
|
|
432
|
+
export const noteMarkdown = (options) => (options.client ?? client).get({ url: '/api/notes/{note_id}/markdown', ...options });
|
|
433
|
+
/**
|
|
434
|
+
* Add Notes
|
|
435
|
+
*
|
|
436
|
+
* Put notes into a collection; those it may not hold (a group's
|
|
437
|
+
* collection holds only the group's notes) or unknown ones are skipped.
|
|
438
|
+
*/
|
|
439
|
+
export const addNotes = (options) => (options.client ?? client).post({
|
|
440
|
+
url: '/api/collections/{collection_id}/notes',
|
|
441
|
+
...options,
|
|
442
|
+
headers: {
|
|
443
|
+
'Content-Type': 'application/json',
|
|
444
|
+
...options.headers
|
|
445
|
+
}
|
|
446
|
+
});
|
|
447
|
+
/**
|
|
448
|
+
* Remove Note
|
|
449
|
+
*/
|
|
450
|
+
export const removeNote = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}/notes/{note_id}', ...options });
|
|
451
|
+
/**
|
|
452
|
+
* List Imports
|
|
453
|
+
*
|
|
454
|
+
* The person's imports, newest first.
|
|
455
|
+
*/
|
|
456
|
+
export const listImports = (options) => (options?.client ?? client).get({ url: '/api/imports', ...options });
|
|
457
|
+
/**
|
|
458
|
+
* Start Import
|
|
459
|
+
*
|
|
460
|
+
* Import an export: BibTeX, RIS or CSL-JSON, alone or zipped with its
|
|
461
|
+
* files. Everything new belongs to ``library_id`` (default: the person's
|
|
462
|
+
* default owner). Runs in the background; poll ``GET /api/imports/{id}``.
|
|
463
|
+
*/
|
|
464
|
+
export const startImport = (options) => (options.client ?? client).post({
|
|
465
|
+
...formDataBodySerializer,
|
|
466
|
+
url: '/api/imports',
|
|
467
|
+
...options,
|
|
468
|
+
headers: {
|
|
469
|
+
'Content-Type': null,
|
|
470
|
+
...options.headers
|
|
471
|
+
}
|
|
472
|
+
});
|
|
473
|
+
/**
|
|
474
|
+
* Get Import
|
|
475
|
+
*/
|
|
476
|
+
export const getImport = (options) => (options.client ?? client).get({ url: '/api/imports/{import_id}', ...options });
|
|
477
|
+
/**
|
|
478
|
+
* List Duplicates Everywhere
|
|
479
|
+
*
|
|
480
|
+
* Pairs of papers that look like the same paper (same identifier or
|
|
481
|
+
* file first, then the same title), with a recommendation which to keep;
|
|
482
|
+
* pairs marked as different are left out.
|
|
483
|
+
*/
|
|
484
|
+
export const listDuplicatesEverywhere = (options) => (options?.client ?? client).get({ url: '/api/duplicates', ...options });
|
|
485
|
+
/**
|
|
486
|
+
* Mark Different
|
|
487
|
+
*
|
|
488
|
+
* The two are different papers: do not suggest them again (for everyone
|
|
489
|
+
* who sees both). Needs the right to change at least one of them.
|
|
490
|
+
*/
|
|
491
|
+
export const markDifferent = (options) => (options.client ?? client).post({
|
|
492
|
+
url: '/api/duplicates/different',
|
|
493
|
+
...options,
|
|
494
|
+
headers: {
|
|
495
|
+
'Content-Type': 'application/json',
|
|
496
|
+
...options.headers
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
/**
|
|
500
|
+
* Empty Trash
|
|
501
|
+
*
|
|
502
|
+
* Delete for good everything in the trash the person may change: their
|
|
503
|
+
* own and that of groups where they are a member or admin.
|
|
504
|
+
*/
|
|
505
|
+
export const emptyTrash = (options) => (options?.client ?? client).delete({ url: '/api/trash', ...options });
|
|
506
|
+
/**
|
|
507
|
+
* Storage
|
|
508
|
+
*
|
|
509
|
+
* How full the storage is (for the bar at the bottom of the menu).
|
|
510
|
+
*/
|
|
511
|
+
export const storage = (options) => (options?.client ?? client).get({ url: '/api/storage', ...options });
|
|
512
|
+
/**
|
|
513
|
+
* Get Config
|
|
514
|
+
*/
|
|
515
|
+
export const getConfig = (options) => (options?.client ?? client).get({ url: '/api/admin/config', ...options });
|
|
516
|
+
/**
|
|
517
|
+
* Set Config
|
|
518
|
+
*
|
|
519
|
+
* Save settings. A new embedding model must be one the ML service
|
|
520
|
+
* offers; the library is then re-embedded in the background, while keyword
|
|
521
|
+
* search keeps working and search by meaning covers more and more.
|
|
522
|
+
*/
|
|
523
|
+
export const setConfig = (options) => (options.client ?? client).put({
|
|
524
|
+
url: '/api/admin/config',
|
|
525
|
+
...options,
|
|
526
|
+
headers: {
|
|
527
|
+
'Content-Type': 'application/json',
|
|
528
|
+
...options.headers
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
/**
|
|
532
|
+
* Ml Status
|
|
533
|
+
*/
|
|
534
|
+
export const mlStatus = (options) => (options?.client ?? client).get({ url: '/api/admin/ml', ...options });
|
|
535
|
+
/**
|
|
536
|
+
* Measure Ml Speed
|
|
537
|
+
*
|
|
538
|
+
* Time a model on this installation's ML service with sample passages.
|
|
539
|
+
* A model not downloaded yet starts downloading: the answer then says
|
|
540
|
+
* ``loading``; ask again in a while.
|
|
541
|
+
*/
|
|
542
|
+
export const measureMlSpeed = (options) => (options.client ?? client).post({ url: '/api/admin/ml/models/{name}/speed', ...options });
|
|
543
|
+
/**
|
|
544
|
+
* Delete Ml Model
|
|
545
|
+
*
|
|
546
|
+
* Remove a downloaded model from the ML service (not the one in use).
|
|
547
|
+
*/
|
|
548
|
+
export const deleteMlModel = (options) => (options.client ?? client).delete({ url: '/api/admin/ml/models/{name}', ...options });
|
|
549
|
+
/**
|
|
550
|
+
* Stats
|
|
551
|
+
*/
|
|
552
|
+
export const stats = (options) => (options?.client ?? client).get({ url: '/api/admin/stats', ...options });
|
|
553
|
+
/**
|
|
554
|
+
* Run Job
|
|
555
|
+
*
|
|
556
|
+
* Start a sweep now: ``embeddings`` (embed what is missing), ``text``
|
|
557
|
+
* (read files still pending), ``text-all`` (read every file again),
|
|
558
|
+
* ``trash`` (delete what is older than the trash days), ``integrity``
|
|
559
|
+
* (check stored contents), ``integrity-deep`` (also their SHA-256) or
|
|
560
|
+
* ``integrity-clean`` (check and remove unused stored contents), ``copy``
|
|
561
|
+
* (update the readable copy) or ``copy-remove`` (delete it).
|
|
562
|
+
*/
|
|
563
|
+
export const runJob = (options) => (options.client ?? client).post({ url: '/api/admin/jobs/{job}', ...options });
|
|
564
|
+
/**
|
|
565
|
+
* Integrity Report
|
|
566
|
+
*
|
|
567
|
+
* The last integrity check's report (None before the first).
|
|
568
|
+
*/
|
|
569
|
+
export const integrityReport = (options) => (options?.client ?? client).get({ url: '/api/admin/integrity', ...options });
|
|
570
|
+
/**
|
|
571
|
+
* Authentication
|
|
572
|
+
*
|
|
573
|
+
* What the Authentication settings show besides the settings.
|
|
574
|
+
*/
|
|
575
|
+
export const authentication = (options) => (options?.client ?? client).get({ url: '/api/admin/authentication', ...options });
|
|
576
|
+
/**
|
|
577
|
+
* Set Oidc Secret
|
|
578
|
+
*
|
|
579
|
+
* The OIDC login's client secret; never sent back.
|
|
580
|
+
*/
|
|
581
|
+
export const setOidcSecret = (options) => (options.client ?? client).put({
|
|
582
|
+
url: '/api/admin/authentication/secret',
|
|
583
|
+
...options,
|
|
584
|
+
headers: {
|
|
585
|
+
'Content-Type': 'application/json',
|
|
586
|
+
...options.headers
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
/**
|
|
590
|
+
* Check Provider
|
|
591
|
+
*
|
|
592
|
+
* Whether the identity provider answers at this address.
|
|
593
|
+
*/
|
|
594
|
+
export const checkProvider = (options) => (options.client ?? client).post({
|
|
595
|
+
url: '/api/admin/authentication/check',
|
|
596
|
+
...options,
|
|
597
|
+
headers: {
|
|
598
|
+
'Content-Type': 'application/json',
|
|
599
|
+
...options.headers
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
/**
|
|
603
|
+
* End All Sessions
|
|
604
|
+
*
|
|
605
|
+
* Log everyone out on every device, except this one.
|
|
606
|
+
*/
|
|
607
|
+
export const endAllSessions = (options) => (options?.client ?? client).delete({ url: '/api/admin/sessions', ...options });
|
|
608
|
+
/**
|
|
609
|
+
* Readable Copy
|
|
610
|
+
*/
|
|
611
|
+
export const readableCopy = (options) => (options?.client ?? client).get({ url: '/api/admin/readable-copy', ...options });
|
|
612
|
+
/**
|
|
613
|
+
* Preview Template
|
|
614
|
+
*/
|
|
615
|
+
export const previewTemplate = (options) => (options.client ?? client).post({
|
|
616
|
+
url: '/api/admin/readable-copy/preview',
|
|
617
|
+
...options,
|
|
618
|
+
headers: {
|
|
619
|
+
'Content-Type': 'application/json',
|
|
620
|
+
...options.headers
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
/**
|
|
624
|
+
* List Tags
|
|
625
|
+
*
|
|
626
|
+
* The tags of the libraries the person can read, with how they are used
|
|
627
|
+
* (items in the trash do not count).
|
|
628
|
+
*/
|
|
629
|
+
export const listTags = (options) => (options?.client ?? client).get({ url: '/api/tags', ...options });
|
|
630
|
+
/**
|
|
631
|
+
* Create Tag
|
|
632
|
+
*
|
|
633
|
+
* A tag not on any item yet (409 if the library has one of that name).
|
|
634
|
+
*/
|
|
635
|
+
export const createTag = (options) => (options.client ?? client).post({
|
|
636
|
+
url: '/api/tags',
|
|
637
|
+
...options,
|
|
638
|
+
headers: {
|
|
639
|
+
'Content-Type': 'application/json',
|
|
640
|
+
...options.headers
|
|
641
|
+
}
|
|
642
|
+
});
|
|
643
|
+
/**
|
|
644
|
+
* Add Tag
|
|
645
|
+
*
|
|
646
|
+
* Tag an item with its owner's, the person's or one of their groups' tag
|
|
647
|
+
* (see ``Access.may_tag``); the tag is created if that owner has none of
|
|
648
|
+
* that name (any case), which for a group needs member rights there.
|
|
649
|
+
*/
|
|
650
|
+
export const addTag = (options) => (options.client ?? client).post({
|
|
651
|
+
url: '/api/items/{item_id}/tags',
|
|
652
|
+
...options,
|
|
653
|
+
headers: {
|
|
654
|
+
'Content-Type': 'application/json',
|
|
655
|
+
...options.headers
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
/**
|
|
659
|
+
* Remove Tag
|
|
660
|
+
*/
|
|
661
|
+
export const removeTag = (options) => (options.client ?? client).delete({ url: '/api/items/{item_id}/tags/{tag_id}', ...options });
|
|
662
|
+
/**
|
|
663
|
+
* Delete Tag
|
|
664
|
+
*
|
|
665
|
+
* Remove a tag from every item and delete it.
|
|
666
|
+
*/
|
|
667
|
+
export const deleteTag = (options) => (options.client ?? client).delete({ url: '/api/tags/{tag_id}', ...options });
|
|
668
|
+
/**
|
|
669
|
+
* Change Tag
|
|
670
|
+
*
|
|
671
|
+
* Rename a tag everywhere (409 if another tag of its owner has that
|
|
672
|
+
* name), set its colour or description, or give it to another owner.
|
|
673
|
+
*/
|
|
674
|
+
export const changeTag = (options) => (options.client ?? client).patch({
|
|
675
|
+
url: '/api/tags/{tag_id}',
|
|
676
|
+
...options,
|
|
677
|
+
headers: {
|
|
678
|
+
'Content-Type': 'application/json',
|
|
679
|
+
...options.headers
|
|
680
|
+
}
|
|
681
|
+
});
|
|
682
|
+
/**
|
|
683
|
+
* List Collections
|
|
684
|
+
*
|
|
685
|
+
* The collections of the libraries the person can read, flat;
|
|
686
|
+
* ``parent_id`` gives the tree.
|
|
687
|
+
*/
|
|
688
|
+
export const listCollections = (options) => (options?.client ?? client).get({ url: '/api/collections', ...options });
|
|
689
|
+
/**
|
|
690
|
+
* Create Collection
|
|
691
|
+
*/
|
|
692
|
+
export const createCollection = (options) => (options.client ?? client).post({
|
|
693
|
+
url: '/api/collections',
|
|
694
|
+
...options,
|
|
695
|
+
headers: {
|
|
696
|
+
'Content-Type': 'application/json',
|
|
697
|
+
...options.headers
|
|
698
|
+
}
|
|
699
|
+
});
|
|
700
|
+
/**
|
|
701
|
+
* Delete Collection
|
|
702
|
+
*
|
|
703
|
+
* Delete a collection and its subcollections; items stay in the library.
|
|
704
|
+
*/
|
|
705
|
+
export const deleteCollection = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}', ...options });
|
|
706
|
+
/**
|
|
707
|
+
* Change Collection
|
|
708
|
+
*
|
|
709
|
+
* Rename, describe or move a collection (not into itself), also into
|
|
710
|
+
* another library the person may change.
|
|
711
|
+
*/
|
|
712
|
+
export const changeCollection = (options) => (options.client ?? client).patch({
|
|
713
|
+
url: '/api/collections/{collection_id}',
|
|
714
|
+
...options,
|
|
715
|
+
headers: {
|
|
716
|
+
'Content-Type': 'application/json',
|
|
717
|
+
...options.headers
|
|
718
|
+
}
|
|
719
|
+
});
|
|
720
|
+
/**
|
|
721
|
+
* Preview Move
|
|
722
|
+
*
|
|
723
|
+
* Before moving a collection into another library: how many of its
|
|
724
|
+
* papers are not in that library yet.
|
|
725
|
+
*/
|
|
726
|
+
export const previewMove = (options) => (options.client ?? client).get({ url: '/api/collections/{collection_id}/move-preview', ...options });
|
|
727
|
+
/**
|
|
728
|
+
* Unpin Collection
|
|
729
|
+
*/
|
|
730
|
+
export const unpinCollection = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}/pin', ...options });
|
|
731
|
+
/**
|
|
732
|
+
* Pin Collection
|
|
733
|
+
*
|
|
734
|
+
* Pin the collection to the person's sidebar (readers may too).
|
|
735
|
+
*/
|
|
736
|
+
export const pinCollection = (options) => (options.client ?? client).put({ url: '/api/collections/{collection_id}/pin', ...options });
|
|
737
|
+
/**
|
|
738
|
+
* Add Items
|
|
739
|
+
*
|
|
740
|
+
* Add items; those the collection may not hold (a group's collection
|
|
741
|
+
* holds only that group's items) or the person cannot read are skipped.
|
|
742
|
+
*/
|
|
743
|
+
export const addItems = (options) => (options.client ?? client).post({
|
|
744
|
+
url: '/api/collections/{collection_id}/items',
|
|
745
|
+
...options,
|
|
746
|
+
headers: {
|
|
747
|
+
'Content-Type': 'application/json',
|
|
748
|
+
...options.headers
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
/**
|
|
752
|
+
* Remove Item
|
|
753
|
+
*/
|
|
754
|
+
export const removeItem = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}/items/{item_id}', ...options });
|
|
755
|
+
/**
|
|
756
|
+
* List Libraries
|
|
757
|
+
*
|
|
758
|
+
* The libraries the person can read: their own first, then their groups'.
|
|
759
|
+
*/
|
|
760
|
+
export const listLibraries = (options) => (options?.client ?? client).get({ url: '/api/libraries', ...options });
|
|
761
|
+
/**
|
|
762
|
+
* Set Default Library
|
|
763
|
+
*
|
|
764
|
+
* Where new items go unless another library is chosen.
|
|
765
|
+
*/
|
|
766
|
+
export const setDefaultLibrary = (options) => (options.client ?? client).put({
|
|
767
|
+
url: '/api/me/default-library',
|
|
768
|
+
...options,
|
|
769
|
+
headers: {
|
|
770
|
+
'Content-Type': 'application/json',
|
|
771
|
+
...options.headers
|
|
772
|
+
}
|
|
773
|
+
});
|
|
774
|
+
/**
|
|
775
|
+
* List Groups
|
|
776
|
+
*
|
|
777
|
+
* The groups the person belongs to (directly or through a group above);
|
|
778
|
+
* site administrators see every group. Flat; ``parent_id`` gives the tree.
|
|
779
|
+
*/
|
|
780
|
+
export const listGroups = (options) => (options?.client ?? client).get({ url: '/api/groups', ...options });
|
|
781
|
+
/**
|
|
782
|
+
* Create Group
|
|
783
|
+
*
|
|
784
|
+
* A group with its library. Top-level groups: site administrators only,
|
|
785
|
+
* with a first admin. Subgroups: the parent's admins (who are then admins
|
|
786
|
+
* of the subgroup too).
|
|
787
|
+
*/
|
|
788
|
+
export const createGroup = (options) => (options.client ?? client).post({
|
|
789
|
+
url: '/api/groups',
|
|
790
|
+
...options,
|
|
791
|
+
headers: {
|
|
792
|
+
'Content-Type': 'application/json',
|
|
793
|
+
...options.headers
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
/**
|
|
797
|
+
* Delete Group
|
|
798
|
+
*
|
|
799
|
+
* Delete an empty group: no groups inside and no items or notes (not
|
|
800
|
+
* even in its trash). Its tags, collections and memberships go with it.
|
|
801
|
+
*/
|
|
802
|
+
export const deleteGroup = (options) => (options.client ?? client).delete({ url: '/api/groups/{group_id}', ...options });
|
|
803
|
+
/**
|
|
804
|
+
* Change Group
|
|
805
|
+
*/
|
|
806
|
+
export const changeGroup = (options) => (options.client ?? client).patch({
|
|
807
|
+
url: '/api/groups/{group_id}',
|
|
808
|
+
...options,
|
|
809
|
+
headers: {
|
|
810
|
+
'Content-Type': 'application/json',
|
|
811
|
+
...options.headers
|
|
812
|
+
}
|
|
813
|
+
});
|
|
814
|
+
/**
|
|
815
|
+
* List Members
|
|
816
|
+
*
|
|
817
|
+
* Everyone in the group: given a role here or in a group above.
|
|
818
|
+
*/
|
|
819
|
+
export const listMembers = (options) => (options.client ?? client).get({ url: '/api/groups/{group_id}/members', ...options });
|
|
820
|
+
/**
|
|
821
|
+
* Remove Member
|
|
822
|
+
*
|
|
823
|
+
* Remove someone's membership here (inherited ones stay).
|
|
824
|
+
*/
|
|
825
|
+
export const removeMember = (options) => (options.client ?? client).delete({ url: '/api/groups/{group_id}/members/{user_id}', ...options });
|
|
826
|
+
/**
|
|
827
|
+
* Set Member
|
|
828
|
+
*
|
|
829
|
+
* Add someone to the group, or change their role here. A role lower than
|
|
830
|
+
* one inherited from a group above has no effect (inherited roles win).
|
|
831
|
+
*/
|
|
832
|
+
export const setMember = (options) => (options.client ?? client).put({
|
|
833
|
+
url: '/api/groups/{group_id}/members/{user_id}',
|
|
834
|
+
...options,
|
|
835
|
+
headers: {
|
|
836
|
+
'Content-Type': 'application/json',
|
|
837
|
+
...options.headers
|
|
838
|
+
}
|
|
839
|
+
});
|
|
840
|
+
/**
|
|
841
|
+
* Leave Group
|
|
842
|
+
*
|
|
843
|
+
* Leave a group one was added to. Membership through a group above can
|
|
844
|
+
* only be left there.
|
|
845
|
+
*/
|
|
846
|
+
export const leaveGroup = (options) => (options.client ?? client).post({ url: '/api/groups/{group_id}/leave', ...options });
|
|
847
|
+
/**
|
|
848
|
+
* Find Users
|
|
849
|
+
*
|
|
850
|
+
* People to add to a group, by username; for site administrators and
|
|
851
|
+
* group admins.
|
|
852
|
+
*/
|
|
853
|
+
export const findUsers = (options) => (options?.client ?? client).get({ url: '/api/users', ...options });
|
|
854
|
+
/**
|
|
855
|
+
* List Users
|
|
856
|
+
*/
|
|
857
|
+
export const listUsers = (options) => (options?.client ?? client).get({ url: '/api/admin/users', ...options });
|
|
858
|
+
/**
|
|
859
|
+
* Create User
|
|
860
|
+
*
|
|
861
|
+
* A new account (with its private space); 409 if the name is taken.
|
|
862
|
+
*/
|
|
863
|
+
export const createUser = (options) => (options.client ?? client).post({
|
|
864
|
+
url: '/api/admin/users',
|
|
865
|
+
...options,
|
|
866
|
+
headers: {
|
|
867
|
+
'Content-Type': 'application/json',
|
|
868
|
+
...options.headers
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
/**
|
|
872
|
+
* Change User
|
|
873
|
+
*
|
|
874
|
+
* Reset a password, grant or take admin rights, (de)activate. The last
|
|
875
|
+
* active administrator cannot lose those rights, and nobody deactivates
|
|
876
|
+
* themselves.
|
|
877
|
+
*/
|
|
878
|
+
export const changeUser = (options) => (options.client ?? client).patch({
|
|
879
|
+
url: '/api/admin/users/{user_id}',
|
|
880
|
+
...options,
|
|
881
|
+
headers: {
|
|
882
|
+
'Content-Type': 'application/json',
|
|
883
|
+
...options.headers
|
|
884
|
+
}
|
|
885
|
+
});
|
|
886
|
+
/**
|
|
887
|
+
* Private Things
|
|
888
|
+
*/
|
|
889
|
+
export const privateThings = (options) => (options.client ?? client).get({ url: '/api/admin/users/{user_id}/private', ...options });
|
|
890
|
+
/**
|
|
891
|
+
* Hand Over
|
|
892
|
+
*
|
|
893
|
+
* Give a deactivated person's papers, notes, tags and collections to a
|
|
894
|
+
* group or another person.
|
|
895
|
+
*/
|
|
896
|
+
export const handOver = (options) => (options.client ?? client).post({
|
|
897
|
+
url: '/api/admin/users/{user_id}/hand-over',
|
|
898
|
+
...options,
|
|
899
|
+
headers: {
|
|
900
|
+
'Content-Type': 'application/json',
|
|
901
|
+
...options.headers
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
/**
|
|
905
|
+
* List Backups
|
|
906
|
+
*/
|
|
907
|
+
export const listBackups = (options) => (options?.client ?? client).get({ url: '/api/admin/backups', ...options });
|
|
908
|
+
/**
|
|
909
|
+
* Start Backup
|
|
910
|
+
*
|
|
911
|
+
* Queue a backup now (the worker writes it); 409 if one is running.
|
|
912
|
+
*/
|
|
913
|
+
export const startBackup = (options) => (options.client ?? client).post({
|
|
914
|
+
url: '/api/admin/backups',
|
|
915
|
+
...options,
|
|
916
|
+
headers: {
|
|
917
|
+
'Content-Type': 'application/json',
|
|
918
|
+
...options.headers
|
|
919
|
+
}
|
|
920
|
+
});
|
|
921
|
+
/**
|
|
922
|
+
* Set Backup Config
|
|
923
|
+
*/
|
|
924
|
+
export const setBackupConfig = (options) => (options.client ?? client).put({
|
|
925
|
+
url: '/api/admin/backups/config',
|
|
926
|
+
...options,
|
|
927
|
+
headers: {
|
|
928
|
+
'Content-Type': 'application/json',
|
|
929
|
+
...options.headers
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
/**
|
|
933
|
+
* Delete Backup
|
|
934
|
+
*/
|
|
935
|
+
export const deleteBackup = (options) => (options.client ?? client).delete({ url: '/api/admin/backups/{name}', ...options });
|
|
936
|
+
/**
|
|
937
|
+
* Check Restore
|
|
938
|
+
*/
|
|
939
|
+
export const checkRestore = (options) => (options.client ?? client).get({ url: '/api/setup/restore-check', ...options });
|
|
940
|
+
/**
|
|
941
|
+
* Setup State
|
|
942
|
+
*/
|
|
943
|
+
export const setupState = (options) => (options?.client ?? client).get({ url: '/api/setup', ...options });
|
|
944
|
+
/**
|
|
945
|
+
* Create First Admin
|
|
946
|
+
*
|
|
947
|
+
* The first administrator, logged in right away.
|
|
948
|
+
*/
|
|
949
|
+
export const createFirstAdmin = (options) => (options.client ?? client).post({
|
|
950
|
+
url: '/api/setup/admin',
|
|
951
|
+
...options,
|
|
952
|
+
headers: {
|
|
953
|
+
'Content-Type': 'application/json',
|
|
954
|
+
...options.headers
|
|
955
|
+
}
|
|
956
|
+
});
|
|
957
|
+
/**
|
|
958
|
+
* Restore On First Start
|
|
959
|
+
*
|
|
960
|
+
* Restore a backup from the backup folder into the empty database; then
|
|
961
|
+
* people log in with their accounts from the backup.
|
|
962
|
+
*/
|
|
963
|
+
export const restoreOnFirstStart = (options) => (options.client ?? client).post({
|
|
964
|
+
url: '/api/setup/restore',
|
|
965
|
+
...options,
|
|
966
|
+
headers: {
|
|
967
|
+
'Content-Type': 'application/json',
|
|
968
|
+
...options.headers
|
|
969
|
+
}
|
|
970
|
+
});
|
|
971
|
+
/**
|
|
972
|
+
* List Tokens
|
|
973
|
+
*/
|
|
974
|
+
export const listTokens = (options) => (options?.client ?? client).get({ url: '/api/me/tokens', ...options });
|
|
975
|
+
/**
|
|
976
|
+
* Create Token
|
|
977
|
+
*
|
|
978
|
+
* A token acting as you, narrowed to its scopes (and owners).
|
|
979
|
+
*/
|
|
980
|
+
export const createToken = (options) => (options.client ?? client).post({
|
|
981
|
+
url: '/api/me/tokens',
|
|
982
|
+
...options,
|
|
983
|
+
headers: {
|
|
984
|
+
'Content-Type': 'application/json',
|
|
985
|
+
...options.headers
|
|
986
|
+
}
|
|
987
|
+
});
|
|
988
|
+
/**
|
|
989
|
+
* Revoke Token
|
|
990
|
+
*/
|
|
991
|
+
export const revokeToken = (options) => (options.client ?? client).delete({ url: '/api/me/tokens/{token_id}', ...options });
|