paperus 0.0.0-stage → 0.0.9

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.
Files changed (36) hide show
  1. package/README.md +16 -2
  2. package/dist/generated/client/client.gen.d.ts +2 -0
  3. package/dist/generated/client/client.gen.js +216 -0
  4. package/dist/generated/client/index.d.ts +10 -0
  5. package/dist/generated/client/index.js +6 -0
  6. package/dist/generated/client/types.gen.d.ts +120 -0
  7. package/dist/generated/client/types.gen.js +2 -0
  8. package/dist/generated/client/utils.gen.d.ts +37 -0
  9. package/dist/generated/client/utils.gen.js +228 -0
  10. package/dist/generated/client.gen.d.ts +12 -0
  11. package/dist/generated/client.gen.js +3 -0
  12. package/dist/generated/core/auth.gen.d.ts +25 -0
  13. package/dist/generated/core/auth.gen.js +14 -0
  14. package/dist/generated/core/bodySerializer.gen.d.ts +25 -0
  15. package/dist/generated/core/bodySerializer.gen.js +57 -0
  16. package/dist/generated/core/params.gen.d.ts +43 -0
  17. package/dist/generated/core/params.gen.js +109 -0
  18. package/dist/generated/core/pathSerializer.gen.d.ts +33 -0
  19. package/dist/generated/core/pathSerializer.gen.js +106 -0
  20. package/dist/generated/core/queryKeySerializer.gen.d.ts +18 -0
  21. package/dist/generated/core/queryKeySerializer.gen.js +92 -0
  22. package/dist/generated/core/serverSentEvents.gen.d.ts +71 -0
  23. package/dist/generated/core/serverSentEvents.gen.js +132 -0
  24. package/dist/generated/core/types.gen.d.ts +83 -0
  25. package/dist/generated/core/types.gen.js +2 -0
  26. package/dist/generated/core/utils.gen.d.ts +19 -0
  27. package/dist/generated/core/utils.gen.js +87 -0
  28. package/dist/generated/index.d.ts +2 -0
  29. package/dist/generated/index.js +2 -0
  30. package/dist/generated/sdk.gen.d.ts +725 -0
  31. package/dist/generated/sdk.gen.js +998 -0
  32. package/dist/generated/types.gen.d.ts +5092 -0
  33. package/dist/generated/types.gen.js +2 -0
  34. package/dist/index.d.ts +20 -0
  35. package/dist/index.js +19 -0
  36. package/package.json +38 -5
@@ -0,0 +1,998 @@
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
+ * Passage Text
309
+ *
310
+ * One passage of a file, as read from it (to find it on the page).
311
+ */
312
+ export const passageText = (options) => (options.client ?? client).get({ url: '/api/files/{file_id}/passages/{position}', ...options });
313
+ /**
314
+ * Trash File
315
+ *
316
+ * Move to the trash; restorable with ``POST …/restore``.
317
+ */
318
+ export const trashFile = (options) => (options.client ?? client).delete({ url: '/api/files/{file_id}', ...options });
319
+ /**
320
+ * Restore File
321
+ */
322
+ export const restoreFile = (options) => (options.client ?? client).post({ url: '/api/files/{file_id}/restore', ...options });
323
+ /**
324
+ * Search
325
+ *
326
+ * Passages for ``q`` in the libraries the person can read (or one
327
+ * ``library``): its words (quotes for phrases, ``-`` to exclude), its
328
+ * meaning, or both; ``type`` (repeatable, CSL types) limits the items.
329
+ * ``per_item`` keeps the best few per paper or note, so more papers fit;
330
+ * ``item`` searches within one paper. The ``X-Search-Mode`` header says
331
+ * what was used: without the ML service, hybrid search falls back to
332
+ * keywords.
333
+ */
334
+ export const search = (options) => (options.client ?? client).get({ url: '/api/search', ...options });
335
+ /**
336
+ * Export Citations
337
+ *
338
+ * Citations for the given papers (``item``, repeatable), a collection
339
+ * (with its subcollections unless ``nested=false``) or, with neither,
340
+ * everything the person can read. ``download=true`` offers it as a file
341
+ * (``.bib`` or ``.json``).
342
+ */
343
+ export const exportCitations = (options) => (options?.client ?? client).get({ url: '/api/citations', ...options });
344
+ /**
345
+ * List Notes
346
+ *
347
+ * Notes the person can read, last changed first: all of them, those
348
+ * about a paper (``item``) or in a collection (with its subcollections
349
+ * unless ``nested=false``); ``trashed=true`` lists the trash instead.
350
+ * ``X-Total-Count`` is the number of matching notes.
351
+ */
352
+ export const listNotes = (options) => (options?.client ?? client).get({ url: '/api/notes', ...options });
353
+ /**
354
+ * Create Note
355
+ *
356
+ * A new note for the given owner (or the person's default owner), about
357
+ * the given papers, optionally put into a collection.
358
+ */
359
+ export const createNote = (options) => (options.client ?? client).post({
360
+ url: '/api/notes',
361
+ ...options,
362
+ headers: {
363
+ 'Content-Type': 'application/json',
364
+ ...options.headers
365
+ }
366
+ });
367
+ /**
368
+ * Trash Note
369
+ */
370
+ export const trashNote = (options) => (options.client ?? client).delete({ url: '/api/notes/{note_id}', ...options });
371
+ /**
372
+ * Read Note
373
+ *
374
+ * The note with its text; the ``ETag`` goes into ``If-Match`` when saving.
375
+ */
376
+ export const readNote = (options) => (options.client ?? client).get({ url: '/api/notes/{note_id}', ...options });
377
+ /**
378
+ * Change Note
379
+ *
380
+ * Save the text. Needs ``If-Match`` with the ETag the editor started
381
+ * from: 412 if someone else saved in between (then reload and merge).
382
+ */
383
+ export const changeNote = (options) => (options.client ?? client).patch({
384
+ url: '/api/notes/{note_id}',
385
+ ...options,
386
+ headers: {
387
+ 'Content-Type': 'application/json',
388
+ ...options.headers
389
+ }
390
+ });
391
+ /**
392
+ * Unlink Item
393
+ */
394
+ export const unlinkItem = (options) => (options.client ?? client).delete({ url: '/api/notes/{note_id}/items/{item_id}', ...options });
395
+ /**
396
+ * Link Item
397
+ *
398
+ * Say the note is about the paper (at a page); changes the page if it
399
+ * is linked already.
400
+ */
401
+ export const linkItem = (options) => (options.client ?? client).put({
402
+ url: '/api/notes/{note_id}/items/{item_id}',
403
+ ...options,
404
+ headers: {
405
+ 'Content-Type': 'application/json',
406
+ ...options.headers
407
+ }
408
+ });
409
+ /**
410
+ * Set Note Owner
411
+ *
412
+ * Give the note to another owner the person may add to. Collections of a
413
+ * group that no longer owns it let it go.
414
+ */
415
+ export const setNoteOwner = (options) => (options.client ?? client).put({
416
+ url: '/api/notes/{note_id}/owner',
417
+ ...options,
418
+ headers: {
419
+ 'Content-Type': 'application/json',
420
+ ...options.headers
421
+ }
422
+ });
423
+ /**
424
+ * Restore Note
425
+ */
426
+ export const restoreNote = (options) => (options.client ?? client).post({ url: '/api/notes/{note_id}/restore', ...options });
427
+ /**
428
+ * Note History
429
+ *
430
+ * Earlier texts of the note, newest first.
431
+ */
432
+ export const noteHistory = (options) => (options.client ?? client).get({ url: '/api/notes/{note_id}/history', ...options });
433
+ /**
434
+ * Note Markdown
435
+ *
436
+ * The note as a Markdown file.
437
+ */
438
+ export const noteMarkdown = (options) => (options.client ?? client).get({ url: '/api/notes/{note_id}/markdown', ...options });
439
+ /**
440
+ * Add Notes
441
+ *
442
+ * Put notes into a collection; those it may not hold (a group's
443
+ * collection holds only the group's notes) or unknown ones are skipped.
444
+ */
445
+ export const addNotes = (options) => (options.client ?? client).post({
446
+ url: '/api/collections/{collection_id}/notes',
447
+ ...options,
448
+ headers: {
449
+ 'Content-Type': 'application/json',
450
+ ...options.headers
451
+ }
452
+ });
453
+ /**
454
+ * Remove Note
455
+ */
456
+ export const removeNote = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}/notes/{note_id}', ...options });
457
+ /**
458
+ * List Imports
459
+ *
460
+ * The person's imports, newest first.
461
+ */
462
+ export const listImports = (options) => (options?.client ?? client).get({ url: '/api/imports', ...options });
463
+ /**
464
+ * Start Import
465
+ *
466
+ * Import an export: BibTeX, RIS or CSL-JSON, alone or zipped with its
467
+ * files. Everything new belongs to ``library_id`` (default: the person's
468
+ * default owner). Runs in the background; poll ``GET /api/imports/{id}``.
469
+ */
470
+ export const startImport = (options) => (options.client ?? client).post({
471
+ ...formDataBodySerializer,
472
+ url: '/api/imports',
473
+ ...options,
474
+ headers: {
475
+ 'Content-Type': null,
476
+ ...options.headers
477
+ }
478
+ });
479
+ /**
480
+ * Get Import
481
+ */
482
+ export const getImport = (options) => (options.client ?? client).get({ url: '/api/imports/{import_id}', ...options });
483
+ /**
484
+ * List Duplicates Everywhere
485
+ *
486
+ * Pairs of papers that look like the same paper (same identifier or
487
+ * file first, then the same title), with a recommendation which to keep;
488
+ * pairs marked as different are left out.
489
+ */
490
+ export const listDuplicatesEverywhere = (options) => (options?.client ?? client).get({ url: '/api/duplicates', ...options });
491
+ /**
492
+ * Mark Different
493
+ *
494
+ * The two are different papers: do not suggest them again (for everyone
495
+ * who sees both). Needs the right to change at least one of them.
496
+ */
497
+ export const markDifferent = (options) => (options.client ?? client).post({
498
+ url: '/api/duplicates/different',
499
+ ...options,
500
+ headers: {
501
+ 'Content-Type': 'application/json',
502
+ ...options.headers
503
+ }
504
+ });
505
+ /**
506
+ * Empty Trash
507
+ *
508
+ * Delete for good everything in the trash the person may change: their
509
+ * own and that of groups where they are a member or admin.
510
+ */
511
+ export const emptyTrash = (options) => (options?.client ?? client).delete({ url: '/api/trash', ...options });
512
+ /**
513
+ * Storage
514
+ *
515
+ * How full the storage is (for the bar at the bottom of the menu).
516
+ */
517
+ export const storage = (options) => (options?.client ?? client).get({ url: '/api/storage', ...options });
518
+ /**
519
+ * Get Config
520
+ */
521
+ export const getConfig = (options) => (options?.client ?? client).get({ url: '/api/admin/config', ...options });
522
+ /**
523
+ * Set Config
524
+ *
525
+ * Save settings. A new embedding model must be one the ML service
526
+ * offers; the library is then re-embedded in the background, while keyword
527
+ * search keeps working and search by meaning covers more and more.
528
+ */
529
+ export const setConfig = (options) => (options.client ?? client).put({
530
+ url: '/api/admin/config',
531
+ ...options,
532
+ headers: {
533
+ 'Content-Type': 'application/json',
534
+ ...options.headers
535
+ }
536
+ });
537
+ /**
538
+ * Ml Status
539
+ */
540
+ export const mlStatus = (options) => (options?.client ?? client).get({ url: '/api/admin/ml', ...options });
541
+ /**
542
+ * Measure Ml Speed
543
+ *
544
+ * Time a model on this installation's ML service with sample passages.
545
+ * A model not downloaded yet starts downloading: the answer then says
546
+ * ``loading``; ask again in a while.
547
+ */
548
+ export const measureMlSpeed = (options) => (options.client ?? client).post({ url: '/api/admin/ml/models/{name}/speed', ...options });
549
+ /**
550
+ * Delete Ml Model
551
+ *
552
+ * Remove a downloaded model from the ML service (not the one in use).
553
+ */
554
+ export const deleteMlModel = (options) => (options.client ?? client).delete({ url: '/api/admin/ml/models/{name}', ...options });
555
+ /**
556
+ * Stats
557
+ */
558
+ export const stats = (options) => (options?.client ?? client).get({ url: '/api/admin/stats', ...options });
559
+ /**
560
+ * Run Job
561
+ *
562
+ * Start a sweep now: ``embeddings`` (embed what is missing), ``text``
563
+ * (read files still pending), ``text-all`` (read every file again),
564
+ * ``trash`` (delete what is older than the trash days), ``integrity``
565
+ * (check stored contents), ``integrity-deep`` (also their SHA-256) or
566
+ * ``integrity-clean`` (check and remove unused stored contents), ``copy``
567
+ * (update the readable copy), ``copy-remove`` (delete it) or ``tidy``
568
+ * (retry stalled jobs, delete old jobs and expired logins).
569
+ */
570
+ export const runJob = (options) => (options.client ?? client).post({ url: '/api/admin/jobs/{job}', ...options });
571
+ /**
572
+ * Integrity Report
573
+ *
574
+ * The last integrity check's report (None before the first).
575
+ */
576
+ export const integrityReport = (options) => (options?.client ?? client).get({ url: '/api/admin/integrity', ...options });
577
+ /**
578
+ * Authentication
579
+ *
580
+ * What the Authentication settings show besides the settings.
581
+ */
582
+ export const authentication = (options) => (options?.client ?? client).get({ url: '/api/admin/authentication', ...options });
583
+ /**
584
+ * Set Oidc Secret
585
+ *
586
+ * The OIDC login's client secret; never sent back.
587
+ */
588
+ export const setOidcSecret = (options) => (options.client ?? client).put({
589
+ url: '/api/admin/authentication/secret',
590
+ ...options,
591
+ headers: {
592
+ 'Content-Type': 'application/json',
593
+ ...options.headers
594
+ }
595
+ });
596
+ /**
597
+ * Check Provider
598
+ *
599
+ * Whether the identity provider answers at this address.
600
+ */
601
+ export const checkProvider = (options) => (options.client ?? client).post({
602
+ url: '/api/admin/authentication/check',
603
+ ...options,
604
+ headers: {
605
+ 'Content-Type': 'application/json',
606
+ ...options.headers
607
+ }
608
+ });
609
+ /**
610
+ * End All Sessions
611
+ *
612
+ * Log everyone out on every device, except this one.
613
+ */
614
+ export const endAllSessions = (options) => (options?.client ?? client).delete({ url: '/api/admin/sessions', ...options });
615
+ /**
616
+ * Readable Copy
617
+ */
618
+ export const readableCopy = (options) => (options?.client ?? client).get({ url: '/api/admin/readable-copy', ...options });
619
+ /**
620
+ * Preview Template
621
+ */
622
+ export const previewTemplate = (options) => (options.client ?? client).post({
623
+ url: '/api/admin/readable-copy/preview',
624
+ ...options,
625
+ headers: {
626
+ 'Content-Type': 'application/json',
627
+ ...options.headers
628
+ }
629
+ });
630
+ /**
631
+ * List Tags
632
+ *
633
+ * The tags of the libraries the person can read, with how they are used
634
+ * (items in the trash do not count).
635
+ */
636
+ export const listTags = (options) => (options?.client ?? client).get({ url: '/api/tags', ...options });
637
+ /**
638
+ * Create Tag
639
+ *
640
+ * A tag not on any item yet (409 if the library has one of that name).
641
+ */
642
+ export const createTag = (options) => (options.client ?? client).post({
643
+ url: '/api/tags',
644
+ ...options,
645
+ headers: {
646
+ 'Content-Type': 'application/json',
647
+ ...options.headers
648
+ }
649
+ });
650
+ /**
651
+ * Add Tag
652
+ *
653
+ * Tag an item with its owner's, the person's or one of their groups' tag
654
+ * (see ``Access.may_tag``); the tag is created if that owner has none of
655
+ * that name (any case), which for a group needs member rights there.
656
+ */
657
+ export const addTag = (options) => (options.client ?? client).post({
658
+ url: '/api/items/{item_id}/tags',
659
+ ...options,
660
+ headers: {
661
+ 'Content-Type': 'application/json',
662
+ ...options.headers
663
+ }
664
+ });
665
+ /**
666
+ * Remove Tag
667
+ */
668
+ export const removeTag = (options) => (options.client ?? client).delete({ url: '/api/items/{item_id}/tags/{tag_id}', ...options });
669
+ /**
670
+ * Delete Tag
671
+ *
672
+ * Remove a tag from every item and delete it.
673
+ */
674
+ export const deleteTag = (options) => (options.client ?? client).delete({ url: '/api/tags/{tag_id}', ...options });
675
+ /**
676
+ * Change Tag
677
+ *
678
+ * Rename a tag everywhere (409 if another tag of its owner has that
679
+ * name), set its colour or description, or give it to another owner.
680
+ */
681
+ export const changeTag = (options) => (options.client ?? client).patch({
682
+ url: '/api/tags/{tag_id}',
683
+ ...options,
684
+ headers: {
685
+ 'Content-Type': 'application/json',
686
+ ...options.headers
687
+ }
688
+ });
689
+ /**
690
+ * List Collections
691
+ *
692
+ * The collections of the libraries the person can read, flat;
693
+ * ``parent_id`` gives the tree.
694
+ */
695
+ export const listCollections = (options) => (options?.client ?? client).get({ url: '/api/collections', ...options });
696
+ /**
697
+ * Create Collection
698
+ */
699
+ export const createCollection = (options) => (options.client ?? client).post({
700
+ url: '/api/collections',
701
+ ...options,
702
+ headers: {
703
+ 'Content-Type': 'application/json',
704
+ ...options.headers
705
+ }
706
+ });
707
+ /**
708
+ * Delete Collection
709
+ *
710
+ * Delete a collection and its subcollections; items stay in the library.
711
+ */
712
+ export const deleteCollection = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}', ...options });
713
+ /**
714
+ * Change Collection
715
+ *
716
+ * Rename, describe or move a collection (not into itself), also into
717
+ * another library the person may change.
718
+ */
719
+ export const changeCollection = (options) => (options.client ?? client).patch({
720
+ url: '/api/collections/{collection_id}',
721
+ ...options,
722
+ headers: {
723
+ 'Content-Type': 'application/json',
724
+ ...options.headers
725
+ }
726
+ });
727
+ /**
728
+ * Preview Move
729
+ *
730
+ * Before moving a collection into another library: how many of its
731
+ * papers are not in that library yet.
732
+ */
733
+ export const previewMove = (options) => (options.client ?? client).get({ url: '/api/collections/{collection_id}/move-preview', ...options });
734
+ /**
735
+ * Unpin Collection
736
+ */
737
+ export const unpinCollection = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}/pin', ...options });
738
+ /**
739
+ * Pin Collection
740
+ *
741
+ * Pin the collection to the person's sidebar (readers may too).
742
+ */
743
+ export const pinCollection = (options) => (options.client ?? client).put({ url: '/api/collections/{collection_id}/pin', ...options });
744
+ /**
745
+ * Add Items
746
+ *
747
+ * Add items; those the collection may not hold (a group's collection
748
+ * holds only that group's items) or the person cannot read are skipped.
749
+ */
750
+ export const addItems = (options) => (options.client ?? client).post({
751
+ url: '/api/collections/{collection_id}/items',
752
+ ...options,
753
+ headers: {
754
+ 'Content-Type': 'application/json',
755
+ ...options.headers
756
+ }
757
+ });
758
+ /**
759
+ * Remove Item
760
+ */
761
+ export const removeItem = (options) => (options.client ?? client).delete({ url: '/api/collections/{collection_id}/items/{item_id}', ...options });
762
+ /**
763
+ * List Libraries
764
+ *
765
+ * The libraries the person can read: their own first, then their groups'.
766
+ */
767
+ export const listLibraries = (options) => (options?.client ?? client).get({ url: '/api/libraries', ...options });
768
+ /**
769
+ * Set Default Library
770
+ *
771
+ * Where new items go unless another library is chosen.
772
+ */
773
+ export const setDefaultLibrary = (options) => (options.client ?? client).put({
774
+ url: '/api/me/default-library',
775
+ ...options,
776
+ headers: {
777
+ 'Content-Type': 'application/json',
778
+ ...options.headers
779
+ }
780
+ });
781
+ /**
782
+ * List Groups
783
+ *
784
+ * The groups the person belongs to (directly or through a group above);
785
+ * site administrators see every group. Flat; ``parent_id`` gives the tree.
786
+ */
787
+ export const listGroups = (options) => (options?.client ?? client).get({ url: '/api/groups', ...options });
788
+ /**
789
+ * Create Group
790
+ *
791
+ * A group with its library. Top-level groups: site administrators only,
792
+ * with a first admin. Subgroups: the parent's admins (who are then admins
793
+ * of the subgroup too).
794
+ */
795
+ export const createGroup = (options) => (options.client ?? client).post({
796
+ url: '/api/groups',
797
+ ...options,
798
+ headers: {
799
+ 'Content-Type': 'application/json',
800
+ ...options.headers
801
+ }
802
+ });
803
+ /**
804
+ * Delete Group
805
+ *
806
+ * Delete an empty group: no groups inside and no items or notes (not
807
+ * even in its trash). Its tags, collections and memberships go with it.
808
+ */
809
+ export const deleteGroup = (options) => (options.client ?? client).delete({ url: '/api/groups/{group_id}', ...options });
810
+ /**
811
+ * Change Group
812
+ */
813
+ export const changeGroup = (options) => (options.client ?? client).patch({
814
+ url: '/api/groups/{group_id}',
815
+ ...options,
816
+ headers: {
817
+ 'Content-Type': 'application/json',
818
+ ...options.headers
819
+ }
820
+ });
821
+ /**
822
+ * List Members
823
+ *
824
+ * Everyone in the group: given a role here or in a group above.
825
+ */
826
+ export const listMembers = (options) => (options.client ?? client).get({ url: '/api/groups/{group_id}/members', ...options });
827
+ /**
828
+ * Remove Member
829
+ *
830
+ * Remove someone's membership here (inherited ones stay).
831
+ */
832
+ export const removeMember = (options) => (options.client ?? client).delete({ url: '/api/groups/{group_id}/members/{user_id}', ...options });
833
+ /**
834
+ * Set Member
835
+ *
836
+ * Add someone to the group, or change their role here. A role lower than
837
+ * one inherited from a group above has no effect (inherited roles win).
838
+ */
839
+ export const setMember = (options) => (options.client ?? client).put({
840
+ url: '/api/groups/{group_id}/members/{user_id}',
841
+ ...options,
842
+ headers: {
843
+ 'Content-Type': 'application/json',
844
+ ...options.headers
845
+ }
846
+ });
847
+ /**
848
+ * Leave Group
849
+ *
850
+ * Leave a group one was added to. Membership through a group above can
851
+ * only be left there.
852
+ */
853
+ export const leaveGroup = (options) => (options.client ?? client).post({ url: '/api/groups/{group_id}/leave', ...options });
854
+ /**
855
+ * Find Users
856
+ *
857
+ * People to add to a group, by username; for site administrators and
858
+ * group admins.
859
+ */
860
+ export const findUsers = (options) => (options?.client ?? client).get({ url: '/api/users', ...options });
861
+ /**
862
+ * List Users
863
+ */
864
+ export const listUsers = (options) => (options?.client ?? client).get({ url: '/api/admin/users', ...options });
865
+ /**
866
+ * Create User
867
+ *
868
+ * A new account (with its private space); 409 if the name is taken.
869
+ */
870
+ export const createUser = (options) => (options.client ?? client).post({
871
+ url: '/api/admin/users',
872
+ ...options,
873
+ headers: {
874
+ 'Content-Type': 'application/json',
875
+ ...options.headers
876
+ }
877
+ });
878
+ /**
879
+ * Change User
880
+ *
881
+ * Reset a password, grant or take admin rights, (de)activate. The last
882
+ * active administrator cannot lose those rights, and nobody deactivates
883
+ * themselves.
884
+ */
885
+ export const changeUser = (options) => (options.client ?? client).patch({
886
+ url: '/api/admin/users/{user_id}',
887
+ ...options,
888
+ headers: {
889
+ 'Content-Type': 'application/json',
890
+ ...options.headers
891
+ }
892
+ });
893
+ /**
894
+ * Private Things
895
+ */
896
+ export const privateThings = (options) => (options.client ?? client).get({ url: '/api/admin/users/{user_id}/private', ...options });
897
+ /**
898
+ * Hand Over
899
+ *
900
+ * Give a deactivated person's papers, notes, tags and collections to a
901
+ * group or another person.
902
+ */
903
+ export const handOver = (options) => (options.client ?? client).post({
904
+ url: '/api/admin/users/{user_id}/hand-over',
905
+ ...options,
906
+ headers: {
907
+ 'Content-Type': 'application/json',
908
+ ...options.headers
909
+ }
910
+ });
911
+ /**
912
+ * List Backups
913
+ */
914
+ export const listBackups = (options) => (options?.client ?? client).get({ url: '/api/admin/backups', ...options });
915
+ /**
916
+ * Start Backup
917
+ *
918
+ * Queue a backup now (the worker writes it); 409 if one is running.
919
+ */
920
+ export const startBackup = (options) => (options.client ?? client).post({
921
+ url: '/api/admin/backups',
922
+ ...options,
923
+ headers: {
924
+ 'Content-Type': 'application/json',
925
+ ...options.headers
926
+ }
927
+ });
928
+ /**
929
+ * Set Backup Config
930
+ */
931
+ export const setBackupConfig = (options) => (options.client ?? client).put({
932
+ url: '/api/admin/backups/config',
933
+ ...options,
934
+ headers: {
935
+ 'Content-Type': 'application/json',
936
+ ...options.headers
937
+ }
938
+ });
939
+ /**
940
+ * Delete Backup
941
+ */
942
+ export const deleteBackup = (options) => (options.client ?? client).delete({ url: '/api/admin/backups/{name}', ...options });
943
+ /**
944
+ * Check Restore
945
+ */
946
+ export const checkRestore = (options) => (options.client ?? client).get({ url: '/api/setup/restore-check', ...options });
947
+ /**
948
+ * Setup State
949
+ */
950
+ export const setupState = (options) => (options?.client ?? client).get({ url: '/api/setup', ...options });
951
+ /**
952
+ * Create First Admin
953
+ *
954
+ * The first administrator, logged in right away.
955
+ */
956
+ export const createFirstAdmin = (options) => (options.client ?? client).post({
957
+ url: '/api/setup/admin',
958
+ ...options,
959
+ headers: {
960
+ 'Content-Type': 'application/json',
961
+ ...options.headers
962
+ }
963
+ });
964
+ /**
965
+ * Restore On First Start
966
+ *
967
+ * Restore a backup from the backup folder into the empty database; then
968
+ * people log in with their accounts from the backup.
969
+ */
970
+ export const restoreOnFirstStart = (options) => (options.client ?? client).post({
971
+ url: '/api/setup/restore',
972
+ ...options,
973
+ headers: {
974
+ 'Content-Type': 'application/json',
975
+ ...options.headers
976
+ }
977
+ });
978
+ /**
979
+ * List Tokens
980
+ */
981
+ export const listTokens = (options) => (options?.client ?? client).get({ url: '/api/me/tokens', ...options });
982
+ /**
983
+ * Create Token
984
+ *
985
+ * A token acting as you, narrowed to its scopes (and owners).
986
+ */
987
+ export const createToken = (options) => (options.client ?? client).post({
988
+ url: '/api/me/tokens',
989
+ ...options,
990
+ headers: {
991
+ 'Content-Type': 'application/json',
992
+ ...options.headers
993
+ }
994
+ });
995
+ /**
996
+ * Revoke Token
997
+ */
998
+ export const revokeToken = (options) => (options.client ?? client).delete({ url: '/api/me/tokens/{token_id}', ...options });