@wix/auto_sdk_benefit-programs_balances 1.0.50 → 1.0.52
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/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +4 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +4 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +440 -0
- package/build/cjs/schemas.js +881 -0
- package/build/cjs/schemas.js.map +1 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +4 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +4 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +440 -0
- package/build/es/schemas.mjs +835 -0
- package/build/es/schemas.mjs.map +1 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +4 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +4 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +440 -0
- package/build/internal/cjs/schemas.js +881 -0
- package/build/internal/cjs/schemas.js.map +1 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +4 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +4 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +440 -0
- package/build/internal/es/schemas.mjs +835 -0
- package/build/internal/es/schemas.mjs.map +1 -0
- package/package.json +11 -4
- package/schemas/package.json +3 -0
|
@@ -0,0 +1,835 @@
|
|
|
1
|
+
// src/benefit-programs-v1-balance-balances.schemas.ts
|
|
2
|
+
import * as z from "zod";
|
|
3
|
+
var GetBalanceRequest = z.object({
|
|
4
|
+
poolId: z.string().describe(
|
|
5
|
+
"ID of the pool associated with the balance to retrieve. This is also the ID of the balance."
|
|
6
|
+
).regex(
|
|
7
|
+
/^[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}$/,
|
|
8
|
+
"Must be a valid GUID"
|
|
9
|
+
)
|
|
10
|
+
});
|
|
11
|
+
var GetBalanceResponse = z.object({
|
|
12
|
+
_id: z.string().describe("Balance ID. This is the same as the associated pool's ID.").regex(
|
|
13
|
+
/^[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}$/,
|
|
14
|
+
"Must be a valid GUID"
|
|
15
|
+
).optional(),
|
|
16
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
17
|
+
"Revision number, which increments by 1 each time the balance is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the balance."
|
|
18
|
+
).optional().nullable(),
|
|
19
|
+
_createdDate: z.date().describe("Date and time the balance was created.").optional().nullable(),
|
|
20
|
+
_updatedDate: z.date().describe("Date and time the balance was updated.").optional().nullable(),
|
|
21
|
+
beneficiary: z.intersection(
|
|
22
|
+
z.object({}),
|
|
23
|
+
z.xor([
|
|
24
|
+
z.object({
|
|
25
|
+
anonymousVisitorId: z.never().optional(),
|
|
26
|
+
memberId: z.never().optional(),
|
|
27
|
+
wixUserId: z.never().optional()
|
|
28
|
+
}),
|
|
29
|
+
z.object({
|
|
30
|
+
memberId: z.never().optional(),
|
|
31
|
+
wixUserId: z.never().optional(),
|
|
32
|
+
anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
|
|
33
|
+
/^[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}$/,
|
|
34
|
+
"Must be a valid GUID"
|
|
35
|
+
)
|
|
36
|
+
}),
|
|
37
|
+
z.object({
|
|
38
|
+
anonymousVisitorId: z.never().optional(),
|
|
39
|
+
wixUserId: z.never().optional(),
|
|
40
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
41
|
+
/^[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}$/,
|
|
42
|
+
"Must be a valid GUID"
|
|
43
|
+
)
|
|
44
|
+
}),
|
|
45
|
+
z.object({
|
|
46
|
+
anonymousVisitorId: z.never().optional(),
|
|
47
|
+
memberId: z.never().optional(),
|
|
48
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
49
|
+
/^[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}$/,
|
|
50
|
+
"Must be a valid GUID"
|
|
51
|
+
)
|
|
52
|
+
})
|
|
53
|
+
])
|
|
54
|
+
).describe("Beneficiary of the associated pool.").optional(),
|
|
55
|
+
amount: z.object({
|
|
56
|
+
available: z.string().describe("number of available credits.").optional(),
|
|
57
|
+
reserved: z.string().describe("number of reserved credits.").optional()
|
|
58
|
+
}).describe("Available credits.").optional(),
|
|
59
|
+
poolInfo: z.object({
|
|
60
|
+
_id: z.string().describe("Pool ID.").regex(
|
|
61
|
+
/^[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}$/,
|
|
62
|
+
"Must be a valid GUID"
|
|
63
|
+
).optional(),
|
|
64
|
+
poolDefinitionId: z.string().describe("ID of the pool definition the pool was created from.").regex(
|
|
65
|
+
/^[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}$/,
|
|
66
|
+
"Must be a valid GUID"
|
|
67
|
+
).optional().nullable(),
|
|
68
|
+
programDefinitionId: z.string().describe("ID of the program definition the pool was created from.").regex(
|
|
69
|
+
/^[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}$/,
|
|
70
|
+
"Must be a valid GUID"
|
|
71
|
+
).optional().nullable(),
|
|
72
|
+
programId: z.string().describe("ID of the program that contains the pool.").regex(
|
|
73
|
+
/^[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}$/,
|
|
74
|
+
"Must be a valid GUID"
|
|
75
|
+
).optional().nullable(),
|
|
76
|
+
creditAmount: z.string().describe("Available credits.").optional().nullable(),
|
|
77
|
+
namespace: z.string().describe(
|
|
78
|
+
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
79
|
+
).min(1).max(20).optional().nullable(),
|
|
80
|
+
externalProgramDefinitionId: z.string().describe(
|
|
81
|
+
"External ID of the program definition the pool was created from."
|
|
82
|
+
).regex(
|
|
83
|
+
/^[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}$/,
|
|
84
|
+
"Must be a valid GUID"
|
|
85
|
+
).optional().nullable(),
|
|
86
|
+
externalProgramId: z.string().describe("External ID of the program that contains the pool.").regex(
|
|
87
|
+
/^[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}$/,
|
|
88
|
+
"Must be a valid GUID"
|
|
89
|
+
).optional().nullable(),
|
|
90
|
+
creditRolloverConfiguration: z.object({
|
|
91
|
+
enabled: z.boolean().describe(
|
|
92
|
+
"Whether unused credits roll over to a new cycle when a program renews."
|
|
93
|
+
).optional().nullable(),
|
|
94
|
+
balanceCap: z.string().describe(
|
|
95
|
+
"Maximum number of credits that can roll over to the next cycle when a program renews."
|
|
96
|
+
).optional().nullable()
|
|
97
|
+
}).describe("Credit rollover configuration information for the pool.").optional(),
|
|
98
|
+
status: z.enum([
|
|
99
|
+
"ACTIVE",
|
|
100
|
+
"PAUSED",
|
|
101
|
+
"ENDED",
|
|
102
|
+
"PROVISIONING",
|
|
103
|
+
"RENEWING",
|
|
104
|
+
"PENDING"
|
|
105
|
+
]).describe("Pool status").optional()
|
|
106
|
+
}).describe("Associated pool information.").optional(),
|
|
107
|
+
extendedFields: z.object({
|
|
108
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
109
|
+
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
110
|
+
).optional()
|
|
111
|
+
}).describe(
|
|
112
|
+
"Custom field data for the balance object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
113
|
+
).optional(),
|
|
114
|
+
lastTransactionId: z.string().describe(
|
|
115
|
+
"ID of the transaction associated with the most recent change to the balance."
|
|
116
|
+
).regex(
|
|
117
|
+
/^[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}$/,
|
|
118
|
+
"Must be a valid GUID"
|
|
119
|
+
).optional().nullable()
|
|
120
|
+
});
|
|
121
|
+
var ListBalancesRequest = z.object({
|
|
122
|
+
options: z.object({
|
|
123
|
+
poolIds: z.array(z.string()).min(0).max(100).optional(),
|
|
124
|
+
cursorPaging: z.object({
|
|
125
|
+
limit: z.number().int().describe("Maximum number of items to return.").min(0).max(100).optional().nullable(),
|
|
126
|
+
cursor: z.string().describe(
|
|
127
|
+
"Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
|
|
128
|
+
).max(16e3).optional().nullable()
|
|
129
|
+
}).describe("Cursor paging.").optional()
|
|
130
|
+
}).optional()
|
|
131
|
+
});
|
|
132
|
+
var ListBalancesResponse = z.object({
|
|
133
|
+
balances: z.array(
|
|
134
|
+
z.object({
|
|
135
|
+
_id: z.string().describe("Balance ID. This is the same as the associated pool's ID.").regex(
|
|
136
|
+
/^[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}$/,
|
|
137
|
+
"Must be a valid GUID"
|
|
138
|
+
).optional(),
|
|
139
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
140
|
+
"Revision number, which increments by 1 each time the balance is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the balance."
|
|
141
|
+
).optional().nullable(),
|
|
142
|
+
_createdDate: z.date().describe("Date and time the balance was created.").optional().nullable(),
|
|
143
|
+
_updatedDate: z.date().describe("Date and time the balance was updated.").optional().nullable(),
|
|
144
|
+
beneficiary: z.intersection(
|
|
145
|
+
z.object({}),
|
|
146
|
+
z.xor([
|
|
147
|
+
z.object({
|
|
148
|
+
anonymousVisitorId: z.never().optional(),
|
|
149
|
+
memberId: z.never().optional(),
|
|
150
|
+
wixUserId: z.never().optional()
|
|
151
|
+
}),
|
|
152
|
+
z.object({
|
|
153
|
+
memberId: z.never().optional(),
|
|
154
|
+
wixUserId: z.never().optional(),
|
|
155
|
+
anonymousVisitorId: z.string().describe(
|
|
156
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
157
|
+
).regex(
|
|
158
|
+
/^[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}$/,
|
|
159
|
+
"Must be a valid GUID"
|
|
160
|
+
)
|
|
161
|
+
}),
|
|
162
|
+
z.object({
|
|
163
|
+
anonymousVisitorId: z.never().optional(),
|
|
164
|
+
wixUserId: z.never().optional(),
|
|
165
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
166
|
+
/^[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}$/,
|
|
167
|
+
"Must be a valid GUID"
|
|
168
|
+
)
|
|
169
|
+
}),
|
|
170
|
+
z.object({
|
|
171
|
+
anonymousVisitorId: z.never().optional(),
|
|
172
|
+
memberId: z.never().optional(),
|
|
173
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
174
|
+
/^[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}$/,
|
|
175
|
+
"Must be a valid GUID"
|
|
176
|
+
)
|
|
177
|
+
})
|
|
178
|
+
])
|
|
179
|
+
).describe("Beneficiary of the associated pool.").optional(),
|
|
180
|
+
amount: z.object({
|
|
181
|
+
available: z.string().describe("number of available credits.").optional(),
|
|
182
|
+
reserved: z.string().describe("number of reserved credits.").optional()
|
|
183
|
+
}).describe("Available credits.").optional(),
|
|
184
|
+
poolInfo: z.object({
|
|
185
|
+
_id: z.string().describe("Pool ID.").regex(
|
|
186
|
+
/^[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}$/,
|
|
187
|
+
"Must be a valid GUID"
|
|
188
|
+
).optional(),
|
|
189
|
+
poolDefinitionId: z.string().describe("ID of the pool definition the pool was created from.").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
|
+
programDefinitionId: z.string().describe(
|
|
194
|
+
"ID of the program definition the pool was created from."
|
|
195
|
+
).regex(
|
|
196
|
+
/^[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}$/,
|
|
197
|
+
"Must be a valid GUID"
|
|
198
|
+
).optional().nullable(),
|
|
199
|
+
programId: z.string().describe("ID of the program that contains the pool.").regex(
|
|
200
|
+
/^[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}$/,
|
|
201
|
+
"Must be a valid GUID"
|
|
202
|
+
).optional().nullable(),
|
|
203
|
+
creditAmount: z.string().describe("Available credits.").optional().nullable(),
|
|
204
|
+
namespace: z.string().describe(
|
|
205
|
+
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
206
|
+
).min(1).max(20).optional().nullable(),
|
|
207
|
+
externalProgramDefinitionId: z.string().describe(
|
|
208
|
+
"External ID of the program definition the pool was created from."
|
|
209
|
+
).regex(
|
|
210
|
+
/^[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}$/,
|
|
211
|
+
"Must be a valid GUID"
|
|
212
|
+
).optional().nullable(),
|
|
213
|
+
externalProgramId: z.string().describe("External ID of the program that contains the pool.").regex(
|
|
214
|
+
/^[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}$/,
|
|
215
|
+
"Must be a valid GUID"
|
|
216
|
+
).optional().nullable(),
|
|
217
|
+
creditRolloverConfiguration: z.object({
|
|
218
|
+
enabled: z.boolean().describe(
|
|
219
|
+
"Whether unused credits roll over to a new cycle when a program renews."
|
|
220
|
+
).optional().nullable(),
|
|
221
|
+
balanceCap: z.string().describe(
|
|
222
|
+
"Maximum number of credits that can roll over to the next cycle when a program renews."
|
|
223
|
+
).optional().nullable()
|
|
224
|
+
}).describe(
|
|
225
|
+
"Credit rollover configuration information for the pool."
|
|
226
|
+
).optional(),
|
|
227
|
+
status: z.enum([
|
|
228
|
+
"ACTIVE",
|
|
229
|
+
"PAUSED",
|
|
230
|
+
"ENDED",
|
|
231
|
+
"PROVISIONING",
|
|
232
|
+
"RENEWING",
|
|
233
|
+
"PENDING"
|
|
234
|
+
]).describe("Pool status").optional()
|
|
235
|
+
}).describe("Associated pool information.").optional(),
|
|
236
|
+
extendedFields: z.object({
|
|
237
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
238
|
+
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
239
|
+
).optional()
|
|
240
|
+
}).describe(
|
|
241
|
+
"Custom field data for the balance object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
242
|
+
).optional(),
|
|
243
|
+
lastTransactionId: z.string().describe(
|
|
244
|
+
"ID of the transaction associated with the most recent change to the balance."
|
|
245
|
+
).regex(
|
|
246
|
+
/^[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}$/,
|
|
247
|
+
"Must be a valid GUID"
|
|
248
|
+
).optional().nullable()
|
|
249
|
+
})
|
|
250
|
+
).max(100).optional(),
|
|
251
|
+
metadata: z.object({
|
|
252
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
253
|
+
cursors: z.object({
|
|
254
|
+
next: z.string().describe(
|
|
255
|
+
"Cursor string pointing to the next page in the list of results."
|
|
256
|
+
).max(16e3).optional().nullable(),
|
|
257
|
+
prev: z.string().describe(
|
|
258
|
+
"Cursor pointing to the previous page in the list of results."
|
|
259
|
+
).max(16e3).optional().nullable()
|
|
260
|
+
}).describe(
|
|
261
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
262
|
+
).optional(),
|
|
263
|
+
hasNext: z.boolean().describe(
|
|
264
|
+
"Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
|
|
265
|
+
).optional().nullable()
|
|
266
|
+
}).describe("Metadata for paginated results.").optional()
|
|
267
|
+
});
|
|
268
|
+
var QueryBalancesRequest = z.object({
|
|
269
|
+
query: z.object({
|
|
270
|
+
filter: z.object({
|
|
271
|
+
_id: z.object({
|
|
272
|
+
$eq: z.string(),
|
|
273
|
+
$exists: z.boolean(),
|
|
274
|
+
$gt: z.string(),
|
|
275
|
+
$gte: z.string(),
|
|
276
|
+
$hasAll: z.array(z.string()),
|
|
277
|
+
$hasSome: z.array(z.string()),
|
|
278
|
+
$in: z.array(z.string()),
|
|
279
|
+
$lt: z.string(),
|
|
280
|
+
$lte: z.string(),
|
|
281
|
+
$ne: z.string(),
|
|
282
|
+
$nin: z.array(z.string()),
|
|
283
|
+
$startsWith: z.string()
|
|
284
|
+
}).partial().strict().optional(),
|
|
285
|
+
_createdDate: z.object({
|
|
286
|
+
$eq: z.string(),
|
|
287
|
+
$exists: z.boolean(),
|
|
288
|
+
$gt: z.string(),
|
|
289
|
+
$gte: z.string(),
|
|
290
|
+
$hasAll: z.array(z.string()),
|
|
291
|
+
$hasSome: z.array(z.string()),
|
|
292
|
+
$in: z.array(z.string()),
|
|
293
|
+
$lt: z.string(),
|
|
294
|
+
$lte: z.string(),
|
|
295
|
+
$ne: z.string(),
|
|
296
|
+
$nin: z.array(z.string()),
|
|
297
|
+
$startsWith: z.string()
|
|
298
|
+
}).partial().strict().optional(),
|
|
299
|
+
"beneficiary.memberId": z.object({
|
|
300
|
+
$eq: z.any(),
|
|
301
|
+
$exists: z.boolean(),
|
|
302
|
+
$gt: z.any(),
|
|
303
|
+
$gte: z.any(),
|
|
304
|
+
$hasAll: z.array(z.any()),
|
|
305
|
+
$hasSome: z.array(z.any()),
|
|
306
|
+
$in: z.array(z.any()),
|
|
307
|
+
$lt: z.any(),
|
|
308
|
+
$lte: z.any(),
|
|
309
|
+
$ne: z.any(),
|
|
310
|
+
$nin: z.array(z.any()),
|
|
311
|
+
$startsWith: z.string()
|
|
312
|
+
}).partial().strict().optional(),
|
|
313
|
+
"beneficiary.wixUserId": z.object({
|
|
314
|
+
$eq: z.any(),
|
|
315
|
+
$exists: z.boolean(),
|
|
316
|
+
$gt: z.any(),
|
|
317
|
+
$gte: z.any(),
|
|
318
|
+
$hasAll: z.array(z.any()),
|
|
319
|
+
$hasSome: z.array(z.any()),
|
|
320
|
+
$in: z.array(z.any()),
|
|
321
|
+
$lt: z.any(),
|
|
322
|
+
$lte: z.any(),
|
|
323
|
+
$ne: z.any(),
|
|
324
|
+
$nin: z.array(z.any()),
|
|
325
|
+
$startsWith: z.string()
|
|
326
|
+
}).partial().strict().optional(),
|
|
327
|
+
$and: z.array(z.any()).optional(),
|
|
328
|
+
$or: z.array(z.any()).optional(),
|
|
329
|
+
$not: z.any().optional()
|
|
330
|
+
}).strict().optional(),
|
|
331
|
+
sort: z.array(
|
|
332
|
+
z.object({
|
|
333
|
+
fieldName: z.enum([
|
|
334
|
+
"_id",
|
|
335
|
+
"_createdDate",
|
|
336
|
+
"beneficiary.memberId",
|
|
337
|
+
"beneficiary.wixUserId"
|
|
338
|
+
]).optional(),
|
|
339
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
340
|
+
})
|
|
341
|
+
).optional()
|
|
342
|
+
}).catchall(z.any()).describe("Filter, sort, and paging to apply to the query.")
|
|
343
|
+
});
|
|
344
|
+
var QueryBalancesResponse = z.object({
|
|
345
|
+
balances: z.array(
|
|
346
|
+
z.object({
|
|
347
|
+
_id: z.string().describe("Balance ID. This is the same as the associated pool's ID.").regex(
|
|
348
|
+
/^[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}$/,
|
|
349
|
+
"Must be a valid GUID"
|
|
350
|
+
).optional(),
|
|
351
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
352
|
+
"Revision number, which increments by 1 each time the balance is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the balance."
|
|
353
|
+
).optional().nullable(),
|
|
354
|
+
_createdDate: z.date().describe("Date and time the balance was created.").optional().nullable(),
|
|
355
|
+
_updatedDate: z.date().describe("Date and time the balance was updated.").optional().nullable(),
|
|
356
|
+
beneficiary: z.intersection(
|
|
357
|
+
z.object({}),
|
|
358
|
+
z.xor([
|
|
359
|
+
z.object({
|
|
360
|
+
anonymousVisitorId: z.never().optional(),
|
|
361
|
+
memberId: z.never().optional(),
|
|
362
|
+
wixUserId: z.never().optional()
|
|
363
|
+
}),
|
|
364
|
+
z.object({
|
|
365
|
+
memberId: z.never().optional(),
|
|
366
|
+
wixUserId: z.never().optional(),
|
|
367
|
+
anonymousVisitorId: z.string().describe(
|
|
368
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
369
|
+
).regex(
|
|
370
|
+
/^[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}$/,
|
|
371
|
+
"Must be a valid GUID"
|
|
372
|
+
)
|
|
373
|
+
}),
|
|
374
|
+
z.object({
|
|
375
|
+
anonymousVisitorId: z.never().optional(),
|
|
376
|
+
wixUserId: z.never().optional(),
|
|
377
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
378
|
+
/^[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}$/,
|
|
379
|
+
"Must be a valid GUID"
|
|
380
|
+
)
|
|
381
|
+
}),
|
|
382
|
+
z.object({
|
|
383
|
+
anonymousVisitorId: z.never().optional(),
|
|
384
|
+
memberId: z.never().optional(),
|
|
385
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
386
|
+
/^[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}$/,
|
|
387
|
+
"Must be a valid GUID"
|
|
388
|
+
)
|
|
389
|
+
})
|
|
390
|
+
])
|
|
391
|
+
).describe("Beneficiary of the associated pool.").optional(),
|
|
392
|
+
amount: z.object({
|
|
393
|
+
available: z.string().describe("number of available credits.").optional(),
|
|
394
|
+
reserved: z.string().describe("number of reserved credits.").optional()
|
|
395
|
+
}).describe("Available credits.").optional(),
|
|
396
|
+
poolInfo: z.object({
|
|
397
|
+
_id: z.string().describe("Pool ID.").regex(
|
|
398
|
+
/^[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}$/,
|
|
399
|
+
"Must be a valid GUID"
|
|
400
|
+
).optional(),
|
|
401
|
+
poolDefinitionId: z.string().describe("ID of the pool definition the pool was created from.").regex(
|
|
402
|
+
/^[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}$/,
|
|
403
|
+
"Must be a valid GUID"
|
|
404
|
+
).optional().nullable(),
|
|
405
|
+
programDefinitionId: z.string().describe(
|
|
406
|
+
"ID of the program definition the pool was created from."
|
|
407
|
+
).regex(
|
|
408
|
+
/^[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}$/,
|
|
409
|
+
"Must be a valid GUID"
|
|
410
|
+
).optional().nullable(),
|
|
411
|
+
programId: z.string().describe("ID of the program that contains the pool.").regex(
|
|
412
|
+
/^[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}$/,
|
|
413
|
+
"Must be a valid GUID"
|
|
414
|
+
).optional().nullable(),
|
|
415
|
+
creditAmount: z.string().describe("Available credits.").optional().nullable(),
|
|
416
|
+
namespace: z.string().describe(
|
|
417
|
+
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
418
|
+
).min(1).max(20).optional().nullable(),
|
|
419
|
+
externalProgramDefinitionId: z.string().describe(
|
|
420
|
+
"External ID of the program definition the pool was created from."
|
|
421
|
+
).regex(
|
|
422
|
+
/^[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}$/,
|
|
423
|
+
"Must be a valid GUID"
|
|
424
|
+
).optional().nullable(),
|
|
425
|
+
externalProgramId: z.string().describe("External ID of the program that contains the pool.").regex(
|
|
426
|
+
/^[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}$/,
|
|
427
|
+
"Must be a valid GUID"
|
|
428
|
+
).optional().nullable(),
|
|
429
|
+
creditRolloverConfiguration: z.object({
|
|
430
|
+
enabled: z.boolean().describe(
|
|
431
|
+
"Whether unused credits roll over to a new cycle when a program renews."
|
|
432
|
+
).optional().nullable(),
|
|
433
|
+
balanceCap: z.string().describe(
|
|
434
|
+
"Maximum number of credits that can roll over to the next cycle when a program renews."
|
|
435
|
+
).optional().nullable()
|
|
436
|
+
}).describe(
|
|
437
|
+
"Credit rollover configuration information for the pool."
|
|
438
|
+
).optional(),
|
|
439
|
+
status: z.enum([
|
|
440
|
+
"ACTIVE",
|
|
441
|
+
"PAUSED",
|
|
442
|
+
"ENDED",
|
|
443
|
+
"PROVISIONING",
|
|
444
|
+
"RENEWING",
|
|
445
|
+
"PENDING"
|
|
446
|
+
]).describe("Pool status").optional()
|
|
447
|
+
}).describe("Associated pool information.").optional(),
|
|
448
|
+
extendedFields: z.object({
|
|
449
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
450
|
+
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
451
|
+
).optional()
|
|
452
|
+
}).describe(
|
|
453
|
+
"Custom field data for the balance object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
454
|
+
).optional(),
|
|
455
|
+
lastTransactionId: z.string().describe(
|
|
456
|
+
"ID of the transaction associated with the most recent change to the balance."
|
|
457
|
+
).regex(
|
|
458
|
+
/^[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}$/,
|
|
459
|
+
"Must be a valid GUID"
|
|
460
|
+
).optional().nullable()
|
|
461
|
+
})
|
|
462
|
+
).optional(),
|
|
463
|
+
metadata: z.object({
|
|
464
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
465
|
+
cursors: z.object({
|
|
466
|
+
next: z.string().describe(
|
|
467
|
+
"Cursor string pointing to the next page in the list of results."
|
|
468
|
+
).max(16e3).optional().nullable(),
|
|
469
|
+
prev: z.string().describe(
|
|
470
|
+
"Cursor pointing to the previous page in the list of results."
|
|
471
|
+
).max(16e3).optional().nullable()
|
|
472
|
+
}).describe(
|
|
473
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
474
|
+
).optional(),
|
|
475
|
+
hasNext: z.boolean().describe(
|
|
476
|
+
"Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
|
|
477
|
+
).optional().nullable()
|
|
478
|
+
}).describe("Metadata for the paginated results.").optional()
|
|
479
|
+
});
|
|
480
|
+
var ChangeBalanceRequest = z.object({
|
|
481
|
+
poolId: z.string().describe(
|
|
482
|
+
"ID of the pool associated with the balance to change. This is also the ID of the balance."
|
|
483
|
+
).regex(
|
|
484
|
+
/^[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}$/,
|
|
485
|
+
"Must be a valid GUID"
|
|
486
|
+
),
|
|
487
|
+
idempotencyKey: z.string().describe(
|
|
488
|
+
"Unique identifier, generated by the client.\nUsed to recognize repeated attempts to make the same request."
|
|
489
|
+
).max(200),
|
|
490
|
+
options: z.intersection(
|
|
491
|
+
z.object({
|
|
492
|
+
instructingParty: z.intersection(
|
|
493
|
+
z.object({}),
|
|
494
|
+
z.xor([
|
|
495
|
+
z.object({
|
|
496
|
+
anonymousVisitorId: z.never().optional(),
|
|
497
|
+
memberId: z.never().optional(),
|
|
498
|
+
wixUserId: z.never().optional()
|
|
499
|
+
}),
|
|
500
|
+
z.object({
|
|
501
|
+
memberId: z.never().optional(),
|
|
502
|
+
wixUserId: z.never().optional(),
|
|
503
|
+
anonymousVisitorId: z.string().describe(
|
|
504
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
505
|
+
).regex(
|
|
506
|
+
/^[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}$/,
|
|
507
|
+
"Must be a valid GUID"
|
|
508
|
+
)
|
|
509
|
+
}),
|
|
510
|
+
z.object({
|
|
511
|
+
anonymousVisitorId: z.never().optional(),
|
|
512
|
+
wixUserId: z.never().optional(),
|
|
513
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
514
|
+
/^[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}$/,
|
|
515
|
+
"Must be a valid GUID"
|
|
516
|
+
)
|
|
517
|
+
}),
|
|
518
|
+
z.object({
|
|
519
|
+
anonymousVisitorId: z.never().optional(),
|
|
520
|
+
memberId: z.never().optional(),
|
|
521
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
522
|
+
/^[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}$/,
|
|
523
|
+
"Must be a valid GUID"
|
|
524
|
+
)
|
|
525
|
+
})
|
|
526
|
+
])
|
|
527
|
+
).describe("Identity changing the balance.").optional(),
|
|
528
|
+
type: z.enum(["UNKNOWN_OPERATION", "ADJUST", "SET"]).optional(),
|
|
529
|
+
transactionDetails: z.object({
|
|
530
|
+
item: z.object({
|
|
531
|
+
_id: z.string().describe("Item ID.").regex(
|
|
532
|
+
/^[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}$/,
|
|
533
|
+
"Must be a valid GUID"
|
|
534
|
+
).optional().nullable(),
|
|
535
|
+
externalId: z.string().describe("Item external ID.").regex(
|
|
536
|
+
/^[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}$/,
|
|
537
|
+
"Must be a valid GUID"
|
|
538
|
+
).optional().nullable(),
|
|
539
|
+
category: z.string().describe("Item category.").max(20).optional().nullable(),
|
|
540
|
+
itemSetId: z.string().describe("Item set ID.").regex(
|
|
541
|
+
/^[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}$/,
|
|
542
|
+
"Must be a valid GUID"
|
|
543
|
+
).optional().nullable(),
|
|
544
|
+
displayName: z.string().describe("Item name.").max(64).optional().nullable(),
|
|
545
|
+
providerAppId: z.string().describe("Provider app id").regex(
|
|
546
|
+
/^[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}$/,
|
|
547
|
+
"Must be a valid GUID"
|
|
548
|
+
).optional().nullable()
|
|
549
|
+
}).describe("Item associated with the transaction.").optional(),
|
|
550
|
+
itemCount: z.number().int().describe("Amount of items associated with the transaction.").min(0).optional().nullable(),
|
|
551
|
+
effectiveDate: z.date().describe("Date and time the transaction was created.").optional().nullable(),
|
|
552
|
+
reason: z.string().describe("Reason for the transaction. For example, `Redemption`.").max(256).optional().nullable(),
|
|
553
|
+
benefitKey: z.string().describe("Benefit key associated with the transaction.").max(64).optional().nullable()
|
|
554
|
+
}).describe(
|
|
555
|
+
"Details to send to the transaction created from this balance change."
|
|
556
|
+
).optional()
|
|
557
|
+
}),
|
|
558
|
+
z.xor([
|
|
559
|
+
z.object({
|
|
560
|
+
setOptions: z.never().optional(),
|
|
561
|
+
adjustOptions: z.object({
|
|
562
|
+
value: z.string().describe(
|
|
563
|
+
"Amount to change the balance's available credits by.\n- To increase the balance, specify a positive number.\n- To decrease the balance, specify a negative number."
|
|
564
|
+
).optional(),
|
|
565
|
+
beneficiary: z.intersection(
|
|
566
|
+
z.object({}),
|
|
567
|
+
z.xor([
|
|
568
|
+
z.object({
|
|
569
|
+
anonymousVisitorId: z.never().optional(),
|
|
570
|
+
memberId: z.never().optional(),
|
|
571
|
+
wixUserId: z.never().optional()
|
|
572
|
+
}),
|
|
573
|
+
z.object({
|
|
574
|
+
memberId: z.never().optional(),
|
|
575
|
+
wixUserId: z.never().optional(),
|
|
576
|
+
anonymousVisitorId: z.string().describe(
|
|
577
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
578
|
+
).regex(
|
|
579
|
+
/^[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}$/,
|
|
580
|
+
"Must be a valid GUID"
|
|
581
|
+
)
|
|
582
|
+
}),
|
|
583
|
+
z.object({
|
|
584
|
+
anonymousVisitorId: z.never().optional(),
|
|
585
|
+
wixUserId: z.never().optional(),
|
|
586
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
587
|
+
/^[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}$/,
|
|
588
|
+
"Must be a valid GUID"
|
|
589
|
+
)
|
|
590
|
+
}),
|
|
591
|
+
z.object({
|
|
592
|
+
anonymousVisitorId: z.never().optional(),
|
|
593
|
+
memberId: z.never().optional(),
|
|
594
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
595
|
+
/^[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}$/,
|
|
596
|
+
"Must be a valid GUID"
|
|
597
|
+
)
|
|
598
|
+
})
|
|
599
|
+
])
|
|
600
|
+
).describe("Beneficiary of the associated pool.").optional()
|
|
601
|
+
}).describe("Adjust the balance by a specific number of credits.")
|
|
602
|
+
}),
|
|
603
|
+
z.object({
|
|
604
|
+
adjustOptions: z.never().optional(),
|
|
605
|
+
setOptions: z.object({
|
|
606
|
+
value: z.string().describe(
|
|
607
|
+
"Amount to set the balance's available credits to.\n\nIf this is the same as the current value, no transaction is created."
|
|
608
|
+
).optional(),
|
|
609
|
+
beneficiary: z.intersection(
|
|
610
|
+
z.object({}),
|
|
611
|
+
z.xor([
|
|
612
|
+
z.object({
|
|
613
|
+
anonymousVisitorId: z.never().optional(),
|
|
614
|
+
memberId: z.never().optional(),
|
|
615
|
+
wixUserId: z.never().optional()
|
|
616
|
+
}),
|
|
617
|
+
z.object({
|
|
618
|
+
memberId: z.never().optional(),
|
|
619
|
+
wixUserId: z.never().optional(),
|
|
620
|
+
anonymousVisitorId: z.string().describe(
|
|
621
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
622
|
+
).regex(
|
|
623
|
+
/^[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}$/,
|
|
624
|
+
"Must be a valid GUID"
|
|
625
|
+
)
|
|
626
|
+
}),
|
|
627
|
+
z.object({
|
|
628
|
+
anonymousVisitorId: z.never().optional(),
|
|
629
|
+
wixUserId: z.never().optional(),
|
|
630
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
631
|
+
/^[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}$/,
|
|
632
|
+
"Must be a valid GUID"
|
|
633
|
+
)
|
|
634
|
+
}),
|
|
635
|
+
z.object({
|
|
636
|
+
anonymousVisitorId: z.never().optional(),
|
|
637
|
+
memberId: z.never().optional(),
|
|
638
|
+
wixUserId: z.string().describe("ID of a Wix user.").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
|
+
)
|
|
642
|
+
})
|
|
643
|
+
])
|
|
644
|
+
).describe("Beneficiary of the associated pool.").optional()
|
|
645
|
+
}).describe("Set the balance to a specific number of credits.")
|
|
646
|
+
})
|
|
647
|
+
])
|
|
648
|
+
)
|
|
649
|
+
});
|
|
650
|
+
var ChangeBalanceResponse = z.object({
|
|
651
|
+
balance: z.object({
|
|
652
|
+
_id: z.string().describe("Balance ID. This is the same as the associated pool's ID.").regex(
|
|
653
|
+
/^[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}$/,
|
|
654
|
+
"Must be a valid GUID"
|
|
655
|
+
).optional(),
|
|
656
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
657
|
+
"Revision number, which increments by 1 each time the balance is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the balance."
|
|
658
|
+
).optional().nullable(),
|
|
659
|
+
_createdDate: z.date().describe("Date and time the balance was created.").optional().nullable(),
|
|
660
|
+
_updatedDate: z.date().describe("Date and time the balance was updated.").optional().nullable(),
|
|
661
|
+
beneficiary: z.intersection(
|
|
662
|
+
z.object({}),
|
|
663
|
+
z.xor([
|
|
664
|
+
z.object({
|
|
665
|
+
anonymousVisitorId: z.never().optional(),
|
|
666
|
+
memberId: z.never().optional(),
|
|
667
|
+
wixUserId: z.never().optional()
|
|
668
|
+
}),
|
|
669
|
+
z.object({
|
|
670
|
+
memberId: z.never().optional(),
|
|
671
|
+
wixUserId: z.never().optional(),
|
|
672
|
+
anonymousVisitorId: z.string().describe(
|
|
673
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
674
|
+
).regex(
|
|
675
|
+
/^[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}$/,
|
|
676
|
+
"Must be a valid GUID"
|
|
677
|
+
)
|
|
678
|
+
}),
|
|
679
|
+
z.object({
|
|
680
|
+
anonymousVisitorId: z.never().optional(),
|
|
681
|
+
wixUserId: z.never().optional(),
|
|
682
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
683
|
+
/^[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}$/,
|
|
684
|
+
"Must be a valid GUID"
|
|
685
|
+
)
|
|
686
|
+
}),
|
|
687
|
+
z.object({
|
|
688
|
+
anonymousVisitorId: z.never().optional(),
|
|
689
|
+
memberId: z.never().optional(),
|
|
690
|
+
wixUserId: z.string().describe("ID of a Wix user.").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
|
+
)
|
|
694
|
+
})
|
|
695
|
+
])
|
|
696
|
+
).describe("Beneficiary of the associated pool.").optional(),
|
|
697
|
+
amount: z.object({
|
|
698
|
+
available: z.string().describe("number of available credits.").optional(),
|
|
699
|
+
reserved: z.string().describe("number of reserved credits.").optional()
|
|
700
|
+
}).describe("Available credits.").optional(),
|
|
701
|
+
poolInfo: z.object({
|
|
702
|
+
_id: z.string().describe("Pool ID.").regex(
|
|
703
|
+
/^[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}$/,
|
|
704
|
+
"Must be a valid GUID"
|
|
705
|
+
).optional(),
|
|
706
|
+
poolDefinitionId: z.string().describe("ID of the pool definition the pool was created from.").regex(
|
|
707
|
+
/^[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}$/,
|
|
708
|
+
"Must be a valid GUID"
|
|
709
|
+
).optional().nullable(),
|
|
710
|
+
programDefinitionId: z.string().describe("ID of the program definition the pool was created from.").regex(
|
|
711
|
+
/^[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}$/,
|
|
712
|
+
"Must be a valid GUID"
|
|
713
|
+
).optional().nullable(),
|
|
714
|
+
programId: z.string().describe("ID of the program that contains the pool.").regex(
|
|
715
|
+
/^[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}$/,
|
|
716
|
+
"Must be a valid GUID"
|
|
717
|
+
).optional().nullable(),
|
|
718
|
+
creditAmount: z.string().describe("Available credits.").optional().nullable(),
|
|
719
|
+
namespace: z.string().describe(
|
|
720
|
+
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
721
|
+
).min(1).max(20).optional().nullable(),
|
|
722
|
+
externalProgramDefinitionId: z.string().describe(
|
|
723
|
+
"External ID of the program definition the pool was created from."
|
|
724
|
+
).regex(
|
|
725
|
+
/^[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}$/,
|
|
726
|
+
"Must be a valid GUID"
|
|
727
|
+
).optional().nullable(),
|
|
728
|
+
externalProgramId: z.string().describe("External ID of the program that contains the pool.").regex(
|
|
729
|
+
/^[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}$/,
|
|
730
|
+
"Must be a valid GUID"
|
|
731
|
+
).optional().nullable(),
|
|
732
|
+
creditRolloverConfiguration: z.object({
|
|
733
|
+
enabled: z.boolean().describe(
|
|
734
|
+
"Whether unused credits roll over to a new cycle when a program renews."
|
|
735
|
+
).optional().nullable(),
|
|
736
|
+
balanceCap: z.string().describe(
|
|
737
|
+
"Maximum number of credits that can roll over to the next cycle when a program renews."
|
|
738
|
+
).optional().nullable()
|
|
739
|
+
}).describe("Credit rollover configuration information for the pool.").optional(),
|
|
740
|
+
status: z.enum([
|
|
741
|
+
"ACTIVE",
|
|
742
|
+
"PAUSED",
|
|
743
|
+
"ENDED",
|
|
744
|
+
"PROVISIONING",
|
|
745
|
+
"RENEWING",
|
|
746
|
+
"PENDING"
|
|
747
|
+
]).describe("Pool status").optional()
|
|
748
|
+
}).describe("Associated pool information.").optional(),
|
|
749
|
+
extendedFields: z.object({
|
|
750
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
751
|
+
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
752
|
+
).optional()
|
|
753
|
+
}).describe(
|
|
754
|
+
"Custom field data for the balance object.\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
755
|
+
).optional(),
|
|
756
|
+
lastTransactionId: z.string().describe(
|
|
757
|
+
"ID of the transaction associated with the most recent change to the balance."
|
|
758
|
+
).regex(
|
|
759
|
+
/^[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}$/,
|
|
760
|
+
"Must be a valid GUID"
|
|
761
|
+
).optional().nullable()
|
|
762
|
+
}).describe("Updated balance.").optional(),
|
|
763
|
+
transactionId: z.string().describe("ID of the transaction associated with this change in balance.").regex(
|
|
764
|
+
/^[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}$/,
|
|
765
|
+
"Must be a valid GUID"
|
|
766
|
+
).optional().nullable()
|
|
767
|
+
});
|
|
768
|
+
var RevertBalanceChangeRequest = z.object({
|
|
769
|
+
transactionId: z.string().describe(
|
|
770
|
+
"ID of the transaction associated with the balance change to revert."
|
|
771
|
+
).regex(
|
|
772
|
+
/^[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}$/,
|
|
773
|
+
"Must be a valid GUID"
|
|
774
|
+
),
|
|
775
|
+
idempotencyKey: z.string().describe(
|
|
776
|
+
"Ignored value, kept for backward compatibility. Idempotency is now handled by the system."
|
|
777
|
+
).max(200),
|
|
778
|
+
options: z.object({
|
|
779
|
+
instructingParty: z.intersection(
|
|
780
|
+
z.object({}),
|
|
781
|
+
z.xor([
|
|
782
|
+
z.object({
|
|
783
|
+
anonymousVisitorId: z.never().optional(),
|
|
784
|
+
memberId: z.never().optional(),
|
|
785
|
+
wixUserId: z.never().optional()
|
|
786
|
+
}),
|
|
787
|
+
z.object({
|
|
788
|
+
memberId: z.never().optional(),
|
|
789
|
+
wixUserId: z.never().optional(),
|
|
790
|
+
anonymousVisitorId: z.string().describe(
|
|
791
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
792
|
+
).regex(
|
|
793
|
+
/^[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}$/,
|
|
794
|
+
"Must be a valid GUID"
|
|
795
|
+
)
|
|
796
|
+
}),
|
|
797
|
+
z.object({
|
|
798
|
+
anonymousVisitorId: z.never().optional(),
|
|
799
|
+
wixUserId: z.never().optional(),
|
|
800
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
801
|
+
/^[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}$/,
|
|
802
|
+
"Must be a valid GUID"
|
|
803
|
+
)
|
|
804
|
+
}),
|
|
805
|
+
z.object({
|
|
806
|
+
anonymousVisitorId: z.never().optional(),
|
|
807
|
+
memberId: z.never().optional(),
|
|
808
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
809
|
+
/^[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}$/,
|
|
810
|
+
"Must be a valid GUID"
|
|
811
|
+
)
|
|
812
|
+
})
|
|
813
|
+
])
|
|
814
|
+
).describe("Identity reverting the balance change.").optional()
|
|
815
|
+
}).optional()
|
|
816
|
+
});
|
|
817
|
+
var RevertBalanceChangeResponse = z.object({
|
|
818
|
+
transactionId: z.string().describe("ID of the transaction associated with the balance reversion.").regex(
|
|
819
|
+
/^[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}$/,
|
|
820
|
+
"Must be a valid GUID"
|
|
821
|
+
).optional().nullable()
|
|
822
|
+
});
|
|
823
|
+
export {
|
|
824
|
+
ChangeBalanceRequest,
|
|
825
|
+
ChangeBalanceResponse,
|
|
826
|
+
GetBalanceRequest,
|
|
827
|
+
GetBalanceResponse,
|
|
828
|
+
ListBalancesRequest,
|
|
829
|
+
ListBalancesResponse,
|
|
830
|
+
QueryBalancesRequest,
|
|
831
|
+
QueryBalancesResponse,
|
|
832
|
+
RevertBalanceChangeRequest,
|
|
833
|
+
RevertBalanceChangeResponse
|
|
834
|
+
};
|
|
835
|
+
//# sourceMappingURL=schemas.mjs.map
|