initiative-plugin-sdk 8.0.0 → 9.0.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.
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Generated by scripts/generate-plugin-api.mjs from schemas/plugin-api.json, the plug-in API
3
- * taken from Initiative 0.75.3 (commit c086f914f). Do not edit: regenerate.
3
+ * taken from Initiative 0.77.1 (commit 1a62d88cd). Do not edit: regenerate.
4
4
  */
5
5
  /**
6
6
  * Each operation a plug-in may call: its method, its path after `/api/v1/c/0`, the
7
7
  * scope it needs, and the query parameters it takes as JSON.
8
8
  */
9
9
  export const pluginApiOperations = {
10
- create_subscription: { method: "POST", path: "/webhooks/subscriptions", scope: { per: "event_type", any_of: ["calendars:read", "comments:read", "counter_groups:read", "dashboards:read", "files:read", "galleries:read", "initiatives:read", "posts:read", "projects:read", "queues:read", "tags:read", "wikis:read"] } },
11
- delete_subscription: { method: "DELETE", path: "/webhooks/subscriptions/{subscription_id}", scope: { per: "event_type", any_of: ["calendars:read", "comments:read", "counter_groups:read", "dashboards:read", "files:read", "galleries:read", "initiatives:read", "posts:read", "projects:read", "queues:read", "tags:read", "wikis:read"] } },
10
+ create_subscription: { method: "POST", path: "/webhooks/subscriptions", scope: { per: "event_type", any_of: ["calendars:read", "comments:read", "counter_groups:read", "dashboards:read", "files:read", "initiatives:read", "posts:read", "projects:read", "queues:read", "tags:read", "wikis:read"] } },
11
+ delete_subscription: { method: "DELETE", path: "/webhooks/subscriptions/{subscription_id}", scope: { per: "event_type", any_of: ["calendars:read", "comments:read", "counter_groups:read", "dashboards:read", "files:read", "initiatives:read", "posts:read", "projects:read", "queues:read", "tags:read", "wikis:read"] } },
12
12
  list_projects: { method: "GET", path: "/projects/", scope: "projects:read" },
13
13
  create_project: { method: "POST", path: "/projects/", scope: "projects:write" },
14
14
  list_files: { method: "GET", path: "/files/", scope: "files:read" },
@@ -21,16 +21,21 @@ export const pluginApiOperations = {
21
21
  create_calendar: { method: "POST", path: "/calendars/", scope: "calendars:write" },
22
22
  list_posts: { method: "GET", path: "/posts/", scope: "posts:read" },
23
23
  create_post: { method: "POST", path: "/posts/", scope: "posts:write" },
24
- list_galleries: { method: "GET", path: "/galleries/", scope: "galleries:read" },
25
- create_gallery: { method: "POST", path: "/galleries/", scope: "galleries:write" },
26
24
  list_wikis: { method: "GET", path: "/wikis/", scope: "wikis:read" },
27
25
  create_wiki: { method: "POST", path: "/wikis/", scope: "wikis:write" },
26
+ list_collection_files: { method: "GET", path: "/collections/{collection_id}/files", scope: "files:read" },
27
+ add_collection_files: { method: "POST", path: "/collections/{collection_id}/files", scope: "files:write" },
28
+ remove_collection_files: { method: "DELETE", path: "/collections/{collection_id}/files", scope: "files:write" },
29
+ get_collection_files_timeline: { method: "GET", path: "/collections/{collection_id}/files/timeline", scope: "files:read" },
28
30
  read_project: { method: "GET", path: "/projects/{project_id}", scope: "projects:read" },
29
31
  update_project: { method: "PATCH", path: "/projects/{project_id}", scope: "projects:write" },
30
32
  list_task_statuses: { method: "GET", path: "/projects/{project_id}/task-statuses/", scope: "projects:read" },
31
33
  list_initiative_task_statuses: { method: "GET", path: "/initiatives/{initiative_id}/task-statuses/", scope: "projects:read" },
34
+ list_task_types: { method: "GET", path: "/projects/{project_id}/task-types/", scope: "projects:read" },
35
+ list_task_type_gallery: { method: "GET", path: "/projects/{project_id}/task-types/gallery", scope: "projects:read" },
32
36
  list_tasks: { method: "GET", path: "/tasks/", scope: "projects:read", json: ["conditions", "sorting"] },
33
37
  create_task: { method: "POST", path: "/tasks/", scope: "projects:write" },
38
+ list_task_groups: { method: "GET", path: "/tasks/groups", scope: "projects:read", json: ["conditions"] },
34
39
  list_column_limits: { method: "GET", path: "/tasks/column-limits", scope: "projects:read" },
35
40
  read_task: { method: "GET", path: "/tasks/{task_id}", scope: "projects:read" },
36
41
  update_task: { method: "PATCH", path: "/tasks/{task_id}", scope: "projects:write" },
@@ -38,13 +43,24 @@ export const pluginApiOperations = {
38
43
  duplicate_task: { method: "POST", path: "/tasks/{task_id}/duplicate", scope: "projects:write" },
39
44
  skip_task: { method: "POST", path: "/tasks/{task_id}/skip", scope: "projects:write" },
40
45
  toggle_checklist_item: { method: "PATCH", path: "/tasks/{task_id}/checklist/{item_id}", scope: "projects:write" },
46
+ promote_checklist_item: { method: "POST", path: "/tasks/{task_id}/checklist/{item_id}/promote", scope: "projects:write" },
41
47
  list_comments: { method: "GET", path: "/comments/", scope: "comments:read" },
42
48
  create_comment: { method: "POST", path: "/comments/", scope: "comments:write" },
43
49
  read_comment: { method: "GET", path: "/comments/{comment_id}", scope: "comments:read" },
44
50
  list_initiatives: { method: "GET", path: "/initiatives/", scope: "initiatives:read" },
45
51
  get_initiative: { method: "GET", path: "/initiatives/{initiative_id}", scope: "initiatives:read" },
52
+ upload_file: { method: "POST", path: "/files/upload", scope: "files:write" },
53
+ upload_file_version: { method: "POST", path: "/files/{file_id}/versions", scope: "files:write" },
46
54
  read_file: { method: "GET", path: "/files/{file_id}", scope: "files:read" },
47
55
  update_file: { method: "PATCH", path: "/files/{file_id}", scope: "files:write" },
56
+ list_collection_shapes: { method: "GET", path: "/collections/shapes", scope: "files:read" },
57
+ list_collections: { method: "GET", path: "/collections/", scope: "files:read" },
58
+ create_collection: { method: "POST", path: "/collections/", scope: "files:write" },
59
+ read_collection: { method: "GET", path: "/collections/{collection_id}", scope: "files:read" },
60
+ delete_collection: { method: "DELETE", path: "/collections/{collection_id}", scope: "files:write" },
61
+ update_collection: { method: "PATCH", path: "/collections/{collection_id}", scope: "files:write" },
62
+ get_collection_file_fields: { method: "GET", path: "/collections/{collection_id}/files/{file_id}/fields", scope: "files:read" },
63
+ set_collection_file_fields: { method: "PUT", path: "/collections/{collection_id}/files/{file_id}/fields", scope: "files:write" },
48
64
  read_queue: { method: "GET", path: "/queues/{queue_id}", scope: "queues:read" },
49
65
  update_queue: { method: "PATCH", path: "/queues/{queue_id}", scope: "queues:write" },
50
66
  add_queue_item: { method: "POST", path: "/queues/{queue_id}/items", scope: "queues:write" },
@@ -75,16 +91,6 @@ export const pluginApiOperations = {
75
91
  read_post: { method: "GET", path: "/posts/{post_id}", scope: "posts:read" },
76
92
  update_post: { method: "PATCH", path: "/posts/{post_id}", scope: "posts:write" },
77
93
  set_post_pin: { method: "PUT", path: "/posts/{post_id}/pin", scope: "posts:write" },
78
- read_gallery: { method: "GET", path: "/galleries/{gallery_id}", scope: "galleries:read" },
79
- update_gallery: { method: "PATCH", path: "/galleries/{gallery_id}", scope: "galleries:write" },
80
- list_gallery_images: { method: "GET", path: "/galleries/{gallery_id}/images", scope: "galleries:read" },
81
- upload_gallery_image: { method: "POST", path: "/galleries/{gallery_id}/images", scope: "galleries:write" },
82
- get_gallery_image_timeline: { method: "GET", path: "/galleries/{gallery_id}/images/timeline", scope: "galleries:read" },
83
- read_gallery_image: { method: "GET", path: "/galleries/{gallery_id}/images/{image_id}", scope: "galleries:read" },
84
- update_gallery_image: { method: "PATCH", path: "/galleries/{gallery_id}/images/{image_id}", scope: "galleries:write" },
85
- list_gallery_image_versions: { method: "GET", path: "/galleries/{gallery_id}/images/{image_id}/versions", scope: "galleries:read" },
86
- upload_gallery_image_version: { method: "POST", path: "/galleries/{gallery_id}/images/{image_id}/versions", scope: "galleries:write" },
87
- delete_gallery_image_version: { method: "DELETE", path: "/galleries/{gallery_id}/images/{image_id}/versions/{version_id}", scope: "galleries:write" },
88
94
  read_wiki: { method: "GET", path: "/wikis/{wiki_id}", scope: "wikis:read" },
89
95
  update_wiki: { method: "PATCH", path: "/wikis/{wiki_id}", scope: "wikis:write" },
90
96
  list_wiki_pages: { method: "GET", path: "/wikis/{wiki_id}/pages", scope: "wikis:read" },
@@ -110,7 +116,6 @@ export const pluginApiOperations = {
110
116
  set_counter_group_grants: { method: "PUT", path: "/counter-groups/{group_id}/grants", scope: "sharing:write" },
111
117
  set_calendar_grants: { method: "PUT", path: "/calendars/{calendar_id}/grants", scope: "sharing:write" },
112
118
  set_post_grants: { method: "PUT", path: "/posts/{post_id}/grants", scope: "sharing:write" },
113
- set_gallery_grants: { method: "PUT", path: "/galleries/{gallery_id}/grants", scope: "sharing:write" },
114
119
  set_wiki_grants: { method: "PUT", path: "/wikis/{wiki_id}/grants", scope: "sharing:write" },
115
120
  duplicate_project: { method: "POST", path: "/projects/{project_id}/duplicate", scope: "projects:write" },
116
121
  duplicate_file: { method: "POST", path: "/files/{file_id}/duplicate", scope: "files:write" },
@@ -118,15 +123,14 @@ export const pluginApiOperations = {
118
123
  duplicate_counter_group: { method: "POST", path: "/counter-groups/{group_id}/duplicate", scope: "counter_groups:write" },
119
124
  duplicate_calendar: { method: "POST", path: "/calendars/{calendar_id}/duplicate", scope: "calendars:write" },
120
125
  duplicate_post: { method: "POST", path: "/posts/{post_id}/duplicate", scope: "posts:write" },
121
- duplicate_gallery: { method: "POST", path: "/galleries/{gallery_id}/duplicate", scope: "galleries:write" },
122
126
  duplicate_wiki: { method: "POST", path: "/wikis/{wiki_id}/duplicate", scope: "wikis:write" },
123
- suggest_community: { method: "GET", path: "/search/suggest", scope: { per: "entity_type", any_of: ["calendars:read", "comments:read", "counter_groups:read", "dashboards:read", "files:read", "galleries:read", "posts:read", "projects:read", "queues:read", "tags:read", "wikis:read"] } },
124
- list_property_definitions: { method: "GET", path: "/property-definitions/", scope: { per: "tool", any_of: ["calendars:read", "counter_groups:read", "dashboards:read", "files:read", "galleries:read", "posts:read", "projects:read", "properties:read", "queues:read", "wikis:read"] } },
125
- create_property_definition: { method: "POST", path: "/property-definitions/", scope: "properties:write" },
126
- delete_property_definition: { method: "DELETE", path: "/property-definitions/{definition_id}", scope: "properties:write" },
127
- update_property_definition: { method: "PATCH", path: "/property-definitions/{definition_id}", scope: "properties:write" },
128
- set_properties: { method: "PUT", path: "/properties/{target}/{entity_id}", scope: { by: "target", scopes: { calendar: "calendars:write", calendar_event: "calendars:write", counter: "counter_groups:write", counter_group: "counter_groups:write", dashboard: "dashboards:write", file: "files:write", gallery: "galleries:write", gallery_image: "galleries:write", post: "posts:write", project: "projects:write", queue: "queues:write", queue_item: "queues:write", task: "projects:write", wiki: "wikis:write", wiki_page: "wikis:write" } } },
129
- archive_entity: { method: "POST", path: "/archive/{entity_type}/{entity_id}", scope: { by: "entity_type", scopes: { calendar: "calendars:write", counter_group: "counter_groups:write", dashboard: "dashboards:write", file: "files:write", gallery: "galleries:write", post: "posts:write", project: "projects:write", queue: "queues:write", task: "projects:write", wiki: "wikis:write" } } },
127
+ suggest_community: { method: "GET", path: "/search/suggest", scope: { per: "entity_type", any_of: ["calendars:read", "comments:read", "counter_groups:read", "dashboards:read", "files:read", "posts:read", "projects:read", "queues:read", "tags:read", "wikis:read"] } },
128
+ list_property_definitions: { method: "GET", path: "/property-definitions/", scope: { per: "tool", any_of: ["calendars:read", "counter_groups:read", "dashboards:read", "files:read", "posts:read", "projects:read", "properties:read", "queues:read", "wikis:read"] } },
129
+ create_property_definition: { method: "POST", path: "/property-definitions/", scope: { per: "property_scope", any_of: ["files:write", "properties:write"] } },
130
+ delete_property_definition: { method: "DELETE", path: "/property-definitions/{definition_id}", scope: { per: "property_scope", any_of: ["files:write", "properties:write"] } },
131
+ update_property_definition: { method: "PATCH", path: "/property-definitions/{definition_id}", scope: { per: "property_scope", any_of: ["files:write", "properties:write"] } },
132
+ set_properties: { method: "PUT", path: "/properties/{target}/{entity_id}", scope: { by: "target", scopes: { calendar: "calendars:write", calendar_event: "calendars:write", collection: "files:write", counter: "counter_groups:write", counter_group: "counter_groups:write", dashboard: "dashboards:write", file: "files:write", post: "posts:write", project: "projects:write", queue: "queues:write", queue_item: "queues:write", task: "projects:write", wiki: "wikis:write", wiki_page: "wikis:write" } } },
133
+ archive_entity: { method: "POST", path: "/archive/{entity_type}/{entity_id}", scope: { by: "entity_type", scopes: { calendar: "calendars:write", collection: "files:write", counter_group: "counter_groups:write", dashboard: "dashboards:write", file: "files:write", post: "posts:write", project: "projects:write", queue: "queues:write", task: "projects:write", wiki: "wikis:write" } } },
130
134
  search_users: { method: "GET", path: "/users/search", scope: "members:read" },
131
135
  read_member_avatar: { method: "GET", path: "/members/{person}/avatar/{digest}", scope: "members:read" },
132
136
  };
@@ -139,7 +143,7 @@ export class PluginApi {
139
143
  /**
140
144
  * Register a new webhook subscription.
141
145
  *
142
- * `POST /webhooks/subscriptions`, needs one of `calendars:read`, `comments:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `galleries:read`, `initiatives:read`, `posts:read`, `projects:read`, `queues:read`, `tags:read`, `wikis:read`.
146
+ * `POST /webhooks/subscriptions`, needs one of `calendars:read`, `comments:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `initiatives:read`, `posts:read`, `projects:read`, `queues:read`, `tags:read`, `wikis:read`.
143
147
  */
144
148
  createSubscription(args) {
145
149
  return this.call("create_subscription", args);
@@ -150,7 +154,7 @@ export class PluginApi {
150
154
  * installed plug-in reaches only the subscriptions it registered, and any
151
155
  * other is a 404.
152
156
  *
153
- * `DELETE /webhooks/subscriptions/{subscription_id}`, needs one of `calendars:read`, `comments:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `galleries:read`, `initiatives:read`, `posts:read`, `projects:read`, `queues:read`, `tags:read`, `wikis:read`.
157
+ * `DELETE /webhooks/subscriptions/{subscription_id}`, needs one of `calendars:read`, `comments:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `initiatives:read`, `posts:read`, `projects:read`, `queues:read`, `tags:read`, `wikis:read`.
154
158
  */
155
159
  deleteSubscription(args) {
156
160
  return this.call("delete_subscription", args);
@@ -252,23 +256,6 @@ export class PluginApi {
252
256
  createPost(args) {
253
257
  return this.call("create_post", args);
254
258
  }
255
- /**
256
- * List galleries visible to the current user (guild admins see all).
257
- *
258
- * `GET /galleries/`, needs `galleries:read`.
259
- */
260
- listGalleries(args) {
261
- return this.call("list_galleries", args);
262
- }
263
- /**
264
- * Create a gallery. Requires create_galleries permission on the initiative
265
- * (or guild admin); the creator gets the owner grant.
266
- *
267
- * `POST /galleries/`, needs `galleries:write`.
268
- */
269
- createGallery(args) {
270
- return this.call("create_gallery", args);
271
- }
272
259
  /**
273
260
  * List wikis visible to the current user (guild admins see all).
274
261
  *
@@ -286,6 +273,45 @@ export class PluginApi {
286
273
  createWiki(args) {
287
274
  return this.call("create_wiki", args);
288
275
  }
276
+ /**
277
+ * The files in one collection the reader can open: the Files list, with its
278
+ * parameters, narrowed to the collection, each with when it was added to it.
279
+ * A collection out of reach is a 404.
280
+ *
281
+ * `GET /collections/{collection_id}/files`, needs `files:read`.
282
+ */
283
+ listCollectionFiles(args) {
284
+ return this.call("list_collection_files", args);
285
+ }
286
+ /**
287
+ * Put files in a collection: each a file of its initiative the reader can
288
+ * open. One already in it stays as it is.
289
+ *
290
+ * `POST /collections/{collection_id}/files`, needs `files:write`.
291
+ */
292
+ addCollectionFiles(args) {
293
+ return this.call("add_collection_files", args);
294
+ }
295
+ /**
296
+ * Take files out of a collection. The files stay where they are. A collection
297
+ * left with no file goes to the trash.
298
+ *
299
+ * `DELETE /collections/{collection_id}/files`, needs `files:write`.
300
+ */
301
+ removeCollectionFiles(args) {
302
+ return this.call("remove_collection_files", args);
303
+ }
304
+ /**
305
+ * The months files were added to this collection in, newest first, each with
306
+ * how many of them the reader can open and the instants to jump to: what the
307
+ * timeline rail is drawn from. Takes the same filters the list does, so the
308
+ * rail is a picture of the list as it stands.
309
+ *
310
+ * `GET /collections/{collection_id}/files/timeline`, needs `files:read`.
311
+ */
312
+ getCollectionFilesTimeline(args) {
313
+ return this.call("get_collection_files_timeline", args);
314
+ }
289
315
  /**
290
316
  * Read Project
291
317
  *
@@ -318,6 +344,23 @@ export class PluginApi {
318
344
  listInitiativeTaskStatuses(args) {
319
345
  return this.call("list_initiative_task_statuses", args);
320
346
  }
347
+ /**
348
+ * List Task Types
349
+ *
350
+ * `GET /projects/{project_id}/task-types/`, needs `projects:read`.
351
+ */
352
+ listTaskTypes(args) {
353
+ return this.call("list_task_types", args);
354
+ }
355
+ /**
356
+ * The ready-made types the project can add, grouped by what they are for, in
357
+ * the reader's language.
358
+ *
359
+ * `GET /projects/{project_id}/task-types/gallery`, needs `projects:read`.
360
+ */
361
+ listTaskTypeGallery(args) {
362
+ return this.call("list_task_type_gallery", args);
363
+ }
321
364
  /**
322
365
  * List Tasks
323
366
  *
@@ -334,6 +377,15 @@ export class PluginApi {
334
377
  createTask(args) {
335
378
  return this.call("create_task", args);
336
379
  }
380
+ /**
381
+ * The groups of the task list these filters answer with, in the order the
382
+ * list shows them, and the groups each task is in.
383
+ *
384
+ * `GET /tasks/groups`, needs `projects:read`.
385
+ */
386
+ listTaskGroups(args) {
387
+ return this.call("list_task_groups", args);
388
+ }
337
389
  /**
338
390
  * Each limited board column of the named projects the reader can open: its
339
391
  * limit, and how many open tasks it holds. A project with no limits, or one
@@ -394,6 +446,14 @@ export class PluginApi {
394
446
  toggleChecklistItem(args) {
395
447
  return this.call("toggle_checklist_item", args);
396
448
  }
449
+ /**
450
+ * Make one checklist item a task of its own, part of this one.
451
+ *
452
+ * `POST /tasks/{task_id}/checklist/{item_id}/promote`, needs `projects:write`.
453
+ */
454
+ promoteChecklistItem(args) {
455
+ return this.call("promote_checklist_item", args);
456
+ }
397
457
  /**
398
458
  * One page of a thread: `limit` conversations, newest first, each with every
399
459
  * reply under it. Follow `next_cursor` for older conversations.
@@ -436,6 +496,24 @@ export class PluginApi {
436
496
  getInitiative(args) {
437
497
  return this.call("get_initiative", args);
438
498
  }
499
+ /**
500
+ * Upload a file: sent with the request as `file`, or sent in pieces before it
501
+ * as a resumable upload, named by `upload_id`.
502
+ *
503
+ * `POST /files/upload`, needs `files:write`.
504
+ */
505
+ uploadFile(args) {
506
+ return this.call("upload_file", args);
507
+ }
508
+ /**
509
+ * Upload a new version of an uploaded file, sent as `file` or as a resumable
510
+ * upload named by `upload_id`. Requires write access.
511
+ *
512
+ * `POST /files/{file_id}/versions`, needs `files:write`.
513
+ */
514
+ uploadFileVersion(args) {
515
+ return this.call("upload_file_version", args);
516
+ }
439
517
  /**
440
518
  * Read File
441
519
  *
@@ -452,6 +530,83 @@ export class PluginApi {
452
530
  updateFile(args) {
453
531
  return this.call("update_file", args);
454
532
  }
533
+ /**
534
+ * The ready-made shapes a new collection can start as, grouped, in the
535
+ * reader's language: the lists each shows and opens on, and its fields.
536
+ *
537
+ * `GET /collections/shapes`, needs `files:read`.
538
+ */
539
+ listCollectionShapes() {
540
+ return this.call("list_collection_shapes");
541
+ }
542
+ /**
543
+ * The initiative's collections the reader can see — those holding a file they
544
+ * can open — most recently changed first, each with how many of its files
545
+ * they can see and a cover they can open.
546
+ *
547
+ * `GET /collections/`, needs `files:read`.
548
+ */
549
+ listCollections(args) {
550
+ return this.call("list_collections", args);
551
+ }
552
+ /**
553
+ * Make a collection of files. It starts with the files named, each one a file
554
+ * of the initiative the reader can open. Takes the initiative role's right to
555
+ * create files. It starts blank, as a ready-made `shape` with its words in
556
+ * the maker's language, or with the fields and lists of `shape_from`, a
557
+ * collection of the same initiative the maker sees.
558
+ *
559
+ * `POST /collections/`, needs `files:write`.
560
+ */
561
+ createCollection(args) {
562
+ return this.call("create_collection", args);
563
+ }
564
+ /**
565
+ * Read Collection
566
+ *
567
+ * `GET /collections/{collection_id}`, needs `files:read`.
568
+ */
569
+ readCollection(args) {
570
+ return this.call("read_collection", args);
571
+ }
572
+ /**
573
+ * Send a collection to the trash. Its files stay where they are.
574
+ *
575
+ * `DELETE /collections/{collection_id}`, needs `files:write`.
576
+ */
577
+ deleteCollection(args) {
578
+ return this.call("delete_collection", args);
579
+ }
580
+ /**
581
+ * Rename, describe, tag, set the cover of, or switch the comments of a
582
+ * collection.
583
+ *
584
+ * `PATCH /collections/{collection_id}`, needs `files:write`.
585
+ */
586
+ updateCollection(args) {
587
+ return this.call("update_collection", args);
588
+ }
589
+ /**
590
+ * One file's values of the collection's own fields, for a file in the
591
+ * collection the reader can open.
592
+ *
593
+ * `GET /collections/{collection_id}/files/{file_id}/fields`, needs `files:read`.
594
+ */
595
+ getCollectionFileFields(args) {
596
+ return this.call("get_collection_file_fields", args);
597
+ }
598
+ /**
599
+ * Replace one file's values of the collection's own fields, or with `merge`
600
+ * write only the ones named, as `PUT /properties` does for a property. The
601
+ * file is one in the collection the reader can open, and the values are the
602
+ * collection's: they take the right to change the collection, not to edit the
603
+ * file. An empty list clears them all.
604
+ *
605
+ * `PUT /collections/{collection_id}/files/{file_id}/fields`, needs `files:write`.
606
+ */
607
+ setCollectionFileFields(args) {
608
+ return this.call("set_collection_file_fields", args);
609
+ }
455
610
  /**
456
611
  * Read Queue
457
612
  *
@@ -698,92 +853,6 @@ export class PluginApi {
698
853
  setPostPin(args) {
699
854
  return this.call("set_post_pin", args);
700
855
  }
701
- /**
702
- * Read Gallery
703
- *
704
- * `GET /galleries/{gallery_id}`, needs `galleries:read`.
705
- */
706
- readGallery(args) {
707
- return this.call("read_gallery", args);
708
- }
709
- /**
710
- * Rename, describe, or choose the cover. Requires write access.
711
- *
712
- * `PATCH /galleries/{gallery_id}`, needs `galleries:write`.
713
- */
714
- updateGallery(args) {
715
- return this.call("update_gallery", args);
716
- }
717
- /**
718
- * One page of a gallery's pictures, newest first.
719
- *
720
- * `GET /galleries/{gallery_id}/images`, needs `galleries:read`.
721
- */
722
- listGalleryImages(args) {
723
- return this.call("list_gallery_images", args);
724
- }
725
- /**
726
- * Add one picture to a gallery. Requires write access.
727
- *
728
- * `POST /galleries/{gallery_id}/images`, needs `galleries:write`.
729
- */
730
- uploadGalleryImage(args) {
731
- return this.call("upload_gallery_image", args);
732
- }
733
- /**
734
- * The months this gallery has pictures in, newest first — what the timeline
735
- * rail is drawn from. Takes the same filters the list does, so the rail is a
736
- * picture of the list as it currently stands.
737
- *
738
- * `GET /galleries/{gallery_id}/images/timeline`, needs `galleries:read`.
739
- */
740
- getGalleryImageTimeline(args) {
741
- return this.call("get_gallery_image_timeline", args);
742
- }
743
- /**
744
- * Read Gallery Image
745
- *
746
- * `GET /galleries/{gallery_id}/images/{image_id}`, needs `galleries:read`.
747
- */
748
- readGalleryImage(args) {
749
- return this.call("read_gallery_image", args);
750
- }
751
- /**
752
- * Retitle, caption, retag or set the properties of a picture. Requires write
753
- * access on the gallery.
754
- *
755
- * `PATCH /galleries/{gallery_id}/images/{image_id}`, needs `galleries:write`.
756
- */
757
- updateGalleryImage(args) {
758
- return this.call("update_gallery_image", args);
759
- }
760
- /**
761
- * Every stored rendition of a picture, newest first.
762
- *
763
- * `GET /galleries/{gallery_id}/images/{image_id}/versions`, needs `galleries:read`.
764
- */
765
- listGalleryImageVersions(args) {
766
- return this.call("list_gallery_image_versions", args);
767
- }
768
- /**
769
- * Replace a picture with a new rendition, keeping the old one as history.
770
- * Requires write access on the gallery.
771
- *
772
- * `POST /galleries/{gallery_id}/images/{image_id}/versions`, needs `galleries:write`.
773
- */
774
- uploadGalleryImageVersion(args) {
775
- return this.call("upload_gallery_image_version", args);
776
- }
777
- /**
778
- * Delete one rendition of a picture. Owner only. Deleting the current one
779
- * promotes the previous; deleting the last is refused — remove the picture
780
- * instead.
781
- *
782
- * `DELETE /galleries/{gallery_id}/images/{image_id}/versions/{version_id}`, needs `galleries:write`.
783
- */
784
- deleteGalleryImageVersion(args) {
785
- return this.call("delete_gallery_image_version", args);
786
- }
787
856
  /**
788
857
  * Read Wiki
789
858
  *
@@ -1007,16 +1076,6 @@ export class PluginApi {
1007
1076
  setPostGrants(args) {
1008
1077
  return this.call("set_post_grants", args);
1009
1078
  }
1010
- /**
1011
- * Replace the gallery's entire sharing state in one call — the body is the
1012
- * full list of grants (all-initiative-members / per-user / per-role). Every
1013
- * non-owner grant is rebuilt from it; the owner is always preserved.
1014
- *
1015
- * `PUT /galleries/{gallery_id}/grants`, needs `sharing:write`.
1016
- */
1017
- setGalleryGrants(args) {
1018
- return this.call("set_gallery_grants", args);
1019
- }
1020
1079
  /**
1021
1080
  * Replace the wiki's entire sharing state in one call — the body is the full
1022
1081
  * list of grants (all-initiative-members / per-user / per-role). Every
@@ -1099,18 +1158,6 @@ export class PluginApi {
1099
1158
  duplicatePost(args) {
1100
1159
  return this.call("duplicate_post", args);
1101
1160
  }
1102
- /**
1103
- * Copy it, with everything inside it, into an initiative: its own unless the
1104
- * body names another. Read is enough to copy a template; anything else needs
1105
- * write. The copy is shared as its source is while it stays in the same
1106
- * initiative, and carries the tags its maker may set: an installed plug-in's
1107
- * copy carries them only when it holds the scope to tag.
1108
- *
1109
- * `POST /galleries/{gallery_id}/duplicate`, needs `galleries:write`.
1110
- */
1111
- duplicateGallery(args) {
1112
- return this.call("duplicate_gallery", args);
1113
- }
1114
1161
  /**
1115
1162
  * Copy it, with everything inside it, into an initiative: its own unless the
1116
1163
  * body names another. Read is enough to copy a template; anything else needs
@@ -1126,7 +1173,7 @@ export class PluginApi {
1126
1173
  /**
1127
1174
  * Titles for the command palette — a way to reach one thing quickly.
1128
1175
  *
1129
- * `GET /search/suggest`, needs one of `calendars:read`, `comments:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `galleries:read`, `posts:read`, `projects:read`, `queues:read`, `tags:read`, `wikis:read`.
1176
+ * `GET /search/suggest`, needs one of `calendars:read`, `comments:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `posts:read`, `projects:read`, `queues:read`, `tags:read`, `wikis:read`.
1130
1177
  */
1131
1178
  suggestCommunity(args) {
1132
1179
  return this.call("suggest_community", args);
@@ -1134,23 +1181,25 @@ export class PluginApi {
1134
1181
  /**
1135
1182
  * List property definitions.
1136
1183
  *
1137
- * `GET /property-definitions/`, needs one of `calendars:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `galleries:read`, `posts:read`, `projects:read`, `properties:read`, `queues:read`, `wikis:read`.
1184
+ * `GET /property-definitions/`, needs one of `calendars:read`, `counter_groups:read`, `dashboards:read`, `files:read`, `posts:read`, `projects:read`, `properties:read`, `queues:read`, `wikis:read`.
1138
1185
  */
1139
1186
  listPropertyDefinitions(args) {
1140
1187
  return this.call("list_property_definitions", args);
1141
1188
  }
1142
1189
  /**
1143
- * Create a new property definition on an initiative.
1190
+ * Create a new property definition on an initiative, or with `collection_id`
1191
+ * a field of that collection's own.
1144
1192
  *
1145
- * `POST /property-definitions/`, needs `properties:write`.
1193
+ * `POST /property-definitions/`, needs one of `files:write`, `properties:write`.
1146
1194
  */
1147
1195
  createPropertyDefinition(args) {
1148
1196
  return this.call("create_property_definition", args);
1149
1197
  }
1150
1198
  /**
1151
- * Delete a property definition. Cascades to remove all attached values.
1199
+ * Delete a property definition. Cascades to remove all attached values. A
1200
+ * collection's field is removed by whoever may change the collection.
1152
1201
  *
1153
- * `DELETE /property-definitions/{definition_id}`, needs `properties:write`.
1202
+ * `DELETE /property-definitions/{definition_id}`, needs one of `files:write`, `properties:write`.
1154
1203
  */
1155
1204
  deletePropertyDefinition(args) {
1156
1205
  return this.call("delete_property_definition", args);
@@ -1158,7 +1207,7 @@ export class PluginApi {
1158
1207
  /**
1159
1208
  * Update a property definition.
1160
1209
  *
1161
- * `PATCH /property-definitions/{definition_id}`, needs `properties:write`.
1210
+ * `PATCH /property-definitions/{definition_id}`, needs one of `files:write`, `properties:write`.
1162
1211
  */
1163
1212
  updatePropertyDefinition(args) {
1164
1213
  return this.call("update_property_definition", args);