@wix/workflows 1.0.36 → 1.0.37

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.
@@ -1,2093 +0,0 @@
1
- type HostModule<T, H extends Host> = {
2
- __type: 'host';
3
- create(host: H): T;
4
- };
5
- type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
- type Host<Environment = unknown> = {
7
- channel: {
8
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
- disconnect: () => void;
10
- } | Promise<{
11
- disconnect: () => void;
12
- }>;
13
- };
14
- environment?: Environment;
15
- /**
16
- * Optional name of the environment, use for logging
17
- */
18
- name?: string;
19
- /**
20
- * Optional bast url to use for API requests, for example `www.wixapis.com`
21
- */
22
- apiBaseUrl?: string;
23
- /**
24
- * Possible data to be provided by every host, for cross cutting concerns
25
- * like internationalization, billing, etc.
26
- */
27
- essentials?: {
28
- /**
29
- * The language of the currently viewed session
30
- */
31
- language?: string;
32
- /**
33
- * The locale of the currently viewed session
34
- */
35
- locale?: string;
36
- /**
37
- * Any headers that should be passed through to the API requests
38
- */
39
- passThroughHeaders?: Record<string, string>;
40
- };
41
- };
42
-
43
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
- interface HttpClient {
45
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
46
- fetchWithAuth: typeof fetch;
47
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
48
- getActiveToken?: () => string | undefined;
49
- }
50
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
- type HttpResponse<T = any> = {
52
- data: T;
53
- status: number;
54
- statusText: string;
55
- headers: any;
56
- request?: any;
57
- };
58
- type RequestOptions<_TResponse = any, Data = any> = {
59
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
60
- url: string;
61
- data?: Data;
62
- params?: URLSearchParams;
63
- } & APIMetadata;
64
- type APIMetadata = {
65
- methodFqn?: string;
66
- entityFqdn?: string;
67
- packageName?: string;
68
- };
69
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
- type EventDefinition<Payload = unknown, Type extends string = string> = {
71
- __type: 'event-definition';
72
- type: Type;
73
- isDomainEvent?: boolean;
74
- transformations?: (envelope: unknown) => Payload;
75
- __payload: Payload;
76
- };
77
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
80
-
81
- type ServicePluginMethodInput = {
82
- request: any;
83
- metadata: any;
84
- };
85
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
- type ServicePluginMethodMetadata = {
87
- name: string;
88
- primaryHttpMappingPath: string;
89
- transformations: {
90
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
91
- toREST: (...args: unknown[]) => unknown;
92
- };
93
- };
94
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
95
- __type: 'service-plugin-definition';
96
- componentType: string;
97
- methods: ServicePluginMethodMetadata[];
98
- __contract: Contract;
99
- };
100
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
103
-
104
- type RequestContext = {
105
- isSSR: boolean;
106
- host: string;
107
- protocol?: string;
108
- };
109
- type ResponseTransformer = (data: any, headers?: any) => any;
110
- /**
111
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
112
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
113
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
114
- */
115
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
- type AmbassadorRequestOptions<T = any> = {
117
- _?: T;
118
- url?: string;
119
- method?: Method;
120
- params?: any;
121
- data?: any;
122
- transformResponse?: ResponseTransformer | ResponseTransformer[];
123
- };
124
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
125
- __isAmbassador: boolean;
126
- };
127
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
129
-
130
- declare global {
131
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
132
- interface SymbolConstructor {
133
- readonly observable: symbol;
134
- }
135
- }
136
-
137
- declare const emptyObjectSymbol: unique symbol;
138
-
139
- /**
140
- Represents a strictly empty plain object, the `{}` value.
141
-
142
- When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
143
-
144
- @example
145
- ```
146
- import type {EmptyObject} from 'type-fest';
147
-
148
- // The following illustrates the problem with `{}`.
149
- const foo1: {} = {}; // Pass
150
- const foo2: {} = []; // Pass
151
- const foo3: {} = 42; // Pass
152
- const foo4: {} = {a: 1}; // Pass
153
-
154
- // With `EmptyObject` only the first case is valid.
155
- const bar1: EmptyObject = {}; // Pass
156
- const bar2: EmptyObject = 42; // Fail
157
- const bar3: EmptyObject = []; // Fail
158
- const bar4: EmptyObject = {a: 1}; // Fail
159
- ```
160
-
161
- Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
162
-
163
- @category Object
164
- */
165
- type EmptyObject = {[emptyObjectSymbol]?: never};
166
-
167
- /**
168
- Returns a boolean for whether the two given types are equal.
169
-
170
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
171
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
172
-
173
- Use-cases:
174
- - If you want to make a conditional branch based on the result of a comparison of two types.
175
-
176
- @example
177
- ```
178
- import type {IsEqual} from 'type-fest';
179
-
180
- // This type returns a boolean for whether the given array includes the given item.
181
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
182
- type Includes<Value extends readonly any[], Item> =
183
- Value extends readonly [Value[0], ...infer rest]
184
- ? IsEqual<Value[0], Item> extends true
185
- ? true
186
- : Includes<rest, Item>
187
- : false;
188
- ```
189
-
190
- @category Type Guard
191
- @category Utilities
192
- */
193
- type IsEqual<A, B> =
194
- (<G>() => G extends A ? 1 : 2) extends
195
- (<G>() => G extends B ? 1 : 2)
196
- ? true
197
- : false;
198
-
199
- /**
200
- Filter out keys from an object.
201
-
202
- Returns `never` if `Exclude` is strictly equal to `Key`.
203
- Returns `never` if `Key` extends `Exclude`.
204
- Returns `Key` otherwise.
205
-
206
- @example
207
- ```
208
- type Filtered = Filter<'foo', 'foo'>;
209
- //=> never
210
- ```
211
-
212
- @example
213
- ```
214
- type Filtered = Filter<'bar', string>;
215
- //=> never
216
- ```
217
-
218
- @example
219
- ```
220
- type Filtered = Filter<'bar', 'foo'>;
221
- //=> 'bar'
222
- ```
223
-
224
- @see {Except}
225
- */
226
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
227
-
228
- type ExceptOptions = {
229
- /**
230
- Disallow assigning non-specified properties.
231
-
232
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
233
-
234
- @default false
235
- */
236
- requireExactProps?: boolean;
237
- };
238
-
239
- /**
240
- Create a type from an object type without certain keys.
241
-
242
- We recommend setting the `requireExactProps` option to `true`.
243
-
244
- This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
245
-
246
- This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
247
-
248
- @example
249
- ```
250
- import type {Except} from 'type-fest';
251
-
252
- type Foo = {
253
- a: number;
254
- b: string;
255
- };
256
-
257
- type FooWithoutA = Except<Foo, 'a'>;
258
- //=> {b: string}
259
-
260
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
261
- //=> errors: 'a' does not exist in type '{ b: string; }'
262
-
263
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
264
- //=> {a: number} & Partial<Record<"b", never>>
265
-
266
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
267
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
268
- ```
269
-
270
- @category Object
271
- */
272
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
274
- } & (Options['requireExactProps'] extends true
275
- ? Partial<Record<KeysType, never>>
276
- : {});
277
-
278
- /**
279
- Returns a boolean for whether the given type is `never`.
280
-
281
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
- @link https://stackoverflow.com/a/53984913/10292952
283
- @link https://www.zhenghao.io/posts/ts-never
284
-
285
- Useful in type utilities, such as checking if something does not occur.
286
-
287
- @example
288
- ```
289
- import type {IsNever, And} from 'type-fest';
290
-
291
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
- type AreStringsEqual<A extends string, B extends string> =
293
- And<
294
- IsNever<Exclude<A, B>> extends true ? true : false,
295
- IsNever<Exclude<B, A>> extends true ? true : false
296
- >;
297
-
298
- type EndIfEqual<I extends string, O extends string> =
299
- AreStringsEqual<I, O> extends true
300
- ? never
301
- : void;
302
-
303
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
- if (input === output) {
305
- process.exit(0);
306
- }
307
- }
308
-
309
- endIfEqual('abc', 'abc');
310
- //=> never
311
-
312
- endIfEqual('abc', '123');
313
- //=> void
314
- ```
315
-
316
- @category Type Guard
317
- @category Utilities
318
- */
319
- type IsNever<T> = [T] extends [never] ? true : false;
320
-
321
- /**
322
- An if-else-like type that resolves depending on whether the given type is `never`.
323
-
324
- @see {@link IsNever}
325
-
326
- @example
327
- ```
328
- import type {IfNever} from 'type-fest';
329
-
330
- type ShouldBeTrue = IfNever<never>;
331
- //=> true
332
-
333
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
- //=> 'bar'
335
- ```
336
-
337
- @category Type Guard
338
- @category Utilities
339
- */
340
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
- IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
- );
343
-
344
- /**
345
- Extract the keys from a type where the value type of the key extends the given `Condition`.
346
-
347
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
348
-
349
- @example
350
- ```
351
- import type {ConditionalKeys} from 'type-fest';
352
-
353
- interface Example {
354
- a: string;
355
- b: string | number;
356
- c?: string;
357
- d: {};
358
- }
359
-
360
- type StringKeysOnly = ConditionalKeys<Example, string>;
361
- //=> 'a'
362
- ```
363
-
364
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
365
-
366
- @example
367
- ```
368
- import type {ConditionalKeys} from 'type-fest';
369
-
370
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
371
- //=> 'a' | 'c'
372
- ```
373
-
374
- @category Object
375
- */
376
- type ConditionalKeys<Base, Condition> =
377
- {
378
- // Map through all the keys of the given base type.
379
- [Key in keyof Base]-?:
380
- // Pick only keys with types extending the given `Condition` type.
381
- Base[Key] extends Condition
382
- // Retain this key
383
- // If the value for the key extends never, only include it if `Condition` also extends never
384
- ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
385
- // Discard this key since the condition fails.
386
- : never;
387
- // Convert the produced object into a union type of the keys which passed the conditional test.
388
- }[keyof Base];
389
-
390
- /**
391
- Exclude keys from a shape that matches the given `Condition`.
392
-
393
- This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
394
-
395
- @example
396
- ```
397
- import type {Primitive, ConditionalExcept} from 'type-fest';
398
-
399
- class Awesome {
400
- name: string;
401
- successes: number;
402
- failures: bigint;
403
-
404
- run() {}
405
- }
406
-
407
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
408
- //=> {run: () => void}
409
- ```
410
-
411
- @example
412
- ```
413
- import type {ConditionalExcept} from 'type-fest';
414
-
415
- interface Example {
416
- a: string;
417
- b: string | number;
418
- c: () => void;
419
- d: {};
420
- }
421
-
422
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
423
- //=> {b: string | number; c: () => void; d: {}}
424
- ```
425
-
426
- @category Object
427
- */
428
- type ConditionalExcept<Base, Condition> = Except<
429
- Base,
430
- ConditionalKeys<Base, Condition>
431
- >;
432
-
433
- /**
434
- * Descriptors are objects that describe the API of a module, and the module
435
- * can either be a REST module or a host module.
436
- * This type is recursive, so it can describe nested modules.
437
- */
438
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
- [key: string]: Descriptors | PublicMetadata | any;
440
- };
441
- /**
442
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
443
- * and returns an object with the same structure, but with all descriptors replaced with their API.
444
- * Any non-descriptor properties are removed from the returned object, including descriptors that
445
- * do not match the given host (as they will not work with the given host).
446
- */
447
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
448
- done: T;
449
- recurse: T extends {
450
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
451
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
452
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
453
- -1,
454
- 0,
455
- 1,
456
- 2,
457
- 3,
458
- 4,
459
- 5
460
- ][Depth]> : never;
461
- }, EmptyObject>;
462
- }[Depth extends -1 ? 'done' : 'recurse'];
463
- type PublicMetadata = {
464
- PACKAGE_NAME?: string;
465
- };
466
-
467
- declare global {
468
- interface ContextualClient {
469
- }
470
- }
471
- /**
472
- * A type used to create concerete types from SDK descriptors in
473
- * case a contextual client is available.
474
- */
475
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
- host: Host;
477
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
478
-
479
- interface Card$2 {
480
- /** Card details. */
481
- info?: CardInfo$2;
482
- }
483
- /** entity representing a card-info */
484
- interface CardInfo$2 {
485
- /**
486
- * Card ID.
487
- * @readonly
488
- */
489
- _id?: string | null;
490
- /** Display name shown at the top of the card. */
491
- name?: string | null;
492
- /** Card description. */
493
- description?: string | null;
494
- /** Details about the contact attached to the card. */
495
- primaryAttachment?: Attachment$2;
496
- /** Due date. */
497
- dueDate?: Date | null;
498
- /** Name of the app or service that created the contact. */
499
- source?: string | null;
500
- /**
501
- * @internal
502
- * @internal
503
- * @readonly
504
- * @deprecated
505
- */
506
- createdAt?: Date | null;
507
- /**
508
- * @internal
509
- * @internal
510
- * @readonly
511
- * @deprecated
512
- */
513
- updatedAt?: Date | null;
514
- /**
515
- * ID of the phase that currently holds the card.
516
- * @readonly
517
- */
518
- phaseId?: string | null;
519
- /**
520
- * Date and time the card was created.
521
- * @readonly
522
- */
523
- _createdDate?: Date | null;
524
- /**
525
- * Date and time the card was updated.
526
- * @readonly
527
- */
528
- _updatedDate?: Date | null;
529
- }
530
- interface Attachment$2 {
531
- /**
532
- * Attachment ID. For internal use.
533
- * @readonly
534
- */
535
- attachmentId?: string;
536
- /**
537
- * @internal
538
- * @internal
539
- * @deprecated
540
- */
541
- value?: string;
542
- /**
543
- * @internal
544
- * @internal
545
- * @deprecated
546
- */
547
- attachmentType?: AttachmentType$2;
548
- /** ID of the contact attached to the card. */
549
- contactId?: string;
550
- }
551
- /** describes the supported types of attachments (currently only supports Contact which is the default type) */
552
- declare enum AttachmentType$2 {
553
- ContactType = "ContactType"
554
- }
555
- interface QueryCardsRequest {
556
- /** Query, sort, and paging options. */
557
- query?: Query$2;
558
- }
559
- interface Query$2 {
560
- /**
561
- * Filter object in the following format:
562
- * `"filter" : {
563
- * "fieldName1": "value1",
564
- * "fieldName2":{"$operator":"value2"}
565
- * }`
566
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
567
- */
568
- filter?: any;
569
- /**
570
- * Sort object in the following format:
571
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
572
- */
573
- sort?: Sorting$2[];
574
- /** Paging options to limit and skip the number of items. */
575
- paging?: Paging$2;
576
- /** 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. */
577
- fields?: string[];
578
- /** 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. */
579
- fieldsets?: string[];
580
- }
581
- interface Sorting$2 {
582
- /** Name of the field to sort by. */
583
- fieldName?: string;
584
- /** Sort order. */
585
- order?: SortOrder$2;
586
- }
587
- declare enum SortOrder$2 {
588
- ASC = "ASC",
589
- DESC = "DESC"
590
- }
591
- interface Paging$2 {
592
- /** Number of items to load. */
593
- limit?: number | null;
594
- /** Number of items to skip in the current sort order. */
595
- offset?: number | null;
596
- }
597
- interface QueryCardsResponse {
598
- /** List of cards that matched the query criteria. */
599
- cards?: Card$2[];
600
- /** Metadata for the page of results. */
601
- pagination?: PaginationResponse$2;
602
- }
603
- interface PaginationResponse$2 {
604
- /** Number of items that were skipped in the current sort order. */
605
- offset?: number;
606
- /** Total number of items that matched the filter. */
607
- total?: number;
608
- /** Number of returned items. */
609
- count?: number;
610
- }
611
- interface ListCardsRequest {
612
- /** ID of the workflow whose cards will be listed. */
613
- workflowId: string;
614
- /** Filters for cards in the specified phase. */
615
- phaseId?: string | null;
616
- /**
617
- * Number of items to return.
618
- *
619
- * Defaults to `50`.
620
- */
621
- limit?: number | null;
622
- /**
623
- * Number of items to skip in the current sort order.
624
- *
625
- * Defaults to `0`.
626
- */
627
- offset?: number | null;
628
- /** Filters for cards with the specified contact ID. */
629
- attachmentValue?: string | null;
630
- /**
631
- * Filters for archived cards.
632
- * If set to `true`,
633
- * only archived cards are returned.
634
- * If set to `false`,
635
- * only cards that are not archived are returned.
636
- *
637
- * Defaults to `false`.
638
- */
639
- fetchArchived?: boolean | null;
640
- /**
641
- * Supported fields:
642
- * `id`, `name`, `createdDate`, `updatedDate`, `phaseId`
643
- *
644
- * List of fields to sort by.
645
- * Formatted as `field:direction`,
646
- * where field is the field name
647
- * and direction is `asc` (ascending) or `desc` (descending).
648
- *
649
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
650
- */
651
- sort?: string[];
652
- }
653
- interface ListCardsResponse {
654
- /** List of cards. */
655
- cards?: Card$2[];
656
- /** Metadata for the page of results. */
657
- pagination?: PaginationResponse$2;
658
- }
659
- interface GetCardRequest {
660
- /** ID of the card to retrieve. */
661
- _id: string;
662
- }
663
- interface GetCardResponse {
664
- /** Requested card. */
665
- card?: Card$2;
666
- }
667
- interface UpdateCardRequest {
668
- /** ID of the card to update. */
669
- _id: string;
670
- /** Card details. */
671
- cardInfo?: CardInfo$2;
672
- }
673
- interface UpdateCardResponse {
674
- }
675
- interface CreateCardRequest {
676
- /** ID of the workflow to create the card in. */
677
- workflowId: string;
678
- /** ID of the phase to create the card in. */
679
- phaseId: string;
680
- /** Card details. */
681
- card?: CardInfo$2;
682
- /**
683
- * Card position, where the first card is `0`.
684
- *
685
- * If a card already occupies the specified position,
686
- * that card and any subsequent cards are shifted to the right by 1.
687
- *
688
- * Defaults to the last position.
689
- */
690
- position?: number | null;
691
- }
692
- interface CreateCardResponse {
693
- /** ID of the newly created card. */
694
- _id?: string | null;
695
- }
696
- interface DeleteCardRequest {
697
- /** ID of the card to delete. */
698
- _id: string;
699
- }
700
- interface DeleteCardResponse {
701
- }
702
- interface MoveCardRequest {
703
- /** ID of the card to move. */
704
- _id: string;
705
- /** ID of the phase to move the card to. */
706
- newPhaseId?: string | null;
707
- /** Position of the card in the phase, where the first card is `0`. */
708
- newPosition?: number | null;
709
- }
710
- interface MoveCardResponse {
711
- }
712
- interface RestoreCardRequest {
713
- /** ID of the card to restore. */
714
- _id: string;
715
- /** ID of the phase to restore the card to. */
716
- newPhaseId: string;
717
- /**
718
- * Position of the restored card in the phase,
719
- * where the first card is `0`.
720
- */
721
- newPosition?: number | null;
722
- }
723
- interface RestoreCardResponse {
724
- }
725
- interface ArchiveCardRequest {
726
- /** ID of the card to archive. */
727
- _id: string;
728
- }
729
- interface ArchiveCardResponse {
730
- }
731
- interface DomainEvent extends DomainEventBodyOneOf {
732
- createdEvent?: EntityCreatedEvent;
733
- updatedEvent?: EntityUpdatedEvent;
734
- deletedEvent?: EntityDeletedEvent;
735
- actionEvent?: ActionEvent;
736
- /**
737
- * Unique event ID.
738
- * Allows clients to ignore duplicate webhooks.
739
- */
740
- _id?: string;
741
- /**
742
- * Assumes actions are also always typed to an entity_type
743
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
744
- */
745
- entityFqdn?: string;
746
- /**
747
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
748
- * This is although the created/updated/deleted notion is duplication of the oneof types
749
- * Example: created/updated/deleted/started/completed/email_opened
750
- */
751
- slug?: string;
752
- /** ID of the entity associated with the event. */
753
- entityId?: string;
754
- /** Event timestamp. */
755
- eventTime?: Date | null;
756
- /**
757
- * Whether the event was triggered as a result of a privacy regulation application
758
- * (for example, GDPR).
759
- */
760
- triggeredByAnonymizeRequest?: boolean | null;
761
- /** If present, indicates the action that triggered the event. */
762
- originatedFrom?: string | null;
763
- /**
764
- * A sequence number defining the order of updates to the underlying entity.
765
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
766
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
767
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
768
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
769
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
770
- */
771
- entityEventSequence?: string | null;
772
- }
773
- /** @oneof */
774
- interface DomainEventBodyOneOf {
775
- createdEvent?: EntityCreatedEvent;
776
- updatedEvent?: EntityUpdatedEvent;
777
- deletedEvent?: EntityDeletedEvent;
778
- actionEvent?: ActionEvent;
779
- }
780
- interface EntityCreatedEvent {
781
- entity?: string;
782
- }
783
- interface EntityUpdatedEvent {
784
- /**
785
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
786
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
787
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
788
- */
789
- currentEntity?: string;
790
- }
791
- interface EntityDeletedEvent {
792
- /** Entity that was deleted */
793
- deletedEntity?: string | null;
794
- }
795
- interface ActionEvent {
796
- body?: string;
797
- }
798
- interface MessageEnvelope {
799
- /** App instance ID. */
800
- instanceId?: string | null;
801
- /** Event type. */
802
- eventType?: string;
803
- /** The identification type and identity data. */
804
- identity?: IdentificationData;
805
- /** Stringify payload. */
806
- data?: string;
807
- }
808
- interface IdentificationData extends IdentificationDataIdOneOf {
809
- /** ID of a site visitor that has not logged in to the site. */
810
- anonymousVisitorId?: string;
811
- /** ID of a site visitor that has logged in to the site. */
812
- memberId?: string;
813
- /** ID of a Wix user (site owner, contributor, etc.). */
814
- wixUserId?: string;
815
- /** ID of an app. */
816
- appId?: string;
817
- /** @readonly */
818
- identityType?: WebhookIdentityType;
819
- }
820
- /** @oneof */
821
- interface IdentificationDataIdOneOf {
822
- /** ID of a site visitor that has not logged in to the site. */
823
- anonymousVisitorId?: string;
824
- /** ID of a site visitor that has logged in to the site. */
825
- memberId?: string;
826
- /** ID of a Wix user (site owner, contributor, etc.). */
827
- wixUserId?: string;
828
- /** ID of an app. */
829
- appId?: string;
830
- }
831
- declare enum WebhookIdentityType {
832
- UNKNOWN = "UNKNOWN",
833
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
834
- MEMBER = "MEMBER",
835
- WIX_USER = "WIX_USER",
836
- APP = "APP"
837
- }
838
- interface AttachmentNonNullableFields$2 {
839
- attachmentId: string;
840
- value: string;
841
- attachmentType: AttachmentType$2;
842
- contactId: string;
843
- }
844
- interface CardInfoNonNullableFields$2 {
845
- primaryAttachment?: AttachmentNonNullableFields$2;
846
- }
847
- interface CardNonNullableFields$2 {
848
- info?: CardInfoNonNullableFields$2;
849
- }
850
- interface PaginationResponseNonNullableFields$2 {
851
- offset: number;
852
- limit: number;
853
- total: number;
854
- count: number;
855
- }
856
- interface ListCardsResponseNonNullableFields {
857
- cards: CardNonNullableFields$2[];
858
- pagination?: PaginationResponseNonNullableFields$2;
859
- }
860
- interface GetCardResponseNonNullableFields {
861
- card?: CardNonNullableFields$2;
862
- }
863
- interface ListCardsOptions {
864
- /** Filters for cards in the specified phase. */
865
- phaseId?: string | null;
866
- /**
867
- * Number of items to return.
868
- *
869
- * Defaults to `50`.
870
- */
871
- limit?: number | null;
872
- /**
873
- * Number of items to skip in the current sort order.
874
- *
875
- * Defaults to `0`.
876
- */
877
- offset?: number | null;
878
- /** Filters for cards with the specified contact ID. */
879
- attachmentValue?: string | null;
880
- /**
881
- * Filters for archived cards.
882
- * If set to `true`,
883
- * only archived cards are returned.
884
- * If set to `false`,
885
- * only cards that are not archived are returned.
886
- *
887
- * Defaults to `false`.
888
- */
889
- fetchArchived?: boolean | null;
890
- /**
891
- * Supported fields:
892
- * `id`, `name`, `createdDate`, `updatedDate`, `phaseId`
893
- *
894
- * List of fields to sort by.
895
- * Formatted as `field:direction`,
896
- * where field is the field name
897
- * and direction is `asc` (ascending) or `desc` (descending).
898
- *
899
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
900
- */
901
- sort?: string[];
902
- }
903
- interface CreateCardIdentifiers {
904
- /** ID of the workflow to create the card in. */
905
- workflowId: string;
906
- /** ID of the phase to create the card in. */
907
- phaseId: string;
908
- }
909
- interface CreateCardOptions {
910
- /**
911
- * Card position, where the first card is `0`.
912
- *
913
- * If a card already occupies the specified position,
914
- * that card and any subsequent cards are shifted to the right by 1.
915
- *
916
- * Defaults to the last position.
917
- */
918
- position?: number | null;
919
- }
920
- interface MoveCardOptions {
921
- /** ID of the phase to move the card to. */
922
- newPhaseId?: string | null;
923
- /** Position of the card in the phase, where the first card is `0`. */
924
- newPosition?: number | null;
925
- }
926
- interface RestoreCardOptions {
927
- /**
928
- * Position of the restored card in the phase,
929
- * where the first card is `0`.
930
- */
931
- newPosition?: number | null;
932
- }
933
-
934
- declare function listCards$1(httpClient: HttpClient): ListCardsSignature;
935
- interface ListCardsSignature {
936
- /**
937
- * Retrieves a list of a workflow's cards.
938
- *
939
- *
940
- * The `listCards()` function returns a Promise that resolves to a list of the specified workflow's cards.
941
- *
942
- *
943
- * Use the `options` parameter to specify which cards to retrieve and in which order to retrieve them. Must use either `phaseId` or `fetchOnlyArchived`.
944
- *
945
- *
946
- * Cards can be sorted based on their `"id"`, `"name"`, `"phaseId"`, `"createdDate"`, `"updatedDate"`, `"source"`, and `"position"`.
947
- *
948
- *
949
- * If no `limit` parameter is passed, the first 50 cards are returned.
950
- *
951
- *
952
- * Sort order defaults to by `"phaseId"` and then by `"position"` ascending.
953
- *
954
- *
955
- * 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).
956
- * @param - ID of the workflow whose cards will be listed.
957
- * @param - Options to use when retrieving the list of cards.
958
- */
959
- (workflowId: string, options?: ListCardsOptions | undefined): Promise<ListCardsResponse & ListCardsResponseNonNullableFields>;
960
- }
961
- declare function getCard$1(httpClient: HttpClient): GetCardSignature;
962
- interface GetCardSignature {
963
- /**
964
- * Retrieves a workflow card by ID.
965
- *
966
- *
967
- * The `getCard()` function returns a Promise that resolves to the card with the specified ID.
968
- *
969
- *
970
- * 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).
971
- * @param - ID of the card to retrieve.
972
- * @returns Requested card.
973
- */
974
- (_id: string): Promise<Card$2 & CardNonNullableFields$2>;
975
- }
976
- declare function updateCard$1(httpClient: HttpClient): UpdateCardSignature;
977
- interface UpdateCardSignature {
978
- /**
979
- * Updates an existing workflow card.
980
- *
981
- *
982
- * The `updateCard()` function returns a Promise that resolves when the card has been updated with the specified values.
983
- *
984
- *
985
- * `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.
986
- *
987
- *
988
- * 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).
989
- * @param - ID of the card to update.
990
- * @param - Card details.
991
- * @param - Options to use when updating a card.
992
- */
993
- (_id: string, cardInfo: CardInfo$2): Promise<void>;
994
- }
995
- declare function createCard$1(httpClient: HttpClient): CreateCardSignature;
996
- interface CreateCardSignature {
997
- /**
998
- * Creates a new workflow card.
999
- *
1000
- *
1001
- * The `createCard()` function returns a Promise that resolves to the created card's ID when the card is created in the specified workflow phase.
1002
- *
1003
- * 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`.
1004
- *
1005
- * When omitted, the newly created card is added to the specified phase as the top card within the phase.
1006
- *
1007
- *
1008
- * 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).
1009
- *
1010
- * > **Note:**
1011
- * > Each workflow is limited to 5,000 cards.
1012
- * > If this limit is reached, `createCard()` throws an error.
1013
- * > [Archive cards](#archivecard) when they're no longer needed
1014
- * > to reduce card count and avoid hitting the limit.
1015
- * @param - Card details.
1016
- * @param - Options to use when creating a card.
1017
- */
1018
- (identifiers: CreateCardIdentifiers, card: CardInfo$2, options?: CreateCardOptions | undefined): Promise<CreateCardResponse>;
1019
- }
1020
- declare function deleteCard$1(httpClient: HttpClient): DeleteCardSignature;
1021
- interface DeleteCardSignature {
1022
- /**
1023
- * Deletes a workflow card by ID.
1024
- *
1025
- *
1026
- * The `deleteCard()` function returns a Promise when the specified card has been deleted.
1027
- *
1028
- * 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).
1029
- * @param - ID of the card to delete.
1030
- */
1031
- (_id: string): Promise<void>;
1032
- }
1033
- declare function moveCard$1(httpClient: HttpClient): MoveCardSignature;
1034
- interface MoveCardSignature {
1035
- /**
1036
- * Moves a card to a new position within a workflow.
1037
- *
1038
- *
1039
- * The `moveCard()` function returns a Promise when the specified card has been moved to the new position.
1040
- *
1041
- * 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`.
1042
- *
1043
- * 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).
1044
- * @param - ID of the card to move.
1045
- * @param - Information about where to move the card.
1046
- */
1047
- (_id: string, options?: MoveCardOptions | undefined): Promise<void>;
1048
- }
1049
- declare function restoreCard$1(httpClient: HttpClient): RestoreCardSignature;
1050
- interface RestoreCardSignature {
1051
- /**
1052
- * Restores an archived workflow card.
1053
- *
1054
- *
1055
- * The `restoreCard()` function returns a Promise that resolves when the archived card has been restored.
1056
- *
1057
- *
1058
- * 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).
1059
- *
1060
- *
1061
- * > **Note:**
1062
- * > Each workflow is limited to 5,000 cards.
1063
- * > If this limit is reached, `createCard()` throws an error.
1064
- * > [Archive cards](#archivecard) when they're no longer needed
1065
- * > to reduce card count and avoid hitting the limit.
1066
- * @param - ID of the card to restore.
1067
- * @param - ID of the phase to restore the card to.
1068
- * @param - Options to use when restoring a card.
1069
- */
1070
- (_id: string, newPhaseId: string, options?: RestoreCardOptions | undefined): Promise<void>;
1071
- }
1072
- declare function archiveCard$1(httpClient: HttpClient): ArchiveCardSignature;
1073
- interface ArchiveCardSignature {
1074
- /**
1075
- * Archives a workflow card.
1076
- *
1077
- *
1078
- * The `archiveCard()` function returns a Promise that resolves when the card has been archived.
1079
- *
1080
- *
1081
- * 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).
1082
- * @param - ID of the card to archive.
1083
- */
1084
- (_id: string): Promise<void>;
1085
- }
1086
-
1087
- declare const listCards: MaybeContext<BuildRESTFunction<typeof listCards$1> & typeof listCards$1>;
1088
- declare const getCard: MaybeContext<BuildRESTFunction<typeof getCard$1> & typeof getCard$1>;
1089
- declare const updateCard: MaybeContext<BuildRESTFunction<typeof updateCard$1> & typeof updateCard$1>;
1090
- declare const createCard: MaybeContext<BuildRESTFunction<typeof createCard$1> & typeof createCard$1>;
1091
- declare const deleteCard: MaybeContext<BuildRESTFunction<typeof deleteCard$1> & typeof deleteCard$1>;
1092
- declare const moveCard: MaybeContext<BuildRESTFunction<typeof moveCard$1> & typeof moveCard$1>;
1093
- declare const restoreCard: MaybeContext<BuildRESTFunction<typeof restoreCard$1> & typeof restoreCard$1>;
1094
- declare const archiveCard: MaybeContext<BuildRESTFunction<typeof archiveCard$1> & typeof archiveCard$1>;
1095
-
1096
- type index_d$2_ActionEvent = ActionEvent;
1097
- type index_d$2_ArchiveCardRequest = ArchiveCardRequest;
1098
- type index_d$2_ArchiveCardResponse = ArchiveCardResponse;
1099
- type index_d$2_CreateCardIdentifiers = CreateCardIdentifiers;
1100
- type index_d$2_CreateCardOptions = CreateCardOptions;
1101
- type index_d$2_CreateCardRequest = CreateCardRequest;
1102
- type index_d$2_CreateCardResponse = CreateCardResponse;
1103
- type index_d$2_DeleteCardRequest = DeleteCardRequest;
1104
- type index_d$2_DeleteCardResponse = DeleteCardResponse;
1105
- type index_d$2_DomainEvent = DomainEvent;
1106
- type index_d$2_DomainEventBodyOneOf = DomainEventBodyOneOf;
1107
- type index_d$2_EntityCreatedEvent = EntityCreatedEvent;
1108
- type index_d$2_EntityDeletedEvent = EntityDeletedEvent;
1109
- type index_d$2_EntityUpdatedEvent = EntityUpdatedEvent;
1110
- type index_d$2_GetCardRequest = GetCardRequest;
1111
- type index_d$2_GetCardResponse = GetCardResponse;
1112
- type index_d$2_GetCardResponseNonNullableFields = GetCardResponseNonNullableFields;
1113
- type index_d$2_IdentificationData = IdentificationData;
1114
- type index_d$2_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1115
- type index_d$2_ListCardsOptions = ListCardsOptions;
1116
- type index_d$2_ListCardsRequest = ListCardsRequest;
1117
- type index_d$2_ListCardsResponse = ListCardsResponse;
1118
- type index_d$2_ListCardsResponseNonNullableFields = ListCardsResponseNonNullableFields;
1119
- type index_d$2_MessageEnvelope = MessageEnvelope;
1120
- type index_d$2_MoveCardOptions = MoveCardOptions;
1121
- type index_d$2_MoveCardRequest = MoveCardRequest;
1122
- type index_d$2_MoveCardResponse = MoveCardResponse;
1123
- type index_d$2_QueryCardsRequest = QueryCardsRequest;
1124
- type index_d$2_QueryCardsResponse = QueryCardsResponse;
1125
- type index_d$2_RestoreCardOptions = RestoreCardOptions;
1126
- type index_d$2_RestoreCardRequest = RestoreCardRequest;
1127
- type index_d$2_RestoreCardResponse = RestoreCardResponse;
1128
- type index_d$2_UpdateCardRequest = UpdateCardRequest;
1129
- type index_d$2_UpdateCardResponse = UpdateCardResponse;
1130
- type index_d$2_WebhookIdentityType = WebhookIdentityType;
1131
- declare const index_d$2_WebhookIdentityType: typeof WebhookIdentityType;
1132
- declare const index_d$2_archiveCard: typeof archiveCard;
1133
- declare const index_d$2_createCard: typeof createCard;
1134
- declare const index_d$2_deleteCard: typeof deleteCard;
1135
- declare const index_d$2_getCard: typeof getCard;
1136
- declare const index_d$2_listCards: typeof listCards;
1137
- declare const index_d$2_moveCard: typeof moveCard;
1138
- declare const index_d$2_restoreCard: typeof restoreCard;
1139
- declare const index_d$2_updateCard: typeof updateCard;
1140
- declare namespace index_d$2 {
1141
- 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 CardNonNullableFields$2 as CardNonNullableFields, 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, 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 };
1142
- }
1143
-
1144
- interface Phase$1 {
1145
- /** Phase information. */
1146
- info?: PhaseInfo$1;
1147
- /** Cards contained in the phase. */
1148
- cardsList?: CardsList$1;
1149
- }
1150
- interface PhaseInfo$1 {
1151
- /**
1152
- * Phase ID.
1153
- * @readonly
1154
- */
1155
- _id?: string | null;
1156
- /** Display name shown at the top of the phase. */
1157
- name?: string | null;
1158
- }
1159
- /** a list of cards (a page) along with the total number */
1160
- interface CardsList$1 {
1161
- /** Total number of cards in the phase. */
1162
- total?: number;
1163
- /**
1164
- * List of cards in the phase.
1165
- * Sorted according to the card display order, from top to bottom.
1166
- */
1167
- cards?: Card$1[];
1168
- }
1169
- interface Card$1 {
1170
- /** Card details. */
1171
- info?: CardInfo$1;
1172
- }
1173
- /** entity representing a card-info */
1174
- interface CardInfo$1 {
1175
- /**
1176
- * Card ID.
1177
- * @readonly
1178
- */
1179
- _id?: string | null;
1180
- /** Display name shown at the top of the card. */
1181
- name?: string | null;
1182
- /** Card description. */
1183
- description?: string | null;
1184
- /** Details about the contact attached to the card. */
1185
- primaryAttachment?: Attachment$1;
1186
- /** Due date. */
1187
- dueDate?: Date | null;
1188
- /** Name of the app or service that created the contact. */
1189
- source?: string | null;
1190
- /**
1191
- * @internal
1192
- * @internal
1193
- * @readonly
1194
- * @deprecated
1195
- */
1196
- createdAt?: Date | null;
1197
- /**
1198
- * @internal
1199
- * @internal
1200
- * @readonly
1201
- * @deprecated
1202
- */
1203
- updatedAt?: Date | null;
1204
- /**
1205
- * ID of the phase that currently holds the card.
1206
- * @readonly
1207
- */
1208
- phaseId?: string | null;
1209
- /**
1210
- * Date and time the card was created.
1211
- * @readonly
1212
- */
1213
- _createdDate?: Date | null;
1214
- /**
1215
- * Date and time the card was updated.
1216
- * @readonly
1217
- */
1218
- _updatedDate?: Date | null;
1219
- }
1220
- interface Attachment$1 {
1221
- /**
1222
- * Attachment ID. For internal use.
1223
- * @readonly
1224
- */
1225
- attachmentId?: string;
1226
- /**
1227
- * @internal
1228
- * @internal
1229
- * @deprecated
1230
- */
1231
- value?: string;
1232
- /**
1233
- * @internal
1234
- * @internal
1235
- * @deprecated
1236
- */
1237
- attachmentType?: AttachmentType$1;
1238
- /** ID of the contact attached to the card. */
1239
- contactId?: string;
1240
- }
1241
- /** describes the supported types of attachments (currently only supports Contact which is the default type) */
1242
- declare enum AttachmentType$1 {
1243
- ContactType = "ContactType"
1244
- }
1245
- interface QueryPhasesRequest {
1246
- /** Query, sort, and paging options. */
1247
- query?: Query$1;
1248
- }
1249
- interface Query$1 {
1250
- /**
1251
- * Filter object in the following format:
1252
- * `"filter" : {
1253
- * "fieldName1": "value1",
1254
- * "fieldName2":{"$operator":"value2"}
1255
- * }`
1256
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
1257
- */
1258
- filter?: any;
1259
- /**
1260
- * Sort object in the following format:
1261
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
1262
- */
1263
- sort?: Sorting$1[];
1264
- /** Paging options to limit and skip the number of items. */
1265
- paging?: Paging$1;
1266
- /** 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. */
1267
- fields?: string[];
1268
- /** 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. */
1269
- fieldsets?: string[];
1270
- }
1271
- interface Sorting$1 {
1272
- /** Name of the field to sort by. */
1273
- fieldName?: string;
1274
- /** Sort order. */
1275
- order?: SortOrder$1;
1276
- }
1277
- declare enum SortOrder$1 {
1278
- ASC = "ASC",
1279
- DESC = "DESC"
1280
- }
1281
- interface Paging$1 {
1282
- /** Number of items to load. */
1283
- limit?: number | null;
1284
- /** Number of items to skip in the current sort order. */
1285
- offset?: number | null;
1286
- }
1287
- interface QueryPhasesResponse {
1288
- /** List of phases that matched the query criteria. */
1289
- phases?: Phase$1[];
1290
- /** Metadata for the page of results. */
1291
- pagination?: PaginationResponse$1;
1292
- }
1293
- interface PaginationResponse$1 {
1294
- /** Number of items that were skipped in the current sort order. */
1295
- offset?: number;
1296
- /** Total number of items that matched the filter. */
1297
- total?: number;
1298
- /** Number of returned items. */
1299
- count?: number;
1300
- }
1301
- interface ListPhasesRequest {
1302
- /** ID of the workflow whose phases will be listed. */
1303
- workflowId: string;
1304
- /** Number of items to return. */
1305
- limit?: number | null;
1306
- /**
1307
- * Number of items to skip in the current sort order.
1308
- *
1309
- * Defaults to `0`.
1310
- */
1311
- offset?: number | null;
1312
- /**
1313
- * Supported fields:
1314
- * `id`, `name`
1315
- *
1316
- * List of fields to sort by.
1317
- * Formatted as `field:direction`,
1318
- * where field is the field name
1319
- * and direction is `asc` (ascending) or `desc` (descending).
1320
- *
1321
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
1322
- */
1323
- sort?: string[];
1324
- }
1325
- interface ListPhasesResponse {
1326
- /** List of phases. */
1327
- phases?: Phase$1[];
1328
- /** Metadata for the page of results. */
1329
- pagination?: PaginationResponse$1;
1330
- }
1331
- interface GetPhaseRequest {
1332
- /** ID of the phase to retrieve. */
1333
- _id: string;
1334
- }
1335
- interface GetPhaseResponse {
1336
- /** Requested phase. */
1337
- phase?: Phase$1;
1338
- }
1339
- interface UpdatePhaseRequest {
1340
- /** ID of the phase to update. */
1341
- _id: string;
1342
- /** Phase details to update. */
1343
- phase?: PhaseInfo$1;
1344
- }
1345
- interface UpdatePhaseResponse {
1346
- }
1347
- interface CreatePhaseRequest {
1348
- /** ID of the workflow to create the phase in. */
1349
- workflowId: string;
1350
- /** Phase details. */
1351
- phase?: PhaseInfo$1;
1352
- /**
1353
- * Phase position, where the first phase is `0`.
1354
- *
1355
- * If a phase already occupies the specified position,
1356
- * that phase and any subsequent phases
1357
- * are shifted to the right by 1.
1358
- *
1359
- * Defaults to the last position,
1360
- * which is displayed before the win phase.
1361
- */
1362
- position?: number | null;
1363
- }
1364
- interface CreatePhaseResponse {
1365
- /** ID of the newly created phase. */
1366
- _id?: string | null;
1367
- }
1368
- interface DeletePhaseRequest {
1369
- /** ID of the phase to delete. */
1370
- _id: string;
1371
- }
1372
- interface DeletePhaseResponse {
1373
- }
1374
- interface MovePhaseRequest {
1375
- /** ID of the workflow that contains the phase to move. */
1376
- workflowId: string;
1377
- /** ID of the phase to move. */
1378
- _id: string;
1379
- /**
1380
- * New phase position, where the first phase is `0`.
1381
- *
1382
- * If a phase already occupies the specified position,
1383
- * that phase and any subsequent phases
1384
- * are shifted to the right by 1.
1385
- */
1386
- newPosition: number | null;
1387
- }
1388
- interface MovePhaseResponse {
1389
- }
1390
- interface AttachmentNonNullableFields$1 {
1391
- attachmentId: string;
1392
- value: string;
1393
- attachmentType: AttachmentType$1;
1394
- contactId: string;
1395
- }
1396
- interface CardInfoNonNullableFields$1 {
1397
- primaryAttachment?: AttachmentNonNullableFields$1;
1398
- }
1399
- interface CardNonNullableFields$1 {
1400
- info?: CardInfoNonNullableFields$1;
1401
- }
1402
- interface CardsListNonNullableFields$1 {
1403
- total: number;
1404
- cards: CardNonNullableFields$1[];
1405
- }
1406
- interface PhaseNonNullableFields$1 {
1407
- cardsList?: CardsListNonNullableFields$1;
1408
- }
1409
- interface PaginationResponseNonNullableFields$1 {
1410
- offset: number;
1411
- limit: number;
1412
- total: number;
1413
- count: number;
1414
- }
1415
- interface ListPhasesResponseNonNullableFields {
1416
- phases: PhaseNonNullableFields$1[];
1417
- pagination?: PaginationResponseNonNullableFields$1;
1418
- }
1419
- interface GetPhaseResponseNonNullableFields {
1420
- phase?: PhaseNonNullableFields$1;
1421
- }
1422
- interface ListPhasesOptions {
1423
- /** Number of items to return. */
1424
- limit?: number | null;
1425
- /**
1426
- * Number of items to skip in the current sort order.
1427
- *
1428
- * Defaults to `0`.
1429
- */
1430
- offset?: number | null;
1431
- /**
1432
- * Supported fields:
1433
- * `id`, `name`
1434
- *
1435
- * List of fields to sort by.
1436
- * Formatted as `field:direction`,
1437
- * where field is the field name
1438
- * and direction is `asc` (ascending) or `desc` (descending).
1439
- *
1440
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
1441
- */
1442
- sort?: string[];
1443
- }
1444
- interface CreatePhaseOptions {
1445
- /**
1446
- * Phase position, where the first phase is `0`.
1447
- *
1448
- * If a phase already occupies the specified position,
1449
- * that phase and any subsequent phases
1450
- * are shifted to the right by 1.
1451
- *
1452
- * Defaults to the last position,
1453
- * which is displayed before the win phase.
1454
- */
1455
- position?: number | null;
1456
- }
1457
- interface MovePhaseIdentifiers {
1458
- /** ID of the workflow that contains the phase to move. */
1459
- workflowId: string;
1460
- /** ID of the phase to move. */
1461
- _id: string;
1462
- }
1463
-
1464
- declare function listPhases$1(httpClient: HttpClient): ListPhasesSignature;
1465
- interface ListPhasesSignature {
1466
- /**
1467
- * Retrieves a list of a workflow's phases.
1468
- *
1469
- *
1470
- * The `listPhases()` function returns a Promise that resolves to a list containing information about the specified workflow's phases.
1471
- *
1472
- *
1473
- * Use the `options` parameter to specify which phases to retrieve and in which order to retrieve them. Phases can be sorted based on their `"id"`, `"name"`, and `"position"`. If no `limit` parameter is passed, the first 50 cards are returned. Sort order defaults to by `"position"` ascending.
1474
- *
1475
- *
1476
- * 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).
1477
- * @param - ID of the workflow whose phases will be listed.
1478
- * @param - Options to use when retrieving the list of workflow phases.
1479
- */
1480
- (workflowId: string, options?: ListPhasesOptions | undefined): Promise<ListPhasesResponse & ListPhasesResponseNonNullableFields>;
1481
- }
1482
- declare function getPhase$1(httpClient: HttpClient): GetPhaseSignature;
1483
- interface GetPhaseSignature {
1484
- /**
1485
- * Retrieves a phase by ID.
1486
- *
1487
- *
1488
- * The `getPhase()` function returns a Promise that resolves to the phase with the specified ID.
1489
- *
1490
- * This function requires you to specify the ID of a phase. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
1491
- * @param - ID of the phase to retrieve.
1492
- * @returns Requested phase.
1493
- */
1494
- (_id: string): Promise<Phase$1 & PhaseNonNullableFields$1>;
1495
- }
1496
- declare function updatePhase$1(httpClient: HttpClient): UpdatePhaseSignature;
1497
- interface UpdatePhaseSignature {
1498
- /**
1499
- * Updates an existing workflow phase.
1500
- *
1501
- *
1502
- * The `updatePhase()` function returns a Promise that resolves when the phase has been updated with the specified values.
1503
- *
1504
- *
1505
- * Only the properties passed in the `phase` object will be updated. All other properties will remain the same.
1506
- *
1507
- *
1508
- * This function requires you to specify the ID of a phase. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
1509
- * @param - ID of the phase to update.
1510
- * @param - Phase details to update.
1511
- * @param - Phase information to update.
1512
- */
1513
- (_id: string, phase: PhaseInfo$1): Promise<void>;
1514
- }
1515
- declare function createPhase$1(httpClient: HttpClient): CreatePhaseSignature;
1516
- interface CreatePhaseSignature {
1517
- /**
1518
- * Creates a new workflow phase.
1519
- *
1520
- *
1521
- * The `createPhase()` function returns a Promise that resolves to the created phase ID when the phase is created in the specified workflow.
1522
- *
1523
- *
1524
- * Pass a value for the `position` parameter to specify the newly created phase's position within the specified workflow. Positions are zero-based, meaning the first position is `0`.
1525
- *
1526
- *
1527
- * When omitted, the newly created phase is added as the last non-win phase.
1528
- *
1529
- *
1530
- * 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).
1531
- * @param - ID of the workflow to create the phase in.
1532
- * @param - Phase details.
1533
- * @param - Options to use when creating workflow phases.
1534
- */
1535
- (workflowId: string, phase: PhaseInfo$1, options?: CreatePhaseOptions | undefined): Promise<CreatePhaseResponse>;
1536
- }
1537
- declare function deletePhase$1(httpClient: HttpClient): DeletePhaseSignature;
1538
- interface DeletePhaseSignature {
1539
- /**
1540
- * Deletes a workflow phase.
1541
- *
1542
- *
1543
- * The `deletePhase()` function returns a Promise when the specified phase has been deleted.
1544
- *
1545
- *
1546
- * This function requires you to specify the ID of a phase. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
1547
- * @param - ID of the phase to delete.
1548
- */
1549
- (_id: string): Promise<void>;
1550
- }
1551
- declare function movePhase$1(httpClient: HttpClient): MovePhaseSignature;
1552
- interface MovePhaseSignature {
1553
- /**
1554
- * Moves a phase to a new position with a workflow.
1555
- *
1556
- *
1557
- * The `movePhase()` function returns a Promise when the specified phase has been moved to the new position.
1558
- *
1559
- *
1560
- * Use the `newPosition` parameter to specify the new phase position within the workflow. Any non-win phase can be moved to any non-win position. The win phase cannot be moved. Positions are zero-based, meaning the first position is `0`.
1561
- *
1562
- *
1563
- * This function requires you to specify the ID of a phase. To learn about retrieving IDs in the Workflows APIs, see [Retrieving IDs](wix-workflows-v2/introduction#retrieving-ids).
1564
- * @param - New phase position, where the first phase is `0`.
1565
- *
1566
- * If a phase already occupies the specified position,
1567
- * that phase and any subsequent phases
1568
- * are shifted to the right by 1.
1569
- */
1570
- (identifiers: MovePhaseIdentifiers, newPosition: number | null): Promise<void>;
1571
- }
1572
-
1573
- declare const listPhases: MaybeContext<BuildRESTFunction<typeof listPhases$1> & typeof listPhases$1>;
1574
- declare const getPhase: MaybeContext<BuildRESTFunction<typeof getPhase$1> & typeof getPhase$1>;
1575
- declare const updatePhase: MaybeContext<BuildRESTFunction<typeof updatePhase$1> & typeof updatePhase$1>;
1576
- declare const createPhase: MaybeContext<BuildRESTFunction<typeof createPhase$1> & typeof createPhase$1>;
1577
- declare const deletePhase: MaybeContext<BuildRESTFunction<typeof deletePhase$1> & typeof deletePhase$1>;
1578
- declare const movePhase: MaybeContext<BuildRESTFunction<typeof movePhase$1> & typeof movePhase$1>;
1579
-
1580
- type index_d$1_CreatePhaseOptions = CreatePhaseOptions;
1581
- type index_d$1_CreatePhaseRequest = CreatePhaseRequest;
1582
- type index_d$1_CreatePhaseResponse = CreatePhaseResponse;
1583
- type index_d$1_DeletePhaseRequest = DeletePhaseRequest;
1584
- type index_d$1_DeletePhaseResponse = DeletePhaseResponse;
1585
- type index_d$1_GetPhaseRequest = GetPhaseRequest;
1586
- type index_d$1_GetPhaseResponse = GetPhaseResponse;
1587
- type index_d$1_GetPhaseResponseNonNullableFields = GetPhaseResponseNonNullableFields;
1588
- type index_d$1_ListPhasesOptions = ListPhasesOptions;
1589
- type index_d$1_ListPhasesRequest = ListPhasesRequest;
1590
- type index_d$1_ListPhasesResponse = ListPhasesResponse;
1591
- type index_d$1_ListPhasesResponseNonNullableFields = ListPhasesResponseNonNullableFields;
1592
- type index_d$1_MovePhaseIdentifiers = MovePhaseIdentifiers;
1593
- type index_d$1_MovePhaseRequest = MovePhaseRequest;
1594
- type index_d$1_MovePhaseResponse = MovePhaseResponse;
1595
- type index_d$1_QueryPhasesRequest = QueryPhasesRequest;
1596
- type index_d$1_QueryPhasesResponse = QueryPhasesResponse;
1597
- type index_d$1_UpdatePhaseRequest = UpdatePhaseRequest;
1598
- type index_d$1_UpdatePhaseResponse = UpdatePhaseResponse;
1599
- declare const index_d$1_createPhase: typeof createPhase;
1600
- declare const index_d$1_deletePhase: typeof deletePhase;
1601
- declare const index_d$1_getPhase: typeof getPhase;
1602
- declare const index_d$1_listPhases: typeof listPhases;
1603
- declare const index_d$1_movePhase: typeof movePhase;
1604
- declare const index_d$1_updatePhase: typeof updatePhase;
1605
- declare namespace index_d$1 {
1606
- 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 PhaseNonNullableFields$1 as PhaseNonNullableFields, 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, 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 };
1607
- }
1608
-
1609
- interface Workflow {
1610
- /** Workflow information and metadata. */
1611
- info?: WorkflowInfo;
1612
- /**
1613
- * Final phase of the workflow.
1614
- * Cards in `winPhase` are treated as if they are not part of the workflow.
1615
- *
1616
- * Normally, a contact can be attached to only 1 card in the workflow.
1617
- * Moving a contact's card to `winPhase`
1618
- * frees up the contact to be attached to another card in the workflow.
1619
- */
1620
- winPhase?: Phase;
1621
- /** Phases that make up the workflow. */
1622
- phasesList?: PhasesList;
1623
- }
1624
- interface WorkflowInfo {
1625
- /**
1626
- * Workflow ID.
1627
- * @readonly
1628
- */
1629
- _id?: string | null;
1630
- /** Display name for the workflow. */
1631
- name?: string | null;
1632
- /**
1633
- * Workflow description,
1634
- * shown below the workflow's display name in the dashboard.
1635
- */
1636
- description?: string | null;
1637
- /**
1638
- * @internal
1639
- * @internal
1640
- * @readonly
1641
- * @deprecated
1642
- */
1643
- createdAt?: Date | null;
1644
- /**
1645
- * Indicates whether the workflow can be deleted.
1646
- * @readonly
1647
- * @deprecated
1648
- */
1649
- isDeletable?: boolean | null;
1650
- /**
1651
- * Date and time the workflow was created.
1652
- * @readonly
1653
- */
1654
- _createdDate?: Date | null;
1655
- }
1656
- interface Phase {
1657
- /** Phase information. */
1658
- info?: PhaseInfo;
1659
- /** Cards contained in the phase. */
1660
- cardsList?: CardsList;
1661
- }
1662
- interface PhaseInfo {
1663
- /**
1664
- * Phase ID.
1665
- * @readonly
1666
- */
1667
- _id?: string | null;
1668
- /** Display name shown at the top of the phase. */
1669
- name?: string | null;
1670
- }
1671
- /** a list of cards (a page) along with the total number */
1672
- interface CardsList {
1673
- /** Total number of cards in the phase. */
1674
- total?: number;
1675
- /**
1676
- * List of cards in the phase.
1677
- * Sorted according to the card display order, from top to bottom.
1678
- */
1679
- cards?: Card[];
1680
- }
1681
- interface Card {
1682
- /** Card details. */
1683
- info?: CardInfo;
1684
- }
1685
- /** entity representing a card-info */
1686
- interface CardInfo {
1687
- /**
1688
- * Card ID.
1689
- * @readonly
1690
- */
1691
- _id?: string | null;
1692
- /** Display name shown at the top of the card. */
1693
- name?: string | null;
1694
- /** Card description. */
1695
- description?: string | null;
1696
- /** Details about the contact attached to the card. */
1697
- primaryAttachment?: Attachment;
1698
- /** Due date. */
1699
- dueDate?: Date | null;
1700
- /** Name of the app or service that created the contact. */
1701
- source?: string | null;
1702
- /**
1703
- * @internal
1704
- * @internal
1705
- * @readonly
1706
- * @deprecated
1707
- */
1708
- createdAt?: Date | null;
1709
- /**
1710
- * @internal
1711
- * @internal
1712
- * @readonly
1713
- * @deprecated
1714
- */
1715
- updatedAt?: Date | null;
1716
- /**
1717
- * ID of the phase that currently holds the card.
1718
- * @readonly
1719
- */
1720
- phaseId?: string | null;
1721
- /**
1722
- * Date and time the card was created.
1723
- * @readonly
1724
- */
1725
- _createdDate?: Date | null;
1726
- /**
1727
- * Date and time the card was updated.
1728
- * @readonly
1729
- */
1730
- _updatedDate?: Date | null;
1731
- }
1732
- interface Attachment {
1733
- /**
1734
- * Attachment ID. For internal use.
1735
- * @readonly
1736
- */
1737
- attachmentId?: string;
1738
- /**
1739
- * @internal
1740
- * @internal
1741
- * @deprecated
1742
- */
1743
- value?: string;
1744
- /**
1745
- * @internal
1746
- * @internal
1747
- * @deprecated
1748
- */
1749
- attachmentType?: AttachmentType;
1750
- /** ID of the contact attached to the card. */
1751
- contactId?: string;
1752
- }
1753
- /** describes the supported types of attachments (currently only supports Contact which is the default type) */
1754
- declare enum AttachmentType {
1755
- ContactType = "ContactType"
1756
- }
1757
- /** a list of phases (a page) along with the total number */
1758
- interface PhasesList {
1759
- /** Total number of phases in the workflow, excluding `winPhase`. */
1760
- total?: number;
1761
- /**
1762
- * List of phases in the workflow.
1763
- * Sorted according to the phase display order, from left to right.
1764
- */
1765
- phases?: Phase[];
1766
- }
1767
- interface ListWorkflowsRequest {
1768
- /**
1769
- * Number of workflows to return.
1770
- * If omitted, all results are returned.
1771
- */
1772
- limit?: number | null;
1773
- /**
1774
- * Number of items to skip in the current sort order.
1775
- *
1776
- * Defaults to `0`.
1777
- */
1778
- offset?: number | null;
1779
- /**
1780
- * Supported fields:
1781
- * `id`, `name`, `description`, `createdDate`
1782
- *
1783
- * List of fields to sort by.
1784
- * Formatted as `field:direction`,
1785
- * where field is the field name
1786
- * and direction is `asc` (ascending) or `desc` (descending).
1787
- *
1788
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
1789
- */
1790
- sort?: string[];
1791
- }
1792
- interface ListWorkflowsResponse {
1793
- /** Retrieved list of workflows. */
1794
- workflows?: WorkflowInfo[];
1795
- /** Metadata for the page of results. */
1796
- pagination?: PaginationResponse;
1797
- }
1798
- interface PaginationResponse {
1799
- /** Number of items that were skipped in the current sort order. */
1800
- offset?: number;
1801
- /** Total number of items that matched the filter. */
1802
- total?: number;
1803
- /** Number of returned items. */
1804
- count?: number;
1805
- }
1806
- interface QueryWorkflowsRequest {
1807
- /** Query options. */
1808
- query?: Query;
1809
- }
1810
- interface Query {
1811
- /**
1812
- * Filter object in the following format:
1813
- * `"filter" : {
1814
- * "fieldName1": "value1",
1815
- * "fieldName2":{"$operator":"value2"}
1816
- * }`
1817
- * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
1818
- */
1819
- filter?: any;
1820
- /**
1821
- * Sort object in the following format:
1822
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
1823
- */
1824
- sort?: Sorting[];
1825
- /** Paging options to limit and skip the number of items. */
1826
- paging?: Paging;
1827
- /** 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. */
1828
- fields?: string[];
1829
- /** 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. */
1830
- fieldsets?: string[];
1831
- }
1832
- interface Sorting {
1833
- /** Name of the field to sort by. */
1834
- fieldName?: string;
1835
- /** Sort order. */
1836
- order?: SortOrder;
1837
- }
1838
- declare enum SortOrder {
1839
- ASC = "ASC",
1840
- DESC = "DESC"
1841
- }
1842
- interface Paging {
1843
- /** Number of items to load. */
1844
- limit?: number | null;
1845
- /** Number of items to skip in the current sort order. */
1846
- offset?: number | null;
1847
- }
1848
- interface QueryWorkflowsResponse {
1849
- /** List of workflows that matched the query. */
1850
- workflows?: Workflow[];
1851
- /** Metadata for the paginated results. */
1852
- pagination?: PaginationResponse;
1853
- }
1854
- interface GetWorkflowRequest {
1855
- /** ID of the workflow to retrieve. */
1856
- _id: string;
1857
- /**
1858
- * Maximum number of cards to return per phase.
1859
- * To retrieve additional pages of cards, use
1860
- * [List Cards](../cards/listCards)
1861
- * (in the Cards API).
1862
- */
1863
- cardsPerPhase?: number | null;
1864
- }
1865
- interface GetWorkflowResponse {
1866
- /** Requested workflow. */
1867
- workflow?: Workflow;
1868
- }
1869
- interface UpdateWorkflowRequest {
1870
- /** ID of the workflow to update. */
1871
- _id: string;
1872
- /** Workflow info. */
1873
- workflow?: WorkflowInfo;
1874
- }
1875
- interface UpdateWorkflowResponse {
1876
- }
1877
- interface CreateWorkflowRequest {
1878
- /** Workflow details. */
1879
- workflow?: WorkflowInfo;
1880
- }
1881
- interface CreateWorkflowResponse {
1882
- /** ID of the new workflow. */
1883
- _id?: string | null;
1884
- }
1885
- interface DeleteWorkflowRequest {
1886
- /** ID of the workflow to delete. */
1887
- _id: string;
1888
- }
1889
- interface DeleteWorkflowResponse {
1890
- }
1891
- interface SetupWorkflowRequest {
1892
- }
1893
- interface SetupWorkflowResponse {
1894
- }
1895
- interface PaginationResponseNonNullableFields {
1896
- offset: number;
1897
- limit: number;
1898
- total: number;
1899
- count: number;
1900
- }
1901
- interface ListWorkflowsResponseNonNullableFields {
1902
- pagination?: PaginationResponseNonNullableFields;
1903
- }
1904
- interface AttachmentNonNullableFields {
1905
- attachmentId: string;
1906
- value: string;
1907
- attachmentType: AttachmentType;
1908
- contactId: string;
1909
- }
1910
- interface CardInfoNonNullableFields {
1911
- primaryAttachment?: AttachmentNonNullableFields;
1912
- }
1913
- interface CardNonNullableFields {
1914
- info?: CardInfoNonNullableFields;
1915
- }
1916
- interface CardsListNonNullableFields {
1917
- total: number;
1918
- cards: CardNonNullableFields[];
1919
- }
1920
- interface PhaseNonNullableFields {
1921
- cardsList?: CardsListNonNullableFields;
1922
- }
1923
- interface PhasesListNonNullableFields {
1924
- total: number;
1925
- phases: PhaseNonNullableFields[];
1926
- }
1927
- interface WorkflowNonNullableFields {
1928
- winPhase?: PhaseNonNullableFields;
1929
- phasesList?: PhasesListNonNullableFields;
1930
- }
1931
- interface GetWorkflowResponseNonNullableFields {
1932
- workflow?: WorkflowNonNullableFields;
1933
- }
1934
- interface ListWorkflowsOptions {
1935
- /**
1936
- * Number of workflows to return.
1937
- * If omitted, all results are returned.
1938
- */
1939
- limit?: number | null;
1940
- /**
1941
- * Number of items to skip in the current sort order.
1942
- *
1943
- * Defaults to `0`.
1944
- */
1945
- offset?: number | null;
1946
- /**
1947
- * Supported fields:
1948
- * `id`, `name`, `description`, `createdDate`
1949
- *
1950
- * List of fields to sort by.
1951
- * Formatted as `field:direction`,
1952
- * where field is the field name
1953
- * and direction is `asc` (ascending) or `desc` (descending).
1954
- *
1955
- * Sorting is applied lexicographically, so `"abc"` comes after `"XYZ"`.
1956
- */
1957
- sort?: string[];
1958
- }
1959
-
1960
- declare function listWorkflows$1(httpClient: HttpClient): ListWorkflowsSignature;
1961
- interface ListWorkflowsSignature {
1962
- /**
1963
- * Retrieves a list of the site's workflows info.
1964
- *
1965
- *
1966
- * The `listWorkflows()` function returns a Promise that resolves to a list containing information about the site's workflows.
1967
- *
1968
- *
1969
- * Use the `options` parameter to specify which workflows to retrieve and in which order to retrieve them. Workflows can be sorted based on their `"name"`.
1970
- *
1971
- *
1972
- * If no `limit` parameter is passed, the first 100 workflows are returned. Sort order defaults to by `"name"` ascending.
1973
- * @param - Options to use when retrieving a list of workflows.
1974
- */
1975
- (options?: ListWorkflowsOptions | undefined): Promise<ListWorkflowsResponse & ListWorkflowsResponseNonNullableFields>;
1976
- }
1977
- declare function getWorkflow$1(httpClient: HttpClient): GetWorkflowSignature;
1978
- interface GetWorkflowSignature {
1979
- /**
1980
- * Retrieves a workflow by ID.
1981
- *
1982
- *
1983
- * The `getWorkflow()` function returns a Promise that resolves to the workflow info with the specified ID.
1984
- *
1985
- *
1986
- * 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).
1987
- * @param - ID of the workflow to retrieve.
1988
- * @param - Maximum number of cards to return per phase.
1989
- * To retrieve additional pages of cards, use
1990
- * [List Cards](../cards/listCards)
1991
- * (in the Cards API).
1992
- * @param - Options to use when retrieving a workflow.
1993
- * @returns Requested workflow.
1994
- */
1995
- (_id: string, cardsPerPhase: number | null): Promise<Workflow & WorkflowNonNullableFields>;
1996
- }
1997
- declare function updateWorkflow$1(httpClient: HttpClient): UpdateWorkflowSignature;
1998
- interface UpdateWorkflowSignature {
1999
- /**
2000
- * Updates an existing workflow.
2001
- *
2002
- *
2003
- * The `updateWorkflow()` function returns a Promise that resolves when the workflow has been updated with the specified values.
2004
- *
2005
- *
2006
- * Only the properties passed in the `workflow` object will be updated. All other properties will remain the same.
2007
- *
2008
- *
2009
- * This function requires you to specify the ID of a workflow. To learn about retrieving IDs in the Workflow API, see [Retrieving IDs](#retrieving-ids).
2010
- * @param - ID of the workflow to update.
2011
- * @param - Workflow info.
2012
- * @param - Options to use when updating a workflow.
2013
- */
2014
- (_id: string, workflow: WorkflowInfo): Promise<void>;
2015
- }
2016
- declare function createWorkflow$1(httpClient: HttpClient): CreateWorkflowSignature;
2017
- interface CreateWorkflowSignature {
2018
- /**
2019
- * Creates a new workflow.
2020
- *
2021
- *
2022
- * The `createWorkflow()` function returns a Promise that resolves to the created workflow ID.
2023
- * @param - Workflow details.
2024
- * @param - Options to use when creating a workflow.
2025
- */
2026
- (workflow: WorkflowInfo): Promise<CreateWorkflowResponse>;
2027
- }
2028
- declare function deleteWorkflow$1(httpClient: HttpClient): DeleteWorkflowSignature;
2029
- interface DeleteWorkflowSignature {
2030
- /**
2031
- * Deletes a workflow.
2032
- *
2033
- *
2034
- * The `deleteWorkflow()` function returns a Promise when the specified workflow has been deleted.
2035
- *
2036
- *
2037
- * 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).
2038
- * @param - ID of the workflow to delete.
2039
- */
2040
- (_id: string): Promise<void>;
2041
- }
2042
-
2043
- declare const listWorkflows: MaybeContext<BuildRESTFunction<typeof listWorkflows$1> & typeof listWorkflows$1>;
2044
- declare const getWorkflow: MaybeContext<BuildRESTFunction<typeof getWorkflow$1> & typeof getWorkflow$1>;
2045
- declare const updateWorkflow: MaybeContext<BuildRESTFunction<typeof updateWorkflow$1> & typeof updateWorkflow$1>;
2046
- declare const createWorkflow: MaybeContext<BuildRESTFunction<typeof createWorkflow$1> & typeof createWorkflow$1>;
2047
- declare const deleteWorkflow: MaybeContext<BuildRESTFunction<typeof deleteWorkflow$1> & typeof deleteWorkflow$1>;
2048
-
2049
- type index_d_Attachment = Attachment;
2050
- type index_d_AttachmentType = AttachmentType;
2051
- declare const index_d_AttachmentType: typeof AttachmentType;
2052
- type index_d_Card = Card;
2053
- type index_d_CardInfo = CardInfo;
2054
- type index_d_CardsList = CardsList;
2055
- type index_d_CreateWorkflowRequest = CreateWorkflowRequest;
2056
- type index_d_CreateWorkflowResponse = CreateWorkflowResponse;
2057
- type index_d_DeleteWorkflowRequest = DeleteWorkflowRequest;
2058
- type index_d_DeleteWorkflowResponse = DeleteWorkflowResponse;
2059
- type index_d_GetWorkflowRequest = GetWorkflowRequest;
2060
- type index_d_GetWorkflowResponse = GetWorkflowResponse;
2061
- type index_d_GetWorkflowResponseNonNullableFields = GetWorkflowResponseNonNullableFields;
2062
- type index_d_ListWorkflowsOptions = ListWorkflowsOptions;
2063
- type index_d_ListWorkflowsRequest = ListWorkflowsRequest;
2064
- type index_d_ListWorkflowsResponse = ListWorkflowsResponse;
2065
- type index_d_ListWorkflowsResponseNonNullableFields = ListWorkflowsResponseNonNullableFields;
2066
- type index_d_PaginationResponse = PaginationResponse;
2067
- type index_d_Paging = Paging;
2068
- type index_d_Phase = Phase;
2069
- type index_d_PhaseInfo = PhaseInfo;
2070
- type index_d_PhasesList = PhasesList;
2071
- type index_d_Query = Query;
2072
- type index_d_QueryWorkflowsRequest = QueryWorkflowsRequest;
2073
- type index_d_QueryWorkflowsResponse = QueryWorkflowsResponse;
2074
- type index_d_SetupWorkflowRequest = SetupWorkflowRequest;
2075
- type index_d_SetupWorkflowResponse = SetupWorkflowResponse;
2076
- type index_d_SortOrder = SortOrder;
2077
- declare const index_d_SortOrder: typeof SortOrder;
2078
- type index_d_Sorting = Sorting;
2079
- type index_d_UpdateWorkflowRequest = UpdateWorkflowRequest;
2080
- type index_d_UpdateWorkflowResponse = UpdateWorkflowResponse;
2081
- type index_d_Workflow = Workflow;
2082
- type index_d_WorkflowInfo = WorkflowInfo;
2083
- type index_d_WorkflowNonNullableFields = WorkflowNonNullableFields;
2084
- declare const index_d_createWorkflow: typeof createWorkflow;
2085
- declare const index_d_deleteWorkflow: typeof deleteWorkflow;
2086
- declare const index_d_getWorkflow: typeof getWorkflow;
2087
- declare const index_d_listWorkflows: typeof listWorkflows;
2088
- declare const index_d_updateWorkflow: typeof updateWorkflow;
2089
- declare namespace index_d {
2090
- 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, type index_d_WorkflowNonNullableFields as WorkflowNonNullableFields, 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 };
2091
- }
2092
-
2093
- export { index_d$2 as cards, index_d$1 as phases, index_d as workflows };