@wix/pricing-plans 1.0.93 → 1.0.95

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,39 +1,127 @@
1
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
2
- interface HttpClient$1 {
3
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
1
+ type HostModule<T, H extends Host> = {
2
+ __type: 'host';
3
+ create(host: H): T;
4
+ };
5
+ type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
+ type Host<Environment = unknown> = {
7
+ channel: {
8
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
+ disconnect: () => void;
10
+ } | Promise<{
11
+ disconnect: () => void;
12
+ }>;
13
+ };
14
+ environment?: Environment;
15
+ /**
16
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
17
+ */
18
+ apiBaseUrl?: string;
19
+ /**
20
+ * Possible data to be provided by every host, for cross cutting concerns
21
+ * like internationalization, billing, etc.
22
+ */
23
+ essentials?: {
24
+ /**
25
+ * The language of the currently viewed session
26
+ */
27
+ language?: string;
28
+ /**
29
+ * The locale of the currently viewed session
30
+ */
31
+ locale?: string;
32
+ /**
33
+ * Any headers that should be passed through to the API requests
34
+ */
35
+ passThroughHeaders?: Record<string, string>;
36
+ };
37
+ };
38
+
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>>;
4
42
  fetchWithAuth: typeof fetch;
5
43
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
+ getActiveToken?: () => string | undefined;
6
45
  }
7
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
8
- type HttpResponse$1<T = any> = {
46
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
47
+ type HttpResponse<T = any> = {
9
48
  data: T;
10
49
  status: number;
11
50
  statusText: string;
12
51
  headers: any;
13
52
  request?: any;
14
53
  };
15
- type RequestOptions$1<_TResponse = any, Data = any> = {
54
+ type RequestOptions<_TResponse = any, Data = any> = {
16
55
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
17
56
  url: string;
18
57
  data?: Data;
19
58
  params?: URLSearchParams;
20
- } & APIMetadata$1;
21
- type APIMetadata$1 = {
59
+ } & APIMetadata;
60
+ type APIMetadata = {
22
61
  methodFqn?: string;
23
62
  entityFqdn?: string;
24
63
  packageName?: string;
25
64
  };
26
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
27
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
65
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
+ type EventDefinition$2<Payload = unknown, Type extends string = string> = {
28
67
  __type: 'event-definition';
29
68
  type: Type;
30
69
  isDomainEvent?: boolean;
31
70
  transformations?: (envelope: unknown) => Payload;
32
71
  __payload: Payload;
33
72
  };
34
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
35
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
36
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
73
+ declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
74
+ type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
75
+ type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
76
+
77
+ type ServicePluginMethodInput = {
78
+ request: any;
79
+ metadata: any;
80
+ };
81
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
82
+ type ServicePluginMethodMetadata = {
83
+ name: string;
84
+ primaryHttpMappingPath: string;
85
+ transformations: {
86
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
87
+ toREST: (...args: unknown[]) => unknown;
88
+ };
89
+ };
90
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
91
+ __type: 'service-plugin-definition';
92
+ componentType: string;
93
+ methods: ServicePluginMethodMetadata[];
94
+ __contract: Contract;
95
+ };
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
+
100
+ type RequestContext = {
101
+ isSSR: boolean;
102
+ host: string;
103
+ protocol?: string;
104
+ };
105
+ type ResponseTransformer = (data: any, headers?: any) => any;
106
+ /**
107
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
108
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
109
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
110
+ */
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
+ _?: T;
114
+ url?: string;
115
+ method?: Method;
116
+ params?: any;
117
+ data?: any;
118
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
119
+ };
120
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
121
+ __isAmbassador: boolean;
122
+ };
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;
37
125
 
38
126
  declare global {
39
127
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -42,6 +130,284 @@ declare global {
42
130
  }
43
131
  }
44
132
 
133
+ declare const emptyObjectSymbol: unique symbol;
134
+
135
+ /**
136
+ Represents a strictly empty plain object, the `{}` value.
137
+
138
+ 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)).
139
+
140
+ @example
141
+ ```
142
+ import type {EmptyObject} from 'type-fest';
143
+
144
+ // The following illustrates the problem with `{}`.
145
+ const foo1: {} = {}; // Pass
146
+ const foo2: {} = []; // Pass
147
+ const foo3: {} = 42; // Pass
148
+ const foo4: {} = {a: 1}; // Pass
149
+
150
+ // With `EmptyObject` only the first case is valid.
151
+ const bar1: EmptyObject = {}; // Pass
152
+ const bar2: EmptyObject = 42; // Fail
153
+ const bar3: EmptyObject = []; // Fail
154
+ const bar4: EmptyObject = {a: 1}; // Fail
155
+ ```
156
+
157
+ 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}.
158
+
159
+ @category Object
160
+ */
161
+ type EmptyObject = {[emptyObjectSymbol]?: never};
162
+
163
+ /**
164
+ Returns a boolean for whether the two given types are equal.
165
+
166
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
167
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
168
+
169
+ Use-cases:
170
+ - If you want to make a conditional branch based on the result of a comparison of two types.
171
+
172
+ @example
173
+ ```
174
+ import type {IsEqual} from 'type-fest';
175
+
176
+ // This type returns a boolean for whether the given array includes the given item.
177
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
178
+ type Includes<Value extends readonly any[], Item> =
179
+ Value extends readonly [Value[0], ...infer rest]
180
+ ? IsEqual<Value[0], Item> extends true
181
+ ? true
182
+ : Includes<rest, Item>
183
+ : false;
184
+ ```
185
+
186
+ @category Type Guard
187
+ @category Utilities
188
+ */
189
+ type IsEqual<A, B> =
190
+ (<G>() => G extends A ? 1 : 2) extends
191
+ (<G>() => G extends B ? 1 : 2)
192
+ ? true
193
+ : false;
194
+
195
+ /**
196
+ Filter out keys from an object.
197
+
198
+ Returns `never` if `Exclude` is strictly equal to `Key`.
199
+ Returns `never` if `Key` extends `Exclude`.
200
+ Returns `Key` otherwise.
201
+
202
+ @example
203
+ ```
204
+ type Filtered = Filter<'foo', 'foo'>;
205
+ //=> never
206
+ ```
207
+
208
+ @example
209
+ ```
210
+ type Filtered = Filter<'bar', string>;
211
+ //=> never
212
+ ```
213
+
214
+ @example
215
+ ```
216
+ type Filtered = Filter<'bar', 'foo'>;
217
+ //=> 'bar'
218
+ ```
219
+
220
+ @see {Except}
221
+ */
222
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
+
224
+ type ExceptOptions = {
225
+ /**
226
+ Disallow assigning non-specified properties.
227
+
228
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
229
+
230
+ @default false
231
+ */
232
+ requireExactProps?: boolean;
233
+ };
234
+
235
+ /**
236
+ Create a type from an object type without certain keys.
237
+
238
+ We recommend setting the `requireExactProps` option to `true`.
239
+
240
+ 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.
241
+
242
+ 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)).
243
+
244
+ @example
245
+ ```
246
+ import type {Except} from 'type-fest';
247
+
248
+ type Foo = {
249
+ a: number;
250
+ b: string;
251
+ };
252
+
253
+ type FooWithoutA = Except<Foo, 'a'>;
254
+ //=> {b: string}
255
+
256
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
257
+ //=> errors: 'a' does not exist in type '{ b: string; }'
258
+
259
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
260
+ //=> {a: number} & Partial<Record<"b", never>>
261
+
262
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
263
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
264
+ ```
265
+
266
+ @category Object
267
+ */
268
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
269
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
270
+ } & (Options['requireExactProps'] extends true
271
+ ? Partial<Record<KeysType, never>>
272
+ : {});
273
+
274
+ /**
275
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
276
+
277
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
278
+
279
+ @example
280
+ ```
281
+ import type {ConditionalKeys} from 'type-fest';
282
+
283
+ interface Example {
284
+ a: string;
285
+ b: string | number;
286
+ c?: string;
287
+ d: {};
288
+ }
289
+
290
+ type StringKeysOnly = ConditionalKeys<Example, string>;
291
+ //=> 'a'
292
+ ```
293
+
294
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
295
+
296
+ @example
297
+ ```
298
+ import type {ConditionalKeys} from 'type-fest';
299
+
300
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
301
+ //=> 'a' | 'c'
302
+ ```
303
+
304
+ @category Object
305
+ */
306
+ type ConditionalKeys<Base, Condition> = NonNullable<
307
+ // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
308
+ {
309
+ // Map through all the keys of the given base type.
310
+ [Key in keyof Base]:
311
+ // Pick only keys with types extending the given `Condition` type.
312
+ Base[Key] extends Condition
313
+ // Retain this key since the condition passes.
314
+ ? Key
315
+ // Discard this key since the condition fails.
316
+ : never;
317
+
318
+ // Convert the produced object into a union type of the keys which passed the conditional test.
319
+ }[keyof Base]
320
+ >;
321
+
322
+ /**
323
+ Exclude keys from a shape that matches the given `Condition`.
324
+
325
+ 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.
326
+
327
+ @example
328
+ ```
329
+ import type {Primitive, ConditionalExcept} from 'type-fest';
330
+
331
+ class Awesome {
332
+ name: string;
333
+ successes: number;
334
+ failures: bigint;
335
+
336
+ run() {}
337
+ }
338
+
339
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
340
+ //=> {run: () => void}
341
+ ```
342
+
343
+ @example
344
+ ```
345
+ import type {ConditionalExcept} from 'type-fest';
346
+
347
+ interface Example {
348
+ a: string;
349
+ b: string | number;
350
+ c: () => void;
351
+ d: {};
352
+ }
353
+
354
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
355
+ //=> {b: string | number; c: () => void; d: {}}
356
+ ```
357
+
358
+ @category Object
359
+ */
360
+ type ConditionalExcept<Base, Condition> = Except<
361
+ Base,
362
+ ConditionalKeys<Base, Condition>
363
+ >;
364
+
365
+ /**
366
+ * Descriptors are objects that describe the API of a module, and the module
367
+ * can either be a REST module or a host module.
368
+ * This type is recursive, so it can describe nested modules.
369
+ */
370
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$2<any> | ServicePluginDefinition<any> | {
371
+ [key: string]: Descriptors | PublicMetadata | any;
372
+ };
373
+ /**
374
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
375
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
376
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
377
+ * do not match the given host (as they will not work with the given host).
378
+ */
379
+ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
380
+ done: T;
381
+ recurse: T extends {
382
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$2<any> ? BuildEventDefinition$2<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
+ -1,
386
+ 0,
387
+ 1,
388
+ 2,
389
+ 3,
390
+ 4,
391
+ 5
392
+ ][Depth]> : never;
393
+ }, EmptyObject>;
394
+ }[Depth extends -1 ? 'done' : 'recurse'];
395
+ type PublicMetadata = {
396
+ PACKAGE_NAME?: string;
397
+ };
398
+
399
+ declare global {
400
+ interface ContextualClient {
401
+ }
402
+ }
403
+ /**
404
+ * A type used to create concerete types from SDK descriptors in
405
+ * case a contextual client is available.
406
+ */
407
+ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
408
+ host: Host;
409
+ } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
410
+
45
411
  /**
46
412
  * An order object includes all of the details related to the purchase of a Pricing Plan.
47
413
  * You can manage existing orders, create offline orders, and preview orders not yet purchased.
@@ -1708,7 +2074,7 @@ interface ManagementListOrdersOptions {
1708
2074
  fieldSet?: Set;
1709
2075
  }
1710
2076
 
1711
- declare function memberGetOrder$1(httpClient: HttpClient$1): MemberGetOrderSignature;
2077
+ declare function memberGetOrder$1(httpClient: HttpClient): MemberGetOrderSignature;
1712
2078
  interface MemberGetOrderSignature {
1713
2079
  /**
1714
2080
  * Gets an order by ID for the currently logged-in member.
@@ -1720,7 +2086,7 @@ interface MemberGetOrderSignature {
1720
2086
  */
1721
2087
  (_id: string, options?: MemberGetOrderOptions | undefined): Promise<Order & OrderNonNullableFields>;
1722
2088
  }
1723
- declare function memberListOrders$1(httpClient: HttpClient$1): MemberListOrdersSignature;
2089
+ declare function memberListOrders$1(httpClient: HttpClient): MemberListOrdersSignature;
1724
2090
  interface MemberListOrdersSignature {
1725
2091
  /**
1726
2092
  * Lists orders for the currently logged-in member.
@@ -1730,7 +2096,7 @@ interface MemberListOrdersSignature {
1730
2096
  */
1731
2097
  (options?: MemberListOrdersOptions | undefined): Promise<MemberListOrdersResponse & MemberListOrdersResponseNonNullableFields>;
1732
2098
  }
1733
- declare function requestCancellation$1(httpClient: HttpClient$1): RequestCancellationSignature;
2099
+ declare function requestCancellation$1(httpClient: HttpClient): RequestCancellationSignature;
1734
2100
  interface RequestCancellationSignature {
1735
2101
  /**
1736
2102
  * Starts the process of canceling an order.
@@ -1758,7 +2124,7 @@ interface RequestCancellationSignature {
1758
2124
  */
1759
2125
  (_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
1760
2126
  }
1761
- declare function createOfflineOrder$1(httpClient: HttpClient$1): CreateOfflineOrderSignature;
2127
+ declare function createOfflineOrder$1(httpClient: HttpClient): CreateOfflineOrderSignature;
1762
2128
  interface CreateOfflineOrderSignature {
1763
2129
  /**
1764
2130
  * Creates an order for a buyer who purchased the plan with an offline transaction.
@@ -1783,7 +2149,7 @@ interface CreateOfflineOrderSignature {
1783
2149
  */
1784
2150
  (planId: string, memberId: string, options?: CreateOfflineOrderOptions | undefined): Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
1785
2151
  }
1786
- declare function getOfflineOrderPreview$1(httpClient: HttpClient$1): GetOfflineOrderPreviewSignature;
2152
+ declare function getOfflineOrderPreview$1(httpClient: HttpClient): GetOfflineOrderPreviewSignature;
1787
2153
  interface GetOfflineOrderPreviewSignature {
1788
2154
  /**
1789
2155
  * Provides a preview of an offline order as if it was purchased.
@@ -1802,7 +2168,7 @@ interface GetOfflineOrderPreviewSignature {
1802
2168
  */
1803
2169
  (planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions | undefined): Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
1804
2170
  }
1805
- declare function getPricePreview$1(httpClient: HttpClient$1): GetPricePreviewSignature;
2171
+ declare function getPricePreview$1(httpClient: HttpClient): GetPricePreviewSignature;
1806
2172
  interface GetPricePreviewSignature {
1807
2173
  /**
1808
2174
  * Retrieves a preview of an order's pricing as if it was purchased.
@@ -1818,7 +2184,7 @@ interface GetPricePreviewSignature {
1818
2184
  */
1819
2185
  (planId: string, options?: GetPricePreviewOptions | undefined): Promise<GetPricePreviewResponse & GetPricePreviewResponseNonNullableFields>;
1820
2186
  }
1821
- declare function managementGetOrder$1(httpClient: HttpClient$1): ManagementGetOrderSignature;
2187
+ declare function managementGetOrder$1(httpClient: HttpClient): ManagementGetOrderSignature;
1822
2188
  interface ManagementGetOrderSignature {
1823
2189
  /**
1824
2190
  * Retrieves an order by ID.
@@ -1829,7 +2195,7 @@ interface ManagementGetOrderSignature {
1829
2195
  */
1830
2196
  (_id: string, options?: ManagementGetOrderOptions | undefined): Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
1831
2197
  }
1832
- declare function managementListOrders$1(httpClient: HttpClient$1): ManagementListOrdersSignature;
2198
+ declare function managementListOrders$1(httpClient: HttpClient): ManagementListOrdersSignature;
1833
2199
  interface ManagementListOrdersSignature {
1834
2200
  /**
1835
2201
  * Lists pricing plan orders.
@@ -1841,7 +2207,7 @@ interface ManagementListOrdersSignature {
1841
2207
  */
1842
2208
  (options?: ManagementListOrdersOptions | undefined): Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
1843
2209
  }
1844
- declare function postponeEndDate$1(httpClient: HttpClient$1): PostponeEndDateSignature;
2210
+ declare function postponeEndDate$1(httpClient: HttpClient): PostponeEndDateSignature;
1845
2211
  interface PostponeEndDateSignature {
1846
2212
  /**
1847
2213
  * Extends the duration of a pricing plan order by postponing the order's `endDate`.
@@ -1863,7 +2229,7 @@ interface PostponeEndDateSignature {
1863
2229
  */
1864
2230
  (_id: string, endDate: Date): Promise<void>;
1865
2231
  }
1866
- declare function cancelOrder$1(httpClient: HttpClient$1): CancelOrderSignature;
2232
+ declare function cancelOrder$1(httpClient: HttpClient): CancelOrderSignature;
1867
2233
  interface CancelOrderSignature {
1868
2234
  /**
1869
2235
  * Cancels an existing order.
@@ -1894,7 +2260,7 @@ interface CancelOrderSignature {
1894
2260
  */
1895
2261
  (_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
1896
2262
  }
1897
- declare function markAsPaid$1(httpClient: HttpClient$1): MarkAsPaidSignature;
2263
+ declare function markAsPaid$1(httpClient: HttpClient): MarkAsPaidSignature;
1898
2264
  interface MarkAsPaidSignature {
1899
2265
  /**
1900
2266
  * Marks an offline order as paid.
@@ -1917,7 +2283,7 @@ interface MarkAsPaidSignature {
1917
2283
  */
1918
2284
  (_id: string): Promise<void>;
1919
2285
  }
1920
- declare function pauseOrder$1(httpClient: HttpClient$1): PauseOrderSignature;
2286
+ declare function pauseOrder$1(httpClient: HttpClient): PauseOrderSignature;
1921
2287
  interface PauseOrderSignature {
1922
2288
  /**
1923
2289
  * Pauses a pricing plan order.
@@ -1938,7 +2304,7 @@ interface PauseOrderSignature {
1938
2304
  */
1939
2305
  (_id: string): Promise<void>;
1940
2306
  }
1941
- declare function resumeOrder$1(httpClient: HttpClient$1): ResumeOrderSignature;
2307
+ declare function resumeOrder$1(httpClient: HttpClient): ResumeOrderSignature;
1942
2308
  interface ResumeOrderSignature {
1943
2309
  /**
1944
2310
  * Resumes a paused pricing plan order.
@@ -1957,35 +2323,53 @@ interface ResumeOrderSignature {
1957
2323
  */
1958
2324
  (_id: string): Promise<void>;
1959
2325
  }
1960
- declare const onOrderCanceled$1: EventDefinition$1<OrderCanceledEnvelope, "wix.pricing_plans.v2.order_canceled">;
1961
- declare const onOrderCreated$1: EventDefinition$1<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
1962
- declare const onOrderUpdated$1: EventDefinition$1<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
1963
- declare const onOrderStartDateChanged$1: EventDefinition$1<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
1964
- declare const onOrderPurchased$1: EventDefinition$1<OrderPurchasedEnvelope, "wix.pricing_plans.v2.order_purchased">;
1965
- declare const onOrderStarted$1: EventDefinition$1<OrderStartedEnvelope, "wix.pricing_plans.v2.order_started">;
1966
- declare const onOrderCycleStarted$1: EventDefinition$1<OrderCycleStartedEnvelope, "wix.pricing_plans.v2.order_cycle_started">;
1967
- declare const onOrderAutoRenewCanceled$1: EventDefinition$1<OrderAutoRenewCanceledEnvelope, "wix.pricing_plans.v2.order_auto_renew_canceled">;
1968
- declare const onOrderEnded$1: EventDefinition$1<OrderEndedEnvelope, "wix.pricing_plans.v2.order_ended">;
1969
- declare const onOrderEndDatePostponed$1: EventDefinition$1<OrderEndDatePostponedEnvelope, "wix.pricing_plans.v2.order_end_date_postponed">;
1970
- declare const onOrderMarkedAsPaid$1: EventDefinition$1<OrderMarkedAsPaidEnvelope, "wix.pricing_plans.v2.order_marked_as_paid">;
1971
- declare const onOrderPaused$1: EventDefinition$1<OrderPausedEnvelope, "wix.pricing_plans.v2.order_paused">;
1972
- declare const onOrderResumed$1: EventDefinition$1<OrderResumedEnvelope, "wix.pricing_plans.v2.order_resumed">;
2326
+ declare const onOrderCanceled$1: EventDefinition$2<OrderCanceledEnvelope, "wix.pricing_plans.v2.order_canceled">;
2327
+ declare const onOrderCreated$1: EventDefinition$2<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
2328
+ declare const onOrderUpdated$1: EventDefinition$2<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
2329
+ declare const onOrderStartDateChanged$1: EventDefinition$2<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
2330
+ declare const onOrderPurchased$1: EventDefinition$2<OrderPurchasedEnvelope, "wix.pricing_plans.v2.order_purchased">;
2331
+ declare const onOrderStarted$1: EventDefinition$2<OrderStartedEnvelope, "wix.pricing_plans.v2.order_started">;
2332
+ declare const onOrderCycleStarted$1: EventDefinition$2<OrderCycleStartedEnvelope, "wix.pricing_plans.v2.order_cycle_started">;
2333
+ declare const onOrderAutoRenewCanceled$1: EventDefinition$2<OrderAutoRenewCanceledEnvelope, "wix.pricing_plans.v2.order_auto_renew_canceled">;
2334
+ declare const onOrderEnded$1: EventDefinition$2<OrderEndedEnvelope, "wix.pricing_plans.v2.order_ended">;
2335
+ declare const onOrderEndDatePostponed$1: EventDefinition$2<OrderEndDatePostponedEnvelope, "wix.pricing_plans.v2.order_end_date_postponed">;
2336
+ declare const onOrderMarkedAsPaid$1: EventDefinition$2<OrderMarkedAsPaidEnvelope, "wix.pricing_plans.v2.order_marked_as_paid">;
2337
+ declare const onOrderPaused$1: EventDefinition$2<OrderPausedEnvelope, "wix.pricing_plans.v2.order_paused">;
2338
+ declare const onOrderResumed$1: EventDefinition$2<OrderResumedEnvelope, "wix.pricing_plans.v2.order_resumed">;
2339
+
2340
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
2341
+ __type: 'event-definition';
2342
+ type: Type;
2343
+ isDomainEvent?: boolean;
2344
+ transformations?: (envelope: unknown) => Payload;
2345
+ __payload: Payload;
2346
+ };
2347
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
2348
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
2349
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
2350
+
2351
+ declare global {
2352
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2353
+ interface SymbolConstructor {
2354
+ readonly observable: symbol;
2355
+ }
2356
+ }
1973
2357
 
1974
2358
  declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
1975
2359
 
1976
- declare const memberGetOrder: BuildRESTFunction$1<typeof memberGetOrder$1> & typeof memberGetOrder$1;
1977
- declare const memberListOrders: BuildRESTFunction$1<typeof memberListOrders$1> & typeof memberListOrders$1;
1978
- declare const requestCancellation: BuildRESTFunction$1<typeof requestCancellation$1> & typeof requestCancellation$1;
1979
- declare const createOfflineOrder: BuildRESTFunction$1<typeof createOfflineOrder$1> & typeof createOfflineOrder$1;
1980
- declare const getOfflineOrderPreview: BuildRESTFunction$1<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1;
1981
- declare const getPricePreview: BuildRESTFunction$1<typeof getPricePreview$1> & typeof getPricePreview$1;
1982
- declare const managementGetOrder: BuildRESTFunction$1<typeof managementGetOrder$1> & typeof managementGetOrder$1;
1983
- declare const managementListOrders: BuildRESTFunction$1<typeof managementListOrders$1> & typeof managementListOrders$1;
1984
- declare const postponeEndDate: BuildRESTFunction$1<typeof postponeEndDate$1> & typeof postponeEndDate$1;
1985
- declare const cancelOrder: BuildRESTFunction$1<typeof cancelOrder$1> & typeof cancelOrder$1;
1986
- declare const markAsPaid: BuildRESTFunction$1<typeof markAsPaid$1> & typeof markAsPaid$1;
1987
- declare const pauseOrder: BuildRESTFunction$1<typeof pauseOrder$1> & typeof pauseOrder$1;
1988
- declare const resumeOrder: BuildRESTFunction$1<typeof resumeOrder$1> & typeof resumeOrder$1;
2360
+ declare const memberGetOrder: MaybeContext<BuildRESTFunction<typeof memberGetOrder$1> & typeof memberGetOrder$1>;
2361
+ declare const memberListOrders: MaybeContext<BuildRESTFunction<typeof memberListOrders$1> & typeof memberListOrders$1>;
2362
+ declare const requestCancellation: MaybeContext<BuildRESTFunction<typeof requestCancellation$1> & typeof requestCancellation$1>;
2363
+ declare const createOfflineOrder: MaybeContext<BuildRESTFunction<typeof createOfflineOrder$1> & typeof createOfflineOrder$1>;
2364
+ declare const getOfflineOrderPreview: MaybeContext<BuildRESTFunction<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1>;
2365
+ declare const getPricePreview: MaybeContext<BuildRESTFunction<typeof getPricePreview$1> & typeof getPricePreview$1>;
2366
+ declare const managementGetOrder: MaybeContext<BuildRESTFunction<typeof managementGetOrder$1> & typeof managementGetOrder$1>;
2367
+ declare const managementListOrders: MaybeContext<BuildRESTFunction<typeof managementListOrders$1> & typeof managementListOrders$1>;
2368
+ declare const postponeEndDate: MaybeContext<BuildRESTFunction<typeof postponeEndDate$1> & typeof postponeEndDate$1>;
2369
+ declare const cancelOrder: MaybeContext<BuildRESTFunction<typeof cancelOrder$1> & typeof cancelOrder$1>;
2370
+ declare const markAsPaid: MaybeContext<BuildRESTFunction<typeof markAsPaid$1> & typeof markAsPaid$1>;
2371
+ declare const pauseOrder: MaybeContext<BuildRESTFunction<typeof pauseOrder$1> & typeof pauseOrder$1>;
2372
+ declare const resumeOrder: MaybeContext<BuildRESTFunction<typeof resumeOrder$1> & typeof resumeOrder$1>;
1989
2373
 
1990
2374
  type _publicOnOrderCanceledType = typeof onOrderCanceled$1;
1991
2375
  /**
@@ -2274,50 +2658,6 @@ declare namespace context$1 {
2274
2658
  export { type ActionEvent$1 as ActionEvent, type ApplicationError$1 as ApplicationError, type context$1_ApplyCouponRequest as ApplyCouponRequest, type context$1_ApplyCouponResponse as ApplyCouponResponse, type BaseEventMetadata$1 as BaseEventMetadata, type BulkActionMetadata$1 as BulkActionMetadata, type context$1_BulkOrderResult as BulkOrderResult, type context$1_BulkPauseOrderRequest as BulkPauseOrderRequest, type context$1_BulkPauseOrderResponse as BulkPauseOrderResponse, type context$1_BulkResumeOrderRequest as BulkResumeOrderRequest, type context$1_BulkResumeOrderResponse as BulkResumeOrderResponse, type context$1_Buyer as Buyer, type context$1_CancelOrderRequest as CancelOrderRequest, type context$1_CancelOrderResponse as CancelOrderResponse, type context$1_Cancellation as Cancellation, context$1_CancellationCause as CancellationCause, context$1_CancellationEffectiveAt as CancellationEffectiveAt, type context$1_Captcha as Captcha, type context$1_ChangeStartDateRequest as ChangeStartDateRequest, type context$1_ChangeStartDateResponse as ChangeStartDateResponse, type context$1_Coupon as Coupon, type context$1_CouponsError as CouponsError, type context$1_CreateExternalOrderRequest as CreateExternalOrderRequest, type context$1_CreateExternalOrderResponse as CreateExternalOrderResponse, type context$1_CreateGuestOnlineOrderRequest as CreateGuestOnlineOrderRequest, type context$1_CreateGuestOnlineOrderResponse as CreateGuestOnlineOrderResponse, type context$1_CreateOfflineOrderOptions as CreateOfflineOrderOptions, type context$1_CreateOfflineOrderRequest as CreateOfflineOrderRequest, type context$1_CreateOfflineOrderResponse as CreateOfflineOrderResponse, type context$1_CreateOfflineOrderResponseNonNullableFields as CreateOfflineOrderResponseNonNullableFields, type context$1_CreateOnlineOrderRequest as CreateOnlineOrderRequest, type context$1_CreateOnlineOrderResponse as CreateOnlineOrderResponse, type context$1_CurrentCycle as CurrentCycle, type context$1_CursorPaging as CursorPaging, type Cursors$1 as Cursors, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Duration$1 as Duration, type context$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type Fee$1 as Fee, type context$1_FormData as FormData, type context$1_GetAvailableOrderActionsRequest as GetAvailableOrderActionsRequest, type context$1_GetAvailableOrderActionsResponse as GetAvailableOrderActionsResponse, type context$1_GetGuestOnlineOrderPreviewRequest as GetGuestOnlineOrderPreviewRequest, type context$1_GetGuestOnlineOrderPreviewResponse as GetGuestOnlineOrderPreviewResponse, type context$1_GetOfflineOrderPreviewOptions as GetOfflineOrderPreviewOptions, type context$1_GetOfflineOrderPreviewRequest as GetOfflineOrderPreviewRequest, type context$1_GetOfflineOrderPreviewResponse as GetOfflineOrderPreviewResponse, type context$1_GetOfflineOrderPreviewResponseNonNullableFields as GetOfflineOrderPreviewResponseNonNullableFields, type context$1_GetOnlineOrderPreviewRequest as GetOnlineOrderPreviewRequest, type context$1_GetOnlineOrderPreviewResponse as GetOnlineOrderPreviewResponse, type context$1_GetOrderRequest as GetOrderRequest, type context$1_GetOrderResponse as GetOrderResponse, type context$1_GetOrderResponseNonNullableFields as GetOrderResponseNonNullableFields, type context$1_GetOrdersStatsRequest as GetOrdersStatsRequest, type context$1_GetOrdersStatsResponse as GetOrdersStatsResponse, type context$1_GetPricePreviewOptions as GetPricePreviewOptions, type context$1_GetPricePreviewRequest as GetPricePreviewRequest, type context$1_GetPricePreviewResponse as GetPricePreviewResponse, type context$1_GetPricePreviewResponseNonNullableFields as GetPricePreviewResponseNonNullableFields, type context$1_Guest as Guest, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type ItemMetadata$1 as ItemMetadata, type context$1_ListOrdersRequest as ListOrdersRequest, type context$1_ListOrdersResponse as ListOrdersResponse, type context$1_ListOrdersResponseNonNullableFields as ListOrdersResponseNonNullableFields, type context$1_ManagementGetOrderOptions as ManagementGetOrderOptions, type context$1_ManagementListOrdersOptions as ManagementListOrdersOptions, type context$1_MarkAsPaidRequest as MarkAsPaidRequest, type context$1_MarkAsPaidResponse as MarkAsPaidResponse, type context$1_MemberGetOrderOptions as MemberGetOrderOptions, type context$1_MemberGetOrderRequest as MemberGetOrderRequest, type context$1_MemberGetOrderResponse as MemberGetOrderResponse, type context$1_MemberGetOrderResponseNonNullableFields as MemberGetOrderResponseNonNullableFields, type context$1_MemberListOrdersOptions as MemberListOrdersOptions, type context$1_MemberListOrdersRequest as MemberListOrdersRequest, type context$1_MemberListOrdersResponse as MemberListOrdersResponse, type context$1_MemberListOrdersResponseNonNullableFields as MemberListOrdersResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type context$1_OnBehalf as OnBehalf, type context$1_Order as Order, type context$1_OrderAutoRenewCanceled as OrderAutoRenewCanceled, type context$1_OrderAutoRenewCanceledEnvelope as OrderAutoRenewCanceledEnvelope, type context$1_OrderCanceled as OrderCanceled, type context$1_OrderCanceledEnvelope as OrderCanceledEnvelope, type context$1_OrderCreatedEnvelope as OrderCreatedEnvelope, type context$1_OrderCycle as OrderCycle, type context$1_OrderCycleStarted as OrderCycleStarted, type context$1_OrderCycleStartedEnvelope as OrderCycleStartedEnvelope, type context$1_OrderEndDatePostponed as OrderEndDatePostponed, type context$1_OrderEndDatePostponedEnvelope as OrderEndDatePostponedEnvelope, type context$1_OrderEnded as OrderEnded, type context$1_OrderEndedEnvelope as OrderEndedEnvelope, type context$1_OrderMarkedAsPaid as OrderMarkedAsPaid, type context$1_OrderMarkedAsPaidEnvelope as OrderMarkedAsPaidEnvelope, context$1_OrderMethod as OrderMethod, type context$1_OrderNonNullableFields as OrderNonNullableFields, type context$1_OrderPaused as OrderPaused, type context$1_OrderPausedEnvelope as OrderPausedEnvelope, type context$1_OrderPurchased as OrderPurchased, type context$1_OrderPurchasedEnvelope as OrderPurchasedEnvelope, type context$1_OrderResumed as OrderResumed, type context$1_OrderResumedEnvelope as OrderResumedEnvelope, type context$1_OrderStartDateChanged as OrderStartDateChanged, type context$1_OrderStartDateChangedEnvelope as OrderStartDateChangedEnvelope, type context$1_OrderStarted as OrderStarted, type context$1_OrderStartedEnvelope as OrderStartedEnvelope, context$1_OrderStatus as OrderStatus, context$1_OrderType as OrderType, type context$1_OrderUpdatedEnvelope as OrderUpdatedEnvelope, type context$1_OrdersQueryOrdersRequest as OrdersQueryOrdersRequest, type context$1_OrdersQueryOrdersResponse as OrdersQueryOrdersResponse, type Paging$1 as Paging, type PagingMetadataV2$1 as PagingMetadataV2, type context$1_PauseOrderRequest as PauseOrderRequest, type context$1_PauseOrderResponse as PauseOrderResponse, type context$1_PausePeriod as PausePeriod, context$1_PaymentStatus as PaymentStatus, PeriodUnit$1 as PeriodUnit, type context$1_PostponeEndDateRequest as PostponeEndDateRequest, type context$1_PostponeEndDateResponse as PostponeEndDateResponse, type context$1_Price as Price, type context$1_PriceDetails as PriceDetails, type context$1_PriceDetailsPricingModelOneOf as PriceDetailsPricingModelOneOf, type context$1_PriceDuration as PriceDuration, type context$1_PricingDetails as PricingDetails, type context$1_PricingDetailsPricingModelOneOf as PricingDetailsPricingModelOneOf, type context$1_QueryOrdersRequest as QueryOrdersRequest, type context$1_QueryOrdersResponse as QueryOrdersResponse, type QueryV2$1 as QueryV2, type context$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, context$1_ReasonNotSuspendable as ReasonNotSuspendable, type Recurrence$1 as Recurrence, type context$1_RequestCancellationRequest as RequestCancellationRequest, type context$1_RequestCancellationResponse as RequestCancellationResponse, type RestoreInfo$1 as RestoreInfo, type context$1_ResumeOrderRequest as ResumeOrderRequest, type context$1_ResumeOrderResponse as ResumeOrderResponse, context$1_Set as Set, type context$1_SetSubmissionRequest as SetSubmissionRequest, type context$1_SetSubmissionResponse as SetSubmissionResponse, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, type context$1_SpannedPrice as SpannedPrice, context$1_Status as Status, type context$1_Tax as Tax, WebhookIdentityType$1 as WebhookIdentityType, type context$1__publicOnOrderAutoRenewCanceledType as _publicOnOrderAutoRenewCanceledType, type context$1__publicOnOrderCanceledType as _publicOnOrderCanceledType, type context$1__publicOnOrderCreatedType as _publicOnOrderCreatedType, type context$1__publicOnOrderCycleStartedType as _publicOnOrderCycleStartedType, type context$1__publicOnOrderEndDatePostponedType as _publicOnOrderEndDatePostponedType, type context$1__publicOnOrderEndedType as _publicOnOrderEndedType, type context$1__publicOnOrderMarkedAsPaidType as _publicOnOrderMarkedAsPaidType, type context$1__publicOnOrderPausedType as _publicOnOrderPausedType, type context$1__publicOnOrderPurchasedType as _publicOnOrderPurchasedType, type context$1__publicOnOrderResumedType as _publicOnOrderResumedType, type context$1__publicOnOrderStartDateChangedType as _publicOnOrderStartDateChangedType, type context$1__publicOnOrderStartedType as _publicOnOrderStartedType, type context$1__publicOnOrderUpdatedType as _publicOnOrderUpdatedType, context$1_cancelOrder as cancelOrder, context$1_createOfflineOrder as createOfflineOrder, context$1_getOfflineOrderPreview as getOfflineOrderPreview, context$1_getPricePreview as getPricePreview, context$1_managementGetOrder as managementGetOrder, context$1_managementListOrders as managementListOrders, context$1_markAsPaid as markAsPaid, context$1_memberGetOrder as memberGetOrder, context$1_memberListOrders as memberListOrders, context$1_onOrderAutoRenewCanceled as onOrderAutoRenewCanceled, context$1_onOrderCanceled as onOrderCanceled, context$1_onOrderCreated as onOrderCreated, context$1_onOrderCycleStarted as onOrderCycleStarted, context$1_onOrderEndDatePostponed as onOrderEndDatePostponed, context$1_onOrderEnded as onOrderEnded, context$1_onOrderMarkedAsPaid as onOrderMarkedAsPaid, context$1_onOrderPaused as onOrderPaused, context$1_onOrderPurchased as onOrderPurchased, context$1_onOrderResumed as onOrderResumed, context$1_onOrderStartDateChanged as onOrderStartDateChanged, context$1_onOrderStarted as onOrderStarted, context$1_onOrderUpdated as onOrderUpdated, context$1_pauseOrder as pauseOrder, context$1_postponeEndDate as postponeEndDate, onOrderAutoRenewCanceled$1 as publicOnOrderAutoRenewCanceled, onOrderCanceled$1 as publicOnOrderCanceled, onOrderCreated$1 as publicOnOrderCreated, onOrderCycleStarted$1 as publicOnOrderCycleStarted, onOrderEndDatePostponed$1 as publicOnOrderEndDatePostponed, onOrderEnded$1 as publicOnOrderEnded, onOrderMarkedAsPaid$1 as publicOnOrderMarkedAsPaid, onOrderPaused$1 as publicOnOrderPaused, onOrderPurchased$1 as publicOnOrderPurchased, onOrderResumed$1 as publicOnOrderResumed, onOrderStartDateChanged$1 as publicOnOrderStartDateChanged, onOrderStarted$1 as publicOnOrderStarted, onOrderUpdated$1 as publicOnOrderUpdated, context$1_requestCancellation as requestCancellation, context$1_resumeOrder as resumeOrder };
2275
2659
  }
2276
2660
 
2277
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2278
- interface HttpClient {
2279
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
2280
- fetchWithAuth: typeof fetch;
2281
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
2282
- }
2283
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
2284
- type HttpResponse<T = any> = {
2285
- data: T;
2286
- status: number;
2287
- statusText: string;
2288
- headers: any;
2289
- request?: any;
2290
- };
2291
- type RequestOptions<_TResponse = any, Data = any> = {
2292
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2293
- url: string;
2294
- data?: Data;
2295
- params?: URLSearchParams;
2296
- } & APIMetadata;
2297
- type APIMetadata = {
2298
- methodFqn?: string;
2299
- entityFqdn?: string;
2300
- packageName?: string;
2301
- };
2302
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
2303
- type EventDefinition<Payload = unknown, Type extends string = string> = {
2304
- __type: 'event-definition';
2305
- type: Type;
2306
- isDomainEvent?: boolean;
2307
- transformations?: (envelope: unknown) => Payload;
2308
- __payload: Payload;
2309
- };
2310
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
2311
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
2312
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
2313
-
2314
- declare global {
2315
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2316
- interface SymbolConstructor {
2317
- readonly observable: symbol;
2318
- }
2319
- }
2320
-
2321
2661
  /** Information about the pricing plan. */
2322
2662
  interface Plan {
2323
2663
  /**
@@ -2768,16 +3108,6 @@ interface GetPlansPremiumStatusResponse {
2768
3108
  /** True if site has plans that were created before Pricing Plans became a premium app. */
2769
3109
  hasOldPlans?: boolean;
2770
3110
  }
2771
- interface QueryPlansRequest {
2772
- /** Query */
2773
- query?: QueryV2;
2774
- }
2775
- interface QueryPlansResponse {
2776
- /** List of pricing plans that match the specified query. */
2777
- plans?: Plan[];
2778
- /** Object containing paging-related data (number of plans returned, offset). */
2779
- pagingMetadata?: PagingMetadataV2;
2780
- }
2781
3111
  interface SearchPlansRequest {
2782
3112
  /** Query */
2783
3113
  query?: QueryV2;
@@ -3398,24 +3728,42 @@ interface ArchivePlanSignature {
3398
3728
  */
3399
3729
  (_id: string): Promise<ArchivePlanResponse & ArchivePlanResponseNonNullableFields>;
3400
3730
  }
3401
- declare const onPlanUpdated$1: EventDefinition<PlanUpdatedEnvelope, "wix.pricing_plans.plan_updated">;
3402
- declare const onPlanCreated$1: EventDefinition<PlanCreatedEnvelope, "wix.pricing_plans.plan_created">;
3403
- declare const onPlanBuyerCanCancelUpdated$1: EventDefinition<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
3404
- declare const onPlanArchived$1: EventDefinition<PlanArchivedEnvelope, "wix.pricing_plans.plan_plan_archived">;
3731
+ declare const onPlanUpdated$1: EventDefinition$2<PlanUpdatedEnvelope, "wix.pricing_plans.plan_updated">;
3732
+ declare const onPlanCreated$1: EventDefinition$2<PlanCreatedEnvelope, "wix.pricing_plans.plan_created">;
3733
+ declare const onPlanBuyerCanCancelUpdated$1: EventDefinition$2<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
3734
+ declare const onPlanArchived$1: EventDefinition$2<PlanArchivedEnvelope, "wix.pricing_plans.plan_plan_archived">;
3735
+
3736
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
3737
+ __type: 'event-definition';
3738
+ type: Type;
3739
+ isDomainEvent?: boolean;
3740
+ transformations?: (envelope: unknown) => Payload;
3741
+ __payload: Payload;
3742
+ };
3743
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
3744
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
3745
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
3746
+
3747
+ declare global {
3748
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3749
+ interface SymbolConstructor {
3750
+ readonly observable: symbol;
3751
+ }
3752
+ }
3405
3753
 
3406
3754
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3407
3755
 
3408
- declare const listPublicPlans: BuildRESTFunction<typeof listPublicPlans$1> & typeof listPublicPlans$1;
3409
- declare const queryPublicPlans: BuildRESTFunction<typeof queryPublicPlans$1> & typeof queryPublicPlans$1;
3410
- declare const getPlan: BuildRESTFunction<typeof getPlan$1> & typeof getPlan$1;
3411
- declare const listPlans: BuildRESTFunction<typeof listPlans$1> & typeof listPlans$1;
3412
- declare const getPlanStats: BuildRESTFunction<typeof getPlanStats$1> & typeof getPlanStats$1;
3413
- declare const createPlan: BuildRESTFunction<typeof createPlan$1> & typeof createPlan$1;
3414
- declare const updatePlan: BuildRESTFunction<typeof updatePlan$1> & typeof updatePlan$1;
3415
- declare const setPlanVisibility: BuildRESTFunction<typeof setPlanVisibility$1> & typeof setPlanVisibility$1;
3416
- declare const makePlanPrimary: BuildRESTFunction<typeof makePlanPrimary$1> & typeof makePlanPrimary$1;
3417
- declare const clearPrimary: BuildRESTFunction<typeof clearPrimary$1> & typeof clearPrimary$1;
3418
- declare const archivePlan: BuildRESTFunction<typeof archivePlan$1> & typeof archivePlan$1;
3756
+ declare const listPublicPlans: MaybeContext<BuildRESTFunction<typeof listPublicPlans$1> & typeof listPublicPlans$1>;
3757
+ declare const queryPublicPlans: MaybeContext<BuildRESTFunction<typeof queryPublicPlans$1> & typeof queryPublicPlans$1>;
3758
+ declare const getPlan: MaybeContext<BuildRESTFunction<typeof getPlan$1> & typeof getPlan$1>;
3759
+ declare const listPlans: MaybeContext<BuildRESTFunction<typeof listPlans$1> & typeof listPlans$1>;
3760
+ declare const getPlanStats: MaybeContext<BuildRESTFunction<typeof getPlanStats$1> & typeof getPlanStats$1>;
3761
+ declare const createPlan: MaybeContext<BuildRESTFunction<typeof createPlan$1> & typeof createPlan$1>;
3762
+ declare const updatePlan: MaybeContext<BuildRESTFunction<typeof updatePlan$1> & typeof updatePlan$1>;
3763
+ declare const setPlanVisibility: MaybeContext<BuildRESTFunction<typeof setPlanVisibility$1> & typeof setPlanVisibility$1>;
3764
+ declare const makePlanPrimary: MaybeContext<BuildRESTFunction<typeof makePlanPrimary$1> & typeof makePlanPrimary$1>;
3765
+ declare const clearPrimary: MaybeContext<BuildRESTFunction<typeof clearPrimary$1> & typeof clearPrimary$1>;
3766
+ declare const archivePlan: MaybeContext<BuildRESTFunction<typeof archivePlan$1> & typeof archivePlan$1>;
3419
3767
 
3420
3768
  type _publicOnPlanUpdatedType = typeof onPlanUpdated$1;
3421
3769
  /**
@@ -3515,8 +3863,6 @@ type context_PricingPricingModelOneOf = PricingPricingModelOneOf;
3515
3863
  type context_PublicFilter = PublicFilter;
3516
3864
  declare const context_PublicFilter: typeof PublicFilter;
3517
3865
  type context_PublicPlan = PublicPlan;
3518
- type context_QueryPlansRequest = QueryPlansRequest;
3519
- type context_QueryPlansResponse = QueryPlansResponse;
3520
3866
  type context_QueryPublicPlansRequest = QueryPublicPlansRequest;
3521
3867
  type context_QueryPublicPlansResponse = QueryPublicPlansResponse;
3522
3868
  type context_QueryPublicPlansResponseNonNullableFields = QueryPublicPlansResponseNonNullableFields;
@@ -3558,7 +3904,7 @@ declare const context_queryPublicPlans: typeof queryPublicPlans;
3558
3904
  declare const context_setPlanVisibility: typeof setPlanVisibility;
3559
3905
  declare const context_updatePlan: typeof updatePlan;
3560
3906
  declare namespace context {
3561
- export { type context_ActionEvent as ActionEvent, type context_ApplicationError as ApplicationError, context_AppliedAt as AppliedAt, type context_ArchivePlanRequest as ArchivePlanRequest, type context_ArchivePlanResponse as ArchivePlanResponse, type context_ArchivePlanResponseNonNullableFields as ArchivePlanResponseNonNullableFields, context_ArchivedFilter as ArchivedFilter, type context_ArrangePlansRequest as ArrangePlansRequest, type context_ArrangePlansResponse as ArrangePlansResponse, type context_BaseEventMetadata as BaseEventMetadata, type context_BulkActionMetadata as BulkActionMetadata, type context_BulkArchivePlanRequest as BulkArchivePlanRequest, type context_BulkArchivePlanResponse as BulkArchivePlanResponse, type context_BulkPlanResult as BulkPlanResult, type context_BuyerCanCancelUpdated as BuyerCanCancelUpdated, type context_ClearPrimaryRequest as ClearPrimaryRequest, type context_ClearPrimaryResponse as ClearPrimaryResponse, type context_CountPlansRequest as CountPlansRequest, type context_CountPlansResponse as CountPlansResponse, type context_CreatePlanRequest as CreatePlanRequest, type context_CreatePlanResponse as CreatePlanResponse, type context_CreatePlanResponseNonNullableFields as CreatePlanResponseNonNullableFields, type context_Cursors as Cursors, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_Duration as Duration, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_Fee as Fee, type context_FeeConfig as FeeConfig, type context_GetPlanRequest as GetPlanRequest, type context_GetPlanResponse as GetPlanResponse, type context_GetPlanResponseNonNullableFields as GetPlanResponseNonNullableFields, type context_GetPlanStatsRequest as GetPlanStatsRequest, type context_GetPlanStatsResponse as GetPlanStatsResponse, type context_GetPlanStatsResponseNonNullableFields as GetPlanStatsResponseNonNullableFields, type context_GetPlansPremiumStatusRequest as GetPlansPremiumStatusRequest, type context_GetPlansPremiumStatusResponse as GetPlansPremiumStatusResponse, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_ItemMetadata as ItemMetadata, type context_ListPlansOptions as ListPlansOptions, type context_ListPlansRequest as ListPlansRequest, type context_ListPlansResponse as ListPlansResponse, type context_ListPlansResponseNonNullableFields as ListPlansResponseNonNullableFields, type context_ListPublicPlansOptions as ListPublicPlansOptions, type context_ListPublicPlansRequest as ListPublicPlansRequest, type context_ListPublicPlansResponse as ListPublicPlansResponse, type context_ListPublicPlansResponseNonNullableFields as ListPublicPlansResponseNonNullableFields, type context_MakePlanPrimaryRequest as MakePlanPrimaryRequest, type context_MakePlanPrimaryResponse as MakePlanPrimaryResponse, type context_MakePlanPrimaryResponseNonNullableFields as MakePlanPrimaryResponseNonNullableFields, type context_MessageEnvelope as MessageEnvelope, type context_Money as Money, type context_Paging as Paging, type context_PagingMetadataV2 as PagingMetadataV2, context_PeriodUnit as PeriodUnit, type context_Plan as Plan, type context_PlanArchived as PlanArchived, type context_PlanArchivedEnvelope as PlanArchivedEnvelope, type context_PlanBuyerCanCancelUpdatedEnvelope as PlanBuyerCanCancelUpdatedEnvelope, type context_PlanCreatedEnvelope as PlanCreatedEnvelope, type context_PlanNonNullableFields as PlanNonNullableFields, type context_PlanUpdatedEnvelope as PlanUpdatedEnvelope, type context_PlansQueryBuilder as PlansQueryBuilder, type context_PlansQueryResult as PlansQueryResult, type context_Pricing as Pricing, type context_PricingPricingModelOneOf as PricingPricingModelOneOf, context_PublicFilter as PublicFilter, type context_PublicPlan as PublicPlan, type context_QueryPlansRequest as QueryPlansRequest, type context_QueryPlansResponse as QueryPlansResponse, type context_QueryPublicPlansRequest as QueryPublicPlansRequest, type context_QueryPublicPlansResponse as QueryPublicPlansResponse, type context_QueryPublicPlansResponseNonNullableFields as QueryPublicPlansResponseNonNullableFields, type context_QueryV2 as QueryV2, type context_Recurrence as Recurrence, type context_RestoreInfo as RestoreInfo, type context_SearchPlansRequest as SearchPlansRequest, type context_SearchPlansResponse as SearchPlansResponse, type context_SetPlanVisibilityRequest as SetPlanVisibilityRequest, type context_SetPlanVisibilityResponse as SetPlanVisibilityResponse, type context_SetPlanVisibilityResponseNonNullableFields as SetPlanVisibilityResponseNonNullableFields, context_SortOrder as SortOrder, type context_Sorting as Sorting, type context_StringList as StringList, type context_UpdatePlan as UpdatePlan, type context_UpdatePlanRequest as UpdatePlanRequest, type context_UpdatePlanResponse as UpdatePlanResponse, type context_UpdatePlanResponseNonNullableFields as UpdatePlanResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnPlanArchivedType as _publicOnPlanArchivedType, type context__publicOnPlanBuyerCanCancelUpdatedType as _publicOnPlanBuyerCanCancelUpdatedType, type context__publicOnPlanCreatedType as _publicOnPlanCreatedType, type context__publicOnPlanUpdatedType as _publicOnPlanUpdatedType, context_archivePlan as archivePlan, context_clearPrimary as clearPrimary, context_createPlan as createPlan, context_getPlan as getPlan, context_getPlanStats as getPlanStats, context_listPlans as listPlans, context_listPublicPlans as listPublicPlans, context_makePlanPrimary as makePlanPrimary, context_onPlanArchived as onPlanArchived, context_onPlanBuyerCanCancelUpdated as onPlanBuyerCanCancelUpdated, context_onPlanCreated as onPlanCreated, context_onPlanUpdated as onPlanUpdated, onPlanArchived$1 as publicOnPlanArchived, onPlanBuyerCanCancelUpdated$1 as publicOnPlanBuyerCanCancelUpdated, onPlanCreated$1 as publicOnPlanCreated, onPlanUpdated$1 as publicOnPlanUpdated, context_queryPublicPlans as queryPublicPlans, context_setPlanVisibility as setPlanVisibility, context_updatePlan as updatePlan };
3907
+ export { type context_ActionEvent as ActionEvent, type context_ApplicationError as ApplicationError, context_AppliedAt as AppliedAt, type context_ArchivePlanRequest as ArchivePlanRequest, type context_ArchivePlanResponse as ArchivePlanResponse, type context_ArchivePlanResponseNonNullableFields as ArchivePlanResponseNonNullableFields, context_ArchivedFilter as ArchivedFilter, type context_ArrangePlansRequest as ArrangePlansRequest, type context_ArrangePlansResponse as ArrangePlansResponse, type context_BaseEventMetadata as BaseEventMetadata, type context_BulkActionMetadata as BulkActionMetadata, type context_BulkArchivePlanRequest as BulkArchivePlanRequest, type context_BulkArchivePlanResponse as BulkArchivePlanResponse, type context_BulkPlanResult as BulkPlanResult, type context_BuyerCanCancelUpdated as BuyerCanCancelUpdated, type context_ClearPrimaryRequest as ClearPrimaryRequest, type context_ClearPrimaryResponse as ClearPrimaryResponse, type context_CountPlansRequest as CountPlansRequest, type context_CountPlansResponse as CountPlansResponse, type context_CreatePlanRequest as CreatePlanRequest, type context_CreatePlanResponse as CreatePlanResponse, type context_CreatePlanResponseNonNullableFields as CreatePlanResponseNonNullableFields, type context_Cursors as Cursors, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_Duration as Duration, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_Fee as Fee, type context_FeeConfig as FeeConfig, type context_GetPlanRequest as GetPlanRequest, type context_GetPlanResponse as GetPlanResponse, type context_GetPlanResponseNonNullableFields as GetPlanResponseNonNullableFields, type context_GetPlanStatsRequest as GetPlanStatsRequest, type context_GetPlanStatsResponse as GetPlanStatsResponse, type context_GetPlanStatsResponseNonNullableFields as GetPlanStatsResponseNonNullableFields, type context_GetPlansPremiumStatusRequest as GetPlansPremiumStatusRequest, type context_GetPlansPremiumStatusResponse as GetPlansPremiumStatusResponse, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_ItemMetadata as ItemMetadata, type context_ListPlansOptions as ListPlansOptions, type context_ListPlansRequest as ListPlansRequest, type context_ListPlansResponse as ListPlansResponse, type context_ListPlansResponseNonNullableFields as ListPlansResponseNonNullableFields, type context_ListPublicPlansOptions as ListPublicPlansOptions, type context_ListPublicPlansRequest as ListPublicPlansRequest, type context_ListPublicPlansResponse as ListPublicPlansResponse, type context_ListPublicPlansResponseNonNullableFields as ListPublicPlansResponseNonNullableFields, type context_MakePlanPrimaryRequest as MakePlanPrimaryRequest, type context_MakePlanPrimaryResponse as MakePlanPrimaryResponse, type context_MakePlanPrimaryResponseNonNullableFields as MakePlanPrimaryResponseNonNullableFields, type context_MessageEnvelope as MessageEnvelope, type context_Money as Money, type context_Paging as Paging, type context_PagingMetadataV2 as PagingMetadataV2, context_PeriodUnit as PeriodUnit, type context_Plan as Plan, type context_PlanArchived as PlanArchived, type context_PlanArchivedEnvelope as PlanArchivedEnvelope, type context_PlanBuyerCanCancelUpdatedEnvelope as PlanBuyerCanCancelUpdatedEnvelope, type context_PlanCreatedEnvelope as PlanCreatedEnvelope, type context_PlanNonNullableFields as PlanNonNullableFields, type context_PlanUpdatedEnvelope as PlanUpdatedEnvelope, type context_PlansQueryBuilder as PlansQueryBuilder, type context_PlansQueryResult as PlansQueryResult, type context_Pricing as Pricing, type context_PricingPricingModelOneOf as PricingPricingModelOneOf, context_PublicFilter as PublicFilter, type context_PublicPlan as PublicPlan, type context_QueryPublicPlansRequest as QueryPublicPlansRequest, type context_QueryPublicPlansResponse as QueryPublicPlansResponse, type context_QueryPublicPlansResponseNonNullableFields as QueryPublicPlansResponseNonNullableFields, type context_QueryV2 as QueryV2, type context_Recurrence as Recurrence, type context_RestoreInfo as RestoreInfo, type context_SearchPlansRequest as SearchPlansRequest, type context_SearchPlansResponse as SearchPlansResponse, type context_SetPlanVisibilityRequest as SetPlanVisibilityRequest, type context_SetPlanVisibilityResponse as SetPlanVisibilityResponse, type context_SetPlanVisibilityResponseNonNullableFields as SetPlanVisibilityResponseNonNullableFields, context_SortOrder as SortOrder, type context_Sorting as Sorting, type context_StringList as StringList, type context_UpdatePlan as UpdatePlan, type context_UpdatePlanRequest as UpdatePlanRequest, type context_UpdatePlanResponse as UpdatePlanResponse, type context_UpdatePlanResponseNonNullableFields as UpdatePlanResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnPlanArchivedType as _publicOnPlanArchivedType, type context__publicOnPlanBuyerCanCancelUpdatedType as _publicOnPlanBuyerCanCancelUpdatedType, type context__publicOnPlanCreatedType as _publicOnPlanCreatedType, type context__publicOnPlanUpdatedType as _publicOnPlanUpdatedType, context_archivePlan as archivePlan, context_clearPrimary as clearPrimary, context_createPlan as createPlan, context_getPlan as getPlan, context_getPlanStats as getPlanStats, context_listPlans as listPlans, context_listPublicPlans as listPublicPlans, context_makePlanPrimary as makePlanPrimary, context_onPlanArchived as onPlanArchived, context_onPlanBuyerCanCancelUpdated as onPlanBuyerCanCancelUpdated, context_onPlanCreated as onPlanCreated, context_onPlanUpdated as onPlanUpdated, onPlanArchived$1 as publicOnPlanArchived, onPlanBuyerCanCancelUpdated$1 as publicOnPlanBuyerCanCancelUpdated, onPlanCreated$1 as publicOnPlanCreated, onPlanUpdated$1 as publicOnPlanUpdated, context_queryPublicPlans as queryPublicPlans, context_setPlanVisibility as setPlanVisibility, context_updatePlan as updatePlan };
3562
3908
  }
3563
3909
 
3564
3910
  export { context$1 as orders, context as plans };