@wix/auto_sdk_loyalty_earning-rules 1.0.41 → 1.0.42
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/schemas.d.ts +469 -0
- package/build/cjs/schemas.js +1001 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/schemas.d.mts +469 -0
- package/build/es/schemas.mjs +949 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/schemas.d.ts +469 -0
- package/build/internal/cjs/schemas.js +1001 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/schemas.d.mts +469 -0
- package/build/internal/es/schemas.mjs +949 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/package.json +12 -5
- package/schemas/package.json +3 -0
|
@@ -0,0 +1,1001 @@
|
|
|
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
|
+
BulkCreateLoyaltyEarningRulesRequest: () => BulkCreateLoyaltyEarningRulesRequest,
|
|
34
|
+
BulkCreateLoyaltyEarningRulesResponse: () => BulkCreateLoyaltyEarningRulesResponse,
|
|
35
|
+
CreateCustomLoyaltyEarningRuleRequest: () => CreateCustomLoyaltyEarningRuleRequest,
|
|
36
|
+
CreateCustomLoyaltyEarningRuleResponse: () => CreateCustomLoyaltyEarningRuleResponse,
|
|
37
|
+
CreateLoyaltyEarningRuleRequest: () => CreateLoyaltyEarningRuleRequest,
|
|
38
|
+
CreateLoyaltyEarningRuleResponse: () => CreateLoyaltyEarningRuleResponse,
|
|
39
|
+
DeleteAutomationEarningRuleRequest: () => DeleteAutomationEarningRuleRequest,
|
|
40
|
+
DeleteAutomationEarningRuleResponse: () => DeleteAutomationEarningRuleResponse,
|
|
41
|
+
DeleteLoyaltyEarningRuleRequest: () => DeleteLoyaltyEarningRuleRequest,
|
|
42
|
+
DeleteLoyaltyEarningRuleResponse: () => DeleteLoyaltyEarningRuleResponse,
|
|
43
|
+
GetLoyaltyEarningRuleRequest: () => GetLoyaltyEarningRuleRequest,
|
|
44
|
+
GetLoyaltyEarningRuleResponse: () => GetLoyaltyEarningRuleResponse,
|
|
45
|
+
ListEarningRulesRequest: () => ListEarningRulesRequest,
|
|
46
|
+
ListEarningRulesResponse: () => ListEarningRulesResponse,
|
|
47
|
+
UpdateLoyaltyEarningRuleRequest: () => UpdateLoyaltyEarningRuleRequest,
|
|
48
|
+
UpdateLoyaltyEarningRuleResponse: () => UpdateLoyaltyEarningRuleResponse
|
|
49
|
+
});
|
|
50
|
+
module.exports = __toCommonJS(schemas_exports);
|
|
51
|
+
|
|
52
|
+
// src/loyalty-v1-loyalty-earning-rule-earning-rules.schemas.ts
|
|
53
|
+
var z = __toESM(require("zod"));
|
|
54
|
+
var CreateLoyaltyEarningRuleRequest = z.object({
|
|
55
|
+
earningRule: z.intersection(
|
|
56
|
+
z.object({
|
|
57
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
58
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
59
|
+
"Must be a valid GUID"
|
|
60
|
+
).optional().nullable(),
|
|
61
|
+
sourceAppId: z.string().describe(
|
|
62
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
63
|
+
).regex(
|
|
64
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
65
|
+
"Must be a valid GUID"
|
|
66
|
+
),
|
|
67
|
+
triggerAppId: z.string().describe(
|
|
68
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
69
|
+
).min(1).max(80),
|
|
70
|
+
triggerActivityType: z.string().describe(
|
|
71
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
72
|
+
).min(1).max(80),
|
|
73
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50),
|
|
74
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]),
|
|
75
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
76
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
77
|
+
).optional().nullable(),
|
|
78
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
79
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
80
|
+
metadata: z.object({
|
|
81
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
82
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
83
|
+
triggerFilters: z.array(
|
|
84
|
+
z.object({
|
|
85
|
+
fieldKey: z.string().describe(
|
|
86
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
87
|
+
).max(110).optional(),
|
|
88
|
+
values: z.array(z.string()).max(100).optional()
|
|
89
|
+
})
|
|
90
|
+
).max(100).optional()
|
|
91
|
+
}),
|
|
92
|
+
z.xor([
|
|
93
|
+
z.object({
|
|
94
|
+
conversionRate: z.never().optional(),
|
|
95
|
+
fixedAmount: z.object({
|
|
96
|
+
configs: z.array(
|
|
97
|
+
z.object({
|
|
98
|
+
tierId: z.string().describe(
|
|
99
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
100
|
+
).regex(
|
|
101
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
102
|
+
"Must be a valid GUID"
|
|
103
|
+
).optional().nullable(),
|
|
104
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
105
|
+
})
|
|
106
|
+
).max(21).optional()
|
|
107
|
+
}).describe(
|
|
108
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
109
|
+
)
|
|
110
|
+
}),
|
|
111
|
+
z.object({
|
|
112
|
+
fixedAmount: z.never().optional(),
|
|
113
|
+
conversionRate: z.object({
|
|
114
|
+
configs: z.array(
|
|
115
|
+
z.object({
|
|
116
|
+
tierId: z.string().describe(
|
|
117
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
118
|
+
).regex(
|
|
119
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
120
|
+
"Must be a valid GUID"
|
|
121
|
+
).optional().nullable(),
|
|
122
|
+
moneyAmount: z.number().int().describe(
|
|
123
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
124
|
+
).optional(),
|
|
125
|
+
points: z.number().int().describe(
|
|
126
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
127
|
+
).optional()
|
|
128
|
+
})
|
|
129
|
+
).max(21).optional(),
|
|
130
|
+
field: z.string().describe(
|
|
131
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
132
|
+
).optional().nullable()
|
|
133
|
+
}).describe(
|
|
134
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
135
|
+
)
|
|
136
|
+
})
|
|
137
|
+
])
|
|
138
|
+
).describe("Earning rule to create.")
|
|
139
|
+
});
|
|
140
|
+
var CreateLoyaltyEarningRuleResponse = z.intersection(
|
|
141
|
+
z.object({
|
|
142
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
143
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
144
|
+
"Must be a valid GUID"
|
|
145
|
+
).optional().nullable(),
|
|
146
|
+
sourceAppId: z.string().describe(
|
|
147
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
148
|
+
).regex(
|
|
149
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
150
|
+
"Must be a valid GUID"
|
|
151
|
+
).optional(),
|
|
152
|
+
triggerAppId: z.string().describe(
|
|
153
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
154
|
+
).min(1).max(80).optional(),
|
|
155
|
+
triggerActivityType: z.string().describe(
|
|
156
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
157
|
+
).min(1).max(80).optional(),
|
|
158
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional(),
|
|
159
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]).describe("Current status of the earning rule.").optional(),
|
|
160
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
161
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
162
|
+
).optional().nullable(),
|
|
163
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
164
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
165
|
+
metadata: z.object({
|
|
166
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
167
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
168
|
+
triggerFilters: z.array(
|
|
169
|
+
z.object({
|
|
170
|
+
fieldKey: z.string().describe(
|
|
171
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
172
|
+
).max(110).optional(),
|
|
173
|
+
values: z.array(z.string()).max(100).optional()
|
|
174
|
+
})
|
|
175
|
+
).max(100).optional()
|
|
176
|
+
}),
|
|
177
|
+
z.xor([
|
|
178
|
+
z.object({
|
|
179
|
+
fixedAmount: z.never().optional(),
|
|
180
|
+
conversionRate: z.never().optional()
|
|
181
|
+
}),
|
|
182
|
+
z.object({
|
|
183
|
+
conversionRate: z.never().optional(),
|
|
184
|
+
fixedAmount: z.object({
|
|
185
|
+
configs: z.array(
|
|
186
|
+
z.object({
|
|
187
|
+
tierId: z.string().describe(
|
|
188
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
189
|
+
).regex(
|
|
190
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
191
|
+
"Must be a valid GUID"
|
|
192
|
+
).optional().nullable(),
|
|
193
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
194
|
+
})
|
|
195
|
+
).max(21).optional()
|
|
196
|
+
}).describe(
|
|
197
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
198
|
+
)
|
|
199
|
+
}),
|
|
200
|
+
z.object({
|
|
201
|
+
fixedAmount: z.never().optional(),
|
|
202
|
+
conversionRate: z.object({
|
|
203
|
+
configs: z.array(
|
|
204
|
+
z.object({
|
|
205
|
+
tierId: z.string().describe(
|
|
206
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
207
|
+
).regex(
|
|
208
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
209
|
+
"Must be a valid GUID"
|
|
210
|
+
).optional().nullable(),
|
|
211
|
+
moneyAmount: z.number().int().describe(
|
|
212
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
213
|
+
).optional(),
|
|
214
|
+
points: z.number().int().describe(
|
|
215
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
216
|
+
).optional()
|
|
217
|
+
})
|
|
218
|
+
).max(21).optional(),
|
|
219
|
+
field: z.string().describe(
|
|
220
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
221
|
+
).optional().nullable()
|
|
222
|
+
}).describe(
|
|
223
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
224
|
+
)
|
|
225
|
+
})
|
|
226
|
+
])
|
|
227
|
+
);
|
|
228
|
+
var BulkCreateLoyaltyEarningRulesRequest = z.object({
|
|
229
|
+
earningRules: z.array(
|
|
230
|
+
z.intersection(
|
|
231
|
+
z.object({
|
|
232
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
233
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
234
|
+
"Must be a valid GUID"
|
|
235
|
+
).optional().nullable(),
|
|
236
|
+
sourceAppId: z.string().describe(
|
|
237
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
238
|
+
).regex(
|
|
239
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
240
|
+
"Must be a valid GUID"
|
|
241
|
+
),
|
|
242
|
+
triggerAppId: z.string().describe(
|
|
243
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
244
|
+
).min(1).max(80),
|
|
245
|
+
triggerActivityType: z.string().describe(
|
|
246
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
247
|
+
).min(1).max(80),
|
|
248
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50),
|
|
249
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]),
|
|
250
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
251
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
252
|
+
).optional().nullable(),
|
|
253
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
254
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
255
|
+
metadata: z.object({
|
|
256
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
257
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
258
|
+
triggerFilters: z.array(
|
|
259
|
+
z.object({
|
|
260
|
+
fieldKey: z.string().describe(
|
|
261
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
262
|
+
).max(110).optional(),
|
|
263
|
+
values: z.array(z.string()).max(100).optional()
|
|
264
|
+
})
|
|
265
|
+
).max(100).optional()
|
|
266
|
+
}),
|
|
267
|
+
z.xor([
|
|
268
|
+
z.object({
|
|
269
|
+
conversionRate: z.never().optional(),
|
|
270
|
+
fixedAmount: z.object({
|
|
271
|
+
configs: z.array(
|
|
272
|
+
z.object({
|
|
273
|
+
tierId: z.string().describe(
|
|
274
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
275
|
+
).regex(
|
|
276
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
277
|
+
"Must be a valid GUID"
|
|
278
|
+
).optional().nullable(),
|
|
279
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
280
|
+
})
|
|
281
|
+
).max(21).optional()
|
|
282
|
+
}).describe(
|
|
283
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
284
|
+
)
|
|
285
|
+
}),
|
|
286
|
+
z.object({
|
|
287
|
+
fixedAmount: z.never().optional(),
|
|
288
|
+
conversionRate: z.object({
|
|
289
|
+
configs: z.array(
|
|
290
|
+
z.object({
|
|
291
|
+
tierId: z.string().describe(
|
|
292
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
293
|
+
).regex(
|
|
294
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
295
|
+
"Must be a valid GUID"
|
|
296
|
+
).optional().nullable(),
|
|
297
|
+
moneyAmount: z.number().int().describe(
|
|
298
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
299
|
+
).optional(),
|
|
300
|
+
points: z.number().int().describe(
|
|
301
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
302
|
+
).optional()
|
|
303
|
+
})
|
|
304
|
+
).max(21).optional(),
|
|
305
|
+
field: z.string().describe(
|
|
306
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
307
|
+
).optional().nullable()
|
|
308
|
+
}).describe(
|
|
309
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
310
|
+
)
|
|
311
|
+
})
|
|
312
|
+
])
|
|
313
|
+
)
|
|
314
|
+
).min(1).max(100)
|
|
315
|
+
});
|
|
316
|
+
var BulkCreateLoyaltyEarningRulesResponse = z.object({
|
|
317
|
+
results: z.array(
|
|
318
|
+
z.object({
|
|
319
|
+
itemMetadata: z.object({
|
|
320
|
+
_id: z.string().describe(
|
|
321
|
+
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
322
|
+
).optional().nullable(),
|
|
323
|
+
originalIndex: z.number().int().describe(
|
|
324
|
+
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
325
|
+
).optional(),
|
|
326
|
+
success: z.boolean().describe(
|
|
327
|
+
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
328
|
+
).optional(),
|
|
329
|
+
error: z.object({
|
|
330
|
+
code: z.string().describe("Error code.").optional(),
|
|
331
|
+
description: z.string().describe("Description of the error.").optional(),
|
|
332
|
+
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
333
|
+
}).describe("Details about the error in case of failure.").optional()
|
|
334
|
+
}).describe("Additional metadata for the created earning rules.").optional(),
|
|
335
|
+
item: z.intersection(
|
|
336
|
+
z.object({
|
|
337
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
338
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
339
|
+
"Must be a valid GUID"
|
|
340
|
+
).optional().nullable(),
|
|
341
|
+
sourceAppId: z.string().describe(
|
|
342
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
343
|
+
).regex(
|
|
344
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
345
|
+
"Must be a valid GUID"
|
|
346
|
+
).optional(),
|
|
347
|
+
triggerAppId: z.string().describe(
|
|
348
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
349
|
+
).min(1).max(80).optional(),
|
|
350
|
+
triggerActivityType: z.string().describe(
|
|
351
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
352
|
+
).min(1).max(80).optional(),
|
|
353
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional(),
|
|
354
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]).describe("Current status of the earning rule.").optional(),
|
|
355
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
356
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
357
|
+
).optional().nullable(),
|
|
358
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
359
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
360
|
+
metadata: z.object({
|
|
361
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
362
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
363
|
+
triggerFilters: z.array(
|
|
364
|
+
z.object({
|
|
365
|
+
fieldKey: z.string().describe(
|
|
366
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
367
|
+
).max(110).optional(),
|
|
368
|
+
values: z.array(z.string()).max(100).optional()
|
|
369
|
+
})
|
|
370
|
+
).max(100).optional()
|
|
371
|
+
}),
|
|
372
|
+
z.xor([
|
|
373
|
+
z.object({
|
|
374
|
+
fixedAmount: z.never().optional(),
|
|
375
|
+
conversionRate: z.never().optional()
|
|
376
|
+
}),
|
|
377
|
+
z.object({
|
|
378
|
+
conversionRate: z.never().optional(),
|
|
379
|
+
fixedAmount: z.object({
|
|
380
|
+
configs: z.array(
|
|
381
|
+
z.object({
|
|
382
|
+
tierId: z.string().describe(
|
|
383
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
384
|
+
).regex(
|
|
385
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
386
|
+
"Must be a valid GUID"
|
|
387
|
+
).optional().nullable(),
|
|
388
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
389
|
+
})
|
|
390
|
+
).max(21).optional()
|
|
391
|
+
}).describe(
|
|
392
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
393
|
+
)
|
|
394
|
+
}),
|
|
395
|
+
z.object({
|
|
396
|
+
fixedAmount: z.never().optional(),
|
|
397
|
+
conversionRate: z.object({
|
|
398
|
+
configs: z.array(
|
|
399
|
+
z.object({
|
|
400
|
+
tierId: z.string().describe(
|
|
401
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
402
|
+
).regex(
|
|
403
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
404
|
+
"Must be a valid GUID"
|
|
405
|
+
).optional().nullable(),
|
|
406
|
+
moneyAmount: z.number().int().describe(
|
|
407
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
408
|
+
).optional(),
|
|
409
|
+
points: z.number().int().describe(
|
|
410
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
411
|
+
).optional()
|
|
412
|
+
})
|
|
413
|
+
).max(21).optional(),
|
|
414
|
+
field: z.string().describe(
|
|
415
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
416
|
+
).optional().nullable()
|
|
417
|
+
}).describe(
|
|
418
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
419
|
+
)
|
|
420
|
+
})
|
|
421
|
+
])
|
|
422
|
+
).describe("Created earning rule.").optional()
|
|
423
|
+
})
|
|
424
|
+
).optional(),
|
|
425
|
+
bulkActionMetadata: z.object({
|
|
426
|
+
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
427
|
+
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
428
|
+
undetailedFailures: z.number().int().describe(
|
|
429
|
+
"Number of failures without details because detailed failure threshold was exceeded."
|
|
430
|
+
).optional()
|
|
431
|
+
}).describe("Additional metadata for the created earning rules.").optional()
|
|
432
|
+
});
|
|
433
|
+
var CreateCustomLoyaltyEarningRuleRequest = z.object({
|
|
434
|
+
type: z.enum(["SOCIAL_MEDIA", "BIRTHDAY"]),
|
|
435
|
+
options: z.object({
|
|
436
|
+
earningRule: z.intersection(
|
|
437
|
+
z.object({
|
|
438
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional()
|
|
439
|
+
}),
|
|
440
|
+
z.xor([
|
|
441
|
+
z.object({
|
|
442
|
+
fixedAmount: z.never().optional(),
|
|
443
|
+
conversionRate: z.never().optional()
|
|
444
|
+
}),
|
|
445
|
+
z.object({
|
|
446
|
+
conversionRate: z.never().optional(),
|
|
447
|
+
fixedAmount: z.object({
|
|
448
|
+
configs: z.array(
|
|
449
|
+
z.object({
|
|
450
|
+
tierId: z.string().describe(
|
|
451
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
452
|
+
).regex(
|
|
453
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
454
|
+
"Must be a valid GUID"
|
|
455
|
+
).optional().nullable(),
|
|
456
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
457
|
+
})
|
|
458
|
+
).max(21).optional()
|
|
459
|
+
}).describe(
|
|
460
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
461
|
+
)
|
|
462
|
+
}),
|
|
463
|
+
z.object({
|
|
464
|
+
fixedAmount: z.never().optional(),
|
|
465
|
+
conversionRate: z.object({
|
|
466
|
+
configs: z.array(
|
|
467
|
+
z.object({
|
|
468
|
+
tierId: z.string().describe(
|
|
469
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
470
|
+
).regex(
|
|
471
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
472
|
+
"Must be a valid GUID"
|
|
473
|
+
).optional().nullable(),
|
|
474
|
+
moneyAmount: z.number().int().describe(
|
|
475
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
476
|
+
).optional(),
|
|
477
|
+
points: z.number().int().describe(
|
|
478
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
479
|
+
).optional()
|
|
480
|
+
})
|
|
481
|
+
).max(21).optional(),
|
|
482
|
+
field: z.string().describe(
|
|
483
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
484
|
+
).optional().nullable()
|
|
485
|
+
}).describe(
|
|
486
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
487
|
+
)
|
|
488
|
+
})
|
|
489
|
+
])
|
|
490
|
+
).describe("Custom earning rule to create.").optional()
|
|
491
|
+
}).optional()
|
|
492
|
+
});
|
|
493
|
+
var CreateCustomLoyaltyEarningRuleResponse = z.object({
|
|
494
|
+
earningRule: z.intersection(
|
|
495
|
+
z.object({
|
|
496
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
497
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
498
|
+
"Must be a valid GUID"
|
|
499
|
+
).optional().nullable(),
|
|
500
|
+
sourceAppId: z.string().describe(
|
|
501
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
502
|
+
).regex(
|
|
503
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
504
|
+
"Must be a valid GUID"
|
|
505
|
+
).optional(),
|
|
506
|
+
triggerAppId: z.string().describe(
|
|
507
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
508
|
+
).min(1).max(80).optional(),
|
|
509
|
+
triggerActivityType: z.string().describe(
|
|
510
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
511
|
+
).min(1).max(80).optional(),
|
|
512
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional(),
|
|
513
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]).describe("Current status of the earning rule.").optional(),
|
|
514
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
515
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
516
|
+
).optional().nullable(),
|
|
517
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
518
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
519
|
+
metadata: z.object({
|
|
520
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
521
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
522
|
+
triggerFilters: z.array(
|
|
523
|
+
z.object({
|
|
524
|
+
fieldKey: z.string().describe(
|
|
525
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
526
|
+
).max(110).optional(),
|
|
527
|
+
values: z.array(z.string()).max(100).optional()
|
|
528
|
+
})
|
|
529
|
+
).max(100).optional()
|
|
530
|
+
}),
|
|
531
|
+
z.xor([
|
|
532
|
+
z.object({
|
|
533
|
+
fixedAmount: z.never().optional(),
|
|
534
|
+
conversionRate: z.never().optional()
|
|
535
|
+
}),
|
|
536
|
+
z.object({
|
|
537
|
+
conversionRate: z.never().optional(),
|
|
538
|
+
fixedAmount: z.object({
|
|
539
|
+
configs: z.array(
|
|
540
|
+
z.object({
|
|
541
|
+
tierId: z.string().describe(
|
|
542
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
543
|
+
).regex(
|
|
544
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
545
|
+
"Must be a valid GUID"
|
|
546
|
+
).optional().nullable(),
|
|
547
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
548
|
+
})
|
|
549
|
+
).max(21).optional()
|
|
550
|
+
}).describe(
|
|
551
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
552
|
+
)
|
|
553
|
+
}),
|
|
554
|
+
z.object({
|
|
555
|
+
fixedAmount: z.never().optional(),
|
|
556
|
+
conversionRate: z.object({
|
|
557
|
+
configs: z.array(
|
|
558
|
+
z.object({
|
|
559
|
+
tierId: z.string().describe(
|
|
560
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
561
|
+
).regex(
|
|
562
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
563
|
+
"Must be a valid GUID"
|
|
564
|
+
).optional().nullable(),
|
|
565
|
+
moneyAmount: z.number().int().describe(
|
|
566
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
567
|
+
).optional(),
|
|
568
|
+
points: z.number().int().describe(
|
|
569
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
570
|
+
).optional()
|
|
571
|
+
})
|
|
572
|
+
).max(21).optional(),
|
|
573
|
+
field: z.string().describe(
|
|
574
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
575
|
+
).optional().nullable()
|
|
576
|
+
}).describe(
|
|
577
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
578
|
+
)
|
|
579
|
+
})
|
|
580
|
+
])
|
|
581
|
+
).describe("Created earning rule.").optional()
|
|
582
|
+
});
|
|
583
|
+
var GetLoyaltyEarningRuleRequest = z.object({
|
|
584
|
+
_id: z.string().describe("ID of the earning rule to retrieve.").regex(
|
|
585
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
586
|
+
"Must be a valid GUID"
|
|
587
|
+
)
|
|
588
|
+
});
|
|
589
|
+
var GetLoyaltyEarningRuleResponse = z.intersection(
|
|
590
|
+
z.object({
|
|
591
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
592
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
593
|
+
"Must be a valid GUID"
|
|
594
|
+
).optional().nullable(),
|
|
595
|
+
sourceAppId: z.string().describe(
|
|
596
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
597
|
+
).regex(
|
|
598
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
599
|
+
"Must be a valid GUID"
|
|
600
|
+
).optional(),
|
|
601
|
+
triggerAppId: z.string().describe(
|
|
602
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
603
|
+
).min(1).max(80).optional(),
|
|
604
|
+
triggerActivityType: z.string().describe(
|
|
605
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
606
|
+
).min(1).max(80).optional(),
|
|
607
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional(),
|
|
608
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]).describe("Current status of the earning rule.").optional(),
|
|
609
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
610
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
611
|
+
).optional().nullable(),
|
|
612
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
613
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
614
|
+
metadata: z.object({
|
|
615
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
616
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
617
|
+
triggerFilters: z.array(
|
|
618
|
+
z.object({
|
|
619
|
+
fieldKey: z.string().describe(
|
|
620
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
621
|
+
).max(110).optional(),
|
|
622
|
+
values: z.array(z.string()).max(100).optional()
|
|
623
|
+
})
|
|
624
|
+
).max(100).optional()
|
|
625
|
+
}),
|
|
626
|
+
z.xor([
|
|
627
|
+
z.object({
|
|
628
|
+
fixedAmount: z.never().optional(),
|
|
629
|
+
conversionRate: z.never().optional()
|
|
630
|
+
}),
|
|
631
|
+
z.object({
|
|
632
|
+
conversionRate: z.never().optional(),
|
|
633
|
+
fixedAmount: z.object({
|
|
634
|
+
configs: z.array(
|
|
635
|
+
z.object({
|
|
636
|
+
tierId: z.string().describe(
|
|
637
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
638
|
+
).regex(
|
|
639
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
640
|
+
"Must be a valid GUID"
|
|
641
|
+
).optional().nullable(),
|
|
642
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
643
|
+
})
|
|
644
|
+
).max(21).optional()
|
|
645
|
+
}).describe(
|
|
646
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
647
|
+
)
|
|
648
|
+
}),
|
|
649
|
+
z.object({
|
|
650
|
+
fixedAmount: z.never().optional(),
|
|
651
|
+
conversionRate: z.object({
|
|
652
|
+
configs: z.array(
|
|
653
|
+
z.object({
|
|
654
|
+
tierId: z.string().describe(
|
|
655
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
656
|
+
).regex(
|
|
657
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
658
|
+
"Must be a valid GUID"
|
|
659
|
+
).optional().nullable(),
|
|
660
|
+
moneyAmount: z.number().int().describe(
|
|
661
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
662
|
+
).optional(),
|
|
663
|
+
points: z.number().int().describe(
|
|
664
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
665
|
+
).optional()
|
|
666
|
+
})
|
|
667
|
+
).max(21).optional(),
|
|
668
|
+
field: z.string().describe(
|
|
669
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
670
|
+
).optional().nullable()
|
|
671
|
+
}).describe(
|
|
672
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
673
|
+
)
|
|
674
|
+
})
|
|
675
|
+
])
|
|
676
|
+
);
|
|
677
|
+
var UpdateLoyaltyEarningRuleRequest = z.object({
|
|
678
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
679
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
680
|
+
"Must be a valid GUID"
|
|
681
|
+
),
|
|
682
|
+
earningRule: z.intersection(
|
|
683
|
+
z.object({
|
|
684
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
685
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
686
|
+
"Must be a valid GUID"
|
|
687
|
+
).optional().nullable(),
|
|
688
|
+
sourceAppId: z.string().describe(
|
|
689
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
690
|
+
).regex(
|
|
691
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
692
|
+
"Must be a valid GUID"
|
|
693
|
+
).optional(),
|
|
694
|
+
triggerAppId: z.string().describe(
|
|
695
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
696
|
+
).min(1).max(80).optional(),
|
|
697
|
+
triggerActivityType: z.string().describe(
|
|
698
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
699
|
+
).min(1).max(80).optional(),
|
|
700
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional(),
|
|
701
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]).optional(),
|
|
702
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
703
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
704
|
+
).optional().nullable(),
|
|
705
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
706
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
707
|
+
metadata: z.object({
|
|
708
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
709
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
710
|
+
triggerFilters: z.array(
|
|
711
|
+
z.object({
|
|
712
|
+
fieldKey: z.string().describe(
|
|
713
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
714
|
+
).max(110).optional(),
|
|
715
|
+
values: z.array(z.string()).max(100).optional()
|
|
716
|
+
})
|
|
717
|
+
).max(100).optional()
|
|
718
|
+
}),
|
|
719
|
+
z.xor([
|
|
720
|
+
z.object({
|
|
721
|
+
fixedAmount: z.never().optional(),
|
|
722
|
+
conversionRate: z.never().optional()
|
|
723
|
+
}),
|
|
724
|
+
z.object({
|
|
725
|
+
conversionRate: z.never().optional(),
|
|
726
|
+
fixedAmount: z.object({
|
|
727
|
+
configs: z.array(
|
|
728
|
+
z.object({
|
|
729
|
+
tierId: z.string().describe(
|
|
730
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
731
|
+
).regex(
|
|
732
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
733
|
+
"Must be a valid GUID"
|
|
734
|
+
).optional().nullable(),
|
|
735
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
736
|
+
})
|
|
737
|
+
).max(21).optional()
|
|
738
|
+
}).describe(
|
|
739
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
740
|
+
)
|
|
741
|
+
}),
|
|
742
|
+
z.object({
|
|
743
|
+
fixedAmount: z.never().optional(),
|
|
744
|
+
conversionRate: z.object({
|
|
745
|
+
configs: z.array(
|
|
746
|
+
z.object({
|
|
747
|
+
tierId: z.string().describe(
|
|
748
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
749
|
+
).regex(
|
|
750
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
751
|
+
"Must be a valid GUID"
|
|
752
|
+
).optional().nullable(),
|
|
753
|
+
moneyAmount: z.number().int().describe(
|
|
754
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
755
|
+
).optional(),
|
|
756
|
+
points: z.number().int().describe(
|
|
757
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
758
|
+
).optional()
|
|
759
|
+
})
|
|
760
|
+
).max(21).optional(),
|
|
761
|
+
field: z.string().describe(
|
|
762
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
763
|
+
).optional().nullable()
|
|
764
|
+
}).describe(
|
|
765
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
766
|
+
)
|
|
767
|
+
})
|
|
768
|
+
])
|
|
769
|
+
).describe("Earning rule to update.")
|
|
770
|
+
});
|
|
771
|
+
var UpdateLoyaltyEarningRuleResponse = z.object({
|
|
772
|
+
earningRule: z.intersection(
|
|
773
|
+
z.object({
|
|
774
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
775
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
776
|
+
"Must be a valid GUID"
|
|
777
|
+
).optional().nullable(),
|
|
778
|
+
sourceAppId: z.string().describe(
|
|
779
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
780
|
+
).regex(
|
|
781
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
782
|
+
"Must be a valid GUID"
|
|
783
|
+
).optional(),
|
|
784
|
+
triggerAppId: z.string().describe(
|
|
785
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
786
|
+
).min(1).max(80).optional(),
|
|
787
|
+
triggerActivityType: z.string().describe(
|
|
788
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
789
|
+
).min(1).max(80).optional(),
|
|
790
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional(),
|
|
791
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]).describe("Current status of the earning rule.").optional(),
|
|
792
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
793
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
794
|
+
).optional().nullable(),
|
|
795
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
796
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
797
|
+
metadata: z.object({
|
|
798
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
799
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
800
|
+
triggerFilters: z.array(
|
|
801
|
+
z.object({
|
|
802
|
+
fieldKey: z.string().describe(
|
|
803
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
804
|
+
).max(110).optional(),
|
|
805
|
+
values: z.array(z.string()).max(100).optional()
|
|
806
|
+
})
|
|
807
|
+
).max(100).optional()
|
|
808
|
+
}),
|
|
809
|
+
z.xor([
|
|
810
|
+
z.object({
|
|
811
|
+
fixedAmount: z.never().optional(),
|
|
812
|
+
conversionRate: z.never().optional()
|
|
813
|
+
}),
|
|
814
|
+
z.object({
|
|
815
|
+
conversionRate: z.never().optional(),
|
|
816
|
+
fixedAmount: z.object({
|
|
817
|
+
configs: z.array(
|
|
818
|
+
z.object({
|
|
819
|
+
tierId: z.string().describe(
|
|
820
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
821
|
+
).regex(
|
|
822
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
823
|
+
"Must be a valid GUID"
|
|
824
|
+
).optional().nullable(),
|
|
825
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
826
|
+
})
|
|
827
|
+
).max(21).optional()
|
|
828
|
+
}).describe(
|
|
829
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
830
|
+
)
|
|
831
|
+
}),
|
|
832
|
+
z.object({
|
|
833
|
+
fixedAmount: z.never().optional(),
|
|
834
|
+
conversionRate: z.object({
|
|
835
|
+
configs: z.array(
|
|
836
|
+
z.object({
|
|
837
|
+
tierId: z.string().describe(
|
|
838
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
839
|
+
).regex(
|
|
840
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
841
|
+
"Must be a valid GUID"
|
|
842
|
+
).optional().nullable(),
|
|
843
|
+
moneyAmount: z.number().int().describe(
|
|
844
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
845
|
+
).optional(),
|
|
846
|
+
points: z.number().int().describe(
|
|
847
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
848
|
+
).optional()
|
|
849
|
+
})
|
|
850
|
+
).max(21).optional(),
|
|
851
|
+
field: z.string().describe(
|
|
852
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
853
|
+
).optional().nullable()
|
|
854
|
+
}).describe(
|
|
855
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
856
|
+
)
|
|
857
|
+
})
|
|
858
|
+
])
|
|
859
|
+
).describe("The updated earning rule.").optional()
|
|
860
|
+
});
|
|
861
|
+
var DeleteLoyaltyEarningRuleRequest = z.object({
|
|
862
|
+
_id: z.string().describe("ID of the earning rule to delete.").regex(
|
|
863
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
864
|
+
"Must be a valid GUID"
|
|
865
|
+
),
|
|
866
|
+
options: z.object({
|
|
867
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
868
|
+
"Revision of the earning rule. Incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
869
|
+
).optional()
|
|
870
|
+
}).optional()
|
|
871
|
+
});
|
|
872
|
+
var DeleteLoyaltyEarningRuleResponse = z.object({});
|
|
873
|
+
var DeleteAutomationEarningRuleRequest = z.object({
|
|
874
|
+
_id: z.string().describe("ID of the earning rule to delete.").regex(
|
|
875
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
876
|
+
"Must be a valid GUID"
|
|
877
|
+
)
|
|
878
|
+
});
|
|
879
|
+
var DeleteAutomationEarningRuleResponse = z.object({});
|
|
880
|
+
var ListEarningRulesRequest = z.object({
|
|
881
|
+
options: z.object({
|
|
882
|
+
triggerAppId: z.string().describe(
|
|
883
|
+
"App ID that triggers the point assignment. For example, `9a5d83fd-8570-482e-81ab-cfa88942ee60`."
|
|
884
|
+
).optional().nullable(),
|
|
885
|
+
triggerActivityType: z.string().describe(
|
|
886
|
+
"Type of activity that triggers the point assignment. For example, `restaurants-order-is-pending`."
|
|
887
|
+
).optional().nullable()
|
|
888
|
+
}).optional()
|
|
889
|
+
});
|
|
890
|
+
var ListEarningRulesResponse = z.object({
|
|
891
|
+
earningRules: z.array(
|
|
892
|
+
z.intersection(
|
|
893
|
+
z.object({
|
|
894
|
+
_id: z.string().describe("Loyalty earning rule ID.").regex(
|
|
895
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
896
|
+
"Must be a valid GUID"
|
|
897
|
+
).optional().nullable(),
|
|
898
|
+
sourceAppId: z.string().describe(
|
|
899
|
+
"ID of the app managing the earning rule. Can be a loyalty app ID or a Wix automations app ID."
|
|
900
|
+
).regex(
|
|
901
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
902
|
+
"Must be a valid GUID"
|
|
903
|
+
).optional(),
|
|
904
|
+
triggerAppId: z.string().describe(
|
|
905
|
+
"ID of the app that triggers point assignment. Examples: Wix Stores, Wix Bookings, Wix Events."
|
|
906
|
+
).min(1).max(80).optional(),
|
|
907
|
+
triggerActivityType: z.string().describe(
|
|
908
|
+
"Type of activity that triggers point assignment. For example, `wix-restaurants/orderSubmitted` or `birthday`."
|
|
909
|
+
).min(1).max(80).optional(),
|
|
910
|
+
title: z.string().describe("Name of the earning rule.").min(1).max(50).optional(),
|
|
911
|
+
status: z.enum(["UNKNOWN", "ACTIVE", "PAUSED"]).describe("Current status of the earning rule.").optional(),
|
|
912
|
+
revision: z.string().regex(/^\d+$/, "Must be a valid UInt64 string").describe(
|
|
913
|
+
"Revision number, incremented by 1 each time the earning rule is updated.\nPass the latest `revision` when updating to prevent conflicting changes."
|
|
914
|
+
).optional().nullable(),
|
|
915
|
+
_createdDate: z.date().describe("Date and time the earning rule was created.").optional().nullable(),
|
|
916
|
+
_updatedDate: z.date().describe("Date and time the earning rule was last updated.").optional().nullable(),
|
|
917
|
+
metadata: z.object({
|
|
918
|
+
canBeDeleted: z.boolean().describe("Whether the earning rule can be deleted.").optional()
|
|
919
|
+
}).describe("Additional metadata about the earning rule.").optional(),
|
|
920
|
+
triggerFilters: z.array(
|
|
921
|
+
z.object({
|
|
922
|
+
fieldKey: z.string().describe(
|
|
923
|
+
'Key identifying the field in the trigger payload (e.g., "service_id", "eventId", "programId").'
|
|
924
|
+
).max(110).optional(),
|
|
925
|
+
values: z.array(z.string()).max(100).optional()
|
|
926
|
+
})
|
|
927
|
+
).max(100).optional()
|
|
928
|
+
}),
|
|
929
|
+
z.xor([
|
|
930
|
+
z.object({
|
|
931
|
+
fixedAmount: z.never().optional(),
|
|
932
|
+
conversionRate: z.never().optional()
|
|
933
|
+
}),
|
|
934
|
+
z.object({
|
|
935
|
+
conversionRate: z.never().optional(),
|
|
936
|
+
fixedAmount: z.object({
|
|
937
|
+
configs: z.array(
|
|
938
|
+
z.object({
|
|
939
|
+
tierId: z.string().describe(
|
|
940
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
941
|
+
).regex(
|
|
942
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
943
|
+
"Must be a valid GUID"
|
|
944
|
+
).optional().nullable(),
|
|
945
|
+
points: z.number().int().describe("Number of points to award.").optional()
|
|
946
|
+
})
|
|
947
|
+
).max(21).optional()
|
|
948
|
+
}).describe(
|
|
949
|
+
"Fixed amount of points awarded for each qualifying activity."
|
|
950
|
+
)
|
|
951
|
+
}),
|
|
952
|
+
z.object({
|
|
953
|
+
fixedAmount: z.never().optional(),
|
|
954
|
+
conversionRate: z.object({
|
|
955
|
+
configs: z.array(
|
|
956
|
+
z.object({
|
|
957
|
+
tierId: z.string().describe(
|
|
958
|
+
"Tier ID. If empty, the base tier is used. See the Tiers API for more information."
|
|
959
|
+
).regex(
|
|
960
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
961
|
+
"Must be a valid GUID"
|
|
962
|
+
).optional().nullable(),
|
|
963
|
+
moneyAmount: z.number().int().describe(
|
|
964
|
+
"The amount of money used as a reference for point calculation.\nPoints are awarded proportionally to the amount spent.\n\nFor example, if set to 10, 1 point is awarded for every 10 units of currency spent (assuming `points` is set to 1).\n\nFormula for points is: `(amount spent) / (money_amount * points)`."
|
|
965
|
+
).optional(),
|
|
966
|
+
points: z.number().int().describe(
|
|
967
|
+
"Points given for the specified `money_amount`.\nWorks in conjunction with `money_amount` to define the earning rule.\n\nFor example: If `money_amount` is 20 and `points` is 10:\n- Spending 10 units of currency earns 5 points\n- Spending 20 units of currency earns 10 points\n- Spending 30 units of currency earns 15 points"
|
|
968
|
+
).optional()
|
|
969
|
+
})
|
|
970
|
+
).max(21).optional(),
|
|
971
|
+
field: z.string().describe(
|
|
972
|
+
'Specifies which field in the Wix automations trigger payload [REST](https://dev.wix.com/docs/rest/business-management/automations/introduction#how-do-automations-work)|[SDK](https://dev.wix.com/docs/sdk/backend-modules/automations/triggered-events/reporting-and-canceling-events) to use for calculating points in conversion rate rules.\nFor example, if set to "priceSummary.totalAmount", the rule uses the total order amount to calculate loyalty points to be awarded.\nThis field is only applicable for automated earning rules.'
|
|
973
|
+
).optional().nullable()
|
|
974
|
+
}).describe(
|
|
975
|
+
"Points awarded based on a conversion rate formula: `(amount spent) / (money_amount * points)`."
|
|
976
|
+
)
|
|
977
|
+
})
|
|
978
|
+
])
|
|
979
|
+
)
|
|
980
|
+
).optional()
|
|
981
|
+
});
|
|
982
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
983
|
+
0 && (module.exports = {
|
|
984
|
+
BulkCreateLoyaltyEarningRulesRequest,
|
|
985
|
+
BulkCreateLoyaltyEarningRulesResponse,
|
|
986
|
+
CreateCustomLoyaltyEarningRuleRequest,
|
|
987
|
+
CreateCustomLoyaltyEarningRuleResponse,
|
|
988
|
+
CreateLoyaltyEarningRuleRequest,
|
|
989
|
+
CreateLoyaltyEarningRuleResponse,
|
|
990
|
+
DeleteAutomationEarningRuleRequest,
|
|
991
|
+
DeleteAutomationEarningRuleResponse,
|
|
992
|
+
DeleteLoyaltyEarningRuleRequest,
|
|
993
|
+
DeleteLoyaltyEarningRuleResponse,
|
|
994
|
+
GetLoyaltyEarningRuleRequest,
|
|
995
|
+
GetLoyaltyEarningRuleResponse,
|
|
996
|
+
ListEarningRulesRequest,
|
|
997
|
+
ListEarningRulesResponse,
|
|
998
|
+
UpdateLoyaltyEarningRuleRequest,
|
|
999
|
+
UpdateLoyaltyEarningRuleResponse
|
|
1000
|
+
});
|
|
1001
|
+
//# sourceMappingURL=schemas.js.map
|