@gleanwork/api-client 0.13.2 → 0.13.3

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 (58) hide show
  1. package/README.md +2 -1
  2. package/dist/commonjs/__tests__/messages.test.js +1 -1
  3. package/dist/commonjs/__tests__/messages.test.js.map +1 -1
  4. package/dist/commonjs/__tests__/summarize.test.js +3 -2
  5. package/dist/commonjs/__tests__/summarize.test.js.map +1 -1
  6. package/dist/commonjs/lib/config.d.ts +3 -3
  7. package/dist/commonjs/lib/config.js +3 -3
  8. package/dist/commonjs/models/components/chatmessagefragment.d.ts +1 -1
  9. package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts +3 -1
  10. package/dist/commonjs/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
  11. package/dist/commonjs/models/components/debugdatasourcestatusresponse.js.map +1 -1
  12. package/dist/esm/__tests__/messages.test.js +1 -1
  13. package/dist/esm/__tests__/messages.test.js.map +1 -1
  14. package/dist/esm/__tests__/summarize.test.js +3 -2
  15. package/dist/esm/__tests__/summarize.test.js.map +1 -1
  16. package/dist/esm/lib/config.d.ts +3 -3
  17. package/dist/esm/lib/config.js +3 -3
  18. package/dist/esm/models/components/chatmessagefragment.d.ts +1 -1
  19. package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts +3 -1
  20. package/dist/esm/models/components/debugdatasourcestatusresponse.d.ts.map +1 -1
  21. package/dist/esm/models/components/debugdatasourcestatusresponse.js.map +1 -1
  22. package/examples/package-lock.json +1 -1
  23. package/jsr.json +1 -1
  24. package/package.json +1 -1
  25. package/src/__tests__/messages.test.ts +1 -1
  26. package/src/__tests__/summarize.test.ts +3 -2
  27. package/src/lib/config.ts +3 -3
  28. package/src/models/components/chatmessagefragment.ts +1 -1
  29. package/src/models/components/debugdatasourcestatusresponse.ts +3 -1
  30. package/.devcontainer/README.md +0 -35
  31. package/docs/sdks/activity/README.md +0 -242
  32. package/docs/sdks/agents/README.md +0 -498
  33. package/docs/sdks/announcements/README.md +0 -137560
  34. package/docs/sdks/answers/README.md +0 -4966
  35. package/docs/sdks/chat/README.md +0 -967
  36. package/docs/sdks/clientauthentication/README.md +0 -98
  37. package/docs/sdks/clientdocuments/README.md +0 -457
  38. package/docs/sdks/clientshortcuts/README.md +0 -9340
  39. package/docs/sdks/collections/README.md +0 -4148
  40. package/docs/sdks/datasource/README.md +0 -98
  41. package/docs/sdks/datasources/README.md +0 -211
  42. package/docs/sdks/entities/README.md +0 -225
  43. package/docs/sdks/indexingauthentication/README.md +0 -93
  44. package/docs/sdks/indexingdocuments/README.md +0 -983
  45. package/docs/sdks/indexingshortcuts/README.md +0 -251
  46. package/docs/sdks/insights/README.md +0 -94
  47. package/docs/sdks/messages/README.md +0 -102
  48. package/docs/sdks/people/README.md +0 -1052
  49. package/docs/sdks/permissions/README.md +0 -1198
  50. package/docs/sdks/pins/README.md +0 -506
  51. package/docs/sdks/policies/README.md +0 -478
  52. package/docs/sdks/reports/README.md +0 -290
  53. package/docs/sdks/search/README.md +0 -986
  54. package/docs/sdks/tools/README.md +0 -208
  55. package/docs/sdks/verification/README.md +0 -276
  56. package/docs/sdks/visibilityoverrides/README.md +0 -192
  57. package/examples/README.md +0 -31
  58. package/src/__tests__/mockserver/README.md +0 -52
@@ -1,4148 +0,0 @@
1
- # Collections
2
- (*client.collections*)
3
-
4
- ## Overview
5
-
6
- ### Available Operations
7
-
8
- * [addItems](#additems) - Add Collection item
9
- * [create](#create) - Create Collection
10
- * [delete](#delete) - Delete Collection
11
- * [deleteItem](#deleteitem) - Delete Collection item
12
- * [update](#update) - Update Collection
13
- * [updateItem](#updateitem) - Update Collection item
14
- * [retrieve](#retrieve) - Read Collection
15
- * [list](#list) - List Collections
16
-
17
- ## addItems
18
-
19
- Add items to a Collection.
20
-
21
- ### Example Usage
22
-
23
- <!-- UsageSnippet language="typescript" operationID="addcollectionitems" method="post" path="/rest/api/v1/addcollectionitems" -->
24
- ```typescript
25
- import { Glean } from "@gleanwork/api-client";
26
-
27
- const glean = new Glean({
28
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
29
- });
30
-
31
- async function run() {
32
- const result = await glean.client.collections.addItems({
33
- collectionId: 7742.68,
34
- });
35
-
36
- console.log(result);
37
- }
38
-
39
- run();
40
- ```
41
-
42
- ### Standalone function
43
-
44
- The standalone function version of this method:
45
-
46
- ```typescript
47
- import { GleanCore } from "@gleanwork/api-client/core.js";
48
- import { clientCollectionsAddItems } from "@gleanwork/api-client/funcs/clientCollectionsAddItems.js";
49
-
50
- // Use `GleanCore` for best tree-shaking performance.
51
- // You can create one instance of it to use across an application.
52
- const glean = new GleanCore({
53
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
54
- });
55
-
56
- async function run() {
57
- const res = await clientCollectionsAddItems(glean, {
58
- collectionId: 7742.68,
59
- });
60
- if (res.ok) {
61
- const { value: result } = res;
62
- console.log(result);
63
- } else {
64
- console.log("clientCollectionsAddItems failed:", res.error);
65
- }
66
- }
67
-
68
- run();
69
- ```
70
-
71
- ### React hooks and utilities
72
-
73
- This method can be used in React components through the following hooks and
74
- associated utilities.
75
-
76
- > Check out [this guide][hook-guide] for information about each of the utilities
77
- > below and how to get started using React hooks.
78
-
79
- [hook-guide]: ../../../REACT_QUERY.md
80
-
81
- ```tsx
82
- import {
83
- // Mutation hook for triggering the API call.
84
- useClientCollectionsAddItemsMutation
85
- } from "@gleanwork/api-client/react-query/clientCollectionsAddItems.js";
86
- ```
87
-
88
- ### Parameters
89
-
90
- | Parameter | Type | Required | Description |
91
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
92
- | `request` | [components.AddCollectionItemsRequest](../../models/components/addcollectionitemsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
93
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
94
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
95
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
96
-
97
- ### Response
98
-
99
- **Promise\<[components.AddCollectionItemsResponse](../../models/components/addcollectionitemsresponse.md)\>**
100
-
101
- ### Errors
102
-
103
- | Error Type | Status Code | Content Type |
104
- | ----------------- | ----------------- | ----------------- |
105
- | errors.GleanError | 4XX, 5XX | \*/\* |
106
-
107
- ## create
108
-
109
- Create a publicly visible (empty) Collection of documents.
110
-
111
- ### Example Usage
112
-
113
- <!-- UsageSnippet language="typescript" operationID="createcollection" method="post" path="/rest/api/v1/createcollection" -->
114
- ```typescript
115
- import { Glean } from "@gleanwork/api-client";
116
- import { RFCDate } from "@gleanwork/api-client/types";
117
-
118
- const glean = new Glean({
119
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
120
- });
121
-
122
- async function run() {
123
- const result = await glean.client.collections.create({
124
- name: "<value>",
125
- addedRoles: [
126
- {
127
- person: {
128
- name: "George Clooney",
129
- obfuscatedId: "abc123",
130
- relatedDocuments: [
131
- {
132
- querySuggestion: {
133
- query: "app:github type:pull author:mortimer",
134
- searchProviderInfo: {
135
- name: "Google",
136
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
137
- },
138
- label: "Mortimer's PRs",
139
- datasource: "github",
140
- requestOptions: {
141
- datasourceFilter: "JIRA",
142
- datasourcesFilter: [
143
- "JIRA",
144
- ],
145
- queryOverridesFacetFilters: true,
146
- facetFilters: [
147
- {
148
- fieldName: "type",
149
- values: [
150
- {
151
- value: "Spreadsheet",
152
- relationType: "EQUALS",
153
- },
154
- {
155
- value: "Presentation",
156
- relationType: "EQUALS",
157
- },
158
- ],
159
- },
160
- ],
161
- facetFilterSets: [
162
- {
163
- filters: [
164
- {
165
- fieldName: "type",
166
- values: [
167
- {
168
- value: "Spreadsheet",
169
- relationType: "EQUALS",
170
- },
171
- {
172
- value: "Presentation",
173
- relationType: "EQUALS",
174
- },
175
- ],
176
- },
177
- ],
178
- },
179
- {
180
- filters: [
181
- {
182
- fieldName: "type",
183
- values: [
184
- {
185
- value: "Spreadsheet",
186
- relationType: "EQUALS",
187
- },
188
- {
189
- value: "Presentation",
190
- relationType: "EQUALS",
191
- },
192
- ],
193
- },
194
- ],
195
- },
196
- {
197
- filters: [
198
- {
199
- fieldName: "type",
200
- values: [
201
- {
202
- value: "Spreadsheet",
203
- relationType: "EQUALS",
204
- },
205
- {
206
- value: "Presentation",
207
- relationType: "EQUALS",
208
- },
209
- ],
210
- },
211
- ],
212
- },
213
- ],
214
- facetBucketSize: 977077,
215
- authTokens: [
216
- {
217
- accessToken: "123abc",
218
- datasource: "gmail",
219
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
220
- tokenType: "Bearer",
221
- authUser: "1",
222
- },
223
- ],
224
- },
225
- ranges: [
226
- {
227
- startIndex: 86650,
228
- document: {
229
- metadata: {
230
- datasource: "datasource",
231
- objectType: "Feature Request",
232
- container: "container",
233
- parentId: "JIRA_EN-1337",
234
- mimeType: "mimeType",
235
- documentId: "documentId",
236
- createTime: new Date("2000-01-23T04:56:07.000Z"),
237
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
238
- components: [
239
- "Backend",
240
- "Networking",
241
- ],
242
- status: "[\"Done\"]",
243
- pins: [
244
- {
245
- audienceFilters: [
246
- {
247
- fieldName: "type",
248
- values: [
249
- {
250
- value: "Spreadsheet",
251
- relationType: "EQUALS",
252
- },
253
- {
254
- value: "Presentation",
255
- relationType: "EQUALS",
256
- },
257
- ],
258
- },
259
- ],
260
- documentId: "<id>",
261
- },
262
- ],
263
- collections: [
264
- {
265
- name: "<value>",
266
- description: "meaty dial elegantly while react",
267
- audienceFilters: [
268
- {
269
- fieldName: "type",
270
- values: [
271
- {
272
- value: "Spreadsheet",
273
- relationType: "EQUALS",
274
- },
275
- {
276
- value: "Presentation",
277
- relationType: "EQUALS",
278
- },
279
- ],
280
- },
281
- ],
282
- id: 854591,
283
- items: [
284
- {
285
- collectionId: 697663,
286
- shortcut: {
287
- inputAlias: "<value>",
288
- },
289
- itemType: "TEXT",
290
- },
291
- {
292
- collectionId: 697663,
293
- shortcut: {
294
- inputAlias: "<value>",
295
- },
296
- itemType: "TEXT",
297
- },
298
- {
299
- collectionId: 697663,
300
- shortcut: {
301
- inputAlias: "<value>",
302
- },
303
- itemType: "TEXT",
304
- },
305
- ],
306
- },
307
- ],
308
- interactions: {
309
- reacts: [
310
- {},
311
- {},
312
- ],
313
- shares: [
314
- {
315
- numDaysAgo: 365776,
316
- },
317
- {
318
- numDaysAgo: 365776,
319
- },
320
- {
321
- numDaysAgo: 365776,
322
- },
323
- ],
324
- },
325
- verification: {
326
- state: "DEPRECATED",
327
- metadata: {
328
- reminders: [
329
- {
330
- assignee: {
331
- name: "George Clooney",
332
- obfuscatedId: "abc123",
333
- },
334
- remindAt: 268615,
335
- },
336
- ],
337
- lastReminder: {
338
- assignee: {
339
- name: "George Clooney",
340
- obfuscatedId: "abc123",
341
- },
342
- remindAt: 423482,
343
- },
344
- },
345
- },
346
- shortcuts: [
347
- {
348
- inputAlias: "<value>",
349
- },
350
- {
351
- inputAlias: "<value>",
352
- },
353
- {
354
- inputAlias: "<value>",
355
- },
356
- ],
357
- customData: {
358
- "someCustomField": {},
359
- },
360
- },
361
- },
362
- },
363
- ],
364
- inputDetails: {
365
- hasCopyPaste: true,
366
- },
367
- },
368
- results: [
369
- {
370
- title: "title",
371
- url: "https://example.com/foo/bar",
372
- nativeAppUrl: "slack://foo/bar",
373
- snippets: [
374
- {
375
- mimeType: "mimeType",
376
- snippet: "snippet",
377
- },
378
- ],
379
- },
380
- ],
381
- },
382
- {
383
- querySuggestion: {
384
- query: "app:github type:pull author:mortimer",
385
- searchProviderInfo: {
386
- name: "Google",
387
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
388
- },
389
- label: "Mortimer's PRs",
390
- datasource: "github",
391
- requestOptions: {
392
- datasourceFilter: "JIRA",
393
- datasourcesFilter: [
394
- "JIRA",
395
- ],
396
- queryOverridesFacetFilters: true,
397
- facetFilters: [
398
- {
399
- fieldName: "type",
400
- values: [
401
- {
402
- value: "Spreadsheet",
403
- relationType: "EQUALS",
404
- },
405
- {
406
- value: "Presentation",
407
- relationType: "EQUALS",
408
- },
409
- ],
410
- },
411
- ],
412
- facetFilterSets: [
413
- {
414
- filters: [
415
- {
416
- fieldName: "type",
417
- values: [
418
- {
419
- value: "Spreadsheet",
420
- relationType: "EQUALS",
421
- },
422
- {
423
- value: "Presentation",
424
- relationType: "EQUALS",
425
- },
426
- ],
427
- },
428
- ],
429
- },
430
- {
431
- filters: [
432
- {
433
- fieldName: "type",
434
- values: [
435
- {
436
- value: "Spreadsheet",
437
- relationType: "EQUALS",
438
- },
439
- {
440
- value: "Presentation",
441
- relationType: "EQUALS",
442
- },
443
- ],
444
- },
445
- ],
446
- },
447
- {
448
- filters: [
449
- {
450
- fieldName: "type",
451
- values: [
452
- {
453
- value: "Spreadsheet",
454
- relationType: "EQUALS",
455
- },
456
- {
457
- value: "Presentation",
458
- relationType: "EQUALS",
459
- },
460
- ],
461
- },
462
- ],
463
- },
464
- ],
465
- facetBucketSize: 977077,
466
- authTokens: [
467
- {
468
- accessToken: "123abc",
469
- datasource: "gmail",
470
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
471
- tokenType: "Bearer",
472
- authUser: "1",
473
- },
474
- ],
475
- },
476
- ranges: [
477
- {
478
- startIndex: 86650,
479
- document: {
480
- metadata: {
481
- datasource: "datasource",
482
- objectType: "Feature Request",
483
- container: "container",
484
- parentId: "JIRA_EN-1337",
485
- mimeType: "mimeType",
486
- documentId: "documentId",
487
- createTime: new Date("2000-01-23T04:56:07.000Z"),
488
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
489
- components: [
490
- "Backend",
491
- "Networking",
492
- ],
493
- status: "[\"Done\"]",
494
- pins: [
495
- {
496
- audienceFilters: [
497
- {
498
- fieldName: "type",
499
- values: [
500
- {
501
- value: "Spreadsheet",
502
- relationType: "EQUALS",
503
- },
504
- {
505
- value: "Presentation",
506
- relationType: "EQUALS",
507
- },
508
- ],
509
- },
510
- ],
511
- documentId: "<id>",
512
- },
513
- ],
514
- collections: [
515
- {
516
- name: "<value>",
517
- description: "meaty dial elegantly while react",
518
- audienceFilters: [
519
- {
520
- fieldName: "type",
521
- values: [
522
- {
523
- value: "Spreadsheet",
524
- relationType: "EQUALS",
525
- },
526
- {
527
- value: "Presentation",
528
- relationType: "EQUALS",
529
- },
530
- ],
531
- },
532
- ],
533
- id: 854591,
534
- items: [
535
- {
536
- collectionId: 697663,
537
- shortcut: {
538
- inputAlias: "<value>",
539
- },
540
- itemType: "TEXT",
541
- },
542
- {
543
- collectionId: 697663,
544
- shortcut: {
545
- inputAlias: "<value>",
546
- },
547
- itemType: "TEXT",
548
- },
549
- {
550
- collectionId: 697663,
551
- shortcut: {
552
- inputAlias: "<value>",
553
- },
554
- itemType: "TEXT",
555
- },
556
- ],
557
- },
558
- ],
559
- interactions: {
560
- reacts: [
561
- {},
562
- {},
563
- ],
564
- shares: [
565
- {
566
- numDaysAgo: 365776,
567
- },
568
- {
569
- numDaysAgo: 365776,
570
- },
571
- {
572
- numDaysAgo: 365776,
573
- },
574
- ],
575
- },
576
- verification: {
577
- state: "DEPRECATED",
578
- metadata: {
579
- reminders: [
580
- {
581
- assignee: {
582
- name: "George Clooney",
583
- obfuscatedId: "abc123",
584
- },
585
- remindAt: 268615,
586
- },
587
- ],
588
- lastReminder: {
589
- assignee: {
590
- name: "George Clooney",
591
- obfuscatedId: "abc123",
592
- },
593
- remindAt: 423482,
594
- },
595
- },
596
- },
597
- shortcuts: [
598
- {
599
- inputAlias: "<value>",
600
- },
601
- {
602
- inputAlias: "<value>",
603
- },
604
- {
605
- inputAlias: "<value>",
606
- },
607
- ],
608
- customData: {
609
- "someCustomField": {},
610
- },
611
- },
612
- },
613
- },
614
- ],
615
- inputDetails: {
616
- hasCopyPaste: true,
617
- },
618
- },
619
- results: [
620
- {
621
- title: "title",
622
- url: "https://example.com/foo/bar",
623
- nativeAppUrl: "slack://foo/bar",
624
- snippets: [
625
- {
626
- mimeType: "mimeType",
627
- snippet: "snippet",
628
- },
629
- ],
630
- },
631
- ],
632
- },
633
- ],
634
- metadata: {
635
- type: "FULL_TIME",
636
- title: "Actor",
637
- department: "Movies",
638
- email: "george@example.com",
639
- location: "Hollywood, CA",
640
- phone: "6505551234",
641
- photoUrl: "https://example.com/george.jpg",
642
- startDate: new RFCDate("2000-01-23"),
643
- datasourceProfile: [
644
- {
645
- datasource: "github",
646
- handle: "<value>",
647
- },
648
- {
649
- datasource: "github",
650
- handle: "<value>",
651
- },
652
- ],
653
- querySuggestions: {
654
- suggestions: [
655
- {
656
- query: "app:github type:pull author:mortimer",
657
- label: "Mortimer's PRs",
658
- datasource: "github",
659
- },
660
- ],
661
- },
662
- inviteInfo: {
663
- invites: [
664
- {},
665
- {},
666
- ],
667
- },
668
- customFields: [
669
- {
670
- label: "<value>",
671
- values: [
672
- {},
673
- {},
674
- {},
675
- ],
676
- },
677
- {
678
- label: "<value>",
679
- values: [
680
- {},
681
- {},
682
- {},
683
- ],
684
- },
685
- ],
686
- badges: [
687
- {
688
- key: "deployment_name_new_hire",
689
- displayName: "New hire",
690
- iconConfig: {
691
- color: "#343CED",
692
- key: "person_icon",
693
- iconType: "GLYPH",
694
- name: "user",
695
- },
696
- },
697
- ],
698
- },
699
- },
700
- role: "VERIFIER",
701
- },
702
- ],
703
- removedRoles: [
704
- {
705
- person: {
706
- name: "George Clooney",
707
- obfuscatedId: "abc123",
708
- metadata: {
709
- type: "FULL_TIME",
710
- title: "Actor",
711
- department: "Movies",
712
- email: "george@example.com",
713
- location: "Hollywood, CA",
714
- phone: "6505551234",
715
- photoUrl: "https://example.com/george.jpg",
716
- startDate: new RFCDate("2000-01-23"),
717
- datasourceProfile: [
718
- {
719
- datasource: "github",
720
- handle: "<value>",
721
- },
722
- {
723
- datasource: "github",
724
- handle: "<value>",
725
- },
726
- ],
727
- querySuggestions: {
728
- suggestions: [
729
- {
730
- query: "app:github type:pull author:mortimer",
731
- label: "Mortimer's PRs",
732
- datasource: "github",
733
- },
734
- ],
735
- },
736
- inviteInfo: {
737
- invites: [
738
- {},
739
- {},
740
- ],
741
- },
742
- badges: [
743
- {
744
- key: "deployment_name_new_hire",
745
- displayName: "New hire",
746
- iconConfig: {
747
- color: "#343CED",
748
- key: "person_icon",
749
- iconType: "GLYPH",
750
- name: "user",
751
- },
752
- },
753
- ],
754
- },
755
- },
756
- role: "VIEWER",
757
- },
758
- ],
759
- audienceFilters: [
760
- {
761
- fieldName: "type",
762
- values: [
763
- {
764
- value: "Spreadsheet",
765
- relationType: "EQUALS",
766
- },
767
- {
768
- value: "Presentation",
769
- relationType: "EQUALS",
770
- },
771
- ],
772
- },
773
- ],
774
- });
775
-
776
- console.log(result);
777
- }
778
-
779
- run();
780
- ```
781
-
782
- ### Standalone function
783
-
784
- The standalone function version of this method:
785
-
786
- ```typescript
787
- import { GleanCore } from "@gleanwork/api-client/core.js";
788
- import { clientCollectionsCreate } from "@gleanwork/api-client/funcs/clientCollectionsCreate.js";
789
- import { RFCDate } from "@gleanwork/api-client/types";
790
-
791
- // Use `GleanCore` for best tree-shaking performance.
792
- // You can create one instance of it to use across an application.
793
- const glean = new GleanCore({
794
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
795
- });
796
-
797
- async function run() {
798
- const res = await clientCollectionsCreate(glean, {
799
- name: "<value>",
800
- addedRoles: [
801
- {
802
- person: {
803
- name: "George Clooney",
804
- obfuscatedId: "abc123",
805
- relatedDocuments: [
806
- {
807
- querySuggestion: {
808
- query: "app:github type:pull author:mortimer",
809
- searchProviderInfo: {
810
- name: "Google",
811
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
812
- },
813
- label: "Mortimer's PRs",
814
- datasource: "github",
815
- requestOptions: {
816
- datasourceFilter: "JIRA",
817
- datasourcesFilter: [
818
- "JIRA",
819
- ],
820
- queryOverridesFacetFilters: true,
821
- facetFilters: [
822
- {
823
- fieldName: "type",
824
- values: [
825
- {
826
- value: "Spreadsheet",
827
- relationType: "EQUALS",
828
- },
829
- {
830
- value: "Presentation",
831
- relationType: "EQUALS",
832
- },
833
- ],
834
- },
835
- ],
836
- facetFilterSets: [
837
- {
838
- filters: [
839
- {
840
- fieldName: "type",
841
- values: [
842
- {
843
- value: "Spreadsheet",
844
- relationType: "EQUALS",
845
- },
846
- {
847
- value: "Presentation",
848
- relationType: "EQUALS",
849
- },
850
- ],
851
- },
852
- ],
853
- },
854
- {
855
- filters: [
856
- {
857
- fieldName: "type",
858
- values: [
859
- {
860
- value: "Spreadsheet",
861
- relationType: "EQUALS",
862
- },
863
- {
864
- value: "Presentation",
865
- relationType: "EQUALS",
866
- },
867
- ],
868
- },
869
- ],
870
- },
871
- {
872
- filters: [
873
- {
874
- fieldName: "type",
875
- values: [
876
- {
877
- value: "Spreadsheet",
878
- relationType: "EQUALS",
879
- },
880
- {
881
- value: "Presentation",
882
- relationType: "EQUALS",
883
- },
884
- ],
885
- },
886
- ],
887
- },
888
- ],
889
- facetBucketSize: 977077,
890
- authTokens: [
891
- {
892
- accessToken: "123abc",
893
- datasource: "gmail",
894
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
895
- tokenType: "Bearer",
896
- authUser: "1",
897
- },
898
- ],
899
- },
900
- ranges: [
901
- {
902
- startIndex: 86650,
903
- document: {
904
- metadata: {
905
- datasource: "datasource",
906
- objectType: "Feature Request",
907
- container: "container",
908
- parentId: "JIRA_EN-1337",
909
- mimeType: "mimeType",
910
- documentId: "documentId",
911
- createTime: new Date("2000-01-23T04:56:07.000Z"),
912
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
913
- components: [
914
- "Backend",
915
- "Networking",
916
- ],
917
- status: "[\"Done\"]",
918
- pins: [
919
- {
920
- audienceFilters: [
921
- {
922
- fieldName: "type",
923
- values: [
924
- {
925
- value: "Spreadsheet",
926
- relationType: "EQUALS",
927
- },
928
- {
929
- value: "Presentation",
930
- relationType: "EQUALS",
931
- },
932
- ],
933
- },
934
- ],
935
- documentId: "<id>",
936
- },
937
- ],
938
- collections: [
939
- {
940
- name: "<value>",
941
- description: "meaty dial elegantly while react",
942
- audienceFilters: [
943
- {
944
- fieldName: "type",
945
- values: [
946
- {
947
- value: "Spreadsheet",
948
- relationType: "EQUALS",
949
- },
950
- {
951
- value: "Presentation",
952
- relationType: "EQUALS",
953
- },
954
- ],
955
- },
956
- ],
957
- id: 854591,
958
- items: [
959
- {
960
- collectionId: 697663,
961
- shortcut: {
962
- inputAlias: "<value>",
963
- },
964
- itemType: "TEXT",
965
- },
966
- {
967
- collectionId: 697663,
968
- shortcut: {
969
- inputAlias: "<value>",
970
- },
971
- itemType: "TEXT",
972
- },
973
- {
974
- collectionId: 697663,
975
- shortcut: {
976
- inputAlias: "<value>",
977
- },
978
- itemType: "TEXT",
979
- },
980
- ],
981
- },
982
- ],
983
- interactions: {
984
- reacts: [
985
- {},
986
- {},
987
- ],
988
- shares: [
989
- {
990
- numDaysAgo: 365776,
991
- },
992
- {
993
- numDaysAgo: 365776,
994
- },
995
- {
996
- numDaysAgo: 365776,
997
- },
998
- ],
999
- },
1000
- verification: {
1001
- state: "DEPRECATED",
1002
- metadata: {
1003
- reminders: [
1004
- {
1005
- assignee: {
1006
- name: "George Clooney",
1007
- obfuscatedId: "abc123",
1008
- },
1009
- remindAt: 268615,
1010
- },
1011
- ],
1012
- lastReminder: {
1013
- assignee: {
1014
- name: "George Clooney",
1015
- obfuscatedId: "abc123",
1016
- },
1017
- remindAt: 423482,
1018
- },
1019
- },
1020
- },
1021
- shortcuts: [
1022
- {
1023
- inputAlias: "<value>",
1024
- },
1025
- {
1026
- inputAlias: "<value>",
1027
- },
1028
- {
1029
- inputAlias: "<value>",
1030
- },
1031
- ],
1032
- customData: {
1033
- "someCustomField": {},
1034
- },
1035
- },
1036
- },
1037
- },
1038
- ],
1039
- inputDetails: {
1040
- hasCopyPaste: true,
1041
- },
1042
- },
1043
- results: [
1044
- {
1045
- title: "title",
1046
- url: "https://example.com/foo/bar",
1047
- nativeAppUrl: "slack://foo/bar",
1048
- snippets: [
1049
- {
1050
- mimeType: "mimeType",
1051
- snippet: "snippet",
1052
- },
1053
- ],
1054
- },
1055
- ],
1056
- },
1057
- {
1058
- querySuggestion: {
1059
- query: "app:github type:pull author:mortimer",
1060
- searchProviderInfo: {
1061
- name: "Google",
1062
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
1063
- },
1064
- label: "Mortimer's PRs",
1065
- datasource: "github",
1066
- requestOptions: {
1067
- datasourceFilter: "JIRA",
1068
- datasourcesFilter: [
1069
- "JIRA",
1070
- ],
1071
- queryOverridesFacetFilters: true,
1072
- facetFilters: [
1073
- {
1074
- fieldName: "type",
1075
- values: [
1076
- {
1077
- value: "Spreadsheet",
1078
- relationType: "EQUALS",
1079
- },
1080
- {
1081
- value: "Presentation",
1082
- relationType: "EQUALS",
1083
- },
1084
- ],
1085
- },
1086
- ],
1087
- facetFilterSets: [
1088
- {
1089
- filters: [
1090
- {
1091
- fieldName: "type",
1092
- values: [
1093
- {
1094
- value: "Spreadsheet",
1095
- relationType: "EQUALS",
1096
- },
1097
- {
1098
- value: "Presentation",
1099
- relationType: "EQUALS",
1100
- },
1101
- ],
1102
- },
1103
- ],
1104
- },
1105
- {
1106
- filters: [
1107
- {
1108
- fieldName: "type",
1109
- values: [
1110
- {
1111
- value: "Spreadsheet",
1112
- relationType: "EQUALS",
1113
- },
1114
- {
1115
- value: "Presentation",
1116
- relationType: "EQUALS",
1117
- },
1118
- ],
1119
- },
1120
- ],
1121
- },
1122
- {
1123
- filters: [
1124
- {
1125
- fieldName: "type",
1126
- values: [
1127
- {
1128
- value: "Spreadsheet",
1129
- relationType: "EQUALS",
1130
- },
1131
- {
1132
- value: "Presentation",
1133
- relationType: "EQUALS",
1134
- },
1135
- ],
1136
- },
1137
- ],
1138
- },
1139
- ],
1140
- facetBucketSize: 977077,
1141
- authTokens: [
1142
- {
1143
- accessToken: "123abc",
1144
- datasource: "gmail",
1145
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
1146
- tokenType: "Bearer",
1147
- authUser: "1",
1148
- },
1149
- ],
1150
- },
1151
- ranges: [
1152
- {
1153
- startIndex: 86650,
1154
- document: {
1155
- metadata: {
1156
- datasource: "datasource",
1157
- objectType: "Feature Request",
1158
- container: "container",
1159
- parentId: "JIRA_EN-1337",
1160
- mimeType: "mimeType",
1161
- documentId: "documentId",
1162
- createTime: new Date("2000-01-23T04:56:07.000Z"),
1163
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
1164
- components: [
1165
- "Backend",
1166
- "Networking",
1167
- ],
1168
- status: "[\"Done\"]",
1169
- pins: [
1170
- {
1171
- audienceFilters: [
1172
- {
1173
- fieldName: "type",
1174
- values: [
1175
- {
1176
- value: "Spreadsheet",
1177
- relationType: "EQUALS",
1178
- },
1179
- {
1180
- value: "Presentation",
1181
- relationType: "EQUALS",
1182
- },
1183
- ],
1184
- },
1185
- ],
1186
- documentId: "<id>",
1187
- },
1188
- ],
1189
- collections: [
1190
- {
1191
- name: "<value>",
1192
- description: "meaty dial elegantly while react",
1193
- audienceFilters: [
1194
- {
1195
- fieldName: "type",
1196
- values: [
1197
- {
1198
- value: "Spreadsheet",
1199
- relationType: "EQUALS",
1200
- },
1201
- {
1202
- value: "Presentation",
1203
- relationType: "EQUALS",
1204
- },
1205
- ],
1206
- },
1207
- ],
1208
- id: 854591,
1209
- items: [
1210
- {
1211
- collectionId: 697663,
1212
- shortcut: {
1213
- inputAlias: "<value>",
1214
- },
1215
- itemType: "TEXT",
1216
- },
1217
- {
1218
- collectionId: 697663,
1219
- shortcut: {
1220
- inputAlias: "<value>",
1221
- },
1222
- itemType: "TEXT",
1223
- },
1224
- {
1225
- collectionId: 697663,
1226
- shortcut: {
1227
- inputAlias: "<value>",
1228
- },
1229
- itemType: "TEXT",
1230
- },
1231
- ],
1232
- },
1233
- ],
1234
- interactions: {
1235
- reacts: [
1236
- {},
1237
- {},
1238
- ],
1239
- shares: [
1240
- {
1241
- numDaysAgo: 365776,
1242
- },
1243
- {
1244
- numDaysAgo: 365776,
1245
- },
1246
- {
1247
- numDaysAgo: 365776,
1248
- },
1249
- ],
1250
- },
1251
- verification: {
1252
- state: "DEPRECATED",
1253
- metadata: {
1254
- reminders: [
1255
- {
1256
- assignee: {
1257
- name: "George Clooney",
1258
- obfuscatedId: "abc123",
1259
- },
1260
- remindAt: 268615,
1261
- },
1262
- ],
1263
- lastReminder: {
1264
- assignee: {
1265
- name: "George Clooney",
1266
- obfuscatedId: "abc123",
1267
- },
1268
- remindAt: 423482,
1269
- },
1270
- },
1271
- },
1272
- shortcuts: [
1273
- {
1274
- inputAlias: "<value>",
1275
- },
1276
- {
1277
- inputAlias: "<value>",
1278
- },
1279
- {
1280
- inputAlias: "<value>",
1281
- },
1282
- ],
1283
- customData: {
1284
- "someCustomField": {},
1285
- },
1286
- },
1287
- },
1288
- },
1289
- ],
1290
- inputDetails: {
1291
- hasCopyPaste: true,
1292
- },
1293
- },
1294
- results: [
1295
- {
1296
- title: "title",
1297
- url: "https://example.com/foo/bar",
1298
- nativeAppUrl: "slack://foo/bar",
1299
- snippets: [
1300
- {
1301
- mimeType: "mimeType",
1302
- snippet: "snippet",
1303
- },
1304
- ],
1305
- },
1306
- ],
1307
- },
1308
- ],
1309
- metadata: {
1310
- type: "FULL_TIME",
1311
- title: "Actor",
1312
- department: "Movies",
1313
- email: "george@example.com",
1314
- location: "Hollywood, CA",
1315
- phone: "6505551234",
1316
- photoUrl: "https://example.com/george.jpg",
1317
- startDate: new RFCDate("2000-01-23"),
1318
- datasourceProfile: [
1319
- {
1320
- datasource: "github",
1321
- handle: "<value>",
1322
- },
1323
- {
1324
- datasource: "github",
1325
- handle: "<value>",
1326
- },
1327
- ],
1328
- querySuggestions: {
1329
- suggestions: [
1330
- {
1331
- query: "app:github type:pull author:mortimer",
1332
- label: "Mortimer's PRs",
1333
- datasource: "github",
1334
- },
1335
- ],
1336
- },
1337
- inviteInfo: {
1338
- invites: [
1339
- {},
1340
- {},
1341
- ],
1342
- },
1343
- customFields: [
1344
- {
1345
- label: "<value>",
1346
- values: [
1347
- {},
1348
- {},
1349
- {},
1350
- ],
1351
- },
1352
- {
1353
- label: "<value>",
1354
- values: [
1355
- {},
1356
- {},
1357
- {},
1358
- ],
1359
- },
1360
- ],
1361
- badges: [
1362
- {
1363
- key: "deployment_name_new_hire",
1364
- displayName: "New hire",
1365
- iconConfig: {
1366
- color: "#343CED",
1367
- key: "person_icon",
1368
- iconType: "GLYPH",
1369
- name: "user",
1370
- },
1371
- },
1372
- ],
1373
- },
1374
- },
1375
- role: "VERIFIER",
1376
- },
1377
- ],
1378
- removedRoles: [
1379
- {
1380
- person: {
1381
- name: "George Clooney",
1382
- obfuscatedId: "abc123",
1383
- metadata: {
1384
- type: "FULL_TIME",
1385
- title: "Actor",
1386
- department: "Movies",
1387
- email: "george@example.com",
1388
- location: "Hollywood, CA",
1389
- phone: "6505551234",
1390
- photoUrl: "https://example.com/george.jpg",
1391
- startDate: new RFCDate("2000-01-23"),
1392
- datasourceProfile: [
1393
- {
1394
- datasource: "github",
1395
- handle: "<value>",
1396
- },
1397
- {
1398
- datasource: "github",
1399
- handle: "<value>",
1400
- },
1401
- ],
1402
- querySuggestions: {
1403
- suggestions: [
1404
- {
1405
- query: "app:github type:pull author:mortimer",
1406
- label: "Mortimer's PRs",
1407
- datasource: "github",
1408
- },
1409
- ],
1410
- },
1411
- inviteInfo: {
1412
- invites: [
1413
- {},
1414
- {},
1415
- ],
1416
- },
1417
- badges: [
1418
- {
1419
- key: "deployment_name_new_hire",
1420
- displayName: "New hire",
1421
- iconConfig: {
1422
- color: "#343CED",
1423
- key: "person_icon",
1424
- iconType: "GLYPH",
1425
- name: "user",
1426
- },
1427
- },
1428
- ],
1429
- },
1430
- },
1431
- role: "VIEWER",
1432
- },
1433
- ],
1434
- audienceFilters: [
1435
- {
1436
- fieldName: "type",
1437
- values: [
1438
- {
1439
- value: "Spreadsheet",
1440
- relationType: "EQUALS",
1441
- },
1442
- {
1443
- value: "Presentation",
1444
- relationType: "EQUALS",
1445
- },
1446
- ],
1447
- },
1448
- ],
1449
- });
1450
- if (res.ok) {
1451
- const { value: result } = res;
1452
- console.log(result);
1453
- } else {
1454
- console.log("clientCollectionsCreate failed:", res.error);
1455
- }
1456
- }
1457
-
1458
- run();
1459
- ```
1460
-
1461
- ### React hooks and utilities
1462
-
1463
- This method can be used in React components through the following hooks and
1464
- associated utilities.
1465
-
1466
- > Check out [this guide][hook-guide] for information about each of the utilities
1467
- > below and how to get started using React hooks.
1468
-
1469
- [hook-guide]: ../../../REACT_QUERY.md
1470
-
1471
- ```tsx
1472
- import {
1473
- // Mutation hook for triggering the API call.
1474
- useClientCollectionsCreateMutation
1475
- } from "@gleanwork/api-client/react-query/clientCollectionsCreate.js";
1476
- ```
1477
-
1478
- ### Parameters
1479
-
1480
- | Parameter | Type | Required | Description |
1481
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1482
- | `request` | [components.CreateCollectionRequest](../../models/components/createcollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1483
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1484
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1485
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1486
-
1487
- ### Response
1488
-
1489
- **Promise\<[operations.CreatecollectionResponse](../../models/operations/createcollectionresponse.md)\>**
1490
-
1491
- ### Errors
1492
-
1493
- | Error Type | Status Code | Content Type |
1494
- | ---------------------- | ---------------------- | ---------------------- |
1495
- | errors.CollectionError | 422 | application/json |
1496
- | errors.GleanError | 4XX, 5XX | \*/\* |
1497
-
1498
- ## delete
1499
-
1500
- Delete a Collection given the Collection's ID.
1501
-
1502
- ### Example Usage
1503
-
1504
- <!-- UsageSnippet language="typescript" operationID="deletecollection" method="post" path="/rest/api/v1/deletecollection" -->
1505
- ```typescript
1506
- import { Glean } from "@gleanwork/api-client";
1507
-
1508
- const glean = new Glean({
1509
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1510
- });
1511
-
1512
- async function run() {
1513
- await glean.client.collections.delete({
1514
- ids: [
1515
- 930352,
1516
- 156719,
1517
- 25102,
1518
- ],
1519
- });
1520
-
1521
-
1522
- }
1523
-
1524
- run();
1525
- ```
1526
-
1527
- ### Standalone function
1528
-
1529
- The standalone function version of this method:
1530
-
1531
- ```typescript
1532
- import { GleanCore } from "@gleanwork/api-client/core.js";
1533
- import { clientCollectionsDelete } from "@gleanwork/api-client/funcs/clientCollectionsDelete.js";
1534
-
1535
- // Use `GleanCore` for best tree-shaking performance.
1536
- // You can create one instance of it to use across an application.
1537
- const glean = new GleanCore({
1538
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1539
- });
1540
-
1541
- async function run() {
1542
- const res = await clientCollectionsDelete(glean, {
1543
- ids: [
1544
- 930352,
1545
- 156719,
1546
- 25102,
1547
- ],
1548
- });
1549
- if (res.ok) {
1550
- const { value: result } = res;
1551
-
1552
- } else {
1553
- console.log("clientCollectionsDelete failed:", res.error);
1554
- }
1555
- }
1556
-
1557
- run();
1558
- ```
1559
-
1560
- ### React hooks and utilities
1561
-
1562
- This method can be used in React components through the following hooks and
1563
- associated utilities.
1564
-
1565
- > Check out [this guide][hook-guide] for information about each of the utilities
1566
- > below and how to get started using React hooks.
1567
-
1568
- [hook-guide]: ../../../REACT_QUERY.md
1569
-
1570
- ```tsx
1571
- import {
1572
- // Mutation hook for triggering the API call.
1573
- useClientCollectionsDeleteMutation
1574
- } from "@gleanwork/api-client/react-query/clientCollectionsDelete.js";
1575
- ```
1576
-
1577
- ### Parameters
1578
-
1579
- | Parameter | Type | Required | Description |
1580
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1581
- | `request` | [components.DeleteCollectionRequest](../../models/components/deletecollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1582
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1583
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1584
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1585
-
1586
- ### Response
1587
-
1588
- **Promise\<void\>**
1589
-
1590
- ### Errors
1591
-
1592
- | Error Type | Status Code | Content Type |
1593
- | ---------------------- | ---------------------- | ---------------------- |
1594
- | errors.CollectionError | 422 | application/json |
1595
- | errors.GleanError | 4XX, 5XX | \*/\* |
1596
-
1597
- ## deleteItem
1598
-
1599
- Delete a single item from a Collection.
1600
-
1601
- ### Example Usage
1602
-
1603
- <!-- UsageSnippet language="typescript" operationID="deletecollectionitem" method="post" path="/rest/api/v1/deletecollectionitem" -->
1604
- ```typescript
1605
- import { Glean } from "@gleanwork/api-client";
1606
-
1607
- const glean = new Glean({
1608
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1609
- });
1610
-
1611
- async function run() {
1612
- const result = await glean.client.collections.deleteItem({
1613
- collectionId: 6980.49,
1614
- itemId: "<id>",
1615
- });
1616
-
1617
- console.log(result);
1618
- }
1619
-
1620
- run();
1621
- ```
1622
-
1623
- ### Standalone function
1624
-
1625
- The standalone function version of this method:
1626
-
1627
- ```typescript
1628
- import { GleanCore } from "@gleanwork/api-client/core.js";
1629
- import { clientCollectionsDeleteItem } from "@gleanwork/api-client/funcs/clientCollectionsDeleteItem.js";
1630
-
1631
- // Use `GleanCore` for best tree-shaking performance.
1632
- // You can create one instance of it to use across an application.
1633
- const glean = new GleanCore({
1634
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1635
- });
1636
-
1637
- async function run() {
1638
- const res = await clientCollectionsDeleteItem(glean, {
1639
- collectionId: 6980.49,
1640
- itemId: "<id>",
1641
- });
1642
- if (res.ok) {
1643
- const { value: result } = res;
1644
- console.log(result);
1645
- } else {
1646
- console.log("clientCollectionsDeleteItem failed:", res.error);
1647
- }
1648
- }
1649
-
1650
- run();
1651
- ```
1652
-
1653
- ### React hooks and utilities
1654
-
1655
- This method can be used in React components through the following hooks and
1656
- associated utilities.
1657
-
1658
- > Check out [this guide][hook-guide] for information about each of the utilities
1659
- > below and how to get started using React hooks.
1660
-
1661
- [hook-guide]: ../../../REACT_QUERY.md
1662
-
1663
- ```tsx
1664
- import {
1665
- // Mutation hook for triggering the API call.
1666
- useClientCollectionsDeleteItemMutation
1667
- } from "@gleanwork/api-client/react-query/clientCollectionsDeleteItem.js";
1668
- ```
1669
-
1670
- ### Parameters
1671
-
1672
- | Parameter | Type | Required | Description |
1673
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1674
- | `request` | [components.DeleteCollectionItemRequest](../../models/components/deletecollectionitemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
1675
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
1676
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
1677
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
1678
-
1679
- ### Response
1680
-
1681
- **Promise\<[components.DeleteCollectionItemResponse](../../models/components/deletecollectionitemresponse.md)\>**
1682
-
1683
- ### Errors
1684
-
1685
- | Error Type | Status Code | Content Type |
1686
- | ----------------- | ----------------- | ----------------- |
1687
- | errors.GleanError | 4XX, 5XX | \*/\* |
1688
-
1689
- ## update
1690
-
1691
- Update the properties of an existing Collection.
1692
-
1693
- ### Example Usage
1694
-
1695
- <!-- UsageSnippet language="typescript" operationID="editcollection" method="post" path="/rest/api/v1/editcollection" -->
1696
- ```typescript
1697
- import { Glean } from "@gleanwork/api-client";
1698
- import { RFCDate } from "@gleanwork/api-client/types";
1699
-
1700
- const glean = new Glean({
1701
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
1702
- });
1703
-
1704
- async function run() {
1705
- const result = await glean.client.collections.update({
1706
- name: "<value>",
1707
- addedRoles: [
1708
- {
1709
- person: {
1710
- name: "George Clooney",
1711
- obfuscatedId: "abc123",
1712
- relatedDocuments: [
1713
- {
1714
- querySuggestion: {
1715
- query: "app:github type:pull author:mortimer",
1716
- searchProviderInfo: {
1717
- name: "Google",
1718
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
1719
- },
1720
- label: "Mortimer's PRs",
1721
- datasource: "github",
1722
- requestOptions: {
1723
- datasourceFilter: "JIRA",
1724
- datasourcesFilter: [
1725
- "JIRA",
1726
- ],
1727
- queryOverridesFacetFilters: true,
1728
- facetFilters: [
1729
- {
1730
- fieldName: "type",
1731
- values: [
1732
- {
1733
- value: "Spreadsheet",
1734
- relationType: "EQUALS",
1735
- },
1736
- {
1737
- value: "Presentation",
1738
- relationType: "EQUALS",
1739
- },
1740
- ],
1741
- },
1742
- ],
1743
- facetFilterSets: [
1744
- {
1745
- filters: [
1746
- {
1747
- fieldName: "type",
1748
- values: [
1749
- {
1750
- value: "Spreadsheet",
1751
- relationType: "EQUALS",
1752
- },
1753
- {
1754
- value: "Presentation",
1755
- relationType: "EQUALS",
1756
- },
1757
- ],
1758
- },
1759
- ],
1760
- },
1761
- {
1762
- filters: [
1763
- {
1764
- fieldName: "type",
1765
- values: [
1766
- {
1767
- value: "Spreadsheet",
1768
- relationType: "EQUALS",
1769
- },
1770
- {
1771
- value: "Presentation",
1772
- relationType: "EQUALS",
1773
- },
1774
- ],
1775
- },
1776
- ],
1777
- },
1778
- ],
1779
- facetBucketSize: 797260,
1780
- authTokens: [
1781
- {
1782
- accessToken: "123abc",
1783
- datasource: "gmail",
1784
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
1785
- tokenType: "Bearer",
1786
- authUser: "1",
1787
- },
1788
- ],
1789
- },
1790
- ranges: [
1791
- {
1792
- startIndex: 932928,
1793
- document: {
1794
- metadata: {
1795
- datasource: "datasource",
1796
- objectType: "Feature Request",
1797
- container: "container",
1798
- parentId: "JIRA_EN-1337",
1799
- mimeType: "mimeType",
1800
- documentId: "documentId",
1801
- createTime: new Date("2000-01-23T04:56:07.000Z"),
1802
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
1803
- components: [
1804
- "Backend",
1805
- "Networking",
1806
- ],
1807
- status: "[\"Done\"]",
1808
- pins: [
1809
- {
1810
- audienceFilters: [
1811
- {
1812
- fieldName: "type",
1813
- values: [
1814
- {
1815
- value: "Spreadsheet",
1816
- relationType: "EQUALS",
1817
- },
1818
- {
1819
- value: "Presentation",
1820
- relationType: "EQUALS",
1821
- },
1822
- ],
1823
- },
1824
- ],
1825
- documentId: "<id>",
1826
- },
1827
- {
1828
- audienceFilters: [
1829
- {
1830
- fieldName: "type",
1831
- values: [
1832
- {
1833
- value: "Spreadsheet",
1834
- relationType: "EQUALS",
1835
- },
1836
- {
1837
- value: "Presentation",
1838
- relationType: "EQUALS",
1839
- },
1840
- ],
1841
- },
1842
- ],
1843
- documentId: "<id>",
1844
- },
1845
- ],
1846
- collections: [
1847
- {
1848
- name: "<value>",
1849
- description: "how by extroverted excess kissingly scruple yearningly",
1850
- audienceFilters: [
1851
- {
1852
- fieldName: "type",
1853
- values: [
1854
- {
1855
- value: "Spreadsheet",
1856
- relationType: "EQUALS",
1857
- },
1858
- {
1859
- value: "Presentation",
1860
- relationType: "EQUALS",
1861
- },
1862
- ],
1863
- },
1864
- ],
1865
- id: 416110,
1866
- items: [
1867
- {
1868
- collectionId: 959645,
1869
- shortcut: {
1870
- inputAlias: "<value>",
1871
- },
1872
- itemType: "TEXT",
1873
- },
1874
- {
1875
- collectionId: 959645,
1876
- shortcut: {
1877
- inputAlias: "<value>",
1878
- },
1879
- itemType: "TEXT",
1880
- },
1881
- {
1882
- collectionId: 959645,
1883
- shortcut: {
1884
- inputAlias: "<value>",
1885
- },
1886
- itemType: "TEXT",
1887
- },
1888
- ],
1889
- },
1890
- {
1891
- name: "<value>",
1892
- description: "how by extroverted excess kissingly scruple yearningly",
1893
- audienceFilters: [
1894
- {
1895
- fieldName: "type",
1896
- values: [
1897
- {
1898
- value: "Spreadsheet",
1899
- relationType: "EQUALS",
1900
- },
1901
- {
1902
- value: "Presentation",
1903
- relationType: "EQUALS",
1904
- },
1905
- ],
1906
- },
1907
- ],
1908
- id: 416110,
1909
- items: [
1910
- {
1911
- collectionId: 959645,
1912
- shortcut: {
1913
- inputAlias: "<value>",
1914
- },
1915
- itemType: "TEXT",
1916
- },
1917
- {
1918
- collectionId: 959645,
1919
- shortcut: {
1920
- inputAlias: "<value>",
1921
- },
1922
- itemType: "TEXT",
1923
- },
1924
- {
1925
- collectionId: 959645,
1926
- shortcut: {
1927
- inputAlias: "<value>",
1928
- },
1929
- itemType: "TEXT",
1930
- },
1931
- ],
1932
- },
1933
- ],
1934
- interactions: {
1935
- reacts: [
1936
- {},
1937
- {},
1938
- {},
1939
- ],
1940
- shares: [
1941
- {
1942
- numDaysAgo: 927933,
1943
- },
1944
- {
1945
- numDaysAgo: 927933,
1946
- },
1947
- {
1948
- numDaysAgo: 927933,
1949
- },
1950
- ],
1951
- },
1952
- verification: {
1953
- state: "UNVERIFIED",
1954
- metadata: {
1955
- reminders: [
1956
- {
1957
- assignee: {
1958
- name: "George Clooney",
1959
- obfuscatedId: "abc123",
1960
- },
1961
- remindAt: 353914,
1962
- },
1963
- {
1964
- assignee: {
1965
- name: "George Clooney",
1966
- obfuscatedId: "abc123",
1967
- },
1968
- remindAt: 353914,
1969
- },
1970
- ],
1971
- lastReminder: {
1972
- assignee: {
1973
- name: "George Clooney",
1974
- obfuscatedId: "abc123",
1975
- },
1976
- remindAt: 314497,
1977
- },
1978
- },
1979
- },
1980
- shortcuts: [
1981
- {
1982
- inputAlias: "<value>",
1983
- },
1984
- {
1985
- inputAlias: "<value>",
1986
- },
1987
- ],
1988
- customData: {
1989
- "someCustomField": {},
1990
- },
1991
- },
1992
- },
1993
- },
1994
- ],
1995
- inputDetails: {
1996
- hasCopyPaste: true,
1997
- },
1998
- },
1999
- results: [
2000
- {
2001
- title: "title",
2002
- url: "https://example.com/foo/bar",
2003
- nativeAppUrl: "slack://foo/bar",
2004
- snippets: [
2005
- {
2006
- mimeType: "mimeType",
2007
- snippet: "snippet",
2008
- },
2009
- ],
2010
- },
2011
- ],
2012
- },
2013
- {
2014
- querySuggestion: {
2015
- query: "app:github type:pull author:mortimer",
2016
- searchProviderInfo: {
2017
- name: "Google",
2018
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
2019
- },
2020
- label: "Mortimer's PRs",
2021
- datasource: "github",
2022
- requestOptions: {
2023
- datasourceFilter: "JIRA",
2024
- datasourcesFilter: [
2025
- "JIRA",
2026
- ],
2027
- queryOverridesFacetFilters: true,
2028
- facetFilters: [
2029
- {
2030
- fieldName: "type",
2031
- values: [
2032
- {
2033
- value: "Spreadsheet",
2034
- relationType: "EQUALS",
2035
- },
2036
- {
2037
- value: "Presentation",
2038
- relationType: "EQUALS",
2039
- },
2040
- ],
2041
- },
2042
- ],
2043
- facetFilterSets: [
2044
- {
2045
- filters: [
2046
- {
2047
- fieldName: "type",
2048
- values: [
2049
- {
2050
- value: "Spreadsheet",
2051
- relationType: "EQUALS",
2052
- },
2053
- {
2054
- value: "Presentation",
2055
- relationType: "EQUALS",
2056
- },
2057
- ],
2058
- },
2059
- ],
2060
- },
2061
- {
2062
- filters: [
2063
- {
2064
- fieldName: "type",
2065
- values: [
2066
- {
2067
- value: "Spreadsheet",
2068
- relationType: "EQUALS",
2069
- },
2070
- {
2071
- value: "Presentation",
2072
- relationType: "EQUALS",
2073
- },
2074
- ],
2075
- },
2076
- ],
2077
- },
2078
- ],
2079
- facetBucketSize: 797260,
2080
- authTokens: [
2081
- {
2082
- accessToken: "123abc",
2083
- datasource: "gmail",
2084
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
2085
- tokenType: "Bearer",
2086
- authUser: "1",
2087
- },
2088
- ],
2089
- },
2090
- ranges: [
2091
- {
2092
- startIndex: 932928,
2093
- document: {
2094
- metadata: {
2095
- datasource: "datasource",
2096
- objectType: "Feature Request",
2097
- container: "container",
2098
- parentId: "JIRA_EN-1337",
2099
- mimeType: "mimeType",
2100
- documentId: "documentId",
2101
- createTime: new Date("2000-01-23T04:56:07.000Z"),
2102
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
2103
- components: [
2104
- "Backend",
2105
- "Networking",
2106
- ],
2107
- status: "[\"Done\"]",
2108
- pins: [
2109
- {
2110
- audienceFilters: [
2111
- {
2112
- fieldName: "type",
2113
- values: [
2114
- {
2115
- value: "Spreadsheet",
2116
- relationType: "EQUALS",
2117
- },
2118
- {
2119
- value: "Presentation",
2120
- relationType: "EQUALS",
2121
- },
2122
- ],
2123
- },
2124
- ],
2125
- documentId: "<id>",
2126
- },
2127
- {
2128
- audienceFilters: [
2129
- {
2130
- fieldName: "type",
2131
- values: [
2132
- {
2133
- value: "Spreadsheet",
2134
- relationType: "EQUALS",
2135
- },
2136
- {
2137
- value: "Presentation",
2138
- relationType: "EQUALS",
2139
- },
2140
- ],
2141
- },
2142
- ],
2143
- documentId: "<id>",
2144
- },
2145
- ],
2146
- collections: [
2147
- {
2148
- name: "<value>",
2149
- description: "how by extroverted excess kissingly scruple yearningly",
2150
- audienceFilters: [
2151
- {
2152
- fieldName: "type",
2153
- values: [
2154
- {
2155
- value: "Spreadsheet",
2156
- relationType: "EQUALS",
2157
- },
2158
- {
2159
- value: "Presentation",
2160
- relationType: "EQUALS",
2161
- },
2162
- ],
2163
- },
2164
- ],
2165
- id: 416110,
2166
- items: [
2167
- {
2168
- collectionId: 959645,
2169
- shortcut: {
2170
- inputAlias: "<value>",
2171
- },
2172
- itemType: "TEXT",
2173
- },
2174
- {
2175
- collectionId: 959645,
2176
- shortcut: {
2177
- inputAlias: "<value>",
2178
- },
2179
- itemType: "TEXT",
2180
- },
2181
- {
2182
- collectionId: 959645,
2183
- shortcut: {
2184
- inputAlias: "<value>",
2185
- },
2186
- itemType: "TEXT",
2187
- },
2188
- ],
2189
- },
2190
- {
2191
- name: "<value>",
2192
- description: "how by extroverted excess kissingly scruple yearningly",
2193
- audienceFilters: [
2194
- {
2195
- fieldName: "type",
2196
- values: [
2197
- {
2198
- value: "Spreadsheet",
2199
- relationType: "EQUALS",
2200
- },
2201
- {
2202
- value: "Presentation",
2203
- relationType: "EQUALS",
2204
- },
2205
- ],
2206
- },
2207
- ],
2208
- id: 416110,
2209
- items: [
2210
- {
2211
- collectionId: 959645,
2212
- shortcut: {
2213
- inputAlias: "<value>",
2214
- },
2215
- itemType: "TEXT",
2216
- },
2217
- {
2218
- collectionId: 959645,
2219
- shortcut: {
2220
- inputAlias: "<value>",
2221
- },
2222
- itemType: "TEXT",
2223
- },
2224
- {
2225
- collectionId: 959645,
2226
- shortcut: {
2227
- inputAlias: "<value>",
2228
- },
2229
- itemType: "TEXT",
2230
- },
2231
- ],
2232
- },
2233
- ],
2234
- interactions: {
2235
- reacts: [
2236
- {},
2237
- {},
2238
- {},
2239
- ],
2240
- shares: [
2241
- {
2242
- numDaysAgo: 927933,
2243
- },
2244
- {
2245
- numDaysAgo: 927933,
2246
- },
2247
- {
2248
- numDaysAgo: 927933,
2249
- },
2250
- ],
2251
- },
2252
- verification: {
2253
- state: "UNVERIFIED",
2254
- metadata: {
2255
- reminders: [
2256
- {
2257
- assignee: {
2258
- name: "George Clooney",
2259
- obfuscatedId: "abc123",
2260
- },
2261
- remindAt: 353914,
2262
- },
2263
- {
2264
- assignee: {
2265
- name: "George Clooney",
2266
- obfuscatedId: "abc123",
2267
- },
2268
- remindAt: 353914,
2269
- },
2270
- ],
2271
- lastReminder: {
2272
- assignee: {
2273
- name: "George Clooney",
2274
- obfuscatedId: "abc123",
2275
- },
2276
- remindAt: 314497,
2277
- },
2278
- },
2279
- },
2280
- shortcuts: [
2281
- {
2282
- inputAlias: "<value>",
2283
- },
2284
- {
2285
- inputAlias: "<value>",
2286
- },
2287
- ],
2288
- customData: {
2289
- "someCustomField": {},
2290
- },
2291
- },
2292
- },
2293
- },
2294
- ],
2295
- inputDetails: {
2296
- hasCopyPaste: true,
2297
- },
2298
- },
2299
- results: [
2300
- {
2301
- title: "title",
2302
- url: "https://example.com/foo/bar",
2303
- nativeAppUrl: "slack://foo/bar",
2304
- snippets: [
2305
- {
2306
- mimeType: "mimeType",
2307
- snippet: "snippet",
2308
- },
2309
- ],
2310
- },
2311
- ],
2312
- },
2313
- {
2314
- querySuggestion: {
2315
- query: "app:github type:pull author:mortimer",
2316
- searchProviderInfo: {
2317
- name: "Google",
2318
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
2319
- },
2320
- label: "Mortimer's PRs",
2321
- datasource: "github",
2322
- requestOptions: {
2323
- datasourceFilter: "JIRA",
2324
- datasourcesFilter: [
2325
- "JIRA",
2326
- ],
2327
- queryOverridesFacetFilters: true,
2328
- facetFilters: [
2329
- {
2330
- fieldName: "type",
2331
- values: [
2332
- {
2333
- value: "Spreadsheet",
2334
- relationType: "EQUALS",
2335
- },
2336
- {
2337
- value: "Presentation",
2338
- relationType: "EQUALS",
2339
- },
2340
- ],
2341
- },
2342
- ],
2343
- facetFilterSets: [
2344
- {
2345
- filters: [
2346
- {
2347
- fieldName: "type",
2348
- values: [
2349
- {
2350
- value: "Spreadsheet",
2351
- relationType: "EQUALS",
2352
- },
2353
- {
2354
- value: "Presentation",
2355
- relationType: "EQUALS",
2356
- },
2357
- ],
2358
- },
2359
- ],
2360
- },
2361
- {
2362
- filters: [
2363
- {
2364
- fieldName: "type",
2365
- values: [
2366
- {
2367
- value: "Spreadsheet",
2368
- relationType: "EQUALS",
2369
- },
2370
- {
2371
- value: "Presentation",
2372
- relationType: "EQUALS",
2373
- },
2374
- ],
2375
- },
2376
- ],
2377
- },
2378
- ],
2379
- facetBucketSize: 797260,
2380
- authTokens: [
2381
- {
2382
- accessToken: "123abc",
2383
- datasource: "gmail",
2384
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
2385
- tokenType: "Bearer",
2386
- authUser: "1",
2387
- },
2388
- ],
2389
- },
2390
- ranges: [
2391
- {
2392
- startIndex: 932928,
2393
- document: {
2394
- metadata: {
2395
- datasource: "datasource",
2396
- objectType: "Feature Request",
2397
- container: "container",
2398
- parentId: "JIRA_EN-1337",
2399
- mimeType: "mimeType",
2400
- documentId: "documentId",
2401
- createTime: new Date("2000-01-23T04:56:07.000Z"),
2402
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
2403
- components: [
2404
- "Backend",
2405
- "Networking",
2406
- ],
2407
- status: "[\"Done\"]",
2408
- pins: [
2409
- {
2410
- audienceFilters: [
2411
- {
2412
- fieldName: "type",
2413
- values: [
2414
- {
2415
- value: "Spreadsheet",
2416
- relationType: "EQUALS",
2417
- },
2418
- {
2419
- value: "Presentation",
2420
- relationType: "EQUALS",
2421
- },
2422
- ],
2423
- },
2424
- ],
2425
- documentId: "<id>",
2426
- },
2427
- {
2428
- audienceFilters: [
2429
- {
2430
- fieldName: "type",
2431
- values: [
2432
- {
2433
- value: "Spreadsheet",
2434
- relationType: "EQUALS",
2435
- },
2436
- {
2437
- value: "Presentation",
2438
- relationType: "EQUALS",
2439
- },
2440
- ],
2441
- },
2442
- ],
2443
- documentId: "<id>",
2444
- },
2445
- ],
2446
- collections: [
2447
- {
2448
- name: "<value>",
2449
- description: "how by extroverted excess kissingly scruple yearningly",
2450
- audienceFilters: [
2451
- {
2452
- fieldName: "type",
2453
- values: [
2454
- {
2455
- value: "Spreadsheet",
2456
- relationType: "EQUALS",
2457
- },
2458
- {
2459
- value: "Presentation",
2460
- relationType: "EQUALS",
2461
- },
2462
- ],
2463
- },
2464
- ],
2465
- id: 416110,
2466
- items: [
2467
- {
2468
- collectionId: 959645,
2469
- shortcut: {
2470
- inputAlias: "<value>",
2471
- },
2472
- itemType: "TEXT",
2473
- },
2474
- {
2475
- collectionId: 959645,
2476
- shortcut: {
2477
- inputAlias: "<value>",
2478
- },
2479
- itemType: "TEXT",
2480
- },
2481
- {
2482
- collectionId: 959645,
2483
- shortcut: {
2484
- inputAlias: "<value>",
2485
- },
2486
- itemType: "TEXT",
2487
- },
2488
- ],
2489
- },
2490
- {
2491
- name: "<value>",
2492
- description: "how by extroverted excess kissingly scruple yearningly",
2493
- audienceFilters: [
2494
- {
2495
- fieldName: "type",
2496
- values: [
2497
- {
2498
- value: "Spreadsheet",
2499
- relationType: "EQUALS",
2500
- },
2501
- {
2502
- value: "Presentation",
2503
- relationType: "EQUALS",
2504
- },
2505
- ],
2506
- },
2507
- ],
2508
- id: 416110,
2509
- items: [
2510
- {
2511
- collectionId: 959645,
2512
- shortcut: {
2513
- inputAlias: "<value>",
2514
- },
2515
- itemType: "TEXT",
2516
- },
2517
- {
2518
- collectionId: 959645,
2519
- shortcut: {
2520
- inputAlias: "<value>",
2521
- },
2522
- itemType: "TEXT",
2523
- },
2524
- {
2525
- collectionId: 959645,
2526
- shortcut: {
2527
- inputAlias: "<value>",
2528
- },
2529
- itemType: "TEXT",
2530
- },
2531
- ],
2532
- },
2533
- ],
2534
- interactions: {
2535
- reacts: [
2536
- {},
2537
- {},
2538
- {},
2539
- ],
2540
- shares: [
2541
- {
2542
- numDaysAgo: 927933,
2543
- },
2544
- {
2545
- numDaysAgo: 927933,
2546
- },
2547
- {
2548
- numDaysAgo: 927933,
2549
- },
2550
- ],
2551
- },
2552
- verification: {
2553
- state: "UNVERIFIED",
2554
- metadata: {
2555
- reminders: [
2556
- {
2557
- assignee: {
2558
- name: "George Clooney",
2559
- obfuscatedId: "abc123",
2560
- },
2561
- remindAt: 353914,
2562
- },
2563
- {
2564
- assignee: {
2565
- name: "George Clooney",
2566
- obfuscatedId: "abc123",
2567
- },
2568
- remindAt: 353914,
2569
- },
2570
- ],
2571
- lastReminder: {
2572
- assignee: {
2573
- name: "George Clooney",
2574
- obfuscatedId: "abc123",
2575
- },
2576
- remindAt: 314497,
2577
- },
2578
- },
2579
- },
2580
- shortcuts: [
2581
- {
2582
- inputAlias: "<value>",
2583
- },
2584
- {
2585
- inputAlias: "<value>",
2586
- },
2587
- ],
2588
- customData: {
2589
- "someCustomField": {},
2590
- },
2591
- },
2592
- },
2593
- },
2594
- ],
2595
- inputDetails: {
2596
- hasCopyPaste: true,
2597
- },
2598
- },
2599
- results: [
2600
- {
2601
- title: "title",
2602
- url: "https://example.com/foo/bar",
2603
- nativeAppUrl: "slack://foo/bar",
2604
- snippets: [
2605
- {
2606
- mimeType: "mimeType",
2607
- snippet: "snippet",
2608
- },
2609
- ],
2610
- },
2611
- ],
2612
- },
2613
- ],
2614
- metadata: {
2615
- type: "FULL_TIME",
2616
- title: "Actor",
2617
- department: "Movies",
2618
- email: "george@example.com",
2619
- location: "Hollywood, CA",
2620
- phone: "6505551234",
2621
- photoUrl: "https://example.com/george.jpg",
2622
- startDate: new RFCDate("2000-01-23"),
2623
- datasourceProfile: [
2624
- {
2625
- datasource: "github",
2626
- handle: "<value>",
2627
- },
2628
- {
2629
- datasource: "github",
2630
- handle: "<value>",
2631
- },
2632
- {
2633
- datasource: "github",
2634
- handle: "<value>",
2635
- },
2636
- ],
2637
- querySuggestions: {
2638
- suggestions: [
2639
- {
2640
- query: "app:github type:pull author:mortimer",
2641
- label: "Mortimer's PRs",
2642
- datasource: "github",
2643
- },
2644
- ],
2645
- },
2646
- inviteInfo: {
2647
- invites: [
2648
- {},
2649
- {},
2650
- {},
2651
- ],
2652
- },
2653
- customFields: [
2654
- {
2655
- label: "<value>",
2656
- values: [
2657
- {},
2658
- {},
2659
- {},
2660
- ],
2661
- },
2662
- ],
2663
- badges: [
2664
- {
2665
- key: "deployment_name_new_hire",
2666
- displayName: "New hire",
2667
- iconConfig: {
2668
- color: "#343CED",
2669
- key: "person_icon",
2670
- iconType: "GLYPH",
2671
- name: "user",
2672
- },
2673
- },
2674
- ],
2675
- },
2676
- },
2677
- role: "OWNER",
2678
- },
2679
- ],
2680
- removedRoles: [
2681
- {
2682
- person: {
2683
- name: "George Clooney",
2684
- obfuscatedId: "abc123",
2685
- metadata: {
2686
- type: "FULL_TIME",
2687
- title: "Actor",
2688
- department: "Movies",
2689
- email: "george@example.com",
2690
- location: "Hollywood, CA",
2691
- phone: "6505551234",
2692
- photoUrl: "https://example.com/george.jpg",
2693
- startDate: new RFCDate("2000-01-23"),
2694
- datasourceProfile: [
2695
- {
2696
- datasource: "github",
2697
- handle: "<value>",
2698
- },
2699
- {
2700
- datasource: "github",
2701
- handle: "<value>",
2702
- },
2703
- {
2704
- datasource: "github",
2705
- handle: "<value>",
2706
- },
2707
- ],
2708
- querySuggestions: {
2709
- suggestions: [
2710
- {
2711
- query: "app:github type:pull author:mortimer",
2712
- label: "Mortimer's PRs",
2713
- datasource: "github",
2714
- },
2715
- ],
2716
- },
2717
- inviteInfo: {
2718
- invites: [
2719
- {},
2720
- {},
2721
- {},
2722
- ],
2723
- },
2724
- badges: [
2725
- {
2726
- key: "deployment_name_new_hire",
2727
- displayName: "New hire",
2728
- iconConfig: {
2729
- color: "#343CED",
2730
- key: "person_icon",
2731
- iconType: "GLYPH",
2732
- name: "user",
2733
- },
2734
- },
2735
- ],
2736
- },
2737
- },
2738
- role: "ANSWER_MODERATOR",
2739
- },
2740
- ],
2741
- audienceFilters: [
2742
- {
2743
- fieldName: "type",
2744
- values: [
2745
- {
2746
- value: "Spreadsheet",
2747
- relationType: "EQUALS",
2748
- },
2749
- {
2750
- value: "Presentation",
2751
- relationType: "EQUALS",
2752
- },
2753
- ],
2754
- },
2755
- ],
2756
- id: 671264,
2757
- });
2758
-
2759
- console.log(result);
2760
- }
2761
-
2762
- run();
2763
- ```
2764
-
2765
- ### Standalone function
2766
-
2767
- The standalone function version of this method:
2768
-
2769
- ```typescript
2770
- import { GleanCore } from "@gleanwork/api-client/core.js";
2771
- import { clientCollectionsUpdate } from "@gleanwork/api-client/funcs/clientCollectionsUpdate.js";
2772
- import { RFCDate } from "@gleanwork/api-client/types";
2773
-
2774
- // Use `GleanCore` for best tree-shaking performance.
2775
- // You can create one instance of it to use across an application.
2776
- const glean = new GleanCore({
2777
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
2778
- });
2779
-
2780
- async function run() {
2781
- const res = await clientCollectionsUpdate(glean, {
2782
- name: "<value>",
2783
- addedRoles: [
2784
- {
2785
- person: {
2786
- name: "George Clooney",
2787
- obfuscatedId: "abc123",
2788
- relatedDocuments: [
2789
- {
2790
- querySuggestion: {
2791
- query: "app:github type:pull author:mortimer",
2792
- searchProviderInfo: {
2793
- name: "Google",
2794
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
2795
- },
2796
- label: "Mortimer's PRs",
2797
- datasource: "github",
2798
- requestOptions: {
2799
- datasourceFilter: "JIRA",
2800
- datasourcesFilter: [
2801
- "JIRA",
2802
- ],
2803
- queryOverridesFacetFilters: true,
2804
- facetFilters: [
2805
- {
2806
- fieldName: "type",
2807
- values: [
2808
- {
2809
- value: "Spreadsheet",
2810
- relationType: "EQUALS",
2811
- },
2812
- {
2813
- value: "Presentation",
2814
- relationType: "EQUALS",
2815
- },
2816
- ],
2817
- },
2818
- ],
2819
- facetFilterSets: [
2820
- {
2821
- filters: [
2822
- {
2823
- fieldName: "type",
2824
- values: [
2825
- {
2826
- value: "Spreadsheet",
2827
- relationType: "EQUALS",
2828
- },
2829
- {
2830
- value: "Presentation",
2831
- relationType: "EQUALS",
2832
- },
2833
- ],
2834
- },
2835
- ],
2836
- },
2837
- {
2838
- filters: [
2839
- {
2840
- fieldName: "type",
2841
- values: [
2842
- {
2843
- value: "Spreadsheet",
2844
- relationType: "EQUALS",
2845
- },
2846
- {
2847
- value: "Presentation",
2848
- relationType: "EQUALS",
2849
- },
2850
- ],
2851
- },
2852
- ],
2853
- },
2854
- ],
2855
- facetBucketSize: 797260,
2856
- authTokens: [
2857
- {
2858
- accessToken: "123abc",
2859
- datasource: "gmail",
2860
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
2861
- tokenType: "Bearer",
2862
- authUser: "1",
2863
- },
2864
- ],
2865
- },
2866
- ranges: [
2867
- {
2868
- startIndex: 932928,
2869
- document: {
2870
- metadata: {
2871
- datasource: "datasource",
2872
- objectType: "Feature Request",
2873
- container: "container",
2874
- parentId: "JIRA_EN-1337",
2875
- mimeType: "mimeType",
2876
- documentId: "documentId",
2877
- createTime: new Date("2000-01-23T04:56:07.000Z"),
2878
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
2879
- components: [
2880
- "Backend",
2881
- "Networking",
2882
- ],
2883
- status: "[\"Done\"]",
2884
- pins: [
2885
- {
2886
- audienceFilters: [
2887
- {
2888
- fieldName: "type",
2889
- values: [
2890
- {
2891
- value: "Spreadsheet",
2892
- relationType: "EQUALS",
2893
- },
2894
- {
2895
- value: "Presentation",
2896
- relationType: "EQUALS",
2897
- },
2898
- ],
2899
- },
2900
- ],
2901
- documentId: "<id>",
2902
- },
2903
- {
2904
- audienceFilters: [
2905
- {
2906
- fieldName: "type",
2907
- values: [
2908
- {
2909
- value: "Spreadsheet",
2910
- relationType: "EQUALS",
2911
- },
2912
- {
2913
- value: "Presentation",
2914
- relationType: "EQUALS",
2915
- },
2916
- ],
2917
- },
2918
- ],
2919
- documentId: "<id>",
2920
- },
2921
- ],
2922
- collections: [
2923
- {
2924
- name: "<value>",
2925
- description: "how by extroverted excess kissingly scruple yearningly",
2926
- audienceFilters: [
2927
- {
2928
- fieldName: "type",
2929
- values: [
2930
- {
2931
- value: "Spreadsheet",
2932
- relationType: "EQUALS",
2933
- },
2934
- {
2935
- value: "Presentation",
2936
- relationType: "EQUALS",
2937
- },
2938
- ],
2939
- },
2940
- ],
2941
- id: 416110,
2942
- items: [
2943
- {
2944
- collectionId: 959645,
2945
- shortcut: {
2946
- inputAlias: "<value>",
2947
- },
2948
- itemType: "TEXT",
2949
- },
2950
- {
2951
- collectionId: 959645,
2952
- shortcut: {
2953
- inputAlias: "<value>",
2954
- },
2955
- itemType: "TEXT",
2956
- },
2957
- {
2958
- collectionId: 959645,
2959
- shortcut: {
2960
- inputAlias: "<value>",
2961
- },
2962
- itemType: "TEXT",
2963
- },
2964
- ],
2965
- },
2966
- {
2967
- name: "<value>",
2968
- description: "how by extroverted excess kissingly scruple yearningly",
2969
- audienceFilters: [
2970
- {
2971
- fieldName: "type",
2972
- values: [
2973
- {
2974
- value: "Spreadsheet",
2975
- relationType: "EQUALS",
2976
- },
2977
- {
2978
- value: "Presentation",
2979
- relationType: "EQUALS",
2980
- },
2981
- ],
2982
- },
2983
- ],
2984
- id: 416110,
2985
- items: [
2986
- {
2987
- collectionId: 959645,
2988
- shortcut: {
2989
- inputAlias: "<value>",
2990
- },
2991
- itemType: "TEXT",
2992
- },
2993
- {
2994
- collectionId: 959645,
2995
- shortcut: {
2996
- inputAlias: "<value>",
2997
- },
2998
- itemType: "TEXT",
2999
- },
3000
- {
3001
- collectionId: 959645,
3002
- shortcut: {
3003
- inputAlias: "<value>",
3004
- },
3005
- itemType: "TEXT",
3006
- },
3007
- ],
3008
- },
3009
- ],
3010
- interactions: {
3011
- reacts: [
3012
- {},
3013
- {},
3014
- {},
3015
- ],
3016
- shares: [
3017
- {
3018
- numDaysAgo: 927933,
3019
- },
3020
- {
3021
- numDaysAgo: 927933,
3022
- },
3023
- {
3024
- numDaysAgo: 927933,
3025
- },
3026
- ],
3027
- },
3028
- verification: {
3029
- state: "UNVERIFIED",
3030
- metadata: {
3031
- reminders: [
3032
- {
3033
- assignee: {
3034
- name: "George Clooney",
3035
- obfuscatedId: "abc123",
3036
- },
3037
- remindAt: 353914,
3038
- },
3039
- {
3040
- assignee: {
3041
- name: "George Clooney",
3042
- obfuscatedId: "abc123",
3043
- },
3044
- remindAt: 353914,
3045
- },
3046
- ],
3047
- lastReminder: {
3048
- assignee: {
3049
- name: "George Clooney",
3050
- obfuscatedId: "abc123",
3051
- },
3052
- remindAt: 314497,
3053
- },
3054
- },
3055
- },
3056
- shortcuts: [
3057
- {
3058
- inputAlias: "<value>",
3059
- },
3060
- {
3061
- inputAlias: "<value>",
3062
- },
3063
- ],
3064
- customData: {
3065
- "someCustomField": {},
3066
- },
3067
- },
3068
- },
3069
- },
3070
- ],
3071
- inputDetails: {
3072
- hasCopyPaste: true,
3073
- },
3074
- },
3075
- results: [
3076
- {
3077
- title: "title",
3078
- url: "https://example.com/foo/bar",
3079
- nativeAppUrl: "slack://foo/bar",
3080
- snippets: [
3081
- {
3082
- mimeType: "mimeType",
3083
- snippet: "snippet",
3084
- },
3085
- ],
3086
- },
3087
- ],
3088
- },
3089
- {
3090
- querySuggestion: {
3091
- query: "app:github type:pull author:mortimer",
3092
- searchProviderInfo: {
3093
- name: "Google",
3094
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
3095
- },
3096
- label: "Mortimer's PRs",
3097
- datasource: "github",
3098
- requestOptions: {
3099
- datasourceFilter: "JIRA",
3100
- datasourcesFilter: [
3101
- "JIRA",
3102
- ],
3103
- queryOverridesFacetFilters: true,
3104
- facetFilters: [
3105
- {
3106
- fieldName: "type",
3107
- values: [
3108
- {
3109
- value: "Spreadsheet",
3110
- relationType: "EQUALS",
3111
- },
3112
- {
3113
- value: "Presentation",
3114
- relationType: "EQUALS",
3115
- },
3116
- ],
3117
- },
3118
- ],
3119
- facetFilterSets: [
3120
- {
3121
- filters: [
3122
- {
3123
- fieldName: "type",
3124
- values: [
3125
- {
3126
- value: "Spreadsheet",
3127
- relationType: "EQUALS",
3128
- },
3129
- {
3130
- value: "Presentation",
3131
- relationType: "EQUALS",
3132
- },
3133
- ],
3134
- },
3135
- ],
3136
- },
3137
- {
3138
- filters: [
3139
- {
3140
- fieldName: "type",
3141
- values: [
3142
- {
3143
- value: "Spreadsheet",
3144
- relationType: "EQUALS",
3145
- },
3146
- {
3147
- value: "Presentation",
3148
- relationType: "EQUALS",
3149
- },
3150
- ],
3151
- },
3152
- ],
3153
- },
3154
- ],
3155
- facetBucketSize: 797260,
3156
- authTokens: [
3157
- {
3158
- accessToken: "123abc",
3159
- datasource: "gmail",
3160
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
3161
- tokenType: "Bearer",
3162
- authUser: "1",
3163
- },
3164
- ],
3165
- },
3166
- ranges: [
3167
- {
3168
- startIndex: 932928,
3169
- document: {
3170
- metadata: {
3171
- datasource: "datasource",
3172
- objectType: "Feature Request",
3173
- container: "container",
3174
- parentId: "JIRA_EN-1337",
3175
- mimeType: "mimeType",
3176
- documentId: "documentId",
3177
- createTime: new Date("2000-01-23T04:56:07.000Z"),
3178
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
3179
- components: [
3180
- "Backend",
3181
- "Networking",
3182
- ],
3183
- status: "[\"Done\"]",
3184
- pins: [
3185
- {
3186
- audienceFilters: [
3187
- {
3188
- fieldName: "type",
3189
- values: [
3190
- {
3191
- value: "Spreadsheet",
3192
- relationType: "EQUALS",
3193
- },
3194
- {
3195
- value: "Presentation",
3196
- relationType: "EQUALS",
3197
- },
3198
- ],
3199
- },
3200
- ],
3201
- documentId: "<id>",
3202
- },
3203
- {
3204
- audienceFilters: [
3205
- {
3206
- fieldName: "type",
3207
- values: [
3208
- {
3209
- value: "Spreadsheet",
3210
- relationType: "EQUALS",
3211
- },
3212
- {
3213
- value: "Presentation",
3214
- relationType: "EQUALS",
3215
- },
3216
- ],
3217
- },
3218
- ],
3219
- documentId: "<id>",
3220
- },
3221
- ],
3222
- collections: [
3223
- {
3224
- name: "<value>",
3225
- description: "how by extroverted excess kissingly scruple yearningly",
3226
- audienceFilters: [
3227
- {
3228
- fieldName: "type",
3229
- values: [
3230
- {
3231
- value: "Spreadsheet",
3232
- relationType: "EQUALS",
3233
- },
3234
- {
3235
- value: "Presentation",
3236
- relationType: "EQUALS",
3237
- },
3238
- ],
3239
- },
3240
- ],
3241
- id: 416110,
3242
- items: [
3243
- {
3244
- collectionId: 959645,
3245
- shortcut: {
3246
- inputAlias: "<value>",
3247
- },
3248
- itemType: "TEXT",
3249
- },
3250
- {
3251
- collectionId: 959645,
3252
- shortcut: {
3253
- inputAlias: "<value>",
3254
- },
3255
- itemType: "TEXT",
3256
- },
3257
- {
3258
- collectionId: 959645,
3259
- shortcut: {
3260
- inputAlias: "<value>",
3261
- },
3262
- itemType: "TEXT",
3263
- },
3264
- ],
3265
- },
3266
- {
3267
- name: "<value>",
3268
- description: "how by extroverted excess kissingly scruple yearningly",
3269
- audienceFilters: [
3270
- {
3271
- fieldName: "type",
3272
- values: [
3273
- {
3274
- value: "Spreadsheet",
3275
- relationType: "EQUALS",
3276
- },
3277
- {
3278
- value: "Presentation",
3279
- relationType: "EQUALS",
3280
- },
3281
- ],
3282
- },
3283
- ],
3284
- id: 416110,
3285
- items: [
3286
- {
3287
- collectionId: 959645,
3288
- shortcut: {
3289
- inputAlias: "<value>",
3290
- },
3291
- itemType: "TEXT",
3292
- },
3293
- {
3294
- collectionId: 959645,
3295
- shortcut: {
3296
- inputAlias: "<value>",
3297
- },
3298
- itemType: "TEXT",
3299
- },
3300
- {
3301
- collectionId: 959645,
3302
- shortcut: {
3303
- inputAlias: "<value>",
3304
- },
3305
- itemType: "TEXT",
3306
- },
3307
- ],
3308
- },
3309
- ],
3310
- interactions: {
3311
- reacts: [
3312
- {},
3313
- {},
3314
- {},
3315
- ],
3316
- shares: [
3317
- {
3318
- numDaysAgo: 927933,
3319
- },
3320
- {
3321
- numDaysAgo: 927933,
3322
- },
3323
- {
3324
- numDaysAgo: 927933,
3325
- },
3326
- ],
3327
- },
3328
- verification: {
3329
- state: "UNVERIFIED",
3330
- metadata: {
3331
- reminders: [
3332
- {
3333
- assignee: {
3334
- name: "George Clooney",
3335
- obfuscatedId: "abc123",
3336
- },
3337
- remindAt: 353914,
3338
- },
3339
- {
3340
- assignee: {
3341
- name: "George Clooney",
3342
- obfuscatedId: "abc123",
3343
- },
3344
- remindAt: 353914,
3345
- },
3346
- ],
3347
- lastReminder: {
3348
- assignee: {
3349
- name: "George Clooney",
3350
- obfuscatedId: "abc123",
3351
- },
3352
- remindAt: 314497,
3353
- },
3354
- },
3355
- },
3356
- shortcuts: [
3357
- {
3358
- inputAlias: "<value>",
3359
- },
3360
- {
3361
- inputAlias: "<value>",
3362
- },
3363
- ],
3364
- customData: {
3365
- "someCustomField": {},
3366
- },
3367
- },
3368
- },
3369
- },
3370
- ],
3371
- inputDetails: {
3372
- hasCopyPaste: true,
3373
- },
3374
- },
3375
- results: [
3376
- {
3377
- title: "title",
3378
- url: "https://example.com/foo/bar",
3379
- nativeAppUrl: "slack://foo/bar",
3380
- snippets: [
3381
- {
3382
- mimeType: "mimeType",
3383
- snippet: "snippet",
3384
- },
3385
- ],
3386
- },
3387
- ],
3388
- },
3389
- {
3390
- querySuggestion: {
3391
- query: "app:github type:pull author:mortimer",
3392
- searchProviderInfo: {
3393
- name: "Google",
3394
- searchLinkUrlTemplate: "https://www.google.com/search?q={query}&hl=en",
3395
- },
3396
- label: "Mortimer's PRs",
3397
- datasource: "github",
3398
- requestOptions: {
3399
- datasourceFilter: "JIRA",
3400
- datasourcesFilter: [
3401
- "JIRA",
3402
- ],
3403
- queryOverridesFacetFilters: true,
3404
- facetFilters: [
3405
- {
3406
- fieldName: "type",
3407
- values: [
3408
- {
3409
- value: "Spreadsheet",
3410
- relationType: "EQUALS",
3411
- },
3412
- {
3413
- value: "Presentation",
3414
- relationType: "EQUALS",
3415
- },
3416
- ],
3417
- },
3418
- ],
3419
- facetFilterSets: [
3420
- {
3421
- filters: [
3422
- {
3423
- fieldName: "type",
3424
- values: [
3425
- {
3426
- value: "Spreadsheet",
3427
- relationType: "EQUALS",
3428
- },
3429
- {
3430
- value: "Presentation",
3431
- relationType: "EQUALS",
3432
- },
3433
- ],
3434
- },
3435
- ],
3436
- },
3437
- {
3438
- filters: [
3439
- {
3440
- fieldName: "type",
3441
- values: [
3442
- {
3443
- value: "Spreadsheet",
3444
- relationType: "EQUALS",
3445
- },
3446
- {
3447
- value: "Presentation",
3448
- relationType: "EQUALS",
3449
- },
3450
- ],
3451
- },
3452
- ],
3453
- },
3454
- ],
3455
- facetBucketSize: 797260,
3456
- authTokens: [
3457
- {
3458
- accessToken: "123abc",
3459
- datasource: "gmail",
3460
- scope: "email profile https://www.googleapis.com/auth/gmail.readonly",
3461
- tokenType: "Bearer",
3462
- authUser: "1",
3463
- },
3464
- ],
3465
- },
3466
- ranges: [
3467
- {
3468
- startIndex: 932928,
3469
- document: {
3470
- metadata: {
3471
- datasource: "datasource",
3472
- objectType: "Feature Request",
3473
- container: "container",
3474
- parentId: "JIRA_EN-1337",
3475
- mimeType: "mimeType",
3476
- documentId: "documentId",
3477
- createTime: new Date("2000-01-23T04:56:07.000Z"),
3478
- updateTime: new Date("2000-01-23T04:56:07.000Z"),
3479
- components: [
3480
- "Backend",
3481
- "Networking",
3482
- ],
3483
- status: "[\"Done\"]",
3484
- pins: [
3485
- {
3486
- audienceFilters: [
3487
- {
3488
- fieldName: "type",
3489
- values: [
3490
- {
3491
- value: "Spreadsheet",
3492
- relationType: "EQUALS",
3493
- },
3494
- {
3495
- value: "Presentation",
3496
- relationType: "EQUALS",
3497
- },
3498
- ],
3499
- },
3500
- ],
3501
- documentId: "<id>",
3502
- },
3503
- {
3504
- audienceFilters: [
3505
- {
3506
- fieldName: "type",
3507
- values: [
3508
- {
3509
- value: "Spreadsheet",
3510
- relationType: "EQUALS",
3511
- },
3512
- {
3513
- value: "Presentation",
3514
- relationType: "EQUALS",
3515
- },
3516
- ],
3517
- },
3518
- ],
3519
- documentId: "<id>",
3520
- },
3521
- ],
3522
- collections: [
3523
- {
3524
- name: "<value>",
3525
- description: "how by extroverted excess kissingly scruple yearningly",
3526
- audienceFilters: [
3527
- {
3528
- fieldName: "type",
3529
- values: [
3530
- {
3531
- value: "Spreadsheet",
3532
- relationType: "EQUALS",
3533
- },
3534
- {
3535
- value: "Presentation",
3536
- relationType: "EQUALS",
3537
- },
3538
- ],
3539
- },
3540
- ],
3541
- id: 416110,
3542
- items: [
3543
- {
3544
- collectionId: 959645,
3545
- shortcut: {
3546
- inputAlias: "<value>",
3547
- },
3548
- itemType: "TEXT",
3549
- },
3550
- {
3551
- collectionId: 959645,
3552
- shortcut: {
3553
- inputAlias: "<value>",
3554
- },
3555
- itemType: "TEXT",
3556
- },
3557
- {
3558
- collectionId: 959645,
3559
- shortcut: {
3560
- inputAlias: "<value>",
3561
- },
3562
- itemType: "TEXT",
3563
- },
3564
- ],
3565
- },
3566
- {
3567
- name: "<value>",
3568
- description: "how by extroverted excess kissingly scruple yearningly",
3569
- audienceFilters: [
3570
- {
3571
- fieldName: "type",
3572
- values: [
3573
- {
3574
- value: "Spreadsheet",
3575
- relationType: "EQUALS",
3576
- },
3577
- {
3578
- value: "Presentation",
3579
- relationType: "EQUALS",
3580
- },
3581
- ],
3582
- },
3583
- ],
3584
- id: 416110,
3585
- items: [
3586
- {
3587
- collectionId: 959645,
3588
- shortcut: {
3589
- inputAlias: "<value>",
3590
- },
3591
- itemType: "TEXT",
3592
- },
3593
- {
3594
- collectionId: 959645,
3595
- shortcut: {
3596
- inputAlias: "<value>",
3597
- },
3598
- itemType: "TEXT",
3599
- },
3600
- {
3601
- collectionId: 959645,
3602
- shortcut: {
3603
- inputAlias: "<value>",
3604
- },
3605
- itemType: "TEXT",
3606
- },
3607
- ],
3608
- },
3609
- ],
3610
- interactions: {
3611
- reacts: [
3612
- {},
3613
- {},
3614
- {},
3615
- ],
3616
- shares: [
3617
- {
3618
- numDaysAgo: 927933,
3619
- },
3620
- {
3621
- numDaysAgo: 927933,
3622
- },
3623
- {
3624
- numDaysAgo: 927933,
3625
- },
3626
- ],
3627
- },
3628
- verification: {
3629
- state: "UNVERIFIED",
3630
- metadata: {
3631
- reminders: [
3632
- {
3633
- assignee: {
3634
- name: "George Clooney",
3635
- obfuscatedId: "abc123",
3636
- },
3637
- remindAt: 353914,
3638
- },
3639
- {
3640
- assignee: {
3641
- name: "George Clooney",
3642
- obfuscatedId: "abc123",
3643
- },
3644
- remindAt: 353914,
3645
- },
3646
- ],
3647
- lastReminder: {
3648
- assignee: {
3649
- name: "George Clooney",
3650
- obfuscatedId: "abc123",
3651
- },
3652
- remindAt: 314497,
3653
- },
3654
- },
3655
- },
3656
- shortcuts: [
3657
- {
3658
- inputAlias: "<value>",
3659
- },
3660
- {
3661
- inputAlias: "<value>",
3662
- },
3663
- ],
3664
- customData: {
3665
- "someCustomField": {},
3666
- },
3667
- },
3668
- },
3669
- },
3670
- ],
3671
- inputDetails: {
3672
- hasCopyPaste: true,
3673
- },
3674
- },
3675
- results: [
3676
- {
3677
- title: "title",
3678
- url: "https://example.com/foo/bar",
3679
- nativeAppUrl: "slack://foo/bar",
3680
- snippets: [
3681
- {
3682
- mimeType: "mimeType",
3683
- snippet: "snippet",
3684
- },
3685
- ],
3686
- },
3687
- ],
3688
- },
3689
- ],
3690
- metadata: {
3691
- type: "FULL_TIME",
3692
- title: "Actor",
3693
- department: "Movies",
3694
- email: "george@example.com",
3695
- location: "Hollywood, CA",
3696
- phone: "6505551234",
3697
- photoUrl: "https://example.com/george.jpg",
3698
- startDate: new RFCDate("2000-01-23"),
3699
- datasourceProfile: [
3700
- {
3701
- datasource: "github",
3702
- handle: "<value>",
3703
- },
3704
- {
3705
- datasource: "github",
3706
- handle: "<value>",
3707
- },
3708
- {
3709
- datasource: "github",
3710
- handle: "<value>",
3711
- },
3712
- ],
3713
- querySuggestions: {
3714
- suggestions: [
3715
- {
3716
- query: "app:github type:pull author:mortimer",
3717
- label: "Mortimer's PRs",
3718
- datasource: "github",
3719
- },
3720
- ],
3721
- },
3722
- inviteInfo: {
3723
- invites: [
3724
- {},
3725
- {},
3726
- {},
3727
- ],
3728
- },
3729
- customFields: [
3730
- {
3731
- label: "<value>",
3732
- values: [
3733
- {},
3734
- {},
3735
- {},
3736
- ],
3737
- },
3738
- ],
3739
- badges: [
3740
- {
3741
- key: "deployment_name_new_hire",
3742
- displayName: "New hire",
3743
- iconConfig: {
3744
- color: "#343CED",
3745
- key: "person_icon",
3746
- iconType: "GLYPH",
3747
- name: "user",
3748
- },
3749
- },
3750
- ],
3751
- },
3752
- },
3753
- role: "OWNER",
3754
- },
3755
- ],
3756
- removedRoles: [
3757
- {
3758
- person: {
3759
- name: "George Clooney",
3760
- obfuscatedId: "abc123",
3761
- metadata: {
3762
- type: "FULL_TIME",
3763
- title: "Actor",
3764
- department: "Movies",
3765
- email: "george@example.com",
3766
- location: "Hollywood, CA",
3767
- phone: "6505551234",
3768
- photoUrl: "https://example.com/george.jpg",
3769
- startDate: new RFCDate("2000-01-23"),
3770
- datasourceProfile: [
3771
- {
3772
- datasource: "github",
3773
- handle: "<value>",
3774
- },
3775
- {
3776
- datasource: "github",
3777
- handle: "<value>",
3778
- },
3779
- {
3780
- datasource: "github",
3781
- handle: "<value>",
3782
- },
3783
- ],
3784
- querySuggestions: {
3785
- suggestions: [
3786
- {
3787
- query: "app:github type:pull author:mortimer",
3788
- label: "Mortimer's PRs",
3789
- datasource: "github",
3790
- },
3791
- ],
3792
- },
3793
- inviteInfo: {
3794
- invites: [
3795
- {},
3796
- {},
3797
- {},
3798
- ],
3799
- },
3800
- badges: [
3801
- {
3802
- key: "deployment_name_new_hire",
3803
- displayName: "New hire",
3804
- iconConfig: {
3805
- color: "#343CED",
3806
- key: "person_icon",
3807
- iconType: "GLYPH",
3808
- name: "user",
3809
- },
3810
- },
3811
- ],
3812
- },
3813
- },
3814
- role: "ANSWER_MODERATOR",
3815
- },
3816
- ],
3817
- audienceFilters: [
3818
- {
3819
- fieldName: "type",
3820
- values: [
3821
- {
3822
- value: "Spreadsheet",
3823
- relationType: "EQUALS",
3824
- },
3825
- {
3826
- value: "Presentation",
3827
- relationType: "EQUALS",
3828
- },
3829
- ],
3830
- },
3831
- ],
3832
- id: 671264,
3833
- });
3834
- if (res.ok) {
3835
- const { value: result } = res;
3836
- console.log(result);
3837
- } else {
3838
- console.log("clientCollectionsUpdate failed:", res.error);
3839
- }
3840
- }
3841
-
3842
- run();
3843
- ```
3844
-
3845
- ### React hooks and utilities
3846
-
3847
- This method can be used in React components through the following hooks and
3848
- associated utilities.
3849
-
3850
- > Check out [this guide][hook-guide] for information about each of the utilities
3851
- > below and how to get started using React hooks.
3852
-
3853
- [hook-guide]: ../../../REACT_QUERY.md
3854
-
3855
- ```tsx
3856
- import {
3857
- // Mutation hook for triggering the API call.
3858
- useClientCollectionsUpdateMutation
3859
- } from "@gleanwork/api-client/react-query/clientCollectionsUpdate.js";
3860
- ```
3861
-
3862
- ### Parameters
3863
-
3864
- | Parameter | Type | Required | Description |
3865
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
3866
- | `request` | [components.EditCollectionRequest](../../models/components/editcollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
3867
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
3868
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
3869
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
3870
-
3871
- ### Response
3872
-
3873
- **Promise\<[components.EditCollectionResponse](../../models/components/editcollectionresponse.md)\>**
3874
-
3875
- ### Errors
3876
-
3877
- | Error Type | Status Code | Content Type |
3878
- | ---------------------- | ---------------------- | ---------------------- |
3879
- | errors.CollectionError | 422 | application/json |
3880
- | errors.GleanError | 4XX, 5XX | \*/\* |
3881
-
3882
- ## updateItem
3883
-
3884
- Update the URL, Glean Document ID, description of an item within a Collection given its ID.
3885
-
3886
- ### Example Usage
3887
-
3888
- <!-- UsageSnippet language="typescript" operationID="editcollectionitem" method="post" path="/rest/api/v1/editcollectionitem" -->
3889
- ```typescript
3890
- import { Glean } from "@gleanwork/api-client";
3891
-
3892
- const glean = new Glean({
3893
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
3894
- });
3895
-
3896
- async function run() {
3897
- const result = await glean.client.collections.updateItem({
3898
- collectionId: 142375,
3899
- itemId: "<id>",
3900
- });
3901
-
3902
- console.log(result);
3903
- }
3904
-
3905
- run();
3906
- ```
3907
-
3908
- ### Standalone function
3909
-
3910
- The standalone function version of this method:
3911
-
3912
- ```typescript
3913
- import { GleanCore } from "@gleanwork/api-client/core.js";
3914
- import { clientCollectionsUpdateItem } from "@gleanwork/api-client/funcs/clientCollectionsUpdateItem.js";
3915
-
3916
- // Use `GleanCore` for best tree-shaking performance.
3917
- // You can create one instance of it to use across an application.
3918
- const glean = new GleanCore({
3919
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
3920
- });
3921
-
3922
- async function run() {
3923
- const res = await clientCollectionsUpdateItem(glean, {
3924
- collectionId: 142375,
3925
- itemId: "<id>",
3926
- });
3927
- if (res.ok) {
3928
- const { value: result } = res;
3929
- console.log(result);
3930
- } else {
3931
- console.log("clientCollectionsUpdateItem failed:", res.error);
3932
- }
3933
- }
3934
-
3935
- run();
3936
- ```
3937
-
3938
- ### React hooks and utilities
3939
-
3940
- This method can be used in React components through the following hooks and
3941
- associated utilities.
3942
-
3943
- > Check out [this guide][hook-guide] for information about each of the utilities
3944
- > below and how to get started using React hooks.
3945
-
3946
- [hook-guide]: ../../../REACT_QUERY.md
3947
-
3948
- ```tsx
3949
- import {
3950
- // Mutation hook for triggering the API call.
3951
- useClientCollectionsUpdateItemMutation
3952
- } from "@gleanwork/api-client/react-query/clientCollectionsUpdateItem.js";
3953
- ```
3954
-
3955
- ### Parameters
3956
-
3957
- | Parameter | Type | Required | Description |
3958
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
3959
- | `request` | [components.EditCollectionItemRequest](../../models/components/editcollectionitemrequest.md) | :heavy_check_mark: | The request object to use for the request. |
3960
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
3961
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
3962
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
3963
-
3964
- ### Response
3965
-
3966
- **Promise\<[components.EditCollectionItemResponse](../../models/components/editcollectionitemresponse.md)\>**
3967
-
3968
- ### Errors
3969
-
3970
- | Error Type | Status Code | Content Type |
3971
- | ----------------- | ----------------- | ----------------- |
3972
- | errors.GleanError | 4XX, 5XX | \*/\* |
3973
-
3974
- ## retrieve
3975
-
3976
- Read the details of a Collection given its ID. Does not fetch items in this Collection.
3977
-
3978
- ### Example Usage
3979
-
3980
- <!-- UsageSnippet language="typescript" operationID="getcollection" method="post" path="/rest/api/v1/getcollection" -->
3981
- ```typescript
3982
- import { Glean } from "@gleanwork/api-client";
3983
-
3984
- const glean = new Glean({
3985
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
3986
- });
3987
-
3988
- async function run() {
3989
- const result = await glean.client.collections.retrieve({
3990
- id: 425335,
3991
- });
3992
-
3993
- console.log(result);
3994
- }
3995
-
3996
- run();
3997
- ```
3998
-
3999
- ### Standalone function
4000
-
4001
- The standalone function version of this method:
4002
-
4003
- ```typescript
4004
- import { GleanCore } from "@gleanwork/api-client/core.js";
4005
- import { clientCollectionsRetrieve } from "@gleanwork/api-client/funcs/clientCollectionsRetrieve.js";
4006
-
4007
- // Use `GleanCore` for best tree-shaking performance.
4008
- // You can create one instance of it to use across an application.
4009
- const glean = new GleanCore({
4010
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
4011
- });
4012
-
4013
- async function run() {
4014
- const res = await clientCollectionsRetrieve(glean, {
4015
- id: 425335,
4016
- });
4017
- if (res.ok) {
4018
- const { value: result } = res;
4019
- console.log(result);
4020
- } else {
4021
- console.log("clientCollectionsRetrieve failed:", res.error);
4022
- }
4023
- }
4024
-
4025
- run();
4026
- ```
4027
-
4028
- ### React hooks and utilities
4029
-
4030
- This method can be used in React components through the following hooks and
4031
- associated utilities.
4032
-
4033
- > Check out [this guide][hook-guide] for information about each of the utilities
4034
- > below and how to get started using React hooks.
4035
-
4036
- [hook-guide]: ../../../REACT_QUERY.md
4037
-
4038
- ```tsx
4039
- import {
4040
- // Mutation hook for triggering the API call.
4041
- useClientCollectionsRetrieveMutation
4042
- } from "@gleanwork/api-client/react-query/clientCollectionsRetrieve.js";
4043
- ```
4044
-
4045
- ### Parameters
4046
-
4047
- | Parameter | Type | Required | Description |
4048
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
4049
- | `request` | [components.GetCollectionRequest](../../models/components/getcollectionrequest.md) | :heavy_check_mark: | The request object to use for the request. |
4050
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
4051
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
4052
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
4053
-
4054
- ### Response
4055
-
4056
- **Promise\<[components.GetCollectionResponse](../../models/components/getcollectionresponse.md)\>**
4057
-
4058
- ### Errors
4059
-
4060
- | Error Type | Status Code | Content Type |
4061
- | ----------------- | ----------------- | ----------------- |
4062
- | errors.GleanError | 4XX, 5XX | \*/\* |
4063
-
4064
- ## list
4065
-
4066
- List all existing Collections.
4067
-
4068
- ### Example Usage
4069
-
4070
- <!-- UsageSnippet language="typescript" operationID="listcollections" method="post" path="/rest/api/v1/listcollections" -->
4071
- ```typescript
4072
- import { Glean } from "@gleanwork/api-client";
4073
-
4074
- const glean = new Glean({
4075
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
4076
- });
4077
-
4078
- async function run() {
4079
- const result = await glean.client.collections.list({});
4080
-
4081
- console.log(result);
4082
- }
4083
-
4084
- run();
4085
- ```
4086
-
4087
- ### Standalone function
4088
-
4089
- The standalone function version of this method:
4090
-
4091
- ```typescript
4092
- import { GleanCore } from "@gleanwork/api-client/core.js";
4093
- import { clientCollectionsList } from "@gleanwork/api-client/funcs/clientCollectionsList.js";
4094
-
4095
- // Use `GleanCore` for best tree-shaking performance.
4096
- // You can create one instance of it to use across an application.
4097
- const glean = new GleanCore({
4098
- apiToken: process.env["GLEAN_API_TOKEN"] ?? "",
4099
- });
4100
-
4101
- async function run() {
4102
- const res = await clientCollectionsList(glean, {});
4103
- if (res.ok) {
4104
- const { value: result } = res;
4105
- console.log(result);
4106
- } else {
4107
- console.log("clientCollectionsList failed:", res.error);
4108
- }
4109
- }
4110
-
4111
- run();
4112
- ```
4113
-
4114
- ### React hooks and utilities
4115
-
4116
- This method can be used in React components through the following hooks and
4117
- associated utilities.
4118
-
4119
- > Check out [this guide][hook-guide] for information about each of the utilities
4120
- > below and how to get started using React hooks.
4121
-
4122
- [hook-guide]: ../../../REACT_QUERY.md
4123
-
4124
- ```tsx
4125
- import {
4126
- // Mutation hook for triggering the API call.
4127
- useClientCollectionsListMutation
4128
- } from "@gleanwork/api-client/react-query/clientCollectionsList.js";
4129
- ```
4130
-
4131
- ### Parameters
4132
-
4133
- | Parameter | Type | Required | Description |
4134
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
4135
- | `request` | [components.ListCollectionsRequest](../../models/components/listcollectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
4136
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
4137
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
4138
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
4139
-
4140
- ### Response
4141
-
4142
- **Promise\<[components.ListCollectionsResponse](../../models/components/listcollectionsresponse.md)\>**
4143
-
4144
- ### Errors
4145
-
4146
- | Error Type | Status Code | Content Type |
4147
- | ----------------- | ----------------- | ----------------- |
4148
- | errors.GleanError | 4XX, 5XX | \*/\* |