@wix/auto_sdk_benefit-programs_items 1.0.56 → 1.0.57
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 +10 -30
- package/build/cjs/index.js +35 -874
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +4 -1
- package/build/cjs/index.typings.js +11 -850
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +10 -30
- package/build/es/index.mjs +35 -864
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +4 -1
- package/build/es/index.typings.mjs +11 -840
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +10 -30
- package/build/internal/cjs/index.js +35 -874
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +4 -1
- package/build/internal/cjs/index.typings.js +11 -850
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +10 -30
- package/build/internal/es/index.mjs +35 -864
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +4 -1
- package/build/internal/es/index.typings.mjs +11 -840
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// index.typings.ts
|
|
@@ -523,802 +513,6 @@ function countItems(payload) {
|
|
|
523
513
|
|
|
524
514
|
// src/benefit-programs-v1-item-items.universal.ts
|
|
525
515
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
526
|
-
|
|
527
|
-
// src/benefit-programs-v1-item-items.schemas.ts
|
|
528
|
-
var z = __toESM(require("zod"));
|
|
529
|
-
var CreateItemRequest = z.object({
|
|
530
|
-
item: z.object({
|
|
531
|
-
_id: z.string().describe("Benefit 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
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
536
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
537
|
-
).optional().nullable(),
|
|
538
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
539
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
540
|
-
externalId: z.string().describe(
|
|
541
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
542
|
-
).regex(
|
|
543
|
-
/^[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}$/,
|
|
544
|
-
"Must be a valid GUID"
|
|
545
|
-
),
|
|
546
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
547
|
-
itemSetId: z.string().describe(
|
|
548
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
549
|
-
).regex(
|
|
550
|
-
/^[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}$/,
|
|
551
|
-
"Must be a valid GUID"
|
|
552
|
-
),
|
|
553
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
554
|
-
providerAppId: z.string().describe(
|
|
555
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
556
|
-
).regex(
|
|
557
|
-
/^[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}$/,
|
|
558
|
-
"Must be a valid GUID"
|
|
559
|
-
),
|
|
560
|
-
extendedFields: z.object({
|
|
561
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
562
|
-
"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)."
|
|
563
|
-
).optional()
|
|
564
|
-
}).describe(
|
|
565
|
-
"Custom field data for the benefit item 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."
|
|
566
|
-
).optional(),
|
|
567
|
-
namespace: z.string().describe(
|
|
568
|
-
"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."
|
|
569
|
-
).min(1).max(20)
|
|
570
|
-
}).describe("Item to create.")
|
|
571
|
-
});
|
|
572
|
-
var CreateItemResponse = z.object({
|
|
573
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
574
|
-
/^[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}$/,
|
|
575
|
-
"Must be a valid GUID"
|
|
576
|
-
).optional().nullable(),
|
|
577
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
578
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
579
|
-
).optional().nullable(),
|
|
580
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
581
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
582
|
-
externalId: z.string().describe(
|
|
583
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
584
|
-
).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
|
-
).optional().nullable(),
|
|
588
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
589
|
-
itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
|
|
590
|
-
/^[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}$/,
|
|
591
|
-
"Must be a valid GUID"
|
|
592
|
-
).optional().nullable(),
|
|
593
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
594
|
-
providerAppId: z.string().describe(
|
|
595
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
596
|
-
).regex(
|
|
597
|
-
/^[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}$/,
|
|
598
|
-
"Must be a valid GUID"
|
|
599
|
-
).optional().nullable(),
|
|
600
|
-
extendedFields: z.object({
|
|
601
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
602
|
-
"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)."
|
|
603
|
-
).optional()
|
|
604
|
-
}).describe(
|
|
605
|
-
"Custom field data for the benefit item 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."
|
|
606
|
-
).optional(),
|
|
607
|
-
namespace: z.string().describe(
|
|
608
|
-
"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."
|
|
609
|
-
).min(1).max(20).optional().nullable()
|
|
610
|
-
});
|
|
611
|
-
var BulkCreateItemsRequest = z.object({
|
|
612
|
-
items: z.array(
|
|
613
|
-
z.object({
|
|
614
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
615
|
-
/^[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}$/,
|
|
616
|
-
"Must be a valid GUID"
|
|
617
|
-
).optional().nullable(),
|
|
618
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
619
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
620
|
-
).optional().nullable(),
|
|
621
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
622
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
623
|
-
externalId: z.string().describe(
|
|
624
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
625
|
-
).regex(
|
|
626
|
-
/^[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}$/,
|
|
627
|
-
"Must be a valid GUID"
|
|
628
|
-
),
|
|
629
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
630
|
-
itemSetId: z.string().describe(
|
|
631
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
632
|
-
).regex(
|
|
633
|
-
/^[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}$/,
|
|
634
|
-
"Must be a valid GUID"
|
|
635
|
-
),
|
|
636
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
637
|
-
providerAppId: z.string().describe(
|
|
638
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
639
|
-
).regex(
|
|
640
|
-
/^[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}$/,
|
|
641
|
-
"Must be a valid GUID"
|
|
642
|
-
),
|
|
643
|
-
extendedFields: z.object({
|
|
644
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
645
|
-
"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)."
|
|
646
|
-
).optional()
|
|
647
|
-
}).describe(
|
|
648
|
-
"Custom field data for the benefit item 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."
|
|
649
|
-
).optional(),
|
|
650
|
-
namespace: z.string().describe(
|
|
651
|
-
"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."
|
|
652
|
-
).min(1).max(20)
|
|
653
|
-
})
|
|
654
|
-
).min(1).max(100),
|
|
655
|
-
options: z.object({
|
|
656
|
-
returnEntity: z.boolean().describe(
|
|
657
|
-
"Whether to return the full item entities.\n\nDefault: `false`"
|
|
658
|
-
).optional()
|
|
659
|
-
}).optional()
|
|
660
|
-
});
|
|
661
|
-
var BulkCreateItemsResponse = z.object({
|
|
662
|
-
results: z.array(
|
|
663
|
-
z.object({
|
|
664
|
-
itemMetadata: z.object({
|
|
665
|
-
_id: z.string().describe(
|
|
666
|
-
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
667
|
-
).regex(
|
|
668
|
-
/^[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}$/,
|
|
669
|
-
"Must be a valid GUID"
|
|
670
|
-
).optional().nullable(),
|
|
671
|
-
originalIndex: z.number().int().describe(
|
|
672
|
-
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
673
|
-
).optional(),
|
|
674
|
-
success: z.boolean().describe(
|
|
675
|
-
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
676
|
-
).optional(),
|
|
677
|
-
error: z.object({
|
|
678
|
-
code: z.string().describe("Error code.").optional(),
|
|
679
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
680
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
681
|
-
}).describe("Details about the error in case of failure.").optional()
|
|
682
|
-
}).describe("Item metadata.").optional(),
|
|
683
|
-
item: z.object({
|
|
684
|
-
_id: z.string().describe("Benefit item 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
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
689
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
690
|
-
).optional().nullable(),
|
|
691
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
692
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
693
|
-
externalId: z.string().describe(
|
|
694
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
695
|
-
).regex(
|
|
696
|
-
/^[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}$/,
|
|
697
|
-
"Must be a valid GUID"
|
|
698
|
-
).optional().nullable(),
|
|
699
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
700
|
-
itemSetId: z.string().describe(
|
|
701
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
702
|
-
).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().nullable(),
|
|
706
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
707
|
-
providerAppId: z.string().describe(
|
|
708
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
709
|
-
).regex(
|
|
710
|
-
/^[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}$/,
|
|
711
|
-
"Must be a valid GUID"
|
|
712
|
-
).optional().nullable(),
|
|
713
|
-
extendedFields: z.object({
|
|
714
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
715
|
-
"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)."
|
|
716
|
-
).optional()
|
|
717
|
-
}).describe(
|
|
718
|
-
"Custom field data for the benefit item 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."
|
|
719
|
-
).optional(),
|
|
720
|
-
namespace: z.string().describe(
|
|
721
|
-
"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."
|
|
722
|
-
).min(1).max(20).optional().nullable()
|
|
723
|
-
}).describe("Item.").optional()
|
|
724
|
-
})
|
|
725
|
-
).min(1).max(100).optional(),
|
|
726
|
-
bulkActionMetadata: z.object({
|
|
727
|
-
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
728
|
-
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
729
|
-
undetailedFailures: z.number().int().describe(
|
|
730
|
-
"Number of failures without details because detailed failure threshold was exceeded."
|
|
731
|
-
).optional()
|
|
732
|
-
}).describe("Bulk action metadata.").optional()
|
|
733
|
-
});
|
|
734
|
-
var DeleteItemRequest = z.object({
|
|
735
|
-
itemId: z.string().describe("Item ID.").regex(
|
|
736
|
-
/^[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}$/,
|
|
737
|
-
"Must be a valid GUID"
|
|
738
|
-
)
|
|
739
|
-
});
|
|
740
|
-
var DeleteItemResponse = z.object({});
|
|
741
|
-
var BulkDeleteItemsRequest = z.object({
|
|
742
|
-
itemIds: z.array(z.string()).min(1).max(100)
|
|
743
|
-
});
|
|
744
|
-
var BulkDeleteItemsResponse = z.object({
|
|
745
|
-
results: z.array(
|
|
746
|
-
z.object({
|
|
747
|
-
itemMetadata: z.object({
|
|
748
|
-
_id: z.string().describe(
|
|
749
|
-
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
750
|
-
).regex(
|
|
751
|
-
/^[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}$/,
|
|
752
|
-
"Must be a valid GUID"
|
|
753
|
-
).optional().nullable(),
|
|
754
|
-
originalIndex: z.number().int().describe(
|
|
755
|
-
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
756
|
-
).optional(),
|
|
757
|
-
success: z.boolean().describe(
|
|
758
|
-
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
759
|
-
).optional(),
|
|
760
|
-
error: z.object({
|
|
761
|
-
code: z.string().describe("Error code.").optional(),
|
|
762
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
763
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
764
|
-
}).describe("Details about the error in case of failure.").optional()
|
|
765
|
-
}).describe("Item metadata.").optional(),
|
|
766
|
-
item: z.object({
|
|
767
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
768
|
-
/^[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}$/,
|
|
769
|
-
"Must be a valid GUID"
|
|
770
|
-
).optional().nullable(),
|
|
771
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
772
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
773
|
-
).optional().nullable(),
|
|
774
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
775
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
776
|
-
externalId: z.string().describe(
|
|
777
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
778
|
-
).regex(
|
|
779
|
-
/^[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}$/,
|
|
780
|
-
"Must be a valid GUID"
|
|
781
|
-
).optional().nullable(),
|
|
782
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
783
|
-
itemSetId: z.string().describe(
|
|
784
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
785
|
-
).regex(
|
|
786
|
-
/^[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}$/,
|
|
787
|
-
"Must be a valid GUID"
|
|
788
|
-
).optional().nullable(),
|
|
789
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
790
|
-
providerAppId: z.string().describe(
|
|
791
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
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
|
-
).optional().nullable(),
|
|
796
|
-
extendedFields: z.object({
|
|
797
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
798
|
-
"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)."
|
|
799
|
-
).optional()
|
|
800
|
-
}).describe(
|
|
801
|
-
"Custom field data for the benefit item 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."
|
|
802
|
-
).optional(),
|
|
803
|
-
namespace: z.string().describe(
|
|
804
|
-
"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."
|
|
805
|
-
).min(1).max(20).optional().nullable()
|
|
806
|
-
}).describe("Item.").optional()
|
|
807
|
-
})
|
|
808
|
-
).min(1).max(100).optional(),
|
|
809
|
-
bulkActionMetadata: z.object({
|
|
810
|
-
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
811
|
-
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
812
|
-
undetailedFailures: z.number().int().describe(
|
|
813
|
-
"Number of failures without details because detailed failure threshold was exceeded."
|
|
814
|
-
).optional()
|
|
815
|
-
}).describe("Bulk action metadata.").optional()
|
|
816
|
-
});
|
|
817
|
-
var BulkDeleteItemsByFilterRequest = z.object({
|
|
818
|
-
namespace: z.string().describe(
|
|
819
|
-
"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."
|
|
820
|
-
).min(1).max(20),
|
|
821
|
-
options: z.object({
|
|
822
|
-
filter: z.record(z.string(), z.any()).describe(
|
|
823
|
-
"Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
|
|
824
|
-
).optional().nullable()
|
|
825
|
-
}).optional()
|
|
826
|
-
});
|
|
827
|
-
var BulkDeleteItemsByFilterResponse = z.object({
|
|
828
|
-
jobId: z.string().describe(
|
|
829
|
-
"Job ID for item deletion. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
|
|
830
|
-
).regex(
|
|
831
|
-
/^[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}$/,
|
|
832
|
-
"Must be a valid GUID"
|
|
833
|
-
).optional()
|
|
834
|
-
});
|
|
835
|
-
var UpdateItemRequest = z.object({
|
|
836
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
837
|
-
/^[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}$/,
|
|
838
|
-
"Must be a valid GUID"
|
|
839
|
-
),
|
|
840
|
-
item: z.object({
|
|
841
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
842
|
-
/^[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}$/,
|
|
843
|
-
"Must be a valid GUID"
|
|
844
|
-
).optional().nullable(),
|
|
845
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
846
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
847
|
-
),
|
|
848
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
849
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
850
|
-
externalId: z.string().describe(
|
|
851
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
852
|
-
).regex(
|
|
853
|
-
/^[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}$/,
|
|
854
|
-
"Must be a valid GUID"
|
|
855
|
-
).optional().nullable(),
|
|
856
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
857
|
-
itemSetId: z.string().describe(
|
|
858
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
859
|
-
).regex(
|
|
860
|
-
/^[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}$/,
|
|
861
|
-
"Must be a valid GUID"
|
|
862
|
-
).optional().nullable(),
|
|
863
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
864
|
-
providerAppId: z.string().describe(
|
|
865
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
866
|
-
).regex(
|
|
867
|
-
/^[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}$/,
|
|
868
|
-
"Must be a valid GUID"
|
|
869
|
-
).optional().nullable(),
|
|
870
|
-
extendedFields: z.object({
|
|
871
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
872
|
-
"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)."
|
|
873
|
-
).optional()
|
|
874
|
-
}).describe(
|
|
875
|
-
"Custom field data for the benefit item 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."
|
|
876
|
-
).optional(),
|
|
877
|
-
namespace: z.string().describe(
|
|
878
|
-
"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."
|
|
879
|
-
).min(1).max(20).optional().nullable()
|
|
880
|
-
}).describe("Item to update.")
|
|
881
|
-
});
|
|
882
|
-
var UpdateItemResponse = z.object({
|
|
883
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
884
|
-
/^[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}$/,
|
|
885
|
-
"Must be a valid GUID"
|
|
886
|
-
).optional().nullable(),
|
|
887
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
888
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
889
|
-
).optional().nullable(),
|
|
890
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
891
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
892
|
-
externalId: z.string().describe(
|
|
893
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
894
|
-
).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
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
899
|
-
itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
|
|
900
|
-
/^[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}$/,
|
|
901
|
-
"Must be a valid GUID"
|
|
902
|
-
).optional().nullable(),
|
|
903
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
904
|
-
providerAppId: z.string().describe(
|
|
905
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
906
|
-
).regex(
|
|
907
|
-
/^[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}$/,
|
|
908
|
-
"Must be a valid GUID"
|
|
909
|
-
).optional().nullable(),
|
|
910
|
-
extendedFields: z.object({
|
|
911
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
912
|
-
"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)."
|
|
913
|
-
).optional()
|
|
914
|
-
}).describe(
|
|
915
|
-
"Custom field data for the benefit item 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."
|
|
916
|
-
).optional(),
|
|
917
|
-
namespace: z.string().describe(
|
|
918
|
-
"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."
|
|
919
|
-
).min(1).max(20).optional().nullable()
|
|
920
|
-
});
|
|
921
|
-
var BulkUpdateItemsRequest = z.object({
|
|
922
|
-
options: z.object({
|
|
923
|
-
items: z.array(
|
|
924
|
-
z.object({
|
|
925
|
-
item: z.object({
|
|
926
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
927
|
-
/^[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}$/,
|
|
928
|
-
"Must be a valid GUID"
|
|
929
|
-
),
|
|
930
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
931
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
932
|
-
),
|
|
933
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
934
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
935
|
-
externalId: z.string().describe(
|
|
936
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
937
|
-
).regex(
|
|
938
|
-
/^[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}$/,
|
|
939
|
-
"Must be a valid GUID"
|
|
940
|
-
).optional().nullable(),
|
|
941
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
942
|
-
itemSetId: z.string().describe(
|
|
943
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
944
|
-
).regex(
|
|
945
|
-
/^[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}$/,
|
|
946
|
-
"Must be a valid GUID"
|
|
947
|
-
).optional().nullable(),
|
|
948
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
949
|
-
providerAppId: z.string().describe(
|
|
950
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
951
|
-
).regex(
|
|
952
|
-
/^[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}$/,
|
|
953
|
-
"Must be a valid GUID"
|
|
954
|
-
).optional().nullable(),
|
|
955
|
-
extendedFields: z.object({
|
|
956
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
957
|
-
"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)."
|
|
958
|
-
).optional()
|
|
959
|
-
}).describe(
|
|
960
|
-
"Custom field data for the benefit item 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."
|
|
961
|
-
).optional(),
|
|
962
|
-
namespace: z.string().describe(
|
|
963
|
-
"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."
|
|
964
|
-
).min(1).max(20).optional().nullable()
|
|
965
|
-
}).describe("Item to update."),
|
|
966
|
-
fieldMask: z.array(z.string()).optional()
|
|
967
|
-
})
|
|
968
|
-
).min(1).max(100).optional(),
|
|
969
|
-
returnEntity: z.boolean().describe(
|
|
970
|
-
"Whether to return the full item entities.\n\nDefault: `false`"
|
|
971
|
-
).optional()
|
|
972
|
-
}).optional()
|
|
973
|
-
});
|
|
974
|
-
var BulkUpdateItemsResponse = z.object({
|
|
975
|
-
results: z.array(
|
|
976
|
-
z.object({
|
|
977
|
-
itemMetadata: z.object({
|
|
978
|
-
_id: z.string().describe(
|
|
979
|
-
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
980
|
-
).regex(
|
|
981
|
-
/^[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}$/,
|
|
982
|
-
"Must be a valid GUID"
|
|
983
|
-
).optional().nullable(),
|
|
984
|
-
originalIndex: z.number().int().describe(
|
|
985
|
-
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
986
|
-
).optional(),
|
|
987
|
-
success: z.boolean().describe(
|
|
988
|
-
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
989
|
-
).optional(),
|
|
990
|
-
error: z.object({
|
|
991
|
-
code: z.string().describe("Error code.").optional(),
|
|
992
|
-
description: z.string().describe("Description of the error.").optional(),
|
|
993
|
-
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
994
|
-
}).describe("Details about the error in case of failure.").optional()
|
|
995
|
-
}).describe("Item metadata.").optional(),
|
|
996
|
-
item: z.object({
|
|
997
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
998
|
-
/^[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}$/,
|
|
999
|
-
"Must be a valid GUID"
|
|
1000
|
-
).optional().nullable(),
|
|
1001
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1002
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
1003
|
-
).optional().nullable(),
|
|
1004
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
1005
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
1006
|
-
externalId: z.string().describe(
|
|
1007
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
1008
|
-
).regex(
|
|
1009
|
-
/^[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}$/,
|
|
1010
|
-
"Must be a valid GUID"
|
|
1011
|
-
).optional().nullable(),
|
|
1012
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
1013
|
-
itemSetId: z.string().describe(
|
|
1014
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
1015
|
-
).regex(
|
|
1016
|
-
/^[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}$/,
|
|
1017
|
-
"Must be a valid GUID"
|
|
1018
|
-
).optional().nullable(),
|
|
1019
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
1020
|
-
providerAppId: z.string().describe(
|
|
1021
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
1022
|
-
).regex(
|
|
1023
|
-
/^[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}$/,
|
|
1024
|
-
"Must be a valid GUID"
|
|
1025
|
-
).optional().nullable(),
|
|
1026
|
-
extendedFields: z.object({
|
|
1027
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1028
|
-
"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)."
|
|
1029
|
-
).optional()
|
|
1030
|
-
}).describe(
|
|
1031
|
-
"Custom field data for the benefit item 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."
|
|
1032
|
-
).optional(),
|
|
1033
|
-
namespace: z.string().describe(
|
|
1034
|
-
"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."
|
|
1035
|
-
).min(1).max(20).optional().nullable()
|
|
1036
|
-
}).describe("Item.").optional()
|
|
1037
|
-
})
|
|
1038
|
-
).min(1).max(100).optional(),
|
|
1039
|
-
bulkActionMetadata: z.object({
|
|
1040
|
-
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
1041
|
-
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
1042
|
-
undetailedFailures: z.number().int().describe(
|
|
1043
|
-
"Number of failures without details because detailed failure threshold was exceeded."
|
|
1044
|
-
).optional()
|
|
1045
|
-
}).describe("Bulk action metadata.").optional()
|
|
1046
|
-
});
|
|
1047
|
-
var GetItemRequest = z.object({
|
|
1048
|
-
itemId: z.string().describe("ID of the item to retrieve.").regex(
|
|
1049
|
-
/^[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}$/,
|
|
1050
|
-
"Must be a valid GUID"
|
|
1051
|
-
)
|
|
1052
|
-
});
|
|
1053
|
-
var GetItemResponse = z.object({
|
|
1054
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
1055
|
-
/^[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}$/,
|
|
1056
|
-
"Must be a valid GUID"
|
|
1057
|
-
).optional().nullable(),
|
|
1058
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1059
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
1060
|
-
).optional().nullable(),
|
|
1061
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
1062
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
1063
|
-
externalId: z.string().describe(
|
|
1064
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
1065
|
-
).regex(
|
|
1066
|
-
/^[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}$/,
|
|
1067
|
-
"Must be a valid GUID"
|
|
1068
|
-
).optional().nullable(),
|
|
1069
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
1070
|
-
itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
|
|
1071
|
-
/^[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}$/,
|
|
1072
|
-
"Must be a valid GUID"
|
|
1073
|
-
).optional().nullable(),
|
|
1074
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
1075
|
-
providerAppId: z.string().describe(
|
|
1076
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
1077
|
-
).regex(
|
|
1078
|
-
/^[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}$/,
|
|
1079
|
-
"Must be a valid GUID"
|
|
1080
|
-
).optional().nullable(),
|
|
1081
|
-
extendedFields: z.object({
|
|
1082
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1083
|
-
"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)."
|
|
1084
|
-
).optional()
|
|
1085
|
-
}).describe(
|
|
1086
|
-
"Custom field data for the benefit item 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."
|
|
1087
|
-
).optional(),
|
|
1088
|
-
namespace: z.string().describe(
|
|
1089
|
-
"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."
|
|
1090
|
-
).min(1).max(20).optional().nullable()
|
|
1091
|
-
});
|
|
1092
|
-
var ListItemsRequest = z.object({
|
|
1093
|
-
options: z.object({
|
|
1094
|
-
filter: z.intersection(
|
|
1095
|
-
z.object({
|
|
1096
|
-
type: z.enum(["BY_ITEM_SET_ID_AND_REFERENCE", "BY_REFERENCE"]).optional(),
|
|
1097
|
-
namespace: z.string().describe("Filter by namespace.").min(1).max(20).optional()
|
|
1098
|
-
}),
|
|
1099
|
-
z.xor([
|
|
1100
|
-
z.object({
|
|
1101
|
-
byItemSetIdAndReferenceOptions: z.never().optional(),
|
|
1102
|
-
byReferenceOptions: z.never().optional()
|
|
1103
|
-
}),
|
|
1104
|
-
z.object({
|
|
1105
|
-
byReferenceOptions: z.never().optional(),
|
|
1106
|
-
byItemSetIdAndReferenceOptions: z.object({
|
|
1107
|
-
filters: z.array(
|
|
1108
|
-
z.object({
|
|
1109
|
-
itemSetId: z.string().describe("ID set ID.").regex(
|
|
1110
|
-
/^[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}$/,
|
|
1111
|
-
"Must be a valid GUID"
|
|
1112
|
-
).optional(),
|
|
1113
|
-
externalId: z.string().describe("External item ID.").regex(
|
|
1114
|
-
/^[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}$/,
|
|
1115
|
-
"Must be a valid GUID"
|
|
1116
|
-
).optional(),
|
|
1117
|
-
category: z.string().describe("Item category.").max(20).optional(),
|
|
1118
|
-
providerAppId: z.string().describe(
|
|
1119
|
-
"*Required**. ID of the app providing the item."
|
|
1120
|
-
).regex(
|
|
1121
|
-
/^[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}$/,
|
|
1122
|
-
"Must be a valid GUID"
|
|
1123
|
-
).optional()
|
|
1124
|
-
})
|
|
1125
|
-
).min(1).max(100).optional()
|
|
1126
|
-
}).describe(
|
|
1127
|
-
"Filter the request by `itemSetId` and item reference."
|
|
1128
|
-
)
|
|
1129
|
-
}),
|
|
1130
|
-
z.object({
|
|
1131
|
-
byItemSetIdAndReferenceOptions: z.never().optional(),
|
|
1132
|
-
byReferenceOptions: z.object({
|
|
1133
|
-
filters: z.array(
|
|
1134
|
-
z.object({
|
|
1135
|
-
externalId: z.string().describe("External item ID.").regex(
|
|
1136
|
-
/^[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}$/,
|
|
1137
|
-
"Must be a valid GUID"
|
|
1138
|
-
).optional(),
|
|
1139
|
-
category: z.string().describe("Item category.").max(20).optional(),
|
|
1140
|
-
providerAppId: z.string().describe(
|
|
1141
|
-
"*Required**. ID of the app providing the item."
|
|
1142
|
-
).regex(
|
|
1143
|
-
/^[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}$/,
|
|
1144
|
-
"Must be a valid GUID"
|
|
1145
|
-
).optional()
|
|
1146
|
-
})
|
|
1147
|
-
).min(1).max(100).optional()
|
|
1148
|
-
}).describe("Filter the request item reference.")
|
|
1149
|
-
})
|
|
1150
|
-
])
|
|
1151
|
-
).describe("Filter.").optional(),
|
|
1152
|
-
cursorPaging: z.object({
|
|
1153
|
-
limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
|
|
1154
|
-
cursor: z.string().describe(
|
|
1155
|
-
"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."
|
|
1156
|
-
).max(16e3).optional().nullable()
|
|
1157
|
-
}).describe("Cursor paging").optional()
|
|
1158
|
-
}).optional()
|
|
1159
|
-
});
|
|
1160
|
-
var ListItemsResponse = z.object({
|
|
1161
|
-
items: z.array(
|
|
1162
|
-
z.object({
|
|
1163
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
1164
|
-
/^[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}$/,
|
|
1165
|
-
"Must be a valid GUID"
|
|
1166
|
-
).optional().nullable(),
|
|
1167
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1168
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
1169
|
-
).optional().nullable(),
|
|
1170
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
1171
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
1172
|
-
externalId: z.string().describe(
|
|
1173
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
1174
|
-
).regex(
|
|
1175
|
-
/^[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}$/,
|
|
1176
|
-
"Must be a valid GUID"
|
|
1177
|
-
).optional().nullable(),
|
|
1178
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
1179
|
-
itemSetId: z.string().describe(
|
|
1180
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
1181
|
-
).regex(
|
|
1182
|
-
/^[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}$/,
|
|
1183
|
-
"Must be a valid GUID"
|
|
1184
|
-
).optional().nullable(),
|
|
1185
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
1186
|
-
providerAppId: z.string().describe(
|
|
1187
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
1188
|
-
).regex(
|
|
1189
|
-
/^[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}$/,
|
|
1190
|
-
"Must be a valid GUID"
|
|
1191
|
-
).optional().nullable(),
|
|
1192
|
-
extendedFields: z.object({
|
|
1193
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1194
|
-
"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)."
|
|
1195
|
-
).optional()
|
|
1196
|
-
}).describe(
|
|
1197
|
-
"Custom field data for the benefit item 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."
|
|
1198
|
-
).optional(),
|
|
1199
|
-
namespace: z.string().describe(
|
|
1200
|
-
"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."
|
|
1201
|
-
).min(1).max(20).optional().nullable()
|
|
1202
|
-
})
|
|
1203
|
-
).optional(),
|
|
1204
|
-
metadata: z.object({
|
|
1205
|
-
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
1206
|
-
cursors: z.object({
|
|
1207
|
-
next: z.string().describe(
|
|
1208
|
-
"Cursor string pointing to the next page in the list of results."
|
|
1209
|
-
).max(16e3).optional().nullable(),
|
|
1210
|
-
prev: z.string().describe(
|
|
1211
|
-
"Cursor pointing to the previous page in the list of results."
|
|
1212
|
-
).max(16e3).optional().nullable()
|
|
1213
|
-
}).describe(
|
|
1214
|
-
"Cursor strings that point to the next page, previous page, or both."
|
|
1215
|
-
).optional(),
|
|
1216
|
-
hasNext: z.boolean().describe(
|
|
1217
|
-
"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."
|
|
1218
|
-
).optional().nullable()
|
|
1219
|
-
}).describe("Metadata for paginated results.").optional()
|
|
1220
|
-
});
|
|
1221
|
-
var QueryItemsRequest = z.object({
|
|
1222
|
-
query: z.intersection(
|
|
1223
|
-
z.object({
|
|
1224
|
-
filter: z.record(z.string(), z.any()).describe(
|
|
1225
|
-
'Filter object in the following format:\n`"filter" : {\n"fieldName1": "value1",\n"fieldName2":{"$operator":"value2"}\n}`\nExample of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`'
|
|
1226
|
-
).optional().nullable(),
|
|
1227
|
-
sort: z.array(
|
|
1228
|
-
z.object({
|
|
1229
|
-
fieldName: z.string().describe("Field to sort by.").max(512).optional(),
|
|
1230
|
-
order: z.enum(["ASC", "DESC"]).optional()
|
|
1231
|
-
})
|
|
1232
|
-
).max(5).optional()
|
|
1233
|
-
}),
|
|
1234
|
-
z.xor([
|
|
1235
|
-
z.object({ cursorPaging: z.never().optional() }),
|
|
1236
|
-
z.object({
|
|
1237
|
-
cursorPaging: z.object({
|
|
1238
|
-
limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
|
|
1239
|
-
cursor: z.string().describe(
|
|
1240
|
-
"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."
|
|
1241
|
-
).max(16e3).optional().nullable()
|
|
1242
|
-
}).describe(
|
|
1243
|
-
"Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`."
|
|
1244
|
-
)
|
|
1245
|
-
})
|
|
1246
|
-
])
|
|
1247
|
-
).describe("Filter, sort, and paging to apply to the query.")
|
|
1248
|
-
});
|
|
1249
|
-
var QueryItemsResponse = z.object({
|
|
1250
|
-
items: z.array(
|
|
1251
|
-
z.object({
|
|
1252
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
1253
|
-
/^[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}$/,
|
|
1254
|
-
"Must be a valid GUID"
|
|
1255
|
-
).optional().nullable(),
|
|
1256
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1257
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the benefit item.\n\nIgnored when creating a benefit item."
|
|
1258
|
-
).optional().nullable(),
|
|
1259
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
1260
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
1261
|
-
externalId: z.string().describe(
|
|
1262
|
-
"ID of the item in the app providing it.\n\nFor example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`."
|
|
1263
|
-
).regex(
|
|
1264
|
-
/^[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}$/,
|
|
1265
|
-
"Must be a valid GUID"
|
|
1266
|
-
).optional().nullable(),
|
|
1267
|
-
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
1268
|
-
itemSetId: z.string().describe(
|
|
1269
|
-
"Item set ID of the benefit that this benefit item is a part of."
|
|
1270
|
-
).regex(
|
|
1271
|
-
/^[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}$/,
|
|
1272
|
-
"Must be a valid GUID"
|
|
1273
|
-
).optional().nullable(),
|
|
1274
|
-
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
1275
|
-
providerAppId: z.string().describe(
|
|
1276
|
-
"ID of the [app](https://dev.wix.com/docs/rest/articles/getting-started/apps-created-by-wix) that defines and provides the item. For example, if the item is a Wix Stores product, this field's value is `215238eb-22a5-4c36-9e7b-e7c08025e04e`."
|
|
1277
|
-
).regex(
|
|
1278
|
-
/^[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}$/,
|
|
1279
|
-
"Must be a valid GUID"
|
|
1280
|
-
).optional().nullable(),
|
|
1281
|
-
extendedFields: z.object({
|
|
1282
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1283
|
-
"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)."
|
|
1284
|
-
).optional()
|
|
1285
|
-
}).describe(
|
|
1286
|
-
"Custom field data for the benefit item 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."
|
|
1287
|
-
).optional(),
|
|
1288
|
-
namespace: z.string().describe(
|
|
1289
|
-
"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."
|
|
1290
|
-
).min(1).max(20).optional().nullable()
|
|
1291
|
-
})
|
|
1292
|
-
).optional(),
|
|
1293
|
-
metadata: z.object({
|
|
1294
|
-
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
1295
|
-
cursors: z.object({
|
|
1296
|
-
next: z.string().describe(
|
|
1297
|
-
"Cursor string pointing to the next page in the list of results."
|
|
1298
|
-
).max(16e3).optional().nullable(),
|
|
1299
|
-
prev: z.string().describe(
|
|
1300
|
-
"Cursor pointing to the previous page in the list of results."
|
|
1301
|
-
).max(16e3).optional().nullable()
|
|
1302
|
-
}).describe(
|
|
1303
|
-
"Cursor strings that point to the next page, previous page, or both."
|
|
1304
|
-
).optional(),
|
|
1305
|
-
hasNext: z.boolean().describe(
|
|
1306
|
-
"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."
|
|
1307
|
-
).optional().nullable()
|
|
1308
|
-
}).describe("Metadata for paginated results.").optional()
|
|
1309
|
-
});
|
|
1310
|
-
var CountItemsRequest = z.object({
|
|
1311
|
-
options: z.object({
|
|
1312
|
-
filter: z.record(z.string(), z.any()).describe(
|
|
1313
|
-
"Items to count.\n\nFilter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
|
|
1314
|
-
).optional().nullable()
|
|
1315
|
-
}).optional()
|
|
1316
|
-
});
|
|
1317
|
-
var CountItemsResponse = z.object({
|
|
1318
|
-
count: z.number().int().describe("Number of items fulfilling the specified filter conditions.").optional()
|
|
1319
|
-
});
|
|
1320
|
-
|
|
1321
|
-
// src/benefit-programs-v1-item-items.universal.ts
|
|
1322
516
|
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
1323
517
|
var Type = /* @__PURE__ */ ((Type2) => {
|
|
1324
518
|
Type2["BY_ITEM_SET_ID_AND_REFERENCE"] = "BY_ITEM_SET_ID_AND_REFERENCE";
|
|
@@ -1339,10 +533,7 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
1339
533
|
return WebhookIdentityType2;
|
|
1340
534
|
})(WebhookIdentityType || {});
|
|
1341
535
|
async function createItem2(item) {
|
|
1342
|
-
const { httpClient, sideEffects
|
|
1343
|
-
if (validateRequestSchema) {
|
|
1344
|
-
CreateItemRequest.parse({ item });
|
|
1345
|
-
}
|
|
536
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1346
537
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ item });
|
|
1347
538
|
const reqOpts = createItem(payload);
|
|
1348
539
|
sideEffects?.onSiteCall?.();
|
|
@@ -1365,10 +556,7 @@ async function createItem2(item) {
|
|
|
1365
556
|
}
|
|
1366
557
|
}
|
|
1367
558
|
async function bulkCreateItems2(items, options) {
|
|
1368
|
-
const { httpClient, sideEffects
|
|
1369
|
-
if (validateRequestSchema) {
|
|
1370
|
-
BulkCreateItemsRequest.parse({ items, options });
|
|
1371
|
-
}
|
|
559
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1372
560
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1373
561
|
items,
|
|
1374
562
|
returnEntity: options?.returnEntity
|
|
@@ -1397,10 +585,7 @@ async function bulkCreateItems2(items, options) {
|
|
|
1397
585
|
}
|
|
1398
586
|
}
|
|
1399
587
|
async function deleteItem2(itemId) {
|
|
1400
|
-
const { httpClient, sideEffects
|
|
1401
|
-
if (validateRequestSchema) {
|
|
1402
|
-
DeleteItemRequest.parse({ itemId });
|
|
1403
|
-
}
|
|
588
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1404
589
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemId });
|
|
1405
590
|
const reqOpts = deleteItem(payload);
|
|
1406
591
|
sideEffects?.onSiteCall?.();
|
|
@@ -1422,10 +607,7 @@ async function deleteItem2(itemId) {
|
|
|
1422
607
|
}
|
|
1423
608
|
}
|
|
1424
609
|
async function bulkDeleteItems2(itemIds) {
|
|
1425
|
-
const { httpClient, sideEffects
|
|
1426
|
-
if (validateRequestSchema) {
|
|
1427
|
-
BulkDeleteItemsRequest.parse({ itemIds });
|
|
1428
|
-
}
|
|
610
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1429
611
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemIds });
|
|
1430
612
|
const reqOpts = bulkDeleteItems(payload);
|
|
1431
613
|
sideEffects?.onSiteCall?.();
|
|
@@ -1448,10 +630,7 @@ async function bulkDeleteItems2(itemIds) {
|
|
|
1448
630
|
}
|
|
1449
631
|
}
|
|
1450
632
|
async function bulkDeleteItemsByFilter2(namespace, options) {
|
|
1451
|
-
const { httpClient, sideEffects
|
|
1452
|
-
if (validateRequestSchema) {
|
|
1453
|
-
BulkDeleteItemsByFilterRequest.parse({ namespace, options });
|
|
1454
|
-
}
|
|
633
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1455
634
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1456
635
|
namespace,
|
|
1457
636
|
filter: options?.filter
|
|
@@ -1477,10 +656,7 @@ async function bulkDeleteItemsByFilter2(namespace, options) {
|
|
|
1477
656
|
}
|
|
1478
657
|
}
|
|
1479
658
|
async function updateItem2(_id, item) {
|
|
1480
|
-
const { httpClient, sideEffects
|
|
1481
|
-
if (validateRequestSchema) {
|
|
1482
|
-
UpdateItemRequest.parse({ _id, item });
|
|
1483
|
-
}
|
|
659
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1484
660
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1485
661
|
item: { ...item, id: _id }
|
|
1486
662
|
});
|
|
@@ -1505,10 +681,7 @@ async function updateItem2(_id, item) {
|
|
|
1505
681
|
}
|
|
1506
682
|
}
|
|
1507
683
|
async function bulkUpdateItems2(options) {
|
|
1508
|
-
const { httpClient, sideEffects
|
|
1509
|
-
if (validateRequestSchema) {
|
|
1510
|
-
BulkUpdateItemsRequest.parse({ options });
|
|
1511
|
-
}
|
|
684
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1512
685
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1513
686
|
items: options?.items,
|
|
1514
687
|
returnEntity: options?.returnEntity
|
|
@@ -1537,10 +710,7 @@ async function bulkUpdateItems2(options) {
|
|
|
1537
710
|
}
|
|
1538
711
|
}
|
|
1539
712
|
async function getItem2(itemId) {
|
|
1540
|
-
const { httpClient, sideEffects
|
|
1541
|
-
if (validateRequestSchema) {
|
|
1542
|
-
GetItemRequest.parse({ itemId });
|
|
1543
|
-
}
|
|
713
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1544
714
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ itemId });
|
|
1545
715
|
const reqOpts = getItem(payload);
|
|
1546
716
|
sideEffects?.onSiteCall?.();
|
|
@@ -1563,10 +733,7 @@ async function getItem2(itemId) {
|
|
|
1563
733
|
}
|
|
1564
734
|
}
|
|
1565
735
|
async function listItems2(options) {
|
|
1566
|
-
const { httpClient, sideEffects
|
|
1567
|
-
if (validateRequestSchema) {
|
|
1568
|
-
ListItemsRequest.parse({ options });
|
|
1569
|
-
}
|
|
736
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1570
737
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1571
738
|
filter: options?.filter,
|
|
1572
739
|
cursorPaging: options?.cursorPaging
|
|
@@ -1641,10 +808,7 @@ function queryItems2(options) {
|
|
|
1641
808
|
});
|
|
1642
809
|
}
|
|
1643
810
|
async function typedQueryItems(query, options) {
|
|
1644
|
-
const { httpClient, sideEffects
|
|
1645
|
-
if (validateRequestSchema) {
|
|
1646
|
-
QueryItemsRequest.parse({ query, options });
|
|
1647
|
-
}
|
|
811
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1648
812
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1649
813
|
query,
|
|
1650
814
|
...options
|
|
@@ -1675,10 +839,7 @@ var utils = {
|
|
|
1675
839
|
}
|
|
1676
840
|
};
|
|
1677
841
|
async function countItems2(options) {
|
|
1678
|
-
const { httpClient, sideEffects
|
|
1679
|
-
if (validateRequestSchema) {
|
|
1680
|
-
CountItemsRequest.parse({ options });
|
|
1681
|
-
}
|
|
842
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1682
843
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1683
844
|
filter: options?.filter
|
|
1684
845
|
});
|