@wix/referral 1.0.54 → 1.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4834 +0,0 @@
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 name of the environment, use for logging
17
- */
18
- name?: string;
19
- /**
20
- * Optional bast url to use for API requests, for example `www.wixapis.com`
21
- */
22
- apiBaseUrl?: string;
23
- /**
24
- * Possible data to be provided by every host, for cross cutting concerns
25
- * like internationalization, billing, etc.
26
- */
27
- essentials?: {
28
- /**
29
- * The language of the currently viewed session
30
- */
31
- language?: string;
32
- /**
33
- * The locale of the currently viewed session
34
- */
35
- locale?: string;
36
- /**
37
- * Any headers that should be passed through to the API requests
38
- */
39
- passThroughHeaders?: Record<string, string>;
40
- };
41
- };
42
-
43
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
44
- interface HttpClient {
45
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
46
- fetchWithAuth: typeof fetch;
47
- wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
48
- getActiveToken?: () => string | undefined;
49
- }
50
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
51
- type HttpResponse<T = any> = {
52
- data: T;
53
- status: number;
54
- statusText: string;
55
- headers: any;
56
- request?: any;
57
- };
58
- type RequestOptions<_TResponse = any, Data = any> = {
59
- method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
60
- url: string;
61
- data?: Data;
62
- params?: URLSearchParams;
63
- } & APIMetadata;
64
- type APIMetadata = {
65
- methodFqn?: string;
66
- entityFqdn?: string;
67
- packageName?: string;
68
- };
69
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
70
- type EventDefinition<Payload = unknown, Type extends string = string> = {
71
- __type: 'event-definition';
72
- type: Type;
73
- isDomainEvent?: boolean;
74
- transformations?: (envelope: unknown) => Payload;
75
- __payload: Payload;
76
- };
77
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
78
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
79
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
80
-
81
- type ServicePluginMethodInput = {
82
- request: any;
83
- metadata: any;
84
- };
85
- type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
86
- type ServicePluginMethodMetadata = {
87
- name: string;
88
- primaryHttpMappingPath: string;
89
- transformations: {
90
- fromREST: (...args: unknown[]) => ServicePluginMethodInput;
91
- toREST: (...args: unknown[]) => unknown;
92
- };
93
- };
94
- type ServicePluginDefinition<Contract extends ServicePluginContract> = {
95
- __type: 'service-plugin-definition';
96
- componentType: string;
97
- methods: ServicePluginMethodMetadata[];
98
- __contract: Contract;
99
- };
100
- declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
101
- type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
102
- declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
103
-
104
- type RequestContext = {
105
- isSSR: boolean;
106
- host: string;
107
- protocol?: string;
108
- };
109
- type ResponseTransformer = (data: any, headers?: any) => any;
110
- /**
111
- * Ambassador request options types are copied mostly from AxiosRequestConfig.
112
- * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
113
- * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
114
- */
115
- type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
116
- type AmbassadorRequestOptions<T = any> = {
117
- _?: T;
118
- url?: string;
119
- method?: Method;
120
- params?: any;
121
- data?: any;
122
- transformResponse?: ResponseTransformer | ResponseTransformer[];
123
- };
124
- type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
125
- __isAmbassador: boolean;
126
- };
127
- type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
128
- type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
129
-
130
- declare global {
131
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
132
- interface SymbolConstructor {
133
- readonly observable: symbol;
134
- }
135
- }
136
-
137
- declare const emptyObjectSymbol: unique symbol;
138
-
139
- /**
140
- Represents a strictly empty plain object, the `{}` value.
141
-
142
- 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)).
143
-
144
- @example
145
- ```
146
- import type {EmptyObject} from 'type-fest';
147
-
148
- // The following illustrates the problem with `{}`.
149
- const foo1: {} = {}; // Pass
150
- const foo2: {} = []; // Pass
151
- const foo3: {} = 42; // Pass
152
- const foo4: {} = {a: 1}; // Pass
153
-
154
- // With `EmptyObject` only the first case is valid.
155
- const bar1: EmptyObject = {}; // Pass
156
- const bar2: EmptyObject = 42; // Fail
157
- const bar3: EmptyObject = []; // Fail
158
- const bar4: EmptyObject = {a: 1}; // Fail
159
- ```
160
-
161
- 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}.
162
-
163
- @category Object
164
- */
165
- type EmptyObject = {[emptyObjectSymbol]?: never};
166
-
167
- /**
168
- Returns a boolean for whether the two given types are equal.
169
-
170
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
171
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
172
-
173
- Use-cases:
174
- - If you want to make a conditional branch based on the result of a comparison of two types.
175
-
176
- @example
177
- ```
178
- import type {IsEqual} from 'type-fest';
179
-
180
- // This type returns a boolean for whether the given array includes the given item.
181
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
182
- type Includes<Value extends readonly any[], Item> =
183
- Value extends readonly [Value[0], ...infer rest]
184
- ? IsEqual<Value[0], Item> extends true
185
- ? true
186
- : Includes<rest, Item>
187
- : false;
188
- ```
189
-
190
- @category Type Guard
191
- @category Utilities
192
- */
193
- type IsEqual<A, B> =
194
- (<G>() => G extends A ? 1 : 2) extends
195
- (<G>() => G extends B ? 1 : 2)
196
- ? true
197
- : false;
198
-
199
- /**
200
- Filter out keys from an object.
201
-
202
- Returns `never` if `Exclude` is strictly equal to `Key`.
203
- Returns `never` if `Key` extends `Exclude`.
204
- Returns `Key` otherwise.
205
-
206
- @example
207
- ```
208
- type Filtered = Filter<'foo', 'foo'>;
209
- //=> never
210
- ```
211
-
212
- @example
213
- ```
214
- type Filtered = Filter<'bar', string>;
215
- //=> never
216
- ```
217
-
218
- @example
219
- ```
220
- type Filtered = Filter<'bar', 'foo'>;
221
- //=> 'bar'
222
- ```
223
-
224
- @see {Except}
225
- */
226
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
227
-
228
- type ExceptOptions = {
229
- /**
230
- Disallow assigning non-specified properties.
231
-
232
- Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
233
-
234
- @default false
235
- */
236
- requireExactProps?: boolean;
237
- };
238
-
239
- /**
240
- Create a type from an object type without certain keys.
241
-
242
- We recommend setting the `requireExactProps` option to `true`.
243
-
244
- 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.
245
-
246
- 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)).
247
-
248
- @example
249
- ```
250
- import type {Except} from 'type-fest';
251
-
252
- type Foo = {
253
- a: number;
254
- b: string;
255
- };
256
-
257
- type FooWithoutA = Except<Foo, 'a'>;
258
- //=> {b: string}
259
-
260
- const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
261
- //=> errors: 'a' does not exist in type '{ b: string; }'
262
-
263
- type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
264
- //=> {a: number} & Partial<Record<"b", never>>
265
-
266
- const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
267
- //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
268
- ```
269
-
270
- @category Object
271
- */
272
- type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
273
- [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
274
- } & (Options['requireExactProps'] extends true
275
- ? Partial<Record<KeysType, never>>
276
- : {});
277
-
278
- /**
279
- Returns a boolean for whether the given type is `never`.
280
-
281
- @link https://github.com/microsoft/TypeScript/issues/31751#issuecomment-498526919
282
- @link https://stackoverflow.com/a/53984913/10292952
283
- @link https://www.zhenghao.io/posts/ts-never
284
-
285
- Useful in type utilities, such as checking if something does not occur.
286
-
287
- @example
288
- ```
289
- import type {IsNever, And} from 'type-fest';
290
-
291
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
292
- type AreStringsEqual<A extends string, B extends string> =
293
- And<
294
- IsNever<Exclude<A, B>> extends true ? true : false,
295
- IsNever<Exclude<B, A>> extends true ? true : false
296
- >;
297
-
298
- type EndIfEqual<I extends string, O extends string> =
299
- AreStringsEqual<I, O> extends true
300
- ? never
301
- : void;
302
-
303
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
304
- if (input === output) {
305
- process.exit(0);
306
- }
307
- }
308
-
309
- endIfEqual('abc', 'abc');
310
- //=> never
311
-
312
- endIfEqual('abc', '123');
313
- //=> void
314
- ```
315
-
316
- @category Type Guard
317
- @category Utilities
318
- */
319
- type IsNever<T> = [T] extends [never] ? true : false;
320
-
321
- /**
322
- An if-else-like type that resolves depending on whether the given type is `never`.
323
-
324
- @see {@link IsNever}
325
-
326
- @example
327
- ```
328
- import type {IfNever} from 'type-fest';
329
-
330
- type ShouldBeTrue = IfNever<never>;
331
- //=> true
332
-
333
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
334
- //=> 'bar'
335
- ```
336
-
337
- @category Type Guard
338
- @category Utilities
339
- */
340
- type IfNever<T, TypeIfNever = true, TypeIfNotNever = false> = (
341
- IsNever<T> extends true ? TypeIfNever : TypeIfNotNever
342
- );
343
-
344
- /**
345
- Extract the keys from a type where the value type of the key extends the given `Condition`.
346
-
347
- Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
348
-
349
- @example
350
- ```
351
- import type {ConditionalKeys} from 'type-fest';
352
-
353
- interface Example {
354
- a: string;
355
- b: string | number;
356
- c?: string;
357
- d: {};
358
- }
359
-
360
- type StringKeysOnly = ConditionalKeys<Example, string>;
361
- //=> 'a'
362
- ```
363
-
364
- To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
365
-
366
- @example
367
- ```
368
- import type {ConditionalKeys} from 'type-fest';
369
-
370
- type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
371
- //=> 'a' | 'c'
372
- ```
373
-
374
- @category Object
375
- */
376
- type ConditionalKeys<Base, Condition> =
377
- {
378
- // Map through all the keys of the given base type.
379
- [Key in keyof Base]-?:
380
- // Pick only keys with types extending the given `Condition` type.
381
- Base[Key] extends Condition
382
- // Retain this key
383
- // If the value for the key extends never, only include it if `Condition` also extends never
384
- ? IfNever<Base[Key], IfNever<Condition, Key, never>, Key>
385
- // Discard this key since the condition fails.
386
- : never;
387
- // Convert the produced object into a union type of the keys which passed the conditional test.
388
- }[keyof Base];
389
-
390
- /**
391
- Exclude keys from a shape that matches the given `Condition`.
392
-
393
- 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.
394
-
395
- @example
396
- ```
397
- import type {Primitive, ConditionalExcept} from 'type-fest';
398
-
399
- class Awesome {
400
- name: string;
401
- successes: number;
402
- failures: bigint;
403
-
404
- run() {}
405
- }
406
-
407
- type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
408
- //=> {run: () => void}
409
- ```
410
-
411
- @example
412
- ```
413
- import type {ConditionalExcept} from 'type-fest';
414
-
415
- interface Example {
416
- a: string;
417
- b: string | number;
418
- c: () => void;
419
- d: {};
420
- }
421
-
422
- type NonStringKeysOnly = ConditionalExcept<Example, string>;
423
- //=> {b: string | number; c: () => void; d: {}}
424
- ```
425
-
426
- @category Object
427
- */
428
- type ConditionalExcept<Base, Condition> = Except<
429
- Base,
430
- ConditionalKeys<Base, Condition>
431
- >;
432
-
433
- /**
434
- * Descriptors are objects that describe the API of a module, and the module
435
- * can either be a REST module or a host module.
436
- * This type is recursive, so it can describe nested modules.
437
- */
438
- type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
439
- [key: string]: Descriptors | PublicMetadata | any;
440
- };
441
- /**
442
- * This type takes in a descriptors object of a certain Host (including an `unknown` host)
443
- * and returns an object with the same structure, but with all descriptors replaced with their API.
444
- * Any non-descriptor properties are removed from the returned object, including descriptors that
445
- * do not match the given host (as they will not work with the given host).
446
- */
447
- type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
448
- done: T;
449
- recurse: T extends {
450
- __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
451
- } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
452
- [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
453
- -1,
454
- 0,
455
- 1,
456
- 2,
457
- 3,
458
- 4,
459
- 5
460
- ][Depth]> : never;
461
- }, EmptyObject>;
462
- }[Depth extends -1 ? 'done' : 'recurse'];
463
- type PublicMetadata = {
464
- PACKAGE_NAME?: string;
465
- };
466
-
467
- declare global {
468
- interface ContextualClient {
469
- }
470
- }
471
- /**
472
- * A type used to create concerete types from SDK descriptors in
473
- * case a contextual client is available.
474
- */
475
- type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
476
- host: Host;
477
- } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
478
-
479
- interface ReferralProgram {
480
- /** Referral program name. */
481
- name?: string | null;
482
- /** @readonly */
483
- status?: ProgramStatus;
484
- /**
485
- * Revision number, which increments by 1 each time the program is updated.
486
- * To prevent conflicting changes, the current `revision` must be passed when updating the program.
487
- */
488
- revision?: string | null;
489
- /**
490
- * Date and time the program was created.
491
- * @readonly
492
- */
493
- _createdDate?: Date | null;
494
- /**
495
- * Date and time the program was last updated.
496
- * @readonly
497
- */
498
- _updatedDate?: Date | null;
499
- /**
500
- * Reward configuration for the referred friend.
501
- * Specifies the reward given to a new customer who was referred to the business.
502
- */
503
- referredFriendReward?: Reward$2;
504
- /**
505
- * Reward configuration for the referring customer.
506
- * Specifies the reward given to an existing customer who referred a new customer to the business.
507
- */
508
- referringCustomerReward?: Reward$2;
509
- /** List of actions that complete a referral. For an action to be considered successful, the referred friend must place and pay for an item. */
510
- successfulReferralActions?: Action[];
511
- /** Configures email notifications for the referral program. */
512
- emails?: Emails;
513
- /**
514
- * Indicates which premium features are available for the current account.
515
- * @readonly
516
- */
517
- premiumFeatures?: PremiumFeatures;
518
- }
519
- /** Status of the referral program. */
520
- declare enum ProgramStatus {
521
- /** Unknown program status. */
522
- UNKNOWN = "UNKNOWN",
523
- /** Referral program is in a draft state and is being modified. It is not yet active. */
524
- DRAFT = "DRAFT",
525
- /** Referral program is active. */
526
- ACTIVE = "ACTIVE",
527
- /** Referral program is paused. */
528
- PAUSED = "PAUSED"
529
- }
530
- interface Reward$2 extends RewardOptionsOneOf$1 {
531
- /** Options for coupon reward type. */
532
- couponOptions?: Coupon$2;
533
- /** Options for the Loyalty points reward type. */
534
- loyaltyPointsOptions?: LoyaltyPoints$2;
535
- /** Type of the reward. */
536
- type?: Type$1;
537
- }
538
- /** @oneof */
539
- interface RewardOptionsOneOf$1 {
540
- /** Options for coupon reward type. */
541
- couponOptions?: Coupon$2;
542
- /** Options for the Loyalty points reward type. */
543
- loyaltyPointsOptions?: LoyaltyPoints$2;
544
- }
545
- declare enum Type$1 {
546
- /** Unknown reward type. */
547
- UNKNOWN = "UNKNOWN",
548
- /** Coupon reward type. */
549
- COUPON = "COUPON",
550
- /** Loyalty points reward type. */
551
- LOYALTY_POINTS = "LOYALTY_POINTS",
552
- /** No reward type. */
553
- NOTHING = "NOTHING"
554
- }
555
- interface Coupon$2 extends CouponDiscountTypeOptionsOneOf$2, CouponScopeOrMinSubtotalOneOf$2 {
556
- /** Options for fixed amount discount. */
557
- fixedAmountOptions?: FixedAmountDiscount$2;
558
- /** Options for percentage discounts. */
559
- percentageOptions?: PercentageDiscount$2;
560
- /** Limit the coupon to carts with a subtotal above this number. */
561
- minimumSubtotal?: number;
562
- /** Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
563
- scope?: CouponScope$2;
564
- /** Coupon name. */
565
- name?: string;
566
- /** Coupon discount type. */
567
- discountType?: DiscountType$2;
568
- /**
569
- * Whether the coupon is limited to one item.
570
- * If `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.
571
- * Coupons with a bookings `scope.namespace` are always limited to one item.
572
- */
573
- limitedToOneItem?: boolean | null;
574
- /** Whether the coupon applies to subscription products. */
575
- appliesToSubscriptions?: boolean | null;
576
- /**
577
- * Specifies the amount of discounted cycles for a subscription item.
578
- *
579
- * - Can only be set when `scope.namespace = pricingPlans`.
580
- * - If `discountedCycleCount` is empty, the coupon applies to all available cycles.
581
- * - `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.
582
- *
583
- * Max: `999`
584
- */
585
- discountedCycleCount?: number | null;
586
- }
587
- /** @oneof */
588
- interface CouponDiscountTypeOptionsOneOf$2 {
589
- /** Options for fixed amount discount. */
590
- fixedAmountOptions?: FixedAmountDiscount$2;
591
- /** Options for percentage discounts. */
592
- percentageOptions?: PercentageDiscount$2;
593
- }
594
- /** @oneof */
595
- interface CouponScopeOrMinSubtotalOneOf$2 {
596
- /** Limit the coupon to carts with a subtotal above this number. */
597
- minimumSubtotal?: number;
598
- /** Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
599
- scope?: CouponScope$2;
600
- }
601
- declare enum DiscountType$2 {
602
- /** Unknown discount type. */
603
- UNKNOWN = "UNKNOWN",
604
- /** Discount as a fixed amount. */
605
- FIXED_AMOUNT = "FIXED_AMOUNT",
606
- /** Discount as a percentage. */
607
- PERCENTAGE = "PERCENTAGE",
608
- /** Free shipping. If `true`, the coupon applies to all items in all `namespaces`. */
609
- FREE_SHIPPING = "FREE_SHIPPING"
610
- }
611
- interface FixedAmountDiscount$2 {
612
- /** Amount of the discount as a fixed value. */
613
- amount?: number;
614
- }
615
- interface PercentageDiscount$2 {
616
- /** Percentage of discount. */
617
- percentage?: number;
618
- }
619
- interface CouponScope$2 {
620
- /** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
621
- namespace?: string;
622
- /** Coupon scope's applied group, for example, Event or ticket in Wix Events. */
623
- group?: Group$2;
624
- }
625
- interface Group$2 {
626
- /** Name of the group. */
627
- name?: string;
628
- /** Entity ID of the group. */
629
- entityId?: string | null;
630
- }
631
- interface LoyaltyPoints$2 {
632
- /** Number of loyalty points to give. */
633
- amount?: number;
634
- }
635
- declare enum Action {
636
- /** Unknown action. */
637
- UNKNOWN = "UNKNOWN",
638
- /** Referred friend ordered and paid for an order in a store. */
639
- STORE_ORDER_PLACED = "STORE_ORDER_PLACED",
640
- /** Referred friend ordered and paid for a plan. */
641
- PLAN_ORDERED = "PLAN_ORDERED",
642
- /** Referred friend ordered and paid for a ticket. */
643
- TICKET_ORDERED = "TICKET_ORDERED",
644
- /** Referred friend booked and paid for a session. */
645
- SESSION_BOOKED = "SESSION_BOOKED",
646
- /** Referred friend placed and paid for a restaurant order. */
647
- RESTAURANT_ORDER_PLACED = "RESTAURANT_ORDER_PLACED",
648
- /** Referred friend joined an online program. */
649
- ONLINE_PROGRAM_JOINED = "ONLINE_PROGRAM_JOINED"
650
- }
651
- interface Emails {
652
- /** Configures email invitations to encourage customers to refer their friends. Select the apps for which this feature is enabled. */
653
- encourageToReferFriends?: App[];
654
- /**
655
- * Whether to send email notifications to referring customers when they receive a referral reward.
656
- * If true, referring customers will be notified by email when their referred friend completes a qualifying action (for example, placing an order).
657
- */
658
- notifyCustomersAboutReward?: boolean;
659
- }
660
- declare enum App {
661
- /** Unknown app. */
662
- UNKNOWN = "UNKNOWN",
663
- /** Send an email to customers who've placed an order with stores. */
664
- STORES = "STORES",
665
- /** Send an email to customers who've placed an order with pricing plans. */
666
- PRICING_PLANS = "PRICING_PLANS",
667
- /** Send an email to customers who've placed an order with events. */
668
- EVENTS = "EVENTS",
669
- /** Send an email to customers who've placed an order with bookings. */
670
- BOOKINGS = "BOOKINGS",
671
- /** Send an email to customers who've placed an order with restaurants. */
672
- RESTAURANTS = "RESTAURANTS"
673
- }
674
- interface PremiumFeatures {
675
- /**
676
- * Whether the site owner has access to the referral program feature.
677
- * @readonly
678
- */
679
- referralProgram?: boolean;
680
- }
681
- interface GetReferralProgramRequest {
682
- }
683
- interface GetReferralProgramResponse {
684
- /** Retrieved referral program. */
685
- referralProgram?: ReferralProgram;
686
- }
687
- interface BulkGetReferralProgramRequest {
688
- }
689
- interface BulkGetReferralProgramResponse {
690
- /** Retrieved referral programs. */
691
- programInSites?: ProgramInSite[];
692
- }
693
- interface ProgramInSite {
694
- /** Metasite ID. */
695
- metaSiteId?: string;
696
- /** Retrieved referral program. */
697
- referralProgram?: ReferralProgram;
698
- }
699
- interface UpdateReferralProgramRequest {
700
- /** Referral program to update. Include the latest `revision` for a successful update. */
701
- referralProgram: ReferralProgram;
702
- }
703
- interface UpdateReferralProgramResponse {
704
- /** Updated referral program. */
705
- referralProgram?: ReferralProgram;
706
- }
707
- interface ActivateReferralProgramRequest {
708
- }
709
- interface ActivateReferralProgramResponse {
710
- /** Activated referral program. */
711
- referralProgram?: ReferralProgram;
712
- }
713
- interface PauseReferralProgramRequest {
714
- }
715
- interface PauseReferralProgramResponse {
716
- /** Paused referral program. */
717
- referralProgram?: ReferralProgram;
718
- }
719
- interface GetAISocialMediaPostsSuggestionsRequest {
720
- /** Topic to generate social media post suggestions for. For example, fitness, education, technology. */
721
- topic?: string;
722
- }
723
- interface GetAISocialMediaPostsSuggestionsResponse {
724
- /** Generated social media post suggestions. */
725
- suggestions?: AISocialMediaPostSuggestion[];
726
- /** Referral URL to refer friends. */
727
- referFriendsPageUrl?: string | null;
728
- }
729
- interface AISocialMediaPostSuggestion {
730
- /** Suggested post content. */
731
- postContent?: string;
732
- /** Suggested hashtags. */
733
- hashtags?: string[];
734
- }
735
- interface GenerateAISocialMediaPostsSuggestionsRequest {
736
- /** Topic to generate social media post suggestions for. For example, fitness, education, technology. */
737
- topic?: string;
738
- }
739
- interface GenerateAISocialMediaPostsSuggestionsResponse {
740
- /** Generated social media post suggestions. */
741
- suggestions?: AISocialMediaPostSuggestion[];
742
- /** Referral URL to refer friends. */
743
- referFriendsPageUrl?: string | null;
744
- }
745
- interface GetReferralProgramPremiumFeaturesRequest {
746
- }
747
- interface GetReferralProgramPremiumFeaturesResponse {
748
- /**
749
- * Whether the site has the referral program feature enabled.
750
- * @readonly
751
- */
752
- referralProgram?: boolean;
753
- }
754
- interface DomainEvent$4 extends DomainEventBodyOneOf$4 {
755
- createdEvent?: EntityCreatedEvent$4;
756
- updatedEvent?: EntityUpdatedEvent$4;
757
- deletedEvent?: EntityDeletedEvent$4;
758
- actionEvent?: ActionEvent$4;
759
- /**
760
- * Unique event ID.
761
- * Allows clients to ignore duplicate webhooks.
762
- */
763
- _id?: string;
764
- /**
765
- * Assumes actions are also always typed to an entity_type
766
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
767
- */
768
- entityFqdn?: string;
769
- /**
770
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
771
- * This is although the created/updated/deleted notion is duplication of the oneof types
772
- * Example: created/updated/deleted/started/completed/email_opened
773
- */
774
- slug?: string;
775
- /** ID of the entity associated with the event. */
776
- entityId?: string;
777
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
778
- eventTime?: Date | null;
779
- /**
780
- * Whether the event was triggered as a result of a privacy regulation application
781
- * (for example, GDPR).
782
- */
783
- triggeredByAnonymizeRequest?: boolean | null;
784
- /** If present, indicates the action that triggered the event. */
785
- originatedFrom?: string | null;
786
- /**
787
- * A sequence number defining the order of updates to the underlying entity.
788
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
789
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
790
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
791
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
792
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
793
- */
794
- entityEventSequence?: string | null;
795
- }
796
- /** @oneof */
797
- interface DomainEventBodyOneOf$4 {
798
- createdEvent?: EntityCreatedEvent$4;
799
- updatedEvent?: EntityUpdatedEvent$4;
800
- deletedEvent?: EntityDeletedEvent$4;
801
- actionEvent?: ActionEvent$4;
802
- }
803
- interface EntityCreatedEvent$4 {
804
- entity?: string;
805
- }
806
- interface RestoreInfo$4 {
807
- deletedDate?: Date | null;
808
- }
809
- interface EntityUpdatedEvent$4 {
810
- /**
811
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
812
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
813
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
814
- */
815
- currentEntity?: string;
816
- }
817
- interface EntityDeletedEvent$4 {
818
- /** Entity that was deleted */
819
- deletedEntity?: string | null;
820
- }
821
- interface ActionEvent$4 {
822
- body?: string;
823
- }
824
- interface Empty$3 {
825
- }
826
- interface MetaSiteSpecialEvent extends MetaSiteSpecialEventPayloadOneOf {
827
- /** Emitted on a meta site creation. */
828
- siteCreated?: SiteCreated;
829
- /** Emitted on a meta site transfer completion. */
830
- siteTransferred?: SiteTransferred;
831
- /** Emitted on a meta site deletion. */
832
- siteDeleted?: SiteDeleted;
833
- /** Emitted on a meta site restoration. */
834
- siteUndeleted?: SiteUndeleted;
835
- /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
836
- sitePublished?: SitePublished;
837
- /** Emitted on a meta site unpublish. */
838
- siteUnpublished?: SiteUnpublished;
839
- /** Emitted when meta site is marked as template. */
840
- siteMarkedAsTemplate?: SiteMarkedAsTemplate;
841
- /** Emitted when meta site is marked as a WixSite. */
842
- siteMarkedAsWixSite?: SiteMarkedAsWixSite;
843
- /** Emitted when an application is provisioned (installed). */
844
- serviceProvisioned?: ServiceProvisioned;
845
- /** Emitted when an application is removed (uninstalled). */
846
- serviceRemoved?: ServiceRemoved;
847
- /** Emitted when meta site name (URL slug) is changed. */
848
- siteRenamedPayload?: SiteRenamed;
849
- /** Emitted when meta site was permanently deleted. */
850
- hardDeleted?: SiteHardDeleted;
851
- /** Emitted on a namespace change. */
852
- namespaceChanged?: NamespaceChanged;
853
- /** Emitted when Studio is attached. */
854
- studioAssigned?: StudioAssigned;
855
- /** Emitted when Studio is detached. */
856
- studioUnassigned?: StudioUnassigned;
857
- /** A meta site id. */
858
- metaSiteId?: string;
859
- /** A meta site version. Monotonically increasing. */
860
- version?: string;
861
- /** A timestamp of the event. */
862
- timestamp?: string;
863
- /**
864
- * TODO(meta-site): Change validation once validations are disabled for consumers
865
- * More context: https://wix.slack.com/archives/C0UHEBPFT/p1720957844413149 and https://wix.slack.com/archives/CFWKX325T/p1728892152855659
866
- */
867
- assets?: Asset[];
868
- }
869
- /** @oneof */
870
- interface MetaSiteSpecialEventPayloadOneOf {
871
- /** Emitted on a meta site creation. */
872
- siteCreated?: SiteCreated;
873
- /** Emitted on a meta site transfer completion. */
874
- siteTransferred?: SiteTransferred;
875
- /** Emitted on a meta site deletion. */
876
- siteDeleted?: SiteDeleted;
877
- /** Emitted on a meta site restoration. */
878
- siteUndeleted?: SiteUndeleted;
879
- /** Emitted on the first* publish of the meta site (* switching from unpublished to published state). */
880
- sitePublished?: SitePublished;
881
- /** Emitted on a meta site unpublish. */
882
- siteUnpublished?: SiteUnpublished;
883
- /** Emitted when meta site is marked as template. */
884
- siteMarkedAsTemplate?: SiteMarkedAsTemplate;
885
- /** Emitted when meta site is marked as a WixSite. */
886
- siteMarkedAsWixSite?: SiteMarkedAsWixSite;
887
- /** Emitted when an application is provisioned (installed). */
888
- serviceProvisioned?: ServiceProvisioned;
889
- /** Emitted when an application is removed (uninstalled). */
890
- serviceRemoved?: ServiceRemoved;
891
- /** Emitted when meta site name (URL slug) is changed. */
892
- siteRenamedPayload?: SiteRenamed;
893
- /** Emitted when meta site was permanently deleted. */
894
- hardDeleted?: SiteHardDeleted;
895
- /** Emitted on a namespace change. */
896
- namespaceChanged?: NamespaceChanged;
897
- /** Emitted when Studio is attached. */
898
- studioAssigned?: StudioAssigned;
899
- /** Emitted when Studio is detached. */
900
- studioUnassigned?: StudioUnassigned;
901
- }
902
- interface Asset {
903
- /** An application definition id (app_id in dev-center). For legacy reasons may be UUID or a string (from Java Enum). */
904
- appDefId?: string;
905
- /** An instance id. For legacy reasons may be UUID or a string. */
906
- instanceId?: string;
907
- /** An application state. */
908
- state?: State;
909
- }
910
- declare enum State {
911
- UNKNOWN = "UNKNOWN",
912
- ENABLED = "ENABLED",
913
- DISABLED = "DISABLED",
914
- PENDING = "PENDING",
915
- DEMO = "DEMO"
916
- }
917
- interface SiteCreated {
918
- /** A template identifier (empty if not created from a template). */
919
- originTemplateId?: string;
920
- /** An account id of the owner. */
921
- ownerId?: string;
922
- /** A context in which meta site was created. */
923
- context?: SiteCreatedContext;
924
- /**
925
- * A meta site id from which this site was created.
926
- *
927
- * In case of a creation from a template it's a template id.
928
- * In case of a site duplication ("Save As" in dashboard or duplicate in UM) it's an id of a source site.
929
- */
930
- originMetaSiteId?: string | null;
931
- /** A meta site name (URL slug). */
932
- siteName?: string;
933
- /** A namespace. */
934
- namespace?: Namespace;
935
- }
936
- declare enum SiteCreatedContext {
937
- /** A valid option, we don't expose all reasons why site might be created. */
938
- OTHER = "OTHER",
939
- /** A meta site was created from template. */
940
- FROM_TEMPLATE = "FROM_TEMPLATE",
941
- /** A meta site was created by copying of the transfferred meta site. */
942
- DUPLICATE_BY_SITE_TRANSFER = "DUPLICATE_BY_SITE_TRANSFER",
943
- /** A copy of existing meta site. */
944
- DUPLICATE = "DUPLICATE",
945
- /** A meta site was created as a transfferred site (copy of the original), old flow, should die soon. */
946
- OLD_SITE_TRANSFER = "OLD_SITE_TRANSFER",
947
- /** deprecated A meta site was created for Flash editor. */
948
- FLASH = "FLASH"
949
- }
950
- declare enum Namespace {
951
- UNKNOWN_NAMESPACE = "UNKNOWN_NAMESPACE",
952
- /** Default namespace for UGC sites. MetaSites with this namespace will be shown in a user's site list by default. */
953
- WIX = "WIX",
954
- /** ShoutOut stand alone product. These are siteless (no actual Wix site, no HtmlWeb). MetaSites with this namespace will *not* be shown in a user's site list by default. */
955
- SHOUT_OUT = "SHOUT_OUT",
956
- /** MetaSites created by the Albums product, they appear as part of the Albums app. MetaSites with this namespace will *not* be shown in a user's site list by default. */
957
- ALBUMS = "ALBUMS",
958
- /** Part of the WixStores migration flow, a user tries to migrate and gets this site to view and if the user likes it then stores removes this namespace and deletes the old site with the old stores. MetaSites with this namespace will *not* be shown in a user's site list by default. */
959
- WIX_STORES_TEST_DRIVE = "WIX_STORES_TEST_DRIVE",
960
- /** Hotels standalone (siteless). MetaSites with this namespace will *not* be shown in a user's site list by default. */
961
- HOTELS = "HOTELS",
962
- /** Clubs siteless MetaSites, a club without a wix website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
963
- CLUBS = "CLUBS",
964
- /** A partially created ADI website. MetaSites with this namespace will *not* be shown in a user's site list by default. */
965
- ONBOARDING_DRAFT = "ONBOARDING_DRAFT",
966
- /** AppBuilder for AppStudio / shmite (c). MetaSites with this namespace will *not* be shown in a user's site list by default. */
967
- DEV_SITE = "DEV_SITE",
968
- /** LogoMaker websites offered to the user after logo purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
969
- LOGOS = "LOGOS",
970
- /** VideoMaker websites offered to the user after video purchase. MetaSites with this namespace will *not* be shown in a user's site list by default. */
971
- VIDEO_MAKER = "VIDEO_MAKER",
972
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
973
- PARTNER_DASHBOARD = "PARTNER_DASHBOARD",
974
- /** MetaSites with this namespace will *not* be shown in a user's site list by default. */
975
- DEV_CENTER_COMPANY = "DEV_CENTER_COMPANY",
976
- /**
977
- * A draft created by HTML editor on open. Upon "first save" it will be moved to be of WIX domain.
978
- *
979
- * Meta site with this namespace will *not* be shown in a user's site list by default.
980
- */
981
- HTML_DRAFT = "HTML_DRAFT",
982
- /**
983
- * the user-journey for Fitness users who want to start from managing their business instead of designing their website.
984
- * Will be accessible from Site List and will not have a website app.
985
- * Once the user attaches a site, the site will become a regular wixsite.
986
- */
987
- SITELESS_BUSINESS = "SITELESS_BUSINESS",
988
- /** Belongs to "strategic products" company. Supports new product in the creator's economy space. */
989
- CREATOR_ECONOMY = "CREATOR_ECONOMY",
990
- /** It is to be used in the Business First efforts. */
991
- DASHBOARD_FIRST = "DASHBOARD_FIRST",
992
- /** Bookings business flow with no site. */
993
- ANYWHERE = "ANYWHERE",
994
- /** Namespace for Headless Backoffice with no editor */
995
- HEADLESS = "HEADLESS",
996
- /**
997
- * Namespace for master site that will exist in parent account that will be referenced by subaccounts
998
- * The site will be used for account level CSM feature for enterprise
999
- */
1000
- ACCOUNT_MASTER_CMS = "ACCOUNT_MASTER_CMS",
1001
- /** Rise.ai Siteless account management for Gift Cards and Store Credit. */
1002
- RISE = "RISE",
1003
- /**
1004
- * As part of the branded app new funnel, users now can create a meta site that will be branded app first.
1005
- * There's a blank site behind the scene but it's blank).
1006
- * The Mobile company will be the owner of this namespace.
1007
- */
1008
- BRANDED_FIRST = "BRANDED_FIRST",
1009
- /** Nownia.com Siteless account management for Ai Scheduling Assistant. */
1010
- NOWNIA = "NOWNIA",
1011
- /**
1012
- * UGC Templates are templates that are created by users for personal use and to sale to other users.
1013
- * The Partners company owns this namespace.
1014
- */
1015
- UGC_TEMPLATE = "UGC_TEMPLATE",
1016
- /** Codux Headless Sites */
1017
- CODUX = "CODUX",
1018
- /** Bobb - AI Design Creator. */
1019
- MEDIA_DESIGN_CREATOR = "MEDIA_DESIGN_CREATOR"
1020
- }
1021
- /** Site transferred to another user. */
1022
- interface SiteTransferred {
1023
- /** A previous owner id (user that transfers meta site). */
1024
- oldOwnerId?: string;
1025
- /** A new owner id (user that accepts meta site). */
1026
- newOwnerId?: string;
1027
- }
1028
- /** Soft deletion of the meta site. Could be restored. */
1029
- interface SiteDeleted {
1030
- /** A deletion context. */
1031
- deleteContext?: DeleteContext;
1032
- }
1033
- interface DeleteContext {
1034
- /** When the meta site was deleted. */
1035
- dateDeleted?: Date | null;
1036
- /** A status. */
1037
- deleteStatus?: DeleteStatus;
1038
- /** A reason (flow). */
1039
- deleteOrigin?: string;
1040
- /** A service that deleted it. */
1041
- initiatorId?: string | null;
1042
- }
1043
- declare enum DeleteStatus {
1044
- UNKNOWN = "UNKNOWN",
1045
- TRASH = "TRASH",
1046
- DELETED = "DELETED",
1047
- PENDING_PURGE = "PENDING_PURGE"
1048
- }
1049
- /** Restoration of the meta site. */
1050
- interface SiteUndeleted {
1051
- }
1052
- /** First publish of a meta site. Or subsequent publish after unpublish. */
1053
- interface SitePublished {
1054
- }
1055
- interface SiteUnpublished {
1056
- /** A list of URLs previously associated with the meta site. */
1057
- urls?: string[];
1058
- }
1059
- interface SiteMarkedAsTemplate {
1060
- }
1061
- interface SiteMarkedAsWixSite {
1062
- }
1063
- /**
1064
- * Represents a service provisioned a site.
1065
- *
1066
- * Note on `origin_instance_id`:
1067
- * There is no guarantee that you will be able to find a meta site using `origin_instance_id`.
1068
- * This is because of the following scenario:
1069
- *
1070
- * Imagine you have a template where a third-party application (TPA) includes some stub data,
1071
- * such as a product catalog. When you create a site from this template, you inherit this
1072
- * default product catalog. However, if the template's product catalog is modified,
1073
- * your site will retain the catalog as it was at the time of site creation. This ensures that
1074
- * your site remains consistent with what you initially received and does not include any
1075
- * changes made to the original template afterward.
1076
- * To ensure this, the TPA on the template gets a new instance_id.
1077
- */
1078
- interface ServiceProvisioned {
1079
- /** Either UUID or EmbeddedServiceType. */
1080
- appDefId?: string;
1081
- /** Not only UUID. Something here could be something weird. */
1082
- instanceId?: string;
1083
- /** An instance id from which this instance is originated. */
1084
- originInstanceId?: string;
1085
- /** A version. */
1086
- version?: string | null;
1087
- /** The origin meta site id */
1088
- originMetaSiteId?: string | null;
1089
- }
1090
- interface ServiceRemoved {
1091
- /** Either UUID or EmbeddedServiceType. */
1092
- appDefId?: string;
1093
- /** Not only UUID. Something here could be something weird. */
1094
- instanceId?: string;
1095
- /** A version. */
1096
- version?: string | null;
1097
- }
1098
- /** Rename of the site. Meaning, free public url has been changed as well. */
1099
- interface SiteRenamed {
1100
- /** A new meta site name (URL slug). */
1101
- newSiteName?: string;
1102
- /** A previous meta site name (URL slug). */
1103
- oldSiteName?: string;
1104
- }
1105
- /**
1106
- * Hard deletion of the meta site.
1107
- *
1108
- * Could not be restored. Therefore it's desirable to cleanup data.
1109
- */
1110
- interface SiteHardDeleted {
1111
- /** A deletion context. */
1112
- deleteContext?: DeleteContext;
1113
- }
1114
- interface NamespaceChanged {
1115
- /** A previous namespace. */
1116
- oldNamespace?: Namespace;
1117
- /** A new namespace. */
1118
- newNamespace?: Namespace;
1119
- }
1120
- /** Assigned Studio editor */
1121
- interface StudioAssigned {
1122
- }
1123
- /** Unassigned Studio editor */
1124
- interface StudioUnassigned {
1125
- }
1126
- interface HtmlSitePublished {
1127
- /** Application instance ID */
1128
- appInstanceId?: string;
1129
- /** Application type */
1130
- appType?: string;
1131
- /** Revision */
1132
- revision?: string;
1133
- /** MSID */
1134
- metaSiteId?: string | null;
1135
- /** optional branch id if publish is done from branch */
1136
- branchId?: string | null;
1137
- /** The site's last transactionId */
1138
- lastTransactionId?: string | null;
1139
- /** A list of the site's pages */
1140
- pages?: Page[];
1141
- /** Site's publish date */
1142
- publishDate?: string;
1143
- }
1144
- interface Page {
1145
- /** Page's Id */
1146
- _id?: string;
1147
- }
1148
- interface SubscriptionEvent extends SubscriptionEventEventOneOf {
1149
- /** Triggered when a subscription is created. */
1150
- created?: SubscriptionCreated;
1151
- /**
1152
- * Triggered when a subscription is assigned to a Wix site, including the initial
1153
- * assignment of a floating subscription or a re-assignement from a different site.
1154
- */
1155
- assigned?: SubscriptionAssigned;
1156
- /** Triggered when a subscription is canceled. */
1157
- cancelled?: SubscriptionCancelled;
1158
- /** Triggered when the subscription's auto renew is turned on. */
1159
- autoRenewTurnedOn?: SubscriptionAutoRenewTurnedOn;
1160
- /** Triggered when the subscription's auto renew is turned off. */
1161
- autoRenewTurnedOff?: SubscriptionAutoRenewTurnedOff;
1162
- /**
1163
- * Triggered when a subscription is unassigned from a Wix site and becomes
1164
- * floating.
1165
- */
1166
- unassigned?: SubscriptionUnassigned;
1167
- /**
1168
- * Triggered when a subscription is transferred from one Wix account to another.
1169
- * A transfer includes cancelling the original subscription and creating a new
1170
- * subscription for the target account. The event returns both the original
1171
- * and the new subscription.
1172
- */
1173
- transferred?: SubscriptionTransferred;
1174
- /** Triggered when a recurring charge succeeds for a subscription. */
1175
- recurringChargeSucceeded?: RecurringChargeSucceeded;
1176
- /**
1177
- * Triggered when a subscription was updated including when its product has been
1178
- * up- or downgraded or the billing cycle is changed.
1179
- */
1180
- contractSwitched?: ContractSwitched;
1181
- /**
1182
- * Triggered when a subscription gets close to the end of its billing cycle.
1183
- * The exact number of days is defined in the billing system.
1184
- */
1185
- nearEndOfPeriod?: SubscriptionNearEndOfPeriod;
1186
- /**
1187
- * Triggered when a subscription is updated and the change doesn't happen
1188
- * immediately but at the end of the current billing cycle.
1189
- */
1190
- pendingChange?: SubscriptionPendingChange;
1191
- /** ID of the subscription's event. */
1192
- eventId?: string | null;
1193
- /**
1194
- * Date and time of the event in
1195
- * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
1196
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
1197
- */
1198
- eventDate?: Date | null;
1199
- }
1200
- /** @oneof */
1201
- interface SubscriptionEventEventOneOf {
1202
- /** Triggered when a subscription is created. */
1203
- created?: SubscriptionCreated;
1204
- /**
1205
- * Triggered when a subscription is assigned to a Wix site, including the initial
1206
- * assignment of a floating subscription or a re-assignement from a different site.
1207
- */
1208
- assigned?: SubscriptionAssigned;
1209
- /** Triggered when a subscription is canceled. */
1210
- cancelled?: SubscriptionCancelled;
1211
- /** Triggered when the subscription's auto renew is turned on. */
1212
- autoRenewTurnedOn?: SubscriptionAutoRenewTurnedOn;
1213
- /** Triggered when the subscription's auto renew is turned off. */
1214
- autoRenewTurnedOff?: SubscriptionAutoRenewTurnedOff;
1215
- /**
1216
- * Triggered when a subscription is unassigned from a Wix site and becomes
1217
- * floating.
1218
- */
1219
- unassigned?: SubscriptionUnassigned;
1220
- /**
1221
- * Triggered when a subscription is transferred from one Wix account to another.
1222
- * A transfer includes cancelling the original subscription and creating a new
1223
- * subscription for the target account. The event returns both the original
1224
- * and the new subscription.
1225
- */
1226
- transferred?: SubscriptionTransferred;
1227
- /** Triggered when a recurring charge succeeds for a subscription. */
1228
- recurringChargeSucceeded?: RecurringChargeSucceeded;
1229
- /**
1230
- * Triggered when a subscription was updated including when its product has been
1231
- * up- or downgraded or the billing cycle is changed.
1232
- */
1233
- contractSwitched?: ContractSwitched;
1234
- /**
1235
- * Triggered when a subscription gets close to the end of its billing cycle.
1236
- * The exact number of days is defined in the billing system.
1237
- */
1238
- nearEndOfPeriod?: SubscriptionNearEndOfPeriod;
1239
- /**
1240
- * Triggered when a subscription is updated and the change doesn't happen
1241
- * immediately but at the end of the current billing cycle.
1242
- */
1243
- pendingChange?: SubscriptionPendingChange;
1244
- }
1245
- /** Triggered when a subscription is created. */
1246
- interface SubscriptionCreated {
1247
- /** Created subscription. */
1248
- subscription?: Subscription;
1249
- /** Metadata for the `created` event. */
1250
- metadata?: Record<string, string>;
1251
- /**
1252
- * Subscription reactivation data.
1253
- * A subscription can be reactivated for example if it was incorrectly canceled because of fraud and then reactivated
1254
- * by the billing system
1255
- */
1256
- reactivationData?: ReactivationData;
1257
- }
1258
- /**
1259
- * A subscription holds information about a Premium product that a Wix account
1260
- * owner has purchased including details about the billing.
1261
- */
1262
- interface Subscription {
1263
- /** ID of the subscription. */
1264
- _id?: string;
1265
- /** ID of the Wix account that purchased the subscription. */
1266
- userId?: string;
1267
- /**
1268
- * ID of the [product](https://bo.wix.com/wix-docs/rest/premium/premium-product-catalog-v2/products/product-object)
1269
- * for which the subscription was purchased.
1270
- */
1271
- productId?: string;
1272
- /**
1273
- * Date and time the subscription was created in
1274
- * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
1275
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
1276
- */
1277
- createdAt?: Date | null;
1278
- /**
1279
- * Date and time the subscription was last updated in
1280
- * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
1281
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
1282
- */
1283
- updatedAt?: Date | null;
1284
- /**
1285
- * ID of the metasite that the subscription is assigned to.
1286
- * Available only when the subscription is assigned to a Wix site.
1287
- * Subscriptions for account level products can't be assigned to a Wix site.
1288
- */
1289
- metaSiteId?: string | null;
1290
- /** Information about the system that manages the subscription's billing. */
1291
- billingReference?: BillingReference;
1292
- /** Information about the billing cycle of the subscription. */
1293
- cycle?: Cycle;
1294
- /**
1295
- * Subscription status.
1296
- *
1297
- * + `UNKNOWN`: Default status.
1298
- * + `AUTO_RENEW_ON`: Subscription is active and automatically renews at the end of the current billing cycle.
1299
- * + `AUTO_RENEW_OFF`: Subscription is active but expires at the end of the current billing cycle.
1300
- * + `MANUAL_RECURRING`: Subscription is active and renews at the end of the current billing cycle, in case the customer takes an action related to the payment.
1301
- * + `CANCELLED`: Subscription isn't active because it has been canceled.
1302
- * + `TRANSFERRED`: Subscription isn't active because it has been transferred to a different account. A different active subscription was created for the target account.
1303
- */
1304
- status?: SubscriptionStatus;
1305
- /**
1306
- * Date and time the subscription was last transferred from one Wix account to
1307
- * another in
1308
- * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
1309
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
1310
- */
1311
- transferredAt?: Date | null;
1312
- /**
1313
- * ID of the [product type](https://bo.wix.com/wix-docs/rest/premium/premium-product-catalog-v2/product-types/product-type-object)
1314
- * that the product, for which the subscription was purchased, belongs to.
1315
- */
1316
- productTypeId?: string;
1317
- /** Version number, which increments by 1 each time the subscription is updated. */
1318
- version?: number;
1319
- /**
1320
- * Whether the subscription is active. Includes the statuses
1321
- * `"AUTO_RENEW_ON"`, `"AUTO_RENEW_OFF"`, and `"MANUAL_RECURRING"`.
1322
- */
1323
- active?: boolean;
1324
- /**
1325
- * Date and time the subscription was originally created in
1326
- * [UTC datetime](https://en.wikipedia.org/wiki/Coordinated_Universal_Time)
1327
- * `YYYY-MM-DDThh:mm:ss.sssZ` format.
1328
- * Differs from `createdAt` in case the subscription was originally created for a different Wix account and has been transferred.
1329
- */
1330
- originalCreationDate?: Date | null;
1331
- /** Custom metadata about the subscription. */
1332
- metadata?: Record<string, string>;
1333
- /**
1334
- * 2-letter country code in
1335
- * [ISO-3166 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements)
1336
- * format.
1337
- */
1338
- countryCode?: string | null;
1339
- }
1340
- interface BillingReference {
1341
- /**
1342
- * Name of the billing system that manages the subscription.
1343
- *
1344
- * + `"UNKNOWN"`: Default value.
1345
- * + `"SBS"`: [Wix Billing](https://github.com/wix-p/premium-billing/tree/master/sbs).
1346
- * + `"LICENSER"`:
1347
- * + `"BASS"`: [Billing and Subscriptions System](https://dev.wix.com/docs/rest/internal-only/premium/subscriptions-by-billing-by-wix/introduction).
1348
- * + `"RESELLER"`: [External Reseller](https://dev.wix.com/api/rest/account-level-apis/resellers/introduction).
1349
- */
1350
- providerName?: ProviderName;
1351
- /** Current provider reference ID. */
1352
- providerReferenceId?: string | null;
1353
- /** Previous provider reference IDs. Used for when a subscription is extended, specifically for domains. */
1354
- previousProviderReferenceIds?: string[];
1355
- }
1356
- declare enum ProviderName {
1357
- UNKNOWN = "UNKNOWN",
1358
- SBS = "SBS",
1359
- LICENSER = "LICENSER",
1360
- BASS = "BASS",
1361
- RESELLER = "RESELLER",
1362
- RECURRING_INVOICES = "RECURRING_INVOICES"
1363
- }
1364
- interface Cycle extends CycleCycleSelectorOneOf {
1365
- /** repetitive interval */
1366
- interval?: Interval;
1367
- /** one time */
1368
- oneTime?: OneTime;
1369
- }
1370
- /** @oneof */
1371
- interface CycleCycleSelectorOneOf {
1372
- /** repetitive interval */
1373
- interval?: Interval;
1374
- /** one time */
1375
- oneTime?: OneTime;
1376
- }
1377
- interface Interval {
1378
- /** interval unit of measure */
1379
- unit?: IntervalUnit;
1380
- /** number of interval */
1381
- count?: number;
1382
- }
1383
- declare enum IntervalUnit {
1384
- /** unknown interval unit */
1385
- UNKNOWN = "UNKNOWN",
1386
- /** day */
1387
- DAY = "DAY",
1388
- /** week */
1389
- WEEK = "WEEK",
1390
- /** month */
1391
- MONTH = "MONTH",
1392
- /** year */
1393
- YEAR = "YEAR"
1394
- }
1395
- interface OneTime {
1396
- }
1397
- declare enum SubscriptionStatus {
1398
- UNKNOWN = "UNKNOWN",
1399
- AUTO_RENEW_ON = "AUTO_RENEW_ON",
1400
- AUTO_RENEW_OFF = "AUTO_RENEW_OFF",
1401
- MANUAL_RECURRING = "MANUAL_RECURRING",
1402
- CANCELLED = "CANCELLED",
1403
- TRANSFERRED = "TRANSFERRED"
1404
- }
1405
- /** Triggered when a subscription is reactivated. */
1406
- interface ReactivationData {
1407
- reactivationReason?: ReactivationReasonEnum;
1408
- /**
1409
- * In the event of reactivation after chargeback dispute, the subscription may be extended according to the
1410
- * number of days it was inactive during the time of resolving the dispute
1411
- */
1412
- newEndOfPeriod?: Date | null;
1413
- /** The original end date, before the inactive period. */
1414
- oldEndOfPeriod?: Date | null;
1415
- /** The difference in days between the new new_end_of_period and old_end_of_period */
1416
- differenceInDays?: number | null;
1417
- }
1418
- /** Reason for subscription reactivation */
1419
- declare enum ReactivationReasonEnum {
1420
- UNKNOWN = "UNKNOWN",
1421
- /**
1422
- * Subscription was reactivated due to billing status change from CANCELED to ACTIVE, for example if it was incorrectly
1423
- * canceled because of suspicion of fraud
1424
- */
1425
- BILLING_STATUS_CHANGE = "BILLING_STATUS_CHANGE",
1426
- /** Subscription was reactivated after a chargeback dispute */
1427
- REACTIVATED_AFTER_CHARGEBACK = "REACTIVATED_AFTER_CHARGEBACK"
1428
- }
1429
- /**
1430
- * Triggered when a subscription is assigned to a Wix site, including the initial
1431
- * assignment of a floating subscription or a re-assignement from a different site.
1432
- */
1433
- interface SubscriptionAssigned {
1434
- /** Assigned subscription. */
1435
- subscription?: Subscription;
1436
- /** ID of the metasite that the subscription has been assigned to before the update. */
1437
- previousMetaSiteId?: string | null;
1438
- }
1439
- /** Triggered when a subscription is canceled. */
1440
- interface SubscriptionCancelled {
1441
- /** Canceled subscription. */
1442
- subscription?: Subscription;
1443
- /** Details about the cancellation including who canceled the subscription and why. */
1444
- cancellationDetails?: CancellationDetails;
1445
- /**
1446
- * Whether the subscription is canceled immediately or expires at the end of the current billing cycle.
1447
- *
1448
- * Default: `false`
1449
- */
1450
- immediateCancel?: boolean;
1451
- /** Whether the subscription was canceled during the free trial period. */
1452
- canceledInFreeTrial?: boolean;
1453
- }
1454
- /** Information about the cancellation flow including who canceled the subscription and why it was canceled. */
1455
- interface CancellationDetails {
1456
- /**
1457
- * Cancellation code.
1458
- *
1459
- * Values supported for cancellations on behalf of the billing system: `-1`, `-2`, `-3`, `-4`, `-5`, `-6`, `-7`, `-8`.
1460
- * For cancellations on behalf of the site owner or the service provider `cancellationCode`
1461
- * is taken from the request of
1462
- * [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
1463
- *
1464
- * + `-1`: The subscription has been cancelled by the billing system but none of the listed cancellation reasons applies.
1465
- * + `-2`: There were payment problems.
1466
- * + `-3`: There was a chargeback.
1467
- * + `-4`: Customer support has canceled the subscription and issued a refund.
1468
- * + `-5`: The site owner has changed their existing subscription.
1469
- * + `-6`: The subscription has been transferred to a different Wix account.
1470
- * + `-7`: The subscription has been canceled because the site owner hasn't manually authenticated the recurring payment during the subscription's grace period. For example, site owners must manually confirm recurring payments within 40 days when paying with boleto.
1471
- * + `-8`: The Wix account that the subscription belonged to has been deleted.
1472
- */
1473
- cancellationCode?: number | null;
1474
- /**
1475
- * Cancellation reason. For cancellations on behalf of the site owner or the service provider `cancellationReason`
1476
- * is taken from the request of
1477
- * [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
1478
- * For cancellations on behalf of the billing system `cancellationReason` is `null` or an empty string.
1479
- */
1480
- cancellationReason?: string | null;
1481
- /**
1482
- * Initiator of the cancellation. For `"USER_REQUESTED"` and `"APP_MANAGED"`,
1483
- * `cancellationCode` and `cancellationReason` are taken from the request of
1484
- * [Cancel Immediately](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately)
1485
- * or [Cancel Immediately Offline](https://bo.wix.com/wix-docs/rest/premium/premium-subscriptions-manager/cancel-immediately-offline).
1486
- * For `"PASSIVE"`, cancellations `cancellationCode` is automatically calculated and `cancellationReason`
1487
- * is `null` or an empty string.
1488
- *
1489
- * + `"UNKNOWN`: Default value.
1490
- * + `"USER_REQUESTED"`: The Wix account owner has canceled the subscription.
1491
- * + `"APP_MANAGED"`: The service provider has canceled the subscription.
1492
- * + `"PASSIVE"`: The billing system has canceled the subscription. For example, in case of payment failure or fraud.
1493
- */
1494
- initiator?: Initiator;
1495
- }
1496
- declare enum Initiator {
1497
- UNKNOWN = "UNKNOWN",
1498
- USER_REQUESTED = "USER_REQUESTED",
1499
- APP_MANAGED = "APP_MANAGED",
1500
- PASSIVE = "PASSIVE"
1501
- }
1502
- /** Triggered when the subscription's auto renew is turned on. */
1503
- interface SubscriptionAutoRenewTurnedOn {
1504
- /** Subscription for which auto renew is turned on. */
1505
- subscription?: Subscription;
1506
- /**
1507
- * Supported values: `USER`, `APP`.
1508
- *
1509
- * Information about who turned auto renew on.
1510
- * + `"USER"`: The site owner who purchased the subscription has turned auto renew on.
1511
- * + `"APP"`: The service provider has turned auto renew on.
1512
- */
1513
- initiator?: string | null;
1514
- }
1515
- /** Triggered when the subscription's auto renew is turned off. */
1516
- interface SubscriptionAutoRenewTurnedOff {
1517
- /** Subscription for which auto renew is turned off. */
1518
- subscription?: Subscription;
1519
- /** Details about the cancellation including who canceled the subscription and why. */
1520
- cancellationDetails?: CancellationDetails;
1521
- /**
1522
- * Whether the subscription is immediately canceled or expires at the end of the current billing cycle.
1523
- *
1524
- * Default: `false`
1525
- */
1526
- immediateCancel?: boolean;
1527
- }
1528
- /**
1529
- * Triggered when a subscription is unassigned from a Wix site and becomes
1530
- * floating.
1531
- */
1532
- interface SubscriptionUnassigned {
1533
- /** Unassigned subscription. */
1534
- subscription?: Subscription;
1535
- /** ID of the metasite that the subscription has been assigned to before the event. */
1536
- previousMetaSiteId?: string;
1537
- /**
1538
- * Reason why the subscription is unassigned.
1539
- *
1540
- * + `"UNKNOWN"`: Default value.
1541
- * + `"USER_REQUESTED"`: The Wix account owner has unassigned the subscription.
1542
- * + `"REPLACED_BY_ANOTHER_SUBSCRIPTION"`: A different subscription that replaces this subscription is assigned to the site.
1543
- */
1544
- unassignReason?: UnassignReason;
1545
- }
1546
- declare enum UnassignReason {
1547
- UNKNOWN = "UNKNOWN",
1548
- USER_REQUESTED = "USER_REQUESTED",
1549
- REPLACED_BY_ANOTHER_SUBSCRIPTION = "REPLACED_BY_ANOTHER_SUBSCRIPTION"
1550
- }
1551
- /**
1552
- * Triggered when a subscription is transferred from one Wix account to another.
1553
- * A transfer includes cancelling the original subscription and creating a new
1554
- * subscription for the target account. The event returns both the original
1555
- * and the new subscription.
1556
- */
1557
- interface SubscriptionTransferred {
1558
- /** Original subscription that was canceled for the transfer. */
1559
- originSubscription?: Subscription;
1560
- /** Newly created subscription for the target account. */
1561
- targetSubscription?: Subscription;
1562
- }
1563
- /** Triggered when a recurring charge succeeds for a subscription. */
1564
- interface RecurringChargeSucceeded {
1565
- /** Subscription for which the recurring charge has succeeded. */
1566
- subscription?: Subscription;
1567
- /** Indication that there was a successful charge at the end of the free trial period */
1568
- freeTrialPeriodEnd?: boolean;
1569
- }
1570
- /**
1571
- * Triggered when a subscription was updated including when its product has been
1572
- * up- or downgraded or the billing cycle is changed.
1573
- */
1574
- interface ContractSwitched {
1575
- /** Updated subscription. */
1576
- subscription?: Subscription;
1577
- /** Billing cycle before the update. */
1578
- previousCycle?: Cycle;
1579
- /** ID of the product belonging to the subscription before the update. */
1580
- previousProductId?: string;
1581
- /** ID of the product type that the subscription's original product belonged to before the update. */
1582
- previousProductTypeId?: string;
1583
- /**
1584
- * Update type. __Note__: Doesn't include information about a product adjustment.
1585
- * For that purpose, see `productAdjustment`.
1586
- *
1587
- * + `"NOT_APPLICABLE"`: Default value.
1588
- * + `"ADDITIONAL_QUANTITY"`: An increased usage quota is added to the subscription. For example, a second mailbox is added to a subscription that previously included a single mailbox.
1589
- * + `"CREDIT_UNUSED_PERIOD"`: The subscription is upgraded and the new price is less than the regular price. The new price applies to every billing cycle, not just the first cycle.
1590
- * + `"REFUND_PRICE_DIFF"`: Not implemented.
1591
- * + `"ADJUST_PERIOD_END"`: Not implemented.
1592
- * + `"DOWNGRADE_GRACE_PERIOD"`: For downgrades during the grace period. In this situation, the site owner hasn’t paid yet and must immediately pay for the downgraded subscription.
1593
- * + `"FULL_AMOUNT_PERIOD"`: For upgrades in which the site owner retains unused benefits. For example, site owners upgrading a Facebook Ads subscription retain their unused FB Ads credit. The unused credit is added to the new credit.
1594
- * + `"END_OF_PERIOD"`: The subscription's billing current cycle is extended because of a downgrade.
1595
- * + `"PENDING_CHANGES"`: The subscription's billing is updated, but the change doesn't apply immediately. Instead, the update becomes effective at the end of current billing cycle.
1596
- * + `"DOWNGRADE_RENEWAL"`: The subscription is downgraded because of a declined payment. This prevents subscriptions from churning.
1597
- */
1598
- contractSwitchType?: ContractSwitchType;
1599
- /**
1600
- * ID of the metasite the subscription has been assigned to previously.
1601
- * Available only in case the subscription is assigned to a different site.
1602
- */
1603
- previousMetaSiteId?: string | null;
1604
- /**
1605
- * Update reason.
1606
- *
1607
- * + `"PRICE_INCREASE"`: The subscription's price has been increased.
1608
- * + `"EXTERNAL_PROVIDER_TRIGGER"`: Any reason other than a price increase.
1609
- */
1610
- contractSwitchReason?: ContractSwitchReason;
1611
- /** Information about the price update. Available only for updates with a price increase. */
1612
- productPriceIncreaseData?: ProductPriceIncreaseData;
1613
- /**
1614
- * Information about a product adjustment. For example, a downgrade.
1615
- * __Note__: This isn't the same as `contractSwitchType`.
1616
- *
1617
- * + `NOT_APPLICABLE`: There is no information about whether the product has been up- or downgraded.
1618
- * + `DOWNGRADE`: The product has been downgraded.
1619
- */
1620
- productAdjustment?: ProductAdjustment;
1621
- }
1622
- /** Copied from SBS */
1623
- declare enum ContractSwitchType {
1624
- NOT_APPLICABLE = "NOT_APPLICABLE",
1625
- ADDITIONAL_QUANTITY = "ADDITIONAL_QUANTITY",
1626
- CREDIT_UNUSED_PERIOD = "CREDIT_UNUSED_PERIOD",
1627
- REFUND_PRICE_DIFF = "REFUND_PRICE_DIFF",
1628
- ADJUST_PERIOD_END = "ADJUST_PERIOD_END",
1629
- DOWNGRADE_GRACE_PERIOD = "DOWNGRADE_GRACE_PERIOD",
1630
- FULL_AMOUNT_PERIOD = "FULL_AMOUNT_PERIOD",
1631
- END_OF_PERIOD = "END_OF_PERIOD",
1632
- PENDING_CHANGES = "PENDING_CHANGES",
1633
- DOWNGRADE_RENEWAL = "DOWNGRADE_RENEWAL"
1634
- }
1635
- declare enum ContractSwitchReason {
1636
- EXTERNAL_PROVIDER_TRIGGER = "EXTERNAL_PROVIDER_TRIGGER",
1637
- PRICE_INCREASE = "PRICE_INCREASE"
1638
- }
1639
- /** Triggered when a subscription's price is increased. */
1640
- interface ProductPriceIncreaseData {
1641
- /** Price of the subscription before the update. */
1642
- previousPrice?: string | null;
1643
- /** A value that is used in order to select the correct email template to send the user regarding the price increase. */
1644
- emailTemplateSelector?: string | null;
1645
- /** Used to differentiate between migration segments. Does not have to be unique per segment. */
1646
- segmentName?: string | null;
1647
- /** Used to determine how the price increase was triggered. */
1648
- priceIncreaseTrigger?: PriceIncreaseTrigger;
1649
- }
1650
- /** Reason for Price Increase Trigger */
1651
- declare enum PriceIncreaseTrigger {
1652
- NEAR_RENEWAL = "NEAR_RENEWAL",
1653
- RECURRING_SUCCESS = "RECURRING_SUCCESS",
1654
- MANUAL = "MANUAL"
1655
- }
1656
- /** Triggered when a subscription's product is adusted. */
1657
- declare enum ProductAdjustment {
1658
- /** flag to show that the ContractSwitchedEvent is not applicable / needed */
1659
- NOT_APPLICABLE = "NOT_APPLICABLE",
1660
- /** flag to show that the ContractSwitchedEvent is a Downgrade */
1661
- DOWNGRADE = "DOWNGRADE"
1662
- }
1663
- /**
1664
- * Triggered when a subscription gets close to the end of its billing cycle.
1665
- * The exact number of days is defined in the billing system.
1666
- */
1667
- interface SubscriptionNearEndOfPeriod {
1668
- /** Subscription that got close to the end of its billing cycle. */
1669
- subscription?: Subscription;
1670
- /** Whether the subscription is within the free trial period. */
1671
- inFreeTrial?: boolean;
1672
- }
1673
- /**
1674
- * Triggered when a subscription is updated and the change doesn't happen
1675
- * immediately but at the end of the current billing cycle.
1676
- */
1677
- interface SubscriptionPendingChange {
1678
- /** Subscription for which a pending update is triggered. */
1679
- subscription?: Subscription;
1680
- }
1681
- interface MessageEnvelope$4 {
1682
- /** App instance ID. */
1683
- instanceId?: string | null;
1684
- /** Event type. */
1685
- eventType?: string;
1686
- /** The identification type and identity data. */
1687
- identity?: IdentificationData$4;
1688
- /** Stringify payload. */
1689
- data?: string;
1690
- }
1691
- interface IdentificationData$4 extends IdentificationDataIdOneOf$4 {
1692
- /** ID of a site visitor that has not logged in to the site. */
1693
- anonymousVisitorId?: string;
1694
- /** ID of a site visitor that has logged in to the site. */
1695
- memberId?: string;
1696
- /** ID of a Wix user (site owner, contributor, etc.). */
1697
- wixUserId?: string;
1698
- /** ID of an app. */
1699
- appId?: string;
1700
- /** @readonly */
1701
- identityType?: WebhookIdentityType$4;
1702
- }
1703
- /** @oneof */
1704
- interface IdentificationDataIdOneOf$4 {
1705
- /** ID of a site visitor that has not logged in to the site. */
1706
- anonymousVisitorId?: string;
1707
- /** ID of a site visitor that has logged in to the site. */
1708
- memberId?: string;
1709
- /** ID of a Wix user (site owner, contributor, etc.). */
1710
- wixUserId?: string;
1711
- /** ID of an app. */
1712
- appId?: string;
1713
- }
1714
- declare enum WebhookIdentityType$4 {
1715
- UNKNOWN = "UNKNOWN",
1716
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
1717
- MEMBER = "MEMBER",
1718
- WIX_USER = "WIX_USER",
1719
- APP = "APP"
1720
- }
1721
- interface FixedAmountDiscountNonNullableFields$2 {
1722
- amount: number;
1723
- }
1724
- interface PercentageDiscountNonNullableFields$2 {
1725
- percentage: number;
1726
- }
1727
- interface GroupNonNullableFields$2 {
1728
- name: string;
1729
- }
1730
- interface CouponScopeNonNullableFields$2 {
1731
- namespace: string;
1732
- group?: GroupNonNullableFields$2;
1733
- }
1734
- interface CouponNonNullableFields$2 {
1735
- fixedAmountOptions?: FixedAmountDiscountNonNullableFields$2;
1736
- percentageOptions?: PercentageDiscountNonNullableFields$2;
1737
- minimumSubtotal: number;
1738
- scope?: CouponScopeNonNullableFields$2;
1739
- name: string;
1740
- discountType: DiscountType$2;
1741
- }
1742
- interface LoyaltyPointsNonNullableFields$1 {
1743
- amount: number;
1744
- }
1745
- interface RewardNonNullableFields {
1746
- couponOptions?: CouponNonNullableFields$2;
1747
- loyaltyPointsOptions?: LoyaltyPointsNonNullableFields$1;
1748
- type: Type$1;
1749
- }
1750
- interface EmailsNonNullableFields {
1751
- encourageToReferFriends: App[];
1752
- notifyCustomersAboutReward: boolean;
1753
- }
1754
- interface PremiumFeaturesNonNullableFields {
1755
- referralProgram: boolean;
1756
- }
1757
- interface ReferralProgramNonNullableFields {
1758
- status: ProgramStatus;
1759
- referredFriendReward?: RewardNonNullableFields;
1760
- referringCustomerReward?: RewardNonNullableFields;
1761
- successfulReferralActions: Action[];
1762
- emails?: EmailsNonNullableFields;
1763
- premiumFeatures?: PremiumFeaturesNonNullableFields;
1764
- }
1765
- interface GetReferralProgramResponseNonNullableFields {
1766
- referralProgram?: ReferralProgramNonNullableFields;
1767
- }
1768
- interface UpdateReferralProgramResponseNonNullableFields {
1769
- referralProgram?: ReferralProgramNonNullableFields;
1770
- }
1771
- interface ActivateReferralProgramResponseNonNullableFields {
1772
- referralProgram?: ReferralProgramNonNullableFields;
1773
- }
1774
- interface PauseReferralProgramResponseNonNullableFields {
1775
- referralProgram?: ReferralProgramNonNullableFields;
1776
- }
1777
- interface AISocialMediaPostSuggestionNonNullableFields {
1778
- postContent: string;
1779
- hashtags: string[];
1780
- }
1781
- interface GetAISocialMediaPostsSuggestionsResponseNonNullableFields {
1782
- suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1783
- }
1784
- interface GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields {
1785
- suggestions: AISocialMediaPostSuggestionNonNullableFields[];
1786
- }
1787
- interface GetReferralProgramPremiumFeaturesResponseNonNullableFields {
1788
- referralProgram: boolean;
1789
- }
1790
- interface BaseEventMetadata$3 {
1791
- /** App instance ID. */
1792
- instanceId?: string | null;
1793
- /** Event type. */
1794
- eventType?: string;
1795
- /** The identification type and identity data. */
1796
- identity?: IdentificationData$4;
1797
- }
1798
- interface EventMetadata$3 extends BaseEventMetadata$3 {
1799
- /**
1800
- * Unique event ID.
1801
- * Allows clients to ignore duplicate webhooks.
1802
- */
1803
- _id?: string;
1804
- /**
1805
- * Assumes actions are also always typed to an entity_type
1806
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
1807
- */
1808
- entityFqdn?: string;
1809
- /**
1810
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
1811
- * This is although the created/updated/deleted notion is duplication of the oneof types
1812
- * Example: created/updated/deleted/started/completed/email_opened
1813
- */
1814
- slug?: string;
1815
- /** ID of the entity associated with the event. */
1816
- entityId?: string;
1817
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
1818
- eventTime?: Date | null;
1819
- /**
1820
- * Whether the event was triggered as a result of a privacy regulation application
1821
- * (for example, GDPR).
1822
- */
1823
- triggeredByAnonymizeRequest?: boolean | null;
1824
- /** If present, indicates the action that triggered the event. */
1825
- originatedFrom?: string | null;
1826
- /**
1827
- * A sequence number defining the order of updates to the underlying entity.
1828
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
1829
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
1830
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
1831
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
1832
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
1833
- */
1834
- entityEventSequence?: string | null;
1835
- }
1836
- interface ProgramUpdatedEnvelope {
1837
- entity: ReferralProgram;
1838
- metadata: EventMetadata$3;
1839
- }
1840
- interface GetAiSocialMediaPostsSuggestionsOptions {
1841
- /** Topic to generate social media post suggestions for. For example, fitness, education, technology. */
1842
- topic?: string;
1843
- }
1844
- interface GenerateAiSocialMediaPostsSuggestionsOptions {
1845
- /** Topic to generate social media post suggestions for. For example, fitness, education, technology. */
1846
- topic?: string;
1847
- }
1848
-
1849
- declare function getReferralProgram$1(httpClient: HttpClient): GetReferralProgramSignature;
1850
- interface GetReferralProgramSignature {
1851
- /**
1852
- * Retrieves the referral program.
1853
- */
1854
- (): Promise<GetReferralProgramResponse & GetReferralProgramResponseNonNullableFields>;
1855
- }
1856
- declare function updateReferralProgram$1(httpClient: HttpClient): UpdateReferralProgramSignature;
1857
- interface UpdateReferralProgramSignature {
1858
- /**
1859
- * Updates a referral program. Supports partial updates.
1860
- *
1861
- * Revision number, which increments by 1 each time the referral program is updated.
1862
- * To prevent conflicting changes, the current revision must be passed when updating the referral program.
1863
- * @param - Referral program to update. Include the latest `revision` for a successful update.
1864
- */
1865
- (referralProgram: ReferralProgram): Promise<UpdateReferralProgramResponse & UpdateReferralProgramResponseNonNullableFields>;
1866
- }
1867
- declare function activateReferralProgram$1(httpClient: HttpClient): ActivateReferralProgramSignature;
1868
- interface ActivateReferralProgramSignature {
1869
- /**
1870
- * Activates the referral program, changing its status to `ACTIVE`.
1871
- */
1872
- (): Promise<ActivateReferralProgramResponse & ActivateReferralProgramResponseNonNullableFields>;
1873
- }
1874
- declare function pauseReferralProgram$1(httpClient: HttpClient): PauseReferralProgramSignature;
1875
- interface PauseReferralProgramSignature {
1876
- /**
1877
- * Pauses the referral program, changing its status to `PAUSED`.
1878
- */
1879
- (): Promise<PauseReferralProgramResponse & PauseReferralProgramResponseNonNullableFields>;
1880
- }
1881
- declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GetAiSocialMediaPostsSuggestionsSignature;
1882
- interface GetAiSocialMediaPostsSuggestionsSignature {
1883
- /**
1884
- * Retrieves pre-generated AI social media post suggestions for promoting the referral program.
1885
- *
1886
- * This method returns a list of AI-generated social media post suggestions that site owners or members can use to promote the referral program. You can display these suggestions in your app's UI, allowing users to easily copy and share them on their preferred social media platforms.
1887
- *
1888
- * >**Note**: This method retrieves existing suggestions. To generate new ones,
1889
- * use the [Generate AI Social Media Posts Suggestions](https://dev.wix.com/docs/velo/api-reference/wix-marketing-v2/referral-program/programs/generate-ai-social-media-posts-suggestions) method.
1890
- */
1891
- (options?: GetAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GetAISocialMediaPostsSuggestionsResponse & GetAISocialMediaPostsSuggestionsResponseNonNullableFields>;
1892
- }
1893
- declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient): GenerateAiSocialMediaPostsSuggestionsSignature;
1894
- interface GenerateAiSocialMediaPostsSuggestionsSignature {
1895
- /**
1896
- * Creates new AI-generated social media post suggestions for promoting the referral program.
1897
- *
1898
- * This method generates new AI-powered social media post suggestions for promoting the referral program. Use it to refresh content or create alternatives to existing suggestions.
1899
- *
1900
- * >**Note**: This method generates new suggestions each time it's called. To retrieve existing suggestions without generating new ones, use the [Get AI Social Media Posts Suggestions](https://dev.wix.com/docs/velo/api-reference/wix-marketing-v2/referral-program/programs/get-ai-social-media-posts-suggestions) method.
1901
- */
1902
- (options?: GenerateAiSocialMediaPostsSuggestionsOptions | undefined): Promise<GenerateAISocialMediaPostsSuggestionsResponse & GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields>;
1903
- }
1904
- declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient): GetReferralProgramPremiumFeaturesSignature;
1905
- interface GetReferralProgramPremiumFeaturesSignature {
1906
- /**
1907
- * Retrieves information about the enabled premium features for the referral program.
1908
- */
1909
- (): Promise<GetReferralProgramPremiumFeaturesResponse & GetReferralProgramPremiumFeaturesResponseNonNullableFields>;
1910
- }
1911
- declare const onProgramUpdated$1: EventDefinition<ProgramUpdatedEnvelope, "wix.loyalty.referral.v1.program_updated">;
1912
-
1913
- declare function createEventModule$3<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
1914
-
1915
- declare const getReferralProgram: MaybeContext<BuildRESTFunction<typeof getReferralProgram$1> & typeof getReferralProgram$1>;
1916
- declare const updateReferralProgram: MaybeContext<BuildRESTFunction<typeof updateReferralProgram$1> & typeof updateReferralProgram$1>;
1917
- declare const activateReferralProgram: MaybeContext<BuildRESTFunction<typeof activateReferralProgram$1> & typeof activateReferralProgram$1>;
1918
- declare const pauseReferralProgram: MaybeContext<BuildRESTFunction<typeof pauseReferralProgram$1> & typeof pauseReferralProgram$1>;
1919
- declare const getAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof getAiSocialMediaPostsSuggestions$1> & typeof getAiSocialMediaPostsSuggestions$1>;
1920
- declare const generateAiSocialMediaPostsSuggestions: MaybeContext<BuildRESTFunction<typeof generateAiSocialMediaPostsSuggestions$1> & typeof generateAiSocialMediaPostsSuggestions$1>;
1921
- declare const getReferralProgramPremiumFeatures: MaybeContext<BuildRESTFunction<typeof getReferralProgramPremiumFeatures$1> & typeof getReferralProgramPremiumFeatures$1>;
1922
-
1923
- type _publicOnProgramUpdatedType = typeof onProgramUpdated$1;
1924
- /**
1925
- * Triggered when a referral program is updated.
1926
- */
1927
- declare const onProgramUpdated: ReturnType<typeof createEventModule$3<_publicOnProgramUpdatedType>>;
1928
-
1929
- type context$4_AISocialMediaPostSuggestion = AISocialMediaPostSuggestion;
1930
- type context$4_Action = Action;
1931
- declare const context$4_Action: typeof Action;
1932
- type context$4_ActivateReferralProgramRequest = ActivateReferralProgramRequest;
1933
- type context$4_ActivateReferralProgramResponse = ActivateReferralProgramResponse;
1934
- type context$4_ActivateReferralProgramResponseNonNullableFields = ActivateReferralProgramResponseNonNullableFields;
1935
- type context$4_App = App;
1936
- declare const context$4_App: typeof App;
1937
- type context$4_Asset = Asset;
1938
- type context$4_BillingReference = BillingReference;
1939
- type context$4_BulkGetReferralProgramRequest = BulkGetReferralProgramRequest;
1940
- type context$4_BulkGetReferralProgramResponse = BulkGetReferralProgramResponse;
1941
- type context$4_CancellationDetails = CancellationDetails;
1942
- type context$4_ContractSwitchReason = ContractSwitchReason;
1943
- declare const context$4_ContractSwitchReason: typeof ContractSwitchReason;
1944
- type context$4_ContractSwitchType = ContractSwitchType;
1945
- declare const context$4_ContractSwitchType: typeof ContractSwitchType;
1946
- type context$4_ContractSwitched = ContractSwitched;
1947
- type context$4_Cycle = Cycle;
1948
- type context$4_CycleCycleSelectorOneOf = CycleCycleSelectorOneOf;
1949
- type context$4_DeleteContext = DeleteContext;
1950
- type context$4_DeleteStatus = DeleteStatus;
1951
- declare const context$4_DeleteStatus: typeof DeleteStatus;
1952
- type context$4_Emails = Emails;
1953
- type context$4_GenerateAISocialMediaPostsSuggestionsRequest = GenerateAISocialMediaPostsSuggestionsRequest;
1954
- type context$4_GenerateAISocialMediaPostsSuggestionsResponse = GenerateAISocialMediaPostsSuggestionsResponse;
1955
- type context$4_GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields = GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields;
1956
- type context$4_GenerateAiSocialMediaPostsSuggestionsOptions = GenerateAiSocialMediaPostsSuggestionsOptions;
1957
- type context$4_GetAISocialMediaPostsSuggestionsRequest = GetAISocialMediaPostsSuggestionsRequest;
1958
- type context$4_GetAISocialMediaPostsSuggestionsResponse = GetAISocialMediaPostsSuggestionsResponse;
1959
- type context$4_GetAISocialMediaPostsSuggestionsResponseNonNullableFields = GetAISocialMediaPostsSuggestionsResponseNonNullableFields;
1960
- type context$4_GetAiSocialMediaPostsSuggestionsOptions = GetAiSocialMediaPostsSuggestionsOptions;
1961
- type context$4_GetReferralProgramPremiumFeaturesRequest = GetReferralProgramPremiumFeaturesRequest;
1962
- type context$4_GetReferralProgramPremiumFeaturesResponse = GetReferralProgramPremiumFeaturesResponse;
1963
- type context$4_GetReferralProgramPremiumFeaturesResponseNonNullableFields = GetReferralProgramPremiumFeaturesResponseNonNullableFields;
1964
- type context$4_GetReferralProgramRequest = GetReferralProgramRequest;
1965
- type context$4_GetReferralProgramResponse = GetReferralProgramResponse;
1966
- type context$4_GetReferralProgramResponseNonNullableFields = GetReferralProgramResponseNonNullableFields;
1967
- type context$4_HtmlSitePublished = HtmlSitePublished;
1968
- type context$4_Initiator = Initiator;
1969
- declare const context$4_Initiator: typeof Initiator;
1970
- type context$4_Interval = Interval;
1971
- type context$4_IntervalUnit = IntervalUnit;
1972
- declare const context$4_IntervalUnit: typeof IntervalUnit;
1973
- type context$4_MetaSiteSpecialEvent = MetaSiteSpecialEvent;
1974
- type context$4_MetaSiteSpecialEventPayloadOneOf = MetaSiteSpecialEventPayloadOneOf;
1975
- type context$4_Namespace = Namespace;
1976
- declare const context$4_Namespace: typeof Namespace;
1977
- type context$4_NamespaceChanged = NamespaceChanged;
1978
- type context$4_OneTime = OneTime;
1979
- type context$4_Page = Page;
1980
- type context$4_PauseReferralProgramRequest = PauseReferralProgramRequest;
1981
- type context$4_PauseReferralProgramResponse = PauseReferralProgramResponse;
1982
- type context$4_PauseReferralProgramResponseNonNullableFields = PauseReferralProgramResponseNonNullableFields;
1983
- type context$4_PremiumFeatures = PremiumFeatures;
1984
- type context$4_PriceIncreaseTrigger = PriceIncreaseTrigger;
1985
- declare const context$4_PriceIncreaseTrigger: typeof PriceIncreaseTrigger;
1986
- type context$4_ProductAdjustment = ProductAdjustment;
1987
- declare const context$4_ProductAdjustment: typeof ProductAdjustment;
1988
- type context$4_ProductPriceIncreaseData = ProductPriceIncreaseData;
1989
- type context$4_ProgramInSite = ProgramInSite;
1990
- type context$4_ProgramStatus = ProgramStatus;
1991
- declare const context$4_ProgramStatus: typeof ProgramStatus;
1992
- type context$4_ProgramUpdatedEnvelope = ProgramUpdatedEnvelope;
1993
- type context$4_ProviderName = ProviderName;
1994
- declare const context$4_ProviderName: typeof ProviderName;
1995
- type context$4_ReactivationData = ReactivationData;
1996
- type context$4_ReactivationReasonEnum = ReactivationReasonEnum;
1997
- declare const context$4_ReactivationReasonEnum: typeof ReactivationReasonEnum;
1998
- type context$4_RecurringChargeSucceeded = RecurringChargeSucceeded;
1999
- type context$4_ReferralProgram = ReferralProgram;
2000
- type context$4_ServiceProvisioned = ServiceProvisioned;
2001
- type context$4_ServiceRemoved = ServiceRemoved;
2002
- type context$4_SiteCreated = SiteCreated;
2003
- type context$4_SiteCreatedContext = SiteCreatedContext;
2004
- declare const context$4_SiteCreatedContext: typeof SiteCreatedContext;
2005
- type context$4_SiteDeleted = SiteDeleted;
2006
- type context$4_SiteHardDeleted = SiteHardDeleted;
2007
- type context$4_SiteMarkedAsTemplate = SiteMarkedAsTemplate;
2008
- type context$4_SiteMarkedAsWixSite = SiteMarkedAsWixSite;
2009
- type context$4_SitePublished = SitePublished;
2010
- type context$4_SiteRenamed = SiteRenamed;
2011
- type context$4_SiteTransferred = SiteTransferred;
2012
- type context$4_SiteUndeleted = SiteUndeleted;
2013
- type context$4_SiteUnpublished = SiteUnpublished;
2014
- type context$4_State = State;
2015
- declare const context$4_State: typeof State;
2016
- type context$4_StudioAssigned = StudioAssigned;
2017
- type context$4_StudioUnassigned = StudioUnassigned;
2018
- type context$4_Subscription = Subscription;
2019
- type context$4_SubscriptionAssigned = SubscriptionAssigned;
2020
- type context$4_SubscriptionAutoRenewTurnedOff = SubscriptionAutoRenewTurnedOff;
2021
- type context$4_SubscriptionAutoRenewTurnedOn = SubscriptionAutoRenewTurnedOn;
2022
- type context$4_SubscriptionCancelled = SubscriptionCancelled;
2023
- type context$4_SubscriptionCreated = SubscriptionCreated;
2024
- type context$4_SubscriptionEvent = SubscriptionEvent;
2025
- type context$4_SubscriptionEventEventOneOf = SubscriptionEventEventOneOf;
2026
- type context$4_SubscriptionNearEndOfPeriod = SubscriptionNearEndOfPeriod;
2027
- type context$4_SubscriptionPendingChange = SubscriptionPendingChange;
2028
- type context$4_SubscriptionStatus = SubscriptionStatus;
2029
- declare const context$4_SubscriptionStatus: typeof SubscriptionStatus;
2030
- type context$4_SubscriptionTransferred = SubscriptionTransferred;
2031
- type context$4_SubscriptionUnassigned = SubscriptionUnassigned;
2032
- type context$4_UnassignReason = UnassignReason;
2033
- declare const context$4_UnassignReason: typeof UnassignReason;
2034
- type context$4_UpdateReferralProgramRequest = UpdateReferralProgramRequest;
2035
- type context$4_UpdateReferralProgramResponse = UpdateReferralProgramResponse;
2036
- type context$4_UpdateReferralProgramResponseNonNullableFields = UpdateReferralProgramResponseNonNullableFields;
2037
- type context$4__publicOnProgramUpdatedType = _publicOnProgramUpdatedType;
2038
- declare const context$4_activateReferralProgram: typeof activateReferralProgram;
2039
- declare const context$4_generateAiSocialMediaPostsSuggestions: typeof generateAiSocialMediaPostsSuggestions;
2040
- declare const context$4_getAiSocialMediaPostsSuggestions: typeof getAiSocialMediaPostsSuggestions;
2041
- declare const context$4_getReferralProgram: typeof getReferralProgram;
2042
- declare const context$4_getReferralProgramPremiumFeatures: typeof getReferralProgramPremiumFeatures;
2043
- declare const context$4_onProgramUpdated: typeof onProgramUpdated;
2044
- declare const context$4_pauseReferralProgram: typeof pauseReferralProgram;
2045
- declare const context$4_updateReferralProgram: typeof updateReferralProgram;
2046
- declare namespace context$4 {
2047
- 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 };
2048
- }
2049
-
2050
- interface ReferralEvent extends ReferralEventEventTypeOneOf {
2051
- /** Event triggered when a referred friend signs up. */
2052
- referredFriendSignupEvent?: ReferredFriendSignupEvent;
2053
- /** Event triggered when a referral is successful. For example, customer places and pays for an order. */
2054
- successfulReferralEvent?: V1SuccessfulReferralEvent;
2055
- /** Event triggered when an action is performed. For example, placing an order. */
2056
- actionEvent?: V1ActionEvent;
2057
- /** Event triggered when a reward is given. */
2058
- rewardEvent?: RewardEvent;
2059
- /**
2060
- * Referral event ID.
2061
- * @readonly
2062
- */
2063
- _id?: string | null;
2064
- /**
2065
- * Revision number, which increments by 1 each time the referral event is updated.
2066
- * To prevent conflicting changes, the current revision must be passed when updating the referral event.
2067
- */
2068
- revision?: string | null;
2069
- /**
2070
- * Date and time the referral event was created.
2071
- * @readonly
2072
- */
2073
- _createdDate?: Date | null;
2074
- /**
2075
- * Date and time the referral event was last updated.
2076
- * @readonly
2077
- */
2078
- _updatedDate?: Date | null;
2079
- }
2080
- /** @oneof */
2081
- interface ReferralEventEventTypeOneOf {
2082
- /** Event triggered when a referred friend signs up. */
2083
- referredFriendSignupEvent?: ReferredFriendSignupEvent;
2084
- /** Event triggered when a referral is successful. For example, customer places and pays for an order. */
2085
- successfulReferralEvent?: V1SuccessfulReferralEvent;
2086
- /** Event triggered when an action is performed. For example, placing an order. */
2087
- actionEvent?: V1ActionEvent;
2088
- /** Event triggered when a reward is given. */
2089
- rewardEvent?: RewardEvent;
2090
- }
2091
- interface ReferredFriendSignupEvent {
2092
- /** ID of the referred friend */
2093
- referredFriendId?: string;
2094
- }
2095
- interface V1SuccessfulReferralEvent {
2096
- /** ID of the referred friend */
2097
- referredFriendId?: string;
2098
- /** ID of the referring customer */
2099
- referringCustomerId?: string;
2100
- }
2101
- interface V1ActionEvent {
2102
- /** ID of the referred friend */
2103
- referredFriendId?: string;
2104
- /** ID of the referring customer */
2105
- referringCustomerId?: string;
2106
- /** Trigger for the action */
2107
- trigger?: V1Trigger;
2108
- /** Amount associated with the action. */
2109
- amount?: string | null;
2110
- /** Currency of the amount. */
2111
- currency?: string | null;
2112
- /** ID of the associated order. */
2113
- orderId?: string | null;
2114
- }
2115
- interface V1Trigger {
2116
- /** ID of the app that triggered the event */
2117
- appId?: string;
2118
- /** Type of activity that triggered the event */
2119
- activityType?: string;
2120
- }
2121
- interface RewardEvent extends RewardEventReceiverOneOf {
2122
- /**
2123
- * ID of the rewarded referring customer.
2124
- * @readonly
2125
- */
2126
- rewardedReferringCustomerId?: string;
2127
- /**
2128
- * ID of the rewarded referred friend.
2129
- * @readonly
2130
- */
2131
- rewardedReferredFriendId?: string;
2132
- /** ID of the referral reward. */
2133
- referralRewardId?: string;
2134
- /** Type of reward. */
2135
- rewardType?: Reward$1;
2136
- }
2137
- /** @oneof */
2138
- interface RewardEventReceiverOneOf {
2139
- /**
2140
- * ID of the rewarded referring customer.
2141
- * @readonly
2142
- */
2143
- rewardedReferringCustomerId?: string;
2144
- /**
2145
- * ID of the rewarded referred friend.
2146
- * @readonly
2147
- */
2148
- rewardedReferredFriendId?: string;
2149
- }
2150
- declare enum Reward$1 {
2151
- /** Unknown reward. This field is not used. */
2152
- UNKNOWN = "UNKNOWN",
2153
- /** Reward is a coupon */
2154
- COUPON = "COUPON",
2155
- /** Reward is loyalty points. */
2156
- LOYALTY_POINTS = "LOYALTY_POINTS",
2157
- /** No reward. */
2158
- NOTHING = "NOTHING"
2159
- }
2160
- interface CreateReferralEventRequest {
2161
- /** Referral event to create */
2162
- referralEvent?: ReferralEvent;
2163
- }
2164
- interface CreateReferralEventResponse {
2165
- /** Created referral event */
2166
- referralEvent?: ReferralEvent;
2167
- }
2168
- interface GetReferralEventRequest {
2169
- /** ID of the referral event to retrieve. */
2170
- referralEventId: string;
2171
- }
2172
- interface GetReferralEventResponse {
2173
- /** Retrieved referral event. */
2174
- referralEvent?: ReferralEvent;
2175
- }
2176
- interface QueryReferralEventRequest {
2177
- /** Query to filter referral events */
2178
- query: CursorQuery$3;
2179
- }
2180
- interface CursorQuery$3 extends CursorQueryPagingMethodOneOf$3 {
2181
- /**
2182
- * Cursor paging options.
2183
- *
2184
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
2185
- */
2186
- cursorPaging?: CursorPaging$3;
2187
- /**
2188
- * Filter object.
2189
- *
2190
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
2191
- */
2192
- filter?: Record<string, any> | null;
2193
- /**
2194
- * Sort object.
2195
- *
2196
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
2197
- */
2198
- sort?: Sorting$3[];
2199
- }
2200
- /** @oneof */
2201
- interface CursorQueryPagingMethodOneOf$3 {
2202
- /**
2203
- * Cursor paging options.
2204
- *
2205
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
2206
- */
2207
- cursorPaging?: CursorPaging$3;
2208
- }
2209
- interface Sorting$3 {
2210
- /** Name of the field to sort by. */
2211
- fieldName?: string;
2212
- /** Sort order. */
2213
- order?: SortOrder$3;
2214
- }
2215
- declare enum SortOrder$3 {
2216
- ASC = "ASC",
2217
- DESC = "DESC"
2218
- }
2219
- interface CursorPaging$3 {
2220
- /** Maximum number of items to return in the results. */
2221
- limit?: number | null;
2222
- /**
2223
- * Pointer to the next or previous page in the list of results.
2224
- *
2225
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
2226
- * Not relevant for the first request.
2227
- */
2228
- cursor?: string | null;
2229
- }
2230
- interface QueryReferralEventResponse {
2231
- /** List of referral events. */
2232
- referralEvents?: ReferralEvent[];
2233
- /** Metadata for the paginated results. */
2234
- metadata?: CursorPagingMetadata$3;
2235
- }
2236
- interface CursorPagingMetadata$3 {
2237
- /** Number of items returned in current page. */
2238
- count?: number | null;
2239
- /** Cursor strings that point to the next page, previous page, or both. */
2240
- cursors?: Cursors$3;
2241
- /**
2242
- * Whether there are more pages to retrieve following the current page.
2243
- *
2244
- * + `true`: Another page of results can be retrieved.
2245
- * + `false`: This is the last page.
2246
- */
2247
- hasNext?: boolean | null;
2248
- }
2249
- interface Cursors$3 {
2250
- /** Cursor string pointing to the next page in the list of results. */
2251
- next?: string | null;
2252
- /** Cursor pointing to the previous page in the list of results. */
2253
- prev?: string | null;
2254
- }
2255
- interface GetReferralStatisticsRequest {
2256
- }
2257
- interface GetReferralStatisticsResponse {
2258
- /** Total number of sign-ups completed by referred friends. */
2259
- totalSignUpsCompleted?: number;
2260
- /** Total number of actions completed by referred friends. */
2261
- totalActionsCompleted?: number;
2262
- /** Total amount of purchases made by referred friends. */
2263
- totalAmountGenerated?: string;
2264
- }
2265
- interface QueryReferringCustomerTotalsRequest {
2266
- /** Query to filter referring customer totals. */
2267
- query?: CursorQuery$3;
2268
- /** List of contact IDs to filter referring customer totals. */
2269
- contactIds?: string[];
2270
- }
2271
- interface QueryReferringCustomerTotalsResponse {
2272
- referringCustomerTotals?: ReferringCustomerTotal[];
2273
- /** Paging metadata */
2274
- metadata?: CursorPagingMetadata$3;
2275
- }
2276
- interface ReferringCustomerTotal {
2277
- /**
2278
- * ID of the referring customer.
2279
- * @readonly
2280
- */
2281
- referringCustomerId?: string;
2282
- /**
2283
- * Contact ID.
2284
- * @readonly
2285
- */
2286
- contactId?: string;
2287
- /**
2288
- * Date and time of the last successful referral.
2289
- * @readonly
2290
- */
2291
- lastSuccessfulReferral?: Date | null;
2292
- /**
2293
- * Total number of successful referrals made by this customer.
2294
- * @readonly
2295
- */
2296
- totalSuccessfulReferrals?: number;
2297
- /**
2298
- * Total amount of revenue generated by friends referred by this customer.
2299
- * @readonly
2300
- */
2301
- totalAmountGenerated?: string;
2302
- /**
2303
- * Date and time of the last friend action.
2304
- * @readonly
2305
- */
2306
- lastFriendAction?: Date | null;
2307
- /**
2308
- * Number of friends who have completed actions.
2309
- * @readonly
2310
- */
2311
- totalFriendsWithActions?: number;
2312
- }
2313
- interface QueryReferredFriendActionsRequest {
2314
- /** Query to filter referred friend actions. */
2315
- query?: CursorQuery$3;
2316
- /** List of contact IDs to filter referred friend actions. */
2317
- contactIds?: string[];
2318
- }
2319
- interface QueryReferredFriendActionsResponse {
2320
- /** List of referred friend actions matching the query. */
2321
- referredFriendActions?: ReferredFriendAction[];
2322
- /** Paging metadata */
2323
- metadata?: CursorPagingMetadata$3;
2324
- }
2325
- interface ReferredFriendAction extends ReferredFriendActionRewardTypeOptionsOneOf {
2326
- /** Coupon reward type options. */
2327
- coupon?: V1Coupon$1;
2328
- /** Loyalty points reward type options. */
2329
- loyaltyPoints?: LoyaltyPoints$1;
2330
- /**
2331
- * Referred friend ID.
2332
- * @readonly
2333
- */
2334
- referredFriendId?: string;
2335
- /**
2336
- * Contact ID.
2337
- * @readonly
2338
- */
2339
- contactId?: string;
2340
- /**
2341
- * Trigger for the first action.
2342
- * @readonly
2343
- */
2344
- trigger?: V1Trigger;
2345
- /**
2346
- * Date and time of the first action.
2347
- * @readonly
2348
- */
2349
- actionDate?: Date | null;
2350
- /** Type of issued reward. */
2351
- rewardType?: Reward$1;
2352
- /** Number of actions completed. */
2353
- totalActions?: number;
2354
- /**
2355
- * Total amount spent by this referred friend.
2356
- * @readonly
2357
- */
2358
- totalAmountSpent?: string;
2359
- /**
2360
- * Date and time of friend signup.
2361
- * @readonly
2362
- */
2363
- signupDate?: Date | null;
2364
- }
2365
- /** @oneof */
2366
- interface ReferredFriendActionRewardTypeOptionsOneOf {
2367
- /** Coupon reward type options. */
2368
- coupon?: V1Coupon$1;
2369
- /** Loyalty points reward type options. */
2370
- loyaltyPoints?: LoyaltyPoints$1;
2371
- }
2372
- interface V1Coupon$1 {
2373
- /**
2374
- * Coupon ID. Example: `8934b045-7052-4a90-be2b-832c70afc9da`.
2375
- * @readonly
2376
- */
2377
- _id?: string;
2378
- /**
2379
- * The code that customers can use to apply the coupon. Example: `6RFD2A3HSPXW`.
2380
- * @readonly
2381
- */
2382
- code?: string;
2383
- /**
2384
- * Current status of the coupon.
2385
- * @readonly
2386
- */
2387
- status?: Status$2;
2388
- /**
2389
- * Detailed specifications of the coupon.
2390
- * @readonly
2391
- */
2392
- couponSpecification?: Coupon$1;
2393
- }
2394
- declare enum Status$2 {
2395
- /** Coupon status is unknown or not specified. */
2396
- UNKNOWN = "UNKNOWN",
2397
- /** Coupon is active and can be applied to purchases. */
2398
- ACTIVE = "ACTIVE",
2399
- /** Coupon was applied and can't be used again. */
2400
- APPLIED = "APPLIED",
2401
- /** Coupon was deleted and is no longer valid. */
2402
- DELETED = "DELETED"
2403
- }
2404
- interface Coupon$1 extends CouponDiscountTypeOptionsOneOf$1, CouponScopeOrMinSubtotalOneOf$1 {
2405
- /** Options for fixed amount discount. */
2406
- fixedAmountOptions?: FixedAmountDiscount$1;
2407
- /** Options for percentage discounts. */
2408
- percentageOptions?: PercentageDiscount$1;
2409
- /** Limit the coupon to carts with a subtotal above this number. */
2410
- minimumSubtotal?: number;
2411
- /** Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
2412
- scope?: CouponScope$1;
2413
- /** Coupon name. */
2414
- name?: string;
2415
- /** Coupon discount type. */
2416
- discountType?: DiscountType$1;
2417
- /**
2418
- * Whether the coupon is limited to one item.
2419
- * If `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.
2420
- * Coupons with a bookings `scope.namespace` are always limited to one item.
2421
- */
2422
- limitedToOneItem?: boolean | null;
2423
- /** Whether the coupon applies to subscription products. */
2424
- appliesToSubscriptions?: boolean | null;
2425
- /**
2426
- * Specifies the amount of discounted cycles for a subscription item.
2427
- *
2428
- * - Can only be set when `scope.namespace = pricingPlans`.
2429
- * - If `discountedCycleCount` is empty, the coupon applies to all available cycles.
2430
- * - `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.
2431
- *
2432
- * Max: `999`
2433
- */
2434
- discountedCycleCount?: number | null;
2435
- }
2436
- /** @oneof */
2437
- interface CouponDiscountTypeOptionsOneOf$1 {
2438
- /** Options for fixed amount discount. */
2439
- fixedAmountOptions?: FixedAmountDiscount$1;
2440
- /** Options for percentage discounts. */
2441
- percentageOptions?: PercentageDiscount$1;
2442
- }
2443
- /** @oneof */
2444
- interface CouponScopeOrMinSubtotalOneOf$1 {
2445
- /** Limit the coupon to carts with a subtotal above this number. */
2446
- minimumSubtotal?: number;
2447
- /** Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
2448
- scope?: CouponScope$1;
2449
- }
2450
- declare enum DiscountType$1 {
2451
- /** Unknown discount type. */
2452
- UNKNOWN = "UNKNOWN",
2453
- /** Discount as a fixed amount. */
2454
- FIXED_AMOUNT = "FIXED_AMOUNT",
2455
- /** Discount as a percentage. */
2456
- PERCENTAGE = "PERCENTAGE",
2457
- /** Free shipping. If `true`, the coupon applies to all items in all `namespaces`. */
2458
- FREE_SHIPPING = "FREE_SHIPPING"
2459
- }
2460
- interface FixedAmountDiscount$1 {
2461
- /** Amount of the discount as a fixed value. */
2462
- amount?: number;
2463
- }
2464
- interface PercentageDiscount$1 {
2465
- /** Percentage of discount. */
2466
- percentage?: number;
2467
- }
2468
- interface CouponScope$1 {
2469
- /** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
2470
- namespace?: string;
2471
- /** Coupon scope's applied group, for example, Event or ticket in Wix Events. */
2472
- group?: Group$1;
2473
- }
2474
- interface Group$1 {
2475
- /** Name of the group. */
2476
- name?: string;
2477
- /** Entity ID of the group. */
2478
- entityId?: string | null;
2479
- }
2480
- interface LoyaltyPoints$1 {
2481
- /**
2482
- * Loyalty transaction ID.
2483
- * @readonly
2484
- */
2485
- transactionId?: string;
2486
- /**
2487
- * The number of loyalty points awarded.
2488
- * @readonly
2489
- */
2490
- amount?: number;
2491
- }
2492
- interface DomainEvent$3 extends DomainEventBodyOneOf$3 {
2493
- createdEvent?: EntityCreatedEvent$3;
2494
- updatedEvent?: EntityUpdatedEvent$3;
2495
- deletedEvent?: EntityDeletedEvent$3;
2496
- actionEvent?: ActionEvent$3;
2497
- /**
2498
- * Unique event ID.
2499
- * Allows clients to ignore duplicate webhooks.
2500
- */
2501
- _id?: string;
2502
- /**
2503
- * Assumes actions are also always typed to an entity_type
2504
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2505
- */
2506
- entityFqdn?: string;
2507
- /**
2508
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2509
- * This is although the created/updated/deleted notion is duplication of the oneof types
2510
- * Example: created/updated/deleted/started/completed/email_opened
2511
- */
2512
- slug?: string;
2513
- /** ID of the entity associated with the event. */
2514
- entityId?: string;
2515
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2516
- eventTime?: Date | null;
2517
- /**
2518
- * Whether the event was triggered as a result of a privacy regulation application
2519
- * (for example, GDPR).
2520
- */
2521
- triggeredByAnonymizeRequest?: boolean | null;
2522
- /** If present, indicates the action that triggered the event. */
2523
- originatedFrom?: string | null;
2524
- /**
2525
- * A sequence number defining the order of updates to the underlying entity.
2526
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
2527
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2528
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2529
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
2530
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2531
- */
2532
- entityEventSequence?: string | null;
2533
- }
2534
- /** @oneof */
2535
- interface DomainEventBodyOneOf$3 {
2536
- createdEvent?: EntityCreatedEvent$3;
2537
- updatedEvent?: EntityUpdatedEvent$3;
2538
- deletedEvent?: EntityDeletedEvent$3;
2539
- actionEvent?: ActionEvent$3;
2540
- }
2541
- interface EntityCreatedEvent$3 {
2542
- entity?: string;
2543
- }
2544
- interface RestoreInfo$3 {
2545
- deletedDate?: Date | null;
2546
- }
2547
- interface EntityUpdatedEvent$3 {
2548
- /**
2549
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
2550
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
2551
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
2552
- */
2553
- currentEntity?: string;
2554
- }
2555
- interface EntityDeletedEvent$3 {
2556
- /** Entity that was deleted */
2557
- deletedEntity?: string | null;
2558
- }
2559
- interface ActionEvent$3 {
2560
- body?: string;
2561
- }
2562
- interface Empty$2 {
2563
- }
2564
- interface SuccessfulReferralEvent$2 {
2565
- /** Details of the referred friend who completed their referral. */
2566
- referredFriendDetails?: ReferredFriendDetails$2;
2567
- }
2568
- interface ReferredFriendDetails$2 {
2569
- /**
2570
- * ID of the referred friend.
2571
- * @readonly
2572
- */
2573
- referredFriendId?: string;
2574
- /**
2575
- * Contact ID of the referred friend.
2576
- * @readonly
2577
- */
2578
- contactId?: string;
2579
- /**
2580
- * ID of the customer who referred this friend.
2581
- * @readonly
2582
- */
2583
- referringCustomerId?: string;
2584
- }
2585
- interface ReferredFriendActionEvent {
2586
- /** Details of the referred friend. */
2587
- referredFriendDetails?: ReferredFriendDetails$2;
2588
- /** Details of the trigger. */
2589
- trigger?: Trigger;
2590
- /** Amount of the referral reward. */
2591
- amount?: string | null;
2592
- /** Currency of the referral reward. */
2593
- currency?: string | null;
2594
- /** ID of the order associated with the referral. */
2595
- orderId?: string | null;
2596
- }
2597
- interface Trigger {
2598
- /** ID of the app associated with the referral activity. */
2599
- appId?: string;
2600
- /** Type of referral activity. */
2601
- activityType?: string;
2602
- }
2603
- interface MessageEnvelope$3 {
2604
- /** App instance ID. */
2605
- instanceId?: string | null;
2606
- /** Event type. */
2607
- eventType?: string;
2608
- /** The identification type and identity data. */
2609
- identity?: IdentificationData$3;
2610
- /** Stringify payload. */
2611
- data?: string;
2612
- }
2613
- interface IdentificationData$3 extends IdentificationDataIdOneOf$3 {
2614
- /** ID of a site visitor that has not logged in to the site. */
2615
- anonymousVisitorId?: string;
2616
- /** ID of a site visitor that has logged in to the site. */
2617
- memberId?: string;
2618
- /** ID of a Wix user (site owner, contributor, etc.). */
2619
- wixUserId?: string;
2620
- /** ID of an app. */
2621
- appId?: string;
2622
- /** @readonly */
2623
- identityType?: WebhookIdentityType$3;
2624
- }
2625
- /** @oneof */
2626
- interface IdentificationDataIdOneOf$3 {
2627
- /** ID of a site visitor that has not logged in to the site. */
2628
- anonymousVisitorId?: string;
2629
- /** ID of a site visitor that has logged in to the site. */
2630
- memberId?: string;
2631
- /** ID of a Wix user (site owner, contributor, etc.). */
2632
- wixUserId?: string;
2633
- /** ID of an app. */
2634
- appId?: string;
2635
- }
2636
- declare enum WebhookIdentityType$3 {
2637
- UNKNOWN = "UNKNOWN",
2638
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
2639
- MEMBER = "MEMBER",
2640
- WIX_USER = "WIX_USER",
2641
- APP = "APP"
2642
- }
2643
- interface ReferredFriendSignupEventNonNullableFields {
2644
- referredFriendId: string;
2645
- }
2646
- interface V1SuccessfulReferralEventNonNullableFields {
2647
- referredFriendId: string;
2648
- referringCustomerId: string;
2649
- }
2650
- interface V1TriggerNonNullableFields {
2651
- appId: string;
2652
- activityType: string;
2653
- }
2654
- interface V1ActionEventNonNullableFields {
2655
- referredFriendId: string;
2656
- referringCustomerId: string;
2657
- trigger?: V1TriggerNonNullableFields;
2658
- }
2659
- interface RewardEventNonNullableFields {
2660
- rewardedReferringCustomerId: string;
2661
- rewardedReferredFriendId: string;
2662
- referralRewardId: string;
2663
- rewardType: Reward$1;
2664
- }
2665
- interface ReferralEventNonNullableFields {
2666
- referredFriendSignupEvent?: ReferredFriendSignupEventNonNullableFields;
2667
- successfulReferralEvent?: V1SuccessfulReferralEventNonNullableFields;
2668
- actionEvent?: V1ActionEventNonNullableFields;
2669
- rewardEvent?: RewardEventNonNullableFields;
2670
- }
2671
- interface GetReferralEventResponseNonNullableFields {
2672
- referralEvent?: ReferralEventNonNullableFields;
2673
- }
2674
- interface QueryReferralEventResponseNonNullableFields {
2675
- referralEvents: ReferralEventNonNullableFields[];
2676
- }
2677
- interface GetReferralStatisticsResponseNonNullableFields {
2678
- totalSignUpsCompleted: number;
2679
- totalActionsCompleted: number;
2680
- totalAmountGenerated: string;
2681
- }
2682
- interface ReferringCustomerTotalNonNullableFields {
2683
- referringCustomerId: string;
2684
- contactId: string;
2685
- totalSuccessfulReferrals: number;
2686
- totalAmountGenerated: string;
2687
- totalFriendsWithActions: number;
2688
- }
2689
- interface QueryReferringCustomerTotalsResponseNonNullableFields {
2690
- referringCustomerTotals: ReferringCustomerTotalNonNullableFields[];
2691
- }
2692
- interface FixedAmountDiscountNonNullableFields$1 {
2693
- amount: number;
2694
- }
2695
- interface PercentageDiscountNonNullableFields$1 {
2696
- percentage: number;
2697
- }
2698
- interface GroupNonNullableFields$1 {
2699
- name: string;
2700
- }
2701
- interface CouponScopeNonNullableFields$1 {
2702
- namespace: string;
2703
- group?: GroupNonNullableFields$1;
2704
- }
2705
- interface CouponNonNullableFields$1 {
2706
- fixedAmountOptions?: FixedAmountDiscountNonNullableFields$1;
2707
- percentageOptions?: PercentageDiscountNonNullableFields$1;
2708
- minimumSubtotal: number;
2709
- scope?: CouponScopeNonNullableFields$1;
2710
- name: string;
2711
- discountType: DiscountType$1;
2712
- }
2713
- interface V1CouponNonNullableFields$1 {
2714
- _id: string;
2715
- code: string;
2716
- status: Status$2;
2717
- couponSpecification?: CouponNonNullableFields$1;
2718
- }
2719
- interface LoyaltyPointsNonNullableFields {
2720
- transactionId: string;
2721
- amount: number;
2722
- }
2723
- interface ReferredFriendActionNonNullableFields {
2724
- coupon?: V1CouponNonNullableFields$1;
2725
- loyaltyPoints?: LoyaltyPointsNonNullableFields;
2726
- referredFriendId: string;
2727
- contactId: string;
2728
- trigger?: V1TriggerNonNullableFields;
2729
- rewardType: Reward$1;
2730
- totalActions: number;
2731
- totalAmountSpent: string;
2732
- }
2733
- interface QueryReferredFriendActionsResponseNonNullableFields {
2734
- referredFriendActions: ReferredFriendActionNonNullableFields[];
2735
- }
2736
- interface BaseEventMetadata$2 {
2737
- /** App instance ID. */
2738
- instanceId?: string | null;
2739
- /** Event type. */
2740
- eventType?: string;
2741
- /** The identification type and identity data. */
2742
- identity?: IdentificationData$3;
2743
- }
2744
- interface EventMetadata$2 extends BaseEventMetadata$2 {
2745
- /**
2746
- * Unique event ID.
2747
- * Allows clients to ignore duplicate webhooks.
2748
- */
2749
- _id?: string;
2750
- /**
2751
- * Assumes actions are also always typed to an entity_type
2752
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
2753
- */
2754
- entityFqdn?: string;
2755
- /**
2756
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
2757
- * This is although the created/updated/deleted notion is duplication of the oneof types
2758
- * Example: created/updated/deleted/started/completed/email_opened
2759
- */
2760
- slug?: string;
2761
- /** ID of the entity associated with the event. */
2762
- entityId?: string;
2763
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
2764
- eventTime?: Date | null;
2765
- /**
2766
- * Whether the event was triggered as a result of a privacy regulation application
2767
- * (for example, GDPR).
2768
- */
2769
- triggeredByAnonymizeRequest?: boolean | null;
2770
- /** If present, indicates the action that triggered the event. */
2771
- originatedFrom?: string | null;
2772
- /**
2773
- * A sequence number defining the order of updates to the underlying entity.
2774
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
2775
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
2776
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
2777
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
2778
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
2779
- */
2780
- entityEventSequence?: string | null;
2781
- }
2782
- interface ReferralEventCreatedEnvelope {
2783
- entity: ReferralEvent;
2784
- metadata: EventMetadata$2;
2785
- }
2786
- interface QueryCursorResult$3 {
2787
- cursors: Cursors$3;
2788
- hasNext: () => boolean;
2789
- hasPrev: () => boolean;
2790
- length: number;
2791
- pageSize: number;
2792
- }
2793
- interface ReferralEventsQueryResult extends QueryCursorResult$3 {
2794
- items: ReferralEvent[];
2795
- query: ReferralEventsQueryBuilder;
2796
- next: () => Promise<ReferralEventsQueryResult>;
2797
- prev: () => Promise<ReferralEventsQueryResult>;
2798
- }
2799
- interface ReferralEventsQueryBuilder {
2800
- /** @param propertyName - Property whose value is compared with `value`.
2801
- * @param value - Value to compare against.
2802
- * @documentationMaturity preview
2803
- */
2804
- eq: (propertyName: 'referredFriendSignupEvent' | 'successfulReferralEvent' | 'actionEvent' | 'rewardEvent' | '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2805
- /** @param propertyName - Property whose value is compared with `value`.
2806
- * @param value - Value to compare against.
2807
- * @documentationMaturity preview
2808
- */
2809
- ne: (propertyName: 'referredFriendSignupEvent' | 'successfulReferralEvent' | 'actionEvent' | 'rewardEvent' | '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2810
- /** @param propertyName - Property whose value is compared with `value`.
2811
- * @param value - Value to compare against.
2812
- * @documentationMaturity preview
2813
- */
2814
- ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2815
- /** @param propertyName - Property whose value is compared with `value`.
2816
- * @param value - Value to compare against.
2817
- * @documentationMaturity preview
2818
- */
2819
- gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2820
- /** @param propertyName - Property whose value is compared with `value`.
2821
- * @param value - Value to compare against.
2822
- * @documentationMaturity preview
2823
- */
2824
- le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2825
- /** @param propertyName - Property whose value is compared with `value`.
2826
- * @param value - Value to compare against.
2827
- * @documentationMaturity preview
2828
- */
2829
- lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2830
- /** @param propertyName - Property whose value is compared with `values`.
2831
- * @param values - List of values to compare against.
2832
- * @documentationMaturity preview
2833
- */
2834
- hasSome: (propertyName: 'referredFriendSignupEvent' | 'successfulReferralEvent' | 'actionEvent' | 'rewardEvent' | '_createdDate' | '_updatedDate', value: any[]) => ReferralEventsQueryBuilder;
2835
- /** @documentationMaturity preview */
2836
- in: (propertyName: 'referredFriendSignupEvent' | 'successfulReferralEvent' | 'actionEvent' | 'rewardEvent' | '_createdDate' | '_updatedDate', value: any) => ReferralEventsQueryBuilder;
2837
- /** @documentationMaturity preview */
2838
- exists: (propertyName: 'referredFriendSignupEvent' | 'successfulReferralEvent' | 'actionEvent' | 'rewardEvent' | '_createdDate' | '_updatedDate', value: boolean) => ReferralEventsQueryBuilder;
2839
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
2840
- * @documentationMaturity preview
2841
- */
2842
- ascending: (...propertyNames: Array<'referredFriendSignupEvent' | 'successfulReferralEvent' | 'actionEvent' | 'rewardEvent' | '_createdDate' | '_updatedDate'>) => ReferralEventsQueryBuilder;
2843
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
2844
- * @documentationMaturity preview
2845
- */
2846
- descending: (...propertyNames: Array<'referredFriendSignupEvent' | 'successfulReferralEvent' | 'actionEvent' | 'rewardEvent' | '_createdDate' | '_updatedDate'>) => ReferralEventsQueryBuilder;
2847
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
2848
- * @documentationMaturity preview
2849
- */
2850
- limit: (limit: number) => ReferralEventsQueryBuilder;
2851
- /** @param cursor - A pointer to specific record
2852
- * @documentationMaturity preview
2853
- */
2854
- skipTo: (cursor: string) => ReferralEventsQueryBuilder;
2855
- /** @documentationMaturity preview */
2856
- find: () => Promise<ReferralEventsQueryResult>;
2857
- }
2858
- interface QueryReferringCustomerTotalsOptions {
2859
- /** Query to filter referring customer totals. */
2860
- query?: CursorQuery$3;
2861
- /** List of contact IDs to filter referring customer totals. */
2862
- contactIds?: string[];
2863
- }
2864
- interface QueryReferredFriendActionsOptions {
2865
- /** Query to filter referred friend actions. */
2866
- query?: CursorQuery$3;
2867
- /** List of contact IDs to filter referred friend actions. */
2868
- contactIds?: string[];
2869
- }
2870
-
2871
- declare function getReferralEvent$1(httpClient: HttpClient): GetReferralEventSignature;
2872
- interface GetReferralEventSignature {
2873
- /**
2874
- * Retrieves a referral event by ID.
2875
- * @param - ID of the referral event to retrieve.
2876
- * @returns Retrieved referral event.
2877
- */
2878
- (referralEventId: string): Promise<ReferralEvent & ReferralEventNonNullableFields>;
2879
- }
2880
- declare function queryReferralEvent$1(httpClient: HttpClient): QueryReferralEventSignature;
2881
- interface QueryReferralEventSignature {
2882
- /**
2883
- * Retrieves a list of referral events, given the provided paging, filtering, and sorting.
2884
- *
2885
- * To learn about working with Query endpoints, see
2886
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
2887
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
2888
- * and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
2889
- */
2890
- (): ReferralEventsQueryBuilder;
2891
- }
2892
- declare function getReferralStatistics$1(httpClient: HttpClient): GetReferralStatisticsSignature;
2893
- interface GetReferralStatisticsSignature {
2894
- /**
2895
- * Retrieves referral statistics.
2896
- */
2897
- (): Promise<GetReferralStatisticsResponse & GetReferralStatisticsResponseNonNullableFields>;
2898
- }
2899
- declare function queryReferringCustomerTotals$1(httpClient: HttpClient): QueryReferringCustomerTotalsSignature;
2900
- interface QueryReferringCustomerTotalsSignature {
2901
- /**
2902
- * Retrieves a list of referring customer totals, given the provided paging, filtering, and sorting.
2903
- *
2904
- * To learn about working with Query endpoints, see
2905
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
2906
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
2907
- * and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
2908
- */
2909
- (options?: QueryReferringCustomerTotalsOptions | undefined): Promise<QueryReferringCustomerTotalsResponse & QueryReferringCustomerTotalsResponseNonNullableFields>;
2910
- }
2911
- declare function queryReferredFriendActions$1(httpClient: HttpClient): QueryReferredFriendActionsSignature;
2912
- interface QueryReferredFriendActionsSignature {
2913
- /**
2914
- * Retrieves a list of referred friend actions, given the provided paging, filtering, and sorting.
2915
- *
2916
- * To learn about working with Query endpoints, see
2917
- * [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language),
2918
- * [Sorting and Paging](https://dev.wix.com/api/rest/getting-started/pagination),
2919
- * and [Field Projection](https://dev.wix.com/api/rest/getting-started/field-projection).
2920
- */
2921
- (options?: QueryReferredFriendActionsOptions | undefined): Promise<QueryReferredFriendActionsResponse & QueryReferredFriendActionsResponseNonNullableFields>;
2922
- }
2923
- declare const onReferralEventCreated$1: EventDefinition<ReferralEventCreatedEnvelope, "wix.loyalty.referral.v1.referral_event_created">;
2924
-
2925
- declare function createEventModule$2<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2926
-
2927
- declare const getReferralEvent: MaybeContext<BuildRESTFunction<typeof getReferralEvent$1> & typeof getReferralEvent$1>;
2928
- declare const queryReferralEvent: MaybeContext<BuildRESTFunction<typeof queryReferralEvent$1> & typeof queryReferralEvent$1>;
2929
- declare const getReferralStatistics: MaybeContext<BuildRESTFunction<typeof getReferralStatistics$1> & typeof getReferralStatistics$1>;
2930
- declare const queryReferringCustomerTotals: MaybeContext<BuildRESTFunction<typeof queryReferringCustomerTotals$1> & typeof queryReferringCustomerTotals$1>;
2931
- declare const queryReferredFriendActions: MaybeContext<BuildRESTFunction<typeof queryReferredFriendActions$1> & typeof queryReferredFriendActions$1>;
2932
-
2933
- type _publicOnReferralEventCreatedType = typeof onReferralEventCreated$1;
2934
- /** */
2935
- declare const onReferralEventCreated: ReturnType<typeof createEventModule$2<_publicOnReferralEventCreatedType>>;
2936
-
2937
- type context$3_CreateReferralEventRequest = CreateReferralEventRequest;
2938
- type context$3_CreateReferralEventResponse = CreateReferralEventResponse;
2939
- type context$3_GetReferralEventRequest = GetReferralEventRequest;
2940
- type context$3_GetReferralEventResponse = GetReferralEventResponse;
2941
- type context$3_GetReferralEventResponseNonNullableFields = GetReferralEventResponseNonNullableFields;
2942
- type context$3_GetReferralStatisticsRequest = GetReferralStatisticsRequest;
2943
- type context$3_GetReferralStatisticsResponse = GetReferralStatisticsResponse;
2944
- type context$3_GetReferralStatisticsResponseNonNullableFields = GetReferralStatisticsResponseNonNullableFields;
2945
- type context$3_QueryReferralEventRequest = QueryReferralEventRequest;
2946
- type context$3_QueryReferralEventResponse = QueryReferralEventResponse;
2947
- type context$3_QueryReferralEventResponseNonNullableFields = QueryReferralEventResponseNonNullableFields;
2948
- type context$3_QueryReferredFriendActionsOptions = QueryReferredFriendActionsOptions;
2949
- type context$3_QueryReferredFriendActionsRequest = QueryReferredFriendActionsRequest;
2950
- type context$3_QueryReferredFriendActionsResponse = QueryReferredFriendActionsResponse;
2951
- type context$3_QueryReferredFriendActionsResponseNonNullableFields = QueryReferredFriendActionsResponseNonNullableFields;
2952
- type context$3_QueryReferringCustomerTotalsOptions = QueryReferringCustomerTotalsOptions;
2953
- type context$3_QueryReferringCustomerTotalsRequest = QueryReferringCustomerTotalsRequest;
2954
- type context$3_QueryReferringCustomerTotalsResponse = QueryReferringCustomerTotalsResponse;
2955
- type context$3_QueryReferringCustomerTotalsResponseNonNullableFields = QueryReferringCustomerTotalsResponseNonNullableFields;
2956
- type context$3_ReferralEvent = ReferralEvent;
2957
- type context$3_ReferralEventCreatedEnvelope = ReferralEventCreatedEnvelope;
2958
- type context$3_ReferralEventEventTypeOneOf = ReferralEventEventTypeOneOf;
2959
- type context$3_ReferralEventNonNullableFields = ReferralEventNonNullableFields;
2960
- type context$3_ReferralEventsQueryBuilder = ReferralEventsQueryBuilder;
2961
- type context$3_ReferralEventsQueryResult = ReferralEventsQueryResult;
2962
- type context$3_ReferredFriendAction = ReferredFriendAction;
2963
- type context$3_ReferredFriendActionEvent = ReferredFriendActionEvent;
2964
- type context$3_ReferredFriendActionRewardTypeOptionsOneOf = ReferredFriendActionRewardTypeOptionsOneOf;
2965
- type context$3_ReferredFriendSignupEvent = ReferredFriendSignupEvent;
2966
- type context$3_ReferringCustomerTotal = ReferringCustomerTotal;
2967
- type context$3_RewardEvent = RewardEvent;
2968
- type context$3_RewardEventReceiverOneOf = RewardEventReceiverOneOf;
2969
- type context$3_Trigger = Trigger;
2970
- type context$3_V1ActionEvent = V1ActionEvent;
2971
- type context$3_V1SuccessfulReferralEvent = V1SuccessfulReferralEvent;
2972
- type context$3_V1Trigger = V1Trigger;
2973
- type context$3__publicOnReferralEventCreatedType = _publicOnReferralEventCreatedType;
2974
- declare const context$3_getReferralEvent: typeof getReferralEvent;
2975
- declare const context$3_getReferralStatistics: typeof getReferralStatistics;
2976
- declare const context$3_onReferralEventCreated: typeof onReferralEventCreated;
2977
- declare const context$3_queryReferralEvent: typeof queryReferralEvent;
2978
- declare const context$3_queryReferredFriendActions: typeof queryReferredFriendActions;
2979
- declare const context$3_queryReferringCustomerTotals: typeof queryReferringCustomerTotals;
2980
- declare namespace context$3 {
2981
- 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 };
2982
- }
2983
-
2984
- interface ReferralReward extends ReferralRewardReceiverOneOf, ReferralRewardRewardTypeOptionsOneOf {
2985
- /**
2986
- * ID of the referring customer who received the reward.
2987
- * @readonly
2988
- */
2989
- rewardedReferringCustomerId?: string;
2990
- /**
2991
- * ID of the referred friend who received the reward.
2992
- * @readonly
2993
- */
2994
- rewardedReferredFriendId?: string;
2995
- /** Details of a coupon reward. Present when `reward_type` is `COUPON`. */
2996
- coupon?: V1Coupon;
2997
- /** Details of a loyalty points reward. Present when `reward_type` is `LOYALTY_POINTS`. */
2998
- loyaltyPoints?: V1LoyaltyPoints;
2999
- /**
3000
- * Referral reward ID.
3001
- * @readonly
3002
- */
3003
- _id?: string | null;
3004
- /**
3005
- * Revision number, which increments by 1 each time the referral reward is updated.
3006
- * To prevent conflicting changes, the current revision must be passed when updating the referral reward.
3007
- */
3008
- revision?: string | null;
3009
- /**
3010
- * Date and time the referral reward was created.
3011
- * @readonly
3012
- */
3013
- _createdDate?: Date | null;
3014
- /**
3015
- * Date and time the referral reward was last updated.
3016
- * @readonly
3017
- */
3018
- _updatedDate?: Date | null;
3019
- /** Type of reward given. */
3020
- rewardType?: RewardTypeType;
3021
- }
3022
- /** @oneof */
3023
- interface ReferralRewardReceiverOneOf {
3024
- /**
3025
- * ID of the referring customer who received the reward.
3026
- * @readonly
3027
- */
3028
- rewardedReferringCustomerId?: string;
3029
- /**
3030
- * ID of the referred friend who received the reward.
3031
- * @readonly
3032
- */
3033
- rewardedReferredFriendId?: string;
3034
- }
3035
- /** @oneof */
3036
- interface ReferralRewardRewardTypeOptionsOneOf {
3037
- /** Details of a coupon reward. Present when `reward_type` is `COUPON`. */
3038
- coupon?: V1Coupon;
3039
- /** Details of a loyalty points reward. Present when `reward_type` is `LOYALTY_POINTS`. */
3040
- loyaltyPoints?: V1LoyaltyPoints;
3041
- }
3042
- declare enum RewardTypeType {
3043
- /** Unknown reward type. */
3044
- UNKNOWN = "UNKNOWN",
3045
- /** Loyalty coupon is given. */
3046
- COUPON = "COUPON",
3047
- /** Loyalty points are awarded. */
3048
- LOYALTY_POINTS = "LOYALTY_POINTS",
3049
- /** No reward is given. */
3050
- NOTHING = "NOTHING"
3051
- }
3052
- interface V1Coupon {
3053
- /**
3054
- * Coupon ID. Example: `8934b045-7052-4a90-be2b-832c70afc9da`.
3055
- * @readonly
3056
- */
3057
- _id?: string;
3058
- /**
3059
- * The code that customers can use to apply the coupon. Example: `6RFD2A3HSPXW`.
3060
- * @readonly
3061
- */
3062
- code?: string;
3063
- /**
3064
- * Current status of the coupon.
3065
- * @readonly
3066
- */
3067
- status?: Status$1;
3068
- /**
3069
- * Detailed specifications of the coupon.
3070
- * @readonly
3071
- */
3072
- couponSpecification?: Coupon;
3073
- }
3074
- declare enum Status$1 {
3075
- /** Coupon status is unknown or not specified. */
3076
- UNKNOWN = "UNKNOWN",
3077
- /** Coupon is active and can be applied to purchases. */
3078
- ACTIVE = "ACTIVE",
3079
- /** Coupon was applied and can't be used again. */
3080
- APPLIED = "APPLIED",
3081
- /** Coupon was deleted and is no longer valid. */
3082
- DELETED = "DELETED"
3083
- }
3084
- interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtotalOneOf {
3085
- /** Options for fixed amount discount. */
3086
- fixedAmountOptions?: FixedAmountDiscount;
3087
- /** Options for percentage discounts. */
3088
- percentageOptions?: PercentageDiscount;
3089
- /** Limit the coupon to carts with a subtotal above this number. */
3090
- minimumSubtotal?: number;
3091
- /** Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
3092
- scope?: CouponScope;
3093
- /** Coupon name. */
3094
- name?: string;
3095
- /** Coupon discount type. */
3096
- discountType?: DiscountType;
3097
- /**
3098
- * Whether the coupon is limited to one item.
3099
- * If `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.
3100
- * Coupons with a bookings `scope.namespace` are always limited to one item.
3101
- */
3102
- limitedToOneItem?: boolean | null;
3103
- /** Whether the coupon applies to subscription products. */
3104
- appliesToSubscriptions?: boolean | null;
3105
- /**
3106
- * Specifies the amount of discounted cycles for a subscription item.
3107
- *
3108
- * - Can only be set when `scope.namespace = pricingPlans`.
3109
- * - If `discountedCycleCount` is empty, the coupon applies to all available cycles.
3110
- * - `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.
3111
- *
3112
- * Max: `999`
3113
- */
3114
- discountedCycleCount?: number | null;
3115
- }
3116
- /** @oneof */
3117
- interface CouponDiscountTypeOptionsOneOf {
3118
- /** Options for fixed amount discount. */
3119
- fixedAmountOptions?: FixedAmountDiscount;
3120
- /** Options for percentage discounts. */
3121
- percentageOptions?: PercentageDiscount;
3122
- }
3123
- /** @oneof */
3124
- interface CouponScopeOrMinSubtotalOneOf {
3125
- /** Limit the coupon to carts with a subtotal above this number. */
3126
- minimumSubtotal?: number;
3127
- /** Specifies the type of line items this coupon will apply to. See [valid scope values](https://dev.wix.com/api/rest/coupons/coupons/valid-scope-values). */
3128
- scope?: CouponScope;
3129
- }
3130
- declare enum DiscountType {
3131
- /** Unknown discount type. */
3132
- UNKNOWN = "UNKNOWN",
3133
- /** Discount as a fixed amount. */
3134
- FIXED_AMOUNT = "FIXED_AMOUNT",
3135
- /** Discount as a percentage. */
3136
- PERCENTAGE = "PERCENTAGE",
3137
- /** Free shipping. If `true`, the coupon applies to all items in all `namespaces`. */
3138
- FREE_SHIPPING = "FREE_SHIPPING"
3139
- }
3140
- interface FixedAmountDiscount {
3141
- /** Amount of the discount as a fixed value. */
3142
- amount?: number;
3143
- }
3144
- interface PercentageDiscount {
3145
- /** Percentage of discount. */
3146
- percentage?: number;
3147
- }
3148
- interface CouponScope {
3149
- /** Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans) */
3150
- namespace?: string;
3151
- /** Coupon scope's applied group, for example, Event or ticket in Wix Events. */
3152
- group?: Group;
3153
- }
3154
- interface Group {
3155
- /** Name of the group. */
3156
- name?: string;
3157
- /** Entity ID of the group. */
3158
- entityId?: string | null;
3159
- }
3160
- interface V1LoyaltyPoints {
3161
- /**
3162
- * Loyalty transaction ID.
3163
- * @readonly
3164
- */
3165
- transactionId?: string;
3166
- /**
3167
- * The number of loyalty points awarded.
3168
- * @readonly
3169
- */
3170
- amount?: number;
3171
- }
3172
- interface GetReferralRewardRequest {
3173
- /** Referral reward ID. */
3174
- _id: string;
3175
- }
3176
- interface GetReferralRewardResponse {
3177
- /** Retrieved referral reward. */
3178
- referralReward?: ReferralReward;
3179
- }
3180
- interface QueryReferralRewardsRequest {
3181
- /** Query to filter referral rewards. */
3182
- query: CursorQuery$2;
3183
- /** Contact ID to filter rewards by. Use `"me"` for current identity's rewards. */
3184
- contactId?: string | null;
3185
- }
3186
- interface CursorQuery$2 extends CursorQueryPagingMethodOneOf$2 {
3187
- /**
3188
- * Cursor paging options.
3189
- *
3190
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
3191
- */
3192
- cursorPaging?: CursorPaging$2;
3193
- /**
3194
- * Filter object.
3195
- *
3196
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
3197
- */
3198
- filter?: Record<string, any> | null;
3199
- /**
3200
- * Sort object.
3201
- *
3202
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
3203
- */
3204
- sort?: Sorting$2[];
3205
- }
3206
- /** @oneof */
3207
- interface CursorQueryPagingMethodOneOf$2 {
3208
- /**
3209
- * Cursor paging options.
3210
- *
3211
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
3212
- */
3213
- cursorPaging?: CursorPaging$2;
3214
- }
3215
- interface Sorting$2 {
3216
- /** Name of the field to sort by. */
3217
- fieldName?: string;
3218
- /** Sort order. */
3219
- order?: SortOrder$2;
3220
- }
3221
- declare enum SortOrder$2 {
3222
- ASC = "ASC",
3223
- DESC = "DESC"
3224
- }
3225
- interface CursorPaging$2 {
3226
- /** Maximum number of items to return in the results. */
3227
- limit?: number | null;
3228
- /**
3229
- * Pointer to the next or previous page in the list of results.
3230
- *
3231
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
3232
- * Not relevant for the first request.
3233
- */
3234
- cursor?: string | null;
3235
- }
3236
- interface QueryReferralRewardsResponse {
3237
- /** Retrieved referral rewards. */
3238
- referralRewards?: ReferralReward[];
3239
- /** Metadata for paging. */
3240
- metadata?: CursorPagingMetadata$2;
3241
- }
3242
- interface CursorPagingMetadata$2 {
3243
- /** Number of items returned in current page. */
3244
- count?: number | null;
3245
- /** Cursor strings that point to the next page, previous page, or both. */
3246
- cursors?: Cursors$2;
3247
- /**
3248
- * Whether there are more pages to retrieve following the current page.
3249
- *
3250
- * + `true`: Another page of results can be retrieved.
3251
- * + `false`: This is the last page.
3252
- */
3253
- hasNext?: boolean | null;
3254
- }
3255
- interface Cursors$2 {
3256
- /** Cursor string pointing to the next page in the list of results. */
3257
- next?: string | null;
3258
- /** Cursor pointing to the previous page in the list of results. */
3259
- prev?: string | null;
3260
- }
3261
- interface ValidateReferralRewardRequest {
3262
- /** Reward to validate. */
3263
- reward?: Reward;
3264
- }
3265
- interface Reward extends RewardOptionsOneOf {
3266
- /** Options for coupon reward type. */
3267
- couponOptions?: Coupon;
3268
- /** Options for the Loyalty points reward type. */
3269
- loyaltyPointsOptions?: LoyaltyPoints;
3270
- /** Type of the reward. */
3271
- type?: Type;
3272
- }
3273
- /** @oneof */
3274
- interface RewardOptionsOneOf {
3275
- /** Options for coupon reward type. */
3276
- couponOptions?: Coupon;
3277
- /** Options for the Loyalty points reward type. */
3278
- loyaltyPointsOptions?: LoyaltyPoints;
3279
- }
3280
- declare enum Type {
3281
- /** Unknown reward type. */
3282
- UNKNOWN = "UNKNOWN",
3283
- /** Coupon reward type. */
3284
- COUPON = "COUPON",
3285
- /** Loyalty points reward type. */
3286
- LOYALTY_POINTS = "LOYALTY_POINTS",
3287
- /** No reward type. */
3288
- NOTHING = "NOTHING"
3289
- }
3290
- interface LoyaltyPoints {
3291
- /** Number of loyalty points to give. */
3292
- amount?: number;
3293
- }
3294
- interface ValidateReferralRewardResponse {
3295
- }
3296
- interface BulkGetReferralRewardsRequest {
3297
- }
3298
- interface BulkGetReferralRewardsResponse {
3299
- /** Rewards grouped by site. */
3300
- rewardsInSite?: RewardsInSite[];
3301
- }
3302
- interface RewardsInSite {
3303
- /** Metasite ID. */
3304
- metaSiteId?: string;
3305
- /** List of rewards for the site. */
3306
- rewards?: ReferralReward[];
3307
- }
3308
- interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
3309
- createdEvent?: EntityCreatedEvent$2;
3310
- updatedEvent?: EntityUpdatedEvent$2;
3311
- deletedEvent?: EntityDeletedEvent$2;
3312
- actionEvent?: ActionEvent$2;
3313
- /**
3314
- * Unique event ID.
3315
- * Allows clients to ignore duplicate webhooks.
3316
- */
3317
- _id?: string;
3318
- /**
3319
- * Assumes actions are also always typed to an entity_type
3320
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
3321
- */
3322
- entityFqdn?: string;
3323
- /**
3324
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3325
- * This is although the created/updated/deleted notion is duplication of the oneof types
3326
- * Example: created/updated/deleted/started/completed/email_opened
3327
- */
3328
- slug?: string;
3329
- /** ID of the entity associated with the event. */
3330
- entityId?: string;
3331
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3332
- eventTime?: Date | null;
3333
- /**
3334
- * Whether the event was triggered as a result of a privacy regulation application
3335
- * (for example, GDPR).
3336
- */
3337
- triggeredByAnonymizeRequest?: boolean | null;
3338
- /** If present, indicates the action that triggered the event. */
3339
- originatedFrom?: string | null;
3340
- /**
3341
- * A sequence number defining the order of updates to the underlying entity.
3342
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
3343
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
3344
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
3345
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
3346
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3347
- */
3348
- entityEventSequence?: string | null;
3349
- }
3350
- /** @oneof */
3351
- interface DomainEventBodyOneOf$2 {
3352
- createdEvent?: EntityCreatedEvent$2;
3353
- updatedEvent?: EntityUpdatedEvent$2;
3354
- deletedEvent?: EntityDeletedEvent$2;
3355
- actionEvent?: ActionEvent$2;
3356
- }
3357
- interface EntityCreatedEvent$2 {
3358
- entity?: string;
3359
- }
3360
- interface RestoreInfo$2 {
3361
- deletedDate?: Date | null;
3362
- }
3363
- interface EntityUpdatedEvent$2 {
3364
- /**
3365
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
3366
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
3367
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
3368
- */
3369
- currentEntity?: string;
3370
- }
3371
- interface EntityDeletedEvent$2 {
3372
- /** Entity that was deleted */
3373
- deletedEntity?: string | null;
3374
- }
3375
- interface ActionEvent$2 {
3376
- body?: string;
3377
- }
3378
- interface Empty$1 {
3379
- }
3380
- interface SuccessfulReferralEvent$1 {
3381
- /** Details of the referred friend who completed their referral. */
3382
- referredFriendDetails?: ReferredFriendDetails$1;
3383
- }
3384
- interface ReferredFriendDetails$1 {
3385
- /**
3386
- * ID of the referred friend.
3387
- * @readonly
3388
- */
3389
- referredFriendId?: string;
3390
- /**
3391
- * Contact ID of the referred friend.
3392
- * @readonly
3393
- */
3394
- contactId?: string;
3395
- /**
3396
- * ID of the customer who referred this friend.
3397
- * @readonly
3398
- */
3399
- referringCustomerId?: string;
3400
- }
3401
- interface MessageEnvelope$2 {
3402
- /** App instance ID. */
3403
- instanceId?: string | null;
3404
- /** Event type. */
3405
- eventType?: string;
3406
- /** The identification type and identity data. */
3407
- identity?: IdentificationData$2;
3408
- /** Stringify payload. */
3409
- data?: string;
3410
- }
3411
- interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
3412
- /** ID of a site visitor that has not logged in to the site. */
3413
- anonymousVisitorId?: string;
3414
- /** ID of a site visitor that has logged in to the site. */
3415
- memberId?: string;
3416
- /** ID of a Wix user (site owner, contributor, etc.). */
3417
- wixUserId?: string;
3418
- /** ID of an app. */
3419
- appId?: string;
3420
- /** @readonly */
3421
- identityType?: WebhookIdentityType$2;
3422
- }
3423
- /** @oneof */
3424
- interface IdentificationDataIdOneOf$2 {
3425
- /** ID of a site visitor that has not logged in to the site. */
3426
- anonymousVisitorId?: string;
3427
- /** ID of a site visitor that has logged in to the site. */
3428
- memberId?: string;
3429
- /** ID of a Wix user (site owner, contributor, etc.). */
3430
- wixUserId?: string;
3431
- /** ID of an app. */
3432
- appId?: string;
3433
- }
3434
- declare enum WebhookIdentityType$2 {
3435
- UNKNOWN = "UNKNOWN",
3436
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
3437
- MEMBER = "MEMBER",
3438
- WIX_USER = "WIX_USER",
3439
- APP = "APP"
3440
- }
3441
- interface FixedAmountDiscountNonNullableFields {
3442
- amount: number;
3443
- }
3444
- interface PercentageDiscountNonNullableFields {
3445
- percentage: number;
3446
- }
3447
- interface GroupNonNullableFields {
3448
- name: string;
3449
- }
3450
- interface CouponScopeNonNullableFields {
3451
- namespace: string;
3452
- group?: GroupNonNullableFields;
3453
- }
3454
- interface CouponNonNullableFields {
3455
- fixedAmountOptions?: FixedAmountDiscountNonNullableFields;
3456
- percentageOptions?: PercentageDiscountNonNullableFields;
3457
- minimumSubtotal: number;
3458
- scope?: CouponScopeNonNullableFields;
3459
- name: string;
3460
- discountType: DiscountType;
3461
- }
3462
- interface V1CouponNonNullableFields {
3463
- _id: string;
3464
- code: string;
3465
- status: Status$1;
3466
- couponSpecification?: CouponNonNullableFields;
3467
- }
3468
- interface V1LoyaltyPointsNonNullableFields {
3469
- transactionId: string;
3470
- amount: number;
3471
- }
3472
- interface ReferralRewardNonNullableFields {
3473
- rewardedReferringCustomerId: string;
3474
- rewardedReferredFriendId: string;
3475
- coupon?: V1CouponNonNullableFields;
3476
- loyaltyPoints?: V1LoyaltyPointsNonNullableFields;
3477
- rewardType: RewardTypeType;
3478
- }
3479
- interface GetReferralRewardResponseNonNullableFields {
3480
- referralReward?: ReferralRewardNonNullableFields;
3481
- }
3482
- interface QueryReferralRewardsResponseNonNullableFields {
3483
- referralRewards: ReferralRewardNonNullableFields[];
3484
- }
3485
- interface QueryReferralRewardsOptions {
3486
- /** Contact ID to filter rewards by. Use `"me"` for current identity's rewards. */
3487
- contactId?: string | null | undefined;
3488
- }
3489
- interface QueryCursorResult$2 {
3490
- cursors: Cursors$2;
3491
- hasNext: () => boolean;
3492
- hasPrev: () => boolean;
3493
- length: number;
3494
- pageSize: number;
3495
- }
3496
- interface ReferralRewardsQueryResult extends QueryCursorResult$2 {
3497
- items: ReferralReward[];
3498
- query: ReferralRewardsQueryBuilder;
3499
- next: () => Promise<ReferralRewardsQueryResult>;
3500
- prev: () => Promise<ReferralRewardsQueryResult>;
3501
- }
3502
- interface ReferralRewardsQueryBuilder {
3503
- /** @param propertyName - Property whose value is compared with `value`.
3504
- * @param value - Value to compare against.
3505
- * @documentationMaturity preview
3506
- */
3507
- eq: (propertyName: 'rewardedReferringCustomerId' | 'rewardedReferredFriendId' | '_createdDate' | '_updatedDate' | 'rewardType', value: any) => ReferralRewardsQueryBuilder;
3508
- /** @param propertyName - Property whose value is compared with `value`.
3509
- * @param value - Value to compare against.
3510
- * @documentationMaturity preview
3511
- */
3512
- ne: (propertyName: 'rewardedReferringCustomerId' | 'rewardedReferredFriendId' | '_createdDate' | '_updatedDate' | 'rewardType', value: any) => ReferralRewardsQueryBuilder;
3513
- /** @param propertyName - Property whose value is compared with `value`.
3514
- * @param value - Value to compare against.
3515
- * @documentationMaturity preview
3516
- */
3517
- ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralRewardsQueryBuilder;
3518
- /** @param propertyName - Property whose value is compared with `value`.
3519
- * @param value - Value to compare against.
3520
- * @documentationMaturity preview
3521
- */
3522
- gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralRewardsQueryBuilder;
3523
- /** @param propertyName - Property whose value is compared with `value`.
3524
- * @param value - Value to compare against.
3525
- * @documentationMaturity preview
3526
- */
3527
- le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralRewardsQueryBuilder;
3528
- /** @param propertyName - Property whose value is compared with `value`.
3529
- * @param value - Value to compare against.
3530
- * @documentationMaturity preview
3531
- */
3532
- lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferralRewardsQueryBuilder;
3533
- /** @param propertyName - Property whose value is compared with `string`.
3534
- * @param string - String to compare against. Case-insensitive.
3535
- * @documentationMaturity preview
3536
- */
3537
- startsWith: (propertyName: 'rewardedReferringCustomerId' | 'rewardedReferredFriendId', value: string) => ReferralRewardsQueryBuilder;
3538
- /** @param propertyName - Property whose value is compared with `values`.
3539
- * @param values - List of values to compare against.
3540
- * @documentationMaturity preview
3541
- */
3542
- hasSome: (propertyName: 'rewardedReferringCustomerId' | 'rewardedReferredFriendId' | '_createdDate' | '_updatedDate' | 'rewardType', value: any[]) => ReferralRewardsQueryBuilder;
3543
- /** @documentationMaturity preview */
3544
- in: (propertyName: 'rewardedReferringCustomerId' | 'rewardedReferredFriendId' | '_createdDate' | '_updatedDate' | 'rewardType', value: any) => ReferralRewardsQueryBuilder;
3545
- /** @documentationMaturity preview */
3546
- exists: (propertyName: 'rewardedReferringCustomerId' | 'rewardedReferredFriendId' | '_createdDate' | '_updatedDate' | 'rewardType', value: boolean) => ReferralRewardsQueryBuilder;
3547
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
3548
- * @documentationMaturity preview
3549
- */
3550
- ascending: (...propertyNames: Array<'rewardedReferringCustomerId' | 'rewardedReferredFriendId' | '_createdDate' | '_updatedDate' | 'rewardType'>) => ReferralRewardsQueryBuilder;
3551
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
3552
- * @documentationMaturity preview
3553
- */
3554
- descending: (...propertyNames: Array<'rewardedReferringCustomerId' | 'rewardedReferredFriendId' | '_createdDate' | '_updatedDate' | 'rewardType'>) => ReferralRewardsQueryBuilder;
3555
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
3556
- * @documentationMaturity preview
3557
- */
3558
- limit: (limit: number) => ReferralRewardsQueryBuilder;
3559
- /** @param cursor - A pointer to specific record
3560
- * @documentationMaturity preview
3561
- */
3562
- skipTo: (cursor: string) => ReferralRewardsQueryBuilder;
3563
- /** @documentationMaturity preview */
3564
- find: () => Promise<ReferralRewardsQueryResult>;
3565
- }
3566
-
3567
- declare function getReferralReward$1(httpClient: HttpClient): GetReferralRewardSignature;
3568
- interface GetReferralRewardSignature {
3569
- /**
3570
- * Retrieves a referral reward.
3571
- * @param - Referral reward ID.
3572
- * @returns Retrieved referral reward.
3573
- */
3574
- (_id: string): Promise<ReferralReward & ReferralRewardNonNullableFields>;
3575
- }
3576
- declare function queryReferralRewards$1(httpClient: HttpClient): QueryReferralRewardsSignature;
3577
- interface QueryReferralRewardsSignature {
3578
- /**
3579
- * Creates a query to retrieve a list of referral rewards.
3580
- *
3581
- * The `queryReferralRewards()` function builds a query to retrieve a list of events and returns a `ReferralRewardsQueryBuilder` object.
3582
- *
3583
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
3584
- *
3585
- * You can refine the query by chaining `ReferralRewardsQueryBuilder` functions onto the query. `ReferralRewardsQueryBuilder` functions enable you to sort, filter, and control the results `queryReferralRewards()` returns.
3586
- *
3587
- * `queryReferralRewards()` runs with these `ReferralRewardsQueryBuilder` defaults, which you can override:
3588
- *
3589
- * - `limit(50)`
3590
- * - `descending("_createdDate")`
3591
- *
3592
- * The functions that are chained to `queryReferralRewards()` are applied in the order they're called. For example, if you apply ascending('rewardedReferredFriendId') and then descending('rewardType'), the results are sorted first by the referred friend ID, and then, if there are multiple results with the same ID, the items are sorted by reward type.
3593
- */
3594
- (options?: QueryReferralRewardsOptions | undefined): ReferralRewardsQueryBuilder;
3595
- }
3596
-
3597
- declare const getReferralReward: MaybeContext<BuildRESTFunction<typeof getReferralReward$1> & typeof getReferralReward$1>;
3598
- declare const queryReferralRewards: MaybeContext<BuildRESTFunction<typeof queryReferralRewards$1> & typeof queryReferralRewards$1>;
3599
-
3600
- type context$2_BulkGetReferralRewardsRequest = BulkGetReferralRewardsRequest;
3601
- type context$2_BulkGetReferralRewardsResponse = BulkGetReferralRewardsResponse;
3602
- type context$2_Coupon = Coupon;
3603
- type context$2_CouponDiscountTypeOptionsOneOf = CouponDiscountTypeOptionsOneOf;
3604
- type context$2_CouponScope = CouponScope;
3605
- type context$2_CouponScopeOrMinSubtotalOneOf = CouponScopeOrMinSubtotalOneOf;
3606
- type context$2_DiscountType = DiscountType;
3607
- declare const context$2_DiscountType: typeof DiscountType;
3608
- type context$2_FixedAmountDiscount = FixedAmountDiscount;
3609
- type context$2_GetReferralRewardRequest = GetReferralRewardRequest;
3610
- type context$2_GetReferralRewardResponse = GetReferralRewardResponse;
3611
- type context$2_GetReferralRewardResponseNonNullableFields = GetReferralRewardResponseNonNullableFields;
3612
- type context$2_Group = Group;
3613
- type context$2_LoyaltyPoints = LoyaltyPoints;
3614
- type context$2_PercentageDiscount = PercentageDiscount;
3615
- type context$2_QueryReferralRewardsOptions = QueryReferralRewardsOptions;
3616
- type context$2_QueryReferralRewardsRequest = QueryReferralRewardsRequest;
3617
- type context$2_QueryReferralRewardsResponse = QueryReferralRewardsResponse;
3618
- type context$2_QueryReferralRewardsResponseNonNullableFields = QueryReferralRewardsResponseNonNullableFields;
3619
- type context$2_ReferralReward = ReferralReward;
3620
- type context$2_ReferralRewardNonNullableFields = ReferralRewardNonNullableFields;
3621
- type context$2_ReferralRewardReceiverOneOf = ReferralRewardReceiverOneOf;
3622
- type context$2_ReferralRewardRewardTypeOptionsOneOf = ReferralRewardRewardTypeOptionsOneOf;
3623
- type context$2_ReferralRewardsQueryBuilder = ReferralRewardsQueryBuilder;
3624
- type context$2_ReferralRewardsQueryResult = ReferralRewardsQueryResult;
3625
- type context$2_Reward = Reward;
3626
- type context$2_RewardOptionsOneOf = RewardOptionsOneOf;
3627
- type context$2_RewardTypeType = RewardTypeType;
3628
- declare const context$2_RewardTypeType: typeof RewardTypeType;
3629
- type context$2_RewardsInSite = RewardsInSite;
3630
- type context$2_Type = Type;
3631
- declare const context$2_Type: typeof Type;
3632
- type context$2_V1Coupon = V1Coupon;
3633
- type context$2_V1LoyaltyPoints = V1LoyaltyPoints;
3634
- type context$2_ValidateReferralRewardRequest = ValidateReferralRewardRequest;
3635
- type context$2_ValidateReferralRewardResponse = ValidateReferralRewardResponse;
3636
- declare const context$2_getReferralReward: typeof getReferralReward;
3637
- declare const context$2_queryReferralRewards: typeof queryReferralRewards;
3638
- declare namespace context$2 {
3639
- 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 };
3640
- }
3641
-
3642
- interface ReferredFriend {
3643
- /**
3644
- * ID of the referred friend.
3645
- * @readonly
3646
- */
3647
- _id?: string;
3648
- /**
3649
- * Contact ID of the referred friend.
3650
- * @readonly
3651
- */
3652
- contactId?: string;
3653
- /**
3654
- * ID of the customer who referred this friend.
3655
- * @readonly
3656
- */
3657
- referringCustomerId?: string;
3658
- /** Status of the referred friend. */
3659
- status?: Status;
3660
- /**
3661
- * Revision number, which increments by 1 each time the referred friend is updated.
3662
- * To prevent conflicting changes, the current revision must be passed when updating the referred friend.
3663
- * @readonly
3664
- */
3665
- revision?: string | null;
3666
- /**
3667
- * Date and time the referred friend was created.
3668
- * @readonly
3669
- */
3670
- _createdDate?: Date | null;
3671
- /**
3672
- * Date and time the referred friend was last updated.
3673
- * @readonly
3674
- */
3675
- _updatedDate?: Date | null;
3676
- }
3677
- declare enum Status {
3678
- /** Unknown status. */
3679
- UNKNOWN = "UNKNOWN",
3680
- /** Initial status when the referred friend joins the site as a member. */
3681
- SIGN_UP_COMPLETED = "SIGN_UP_COMPLETED",
3682
- /** Status after the referred friend completes a specific action, such as making a purchase. */
3683
- ACTIONS_COMPLETED = "ACTIONS_COMPLETED"
3684
- }
3685
- interface CreateReferredFriendRequest {
3686
- /** Referral code for the referred friend. */
3687
- referralCode?: string | null;
3688
- }
3689
- interface CreateReferredFriendResponse {
3690
- /** Created referred friend. */
3691
- referredFriend?: ReferredFriend;
3692
- }
3693
- interface GetReferredFriendRequest {
3694
- /** ID of the referred friend to retrieve. */
3695
- referredFriendId: string;
3696
- }
3697
- interface GetReferredFriendResponse {
3698
- /** Retrieved referred friend. */
3699
- referredFriend?: ReferredFriend;
3700
- }
3701
- interface GetReferredFriendByContactIdRequest {
3702
- /** Contact ID or "me" to get the current identity's contact. */
3703
- contactId: string;
3704
- }
3705
- interface GetReferredFriendByContactIdResponse {
3706
- /** Retrieved referred friend. */
3707
- referredFriend?: ReferredFriend;
3708
- }
3709
- interface UpdateReferredFriendRequest {
3710
- /** Referred friend to be updated. May be partial. */
3711
- referredFriend: ReferredFriend;
3712
- }
3713
- interface UpdateReferredFriendResponse {
3714
- /** Updated referred friend. */
3715
- referredFriend?: ReferredFriend;
3716
- }
3717
- interface DeleteReferredFriendRequest {
3718
- /** ID of the referred friend to delete. */
3719
- referredFriendId: string;
3720
- /**
3721
- * Revision number, which increments by 1 each time the referred friend is updated.
3722
- * To prevent conflicting changes, the current revision must be passed when deleting the referred friend.
3723
- */
3724
- revision?: string;
3725
- }
3726
- interface DeleteReferredFriendResponse {
3727
- }
3728
- interface QueryReferredFriendRequest {
3729
- /** Query options. */
3730
- query: CursorQuery$1;
3731
- }
3732
- interface CursorQuery$1 extends CursorQueryPagingMethodOneOf$1 {
3733
- /**
3734
- * Cursor paging options.
3735
- *
3736
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
3737
- */
3738
- cursorPaging?: CursorPaging$1;
3739
- /**
3740
- * Filter object.
3741
- *
3742
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
3743
- */
3744
- filter?: Record<string, any> | null;
3745
- /**
3746
- * Sort object.
3747
- *
3748
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
3749
- */
3750
- sort?: Sorting$1[];
3751
- }
3752
- /** @oneof */
3753
- interface CursorQueryPagingMethodOneOf$1 {
3754
- /**
3755
- * Cursor paging options.
3756
- *
3757
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
3758
- */
3759
- cursorPaging?: CursorPaging$1;
3760
- }
3761
- interface Sorting$1 {
3762
- /** Name of the field to sort by. */
3763
- fieldName?: string;
3764
- /** Sort order. */
3765
- order?: SortOrder$1;
3766
- }
3767
- declare enum SortOrder$1 {
3768
- ASC = "ASC",
3769
- DESC = "DESC"
3770
- }
3771
- interface CursorPaging$1 {
3772
- /** Maximum number of items to return in the results. */
3773
- limit?: number | null;
3774
- /**
3775
- * Pointer to the next or previous page in the list of results.
3776
- *
3777
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
3778
- * Not relevant for the first request.
3779
- */
3780
- cursor?: string | null;
3781
- }
3782
- interface QueryReferredFriendResponse {
3783
- /** Retrieved referred friends. */
3784
- referredFriends?: ReferredFriend[];
3785
- /** Cursor paging metadata. */
3786
- metadata?: CursorPagingMetadata$1;
3787
- }
3788
- interface CursorPagingMetadata$1 {
3789
- /** Number of items returned in current page. */
3790
- count?: number | null;
3791
- /** Cursor strings that point to the next page, previous page, or both. */
3792
- cursors?: Cursors$1;
3793
- /**
3794
- * Whether there are more pages to retrieve following the current page.
3795
- *
3796
- * + `true`: Another page of results can be retrieved.
3797
- * + `false`: This is the last page.
3798
- */
3799
- hasNext?: boolean | null;
3800
- }
3801
- interface Cursors$1 {
3802
- /** Cursor string pointing to the next page in the list of results. */
3803
- next?: string | null;
3804
- /** Cursor pointing to the previous page in the list of results. */
3805
- prev?: string | null;
3806
- }
3807
- interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
3808
- createdEvent?: EntityCreatedEvent$1;
3809
- updatedEvent?: EntityUpdatedEvent$1;
3810
- deletedEvent?: EntityDeletedEvent$1;
3811
- actionEvent?: ActionEvent$1;
3812
- /**
3813
- * Unique event ID.
3814
- * Allows clients to ignore duplicate webhooks.
3815
- */
3816
- _id?: string;
3817
- /**
3818
- * Assumes actions are also always typed to an entity_type
3819
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
3820
- */
3821
- entityFqdn?: string;
3822
- /**
3823
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3824
- * This is although the created/updated/deleted notion is duplication of the oneof types
3825
- * Example: created/updated/deleted/started/completed/email_opened
3826
- */
3827
- slug?: string;
3828
- /** ID of the entity associated with the event. */
3829
- entityId?: string;
3830
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3831
- eventTime?: Date | null;
3832
- /**
3833
- * Whether the event was triggered as a result of a privacy regulation application
3834
- * (for example, GDPR).
3835
- */
3836
- triggeredByAnonymizeRequest?: boolean | null;
3837
- /** If present, indicates the action that triggered the event. */
3838
- originatedFrom?: string | null;
3839
- /**
3840
- * A sequence number defining the order of updates to the underlying entity.
3841
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
3842
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
3843
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
3844
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
3845
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
3846
- */
3847
- entityEventSequence?: string | null;
3848
- }
3849
- /** @oneof */
3850
- interface DomainEventBodyOneOf$1 {
3851
- createdEvent?: EntityCreatedEvent$1;
3852
- updatedEvent?: EntityUpdatedEvent$1;
3853
- deletedEvent?: EntityDeletedEvent$1;
3854
- actionEvent?: ActionEvent$1;
3855
- }
3856
- interface EntityCreatedEvent$1 {
3857
- entity?: string;
3858
- }
3859
- interface RestoreInfo$1 {
3860
- deletedDate?: Date | null;
3861
- }
3862
- interface EntityUpdatedEvent$1 {
3863
- /**
3864
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
3865
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
3866
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
3867
- */
3868
- currentEntity?: string;
3869
- }
3870
- interface EntityDeletedEvent$1 {
3871
- /** Entity that was deleted */
3872
- deletedEntity?: string | null;
3873
- }
3874
- interface ActionEvent$1 {
3875
- body?: string;
3876
- }
3877
- interface Empty {
3878
- }
3879
- interface SuccessfulReferralEvent {
3880
- /** Details of the referred friend who completed their referral. */
3881
- referredFriendDetails?: ReferredFriendDetails;
3882
- }
3883
- interface ReferredFriendDetails {
3884
- /**
3885
- * ID of the referred friend.
3886
- * @readonly
3887
- */
3888
- referredFriendId?: string;
3889
- /**
3890
- * Contact ID of the referred friend.
3891
- * @readonly
3892
- */
3893
- contactId?: string;
3894
- /**
3895
- * ID of the customer who referred this friend.
3896
- * @readonly
3897
- */
3898
- referringCustomerId?: string;
3899
- }
3900
- interface MessageEnvelope$1 {
3901
- /** App instance ID. */
3902
- instanceId?: string | null;
3903
- /** Event type. */
3904
- eventType?: string;
3905
- /** The identification type and identity data. */
3906
- identity?: IdentificationData$1;
3907
- /** Stringify payload. */
3908
- data?: string;
3909
- }
3910
- interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
3911
- /** ID of a site visitor that has not logged in to the site. */
3912
- anonymousVisitorId?: string;
3913
- /** ID of a site visitor that has logged in to the site. */
3914
- memberId?: string;
3915
- /** ID of a Wix user (site owner, contributor, etc.). */
3916
- wixUserId?: string;
3917
- /** ID of an app. */
3918
- appId?: string;
3919
- /** @readonly */
3920
- identityType?: WebhookIdentityType$1;
3921
- }
3922
- /** @oneof */
3923
- interface IdentificationDataIdOneOf$1 {
3924
- /** ID of a site visitor that has not logged in to the site. */
3925
- anonymousVisitorId?: string;
3926
- /** ID of a site visitor that has logged in to the site. */
3927
- memberId?: string;
3928
- /** ID of a Wix user (site owner, contributor, etc.). */
3929
- wixUserId?: string;
3930
- /** ID of an app. */
3931
- appId?: string;
3932
- }
3933
- declare enum WebhookIdentityType$1 {
3934
- UNKNOWN = "UNKNOWN",
3935
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
3936
- MEMBER = "MEMBER",
3937
- WIX_USER = "WIX_USER",
3938
- APP = "APP"
3939
- }
3940
- interface ReferredFriendNonNullableFields {
3941
- _id: string;
3942
- contactId: string;
3943
- referringCustomerId: string;
3944
- status: Status;
3945
- }
3946
- interface CreateReferredFriendResponseNonNullableFields {
3947
- referredFriend?: ReferredFriendNonNullableFields;
3948
- }
3949
- interface GetReferredFriendResponseNonNullableFields {
3950
- referredFriend?: ReferredFriendNonNullableFields;
3951
- }
3952
- interface GetReferredFriendByContactIdResponseNonNullableFields {
3953
- referredFriend?: ReferredFriendNonNullableFields;
3954
- }
3955
- interface UpdateReferredFriendResponseNonNullableFields {
3956
- referredFriend?: ReferredFriendNonNullableFields;
3957
- }
3958
- interface QueryReferredFriendResponseNonNullableFields {
3959
- referredFriends: ReferredFriendNonNullableFields[];
3960
- }
3961
- interface BaseEventMetadata$1 {
3962
- /** App instance ID. */
3963
- instanceId?: string | null;
3964
- /** Event type. */
3965
- eventType?: string;
3966
- /** The identification type and identity data. */
3967
- identity?: IdentificationData$1;
3968
- }
3969
- interface EventMetadata$1 extends BaseEventMetadata$1 {
3970
- /**
3971
- * Unique event ID.
3972
- * Allows clients to ignore duplicate webhooks.
3973
- */
3974
- _id?: string;
3975
- /**
3976
- * Assumes actions are also always typed to an entity_type
3977
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
3978
- */
3979
- entityFqdn?: string;
3980
- /**
3981
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
3982
- * This is although the created/updated/deleted notion is duplication of the oneof types
3983
- * Example: created/updated/deleted/started/completed/email_opened
3984
- */
3985
- slug?: string;
3986
- /** ID of the entity associated with the event. */
3987
- entityId?: string;
3988
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
3989
- eventTime?: Date | null;
3990
- /**
3991
- * Whether the event was triggered as a result of a privacy regulation application
3992
- * (for example, GDPR).
3993
- */
3994
- triggeredByAnonymizeRequest?: boolean | null;
3995
- /** If present, indicates the action that triggered the event. */
3996
- originatedFrom?: string | null;
3997
- /**
3998
- * A sequence number defining the order of updates to the underlying entity.
3999
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
4000
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
4001
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
4002
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
4003
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
4004
- */
4005
- entityEventSequence?: string | null;
4006
- }
4007
- interface ReferredFriendCreatedEnvelope {
4008
- entity: ReferredFriend;
4009
- metadata: EventMetadata$1;
4010
- }
4011
- interface ReferredFriendDeletedEnvelope {
4012
- metadata: EventMetadata$1;
4013
- }
4014
- interface ReferredFriendUpdatedEnvelope {
4015
- entity: ReferredFriend;
4016
- metadata: EventMetadata$1;
4017
- }
4018
- interface CreateReferredFriendOptions {
4019
- /** Referral code for the referred friend. */
4020
- referralCode?: string | null;
4021
- }
4022
- interface UpdateReferredFriend {
4023
- /**
4024
- * ID of the referred friend.
4025
- * @readonly
4026
- */
4027
- _id?: string;
4028
- /**
4029
- * Contact ID of the referred friend.
4030
- * @readonly
4031
- */
4032
- contactId?: string;
4033
- /**
4034
- * ID of the customer who referred this friend.
4035
- * @readonly
4036
- */
4037
- referringCustomerId?: string;
4038
- /** Status of the referred friend. */
4039
- status?: Status;
4040
- /**
4041
- * Revision number, which increments by 1 each time the referred friend is updated.
4042
- * To prevent conflicting changes, the current revision must be passed when updating the referred friend.
4043
- * @readonly
4044
- */
4045
- revision?: string | null;
4046
- /**
4047
- * Date and time the referred friend was created.
4048
- * @readonly
4049
- */
4050
- _createdDate?: Date | null;
4051
- /**
4052
- * Date and time the referred friend was last updated.
4053
- * @readonly
4054
- */
4055
- _updatedDate?: Date | null;
4056
- }
4057
- interface DeleteReferredFriendOptions {
4058
- /**
4059
- * Revision number, which increments by 1 each time the referred friend is updated.
4060
- * To prevent conflicting changes, the current revision must be passed when deleting the referred friend.
4061
- */
4062
- revision?: string;
4063
- }
4064
- interface QueryCursorResult$1 {
4065
- cursors: Cursors$1;
4066
- hasNext: () => boolean;
4067
- hasPrev: () => boolean;
4068
- length: number;
4069
- pageSize: number;
4070
- }
4071
- interface ReferredFriendsQueryResult extends QueryCursorResult$1 {
4072
- items: ReferredFriend[];
4073
- query: ReferredFriendsQueryBuilder;
4074
- next: () => Promise<ReferredFriendsQueryResult>;
4075
- prev: () => Promise<ReferredFriendsQueryResult>;
4076
- }
4077
- interface ReferredFriendsQueryBuilder {
4078
- /** @param propertyName - Property whose value is compared with `value`.
4079
- * @param value - Value to compare against.
4080
- * @documentationMaturity preview
4081
- */
4082
- eq: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
4083
- /** @param propertyName - Property whose value is compared with `value`.
4084
- * @param value - Value to compare against.
4085
- * @documentationMaturity preview
4086
- */
4087
- ne: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
4088
- /** @param propertyName - Property whose value is compared with `value`.
4089
- * @param value - Value to compare against.
4090
- * @documentationMaturity preview
4091
- */
4092
- ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
4093
- /** @param propertyName - Property whose value is compared with `value`.
4094
- * @param value - Value to compare against.
4095
- * @documentationMaturity preview
4096
- */
4097
- gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
4098
- /** @param propertyName - Property whose value is compared with `value`.
4099
- * @param value - Value to compare against.
4100
- * @documentationMaturity preview
4101
- */
4102
- le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
4103
- /** @param propertyName - Property whose value is compared with `value`.
4104
- * @param value - Value to compare against.
4105
- * @documentationMaturity preview
4106
- */
4107
- lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
4108
- /** @param propertyName - Property whose value is compared with `string`.
4109
- * @param string - String to compare against. Case-insensitive.
4110
- * @documentationMaturity preview
4111
- */
4112
- startsWith: (propertyName: 'referringCustomerId', value: string) => ReferredFriendsQueryBuilder;
4113
- /** @param propertyName - Property whose value is compared with `values`.
4114
- * @param values - List of values to compare against.
4115
- * @documentationMaturity preview
4116
- */
4117
- hasSome: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any[]) => ReferredFriendsQueryBuilder;
4118
- /** @documentationMaturity preview */
4119
- in: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: any) => ReferredFriendsQueryBuilder;
4120
- /** @documentationMaturity preview */
4121
- exists: (propertyName: 'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate', value: boolean) => ReferredFriendsQueryBuilder;
4122
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
4123
- * @documentationMaturity preview
4124
- */
4125
- ascending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
4126
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
4127
- * @documentationMaturity preview
4128
- */
4129
- descending: (...propertyNames: Array<'referringCustomerId' | 'status' | '_createdDate' | '_updatedDate'>) => ReferredFriendsQueryBuilder;
4130
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
4131
- * @documentationMaturity preview
4132
- */
4133
- limit: (limit: number) => ReferredFriendsQueryBuilder;
4134
- /** @param cursor - A pointer to specific record
4135
- * @documentationMaturity preview
4136
- */
4137
- skipTo: (cursor: string) => ReferredFriendsQueryBuilder;
4138
- /** @documentationMaturity preview */
4139
- find: () => Promise<ReferredFriendsQueryResult>;
4140
- }
4141
-
4142
- declare function createReferredFriend$1(httpClient: HttpClient): CreateReferredFriendSignature;
4143
- interface CreateReferredFriendSignature {
4144
- /**
4145
- * Creates a new referred friend or returns an existing entity if it already exists.
4146
- *
4147
- * This method must be called with a [member identity](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities#site-members).
4148
- *
4149
- * A referral code must be provided either in the request or via scope.
4150
- *
4151
- * The member must be eligible to become a referred friend.
4152
- */
4153
- (options?: CreateReferredFriendOptions | undefined): Promise<CreateReferredFriendResponse & CreateReferredFriendResponseNonNullableFields>;
4154
- }
4155
- declare function getReferredFriend$1(httpClient: HttpClient): GetReferredFriendSignature;
4156
- interface GetReferredFriendSignature {
4157
- /**
4158
- * Retrieves a referred friend by ID.
4159
- * @param - ID of the referred friend to retrieve.
4160
- * @returns Retrieved referred friend.
4161
- */
4162
- (referredFriendId: string): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
4163
- }
4164
- declare function getReferredFriendByContactId$1(httpClient: HttpClient): GetReferredFriendByContactIdSignature;
4165
- interface GetReferredFriendByContactIdSignature {
4166
- /**
4167
- * Retrieves a referred friend by contact ID.
4168
- *
4169
- * You can use `me` instead of a specific contact ID to get the referred friend for the current identity's contact.
4170
- * @param - Contact ID or "me" to get the current identity's contact.
4171
- */
4172
- (contactId: string): Promise<GetReferredFriendByContactIdResponse & GetReferredFriendByContactIdResponseNonNullableFields>;
4173
- }
4174
- declare function updateReferredFriend$1(httpClient: HttpClient): UpdateReferredFriendSignature;
4175
- interface UpdateReferredFriendSignature {
4176
- /**
4177
- * Updates a referred friend. Supports partial updates.
4178
- *
4179
- * You must pass the latest `revision` for a successful update.
4180
- * @param - ID of the referred friend.
4181
- * @returns Updated referred friend.
4182
- */
4183
- (_id: string, referredFriend: UpdateReferredFriend): Promise<ReferredFriend & ReferredFriendNonNullableFields>;
4184
- }
4185
- declare function deleteReferredFriend$1(httpClient: HttpClient): DeleteReferredFriendSignature;
4186
- interface DeleteReferredFriendSignature {
4187
- /**
4188
- * Deletes a referred friend.
4189
- * @param - ID of the referred friend to delete.
4190
- */
4191
- (referredFriendId: string, options?: DeleteReferredFriendOptions | undefined): Promise<void>;
4192
- }
4193
- declare function queryReferredFriend$1(httpClient: HttpClient): QueryReferredFriendSignature;
4194
- interface QueryReferredFriendSignature {
4195
- /**
4196
- * Creates a query to retrieve a list of referred friends.
4197
- *
4198
- * The `queryReferredFriend()` function builds a query to retrieve a list of events and returns a `ReferredFriendsQueryBuilder` object.
4199
- *
4200
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
4201
- *
4202
- * You can refine the query by chaining `ReferredFriendsQueryBuilder` functions onto the query. `ReferredFriendsQueryBuilder` functions enable you to sort, filter, and control the results `queryReferredFriend()` returns.
4203
- *
4204
- * `queryReferredFriend()` runs with these `ReferredFriendQueryBuilder` defaults, which you can override:
4205
- *
4206
- * - `limit(50)`
4207
- * - `descending("_createdDate")`
4208
- *
4209
- * The functions that are chained to `queryReferredFriend()` are applied in the order they're called. For example, if you apply ascending('status') and then descending('referringCustomerId'), the results are sorted first by the status, and then, if there are multiple results with the same status, the items are sorted by referring customer ID.
4210
- */
4211
- (): ReferredFriendsQueryBuilder;
4212
- }
4213
- declare const onReferredFriendCreated$1: EventDefinition<ReferredFriendCreatedEnvelope, "wix.loyalty.referral.v1.referred_friend_created">;
4214
- declare const onReferredFriendDeleted$1: EventDefinition<ReferredFriendDeletedEnvelope, "wix.loyalty.referral.v1.referred_friend_deleted">;
4215
- declare const onReferredFriendUpdated$1: EventDefinition<ReferredFriendUpdatedEnvelope, "wix.loyalty.referral.v1.referred_friend_updated">;
4216
-
4217
- declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4218
-
4219
- declare const createReferredFriend: MaybeContext<BuildRESTFunction<typeof createReferredFriend$1> & typeof createReferredFriend$1>;
4220
- declare const getReferredFriend: MaybeContext<BuildRESTFunction<typeof getReferredFriend$1> & typeof getReferredFriend$1>;
4221
- declare const getReferredFriendByContactId: MaybeContext<BuildRESTFunction<typeof getReferredFriendByContactId$1> & typeof getReferredFriendByContactId$1>;
4222
- declare const updateReferredFriend: MaybeContext<BuildRESTFunction<typeof updateReferredFriend$1> & typeof updateReferredFriend$1>;
4223
- declare const deleteReferredFriend: MaybeContext<BuildRESTFunction<typeof deleteReferredFriend$1> & typeof deleteReferredFriend$1>;
4224
- declare const queryReferredFriend: MaybeContext<BuildRESTFunction<typeof queryReferredFriend$1> & typeof queryReferredFriend$1>;
4225
-
4226
- type _publicOnReferredFriendCreatedType = typeof onReferredFriendCreated$1;
4227
- /**
4228
- * Triggered when a referred friend is created.
4229
- */
4230
- declare const onReferredFriendCreated: ReturnType<typeof createEventModule$1<_publicOnReferredFriendCreatedType>>;
4231
-
4232
- type _publicOnReferredFriendDeletedType = typeof onReferredFriendDeleted$1;
4233
- /**
4234
- * Triggered when a referred friend is deleted.
4235
- */
4236
- declare const onReferredFriendDeleted: ReturnType<typeof createEventModule$1<_publicOnReferredFriendDeletedType>>;
4237
-
4238
- type _publicOnReferredFriendUpdatedType = typeof onReferredFriendUpdated$1;
4239
- /**
4240
- * Triggered when a referred friend is updated.
4241
- */
4242
- declare const onReferredFriendUpdated: ReturnType<typeof createEventModule$1<_publicOnReferredFriendUpdatedType>>;
4243
-
4244
- type context$1_CreateReferredFriendOptions = CreateReferredFriendOptions;
4245
- type context$1_CreateReferredFriendRequest = CreateReferredFriendRequest;
4246
- type context$1_CreateReferredFriendResponse = CreateReferredFriendResponse;
4247
- type context$1_CreateReferredFriendResponseNonNullableFields = CreateReferredFriendResponseNonNullableFields;
4248
- type context$1_DeleteReferredFriendOptions = DeleteReferredFriendOptions;
4249
- type context$1_DeleteReferredFriendRequest = DeleteReferredFriendRequest;
4250
- type context$1_DeleteReferredFriendResponse = DeleteReferredFriendResponse;
4251
- type context$1_Empty = Empty;
4252
- type context$1_GetReferredFriendByContactIdRequest = GetReferredFriendByContactIdRequest;
4253
- type context$1_GetReferredFriendByContactIdResponse = GetReferredFriendByContactIdResponse;
4254
- type context$1_GetReferredFriendByContactIdResponseNonNullableFields = GetReferredFriendByContactIdResponseNonNullableFields;
4255
- type context$1_GetReferredFriendRequest = GetReferredFriendRequest;
4256
- type context$1_GetReferredFriendResponse = GetReferredFriendResponse;
4257
- type context$1_GetReferredFriendResponseNonNullableFields = GetReferredFriendResponseNonNullableFields;
4258
- type context$1_QueryReferredFriendRequest = QueryReferredFriendRequest;
4259
- type context$1_QueryReferredFriendResponse = QueryReferredFriendResponse;
4260
- type context$1_QueryReferredFriendResponseNonNullableFields = QueryReferredFriendResponseNonNullableFields;
4261
- type context$1_ReferredFriend = ReferredFriend;
4262
- type context$1_ReferredFriendCreatedEnvelope = ReferredFriendCreatedEnvelope;
4263
- type context$1_ReferredFriendDeletedEnvelope = ReferredFriendDeletedEnvelope;
4264
- type context$1_ReferredFriendDetails = ReferredFriendDetails;
4265
- type context$1_ReferredFriendNonNullableFields = ReferredFriendNonNullableFields;
4266
- type context$1_ReferredFriendUpdatedEnvelope = ReferredFriendUpdatedEnvelope;
4267
- type context$1_ReferredFriendsQueryBuilder = ReferredFriendsQueryBuilder;
4268
- type context$1_ReferredFriendsQueryResult = ReferredFriendsQueryResult;
4269
- type context$1_Status = Status;
4270
- declare const context$1_Status: typeof Status;
4271
- type context$1_SuccessfulReferralEvent = SuccessfulReferralEvent;
4272
- type context$1_UpdateReferredFriend = UpdateReferredFriend;
4273
- type context$1_UpdateReferredFriendRequest = UpdateReferredFriendRequest;
4274
- type context$1_UpdateReferredFriendResponse = UpdateReferredFriendResponse;
4275
- type context$1_UpdateReferredFriendResponseNonNullableFields = UpdateReferredFriendResponseNonNullableFields;
4276
- type context$1__publicOnReferredFriendCreatedType = _publicOnReferredFriendCreatedType;
4277
- type context$1__publicOnReferredFriendDeletedType = _publicOnReferredFriendDeletedType;
4278
- type context$1__publicOnReferredFriendUpdatedType = _publicOnReferredFriendUpdatedType;
4279
- declare const context$1_createReferredFriend: typeof createReferredFriend;
4280
- declare const context$1_deleteReferredFriend: typeof deleteReferredFriend;
4281
- declare const context$1_getReferredFriend: typeof getReferredFriend;
4282
- declare const context$1_getReferredFriendByContactId: typeof getReferredFriendByContactId;
4283
- declare const context$1_onReferredFriendCreated: typeof onReferredFriendCreated;
4284
- declare const context$1_onReferredFriendDeleted: typeof onReferredFriendDeleted;
4285
- declare const context$1_onReferredFriendUpdated: typeof onReferredFriendUpdated;
4286
- declare const context$1_queryReferredFriend: typeof queryReferredFriend;
4287
- declare const context$1_updateReferredFriend: typeof updateReferredFriend;
4288
- declare namespace context$1 {
4289
- 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 };
4290
- }
4291
-
4292
- interface ReferringCustomer {
4293
- /**
4294
- * ID of the referring customer.
4295
- * @readonly
4296
- */
4297
- _id?: string;
4298
- /**
4299
- * Contact ID associated with the referring customer.
4300
- * @readonly
4301
- */
4302
- contactId?: string;
4303
- /**
4304
- * Unique code for the referral. For example, `GxpxwAoMqxH8`.
4305
- * @readonly
4306
- */
4307
- referralCode?: string;
4308
- /**
4309
- * Revision number, which increments by 1 each time the referring customer is updated.
4310
- * To prevent conflicting changes, the current revision must be passed when updating the referring customer.
4311
- */
4312
- revision?: string | null;
4313
- /**
4314
- * Date and time the referring customer was created.
4315
- * @readonly
4316
- */
4317
- _createdDate?: Date | null;
4318
- /**
4319
- * Date and time the referring customer was last updated.
4320
- * @readonly
4321
- */
4322
- _updatedDate?: Date | null;
4323
- }
4324
- interface GenerateReferringCustomerForContactRequest {
4325
- /** Contact ID or `"me"` to generate the current identity's referring customer. */
4326
- contactId: string;
4327
- }
4328
- interface GenerateReferringCustomerForContactResponse {
4329
- /** Created referring customer. */
4330
- referringCustomer?: ReferringCustomer;
4331
- }
4332
- interface GetReferringCustomerRequest {
4333
- /** ID of the referring customer to retrieve. */
4334
- referringCustomerId: string;
4335
- }
4336
- interface GetReferringCustomerResponse {
4337
- /** Retrieved referring customer. */
4338
- referringCustomer?: ReferringCustomer;
4339
- }
4340
- interface GetReferringCustomerByReferralCodeRequest {
4341
- /** Referral code of the referring customer to retrieve. */
4342
- referralCode: string;
4343
- }
4344
- interface GetReferringCustomerByReferralCodeResponse {
4345
- /** Retrieved referring customer. */
4346
- referringCustomer?: ReferringCustomer;
4347
- }
4348
- interface QueryReferringCustomersRequest {
4349
- /** Query options. */
4350
- query: CursorQuery;
4351
- }
4352
- interface CursorQuery extends CursorQueryPagingMethodOneOf {
4353
- /**
4354
- * Cursor paging options.
4355
- *
4356
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
4357
- */
4358
- cursorPaging?: CursorPaging;
4359
- /**
4360
- * Filter object.
4361
- *
4362
- * Learn more about the [filter section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-filter-section).
4363
- */
4364
- filter?: Record<string, any> | null;
4365
- /**
4366
- * Sort object.
4367
- *
4368
- * Learn more about the [sort section](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#the-sort-section).
4369
- */
4370
- sort?: Sorting[];
4371
- }
4372
- /** @oneof */
4373
- interface CursorQueryPagingMethodOneOf {
4374
- /**
4375
- * Cursor paging options.
4376
- *
4377
- * Learn more about [cursor paging](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#cursor-paging).
4378
- */
4379
- cursorPaging?: CursorPaging;
4380
- }
4381
- interface Sorting {
4382
- /** Name of the field to sort by. */
4383
- fieldName?: string;
4384
- /** Sort order. */
4385
- order?: SortOrder;
4386
- }
4387
- declare enum SortOrder {
4388
- ASC = "ASC",
4389
- DESC = "DESC"
4390
- }
4391
- interface CursorPaging {
4392
- /** Maximum number of items to return in the results. */
4393
- limit?: number | null;
4394
- /**
4395
- * Pointer to the next or previous page in the list of results.
4396
- *
4397
- * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
4398
- * Not relevant for the first request.
4399
- */
4400
- cursor?: string | null;
4401
- }
4402
- interface QueryReferringCustomersResponse {
4403
- /** List of retrieved referring customers. */
4404
- referringCustomers?: ReferringCustomer[];
4405
- /** Paging metadata. */
4406
- metadata?: CursorPagingMetadata;
4407
- }
4408
- interface CursorPagingMetadata {
4409
- /** Number of items returned in current page. */
4410
- count?: number | null;
4411
- /** Cursor strings that point to the next page, previous page, or both. */
4412
- cursors?: Cursors;
4413
- /**
4414
- * Whether there are more pages to retrieve following the current page.
4415
- *
4416
- * + `true`: Another page of results can be retrieved.
4417
- * + `false`: This is the last page.
4418
- */
4419
- hasNext?: boolean | null;
4420
- }
4421
- interface Cursors {
4422
- /** Cursor string pointing to the next page in the list of results. */
4423
- next?: string | null;
4424
- /** Cursor pointing to the previous page in the list of results. */
4425
- prev?: string | null;
4426
- }
4427
- interface DeleteReferringCustomerRequest {
4428
- /** ID of the referring customer to delete. */
4429
- referringCustomerId: string;
4430
- /** Revision number of the referring customer. */
4431
- revision?: string;
4432
- }
4433
- interface DeleteReferringCustomerResponse {
4434
- }
4435
- interface DomainEvent extends DomainEventBodyOneOf {
4436
- createdEvent?: EntityCreatedEvent;
4437
- updatedEvent?: EntityUpdatedEvent;
4438
- deletedEvent?: EntityDeletedEvent;
4439
- actionEvent?: ActionEvent;
4440
- /**
4441
- * Unique event ID.
4442
- * Allows clients to ignore duplicate webhooks.
4443
- */
4444
- _id?: string;
4445
- /**
4446
- * Assumes actions are also always typed to an entity_type
4447
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
4448
- */
4449
- entityFqdn?: string;
4450
- /**
4451
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
4452
- * This is although the created/updated/deleted notion is duplication of the oneof types
4453
- * Example: created/updated/deleted/started/completed/email_opened
4454
- */
4455
- slug?: string;
4456
- /** ID of the entity associated with the event. */
4457
- entityId?: string;
4458
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
4459
- eventTime?: Date | null;
4460
- /**
4461
- * Whether the event was triggered as a result of a privacy regulation application
4462
- * (for example, GDPR).
4463
- */
4464
- triggeredByAnonymizeRequest?: boolean | null;
4465
- /** If present, indicates the action that triggered the event. */
4466
- originatedFrom?: string | null;
4467
- /**
4468
- * A sequence number defining the order of updates to the underlying entity.
4469
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
4470
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
4471
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
4472
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
4473
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
4474
- */
4475
- entityEventSequence?: string | null;
4476
- }
4477
- /** @oneof */
4478
- interface DomainEventBodyOneOf {
4479
- createdEvent?: EntityCreatedEvent;
4480
- updatedEvent?: EntityUpdatedEvent;
4481
- deletedEvent?: EntityDeletedEvent;
4482
- actionEvent?: ActionEvent;
4483
- }
4484
- interface EntityCreatedEvent {
4485
- entity?: string;
4486
- }
4487
- interface RestoreInfo {
4488
- deletedDate?: Date | null;
4489
- }
4490
- interface EntityUpdatedEvent {
4491
- /**
4492
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
4493
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
4494
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
4495
- */
4496
- currentEntity?: string;
4497
- }
4498
- interface EntityDeletedEvent {
4499
- /** Entity that was deleted */
4500
- deletedEntity?: string | null;
4501
- }
4502
- interface ActionEvent {
4503
- body?: string;
4504
- }
4505
- interface MessageEnvelope {
4506
- /** App instance ID. */
4507
- instanceId?: string | null;
4508
- /** Event type. */
4509
- eventType?: string;
4510
- /** The identification type and identity data. */
4511
- identity?: IdentificationData;
4512
- /** Stringify payload. */
4513
- data?: string;
4514
- }
4515
- interface IdentificationData extends IdentificationDataIdOneOf {
4516
- /** ID of a site visitor that has not logged in to the site. */
4517
- anonymousVisitorId?: string;
4518
- /** ID of a site visitor that has logged in to the site. */
4519
- memberId?: string;
4520
- /** ID of a Wix user (site owner, contributor, etc.). */
4521
- wixUserId?: string;
4522
- /** ID of an app. */
4523
- appId?: string;
4524
- /** @readonly */
4525
- identityType?: WebhookIdentityType;
4526
- }
4527
- /** @oneof */
4528
- interface IdentificationDataIdOneOf {
4529
- /** ID of a site visitor that has not logged in to the site. */
4530
- anonymousVisitorId?: string;
4531
- /** ID of a site visitor that has logged in to the site. */
4532
- memberId?: string;
4533
- /** ID of a Wix user (site owner, contributor, etc.). */
4534
- wixUserId?: string;
4535
- /** ID of an app. */
4536
- appId?: string;
4537
- }
4538
- declare enum WebhookIdentityType {
4539
- UNKNOWN = "UNKNOWN",
4540
- ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
4541
- MEMBER = "MEMBER",
4542
- WIX_USER = "WIX_USER",
4543
- APP = "APP"
4544
- }
4545
- interface ReferringCustomerNonNullableFields {
4546
- _id: string;
4547
- contactId: string;
4548
- referralCode: string;
4549
- }
4550
- interface GenerateReferringCustomerForContactResponseNonNullableFields {
4551
- referringCustomer?: ReferringCustomerNonNullableFields;
4552
- }
4553
- interface GetReferringCustomerResponseNonNullableFields {
4554
- referringCustomer?: ReferringCustomerNonNullableFields;
4555
- }
4556
- interface GetReferringCustomerByReferralCodeResponseNonNullableFields {
4557
- referringCustomer?: ReferringCustomerNonNullableFields;
4558
- }
4559
- interface QueryReferringCustomersResponseNonNullableFields {
4560
- referringCustomers: ReferringCustomerNonNullableFields[];
4561
- }
4562
- interface BaseEventMetadata {
4563
- /** App instance ID. */
4564
- instanceId?: string | null;
4565
- /** Event type. */
4566
- eventType?: string;
4567
- /** The identification type and identity data. */
4568
- identity?: IdentificationData;
4569
- }
4570
- interface EventMetadata extends BaseEventMetadata {
4571
- /**
4572
- * Unique event ID.
4573
- * Allows clients to ignore duplicate webhooks.
4574
- */
4575
- _id?: string;
4576
- /**
4577
- * Assumes actions are also always typed to an entity_type
4578
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
4579
- */
4580
- entityFqdn?: string;
4581
- /**
4582
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
4583
- * This is although the created/updated/deleted notion is duplication of the oneof types
4584
- * Example: created/updated/deleted/started/completed/email_opened
4585
- */
4586
- slug?: string;
4587
- /** ID of the entity associated with the event. */
4588
- entityId?: string;
4589
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
4590
- eventTime?: Date | null;
4591
- /**
4592
- * Whether the event was triggered as a result of a privacy regulation application
4593
- * (for example, GDPR).
4594
- */
4595
- triggeredByAnonymizeRequest?: boolean | null;
4596
- /** If present, indicates the action that triggered the event. */
4597
- originatedFrom?: string | null;
4598
- /**
4599
- * A sequence number defining the order of updates to the underlying entity.
4600
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
4601
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
4602
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
4603
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
4604
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
4605
- */
4606
- entityEventSequence?: string | null;
4607
- }
4608
- interface ReferringCustomerCreatedEnvelope {
4609
- entity: ReferringCustomer;
4610
- metadata: EventMetadata;
4611
- }
4612
- interface ReferringCustomerDeletedEnvelope {
4613
- metadata: EventMetadata;
4614
- }
4615
- interface QueryCursorResult {
4616
- cursors: Cursors;
4617
- hasNext: () => boolean;
4618
- hasPrev: () => boolean;
4619
- length: number;
4620
- pageSize: number;
4621
- }
4622
- interface ReferringCustomersQueryResult extends QueryCursorResult {
4623
- items: ReferringCustomer[];
4624
- query: ReferringCustomersQueryBuilder;
4625
- next: () => Promise<ReferringCustomersQueryResult>;
4626
- prev: () => Promise<ReferringCustomersQueryResult>;
4627
- }
4628
- interface ReferringCustomersQueryBuilder {
4629
- /** @param propertyName - Property whose value is compared with `value`.
4630
- * @param value - Value to compare against.
4631
- * @documentationMaturity preview
4632
- */
4633
- eq: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
4634
- /** @param propertyName - Property whose value is compared with `value`.
4635
- * @param value - Value to compare against.
4636
- * @documentationMaturity preview
4637
- */
4638
- ne: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
4639
- /** @param propertyName - Property whose value is compared with `value`.
4640
- * @param value - Value to compare against.
4641
- * @documentationMaturity preview
4642
- */
4643
- ge: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
4644
- /** @param propertyName - Property whose value is compared with `value`.
4645
- * @param value - Value to compare against.
4646
- * @documentationMaturity preview
4647
- */
4648
- gt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
4649
- /** @param propertyName - Property whose value is compared with `value`.
4650
- * @param value - Value to compare against.
4651
- * @documentationMaturity preview
4652
- */
4653
- le: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
4654
- /** @param propertyName - Property whose value is compared with `value`.
4655
- * @param value - Value to compare against.
4656
- * @documentationMaturity preview
4657
- */
4658
- lt: (propertyName: '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
4659
- /** @param propertyName - Property whose value is compared with `string`.
4660
- * @param string - String to compare against. Case-insensitive.
4661
- * @documentationMaturity preview
4662
- */
4663
- startsWith: (propertyName: 'contactId' | 'referralCode', value: string) => ReferringCustomersQueryBuilder;
4664
- /** @param propertyName - Property whose value is compared with `values`.
4665
- * @param values - List of values to compare against.
4666
- * @documentationMaturity preview
4667
- */
4668
- hasSome: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any[]) => ReferringCustomersQueryBuilder;
4669
- /** @documentationMaturity preview */
4670
- in: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: any) => ReferringCustomersQueryBuilder;
4671
- /** @documentationMaturity preview */
4672
- exists: (propertyName: 'contactId' | 'referralCode' | '_createdDate' | '_updatedDate', value: boolean) => ReferringCustomersQueryBuilder;
4673
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
4674
- * @documentationMaturity preview
4675
- */
4676
- ascending: (...propertyNames: Array<'contactId' | 'referralCode' | '_createdDate' | '_updatedDate'>) => ReferringCustomersQueryBuilder;
4677
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
4678
- * @documentationMaturity preview
4679
- */
4680
- descending: (...propertyNames: Array<'contactId' | 'referralCode' | '_createdDate' | '_updatedDate'>) => ReferringCustomersQueryBuilder;
4681
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
4682
- * @documentationMaturity preview
4683
- */
4684
- limit: (limit: number) => ReferringCustomersQueryBuilder;
4685
- /** @param cursor - A pointer to specific record
4686
- * @documentationMaturity preview
4687
- */
4688
- skipTo: (cursor: string) => ReferringCustomersQueryBuilder;
4689
- /** @documentationMaturity preview */
4690
- find: () => Promise<ReferringCustomersQueryResult>;
4691
- }
4692
- interface DeleteReferringCustomerOptions {
4693
- /** Revision number of the referring customer. */
4694
- revision?: string;
4695
- }
4696
-
4697
- declare function generateReferringCustomerForContact$1(httpClient: HttpClient): GenerateReferringCustomerForContactSignature;
4698
- interface GenerateReferringCustomerForContactSignature {
4699
- /**
4700
- * Creates a new referring customer or returns an existing one for the provided contact ID.
4701
- *
4702
- * You can use `me` instead of a specific contact ID to generate a referring customer for the current identity's contact.
4703
- *
4704
- * See the [About Identities](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities) article to learn more about identies.
4705
- * @param - Contact ID or `"me"` to generate the current identity's referring customer.
4706
- */
4707
- (contactId: string): Promise<GenerateReferringCustomerForContactResponse & GenerateReferringCustomerForContactResponseNonNullableFields>;
4708
- }
4709
- declare function getReferringCustomer$1(httpClient: HttpClient): GetReferringCustomerSignature;
4710
- interface GetReferringCustomerSignature {
4711
- /**
4712
- * Retrieves a referring customer by ID.
4713
- * @param - ID of the referring customer to retrieve.
4714
- * @returns Retrieved referring customer.
4715
- */
4716
- (referringCustomerId: string): Promise<ReferringCustomer & ReferringCustomerNonNullableFields>;
4717
- }
4718
- declare function getReferringCustomerByReferralCode$1(httpClient: HttpClient): GetReferringCustomerByReferralCodeSignature;
4719
- interface GetReferringCustomerByReferralCodeSignature {
4720
- /**
4721
- * Retrieves a referring customer by referral code.
4722
- * @param - Referral code of the referring customer to retrieve.
4723
- */
4724
- (referralCode: string): Promise<GetReferringCustomerByReferralCodeResponse & GetReferringCustomerByReferralCodeResponseNonNullableFields>;
4725
- }
4726
- declare function queryReferringCustomers$1(httpClient: HttpClient): QueryReferringCustomersSignature;
4727
- interface QueryReferringCustomersSignature {
4728
- /**
4729
- * Creates a query to retrieve a list of referring customers.
4730
- *
4731
- * The `queryReferringCustomers()` function builds a query to retrieve a list of events and returns a `ReferringCustomersQueryBuilder` object.
4732
- *
4733
- * The returned object contains the query definition, which is typically used to run the query using the `find()` function.
4734
- *
4735
- * You can refine the query by chaining `ReferringCustomersQueryBuilder` functions onto the query. `ReferringCustomersQueryBuilder` functions enable you to sort, filter, and control the results `queryReferringCustomers()` returns.
4736
- *
4737
- * `queryReferringCustomers()` runs with these `ReferringCustomersQueryBuilder` defaults, which you can override:
4738
- *
4739
- * - `limit(50)`
4740
- * - `descending("_createdDate")`
4741
- * The functions that are chained to `queryReferringCustomers()` are applied in the order they're called. For example, if you apply ascending('referralCode') and then descending('contactID'), the results are sorted first by the referral code, and then, if there are multiple results with the same referral code, the items are sorted by contact ID.
4742
- */
4743
- (): ReferringCustomersQueryBuilder;
4744
- }
4745
- declare function deleteReferringCustomer$1(httpClient: HttpClient): DeleteReferringCustomerSignature;
4746
- interface DeleteReferringCustomerSignature {
4747
- /**
4748
- * Deletes a referring customer by ID.
4749
- *
4750
- * You must provide the latest `revision` to prevent conflicting changes.
4751
- * @param - ID of the referring customer to delete.
4752
- */
4753
- (referringCustomerId: string, options?: DeleteReferringCustomerOptions | undefined): Promise<void>;
4754
- }
4755
- declare const onReferringCustomerCreated$1: EventDefinition<ReferringCustomerCreatedEnvelope, "wix.loyalty.referral.v1.referring_customer_created">;
4756
- declare const onReferringCustomerDeleted$1: EventDefinition<ReferringCustomerDeletedEnvelope, "wix.loyalty.referral.v1.referring_customer_deleted">;
4757
-
4758
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
4759
-
4760
- declare const generateReferringCustomerForContact: MaybeContext<BuildRESTFunction<typeof generateReferringCustomerForContact$1> & typeof generateReferringCustomerForContact$1>;
4761
- declare const getReferringCustomer: MaybeContext<BuildRESTFunction<typeof getReferringCustomer$1> & typeof getReferringCustomer$1>;
4762
- declare const getReferringCustomerByReferralCode: MaybeContext<BuildRESTFunction<typeof getReferringCustomerByReferralCode$1> & typeof getReferringCustomerByReferralCode$1>;
4763
- declare const queryReferringCustomers: MaybeContext<BuildRESTFunction<typeof queryReferringCustomers$1> & typeof queryReferringCustomers$1>;
4764
- declare const deleteReferringCustomer: MaybeContext<BuildRESTFunction<typeof deleteReferringCustomer$1> & typeof deleteReferringCustomer$1>;
4765
-
4766
- type _publicOnReferringCustomerCreatedType = typeof onReferringCustomerCreated$1;
4767
- /**
4768
- * Triggered when a referring customer is created.
4769
- */
4770
- declare const onReferringCustomerCreated: ReturnType<typeof createEventModule<_publicOnReferringCustomerCreatedType>>;
4771
-
4772
- type _publicOnReferringCustomerDeletedType = typeof onReferringCustomerDeleted$1;
4773
- /**
4774
- * Triggered when a referring customer is deleted.
4775
- */
4776
- declare const onReferringCustomerDeleted: ReturnType<typeof createEventModule<_publicOnReferringCustomerDeletedType>>;
4777
-
4778
- type context_ActionEvent = ActionEvent;
4779
- type context_BaseEventMetadata = BaseEventMetadata;
4780
- type context_CursorPaging = CursorPaging;
4781
- type context_CursorPagingMetadata = CursorPagingMetadata;
4782
- type context_CursorQuery = CursorQuery;
4783
- type context_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf;
4784
- type context_Cursors = Cursors;
4785
- type context_DeleteReferringCustomerOptions = DeleteReferringCustomerOptions;
4786
- type context_DeleteReferringCustomerRequest = DeleteReferringCustomerRequest;
4787
- type context_DeleteReferringCustomerResponse = DeleteReferringCustomerResponse;
4788
- type context_DomainEvent = DomainEvent;
4789
- type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
4790
- type context_EntityCreatedEvent = EntityCreatedEvent;
4791
- type context_EntityDeletedEvent = EntityDeletedEvent;
4792
- type context_EntityUpdatedEvent = EntityUpdatedEvent;
4793
- type context_EventMetadata = EventMetadata;
4794
- type context_GenerateReferringCustomerForContactRequest = GenerateReferringCustomerForContactRequest;
4795
- type context_GenerateReferringCustomerForContactResponse = GenerateReferringCustomerForContactResponse;
4796
- type context_GenerateReferringCustomerForContactResponseNonNullableFields = GenerateReferringCustomerForContactResponseNonNullableFields;
4797
- type context_GetReferringCustomerByReferralCodeRequest = GetReferringCustomerByReferralCodeRequest;
4798
- type context_GetReferringCustomerByReferralCodeResponse = GetReferringCustomerByReferralCodeResponse;
4799
- type context_GetReferringCustomerByReferralCodeResponseNonNullableFields = GetReferringCustomerByReferralCodeResponseNonNullableFields;
4800
- type context_GetReferringCustomerRequest = GetReferringCustomerRequest;
4801
- type context_GetReferringCustomerResponse = GetReferringCustomerResponse;
4802
- type context_GetReferringCustomerResponseNonNullableFields = GetReferringCustomerResponseNonNullableFields;
4803
- type context_IdentificationData = IdentificationData;
4804
- type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
4805
- type context_MessageEnvelope = MessageEnvelope;
4806
- type context_QueryReferringCustomersRequest = QueryReferringCustomersRequest;
4807
- type context_QueryReferringCustomersResponse = QueryReferringCustomersResponse;
4808
- type context_QueryReferringCustomersResponseNonNullableFields = QueryReferringCustomersResponseNonNullableFields;
4809
- type context_ReferringCustomer = ReferringCustomer;
4810
- type context_ReferringCustomerCreatedEnvelope = ReferringCustomerCreatedEnvelope;
4811
- type context_ReferringCustomerDeletedEnvelope = ReferringCustomerDeletedEnvelope;
4812
- type context_ReferringCustomerNonNullableFields = ReferringCustomerNonNullableFields;
4813
- type context_ReferringCustomersQueryBuilder = ReferringCustomersQueryBuilder;
4814
- type context_ReferringCustomersQueryResult = ReferringCustomersQueryResult;
4815
- type context_RestoreInfo = RestoreInfo;
4816
- type context_SortOrder = SortOrder;
4817
- declare const context_SortOrder: typeof SortOrder;
4818
- type context_Sorting = Sorting;
4819
- type context_WebhookIdentityType = WebhookIdentityType;
4820
- declare const context_WebhookIdentityType: typeof WebhookIdentityType;
4821
- type context__publicOnReferringCustomerCreatedType = _publicOnReferringCustomerCreatedType;
4822
- type context__publicOnReferringCustomerDeletedType = _publicOnReferringCustomerDeletedType;
4823
- declare const context_deleteReferringCustomer: typeof deleteReferringCustomer;
4824
- declare const context_generateReferringCustomerForContact: typeof generateReferringCustomerForContact;
4825
- declare const context_getReferringCustomer: typeof getReferringCustomer;
4826
- declare const context_getReferringCustomerByReferralCode: typeof getReferringCustomerByReferralCode;
4827
- declare const context_onReferringCustomerCreated: typeof onReferringCustomerCreated;
4828
- declare const context_onReferringCustomerDeleted: typeof onReferringCustomerDeleted;
4829
- declare const context_queryReferringCustomers: typeof queryReferringCustomers;
4830
- declare namespace context {
4831
- export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_CursorQuery as CursorQuery, type context_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context_Cursors as Cursors, type context_DeleteReferringCustomerOptions as DeleteReferringCustomerOptions, type context_DeleteReferringCustomerRequest as DeleteReferringCustomerRequest, type context_DeleteReferringCustomerResponse as DeleteReferringCustomerResponse, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_EventMetadata as EventMetadata, type context_GenerateReferringCustomerForContactRequest as GenerateReferringCustomerForContactRequest, type context_GenerateReferringCustomerForContactResponse as GenerateReferringCustomerForContactResponse, type context_GenerateReferringCustomerForContactResponseNonNullableFields as GenerateReferringCustomerForContactResponseNonNullableFields, type context_GetReferringCustomerByReferralCodeRequest as GetReferringCustomerByReferralCodeRequest, type context_GetReferringCustomerByReferralCodeResponse as GetReferringCustomerByReferralCodeResponse, type context_GetReferringCustomerByReferralCodeResponseNonNullableFields as GetReferringCustomerByReferralCodeResponseNonNullableFields, type context_GetReferringCustomerRequest as GetReferringCustomerRequest, type context_GetReferringCustomerResponse as GetReferringCustomerResponse, type context_GetReferringCustomerResponseNonNullableFields as GetReferringCustomerResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_MessageEnvelope as MessageEnvelope, type context_QueryReferringCustomersRequest as QueryReferringCustomersRequest, type context_QueryReferringCustomersResponse as QueryReferringCustomersResponse, type context_QueryReferringCustomersResponseNonNullableFields as QueryReferringCustomersResponseNonNullableFields, type context_ReferringCustomer as ReferringCustomer, type context_ReferringCustomerCreatedEnvelope as ReferringCustomerCreatedEnvelope, type context_ReferringCustomerDeletedEnvelope as ReferringCustomerDeletedEnvelope, type context_ReferringCustomerNonNullableFields as ReferringCustomerNonNullableFields, type context_ReferringCustomersQueryBuilder as ReferringCustomersQueryBuilder, type context_ReferringCustomersQueryResult as ReferringCustomersQueryResult, type context_RestoreInfo as RestoreInfo, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_WebhookIdentityType as WebhookIdentityType, type context__publicOnReferringCustomerCreatedType as _publicOnReferringCustomerCreatedType, type context__publicOnReferringCustomerDeletedType as _publicOnReferringCustomerDeletedType, context_deleteReferringCustomer as deleteReferringCustomer, context_generateReferringCustomerForContact as generateReferringCustomerForContact, context_getReferringCustomer as getReferringCustomer, context_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, context_onReferringCustomerCreated as onReferringCustomerCreated, context_onReferringCustomerDeleted as onReferringCustomerDeleted, onReferringCustomerCreated$1 as publicOnReferringCustomerCreated, onReferringCustomerDeleted$1 as publicOnReferringCustomerDeleted, context_queryReferringCustomers as queryReferringCustomers };
4832
- }
4833
-
4834
- export { context as customers, context$1 as friends, context$4 as programs, context$2 as rewards, context$3 as tracker };