@devrev/typescript-sdk 1.0.2 → 1.1.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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +31 -48
  3. package/package.json +17 -10
  4. package/.eslintignore +0 -2
  5. package/.github/workflows/npm-publish.yml +0 -27
  6. package/.prettierignore +0 -4
  7. package/.prettierrc +0 -15
  8. package/.vscode/extensions.json +0 -8
  9. package/.vscode/launch.json +0 -17
  10. package/.vscode/settings.json +0 -31
  11. package/USER_README.md +0 -16
  12. package/nodemon.json +0 -5
  13. package/src/auto-generated/beta/beta-devrev-sdk.ts +0 -1826
  14. package/src/auto-generated/internal/private-internal-devrev-sdk.ts +0 -54739
  15. package/src/auto-generated/public-devrev-sdk.ts +0 -4009
  16. package/src/beta-data-contracts.json +0 -3271
  17. package/src/client_setup.ts +0 -64
  18. package/src/private-internal-data-contracts.json +0 -98025
  19. package/src/public-data-contracts.json +0 -6922
  20. package/src/workflow/workflow.test.ts +0 -26
  21. package/src/workflow/workflow.ts +0 -54
  22. package/templates/README.md +0 -17
  23. package/templates/base/README.md +0 -8
  24. package/templates/base/data-contract-jsdoc.ejs +0 -37
  25. package/templates/base/data-contracts.ejs +0 -28
  26. package/templates/base/enum-data-contract.ejs +0 -12
  27. package/templates/base/http-client.ejs +0 -3
  28. package/templates/base/http-clients/axios-http-client.ejs +0 -138
  29. package/templates/base/http-clients/fetch-http-client.ejs +0 -224
  30. package/templates/base/interface-data-contract.ejs +0 -10
  31. package/templates/base/object-field-jsdoc.ejs +0 -28
  32. package/templates/base/route-docs.ejs +0 -30
  33. package/templates/base/route-name.ejs +0 -43
  34. package/templates/base/route-type.ejs +0 -22
  35. package/templates/base/type-data-contract.ejs +0 -15
  36. package/templates/default/README.md +0 -7
  37. package/templates/default/api.ejs +0 -64
  38. package/templates/default/procedure-call.ejs +0 -100
  39. package/templates/default/route-types.ejs +0 -26
  40. package/templates/modular/README.md +0 -7
  41. package/templates/modular/api.ejs +0 -28
  42. package/templates/modular/procedure-call.ejs +0 -100
  43. package/templates/modular/route-types.ejs +0 -18
  44. package/tsconfig.eslint.json +0 -4
  45. package/tsconfig.json +0 -25
@@ -1,1826 +0,0 @@
1
- /* eslint-disable */
2
- /* tslint:disable */
3
- /*
4
- * ---------------------------------------------------------------
5
- * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
6
- * ## ##
7
- * ## AUTHOR: acacode ##
8
- * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
9
- * ---------------------------------------------------------------
10
- */
11
-
12
- /** artifact-summary */
13
- export type ArtifactSummary = AtomBaseSummary;
14
-
15
- /** atom-base */
16
- export interface AtomBase {
17
- created_by?: UserSummary;
18
- /**
19
- * Timestamp when the object was created.
20
- * @format date-time
21
- */
22
- created_date?: string;
23
- /** Human-readable object ID unique to the Dev organization. */
24
- display_id?: string;
25
- /** Globally unique object ID. */
26
- id: string;
27
- modified_by?: UserSummary;
28
- /**
29
- * Timestamp when the object was last modified.
30
- * @format date-time
31
- */
32
- modified_date?: string;
33
- }
34
-
35
- /** atom-base-summary */
36
- export interface AtomBaseSummary {
37
- /** Human-readable object ID unique to the Dev organization. */
38
- display_id?: string;
39
- /** Globally unique object ID. */
40
- id: string;
41
- }
42
-
43
- /** capability-summary */
44
- export type CapabilitySummary = PartBaseSummary;
45
-
46
- /** conversation */
47
- export type Conversation = AtomBase & {
48
- /** Description of the conversation object. */
49
- description?: string;
50
- group?: GroupSummary;
51
- /** The latest messages on the conversation. */
52
- messages?: TimelineEntry[];
53
- /** Owner IDs for the conversation. */
54
- owned_by?: UserSummary[];
55
- /** Describes the current stage of a work item. */
56
- stage?: Stage;
57
- /** Title of the conversation object. */
58
- title?: string;
59
- };
60
-
61
- /** conversation-summary */
62
- export type ConversationSummary = AtomBaseSummary & {
63
- /** Title of the conversation object. */
64
- title?: string;
65
- };
66
-
67
- /**
68
- * conversations-create-request
69
- * The request to create a new conversation.
70
- */
71
- export interface ConversationsCreateRequest {
72
- /** Description for the conversation. */
73
- description?: string;
74
- /** The group that the conversation is associated with. */
75
- group?: string;
76
- /**
77
- * The users in the conversation.
78
- * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
79
- */
80
- members?: string[];
81
- /** Initial messages on the conversation. */
82
- messages?: ConversationsCreateRequestMessage[];
83
- /** Sets an object's initial stage. */
84
- stage?: StageInit;
85
- /** Tags associated with the conversation. */
86
- tags?: SetTagWithValue[];
87
- /** The title for the conversation. */
88
- title?: string;
89
- type: ConversationsCreateRequestTypeValue;
90
- }
91
-
92
- /** conversations-create-request-message */
93
- export interface ConversationsCreateRequestMessage {
94
- /**
95
- * The IDs of the artifacts to the message.
96
- * @example ["don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"]
97
- */
98
- artifacts?: string[];
99
- /** The message's body. */
100
- body?: string;
101
- }
102
-
103
- export enum ConversationsCreateRequestTypeValue {
104
- Support = 'support',
105
- }
106
-
107
- /**
108
- * conversations-create-response
109
- * The response to creating a new conversation.
110
- */
111
- export interface ConversationsCreateResponse {
112
- conversation: Conversation;
113
- }
114
-
115
- /**
116
- * conversations-delete-request
117
- * The request to delete a conversation.
118
- */
119
- export interface ConversationsDeleteRequest {
120
- /** The ID of the conversation to delete. */
121
- id: string;
122
- }
123
-
124
- /**
125
- * conversations-delete-response
126
- * The response for deleting a conversation.
127
- */
128
- export type ConversationsDeleteResponse = object;
129
-
130
- /** conversations-export-response */
131
- export interface ConversationsExportResponse {
132
- /** The resulting collection of conversation items. */
133
- conversations: Conversation[];
134
- }
135
-
136
- /**
137
- * conversations-get-response
138
- * The response to getting a conversation's information.
139
- */
140
- export interface ConversationsGetResponse {
141
- conversation: Conversation;
142
- }
143
-
144
- /**
145
- * conversations-list-response
146
- * The response to listing the conversations.
147
- */
148
- export interface ConversationsListResponse {
149
- /** The list of conversations. */
150
- conversations: Conversation[];
151
- /**
152
- * The cursor used to iterate subsequent results in accordance to the
153
- * sort order. If not set, then no later elements exist.
154
- */
155
- next_cursor?: string;
156
- /**
157
- * The cursor used to iterate preceding results in accordance to the
158
- * sort order. If not set, then no prior elements exist.
159
- */
160
- prev_cursor?: string;
161
- }
162
-
163
- /**
164
- * conversations-update-request
165
- * The request to update a conversation.
166
- */
167
- export interface ConversationsUpdateRequest {
168
- applies_to_parts?: ConversationsUpdateRequestAppliesToParts;
169
- /** The updated description for the conversation. */
170
- description?: string;
171
- /** The group that the conversation is associated with. */
172
- group?: string;
173
- /** The ID of the conversation to update. */
174
- id: string;
175
- /** Updates an object's stage. */
176
- stage?: StageUpdate;
177
- /** The updated status of the conversation. */
178
- status?: string;
179
- /** The updated title of the conversation. */
180
- title?: string;
181
- }
182
-
183
- /** conversations-update-request-applies-to-parts */
184
- export interface ConversationsUpdateRequestAppliesToParts {
185
- /**
186
- * Updates the parts that the conversation applies to.
187
- * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
188
- */
189
- set?: string[];
190
- }
191
-
192
- /**
193
- * conversations-update-response
194
- * The response for updating a conversation.
195
- */
196
- export interface ConversationsUpdateResponse {
197
- conversation: Conversation;
198
- }
199
-
200
- /** dev-user-summary */
201
- export type DevUserSummary = UserBaseSummary;
202
-
203
- /** enhancement-summary */
204
- export type EnhancementSummary = PartBaseSummary;
205
-
206
- /** error-bad-request */
207
- export type ErrorBadRequest = ErrorBase &
208
- (
209
- | ErrorBadRequestBadRequest
210
- | ErrorBadRequestInvalidEnumValue
211
- | ErrorBadRequestMissingRequiredField
212
- | ErrorBadRequestParseError
213
- | ErrorBadRequestValueNotPermitted
214
- ) & {
215
- type: ErrorBadRequestType;
216
- };
217
-
218
- /** error-bad-request-bad-request */
219
- export type ErrorBadRequestBadRequest = object;
220
-
221
- /** error-bad-request-invalid-enum-value */
222
- export interface ErrorBadRequestInvalidEnumValue {
223
- /** The allowed values for the field. */
224
- allowed_values: string[];
225
- /** The field whose enum value is invalid. */
226
- field_name: string;
227
- /** The value that was received. */
228
- value: string;
229
- }
230
-
231
- /** error-bad-request-missing-required-field */
232
- export interface ErrorBadRequestMissingRequiredField {
233
- /** The missing field's name. */
234
- field_name: string;
235
- }
236
-
237
- /** error-bad-request-parse-error */
238
- export type ErrorBadRequestParseError = object;
239
-
240
- export enum ErrorBadRequestType {
241
- BadRequest = 'bad_request',
242
- InvalidEnumValue = 'invalid_enum_value',
243
- MissingRequiredField = 'missing_required_field',
244
- ParseError = 'parse_error',
245
- ValueNotPermitted = 'value_not_permitted',
246
- }
247
-
248
- /** error-bad-request-value-not-permitted */
249
- export interface ErrorBadRequestValueNotPermitted {
250
- /** The field whose value is not permitted. */
251
- field_name: string;
252
- /** The reason the value isn't permitted. */
253
- reason?: string;
254
- }
255
-
256
- /** error-base */
257
- export interface ErrorBase {
258
- /** The message associated with the error. */
259
- message?: string;
260
- }
261
-
262
- /** error-forbidden */
263
- export type ErrorForbidden = ErrorBase &
264
- ErrorForbiddenForbidden & {
265
- type: ErrorForbiddenType;
266
- };
267
-
268
- /** error-forbidden-forbidden */
269
- export type ErrorForbiddenForbidden = object;
270
-
271
- export enum ErrorForbiddenType {
272
- Forbidden = 'forbidden',
273
- }
274
-
275
- /** error-internal-server-error */
276
- export type ErrorInternalServerError = ErrorBase &
277
- ErrorInternalServerErrorInternalError & {
278
- /**
279
- * A unique ID that's generated for the error that can be used for
280
- * inquiry.
281
- */
282
- reference_id?: string;
283
- type: ErrorInternalServerErrorType;
284
- };
285
-
286
- /** error-internal-server-error-internal-error */
287
- export type ErrorInternalServerErrorInternalError = object;
288
-
289
- export enum ErrorInternalServerErrorType {
290
- InternalError = 'internal_error',
291
- }
292
-
293
- /** error-not-found */
294
- export type ErrorNotFound = ErrorBase &
295
- ErrorNotFoundNotFound & {
296
- type: ErrorNotFoundType;
297
- };
298
-
299
- /** error-not-found-not-found */
300
- export type ErrorNotFoundNotFound = object;
301
-
302
- export enum ErrorNotFoundType {
303
- NotFound = 'not_found',
304
- }
305
-
306
- /** error-service-unavailable */
307
- export type ErrorServiceUnavailable = ErrorBase &
308
- ErrorServiceUnavailableServiceUnavailable & {
309
- type: ErrorServiceUnavailableType;
310
- };
311
-
312
- /** error-service-unavailable-service-unavailable */
313
- export type ErrorServiceUnavailableServiceUnavailable = object;
314
-
315
- export enum ErrorServiceUnavailableType {
316
- ServiceUnavailable = 'service_unavailable',
317
- }
318
-
319
- /** error-too-many-requests */
320
- export type ErrorTooManyRequests = ErrorBase &
321
- ErrorTooManyRequestsTooManyRequests & {
322
- /**
323
- * The number of seconds after which the client should retry.
324
- * @format int64
325
- */
326
- retry_after?: number;
327
- type: ErrorTooManyRequestsType;
328
- };
329
-
330
- /** error-too-many-requests-too-many-requests */
331
- export type ErrorTooManyRequestsTooManyRequests = object;
332
-
333
- export enum ErrorTooManyRequestsType {
334
- TooManyRequests = 'too_many_requests',
335
- }
336
-
337
- /** error-unauthorized */
338
- export type ErrorUnauthorized = ErrorBase &
339
- ErrorUnauthorizedUnauthenticated & {
340
- type: ErrorUnauthorizedType;
341
- };
342
-
343
- export enum ErrorUnauthorizedType {
344
- Unauthenticated = 'unauthenticated',
345
- }
346
-
347
- /** error-unauthorized-unauthenticated */
348
- export type ErrorUnauthorizedUnauthenticated = object;
349
-
350
- /** feature-summary */
351
- export type FeatureSummary = PartBaseSummary;
352
-
353
- /** group-summary */
354
- export type GroupSummary = AtomBaseSummary;
355
-
356
- /** Priority of the work based upon impact and criticality. */
357
- export enum IssuePriority {
358
- P0 = 'p0',
359
- P1 = 'p1',
360
- P2 = 'p2',
361
- P3 = 'p3',
362
- }
363
-
364
- /** issue-summary */
365
- export type IssueSummary = WorkBaseSummary & {
366
- /** Priority of the work based upon impact and criticality. */
367
- priority?: IssuePriority;
368
- };
369
-
370
- /** link */
371
- export type Link = AtomBase & {
372
- /** Type of link used to define the relationship. */
373
- link_type: LinkType;
374
- source: LinkEndpointSummary;
375
- target: LinkEndpointSummary;
376
- };
377
-
378
- /** link-endpoint-summary */
379
- export type LinkEndpointSummary = (
380
- | CapabilitySummary
381
- | ConversationSummary
382
- | EnhancementSummary
383
- | FeatureSummary
384
- | IssueSummary
385
- | ProductSummary
386
- | TicketSummary
387
- ) & {
388
- type: LinkEndpointType;
389
- };
390
-
391
- export enum LinkEndpointType {
392
- Capability = 'capability',
393
- Conversation = 'conversation',
394
- Enhancement = 'enhancement',
395
- Feature = 'feature',
396
- Issue = 'issue',
397
- Product = 'product',
398
- Ticket = 'ticket',
399
- }
400
-
401
- /**
402
- * link-rev-user-to-rev-org-request
403
- * A request to link a rev user to a rev org.
404
- */
405
- export interface LinkRevUserToRevOrgRequest {
406
- /**
407
- * The don of the rev org to link the rev user to.
408
- * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
409
- */
410
- rev_org_don: string;
411
- /** The don of the rev user to link. */
412
- user_don: string;
413
- }
414
-
415
- /**
416
- * link-rev-user-to-rev-org-response
417
- * The response to link a rev user to a rev org.
418
- */
419
- export interface LinkRevUserToRevOrgResponse {
420
- rev_user: RevUser;
421
- }
422
-
423
- /** Type of link used to define the relationship. */
424
- export enum LinkType {
425
- DevelopedWith = 'developed_with',
426
- Imports = 'imports',
427
- IsDependentOn = 'is_dependent_on',
428
- IsDuplicateOf = 'is_duplicate_of',
429
- IsParentOf = 'is_parent_of',
430
- IsPartOf = 'is_part_of',
431
- IsRelatedTo = 'is_related_to',
432
- Serves = 'serves',
433
- }
434
-
435
- /**
436
- * links-create-request
437
- * The request to create a new link.
438
- */
439
- export interface LinksCreateRequest {
440
- /** Type of link used to define the relationship. */
441
- link_type: LinkType;
442
- /** The ID of the source object. */
443
- source: string;
444
- /** The ID of the target object. */
445
- target: string;
446
- }
447
-
448
- /**
449
- * links-create-response
450
- * The response to creating a new link.
451
- */
452
- export interface LinksCreateResponse {
453
- link: Link;
454
- }
455
-
456
- /**
457
- * links-delete-request
458
- * The request to delete a link.
459
- */
460
- export interface LinksDeleteRequest {
461
- /** The ID of the link to delete. */
462
- id: string;
463
- }
464
-
465
- /**
466
- * links-delete-response
467
- * The response for deleting a link.
468
- */
469
- export type LinksDeleteResponse = object;
470
-
471
- /**
472
- * The direction of link, which can either be outbound such that the
473
- * object is the source of the link, otherwise inbound where the object is
474
- * the target of the link.
475
- */
476
- export enum LinksDirection {
477
- IsSource = 'is_source',
478
- IsTarget = 'is_target',
479
- }
480
-
481
- /**
482
- * links-get-response
483
- * The response to getting a link's information.
484
- */
485
- export interface LinksGetResponse {
486
- link: Link;
487
- }
488
-
489
- /**
490
- * links-list-response
491
- * The response to listing the links.
492
- */
493
- export interface LinksListResponse {
494
- /** The list of links. */
495
- links: Link[];
496
- /**
497
- * The cursor used to iterate subsequent results in accordance to the
498
- * sort order. If not set, then no later elements exist.
499
- */
500
- next_cursor?: string;
501
- /**
502
- * The cursor used to iterate preceding results in accordance to the
503
- * sort order. If not set, then no prior elements exist.
504
- */
505
- prev_cursor?: string;
506
- }
507
-
508
- /**
509
- * The iteration mode to use. If "after", then entries after the provided
510
- * cursor will be returned, or if no cursor is provided, then from the
511
- * beginning. If "before", then entries before the provided cursor will be
512
- * returned, or if no cursor is provided, then from the end. Entries will
513
- * always be returned in the specified sort-by order.
514
- */
515
- export enum ListMode {
516
- After = 'after',
517
- Before = 'before',
518
- }
519
-
520
- /** org-base-summary */
521
- export type OrgBaseSummary = AtomBaseSummary & {
522
- /** Name of the Organization. */
523
- display_name?: string;
524
- };
525
-
526
- /** org-summary */
527
- export type OrgSummary = RevOrgSummary & {
528
- type: OrgType;
529
- };
530
-
531
- export enum OrgType {
532
- RevOrg = 'rev_org',
533
- }
534
-
535
- /** part-base-summary */
536
- export type PartBaseSummary = AtomBaseSummary & {
537
- /** Name of the part. */
538
- name: string;
539
- };
540
-
541
- /** product-summary */
542
- export type ProductSummary = PartBaseSummary;
543
-
544
- /** rev-org-summary */
545
- export type RevOrgSummary = OrgBaseSummary;
546
-
547
- /** rev-user */
548
- export type RevUser = UserBase & {
549
- /** Description of the Rev user. */
550
- description?: string;
551
- /**
552
- * External ref is a mutable unique identifier for a user within the
553
- * Rev organization from your primary customer record. If none is
554
- * available, a good alternative is the email address/phone number
555
- * which could uniquely identify the user. If none is specified, a
556
- * system-generated identifier will be assigned to the user.
557
- */
558
- external_ref?: string;
559
- rev_org?: OrgSummary;
560
- };
561
-
562
- /** rev-user-summary */
563
- export type RevUserSummary = UserBaseSummary & {
564
- /**
565
- * External ref is a mutable unique identifier for a user within the
566
- * Rev organization from your primary customer record. If none is
567
- * available, a good alternative is the email address/phone number
568
- * which could uniquely identify the user. If none is specified, a
569
- * system-generated identifier will be assigned to the user.
570
- */
571
- external_ref?: string;
572
- rev_org?: OrgSummary;
573
- };
574
-
575
- /**
576
- * rev-users-create-request
577
- * Request object to create a new Rev user for a Rev organization.
578
- */
579
- export interface RevUsersCreateRequest {
580
- /** Description of the Rev user. */
581
- description?: string;
582
- /** The user's display name. The name is non-unique and mutable. */
583
- display_name?: string;
584
- /** Email address of the Rev user. */
585
- email?: string;
586
- /**
587
- * External ref is a mutable unique identifier for a user within the
588
- * Dev organization from your primary customer record. If none is
589
- * available, a good alternative is the email address/phone number
590
- * which could uniquely identify the user. If none is specified, a
591
- * system-generated identifier will be assigned to the user.
592
- */
593
- external_ref?: string;
594
- /** Phone numbers of the Rev user. */
595
- phone_numbers?: string[];
596
- /**
597
- * The ID of Rev organization for which a Rev user is to be created.
598
- * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
599
- */
600
- rev_org: string;
601
- }
602
-
603
- /**
604
- * rev-users-create-response
605
- * Response object for creating a new Rev user for Rev organization.
606
- */
607
- export interface RevUsersCreateResponse {
608
- rev_user: RevUser;
609
- }
610
-
611
- /**
612
- * rev-users-delete-request
613
- * Request object to delete a Rev user.
614
- */
615
- export interface RevUsersDeleteRequest {
616
- /** The ID of Rev user to delete. */
617
- id: string;
618
- }
619
-
620
- /**
621
- * rev-users-delete-response
622
- * The response to deleting a Rev user of a Rev organization.
623
- */
624
- export type RevUsersDeleteResponse = object;
625
-
626
- /**
627
- * rev-users-get-response
628
- * The returned Rev user.
629
- */
630
- export interface RevUsersGetResponse {
631
- rev_user: RevUser;
632
- }
633
-
634
- /**
635
- * rev-users-list-response
636
- * The response to listing all Rev users matching the filter criteria.
637
- */
638
- export interface RevUsersListResponse {
639
- /**
640
- * The cursor used to iterate subsequent results in accordance to the
641
- * sort order. If not set, then no later elements exist.
642
- */
643
- next_cursor?: string;
644
- /**
645
- * The cursor used to iterate preceding results in accordance to the
646
- * sort order. If not set, then no prior elements exist.
647
- */
648
- prev_cursor?: string;
649
- /** List containing all the Rev users. */
650
- rev_users: RevUser[];
651
- }
652
-
653
- /**
654
- * rev-users-update-request
655
- * Request to update details of a Rev user.
656
- */
657
- export interface RevUsersUpdateRequest {
658
- /** Updated description of the Rev user. */
659
- description?: string;
660
- /** Updated display name of the Rev user. */
661
- display_name?: string;
662
- /** Updated email address of the Rev user. */
663
- email?: string;
664
- /** Updated external ref value of the Rev user. */
665
- external_ref?: string;
666
- /** The ID of Rev user to update. */
667
- id: string;
668
- }
669
-
670
- /**
671
- * rev-users-update-response
672
- * Updated Rev user object.
673
- */
674
- export interface RevUsersUpdateResponse {
675
- rev_user: RevUser;
676
- }
677
-
678
- /** set-tag-with-value */
679
- export interface SetTagWithValue {
680
- /**
681
- * The ID of the tag.
682
- * @example "don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"
683
- */
684
- id: string;
685
- /**
686
- * The value for the object's association with the tag. If specified,
687
- * the value must be one that's specified in the tag's allowed values.
688
- */
689
- value?: string;
690
- }
691
-
692
- /**
693
- * stage
694
- * Describes the current stage of a work item.
695
- */
696
- export interface Stage {
697
- /** Current stage name of the work item. */
698
- name: string;
699
- }
700
-
701
- /**
702
- * stage-init
703
- * Sets an object's initial stage.
704
- */
705
- export interface StageInit {
706
- /** The name of the stage. */
707
- name?: string;
708
- }
709
-
710
- /**
711
- * stage-update
712
- * Updates an object's stage.
713
- */
714
- export interface StageUpdate {
715
- /** The updated name of the stage, otherwise unchanged if not set. */
716
- name?: string;
717
- }
718
-
719
- /** sys-user */
720
- export type SysUser = UserBase;
721
-
722
- /** sys-user-summary */
723
- export type SysUserSummary = UserBaseSummary;
724
-
725
- /**
726
- * sys-users-list-response
727
- * The response to listing the system users.
728
- */
729
- export interface SysUsersListResponse {
730
- /**
731
- * The cursor used to iterate subsequent results in accordance to the
732
- * sort order. If not set, then no later elements exist.
733
- */
734
- next_cursor?: string;
735
- /**
736
- * The cursor used to iterate preceding results in accordance to the
737
- * sort order. If not set, then no prior elements exist.
738
- */
739
- prev_cursor?: string;
740
- /** The list of system users. */
741
- sys_users: SysUser[];
742
- }
743
-
744
- /**
745
- * sys-users-update-request
746
- * Request to update information of the system user.
747
- */
748
- export interface SysUsersUpdateRequest {
749
- /** Updated display name for the system user. */
750
- display_name?: string;
751
- /**
752
- * Artifact ID of the system user's new display picture.
753
- * @example "don:<partition>:core:devo/<dev-org-id>:artifact/<artifact-id>"
754
- */
755
- display_picture?: string | null;
756
- /** Updated full name for the system user. */
757
- full_name?: string;
758
- /** The ID of system user to update. */
759
- id: string;
760
- }
761
-
762
- /**
763
- * sys-users-update-response
764
- * Updated Sys user object.
765
- */
766
- export interface SysUsersUpdateResponse {
767
- sys_user: SysUser;
768
- }
769
-
770
- /** Severity of the ticket. */
771
- export enum TicketSeverity {
772
- Blocker = 'blocker',
773
- High = 'high',
774
- Low = 'low',
775
- Medium = 'medium',
776
- }
777
-
778
- /** ticket-summary */
779
- export type TicketSummary = WorkBaseSummary & {
780
- rev_org?: OrgSummary;
781
- /** Severity of the ticket. */
782
- severity?: TicketSeverity;
783
- };
784
-
785
- /** timeline-comment */
786
- export type TimelineComment = TimelineEntryBase & {
787
- /** The artifacts for the comment. */
788
- artifacts?: ArtifactSummary[];
789
- /**
790
- * The comment's body. If the comment has been deleted, then no body
791
- * will appear in the response.
792
- */
793
- body?: string;
794
- /** The type of the body to use for the comment. */
795
- body_type?: TimelineCommentBodyType;
796
- /** The SnapKit Body of the comment. */
797
- snap_kit_body?: object;
798
- };
799
-
800
- /** The type of the body to use for the comment. */
801
- export enum TimelineCommentBodyType {
802
- SnapKit = 'snap_kit',
803
- Text = 'text',
804
- }
805
-
806
- /** timeline-entry */
807
- export type TimelineEntry = TimelineComment & {
808
- type: TimelineEntryType;
809
- };
810
-
811
- /** timeline-entry-base */
812
- export type TimelineEntryBase = AtomBase;
813
-
814
- export enum TimelineEntryType {
815
- TimelineComment = 'timeline_comment',
816
- }
817
-
818
- /**
819
- * unlink-rev-user-from-rev-org-request
820
- * A request to unlink a rev user from a rev org.
821
- */
822
- export interface UnlinkRevUserFromRevOrgRequest {
823
- /**
824
- * The don of the rev org to unlink the rev user from.
825
- * @example "don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"
826
- */
827
- rev_org_don: string;
828
- /** The don of the rev user to unlink. */
829
- user_don: string;
830
- }
831
-
832
- /**
833
- * unlink-rev-user-from-rev-org-response
834
- * The response to unlink a rev user from a rev org.
835
- */
836
- export interface UnlinkRevUserFromRevOrgResponse {
837
- rev_user: RevUser;
838
- }
839
-
840
- /** user-base */
841
- export type UserBase = AtomBase & {
842
- /** The user's display name. The name is non-unique and mutable. */
843
- display_name?: string;
844
- display_picture?: ArtifactSummary;
845
- /** Email address of the user. */
846
- email?: string;
847
- /** Full name of the user. */
848
- full_name?: string;
849
- /** Phone numbers of the user. */
850
- phone_numbers?: string[];
851
- /** State of the user. */
852
- state?: UserState;
853
- };
854
-
855
- /** user-base-summary */
856
- export type UserBaseSummary = AtomBaseSummary & {
857
- /** The user's display name. The name is non-unique and mutable. */
858
- display_name?: string;
859
- display_picture?: ArtifactSummary;
860
- /** Email address of the user. */
861
- email?: string;
862
- /** Full name of the user. */
863
- full_name?: string;
864
- /** State of the user. */
865
- state?: UserState;
866
- };
867
-
868
- /** State of the user. */
869
- export enum UserState {
870
- Active = 'active',
871
- Deactivated = 'deactivated',
872
- Locked = 'locked',
873
- Shadow = 'shadow',
874
- Unassigned = 'unassigned',
875
- }
876
-
877
- /** user-summary */
878
- export type UserSummary = (DevUserSummary | RevUserSummary | SysUserSummary) & {
879
- type: UserType;
880
- };
881
-
882
- export enum UserType {
883
- DevUser = 'dev_user',
884
- RevUser = 'rev_user',
885
- SysUser = 'sys_user',
886
- }
887
-
888
- /** work-base-summary */
889
- export type WorkBaseSummary = AtomBaseSummary & {
890
- /** Title of the work object. */
891
- title: string;
892
- };
893
-
894
- import axios, {
895
- AxiosInstance,
896
- AxiosRequestConfig,
897
- AxiosResponse,
898
- HeadersDefaults,
899
- ResponseType,
900
- } from 'axios';
901
-
902
- export type QueryParamsType = Record<string | number, any>;
903
-
904
- export interface FullRequestParams
905
- extends Omit<AxiosRequestConfig, 'data' | 'params' | 'url' | 'responseType'> {
906
- /** set parameter to `true` for call `securityWorker` for this request */
907
- secure?: boolean;
908
- /** request path */
909
- path: string;
910
- /** content type of request body */
911
- type?: ContentType;
912
- /** query params */
913
- query?: QueryParamsType;
914
- /** format of response (i.e. response.json() -> format: "json") */
915
- format?: ResponseType;
916
- /** request body */
917
- body?: unknown;
918
- }
919
-
920
- export type RequestParams = Omit<
921
- FullRequestParams,
922
- 'body' | 'method' | 'query' | 'path'
923
- >;
924
-
925
- export interface ApiConfig<SecurityDataType = unknown>
926
- extends Omit<AxiosRequestConfig, 'data' | 'cancelToken'> {
927
- securityWorker?: (
928
- securityData: SecurityDataType | null
929
- ) => Promise<AxiosRequestConfig | void> | AxiosRequestConfig | void;
930
- secure?: boolean;
931
- format?: ResponseType;
932
- }
933
-
934
- export enum ContentType {
935
- Json = 'application/json',
936
- FormData = 'multipart/form-data',
937
- UrlEncoded = 'application/x-www-form-urlencoded',
938
- Text = 'text/plain',
939
- }
940
-
941
- export class HttpClient<SecurityDataType = unknown> {
942
- public instance: AxiosInstance;
943
- private securityData: SecurityDataType | null = null;
944
- private securityWorker?: ApiConfig<SecurityDataType>['securityWorker'];
945
- private secure?: boolean;
946
- private format?: ResponseType;
947
-
948
- constructor({
949
- securityWorker,
950
- secure,
951
- format,
952
- ...axiosConfig
953
- }: ApiConfig<SecurityDataType> = {}) {
954
- this.instance = axios.create({
955
- ...axiosConfig,
956
- baseURL: axiosConfig.baseURL || '{protocol}://{hostname}',
957
- });
958
- this.secure = secure;
959
- this.format = format;
960
- this.securityWorker = securityWorker;
961
- }
962
-
963
- public setSecurityData = (data: SecurityDataType | null) => {
964
- this.securityData = data;
965
- };
966
-
967
- protected mergeRequestParams(
968
- params1: AxiosRequestConfig,
969
- params2?: AxiosRequestConfig
970
- ): AxiosRequestConfig {
971
- const method = params1.method || (params2 && params2.method);
972
-
973
- return {
974
- ...this.instance.defaults,
975
- ...params1,
976
- ...(params2 || {}),
977
- headers: {
978
- ...((method &&
979
- this.instance.defaults.headers[
980
- method.toLowerCase() as keyof HeadersDefaults
981
- ]) ||
982
- {}),
983
- ...(params1.headers || {}),
984
- ...((params2 && params2.headers) || {}),
985
- },
986
- };
987
- }
988
-
989
- protected stringifyFormItem(formItem: unknown) {
990
- if (typeof formItem === 'object' && formItem !== null) {
991
- return JSON.stringify(formItem);
992
- } else {
993
- return `${formItem}`;
994
- }
995
- }
996
-
997
- protected createFormData(input: Record<string, unknown>): FormData {
998
- return Object.keys(input || {}).reduce((formData, key) => {
999
- const property = input[key];
1000
- const propertyContent: any[] =
1001
- property instanceof Array ? property : [property];
1002
-
1003
- for (const formItem of propertyContent) {
1004
- const isFileType = formItem instanceof Blob || formItem instanceof File;
1005
- formData.append(
1006
- key,
1007
- isFileType ? formItem : this.stringifyFormItem(formItem)
1008
- );
1009
- }
1010
-
1011
- return formData;
1012
- }, new FormData());
1013
- }
1014
-
1015
- public request = async <T = any, _E = any>({
1016
- secure,
1017
- path,
1018
- type,
1019
- query,
1020
- format,
1021
- body,
1022
- ...params
1023
- }: FullRequestParams): Promise<AxiosResponse<T>> => {
1024
- const secureParams =
1025
- ((typeof secure === 'boolean' ? secure : this.secure) &&
1026
- this.securityWorker &&
1027
- (await this.securityWorker(this.securityData))) ||
1028
- {};
1029
- const requestParams = this.mergeRequestParams(params, secureParams);
1030
- const responseFormat = format || this.format || undefined;
1031
-
1032
- if (
1033
- type === ContentType.FormData &&
1034
- body &&
1035
- body !== null &&
1036
- typeof body === 'object'
1037
- ) {
1038
- body = this.createFormData(body as Record<string, unknown>);
1039
- }
1040
-
1041
- if (
1042
- type === ContentType.Text &&
1043
- body &&
1044
- body !== null &&
1045
- typeof body !== 'string'
1046
- ) {
1047
- body = JSON.stringify(body);
1048
- }
1049
-
1050
- return this.instance.request({
1051
- ...requestParams,
1052
- headers: {
1053
- ...(requestParams.headers || {}),
1054
- ...(type && type !== ContentType.FormData
1055
- ? { 'Content-Type': type }
1056
- : {}),
1057
- },
1058
- params: query,
1059
- responseType: responseFormat,
1060
- data: body,
1061
- url: path,
1062
- });
1063
- };
1064
- }
1065
-
1066
- /**
1067
- * @title DevRev Beta REST API
1068
- * @version BETA
1069
- * @baseUrl {protocol}://{hostname}
1070
- *
1071
- * DevRev's BETA REST API Specification.
1072
- */
1073
- export class Api<
1074
- SecurityDataType extends unknown
1075
- > extends HttpClient<SecurityDataType> {
1076
- /**
1077
- * @description Creates a conversation.
1078
- *
1079
- * @tags conversations
1080
- * @name ConversationsCreate
1081
- * @request POST:/conversations.create
1082
- * @secure
1083
- */
1084
- conversationsCreate = (
1085
- data: ConversationsCreateRequest,
1086
- params: RequestParams = {}
1087
- ) =>
1088
- this.request<
1089
- ConversationsCreateResponse,
1090
- | ErrorBadRequest
1091
- | ErrorUnauthorized
1092
- | ErrorForbidden
1093
- | ErrorTooManyRequests
1094
- | ErrorInternalServerError
1095
- | ErrorServiceUnavailable
1096
- >({
1097
- path: `/conversations.create`,
1098
- method: 'POST',
1099
- body: data,
1100
- secure: true,
1101
- type: ContentType.Json,
1102
- format: 'json',
1103
- ...params,
1104
- });
1105
-
1106
- /**
1107
- * @description Deletes the requested conversation.
1108
- *
1109
- * @tags conversations
1110
- * @name ConversationsDelete
1111
- * @request POST:/conversations.delete
1112
- * @secure
1113
- */
1114
- conversationsDelete = (
1115
- data: ConversationsDeleteRequest,
1116
- params: RequestParams = {}
1117
- ) =>
1118
- this.request<
1119
- ConversationsDeleteResponse,
1120
- | ErrorBadRequest
1121
- | ErrorUnauthorized
1122
- | ErrorForbidden
1123
- | ErrorNotFound
1124
- | ErrorTooManyRequests
1125
- | ErrorInternalServerError
1126
- | ErrorServiceUnavailable
1127
- >({
1128
- path: `/conversations.delete`,
1129
- method: 'POST',
1130
- body: data,
1131
- secure: true,
1132
- type: ContentType.Json,
1133
- format: 'json',
1134
- ...params,
1135
- });
1136
-
1137
- /**
1138
- * @description Exports a collection of conversation items.
1139
- *
1140
- * @tags conversations
1141
- * @name ConversationsExport
1142
- * @request GET:/conversations.export
1143
- * @secure
1144
- */
1145
- conversationsExport = (
1146
- query?: {
1147
- /**
1148
- * Filters for conversations belonging to any of the provided parts.
1149
- * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
1150
- */
1151
- applies_to_parts?: string[];
1152
- /**
1153
- * The number of conversation items to return. The default is '50', the
1154
- * maximum is '5000'.
1155
- * @format int32
1156
- */
1157
- first?: number;
1158
- /**
1159
- * Filters for conversations where these users are participants.
1160
- * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
1161
- */
1162
- members?: string[];
1163
- /**
1164
- * Filters for conversations owned by any of these users.
1165
- * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
1166
- */
1167
- owned_by?: string[];
1168
- /**
1169
- * Filters for conversations that are associated with any of the
1170
- * provided Rev organizations.
1171
- * @example ["don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"]
1172
- */
1173
- rev_org?: string[];
1174
- /** Filters for conversations with any of the provided source channels. */
1175
- source_channels?: string[];
1176
- /** Filters for records in the provided stage(s). */
1177
- 'stage.name'?: string[];
1178
- /**
1179
- * Filters for conversations with any of the provided tags.
1180
- * @example ["don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"]
1181
- */
1182
- tags?: string[];
1183
- },
1184
- params: RequestParams = {}
1185
- ) =>
1186
- this.request<
1187
- ConversationsExportResponse,
1188
- | ErrorBadRequest
1189
- | ErrorUnauthorized
1190
- | ErrorForbidden
1191
- | ErrorTooManyRequests
1192
- | ErrorInternalServerError
1193
- | ErrorServiceUnavailable
1194
- >({
1195
- path: `/conversations.export`,
1196
- method: 'GET',
1197
- query: query,
1198
- secure: true,
1199
- format: 'json',
1200
- ...params,
1201
- });
1202
-
1203
- /**
1204
- * @description Gets the requested conversation's information.
1205
- *
1206
- * @tags conversations
1207
- * @name ConversationsGet
1208
- * @request GET:/conversations.get
1209
- * @secure
1210
- */
1211
- conversationsGet = (
1212
- query: {
1213
- /** The requested conversation's ID. */
1214
- id: string;
1215
- },
1216
- params: RequestParams = {}
1217
- ) =>
1218
- this.request<
1219
- ConversationsGetResponse,
1220
- | ErrorBadRequest
1221
- | ErrorUnauthorized
1222
- | ErrorForbidden
1223
- | ErrorNotFound
1224
- | ErrorTooManyRequests
1225
- | ErrorInternalServerError
1226
- | ErrorServiceUnavailable
1227
- >({
1228
- path: `/conversations.get`,
1229
- method: 'GET',
1230
- query: query,
1231
- secure: true,
1232
- format: 'json',
1233
- ...params,
1234
- });
1235
-
1236
- /**
1237
- * @description Lists the available conversations.
1238
- *
1239
- * @tags conversations
1240
- * @name ConversationsList
1241
- * @request GET:/conversations.list
1242
- * @secure
1243
- */
1244
- conversationsList = (
1245
- query?: {
1246
- /**
1247
- * Filters for conversations belonging to any of the provided parts.
1248
- * @example ["don:<partition>:core:devo/<dev-org-id>:<part-type>/<part-id>"]
1249
- */
1250
- applies_to_parts?: string[];
1251
- /**
1252
- * The cursor to resume iteration from. If not provided, then iteration
1253
- * starts from the beginning.
1254
- */
1255
- cursor?: string;
1256
- /**
1257
- * The maximum number of conversations to return. The default is '50'.
1258
- * @format int32
1259
- */
1260
- limit?: number;
1261
- /**
1262
- * Filters for conversations where these users are participants.
1263
- * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
1264
- */
1265
- members?: string[];
1266
- /**
1267
- * The iteration mode to use, otherwise if not set, then "after" is
1268
- * used.
1269
- */
1270
- mode?: ListMode;
1271
- /**
1272
- * Filters for conversations owned by any of these users.
1273
- * @example ["don:<partition>:identity:devo/<dev-org-id>:devu/<dev-user-id>"]
1274
- */
1275
- owned_by?: string[];
1276
- /**
1277
- * Filters for conversations that are associated with any of the
1278
- * provided Rev organizations.
1279
- * @example ["don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"]
1280
- */
1281
- rev_org?: string[];
1282
- /** Filters for conversations with any of the provided source channels. */
1283
- source_channels?: string[];
1284
- /** Filters for records in the provided stage(s). */
1285
- 'stage.name'?: string[];
1286
- /**
1287
- * Filters for conversations with any of the provided tags.
1288
- * @example ["don:<partition>:core:devo/<dev-org-id>:tag/<tag-id>"]
1289
- */
1290
- tags?: string[];
1291
- },
1292
- params: RequestParams = {}
1293
- ) =>
1294
- this.request<
1295
- ConversationsListResponse,
1296
- | ErrorBadRequest
1297
- | ErrorUnauthorized
1298
- | ErrorForbidden
1299
- | ErrorTooManyRequests
1300
- | ErrorInternalServerError
1301
- | ErrorServiceUnavailable
1302
- >({
1303
- path: `/conversations.list`,
1304
- method: 'GET',
1305
- query: query,
1306
- secure: true,
1307
- format: 'json',
1308
- ...params,
1309
- });
1310
-
1311
- /**
1312
- * @description Updates the requested conversation.
1313
- *
1314
- * @tags conversations
1315
- * @name ConversationsUpdate
1316
- * @request POST:/conversations.update
1317
- * @secure
1318
- */
1319
- conversationsUpdate = (
1320
- data: ConversationsUpdateRequest,
1321
- params: RequestParams = {}
1322
- ) =>
1323
- this.request<
1324
- ConversationsUpdateResponse,
1325
- | ErrorBadRequest
1326
- | ErrorUnauthorized
1327
- | ErrorForbidden
1328
- | ErrorNotFound
1329
- | ErrorTooManyRequests
1330
- | ErrorInternalServerError
1331
- | ErrorServiceUnavailable
1332
- >({
1333
- path: `/conversations.update`,
1334
- method: 'POST',
1335
- body: data,
1336
- secure: true,
1337
- type: ContentType.Json,
1338
- format: 'json',
1339
- ...params,
1340
- });
1341
-
1342
- /**
1343
- * @description Creates a link between two objects to indicate a relationship.
1344
- *
1345
- * @tags links
1346
- * @name LinksCreate
1347
- * @request POST:/links.create
1348
- * @secure
1349
- */
1350
- linksCreate = (data: LinksCreateRequest, params: RequestParams = {}) =>
1351
- this.request<
1352
- LinksCreateResponse,
1353
- | ErrorBadRequest
1354
- | ErrorUnauthorized
1355
- | ErrorForbidden
1356
- | ErrorTooManyRequests
1357
- | ErrorInternalServerError
1358
- | ErrorServiceUnavailable
1359
- >({
1360
- path: `/links.create`,
1361
- method: 'POST',
1362
- body: data,
1363
- secure: true,
1364
- type: ContentType.Json,
1365
- format: 'json',
1366
- ...params,
1367
- });
1368
-
1369
- /**
1370
- * @description Deletes a link.
1371
- *
1372
- * @tags links
1373
- * @name LinksDelete
1374
- * @request POST:/links.delete
1375
- * @secure
1376
- */
1377
- linksDelete = (data: LinksDeleteRequest, params: RequestParams = {}) =>
1378
- this.request<
1379
- LinksDeleteResponse,
1380
- | ErrorBadRequest
1381
- | ErrorUnauthorized
1382
- | ErrorForbidden
1383
- | ErrorNotFound
1384
- | ErrorTooManyRequests
1385
- | ErrorInternalServerError
1386
- | ErrorServiceUnavailable
1387
- >({
1388
- path: `/links.delete`,
1389
- method: 'POST',
1390
- body: data,
1391
- secure: true,
1392
- type: ContentType.Json,
1393
- format: 'json',
1394
- ...params,
1395
- });
1396
-
1397
- /**
1398
- * @description Gets the requested link's information.
1399
- *
1400
- * @tags links
1401
- * @name LinksGet
1402
- * @request GET:/links.get
1403
- * @secure
1404
- */
1405
- linksGet = (
1406
- query: {
1407
- /** The requested link's ID. */
1408
- id: string;
1409
- },
1410
- params: RequestParams = {}
1411
- ) =>
1412
- this.request<
1413
- LinksGetResponse,
1414
- | ErrorBadRequest
1415
- | ErrorUnauthorized
1416
- | ErrorForbidden
1417
- | ErrorNotFound
1418
- | ErrorTooManyRequests
1419
- | ErrorInternalServerError
1420
- | ErrorServiceUnavailable
1421
- >({
1422
- path: `/links.get`,
1423
- method: 'GET',
1424
- query: query,
1425
- secure: true,
1426
- format: 'json',
1427
- ...params,
1428
- });
1429
-
1430
- /**
1431
- * @description Lists the available links.
1432
- *
1433
- * @tags links
1434
- * @name LinksList
1435
- * @request GET:/links.list
1436
- * @secure
1437
- */
1438
- linksList = (
1439
- query: {
1440
- /** The ID of the object to list the links for. */
1441
- object: string;
1442
- /**
1443
- * The cursor to resume iteration from. If not provided, then iteration
1444
- * starts from the beginning.
1445
- */
1446
- cursor?: string;
1447
- /**
1448
- * The direction of the links to list, otherwise if not present, then
1449
- * links in both directions (source and target) are included.
1450
- */
1451
- direction?: LinksDirection;
1452
- /**
1453
- * The maximum number of links to return. If not set, then the default
1454
- * is '50'.
1455
- * @format int32
1456
- */
1457
- limit?: number;
1458
- /**
1459
- * The link type(s) to filter for, otherwise if not present, all link
1460
- * types are included.
1461
- */
1462
- link_type?: LinkType[];
1463
- /**
1464
- * The iteration mode to use, otherwise if not set, then "after" is
1465
- * used.
1466
- */
1467
- mode?: ListMode;
1468
- /**
1469
- * The link types to filter for, otherwise if not present, all link
1470
- * types are included.
1471
- * @deprecated
1472
- */
1473
- types?: LinkType[];
1474
- },
1475
- params: RequestParams = {}
1476
- ) =>
1477
- this.request<
1478
- LinksListResponse,
1479
- | ErrorBadRequest
1480
- | ErrorUnauthorized
1481
- | ErrorForbidden
1482
- | ErrorTooManyRequests
1483
- | ErrorInternalServerError
1484
- | ErrorServiceUnavailable
1485
- >({
1486
- path: `/links.list`,
1487
- method: 'GET',
1488
- query: query,
1489
- secure: true,
1490
- format: 'json',
1491
- ...params,
1492
- });
1493
-
1494
- /**
1495
- * @description Creates a Rev user for a Rev organization. Rev user can be a customer or a lead of an organization.
1496
- *
1497
- * @tags rev-users
1498
- * @name RevUsersCreate
1499
- * @request POST:/rev-users.create
1500
- * @secure
1501
- */
1502
- revUsersCreate = (data: RevUsersCreateRequest, params: RequestParams = {}) =>
1503
- this.request<
1504
- RevUsersCreateResponse,
1505
- | ErrorBadRequest
1506
- | ErrorUnauthorized
1507
- | ErrorForbidden
1508
- | ErrorTooManyRequests
1509
- | ErrorInternalServerError
1510
- | ErrorServiceUnavailable
1511
- >({
1512
- path: `/rev-users.create`,
1513
- method: 'POST',
1514
- body: data,
1515
- secure: true,
1516
- type: ContentType.Json,
1517
- format: 'json',
1518
- ...params,
1519
- });
1520
-
1521
- /**
1522
- * @description Deletes a Rev user.
1523
- *
1524
- * @tags rev-users
1525
- * @name RevUsersDelete
1526
- * @request POST:/rev-users.delete
1527
- * @secure
1528
- */
1529
- revUsersDelete = (data: RevUsersDeleteRequest, params: RequestParams = {}) =>
1530
- this.request<
1531
- RevUsersDeleteResponse,
1532
- | ErrorBadRequest
1533
- | ErrorUnauthorized
1534
- | ErrorForbidden
1535
- | ErrorNotFound
1536
- | ErrorTooManyRequests
1537
- | ErrorInternalServerError
1538
- | ErrorServiceUnavailable
1539
- >({
1540
- path: `/rev-users.delete`,
1541
- method: 'POST',
1542
- body: data,
1543
- secure: true,
1544
- type: ContentType.Json,
1545
- format: 'json',
1546
- ...params,
1547
- });
1548
-
1549
- /**
1550
- * @description Returns the Rev user of a Rev organization by its ID.
1551
- *
1552
- * @tags rev-users
1553
- * @name RevUsersGet
1554
- * @request GET:/rev-users.get
1555
- * @secure
1556
- */
1557
- revUsersGet = (
1558
- query: {
1559
- /** The ID of Rev user to be retrieved. */
1560
- id: string;
1561
- },
1562
- params: RequestParams = {}
1563
- ) =>
1564
- this.request<
1565
- RevUsersGetResponse,
1566
- | ErrorBadRequest
1567
- | ErrorUnauthorized
1568
- | ErrorForbidden
1569
- | ErrorNotFound
1570
- | ErrorTooManyRequests
1571
- | ErrorInternalServerError
1572
- | ErrorServiceUnavailable
1573
- >({
1574
- path: `/rev-users.get`,
1575
- method: 'GET',
1576
- query: query,
1577
- secure: true,
1578
- format: 'json',
1579
- ...params,
1580
- });
1581
-
1582
- /**
1583
- * @description Links a rev user to a rev org.
1584
- *
1585
- * @tags rev-users
1586
- * @name LinkRevUserToRevOrg
1587
- * @request POST:/rev-users.link
1588
- * @secure
1589
- */
1590
- linkRevUserToRevOrg = (
1591
- data: LinkRevUserToRevOrgRequest,
1592
- params: RequestParams = {}
1593
- ) =>
1594
- this.request<
1595
- LinkRevUserToRevOrgResponse,
1596
- | ErrorBadRequest
1597
- | ErrorUnauthorized
1598
- | ErrorForbidden
1599
- | ErrorNotFound
1600
- | ErrorTooManyRequests
1601
- | ErrorInternalServerError
1602
- | ErrorServiceUnavailable
1603
- >({
1604
- path: `/rev-users.link`,
1605
- method: 'POST',
1606
- body: data,
1607
- secure: true,
1608
- type: ContentType.Json,
1609
- format: 'json',
1610
- ...params,
1611
- });
1612
-
1613
- /**
1614
- * @description Returns a list of all Rev Users belonging to the authenticated user's Dev Organization.
1615
- *
1616
- * @tags rev-users
1617
- * @name RevUsersList
1618
- * @request GET:/rev-users.list
1619
- * @secure
1620
- */
1621
- revUsersList = (
1622
- query?: {
1623
- /** Filters for Rev users that were created by the specified user(s). */
1624
- created_by?: string[];
1625
- /**
1626
- * Filters for objects created after the provided timestamp (inclusive).
1627
- * @format date-time
1628
- */
1629
- 'created_date.after'?: string;
1630
- /**
1631
- * Filters for objects created before the provided timestamp
1632
- * (inclusive).
1633
- * @format date-time
1634
- */
1635
- 'created_date.before'?: string;
1636
- /**
1637
- * The cursor to resume iteration from. If not provided, then iteration
1638
- * starts from the beginning.
1639
- */
1640
- cursor?: string;
1641
- /** List of emails of Rev users to be filtered. */
1642
- email?: string[];
1643
- /**
1644
- * The maximum number of Rev users to return. The default is '50'.
1645
- * @format int32
1646
- */
1647
- limit?: number;
1648
- /**
1649
- * The iteration mode to use, otherwise if not set, then "after" is
1650
- * used.
1651
- */
1652
- mode?: ListMode;
1653
- /**
1654
- * Filters for objects created after the provided timestamp (inclusive).
1655
- * @format date-time
1656
- */
1657
- 'modified_date.after'?: string;
1658
- /**
1659
- * Filters for objects created before the provided timestamp
1660
- * (inclusive).
1661
- * @format date-time
1662
- */
1663
- 'modified_date.before'?: string;
1664
- /**
1665
- * List of IDs of Rev organizations to be filtered.
1666
- * @example ["don:<partition>:identity:devo/<dev-org-id>:revo/<rev-org-id>"]
1667
- */
1668
- rev_org?: string[];
1669
- /** Fields to sort the Rev users by and the direction to sort them. */
1670
- sort_by?: string[];
1671
- },
1672
- params: RequestParams = {}
1673
- ) =>
1674
- this.request<
1675
- RevUsersListResponse,
1676
- | ErrorBadRequest
1677
- | ErrorUnauthorized
1678
- | ErrorForbidden
1679
- | ErrorNotFound
1680
- | ErrorTooManyRequests
1681
- | ErrorInternalServerError
1682
- | ErrorServiceUnavailable
1683
- >({
1684
- path: `/rev-users.list`,
1685
- method: 'GET',
1686
- query: query,
1687
- secure: true,
1688
- format: 'json',
1689
- ...params,
1690
- });
1691
-
1692
- /**
1693
- * @description Unlinks a rev user from a rev org.
1694
- *
1695
- * @tags rev-users
1696
- * @name UnlinkRevUserFromRevOrg
1697
- * @request POST:/rev-users.unlink
1698
- * @secure
1699
- */
1700
- unlinkRevUserFromRevOrg = (
1701
- data: UnlinkRevUserFromRevOrgRequest,
1702
- params: RequestParams = {}
1703
- ) =>
1704
- this.request<
1705
- UnlinkRevUserFromRevOrgResponse,
1706
- | ErrorBadRequest
1707
- | ErrorUnauthorized
1708
- | ErrorForbidden
1709
- | ErrorNotFound
1710
- | ErrorTooManyRequests
1711
- | ErrorInternalServerError
1712
- | ErrorServiceUnavailable
1713
- >({
1714
- path: `/rev-users.unlink`,
1715
- method: 'POST',
1716
- body: data,
1717
- secure: true,
1718
- type: ContentType.Json,
1719
- format: 'json',
1720
- ...params,
1721
- });
1722
-
1723
- /**
1724
- * @description Updates a Rev user.
1725
- *
1726
- * @tags rev-users
1727
- * @name RevUsersUpdate
1728
- * @request POST:/rev-users.update
1729
- * @secure
1730
- */
1731
- revUsersUpdate = (data: RevUsersUpdateRequest, params: RequestParams = {}) =>
1732
- this.request<
1733
- RevUsersUpdateResponse,
1734
- | ErrorBadRequest
1735
- | ErrorUnauthorized
1736
- | ErrorForbidden
1737
- | ErrorNotFound
1738
- | ErrorTooManyRequests
1739
- | ErrorInternalServerError
1740
- | ErrorServiceUnavailable
1741
- >({
1742
- path: `/rev-users.update`,
1743
- method: 'POST',
1744
- body: data,
1745
- secure: true,
1746
- type: ContentType.Json,
1747
- format: 'json',
1748
- ...params,
1749
- });
1750
-
1751
- /**
1752
- * @description Lists system users within your organization.
1753
- *
1754
- * @tags sys-users
1755
- * @name SysUsersList
1756
- * @request GET:/sys-users.list
1757
- * @secure
1758
- */
1759
- sysUsersList = (
1760
- query?: {
1761
- /**
1762
- * The cursor to resume iteration from. If not provided, then iteration
1763
- * starts from the beginning.
1764
- */
1765
- cursor?: string;
1766
- /**
1767
- * The maximum number of system users to return. Value can range from
1768
- * '1' to '100', with a default of '50'.
1769
- * @format int32
1770
- */
1771
- limit?: number;
1772
- /**
1773
- * The iteration mode to use, otherwise if not set, then "after" is
1774
- * used.
1775
- */
1776
- mode?: ListMode;
1777
- /** Fields to sort the system users by and the direction to sort them. */
1778
- sort_by?: string[];
1779
- },
1780
- params: RequestParams = {}
1781
- ) =>
1782
- this.request<
1783
- SysUsersListResponse,
1784
- | ErrorBadRequest
1785
- | ErrorUnauthorized
1786
- | ErrorForbidden
1787
- | ErrorTooManyRequests
1788
- | ErrorInternalServerError
1789
- | ErrorServiceUnavailable
1790
- >({
1791
- path: `/sys-users.list`,
1792
- method: 'GET',
1793
- query: query,
1794
- secure: true,
1795
- format: 'json',
1796
- ...params,
1797
- });
1798
-
1799
- /**
1800
- * @description Updates the system user.
1801
- *
1802
- * @tags sys-users
1803
- * @name SysUsersUpdate
1804
- * @request POST:/sys-users.update
1805
- * @secure
1806
- */
1807
- sysUsersUpdate = (data: SysUsersUpdateRequest, params: RequestParams = {}) =>
1808
- this.request<
1809
- SysUsersUpdateResponse,
1810
- | ErrorBadRequest
1811
- | ErrorUnauthorized
1812
- | ErrorForbidden
1813
- | ErrorNotFound
1814
- | ErrorTooManyRequests
1815
- | ErrorInternalServerError
1816
- | ErrorServiceUnavailable
1817
- >({
1818
- path: `/sys-users.update`,
1819
- method: 'POST',
1820
- body: data,
1821
- secure: true,
1822
- type: ContentType.Json,
1823
- format: 'json',
1824
- ...params,
1825
- });
1826
- }