@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,1446 @@
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 QueryCardsRequest {
78
+ /** Query, sort, and paging options. */
79
+ query?: Query$2;
80
+ }
81
+ interface Query$2 {
82
+ /**
83
+ * Filter object in the following format:
84
+ * `"filter" : {
85
+ * "fieldName1": "value1",
86
+ * "fieldName2":{"$operator":"value2"}
87
+ * }`
88
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
89
+ */
90
+ filter?: any;
91
+ /**
92
+ * Sort object in the following format:
93
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
94
+ */
95
+ sort?: Sorting$2[];
96
+ /** Paging options to limit and skip the number of items. */
97
+ paging?: Paging$2;
98
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
99
+ fields?: string[];
100
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
101
+ fieldsets?: string[];
102
+ }
103
+ interface Sorting$2 {
104
+ /** Name of the field to sort by. */
105
+ fieldName?: string;
106
+ /** Sort order. */
107
+ order?: SortOrder$2;
108
+ }
109
+ declare enum SortOrder$2 {
110
+ ASC = "ASC",
111
+ DESC = "DESC"
112
+ }
113
+ interface Paging$2 {
114
+ /** Number of items to load. */
115
+ limit?: number | null;
116
+ /** Number of items to skip in the current sort order. */
117
+ offset?: number | null;
118
+ }
119
+ interface QueryCardsResponse {
120
+ /** List of cards that matched the query criteria. */
121
+ cards?: Card$2[];
122
+ /** Metadata for the page of results. */
123
+ pagination?: PaginationResponse$2;
124
+ }
125
+ interface PaginationResponse$2 {
126
+ /** Number of items that were skipped in the current sort order. */
127
+ offset?: number;
128
+ /** Total number of items that matched the filter. */
129
+ total?: number;
130
+ /** Number of returned items. */
131
+ count?: number;
132
+ }
133
+ interface ListCardsRequest {
134
+ /** ID of the workflow whose cards will be listed. */
135
+ workflowId: string;
136
+ /** Filters for cards in the specified phase. */
137
+ phaseId?: string | null;
138
+ /**
139
+ * Number of items to return.
140
+ *
141
+ * Defaults to `50`.
142
+ */
143
+ limit?: number | null;
144
+ /**
145
+ * Number of items to skip in the current sort order.
146
+ *
147
+ * Defaults to `0`.
148
+ */
149
+ offset?: number | null;
150
+ /** Filters for cards with the specified contact ID. */
151
+ attachmentValue?: string | null;
152
+ /**
153
+ * Filters for archived cards.
154
+ * If set to `true`,
155
+ * only archived cards are returned.
156
+ * If set to `false`,
157
+ * only cards that are not archived are returned.
158
+ *
159
+ * Defaults to `false`.
160
+ */
161
+ fetchArchived?: boolean | null;
162
+ /**
163
+ * Supported fields:
164
+ * `id`, `name`, `createdDate`, `updatedDate`, `phaseId`
165
+ *
166
+ * List of fields to sort by.
167
+ * Formatted as `field:direction`,
168
+ * where field is the field name
169
+ * and direction is `asc` (ascending) or `desc` (descending).
170
+ *
171
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
172
+ */
173
+ sort?: string[];
174
+ }
175
+ interface ListCardsResponse {
176
+ /** List of cards. */
177
+ cards?: Card$2[];
178
+ /** Metadata for the page of results. */
179
+ pagination?: PaginationResponse$2;
180
+ }
181
+ interface GetCardRequest {
182
+ /** ID of the card to retrieve. */
183
+ _id: string;
184
+ }
185
+ interface GetCardResponse {
186
+ /** Requested card. */
187
+ card?: Card$2;
188
+ }
189
+ interface UpdateCardRequest {
190
+ /** ID of the card to update. */
191
+ _id: string;
192
+ /** Card details. */
193
+ cardInfo?: CardInfo$2;
194
+ }
195
+ interface UpdateCardResponse {
196
+ }
197
+ interface CreateCardRequest {
198
+ /** ID of the workflow to create the card in. */
199
+ workflowId: string;
200
+ /** ID of the phase to create the card in. */
201
+ phaseId: string;
202
+ /** Card details. */
203
+ card?: CardInfo$2;
204
+ /**
205
+ * Card position, where the first card is `0`.
206
+ *
207
+ * If a card already occupies the specified position,
208
+ * that card and any subsequent cards are shifted to the right by 1.
209
+ *
210
+ * Defaults to the last position.
211
+ */
212
+ position?: number | null;
213
+ }
214
+ interface CreateCardResponse {
215
+ /** ID of the newly created card. */
216
+ _id?: string | null;
217
+ }
218
+ interface DeleteCardRequest {
219
+ /** ID of the card to delete. */
220
+ _id: string;
221
+ }
222
+ interface DeleteCardResponse {
223
+ }
224
+ interface MoveCardRequest {
225
+ /** ID of the card to move. */
226
+ _id: string;
227
+ /** ID of the phase to move the card to. */
228
+ newPhaseId?: string | null;
229
+ /** Position of the card in the phase, where the first card is `0`. */
230
+ newPosition?: number | null;
231
+ }
232
+ interface MoveCardResponse {
233
+ }
234
+ interface RestoreCardRequest {
235
+ /** ID of the card to restore. */
236
+ _id: string;
237
+ /** ID of the phase to restore the card to. */
238
+ newPhaseId: string;
239
+ /**
240
+ * Position of the restored card in the phase,
241
+ * where the first card is `0`.
242
+ */
243
+ newPosition?: number | null;
244
+ }
245
+ interface RestoreCardResponse {
246
+ }
247
+ interface ArchiveCardRequest {
248
+ /** ID of the card to archive. */
249
+ _id: string;
250
+ }
251
+ interface ArchiveCardResponse {
252
+ }
253
+ interface DomainEvent extends DomainEventBodyOneOf {
254
+ createdEvent?: EntityCreatedEvent;
255
+ updatedEvent?: EntityUpdatedEvent;
256
+ deletedEvent?: EntityDeletedEvent;
257
+ actionEvent?: ActionEvent;
258
+ /**
259
+ * Unique event ID.
260
+ * Allows clients to ignore duplicate webhooks.
261
+ */
262
+ _id?: string;
263
+ /**
264
+ * Assumes actions are also always typed to an entity_type
265
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
266
+ */
267
+ entityFqdn?: string;
268
+ /**
269
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
270
+ * This is although the created/updated/deleted notion is duplication of the oneof types
271
+ * Example: created/updated/deleted/started/completed/email_opened
272
+ */
273
+ slug?: string;
274
+ /** ID of the entity associated with the event. */
275
+ entityId?: string;
276
+ /** Event timestamp. */
277
+ eventTime?: Date;
278
+ /**
279
+ * Whether the event was triggered as a result of a privacy regulation application
280
+ * (for example, GDPR).
281
+ */
282
+ triggeredByAnonymizeRequest?: boolean | null;
283
+ /** If present, indicates the action that triggered the event. */
284
+ originatedFrom?: string | null;
285
+ /**
286
+ * A sequence number defining the order of updates to the underlying entity.
287
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
288
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
289
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
290
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
291
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
292
+ */
293
+ entityEventSequence?: string | null;
294
+ }
295
+ /** @oneof */
296
+ interface DomainEventBodyOneOf {
297
+ createdEvent?: EntityCreatedEvent;
298
+ updatedEvent?: EntityUpdatedEvent;
299
+ deletedEvent?: EntityDeletedEvent;
300
+ actionEvent?: ActionEvent;
301
+ }
302
+ interface EntityCreatedEvent {
303
+ entity?: string;
304
+ }
305
+ interface EntityUpdatedEvent {
306
+ /**
307
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
308
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
309
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
310
+ */
311
+ currentEntity?: string;
312
+ }
313
+ interface EntityDeletedEvent {
314
+ /** Entity that was deleted */
315
+ deletedEntity?: string | null;
316
+ }
317
+ interface ActionEvent {
318
+ body?: string;
319
+ }
320
+ interface MessageEnvelope {
321
+ /** App instance ID. */
322
+ instanceId?: string | null;
323
+ /** Event type. */
324
+ eventType?: string;
325
+ /** The identification type and identity data. */
326
+ identity?: IdentificationData;
327
+ /** Stringify payload. */
328
+ data?: string;
329
+ }
330
+ interface IdentificationData extends IdentificationDataIdOneOf {
331
+ /** ID of a site visitor that has not logged in to the site. */
332
+ anonymousVisitorId?: string;
333
+ /** ID of a site visitor that has logged in to the site. */
334
+ memberId?: string;
335
+ /** ID of a Wix user (site owner, contributor, etc.). */
336
+ wixUserId?: string;
337
+ /** ID of an app. */
338
+ appId?: string;
339
+ /** @readonly */
340
+ identityType?: WebhookIdentityType;
341
+ }
342
+ /** @oneof */
343
+ interface IdentificationDataIdOneOf {
344
+ /** ID of a site visitor that has not logged in to the site. */
345
+ anonymousVisitorId?: string;
346
+ /** ID of a site visitor that has logged in to the site. */
347
+ memberId?: string;
348
+ /** ID of a Wix user (site owner, contributor, etc.). */
349
+ wixUserId?: string;
350
+ /** ID of an app. */
351
+ appId?: string;
352
+ }
353
+ declare enum WebhookIdentityType {
354
+ UNKNOWN = "UNKNOWN",
355
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
356
+ MEMBER = "MEMBER",
357
+ WIX_USER = "WIX_USER",
358
+ APP = "APP"
359
+ }
360
+ interface ListCardsResponseNonNullableFields {
361
+ cards: {
362
+ info?: {
363
+ primaryAttachment?: {
364
+ attachmentId: string;
365
+ value: string;
366
+ attachmentType: AttachmentType$2;
367
+ contactId: string;
368
+ };
369
+ };
370
+ }[];
371
+ pagination?: {
372
+ offset: number;
373
+ total: number;
374
+ count: number;
375
+ };
376
+ }
377
+ interface GetCardResponseNonNullableFields {
378
+ card?: {
379
+ info?: {
380
+ primaryAttachment?: {
381
+ attachmentId: string;
382
+ value: string;
383
+ attachmentType: AttachmentType$2;
384
+ contactId: string;
385
+ };
386
+ };
387
+ };
388
+ }
389
+ interface ListCardsOptions {
390
+ /** Filters for cards in the specified phase. */
391
+ phaseId?: string | null;
392
+ /**
393
+ * Number of items to return.
394
+ *
395
+ * Defaults to `50`.
396
+ */
397
+ limit?: number | null;
398
+ /**
399
+ * Number of items to skip in the current sort order.
400
+ *
401
+ * Defaults to `0`.
402
+ */
403
+ offset?: number | null;
404
+ /** Filters for cards with the specified contact ID. */
405
+ attachmentValue?: string | null;
406
+ /**
407
+ * Filters for archived cards.
408
+ * If set to `true`,
409
+ * only archived cards are returned.
410
+ * If set to `false`,
411
+ * only cards that are not archived are returned.
412
+ *
413
+ * Defaults to `false`.
414
+ */
415
+ fetchArchived?: boolean | null;
416
+ /**
417
+ * Supported fields:
418
+ * `id`, `name`, `createdDate`, `updatedDate`, `phaseId`
419
+ *
420
+ * List of fields to sort by.
421
+ * Formatted as `field:direction`,
422
+ * where field is the field name
423
+ * and direction is `asc` (ascending) or `desc` (descending).
424
+ *
425
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
426
+ */
427
+ sort?: string[];
428
+ }
429
+ interface CreateCardIdentifiers {
430
+ /** ID of the workflow to create the card in. */
431
+ workflowId: string;
432
+ /** ID of the phase to create the card in. */
433
+ phaseId: string;
434
+ }
435
+ interface CreateCardOptions {
436
+ /**
437
+ * Card position, where the first card is `0`.
438
+ *
439
+ * If a card already occupies the specified position,
440
+ * that card and any subsequent cards are shifted to the right by 1.
441
+ *
442
+ * Defaults to the last position.
443
+ */
444
+ position?: number | null;
445
+ }
446
+ interface MoveCardOptions {
447
+ /** ID of the phase to move the card to. */
448
+ newPhaseId?: string | null;
449
+ /** Position of the card in the phase, where the first card is `0`. */
450
+ newPosition?: number | null;
451
+ }
452
+ interface RestoreCardOptions {
453
+ /**
454
+ * Position of the restored card in the phase,
455
+ * where the first card is `0`.
456
+ */
457
+ newPosition?: number | null;
458
+ }
459
+
460
+ interface HttpClient$2 {
461
+ request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
462
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
463
+ }
464
+ type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
465
+ type HttpResponse$2<T = any> = {
466
+ data: T;
467
+ status: number;
468
+ statusText: string;
469
+ headers: any;
470
+ request?: any;
471
+ };
472
+ type RequestOptions$2<_TResponse = any, Data = any> = {
473
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
474
+ url: string;
475
+ data?: Data;
476
+ params?: URLSearchParams;
477
+ } & APIMetadata$2;
478
+ type APIMetadata$2 = {
479
+ methodFqn?: string;
480
+ entityFqdn?: string;
481
+ packageName?: string;
482
+ };
483
+
484
+ declare global {
485
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
486
+ interface SymbolConstructor {
487
+ readonly observable: symbol;
488
+ }
489
+ }
490
+
491
+ declare const __metadata$2: {
492
+ PACKAGE_NAME: string;
493
+ };
494
+ declare function listCards(httpClient: HttpClient$2): (workflowId: string, options?: ListCardsOptions) => Promise<ListCardsResponse & ListCardsResponseNonNullableFields>;
495
+ declare function getCard(httpClient: HttpClient$2): (_id: string) => Promise<Card$2 & {
496
+ info?: {
497
+ primaryAttachment?: {
498
+ attachmentId: string;
499
+ value: string;
500
+ attachmentType: AttachmentType$2;
501
+ contactId: string;
502
+ } | undefined;
503
+ } | undefined;
504
+ }>;
505
+ declare function updateCard(httpClient: HttpClient$2): (_id: string, cardInfo: CardInfo$2) => Promise<void>;
506
+ declare function createCard(httpClient: HttpClient$2): (identifiers: CreateCardIdentifiers, card: CardInfo$2, options?: CreateCardOptions) => Promise<CreateCardResponse>;
507
+ declare function deleteCard(httpClient: HttpClient$2): (_id: string) => Promise<void>;
508
+ declare function moveCard(httpClient: HttpClient$2): (_id: string, options?: MoveCardOptions) => Promise<void>;
509
+ declare function restoreCard(httpClient: HttpClient$2): (_id: string, newPhaseId: string, options?: RestoreCardOptions) => Promise<void>;
510
+ declare function archiveCard(httpClient: HttpClient$2): (_id: string) => Promise<void>;
511
+
512
+ type index_d$2_ActionEvent = ActionEvent;
513
+ type index_d$2_ArchiveCardRequest = ArchiveCardRequest;
514
+ type index_d$2_ArchiveCardResponse = ArchiveCardResponse;
515
+ type index_d$2_CreateCardIdentifiers = CreateCardIdentifiers;
516
+ type index_d$2_CreateCardOptions = CreateCardOptions;
517
+ type index_d$2_CreateCardRequest = CreateCardRequest;
518
+ type index_d$2_CreateCardResponse = CreateCardResponse;
519
+ type index_d$2_DeleteCardRequest = DeleteCardRequest;
520
+ type index_d$2_DeleteCardResponse = DeleteCardResponse;
521
+ type index_d$2_DomainEvent = DomainEvent;
522
+ type index_d$2_DomainEventBodyOneOf = DomainEventBodyOneOf;
523
+ type index_d$2_EntityCreatedEvent = EntityCreatedEvent;
524
+ type index_d$2_EntityDeletedEvent = EntityDeletedEvent;
525
+ type index_d$2_EntityUpdatedEvent = EntityUpdatedEvent;
526
+ type index_d$2_GetCardRequest = GetCardRequest;
527
+ type index_d$2_GetCardResponse = GetCardResponse;
528
+ type index_d$2_GetCardResponseNonNullableFields = GetCardResponseNonNullableFields;
529
+ type index_d$2_IdentificationData = IdentificationData;
530
+ type index_d$2_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
531
+ type index_d$2_ListCardsOptions = ListCardsOptions;
532
+ type index_d$2_ListCardsRequest = ListCardsRequest;
533
+ type index_d$2_ListCardsResponse = ListCardsResponse;
534
+ type index_d$2_ListCardsResponseNonNullableFields = ListCardsResponseNonNullableFields;
535
+ type index_d$2_MessageEnvelope = MessageEnvelope;
536
+ type index_d$2_MoveCardOptions = MoveCardOptions;
537
+ type index_d$2_MoveCardRequest = MoveCardRequest;
538
+ type index_d$2_MoveCardResponse = MoveCardResponse;
539
+ type index_d$2_QueryCardsRequest = QueryCardsRequest;
540
+ type index_d$2_QueryCardsResponse = QueryCardsResponse;
541
+ type index_d$2_RestoreCardOptions = RestoreCardOptions;
542
+ type index_d$2_RestoreCardRequest = RestoreCardRequest;
543
+ type index_d$2_RestoreCardResponse = RestoreCardResponse;
544
+ type index_d$2_UpdateCardRequest = UpdateCardRequest;
545
+ type index_d$2_UpdateCardResponse = UpdateCardResponse;
546
+ type index_d$2_WebhookIdentityType = WebhookIdentityType;
547
+ declare const index_d$2_WebhookIdentityType: typeof WebhookIdentityType;
548
+ declare const index_d$2_archiveCard: typeof archiveCard;
549
+ declare const index_d$2_createCard: typeof createCard;
550
+ declare const index_d$2_deleteCard: typeof deleteCard;
551
+ declare const index_d$2_getCard: typeof getCard;
552
+ declare const index_d$2_listCards: typeof listCards;
553
+ declare const index_d$2_moveCard: typeof moveCard;
554
+ declare const index_d$2_restoreCard: typeof restoreCard;
555
+ declare const index_d$2_updateCard: typeof updateCard;
556
+ declare namespace index_d$2 {
557
+ export { type index_d$2_ActionEvent as ActionEvent, type index_d$2_ArchiveCardRequest as ArchiveCardRequest, type index_d$2_ArchiveCardResponse as ArchiveCardResponse, type Attachment$2 as Attachment, AttachmentType$2 as AttachmentType, type Card$2 as Card, type CardInfo$2 as CardInfo, type index_d$2_CreateCardIdentifiers as CreateCardIdentifiers, type index_d$2_CreateCardOptions as CreateCardOptions, type index_d$2_CreateCardRequest as CreateCardRequest, type index_d$2_CreateCardResponse as CreateCardResponse, type index_d$2_DeleteCardRequest as DeleteCardRequest, type index_d$2_DeleteCardResponse as DeleteCardResponse, type index_d$2_DomainEvent as DomainEvent, type index_d$2_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d$2_EntityCreatedEvent as EntityCreatedEvent, type index_d$2_EntityDeletedEvent as EntityDeletedEvent, type index_d$2_EntityUpdatedEvent as EntityUpdatedEvent, type index_d$2_GetCardRequest as GetCardRequest, type index_d$2_GetCardResponse as GetCardResponse, type index_d$2_GetCardResponseNonNullableFields as GetCardResponseNonNullableFields, type index_d$2_IdentificationData as IdentificationData, type index_d$2_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d$2_ListCardsOptions as ListCardsOptions, type index_d$2_ListCardsRequest as ListCardsRequest, type index_d$2_ListCardsResponse as ListCardsResponse, type index_d$2_ListCardsResponseNonNullableFields as ListCardsResponseNonNullableFields, type index_d$2_MessageEnvelope as MessageEnvelope, type index_d$2_MoveCardOptions as MoveCardOptions, type index_d$2_MoveCardRequest as MoveCardRequest, type index_d$2_MoveCardResponse as MoveCardResponse, type PaginationResponse$2 as PaginationResponse, type Paging$2 as Paging, type Query$2 as Query, type index_d$2_QueryCardsRequest as QueryCardsRequest, type index_d$2_QueryCardsResponse as QueryCardsResponse, type index_d$2_RestoreCardOptions as RestoreCardOptions, type index_d$2_RestoreCardRequest as RestoreCardRequest, type index_d$2_RestoreCardResponse as RestoreCardResponse, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, type index_d$2_UpdateCardRequest as UpdateCardRequest, type index_d$2_UpdateCardResponse as UpdateCardResponse, index_d$2_WebhookIdentityType as WebhookIdentityType, __metadata$2 as __metadata, index_d$2_archiveCard as archiveCard, index_d$2_createCard as createCard, index_d$2_deleteCard as deleteCard, index_d$2_getCard as getCard, index_d$2_listCards as listCards, index_d$2_moveCard as moveCard, index_d$2_restoreCard as restoreCard, index_d$2_updateCard as updateCard };
558
+ }
559
+
560
+ interface Phase$1 {
561
+ /** Phase information. */
562
+ info?: PhaseInfo$1;
563
+ /** Cards contained in the phase. */
564
+ cardsList?: CardsList$1;
565
+ }
566
+ interface PhaseInfo$1 {
567
+ /**
568
+ * Phase ID.
569
+ * @readonly
570
+ */
571
+ _id?: string | null;
572
+ /** Display name shown at the top of the phase. */
573
+ name?: string | null;
574
+ }
575
+ /** a list of cards (a page) along with the total number */
576
+ interface CardsList$1 {
577
+ /** Total number of cards in the phase. */
578
+ total?: number;
579
+ /**
580
+ * List of cards in the phase.
581
+ * Sorted according to the card display order, from top to bottom.
582
+ */
583
+ cards?: Card$1[];
584
+ }
585
+ interface Card$1 {
586
+ /** Card details. */
587
+ info?: CardInfo$1;
588
+ }
589
+ /** entity representing a card-info */
590
+ interface CardInfo$1 {
591
+ /**
592
+ * Card ID.
593
+ * @readonly
594
+ */
595
+ _id?: string | null;
596
+ /** Display name shown at the top of the card. */
597
+ name?: string | null;
598
+ /** Card description. */
599
+ description?: string | null;
600
+ /** Details about the contact attached to the card. */
601
+ primaryAttachment?: Attachment$1;
602
+ /** Due date. */
603
+ dueDate?: Date;
604
+ /** Name of the app or service that created the contact. */
605
+ source?: string | null;
606
+ /**
607
+ * @internal
608
+ * @internal
609
+ * @readonly
610
+ * @deprecated
611
+ */
612
+ createdAt?: Date;
613
+ /**
614
+ * @internal
615
+ * @internal
616
+ * @readonly
617
+ * @deprecated
618
+ */
619
+ updatedAt?: Date;
620
+ /**
621
+ * ID of the phase that currently holds the card.
622
+ * @readonly
623
+ */
624
+ phaseId?: string | null;
625
+ /**
626
+ * Date and time the card was created.
627
+ * @readonly
628
+ */
629
+ _createdDate?: Date;
630
+ /**
631
+ * Date and time the card was updated.
632
+ * @readonly
633
+ */
634
+ _updatedDate?: Date;
635
+ }
636
+ interface Attachment$1 {
637
+ /**
638
+ * Attachment ID. For internal use.
639
+ * @readonly
640
+ */
641
+ attachmentId?: string;
642
+ /**
643
+ * @internal
644
+ * @internal
645
+ * @deprecated
646
+ */
647
+ value?: string;
648
+ /**
649
+ * @internal
650
+ * @internal
651
+ * @deprecated
652
+ */
653
+ attachmentType?: AttachmentType$1;
654
+ /** ID of the contact attached to the card. */
655
+ contactId?: string;
656
+ }
657
+ /** describes the supported types of attachments (currently only supports Contact which is the default type) */
658
+ declare enum AttachmentType$1 {
659
+ ContactType = "ContactType"
660
+ }
661
+ interface QueryPhasesRequest {
662
+ /** Query, sort, and paging options. */
663
+ query?: Query$1;
664
+ }
665
+ interface Query$1 {
666
+ /**
667
+ * Filter object in the following format:
668
+ * `"filter" : {
669
+ * "fieldName1": "value1",
670
+ * "fieldName2":{"$operator":"value2"}
671
+ * }`
672
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
673
+ */
674
+ filter?: any;
675
+ /**
676
+ * Sort object in the following format:
677
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
678
+ */
679
+ sort?: Sorting$1[];
680
+ /** Paging options to limit and skip the number of items. */
681
+ paging?: Paging$1;
682
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
683
+ fields?: string[];
684
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
685
+ fieldsets?: string[];
686
+ }
687
+ interface Sorting$1 {
688
+ /** Name of the field to sort by. */
689
+ fieldName?: string;
690
+ /** Sort order. */
691
+ order?: SortOrder$1;
692
+ }
693
+ declare enum SortOrder$1 {
694
+ ASC = "ASC",
695
+ DESC = "DESC"
696
+ }
697
+ interface Paging$1 {
698
+ /** Number of items to load. */
699
+ limit?: number | null;
700
+ /** Number of items to skip in the current sort order. */
701
+ offset?: number | null;
702
+ }
703
+ interface QueryPhasesResponse {
704
+ /** List of phases that matched the query criteria. */
705
+ phases?: Phase$1[];
706
+ /** Metadata for the page of results. */
707
+ pagination?: PaginationResponse$1;
708
+ }
709
+ interface PaginationResponse$1 {
710
+ /** Number of items that were skipped in the current sort order. */
711
+ offset?: number;
712
+ /** Total number of items that matched the filter. */
713
+ total?: number;
714
+ /** Number of returned items. */
715
+ count?: number;
716
+ }
717
+ interface ListPhasesRequest {
718
+ /** ID of the workflow whose phases will be listed. */
719
+ workflowId: string;
720
+ /** Number of items to return. */
721
+ limit?: number | null;
722
+ /**
723
+ * Number of items to skip in the current sort order.
724
+ *
725
+ * Defaults to `0`.
726
+ */
727
+ offset?: number | null;
728
+ /**
729
+ * Supported fields:
730
+ * `id`, `name`
731
+ *
732
+ * List of fields to sort by.
733
+ * Formatted as `field:direction`,
734
+ * where field is the field name
735
+ * and direction is `asc` (ascending) or `desc` (descending).
736
+ *
737
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
738
+ */
739
+ sort?: string[];
740
+ }
741
+ interface ListPhasesResponse {
742
+ /** List of phases. */
743
+ phases?: Phase$1[];
744
+ /** Metadata for the page of results. */
745
+ pagination?: PaginationResponse$1;
746
+ }
747
+ interface GetPhaseRequest {
748
+ /** ID of the phase to retrieve. */
749
+ _id: string;
750
+ }
751
+ interface GetPhaseResponse {
752
+ /** Requested phase. */
753
+ phase?: Phase$1;
754
+ }
755
+ interface UpdatePhaseRequest {
756
+ /** ID of the phase to update. */
757
+ _id: string;
758
+ /** Phase details to update. */
759
+ phase?: PhaseInfo$1;
760
+ }
761
+ interface UpdatePhaseResponse {
762
+ }
763
+ interface CreatePhaseRequest {
764
+ /** ID of the workflow to create the phase in. */
765
+ workflowId: string;
766
+ /** Phase details. */
767
+ phase?: PhaseInfo$1;
768
+ /**
769
+ * Phase position, where the first phase is `0`.
770
+ *
771
+ * If a phase already occupies the specified position,
772
+ * that phase and any subsequent phases
773
+ * are shifted to the right by 1.
774
+ *
775
+ * Defaults to the last position,
776
+ * which is displayed before the win phase.
777
+ */
778
+ position?: number | null;
779
+ }
780
+ interface CreatePhaseResponse {
781
+ /** ID of the newly created phase. */
782
+ _id?: string | null;
783
+ }
784
+ interface DeletePhaseRequest {
785
+ /** ID of the phase to delete. */
786
+ _id: string;
787
+ }
788
+ interface DeletePhaseResponse {
789
+ }
790
+ interface MovePhaseRequest {
791
+ /** ID of the workflow that contains the phase to move. */
792
+ workflowId: string;
793
+ /** ID of the phase to move. */
794
+ _id: string;
795
+ /**
796
+ * New phase position, where the first phase is `0`.
797
+ *
798
+ * If a phase already occupies the specified position,
799
+ * that phase and any subsequent phases
800
+ * are shifted to the right by 1.
801
+ */
802
+ newPosition: number | null;
803
+ }
804
+ interface MovePhaseResponse {
805
+ }
806
+ interface ListPhasesResponseNonNullableFields {
807
+ phases: {
808
+ cardsList?: {
809
+ total: number;
810
+ cards: {
811
+ info?: {
812
+ primaryAttachment?: {
813
+ attachmentId: string;
814
+ value: string;
815
+ attachmentType: AttachmentType$1;
816
+ contactId: string;
817
+ };
818
+ };
819
+ }[];
820
+ };
821
+ }[];
822
+ pagination?: {
823
+ offset: number;
824
+ total: number;
825
+ count: number;
826
+ };
827
+ }
828
+ interface GetPhaseResponseNonNullableFields {
829
+ phase?: {
830
+ cardsList?: {
831
+ total: number;
832
+ cards: {
833
+ info?: {
834
+ primaryAttachment?: {
835
+ attachmentId: string;
836
+ value: string;
837
+ attachmentType: AttachmentType$1;
838
+ contactId: string;
839
+ };
840
+ };
841
+ }[];
842
+ };
843
+ };
844
+ }
845
+ interface ListPhasesOptions {
846
+ /** Number of items to return. */
847
+ limit?: number | null;
848
+ /**
849
+ * Number of items to skip in the current sort order.
850
+ *
851
+ * Defaults to `0`.
852
+ */
853
+ offset?: number | null;
854
+ /**
855
+ * Supported fields:
856
+ * `id`, `name`
857
+ *
858
+ * List of fields to sort by.
859
+ * Formatted as `field:direction`,
860
+ * where field is the field name
861
+ * and direction is `asc` (ascending) or `desc` (descending).
862
+ *
863
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
864
+ */
865
+ sort?: string[];
866
+ }
867
+ interface CreatePhaseOptions {
868
+ /**
869
+ * Phase position, where the first phase is `0`.
870
+ *
871
+ * If a phase already occupies the specified position,
872
+ * that phase and any subsequent phases
873
+ * are shifted to the right by 1.
874
+ *
875
+ * Defaults to the last position,
876
+ * which is displayed before the win phase.
877
+ */
878
+ position?: number | null;
879
+ }
880
+ interface MovePhaseIdentifiers {
881
+ /** ID of the workflow that contains the phase to move. */
882
+ workflowId: string;
883
+ /** ID of the phase to move. */
884
+ _id: string;
885
+ }
886
+
887
+ interface HttpClient$1 {
888
+ request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
889
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
890
+ }
891
+ type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
892
+ type HttpResponse$1<T = any> = {
893
+ data: T;
894
+ status: number;
895
+ statusText: string;
896
+ headers: any;
897
+ request?: any;
898
+ };
899
+ type RequestOptions$1<_TResponse = any, Data = any> = {
900
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
901
+ url: string;
902
+ data?: Data;
903
+ params?: URLSearchParams;
904
+ } & APIMetadata$1;
905
+ type APIMetadata$1 = {
906
+ methodFqn?: string;
907
+ entityFqdn?: string;
908
+ packageName?: string;
909
+ };
910
+
911
+ declare global {
912
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
913
+ interface SymbolConstructor {
914
+ readonly observable: symbol;
915
+ }
916
+ }
917
+
918
+ declare const __metadata$1: {
919
+ PACKAGE_NAME: string;
920
+ };
921
+ declare function listPhases(httpClient: HttpClient$1): (workflowId: string, options?: ListPhasesOptions) => Promise<ListPhasesResponse & ListPhasesResponseNonNullableFields>;
922
+ declare function getPhase(httpClient: HttpClient$1): (_id: string) => Promise<Phase$1 & {
923
+ cardsList?: {
924
+ total: number;
925
+ cards: {
926
+ info?: {
927
+ primaryAttachment?: {
928
+ attachmentId: string;
929
+ value: string;
930
+ attachmentType: AttachmentType$1;
931
+ contactId: string;
932
+ } | undefined;
933
+ } | undefined;
934
+ }[];
935
+ } | undefined;
936
+ }>;
937
+ declare function updatePhase(httpClient: HttpClient$1): (_id: string, phase: PhaseInfo$1) => Promise<void>;
938
+ declare function createPhase(httpClient: HttpClient$1): (workflowId: string, phase: PhaseInfo$1, options?: CreatePhaseOptions) => Promise<CreatePhaseResponse>;
939
+ declare function deletePhase(httpClient: HttpClient$1): (_id: string) => Promise<void>;
940
+ declare function movePhase(httpClient: HttpClient$1): (identifiers: MovePhaseIdentifiers, newPosition: number | null) => Promise<void>;
941
+
942
+ type index_d$1_CreatePhaseOptions = CreatePhaseOptions;
943
+ type index_d$1_CreatePhaseRequest = CreatePhaseRequest;
944
+ type index_d$1_CreatePhaseResponse = CreatePhaseResponse;
945
+ type index_d$1_DeletePhaseRequest = DeletePhaseRequest;
946
+ type index_d$1_DeletePhaseResponse = DeletePhaseResponse;
947
+ type index_d$1_GetPhaseRequest = GetPhaseRequest;
948
+ type index_d$1_GetPhaseResponse = GetPhaseResponse;
949
+ type index_d$1_GetPhaseResponseNonNullableFields = GetPhaseResponseNonNullableFields;
950
+ type index_d$1_ListPhasesOptions = ListPhasesOptions;
951
+ type index_d$1_ListPhasesRequest = ListPhasesRequest;
952
+ type index_d$1_ListPhasesResponse = ListPhasesResponse;
953
+ type index_d$1_ListPhasesResponseNonNullableFields = ListPhasesResponseNonNullableFields;
954
+ type index_d$1_MovePhaseIdentifiers = MovePhaseIdentifiers;
955
+ type index_d$1_MovePhaseRequest = MovePhaseRequest;
956
+ type index_d$1_MovePhaseResponse = MovePhaseResponse;
957
+ type index_d$1_QueryPhasesRequest = QueryPhasesRequest;
958
+ type index_d$1_QueryPhasesResponse = QueryPhasesResponse;
959
+ type index_d$1_UpdatePhaseRequest = UpdatePhaseRequest;
960
+ type index_d$1_UpdatePhaseResponse = UpdatePhaseResponse;
961
+ declare const index_d$1_createPhase: typeof createPhase;
962
+ declare const index_d$1_deletePhase: typeof deletePhase;
963
+ declare const index_d$1_getPhase: typeof getPhase;
964
+ declare const index_d$1_listPhases: typeof listPhases;
965
+ declare const index_d$1_movePhase: typeof movePhase;
966
+ declare const index_d$1_updatePhase: typeof updatePhase;
967
+ declare namespace index_d$1 {
968
+ export { type Attachment$1 as Attachment, AttachmentType$1 as AttachmentType, type Card$1 as Card, type CardInfo$1 as CardInfo, type CardsList$1 as CardsList, type index_d$1_CreatePhaseOptions as CreatePhaseOptions, type index_d$1_CreatePhaseRequest as CreatePhaseRequest, type index_d$1_CreatePhaseResponse as CreatePhaseResponse, type index_d$1_DeletePhaseRequest as DeletePhaseRequest, type index_d$1_DeletePhaseResponse as DeletePhaseResponse, type index_d$1_GetPhaseRequest as GetPhaseRequest, type index_d$1_GetPhaseResponse as GetPhaseResponse, type index_d$1_GetPhaseResponseNonNullableFields as GetPhaseResponseNonNullableFields, type index_d$1_ListPhasesOptions as ListPhasesOptions, type index_d$1_ListPhasesRequest as ListPhasesRequest, type index_d$1_ListPhasesResponse as ListPhasesResponse, type index_d$1_ListPhasesResponseNonNullableFields as ListPhasesResponseNonNullableFields, type index_d$1_MovePhaseIdentifiers as MovePhaseIdentifiers, type index_d$1_MovePhaseRequest as MovePhaseRequest, type index_d$1_MovePhaseResponse as MovePhaseResponse, type PaginationResponse$1 as PaginationResponse, type Paging$1 as Paging, type Phase$1 as Phase, type PhaseInfo$1 as PhaseInfo, type Query$1 as Query, type index_d$1_QueryPhasesRequest as QueryPhasesRequest, type index_d$1_QueryPhasesResponse as QueryPhasesResponse, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type index_d$1_UpdatePhaseRequest as UpdatePhaseRequest, type index_d$1_UpdatePhaseResponse as UpdatePhaseResponse, __metadata$1 as __metadata, index_d$1_createPhase as createPhase, index_d$1_deletePhase as deletePhase, index_d$1_getPhase as getPhase, index_d$1_listPhases as listPhases, index_d$1_movePhase as movePhase, index_d$1_updatePhase as updatePhase };
969
+ }
970
+
971
+ interface Workflow {
972
+ /** Workflow information and metadata. */
973
+ info?: WorkflowInfo;
974
+ /**
975
+ * Final phase of the workflow.
976
+ * Cards in `winPhase` are treated as if they are not part of the workflow.
977
+ *
978
+ * Normally, a contact can be attached to only 1 card in the workflow.
979
+ * Moving a contact's card to `winPhase`
980
+ * frees up the contact to be attached to another card in the workflow.
981
+ */
982
+ winPhase?: Phase;
983
+ /** Phases that make up the workflow. */
984
+ phasesList?: PhasesList;
985
+ }
986
+ interface WorkflowInfo {
987
+ /**
988
+ * Workflow ID.
989
+ * @readonly
990
+ */
991
+ _id?: string | null;
992
+ /** Display name for the workflow. */
993
+ name?: string | null;
994
+ /**
995
+ * Workflow description,
996
+ * shown below the workflow's display name in the dashboard.
997
+ */
998
+ description?: string | null;
999
+ /**
1000
+ * @internal
1001
+ * @internal
1002
+ * @readonly
1003
+ * @deprecated
1004
+ */
1005
+ createdAt?: Date;
1006
+ /**
1007
+ * Indicates whether the workflow can be deleted.
1008
+ * @readonly
1009
+ * @deprecated
1010
+ */
1011
+ isDeletable?: boolean | null;
1012
+ /**
1013
+ * Date and time the workflow was created.
1014
+ * @readonly
1015
+ */
1016
+ _createdDate?: Date;
1017
+ }
1018
+ interface Phase {
1019
+ /** Phase information. */
1020
+ info?: PhaseInfo;
1021
+ /** Cards contained in the phase. */
1022
+ cardsList?: CardsList;
1023
+ }
1024
+ interface PhaseInfo {
1025
+ /**
1026
+ * Phase ID.
1027
+ * @readonly
1028
+ */
1029
+ _id?: string | null;
1030
+ /** Display name shown at the top of the phase. */
1031
+ name?: string | null;
1032
+ }
1033
+ /** a list of cards (a page) along with the total number */
1034
+ interface CardsList {
1035
+ /** Total number of cards in the phase. */
1036
+ total?: number;
1037
+ /**
1038
+ * List of cards in the phase.
1039
+ * Sorted according to the card display order, from top to bottom.
1040
+ */
1041
+ cards?: Card[];
1042
+ }
1043
+ interface Card {
1044
+ /** Card details. */
1045
+ info?: CardInfo;
1046
+ }
1047
+ /** entity representing a card-info */
1048
+ interface CardInfo {
1049
+ /**
1050
+ * Card ID.
1051
+ * @readonly
1052
+ */
1053
+ _id?: string | null;
1054
+ /** Display name shown at the top of the card. */
1055
+ name?: string | null;
1056
+ /** Card description. */
1057
+ description?: string | null;
1058
+ /** Details about the contact attached to the card. */
1059
+ primaryAttachment?: Attachment;
1060
+ /** Due date. */
1061
+ dueDate?: Date;
1062
+ /** Name of the app or service that created the contact. */
1063
+ source?: string | null;
1064
+ /**
1065
+ * @internal
1066
+ * @internal
1067
+ * @readonly
1068
+ * @deprecated
1069
+ */
1070
+ createdAt?: Date;
1071
+ /**
1072
+ * @internal
1073
+ * @internal
1074
+ * @readonly
1075
+ * @deprecated
1076
+ */
1077
+ updatedAt?: Date;
1078
+ /**
1079
+ * ID of the phase that currently holds the card.
1080
+ * @readonly
1081
+ */
1082
+ phaseId?: string | null;
1083
+ /**
1084
+ * Date and time the card was created.
1085
+ * @readonly
1086
+ */
1087
+ _createdDate?: Date;
1088
+ /**
1089
+ * Date and time the card was updated.
1090
+ * @readonly
1091
+ */
1092
+ _updatedDate?: Date;
1093
+ }
1094
+ interface Attachment {
1095
+ /**
1096
+ * Attachment ID. For internal use.
1097
+ * @readonly
1098
+ */
1099
+ attachmentId?: string;
1100
+ /**
1101
+ * @internal
1102
+ * @internal
1103
+ * @deprecated
1104
+ */
1105
+ value?: string;
1106
+ /**
1107
+ * @internal
1108
+ * @internal
1109
+ * @deprecated
1110
+ */
1111
+ attachmentType?: AttachmentType;
1112
+ /** ID of the contact attached to the card. */
1113
+ contactId?: string;
1114
+ }
1115
+ /** describes the supported types of attachments (currently only supports Contact which is the default type) */
1116
+ declare enum AttachmentType {
1117
+ ContactType = "ContactType"
1118
+ }
1119
+ /** a list of phases (a page) along with the total number */
1120
+ interface PhasesList {
1121
+ /** Total number of phases in the workflow, excluding `winPhase`. */
1122
+ total?: number;
1123
+ /**
1124
+ * List of phases in the workflow.
1125
+ * Sorted according to the phase display order, from left to right.
1126
+ */
1127
+ phases?: Phase[];
1128
+ }
1129
+ interface ListWorkflowsRequest {
1130
+ /**
1131
+ * Number of workflows to return.
1132
+ * If omitted, all results are returned.
1133
+ */
1134
+ limit?: number | null;
1135
+ /**
1136
+ * Number of items to skip in the current sort order.
1137
+ *
1138
+ * Defaults to `0`.
1139
+ */
1140
+ offset?: number | null;
1141
+ /**
1142
+ * Supported fields:
1143
+ * `id`, `name`, `description`, `createdDate`
1144
+ *
1145
+ * List of fields to sort by.
1146
+ * Formatted as `field:direction`,
1147
+ * where field is the field name
1148
+ * and direction is `asc` (ascending) or `desc` (descending).
1149
+ *
1150
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
1151
+ */
1152
+ sort?: string[];
1153
+ }
1154
+ interface ListWorkflowsResponse {
1155
+ /** Retrieved list of workflows. */
1156
+ workflows?: WorkflowInfo[];
1157
+ /** Metadata for the page of results. */
1158
+ pagination?: PaginationResponse;
1159
+ }
1160
+ interface PaginationResponse {
1161
+ /** Number of items that were skipped in the current sort order. */
1162
+ offset?: number;
1163
+ /** Total number of items that matched the filter. */
1164
+ total?: number;
1165
+ /** Number of returned items. */
1166
+ count?: number;
1167
+ }
1168
+ interface QueryWorkflowsRequest {
1169
+ /** Query options. */
1170
+ query?: Query;
1171
+ }
1172
+ interface Query {
1173
+ /**
1174
+ * Filter object in the following format:
1175
+ * `"filter" : {
1176
+ * "fieldName1": "value1",
1177
+ * "fieldName2":{"$operator":"value2"}
1178
+ * }`
1179
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
1180
+ */
1181
+ filter?: any;
1182
+ /**
1183
+ * Sort object in the following format:
1184
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
1185
+ */
1186
+ sort?: Sorting[];
1187
+ /** Paging options to limit and skip the number of items. */
1188
+ paging?: Paging;
1189
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
1190
+ fields?: string[];
1191
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
1192
+ fieldsets?: string[];
1193
+ }
1194
+ interface Sorting {
1195
+ /** Name of the field to sort by. */
1196
+ fieldName?: string;
1197
+ /** Sort order. */
1198
+ order?: SortOrder;
1199
+ }
1200
+ declare enum SortOrder {
1201
+ ASC = "ASC",
1202
+ DESC = "DESC"
1203
+ }
1204
+ interface Paging {
1205
+ /** Number of items to load. */
1206
+ limit?: number | null;
1207
+ /** Number of items to skip in the current sort order. */
1208
+ offset?: number | null;
1209
+ }
1210
+ interface QueryWorkflowsResponse {
1211
+ /** List of workflows that matched the query. */
1212
+ workflows?: Workflow[];
1213
+ /** Metadata for the paginated results. */
1214
+ pagination?: PaginationResponse;
1215
+ }
1216
+ interface GetWorkflowRequest {
1217
+ /** ID of the workflow to retrieve. */
1218
+ _id: string;
1219
+ /**
1220
+ * Maximum number of cards to return per phase.
1221
+ * To retrieve additional pages of cards, use
1222
+ * [List Cards](../cards/listCards)
1223
+ * (in the Cards API).
1224
+ */
1225
+ cardsPerPhase?: number | null;
1226
+ }
1227
+ interface GetWorkflowResponse {
1228
+ /** Requested workflow. */
1229
+ workflow?: Workflow;
1230
+ }
1231
+ interface UpdateWorkflowRequest {
1232
+ /** ID of the workflow to update. */
1233
+ _id: string;
1234
+ /** Workflow info. */
1235
+ workflow?: WorkflowInfo;
1236
+ }
1237
+ interface UpdateWorkflowResponse {
1238
+ }
1239
+ interface CreateWorkflowRequest {
1240
+ /** Workflow details. */
1241
+ workflow?: WorkflowInfo;
1242
+ }
1243
+ interface CreateWorkflowResponse {
1244
+ /** ID of the new workflow. */
1245
+ _id?: string | null;
1246
+ }
1247
+ interface DeleteWorkflowRequest {
1248
+ /** ID of the workflow to delete. */
1249
+ _id: string;
1250
+ }
1251
+ interface DeleteWorkflowResponse {
1252
+ }
1253
+ interface SetupWorkflowRequest {
1254
+ }
1255
+ interface SetupWorkflowResponse {
1256
+ }
1257
+ interface ListWorkflowsResponseNonNullableFields {
1258
+ workflows: WorkflowInfo[];
1259
+ pagination?: {
1260
+ offset: number;
1261
+ total: number;
1262
+ count: number;
1263
+ };
1264
+ }
1265
+ interface GetWorkflowResponseNonNullableFields {
1266
+ workflow?: {
1267
+ winPhase?: {
1268
+ cardsList?: {
1269
+ total: number;
1270
+ cards: {
1271
+ info?: {
1272
+ primaryAttachment?: {
1273
+ attachmentId: string;
1274
+ value: string;
1275
+ attachmentType: AttachmentType;
1276
+ contactId: string;
1277
+ };
1278
+ };
1279
+ }[];
1280
+ };
1281
+ };
1282
+ phasesList?: {
1283
+ total: number;
1284
+ phases: {
1285
+ cardsList?: {
1286
+ total: number;
1287
+ cards: {
1288
+ info?: {
1289
+ primaryAttachment?: {
1290
+ attachmentId: string;
1291
+ value: string;
1292
+ attachmentType: AttachmentType;
1293
+ contactId: string;
1294
+ };
1295
+ };
1296
+ }[];
1297
+ };
1298
+ }[];
1299
+ };
1300
+ };
1301
+ }
1302
+ interface ListWorkflowsOptions {
1303
+ /**
1304
+ * Number of workflows to return.
1305
+ * If omitted, all results are returned.
1306
+ */
1307
+ limit?: number | null;
1308
+ /**
1309
+ * Number of items to skip in the current sort order.
1310
+ *
1311
+ * Defaults to `0`.
1312
+ */
1313
+ offset?: number | null;
1314
+ /**
1315
+ * Supported fields:
1316
+ * `id`, `name`, `description`, `createdDate`
1317
+ *
1318
+ * List of fields to sort by.
1319
+ * Formatted as `field:direction`,
1320
+ * where field is the field name
1321
+ * and direction is `asc` (ascending) or `desc` (descending).
1322
+ *
1323
+ * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
1324
+ */
1325
+ sort?: string[];
1326
+ }
1327
+
1328
+ interface HttpClient {
1329
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1330
+ fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
1331
+ }
1332
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
1333
+ type HttpResponse<T = any> = {
1334
+ data: T;
1335
+ status: number;
1336
+ statusText: string;
1337
+ headers: any;
1338
+ request?: any;
1339
+ };
1340
+ type RequestOptions<_TResponse = any, Data = any> = {
1341
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
1342
+ url: string;
1343
+ data?: Data;
1344
+ params?: URLSearchParams;
1345
+ } & APIMetadata;
1346
+ type APIMetadata = {
1347
+ methodFqn?: string;
1348
+ entityFqdn?: string;
1349
+ packageName?: string;
1350
+ };
1351
+
1352
+ declare global {
1353
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1354
+ interface SymbolConstructor {
1355
+ readonly observable: symbol;
1356
+ }
1357
+ }
1358
+
1359
+ declare const __metadata: {
1360
+ PACKAGE_NAME: string;
1361
+ };
1362
+ declare function listWorkflows(httpClient: HttpClient): (options?: ListWorkflowsOptions) => Promise<ListWorkflowsResponse & ListWorkflowsResponseNonNullableFields>;
1363
+ declare function getWorkflow(httpClient: HttpClient): (_id: string, cardsPerPhase: number | null) => Promise<Workflow & {
1364
+ winPhase?: {
1365
+ cardsList?: {
1366
+ total: number;
1367
+ cards: {
1368
+ info?: {
1369
+ primaryAttachment?: {
1370
+ attachmentId: string;
1371
+ value: string;
1372
+ attachmentType: AttachmentType;
1373
+ contactId: string;
1374
+ } | undefined;
1375
+ } | undefined;
1376
+ }[];
1377
+ } | undefined;
1378
+ } | undefined;
1379
+ phasesList?: {
1380
+ total: number;
1381
+ phases: {
1382
+ cardsList?: {
1383
+ total: number;
1384
+ cards: {
1385
+ info?: {
1386
+ primaryAttachment?: {
1387
+ attachmentId: string;
1388
+ value: string;
1389
+ attachmentType: AttachmentType;
1390
+ contactId: string;
1391
+ } | undefined;
1392
+ } | undefined;
1393
+ }[];
1394
+ } | undefined;
1395
+ }[];
1396
+ } | undefined;
1397
+ }>;
1398
+ declare function updateWorkflow(httpClient: HttpClient): (_id: string, workflow: WorkflowInfo) => Promise<void>;
1399
+ declare function createWorkflow(httpClient: HttpClient): (workflow: WorkflowInfo) => Promise<CreateWorkflowResponse>;
1400
+ declare function deleteWorkflow(httpClient: HttpClient): (_id: string) => Promise<void>;
1401
+
1402
+ type index_d_Attachment = Attachment;
1403
+ type index_d_AttachmentType = AttachmentType;
1404
+ declare const index_d_AttachmentType: typeof AttachmentType;
1405
+ type index_d_Card = Card;
1406
+ type index_d_CardInfo = CardInfo;
1407
+ type index_d_CardsList = CardsList;
1408
+ type index_d_CreateWorkflowRequest = CreateWorkflowRequest;
1409
+ type index_d_CreateWorkflowResponse = CreateWorkflowResponse;
1410
+ type index_d_DeleteWorkflowRequest = DeleteWorkflowRequest;
1411
+ type index_d_DeleteWorkflowResponse = DeleteWorkflowResponse;
1412
+ type index_d_GetWorkflowRequest = GetWorkflowRequest;
1413
+ type index_d_GetWorkflowResponse = GetWorkflowResponse;
1414
+ type index_d_GetWorkflowResponseNonNullableFields = GetWorkflowResponseNonNullableFields;
1415
+ type index_d_ListWorkflowsOptions = ListWorkflowsOptions;
1416
+ type index_d_ListWorkflowsRequest = ListWorkflowsRequest;
1417
+ type index_d_ListWorkflowsResponse = ListWorkflowsResponse;
1418
+ type index_d_ListWorkflowsResponseNonNullableFields = ListWorkflowsResponseNonNullableFields;
1419
+ type index_d_PaginationResponse = PaginationResponse;
1420
+ type index_d_Paging = Paging;
1421
+ type index_d_Phase = Phase;
1422
+ type index_d_PhaseInfo = PhaseInfo;
1423
+ type index_d_PhasesList = PhasesList;
1424
+ type index_d_Query = Query;
1425
+ type index_d_QueryWorkflowsRequest = QueryWorkflowsRequest;
1426
+ type index_d_QueryWorkflowsResponse = QueryWorkflowsResponse;
1427
+ type index_d_SetupWorkflowRequest = SetupWorkflowRequest;
1428
+ type index_d_SetupWorkflowResponse = SetupWorkflowResponse;
1429
+ type index_d_SortOrder = SortOrder;
1430
+ declare const index_d_SortOrder: typeof SortOrder;
1431
+ type index_d_Sorting = Sorting;
1432
+ type index_d_UpdateWorkflowRequest = UpdateWorkflowRequest;
1433
+ type index_d_UpdateWorkflowResponse = UpdateWorkflowResponse;
1434
+ type index_d_Workflow = Workflow;
1435
+ type index_d_WorkflowInfo = WorkflowInfo;
1436
+ declare const index_d___metadata: typeof __metadata;
1437
+ declare const index_d_createWorkflow: typeof createWorkflow;
1438
+ declare const index_d_deleteWorkflow: typeof deleteWorkflow;
1439
+ declare const index_d_getWorkflow: typeof getWorkflow;
1440
+ declare const index_d_listWorkflows: typeof listWorkflows;
1441
+ declare const index_d_updateWorkflow: typeof updateWorkflow;
1442
+ declare namespace index_d {
1443
+ export { type index_d_Attachment as Attachment, index_d_AttachmentType as AttachmentType, type index_d_Card as Card, type index_d_CardInfo as CardInfo, type index_d_CardsList as CardsList, type index_d_CreateWorkflowRequest as CreateWorkflowRequest, type index_d_CreateWorkflowResponse as CreateWorkflowResponse, type index_d_DeleteWorkflowRequest as DeleteWorkflowRequest, type index_d_DeleteWorkflowResponse as DeleteWorkflowResponse, type index_d_GetWorkflowRequest as GetWorkflowRequest, type index_d_GetWorkflowResponse as GetWorkflowResponse, type index_d_GetWorkflowResponseNonNullableFields as GetWorkflowResponseNonNullableFields, type index_d_ListWorkflowsOptions as ListWorkflowsOptions, type index_d_ListWorkflowsRequest as ListWorkflowsRequest, type index_d_ListWorkflowsResponse as ListWorkflowsResponse, type index_d_ListWorkflowsResponseNonNullableFields as ListWorkflowsResponseNonNullableFields, type index_d_PaginationResponse as PaginationResponse, type index_d_Paging as Paging, type index_d_Phase as Phase, type index_d_PhaseInfo as PhaseInfo, type index_d_PhasesList as PhasesList, type index_d_Query as Query, type index_d_QueryWorkflowsRequest as QueryWorkflowsRequest, type index_d_QueryWorkflowsResponse as QueryWorkflowsResponse, type index_d_SetupWorkflowRequest as SetupWorkflowRequest, type index_d_SetupWorkflowResponse as SetupWorkflowResponse, index_d_SortOrder as SortOrder, type index_d_Sorting as Sorting, type index_d_UpdateWorkflowRequest as UpdateWorkflowRequest, type index_d_UpdateWorkflowResponse as UpdateWorkflowResponse, type index_d_Workflow as Workflow, type index_d_WorkflowInfo as WorkflowInfo, index_d___metadata as __metadata, index_d_createWorkflow as createWorkflow, index_d_deleteWorkflow as deleteWorkflow, index_d_getWorkflow as getWorkflow, index_d_listWorkflows as listWorkflows, index_d_updateWorkflow as updateWorkflow };
1444
+ }
1445
+
1446
+ export { index_d$2 as cards, index_d$1 as phases, index_d as workflows };