@wix/auto_sdk_benefit-programs_items 1.0.55 → 1.0.56
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 +30 -10
- package/build/cjs/index.js +874 -35
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +1 -4
- package/build/cjs/index.typings.js +850 -11
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +30 -10
- package/build/es/index.mjs +864 -35
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +1 -4
- package/build/es/index.typings.mjs +840 -11
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +30 -10
- package/build/internal/cjs/index.js +874 -35
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +1 -4
- package/build/internal/cjs/index.typings.js +850 -11
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +30 -10
- package/build/internal/es/index.mjs +864 -35
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +1 -4
- package/build/internal/es/index.typings.mjs +840 -11
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -475,6 +475,802 @@ function countItems(payload) {
|
|
|
475
475
|
|
|
476
476
|
// src/benefit-programs-v1-item-items.universal.ts
|
|
477
477
|
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
478
|
+
|
|
479
|
+
// src/benefit-programs-v1-item-items.schemas.ts
|
|
480
|
+
import * as z from "zod";
|
|
481
|
+
var CreateItemRequest = z.object({
|
|
482
|
+
item: z.object({
|
|
483
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
484
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
485
|
+
"Must be a valid GUID"
|
|
486
|
+
).optional().nullable(),
|
|
487
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
488
|
+
"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."
|
|
489
|
+
).optional().nullable(),
|
|
490
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
491
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
492
|
+
externalId: z.string().describe(
|
|
493
|
+
"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`."
|
|
494
|
+
).regex(
|
|
495
|
+
/^[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}$/,
|
|
496
|
+
"Must be a valid GUID"
|
|
497
|
+
),
|
|
498
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
499
|
+
itemSetId: z.string().describe(
|
|
500
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
501
|
+
).regex(
|
|
502
|
+
/^[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}$/,
|
|
503
|
+
"Must be a valid GUID"
|
|
504
|
+
),
|
|
505
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
506
|
+
providerAppId: z.string().describe(
|
|
507
|
+
"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`."
|
|
508
|
+
).regex(
|
|
509
|
+
/^[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}$/,
|
|
510
|
+
"Must be a valid GUID"
|
|
511
|
+
),
|
|
512
|
+
extendedFields: z.object({
|
|
513
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
514
|
+
"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)."
|
|
515
|
+
).optional()
|
|
516
|
+
}).describe(
|
|
517
|
+
"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."
|
|
518
|
+
).optional(),
|
|
519
|
+
namespace: z.string().describe(
|
|
520
|
+
"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."
|
|
521
|
+
).min(1).max(20)
|
|
522
|
+
}).describe("Item to create.")
|
|
523
|
+
});
|
|
524
|
+
var CreateItemResponse = z.object({
|
|
525
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
526
|
+
/^[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}$/,
|
|
527
|
+
"Must be a valid GUID"
|
|
528
|
+
).optional().nullable(),
|
|
529
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
530
|
+
"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."
|
|
531
|
+
).optional().nullable(),
|
|
532
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
533
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
534
|
+
externalId: z.string().describe(
|
|
535
|
+
"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`."
|
|
536
|
+
).regex(
|
|
537
|
+
/^[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}$/,
|
|
538
|
+
"Must be a valid GUID"
|
|
539
|
+
).optional().nullable(),
|
|
540
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
541
|
+
itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
|
|
542
|
+
/^[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}$/,
|
|
543
|
+
"Must be a valid GUID"
|
|
544
|
+
).optional().nullable(),
|
|
545
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
546
|
+
providerAppId: z.string().describe(
|
|
547
|
+
"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`."
|
|
548
|
+
).regex(
|
|
549
|
+
/^[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}$/,
|
|
550
|
+
"Must be a valid GUID"
|
|
551
|
+
).optional().nullable(),
|
|
552
|
+
extendedFields: z.object({
|
|
553
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
554
|
+
"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)."
|
|
555
|
+
).optional()
|
|
556
|
+
}).describe(
|
|
557
|
+
"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."
|
|
558
|
+
).optional(),
|
|
559
|
+
namespace: z.string().describe(
|
|
560
|
+
"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."
|
|
561
|
+
).min(1).max(20).optional().nullable()
|
|
562
|
+
});
|
|
563
|
+
var BulkCreateItemsRequest = z.object({
|
|
564
|
+
items: z.array(
|
|
565
|
+
z.object({
|
|
566
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
567
|
+
/^[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}$/,
|
|
568
|
+
"Must be a valid GUID"
|
|
569
|
+
).optional().nullable(),
|
|
570
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
571
|
+
"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."
|
|
572
|
+
).optional().nullable(),
|
|
573
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
574
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
575
|
+
externalId: z.string().describe(
|
|
576
|
+
"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`."
|
|
577
|
+
).regex(
|
|
578
|
+
/^[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}$/,
|
|
579
|
+
"Must be a valid GUID"
|
|
580
|
+
),
|
|
581
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
582
|
+
itemSetId: z.string().describe(
|
|
583
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
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
|
+
),
|
|
588
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
589
|
+
providerAppId: z.string().describe(
|
|
590
|
+
"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`."
|
|
591
|
+
).regex(
|
|
592
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
593
|
+
"Must be a valid GUID"
|
|
594
|
+
),
|
|
595
|
+
extendedFields: z.object({
|
|
596
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
597
|
+
"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)."
|
|
598
|
+
).optional()
|
|
599
|
+
}).describe(
|
|
600
|
+
"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."
|
|
601
|
+
).optional(),
|
|
602
|
+
namespace: z.string().describe(
|
|
603
|
+
"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."
|
|
604
|
+
).min(1).max(20)
|
|
605
|
+
})
|
|
606
|
+
).min(1).max(100),
|
|
607
|
+
options: z.object({
|
|
608
|
+
returnEntity: z.boolean().describe(
|
|
609
|
+
"Whether to return the full item entities.\n\nDefault: `false`"
|
|
610
|
+
).optional()
|
|
611
|
+
}).optional()
|
|
612
|
+
});
|
|
613
|
+
var BulkCreateItemsResponse = z.object({
|
|
614
|
+
results: z.array(
|
|
615
|
+
z.object({
|
|
616
|
+
itemMetadata: z.object({
|
|
617
|
+
_id: z.string().describe(
|
|
618
|
+
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
619
|
+
).regex(
|
|
620
|
+
/^[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}$/,
|
|
621
|
+
"Must be a valid GUID"
|
|
622
|
+
).optional().nullable(),
|
|
623
|
+
originalIndex: z.number().int().describe(
|
|
624
|
+
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
625
|
+
).optional(),
|
|
626
|
+
success: z.boolean().describe(
|
|
627
|
+
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
628
|
+
).optional(),
|
|
629
|
+
error: z.object({
|
|
630
|
+
code: z.string().describe("Error code.").optional(),
|
|
631
|
+
description: z.string().describe("Description of the error.").optional(),
|
|
632
|
+
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
633
|
+
}).describe("Details about the error in case of failure.").optional()
|
|
634
|
+
}).describe("Item metadata.").optional(),
|
|
635
|
+
item: z.object({
|
|
636
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
637
|
+
/^[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}$/,
|
|
638
|
+
"Must be a valid GUID"
|
|
639
|
+
).optional().nullable(),
|
|
640
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
641
|
+
"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."
|
|
642
|
+
).optional().nullable(),
|
|
643
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
644
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
645
|
+
externalId: z.string().describe(
|
|
646
|
+
"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`."
|
|
647
|
+
).regex(
|
|
648
|
+
/^[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}$/,
|
|
649
|
+
"Must be a valid GUID"
|
|
650
|
+
).optional().nullable(),
|
|
651
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
652
|
+
itemSetId: z.string().describe(
|
|
653
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
654
|
+
).regex(
|
|
655
|
+
/^[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}$/,
|
|
656
|
+
"Must be a valid GUID"
|
|
657
|
+
).optional().nullable(),
|
|
658
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
659
|
+
providerAppId: z.string().describe(
|
|
660
|
+
"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`."
|
|
661
|
+
).regex(
|
|
662
|
+
/^[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}$/,
|
|
663
|
+
"Must be a valid GUID"
|
|
664
|
+
).optional().nullable(),
|
|
665
|
+
extendedFields: z.object({
|
|
666
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
667
|
+
"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)."
|
|
668
|
+
).optional()
|
|
669
|
+
}).describe(
|
|
670
|
+
"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."
|
|
671
|
+
).optional(),
|
|
672
|
+
namespace: z.string().describe(
|
|
673
|
+
"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."
|
|
674
|
+
).min(1).max(20).optional().nullable()
|
|
675
|
+
}).describe("Item.").optional()
|
|
676
|
+
})
|
|
677
|
+
).min(1).max(100).optional(),
|
|
678
|
+
bulkActionMetadata: z.object({
|
|
679
|
+
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
680
|
+
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
681
|
+
undetailedFailures: z.number().int().describe(
|
|
682
|
+
"Number of failures without details because detailed failure threshold was exceeded."
|
|
683
|
+
).optional()
|
|
684
|
+
}).describe("Bulk action metadata.").optional()
|
|
685
|
+
});
|
|
686
|
+
var DeleteItemRequest = z.object({
|
|
687
|
+
itemId: z.string().describe("Item ID.").regex(
|
|
688
|
+
/^[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}$/,
|
|
689
|
+
"Must be a valid GUID"
|
|
690
|
+
)
|
|
691
|
+
});
|
|
692
|
+
var DeleteItemResponse = z.object({});
|
|
693
|
+
var BulkDeleteItemsRequest = z.object({
|
|
694
|
+
itemIds: z.array(z.string()).min(1).max(100)
|
|
695
|
+
});
|
|
696
|
+
var BulkDeleteItemsResponse = z.object({
|
|
697
|
+
results: z.array(
|
|
698
|
+
z.object({
|
|
699
|
+
itemMetadata: z.object({
|
|
700
|
+
_id: z.string().describe(
|
|
701
|
+
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
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
|
+
originalIndex: z.number().int().describe(
|
|
707
|
+
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
708
|
+
).optional(),
|
|
709
|
+
success: z.boolean().describe(
|
|
710
|
+
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
711
|
+
).optional(),
|
|
712
|
+
error: z.object({
|
|
713
|
+
code: z.string().describe("Error code.").optional(),
|
|
714
|
+
description: z.string().describe("Description of the error.").optional(),
|
|
715
|
+
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
716
|
+
}).describe("Details about the error in case of failure.").optional()
|
|
717
|
+
}).describe("Item metadata.").optional(),
|
|
718
|
+
item: z.object({
|
|
719
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
720
|
+
/^[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}$/,
|
|
721
|
+
"Must be a valid GUID"
|
|
722
|
+
).optional().nullable(),
|
|
723
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
724
|
+
"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."
|
|
725
|
+
).optional().nullable(),
|
|
726
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
727
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
728
|
+
externalId: z.string().describe(
|
|
729
|
+
"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`."
|
|
730
|
+
).regex(
|
|
731
|
+
/^[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}$/,
|
|
732
|
+
"Must be a valid GUID"
|
|
733
|
+
).optional().nullable(),
|
|
734
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
735
|
+
itemSetId: z.string().describe(
|
|
736
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
737
|
+
).regex(
|
|
738
|
+
/^[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}$/,
|
|
739
|
+
"Must be a valid GUID"
|
|
740
|
+
).optional().nullable(),
|
|
741
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
742
|
+
providerAppId: z.string().describe(
|
|
743
|
+
"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`."
|
|
744
|
+
).regex(
|
|
745
|
+
/^[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}$/,
|
|
746
|
+
"Must be a valid GUID"
|
|
747
|
+
).optional().nullable(),
|
|
748
|
+
extendedFields: z.object({
|
|
749
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
750
|
+
"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)."
|
|
751
|
+
).optional()
|
|
752
|
+
}).describe(
|
|
753
|
+
"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."
|
|
754
|
+
).optional(),
|
|
755
|
+
namespace: z.string().describe(
|
|
756
|
+
"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."
|
|
757
|
+
).min(1).max(20).optional().nullable()
|
|
758
|
+
}).describe("Item.").optional()
|
|
759
|
+
})
|
|
760
|
+
).min(1).max(100).optional(),
|
|
761
|
+
bulkActionMetadata: z.object({
|
|
762
|
+
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
763
|
+
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
764
|
+
undetailedFailures: z.number().int().describe(
|
|
765
|
+
"Number of failures without details because detailed failure threshold was exceeded."
|
|
766
|
+
).optional()
|
|
767
|
+
}).describe("Bulk action metadata.").optional()
|
|
768
|
+
});
|
|
769
|
+
var BulkDeleteItemsByFilterRequest = z.object({
|
|
770
|
+
namespace: z.string().describe(
|
|
771
|
+
"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."
|
|
772
|
+
).min(1).max(20),
|
|
773
|
+
options: z.object({
|
|
774
|
+
filter: z.record(z.string(), z.any()).describe(
|
|
775
|
+
"Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
|
|
776
|
+
).optional().nullable()
|
|
777
|
+
}).optional()
|
|
778
|
+
});
|
|
779
|
+
var BulkDeleteItemsByFilterResponse = z.object({
|
|
780
|
+
jobId: z.string().describe(
|
|
781
|
+
"Job ID for item deletion. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
|
|
782
|
+
).regex(
|
|
783
|
+
/^[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}$/,
|
|
784
|
+
"Must be a valid GUID"
|
|
785
|
+
).optional()
|
|
786
|
+
});
|
|
787
|
+
var UpdateItemRequest = z.object({
|
|
788
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
789
|
+
/^[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}$/,
|
|
790
|
+
"Must be a valid GUID"
|
|
791
|
+
),
|
|
792
|
+
item: z.object({
|
|
793
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
794
|
+
/^[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}$/,
|
|
795
|
+
"Must be a valid GUID"
|
|
796
|
+
).optional().nullable(),
|
|
797
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
798
|
+
"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."
|
|
799
|
+
),
|
|
800
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
801
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
802
|
+
externalId: z.string().describe(
|
|
803
|
+
"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`."
|
|
804
|
+
).regex(
|
|
805
|
+
/^[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}$/,
|
|
806
|
+
"Must be a valid GUID"
|
|
807
|
+
).optional().nullable(),
|
|
808
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
809
|
+
itemSetId: z.string().describe(
|
|
810
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
811
|
+
).regex(
|
|
812
|
+
/^[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}$/,
|
|
813
|
+
"Must be a valid GUID"
|
|
814
|
+
).optional().nullable(),
|
|
815
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
816
|
+
providerAppId: z.string().describe(
|
|
817
|
+
"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`."
|
|
818
|
+
).regex(
|
|
819
|
+
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
820
|
+
"Must be a valid GUID"
|
|
821
|
+
).optional().nullable(),
|
|
822
|
+
extendedFields: z.object({
|
|
823
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
824
|
+
"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)."
|
|
825
|
+
).optional()
|
|
826
|
+
}).describe(
|
|
827
|
+
"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."
|
|
828
|
+
).optional(),
|
|
829
|
+
namespace: z.string().describe(
|
|
830
|
+
"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."
|
|
831
|
+
).min(1).max(20).optional().nullable()
|
|
832
|
+
}).describe("Item to update.")
|
|
833
|
+
});
|
|
834
|
+
var UpdateItemResponse = z.object({
|
|
835
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
836
|
+
/^[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}$/,
|
|
837
|
+
"Must be a valid GUID"
|
|
838
|
+
).optional().nullable(),
|
|
839
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
840
|
+
"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."
|
|
841
|
+
).optional().nullable(),
|
|
842
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
843
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
844
|
+
externalId: z.string().describe(
|
|
845
|
+
"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`."
|
|
846
|
+
).regex(
|
|
847
|
+
/^[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}$/,
|
|
848
|
+
"Must be a valid GUID"
|
|
849
|
+
).optional().nullable(),
|
|
850
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
851
|
+
itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").regex(
|
|
852
|
+
/^[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}$/,
|
|
853
|
+
"Must be a valid GUID"
|
|
854
|
+
).optional().nullable(),
|
|
855
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
856
|
+
providerAppId: z.string().describe(
|
|
857
|
+
"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`."
|
|
858
|
+
).regex(
|
|
859
|
+
/^[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}$/,
|
|
860
|
+
"Must be a valid GUID"
|
|
861
|
+
).optional().nullable(),
|
|
862
|
+
extendedFields: z.object({
|
|
863
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
864
|
+
"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)."
|
|
865
|
+
).optional()
|
|
866
|
+
}).describe(
|
|
867
|
+
"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."
|
|
868
|
+
).optional(),
|
|
869
|
+
namespace: z.string().describe(
|
|
870
|
+
"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."
|
|
871
|
+
).min(1).max(20).optional().nullable()
|
|
872
|
+
});
|
|
873
|
+
var BulkUpdateItemsRequest = z.object({
|
|
874
|
+
options: z.object({
|
|
875
|
+
items: z.array(
|
|
876
|
+
z.object({
|
|
877
|
+
item: z.object({
|
|
878
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
879
|
+
/^[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}$/,
|
|
880
|
+
"Must be a valid GUID"
|
|
881
|
+
),
|
|
882
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
883
|
+
"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."
|
|
884
|
+
),
|
|
885
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
886
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
887
|
+
externalId: z.string().describe(
|
|
888
|
+
"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`."
|
|
889
|
+
).regex(
|
|
890
|
+
/^[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}$/,
|
|
891
|
+
"Must be a valid GUID"
|
|
892
|
+
).optional().nullable(),
|
|
893
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
894
|
+
itemSetId: z.string().describe(
|
|
895
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
896
|
+
).regex(
|
|
897
|
+
/^[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}$/,
|
|
898
|
+
"Must be a valid GUID"
|
|
899
|
+
).optional().nullable(),
|
|
900
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
901
|
+
providerAppId: z.string().describe(
|
|
902
|
+
"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`."
|
|
903
|
+
).regex(
|
|
904
|
+
/^[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}$/,
|
|
905
|
+
"Must be a valid GUID"
|
|
906
|
+
).optional().nullable(),
|
|
907
|
+
extendedFields: z.object({
|
|
908
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
909
|
+
"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)."
|
|
910
|
+
).optional()
|
|
911
|
+
}).describe(
|
|
912
|
+
"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."
|
|
913
|
+
).optional(),
|
|
914
|
+
namespace: z.string().describe(
|
|
915
|
+
"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."
|
|
916
|
+
).min(1).max(20).optional().nullable()
|
|
917
|
+
}).describe("Item to update."),
|
|
918
|
+
fieldMask: z.array(z.string()).optional()
|
|
919
|
+
})
|
|
920
|
+
).min(1).max(100).optional(),
|
|
921
|
+
returnEntity: z.boolean().describe(
|
|
922
|
+
"Whether to return the full item entities.\n\nDefault: `false`"
|
|
923
|
+
).optional()
|
|
924
|
+
}).optional()
|
|
925
|
+
});
|
|
926
|
+
var BulkUpdateItemsResponse = z.object({
|
|
927
|
+
results: z.array(
|
|
928
|
+
z.object({
|
|
929
|
+
itemMetadata: z.object({
|
|
930
|
+
_id: z.string().describe(
|
|
931
|
+
"Item ID. Should always be available, unless it's impossible (for example, when failing to create an item)."
|
|
932
|
+
).regex(
|
|
933
|
+
/^[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}$/,
|
|
934
|
+
"Must be a valid GUID"
|
|
935
|
+
).optional().nullable(),
|
|
936
|
+
originalIndex: z.number().int().describe(
|
|
937
|
+
"Index of the item within the request array. Allows for correlation between request and response items."
|
|
938
|
+
).optional(),
|
|
939
|
+
success: z.boolean().describe(
|
|
940
|
+
"Whether the requested action was successful for this item. When `false`, the `error` field is populated."
|
|
941
|
+
).optional(),
|
|
942
|
+
error: z.object({
|
|
943
|
+
code: z.string().describe("Error code.").optional(),
|
|
944
|
+
description: z.string().describe("Description of the error.").optional(),
|
|
945
|
+
data: z.record(z.string(), z.any()).describe("Data related to the error.").optional().nullable()
|
|
946
|
+
}).describe("Details about the error in case of failure.").optional()
|
|
947
|
+
}).describe("Item metadata.").optional(),
|
|
948
|
+
item: z.object({
|
|
949
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
950
|
+
/^[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}$/,
|
|
951
|
+
"Must be a valid GUID"
|
|
952
|
+
).optional().nullable(),
|
|
953
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
954
|
+
"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."
|
|
955
|
+
).optional().nullable(),
|
|
956
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
957
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
958
|
+
externalId: z.string().describe(
|
|
959
|
+
"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`."
|
|
960
|
+
).regex(
|
|
961
|
+
/^[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}$/,
|
|
962
|
+
"Must be a valid GUID"
|
|
963
|
+
).optional().nullable(),
|
|
964
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
965
|
+
itemSetId: z.string().describe(
|
|
966
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
967
|
+
).regex(
|
|
968
|
+
/^[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}$/,
|
|
969
|
+
"Must be a valid GUID"
|
|
970
|
+
).optional().nullable(),
|
|
971
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
972
|
+
providerAppId: z.string().describe(
|
|
973
|
+
"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`."
|
|
974
|
+
).regex(
|
|
975
|
+
/^[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}$/,
|
|
976
|
+
"Must be a valid GUID"
|
|
977
|
+
).optional().nullable(),
|
|
978
|
+
extendedFields: z.object({
|
|
979
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
980
|
+
"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)."
|
|
981
|
+
).optional()
|
|
982
|
+
}).describe(
|
|
983
|
+
"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."
|
|
984
|
+
).optional(),
|
|
985
|
+
namespace: z.string().describe(
|
|
986
|
+
"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."
|
|
987
|
+
).min(1).max(20).optional().nullable()
|
|
988
|
+
}).describe("Item.").optional()
|
|
989
|
+
})
|
|
990
|
+
).min(1).max(100).optional(),
|
|
991
|
+
bulkActionMetadata: z.object({
|
|
992
|
+
totalSuccesses: z.number().int().describe("Number of items that were successfully processed.").optional(),
|
|
993
|
+
totalFailures: z.number().int().describe("Number of items that couldn't be processed.").optional(),
|
|
994
|
+
undetailedFailures: z.number().int().describe(
|
|
995
|
+
"Number of failures without details because detailed failure threshold was exceeded."
|
|
996
|
+
).optional()
|
|
997
|
+
}).describe("Bulk action metadata.").optional()
|
|
998
|
+
});
|
|
999
|
+
var GetItemRequest = z.object({
|
|
1000
|
+
itemId: z.string().describe("ID of the item to retrieve.").regex(
|
|
1001
|
+
/^[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}$/,
|
|
1002
|
+
"Must be a valid GUID"
|
|
1003
|
+
)
|
|
1004
|
+
});
|
|
1005
|
+
var GetItemResponse = z.object({
|
|
1006
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
1007
|
+
/^[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}$/,
|
|
1008
|
+
"Must be a valid GUID"
|
|
1009
|
+
).optional().nullable(),
|
|
1010
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1011
|
+
"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."
|
|
1012
|
+
).optional().nullable(),
|
|
1013
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
1014
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
1015
|
+
externalId: z.string().describe(
|
|
1016
|
+
"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`."
|
|
1017
|
+
).regex(
|
|
1018
|
+
/^[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}$/,
|
|
1019
|
+
"Must be a valid GUID"
|
|
1020
|
+
).optional().nullable(),
|
|
1021
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
1022
|
+
itemSetId: z.string().describe("Item set ID of the benefit that this benefit item is a part of.").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
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
1027
|
+
providerAppId: z.string().describe(
|
|
1028
|
+
"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`."
|
|
1029
|
+
).regex(
|
|
1030
|
+
/^[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}$/,
|
|
1031
|
+
"Must be a valid GUID"
|
|
1032
|
+
).optional().nullable(),
|
|
1033
|
+
extendedFields: z.object({
|
|
1034
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1035
|
+
"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)."
|
|
1036
|
+
).optional()
|
|
1037
|
+
}).describe(
|
|
1038
|
+
"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."
|
|
1039
|
+
).optional(),
|
|
1040
|
+
namespace: z.string().describe(
|
|
1041
|
+
"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."
|
|
1042
|
+
).min(1).max(20).optional().nullable()
|
|
1043
|
+
});
|
|
1044
|
+
var ListItemsRequest = z.object({
|
|
1045
|
+
options: z.object({
|
|
1046
|
+
filter: z.intersection(
|
|
1047
|
+
z.object({
|
|
1048
|
+
type: z.enum(["BY_ITEM_SET_ID_AND_REFERENCE", "BY_REFERENCE"]).optional(),
|
|
1049
|
+
namespace: z.string().describe("Filter by namespace.").min(1).max(20).optional()
|
|
1050
|
+
}),
|
|
1051
|
+
z.xor([
|
|
1052
|
+
z.object({
|
|
1053
|
+
byItemSetIdAndReferenceOptions: z.never().optional(),
|
|
1054
|
+
byReferenceOptions: z.never().optional()
|
|
1055
|
+
}),
|
|
1056
|
+
z.object({
|
|
1057
|
+
byReferenceOptions: z.never().optional(),
|
|
1058
|
+
byItemSetIdAndReferenceOptions: z.object({
|
|
1059
|
+
filters: z.array(
|
|
1060
|
+
z.object({
|
|
1061
|
+
itemSetId: z.string().describe("ID set ID.").regex(
|
|
1062
|
+
/^[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}$/,
|
|
1063
|
+
"Must be a valid GUID"
|
|
1064
|
+
).optional(),
|
|
1065
|
+
externalId: z.string().describe("External item ID.").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(),
|
|
1069
|
+
category: z.string().describe("Item category.").max(20).optional(),
|
|
1070
|
+
providerAppId: z.string().describe(
|
|
1071
|
+
"*Required**. ID of the app providing the item."
|
|
1072
|
+
).regex(
|
|
1073
|
+
/^[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}$/,
|
|
1074
|
+
"Must be a valid GUID"
|
|
1075
|
+
).optional()
|
|
1076
|
+
})
|
|
1077
|
+
).min(1).max(100).optional()
|
|
1078
|
+
}).describe(
|
|
1079
|
+
"Filter the request by `itemSetId` and item reference."
|
|
1080
|
+
)
|
|
1081
|
+
}),
|
|
1082
|
+
z.object({
|
|
1083
|
+
byItemSetIdAndReferenceOptions: z.never().optional(),
|
|
1084
|
+
byReferenceOptions: z.object({
|
|
1085
|
+
filters: z.array(
|
|
1086
|
+
z.object({
|
|
1087
|
+
externalId: z.string().describe("External item ID.").regex(
|
|
1088
|
+
/^[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}$/,
|
|
1089
|
+
"Must be a valid GUID"
|
|
1090
|
+
).optional(),
|
|
1091
|
+
category: z.string().describe("Item category.").max(20).optional(),
|
|
1092
|
+
providerAppId: z.string().describe(
|
|
1093
|
+
"*Required**. ID of the app providing the item."
|
|
1094
|
+
).regex(
|
|
1095
|
+
/^[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}$/,
|
|
1096
|
+
"Must be a valid GUID"
|
|
1097
|
+
).optional()
|
|
1098
|
+
})
|
|
1099
|
+
).min(1).max(100).optional()
|
|
1100
|
+
}).describe("Filter the request item reference.")
|
|
1101
|
+
})
|
|
1102
|
+
])
|
|
1103
|
+
).describe("Filter.").optional(),
|
|
1104
|
+
cursorPaging: z.object({
|
|
1105
|
+
limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
|
|
1106
|
+
cursor: z.string().describe(
|
|
1107
|
+
"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."
|
|
1108
|
+
).max(16e3).optional().nullable()
|
|
1109
|
+
}).describe("Cursor paging").optional()
|
|
1110
|
+
}).optional()
|
|
1111
|
+
});
|
|
1112
|
+
var ListItemsResponse = z.object({
|
|
1113
|
+
items: z.array(
|
|
1114
|
+
z.object({
|
|
1115
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
1116
|
+
/^[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}$/,
|
|
1117
|
+
"Must be a valid GUID"
|
|
1118
|
+
).optional().nullable(),
|
|
1119
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1120
|
+
"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."
|
|
1121
|
+
).optional().nullable(),
|
|
1122
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
1123
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
1124
|
+
externalId: z.string().describe(
|
|
1125
|
+
"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`."
|
|
1126
|
+
).regex(
|
|
1127
|
+
/^[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}$/,
|
|
1128
|
+
"Must be a valid GUID"
|
|
1129
|
+
).optional().nullable(),
|
|
1130
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
1131
|
+
itemSetId: z.string().describe(
|
|
1132
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
1133
|
+
).regex(
|
|
1134
|
+
/^[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}$/,
|
|
1135
|
+
"Must be a valid GUID"
|
|
1136
|
+
).optional().nullable(),
|
|
1137
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
1138
|
+
providerAppId: z.string().describe(
|
|
1139
|
+
"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`."
|
|
1140
|
+
).regex(
|
|
1141
|
+
/^[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}$/,
|
|
1142
|
+
"Must be a valid GUID"
|
|
1143
|
+
).optional().nullable(),
|
|
1144
|
+
extendedFields: z.object({
|
|
1145
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1146
|
+
"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)."
|
|
1147
|
+
).optional()
|
|
1148
|
+
}).describe(
|
|
1149
|
+
"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."
|
|
1150
|
+
).optional(),
|
|
1151
|
+
namespace: z.string().describe(
|
|
1152
|
+
"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."
|
|
1153
|
+
).min(1).max(20).optional().nullable()
|
|
1154
|
+
})
|
|
1155
|
+
).optional(),
|
|
1156
|
+
metadata: z.object({
|
|
1157
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
1158
|
+
cursors: z.object({
|
|
1159
|
+
next: z.string().describe(
|
|
1160
|
+
"Cursor string pointing to the next page in the list of results."
|
|
1161
|
+
).max(16e3).optional().nullable(),
|
|
1162
|
+
prev: z.string().describe(
|
|
1163
|
+
"Cursor pointing to the previous page in the list of results."
|
|
1164
|
+
).max(16e3).optional().nullable()
|
|
1165
|
+
}).describe(
|
|
1166
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
1167
|
+
).optional(),
|
|
1168
|
+
hasNext: z.boolean().describe(
|
|
1169
|
+
"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."
|
|
1170
|
+
).optional().nullable()
|
|
1171
|
+
}).describe("Metadata for paginated results.").optional()
|
|
1172
|
+
});
|
|
1173
|
+
var QueryItemsRequest = z.object({
|
|
1174
|
+
query: z.intersection(
|
|
1175
|
+
z.object({
|
|
1176
|
+
filter: z.record(z.string(), z.any()).describe(
|
|
1177
|
+
'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`'
|
|
1178
|
+
).optional().nullable(),
|
|
1179
|
+
sort: z.array(
|
|
1180
|
+
z.object({
|
|
1181
|
+
fieldName: z.string().describe("Field to sort by.").max(512).optional(),
|
|
1182
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
1183
|
+
})
|
|
1184
|
+
).max(5).optional()
|
|
1185
|
+
}),
|
|
1186
|
+
z.xor([
|
|
1187
|
+
z.object({ cursorPaging: z.never().optional() }),
|
|
1188
|
+
z.object({
|
|
1189
|
+
cursorPaging: z.object({
|
|
1190
|
+
limit: z.number().int().describe("Maximum number of items to return.").min(0).max(1e3).optional().nullable(),
|
|
1191
|
+
cursor: z.string().describe(
|
|
1192
|
+
"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."
|
|
1193
|
+
).max(16e3).optional().nullable()
|
|
1194
|
+
}).describe(
|
|
1195
|
+
"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`."
|
|
1196
|
+
)
|
|
1197
|
+
})
|
|
1198
|
+
])
|
|
1199
|
+
).describe("Filter, sort, and paging to apply to the query.")
|
|
1200
|
+
});
|
|
1201
|
+
var QueryItemsResponse = z.object({
|
|
1202
|
+
items: z.array(
|
|
1203
|
+
z.object({
|
|
1204
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
1205
|
+
/^[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}$/,
|
|
1206
|
+
"Must be a valid GUID"
|
|
1207
|
+
).optional().nullable(),
|
|
1208
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1209
|
+
"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."
|
|
1210
|
+
).optional().nullable(),
|
|
1211
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
1212
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
1213
|
+
externalId: z.string().describe(
|
|
1214
|
+
"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`."
|
|
1215
|
+
).regex(
|
|
1216
|
+
/^[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}$/,
|
|
1217
|
+
"Must be a valid GUID"
|
|
1218
|
+
).optional().nullable(),
|
|
1219
|
+
category: z.string().describe("Benefit item category.").max(20).optional().nullable(),
|
|
1220
|
+
itemSetId: z.string().describe(
|
|
1221
|
+
"Item set ID of the benefit that this benefit item is a part of."
|
|
1222
|
+
).regex(
|
|
1223
|
+
/^[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}$/,
|
|
1224
|
+
"Must be a valid GUID"
|
|
1225
|
+
).optional().nullable(),
|
|
1226
|
+
displayName: z.string().describe("Benefit item display name.").max(64).optional().nullable(),
|
|
1227
|
+
providerAppId: z.string().describe(
|
|
1228
|
+
"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`."
|
|
1229
|
+
).regex(
|
|
1230
|
+
/^[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}$/,
|
|
1231
|
+
"Must be a valid GUID"
|
|
1232
|
+
).optional().nullable(),
|
|
1233
|
+
extendedFields: z.object({
|
|
1234
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1235
|
+
"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)."
|
|
1236
|
+
).optional()
|
|
1237
|
+
}).describe(
|
|
1238
|
+
"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."
|
|
1239
|
+
).optional(),
|
|
1240
|
+
namespace: z.string().describe(
|
|
1241
|
+
"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."
|
|
1242
|
+
).min(1).max(20).optional().nullable()
|
|
1243
|
+
})
|
|
1244
|
+
).optional(),
|
|
1245
|
+
metadata: z.object({
|
|
1246
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
1247
|
+
cursors: z.object({
|
|
1248
|
+
next: z.string().describe(
|
|
1249
|
+
"Cursor string pointing to the next page in the list of results."
|
|
1250
|
+
).max(16e3).optional().nullable(),
|
|
1251
|
+
prev: z.string().describe(
|
|
1252
|
+
"Cursor pointing to the previous page in the list of results."
|
|
1253
|
+
).max(16e3).optional().nullable()
|
|
1254
|
+
}).describe(
|
|
1255
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
1256
|
+
).optional(),
|
|
1257
|
+
hasNext: z.boolean().describe(
|
|
1258
|
+
"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."
|
|
1259
|
+
).optional().nullable()
|
|
1260
|
+
}).describe("Metadata for paginated results.").optional()
|
|
1261
|
+
});
|
|
1262
|
+
var CountItemsRequest = z.object({
|
|
1263
|
+
options: z.object({
|
|
1264
|
+
filter: z.record(z.string(), z.any()).describe(
|
|
1265
|
+
"Items to count.\n\nFilter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language)."
|
|
1266
|
+
).optional().nullable()
|
|
1267
|
+
}).optional()
|
|
1268
|
+
});
|
|
1269
|
+
var CountItemsResponse = z.object({
|
|
1270
|
+
count: z.number().int().describe("Number of items fulfilling the specified filter conditions.").optional()
|
|
1271
|
+
});
|
|
1272
|
+
|
|
1273
|
+
// src/benefit-programs-v1-item-items.universal.ts
|
|
478
1274
|
import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
|
|
479
1275
|
var Type = /* @__PURE__ */ ((Type2) => {
|
|
480
1276
|
Type2["BY_ITEM_SET_ID_AND_REFERENCE"] = "BY_ITEM_SET_ID_AND_REFERENCE";
|
|
@@ -495,7 +1291,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
495
1291
|
return WebhookIdentityType2;
|
|
496
1292
|
})(WebhookIdentityType || {});
|
|
497
1293
|
async function createItem2(item) {
|
|
498
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1294
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
1295
|
+
if (validateRequestSchema) {
|
|
1296
|
+
CreateItemRequest.parse({ item });
|
|
1297
|
+
}
|
|
499
1298
|
const payload = renameKeysFromSDKRequestToRESTRequest({ item });
|
|
500
1299
|
const reqOpts = createItem(payload);
|
|
501
1300
|
sideEffects?.onSiteCall?.();
|
|
@@ -518,7 +1317,10 @@ async function createItem2(item) {
|
|
|
518
1317
|
}
|
|
519
1318
|
}
|
|
520
1319
|
async function bulkCreateItems2(items, options) {
|
|
521
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1320
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
1321
|
+
if (validateRequestSchema) {
|
|
1322
|
+
BulkCreateItemsRequest.parse({ items, options });
|
|
1323
|
+
}
|
|
522
1324
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
523
1325
|
items,
|
|
524
1326
|
returnEntity: options?.returnEntity
|
|
@@ -547,7 +1349,10 @@ async function bulkCreateItems2(items, options) {
|
|
|
547
1349
|
}
|
|
548
1350
|
}
|
|
549
1351
|
async function deleteItem2(itemId) {
|
|
550
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1352
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
1353
|
+
if (validateRequestSchema) {
|
|
1354
|
+
DeleteItemRequest.parse({ itemId });
|
|
1355
|
+
}
|
|
551
1356
|
const payload = renameKeysFromSDKRequestToRESTRequest({ itemId });
|
|
552
1357
|
const reqOpts = deleteItem(payload);
|
|
553
1358
|
sideEffects?.onSiteCall?.();
|
|
@@ -569,7 +1374,10 @@ async function deleteItem2(itemId) {
|
|
|
569
1374
|
}
|
|
570
1375
|
}
|
|
571
1376
|
async function bulkDeleteItems2(itemIds) {
|
|
572
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1377
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
1378
|
+
if (validateRequestSchema) {
|
|
1379
|
+
BulkDeleteItemsRequest.parse({ itemIds });
|
|
1380
|
+
}
|
|
573
1381
|
const payload = renameKeysFromSDKRequestToRESTRequest({ itemIds });
|
|
574
1382
|
const reqOpts = bulkDeleteItems(payload);
|
|
575
1383
|
sideEffects?.onSiteCall?.();
|
|
@@ -592,7 +1400,10 @@ async function bulkDeleteItems2(itemIds) {
|
|
|
592
1400
|
}
|
|
593
1401
|
}
|
|
594
1402
|
async function bulkDeleteItemsByFilter2(namespace, options) {
|
|
595
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1403
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
1404
|
+
if (validateRequestSchema) {
|
|
1405
|
+
BulkDeleteItemsByFilterRequest.parse({ namespace, options });
|
|
1406
|
+
}
|
|
596
1407
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
597
1408
|
namespace,
|
|
598
1409
|
filter: options?.filter
|
|
@@ -618,7 +1429,10 @@ async function bulkDeleteItemsByFilter2(namespace, options) {
|
|
|
618
1429
|
}
|
|
619
1430
|
}
|
|
620
1431
|
async function updateItem2(_id, item) {
|
|
621
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1432
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
1433
|
+
if (validateRequestSchema) {
|
|
1434
|
+
UpdateItemRequest.parse({ _id, item });
|
|
1435
|
+
}
|
|
622
1436
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
623
1437
|
item: { ...item, id: _id }
|
|
624
1438
|
});
|
|
@@ -643,7 +1457,10 @@ async function updateItem2(_id, item) {
|
|
|
643
1457
|
}
|
|
644
1458
|
}
|
|
645
1459
|
async function bulkUpdateItems2(options) {
|
|
646
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1460
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
1461
|
+
if (validateRequestSchema) {
|
|
1462
|
+
BulkUpdateItemsRequest.parse({ options });
|
|
1463
|
+
}
|
|
647
1464
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
648
1465
|
items: options?.items,
|
|
649
1466
|
returnEntity: options?.returnEntity
|
|
@@ -672,7 +1489,10 @@ async function bulkUpdateItems2(options) {
|
|
|
672
1489
|
}
|
|
673
1490
|
}
|
|
674
1491
|
async function getItem2(itemId) {
|
|
675
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1492
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
1493
|
+
if (validateRequestSchema) {
|
|
1494
|
+
GetItemRequest.parse({ itemId });
|
|
1495
|
+
}
|
|
676
1496
|
const payload = renameKeysFromSDKRequestToRESTRequest({ itemId });
|
|
677
1497
|
const reqOpts = getItem(payload);
|
|
678
1498
|
sideEffects?.onSiteCall?.();
|
|
@@ -695,7 +1515,10 @@ async function getItem2(itemId) {
|
|
|
695
1515
|
}
|
|
696
1516
|
}
|
|
697
1517
|
async function listItems2(options) {
|
|
698
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1518
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
1519
|
+
if (validateRequestSchema) {
|
|
1520
|
+
ListItemsRequest.parse({ options });
|
|
1521
|
+
}
|
|
699
1522
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
700
1523
|
filter: options?.filter,
|
|
701
1524
|
cursorPaging: options?.cursorPaging
|
|
@@ -770,7 +1593,10 @@ function queryItems2(options) {
|
|
|
770
1593
|
});
|
|
771
1594
|
}
|
|
772
1595
|
async function typedQueryItems(query, options) {
|
|
773
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
1596
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
1597
|
+
if (validateRequestSchema) {
|
|
1598
|
+
QueryItemsRequest.parse({ query, options });
|
|
1599
|
+
}
|
|
774
1600
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
775
1601
|
query,
|
|
776
1602
|
...options
|
|
@@ -801,7 +1627,10 @@ var utils = {
|
|
|
801
1627
|
}
|
|
802
1628
|
};
|
|
803
1629
|
async function countItems2(options) {
|
|
804
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
1630
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
1631
|
+
if (validateRequestSchema) {
|
|
1632
|
+
CountItemsRequest.parse({ options });
|
|
1633
|
+
}
|
|
805
1634
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
806
1635
|
filter: options?.filter
|
|
807
1636
|
});
|
|
@@ -827,92 +1656,92 @@ async function countItems2(options) {
|
|
|
827
1656
|
}
|
|
828
1657
|
|
|
829
1658
|
// src/benefit-programs-v1-item-items.public.ts
|
|
830
|
-
function createItem3(httpClient) {
|
|
1659
|
+
function createItem3(httpClient, __options) {
|
|
831
1660
|
return (item) => createItem2(
|
|
832
1661
|
item,
|
|
833
1662
|
// @ts-ignore
|
|
834
|
-
{ httpClient }
|
|
1663
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
835
1664
|
);
|
|
836
1665
|
}
|
|
837
|
-
function bulkCreateItems3(httpClient) {
|
|
1666
|
+
function bulkCreateItems3(httpClient, __options) {
|
|
838
1667
|
return (items, options) => bulkCreateItems2(
|
|
839
1668
|
items,
|
|
840
1669
|
options,
|
|
841
1670
|
// @ts-ignore
|
|
842
|
-
{ httpClient }
|
|
1671
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
843
1672
|
);
|
|
844
1673
|
}
|
|
845
|
-
function deleteItem3(httpClient) {
|
|
1674
|
+
function deleteItem3(httpClient, __options) {
|
|
846
1675
|
return (itemId) => deleteItem2(
|
|
847
1676
|
itemId,
|
|
848
1677
|
// @ts-ignore
|
|
849
|
-
{ httpClient }
|
|
1678
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
850
1679
|
);
|
|
851
1680
|
}
|
|
852
|
-
function bulkDeleteItems3(httpClient) {
|
|
1681
|
+
function bulkDeleteItems3(httpClient, __options) {
|
|
853
1682
|
return (itemIds) => bulkDeleteItems2(
|
|
854
1683
|
itemIds,
|
|
855
1684
|
// @ts-ignore
|
|
856
|
-
{ httpClient }
|
|
1685
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
857
1686
|
);
|
|
858
1687
|
}
|
|
859
|
-
function bulkDeleteItemsByFilter3(httpClient) {
|
|
1688
|
+
function bulkDeleteItemsByFilter3(httpClient, __options) {
|
|
860
1689
|
return (namespace, options) => bulkDeleteItemsByFilter2(
|
|
861
1690
|
namespace,
|
|
862
1691
|
options,
|
|
863
1692
|
// @ts-ignore
|
|
864
|
-
{ httpClient }
|
|
1693
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
865
1694
|
);
|
|
866
1695
|
}
|
|
867
|
-
function updateItem3(httpClient) {
|
|
1696
|
+
function updateItem3(httpClient, __options) {
|
|
868
1697
|
return (_id, item) => updateItem2(
|
|
869
1698
|
_id,
|
|
870
1699
|
item,
|
|
871
1700
|
// @ts-ignore
|
|
872
|
-
{ httpClient }
|
|
1701
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
873
1702
|
);
|
|
874
1703
|
}
|
|
875
|
-
function bulkUpdateItems3(httpClient) {
|
|
1704
|
+
function bulkUpdateItems3(httpClient, __options) {
|
|
876
1705
|
return (options) => bulkUpdateItems2(
|
|
877
1706
|
options,
|
|
878
1707
|
// @ts-ignore
|
|
879
|
-
{ httpClient }
|
|
1708
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
880
1709
|
);
|
|
881
1710
|
}
|
|
882
|
-
function getItem3(httpClient) {
|
|
1711
|
+
function getItem3(httpClient, __options) {
|
|
883
1712
|
return (itemId) => getItem2(
|
|
884
1713
|
itemId,
|
|
885
1714
|
// @ts-ignore
|
|
886
|
-
{ httpClient }
|
|
1715
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
887
1716
|
);
|
|
888
1717
|
}
|
|
889
|
-
function listItems3(httpClient) {
|
|
1718
|
+
function listItems3(httpClient, __options) {
|
|
890
1719
|
return (options) => listItems2(
|
|
891
1720
|
options,
|
|
892
1721
|
// @ts-ignore
|
|
893
|
-
{ httpClient }
|
|
1722
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
894
1723
|
);
|
|
895
1724
|
}
|
|
896
|
-
function queryItems3(httpClient) {
|
|
1725
|
+
function queryItems3(httpClient, __options) {
|
|
897
1726
|
return (options) => queryItems2(
|
|
898
1727
|
options,
|
|
899
1728
|
// @ts-ignore
|
|
900
|
-
{ httpClient }
|
|
1729
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
901
1730
|
);
|
|
902
1731
|
}
|
|
903
|
-
function typedQueryItems2(httpClient) {
|
|
1732
|
+
function typedQueryItems2(httpClient, __options) {
|
|
904
1733
|
return (query, options) => typedQueryItems(
|
|
905
1734
|
query,
|
|
906
1735
|
options,
|
|
907
1736
|
// @ts-ignore
|
|
908
|
-
{ httpClient }
|
|
1737
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
909
1738
|
);
|
|
910
1739
|
}
|
|
911
|
-
function countItems3(httpClient) {
|
|
1740
|
+
function countItems3(httpClient, __options) {
|
|
912
1741
|
return (options) => countItems2(
|
|
913
1742
|
options,
|
|
914
1743
|
// @ts-ignore
|
|
915
|
-
{ httpClient }
|
|
1744
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
916
1745
|
);
|
|
917
1746
|
}
|
|
918
1747
|
|