@wix/pricing-plans 1.0.99 → 1.0.100

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$1<T, H extends Host$1> = {
1
+ type HostModule<T, H extends Host> = {
2
2
  __type: 'host';
3
3
  create(host: H): T;
4
4
  };
5
- type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
6
- type Host$1<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;
@@ -12,6 +12,10 @@ type Host$1<Environment = unknown> = {
12
12
  }>;
13
13
  };
14
14
  environment?: Environment;
15
+ /**
16
+ * Optional name of the environment, use for logging
17
+ */
18
+ name?: string;
15
19
  /**
16
20
  * Optional bast url to use for API requests, for example `www.wixapis.com`
17
21
  */
@@ -36,92 +40,92 @@ type Host$1<Environment = unknown> = {
36
40
  };
37
41
  };
38
42
 
39
- type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
40
- interface HttpClient$1 {
41
- request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
43
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
+ interface HttpClient {
45
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
42
46
  fetchWithAuth: typeof fetch;
43
47
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
48
  getActiveToken?: () => string | undefined;
45
49
  }
46
- type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
47
- type HttpResponse$1<T = any> = {
50
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
+ type HttpResponse<T = any> = {
48
52
  data: T;
49
53
  status: number;
50
54
  statusText: string;
51
55
  headers: any;
52
56
  request?: any;
53
57
  };
54
- type RequestOptions$1<_TResponse = any, Data = any> = {
58
+ type RequestOptions<_TResponse = any, Data = any> = {
55
59
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
56
60
  url: string;
57
61
  data?: Data;
58
62
  params?: URLSearchParams;
59
- } & APIMetadata$1;
60
- type APIMetadata$1 = {
63
+ } & APIMetadata;
64
+ type APIMetadata = {
61
65
  methodFqn?: string;
62
66
  entityFqdn?: string;
63
67
  packageName?: string;
64
68
  };
65
- type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
66
- type EventDefinition$3<Payload = unknown, Type extends string = string> = {
69
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
67
71
  __type: 'event-definition';
68
72
  type: Type;
69
73
  isDomainEvent?: boolean;
70
74
  transformations?: (envelope: unknown) => Payload;
71
75
  __payload: Payload;
72
76
  };
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;
77
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
76
80
 
77
- type ServicePluginMethodInput$1 = {
81
+ type ServicePluginMethodInput = {
78
82
  request: any;
79
83
  metadata: any;
80
84
  };
81
- type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
82
- type ServicePluginMethodMetadata$1 = {
85
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
+ type ServicePluginMethodMetadata = {
83
87
  name: string;
84
88
  primaryHttpMappingPath: string;
85
89
  transformations: {
86
- fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
90
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
87
91
  toREST: (...args: unknown[]) => unknown;
88
92
  };
89
93
  };
90
- type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
94
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
91
95
  __type: 'service-plugin-definition';
92
96
  componentType: string;
93
- methods: ServicePluginMethodMetadata$1[];
97
+ methods: ServicePluginMethodMetadata[];
94
98
  __contract: Contract;
95
99
  };
96
- declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
97
- type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
98
- declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
100
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
+ declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
99
103
 
100
- type RequestContext$1 = {
104
+ type RequestContext = {
101
105
  isSSR: boolean;
102
106
  host: string;
103
107
  protocol?: string;
104
108
  };
105
- type ResponseTransformer$1 = (data: any, headers?: any) => any;
109
+ type ResponseTransformer = (data: any, headers?: any) => any;
106
110
  /**
107
111
  * Ambassador request options types are copied mostly from AxiosRequestConfig.
108
112
  * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
109
113
  * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
110
114
  */
111
- type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
112
- type AmbassadorRequestOptions$1<T = any> = {
115
+ type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
+ type AmbassadorRequestOptions<T = any> = {
113
117
  _?: T;
114
118
  url?: string;
115
- method?: Method$1;
119
+ method?: Method;
116
120
  params?: any;
117
121
  data?: any;
118
- transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
122
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
119
123
  };
120
- type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
124
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
121
125
  __isAmbassador: boolean;
122
126
  };
123
- type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
124
- type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
127
+ type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
+ type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
125
129
 
126
130
  declare global {
127
131
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -130,7 +134,7 @@ declare global {
130
134
  }
131
135
  }
132
136
 
133
- declare const emptyObjectSymbol$1: unique symbol;
137
+ declare const emptyObjectSymbol: unique symbol;
134
138
 
135
139
  /**
136
140
  Represents a strictly empty plain object, the `{}` value.
@@ -158,7 +162,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
158
162
 
159
163
  @category Object
160
164
  */
161
- type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
165
+ type EmptyObject = {[emptyObjectSymbol]?: never};
162
166
 
163
167
  /**
164
168
  Returns a boolean for whether the two given types are equal.
@@ -186,7 +190,7 @@ type Includes<Value extends readonly any[], Item> =
186
190
  @category Type Guard
187
191
  @category Utilities
188
192
  */
189
- type IsEqual$1<A, B> =
193
+ type IsEqual<A, B> =
190
194
  (<G>() => G extends A ? 1 : 2) extends
191
195
  (<G>() => G extends B ? 1 : 2)
192
196
  ? true
@@ -219,9 +223,9 @@ type Filtered = Filter<'bar', 'foo'>;
219
223
 
220
224
  @see {Except}
221
225
  */
222
- type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
226
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
227
 
224
- type ExceptOptions$1 = {
228
+ type ExceptOptions = {
225
229
  /**
226
230
  Disallow assigning non-specified properties.
227
231
 
@@ -265,12 +269,78 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
265
269
 
266
270
  @category Object
267
271
  */
268
- type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
269
- [KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
272
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
270
274
  } & (Options['requireExactProps'] extends true
271
275
  ? Partial<Record<KeysType, never>>
272
276
  : {});
273
277
 
278
+ /**
279
+ Returns a boolean for whether the given type is `never`.
280
+
281
+ @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
+ @link https://stackoverflow.com/a/53984913/10292952
283
+ @link https://www.zhenghao.io/posts/ts-never
284
+
285
+ Useful in type utilities, such as checking if something does not occur.
286
+
287
+ @example
288
+ ```
289
+ import type {IsNever, And} from 'type-fest';
290
+
291
+ // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
+ type AreStringsEqual<A extends string, B extends string> =
293
+ And<
294
+ IsNever<Exclude<A, B>> extends true ? true : false,
295
+ IsNever<Exclude<B, A>> extends true ? true : false
296
+ >;
297
+
298
+ type EndIfEqual<I extends string, O extends string> =
299
+ AreStringsEqual<I, O> extends true
300
+ ? never
301
+ : void;
302
+
303
+ function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
+ if (input === output) {
305
+ process.exit(0);
306
+ }
307
+ }
308
+
309
+ endIfEqual('abc', 'abc');
310
+ //=> never
311
+
312
+ endIfEqual('abc', '123');
313
+ //=> void
314
+ ```
315
+
316
+ @category Type Guard
317
+ @category Utilities
318
+ */
319
+ type IsNever<T> = [T] extends [never] ? true : false;
320
+
321
+ /**
322
+ An if-else-like type that resolves depending on whether the given type is `never`.
323
+
324
+ @see {@link IsNever}
325
+
326
+ @example
327
+ ```
328
+ import type {IfNever} from 'type-fest';
329
+
330
+ type ShouldBeTrue = IfNever<never>;
331
+ //=> true
332
+
333
+ type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
+ //=> 'bar'
335
+ ```
336
+
337
+ @category Type Guard
338
+ @category Utilities
339
+ */
340
+ type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
+ IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
+ );
343
+
274
344
  /**
275
345
  Extract the keys from a type where the value type of the key extends the given `Condition`.
276
346
 
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
303
373
 
304
374
  @category Object
305
375
  */
306
- type ConditionalKeys$1<Base, Condition> = NonNullable<
307
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
376
+ type ConditionalKeys<Base, Condition> =
308
377
  {
309
378
  // Map through all the keys of the given base type.
310
- [Key in keyof Base]:
379
+ [Key in keyof Base]-?:
311
380
  // Pick only keys with types extending the given `Condition` type.
312
381
  Base[Key] extends Condition
313
- // Retain this key since the condition passes.
314
- ? Key
382
+ // Retain this key
383
+ // If the value for the key extends never, only include it if `Condition` also extends never
384
+ ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
315
385
  // Discard this key since the condition fails.
316
386
  : never;
317
-
318
387
  // Convert the produced object into a union type of the keys which passed the conditional test.
319
- }[keyof Base]
320
- >;
388
+ }[keyof Base];
321
389
 
322
390
  /**
323
391
  Exclude keys from a shape that matches the given `Condition`.
@@ -357,9 +425,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
357
425
 
358
426
  @category Object
359
427
  */
360
- type ConditionalExcept$1<Base, Condition> = Except$1<
428
+ type ConditionalExcept<Base, Condition> = Except<
361
429
  Base,
362
- ConditionalKeys$1<Base, Condition>
430
+ ConditionalKeys<Base, Condition>
363
431
  >;
364
432
 
365
433
  /**
@@ -367,8 +435,8 @@ ConditionalKeys$1<Base, Condition>
367
435
  * can either be a REST module or a host module.
368
436
  * This type is recursive, so it can describe nested modules.
369
437
  */
370
- type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$3<any> | ServicePluginDefinition$1<any> | {
371
- [key: string]: Descriptors$1 | PublicMetadata$1 | any;
438
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
+ [key: string]: Descriptors | PublicMetadata | any;
372
440
  };
373
441
  /**
374
442
  * This type takes in a descriptors object of a certain Host (including an `unknown` host)
@@ -376,12 +444,12 @@ type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 |
376
444
  * Any non-descriptor properties are removed from the returned object, including descriptors that
377
445
  * do not match the given host (as they will not work with the given host).
378
446
  */
379
- type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
447
+ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
380
448
  done: T;
381
449
  recurse: T extends {
382
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
383
- } ? 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<{
384
- [Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
450
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
451
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
452
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
453
  -1,
386
454
  0,
387
455
  1,
@@ -390,9 +458,9 @@ type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefin
390
458
  4,
391
459
  5
392
460
  ][Depth]> : never;
393
- }, EmptyObject$1>;
461
+ }, EmptyObject>;
394
462
  }[Depth extends -1 ? 'done' : 'recurse'];
395
- type PublicMetadata$1 = {
463
+ type PublicMetadata = {
396
464
  PACKAGE_NAME?: string;
397
465
  };
398
466
 
@@ -404,9 +472,9 @@ declare global {
404
472
  * A type used to create concerete types from SDK descriptors in
405
473
  * case a contextual client is available.
406
474
  */
407
- type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
408
- host: Host$1;
409
- } ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
475
+ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
+ host: Host;
477
+ } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
410
478
 
411
479
  /**
412
480
  * An order object includes all of the details related to the purchase of a Pricing Plan.
@@ -512,7 +580,7 @@ interface Order {
512
580
  * Start date and time for the ordered plan.
513
581
  * @readonly
514
582
  */
515
- startDate?: Date;
583
+ startDate?: Date | null;
516
584
  /**
517
585
  * Current end date and time for the ordered plan.
518
586
  *
@@ -522,7 +590,7 @@ interface Order {
522
590
  * Omitted if the order is valid until canceled and still `ACTIVE`.
523
591
  * @readonly
524
592
  */
525
- endDate?: Date;
593
+ endDate?: Date | null;
526
594
  /**
527
595
  * List of periods during which the order is paused.
528
596
  * @readonly
@@ -541,7 +609,7 @@ interface Order {
541
609
  * Calculated by using the original end date plus any pause periods. Omitted if the order is active until canceled. Reserved for future use.
542
610
  * @readonly
543
611
  */
544
- earliestEndDate?: Date;
612
+ earliestEndDate?: Date | null;
545
613
  /**
546
614
  * Current payment cycle for the order.
547
615
  *
@@ -568,12 +636,12 @@ interface Order {
568
636
  * Date and time the order was created.
569
637
  * @readonly
570
638
  */
571
- _createdDate?: Date;
639
+ _createdDate?: Date | null;
572
640
  /**
573
641
  * Date and time the order was updated.
574
642
  * @readonly
575
643
  */
576
- _updatedDate?: Date;
644
+ _updatedDate?: Date | null;
577
645
  /**
578
646
  * Information about the form submitted during the plan's checkout.
579
647
  * @readonly
@@ -793,7 +861,7 @@ declare enum OrderStatus {
793
861
  }
794
862
  interface Cancellation {
795
863
  /** Date and time the cancellation was requested. */
796
- requestedDate?: Date;
864
+ requestedDate?: Date | null;
797
865
  /**
798
866
  * Reason for the cancellation. One of:
799
867
  * + `OWNER_ACTION`: Site owner canceled the order.
@@ -856,13 +924,13 @@ interface PausePeriod {
856
924
  */
857
925
  status?: Status;
858
926
  /** Start date and time of the pause period. */
859
- pauseDate?: Date;
927
+ pauseDate?: Date | null;
860
928
  /**
861
929
  * End date and time of the pause period.
862
930
  *
863
931
  * Omitted while the pause period remains `ACTIVE`.
864
932
  */
865
- resumeDate?: Date;
933
+ resumeDate?: Date | null;
866
934
  }
867
935
  declare enum Status {
868
936
  UNDEFINED = "UNDEFINED",
@@ -883,9 +951,9 @@ interface CurrentCycle {
883
951
  */
884
952
  index?: number;
885
953
  /** Start date and time for the current payment cycle. */
886
- startedDate?: Date;
954
+ startedDate?: Date | null;
887
955
  /** End date and time for the current payment cycle. */
888
- endedDate?: Date;
956
+ endedDate?: Date | null;
889
957
  }
890
958
  /** Order cycle start and end dates take into account free trial days and suspensions */
891
959
  interface OrderCycle {
@@ -896,9 +964,9 @@ interface OrderCycle {
896
964
  */
897
965
  index?: number;
898
966
  /** Start date and time for this order cycle. */
899
- startedDate?: Date;
967
+ startedDate?: Date | null;
900
968
  /** End date and time for this order cycle. */
901
- endedDate?: Date;
969
+ endedDate?: Date | null;
902
970
  }
903
971
  interface FormData {
904
972
  /** ID of the form associated with the plan at checkout. */
@@ -938,7 +1006,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
938
1006
  /** ID of the entity associated with the event. */
939
1007
  entityId?: string;
940
1008
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
941
- eventTime?: Date;
1009
+ eventTime?: Date | null;
942
1010
  /**
943
1011
  * Whether the event was triggered as a result of a privacy regulation application
944
1012
  * (for example, GDPR).
@@ -967,7 +1035,7 @@ interface EntityCreatedEvent$1 {
967
1035
  entity?: string;
968
1036
  }
969
1037
  interface RestoreInfo$1 {
970
- deletedDate?: Date;
1038
+ deletedDate?: Date | null;
971
1039
  }
972
1040
  interface EntityUpdatedEvent$1 {
973
1041
  /**
@@ -1208,7 +1276,7 @@ interface CreateOnlineOrderRequest {
1208
1276
  *
1209
1277
  * Default: Current date
1210
1278
  */
1211
- startDate?: Date;
1279
+ startDate?: Date | null;
1212
1280
  /** Coupon code to apply. */
1213
1281
  couponCode?: string | null;
1214
1282
  /** Provided if checkout is initiated on buyer's behalf. */
@@ -1240,7 +1308,7 @@ interface CreateGuestOnlineOrderRequest {
1240
1308
  *
1241
1309
  * Default: Current date
1242
1310
  */
1243
- startDate?: Date;
1311
+ startDate?: Date | null;
1244
1312
  /** Coupon code to apply. */
1245
1313
  couponCode?: string | null;
1246
1314
  /** Captcha data to prove you are not a robot */
@@ -1272,7 +1340,7 @@ interface CreateOfflineOrderRequest {
1272
1340
  *
1273
1341
  * Default: Current date and time
1274
1342
  */
1275
- startDate?: Date;
1343
+ startDate?: Date | null;
1276
1344
  /**
1277
1345
  * Whether the order is paid.
1278
1346
  *
@@ -1310,7 +1378,7 @@ interface GetOnlineOrderPreviewRequest {
1310
1378
  *
1311
1379
  * Default: Current date
1312
1380
  */
1313
- startDate?: Date;
1381
+ startDate?: Date | null;
1314
1382
  /** Coupon code to apply. */
1315
1383
  couponCode?: string | null;
1316
1384
  }
@@ -1331,7 +1399,7 @@ interface GetGuestOnlineOrderPreviewRequest {
1331
1399
  *
1332
1400
  * Default: Current date
1333
1401
  */
1334
- startDate?: Date;
1402
+ startDate?: Date | null;
1335
1403
  /** Coupon code to apply. */
1336
1404
  couponCode?: string | null;
1337
1405
  /** Email for checkout */
@@ -1356,7 +1424,7 @@ interface GetOfflineOrderPreviewRequest {
1356
1424
  *
1357
1425
  * Default: Current date and time
1358
1426
  */
1359
- startDate?: Date;
1427
+ startDate?: Date | null;
1360
1428
  /** Coupon code to apply. See [Coupons to learn more](https://dev.wix.com/api/rest/coupons). */
1361
1429
  couponCode?: string | null;
1362
1430
  }
@@ -1397,7 +1465,7 @@ interface ChangeStartDateRequest {
1397
1465
  /** Draft order ID. */
1398
1466
  orderId?: string;
1399
1467
  /** New valid from date (timestamp). */
1400
- startDate?: Date;
1468
+ startDate?: Date | null;
1401
1469
  }
1402
1470
  interface ChangeStartDateResponse {
1403
1471
  /** Updated draft order. */
@@ -1571,7 +1639,7 @@ interface PostponeEndDateRequest {
1571
1639
  *
1572
1640
  * Must be later than the current end date and time.
1573
1641
  */
1574
- endDate: Date;
1642
+ endDate: Date | null;
1575
1643
  }
1576
1644
  interface PostponeEndDateResponse {
1577
1645
  }
@@ -1821,7 +1889,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
1821
1889
  /** ID of the entity associated with the event. */
1822
1890
  entityId?: string;
1823
1891
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1824
- eventTime?: Date;
1892
+ eventTime?: Date | null;
1825
1893
  /**
1826
1894
  * Whether the event was triggered as a result of a privacy regulation application
1827
1895
  * (for example, GDPR).
@@ -1977,7 +2045,7 @@ interface CreateOfflineOrderOptions {
1977
2045
  *
1978
2046
  * Default: Current date and time
1979
2047
  */
1980
- startDate?: Date;
2048
+ startDate?: Date | null;
1981
2049
  /**
1982
2050
  * Whether the order is paid.
1983
2051
  *
@@ -1995,7 +2063,7 @@ interface GetOfflineOrderPreviewOptions {
1995
2063
  *
1996
2064
  * Default: Current date and time
1997
2065
  */
1998
- startDate?: Date;
2066
+ startDate?: Date | null;
1999
2067
  /** Coupon code to apply. */
2000
2068
  couponCode?: string | null;
2001
2069
  }
@@ -2070,7 +2138,7 @@ interface ManagementListOrdersOptions {
2070
2138
  fieldSet?: Set;
2071
2139
  }
2072
2140
 
2073
- declare function memberGetOrder$1(httpClient: HttpClient$1): MemberGetOrderSignature;
2141
+ declare function memberGetOrder$1(httpClient: HttpClient): MemberGetOrderSignature;
2074
2142
  interface MemberGetOrderSignature {
2075
2143
  /**
2076
2144
  * Gets an order by ID for the currently logged-in member.
@@ -2082,7 +2150,7 @@ interface MemberGetOrderSignature {
2082
2150
  */
2083
2151
  (_id: string, options?: MemberGetOrderOptions | undefined): Promise<Order & OrderNonNullableFields>;
2084
2152
  }
2085
- declare function memberListOrders$1(httpClient: HttpClient$1): MemberListOrdersSignature;
2153
+ declare function memberListOrders$1(httpClient: HttpClient): MemberListOrdersSignature;
2086
2154
  interface MemberListOrdersSignature {
2087
2155
  /**
2088
2156
  * Lists orders for the currently logged-in member.
@@ -2092,7 +2160,7 @@ interface MemberListOrdersSignature {
2092
2160
  */
2093
2161
  (options?: MemberListOrdersOptions | undefined): Promise<MemberListOrdersResponse & MemberListOrdersResponseNonNullableFields>;
2094
2162
  }
2095
- declare function requestCancellation$1(httpClient: HttpClient$1): RequestCancellationSignature;
2163
+ declare function requestCancellation$1(httpClient: HttpClient): RequestCancellationSignature;
2096
2164
  interface RequestCancellationSignature {
2097
2165
  /**
2098
2166
  * Starts the process of canceling an order.
@@ -2120,7 +2188,7 @@ interface RequestCancellationSignature {
2120
2188
  */
2121
2189
  (_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
2122
2190
  }
2123
- declare function createOfflineOrder$1(httpClient: HttpClient$1): CreateOfflineOrderSignature;
2191
+ declare function createOfflineOrder$1(httpClient: HttpClient): CreateOfflineOrderSignature;
2124
2192
  interface CreateOfflineOrderSignature {
2125
2193
  /**
2126
2194
  * Creates an order for a buyer who purchased the plan with an offline transaction.
@@ -2145,7 +2213,7 @@ interface CreateOfflineOrderSignature {
2145
2213
  */
2146
2214
  (planId: string, memberId: string, options?: CreateOfflineOrderOptions | undefined): Promise<CreateOfflineOrderResponse & CreateOfflineOrderResponseNonNullableFields>;
2147
2215
  }
2148
- declare function getOfflineOrderPreview$1(httpClient: HttpClient$1): GetOfflineOrderPreviewSignature;
2216
+ declare function getOfflineOrderPreview$1(httpClient: HttpClient): GetOfflineOrderPreviewSignature;
2149
2217
  interface GetOfflineOrderPreviewSignature {
2150
2218
  /**
2151
2219
  * Provides a preview of an offline order as if it was purchased.
@@ -2164,7 +2232,7 @@ interface GetOfflineOrderPreviewSignature {
2164
2232
  */
2165
2233
  (planId: string, memberId: string, options?: GetOfflineOrderPreviewOptions | undefined): Promise<GetOfflineOrderPreviewResponse & GetOfflineOrderPreviewResponseNonNullableFields>;
2166
2234
  }
2167
- declare function getPricePreview$1(httpClient: HttpClient$1): GetPricePreviewSignature;
2235
+ declare function getPricePreview$1(httpClient: HttpClient): GetPricePreviewSignature;
2168
2236
  interface GetPricePreviewSignature {
2169
2237
  /**
2170
2238
  * Retrieves a preview of an order's pricing as if it was purchased.
@@ -2180,7 +2248,7 @@ interface GetPricePreviewSignature {
2180
2248
  */
2181
2249
  (planId: string, options?: GetPricePreviewOptions | undefined): Promise<GetPricePreviewResponse & GetPricePreviewResponseNonNullableFields>;
2182
2250
  }
2183
- declare function managementGetOrder$1(httpClient: HttpClient$1): ManagementGetOrderSignature;
2251
+ declare function managementGetOrder$1(httpClient: HttpClient): ManagementGetOrderSignature;
2184
2252
  interface ManagementGetOrderSignature {
2185
2253
  /**
2186
2254
  * Retrieves an order by ID.
@@ -2191,7 +2259,7 @@ interface ManagementGetOrderSignature {
2191
2259
  */
2192
2260
  (_id: string, options?: ManagementGetOrderOptions | undefined): Promise<GetOrderResponse & GetOrderResponseNonNullableFields>;
2193
2261
  }
2194
- declare function managementListOrders$1(httpClient: HttpClient$1): ManagementListOrdersSignature;
2262
+ declare function managementListOrders$1(httpClient: HttpClient): ManagementListOrdersSignature;
2195
2263
  interface ManagementListOrdersSignature {
2196
2264
  /**
2197
2265
  * Lists pricing plan orders.
@@ -2203,7 +2271,7 @@ interface ManagementListOrdersSignature {
2203
2271
  */
2204
2272
  (options?: ManagementListOrdersOptions | undefined): Promise<ListOrdersResponse & ListOrdersResponseNonNullableFields>;
2205
2273
  }
2206
- declare function postponeEndDate$1(httpClient: HttpClient$1): PostponeEndDateSignature;
2274
+ declare function postponeEndDate$1(httpClient: HttpClient): PostponeEndDateSignature;
2207
2275
  interface PostponeEndDateSignature {
2208
2276
  /**
2209
2277
  * Extends the duration of a pricing plan order by postponing the order's `endDate`.
@@ -2223,9 +2291,9 @@ interface PostponeEndDateSignature {
2223
2291
  * @param - Options for postponing the end date of an order.
2224
2292
  * @returns Fulfilled - When the order's end date has been postponed or made earlier.
2225
2293
  */
2226
- (_id: string, endDate: Date): Promise<void>;
2294
+ (_id: string, endDate: Date | null): Promise<void>;
2227
2295
  }
2228
- declare function cancelOrder$1(httpClient: HttpClient$1): CancelOrderSignature;
2296
+ declare function cancelOrder$1(httpClient: HttpClient): CancelOrderSignature;
2229
2297
  interface CancelOrderSignature {
2230
2298
  /**
2231
2299
  * Cancels an existing order.
@@ -2256,7 +2324,7 @@ interface CancelOrderSignature {
2256
2324
  */
2257
2325
  (_id: string, effectiveAt: CancellationEffectiveAt): Promise<void>;
2258
2326
  }
2259
- declare function markAsPaid$1(httpClient: HttpClient$1): MarkAsPaidSignature;
2327
+ declare function markAsPaid$1(httpClient: HttpClient): MarkAsPaidSignature;
2260
2328
  interface MarkAsPaidSignature {
2261
2329
  /**
2262
2330
  * Marks an offline order as paid.
@@ -2279,7 +2347,7 @@ interface MarkAsPaidSignature {
2279
2347
  */
2280
2348
  (_id: string): Promise<void>;
2281
2349
  }
2282
- declare function pauseOrder$1(httpClient: HttpClient$1): PauseOrderSignature;
2350
+ declare function pauseOrder$1(httpClient: HttpClient): PauseOrderSignature;
2283
2351
  interface PauseOrderSignature {
2284
2352
  /**
2285
2353
  * Pauses a pricing plan order.
@@ -2300,7 +2368,7 @@ interface PauseOrderSignature {
2300
2368
  */
2301
2369
  (_id: string): Promise<void>;
2302
2370
  }
2303
- declare function resumeOrder$1(httpClient: HttpClient$1): ResumeOrderSignature;
2371
+ declare function resumeOrder$1(httpClient: HttpClient): ResumeOrderSignature;
2304
2372
  interface ResumeOrderSignature {
2305
2373
  /**
2306
2374
  * Resumes a paused pricing plan order.
@@ -2319,53 +2387,35 @@ interface ResumeOrderSignature {
2319
2387
  */
2320
2388
  (_id: string): Promise<void>;
2321
2389
  }
2322
- declare const onOrderCanceled$1: EventDefinition$3<OrderCanceledEnvelope, "wix.pricing_plans.v2.order_canceled">;
2323
- declare const onOrderCreated$1: EventDefinition$3<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
2324
- declare const onOrderUpdated$1: EventDefinition$3<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
2325
- declare const onOrderStartDateChanged$1: EventDefinition$3<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
2326
- declare const onOrderPurchased$1: EventDefinition$3<OrderPurchasedEnvelope, "wix.pricing_plans.v2.order_purchased">;
2327
- declare const onOrderStarted$1: EventDefinition$3<OrderStartedEnvelope, "wix.pricing_plans.v2.order_started">;
2328
- declare const onOrderCycleStarted$1: EventDefinition$3<OrderCycleStartedEnvelope, "wix.pricing_plans.v2.order_cycle_started">;
2329
- declare const onOrderAutoRenewCanceled$1: EventDefinition$3<OrderAutoRenewCanceledEnvelope, "wix.pricing_plans.v2.order_auto_renew_canceled">;
2330
- declare const onOrderEnded$1: EventDefinition$3<OrderEndedEnvelope, "wix.pricing_plans.v2.order_ended">;
2331
- declare const onOrderEndDatePostponed$1: EventDefinition$3<OrderEndDatePostponedEnvelope, "wix.pricing_plans.v2.order_end_date_postponed">;
2332
- declare const onOrderMarkedAsPaid$1: EventDefinition$3<OrderMarkedAsPaidEnvelope, "wix.pricing_plans.v2.order_marked_as_paid">;
2333
- declare const onOrderPaused$1: EventDefinition$3<OrderPausedEnvelope, "wix.pricing_plans.v2.order_paused">;
2334
- declare const onOrderResumed$1: EventDefinition$3<OrderResumedEnvelope, "wix.pricing_plans.v2.order_resumed">;
2335
-
2336
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
2337
- __type: 'event-definition';
2338
- type: Type;
2339
- isDomainEvent?: boolean;
2340
- transformations?: (envelope: unknown) => Payload;
2341
- __payload: Payload;
2342
- };
2343
- declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
2344
- type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
2345
- type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
2346
-
2347
- declare global {
2348
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2349
- interface SymbolConstructor {
2350
- readonly observable: symbol;
2351
- }
2352
- }
2353
-
2354
- declare function createEventModule$1<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
2355
-
2356
- declare const memberGetOrder: MaybeContext$1<BuildRESTFunction$1<typeof memberGetOrder$1> & typeof memberGetOrder$1>;
2357
- declare const memberListOrders: MaybeContext$1<BuildRESTFunction$1<typeof memberListOrders$1> & typeof memberListOrders$1>;
2358
- declare const requestCancellation: MaybeContext$1<BuildRESTFunction$1<typeof requestCancellation$1> & typeof requestCancellation$1>;
2359
- declare const createOfflineOrder: MaybeContext$1<BuildRESTFunction$1<typeof createOfflineOrder$1> & typeof createOfflineOrder$1>;
2360
- declare const getOfflineOrderPreview: MaybeContext$1<BuildRESTFunction$1<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1>;
2361
- declare const getPricePreview: MaybeContext$1<BuildRESTFunction$1<typeof getPricePreview$1> & typeof getPricePreview$1>;
2362
- declare const managementGetOrder: MaybeContext$1<BuildRESTFunction$1<typeof managementGetOrder$1> & typeof managementGetOrder$1>;
2363
- declare const managementListOrders: MaybeContext$1<BuildRESTFunction$1<typeof managementListOrders$1> & typeof managementListOrders$1>;
2364
- declare const postponeEndDate: MaybeContext$1<BuildRESTFunction$1<typeof postponeEndDate$1> & typeof postponeEndDate$1>;
2365
- declare const cancelOrder: MaybeContext$1<BuildRESTFunction$1<typeof cancelOrder$1> & typeof cancelOrder$1>;
2366
- declare const markAsPaid: MaybeContext$1<BuildRESTFunction$1<typeof markAsPaid$1> & typeof markAsPaid$1>;
2367
- declare const pauseOrder: MaybeContext$1<BuildRESTFunction$1<typeof pauseOrder$1> & typeof pauseOrder$1>;
2368
- declare const resumeOrder: MaybeContext$1<BuildRESTFunction$1<typeof resumeOrder$1> & typeof resumeOrder$1>;
2390
+ declare const onOrderCanceled$1: EventDefinition<OrderCanceledEnvelope, "wix.pricing_plans.v2.order_canceled">;
2391
+ declare const onOrderCreated$1: EventDefinition<OrderCreatedEnvelope, "wix.pricing_plans.v2.order_created">;
2392
+ declare const onOrderUpdated$1: EventDefinition<OrderUpdatedEnvelope, "wix.pricing_plans.v2.order_updated">;
2393
+ declare const onOrderStartDateChanged$1: EventDefinition<OrderStartDateChangedEnvelope, "wix.pricing_plans.v2.order_start_date_changed">;
2394
+ declare const onOrderPurchased$1: EventDefinition<OrderPurchasedEnvelope, "wix.pricing_plans.v2.order_purchased">;
2395
+ declare const onOrderStarted$1: EventDefinition<OrderStartedEnvelope, "wix.pricing_plans.v2.order_started">;
2396
+ declare const onOrderCycleStarted$1: EventDefinition<OrderCycleStartedEnvelope, "wix.pricing_plans.v2.order_cycle_started">;
2397
+ declare const onOrderAutoRenewCanceled$1: EventDefinition<OrderAutoRenewCanceledEnvelope, "wix.pricing_plans.v2.order_auto_renew_canceled">;
2398
+ declare const onOrderEnded$1: EventDefinition<OrderEndedEnvelope, "wix.pricing_plans.v2.order_ended">;
2399
+ declare const onOrderEndDatePostponed$1: EventDefinition<OrderEndDatePostponedEnvelope, "wix.pricing_plans.v2.order_end_date_postponed">;
2400
+ declare const onOrderMarkedAsPaid$1: EventDefinition<OrderMarkedAsPaidEnvelope, "wix.pricing_plans.v2.order_marked_as_paid">;
2401
+ declare const onOrderPaused$1: EventDefinition<OrderPausedEnvelope, "wix.pricing_plans.v2.order_paused">;
2402
+ declare const onOrderResumed$1: EventDefinition<OrderResumedEnvelope, "wix.pricing_plans.v2.order_resumed">;
2403
+
2404
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2405
+
2406
+ declare const memberGetOrder: MaybeContext<BuildRESTFunction<typeof memberGetOrder$1> & typeof memberGetOrder$1>;
2407
+ declare const memberListOrders: MaybeContext<BuildRESTFunction<typeof memberListOrders$1> & typeof memberListOrders$1>;
2408
+ declare const requestCancellation: MaybeContext<BuildRESTFunction<typeof requestCancellation$1> & typeof requestCancellation$1>;
2409
+ declare const createOfflineOrder: MaybeContext<BuildRESTFunction<typeof createOfflineOrder$1> & typeof createOfflineOrder$1>;
2410
+ declare const getOfflineOrderPreview: MaybeContext<BuildRESTFunction<typeof getOfflineOrderPreview$1> & typeof getOfflineOrderPreview$1>;
2411
+ declare const getPricePreview: MaybeContext<BuildRESTFunction<typeof getPricePreview$1> & typeof getPricePreview$1>;
2412
+ declare const managementGetOrder: MaybeContext<BuildRESTFunction<typeof managementGetOrder$1> & typeof managementGetOrder$1>;
2413
+ declare const managementListOrders: MaybeContext<BuildRESTFunction<typeof managementListOrders$1> & typeof managementListOrders$1>;
2414
+ declare const postponeEndDate: MaybeContext<BuildRESTFunction<typeof postponeEndDate$1> & typeof postponeEndDate$1>;
2415
+ declare const cancelOrder: MaybeContext<BuildRESTFunction<typeof cancelOrder$1> & typeof cancelOrder$1>;
2416
+ declare const markAsPaid: MaybeContext<BuildRESTFunction<typeof markAsPaid$1> & typeof markAsPaid$1>;
2417
+ declare const pauseOrder: MaybeContext<BuildRESTFunction<typeof pauseOrder$1> & typeof pauseOrder$1>;
2418
+ declare const resumeOrder: MaybeContext<BuildRESTFunction<typeof resumeOrder$1> & typeof resumeOrder$1>;
2369
2419
 
2370
2420
  type _publicOnOrderCanceledType = typeof onOrderCanceled$1;
2371
2421
  /**
@@ -2654,493 +2704,83 @@ declare namespace context$1 {
2654
2704
  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 };
2655
2705
  }
2656
2706
 
2657
- type HostModule<T, H extends Host> = {
2658
- __type: 'host';
2659
- create(host: H): T;
2660
- };
2661
- type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
2662
- type Host<Environment = unknown> = {
2663
- channel: {
2664
- observeState(callback: (props: unknown, environment: Environment) => unknown): {
2665
- disconnect: () => void;
2666
- } | Promise<{
2667
- disconnect: () => void;
2668
- }>;
2669
- };
2670
- environment?: Environment;
2707
+ /** Information about the pricing plan. */
2708
+ interface Plan {
2671
2709
  /**
2672
- * Optional bast url to use for API requests, for example `www.wixapis.com`
2710
+ * Plan ID.
2711
+ * @readonly
2673
2712
  */
2674
- apiBaseUrl?: string;
2713
+ _id?: string;
2714
+ /** Plan name. */
2715
+ name?: string | null;
2716
+ /** Plan description. */
2717
+ description?: string | null;
2675
2718
  /**
2676
- * Possible data to be provided by every host, for cross cutting concerns
2677
- * like internationalization, billing, etc.
2719
+ * List of text strings that promote what is included with this plan.
2720
+ *
2721
+ * For example, "Plenty of parking" or "Free gift on your birthday".
2678
2722
  */
2679
- essentials?: {
2680
- /**
2681
- * The language of the currently viewed session
2682
- */
2683
- language?: string;
2684
- /**
2685
- * The locale of the currently viewed session
2686
- */
2687
- locale?: string;
2688
- /**
2689
- * Any headers that should be passed through to the API requests
2690
- */
2691
- passThroughHeaders?: Record<string, string>;
2692
- };
2693
- };
2694
-
2695
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2696
- interface HttpClient {
2697
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
2698
- fetchWithAuth: typeof fetch;
2699
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
2700
- getActiveToken?: () => string | undefined;
2701
- }
2702
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
2703
- type HttpResponse<T = any> = {
2704
- data: T;
2705
- status: number;
2706
- statusText: string;
2707
- headers: any;
2708
- request?: any;
2709
- };
2710
- type RequestOptions<_TResponse = any, Data = any> = {
2711
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2712
- url: string;
2713
- data?: Data;
2714
- params?: URLSearchParams;
2715
- } & APIMetadata;
2716
- type APIMetadata = {
2717
- methodFqn?: string;
2718
- entityFqdn?: string;
2719
- packageName?: string;
2720
- };
2721
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
2722
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
2723
- __type: 'event-definition';
2724
- type: Type;
2725
- isDomainEvent?: boolean;
2726
- transformations?: (envelope: unknown) => Payload;
2727
- __payload: Payload;
2728
- };
2729
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
2730
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
2731
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
2732
-
2733
- type ServicePluginMethodInput = {
2734
- request: any;
2735
- metadata: any;
2736
- };
2737
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
2738
- type ServicePluginMethodMetadata = {
2739
- name: string;
2740
- primaryHttpMappingPath: string;
2741
- transformations: {
2742
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
2743
- toREST: (...args: unknown[]) => unknown;
2744
- };
2745
- };
2746
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
2747
- __type: 'service-plugin-definition';
2748
- componentType: string;
2749
- methods: ServicePluginMethodMetadata[];
2750
- __contract: Contract;
2751
- };
2752
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
2753
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
2754
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
2755
-
2756
- type RequestContext = {
2757
- isSSR: boolean;
2758
- host: string;
2759
- protocol?: string;
2760
- };
2761
- type ResponseTransformer = (data: any, headers?: any) => any;
2762
- /**
2763
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
2764
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
2765
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
2766
- */
2767
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
2768
- type AmbassadorRequestOptions<T = any> = {
2769
- _?: T;
2770
- url?: string;
2771
- method?: Method;
2772
- params?: any;
2773
- data?: any;
2774
- transformResponse?: ResponseTransformer | ResponseTransformer[];
2775
- };
2776
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
2777
- __isAmbassador: boolean;
2778
- };
2779
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
2780
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
2781
-
2782
- declare global {
2783
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2784
- interface SymbolConstructor {
2785
- readonly observable: symbol;
2786
- }
2787
- }
2788
-
2789
- declare const emptyObjectSymbol: unique symbol;
2790
-
2791
- /**
2792
- Represents a strictly empty plain object, the `{}` value.
2793
-
2794
- 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)).
2795
-
2796
- @example
2797
- ```
2798
- import type {EmptyObject} from 'type-fest';
2799
-
2800
- // The following illustrates the problem with `{}`.
2801
- const foo1: {} = {}; // Pass
2802
- const foo2: {} = []; // Pass
2803
- const foo3: {} = 42; // Pass
2804
- const foo4: {} = {a: 1}; // Pass
2805
-
2806
- // With `EmptyObject` only the first case is valid.
2807
- const bar1: EmptyObject = {}; // Pass
2808
- const bar2: EmptyObject = 42; // Fail
2809
- const bar3: EmptyObject = []; // Fail
2810
- const bar4: EmptyObject = {a: 1}; // Fail
2811
- ```
2812
-
2813
- 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}.
2814
-
2815
- @category Object
2816
- */
2817
- type EmptyObject = {[emptyObjectSymbol]?: never};
2818
-
2819
- /**
2820
- Returns a boolean for whether the two given types are equal.
2821
-
2822
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
2823
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
2824
-
2825
- Use-cases:
2826
- - If you want to make a conditional branch based on the result of a comparison of two types.
2827
-
2828
- @example
2829
- ```
2830
- import type {IsEqual} from 'type-fest';
2831
-
2832
- // This type returns a boolean for whether the given array includes the given item.
2833
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
2834
- type Includes<Value extends readonly any[], Item> =
2835
- Value extends readonly [Value[0], ...infer rest]
2836
- ? IsEqual<Value[0], Item> extends true
2837
- ? true
2838
- : Includes<rest, Item>
2839
- : false;
2840
- ```
2841
-
2842
- @category Type Guard
2843
- @category Utilities
2844
- */
2845
- type IsEqual<A, B> =
2846
- (<G>() => G extends A ? 1 : 2) extends
2847
- (<G>() => G extends B ? 1 : 2)
2848
- ? true
2849
- : false;
2850
-
2851
- /**
2852
- Filter out keys from an object.
2853
-
2854
- Returns `never` if `Exclude` is strictly equal to `Key`.
2855
- Returns `never` if `Key` extends `Exclude`.
2856
- Returns `Key` otherwise.
2857
-
2858
- @example
2859
- ```
2860
- type Filtered = Filter<'foo', 'foo'>;
2861
- //=> never
2862
- ```
2863
-
2864
- @example
2865
- ```
2866
- type Filtered = Filter<'bar', string>;
2867
- //=> never
2868
- ```
2869
-
2870
- @example
2871
- ```
2872
- type Filtered = Filter<'bar', 'foo'>;
2873
- //=> 'bar'
2874
- ```
2875
-
2876
- @see {Except}
2877
- */
2878
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
2879
-
2880
- type ExceptOptions = {
2881
- /**
2882
- Disallow assigning non-specified properties.
2883
-
2884
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
2885
-
2886
- @default false
2887
- */
2888
- requireExactProps?: boolean;
2889
- };
2890
-
2891
- /**
2892
- Create a type from an object type without certain keys.
2893
-
2894
- We recommend setting the `requireExactProps` option to `true`.
2895
-
2896
- 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.
2897
-
2898
- 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)).
2899
-
2900
- @example
2901
- ```
2902
- import type {Except} from 'type-fest';
2903
-
2904
- type Foo = {
2905
- a: number;
2906
- b: string;
2907
- };
2908
-
2909
- type FooWithoutA = Except<Foo, 'a'>;
2910
- //=> {b: string}
2911
-
2912
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
2913
- //=> errors: 'a' does not exist in type '{ b: string; }'
2914
-
2915
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
2916
- //=> {a: number} & Partial<Record<"b", never>>
2917
-
2918
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
2919
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
2920
- ```
2921
-
2922
- @category Object
2923
- */
2924
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
2925
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
2926
- } & (Options['requireExactProps'] extends true
2927
- ? Partial<Record<KeysType, never>>
2928
- : {});
2929
-
2930
- /**
2931
- Extract the keys from a type where the value type of the key extends the given `Condition`.
2932
-
2933
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
2934
-
2935
- @example
2936
- ```
2937
- import type {ConditionalKeys} from 'type-fest';
2938
-
2939
- interface Example {
2940
- a: string;
2941
- b: string | number;
2942
- c?: string;
2943
- d: {};
2944
- }
2945
-
2946
- type StringKeysOnly = ConditionalKeys<Example, string>;
2947
- //=> 'a'
2948
- ```
2949
-
2950
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
2951
-
2952
- @example
2953
- ```
2954
- import type {ConditionalKeys} from 'type-fest';
2955
-
2956
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
2957
- //=> 'a' | 'c'
2958
- ```
2959
-
2960
- @category Object
2961
- */
2962
- type ConditionalKeys<Base, Condition> = NonNullable<
2963
- // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
2964
- {
2965
- // Map through all the keys of the given base type.
2966
- [Key in keyof Base]:
2967
- // Pick only keys with types extending the given `Condition` type.
2968
- Base[Key] extends Condition
2969
- // Retain this key since the condition passes.
2970
- ? Key
2971
- // Discard this key since the condition fails.
2972
- : never;
2973
-
2974
- // Convert the produced object into a union type of the keys which passed the conditional test.
2975
- }[keyof Base]
2976
- >;
2977
-
2978
- /**
2979
- Exclude keys from a shape that matches the given `Condition`.
2980
-
2981
- 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.
2982
-
2983
- @example
2984
- ```
2985
- import type {Primitive, ConditionalExcept} from 'type-fest';
2986
-
2987
- class Awesome {
2988
- name: string;
2989
- successes: number;
2990
- failures: bigint;
2991
-
2992
- run() {}
2993
- }
2994
-
2995
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
2996
- //=> {run: () => void}
2997
- ```
2998
-
2999
- @example
3000
- ```
3001
- import type {ConditionalExcept} from 'type-fest';
3002
-
3003
- interface Example {
3004
- a: string;
3005
- b: string | number;
3006
- c: () => void;
3007
- d: {};
3008
- }
3009
-
3010
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
3011
- //=> {b: string | number; c: () => void; d: {}}
3012
- ```
3013
-
3014
- @category Object
3015
- */
3016
- type ConditionalExcept<Base, Condition> = Except<
3017
- Base,
3018
- ConditionalKeys<Base, Condition>
3019
- >;
3020
-
3021
- /**
3022
- * Descriptors are objects that describe the API of a module, and the module
3023
- * can either be a REST module or a host module.
3024
- * This type is recursive, so it can describe nested modules.
3025
- */
3026
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$1<any> | ServicePluginDefinition<any> | {
3027
- [key: string]: Descriptors | PublicMetadata | any;
3028
- };
3029
- /**
3030
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
3031
- * and returns an object with the same structure, but with all descriptors replaced with their API.
3032
- * Any non-descriptor properties are removed from the returned object, including descriptors that
3033
- * do not match the given host (as they will not work with the given host).
3034
- */
3035
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
3036
- done: T;
3037
- recurse: T extends {
3038
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
3039
- } ? 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<{
3040
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
3041
- -1,
3042
- 0,
3043
- 1,
3044
- 2,
3045
- 3,
3046
- 4,
3047
- 5
3048
- ][Depth]> : never;
3049
- }, EmptyObject>;
3050
- }[Depth extends -1 ? 'done' : 'recurse'];
3051
- type PublicMetadata = {
3052
- PACKAGE_NAME?: string;
3053
- };
3054
-
3055
- declare global {
3056
- interface ContextualClient {
3057
- }
3058
- }
3059
- /**
3060
- * A type used to create concerete types from SDK descriptors in
3061
- * case a contextual client is available.
3062
- */
3063
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
3064
- host: Host;
3065
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
3066
-
3067
- /** Information about the pricing plan. */
3068
- interface Plan {
3069
- /**
3070
- * Plan ID.
3071
- * @readonly
3072
- */
3073
- _id?: string;
3074
- /** Plan name. */
3075
- name?: string | null;
3076
- /** Plan description. */
3077
- description?: string | null;
3078
- /**
3079
- * List of text strings that promote what is included with this plan.
3080
- *
3081
- * For example, "Plenty of parking" or "Free gift on your birthday".
3082
- */
3083
- perks?: StringList;
3084
- /** Plan price, payment schedule, and expiration. */
3085
- pricing?: Pricing;
3086
- /** Whether the plan is public (visible to site visitors and members). */
3087
- public?: boolean | null;
3088
- /**
3089
- * Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.
3090
- * @readonly
3091
- */
3092
- archived?: boolean;
3093
- /**
3094
- * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
3095
- *
3096
- * Default: `false`.
3097
- * @readonly
3098
- */
3099
- primary?: boolean;
3100
- /**
3101
- * Whether the plan has any orders (including pending and unpaid orders).
3102
- * @readonly
3103
- */
3104
- hasOrders?: boolean;
3105
- /**
3106
- * Date plan was created.
3107
- * @readonly
3108
- */
3109
- _createdDate?: Date;
3110
- /**
3111
- * Date plan was last updated.
3112
- * @readonly
3113
- */
3114
- _updatedDate?: Date;
3115
- /**
3116
- * URL-friendly version of plan name. Unique across all plans in the same site.
3117
- * @readonly
3118
- */
3119
- slug?: string | null;
3120
- /**
3121
- * Number of times the same buyer can purchase the plan. Currently limited to support:
3122
- * - Empty value or a value of `0`, meaning no limitation.
3123
- * - Value of `1`, meaning limited to one purchase per buyer.
3124
- */
3125
- maxPurchasesPerBuyer?: number | null;
3126
- /**
3127
- * Whether the buyer can start the plan at a later date.
3128
- *
3129
- * Default: `false`.
3130
- *
3131
- */
3132
- allowFutureStartDate?: boolean | null;
3133
- /**
3134
- * Whether the buyer is allowed to cancel their plan. If `false`, calling the [`requestCancellation()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/orders/requestcancellation) function returns an error.
3135
- *
3136
- * Default: `true`.
3137
- *
3138
- */
3139
- buyerCanCancel?: boolean | null;
3140
- /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
3141
- termsAndConditions?: string | null;
3142
- /** ID of the form associated with the plan at checkout. */
3143
- formId?: string | null;
2723
+ perks?: StringList;
2724
+ /** Plan price, payment schedule, and expiration. */
2725
+ pricing?: Pricing;
2726
+ /** Whether the plan is public (visible to site visitors and members). */
2727
+ public?: boolean | null;
2728
+ /**
2729
+ * Whether the plan is archived. Archived plans are not visible and can't be purchased anymore, but existing purchases remain in effect.
2730
+ * @readonly
2731
+ */
2732
+ archived?: boolean;
2733
+ /**
2734
+ * Whether the plan is marked as primary. If `true`, the plan is highlighted on the site with a custom ribbon.
2735
+ *
2736
+ * Default: `false`.
2737
+ * @readonly
2738
+ */
2739
+ primary?: boolean;
2740
+ /**
2741
+ * Whether the plan has any orders (including pending and unpaid orders).
2742
+ * @readonly
2743
+ */
2744
+ hasOrders?: boolean;
2745
+ /**
2746
+ * Date plan was created.
2747
+ * @readonly
2748
+ */
2749
+ _createdDate?: Date | null;
2750
+ /**
2751
+ * Date plan was last updated.
2752
+ * @readonly
2753
+ */
2754
+ _updatedDate?: Date | null;
2755
+ /**
2756
+ * URL-friendly version of plan name. Unique across all plans in the same site.
2757
+ * @readonly
2758
+ */
2759
+ slug?: string | null;
2760
+ /**
2761
+ * Number of times the same buyer can purchase the plan. Currently limited to support:
2762
+ * - Empty value or a value of `0`, meaning no limitation.
2763
+ * - Value of `1`, meaning limited to one purchase per buyer.
2764
+ */
2765
+ maxPurchasesPerBuyer?: number | null;
2766
+ /**
2767
+ * Whether the buyer can start the plan at a later date.
2768
+ *
2769
+ * Default: `false`.
2770
+ *
2771
+ */
2772
+ allowFutureStartDate?: boolean | null;
2773
+ /**
2774
+ * Whether the buyer is allowed to cancel their plan. If `false`, calling the [`requestCancellation()`](https://www.wix.com/velo/reference/wix-pricing-plans-v2/orders/requestcancellation) function returns an error.
2775
+ *
2776
+ * Default: `true`.
2777
+ *
2778
+ */
2779
+ buyerCanCancel?: boolean | null;
2780
+ /** Any terms and conditions that apply to the plan. This information will be displayed during checkout. */
2781
+ termsAndConditions?: string | null;
2782
+ /** ID of the form associated with the plan at checkout. */
2783
+ formId?: string | null;
3144
2784
  }
3145
2785
  /** This wrapper type exist in order to distinguish an empty string list from no list at all in update requests. */
3146
2786
  interface StringList {
@@ -3260,9 +2900,9 @@ interface PublicPlan {
3260
2900
  /** Whether the plan is marked as primary. */
3261
2901
  primary?: boolean;
3262
2902
  /** Date plan was created. */
3263
- _createdDate?: Date;
2903
+ _createdDate?: Date | null;
3264
2904
  /** Date plan was last updated. */
3265
- _updatedDate?: Date;
2905
+ _updatedDate?: Date | null;
3266
2906
  /** URL-friendly version of plan name. Unique across all plans in the same site. */
3267
2907
  slug?: string | null;
3268
2908
  /** Number of times the same buyer can purchase the plan. An empty value or a value of zero means no limitation. */
@@ -3436,6 +3076,7 @@ interface ClearPrimaryRequest {
3436
3076
  interface ClearPrimaryResponse {
3437
3077
  }
3438
3078
  interface ArchivePlanRequest {
3079
+ /** ID of the plan to archive. */
3439
3080
  _id: string;
3440
3081
  }
3441
3082
  interface ArchivePlanResponse {
@@ -3447,7 +3088,7 @@ interface PlanArchived {
3447
3088
  plan?: Plan;
3448
3089
  }
3449
3090
  interface BulkArchivePlanRequest {
3450
- /** List of Plan IDs. */
3091
+ /** List of Plan IDs to archive. */
3451
3092
  ids?: string[];
3452
3093
  /** Set to true to return Plan entity in response. */
3453
3094
  returnFullEntity?: boolean;
@@ -3550,7 +3191,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
3550
3191
  /** ID of the entity associated with the event. */
3551
3192
  entityId?: string;
3552
3193
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3553
- eventTime?: Date;
3194
+ eventTime?: Date | null;
3554
3195
  /**
3555
3196
  * Whether the event was triggered as a result of a privacy regulation application
3556
3197
  * (for example, GDPR).
@@ -3579,7 +3220,7 @@ interface EntityCreatedEvent {
3579
3220
  entity?: string;
3580
3221
  }
3581
3222
  interface RestoreInfo {
3582
- deletedDate?: Date;
3223
+ deletedDate?: Date | null;
3583
3224
  }
3584
3225
  interface EntityUpdatedEvent {
3585
3226
  /**
@@ -3735,7 +3376,7 @@ interface EventMetadata extends BaseEventMetadata {
3735
3376
  /** ID of the entity associated with the event. */
3736
3377
  entityId?: string;
3737
3378
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3738
- eventTime?: Date;
3379
+ eventTime?: Date | null;
3739
3380
  /**
3740
3381
  * Whether the event was triggered as a result of a privacy regulation application
3741
3382
  * (for example, GDPR).
@@ -3915,12 +3556,12 @@ interface UpdatePlan {
3915
3556
  * Date plan was created.
3916
3557
  * @readonly
3917
3558
  */
3918
- _createdDate?: Date;
3559
+ _createdDate?: Date | null;
3919
3560
  /**
3920
3561
  * Date plan was last updated.
3921
3562
  * @readonly
3922
3563
  */
3923
- _updatedDate?: Date;
3564
+ _updatedDate?: Date | null;
3924
3565
  /**
3925
3566
  * URL-friendly version of plan name. Unique across all plans in the same site.
3926
3567
  * @readonly
@@ -4134,28 +3775,10 @@ interface ArchivePlanSignature {
4134
3775
  */
4135
3776
  (_id: string): Promise<ArchivePlanResponse & ArchivePlanResponseNonNullableFields>;
4136
3777
  }
4137
- declare const onPlanUpdated$1: EventDefinition$1<PlanUpdatedEnvelope, "wix.pricing_plans.plan_updated">;
4138
- declare const onPlanCreated$1: EventDefinition$1<PlanCreatedEnvelope, "wix.pricing_plans.plan_created">;
4139
- declare const onPlanBuyerCanCancelUpdated$1: EventDefinition$1<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
4140
- declare const onPlanArchived$1: EventDefinition$1<PlanArchivedEnvelope, "wix.pricing_plans.plan_plan_archived">;
4141
-
4142
- type EventDefinition<Payload = unknown, Type extends string = string> = {
4143
- __type: 'event-definition';
4144
- type: Type;
4145
- isDomainEvent?: boolean;
4146
- transformations?: (envelope: unknown) => Payload;
4147
- __payload: Payload;
4148
- };
4149
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
4150
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
4151
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
4152
-
4153
- declare global {
4154
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
4155
- interface SymbolConstructor {
4156
- readonly observable: symbol;
4157
- }
4158
- }
3778
+ declare const onPlanUpdated$1: EventDefinition<PlanUpdatedEnvelope, "wix.pricing_plans.plan_updated">;
3779
+ declare const onPlanCreated$1: EventDefinition<PlanCreatedEnvelope, "wix.pricing_plans.plan_created">;
3780
+ declare const onPlanBuyerCanCancelUpdated$1: EventDefinition<PlanBuyerCanCancelUpdatedEnvelope, "wix.pricing_plans.plan_buyer_can_cancel_updated">;
3781
+ declare const onPlanArchived$1: EventDefinition<PlanArchivedEnvelope, "wix.pricing_plans.plan_plan_archived">;
4159
3782
 
4160
3783
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4161
3784
 
@@ -4184,7 +3807,9 @@ type _publicOnPlanCreatedType = typeof onPlanCreated$1;
4184
3807
  declare const onPlanCreated: ReturnType<typeof createEventModule<_publicOnPlanCreatedType>>;
4185
3808
 
4186
3809
  type _publicOnPlanBuyerCanCancelUpdatedType = typeof onPlanBuyerCanCancelUpdated$1;
4187
- /** */
3810
+ /**
3811
+ * An event that is triggered when a plan's `buyerCanCancel` field is updated.
3812
+ */
4188
3813
  declare const onPlanBuyerCanCancelUpdated: ReturnType<typeof createEventModule<_publicOnPlanBuyerCanCancelUpdatedType>>;
4189
3814
 
4190
3815
  type _publicOnPlanArchivedType = typeof onPlanArchived$1;