@wix/calendar 1.0.22 → 1.0.24
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 +7 -7
- package/type-bundles/context.bundle.d.ts +2539 -649
- package/type-bundles/index.bundle.d.ts +2539 -649
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type HostModule<T, H extends Host> = {
|
|
1
|
+
type HostModule$4<T, H extends Host$4> = {
|
|
2
2
|
__type: 'host';
|
|
3
3
|
create(host: H): T;
|
|
4
4
|
};
|
|
5
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
-
type Host<Environment = unknown> = {
|
|
5
|
+
type HostModuleAPI$4<T extends HostModule$4<any, any>> = T extends HostModule$4<infer U, any> ? U : never;
|
|
6
|
+
type Host$4<Environment = unknown> = {
|
|
7
7
|
channel: {
|
|
8
8
|
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
9
|
disconnect: () => void;
|
|
@@ -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
|
*/
|
|
@@ -36,92 +40,92 @@ type Host<Environment = unknown> = {
|
|
|
36
40
|
};
|
|
37
41
|
};
|
|
38
42
|
|
|
39
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
40
|
-
interface HttpClient {
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
43
|
+
type RESTFunctionDescriptor$4<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$4) => T;
|
|
44
|
+
interface HttpClient$4 {
|
|
45
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$4<TResponse, TData>): Promise<HttpResponse$4<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<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
47
|
-
type HttpResponse<T = any> = {
|
|
50
|
+
type RequestOptionsFactory$4<TResponse = any, TData = any> = (context: any) => RequestOptions$4<TResponse, TData>;
|
|
51
|
+
type HttpResponse$4<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<_TResponse = any, Data = any> = {
|
|
58
|
+
type RequestOptions$4<_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;
|
|
60
|
-
type APIMetadata = {
|
|
63
|
+
} & APIMetadata$4;
|
|
64
|
+
type APIMetadata$4 = {
|
|
61
65
|
methodFqn?: string;
|
|
62
66
|
entityFqdn?: string;
|
|
63
67
|
packageName?: string;
|
|
64
68
|
};
|
|
65
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
66
|
-
type EventDefinition$
|
|
69
|
+
type BuildRESTFunction$4<T extends RESTFunctionDescriptor$4> = T extends RESTFunctionDescriptor$4<infer U> ? U : never;
|
|
70
|
+
type EventDefinition$4<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$
|
|
74
|
-
type EventHandler$
|
|
75
|
-
type BuildEventDefinition$
|
|
77
|
+
declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
78
|
+
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
79
|
+
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
76
80
|
|
|
77
|
-
type ServicePluginMethodInput = {
|
|
81
|
+
type ServicePluginMethodInput$4 = {
|
|
78
82
|
request: any;
|
|
79
83
|
metadata: any;
|
|
80
84
|
};
|
|
81
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
82
|
-
type ServicePluginMethodMetadata = {
|
|
85
|
+
type ServicePluginContract$4 = Record<string, (payload: ServicePluginMethodInput$4) => unknown | Promise<unknown>>;
|
|
86
|
+
type ServicePluginMethodMetadata$4 = {
|
|
83
87
|
name: string;
|
|
84
88
|
primaryHttpMappingPath: string;
|
|
85
89
|
transformations: {
|
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
90
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$4;
|
|
87
91
|
toREST: (...args: unknown[]) => unknown;
|
|
88
92
|
};
|
|
89
93
|
};
|
|
90
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
94
|
+
type ServicePluginDefinition$4<Contract extends ServicePluginContract$4> = {
|
|
91
95
|
__type: 'service-plugin-definition';
|
|
92
96
|
componentType: string;
|
|
93
|
-
methods: ServicePluginMethodMetadata[];
|
|
97
|
+
methods: ServicePluginMethodMetadata$4[];
|
|
94
98
|
__contract: Contract;
|
|
95
99
|
};
|
|
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";
|
|
100
|
+
declare function ServicePluginDefinition$4<Contract extends ServicePluginContract$4>(componentType: string, methods: ServicePluginMethodMetadata$4[]): ServicePluginDefinition$4<Contract>;
|
|
101
|
+
type BuildServicePluginDefinition$4<T extends ServicePluginDefinition$4<any>> = (implementation: T['__contract']) => void;
|
|
102
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$4 = "wix_spi_error";
|
|
99
103
|
|
|
100
|
-
type RequestContext = {
|
|
104
|
+
type RequestContext$4 = {
|
|
101
105
|
isSSR: boolean;
|
|
102
106
|
host: string;
|
|
103
107
|
protocol?: string;
|
|
104
108
|
};
|
|
105
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
109
|
+
type ResponseTransformer$4 = (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 = '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> = {
|
|
115
|
+
type Method$4 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
116
|
+
type AmbassadorRequestOptions$4<T = any> = {
|
|
113
117
|
_?: T;
|
|
114
118
|
url?: string;
|
|
115
|
-
method?: Method;
|
|
119
|
+
method?: Method$4;
|
|
116
120
|
params?: any;
|
|
117
121
|
data?: any;
|
|
118
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
122
|
+
transformResponse?: ResponseTransformer$4 | ResponseTransformer$4[];
|
|
119
123
|
};
|
|
120
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
124
|
+
type AmbassadorFactory$4<Request, Response> = (payload: Request) => ((context: RequestContext$4) => AmbassadorRequestOptions$4<Response>) & {
|
|
121
125
|
__isAmbassador: boolean;
|
|
122
126
|
};
|
|
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;
|
|
127
|
+
type AmbassadorFunctionDescriptor$4<Request = any, Response = any> = AmbassadorFactory$4<Request, Response>;
|
|
128
|
+
type BuildAmbassadorFunction$4<T extends AmbassadorFunctionDescriptor$4> = T extends AmbassadorFunctionDescriptor$4<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: unique symbol;
|
|
137
|
+
declare const emptyObjectSymbol$4: 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 = {[emptyObjectSymbol]?: never};
|
|
165
|
+
type EmptyObject$4 = {[emptyObjectSymbol$4]?: 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<A, B> =
|
|
193
|
+
type IsEqual$4<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<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
226
|
+
type Filter$4<KeyType, ExcludeType> = IsEqual$4<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
227
|
|
|
224
|
-
type ExceptOptions = {
|
|
228
|
+
type ExceptOptions$4 = {
|
|
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<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
269
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
272
|
+
type Except$4<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$4 = {requireExactProps: false}> = {
|
|
273
|
+
[KeyType in keyof ObjectType as Filter$4<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$4<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$4<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
341
|
+
IsNever$4<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> =
|
|
307
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
376
|
+
type ConditionalKeys$4<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
|
|
314
|
-
|
|
382
|
+
// Retain this key
|
|
383
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
384
|
+
? IfNever$4<Base[Key], IfNever$4<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<Base, Condition> = Except<
|
|
428
|
+
type ConditionalExcept$4<Base, Condition> = Except$4<
|
|
361
429
|
Base,
|
|
362
|
-
ConditionalKeys<Base, Condition>
|
|
430
|
+
ConditionalKeys$4<Base, Condition>
|
|
363
431
|
>;
|
|
364
432
|
|
|
365
433
|
/**
|
|
@@ -367,8 +435,8 @@ 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$
|
|
371
|
-
[key: string]: Descriptors | PublicMetadata | any;
|
|
438
|
+
type Descriptors$4 = RESTFunctionDescriptor$4 | AmbassadorFunctionDescriptor$4 | HostModule$4<any, any> | EventDefinition$4<any> | ServicePluginDefinition$4<any> | {
|
|
439
|
+
[key: string]: Descriptors$4 | PublicMetadata$4 | 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 = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostM
|
|
|
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<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
447
|
+
type BuildDescriptors$4<T extends Descriptors$4, H extends Host$4<any> | undefined, Depth extends number = 5> = {
|
|
380
448
|
done: T;
|
|
381
449
|
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$
|
|
384
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
450
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$4;
|
|
451
|
+
} ? never : T extends AmbassadorFunctionDescriptor$4 ? BuildAmbassadorFunction$4<T> : T extends RESTFunctionDescriptor$4 ? BuildRESTFunction$4<T> : T extends EventDefinition$4<any> ? BuildEventDefinition$4<T> : T extends ServicePluginDefinition$4<any> ? BuildServicePluginDefinition$4<T> : T extends HostModule$4<any, any> ? HostModuleAPI$4<T> : ConditionalExcept$4<{
|
|
452
|
+
[Key in keyof T]: T[Key] extends Descriptors$4 ? BuildDescriptors$4<T[Key], H, [
|
|
385
453
|
-1,
|
|
386
454
|
0,
|
|
387
455
|
1,
|
|
@@ -390,9 +458,9 @@ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, De
|
|
|
390
458
|
4,
|
|
391
459
|
5
|
|
392
460
|
][Depth]> : never;
|
|
393
|
-
}, EmptyObject>;
|
|
461
|
+
}, EmptyObject$4>;
|
|
394
462
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
-
type PublicMetadata = {
|
|
463
|
+
type PublicMetadata$4 = {
|
|
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<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
408
|
-
host: Host;
|
|
409
|
-
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
475
|
+
type MaybeContext$4<T extends Descriptors$4> = globalThis.ContextualClient extends {
|
|
476
|
+
host: Host$4;
|
|
477
|
+
} ? BuildDescriptors$4<T, globalThis.ContextualClient['host']> : T;
|
|
410
478
|
|
|
411
479
|
interface Event$1 {
|
|
412
480
|
/**
|
|
@@ -2351,7 +2419,7 @@ interface ListEventsByMemberIdOptions {
|
|
|
2351
2419
|
eventIds?: string[];
|
|
2352
2420
|
}
|
|
2353
2421
|
|
|
2354
|
-
declare function getEvent$1(httpClient: HttpClient): GetEventSignature;
|
|
2422
|
+
declare function getEvent$1(httpClient: HttpClient$4): GetEventSignature;
|
|
2355
2423
|
interface GetEventSignature {
|
|
2356
2424
|
/**
|
|
2357
2425
|
* Retrieves an event by ID.
|
|
@@ -2360,7 +2428,7 @@ interface GetEventSignature {
|
|
|
2360
2428
|
*/
|
|
2361
2429
|
(eventId: string | null, options?: GetEventOptions | undefined): Promise<Event$1 & EventNonNullableFields>;
|
|
2362
2430
|
}
|
|
2363
|
-
declare function listEvents$1(httpClient: HttpClient): ListEventsSignature;
|
|
2431
|
+
declare function listEvents$1(httpClient: HttpClient$4): ListEventsSignature;
|
|
2364
2432
|
interface ListEventsSignature {
|
|
2365
2433
|
/**
|
|
2366
2434
|
* Retrieves a list of events by their IDs.
|
|
@@ -2368,7 +2436,7 @@ interface ListEventsSignature {
|
|
|
2368
2436
|
*/
|
|
2369
2437
|
(eventIds: string[], options?: ListEventsOptions | undefined): Promise<ListEventsResponse & ListEventsResponseNonNullableFields>;
|
|
2370
2438
|
}
|
|
2371
|
-
declare function queryEvents$1(httpClient: HttpClient): QueryEventsSignature;
|
|
2439
|
+
declare function queryEvents$1(httpClient: HttpClient$4): QueryEventsSignature;
|
|
2372
2440
|
interface QueryEventsSignature {
|
|
2373
2441
|
/**
|
|
2374
2442
|
* Query events given the provided time range, filters and paging.
|
|
@@ -2378,7 +2446,7 @@ interface QueryEventsSignature {
|
|
|
2378
2446
|
*/
|
|
2379
2447
|
(options?: QueryEventsOptions | undefined): EventsQueryBuilder;
|
|
2380
2448
|
}
|
|
2381
|
-
declare function createEvent$1(httpClient: HttpClient): CreateEventSignature;
|
|
2449
|
+
declare function createEvent$1(httpClient: HttpClient$4): CreateEventSignature;
|
|
2382
2450
|
interface CreateEventSignature {
|
|
2383
2451
|
/**
|
|
2384
2452
|
* Creates an event.
|
|
@@ -2387,7 +2455,7 @@ interface CreateEventSignature {
|
|
|
2387
2455
|
*/
|
|
2388
2456
|
(event: Event$1, options?: CreateEventOptions | undefined): Promise<Event$1 & EventNonNullableFields>;
|
|
2389
2457
|
}
|
|
2390
|
-
declare function bulkCreateEvent$1(httpClient: HttpClient): BulkCreateEventSignature;
|
|
2458
|
+
declare function bulkCreateEvent$1(httpClient: HttpClient$4): BulkCreateEventSignature;
|
|
2391
2459
|
interface BulkCreateEventSignature {
|
|
2392
2460
|
/**
|
|
2393
2461
|
* Creates multiple events in bulk.
|
|
@@ -2395,7 +2463,7 @@ interface BulkCreateEventSignature {
|
|
|
2395
2463
|
*/
|
|
2396
2464
|
(events: MaskedEvent[], options?: BulkCreateEventOptions | undefined): Promise<BulkCreateEventResponse & BulkCreateEventResponseNonNullableFields>;
|
|
2397
2465
|
}
|
|
2398
|
-
declare function updateEvent$1(httpClient: HttpClient): UpdateEventSignature;
|
|
2466
|
+
declare function updateEvent$1(httpClient: HttpClient$4): UpdateEventSignature;
|
|
2399
2467
|
interface UpdateEventSignature {
|
|
2400
2468
|
/**
|
|
2401
2469
|
* Updates an event.
|
|
@@ -2404,7 +2472,7 @@ interface UpdateEventSignature {
|
|
|
2404
2472
|
*/
|
|
2405
2473
|
(_id: string | null, event: UpdateEvent, options?: UpdateEventOptions | undefined): Promise<Event$1 & EventNonNullableFields>;
|
|
2406
2474
|
}
|
|
2407
|
-
declare function bulkUpdateEvent$1(httpClient: HttpClient): BulkUpdateEventSignature;
|
|
2475
|
+
declare function bulkUpdateEvent$1(httpClient: HttpClient$4): BulkUpdateEventSignature;
|
|
2408
2476
|
interface BulkUpdateEventSignature {
|
|
2409
2477
|
/**
|
|
2410
2478
|
* Updates multiple events in bulk.
|
|
@@ -2412,7 +2480,7 @@ interface BulkUpdateEventSignature {
|
|
|
2412
2480
|
*/
|
|
2413
2481
|
(events: BulkUpdateEventRequestMaskedEvent[], options?: BulkUpdateEventOptions | undefined): Promise<BulkUpdateEventResponse & BulkUpdateEventResponseNonNullableFields>;
|
|
2414
2482
|
}
|
|
2415
|
-
declare function restoreEventDefaults$1(httpClient: HttpClient): RestoreEventDefaultsSignature;
|
|
2483
|
+
declare function restoreEventDefaults$1(httpClient: HttpClient$4): RestoreEventDefaultsSignature;
|
|
2416
2484
|
interface RestoreEventDefaultsSignature {
|
|
2417
2485
|
/**
|
|
2418
2486
|
* Restore default event values from the schedule or the recurring event.
|
|
@@ -2421,7 +2489,7 @@ interface RestoreEventDefaultsSignature {
|
|
|
2421
2489
|
*/
|
|
2422
2490
|
(eventId: string | null, fields: Field$1[], options?: RestoreEventDefaultsOptions | undefined): Promise<RestoreEventDefaultsResponse & RestoreEventDefaultsResponseNonNullableFields>;
|
|
2423
2491
|
}
|
|
2424
|
-
declare function splitRecurringEvent$1(httpClient: HttpClient): SplitRecurringEventSignature;
|
|
2492
|
+
declare function splitRecurringEvent$1(httpClient: HttpClient$4): SplitRecurringEventSignature;
|
|
2425
2493
|
interface SplitRecurringEventSignature {
|
|
2426
2494
|
/**
|
|
2427
2495
|
* Splits a recurring event at a provided future date into two recurring events.
|
|
@@ -2441,7 +2509,7 @@ interface SplitRecurringEventSignature {
|
|
|
2441
2509
|
*/
|
|
2442
2510
|
(recurringEventId: string | null, splitLocalDate: string | null, options?: SplitRecurringEventOptions | undefined): Promise<SplitRecurringEventResponse & SplitRecurringEventResponseNonNullableFields>;
|
|
2443
2511
|
}
|
|
2444
|
-
declare function cancelEvent$1(httpClient: HttpClient): CancelEventSignature;
|
|
2512
|
+
declare function cancelEvent$1(httpClient: HttpClient$4): CancelEventSignature;
|
|
2445
2513
|
interface CancelEventSignature {
|
|
2446
2514
|
/**
|
|
2447
2515
|
* Cancels an event.
|
|
@@ -2449,7 +2517,7 @@ interface CancelEventSignature {
|
|
|
2449
2517
|
*/
|
|
2450
2518
|
(eventId: string | null, options?: CancelEventOptions | undefined): Promise<CancelEventResponse & CancelEventResponseNonNullableFields>;
|
|
2451
2519
|
}
|
|
2452
|
-
declare function bulkCancelEvent$1(httpClient: HttpClient): BulkCancelEventSignature;
|
|
2520
|
+
declare function bulkCancelEvent$1(httpClient: HttpClient$4): BulkCancelEventSignature;
|
|
2453
2521
|
interface BulkCancelEventSignature {
|
|
2454
2522
|
/**
|
|
2455
2523
|
* Cancels multiple events in bulk.
|
|
@@ -2457,7 +2525,7 @@ interface BulkCancelEventSignature {
|
|
|
2457
2525
|
*/
|
|
2458
2526
|
(eventIds: string[], options?: BulkCancelEventOptions | undefined): Promise<BulkCancelEventResponse & BulkCancelEventResponseNonNullableFields>;
|
|
2459
2527
|
}
|
|
2460
|
-
declare function listEventsByContactId$1(httpClient: HttpClient): ListEventsByContactIdSignature;
|
|
2528
|
+
declare function listEventsByContactId$1(httpClient: HttpClient$4): ListEventsByContactIdSignature;
|
|
2461
2529
|
interface ListEventsByContactIdSignature {
|
|
2462
2530
|
/**
|
|
2463
2531
|
* Retrieves a list of events by a participant's contact ID.
|
|
@@ -2469,7 +2537,7 @@ interface ListEventsByContactIdSignature {
|
|
|
2469
2537
|
*/
|
|
2470
2538
|
(contactId: string | null, options?: ListEventsByContactIdOptions | undefined): Promise<ListEventsByContactIdResponse & ListEventsByContactIdResponseNonNullableFields>;
|
|
2471
2539
|
}
|
|
2472
|
-
declare function listEventsByMemberId$1(httpClient: HttpClient): ListEventsByMemberIdSignature;
|
|
2540
|
+
declare function listEventsByMemberId$1(httpClient: HttpClient$4): ListEventsByMemberIdSignature;
|
|
2473
2541
|
interface ListEventsByMemberIdSignature {
|
|
2474
2542
|
/**
|
|
2475
2543
|
* Retrieves a list of events by a participant's member ID.
|
|
@@ -2485,44 +2553,26 @@ interface ListEventsByMemberIdSignature {
|
|
|
2485
2553
|
*/
|
|
2486
2554
|
(memberId: string | null, options?: ListEventsByMemberIdOptions | undefined): Promise<ListEventsByMemberIdResponse & ListEventsByMemberIdResponseNonNullableFields>;
|
|
2487
2555
|
}
|
|
2488
|
-
declare const onEventCreated$1: EventDefinition$
|
|
2489
|
-
declare const onEventUpdated$1: EventDefinition$
|
|
2490
|
-
declare const onEventRecurringSplit$1: EventDefinition$
|
|
2491
|
-
declare const onEventCancelled$1: EventDefinition$
|
|
2492
|
-
|
|
2493
|
-
type EventDefinition$4<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$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
2501
|
-
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
2502
|
-
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
2503
|
-
|
|
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
|
-
}
|
|
2556
|
+
declare const onEventCreated$1: EventDefinition$4<EventCreatedEnvelope, "wix.calendar.v3.event_created">;
|
|
2557
|
+
declare const onEventUpdated$1: EventDefinition$4<EventUpdatedEnvelope, "wix.calendar.v3.event_updated">;
|
|
2558
|
+
declare const onEventRecurringSplit$1: EventDefinition$4<EventRecurringSplitEnvelope, "wix.calendar.v3.event_recurring_split">;
|
|
2559
|
+
declare const onEventCancelled$1: EventDefinition$4<EventCancelledEnvelope, "wix.calendar.v3.event_cancelled">;
|
|
2510
2560
|
|
|
2511
2561
|
declare function createEventModule$4<T extends EventDefinition$4<any, string>>(eventDefinition: T): BuildEventDefinition$4<T> & T;
|
|
2512
2562
|
|
|
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>;
|
|
2563
|
+
declare const getEvent: MaybeContext$4<BuildRESTFunction$4<typeof getEvent$1> & typeof getEvent$1>;
|
|
2564
|
+
declare const listEvents: MaybeContext$4<BuildRESTFunction$4<typeof listEvents$1> & typeof listEvents$1>;
|
|
2565
|
+
declare const queryEvents: MaybeContext$4<BuildRESTFunction$4<typeof queryEvents$1> & typeof queryEvents$1>;
|
|
2566
|
+
declare const createEvent: MaybeContext$4<BuildRESTFunction$4<typeof createEvent$1> & typeof createEvent$1>;
|
|
2567
|
+
declare const bulkCreateEvent: MaybeContext$4<BuildRESTFunction$4<typeof bulkCreateEvent$1> & typeof bulkCreateEvent$1>;
|
|
2568
|
+
declare const updateEvent: MaybeContext$4<BuildRESTFunction$4<typeof updateEvent$1> & typeof updateEvent$1>;
|
|
2569
|
+
declare const bulkUpdateEvent: MaybeContext$4<BuildRESTFunction$4<typeof bulkUpdateEvent$1> & typeof bulkUpdateEvent$1>;
|
|
2570
|
+
declare const restoreEventDefaults: MaybeContext$4<BuildRESTFunction$4<typeof restoreEventDefaults$1> & typeof restoreEventDefaults$1>;
|
|
2571
|
+
declare const splitRecurringEvent: MaybeContext$4<BuildRESTFunction$4<typeof splitRecurringEvent$1> & typeof splitRecurringEvent$1>;
|
|
2572
|
+
declare const cancelEvent: MaybeContext$4<BuildRESTFunction$4<typeof cancelEvent$1> & typeof cancelEvent$1>;
|
|
2573
|
+
declare const bulkCancelEvent: MaybeContext$4<BuildRESTFunction$4<typeof bulkCancelEvent$1> & typeof bulkCancelEvent$1>;
|
|
2574
|
+
declare const listEventsByContactId: MaybeContext$4<BuildRESTFunction$4<typeof listEventsByContactId$1> & typeof listEventsByContactId$1>;
|
|
2575
|
+
declare const listEventsByMemberId: MaybeContext$4<BuildRESTFunction$4<typeof listEventsByMemberId$1> & typeof listEventsByMemberId$1>;
|
|
2526
2576
|
|
|
2527
2577
|
type _publicOnEventCreatedType = typeof onEventCreated$1;
|
|
2528
2578
|
/** */
|
|
@@ -2646,145 +2696,623 @@ declare namespace context$4 {
|
|
|
2646
2696
|
export { type ActionEvent$4 as ActionEvent, type Address$2 as Address, type AddressHint$2 as AddressHint, type context$4_ApplicationError as ApplicationError, type BaseEventMetadata$4 as BaseEventMetadata, type context$4_BulkActionMetadata as BulkActionMetadata, type context$4_BulkCancelEventOptions as BulkCancelEventOptions, type context$4_BulkCancelEventRequest as BulkCancelEventRequest, type context$4_BulkCancelEventResponse as BulkCancelEventResponse, type context$4_BulkCancelEventResponseNonNullableFields as BulkCancelEventResponseNonNullableFields, type context$4_BulkCreateEventOptions as BulkCreateEventOptions, type context$4_BulkCreateEventRequest as BulkCreateEventRequest, type context$4_BulkCreateEventResponse as BulkCreateEventResponse, type context$4_BulkCreateEventResponseNonNullableFields as BulkCreateEventResponseNonNullableFields, type context$4_BulkEventResult as BulkEventResult, type context$4_BulkUpdateEventOptions as BulkUpdateEventOptions, type context$4_BulkUpdateEventRequest as BulkUpdateEventRequest, type context$4_BulkUpdateEventRequestMaskedEvent as BulkUpdateEventRequestMaskedEvent, type context$4_BulkUpdateEventResponse as BulkUpdateEventResponse, type context$4_BulkUpdateEventResponseNonNullableFields as BulkUpdateEventResponseNonNullableFields, type BusinessSchedule$2 as BusinessSchedule, type context$4_CancelEventOptions as CancelEventOptions, type context$4_CancelEventRequest as CancelEventRequest, type context$4_CancelEventResponse as CancelEventResponse, type context$4_CancelEventResponseNonNullableFields as CancelEventResponseNonNullableFields, type Categories$2 as Categories, type ChangeContext$2 as ChangeContext, type ChangeContextPayloadOneOf$2 as ChangeContextPayloadOneOf, type context$4_CommonCursorPaging as CommonCursorPaging, type context$4_CommonCursorPagingMetadata as CommonCursorPagingMetadata, type context$4_CommonCursors as CommonCursors, type CommonIdentificationData$2 as CommonIdentificationData, type CommonIdentificationDataIdOneOf$2 as CommonIdentificationDataIdOneOf, type ConferencingDetails$2 as ConferencingDetails, type ConsentPolicy$2 as ConsentPolicy, type context$4_CreateEventOptions as CreateEventOptions, type context$4_CreateEventRequest as CreateEventRequest, type context$4_CreateEventResponse as CreateEventResponse, type context$4_CreateEventResponseNonNullableFields as CreateEventResponseNonNullableFields, type CursorPaging$2 as CursorPaging, type CursorPagingMetadata$2 as CursorPagingMetadata, type CursorQuery$2 as CursorQuery, type CursorQueryPagingMethodOneOf$2 as CursorQueryPagingMethodOneOf, type Cursors$2 as Cursors, Day$1 as Day, DayOfWeek$2 as DayOfWeek, type context$4_DeleteTargetsRequest as DeleteTargetsRequest, type context$4_DeleteTargetsResponse as DeleteTargetsResponse, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type Empty$4 as Empty, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, type Event$1 as Event, type context$4_EventCancelled as EventCancelled, type context$4_EventCancelledEnvelope as EventCancelledEnvelope, type context$4_EventCreatedEnvelope as EventCreatedEnvelope, type EventMetadata$4 as EventMetadata, type context$4_EventNonNullableFields as EventNonNullableFields, type context$4_EventRecurringSplitEnvelope as EventRecurringSplitEnvelope, type context$4_EventUpdatedEnvelope as EventUpdatedEnvelope, type context$4_EventUpdatedWithMetadata as EventUpdatedWithMetadata, type context$4_EventsQueryBuilder as EventsQueryBuilder, type context$4_EventsQueryResult as EventsQueryResult, type ExtendedFields$3 as ExtendedFields, Field$1 as Field, Frequency$1 as Frequency, type GeoCoordinates$2 as GeoCoordinates, type context$4_GetEventOptions as GetEventOptions, type context$4_GetEventRequest as GetEventRequest, type context$4_GetEventResponse as GetEventResponse, type context$4_GetEventResponseNonNullableFields as GetEventResponseNonNullableFields, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, IdentityType$2 as IdentityType, type context$4_ItemMetadata as ItemMetadata, type context$4_ListEventsByContactIdOptions as ListEventsByContactIdOptions, type context$4_ListEventsByContactIdRequest as ListEventsByContactIdRequest, type context$4_ListEventsByContactIdResponse as ListEventsByContactIdResponse, type context$4_ListEventsByContactIdResponseNonNullableFields as ListEventsByContactIdResponseNonNullableFields, type context$4_ListEventsByMemberIdOptions as ListEventsByMemberIdOptions, type context$4_ListEventsByMemberIdRequest as ListEventsByMemberIdRequest, type context$4_ListEventsByMemberIdResponse as ListEventsByMemberIdResponse, type context$4_ListEventsByMemberIdResponseNonNullableFields as ListEventsByMemberIdResponseNonNullableFields, type context$4_ListEventsOptions as ListEventsOptions, type context$4_ListEventsRequest as ListEventsRequest, type context$4_ListEventsResponse as ListEventsResponse, type context$4_ListEventsResponseNonNullableFields as ListEventsResponseNonNullableFields, type context$4_ListRecurringEventInstancesHistoryRequest as ListRecurringEventInstancesHistoryRequest, type context$4_ListRecurringEventInstancesHistoryResponse as ListRecurringEventInstancesHistoryResponse, type Locale$2 as Locale, type Location$2 as Location, LocationType$2 as LocationType, type context$4_MaskedEvent as MaskedEvent, type MessageEnvelope$4 as MessageEnvelope, type Multilingual$2 as Multilingual, type Participant$2 as Participant, type ParticipantNotification$1 as ParticipantNotification, type Participants$1 as Participants, ParticipantsStatus$1 as ParticipantsStatus, type Permission$2 as Permission, PlacementType$2 as PlacementType, type Properties$2 as Properties, type PropertiesChange$2 as PropertiesChange, type context$4_QueryEventsOptions as QueryEventsOptions, type context$4_QueryEventsRequest as QueryEventsRequest, type context$4_QueryEventsResponse as QueryEventsResponse, type context$4_QueryEventsResponseNonNullableFields as QueryEventsResponseNonNullableFields, type RecurrenceRule$1 as RecurrenceRule, RecurrenceType$1 as RecurrenceType, type context$4_RecurringEventSplit as RecurringEventSplit, RequestedFields$1 as RequestedFields, ResolutionMethod$2 as ResolutionMethod, type Resource$1 as Resource, type context$4_RestoreEventDefaultsOptions as RestoreEventDefaultsOptions, type context$4_RestoreEventDefaultsRequest as RestoreEventDefaultsRequest, type context$4_RestoreEventDefaultsResponse as RestoreEventDefaultsResponse, type context$4_RestoreEventDefaultsResponseNonNullableFields as RestoreEventDefaultsResponseNonNullableFields, type RestoreInfo$4 as RestoreInfo, Role$2 as Role, type SiteCloned$2 as SiteCloned, type SiteCreated$2 as SiteCreated, type SitePropertiesEvent$2 as SitePropertiesEvent, type SitePropertiesNotification$2 as SitePropertiesNotification, context$4_SortOrder as SortOrder, type context$4_Sorting as Sorting, type SpecialHourPeriod$2 as SpecialHourPeriod, type context$4_SplitRecurringEventOptions as SplitRecurringEventOptions, type context$4_SplitRecurringEventRequest as SplitRecurringEventRequest, type context$4_SplitRecurringEventResponse as SplitRecurringEventResponse, type context$4_SplitRecurringEventResponseNonNullableFields as SplitRecurringEventResponseNonNullableFields, Status$4 as Status, type SupportedLanguage$2 as SupportedLanguage, type TimePeriod$2 as TimePeriod, type Translation$2 as Translation, Transparency$1 as Transparency, Type$2 as Type, type context$4_UpdateEvent as UpdateEvent, type context$4_UpdateEventOptions as UpdateEventOptions, type context$4_UpdateEventParticipantsRequest as UpdateEventParticipantsRequest, type context$4_UpdateEventParticipantsResponse as UpdateEventParticipantsResponse, type context$4_UpdateEventRequest as UpdateEventRequest, type context$4_UpdateEventResponse as UpdateEventResponse, type context$4_UpdateEventResponseNonNullableFields as UpdateEventResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, type ZonedDate$2 as ZonedDate, type context$4__publicOnEventCancelledType as _publicOnEventCancelledType, type context$4__publicOnEventCreatedType as _publicOnEventCreatedType, type context$4__publicOnEventRecurringSplitType as _publicOnEventRecurringSplitType, type context$4__publicOnEventUpdatedType as _publicOnEventUpdatedType, context$4_bulkCancelEvent as bulkCancelEvent, context$4_bulkCreateEvent as bulkCreateEvent, context$4_bulkUpdateEvent as bulkUpdateEvent, context$4_cancelEvent as cancelEvent, context$4_createEvent as createEvent, context$4_getEvent as getEvent, context$4_listEvents as listEvents, context$4_listEventsByContactId as listEventsByContactId, context$4_listEventsByMemberId as listEventsByMemberId, context$4_onEventCancelled as onEventCancelled, context$4_onEventCreated as onEventCreated, context$4_onEventRecurringSplit as onEventRecurringSplit, context$4_onEventUpdated as onEventUpdated, onEventCancelled$1 as publicOnEventCancelled, onEventCreated$1 as publicOnEventCreated, onEventRecurringSplit$1 as publicOnEventRecurringSplit, onEventUpdated$1 as publicOnEventUpdated, context$4_queryEvents as queryEvents, context$4_restoreEventDefaults as restoreEventDefaults, context$4_splitRecurringEvent as splitRecurringEvent, context$4_updateEvent as updateEvent };
|
|
2647
2697
|
}
|
|
2648
2698
|
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
}
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
eventAddedOrUpdated?: EventAddedOrUpdated;
|
|
2664
|
-
/** Event has been removed from the view. */
|
|
2665
|
-
eventRemoved?: EventRemoved;
|
|
2666
|
-
/** ID of the Wix app owning the event */
|
|
2667
|
-
appId?: string | null;
|
|
2668
|
-
}
|
|
2669
|
-
/** @oneof */
|
|
2670
|
-
interface EventsViewProjectionUpdatedTypeOneOf {
|
|
2671
|
-
/** Event has been added or updated within the view. */
|
|
2672
|
-
eventAddedOrUpdated?: EventAddedOrUpdated;
|
|
2673
|
-
/** Event has been removed from the view. */
|
|
2674
|
-
eventRemoved?: EventRemoved;
|
|
2675
|
-
}
|
|
2676
|
-
interface EventAddedOrUpdated {
|
|
2677
|
-
/** The event which was added or updated within the view. */
|
|
2678
|
-
event?: Event;
|
|
2679
|
-
/** Optionally, the previous event. */
|
|
2680
|
-
previousEvent?: Event;
|
|
2681
|
-
}
|
|
2682
|
-
interface Event {
|
|
2683
|
-
/**
|
|
2684
|
-
* The event ID.
|
|
2685
|
-
* @readonly
|
|
2686
|
-
*/
|
|
2687
|
-
_id?: string | null;
|
|
2688
|
-
/**
|
|
2689
|
-
* The ID of the schedule that the event belongs to.
|
|
2690
|
-
* Cannot change.
|
|
2691
|
-
*/
|
|
2692
|
-
scheduleId?: string | null;
|
|
2693
|
-
/**
|
|
2694
|
-
* The external schedule ID.
|
|
2695
|
-
* @readonly
|
|
2696
|
-
*/
|
|
2697
|
-
externalScheduleId?: string | null;
|
|
2698
|
-
/**
|
|
2699
|
-
* The schedule name.
|
|
2700
|
-
* @readonly
|
|
2701
|
-
*/
|
|
2702
|
-
scheduleName?: string | null;
|
|
2703
|
-
/**
|
|
2704
|
-
* The event type.
|
|
2705
|
-
* Cannot change.
|
|
2706
|
-
*
|
|
2707
|
-
* The possible values are:
|
|
2708
|
-
* - `"DEFAULT"` Default event.
|
|
2709
|
-
* - `"WORKING_HOURS"` The event represents a resource working hours. Working hours events are hidden by default from queries.
|
|
2710
|
-
*
|
|
2711
|
-
* The Wix Bookings App, once installed, also provides the following:
|
|
2712
|
-
* - `"APPOINTMENT"` Bookings Appointment event.
|
|
2713
|
-
* - `"CLASS"` Bookings Class event.
|
|
2714
|
-
* - `"COURSE"` Bookings Course event.
|
|
2715
|
-
*
|
|
2716
|
-
* See the [Event Type Provider](https://dev.wix.com/docs/rest/internal-only/calendar/event-type-provider-v3/introduction) for more details.
|
|
2717
|
-
*/
|
|
2718
|
-
type?: string | null;
|
|
2719
|
-
/**
|
|
2720
|
-
* The event status. Read only.
|
|
2721
|
-
*
|
|
2722
|
-
* The possible values are:
|
|
2723
|
-
* - `"CONFIRMED"` Event is confirmed. Default value.
|
|
2724
|
-
* - `"CANCELLED"` Event has been cancelled.
|
|
2725
|
-
* @readonly
|
|
2726
|
-
*/
|
|
2727
|
-
status?: Status$3;
|
|
2728
|
-
/**
|
|
2729
|
-
* The event title.
|
|
2730
|
-
*
|
|
2731
|
-
* The title is inherited from the schedule and can be overridden.
|
|
2732
|
-
*/
|
|
2733
|
-
title?: string | null;
|
|
2734
|
-
/**
|
|
2735
|
-
* The event start date.
|
|
2736
|
-
*
|
|
2737
|
-
* Recurring events must start from at least today.
|
|
2738
|
-
*/
|
|
2739
|
-
start?: ZonedDate$1;
|
|
2740
|
-
/** The event end date. */
|
|
2741
|
-
end?: ZonedDate$1;
|
|
2742
|
-
/**
|
|
2743
|
-
* Read-only start date adjusted to the Wix Business time zone, or `request.timeZone` if provided.
|
|
2744
|
-
* @readonly
|
|
2745
|
-
*/
|
|
2746
|
-
adjustedStart?: ZonedDate$1;
|
|
2747
|
-
/**
|
|
2748
|
-
* Read-only end date adjusted to the Wix Business time zone, or `request.timeZone` if provided.
|
|
2749
|
-
* @readonly
|
|
2750
|
-
*/
|
|
2751
|
-
adjustedEnd?: ZonedDate$1;
|
|
2752
|
-
/**
|
|
2753
|
-
* The event time zone, formatted according to the IANA time zone format.
|
|
2754
|
-
* Must be a regional time zone (Area/Location) or UTC.
|
|
2755
|
-
*
|
|
2756
|
-
* The time zone is inherited from the schedule and can be overridden.
|
|
2757
|
-
*/
|
|
2758
|
-
timeZone?: string | null;
|
|
2699
|
+
type HostModule$3<T, H extends Host$3> = {
|
|
2700
|
+
__type: 'host';
|
|
2701
|
+
create(host: H): T;
|
|
2702
|
+
};
|
|
2703
|
+
type HostModuleAPI$3<T extends HostModule$3<any, any>> = T extends HostModule$3<infer U, any> ? U : never;
|
|
2704
|
+
type Host$3<Environment = unknown> = {
|
|
2705
|
+
channel: {
|
|
2706
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
2707
|
+
disconnect: () => void;
|
|
2708
|
+
} | Promise<{
|
|
2709
|
+
disconnect: () => void;
|
|
2710
|
+
}>;
|
|
2711
|
+
};
|
|
2712
|
+
environment?: Environment;
|
|
2759
2713
|
/**
|
|
2760
|
-
*
|
|
2761
|
-
*
|
|
2762
|
-
* The possible values are:
|
|
2763
|
-
* - `"NONE"` No recurrence, i.e the event is a single event instance. Default.
|
|
2764
|
-
* - `"MASTER"` The event is the recurrence master defining the recurrence rule, which is the repeat pattern for the events.
|
|
2765
|
-
* - `"INSTANCE"` The event is an instance of a recurring event. Read only.
|
|
2766
|
-
* - `"EXCEPTION"` The event is an exceptional instance of a recurring event. Read only.
|
|
2767
|
-
* @readonly
|
|
2714
|
+
* Optional name of the environment, use for logging
|
|
2768
2715
|
*/
|
|
2769
|
-
|
|
2716
|
+
name?: string;
|
|
2770
2717
|
/**
|
|
2771
|
-
*
|
|
2772
|
-
* Required for `MASTER` recurrence, read only otherwise.
|
|
2773
|
-
*
|
|
2774
|
-
* For example, a event that repeats every second week on a Monday until January 7, 2024 at 8 AM, will have the following recurrence:
|
|
2775
|
-
* - `frequency = WEEKLY`
|
|
2776
|
-
* - `interval = 2`
|
|
2777
|
-
* - `days = [MONDAY]`
|
|
2778
|
-
* - `until = 20240107T08:00:00Z`
|
|
2718
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
2779
2719
|
*/
|
|
2780
|
-
|
|
2720
|
+
apiBaseUrl?: string;
|
|
2781
2721
|
/**
|
|
2782
|
-
*
|
|
2783
|
-
*
|
|
2722
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
2723
|
+
* like internationalization, billing, etc.
|
|
2784
2724
|
*/
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2725
|
+
essentials?: {
|
|
2726
|
+
/**
|
|
2727
|
+
* The language of the currently viewed session
|
|
2728
|
+
*/
|
|
2729
|
+
language?: string;
|
|
2730
|
+
/**
|
|
2731
|
+
* The locale of the currently viewed session
|
|
2732
|
+
*/
|
|
2733
|
+
locale?: string;
|
|
2734
|
+
/**
|
|
2735
|
+
* Any headers that should be passed through to the API requests
|
|
2736
|
+
*/
|
|
2737
|
+
passThroughHeaders?: Record<string, string>;
|
|
2738
|
+
};
|
|
2739
|
+
};
|
|
2740
|
+
|
|
2741
|
+
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
2742
|
+
interface HttpClient$3 {
|
|
2743
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
2744
|
+
fetchWithAuth: typeof fetch;
|
|
2745
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
2746
|
+
getActiveToken?: () => string | undefined;
|
|
2747
|
+
}
|
|
2748
|
+
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
2749
|
+
type HttpResponse$3<T = any> = {
|
|
2750
|
+
data: T;
|
|
2751
|
+
status: number;
|
|
2752
|
+
statusText: string;
|
|
2753
|
+
headers: any;
|
|
2754
|
+
request?: any;
|
|
2755
|
+
};
|
|
2756
|
+
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
2757
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
2758
|
+
url: string;
|
|
2759
|
+
data?: Data;
|
|
2760
|
+
params?: URLSearchParams;
|
|
2761
|
+
} & APIMetadata$3;
|
|
2762
|
+
type APIMetadata$3 = {
|
|
2763
|
+
methodFqn?: string;
|
|
2764
|
+
entityFqdn?: string;
|
|
2765
|
+
packageName?: string;
|
|
2766
|
+
};
|
|
2767
|
+
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
2768
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
2769
|
+
__type: 'event-definition';
|
|
2770
|
+
type: Type;
|
|
2771
|
+
isDomainEvent?: boolean;
|
|
2772
|
+
transformations?: (envelope: unknown) => Payload;
|
|
2773
|
+
__payload: Payload;
|
|
2774
|
+
};
|
|
2775
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
2776
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
2777
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
2778
|
+
|
|
2779
|
+
type ServicePluginMethodInput$3 = {
|
|
2780
|
+
request: any;
|
|
2781
|
+
metadata: any;
|
|
2782
|
+
};
|
|
2783
|
+
type ServicePluginContract$3 = Record<string, (payload: ServicePluginMethodInput$3) => unknown | Promise<unknown>>;
|
|
2784
|
+
type ServicePluginMethodMetadata$3 = {
|
|
2785
|
+
name: string;
|
|
2786
|
+
primaryHttpMappingPath: string;
|
|
2787
|
+
transformations: {
|
|
2788
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$3;
|
|
2789
|
+
toREST: (...args: unknown[]) => unknown;
|
|
2790
|
+
};
|
|
2791
|
+
};
|
|
2792
|
+
type ServicePluginDefinition$3<Contract extends ServicePluginContract$3> = {
|
|
2793
|
+
__type: 'service-plugin-definition';
|
|
2794
|
+
componentType: string;
|
|
2795
|
+
methods: ServicePluginMethodMetadata$3[];
|
|
2796
|
+
__contract: Contract;
|
|
2797
|
+
};
|
|
2798
|
+
declare function ServicePluginDefinition$3<Contract extends ServicePluginContract$3>(componentType: string, methods: ServicePluginMethodMetadata$3[]): ServicePluginDefinition$3<Contract>;
|
|
2799
|
+
type BuildServicePluginDefinition$3<T extends ServicePluginDefinition$3<any>> = (implementation: T['__contract']) => void;
|
|
2800
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$3 = "wix_spi_error";
|
|
2801
|
+
|
|
2802
|
+
type RequestContext$3 = {
|
|
2803
|
+
isSSR: boolean;
|
|
2804
|
+
host: string;
|
|
2805
|
+
protocol?: string;
|
|
2806
|
+
};
|
|
2807
|
+
type ResponseTransformer$3 = (data: any, headers?: any) => any;
|
|
2808
|
+
/**
|
|
2809
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
2810
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
2811
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
2812
|
+
*/
|
|
2813
|
+
type Method$3 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
2814
|
+
type AmbassadorRequestOptions$3<T = any> = {
|
|
2815
|
+
_?: T;
|
|
2816
|
+
url?: string;
|
|
2817
|
+
method?: Method$3;
|
|
2818
|
+
params?: any;
|
|
2819
|
+
data?: any;
|
|
2820
|
+
transformResponse?: ResponseTransformer$3 | ResponseTransformer$3[];
|
|
2821
|
+
};
|
|
2822
|
+
type AmbassadorFactory$3<Request, Response> = (payload: Request) => ((context: RequestContext$3) => AmbassadorRequestOptions$3<Response>) & {
|
|
2823
|
+
__isAmbassador: boolean;
|
|
2824
|
+
};
|
|
2825
|
+
type AmbassadorFunctionDescriptor$3<Request = any, Response = any> = AmbassadorFactory$3<Request, Response>;
|
|
2826
|
+
type BuildAmbassadorFunction$3<T extends AmbassadorFunctionDescriptor$3> = T extends AmbassadorFunctionDescriptor$3<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
2827
|
+
|
|
2828
|
+
declare global {
|
|
2829
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2830
|
+
interface SymbolConstructor {
|
|
2831
|
+
readonly observable: symbol;
|
|
2832
|
+
}
|
|
2833
|
+
}
|
|
2834
|
+
|
|
2835
|
+
declare const emptyObjectSymbol$3: unique symbol;
|
|
2836
|
+
|
|
2837
|
+
/**
|
|
2838
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
2839
|
+
|
|
2840
|
+
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)).
|
|
2841
|
+
|
|
2842
|
+
@example
|
|
2843
|
+
```
|
|
2844
|
+
import type {EmptyObject} from 'type-fest';
|
|
2845
|
+
|
|
2846
|
+
// The following illustrates the problem with `{}`.
|
|
2847
|
+
const foo1: {} = {}; // Pass
|
|
2848
|
+
const foo2: {} = []; // Pass
|
|
2849
|
+
const foo3: {} = 42; // Pass
|
|
2850
|
+
const foo4: {} = {a: 1}; // Pass
|
|
2851
|
+
|
|
2852
|
+
// With `EmptyObject` only the first case is valid.
|
|
2853
|
+
const bar1: EmptyObject = {}; // Pass
|
|
2854
|
+
const bar2: EmptyObject = 42; // Fail
|
|
2855
|
+
const bar3: EmptyObject = []; // Fail
|
|
2856
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
2857
|
+
```
|
|
2858
|
+
|
|
2859
|
+
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}.
|
|
2860
|
+
|
|
2861
|
+
@category Object
|
|
2862
|
+
*/
|
|
2863
|
+
type EmptyObject$3 = {[emptyObjectSymbol$3]?: never};
|
|
2864
|
+
|
|
2865
|
+
/**
|
|
2866
|
+
Returns a boolean for whether the two given types are equal.
|
|
2867
|
+
|
|
2868
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
2869
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
2870
|
+
|
|
2871
|
+
Use-cases:
|
|
2872
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
2873
|
+
|
|
2874
|
+
@example
|
|
2875
|
+
```
|
|
2876
|
+
import type {IsEqual} from 'type-fest';
|
|
2877
|
+
|
|
2878
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
2879
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
2880
|
+
type Includes<Value extends readonly any[], Item> =
|
|
2881
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
2882
|
+
? IsEqual<Value[0], Item> extends true
|
|
2883
|
+
? true
|
|
2884
|
+
: Includes<rest, Item>
|
|
2885
|
+
: false;
|
|
2886
|
+
```
|
|
2887
|
+
|
|
2888
|
+
@category Type Guard
|
|
2889
|
+
@category Utilities
|
|
2890
|
+
*/
|
|
2891
|
+
type IsEqual$3<A, B> =
|
|
2892
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
2893
|
+
(<G>() => G extends B ? 1 : 2)
|
|
2894
|
+
? true
|
|
2895
|
+
: false;
|
|
2896
|
+
|
|
2897
|
+
/**
|
|
2898
|
+
Filter out keys from an object.
|
|
2899
|
+
|
|
2900
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
2901
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
2902
|
+
Returns `Key` otherwise.
|
|
2903
|
+
|
|
2904
|
+
@example
|
|
2905
|
+
```
|
|
2906
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
2907
|
+
//=> never
|
|
2908
|
+
```
|
|
2909
|
+
|
|
2910
|
+
@example
|
|
2911
|
+
```
|
|
2912
|
+
type Filtered = Filter<'bar', string>;
|
|
2913
|
+
//=> never
|
|
2914
|
+
```
|
|
2915
|
+
|
|
2916
|
+
@example
|
|
2917
|
+
```
|
|
2918
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
2919
|
+
//=> 'bar'
|
|
2920
|
+
```
|
|
2921
|
+
|
|
2922
|
+
@see {Except}
|
|
2923
|
+
*/
|
|
2924
|
+
type Filter$3<KeyType, ExcludeType> = IsEqual$3<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
2925
|
+
|
|
2926
|
+
type ExceptOptions$3 = {
|
|
2927
|
+
/**
|
|
2928
|
+
Disallow assigning non-specified properties.
|
|
2929
|
+
|
|
2930
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
2931
|
+
|
|
2932
|
+
@default false
|
|
2933
|
+
*/
|
|
2934
|
+
requireExactProps?: boolean;
|
|
2935
|
+
};
|
|
2936
|
+
|
|
2937
|
+
/**
|
|
2938
|
+
Create a type from an object type without certain keys.
|
|
2939
|
+
|
|
2940
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
2941
|
+
|
|
2942
|
+
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.
|
|
2943
|
+
|
|
2944
|
+
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)).
|
|
2945
|
+
|
|
2946
|
+
@example
|
|
2947
|
+
```
|
|
2948
|
+
import type {Except} from 'type-fest';
|
|
2949
|
+
|
|
2950
|
+
type Foo = {
|
|
2951
|
+
a: number;
|
|
2952
|
+
b: string;
|
|
2953
|
+
};
|
|
2954
|
+
|
|
2955
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
2956
|
+
//=> {b: string}
|
|
2957
|
+
|
|
2958
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
2959
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
2960
|
+
|
|
2961
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
2962
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
2963
|
+
|
|
2964
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
2965
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
2966
|
+
```
|
|
2967
|
+
|
|
2968
|
+
@category Object
|
|
2969
|
+
*/
|
|
2970
|
+
type Except$3<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$3 = {requireExactProps: false}> = {
|
|
2971
|
+
[KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
|
|
2972
|
+
} & (Options['requireExactProps'] extends true
|
|
2973
|
+
? Partial<Record<KeysType, never>>
|
|
2974
|
+
: {});
|
|
2975
|
+
|
|
2976
|
+
/**
|
|
2977
|
+
Returns a boolean for whether the given type is `never`.
|
|
2978
|
+
|
|
2979
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
2980
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
2981
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
2982
|
+
|
|
2983
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
2984
|
+
|
|
2985
|
+
@example
|
|
2986
|
+
```
|
|
2987
|
+
import type {IsNever, And} from 'type-fest';
|
|
2988
|
+
|
|
2989
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
2990
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
2991
|
+
And<
|
|
2992
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
2993
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
2994
|
+
>;
|
|
2995
|
+
|
|
2996
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
2997
|
+
AreStringsEqual<I, O> extends true
|
|
2998
|
+
? never
|
|
2999
|
+
: void;
|
|
3000
|
+
|
|
3001
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
3002
|
+
if (input === output) {
|
|
3003
|
+
process.exit(0);
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
endIfEqual('abc', 'abc');
|
|
3008
|
+
//=> never
|
|
3009
|
+
|
|
3010
|
+
endIfEqual('abc', '123');
|
|
3011
|
+
//=> void
|
|
3012
|
+
```
|
|
3013
|
+
|
|
3014
|
+
@category Type Guard
|
|
3015
|
+
@category Utilities
|
|
3016
|
+
*/
|
|
3017
|
+
type IsNever$3<T> = [T] extends [never] ? true : false;
|
|
3018
|
+
|
|
3019
|
+
/**
|
|
3020
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
3021
|
+
|
|
3022
|
+
@see {@link IsNever}
|
|
3023
|
+
|
|
3024
|
+
@example
|
|
3025
|
+
```
|
|
3026
|
+
import type {IfNever} from 'type-fest';
|
|
3027
|
+
|
|
3028
|
+
type ShouldBeTrue = IfNever<never>;
|
|
3029
|
+
//=> true
|
|
3030
|
+
|
|
3031
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
3032
|
+
//=> 'bar'
|
|
3033
|
+
```
|
|
3034
|
+
|
|
3035
|
+
@category Type Guard
|
|
3036
|
+
@category Utilities
|
|
3037
|
+
*/
|
|
3038
|
+
type IfNever$3<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
3039
|
+
IsNever$3<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
3040
|
+
);
|
|
3041
|
+
|
|
3042
|
+
/**
|
|
3043
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
3044
|
+
|
|
3045
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
3046
|
+
|
|
3047
|
+
@example
|
|
3048
|
+
```
|
|
3049
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
3050
|
+
|
|
3051
|
+
interface Example {
|
|
3052
|
+
a: string;
|
|
3053
|
+
b: string | number;
|
|
3054
|
+
c?: string;
|
|
3055
|
+
d: {};
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
3059
|
+
//=> 'a'
|
|
3060
|
+
```
|
|
3061
|
+
|
|
3062
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
3063
|
+
|
|
3064
|
+
@example
|
|
3065
|
+
```
|
|
3066
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
3067
|
+
|
|
3068
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
3069
|
+
//=> 'a' | 'c'
|
|
3070
|
+
```
|
|
3071
|
+
|
|
3072
|
+
@category Object
|
|
3073
|
+
*/
|
|
3074
|
+
type ConditionalKeys$3<Base, Condition> =
|
|
3075
|
+
{
|
|
3076
|
+
// Map through all the keys of the given base type.
|
|
3077
|
+
[Key in keyof Base]-?:
|
|
3078
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
3079
|
+
Base[Key] extends Condition
|
|
3080
|
+
// Retain this key
|
|
3081
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
3082
|
+
? IfNever$3<Base[Key], IfNever$3<Condition, Key, never>, Key>
|
|
3083
|
+
// Discard this key since the condition fails.
|
|
3084
|
+
: never;
|
|
3085
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
3086
|
+
}[keyof Base];
|
|
3087
|
+
|
|
3088
|
+
/**
|
|
3089
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
3090
|
+
|
|
3091
|
+
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.
|
|
3092
|
+
|
|
3093
|
+
@example
|
|
3094
|
+
```
|
|
3095
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
3096
|
+
|
|
3097
|
+
class Awesome {
|
|
3098
|
+
name: string;
|
|
3099
|
+
successes: number;
|
|
3100
|
+
failures: bigint;
|
|
3101
|
+
|
|
3102
|
+
run() {}
|
|
3103
|
+
}
|
|
3104
|
+
|
|
3105
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
3106
|
+
//=> {run: () => void}
|
|
3107
|
+
```
|
|
3108
|
+
|
|
3109
|
+
@example
|
|
3110
|
+
```
|
|
3111
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
3112
|
+
|
|
3113
|
+
interface Example {
|
|
3114
|
+
a: string;
|
|
3115
|
+
b: string | number;
|
|
3116
|
+
c: () => void;
|
|
3117
|
+
d: {};
|
|
3118
|
+
}
|
|
3119
|
+
|
|
3120
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
3121
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
3122
|
+
```
|
|
3123
|
+
|
|
3124
|
+
@category Object
|
|
3125
|
+
*/
|
|
3126
|
+
type ConditionalExcept$3<Base, Condition> = Except$3<
|
|
3127
|
+
Base,
|
|
3128
|
+
ConditionalKeys$3<Base, Condition>
|
|
3129
|
+
>;
|
|
3130
|
+
|
|
3131
|
+
/**
|
|
3132
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
3133
|
+
* can either be a REST module or a host module.
|
|
3134
|
+
* This type is recursive, so it can describe nested modules.
|
|
3135
|
+
*/
|
|
3136
|
+
type Descriptors$3 = RESTFunctionDescriptor$3 | AmbassadorFunctionDescriptor$3 | HostModule$3<any, any> | EventDefinition$3<any> | ServicePluginDefinition$3<any> | {
|
|
3137
|
+
[key: string]: Descriptors$3 | PublicMetadata$3 | any;
|
|
3138
|
+
};
|
|
3139
|
+
/**
|
|
3140
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
3141
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
3142
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
3143
|
+
* do not match the given host (as they will not work with the given host).
|
|
3144
|
+
*/
|
|
3145
|
+
type BuildDescriptors$3<T extends Descriptors$3, H extends Host$3<any> | undefined, Depth extends number = 5> = {
|
|
3146
|
+
done: T;
|
|
3147
|
+
recurse: T extends {
|
|
3148
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$3;
|
|
3149
|
+
} ? never : T extends AmbassadorFunctionDescriptor$3 ? BuildAmbassadorFunction$3<T> : T extends RESTFunctionDescriptor$3 ? BuildRESTFunction$3<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$3<any> ? BuildServicePluginDefinition$3<T> : T extends HostModule$3<any, any> ? HostModuleAPI$3<T> : ConditionalExcept$3<{
|
|
3150
|
+
[Key in keyof T]: T[Key] extends Descriptors$3 ? BuildDescriptors$3<T[Key], H, [
|
|
3151
|
+
-1,
|
|
3152
|
+
0,
|
|
3153
|
+
1,
|
|
3154
|
+
2,
|
|
3155
|
+
3,
|
|
3156
|
+
4,
|
|
3157
|
+
5
|
|
3158
|
+
][Depth]> : never;
|
|
3159
|
+
}, EmptyObject$3>;
|
|
3160
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
3161
|
+
type PublicMetadata$3 = {
|
|
3162
|
+
PACKAGE_NAME?: string;
|
|
3163
|
+
};
|
|
3164
|
+
|
|
3165
|
+
declare global {
|
|
3166
|
+
interface ContextualClient {
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
/**
|
|
3170
|
+
* A type used to create concerete types from SDK descriptors in
|
|
3171
|
+
* case a contextual client is available.
|
|
3172
|
+
*/
|
|
3173
|
+
type MaybeContext$3<T extends Descriptors$3> = globalThis.ContextualClient extends {
|
|
3174
|
+
host: Host$3;
|
|
3175
|
+
} ? BuildDescriptors$3<T, globalThis.ContextualClient['host']> : T;
|
|
3176
|
+
|
|
3177
|
+
interface EventsView {
|
|
3178
|
+
/**
|
|
3179
|
+
* The view end date.
|
|
3180
|
+
* @readonly
|
|
3181
|
+
*/
|
|
3182
|
+
endDate?: Date;
|
|
3183
|
+
/**
|
|
3184
|
+
* The number of days the view lasts into the future.
|
|
3185
|
+
* @readonly
|
|
3186
|
+
*/
|
|
3187
|
+
futureDurationInDays?: number | null;
|
|
3188
|
+
}
|
|
3189
|
+
interface EventsViewProjectionUpdated extends EventsViewProjectionUpdatedTypeOneOf {
|
|
3190
|
+
/** Event has been added or updated within the view. */
|
|
3191
|
+
eventAddedOrUpdated?: EventAddedOrUpdated;
|
|
3192
|
+
/** Event has been removed from the view. */
|
|
3193
|
+
eventRemoved?: EventRemoved;
|
|
3194
|
+
/** ID of the Wix app owning the event */
|
|
3195
|
+
appId?: string | null;
|
|
3196
|
+
}
|
|
3197
|
+
/** @oneof */
|
|
3198
|
+
interface EventsViewProjectionUpdatedTypeOneOf {
|
|
3199
|
+
/** Event has been added or updated within the view. */
|
|
3200
|
+
eventAddedOrUpdated?: EventAddedOrUpdated;
|
|
3201
|
+
/** Event has been removed from the view. */
|
|
3202
|
+
eventRemoved?: EventRemoved;
|
|
3203
|
+
}
|
|
3204
|
+
interface EventAddedOrUpdated {
|
|
3205
|
+
/** The event which was added or updated within the view. */
|
|
3206
|
+
event?: Event;
|
|
3207
|
+
/** Optionally, the previous event. */
|
|
3208
|
+
previousEvent?: Event;
|
|
3209
|
+
}
|
|
3210
|
+
interface Event {
|
|
3211
|
+
/**
|
|
3212
|
+
* The event ID.
|
|
3213
|
+
* @readonly
|
|
3214
|
+
*/
|
|
3215
|
+
_id?: string | null;
|
|
3216
|
+
/**
|
|
3217
|
+
* The ID of the schedule that the event belongs to.
|
|
3218
|
+
* Cannot change.
|
|
3219
|
+
*/
|
|
3220
|
+
scheduleId?: string | null;
|
|
3221
|
+
/**
|
|
3222
|
+
* The external schedule ID.
|
|
3223
|
+
* @readonly
|
|
3224
|
+
*/
|
|
3225
|
+
externalScheduleId?: string | null;
|
|
3226
|
+
/**
|
|
3227
|
+
* The schedule name.
|
|
3228
|
+
* @readonly
|
|
3229
|
+
*/
|
|
3230
|
+
scheduleName?: string | null;
|
|
3231
|
+
/**
|
|
3232
|
+
* The event type.
|
|
3233
|
+
* Cannot change.
|
|
3234
|
+
*
|
|
3235
|
+
* The possible values are:
|
|
3236
|
+
* - `"DEFAULT"` Default event.
|
|
3237
|
+
* - `"WORKING_HOURS"` The event represents a resource working hours. Working hours events are hidden by default from queries.
|
|
3238
|
+
*
|
|
3239
|
+
* The Wix Bookings App, once installed, also provides the following:
|
|
3240
|
+
* - `"APPOINTMENT"` Bookings Appointment event.
|
|
3241
|
+
* - `"CLASS"` Bookings Class event.
|
|
3242
|
+
* - `"COURSE"` Bookings Course event.
|
|
3243
|
+
*
|
|
3244
|
+
* See the [Event Type Provider](https://dev.wix.com/docs/rest/internal-only/calendar/event-type-provider-v3/introduction) for more details.
|
|
3245
|
+
*/
|
|
3246
|
+
type?: string | null;
|
|
3247
|
+
/**
|
|
3248
|
+
* The event status. Read only.
|
|
3249
|
+
*
|
|
3250
|
+
* The possible values are:
|
|
3251
|
+
* - `"CONFIRMED"` Event is confirmed. Default value.
|
|
3252
|
+
* - `"CANCELLED"` Event has been cancelled.
|
|
3253
|
+
* @readonly
|
|
3254
|
+
*/
|
|
3255
|
+
status?: Status$3;
|
|
3256
|
+
/**
|
|
3257
|
+
* The event title.
|
|
3258
|
+
*
|
|
3259
|
+
* The title is inherited from the schedule and can be overridden.
|
|
3260
|
+
*/
|
|
3261
|
+
title?: string | null;
|
|
3262
|
+
/**
|
|
3263
|
+
* The event start date.
|
|
3264
|
+
*
|
|
3265
|
+
* Recurring events must start from at least today.
|
|
3266
|
+
*/
|
|
3267
|
+
start?: ZonedDate$1;
|
|
3268
|
+
/** The event end date. */
|
|
3269
|
+
end?: ZonedDate$1;
|
|
3270
|
+
/**
|
|
3271
|
+
* Read-only start date adjusted to the Wix Business time zone, or `request.timeZone` if provided.
|
|
3272
|
+
* @readonly
|
|
3273
|
+
*/
|
|
3274
|
+
adjustedStart?: ZonedDate$1;
|
|
3275
|
+
/**
|
|
3276
|
+
* Read-only end date adjusted to the Wix Business time zone, or `request.timeZone` if provided.
|
|
3277
|
+
* @readonly
|
|
3278
|
+
*/
|
|
3279
|
+
adjustedEnd?: ZonedDate$1;
|
|
3280
|
+
/**
|
|
3281
|
+
* The event time zone, formatted according to the IANA time zone format.
|
|
3282
|
+
* Must be a regional time zone (Area/Location) or UTC.
|
|
3283
|
+
*
|
|
3284
|
+
* The time zone is inherited from the schedule and can be overridden.
|
|
3285
|
+
*/
|
|
3286
|
+
timeZone?: string | null;
|
|
3287
|
+
/**
|
|
3288
|
+
* Whether this event is a recurring event or an instance of recurring event.
|
|
3289
|
+
*
|
|
3290
|
+
* The possible values are:
|
|
3291
|
+
* - `"NONE"` No recurrence, i.e the event is a single event instance. Default.
|
|
3292
|
+
* - `"MASTER"` The event is the recurrence master defining the recurrence rule, which is the repeat pattern for the events.
|
|
3293
|
+
* - `"INSTANCE"` The event is an instance of a recurring event. Read only.
|
|
3294
|
+
* - `"EXCEPTION"` The event is an exceptional instance of a recurring event. Read only.
|
|
3295
|
+
* @readonly
|
|
3296
|
+
*/
|
|
3297
|
+
recurrenceType?: RecurrenceType;
|
|
3298
|
+
/**
|
|
3299
|
+
* The recurrence rule defining a repeating pattern for the event.
|
|
3300
|
+
* Required for `MASTER` recurrence, read only otherwise.
|
|
3301
|
+
*
|
|
3302
|
+
* For example, a event that repeats every second week on a Monday until January 7, 2024 at 8 AM, will have the following recurrence:
|
|
3303
|
+
* - `frequency = WEEKLY`
|
|
3304
|
+
* - `interval = 2`
|
|
3305
|
+
* - `days = [MONDAY]`
|
|
3306
|
+
* - `until = 20240107T08:00:00Z`
|
|
3307
|
+
*/
|
|
3308
|
+
recurrenceRule?: RecurrenceRule;
|
|
3309
|
+
/**
|
|
3310
|
+
* The ID of the recurring event that this event belongs to, if this event is an instance of recurring event.
|
|
3311
|
+
* @readonly
|
|
3312
|
+
*/
|
|
3313
|
+
recurringEventId?: string | null;
|
|
3314
|
+
/**
|
|
3315
|
+
* Specifies whether the event blocks the schedule time.
|
|
2788
3316
|
* Default is true.
|
|
2789
3317
|
*/
|
|
2790
3318
|
transparency?: Transparency;
|
|
@@ -3302,92 +3830,552 @@ interface EventMetadata$3 extends BaseEventMetadata$3 {
|
|
|
3302
3830
|
*/
|
|
3303
3831
|
entityEventSequence?: string | null;
|
|
3304
3832
|
}
|
|
3305
|
-
interface EventsViewProjectionUpdatedEnvelope {
|
|
3306
|
-
data: EventsViewProjectionUpdated;
|
|
3307
|
-
metadata: EventMetadata$3;
|
|
3833
|
+
interface EventsViewProjectionUpdatedEnvelope {
|
|
3834
|
+
data: EventsViewProjectionUpdated;
|
|
3835
|
+
metadata: EventMetadata$3;
|
|
3836
|
+
}
|
|
3837
|
+
interface EventsViewExtendedEnvelope {
|
|
3838
|
+
data: EventsViewExtended;
|
|
3839
|
+
metadata: EventMetadata$3;
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3842
|
+
declare function getEventsView$1(httpClient: HttpClient$3): GetEventsViewSignature;
|
|
3843
|
+
interface GetEventsViewSignature {
|
|
3844
|
+
/**
|
|
3845
|
+
* Retrieves the events view information.
|
|
3846
|
+
* E.g. the current view end date, or the future duration in days the view should strive for.
|
|
3847
|
+
*/
|
|
3848
|
+
(): Promise<GetEventsViewResponse>;
|
|
3849
|
+
}
|
|
3850
|
+
declare const onEventsViewProjectionUpdated$1: EventDefinition$3<EventsViewProjectionUpdatedEnvelope, "wix.calendar.v3.events_view_projection_updated">;
|
|
3851
|
+
declare const onEventsViewExtended$1: EventDefinition$3<EventsViewExtendedEnvelope, "wix.calendar.v3.events_view_extended">;
|
|
3852
|
+
|
|
3853
|
+
declare function createEventModule$3<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
|
|
3854
|
+
|
|
3855
|
+
declare const getEventsView: MaybeContext$3<BuildRESTFunction$3<typeof getEventsView$1> & typeof getEventsView$1>;
|
|
3856
|
+
|
|
3857
|
+
type _publicOnEventsViewProjectionUpdatedType = typeof onEventsViewProjectionUpdated$1;
|
|
3858
|
+
/** */
|
|
3859
|
+
declare const onEventsViewProjectionUpdated: ReturnType<typeof createEventModule$3<_publicOnEventsViewProjectionUpdatedType>>;
|
|
3860
|
+
|
|
3861
|
+
type _publicOnEventsViewExtendedType = typeof onEventsViewExtended$1;
|
|
3862
|
+
/** */
|
|
3863
|
+
declare const onEventsViewExtended: ReturnType<typeof createEventModule$3<_publicOnEventsViewExtendedType>>;
|
|
3864
|
+
|
|
3865
|
+
type context$3_Day = Day;
|
|
3866
|
+
declare const context$3_Day: typeof Day;
|
|
3867
|
+
type context$3_Event = Event;
|
|
3868
|
+
type context$3_EventAddedOrUpdated = EventAddedOrUpdated;
|
|
3869
|
+
type context$3_EventRemoved = EventRemoved;
|
|
3870
|
+
type context$3_EventsView = EventsView;
|
|
3871
|
+
type context$3_EventsViewExtended = EventsViewExtended;
|
|
3872
|
+
type context$3_EventsViewExtendedEnvelope = EventsViewExtendedEnvelope;
|
|
3873
|
+
type context$3_EventsViewProjectionUpdated = EventsViewProjectionUpdated;
|
|
3874
|
+
type context$3_EventsViewProjectionUpdatedEnvelope = EventsViewProjectionUpdatedEnvelope;
|
|
3875
|
+
type context$3_EventsViewProjectionUpdatedTypeOneOf = EventsViewProjectionUpdatedTypeOneOf;
|
|
3876
|
+
type context$3_ExtendEventsViewRequest = ExtendEventsViewRequest;
|
|
3877
|
+
type context$3_ExtendEventsViewResponse = ExtendEventsViewResponse;
|
|
3878
|
+
type context$3_Field = Field;
|
|
3879
|
+
declare const context$3_Field: typeof Field;
|
|
3880
|
+
type context$3_Frequency = Frequency;
|
|
3881
|
+
declare const context$3_Frequency: typeof Frequency;
|
|
3882
|
+
type context$3_GetEventsViewRequest = GetEventsViewRequest;
|
|
3883
|
+
type context$3_GetEventsViewResponse = GetEventsViewResponse;
|
|
3884
|
+
type context$3_Participants = Participants;
|
|
3885
|
+
type context$3_ParticipantsStatus = ParticipantsStatus;
|
|
3886
|
+
declare const context$3_ParticipantsStatus: typeof ParticipantsStatus;
|
|
3887
|
+
type context$3_RecurrenceRule = RecurrenceRule;
|
|
3888
|
+
type context$3_RecurrenceType = RecurrenceType;
|
|
3889
|
+
declare const context$3_RecurrenceType: typeof RecurrenceType;
|
|
3890
|
+
type context$3_Resource = Resource;
|
|
3891
|
+
type context$3_Transparency = Transparency;
|
|
3892
|
+
declare const context$3_Transparency: typeof Transparency;
|
|
3893
|
+
type context$3__publicOnEventsViewExtendedType = _publicOnEventsViewExtendedType;
|
|
3894
|
+
type context$3__publicOnEventsViewProjectionUpdatedType = _publicOnEventsViewProjectionUpdatedType;
|
|
3895
|
+
declare const context$3_getEventsView: typeof getEventsView;
|
|
3896
|
+
declare const context$3_onEventsViewExtended: typeof onEventsViewExtended;
|
|
3897
|
+
declare const context$3_onEventsViewProjectionUpdated: typeof onEventsViewProjectionUpdated;
|
|
3898
|
+
declare namespace context$3 {
|
|
3899
|
+
export { type ActionEvent$3 as ActionEvent, type BaseEventMetadata$3 as BaseEventMetadata, type CommonIdentificationData$1 as CommonIdentificationData, type CommonIdentificationDataIdOneOf$1 as CommonIdentificationDataIdOneOf, type ConferencingDetails$1 as ConferencingDetails, context$3_Day as Day, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type Empty$3 as Empty, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type context$3_Event as Event, type context$3_EventAddedOrUpdated as EventAddedOrUpdated, type EventMetadata$3 as EventMetadata, type context$3_EventRemoved as EventRemoved, type context$3_EventsView as EventsView, type context$3_EventsViewExtended as EventsViewExtended, type context$3_EventsViewExtendedEnvelope as EventsViewExtendedEnvelope, type context$3_EventsViewProjectionUpdated as EventsViewProjectionUpdated, type context$3_EventsViewProjectionUpdatedEnvelope as EventsViewProjectionUpdatedEnvelope, type context$3_EventsViewProjectionUpdatedTypeOneOf as EventsViewProjectionUpdatedTypeOneOf, type context$3_ExtendEventsViewRequest as ExtendEventsViewRequest, type context$3_ExtendEventsViewResponse as ExtendEventsViewResponse, type ExtendedFields$2 as ExtendedFields, context$3_Field as Field, context$3_Frequency as Frequency, type context$3_GetEventsViewRequest as GetEventsViewRequest, type context$3_GetEventsViewResponse as GetEventsViewResponse, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, IdentityType$1 as IdentityType, type Location$1 as Location, LocationType$1 as LocationType, type MessageEnvelope$3 as MessageEnvelope, type Participant$1 as Participant, type context$3_Participants as Participants, context$3_ParticipantsStatus as ParticipantsStatus, type Permission$1 as Permission, type context$3_RecurrenceRule as RecurrenceRule, context$3_RecurrenceType as RecurrenceType, type context$3_Resource as Resource, type RestoreInfo$3 as RestoreInfo, Role$1 as Role, Status$3 as Status, context$3_Transparency as Transparency, Type$1 as Type, WebhookIdentityType$3 as WebhookIdentityType, type ZonedDate$1 as ZonedDate, type context$3__publicOnEventsViewExtendedType as _publicOnEventsViewExtendedType, type context$3__publicOnEventsViewProjectionUpdatedType as _publicOnEventsViewProjectionUpdatedType, context$3_getEventsView as getEventsView, context$3_onEventsViewExtended as onEventsViewExtended, context$3_onEventsViewProjectionUpdated as onEventsViewProjectionUpdated, onEventsViewExtended$1 as publicOnEventsViewExtended, onEventsViewProjectionUpdated$1 as publicOnEventsViewProjectionUpdated };
|
|
3900
|
+
}
|
|
3901
|
+
|
|
3902
|
+
type HostModule$2<T, H extends Host$2> = {
|
|
3903
|
+
__type: 'host';
|
|
3904
|
+
create(host: H): T;
|
|
3905
|
+
};
|
|
3906
|
+
type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
|
|
3907
|
+
type Host$2<Environment = unknown> = {
|
|
3908
|
+
channel: {
|
|
3909
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
3910
|
+
disconnect: () => void;
|
|
3911
|
+
} | Promise<{
|
|
3912
|
+
disconnect: () => void;
|
|
3913
|
+
}>;
|
|
3914
|
+
};
|
|
3915
|
+
environment?: Environment;
|
|
3916
|
+
/**
|
|
3917
|
+
* Optional name of the environment, use for logging
|
|
3918
|
+
*/
|
|
3919
|
+
name?: string;
|
|
3920
|
+
/**
|
|
3921
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
3922
|
+
*/
|
|
3923
|
+
apiBaseUrl?: string;
|
|
3924
|
+
/**
|
|
3925
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
3926
|
+
* like internationalization, billing, etc.
|
|
3927
|
+
*/
|
|
3928
|
+
essentials?: {
|
|
3929
|
+
/**
|
|
3930
|
+
* The language of the currently viewed session
|
|
3931
|
+
*/
|
|
3932
|
+
language?: string;
|
|
3933
|
+
/**
|
|
3934
|
+
* The locale of the currently viewed session
|
|
3935
|
+
*/
|
|
3936
|
+
locale?: string;
|
|
3937
|
+
/**
|
|
3938
|
+
* Any headers that should be passed through to the API requests
|
|
3939
|
+
*/
|
|
3940
|
+
passThroughHeaders?: Record<string, string>;
|
|
3941
|
+
};
|
|
3942
|
+
};
|
|
3943
|
+
|
|
3944
|
+
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
3945
|
+
interface HttpClient$2 {
|
|
3946
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
3947
|
+
fetchWithAuth: typeof fetch;
|
|
3948
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
3949
|
+
getActiveToken?: () => string | undefined;
|
|
3950
|
+
}
|
|
3951
|
+
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
3952
|
+
type HttpResponse$2<T = any> = {
|
|
3953
|
+
data: T;
|
|
3954
|
+
status: number;
|
|
3955
|
+
statusText: string;
|
|
3956
|
+
headers: any;
|
|
3957
|
+
request?: any;
|
|
3958
|
+
};
|
|
3959
|
+
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
3960
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3961
|
+
url: string;
|
|
3962
|
+
data?: Data;
|
|
3963
|
+
params?: URLSearchParams;
|
|
3964
|
+
} & APIMetadata$2;
|
|
3965
|
+
type APIMetadata$2 = {
|
|
3966
|
+
methodFqn?: string;
|
|
3967
|
+
entityFqdn?: string;
|
|
3968
|
+
packageName?: string;
|
|
3969
|
+
};
|
|
3970
|
+
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
3971
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
3972
|
+
__type: 'event-definition';
|
|
3973
|
+
type: Type;
|
|
3974
|
+
isDomainEvent?: boolean;
|
|
3975
|
+
transformations?: (envelope: unknown) => Payload;
|
|
3976
|
+
__payload: Payload;
|
|
3977
|
+
};
|
|
3978
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
3979
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
3980
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
3981
|
+
|
|
3982
|
+
type ServicePluginMethodInput$2 = {
|
|
3983
|
+
request: any;
|
|
3984
|
+
metadata: any;
|
|
3985
|
+
};
|
|
3986
|
+
type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
|
|
3987
|
+
type ServicePluginMethodMetadata$2 = {
|
|
3988
|
+
name: string;
|
|
3989
|
+
primaryHttpMappingPath: string;
|
|
3990
|
+
transformations: {
|
|
3991
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
|
|
3992
|
+
toREST: (...args: unknown[]) => unknown;
|
|
3993
|
+
};
|
|
3994
|
+
};
|
|
3995
|
+
type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
|
|
3996
|
+
__type: 'service-plugin-definition';
|
|
3997
|
+
componentType: string;
|
|
3998
|
+
methods: ServicePluginMethodMetadata$2[];
|
|
3999
|
+
__contract: Contract;
|
|
4000
|
+
};
|
|
4001
|
+
declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
|
|
4002
|
+
type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
|
|
4003
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
|
|
4004
|
+
|
|
4005
|
+
type RequestContext$2 = {
|
|
4006
|
+
isSSR: boolean;
|
|
4007
|
+
host: string;
|
|
4008
|
+
protocol?: string;
|
|
4009
|
+
};
|
|
4010
|
+
type ResponseTransformer$2 = (data: any, headers?: any) => any;
|
|
4011
|
+
/**
|
|
4012
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
4013
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
4014
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
4015
|
+
*/
|
|
4016
|
+
type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
4017
|
+
type AmbassadorRequestOptions$2<T = any> = {
|
|
4018
|
+
_?: T;
|
|
4019
|
+
url?: string;
|
|
4020
|
+
method?: Method$2;
|
|
4021
|
+
params?: any;
|
|
4022
|
+
data?: any;
|
|
4023
|
+
transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
|
|
4024
|
+
};
|
|
4025
|
+
type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
|
|
4026
|
+
__isAmbassador: boolean;
|
|
4027
|
+
};
|
|
4028
|
+
type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
|
|
4029
|
+
type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
4030
|
+
|
|
4031
|
+
declare global {
|
|
4032
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4033
|
+
interface SymbolConstructor {
|
|
4034
|
+
readonly observable: symbol;
|
|
4035
|
+
}
|
|
3308
4036
|
}
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
4037
|
+
|
|
4038
|
+
declare const emptyObjectSymbol$2: unique symbol;
|
|
4039
|
+
|
|
4040
|
+
/**
|
|
4041
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
4042
|
+
|
|
4043
|
+
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)).
|
|
4044
|
+
|
|
4045
|
+
@example
|
|
4046
|
+
```
|
|
4047
|
+
import type {EmptyObject} from 'type-fest';
|
|
4048
|
+
|
|
4049
|
+
// The following illustrates the problem with `{}`.
|
|
4050
|
+
const foo1: {} = {}; // Pass
|
|
4051
|
+
const foo2: {} = []; // Pass
|
|
4052
|
+
const foo3: {} = 42; // Pass
|
|
4053
|
+
const foo4: {} = {a: 1}; // Pass
|
|
4054
|
+
|
|
4055
|
+
// With `EmptyObject` only the first case is valid.
|
|
4056
|
+
const bar1: EmptyObject = {}; // Pass
|
|
4057
|
+
const bar2: EmptyObject = 42; // Fail
|
|
4058
|
+
const bar3: EmptyObject = []; // Fail
|
|
4059
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
4060
|
+
```
|
|
4061
|
+
|
|
4062
|
+
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}.
|
|
4063
|
+
|
|
4064
|
+
@category Object
|
|
4065
|
+
*/
|
|
4066
|
+
type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
|
|
4067
|
+
|
|
4068
|
+
/**
|
|
4069
|
+
Returns a boolean for whether the two given types are equal.
|
|
4070
|
+
|
|
4071
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
4072
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
4073
|
+
|
|
4074
|
+
Use-cases:
|
|
4075
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
4076
|
+
|
|
4077
|
+
@example
|
|
4078
|
+
```
|
|
4079
|
+
import type {IsEqual} from 'type-fest';
|
|
4080
|
+
|
|
4081
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
4082
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
4083
|
+
type Includes<Value extends readonly any[], Item> =
|
|
4084
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
4085
|
+
? IsEqual<Value[0], Item> extends true
|
|
4086
|
+
? true
|
|
4087
|
+
: Includes<rest, Item>
|
|
4088
|
+
: false;
|
|
4089
|
+
```
|
|
4090
|
+
|
|
4091
|
+
@category Type Guard
|
|
4092
|
+
@category Utilities
|
|
4093
|
+
*/
|
|
4094
|
+
type IsEqual$2<A, B> =
|
|
4095
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
4096
|
+
(<G>() => G extends B ? 1 : 2)
|
|
4097
|
+
? true
|
|
4098
|
+
: false;
|
|
4099
|
+
|
|
4100
|
+
/**
|
|
4101
|
+
Filter out keys from an object.
|
|
4102
|
+
|
|
4103
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
4104
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
4105
|
+
Returns `Key` otherwise.
|
|
4106
|
+
|
|
4107
|
+
@example
|
|
4108
|
+
```
|
|
4109
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
4110
|
+
//=> never
|
|
4111
|
+
```
|
|
4112
|
+
|
|
4113
|
+
@example
|
|
4114
|
+
```
|
|
4115
|
+
type Filtered = Filter<'bar', string>;
|
|
4116
|
+
//=> never
|
|
4117
|
+
```
|
|
4118
|
+
|
|
4119
|
+
@example
|
|
4120
|
+
```
|
|
4121
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
4122
|
+
//=> 'bar'
|
|
4123
|
+
```
|
|
4124
|
+
|
|
4125
|
+
@see {Except}
|
|
4126
|
+
*/
|
|
4127
|
+
type Filter$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
4128
|
+
|
|
4129
|
+
type ExceptOptions$2 = {
|
|
4130
|
+
/**
|
|
4131
|
+
Disallow assigning non-specified properties.
|
|
4132
|
+
|
|
4133
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
4134
|
+
|
|
4135
|
+
@default false
|
|
4136
|
+
*/
|
|
4137
|
+
requireExactProps?: boolean;
|
|
4138
|
+
};
|
|
4139
|
+
|
|
4140
|
+
/**
|
|
4141
|
+
Create a type from an object type without certain keys.
|
|
4142
|
+
|
|
4143
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
4144
|
+
|
|
4145
|
+
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.
|
|
4146
|
+
|
|
4147
|
+
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)).
|
|
4148
|
+
|
|
4149
|
+
@example
|
|
4150
|
+
```
|
|
4151
|
+
import type {Except} from 'type-fest';
|
|
4152
|
+
|
|
4153
|
+
type Foo = {
|
|
4154
|
+
a: number;
|
|
4155
|
+
b: string;
|
|
4156
|
+
};
|
|
4157
|
+
|
|
4158
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
4159
|
+
//=> {b: string}
|
|
4160
|
+
|
|
4161
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
4162
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
4163
|
+
|
|
4164
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
4165
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
4166
|
+
|
|
4167
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
4168
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
4169
|
+
```
|
|
4170
|
+
|
|
4171
|
+
@category Object
|
|
4172
|
+
*/
|
|
4173
|
+
type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
|
|
4174
|
+
[KeyType in keyof ObjectType as Filter$2<KeyType, KeysType>]: ObjectType[KeyType];
|
|
4175
|
+
} & (Options['requireExactProps'] extends true
|
|
4176
|
+
? Partial<Record<KeysType, never>>
|
|
4177
|
+
: {});
|
|
4178
|
+
|
|
4179
|
+
/**
|
|
4180
|
+
Returns a boolean for whether the given type is `never`.
|
|
4181
|
+
|
|
4182
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
4183
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
4184
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
4185
|
+
|
|
4186
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
4187
|
+
|
|
4188
|
+
@example
|
|
4189
|
+
```
|
|
4190
|
+
import type {IsNever, And} from 'type-fest';
|
|
4191
|
+
|
|
4192
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
4193
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
4194
|
+
And<
|
|
4195
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
4196
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
4197
|
+
>;
|
|
4198
|
+
|
|
4199
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
4200
|
+
AreStringsEqual<I, O> extends true
|
|
4201
|
+
? never
|
|
4202
|
+
: void;
|
|
4203
|
+
|
|
4204
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
4205
|
+
if (input === output) {
|
|
4206
|
+
process.exit(0);
|
|
4207
|
+
}
|
|
4208
|
+
}
|
|
4209
|
+
|
|
4210
|
+
endIfEqual('abc', 'abc');
|
|
4211
|
+
//=> never
|
|
4212
|
+
|
|
4213
|
+
endIfEqual('abc', '123');
|
|
4214
|
+
//=> void
|
|
4215
|
+
```
|
|
4216
|
+
|
|
4217
|
+
@category Type Guard
|
|
4218
|
+
@category Utilities
|
|
4219
|
+
*/
|
|
4220
|
+
type IsNever$2<T> = [T] extends [never] ? true : false;
|
|
4221
|
+
|
|
4222
|
+
/**
|
|
4223
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
4224
|
+
|
|
4225
|
+
@see {@link IsNever}
|
|
4226
|
+
|
|
4227
|
+
@example
|
|
4228
|
+
```
|
|
4229
|
+
import type {IfNever} from 'type-fest';
|
|
4230
|
+
|
|
4231
|
+
type ShouldBeTrue = IfNever<never>;
|
|
4232
|
+
//=> true
|
|
4233
|
+
|
|
4234
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
4235
|
+
//=> 'bar'
|
|
4236
|
+
```
|
|
4237
|
+
|
|
4238
|
+
@category Type Guard
|
|
4239
|
+
@category Utilities
|
|
4240
|
+
*/
|
|
4241
|
+
type IfNever$2<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
4242
|
+
IsNever$2<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
4243
|
+
);
|
|
4244
|
+
|
|
4245
|
+
/**
|
|
4246
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
4247
|
+
|
|
4248
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
4249
|
+
|
|
4250
|
+
@example
|
|
4251
|
+
```
|
|
4252
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
4253
|
+
|
|
4254
|
+
interface Example {
|
|
4255
|
+
a: string;
|
|
4256
|
+
b: string | number;
|
|
4257
|
+
c?: string;
|
|
4258
|
+
d: {};
|
|
3312
4259
|
}
|
|
3313
4260
|
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
* Retrieves the events view information.
|
|
3318
|
-
* E.g. the current view end date, or the future duration in days the view should strive for.
|
|
3319
|
-
*/
|
|
3320
|
-
(): Promise<GetEventsViewResponse>;
|
|
3321
|
-
}
|
|
3322
|
-
declare const onEventsViewProjectionUpdated$1: EventDefinition$5<EventsViewProjectionUpdatedEnvelope, "wix.calendar.v3.events_view_projection_updated">;
|
|
3323
|
-
declare const onEventsViewExtended$1: EventDefinition$5<EventsViewExtendedEnvelope, "wix.calendar.v3.events_view_extended">;
|
|
4261
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
4262
|
+
//=> 'a'
|
|
4263
|
+
```
|
|
3324
4264
|
|
|
3325
|
-
|
|
3326
|
-
__type: 'event-definition';
|
|
3327
|
-
type: Type;
|
|
3328
|
-
isDomainEvent?: boolean;
|
|
3329
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3330
|
-
__payload: Payload;
|
|
3331
|
-
};
|
|
3332
|
-
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
3333
|
-
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
3334
|
-
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
4265
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
3335
4266
|
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
4267
|
+
@example
|
|
4268
|
+
```
|
|
4269
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
4270
|
+
|
|
4271
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
4272
|
+
//=> 'a' | 'c'
|
|
4273
|
+
```
|
|
4274
|
+
|
|
4275
|
+
@category Object
|
|
4276
|
+
*/
|
|
4277
|
+
type ConditionalKeys$2<Base, Condition> =
|
|
4278
|
+
{
|
|
4279
|
+
// Map through all the keys of the given base type.
|
|
4280
|
+
[Key in keyof Base]-?:
|
|
4281
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
4282
|
+
Base[Key] extends Condition
|
|
4283
|
+
// Retain this key
|
|
4284
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
4285
|
+
? IfNever$2<Base[Key], IfNever$2<Condition, Key, never>, Key>
|
|
4286
|
+
// Discard this key since the condition fails.
|
|
4287
|
+
: never;
|
|
4288
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
4289
|
+
}[keyof Base];
|
|
4290
|
+
|
|
4291
|
+
/**
|
|
4292
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
4293
|
+
|
|
4294
|
+
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.
|
|
4295
|
+
|
|
4296
|
+
@example
|
|
4297
|
+
```
|
|
4298
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
4299
|
+
|
|
4300
|
+
class Awesome {
|
|
4301
|
+
name: string;
|
|
4302
|
+
successes: number;
|
|
4303
|
+
failures: bigint;
|
|
4304
|
+
|
|
4305
|
+
run() {}
|
|
3341
4306
|
}
|
|
3342
4307
|
|
|
3343
|
-
|
|
4308
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
4309
|
+
//=> {run: () => void}
|
|
4310
|
+
```
|
|
3344
4311
|
|
|
3345
|
-
|
|
4312
|
+
@example
|
|
4313
|
+
```
|
|
4314
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
3346
4315
|
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
4316
|
+
interface Example {
|
|
4317
|
+
a: string;
|
|
4318
|
+
b: string | number;
|
|
4319
|
+
c: () => void;
|
|
4320
|
+
d: {};
|
|
4321
|
+
}
|
|
3350
4322
|
|
|
3351
|
-
type
|
|
3352
|
-
|
|
3353
|
-
|
|
4323
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
4324
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
4325
|
+
```
|
|
3354
4326
|
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
type
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
type
|
|
3366
|
-
|
|
3367
|
-
type
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
4327
|
+
@category Object
|
|
4328
|
+
*/
|
|
4329
|
+
type ConditionalExcept$2<Base, Condition> = Except$2<
|
|
4330
|
+
Base,
|
|
4331
|
+
ConditionalKeys$2<Base, Condition>
|
|
4332
|
+
>;
|
|
4333
|
+
|
|
4334
|
+
/**
|
|
4335
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
4336
|
+
* can either be a REST module or a host module.
|
|
4337
|
+
* This type is recursive, so it can describe nested modules.
|
|
4338
|
+
*/
|
|
4339
|
+
type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$2<any> | ServicePluginDefinition$2<any> | {
|
|
4340
|
+
[key: string]: Descriptors$2 | PublicMetadata$2 | any;
|
|
4341
|
+
};
|
|
4342
|
+
/**
|
|
4343
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
4344
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
4345
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
4346
|
+
* do not match the given host (as they will not work with the given host).
|
|
4347
|
+
*/
|
|
4348
|
+
type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
|
|
4349
|
+
done: T;
|
|
4350
|
+
recurse: T extends {
|
|
4351
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
|
|
4352
|
+
} ? never : T extends AmbassadorFunctionDescriptor$2 ? BuildAmbassadorFunction$2<T> : T extends RESTFunctionDescriptor$2 ? BuildRESTFunction$2<T> : T extends EventDefinition$2<any> ? BuildEventDefinition$2<T> : T extends ServicePluginDefinition$2<any> ? BuildServicePluginDefinition$2<T> : T extends HostModule$2<any, any> ? HostModuleAPI$2<T> : ConditionalExcept$2<{
|
|
4353
|
+
[Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
|
|
4354
|
+
-1,
|
|
4355
|
+
0,
|
|
4356
|
+
1,
|
|
4357
|
+
2,
|
|
4358
|
+
3,
|
|
4359
|
+
4,
|
|
4360
|
+
5
|
|
4361
|
+
][Depth]> : never;
|
|
4362
|
+
}, EmptyObject$2>;
|
|
4363
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
4364
|
+
type PublicMetadata$2 = {
|
|
4365
|
+
PACKAGE_NAME?: string;
|
|
4366
|
+
};
|
|
4367
|
+
|
|
4368
|
+
declare global {
|
|
4369
|
+
interface ContextualClient {
|
|
4370
|
+
}
|
|
3390
4371
|
}
|
|
4372
|
+
/**
|
|
4373
|
+
* A type used to create concerete types from SDK descriptors in
|
|
4374
|
+
* case a contextual client is available.
|
|
4375
|
+
*/
|
|
4376
|
+
type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
|
|
4377
|
+
host: Host$2;
|
|
4378
|
+
} ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
|
|
3391
4379
|
|
|
3392
4380
|
interface Participation extends ParticipationParticipatedItemOneOf {
|
|
3393
4381
|
/** The ID of the schedule that the participant is participating in. */
|
|
@@ -3847,135 +4835,595 @@ interface UpdateParticipation {
|
|
|
3847
4835
|
extendedFields?: ExtendedFields$1;
|
|
3848
4836
|
}
|
|
3849
4837
|
|
|
3850
|
-
declare function getParticipation$1(httpClient: HttpClient): GetParticipationSignature;
|
|
3851
|
-
interface GetParticipationSignature {
|
|
4838
|
+
declare function getParticipation$1(httpClient: HttpClient$2): GetParticipationSignature;
|
|
4839
|
+
interface GetParticipationSignature {
|
|
4840
|
+
/**
|
|
4841
|
+
* Retrieves a participation by ID.
|
|
4842
|
+
* @param - The participation ID.
|
|
4843
|
+
* @returns The participation.
|
|
4844
|
+
*/
|
|
4845
|
+
(participationId: string | null): Promise<Participation & ParticipationNonNullableFields>;
|
|
4846
|
+
}
|
|
4847
|
+
declare function queryParticipations$1(httpClient: HttpClient$2): QueryParticipationsSignature;
|
|
4848
|
+
interface QueryParticipationsSignature {
|
|
4849
|
+
/**
|
|
4850
|
+
* Retrieves a list of participations, given the provided filters and paging.
|
|
4851
|
+
*
|
|
4852
|
+
* Sort: by `createdDate`, default order is `DESC`.
|
|
4853
|
+
*/
|
|
4854
|
+
(): ParticipationsQueryBuilder;
|
|
4855
|
+
}
|
|
4856
|
+
declare function createParticipation$1(httpClient: HttpClient$2): CreateParticipationSignature;
|
|
4857
|
+
interface CreateParticipationSignature {
|
|
4858
|
+
/**
|
|
4859
|
+
* Creates a schedule or event participation.
|
|
4860
|
+
* @param - The participation to create.
|
|
4861
|
+
* @returns The created participation.
|
|
4862
|
+
*/
|
|
4863
|
+
(participation: Participation, options?: CreateParticipationOptions | undefined): Promise<Participation & ParticipationNonNullableFields>;
|
|
4864
|
+
}
|
|
4865
|
+
declare function updateParticipation$1(httpClient: HttpClient$2): UpdateParticipationSignature;
|
|
4866
|
+
interface UpdateParticipationSignature {
|
|
4867
|
+
/**
|
|
4868
|
+
* Updates a participation.
|
|
4869
|
+
* @param - The participation ID.
|
|
4870
|
+
* @returns The updated participation.
|
|
4871
|
+
*/
|
|
4872
|
+
(_id: string | null, participation: UpdateParticipation): Promise<Participation & ParticipationNonNullableFields>;
|
|
4873
|
+
}
|
|
4874
|
+
declare function deleteParticipation$1(httpClient: HttpClient$2): DeleteParticipationSignature;
|
|
4875
|
+
interface DeleteParticipationSignature {
|
|
4876
|
+
/**
|
|
4877
|
+
* Deletes a participation.
|
|
4878
|
+
* @param - The ID of participation to delete.
|
|
4879
|
+
*/
|
|
4880
|
+
(participationId: string | null): Promise<void>;
|
|
4881
|
+
}
|
|
4882
|
+
declare const onParticipationCreated$1: EventDefinition$2<ParticipationCreatedEnvelope, "wix.calendar.v3.participation_created">;
|
|
4883
|
+
declare const onParticipationUpdated$1: EventDefinition$2<ParticipationUpdatedEnvelope, "wix.calendar.v3.participation_updated">;
|
|
4884
|
+
declare const onParticipationDeleted$1: EventDefinition$2<ParticipationDeletedEnvelope, "wix.calendar.v3.participation_deleted">;
|
|
4885
|
+
|
|
4886
|
+
declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
|
4887
|
+
|
|
4888
|
+
declare const getParticipation: MaybeContext$2<BuildRESTFunction$2<typeof getParticipation$1> & typeof getParticipation$1>;
|
|
4889
|
+
declare const queryParticipations: MaybeContext$2<BuildRESTFunction$2<typeof queryParticipations$1> & typeof queryParticipations$1>;
|
|
4890
|
+
declare const createParticipation: MaybeContext$2<BuildRESTFunction$2<typeof createParticipation$1> & typeof createParticipation$1>;
|
|
4891
|
+
declare const updateParticipation: MaybeContext$2<BuildRESTFunction$2<typeof updateParticipation$1> & typeof updateParticipation$1>;
|
|
4892
|
+
declare const deleteParticipation: MaybeContext$2<BuildRESTFunction$2<typeof deleteParticipation$1> & typeof deleteParticipation$1>;
|
|
4893
|
+
|
|
4894
|
+
type _publicOnParticipationCreatedType = typeof onParticipationCreated$1;
|
|
4895
|
+
/** */
|
|
4896
|
+
declare const onParticipationCreated: ReturnType<typeof createEventModule$2<_publicOnParticipationCreatedType>>;
|
|
4897
|
+
|
|
4898
|
+
type _publicOnParticipationUpdatedType = typeof onParticipationUpdated$1;
|
|
4899
|
+
/** */
|
|
4900
|
+
declare const onParticipationUpdated: ReturnType<typeof createEventModule$2<_publicOnParticipationUpdatedType>>;
|
|
4901
|
+
|
|
4902
|
+
type _publicOnParticipationDeletedType = typeof onParticipationDeleted$1;
|
|
4903
|
+
/** */
|
|
4904
|
+
declare const onParticipationDeleted: ReturnType<typeof createEventModule$2<_publicOnParticipationDeletedType>>;
|
|
4905
|
+
|
|
4906
|
+
type context$2_CreateParticipationOptions = CreateParticipationOptions;
|
|
4907
|
+
type context$2_CreateParticipationRequest = CreateParticipationRequest;
|
|
4908
|
+
type context$2_CreateParticipationResponse = CreateParticipationResponse;
|
|
4909
|
+
type context$2_CreateParticipationResponseNonNullableFields = CreateParticipationResponseNonNullableFields;
|
|
4910
|
+
type context$2_DeleteParticipationRequest = DeleteParticipationRequest;
|
|
4911
|
+
type context$2_DeleteParticipationResponse = DeleteParticipationResponse;
|
|
4912
|
+
type context$2_GetParticipationRequest = GetParticipationRequest;
|
|
4913
|
+
type context$2_GetParticipationResponse = GetParticipationResponse;
|
|
4914
|
+
type context$2_GetParticipationResponseNonNullableFields = GetParticipationResponseNonNullableFields;
|
|
4915
|
+
type context$2_Participant = Participant;
|
|
4916
|
+
type context$2_Participation = Participation;
|
|
4917
|
+
type context$2_ParticipationCreatedEnvelope = ParticipationCreatedEnvelope;
|
|
4918
|
+
type context$2_ParticipationDeletedEnvelope = ParticipationDeletedEnvelope;
|
|
4919
|
+
type context$2_ParticipationNonNullableFields = ParticipationNonNullableFields;
|
|
4920
|
+
type context$2_ParticipationParticipatedItemOneOf = ParticipationParticipatedItemOneOf;
|
|
4921
|
+
type context$2_ParticipationUpdatedEnvelope = ParticipationUpdatedEnvelope;
|
|
4922
|
+
type context$2_ParticipationUpdatedWithMetadata = ParticipationUpdatedWithMetadata;
|
|
4923
|
+
type context$2_ParticipationsQueryBuilder = ParticipationsQueryBuilder;
|
|
4924
|
+
type context$2_ParticipationsQueryResult = ParticipationsQueryResult;
|
|
4925
|
+
type context$2_PartySizeSumByScheduleId = PartySizeSumByScheduleId;
|
|
4926
|
+
type context$2_QueryParticipationsRequest = QueryParticipationsRequest;
|
|
4927
|
+
type context$2_QueryParticipationsResponse = QueryParticipationsResponse;
|
|
4928
|
+
type context$2_QueryParticipationsResponseNonNullableFields = QueryParticipationsResponseNonNullableFields;
|
|
4929
|
+
type context$2_SumParticipationsPartySizeByScheduleIdRequest = SumParticipationsPartySizeByScheduleIdRequest;
|
|
4930
|
+
type context$2_SumParticipationsPartySizeByScheduleIdResponse = SumParticipationsPartySizeByScheduleIdResponse;
|
|
4931
|
+
type context$2_UpdateParticipation = UpdateParticipation;
|
|
4932
|
+
type context$2_UpdateParticipationRequest = UpdateParticipationRequest;
|
|
4933
|
+
type context$2_UpdateParticipationResponse = UpdateParticipationResponse;
|
|
4934
|
+
type context$2_UpdateParticipationResponseNonNullableFields = UpdateParticipationResponseNonNullableFields;
|
|
4935
|
+
type context$2__publicOnParticipationCreatedType = _publicOnParticipationCreatedType;
|
|
4936
|
+
type context$2__publicOnParticipationDeletedType = _publicOnParticipationDeletedType;
|
|
4937
|
+
type context$2__publicOnParticipationUpdatedType = _publicOnParticipationUpdatedType;
|
|
4938
|
+
declare const context$2_createParticipation: typeof createParticipation;
|
|
4939
|
+
declare const context$2_deleteParticipation: typeof deleteParticipation;
|
|
4940
|
+
declare const context$2_getParticipation: typeof getParticipation;
|
|
4941
|
+
declare const context$2_onParticipationCreated: typeof onParticipationCreated;
|
|
4942
|
+
declare const context$2_onParticipationDeleted: typeof onParticipationDeleted;
|
|
4943
|
+
declare const context$2_onParticipationUpdated: typeof onParticipationUpdated;
|
|
4944
|
+
declare const context$2_queryParticipations: typeof queryParticipations;
|
|
4945
|
+
declare const context$2_updateParticipation: typeof updateParticipation;
|
|
4946
|
+
declare namespace context$2 {
|
|
4947
|
+
export { type ActionEvent$2 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type context$2_CreateParticipationOptions as CreateParticipationOptions, type context$2_CreateParticipationRequest as CreateParticipationRequest, type context$2_CreateParticipationResponse as CreateParticipationResponse, type context$2_CreateParticipationResponseNonNullableFields as CreateParticipationResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type CursorQuery$1 as CursorQuery, type CursorQueryPagingMethodOneOf$1 as CursorQueryPagingMethodOneOf, type Cursors$1 as Cursors, type context$2_DeleteParticipationRequest as DeleteParticipationRequest, type context$2_DeleteParticipationResponse as DeleteParticipationResponse, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$2 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type ExtendedFields$1 as ExtendedFields, type context$2_GetParticipationRequest as GetParticipationRequest, type context$2_GetParticipationResponse as GetParticipationResponse, type context$2_GetParticipationResponseNonNullableFields as GetParticipationResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type MessageEnvelope$2 as MessageEnvelope, type context$2_Participant as Participant, type context$2_Participation as Participation, type context$2_ParticipationCreatedEnvelope as ParticipationCreatedEnvelope, type context$2_ParticipationDeletedEnvelope as ParticipationDeletedEnvelope, type context$2_ParticipationNonNullableFields as ParticipationNonNullableFields, type context$2_ParticipationParticipatedItemOneOf as ParticipationParticipatedItemOneOf, type context$2_ParticipationUpdatedEnvelope as ParticipationUpdatedEnvelope, type context$2_ParticipationUpdatedWithMetadata as ParticipationUpdatedWithMetadata, type context$2_ParticipationsQueryBuilder as ParticipationsQueryBuilder, type context$2_ParticipationsQueryResult as ParticipationsQueryResult, type context$2_PartySizeSumByScheduleId as PartySizeSumByScheduleId, type context$2_QueryParticipationsRequest as QueryParticipationsRequest, type context$2_QueryParticipationsResponse as QueryParticipationsResponse, type context$2_QueryParticipationsResponseNonNullableFields as QueryParticipationsResponseNonNullableFields, type RestoreInfo$2 as RestoreInfo, Status$2 as Status, type context$2_SumParticipationsPartySizeByScheduleIdRequest as SumParticipationsPartySizeByScheduleIdRequest, type context$2_SumParticipationsPartySizeByScheduleIdResponse as SumParticipationsPartySizeByScheduleIdResponse, type context$2_UpdateParticipation as UpdateParticipation, type context$2_UpdateParticipationRequest as UpdateParticipationRequest, type context$2_UpdateParticipationResponse as UpdateParticipationResponse, type context$2_UpdateParticipationResponseNonNullableFields as UpdateParticipationResponseNonNullableFields, WebhookIdentityType$2 as WebhookIdentityType, type context$2__publicOnParticipationCreatedType as _publicOnParticipationCreatedType, type context$2__publicOnParticipationDeletedType as _publicOnParticipationDeletedType, type context$2__publicOnParticipationUpdatedType as _publicOnParticipationUpdatedType, context$2_createParticipation as createParticipation, context$2_deleteParticipation as deleteParticipation, context$2_getParticipation as getParticipation, context$2_onParticipationCreated as onParticipationCreated, context$2_onParticipationDeleted as onParticipationDeleted, context$2_onParticipationUpdated as onParticipationUpdated, onParticipationCreated$1 as publicOnParticipationCreated, onParticipationDeleted$1 as publicOnParticipationDeleted, onParticipationUpdated$1 as publicOnParticipationUpdated, context$2_queryParticipations as queryParticipations, context$2_updateParticipation as updateParticipation };
|
|
4948
|
+
}
|
|
4949
|
+
|
|
4950
|
+
type HostModule$1<T, H extends Host$1> = {
|
|
4951
|
+
__type: 'host';
|
|
4952
|
+
create(host: H): T;
|
|
4953
|
+
};
|
|
4954
|
+
type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
|
|
4955
|
+
type Host$1<Environment = unknown> = {
|
|
4956
|
+
channel: {
|
|
4957
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
4958
|
+
disconnect: () => void;
|
|
4959
|
+
} | Promise<{
|
|
4960
|
+
disconnect: () => void;
|
|
4961
|
+
}>;
|
|
4962
|
+
};
|
|
4963
|
+
environment?: Environment;
|
|
3852
4964
|
/**
|
|
3853
|
-
*
|
|
3854
|
-
* @param - The participation ID.
|
|
3855
|
-
* @returns The participation.
|
|
4965
|
+
* Optional name of the environment, use for logging
|
|
3856
4966
|
*/
|
|
3857
|
-
|
|
3858
|
-
}
|
|
3859
|
-
declare function queryParticipations$1(httpClient: HttpClient): QueryParticipationsSignature;
|
|
3860
|
-
interface QueryParticipationsSignature {
|
|
4967
|
+
name?: string;
|
|
3861
4968
|
/**
|
|
3862
|
-
*
|
|
3863
|
-
*
|
|
3864
|
-
* Sort: by `createdDate`, default order is `DESC`.
|
|
4969
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
3865
4970
|
*/
|
|
3866
|
-
|
|
3867
|
-
}
|
|
3868
|
-
declare function createParticipation$1(httpClient: HttpClient): CreateParticipationSignature;
|
|
3869
|
-
interface CreateParticipationSignature {
|
|
4971
|
+
apiBaseUrl?: string;
|
|
3870
4972
|
/**
|
|
3871
|
-
*
|
|
3872
|
-
*
|
|
3873
|
-
* @returns The created participation.
|
|
4973
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
4974
|
+
* like internationalization, billing, etc.
|
|
3874
4975
|
*/
|
|
3875
|
-
|
|
4976
|
+
essentials?: {
|
|
4977
|
+
/**
|
|
4978
|
+
* The language of the currently viewed session
|
|
4979
|
+
*/
|
|
4980
|
+
language?: string;
|
|
4981
|
+
/**
|
|
4982
|
+
* The locale of the currently viewed session
|
|
4983
|
+
*/
|
|
4984
|
+
locale?: string;
|
|
4985
|
+
/**
|
|
4986
|
+
* Any headers that should be passed through to the API requests
|
|
4987
|
+
*/
|
|
4988
|
+
passThroughHeaders?: Record<string, string>;
|
|
4989
|
+
};
|
|
4990
|
+
};
|
|
4991
|
+
|
|
4992
|
+
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
4993
|
+
interface HttpClient$1 {
|
|
4994
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
4995
|
+
fetchWithAuth: typeof fetch;
|
|
4996
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
4997
|
+
getActiveToken?: () => string | undefined;
|
|
3876
4998
|
}
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
4999
|
+
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
5000
|
+
type HttpResponse$1<T = any> = {
|
|
5001
|
+
data: T;
|
|
5002
|
+
status: number;
|
|
5003
|
+
statusText: string;
|
|
5004
|
+
headers: any;
|
|
5005
|
+
request?: any;
|
|
5006
|
+
};
|
|
5007
|
+
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
5008
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
5009
|
+
url: string;
|
|
5010
|
+
data?: Data;
|
|
5011
|
+
params?: URLSearchParams;
|
|
5012
|
+
} & APIMetadata$1;
|
|
5013
|
+
type APIMetadata$1 = {
|
|
5014
|
+
methodFqn?: string;
|
|
5015
|
+
entityFqdn?: string;
|
|
5016
|
+
packageName?: string;
|
|
5017
|
+
};
|
|
5018
|
+
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
5019
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
5020
|
+
__type: 'event-definition';
|
|
5021
|
+
type: Type;
|
|
5022
|
+
isDomainEvent?: boolean;
|
|
5023
|
+
transformations?: (envelope: unknown) => Payload;
|
|
5024
|
+
__payload: Payload;
|
|
5025
|
+
};
|
|
5026
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
5027
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
5028
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
5029
|
+
|
|
5030
|
+
type ServicePluginMethodInput$1 = {
|
|
5031
|
+
request: any;
|
|
5032
|
+
metadata: any;
|
|
5033
|
+
};
|
|
5034
|
+
type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
|
|
5035
|
+
type ServicePluginMethodMetadata$1 = {
|
|
5036
|
+
name: string;
|
|
5037
|
+
primaryHttpMappingPath: string;
|
|
5038
|
+
transformations: {
|
|
5039
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
|
|
5040
|
+
toREST: (...args: unknown[]) => unknown;
|
|
5041
|
+
};
|
|
5042
|
+
};
|
|
5043
|
+
type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
|
|
5044
|
+
__type: 'service-plugin-definition';
|
|
5045
|
+
componentType: string;
|
|
5046
|
+
methods: ServicePluginMethodMetadata$1[];
|
|
5047
|
+
__contract: Contract;
|
|
5048
|
+
};
|
|
5049
|
+
declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
|
|
5050
|
+
type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
|
|
5051
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
|
|
5052
|
+
|
|
5053
|
+
type RequestContext$1 = {
|
|
5054
|
+
isSSR: boolean;
|
|
5055
|
+
host: string;
|
|
5056
|
+
protocol?: string;
|
|
5057
|
+
};
|
|
5058
|
+
type ResponseTransformer$1 = (data: any, headers?: any) => any;
|
|
5059
|
+
/**
|
|
5060
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
5061
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
5062
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
5063
|
+
*/
|
|
5064
|
+
type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
5065
|
+
type AmbassadorRequestOptions$1<T = any> = {
|
|
5066
|
+
_?: T;
|
|
5067
|
+
url?: string;
|
|
5068
|
+
method?: Method$1;
|
|
5069
|
+
params?: any;
|
|
5070
|
+
data?: any;
|
|
5071
|
+
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
5072
|
+
};
|
|
5073
|
+
type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
|
|
5074
|
+
__isAmbassador: boolean;
|
|
5075
|
+
};
|
|
5076
|
+
type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
|
|
5077
|
+
type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
5078
|
+
|
|
5079
|
+
declare global {
|
|
5080
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
5081
|
+
interface SymbolConstructor {
|
|
5082
|
+
readonly observable: symbol;
|
|
5083
|
+
}
|
|
5084
|
+
}
|
|
5085
|
+
|
|
5086
|
+
declare const emptyObjectSymbol$1: unique symbol;
|
|
5087
|
+
|
|
5088
|
+
/**
|
|
5089
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
5090
|
+
|
|
5091
|
+
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)).
|
|
5092
|
+
|
|
5093
|
+
@example
|
|
5094
|
+
```
|
|
5095
|
+
import type {EmptyObject} from 'type-fest';
|
|
5096
|
+
|
|
5097
|
+
// The following illustrates the problem with `{}`.
|
|
5098
|
+
const foo1: {} = {}; // Pass
|
|
5099
|
+
const foo2: {} = []; // Pass
|
|
5100
|
+
const foo3: {} = 42; // Pass
|
|
5101
|
+
const foo4: {} = {a: 1}; // Pass
|
|
5102
|
+
|
|
5103
|
+
// With `EmptyObject` only the first case is valid.
|
|
5104
|
+
const bar1: EmptyObject = {}; // Pass
|
|
5105
|
+
const bar2: EmptyObject = 42; // Fail
|
|
5106
|
+
const bar3: EmptyObject = []; // Fail
|
|
5107
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
5108
|
+
```
|
|
5109
|
+
|
|
5110
|
+
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}.
|
|
5111
|
+
|
|
5112
|
+
@category Object
|
|
5113
|
+
*/
|
|
5114
|
+
type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
|
|
5115
|
+
|
|
5116
|
+
/**
|
|
5117
|
+
Returns a boolean for whether the two given types are equal.
|
|
5118
|
+
|
|
5119
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
5120
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
5121
|
+
|
|
5122
|
+
Use-cases:
|
|
5123
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
5124
|
+
|
|
5125
|
+
@example
|
|
5126
|
+
```
|
|
5127
|
+
import type {IsEqual} from 'type-fest';
|
|
5128
|
+
|
|
5129
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
5130
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
5131
|
+
type Includes<Value extends readonly any[], Item> =
|
|
5132
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
5133
|
+
? IsEqual<Value[0], Item> extends true
|
|
5134
|
+
? true
|
|
5135
|
+
: Includes<rest, Item>
|
|
5136
|
+
: false;
|
|
5137
|
+
```
|
|
5138
|
+
|
|
5139
|
+
@category Type Guard
|
|
5140
|
+
@category Utilities
|
|
5141
|
+
*/
|
|
5142
|
+
type IsEqual$1<A, B> =
|
|
5143
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
5144
|
+
(<G>() => G extends B ? 1 : 2)
|
|
5145
|
+
? true
|
|
5146
|
+
: false;
|
|
5147
|
+
|
|
5148
|
+
/**
|
|
5149
|
+
Filter out keys from an object.
|
|
5150
|
+
|
|
5151
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
5152
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
5153
|
+
Returns `Key` otherwise.
|
|
5154
|
+
|
|
5155
|
+
@example
|
|
5156
|
+
```
|
|
5157
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
5158
|
+
//=> never
|
|
5159
|
+
```
|
|
5160
|
+
|
|
5161
|
+
@example
|
|
5162
|
+
```
|
|
5163
|
+
type Filtered = Filter<'bar', string>;
|
|
5164
|
+
//=> never
|
|
5165
|
+
```
|
|
5166
|
+
|
|
5167
|
+
@example
|
|
5168
|
+
```
|
|
5169
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
5170
|
+
//=> 'bar'
|
|
5171
|
+
```
|
|
5172
|
+
|
|
5173
|
+
@see {Except}
|
|
5174
|
+
*/
|
|
5175
|
+
type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
5176
|
+
|
|
5177
|
+
type ExceptOptions$1 = {
|
|
5178
|
+
/**
|
|
5179
|
+
Disallow assigning non-specified properties.
|
|
5180
|
+
|
|
5181
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
5182
|
+
|
|
5183
|
+
@default false
|
|
5184
|
+
*/
|
|
5185
|
+
requireExactProps?: boolean;
|
|
5186
|
+
};
|
|
5187
|
+
|
|
5188
|
+
/**
|
|
5189
|
+
Create a type from an object type without certain keys.
|
|
5190
|
+
|
|
5191
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
5192
|
+
|
|
5193
|
+
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.
|
|
5194
|
+
|
|
5195
|
+
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)).
|
|
5196
|
+
|
|
5197
|
+
@example
|
|
5198
|
+
```
|
|
5199
|
+
import type {Except} from 'type-fest';
|
|
5200
|
+
|
|
5201
|
+
type Foo = {
|
|
5202
|
+
a: number;
|
|
5203
|
+
b: string;
|
|
5204
|
+
};
|
|
5205
|
+
|
|
5206
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
5207
|
+
//=> {b: string}
|
|
5208
|
+
|
|
5209
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
5210
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
5211
|
+
|
|
5212
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
5213
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
5214
|
+
|
|
5215
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
5216
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
5217
|
+
```
|
|
5218
|
+
|
|
5219
|
+
@category Object
|
|
5220
|
+
*/
|
|
5221
|
+
type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
|
|
5222
|
+
[KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
|
|
5223
|
+
} & (Options['requireExactProps'] extends true
|
|
5224
|
+
? Partial<Record<KeysType, never>>
|
|
5225
|
+
: {});
|
|
5226
|
+
|
|
5227
|
+
/**
|
|
5228
|
+
Returns a boolean for whether the given type is `never`.
|
|
5229
|
+
|
|
5230
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
5231
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
5232
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
5233
|
+
|
|
5234
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
5235
|
+
|
|
5236
|
+
@example
|
|
5237
|
+
```
|
|
5238
|
+
import type {IsNever, And} from 'type-fest';
|
|
5239
|
+
|
|
5240
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
5241
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
5242
|
+
And<
|
|
5243
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
5244
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
5245
|
+
>;
|
|
5246
|
+
|
|
5247
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
5248
|
+
AreStringsEqual<I, O> extends true
|
|
5249
|
+
? never
|
|
5250
|
+
: void;
|
|
5251
|
+
|
|
5252
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
5253
|
+
if (input === output) {
|
|
5254
|
+
process.exit(0);
|
|
5255
|
+
}
|
|
3885
5256
|
}
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
5257
|
+
|
|
5258
|
+
endIfEqual('abc', 'abc');
|
|
5259
|
+
//=> never
|
|
5260
|
+
|
|
5261
|
+
endIfEqual('abc', '123');
|
|
5262
|
+
//=> void
|
|
5263
|
+
```
|
|
5264
|
+
|
|
5265
|
+
@category Type Guard
|
|
5266
|
+
@category Utilities
|
|
5267
|
+
*/
|
|
5268
|
+
type IsNever$1<T> = [T] extends [never] ? true : false;
|
|
5269
|
+
|
|
5270
|
+
/**
|
|
5271
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
5272
|
+
|
|
5273
|
+
@see {@link IsNever}
|
|
5274
|
+
|
|
5275
|
+
@example
|
|
5276
|
+
```
|
|
5277
|
+
import type {IfNever} from 'type-fest';
|
|
5278
|
+
|
|
5279
|
+
type ShouldBeTrue = IfNever<never>;
|
|
5280
|
+
//=> true
|
|
5281
|
+
|
|
5282
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
5283
|
+
//=> 'bar'
|
|
5284
|
+
```
|
|
5285
|
+
|
|
5286
|
+
@category Type Guard
|
|
5287
|
+
@category Utilities
|
|
5288
|
+
*/
|
|
5289
|
+
type IfNever$1<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
5290
|
+
IsNever$1<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
5291
|
+
);
|
|
5292
|
+
|
|
5293
|
+
/**
|
|
5294
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
5295
|
+
|
|
5296
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
5297
|
+
|
|
5298
|
+
@example
|
|
5299
|
+
```
|
|
5300
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
5301
|
+
|
|
5302
|
+
interface Example {
|
|
5303
|
+
a: string;
|
|
5304
|
+
b: string | number;
|
|
5305
|
+
c?: string;
|
|
5306
|
+
d: {};
|
|
3893
5307
|
}
|
|
3894
|
-
declare const onParticipationCreated$1: EventDefinition$5<ParticipationCreatedEnvelope, "wix.calendar.v3.participation_created">;
|
|
3895
|
-
declare const onParticipationUpdated$1: EventDefinition$5<ParticipationUpdatedEnvelope, "wix.calendar.v3.participation_updated">;
|
|
3896
|
-
declare const onParticipationDeleted$1: EventDefinition$5<ParticipationDeletedEnvelope, "wix.calendar.v3.participation_deleted">;
|
|
3897
5308
|
|
|
3898
|
-
type
|
|
3899
|
-
|
|
3900
|
-
|
|
3901
|
-
isDomainEvent?: boolean;
|
|
3902
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3903
|
-
__payload: Payload;
|
|
3904
|
-
};
|
|
3905
|
-
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
3906
|
-
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
3907
|
-
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
5309
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
5310
|
+
//=> 'a'
|
|
5311
|
+
```
|
|
3908
5312
|
|
|
3909
|
-
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3913
|
-
|
|
5313
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
5314
|
+
|
|
5315
|
+
@example
|
|
5316
|
+
```
|
|
5317
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
5318
|
+
|
|
5319
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
5320
|
+
//=> 'a' | 'c'
|
|
5321
|
+
```
|
|
5322
|
+
|
|
5323
|
+
@category Object
|
|
5324
|
+
*/
|
|
5325
|
+
type ConditionalKeys$1<Base, Condition> =
|
|
5326
|
+
{
|
|
5327
|
+
// Map through all the keys of the given base type.
|
|
5328
|
+
[Key in keyof Base]-?:
|
|
5329
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
5330
|
+
Base[Key] extends Condition
|
|
5331
|
+
// Retain this key
|
|
5332
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
5333
|
+
? IfNever$1<Base[Key], IfNever$1<Condition, Key, never>, Key>
|
|
5334
|
+
// Discard this key since the condition fails.
|
|
5335
|
+
: never;
|
|
5336
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
5337
|
+
}[keyof Base];
|
|
5338
|
+
|
|
5339
|
+
/**
|
|
5340
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
5341
|
+
|
|
5342
|
+
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.
|
|
5343
|
+
|
|
5344
|
+
@example
|
|
5345
|
+
```
|
|
5346
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
5347
|
+
|
|
5348
|
+
class Awesome {
|
|
5349
|
+
name: string;
|
|
5350
|
+
successes: number;
|
|
5351
|
+
failures: bigint;
|
|
5352
|
+
|
|
5353
|
+
run() {}
|
|
3914
5354
|
}
|
|
3915
5355
|
|
|
3916
|
-
|
|
5356
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
5357
|
+
//=> {run: () => void}
|
|
5358
|
+
```
|
|
3917
5359
|
|
|
3918
|
-
|
|
3919
|
-
|
|
3920
|
-
|
|
3921
|
-
declare const updateParticipation: MaybeContext<BuildRESTFunction<typeof updateParticipation$1> & typeof updateParticipation$1>;
|
|
3922
|
-
declare const deleteParticipation: MaybeContext<BuildRESTFunction<typeof deleteParticipation$1> & typeof deleteParticipation$1>;
|
|
5360
|
+
@example
|
|
5361
|
+
```
|
|
5362
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
3923
5363
|
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
5364
|
+
interface Example {
|
|
5365
|
+
a: string;
|
|
5366
|
+
b: string | number;
|
|
5367
|
+
c: () => void;
|
|
5368
|
+
d: {};
|
|
5369
|
+
}
|
|
3927
5370
|
|
|
3928
|
-
type
|
|
3929
|
-
|
|
3930
|
-
|
|
5371
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
5372
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
5373
|
+
```
|
|
3931
5374
|
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
5375
|
+
@category Object
|
|
5376
|
+
*/
|
|
5377
|
+
type ConditionalExcept$1<Base, Condition> = Except$1<
|
|
5378
|
+
Base,
|
|
5379
|
+
ConditionalKeys$1<Base, Condition>
|
|
5380
|
+
>;
|
|
3935
5381
|
|
|
3936
|
-
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
type
|
|
3940
|
-
|
|
3941
|
-
type
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
type
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
type
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
type
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
declare
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
declare const context$2_onParticipationUpdated: typeof onParticipationUpdated;
|
|
3974
|
-
declare const context$2_queryParticipations: typeof queryParticipations;
|
|
3975
|
-
declare const context$2_updateParticipation: typeof updateParticipation;
|
|
3976
|
-
declare namespace context$2 {
|
|
3977
|
-
export { type ActionEvent$2 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type context$2_CreateParticipationOptions as CreateParticipationOptions, type context$2_CreateParticipationRequest as CreateParticipationRequest, type context$2_CreateParticipationResponse as CreateParticipationResponse, type context$2_CreateParticipationResponseNonNullableFields as CreateParticipationResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type CursorQuery$1 as CursorQuery, type CursorQueryPagingMethodOneOf$1 as CursorQueryPagingMethodOneOf, type Cursors$1 as Cursors, type context$2_DeleteParticipationRequest as DeleteParticipationRequest, type context$2_DeleteParticipationResponse as DeleteParticipationResponse, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$2 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type ExtendedFields$1 as ExtendedFields, type context$2_GetParticipationRequest as GetParticipationRequest, type context$2_GetParticipationResponse as GetParticipationResponse, type context$2_GetParticipationResponseNonNullableFields as GetParticipationResponseNonNullableFields, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type MessageEnvelope$2 as MessageEnvelope, type context$2_Participant as Participant, type context$2_Participation as Participation, type context$2_ParticipationCreatedEnvelope as ParticipationCreatedEnvelope, type context$2_ParticipationDeletedEnvelope as ParticipationDeletedEnvelope, type context$2_ParticipationNonNullableFields as ParticipationNonNullableFields, type context$2_ParticipationParticipatedItemOneOf as ParticipationParticipatedItemOneOf, type context$2_ParticipationUpdatedEnvelope as ParticipationUpdatedEnvelope, type context$2_ParticipationUpdatedWithMetadata as ParticipationUpdatedWithMetadata, type context$2_ParticipationsQueryBuilder as ParticipationsQueryBuilder, type context$2_ParticipationsQueryResult as ParticipationsQueryResult, type context$2_PartySizeSumByScheduleId as PartySizeSumByScheduleId, type context$2_QueryParticipationsRequest as QueryParticipationsRequest, type context$2_QueryParticipationsResponse as QueryParticipationsResponse, type context$2_QueryParticipationsResponseNonNullableFields as QueryParticipationsResponseNonNullableFields, type RestoreInfo$2 as RestoreInfo, Status$2 as Status, type context$2_SumParticipationsPartySizeByScheduleIdRequest as SumParticipationsPartySizeByScheduleIdRequest, type context$2_SumParticipationsPartySizeByScheduleIdResponse as SumParticipationsPartySizeByScheduleIdResponse, type context$2_UpdateParticipation as UpdateParticipation, type context$2_UpdateParticipationRequest as UpdateParticipationRequest, type context$2_UpdateParticipationResponse as UpdateParticipationResponse, type context$2_UpdateParticipationResponseNonNullableFields as UpdateParticipationResponseNonNullableFields, WebhookIdentityType$2 as WebhookIdentityType, type context$2__publicOnParticipationCreatedType as _publicOnParticipationCreatedType, type context$2__publicOnParticipationDeletedType as _publicOnParticipationDeletedType, type context$2__publicOnParticipationUpdatedType as _publicOnParticipationUpdatedType, context$2_createParticipation as createParticipation, context$2_deleteParticipation as deleteParticipation, context$2_getParticipation as getParticipation, context$2_onParticipationCreated as onParticipationCreated, context$2_onParticipationDeleted as onParticipationDeleted, context$2_onParticipationUpdated as onParticipationUpdated, onParticipationCreated$1 as publicOnParticipationCreated, onParticipationDeleted$1 as publicOnParticipationDeleted, onParticipationUpdated$1 as publicOnParticipationUpdated, context$2_queryParticipations as queryParticipations, context$2_updateParticipation as updateParticipation };
|
|
5382
|
+
/**
|
|
5383
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
5384
|
+
* can either be a REST module or a host module.
|
|
5385
|
+
* This type is recursive, so it can describe nested modules.
|
|
5386
|
+
*/
|
|
5387
|
+
type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$1<any> | ServicePluginDefinition$1<any> | {
|
|
5388
|
+
[key: string]: Descriptors$1 | PublicMetadata$1 | any;
|
|
5389
|
+
};
|
|
5390
|
+
/**
|
|
5391
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
5392
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
5393
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
5394
|
+
* do not match the given host (as they will not work with the given host).
|
|
5395
|
+
*/
|
|
5396
|
+
type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
|
|
5397
|
+
done: T;
|
|
5398
|
+
recurse: T extends {
|
|
5399
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
|
|
5400
|
+
} ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
|
|
5401
|
+
[Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
|
|
5402
|
+
-1,
|
|
5403
|
+
0,
|
|
5404
|
+
1,
|
|
5405
|
+
2,
|
|
5406
|
+
3,
|
|
5407
|
+
4,
|
|
5408
|
+
5
|
|
5409
|
+
][Depth]> : never;
|
|
5410
|
+
}, EmptyObject$1>;
|
|
5411
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
5412
|
+
type PublicMetadata$1 = {
|
|
5413
|
+
PACKAGE_NAME?: string;
|
|
5414
|
+
};
|
|
5415
|
+
|
|
5416
|
+
declare global {
|
|
5417
|
+
interface ContextualClient {
|
|
5418
|
+
}
|
|
3978
5419
|
}
|
|
5420
|
+
/**
|
|
5421
|
+
* A type used to create concerete types from SDK descriptors in
|
|
5422
|
+
* case a contextual client is available.
|
|
5423
|
+
*/
|
|
5424
|
+
type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
|
|
5425
|
+
host: Host$1;
|
|
5426
|
+
} ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
|
|
3979
5427
|
|
|
3980
5428
|
interface Schedule {
|
|
3981
5429
|
/**
|
|
@@ -5201,234 +6649,694 @@ interface UpdateSchedule {
|
|
|
5201
6649
|
/** Extensions enabling applications or users to save custom data related to the schedule. */
|
|
5202
6650
|
extendedFields?: ExtendedFields;
|
|
5203
6651
|
/**
|
|
5204
|
-
* The schedule revision number, which incremented on updates.
|
|
5205
|
-
*
|
|
5206
|
-
* The current revision should be provided on updates to prevent conflicting changes.
|
|
5207
|
-
* @readonly
|
|
6652
|
+
* The schedule revision number, which incremented on updates.
|
|
6653
|
+
*
|
|
6654
|
+
* The current revision should be provided on updates to prevent conflicting changes.
|
|
6655
|
+
* @readonly
|
|
6656
|
+
*/
|
|
6657
|
+
revision?: string | null;
|
|
6658
|
+
/**
|
|
6659
|
+
* Date the schedule was created.
|
|
6660
|
+
* @readonly
|
|
6661
|
+
*/
|
|
6662
|
+
_createdDate?: Date;
|
|
6663
|
+
/**
|
|
6664
|
+
* Date the schedule was last updated.
|
|
6665
|
+
* @readonly
|
|
6666
|
+
*/
|
|
6667
|
+
_updatedDate?: Date;
|
|
6668
|
+
}
|
|
6669
|
+
interface UpdateScheduleOptions {
|
|
6670
|
+
/** Whether to notify participants regarding the changes. */
|
|
6671
|
+
participantNotification?: ParticipantNotification;
|
|
6672
|
+
}
|
|
6673
|
+
interface CancelScheduleOptions {
|
|
6674
|
+
/**
|
|
6675
|
+
* Whether to preserve future events with participants.
|
|
6676
|
+
* Default is false.
|
|
6677
|
+
*/
|
|
6678
|
+
preserveFutureEventsWithParticipants?: boolean | null;
|
|
6679
|
+
/** Whether to notify participants regarding the changes. */
|
|
6680
|
+
participantNotification?: ParticipantNotification;
|
|
6681
|
+
}
|
|
6682
|
+
|
|
6683
|
+
declare function getSchedule$1(httpClient: HttpClient$1): GetScheduleSignature;
|
|
6684
|
+
interface GetScheduleSignature {
|
|
6685
|
+
/**
|
|
6686
|
+
* Retrieves a schedule by ID.
|
|
6687
|
+
* @param - The ID of the schedule to retrieve.
|
|
6688
|
+
* @returns The schedule.
|
|
6689
|
+
*/
|
|
6690
|
+
(scheduleId: string | null, options?: GetScheduleOptions | undefined): Promise<Schedule & ScheduleNonNullableFields>;
|
|
6691
|
+
}
|
|
6692
|
+
declare function querySchedules$1(httpClient: HttpClient$1): QuerySchedulesSignature;
|
|
6693
|
+
interface QuerySchedulesSignature {
|
|
6694
|
+
/**
|
|
6695
|
+
* Query for schedules given the provided filters and paging.
|
|
6696
|
+
*
|
|
6697
|
+
* By default only active schedules are returned, unless a `status` filter is provided.
|
|
6698
|
+
*/
|
|
6699
|
+
(options?: QuerySchedulesOptions | undefined): SchedulesQueryBuilder;
|
|
6700
|
+
}
|
|
6701
|
+
declare function createSchedule$1(httpClient: HttpClient$1): CreateScheduleSignature;
|
|
6702
|
+
interface CreateScheduleSignature {
|
|
6703
|
+
/**
|
|
6704
|
+
* Creates a schedule.
|
|
6705
|
+
* @param - The schedule to create.
|
|
6706
|
+
* @returns The created schedule.
|
|
5208
6707
|
*/
|
|
5209
|
-
|
|
6708
|
+
(schedule: Schedule, options?: CreateScheduleOptions | undefined): Promise<Schedule & ScheduleNonNullableFields>;
|
|
6709
|
+
}
|
|
6710
|
+
declare function updateSchedule$1(httpClient: HttpClient$1): UpdateScheduleSignature;
|
|
6711
|
+
interface UpdateScheduleSignature {
|
|
5210
6712
|
/**
|
|
5211
|
-
*
|
|
5212
|
-
* @
|
|
6713
|
+
* Updates a schedule.
|
|
6714
|
+
* @param - The schedule ID.
|
|
6715
|
+
* @returns The updated schedule.
|
|
5213
6716
|
*/
|
|
5214
|
-
|
|
6717
|
+
(_id: string | null, schedule: UpdateSchedule, options?: UpdateScheduleOptions | undefined): Promise<Schedule & ScheduleNonNullableFields>;
|
|
6718
|
+
}
|
|
6719
|
+
declare function cancelSchedule$1(httpClient: HttpClient$1): CancelScheduleSignature;
|
|
6720
|
+
interface CancelScheduleSignature {
|
|
5215
6721
|
/**
|
|
5216
|
-
*
|
|
5217
|
-
* @
|
|
6722
|
+
* Cancels a schedule.
|
|
6723
|
+
* @param - The ID of the schedule to cancel.
|
|
5218
6724
|
*/
|
|
5219
|
-
|
|
6725
|
+
(scheduleId: string | null, options?: CancelScheduleOptions | undefined): Promise<CancelScheduleResponse & CancelScheduleResponseNonNullableFields>;
|
|
5220
6726
|
}
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
6727
|
+
declare const onScheduleCreated$1: EventDefinition$1<ScheduleCreatedEnvelope, "wix.calendar.v3.schedule_created">;
|
|
6728
|
+
declare const onScheduleUpdated$1: EventDefinition$1<ScheduleUpdatedEnvelope, "wix.calendar.v3.schedule_updated">;
|
|
6729
|
+
declare const onScheduleCloned$1: EventDefinition$1<ScheduleClonedEnvelope, "wix.calendar.v3.schedule_cloned">;
|
|
6730
|
+
declare const onScheduleCancelled$1: EventDefinition$1<ScheduleCancelledEnvelope, "wix.calendar.v3.schedule_cancelled">;
|
|
6731
|
+
|
|
6732
|
+
declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
6733
|
+
|
|
6734
|
+
declare const getSchedule: MaybeContext$1<BuildRESTFunction$1<typeof getSchedule$1> & typeof getSchedule$1>;
|
|
6735
|
+
declare const querySchedules: MaybeContext$1<BuildRESTFunction$1<typeof querySchedules$1> & typeof querySchedules$1>;
|
|
6736
|
+
declare const createSchedule: MaybeContext$1<BuildRESTFunction$1<typeof createSchedule$1> & typeof createSchedule$1>;
|
|
6737
|
+
declare const updateSchedule: MaybeContext$1<BuildRESTFunction$1<typeof updateSchedule$1> & typeof updateSchedule$1>;
|
|
6738
|
+
declare const cancelSchedule: MaybeContext$1<BuildRESTFunction$1<typeof cancelSchedule$1> & typeof cancelSchedule$1>;
|
|
6739
|
+
|
|
6740
|
+
type _publicOnScheduleCreatedType = typeof onScheduleCreated$1;
|
|
6741
|
+
/**
|
|
6742
|
+
* Restore once implemented.
|
|
6743
|
+
* option (google.api.http) = {
|
|
6744
|
+
* post: "/v3/schedules/{schedule_id}/clone";
|
|
6745
|
+
* };
|
|
6746
|
+
*/
|
|
6747
|
+
declare const onScheduleCreated: ReturnType<typeof createEventModule$1<_publicOnScheduleCreatedType>>;
|
|
6748
|
+
|
|
6749
|
+
type _publicOnScheduleUpdatedType = typeof onScheduleUpdated$1;
|
|
6750
|
+
/** */
|
|
6751
|
+
declare const onScheduleUpdated: ReturnType<typeof createEventModule$1<_publicOnScheduleUpdatedType>>;
|
|
6752
|
+
|
|
6753
|
+
type _publicOnScheduleClonedType = typeof onScheduleCloned$1;
|
|
6754
|
+
/** */
|
|
6755
|
+
declare const onScheduleCloned: ReturnType<typeof createEventModule$1<_publicOnScheduleClonedType>>;
|
|
6756
|
+
|
|
6757
|
+
type _publicOnScheduleCancelledType = typeof onScheduleCancelled$1;
|
|
6758
|
+
/** */
|
|
6759
|
+
declare const onScheduleCancelled: ReturnType<typeof createEventModule$1<_publicOnScheduleCancelledType>>;
|
|
6760
|
+
|
|
6761
|
+
type context$1_Asset = Asset;
|
|
6762
|
+
type context$1_CancelScheduleOptions = CancelScheduleOptions;
|
|
6763
|
+
type context$1_CancelScheduleRequest = CancelScheduleRequest;
|
|
6764
|
+
type context$1_CancelScheduleResponse = CancelScheduleResponse;
|
|
6765
|
+
type context$1_CancelScheduleResponseNonNullableFields = CancelScheduleResponseNonNullableFields;
|
|
6766
|
+
type context$1_CloneScheduleRequest = CloneScheduleRequest;
|
|
6767
|
+
type context$1_CloneScheduleResponse = CloneScheduleResponse;
|
|
6768
|
+
type context$1_CommonIdentificationData = CommonIdentificationData;
|
|
6769
|
+
type context$1_CommonIdentificationDataIdOneOf = CommonIdentificationDataIdOneOf;
|
|
6770
|
+
type context$1_ConferencingDetails = ConferencingDetails;
|
|
6771
|
+
type context$1_CreateScheduleOptions = CreateScheduleOptions;
|
|
6772
|
+
type context$1_CreateScheduleRequest = CreateScheduleRequest;
|
|
6773
|
+
type context$1_CreateScheduleResponse = CreateScheduleResponse;
|
|
6774
|
+
type context$1_CreateScheduleResponseNonNullableFields = CreateScheduleResponseNonNullableFields;
|
|
6775
|
+
type context$1_CursorPaging = CursorPaging;
|
|
6776
|
+
type context$1_CursorPagingMetadata = CursorPagingMetadata;
|
|
6777
|
+
type context$1_CursorQuery = CursorQuery;
|
|
6778
|
+
type context$1_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf;
|
|
6779
|
+
type context$1_Cursors = Cursors;
|
|
6780
|
+
type context$1_DeleteContext = DeleteContext;
|
|
6781
|
+
type context$1_DeleteStatus = DeleteStatus;
|
|
6782
|
+
declare const context$1_DeleteStatus: typeof DeleteStatus;
|
|
6783
|
+
type context$1_ExtendedFields = ExtendedFields;
|
|
6784
|
+
type context$1_GetScheduleOptions = GetScheduleOptions;
|
|
6785
|
+
type context$1_GetScheduleRequest = GetScheduleRequest;
|
|
6786
|
+
type context$1_GetScheduleResponse = GetScheduleResponse;
|
|
6787
|
+
type context$1_GetScheduleResponseNonNullableFields = GetScheduleResponseNonNullableFields;
|
|
6788
|
+
type context$1_IdentityType = IdentityType;
|
|
6789
|
+
declare const context$1_IdentityType: typeof IdentityType;
|
|
6790
|
+
type context$1_Location = Location;
|
|
6791
|
+
type context$1_LocationType = LocationType;
|
|
6792
|
+
declare const context$1_LocationType: typeof LocationType;
|
|
6793
|
+
type context$1_MetaSiteSpecialEvent = MetaSiteSpecialEvent;
|
|
6794
|
+
type context$1_MetaSiteSpecialEventPayloadOneOf = MetaSiteSpecialEventPayloadOneOf;
|
|
6795
|
+
type context$1_Namespace = Namespace;
|
|
6796
|
+
declare const context$1_Namespace: typeof Namespace;
|
|
6797
|
+
type context$1_NamespaceChanged = NamespaceChanged;
|
|
6798
|
+
type context$1_ParticipantNotification = ParticipantNotification;
|
|
6799
|
+
type context$1_Permission = Permission;
|
|
6800
|
+
type context$1_QuerySchedulesOptions = QuerySchedulesOptions;
|
|
6801
|
+
type context$1_QuerySchedulesRequest = QuerySchedulesRequest;
|
|
6802
|
+
type context$1_QuerySchedulesResponse = QuerySchedulesResponse;
|
|
6803
|
+
type context$1_QuerySchedulesResponseNonNullableFields = QuerySchedulesResponseNonNullableFields;
|
|
6804
|
+
type context$1_RequestedFields = RequestedFields;
|
|
6805
|
+
declare const context$1_RequestedFields: typeof RequestedFields;
|
|
6806
|
+
type context$1_Role = Role;
|
|
6807
|
+
declare const context$1_Role: typeof Role;
|
|
6808
|
+
type context$1_Schedule = Schedule;
|
|
6809
|
+
type context$1_ScheduleCancelled = ScheduleCancelled;
|
|
6810
|
+
type context$1_ScheduleCancelledEnvelope = ScheduleCancelledEnvelope;
|
|
6811
|
+
type context$1_ScheduleCloned = ScheduleCloned;
|
|
6812
|
+
type context$1_ScheduleClonedEnvelope = ScheduleClonedEnvelope;
|
|
6813
|
+
type context$1_ScheduleCreatedEnvelope = ScheduleCreatedEnvelope;
|
|
6814
|
+
type context$1_ScheduleNonNullableFields = ScheduleNonNullableFields;
|
|
6815
|
+
type context$1_ScheduleUpdatedEnvelope = ScheduleUpdatedEnvelope;
|
|
6816
|
+
type context$1_ScheduleUpdatedWithMetadata = ScheduleUpdatedWithMetadata;
|
|
6817
|
+
type context$1_SchedulesQueryBuilder = SchedulesQueryBuilder;
|
|
6818
|
+
type context$1_SchedulesQueryResult = SchedulesQueryResult;
|
|
6819
|
+
type context$1_ServiceProvisioned = ServiceProvisioned;
|
|
6820
|
+
type context$1_ServiceRemoved = ServiceRemoved;
|
|
6821
|
+
type context$1_SiteCreatedContext = SiteCreatedContext;
|
|
6822
|
+
declare const context$1_SiteCreatedContext: typeof SiteCreatedContext;
|
|
6823
|
+
type context$1_SiteDeleted = SiteDeleted;
|
|
6824
|
+
type context$1_SiteHardDeleted = SiteHardDeleted;
|
|
6825
|
+
type context$1_SiteMarkedAsTemplate = SiteMarkedAsTemplate;
|
|
6826
|
+
type context$1_SiteMarkedAsWixSite = SiteMarkedAsWixSite;
|
|
6827
|
+
type context$1_SitePublished = SitePublished;
|
|
6828
|
+
type context$1_SiteRenamed = SiteRenamed;
|
|
6829
|
+
type context$1_SiteTransferred = SiteTransferred;
|
|
6830
|
+
type context$1_SiteUndeleted = SiteUndeleted;
|
|
6831
|
+
type context$1_SiteUnpublished = SiteUnpublished;
|
|
6832
|
+
type context$1_State = State;
|
|
6833
|
+
declare const context$1_State: typeof State;
|
|
6834
|
+
type context$1_StudioAssigned = StudioAssigned;
|
|
6835
|
+
type context$1_StudioUnassigned = StudioUnassigned;
|
|
6836
|
+
type context$1_Trigger = Trigger;
|
|
6837
|
+
declare const context$1_Trigger: typeof Trigger;
|
|
6838
|
+
type context$1_Type = Type;
|
|
6839
|
+
declare const context$1_Type: typeof Type;
|
|
6840
|
+
type context$1_UpdateSchedule = UpdateSchedule;
|
|
6841
|
+
type context$1_UpdateScheduleOptions = UpdateScheduleOptions;
|
|
6842
|
+
type context$1_UpdateScheduleRequest = UpdateScheduleRequest;
|
|
6843
|
+
type context$1_UpdateScheduleResponse = UpdateScheduleResponse;
|
|
6844
|
+
type context$1_UpdateScheduleResponseNonNullableFields = UpdateScheduleResponseNonNullableFields;
|
|
6845
|
+
type context$1_V4SiteCreated = V4SiteCreated;
|
|
6846
|
+
type context$1__publicOnScheduleCancelledType = _publicOnScheduleCancelledType;
|
|
6847
|
+
type context$1__publicOnScheduleClonedType = _publicOnScheduleClonedType;
|
|
6848
|
+
type context$1__publicOnScheduleCreatedType = _publicOnScheduleCreatedType;
|
|
6849
|
+
type context$1__publicOnScheduleUpdatedType = _publicOnScheduleUpdatedType;
|
|
6850
|
+
declare const context$1_cancelSchedule: typeof cancelSchedule;
|
|
6851
|
+
declare const context$1_createSchedule: typeof createSchedule;
|
|
6852
|
+
declare const context$1_getSchedule: typeof getSchedule;
|
|
6853
|
+
declare const context$1_onScheduleCancelled: typeof onScheduleCancelled;
|
|
6854
|
+
declare const context$1_onScheduleCloned: typeof onScheduleCloned;
|
|
6855
|
+
declare const context$1_onScheduleCreated: typeof onScheduleCreated;
|
|
6856
|
+
declare const context$1_onScheduleUpdated: typeof onScheduleUpdated;
|
|
6857
|
+
declare const context$1_querySchedules: typeof querySchedules;
|
|
6858
|
+
declare const context$1_updateSchedule: typeof updateSchedule;
|
|
6859
|
+
declare namespace context$1 {
|
|
6860
|
+
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 };
|
|
5224
6861
|
}
|
|
5225
|
-
|
|
6862
|
+
|
|
6863
|
+
type HostModule<T, H extends Host> = {
|
|
6864
|
+
__type: 'host';
|
|
6865
|
+
create(host: H): T;
|
|
6866
|
+
};
|
|
6867
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6868
|
+
type Host<Environment = unknown> = {
|
|
6869
|
+
channel: {
|
|
6870
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
6871
|
+
disconnect: () => void;
|
|
6872
|
+
} | Promise<{
|
|
6873
|
+
disconnect: () => void;
|
|
6874
|
+
}>;
|
|
6875
|
+
};
|
|
6876
|
+
environment?: Environment;
|
|
5226
6877
|
/**
|
|
5227
|
-
*
|
|
5228
|
-
* Default is false.
|
|
6878
|
+
* Optional name of the environment, use for logging
|
|
5229
6879
|
*/
|
|
5230
|
-
|
|
5231
|
-
/**
|
|
5232
|
-
|
|
6880
|
+
name?: string;
|
|
6881
|
+
/**
|
|
6882
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
6883
|
+
*/
|
|
6884
|
+
apiBaseUrl?: string;
|
|
6885
|
+
/**
|
|
6886
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
6887
|
+
* like internationalization, billing, etc.
|
|
6888
|
+
*/
|
|
6889
|
+
essentials?: {
|
|
6890
|
+
/**
|
|
6891
|
+
* The language of the currently viewed session
|
|
6892
|
+
*/
|
|
6893
|
+
language?: string;
|
|
6894
|
+
/**
|
|
6895
|
+
* The locale of the currently viewed session
|
|
6896
|
+
*/
|
|
6897
|
+
locale?: string;
|
|
6898
|
+
/**
|
|
6899
|
+
* Any headers that should be passed through to the API requests
|
|
6900
|
+
*/
|
|
6901
|
+
passThroughHeaders?: Record<string, string>;
|
|
6902
|
+
};
|
|
6903
|
+
};
|
|
6904
|
+
|
|
6905
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
6906
|
+
interface HttpClient {
|
|
6907
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
6908
|
+
fetchWithAuth: typeof fetch;
|
|
6909
|
+
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
6910
|
+
getActiveToken?: () => string | undefined;
|
|
5233
6911
|
}
|
|
6912
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
6913
|
+
type HttpResponse<T = any> = {
|
|
6914
|
+
data: T;
|
|
6915
|
+
status: number;
|
|
6916
|
+
statusText: string;
|
|
6917
|
+
headers: any;
|
|
6918
|
+
request?: any;
|
|
6919
|
+
};
|
|
6920
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
6921
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
6922
|
+
url: string;
|
|
6923
|
+
data?: Data;
|
|
6924
|
+
params?: URLSearchParams;
|
|
6925
|
+
} & APIMetadata;
|
|
6926
|
+
type APIMetadata = {
|
|
6927
|
+
methodFqn?: string;
|
|
6928
|
+
entityFqdn?: string;
|
|
6929
|
+
packageName?: string;
|
|
6930
|
+
};
|
|
6931
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
6932
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
6933
|
+
__type: 'event-definition';
|
|
6934
|
+
type: Type;
|
|
6935
|
+
isDomainEvent?: boolean;
|
|
6936
|
+
transformations?: (envelope: unknown) => Payload;
|
|
6937
|
+
__payload: Payload;
|
|
6938
|
+
};
|
|
6939
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
6940
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
6941
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
6942
|
+
|
|
6943
|
+
type ServicePluginMethodInput = {
|
|
6944
|
+
request: any;
|
|
6945
|
+
metadata: any;
|
|
6946
|
+
};
|
|
6947
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
6948
|
+
type ServicePluginMethodMetadata = {
|
|
6949
|
+
name: string;
|
|
6950
|
+
primaryHttpMappingPath: string;
|
|
6951
|
+
transformations: {
|
|
6952
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
6953
|
+
toREST: (...args: unknown[]) => unknown;
|
|
6954
|
+
};
|
|
6955
|
+
};
|
|
6956
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
6957
|
+
__type: 'service-plugin-definition';
|
|
6958
|
+
componentType: string;
|
|
6959
|
+
methods: ServicePluginMethodMetadata[];
|
|
6960
|
+
__contract: Contract;
|
|
6961
|
+
};
|
|
6962
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
6963
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
6964
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
5234
6965
|
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
6966
|
+
type RequestContext = {
|
|
6967
|
+
isSSR: boolean;
|
|
6968
|
+
host: string;
|
|
6969
|
+
protocol?: string;
|
|
6970
|
+
};
|
|
6971
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
6972
|
+
/**
|
|
6973
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
6974
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
6975
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
6976
|
+
*/
|
|
6977
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
6978
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
6979
|
+
_?: T;
|
|
6980
|
+
url?: string;
|
|
6981
|
+
method?: Method;
|
|
6982
|
+
params?: any;
|
|
6983
|
+
data?: any;
|
|
6984
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
6985
|
+
};
|
|
6986
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
6987
|
+
__isAmbassador: boolean;
|
|
6988
|
+
};
|
|
6989
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
6990
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
6991
|
+
|
|
6992
|
+
declare global {
|
|
6993
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6994
|
+
interface SymbolConstructor {
|
|
6995
|
+
readonly observable: symbol;
|
|
6996
|
+
}
|
|
5261
6997
|
}
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5267
|
-
|
|
5268
|
-
|
|
5269
|
-
|
|
6998
|
+
|
|
6999
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
7000
|
+
|
|
7001
|
+
/**
|
|
7002
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
7003
|
+
|
|
7004
|
+
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)).
|
|
7005
|
+
|
|
7006
|
+
@example
|
|
7007
|
+
```
|
|
7008
|
+
import type {EmptyObject} from 'type-fest';
|
|
7009
|
+
|
|
7010
|
+
// The following illustrates the problem with `{}`.
|
|
7011
|
+
const foo1: {} = {}; // Pass
|
|
7012
|
+
const foo2: {} = []; // Pass
|
|
7013
|
+
const foo3: {} = 42; // Pass
|
|
7014
|
+
const foo4: {} = {a: 1}; // Pass
|
|
7015
|
+
|
|
7016
|
+
// With `EmptyObject` only the first case is valid.
|
|
7017
|
+
const bar1: EmptyObject = {}; // Pass
|
|
7018
|
+
const bar2: EmptyObject = 42; // Fail
|
|
7019
|
+
const bar3: EmptyObject = []; // Fail
|
|
7020
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
7021
|
+
```
|
|
7022
|
+
|
|
7023
|
+
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}.
|
|
7024
|
+
|
|
7025
|
+
@category Object
|
|
7026
|
+
*/
|
|
7027
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
7028
|
+
|
|
7029
|
+
/**
|
|
7030
|
+
Returns a boolean for whether the two given types are equal.
|
|
7031
|
+
|
|
7032
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
7033
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
7034
|
+
|
|
7035
|
+
Use-cases:
|
|
7036
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
7037
|
+
|
|
7038
|
+
@example
|
|
7039
|
+
```
|
|
7040
|
+
import type {IsEqual} from 'type-fest';
|
|
7041
|
+
|
|
7042
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
7043
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
7044
|
+
type Includes<Value extends readonly any[], Item> =
|
|
7045
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
7046
|
+
? IsEqual<Value[0], Item> extends true
|
|
7047
|
+
? true
|
|
7048
|
+
: Includes<rest, Item>
|
|
7049
|
+
: false;
|
|
7050
|
+
```
|
|
7051
|
+
|
|
7052
|
+
@category Type Guard
|
|
7053
|
+
@category Utilities
|
|
7054
|
+
*/
|
|
7055
|
+
type IsEqual<A, B> =
|
|
7056
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
7057
|
+
(<G>() => G extends B ? 1 : 2)
|
|
7058
|
+
? true
|
|
7059
|
+
: false;
|
|
7060
|
+
|
|
7061
|
+
/**
|
|
7062
|
+
Filter out keys from an object.
|
|
7063
|
+
|
|
7064
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
7065
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
7066
|
+
Returns `Key` otherwise.
|
|
7067
|
+
|
|
7068
|
+
@example
|
|
7069
|
+
```
|
|
7070
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
7071
|
+
//=> never
|
|
7072
|
+
```
|
|
7073
|
+
|
|
7074
|
+
@example
|
|
7075
|
+
```
|
|
7076
|
+
type Filtered = Filter<'bar', string>;
|
|
7077
|
+
//=> never
|
|
7078
|
+
```
|
|
7079
|
+
|
|
7080
|
+
@example
|
|
7081
|
+
```
|
|
7082
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
7083
|
+
//=> 'bar'
|
|
7084
|
+
```
|
|
7085
|
+
|
|
7086
|
+
@see {Except}
|
|
7087
|
+
*/
|
|
7088
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
7089
|
+
|
|
7090
|
+
type ExceptOptions = {
|
|
7091
|
+
/**
|
|
7092
|
+
Disallow assigning non-specified properties.
|
|
7093
|
+
|
|
7094
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
7095
|
+
|
|
7096
|
+
@default false
|
|
7097
|
+
*/
|
|
7098
|
+
requireExactProps?: boolean;
|
|
7099
|
+
};
|
|
7100
|
+
|
|
7101
|
+
/**
|
|
7102
|
+
Create a type from an object type without certain keys.
|
|
7103
|
+
|
|
7104
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
7105
|
+
|
|
7106
|
+
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.
|
|
7107
|
+
|
|
7108
|
+
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)).
|
|
7109
|
+
|
|
7110
|
+
@example
|
|
7111
|
+
```
|
|
7112
|
+
import type {Except} from 'type-fest';
|
|
7113
|
+
|
|
7114
|
+
type Foo = {
|
|
7115
|
+
a: number;
|
|
7116
|
+
b: string;
|
|
7117
|
+
};
|
|
7118
|
+
|
|
7119
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
7120
|
+
//=> {b: string}
|
|
7121
|
+
|
|
7122
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
7123
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
7124
|
+
|
|
7125
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
7126
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
7127
|
+
|
|
7128
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
7129
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
7130
|
+
```
|
|
7131
|
+
|
|
7132
|
+
@category Object
|
|
7133
|
+
*/
|
|
7134
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
7135
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
7136
|
+
} & (Options['requireExactProps'] extends true
|
|
7137
|
+
? Partial<Record<KeysType, never>>
|
|
7138
|
+
: {});
|
|
7139
|
+
|
|
7140
|
+
/**
|
|
7141
|
+
Returns a boolean for whether the given type is `never`.
|
|
7142
|
+
|
|
7143
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
7144
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
7145
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
7146
|
+
|
|
7147
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
7148
|
+
|
|
7149
|
+
@example
|
|
7150
|
+
```
|
|
7151
|
+
import type {IsNever, And} from 'type-fest';
|
|
7152
|
+
|
|
7153
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
7154
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
7155
|
+
And<
|
|
7156
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
7157
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
7158
|
+
>;
|
|
7159
|
+
|
|
7160
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
7161
|
+
AreStringsEqual<I, O> extends true
|
|
7162
|
+
? never
|
|
7163
|
+
: void;
|
|
7164
|
+
|
|
7165
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
7166
|
+
if (input === output) {
|
|
7167
|
+
process.exit(0);
|
|
7168
|
+
}
|
|
5270
7169
|
}
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
7170
|
+
|
|
7171
|
+
endIfEqual('abc', 'abc');
|
|
7172
|
+
//=> never
|
|
7173
|
+
|
|
7174
|
+
endIfEqual('abc', '123');
|
|
7175
|
+
//=> void
|
|
7176
|
+
```
|
|
7177
|
+
|
|
7178
|
+
@category Type Guard
|
|
7179
|
+
@category Utilities
|
|
7180
|
+
*/
|
|
7181
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
7182
|
+
|
|
7183
|
+
/**
|
|
7184
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
7185
|
+
|
|
7186
|
+
@see {@link IsNever}
|
|
7187
|
+
|
|
7188
|
+
@example
|
|
7189
|
+
```
|
|
7190
|
+
import type {IfNever} from 'type-fest';
|
|
7191
|
+
|
|
7192
|
+
type ShouldBeTrue = IfNever<never>;
|
|
7193
|
+
//=> true
|
|
7194
|
+
|
|
7195
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
7196
|
+
//=> 'bar'
|
|
7197
|
+
```
|
|
7198
|
+
|
|
7199
|
+
@category Type Guard
|
|
7200
|
+
@category Utilities
|
|
7201
|
+
*/
|
|
7202
|
+
type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
7203
|
+
IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
7204
|
+
);
|
|
7205
|
+
|
|
7206
|
+
/**
|
|
7207
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
7208
|
+
|
|
7209
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
7210
|
+
|
|
7211
|
+
@example
|
|
7212
|
+
```
|
|
7213
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
7214
|
+
|
|
7215
|
+
interface Example {
|
|
7216
|
+
a: string;
|
|
7217
|
+
b: string | number;
|
|
7218
|
+
c?: string;
|
|
7219
|
+
d: {};
|
|
5278
7220
|
}
|
|
5279
|
-
declare const onScheduleCreated$1: EventDefinition$5<ScheduleCreatedEnvelope, "wix.calendar.v3.schedule_created">;
|
|
5280
|
-
declare const onScheduleUpdated$1: EventDefinition$5<ScheduleUpdatedEnvelope, "wix.calendar.v3.schedule_updated">;
|
|
5281
|
-
declare const onScheduleCloned$1: EventDefinition$5<ScheduleClonedEnvelope, "wix.calendar.v3.schedule_cloned">;
|
|
5282
|
-
declare const onScheduleCancelled$1: EventDefinition$5<ScheduleCancelledEnvelope, "wix.calendar.v3.schedule_cancelled">;
|
|
5283
7221
|
|
|
5284
|
-
type
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
isDomainEvent?: boolean;
|
|
5288
|
-
transformations?: (envelope: unknown) => Payload;
|
|
5289
|
-
__payload: Payload;
|
|
5290
|
-
};
|
|
5291
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
5292
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
5293
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
7222
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
7223
|
+
//=> 'a'
|
|
7224
|
+
```
|
|
5294
7225
|
|
|
5295
|
-
|
|
5296
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
5297
|
-
interface SymbolConstructor {
|
|
5298
|
-
readonly observable: symbol;
|
|
5299
|
-
}
|
|
5300
|
-
}
|
|
7226
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
5301
7227
|
|
|
5302
|
-
|
|
7228
|
+
@example
|
|
7229
|
+
```
|
|
7230
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
7231
|
+
|
|
7232
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
7233
|
+
//=> 'a' | 'c'
|
|
7234
|
+
```
|
|
5303
7235
|
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
7236
|
+
@category Object
|
|
7237
|
+
*/
|
|
7238
|
+
type ConditionalKeys<Base, Condition> =
|
|
7239
|
+
{
|
|
7240
|
+
// Map through all the keys of the given base type.
|
|
7241
|
+
[Key in keyof Base]-?:
|
|
7242
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
7243
|
+
Base[Key] extends Condition
|
|
7244
|
+
// Retain this key
|
|
7245
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
7246
|
+
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
|
|
7247
|
+
// Discard this key since the condition fails.
|
|
7248
|
+
: never;
|
|
7249
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
7250
|
+
}[keyof Base];
|
|
5309
7251
|
|
|
5310
|
-
type _publicOnScheduleCreatedType = typeof onScheduleCreated$1;
|
|
5311
7252
|
/**
|
|
5312
|
-
|
|
5313
|
-
* option (google.api.http) = {
|
|
5314
|
-
* post: "/v3/schedules/{schedule_id}/clone";
|
|
5315
|
-
* };
|
|
5316
|
-
*/
|
|
5317
|
-
declare const onScheduleCreated: ReturnType<typeof createEventModule$1<_publicOnScheduleCreatedType>>;
|
|
7253
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
5318
7254
|
|
|
5319
|
-
type
|
|
5320
|
-
/** */
|
|
5321
|
-
declare const onScheduleUpdated: ReturnType<typeof createEventModule$1<_publicOnScheduleUpdatedType>>;
|
|
7255
|
+
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.
|
|
5322
7256
|
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
7257
|
+
@example
|
|
7258
|
+
```
|
|
7259
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
5326
7260
|
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
7261
|
+
class Awesome {
|
|
7262
|
+
name: string;
|
|
7263
|
+
successes: number;
|
|
7264
|
+
failures: bigint;
|
|
5330
7265
|
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
type
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
type
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
type
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
type
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
type
|
|
5364
|
-
|
|
5365
|
-
type
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
type
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
type
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
type
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
type context$1_SitePublished = SitePublished;
|
|
5398
|
-
type context$1_SiteRenamed = SiteRenamed;
|
|
5399
|
-
type context$1_SiteTransferred = SiteTransferred;
|
|
5400
|
-
type context$1_SiteUndeleted = SiteUndeleted;
|
|
5401
|
-
type context$1_SiteUnpublished = SiteUnpublished;
|
|
5402
|
-
type context$1_State = State;
|
|
5403
|
-
declare const context$1_State: typeof State;
|
|
5404
|
-
type context$1_StudioAssigned = StudioAssigned;
|
|
5405
|
-
type context$1_StudioUnassigned = StudioUnassigned;
|
|
5406
|
-
type context$1_Trigger = Trigger;
|
|
5407
|
-
declare const context$1_Trigger: typeof Trigger;
|
|
5408
|
-
type context$1_Type = Type;
|
|
5409
|
-
declare const context$1_Type: typeof Type;
|
|
5410
|
-
type context$1_UpdateSchedule = UpdateSchedule;
|
|
5411
|
-
type context$1_UpdateScheduleOptions = UpdateScheduleOptions;
|
|
5412
|
-
type context$1_UpdateScheduleRequest = UpdateScheduleRequest;
|
|
5413
|
-
type context$1_UpdateScheduleResponse = UpdateScheduleResponse;
|
|
5414
|
-
type context$1_UpdateScheduleResponseNonNullableFields = UpdateScheduleResponseNonNullableFields;
|
|
5415
|
-
type context$1_V4SiteCreated = V4SiteCreated;
|
|
5416
|
-
type context$1__publicOnScheduleCancelledType = _publicOnScheduleCancelledType;
|
|
5417
|
-
type context$1__publicOnScheduleClonedType = _publicOnScheduleClonedType;
|
|
5418
|
-
type context$1__publicOnScheduleCreatedType = _publicOnScheduleCreatedType;
|
|
5419
|
-
type context$1__publicOnScheduleUpdatedType = _publicOnScheduleUpdatedType;
|
|
5420
|
-
declare const context$1_cancelSchedule: typeof cancelSchedule;
|
|
5421
|
-
declare const context$1_createSchedule: typeof createSchedule;
|
|
5422
|
-
declare const context$1_getSchedule: typeof getSchedule;
|
|
5423
|
-
declare const context$1_onScheduleCancelled: typeof onScheduleCancelled;
|
|
5424
|
-
declare const context$1_onScheduleCloned: typeof onScheduleCloned;
|
|
5425
|
-
declare const context$1_onScheduleCreated: typeof onScheduleCreated;
|
|
5426
|
-
declare const context$1_onScheduleUpdated: typeof onScheduleUpdated;
|
|
5427
|
-
declare const context$1_querySchedules: typeof querySchedules;
|
|
5428
|
-
declare const context$1_updateSchedule: typeof updateSchedule;
|
|
5429
|
-
declare namespace context$1 {
|
|
5430
|
-
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 };
|
|
7266
|
+
run() {}
|
|
7267
|
+
}
|
|
7268
|
+
|
|
7269
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
7270
|
+
//=> {run: () => void}
|
|
7271
|
+
```
|
|
7272
|
+
|
|
7273
|
+
@example
|
|
7274
|
+
```
|
|
7275
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
7276
|
+
|
|
7277
|
+
interface Example {
|
|
7278
|
+
a: string;
|
|
7279
|
+
b: string | number;
|
|
7280
|
+
c: () => void;
|
|
7281
|
+
d: {};
|
|
7282
|
+
}
|
|
7283
|
+
|
|
7284
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
7285
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
7286
|
+
```
|
|
7287
|
+
|
|
7288
|
+
@category Object
|
|
7289
|
+
*/
|
|
7290
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
7291
|
+
Base,
|
|
7292
|
+
ConditionalKeys<Base, Condition>
|
|
7293
|
+
>;
|
|
7294
|
+
|
|
7295
|
+
/**
|
|
7296
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
7297
|
+
* can either be a REST module or a host module.
|
|
7298
|
+
* This type is recursive, so it can describe nested modules.
|
|
7299
|
+
*/
|
|
7300
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
7301
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
7302
|
+
};
|
|
7303
|
+
/**
|
|
7304
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
7305
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
7306
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
7307
|
+
* do not match the given host (as they will not work with the given host).
|
|
7308
|
+
*/
|
|
7309
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
7310
|
+
done: T;
|
|
7311
|
+
recurse: T extends {
|
|
7312
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
7313
|
+
} ? 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<{
|
|
7314
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
7315
|
+
-1,
|
|
7316
|
+
0,
|
|
7317
|
+
1,
|
|
7318
|
+
2,
|
|
7319
|
+
3,
|
|
7320
|
+
4,
|
|
7321
|
+
5
|
|
7322
|
+
][Depth]> : never;
|
|
7323
|
+
}, EmptyObject>;
|
|
7324
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
7325
|
+
type PublicMetadata = {
|
|
7326
|
+
PACKAGE_NAME?: string;
|
|
7327
|
+
};
|
|
7328
|
+
|
|
7329
|
+
declare global {
|
|
7330
|
+
interface ContextualClient {
|
|
7331
|
+
}
|
|
5431
7332
|
}
|
|
7333
|
+
/**
|
|
7334
|
+
* A type used to create concerete types from SDK descriptors in
|
|
7335
|
+
* case a contextual client is available.
|
|
7336
|
+
*/
|
|
7337
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
7338
|
+
host: Host;
|
|
7339
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
5432
7340
|
|
|
5433
7341
|
interface ScheduleTimeFrame {
|
|
5434
7342
|
/**
|
|
@@ -5994,25 +7902,7 @@ interface ListScheduleTimeFramesSignature {
|
|
|
5994
7902
|
*/
|
|
5995
7903
|
(ids: string[], options?: ListScheduleTimeFramesOptions | undefined): Promise<ListScheduleTimeFramesResponse & ListScheduleTimeFramesResponseNonNullableFields>;
|
|
5996
7904
|
}
|
|
5997
|
-
declare const onScheduleTimeFrameUpdated$1: EventDefinition
|
|
5998
|
-
|
|
5999
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
6000
|
-
__type: 'event-definition';
|
|
6001
|
-
type: Type;
|
|
6002
|
-
isDomainEvent?: boolean;
|
|
6003
|
-
transformations?: (envelope: unknown) => Payload;
|
|
6004
|
-
__payload: Payload;
|
|
6005
|
-
};
|
|
6006
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
6007
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
6008
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
6009
|
-
|
|
6010
|
-
declare global {
|
|
6011
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6012
|
-
interface SymbolConstructor {
|
|
6013
|
-
readonly observable: symbol;
|
|
6014
|
-
}
|
|
6015
|
-
}
|
|
7905
|
+
declare const onScheduleTimeFrameUpdated$1: EventDefinition<ScheduleTimeFrameUpdatedEnvelope, "wix.calendar.v3.schedule_time_frame_updated">;
|
|
6016
7906
|
|
|
6017
7907
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
6018
7908
|
|