@wix/workflows 1.0.26 → 1.0.28

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.
@@ -0,0 +1,807 @@
1
+ interface Card$2 {
2
+ /** Card details. */
3
+ info?: CardInfo$2;
4
+ }
5
+ /** entity representing a card-info */
6
+ interface CardInfo$2 {
7
+ /**
8
+ * Card ID.
9
+ * @readonly
10
+ */
11
+ _id?: string | null;
12
+ /** Display name shown at the top of the card. */
13
+ name?: string | null;
14
+ /** Card description. */
15
+ description?: string | null;
16
+ /** Details about the contact attached to the card. */
17
+ primaryAttachment?: Attachment$2;
18
+ /** Due date. */
19
+ dueDate?: Date;
20
+ /** Name of the app or service that created the contact. */
21
+ source?: string | null;
22
+ /**
23
+ * @internal
24
+ * @internal
25
+ * @readonly
26
+ * @deprecated
27
+ */
28
+ createdAt?: Date;
29
+ /**
30
+ * @internal
31
+ * @internal
32
+ * @readonly
33
+ * @deprecated
34
+ */
35
+ updatedAt?: Date;
36
+ /**
37
+ * ID of the phase that currently holds the card.
38
+ * @readonly
39
+ */
40
+ phaseId?: string | null;
41
+ /**
42
+ * Date and time the card was created.
43
+ * @readonly
44
+ */
45
+ _createdDate?: Date;
46
+ /**
47
+ * Date and time the card was updated.
48
+ * @readonly
49
+ */
50
+ _updatedDate?: Date;
51
+ }
52
+ interface Attachment$2 {
53
+ /**
54
+ * Attachment ID. For internal use.
55
+ * @readonly
56
+ */
57
+ attachmentId?: string;
58
+ /**
59
+ * @internal
60
+ * @internal
61
+ * @deprecated
62
+ */
63
+ value?: string;
64
+ /**
65
+ * @internal
66
+ * @internal
67
+ * @deprecated
68
+ */
69
+ attachmentType?: AttachmentType$2;
70
+ /** ID of the contact attached to the card. */
71
+ contactId?: string;
72
+ }
73
+ /** describes the supported types of attachments (currently only supports Contact which is the default type) */
74
+ declare enum AttachmentType$2 {
75
+ ContactType = "ContactType"
76
+ }
77
+ interface PaginationResponse$2 {
78
+ /** Number of items that were skipped in the current sort order. */
79
+ offset?: number;
80
+ /** Total number of items that matched the filter. */
81
+ total?: number;
82
+ /** Number of returned items. */
83
+ count?: number;
84
+ }
85
+ interface ListCardsResponse {
86
+ /** List of cards. */
87
+ cards?: Card$2[];
88
+ /** Metadata for the page of results. */
89
+ pagination?: PaginationResponse$2;
90
+ }
91
+ interface CreateCardResponse {
92
+ /** ID of the newly created card. */
93
+ _id?: string | null;
94
+ }
95
+ interface ListCardsResponseNonNullableFields {
96
+ cards: {
97
+ info?: {
98
+ primaryAttachment?: {
99
+ attachmentId: string;
100
+ value: string;
101
+ attachmentType: AttachmentType$2;
102
+ contactId: string;
103
+ };
104
+ };
105
+ }[];
106
+ pagination?: {
107
+ offset: number;
108
+ total: number;
109
+ count: number;
110
+ };
111
+ }
112
+ interface ListCardsOptions {
113
+ /** Filters for cards in the specified phase. */
114
+ phaseId?: string | null;
115
+ /**
116
+ * Number of items to return.
117
+ *
118
+ * Defaults to `50`.
119
+ */
120
+ limit?: number | null;
121
+ /**
122
+ * Number of items to skip in the current sort order.
123
+ *
124
+ * Defaults to `0`.
125
+ */
126
+ offset?: number | null;
127
+ /** Filters for cards with the specified contact ID. */
128
+ attachmentValue?: string | null;
129
+ /**
130
+ * Filters for archived cards.
131
+ * If set to `true`,
132
+ * only archived cards are returned.
133
+ * If set to `false`,
134
+ * only cards that are not archived are returned.
135
+ *
136
+ * Defaults to `false`.
137
+ */
138
+ fetchArchived?: boolean | null;
139
+ /**
140
+ * Supported fields:
141
+ * `id`, `name`, `createdDate`, `updatedDate`, `phaseId`
142
+ *
143
+ * List of fields to sort by.
144
+ * Formatted as `field:direction`,
145
+ * where field is the field name
146
+ * and direction is `asc` (ascending) or `desc` (descending).
147
+ *
148
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
149
+ */
150
+ sort?: string[];
151
+ }
152
+ interface CreateCardIdentifiers {
153
+ /** ID of the workflow to create the card in. */
154
+ workflowId: string;
155
+ /** ID of the phase to create the card in. */
156
+ phaseId: string;
157
+ }
158
+ interface CreateCardOptions {
159
+ /**
160
+ * Card position, where the first card is `0`.
161
+ *
162
+ * If a card already occupies the specified position,
163
+ * that card and any subsequent cards are shifted to the right by 1.
164
+ *
165
+ * Defaults to the last position.
166
+ */
167
+ position?: number | null;
168
+ }
169
+ interface MoveCardOptions {
170
+ /** ID of the phase to move the card to. */
171
+ newPhaseId?: string | null;
172
+ /** Position of the card in the phase, where the first card is `0`. */
173
+ newPosition?: number | null;
174
+ }
175
+ interface RestoreCardOptions {
176
+ /**
177
+ * Position of the restored card in the phase,
178
+ * where the first card is `0`.
179
+ */
180
+ newPosition?: number | null;
181
+ }
182
+
183
+ type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
184
+ interface HttpClient$2 {
185
+ request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
186
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
187
+ }
188
+ type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
189
+ type HttpResponse$2<T = any> = {
190
+ data: T;
191
+ status: number;
192
+ statusText: string;
193
+ headers: any;
194
+ request?: any;
195
+ };
196
+ type RequestOptions$2<_TResponse = any, Data = any> = {
197
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
198
+ url: string;
199
+ data?: Data;
200
+ params?: URLSearchParams;
201
+ } & APIMetadata$2;
202
+ type APIMetadata$2 = {
203
+ methodFqn?: string;
204
+ entityFqdn?: string;
205
+ packageName?: string;
206
+ };
207
+ type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
208
+
209
+ declare global {
210
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
211
+ interface SymbolConstructor {
212
+ readonly observable: symbol;
213
+ }
214
+ }
215
+
216
+ declare function listCards$1(httpClient: HttpClient$2): (workflowId: string, options?: ListCardsOptions) => Promise<ListCardsResponse & ListCardsResponseNonNullableFields>;
217
+ declare function getCard$1(httpClient: HttpClient$2): (_id: string) => Promise<Card$2 & {
218
+ info?: {
219
+ primaryAttachment?: {
220
+ attachmentId: string;
221
+ value: string;
222
+ attachmentType: AttachmentType$2;
223
+ contactId: string;
224
+ } | undefined;
225
+ } | undefined;
226
+ }>;
227
+ declare function updateCard$1(httpClient: HttpClient$2): (_id: string, cardInfo: CardInfo$2) => Promise<void>;
228
+ declare function createCard$1(httpClient: HttpClient$2): (identifiers: CreateCardIdentifiers, card: CardInfo$2, options?: CreateCardOptions) => Promise<CreateCardResponse>;
229
+ declare function deleteCard$1(httpClient: HttpClient$2): (_id: string) => Promise<void>;
230
+ declare function moveCard$1(httpClient: HttpClient$2): (_id: string, options?: MoveCardOptions) => Promise<void>;
231
+ declare function restoreCard$1(httpClient: HttpClient$2): (_id: string, newPhaseId: string, options?: RestoreCardOptions) => Promise<void>;
232
+ declare function archiveCard$1(httpClient: HttpClient$2): (_id: string) => Promise<void>;
233
+
234
+ declare const listCards: BuildRESTFunction$2<typeof listCards$1>;
235
+ declare const getCard: BuildRESTFunction$2<typeof getCard$1>;
236
+ declare const updateCard: BuildRESTFunction$2<typeof updateCard$1>;
237
+ declare const createCard: BuildRESTFunction$2<typeof createCard$1>;
238
+ declare const deleteCard: BuildRESTFunction$2<typeof deleteCard$1>;
239
+ declare const moveCard: BuildRESTFunction$2<typeof moveCard$1>;
240
+ declare const restoreCard: BuildRESTFunction$2<typeof restoreCard$1>;
241
+ declare const archiveCard: BuildRESTFunction$2<typeof archiveCard$1>;
242
+
243
+ declare const context$2_archiveCard: typeof archiveCard;
244
+ declare const context$2_createCard: typeof createCard;
245
+ declare const context$2_deleteCard: typeof deleteCard;
246
+ declare const context$2_getCard: typeof getCard;
247
+ declare const context$2_listCards: typeof listCards;
248
+ declare const context$2_moveCard: typeof moveCard;
249
+ declare const context$2_restoreCard: typeof restoreCard;
250
+ declare const context$2_updateCard: typeof updateCard;
251
+ declare namespace context$2 {
252
+ export { context$2_archiveCard as archiveCard, context$2_createCard as createCard, context$2_deleteCard as deleteCard, context$2_getCard as getCard, context$2_listCards as listCards, context$2_moveCard as moveCard, context$2_restoreCard as restoreCard, context$2_updateCard as updateCard };
253
+ }
254
+
255
+ interface Phase$1 {
256
+ /** Phase information. */
257
+ info?: PhaseInfo$1;
258
+ /** Cards contained in the phase. */
259
+ cardsList?: CardsList$1;
260
+ }
261
+ interface PhaseInfo$1 {
262
+ /**
263
+ * Phase ID.
264
+ * @readonly
265
+ */
266
+ _id?: string | null;
267
+ /** Display name shown at the top of the phase. */
268
+ name?: string | null;
269
+ }
270
+ /** a list of cards (a page) along with the total number */
271
+ interface CardsList$1 {
272
+ /** Total number of cards in the phase. */
273
+ total?: number;
274
+ /**
275
+ * List of cards in the phase.
276
+ * Sorted according to the card display order, from top to bottom.
277
+ */
278
+ cards?: Card$1[];
279
+ }
280
+ interface Card$1 {
281
+ /** Card details. */
282
+ info?: CardInfo$1;
283
+ }
284
+ /** entity representing a card-info */
285
+ interface CardInfo$1 {
286
+ /**
287
+ * Card ID.
288
+ * @readonly
289
+ */
290
+ _id?: string | null;
291
+ /** Display name shown at the top of the card. */
292
+ name?: string | null;
293
+ /** Card description. */
294
+ description?: string | null;
295
+ /** Details about the contact attached to the card. */
296
+ primaryAttachment?: Attachment$1;
297
+ /** Due date. */
298
+ dueDate?: Date;
299
+ /** Name of the app or service that created the contact. */
300
+ source?: string | null;
301
+ /**
302
+ * @internal
303
+ * @internal
304
+ * @readonly
305
+ * @deprecated
306
+ */
307
+ createdAt?: Date;
308
+ /**
309
+ * @internal
310
+ * @internal
311
+ * @readonly
312
+ * @deprecated
313
+ */
314
+ updatedAt?: Date;
315
+ /**
316
+ * ID of the phase that currently holds the card.
317
+ * @readonly
318
+ */
319
+ phaseId?: string | null;
320
+ /**
321
+ * Date and time the card was created.
322
+ * @readonly
323
+ */
324
+ _createdDate?: Date;
325
+ /**
326
+ * Date and time the card was updated.
327
+ * @readonly
328
+ */
329
+ _updatedDate?: Date;
330
+ }
331
+ interface Attachment$1 {
332
+ /**
333
+ * Attachment ID. For internal use.
334
+ * @readonly
335
+ */
336
+ attachmentId?: string;
337
+ /**
338
+ * @internal
339
+ * @internal
340
+ * @deprecated
341
+ */
342
+ value?: string;
343
+ /**
344
+ * @internal
345
+ * @internal
346
+ * @deprecated
347
+ */
348
+ attachmentType?: AttachmentType$1;
349
+ /** ID of the contact attached to the card. */
350
+ contactId?: string;
351
+ }
352
+ /** describes the supported types of attachments (currently only supports Contact which is the default type) */
353
+ declare enum AttachmentType$1 {
354
+ ContactType = "ContactType"
355
+ }
356
+ interface PaginationResponse$1 {
357
+ /** Number of items that were skipped in the current sort order. */
358
+ offset?: number;
359
+ /** Total number of items that matched the filter. */
360
+ total?: number;
361
+ /** Number of returned items. */
362
+ count?: number;
363
+ }
364
+ interface ListPhasesResponse {
365
+ /** List of phases. */
366
+ phases?: Phase$1[];
367
+ /** Metadata for the page of results. */
368
+ pagination?: PaginationResponse$1;
369
+ }
370
+ interface CreatePhaseResponse {
371
+ /** ID of the newly created phase. */
372
+ _id?: string | null;
373
+ }
374
+ interface ListPhasesResponseNonNullableFields {
375
+ phases: {
376
+ cardsList?: {
377
+ total: number;
378
+ cards: {
379
+ info?: {
380
+ primaryAttachment?: {
381
+ attachmentId: string;
382
+ value: string;
383
+ attachmentType: AttachmentType$1;
384
+ contactId: string;
385
+ };
386
+ };
387
+ }[];
388
+ };
389
+ }[];
390
+ pagination?: {
391
+ offset: number;
392
+ total: number;
393
+ count: number;
394
+ };
395
+ }
396
+ interface ListPhasesOptions {
397
+ /** Number of items to return. */
398
+ limit?: number | null;
399
+ /**
400
+ * Number of items to skip in the current sort order.
401
+ *
402
+ * Defaults to `0`.
403
+ */
404
+ offset?: number | null;
405
+ /**
406
+ * Supported fields:
407
+ * `id`, `name`
408
+ *
409
+ * List of fields to sort by.
410
+ * Formatted as `field:direction`,
411
+ * where field is the field name
412
+ * and direction is `asc` (ascending) or `desc` (descending).
413
+ *
414
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
415
+ */
416
+ sort?: string[];
417
+ }
418
+ interface CreatePhaseOptions {
419
+ /**
420
+ * Phase position, where the first phase is `0`.
421
+ *
422
+ * If a phase already occupies the specified position,
423
+ * that phase and any subsequent phases
424
+ * are shifted to the right by 1.
425
+ *
426
+ * Defaults to the last position,
427
+ * which is displayed before the win phase.
428
+ */
429
+ position?: number | null;
430
+ }
431
+ interface MovePhaseIdentifiers {
432
+ /** ID of the workflow that contains the phase to move. */
433
+ workflowId: string;
434
+ /** ID of the phase to move. */
435
+ _id: string;
436
+ }
437
+
438
+ type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
439
+ interface HttpClient$1 {
440
+ request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
441
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
442
+ }
443
+ type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
444
+ type HttpResponse$1<T = any> = {
445
+ data: T;
446
+ status: number;
447
+ statusText: string;
448
+ headers: any;
449
+ request?: any;
450
+ };
451
+ type RequestOptions$1<_TResponse = any, Data = any> = {
452
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
453
+ url: string;
454
+ data?: Data;
455
+ params?: URLSearchParams;
456
+ } & APIMetadata$1;
457
+ type APIMetadata$1 = {
458
+ methodFqn?: string;
459
+ entityFqdn?: string;
460
+ packageName?: string;
461
+ };
462
+ type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
463
+
464
+ declare global {
465
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
466
+ interface SymbolConstructor {
467
+ readonly observable: symbol;
468
+ }
469
+ }
470
+
471
+ declare function listPhases$1(httpClient: HttpClient$1): (workflowId: string, options?: ListPhasesOptions) => Promise<ListPhasesResponse & ListPhasesResponseNonNullableFields>;
472
+ declare function getPhase$1(httpClient: HttpClient$1): (_id: string) => Promise<Phase$1 & {
473
+ cardsList?: {
474
+ total: number;
475
+ cards: {
476
+ info?: {
477
+ primaryAttachment?: {
478
+ attachmentId: string;
479
+ value: string;
480
+ attachmentType: AttachmentType$1;
481
+ contactId: string;
482
+ } | undefined;
483
+ } | undefined;
484
+ }[];
485
+ } | undefined;
486
+ }>;
487
+ declare function updatePhase$1(httpClient: HttpClient$1): (_id: string, phase: PhaseInfo$1) => Promise<void>;
488
+ declare function createPhase$1(httpClient: HttpClient$1): (workflowId: string, phase: PhaseInfo$1, options?: CreatePhaseOptions) => Promise<CreatePhaseResponse>;
489
+ declare function deletePhase$1(httpClient: HttpClient$1): (_id: string) => Promise<void>;
490
+ declare function movePhase$1(httpClient: HttpClient$1): (identifiers: MovePhaseIdentifiers, newPosition: number | null) => Promise<void>;
491
+
492
+ declare const listPhases: BuildRESTFunction$1<typeof listPhases$1>;
493
+ declare const getPhase: BuildRESTFunction$1<typeof getPhase$1>;
494
+ declare const updatePhase: BuildRESTFunction$1<typeof updatePhase$1>;
495
+ declare const createPhase: BuildRESTFunction$1<typeof createPhase$1>;
496
+ declare const deletePhase: BuildRESTFunction$1<typeof deletePhase$1>;
497
+ declare const movePhase: BuildRESTFunction$1<typeof movePhase$1>;
498
+
499
+ declare const context$1_createPhase: typeof createPhase;
500
+ declare const context$1_deletePhase: typeof deletePhase;
501
+ declare const context$1_getPhase: typeof getPhase;
502
+ declare const context$1_listPhases: typeof listPhases;
503
+ declare const context$1_movePhase: typeof movePhase;
504
+ declare const context$1_updatePhase: typeof updatePhase;
505
+ declare namespace context$1 {
506
+ export { context$1_createPhase as createPhase, context$1_deletePhase as deletePhase, context$1_getPhase as getPhase, context$1_listPhases as listPhases, context$1_movePhase as movePhase, context$1_updatePhase as updatePhase };
507
+ }
508
+
509
+ interface Workflow {
510
+ /** Workflow information and metadata. */
511
+ info?: WorkflowInfo;
512
+ /**
513
+ * Final phase of the workflow.
514
+ * Cards in `winPhase` are treated as if they are not part of the workflow.
515
+ *
516
+ * Normally, a contact can be attached to only 1 card in the workflow.
517
+ * Moving a contact's card to `winPhase`
518
+ * frees up the contact to be attached to another card in the workflow.
519
+ */
520
+ winPhase?: Phase;
521
+ /** Phases that make up the workflow. */
522
+ phasesList?: PhasesList;
523
+ }
524
+ interface WorkflowInfo {
525
+ /**
526
+ * Workflow ID.
527
+ * @readonly
528
+ */
529
+ _id?: string | null;
530
+ /** Display name for the workflow. */
531
+ name?: string | null;
532
+ /**
533
+ * Workflow description,
534
+ * shown below the workflow's display name in the dashboard.
535
+ */
536
+ description?: string | null;
537
+ /**
538
+ * @internal
539
+ * @internal
540
+ * @readonly
541
+ * @deprecated
542
+ */
543
+ createdAt?: Date;
544
+ /**
545
+ * Indicates whether the workflow can be deleted.
546
+ * @readonly
547
+ * @deprecated
548
+ */
549
+ isDeletable?: boolean | null;
550
+ /**
551
+ * Date and time the workflow was created.
552
+ * @readonly
553
+ */
554
+ _createdDate?: Date;
555
+ }
556
+ interface Phase {
557
+ /** Phase information. */
558
+ info?: PhaseInfo;
559
+ /** Cards contained in the phase. */
560
+ cardsList?: CardsList;
561
+ }
562
+ interface PhaseInfo {
563
+ /**
564
+ * Phase ID.
565
+ * @readonly
566
+ */
567
+ _id?: string | null;
568
+ /** Display name shown at the top of the phase. */
569
+ name?: string | null;
570
+ }
571
+ /** a list of cards (a page) along with the total number */
572
+ interface CardsList {
573
+ /** Total number of cards in the phase. */
574
+ total?: number;
575
+ /**
576
+ * List of cards in the phase.
577
+ * Sorted according to the card display order, from top to bottom.
578
+ */
579
+ cards?: Card[];
580
+ }
581
+ interface Card {
582
+ /** Card details. */
583
+ info?: CardInfo;
584
+ }
585
+ /** entity representing a card-info */
586
+ interface CardInfo {
587
+ /**
588
+ * Card ID.
589
+ * @readonly
590
+ */
591
+ _id?: string | null;
592
+ /** Display name shown at the top of the card. */
593
+ name?: string | null;
594
+ /** Card description. */
595
+ description?: string | null;
596
+ /** Details about the contact attached to the card. */
597
+ primaryAttachment?: Attachment;
598
+ /** Due date. */
599
+ dueDate?: Date;
600
+ /** Name of the app or service that created the contact. */
601
+ source?: string | null;
602
+ /**
603
+ * @internal
604
+ * @internal
605
+ * @readonly
606
+ * @deprecated
607
+ */
608
+ createdAt?: Date;
609
+ /**
610
+ * @internal
611
+ * @internal
612
+ * @readonly
613
+ * @deprecated
614
+ */
615
+ updatedAt?: Date;
616
+ /**
617
+ * ID of the phase that currently holds the card.
618
+ * @readonly
619
+ */
620
+ phaseId?: string | null;
621
+ /**
622
+ * Date and time the card was created.
623
+ * @readonly
624
+ */
625
+ _createdDate?: Date;
626
+ /**
627
+ * Date and time the card was updated.
628
+ * @readonly
629
+ */
630
+ _updatedDate?: Date;
631
+ }
632
+ interface Attachment {
633
+ /**
634
+ * Attachment ID. For internal use.
635
+ * @readonly
636
+ */
637
+ attachmentId?: string;
638
+ /**
639
+ * @internal
640
+ * @internal
641
+ * @deprecated
642
+ */
643
+ value?: string;
644
+ /**
645
+ * @internal
646
+ * @internal
647
+ * @deprecated
648
+ */
649
+ attachmentType?: AttachmentType;
650
+ /** ID of the contact attached to the card. */
651
+ contactId?: string;
652
+ }
653
+ /** describes the supported types of attachments (currently only supports Contact which is the default type) */
654
+ declare enum AttachmentType {
655
+ ContactType = "ContactType"
656
+ }
657
+ /** a list of phases (a page) along with the total number */
658
+ interface PhasesList {
659
+ /** Total number of phases in the workflow, excluding `winPhase`. */
660
+ total?: number;
661
+ /**
662
+ * List of phases in the workflow.
663
+ * Sorted according to the phase display order, from left to right.
664
+ */
665
+ phases?: Phase[];
666
+ }
667
+ interface ListWorkflowsResponse {
668
+ /** Retrieved list of workflows. */
669
+ workflows?: WorkflowInfo[];
670
+ /** Metadata for the page of results. */
671
+ pagination?: PaginationResponse;
672
+ }
673
+ interface PaginationResponse {
674
+ /** Number of items that were skipped in the current sort order. */
675
+ offset?: number;
676
+ /** Total number of items that matched the filter. */
677
+ total?: number;
678
+ /** Number of returned items. */
679
+ count?: number;
680
+ }
681
+ interface CreateWorkflowResponse {
682
+ /** ID of the new workflow. */
683
+ _id?: string | null;
684
+ }
685
+ interface ListWorkflowsResponseNonNullableFields {
686
+ workflows: WorkflowInfo[];
687
+ pagination?: {
688
+ offset: number;
689
+ total: number;
690
+ count: number;
691
+ };
692
+ }
693
+ interface ListWorkflowsOptions {
694
+ /**
695
+ * Number of workflows to return.
696
+ * If omitted, all results are returned.
697
+ */
698
+ limit?: number | null;
699
+ /**
700
+ * Number of items to skip in the current sort order.
701
+ *
702
+ * Defaults to `0`.
703
+ */
704
+ offset?: number | null;
705
+ /**
706
+ * Supported fields:
707
+ * `id`, `name`, `description`, `createdDate`
708
+ *
709
+ * List of fields to sort by.
710
+ * Formatted as `field:direction`,
711
+ * where field is the field name
712
+ * and direction is `asc` (ascending) or `desc` (descending).
713
+ *
714
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
715
+ */
716
+ sort?: string[];
717
+ }
718
+
719
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
720
+ interface HttpClient {
721
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
722
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
723
+ }
724
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
725
+ type HttpResponse<T = any> = {
726
+ data: T;
727
+ status: number;
728
+ statusText: string;
729
+ headers: any;
730
+ request?: any;
731
+ };
732
+ type RequestOptions<_TResponse = any, Data = any> = {
733
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
734
+ url: string;
735
+ data?: Data;
736
+ params?: URLSearchParams;
737
+ } & APIMetadata;
738
+ type APIMetadata = {
739
+ methodFqn?: string;
740
+ entityFqdn?: string;
741
+ packageName?: string;
742
+ };
743
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
744
+
745
+ declare global {
746
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
747
+ interface SymbolConstructor {
748
+ readonly observable: symbol;
749
+ }
750
+ }
751
+
752
+ declare function listWorkflows$1(httpClient: HttpClient): (options?: ListWorkflowsOptions) => Promise<ListWorkflowsResponse & ListWorkflowsResponseNonNullableFields>;
753
+ declare function getWorkflow$1(httpClient: HttpClient): (_id: string, cardsPerPhase: number | null) => Promise<Workflow & {
754
+ winPhase?: {
755
+ cardsList?: {
756
+ total: number;
757
+ cards: {
758
+ info?: {
759
+ primaryAttachment?: {
760
+ attachmentId: string;
761
+ value: string;
762
+ attachmentType: AttachmentType;
763
+ contactId: string;
764
+ } | undefined;
765
+ } | undefined;
766
+ }[];
767
+ } | undefined;
768
+ } | undefined;
769
+ phasesList?: {
770
+ total: number;
771
+ phases: {
772
+ cardsList?: {
773
+ total: number;
774
+ cards: {
775
+ info?: {
776
+ primaryAttachment?: {
777
+ attachmentId: string;
778
+ value: string;
779
+ attachmentType: AttachmentType;
780
+ contactId: string;
781
+ } | undefined;
782
+ } | undefined;
783
+ }[];
784
+ } | undefined;
785
+ }[];
786
+ } | undefined;
787
+ }>;
788
+ declare function updateWorkflow$1(httpClient: HttpClient): (_id: string, workflow: WorkflowInfo) => Promise<void>;
789
+ declare function createWorkflow$1(httpClient: HttpClient): (workflow: WorkflowInfo) => Promise<CreateWorkflowResponse>;
790
+ declare function deleteWorkflow$1(httpClient: HttpClient): (_id: string) => Promise<void>;
791
+
792
+ declare const listWorkflows: BuildRESTFunction<typeof listWorkflows$1>;
793
+ declare const getWorkflow: BuildRESTFunction<typeof getWorkflow$1>;
794
+ declare const updateWorkflow: BuildRESTFunction<typeof updateWorkflow$1>;
795
+ declare const createWorkflow: BuildRESTFunction<typeof createWorkflow$1>;
796
+ declare const deleteWorkflow: BuildRESTFunction<typeof deleteWorkflow$1>;
797
+
798
+ declare const context_createWorkflow: typeof createWorkflow;
799
+ declare const context_deleteWorkflow: typeof deleteWorkflow;
800
+ declare const context_getWorkflow: typeof getWorkflow;
801
+ declare const context_listWorkflows: typeof listWorkflows;
802
+ declare const context_updateWorkflow: typeof updateWorkflow;
803
+ declare namespace context {
804
+ export { context_createWorkflow as createWorkflow, context_deleteWorkflow as deleteWorkflow, context_getWorkflow as getWorkflow, context_listWorkflows as listWorkflows, context_updateWorkflow as updateWorkflow };
805
+ }
806
+
807
+ export { context$2 as cards, context$1 as phases, context as workflows };