@wix/seatings 1.0.16 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/seatings",
3
- "version": "1.0.16",
3
+ "version": "1.0.18",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,8 +18,8 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/seatings_seating-plan": "1.0.14",
22
- "@wix/seatings_seating-reservation": "1.0.12"
21
+ "@wix/seatings_seating-plan": "1.0.15",
22
+ "@wix/seatings_seating-reservation": "1.0.13"
23
23
  },
24
24
  "devDependencies": {
25
25
  "glob": "^10.4.1",
@@ -44,5 +44,5 @@
44
44
  "fqdn": ""
45
45
  }
46
46
  },
47
- "falconPackageHash": "07a333054ed7fe3fc9529712f7d25b2f72bf419df43df1133f6582a5"
47
+ "falconPackageHash": "ff4a5a8641d186e91c75e31dbdf3ae9914580774e3338b4f1983ea1f"
48
48
  }
@@ -12,6 +12,10 @@ type Host<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
  */
@@ -63,16 +67,16 @@ type APIMetadata = {
63
67
  packageName?: string;
64
68
  };
65
69
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
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$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;
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
81
  type ServicePluginMethodInput = {
78
82
  request: any;
@@ -271,6 +275,72 @@ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends Excep
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<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`.
@@ -367,7 +435,7 @@ ConditionalKeys<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 = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$2<any> | ServicePluginDefinition<any> | {
438
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
371
439
  [key: string]: Descriptors | PublicMetadata | any;
372
440
  };
373
441
  /**
@@ -380,7 +448,7 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
380
448
  done: T;
381
449
  recurse: T extends {
382
450
  __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<{
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<{
384
452
  [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
453
  -1,
386
454
  0,
@@ -430,12 +498,12 @@ interface SeatingPlan$1 {
430
498
  * Seating plan created timestamp.
431
499
  * @readonly
432
500
  */
433
- _createdDate?: Date;
501
+ _createdDate?: Date | null;
434
502
  /**
435
503
  * Seating plan updated timestamp.
436
504
  * @readonly
437
505
  */
438
- _updatedDate?: Date;
506
+ _updatedDate?: Date | null;
439
507
  /**
440
508
  * Total capacity
441
509
  * @readonly
@@ -948,7 +1016,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
948
1016
  /** ID of the entity associated with the event. */
949
1017
  entityId?: string;
950
1018
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
951
- eventTime?: Date;
1019
+ eventTime?: Date | null;
952
1020
  /**
953
1021
  * Whether the event was triggered as a result of a privacy regulation application
954
1022
  * (for example, GDPR).
@@ -977,7 +1045,7 @@ interface EntityCreatedEvent$1 {
977
1045
  entity?: string;
978
1046
  }
979
1047
  interface RestoreInfo$1 {
980
- deletedDate?: Date;
1048
+ deletedDate?: Date | null;
981
1049
  }
982
1050
  interface EntityUpdatedEvent$1 {
983
1051
  /**
@@ -1239,7 +1307,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
1239
1307
  /** ID of the entity associated with the event. */
1240
1308
  entityId?: string;
1241
1309
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1242
- eventTime?: Date;
1310
+ eventTime?: Date | null;
1243
1311
  /**
1244
1312
  * Whether the event was triggered as a result of a privacy regulation application
1245
1313
  * (for example, GDPR).
@@ -1408,29 +1476,11 @@ interface GetSeatingPlanThumbnailSignature {
1408
1476
  */
1409
1477
  (_id: string | null): Promise<GetSeatingPlanThumbnailResponse>;
1410
1478
  }
1411
- declare const onSeatingPlanCreated$1: EventDefinition$2<SeatingPlanCreatedEnvelope, "wix.seating.v1.seating_plan_created">;
1412
- declare const onSeatingPlanUpdated$1: EventDefinition$2<SeatingPlanUpdatedEnvelope, "wix.seating.v1.seating_plan_updated">;
1413
- declare const onSeatingPlanDeleted$1: EventDefinition$2<SeatingPlanDeletedEnvelope, "wix.seating.v1.seating_plan_deleted">;
1414
-
1415
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
1416
- __type: 'event-definition';
1417
- type: Type;
1418
- isDomainEvent?: boolean;
1419
- transformations?: (envelope: unknown) => Payload;
1420
- __payload: Payload;
1421
- };
1422
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
1423
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
1424
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
1425
-
1426
- declare global {
1427
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1428
- interface SymbolConstructor {
1429
- readonly observable: symbol;
1430
- }
1431
- }
1479
+ declare const onSeatingPlanCreated$1: EventDefinition<SeatingPlanCreatedEnvelope, "wix.seating.v1.seating_plan_created">;
1480
+ declare const onSeatingPlanUpdated$1: EventDefinition<SeatingPlanUpdatedEnvelope, "wix.seating.v1.seating_plan_updated">;
1481
+ declare const onSeatingPlanDeleted$1: EventDefinition<SeatingPlanDeletedEnvelope, "wix.seating.v1.seating_plan_deleted">;
1432
1482
 
1433
- declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
1483
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1434
1484
 
1435
1485
  declare const createSeatingPlan: MaybeContext<BuildRESTFunction<typeof createSeatingPlan$1> & typeof createSeatingPlan$1>;
1436
1486
  declare const updateSeatingPlan: MaybeContext<BuildRESTFunction<typeof updateSeatingPlan$1> & typeof updateSeatingPlan$1>;
@@ -1858,12 +1908,12 @@ interface SeatingPlan {
1858
1908
  * Seating plan created timestamp.
1859
1909
  * @readonly
1860
1910
  */
1861
- _createdDate?: Date;
1911
+ _createdDate?: Date | null;
1862
1912
  /**
1863
1913
  * Seating plan updated timestamp.
1864
1914
  * @readonly
1865
1915
  */
1866
- _updatedDate?: Date;
1916
+ _updatedDate?: Date | null;
1867
1917
  /**
1868
1918
  * Total capacity
1869
1919
  * @readonly
@@ -2227,7 +2277,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
2227
2277
  /** ID of the entity associated with the event. */
2228
2278
  entityId?: string;
2229
2279
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2230
- eventTime?: Date;
2280
+ eventTime?: Date | null;
2231
2281
  /**
2232
2282
  * Whether the event was triggered as a result of a privacy regulation application
2233
2283
  * (for example, GDPR).
@@ -2256,7 +2306,7 @@ interface EntityCreatedEvent {
2256
2306
  entity?: string;
2257
2307
  }
2258
2308
  interface RestoreInfo {
2259
- deletedDate?: Date;
2309
+ deletedDate?: Date | null;
2260
2310
  }
2261
2311
  interface EntityUpdatedEvent {
2262
2312
  /**
@@ -2442,7 +2492,7 @@ interface EventMetadata extends BaseEventMetadata {
2442
2492
  /** ID of the entity associated with the event. */
2443
2493
  entityId?: string;
2444
2494
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2445
- eventTime?: Date;
2495
+ eventTime?: Date | null;
2446
2496
  /**
2447
2497
  * Whether the event was triggered as a result of a privacy regulation application
2448
2498
  * (for example, GDPR).
@@ -2544,26 +2594,8 @@ interface GetSeatingReservationsSummarySignature {
2544
2594
  /** @param - Filter for seating plan */
2545
2595
  (filter: Record<string, any> | null): Promise<GetSeatingReservationsSummaryResponse & GetSeatingReservationsSummaryResponseNonNullableFields>;
2546
2596
  }
2547
- declare const onSeatingReservationCreated$1: EventDefinition$2<SeatingReservationCreatedEnvelope, "wix.seating.v1.seating_reservation_created">;
2548
- declare const onSeatingReservationDeleted$1: EventDefinition$2<SeatingReservationDeletedEnvelope, "wix.seating.v1.seating_reservation_deleted">;
2549
-
2550
- type EventDefinition<Payload = unknown, Type extends string = string> = {
2551
- __type: 'event-definition';
2552
- type: Type;
2553
- isDomainEvent?: boolean;
2554
- transformations?: (envelope: unknown) => Payload;
2555
- __payload: Payload;
2556
- };
2557
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
2558
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
2559
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
2560
-
2561
- declare global {
2562
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2563
- interface SymbolConstructor {
2564
- readonly observable: symbol;
2565
- }
2566
- }
2597
+ declare const onSeatingReservationCreated$1: EventDefinition<SeatingReservationCreatedEnvelope, "wix.seating.v1.seating_reservation_created">;
2598
+ declare const onSeatingReservationDeleted$1: EventDefinition<SeatingReservationDeletedEnvelope, "wix.seating.v1.seating_reservation_deleted">;
2567
2599
 
2568
2600
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2569
2601
 
@@ -12,6 +12,10 @@ type Host<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
  */
@@ -63,16 +67,16 @@ type APIMetadata = {
63
67
  packageName?: string;
64
68
  };
65
69
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
66
- type EventDefinition$2<Payload = unknown, Type extends string = string> = {
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$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;
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
81
  type ServicePluginMethodInput = {
78
82
  request: any;
@@ -271,6 +275,72 @@ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends Excep
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<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`.
@@ -367,7 +435,7 @@ ConditionalKeys<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 = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$2<any> | ServicePluginDefinition<any> | {
438
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
371
439
  [key: string]: Descriptors | PublicMetadata | any;
372
440
  };
373
441
  /**
@@ -380,7 +448,7 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
380
448
  done: T;
381
449
  recurse: T extends {
382
450
  __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<{
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<{
384
452
  [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
453
  -1,
386
454
  0,
@@ -430,12 +498,12 @@ interface SeatingPlan$1 {
430
498
  * Seating plan created timestamp.
431
499
  * @readonly
432
500
  */
433
- _createdDate?: Date;
501
+ _createdDate?: Date | null;
434
502
  /**
435
503
  * Seating plan updated timestamp.
436
504
  * @readonly
437
505
  */
438
- _updatedDate?: Date;
506
+ _updatedDate?: Date | null;
439
507
  /**
440
508
  * Total capacity
441
509
  * @readonly
@@ -948,7 +1016,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
948
1016
  /** ID of the entity associated with the event. */
949
1017
  entityId?: string;
950
1018
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
951
- eventTime?: Date;
1019
+ eventTime?: Date | null;
952
1020
  /**
953
1021
  * Whether the event was triggered as a result of a privacy regulation application
954
1022
  * (for example, GDPR).
@@ -977,7 +1045,7 @@ interface EntityCreatedEvent$1 {
977
1045
  entity?: string;
978
1046
  }
979
1047
  interface RestoreInfo$1 {
980
- deletedDate?: Date;
1048
+ deletedDate?: Date | null;
981
1049
  }
982
1050
  interface EntityUpdatedEvent$1 {
983
1051
  /**
@@ -1239,7 +1307,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
1239
1307
  /** ID of the entity associated with the event. */
1240
1308
  entityId?: string;
1241
1309
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1242
- eventTime?: Date;
1310
+ eventTime?: Date | null;
1243
1311
  /**
1244
1312
  * Whether the event was triggered as a result of a privacy regulation application
1245
1313
  * (for example, GDPR).
@@ -1408,29 +1476,11 @@ interface GetSeatingPlanThumbnailSignature {
1408
1476
  */
1409
1477
  (_id: string | null): Promise<GetSeatingPlanThumbnailResponse>;
1410
1478
  }
1411
- declare const onSeatingPlanCreated$1: EventDefinition$2<SeatingPlanCreatedEnvelope, "wix.seating.v1.seating_plan_created">;
1412
- declare const onSeatingPlanUpdated$1: EventDefinition$2<SeatingPlanUpdatedEnvelope, "wix.seating.v1.seating_plan_updated">;
1413
- declare const onSeatingPlanDeleted$1: EventDefinition$2<SeatingPlanDeletedEnvelope, "wix.seating.v1.seating_plan_deleted">;
1414
-
1415
- type EventDefinition$1<Payload = unknown, Type extends string = string> = {
1416
- __type: 'event-definition';
1417
- type: Type;
1418
- isDomainEvent?: boolean;
1419
- transformations?: (envelope: unknown) => Payload;
1420
- __payload: Payload;
1421
- };
1422
- declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
1423
- type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
1424
- type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
1425
-
1426
- declare global {
1427
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
1428
- interface SymbolConstructor {
1429
- readonly observable: symbol;
1430
- }
1431
- }
1479
+ declare const onSeatingPlanCreated$1: EventDefinition<SeatingPlanCreatedEnvelope, "wix.seating.v1.seating_plan_created">;
1480
+ declare const onSeatingPlanUpdated$1: EventDefinition<SeatingPlanUpdatedEnvelope, "wix.seating.v1.seating_plan_updated">;
1481
+ declare const onSeatingPlanDeleted$1: EventDefinition<SeatingPlanDeletedEnvelope, "wix.seating.v1.seating_plan_deleted">;
1432
1482
 
1433
- declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
1483
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1434
1484
 
1435
1485
  declare const createSeatingPlan: MaybeContext<BuildRESTFunction<typeof createSeatingPlan$1> & typeof createSeatingPlan$1>;
1436
1486
  declare const updateSeatingPlan: MaybeContext<BuildRESTFunction<typeof updateSeatingPlan$1> & typeof updateSeatingPlan$1>;
@@ -1858,12 +1908,12 @@ interface SeatingPlan {
1858
1908
  * Seating plan created timestamp.
1859
1909
  * @readonly
1860
1910
  */
1861
- _createdDate?: Date;
1911
+ _createdDate?: Date | null;
1862
1912
  /**
1863
1913
  * Seating plan updated timestamp.
1864
1914
  * @readonly
1865
1915
  */
1866
- _updatedDate?: Date;
1916
+ _updatedDate?: Date | null;
1867
1917
  /**
1868
1918
  * Total capacity
1869
1919
  * @readonly
@@ -2227,7 +2277,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
2227
2277
  /** ID of the entity associated with the event. */
2228
2278
  entityId?: string;
2229
2279
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2230
- eventTime?: Date;
2280
+ eventTime?: Date | null;
2231
2281
  /**
2232
2282
  * Whether the event was triggered as a result of a privacy regulation application
2233
2283
  * (for example, GDPR).
@@ -2256,7 +2306,7 @@ interface EntityCreatedEvent {
2256
2306
  entity?: string;
2257
2307
  }
2258
2308
  interface RestoreInfo {
2259
- deletedDate?: Date;
2309
+ deletedDate?: Date | null;
2260
2310
  }
2261
2311
  interface EntityUpdatedEvent {
2262
2312
  /**
@@ -2442,7 +2492,7 @@ interface EventMetadata extends BaseEventMetadata {
2442
2492
  /** ID of the entity associated with the event. */
2443
2493
  entityId?: string;
2444
2494
  /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2445
- eventTime?: Date;
2495
+ eventTime?: Date | null;
2446
2496
  /**
2447
2497
  * Whether the event was triggered as a result of a privacy regulation application
2448
2498
  * (for example, GDPR).
@@ -2544,26 +2594,8 @@ interface GetSeatingReservationsSummarySignature {
2544
2594
  /** @param - Filter for seating plan */
2545
2595
  (filter: Record<string, any> | null): Promise<GetSeatingReservationsSummaryResponse & GetSeatingReservationsSummaryResponseNonNullableFields>;
2546
2596
  }
2547
- declare const onSeatingReservationCreated$1: EventDefinition$2<SeatingReservationCreatedEnvelope, "wix.seating.v1.seating_reservation_created">;
2548
- declare const onSeatingReservationDeleted$1: EventDefinition$2<SeatingReservationDeletedEnvelope, "wix.seating.v1.seating_reservation_deleted">;
2549
-
2550
- type EventDefinition<Payload = unknown, Type extends string = string> = {
2551
- __type: 'event-definition';
2552
- type: Type;
2553
- isDomainEvent?: boolean;
2554
- transformations?: (envelope: unknown) => Payload;
2555
- __payload: Payload;
2556
- };
2557
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
2558
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
2559
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
2560
-
2561
- declare global {
2562
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2563
- interface SymbolConstructor {
2564
- readonly observable: symbol;
2565
- }
2566
- }
2597
+ declare const onSeatingReservationCreated$1: EventDefinition<SeatingReservationCreatedEnvelope, "wix.seating.v1.seating_reservation_created">;
2598
+ declare const onSeatingReservationDeleted$1: EventDefinition<SeatingReservationDeletedEnvelope, "wix.seating.v1.seating_reservation_deleted">;
2567
2599
 
2568
2600
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2569
2601
 
@@ -20,12 +20,12 @@ interface SeatingPlan$3 {
20
20
  * Seating plan created timestamp.
21
21
  * @readonly
22
22
  */
23
- createdDate?: Date;
23
+ createdDate?: Date | null;
24
24
  /**
25
25
  * Seating plan updated timestamp.
26
26
  * @readonly
27
27
  */
28
- updatedDate?: Date;
28
+ updatedDate?: Date | null;
29
29
  /**
30
30
  * Total capacity
31
31
  * @readonly
@@ -578,12 +578,12 @@ interface SeatingPlan$2 {
578
578
  * Seating plan created timestamp.
579
579
  * @readonly
580
580
  */
581
- _createdDate?: Date;
581
+ _createdDate?: Date | null;
582
582
  /**
583
583
  * Seating plan updated timestamp.
584
584
  * @readonly
585
585
  */
586
- _updatedDate?: Date;
586
+ _updatedDate?: Date | null;
587
587
  /**
588
588
  * Total capacity
589
589
  * @readonly
@@ -1383,12 +1383,12 @@ interface SeatingPlan$1 {
1383
1383
  * Seating plan created timestamp.
1384
1384
  * @readonly
1385
1385
  */
1386
- createdDate?: Date;
1386
+ createdDate?: Date | null;
1387
1387
  /**
1388
1388
  * Seating plan updated timestamp.
1389
1389
  * @readonly
1390
1390
  */
1391
- updatedDate?: Date;
1391
+ updatedDate?: Date | null;
1392
1392
  /**
1393
1393
  * Total capacity
1394
1394
  * @readonly
@@ -1992,12 +1992,12 @@ interface SeatingPlan {
1992
1992
  * Seating plan created timestamp.
1993
1993
  * @readonly
1994
1994
  */
1995
- _createdDate?: Date;
1995
+ _createdDate?: Date | null;
1996
1996
  /**
1997
1997
  * Seating plan updated timestamp.
1998
1998
  * @readonly
1999
1999
  */
2000
- _updatedDate?: Date;
2000
+ _updatedDate?: Date | null;
2001
2001
  /**
2002
2002
  * Total capacity
2003
2003
  * @readonly