@wix/calendar 1.0.13 → 1.0.15

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,8 +1,47 @@
1
+ type HostModule<T, H extends Host> = {
2
+ __type: 'host';
3
+ create(host: H): T;
4
+ };
5
+ type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
6
+ type Host<Environment = unknown> = {
7
+ channel: {
8
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
+ disconnect: () => void;
10
+ } | Promise<{
11
+ disconnect: () => void;
12
+ }>;
13
+ };
14
+ environment?: Environment;
15
+ /**
16
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
17
+ */
18
+ apiBaseUrl?: string;
19
+ /**
20
+ * Possible data to be provided by every host, for cross cutting concerns
21
+ * like internationalization, billing, etc.
22
+ */
23
+ essentials?: {
24
+ /**
25
+ * The language of the currently viewed session
26
+ */
27
+ language?: string;
28
+ /**
29
+ * The locale of the currently viewed session
30
+ */
31
+ locale?: string;
32
+ /**
33
+ * Any headers that should be passed through to the API requests
34
+ */
35
+ passThroughHeaders?: Record<string, string>;
36
+ };
37
+ };
38
+
1
39
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
40
  interface HttpClient {
3
41
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
4
42
  fetchWithAuth: typeof fetch;
5
43
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
+ getActiveToken?: () => string | undefined;
6
45
  }
7
46
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
8
47
  type HttpResponse<T = any> = {
@@ -24,16 +63,65 @@ type APIMetadata = {
24
63
  packageName?: string;
25
64
  };
26
65
  type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
27
- type EventDefinition<Payload = unknown, Type extends string = string> = {
66
+ type EventDefinition$3<Payload = unknown, Type extends string = string> = {
28
67
  __type: 'event-definition';
29
68
  type: Type;
30
69
  isDomainEvent?: boolean;
31
70
  transformations?: (envelope: unknown) => Payload;
32
71
  __payload: Payload;
33
72
  };
34
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
35
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
36
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
73
+ declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
74
+ type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
75
+ type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
76
+
77
+ type ServicePluginMethodInput = {
78
+ request: any;
79
+ metadata: any;
80
+ };
81
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
82
+ type ServicePluginMethodMetadata = {
83
+ name: string;
84
+ primaryHttpMappingPath: string;
85
+ transformations: {
86
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
87
+ toREST: (...args: unknown[]) => unknown;
88
+ };
89
+ };
90
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
91
+ __type: 'service-plugin-definition';
92
+ componentType: string;
93
+ methods: ServicePluginMethodMetadata[];
94
+ __contract: Contract;
95
+ };
96
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
97
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
98
+ declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
99
+
100
+ type RequestContext = {
101
+ isSSR: boolean;
102
+ host: string;
103
+ protocol?: string;
104
+ };
105
+ type ResponseTransformer = (data: any, headers?: any) => any;
106
+ /**
107
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
108
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
109
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
110
+ */
111
+ type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
112
+ type AmbassadorRequestOptions<T = any> = {
113
+ _?: T;
114
+ url?: string;
115
+ method?: Method;
116
+ params?: any;
117
+ data?: any;
118
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
119
+ };
120
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
121
+ __isAmbassador: boolean;
122
+ };
123
+ type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
124
+ type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
37
125
 
38
126
  declare global {
39
127
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -42,6 +130,284 @@ declare global {
42
130
  }
43
131
  }
44
132
 
133
+ declare const emptyObjectSymbol: unique symbol;
134
+
135
+ /**
136
+ Represents a strictly empty plain object, the `{}` value.
137
+
138
+ When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
139
+
140
+ @example
141
+ ```
142
+ import type {EmptyObject} from 'type-fest';
143
+
144
+ // The following illustrates the problem with `{}`.
145
+ const foo1: {} = {}; // Pass
146
+ const foo2: {} = []; // Pass
147
+ const foo3: {} = 42; // Pass
148
+ const foo4: {} = {a: 1}; // Pass
149
+
150
+ // With `EmptyObject` only the first case is valid.
151
+ const bar1: EmptyObject = {}; // Pass
152
+ const bar2: EmptyObject = 42; // Fail
153
+ const bar3: EmptyObject = []; // Fail
154
+ const bar4: EmptyObject = {a: 1}; // Fail
155
+ ```
156
+
157
+ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
158
+
159
+ @category Object
160
+ */
161
+ type EmptyObject = {[emptyObjectSymbol]?: never};
162
+
163
+ /**
164
+ Returns a boolean for whether the two given types are equal.
165
+
166
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
167
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
168
+
169
+ Use-cases:
170
+ - If you want to make a conditional branch based on the result of a comparison of two types.
171
+
172
+ @example
173
+ ```
174
+ import type {IsEqual} from 'type-fest';
175
+
176
+ // This type returns a boolean for whether the given array includes the given item.
177
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
178
+ type Includes<Value extends readonly any[], Item> =
179
+ Value extends readonly [Value[0], ...infer rest]
180
+ ? IsEqual<Value[0], Item> extends true
181
+ ? true
182
+ : Includes<rest, Item>
183
+ : false;
184
+ ```
185
+
186
+ @category Type Guard
187
+ @category Utilities
188
+ */
189
+ type IsEqual<A, B> =
190
+ (<G>() => G extends A ? 1 : 2) extends
191
+ (<G>() => G extends B ? 1 : 2)
192
+ ? true
193
+ : false;
194
+
195
+ /**
196
+ Filter out keys from an object.
197
+
198
+ Returns `never` if `Exclude` is strictly equal to `Key`.
199
+ Returns `never` if `Key` extends `Exclude`.
200
+ Returns `Key` otherwise.
201
+
202
+ @example
203
+ ```
204
+ type Filtered = Filter<'foo', 'foo'>;
205
+ //=> never
206
+ ```
207
+
208
+ @example
209
+ ```
210
+ type Filtered = Filter<'bar', string>;
211
+ //=> never
212
+ ```
213
+
214
+ @example
215
+ ```
216
+ type Filtered = Filter<'bar', 'foo'>;
217
+ //=> 'bar'
218
+ ```
219
+
220
+ @see {Except}
221
+ */
222
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
+
224
+ type ExceptOptions = {
225
+ /**
226
+ Disallow assigning non-specified properties.
227
+
228
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
229
+
230
+ @default false
231
+ */
232
+ requireExactProps?: boolean;
233
+ };
234
+
235
+ /**
236
+ Create a type from an object type without certain keys.
237
+
238
+ We recommend setting the `requireExactProps` option to `true`.
239
+
240
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
241
+
242
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
243
+
244
+ @example
245
+ ```
246
+ import type {Except} from 'type-fest';
247
+
248
+ type Foo = {
249
+ a: number;
250
+ b: string;
251
+ };
252
+
253
+ type FooWithoutA = Except<Foo, 'a'>;
254
+ //=> {b: string}
255
+
256
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
257
+ //=> errors: 'a' does not exist in type '{ b: string; }'
258
+
259
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
260
+ //=> {a: number} & Partial<Record<"b", never>>
261
+
262
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
263
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
264
+ ```
265
+
266
+ @category Object
267
+ */
268
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
269
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
270
+ } & (Options['requireExactProps'] extends true
271
+ ? Partial<Record<KeysType, never>>
272
+ : {});
273
+
274
+ /**
275
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
276
+
277
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
278
+
279
+ @example
280
+ ```
281
+ import type {ConditionalKeys} from 'type-fest';
282
+
283
+ interface Example {
284
+ a: string;
285
+ b: string | number;
286
+ c?: string;
287
+ d: {};
288
+ }
289
+
290
+ type StringKeysOnly = ConditionalKeys<Example, string>;
291
+ //=> 'a'
292
+ ```
293
+
294
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
295
+
296
+ @example
297
+ ```
298
+ import type {ConditionalKeys} from 'type-fest';
299
+
300
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
301
+ //=> 'a' | 'c'
302
+ ```
303
+
304
+ @category Object
305
+ */
306
+ type ConditionalKeys<Base, Condition> = NonNullable<
307
+ // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
308
+ {
309
+ // Map through all the keys of the given base type.
310
+ [Key in keyof Base]:
311
+ // Pick only keys with types extending the given `Condition` type.
312
+ Base[Key] extends Condition
313
+ // Retain this key since the condition passes.
314
+ ? Key
315
+ // Discard this key since the condition fails.
316
+ : never;
317
+
318
+ // Convert the produced object into a union type of the keys which passed the conditional test.
319
+ }[keyof Base]
320
+ >;
321
+
322
+ /**
323
+ Exclude keys from a shape that matches the given `Condition`.
324
+
325
+ This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
326
+
327
+ @example
328
+ ```
329
+ import type {Primitive, ConditionalExcept} from 'type-fest';
330
+
331
+ class Awesome {
332
+ name: string;
333
+ successes: number;
334
+ failures: bigint;
335
+
336
+ run() {}
337
+ }
338
+
339
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
340
+ //=> {run: () => void}
341
+ ```
342
+
343
+ @example
344
+ ```
345
+ import type {ConditionalExcept} from 'type-fest';
346
+
347
+ interface Example {
348
+ a: string;
349
+ b: string | number;
350
+ c: () => void;
351
+ d: {};
352
+ }
353
+
354
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
355
+ //=> {b: string | number; c: () => void; d: {}}
356
+ ```
357
+
358
+ @category Object
359
+ */
360
+ type ConditionalExcept<Base, Condition> = Except<
361
+ Base,
362
+ ConditionalKeys<Base, Condition>
363
+ >;
364
+
365
+ /**
366
+ * Descriptors are objects that describe the API of a module, and the module
367
+ * can either be a REST module or a host module.
368
+ * This type is recursive, so it can describe nested modules.
369
+ */
370
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$3<any> | ServicePluginDefinition<any> | {
371
+ [key: string]: Descriptors | PublicMetadata | any;
372
+ };
373
+ /**
374
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
375
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
376
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
377
+ * do not match the given host (as they will not work with the given host).
378
+ */
379
+ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
380
+ done: T;
381
+ recurse: T extends {
382
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
383
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
384
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
385
+ -1,
386
+ 0,
387
+ 1,
388
+ 2,
389
+ 3,
390
+ 4,
391
+ 5
392
+ ][Depth]> : never;
393
+ }, EmptyObject>;
394
+ }[Depth extends -1 ? 'done' : 'recurse'];
395
+ type PublicMetadata = {
396
+ PACKAGE_NAME?: string;
397
+ };
398
+
399
+ declare global {
400
+ interface ContextualClient {
401
+ }
402
+ }
403
+ /**
404
+ * A type used to create concerete types from SDK descriptors in
405
+ * case a contextual client is available.
406
+ */
407
+ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
408
+ host: Host;
409
+ } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
410
+
45
411
  interface Event {
46
412
  /**
47
413
  * The event ID.
@@ -2119,26 +2485,44 @@ interface ListEventsByMemberIdSignature {
2119
2485
  */
2120
2486
  (memberId: string | null, options?: ListEventsByMemberIdOptions | undefined): Promise<ListEventsByMemberIdResponse & ListEventsByMemberIdResponseNonNullableFields>;
2121
2487
  }
2122
- declare const onEventCreated$1: EventDefinition<EventCreatedEnvelope, "wix.calendar.v3.event_created">;
2123
- declare const onEventUpdated$1: EventDefinition<EventUpdatedEnvelope, "wix.calendar.v3.event_updated">;
2124
- declare const onEventRecurringSplit$1: EventDefinition<EventRecurringSplitEnvelope, "wix.calendar.v3.event_recurring_split">;
2125
- declare const onEventCancelled$1: EventDefinition<EventCancelledEnvelope, "wix.calendar.v3.event_cancelled">;
2488
+ declare const onEventCreated$1: EventDefinition$3<EventCreatedEnvelope, "wix.calendar.v3.event_created">;
2489
+ declare const onEventUpdated$1: EventDefinition$3<EventUpdatedEnvelope, "wix.calendar.v3.event_updated">;
2490
+ declare const onEventRecurringSplit$1: EventDefinition$3<EventRecurringSplitEnvelope, "wix.calendar.v3.event_recurring_split">;
2491
+ declare const onEventCancelled$1: EventDefinition$3<EventCancelledEnvelope, "wix.calendar.v3.event_cancelled">;
2126
2492
 
2127
- declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2493
+ type EventDefinition$2<Payload = unknown, Type extends string = string> = {
2494
+ __type: 'event-definition';
2495
+ type: Type;
2496
+ isDomainEvent?: boolean;
2497
+ transformations?: (envelope: unknown) => Payload;
2498
+ __payload: Payload;
2499
+ };
2500
+ declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
2501
+ type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
2502
+ type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
2128
2503
 
2129
- declare const getEvent: BuildRESTFunction<typeof getEvent$1> & typeof getEvent$1;
2130
- declare const listEvents: BuildRESTFunction<typeof listEvents$1> & typeof listEvents$1;
2131
- declare const queryEvents: BuildRESTFunction<typeof queryEvents$1> & typeof queryEvents$1;
2132
- declare const createEvent: BuildRESTFunction<typeof createEvent$1> & typeof createEvent$1;
2133
- declare const bulkCreateEvent: BuildRESTFunction<typeof bulkCreateEvent$1> & typeof bulkCreateEvent$1;
2134
- declare const updateEvent: BuildRESTFunction<typeof updateEvent$1> & typeof updateEvent$1;
2135
- declare const bulkUpdateEvent: BuildRESTFunction<typeof bulkUpdateEvent$1> & typeof bulkUpdateEvent$1;
2136
- declare const restoreEventDefaults: BuildRESTFunction<typeof restoreEventDefaults$1> & typeof restoreEventDefaults$1;
2137
- declare const splitRecurringEvent: BuildRESTFunction<typeof splitRecurringEvent$1> & typeof splitRecurringEvent$1;
2138
- declare const cancelEvent: BuildRESTFunction<typeof cancelEvent$1> & typeof cancelEvent$1;
2139
- declare const bulkCancelEvent: BuildRESTFunction<typeof bulkCancelEvent$1> & typeof bulkCancelEvent$1;
2140
- declare const listEventsByContactId: BuildRESTFunction<typeof listEventsByContactId$1> & typeof listEventsByContactId$1;
2141
- declare const listEventsByMemberId: BuildRESTFunction<typeof listEventsByMemberId$1> & typeof listEventsByMemberId$1;
2504
+ declare global {
2505
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2506
+ interface SymbolConstructor {
2507
+ readonly observable: symbol;
2508
+ }
2509
+ }
2510
+
2511
+ declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
2512
+
2513
+ declare const getEvent: MaybeContext<BuildRESTFunction<typeof getEvent$1> & typeof getEvent$1>;
2514
+ declare const listEvents: MaybeContext<BuildRESTFunction<typeof listEvents$1> & typeof listEvents$1>;
2515
+ declare const queryEvents: MaybeContext<BuildRESTFunction<typeof queryEvents$1> & typeof queryEvents$1>;
2516
+ declare const createEvent: MaybeContext<BuildRESTFunction<typeof createEvent$1> & typeof createEvent$1>;
2517
+ declare const bulkCreateEvent: MaybeContext<BuildRESTFunction<typeof bulkCreateEvent$1> & typeof bulkCreateEvent$1>;
2518
+ declare const updateEvent: MaybeContext<BuildRESTFunction<typeof updateEvent$1> & typeof updateEvent$1>;
2519
+ declare const bulkUpdateEvent: MaybeContext<BuildRESTFunction<typeof bulkUpdateEvent$1> & typeof bulkUpdateEvent$1>;
2520
+ declare const restoreEventDefaults: MaybeContext<BuildRESTFunction<typeof restoreEventDefaults$1> & typeof restoreEventDefaults$1>;
2521
+ declare const splitRecurringEvent: MaybeContext<BuildRESTFunction<typeof splitRecurringEvent$1> & typeof splitRecurringEvent$1>;
2522
+ declare const cancelEvent: MaybeContext<BuildRESTFunction<typeof cancelEvent$1> & typeof cancelEvent$1>;
2523
+ declare const bulkCancelEvent: MaybeContext<BuildRESTFunction<typeof bulkCancelEvent$1> & typeof bulkCancelEvent$1>;
2524
+ declare const listEventsByContactId: MaybeContext<BuildRESTFunction<typeof listEventsByContactId$1> & typeof listEventsByContactId$1>;
2525
+ declare const listEventsByMemberId: MaybeContext<BuildRESTFunction<typeof listEventsByMemberId$1> & typeof listEventsByMemberId$1>;
2142
2526
 
2143
2527
  type _publicOnEventCreatedType = typeof onEventCreated$1;
2144
2528
  /** */
@@ -2592,7 +2976,7 @@ interface ScheduleUpdatedWithMetadata {
2592
2976
  }
2593
2977
  interface CloneScheduleRequest {
2594
2978
  /** The ID of the schedule to clone. */
2595
- scheduleId: string | null;
2979
+ scheduleId?: string | null;
2596
2980
  /** Optional values to override. */
2597
2981
  schedule?: Schedule;
2598
2982
  }
@@ -3327,9 +3711,6 @@ interface CreateScheduleResponseNonNullableFields {
3327
3711
  interface UpdateScheduleResponseNonNullableFields {
3328
3712
  schedule?: ScheduleNonNullableFields;
3329
3713
  }
3330
- interface CloneScheduleResponseNonNullableFields {
3331
- schedule?: ScheduleNonNullableFields;
3332
- }
3333
3714
  interface CancelScheduleResponseNonNullableFields {
3334
3715
  schedule?: ScheduleNonNullableFields;
3335
3716
  }
@@ -3527,10 +3908,6 @@ interface UpdateScheduleOptions {
3527
3908
  /** Whether to notify participants regarding the changes. */
3528
3909
  participantNotification?: ParticipantNotification;
3529
3910
  }
3530
- interface CloneScheduleOptions {
3531
- /** Optional values to override. */
3532
- schedule?: Schedule;
3533
- }
3534
3911
  interface CancelScheduleOptions {
3535
3912
  /**
3536
3913
  * Whether to preserve future events with participants.
@@ -3577,14 +3954,6 @@ interface UpdateScheduleSignature {
3577
3954
  */
3578
3955
  (_id: string | null, schedule: UpdateSchedule, options?: UpdateScheduleOptions | undefined): Promise<Schedule & ScheduleNonNullableFields>;
3579
3956
  }
3580
- declare function cloneSchedule$1(httpClient: HttpClient): CloneScheduleSignature;
3581
- interface CloneScheduleSignature {
3582
- /**
3583
- * Clone a schedule.
3584
- * @param - The ID of the schedule to clone.
3585
- */
3586
- (scheduleId: string | null, options?: CloneScheduleOptions | undefined): Promise<CloneScheduleResponse & CloneScheduleResponseNonNullableFields>;
3587
- }
3588
3957
  declare function cancelSchedule$1(httpClient: HttpClient): CancelScheduleSignature;
3589
3958
  interface CancelScheduleSignature {
3590
3959
  /**
@@ -3593,22 +3962,44 @@ interface CancelScheduleSignature {
3593
3962
  */
3594
3963
  (scheduleId: string | null, options?: CancelScheduleOptions | undefined): Promise<CancelScheduleResponse & CancelScheduleResponseNonNullableFields>;
3595
3964
  }
3596
- declare const onScheduleCreated$1: EventDefinition<ScheduleCreatedEnvelope, "wix.calendar.v3.schedule_created">;
3597
- declare const onScheduleUpdated$1: EventDefinition<ScheduleUpdatedEnvelope, "wix.calendar.v3.schedule_updated">;
3598
- declare const onScheduleCloned$1: EventDefinition<ScheduleClonedEnvelope, "wix.calendar.v3.schedule_cloned">;
3599
- declare const onScheduleCancelled$1: EventDefinition<ScheduleCancelledEnvelope, "wix.calendar.v3.schedule_cancelled">;
3965
+ declare const onScheduleCreated$1: EventDefinition$3<ScheduleCreatedEnvelope, "wix.calendar.v3.schedule_created">;
3966
+ declare const onScheduleUpdated$1: EventDefinition$3<ScheduleUpdatedEnvelope, "wix.calendar.v3.schedule_updated">;
3967
+ declare const onScheduleCloned$1: EventDefinition$3<ScheduleClonedEnvelope, "wix.calendar.v3.schedule_cloned">;
3968
+ declare const onScheduleCancelled$1: EventDefinition$3<ScheduleCancelledEnvelope, "wix.calendar.v3.schedule_cancelled">;
3600
3969
 
3601
- declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
3970
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
3971
+ __type: 'event-definition';
3972
+ type: Type;
3973
+ isDomainEvent?: boolean;
3974
+ transformations?: (envelope: unknown) => Payload;
3975
+ __payload: Payload;
3976
+ };
3977
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
3978
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
3979
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
3980
+
3981
+ declare global {
3982
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
3983
+ interface SymbolConstructor {
3984
+ readonly observable: symbol;
3985
+ }
3986
+ }
3987
+
3988
+ declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
3602
3989
 
3603
- declare const getSchedule: BuildRESTFunction<typeof getSchedule$1> & typeof getSchedule$1;
3604
- declare const querySchedules: BuildRESTFunction<typeof querySchedules$1> & typeof querySchedules$1;
3605
- declare const createSchedule: BuildRESTFunction<typeof createSchedule$1> & typeof createSchedule$1;
3606
- declare const updateSchedule: BuildRESTFunction<typeof updateSchedule$1> & typeof updateSchedule$1;
3607
- declare const cloneSchedule: BuildRESTFunction<typeof cloneSchedule$1> & typeof cloneSchedule$1;
3608
- declare const cancelSchedule: BuildRESTFunction<typeof cancelSchedule$1> & typeof cancelSchedule$1;
3990
+ declare const getSchedule: MaybeContext<BuildRESTFunction<typeof getSchedule$1> & typeof getSchedule$1>;
3991
+ declare const querySchedules: MaybeContext<BuildRESTFunction<typeof querySchedules$1> & typeof querySchedules$1>;
3992
+ declare const createSchedule: MaybeContext<BuildRESTFunction<typeof createSchedule$1> & typeof createSchedule$1>;
3993
+ declare const updateSchedule: MaybeContext<BuildRESTFunction<typeof updateSchedule$1> & typeof updateSchedule$1>;
3994
+ declare const cancelSchedule: MaybeContext<BuildRESTFunction<typeof cancelSchedule$1> & typeof cancelSchedule$1>;
3609
3995
 
3610
3996
  type _publicOnScheduleCreatedType = typeof onScheduleCreated$1;
3611
- /** */
3997
+ /**
3998
+ * Restore once implemented.
3999
+ * option (google.api.http) = {
4000
+ * post: "/v3/schedules/{schedule_id}/clone";
4001
+ * };
4002
+ */
3612
4003
  declare const onScheduleCreated: ReturnType<typeof createEventModule$1<_publicOnScheduleCreatedType>>;
3613
4004
 
3614
4005
  type _publicOnScheduleUpdatedType = typeof onScheduleUpdated$1;
@@ -3628,10 +4019,8 @@ type context$1_CancelScheduleOptions = CancelScheduleOptions;
3628
4019
  type context$1_CancelScheduleRequest = CancelScheduleRequest;
3629
4020
  type context$1_CancelScheduleResponse = CancelScheduleResponse;
3630
4021
  type context$1_CancelScheduleResponseNonNullableFields = CancelScheduleResponseNonNullableFields;
3631
- type context$1_CloneScheduleOptions = CloneScheduleOptions;
3632
4022
  type context$1_CloneScheduleRequest = CloneScheduleRequest;
3633
4023
  type context$1_CloneScheduleResponse = CloneScheduleResponse;
3634
- type context$1_CloneScheduleResponseNonNullableFields = CloneScheduleResponseNonNullableFields;
3635
4024
  type context$1_CommonIdentificationData = CommonIdentificationData;
3636
4025
  type context$1_CommonIdentificationDataIdOneOf = CommonIdentificationDataIdOneOf;
3637
4026
  type context$1_ConferencingDetails = ConferencingDetails;
@@ -3715,7 +4104,6 @@ type context$1__publicOnScheduleClonedType = _publicOnScheduleClonedType;
3715
4104
  type context$1__publicOnScheduleCreatedType = _publicOnScheduleCreatedType;
3716
4105
  type context$1__publicOnScheduleUpdatedType = _publicOnScheduleUpdatedType;
3717
4106
  declare const context$1_cancelSchedule: typeof cancelSchedule;
3718
- declare const context$1_cloneSchedule: typeof cloneSchedule;
3719
4107
  declare const context$1_createSchedule: typeof createSchedule;
3720
4108
  declare const context$1_getSchedule: typeof getSchedule;
3721
4109
  declare const context$1_onScheduleCancelled: typeof onScheduleCancelled;
@@ -3725,7 +4113,7 @@ declare const context$1_onScheduleUpdated: typeof onScheduleUpdated;
3725
4113
  declare const context$1_querySchedules: typeof querySchedules;
3726
4114
  declare const context$1_updateSchedule: typeof updateSchedule;
3727
4115
  declare namespace context$1 {
3728
- export { type ActionEvent$1 as ActionEvent, type Address$1 as Address, type AddressHint$1 as AddressHint, type context$1_Asset as Asset, type BaseEventMetadata$1 as BaseEventMetadata, type BusinessSchedule$1 as BusinessSchedule, type context$1_CancelScheduleOptions as CancelScheduleOptions, type context$1_CancelScheduleRequest as CancelScheduleRequest, type context$1_CancelScheduleResponse as CancelScheduleResponse, type context$1_CancelScheduleResponseNonNullableFields as CancelScheduleResponseNonNullableFields, type Categories$1 as Categories, type ChangeContext$1 as ChangeContext, type ChangeContextPayloadOneOf$1 as ChangeContextPayloadOneOf, type context$1_CloneScheduleOptions as CloneScheduleOptions, type context$1_CloneScheduleRequest as CloneScheduleRequest, type context$1_CloneScheduleResponse as CloneScheduleResponse, type context$1_CloneScheduleResponseNonNullableFields as CloneScheduleResponseNonNullableFields, type context$1_CommonIdentificationData as CommonIdentificationData, type context$1_CommonIdentificationDataIdOneOf as CommonIdentificationDataIdOneOf, type context$1_ConferencingDetails as ConferencingDetails, type ConsentPolicy$1 as ConsentPolicy, type context$1_CreateScheduleOptions as CreateScheduleOptions, type context$1_CreateScheduleRequest as CreateScheduleRequest, type context$1_CreateScheduleResponse as CreateScheduleResponse, type context$1_CreateScheduleResponseNonNullableFields as CreateScheduleResponseNonNullableFields, type context$1_CursorPaging as CursorPaging, type context$1_CursorPagingMetadata as CursorPagingMetadata, type context$1_CursorQuery as CursorQuery, type context$1_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context$1_Cursors as Cursors, DayOfWeek$1 as DayOfWeek, type context$1_DeleteContext as DeleteContext, context$1_DeleteStatus as DeleteStatus, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$1_ExtendedFields as ExtendedFields, type GeoCoordinates$1 as GeoCoordinates, type context$1_GetScheduleOptions as GetScheduleOptions, type context$1_GetScheduleRequest as GetScheduleRequest, type context$1_GetScheduleResponse as GetScheduleResponse, type context$1_GetScheduleResponseNonNullableFields as GetScheduleResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, context$1_IdentityType as IdentityType, type Locale$1 as Locale, type context$1_Location as Location, context$1_LocationType as LocationType, type MessageEnvelope$1 as MessageEnvelope, type context$1_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type context$1_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, type Multilingual$1 as Multilingual, context$1_Namespace as Namespace, type context$1_NamespaceChanged as NamespaceChanged, type context$1_ParticipantNotification as ParticipantNotification, type context$1_Permission as Permission, PlacementType$1 as PlacementType, type Properties$1 as Properties, type PropertiesChange$1 as PropertiesChange, type context$1_QuerySchedulesOptions as QuerySchedulesOptions, type context$1_QuerySchedulesRequest as QuerySchedulesRequest, type context$1_QuerySchedulesResponse as QuerySchedulesResponse, type context$1_QuerySchedulesResponseNonNullableFields as QuerySchedulesResponseNonNullableFields, context$1_RequestedFields as RequestedFields, ResolutionMethod$1 as ResolutionMethod, type RestoreInfo$1 as RestoreInfo, context$1_Role as Role, type context$1_Schedule as Schedule, type context$1_ScheduleCancelled as ScheduleCancelled, type context$1_ScheduleCancelledEnvelope as ScheduleCancelledEnvelope, type context$1_ScheduleCloned as ScheduleCloned, type context$1_ScheduleClonedEnvelope as ScheduleClonedEnvelope, type context$1_ScheduleCreatedEnvelope as ScheduleCreatedEnvelope, type context$1_ScheduleNonNullableFields as ScheduleNonNullableFields, type context$1_ScheduleUpdatedEnvelope as ScheduleUpdatedEnvelope, type context$1_ScheduleUpdatedWithMetadata as ScheduleUpdatedWithMetadata, type context$1_SchedulesQueryBuilder as SchedulesQueryBuilder, type context$1_SchedulesQueryResult as SchedulesQueryResult, type context$1_ServiceProvisioned as ServiceProvisioned, type context$1_ServiceRemoved as ServiceRemoved, type SiteCloned$1 as SiteCloned, type SiteCreated$1 as SiteCreated, context$1_SiteCreatedContext as SiteCreatedContext, type context$1_SiteDeleted as SiteDeleted, type context$1_SiteHardDeleted as SiteHardDeleted, type context$1_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type context$1_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type SitePropertiesEvent$1 as SitePropertiesEvent, type SitePropertiesNotification$1 as SitePropertiesNotification, type context$1_SitePublished as SitePublished, type context$1_SiteRenamed as SiteRenamed, type context$1_SiteTransferred as SiteTransferred, type context$1_SiteUndeleted as SiteUndeleted, type context$1_SiteUnpublished as SiteUnpublished, type SpecialHourPeriod$1 as SpecialHourPeriod, context$1_State as State, Status$1 as Status, type context$1_StudioAssigned as StudioAssigned, type context$1_StudioUnassigned as StudioUnassigned, type SupportedLanguage$1 as SupportedLanguage, type TimePeriod$1 as TimePeriod, type Translation$1 as Translation, context$1_Trigger as Trigger, context$1_Type as Type, type context$1_UpdateSchedule as UpdateSchedule, type context$1_UpdateScheduleOptions as UpdateScheduleOptions, type context$1_UpdateScheduleRequest as UpdateScheduleRequest, type context$1_UpdateScheduleResponse as UpdateScheduleResponse, type context$1_UpdateScheduleResponseNonNullableFields as UpdateScheduleResponseNonNullableFields, type context$1_V4SiteCreated as V4SiteCreated, WebhookIdentityType$1 as WebhookIdentityType, type context$1__publicOnScheduleCancelledType as _publicOnScheduleCancelledType, type context$1__publicOnScheduleClonedType as _publicOnScheduleClonedType, type context$1__publicOnScheduleCreatedType as _publicOnScheduleCreatedType, type context$1__publicOnScheduleUpdatedType as _publicOnScheduleUpdatedType, context$1_cancelSchedule as cancelSchedule, context$1_cloneSchedule as cloneSchedule, context$1_createSchedule as createSchedule, context$1_getSchedule as getSchedule, context$1_onScheduleCancelled as onScheduleCancelled, context$1_onScheduleCloned as onScheduleCloned, context$1_onScheduleCreated as onScheduleCreated, context$1_onScheduleUpdated as onScheduleUpdated, onScheduleCancelled$1 as publicOnScheduleCancelled, onScheduleCloned$1 as publicOnScheduleCloned, onScheduleCreated$1 as publicOnScheduleCreated, onScheduleUpdated$1 as publicOnScheduleUpdated, context$1_querySchedules as querySchedules, context$1_updateSchedule as updateSchedule };
4116
+ export { type ActionEvent$1 as ActionEvent, type Address$1 as Address, type AddressHint$1 as AddressHint, type context$1_Asset as Asset, type BaseEventMetadata$1 as BaseEventMetadata, type BusinessSchedule$1 as BusinessSchedule, type context$1_CancelScheduleOptions as CancelScheduleOptions, type context$1_CancelScheduleRequest as CancelScheduleRequest, type context$1_CancelScheduleResponse as CancelScheduleResponse, type context$1_CancelScheduleResponseNonNullableFields as CancelScheduleResponseNonNullableFields, type Categories$1 as Categories, type ChangeContext$1 as ChangeContext, type ChangeContextPayloadOneOf$1 as ChangeContextPayloadOneOf, type context$1_CloneScheduleRequest as CloneScheduleRequest, type context$1_CloneScheduleResponse as CloneScheduleResponse, type context$1_CommonIdentificationData as CommonIdentificationData, type context$1_CommonIdentificationDataIdOneOf as CommonIdentificationDataIdOneOf, type context$1_ConferencingDetails as ConferencingDetails, type ConsentPolicy$1 as ConsentPolicy, type context$1_CreateScheduleOptions as CreateScheduleOptions, type context$1_CreateScheduleRequest as CreateScheduleRequest, type context$1_CreateScheduleResponse as CreateScheduleResponse, type context$1_CreateScheduleResponseNonNullableFields as CreateScheduleResponseNonNullableFields, type context$1_CursorPaging as CursorPaging, type context$1_CursorPagingMetadata as CursorPagingMetadata, type context$1_CursorQuery as CursorQuery, type context$1_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context$1_Cursors as Cursors, DayOfWeek$1 as DayOfWeek, type context$1_DeleteContext as DeleteContext, context$1_DeleteStatus as DeleteStatus, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$1_ExtendedFields as ExtendedFields, type GeoCoordinates$1 as GeoCoordinates, type context$1_GetScheduleOptions as GetScheduleOptions, type context$1_GetScheduleRequest as GetScheduleRequest, type context$1_GetScheduleResponse as GetScheduleResponse, type context$1_GetScheduleResponseNonNullableFields as GetScheduleResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, context$1_IdentityType as IdentityType, type Locale$1 as Locale, type context$1_Location as Location, context$1_LocationType as LocationType, type MessageEnvelope$1 as MessageEnvelope, type context$1_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type context$1_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, type Multilingual$1 as Multilingual, context$1_Namespace as Namespace, type context$1_NamespaceChanged as NamespaceChanged, type context$1_ParticipantNotification as ParticipantNotification, type context$1_Permission as Permission, PlacementType$1 as PlacementType, type Properties$1 as Properties, type PropertiesChange$1 as PropertiesChange, type context$1_QuerySchedulesOptions as QuerySchedulesOptions, type context$1_QuerySchedulesRequest as QuerySchedulesRequest, type context$1_QuerySchedulesResponse as QuerySchedulesResponse, type context$1_QuerySchedulesResponseNonNullableFields as QuerySchedulesResponseNonNullableFields, context$1_RequestedFields as RequestedFields, ResolutionMethod$1 as ResolutionMethod, type RestoreInfo$1 as RestoreInfo, context$1_Role as Role, type context$1_Schedule as Schedule, type context$1_ScheduleCancelled as ScheduleCancelled, type context$1_ScheduleCancelledEnvelope as ScheduleCancelledEnvelope, type context$1_ScheduleCloned as ScheduleCloned, type context$1_ScheduleClonedEnvelope as ScheduleClonedEnvelope, type context$1_ScheduleCreatedEnvelope as ScheduleCreatedEnvelope, type context$1_ScheduleNonNullableFields as ScheduleNonNullableFields, type context$1_ScheduleUpdatedEnvelope as ScheduleUpdatedEnvelope, type context$1_ScheduleUpdatedWithMetadata as ScheduleUpdatedWithMetadata, type context$1_SchedulesQueryBuilder as SchedulesQueryBuilder, type context$1_SchedulesQueryResult as SchedulesQueryResult, type context$1_ServiceProvisioned as ServiceProvisioned, type context$1_ServiceRemoved as ServiceRemoved, type SiteCloned$1 as SiteCloned, type SiteCreated$1 as SiteCreated, context$1_SiteCreatedContext as SiteCreatedContext, type context$1_SiteDeleted as SiteDeleted, type context$1_SiteHardDeleted as SiteHardDeleted, type context$1_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type context$1_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type SitePropertiesEvent$1 as SitePropertiesEvent, type SitePropertiesNotification$1 as SitePropertiesNotification, type context$1_SitePublished as SitePublished, type context$1_SiteRenamed as SiteRenamed, type context$1_SiteTransferred as SiteTransferred, type context$1_SiteUndeleted as SiteUndeleted, type context$1_SiteUnpublished as SiteUnpublished, type SpecialHourPeriod$1 as SpecialHourPeriod, context$1_State as State, Status$1 as Status, type context$1_StudioAssigned as StudioAssigned, type context$1_StudioUnassigned as StudioUnassigned, type SupportedLanguage$1 as SupportedLanguage, type TimePeriod$1 as TimePeriod, type Translation$1 as Translation, context$1_Trigger as Trigger, context$1_Type as Type, type context$1_UpdateSchedule as UpdateSchedule, type context$1_UpdateScheduleOptions as UpdateScheduleOptions, type context$1_UpdateScheduleRequest as UpdateScheduleRequest, type context$1_UpdateScheduleResponse as UpdateScheduleResponse, type context$1_UpdateScheduleResponseNonNullableFields as UpdateScheduleResponseNonNullableFields, type context$1_V4SiteCreated as V4SiteCreated, WebhookIdentityType$1 as WebhookIdentityType, type context$1__publicOnScheduleCancelledType as _publicOnScheduleCancelledType, type context$1__publicOnScheduleClonedType as _publicOnScheduleClonedType, type context$1__publicOnScheduleCreatedType as _publicOnScheduleCreatedType, type context$1__publicOnScheduleUpdatedType as _publicOnScheduleUpdatedType, context$1_cancelSchedule as cancelSchedule, context$1_createSchedule as createSchedule, context$1_getSchedule as getSchedule, context$1_onScheduleCancelled as onScheduleCancelled, context$1_onScheduleCloned as onScheduleCloned, context$1_onScheduleCreated as onScheduleCreated, context$1_onScheduleUpdated as onScheduleUpdated, onScheduleCancelled$1 as publicOnScheduleCancelled, onScheduleCloned$1 as publicOnScheduleCloned, onScheduleCreated$1 as publicOnScheduleCreated, onScheduleUpdated$1 as publicOnScheduleUpdated, context$1_querySchedules as querySchedules, context$1_updateSchedule as updateSchedule };
3729
4117
  }
3730
4118
 
3731
4119
  interface ScheduleTimeFrame {
@@ -4260,13 +4648,6 @@ interface ScheduleTimeFrameUpdatedEnvelope {
4260
4648
  entity: ScheduleTimeFrame;
4261
4649
  metadata: EventMetadata;
4262
4650
  }
4263
- interface ScheduleTimeFrameCreatedEnvelope {
4264
- entity: ScheduleTimeFrame;
4265
- metadata: EventMetadata;
4266
- }
4267
- interface ScheduleTimeFrameDeletedEnvelope {
4268
- metadata: EventMetadata;
4269
- }
4270
4651
  interface GetScheduleTimeFrameOptions {
4271
4652
  /**
4272
4653
  * Optional time zone used to adjust the returned time.
@@ -4299,27 +4680,35 @@ interface ListScheduleTimeFramesSignature {
4299
4680
  */
4300
4681
  (ids: string[], options?: ListScheduleTimeFramesOptions | undefined): Promise<ListScheduleTimeFramesResponse & ListScheduleTimeFramesResponseNonNullableFields>;
4301
4682
  }
4302
- declare const onScheduleTimeFrameUpdated$1: EventDefinition<ScheduleTimeFrameUpdatedEnvelope, "wix.calendar.v3.schedule_time_frame_updated">;
4303
- declare const onScheduleTimeFrameCreated$1: EventDefinition<ScheduleTimeFrameCreatedEnvelope, "wix.calendar.v3.schedule_time_frame_created">;
4304
- declare const onScheduleTimeFrameDeleted$1: EventDefinition<ScheduleTimeFrameDeletedEnvelope, "wix.calendar.v3.schedule_time_frame_deleted">;
4683
+ declare const onScheduleTimeFrameUpdated$1: EventDefinition$3<ScheduleTimeFrameUpdatedEnvelope, "wix.calendar.v3.schedule_time_frame_updated">;
4684
+
4685
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
4686
+ __type: 'event-definition';
4687
+ type: Type;
4688
+ isDomainEvent?: boolean;
4689
+ transformations?: (envelope: unknown) => Payload;
4690
+ __payload: Payload;
4691
+ };
4692
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
4693
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
4694
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
4695
+
4696
+ declare global {
4697
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
4698
+ interface SymbolConstructor {
4699
+ readonly observable: symbol;
4700
+ }
4701
+ }
4305
4702
 
4306
4703
  declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4307
4704
 
4308
- declare const getScheduleTimeFrame: BuildRESTFunction<typeof getScheduleTimeFrame$1> & typeof getScheduleTimeFrame$1;
4309
- declare const listScheduleTimeFrames: BuildRESTFunction<typeof listScheduleTimeFrames$1> & typeof listScheduleTimeFrames$1;
4705
+ declare const getScheduleTimeFrame: MaybeContext<BuildRESTFunction<typeof getScheduleTimeFrame$1> & typeof getScheduleTimeFrame$1>;
4706
+ declare const listScheduleTimeFrames: MaybeContext<BuildRESTFunction<typeof listScheduleTimeFrames$1> & typeof listScheduleTimeFrames$1>;
4310
4707
 
4311
4708
  type _publicOnScheduleTimeFrameUpdatedType = typeof onScheduleTimeFrameUpdated$1;
4312
4709
  /** */
4313
4710
  declare const onScheduleTimeFrameUpdated: ReturnType<typeof createEventModule<_publicOnScheduleTimeFrameUpdatedType>>;
4314
4711
 
4315
- type _publicOnScheduleTimeFrameCreatedType = typeof onScheduleTimeFrameCreated$1;
4316
- /** */
4317
- declare const onScheduleTimeFrameCreated: ReturnType<typeof createEventModule<_publicOnScheduleTimeFrameCreatedType>>;
4318
-
4319
- type _publicOnScheduleTimeFrameDeletedType = typeof onScheduleTimeFrameDeleted$1;
4320
- /** */
4321
- declare const onScheduleTimeFrameDeleted: ReturnType<typeof createEventModule<_publicOnScheduleTimeFrameDeletedType>>;
4322
-
4323
4712
  type context_ActionEvent = ActionEvent;
4324
4713
  type context_Address = Address;
4325
4714
  type context_AddressHint = AddressHint;
@@ -4360,8 +4749,6 @@ type context_ResolutionMethod = ResolutionMethod;
4360
4749
  declare const context_ResolutionMethod: typeof ResolutionMethod;
4361
4750
  type context_RestoreInfo = RestoreInfo;
4362
4751
  type context_ScheduleTimeFrame = ScheduleTimeFrame;
4363
- type context_ScheduleTimeFrameCreatedEnvelope = ScheduleTimeFrameCreatedEnvelope;
4364
- type context_ScheduleTimeFrameDeletedEnvelope = ScheduleTimeFrameDeletedEnvelope;
4365
4752
  type context_ScheduleTimeFrameNonNullableFields = ScheduleTimeFrameNonNullableFields;
4366
4753
  type context_ScheduleTimeFrameUpdatedEnvelope = ScheduleTimeFrameUpdatedEnvelope;
4367
4754
  type context_ScheduleTimeFrameUpdatedWithMetadata = ScheduleTimeFrameUpdatedWithMetadata;
@@ -4378,16 +4765,12 @@ type context_Translation = Translation;
4378
4765
  type context_WebhookIdentityType = WebhookIdentityType;
4379
4766
  declare const context_WebhookIdentityType: typeof WebhookIdentityType;
4380
4767
  type context_ZonedDate = ZonedDate;
4381
- type context__publicOnScheduleTimeFrameCreatedType = _publicOnScheduleTimeFrameCreatedType;
4382
- type context__publicOnScheduleTimeFrameDeletedType = _publicOnScheduleTimeFrameDeletedType;
4383
4768
  type context__publicOnScheduleTimeFrameUpdatedType = _publicOnScheduleTimeFrameUpdatedType;
4384
4769
  declare const context_getScheduleTimeFrame: typeof getScheduleTimeFrame;
4385
4770
  declare const context_listScheduleTimeFrames: typeof listScheduleTimeFrames;
4386
- declare const context_onScheduleTimeFrameCreated: typeof onScheduleTimeFrameCreated;
4387
- declare const context_onScheduleTimeFrameDeleted: typeof onScheduleTimeFrameDeleted;
4388
4771
  declare const context_onScheduleTimeFrameUpdated: typeof onScheduleTimeFrameUpdated;
4389
4772
  declare namespace context {
4390
- export { type context_ActionEvent as ActionEvent, type context_Address as Address, type context_AddressHint as AddressHint, type context_BaseEventMetadata as BaseEventMetadata, type context_BusinessSchedule as BusinessSchedule, type context_Categories as Categories, type context_ChangeContext as ChangeContext, type context_ChangeContextPayloadOneOf as ChangeContextPayloadOneOf, type context_ConsentPolicy as ConsentPolicy, context_DayOfWeek as DayOfWeek, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_Empty as Empty, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_GeoCoordinates as GeoCoordinates, type context_GetScheduleTimeFrameOptions as GetScheduleTimeFrameOptions, type context_GetScheduleTimeFrameRequest as GetScheduleTimeFrameRequest, type context_GetScheduleTimeFrameResponse as GetScheduleTimeFrameResponse, type context_GetScheduleTimeFrameResponseNonNullableFields as GetScheduleTimeFrameResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_ListScheduleTimeFramesOptions as ListScheduleTimeFramesOptions, type context_ListScheduleTimeFramesRequest as ListScheduleTimeFramesRequest, type context_ListScheduleTimeFramesResponse as ListScheduleTimeFramesResponse, type context_ListScheduleTimeFramesResponseNonNullableFields as ListScheduleTimeFramesResponseNonNullableFields, type context_Locale as Locale, type context_MessageEnvelope as MessageEnvelope, type context_Multilingual as Multilingual, context_PlacementType as PlacementType, type context_Properties as Properties, type context_PropertiesChange as PropertiesChange, context_ResolutionMethod as ResolutionMethod, type context_RestoreInfo as RestoreInfo, type context_ScheduleTimeFrame as ScheduleTimeFrame, type context_ScheduleTimeFrameCreatedEnvelope as ScheduleTimeFrameCreatedEnvelope, type context_ScheduleTimeFrameDeletedEnvelope as ScheduleTimeFrameDeletedEnvelope, type context_ScheduleTimeFrameNonNullableFields as ScheduleTimeFrameNonNullableFields, type context_ScheduleTimeFrameUpdatedEnvelope as ScheduleTimeFrameUpdatedEnvelope, type context_ScheduleTimeFrameUpdatedWithMetadata as ScheduleTimeFrameUpdatedWithMetadata, type context_SiteCloned as SiteCloned, type context_SiteCreated as SiteCreated, type context_SitePropertiesEvent as SitePropertiesEvent, type context_SitePropertiesNotification as SitePropertiesNotification, type context_SpecialHourPeriod as SpecialHourPeriod, context_Status as Status, type context_SupportedLanguage as SupportedLanguage, type context_TimePeriod as TimePeriod, type context_Translation as Translation, context_WebhookIdentityType as WebhookIdentityType, type context_ZonedDate as ZonedDate, type context__publicOnScheduleTimeFrameCreatedType as _publicOnScheduleTimeFrameCreatedType, type context__publicOnScheduleTimeFrameDeletedType as _publicOnScheduleTimeFrameDeletedType, type context__publicOnScheduleTimeFrameUpdatedType as _publicOnScheduleTimeFrameUpdatedType, context_getScheduleTimeFrame as getScheduleTimeFrame, context_listScheduleTimeFrames as listScheduleTimeFrames, context_onScheduleTimeFrameCreated as onScheduleTimeFrameCreated, context_onScheduleTimeFrameDeleted as onScheduleTimeFrameDeleted, context_onScheduleTimeFrameUpdated as onScheduleTimeFrameUpdated, onScheduleTimeFrameCreated$1 as publicOnScheduleTimeFrameCreated, onScheduleTimeFrameDeleted$1 as publicOnScheduleTimeFrameDeleted, onScheduleTimeFrameUpdated$1 as publicOnScheduleTimeFrameUpdated };
4773
+ export { type context_ActionEvent as ActionEvent, type context_Address as Address, type context_AddressHint as AddressHint, type context_BaseEventMetadata as BaseEventMetadata, type context_BusinessSchedule as BusinessSchedule, type context_Categories as Categories, type context_ChangeContext as ChangeContext, type context_ChangeContextPayloadOneOf as ChangeContextPayloadOneOf, type context_ConsentPolicy as ConsentPolicy, context_DayOfWeek as DayOfWeek, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_Empty as Empty, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_GeoCoordinates as GeoCoordinates, type context_GetScheduleTimeFrameOptions as GetScheduleTimeFrameOptions, type context_GetScheduleTimeFrameRequest as GetScheduleTimeFrameRequest, type context_GetScheduleTimeFrameResponse as GetScheduleTimeFrameResponse, type context_GetScheduleTimeFrameResponseNonNullableFields as GetScheduleTimeFrameResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_ListScheduleTimeFramesOptions as ListScheduleTimeFramesOptions, type context_ListScheduleTimeFramesRequest as ListScheduleTimeFramesRequest, type context_ListScheduleTimeFramesResponse as ListScheduleTimeFramesResponse, type context_ListScheduleTimeFramesResponseNonNullableFields as ListScheduleTimeFramesResponseNonNullableFields, type context_Locale as Locale, type context_MessageEnvelope as MessageEnvelope, type context_Multilingual as Multilingual, context_PlacementType as PlacementType, type context_Properties as Properties, type context_PropertiesChange as PropertiesChange, context_ResolutionMethod as ResolutionMethod, type context_RestoreInfo as RestoreInfo, type context_ScheduleTimeFrame as ScheduleTimeFrame, type context_ScheduleTimeFrameNonNullableFields as ScheduleTimeFrameNonNullableFields, type context_ScheduleTimeFrameUpdatedEnvelope as ScheduleTimeFrameUpdatedEnvelope, type context_ScheduleTimeFrameUpdatedWithMetadata as ScheduleTimeFrameUpdatedWithMetadata, type context_SiteCloned as SiteCloned, type context_SiteCreated as SiteCreated, type context_SitePropertiesEvent as SitePropertiesEvent, type context_SitePropertiesNotification as SitePropertiesNotification, type context_SpecialHourPeriod as SpecialHourPeriod, context_Status as Status, type context_SupportedLanguage as SupportedLanguage, type context_TimePeriod as TimePeriod, type context_Translation as Translation, context_WebhookIdentityType as WebhookIdentityType, type context_ZonedDate as ZonedDate, type context__publicOnScheduleTimeFrameUpdatedType as _publicOnScheduleTimeFrameUpdatedType, context_getScheduleTimeFrame as getScheduleTimeFrame, context_listScheduleTimeFrames as listScheduleTimeFrames, context_onScheduleTimeFrameUpdated as onScheduleTimeFrameUpdated, onScheduleTimeFrameUpdated$1 as publicOnScheduleTimeFrameUpdated };
4391
4774
  }
4392
4775
 
4393
4776
  export { context$2 as events, context as scheduleTimeFrames, context$1 as schedules };