@wix/automations 1.0.42 → 1.0.44

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,9 +1,9 @@
1
- type HostModule$2<T, H extends Host$2> = {
1
+ type HostModule<T, H extends Host> = {
2
2
  __type: 'host';
3
3
  create(host: H): T;
4
4
  };
5
- type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
6
- type Host$2<Environment = unknown> = {
5
+ type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
+ type Host<Environment = unknown> = {
7
7
  channel: {
8
8
  observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
9
  disconnect: () => void;
@@ -36,92 +36,92 @@ type Host$2<Environment = unknown> = {
36
36
  };
37
37
  };
38
38
 
39
- type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
40
- interface HttpClient$2 {
41
- request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
39
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
40
+ interface HttpClient {
41
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
42
42
  fetchWithAuth: typeof fetch;
43
43
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
44
  getActiveToken?: () => string | undefined;
45
45
  }
46
- type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
47
- type HttpResponse$2<T = any> = {
46
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
47
+ type HttpResponse<T = any> = {
48
48
  data: T;
49
49
  status: number;
50
50
  statusText: string;
51
51
  headers: any;
52
52
  request?: any;
53
53
  };
54
- type RequestOptions$2<_TResponse = any, Data = any> = {
54
+ type RequestOptions<_TResponse = any, Data = any> = {
55
55
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
56
56
  url: string;
57
57
  data?: Data;
58
58
  params?: URLSearchParams;
59
- } & APIMetadata$2;
60
- type APIMetadata$2 = {
59
+ } & APIMetadata;
60
+ type APIMetadata = {
61
61
  methodFqn?: string;
62
62
  entityFqdn?: string;
63
63
  packageName?: string;
64
64
  };
65
- type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
66
- type EventDefinition$5<Payload = unknown, Type extends string = string> = {
65
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
+ type EventDefinition$3<Payload = unknown, Type extends string = string> = {
67
67
  __type: 'event-definition';
68
68
  type: Type;
69
69
  isDomainEvent?: boolean;
70
70
  transformations?: (envelope: unknown) => Payload;
71
71
  __payload: Payload;
72
72
  };
73
- declare function EventDefinition$5<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$5<Payload, Type>;
74
- type EventHandler$5<T extends EventDefinition$5> = (payload: T['__payload']) => void | Promise<void>;
75
- type BuildEventDefinition$5<T extends EventDefinition$5<any, string>> = (handler: EventHandler$5<T>) => void;
73
+ declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
74
+ type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
75
+ type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
76
76
 
77
- type ServicePluginMethodInput$2 = {
77
+ type ServicePluginMethodInput = {
78
78
  request: any;
79
79
  metadata: any;
80
80
  };
81
- type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
82
- type ServicePluginMethodMetadata$2 = {
81
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
82
+ type ServicePluginMethodMetadata = {
83
83
  name: string;
84
84
  primaryHttpMappingPath: string;
85
85
  transformations: {
86
- fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
86
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
87
87
  toREST: (...args: unknown[]) => unknown;
88
88
  };
89
89
  };
90
- type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
90
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
91
91
  __type: 'service-plugin-definition';
92
92
  componentType: string;
93
- methods: ServicePluginMethodMetadata$2[];
93
+ methods: ServicePluginMethodMetadata[];
94
94
  __contract: Contract;
95
95
  };
96
- declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
97
- type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
98
- declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
96
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
97
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
98
+ declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
99
99
 
100
- type RequestContext$2 = {
100
+ type RequestContext = {
101
101
  isSSR: boolean;
102
102
  host: string;
103
103
  protocol?: string;
104
104
  };
105
- type ResponseTransformer$2 = (data: any, headers?: any) => any;
105
+ type ResponseTransformer = (data: any, headers?: any) => any;
106
106
  /**
107
107
  * Ambassador request options types are copied mostly from AxiosRequestConfig.
108
108
  * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
109
109
  * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
110
110
  */
111
- type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
112
- type AmbassadorRequestOptions$2<T = any> = {
111
+ type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
112
+ type AmbassadorRequestOptions<T = any> = {
113
113
  _?: T;
114
114
  url?: string;
115
- method?: Method$2;
115
+ method?: Method;
116
116
  params?: any;
117
117
  data?: any;
118
- transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
118
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
119
119
  };
120
- type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
120
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
121
121
  __isAmbassador: boolean;
122
122
  };
123
- type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
124
- type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
123
+ type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
124
+ type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
125
125
 
126
126
  declare global {
127
127
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -130,7 +130,7 @@ declare global {
130
130
  }
131
131
  }
132
132
 
133
- declare const emptyObjectSymbol$2: unique symbol;
133
+ declare const emptyObjectSymbol: unique symbol;
134
134
 
135
135
  /**
136
136
  Represents a strictly empty plain object, the `{}` value.
@@ -158,7 +158,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
158
158
 
159
159
  @category Object
160
160
  */
161
- type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
161
+ type EmptyObject = {[emptyObjectSymbol]?: never};
162
162
 
163
163
  /**
164
164
  Returns a boolean for whether the two given types are equal.
@@ -186,7 +186,7 @@ type Includes<Value extends readonly any[], Item> =
186
186
  @category Type Guard
187
187
  @category Utilities
188
188
  */
189
- type IsEqual$2<A, B> =
189
+ type IsEqual<A, B> =
190
190
  (<G>() => G extends A ? 1 : 2) extends
191
191
  (<G>() => G extends B ? 1 : 2)
192
192
  ? true
@@ -219,9 +219,9 @@ type Filtered = Filter<'bar', 'foo'>;
219
219
 
220
220
  @see {Except}
221
221
  */
222
- type Filter$5<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
222
+ type Filter$3<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
223
 
224
- type ExceptOptions$2 = {
224
+ type ExceptOptions = {
225
225
  /**
226
226
  Disallow assigning non-specified properties.
227
227
 
@@ -265,8 +265,8 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
265
265
 
266
266
  @category Object
267
267
  */
268
- type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
269
- [KeyType in keyof ObjectType as Filter$5<KeyType, KeysType>]: ObjectType[KeyType];
268
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
269
+ [KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
270
270
  } & (Options['requireExactProps'] extends true
271
271
  ? Partial<Record<KeysType, never>>
272
272
  : {});
@@ -303,7 +303,7 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
303
303
 
304
304
  @category Object
305
305
  */
306
- type ConditionalKeys$2<Base, Condition> = NonNullable<
306
+ type ConditionalKeys<Base, Condition> = NonNullable<
307
307
  // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
308
308
  {
309
309
  // Map through all the keys of the given base type.
@@ -357,9 +357,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
357
357
 
358
358
  @category Object
359
359
  */
360
- type ConditionalExcept$2<Base, Condition> = Except$2<
360
+ type ConditionalExcept<Base, Condition> = Except<
361
361
  Base,
362
- ConditionalKeys$2<Base, Condition>
362
+ ConditionalKeys<Base, Condition>
363
363
  >;
364
364
 
365
365
  /**
@@ -367,8 +367,8 @@ ConditionalKeys$2<Base, Condition>
367
367
  * can either be a REST module or a host module.
368
368
  * This type is recursive, so it can describe nested modules.
369
369
  */
370
- type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$5<any> | ServicePluginDefinition$2<any> | {
371
- [key: string]: Descriptors$2 | PublicMetadata$2 | any;
370
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$3<any> | ServicePluginDefinition<any> | {
371
+ [key: string]: Descriptors | PublicMetadata | any;
372
372
  };
373
373
  /**
374
374
  * This type takes in a descriptors object of a certain Host (including an `unknown` host)
@@ -376,12 +376,12 @@ type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 |
376
376
  * Any non-descriptor properties are removed from the returned object, including descriptors that
377
377
  * do not match the given host (as they will not work with the given host).
378
378
  */
379
- type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
379
+ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
380
380
  done: T;
381
381
  recurse: T extends {
382
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
383
- } ? never : T extends AmbassadorFunctionDescriptor$2 ? BuildAmbassadorFunction$2<T> : T extends RESTFunctionDescriptor$2 ? BuildRESTFunction$2<T> : T extends EventDefinition$5<any> ? BuildEventDefinition$5<T> : T extends ServicePluginDefinition$2<any> ? BuildServicePluginDefinition$2<T> : T extends HostModule$2<any, any> ? HostModuleAPI$2<T> : ConditionalExcept$2<{
384
- [Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
382
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
384
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
385
  -1,
386
386
  0,
387
387
  1,
@@ -390,9 +390,9 @@ type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefin
390
390
  4,
391
391
  5
392
392
  ][Depth]> : never;
393
- }, EmptyObject$2>;
393
+ }, EmptyObject>;
394
394
  }[Depth extends -1 ? 'done' : 'recurse'];
395
- type PublicMetadata$2 = {
395
+ type PublicMetadata = {
396
396
  PACKAGE_NAME?: string;
397
397
  };
398
398
 
@@ -404,9 +404,9 @@ declare global {
404
404
  * A type used to create concerete types from SDK descriptors in
405
405
  * case a contextual client is available.
406
406
  */
407
- type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
408
- host: Host$2;
409
- } ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
407
+ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
408
+ host: Host;
409
+ } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
410
410
 
411
411
  /** Automation */
412
412
  interface Automation$2 {
@@ -486,7 +486,7 @@ interface Trigger$2 {
486
486
  /** Identifier for this trigger - human readable action key */
487
487
  triggerKey?: string;
488
488
  /** optional list of filters on schema fields */
489
- filters?: Filter$4[];
489
+ filters?: Filter$2[];
490
490
  /**
491
491
  * optional - allows to define a trigger whose following actions will be executed only if the same event for the same resource has not in the last X seconds.
492
492
  * for example, if the trigger is "session booked", the resource is a contact and the timeframe is 3600 seconds (contact hasn't booked another session in the last hour),
@@ -494,7 +494,7 @@ interface Trigger$2 {
494
494
  */
495
495
  debounce?: Debounce;
496
496
  }
497
- interface Filter$4 {
497
+ interface Filter$2 {
498
498
  /** the filter identifier */
499
499
  _id?: string | null;
500
500
  /** the field key from the schema, for example "formId" */
@@ -1256,6 +1256,14 @@ interface UpdatedWithPreviousEntity$1 {
1256
1256
  /** updated automation */
1257
1257
  currentAutomation?: Automation$2;
1258
1258
  }
1259
+ interface MigrationUpdateAutomationRequest {
1260
+ /** Automation to be updated, may be partial */
1261
+ automation: Automation$2;
1262
+ }
1263
+ interface MigrationUpdateAutomationResponse {
1264
+ /** The updated Automation */
1265
+ automation?: Automation$2;
1266
+ }
1259
1267
  interface DeleteAutomationRequest$1 {
1260
1268
  /** Id of the Automation to delete */
1261
1269
  automationId: string;
@@ -1663,6 +1671,9 @@ interface GetAutomationResponseNonNullableFields$1 {
1663
1671
  interface UpdateAutomationResponseNonNullableFields$1 {
1664
1672
  automation?: AutomationNonNullableFields$1;
1665
1673
  }
1674
+ interface MigrationUpdateAutomationResponseNonNullableFields {
1675
+ automation?: AutomationNonNullableFields$1;
1676
+ }
1666
1677
  interface QueryAutomationsResponseNonNullableFields$1 {
1667
1678
  automations: AutomationNonNullableFields$1[];
1668
1679
  }
@@ -1873,6 +1884,60 @@ interface UpdateAutomation$1 {
1873
1884
  /** @readonly */
1874
1885
  migratedToV3?: boolean | null;
1875
1886
  }
1887
+ interface MigrationUpdateAutomation {
1888
+ /**
1889
+ * Automation ID
1890
+ * @readonly
1891
+ */
1892
+ _id?: string | null;
1893
+ /** Revision */
1894
+ revision?: string | null;
1895
+ /** Automation name */
1896
+ name?: string;
1897
+ /** Automation description */
1898
+ description?: string;
1899
+ /**
1900
+ * Automation Type
1901
+ * @readonly
1902
+ */
1903
+ type?: Type$2;
1904
+ /** Automation Status */
1905
+ status?: Status$2;
1906
+ /** Rule that contains a trigger and some actions */
1907
+ rule?: Rule;
1908
+ /**
1909
+ * Source Application Automation
1910
+ * @readonly
1911
+ */
1912
+ source?: Source;
1913
+ /**
1914
+ * Metadata
1915
+ * @readonly
1916
+ */
1917
+ metadata?: AutomationMetadata;
1918
+ /**
1919
+ * Created date
1920
+ * @readonly
1921
+ */
1922
+ _createdDate?: Date;
1923
+ /**
1924
+ * Updated date
1925
+ * @readonly
1926
+ */
1927
+ _updatedDate?: Date;
1928
+ /**
1929
+ * ESB Configuration ID
1930
+ * @readonly
1931
+ */
1932
+ esbConfigurationId?: string | null;
1933
+ /**
1934
+ * Was this automation migrated from v1
1935
+ * @readonly
1936
+ */
1937
+ migratedFromV1?: boolean | null;
1938
+ /** @readonly */
1939
+ migratedToV3?: boolean | null;
1940
+ }
1876
1941
  interface DeleteAutomationOptions {
1877
1942
  /** The revision of the Automation */
1878
1943
  revision?: string;
@@ -1974,7 +2039,7 @@ interface GenerateActionInputMappingFromTemplateOptions {
1974
2039
  actionInputMappingTemplate: Record<string, any> | null;
1975
2040
  }
1976
2041
 
1977
- declare function createAutomation$3(httpClient: HttpClient$2): CreateAutomationSignature$1;
2042
+ declare function createAutomation$3(httpClient: HttpClient): CreateAutomationSignature$1;
1978
2043
  interface CreateAutomationSignature$1 {
1979
2044
  /**
1980
2045
  * Creates a new Automation
@@ -1983,7 +2048,7 @@ interface CreateAutomationSignature$1 {
1983
2048
  */
1984
2049
  (automation: Automation$2): Promise<Automation$2 & AutomationNonNullableFields$1>;
1985
2050
  }
1986
- declare function getAutomation$3(httpClient: HttpClient$2): GetAutomationSignature$1;
2051
+ declare function getAutomation$3(httpClient: HttpClient): GetAutomationSignature$1;
1987
2052
  interface GetAutomationSignature$1 {
1988
2053
  /**
1989
2054
  * Get a Automation by id
@@ -1992,17 +2057,24 @@ interface GetAutomationSignature$1 {
1992
2057
  */
1993
2058
  (automationId: string, options?: GetAutomationOptions$1 | undefined): Promise<Automation$2 & AutomationNonNullableFields$1>;
1994
2059
  }
1995
- declare function updateAutomation$3(httpClient: HttpClient$2): UpdateAutomationSignature$1;
2060
+ declare function updateAutomation$3(httpClient: HttpClient): UpdateAutomationSignature$1;
1996
2061
  interface UpdateAutomationSignature$1 {
1997
2062
  /**
1998
2063
  * Update a Automation, supports partial update
1999
2064
  * Pass the latest `revision` for a successful update
2065
+ * @param - Automation ID
2066
+ */
2067
+ (_id: string | null, automation: UpdateAutomation$1): Promise<UpdateAutomationResponse$1 & UpdateAutomationResponseNonNullableFields$1>;
2068
+ }
2069
+ declare function migrationUpdateAutomation$1(httpClient: HttpClient): MigrationUpdateAutomationSignature;
2070
+ interface MigrationUpdateAutomationSignature {
2071
+ /**
2000
2072
  * @param - Automation ID
2001
2073
  * @returns The updated Automation
2002
2074
  */
2003
- (_id: string | null, automation: UpdateAutomation$1): Promise<Automation$2 & AutomationNonNullableFields$1>;
2075
+ (_id: string | null, automation: MigrationUpdateAutomation): Promise<Automation$2 & AutomationNonNullableFields$1>;
2004
2076
  }
2005
- declare function deleteAutomation$3(httpClient: HttpClient$2): DeleteAutomationSignature$1;
2077
+ declare function deleteAutomation$3(httpClient: HttpClient): DeleteAutomationSignature$1;
2006
2078
  interface DeleteAutomationSignature$1 {
2007
2079
  /**
2008
2080
  * Delete an Automation
@@ -2010,14 +2082,14 @@ interface DeleteAutomationSignature$1 {
2010
2082
  */
2011
2083
  (automationId: string, options?: DeleteAutomationOptions | undefined): Promise<void>;
2012
2084
  }
2013
- declare function queryAutomations$3(httpClient: HttpClient$2): QueryAutomationsSignature$1;
2085
+ declare function queryAutomations$3(httpClient: HttpClient): QueryAutomationsSignature$1;
2014
2086
  interface QueryAutomationsSignature$1 {
2015
2087
  /**
2016
2088
  * Query Automations using [WQL - Wix Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language)
2017
2089
  */
2018
2090
  (options?: QueryAutomationsOptions | undefined): AutomationsQueryBuilder$1;
2019
2091
  }
2020
- declare function overrideApplicationAutomation$1(httpClient: HttpClient$2): OverrideApplicationAutomationSignature;
2092
+ declare function overrideApplicationAutomation$1(httpClient: HttpClient): OverrideApplicationAutomationSignature;
2021
2093
  interface OverrideApplicationAutomationSignature {
2022
2094
  /**
2023
2095
  * Creates a new Automation
@@ -2025,7 +2097,7 @@ interface OverrideApplicationAutomationSignature {
2025
2097
  */
2026
2098
  (automation: Automation$2): Promise<OverrideApplicationAutomationResponse & OverrideApplicationAutomationResponseNonNullableFields>;
2027
2099
  }
2028
- declare function validateAutomationById$1(httpClient: HttpClient$2): ValidateAutomationByIdSignature;
2100
+ declare function validateAutomationById$1(httpClient: HttpClient): ValidateAutomationByIdSignature;
2029
2101
  interface ValidateAutomationByIdSignature {
2030
2102
  /**
2031
2103
  * Validate Automation by Id
@@ -2033,7 +2105,7 @@ interface ValidateAutomationByIdSignature {
2033
2105
  */
2034
2106
  (automationId: string, options?: ValidateAutomationByIdOptions | undefined): Promise<ValidateAutomationByIdResponse & ValidateAutomationByIdResponseNonNullableFields>;
2035
2107
  }
2036
- declare function validateAutomation$3(httpClient: HttpClient$2): ValidateAutomationSignature$1;
2108
+ declare function validateAutomation$3(httpClient: HttpClient): ValidateAutomationSignature$1;
2037
2109
  interface ValidateAutomationSignature$1 {
2038
2110
  /**
2039
2111
  * Validate Automation
@@ -2041,19 +2113,19 @@ interface ValidateAutomationSignature$1 {
2041
2113
  */
2042
2114
  (automation: Automation$2): Promise<ValidateAutomationResponse$1 & ValidateAutomationResponseNonNullableFields$1>;
2043
2115
  }
2044
- declare function getAutomationActivationStats$1(httpClient: HttpClient$2): GetAutomationActivationStatsSignature;
2116
+ declare function getAutomationActivationStats$1(httpClient: HttpClient): GetAutomationActivationStatsSignature;
2045
2117
  interface GetAutomationActivationStatsSignature {
2046
2118
  /** @param - Automation ID */
2047
2119
  (automationId: string, options?: GetAutomationActivationStatsOptions | undefined): Promise<GetAutomationActivationReportsResponse & GetAutomationActivationReportsResponseNonNullableFields>;
2048
2120
  }
2049
- declare function getActionsQuotaInfo$3(httpClient: HttpClient$2): GetActionsQuotaInfoSignature$1;
2121
+ declare function getActionsQuotaInfo$3(httpClient: HttpClient): GetActionsQuotaInfoSignature$1;
2050
2122
  interface GetActionsQuotaInfoSignature$1 {
2051
2123
  /**
2052
2124
  * Get actions quota information
2053
2125
  */
2054
2126
  (): Promise<GetActionsQuotaInfoResponse$1 & GetActionsQuotaInfoResponseNonNullableFields$1>;
2055
2127
  }
2056
- declare function generateActionInputMappingFromTemplate$1(httpClient: HttpClient$2): GenerateActionInputMappingFromTemplateSignature;
2128
+ declare function generateActionInputMappingFromTemplate$1(httpClient: HttpClient): GenerateActionInputMappingFromTemplateSignature;
2057
2129
  interface GenerateActionInputMappingFromTemplateSignature {
2058
2130
  /**
2059
2131
  * Generate action input mapping from a template
@@ -2061,22 +2133,22 @@ interface GenerateActionInputMappingFromTemplateSignature {
2061
2133
  */
2062
2134
  (appId: string, options: GenerateActionInputMappingFromTemplateOptions): Promise<GenerateActionInputMappingFromTemplateResponse>;
2063
2135
  }
2064
- declare const onAutomationCreated$3: EventDefinition$5<AutomationCreatedEnvelope$1, "wix.automations.v1.automation_created">;
2065
- declare const onAutomationUpdated$3: EventDefinition$5<AutomationUpdatedEnvelope$1, "wix.automations.v1.automation_updated">;
2066
- declare const onAutomationDeleted$3: EventDefinition$5<AutomationDeletedEnvelope$1, "wix.automations.v1.automation_deleted">;
2067
- declare const onAutomationUpdatedWithPreviousEntity$3: EventDefinition$5<AutomationUpdatedWithPreviousEntityEnvelope$1, "wix.automations.v1.automation_updated_with_previous_entity">;
2068
- declare const onAutomationDeletedWithEntity$3: EventDefinition$5<AutomationDeletedWithEntityEnvelope$1, "wix.automations.v1.automation_deleted_with_entity">;
2136
+ declare const onAutomationCreated$3: EventDefinition$3<AutomationCreatedEnvelope$1, "wix.automations.v1.automation_created">;
2137
+ declare const onAutomationUpdated$3: EventDefinition$3<AutomationUpdatedEnvelope$1, "wix.automations.v1.automation_updated">;
2138
+ declare const onAutomationDeleted$3: EventDefinition$3<AutomationDeletedEnvelope$1, "wix.automations.v1.automation_deleted">;
2139
+ declare const onAutomationUpdatedWithPreviousEntity$3: EventDefinition$3<AutomationUpdatedWithPreviousEntityEnvelope$1, "wix.automations.v1.automation_updated_with_previous_entity">;
2140
+ declare const onAutomationDeletedWithEntity$3: EventDefinition$3<AutomationDeletedWithEntityEnvelope$1, "wix.automations.v1.automation_deleted_with_entity">;
2069
2141
 
2070
- type EventDefinition$4<Payload = unknown, Type extends string = string> = {
2142
+ type EventDefinition$2<Payload = unknown, Type extends string = string> = {
2071
2143
  __type: 'event-definition';
2072
2144
  type: Type;
2073
2145
  isDomainEvent?: boolean;
2074
2146
  transformations?: (envelope: unknown) => Payload;
2075
2147
  __payload: Payload;
2076
2148
  };
2077
- declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
2078
- type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
2079
- type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
2149
+ declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
2150
+ type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
2151
+ type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
2080
2152
 
2081
2153
  declare global {
2082
2154
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -2085,19 +2157,20 @@ declare global {
2085
2157
  }
2086
2158
  }
2087
2159
 
2088
- declare function createEventModule$2<T extends EventDefinition$4<any, string>>(eventDefinition: T): BuildEventDefinition$4<T> & T;
2160
+ declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
2089
2161
 
2090
- declare const createAutomation$2: MaybeContext$2<BuildRESTFunction$2<typeof createAutomation$3> & typeof createAutomation$3>;
2091
- declare const getAutomation$2: MaybeContext$2<BuildRESTFunction$2<typeof getAutomation$3> & typeof getAutomation$3>;
2092
- declare const updateAutomation$2: MaybeContext$2<BuildRESTFunction$2<typeof updateAutomation$3> & typeof updateAutomation$3>;
2093
- declare const deleteAutomation$2: MaybeContext$2<BuildRESTFunction$2<typeof deleteAutomation$3> & typeof deleteAutomation$3>;
2094
- declare const queryAutomations$2: MaybeContext$2<BuildRESTFunction$2<typeof queryAutomations$3> & typeof queryAutomations$3>;
2095
- declare const overrideApplicationAutomation: MaybeContext$2<BuildRESTFunction$2<typeof overrideApplicationAutomation$1> & typeof overrideApplicationAutomation$1>;
2096
- declare const validateAutomationById: MaybeContext$2<BuildRESTFunction$2<typeof validateAutomationById$1> & typeof validateAutomationById$1>;
2097
- declare const validateAutomation$2: MaybeContext$2<BuildRESTFunction$2<typeof validateAutomation$3> & typeof validateAutomation$3>;
2098
- declare const getAutomationActivationStats: MaybeContext$2<BuildRESTFunction$2<typeof getAutomationActivationStats$1> & typeof getAutomationActivationStats$1>;
2099
- declare const getActionsQuotaInfo$2: MaybeContext$2<BuildRESTFunction$2<typeof getActionsQuotaInfo$3> & typeof getActionsQuotaInfo$3>;
2100
- declare const generateActionInputMappingFromTemplate: MaybeContext$2<BuildRESTFunction$2<typeof generateActionInputMappingFromTemplate$1> & typeof generateActionInputMappingFromTemplate$1>;
2162
+ declare const createAutomation$2: MaybeContext<BuildRESTFunction<typeof createAutomation$3> & typeof createAutomation$3>;
2163
+ declare const getAutomation$2: MaybeContext<BuildRESTFunction<typeof getAutomation$3> & typeof getAutomation$3>;
2164
+ declare const updateAutomation$2: MaybeContext<BuildRESTFunction<typeof updateAutomation$3> & typeof updateAutomation$3>;
2165
+ declare const migrationUpdateAutomation: MaybeContext<BuildRESTFunction<typeof migrationUpdateAutomation$1> & typeof migrationUpdateAutomation$1>;
2166
+ declare const deleteAutomation$2: MaybeContext<BuildRESTFunction<typeof deleteAutomation$3> & typeof deleteAutomation$3>;
2167
+ declare const queryAutomations$2: MaybeContext<BuildRESTFunction<typeof queryAutomations$3> & typeof queryAutomations$3>;
2168
+ declare const overrideApplicationAutomation: MaybeContext<BuildRESTFunction<typeof overrideApplicationAutomation$1> & typeof overrideApplicationAutomation$1>;
2169
+ declare const validateAutomationById: MaybeContext<BuildRESTFunction<typeof validateAutomationById$1> & typeof validateAutomationById$1>;
2170
+ declare const validateAutomation$2: MaybeContext<BuildRESTFunction<typeof validateAutomation$3> & typeof validateAutomation$3>;
2171
+ declare const getAutomationActivationStats: MaybeContext<BuildRESTFunction<typeof getAutomationActivationStats$1> & typeof getAutomationActivationStats$1>;
2172
+ declare const getActionsQuotaInfo$2: MaybeContext<BuildRESTFunction<typeof getActionsQuotaInfo$3> & typeof getActionsQuotaInfo$3>;
2173
+ declare const generateActionInputMappingFromTemplate: MaybeContext<BuildRESTFunction<typeof generateActionInputMappingFromTemplate$1> & typeof generateActionInputMappingFromTemplate$1>;
2101
2174
 
2102
2175
  type _publicOnAutomationCreatedType$1 = typeof onAutomationCreated$3;
2103
2176
  /** */
@@ -2143,6 +2216,10 @@ type context$2_GetAutomationActivationStatsOptions = GetAutomationActivationStat
2143
2216
  type context$2_MigrationBulkCreateAutomations = MigrationBulkCreateAutomations;
2144
2217
  type context$2_MigrationBulkCreateAutomationsRequest = MigrationBulkCreateAutomationsRequest;
2145
2218
  type context$2_MigrationBulkCreateAutomationsResponse = MigrationBulkCreateAutomationsResponse;
2219
+ type context$2_MigrationUpdateAutomation = MigrationUpdateAutomation;
2220
+ type context$2_MigrationUpdateAutomationRequest = MigrationUpdateAutomationRequest;
2221
+ type context$2_MigrationUpdateAutomationResponse = MigrationUpdateAutomationResponse;
2222
+ type context$2_MigrationUpdateAutomationResponseNonNullableFields = MigrationUpdateAutomationResponseNonNullableFields;
2146
2223
  type context$2_MigrationUpdateMigratedToV3AutomationRequest = MigrationUpdateMigratedToV3AutomationRequest;
2147
2224
  type context$2_MigrationUpdateMigratedToV3AutomationResponse = MigrationUpdateMigratedToV3AutomationResponse;
2148
2225
  type context$2_Offset = Offset;
@@ -2174,484 +2251,75 @@ type context$2_ValidateAutomationByIdResponse = ValidateAutomationByIdResponse;
2174
2251
  type context$2_ValidateAutomationByIdResponseNonNullableFields = ValidateAutomationByIdResponseNonNullableFields;
2175
2252
  declare const context$2_generateActionInputMappingFromTemplate: typeof generateActionInputMappingFromTemplate;
2176
2253
  declare const context$2_getAutomationActivationStats: typeof getAutomationActivationStats;
2254
+ declare const context$2_migrationUpdateAutomation: typeof migrationUpdateAutomation;
2177
2255
  declare const context$2_overrideApplicationAutomation: typeof overrideApplicationAutomation;
2178
2256
  declare const context$2_validateAutomationById: typeof validateAutomationById;
2179
2257
  declare namespace context$2 {
2180
- export { type Action$2 as Action, type ActionConfigurationError$1 as ActionConfigurationError, ActionErrorType$1 as ActionErrorType, type ActionEvent$2 as ActionEvent, type ActionProviderQuotaInfo$1 as ActionProviderQuotaInfo, type ActionQuotaInfo$1 as ActionQuotaInfo, type ActionValidationError$1 as ActionValidationError, type ActionValidationErrorErrorOneOf$1 as ActionValidationErrorErrorOneOf, type ActionValidationInfo$1 as ActionValidationInfo, type context$2_ActivationReport as ActivationReport, ActivationStatus$1 as ActivationStatus, type AdditionalInfo$1 as AdditionalInfo, type ApplicationError$2 as ApplicationError, type Asset$1 as Asset, type Automation$2 as Automation, type AutomationCreatedEnvelope$1 as AutomationCreatedEnvelope, type AutomationDeletedEnvelope$1 as AutomationDeletedEnvelope, type AutomationDeletedWithEntityEnvelope$1 as AutomationDeletedWithEntityEnvelope, type context$2_AutomationMetadata as AutomationMetadata, type AutomationNonNullableFields$1 as AutomationNonNullableFields, type AutomationUpdatedEnvelope$1 as AutomationUpdatedEnvelope, type AutomationUpdatedWithPreviousEntityEnvelope$1 as AutomationUpdatedWithPreviousEntityEnvelope, type AutomationsQueryBuilder$1 as AutomationsQueryBuilder, type AutomationsQueryResult$1 as AutomationsQueryResult, type BaseEventMetadata$2 as BaseEventMetadata, BlockType$1 as BlockType, type BulkActionMetadata$2 as BulkActionMetadata, type context$2_BulkCreateApplicationAutomationRequest as BulkCreateApplicationAutomationRequest, type context$2_BulkCreateApplicationAutomationResponse as BulkCreateApplicationAutomationResponse, type BulkDeleteAutomationsRequest$1 as BulkDeleteAutomationsRequest, type BulkDeleteAutomationsResponse$1 as BulkDeleteAutomationsResponse, type CTA$1 as CTA, type context$2_Condition as Condition, type ConditionBlock$1 as ConditionBlock, type context$2_Conditions as Conditions, type CreateAutomationRequest$1 as CreateAutomationRequest, type CreateAutomationResponse$1 as CreateAutomationResponse, type CreateAutomationResponseNonNullableFields$1 as CreateAutomationResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type Cursors$1 as Cursors, type context$2_Debounce as Debounce, type Delay$1 as Delay, type context$2_DelayTypeOneOf as DelayTypeOneOf, type context$2_DeleteAutomationOptions as DeleteAutomationOptions, type DeleteAutomationRequest$1 as DeleteAutomationRequest, type DeleteAutomationResponse$1 as DeleteAutomationResponse, type DeleteContext$1 as DeleteContext, DeleteStatus$1 as DeleteStatus, type DeletedWithEntity$1 as DeletedWithEntity, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$2 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type context$2_ExtendedFields as ExtendedFields, type Filter$4 as Filter, type context$2_GenerateActionInputMappingFromTemplateOptions as GenerateActionInputMappingFromTemplateOptions, type context$2_GenerateActionInputMappingFromTemplateRequest as GenerateActionInputMappingFromTemplateRequest, type context$2_GenerateActionInputMappingFromTemplateResponse as GenerateActionInputMappingFromTemplateResponse, type context$2_GenerateApplicationAutomationFromCustomRequest as GenerateApplicationAutomationFromCustomRequest, type context$2_GenerateApplicationAutomationFromCustomResponse as GenerateApplicationAutomationFromCustomResponse, type GetActionsQuotaInfoRequest$1 as GetActionsQuotaInfoRequest, type GetActionsQuotaInfoResponse$1 as GetActionsQuotaInfoResponse, type GetActionsQuotaInfoResponseNonNullableFields$1 as GetActionsQuotaInfoResponseNonNullableFields, type context$2_GetApplicationAutomationRequest as GetApplicationAutomationRequest, type context$2_GetApplicationAutomationResponse as GetApplicationAutomationResponse, type GetAutomationActionSchemaRequest$1 as GetAutomationActionSchemaRequest, type GetAutomationActionSchemaResponse$1 as GetAutomationActionSchemaResponse, type context$2_GetAutomationActivationReportsRequest as GetAutomationActivationReportsRequest, type context$2_GetAutomationActivationReportsResponse as GetAutomationActivationReportsResponse, type context$2_GetAutomationActivationReportsResponseNonNullableFields as GetAutomationActivationReportsResponseNonNullableFields, type context$2_GetAutomationActivationStatsOptions as GetAutomationActivationStatsOptions, type GetAutomationOptions$1 as GetAutomationOptions, type GetAutomationRequest$1 as GetAutomationRequest, type GetAutomationResponse$1 as GetAutomationResponse, type GetAutomationResponseNonNullableFields$1 as GetAutomationResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type ItemMetadata$2 as ItemMetadata, type MessageEnvelope$2 as MessageEnvelope, type MetaSiteSpecialEvent$1 as MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf$1 as MetaSiteSpecialEventPayloadOneOf, type context$2_MigrationBulkCreateAutomations as MigrationBulkCreateAutomations, type context$2_MigrationBulkCreateAutomationsRequest as MigrationBulkCreateAutomationsRequest, type context$2_MigrationBulkCreateAutomationsResponse as MigrationBulkCreateAutomationsResponse, type context$2_MigrationUpdateMigratedToV3AutomationRequest as MigrationUpdateMigratedToV3AutomationRequest, type context$2_MigrationUpdateMigratedToV3AutomationResponse as MigrationUpdateMigratedToV3AutomationResponse, Namespace$1 as Namespace, type NamespaceChanged$1 as NamespaceChanged, type context$2_Offset as Offset, type context$2_OffsetValueOneOf as OffsetValueOneOf, type context$2_OverrideApplicationAutomationRequest as OverrideApplicationAutomationRequest, type context$2_OverrideApplicationAutomationResponse as OverrideApplicationAutomationResponse, type context$2_OverrideApplicationAutomationResponseNonNullableFields as OverrideApplicationAutomationResponseNonNullableFields, type context$2_Paging as Paging, type context$2_PagingMetadata as PagingMetadata, type context$2_PagingMetadataV2 as PagingMetadataV2, type Plan$1 as Plan, type ProviderConfigurationError$1 as ProviderConfigurationError, type context$2_QueryApplicationAutomationsRequest as QueryApplicationAutomationsRequest, type context$2_QueryApplicationAutomationsResponse as QueryApplicationAutomationsResponse, type context$2_QueryAutomationsOptions as QueryAutomationsOptions, type QueryAutomationsRequest$1 as QueryAutomationsRequest, type QueryAutomationsResponse$1 as QueryAutomationsResponse, type QueryAutomationsResponseNonNullableFields$1 as QueryAutomationsResponseNonNullableFields, type context$2_QueryV2 as QueryV2, type context$2_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type Quota$1 as Quota, type QuotaInfo$1 as QuotaInfo, type RateLimit$2 as RateLimit, type RestoreInfo$2 as RestoreInfo, type context$2_Rule as Rule, type ServiceProvisioned$1 as ServiceProvisioned, type ServiceRemoved$1 as ServiceRemoved, type SiteCreated$1 as SiteCreated, SiteCreatedContext$1 as SiteCreatedContext, type SiteDeleted$1 as SiteDeleted, type SiteHardDeleted$1 as SiteHardDeleted, type SiteMarkedAsTemplate$1 as SiteMarkedAsTemplate, type SiteMarkedAsWixSite$1 as SiteMarkedAsWixSite, type SitePublished$1 as SitePublished, type SiteRenamed$1 as SiteRenamed, type SiteTransferred$1 as SiteTransferred, type SiteUndeleted$1 as SiteUndeleted, type SiteUnpublished$1 as SiteUnpublished, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type context$2_Source as Source, State$1 as State, Status$2 as Status, type StudioAssigned$1 as StudioAssigned, type StudioUnassigned$1 as StudioUnassigned, type context$2_SyncApplicationAutomationsRequest as SyncApplicationAutomationsRequest, type context$2_SyncApplicationAutomationsResponse as SyncApplicationAutomationsResponse, type Trigger$2 as Trigger, type TriggerConfigurationError$1 as TriggerConfigurationError, TriggerErrorType$1 as TriggerErrorType, type TriggerValidationError$1 as TriggerValidationError, type TriggerValidationErrorErrorOneOf$1 as TriggerValidationErrorErrorOneOf, TriggerValidationErrorValidationErrorType$1 as TriggerValidationErrorValidationErrorType, Type$2 as Type, type context$2_Until as Until, type context$2_UpdateApplicationAutomationConfigurationIdRequest as UpdateApplicationAutomationConfigurationIdRequest, type context$2_UpdateApplicationAutomationConfigurationIdResponse as UpdateApplicationAutomationConfigurationIdResponse, type context$2_UpdateApplicationAutomationToMigratedFromV1Request as UpdateApplicationAutomationToMigratedFromV1Request, type context$2_UpdateApplicationAutomationToMigratedFromV1Response as UpdateApplicationAutomationToMigratedFromV1Response, type UpdateAutomation$1 as UpdateAutomation, type UpdateAutomationRequest$1 as UpdateAutomationRequest, type UpdateAutomationResponse$1 as UpdateAutomationResponse, type UpdateAutomationResponseNonNullableFields$1 as UpdateAutomationResponseNonNullableFields, type context$2_UpdatedAutomationsWithEsb as UpdatedAutomationsWithEsb, type UpdatedWithPreviousEntity$1 as UpdatedWithPreviousEntity, type UpgradeCTA$1 as UpgradeCTA, type context$2_ValidateAutomationByIdOptions as ValidateAutomationByIdOptions, type context$2_ValidateAutomationByIdRequest as ValidateAutomationByIdRequest, type context$2_ValidateAutomationByIdResponse as ValidateAutomationByIdResponse, type context$2_ValidateAutomationByIdResponseNonNullableFields as ValidateAutomationByIdResponseNonNullableFields, type ValidateAutomationRequest$1 as ValidateAutomationRequest, type ValidateAutomationResponse$1 as ValidateAutomationResponse, type ValidateAutomationResponseNonNullableFields$1 as ValidateAutomationResponseNonNullableFields, ValidationErrorType$1 as ValidationErrorType, WebhookIdentityType$2 as WebhookIdentityType, type _publicOnAutomationCreatedType$1 as _publicOnAutomationCreatedType, type _publicOnAutomationDeletedType$1 as _publicOnAutomationDeletedType, type _publicOnAutomationDeletedWithEntityType$1 as _publicOnAutomationDeletedWithEntityType, type _publicOnAutomationUpdatedType$1 as _publicOnAutomationUpdatedType, type _publicOnAutomationUpdatedWithPreviousEntityType$1 as _publicOnAutomationUpdatedWithPreviousEntityType, createAutomation$2 as createAutomation, deleteAutomation$2 as deleteAutomation, context$2_generateActionInputMappingFromTemplate as generateActionInputMappingFromTemplate, getActionsQuotaInfo$2 as getActionsQuotaInfo, getAutomation$2 as getAutomation, context$2_getAutomationActivationStats as getAutomationActivationStats, onAutomationCreated$2 as onAutomationCreated, onAutomationDeleted$2 as onAutomationDeleted, onAutomationDeletedWithEntity$2 as onAutomationDeletedWithEntity, onAutomationUpdated$2 as onAutomationUpdated, onAutomationUpdatedWithPreviousEntity$2 as onAutomationUpdatedWithPreviousEntity, context$2_overrideApplicationAutomation as overrideApplicationAutomation, onAutomationCreated$3 as publicOnAutomationCreated, onAutomationDeleted$3 as publicOnAutomationDeleted, onAutomationDeletedWithEntity$3 as publicOnAutomationDeletedWithEntity, onAutomationUpdated$3 as publicOnAutomationUpdated, onAutomationUpdatedWithPreviousEntity$3 as publicOnAutomationUpdatedWithPreviousEntity, queryAutomations$2 as queryAutomations, updateAutomation$2 as updateAutomation, validateAutomation$2 as validateAutomation, context$2_validateAutomationById as validateAutomationById };
2258
+ export { type Action$2 as Action, type ActionConfigurationError$1 as ActionConfigurationError, ActionErrorType$1 as ActionErrorType, type ActionEvent$2 as ActionEvent, type ActionProviderQuotaInfo$1 as ActionProviderQuotaInfo, type ActionQuotaInfo$1 as ActionQuotaInfo, type ActionValidationError$1 as ActionValidationError, type ActionValidationErrorErrorOneOf$1 as ActionValidationErrorErrorOneOf, type ActionValidationInfo$1 as ActionValidationInfo, type context$2_ActivationReport as ActivationReport, ActivationStatus$1 as ActivationStatus, type AdditionalInfo$1 as AdditionalInfo, type ApplicationError$2 as ApplicationError, type Asset$1 as Asset, type Automation$2 as Automation, type AutomationCreatedEnvelope$1 as AutomationCreatedEnvelope, type AutomationDeletedEnvelope$1 as AutomationDeletedEnvelope, type AutomationDeletedWithEntityEnvelope$1 as AutomationDeletedWithEntityEnvelope, type context$2_AutomationMetadata as AutomationMetadata, type AutomationNonNullableFields$1 as AutomationNonNullableFields, type AutomationUpdatedEnvelope$1 as AutomationUpdatedEnvelope, type AutomationUpdatedWithPreviousEntityEnvelope$1 as AutomationUpdatedWithPreviousEntityEnvelope, type AutomationsQueryBuilder$1 as AutomationsQueryBuilder, type AutomationsQueryResult$1 as AutomationsQueryResult, type BaseEventMetadata$2 as BaseEventMetadata, BlockType$1 as BlockType, type BulkActionMetadata$2 as BulkActionMetadata, type context$2_BulkCreateApplicationAutomationRequest as BulkCreateApplicationAutomationRequest, type context$2_BulkCreateApplicationAutomationResponse as BulkCreateApplicationAutomationResponse, type BulkDeleteAutomationsRequest$1 as BulkDeleteAutomationsRequest, type BulkDeleteAutomationsResponse$1 as BulkDeleteAutomationsResponse, type CTA$1 as CTA, type context$2_Condition as Condition, type ConditionBlock$1 as ConditionBlock, type context$2_Conditions as Conditions, type CreateAutomationRequest$1 as CreateAutomationRequest, type CreateAutomationResponse$1 as CreateAutomationResponse, type CreateAutomationResponseNonNullableFields$1 as CreateAutomationResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type Cursors$1 as Cursors, type context$2_Debounce as Debounce, type Delay$1 as Delay, type context$2_DelayTypeOneOf as DelayTypeOneOf, type context$2_DeleteAutomationOptions as DeleteAutomationOptions, type DeleteAutomationRequest$1 as DeleteAutomationRequest, type DeleteAutomationResponse$1 as DeleteAutomationResponse, type DeleteContext$1 as DeleteContext, DeleteStatus$1 as DeleteStatus, type DeletedWithEntity$1 as DeletedWithEntity, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$2 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type context$2_ExtendedFields as ExtendedFields, type Filter$2 as Filter, type context$2_GenerateActionInputMappingFromTemplateOptions as GenerateActionInputMappingFromTemplateOptions, type context$2_GenerateActionInputMappingFromTemplateRequest as GenerateActionInputMappingFromTemplateRequest, type context$2_GenerateActionInputMappingFromTemplateResponse as GenerateActionInputMappingFromTemplateResponse, type context$2_GenerateApplicationAutomationFromCustomRequest as GenerateApplicationAutomationFromCustomRequest, type context$2_GenerateApplicationAutomationFromCustomResponse as GenerateApplicationAutomationFromCustomResponse, type GetActionsQuotaInfoRequest$1 as GetActionsQuotaInfoRequest, type GetActionsQuotaInfoResponse$1 as GetActionsQuotaInfoResponse, type GetActionsQuotaInfoResponseNonNullableFields$1 as GetActionsQuotaInfoResponseNonNullableFields, type context$2_GetApplicationAutomationRequest as GetApplicationAutomationRequest, type context$2_GetApplicationAutomationResponse as GetApplicationAutomationResponse, type GetAutomationActionSchemaRequest$1 as GetAutomationActionSchemaRequest, type GetAutomationActionSchemaResponse$1 as GetAutomationActionSchemaResponse, type context$2_GetAutomationActivationReportsRequest as GetAutomationActivationReportsRequest, type context$2_GetAutomationActivationReportsResponse as GetAutomationActivationReportsResponse, type context$2_GetAutomationActivationReportsResponseNonNullableFields as GetAutomationActivationReportsResponseNonNullableFields, type context$2_GetAutomationActivationStatsOptions as GetAutomationActivationStatsOptions, type GetAutomationOptions$1 as GetAutomationOptions, type GetAutomationRequest$1 as GetAutomationRequest, type GetAutomationResponse$1 as GetAutomationResponse, type GetAutomationResponseNonNullableFields$1 as GetAutomationResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type ItemMetadata$2 as ItemMetadata, type MessageEnvelope$2 as MessageEnvelope, type MetaSiteSpecialEvent$1 as MetaSiteSpecialEvent, type MetaSiteSpecialEventPayloadOneOf$1 as MetaSiteSpecialEventPayloadOneOf, type context$2_MigrationBulkCreateAutomations as MigrationBulkCreateAutomations, type context$2_MigrationBulkCreateAutomationsRequest as MigrationBulkCreateAutomationsRequest, type context$2_MigrationBulkCreateAutomationsResponse as MigrationBulkCreateAutomationsResponse, type context$2_MigrationUpdateAutomation as MigrationUpdateAutomation, type context$2_MigrationUpdateAutomationRequest as MigrationUpdateAutomationRequest, type context$2_MigrationUpdateAutomationResponse as MigrationUpdateAutomationResponse, type context$2_MigrationUpdateAutomationResponseNonNullableFields as MigrationUpdateAutomationResponseNonNullableFields, type context$2_MigrationUpdateMigratedToV3AutomationRequest as MigrationUpdateMigratedToV3AutomationRequest, type context$2_MigrationUpdateMigratedToV3AutomationResponse as MigrationUpdateMigratedToV3AutomationResponse, Namespace$1 as Namespace, type NamespaceChanged$1 as NamespaceChanged, type context$2_Offset as Offset, type context$2_OffsetValueOneOf as OffsetValueOneOf, type context$2_OverrideApplicationAutomationRequest as OverrideApplicationAutomationRequest, type context$2_OverrideApplicationAutomationResponse as OverrideApplicationAutomationResponse, type context$2_OverrideApplicationAutomationResponseNonNullableFields as OverrideApplicationAutomationResponseNonNullableFields, type context$2_Paging as Paging, type context$2_PagingMetadata as PagingMetadata, type context$2_PagingMetadataV2 as PagingMetadataV2, type Plan$1 as Plan, type ProviderConfigurationError$1 as ProviderConfigurationError, type context$2_QueryApplicationAutomationsRequest as QueryApplicationAutomationsRequest, type context$2_QueryApplicationAutomationsResponse as QueryApplicationAutomationsResponse, type context$2_QueryAutomationsOptions as QueryAutomationsOptions, type QueryAutomationsRequest$1 as QueryAutomationsRequest, type QueryAutomationsResponse$1 as QueryAutomationsResponse, type QueryAutomationsResponseNonNullableFields$1 as QueryAutomationsResponseNonNullableFields, type context$2_QueryV2 as QueryV2, type context$2_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type Quota$1 as Quota, type QuotaInfo$1 as QuotaInfo, type RateLimit$2 as RateLimit, type RestoreInfo$2 as RestoreInfo, type context$2_Rule as Rule, type ServiceProvisioned$1 as ServiceProvisioned, type ServiceRemoved$1 as ServiceRemoved, type SiteCreated$1 as SiteCreated, SiteCreatedContext$1 as SiteCreatedContext, type SiteDeleted$1 as SiteDeleted, type SiteHardDeleted$1 as SiteHardDeleted, type SiteMarkedAsTemplate$1 as SiteMarkedAsTemplate, type SiteMarkedAsWixSite$1 as SiteMarkedAsWixSite, type SitePublished$1 as SitePublished, type SiteRenamed$1 as SiteRenamed, type SiteTransferred$1 as SiteTransferred, type SiteUndeleted$1 as SiteUndeleted, type SiteUnpublished$1 as SiteUnpublished, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type context$2_Source as Source, State$1 as State, Status$2 as Status, type StudioAssigned$1 as StudioAssigned, type StudioUnassigned$1 as StudioUnassigned, type context$2_SyncApplicationAutomationsRequest as SyncApplicationAutomationsRequest, type context$2_SyncApplicationAutomationsResponse as SyncApplicationAutomationsResponse, type Trigger$2 as Trigger, type TriggerConfigurationError$1 as TriggerConfigurationError, TriggerErrorType$1 as TriggerErrorType, type TriggerValidationError$1 as TriggerValidationError, type TriggerValidationErrorErrorOneOf$1 as TriggerValidationErrorErrorOneOf, TriggerValidationErrorValidationErrorType$1 as TriggerValidationErrorValidationErrorType, Type$2 as Type, type context$2_Until as Until, type context$2_UpdateApplicationAutomationConfigurationIdRequest as UpdateApplicationAutomationConfigurationIdRequest, type context$2_UpdateApplicationAutomationConfigurationIdResponse as UpdateApplicationAutomationConfigurationIdResponse, type context$2_UpdateApplicationAutomationToMigratedFromV1Request as UpdateApplicationAutomationToMigratedFromV1Request, type context$2_UpdateApplicationAutomationToMigratedFromV1Response as UpdateApplicationAutomationToMigratedFromV1Response, type UpdateAutomation$1 as UpdateAutomation, type UpdateAutomationRequest$1 as UpdateAutomationRequest, type UpdateAutomationResponse$1 as UpdateAutomationResponse, type UpdateAutomationResponseNonNullableFields$1 as UpdateAutomationResponseNonNullableFields, type context$2_UpdatedAutomationsWithEsb as UpdatedAutomationsWithEsb, type UpdatedWithPreviousEntity$1 as UpdatedWithPreviousEntity, type UpgradeCTA$1 as UpgradeCTA, type context$2_ValidateAutomationByIdOptions as ValidateAutomationByIdOptions, type context$2_ValidateAutomationByIdRequest as ValidateAutomationByIdRequest, type context$2_ValidateAutomationByIdResponse as ValidateAutomationByIdResponse, type context$2_ValidateAutomationByIdResponseNonNullableFields as ValidateAutomationByIdResponseNonNullableFields, type ValidateAutomationRequest$1 as ValidateAutomationRequest, type ValidateAutomationResponse$1 as ValidateAutomationResponse, type ValidateAutomationResponseNonNullableFields$1 as ValidateAutomationResponseNonNullableFields, ValidationErrorType$1 as ValidationErrorType, WebhookIdentityType$2 as WebhookIdentityType, type _publicOnAutomationCreatedType$1 as _publicOnAutomationCreatedType, type _publicOnAutomationDeletedType$1 as _publicOnAutomationDeletedType, type _publicOnAutomationDeletedWithEntityType$1 as _publicOnAutomationDeletedWithEntityType, type _publicOnAutomationUpdatedType$1 as _publicOnAutomationUpdatedType, type _publicOnAutomationUpdatedWithPreviousEntityType$1 as _publicOnAutomationUpdatedWithPreviousEntityType, createAutomation$2 as createAutomation, deleteAutomation$2 as deleteAutomation, context$2_generateActionInputMappingFromTemplate as generateActionInputMappingFromTemplate, getActionsQuotaInfo$2 as getActionsQuotaInfo, getAutomation$2 as getAutomation, context$2_getAutomationActivationStats as getAutomationActivationStats, context$2_migrationUpdateAutomation as migrationUpdateAutomation, onAutomationCreated$2 as onAutomationCreated, onAutomationDeleted$2 as onAutomationDeleted, onAutomationDeletedWithEntity$2 as onAutomationDeletedWithEntity, onAutomationUpdated$2 as onAutomationUpdated, onAutomationUpdatedWithPreviousEntity$2 as onAutomationUpdatedWithPreviousEntity, context$2_overrideApplicationAutomation as overrideApplicationAutomation, onAutomationCreated$3 as publicOnAutomationCreated, onAutomationDeleted$3 as publicOnAutomationDeleted, onAutomationDeletedWithEntity$3 as publicOnAutomationDeletedWithEntity, onAutomationUpdated$3 as publicOnAutomationUpdated, onAutomationUpdatedWithPreviousEntity$3 as publicOnAutomationUpdatedWithPreviousEntity, queryAutomations$2 as queryAutomations, updateAutomation$2 as updateAutomation, validateAutomation$2 as validateAutomation, context$2_validateAutomationById as validateAutomationById };
2181
2259
  }
2182
2260
 
2183
- type HostModule$1<T, H extends Host$1> = {
2184
- __type: 'host';
2185
- create(host: H): T;
2186
- };
2187
- type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
2188
- type Host$1<Environment = unknown> = {
2189
- channel: {
2190
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
2191
- disconnect: () => void;
2192
- } | Promise<{
2193
- disconnect: () => void;
2194
- }>;
2195
- };
2196
- environment?: Environment;
2261
+ interface Activation {
2262
+ /** Activation ID */
2263
+ _id?: string;
2264
+ /** Activation automation */
2265
+ automation?: Automation$1;
2266
+ }
2267
+ interface Automation$1 extends AutomationOriginInfoOneOf$1 {
2268
+ /** Application info */
2269
+ applicationInfo?: ApplicationOrigin$1;
2270
+ /** Preinstalled info */
2271
+ preinstalledInfo?: PreinstalledOrigin$1;
2197
2272
  /**
2198
- * Optional bast url to use for API requests, for example `www.wixapis.com`
2273
+ * Automation ID.
2274
+ * @readonly
2199
2275
  */
2200
- apiBaseUrl?: string;
2276
+ _id?: string | null;
2201
2277
  /**
2202
- * Possible data to be provided by every host, for cross cutting concerns
2203
- * like internationalization, billing, etc.
2278
+ * Revision number, which increments by 1 each time the automation is updated.
2279
+ * To prevent conflicting changes,
2280
+ * the current revision must be passed when updating the automation.
2281
+ *
2282
+ * Ignored when creating an automation.
2283
+ * @readonly
2204
2284
  */
2205
- essentials?: {
2206
- /**
2207
- * The language of the currently viewed session
2208
- */
2209
- language?: string;
2210
- /**
2211
- * The locale of the currently viewed session
2212
- */
2213
- locale?: string;
2214
- /**
2215
- * Any headers that should be passed through to the API requests
2216
- */
2217
- passThroughHeaders?: Record<string, string>;
2218
- };
2219
- };
2220
-
2221
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
2222
- interface HttpClient$1 {
2223
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
2224
- fetchWithAuth: typeof fetch;
2225
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
2226
- getActiveToken?: () => string | undefined;
2227
- }
2228
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
2229
- type HttpResponse$1<T = any> = {
2230
- data: T;
2231
- status: number;
2232
- statusText: string;
2233
- headers: any;
2234
- request?: any;
2235
- };
2236
- type RequestOptions$1<_TResponse = any, Data = any> = {
2237
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2238
- url: string;
2239
- data?: Data;
2240
- params?: URLSearchParams;
2241
- } & APIMetadata$1;
2242
- type APIMetadata$1 = {
2243
- methodFqn?: string;
2244
- entityFqdn?: string;
2245
- packageName?: string;
2246
- };
2247
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
2248
- type EventDefinition$3<Payload = unknown, Type extends string = string> = {
2249
- __type: 'event-definition';
2250
- type: Type;
2251
- isDomainEvent?: boolean;
2252
- transformations?: (envelope: unknown) => Payload;
2253
- __payload: Payload;
2254
- };
2255
- declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
2256
- type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
2257
- type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
2258
-
2259
- type ServicePluginMethodInput$1 = {
2260
- request: any;
2261
- metadata: any;
2262
- };
2263
- type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
2264
- type ServicePluginMethodMetadata$1 = {
2265
- name: string;
2266
- primaryHttpMappingPath: string;
2267
- transformations: {
2268
- fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
2269
- toREST: (...args: unknown[]) => unknown;
2270
- };
2271
- };
2272
- type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
2273
- __type: 'service-plugin-definition';
2274
- componentType: string;
2275
- methods: ServicePluginMethodMetadata$1[];
2276
- __contract: Contract;
2277
- };
2278
- declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
2279
- type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
2280
- declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
2281
-
2282
- type RequestContext$1 = {
2283
- isSSR: boolean;
2284
- host: string;
2285
- protocol?: string;
2286
- };
2287
- type ResponseTransformer$1 = (data: any, headers?: any) => any;
2288
- /**
2289
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
2290
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
2291
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
2292
- */
2293
- type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
2294
- type AmbassadorRequestOptions$1<T = any> = {
2295
- _?: T;
2296
- url?: string;
2297
- method?: Method$1;
2298
- params?: any;
2299
- data?: any;
2300
- transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
2301
- };
2302
- type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
2303
- __isAmbassador: boolean;
2304
- };
2305
- type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
2306
- type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
2307
-
2308
- declare global {
2309
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2310
- interface SymbolConstructor {
2311
- readonly observable: symbol;
2312
- }
2313
- }
2314
-
2315
- declare const emptyObjectSymbol$1: unique symbol;
2316
-
2317
- /**
2318
- Represents a strictly empty plain object, the `{}` value.
2319
-
2320
- 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)).
2321
-
2322
- @example
2323
- ```
2324
- import type {EmptyObject} from 'type-fest';
2325
-
2326
- // The following illustrates the problem with `{}`.
2327
- const foo1: {} = {}; // Pass
2328
- const foo2: {} = []; // Pass
2329
- const foo3: {} = 42; // Pass
2330
- const foo4: {} = {a: 1}; // Pass
2331
-
2332
- // With `EmptyObject` only the first case is valid.
2333
- const bar1: EmptyObject = {}; // Pass
2334
- const bar2: EmptyObject = 42; // Fail
2335
- const bar3: EmptyObject = []; // Fail
2336
- const bar4: EmptyObject = {a: 1}; // Fail
2337
- ```
2338
-
2339
- 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}.
2340
-
2341
- @category Object
2342
- */
2343
- type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
2344
-
2345
- /**
2346
- Returns a boolean for whether the two given types are equal.
2347
-
2348
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
2349
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
2350
-
2351
- Use-cases:
2352
- - If you want to make a conditional branch based on the result of a comparison of two types.
2353
-
2354
- @example
2355
- ```
2356
- import type {IsEqual} from 'type-fest';
2357
-
2358
- // This type returns a boolean for whether the given array includes the given item.
2359
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
2360
- type Includes<Value extends readonly any[], Item> =
2361
- Value extends readonly [Value[0], ...infer rest]
2362
- ? IsEqual<Value[0], Item> extends true
2363
- ? true
2364
- : Includes<rest, Item>
2365
- : false;
2366
- ```
2367
-
2368
- @category Type Guard
2369
- @category Utilities
2370
- */
2371
- type IsEqual$1<A, B> =
2372
- (<G>() => G extends A ? 1 : 2) extends
2373
- (<G>() => G extends B ? 1 : 2)
2374
- ? true
2375
- : false;
2376
-
2377
- /**
2378
- Filter out keys from an object.
2379
-
2380
- Returns `never` if `Exclude` is strictly equal to `Key`.
2381
- Returns `never` if `Key` extends `Exclude`.
2382
- Returns `Key` otherwise.
2383
-
2384
- @example
2385
- ```
2386
- type Filtered = Filter<'foo', 'foo'>;
2387
- //=> never
2388
- ```
2389
-
2390
- @example
2391
- ```
2392
- type Filtered = Filter<'bar', string>;
2393
- //=> never
2394
- ```
2395
-
2396
- @example
2397
- ```
2398
- type Filtered = Filter<'bar', 'foo'>;
2399
- //=> 'bar'
2400
- ```
2401
-
2402
- @see {Except}
2403
- */
2404
- type Filter$3<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
2405
-
2406
- type ExceptOptions$1 = {
2407
- /**
2408
- Disallow assigning non-specified properties.
2409
-
2410
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
2411
-
2412
- @default false
2413
- */
2414
- requireExactProps?: boolean;
2415
- };
2416
-
2417
- /**
2418
- Create a type from an object type without certain keys.
2419
-
2420
- We recommend setting the `requireExactProps` option to `true`.
2421
-
2422
- 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.
2423
-
2424
- 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)).
2425
-
2426
- @example
2427
- ```
2428
- import type {Except} from 'type-fest';
2429
-
2430
- type Foo = {
2431
- a: number;
2432
- b: string;
2433
- };
2434
-
2435
- type FooWithoutA = Except<Foo, 'a'>;
2436
- //=> {b: string}
2437
-
2438
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
2439
- //=> errors: 'a' does not exist in type '{ b: string; }'
2440
-
2441
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
2442
- //=> {a: number} & Partial<Record<"b", never>>
2443
-
2444
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
2445
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
2446
- ```
2447
-
2448
- @category Object
2449
- */
2450
- type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
2451
- [KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
2452
- } & (Options['requireExactProps'] extends true
2453
- ? Partial<Record<KeysType, never>>
2454
- : {});
2455
-
2456
- /**
2457
- Extract the keys from a type where the value type of the key extends the given `Condition`.
2458
-
2459
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
2460
-
2461
- @example
2462
- ```
2463
- import type {ConditionalKeys} from 'type-fest';
2464
-
2465
- interface Example {
2466
- a: string;
2467
- b: string | number;
2468
- c?: string;
2469
- d: {};
2470
- }
2471
-
2472
- type StringKeysOnly = ConditionalKeys<Example, string>;
2473
- //=> 'a'
2474
- ```
2475
-
2476
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
2477
-
2478
- @example
2479
- ```
2480
- import type {ConditionalKeys} from 'type-fest';
2481
-
2482
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
2483
- //=> 'a' | 'c'
2484
- ```
2485
-
2486
- @category Object
2487
- */
2488
- type ConditionalKeys$1<Base, Condition> = NonNullable<
2489
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
2490
- {
2491
- // Map through all the keys of the given base type.
2492
- [Key in keyof Base]:
2493
- // Pick only keys with types extending the given `Condition` type.
2494
- Base[Key] extends Condition
2495
- // Retain this key since the condition passes.
2496
- ? Key
2497
- // Discard this key since the condition fails.
2498
- : never;
2499
-
2500
- // Convert the produced object into a union type of the keys which passed the conditional test.
2501
- }[keyof Base]
2502
- >;
2503
-
2504
- /**
2505
- Exclude keys from a shape that matches the given `Condition`.
2506
-
2507
- 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.
2508
-
2509
- @example
2510
- ```
2511
- import type {Primitive, ConditionalExcept} from 'type-fest';
2512
-
2513
- class Awesome {
2514
- name: string;
2515
- successes: number;
2516
- failures: bigint;
2517
-
2518
- run() {}
2519
- }
2520
-
2521
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
2522
- //=> {run: () => void}
2523
- ```
2524
-
2525
- @example
2526
- ```
2527
- import type {ConditionalExcept} from 'type-fest';
2528
-
2529
- interface Example {
2530
- a: string;
2531
- b: string | number;
2532
- c: () => void;
2533
- d: {};
2534
- }
2535
-
2536
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
2537
- //=> {b: string | number; c: () => void; d: {}}
2538
- ```
2539
-
2540
- @category Object
2541
- */
2542
- type ConditionalExcept$1<Base, Condition> = Except$1<
2543
- Base,
2544
- ConditionalKeys$1<Base, Condition>
2545
- >;
2546
-
2547
- /**
2548
- * Descriptors are objects that describe the API of a module, and the module
2549
- * can either be a REST module or a host module.
2550
- * This type is recursive, so it can describe nested modules.
2551
- */
2552
- type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$3<any> | ServicePluginDefinition$1<any> | {
2553
- [key: string]: Descriptors$1 | PublicMetadata$1 | any;
2554
- };
2555
- /**
2556
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
2557
- * and returns an object with the same structure, but with all descriptors replaced with their API.
2558
- * Any non-descriptor properties are removed from the returned object, including descriptors that
2559
- * do not match the given host (as they will not work with the given host).
2560
- */
2561
- type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
2562
- done: T;
2563
- recurse: T extends {
2564
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
2565
- } ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
2566
- [Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
2567
- -1,
2568
- 0,
2569
- 1,
2570
- 2,
2571
- 3,
2572
- 4,
2573
- 5
2574
- ][Depth]> : never;
2575
- }, EmptyObject$1>;
2576
- }[Depth extends -1 ? 'done' : 'recurse'];
2577
- type PublicMetadata$1 = {
2578
- PACKAGE_NAME?: string;
2579
- };
2580
-
2581
- declare global {
2582
- interface ContextualClient {
2583
- }
2584
- }
2585
- /**
2586
- * A type used to create concerete types from SDK descriptors in
2587
- * case a contextual client is available.
2588
- */
2589
- type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
2590
- host: Host$1;
2591
- } ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
2592
-
2593
- interface Activation {
2594
- /** Activation ID */
2595
- _id?: string;
2596
- /** Activation automation */
2597
- automation?: Automation$1;
2598
- }
2599
- interface Automation$1 extends AutomationOriginInfoOneOf$1 {
2600
- /** Application info */
2601
- applicationInfo?: ApplicationOrigin$1;
2602
- /** Preinstalled info */
2603
- preinstalledInfo?: PreinstalledOrigin$1;
2604
- /**
2605
- * Automation ID.
2606
- * @readonly
2607
- */
2608
- _id?: string | null;
2609
- /**
2610
- * Revision number, which increments by 1 each time the automation is updated.
2611
- * To prevent conflicting changes,
2612
- * the current revision must be passed when updating the automation.
2613
- *
2614
- * Ignored when creating an automation.
2615
- * @readonly
2616
- */
2617
- revision?: string | null;
2618
- /**
2619
- * Information about the creator of the automation.
2620
- * @readonly
2621
- */
2622
- createdBy?: AuditInfo$1;
2623
- /**
2624
- * Date and time the automation was created.
2625
- * @readonly
2626
- */
2627
- _createdDate?: Date;
2628
- /**
2629
- * The entity that last updated the automation.
2630
- * @readonly
2631
- */
2632
- updatedBy?: AuditInfo$1;
2633
- /**
2634
- * Date and time the automation was last updated.
2635
- * @readonly
2636
- */
2637
- _updatedDate?: Date;
2638
- /** Automation name that is displayed on the user's site. */
2639
- name?: string;
2640
- /** Automation description. */
2641
- description?: string | null;
2642
- /** Object that defines the automation's trigger, actions, and activation status. */
2643
- configuration?: AutomationConfiguration$1;
2644
- /** Defines how the automation was added to the site. */
2645
- origin?: Origin$1;
2646
- /** Automation settings. */
2647
- settings?: AutomationSettings$1;
2648
- /**
2649
- * Draft info (optional - only if the automation is a draft)
2650
- * @readonly
2651
- */
2652
- draftInfo?: DraftInfo$1;
2653
- /** Namespace */
2654
- namespace?: string | null;
2285
+ revision?: string | null;
2286
+ /**
2287
+ * Information about the creator of the automation.
2288
+ * @readonly
2289
+ */
2290
+ createdBy?: AuditInfo$1;
2291
+ /**
2292
+ * Date and time the automation was created.
2293
+ * @readonly
2294
+ */
2295
+ _createdDate?: Date;
2296
+ /**
2297
+ * The entity that last updated the automation.
2298
+ * @readonly
2299
+ */
2300
+ updatedBy?: AuditInfo$1;
2301
+ /**
2302
+ * Date and time the automation was last updated.
2303
+ * @readonly
2304
+ */
2305
+ _updatedDate?: Date;
2306
+ /** Automation name that is displayed on the user's site. */
2307
+ name?: string;
2308
+ /** Automation description. */
2309
+ description?: string | null;
2310
+ /** Object that defines the automation's trigger, actions, and activation status. */
2311
+ configuration?: AutomationConfiguration$1;
2312
+ /** Defines how the automation was added to the site. */
2313
+ origin?: Origin$1;
2314
+ /** Automation settings. */
2315
+ settings?: AutomationSettings$1;
2316
+ /**
2317
+ * Draft info (optional - only if the automation is a draft)
2318
+ * @readonly
2319
+ */
2320
+ draftInfo?: DraftInfo$1;
2321
+ /** Namespace */
2322
+ namespace?: string | null;
2655
2323
  }
2656
2324
  /** @oneof */
2657
2325
  interface AutomationOriginInfoOneOf$1 {
@@ -2711,7 +2379,7 @@ declare enum TimeUnit$1 {
2711
2379
  WEEKS = "WEEKS",
2712
2380
  MONTHS = "MONTHS"
2713
2381
  }
2714
- interface Filter$2 {
2382
+ interface Filter$1 {
2715
2383
  /** Filter ID. */
2716
2384
  _id?: string;
2717
2385
  /** Field key from the payload schema, for example "formId". */
@@ -2837,7 +2505,7 @@ interface Trigger$1 {
2837
2505
  * List of filters on schema fields.
2838
2506
  * In order for the automation to run, all filter expressions must evaluate to `true` for a given payload.
2839
2507
  */
2840
- filters?: Filter$2[];
2508
+ filters?: Filter$1[];
2841
2509
  /** Defines the time offset between the trigger date and when the automation runs. */
2842
2510
  scheduledEventOffset?: FutureDateActivationOffset$1;
2843
2511
  /** Limits the number of times an automation can be triggered. */
@@ -3844,889 +3512,479 @@ interface BulkCancelEventRequest {
3844
3512
  }
3845
3513
  interface BulkCancelEventResponse {
3846
3514
  /** Trigger key related to the cancelled event */
3847
- triggerKey?: string;
3848
- /** List of results for each item in the bulk cancel event request */
3849
- results?: BulkCancelEventResult[];
3850
- /** Metadata for the overall bulk action, including success and failure counts */
3851
- bulkActionMetadata?: BulkActionMetadata$1;
3852
- }
3853
- interface BulkCancelEventResult {
3854
- /** Metadata of the item, including its ID and success or failure status */
3855
- itemMetadata?: ItemMetadata$1;
3856
- /** ID of the related resource in GUID format */
3857
- externalEntityId?: string;
3858
- }
3859
- interface CancelEventRequest {
3860
- /**
3861
- * ID of the related resource in GUID format.
3862
- * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
3863
- *
3864
- * Typically, this ID is defined in your system,
3865
- * but you can also use any Wix resource GUID,
3866
- * such as contact ID, member ID, or invoice ID.
3867
- * See
3868
- * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
3869
- * for more information.
3870
- */
3871
- externalEntityId: string;
3872
- /**
3873
- * Trigger key whose event you want to cancel.
3874
- * For example, `form_submitted` or `invoice_due`.
3875
- */
3876
- triggerKey: string;
3877
- }
3878
- interface CancelEventResponse {
3879
- }
3880
- interface V1RunAutomationRequest extends V1RunAutomationRequestIdentifierOneOf {
3881
- /** a preinstalled automation identifier */
3882
- preinstalledIdentifier?: PreinstalledIdentifier;
3883
- /** a automation of any type identifier that will be available in future */
3884
- automationIdentifier?: AutomationIdentifier;
3885
- /** identifier MUST be either AUTOMATION or PREINSTALLED */
3886
- identifierType?: IdentifierType;
3887
- /**
3888
- * Event payload, formatted as key:value pairs.
3889
- * Must comply with the payload schema
3890
- * if you provided one when configuring your trigger.
3891
- *
3892
- * Key names can include only alphanumeric characters or underscores
3893
- * (`A-Z`, `a-z`, `0-9`, `_`).
3894
- * They cannot start with an underscore.
3895
- *
3896
- * Values can be strings, numbers, integers, booleans, or arrays.
3897
- * If a value is an array, the array items must be objects,
3898
- * and nested object properties must be
3899
- * strings, numbers, integers, or booleans only.
3900
- */
3901
- payload?: Record<string, any> | null;
3902
- }
3903
- /** @oneof */
3904
- interface V1RunAutomationRequestIdentifierOneOf {
3905
- /** a preinstalled automation identifier */
3906
- preinstalledIdentifier?: PreinstalledIdentifier;
3907
- /** a automation of any type identifier that will be available in future */
3908
- automationIdentifier?: AutomationIdentifier;
3909
- }
3910
- declare enum IdentifierType {
3911
- UNKNOWN_IDENTIFIER = "UNKNOWN_IDENTIFIER",
3912
- PREINSTALLED = "PREINSTALLED",
3913
- AUTOMATION = "AUTOMATION"
3914
- }
3915
- interface PreinstalledIdentifier {
3916
- /** identifier for the application of the preinstalled */
3917
- appId?: string;
3918
- /** application component id */
3919
- componentId?: string;
3920
- }
3921
- interface AutomationIdentifier {
3922
- /** automation id */
3923
- automationId?: string;
3924
- }
3925
- interface V1RunAutomationResponse {
3926
- }
3927
- interface ReportDomainEventRequest {
3928
- /** trigger app id */
3929
- triggerAppId?: string;
3930
- /** report event request */
3931
- reportEventRequest?: ReportEventRequest;
3932
- }
3933
- interface ReportDomainEventResponse {
3934
- }
3935
- interface ExecuteFromActionRequest {
3936
- /** Requested action id */
3937
- actionId?: string;
3938
- /** Optional: an activation id to link this action to */
3939
- activationId?: string | null;
3940
- /** Activation payload */
3941
- payload?: Record<string, any> | null;
3942
- /** Configuration correlation id to run this action from */
3943
- configurationCorrelationId?: string;
3944
- /** Optional - schedule id that this action was scheduled from */
3945
- scheduleId?: string | null;
3946
- /** Optional - an external entity id that this execution is related to */
3947
- externalEntityId?: string | null;
3948
- /** Optional - Activation automation */
3949
- automation?: Automation$1;
3950
- }
3951
- interface ExecuteFromActionResponse {
3952
- }
3953
- interface ActivationScheduleCompleted {
3954
- /** Activation identifier */
3955
- _id?: string;
3956
- /** Activation schedule identifier */
3957
- scheduleId?: string;
3958
- /** Activation schedule due date */
3959
- scheduleDate?: Date;
3960
- /** Activation payload */
3961
- payload?: Record<string, any> | null;
3962
- /** Activation Automation */
3963
- automation?: Automation$1;
3964
- /** Optional - external entity id that this activation is related to */
3965
- externalEntityId?: string | null;
3966
- }
3967
- interface ReportEventResponseNonNullableFields {
3968
- activationIds: string[];
3969
- }
3970
- interface ApplicationErrorNonNullableFields$1 {
3971
- code: string;
3972
- description: string;
3973
- }
3974
- interface ItemMetadataNonNullableFields$1 {
3975
- originalIndex: number;
3976
- success: boolean;
3977
- error?: ApplicationErrorNonNullableFields$1;
3978
- }
3979
- interface IdempotencyNonNullableFields {
3980
- key: string;
3981
- }
3982
- interface EventInfoNonNullableFields {
3983
- idempotency?: IdempotencyNonNullableFields;
3984
- }
3985
- interface BulkReportEventResultNonNullableFields {
3986
- itemMetadata?: ItemMetadataNonNullableFields$1;
3987
- eventInfo?: EventInfoNonNullableFields;
3988
- activationIds: string[];
3989
- }
3990
- interface BulkActionMetadataNonNullableFields$1 {
3991
- totalSuccesses: number;
3992
- totalFailures: number;
3993
- undetailedFailures: number;
3994
- }
3995
- interface BulkReportEventResponseNonNullableFields {
3996
- triggerKey: string;
3997
- results: BulkReportEventResultNonNullableFields[];
3998
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3999
- }
4000
- interface BulkCancelEventResultNonNullableFields {
4001
- itemMetadata?: ItemMetadataNonNullableFields$1;
4002
- externalEntityId: string;
4003
- }
4004
- interface BulkCancelEventResponseNonNullableFields {
4005
- triggerKey: string;
4006
- results: BulkCancelEventResultNonNullableFields[];
4007
- bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
4008
- }
4009
- interface BaseEventMetadata$1 {
4010
- /** App instance ID. */
4011
- instanceId?: string | null;
4012
- /** Event type. */
4013
- eventType?: string;
4014
- /** The identification type and identity data. */
4015
- identity?: IdentificationData$1;
4016
- }
4017
- interface EventMetadata$1 extends BaseEventMetadata$1 {
4018
- /**
4019
- * Unique event ID.
4020
- * Allows clients to ignore duplicate webhooks.
4021
- */
4022
- _id?: string;
4023
- /**
4024
- * Assumes actions are also always typed to an entity_type
4025
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
4026
- */
4027
- entityFqdn?: string;
4028
- /**
4029
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
4030
- * This is although the created/updated/deleted notion is duplication of the oneof types
4031
- * Example: created/updated/deleted/started/completed/email_opened
4032
- */
4033
- slug?: string;
4034
- /** ID of the entity associated with the event. */
4035
- entityId?: string;
4036
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
4037
- eventTime?: Date;
4038
- /**
4039
- * Whether the event was triggered as a result of a privacy regulation application
4040
- * (for example, GDPR).
4041
- */
4042
- triggeredByAnonymizeRequest?: boolean | null;
4043
- /** If present, indicates the action that triggered the event. */
4044
- originatedFrom?: string | null;
4045
- /**
4046
- * A sequence number defining the order of updates to the underlying entity.
4047
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
4048
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
4049
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
4050
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
4051
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
4052
- */
4053
- entityEventSequence?: string | null;
4054
- }
4055
- interface ActivationStatusChangedEnvelope {
4056
- data: ActivationStatusChanged;
4057
- metadata: EventMetadata$1;
4058
- }
4059
- interface ReportEventOptions {
4060
- /**
4061
- * Event payload, formatted as key:value pairs.
4062
- * Must comply with the payload schema
4063
- * if you provided one when configuring your trigger.
4064
- *
4065
- * Key names can include only alphanumeric characters or underscores
4066
- * (`A-Z`, `a-z`, `0-9`, `_`).
4067
- * They cannot start with an underscore.
4068
- *
4069
- * Values can be strings, numbers, integers, booleans, or arrays.
4070
- * If a value is an array, the array items must be objects,
4071
- * and nested object properties must be
4072
- * strings, numbers, integers, or booleans only.
4073
- */
4074
- payload?: Record<string, any> | null;
3515
+ triggerKey?: string;
3516
+ /** List of results for each item in the bulk cancel event request */
3517
+ results?: BulkCancelEventResult[];
3518
+ /** Metadata for the overall bulk action, including success and failure counts */
3519
+ bulkActionMetadata?: BulkActionMetadata$1;
3520
+ }
3521
+ interface BulkCancelEventResult {
3522
+ /** Metadata of the item, including its ID and success or failure status */
3523
+ itemMetadata?: ItemMetadata$1;
3524
+ /** ID of the related resource in GUID format */
3525
+ externalEntityId?: string;
3526
+ }
3527
+ interface CancelEventRequest {
4075
3528
  /**
4076
3529
  * ID of the related resource in GUID format.
4077
3530
  * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
4078
3531
  *
4079
- * Required if your app needs to
4080
- * [cancel the event](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/cancel-event)
4081
- * if the automation becomes no longer relevant.
4082
- *
4083
3532
  * Typically, this ID is defined in your system,
4084
3533
  * but you can also use any Wix resource GUID,
4085
3534
  * such as contact ID, member ID, or invoice ID.
4086
3535
  * See
4087
- * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#about-canceling-events)
3536
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
4088
3537
  * for more information.
4089
3538
  */
4090
- externalEntityId?: string | null;
4091
- /** Idempotency information for the event */
4092
- idempotency?: Idempotency;
4093
- }
4094
-
4095
- declare function reportEvent$1(httpClient: HttpClient$1): ReportEventSignature;
4096
- interface ReportEventSignature {
4097
- /**
4098
- * Reports an event and activates site automations with the specified trigger key.
4099
- *
4100
- *
4101
- * Only the app that created a trigger can report events for it.
4102
- * This means other apps can't report events for your triggers,
4103
- * and you can't report events for another app's triggers.
4104
- *
4105
- * If your app supports canceling events,
4106
- * `externalEntityId` must be provided.
4107
- * `externalEntityId` is required when calling [cancelEvent()](#cancel-event).
4108
- * @param - Trigger key as defined in your app's trigger configuration
4109
- * in the app dashboard.
4110
- * For example, `form_submitted` or `invoice_due`.
4111
- */
4112
- (triggerKey: string, options?: ReportEventOptions | undefined): Promise<ReportEventResponse & ReportEventResponseNonNullableFields>;
4113
- }
4114
- declare function bulkReportEvent$1(httpClient: HttpClient$1): BulkReportEventSignature;
4115
- interface BulkReportEventSignature {
3539
+ externalEntityId: string;
4116
3540
  /**
4117
- * Bulk reports events and activates site automations with the specified trigger key.
4118
- * @param - Trigger key as defined in your app's trigger configuration
4119
- * in the app dashboard.
3541
+ * Trigger key whose event you want to cancel.
4120
3542
  * For example, `form_submitted` or `invoice_due`.
4121
- * @param - Repeated list of event details for bulk reporting
4122
3543
  */
4123
- (triggerKey: string, eventsInfo: EventInfo[]): Promise<BulkReportEventResponse & BulkReportEventResponseNonNullableFields>;
3544
+ triggerKey: string;
4124
3545
  }
4125
- declare function bulkCancelEvent$1(httpClient: HttpClient$1): BulkCancelEventSignature;
4126
- interface BulkCancelEventSignature {
4127
- /**
4128
- * Bulk cancels any remaining actions for a trigger and external entities.
4129
- * @param - Trigger key whose events you want to cancel.
4130
- * For example, `form_submitted` or `invoice_due`.
4131
- * @param - Repeated list of external_entity_id, representing the related resources' IDs
4132
- */
4133
- (triggerKey: string, externalEntityIds: string[]): Promise<BulkCancelEventResponse & BulkCancelEventResponseNonNullableFields>;
3546
+ interface CancelEventResponse {
4134
3547
  }
4135
- declare function cancelEvent$1(httpClient: HttpClient$1): CancelEventSignature;
4136
- interface CancelEventSignature {
3548
+ interface V1RunAutomationRequest extends V1RunAutomationRequestIdentifierOneOf {
3549
+ /** a preinstalled automation identifier */
3550
+ preinstalledIdentifier?: PreinstalledIdentifier;
3551
+ /** a automation of any type identifier that will be available in future */
3552
+ automationIdentifier?: AutomationIdentifier;
3553
+ /** identifier MUST be either AUTOMATION or PREINSTALLED */
3554
+ identifierType?: IdentifierType;
4137
3555
  /**
4138
- * Cancels any remaining actions for a trigger and external entity.
4139
- *
3556
+ * Event payload, formatted as key:value pairs.
3557
+ * Must comply with the payload schema
3558
+ * if you provided one when configuring your trigger.
4140
3559
  *
4141
- * Events are not cancelable by default.
4142
- * To make an event cancelable,
4143
- * you must first pass an `externalEntityId`
4144
- * and the applicable `triggerKey` to [reportEvent()](#report-event).
4145
- * When you call cancelEvent() with the same `externalEntityId` and `triggerKey`,
4146
- * the event is canceled,
4147
- * as are all other events that share the `externalEntityId` and `triggerKey`.
4148
- * @param - Trigger key whose event you want to cancel.
4149
- * For example, `form_submitted` or `invoice_due`.
4150
- * @param - ID of the related resource in GUID format.
4151
- * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
3560
+ * Key names can include only alphanumeric characters or underscores
3561
+ * (`A-Z`, `a-z`, `0-9`, `_`).
3562
+ * They cannot start with an underscore.
4152
3563
  *
4153
- * Typically, this ID is defined in your system,
4154
- * but you can also use any Wix resource GUID,
4155
- * such as contact ID, member ID, or invoice ID.
4156
- * See
4157
- * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
4158
- * for more information.
3564
+ * Values can be strings, numbers, integers, booleans, or arrays.
3565
+ * If a value is an array, the array items must be objects,
3566
+ * and nested object properties must be
3567
+ * strings, numbers, integers, or booleans only.
4159
3568
  */
4160
- (triggerKey: string, externalEntityId: string): Promise<void>;
4161
- }
4162
- declare const onActivationStatusChanged$1: EventDefinition$3<ActivationStatusChangedEnvelope, "wix.automations.v2.activation_activation_status_changed">;
4163
-
4164
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
4165
- __type: 'event-definition';
4166
- type: Type;
4167
- isDomainEvent?: boolean;
4168
- transformations?: (envelope: unknown) => Payload;
4169
- __payload: Payload;
4170
- };
4171
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
4172
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
4173
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
4174
-
4175
- declare global {
4176
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
4177
- interface SymbolConstructor {
4178
- readonly observable: symbol;
4179
- }
3569
+ payload?: Record<string, any> | null;
4180
3570
  }
4181
-
4182
- declare function createEventModule$1<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
4183
-
4184
- declare const reportEvent: MaybeContext$1<BuildRESTFunction$1<typeof reportEvent$1> & typeof reportEvent$1>;
4185
- declare const bulkReportEvent: MaybeContext$1<BuildRESTFunction$1<typeof bulkReportEvent$1> & typeof bulkReportEvent$1>;
4186
- declare const bulkCancelEvent: MaybeContext$1<BuildRESTFunction$1<typeof bulkCancelEvent$1> & typeof bulkCancelEvent$1>;
4187
- declare const cancelEvent: MaybeContext$1<BuildRESTFunction$1<typeof cancelEvent$1> & typeof cancelEvent$1>;
4188
-
4189
- type _publicOnActivationStatusChangedType = typeof onActivationStatusChanged$1;
4190
- /**
4191
- * activation status changed message
4192
- */
4193
- declare const onActivationStatusChanged: ReturnType<typeof createEventModule$1<_publicOnActivationStatusChangedType>>;
4194
-
4195
- type context$1_ActionActionOneOf = ActionActionOneOf;
4196
- type context$1_ActionCompletedRequest = ActionCompletedRequest;
4197
- type context$1_ActionData = ActionData;
4198
- type context$1_ActionStatus = ActionStatus;
4199
- type context$1_ActionsData = ActionsData;
4200
- type context$1_Activation = Activation;
4201
- type context$1_ActivationActionStatusChanged = ActivationActionStatusChanged;
4202
- type context$1_ActivationActionStatusChangedStatus = ActivationActionStatusChangedStatus;
4203
- declare const context$1_ActivationActionStatusChangedStatus: typeof ActivationActionStatusChangedStatus;
4204
- type context$1_ActivationActionStatusChangedStatusInfoOneOf = ActivationActionStatusChangedStatusInfoOneOf;
4205
- type context$1_ActivationContinuedAfterSchedule = ActivationContinuedAfterSchedule;
4206
- type context$1_ActivationRequest = ActivationRequest;
4207
- type context$1_ActivationResumeAfterDelay = ActivationResumeAfterDelay;
4208
- type context$1_ActivationScheduleCompleted = ActivationScheduleCompleted;
4209
- type context$1_ActivationScheduleRequested = ActivationScheduleRequested;
4210
- type context$1_ActivationSource = ActivationSource;
4211
- type context$1_ActivationSourceOfOneOf = ActivationSourceOfOneOf;
4212
- type context$1_ActivationStatus = ActivationStatus;
4213
- type context$1_ActivationStatusChanged = ActivationStatusChanged;
4214
- type context$1_ActivationStatusChangedEnvelope = ActivationStatusChangedEnvelope;
4215
- type context$1_ActivationStatusChangedFailedStatusInfo = ActivationStatusChangedFailedStatusInfo;
4216
- type context$1_ActivationStatusChangedStatus = ActivationStatusChangedStatus;
4217
- declare const context$1_ActivationStatusChangedStatus: typeof ActivationStatusChangedStatus;
4218
- type context$1_ActivationStatusChangedStatusInfoOneOf = ActivationStatusChangedStatusInfoOneOf;
4219
- type context$1_AppDefinedActionInfo = AppDefinedActionInfo;
4220
- type context$1_AsyncAction = AsyncAction;
4221
- type context$1_AutomationConfigurationAction = AutomationConfigurationAction;
4222
- type context$1_AutomationConfigurationActionInfoOneOf = AutomationConfigurationActionInfoOneOf;
4223
- type context$1_AutomationConfigurationStatus = AutomationConfigurationStatus;
4224
- declare const context$1_AutomationConfigurationStatus: typeof AutomationConfigurationStatus;
4225
- type context$1_AutomationIdentifier = AutomationIdentifier;
4226
- type context$1_AutomationInfo = AutomationInfo;
4227
- type context$1_AutomationInfoOriginInfoOneOf = AutomationInfoOriginInfoOneOf;
4228
- type context$1_BatchActivationRequest = BatchActivationRequest;
4229
- type context$1_BlockType = BlockType;
4230
- declare const context$1_BlockType: typeof BlockType;
4231
- type context$1_BulkCancelEventRequest = BulkCancelEventRequest;
4232
- type context$1_BulkCancelEventResponse = BulkCancelEventResponse;
4233
- type context$1_BulkCancelEventResponseNonNullableFields = BulkCancelEventResponseNonNullableFields;
4234
- type context$1_BulkCancelEventResult = BulkCancelEventResult;
4235
- type context$1_BulkReportEventRequest = BulkReportEventRequest;
4236
- type context$1_BulkReportEventResponse = BulkReportEventResponse;
4237
- type context$1_BulkReportEventResponseNonNullableFields = BulkReportEventResponseNonNullableFields;
4238
- type context$1_BulkReportEventResult = BulkReportEventResult;
4239
- type context$1_CancelEventRequest = CancelEventRequest;
4240
- type context$1_CancelEventResponse = CancelEventResponse;
4241
- type context$1_CancelPendingScheduleRequest = CancelPendingScheduleRequest;
4242
- type context$1_CancelPendingScheduleRequestByOneOf = CancelPendingScheduleRequestByOneOf;
4243
- type context$1_CancelPendingScheduleResponse = CancelPendingScheduleResponse;
4244
- type context$1_CancellationReason = CancellationReason;
4245
- declare const context$1_CancellationReason: typeof CancellationReason;
4246
- type context$1_CancelledStatusInfo = CancelledStatusInfo;
4247
- type context$1_Case = Case;
4248
- type context$1_ConditionActionInfo = ConditionActionInfo;
4249
- type context$1_ConditionBlock = ConditionBlock;
4250
- type context$1_ConditionFilter = ConditionFilter;
4251
- type context$1_Delay = Delay;
4252
- type context$1_DelayActionInfo = DelayActionInfo;
4253
- type context$1_DelayHelper = DelayHelper;
4254
- type context$1_DelayOfOneOf = DelayOfOneOf;
4255
- type context$1_EndedStatusInfo = EndedStatusInfo;
4256
- type context$1_EndedStatusInfoTypeInfoOneOf = EndedStatusInfoTypeInfoOneOf;
4257
- type context$1_EventInfo = EventInfo;
4258
- type context$1_ExecuteFromActionRequest = ExecuteFromActionRequest;
4259
- type context$1_ExecuteFromActionResponse = ExecuteFromActionResponse;
4260
- type context$1_ExpressionEvaluationResult = ExpressionEvaluationResult;
4261
- type context$1_FailedStatusInfo = FailedStatusInfo;
4262
- type context$1_Idempotency = Idempotency;
4263
- type context$1_IdentifierType = IdentifierType;
4264
- declare const context$1_IdentifierType: typeof IdentifierType;
4265
- type context$1_Identity = Identity;
4266
- type context$1_IfFilter = IfFilter;
4267
- type context$1_InitiatedStatusInfo = InitiatedStatusInfo;
4268
- type context$1_Output = Output;
4269
- type context$1_PreinstalledIdentifier = PreinstalledIdentifier;
4270
- type context$1_RateLimitActionInfo = RateLimitActionInfo;
4271
- type context$1_RateLimiting = RateLimiting;
4272
- type context$1_RefreshPayloadRequest = RefreshPayloadRequest;
4273
- type context$1_RefreshPayloadResponse = RefreshPayloadResponse;
4274
- type context$1_ReportDomainEventRequest = ReportDomainEventRequest;
4275
- type context$1_ReportDomainEventResponse = ReportDomainEventResponse;
4276
- type context$1_ReportEventOptions = ReportEventOptions;
4277
- type context$1_ReportEventRequest = ReportEventRequest;
4278
- type context$1_ReportEventResponse = ReportEventResponse;
4279
- type context$1_ReportEventResponseNonNullableFields = ReportEventResponseNonNullableFields;
4280
- type context$1_RunAutomationRequest = RunAutomationRequest;
4281
- type context$1_RunAutomationResponse = RunAutomationResponse;
4282
- type context$1_Runtime = Runtime;
4283
- type context$1_Schedule = Schedule;
4284
- type context$1_ScheduleRequest = ScheduleRequest;
4285
- type context$1_ScheduleResponse = ScheduleResponse;
4286
- type context$1_ScheduleStatus = ScheduleStatus;
4287
- declare const context$1_ScheduleStatus: typeof ScheduleStatus;
4288
- type context$1_ScheduledAction = ScheduledAction;
4289
- type context$1_ScheduledStatusInfo = ScheduledStatusInfo;
4290
- type context$1_Scheduler = Scheduler;
4291
- type context$1_Service = Service;
4292
- type context$1_ServiceMapping = ServiceMapping;
4293
- type context$1_SimpleDelay = SimpleDelay;
4294
- type context$1_SpiAction = SpiAction;
4295
- type context$1_StartedStatusInfo = StartedStatusInfo;
4296
- type context$1_StartedStatusInfoAppDefinedActionInfo = StartedStatusInfoAppDefinedActionInfo;
4297
- type context$1_StartedStatusInfoTypeInfoOneOf = StartedStatusInfoTypeInfoOneOf;
4298
- type context$1_SwitchFilter = SwitchFilter;
4299
- type context$1_SystemHelper = SystemHelper;
4300
- type context$1_SystemHelperHelperOneOf = SystemHelperHelperOneOf;
4301
- type context$1_Target = Target;
4302
- declare const context$1_Target: typeof Target;
4303
- type context$1_TriggerInfo = TriggerInfo;
4304
- type context$1_Units = Units;
4305
- declare const context$1_Units: typeof Units;
4306
- type context$1_UpdatePendingSchedulesPayloadRequest = UpdatePendingSchedulesPayloadRequest;
4307
- type context$1_UpdatePendingSchedulesPayloadResponse = UpdatePendingSchedulesPayloadResponse;
4308
- type context$1_V1RunAutomationRequest = V1RunAutomationRequest;
4309
- type context$1_V1RunAutomationRequestIdentifierOneOf = V1RunAutomationRequestIdentifierOneOf;
4310
- type context$1_V1RunAutomationResponse = V1RunAutomationResponse;
4311
- type context$1__publicOnActivationStatusChangedType = _publicOnActivationStatusChangedType;
4312
- declare const context$1_bulkCancelEvent: typeof bulkCancelEvent;
4313
- declare const context$1_bulkReportEvent: typeof bulkReportEvent;
4314
- declare const context$1_cancelEvent: typeof cancelEvent;
4315
- declare const context$1_onActivationStatusChanged: typeof onActivationStatusChanged;
4316
- declare const context$1_reportEvent: typeof reportEvent;
4317
- declare namespace context$1 {
4318
- export { type Action$1 as Action, type context$1_ActionActionOneOf as ActionActionOneOf, type context$1_ActionCompletedRequest as ActionCompletedRequest, type context$1_ActionData as ActionData, type ActionEvent$1 as ActionEvent, type ActionSettings$1 as ActionSettings, type context$1_ActionStatus as ActionStatus, type context$1_ActionsData as ActionsData, type context$1_Activation as Activation, type context$1_ActivationActionStatusChanged as ActivationActionStatusChanged, context$1_ActivationActionStatusChangedStatus as ActivationActionStatusChangedStatus, type context$1_ActivationActionStatusChangedStatusInfoOneOf as ActivationActionStatusChangedStatusInfoOneOf, type context$1_ActivationContinuedAfterSchedule as ActivationContinuedAfterSchedule, type context$1_ActivationRequest as ActivationRequest, type context$1_ActivationResumeAfterDelay as ActivationResumeAfterDelay, type context$1_ActivationScheduleCompleted as ActivationScheduleCompleted, type context$1_ActivationScheduleRequested as ActivationScheduleRequested, type context$1_ActivationSource as ActivationSource, type context$1_ActivationSourceOfOneOf as ActivationSourceOfOneOf, type context$1_ActivationStatus as ActivationStatus, type context$1_ActivationStatusChanged as ActivationStatusChanged, type context$1_ActivationStatusChangedEnvelope as ActivationStatusChangedEnvelope, type context$1_ActivationStatusChangedFailedStatusInfo as ActivationStatusChangedFailedStatusInfo, context$1_ActivationStatusChangedStatus as ActivationStatusChangedStatus, type context$1_ActivationStatusChangedStatusInfoOneOf as ActivationStatusChangedStatusInfoOneOf, type AppDefinedAction$1 as AppDefinedAction, type context$1_AppDefinedActionInfo as AppDefinedActionInfo, type ApplicationError$1 as ApplicationError, type ApplicationOrigin$1 as ApplicationOrigin, type context$1_AsyncAction as AsyncAction, type AuditInfo$1 as AuditInfo, type AuditInfoIdOneOf$1 as AuditInfoIdOneOf, type Automation$1 as Automation, type AutomationConfiguration$1 as AutomationConfiguration, type context$1_AutomationConfigurationAction as AutomationConfigurationAction, type context$1_AutomationConfigurationActionInfoOneOf as AutomationConfigurationActionInfoOneOf, context$1_AutomationConfigurationStatus as AutomationConfigurationStatus, type context$1_AutomationIdentifier as AutomationIdentifier, type context$1_AutomationInfo as AutomationInfo, type context$1_AutomationInfoOriginInfoOneOf as AutomationInfoOriginInfoOneOf, type AutomationOriginInfoOneOf$1 as AutomationOriginInfoOneOf, type AutomationSettings$1 as AutomationSettings, type BaseEventMetadata$1 as BaseEventMetadata, type context$1_BatchActivationRequest as BatchActivationRequest, context$1_BlockType as BlockType, type BulkActionMetadata$1 as BulkActionMetadata, type context$1_BulkCancelEventRequest as BulkCancelEventRequest, type context$1_BulkCancelEventResponse as BulkCancelEventResponse, type context$1_BulkCancelEventResponseNonNullableFields as BulkCancelEventResponseNonNullableFields, type context$1_BulkCancelEventResult as BulkCancelEventResult, type context$1_BulkReportEventRequest as BulkReportEventRequest, type context$1_BulkReportEventResponse as BulkReportEventResponse, type context$1_BulkReportEventResponseNonNullableFields as BulkReportEventResponseNonNullableFields, type context$1_BulkReportEventResult as BulkReportEventResult, type context$1_CancelEventRequest as CancelEventRequest, type context$1_CancelEventResponse as CancelEventResponse, type context$1_CancelPendingScheduleRequest as CancelPendingScheduleRequest, type context$1_CancelPendingScheduleRequestByOneOf as CancelPendingScheduleRequestByOneOf, type context$1_CancelPendingScheduleResponse as CancelPendingScheduleResponse, context$1_CancellationReason as CancellationReason, type context$1_CancelledStatusInfo as CancelledStatusInfo, type context$1_Case as Case, type ConditionAction$1 as ConditionAction, type context$1_ConditionActionInfo as ConditionActionInfo, type context$1_ConditionBlock as ConditionBlock, type ConditionExpressionGroup$1 as ConditionExpressionGroup, type context$1_ConditionFilter as ConditionFilter, type context$1_Delay as Delay, type DelayAction$1 as DelayAction, type context$1_DelayActionInfo as DelayActionInfo, type context$1_DelayHelper as DelayHelper, type context$1_DelayOfOneOf as DelayOfOneOf, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type DraftInfo$1 as DraftInfo, type Empty$1 as Empty, type context$1_EndedStatusInfo as EndedStatusInfo, type context$1_EndedStatusInfoTypeInfoOneOf as EndedStatusInfoTypeInfoOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type context$1_EventInfo as EventInfo, type EventMetadata$1 as EventMetadata, type context$1_ExecuteFromActionRequest as ExecuteFromActionRequest, type context$1_ExecuteFromActionResponse as ExecuteFromActionResponse, type context$1_ExpressionEvaluationResult as ExpressionEvaluationResult, type context$1_FailedStatusInfo as FailedStatusInfo, type Filter$2 as Filter, type FutureDateActivationOffset$1 as FutureDateActivationOffset, type context$1_Idempotency as Idempotency, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, context$1_IdentifierType as IdentifierType, type context$1_Identity as Identity, type context$1_IfFilter as IfFilter, type context$1_InitiatedStatusInfo as InitiatedStatusInfo, type ItemMetadata$1 as ItemMetadata, type MessageEnvelope$1 as MessageEnvelope, Operator$1 as Operator, Origin$1 as Origin, type context$1_Output as Output, type OutputAction$1 as OutputAction, type context$1_PreinstalledIdentifier as PreinstalledIdentifier, type PreinstalledOrigin$1 as PreinstalledOrigin, type RateLimit$1 as RateLimit, type RateLimitAction$1 as RateLimitAction, type context$1_RateLimitActionInfo as RateLimitActionInfo, type context$1_RateLimiting as RateLimiting, type context$1_RefreshPayloadRequest as RefreshPayloadRequest, type context$1_RefreshPayloadResponse as RefreshPayloadResponse, type context$1_ReportDomainEventRequest as ReportDomainEventRequest, type context$1_ReportDomainEventResponse as ReportDomainEventResponse, type context$1_ReportEventOptions as ReportEventOptions, type context$1_ReportEventRequest as ReportEventRequest, type context$1_ReportEventResponse as ReportEventResponse, type context$1_ReportEventResponseNonNullableFields as ReportEventResponseNonNullableFields, type RestoreInfo$1 as RestoreInfo, type context$1_RunAutomationRequest as RunAutomationRequest, type context$1_RunAutomationResponse as RunAutomationResponse, type context$1_Runtime as Runtime, type context$1_Schedule as Schedule, type context$1_ScheduleRequest as ScheduleRequest, type context$1_ScheduleResponse as ScheduleResponse, context$1_ScheduleStatus as ScheduleStatus, type context$1_ScheduledAction as ScheduledAction, type context$1_ScheduledStatusInfo as ScheduledStatusInfo, type context$1_Scheduler as Scheduler, type context$1_Service as Service, type context$1_ServiceMapping as ServiceMapping, type context$1_SimpleDelay as SimpleDelay, type context$1_SpiAction as SpiAction, type context$1_StartedStatusInfo as StartedStatusInfo, type context$1_StartedStatusInfoAppDefinedActionInfo as StartedStatusInfoAppDefinedActionInfo, type context$1_StartedStatusInfoTypeInfoOneOf as StartedStatusInfoTypeInfoOneOf, Status$1 as Status, type context$1_SwitchFilter as SwitchFilter, type context$1_SystemHelper as SystemHelper, type context$1_SystemHelperHelperOneOf as SystemHelperHelperOneOf, context$1_Target as Target, TimeUnit$1 as TimeUnit, type Trigger$1 as Trigger, type context$1_TriggerInfo as TriggerInfo, Type$1 as Type, context$1_Units as Units, type context$1_UpdatePendingSchedulesPayloadRequest as UpdatePendingSchedulesPayloadRequest, type context$1_UpdatePendingSchedulesPayloadResponse as UpdatePendingSchedulesPayloadResponse, type context$1_V1RunAutomationRequest as V1RunAutomationRequest, type context$1_V1RunAutomationRequestIdentifierOneOf as V1RunAutomationRequestIdentifierOneOf, type context$1_V1RunAutomationResponse as V1RunAutomationResponse, WebhookIdentityType$1 as WebhookIdentityType, type context$1__publicOnActivationStatusChangedType as _publicOnActivationStatusChangedType, context$1_bulkCancelEvent as bulkCancelEvent, context$1_bulkReportEvent as bulkReportEvent, context$1_cancelEvent as cancelEvent, context$1_onActivationStatusChanged as onActivationStatusChanged, onActivationStatusChanged$1 as publicOnActivationStatusChanged, context$1_reportEvent as reportEvent };
3571
+ /** @oneof */
3572
+ interface V1RunAutomationRequestIdentifierOneOf {
3573
+ /** a preinstalled automation identifier */
3574
+ preinstalledIdentifier?: PreinstalledIdentifier;
3575
+ /** a automation of any type identifier that will be available in future */
3576
+ automationIdentifier?: AutomationIdentifier;
4319
3577
  }
4320
-
4321
- type HostModule<T, H extends Host> = {
4322
- __type: 'host';
4323
- create(host: H): T;
4324
- };
4325
- type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
4326
- type Host<Environment = unknown> = {
4327
- channel: {
4328
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
4329
- disconnect: () => void;
4330
- } | Promise<{
4331
- disconnect: () => void;
4332
- }>;
4333
- };
4334
- environment?: Environment;
3578
+ declare enum IdentifierType {
3579
+ UNKNOWN_IDENTIFIER = "UNKNOWN_IDENTIFIER",
3580
+ PREINSTALLED = "PREINSTALLED",
3581
+ AUTOMATION = "AUTOMATION"
3582
+ }
3583
+ interface PreinstalledIdentifier {
3584
+ /** identifier for the application of the preinstalled */
3585
+ appId?: string;
3586
+ /** application component id */
3587
+ componentId?: string;
3588
+ }
3589
+ interface AutomationIdentifier {
3590
+ /** automation id */
3591
+ automationId?: string;
3592
+ }
3593
+ interface V1RunAutomationResponse {
3594
+ }
3595
+ interface ReportDomainEventRequest {
3596
+ /** trigger app id */
3597
+ triggerAppId?: string;
3598
+ /** report event request */
3599
+ reportEventRequest?: ReportEventRequest;
3600
+ }
3601
+ interface ReportDomainEventResponse {
3602
+ }
3603
+ interface ExecuteFromActionRequest {
3604
+ /** Requested action id */
3605
+ actionId?: string;
3606
+ /** Optional: an activation id to link this action to */
3607
+ activationId?: string | null;
3608
+ /** Activation payload */
3609
+ payload?: Record<string, any> | null;
3610
+ /** Configuration correlation id to run this action from */
3611
+ configurationCorrelationId?: string;
3612
+ /** Optional - schedule id that this action was scheduled from */
3613
+ scheduleId?: string | null;
3614
+ /** Optional - an external entity id that this execution is related to */
3615
+ externalEntityId?: string | null;
3616
+ /** Optional - Activation automation */
3617
+ automation?: Automation$1;
3618
+ }
3619
+ interface ExecuteFromActionResponse {
3620
+ }
3621
+ interface ActivationScheduleCompleted {
3622
+ /** Activation identifier */
3623
+ _id?: string;
3624
+ /** Activation schedule identifier */
3625
+ scheduleId?: string;
3626
+ /** Activation schedule due date */
3627
+ scheduleDate?: Date;
3628
+ /** Activation payload */
3629
+ payload?: Record<string, any> | null;
3630
+ /** Activation Automation */
3631
+ automation?: Automation$1;
3632
+ /** Optional - external entity id that this activation is related to */
3633
+ externalEntityId?: string | null;
3634
+ }
3635
+ interface ReportEventResponseNonNullableFields {
3636
+ activationIds: string[];
3637
+ }
3638
+ interface ApplicationErrorNonNullableFields$1 {
3639
+ code: string;
3640
+ description: string;
3641
+ }
3642
+ interface ItemMetadataNonNullableFields$1 {
3643
+ originalIndex: number;
3644
+ success: boolean;
3645
+ error?: ApplicationErrorNonNullableFields$1;
3646
+ }
3647
+ interface IdempotencyNonNullableFields {
3648
+ key: string;
3649
+ }
3650
+ interface EventInfoNonNullableFields {
3651
+ idempotency?: IdempotencyNonNullableFields;
3652
+ }
3653
+ interface BulkReportEventResultNonNullableFields {
3654
+ itemMetadata?: ItemMetadataNonNullableFields$1;
3655
+ eventInfo?: EventInfoNonNullableFields;
3656
+ activationIds: string[];
3657
+ }
3658
+ interface BulkActionMetadataNonNullableFields$1 {
3659
+ totalSuccesses: number;
3660
+ totalFailures: number;
3661
+ undetailedFailures: number;
3662
+ }
3663
+ interface BulkReportEventResponseNonNullableFields {
3664
+ triggerKey: string;
3665
+ results: BulkReportEventResultNonNullableFields[];
3666
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3667
+ }
3668
+ interface BulkCancelEventResultNonNullableFields {
3669
+ itemMetadata?: ItemMetadataNonNullableFields$1;
3670
+ externalEntityId: string;
3671
+ }
3672
+ interface BulkCancelEventResponseNonNullableFields {
3673
+ triggerKey: string;
3674
+ results: BulkCancelEventResultNonNullableFields[];
3675
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields$1;
3676
+ }
3677
+ interface BaseEventMetadata$1 {
3678
+ /** App instance ID. */
3679
+ instanceId?: string | null;
3680
+ /** Event type. */
3681
+ eventType?: string;
3682
+ /** The identification type and identity data. */
3683
+ identity?: IdentificationData$1;
3684
+ }
3685
+ interface EventMetadata$1 extends BaseEventMetadata$1 {
4335
3686
  /**
4336
- * Optional bast url to use for API requests, for example `www.wixapis.com`
3687
+ * Unique event ID.
3688
+ * Allows clients to ignore duplicate webhooks.
4337
3689
  */
4338
- apiBaseUrl?: string;
3690
+ _id?: string;
4339
3691
  /**
4340
- * Possible data to be provided by every host, for cross cutting concerns
4341
- * like internationalization, billing, etc.
3692
+ * Assumes actions are also always typed to an entity_type
3693
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
4342
3694
  */
4343
- essentials?: {
4344
- /**
4345
- * The language of the currently viewed session
4346
- */
4347
- language?: string;
4348
- /**
4349
- * The locale of the currently viewed session
4350
- */
4351
- locale?: string;
4352
- /**
4353
- * Any headers that should be passed through to the API requests
4354
- */
4355
- passThroughHeaders?: Record<string, string>;
4356
- };
4357
- };
4358
-
4359
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
4360
- interface HttpClient {
4361
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4362
- fetchWithAuth: typeof fetch;
4363
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
4364
- getActiveToken?: () => string | undefined;
4365
- }
4366
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
4367
- type HttpResponse<T = any> = {
4368
- data: T;
4369
- status: number;
4370
- statusText: string;
4371
- headers: any;
4372
- request?: any;
4373
- };
4374
- type RequestOptions<_TResponse = any, Data = any> = {
4375
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
4376
- url: string;
4377
- data?: Data;
4378
- params?: URLSearchParams;
4379
- } & APIMetadata;
4380
- type APIMetadata = {
4381
- methodFqn?: string;
4382
3695
  entityFqdn?: string;
4383
- packageName?: string;
4384
- };
4385
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
4386
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
4387
- __type: 'event-definition';
4388
- type: Type;
4389
- isDomainEvent?: boolean;
4390
- transformations?: (envelope: unknown) => Payload;
4391
- __payload: Payload;
4392
- };
4393
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
4394
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
4395
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
4396
-
4397
- type ServicePluginMethodInput = {
4398
- request: any;
4399
- metadata: any;
4400
- };
4401
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
4402
- type ServicePluginMethodMetadata = {
4403
- name: string;
4404
- primaryHttpMappingPath: string;
4405
- transformations: {
4406
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
4407
- toREST: (...args: unknown[]) => unknown;
4408
- };
4409
- };
4410
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
4411
- __type: 'service-plugin-definition';
4412
- componentType: string;
4413
- methods: ServicePluginMethodMetadata[];
4414
- __contract: Contract;
4415
- };
4416
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
4417
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
4418
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
4419
-
4420
- type RequestContext = {
4421
- isSSR: boolean;
4422
- host: string;
4423
- protocol?: string;
4424
- };
4425
- type ResponseTransformer = (data: any, headers?: any) => any;
4426
- /**
4427
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
4428
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
4429
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
4430
- */
4431
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
4432
- type AmbassadorRequestOptions<T = any> = {
4433
- _?: T;
4434
- url?: string;
4435
- method?: Method;
4436
- params?: any;
4437
- data?: any;
4438
- transformResponse?: ResponseTransformer | ResponseTransformer[];
4439
- };
4440
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
4441
- __isAmbassador: boolean;
4442
- };
4443
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
4444
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
4445
-
4446
- declare global {
4447
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
4448
- interface SymbolConstructor {
4449
- readonly observable: symbol;
4450
- }
3696
+ /**
3697
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3698
+ * This is although the created/updated/deleted notion is duplication of the oneof types
3699
+ * Example: created/updated/deleted/started/completed/email_opened
3700
+ */
3701
+ slug?: string;
3702
+ /** ID of the entity associated with the event. */
3703
+ entityId?: string;
3704
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3705
+ eventTime?: Date;
3706
+ /**
3707
+ * Whether the event was triggered as a result of a privacy regulation application
3708
+ * (for example, GDPR).
3709
+ */
3710
+ triggeredByAnonymizeRequest?: boolean | null;
3711
+ /** If present, indicates the action that triggered the event. */
3712
+ originatedFrom?: string | null;
3713
+ /**
3714
+ * A sequence number defining the order of updates to the underlying entity.
3715
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
3716
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
3717
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
3718
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
3719
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3720
+ */
3721
+ entityEventSequence?: string | null;
4451
3722
  }
4452
-
4453
- declare const emptyObjectSymbol: unique symbol;
4454
-
4455
- /**
4456
- Represents a strictly empty plain object, the `{}` value.
4457
-
4458
- 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)).
4459
-
4460
- @example
4461
- ```
4462
- import type {EmptyObject} from 'type-fest';
4463
-
4464
- // The following illustrates the problem with `{}`.
4465
- const foo1: {} = {}; // Pass
4466
- const foo2: {} = []; // Pass
4467
- const foo3: {} = 42; // Pass
4468
- const foo4: {} = {a: 1}; // Pass
4469
-
4470
- // With `EmptyObject` only the first case is valid.
4471
- const bar1: EmptyObject = {}; // Pass
4472
- const bar2: EmptyObject = 42; // Fail
4473
- const bar3: EmptyObject = []; // Fail
4474
- const bar4: EmptyObject = {a: 1}; // Fail
4475
- ```
4476
-
4477
- 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}.
4478
-
4479
- @category Object
4480
- */
4481
- type EmptyObject = {[emptyObjectSymbol]?: never};
4482
-
4483
- /**
4484
- Returns a boolean for whether the two given types are equal.
4485
-
4486
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
4487
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
4488
-
4489
- Use-cases:
4490
- - If you want to make a conditional branch based on the result of a comparison of two types.
4491
-
4492
- @example
4493
- ```
4494
- import type {IsEqual} from 'type-fest';
4495
-
4496
- // This type returns a boolean for whether the given array includes the given item.
4497
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
4498
- type Includes<Value extends readonly any[], Item> =
4499
- Value extends readonly [Value[0], ...infer rest]
4500
- ? IsEqual<Value[0], Item> extends true
4501
- ? true
4502
- : Includes<rest, Item>
4503
- : false;
4504
- ```
4505
-
4506
- @category Type Guard
4507
- @category Utilities
4508
- */
4509
- type IsEqual<A, B> =
4510
- (<G>() => G extends A ? 1 : 2) extends
4511
- (<G>() => G extends B ? 1 : 2)
4512
- ? true
4513
- : false;
4514
-
4515
- /**
4516
- Filter out keys from an object.
4517
-
4518
- Returns `never` if `Exclude` is strictly equal to `Key`.
4519
- Returns `never` if `Key` extends `Exclude`.
4520
- Returns `Key` otherwise.
4521
-
4522
- @example
4523
- ```
4524
- type Filtered = Filter<'foo', 'foo'>;
4525
- //=> never
4526
- ```
4527
-
4528
- @example
4529
- ```
4530
- type Filtered = Filter<'bar', string>;
4531
- //=> never
4532
- ```
4533
-
4534
- @example
4535
- ```
4536
- type Filtered = Filter<'bar', 'foo'>;
4537
- //=> 'bar'
4538
- ```
4539
-
4540
- @see {Except}
4541
- */
4542
- type Filter$1<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
4543
-
4544
- type ExceptOptions = {
4545
- /**
4546
- Disallow assigning non-specified properties.
4547
-
4548
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
4549
-
4550
- @default false
4551
- */
4552
- requireExactProps?: boolean;
4553
- };
4554
-
4555
- /**
4556
- Create a type from an object type without certain keys.
4557
-
4558
- We recommend setting the `requireExactProps` option to `true`.
4559
-
4560
- 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.
4561
-
4562
- 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)).
4563
-
4564
- @example
4565
- ```
4566
- import type {Except} from 'type-fest';
4567
-
4568
- type Foo = {
4569
- a: number;
4570
- b: string;
4571
- };
4572
-
4573
- type FooWithoutA = Except<Foo, 'a'>;
4574
- //=> {b: string}
4575
-
4576
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
4577
- //=> errors: 'a' does not exist in type '{ b: string; }'
4578
-
4579
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
4580
- //=> {a: number} & Partial<Record<"b", never>>
4581
-
4582
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
4583
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
4584
- ```
4585
-
4586
- @category Object
4587
- */
4588
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
4589
- [KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
4590
- } & (Options['requireExactProps'] extends true
4591
- ? Partial<Record<KeysType, never>>
4592
- : {});
4593
-
4594
- /**
4595
- Extract the keys from a type where the value type of the key extends the given `Condition`.
4596
-
4597
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
4598
-
4599
- @example
4600
- ```
4601
- import type {ConditionalKeys} from 'type-fest';
4602
-
4603
- interface Example {
4604
- a: string;
4605
- b: string | number;
4606
- c?: string;
4607
- d: {};
3723
+ interface ActivationStatusChangedEnvelope {
3724
+ data: ActivationStatusChanged;
3725
+ metadata: EventMetadata$1;
3726
+ }
3727
+ interface ReportEventOptions {
3728
+ /**
3729
+ * Event payload, formatted as key:value pairs.
3730
+ * Must comply with the payload schema
3731
+ * if you provided one when configuring your trigger.
3732
+ *
3733
+ * Key names can include only alphanumeric characters or underscores
3734
+ * (`A-Z`, `a-z`, `0-9`, `_`).
3735
+ * They cannot start with an underscore.
3736
+ *
3737
+ * Values can be strings, numbers, integers, booleans, or arrays.
3738
+ * If a value is an array, the array items must be objects,
3739
+ * and nested object properties must be
3740
+ * strings, numbers, integers, or booleans only.
3741
+ */
3742
+ payload?: Record<string, any> | null;
3743
+ /**
3744
+ * ID of the related resource in GUID format.
3745
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
3746
+ *
3747
+ * Required if your app needs to
3748
+ * [cancel the event](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/cancel-event)
3749
+ * if the automation becomes no longer relevant.
3750
+ *
3751
+ * Typically, this ID is defined in your system,
3752
+ * but you can also use any Wix resource GUID,
3753
+ * such as contact ID, member ID, or invoice ID.
3754
+ * See
3755
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#about-canceling-events)
3756
+ * for more information.
3757
+ */
3758
+ externalEntityId?: string | null;
3759
+ /** Idempotency information for the event */
3760
+ idempotency?: Idempotency;
4608
3761
  }
4609
3762
 
4610
- type StringKeysOnly = ConditionalKeys<Example, string>;
4611
- //=> 'a'
4612
- ```
4613
-
4614
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
4615
-
4616
- @example
4617
- ```
4618
- import type {ConditionalKeys} from 'type-fest';
4619
-
4620
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
4621
- //=> 'a' | 'c'
4622
- ```
4623
-
4624
- @category Object
4625
- */
4626
- type ConditionalKeys<Base, Condition> = NonNullable<
4627
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
4628
- {
4629
- // Map through all the keys of the given base type.
4630
- [Key in keyof Base]:
4631
- // Pick only keys with types extending the given `Condition` type.
4632
- Base[Key] extends Condition
4633
- // Retain this key since the condition passes.
4634
- ? Key
4635
- // Discard this key since the condition fails.
4636
- : never;
4637
-
4638
- // Convert the produced object into a union type of the keys which passed the conditional test.
4639
- }[keyof Base]
4640
- >;
4641
-
4642
- /**
4643
- Exclude keys from a shape that matches the given `Condition`.
4644
-
4645
- 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.
4646
-
4647
- @example
4648
- ```
4649
- import type {Primitive, ConditionalExcept} from 'type-fest';
4650
-
4651
- class Awesome {
4652
- name: string;
4653
- successes: number;
4654
- failures: bigint;
4655
-
4656
- run() {}
3763
+ declare function reportEvent$1(httpClient: HttpClient): ReportEventSignature;
3764
+ interface ReportEventSignature {
3765
+ /**
3766
+ * Reports an event and activates site automations with the specified trigger key.
3767
+ *
3768
+ *
3769
+ * Only the app that created a trigger can report events for it.
3770
+ * This means other apps can't report events for your triggers,
3771
+ * and you can't report events for another app's triggers.
3772
+ *
3773
+ * If your app supports canceling events,
3774
+ * `externalEntityId` must be provided.
3775
+ * `externalEntityId` is required when calling [cancelEvent()](#cancel-event).
3776
+ * @param - Trigger key as defined in your app's trigger configuration
3777
+ * in the app dashboard.
3778
+ * For example, `form_submitted` or `invoice_due`.
3779
+ */
3780
+ (triggerKey: string, options?: ReportEventOptions | undefined): Promise<ReportEventResponse & ReportEventResponseNonNullableFields>;
4657
3781
  }
3782
+ declare function bulkReportEvent$1(httpClient: HttpClient): BulkReportEventSignature;
3783
+ interface BulkReportEventSignature {
3784
+ /**
3785
+ * Bulk reports events and activates site automations with the specified trigger key.
3786
+ * @param - Trigger key as defined in your app's trigger configuration
3787
+ * in the app dashboard.
3788
+ * For example, `form_submitted` or `invoice_due`.
3789
+ * @param - Repeated list of event details for bulk reporting
3790
+ */
3791
+ (triggerKey: string, eventsInfo: EventInfo[]): Promise<BulkReportEventResponse & BulkReportEventResponseNonNullableFields>;
3792
+ }
3793
+ declare function bulkCancelEvent$1(httpClient: HttpClient): BulkCancelEventSignature;
3794
+ interface BulkCancelEventSignature {
3795
+ /**
3796
+ * Bulk cancels any remaining actions for a trigger and external entities.
3797
+ * @param - Trigger key whose events you want to cancel.
3798
+ * For example, `form_submitted` or `invoice_due`.
3799
+ * @param - Repeated list of external_entity_id, representing the related resources' IDs
3800
+ */
3801
+ (triggerKey: string, externalEntityIds: string[]): Promise<BulkCancelEventResponse & BulkCancelEventResponseNonNullableFields>;
3802
+ }
3803
+ declare function cancelEvent$1(httpClient: HttpClient): CancelEventSignature;
3804
+ interface CancelEventSignature {
3805
+ /**
3806
+ * Cancels any remaining actions for a trigger and external entity.
3807
+ *
3808
+ *
3809
+ * Events are not cancelable by default.
3810
+ * To make an event cancelable,
3811
+ * you must first pass an `externalEntityId`
3812
+ * and the applicable `triggerKey` to [reportEvent()](#report-event).
3813
+ * When you call cancelEvent() with the same `externalEntityId` and `triggerKey`,
3814
+ * the event is canceled,
3815
+ * as are all other events that share the `externalEntityId` and `triggerKey`.
3816
+ * @param - Trigger key whose event you want to cancel.
3817
+ * For example, `form_submitted` or `invoice_due`.
3818
+ * @param - ID of the related resource in GUID format.
3819
+ * For example, `fc81a355-3429-50fc-a4c7-def486e828f3`.
3820
+ *
3821
+ * Typically, this ID is defined in your system,
3822
+ * but you can also use any Wix resource GUID,
3823
+ * such as contact ID, member ID, or invoice ID.
3824
+ * See
3825
+ * [Choose the right `externalEntityId`](https://dev.wix.com/docs/rest/business-management/automations/triggered-events/reporting-and-canceling-events#choose-the-right-externalentityid)
3826
+ * for more information.
3827
+ */
3828
+ (triggerKey: string, externalEntityId: string): Promise<void>;
3829
+ }
3830
+ declare const onActivationStatusChanged$1: EventDefinition$3<ActivationStatusChangedEnvelope, "wix.automations.v2.activation_activation_status_changed">;
4658
3831
 
4659
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
4660
- //=> {run: () => void}
4661
- ```
4662
-
4663
- @example
4664
- ```
4665
- import type {ConditionalExcept} from 'type-fest';
3832
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
3833
+ __type: 'event-definition';
3834
+ type: Type;
3835
+ isDomainEvent?: boolean;
3836
+ transformations?: (envelope: unknown) => Payload;
3837
+ __payload: Payload;
3838
+ };
3839
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
3840
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
3841
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
4666
3842
 
4667
- interface Example {
4668
- a: string;
4669
- b: string | number;
4670
- c: () => void;
4671
- d: {};
3843
+ declare global {
3844
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3845
+ interface SymbolConstructor {
3846
+ readonly observable: symbol;
3847
+ }
4672
3848
  }
4673
3849
 
4674
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
4675
- //=> {b: string | number; c: () => void; d: {}}
4676
- ```
3850
+ declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
4677
3851
 
4678
- @category Object
4679
- */
4680
- type ConditionalExcept<Base, Condition> = Except<
4681
- Base,
4682
- ConditionalKeys<Base, Condition>
4683
- >;
3852
+ declare const reportEvent: MaybeContext<BuildRESTFunction<typeof reportEvent$1> & typeof reportEvent$1>;
3853
+ declare const bulkReportEvent: MaybeContext<BuildRESTFunction<typeof bulkReportEvent$1> & typeof bulkReportEvent$1>;
3854
+ declare const bulkCancelEvent: MaybeContext<BuildRESTFunction<typeof bulkCancelEvent$1> & typeof bulkCancelEvent$1>;
3855
+ declare const cancelEvent: MaybeContext<BuildRESTFunction<typeof cancelEvent$1> & typeof cancelEvent$1>;
4684
3856
 
3857
+ type _publicOnActivationStatusChangedType = typeof onActivationStatusChanged$1;
4685
3858
  /**
4686
- * Descriptors are objects that describe the API of a module, and the module
4687
- * can either be a REST module or a host module.
4688
- * This type is recursive, so it can describe nested modules.
4689
- */
4690
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
4691
- [key: string]: Descriptors | PublicMetadata | any;
4692
- };
4693
- /**
4694
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
4695
- * and returns an object with the same structure, but with all descriptors replaced with their API.
4696
- * Any non-descriptor properties are removed from the returned object, including descriptors that
4697
- * do not match the given host (as they will not work with the given host).
3859
+ * activation status changed message
4698
3860
  */
4699
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
4700
- done: T;
4701
- recurse: T extends {
4702
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
4703
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
4704
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
4705
- -1,
4706
- 0,
4707
- 1,
4708
- 2,
4709
- 3,
4710
- 4,
4711
- 5
4712
- ][Depth]> : never;
4713
- }, EmptyObject>;
4714
- }[Depth extends -1 ? 'done' : 'recurse'];
4715
- type PublicMetadata = {
4716
- PACKAGE_NAME?: string;
4717
- };
3861
+ declare const onActivationStatusChanged: ReturnType<typeof createEventModule$1<_publicOnActivationStatusChangedType>>;
4718
3862
 
4719
- declare global {
4720
- interface ContextualClient {
4721
- }
3863
+ type context$1_ActionActionOneOf = ActionActionOneOf;
3864
+ type context$1_ActionCompletedRequest = ActionCompletedRequest;
3865
+ type context$1_ActionData = ActionData;
3866
+ type context$1_ActionStatus = ActionStatus;
3867
+ type context$1_ActionsData = ActionsData;
3868
+ type context$1_Activation = Activation;
3869
+ type context$1_ActivationActionStatusChanged = ActivationActionStatusChanged;
3870
+ type context$1_ActivationActionStatusChangedStatus = ActivationActionStatusChangedStatus;
3871
+ declare const context$1_ActivationActionStatusChangedStatus: typeof ActivationActionStatusChangedStatus;
3872
+ type context$1_ActivationActionStatusChangedStatusInfoOneOf = ActivationActionStatusChangedStatusInfoOneOf;
3873
+ type context$1_ActivationContinuedAfterSchedule = ActivationContinuedAfterSchedule;
3874
+ type context$1_ActivationRequest = ActivationRequest;
3875
+ type context$1_ActivationResumeAfterDelay = ActivationResumeAfterDelay;
3876
+ type context$1_ActivationScheduleCompleted = ActivationScheduleCompleted;
3877
+ type context$1_ActivationScheduleRequested = ActivationScheduleRequested;
3878
+ type context$1_ActivationSource = ActivationSource;
3879
+ type context$1_ActivationSourceOfOneOf = ActivationSourceOfOneOf;
3880
+ type context$1_ActivationStatus = ActivationStatus;
3881
+ type context$1_ActivationStatusChanged = ActivationStatusChanged;
3882
+ type context$1_ActivationStatusChangedEnvelope = ActivationStatusChangedEnvelope;
3883
+ type context$1_ActivationStatusChangedFailedStatusInfo = ActivationStatusChangedFailedStatusInfo;
3884
+ type context$1_ActivationStatusChangedStatus = ActivationStatusChangedStatus;
3885
+ declare const context$1_ActivationStatusChangedStatus: typeof ActivationStatusChangedStatus;
3886
+ type context$1_ActivationStatusChangedStatusInfoOneOf = ActivationStatusChangedStatusInfoOneOf;
3887
+ type context$1_AppDefinedActionInfo = AppDefinedActionInfo;
3888
+ type context$1_AsyncAction = AsyncAction;
3889
+ type context$1_AutomationConfigurationAction = AutomationConfigurationAction;
3890
+ type context$1_AutomationConfigurationActionInfoOneOf = AutomationConfigurationActionInfoOneOf;
3891
+ type context$1_AutomationConfigurationStatus = AutomationConfigurationStatus;
3892
+ declare const context$1_AutomationConfigurationStatus: typeof AutomationConfigurationStatus;
3893
+ type context$1_AutomationIdentifier = AutomationIdentifier;
3894
+ type context$1_AutomationInfo = AutomationInfo;
3895
+ type context$1_AutomationInfoOriginInfoOneOf = AutomationInfoOriginInfoOneOf;
3896
+ type context$1_BatchActivationRequest = BatchActivationRequest;
3897
+ type context$1_BlockType = BlockType;
3898
+ declare const context$1_BlockType: typeof BlockType;
3899
+ type context$1_BulkCancelEventRequest = BulkCancelEventRequest;
3900
+ type context$1_BulkCancelEventResponse = BulkCancelEventResponse;
3901
+ type context$1_BulkCancelEventResponseNonNullableFields = BulkCancelEventResponseNonNullableFields;
3902
+ type context$1_BulkCancelEventResult = BulkCancelEventResult;
3903
+ type context$1_BulkReportEventRequest = BulkReportEventRequest;
3904
+ type context$1_BulkReportEventResponse = BulkReportEventResponse;
3905
+ type context$1_BulkReportEventResponseNonNullableFields = BulkReportEventResponseNonNullableFields;
3906
+ type context$1_BulkReportEventResult = BulkReportEventResult;
3907
+ type context$1_CancelEventRequest = CancelEventRequest;
3908
+ type context$1_CancelEventResponse = CancelEventResponse;
3909
+ type context$1_CancelPendingScheduleRequest = CancelPendingScheduleRequest;
3910
+ type context$1_CancelPendingScheduleRequestByOneOf = CancelPendingScheduleRequestByOneOf;
3911
+ type context$1_CancelPendingScheduleResponse = CancelPendingScheduleResponse;
3912
+ type context$1_CancellationReason = CancellationReason;
3913
+ declare const context$1_CancellationReason: typeof CancellationReason;
3914
+ type context$1_CancelledStatusInfo = CancelledStatusInfo;
3915
+ type context$1_Case = Case;
3916
+ type context$1_ConditionActionInfo = ConditionActionInfo;
3917
+ type context$1_ConditionBlock = ConditionBlock;
3918
+ type context$1_ConditionFilter = ConditionFilter;
3919
+ type context$1_Delay = Delay;
3920
+ type context$1_DelayActionInfo = DelayActionInfo;
3921
+ type context$1_DelayHelper = DelayHelper;
3922
+ type context$1_DelayOfOneOf = DelayOfOneOf;
3923
+ type context$1_EndedStatusInfo = EndedStatusInfo;
3924
+ type context$1_EndedStatusInfoTypeInfoOneOf = EndedStatusInfoTypeInfoOneOf;
3925
+ type context$1_EventInfo = EventInfo;
3926
+ type context$1_ExecuteFromActionRequest = ExecuteFromActionRequest;
3927
+ type context$1_ExecuteFromActionResponse = ExecuteFromActionResponse;
3928
+ type context$1_ExpressionEvaluationResult = ExpressionEvaluationResult;
3929
+ type context$1_FailedStatusInfo = FailedStatusInfo;
3930
+ type context$1_Idempotency = Idempotency;
3931
+ type context$1_IdentifierType = IdentifierType;
3932
+ declare const context$1_IdentifierType: typeof IdentifierType;
3933
+ type context$1_Identity = Identity;
3934
+ type context$1_IfFilter = IfFilter;
3935
+ type context$1_InitiatedStatusInfo = InitiatedStatusInfo;
3936
+ type context$1_Output = Output;
3937
+ type context$1_PreinstalledIdentifier = PreinstalledIdentifier;
3938
+ type context$1_RateLimitActionInfo = RateLimitActionInfo;
3939
+ type context$1_RateLimiting = RateLimiting;
3940
+ type context$1_RefreshPayloadRequest = RefreshPayloadRequest;
3941
+ type context$1_RefreshPayloadResponse = RefreshPayloadResponse;
3942
+ type context$1_ReportDomainEventRequest = ReportDomainEventRequest;
3943
+ type context$1_ReportDomainEventResponse = ReportDomainEventResponse;
3944
+ type context$1_ReportEventOptions = ReportEventOptions;
3945
+ type context$1_ReportEventRequest = ReportEventRequest;
3946
+ type context$1_ReportEventResponse = ReportEventResponse;
3947
+ type context$1_ReportEventResponseNonNullableFields = ReportEventResponseNonNullableFields;
3948
+ type context$1_RunAutomationRequest = RunAutomationRequest;
3949
+ type context$1_RunAutomationResponse = RunAutomationResponse;
3950
+ type context$1_Runtime = Runtime;
3951
+ type context$1_Schedule = Schedule;
3952
+ type context$1_ScheduleRequest = ScheduleRequest;
3953
+ type context$1_ScheduleResponse = ScheduleResponse;
3954
+ type context$1_ScheduleStatus = ScheduleStatus;
3955
+ declare const context$1_ScheduleStatus: typeof ScheduleStatus;
3956
+ type context$1_ScheduledAction = ScheduledAction;
3957
+ type context$1_ScheduledStatusInfo = ScheduledStatusInfo;
3958
+ type context$1_Scheduler = Scheduler;
3959
+ type context$1_Service = Service;
3960
+ type context$1_ServiceMapping = ServiceMapping;
3961
+ type context$1_SimpleDelay = SimpleDelay;
3962
+ type context$1_SpiAction = SpiAction;
3963
+ type context$1_StartedStatusInfo = StartedStatusInfo;
3964
+ type context$1_StartedStatusInfoAppDefinedActionInfo = StartedStatusInfoAppDefinedActionInfo;
3965
+ type context$1_StartedStatusInfoTypeInfoOneOf = StartedStatusInfoTypeInfoOneOf;
3966
+ type context$1_SwitchFilter = SwitchFilter;
3967
+ type context$1_SystemHelper = SystemHelper;
3968
+ type context$1_SystemHelperHelperOneOf = SystemHelperHelperOneOf;
3969
+ type context$1_Target = Target;
3970
+ declare const context$1_Target: typeof Target;
3971
+ type context$1_TriggerInfo = TriggerInfo;
3972
+ type context$1_Units = Units;
3973
+ declare const context$1_Units: typeof Units;
3974
+ type context$1_UpdatePendingSchedulesPayloadRequest = UpdatePendingSchedulesPayloadRequest;
3975
+ type context$1_UpdatePendingSchedulesPayloadResponse = UpdatePendingSchedulesPayloadResponse;
3976
+ type context$1_V1RunAutomationRequest = V1RunAutomationRequest;
3977
+ type context$1_V1RunAutomationRequestIdentifierOneOf = V1RunAutomationRequestIdentifierOneOf;
3978
+ type context$1_V1RunAutomationResponse = V1RunAutomationResponse;
3979
+ type context$1__publicOnActivationStatusChangedType = _publicOnActivationStatusChangedType;
3980
+ declare const context$1_bulkCancelEvent: typeof bulkCancelEvent;
3981
+ declare const context$1_bulkReportEvent: typeof bulkReportEvent;
3982
+ declare const context$1_cancelEvent: typeof cancelEvent;
3983
+ declare const context$1_onActivationStatusChanged: typeof onActivationStatusChanged;
3984
+ declare const context$1_reportEvent: typeof reportEvent;
3985
+ declare namespace context$1 {
3986
+ export { type Action$1 as Action, type context$1_ActionActionOneOf as ActionActionOneOf, type context$1_ActionCompletedRequest as ActionCompletedRequest, type context$1_ActionData as ActionData, type ActionEvent$1 as ActionEvent, type ActionSettings$1 as ActionSettings, type context$1_ActionStatus as ActionStatus, type context$1_ActionsData as ActionsData, type context$1_Activation as Activation, type context$1_ActivationActionStatusChanged as ActivationActionStatusChanged, context$1_ActivationActionStatusChangedStatus as ActivationActionStatusChangedStatus, type context$1_ActivationActionStatusChangedStatusInfoOneOf as ActivationActionStatusChangedStatusInfoOneOf, type context$1_ActivationContinuedAfterSchedule as ActivationContinuedAfterSchedule, type context$1_ActivationRequest as ActivationRequest, type context$1_ActivationResumeAfterDelay as ActivationResumeAfterDelay, type context$1_ActivationScheduleCompleted as ActivationScheduleCompleted, type context$1_ActivationScheduleRequested as ActivationScheduleRequested, type context$1_ActivationSource as ActivationSource, type context$1_ActivationSourceOfOneOf as ActivationSourceOfOneOf, type context$1_ActivationStatus as ActivationStatus, type context$1_ActivationStatusChanged as ActivationStatusChanged, type context$1_ActivationStatusChangedEnvelope as ActivationStatusChangedEnvelope, type context$1_ActivationStatusChangedFailedStatusInfo as ActivationStatusChangedFailedStatusInfo, context$1_ActivationStatusChangedStatus as ActivationStatusChangedStatus, type context$1_ActivationStatusChangedStatusInfoOneOf as ActivationStatusChangedStatusInfoOneOf, type AppDefinedAction$1 as AppDefinedAction, type context$1_AppDefinedActionInfo as AppDefinedActionInfo, type ApplicationError$1 as ApplicationError, type ApplicationOrigin$1 as ApplicationOrigin, type context$1_AsyncAction as AsyncAction, type AuditInfo$1 as AuditInfo, type AuditInfoIdOneOf$1 as AuditInfoIdOneOf, type Automation$1 as Automation, type AutomationConfiguration$1 as AutomationConfiguration, type context$1_AutomationConfigurationAction as AutomationConfigurationAction, type context$1_AutomationConfigurationActionInfoOneOf as AutomationConfigurationActionInfoOneOf, context$1_AutomationConfigurationStatus as AutomationConfigurationStatus, type context$1_AutomationIdentifier as AutomationIdentifier, type context$1_AutomationInfo as AutomationInfo, type context$1_AutomationInfoOriginInfoOneOf as AutomationInfoOriginInfoOneOf, type AutomationOriginInfoOneOf$1 as AutomationOriginInfoOneOf, type AutomationSettings$1 as AutomationSettings, type BaseEventMetadata$1 as BaseEventMetadata, type context$1_BatchActivationRequest as BatchActivationRequest, context$1_BlockType as BlockType, type BulkActionMetadata$1 as BulkActionMetadata, type context$1_BulkCancelEventRequest as BulkCancelEventRequest, type context$1_BulkCancelEventResponse as BulkCancelEventResponse, type context$1_BulkCancelEventResponseNonNullableFields as BulkCancelEventResponseNonNullableFields, type context$1_BulkCancelEventResult as BulkCancelEventResult, type context$1_BulkReportEventRequest as BulkReportEventRequest, type context$1_BulkReportEventResponse as BulkReportEventResponse, type context$1_BulkReportEventResponseNonNullableFields as BulkReportEventResponseNonNullableFields, type context$1_BulkReportEventResult as BulkReportEventResult, type context$1_CancelEventRequest as CancelEventRequest, type context$1_CancelEventResponse as CancelEventResponse, type context$1_CancelPendingScheduleRequest as CancelPendingScheduleRequest, type context$1_CancelPendingScheduleRequestByOneOf as CancelPendingScheduleRequestByOneOf, type context$1_CancelPendingScheduleResponse as CancelPendingScheduleResponse, context$1_CancellationReason as CancellationReason, type context$1_CancelledStatusInfo as CancelledStatusInfo, type context$1_Case as Case, type ConditionAction$1 as ConditionAction, type context$1_ConditionActionInfo as ConditionActionInfo, type context$1_ConditionBlock as ConditionBlock, type ConditionExpressionGroup$1 as ConditionExpressionGroup, type context$1_ConditionFilter as ConditionFilter, type context$1_Delay as Delay, type DelayAction$1 as DelayAction, type context$1_DelayActionInfo as DelayActionInfo, type context$1_DelayHelper as DelayHelper, type context$1_DelayOfOneOf as DelayOfOneOf, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type DraftInfo$1 as DraftInfo, type Empty$1 as Empty, type context$1_EndedStatusInfo as EndedStatusInfo, type context$1_EndedStatusInfoTypeInfoOneOf as EndedStatusInfoTypeInfoOneOf, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type context$1_EventInfo as EventInfo, type EventMetadata$1 as EventMetadata, type context$1_ExecuteFromActionRequest as ExecuteFromActionRequest, type context$1_ExecuteFromActionResponse as ExecuteFromActionResponse, type context$1_ExpressionEvaluationResult as ExpressionEvaluationResult, type context$1_FailedStatusInfo as FailedStatusInfo, type Filter$1 as Filter, type FutureDateActivationOffset$1 as FutureDateActivationOffset, type context$1_Idempotency as Idempotency, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, context$1_IdentifierType as IdentifierType, type context$1_Identity as Identity, type context$1_IfFilter as IfFilter, type context$1_InitiatedStatusInfo as InitiatedStatusInfo, type ItemMetadata$1 as ItemMetadata, type MessageEnvelope$1 as MessageEnvelope, Operator$1 as Operator, Origin$1 as Origin, type context$1_Output as Output, type OutputAction$1 as OutputAction, type context$1_PreinstalledIdentifier as PreinstalledIdentifier, type PreinstalledOrigin$1 as PreinstalledOrigin, type RateLimit$1 as RateLimit, type RateLimitAction$1 as RateLimitAction, type context$1_RateLimitActionInfo as RateLimitActionInfo, type context$1_RateLimiting as RateLimiting, type context$1_RefreshPayloadRequest as RefreshPayloadRequest, type context$1_RefreshPayloadResponse as RefreshPayloadResponse, type context$1_ReportDomainEventRequest as ReportDomainEventRequest, type context$1_ReportDomainEventResponse as ReportDomainEventResponse, type context$1_ReportEventOptions as ReportEventOptions, type context$1_ReportEventRequest as ReportEventRequest, type context$1_ReportEventResponse as ReportEventResponse, type context$1_ReportEventResponseNonNullableFields as ReportEventResponseNonNullableFields, type RestoreInfo$1 as RestoreInfo, type context$1_RunAutomationRequest as RunAutomationRequest, type context$1_RunAutomationResponse as RunAutomationResponse, type context$1_Runtime as Runtime, type context$1_Schedule as Schedule, type context$1_ScheduleRequest as ScheduleRequest, type context$1_ScheduleResponse as ScheduleResponse, context$1_ScheduleStatus as ScheduleStatus, type context$1_ScheduledAction as ScheduledAction, type context$1_ScheduledStatusInfo as ScheduledStatusInfo, type context$1_Scheduler as Scheduler, type context$1_Service as Service, type context$1_ServiceMapping as ServiceMapping, type context$1_SimpleDelay as SimpleDelay, type context$1_SpiAction as SpiAction, type context$1_StartedStatusInfo as StartedStatusInfo, type context$1_StartedStatusInfoAppDefinedActionInfo as StartedStatusInfoAppDefinedActionInfo, type context$1_StartedStatusInfoTypeInfoOneOf as StartedStatusInfoTypeInfoOneOf, Status$1 as Status, type context$1_SwitchFilter as SwitchFilter, type context$1_SystemHelper as SystemHelper, type context$1_SystemHelperHelperOneOf as SystemHelperHelperOneOf, context$1_Target as Target, TimeUnit$1 as TimeUnit, type Trigger$1 as Trigger, type context$1_TriggerInfo as TriggerInfo, Type$1 as Type, context$1_Units as Units, type context$1_UpdatePendingSchedulesPayloadRequest as UpdatePendingSchedulesPayloadRequest, type context$1_UpdatePendingSchedulesPayloadResponse as UpdatePendingSchedulesPayloadResponse, type context$1_V1RunAutomationRequest as V1RunAutomationRequest, type context$1_V1RunAutomationRequestIdentifierOneOf as V1RunAutomationRequestIdentifierOneOf, type context$1_V1RunAutomationResponse as V1RunAutomationResponse, WebhookIdentityType$1 as WebhookIdentityType, type context$1__publicOnActivationStatusChangedType as _publicOnActivationStatusChangedType, context$1_bulkCancelEvent as bulkCancelEvent, context$1_bulkReportEvent as bulkReportEvent, context$1_cancelEvent as cancelEvent, context$1_onActivationStatusChanged as onActivationStatusChanged, onActivationStatusChanged$1 as publicOnActivationStatusChanged, context$1_reportEvent as reportEvent };
4722
3987
  }
4723
- /**
4724
- * A type used to create concerete types from SDK descriptors in
4725
- * case a contextual client is available.
4726
- */
4727
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
4728
- host: Host;
4729
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
4730
3988
 
4731
3989
  interface Automation extends AutomationOriginInfoOneOf {
4732
3990
  /** Application info */
@@ -6697,11 +5955,11 @@ interface GetActionsQuotaInfoSignature {
6697
5955
  */
6698
5956
  (): Promise<GetActionsQuotaInfoResponse & GetActionsQuotaInfoResponseNonNullableFields>;
6699
5957
  }
6700
- declare const onAutomationCreated$1: EventDefinition$1<AutomationCreatedEnvelope, "wix.automations.v2.automation_created">;
6701
- declare const onAutomationUpdated$1: EventDefinition$1<AutomationUpdatedEnvelope, "wix.automations.v2.automation_updated">;
6702
- declare const onAutomationDeleted$1: EventDefinition$1<AutomationDeletedEnvelope, "wix.automations.v2.automation_deleted">;
6703
- declare const onAutomationUpdatedWithPreviousEntity$1: EventDefinition$1<AutomationUpdatedWithPreviousEntityEnvelope, "wix.automations.v2.automation_updated_with_previous_entity">;
6704
- declare const onAutomationDeletedWithEntity$1: EventDefinition$1<AutomationDeletedWithEntityEnvelope, "wix.automations.v2.automation_deleted_with_entity">;
5958
+ declare const onAutomationCreated$1: EventDefinition$3<AutomationCreatedEnvelope, "wix.automations.v2.automation_created">;
5959
+ declare const onAutomationUpdated$1: EventDefinition$3<AutomationUpdatedEnvelope, "wix.automations.v2.automation_updated">;
5960
+ declare const onAutomationDeleted$1: EventDefinition$3<AutomationDeletedEnvelope, "wix.automations.v2.automation_deleted">;
5961
+ declare const onAutomationUpdatedWithPreviousEntity$1: EventDefinition$3<AutomationUpdatedWithPreviousEntityEnvelope, "wix.automations.v2.automation_updated_with_previous_entity">;
5962
+ declare const onAutomationDeletedWithEntity$1: EventDefinition$3<AutomationDeletedWithEntityEnvelope, "wix.automations.v2.automation_deleted_with_entity">;
6705
5963
 
6706
5964
  type EventDefinition<Payload = unknown, Type extends string = string> = {
6707
5965
  __type: 'event-definition';