@wix/auto_sdk_referral_programs 1.0.180 → 1.0.182

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.
@@ -0,0 +1,1255 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // schemas.ts
31
+ var schemas_exports = {};
32
+ __export(schemas_exports, {
33
+ ActivateReferralProgramRequest: () => ActivateReferralProgramRequest,
34
+ ActivateReferralProgramResponse: () => ActivateReferralProgramResponse,
35
+ GenerateAiSocialMediaPostsSuggestionsRequest: () => GenerateAiSocialMediaPostsSuggestionsRequest,
36
+ GenerateAiSocialMediaPostsSuggestionsResponse: () => GenerateAiSocialMediaPostsSuggestionsResponse,
37
+ GetAiSocialMediaPostsSuggestionsRequest: () => GetAiSocialMediaPostsSuggestionsRequest,
38
+ GetAiSocialMediaPostsSuggestionsResponse: () => GetAiSocialMediaPostsSuggestionsResponse,
39
+ GetReferralProgramPremiumFeaturesRequest: () => GetReferralProgramPremiumFeaturesRequest,
40
+ GetReferralProgramPremiumFeaturesResponse: () => GetReferralProgramPremiumFeaturesResponse,
41
+ GetReferralProgramRequest: () => GetReferralProgramRequest,
42
+ GetReferralProgramResponse: () => GetReferralProgramResponse,
43
+ PauseReferralProgramRequest: () => PauseReferralProgramRequest,
44
+ PauseReferralProgramResponse: () => PauseReferralProgramResponse,
45
+ UpdateReferralProgramRequest: () => UpdateReferralProgramRequest,
46
+ UpdateReferralProgramResponse: () => UpdateReferralProgramResponse
47
+ });
48
+ module.exports = __toCommonJS(schemas_exports);
49
+
50
+ // src/loyalty-referral-v1-program-programs.schemas.ts
51
+ var z = __toESM(require("zod"));
52
+ var GetReferralProgramRequest = z.object({});
53
+ var GetReferralProgramResponse = z.object({
54
+ referralProgram: z.object({
55
+ name: z.string().describe("Referral program name.").min(2).max(50).optional().nullable(),
56
+ status: z.enum(["UNKNOWN", "DRAFT", "ACTIVE", "PAUSED"]).optional(),
57
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
58
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current `revision` must be passed when updating the program."
59
+ ).optional().nullable(),
60
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
61
+ _updatedDate: z.date().describe("Date and time the program was last updated.").optional().nullable(),
62
+ referredFriendReward: z.intersection(
63
+ z.object({
64
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
65
+ }),
66
+ z.xor([
67
+ z.object({
68
+ couponOptions: z.never().optional(),
69
+ loyaltyPointsOptions: z.never().optional()
70
+ }),
71
+ z.object({
72
+ loyaltyPointsOptions: z.never().optional(),
73
+ couponOptions: z.intersection(
74
+ z.object({
75
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
76
+ discountType: z.enum([
77
+ "UNKNOWN",
78
+ "FIXED_AMOUNT",
79
+ "PERCENTAGE",
80
+ "FREE_SHIPPING"
81
+ ]).describe("Coupon discount type.").optional(),
82
+ limitedToOneItem: z.boolean().describe(
83
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
84
+ ).optional().nullable(),
85
+ appliesToSubscriptions: z.boolean().describe(
86
+ "Whether the coupon applies to subscription products."
87
+ ).optional().nullable(),
88
+ discountedCycleCount: z.number().int().describe(
89
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
90
+ ).optional().nullable()
91
+ }),
92
+ z.intersection(
93
+ z.xor([
94
+ z.object({
95
+ fixedAmountOptions: z.never().optional(),
96
+ percentageOptions: z.never().optional()
97
+ }),
98
+ z.object({
99
+ percentageOptions: z.never().optional(),
100
+ fixedAmountOptions: z.object({
101
+ amount: z.number().describe(
102
+ "Amount of the discount as a fixed value."
103
+ ).min(0.01).optional()
104
+ }).describe("Options for fixed amount discount.")
105
+ }),
106
+ z.object({
107
+ fixedAmountOptions: z.never().optional(),
108
+ percentageOptions: z.object({
109
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
110
+ }).describe("Options for percentage discounts.")
111
+ })
112
+ ]),
113
+ z.xor([
114
+ z.object({
115
+ minimumSubtotal: z.never().optional(),
116
+ scope: z.never().optional()
117
+ }),
118
+ z.object({
119
+ scope: z.never().optional(),
120
+ minimumSubtotal: z.number().describe(
121
+ "Limit the coupon to carts with a subtotal above this number."
122
+ )
123
+ }),
124
+ z.object({
125
+ minimumSubtotal: z.never().optional(),
126
+ scope: z.object({
127
+ namespace: z.string().describe(
128
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
129
+ ).optional(),
130
+ group: z.object({
131
+ name: z.string().describe("Name of the group.").optional(),
132
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
133
+ }).describe(
134
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
135
+ ).optional()
136
+ }).describe(
137
+ "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)."
138
+ )
139
+ })
140
+ ])
141
+ )
142
+ ).describe("Options for coupon reward type.")
143
+ }),
144
+ z.object({
145
+ couponOptions: z.never().optional(),
146
+ loyaltyPointsOptions: z.object({
147
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
148
+ }).describe("Options for the Loyalty points reward type.")
149
+ })
150
+ ])
151
+ ).describe(
152
+ "Reward configuration for the referred friend.\nSpecifies the reward given to a new customer who was referred to the business."
153
+ ).optional(),
154
+ referringCustomerReward: z.intersection(
155
+ z.object({
156
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
157
+ }),
158
+ z.xor([
159
+ z.object({
160
+ couponOptions: z.never().optional(),
161
+ loyaltyPointsOptions: z.never().optional()
162
+ }),
163
+ z.object({
164
+ loyaltyPointsOptions: z.never().optional(),
165
+ couponOptions: z.intersection(
166
+ z.object({
167
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
168
+ discountType: z.enum([
169
+ "UNKNOWN",
170
+ "FIXED_AMOUNT",
171
+ "PERCENTAGE",
172
+ "FREE_SHIPPING"
173
+ ]).describe("Coupon discount type.").optional(),
174
+ limitedToOneItem: z.boolean().describe(
175
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
176
+ ).optional().nullable(),
177
+ appliesToSubscriptions: z.boolean().describe(
178
+ "Whether the coupon applies to subscription products."
179
+ ).optional().nullable(),
180
+ discountedCycleCount: z.number().int().describe(
181
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
182
+ ).optional().nullable()
183
+ }),
184
+ z.intersection(
185
+ z.xor([
186
+ z.object({
187
+ fixedAmountOptions: z.never().optional(),
188
+ percentageOptions: z.never().optional()
189
+ }),
190
+ z.object({
191
+ percentageOptions: z.never().optional(),
192
+ fixedAmountOptions: z.object({
193
+ amount: z.number().describe(
194
+ "Amount of the discount as a fixed value."
195
+ ).min(0.01).optional()
196
+ }).describe("Options for fixed amount discount.")
197
+ }),
198
+ z.object({
199
+ fixedAmountOptions: z.never().optional(),
200
+ percentageOptions: z.object({
201
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
202
+ }).describe("Options for percentage discounts.")
203
+ })
204
+ ]),
205
+ z.xor([
206
+ z.object({
207
+ minimumSubtotal: z.never().optional(),
208
+ scope: z.never().optional()
209
+ }),
210
+ z.object({
211
+ scope: z.never().optional(),
212
+ minimumSubtotal: z.number().describe(
213
+ "Limit the coupon to carts with a subtotal above this number."
214
+ )
215
+ }),
216
+ z.object({
217
+ minimumSubtotal: z.never().optional(),
218
+ scope: z.object({
219
+ namespace: z.string().describe(
220
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
221
+ ).optional(),
222
+ group: z.object({
223
+ name: z.string().describe("Name of the group.").optional(),
224
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
225
+ }).describe(
226
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
227
+ ).optional()
228
+ }).describe(
229
+ "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)."
230
+ )
231
+ })
232
+ ])
233
+ )
234
+ ).describe("Options for coupon reward type.")
235
+ }),
236
+ z.object({
237
+ couponOptions: z.never().optional(),
238
+ loyaltyPointsOptions: z.object({
239
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
240
+ }).describe("Options for the Loyalty points reward type.")
241
+ })
242
+ ])
243
+ ).describe(
244
+ "Reward configuration for the referring customer.\nSpecifies the reward given to an existing customer who referred a new customer to the business."
245
+ ).optional(),
246
+ successfulReferralActions: z.array(
247
+ z.enum([
248
+ "UNKNOWN",
249
+ "STORE_ORDER_PLACED",
250
+ "PLAN_ORDERED",
251
+ "TICKET_ORDERED",
252
+ "SESSION_BOOKED",
253
+ "RESTAURANT_ORDER_PLACED",
254
+ "ONLINE_PROGRAM_JOINED"
255
+ ])
256
+ ).max(100).optional(),
257
+ emails: z.object({
258
+ encourageToReferFriends: z.array(
259
+ z.enum([
260
+ "UNKNOWN",
261
+ "STORES",
262
+ "PRICING_PLANS",
263
+ "EVENTS",
264
+ "BOOKINGS",
265
+ "RESTAURANTS",
266
+ "ONLINE_PROGRAMS"
267
+ ])
268
+ ).optional(),
269
+ notifyCustomersAboutReward: z.boolean().describe(
270
+ "Whether to send email notifications to referring customers when they receive a referral reward.\nIf true, referring customers will be notified by email when their referred friend completes a qualifying action (for example, placing an order)."
271
+ ).optional()
272
+ }).describe("Configures email notifications for the referral program.").optional(),
273
+ premiumFeatures: z.object({
274
+ referralProgram: z.boolean().describe(
275
+ "Whether the site owner has access to the referral program feature."
276
+ ).optional()
277
+ }).describe(
278
+ "Indicates which premium features are available for the current account."
279
+ ).optional()
280
+ }).describe("Retrieved referral program.").optional()
281
+ });
282
+ var UpdateReferralProgramRequest = z.object({
283
+ referralProgram: z.object({
284
+ name: z.string().describe("Referral program name.").min(2).max(50).optional().nullable(),
285
+ status: z.enum(["UNKNOWN", "DRAFT", "ACTIVE", "PAUSED"]).optional(),
286
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
287
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current `revision` must be passed when updating the program."
288
+ ),
289
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
290
+ _updatedDate: z.date().describe("Date and time the program was last updated.").optional().nullable(),
291
+ referredFriendReward: z.intersection(
292
+ z.object({
293
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).optional()
294
+ }),
295
+ z.xor([
296
+ z.object({
297
+ couponOptions: z.never().optional(),
298
+ loyaltyPointsOptions: z.never().optional()
299
+ }),
300
+ z.object({
301
+ loyaltyPointsOptions: z.never().optional(),
302
+ couponOptions: z.intersection(
303
+ z.object({
304
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
305
+ discountType: z.enum([
306
+ "UNKNOWN",
307
+ "FIXED_AMOUNT",
308
+ "PERCENTAGE",
309
+ "FREE_SHIPPING"
310
+ ]).describe("Coupon discount type.").optional(),
311
+ limitedToOneItem: z.boolean().describe(
312
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
313
+ ).optional().nullable(),
314
+ appliesToSubscriptions: z.boolean().describe(
315
+ "Whether the coupon applies to subscription products."
316
+ ).optional().nullable(),
317
+ discountedCycleCount: z.number().int().describe(
318
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
319
+ ).optional().nullable()
320
+ }),
321
+ z.intersection(
322
+ z.xor([
323
+ z.object({
324
+ fixedAmountOptions: z.never().optional(),
325
+ percentageOptions: z.never().optional()
326
+ }),
327
+ z.object({
328
+ percentageOptions: z.never().optional(),
329
+ fixedAmountOptions: z.object({
330
+ amount: z.number().describe(
331
+ "Amount of the discount as a fixed value."
332
+ ).min(0.01).optional()
333
+ }).describe("Options for fixed amount discount.")
334
+ }),
335
+ z.object({
336
+ fixedAmountOptions: z.never().optional(),
337
+ percentageOptions: z.object({
338
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
339
+ }).describe("Options for percentage discounts.")
340
+ })
341
+ ]),
342
+ z.xor([
343
+ z.object({
344
+ minimumSubtotal: z.never().optional(),
345
+ scope: z.never().optional()
346
+ }),
347
+ z.object({
348
+ scope: z.never().optional(),
349
+ minimumSubtotal: z.number().describe(
350
+ "Limit the coupon to carts with a subtotal above this number."
351
+ )
352
+ }),
353
+ z.object({
354
+ minimumSubtotal: z.never().optional(),
355
+ scope: z.object({
356
+ namespace: z.string().describe(
357
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
358
+ ).optional(),
359
+ group: z.object({
360
+ name: z.string().describe("Name of the group.").optional(),
361
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
362
+ }).describe(
363
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
364
+ ).optional()
365
+ }).describe(
366
+ "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)."
367
+ )
368
+ })
369
+ ])
370
+ )
371
+ ).describe("Options for coupon reward type.")
372
+ }),
373
+ z.object({
374
+ couponOptions: z.never().optional(),
375
+ loyaltyPointsOptions: z.object({
376
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
377
+ }).describe("Options for the Loyalty points reward type.")
378
+ })
379
+ ])
380
+ ).describe(
381
+ "Reward configuration for the referred friend.\nSpecifies the reward given to a new customer who was referred to the business."
382
+ ).optional(),
383
+ referringCustomerReward: z.intersection(
384
+ z.object({
385
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).optional()
386
+ }),
387
+ z.xor([
388
+ z.object({
389
+ couponOptions: z.never().optional(),
390
+ loyaltyPointsOptions: z.never().optional()
391
+ }),
392
+ z.object({
393
+ loyaltyPointsOptions: z.never().optional(),
394
+ couponOptions: z.intersection(
395
+ z.object({
396
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
397
+ discountType: z.enum([
398
+ "UNKNOWN",
399
+ "FIXED_AMOUNT",
400
+ "PERCENTAGE",
401
+ "FREE_SHIPPING"
402
+ ]).describe("Coupon discount type.").optional(),
403
+ limitedToOneItem: z.boolean().describe(
404
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
405
+ ).optional().nullable(),
406
+ appliesToSubscriptions: z.boolean().describe(
407
+ "Whether the coupon applies to subscription products."
408
+ ).optional().nullable(),
409
+ discountedCycleCount: z.number().int().describe(
410
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
411
+ ).optional().nullable()
412
+ }),
413
+ z.intersection(
414
+ z.xor([
415
+ z.object({
416
+ fixedAmountOptions: z.never().optional(),
417
+ percentageOptions: z.never().optional()
418
+ }),
419
+ z.object({
420
+ percentageOptions: z.never().optional(),
421
+ fixedAmountOptions: z.object({
422
+ amount: z.number().describe(
423
+ "Amount of the discount as a fixed value."
424
+ ).min(0.01).optional()
425
+ }).describe("Options for fixed amount discount.")
426
+ }),
427
+ z.object({
428
+ fixedAmountOptions: z.never().optional(),
429
+ percentageOptions: z.object({
430
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
431
+ }).describe("Options for percentage discounts.")
432
+ })
433
+ ]),
434
+ z.xor([
435
+ z.object({
436
+ minimumSubtotal: z.never().optional(),
437
+ scope: z.never().optional()
438
+ }),
439
+ z.object({
440
+ scope: z.never().optional(),
441
+ minimumSubtotal: z.number().describe(
442
+ "Limit the coupon to carts with a subtotal above this number."
443
+ )
444
+ }),
445
+ z.object({
446
+ minimumSubtotal: z.never().optional(),
447
+ scope: z.object({
448
+ namespace: z.string().describe(
449
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
450
+ ).optional(),
451
+ group: z.object({
452
+ name: z.string().describe("Name of the group.").optional(),
453
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
454
+ }).describe(
455
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
456
+ ).optional()
457
+ }).describe(
458
+ "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)."
459
+ )
460
+ })
461
+ ])
462
+ )
463
+ ).describe("Options for coupon reward type.")
464
+ }),
465
+ z.object({
466
+ couponOptions: z.never().optional(),
467
+ loyaltyPointsOptions: z.object({
468
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
469
+ }).describe("Options for the Loyalty points reward type.")
470
+ })
471
+ ])
472
+ ).describe(
473
+ "Reward configuration for the referring customer.\nSpecifies the reward given to an existing customer who referred a new customer to the business."
474
+ ).optional(),
475
+ successfulReferralActions: z.array(
476
+ z.enum([
477
+ "UNKNOWN",
478
+ "STORE_ORDER_PLACED",
479
+ "PLAN_ORDERED",
480
+ "TICKET_ORDERED",
481
+ "SESSION_BOOKED",
482
+ "RESTAURANT_ORDER_PLACED",
483
+ "ONLINE_PROGRAM_JOINED"
484
+ ])
485
+ ).max(100).optional(),
486
+ emails: z.object({
487
+ encourageToReferFriends: z.array(
488
+ z.enum([
489
+ "UNKNOWN",
490
+ "STORES",
491
+ "PRICING_PLANS",
492
+ "EVENTS",
493
+ "BOOKINGS",
494
+ "RESTAURANTS",
495
+ "ONLINE_PROGRAMS"
496
+ ])
497
+ ).optional(),
498
+ notifyCustomersAboutReward: z.boolean().describe(
499
+ "Whether to send email notifications to referring customers when they receive a referral reward.\nIf true, referring customers will be notified by email when their referred friend completes a qualifying action (for example, placing an order)."
500
+ ).optional()
501
+ }).describe("Configures email notifications for the referral program.").optional(),
502
+ premiumFeatures: z.object({
503
+ referralProgram: z.boolean().describe(
504
+ "Whether the site owner has access to the referral program feature."
505
+ ).optional()
506
+ }).describe(
507
+ "Indicates which premium features are available for the current account."
508
+ ).optional()
509
+ }).describe(
510
+ "Referral program to update. Include the latest `revision` for a successful update."
511
+ )
512
+ });
513
+ var UpdateReferralProgramResponse = z.object({
514
+ referralProgram: z.object({
515
+ name: z.string().describe("Referral program name.").min(2).max(50).optional().nullable(),
516
+ status: z.enum(["UNKNOWN", "DRAFT", "ACTIVE", "PAUSED"]).optional(),
517
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
518
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current `revision` must be passed when updating the program."
519
+ ).optional().nullable(),
520
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
521
+ _updatedDate: z.date().describe("Date and time the program was last updated.").optional().nullable(),
522
+ referredFriendReward: z.intersection(
523
+ z.object({
524
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
525
+ }),
526
+ z.xor([
527
+ z.object({
528
+ couponOptions: z.never().optional(),
529
+ loyaltyPointsOptions: z.never().optional()
530
+ }),
531
+ z.object({
532
+ loyaltyPointsOptions: z.never().optional(),
533
+ couponOptions: z.intersection(
534
+ z.object({
535
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
536
+ discountType: z.enum([
537
+ "UNKNOWN",
538
+ "FIXED_AMOUNT",
539
+ "PERCENTAGE",
540
+ "FREE_SHIPPING"
541
+ ]).describe("Coupon discount type.").optional(),
542
+ limitedToOneItem: z.boolean().describe(
543
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
544
+ ).optional().nullable(),
545
+ appliesToSubscriptions: z.boolean().describe(
546
+ "Whether the coupon applies to subscription products."
547
+ ).optional().nullable(),
548
+ discountedCycleCount: z.number().int().describe(
549
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
550
+ ).optional().nullable()
551
+ }),
552
+ z.intersection(
553
+ z.xor([
554
+ z.object({
555
+ fixedAmountOptions: z.never().optional(),
556
+ percentageOptions: z.never().optional()
557
+ }),
558
+ z.object({
559
+ percentageOptions: z.never().optional(),
560
+ fixedAmountOptions: z.object({
561
+ amount: z.number().describe(
562
+ "Amount of the discount as a fixed value."
563
+ ).min(0.01).optional()
564
+ }).describe("Options for fixed amount discount.")
565
+ }),
566
+ z.object({
567
+ fixedAmountOptions: z.never().optional(),
568
+ percentageOptions: z.object({
569
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
570
+ }).describe("Options for percentage discounts.")
571
+ })
572
+ ]),
573
+ z.xor([
574
+ z.object({
575
+ minimumSubtotal: z.never().optional(),
576
+ scope: z.never().optional()
577
+ }),
578
+ z.object({
579
+ scope: z.never().optional(),
580
+ minimumSubtotal: z.number().describe(
581
+ "Limit the coupon to carts with a subtotal above this number."
582
+ )
583
+ }),
584
+ z.object({
585
+ minimumSubtotal: z.never().optional(),
586
+ scope: z.object({
587
+ namespace: z.string().describe(
588
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
589
+ ).optional(),
590
+ group: z.object({
591
+ name: z.string().describe("Name of the group.").optional(),
592
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
593
+ }).describe(
594
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
595
+ ).optional()
596
+ }).describe(
597
+ "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)."
598
+ )
599
+ })
600
+ ])
601
+ )
602
+ ).describe("Options for coupon reward type.")
603
+ }),
604
+ z.object({
605
+ couponOptions: z.never().optional(),
606
+ loyaltyPointsOptions: z.object({
607
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
608
+ }).describe("Options for the Loyalty points reward type.")
609
+ })
610
+ ])
611
+ ).describe(
612
+ "Reward configuration for the referred friend.\nSpecifies the reward given to a new customer who was referred to the business."
613
+ ).optional(),
614
+ referringCustomerReward: z.intersection(
615
+ z.object({
616
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
617
+ }),
618
+ z.xor([
619
+ z.object({
620
+ couponOptions: z.never().optional(),
621
+ loyaltyPointsOptions: z.never().optional()
622
+ }),
623
+ z.object({
624
+ loyaltyPointsOptions: z.never().optional(),
625
+ couponOptions: z.intersection(
626
+ z.object({
627
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
628
+ discountType: z.enum([
629
+ "UNKNOWN",
630
+ "FIXED_AMOUNT",
631
+ "PERCENTAGE",
632
+ "FREE_SHIPPING"
633
+ ]).describe("Coupon discount type.").optional(),
634
+ limitedToOneItem: z.boolean().describe(
635
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
636
+ ).optional().nullable(),
637
+ appliesToSubscriptions: z.boolean().describe(
638
+ "Whether the coupon applies to subscription products."
639
+ ).optional().nullable(),
640
+ discountedCycleCount: z.number().int().describe(
641
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
642
+ ).optional().nullable()
643
+ }),
644
+ z.intersection(
645
+ z.xor([
646
+ z.object({
647
+ fixedAmountOptions: z.never().optional(),
648
+ percentageOptions: z.never().optional()
649
+ }),
650
+ z.object({
651
+ percentageOptions: z.never().optional(),
652
+ fixedAmountOptions: z.object({
653
+ amount: z.number().describe(
654
+ "Amount of the discount as a fixed value."
655
+ ).min(0.01).optional()
656
+ }).describe("Options for fixed amount discount.")
657
+ }),
658
+ z.object({
659
+ fixedAmountOptions: z.never().optional(),
660
+ percentageOptions: z.object({
661
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
662
+ }).describe("Options for percentage discounts.")
663
+ })
664
+ ]),
665
+ z.xor([
666
+ z.object({
667
+ minimumSubtotal: z.never().optional(),
668
+ scope: z.never().optional()
669
+ }),
670
+ z.object({
671
+ scope: z.never().optional(),
672
+ minimumSubtotal: z.number().describe(
673
+ "Limit the coupon to carts with a subtotal above this number."
674
+ )
675
+ }),
676
+ z.object({
677
+ minimumSubtotal: z.never().optional(),
678
+ scope: z.object({
679
+ namespace: z.string().describe(
680
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
681
+ ).optional(),
682
+ group: z.object({
683
+ name: z.string().describe("Name of the group.").optional(),
684
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
685
+ }).describe(
686
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
687
+ ).optional()
688
+ }).describe(
689
+ "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)."
690
+ )
691
+ })
692
+ ])
693
+ )
694
+ ).describe("Options for coupon reward type.")
695
+ }),
696
+ z.object({
697
+ couponOptions: z.never().optional(),
698
+ loyaltyPointsOptions: z.object({
699
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
700
+ }).describe("Options for the Loyalty points reward type.")
701
+ })
702
+ ])
703
+ ).describe(
704
+ "Reward configuration for the referring customer.\nSpecifies the reward given to an existing customer who referred a new customer to the business."
705
+ ).optional(),
706
+ successfulReferralActions: z.array(
707
+ z.enum([
708
+ "UNKNOWN",
709
+ "STORE_ORDER_PLACED",
710
+ "PLAN_ORDERED",
711
+ "TICKET_ORDERED",
712
+ "SESSION_BOOKED",
713
+ "RESTAURANT_ORDER_PLACED",
714
+ "ONLINE_PROGRAM_JOINED"
715
+ ])
716
+ ).max(100).optional(),
717
+ emails: z.object({
718
+ encourageToReferFriends: z.array(
719
+ z.enum([
720
+ "UNKNOWN",
721
+ "STORES",
722
+ "PRICING_PLANS",
723
+ "EVENTS",
724
+ "BOOKINGS",
725
+ "RESTAURANTS",
726
+ "ONLINE_PROGRAMS"
727
+ ])
728
+ ).optional(),
729
+ notifyCustomersAboutReward: z.boolean().describe(
730
+ "Whether to send email notifications to referring customers when they receive a referral reward.\nIf true, referring customers will be notified by email when their referred friend completes a qualifying action (for example, placing an order)."
731
+ ).optional()
732
+ }).describe("Configures email notifications for the referral program.").optional(),
733
+ premiumFeatures: z.object({
734
+ referralProgram: z.boolean().describe(
735
+ "Whether the site owner has access to the referral program feature."
736
+ ).optional()
737
+ }).describe(
738
+ "Indicates which premium features are available for the current account."
739
+ ).optional()
740
+ }).describe("Updated referral program.").optional()
741
+ });
742
+ var ActivateReferralProgramRequest = z.object({});
743
+ var ActivateReferralProgramResponse = z.object({
744
+ referralProgram: z.object({
745
+ name: z.string().describe("Referral program name.").min(2).max(50).optional().nullable(),
746
+ status: z.enum(["UNKNOWN", "DRAFT", "ACTIVE", "PAUSED"]).optional(),
747
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
748
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current `revision` must be passed when updating the program."
749
+ ).optional().nullable(),
750
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
751
+ _updatedDate: z.date().describe("Date and time the program was last updated.").optional().nullable(),
752
+ referredFriendReward: z.intersection(
753
+ z.object({
754
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
755
+ }),
756
+ z.xor([
757
+ z.object({
758
+ couponOptions: z.never().optional(),
759
+ loyaltyPointsOptions: z.never().optional()
760
+ }),
761
+ z.object({
762
+ loyaltyPointsOptions: z.never().optional(),
763
+ couponOptions: z.intersection(
764
+ z.object({
765
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
766
+ discountType: z.enum([
767
+ "UNKNOWN",
768
+ "FIXED_AMOUNT",
769
+ "PERCENTAGE",
770
+ "FREE_SHIPPING"
771
+ ]).describe("Coupon discount type.").optional(),
772
+ limitedToOneItem: z.boolean().describe(
773
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
774
+ ).optional().nullable(),
775
+ appliesToSubscriptions: z.boolean().describe(
776
+ "Whether the coupon applies to subscription products."
777
+ ).optional().nullable(),
778
+ discountedCycleCount: z.number().int().describe(
779
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
780
+ ).optional().nullable()
781
+ }),
782
+ z.intersection(
783
+ z.xor([
784
+ z.object({
785
+ fixedAmountOptions: z.never().optional(),
786
+ percentageOptions: z.never().optional()
787
+ }),
788
+ z.object({
789
+ percentageOptions: z.never().optional(),
790
+ fixedAmountOptions: z.object({
791
+ amount: z.number().describe(
792
+ "Amount of the discount as a fixed value."
793
+ ).min(0.01).optional()
794
+ }).describe("Options for fixed amount discount.")
795
+ }),
796
+ z.object({
797
+ fixedAmountOptions: z.never().optional(),
798
+ percentageOptions: z.object({
799
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
800
+ }).describe("Options for percentage discounts.")
801
+ })
802
+ ]),
803
+ z.xor([
804
+ z.object({
805
+ minimumSubtotal: z.never().optional(),
806
+ scope: z.never().optional()
807
+ }),
808
+ z.object({
809
+ scope: z.never().optional(),
810
+ minimumSubtotal: z.number().describe(
811
+ "Limit the coupon to carts with a subtotal above this number."
812
+ )
813
+ }),
814
+ z.object({
815
+ minimumSubtotal: z.never().optional(),
816
+ scope: z.object({
817
+ namespace: z.string().describe(
818
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
819
+ ).optional(),
820
+ group: z.object({
821
+ name: z.string().describe("Name of the group.").optional(),
822
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
823
+ }).describe(
824
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
825
+ ).optional()
826
+ }).describe(
827
+ "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)."
828
+ )
829
+ })
830
+ ])
831
+ )
832
+ ).describe("Options for coupon reward type.")
833
+ }),
834
+ z.object({
835
+ couponOptions: z.never().optional(),
836
+ loyaltyPointsOptions: z.object({
837
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
838
+ }).describe("Options for the Loyalty points reward type.")
839
+ })
840
+ ])
841
+ ).describe(
842
+ "Reward configuration for the referred friend.\nSpecifies the reward given to a new customer who was referred to the business."
843
+ ).optional(),
844
+ referringCustomerReward: z.intersection(
845
+ z.object({
846
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
847
+ }),
848
+ z.xor([
849
+ z.object({
850
+ couponOptions: z.never().optional(),
851
+ loyaltyPointsOptions: z.never().optional()
852
+ }),
853
+ z.object({
854
+ loyaltyPointsOptions: z.never().optional(),
855
+ couponOptions: z.intersection(
856
+ z.object({
857
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
858
+ discountType: z.enum([
859
+ "UNKNOWN",
860
+ "FIXED_AMOUNT",
861
+ "PERCENTAGE",
862
+ "FREE_SHIPPING"
863
+ ]).describe("Coupon discount type.").optional(),
864
+ limitedToOneItem: z.boolean().describe(
865
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
866
+ ).optional().nullable(),
867
+ appliesToSubscriptions: z.boolean().describe(
868
+ "Whether the coupon applies to subscription products."
869
+ ).optional().nullable(),
870
+ discountedCycleCount: z.number().int().describe(
871
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
872
+ ).optional().nullable()
873
+ }),
874
+ z.intersection(
875
+ z.xor([
876
+ z.object({
877
+ fixedAmountOptions: z.never().optional(),
878
+ percentageOptions: z.never().optional()
879
+ }),
880
+ z.object({
881
+ percentageOptions: z.never().optional(),
882
+ fixedAmountOptions: z.object({
883
+ amount: z.number().describe(
884
+ "Amount of the discount as a fixed value."
885
+ ).min(0.01).optional()
886
+ }).describe("Options for fixed amount discount.")
887
+ }),
888
+ z.object({
889
+ fixedAmountOptions: z.never().optional(),
890
+ percentageOptions: z.object({
891
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
892
+ }).describe("Options for percentage discounts.")
893
+ })
894
+ ]),
895
+ z.xor([
896
+ z.object({
897
+ minimumSubtotal: z.never().optional(),
898
+ scope: z.never().optional()
899
+ }),
900
+ z.object({
901
+ scope: z.never().optional(),
902
+ minimumSubtotal: z.number().describe(
903
+ "Limit the coupon to carts with a subtotal above this number."
904
+ )
905
+ }),
906
+ z.object({
907
+ minimumSubtotal: z.never().optional(),
908
+ scope: z.object({
909
+ namespace: z.string().describe(
910
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
911
+ ).optional(),
912
+ group: z.object({
913
+ name: z.string().describe("Name of the group.").optional(),
914
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
915
+ }).describe(
916
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
917
+ ).optional()
918
+ }).describe(
919
+ "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)."
920
+ )
921
+ })
922
+ ])
923
+ )
924
+ ).describe("Options for coupon reward type.")
925
+ }),
926
+ z.object({
927
+ couponOptions: z.never().optional(),
928
+ loyaltyPointsOptions: z.object({
929
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
930
+ }).describe("Options for the Loyalty points reward type.")
931
+ })
932
+ ])
933
+ ).describe(
934
+ "Reward configuration for the referring customer.\nSpecifies the reward given to an existing customer who referred a new customer to the business."
935
+ ).optional(),
936
+ successfulReferralActions: z.array(
937
+ z.enum([
938
+ "UNKNOWN",
939
+ "STORE_ORDER_PLACED",
940
+ "PLAN_ORDERED",
941
+ "TICKET_ORDERED",
942
+ "SESSION_BOOKED",
943
+ "RESTAURANT_ORDER_PLACED",
944
+ "ONLINE_PROGRAM_JOINED"
945
+ ])
946
+ ).max(100).optional(),
947
+ emails: z.object({
948
+ encourageToReferFriends: z.array(
949
+ z.enum([
950
+ "UNKNOWN",
951
+ "STORES",
952
+ "PRICING_PLANS",
953
+ "EVENTS",
954
+ "BOOKINGS",
955
+ "RESTAURANTS",
956
+ "ONLINE_PROGRAMS"
957
+ ])
958
+ ).optional(),
959
+ notifyCustomersAboutReward: z.boolean().describe(
960
+ "Whether to send email notifications to referring customers when they receive a referral reward.\nIf true, referring customers will be notified by email when their referred friend completes a qualifying action (for example, placing an order)."
961
+ ).optional()
962
+ }).describe("Configures email notifications for the referral program.").optional(),
963
+ premiumFeatures: z.object({
964
+ referralProgram: z.boolean().describe(
965
+ "Whether the site owner has access to the referral program feature."
966
+ ).optional()
967
+ }).describe(
968
+ "Indicates which premium features are available for the current account."
969
+ ).optional()
970
+ }).describe("Activated referral program.").optional()
971
+ });
972
+ var PauseReferralProgramRequest = z.object({});
973
+ var PauseReferralProgramResponse = z.object({
974
+ referralProgram: z.object({
975
+ name: z.string().describe("Referral program name.").min(2).max(50).optional().nullable(),
976
+ status: z.enum(["UNKNOWN", "DRAFT", "ACTIVE", "PAUSED"]).optional(),
977
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
978
+ "Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current `revision` must be passed when updating the program."
979
+ ).optional().nullable(),
980
+ _createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
981
+ _updatedDate: z.date().describe("Date and time the program was last updated.").optional().nullable(),
982
+ referredFriendReward: z.intersection(
983
+ z.object({
984
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
985
+ }),
986
+ z.xor([
987
+ z.object({
988
+ couponOptions: z.never().optional(),
989
+ loyaltyPointsOptions: z.never().optional()
990
+ }),
991
+ z.object({
992
+ loyaltyPointsOptions: z.never().optional(),
993
+ couponOptions: z.intersection(
994
+ z.object({
995
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
996
+ discountType: z.enum([
997
+ "UNKNOWN",
998
+ "FIXED_AMOUNT",
999
+ "PERCENTAGE",
1000
+ "FREE_SHIPPING"
1001
+ ]).describe("Coupon discount type.").optional(),
1002
+ limitedToOneItem: z.boolean().describe(
1003
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
1004
+ ).optional().nullable(),
1005
+ appliesToSubscriptions: z.boolean().describe(
1006
+ "Whether the coupon applies to subscription products."
1007
+ ).optional().nullable(),
1008
+ discountedCycleCount: z.number().int().describe(
1009
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
1010
+ ).optional().nullable()
1011
+ }),
1012
+ z.intersection(
1013
+ z.xor([
1014
+ z.object({
1015
+ fixedAmountOptions: z.never().optional(),
1016
+ percentageOptions: z.never().optional()
1017
+ }),
1018
+ z.object({
1019
+ percentageOptions: z.never().optional(),
1020
+ fixedAmountOptions: z.object({
1021
+ amount: z.number().describe(
1022
+ "Amount of the discount as a fixed value."
1023
+ ).min(0.01).optional()
1024
+ }).describe("Options for fixed amount discount.")
1025
+ }),
1026
+ z.object({
1027
+ fixedAmountOptions: z.never().optional(),
1028
+ percentageOptions: z.object({
1029
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
1030
+ }).describe("Options for percentage discounts.")
1031
+ })
1032
+ ]),
1033
+ z.xor([
1034
+ z.object({
1035
+ minimumSubtotal: z.never().optional(),
1036
+ scope: z.never().optional()
1037
+ }),
1038
+ z.object({
1039
+ scope: z.never().optional(),
1040
+ minimumSubtotal: z.number().describe(
1041
+ "Limit the coupon to carts with a subtotal above this number."
1042
+ )
1043
+ }),
1044
+ z.object({
1045
+ minimumSubtotal: z.never().optional(),
1046
+ scope: z.object({
1047
+ namespace: z.string().describe(
1048
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
1049
+ ).optional(),
1050
+ group: z.object({
1051
+ name: z.string().describe("Name of the group.").optional(),
1052
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
1053
+ }).describe(
1054
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
1055
+ ).optional()
1056
+ }).describe(
1057
+ "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)."
1058
+ )
1059
+ })
1060
+ ])
1061
+ )
1062
+ ).describe("Options for coupon reward type.")
1063
+ }),
1064
+ z.object({
1065
+ couponOptions: z.never().optional(),
1066
+ loyaltyPointsOptions: z.object({
1067
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
1068
+ }).describe("Options for the Loyalty points reward type.")
1069
+ })
1070
+ ])
1071
+ ).describe(
1072
+ "Reward configuration for the referred friend.\nSpecifies the reward given to a new customer who was referred to the business."
1073
+ ).optional(),
1074
+ referringCustomerReward: z.intersection(
1075
+ z.object({
1076
+ type: z.enum(["UNKNOWN", "COUPON", "LOYALTY_POINTS", "NOTHING"]).describe("Type of the reward.").optional()
1077
+ }),
1078
+ z.xor([
1079
+ z.object({
1080
+ couponOptions: z.never().optional(),
1081
+ loyaltyPointsOptions: z.never().optional()
1082
+ }),
1083
+ z.object({
1084
+ loyaltyPointsOptions: z.never().optional(),
1085
+ couponOptions: z.intersection(
1086
+ z.object({
1087
+ name: z.string().describe("Coupon name.").min(1).max(50).optional(),
1088
+ discountType: z.enum([
1089
+ "UNKNOWN",
1090
+ "FIXED_AMOUNT",
1091
+ "PERCENTAGE",
1092
+ "FREE_SHIPPING"
1093
+ ]).describe("Coupon discount type.").optional(),
1094
+ limitedToOneItem: z.boolean().describe(
1095
+ "Whether the coupon is limited to one item.\nIf `true` and a customer pays for multiple items, the discount applies to only the lowest priced item.\nCoupons with a bookings `scope.namespace` are always limited to one item."
1096
+ ).optional().nullable(),
1097
+ appliesToSubscriptions: z.boolean().describe(
1098
+ "Whether the coupon applies to subscription products."
1099
+ ).optional().nullable(),
1100
+ discountedCycleCount: z.number().int().describe(
1101
+ "Specifies the amount of discounted cycles for a subscription item.\n\n- Can only be set when `scope.namespace = pricingPlans`.\n- If `discountedCycleCount` is empty, the coupon applies to all available cycles.\n- `discountedCycleCount` is ignored if `appliesToSubscriptions = true`.\n\nMax: `999`"
1102
+ ).optional().nullable()
1103
+ }),
1104
+ z.intersection(
1105
+ z.xor([
1106
+ z.object({
1107
+ fixedAmountOptions: z.never().optional(),
1108
+ percentageOptions: z.never().optional()
1109
+ }),
1110
+ z.object({
1111
+ percentageOptions: z.never().optional(),
1112
+ fixedAmountOptions: z.object({
1113
+ amount: z.number().describe(
1114
+ "Amount of the discount as a fixed value."
1115
+ ).min(0.01).optional()
1116
+ }).describe("Options for fixed amount discount.")
1117
+ }),
1118
+ z.object({
1119
+ fixedAmountOptions: z.never().optional(),
1120
+ percentageOptions: z.object({
1121
+ percentage: z.number().describe("Percentage of discount.").min(0).max(100).optional()
1122
+ }).describe("Options for percentage discounts.")
1123
+ })
1124
+ ]),
1125
+ z.xor([
1126
+ z.object({
1127
+ minimumSubtotal: z.never().optional(),
1128
+ scope: z.never().optional()
1129
+ }),
1130
+ z.object({
1131
+ scope: z.never().optional(),
1132
+ minimumSubtotal: z.number().describe(
1133
+ "Limit the coupon to carts with a subtotal above this number."
1134
+ )
1135
+ }),
1136
+ z.object({
1137
+ minimumSubtotal: z.never().optional(),
1138
+ scope: z.object({
1139
+ namespace: z.string().describe(
1140
+ "Scope namespace (Wix Stores, Wix Bookings, Wix Events, Wix Pricing Plans)"
1141
+ ).optional(),
1142
+ group: z.object({
1143
+ name: z.string().describe("Name of the group.").optional(),
1144
+ entityId: z.string().describe("Entity ID of the group.").optional().nullable()
1145
+ }).describe(
1146
+ "Coupon scope's applied group, for example, Event or ticket in Wix Events."
1147
+ ).optional()
1148
+ }).describe(
1149
+ "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)."
1150
+ )
1151
+ })
1152
+ ])
1153
+ )
1154
+ ).describe("Options for coupon reward type.")
1155
+ }),
1156
+ z.object({
1157
+ couponOptions: z.never().optional(),
1158
+ loyaltyPointsOptions: z.object({
1159
+ amount: z.number().int().describe("Number of loyalty points to give.").min(1).max(9999999).optional()
1160
+ }).describe("Options for the Loyalty points reward type.")
1161
+ })
1162
+ ])
1163
+ ).describe(
1164
+ "Reward configuration for the referring customer.\nSpecifies the reward given to an existing customer who referred a new customer to the business."
1165
+ ).optional(),
1166
+ successfulReferralActions: z.array(
1167
+ z.enum([
1168
+ "UNKNOWN",
1169
+ "STORE_ORDER_PLACED",
1170
+ "PLAN_ORDERED",
1171
+ "TICKET_ORDERED",
1172
+ "SESSION_BOOKED",
1173
+ "RESTAURANT_ORDER_PLACED",
1174
+ "ONLINE_PROGRAM_JOINED"
1175
+ ])
1176
+ ).max(100).optional(),
1177
+ emails: z.object({
1178
+ encourageToReferFriends: z.array(
1179
+ z.enum([
1180
+ "UNKNOWN",
1181
+ "STORES",
1182
+ "PRICING_PLANS",
1183
+ "EVENTS",
1184
+ "BOOKINGS",
1185
+ "RESTAURANTS",
1186
+ "ONLINE_PROGRAMS"
1187
+ ])
1188
+ ).optional(),
1189
+ notifyCustomersAboutReward: z.boolean().describe(
1190
+ "Whether to send email notifications to referring customers when they receive a referral reward.\nIf true, referring customers will be notified by email when their referred friend completes a qualifying action (for example, placing an order)."
1191
+ ).optional()
1192
+ }).describe("Configures email notifications for the referral program.").optional(),
1193
+ premiumFeatures: z.object({
1194
+ referralProgram: z.boolean().describe(
1195
+ "Whether the site owner has access to the referral program feature."
1196
+ ).optional()
1197
+ }).describe(
1198
+ "Indicates which premium features are available for the current account."
1199
+ ).optional()
1200
+ }).describe("Paused referral program.").optional()
1201
+ });
1202
+ var GetAiSocialMediaPostsSuggestionsRequest = z.object({
1203
+ options: z.object({
1204
+ topic: z.string().describe(
1205
+ "Topic to generate social media post suggestions for. For example, fitness, education, or technology."
1206
+ ).max(512).optional()
1207
+ }).optional()
1208
+ });
1209
+ var GetAiSocialMediaPostsSuggestionsResponse = z.object({
1210
+ suggestions: z.array(
1211
+ z.object({
1212
+ postContent: z.string().describe("Suggested post content.").max(4096).optional(),
1213
+ hashtags: z.array(z.string()).max(256).optional()
1214
+ })
1215
+ ).max(3).optional(),
1216
+ referFriendsPageUrl: z.string().describe("Referral URL to refer friends.").max(2083).optional().nullable()
1217
+ });
1218
+ var GenerateAiSocialMediaPostsSuggestionsRequest = z.object({
1219
+ options: z.object({
1220
+ topic: z.string().describe(
1221
+ "Topic to generate social media post suggestions for. For example, fitness, education, or technology."
1222
+ ).max(512).optional()
1223
+ }).optional()
1224
+ });
1225
+ var GenerateAiSocialMediaPostsSuggestionsResponse = z.object({
1226
+ suggestions: z.array(
1227
+ z.object({
1228
+ postContent: z.string().describe("Suggested post content.").max(4096).optional(),
1229
+ hashtags: z.array(z.string()).max(256).optional()
1230
+ })
1231
+ ).max(3).optional(),
1232
+ referFriendsPageUrl: z.string().describe("Referral URL to refer friends.").max(2083).optional().nullable()
1233
+ });
1234
+ var GetReferralProgramPremiumFeaturesRequest = z.object({});
1235
+ var GetReferralProgramPremiumFeaturesResponse = z.object({
1236
+ referralProgram: z.boolean().describe("Whether the site has the referral program feature enabled.").optional()
1237
+ });
1238
+ // Annotate the CommonJS export names for ESM import in node:
1239
+ 0 && (module.exports = {
1240
+ ActivateReferralProgramRequest,
1241
+ ActivateReferralProgramResponse,
1242
+ GenerateAiSocialMediaPostsSuggestionsRequest,
1243
+ GenerateAiSocialMediaPostsSuggestionsResponse,
1244
+ GetAiSocialMediaPostsSuggestionsRequest,
1245
+ GetAiSocialMediaPostsSuggestionsResponse,
1246
+ GetReferralProgramPremiumFeaturesRequest,
1247
+ GetReferralProgramPremiumFeaturesResponse,
1248
+ GetReferralProgramRequest,
1249
+ GetReferralProgramResponse,
1250
+ PauseReferralProgramRequest,
1251
+ PauseReferralProgramResponse,
1252
+ UpdateReferralProgramRequest,
1253
+ UpdateReferralProgramResponse
1254
+ });
1255
+ //# sourceMappingURL=schemas.js.map