@wix/referral 1.0.40 → 1.0.41
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 +521 -2165
- package/type-bundles/index.bundle.d.ts +521 -2165
- package/type-bundles/meta.bundle.d.ts +28 -28
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
type HostModule
|
|
1
|
+
type HostModule<T, H extends Host> = {
|
|
2
2
|
__type: 'host';
|
|
3
3
|
create(host: H): T;
|
|
4
4
|
};
|
|
5
|
-
type HostModuleAPI
|
|
6
|
-
type Host
|
|
5
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
+
type Host<Environment = unknown> = {
|
|
7
7
|
channel: {
|
|
8
8
|
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
9
|
disconnect: () => void;
|
|
@@ -12,6 +12,10 @@ type Host$4<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$4<Environment = unknown> = {
|
|
|
36
40
|
};
|
|
37
41
|
};
|
|
38
42
|
|
|
39
|
-
type RESTFunctionDescriptor
|
|
40
|
-
interface HttpClient
|
|
41
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory
|
|
43
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
44
|
+
interface HttpClient {
|
|
45
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
42
46
|
fetchWithAuth: typeof fetch;
|
|
43
47
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
48
|
getActiveToken?: () => string | undefined;
|
|
45
49
|
}
|
|
46
|
-
type RequestOptionsFactory
|
|
47
|
-
type HttpResponse
|
|
50
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
51
|
+
type HttpResponse<T = any> = {
|
|
48
52
|
data: T;
|
|
49
53
|
status: number;
|
|
50
54
|
statusText: string;
|
|
51
55
|
headers: any;
|
|
52
56
|
request?: any;
|
|
53
57
|
};
|
|
54
|
-
type RequestOptions
|
|
58
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
55
59
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
56
60
|
url: string;
|
|
57
61
|
data?: Data;
|
|
58
62
|
params?: URLSearchParams;
|
|
59
|
-
} & APIMetadata
|
|
60
|
-
type APIMetadata
|
|
63
|
+
} & APIMetadata;
|
|
64
|
+
type APIMetadata = {
|
|
61
65
|
methodFqn?: string;
|
|
62
66
|
entityFqdn?: string;
|
|
63
67
|
packageName?: string;
|
|
64
68
|
};
|
|
65
|
-
type BuildRESTFunction
|
|
66
|
-
type EventDefinition
|
|
69
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
70
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
67
71
|
__type: 'event-definition';
|
|
68
72
|
type: Type;
|
|
69
73
|
isDomainEvent?: boolean;
|
|
70
74
|
transformations?: (envelope: unknown) => Payload;
|
|
71
75
|
__payload: Payload;
|
|
72
76
|
};
|
|
73
|
-
declare function EventDefinition
|
|
74
|
-
type EventHandler
|
|
75
|
-
type BuildEventDefinition
|
|
77
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
78
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
79
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
76
80
|
|
|
77
|
-
type ServicePluginMethodInput
|
|
81
|
+
type ServicePluginMethodInput = {
|
|
78
82
|
request: any;
|
|
79
83
|
metadata: any;
|
|
80
84
|
};
|
|
81
|
-
type ServicePluginContract
|
|
82
|
-
type ServicePluginMethodMetadata
|
|
85
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
86
|
+
type ServicePluginMethodMetadata = {
|
|
83
87
|
name: string;
|
|
84
88
|
primaryHttpMappingPath: string;
|
|
85
89
|
transformations: {
|
|
86
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput
|
|
90
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
87
91
|
toREST: (...args: unknown[]) => unknown;
|
|
88
92
|
};
|
|
89
93
|
};
|
|
90
|
-
type ServicePluginDefinition
|
|
94
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
91
95
|
__type: 'service-plugin-definition';
|
|
92
96
|
componentType: string;
|
|
93
|
-
methods: ServicePluginMethodMetadata
|
|
97
|
+
methods: ServicePluginMethodMetadata[];
|
|
94
98
|
__contract: Contract;
|
|
95
99
|
};
|
|
96
|
-
declare function ServicePluginDefinition
|
|
97
|
-
type BuildServicePluginDefinition
|
|
98
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE
|
|
100
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
101
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
102
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
99
103
|
|
|
100
|
-
type RequestContext
|
|
104
|
+
type RequestContext = {
|
|
101
105
|
isSSR: boolean;
|
|
102
106
|
host: string;
|
|
103
107
|
protocol?: string;
|
|
104
108
|
};
|
|
105
|
-
type ResponseTransformer
|
|
109
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
106
110
|
/**
|
|
107
111
|
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
108
112
|
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
109
113
|
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
110
114
|
*/
|
|
111
|
-
type Method
|
|
112
|
-
type AmbassadorRequestOptions
|
|
115
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
116
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
113
117
|
_?: T;
|
|
114
118
|
url?: string;
|
|
115
|
-
method?: Method
|
|
119
|
+
method?: Method;
|
|
116
120
|
params?: any;
|
|
117
121
|
data?: any;
|
|
118
|
-
transformResponse?: ResponseTransformer
|
|
122
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
119
123
|
};
|
|
120
|
-
type AmbassadorFactory
|
|
124
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
121
125
|
__isAmbassador: boolean;
|
|
122
126
|
};
|
|
123
|
-
type AmbassadorFunctionDescriptor
|
|
124
|
-
type BuildAmbassadorFunction
|
|
127
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
128
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
125
129
|
|
|
126
130
|
declare global {
|
|
127
131
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -130,7 +134,7 @@ declare global {
|
|
|
130
134
|
}
|
|
131
135
|
}
|
|
132
136
|
|
|
133
|
-
declare const emptyObjectSymbol
|
|
137
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
134
138
|
|
|
135
139
|
/**
|
|
136
140
|
Represents a strictly empty plain object, the `{}` value.
|
|
@@ -158,7 +162,7 @@ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<n
|
|
|
158
162
|
|
|
159
163
|
@category Object
|
|
160
164
|
*/
|
|
161
|
-
type EmptyObject
|
|
165
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
162
166
|
|
|
163
167
|
/**
|
|
164
168
|
Returns a boolean for whether the two given types are equal.
|
|
@@ -186,7 +190,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
186
190
|
@category Type Guard
|
|
187
191
|
@category Utilities
|
|
188
192
|
*/
|
|
189
|
-
type IsEqual
|
|
193
|
+
type IsEqual<A, B> =
|
|
190
194
|
(<G>() => G extends A ? 1 : 2) extends
|
|
191
195
|
(<G>() => G extends B ? 1 : 2)
|
|
192
196
|
? true
|
|
@@ -219,9 +223,9 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
219
223
|
|
|
220
224
|
@see {Except}
|
|
221
225
|
*/
|
|
222
|
-
type Filter
|
|
226
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
227
|
|
|
224
|
-
type ExceptOptions
|
|
228
|
+
type ExceptOptions = {
|
|
225
229
|
/**
|
|
226
230
|
Disallow assigning non-specified properties.
|
|
227
231
|
|
|
@@ -265,12 +269,78 @@ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
|
265
269
|
|
|
266
270
|
@category Object
|
|
267
271
|
*/
|
|
268
|
-
type Except
|
|
269
|
-
[KeyType in keyof ObjectType as Filter
|
|
272
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
273
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
270
274
|
} & (Options['requireExactProps'] extends true
|
|
271
275
|
? Partial<Record<KeysType, never>>
|
|
272
276
|
: {});
|
|
273
277
|
|
|
278
|
+
/**
|
|
279
|
+
Returns a boolean for whether the given type is `never`.
|
|
280
|
+
|
|
281
|
+
@link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
|
|
282
|
+
@link https://stackoverflow.com/a/53984913/10292952
|
|
283
|
+
@link https://www.zhenghao.io/posts/ts-never
|
|
284
|
+
|
|
285
|
+
Useful in type utilities, such as checking if something does not occur.
|
|
286
|
+
|
|
287
|
+
@example
|
|
288
|
+
```
|
|
289
|
+
import type {IsNever, And} from 'type-fest';
|
|
290
|
+
|
|
291
|
+
// https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
|
|
292
|
+
type AreStringsEqual<A extends string, B extends string> =
|
|
293
|
+
And<
|
|
294
|
+
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
295
|
+
IsNever<Exclude<B, A>> extends true ? true : false
|
|
296
|
+
>;
|
|
297
|
+
|
|
298
|
+
type EndIfEqual<I extends string, O extends string> =
|
|
299
|
+
AreStringsEqual<I, O> extends true
|
|
300
|
+
? never
|
|
301
|
+
: void;
|
|
302
|
+
|
|
303
|
+
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
304
|
+
if (input === output) {
|
|
305
|
+
process.exit(0);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
endIfEqual('abc', 'abc');
|
|
310
|
+
//=> never
|
|
311
|
+
|
|
312
|
+
endIfEqual('abc', '123');
|
|
313
|
+
//=> void
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
@category Type Guard
|
|
317
|
+
@category Utilities
|
|
318
|
+
*/
|
|
319
|
+
type IsNever<T> = [T] extends [never] ? true : false;
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
An if-else-like type that resolves depending on whether the given type is `never`.
|
|
323
|
+
|
|
324
|
+
@see {@link IsNever}
|
|
325
|
+
|
|
326
|
+
@example
|
|
327
|
+
```
|
|
328
|
+
import type {IfNever} from 'type-fest';
|
|
329
|
+
|
|
330
|
+
type ShouldBeTrue = IfNever<never>;
|
|
331
|
+
//=> true
|
|
332
|
+
|
|
333
|
+
type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
|
|
334
|
+
//=> 'bar'
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
@category Type Guard
|
|
338
|
+
@category Utilities
|
|
339
|
+
*/
|
|
340
|
+
type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
|
|
341
|
+
IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
|
|
342
|
+
);
|
|
343
|
+
|
|
274
344
|
/**
|
|
275
345
|
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
276
346
|
|
|
@@ -303,21 +373,19 @@ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
|
303
373
|
|
|
304
374
|
@category Object
|
|
305
375
|
*/
|
|
306
|
-
type ConditionalKeys
|
|
307
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
376
|
+
type ConditionalKeys<Base, Condition> =
|
|
308
377
|
{
|
|
309
378
|
// Map through all the keys of the given base type.
|
|
310
|
-
[Key in keyof Base]
|
|
379
|
+
[Key in keyof Base]-?:
|
|
311
380
|
// Pick only keys with types extending the given `Condition` type.
|
|
312
381
|
Base[Key] extends Condition
|
|
313
|
-
// Retain this key
|
|
314
|
-
|
|
382
|
+
// Retain this key
|
|
383
|
+
// If the value for the key extends never, only include it if `Condition` also extends never
|
|
384
|
+
? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
|
|
315
385
|
// Discard this key since the condition fails.
|
|
316
386
|
: never;
|
|
317
|
-
|
|
318
387
|
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
319
|
-
}[keyof Base]
|
|
320
|
-
>;
|
|
388
|
+
}[keyof Base];
|
|
321
389
|
|
|
322
390
|
/**
|
|
323
391
|
Exclude keys from a shape that matches the given `Condition`.
|
|
@@ -357,9 +425,9 @@ type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
|
357
425
|
|
|
358
426
|
@category Object
|
|
359
427
|
*/
|
|
360
|
-
type ConditionalExcept
|
|
428
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
361
429
|
Base,
|
|
362
|
-
ConditionalKeys
|
|
430
|
+
ConditionalKeys<Base, Condition>
|
|
363
431
|
>;
|
|
364
432
|
|
|
365
433
|
/**
|
|
@@ -367,8 +435,8 @@ ConditionalKeys$4<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
|
|
371
|
-
[key: string]: Descriptors
|
|
438
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
|
|
439
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
372
440
|
};
|
|
373
441
|
/**
|
|
374
442
|
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
@@ -376,12 +444,12 @@ type Descriptors$4 = RESTFunctionDescriptor$4 | AmbassadorFunctionDescriptor$4 |
|
|
|
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
|
|
447
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
380
448
|
done: T;
|
|
381
449
|
recurse: T extends {
|
|
382
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE
|
|
383
|
-
} ? never : T extends AmbassadorFunctionDescriptor
|
|
384
|
-
[Key in keyof T]: T[Key] extends Descriptors
|
|
450
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
451
|
+
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
452
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
385
453
|
-1,
|
|
386
454
|
0,
|
|
387
455
|
1,
|
|
@@ -390,9 +458,9 @@ type BuildDescriptors$4<T extends Descriptors$4, H extends Host$4<any> | undefin
|
|
|
390
458
|
4,
|
|
391
459
|
5
|
|
392
460
|
][Depth]> : never;
|
|
393
|
-
}, EmptyObject
|
|
461
|
+
}, EmptyObject>;
|
|
394
462
|
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
-
type PublicMetadata
|
|
463
|
+
type PublicMetadata = {
|
|
396
464
|
PACKAGE_NAME?: string;
|
|
397
465
|
};
|
|
398
466
|
|
|
@@ -404,9 +472,9 @@ declare global {
|
|
|
404
472
|
* A type used to create concerete types from SDK descriptors in
|
|
405
473
|
* case a contextual client is available.
|
|
406
474
|
*/
|
|
407
|
-
type MaybeContext
|
|
408
|
-
host: Host
|
|
409
|
-
} ? BuildDescriptors
|
|
475
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
476
|
+
host: Host;
|
|
477
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
410
478
|
|
|
411
479
|
interface ReferralProgram {
|
|
412
480
|
/** Referral program name. */
|
|
@@ -422,12 +490,12 @@ interface ReferralProgram {
|
|
|
422
490
|
* Date and time the program was created.
|
|
423
491
|
* @readonly
|
|
424
492
|
*/
|
|
425
|
-
_createdDate?: Date;
|
|
493
|
+
_createdDate?: Date | null;
|
|
426
494
|
/**
|
|
427
495
|
* Date and time the program was last updated.
|
|
428
496
|
* @readonly
|
|
429
497
|
*/
|
|
430
|
-
_updatedDate?: Date;
|
|
498
|
+
_updatedDate?: Date | null;
|
|
431
499
|
/**
|
|
432
500
|
* Reward configuration for the referred friend.
|
|
433
501
|
* Specifies the reward given to a new customer who was referred to the business.
|
|
@@ -734,7 +802,7 @@ interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
|
|
|
734
802
|
/** ID of the entity associated with the event. */
|
|
735
803
|
entityId?: string;
|
|
736
804
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
737
|
-
eventTime?: Date;
|
|
805
|
+
eventTime?: Date | null;
|
|
738
806
|
/**
|
|
739
807
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
740
808
|
* (for example, GDPR).
|
|
@@ -763,7 +831,7 @@ interface EntityCreatedEvent$4 {
|
|
|
763
831
|
entity?: string;
|
|
764
832
|
}
|
|
765
833
|
interface RestoreInfo$4 {
|
|
766
|
-
deletedDate?: Date;
|
|
834
|
+
deletedDate?: Date | null;
|
|
767
835
|
}
|
|
768
836
|
interface EntityUpdatedEvent$4 {
|
|
769
837
|
/**
|
|
@@ -989,7 +1057,7 @@ interface SiteDeleted {
|
|
|
989
1057
|
}
|
|
990
1058
|
interface DeleteContext {
|
|
991
1059
|
/** When the meta site was deleted. */
|
|
992
|
-
dateDeleted?: Date;
|
|
1060
|
+
dateDeleted?: Date | null;
|
|
993
1061
|
/** A status. */
|
|
994
1062
|
deleteStatus?: DeleteStatus;
|
|
995
1063
|
/** A reason (flow). */
|
|
@@ -1137,7 +1205,7 @@ interface SubscriptionEvent extends SubscriptionEventEventOneOf {
|
|
|
1137
1205
|
* [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
|
|
1138
1206
|
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1139
1207
|
*/
|
|
1140
|
-
eventDate?: Date;
|
|
1208
|
+
eventDate?: Date | null;
|
|
1141
1209
|
}
|
|
1142
1210
|
/** @oneof */
|
|
1143
1211
|
interface SubscriptionEventEventOneOf {
|
|
@@ -1216,13 +1284,13 @@ interface Subscription {
|
|
|
1216
1284
|
* [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
|
|
1217
1285
|
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1218
1286
|
*/
|
|
1219
|
-
createdAt?: Date;
|
|
1287
|
+
createdAt?: Date | null;
|
|
1220
1288
|
/**
|
|
1221
1289
|
* Date and time the subscription was last updated in
|
|
1222
1290
|
* [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
|
|
1223
1291
|
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1224
1292
|
*/
|
|
1225
|
-
updatedAt?: Date;
|
|
1293
|
+
updatedAt?: Date | null;
|
|
1226
1294
|
/**
|
|
1227
1295
|
* ID of the metasite that the subscription is assigned to.
|
|
1228
1296
|
* Available only when the subscription is assigned to a Wix site.
|
|
@@ -1250,7 +1318,7 @@ interface Subscription {
|
|
|
1250
1318
|
* [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
|
|
1251
1319
|
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1252
1320
|
*/
|
|
1253
|
-
transferredAt?: Date;
|
|
1321
|
+
transferredAt?: Date | null;
|
|
1254
1322
|
/**
|
|
1255
1323
|
* ID of the [product type](https://bo.wix.com/wix-docs/rest/premium/premium-product-catalog-v2/product-types/product-type-object)
|
|
1256
1324
|
* that the product, for which the subscription was purchased, belongs to.
|
|
@@ -1269,7 +1337,7 @@ interface Subscription {
|
|
|
1269
1337
|
* `YYYY-MM-DDThh:mm:ss.sssZ` format.
|
|
1270
1338
|
* Differs from `createdAt` in case the subscription was originally created for a different Wix account and has been transferred.
|
|
1271
1339
|
*/
|
|
1272
|
-
originalCreationDate?: Date;
|
|
1340
|
+
originalCreationDate?: Date | null;
|
|
1273
1341
|
/** Custom metadata about the subscription. */
|
|
1274
1342
|
metadata?: Record<string, string>;
|
|
1275
1343
|
/**
|
|
@@ -1351,9 +1419,9 @@ interface ReactivationData {
|
|
|
1351
1419
|
* In the event of reactivation after chargeback dispute, the subscription may be extended according to the
|
|
1352
1420
|
* number of days it was inactive during the time of resolving the dispute
|
|
1353
1421
|
*/
|
|
1354
|
-
newEndOfPeriod?: Date;
|
|
1422
|
+
newEndOfPeriod?: Date | null;
|
|
1355
1423
|
/** The original end date, before the inactive period. */
|
|
1356
|
-
oldEndOfPeriod?: Date;
|
|
1424
|
+
oldEndOfPeriod?: Date | null;
|
|
1357
1425
|
/** The difference in days between the new new_end_of_period and old_end_of_period */
|
|
1358
1426
|
differenceInDays?: number | null;
|
|
1359
1427
|
}
|
|
@@ -1757,7 +1825,7 @@ interface EventMetadata$3 extends BaseEventMetadata$3 {
|
|
|
1757
1825
|
/** ID of the entity associated with the event. */
|
|
1758
1826
|
entityId?: string;
|
|
1759
1827
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
1760
|
-
eventTime?: Date;
|
|
1828
|
+
eventTime?: Date | null;
|
|
1761
1829
|
/**
|
|
1762
1830
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
1763
1831
|
* (for example, GDPR).
|
|
@@ -1788,14 +1856,14 @@ interface GenerateAiSocialMediaPostsSuggestionsOptions {
|
|
|
1788
1856
|
topic?: string;
|
|
1789
1857
|
}
|
|
1790
1858
|
|
|
1791
|
-
declare function getReferralProgram$1(httpClient: HttpClient
|
|
1859
|
+
declare function getReferralProgram$1(httpClient: HttpClient): GetReferralProgramSignature;
|
|
1792
1860
|
interface GetReferralProgramSignature {
|
|
1793
1861
|
/**
|
|
1794
1862
|
* Retrieves the referral program.
|
|
1795
1863
|
*/
|
|
1796
1864
|
(): Promise<GetReferralProgramResponse & GetReferralProgramResponseNonNullableFields>;
|
|
1797
1865
|
}
|
|
1798
|
-
declare function updateReferralProgram$1(httpClient: HttpClient
|
|
1866
|
+
declare function updateReferralProgram$1(httpClient: HttpClient): UpdateReferralProgramSignature;
|
|
1799
1867
|
interface UpdateReferralProgramSignature {
|
|
1800
1868
|
/**
|
|
1801
1869
|
* Updates a referral program. Supports partial updates.
|
|
@@ -1806,21 +1874,21 @@ interface UpdateReferralProgramSignature {
|
|
|
1806
1874
|
*/
|
|
1807
1875
|
(referralProgram: ReferralProgram): Promise<UpdateReferralProgramResponse & UpdateReferralProgramResponseNonNullableFields>;
|
|
1808
1876
|
}
|
|
1809
|
-
declare function activateReferralProgram$1(httpClient: HttpClient
|
|
1877
|
+
declare function activateReferralProgram$1(httpClient: HttpClient): ActivateReferralProgramSignature;
|
|
1810
1878
|
interface ActivateReferralProgramSignature {
|
|
1811
1879
|
/**
|
|
1812
1880
|
* Activates the referral program, changing its status to `ACTIVE`.
|
|
1813
1881
|
*/
|
|
1814
1882
|
(): Promise<ActivateReferralProgramResponse & ActivateReferralProgramResponseNonNullableFields>;
|
|
1815
1883
|
}
|
|
1816
|
-
declare function pauseReferralProgram$1(httpClient: HttpClient
|
|
1884
|
+
declare function pauseReferralProgram$1(httpClient: HttpClient): PauseReferralProgramSignature;
|
|
1817
1885
|
interface PauseReferralProgramSignature {
|
|
1818
1886
|
/**
|
|
1819
1887
|
* Pauses the referral program, changing its status to `PAUSED`.
|
|
1820
1888
|
*/
|
|
1821
1889
|
(): Promise<PauseReferralProgramResponse & PauseReferralProgramResponseNonNullableFields>;
|
|
1822
1890
|
}
|
|
1823
|
-
declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient
|
|
1891
|
+
declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GetAiSocialMediaPostsSuggestionsSignature;
|
|
1824
1892
|
interface GetAiSocialMediaPostsSuggestionsSignature {
|
|
1825
1893
|
/**
|
|
1826
1894
|
* Retrieves pre-generated AI social media post suggestions for promoting the referral program.
|
|
@@ -1832,7 +1900,7 @@ interface GetAiSocialMediaPostsSuggestionsSignature {
|
|
|
1832
1900
|
*/
|
|
1833
1901
|
(options?: GetAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GetAISocialMediaPostsSuggestionsResponse & GetAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
1834
1902
|
}
|
|
1835
|
-
declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient
|
|
1903
|
+
declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GenerateAiSocialMediaPostsSuggestionsSignature;
|
|
1836
1904
|
interface GenerateAiSocialMediaPostsSuggestionsSignature {
|
|
1837
1905
|
/**
|
|
1838
1906
|
* Creates new AI-generated social media post suggestions for promoting the referral program.
|
|
@@ -1843,42 +1911,24 @@ interface GenerateAiSocialMediaPostsSuggestionsSignature {
|
|
|
1843
1911
|
*/
|
|
1844
1912
|
(options?: GenerateAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GenerateAISocialMediaPostsSuggestionsResponse & GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
1845
1913
|
}
|
|
1846
|
-
declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient
|
|
1914
|
+
declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient): GetReferralProgramPremiumFeaturesSignature;
|
|
1847
1915
|
interface GetReferralProgramPremiumFeaturesSignature {
|
|
1848
1916
|
/**
|
|
1849
1917
|
* Retrieves information about the enabled premium features for the referral program.
|
|
1850
1918
|
*/
|
|
1851
1919
|
(): Promise<GetReferralProgramPremiumFeaturesResponse & GetReferralProgramPremiumFeaturesResponseNonNullableFields>;
|
|
1852
1920
|
}
|
|
1853
|
-
declare const onProgramUpdated$1: EventDefinition
|
|
1854
|
-
|
|
1855
|
-
type EventDefinition$7<Payload = unknown, Type extends string = string> = {
|
|
1856
|
-
__type: 'event-definition';
|
|
1857
|
-
type: Type;
|
|
1858
|
-
isDomainEvent?: boolean;
|
|
1859
|
-
transformations?: (envelope: unknown) => Payload;
|
|
1860
|
-
__payload: Payload;
|
|
1861
|
-
};
|
|
1862
|
-
declare function EventDefinition$7<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$7<Payload, Type>;
|
|
1863
|
-
type EventHandler$7<T extends EventDefinition$7> = (payload: T['__payload']) => void | Promise<void>;
|
|
1864
|
-
type BuildEventDefinition$7<T extends EventDefinition$7<any, string>> = (handler: EventHandler$7<T>) => void;
|
|
1865
|
-
|
|
1866
|
-
declare global {
|
|
1867
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1868
|
-
interface SymbolConstructor {
|
|
1869
|
-
readonly observable: symbol;
|
|
1870
|
-
}
|
|
1871
|
-
}
|
|
1921
|
+
declare const onProgramUpdated$1: EventDefinition<ProgramUpdatedEnvelope, "wix.loyalty.referral.v1.program_updated">;
|
|
1872
1922
|
|
|
1873
|
-
declare function createEventModule$3<T extends EventDefinition
|
|
1923
|
+
declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
1874
1924
|
|
|
1875
|
-
declare const getReferralProgram: MaybeContext
|
|
1876
|
-
declare const updateReferralProgram: MaybeContext
|
|
1877
|
-
declare const activateReferralProgram: MaybeContext
|
|
1878
|
-
declare const pauseReferralProgram: MaybeContext
|
|
1879
|
-
declare const getAiSocialMediaPostsSuggestions: MaybeContext
|
|
1880
|
-
declare const generateAiSocialMediaPostsSuggestions: MaybeContext
|
|
1881
|
-
declare const getReferralProgramPremiumFeatures: MaybeContext
|
|
1925
|
+
declare const getReferralProgram: MaybeContext<BuildRESTFunction<typeof getReferralProgram$1> & typeof getReferralProgram$1>;
|
|
1926
|
+
declare const updateReferralProgram: MaybeContext<BuildRESTFunction<typeof updateReferralProgram$1> & typeof updateReferralProgram$1>;
|
|
1927
|
+
declare const activateReferralProgram: MaybeContext<BuildRESTFunction<typeof activateReferralProgram$1> & typeof activateReferralProgram$1>;
|
|
1928
|
+
declare const pauseReferralProgram: MaybeContext<BuildRESTFunction<typeof pauseReferralProgram$1> & typeof pauseReferralProgram$1>;
|
|
1929
|
+
declare const getAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof getAiSocialMediaPostsSuggestions$1> & typeof getAiSocialMediaPostsSuggestions$1>;
|
|
1930
|
+
declare const generateAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof generateAiSocialMediaPostsSuggestions$1> & typeof generateAiSocialMediaPostsSuggestions$1>;
|
|
1931
|
+
declare const getReferralProgramPremiumFeatures: MaybeContext<BuildRESTFunction<typeof getReferralProgramPremiumFeatures$1> & typeof getReferralProgramPremiumFeatures$1>;
|
|
1882
1932
|
|
|
1883
1933
|
type _publicOnProgramUpdatedType = typeof onProgramUpdated$1;
|
|
1884
1934
|
/**
|
|
@@ -2007,488 +2057,78 @@ declare namespace index_d$4 {
|
|
|
2007
2057
|
export { type index_d$4_AISocialMediaPostSuggestion as AISocialMediaPostSuggestion, index_d$4_Action as Action, type ActionEvent$4 as ActionEvent, type index_d$4_ActivateReferralProgramRequest as ActivateReferralProgramRequest, type index_d$4_ActivateReferralProgramResponse as ActivateReferralProgramResponse, type index_d$4_ActivateReferralProgramResponseNonNullableFields as ActivateReferralProgramResponseNonNullableFields, index_d$4_App as App, type index_d$4_Asset as Asset, type BaseEventMetadata$3 as BaseEventMetadata, type index_d$4_BillingReference as BillingReference, type index_d$4_BulkGetReferralProgramRequest as BulkGetReferralProgramRequest, type index_d$4_BulkGetReferralProgramResponse as BulkGetReferralProgramResponse, type index_d$4_CancellationDetails as CancellationDetails, index_d$4_ContractSwitchReason as ContractSwitchReason, index_d$4_ContractSwitchType as ContractSwitchType, type index_d$4_ContractSwitched as ContractSwitched, type Coupon$2 as Coupon, type CouponDiscountTypeOptionsOneOf$2 as CouponDiscountTypeOptionsOneOf, type CouponScope$2 as CouponScope, type CouponScopeOrMinSubtotalOneOf$2 as CouponScopeOrMinSubtotalOneOf, type index_d$4_Cycle as Cycle, type index_d$4_CycleCycleSelectorOneOf as CycleCycleSelectorOneOf, type index_d$4_DeleteContext as DeleteContext, index_d$4_DeleteStatus as DeleteStatus, DiscountType$2 as DiscountType, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type index_d$4_Emails as Emails, type Empty$3 as Empty, type EntityCreatedEvent$4 as EntityCreatedEvent, type EntityDeletedEvent$4 as EntityDeletedEvent, type EntityUpdatedEvent$4 as EntityUpdatedEvent, type EventMetadata$3 as EventMetadata, type FixedAmountDiscount$2 as FixedAmountDiscount, type index_d$4_GenerateAISocialMediaPostsSuggestionsRequest as GenerateAISocialMediaPostsSuggestionsRequest, type index_d$4_GenerateAISocialMediaPostsSuggestionsResponse as GenerateAISocialMediaPostsSuggestionsResponse, type index_d$4_GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields as GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields, type index_d$4_GenerateAiSocialMediaPostsSuggestionsOptions as GenerateAiSocialMediaPostsSuggestionsOptions, type index_d$4_GetAISocialMediaPostsSuggestionsRequest as GetAISocialMediaPostsSuggestionsRequest, type index_d$4_GetAISocialMediaPostsSuggestionsResponse as GetAISocialMediaPostsSuggestionsResponse, type index_d$4_GetAISocialMediaPostsSuggestionsResponseNonNullableFields as GetAISocialMediaPostsSuggestionsResponseNonNullableFields, type index_d$4_GetAiSocialMediaPostsSuggestionsOptions as GetAiSocialMediaPostsSuggestionsOptions, type index_d$4_GetReferralProgramPremiumFeaturesRequest as GetReferralProgramPremiumFeaturesRequest, type index_d$4_GetReferralProgramPremiumFeaturesResponse as GetReferralProgramPremiumFeaturesResponse, type index_d$4_GetReferralProgramPremiumFeaturesResponseNonNullableFields as GetReferralProgramPremiumFeaturesResponseNonNullableFields, type index_d$4_GetReferralProgramRequest as GetReferralProgramRequest, type index_d$4_GetReferralProgramResponse as GetReferralProgramResponse, type index_d$4_GetReferralProgramResponseNonNullableFields as GetReferralProgramResponseNonNullableFields, type Group$2 as Group, type index_d$4_HtmlSitePublished as HtmlSitePublished, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, index_d$4_Initiator as Initiator, type index_d$4_Interval as Interval, index_d$4_IntervalUnit as IntervalUnit, type LoyaltyPoints$2 as LoyaltyPoints, type MessageEnvelope$4 as MessageEnvelope, type index_d$4_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type index_d$4_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, index_d$4_Namespace as Namespace, type index_d$4_NamespaceChanged as NamespaceChanged, type index_d$4_OneTime as OneTime, type index_d$4_Page as Page, type index_d$4_PauseReferralProgramRequest as PauseReferralProgramRequest, type index_d$4_PauseReferralProgramResponse as PauseReferralProgramResponse, type index_d$4_PauseReferralProgramResponseNonNullableFields as PauseReferralProgramResponseNonNullableFields, type PercentageDiscount$2 as PercentageDiscount, type index_d$4_PremiumFeatures as PremiumFeatures, index_d$4_PriceIncreaseTrigger as PriceIncreaseTrigger, index_d$4_ProductAdjustment as ProductAdjustment, type index_d$4_ProductPriceIncreaseData as ProductPriceIncreaseData, type index_d$4_ProgramInSite as ProgramInSite, index_d$4_ProgramStatus as ProgramStatus, type index_d$4_ProgramUpdatedEnvelope as ProgramUpdatedEnvelope, index_d$4_ProviderName as ProviderName, type index_d$4_ReactivationData as ReactivationData, index_d$4_ReactivationReasonEnum as ReactivationReasonEnum, type index_d$4_RecurringChargeSucceeded as RecurringChargeSucceeded, type index_d$4_ReferralProgram as ReferralProgram, type RestoreInfo$4 as RestoreInfo, type Reward$2 as Reward, type RewardOptionsOneOf$1 as RewardOptionsOneOf, type index_d$4_ServiceProvisioned as ServiceProvisioned, type index_d$4_ServiceRemoved as ServiceRemoved, type index_d$4_SiteCreated as SiteCreated, index_d$4_SiteCreatedContext as SiteCreatedContext, type index_d$4_SiteDeleted as SiteDeleted, type index_d$4_SiteHardDeleted as SiteHardDeleted, type index_d$4_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type index_d$4_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type index_d$4_SitePublished as SitePublished, type index_d$4_SiteRenamed as SiteRenamed, type index_d$4_SiteTransferred as SiteTransferred, type index_d$4_SiteUndeleted as SiteUndeleted, type index_d$4_SiteUnpublished as SiteUnpublished, index_d$4_State as State, type index_d$4_StudioAssigned as StudioAssigned, type index_d$4_StudioUnassigned as StudioUnassigned, type index_d$4_Subscription as Subscription, type index_d$4_SubscriptionAssigned as SubscriptionAssigned, type index_d$4_SubscriptionAutoRenewTurnedOff as SubscriptionAutoRenewTurnedOff, type index_d$4_SubscriptionAutoRenewTurnedOn as SubscriptionAutoRenewTurnedOn, type index_d$4_SubscriptionCancelled as SubscriptionCancelled, type index_d$4_SubscriptionCreated as SubscriptionCreated, type index_d$4_SubscriptionEvent as SubscriptionEvent, type index_d$4_SubscriptionEventEventOneOf as SubscriptionEventEventOneOf, type index_d$4_SubscriptionNearEndOfPeriod as SubscriptionNearEndOfPeriod, type index_d$4_SubscriptionPendingChange as SubscriptionPendingChange, index_d$4_SubscriptionStatus as SubscriptionStatus, type index_d$4_SubscriptionTransferred as SubscriptionTransferred, type index_d$4_SubscriptionUnassigned as SubscriptionUnassigned, Type$1 as Type, index_d$4_UnassignReason as UnassignReason, type index_d$4_UpdateReferralProgramRequest as UpdateReferralProgramRequest, type index_d$4_UpdateReferralProgramResponse as UpdateReferralProgramResponse, type index_d$4_UpdateReferralProgramResponseNonNullableFields as UpdateReferralProgramResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, type index_d$4__publicOnProgramUpdatedType as _publicOnProgramUpdatedType, index_d$4_activateReferralProgram as activateReferralProgram, index_d$4_generateAiSocialMediaPostsSuggestions as generateAiSocialMediaPostsSuggestions, index_d$4_getAiSocialMediaPostsSuggestions as getAiSocialMediaPostsSuggestions, index_d$4_getReferralProgram as getReferralProgram, index_d$4_getReferralProgramPremiumFeatures as getReferralProgramPremiumFeatures, index_d$4_onProgramUpdated as onProgramUpdated, index_d$4_pauseReferralProgram as pauseReferralProgram, onProgramUpdated$1 as publicOnProgramUpdated, index_d$4_updateReferralProgram as updateReferralProgram };
|
|
2008
2058
|
}
|
|
2009
2059
|
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
} | Promise<{
|
|
2020
|
-
disconnect: () => void;
|
|
2021
|
-
}>;
|
|
2022
|
-
};
|
|
2023
|
-
environment?: Environment;
|
|
2060
|
+
interface ReferralEvent extends ReferralEventEventTypeOneOf {
|
|
2061
|
+
/** Event triggered when a referred friend signs up. */
|
|
2062
|
+
referredFriendSignupEvent?: ReferredFriendSignupEvent;
|
|
2063
|
+
/** Event triggered when a referral is successful. For example, customer places and pays for an order. */
|
|
2064
|
+
successfulReferralEvent?: V1SuccessfulReferralEvent;
|
|
2065
|
+
/** Event triggered when an action is performed. For example, placing an order. */
|
|
2066
|
+
actionEvent?: V1ActionEvent;
|
|
2067
|
+
/** Event triggered when a reward is given. */
|
|
2068
|
+
rewardEvent?: RewardEvent;
|
|
2024
2069
|
/**
|
|
2025
|
-
*
|
|
2070
|
+
* Referral event ID.
|
|
2071
|
+
* @readonly
|
|
2026
2072
|
*/
|
|
2027
|
-
|
|
2073
|
+
_id?: string | null;
|
|
2028
2074
|
/**
|
|
2029
|
-
*
|
|
2030
|
-
*
|
|
2075
|
+
* Revision number, which increments by 1 each time the referral event is updated.
|
|
2076
|
+
* To prevent conflicting changes, the current revision must be passed when updating the referral event.
|
|
2031
2077
|
*/
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
*/
|
|
2044
|
-
passThroughHeaders?: Record<string, string>;
|
|
2045
|
-
};
|
|
2046
|
-
};
|
|
2047
|
-
|
|
2048
|
-
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
2049
|
-
interface HttpClient$3 {
|
|
2050
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
2051
|
-
fetchWithAuth: typeof fetch;
|
|
2052
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
2053
|
-
getActiveToken?: () => string | undefined;
|
|
2078
|
+
revision?: string | null;
|
|
2079
|
+
/**
|
|
2080
|
+
* Date and time the referral event was created.
|
|
2081
|
+
* @readonly
|
|
2082
|
+
*/
|
|
2083
|
+
_createdDate?: Date | null;
|
|
2084
|
+
/**
|
|
2085
|
+
* Date and time the referral event was last updated.
|
|
2086
|
+
* @readonly
|
|
2087
|
+
*/
|
|
2088
|
+
_updatedDate?: Date | null;
|
|
2054
2089
|
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
url: string;
|
|
2066
|
-
data?: Data;
|
|
2067
|
-
params?: URLSearchParams;
|
|
2068
|
-
} & APIMetadata$3;
|
|
2069
|
-
type APIMetadata$3 = {
|
|
2070
|
-
methodFqn?: string;
|
|
2071
|
-
entityFqdn?: string;
|
|
2072
|
-
packageName?: string;
|
|
2073
|
-
};
|
|
2074
|
-
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
2075
|
-
type EventDefinition$6<Payload = unknown, Type extends string = string> = {
|
|
2076
|
-
__type: 'event-definition';
|
|
2077
|
-
type: Type;
|
|
2078
|
-
isDomainEvent?: boolean;
|
|
2079
|
-
transformations?: (envelope: unknown) => Payload;
|
|
2080
|
-
__payload: Payload;
|
|
2081
|
-
};
|
|
2082
|
-
declare function EventDefinition$6<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$6<Payload, Type>;
|
|
2083
|
-
type EventHandler$6<T extends EventDefinition$6> = (payload: T['__payload']) => void | Promise<void>;
|
|
2084
|
-
type BuildEventDefinition$6<T extends EventDefinition$6<any, string>> = (handler: EventHandler$6<T>) => void;
|
|
2085
|
-
|
|
2086
|
-
type ServicePluginMethodInput$3 = {
|
|
2087
|
-
request: any;
|
|
2088
|
-
metadata: any;
|
|
2089
|
-
};
|
|
2090
|
-
type ServicePluginContract$3 = Record<string, (payload: ServicePluginMethodInput$3) => unknown | Promise<unknown>>;
|
|
2091
|
-
type ServicePluginMethodMetadata$3 = {
|
|
2092
|
-
name: string;
|
|
2093
|
-
primaryHttpMappingPath: string;
|
|
2094
|
-
transformations: {
|
|
2095
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$3;
|
|
2096
|
-
toREST: (...args: unknown[]) => unknown;
|
|
2097
|
-
};
|
|
2098
|
-
};
|
|
2099
|
-
type ServicePluginDefinition$3<Contract extends ServicePluginContract$3> = {
|
|
2100
|
-
__type: 'service-plugin-definition';
|
|
2101
|
-
componentType: string;
|
|
2102
|
-
methods: ServicePluginMethodMetadata$3[];
|
|
2103
|
-
__contract: Contract;
|
|
2104
|
-
};
|
|
2105
|
-
declare function ServicePluginDefinition$3<Contract extends ServicePluginContract$3>(componentType: string, methods: ServicePluginMethodMetadata$3[]): ServicePluginDefinition$3<Contract>;
|
|
2106
|
-
type BuildServicePluginDefinition$3<T extends ServicePluginDefinition$3<any>> = (implementation: T['__contract']) => void;
|
|
2107
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$3 = "wix_spi_error";
|
|
2108
|
-
|
|
2109
|
-
type RequestContext$3 = {
|
|
2110
|
-
isSSR: boolean;
|
|
2111
|
-
host: string;
|
|
2112
|
-
protocol?: string;
|
|
2113
|
-
};
|
|
2114
|
-
type ResponseTransformer$3 = (data: any, headers?: any) => any;
|
|
2115
|
-
/**
|
|
2116
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
2117
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
2118
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
2119
|
-
*/
|
|
2120
|
-
type Method$3 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
2121
|
-
type AmbassadorRequestOptions$3<T = any> = {
|
|
2122
|
-
_?: T;
|
|
2123
|
-
url?: string;
|
|
2124
|
-
method?: Method$3;
|
|
2125
|
-
params?: any;
|
|
2126
|
-
data?: any;
|
|
2127
|
-
transformResponse?: ResponseTransformer$3 | ResponseTransformer$3[];
|
|
2128
|
-
};
|
|
2129
|
-
type AmbassadorFactory$3<Request, Response> = (payload: Request) => ((context: RequestContext$3) => AmbassadorRequestOptions$3<Response>) & {
|
|
2130
|
-
__isAmbassador: boolean;
|
|
2131
|
-
};
|
|
2132
|
-
type AmbassadorFunctionDescriptor$3<Request = any, Response = any> = AmbassadorFactory$3<Request, Response>;
|
|
2133
|
-
type BuildAmbassadorFunction$3<T extends AmbassadorFunctionDescriptor$3> = T extends AmbassadorFunctionDescriptor$3<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
2134
|
-
|
|
2135
|
-
declare global {
|
|
2136
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2137
|
-
interface SymbolConstructor {
|
|
2138
|
-
readonly observable: symbol;
|
|
2139
|
-
}
|
|
2090
|
+
/** @oneof */
|
|
2091
|
+
interface ReferralEventEventTypeOneOf {
|
|
2092
|
+
/** Event triggered when a referred friend signs up. */
|
|
2093
|
+
referredFriendSignupEvent?: ReferredFriendSignupEvent;
|
|
2094
|
+
/** Event triggered when a referral is successful. For example, customer places and pays for an order. */
|
|
2095
|
+
successfulReferralEvent?: V1SuccessfulReferralEvent;
|
|
2096
|
+
/** Event triggered when an action is performed. For example, placing an order. */
|
|
2097
|
+
actionEvent?: V1ActionEvent;
|
|
2098
|
+
/** Event triggered when a reward is given. */
|
|
2099
|
+
rewardEvent?: RewardEvent;
|
|
2140
2100
|
}
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
/**
|
|
2145
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
2146
|
-
|
|
2147
|
-
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)).
|
|
2148
|
-
|
|
2149
|
-
@example
|
|
2150
|
-
```
|
|
2151
|
-
import type {EmptyObject} from 'type-fest';
|
|
2152
|
-
|
|
2153
|
-
// The following illustrates the problem with `{}`.
|
|
2154
|
-
const foo1: {} = {}; // Pass
|
|
2155
|
-
const foo2: {} = []; // Pass
|
|
2156
|
-
const foo3: {} = 42; // Pass
|
|
2157
|
-
const foo4: {} = {a: 1}; // Pass
|
|
2158
|
-
|
|
2159
|
-
// With `EmptyObject` only the first case is valid.
|
|
2160
|
-
const bar1: EmptyObject = {}; // Pass
|
|
2161
|
-
const bar2: EmptyObject = 42; // Fail
|
|
2162
|
-
const bar3: EmptyObject = []; // Fail
|
|
2163
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
2164
|
-
```
|
|
2165
|
-
|
|
2166
|
-
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}.
|
|
2167
|
-
|
|
2168
|
-
@category Object
|
|
2169
|
-
*/
|
|
2170
|
-
type EmptyObject$3 = {[emptyObjectSymbol$3]?: never};
|
|
2171
|
-
|
|
2172
|
-
/**
|
|
2173
|
-
Returns a boolean for whether the two given types are equal.
|
|
2174
|
-
|
|
2175
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
2176
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
2177
|
-
|
|
2178
|
-
Use-cases:
|
|
2179
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
2180
|
-
|
|
2181
|
-
@example
|
|
2182
|
-
```
|
|
2183
|
-
import type {IsEqual} from 'type-fest';
|
|
2184
|
-
|
|
2185
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
2186
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
2187
|
-
type Includes<Value extends readonly any[], Item> =
|
|
2188
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
2189
|
-
? IsEqual<Value[0], Item> extends true
|
|
2190
|
-
? true
|
|
2191
|
-
: Includes<rest, Item>
|
|
2192
|
-
: false;
|
|
2193
|
-
```
|
|
2194
|
-
|
|
2195
|
-
@category Type Guard
|
|
2196
|
-
@category Utilities
|
|
2197
|
-
*/
|
|
2198
|
-
type IsEqual$3<A, B> =
|
|
2199
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
2200
|
-
(<G>() => G extends B ? 1 : 2)
|
|
2201
|
-
? true
|
|
2202
|
-
: false;
|
|
2203
|
-
|
|
2204
|
-
/**
|
|
2205
|
-
Filter out keys from an object.
|
|
2206
|
-
|
|
2207
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
2208
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
2209
|
-
Returns `Key` otherwise.
|
|
2210
|
-
|
|
2211
|
-
@example
|
|
2212
|
-
```
|
|
2213
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
2214
|
-
//=> never
|
|
2215
|
-
```
|
|
2216
|
-
|
|
2217
|
-
@example
|
|
2218
|
-
```
|
|
2219
|
-
type Filtered = Filter<'bar', string>;
|
|
2220
|
-
//=> never
|
|
2221
|
-
```
|
|
2222
|
-
|
|
2223
|
-
@example
|
|
2224
|
-
```
|
|
2225
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
2226
|
-
//=> 'bar'
|
|
2227
|
-
```
|
|
2228
|
-
|
|
2229
|
-
@see {Except}
|
|
2230
|
-
*/
|
|
2231
|
-
type Filter$3<KeyType, ExcludeType> = IsEqual$3<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
2232
|
-
|
|
2233
|
-
type ExceptOptions$3 = {
|
|
2234
|
-
/**
|
|
2235
|
-
Disallow assigning non-specified properties.
|
|
2236
|
-
|
|
2237
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
2238
|
-
|
|
2239
|
-
@default false
|
|
2240
|
-
*/
|
|
2241
|
-
requireExactProps?: boolean;
|
|
2242
|
-
};
|
|
2243
|
-
|
|
2244
|
-
/**
|
|
2245
|
-
Create a type from an object type without certain keys.
|
|
2246
|
-
|
|
2247
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
2248
|
-
|
|
2249
|
-
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.
|
|
2250
|
-
|
|
2251
|
-
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)).
|
|
2252
|
-
|
|
2253
|
-
@example
|
|
2254
|
-
```
|
|
2255
|
-
import type {Except} from 'type-fest';
|
|
2256
|
-
|
|
2257
|
-
type Foo = {
|
|
2258
|
-
a: number;
|
|
2259
|
-
b: string;
|
|
2260
|
-
};
|
|
2261
|
-
|
|
2262
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
2263
|
-
//=> {b: string}
|
|
2264
|
-
|
|
2265
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
2266
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
2267
|
-
|
|
2268
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
2269
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
2270
|
-
|
|
2271
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
2272
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
2273
|
-
```
|
|
2274
|
-
|
|
2275
|
-
@category Object
|
|
2276
|
-
*/
|
|
2277
|
-
type Except$3<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$3 = {requireExactProps: false}> = {
|
|
2278
|
-
[KeyType in keyof ObjectType as Filter$3<KeyType, KeysType>]: ObjectType[KeyType];
|
|
2279
|
-
} & (Options['requireExactProps'] extends true
|
|
2280
|
-
? Partial<Record<KeysType, never>>
|
|
2281
|
-
: {});
|
|
2282
|
-
|
|
2283
|
-
/**
|
|
2284
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
2285
|
-
|
|
2286
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
2287
|
-
|
|
2288
|
-
@example
|
|
2289
|
-
```
|
|
2290
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
2291
|
-
|
|
2292
|
-
interface Example {
|
|
2293
|
-
a: string;
|
|
2294
|
-
b: string | number;
|
|
2295
|
-
c?: string;
|
|
2296
|
-
d: {};
|
|
2101
|
+
interface ReferredFriendSignupEvent {
|
|
2102
|
+
/** ID of the referred friend */
|
|
2103
|
+
referredFriendId?: string;
|
|
2297
2104
|
}
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
2304
|
-
|
|
2305
|
-
@example
|
|
2306
|
-
```
|
|
2307
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
2308
|
-
|
|
2309
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
2310
|
-
//=> 'a' | 'c'
|
|
2311
|
-
```
|
|
2312
|
-
|
|
2313
|
-
@category Object
|
|
2314
|
-
*/
|
|
2315
|
-
type ConditionalKeys$3<Base, Condition> = NonNullable<
|
|
2316
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
2317
|
-
{
|
|
2318
|
-
// Map through all the keys of the given base type.
|
|
2319
|
-
[Key in keyof Base]:
|
|
2320
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
2321
|
-
Base[Key] extends Condition
|
|
2322
|
-
// Retain this key since the condition passes.
|
|
2323
|
-
? Key
|
|
2324
|
-
// Discard this key since the condition fails.
|
|
2325
|
-
: never;
|
|
2326
|
-
|
|
2327
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
2328
|
-
}[keyof Base]
|
|
2329
|
-
>;
|
|
2330
|
-
|
|
2331
|
-
/**
|
|
2332
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
2333
|
-
|
|
2334
|
-
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.
|
|
2335
|
-
|
|
2336
|
-
@example
|
|
2337
|
-
```
|
|
2338
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
2339
|
-
|
|
2340
|
-
class Awesome {
|
|
2341
|
-
name: string;
|
|
2342
|
-
successes: number;
|
|
2343
|
-
failures: bigint;
|
|
2344
|
-
|
|
2345
|
-
run() {}
|
|
2105
|
+
interface V1SuccessfulReferralEvent {
|
|
2106
|
+
/** ID of the referred friend */
|
|
2107
|
+
referredFriendId?: string;
|
|
2108
|
+
/** ID of the referring customer */
|
|
2109
|
+
referringCustomerId?: string;
|
|
2346
2110
|
}
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
d: {};
|
|
2111
|
+
interface V1ActionEvent {
|
|
2112
|
+
/** ID of the referred friend */
|
|
2113
|
+
referredFriendId?: string;
|
|
2114
|
+
/** ID of the referring customer */
|
|
2115
|
+
referringCustomerId?: string;
|
|
2116
|
+
/** Trigger for the action */
|
|
2117
|
+
trigger?: V1Trigger;
|
|
2118
|
+
/** Amount associated with the action. */
|
|
2119
|
+
amount?: string | null;
|
|
2120
|
+
/** Currency of the amount. */
|
|
2121
|
+
currency?: string | null;
|
|
2122
|
+
/** ID of the associated order. */
|
|
2123
|
+
orderId?: string | null;
|
|
2361
2124
|
}
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
@category Object
|
|
2368
|
-
*/
|
|
2369
|
-
type ConditionalExcept$3<Base, Condition> = Except$3<
|
|
2370
|
-
Base,
|
|
2371
|
-
ConditionalKeys$3<Base, Condition>
|
|
2372
|
-
>;
|
|
2373
|
-
|
|
2374
|
-
/**
|
|
2375
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
2376
|
-
* can either be a REST module or a host module.
|
|
2377
|
-
* This type is recursive, so it can describe nested modules.
|
|
2378
|
-
*/
|
|
2379
|
-
type Descriptors$3 = RESTFunctionDescriptor$3 | AmbassadorFunctionDescriptor$3 | HostModule$3<any, any> | EventDefinition$6<any> | ServicePluginDefinition$3<any> | {
|
|
2380
|
-
[key: string]: Descriptors$3 | PublicMetadata$3 | any;
|
|
2381
|
-
};
|
|
2382
|
-
/**
|
|
2383
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
2384
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
2385
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
2386
|
-
* do not match the given host (as they will not work with the given host).
|
|
2387
|
-
*/
|
|
2388
|
-
type BuildDescriptors$3<T extends Descriptors$3, H extends Host$3<any> | undefined, Depth extends number = 5> = {
|
|
2389
|
-
done: T;
|
|
2390
|
-
recurse: T extends {
|
|
2391
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$3;
|
|
2392
|
-
} ? never : T extends AmbassadorFunctionDescriptor$3 ? BuildAmbassadorFunction$3<T> : T extends RESTFunctionDescriptor$3 ? BuildRESTFunction$3<T> : T extends EventDefinition$6<any> ? BuildEventDefinition$6<T> : T extends ServicePluginDefinition$3<any> ? BuildServicePluginDefinition$3<T> : T extends HostModule$3<any, any> ? HostModuleAPI$3<T> : ConditionalExcept$3<{
|
|
2393
|
-
[Key in keyof T]: T[Key] extends Descriptors$3 ? BuildDescriptors$3<T[Key], H, [
|
|
2394
|
-
-1,
|
|
2395
|
-
0,
|
|
2396
|
-
1,
|
|
2397
|
-
2,
|
|
2398
|
-
3,
|
|
2399
|
-
4,
|
|
2400
|
-
5
|
|
2401
|
-
][Depth]> : never;
|
|
2402
|
-
}, EmptyObject$3>;
|
|
2403
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
2404
|
-
type PublicMetadata$3 = {
|
|
2405
|
-
PACKAGE_NAME?: string;
|
|
2406
|
-
};
|
|
2407
|
-
|
|
2408
|
-
declare global {
|
|
2409
|
-
interface ContextualClient {
|
|
2410
|
-
}
|
|
2125
|
+
interface V1Trigger {
|
|
2126
|
+
/** ID of the app that triggered the event */
|
|
2127
|
+
appId?: string;
|
|
2128
|
+
/** Type of activity that triggered the event */
|
|
2129
|
+
activityType?: string;
|
|
2411
2130
|
}
|
|
2412
|
-
|
|
2413
|
-
* A type used to create concerete types from SDK descriptors in
|
|
2414
|
-
* case a contextual client is available.
|
|
2415
|
-
*/
|
|
2416
|
-
type MaybeContext$3<T extends Descriptors$3> = globalThis.ContextualClient extends {
|
|
2417
|
-
host: Host$3;
|
|
2418
|
-
} ? BuildDescriptors$3<T, globalThis.ContextualClient['host']> : T;
|
|
2419
|
-
|
|
2420
|
-
interface ReferralEvent extends ReferralEventEventTypeOneOf {
|
|
2421
|
-
/** Event triggered when a referred friend signs up. */
|
|
2422
|
-
referredFriendSignupEvent?: ReferredFriendSignupEvent;
|
|
2423
|
-
/** Event triggered when a referral is successful. For example, customer places and pays for an order. */
|
|
2424
|
-
successfulReferralEvent?: V1SuccessfulReferralEvent;
|
|
2425
|
-
/** Event triggered when an action is performed. For example, placing an order. */
|
|
2426
|
-
actionEvent?: V1ActionEvent;
|
|
2427
|
-
/** Event triggered when a reward is given. */
|
|
2428
|
-
rewardEvent?: RewardEvent;
|
|
2429
|
-
/**
|
|
2430
|
-
* Referral event ID.
|
|
2431
|
-
* @readonly
|
|
2432
|
-
*/
|
|
2433
|
-
_id?: string | null;
|
|
2434
|
-
/**
|
|
2435
|
-
* Revision number, which increments by 1 each time the referral event is updated.
|
|
2436
|
-
* To prevent conflicting changes, the current revision must be passed when updating the referral event.
|
|
2437
|
-
*/
|
|
2438
|
-
revision?: string | null;
|
|
2439
|
-
/**
|
|
2440
|
-
* Date and time the referral event was created.
|
|
2441
|
-
* @readonly
|
|
2442
|
-
*/
|
|
2443
|
-
_createdDate?: Date;
|
|
2444
|
-
/**
|
|
2445
|
-
* Date and time the referral event was last updated.
|
|
2446
|
-
* @readonly
|
|
2447
|
-
*/
|
|
2448
|
-
_updatedDate?: Date;
|
|
2449
|
-
}
|
|
2450
|
-
/** @oneof */
|
|
2451
|
-
interface ReferralEventEventTypeOneOf {
|
|
2452
|
-
/** Event triggered when a referred friend signs up. */
|
|
2453
|
-
referredFriendSignupEvent?: ReferredFriendSignupEvent;
|
|
2454
|
-
/** Event triggered when a referral is successful. For example, customer places and pays for an order. */
|
|
2455
|
-
successfulReferralEvent?: V1SuccessfulReferralEvent;
|
|
2456
|
-
/** Event triggered when an action is performed. For example, placing an order. */
|
|
2457
|
-
actionEvent?: V1ActionEvent;
|
|
2458
|
-
/** Event triggered when a reward is given. */
|
|
2459
|
-
rewardEvent?: RewardEvent;
|
|
2460
|
-
}
|
|
2461
|
-
interface ReferredFriendSignupEvent {
|
|
2462
|
-
/** ID of the referred friend */
|
|
2463
|
-
referredFriendId?: string;
|
|
2464
|
-
}
|
|
2465
|
-
interface V1SuccessfulReferralEvent {
|
|
2466
|
-
/** ID of the referred friend */
|
|
2467
|
-
referredFriendId?: string;
|
|
2468
|
-
/** ID of the referring customer */
|
|
2469
|
-
referringCustomerId?: string;
|
|
2470
|
-
}
|
|
2471
|
-
interface V1ActionEvent {
|
|
2472
|
-
/** ID of the referred friend */
|
|
2473
|
-
referredFriendId?: string;
|
|
2474
|
-
/** ID of the referring customer */
|
|
2475
|
-
referringCustomerId?: string;
|
|
2476
|
-
/** Trigger for the action */
|
|
2477
|
-
trigger?: V1Trigger;
|
|
2478
|
-
/** Amount associated with the action. */
|
|
2479
|
-
amount?: string | null;
|
|
2480
|
-
/** Currency of the amount. */
|
|
2481
|
-
currency?: string | null;
|
|
2482
|
-
/** ID of the associated order. */
|
|
2483
|
-
orderId?: string | null;
|
|
2484
|
-
}
|
|
2485
|
-
interface V1Trigger {
|
|
2486
|
-
/** ID of the app that triggered the event */
|
|
2487
|
-
appId?: string;
|
|
2488
|
-
/** Type of activity that triggered the event */
|
|
2489
|
-
activityType?: string;
|
|
2490
|
-
}
|
|
2491
|
-
interface RewardEvent extends RewardEventReceiverOneOf {
|
|
2131
|
+
interface RewardEvent extends RewardEventReceiverOneOf {
|
|
2492
2132
|
/**
|
|
2493
2133
|
* ID of the rewarded referring customer.
|
|
2494
2134
|
* @readonly
|
|
@@ -2658,7 +2298,7 @@ interface ReferringCustomerTotal {
|
|
|
2658
2298
|
* Date and time of the last successful referral.
|
|
2659
2299
|
* @readonly
|
|
2660
2300
|
*/
|
|
2661
|
-
lastSuccessfulReferral?: Date;
|
|
2301
|
+
lastSuccessfulReferral?: Date | null;
|
|
2662
2302
|
/**
|
|
2663
2303
|
* Total number of successful referrals made by this customer.
|
|
2664
2304
|
* @readonly
|
|
@@ -2673,7 +2313,7 @@ interface ReferringCustomerTotal {
|
|
|
2673
2313
|
* Date and time of the last friend action.
|
|
2674
2314
|
* @readonly
|
|
2675
2315
|
*/
|
|
2676
|
-
lastFriendAction?: Date;
|
|
2316
|
+
lastFriendAction?: Date | null;
|
|
2677
2317
|
/**
|
|
2678
2318
|
* Number of friends who have completed actions.
|
|
2679
2319
|
* @readonly
|
|
@@ -2716,7 +2356,7 @@ interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneO
|
|
|
2716
2356
|
* Date and time of the first action.
|
|
2717
2357
|
* @readonly
|
|
2718
2358
|
*/
|
|
2719
|
-
actionDate?: Date;
|
|
2359
|
+
actionDate?: Date | null;
|
|
2720
2360
|
/** Type of issued reward. */
|
|
2721
2361
|
rewardType?: Reward$1;
|
|
2722
2362
|
/** Number of actions completed. */
|
|
@@ -2730,7 +2370,7 @@ interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneO
|
|
|
2730
2370
|
* Date and time of friend signup.
|
|
2731
2371
|
* @readonly
|
|
2732
2372
|
*/
|
|
2733
|
-
signupDate?: Date;
|
|
2373
|
+
signupDate?: Date | null;
|
|
2734
2374
|
}
|
|
2735
2375
|
/** @oneof */
|
|
2736
2376
|
interface ReferredFriendActionRewardTypeOptionsOneOf {
|
|
@@ -2897,7 +2537,7 @@ interface DomainEvent$3 extends DomainEventBodyOneOf$3 {
|
|
|
2897
2537
|
/** ID of the entity associated with the event. */
|
|
2898
2538
|
entityId?: string;
|
|
2899
2539
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
2900
|
-
eventTime?: Date;
|
|
2540
|
+
eventTime?: Date | null;
|
|
2901
2541
|
/**
|
|
2902
2542
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
2903
2543
|
* (for example, GDPR).
|
|
@@ -2926,7 +2566,7 @@ interface EntityCreatedEvent$3 {
|
|
|
2926
2566
|
entity?: string;
|
|
2927
2567
|
}
|
|
2928
2568
|
interface RestoreInfo$3 {
|
|
2929
|
-
deletedDate?: Date;
|
|
2569
|
+
deletedDate?: Date | null;
|
|
2930
2570
|
}
|
|
2931
2571
|
interface EntityUpdatedEvent$3 {
|
|
2932
2572
|
/**
|
|
@@ -3145,7 +2785,7 @@ interface EventMetadata$2 extends BaseEventMetadata$2 {
|
|
|
3145
2785
|
/** ID of the entity associated with the event. */
|
|
3146
2786
|
entityId?: string;
|
|
3147
2787
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
3148
|
-
eventTime?: Date;
|
|
2788
|
+
eventTime?: Date | null;
|
|
3149
2789
|
/**
|
|
3150
2790
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
3151
2791
|
* (for example, GDPR).
|
|
@@ -3252,7 +2892,7 @@ interface QueryReferredFriendActionsOptions {
|
|
|
3252
2892
|
contactIds?: string[];
|
|
3253
2893
|
}
|
|
3254
2894
|
|
|
3255
|
-
declare function getReferralEvent$1(httpClient: HttpClient
|
|
2895
|
+
declare function getReferralEvent$1(httpClient: HttpClient): GetReferralEventSignature;
|
|
3256
2896
|
interface GetReferralEventSignature {
|
|
3257
2897
|
/**
|
|
3258
2898
|
* Retrieves a referral event by ID.
|
|
@@ -3261,7 +2901,7 @@ interface GetReferralEventSignature {
|
|
|
3261
2901
|
*/
|
|
3262
2902
|
(referralEventId: string): Promise<ReferralEvent & ReferralEventNonNullableFields>;
|
|
3263
2903
|
}
|
|
3264
|
-
declare function queryReferralEvent$1(httpClient: HttpClient
|
|
2904
|
+
declare function queryReferralEvent$1(httpClient: HttpClient): QueryReferralEventSignature;
|
|
3265
2905
|
interface QueryReferralEventSignature {
|
|
3266
2906
|
/**
|
|
3267
2907
|
* Retrieves a list of referral events, given the provided paging, filtering, and sorting.
|
|
@@ -3273,14 +2913,14 @@ interface QueryReferralEventSignature {
|
|
|
3273
2913
|
*/
|
|
3274
2914
|
(): ReferralEventsQueryBuilder;
|
|
3275
2915
|
}
|
|
3276
|
-
declare function getReferralStatistics$1(httpClient: HttpClient
|
|
2916
|
+
declare function getReferralStatistics$1(httpClient: HttpClient): GetReferralStatisticsSignature;
|
|
3277
2917
|
interface GetReferralStatisticsSignature {
|
|
3278
2918
|
/**
|
|
3279
2919
|
* Retrieves referral statistics.
|
|
3280
2920
|
*/
|
|
3281
2921
|
(): Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
|
|
3282
2922
|
}
|
|
3283
|
-
declare function queryReferringCustomerTotals$1(httpClient: HttpClient
|
|
2923
|
+
declare function queryReferringCustomerTotals$1(httpClient: HttpClient): QueryReferringCustomerTotalsSignature;
|
|
3284
2924
|
interface QueryReferringCustomerTotalsSignature {
|
|
3285
2925
|
/**
|
|
3286
2926
|
* Retrieves a list of referring customer totals, given the provided paging, filtering, and sorting.
|
|
@@ -3292,7 +2932,7 @@ interface QueryReferringCustomerTotalsSignature {
|
|
|
3292
2932
|
*/
|
|
3293
2933
|
(options?: QueryReferringCustomerTotalsOptions | undefined): Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
|
|
3294
2934
|
}
|
|
3295
|
-
declare function queryReferredFriendActions$1(httpClient: HttpClient
|
|
2935
|
+
declare function queryReferredFriendActions$1(httpClient: HttpClient): QueryReferredFriendActionsSignature;
|
|
3296
2936
|
interface QueryReferredFriendActionsSignature {
|
|
3297
2937
|
/**
|
|
3298
2938
|
* Retrieves a list of referred friend actions, given the provided paging, filtering, and sorting.
|
|
@@ -3304,33 +2944,15 @@ interface QueryReferredFriendActionsSignature {
|
|
|
3304
2944
|
*/
|
|
3305
2945
|
(options?: QueryReferredFriendActionsOptions | undefined): Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
|
|
3306
2946
|
}
|
|
3307
|
-
declare const onReferralEventCreated$1: EventDefinition
|
|
3308
|
-
|
|
3309
|
-
type EventDefinition$5<Payload = unknown, Type extends string = string> = {
|
|
3310
|
-
__type: 'event-definition';
|
|
3311
|
-
type: Type;
|
|
3312
|
-
isDomainEvent?: boolean;
|
|
3313
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3314
|
-
__payload: Payload;
|
|
3315
|
-
};
|
|
3316
|
-
declare function EventDefinition$5<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$5<Payload, Type>;
|
|
3317
|
-
type EventHandler$5<T extends EventDefinition$5> = (payload: T['__payload']) => void | Promise<void>;
|
|
3318
|
-
type BuildEventDefinition$5<T extends EventDefinition$5<any, string>> = (handler: EventHandler$5<T>) => void;
|
|
3319
|
-
|
|
3320
|
-
declare global {
|
|
3321
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3322
|
-
interface SymbolConstructor {
|
|
3323
|
-
readonly observable: symbol;
|
|
3324
|
-
}
|
|
3325
|
-
}
|
|
2947
|
+
declare const onReferralEventCreated$1: EventDefinition<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
|
|
3326
2948
|
|
|
3327
|
-
declare function createEventModule$2<T extends EventDefinition
|
|
2949
|
+
declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
3328
2950
|
|
|
3329
|
-
declare const getReferralEvent: MaybeContext
|
|
3330
|
-
declare const queryReferralEvent: MaybeContext
|
|
3331
|
-
declare const getReferralStatistics: MaybeContext
|
|
3332
|
-
declare const queryReferringCustomerTotals: MaybeContext
|
|
3333
|
-
declare const queryReferredFriendActions: MaybeContext
|
|
2951
|
+
declare const getReferralEvent: MaybeContext<BuildRESTFunction<typeof getReferralEvent$1> & typeof getReferralEvent$1>;
|
|
2952
|
+
declare const queryReferralEvent: MaybeContext<BuildRESTFunction<typeof queryReferralEvent$1> & typeof queryReferralEvent$1>;
|
|
2953
|
+
declare const getReferralStatistics: MaybeContext<BuildRESTFunction<typeof getReferralStatistics$1> & typeof getReferralStatistics$1>;
|
|
2954
|
+
declare const queryReferringCustomerTotals: MaybeContext<BuildRESTFunction<typeof queryReferringCustomerTotals$1> & typeof queryReferringCustomerTotals$1>;
|
|
2955
|
+
declare const queryReferredFriendActions: MaybeContext<BuildRESTFunction<typeof queryReferredFriendActions$1> & typeof queryReferredFriendActions$1>;
|
|
3334
2956
|
|
|
3335
2957
|
type _publicOnReferralEventCreatedType = typeof onReferralEventCreated$1;
|
|
3336
2958
|
/** */
|
|
@@ -3383,505 +3005,95 @@ declare namespace index_d$3 {
|
|
|
3383
3005
|
export { type ActionEvent$3 as ActionEvent, type BaseEventMetadata$2 as BaseEventMetadata, type Coupon$1 as Coupon, type CouponDiscountTypeOptionsOneOf$1 as CouponDiscountTypeOptionsOneOf, type CouponScope$1 as CouponScope, type CouponScopeOrMinSubtotalOneOf$1 as CouponScopeOrMinSubtotalOneOf, type index_d$3_CreateReferralEventRequest as CreateReferralEventRequest, type index_d$3_CreateReferralEventResponse as CreateReferralEventResponse, type CursorPaging$3 as CursorPaging, type CursorPagingMetadata$3 as CursorPagingMetadata, type CursorQuery$3 as CursorQuery, type CursorQueryPagingMethodOneOf$3 as CursorQueryPagingMethodOneOf, type Cursors$3 as Cursors, DiscountType$1 as DiscountType, type DomainEvent$3 as DomainEvent, type DomainEventBodyOneOf$3 as DomainEventBodyOneOf, type Empty$2 as Empty, type EntityCreatedEvent$3 as EntityCreatedEvent, type EntityDeletedEvent$3 as EntityDeletedEvent, type EntityUpdatedEvent$3 as EntityUpdatedEvent, type EventMetadata$2 as EventMetadata, type FixedAmountDiscount$1 as FixedAmountDiscount, type index_d$3_GetReferralEventRequest as GetReferralEventRequest, type index_d$3_GetReferralEventResponse as GetReferralEventResponse, type index_d$3_GetReferralEventResponseNonNullableFields as GetReferralEventResponseNonNullableFields, type index_d$3_GetReferralStatisticsRequest as GetReferralStatisticsRequest, type index_d$3_GetReferralStatisticsResponse as GetReferralStatisticsResponse, type index_d$3_GetReferralStatisticsResponseNonNullableFields as GetReferralStatisticsResponseNonNullableFields, type Group$1 as Group, type IdentificationData$3 as IdentificationData, type IdentificationDataIdOneOf$3 as IdentificationDataIdOneOf, type LoyaltyPoints$1 as LoyaltyPoints, type MessageEnvelope$3 as MessageEnvelope, type PercentageDiscount$1 as PercentageDiscount, type index_d$3_QueryReferralEventRequest as QueryReferralEventRequest, type index_d$3_QueryReferralEventResponse as QueryReferralEventResponse, type index_d$3_QueryReferralEventResponseNonNullableFields as QueryReferralEventResponseNonNullableFields, type index_d$3_QueryReferredFriendActionsOptions as QueryReferredFriendActionsOptions, type index_d$3_QueryReferredFriendActionsRequest as QueryReferredFriendActionsRequest, type index_d$3_QueryReferredFriendActionsResponse as QueryReferredFriendActionsResponse, type index_d$3_QueryReferredFriendActionsResponseNonNullableFields as QueryReferredFriendActionsResponseNonNullableFields, type index_d$3_QueryReferringCustomerTotalsOptions as QueryReferringCustomerTotalsOptions, type index_d$3_QueryReferringCustomerTotalsRequest as QueryReferringCustomerTotalsRequest, type index_d$3_QueryReferringCustomerTotalsResponse as QueryReferringCustomerTotalsResponse, type index_d$3_QueryReferringCustomerTotalsResponseNonNullableFields as QueryReferringCustomerTotalsResponseNonNullableFields, type index_d$3_ReferralEvent as ReferralEvent, type index_d$3_ReferralEventCreatedEnvelope as ReferralEventCreatedEnvelope, type index_d$3_ReferralEventEventTypeOneOf as ReferralEventEventTypeOneOf, type index_d$3_ReferralEventNonNullableFields as ReferralEventNonNullableFields, type index_d$3_ReferralEventsQueryBuilder as ReferralEventsQueryBuilder, type index_d$3_ReferralEventsQueryResult as ReferralEventsQueryResult, type index_d$3_ReferredFriendAction as ReferredFriendAction, type index_d$3_ReferredFriendActionEvent as ReferredFriendActionEvent, type index_d$3_ReferredFriendActionRewardTypeOptionsOneOf as ReferredFriendActionRewardTypeOptionsOneOf, type ReferredFriendDetails$2 as ReferredFriendDetails, type index_d$3_ReferredFriendSignupEvent as ReferredFriendSignupEvent, type index_d$3_ReferringCustomerTotal as ReferringCustomerTotal, type RestoreInfo$3 as RestoreInfo, Reward$1 as Reward, type index_d$3_RewardEvent as RewardEvent, type index_d$3_RewardEventReceiverOneOf as RewardEventReceiverOneOf, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, Status$2 as Status, type SuccessfulReferralEvent$2 as SuccessfulReferralEvent, type index_d$3_Trigger as Trigger, type index_d$3_V1ActionEvent as V1ActionEvent, type V1Coupon$1 as V1Coupon, type index_d$3_V1SuccessfulReferralEvent as V1SuccessfulReferralEvent, type index_d$3_V1Trigger as V1Trigger, WebhookIdentityType$3 as WebhookIdentityType, type index_d$3__publicOnReferralEventCreatedType as _publicOnReferralEventCreatedType, index_d$3_getReferralEvent as getReferralEvent, index_d$3_getReferralStatistics as getReferralStatistics, index_d$3_onReferralEventCreated as onReferralEventCreated, onReferralEventCreated$1 as publicOnReferralEventCreated, index_d$3_queryReferralEvent as queryReferralEvent, index_d$3_queryReferredFriendActions as queryReferredFriendActions, index_d$3_queryReferringCustomerTotals as queryReferringCustomerTotals };
|
|
3384
3006
|
}
|
|
3385
3007
|
|
|
3386
|
-
|
|
3387
|
-
__type: 'host';
|
|
3388
|
-
create(host: H): T;
|
|
3389
|
-
};
|
|
3390
|
-
type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
|
|
3391
|
-
type Host$2<Environment = unknown> = {
|
|
3392
|
-
channel: {
|
|
3393
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
3394
|
-
disconnect: () => void;
|
|
3395
|
-
} | Promise<{
|
|
3396
|
-
disconnect: () => void;
|
|
3397
|
-
}>;
|
|
3398
|
-
};
|
|
3399
|
-
environment?: Environment;
|
|
3008
|
+
interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
|
|
3400
3009
|
/**
|
|
3401
|
-
*
|
|
3010
|
+
* ID of the referring customer who received the reward.
|
|
3011
|
+
* @readonly
|
|
3402
3012
|
*/
|
|
3403
|
-
|
|
3013
|
+
rewardedReferringCustomerId?: string;
|
|
3404
3014
|
/**
|
|
3405
|
-
*
|
|
3406
|
-
*
|
|
3015
|
+
* ID of the referred friend who received the reward.
|
|
3016
|
+
* @readonly
|
|
3407
3017
|
*/
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3018
|
+
rewardedReferredFriendId?: string;
|
|
3019
|
+
/** Details of a coupon reward. Present when `reward_type` is `COUPON`. */
|
|
3020
|
+
coupon?: V1Coupon;
|
|
3021
|
+
/** Details of a loyalty points reward. Present when `reward_type` is `LOYALTY_POINTS`. */
|
|
3022
|
+
loyaltyPoints?: V1LoyaltyPoints;
|
|
3023
|
+
/**
|
|
3024
|
+
* Referral reward ID.
|
|
3025
|
+
* @readonly
|
|
3026
|
+
*/
|
|
3027
|
+
_id?: string | null;
|
|
3028
|
+
/**
|
|
3029
|
+
* Revision number, which increments by 1 each time the referral reward is updated.
|
|
3030
|
+
* To prevent conflicting changes, the current revision must be passed when updating the referral reward.
|
|
3031
|
+
*/
|
|
3032
|
+
revision?: string | null;
|
|
3033
|
+
/**
|
|
3034
|
+
* Date and time the referral reward was created.
|
|
3035
|
+
* @readonly
|
|
3036
|
+
*/
|
|
3037
|
+
_createdDate?: Date | null;
|
|
3038
|
+
/**
|
|
3039
|
+
* Date and time the referral reward was last updated.
|
|
3040
|
+
* @readonly
|
|
3041
|
+
*/
|
|
3042
|
+
_updatedDate?: Date | null;
|
|
3043
|
+
/**
|
|
3044
|
+
* Type of reward given.
|
|
3045
|
+
*
|
|
3046
|
+
* Possible values:
|
|
3047
|
+
* - `UNKNOWN`: Unknown reward.
|
|
3048
|
+
* - `COUPON`: A loyalty coupon is given.
|
|
3049
|
+
* - `LOYALTY_POINTS`: Loyalty points are awarded.
|
|
3050
|
+
* - `NOTHING`: No reward is given.
|
|
3051
|
+
*/
|
|
3052
|
+
rewardType?: RewardTypeType;
|
|
3430
3053
|
}
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3434
|
-
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
params?: URLSearchParams;
|
|
3444
|
-
} & APIMetadata$2;
|
|
3445
|
-
type APIMetadata$2 = {
|
|
3446
|
-
methodFqn?: string;
|
|
3447
|
-
entityFqdn?: string;
|
|
3448
|
-
packageName?: string;
|
|
3449
|
-
};
|
|
3450
|
-
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
3451
|
-
type EventDefinition$4<Payload = unknown, Type extends string = string> = {
|
|
3452
|
-
__type: 'event-definition';
|
|
3453
|
-
type: Type;
|
|
3454
|
-
isDomainEvent?: boolean;
|
|
3455
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3456
|
-
__payload: Payload;
|
|
3457
|
-
};
|
|
3458
|
-
declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
3459
|
-
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
3460
|
-
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
3461
|
-
|
|
3462
|
-
type ServicePluginMethodInput$2 = {
|
|
3463
|
-
request: any;
|
|
3464
|
-
metadata: any;
|
|
3465
|
-
};
|
|
3466
|
-
type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
|
|
3467
|
-
type ServicePluginMethodMetadata$2 = {
|
|
3468
|
-
name: string;
|
|
3469
|
-
primaryHttpMappingPath: string;
|
|
3470
|
-
transformations: {
|
|
3471
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
|
|
3472
|
-
toREST: (...args: unknown[]) => unknown;
|
|
3473
|
-
};
|
|
3474
|
-
};
|
|
3475
|
-
type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
|
|
3476
|
-
__type: 'service-plugin-definition';
|
|
3477
|
-
componentType: string;
|
|
3478
|
-
methods: ServicePluginMethodMetadata$2[];
|
|
3479
|
-
__contract: Contract;
|
|
3480
|
-
};
|
|
3481
|
-
declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
|
|
3482
|
-
type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
|
|
3483
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
|
|
3484
|
-
|
|
3485
|
-
type RequestContext$2 = {
|
|
3486
|
-
isSSR: boolean;
|
|
3487
|
-
host: string;
|
|
3488
|
-
protocol?: string;
|
|
3489
|
-
};
|
|
3490
|
-
type ResponseTransformer$2 = (data: any, headers?: any) => any;
|
|
3491
|
-
/**
|
|
3492
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
3493
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
3494
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
3495
|
-
*/
|
|
3496
|
-
type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
3497
|
-
type AmbassadorRequestOptions$2<T = any> = {
|
|
3498
|
-
_?: T;
|
|
3499
|
-
url?: string;
|
|
3500
|
-
method?: Method$2;
|
|
3501
|
-
params?: any;
|
|
3502
|
-
data?: any;
|
|
3503
|
-
transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
|
|
3504
|
-
};
|
|
3505
|
-
type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
|
|
3506
|
-
__isAmbassador: boolean;
|
|
3507
|
-
};
|
|
3508
|
-
type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
|
|
3509
|
-
type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
3510
|
-
|
|
3511
|
-
declare global {
|
|
3512
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3513
|
-
interface SymbolConstructor {
|
|
3514
|
-
readonly observable: symbol;
|
|
3515
|
-
}
|
|
3054
|
+
/** @oneof */
|
|
3055
|
+
interface ReferralRewardReceiverOneOf {
|
|
3056
|
+
/**
|
|
3057
|
+
* ID of the referring customer who received the reward.
|
|
3058
|
+
* @readonly
|
|
3059
|
+
*/
|
|
3060
|
+
rewardedReferringCustomerId?: string;
|
|
3061
|
+
/**
|
|
3062
|
+
* ID of the referred friend who received the reward.
|
|
3063
|
+
* @readonly
|
|
3064
|
+
*/
|
|
3065
|
+
rewardedReferredFriendId?: string;
|
|
3516
3066
|
}
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
/**
|
|
3521
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
3522
|
-
|
|
3523
|
-
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)).
|
|
3524
|
-
|
|
3525
|
-
@example
|
|
3526
|
-
```
|
|
3527
|
-
import type {EmptyObject} from 'type-fest';
|
|
3528
|
-
|
|
3529
|
-
// The following illustrates the problem with `{}`.
|
|
3530
|
-
const foo1: {} = {}; // Pass
|
|
3531
|
-
const foo2: {} = []; // Pass
|
|
3532
|
-
const foo3: {} = 42; // Pass
|
|
3533
|
-
const foo4: {} = {a: 1}; // Pass
|
|
3534
|
-
|
|
3535
|
-
// With `EmptyObject` only the first case is valid.
|
|
3536
|
-
const bar1: EmptyObject = {}; // Pass
|
|
3537
|
-
const bar2: EmptyObject = 42; // Fail
|
|
3538
|
-
const bar3: EmptyObject = []; // Fail
|
|
3539
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
3540
|
-
```
|
|
3541
|
-
|
|
3542
|
-
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}.
|
|
3543
|
-
|
|
3544
|
-
@category Object
|
|
3545
|
-
*/
|
|
3546
|
-
type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
|
|
3547
|
-
|
|
3548
|
-
/**
|
|
3549
|
-
Returns a boolean for whether the two given types are equal.
|
|
3550
|
-
|
|
3551
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
3552
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
3553
|
-
|
|
3554
|
-
Use-cases:
|
|
3555
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
3556
|
-
|
|
3557
|
-
@example
|
|
3558
|
-
```
|
|
3559
|
-
import type {IsEqual} from 'type-fest';
|
|
3560
|
-
|
|
3561
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
3562
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
3563
|
-
type Includes<Value extends readonly any[], Item> =
|
|
3564
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
3565
|
-
? IsEqual<Value[0], Item> extends true
|
|
3566
|
-
? true
|
|
3567
|
-
: Includes<rest, Item>
|
|
3568
|
-
: false;
|
|
3569
|
-
```
|
|
3570
|
-
|
|
3571
|
-
@category Type Guard
|
|
3572
|
-
@category Utilities
|
|
3573
|
-
*/
|
|
3574
|
-
type IsEqual$2<A, B> =
|
|
3575
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
3576
|
-
(<G>() => G extends B ? 1 : 2)
|
|
3577
|
-
? true
|
|
3578
|
-
: false;
|
|
3579
|
-
|
|
3580
|
-
/**
|
|
3581
|
-
Filter out keys from an object.
|
|
3582
|
-
|
|
3583
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
3584
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
3585
|
-
Returns `Key` otherwise.
|
|
3586
|
-
|
|
3587
|
-
@example
|
|
3588
|
-
```
|
|
3589
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
3590
|
-
//=> never
|
|
3591
|
-
```
|
|
3592
|
-
|
|
3593
|
-
@example
|
|
3594
|
-
```
|
|
3595
|
-
type Filtered = Filter<'bar', string>;
|
|
3596
|
-
//=> never
|
|
3597
|
-
```
|
|
3598
|
-
|
|
3599
|
-
@example
|
|
3600
|
-
```
|
|
3601
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
3602
|
-
//=> 'bar'
|
|
3603
|
-
```
|
|
3604
|
-
|
|
3605
|
-
@see {Except}
|
|
3606
|
-
*/
|
|
3607
|
-
type Filter$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
3608
|
-
|
|
3609
|
-
type ExceptOptions$2 = {
|
|
3610
|
-
/**
|
|
3611
|
-
Disallow assigning non-specified properties.
|
|
3612
|
-
|
|
3613
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
3614
|
-
|
|
3615
|
-
@default false
|
|
3616
|
-
*/
|
|
3617
|
-
requireExactProps?: boolean;
|
|
3618
|
-
};
|
|
3619
|
-
|
|
3620
|
-
/**
|
|
3621
|
-
Create a type from an object type without certain keys.
|
|
3622
|
-
|
|
3623
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
3624
|
-
|
|
3625
|
-
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.
|
|
3626
|
-
|
|
3627
|
-
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)).
|
|
3628
|
-
|
|
3629
|
-
@example
|
|
3630
|
-
```
|
|
3631
|
-
import type {Except} from 'type-fest';
|
|
3632
|
-
|
|
3633
|
-
type Foo = {
|
|
3634
|
-
a: number;
|
|
3635
|
-
b: string;
|
|
3636
|
-
};
|
|
3637
|
-
|
|
3638
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
3639
|
-
//=> {b: string}
|
|
3640
|
-
|
|
3641
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
3642
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
3643
|
-
|
|
3644
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
3645
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
3646
|
-
|
|
3647
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
3648
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
3649
|
-
```
|
|
3650
|
-
|
|
3651
|
-
@category Object
|
|
3652
|
-
*/
|
|
3653
|
-
type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
|
|
3654
|
-
[KeyType in keyof ObjectType as Filter$2<KeyType, KeysType>]: ObjectType[KeyType];
|
|
3655
|
-
} & (Options['requireExactProps'] extends true
|
|
3656
|
-
? Partial<Record<KeysType, never>>
|
|
3657
|
-
: {});
|
|
3658
|
-
|
|
3659
|
-
/**
|
|
3660
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
3661
|
-
|
|
3662
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
3663
|
-
|
|
3664
|
-
@example
|
|
3665
|
-
```
|
|
3666
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
3667
|
-
|
|
3668
|
-
interface Example {
|
|
3669
|
-
a: string;
|
|
3670
|
-
b: string | number;
|
|
3671
|
-
c?: string;
|
|
3672
|
-
d: {};
|
|
3673
|
-
}
|
|
3674
|
-
|
|
3675
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
3676
|
-
//=> 'a'
|
|
3677
|
-
```
|
|
3678
|
-
|
|
3679
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
3680
|
-
|
|
3681
|
-
@example
|
|
3682
|
-
```
|
|
3683
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
3684
|
-
|
|
3685
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
3686
|
-
//=> 'a' | 'c'
|
|
3687
|
-
```
|
|
3688
|
-
|
|
3689
|
-
@category Object
|
|
3690
|
-
*/
|
|
3691
|
-
type ConditionalKeys$2<Base, Condition> = NonNullable<
|
|
3692
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
3693
|
-
{
|
|
3694
|
-
// Map through all the keys of the given base type.
|
|
3695
|
-
[Key in keyof Base]:
|
|
3696
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
3697
|
-
Base[Key] extends Condition
|
|
3698
|
-
// Retain this key since the condition passes.
|
|
3699
|
-
? Key
|
|
3700
|
-
// Discard this key since the condition fails.
|
|
3701
|
-
: never;
|
|
3702
|
-
|
|
3703
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
3704
|
-
}[keyof Base]
|
|
3705
|
-
>;
|
|
3706
|
-
|
|
3707
|
-
/**
|
|
3708
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
3709
|
-
|
|
3710
|
-
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.
|
|
3711
|
-
|
|
3712
|
-
@example
|
|
3713
|
-
```
|
|
3714
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
3715
|
-
|
|
3716
|
-
class Awesome {
|
|
3717
|
-
name: string;
|
|
3718
|
-
successes: number;
|
|
3719
|
-
failures: bigint;
|
|
3720
|
-
|
|
3721
|
-
run() {}
|
|
3722
|
-
}
|
|
3723
|
-
|
|
3724
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
3725
|
-
//=> {run: () => void}
|
|
3726
|
-
```
|
|
3727
|
-
|
|
3728
|
-
@example
|
|
3729
|
-
```
|
|
3730
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
3731
|
-
|
|
3732
|
-
interface Example {
|
|
3733
|
-
a: string;
|
|
3734
|
-
b: string | number;
|
|
3735
|
-
c: () => void;
|
|
3736
|
-
d: {};
|
|
3737
|
-
}
|
|
3738
|
-
|
|
3739
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
3740
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
3741
|
-
```
|
|
3742
|
-
|
|
3743
|
-
@category Object
|
|
3744
|
-
*/
|
|
3745
|
-
type ConditionalExcept$2<Base, Condition> = Except$2<
|
|
3746
|
-
Base,
|
|
3747
|
-
ConditionalKeys$2<Base, Condition>
|
|
3748
|
-
>;
|
|
3749
|
-
|
|
3750
|
-
/**
|
|
3751
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
3752
|
-
* can either be a REST module or a host module.
|
|
3753
|
-
* This type is recursive, so it can describe nested modules.
|
|
3754
|
-
*/
|
|
3755
|
-
type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$4<any> | ServicePluginDefinition$2<any> | {
|
|
3756
|
-
[key: string]: Descriptors$2 | PublicMetadata$2 | any;
|
|
3757
|
-
};
|
|
3758
|
-
/**
|
|
3759
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
3760
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
3761
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
3762
|
-
* do not match the given host (as they will not work with the given host).
|
|
3763
|
-
*/
|
|
3764
|
-
type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
|
|
3765
|
-
done: T;
|
|
3766
|
-
recurse: T extends {
|
|
3767
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
|
|
3768
|
-
} ? never : T extends AmbassadorFunctionDescriptor$2 ? BuildAmbassadorFunction$2<T> : T extends RESTFunctionDescriptor$2 ? BuildRESTFunction$2<T> : T extends EventDefinition$4<any> ? BuildEventDefinition$4<T> : T extends ServicePluginDefinition$2<any> ? BuildServicePluginDefinition$2<T> : T extends HostModule$2<any, any> ? HostModuleAPI$2<T> : ConditionalExcept$2<{
|
|
3769
|
-
[Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
|
|
3770
|
-
-1,
|
|
3771
|
-
0,
|
|
3772
|
-
1,
|
|
3773
|
-
2,
|
|
3774
|
-
3,
|
|
3775
|
-
4,
|
|
3776
|
-
5
|
|
3777
|
-
][Depth]> : never;
|
|
3778
|
-
}, EmptyObject$2>;
|
|
3779
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
3780
|
-
type PublicMetadata$2 = {
|
|
3781
|
-
PACKAGE_NAME?: string;
|
|
3782
|
-
};
|
|
3783
|
-
|
|
3784
|
-
declare global {
|
|
3785
|
-
interface ContextualClient {
|
|
3786
|
-
}
|
|
3787
|
-
}
|
|
3788
|
-
/**
|
|
3789
|
-
* A type used to create concerete types from SDK descriptors in
|
|
3790
|
-
* case a contextual client is available.
|
|
3791
|
-
*/
|
|
3792
|
-
type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
|
|
3793
|
-
host: Host$2;
|
|
3794
|
-
} ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
|
|
3795
|
-
|
|
3796
|
-
interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
|
|
3797
|
-
/**
|
|
3798
|
-
* ID of the referring customer who received the reward.
|
|
3799
|
-
* @readonly
|
|
3800
|
-
*/
|
|
3801
|
-
rewardedReferringCustomerId?: string;
|
|
3802
|
-
/**
|
|
3803
|
-
* ID of the referred friend who received the reward.
|
|
3804
|
-
* @readonly
|
|
3805
|
-
*/
|
|
3806
|
-
rewardedReferredFriendId?: string;
|
|
3067
|
+
/** @oneof */
|
|
3068
|
+
interface ReferralRewardRewardTypeOptionsOneOf {
|
|
3807
3069
|
/** Details of a coupon reward. Present when `reward_type` is `COUPON`. */
|
|
3808
3070
|
coupon?: V1Coupon;
|
|
3809
3071
|
/** Details of a loyalty points reward. Present when `reward_type` is `LOYALTY_POINTS`. */
|
|
3810
3072
|
loyaltyPoints?: V1LoyaltyPoints;
|
|
3073
|
+
}
|
|
3074
|
+
declare enum RewardTypeType {
|
|
3075
|
+
/** Unknown reward. */
|
|
3076
|
+
UNKNOWN = "UNKNOWN",
|
|
3077
|
+
/** A loyalty coupon is given. */
|
|
3078
|
+
COUPON = "COUPON",
|
|
3079
|
+
/** Loyalty points are awarded. */
|
|
3080
|
+
LOYALTY_POINTS = "LOYALTY_POINTS",
|
|
3081
|
+
/** No reward is given. */
|
|
3082
|
+
NOTHING = "NOTHING"
|
|
3083
|
+
}
|
|
3084
|
+
interface V1Coupon {
|
|
3811
3085
|
/**
|
|
3812
|
-
*
|
|
3813
|
-
* @readonly
|
|
3814
|
-
*/
|
|
3815
|
-
_id?: string | null;
|
|
3816
|
-
/**
|
|
3817
|
-
* Revision number, which increments by 1 each time the referral reward is updated.
|
|
3818
|
-
* To prevent conflicting changes, the current revision must be passed when updating the referral reward.
|
|
3819
|
-
*/
|
|
3820
|
-
revision?: string | null;
|
|
3821
|
-
/**
|
|
3822
|
-
* Date and time the referral reward was created.
|
|
3086
|
+
* Coupon ID. Example: `8934b045-7052-4a90-be2b-832c70afc9da`.
|
|
3823
3087
|
* @readonly
|
|
3824
3088
|
*/
|
|
3825
|
-
|
|
3089
|
+
_id?: string;
|
|
3826
3090
|
/**
|
|
3827
|
-
*
|
|
3091
|
+
* The code that customers can use to apply the coupon. Example: `6RFD2A3HSPXW`.
|
|
3828
3092
|
* @readonly
|
|
3829
3093
|
*/
|
|
3830
|
-
|
|
3094
|
+
code?: string;
|
|
3831
3095
|
/**
|
|
3832
|
-
*
|
|
3833
|
-
*
|
|
3834
|
-
* Possible values:
|
|
3835
|
-
* - `UNKNOWN`: Unknown reward.
|
|
3836
|
-
* - `COUPON`: A loyalty coupon is given.
|
|
3837
|
-
* - `LOYALTY_POINTS`: Loyalty points are awarded.
|
|
3838
|
-
* - `NOTHING`: No reward is given.
|
|
3839
|
-
*/
|
|
3840
|
-
rewardType?: RewardTypeType;
|
|
3841
|
-
}
|
|
3842
|
-
/** @oneof */
|
|
3843
|
-
interface ReferralRewardReceiverOneOf {
|
|
3844
|
-
/**
|
|
3845
|
-
* ID of the referring customer who received the reward.
|
|
3846
|
-
* @readonly
|
|
3847
|
-
*/
|
|
3848
|
-
rewardedReferringCustomerId?: string;
|
|
3849
|
-
/**
|
|
3850
|
-
* ID of the referred friend who received the reward.
|
|
3851
|
-
* @readonly
|
|
3852
|
-
*/
|
|
3853
|
-
rewardedReferredFriendId?: string;
|
|
3854
|
-
}
|
|
3855
|
-
/** @oneof */
|
|
3856
|
-
interface ReferralRewardRewardTypeOptionsOneOf {
|
|
3857
|
-
/** Details of a coupon reward. Present when `reward_type` is `COUPON`. */
|
|
3858
|
-
coupon?: V1Coupon;
|
|
3859
|
-
/** Details of a loyalty points reward. Present when `reward_type` is `LOYALTY_POINTS`. */
|
|
3860
|
-
loyaltyPoints?: V1LoyaltyPoints;
|
|
3861
|
-
}
|
|
3862
|
-
declare enum RewardTypeType {
|
|
3863
|
-
/** Unknown reward. */
|
|
3864
|
-
UNKNOWN = "UNKNOWN",
|
|
3865
|
-
/** A loyalty coupon is given. */
|
|
3866
|
-
COUPON = "COUPON",
|
|
3867
|
-
/** Loyalty points are awarded. */
|
|
3868
|
-
LOYALTY_POINTS = "LOYALTY_POINTS",
|
|
3869
|
-
/** No reward is given. */
|
|
3870
|
-
NOTHING = "NOTHING"
|
|
3871
|
-
}
|
|
3872
|
-
interface V1Coupon {
|
|
3873
|
-
/**
|
|
3874
|
-
* Coupon ID. Example: `8934b045-7052-4a90-be2b-832c70afc9da`.
|
|
3875
|
-
* @readonly
|
|
3876
|
-
*/
|
|
3877
|
-
_id?: string;
|
|
3878
|
-
/**
|
|
3879
|
-
* The code that customers can use to apply the coupon. Example: `6RFD2A3HSPXW`.
|
|
3880
|
-
* @readonly
|
|
3881
|
-
*/
|
|
3882
|
-
code?: string;
|
|
3883
|
-
/**
|
|
3884
|
-
* Current status of the coupon.
|
|
3096
|
+
* Current status of the coupon.
|
|
3885
3097
|
*
|
|
3886
3098
|
* Possible values:
|
|
3887
3099
|
*
|
|
@@ -4163,7 +3375,7 @@ interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
|
|
|
4163
3375
|
/** ID of the entity associated with the event. */
|
|
4164
3376
|
entityId?: string;
|
|
4165
3377
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
4166
|
-
eventTime?: Date;
|
|
3378
|
+
eventTime?: Date | null;
|
|
4167
3379
|
/**
|
|
4168
3380
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
4169
3381
|
* (for example, GDPR).
|
|
@@ -4192,7 +3404,7 @@ interface EntityCreatedEvent$2 {
|
|
|
4192
3404
|
entity?: string;
|
|
4193
3405
|
}
|
|
4194
3406
|
interface RestoreInfo$2 {
|
|
4195
|
-
deletedDate?: Date;
|
|
3407
|
+
deletedDate?: Date | null;
|
|
4196
3408
|
}
|
|
4197
3409
|
interface EntityUpdatedEvent$2 {
|
|
4198
3410
|
/**
|
|
@@ -4398,7 +3610,7 @@ interface ReferralRewardsQueryBuilder {
|
|
|
4398
3610
|
find: () => Promise<ReferralRewardsQueryResult>;
|
|
4399
3611
|
}
|
|
4400
3612
|
|
|
4401
|
-
declare function getReferralReward$1(httpClient: HttpClient
|
|
3613
|
+
declare function getReferralReward$1(httpClient: HttpClient): GetReferralRewardSignature;
|
|
4402
3614
|
interface GetReferralRewardSignature {
|
|
4403
3615
|
/**
|
|
4404
3616
|
* Retrieves a referral reward.
|
|
@@ -4407,7 +3619,7 @@ interface GetReferralRewardSignature {
|
|
|
4407
3619
|
*/
|
|
4408
3620
|
(_id: string): Promise<ReferralReward & ReferralRewardNonNullableFields>;
|
|
4409
3621
|
}
|
|
4410
|
-
declare function queryReferralRewards$1(httpClient: HttpClient
|
|
3622
|
+
declare function queryReferralRewards$1(httpClient: HttpClient): QueryReferralRewardsSignature;
|
|
4411
3623
|
interface QueryReferralRewardsSignature {
|
|
4412
3624
|
/**
|
|
4413
3625
|
* Retrieves a list of referral rewards, given the provided paging, filtering, and sorting.
|
|
@@ -4420,8 +3632,8 @@ interface QueryReferralRewardsSignature {
|
|
|
4420
3632
|
(options?: QueryReferralRewardsOptions | undefined): ReferralRewardsQueryBuilder;
|
|
4421
3633
|
}
|
|
4422
3634
|
|
|
4423
|
-
declare const getReferralReward: MaybeContext
|
|
4424
|
-
declare const queryReferralRewards: MaybeContext
|
|
3635
|
+
declare const getReferralReward: MaybeContext<BuildRESTFunction<typeof getReferralReward$1> & typeof getReferralReward$1>;
|
|
3636
|
+
declare const queryReferralRewards: MaybeContext<BuildRESTFunction<typeof queryReferralRewards$1> & typeof queryReferralRewards$1>;
|
|
4425
3637
|
|
|
4426
3638
|
type index_d$2_BulkGetReferralRewardsRequest = BulkGetReferralRewardsRequest;
|
|
4427
3639
|
type index_d$2_BulkGetReferralRewardsResponse = BulkGetReferralRewardsResponse;
|
|
@@ -4465,458 +3677,48 @@ declare namespace index_d$2 {
|
|
|
4465
3677
|
export { type ActionEvent$2 as ActionEvent, type index_d$2_BulkGetReferralRewardsRequest as BulkGetReferralRewardsRequest, type index_d$2_BulkGetReferralRewardsResponse as BulkGetReferralRewardsResponse, type index_d$2_Coupon as Coupon, type index_d$2_CouponDiscountTypeOptionsOneOf as CouponDiscountTypeOptionsOneOf, type index_d$2_CouponScope as CouponScope, type index_d$2_CouponScopeOrMinSubtotalOneOf as CouponScopeOrMinSubtotalOneOf, 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, index_d$2_DiscountType as DiscountType, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type index_d$2_FixedAmountDiscount as FixedAmountDiscount, type index_d$2_GetReferralRewardRequest as GetReferralRewardRequest, type index_d$2_GetReferralRewardResponse as GetReferralRewardResponse, type index_d$2_GetReferralRewardResponseNonNullableFields as GetReferralRewardResponseNonNullableFields, type index_d$2_Group as Group, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type index_d$2_LoyaltyPoints as LoyaltyPoints, type MessageEnvelope$2 as MessageEnvelope, type index_d$2_PercentageDiscount as PercentageDiscount, type index_d$2_QueryReferralRewardsOptions as QueryReferralRewardsOptions, type index_d$2_QueryReferralRewardsRequest as QueryReferralRewardsRequest, type index_d$2_QueryReferralRewardsResponse as QueryReferralRewardsResponse, type index_d$2_QueryReferralRewardsResponseNonNullableFields as QueryReferralRewardsResponseNonNullableFields, type index_d$2_ReferralReward as ReferralReward, type index_d$2_ReferralRewardNonNullableFields as ReferralRewardNonNullableFields, type index_d$2_ReferralRewardReceiverOneOf as ReferralRewardReceiverOneOf, type index_d$2_ReferralRewardRewardTypeOptionsOneOf as ReferralRewardRewardTypeOptionsOneOf, type index_d$2_ReferralRewardsQueryBuilder as ReferralRewardsQueryBuilder, type index_d$2_ReferralRewardsQueryResult as ReferralRewardsQueryResult, type ReferredFriendDetails$1 as ReferredFriendDetails, type RestoreInfo$2 as RestoreInfo, type index_d$2_Reward as Reward, type index_d$2_RewardOptionsOneOf as RewardOptionsOneOf, index_d$2_RewardTypeType as RewardTypeType, type index_d$2_RewardsInSite as RewardsInSite, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Status$1 as Status, type SuccessfulReferralEvent$1 as SuccessfulReferralEvent, index_d$2_Type as Type, type index_d$2_V1Coupon as V1Coupon, type index_d$2_V1LoyaltyPoints as V1LoyaltyPoints, type index_d$2_ValidateReferralRewardRequest as ValidateReferralRewardRequest, type index_d$2_ValidateReferralRewardResponse as ValidateReferralRewardResponse, WebhookIdentityType$2 as WebhookIdentityType, index_d$2_getReferralReward as getReferralReward, index_d$2_queryReferralRewards as queryReferralRewards };
|
|
4466
3678
|
}
|
|
4467
3679
|
|
|
4468
|
-
|
|
4469
|
-
__type: 'host';
|
|
4470
|
-
create(host: H): T;
|
|
4471
|
-
};
|
|
4472
|
-
type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
|
|
4473
|
-
type Host$1<Environment = unknown> = {
|
|
4474
|
-
channel: {
|
|
4475
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
4476
|
-
disconnect: () => void;
|
|
4477
|
-
} | Promise<{
|
|
4478
|
-
disconnect: () => void;
|
|
4479
|
-
}>;
|
|
4480
|
-
};
|
|
4481
|
-
environment?: Environment;
|
|
3680
|
+
interface ReferredFriend {
|
|
4482
3681
|
/**
|
|
4483
|
-
*
|
|
3682
|
+
* ID of the referred friend.
|
|
3683
|
+
* @readonly
|
|
4484
3684
|
*/
|
|
4485
|
-
|
|
3685
|
+
_id?: string;
|
|
4486
3686
|
/**
|
|
4487
|
-
*
|
|
4488
|
-
*
|
|
3687
|
+
* Contact ID of the referred friend.
|
|
3688
|
+
* @readonly
|
|
4489
3689
|
*/
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
3690
|
+
contactId?: string;
|
|
3691
|
+
/**
|
|
3692
|
+
* ID of the customer who referred this friend.
|
|
3693
|
+
* @readonly
|
|
3694
|
+
*/
|
|
3695
|
+
referringCustomerId?: string;
|
|
3696
|
+
/** Status of the referred friend. */
|
|
3697
|
+
status?: Status;
|
|
3698
|
+
/**
|
|
3699
|
+
* Revision number, which increments by 1 each time the referred friend is updated.
|
|
3700
|
+
* To prevent conflicting changes, the current revision must be passed when updating the referred friend.
|
|
3701
|
+
* @readonly
|
|
3702
|
+
*/
|
|
3703
|
+
revision?: string | null;
|
|
3704
|
+
/**
|
|
3705
|
+
* Date and time the referred friend was created.
|
|
3706
|
+
* @readonly
|
|
3707
|
+
*/
|
|
3708
|
+
_createdDate?: Date | null;
|
|
3709
|
+
/**
|
|
3710
|
+
* Date and time the referred friend was last updated.
|
|
3711
|
+
* @readonly
|
|
3712
|
+
*/
|
|
3713
|
+
_updatedDate?: Date | null;
|
|
4512
3714
|
}
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
status
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
};
|
|
4521
|
-
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
4522
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
4523
|
-
url: string;
|
|
4524
|
-
data?: Data;
|
|
4525
|
-
params?: URLSearchParams;
|
|
4526
|
-
} & APIMetadata$1;
|
|
4527
|
-
type APIMetadata$1 = {
|
|
4528
|
-
methodFqn?: string;
|
|
4529
|
-
entityFqdn?: string;
|
|
4530
|
-
packageName?: string;
|
|
4531
|
-
};
|
|
4532
|
-
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
4533
|
-
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
4534
|
-
__type: 'event-definition';
|
|
4535
|
-
type: Type;
|
|
4536
|
-
isDomainEvent?: boolean;
|
|
4537
|
-
transformations?: (envelope: unknown) => Payload;
|
|
4538
|
-
__payload: Payload;
|
|
4539
|
-
};
|
|
4540
|
-
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
4541
|
-
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
4542
|
-
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
4543
|
-
|
|
4544
|
-
type ServicePluginMethodInput$1 = {
|
|
4545
|
-
request: any;
|
|
4546
|
-
metadata: any;
|
|
4547
|
-
};
|
|
4548
|
-
type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
|
|
4549
|
-
type ServicePluginMethodMetadata$1 = {
|
|
4550
|
-
name: string;
|
|
4551
|
-
primaryHttpMappingPath: string;
|
|
4552
|
-
transformations: {
|
|
4553
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
|
|
4554
|
-
toREST: (...args: unknown[]) => unknown;
|
|
4555
|
-
};
|
|
4556
|
-
};
|
|
4557
|
-
type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
|
|
4558
|
-
__type: 'service-plugin-definition';
|
|
4559
|
-
componentType: string;
|
|
4560
|
-
methods: ServicePluginMethodMetadata$1[];
|
|
4561
|
-
__contract: Contract;
|
|
4562
|
-
};
|
|
4563
|
-
declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
|
|
4564
|
-
type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
|
|
4565
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
|
|
4566
|
-
|
|
4567
|
-
type RequestContext$1 = {
|
|
4568
|
-
isSSR: boolean;
|
|
4569
|
-
host: string;
|
|
4570
|
-
protocol?: string;
|
|
4571
|
-
};
|
|
4572
|
-
type ResponseTransformer$1 = (data: any, headers?: any) => any;
|
|
4573
|
-
/**
|
|
4574
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
4575
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
4576
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
4577
|
-
*/
|
|
4578
|
-
type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
4579
|
-
type AmbassadorRequestOptions$1<T = any> = {
|
|
4580
|
-
_?: T;
|
|
4581
|
-
url?: string;
|
|
4582
|
-
method?: Method$1;
|
|
4583
|
-
params?: any;
|
|
4584
|
-
data?: any;
|
|
4585
|
-
transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
|
|
4586
|
-
};
|
|
4587
|
-
type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
|
|
4588
|
-
__isAmbassador: boolean;
|
|
4589
|
-
};
|
|
4590
|
-
type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
|
|
4591
|
-
type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
4592
|
-
|
|
4593
|
-
declare global {
|
|
4594
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4595
|
-
interface SymbolConstructor {
|
|
4596
|
-
readonly observable: symbol;
|
|
4597
|
-
}
|
|
4598
|
-
}
|
|
4599
|
-
|
|
4600
|
-
declare const emptyObjectSymbol$1: unique symbol;
|
|
4601
|
-
|
|
4602
|
-
/**
|
|
4603
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
4604
|
-
|
|
4605
|
-
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)).
|
|
4606
|
-
|
|
4607
|
-
@example
|
|
4608
|
-
```
|
|
4609
|
-
import type {EmptyObject} from 'type-fest';
|
|
4610
|
-
|
|
4611
|
-
// The following illustrates the problem with `{}`.
|
|
4612
|
-
const foo1: {} = {}; // Pass
|
|
4613
|
-
const foo2: {} = []; // Pass
|
|
4614
|
-
const foo3: {} = 42; // Pass
|
|
4615
|
-
const foo4: {} = {a: 1}; // Pass
|
|
4616
|
-
|
|
4617
|
-
// With `EmptyObject` only the first case is valid.
|
|
4618
|
-
const bar1: EmptyObject = {}; // Pass
|
|
4619
|
-
const bar2: EmptyObject = 42; // Fail
|
|
4620
|
-
const bar3: EmptyObject = []; // Fail
|
|
4621
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
4622
|
-
```
|
|
4623
|
-
|
|
4624
|
-
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}.
|
|
4625
|
-
|
|
4626
|
-
@category Object
|
|
4627
|
-
*/
|
|
4628
|
-
type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
|
|
4629
|
-
|
|
4630
|
-
/**
|
|
4631
|
-
Returns a boolean for whether the two given types are equal.
|
|
4632
|
-
|
|
4633
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
4634
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
4635
|
-
|
|
4636
|
-
Use-cases:
|
|
4637
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
4638
|
-
|
|
4639
|
-
@example
|
|
4640
|
-
```
|
|
4641
|
-
import type {IsEqual} from 'type-fest';
|
|
4642
|
-
|
|
4643
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
4644
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
4645
|
-
type Includes<Value extends readonly any[], Item> =
|
|
4646
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
4647
|
-
? IsEqual<Value[0], Item> extends true
|
|
4648
|
-
? true
|
|
4649
|
-
: Includes<rest, Item>
|
|
4650
|
-
: false;
|
|
4651
|
-
```
|
|
4652
|
-
|
|
4653
|
-
@category Type Guard
|
|
4654
|
-
@category Utilities
|
|
4655
|
-
*/
|
|
4656
|
-
type IsEqual$1<A, B> =
|
|
4657
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
4658
|
-
(<G>() => G extends B ? 1 : 2)
|
|
4659
|
-
? true
|
|
4660
|
-
: false;
|
|
4661
|
-
|
|
4662
|
-
/**
|
|
4663
|
-
Filter out keys from an object.
|
|
4664
|
-
|
|
4665
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
4666
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
4667
|
-
Returns `Key` otherwise.
|
|
4668
|
-
|
|
4669
|
-
@example
|
|
4670
|
-
```
|
|
4671
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
4672
|
-
//=> never
|
|
4673
|
-
```
|
|
4674
|
-
|
|
4675
|
-
@example
|
|
4676
|
-
```
|
|
4677
|
-
type Filtered = Filter<'bar', string>;
|
|
4678
|
-
//=> never
|
|
4679
|
-
```
|
|
4680
|
-
|
|
4681
|
-
@example
|
|
4682
|
-
```
|
|
4683
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
4684
|
-
//=> 'bar'
|
|
4685
|
-
```
|
|
4686
|
-
|
|
4687
|
-
@see {Except}
|
|
4688
|
-
*/
|
|
4689
|
-
type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
4690
|
-
|
|
4691
|
-
type ExceptOptions$1 = {
|
|
4692
|
-
/**
|
|
4693
|
-
Disallow assigning non-specified properties.
|
|
4694
|
-
|
|
4695
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
4696
|
-
|
|
4697
|
-
@default false
|
|
4698
|
-
*/
|
|
4699
|
-
requireExactProps?: boolean;
|
|
4700
|
-
};
|
|
4701
|
-
|
|
4702
|
-
/**
|
|
4703
|
-
Create a type from an object type without certain keys.
|
|
4704
|
-
|
|
4705
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
4706
|
-
|
|
4707
|
-
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.
|
|
4708
|
-
|
|
4709
|
-
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)).
|
|
4710
|
-
|
|
4711
|
-
@example
|
|
4712
|
-
```
|
|
4713
|
-
import type {Except} from 'type-fest';
|
|
4714
|
-
|
|
4715
|
-
type Foo = {
|
|
4716
|
-
a: number;
|
|
4717
|
-
b: string;
|
|
4718
|
-
};
|
|
4719
|
-
|
|
4720
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
4721
|
-
//=> {b: string}
|
|
4722
|
-
|
|
4723
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
4724
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
4725
|
-
|
|
4726
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
4727
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
4728
|
-
|
|
4729
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
4730
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
4731
|
-
```
|
|
4732
|
-
|
|
4733
|
-
@category Object
|
|
4734
|
-
*/
|
|
4735
|
-
type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
|
|
4736
|
-
[KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
|
|
4737
|
-
} & (Options['requireExactProps'] extends true
|
|
4738
|
-
? Partial<Record<KeysType, never>>
|
|
4739
|
-
: {});
|
|
4740
|
-
|
|
4741
|
-
/**
|
|
4742
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
4743
|
-
|
|
4744
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
4745
|
-
|
|
4746
|
-
@example
|
|
4747
|
-
```
|
|
4748
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
4749
|
-
|
|
4750
|
-
interface Example {
|
|
4751
|
-
a: string;
|
|
4752
|
-
b: string | number;
|
|
4753
|
-
c?: string;
|
|
4754
|
-
d: {};
|
|
4755
|
-
}
|
|
4756
|
-
|
|
4757
|
-
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
4758
|
-
//=> 'a'
|
|
4759
|
-
```
|
|
4760
|
-
|
|
4761
|
-
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
4762
|
-
|
|
4763
|
-
@example
|
|
4764
|
-
```
|
|
4765
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
4766
|
-
|
|
4767
|
-
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
4768
|
-
//=> 'a' | 'c'
|
|
4769
|
-
```
|
|
4770
|
-
|
|
4771
|
-
@category Object
|
|
4772
|
-
*/
|
|
4773
|
-
type ConditionalKeys$1<Base, Condition> = NonNullable<
|
|
4774
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
4775
|
-
{
|
|
4776
|
-
// Map through all the keys of the given base type.
|
|
4777
|
-
[Key in keyof Base]:
|
|
4778
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
4779
|
-
Base[Key] extends Condition
|
|
4780
|
-
// Retain this key since the condition passes.
|
|
4781
|
-
? Key
|
|
4782
|
-
// Discard this key since the condition fails.
|
|
4783
|
-
: never;
|
|
4784
|
-
|
|
4785
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
4786
|
-
}[keyof Base]
|
|
4787
|
-
>;
|
|
4788
|
-
|
|
4789
|
-
/**
|
|
4790
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
4791
|
-
|
|
4792
|
-
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.
|
|
4793
|
-
|
|
4794
|
-
@example
|
|
4795
|
-
```
|
|
4796
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
4797
|
-
|
|
4798
|
-
class Awesome {
|
|
4799
|
-
name: string;
|
|
4800
|
-
successes: number;
|
|
4801
|
-
failures: bigint;
|
|
4802
|
-
|
|
4803
|
-
run() {}
|
|
4804
|
-
}
|
|
4805
|
-
|
|
4806
|
-
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
4807
|
-
//=> {run: () => void}
|
|
4808
|
-
```
|
|
4809
|
-
|
|
4810
|
-
@example
|
|
4811
|
-
```
|
|
4812
|
-
import type {ConditionalExcept} from 'type-fest';
|
|
4813
|
-
|
|
4814
|
-
interface Example {
|
|
4815
|
-
a: string;
|
|
4816
|
-
b: string | number;
|
|
4817
|
-
c: () => void;
|
|
4818
|
-
d: {};
|
|
4819
|
-
}
|
|
4820
|
-
|
|
4821
|
-
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
4822
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
4823
|
-
```
|
|
4824
|
-
|
|
4825
|
-
@category Object
|
|
4826
|
-
*/
|
|
4827
|
-
type ConditionalExcept$1<Base, Condition> = Except$1<
|
|
4828
|
-
Base,
|
|
4829
|
-
ConditionalKeys$1<Base, Condition>
|
|
4830
|
-
>;
|
|
4831
|
-
|
|
4832
|
-
/**
|
|
4833
|
-
* Descriptors are objects that describe the API of a module, and the module
|
|
4834
|
-
* can either be a REST module or a host module.
|
|
4835
|
-
* This type is recursive, so it can describe nested modules.
|
|
4836
|
-
*/
|
|
4837
|
-
type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$3<any> | ServicePluginDefinition$1<any> | {
|
|
4838
|
-
[key: string]: Descriptors$1 | PublicMetadata$1 | any;
|
|
4839
|
-
};
|
|
4840
|
-
/**
|
|
4841
|
-
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
4842
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
4843
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
4844
|
-
* do not match the given host (as they will not work with the given host).
|
|
4845
|
-
*/
|
|
4846
|
-
type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
|
|
4847
|
-
done: T;
|
|
4848
|
-
recurse: T extends {
|
|
4849
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
|
|
4850
|
-
} ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$3<any> ? BuildEventDefinition$3<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
|
|
4851
|
-
[Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
|
|
4852
|
-
-1,
|
|
4853
|
-
0,
|
|
4854
|
-
1,
|
|
4855
|
-
2,
|
|
4856
|
-
3,
|
|
4857
|
-
4,
|
|
4858
|
-
5
|
|
4859
|
-
][Depth]> : never;
|
|
4860
|
-
}, EmptyObject$1>;
|
|
4861
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
4862
|
-
type PublicMetadata$1 = {
|
|
4863
|
-
PACKAGE_NAME?: string;
|
|
4864
|
-
};
|
|
4865
|
-
|
|
4866
|
-
declare global {
|
|
4867
|
-
interface ContextualClient {
|
|
4868
|
-
}
|
|
4869
|
-
}
|
|
4870
|
-
/**
|
|
4871
|
-
* A type used to create concerete types from SDK descriptors in
|
|
4872
|
-
* case a contextual client is available.
|
|
4873
|
-
*/
|
|
4874
|
-
type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
|
|
4875
|
-
host: Host$1;
|
|
4876
|
-
} ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
|
|
4877
|
-
|
|
4878
|
-
interface ReferredFriend {
|
|
4879
|
-
/**
|
|
4880
|
-
* ID of the referred friend.
|
|
4881
|
-
* @readonly
|
|
4882
|
-
*/
|
|
4883
|
-
_id?: string;
|
|
4884
|
-
/**
|
|
4885
|
-
* Contact ID of the referred friend.
|
|
4886
|
-
* @readonly
|
|
4887
|
-
*/
|
|
4888
|
-
contactId?: string;
|
|
4889
|
-
/**
|
|
4890
|
-
* ID of the customer who referred this friend.
|
|
4891
|
-
* @readonly
|
|
4892
|
-
*/
|
|
4893
|
-
referringCustomerId?: string;
|
|
4894
|
-
/** Status of the referred friend. */
|
|
4895
|
-
status?: Status;
|
|
4896
|
-
/**
|
|
4897
|
-
* Revision number, which increments by 1 each time the referred friend is updated.
|
|
4898
|
-
* To prevent conflicting changes, the current revision must be passed when updating the referred friend.
|
|
4899
|
-
* @readonly
|
|
4900
|
-
*/
|
|
4901
|
-
revision?: string | null;
|
|
4902
|
-
/**
|
|
4903
|
-
* Date and time the referred friend was created.
|
|
4904
|
-
* @readonly
|
|
4905
|
-
*/
|
|
4906
|
-
_createdDate?: Date;
|
|
4907
|
-
/**
|
|
4908
|
-
* Date and time the referred friend was last updated.
|
|
4909
|
-
* @readonly
|
|
4910
|
-
*/
|
|
4911
|
-
_updatedDate?: Date;
|
|
4912
|
-
}
|
|
4913
|
-
declare enum Status {
|
|
4914
|
-
/** Unknown status. */
|
|
4915
|
-
UNKNOWN = "UNKNOWN",
|
|
4916
|
-
/** Initial status when the referred friend joins the site as a member. */
|
|
4917
|
-
SIGN_UP_COMPLETED = "SIGN_UP_COMPLETED",
|
|
4918
|
-
/** Status after the referred friend completes specific actions, such as making a purchase. */
|
|
4919
|
-
ACTIONS_COMPLETED = "ACTIONS_COMPLETED"
|
|
3715
|
+
declare enum Status {
|
|
3716
|
+
/** Unknown status. */
|
|
3717
|
+
UNKNOWN = "UNKNOWN",
|
|
3718
|
+
/** Initial status when the referred friend joins the site as a member. */
|
|
3719
|
+
SIGN_UP_COMPLETED = "SIGN_UP_COMPLETED",
|
|
3720
|
+
/** Status after the referred friend completes specific actions, such as making a purchase. */
|
|
3721
|
+
ACTIONS_COMPLETED = "ACTIONS_COMPLETED"
|
|
4920
3722
|
}
|
|
4921
3723
|
interface CreateReferredFriendRequest {
|
|
4922
3724
|
/** Referral code for the referred friend. */
|
|
@@ -5064,7 +3866,7 @@ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
|
|
|
5064
3866
|
/** ID of the entity associated with the event. */
|
|
5065
3867
|
entityId?: string;
|
|
5066
3868
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
5067
|
-
eventTime?: Date;
|
|
3869
|
+
eventTime?: Date | null;
|
|
5068
3870
|
/**
|
|
5069
3871
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
5070
3872
|
* (for example, GDPR).
|
|
@@ -5093,7 +3895,7 @@ interface EntityCreatedEvent$1 {
|
|
|
5093
3895
|
entity?: string;
|
|
5094
3896
|
}
|
|
5095
3897
|
interface RestoreInfo$1 {
|
|
5096
|
-
deletedDate?: Date;
|
|
3898
|
+
deletedDate?: Date | null;
|
|
5097
3899
|
}
|
|
5098
3900
|
interface EntityUpdatedEvent$1 {
|
|
5099
3901
|
/**
|
|
@@ -5222,7 +4024,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
|
|
|
5222
4024
|
/** ID of the entity associated with the event. */
|
|
5223
4025
|
entityId?: string;
|
|
5224
4026
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
5225
|
-
eventTime?: Date;
|
|
4027
|
+
eventTime?: Date | null;
|
|
5226
4028
|
/**
|
|
5227
4029
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
5228
4030
|
* (for example, GDPR).
|
|
@@ -5283,12 +4085,12 @@ interface UpdateReferredFriend {
|
|
|
5283
4085
|
* Date and time the referred friend was created.
|
|
5284
4086
|
* @readonly
|
|
5285
4087
|
*/
|
|
5286
|
-
_createdDate?: Date;
|
|
4088
|
+
_createdDate?: Date | null;
|
|
5287
4089
|
/**
|
|
5288
4090
|
* Date and time the referred friend was last updated.
|
|
5289
4091
|
* @readonly
|
|
5290
4092
|
*/
|
|
5291
|
-
_updatedDate?: Date;
|
|
4093
|
+
_updatedDate?: Date | null;
|
|
5292
4094
|
}
|
|
5293
4095
|
interface DeleteReferredFriendOptions {
|
|
5294
4096
|
/**
|
|
@@ -5356,602 +4158,174 @@ interface ReferredFriendsQueryBuilder {
|
|
|
5356
4158
|
/** @documentationMaturity preview */
|
|
5357
4159
|
exists: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: boolean) => ReferredFriendsQueryBuilder;
|
|
5358
4160
|
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
5359
|
-
* @documentationMaturity preview
|
|
5360
|
-
*/
|
|
5361
|
-
ascending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
|
|
5362
|
-
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
5363
|
-
* @documentationMaturity preview
|
|
5364
|
-
*/
|
|
5365
|
-
descending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
|
|
5366
|
-
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
5367
|
-
* @documentationMaturity preview
|
|
5368
|
-
*/
|
|
5369
|
-
limit: (limit: number) => ReferredFriendsQueryBuilder;
|
|
5370
|
-
/** @param cursor - A pointer to specific record
|
|
5371
|
-
* @documentationMaturity preview
|
|
5372
|
-
*/
|
|
5373
|
-
skipTo: (cursor: string) => ReferredFriendsQueryBuilder;
|
|
5374
|
-
/** @documentationMaturity preview */
|
|
5375
|
-
find: () => Promise<ReferredFriendsQueryResult>;
|
|
5376
|
-
}
|
|
5377
|
-
|
|
5378
|
-
declare function createReferredFriend$1(httpClient: HttpClient$1): CreateReferredFriendSignature;
|
|
5379
|
-
interface CreateReferredFriendSignature {
|
|
5380
|
-
/**
|
|
5381
|
-
* Creates a new referred friend or returns an existing entity if it already exists.
|
|
5382
|
-
*
|
|
5383
|
-
* This method must be called with a [member identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities#site-members).
|
|
5384
|
-
*
|
|
5385
|
-
* A referral code must be provided either in the request or via scope.
|
|
5386
|
-
*
|
|
5387
|
-
* The member must be eligible to become a referred friend.
|
|
5388
|
-
*/
|
|
5389
|
-
(options?: CreateReferredFriendOptions | undefined): Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
|
|
5390
|
-
}
|
|
5391
|
-
declare function getReferredFriend$1(httpClient: HttpClient$1): GetReferredFriendSignature;
|
|
5392
|
-
interface GetReferredFriendSignature {
|
|
5393
|
-
/**
|
|
5394
|
-
* Retrieves a referred friend by ID.
|
|
5395
|
-
* @param - ID of the referred friend to retrieve.
|
|
5396
|
-
*/
|
|
5397
|
-
(referredFriendId: string): Promise<GetReferredFriendResponse & GetReferredFriendResponseNonNullableFields>;
|
|
5398
|
-
}
|
|
5399
|
-
declare function getReferredFriendByContactId$1(httpClient: HttpClient$1): GetReferredFriendByContactIdSignature;
|
|
5400
|
-
interface GetReferredFriendByContactIdSignature {
|
|
5401
|
-
/**
|
|
5402
|
-
* Retrieves a referred friend by contact ID.
|
|
5403
|
-
*
|
|
5404
|
-
* You can use `me` instead of a specific contact ID to get the referred friend for the current identity's contact.
|
|
5405
|
-
* @param - Contact ID or "me" to get the current identity's contact.
|
|
5406
|
-
* @returns Retrieved referred friend.
|
|
5407
|
-
*/
|
|
5408
|
-
(contactId: string): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
5409
|
-
}
|
|
5410
|
-
declare function updateReferredFriend$1(httpClient: HttpClient$1): UpdateReferredFriendSignature;
|
|
5411
|
-
interface UpdateReferredFriendSignature {
|
|
5412
|
-
/**
|
|
5413
|
-
* Updates a referred friend. Supports partial updates.
|
|
5414
|
-
*
|
|
5415
|
-
* You must pass the latest `revision` for a successful update.
|
|
5416
|
-
* @param - ID of the referred friend.
|
|
5417
|
-
* @returns Updated referred friend.
|
|
5418
|
-
*/
|
|
5419
|
-
(_id: string, referredFriend: UpdateReferredFriend): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
5420
|
-
}
|
|
5421
|
-
declare function deleteReferredFriend$1(httpClient: HttpClient$1): DeleteReferredFriendSignature;
|
|
5422
|
-
interface DeleteReferredFriendSignature {
|
|
5423
|
-
/**
|
|
5424
|
-
* Deletes a referred friend.
|
|
5425
|
-
* @param - ID of the referred friend to delete.
|
|
5426
|
-
*/
|
|
5427
|
-
(referredFriendId: string, options?: DeleteReferredFriendOptions | undefined): Promise<void>;
|
|
5428
|
-
}
|
|
5429
|
-
declare function queryReferredFriend$1(httpClient: HttpClient$1): QueryReferredFriendSignature;
|
|
5430
|
-
interface QueryReferredFriendSignature {
|
|
5431
|
-
/**
|
|
5432
|
-
* Creates a query to retrieve a list of referred friends.
|
|
5433
|
-
*
|
|
5434
|
-
* The `queryReferredFriend()` function builds a query to retrieve a list of events and returns a `ReferredFriendsQueryBuilder` object.
|
|
5435
|
-
*
|
|
5436
|
-
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
5437
|
-
*
|
|
5438
|
-
* You can refine the query by chaining `ReferredFriendsQueryBuilder` functions onto the query. `ReferredFriendsQueryBuilder` functions enable you to sort, filter, and control the results `queryReferredFriend()` returns.
|
|
5439
|
-
*
|
|
5440
|
-
* `queryReferredFriend()` runs with these `ReferredFriendQueryBuilder` defaults, which you can override:
|
|
5441
|
-
*
|
|
5442
|
-
* - `limit(50)`
|
|
5443
|
-
* - `descending("_createdDate")`
|
|
5444
|
-
*
|
|
5445
|
-
* The functions that are chained to `queryReferredFriend()` are applied in the order they're called. For example, if you apply ascending('status') and then descending('referringCustomerId'), the results are sorted first by the status, and then, if there are multiple results with the same status, the items are sorted by referring customer ID.
|
|
5446
|
-
*/
|
|
5447
|
-
(): ReferredFriendsQueryBuilder;
|
|
5448
|
-
}
|
|
5449
|
-
declare const onReferredFriendCreated$1: EventDefinition$3<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
|
|
5450
|
-
declare const onReferredFriendUpdated$1: EventDefinition$3<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
|
|
5451
|
-
declare const onReferredFriendDeleted$1: EventDefinition$3<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
|
|
5452
|
-
|
|
5453
|
-
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
5454
|
-
__type: 'event-definition';
|
|
5455
|
-
type: Type;
|
|
5456
|
-
isDomainEvent?: boolean;
|
|
5457
|
-
transformations?: (envelope: unknown) => Payload;
|
|
5458
|
-
__payload: Payload;
|
|
5459
|
-
};
|
|
5460
|
-
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
5461
|
-
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
5462
|
-
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
5463
|
-
|
|
5464
|
-
declare global {
|
|
5465
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
5466
|
-
interface SymbolConstructor {
|
|
5467
|
-
readonly observable: symbol;
|
|
5468
|
-
}
|
|
5469
|
-
}
|
|
5470
|
-
|
|
5471
|
-
declare function createEventModule$1<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
|
5472
|
-
|
|
5473
|
-
declare const createReferredFriend: MaybeContext$1<BuildRESTFunction$1<typeof createReferredFriend$1> & typeof createReferredFriend$1>;
|
|
5474
|
-
declare const getReferredFriend: MaybeContext$1<BuildRESTFunction$1<typeof getReferredFriend$1> & typeof getReferredFriend$1>;
|
|
5475
|
-
declare const getReferredFriendByContactId: MaybeContext$1<BuildRESTFunction$1<typeof getReferredFriendByContactId$1> & typeof getReferredFriendByContactId$1>;
|
|
5476
|
-
declare const updateReferredFriend: MaybeContext$1<BuildRESTFunction$1<typeof updateReferredFriend$1> & typeof updateReferredFriend$1>;
|
|
5477
|
-
declare const deleteReferredFriend: MaybeContext$1<BuildRESTFunction$1<typeof deleteReferredFriend$1> & typeof deleteReferredFriend$1>;
|
|
5478
|
-
declare const queryReferredFriend: MaybeContext$1<BuildRESTFunction$1<typeof queryReferredFriend$1> & typeof queryReferredFriend$1>;
|
|
5479
|
-
|
|
5480
|
-
type _publicOnReferredFriendCreatedType = typeof onReferredFriendCreated$1;
|
|
5481
|
-
/**
|
|
5482
|
-
* Triggered when a referred friend is created.
|
|
5483
|
-
*/
|
|
5484
|
-
declare const onReferredFriendCreated: ReturnType<typeof createEventModule$1<_publicOnReferredFriendCreatedType>>;
|
|
5485
|
-
|
|
5486
|
-
type _publicOnReferredFriendUpdatedType = typeof onReferredFriendUpdated$1;
|
|
5487
|
-
/**
|
|
5488
|
-
* Triggered when a referred friend is updated.
|
|
5489
|
-
*/
|
|
5490
|
-
declare const onReferredFriendUpdated: ReturnType<typeof createEventModule$1<_publicOnReferredFriendUpdatedType>>;
|
|
5491
|
-
|
|
5492
|
-
type _publicOnReferredFriendDeletedType = typeof onReferredFriendDeleted$1;
|
|
5493
|
-
/**
|
|
5494
|
-
* Triggered when a referred friend is deleted.
|
|
5495
|
-
*/
|
|
5496
|
-
declare const onReferredFriendDeleted: ReturnType<typeof createEventModule$1<_publicOnReferredFriendDeletedType>>;
|
|
5497
|
-
|
|
5498
|
-
type index_d$1_CreateReferredFriendOptions = CreateReferredFriendOptions;
|
|
5499
|
-
type index_d$1_CreateReferredFriendRequest = CreateReferredFriendRequest;
|
|
5500
|
-
type index_d$1_CreateReferredFriendResponse = CreateReferredFriendResponse;
|
|
5501
|
-
type index_d$1_CreateReferredFriendResponseNonNullableFields = CreateReferredFriendResponseNonNullableFields;
|
|
5502
|
-
type index_d$1_DeleteReferredFriendOptions = DeleteReferredFriendOptions;
|
|
5503
|
-
type index_d$1_DeleteReferredFriendRequest = DeleteReferredFriendRequest;
|
|
5504
|
-
type index_d$1_DeleteReferredFriendResponse = DeleteReferredFriendResponse;
|
|
5505
|
-
type index_d$1_Empty = Empty;
|
|
5506
|
-
type index_d$1_GetReferredFriendByContactIdRequest = GetReferredFriendByContactIdRequest;
|
|
5507
|
-
type index_d$1_GetReferredFriendByContactIdResponse = GetReferredFriendByContactIdResponse;
|
|
5508
|
-
type index_d$1_GetReferredFriendByContactIdResponseNonNullableFields = GetReferredFriendByContactIdResponseNonNullableFields;
|
|
5509
|
-
type index_d$1_GetReferredFriendRequest = GetReferredFriendRequest;
|
|
5510
|
-
type index_d$1_GetReferredFriendResponse = GetReferredFriendResponse;
|
|
5511
|
-
type index_d$1_GetReferredFriendResponseNonNullableFields = GetReferredFriendResponseNonNullableFields;
|
|
5512
|
-
type index_d$1_QueryReferredFriendRequest = QueryReferredFriendRequest;
|
|
5513
|
-
type index_d$1_QueryReferredFriendResponse = QueryReferredFriendResponse;
|
|
5514
|
-
type index_d$1_QueryReferredFriendResponseNonNullableFields = QueryReferredFriendResponseNonNullableFields;
|
|
5515
|
-
type index_d$1_ReferredFriend = ReferredFriend;
|
|
5516
|
-
type index_d$1_ReferredFriendCreatedEnvelope = ReferredFriendCreatedEnvelope;
|
|
5517
|
-
type index_d$1_ReferredFriendDeletedEnvelope = ReferredFriendDeletedEnvelope;
|
|
5518
|
-
type index_d$1_ReferredFriendDetails = ReferredFriendDetails;
|
|
5519
|
-
type index_d$1_ReferredFriendNonNullableFields = ReferredFriendNonNullableFields;
|
|
5520
|
-
type index_d$1_ReferredFriendUpdatedEnvelope = ReferredFriendUpdatedEnvelope;
|
|
5521
|
-
type index_d$1_ReferredFriendsQueryBuilder = ReferredFriendsQueryBuilder;
|
|
5522
|
-
type index_d$1_ReferredFriendsQueryResult = ReferredFriendsQueryResult;
|
|
5523
|
-
type index_d$1_Status = Status;
|
|
5524
|
-
declare const index_d$1_Status: typeof Status;
|
|
5525
|
-
type index_d$1_SuccessfulReferralEvent = SuccessfulReferralEvent;
|
|
5526
|
-
type index_d$1_UpdateReferredFriend = UpdateReferredFriend;
|
|
5527
|
-
type index_d$1_UpdateReferredFriendRequest = UpdateReferredFriendRequest;
|
|
5528
|
-
type index_d$1_UpdateReferredFriendResponse = UpdateReferredFriendResponse;
|
|
5529
|
-
type index_d$1_UpdateReferredFriendResponseNonNullableFields = UpdateReferredFriendResponseNonNullableFields;
|
|
5530
|
-
type index_d$1__publicOnReferredFriendCreatedType = _publicOnReferredFriendCreatedType;
|
|
5531
|
-
type index_d$1__publicOnReferredFriendDeletedType = _publicOnReferredFriendDeletedType;
|
|
5532
|
-
type index_d$1__publicOnReferredFriendUpdatedType = _publicOnReferredFriendUpdatedType;
|
|
5533
|
-
declare const index_d$1_createReferredFriend: typeof createReferredFriend;
|
|
5534
|
-
declare const index_d$1_deleteReferredFriend: typeof deleteReferredFriend;
|
|
5535
|
-
declare const index_d$1_getReferredFriend: typeof getReferredFriend;
|
|
5536
|
-
declare const index_d$1_getReferredFriendByContactId: typeof getReferredFriendByContactId;
|
|
5537
|
-
declare const index_d$1_onReferredFriendCreated: typeof onReferredFriendCreated;
|
|
5538
|
-
declare const index_d$1_onReferredFriendDeleted: typeof onReferredFriendDeleted;
|
|
5539
|
-
declare const index_d$1_onReferredFriendUpdated: typeof onReferredFriendUpdated;
|
|
5540
|
-
declare const index_d$1_queryReferredFriend: typeof queryReferredFriend;
|
|
5541
|
-
declare const index_d$1_updateReferredFriend: typeof updateReferredFriend;
|
|
5542
|
-
declare namespace index_d$1 {
|
|
5543
|
-
export { type ActionEvent$1 as ActionEvent, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$1_CreateReferredFriendOptions as CreateReferredFriendOptions, type index_d$1_CreateReferredFriendRequest as CreateReferredFriendRequest, type index_d$1_CreateReferredFriendResponse as CreateReferredFriendResponse, type index_d$1_CreateReferredFriendResponseNonNullableFields as CreateReferredFriendResponseNonNullableFields, 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 index_d$1_DeleteReferredFriendOptions as DeleteReferredFriendOptions, type index_d$1_DeleteReferredFriendRequest as DeleteReferredFriendRequest, type index_d$1_DeleteReferredFriendResponse as DeleteReferredFriendResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type index_d$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type index_d$1_GetReferredFriendByContactIdRequest as GetReferredFriendByContactIdRequest, type index_d$1_GetReferredFriendByContactIdResponse as GetReferredFriendByContactIdResponse, type index_d$1_GetReferredFriendByContactIdResponseNonNullableFields as GetReferredFriendByContactIdResponseNonNullableFields, type index_d$1_GetReferredFriendRequest as GetReferredFriendRequest, type index_d$1_GetReferredFriendResponse as GetReferredFriendResponse, type index_d$1_GetReferredFriendResponseNonNullableFields as GetReferredFriendResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_QueryReferredFriendRequest as QueryReferredFriendRequest, type index_d$1_QueryReferredFriendResponse as QueryReferredFriendResponse, type index_d$1_QueryReferredFriendResponseNonNullableFields as QueryReferredFriendResponseNonNullableFields, type index_d$1_ReferredFriend as ReferredFriend, type index_d$1_ReferredFriendCreatedEnvelope as ReferredFriendCreatedEnvelope, type index_d$1_ReferredFriendDeletedEnvelope as ReferredFriendDeletedEnvelope, type index_d$1_ReferredFriendDetails as ReferredFriendDetails, type index_d$1_ReferredFriendNonNullableFields as ReferredFriendNonNullableFields, type index_d$1_ReferredFriendUpdatedEnvelope as ReferredFriendUpdatedEnvelope, type index_d$1_ReferredFriendsQueryBuilder as ReferredFriendsQueryBuilder, type index_d$1_ReferredFriendsQueryResult as ReferredFriendsQueryResult, type RestoreInfo$1 as RestoreInfo, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, index_d$1_Status as Status, type index_d$1_SuccessfulReferralEvent as SuccessfulReferralEvent, type index_d$1_UpdateReferredFriend as UpdateReferredFriend, type index_d$1_UpdateReferredFriendRequest as UpdateReferredFriendRequest, type index_d$1_UpdateReferredFriendResponse as UpdateReferredFriendResponse, type index_d$1_UpdateReferredFriendResponseNonNullableFields as UpdateReferredFriendResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, type index_d$1__publicOnReferredFriendCreatedType as _publicOnReferredFriendCreatedType, type index_d$1__publicOnReferredFriendDeletedType as _publicOnReferredFriendDeletedType, type index_d$1__publicOnReferredFriendUpdatedType as _publicOnReferredFriendUpdatedType, index_d$1_createReferredFriend as createReferredFriend, index_d$1_deleteReferredFriend as deleteReferredFriend, index_d$1_getReferredFriend as getReferredFriend, index_d$1_getReferredFriendByContactId as getReferredFriendByContactId, index_d$1_onReferredFriendCreated as onReferredFriendCreated, index_d$1_onReferredFriendDeleted as onReferredFriendDeleted, index_d$1_onReferredFriendUpdated as onReferredFriendUpdated, onReferredFriendCreated$1 as publicOnReferredFriendCreated, onReferredFriendDeleted$1 as publicOnReferredFriendDeleted, onReferredFriendUpdated$1 as publicOnReferredFriendUpdated, index_d$1_queryReferredFriend as queryReferredFriend, index_d$1_updateReferredFriend as updateReferredFriend };
|
|
5544
|
-
}
|
|
5545
|
-
|
|
5546
|
-
type HostModule<T, H extends Host> = {
|
|
5547
|
-
__type: 'host';
|
|
5548
|
-
create(host: H): T;
|
|
5549
|
-
};
|
|
5550
|
-
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
5551
|
-
type Host<Environment = unknown> = {
|
|
5552
|
-
channel: {
|
|
5553
|
-
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
5554
|
-
disconnect: () => void;
|
|
5555
|
-
} | Promise<{
|
|
5556
|
-
disconnect: () => void;
|
|
5557
|
-
}>;
|
|
5558
|
-
};
|
|
5559
|
-
environment?: Environment;
|
|
5560
|
-
/**
|
|
5561
|
-
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
5562
|
-
*/
|
|
5563
|
-
apiBaseUrl?: string;
|
|
5564
|
-
/**
|
|
5565
|
-
* Possible data to be provided by every host, for cross cutting concerns
|
|
5566
|
-
* like internationalization, billing, etc.
|
|
5567
|
-
*/
|
|
5568
|
-
essentials?: {
|
|
5569
|
-
/**
|
|
5570
|
-
* The language of the currently viewed session
|
|
5571
|
-
*/
|
|
5572
|
-
language?: string;
|
|
5573
|
-
/**
|
|
5574
|
-
* The locale of the currently viewed session
|
|
5575
|
-
*/
|
|
5576
|
-
locale?: string;
|
|
5577
|
-
/**
|
|
5578
|
-
* Any headers that should be passed through to the API requests
|
|
5579
|
-
*/
|
|
5580
|
-
passThroughHeaders?: Record<string, string>;
|
|
5581
|
-
};
|
|
5582
|
-
};
|
|
5583
|
-
|
|
5584
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
5585
|
-
interface HttpClient {
|
|
5586
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
5587
|
-
fetchWithAuth: typeof fetch;
|
|
5588
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
5589
|
-
getActiveToken?: () => string | undefined;
|
|
5590
|
-
}
|
|
5591
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
5592
|
-
type HttpResponse<T = any> = {
|
|
5593
|
-
data: T;
|
|
5594
|
-
status: number;
|
|
5595
|
-
statusText: string;
|
|
5596
|
-
headers: any;
|
|
5597
|
-
request?: any;
|
|
5598
|
-
};
|
|
5599
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
5600
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
5601
|
-
url: string;
|
|
5602
|
-
data?: Data;
|
|
5603
|
-
params?: URLSearchParams;
|
|
5604
|
-
} & APIMetadata;
|
|
5605
|
-
type APIMetadata = {
|
|
5606
|
-
methodFqn?: string;
|
|
5607
|
-
entityFqdn?: string;
|
|
5608
|
-
packageName?: string;
|
|
5609
|
-
};
|
|
5610
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
5611
|
-
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
5612
|
-
__type: 'event-definition';
|
|
5613
|
-
type: Type;
|
|
5614
|
-
isDomainEvent?: boolean;
|
|
5615
|
-
transformations?: (envelope: unknown) => Payload;
|
|
5616
|
-
__payload: Payload;
|
|
5617
|
-
};
|
|
5618
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
5619
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
5620
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
5621
|
-
|
|
5622
|
-
type ServicePluginMethodInput = {
|
|
5623
|
-
request: any;
|
|
5624
|
-
metadata: any;
|
|
5625
|
-
};
|
|
5626
|
-
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
5627
|
-
type ServicePluginMethodMetadata = {
|
|
5628
|
-
name: string;
|
|
5629
|
-
primaryHttpMappingPath: string;
|
|
5630
|
-
transformations: {
|
|
5631
|
-
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
5632
|
-
toREST: (...args: unknown[]) => unknown;
|
|
5633
|
-
};
|
|
5634
|
-
};
|
|
5635
|
-
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
5636
|
-
__type: 'service-plugin-definition';
|
|
5637
|
-
componentType: string;
|
|
5638
|
-
methods: ServicePluginMethodMetadata[];
|
|
5639
|
-
__contract: Contract;
|
|
5640
|
-
};
|
|
5641
|
-
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
5642
|
-
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
5643
|
-
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
5644
|
-
|
|
5645
|
-
type RequestContext = {
|
|
5646
|
-
isSSR: boolean;
|
|
5647
|
-
host: string;
|
|
5648
|
-
protocol?: string;
|
|
5649
|
-
};
|
|
5650
|
-
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
5651
|
-
/**
|
|
5652
|
-
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
5653
|
-
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
5654
|
-
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
5655
|
-
*/
|
|
5656
|
-
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
5657
|
-
type AmbassadorRequestOptions<T = any> = {
|
|
5658
|
-
_?: T;
|
|
5659
|
-
url?: string;
|
|
5660
|
-
method?: Method;
|
|
5661
|
-
params?: any;
|
|
5662
|
-
data?: any;
|
|
5663
|
-
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
5664
|
-
};
|
|
5665
|
-
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
5666
|
-
__isAmbassador: boolean;
|
|
5667
|
-
};
|
|
5668
|
-
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
5669
|
-
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
5670
|
-
|
|
5671
|
-
declare global {
|
|
5672
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
5673
|
-
interface SymbolConstructor {
|
|
5674
|
-
readonly observable: symbol;
|
|
5675
|
-
}
|
|
5676
|
-
}
|
|
5677
|
-
|
|
5678
|
-
declare const emptyObjectSymbol: unique symbol;
|
|
5679
|
-
|
|
5680
|
-
/**
|
|
5681
|
-
Represents a strictly empty plain object, the `{}` value.
|
|
5682
|
-
|
|
5683
|
-
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)).
|
|
5684
|
-
|
|
5685
|
-
@example
|
|
5686
|
-
```
|
|
5687
|
-
import type {EmptyObject} from 'type-fest';
|
|
5688
|
-
|
|
5689
|
-
// The following illustrates the problem with `{}`.
|
|
5690
|
-
const foo1: {} = {}; // Pass
|
|
5691
|
-
const foo2: {} = []; // Pass
|
|
5692
|
-
const foo3: {} = 42; // Pass
|
|
5693
|
-
const foo4: {} = {a: 1}; // Pass
|
|
5694
|
-
|
|
5695
|
-
// With `EmptyObject` only the first case is valid.
|
|
5696
|
-
const bar1: EmptyObject = {}; // Pass
|
|
5697
|
-
const bar2: EmptyObject = 42; // Fail
|
|
5698
|
-
const bar3: EmptyObject = []; // Fail
|
|
5699
|
-
const bar4: EmptyObject = {a: 1}; // Fail
|
|
5700
|
-
```
|
|
5701
|
-
|
|
5702
|
-
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}.
|
|
5703
|
-
|
|
5704
|
-
@category Object
|
|
5705
|
-
*/
|
|
5706
|
-
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
5707
|
-
|
|
5708
|
-
/**
|
|
5709
|
-
Returns a boolean for whether the two given types are equal.
|
|
5710
|
-
|
|
5711
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
5712
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
5713
|
-
|
|
5714
|
-
Use-cases:
|
|
5715
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
5716
|
-
|
|
5717
|
-
@example
|
|
5718
|
-
```
|
|
5719
|
-
import type {IsEqual} from 'type-fest';
|
|
5720
|
-
|
|
5721
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
5722
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
5723
|
-
type Includes<Value extends readonly any[], Item> =
|
|
5724
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
5725
|
-
? IsEqual<Value[0], Item> extends true
|
|
5726
|
-
? true
|
|
5727
|
-
: Includes<rest, Item>
|
|
5728
|
-
: false;
|
|
5729
|
-
```
|
|
5730
|
-
|
|
5731
|
-
@category Type Guard
|
|
5732
|
-
@category Utilities
|
|
5733
|
-
*/
|
|
5734
|
-
type IsEqual<A, B> =
|
|
5735
|
-
(<G>() => G extends A ? 1 : 2) extends
|
|
5736
|
-
(<G>() => G extends B ? 1 : 2)
|
|
5737
|
-
? true
|
|
5738
|
-
: false;
|
|
5739
|
-
|
|
5740
|
-
/**
|
|
5741
|
-
Filter out keys from an object.
|
|
5742
|
-
|
|
5743
|
-
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
5744
|
-
Returns `never` if `Key` extends `Exclude`.
|
|
5745
|
-
Returns `Key` otherwise.
|
|
5746
|
-
|
|
5747
|
-
@example
|
|
5748
|
-
```
|
|
5749
|
-
type Filtered = Filter<'foo', 'foo'>;
|
|
5750
|
-
//=> never
|
|
5751
|
-
```
|
|
5752
|
-
|
|
5753
|
-
@example
|
|
5754
|
-
```
|
|
5755
|
-
type Filtered = Filter<'bar', string>;
|
|
5756
|
-
//=> never
|
|
5757
|
-
```
|
|
5758
|
-
|
|
5759
|
-
@example
|
|
5760
|
-
```
|
|
5761
|
-
type Filtered = Filter<'bar', 'foo'>;
|
|
5762
|
-
//=> 'bar'
|
|
5763
|
-
```
|
|
5764
|
-
|
|
5765
|
-
@see {Except}
|
|
5766
|
-
*/
|
|
5767
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
5768
|
-
|
|
5769
|
-
type ExceptOptions = {
|
|
5770
|
-
/**
|
|
5771
|
-
Disallow assigning non-specified properties.
|
|
5772
|
-
|
|
5773
|
-
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
5774
|
-
|
|
5775
|
-
@default false
|
|
5776
|
-
*/
|
|
5777
|
-
requireExactProps?: boolean;
|
|
5778
|
-
};
|
|
5779
|
-
|
|
5780
|
-
/**
|
|
5781
|
-
Create a type from an object type without certain keys.
|
|
5782
|
-
|
|
5783
|
-
We recommend setting the `requireExactProps` option to `true`.
|
|
5784
|
-
|
|
5785
|
-
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.
|
|
5786
|
-
|
|
5787
|
-
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)).
|
|
5788
|
-
|
|
5789
|
-
@example
|
|
5790
|
-
```
|
|
5791
|
-
import type {Except} from 'type-fest';
|
|
5792
|
-
|
|
5793
|
-
type Foo = {
|
|
5794
|
-
a: number;
|
|
5795
|
-
b: string;
|
|
5796
|
-
};
|
|
5797
|
-
|
|
5798
|
-
type FooWithoutA = Except<Foo, 'a'>;
|
|
5799
|
-
//=> {b: string}
|
|
5800
|
-
|
|
5801
|
-
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
5802
|
-
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
5803
|
-
|
|
5804
|
-
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
5805
|
-
//=> {a: number} & Partial<Record<"b", never>>
|
|
5806
|
-
|
|
5807
|
-
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
5808
|
-
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
5809
|
-
```
|
|
5810
|
-
|
|
5811
|
-
@category Object
|
|
5812
|
-
*/
|
|
5813
|
-
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
5814
|
-
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
5815
|
-
} & (Options['requireExactProps'] extends true
|
|
5816
|
-
? Partial<Record<KeysType, never>>
|
|
5817
|
-
: {});
|
|
5818
|
-
|
|
5819
|
-
/**
|
|
5820
|
-
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
5821
|
-
|
|
5822
|
-
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
5823
|
-
|
|
5824
|
-
@example
|
|
5825
|
-
```
|
|
5826
|
-
import type {ConditionalKeys} from 'type-fest';
|
|
5827
|
-
|
|
5828
|
-
interface Example {
|
|
5829
|
-
a: string;
|
|
5830
|
-
b: string | number;
|
|
5831
|
-
c?: string;
|
|
5832
|
-
d: {};
|
|
4161
|
+
* @documentationMaturity preview
|
|
4162
|
+
*/
|
|
4163
|
+
ascending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
|
|
4164
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
4165
|
+
* @documentationMaturity preview
|
|
4166
|
+
*/
|
|
4167
|
+
descending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
|
|
4168
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
4169
|
+
* @documentationMaturity preview
|
|
4170
|
+
*/
|
|
4171
|
+
limit: (limit: number) => ReferredFriendsQueryBuilder;
|
|
4172
|
+
/** @param cursor - A pointer to specific record
|
|
4173
|
+
* @documentationMaturity preview
|
|
4174
|
+
*/
|
|
4175
|
+
skipTo: (cursor: string) => ReferredFriendsQueryBuilder;
|
|
4176
|
+
/** @documentationMaturity preview */
|
|
4177
|
+
find: () => Promise<ReferredFriendsQueryResult>;
|
|
5833
4178
|
}
|
|
5834
4179
|
|
|
5835
|
-
|
|
5836
|
-
|
|
5837
|
-
|
|
5838
|
-
|
|
5839
|
-
|
|
5840
|
-
|
|
5841
|
-
|
|
5842
|
-
|
|
5843
|
-
|
|
5844
|
-
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
```
|
|
5848
|
-
|
|
5849
|
-
@category Object
|
|
5850
|
-
*/
|
|
5851
|
-
type ConditionalKeys<Base, Condition> = NonNullable<
|
|
5852
|
-
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
5853
|
-
{
|
|
5854
|
-
// Map through all the keys of the given base type.
|
|
5855
|
-
[Key in keyof Base]:
|
|
5856
|
-
// Pick only keys with types extending the given `Condition` type.
|
|
5857
|
-
Base[Key] extends Condition
|
|
5858
|
-
// Retain this key since the condition passes.
|
|
5859
|
-
? Key
|
|
5860
|
-
// Discard this key since the condition fails.
|
|
5861
|
-
: never;
|
|
5862
|
-
|
|
5863
|
-
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
5864
|
-
}[keyof Base]
|
|
5865
|
-
>;
|
|
5866
|
-
|
|
5867
|
-
/**
|
|
5868
|
-
Exclude keys from a shape that matches the given `Condition`.
|
|
5869
|
-
|
|
5870
|
-
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.
|
|
5871
|
-
|
|
5872
|
-
@example
|
|
5873
|
-
```
|
|
5874
|
-
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
5875
|
-
|
|
5876
|
-
class Awesome {
|
|
5877
|
-
name: string;
|
|
5878
|
-
successes: number;
|
|
5879
|
-
failures: bigint;
|
|
5880
|
-
|
|
5881
|
-
run() {}
|
|
4180
|
+
declare function createReferredFriend$1(httpClient: HttpClient): CreateReferredFriendSignature;
|
|
4181
|
+
interface CreateReferredFriendSignature {
|
|
4182
|
+
/**
|
|
4183
|
+
* Creates a new referred friend or returns an existing entity if it already exists.
|
|
4184
|
+
*
|
|
4185
|
+
* This method must be called with a [member identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities#site-members).
|
|
4186
|
+
*
|
|
4187
|
+
* A referral code must be provided either in the request or via scope.
|
|
4188
|
+
*
|
|
4189
|
+
* The member must be eligible to become a referred friend.
|
|
4190
|
+
*/
|
|
4191
|
+
(options?: CreateReferredFriendOptions | undefined): Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
|
|
5882
4192
|
}
|
|
5883
|
-
|
|
5884
|
-
|
|
5885
|
-
|
|
5886
|
-
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
interface
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
4193
|
+
declare function getReferredFriend$1(httpClient: HttpClient): GetReferredFriendSignature;
|
|
4194
|
+
interface GetReferredFriendSignature {
|
|
4195
|
+
/**
|
|
4196
|
+
* Retrieves a referred friend by ID.
|
|
4197
|
+
* @param - ID of the referred friend to retrieve.
|
|
4198
|
+
*/
|
|
4199
|
+
(referredFriendId: string): Promise<GetReferredFriendResponse & GetReferredFriendResponseNonNullableFields>;
|
|
4200
|
+
}
|
|
4201
|
+
declare function getReferredFriendByContactId$1(httpClient: HttpClient): GetReferredFriendByContactIdSignature;
|
|
4202
|
+
interface GetReferredFriendByContactIdSignature {
|
|
4203
|
+
/**
|
|
4204
|
+
* Retrieves a referred friend by contact ID.
|
|
4205
|
+
*
|
|
4206
|
+
* You can use `me` instead of a specific contact ID to get the referred friend for the current identity's contact.
|
|
4207
|
+
* @param - Contact ID or "me" to get the current identity's contact.
|
|
4208
|
+
* @returns Retrieved referred friend.
|
|
4209
|
+
*/
|
|
4210
|
+
(contactId: string): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
4211
|
+
}
|
|
4212
|
+
declare function updateReferredFriend$1(httpClient: HttpClient): UpdateReferredFriendSignature;
|
|
4213
|
+
interface UpdateReferredFriendSignature {
|
|
4214
|
+
/**
|
|
4215
|
+
* Updates a referred friend. Supports partial updates.
|
|
4216
|
+
*
|
|
4217
|
+
* You must pass the latest `revision` for a successful update.
|
|
4218
|
+
* @param - ID of the referred friend.
|
|
4219
|
+
* @returns Updated referred friend.
|
|
4220
|
+
*/
|
|
4221
|
+
(_id: string, referredFriend: UpdateReferredFriend): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
4222
|
+
}
|
|
4223
|
+
declare function deleteReferredFriend$1(httpClient: HttpClient): DeleteReferredFriendSignature;
|
|
4224
|
+
interface DeleteReferredFriendSignature {
|
|
4225
|
+
/**
|
|
4226
|
+
* Deletes a referred friend.
|
|
4227
|
+
* @param - ID of the referred friend to delete.
|
|
4228
|
+
*/
|
|
4229
|
+
(referredFriendId: string, options?: DeleteReferredFriendOptions | undefined): Promise<void>;
|
|
4230
|
+
}
|
|
4231
|
+
declare function queryReferredFriend$1(httpClient: HttpClient): QueryReferredFriendSignature;
|
|
4232
|
+
interface QueryReferredFriendSignature {
|
|
4233
|
+
/**
|
|
4234
|
+
* Creates a query to retrieve a list of referred friends.
|
|
4235
|
+
*
|
|
4236
|
+
* The `queryReferredFriend()` function builds a query to retrieve a list of events and returns a `ReferredFriendsQueryBuilder` object.
|
|
4237
|
+
*
|
|
4238
|
+
* The returned object contains the query definition, which is typically used to run the query using the `find()` function.
|
|
4239
|
+
*
|
|
4240
|
+
* You can refine the query by chaining `ReferredFriendsQueryBuilder` functions onto the query. `ReferredFriendsQueryBuilder` functions enable you to sort, filter, and control the results `queryReferredFriend()` returns.
|
|
4241
|
+
*
|
|
4242
|
+
* `queryReferredFriend()` runs with these `ReferredFriendQueryBuilder` defaults, which you can override:
|
|
4243
|
+
*
|
|
4244
|
+
* - `limit(50)`
|
|
4245
|
+
* - `descending("_createdDate")`
|
|
4246
|
+
*
|
|
4247
|
+
* The functions that are chained to `queryReferredFriend()` are applied in the order they're called. For example, if you apply ascending('status') and then descending('referringCustomerId'), the results are sorted first by the status, and then, if there are multiple results with the same status, the items are sorted by referring customer ID.
|
|
4248
|
+
*/
|
|
4249
|
+
(): ReferredFriendsQueryBuilder;
|
|
5897
4250
|
}
|
|
4251
|
+
declare const onReferredFriendCreated$1: EventDefinition<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
|
|
4252
|
+
declare const onReferredFriendUpdated$1: EventDefinition<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
|
|
4253
|
+
declare const onReferredFriendDeleted$1: EventDefinition<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
|
|
5898
4254
|
|
|
5899
|
-
|
|
5900
|
-
//=> {b: string | number; c: () => void; d: {}}
|
|
5901
|
-
```
|
|
4255
|
+
declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
5902
4256
|
|
|
5903
|
-
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
|
|
5907
|
-
|
|
5908
|
-
>;
|
|
4257
|
+
declare const createReferredFriend: MaybeContext<BuildRESTFunction<typeof createReferredFriend$1> & typeof createReferredFriend$1>;
|
|
4258
|
+
declare const getReferredFriend: MaybeContext<BuildRESTFunction<typeof getReferredFriend$1> & typeof getReferredFriend$1>;
|
|
4259
|
+
declare const getReferredFriendByContactId: MaybeContext<BuildRESTFunction<typeof getReferredFriendByContactId$1> & typeof getReferredFriendByContactId$1>;
|
|
4260
|
+
declare const updateReferredFriend: MaybeContext<BuildRESTFunction<typeof updateReferredFriend$1> & typeof updateReferredFriend$1>;
|
|
4261
|
+
declare const deleteReferredFriend: MaybeContext<BuildRESTFunction<typeof deleteReferredFriend$1> & typeof deleteReferredFriend$1>;
|
|
4262
|
+
declare const queryReferredFriend: MaybeContext<BuildRESTFunction<typeof queryReferredFriend$1> & typeof queryReferredFriend$1>;
|
|
5909
4263
|
|
|
4264
|
+
type _publicOnReferredFriendCreatedType = typeof onReferredFriendCreated$1;
|
|
5910
4265
|
/**
|
|
5911
|
-
*
|
|
5912
|
-
* can either be a REST module or a host module.
|
|
5913
|
-
* This type is recursive, so it can describe nested modules.
|
|
4266
|
+
* Triggered when a referred friend is created.
|
|
5914
4267
|
*/
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
4268
|
+
declare const onReferredFriendCreated: ReturnType<typeof createEventModule$1<_publicOnReferredFriendCreatedType>>;
|
|
4269
|
+
|
|
4270
|
+
type _publicOnReferredFriendUpdatedType = typeof onReferredFriendUpdated$1;
|
|
5918
4271
|
/**
|
|
5919
|
-
*
|
|
5920
|
-
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
5921
|
-
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
5922
|
-
* do not match the given host (as they will not work with the given host).
|
|
4272
|
+
* Triggered when a referred friend is updated.
|
|
5923
4273
|
*/
|
|
5924
|
-
|
|
5925
|
-
done: T;
|
|
5926
|
-
recurse: T extends {
|
|
5927
|
-
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
5928
|
-
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$1<any> ? BuildEventDefinition$1<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
5929
|
-
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
5930
|
-
-1,
|
|
5931
|
-
0,
|
|
5932
|
-
1,
|
|
5933
|
-
2,
|
|
5934
|
-
3,
|
|
5935
|
-
4,
|
|
5936
|
-
5
|
|
5937
|
-
][Depth]> : never;
|
|
5938
|
-
}, EmptyObject>;
|
|
5939
|
-
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
5940
|
-
type PublicMetadata = {
|
|
5941
|
-
PACKAGE_NAME?: string;
|
|
5942
|
-
};
|
|
4274
|
+
declare const onReferredFriendUpdated: ReturnType<typeof createEventModule$1<_publicOnReferredFriendUpdatedType>>;
|
|
5943
4275
|
|
|
5944
|
-
|
|
5945
|
-
interface ContextualClient {
|
|
5946
|
-
}
|
|
5947
|
-
}
|
|
4276
|
+
type _publicOnReferredFriendDeletedType = typeof onReferredFriendDeleted$1;
|
|
5948
4277
|
/**
|
|
5949
|
-
*
|
|
5950
|
-
* case a contextual client is available.
|
|
4278
|
+
* Triggered when a referred friend is deleted.
|
|
5951
4279
|
*/
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
4280
|
+
declare const onReferredFriendDeleted: ReturnType<typeof createEventModule$1<_publicOnReferredFriendDeletedType>>;
|
|
4281
|
+
|
|
4282
|
+
type index_d$1_CreateReferredFriendOptions = CreateReferredFriendOptions;
|
|
4283
|
+
type index_d$1_CreateReferredFriendRequest = CreateReferredFriendRequest;
|
|
4284
|
+
type index_d$1_CreateReferredFriendResponse = CreateReferredFriendResponse;
|
|
4285
|
+
type index_d$1_CreateReferredFriendResponseNonNullableFields = CreateReferredFriendResponseNonNullableFields;
|
|
4286
|
+
type index_d$1_DeleteReferredFriendOptions = DeleteReferredFriendOptions;
|
|
4287
|
+
type index_d$1_DeleteReferredFriendRequest = DeleteReferredFriendRequest;
|
|
4288
|
+
type index_d$1_DeleteReferredFriendResponse = DeleteReferredFriendResponse;
|
|
4289
|
+
type index_d$1_Empty = Empty;
|
|
4290
|
+
type index_d$1_GetReferredFriendByContactIdRequest = GetReferredFriendByContactIdRequest;
|
|
4291
|
+
type index_d$1_GetReferredFriendByContactIdResponse = GetReferredFriendByContactIdResponse;
|
|
4292
|
+
type index_d$1_GetReferredFriendByContactIdResponseNonNullableFields = GetReferredFriendByContactIdResponseNonNullableFields;
|
|
4293
|
+
type index_d$1_GetReferredFriendRequest = GetReferredFriendRequest;
|
|
4294
|
+
type index_d$1_GetReferredFriendResponse = GetReferredFriendResponse;
|
|
4295
|
+
type index_d$1_GetReferredFriendResponseNonNullableFields = GetReferredFriendResponseNonNullableFields;
|
|
4296
|
+
type index_d$1_QueryReferredFriendRequest = QueryReferredFriendRequest;
|
|
4297
|
+
type index_d$1_QueryReferredFriendResponse = QueryReferredFriendResponse;
|
|
4298
|
+
type index_d$1_QueryReferredFriendResponseNonNullableFields = QueryReferredFriendResponseNonNullableFields;
|
|
4299
|
+
type index_d$1_ReferredFriend = ReferredFriend;
|
|
4300
|
+
type index_d$1_ReferredFriendCreatedEnvelope = ReferredFriendCreatedEnvelope;
|
|
4301
|
+
type index_d$1_ReferredFriendDeletedEnvelope = ReferredFriendDeletedEnvelope;
|
|
4302
|
+
type index_d$1_ReferredFriendDetails = ReferredFriendDetails;
|
|
4303
|
+
type index_d$1_ReferredFriendNonNullableFields = ReferredFriendNonNullableFields;
|
|
4304
|
+
type index_d$1_ReferredFriendUpdatedEnvelope = ReferredFriendUpdatedEnvelope;
|
|
4305
|
+
type index_d$1_ReferredFriendsQueryBuilder = ReferredFriendsQueryBuilder;
|
|
4306
|
+
type index_d$1_ReferredFriendsQueryResult = ReferredFriendsQueryResult;
|
|
4307
|
+
type index_d$1_Status = Status;
|
|
4308
|
+
declare const index_d$1_Status: typeof Status;
|
|
4309
|
+
type index_d$1_SuccessfulReferralEvent = SuccessfulReferralEvent;
|
|
4310
|
+
type index_d$1_UpdateReferredFriend = UpdateReferredFriend;
|
|
4311
|
+
type index_d$1_UpdateReferredFriendRequest = UpdateReferredFriendRequest;
|
|
4312
|
+
type index_d$1_UpdateReferredFriendResponse = UpdateReferredFriendResponse;
|
|
4313
|
+
type index_d$1_UpdateReferredFriendResponseNonNullableFields = UpdateReferredFriendResponseNonNullableFields;
|
|
4314
|
+
type index_d$1__publicOnReferredFriendCreatedType = _publicOnReferredFriendCreatedType;
|
|
4315
|
+
type index_d$1__publicOnReferredFriendDeletedType = _publicOnReferredFriendDeletedType;
|
|
4316
|
+
type index_d$1__publicOnReferredFriendUpdatedType = _publicOnReferredFriendUpdatedType;
|
|
4317
|
+
declare const index_d$1_createReferredFriend: typeof createReferredFriend;
|
|
4318
|
+
declare const index_d$1_deleteReferredFriend: typeof deleteReferredFriend;
|
|
4319
|
+
declare const index_d$1_getReferredFriend: typeof getReferredFriend;
|
|
4320
|
+
declare const index_d$1_getReferredFriendByContactId: typeof getReferredFriendByContactId;
|
|
4321
|
+
declare const index_d$1_onReferredFriendCreated: typeof onReferredFriendCreated;
|
|
4322
|
+
declare const index_d$1_onReferredFriendDeleted: typeof onReferredFriendDeleted;
|
|
4323
|
+
declare const index_d$1_onReferredFriendUpdated: typeof onReferredFriendUpdated;
|
|
4324
|
+
declare const index_d$1_queryReferredFriend: typeof queryReferredFriend;
|
|
4325
|
+
declare const index_d$1_updateReferredFriend: typeof updateReferredFriend;
|
|
4326
|
+
declare namespace index_d$1 {
|
|
4327
|
+
export { type ActionEvent$1 as ActionEvent, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$1_CreateReferredFriendOptions as CreateReferredFriendOptions, type index_d$1_CreateReferredFriendRequest as CreateReferredFriendRequest, type index_d$1_CreateReferredFriendResponse as CreateReferredFriendResponse, type index_d$1_CreateReferredFriendResponseNonNullableFields as CreateReferredFriendResponseNonNullableFields, 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 index_d$1_DeleteReferredFriendOptions as DeleteReferredFriendOptions, type index_d$1_DeleteReferredFriendRequest as DeleteReferredFriendRequest, type index_d$1_DeleteReferredFriendResponse as DeleteReferredFriendResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type index_d$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type index_d$1_GetReferredFriendByContactIdRequest as GetReferredFriendByContactIdRequest, type index_d$1_GetReferredFriendByContactIdResponse as GetReferredFriendByContactIdResponse, type index_d$1_GetReferredFriendByContactIdResponseNonNullableFields as GetReferredFriendByContactIdResponseNonNullableFields, type index_d$1_GetReferredFriendRequest as GetReferredFriendRequest, type index_d$1_GetReferredFriendResponse as GetReferredFriendResponse, type index_d$1_GetReferredFriendResponseNonNullableFields as GetReferredFriendResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type index_d$1_QueryReferredFriendRequest as QueryReferredFriendRequest, type index_d$1_QueryReferredFriendResponse as QueryReferredFriendResponse, type index_d$1_QueryReferredFriendResponseNonNullableFields as QueryReferredFriendResponseNonNullableFields, type index_d$1_ReferredFriend as ReferredFriend, type index_d$1_ReferredFriendCreatedEnvelope as ReferredFriendCreatedEnvelope, type index_d$1_ReferredFriendDeletedEnvelope as ReferredFriendDeletedEnvelope, type index_d$1_ReferredFriendDetails as ReferredFriendDetails, type index_d$1_ReferredFriendNonNullableFields as ReferredFriendNonNullableFields, type index_d$1_ReferredFriendUpdatedEnvelope as ReferredFriendUpdatedEnvelope, type index_d$1_ReferredFriendsQueryBuilder as ReferredFriendsQueryBuilder, type index_d$1_ReferredFriendsQueryResult as ReferredFriendsQueryResult, type RestoreInfo$1 as RestoreInfo, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, index_d$1_Status as Status, type index_d$1_SuccessfulReferralEvent as SuccessfulReferralEvent, type index_d$1_UpdateReferredFriend as UpdateReferredFriend, type index_d$1_UpdateReferredFriendRequest as UpdateReferredFriendRequest, type index_d$1_UpdateReferredFriendResponse as UpdateReferredFriendResponse, type index_d$1_UpdateReferredFriendResponseNonNullableFields as UpdateReferredFriendResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, type index_d$1__publicOnReferredFriendCreatedType as _publicOnReferredFriendCreatedType, type index_d$1__publicOnReferredFriendDeletedType as _publicOnReferredFriendDeletedType, type index_d$1__publicOnReferredFriendUpdatedType as _publicOnReferredFriendUpdatedType, index_d$1_createReferredFriend as createReferredFriend, index_d$1_deleteReferredFriend as deleteReferredFriend, index_d$1_getReferredFriend as getReferredFriend, index_d$1_getReferredFriendByContactId as getReferredFriendByContactId, index_d$1_onReferredFriendCreated as onReferredFriendCreated, index_d$1_onReferredFriendDeleted as onReferredFriendDeleted, index_d$1_onReferredFriendUpdated as onReferredFriendUpdated, onReferredFriendCreated$1 as publicOnReferredFriendCreated, onReferredFriendDeleted$1 as publicOnReferredFriendDeleted, onReferredFriendUpdated$1 as publicOnReferredFriendUpdated, index_d$1_queryReferredFriend as queryReferredFriend, index_d$1_updateReferredFriend as updateReferredFriend };
|
|
4328
|
+
}
|
|
5955
4329
|
|
|
5956
4330
|
interface ReferringCustomer {
|
|
5957
4331
|
/**
|
|
@@ -5978,12 +4352,12 @@ interface ReferringCustomer {
|
|
|
5978
4352
|
* Date and time the referring customer was created.
|
|
5979
4353
|
* @readonly
|
|
5980
4354
|
*/
|
|
5981
|
-
_createdDate?: Date;
|
|
4355
|
+
_createdDate?: Date | null;
|
|
5982
4356
|
/**
|
|
5983
4357
|
* Date and time the referring customer was last updated.
|
|
5984
4358
|
* @readonly
|
|
5985
4359
|
*/
|
|
5986
|
-
_updatedDate?: Date;
|
|
4360
|
+
_updatedDate?: Date | null;
|
|
5987
4361
|
}
|
|
5988
4362
|
interface GenerateReferringCustomerForContactRequest {
|
|
5989
4363
|
/** Contact ID or `"me"` to generate the current identity's referring customer. */
|
|
@@ -6120,7 +4494,7 @@ interface DomainEvent extends DomainEventBodyOneOf {
|
|
|
6120
4494
|
/** ID of the entity associated with the event. */
|
|
6121
4495
|
entityId?: string;
|
|
6122
4496
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
6123
|
-
eventTime?: Date;
|
|
4497
|
+
eventTime?: Date | null;
|
|
6124
4498
|
/**
|
|
6125
4499
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
6126
4500
|
* (for example, GDPR).
|
|
@@ -6149,7 +4523,7 @@ interface EntityCreatedEvent {
|
|
|
6149
4523
|
entity?: string;
|
|
6150
4524
|
}
|
|
6151
4525
|
interface RestoreInfo {
|
|
6152
|
-
deletedDate?: Date;
|
|
4526
|
+
deletedDate?: Date | null;
|
|
6153
4527
|
}
|
|
6154
4528
|
interface EntityUpdatedEvent {
|
|
6155
4529
|
/**
|
|
@@ -6251,7 +4625,7 @@ interface EventMetadata extends BaseEventMetadata {
|
|
|
6251
4625
|
/** ID of the entity associated with the event. */
|
|
6252
4626
|
entityId?: string;
|
|
6253
4627
|
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
6254
|
-
eventTime?: Date;
|
|
4628
|
+
eventTime?: Date | null;
|
|
6255
4629
|
/**
|
|
6256
4630
|
* Whether the event was triggered as a result of a privacy regulation application
|
|
6257
4631
|
* (for example, GDPR).
|
|
@@ -6416,26 +4790,8 @@ interface DeleteReferringCustomerSignature {
|
|
|
6416
4790
|
*/
|
|
6417
4791
|
(referringCustomerId: string, options?: DeleteReferringCustomerOptions | undefined): Promise<void>;
|
|
6418
4792
|
}
|
|
6419
|
-
declare const onReferringCustomerCreated$1: EventDefinition
|
|
6420
|
-
declare const onReferringCustomerDeleted$1: EventDefinition
|
|
6421
|
-
|
|
6422
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
6423
|
-
__type: 'event-definition';
|
|
6424
|
-
type: Type;
|
|
6425
|
-
isDomainEvent?: boolean;
|
|
6426
|
-
transformations?: (envelope: unknown) => Payload;
|
|
6427
|
-
__payload: Payload;
|
|
6428
|
-
};
|
|
6429
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
6430
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
6431
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
6432
|
-
|
|
6433
|
-
declare global {
|
|
6434
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
6435
|
-
interface SymbolConstructor {
|
|
6436
|
-
readonly observable: symbol;
|
|
6437
|
-
}
|
|
6438
|
-
}
|
|
4793
|
+
declare const onReferringCustomerCreated$1: EventDefinition<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
|
|
4794
|
+
declare const onReferringCustomerDeleted$1: EventDefinition<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
|
|
6439
4795
|
|
|
6440
4796
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
6441
4797
|
|