@wix/referral 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/context.d.ts +1 -0
- package/build/cjs/context.js +2 -1
- package/build/cjs/context.js.map +1 -1
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +2 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +2 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +1 -0
- package/build/es/context.js +1 -0
- package/build/es/context.js.map +1 -1
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +1 -0
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +1 -0
- package/build/es/meta.js.map +1 -1
- package/package.json +4 -3
- package/type-bundles/context.bundle.d.ts +672 -11
- package/type-bundles/index.bundle.d.ts +1838 -11
- package/type-bundles/meta.bundle.d.ts +1284 -21
|
@@ -1,3 +1,658 @@
|
|
|
1
|
+
/** ReferralProgram is the main entity of ReferralPrograms that can be used to manage the program. */
|
|
2
|
+
interface ReferralProgram {
|
|
3
|
+
/** Referral program name. */
|
|
4
|
+
name?: string | null;
|
|
5
|
+
/**
|
|
6
|
+
* Referral program status.
|
|
7
|
+
* @readonly
|
|
8
|
+
*/
|
|
9
|
+
status?: ProgramStatus;
|
|
10
|
+
/** Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision. */
|
|
11
|
+
revision?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Program's creation date and time.
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
_createdDate?: Date;
|
|
17
|
+
/**
|
|
18
|
+
* Program's last update date and time
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
_updatedDate?: Date;
|
|
22
|
+
/** Referred friend reward configuration. */
|
|
23
|
+
referredFriendReward?: Reward$1;
|
|
24
|
+
/** Referring customer reward configuration. */
|
|
25
|
+
referringCustomerReward?: Reward$1;
|
|
26
|
+
/** List of actions that complete referral. */
|
|
27
|
+
successfulReferralActions?: Action[];
|
|
28
|
+
/**
|
|
29
|
+
* Set to true if user has required plan to activate program.
|
|
30
|
+
* @readonly
|
|
31
|
+
* @deprecated Set to true if user has required plan to activate program.
|
|
32
|
+
* @replacedBy GetReferralProgramPremiumFeatures
|
|
33
|
+
* @removalDate 2024-09-01
|
|
34
|
+
*/
|
|
35
|
+
isPremium?: boolean;
|
|
36
|
+
/** Emails configuration. */
|
|
37
|
+
emails?: Emails;
|
|
38
|
+
}
|
|
39
|
+
declare enum ProgramStatus {
|
|
40
|
+
/** unknown status. */
|
|
41
|
+
UNKNOWN = "UNKNOWN",
|
|
42
|
+
/** initial program status (program was created but was not enabled yet). */
|
|
43
|
+
DRAFT = "DRAFT",
|
|
44
|
+
/** program is active. */
|
|
45
|
+
ACTIVE = "ACTIVE",
|
|
46
|
+
/** program was manually disabled by the user (this action can be reverted, meaning user can set it to be active again). */
|
|
47
|
+
PAUSED = "PAUSED"
|
|
48
|
+
}
|
|
49
|
+
interface Reward$1 extends RewardOptionsOneOf {
|
|
50
|
+
/** Options for coupon reward type. */
|
|
51
|
+
couponOptions?: Coupon$1;
|
|
52
|
+
/** Options for Loyalty points reward type. */
|
|
53
|
+
loyaltyPointsOptions?: LoyaltyPoints$1;
|
|
54
|
+
/** Type of the reward. */
|
|
55
|
+
type?: Type;
|
|
56
|
+
}
|
|
57
|
+
/** @oneof */
|
|
58
|
+
interface RewardOptionsOneOf {
|
|
59
|
+
/** Options for coupon reward type. */
|
|
60
|
+
couponOptions?: Coupon$1;
|
|
61
|
+
/** Options for Loyalty points reward type. */
|
|
62
|
+
loyaltyPointsOptions?: LoyaltyPoints$1;
|
|
63
|
+
}
|
|
64
|
+
declare enum Type {
|
|
65
|
+
/** Unknown reward type. */
|
|
66
|
+
UNKNOWN = "UNKNOWN",
|
|
67
|
+
/** Coupon reward type. */
|
|
68
|
+
COUPON = "COUPON",
|
|
69
|
+
/** Loyalty points reward type. */
|
|
70
|
+
LOYALTY_POINTS = "LOYALTY_POINTS",
|
|
71
|
+
/** No reward type. */
|
|
72
|
+
NOTHING = "NOTHING"
|
|
73
|
+
}
|
|
74
|
+
interface Coupon$1 extends CouponDiscountTypeOptionsOneOf$1, CouponScopeOrMinSubtotalOneOf$1 {
|
|
75
|
+
/** Options for fixed amount discount type. */
|
|
76
|
+
fixedAmountOptions?: FixedAmountDiscount$1;
|
|
77
|
+
/** Options for percentage discount type. */
|
|
78
|
+
percentageOptions?: PercentageDiscount$1;
|
|
79
|
+
/** Limit the coupon to carts with a subtotal above this number. */
|
|
80
|
+
minimumSubtotal?: number;
|
|
81
|
+
/** Specifies the type of line items this coupon will apply to. */
|
|
82
|
+
scope?: CouponScope$1;
|
|
83
|
+
/** Coupon name. */
|
|
84
|
+
name?: string;
|
|
85
|
+
/** Coupon discount type. */
|
|
86
|
+
discountType?: DiscountType$1;
|
|
87
|
+
/** Limit the coupon to only apply to one item in cart. */
|
|
88
|
+
limitedToOneItem?: boolean | null;
|
|
89
|
+
/** If true, coupon also applies to subscriptions. */
|
|
90
|
+
appliesToSubscriptions?: boolean | null;
|
|
91
|
+
/** Specifies the amount of discounted cycles for subscription item. See Stores Coupons documentation for more info. */
|
|
92
|
+
discountedCycleCount?: number | null;
|
|
93
|
+
}
|
|
94
|
+
/** @oneof */
|
|
95
|
+
interface CouponDiscountTypeOptionsOneOf$1 {
|
|
96
|
+
/** Options for fixed amount discount type. */
|
|
97
|
+
fixedAmountOptions?: FixedAmountDiscount$1;
|
|
98
|
+
/** Options for percentage discount type. */
|
|
99
|
+
percentageOptions?: PercentageDiscount$1;
|
|
100
|
+
}
|
|
101
|
+
/** @oneof */
|
|
102
|
+
interface CouponScopeOrMinSubtotalOneOf$1 {
|
|
103
|
+
/** Limit the coupon to carts with a subtotal above this number. */
|
|
104
|
+
minimumSubtotal?: number;
|
|
105
|
+
/** Specifies the type of line items this coupon will apply to. */
|
|
106
|
+
scope?: CouponScope$1;
|
|
107
|
+
}
|
|
108
|
+
declare enum DiscountType$1 {
|
|
109
|
+
/** Unknown discount type. */
|
|
110
|
+
UNKNOWN = "UNKNOWN",
|
|
111
|
+
/** Discount as a fixed amount. */
|
|
112
|
+
FIXED_AMOUNT = "FIXED_AMOUNT",
|
|
113
|
+
/** Discount as a percentage. */
|
|
114
|
+
PERCENTAGE = "PERCENTAGE",
|
|
115
|
+
/** Free shipping. */
|
|
116
|
+
FREE_SHIPPING = "FREE_SHIPPING"
|
|
117
|
+
}
|
|
118
|
+
interface FixedAmountDiscount$1 {
|
|
119
|
+
/** Fixed amount to discount. */
|
|
120
|
+
amount?: number;
|
|
121
|
+
}
|
|
122
|
+
interface PercentageDiscount$1 {
|
|
123
|
+
/** Percentage to discount. */
|
|
124
|
+
percentage?: number;
|
|
125
|
+
}
|
|
126
|
+
interface CouponScope$1 {
|
|
127
|
+
/** Namespace of the coupon scope. */
|
|
128
|
+
namespace?: string;
|
|
129
|
+
/** Group of the coupon scope. */
|
|
130
|
+
group?: Group$1;
|
|
131
|
+
}
|
|
132
|
+
interface Group$1 {
|
|
133
|
+
/** Name of the group. */
|
|
134
|
+
name?: string;
|
|
135
|
+
/** Entity ID of the group. */
|
|
136
|
+
entityId?: string | null;
|
|
137
|
+
}
|
|
138
|
+
interface LoyaltyPoints$1 {
|
|
139
|
+
/** Amount of points to give. */
|
|
140
|
+
amount?: number;
|
|
141
|
+
}
|
|
142
|
+
declare enum Action {
|
|
143
|
+
/** Unknown action. */
|
|
144
|
+
UNKNOWN = "UNKNOWN",
|
|
145
|
+
/** Store order placed. */
|
|
146
|
+
STORE_ORDER_PLACED = "STORE_ORDER_PLACED",
|
|
147
|
+
/** Pricing plan ordered. */
|
|
148
|
+
PLAN_ORDERED = "PLAN_ORDERED",
|
|
149
|
+
/** Wix events ticket ordered. */
|
|
150
|
+
TICKET_ORDERED = "TICKET_ORDERED",
|
|
151
|
+
/** Bookings session booked. */
|
|
152
|
+
SESSION_BOOKED = "SESSION_BOOKED",
|
|
153
|
+
/** Restaurant order placed. */
|
|
154
|
+
RESTAURANT_ORDER_PLACED = "RESTAURANT_ORDER_PLACED"
|
|
155
|
+
}
|
|
156
|
+
interface Emails {
|
|
157
|
+
/** Encourage customers to refer their friends email. Select for which apps to enable. */
|
|
158
|
+
encourageToReferFriends?: App[];
|
|
159
|
+
/** Notify customers about their referral reward email. Set true to enable email. */
|
|
160
|
+
notifyCustomersAboutReward?: boolean;
|
|
161
|
+
}
|
|
162
|
+
declare enum App {
|
|
163
|
+
/** Unknown app. */
|
|
164
|
+
UNKNOWN = "UNKNOWN",
|
|
165
|
+
/** Wix stores. */
|
|
166
|
+
STORES = "STORES",
|
|
167
|
+
/** Wix pricing plans. */
|
|
168
|
+
PRICING_PLANS = "PRICING_PLANS",
|
|
169
|
+
/** Wix events. */
|
|
170
|
+
EVENTS = "EVENTS",
|
|
171
|
+
/** Wix bookings. */
|
|
172
|
+
BOOKINGS = "BOOKINGS",
|
|
173
|
+
/** Wix restaurants. */
|
|
174
|
+
RESTAURANTS = "RESTAURANTS"
|
|
175
|
+
}
|
|
176
|
+
interface GetReferralProgramResponse {
|
|
177
|
+
/** The retrieved ReferralProgram. */
|
|
178
|
+
referralProgram?: ReferralProgram;
|
|
179
|
+
}
|
|
180
|
+
interface Cursors$3 {
|
|
181
|
+
/** Cursor string pointing to the next page in the list of results. */
|
|
182
|
+
next?: string | null;
|
|
183
|
+
/** Cursor pointing to the previous page in the list of results. */
|
|
184
|
+
prev?: string | null;
|
|
185
|
+
}
|
|
186
|
+
interface UpdateReferralProgramResponse {
|
|
187
|
+
/** The updated ReferralProgram. */
|
|
188
|
+
referralProgram?: ReferralProgram;
|
|
189
|
+
}
|
|
190
|
+
interface ActivateReferralProgramResponse {
|
|
191
|
+
/** The activated ReferralProgram. */
|
|
192
|
+
referralProgram?: ReferralProgram;
|
|
193
|
+
}
|
|
194
|
+
interface PauseReferralProgramResponse {
|
|
195
|
+
/** The paused ReferralProgram. */
|
|
196
|
+
referralProgram?: ReferralProgram;
|
|
197
|
+
}
|
|
198
|
+
interface GetAISocialMediaPostsSuggestionsResponse {
|
|
199
|
+
/** The generated suggestions. */
|
|
200
|
+
suggestions?: AISocialMediaPostSuggestion[];
|
|
201
|
+
/** The refer friends page URL. */
|
|
202
|
+
referFriendsPageUrl?: string | null;
|
|
203
|
+
}
|
|
204
|
+
interface AISocialMediaPostSuggestion {
|
|
205
|
+
/** The suggested post content. */
|
|
206
|
+
postContent?: string;
|
|
207
|
+
/** The suggested hashtags. */
|
|
208
|
+
hashtags?: string[];
|
|
209
|
+
}
|
|
210
|
+
interface GenerateAISocialMediaPostsSuggestionsResponse {
|
|
211
|
+
/** The generated suggestions. */
|
|
212
|
+
suggestions?: AISocialMediaPostSuggestion[];
|
|
213
|
+
/** The refer friends page URL. */
|
|
214
|
+
referFriendsPageUrl?: string | null;
|
|
215
|
+
}
|
|
216
|
+
interface GetReferralProgramPremiumFeaturesResponse {
|
|
217
|
+
/**
|
|
218
|
+
* Set to true if user has referral program feature.
|
|
219
|
+
* @readonly
|
|
220
|
+
*/
|
|
221
|
+
referralProgram?: boolean;
|
|
222
|
+
}
|
|
223
|
+
interface IdentificationData$3 extends IdentificationDataIdOneOf$3 {
|
|
224
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
225
|
+
anonymousVisitorId?: string;
|
|
226
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
227
|
+
memberId?: string;
|
|
228
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
229
|
+
wixUserId?: string;
|
|
230
|
+
/** ID of an app. */
|
|
231
|
+
appId?: string;
|
|
232
|
+
/** @readonly */
|
|
233
|
+
identityType?: WebhookIdentityType$3;
|
|
234
|
+
}
|
|
235
|
+
/** @oneof */
|
|
236
|
+
interface IdentificationDataIdOneOf$3 {
|
|
237
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
238
|
+
anonymousVisitorId?: string;
|
|
239
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
240
|
+
memberId?: string;
|
|
241
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
242
|
+
wixUserId?: string;
|
|
243
|
+
/** ID of an app. */
|
|
244
|
+
appId?: string;
|
|
245
|
+
}
|
|
246
|
+
declare enum WebhookIdentityType$3 {
|
|
247
|
+
UNKNOWN = "UNKNOWN",
|
|
248
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
249
|
+
MEMBER = "MEMBER",
|
|
250
|
+
WIX_USER = "WIX_USER",
|
|
251
|
+
APP = "APP"
|
|
252
|
+
}
|
|
253
|
+
interface GetReferralProgramResponseNonNullableFields {
|
|
254
|
+
referralProgram?: {
|
|
255
|
+
status: ProgramStatus;
|
|
256
|
+
referredFriendReward?: {
|
|
257
|
+
couponOptions?: {
|
|
258
|
+
fixedAmountOptions?: {
|
|
259
|
+
amount: number;
|
|
260
|
+
};
|
|
261
|
+
percentageOptions?: {
|
|
262
|
+
percentage: number;
|
|
263
|
+
};
|
|
264
|
+
minimumSubtotal: number;
|
|
265
|
+
scope?: {
|
|
266
|
+
namespace: string;
|
|
267
|
+
group?: {
|
|
268
|
+
name: string;
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
name: string;
|
|
272
|
+
discountType: DiscountType$1;
|
|
273
|
+
};
|
|
274
|
+
loyaltyPointsOptions?: {
|
|
275
|
+
amount: number;
|
|
276
|
+
};
|
|
277
|
+
type: Type;
|
|
278
|
+
};
|
|
279
|
+
referringCustomerReward?: {
|
|
280
|
+
couponOptions?: {
|
|
281
|
+
fixedAmountOptions?: {
|
|
282
|
+
amount: number;
|
|
283
|
+
};
|
|
284
|
+
percentageOptions?: {
|
|
285
|
+
percentage: number;
|
|
286
|
+
};
|
|
287
|
+
minimumSubtotal: number;
|
|
288
|
+
scope?: {
|
|
289
|
+
namespace: string;
|
|
290
|
+
group?: {
|
|
291
|
+
name: string;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
name: string;
|
|
295
|
+
discountType: DiscountType$1;
|
|
296
|
+
};
|
|
297
|
+
loyaltyPointsOptions?: {
|
|
298
|
+
amount: number;
|
|
299
|
+
};
|
|
300
|
+
type: Type;
|
|
301
|
+
};
|
|
302
|
+
successfulReferralActions: Action[];
|
|
303
|
+
isPremium: boolean;
|
|
304
|
+
emails?: {
|
|
305
|
+
encourageToReferFriends: App[];
|
|
306
|
+
notifyCustomersAboutReward: boolean;
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
interface UpdateReferralProgramResponseNonNullableFields {
|
|
311
|
+
referralProgram?: {
|
|
312
|
+
status: ProgramStatus;
|
|
313
|
+
referredFriendReward?: {
|
|
314
|
+
couponOptions?: {
|
|
315
|
+
fixedAmountOptions?: {
|
|
316
|
+
amount: number;
|
|
317
|
+
};
|
|
318
|
+
percentageOptions?: {
|
|
319
|
+
percentage: number;
|
|
320
|
+
};
|
|
321
|
+
minimumSubtotal: number;
|
|
322
|
+
scope?: {
|
|
323
|
+
namespace: string;
|
|
324
|
+
group?: {
|
|
325
|
+
name: string;
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
name: string;
|
|
329
|
+
discountType: DiscountType$1;
|
|
330
|
+
};
|
|
331
|
+
loyaltyPointsOptions?: {
|
|
332
|
+
amount: number;
|
|
333
|
+
};
|
|
334
|
+
type: Type;
|
|
335
|
+
};
|
|
336
|
+
referringCustomerReward?: {
|
|
337
|
+
couponOptions?: {
|
|
338
|
+
fixedAmountOptions?: {
|
|
339
|
+
amount: number;
|
|
340
|
+
};
|
|
341
|
+
percentageOptions?: {
|
|
342
|
+
percentage: number;
|
|
343
|
+
};
|
|
344
|
+
minimumSubtotal: number;
|
|
345
|
+
scope?: {
|
|
346
|
+
namespace: string;
|
|
347
|
+
group?: {
|
|
348
|
+
name: string;
|
|
349
|
+
};
|
|
350
|
+
};
|
|
351
|
+
name: string;
|
|
352
|
+
discountType: DiscountType$1;
|
|
353
|
+
};
|
|
354
|
+
loyaltyPointsOptions?: {
|
|
355
|
+
amount: number;
|
|
356
|
+
};
|
|
357
|
+
type: Type;
|
|
358
|
+
};
|
|
359
|
+
successfulReferralActions: Action[];
|
|
360
|
+
isPremium: boolean;
|
|
361
|
+
emails?: {
|
|
362
|
+
encourageToReferFriends: App[];
|
|
363
|
+
notifyCustomersAboutReward: boolean;
|
|
364
|
+
};
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
interface ActivateReferralProgramResponseNonNullableFields {
|
|
368
|
+
referralProgram?: {
|
|
369
|
+
status: ProgramStatus;
|
|
370
|
+
referredFriendReward?: {
|
|
371
|
+
couponOptions?: {
|
|
372
|
+
fixedAmountOptions?: {
|
|
373
|
+
amount: number;
|
|
374
|
+
};
|
|
375
|
+
percentageOptions?: {
|
|
376
|
+
percentage: number;
|
|
377
|
+
};
|
|
378
|
+
minimumSubtotal: number;
|
|
379
|
+
scope?: {
|
|
380
|
+
namespace: string;
|
|
381
|
+
group?: {
|
|
382
|
+
name: string;
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
name: string;
|
|
386
|
+
discountType: DiscountType$1;
|
|
387
|
+
};
|
|
388
|
+
loyaltyPointsOptions?: {
|
|
389
|
+
amount: number;
|
|
390
|
+
};
|
|
391
|
+
type: Type;
|
|
392
|
+
};
|
|
393
|
+
referringCustomerReward?: {
|
|
394
|
+
couponOptions?: {
|
|
395
|
+
fixedAmountOptions?: {
|
|
396
|
+
amount: number;
|
|
397
|
+
};
|
|
398
|
+
percentageOptions?: {
|
|
399
|
+
percentage: number;
|
|
400
|
+
};
|
|
401
|
+
minimumSubtotal: number;
|
|
402
|
+
scope?: {
|
|
403
|
+
namespace: string;
|
|
404
|
+
group?: {
|
|
405
|
+
name: string;
|
|
406
|
+
};
|
|
407
|
+
};
|
|
408
|
+
name: string;
|
|
409
|
+
discountType: DiscountType$1;
|
|
410
|
+
};
|
|
411
|
+
loyaltyPointsOptions?: {
|
|
412
|
+
amount: number;
|
|
413
|
+
};
|
|
414
|
+
type: Type;
|
|
415
|
+
};
|
|
416
|
+
successfulReferralActions: Action[];
|
|
417
|
+
isPremium: boolean;
|
|
418
|
+
emails?: {
|
|
419
|
+
encourageToReferFriends: App[];
|
|
420
|
+
notifyCustomersAboutReward: boolean;
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
interface PauseReferralProgramResponseNonNullableFields {
|
|
425
|
+
referralProgram?: {
|
|
426
|
+
status: ProgramStatus;
|
|
427
|
+
referredFriendReward?: {
|
|
428
|
+
couponOptions?: {
|
|
429
|
+
fixedAmountOptions?: {
|
|
430
|
+
amount: number;
|
|
431
|
+
};
|
|
432
|
+
percentageOptions?: {
|
|
433
|
+
percentage: number;
|
|
434
|
+
};
|
|
435
|
+
minimumSubtotal: number;
|
|
436
|
+
scope?: {
|
|
437
|
+
namespace: string;
|
|
438
|
+
group?: {
|
|
439
|
+
name: string;
|
|
440
|
+
};
|
|
441
|
+
};
|
|
442
|
+
name: string;
|
|
443
|
+
discountType: DiscountType$1;
|
|
444
|
+
};
|
|
445
|
+
loyaltyPointsOptions?: {
|
|
446
|
+
amount: number;
|
|
447
|
+
};
|
|
448
|
+
type: Type;
|
|
449
|
+
};
|
|
450
|
+
referringCustomerReward?: {
|
|
451
|
+
couponOptions?: {
|
|
452
|
+
fixedAmountOptions?: {
|
|
453
|
+
amount: number;
|
|
454
|
+
};
|
|
455
|
+
percentageOptions?: {
|
|
456
|
+
percentage: number;
|
|
457
|
+
};
|
|
458
|
+
minimumSubtotal: number;
|
|
459
|
+
scope?: {
|
|
460
|
+
namespace: string;
|
|
461
|
+
group?: {
|
|
462
|
+
name: string;
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
name: string;
|
|
466
|
+
discountType: DiscountType$1;
|
|
467
|
+
};
|
|
468
|
+
loyaltyPointsOptions?: {
|
|
469
|
+
amount: number;
|
|
470
|
+
};
|
|
471
|
+
type: Type;
|
|
472
|
+
};
|
|
473
|
+
successfulReferralActions: Action[];
|
|
474
|
+
isPremium: boolean;
|
|
475
|
+
emails?: {
|
|
476
|
+
encourageToReferFriends: App[];
|
|
477
|
+
notifyCustomersAboutReward: boolean;
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
}
|
|
481
|
+
interface GetAISocialMediaPostsSuggestionsResponseNonNullableFields {
|
|
482
|
+
suggestions: {
|
|
483
|
+
postContent: string;
|
|
484
|
+
hashtags: string[];
|
|
485
|
+
}[];
|
|
486
|
+
}
|
|
487
|
+
interface GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields {
|
|
488
|
+
suggestions: {
|
|
489
|
+
postContent: string;
|
|
490
|
+
hashtags: string[];
|
|
491
|
+
}[];
|
|
492
|
+
}
|
|
493
|
+
interface GetReferralProgramPremiumFeaturesResponseNonNullableFields {
|
|
494
|
+
referralProgram: boolean;
|
|
495
|
+
}
|
|
496
|
+
interface BaseEventMetadata$3 {
|
|
497
|
+
/** App instance ID. */
|
|
498
|
+
instanceId?: string | null;
|
|
499
|
+
/** Event type. */
|
|
500
|
+
eventType?: string;
|
|
501
|
+
/** The identification type and identity data. */
|
|
502
|
+
identity?: IdentificationData$3;
|
|
503
|
+
}
|
|
504
|
+
interface EventMetadata$3 extends BaseEventMetadata$3 {
|
|
505
|
+
/**
|
|
506
|
+
* Unique event ID.
|
|
507
|
+
* Allows clients to ignore duplicate webhooks.
|
|
508
|
+
*/
|
|
509
|
+
_id?: string;
|
|
510
|
+
/**
|
|
511
|
+
* Assumes actions are also always typed to an entity_type
|
|
512
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
513
|
+
*/
|
|
514
|
+
entityFqdn?: string;
|
|
515
|
+
/**
|
|
516
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
517
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
518
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
519
|
+
*/
|
|
520
|
+
slug?: string;
|
|
521
|
+
/** ID of the entity associated with the event. */
|
|
522
|
+
entityId?: string;
|
|
523
|
+
/** Event timestamp. */
|
|
524
|
+
eventTime?: Date;
|
|
525
|
+
/**
|
|
526
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
527
|
+
* (for example, GDPR).
|
|
528
|
+
*/
|
|
529
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
530
|
+
/** If present, indicates the action that triggered the event. */
|
|
531
|
+
originatedFrom?: string | null;
|
|
532
|
+
/**
|
|
533
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
534
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
535
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
536
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
537
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
538
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
539
|
+
*/
|
|
540
|
+
entityEventSequence?: string | null;
|
|
541
|
+
}
|
|
542
|
+
interface ProgramUpdatedEnvelope {
|
|
543
|
+
entity: ReferralProgram;
|
|
544
|
+
metadata: EventMetadata$3;
|
|
545
|
+
}
|
|
546
|
+
interface QueryCursorResult$3 {
|
|
547
|
+
cursors: Cursors$3;
|
|
548
|
+
hasNext: () => boolean;
|
|
549
|
+
hasPrev: () => boolean;
|
|
550
|
+
length: number;
|
|
551
|
+
pageSize: number;
|
|
552
|
+
}
|
|
553
|
+
interface ReferralProgramsQueryResult extends QueryCursorResult$3 {
|
|
554
|
+
items: ReferralProgram[];
|
|
555
|
+
query: ReferralProgramsQueryBuilder;
|
|
556
|
+
next: () => Promise<ReferralProgramsQueryResult>;
|
|
557
|
+
prev: () => Promise<ReferralProgramsQueryResult>;
|
|
558
|
+
}
|
|
559
|
+
interface ReferralProgramsQueryBuilder {
|
|
560
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
561
|
+
* @documentationMaturity preview
|
|
562
|
+
*/
|
|
563
|
+
limit: (limit: number) => ReferralProgramsQueryBuilder;
|
|
564
|
+
/** @param cursor - A pointer to specific record
|
|
565
|
+
* @documentationMaturity preview
|
|
566
|
+
*/
|
|
567
|
+
skipTo: (cursor: string) => ReferralProgramsQueryBuilder;
|
|
568
|
+
/** @documentationMaturity preview */
|
|
569
|
+
find: () => Promise<ReferralProgramsQueryResult>;
|
|
570
|
+
}
|
|
571
|
+
interface GetAiSocialMediaPostsSuggestionsOptions {
|
|
572
|
+
/** The topic to generate suggestions for. */
|
|
573
|
+
topic?: string;
|
|
574
|
+
}
|
|
575
|
+
interface GenerateAiSocialMediaPostsSuggestionsOptions {
|
|
576
|
+
/** The topic to generate suggestions for. */
|
|
577
|
+
topic?: string;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
type RESTFunctionDescriptor$3<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$3) => T;
|
|
581
|
+
interface HttpClient$3 {
|
|
582
|
+
request<TResponse, TData = any>(req: RequestOptionsFactory$3<TResponse, TData>): Promise<HttpResponse$3<TResponse>>;
|
|
583
|
+
fetchWithAuth: (url: string | URL, init?: RequestInit) => Promise<Response>;
|
|
584
|
+
}
|
|
585
|
+
type RequestOptionsFactory$3<TResponse = any, TData = any> = (context: any) => RequestOptions$3<TResponse, TData>;
|
|
586
|
+
type HttpResponse$3<T = any> = {
|
|
587
|
+
data: T;
|
|
588
|
+
status: number;
|
|
589
|
+
statusText: string;
|
|
590
|
+
headers: any;
|
|
591
|
+
request?: any;
|
|
592
|
+
};
|
|
593
|
+
type RequestOptions$3<_TResponse = any, Data = any> = {
|
|
594
|
+
method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
|
|
595
|
+
url: string;
|
|
596
|
+
data?: Data;
|
|
597
|
+
params?: URLSearchParams;
|
|
598
|
+
} & APIMetadata$3;
|
|
599
|
+
type APIMetadata$3 = {
|
|
600
|
+
methodFqn?: string;
|
|
601
|
+
entityFqdn?: string;
|
|
602
|
+
packageName?: string;
|
|
603
|
+
};
|
|
604
|
+
type BuildRESTFunction$3<T extends RESTFunctionDescriptor$3> = T extends RESTFunctionDescriptor$3<infer U> ? U : never;
|
|
605
|
+
type EventDefinition$3<Payload = unknown, Type extends string = string> = {
|
|
606
|
+
__type: 'event-definition';
|
|
607
|
+
type: Type;
|
|
608
|
+
isDomainEvent?: boolean;
|
|
609
|
+
transformations?: (envelope: unknown) => Payload;
|
|
610
|
+
__payload: Payload;
|
|
611
|
+
};
|
|
612
|
+
declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
|
|
613
|
+
type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
|
|
614
|
+
type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
|
|
615
|
+
|
|
616
|
+
declare global {
|
|
617
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
618
|
+
interface SymbolConstructor {
|
|
619
|
+
readonly observable: symbol;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
declare function getReferralProgram$1(httpClient: HttpClient$3): () => Promise<GetReferralProgramResponse & GetReferralProgramResponseNonNullableFields>;
|
|
624
|
+
declare function queryReferralPrograms$1(httpClient: HttpClient$3): () => ReferralProgramsQueryBuilder;
|
|
625
|
+
declare function updateReferralProgram$1(httpClient: HttpClient$3): (referralProgram: ReferralProgram) => Promise<UpdateReferralProgramResponse & UpdateReferralProgramResponseNonNullableFields>;
|
|
626
|
+
declare function activateReferralProgram$1(httpClient: HttpClient$3): () => Promise<ActivateReferralProgramResponse & ActivateReferralProgramResponseNonNullableFields>;
|
|
627
|
+
declare function pauseReferralProgram$1(httpClient: HttpClient$3): () => Promise<PauseReferralProgramResponse & PauseReferralProgramResponseNonNullableFields>;
|
|
628
|
+
declare function getAiSocialMediaPostsSuggestions$1(httpClient: HttpClient$3): (options?: GetAiSocialMediaPostsSuggestionsOptions) => Promise<GetAISocialMediaPostsSuggestionsResponse & GetAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
629
|
+
declare function generateAiSocialMediaPostsSuggestions$1(httpClient: HttpClient$3): (options?: GenerateAiSocialMediaPostsSuggestionsOptions) => Promise<GenerateAISocialMediaPostsSuggestionsResponse & GenerateAISocialMediaPostsSuggestionsResponseNonNullableFields>;
|
|
630
|
+
declare function getReferralProgramPremiumFeatures$1(httpClient: HttpClient$3): () => Promise<GetReferralProgramPremiumFeaturesResponse & GetReferralProgramPremiumFeaturesResponseNonNullableFields>;
|
|
631
|
+
declare const onProgramUpdated$1: EventDefinition$3<ProgramUpdatedEnvelope, "wix.loyalty.referral.v1.program_updated">;
|
|
632
|
+
|
|
633
|
+
declare const getReferralProgram: BuildRESTFunction$3<typeof getReferralProgram$1>;
|
|
634
|
+
declare const queryReferralPrograms: BuildRESTFunction$3<typeof queryReferralPrograms$1>;
|
|
635
|
+
declare const updateReferralProgram: BuildRESTFunction$3<typeof updateReferralProgram$1>;
|
|
636
|
+
declare const activateReferralProgram: BuildRESTFunction$3<typeof activateReferralProgram$1>;
|
|
637
|
+
declare const pauseReferralProgram: BuildRESTFunction$3<typeof pauseReferralProgram$1>;
|
|
638
|
+
declare const getAiSocialMediaPostsSuggestions: BuildRESTFunction$3<typeof getAiSocialMediaPostsSuggestions$1>;
|
|
639
|
+
declare const generateAiSocialMediaPostsSuggestions: BuildRESTFunction$3<typeof generateAiSocialMediaPostsSuggestions$1>;
|
|
640
|
+
declare const getReferralProgramPremiumFeatures: BuildRESTFunction$3<typeof getReferralProgramPremiumFeatures$1>;
|
|
641
|
+
declare const onProgramUpdated: BuildEventDefinition$3<typeof onProgramUpdated$1>;
|
|
642
|
+
|
|
643
|
+
declare const context$3_activateReferralProgram: typeof activateReferralProgram;
|
|
644
|
+
declare const context$3_generateAiSocialMediaPostsSuggestions: typeof generateAiSocialMediaPostsSuggestions;
|
|
645
|
+
declare const context$3_getAiSocialMediaPostsSuggestions: typeof getAiSocialMediaPostsSuggestions;
|
|
646
|
+
declare const context$3_getReferralProgram: typeof getReferralProgram;
|
|
647
|
+
declare const context$3_getReferralProgramPremiumFeatures: typeof getReferralProgramPremiumFeatures;
|
|
648
|
+
declare const context$3_onProgramUpdated: typeof onProgramUpdated;
|
|
649
|
+
declare const context$3_pauseReferralProgram: typeof pauseReferralProgram;
|
|
650
|
+
declare const context$3_queryReferralPrograms: typeof queryReferralPrograms;
|
|
651
|
+
declare const context$3_updateReferralProgram: typeof updateReferralProgram;
|
|
652
|
+
declare namespace context$3 {
|
|
653
|
+
export { context$3_activateReferralProgram as activateReferralProgram, context$3_generateAiSocialMediaPostsSuggestions as generateAiSocialMediaPostsSuggestions, context$3_getAiSocialMediaPostsSuggestions as getAiSocialMediaPostsSuggestions, context$3_getReferralProgram as getReferralProgram, context$3_getReferralProgramPremiumFeatures as getReferralProgramPremiumFeatures, context$3_onProgramUpdated as onProgramUpdated, context$3_pauseReferralProgram as pauseReferralProgram, context$3_queryReferralPrograms as queryReferralPrograms, context$3_updateReferralProgram as updateReferralProgram };
|
|
654
|
+
}
|
|
655
|
+
|
|
1
656
|
/** ReferralEvent. */
|
|
2
657
|
interface ReferralEvent extends ReferralEventEventTypeOneOf {
|
|
3
658
|
/** ReferredFriendSignupEvent is an event that is triggered when a referred friend signs up. */
|
|
@@ -306,17 +961,17 @@ declare enum Status$1 {
|
|
|
306
961
|
DELETED = "DELETED"
|
|
307
962
|
}
|
|
308
963
|
interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtotalOneOf {
|
|
309
|
-
/** Options for fixed amount discount type */
|
|
964
|
+
/** Options for fixed amount discount type. */
|
|
310
965
|
fixedAmountOptions?: FixedAmountDiscount;
|
|
311
|
-
/** Options for percentage discount type */
|
|
966
|
+
/** Options for percentage discount type. */
|
|
312
967
|
percentageOptions?: PercentageDiscount;
|
|
313
968
|
/** Limit the coupon to carts with a subtotal above this number. */
|
|
314
969
|
minimumSubtotal?: number;
|
|
315
970
|
/** Specifies the type of line items this coupon will apply to. */
|
|
316
971
|
scope?: CouponScope;
|
|
317
|
-
/** Coupon name */
|
|
972
|
+
/** Coupon name. */
|
|
318
973
|
name?: string;
|
|
319
|
-
/** Coupon discount type */
|
|
974
|
+
/** Coupon discount type. */
|
|
320
975
|
discountType?: DiscountType;
|
|
321
976
|
/** Limit the coupon to only apply to one item in cart. */
|
|
322
977
|
limitedToOneItem?: boolean | null;
|
|
@@ -327,9 +982,9 @@ interface Coupon extends CouponDiscountTypeOptionsOneOf, CouponScopeOrMinSubtota
|
|
|
327
982
|
}
|
|
328
983
|
/** @oneof */
|
|
329
984
|
interface CouponDiscountTypeOptionsOneOf {
|
|
330
|
-
/** Options for fixed amount discount type */
|
|
985
|
+
/** Options for fixed amount discount type. */
|
|
331
986
|
fixedAmountOptions?: FixedAmountDiscount;
|
|
332
|
-
/** Options for percentage discount type */
|
|
987
|
+
/** Options for percentage discount type. */
|
|
333
988
|
percentageOptions?: PercentageDiscount;
|
|
334
989
|
}
|
|
335
990
|
/** @oneof */
|
|
@@ -340,27 +995,33 @@ interface CouponScopeOrMinSubtotalOneOf {
|
|
|
340
995
|
scope?: CouponScope;
|
|
341
996
|
}
|
|
342
997
|
declare enum DiscountType {
|
|
998
|
+
/** Unknown discount type. */
|
|
343
999
|
UNKNOWN = "UNKNOWN",
|
|
344
|
-
/** Discount as a fixed amount */
|
|
1000
|
+
/** Discount as a fixed amount. */
|
|
345
1001
|
FIXED_AMOUNT = "FIXED_AMOUNT",
|
|
346
|
-
/** Discount as a percentage */
|
|
1002
|
+
/** Discount as a percentage. */
|
|
347
1003
|
PERCENTAGE = "PERCENTAGE",
|
|
348
|
-
/** Free shipping */
|
|
1004
|
+
/** Free shipping. */
|
|
349
1005
|
FREE_SHIPPING = "FREE_SHIPPING"
|
|
350
1006
|
}
|
|
351
1007
|
interface FixedAmountDiscount {
|
|
352
|
-
/** Fixed amount to discount */
|
|
1008
|
+
/** Fixed amount to discount. */
|
|
353
1009
|
amount?: number;
|
|
354
1010
|
}
|
|
355
1011
|
interface PercentageDiscount {
|
|
1012
|
+
/** Percentage to discount. */
|
|
356
1013
|
percentage?: number;
|
|
357
1014
|
}
|
|
358
1015
|
interface CouponScope {
|
|
1016
|
+
/** Namespace of the coupon scope. */
|
|
359
1017
|
namespace?: string;
|
|
1018
|
+
/** Group of the coupon scope. */
|
|
360
1019
|
group?: Group;
|
|
361
1020
|
}
|
|
362
1021
|
interface Group {
|
|
1022
|
+
/** Name of the group. */
|
|
363
1023
|
name?: string;
|
|
1024
|
+
/** Entity ID of the group. */
|
|
364
1025
|
entityId?: string | null;
|
|
365
1026
|
}
|
|
366
1027
|
interface LoyaltyPoints {
|
|
@@ -1341,4 +2002,4 @@ declare namespace context {
|
|
|
1341
2002
|
export { context_deleteReferringCustomer as deleteReferringCustomer, context_generateReferringCustomerForContact as generateReferringCustomerForContact, context_getReferringCustomer as getReferringCustomer, context_getReferringCustomerByReferralCode as getReferringCustomerByReferralCode, context_onReferringCustomerCreated as onReferringCustomerCreated, context_onReferringCustomerDeleted as onReferringCustomerDeleted, context_queryReferringCustomers as queryReferringCustomers };
|
|
1342
2003
|
}
|
|
1343
2004
|
|
|
1344
|
-
export { context as customers, context$1 as friends, context$2 as tracker };
|
|
2005
|
+
export { context as customers, context$1 as friends, context$3 as programs, context$2 as tracker };
|