@wix/referral 1.0.27 → 1.0.29
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 +505 -233
- package/type-bundles/index.bundle.d.ts +505 -233
|
@@ -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;
|
|
@@ -1548,14 +1914,14 @@ interface GenerateAiSocialMediaPostsSuggestionsOptions {
|
|
|
1548
1914
|
topic?: string;
|
|
1549
1915
|
}
|
|
1550
1916
|
|
|
1551
|
-
declare function getReferralProgram$1(httpClient: HttpClient
|
|
1917
|
+
declare function getReferralProgram$1(httpClient: HttpClient): GetReferralProgramSignature;
|
|
1552
1918
|
interface GetReferralProgramSignature {
|
|
1553
1919
|
/**
|
|
1554
1920
|
* Retrieves the referral program.
|
|
1555
1921
|
*/
|
|
1556
1922
|
(): Promise<GetReferralProgramResponse & GetReferralProgramResponseNonNullableFields>;
|
|
1557
1923
|
}
|
|
1558
|
-
declare function queryReferralPrograms$1(httpClient: HttpClient
|
|
1924
|
+
declare function queryReferralPrograms$1(httpClient: HttpClient): QueryReferralProgramsSignature;
|
|
1559
1925
|
interface QueryReferralProgramsSignature {
|
|
1560
1926
|
/**
|
|
1561
1927
|
* Retrieves a list of referral programs, given the provided paging, filtering, and sorting.
|
|
@@ -1568,7 +1934,7 @@ interface QueryReferralProgramsSignature {
|
|
|
1568
1934
|
*/
|
|
1569
1935
|
(): ReferralProgramsQueryBuilder;
|
|
1570
1936
|
}
|
|
1571
|
-
declare function updateReferralProgram$1(httpClient: HttpClient
|
|
1937
|
+
declare function updateReferralProgram$1(httpClient: HttpClient): UpdateReferralProgramSignature;
|
|
1572
1938
|
interface UpdateReferralProgramSignature {
|
|
1573
1939
|
/**
|
|
1574
1940
|
* Updates a referral program. Supports partial updates.
|
|
@@ -1579,21 +1945,21 @@ interface UpdateReferralProgramSignature {
|
|
|
1579
1945
|
*/
|
|
1580
1946
|
(referralProgram: ReferralProgram): Promise<UpdateReferralProgramResponse & UpdateReferralProgramResponseNonNullableFields>;
|
|
1581
1947
|
}
|
|
1582
|
-
declare function activateReferralProgram$1(httpClient: HttpClient
|
|
1948
|
+
declare function activateReferralProgram$1(httpClient: HttpClient): ActivateReferralProgramSignature;
|
|
1583
1949
|
interface ActivateReferralProgramSignature {
|
|
1584
1950
|
/**
|
|
1585
1951
|
* Activates the referral program, changing its status to `ACTIVE`.
|
|
1586
1952
|
*/
|
|
1587
1953
|
(): Promise<ActivateReferralProgramResponse & ActivateReferralProgramResponseNonNullableFields>;
|
|
1588
1954
|
}
|
|
1589
|
-
declare function pauseReferralProgram$1(httpClient: HttpClient
|
|
1955
|
+
declare function pauseReferralProgram$1(httpClient: HttpClient): PauseReferralProgramSignature;
|
|
1590
1956
|
interface PauseReferralProgramSignature {
|
|
1591
1957
|
/**
|
|
1592
1958
|
* Pauses the referral program, changing its status to `PAUSED`.
|
|
1593
1959
|
*/
|
|
1594
1960
|
(): Promise<PauseReferralProgramResponse & PauseReferralProgramResponseNonNullableFields>;
|
|
1595
1961
|
}
|
|
1596
|
-
declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient
|
|
1962
|
+
declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GetAiSocialMediaPostsSuggestionsSignature;
|
|
1597
1963
|
interface GetAiSocialMediaPostsSuggestionsSignature {
|
|
1598
1964
|
/**
|
|
1599
1965
|
* Retrieves pre-generated AI social media post suggestions for promoting the referral program.
|
|
@@ -1605,7 +1971,7 @@ interface GetAiSocialMediaPostsSuggestionsSignature {
|
|
|
1605
1971
|
*/
|
|
1606
1972
|
(options?: GetAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GetAISocialMediaPostsSuggestionsResponse & GetAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
1607
1973
|
}
|
|
1608
|
-
declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient
|
|
1974
|
+
declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GenerateAiSocialMediaPostsSuggestionsSignature;
|
|
1609
1975
|
interface GenerateAiSocialMediaPostsSuggestionsSignature {
|
|
1610
1976
|
/**
|
|
1611
1977
|
* Creates new AI-generated social media post suggestions for promoting the referral program.
|
|
@@ -1616,25 +1982,43 @@ interface GenerateAiSocialMediaPostsSuggestionsSignature {
|
|
|
1616
1982
|
*/
|
|
1617
1983
|
(options?: GenerateAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GenerateAISocialMediaPostsSuggestionsResponse & GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
1618
1984
|
}
|
|
1619
|
-
declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient
|
|
1985
|
+
declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient): GetReferralProgramPremiumFeaturesSignature;
|
|
1620
1986
|
interface GetReferralProgramPremiumFeaturesSignature {
|
|
1621
1987
|
/**
|
|
1622
1988
|
* Retrieves information about the enabled premium features for the referral program.
|
|
1623
1989
|
*/
|
|
1624
1990
|
(): Promise<GetReferralProgramPremiumFeaturesResponse & GetReferralProgramPremiumFeaturesResponseNonNullableFields>;
|
|
1625
1991
|
}
|
|
1626
|
-
declare const onProgramUpdated$1: EventDefinition$
|
|
1992
|
+
declare const onProgramUpdated$1: EventDefinition$4<ProgramUpdatedEnvelope, "wix.loyalty.referral.v1.program_updated">;
|
|
1993
|
+
|
|
1994
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
1995
|
+
__type: 'event-definition';
|
|
1996
|
+
type: Type;
|
|
1997
|
+
isDomainEvent?: boolean;
|
|
1998
|
+
transformations?: (envelope: unknown) => Payload;
|
|
1999
|
+
__payload: Payload;
|
|
2000
|
+
};
|
|
2001
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
2002
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
2003
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
2004
|
+
|
|
2005
|
+
declare global {
|
|
2006
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
2007
|
+
interface SymbolConstructor {
|
|
2008
|
+
readonly observable: symbol;
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
1627
2011
|
|
|
1628
2012
|
declare function createEventModule$3<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
|
|
1629
2013
|
|
|
1630
|
-
declare const getReferralProgram: BuildRESTFunction
|
|
1631
|
-
declare const queryReferralPrograms: BuildRESTFunction
|
|
1632
|
-
declare const updateReferralProgram: BuildRESTFunction
|
|
1633
|
-
declare const activateReferralProgram: BuildRESTFunction
|
|
1634
|
-
declare const pauseReferralProgram: BuildRESTFunction
|
|
1635
|
-
declare const getAiSocialMediaPostsSuggestions: BuildRESTFunction
|
|
1636
|
-
declare const generateAiSocialMediaPostsSuggestions: BuildRESTFunction
|
|
1637
|
-
declare const getReferralProgramPremiumFeatures: BuildRESTFunction
|
|
2014
|
+
declare const getReferralProgram: MaybeContext<BuildRESTFunction<typeof getReferralProgram$1> & typeof getReferralProgram$1>;
|
|
2015
|
+
declare const queryReferralPrograms: MaybeContext<BuildRESTFunction<typeof queryReferralPrograms$1> & typeof queryReferralPrograms$1>;
|
|
2016
|
+
declare const updateReferralProgram: MaybeContext<BuildRESTFunction<typeof updateReferralProgram$1> & typeof updateReferralProgram$1>;
|
|
2017
|
+
declare const activateReferralProgram: MaybeContext<BuildRESTFunction<typeof activateReferralProgram$1> & typeof activateReferralProgram$1>;
|
|
2018
|
+
declare const pauseReferralProgram: MaybeContext<BuildRESTFunction<typeof pauseReferralProgram$1> & typeof pauseReferralProgram$1>;
|
|
2019
|
+
declare const getAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof getAiSocialMediaPostsSuggestions$1> & typeof getAiSocialMediaPostsSuggestions$1>;
|
|
2020
|
+
declare const generateAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof generateAiSocialMediaPostsSuggestions$1> & typeof generateAiSocialMediaPostsSuggestions$1>;
|
|
2021
|
+
declare const getReferralProgramPremiumFeatures: MaybeContext<BuildRESTFunction<typeof getReferralProgramPremiumFeatures$1> & typeof getReferralProgramPremiumFeatures$1>;
|
|
1638
2022
|
|
|
1639
2023
|
type _publicOnProgramUpdatedType = typeof onProgramUpdated$1;
|
|
1640
2024
|
/** */
|
|
@@ -1767,50 +2151,6 @@ declare namespace index_d$4 {
|
|
|
1767
2151
|
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 CursorPaging$4 as CursorPaging, type CursorPagingMetadata$4 as CursorPagingMetadata, type CursorQuery$4 as CursorQuery, type CursorQueryPagingMethodOneOf$4 as CursorQueryPagingMethodOneOf, type Cursors$4 as Cursors, 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_QueryReferralProgramsRequest as QueryReferralProgramsRequest, type index_d$4_QueryReferralProgramsResponse as QueryReferralProgramsResponse, type index_d$4_QueryReferralProgramsResponseNonNullableFields as QueryReferralProgramsResponseNonNullableFields, 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 index_d$4_ReferralProgramsQueryBuilder as ReferralProgramsQueryBuilder, type index_d$4_ReferralProgramsQueryResult as ReferralProgramsQueryResult, 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, SortOrder$4 as SortOrder, type Sorting$4 as Sorting, 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_queryReferralPrograms as queryReferralPrograms, index_d$4_updateReferralProgram as updateReferralProgram };
|
|
1768
2152
|
}
|
|
1769
2153
|
|
|
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
|
-
}
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
2154
|
interface ReferralEvent extends ReferralEventEventTypeOneOf {
|
|
1815
2155
|
/** Event triggered when a referred friend signs up. */
|
|
1816
2156
|
referredFriendSignupEvent?: ReferredFriendSignupEvent;
|
|
@@ -2646,7 +2986,7 @@ interface QueryReferredFriendActionsOptions {
|
|
|
2646
2986
|
contactIds?: string[];
|
|
2647
2987
|
}
|
|
2648
2988
|
|
|
2649
|
-
declare function getReferralEvent$1(httpClient: HttpClient
|
|
2989
|
+
declare function getReferralEvent$1(httpClient: HttpClient): GetReferralEventSignature;
|
|
2650
2990
|
interface GetReferralEventSignature {
|
|
2651
2991
|
/**
|
|
2652
2992
|
* Retrieves a referral event by ID.
|
|
@@ -2655,7 +2995,7 @@ interface GetReferralEventSignature {
|
|
|
2655
2995
|
*/
|
|
2656
2996
|
(referralEventId: string): Promise<ReferralEvent & ReferralEventNonNullableFields>;
|
|
2657
2997
|
}
|
|
2658
|
-
declare function queryReferralEvent$1(httpClient: HttpClient
|
|
2998
|
+
declare function queryReferralEvent$1(httpClient: HttpClient): QueryReferralEventSignature;
|
|
2659
2999
|
interface QueryReferralEventSignature {
|
|
2660
3000
|
/**
|
|
2661
3001
|
* Retrieves a list of referral events, given the provided paging, filtering, and sorting.
|
|
@@ -2667,14 +3007,14 @@ interface QueryReferralEventSignature {
|
|
|
2667
3007
|
*/
|
|
2668
3008
|
(): ReferralEventsQueryBuilder;
|
|
2669
3009
|
}
|
|
2670
|
-
declare function getReferralStatistics$1(httpClient: HttpClient
|
|
3010
|
+
declare function getReferralStatistics$1(httpClient: HttpClient): GetReferralStatisticsSignature;
|
|
2671
3011
|
interface GetReferralStatisticsSignature {
|
|
2672
3012
|
/**
|
|
2673
3013
|
* Retrieves referral statistics.
|
|
2674
3014
|
*/
|
|
2675
3015
|
(): Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
|
|
2676
3016
|
}
|
|
2677
|
-
declare function queryReferringCustomerTotals$1(httpClient: HttpClient
|
|
3017
|
+
declare function queryReferringCustomerTotals$1(httpClient: HttpClient): QueryReferringCustomerTotalsSignature;
|
|
2678
3018
|
interface QueryReferringCustomerTotalsSignature {
|
|
2679
3019
|
/**
|
|
2680
3020
|
* Retrieves a list of referring customer totals, given the provided paging, filtering, and sorting.
|
|
@@ -2686,7 +3026,7 @@ interface QueryReferringCustomerTotalsSignature {
|
|
|
2686
3026
|
*/
|
|
2687
3027
|
(options?: QueryReferringCustomerTotalsOptions | undefined): Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
|
|
2688
3028
|
}
|
|
2689
|
-
declare function queryReferredFriendActions$1(httpClient: HttpClient
|
|
3029
|
+
declare function queryReferredFriendActions$1(httpClient: HttpClient): QueryReferredFriendActionsSignature;
|
|
2690
3030
|
interface QueryReferredFriendActionsSignature {
|
|
2691
3031
|
/**
|
|
2692
3032
|
* Retrieves a list of referred friend actions, given the provided paging, filtering, and sorting.
|
|
@@ -2698,15 +3038,33 @@ interface QueryReferredFriendActionsSignature {
|
|
|
2698
3038
|
*/
|
|
2699
3039
|
(options?: QueryReferredFriendActionsOptions | undefined): Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
|
|
2700
3040
|
}
|
|
2701
|
-
declare const onReferralEventCreated$1: EventDefinition$
|
|
3041
|
+
declare const onReferralEventCreated$1: EventDefinition$4<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
|
|
3042
|
+
|
|
3043
|
+
type EventDefinition$2<Payload = unknown, Type extends string = string> = {
|
|
3044
|
+
__type: 'event-definition';
|
|
3045
|
+
type: Type;
|
|
3046
|
+
isDomainEvent?: boolean;
|
|
3047
|
+
transformations?: (envelope: unknown) => Payload;
|
|
3048
|
+
__payload: Payload;
|
|
3049
|
+
};
|
|
3050
|
+
declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
|
|
3051
|
+
type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
|
|
3052
|
+
type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
|
|
3053
|
+
|
|
3054
|
+
declare global {
|
|
3055
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
3056
|
+
interface SymbolConstructor {
|
|
3057
|
+
readonly observable: symbol;
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
2702
3060
|
|
|
2703
3061
|
declare function createEventModule$2<T extends EventDefinition$2<any, string>>(eventDefinition: T): BuildEventDefinition$2<T> & T;
|
|
2704
3062
|
|
|
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
|
|
3063
|
+
declare const getReferralEvent: MaybeContext<BuildRESTFunction<typeof getReferralEvent$1> & typeof getReferralEvent$1>;
|
|
3064
|
+
declare const queryReferralEvent: MaybeContext<BuildRESTFunction<typeof queryReferralEvent$1> & typeof queryReferralEvent$1>;
|
|
3065
|
+
declare const getReferralStatistics: MaybeContext<BuildRESTFunction<typeof getReferralStatistics$1> & typeof getReferralStatistics$1>;
|
|
3066
|
+
declare const queryReferringCustomerTotals: MaybeContext<BuildRESTFunction<typeof queryReferringCustomerTotals$1> & typeof queryReferringCustomerTotals$1>;
|
|
3067
|
+
declare const queryReferredFriendActions: MaybeContext<BuildRESTFunction<typeof queryReferredFriendActions$1> & typeof queryReferredFriendActions$1>;
|
|
2710
3068
|
|
|
2711
3069
|
type _publicOnReferralEventCreatedType = typeof onReferralEventCreated$1;
|
|
2712
3070
|
/** */
|
|
@@ -2759,40 +3117,6 @@ declare namespace index_d$3 {
|
|
|
2759
3117
|
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 };
|
|
2760
3118
|
}
|
|
2761
3119
|
|
|
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
3120
|
interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
|
|
2797
3121
|
/**
|
|
2798
3122
|
* ID of the referring customer who received the reward.
|
|
@@ -3398,7 +3722,7 @@ interface ReferralRewardsQueryBuilder {
|
|
|
3398
3722
|
find: () => Promise<ReferralRewardsQueryResult>;
|
|
3399
3723
|
}
|
|
3400
3724
|
|
|
3401
|
-
declare function getReferralReward$1(httpClient: HttpClient
|
|
3725
|
+
declare function getReferralReward$1(httpClient: HttpClient): GetReferralRewardSignature;
|
|
3402
3726
|
interface GetReferralRewardSignature {
|
|
3403
3727
|
/**
|
|
3404
3728
|
* Retrieves a referral reward.
|
|
@@ -3407,7 +3731,7 @@ interface GetReferralRewardSignature {
|
|
|
3407
3731
|
*/
|
|
3408
3732
|
(_id: string): Promise<ReferralReward & ReferralRewardNonNullableFields>;
|
|
3409
3733
|
}
|
|
3410
|
-
declare function queryReferralRewards$1(httpClient: HttpClient
|
|
3734
|
+
declare function queryReferralRewards$1(httpClient: HttpClient): QueryReferralRewardsSignature;
|
|
3411
3735
|
interface QueryReferralRewardsSignature {
|
|
3412
3736
|
/**
|
|
3413
3737
|
* Retrieves a list of referral rewards, given the provided paging, filtering, and sorting.
|
|
@@ -3420,8 +3744,8 @@ interface QueryReferralRewardsSignature {
|
|
|
3420
3744
|
(options?: QueryReferralRewardsOptions | undefined): ReferralRewardsQueryBuilder;
|
|
3421
3745
|
}
|
|
3422
3746
|
|
|
3423
|
-
declare const getReferralReward: BuildRESTFunction
|
|
3424
|
-
declare const queryReferralRewards: BuildRESTFunction
|
|
3747
|
+
declare const getReferralReward: MaybeContext<BuildRESTFunction<typeof getReferralReward$1> & typeof getReferralReward$1>;
|
|
3748
|
+
declare const queryReferralRewards: MaybeContext<BuildRESTFunction<typeof queryReferralRewards$1> & typeof queryReferralRewards$1>;
|
|
3425
3749
|
|
|
3426
3750
|
type index_d$2_BulkGetReferralRewardsRequest = BulkGetReferralRewardsRequest;
|
|
3427
3751
|
type index_d$2_BulkGetReferralRewardsResponse = BulkGetReferralRewardsResponse;
|
|
@@ -3465,50 +3789,6 @@ declare namespace index_d$2 {
|
|
|
3465
3789
|
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 };
|
|
3466
3790
|
}
|
|
3467
3791
|
|
|
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
3792
|
interface ReferredFriend {
|
|
3513
3793
|
/**
|
|
3514
3794
|
* ID of the referred friend.
|
|
@@ -4008,7 +4288,7 @@ interface ReferredFriendsQueryBuilder {
|
|
|
4008
4288
|
find: () => Promise<ReferredFriendsQueryResult>;
|
|
4009
4289
|
}
|
|
4010
4290
|
|
|
4011
|
-
declare function createReferredFriend$1(httpClient: HttpClient
|
|
4291
|
+
declare function createReferredFriend$1(httpClient: HttpClient): CreateReferredFriendSignature;
|
|
4012
4292
|
interface CreateReferredFriendSignature {
|
|
4013
4293
|
/**
|
|
4014
4294
|
* Creates a new referred friend or returns an existing entity if it already exists.
|
|
@@ -4021,7 +4301,7 @@ interface CreateReferredFriendSignature {
|
|
|
4021
4301
|
*/
|
|
4022
4302
|
(options?: CreateReferredFriendOptions | undefined): Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
|
|
4023
4303
|
}
|
|
4024
|
-
declare function getReferredFriend$1(httpClient: HttpClient
|
|
4304
|
+
declare function getReferredFriend$1(httpClient: HttpClient): GetReferredFriendSignature;
|
|
4025
4305
|
interface GetReferredFriendSignature {
|
|
4026
4306
|
/**
|
|
4027
4307
|
* Retrieves a referred friend by ID.
|
|
@@ -4029,7 +4309,7 @@ interface GetReferredFriendSignature {
|
|
|
4029
4309
|
*/
|
|
4030
4310
|
(referredFriendId: string): Promise<GetReferredFriendResponse & GetReferredFriendResponseNonNullableFields>;
|
|
4031
4311
|
}
|
|
4032
|
-
declare function getReferredFriendByContactId$1(httpClient: HttpClient
|
|
4312
|
+
declare function getReferredFriendByContactId$1(httpClient: HttpClient): GetReferredFriendByContactIdSignature;
|
|
4033
4313
|
interface GetReferredFriendByContactIdSignature {
|
|
4034
4314
|
/**
|
|
4035
4315
|
* Retrieves a referred friend by contact ID.
|
|
@@ -4040,7 +4320,7 @@ interface GetReferredFriendByContactIdSignature {
|
|
|
4040
4320
|
*/
|
|
4041
4321
|
(contactId: string): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
4042
4322
|
}
|
|
4043
|
-
declare function updateReferredFriend$1(httpClient: HttpClient
|
|
4323
|
+
declare function updateReferredFriend$1(httpClient: HttpClient): UpdateReferredFriendSignature;
|
|
4044
4324
|
interface UpdateReferredFriendSignature {
|
|
4045
4325
|
/**
|
|
4046
4326
|
* Updates a referred friend. Supports partial updates.
|
|
@@ -4051,14 +4331,14 @@ interface UpdateReferredFriendSignature {
|
|
|
4051
4331
|
*/
|
|
4052
4332
|
(_id: string, referredFriend: UpdateReferredFriend): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
|
|
4053
4333
|
}
|
|
4054
|
-
declare function deleteReferredFriend$1(httpClient: HttpClient
|
|
4334
|
+
declare function deleteReferredFriend$1(httpClient: HttpClient): DeleteReferredFriendSignature;
|
|
4055
4335
|
interface DeleteReferredFriendSignature {
|
|
4056
4336
|
/**
|
|
4057
4337
|
* Deletes a referred friend.
|
|
4058
4338
|
*/
|
|
4059
4339
|
(referredFriendId: string, options?: DeleteReferredFriendOptions | undefined): Promise<void>;
|
|
4060
4340
|
}
|
|
4061
|
-
declare function queryReferredFriend$1(httpClient: HttpClient
|
|
4341
|
+
declare function queryReferredFriend$1(httpClient: HttpClient): QueryReferredFriendSignature;
|
|
4062
4342
|
interface QueryReferredFriendSignature {
|
|
4063
4343
|
/**
|
|
4064
4344
|
* Retrieves a list of referred friends, given the provided paging, filtering, and sorting.
|
|
@@ -4072,18 +4352,36 @@ interface QueryReferredFriendSignature {
|
|
|
4072
4352
|
*/
|
|
4073
4353
|
(): ReferredFriendsQueryBuilder;
|
|
4074
4354
|
}
|
|
4075
|
-
declare const onReferredFriendCreated$1: EventDefinition$
|
|
4076
|
-
declare const onReferredFriendUpdated$1: EventDefinition$
|
|
4077
|
-
declare const onReferredFriendDeleted$1: EventDefinition$
|
|
4355
|
+
declare const onReferredFriendCreated$1: EventDefinition$4<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
|
|
4356
|
+
declare const onReferredFriendUpdated$1: EventDefinition$4<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
|
|
4357
|
+
declare const onReferredFriendDeleted$1: EventDefinition$4<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
|
|
4358
|
+
|
|
4359
|
+
type EventDefinition$1<Payload = unknown, Type extends string = string> = {
|
|
4360
|
+
__type: 'event-definition';
|
|
4361
|
+
type: Type;
|
|
4362
|
+
isDomainEvent?: boolean;
|
|
4363
|
+
transformations?: (envelope: unknown) => Payload;
|
|
4364
|
+
__payload: Payload;
|
|
4365
|
+
};
|
|
4366
|
+
declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
|
|
4367
|
+
type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
|
|
4368
|
+
type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
|
|
4369
|
+
|
|
4370
|
+
declare global {
|
|
4371
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4372
|
+
interface SymbolConstructor {
|
|
4373
|
+
readonly observable: symbol;
|
|
4374
|
+
}
|
|
4375
|
+
}
|
|
4078
4376
|
|
|
4079
4377
|
declare function createEventModule$1<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
|
|
4080
4378
|
|
|
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
|
|
4379
|
+
declare const createReferredFriend: MaybeContext<BuildRESTFunction<typeof createReferredFriend$1> & typeof createReferredFriend$1>;
|
|
4380
|
+
declare const getReferredFriend: MaybeContext<BuildRESTFunction<typeof getReferredFriend$1> & typeof getReferredFriend$1>;
|
|
4381
|
+
declare const getReferredFriendByContactId: MaybeContext<BuildRESTFunction<typeof getReferredFriendByContactId$1> & typeof getReferredFriendByContactId$1>;
|
|
4382
|
+
declare const updateReferredFriend: MaybeContext<BuildRESTFunction<typeof updateReferredFriend$1> & typeof updateReferredFriend$1>;
|
|
4383
|
+
declare const deleteReferredFriend: MaybeContext<BuildRESTFunction<typeof deleteReferredFriend$1> & typeof deleteReferredFriend$1>;
|
|
4384
|
+
declare const queryReferredFriend: MaybeContext<BuildRESTFunction<typeof queryReferredFriend$1> & typeof queryReferredFriend$1>;
|
|
4087
4385
|
|
|
4088
4386
|
type _publicOnReferredFriendCreatedType = typeof onReferredFriendCreated$1;
|
|
4089
4387
|
/** */
|
|
@@ -4145,50 +4443,6 @@ declare namespace index_d$1 {
|
|
|
4145
4443
|
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 };
|
|
4146
4444
|
}
|
|
4147
4445
|
|
|
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
4446
|
/** ReferringCustomer is the main entity of ReferringCustomers. */
|
|
4193
4447
|
interface ReferringCustomer {
|
|
4194
4448
|
/**
|
|
@@ -4646,16 +4900,34 @@ interface DeleteReferringCustomerSignature {
|
|
|
4646
4900
|
*/
|
|
4647
4901
|
(referringCustomerId: string, options?: DeleteReferringCustomerOptions | undefined): Promise<void>;
|
|
4648
4902
|
}
|
|
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">;
|
|
4903
|
+
declare const onReferringCustomerCreated$1: EventDefinition$4<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
|
|
4904
|
+
declare const onReferringCustomerDeleted$1: EventDefinition$4<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
|
|
4905
|
+
|
|
4906
|
+
type EventDefinition<Payload = unknown, Type extends string = string> = {
|
|
4907
|
+
__type: 'event-definition';
|
|
4908
|
+
type: Type;
|
|
4909
|
+
isDomainEvent?: boolean;
|
|
4910
|
+
transformations?: (envelope: unknown) => Payload;
|
|
4911
|
+
__payload: Payload;
|
|
4912
|
+
};
|
|
4913
|
+
declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
|
|
4914
|
+
type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
|
|
4915
|
+
type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
|
|
4916
|
+
|
|
4917
|
+
declare global {
|
|
4918
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
4919
|
+
interface SymbolConstructor {
|
|
4920
|
+
readonly observable: symbol;
|
|
4921
|
+
}
|
|
4922
|
+
}
|
|
4651
4923
|
|
|
4652
4924
|
declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
|
|
4653
4925
|
|
|
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
|
|
4926
|
+
declare const generateReferringCustomerForContact: MaybeContext<BuildRESTFunction<typeof generateReferringCustomerForContact$1> & typeof generateReferringCustomerForContact$1>;
|
|
4927
|
+
declare const getReferringCustomer: MaybeContext<BuildRESTFunction<typeof getReferringCustomer$1> & typeof getReferringCustomer$1>;
|
|
4928
|
+
declare const getReferringCustomerByReferralCode: MaybeContext<BuildRESTFunction<typeof getReferringCustomerByReferralCode$1> & typeof getReferringCustomerByReferralCode$1>;
|
|
4929
|
+
declare const queryReferringCustomers: MaybeContext<BuildRESTFunction<typeof queryReferringCustomers$1> & typeof queryReferringCustomers$1>;
|
|
4930
|
+
declare const deleteReferringCustomer: MaybeContext<BuildRESTFunction<typeof deleteReferringCustomer$1> & typeof deleteReferringCustomer$1>;
|
|
4659
4931
|
|
|
4660
4932
|
type _publicOnReferringCustomerCreatedType = typeof onReferringCustomerCreated$1;
|
|
4661
4933
|
/** */
|