@wix/referral 1.0.27 → 1.0.28
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/build/cjs/context.js +1 -0
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.js +1 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/meta.js +1 -0
- package/build/cjs/meta.js.map +1 -0
- package/package.json +7 -7
- package/type-bundles/context.bundle.d.ts +504 -359
- package/type-bundles/index.bundle.d.ts +504 -359
- package/type-bundles/meta.bundle.d.ts +1 -167
|
@@ -1,39 +1,127 @@
|
|
|
1
|
-
type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
type HostModule<T, H extends Host> = {
|
|
2
|
+
__type: 'host';
|
|
3
|
+
create(host: H): T;
|
|
4
|
+
};
|
|
5
|
+
type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
|
|
6
|
+
type Host<Environment = unknown> = {
|
|
7
|
+
channel: {
|
|
8
|
+
observeState(callback: (props: unknown, environment: Environment) => unknown): {
|
|
9
|
+
disconnect: () => void;
|
|
10
|
+
} | Promise<{
|
|
11
|
+
disconnect: () => void;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
environment?: Environment;
|
|
15
|
+
/**
|
|
16
|
+
* Optional bast url to use for API requests, for example `www.wixapis.com`
|
|
17
|
+
*/
|
|
18
|
+
apiBaseUrl?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Possible data to be provided by every host, for cross cutting concerns
|
|
21
|
+
* like internationalization, billing, etc.
|
|
22
|
+
*/
|
|
23
|
+
essentials?: {
|
|
24
|
+
/**
|
|
25
|
+
* The language of the currently viewed session
|
|
26
|
+
*/
|
|
27
|
+
language?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The locale of the currently viewed session
|
|
30
|
+
*/
|
|
31
|
+
locale?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Any headers that should be passed through to the API requests
|
|
34
|
+
*/
|
|
35
|
+
passThroughHeaders?: Record<string, string>;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
40
|
+
interface HttpClient {
|
|
41
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4
42
|
fetchWithAuth: typeof fetch;
|
|
5
43
|
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
44
|
+
getActiveToken?: () => string | undefined;
|
|
6
45
|
}
|
|
7
|
-
type RequestOptionsFactory
|
|
8
|
-
type HttpResponse
|
|
46
|
+
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
47
|
+
type HttpResponse<T = any> = {
|
|
9
48
|
data: T;
|
|
10
49
|
status: number;
|
|
11
50
|
statusText: string;
|
|
12
51
|
headers: any;
|
|
13
52
|
request?: any;
|
|
14
53
|
};
|
|
15
|
-
type RequestOptions
|
|
54
|
+
type RequestOptions<_TResponse = any, Data = any> = {
|
|
16
55
|
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
17
56
|
url: string;
|
|
18
57
|
data?: Data;
|
|
19
58
|
params?: URLSearchParams;
|
|
20
|
-
} & APIMetadata
|
|
21
|
-
type APIMetadata
|
|
59
|
+
} & APIMetadata;
|
|
60
|
+
type APIMetadata = {
|
|
22
61
|
methodFqn?: string;
|
|
23
62
|
entityFqdn?: string;
|
|
24
63
|
packageName?: string;
|
|
25
64
|
};
|
|
26
|
-
type BuildRESTFunction
|
|
27
|
-
type EventDefinition$
|
|
65
|
+
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
66
|
+
type EventDefinition$4<Payload = unknown, Type extends string = string> = {
|
|
28
67
|
__type: 'event-definition';
|
|
29
68
|
type: Type;
|
|
30
69
|
isDomainEvent?: boolean;
|
|
31
70
|
transformations?: (envelope: unknown) => Payload;
|
|
32
71
|
__payload: Payload;
|
|
33
72
|
};
|
|
34
|
-
declare function EventDefinition$
|
|
35
|
-
type EventHandler$
|
|
36
|
-
type BuildEventDefinition$
|
|
73
|
+
declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
|
|
74
|
+
type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
|
|
75
|
+
type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
|
|
76
|
+
|
|
77
|
+
type ServicePluginMethodInput = {
|
|
78
|
+
request: any;
|
|
79
|
+
metadata: any;
|
|
80
|
+
};
|
|
81
|
+
type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
|
|
82
|
+
type ServicePluginMethodMetadata = {
|
|
83
|
+
name: string;
|
|
84
|
+
primaryHttpMappingPath: string;
|
|
85
|
+
transformations: {
|
|
86
|
+
fromREST: (...args: unknown[]) => ServicePluginMethodInput;
|
|
87
|
+
toREST: (...args: unknown[]) => unknown;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
type ServicePluginDefinition<Contract extends ServicePluginContract> = {
|
|
91
|
+
__type: 'service-plugin-definition';
|
|
92
|
+
componentType: string;
|
|
93
|
+
methods: ServicePluginMethodMetadata[];
|
|
94
|
+
__contract: Contract;
|
|
95
|
+
};
|
|
96
|
+
declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
|
|
97
|
+
type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
|
|
98
|
+
declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
|
|
99
|
+
|
|
100
|
+
type RequestContext = {
|
|
101
|
+
isSSR: boolean;
|
|
102
|
+
host: string;
|
|
103
|
+
protocol?: string;
|
|
104
|
+
};
|
|
105
|
+
type ResponseTransformer = (data: any, headers?: any) => any;
|
|
106
|
+
/**
|
|
107
|
+
* Ambassador request options types are copied mostly from AxiosRequestConfig.
|
|
108
|
+
* They are copied and not imported to reduce the amount of dependencies (to reduce install time).
|
|
109
|
+
* https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
|
|
110
|
+
*/
|
|
111
|
+
type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
|
|
112
|
+
type AmbassadorRequestOptions<T = any> = {
|
|
113
|
+
_?: T;
|
|
114
|
+
url?: string;
|
|
115
|
+
method?: Method;
|
|
116
|
+
params?: any;
|
|
117
|
+
data?: any;
|
|
118
|
+
transformResponse?: ResponseTransformer | ResponseTransformer[];
|
|
119
|
+
};
|
|
120
|
+
type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
|
|
121
|
+
__isAmbassador: boolean;
|
|
122
|
+
};
|
|
123
|
+
type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
|
|
124
|
+
type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
|
|
37
125
|
|
|
38
126
|
declare global {
|
|
39
127
|
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
@@ -42,6 +130,284 @@ declare global {
|
|
|
42
130
|
}
|
|
43
131
|
}
|
|
44
132
|
|
|
133
|
+
declare const emptyObjectSymbol: unique symbol;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
Represents a strictly empty plain object, the `{}` value.
|
|
137
|
+
|
|
138
|
+
When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
|
|
139
|
+
|
|
140
|
+
@example
|
|
141
|
+
```
|
|
142
|
+
import type {EmptyObject} from 'type-fest';
|
|
143
|
+
|
|
144
|
+
// The following illustrates the problem with `{}`.
|
|
145
|
+
const foo1: {} = {}; // Pass
|
|
146
|
+
const foo2: {} = []; // Pass
|
|
147
|
+
const foo3: {} = 42; // Pass
|
|
148
|
+
const foo4: {} = {a: 1}; // Pass
|
|
149
|
+
|
|
150
|
+
// With `EmptyObject` only the first case is valid.
|
|
151
|
+
const bar1: EmptyObject = {}; // Pass
|
|
152
|
+
const bar2: EmptyObject = 42; // Fail
|
|
153
|
+
const bar3: EmptyObject = []; // Fail
|
|
154
|
+
const bar4: EmptyObject = {a: 1}; // Fail
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
|
|
158
|
+
|
|
159
|
+
@category Object
|
|
160
|
+
*/
|
|
161
|
+
type EmptyObject = {[emptyObjectSymbol]?: never};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
Returns a boolean for whether the two given types are equal.
|
|
165
|
+
|
|
166
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
167
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
168
|
+
|
|
169
|
+
Use-cases:
|
|
170
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
171
|
+
|
|
172
|
+
@example
|
|
173
|
+
```
|
|
174
|
+
import type {IsEqual} from 'type-fest';
|
|
175
|
+
|
|
176
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
177
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
178
|
+
type Includes<Value extends readonly any[], Item> =
|
|
179
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
180
|
+
? IsEqual<Value[0], Item> extends true
|
|
181
|
+
? true
|
|
182
|
+
: Includes<rest, Item>
|
|
183
|
+
: false;
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
@category Type Guard
|
|
187
|
+
@category Utilities
|
|
188
|
+
*/
|
|
189
|
+
type IsEqual<A, B> =
|
|
190
|
+
(<G>() => G extends A ? 1 : 2) extends
|
|
191
|
+
(<G>() => G extends B ? 1 : 2)
|
|
192
|
+
? true
|
|
193
|
+
: false;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
Filter out keys from an object.
|
|
197
|
+
|
|
198
|
+
Returns `never` if `Exclude` is strictly equal to `Key`.
|
|
199
|
+
Returns `never` if `Key` extends `Exclude`.
|
|
200
|
+
Returns `Key` otherwise.
|
|
201
|
+
|
|
202
|
+
@example
|
|
203
|
+
```
|
|
204
|
+
type Filtered = Filter<'foo', 'foo'>;
|
|
205
|
+
//=> never
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
@example
|
|
209
|
+
```
|
|
210
|
+
type Filtered = Filter<'bar', string>;
|
|
211
|
+
//=> never
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
@example
|
|
215
|
+
```
|
|
216
|
+
type Filtered = Filter<'bar', 'foo'>;
|
|
217
|
+
//=> 'bar'
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
@see {Except}
|
|
221
|
+
*/
|
|
222
|
+
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
223
|
+
|
|
224
|
+
type ExceptOptions = {
|
|
225
|
+
/**
|
|
226
|
+
Disallow assigning non-specified properties.
|
|
227
|
+
|
|
228
|
+
Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
|
|
229
|
+
|
|
230
|
+
@default false
|
|
231
|
+
*/
|
|
232
|
+
requireExactProps?: boolean;
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
Create a type from an object type without certain keys.
|
|
237
|
+
|
|
238
|
+
We recommend setting the `requireExactProps` option to `true`.
|
|
239
|
+
|
|
240
|
+
This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
|
|
241
|
+
|
|
242
|
+
This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
|
|
243
|
+
|
|
244
|
+
@example
|
|
245
|
+
```
|
|
246
|
+
import type {Except} from 'type-fest';
|
|
247
|
+
|
|
248
|
+
type Foo = {
|
|
249
|
+
a: number;
|
|
250
|
+
b: string;
|
|
251
|
+
};
|
|
252
|
+
|
|
253
|
+
type FooWithoutA = Except<Foo, 'a'>;
|
|
254
|
+
//=> {b: string}
|
|
255
|
+
|
|
256
|
+
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
257
|
+
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
258
|
+
|
|
259
|
+
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
260
|
+
//=> {a: number} & Partial<Record<"b", never>>
|
|
261
|
+
|
|
262
|
+
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
263
|
+
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
@category Object
|
|
267
|
+
*/
|
|
268
|
+
type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
|
|
269
|
+
[KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
|
|
270
|
+
} & (Options['requireExactProps'] extends true
|
|
271
|
+
? Partial<Record<KeysType, never>>
|
|
272
|
+
: {});
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
Extract the keys from a type where the value type of the key extends the given `Condition`.
|
|
276
|
+
|
|
277
|
+
Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
|
|
278
|
+
|
|
279
|
+
@example
|
|
280
|
+
```
|
|
281
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
282
|
+
|
|
283
|
+
interface Example {
|
|
284
|
+
a: string;
|
|
285
|
+
b: string | number;
|
|
286
|
+
c?: string;
|
|
287
|
+
d: {};
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
type StringKeysOnly = ConditionalKeys<Example, string>;
|
|
291
|
+
//=> 'a'
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
|
|
295
|
+
|
|
296
|
+
@example
|
|
297
|
+
```
|
|
298
|
+
import type {ConditionalKeys} from 'type-fest';
|
|
299
|
+
|
|
300
|
+
type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
|
|
301
|
+
//=> 'a' | 'c'
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
@category Object
|
|
305
|
+
*/
|
|
306
|
+
type ConditionalKeys<Base, Condition> = NonNullable<
|
|
307
|
+
// Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
|
|
308
|
+
{
|
|
309
|
+
// Map through all the keys of the given base type.
|
|
310
|
+
[Key in keyof Base]:
|
|
311
|
+
// Pick only keys with types extending the given `Condition` type.
|
|
312
|
+
Base[Key] extends Condition
|
|
313
|
+
// Retain this key since the condition passes.
|
|
314
|
+
? Key
|
|
315
|
+
// Discard this key since the condition fails.
|
|
316
|
+
: never;
|
|
317
|
+
|
|
318
|
+
// Convert the produced object into a union type of the keys which passed the conditional test.
|
|
319
|
+
}[keyof Base]
|
|
320
|
+
>;
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
Exclude keys from a shape that matches the given `Condition`.
|
|
324
|
+
|
|
325
|
+
This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
|
|
326
|
+
|
|
327
|
+
@example
|
|
328
|
+
```
|
|
329
|
+
import type {Primitive, ConditionalExcept} from 'type-fest';
|
|
330
|
+
|
|
331
|
+
class Awesome {
|
|
332
|
+
name: string;
|
|
333
|
+
successes: number;
|
|
334
|
+
failures: bigint;
|
|
335
|
+
|
|
336
|
+
run() {}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
|
|
340
|
+
//=> {run: () => void}
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
@example
|
|
344
|
+
```
|
|
345
|
+
import type {ConditionalExcept} from 'type-fest';
|
|
346
|
+
|
|
347
|
+
interface Example {
|
|
348
|
+
a: string;
|
|
349
|
+
b: string | number;
|
|
350
|
+
c: () => void;
|
|
351
|
+
d: {};
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
type NonStringKeysOnly = ConditionalExcept<Example, string>;
|
|
355
|
+
//=> {b: string | number; c: () => void; d: {}}
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
@category Object
|
|
359
|
+
*/
|
|
360
|
+
type ConditionalExcept<Base, Condition> = Except<
|
|
361
|
+
Base,
|
|
362
|
+
ConditionalKeys<Base, Condition>
|
|
363
|
+
>;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Descriptors are objects that describe the API of a module, and the module
|
|
367
|
+
* can either be a REST module or a host module.
|
|
368
|
+
* This type is recursive, so it can describe nested modules.
|
|
369
|
+
*/
|
|
370
|
+
type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition$4<any> | ServicePluginDefinition<any> | {
|
|
371
|
+
[key: string]: Descriptors | PublicMetadata | any;
|
|
372
|
+
};
|
|
373
|
+
/**
|
|
374
|
+
* This type takes in a descriptors object of a certain Host (including an `unknown` host)
|
|
375
|
+
* and returns an object with the same structure, but with all descriptors replaced with their API.
|
|
376
|
+
* Any non-descriptor properties are removed from the returned object, including descriptors that
|
|
377
|
+
* do not match the given host (as they will not work with the given host).
|
|
378
|
+
*/
|
|
379
|
+
type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
|
|
380
|
+
done: T;
|
|
381
|
+
recurse: T extends {
|
|
382
|
+
__type: typeof SERVICE_PLUGIN_ERROR_TYPE;
|
|
383
|
+
} ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition$4<any> ? BuildEventDefinition$4<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
|
|
384
|
+
[Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
|
|
385
|
+
-1,
|
|
386
|
+
0,
|
|
387
|
+
1,
|
|
388
|
+
2,
|
|
389
|
+
3,
|
|
390
|
+
4,
|
|
391
|
+
5
|
|
392
|
+
][Depth]> : never;
|
|
393
|
+
}, EmptyObject>;
|
|
394
|
+
}[Depth extends -1 ? 'done' : 'recurse'];
|
|
395
|
+
type PublicMetadata = {
|
|
396
|
+
PACKAGE_NAME?: string;
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
declare global {
|
|
400
|
+
interface ContextualClient {
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* A type used to create concerete types from SDK descriptors in
|
|
405
|
+
* case a contextual client is available.
|
|
406
|
+
*/
|
|
407
|
+
type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
|
|
408
|
+
host: Host;
|
|
409
|
+
} ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
|
|
410
|
+
|
|
45
411
|
interface ReferralProgram {
|
|
46
412
|
/** Referral program name. */
|
|
47
413
|
name?: string | null;
|
|
@@ -310,85 +676,6 @@ interface ProgramInSite {
|
|
|
310
676
|
/** Retrieved referral program. */
|
|
311
677
|
referralProgram?: ReferralProgram;
|
|
312
678
|
}
|
|
313
|
-
interface QueryReferralProgramsRequest {
|
|
314
|
-
/** Query options. */
|
|
315
|
-
query: CursorQuery$4;
|
|
316
|
-
}
|
|
317
|
-
interface CursorQuery$4 extends CursorQueryPagingMethodOneOf$4 {
|
|
318
|
-
/**
|
|
319
|
-
* Cursor paging options.
|
|
320
|
-
*
|
|
321
|
-
* Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
|
|
322
|
-
*/
|
|
323
|
-
cursorPaging?: CursorPaging$4;
|
|
324
|
-
/**
|
|
325
|
-
* Filter object.
|
|
326
|
-
*
|
|
327
|
-
* Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
|
|
328
|
-
*/
|
|
329
|
-
filter?: Record<string, any> | null;
|
|
330
|
-
/**
|
|
331
|
-
* Sort object.
|
|
332
|
-
*
|
|
333
|
-
* Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
|
|
334
|
-
*/
|
|
335
|
-
sort?: Sorting$4[];
|
|
336
|
-
}
|
|
337
|
-
/** @oneof */
|
|
338
|
-
interface CursorQueryPagingMethodOneOf$4 {
|
|
339
|
-
/**
|
|
340
|
-
* Cursor paging options.
|
|
341
|
-
*
|
|
342
|
-
* Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
|
|
343
|
-
*/
|
|
344
|
-
cursorPaging?: CursorPaging$4;
|
|
345
|
-
}
|
|
346
|
-
interface Sorting$4 {
|
|
347
|
-
/** Name of the field to sort by. */
|
|
348
|
-
fieldName?: string;
|
|
349
|
-
/** Sort order. */
|
|
350
|
-
order?: SortOrder$4;
|
|
351
|
-
}
|
|
352
|
-
declare enum SortOrder$4 {
|
|
353
|
-
ASC = "ASC",
|
|
354
|
-
DESC = "DESC"
|
|
355
|
-
}
|
|
356
|
-
interface CursorPaging$4 {
|
|
357
|
-
/** Maximum number of items to return in the results. */
|
|
358
|
-
limit?: number | null;
|
|
359
|
-
/**
|
|
360
|
-
* Pointer to the next or previous page in the list of results.
|
|
361
|
-
*
|
|
362
|
-
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
363
|
-
* Not relevant for the first request.
|
|
364
|
-
*/
|
|
365
|
-
cursor?: string | null;
|
|
366
|
-
}
|
|
367
|
-
interface QueryReferralProgramsResponse {
|
|
368
|
-
/** Referral programs matching the query. */
|
|
369
|
-
referralPrograms?: ReferralProgram[];
|
|
370
|
-
/** Paging metadata. */
|
|
371
|
-
pagingMetadata?: CursorPagingMetadata$4;
|
|
372
|
-
}
|
|
373
|
-
interface CursorPagingMetadata$4 {
|
|
374
|
-
/** Number of items returned in current page. */
|
|
375
|
-
count?: number | null;
|
|
376
|
-
/** Cursor strings that point to the next page, previous page, or both. */
|
|
377
|
-
cursors?: Cursors$4;
|
|
378
|
-
/**
|
|
379
|
-
* Whether there are more pages to retrieve following the current page.
|
|
380
|
-
*
|
|
381
|
-
* + `true`: Another page of results can be retrieved.
|
|
382
|
-
* + `false`: This is the last page.
|
|
383
|
-
*/
|
|
384
|
-
hasNext?: boolean | null;
|
|
385
|
-
}
|
|
386
|
-
interface Cursors$4 {
|
|
387
|
-
/** Cursor string pointing to the next page in the list of results. */
|
|
388
|
-
next?: string | null;
|
|
389
|
-
/** Cursor pointing to the previous page in the list of results. */
|
|
390
|
-
prev?: string | null;
|
|
391
|
-
}
|
|
392
679
|
interface UpdateReferralProgramRequest {
|
|
393
680
|
/** Referral program to update. Include the latest `revision` for a successful update. */
|
|
394
681
|
referralProgram: ReferralProgram;
|
|
@@ -1439,9 +1726,6 @@ interface ReferralProgramNonNullableFields {
|
|
|
1439
1726
|
interface GetReferralProgramResponseNonNullableFields {
|
|
1440
1727
|
referralProgram?: ReferralProgramNonNullableFields;
|
|
1441
1728
|
}
|
|
1442
|
-
interface QueryReferralProgramsResponseNonNullableFields {
|
|
1443
|
-
referralPrograms: ReferralProgramNonNullableFields[];
|
|
1444
|
-
}
|
|
1445
1729
|
interface UpdateReferralProgramResponseNonNullableFields {
|
|
1446
1730
|
referralProgram?: ReferralProgramNonNullableFields;
|
|
1447
1731
|
}
|
|
@@ -1514,31 +1798,6 @@ interface ProgramUpdatedEnvelope {
|
|
|
1514
1798
|
entity: ReferralProgram;
|
|
1515
1799
|
metadata: EventMetadata$3;
|
|
1516
1800
|
}
|
|
1517
|
-
interface QueryCursorResult$4 {
|
|
1518
|
-
cursors: Cursors$4;
|
|
1519
|
-
hasNext: () => boolean;
|
|
1520
|
-
hasPrev: () => boolean;
|
|
1521
|
-
length: number;
|
|
1522
|
-
pageSize: number;
|
|
1523
|
-
}
|
|
1524
|
-
interface ReferralProgramsQueryResult extends QueryCursorResult$4 {
|
|
1525
|
-
items: ReferralProgram[];
|
|
1526
|
-
query: ReferralProgramsQueryBuilder;
|
|
1527
|
-
next: () => Promise<ReferralProgramsQueryResult>;
|
|
1528
|
-
prev: () => Promise<ReferralProgramsQueryResult>;
|
|
1529
|
-
}
|
|
1530
|
-
interface ReferralProgramsQueryBuilder {
|
|
1531
|
-
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
1532
|
-
* @documentationMaturity preview
|
|
1533
|
-
*/
|
|
1534
|
-
limit: (limit: number) => ReferralProgramsQueryBuilder;
|
|
1535
|
-
/** @param cursor - A pointer to specific record
|
|
1536
|
-
* @documentationMaturity preview
|
|
1537
|
-
*/
|
|
1538
|
-
skipTo: (cursor: string) => ReferralProgramsQueryBuilder;
|
|
1539
|
-
/** @documentationMaturity preview */
|
|
1540
|
-
find: () => Promise<ReferralProgramsQueryResult>;
|
|
1541
|
-
}
|
|
1542
1801
|
interface GetAiSocialMediaPostsSuggestionsOptions {
|
|
1543
1802
|
/** Topic to generate social media post suggestions for. For example, fitness, education, technology. */
|
|
1544
1803
|
topic?: string;
|
|
@@ -1548,27 +1807,14 @@ interface GenerateAiSocialMediaPostsSuggestionsOptions {
|
|
|
1548
1807
|
topic?: string;
|
|
1549
1808
|
}
|
|
1550
1809
|
|
|
1551
|
-
declare function getReferralProgram$1(httpClient: HttpClient
|
|
1810
|
+
declare function getReferralProgram$1(httpClient: HttpClient): GetReferralProgramSignature;
|
|
1552
1811
|
interface GetReferralProgramSignature {
|
|
1553
1812
|
/**
|
|
1554
1813
|
* Retrieves the referral program.
|
|
1555
1814
|
*/
|
|
1556
1815
|
(): Promise<GetReferralProgramResponse & GetReferralProgramResponseNonNullableFields>;
|
|
1557
1816
|
}
|
|
1558
|
-
declare function
|
|
1559
|
-
interface QueryReferralProgramsSignature {
|
|
1560
|
-
/**
|
|
1561
|
-
* Retrieves a list of referral programs, given the provided paging, filtering, and sorting.
|
|
1562
|
-
*
|
|
1563
|
-
* To learn about working with _Query_ method, see
|
|
1564
|
-
* [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
|
|
1565
|
-
* [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
|
|
1566
|
-
* and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
|
|
1567
|
-
* @deprecated
|
|
1568
|
-
*/
|
|
1569
|
-
(): ReferralProgramsQueryBuilder;
|
|
1570
|
-
}
|
|
1571
|
-
declare function updateReferralProgram$1(httpClient: HttpClient$4): UpdateReferralProgramSignature;
|
|
1817
|
+
declare function updateReferralProgram$1(httpClient: HttpClient): UpdateReferralProgramSignature;
|
|
1572
1818
|
interface UpdateReferralProgramSignature {
|
|
1573
1819
|
/**
|
|
1574
1820
|
* Updates a referral program. Supports partial updates.
|
|
@@ -1579,21 +1825,21 @@ interface UpdateReferralProgramSignature {
|
|
|
1579
1825
|
*/
|
|
1580
1826
|
(referralProgram: ReferralProgram): Promise<UpdateReferralProgramResponse & UpdateReferralProgramResponseNonNullableFields>;
|
|
1581
1827
|
}
|
|
1582
|
-
declare function activateReferralProgram$1(httpClient: HttpClient
|
|
1828
|
+
declare function activateReferralProgram$1(httpClient: HttpClient): ActivateReferralProgramSignature;
|
|
1583
1829
|
interface ActivateReferralProgramSignature {
|
|
1584
1830
|
/**
|
|
1585
1831
|
* Activates the referral program, changing its status to `ACTIVE`.
|
|
1586
1832
|
*/
|
|
1587
1833
|
(): Promise<ActivateReferralProgramResponse & ActivateReferralProgramResponseNonNullableFields>;
|
|
1588
1834
|
}
|
|
1589
|
-
declare function pauseReferralProgram$1(httpClient: HttpClient
|
|
1835
|
+
declare function pauseReferralProgram$1(httpClient: HttpClient): PauseReferralProgramSignature;
|
|
1590
1836
|
interface PauseReferralProgramSignature {
|
|
1591
1837
|
/**
|
|
1592
1838
|
* Pauses the referral program, changing its status to `PAUSED`.
|
|
1593
1839
|
*/
|
|
1594
1840
|
(): Promise<PauseReferralProgramResponse & PauseReferralProgramResponseNonNullableFields>;
|
|
1595
1841
|
}
|
|
1596
|
-
declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient
|
|
1842
|
+
declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GetAiSocialMediaPostsSuggestionsSignature;
|
|
1597
1843
|
interface GetAiSocialMediaPostsSuggestionsSignature {
|
|
1598
1844
|
/**
|
|
1599
1845
|
* Retrieves pre-generated AI social media post suggestions for promoting the referral program.
|
|
@@ -1605,7 +1851,7 @@ interface GetAiSocialMediaPostsSuggestionsSignature {
|
|
|
1605
1851
|
*/
|
|
1606
1852
|
(options?: GetAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GetAISocialMediaPostsSuggestionsResponse & GetAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
1607
1853
|
}
|
|
1608
|
-
declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient
|
|
1854
|
+
declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GenerateAiSocialMediaPostsSuggestionsSignature;
|
|
1609
1855
|
interface GenerateAiSocialMediaPostsSuggestionsSignature {
|
|
1610
1856
|
/**
|
|
1611
1857
|
* Creates new AI-generated social media post suggestions for promoting the referral program.
|
|
@@ -1616,25 +1862,42 @@ interface GenerateAiSocialMediaPostsSuggestionsSignature {
|
|
|
1616
1862
|
*/
|
|
1617
1863
|
(options?: GenerateAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GenerateAISocialMediaPostsSuggestionsResponse & GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
1618
1864
|
}
|
|
1619
|
-
declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient
|
|
1865
|
+
declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient): GetReferralProgramPremiumFeaturesSignature;
|
|
1620
1866
|
interface GetReferralProgramPremiumFeaturesSignature {
|
|
1621
1867
|
/**
|
|
1622
1868
|
* Retrieves information about the enabled premium features for the referral program.
|
|
1623
1869
|
*/
|
|
1624
1870
|
(): Promise<GetReferralProgramPremiumFeaturesResponse & GetReferralProgramPremiumFeaturesResponseNonNullableFields>;
|
|
1625
1871
|
}
|
|
1626
|
-
declare const onProgramUpdated$1: EventDefinition$
|
|
1872
|
+
declare const onProgramUpdated$1: EventDefinition$4<ProgramUpdatedEnvelope, "wix.loyalty.referral.v1.program_updated">;
|
|
1873
|
+
|
|
1874
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
1875
|
+
__type: 'event-definition';
|
|
1876
|
+
type: Type;
|
|
1877
|
+
isDomainEvent?: boolean;
|
|
1878
|
+
transformations?: (envelope: unknown) => Payload;
|
|
1879
|
+
__payload: Payload;
|
|
1880
|
+
};
|
|
1881
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
1882
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
1883
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
1884
|
+
|
|
1885
|
+
declare global {
|
|
1886
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1887
|
+
interface SymbolConstructor {
|
|
1888
|
+
readonly observable: symbol;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1627
1891
|
|
|
1628
1892
|
declare function createEventModule$3<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
|
|
1629
1893
|
|
|
1630
|
-
declare const getReferralProgram: BuildRESTFunction
|
|
1631
|
-
declare const
|
|
1632
|
-
declare const
|
|
1633
|
-
declare const
|
|
1634
|
-
declare const
|
|
1635
|
-
declare const
|
|
1636
|
-
declare const
|
|
1637
|
-
declare const getReferralProgramPremiumFeatures: BuildRESTFunction$4<typeof getReferralProgramPremiumFeatures$1> & typeof getReferralProgramPremiumFeatures$1;
|
|
1894
|
+
declare const getReferralProgram: MaybeContext<BuildRESTFunction<typeof getReferralProgram$1> & typeof getReferralProgram$1>;
|
|
1895
|
+
declare const updateReferralProgram: MaybeContext<BuildRESTFunction<typeof updateReferralProgram$1> & typeof updateReferralProgram$1>;
|
|
1896
|
+
declare const activateReferralProgram: MaybeContext<BuildRESTFunction<typeof activateReferralProgram$1> & typeof activateReferralProgram$1>;
|
|
1897
|
+
declare const pauseReferralProgram: MaybeContext<BuildRESTFunction<typeof pauseReferralProgram$1> & typeof pauseReferralProgram$1>;
|
|
1898
|
+
declare const getAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof getAiSocialMediaPostsSuggestions$1> & typeof getAiSocialMediaPostsSuggestions$1>;
|
|
1899
|
+
declare const generateAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof generateAiSocialMediaPostsSuggestions$1> & typeof generateAiSocialMediaPostsSuggestions$1>;
|
|
1900
|
+
declare const getReferralProgramPremiumFeatures: MaybeContext<BuildRESTFunction<typeof getReferralProgramPremiumFeatures$1> & typeof getReferralProgramPremiumFeatures$1>;
|
|
1638
1901
|
|
|
1639
1902
|
type _publicOnProgramUpdatedType = typeof onProgramUpdated$1;
|
|
1640
1903
|
/** */
|
|
@@ -1706,16 +1969,11 @@ declare const context$4_ProgramStatus: typeof ProgramStatus;
|
|
|
1706
1969
|
type context$4_ProgramUpdatedEnvelope = ProgramUpdatedEnvelope;
|
|
1707
1970
|
type context$4_ProviderName = ProviderName;
|
|
1708
1971
|
declare const context$4_ProviderName: typeof ProviderName;
|
|
1709
|
-
type context$4_QueryReferralProgramsRequest = QueryReferralProgramsRequest;
|
|
1710
|
-
type context$4_QueryReferralProgramsResponse = QueryReferralProgramsResponse;
|
|
1711
|
-
type context$4_QueryReferralProgramsResponseNonNullableFields = QueryReferralProgramsResponseNonNullableFields;
|
|
1712
1972
|
type context$4_ReactivationData = ReactivationData;
|
|
1713
1973
|
type context$4_ReactivationReasonEnum = ReactivationReasonEnum;
|
|
1714
1974
|
declare const context$4_ReactivationReasonEnum: typeof ReactivationReasonEnum;
|
|
1715
1975
|
type context$4_RecurringChargeSucceeded = RecurringChargeSucceeded;
|
|
1716
1976
|
type context$4_ReferralProgram = ReferralProgram;
|
|
1717
|
-
type context$4_ReferralProgramsQueryBuilder = ReferralProgramsQueryBuilder;
|
|
1718
|
-
type context$4_ReferralProgramsQueryResult = ReferralProgramsQueryResult;
|
|
1719
1977
|
type context$4_ServiceProvisioned = ServiceProvisioned;
|
|
1720
1978
|
type context$4_ServiceRemoved = ServiceRemoved;
|
|
1721
1979
|
type context$4_SiteCreated = SiteCreated;
|
|
@@ -1761,54 +2019,9 @@ declare const context$4_getReferralProgram: typeof getReferralProgram;
|
|
|
1761
2019
|
declare const context$4_getReferralProgramPremiumFeatures: typeof getReferralProgramPremiumFeatures;
|
|
1762
2020
|
declare const context$4_onProgramUpdated: typeof onProgramUpdated;
|
|
1763
2021
|
declare const context$4_pauseReferralProgram: typeof pauseReferralProgram;
|
|
1764
|
-
declare const context$4_queryReferralPrograms: typeof queryReferralPrograms;
|
|
1765
2022
|
declare const context$4_updateReferralProgram: typeof updateReferralProgram;
|
|
1766
2023
|
declare namespace context$4 {
|
|
1767
|
-
export { type context$4_AISocialMediaPostSuggestion as AISocialMediaPostSuggestion, context$4_Action as Action, type ActionEvent$4 as ActionEvent, type context$4_ActivateReferralProgramRequest as ActivateReferralProgramRequest, type context$4_ActivateReferralProgramResponse as ActivateReferralProgramResponse, type context$4_ActivateReferralProgramResponseNonNullableFields as ActivateReferralProgramResponseNonNullableFields, context$4_App as App, type context$4_Asset as Asset, type BaseEventMetadata$3 as BaseEventMetadata, type context$4_BillingReference as BillingReference, type context$4_BulkGetReferralProgramRequest as BulkGetReferralProgramRequest, type context$4_BulkGetReferralProgramResponse as BulkGetReferralProgramResponse, type context$4_CancellationDetails as CancellationDetails, context$4_ContractSwitchReason as ContractSwitchReason, context$4_ContractSwitchType as ContractSwitchType, type context$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
|
|
1768
|
-
}
|
|
1769
|
-
|
|
1770
|
-
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
1771
|
-
interface HttpClient$3 {
|
|
1772
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
1773
|
-
fetchWithAuth: typeof fetch;
|
|
1774
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
1775
|
-
}
|
|
1776
|
-
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
1777
|
-
type HttpResponse$3<T = any> = {
|
|
1778
|
-
data: T;
|
|
1779
|
-
status: number;
|
|
1780
|
-
statusText: string;
|
|
1781
|
-
headers: any;
|
|
1782
|
-
request?: any;
|
|
1783
|
-
};
|
|
1784
|
-
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
1785
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
1786
|
-
url: string;
|
|
1787
|
-
data?: Data;
|
|
1788
|
-
params?: URLSearchParams;
|
|
1789
|
-
} & APIMetadata$3;
|
|
1790
|
-
type APIMetadata$3 = {
|
|
1791
|
-
methodFqn?: string;
|
|
1792
|
-
entityFqdn?: string;
|
|
1793
|
-
packageName?: string;
|
|
1794
|
-
};
|
|
1795
|
-
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
1796
|
-
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
1797
|
-
__type: 'event-definition';
|
|
1798
|
-
type: Type;
|
|
1799
|
-
isDomainEvent?: boolean;
|
|
1800
|
-
transformations?: (envelope: unknown) => Payload;
|
|
1801
|
-
__payload: Payload;
|
|
1802
|
-
};
|
|
1803
|
-
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
1804
|
-
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
1805
|
-
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
1806
|
-
|
|
1807
|
-
declare global {
|
|
1808
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
1809
|
-
interface SymbolConstructor {
|
|
1810
|
-
readonly observable: symbol;
|
|
1811
|
-
}
|
|
2024
|
+
export { type context$4_AISocialMediaPostSuggestion as AISocialMediaPostSuggestion, context$4_Action as Action, type ActionEvent$4 as ActionEvent, type context$4_ActivateReferralProgramRequest as ActivateReferralProgramRequest, type context$4_ActivateReferralProgramResponse as ActivateReferralProgramResponse, type context$4_ActivateReferralProgramResponseNonNullableFields as ActivateReferralProgramResponseNonNullableFields, context$4_App as App, type context$4_Asset as Asset, type BaseEventMetadata$3 as BaseEventMetadata, type context$4_BillingReference as BillingReference, type context$4_BulkGetReferralProgramRequest as BulkGetReferralProgramRequest, type context$4_BulkGetReferralProgramResponse as BulkGetReferralProgramResponse, type context$4_CancellationDetails as CancellationDetails, context$4_ContractSwitchReason as ContractSwitchReason, context$4_ContractSwitchType as ContractSwitchType, type context$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 context$4_Cycle as Cycle, type context$4_CycleCycleSelectorOneOf as CycleCycleSelectorOneOf, type context$4_DeleteContext as DeleteContext, context$4_DeleteStatus as DeleteStatus, DiscountType$2 as DiscountType, type DomainEvent$4 as DomainEvent, type DomainEventBodyOneOf$4 as DomainEventBodyOneOf, type context$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 context$4_GenerateAISocialMediaPostsSuggestionsRequest as GenerateAISocialMediaPostsSuggestionsRequest, type context$4_GenerateAISocialMediaPostsSuggestionsResponse as GenerateAISocialMediaPostsSuggestionsResponse, type context$4_GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields as GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields, type context$4_GenerateAiSocialMediaPostsSuggestionsOptions as GenerateAiSocialMediaPostsSuggestionsOptions, type context$4_GetAISocialMediaPostsSuggestionsRequest as GetAISocialMediaPostsSuggestionsRequest, type context$4_GetAISocialMediaPostsSuggestionsResponse as GetAISocialMediaPostsSuggestionsResponse, type context$4_GetAISocialMediaPostsSuggestionsResponseNonNullableFields as GetAISocialMediaPostsSuggestionsResponseNonNullableFields, type context$4_GetAiSocialMediaPostsSuggestionsOptions as GetAiSocialMediaPostsSuggestionsOptions, type context$4_GetReferralProgramPremiumFeaturesRequest as GetReferralProgramPremiumFeaturesRequest, type context$4_GetReferralProgramPremiumFeaturesResponse as GetReferralProgramPremiumFeaturesResponse, type context$4_GetReferralProgramPremiumFeaturesResponseNonNullableFields as GetReferralProgramPremiumFeaturesResponseNonNullableFields, type context$4_GetReferralProgramRequest as GetReferralProgramRequest, type context$4_GetReferralProgramResponse as GetReferralProgramResponse, type context$4_GetReferralProgramResponseNonNullableFields as GetReferralProgramResponseNonNullableFields, type Group$2 as Group, type context$4_HtmlSitePublished as HtmlSitePublished, type IdentificationData$4 as IdentificationData, type IdentificationDataIdOneOf$4 as IdentificationDataIdOneOf, context$4_Initiator as Initiator, type context$4_Interval as Interval, context$4_IntervalUnit as IntervalUnit, type LoyaltyPoints$2 as LoyaltyPoints, type MessageEnvelope$4 as MessageEnvelope, type context$4_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type context$4_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, context$4_Namespace as Namespace, type context$4_NamespaceChanged as NamespaceChanged, type context$4_OneTime as OneTime, type context$4_Page as Page, type context$4_PauseReferralProgramRequest as PauseReferralProgramRequest, type context$4_PauseReferralProgramResponse as PauseReferralProgramResponse, type context$4_PauseReferralProgramResponseNonNullableFields as PauseReferralProgramResponseNonNullableFields, type PercentageDiscount$2 as PercentageDiscount, type context$4_PremiumFeatures as PremiumFeatures, context$4_PriceIncreaseTrigger as PriceIncreaseTrigger, context$4_ProductAdjustment as ProductAdjustment, type context$4_ProductPriceIncreaseData as ProductPriceIncreaseData, type context$4_ProgramInSite as ProgramInSite, context$4_ProgramStatus as ProgramStatus, type context$4_ProgramUpdatedEnvelope as ProgramUpdatedEnvelope, context$4_ProviderName as ProviderName, type context$4_ReactivationData as ReactivationData, context$4_ReactivationReasonEnum as ReactivationReasonEnum, type context$4_RecurringChargeSucceeded as RecurringChargeSucceeded, type context$4_ReferralProgram as ReferralProgram, type RestoreInfo$4 as RestoreInfo, type Reward$2 as Reward, type RewardOptionsOneOf$1 as RewardOptionsOneOf, type context$4_ServiceProvisioned as ServiceProvisioned, type context$4_ServiceRemoved as ServiceRemoved, type context$4_SiteCreated as SiteCreated, context$4_SiteCreatedContext as SiteCreatedContext, type context$4_SiteDeleted as SiteDeleted, type context$4_SiteHardDeleted as SiteHardDeleted, type context$4_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type context$4_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type context$4_SitePublished as SitePublished, type context$4_SiteRenamed as SiteRenamed, type context$4_SiteTransferred as SiteTransferred, type context$4_SiteUndeleted as SiteUndeleted, type context$4_SiteUnpublished as SiteUnpublished, context$4_State as State, type context$4_StudioAssigned as StudioAssigned, type context$4_StudioUnassigned as StudioUnassigned, type context$4_Subscription as Subscription, type context$4_SubscriptionAssigned as SubscriptionAssigned, type context$4_SubscriptionAutoRenewTurnedOff as SubscriptionAutoRenewTurnedOff, type context$4_SubscriptionAutoRenewTurnedOn as SubscriptionAutoRenewTurnedOn, type context$4_SubscriptionCancelled as SubscriptionCancelled, type context$4_SubscriptionCreated as SubscriptionCreated, type context$4_SubscriptionEvent as SubscriptionEvent, type context$4_SubscriptionEventEventOneOf as SubscriptionEventEventOneOf, type context$4_SubscriptionNearEndOfPeriod as SubscriptionNearEndOfPeriod, type context$4_SubscriptionPendingChange as SubscriptionPendingChange, context$4_SubscriptionStatus as SubscriptionStatus, type context$4_SubscriptionTransferred as SubscriptionTransferred, type context$4_SubscriptionUnassigned as SubscriptionUnassigned, Type$1 as Type, context$4_UnassignReason as UnassignReason, type context$4_UpdateReferralProgramRequest as UpdateReferralProgramRequest, type context$4_UpdateReferralProgramResponse as UpdateReferralProgramResponse, type context$4_UpdateReferralProgramResponseNonNullableFields as UpdateReferralProgramResponseNonNullableFields, WebhookIdentityType$4 as WebhookIdentityType, type context$4__publicOnProgramUpdatedType as _publicOnProgramUpdatedType, context$4_activateReferralProgram as activateReferralProgram, context$4_generateAiSocialMediaPostsSuggestions as generateAiSocialMediaPostsSuggestions, context$4_getAiSocialMediaPostsSuggestions as getAiSocialMediaPostsSuggestions, context$4_getReferralProgram as getReferralProgram, context$4_getReferralProgramPremiumFeatures as getReferralProgramPremiumFeatures, context$4_onProgramUpdated as onProgramUpdated, context$4_pauseReferralProgram as pauseReferralProgram, onProgramUpdated$1 as publicOnProgramUpdated, context$4_updateReferralProgram as updateReferralProgram };
|
|
1812
2025
|
}
|
|
1813
2026
|
|
|
1814
2027
|
interface ReferralEvent extends ReferralEventEventTypeOneOf {
|
|
@@ -2646,7 +2859,7 @@ interface QueryReferredFriendActionsOptions {
|
|
|
2646
2859
|
contactIds?: string[];
|
|
2647
2860
|
}
|
|
2648
2861
|
|
|
2649
|
-
declare function getReferralEvent$1(httpClient: HttpClient
|
|
2862
|
+
declare function getReferralEvent$1(httpClient: HttpClient): GetReferralEventSignature;
|
|
2650
2863
|
interface GetReferralEventSignature {
|
|
2651
2864
|
/**
|
|
2652
2865
|
* Retrieves a referral event by ID.
|
|
@@ -2655,7 +2868,7 @@ interface GetReferralEventSignature {
|
|
|
2655
2868
|
*/
|
|
2656
2869
|
(referralEventId: string): Promise<ReferralEvent & ReferralEventNonNullableFields>;
|
|
2657
2870
|
}
|
|
2658
|
-
declare function queryReferralEvent$1(httpClient: HttpClient
|
|
2871
|
+
declare function queryReferralEvent$1(httpClient: HttpClient): QueryReferralEventSignature;
|
|
2659
2872
|
interface QueryReferralEventSignature {
|
|
2660
2873
|
/**
|
|
2661
2874
|
* Retrieves a list of referral events, given the provided paging, filtering, and sorting.
|
|
@@ -2667,14 +2880,14 @@ interface QueryReferralEventSignature {
|
|
|
2667
2880
|
*/
|
|
2668
2881
|
(): ReferralEventsQueryBuilder;
|
|
2669
2882
|
}
|
|
2670
|
-
declare function getReferralStatistics$1(httpClient: HttpClient
|
|
2883
|
+
declare function getReferralStatistics$1(httpClient: HttpClient): GetReferralStatisticsSignature;
|
|
2671
2884
|
interface GetReferralStatisticsSignature {
|
|
2672
2885
|
/**
|
|
2673
2886
|
* Retrieves referral statistics.
|
|
2674
2887
|
*/
|
|
2675
2888
|
(): Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
|
|
2676
2889
|
}
|
|
2677
|
-
declare function queryReferringCustomerTotals$1(httpClient: HttpClient
|
|
2890
|
+
declare function queryReferringCustomerTotals$1(httpClient: HttpClient): QueryReferringCustomerTotalsSignature;
|
|
2678
2891
|
interface QueryReferringCustomerTotalsSignature {
|
|
2679
2892
|
/**
|
|
2680
2893
|
* Retrieves a list of referring customer totals, given the provided paging, filtering, and sorting.
|
|
@@ -2686,7 +2899,7 @@ interface QueryReferringCustomerTotalsSignature {
|
|
|
2686
2899
|
*/
|
|
2687
2900
|
(options?: QueryReferringCustomerTotalsOptions | undefined): Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
|
|
2688
2901
|
}
|
|
2689
|
-
declare function queryReferredFriendActions$1(httpClient: HttpClient
|
|
2902
|
+
declare function queryReferredFriendActions$1(httpClient: HttpClient): QueryReferredFriendActionsSignature;
|
|
2690
2903
|
interface QueryReferredFriendActionsSignature {
|
|
2691
2904
|
/**
|
|
2692
2905
|
* Retrieves a list of referred friend actions, given the provided paging, filtering, and sorting.
|
|
@@ -2698,15 +2911,33 @@ interface QueryReferredFriendActionsSignature {
|
|
|
2698
2911
|
*/
|
|
2699
2912
|
(options?: QueryReferredFriendActionsOptions | undefined): Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
|
|
2700
2913
|
}
|
|
2701
|
-
declare const onReferralEventCreated$1: EventDefinition$
|
|
2914
|
+
declare const onReferralEventCreated$1: EventDefinition$4<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
|
|
2915
|
+
|
|
2916
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
2917
|
+
__type: 'event-definition';
|
|
2918
|
+
type: Type;
|
|
2919
|
+
isDomainEvent?: boolean;
|
|
2920
|
+
transformations?: (envelope: unknown) => Payload;
|
|
2921
|
+
__payload: Payload;
|
|
2922
|
+
};
|
|
2923
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
2924
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
2925
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
2926
|
+
|
|
2927
|
+
declare global {
|
|
2928
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2929
|
+
interface SymbolConstructor {
|
|
2930
|
+
readonly observable: symbol;
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2702
2933
|
|
|
2703
2934
|
declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
|
2704
2935
|
|
|
2705
|
-
declare const getReferralEvent: BuildRESTFunction
|
|
2706
|
-
declare const queryReferralEvent: BuildRESTFunction
|
|
2707
|
-
declare const getReferralStatistics: BuildRESTFunction
|
|
2708
|
-
declare const queryReferringCustomerTotals: BuildRESTFunction
|
|
2709
|
-
declare const queryReferredFriendActions: BuildRESTFunction
|
|
2936
|
+
declare const getReferralEvent: MaybeContext<BuildRESTFunction<typeof getReferralEvent$1> & typeof getReferralEvent$1>;
|
|
2937
|
+
declare const queryReferralEvent: MaybeContext<BuildRESTFunction<typeof queryReferralEvent$1> & typeof queryReferralEvent$1>;
|
|
2938
|
+
declare const getReferralStatistics: MaybeContext<BuildRESTFunction<typeof getReferralStatistics$1> & typeof getReferralStatistics$1>;
|
|
2939
|
+
declare const queryReferringCustomerTotals: MaybeContext<BuildRESTFunction<typeof queryReferringCustomerTotals$1> & typeof queryReferringCustomerTotals$1>;
|
|
2940
|
+
declare const queryReferredFriendActions: MaybeContext<BuildRESTFunction<typeof queryReferredFriendActions$1> & typeof queryReferredFriendActions$1>;
|
|
2710
2941
|
|
|
2711
2942
|
type _publicOnReferralEventCreatedType = typeof onReferralEventCreated$1;
|
|
2712
2943
|
/** */
|
|
@@ -2759,40 +2990,6 @@ declare namespace context$3 {
|
|
|
2759
2990
|
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 context$3_CreateReferralEventRequest as CreateReferralEventRequest, type context$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 context$3_GetReferralEventRequest as GetReferralEventRequest, type context$3_GetReferralEventResponse as GetReferralEventResponse, type context$3_GetReferralEventResponseNonNullableFields as GetReferralEventResponseNonNullableFields, type context$3_GetReferralStatisticsRequest as GetReferralStatisticsRequest, type context$3_GetReferralStatisticsResponse as GetReferralStatisticsResponse, type context$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 context$3_QueryReferralEventRequest as QueryReferralEventRequest, type context$3_QueryReferralEventResponse as QueryReferralEventResponse, type context$3_QueryReferralEventResponseNonNullableFields as QueryReferralEventResponseNonNullableFields, type context$3_QueryReferredFriendActionsOptions as QueryReferredFriendActionsOptions, type context$3_QueryReferredFriendActionsRequest as QueryReferredFriendActionsRequest, type context$3_QueryReferredFriendActionsResponse as QueryReferredFriendActionsResponse, type context$3_QueryReferredFriendActionsResponseNonNullableFields as QueryReferredFriendActionsResponseNonNullableFields, type context$3_QueryReferringCustomerTotalsOptions as QueryReferringCustomerTotalsOptions, type context$3_QueryReferringCustomerTotalsRequest as QueryReferringCustomerTotalsRequest, type context$3_QueryReferringCustomerTotalsResponse as QueryReferringCustomerTotalsResponse, type context$3_QueryReferringCustomerTotalsResponseNonNullableFields as QueryReferringCustomerTotalsResponseNonNullableFields, type context$3_ReferralEvent as ReferralEvent, type context$3_ReferralEventCreatedEnvelope as ReferralEventCreatedEnvelope, type context$3_ReferralEventEventTypeOneOf as ReferralEventEventTypeOneOf, type context$3_ReferralEventNonNullableFields as ReferralEventNonNullableFields, type context$3_ReferralEventsQueryBuilder as ReferralEventsQueryBuilder, type context$3_ReferralEventsQueryResult as ReferralEventsQueryResult, type context$3_ReferredFriendAction as ReferredFriendAction, type context$3_ReferredFriendActionEvent as ReferredFriendActionEvent, type context$3_ReferredFriendActionRewardTypeOptionsOneOf as ReferredFriendActionRewardTypeOptionsOneOf, type ReferredFriendDetails$2 as ReferredFriendDetails, type context$3_ReferredFriendSignupEvent as ReferredFriendSignupEvent, type context$3_ReferringCustomerTotal as ReferringCustomerTotal, type RestoreInfo$3 as RestoreInfo, Reward$1 as Reward, type context$3_RewardEvent as RewardEvent, type context$3_RewardEventReceiverOneOf as RewardEventReceiverOneOf, SortOrder$3 as SortOrder, type Sorting$3 as Sorting, Status$2 as Status, type SuccessfulReferralEvent$2 as SuccessfulReferralEvent, type context$3_Trigger as Trigger, type context$3_V1ActionEvent as V1ActionEvent, type V1Coupon$1 as V1Coupon, type context$3_V1SuccessfulReferralEvent as V1SuccessfulReferralEvent, type context$3_V1Trigger as V1Trigger, WebhookIdentityType$3 as WebhookIdentityType, type context$3__publicOnReferralEventCreatedType as _publicOnReferralEventCreatedType, context$3_getReferralEvent as getReferralEvent, context$3_getReferralStatistics as getReferralStatistics, context$3_onReferralEventCreated as onReferralEventCreated, onReferralEventCreated$1 as publicOnReferralEventCreated, context$3_queryReferralEvent as queryReferralEvent, context$3_queryReferredFriendActions as queryReferredFriendActions, context$3_queryReferringCustomerTotals as queryReferringCustomerTotals };
|
|
2760
2991
|
}
|
|
2761
2992
|
|
|
2762
|
-
type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
|
|
2763
|
-
interface HttpClient$2 {
|
|
2764
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
|
|
2765
|
-
fetchWithAuth: typeof fetch;
|
|
2766
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
2767
|
-
}
|
|
2768
|
-
type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
|
|
2769
|
-
type HttpResponse$2<T = any> = {
|
|
2770
|
-
data: T;
|
|
2771
|
-
status: number;
|
|
2772
|
-
statusText: string;
|
|
2773
|
-
headers: any;
|
|
2774
|
-
request?: any;
|
|
2775
|
-
};
|
|
2776
|
-
type RequestOptions$2<_TResponse = any, Data = any> = {
|
|
2777
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
2778
|
-
url: string;
|
|
2779
|
-
data?: Data;
|
|
2780
|
-
params?: URLSearchParams;
|
|
2781
|
-
} & APIMetadata$2;
|
|
2782
|
-
type APIMetadata$2 = {
|
|
2783
|
-
methodFqn?: string;
|
|
2784
|
-
entityFqdn?: string;
|
|
2785
|
-
packageName?: string;
|
|
2786
|
-
};
|
|
2787
|
-
type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
|
|
2788
|
-
|
|
2789
|
-
declare global {
|
|
2790
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2791
|
-
interface SymbolConstructor {
|
|
2792
|
-
readonly observable: symbol;
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
|
-
|
|
2796
2993
|
interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
|
|
2797
2994
|
/**
|
|
2798
2995
|
* ID of the referring customer who received the reward.
|
|
@@ -3398,7 +3595,7 @@ interface ReferralRewardsQueryBuilder {
|
|
|
3398
3595
|
find: () => Promise<ReferralRewardsQueryResult>;
|
|
3399
3596
|
}
|
|
3400
3597
|
|
|
3401
|
-
declare function getReferralReward$1(httpClient: HttpClient
|
|
3598
|
+
declare function getReferralReward$1(httpClient: HttpClient): GetReferralRewardSignature;
|
|
3402
3599
|
interface GetReferralRewardSignature {
|
|
3403
3600
|
/**
|
|
3404
3601
|
* Retrieves a referral reward.
|
|
@@ -3407,7 +3604,7 @@ interface GetReferralRewardSignature {
|
|
|
3407
3604
|
*/
|
|
3408
3605
|
(_id: string): Promise<ReferralReward & ReferralRewardNonNullableFields>;
|
|
3409
3606
|
}
|
|
3410
|
-
declare function queryReferralRewards$1(httpClient: HttpClient
|
|
3607
|
+
declare function queryReferralRewards$1(httpClient: HttpClient): QueryReferralRewardsSignature;
|
|
3411
3608
|
interface QueryReferralRewardsSignature {
|
|
3412
3609
|
/**
|
|
3413
3610
|
* Retrieves a list of referral rewards, given the provided paging, filtering, and sorting.
|
|
@@ -3420,8 +3617,8 @@ interface QueryReferralRewardsSignature {
|
|
|
3420
3617
|
(options?: QueryReferralRewardsOptions | undefined): ReferralRewardsQueryBuilder;
|
|
3421
3618
|
}
|
|
3422
3619
|
|
|
3423
|
-
declare const getReferralReward: BuildRESTFunction
|
|
3424
|
-
declare const queryReferralRewards: BuildRESTFunction
|
|
3620
|
+
declare const getReferralReward: MaybeContext<BuildRESTFunction<typeof getReferralReward$1> & typeof getReferralReward$1>;
|
|
3621
|
+
declare const queryReferralRewards: MaybeContext<BuildRESTFunction<typeof queryReferralRewards$1> & typeof queryReferralRewards$1>;
|
|
3425
3622
|
|
|
3426
3623
|
type context$2_BulkGetReferralRewardsRequest = BulkGetReferralRewardsRequest;
|
|
3427
3624
|
type context$2_BulkGetReferralRewardsResponse = BulkGetReferralRewardsResponse;
|
|
@@ -3465,50 +3662,6 @@ declare namespace context$2 {
|
|
|
3465
3662
|
export { type ActionEvent$2 as ActionEvent, type context$2_BulkGetReferralRewardsRequest as BulkGetReferralRewardsRequest, type context$2_BulkGetReferralRewardsResponse as BulkGetReferralRewardsResponse, type context$2_Coupon as Coupon, type context$2_CouponDiscountTypeOptionsOneOf as CouponDiscountTypeOptionsOneOf, type context$2_CouponScope as CouponScope, type context$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, context$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 context$2_FixedAmountDiscount as FixedAmountDiscount, type context$2_GetReferralRewardRequest as GetReferralRewardRequest, type context$2_GetReferralRewardResponse as GetReferralRewardResponse, type context$2_GetReferralRewardResponseNonNullableFields as GetReferralRewardResponseNonNullableFields, type context$2_Group as Group, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type context$2_LoyaltyPoints as LoyaltyPoints, type MessageEnvelope$2 as MessageEnvelope, type context$2_PercentageDiscount as PercentageDiscount, type context$2_QueryReferralRewardsOptions as QueryReferralRewardsOptions, type context$2_QueryReferralRewardsRequest as QueryReferralRewardsRequest, type context$2_QueryReferralRewardsResponse as QueryReferralRewardsResponse, type context$2_QueryReferralRewardsResponseNonNullableFields as QueryReferralRewardsResponseNonNullableFields, type context$2_ReferralReward as ReferralReward, type context$2_ReferralRewardNonNullableFields as ReferralRewardNonNullableFields, type context$2_ReferralRewardReceiverOneOf as ReferralRewardReceiverOneOf, type context$2_ReferralRewardRewardTypeOptionsOneOf as ReferralRewardRewardTypeOptionsOneOf, type context$2_ReferralRewardsQueryBuilder as ReferralRewardsQueryBuilder, type context$2_ReferralRewardsQueryResult as ReferralRewardsQueryResult, type ReferredFriendDetails$1 as ReferredFriendDetails, type RestoreInfo$2 as RestoreInfo, type context$2_Reward as Reward, type context$2_RewardOptionsOneOf as RewardOptionsOneOf, context$2_RewardTypeType as RewardTypeType, type context$2_RewardsInSite as RewardsInSite, SortOrder$2 as SortOrder, type Sorting$2 as Sorting, Status$1 as Status, type SuccessfulReferralEvent$1 as SuccessfulReferralEvent, context$2_Type as Type, type context$2_V1Coupon as V1Coupon, type context$2_V1LoyaltyPoints as V1LoyaltyPoints, type context$2_ValidateReferralRewardRequest as ValidateReferralRewardRequest, type context$2_ValidateReferralRewardResponse as ValidateReferralRewardResponse, WebhookIdentityType$2 as WebhookIdentityType, context$2_getReferralReward as getReferralReward, context$2_queryReferralRewards as queryReferralRewards };
|
|
3466
3663
|
}
|
|
3467
3664
|
|
|
3468
|
-
type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
|
|
3469
|
-
interface HttpClient$1 {
|
|
3470
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
|
|
3471
|
-
fetchWithAuth: typeof fetch;
|
|
3472
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
3473
|
-
}
|
|
3474
|
-
type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
|
|
3475
|
-
type HttpResponse$1<T = any> = {
|
|
3476
|
-
data: T;
|
|
3477
|
-
status: number;
|
|
3478
|
-
statusText: string;
|
|
3479
|
-
headers: any;
|
|
3480
|
-
request?: any;
|
|
3481
|
-
};
|
|
3482
|
-
type RequestOptions$1<_TResponse = any, Data = any> = {
|
|
3483
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
3484
|
-
url: string;
|
|
3485
|
-
data?: Data;
|
|
3486
|
-
params?: URLSearchParams;
|
|
3487
|
-
} & APIMetadata$1;
|
|
3488
|
-
type APIMetadata$1 = {
|
|
3489
|
-
methodFqn?: string;
|
|
3490
|
-
entityFqdn?: string;
|
|
3491
|
-
packageName?: string;
|
|
3492
|
-
};
|
|
3493
|
-
type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
|
|
3494
|
-
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
3495
|
-
__type: 'event-definition';
|
|
3496
|
-
type: Type;
|
|
3497
|
-
isDomainEvent?: boolean;
|
|
3498
|
-
transformations?: (envelope: unknown) => Payload;
|
|
3499
|
-
__payload: Payload;
|
|
3500
|
-
};
|
|
3501
|
-
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
3502
|
-
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
3503
|
-
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
3504
|
-
|
|
3505
|
-
declare global {
|
|
3506
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3507
|
-
interface SymbolConstructor {
|
|
3508
|
-
readonly observable: symbol;
|
|
3509
|
-
}
|
|
3510
|
-
}
|
|
3511
|
-
|
|
3512
3665
|
interface ReferredFriend {
|
|
3513
3666
|
/**
|
|
3514
3667
|
* ID of the referred friend.
|
|
@@ -4008,7 +4161,7 @@ interface ReferredFriendsQueryBuilder {
|
|
|
4008
4161
|
find: () => Promise<ReferredFriendsQueryResult>;
|
|
4009
4162
|
}
|
|
4010
4163
|
|
|
4011
|
-
declare function createReferredFriend$1(httpClient: HttpClient
|
|
4164
|
+
declare function createReferredFriend$1(httpClient: HttpClient): CreateReferredFriendSignature;
|
|
4012
4165
|
interface CreateReferredFriendSignature {
|
|
4013
4166
|
/**
|
|
4014
4167
|
* Creates a new referred friend or returns an existing entity if it already exists.
|
|
@@ -4021,7 +4174,7 @@ interface CreateReferredFriendSignature {
|
|
|
4021
4174
|
*/
|
|
4022
4175
|
(options?: CreateReferredFriendOptions | undefined): Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
|
|
4023
4176
|
}
|
|
4024
|
-
declare function getReferredFriend$1(httpClient: HttpClient
|
|
4177
|
+
declare function getReferredFriend$1(httpClient: HttpClient): GetReferredFriendSignature;
|
|
4025
4178
|
interface GetReferredFriendSignature {
|
|
4026
4179
|
/**
|
|
4027
4180
|
* Retrieves a referred friend by ID.
|
|
@@ -4029,7 +4182,7 @@ interface GetReferredFriendSignature {
|
|
|
4029
4182
|
*/
|
|
4030
4183
|
(referredFriendId: string): Promise<GetReferredFriendResponse & GetReferredFriendResponseNonNullableFields>;
|
|
4031
4184
|
}
|
|
4032
|
-
declare function getReferredFriendByContactId$1(httpClient: HttpClient
|
|
4185
|
+
declare function getReferredFriendByContactId$1(httpClient: HttpClient): GetReferredFriendByContactIdSignature;
|
|
4033
4186
|
interface GetReferredFriendByContactIdSignature {
|
|
4034
4187
|
/**
|
|
4035
4188
|
* Retrieves a referred friend by contact ID.
|
|
@@ -4040,7 +4193,7 @@ interface GetReferredFriendByContactIdSignature {
|
|
|
4040
4193
|
*/
|
|
4041
4194
|
(contactId: string): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
4042
4195
|
}
|
|
4043
|
-
declare function updateReferredFriend$1(httpClient: HttpClient
|
|
4196
|
+
declare function updateReferredFriend$1(httpClient: HttpClient): UpdateReferredFriendSignature;
|
|
4044
4197
|
interface UpdateReferredFriendSignature {
|
|
4045
4198
|
/**
|
|
4046
4199
|
* Updates a referred friend. Supports partial updates.
|
|
@@ -4051,14 +4204,14 @@ interface UpdateReferredFriendSignature {
|
|
|
4051
4204
|
*/
|
|
4052
4205
|
(_id: string, referredFriend: UpdateReferredFriend): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
4053
4206
|
}
|
|
4054
|
-
declare function deleteReferredFriend$1(httpClient: HttpClient
|
|
4207
|
+
declare function deleteReferredFriend$1(httpClient: HttpClient): DeleteReferredFriendSignature;
|
|
4055
4208
|
interface DeleteReferredFriendSignature {
|
|
4056
4209
|
/**
|
|
4057
4210
|
* Deletes a referred friend.
|
|
4058
4211
|
*/
|
|
4059
4212
|
(referredFriendId: string, options?: DeleteReferredFriendOptions | undefined): Promise<void>;
|
|
4060
4213
|
}
|
|
4061
|
-
declare function queryReferredFriend$1(httpClient: HttpClient
|
|
4214
|
+
declare function queryReferredFriend$1(httpClient: HttpClient): QueryReferredFriendSignature;
|
|
4062
4215
|
interface QueryReferredFriendSignature {
|
|
4063
4216
|
/**
|
|
4064
4217
|
* Retrieves a list of referred friends, given the provided paging, filtering, and sorting.
|
|
@@ -4072,18 +4225,36 @@ interface QueryReferredFriendSignature {
|
|
|
4072
4225
|
*/
|
|
4073
4226
|
(): ReferredFriendsQueryBuilder;
|
|
4074
4227
|
}
|
|
4075
|
-
declare const onReferredFriendCreated$1: EventDefinition$
|
|
4076
|
-
declare const onReferredFriendUpdated$1: EventDefinition$
|
|
4077
|
-
declare const onReferredFriendDeleted$1: EventDefinition$
|
|
4228
|
+
declare const onReferredFriendCreated$1: EventDefinition$4<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
|
|
4229
|
+
declare const onReferredFriendUpdated$1: EventDefinition$4<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
|
|
4230
|
+
declare const onReferredFriendDeleted$1: EventDefinition$4<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
|
|
4231
|
+
|
|
4232
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
4233
|
+
__type: 'event-definition';
|
|
4234
|
+
type: Type;
|
|
4235
|
+
isDomainEvent?: boolean;
|
|
4236
|
+
transformations?: (envelope: unknown) => Payload;
|
|
4237
|
+
__payload: Payload;
|
|
4238
|
+
};
|
|
4239
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
4240
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
4241
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
4242
|
+
|
|
4243
|
+
declare global {
|
|
4244
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4245
|
+
interface SymbolConstructor {
|
|
4246
|
+
readonly observable: symbol;
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4078
4249
|
|
|
4079
4250
|
declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
4080
4251
|
|
|
4081
|
-
declare const createReferredFriend: BuildRESTFunction
|
|
4082
|
-
declare const getReferredFriend: BuildRESTFunction
|
|
4083
|
-
declare const getReferredFriendByContactId: BuildRESTFunction
|
|
4084
|
-
declare const updateReferredFriend: BuildRESTFunction
|
|
4085
|
-
declare const deleteReferredFriend: BuildRESTFunction
|
|
4086
|
-
declare const queryReferredFriend: BuildRESTFunction
|
|
4252
|
+
declare const createReferredFriend: MaybeContext<BuildRESTFunction<typeof createReferredFriend$1> & typeof createReferredFriend$1>;
|
|
4253
|
+
declare const getReferredFriend: MaybeContext<BuildRESTFunction<typeof getReferredFriend$1> & typeof getReferredFriend$1>;
|
|
4254
|
+
declare const getReferredFriendByContactId: MaybeContext<BuildRESTFunction<typeof getReferredFriendByContactId$1> & typeof getReferredFriendByContactId$1>;
|
|
4255
|
+
declare const updateReferredFriend: MaybeContext<BuildRESTFunction<typeof updateReferredFriend$1> & typeof updateReferredFriend$1>;
|
|
4256
|
+
declare const deleteReferredFriend: MaybeContext<BuildRESTFunction<typeof deleteReferredFriend$1> & typeof deleteReferredFriend$1>;
|
|
4257
|
+
declare const queryReferredFriend: MaybeContext<BuildRESTFunction<typeof queryReferredFriend$1> & typeof queryReferredFriend$1>;
|
|
4087
4258
|
|
|
4088
4259
|
type _publicOnReferredFriendCreatedType = typeof onReferredFriendCreated$1;
|
|
4089
4260
|
/** */
|
|
@@ -4145,50 +4316,6 @@ declare namespace context$1 {
|
|
|
4145
4316
|
export { type ActionEvent$1 as ActionEvent, type BaseEventMetadata$1 as BaseEventMetadata, type context$1_CreateReferredFriendOptions as CreateReferredFriendOptions, type context$1_CreateReferredFriendRequest as CreateReferredFriendRequest, type context$1_CreateReferredFriendResponse as CreateReferredFriendResponse, type context$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 context$1_DeleteReferredFriendOptions as DeleteReferredFriendOptions, type context$1_DeleteReferredFriendRequest as DeleteReferredFriendRequest, type context$1_DeleteReferredFriendResponse as DeleteReferredFriendResponse, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type context$1_Empty as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type context$1_GetReferredFriendByContactIdRequest as GetReferredFriendByContactIdRequest, type context$1_GetReferredFriendByContactIdResponse as GetReferredFriendByContactIdResponse, type context$1_GetReferredFriendByContactIdResponseNonNullableFields as GetReferredFriendByContactIdResponseNonNullableFields, type context$1_GetReferredFriendRequest as GetReferredFriendRequest, type context$1_GetReferredFriendResponse as GetReferredFriendResponse, type context$1_GetReferredFriendResponseNonNullableFields as GetReferredFriendResponseNonNullableFields, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type context$1_QueryReferredFriendRequest as QueryReferredFriendRequest, type context$1_QueryReferredFriendResponse as QueryReferredFriendResponse, type context$1_QueryReferredFriendResponseNonNullableFields as QueryReferredFriendResponseNonNullableFields, type context$1_ReferredFriend as ReferredFriend, type context$1_ReferredFriendCreatedEnvelope as ReferredFriendCreatedEnvelope, type context$1_ReferredFriendDeletedEnvelope as ReferredFriendDeletedEnvelope, type context$1_ReferredFriendDetails as ReferredFriendDetails, type context$1_ReferredFriendNonNullableFields as ReferredFriendNonNullableFields, type context$1_ReferredFriendUpdatedEnvelope as ReferredFriendUpdatedEnvelope, type context$1_ReferredFriendsQueryBuilder as ReferredFriendsQueryBuilder, type context$1_ReferredFriendsQueryResult as ReferredFriendsQueryResult, type RestoreInfo$1 as RestoreInfo, SortOrder$1 as SortOrder, type Sorting$1 as Sorting, context$1_Status as Status, type context$1_SuccessfulReferralEvent as SuccessfulReferralEvent, type context$1_UpdateReferredFriend as UpdateReferredFriend, type context$1_UpdateReferredFriendRequest as UpdateReferredFriendRequest, type context$1_UpdateReferredFriendResponse as UpdateReferredFriendResponse, type context$1_UpdateReferredFriendResponseNonNullableFields as UpdateReferredFriendResponseNonNullableFields, WebhookIdentityType$1 as WebhookIdentityType, type context$1__publicOnReferredFriendCreatedType as _publicOnReferredFriendCreatedType, type context$1__publicOnReferredFriendDeletedType as _publicOnReferredFriendDeletedType, type context$1__publicOnReferredFriendUpdatedType as _publicOnReferredFriendUpdatedType, context$1_createReferredFriend as createReferredFriend, context$1_deleteReferredFriend as deleteReferredFriend, context$1_getReferredFriend as getReferredFriend, context$1_getReferredFriendByContactId as getReferredFriendByContactId, context$1_onReferredFriendCreated as onReferredFriendCreated, context$1_onReferredFriendDeleted as onReferredFriendDeleted, context$1_onReferredFriendUpdated as onReferredFriendUpdated, onReferredFriendCreated$1 as publicOnReferredFriendCreated, onReferredFriendDeleted$1 as publicOnReferredFriendDeleted, onReferredFriendUpdated$1 as publicOnReferredFriendUpdated, context$1_queryReferredFriend as queryReferredFriend, context$1_updateReferredFriend as updateReferredFriend };
|
|
4146
4317
|
}
|
|
4147
4318
|
|
|
4148
|
-
type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
|
|
4149
|
-
interface HttpClient {
|
|
4150
|
-
request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
|
|
4151
|
-
fetchWithAuth: typeof fetch;
|
|
4152
|
-
wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
|
|
4153
|
-
}
|
|
4154
|
-
type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
|
|
4155
|
-
type HttpResponse<T = any> = {
|
|
4156
|
-
data: T;
|
|
4157
|
-
status: number;
|
|
4158
|
-
statusText: string;
|
|
4159
|
-
headers: any;
|
|
4160
|
-
request?: any;
|
|
4161
|
-
};
|
|
4162
|
-
type RequestOptions<_TResponse = any, Data = any> = {
|
|
4163
|
-
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
4164
|
-
url: string;
|
|
4165
|
-
data?: Data;
|
|
4166
|
-
params?: URLSearchParams;
|
|
4167
|
-
} & APIMetadata;
|
|
4168
|
-
type APIMetadata = {
|
|
4169
|
-
methodFqn?: string;
|
|
4170
|
-
entityFqdn?: string;
|
|
4171
|
-
packageName?: string;
|
|
4172
|
-
};
|
|
4173
|
-
type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
|
|
4174
|
-
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
4175
|
-
__type: 'event-definition';
|
|
4176
|
-
type: Type;
|
|
4177
|
-
isDomainEvent?: boolean;
|
|
4178
|
-
transformations?: (envelope: unknown) => Payload;
|
|
4179
|
-
__payload: Payload;
|
|
4180
|
-
};
|
|
4181
|
-
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
4182
|
-
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
4183
|
-
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
4184
|
-
|
|
4185
|
-
declare global {
|
|
4186
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4187
|
-
interface SymbolConstructor {
|
|
4188
|
-
readonly observable: symbol;
|
|
4189
|
-
}
|
|
4190
|
-
}
|
|
4191
|
-
|
|
4192
4319
|
/** ReferringCustomer is the main entity of ReferringCustomers. */
|
|
4193
4320
|
interface ReferringCustomer {
|
|
4194
4321
|
/**
|
|
@@ -4646,16 +4773,34 @@ interface DeleteReferringCustomerSignature {
|
|
|
4646
4773
|
*/
|
|
4647
4774
|
(referringCustomerId: string, options?: DeleteReferringCustomerOptions | undefined): Promise<void>;
|
|
4648
4775
|
}
|
|
4649
|
-
declare const onReferringCustomerCreated$1: EventDefinition<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
|
|
4650
|
-
declare const onReferringCustomerDeleted$1: EventDefinition<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
|
|
4776
|
+
declare const onReferringCustomerCreated$1: EventDefinition$4<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
|
|
4777
|
+
declare const onReferringCustomerDeleted$1: EventDefinition$4<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
|
|
4778
|
+
|
|
4779
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
4780
|
+
__type: 'event-definition';
|
|
4781
|
+
type: Type;
|
|
4782
|
+
isDomainEvent?: boolean;
|
|
4783
|
+
transformations?: (envelope: unknown) => Payload;
|
|
4784
|
+
__payload: Payload;
|
|
4785
|
+
};
|
|
4786
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
4787
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
4788
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
4789
|
+
|
|
4790
|
+
declare global {
|
|
4791
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4792
|
+
interface SymbolConstructor {
|
|
4793
|
+
readonly observable: symbol;
|
|
4794
|
+
}
|
|
4795
|
+
}
|
|
4651
4796
|
|
|
4652
4797
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
4653
4798
|
|
|
4654
|
-
declare const generateReferringCustomerForContact: BuildRESTFunction<typeof generateReferringCustomerForContact$1> & typeof generateReferringCustomerForContact$1
|
|
4655
|
-
declare const getReferringCustomer: BuildRESTFunction<typeof getReferringCustomer$1> & typeof getReferringCustomer$1
|
|
4656
|
-
declare const getReferringCustomerByReferralCode: BuildRESTFunction<typeof getReferringCustomerByReferralCode$1> & typeof getReferringCustomerByReferralCode$1
|
|
4657
|
-
declare const queryReferringCustomers: BuildRESTFunction<typeof queryReferringCustomers$1> & typeof queryReferringCustomers$1
|
|
4658
|
-
declare const deleteReferringCustomer: BuildRESTFunction<typeof deleteReferringCustomer$1> & typeof deleteReferringCustomer$1
|
|
4799
|
+
declare const generateReferringCustomerForContact: MaybeContext<BuildRESTFunction<typeof generateReferringCustomerForContact$1> & typeof generateReferringCustomerForContact$1>;
|
|
4800
|
+
declare const getReferringCustomer: MaybeContext<BuildRESTFunction<typeof getReferringCustomer$1> & typeof getReferringCustomer$1>;
|
|
4801
|
+
declare const getReferringCustomerByReferralCode: MaybeContext<BuildRESTFunction<typeof getReferringCustomerByReferralCode$1> & typeof getReferringCustomerByReferralCode$1>;
|
|
4802
|
+
declare const queryReferringCustomers: MaybeContext<BuildRESTFunction<typeof queryReferringCustomers$1> & typeof queryReferringCustomers$1>;
|
|
4803
|
+
declare const deleteReferringCustomer: MaybeContext<BuildRESTFunction<typeof deleteReferringCustomer$1> & typeof deleteReferringCustomer$1>;
|
|
4659
4804
|
|
|
4660
4805
|
type _publicOnReferringCustomerCreatedType = typeof onReferringCustomerCreated$1;
|
|
4661
4806
|
/** */
|