@wix/workflows 1.0.19 → 1.0.21

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 (133) hide show
  1. package/build/cjs/context.d.ts +3 -3
  2. package/build/cjs/context.js +3 -3
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +3 -3
  5. package/build/cjs/index.js +3 -3
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +3 -3
  8. package/build/cjs/meta.js +3 -3
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +3 -3
  11. package/build/es/context.js +3 -3
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +3 -3
  14. package/build/es/index.js +3 -3
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +3 -3
  17. package/build/es/meta.js +3 -3
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +13 -9
  20. package/build/cjs/index.typings.d.ts +0 -3
  21. package/build/cjs/index.typings.js +0 -30
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/workflows-v1-card.context.d.ts +0 -10
  24. package/build/cjs/src/workflows-v1-card.context.js +0 -93
  25. package/build/cjs/src/workflows-v1-card.context.js.map +0 -1
  26. package/build/cjs/src/workflows-v1-card.http.d.ts +0 -114
  27. package/build/cjs/src/workflows-v1-card.http.js +0 -356
  28. package/build/cjs/src/workflows-v1-card.http.js.map +0 -1
  29. package/build/cjs/src/workflows-v1-card.meta.d.ts +0 -37
  30. package/build/cjs/src/workflows-v1-card.meta.js +0 -180
  31. package/build/cjs/src/workflows-v1-card.meta.js.map +0 -1
  32. package/build/cjs/src/workflows-v1-card.public.d.ts +0 -24
  33. package/build/cjs/src/workflows-v1-card.public.js +0 -57
  34. package/build/cjs/src/workflows-v1-card.public.js.map +0 -1
  35. package/build/cjs/src/workflows-v1-card.types.d.ts +0 -337
  36. package/build/cjs/src/workflows-v1-card.types.js +0 -14
  37. package/build/cjs/src/workflows-v1-card.types.js.map +0 -1
  38. package/build/cjs/src/workflows-v1-card.universal.d.ts +0 -569
  39. package/build/cjs/src/workflows-v1-card.universal.js +0 -605
  40. package/build/cjs/src/workflows-v1-card.universal.js.map +0 -1
  41. package/build/cjs/src/workflows-v1-phase.context.d.ts +0 -8
  42. package/build/cjs/src/workflows-v1-phase.context.js +0 -71
  43. package/build/cjs/src/workflows-v1-phase.context.js.map +0 -1
  44. package/build/cjs/src/workflows-v1-phase.http.d.ts +0 -76
  45. package/build/cjs/src/workflows-v1-phase.http.js +0 -259
  46. package/build/cjs/src/workflows-v1-phase.http.js.map +0 -1
  47. package/build/cjs/src/workflows-v1-phase.meta.d.ts +0 -31
  48. package/build/cjs/src/workflows-v1-phase.meta.js +0 -142
  49. package/build/cjs/src/workflows-v1-phase.meta.js.map +0 -1
  50. package/build/cjs/src/workflows-v1-phase.public.d.ts +0 -27
  51. package/build/cjs/src/workflows-v1-phase.public.js +0 -45
  52. package/build/cjs/src/workflows-v1-phase.public.js.map +0 -1
  53. package/build/cjs/src/workflows-v1-phase.types.d.ts +0 -274
  54. package/build/cjs/src/workflows-v1-phase.types.js +0 -14
  55. package/build/cjs/src/workflows-v1-phase.types.js.map +0 -1
  56. package/build/cjs/src/workflows-v1-phase.universal.d.ts +0 -429
  57. package/build/cjs/src/workflows-v1-phase.universal.js +0 -459
  58. package/build/cjs/src/workflows-v1-phase.universal.js.map +0 -1
  59. package/build/cjs/src/workflows-v1-workflow.context.d.ts +0 -7
  60. package/build/cjs/src/workflows-v1-workflow.context.js +0 -60
  61. package/build/cjs/src/workflows-v1-workflow.context.js.map +0 -1
  62. package/build/cjs/src/workflows-v1-workflow.http.d.ts +0 -55
  63. package/build/cjs/src/workflows-v1-workflow.http.js +0 -258
  64. package/build/cjs/src/workflows-v1-workflow.http.js.map +0 -1
  65. package/build/cjs/src/workflows-v1-workflow.meta.d.ts +0 -23
  66. package/build/cjs/src/workflows-v1-workflow.meta.js +0 -123
  67. package/build/cjs/src/workflows-v1-workflow.meta.js.map +0 -1
  68. package/build/cjs/src/workflows-v1-workflow.public.d.ts +0 -46
  69. package/build/cjs/src/workflows-v1-workflow.public.js +0 -39
  70. package/build/cjs/src/workflows-v1-workflow.public.js.map +0 -1
  71. package/build/cjs/src/workflows-v1-workflow.types.d.ts +0 -319
  72. package/build/cjs/src/workflows-v1-workflow.types.js +0 -14
  73. package/build/cjs/src/workflows-v1-workflow.types.js.map +0 -1
  74. package/build/cjs/src/workflows-v1-workflow.universal.d.ts +0 -427
  75. package/build/cjs/src/workflows-v1-workflow.universal.js +0 -366
  76. package/build/cjs/src/workflows-v1-workflow.universal.js.map +0 -1
  77. package/build/es/index.typings.d.ts +0 -3
  78. package/build/es/index.typings.js +0 -4
  79. package/build/es/index.typings.js.map +0 -1
  80. package/build/es/src/workflows-v1-card.context.d.ts +0 -10
  81. package/build/es/src/workflows-v1-card.context.js +0 -82
  82. package/build/es/src/workflows-v1-card.context.js.map +0 -1
  83. package/build/es/src/workflows-v1-card.http.d.ts +0 -114
  84. package/build/es/src/workflows-v1-card.http.js +0 -345
  85. package/build/es/src/workflows-v1-card.http.js.map +0 -1
  86. package/build/es/src/workflows-v1-card.meta.d.ts +0 -37
  87. package/build/es/src/workflows-v1-card.meta.js +0 -146
  88. package/build/es/src/workflows-v1-card.meta.js.map +0 -1
  89. package/build/es/src/workflows-v1-card.public.d.ts +0 -24
  90. package/build/es/src/workflows-v1-card.public.js +0 -44
  91. package/build/es/src/workflows-v1-card.public.js.map +0 -1
  92. package/build/es/src/workflows-v1-card.types.d.ts +0 -337
  93. package/build/es/src/workflows-v1-card.types.js +0 -11
  94. package/build/es/src/workflows-v1-card.types.js.map +0 -1
  95. package/build/es/src/workflows-v1-card.universal.d.ts +0 -569
  96. package/build/es/src/workflows-v1-card.universal.js +0 -571
  97. package/build/es/src/workflows-v1-card.universal.js.map +0 -1
  98. package/build/es/src/workflows-v1-phase.context.d.ts +0 -8
  99. package/build/es/src/workflows-v1-phase.context.js +0 -62
  100. package/build/es/src/workflows-v1-phase.context.js.map +0 -1
  101. package/build/es/src/workflows-v1-phase.http.d.ts +0 -76
  102. package/build/es/src/workflows-v1-phase.http.js +0 -250
  103. package/build/es/src/workflows-v1-phase.http.js.map +0 -1
  104. package/build/es/src/workflows-v1-phase.meta.d.ts +0 -31
  105. package/build/es/src/workflows-v1-phase.meta.js +0 -110
  106. package/build/es/src/workflows-v1-phase.meta.js.map +0 -1
  107. package/build/es/src/workflows-v1-phase.public.d.ts +0 -27
  108. package/build/es/src/workflows-v1-phase.public.js +0 -34
  109. package/build/es/src/workflows-v1-phase.public.js.map +0 -1
  110. package/build/es/src/workflows-v1-phase.types.d.ts +0 -274
  111. package/build/es/src/workflows-v1-phase.types.js +0 -11
  112. package/build/es/src/workflows-v1-phase.types.js.map +0 -1
  113. package/build/es/src/workflows-v1-phase.universal.d.ts +0 -429
  114. package/build/es/src/workflows-v1-phase.universal.js +0 -427
  115. package/build/es/src/workflows-v1-phase.universal.js.map +0 -1
  116. package/build/es/src/workflows-v1-workflow.context.d.ts +0 -7
  117. package/build/es/src/workflows-v1-workflow.context.js +0 -52
  118. package/build/es/src/workflows-v1-workflow.context.js.map +0 -1
  119. package/build/es/src/workflows-v1-workflow.http.d.ts +0 -55
  120. package/build/es/src/workflows-v1-workflow.http.js +0 -250
  121. package/build/es/src/workflows-v1-workflow.http.js.map +0 -1
  122. package/build/es/src/workflows-v1-workflow.meta.d.ts +0 -23
  123. package/build/es/src/workflows-v1-workflow.meta.js +0 -92
  124. package/build/es/src/workflows-v1-workflow.meta.js.map +0 -1
  125. package/build/es/src/workflows-v1-workflow.public.d.ts +0 -46
  126. package/build/es/src/workflows-v1-workflow.public.js +0 -29
  127. package/build/es/src/workflows-v1-workflow.public.js.map +0 -1
  128. package/build/es/src/workflows-v1-workflow.types.d.ts +0 -319
  129. package/build/es/src/workflows-v1-workflow.types.js +0 -11
  130. package/build/es/src/workflows-v1-workflow.types.js.map +0 -1
  131. package/build/es/src/workflows-v1-workflow.universal.d.ts +0 -427
  132. package/build/es/src/workflows-v1-workflow.universal.js +0 -335
  133. package/build/es/src/workflows-v1-workflow.universal.js.map +0 -1
@@ -1,569 +0,0 @@
1
- export interface Card {
2
- /** Card details. */
3
- info?: CardInfo;
4
- }
5
- /** entity representing a card-info */
6
- export interface CardInfo {
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;
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
- */
27
- createdAt?: Date;
28
- /**
29
- * @internal
30
- * @internal
31
- * @readonly
32
- */
33
- updatedAt?: Date;
34
- /**
35
- * ID of the phase that currently holds the card.
36
- * @readonly
37
- */
38
- phaseId?: string | null;
39
- /**
40
- * Date and time the card was created.
41
- * @readonly
42
- */
43
- _createdDate?: Date;
44
- /**
45
- * Date and time the card was updated.
46
- * @readonly
47
- */
48
- _updatedDate?: Date;
49
- }
50
- export interface Attachment {
51
- /**
52
- * Attachment ID. For internal use.
53
- * @readonly
54
- */
55
- attachmentId?: string;
56
- /**
57
- * @internal
58
- * @internal */
59
- value?: string;
60
- /**
61
- * @internal
62
- * @internal */
63
- attachmentType?: AttachmentType;
64
- /** ID of the contact attached to the card. */
65
- contactId?: string;
66
- }
67
- /** describes the supported types of attachments (currently only supports Contact which is the default type) */
68
- export declare enum AttachmentType {
69
- ContactType = "ContactType"
70
- }
71
- export interface QueryCardsRequest {
72
- /** Query, sort, and paging options. */
73
- query?: Query;
74
- }
75
- export interface Query {
76
- /**
77
- * Filter object in the following format:
78
- * `"filter" : {
79
- * "fieldName1": "value1",
80
- * "fieldName2":{"$operator":"value2"}
81
- * }`
82
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
83
- */
84
- filter?: any;
85
- /**
86
- * Sort object in the following format:
87
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
88
- */
89
- sort?: Sorting[];
90
- /** Paging options to limit and skip the number of items. */
91
- paging?: Paging;
92
- /** 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. */
93
- fields?: string[];
94
- /** 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. */
95
- fieldsets?: string[];
96
- }
97
- export interface Sorting {
98
- /** Name of the field to sort by. */
99
- fieldName?: string;
100
- /** Sort order. */
101
- order?: SortOrder;
102
- }
103
- export declare enum SortOrder {
104
- ASC = "ASC",
105
- DESC = "DESC"
106
- }
107
- export interface Paging {
108
- /** Number of items to load. */
109
- limit?: number | null;
110
- /** Number of items to skip in the current sort order. */
111
- offset?: number | null;
112
- }
113
- export interface QueryCardsResponse {
114
- /** List of cards that matched the query criteria. */
115
- cards?: Card[];
116
- /** Metadata for the page of results. */
117
- pagination?: PaginationResponse;
118
- }
119
- export interface PaginationResponse {
120
- /** Number of items that were skipped in the current sort order. */
121
- offset?: number;
122
- /** Total number of items that matched the filter. */
123
- total?: number;
124
- /** Number of returned items. */
125
- count?: number;
126
- }
127
- export interface ListCardsRequest {
128
- /** ID of the workflow whose cards will be listed. */
129
- workflowId: string;
130
- /** Filters for cards in the specified phase. */
131
- phaseId?: string | null;
132
- /**
133
- * Number of items to return.
134
- *
135
- * Defaults to `50`.
136
- */
137
- limit?: number | null;
138
- /**
139
- * Number of items to skip in the current sort order.
140
- *
141
- * Defaults to `0`.
142
- */
143
- offset?: number | null;
144
- /** Filters for cards with the specified contact ID. */
145
- attachmentValue?: string | null;
146
- /**
147
- * Filters for archived cards.
148
- * If set to `true`,
149
- * only archived cards are returned.
150
- * If set to `false`,
151
- * only cards that are not archived are returned.
152
- *
153
- * Defaults to `false`.
154
- */
155
- fetchArchived?: boolean | null;
156
- /**
157
- * Supported fields:
158
- * `id`, `name`, `createdDate`, `updatedDate`, `phaseId`
159
- *
160
- * List of fields to sort by.
161
- * Formatted as `field:direction`,
162
- * where field is the field name
163
- * and direction is `asc` (ascending) or `desc` (descending).
164
- *
165
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
166
- */
167
- sort?: string[];
168
- }
169
- export interface ListCardsResponse {
170
- /** List of cards. */
171
- cards?: Card[];
172
- /** Metadata for the page of results. */
173
- pagination?: PaginationResponse;
174
- }
175
- export interface GetCardRequest {
176
- /** ID of the card to retrieve. */
177
- _id: string;
178
- }
179
- export interface GetCardResponse {
180
- /** Requested card. */
181
- card?: Card;
182
- }
183
- export interface UpdateCardRequest {
184
- /** ID of the card to update. */
185
- _id: string;
186
- /** Card details. */
187
- cardInfo?: CardInfo;
188
- }
189
- export interface UpdateCardResponse {
190
- }
191
- export interface CreateCardRequest {
192
- /** ID of the workflow to create the card in. */
193
- workflowId: string;
194
- /** ID of the phase to create the card in. */
195
- phaseId: string;
196
- /** Card details. */
197
- card?: CardInfo;
198
- /**
199
- * Card position, where the first card is `0`.
200
- *
201
- * If a card already occupies the specified position,
202
- * that card and any subsequent cards are shifted to the right by 1.
203
- *
204
- * Defaults to the last position.
205
- */
206
- position?: number | null;
207
- }
208
- export interface CreateCardResponse {
209
- /** ID of the newly created card. */
210
- _id?: string | null;
211
- }
212
- export interface DeleteCardRequest {
213
- /** ID of the card to delete. */
214
- _id: string;
215
- }
216
- export interface DeleteCardResponse {
217
- }
218
- export interface MoveCardRequest {
219
- /** ID of the card to move. */
220
- _id: string;
221
- /** ID of the phase to move the card to. */
222
- newPhaseId?: string | null;
223
- /** Position of the card in the phase, where the first card is `0`. */
224
- newPosition?: number | null;
225
- }
226
- export interface MoveCardResponse {
227
- }
228
- export interface RestoreCardRequest {
229
- /** ID of the card to restore. */
230
- _id: string;
231
- /** ID of the phase to restore the card to. */
232
- newPhaseId: string;
233
- /**
234
- * Position of the restored card in the phase,
235
- * where the first card is `0`.
236
- */
237
- newPosition?: number | null;
238
- }
239
- export interface RestoreCardResponse {
240
- }
241
- export interface ArchiveCardRequest {
242
- /** ID of the card to archive. */
243
- _id: string;
244
- }
245
- export interface ArchiveCardResponse {
246
- }
247
- export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
248
- createdEvent?: EntityCreatedEvent<T>;
249
- updatedEvent?: EntityUpdatedEvent<T>;
250
- deletedEvent?: EntityDeletedEvent<T>;
251
- actionEvent?: ActionEvent<T>;
252
- /**
253
- * Unique event ID.
254
- * Allows clients to ignore duplicate webhooks.
255
- */
256
- _id?: string;
257
- /**
258
- * Assumes actions are also always typed to an entity_type
259
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
260
- */
261
- entityFqdn?: string;
262
- /**
263
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
264
- * This is although the created/updated/deleted notion is duplication of the oneof types
265
- * Example: created/updated/deleted/started/completed/email_opened
266
- */
267
- slug?: string;
268
- /** ID of the entity associated with the event. */
269
- entityId?: string;
270
- /** Event timestamp. */
271
- eventTime?: Date;
272
- /**
273
- * Whether the event was triggered as a result of a privacy regulation application
274
- * (for example, GDPR).
275
- */
276
- triggeredByAnonymizeRequest?: boolean | null;
277
- /** If present, indicates the action that triggered the event. */
278
- originatedFrom?: string | null;
279
- /**
280
- * A sequence number defining the order of updates to the underlying entity.
281
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
282
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
283
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
284
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
285
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
286
- */
287
- entityEventSequence?: string | null;
288
- }
289
- export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
290
- }
291
- export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
292
- }
293
- export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
294
- }
295
- export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
296
- }
297
- /** @oneof */
298
- export interface DomainEventBodyOneOf<T> {
299
- createdEvent?: EntityCreatedEvent<T>;
300
- updatedEvent?: EntityUpdatedEvent<T>;
301
- deletedEvent?: EntityDeletedEvent<T>;
302
- actionEvent?: ActionEvent<T>;
303
- }
304
- export interface EntityCreatedEvent<T> {
305
- entity?: T;
306
- }
307
- export interface EntityUpdatedEvent<T> {
308
- /**
309
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
310
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
311
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
312
- */
313
- currentEntity?: T;
314
- }
315
- export interface EntityDeletedEvent<T> {
316
- /** Entity that was deleted */
317
- deletedEntity?: T | null;
318
- }
319
- export interface ActionEvent<T> {
320
- body?: T;
321
- }
322
- export interface ListCardsResponseNonNullableFields {
323
- cards: {
324
- info?: {
325
- primaryAttachment?: {
326
- attachmentId: string;
327
- value: string;
328
- attachmentType: AttachmentType;
329
- contactId: string;
330
- };
331
- };
332
- }[];
333
- pagination?: {
334
- offset: number;
335
- total: number;
336
- count: number;
337
- };
338
- }
339
- export interface GetCardResponseNonNullableFields {
340
- card?: {
341
- info?: {
342
- primaryAttachment?: {
343
- attachmentId: string;
344
- value: string;
345
- attachmentType: AttachmentType;
346
- contactId: string;
347
- };
348
- };
349
- };
350
- }
351
- /**
352
- * Retrieves a list of a workflow's cards.
353
- *
354
- *
355
- * The `listCards()` function returns a Promise that resolves to a list of the specified workflow's cards.
356
- *
357
- *
358
- * Use the `options` parameter to specify which cards to retrieve and in which order to retrieve them. Must use either `phaseId` or `fetchOnlyArchived`.
359
- *
360
- *
361
- * Cards can be sorted based on their `"id"`, `"name"`, `"phaseId"`, `"createdDate"`, `"updatedDate"`, `"source"`, and `"position"`.
362
- *
363
- *
364
- * If no `limit` parameter is passed, the first 50 cards are returned.
365
- *
366
- *
367
- * Sort order defaults to by `"phaseId"` and then by `"position"` ascending.
368
- *
369
- *
370
- * This function requires you to specify the ID of a workflow. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
371
- * @param workflowId - ID of the workflow whose cards will be listed.
372
- * @public
373
- * @requiredField workflowId
374
- * @param options - Options to use when retrieving the list of cards.
375
- */
376
- export declare function listCards(workflowId: string, options?: ListCardsOptions): Promise<ListCardsResponse & ListCardsResponseNonNullableFields>;
377
- export interface ListCardsOptions {
378
- /** Filters for cards in the specified phase. */
379
- phaseId?: string | null;
380
- /**
381
- * Number of items to return.
382
- *
383
- * Defaults to `50`.
384
- */
385
- limit?: number | null;
386
- /**
387
- * Number of items to skip in the current sort order.
388
- *
389
- * Defaults to `0`.
390
- */
391
- offset?: number | null;
392
- /** Filters for cards with the specified contact ID. */
393
- attachmentValue?: string | null;
394
- /**
395
- * Filters for archived cards.
396
- * If set to `true`,
397
- * only archived cards are returned.
398
- * If set to `false`,
399
- * only cards that are not archived are returned.
400
- *
401
- * Defaults to `false`.
402
- */
403
- fetchArchived?: boolean | null;
404
- /**
405
- * Supported fields:
406
- * `id`, `name`, `createdDate`, `updatedDate`, `phaseId`
407
- *
408
- * List of fields to sort by.
409
- * Formatted as `field:direction`,
410
- * where field is the field name
411
- * and direction is `asc` (ascending) or `desc` (descending).
412
- *
413
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
414
- */
415
- sort?: string[];
416
- }
417
- /**
418
- * Retrieves a workflow card by ID.
419
- *
420
- *
421
- * The `getCard()` function returns a Promise that resolves to the card with the specified ID.
422
- *
423
- *
424
- * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
425
- * @param _id - ID of the card to retrieve.
426
- * @public
427
- * @requiredField _id
428
- * @returns Requested card.
429
- */
430
- export declare function getCard(_id: string): Promise<Card & NonNullable<GetCardResponseNonNullableFields>['card']>;
431
- /**
432
- * Updates an existing workflow card.
433
- *
434
- *
435
- * The `updateCard()` function returns a Promise that resolves when the card has been updated with the specified values.
436
- *
437
- *
438
- * `contactId` is not a required field, but if the parameter is not passed, the field will default to empty and the card will not be associated with any contact.
439
- *
440
- *
441
- * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
442
- * @param _id - ID of the card to update.
443
- * @param cardInfo - Card details.
444
- * @public
445
- * @requiredField _id
446
- * @requiredField cardInfo
447
- * @param options - Options to use when updating a card.
448
- */
449
- export declare function updateCard(_id: string, cardInfo: CardInfo): Promise<void>;
450
- /**
451
- * Creates a new workflow card.
452
- *
453
- *
454
- * The `createCard()` function returns a Promise that resolves to the created card's ID when the card is created in the specified workflow phase.
455
- *
456
- * Pass a value for the `position` parameter to specify the newly created card's position within the specified phase. Positions are zero-based, meaning the first position is `0`.
457
- *
458
- * When omitted, the newly created card is added to the specified phase as the top card within the phase.
459
- *
460
- *
461
- * This function requires you to specify the ID of a workflow and phase. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
462
- *
463
- * > **Note:**
464
- * > Each workflow is limited to 5,000 cards.
465
- * > If this limit is reached, `createCard()` throws an error.
466
- * > [Archive cards](#archivecard) when they're no longer needed
467
- * > to reduce card count and avoid hitting the limit.
468
- * @param card - Card details.
469
- * @public
470
- * @requiredField card
471
- * @requiredField identifiers
472
- * @requiredField identifiers.phaseId
473
- * @requiredField identifiers.workflowId
474
- * @param options - Options to use when creating a card.
475
- */
476
- export declare function createCard(identifiers: CreateCardIdentifiers, card: CardInfo, options?: CreateCardOptions): Promise<CreateCardResponse>;
477
- export interface CreateCardIdentifiers {
478
- /** ID of the workflow to create the card in. */
479
- workflowId: string;
480
- /** ID of the phase to create the card in. */
481
- phaseId: string;
482
- }
483
- export interface CreateCardOptions {
484
- /**
485
- * Card position, where the first card is `0`.
486
- *
487
- * If a card already occupies the specified position,
488
- * that card and any subsequent cards are shifted to the right by 1.
489
- *
490
- * Defaults to the last position.
491
- */
492
- position?: number | null;
493
- }
494
- /**
495
- * Deletes a workflow card by ID.
496
- *
497
- *
498
- * The `deleteCard()` function returns a Promise when the specified card has been deleted.
499
- *
500
- * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
501
- * @param _id - ID of the card to delete.
502
- * @public
503
- * @requiredField _id
504
- */
505
- export declare function deleteCard(_id: string): Promise<void>;
506
- /**
507
- * Moves a card to a new position within a workflow.
508
- *
509
- *
510
- * The `moveCard()` function returns a Promise when the specified card has been moved to the new position.
511
- *
512
- * Use the `options` parameter to specify the phase and position within that phase to move the card to. Positions are zero-based, meaning the first position is `0`.
513
- *
514
- * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
515
- * @param _id - ID of the card to move.
516
- * @public
517
- * @requiredField _id
518
- * @param options - Information about where to move the card.
519
- */
520
- export declare function moveCard(_id: string, options?: MoveCardOptions): Promise<void>;
521
- export interface MoveCardOptions {
522
- /** ID of the phase to move the card to. */
523
- newPhaseId?: string | null;
524
- /** Position of the card in the phase, where the first card is `0`. */
525
- newPosition?: number | null;
526
- }
527
- /**
528
- * Restores an archived workflow card.
529
- *
530
- *
531
- * The `restoreCard()` function returns a Promise that resolves when the archived card has been restored.
532
- *
533
- *
534
- * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
535
- *
536
- *
537
- * > **Note:**
538
- * > Each workflow is limited to 5,000 cards.
539
- * > If this limit is reached, `createCard()` throws an error.
540
- * > [Archive cards](#archivecard) when they're no longer needed
541
- * > to reduce card count and avoid hitting the limit.
542
- * @param _id - ID of the card to restore.
543
- * @param newPhaseId - ID of the phase to restore the card to.
544
- * @public
545
- * @requiredField _id
546
- * @requiredField newPhaseId
547
- * @param options - Options to use when restoring a card.
548
- */
549
- export declare function restoreCard(_id: string, newPhaseId: string, options?: RestoreCardOptions): Promise<void>;
550
- export interface RestoreCardOptions {
551
- /**
552
- * Position of the restored card in the phase,
553
- * where the first card is `0`.
554
- */
555
- newPosition?: number | null;
556
- }
557
- /**
558
- * Archives a workflow card.
559
- *
560
- *
561
- * The `archiveCard()` function returns a Promise that resolves when the card has been archived.
562
- *
563
- *
564
- * This function requires you to specify the ID of a card. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
565
- * @param _id - ID of the card to archive.
566
- * @public
567
- * @requiredField _id
568
- */
569
- export declare function archiveCard(_id: string): Promise<void>;