@wix/auto_sdk_benefit-programs_transactions 1.0.53 → 1.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +3 -1
- package/build/cjs/index.js +512 -8
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +506 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/schemas.d.ts +3 -3
- package/build/es/index.d.mts +3 -1
- package/build/es/index.mjs +502 -8
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +496 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/schemas.d.mts +3 -3
- package/build/internal/cjs/index.d.ts +3 -1
- package/build/internal/cjs/index.js +512 -8
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +506 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +3 -3
- package/build/internal/es/index.d.mts +3 -1
- package/build/internal/es/index.mjs +502 -8
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +496 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +3 -3
- package/package.json +4 -4
package/build/cjs/index.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@
|
|
|
2
2
|
import { Transaction, TransactionsQueryBuilder, TransactionQuery, typedQueryTransactions } from './index.typings.js';
|
|
3
3
|
export { AccountInfo, ActionEvent, ApplicationError, BalanceType, BalanceTypeWithLiterals, BulkActionMetadata, BulkCreateTransactionsRequest, BulkCreateTransactionsResponse, BulkTransactionResult, BulkUpdateTransactionsRequest, BulkUpdateTransactionsResponse, CommonIdentificationData, CommonIdentificationDataIdOneOf, CommonQueryWithEntityContext, CreateTransactionRequest, CreateTransactionResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DomainEvent, DomainEventBodyOneOf, DuplicateExternalIdErrorData, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, ExtendedFields, FailedTransactionDetails, GetTransactionRequest, GetTransactionResponse, IdentificationData, IdentificationDataIdOneOf, IdentityType, IdentityTypeWithLiterals, Item, ItemMetadata, MaskedTransaction, MessageEnvelope, PoolInfo, QueryTransactionsRequest, QueryTransactionsResponse, RequestedValues, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, TransactionDetails, TransactionQuerySpec, TransactionStatus, TransactionStatusDetailsOneOf, TransactionStatusWithLiterals, TransactionsQueryResult, UpdateTransactionRequest, UpdateTransactionResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.js';
|
|
4
4
|
|
|
5
|
-
declare function getTransaction$1(httpClient: HttpClient
|
|
5
|
+
declare function getTransaction$1(httpClient: HttpClient, __options?: {
|
|
6
|
+
validateRequestSchema?: boolean;
|
|
7
|
+
}): GetTransactionSignature;
|
|
6
8
|
interface GetTransactionSignature {
|
|
7
9
|
/**
|
|
8
10
|
* Retrieves a transaction.
|
package/build/cjs/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
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
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// index.ts
|
|
@@ -198,6 +208,494 @@ function queryTransactions(payload) {
|
|
|
198
208
|
|
|
199
209
|
// src/benefit-programs-v1-transaction-transactions.universal.ts
|
|
200
210
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
211
|
+
|
|
212
|
+
// src/benefit-programs-v1-transaction-transactions.schemas.ts
|
|
213
|
+
var z = __toESM(require("zod"));
|
|
214
|
+
var GetTransactionRequest = z.object({
|
|
215
|
+
transactionId: z.string().describe("ID of the transaction to retrieve.").regex(
|
|
216
|
+
/^[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}$/,
|
|
217
|
+
"Must be a valid GUID"
|
|
218
|
+
)
|
|
219
|
+
});
|
|
220
|
+
var GetTransactionResponse = z.object({
|
|
221
|
+
_id: z.string().describe("Transaction ID.").regex(
|
|
222
|
+
/^[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}$/,
|
|
223
|
+
"Must be a valid GUID"
|
|
224
|
+
).optional().nullable(),
|
|
225
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
226
|
+
"Revision number, which increments by 1 each time the transaction is updated."
|
|
227
|
+
).optional().nullable(),
|
|
228
|
+
_createdDate: z.date().describe("Date and time the transaction was created.").optional().nullable(),
|
|
229
|
+
_updatedDate: z.date().describe("Date and time the transaction was updated.").optional().nullable(),
|
|
230
|
+
pool: z.object({
|
|
231
|
+
_id: z.string().describe("Pool ID.").regex(
|
|
232
|
+
/^[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}$/,
|
|
233
|
+
"Must be a valid GUID"
|
|
234
|
+
).optional(),
|
|
235
|
+
poolDefinitionId: z.string().describe("ID of the pool definition the pool was created from.").regex(
|
|
236
|
+
/^[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}$/,
|
|
237
|
+
"Must be a valid GUID"
|
|
238
|
+
).optional().nullable(),
|
|
239
|
+
programDefinitionId: z.string().describe(
|
|
240
|
+
"ID of the program definition containing the pool definition the pool was created from."
|
|
241
|
+
).regex(
|
|
242
|
+
/^[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}$/,
|
|
243
|
+
"Must be a valid GUID"
|
|
244
|
+
).optional().nullable(),
|
|
245
|
+
externalProgramDefinitionId: z.string().describe(
|
|
246
|
+
"External ID of the program definition the pool was created from."
|
|
247
|
+
).regex(
|
|
248
|
+
/^[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}$/,
|
|
249
|
+
"Must be a valid GUID"
|
|
250
|
+
).optional().nullable(),
|
|
251
|
+
programId: z.string().describe("ID of the program that contains the pool.").regex(
|
|
252
|
+
/^[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}$/,
|
|
253
|
+
"Must be a valid GUID"
|
|
254
|
+
).optional().nullable(),
|
|
255
|
+
externalProgramId: z.string().describe("External ID of the program that contains the pool.").regex(
|
|
256
|
+
/^[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}$/,
|
|
257
|
+
"Must be a valid GUID"
|
|
258
|
+
).optional().nullable(),
|
|
259
|
+
creditAmount: z.string().describe("Available credits.").optional().nullable(),
|
|
260
|
+
namespace: z.string().describe(
|
|
261
|
+
"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."
|
|
262
|
+
).min(1).max(20).optional().nullable(),
|
|
263
|
+
displayName: z.string().describe("Pool name").max(64).optional().nullable(),
|
|
264
|
+
benefitDisplayName: z.string().describe("Benefit name").max(40).optional().nullable()
|
|
265
|
+
}).describe("Pool associated with this transaction.").optional(),
|
|
266
|
+
amount: z.string().describe("Amount the balance was adjusted in this transaction.").optional(),
|
|
267
|
+
source: z.enum(["AVAILABLE", "EXTERNAL"]).describe("Where the credits came from.").optional(),
|
|
268
|
+
target: z.enum(["AVAILABLE", "EXTERNAL"]).describe("Where the credits went to.").optional(),
|
|
269
|
+
idempotencyKey: z.string().describe(
|
|
270
|
+
"Unique identifier, generated by the client.\nUsed to recognize repeated attempts to make the same request."
|
|
271
|
+
).max(200).optional(),
|
|
272
|
+
relatedTransactionId: z.string().describe(
|
|
273
|
+
"ID of the related transaction. For example, if this transaction is a refund for a benefit redemption, the related transaction is the benefit redemption transaction."
|
|
274
|
+
).regex(
|
|
275
|
+
/^[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}$/,
|
|
276
|
+
"Must be a valid GUID"
|
|
277
|
+
).optional().nullable(),
|
|
278
|
+
beneficiary: z.intersection(
|
|
279
|
+
z.object({}),
|
|
280
|
+
z.xor([
|
|
281
|
+
z.object({
|
|
282
|
+
anonymousVisitorId: z.never().optional(),
|
|
283
|
+
memberId: z.never().optional(),
|
|
284
|
+
wixUserId: z.never().optional()
|
|
285
|
+
}),
|
|
286
|
+
z.object({
|
|
287
|
+
memberId: z.never().optional(),
|
|
288
|
+
wixUserId: z.never().optional(),
|
|
289
|
+
anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
|
|
290
|
+
/^[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}$/,
|
|
291
|
+
"Must be a valid GUID"
|
|
292
|
+
)
|
|
293
|
+
}),
|
|
294
|
+
z.object({
|
|
295
|
+
anonymousVisitorId: z.never().optional(),
|
|
296
|
+
wixUserId: z.never().optional(),
|
|
297
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
298
|
+
/^[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}$/,
|
|
299
|
+
"Must be a valid GUID"
|
|
300
|
+
)
|
|
301
|
+
}),
|
|
302
|
+
z.object({
|
|
303
|
+
anonymousVisitorId: z.never().optional(),
|
|
304
|
+
memberId: z.never().optional(),
|
|
305
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
306
|
+
/^[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}$/,
|
|
307
|
+
"Must be a valid GUID"
|
|
308
|
+
)
|
|
309
|
+
})
|
|
310
|
+
])
|
|
311
|
+
).describe("Beneficiary of the pool associated with this transaction.").optional(),
|
|
312
|
+
instructingParty: z.intersection(
|
|
313
|
+
z.object({}),
|
|
314
|
+
z.xor([
|
|
315
|
+
z.object({
|
|
316
|
+
anonymousVisitorId: z.never().optional(),
|
|
317
|
+
memberId: z.never().optional(),
|
|
318
|
+
wixUserId: z.never().optional()
|
|
319
|
+
}),
|
|
320
|
+
z.object({
|
|
321
|
+
memberId: z.never().optional(),
|
|
322
|
+
wixUserId: z.never().optional(),
|
|
323
|
+
anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
|
|
324
|
+
/^[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}$/,
|
|
325
|
+
"Must be a valid GUID"
|
|
326
|
+
)
|
|
327
|
+
}),
|
|
328
|
+
z.object({
|
|
329
|
+
anonymousVisitorId: z.never().optional(),
|
|
330
|
+
wixUserId: z.never().optional(),
|
|
331
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
332
|
+
/^[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}$/,
|
|
333
|
+
"Must be a valid GUID"
|
|
334
|
+
)
|
|
335
|
+
}),
|
|
336
|
+
z.object({
|
|
337
|
+
anonymousVisitorId: z.never().optional(),
|
|
338
|
+
memberId: z.never().optional(),
|
|
339
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
340
|
+
/^[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}$/,
|
|
341
|
+
"Must be a valid GUID"
|
|
342
|
+
)
|
|
343
|
+
})
|
|
344
|
+
])
|
|
345
|
+
).describe("Identity that created the transaction.").optional(),
|
|
346
|
+
status: z.enum(["PENDING", "COMPLETED", "FAILED"]).describe("Transaction status.").optional(),
|
|
347
|
+
details: z.object({
|
|
348
|
+
item: z.object({
|
|
349
|
+
_id: z.string().describe("Item ID.").regex(
|
|
350
|
+
/^[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}$/,
|
|
351
|
+
"Must be a valid GUID"
|
|
352
|
+
).optional().nullable(),
|
|
353
|
+
externalId: z.string().describe("Item external ID.").regex(
|
|
354
|
+
/^[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}$/,
|
|
355
|
+
"Must be a valid GUID"
|
|
356
|
+
).optional().nullable(),
|
|
357
|
+
category: z.string().describe("Item category.").max(20).optional().nullable(),
|
|
358
|
+
itemSetId: z.string().describe("Item set ID.").regex(
|
|
359
|
+
/^[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}$/,
|
|
360
|
+
"Must be a valid GUID"
|
|
361
|
+
).optional().nullable(),
|
|
362
|
+
displayName: z.string().describe("Item name.").max(64).optional().nullable(),
|
|
363
|
+
providerAppId: z.string().describe("Provider app id").regex(
|
|
364
|
+
/^[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}$/,
|
|
365
|
+
"Must be a valid GUID"
|
|
366
|
+
).optional().nullable()
|
|
367
|
+
}).describe("Item associated with the transaction.").optional(),
|
|
368
|
+
itemCount: z.number().int().describe("Amount of items associated with the transaction.").min(0).optional().nullable(),
|
|
369
|
+
effectiveDate: z.date().describe("Date and time the transaction was created.").optional().nullable(),
|
|
370
|
+
reason: z.string().describe("Reason for the transaction. For example, `Redemption`.").max(256).optional().nullable(),
|
|
371
|
+
benefitKey: z.string().describe("Benefit key associated with the transaction.").max(64).optional().nullable()
|
|
372
|
+
}).describe("Additional transaction details.").optional(),
|
|
373
|
+
extendedFields: z.object({
|
|
374
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
375
|
+
"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)."
|
|
376
|
+
).optional()
|
|
377
|
+
}).describe(
|
|
378
|
+
"Custom field data for the transaction object.\n\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."
|
|
379
|
+
).optional(),
|
|
380
|
+
externalId: z.string().describe("External transaction ID.").regex(
|
|
381
|
+
/^[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}$/,
|
|
382
|
+
"Must be a valid GUID"
|
|
383
|
+
).optional().nullable()
|
|
384
|
+
});
|
|
385
|
+
var QueryTransactionsRequest = z.object({
|
|
386
|
+
query: z.object({
|
|
387
|
+
filter: z.object({
|
|
388
|
+
_id: z.object({
|
|
389
|
+
$eq: z.string(),
|
|
390
|
+
$exists: z.boolean(),
|
|
391
|
+
$gt: z.string(),
|
|
392
|
+
$gte: z.string(),
|
|
393
|
+
$hasAll: z.array(z.string()),
|
|
394
|
+
$hasSome: z.array(z.string()),
|
|
395
|
+
$in: z.array(z.string()),
|
|
396
|
+
$lt: z.string(),
|
|
397
|
+
$lte: z.string(),
|
|
398
|
+
$ne: z.string(),
|
|
399
|
+
$nin: z.array(z.string()),
|
|
400
|
+
$startsWith: z.string()
|
|
401
|
+
}).partial().strict().optional(),
|
|
402
|
+
relatedTransactionId: z.object({
|
|
403
|
+
$eq: z.string(),
|
|
404
|
+
$exists: z.boolean(),
|
|
405
|
+
$gt: z.string(),
|
|
406
|
+
$gte: z.string(),
|
|
407
|
+
$hasAll: z.array(z.string()),
|
|
408
|
+
$hasSome: z.array(z.string()),
|
|
409
|
+
$in: z.array(z.string()),
|
|
410
|
+
$lt: z.string(),
|
|
411
|
+
$lte: z.string(),
|
|
412
|
+
$ne: z.string(),
|
|
413
|
+
$nin: z.array(z.string()),
|
|
414
|
+
$startsWith: z.string()
|
|
415
|
+
}).partial().strict().optional(),
|
|
416
|
+
"pool._id": z.object({
|
|
417
|
+
$eq: z.string(),
|
|
418
|
+
$exists: z.boolean(),
|
|
419
|
+
$gt: z.string(),
|
|
420
|
+
$gte: z.string(),
|
|
421
|
+
$hasAll: z.array(z.string()),
|
|
422
|
+
$hasSome: z.array(z.string()),
|
|
423
|
+
$in: z.array(z.string()),
|
|
424
|
+
$lt: z.string(),
|
|
425
|
+
$lte: z.string(),
|
|
426
|
+
$ne: z.string(),
|
|
427
|
+
$nin: z.array(z.string()),
|
|
428
|
+
$startsWith: z.string()
|
|
429
|
+
}).partial().strict().optional(),
|
|
430
|
+
"beneficiary.memberId": z.object({
|
|
431
|
+
$eq: z.any(),
|
|
432
|
+
$exists: z.boolean(),
|
|
433
|
+
$gt: z.any(),
|
|
434
|
+
$gte: z.any(),
|
|
435
|
+
$hasAll: z.array(z.any()),
|
|
436
|
+
$hasSome: z.array(z.any()),
|
|
437
|
+
$in: z.array(z.any()),
|
|
438
|
+
$lt: z.any(),
|
|
439
|
+
$lte: z.any(),
|
|
440
|
+
$ne: z.any(),
|
|
441
|
+
$nin: z.array(z.any()),
|
|
442
|
+
$startsWith: z.string()
|
|
443
|
+
}).partial().strict().optional(),
|
|
444
|
+
"beneficiary.wixUserId": z.object({
|
|
445
|
+
$eq: z.any(),
|
|
446
|
+
$exists: z.boolean(),
|
|
447
|
+
$gt: z.any(),
|
|
448
|
+
$gte: z.any(),
|
|
449
|
+
$hasAll: z.array(z.any()),
|
|
450
|
+
$hasSome: z.array(z.any()),
|
|
451
|
+
$in: z.array(z.any()),
|
|
452
|
+
$lt: z.any(),
|
|
453
|
+
$lte: z.any(),
|
|
454
|
+
$ne: z.any(),
|
|
455
|
+
$nin: z.array(z.any()),
|
|
456
|
+
$startsWith: z.string()
|
|
457
|
+
}).partial().strict().optional(),
|
|
458
|
+
"details.item._id": z.object({
|
|
459
|
+
$eq: z.string(),
|
|
460
|
+
$exists: z.boolean(),
|
|
461
|
+
$gt: z.string(),
|
|
462
|
+
$gte: z.string(),
|
|
463
|
+
$hasAll: z.array(z.string()),
|
|
464
|
+
$hasSome: z.array(z.string()),
|
|
465
|
+
$in: z.array(z.string()),
|
|
466
|
+
$lt: z.string(),
|
|
467
|
+
$lte: z.string(),
|
|
468
|
+
$ne: z.string(),
|
|
469
|
+
$nin: z.array(z.string()),
|
|
470
|
+
$startsWith: z.string()
|
|
471
|
+
}).partial().strict().optional(),
|
|
472
|
+
_createdDate: z.object({
|
|
473
|
+
$eq: z.string(),
|
|
474
|
+
$exists: z.boolean(),
|
|
475
|
+
$gt: z.string(),
|
|
476
|
+
$gte: z.string(),
|
|
477
|
+
$hasAll: z.array(z.string()),
|
|
478
|
+
$hasSome: z.array(z.string()),
|
|
479
|
+
$in: z.array(z.string()),
|
|
480
|
+
$lt: z.string(),
|
|
481
|
+
$lte: z.string(),
|
|
482
|
+
$ne: z.string(),
|
|
483
|
+
$nin: z.array(z.string()),
|
|
484
|
+
$startsWith: z.string()
|
|
485
|
+
}).partial().strict().optional(),
|
|
486
|
+
$and: z.array(z.any()).optional(),
|
|
487
|
+
$or: z.array(z.any()).optional(),
|
|
488
|
+
$not: z.any().optional()
|
|
489
|
+
}).strict().optional(),
|
|
490
|
+
sort: z.array(
|
|
491
|
+
z.object({
|
|
492
|
+
fieldName: z.enum([
|
|
493
|
+
"_id",
|
|
494
|
+
"relatedTransactionId",
|
|
495
|
+
"pool._id",
|
|
496
|
+
"beneficiary.memberId",
|
|
497
|
+
"beneficiary.wixUserId",
|
|
498
|
+
"details.item._id",
|
|
499
|
+
"_createdDate"
|
|
500
|
+
]).optional(),
|
|
501
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
502
|
+
})
|
|
503
|
+
).optional()
|
|
504
|
+
}).catchall(z.any()).describe("Filter, sort, and paging to apply to the query.")
|
|
505
|
+
});
|
|
506
|
+
var QueryTransactionsResponse = z.object({
|
|
507
|
+
transactions: z.array(
|
|
508
|
+
z.object({
|
|
509
|
+
_id: z.string().describe("Transaction ID.").regex(
|
|
510
|
+
/^[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}$/,
|
|
511
|
+
"Must be a valid GUID"
|
|
512
|
+
).optional().nullable(),
|
|
513
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
514
|
+
"Revision number, which increments by 1 each time the transaction is updated."
|
|
515
|
+
).optional().nullable(),
|
|
516
|
+
_createdDate: z.date().describe("Date and time the transaction was created.").optional().nullable(),
|
|
517
|
+
_updatedDate: z.date().describe("Date and time the transaction was updated.").optional().nullable(),
|
|
518
|
+
pool: z.object({
|
|
519
|
+
_id: z.string().describe("Pool ID.").regex(
|
|
520
|
+
/^[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}$/,
|
|
521
|
+
"Must be a valid GUID"
|
|
522
|
+
).optional(),
|
|
523
|
+
poolDefinitionId: z.string().describe("ID of the pool definition the pool was created from.").regex(
|
|
524
|
+
/^[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}$/,
|
|
525
|
+
"Must be a valid GUID"
|
|
526
|
+
).optional().nullable(),
|
|
527
|
+
programDefinitionId: z.string().describe(
|
|
528
|
+
"ID of the program definition containing the pool definition the pool was created from."
|
|
529
|
+
).regex(
|
|
530
|
+
/^[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}$/,
|
|
531
|
+
"Must be a valid GUID"
|
|
532
|
+
).optional().nullable(),
|
|
533
|
+
externalProgramDefinitionId: z.string().describe(
|
|
534
|
+
"External ID of the program definition the pool was created from."
|
|
535
|
+
).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
|
+
programId: z.string().describe("ID of the program that contains the pool.").regex(
|
|
540
|
+
/^[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}$/,
|
|
541
|
+
"Must be a valid GUID"
|
|
542
|
+
).optional().nullable(),
|
|
543
|
+
externalProgramId: z.string().describe("External ID of the program that contains the pool.").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
|
+
creditAmount: z.string().describe("Available credits.").optional().nullable(),
|
|
548
|
+
namespace: z.string().describe(
|
|
549
|
+
"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."
|
|
550
|
+
).min(1).max(20).optional().nullable(),
|
|
551
|
+
displayName: z.string().describe("Pool name").max(64).optional().nullable(),
|
|
552
|
+
benefitDisplayName: z.string().describe("Benefit name").max(40).optional().nullable()
|
|
553
|
+
}).describe("Pool associated with this transaction.").optional(),
|
|
554
|
+
amount: z.string().describe("Amount the balance was adjusted in this transaction.").optional(),
|
|
555
|
+
source: z.enum(["AVAILABLE", "EXTERNAL"]).describe("Where the credits came from.").optional(),
|
|
556
|
+
target: z.enum(["AVAILABLE", "EXTERNAL"]).describe("Where the credits went to.").optional(),
|
|
557
|
+
idempotencyKey: z.string().describe(
|
|
558
|
+
"Unique identifier, generated by the client.\nUsed to recognize repeated attempts to make the same request."
|
|
559
|
+
).max(200).optional(),
|
|
560
|
+
relatedTransactionId: z.string().describe(
|
|
561
|
+
"ID of the related transaction. For example, if this transaction is a refund for a benefit redemption, the related transaction is the benefit redemption transaction."
|
|
562
|
+
).regex(
|
|
563
|
+
/^[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}$/,
|
|
564
|
+
"Must be a valid GUID"
|
|
565
|
+
).optional().nullable(),
|
|
566
|
+
beneficiary: z.intersection(
|
|
567
|
+
z.object({}),
|
|
568
|
+
z.xor([
|
|
569
|
+
z.object({
|
|
570
|
+
anonymousVisitorId: z.never().optional(),
|
|
571
|
+
memberId: z.never().optional(),
|
|
572
|
+
wixUserId: z.never().optional()
|
|
573
|
+
}),
|
|
574
|
+
z.object({
|
|
575
|
+
memberId: z.never().optional(),
|
|
576
|
+
wixUserId: z.never().optional(),
|
|
577
|
+
anonymousVisitorId: z.string().describe(
|
|
578
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
579
|
+
).regex(
|
|
580
|
+
/^[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}$/,
|
|
581
|
+
"Must be a valid GUID"
|
|
582
|
+
)
|
|
583
|
+
}),
|
|
584
|
+
z.object({
|
|
585
|
+
anonymousVisitorId: z.never().optional(),
|
|
586
|
+
wixUserId: z.never().optional(),
|
|
587
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
588
|
+
/^[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}$/,
|
|
589
|
+
"Must be a valid GUID"
|
|
590
|
+
)
|
|
591
|
+
}),
|
|
592
|
+
z.object({
|
|
593
|
+
anonymousVisitorId: z.never().optional(),
|
|
594
|
+
memberId: z.never().optional(),
|
|
595
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
596
|
+
/^[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}$/,
|
|
597
|
+
"Must be a valid GUID"
|
|
598
|
+
)
|
|
599
|
+
})
|
|
600
|
+
])
|
|
601
|
+
).describe("Beneficiary of the pool associated with this transaction.").optional(),
|
|
602
|
+
instructingParty: z.intersection(
|
|
603
|
+
z.object({}),
|
|
604
|
+
z.xor([
|
|
605
|
+
z.object({
|
|
606
|
+
anonymousVisitorId: z.never().optional(),
|
|
607
|
+
memberId: z.never().optional(),
|
|
608
|
+
wixUserId: z.never().optional()
|
|
609
|
+
}),
|
|
610
|
+
z.object({
|
|
611
|
+
memberId: z.never().optional(),
|
|
612
|
+
wixUserId: z.never().optional(),
|
|
613
|
+
anonymousVisitorId: z.string().describe(
|
|
614
|
+
"ID of a site visitor that hasn't logged in to the site."
|
|
615
|
+
).regex(
|
|
616
|
+
/^[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}$/,
|
|
617
|
+
"Must be a valid GUID"
|
|
618
|
+
)
|
|
619
|
+
}),
|
|
620
|
+
z.object({
|
|
621
|
+
anonymousVisitorId: z.never().optional(),
|
|
622
|
+
wixUserId: z.never().optional(),
|
|
623
|
+
memberId: z.string().describe("ID of a site member.").regex(
|
|
624
|
+
/^[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}$/,
|
|
625
|
+
"Must be a valid GUID"
|
|
626
|
+
)
|
|
627
|
+
}),
|
|
628
|
+
z.object({
|
|
629
|
+
anonymousVisitorId: z.never().optional(),
|
|
630
|
+
memberId: z.never().optional(),
|
|
631
|
+
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
632
|
+
/^[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}$/,
|
|
633
|
+
"Must be a valid GUID"
|
|
634
|
+
)
|
|
635
|
+
})
|
|
636
|
+
])
|
|
637
|
+
).describe("Identity that created the transaction.").optional(),
|
|
638
|
+
status: z.enum(["PENDING", "COMPLETED", "FAILED"]).describe("Transaction status.").optional(),
|
|
639
|
+
details: z.object({
|
|
640
|
+
item: z.object({
|
|
641
|
+
_id: z.string().describe("Item ID.").regex(
|
|
642
|
+
/^[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}$/,
|
|
643
|
+
"Must be a valid GUID"
|
|
644
|
+
).optional().nullable(),
|
|
645
|
+
externalId: z.string().describe("Item external ID.").regex(
|
|
646
|
+
/^[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}$/,
|
|
647
|
+
"Must be a valid GUID"
|
|
648
|
+
).optional().nullable(),
|
|
649
|
+
category: z.string().describe("Item category.").max(20).optional().nullable(),
|
|
650
|
+
itemSetId: z.string().describe("Item set ID.").regex(
|
|
651
|
+
/^[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}$/,
|
|
652
|
+
"Must be a valid GUID"
|
|
653
|
+
).optional().nullable(),
|
|
654
|
+
displayName: z.string().describe("Item name.").max(64).optional().nullable(),
|
|
655
|
+
providerAppId: z.string().describe("Provider app id").regex(
|
|
656
|
+
/^[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}$/,
|
|
657
|
+
"Must be a valid GUID"
|
|
658
|
+
).optional().nullable()
|
|
659
|
+
}).describe("Item associated with the transaction.").optional(),
|
|
660
|
+
itemCount: z.number().int().describe("Amount of items associated with the transaction.").min(0).optional().nullable(),
|
|
661
|
+
effectiveDate: z.date().describe("Date and time the transaction was created.").optional().nullable(),
|
|
662
|
+
reason: z.string().describe(
|
|
663
|
+
"Reason for the transaction. For example, `Redemption`."
|
|
664
|
+
).max(256).optional().nullable(),
|
|
665
|
+
benefitKey: z.string().describe("Benefit key associated with the transaction.").max(64).optional().nullable()
|
|
666
|
+
}).describe("Additional transaction details.").optional(),
|
|
667
|
+
extendedFields: z.object({
|
|
668
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
669
|
+
"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)."
|
|
670
|
+
).optional()
|
|
671
|
+
}).describe(
|
|
672
|
+
"Custom field data for the transaction object.\n\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."
|
|
673
|
+
).optional(),
|
|
674
|
+
externalId: z.string().describe("External transaction ID.").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
|
+
).optional().nullable()
|
|
678
|
+
})
|
|
679
|
+
).optional(),
|
|
680
|
+
metadata: z.object({
|
|
681
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
682
|
+
cursors: z.object({
|
|
683
|
+
next: z.string().describe(
|
|
684
|
+
"Cursor string pointing to the next page in the list of results."
|
|
685
|
+
).max(16e3).optional().nullable(),
|
|
686
|
+
prev: z.string().describe(
|
|
687
|
+
"Cursor pointing to the previous page in the list of results."
|
|
688
|
+
).max(16e3).optional().nullable()
|
|
689
|
+
}).describe(
|
|
690
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
691
|
+
).optional(),
|
|
692
|
+
hasNext: z.boolean().describe(
|
|
693
|
+
"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."
|
|
694
|
+
).optional().nullable()
|
|
695
|
+
}).describe("Metadata for paginated results.").optional()
|
|
696
|
+
});
|
|
697
|
+
|
|
698
|
+
// src/benefit-programs-v1-transaction-transactions.universal.ts
|
|
201
699
|
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
202
700
|
var BalanceType = /* @__PURE__ */ ((BalanceType2) => {
|
|
203
701
|
BalanceType2["AVAILABLE"] = "AVAILABLE";
|
|
@@ -231,7 +729,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
231
729
|
return WebhookIdentityType2;
|
|
232
730
|
})(WebhookIdentityType || {});
|
|
233
731
|
async function getTransaction2(transactionId) {
|
|
234
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
732
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
733
|
+
if (validateRequestSchema) {
|
|
734
|
+
GetTransactionRequest.parse({ transactionId });
|
|
735
|
+
}
|
|
235
736
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
236
737
|
transactionId
|
|
237
738
|
});
|
|
@@ -301,7 +802,10 @@ function queryTransactions2() {
|
|
|
301
802
|
});
|
|
302
803
|
}
|
|
303
804
|
async function typedQueryTransactions(query) {
|
|
304
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
805
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
806
|
+
if (validateRequestSchema) {
|
|
807
|
+
QueryTransactionsRequest.parse({ query });
|
|
808
|
+
}
|
|
305
809
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
306
810
|
const reqOpts = queryTransactions(payload);
|
|
307
811
|
sideEffects?.onSiteCall?.();
|
|
@@ -330,24 +834,24 @@ var utils = {
|
|
|
330
834
|
};
|
|
331
835
|
|
|
332
836
|
// src/benefit-programs-v1-transaction-transactions.public.ts
|
|
333
|
-
function getTransaction3(httpClient) {
|
|
837
|
+
function getTransaction3(httpClient, __options) {
|
|
334
838
|
return (transactionId) => getTransaction2(
|
|
335
839
|
transactionId,
|
|
336
840
|
// @ts-ignore
|
|
337
|
-
{ httpClient }
|
|
841
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
338
842
|
);
|
|
339
843
|
}
|
|
340
|
-
function queryTransactions3(httpClient) {
|
|
844
|
+
function queryTransactions3(httpClient, __options) {
|
|
341
845
|
return () => queryTransactions2(
|
|
342
846
|
// @ts-ignore
|
|
343
|
-
{ httpClient }
|
|
847
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
344
848
|
);
|
|
345
849
|
}
|
|
346
|
-
function typedQueryTransactions2(httpClient) {
|
|
850
|
+
function typedQueryTransactions2(httpClient, __options) {
|
|
347
851
|
return (query) => typedQueryTransactions(
|
|
348
852
|
query,
|
|
349
853
|
// @ts-ignore
|
|
350
|
-
{ httpClient }
|
|
854
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
351
855
|
);
|
|
352
856
|
}
|
|
353
857
|
|