@wix/workflows 1.0.25 → 1.0.27
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.
- package/context/package.json +2 -1
- package/meta/package.json +2 -1
- package/package.json +13 -7
- package/type-bundles/context.bundle.d.ts +733 -0
- package/type-bundles/index.bundle.d.ts +1376 -0
- package/type-bundles/meta.bundle.d.ts +1617 -0
|
@@ -0,0 +1,733 @@
|
|
|
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<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
184
|
+
interface HttpClient {
|
|
185
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
186
|
+
}
|
|
187
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
188
|
+
type HttpResponse<T = any> = {
|
|
189
|
+
data: T;
|
|
190
|
+
status: number;
|
|
191
|
+
statusText: string;
|
|
192
|
+
headers: any;
|
|
193
|
+
request?: any;
|
|
194
|
+
};
|
|
195
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
196
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
197
|
+
url: string;
|
|
198
|
+
data?: Data;
|
|
199
|
+
params?: URLSearchParams;
|
|
200
|
+
} & APIMetadata;
|
|
201
|
+
type APIMetadata = {
|
|
202
|
+
methodFqn?: string;
|
|
203
|
+
entityFqdn?: string;
|
|
204
|
+
packageName?: string;
|
|
205
|
+
};
|
|
206
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
207
|
+
|
|
208
|
+
declare function listCards$1(httpClient: HttpClient): (workflowId: string, options?: ListCardsOptions) => Promise<ListCardsResponse & ListCardsResponseNonNullableFields>;
|
|
209
|
+
declare function getCard$1(httpClient: HttpClient): (_id: string) => Promise<Card$2 & {
|
|
210
|
+
info?: {
|
|
211
|
+
primaryAttachment?: {
|
|
212
|
+
attachmentId: string;
|
|
213
|
+
value: string;
|
|
214
|
+
attachmentType: AttachmentType$2;
|
|
215
|
+
contactId: string;
|
|
216
|
+
} | undefined;
|
|
217
|
+
} | undefined;
|
|
218
|
+
}>;
|
|
219
|
+
declare function updateCard$1(httpClient: HttpClient): (_id: string, cardInfo: CardInfo$2) => Promise<void>;
|
|
220
|
+
declare function createCard$1(httpClient: HttpClient): (identifiers: CreateCardIdentifiers, card: CardInfo$2, options?: CreateCardOptions) => Promise<CreateCardResponse>;
|
|
221
|
+
declare function deleteCard$1(httpClient: HttpClient): (_id: string) => Promise<void>;
|
|
222
|
+
declare function moveCard$1(httpClient: HttpClient): (_id: string, options?: MoveCardOptions) => Promise<void>;
|
|
223
|
+
declare function restoreCard$1(httpClient: HttpClient): (_id: string, newPhaseId: string, options?: RestoreCardOptions) => Promise<void>;
|
|
224
|
+
declare function archiveCard$1(httpClient: HttpClient): (_id: string) => Promise<void>;
|
|
225
|
+
|
|
226
|
+
declare const listCards: BuildRESTFunction<typeof listCards$1>;
|
|
227
|
+
declare const getCard: BuildRESTFunction<typeof getCard$1>;
|
|
228
|
+
declare const updateCard: BuildRESTFunction<typeof updateCard$1>;
|
|
229
|
+
declare const createCard: BuildRESTFunction<typeof createCard$1>;
|
|
230
|
+
declare const deleteCard: BuildRESTFunction<typeof deleteCard$1>;
|
|
231
|
+
declare const moveCard: BuildRESTFunction<typeof moveCard$1>;
|
|
232
|
+
declare const restoreCard: BuildRESTFunction<typeof restoreCard$1>;
|
|
233
|
+
declare const archiveCard: BuildRESTFunction<typeof archiveCard$1>;
|
|
234
|
+
|
|
235
|
+
declare const context$2_archiveCard: typeof archiveCard;
|
|
236
|
+
declare const context$2_createCard: typeof createCard;
|
|
237
|
+
declare const context$2_deleteCard: typeof deleteCard;
|
|
238
|
+
declare const context$2_getCard: typeof getCard;
|
|
239
|
+
declare const context$2_listCards: typeof listCards;
|
|
240
|
+
declare const context$2_moveCard: typeof moveCard;
|
|
241
|
+
declare const context$2_restoreCard: typeof restoreCard;
|
|
242
|
+
declare const context$2_updateCard: typeof updateCard;
|
|
243
|
+
declare namespace context$2 {
|
|
244
|
+
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 };
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
interface Phase$1 {
|
|
248
|
+
/** Phase information. */
|
|
249
|
+
info?: PhaseInfo$1;
|
|
250
|
+
/** Cards contained in the phase. */
|
|
251
|
+
cardsList?: CardsList$1;
|
|
252
|
+
}
|
|
253
|
+
interface PhaseInfo$1 {
|
|
254
|
+
/**
|
|
255
|
+
* Phase ID.
|
|
256
|
+
* @readonly
|
|
257
|
+
*/
|
|
258
|
+
_id?: string | null;
|
|
259
|
+
/** Display name shown at the top of the phase. */
|
|
260
|
+
name?: string | null;
|
|
261
|
+
}
|
|
262
|
+
/** a list of cards (a page) along with the total number */
|
|
263
|
+
interface CardsList$1 {
|
|
264
|
+
/** Total number of cards in the phase. */
|
|
265
|
+
total?: number;
|
|
266
|
+
/**
|
|
267
|
+
* List of cards in the phase.
|
|
268
|
+
* Sorted according to the card display order, from top to bottom.
|
|
269
|
+
*/
|
|
270
|
+
cards?: Card$1[];
|
|
271
|
+
}
|
|
272
|
+
interface Card$1 {
|
|
273
|
+
/** Card details. */
|
|
274
|
+
info?: CardInfo$1;
|
|
275
|
+
}
|
|
276
|
+
/** entity representing a card-info */
|
|
277
|
+
interface CardInfo$1 {
|
|
278
|
+
/**
|
|
279
|
+
* Card ID.
|
|
280
|
+
* @readonly
|
|
281
|
+
*/
|
|
282
|
+
_id?: string | null;
|
|
283
|
+
/** Display name shown at the top of the card. */
|
|
284
|
+
name?: string | null;
|
|
285
|
+
/** Card description. */
|
|
286
|
+
description?: string | null;
|
|
287
|
+
/** Details about the contact attached to the card. */
|
|
288
|
+
primaryAttachment?: Attachment$1;
|
|
289
|
+
/** Due date. */
|
|
290
|
+
dueDate?: Date;
|
|
291
|
+
/** Name of the app or service that created the contact. */
|
|
292
|
+
source?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* @internal
|
|
295
|
+
* @internal
|
|
296
|
+
* @readonly
|
|
297
|
+
* @deprecated
|
|
298
|
+
*/
|
|
299
|
+
createdAt?: Date;
|
|
300
|
+
/**
|
|
301
|
+
* @internal
|
|
302
|
+
* @internal
|
|
303
|
+
* @readonly
|
|
304
|
+
* @deprecated
|
|
305
|
+
*/
|
|
306
|
+
updatedAt?: Date;
|
|
307
|
+
/**
|
|
308
|
+
* ID of the phase that currently holds the card.
|
|
309
|
+
* @readonly
|
|
310
|
+
*/
|
|
311
|
+
phaseId?: string | null;
|
|
312
|
+
/**
|
|
313
|
+
* Date and time the card was created.
|
|
314
|
+
* @readonly
|
|
315
|
+
*/
|
|
316
|
+
_createdDate?: Date;
|
|
317
|
+
/**
|
|
318
|
+
* Date and time the card was updated.
|
|
319
|
+
* @readonly
|
|
320
|
+
*/
|
|
321
|
+
_updatedDate?: Date;
|
|
322
|
+
}
|
|
323
|
+
interface Attachment$1 {
|
|
324
|
+
/**
|
|
325
|
+
* Attachment ID. For internal use.
|
|
326
|
+
* @readonly
|
|
327
|
+
*/
|
|
328
|
+
attachmentId?: string;
|
|
329
|
+
/**
|
|
330
|
+
* @internal
|
|
331
|
+
* @internal
|
|
332
|
+
* @deprecated
|
|
333
|
+
*/
|
|
334
|
+
value?: string;
|
|
335
|
+
/**
|
|
336
|
+
* @internal
|
|
337
|
+
* @internal
|
|
338
|
+
* @deprecated
|
|
339
|
+
*/
|
|
340
|
+
attachmentType?: AttachmentType$1;
|
|
341
|
+
/** ID of the contact attached to the card. */
|
|
342
|
+
contactId?: string;
|
|
343
|
+
}
|
|
344
|
+
/** describes the supported types of attachments (currently only supports Contact which is the default type) */
|
|
345
|
+
declare enum AttachmentType$1 {
|
|
346
|
+
ContactType = "ContactType"
|
|
347
|
+
}
|
|
348
|
+
interface PaginationResponse$1 {
|
|
349
|
+
/** Number of items that were skipped in the current sort order. */
|
|
350
|
+
offset?: number;
|
|
351
|
+
/** Total number of items that matched the filter. */
|
|
352
|
+
total?: number;
|
|
353
|
+
/** Number of returned items. */
|
|
354
|
+
count?: number;
|
|
355
|
+
}
|
|
356
|
+
interface ListPhasesResponse {
|
|
357
|
+
/** List of phases. */
|
|
358
|
+
phases?: Phase$1[];
|
|
359
|
+
/** Metadata for the page of results. */
|
|
360
|
+
pagination?: PaginationResponse$1;
|
|
361
|
+
}
|
|
362
|
+
interface CreatePhaseResponse {
|
|
363
|
+
/** ID of the newly created phase. */
|
|
364
|
+
_id?: string | null;
|
|
365
|
+
}
|
|
366
|
+
interface ListPhasesResponseNonNullableFields {
|
|
367
|
+
phases: {
|
|
368
|
+
cardsList?: {
|
|
369
|
+
total: number;
|
|
370
|
+
cards: {
|
|
371
|
+
info?: {
|
|
372
|
+
primaryAttachment?: {
|
|
373
|
+
attachmentId: string;
|
|
374
|
+
value: string;
|
|
375
|
+
attachmentType: AttachmentType$1;
|
|
376
|
+
contactId: string;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
379
|
+
}[];
|
|
380
|
+
};
|
|
381
|
+
}[];
|
|
382
|
+
pagination?: {
|
|
383
|
+
offset: number;
|
|
384
|
+
total: number;
|
|
385
|
+
count: number;
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
interface ListPhasesOptions {
|
|
389
|
+
/** Number of items to return. */
|
|
390
|
+
limit?: number | null;
|
|
391
|
+
/**
|
|
392
|
+
* Number of items to skip in the current sort order.
|
|
393
|
+
*
|
|
394
|
+
* Defaults to `0`.
|
|
395
|
+
*/
|
|
396
|
+
offset?: number | null;
|
|
397
|
+
/**
|
|
398
|
+
* Supported fields:
|
|
399
|
+
* `id`, `name`
|
|
400
|
+
*
|
|
401
|
+
* List of fields to sort by.
|
|
402
|
+
* Formatted as `field:direction`,
|
|
403
|
+
* where field is the field name
|
|
404
|
+
* and direction is `asc` (ascending) or `desc` (descending).
|
|
405
|
+
*
|
|
406
|
+
* Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
|
|
407
|
+
*/
|
|
408
|
+
sort?: string[];
|
|
409
|
+
}
|
|
410
|
+
interface CreatePhaseOptions {
|
|
411
|
+
/**
|
|
412
|
+
* Phase position, where the first phase is `0`.
|
|
413
|
+
*
|
|
414
|
+
* If a phase already occupies the specified position,
|
|
415
|
+
* that phase and any subsequent phases
|
|
416
|
+
* are shifted to the right by 1.
|
|
417
|
+
*
|
|
418
|
+
* Defaults to the last position,
|
|
419
|
+
* which is displayed before the win phase.
|
|
420
|
+
*/
|
|
421
|
+
position?: number | null;
|
|
422
|
+
}
|
|
423
|
+
interface MovePhaseIdentifiers {
|
|
424
|
+
/** ID of the workflow that contains the phase to move. */
|
|
425
|
+
workflowId: string;
|
|
426
|
+
/** ID of the phase to move. */
|
|
427
|
+
_id: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
declare function listPhases$1(httpClient: HttpClient): (workflowId: string, options?: ListPhasesOptions) => Promise<ListPhasesResponse & ListPhasesResponseNonNullableFields>;
|
|
431
|
+
declare function getPhase$1(httpClient: HttpClient): (_id: string) => Promise<Phase$1 & {
|
|
432
|
+
cardsList?: {
|
|
433
|
+
total: number;
|
|
434
|
+
cards: {
|
|
435
|
+
info?: {
|
|
436
|
+
primaryAttachment?: {
|
|
437
|
+
attachmentId: string;
|
|
438
|
+
value: string;
|
|
439
|
+
attachmentType: AttachmentType$1;
|
|
440
|
+
contactId: string;
|
|
441
|
+
} | undefined;
|
|
442
|
+
} | undefined;
|
|
443
|
+
}[];
|
|
444
|
+
} | undefined;
|
|
445
|
+
}>;
|
|
446
|
+
declare function updatePhase$1(httpClient: HttpClient): (_id: string, phase: PhaseInfo$1) => Promise<void>;
|
|
447
|
+
declare function createPhase$1(httpClient: HttpClient): (workflowId: string, phase: PhaseInfo$1, options?: CreatePhaseOptions) => Promise<CreatePhaseResponse>;
|
|
448
|
+
declare function deletePhase$1(httpClient: HttpClient): (_id: string) => Promise<void>;
|
|
449
|
+
declare function movePhase$1(httpClient: HttpClient): (identifiers: MovePhaseIdentifiers, newPosition: number | null) => Promise<void>;
|
|
450
|
+
|
|
451
|
+
declare const listPhases: BuildRESTFunction<typeof listPhases$1>;
|
|
452
|
+
declare const getPhase: BuildRESTFunction<typeof getPhase$1>;
|
|
453
|
+
declare const updatePhase: BuildRESTFunction<typeof updatePhase$1>;
|
|
454
|
+
declare const createPhase: BuildRESTFunction<typeof createPhase$1>;
|
|
455
|
+
declare const deletePhase: BuildRESTFunction<typeof deletePhase$1>;
|
|
456
|
+
declare const movePhase: BuildRESTFunction<typeof movePhase$1>;
|
|
457
|
+
|
|
458
|
+
declare const context$1_createPhase: typeof createPhase;
|
|
459
|
+
declare const context$1_deletePhase: typeof deletePhase;
|
|
460
|
+
declare const context$1_getPhase: typeof getPhase;
|
|
461
|
+
declare const context$1_listPhases: typeof listPhases;
|
|
462
|
+
declare const context$1_movePhase: typeof movePhase;
|
|
463
|
+
declare const context$1_updatePhase: typeof updatePhase;
|
|
464
|
+
declare namespace context$1 {
|
|
465
|
+
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 };
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
interface Workflow {
|
|
469
|
+
/** Workflow information and metadata. */
|
|
470
|
+
info?: WorkflowInfo;
|
|
471
|
+
/**
|
|
472
|
+
* Final phase of the workflow.
|
|
473
|
+
* Cards in `winPhase` are treated as if they are not part of the workflow.
|
|
474
|
+
*
|
|
475
|
+
* Normally, a contact can be attached to only 1 card in the workflow.
|
|
476
|
+
* Moving a contact's card to `winPhase`
|
|
477
|
+
* frees up the contact to be attached to another card in the workflow.
|
|
478
|
+
*/
|
|
479
|
+
winPhase?: Phase;
|
|
480
|
+
/** Phases that make up the workflow. */
|
|
481
|
+
phasesList?: PhasesList;
|
|
482
|
+
}
|
|
483
|
+
interface WorkflowInfo {
|
|
484
|
+
/**
|
|
485
|
+
* Workflow ID.
|
|
486
|
+
* @readonly
|
|
487
|
+
*/
|
|
488
|
+
_id?: string | null;
|
|
489
|
+
/** Display name for the workflow. */
|
|
490
|
+
name?: string | null;
|
|
491
|
+
/**
|
|
492
|
+
* Workflow description,
|
|
493
|
+
* shown below the workflow's display name in the dashboard.
|
|
494
|
+
*/
|
|
495
|
+
description?: string | null;
|
|
496
|
+
/**
|
|
497
|
+
* @internal
|
|
498
|
+
* @internal
|
|
499
|
+
* @readonly
|
|
500
|
+
* @deprecated
|
|
501
|
+
*/
|
|
502
|
+
createdAt?: Date;
|
|
503
|
+
/**
|
|
504
|
+
* Indicates whether the workflow can be deleted.
|
|
505
|
+
* @readonly
|
|
506
|
+
* @deprecated
|
|
507
|
+
*/
|
|
508
|
+
isDeletable?: boolean | null;
|
|
509
|
+
/**
|
|
510
|
+
* Date and time the workflow was created.
|
|
511
|
+
* @readonly
|
|
512
|
+
*/
|
|
513
|
+
_createdDate?: Date;
|
|
514
|
+
}
|
|
515
|
+
interface Phase {
|
|
516
|
+
/** Phase information. */
|
|
517
|
+
info?: PhaseInfo;
|
|
518
|
+
/** Cards contained in the phase. */
|
|
519
|
+
cardsList?: CardsList;
|
|
520
|
+
}
|
|
521
|
+
interface PhaseInfo {
|
|
522
|
+
/**
|
|
523
|
+
* Phase ID.
|
|
524
|
+
* @readonly
|
|
525
|
+
*/
|
|
526
|
+
_id?: string | null;
|
|
527
|
+
/** Display name shown at the top of the phase. */
|
|
528
|
+
name?: string | null;
|
|
529
|
+
}
|
|
530
|
+
/** a list of cards (a page) along with the total number */
|
|
531
|
+
interface CardsList {
|
|
532
|
+
/** Total number of cards in the phase. */
|
|
533
|
+
total?: number;
|
|
534
|
+
/**
|
|
535
|
+
* List of cards in the phase.
|
|
536
|
+
* Sorted according to the card display order, from top to bottom.
|
|
537
|
+
*/
|
|
538
|
+
cards?: Card[];
|
|
539
|
+
}
|
|
540
|
+
interface Card {
|
|
541
|
+
/** Card details. */
|
|
542
|
+
info?: CardInfo;
|
|
543
|
+
}
|
|
544
|
+
/** entity representing a card-info */
|
|
545
|
+
interface CardInfo {
|
|
546
|
+
/**
|
|
547
|
+
* Card ID.
|
|
548
|
+
* @readonly
|
|
549
|
+
*/
|
|
550
|
+
_id?: string | null;
|
|
551
|
+
/** Display name shown at the top of the card. */
|
|
552
|
+
name?: string | null;
|
|
553
|
+
/** Card description. */
|
|
554
|
+
description?: string | null;
|
|
555
|
+
/** Details about the contact attached to the card. */
|
|
556
|
+
primaryAttachment?: Attachment;
|
|
557
|
+
/** Due date. */
|
|
558
|
+
dueDate?: Date;
|
|
559
|
+
/** Name of the app or service that created the contact. */
|
|
560
|
+
source?: string | null;
|
|
561
|
+
/**
|
|
562
|
+
* @internal
|
|
563
|
+
* @internal
|
|
564
|
+
* @readonly
|
|
565
|
+
* @deprecated
|
|
566
|
+
*/
|
|
567
|
+
createdAt?: Date;
|
|
568
|
+
/**
|
|
569
|
+
* @internal
|
|
570
|
+
* @internal
|
|
571
|
+
* @readonly
|
|
572
|
+
* @deprecated
|
|
573
|
+
*/
|
|
574
|
+
updatedAt?: Date;
|
|
575
|
+
/**
|
|
576
|
+
* ID of the phase that currently holds the card.
|
|
577
|
+
* @readonly
|
|
578
|
+
*/
|
|
579
|
+
phaseId?: string | null;
|
|
580
|
+
/**
|
|
581
|
+
* Date and time the card was created.
|
|
582
|
+
* @readonly
|
|
583
|
+
*/
|
|
584
|
+
_createdDate?: Date;
|
|
585
|
+
/**
|
|
586
|
+
* Date and time the card was updated.
|
|
587
|
+
* @readonly
|
|
588
|
+
*/
|
|
589
|
+
_updatedDate?: Date;
|
|
590
|
+
}
|
|
591
|
+
interface Attachment {
|
|
592
|
+
/**
|
|
593
|
+
* Attachment ID. For internal use.
|
|
594
|
+
* @readonly
|
|
595
|
+
*/
|
|
596
|
+
attachmentId?: string;
|
|
597
|
+
/**
|
|
598
|
+
* @internal
|
|
599
|
+
* @internal
|
|
600
|
+
* @deprecated
|
|
601
|
+
*/
|
|
602
|
+
value?: string;
|
|
603
|
+
/**
|
|
604
|
+
* @internal
|
|
605
|
+
* @internal
|
|
606
|
+
* @deprecated
|
|
607
|
+
*/
|
|
608
|
+
attachmentType?: AttachmentType;
|
|
609
|
+
/** ID of the contact attached to the card. */
|
|
610
|
+
contactId?: string;
|
|
611
|
+
}
|
|
612
|
+
/** describes the supported types of attachments (currently only supports Contact which is the default type) */
|
|
613
|
+
declare enum AttachmentType {
|
|
614
|
+
ContactType = "ContactType"
|
|
615
|
+
}
|
|
616
|
+
/** a list of phases (a page) along with the total number */
|
|
617
|
+
interface PhasesList {
|
|
618
|
+
/** Total number of phases in the workflow, excluding `winPhase`. */
|
|
619
|
+
total?: number;
|
|
620
|
+
/**
|
|
621
|
+
* List of phases in the workflow.
|
|
622
|
+
* Sorted according to the phase display order, from left to right.
|
|
623
|
+
*/
|
|
624
|
+
phases?: Phase[];
|
|
625
|
+
}
|
|
626
|
+
interface ListWorkflowsResponse {
|
|
627
|
+
/** Retrieved list of workflows. */
|
|
628
|
+
workflows?: WorkflowInfo[];
|
|
629
|
+
/** Metadata for the page of results. */
|
|
630
|
+
pagination?: PaginationResponse;
|
|
631
|
+
}
|
|
632
|
+
interface PaginationResponse {
|
|
633
|
+
/** Number of items that were skipped in the current sort order. */
|
|
634
|
+
offset?: number;
|
|
635
|
+
/** Total number of items that matched the filter. */
|
|
636
|
+
total?: number;
|
|
637
|
+
/** Number of returned items. */
|
|
638
|
+
count?: number;
|
|
639
|
+
}
|
|
640
|
+
interface CreateWorkflowResponse {
|
|
641
|
+
/** ID of the new workflow. */
|
|
642
|
+
_id?: string | null;
|
|
643
|
+
}
|
|
644
|
+
interface ListWorkflowsResponseNonNullableFields {
|
|
645
|
+
workflows: WorkflowInfo[];
|
|
646
|
+
pagination?: {
|
|
647
|
+
offset: number;
|
|
648
|
+
total: number;
|
|
649
|
+
count: number;
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
interface ListWorkflowsOptions {
|
|
653
|
+
/**
|
|
654
|
+
* Number of workflows to return.
|
|
655
|
+
* If omitted, all results are returned.
|
|
656
|
+
*/
|
|
657
|
+
limit?: number | null;
|
|
658
|
+
/**
|
|
659
|
+
* Number of items to skip in the current sort order.
|
|
660
|
+
*
|
|
661
|
+
* Defaults to `0`.
|
|
662
|
+
*/
|
|
663
|
+
offset?: number | null;
|
|
664
|
+
/**
|
|
665
|
+
* Supported fields:
|
|
666
|
+
* `id`, `name`, `description`, `createdDate`
|
|
667
|
+
*
|
|
668
|
+
* List of fields to sort by.
|
|
669
|
+
* Formatted as `field:direction`,
|
|
670
|
+
* where field is the field name
|
|
671
|
+
* and direction is `asc` (ascending) or `desc` (descending).
|
|
672
|
+
*
|
|
673
|
+
* Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
|
|
674
|
+
*/
|
|
675
|
+
sort?: string[];
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
declare function listWorkflows$1(httpClient: HttpClient): (options?: ListWorkflowsOptions) => Promise<ListWorkflowsResponse & ListWorkflowsResponseNonNullableFields>;
|
|
679
|
+
declare function getWorkflow$1(httpClient: HttpClient): (_id: string, cardsPerPhase: number | null) => Promise<Workflow & {
|
|
680
|
+
winPhase?: {
|
|
681
|
+
cardsList?: {
|
|
682
|
+
total: number;
|
|
683
|
+
cards: {
|
|
684
|
+
info?: {
|
|
685
|
+
primaryAttachment?: {
|
|
686
|
+
attachmentId: string;
|
|
687
|
+
value: string;
|
|
688
|
+
attachmentType: AttachmentType;
|
|
689
|
+
contactId: string;
|
|
690
|
+
} | undefined;
|
|
691
|
+
} | undefined;
|
|
692
|
+
}[];
|
|
693
|
+
} | undefined;
|
|
694
|
+
} | undefined;
|
|
695
|
+
phasesList?: {
|
|
696
|
+
total: number;
|
|
697
|
+
phases: {
|
|
698
|
+
cardsList?: {
|
|
699
|
+
total: number;
|
|
700
|
+
cards: {
|
|
701
|
+
info?: {
|
|
702
|
+
primaryAttachment?: {
|
|
703
|
+
attachmentId: string;
|
|
704
|
+
value: string;
|
|
705
|
+
attachmentType: AttachmentType;
|
|
706
|
+
contactId: string;
|
|
707
|
+
} | undefined;
|
|
708
|
+
} | undefined;
|
|
709
|
+
}[];
|
|
710
|
+
} | undefined;
|
|
711
|
+
}[];
|
|
712
|
+
} | undefined;
|
|
713
|
+
}>;
|
|
714
|
+
declare function updateWorkflow$1(httpClient: HttpClient): (_id: string, workflow: WorkflowInfo) => Promise<void>;
|
|
715
|
+
declare function createWorkflow$1(httpClient: HttpClient): (workflow: WorkflowInfo) => Promise<CreateWorkflowResponse>;
|
|
716
|
+
declare function deleteWorkflow$1(httpClient: HttpClient): (_id: string) => Promise<void>;
|
|
717
|
+
|
|
718
|
+
declare const listWorkflows: BuildRESTFunction<typeof listWorkflows$1>;
|
|
719
|
+
declare const getWorkflow: BuildRESTFunction<typeof getWorkflow$1>;
|
|
720
|
+
declare const updateWorkflow: BuildRESTFunction<typeof updateWorkflow$1>;
|
|
721
|
+
declare const createWorkflow: BuildRESTFunction<typeof createWorkflow$1>;
|
|
722
|
+
declare const deleteWorkflow: BuildRESTFunction<typeof deleteWorkflow$1>;
|
|
723
|
+
|
|
724
|
+
declare const context_createWorkflow: typeof createWorkflow;
|
|
725
|
+
declare const context_deleteWorkflow: typeof deleteWorkflow;
|
|
726
|
+
declare const context_getWorkflow: typeof getWorkflow;
|
|
727
|
+
declare const context_listWorkflows: typeof listWorkflows;
|
|
728
|
+
declare const context_updateWorkflow: typeof updateWorkflow;
|
|
729
|
+
declare namespace context {
|
|
730
|
+
export { context_createWorkflow as createWorkflow, context_deleteWorkflow as deleteWorkflow, context_getWorkflow as getWorkflow, context_listWorkflows as listWorkflows, context_updateWorkflow as updateWorkflow };
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
export { context$2 as cards, context$1 as phases, context as workflows };
|