@wix/auto_sdk_benefit-programs_items 1.0.26 → 1.0.28
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/{internal → cjs}/index.d.ts +14 -12
- package/build/cjs/index.js.map +1 -0
- package/build/{benefit-programs-v1-item-items.universal-CkMjOEfX.d.mts → cjs/index.typings.d.ts} +183 -1
- package/build/cjs/index.typings.js +814 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/{internal → cjs}/meta.d.ts +2 -1
- package/build/{internal → es}/index.d.mts +14 -12
- package/build/es/index.mjs.map +1 -0
- package/build/{benefit-programs-v1-item-items.universal-CkMjOEfX.d.ts → es/index.typings.d.mts} +183 -1
- package/build/es/index.typings.mjs +777 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/{internal → es}/meta.d.mts +2 -1
- package/build/es/package.json +3 -0
- package/build/{index.d.ts → internal/cjs/index.d.ts} +14 -12
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/{benefit-programs-v1-item-items.universal-CkMjOEfX.d.mts → cjs/index.typings.d.ts} +183 -1
- package/build/internal/cjs/index.typings.js +814 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/{meta.d.ts → internal/cjs/meta.d.ts} +2 -1
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/{index.d.mts → internal/es/index.d.mts} +14 -12
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/{benefit-programs-v1-item-items.universal-CkMjOEfX.d.ts → es/index.typings.d.mts} +183 -1
- package/build/internal/es/index.typings.mjs +777 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/{meta.d.mts → internal/es/meta.d.mts} +2 -1
- package/build/internal/es/meta.mjs.map +1 -0
- package/package.json +13 -12
- package/build/index.js.map +0 -1
- package/build/index.mjs.map +0 -1
- package/build/internal/index.js.map +0 -1
- package/build/internal/index.mjs.map +0 -1
- package/build/meta.js.map +0 -1
- package/build/meta.mjs.map +0 -1
- /package/build/{index.js → cjs/index.js} +0 -0
- /package/build/{internal → cjs}/meta.js +0 -0
- /package/build/{internal → cjs}/meta.js.map +0 -0
- /package/build/{index.mjs → es/index.mjs} +0 -0
- /package/build/{internal → es}/meta.mjs +0 -0
- /package/build/{internal → es}/meta.mjs.map +0 -0
- /package/build/internal/{index.js → cjs/index.js} +0 -0
- /package/build/{meta.js → internal/cjs/meta.js} +0 -0
- /package/build/internal/{index.mjs → es/index.mjs} +0 -0
- /package/build/{meta.mjs → internal/es/meta.mjs} +0 -0
package/build/{benefit-programs-v1-item-items.universal-CkMjOEfX.d.ts → es/index.typings.d.mts}
RENAMED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
|
+
|
|
1
3
|
interface Item {
|
|
2
4
|
/**
|
|
3
5
|
* Benefit item ID.
|
|
@@ -652,6 +654,42 @@ declare enum WebhookIdentityType {
|
|
|
652
654
|
}
|
|
653
655
|
/** @enumType */
|
|
654
656
|
type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
|
|
657
|
+
type CountItemsApplicationErrors = {
|
|
658
|
+
code?: 'TOO_MANY_TO_COUNT';
|
|
659
|
+
description?: string;
|
|
660
|
+
data?: Record<string, any>;
|
|
661
|
+
};
|
|
662
|
+
/**
|
|
663
|
+
* Creates a benefit item.
|
|
664
|
+
* @param item - Item to create.
|
|
665
|
+
* @public
|
|
666
|
+
* @documentationMaturity preview
|
|
667
|
+
* @requiredField item
|
|
668
|
+
* @requiredField item.externalId
|
|
669
|
+
* @requiredField item.itemSetId
|
|
670
|
+
* @requiredField item.namespace
|
|
671
|
+
* @requiredField item.providerAppId
|
|
672
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_CREATE
|
|
673
|
+
* @applicableIdentity APP
|
|
674
|
+
* @returns Created item.
|
|
675
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.CreateItem
|
|
676
|
+
*/
|
|
677
|
+
declare function createItem(item: NonNullablePaths<Item, `externalId` | `itemSetId` | `namespace` | `providerAppId`, 2>): Promise<Item>;
|
|
678
|
+
/**
|
|
679
|
+
* Creates benefit items.
|
|
680
|
+
* @param items - Items to create.
|
|
681
|
+
* @public
|
|
682
|
+
* @documentationMaturity preview
|
|
683
|
+
* @requiredField items
|
|
684
|
+
* @requiredField items.externalId
|
|
685
|
+
* @requiredField items.itemSetId
|
|
686
|
+
* @requiredField items.namespace
|
|
687
|
+
* @requiredField items.providerAppId
|
|
688
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_CREATE
|
|
689
|
+
* @applicableIdentity APP
|
|
690
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.BulkCreateItems
|
|
691
|
+
*/
|
|
692
|
+
declare function bulkCreateItems(items: NonNullablePaths<Item, `externalId` | `itemSetId` | `namespace` | `providerAppId`, 2>[], options?: BulkCreateItemsOptions): Promise<NonNullablePaths<BulkCreateItemsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
655
693
|
interface BulkCreateItemsOptions {
|
|
656
694
|
/**
|
|
657
695
|
* Whether to return the full item entities.
|
|
@@ -660,10 +698,83 @@ interface BulkCreateItemsOptions {
|
|
|
660
698
|
*/
|
|
661
699
|
returnEntity?: boolean;
|
|
662
700
|
}
|
|
701
|
+
/**
|
|
702
|
+
* Deletes a benefit item.
|
|
703
|
+
*
|
|
704
|
+
* <blockquote class="caution">
|
|
705
|
+
* <strong>Caution:</strong>
|
|
706
|
+
*
|
|
707
|
+
* Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.
|
|
708
|
+
* </blockquote>
|
|
709
|
+
* @param itemId - Item ID.
|
|
710
|
+
* @public
|
|
711
|
+
* @documentationMaturity preview
|
|
712
|
+
* @requiredField itemId
|
|
713
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_DELETE
|
|
714
|
+
* @applicableIdentity APP
|
|
715
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.DeleteItem
|
|
716
|
+
*/
|
|
717
|
+
declare function deleteItem(itemId: string): Promise<void>;
|
|
718
|
+
/**
|
|
719
|
+
* Deletes benefit items.
|
|
720
|
+
*
|
|
721
|
+
* <blockquote class="caution">
|
|
722
|
+
* <strong>Caution:</strong>
|
|
723
|
+
*
|
|
724
|
+
* Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.
|
|
725
|
+
* </blockquote>
|
|
726
|
+
* @param itemIds - List of IDs of the items to delete.
|
|
727
|
+
* @public
|
|
728
|
+
* @documentationMaturity preview
|
|
729
|
+
* @requiredField itemIds
|
|
730
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_DELETE
|
|
731
|
+
* @applicableIdentity APP
|
|
732
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.BulkDeleteItems
|
|
733
|
+
*/
|
|
734
|
+
declare function bulkDeleteItems(itemIds: string[]): Promise<NonNullablePaths<BulkDeleteItemsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
735
|
+
/**
|
|
736
|
+
* Deletes benefit items that fulfill the specified filter conditions.
|
|
737
|
+
*
|
|
738
|
+
* For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).
|
|
739
|
+
*
|
|
740
|
+
* <blockquote class="caution">
|
|
741
|
+
* <strong>Caution:</strong>
|
|
742
|
+
*
|
|
743
|
+
* Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.
|
|
744
|
+
* </blockquote>
|
|
745
|
+
* @param namespace - 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.
|
|
746
|
+
* @public
|
|
747
|
+
* @documentationMaturity preview
|
|
748
|
+
* @requiredField namespace
|
|
749
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_DELETE
|
|
750
|
+
* @applicableIdentity APP
|
|
751
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.BulkDeleteItemsByFilter
|
|
752
|
+
*/
|
|
753
|
+
declare function bulkDeleteItemsByFilter(namespace: string, options?: BulkDeleteItemsByFilterOptions): Promise<NonNullablePaths<BulkDeleteItemsByFilterResponse, `jobId`, 2>>;
|
|
663
754
|
interface BulkDeleteItemsByFilterOptions {
|
|
664
755
|
/** Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */
|
|
665
756
|
filter?: Record<string, any> | null;
|
|
666
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* Updates a benefit item.
|
|
760
|
+
*
|
|
761
|
+
* Each time the benefit item is updated,
|
|
762
|
+
* `revision` increments by 1.
|
|
763
|
+
* The current `revision` must be passed when updating the benefit item.
|
|
764
|
+
* This ensures you're working with the latest benefit item
|
|
765
|
+
* and prevents unintended overwrites.
|
|
766
|
+
* @param _id - Benefit item ID.
|
|
767
|
+
* @public
|
|
768
|
+
* @documentationMaturity preview
|
|
769
|
+
* @requiredField _id
|
|
770
|
+
* @requiredField item
|
|
771
|
+
* @requiredField item.revision
|
|
772
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_UPDATE
|
|
773
|
+
* @applicableIdentity APP
|
|
774
|
+
* @returns Updated item.
|
|
775
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.UpdateItem
|
|
776
|
+
*/
|
|
777
|
+
declare function updateItem(_id: string, item: NonNullablePaths<UpdateItem, `revision`, 2>): Promise<Item>;
|
|
667
778
|
interface UpdateItem {
|
|
668
779
|
/**
|
|
669
780
|
* Benefit item ID.
|
|
@@ -739,6 +850,24 @@ interface UpdateItem {
|
|
|
739
850
|
*/
|
|
740
851
|
namespace?: string | null;
|
|
741
852
|
}
|
|
853
|
+
/**
|
|
854
|
+
* Updates benefit items.
|
|
855
|
+
*
|
|
856
|
+
* Each time the benefit item is updated,
|
|
857
|
+
* `revision` increments by 1.
|
|
858
|
+
* The current `revision` must be passed when updating the benefit item.
|
|
859
|
+
* This ensures you're working with the latest benefit item
|
|
860
|
+
* and prevents unintended overwrites.
|
|
861
|
+
* @public
|
|
862
|
+
* @documentationMaturity preview
|
|
863
|
+
* @requiredField options.items.item
|
|
864
|
+
* @requiredField options.items.item._id
|
|
865
|
+
* @requiredField options.items.item.revision
|
|
866
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_UPDATE
|
|
867
|
+
* @applicableIdentity APP
|
|
868
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.BulkUpdateItems
|
|
869
|
+
*/
|
|
870
|
+
declare function bulkUpdateItems(options?: NonNullablePaths<BulkUpdateItemsOptions, `items.${number}.item` | `items.${number}.item._id` | `items.${number}.item.revision`, 5>): Promise<NonNullablePaths<BulkUpdateItemsResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6>>;
|
|
742
871
|
interface BulkUpdateItemsOptions {
|
|
743
872
|
/**
|
|
744
873
|
* Items to update.
|
|
@@ -753,12 +882,52 @@ interface BulkUpdateItemsOptions {
|
|
|
753
882
|
*/
|
|
754
883
|
returnEntity?: boolean;
|
|
755
884
|
}
|
|
885
|
+
/**
|
|
886
|
+
* Retrieves a benefit item.
|
|
887
|
+
* @param itemId - ID of the item to retrieve.
|
|
888
|
+
* @public
|
|
889
|
+
* @documentationMaturity preview
|
|
890
|
+
* @requiredField itemId
|
|
891
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
892
|
+
* @applicableIdentity APP
|
|
893
|
+
* @returns Retrieved item.
|
|
894
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.GetItem
|
|
895
|
+
*/
|
|
896
|
+
declare function getItem(itemId: string): Promise<Item>;
|
|
897
|
+
/**
|
|
898
|
+
* Retrieves a list of up to 1000 benefit items.
|
|
899
|
+
* @public
|
|
900
|
+
* @documentationMaturity preview
|
|
901
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
902
|
+
* @applicableIdentity APP
|
|
903
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.ListItems
|
|
904
|
+
*/
|
|
905
|
+
declare function listItems(options?: ListItemsOptions): Promise<NonNullablePaths<ListItemsResponse, `items`, 2>>;
|
|
756
906
|
interface ListItemsOptions {
|
|
757
907
|
/** Filter. */
|
|
758
908
|
filter?: Filter;
|
|
759
909
|
/** Cursor paging */
|
|
760
910
|
cursorPaging?: CursorPaging;
|
|
761
911
|
}
|
|
912
|
+
/**
|
|
913
|
+
* Creates a query to retrieve a list of items.
|
|
914
|
+
*
|
|
915
|
+
* The Query Items method builds a query to retrieve a list of items and returns a `ItemsQueryBuilder` object.
|
|
916
|
+
*
|
|
917
|
+
* The returned object contains the query definition, which is used to run the query using the `find()` method.
|
|
918
|
+
*
|
|
919
|
+
* You can refine the query by chaining `ItemsQueryBuilder` methods onto the query. `ItemsQueryBuilder` methods enable you to filter, sort, and control the results that Query Items returns.
|
|
920
|
+
*
|
|
921
|
+
* Query Items has a default paging limit of 50, which you can override.
|
|
922
|
+
*
|
|
923
|
+
* For a full description of the item object, see the object returned for the `items` property in `ItemsQueryResult`.
|
|
924
|
+
* @public
|
|
925
|
+
* @documentationMaturity preview
|
|
926
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
927
|
+
* @applicableIdentity APP
|
|
928
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.QueryItems
|
|
929
|
+
*/
|
|
930
|
+
declare function queryItems(): ItemsQueryBuilder;
|
|
762
931
|
interface QueryCursorResult {
|
|
763
932
|
cursors: Cursors;
|
|
764
933
|
hasNext: () => boolean;
|
|
@@ -836,6 +1005,19 @@ interface ItemsQueryBuilder {
|
|
|
836
1005
|
/** @documentationMaturity preview */
|
|
837
1006
|
find: () => Promise<ItemsQueryResult>;
|
|
838
1007
|
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Counts how many benefit items exist that fulfill the specified filtering conditions.
|
|
1010
|
+
*
|
|
1011
|
+
* For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).
|
|
1012
|
+
* @public
|
|
1013
|
+
* @documentationMaturity preview
|
|
1014
|
+
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
1015
|
+
* @applicableIdentity APP
|
|
1016
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.CountItems
|
|
1017
|
+
*/
|
|
1018
|
+
declare function countItems(options?: CountItemsOptions): Promise<NonNullablePaths<CountItemsResponse, `count`, 2> & {
|
|
1019
|
+
__applicationErrorsType?: CountItemsApplicationErrors;
|
|
1020
|
+
}>;
|
|
839
1021
|
interface CountItemsOptions {
|
|
840
1022
|
/**
|
|
841
1023
|
* Items to count.
|
|
@@ -845,4 +1027,4 @@ interface CountItemsOptions {
|
|
|
845
1027
|
filter?: Record<string, any> | null;
|
|
846
1028
|
}
|
|
847
1029
|
|
|
848
|
-
export { type
|
|
1030
|
+
export { type ActionEvent, type AllocateItemSetsRequest, type AllocateItemSetsResponse, type ApplicationError, type BulkActionMetadata, type BulkCloneItemSetsRequest, type BulkCloneItemSetsResponse, type BulkCloneItemSetsResult, type BulkCreateItemsOptions, type BulkCreateItemsRequest, type BulkCreateItemsResponse, type BulkDeleteItemsByFilterOptions, type BulkDeleteItemsByFilterRequest, type BulkDeleteItemsByFilterResponse, type BulkDeleteItemsRequest, type BulkDeleteItemsResponse, type BulkItemResult, type BulkUpdateItemsOptions, type BulkUpdateItemsRequest, type BulkUpdateItemsResponse, type ByItemSetIdAndReference, type ByItemSetIdAndReferenceFilter, type ByReference, type ByReferenceFilter, type CloneItemsRequest, type CloneItemsResponse, type CountItemsApplicationErrors, type CountItemsOptions, type CountItemsRequest, type CountItemsResponse, type CreateItemRequest, type CreateItemResponse, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DeleteItemRequest, type DeleteItemResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type ExtendedFields, type Filter, type FilterFilterOneOf, type GetItemRequest, type GetItemResponse, type IdentificationData, type IdentificationDataIdOneOf, type Item, type ItemMetadata, type ItemsCloned, type ItemsQueryBuilder, type ItemsQueryResult, type ListItemsOptions, type ListItemsRequest, type ListItemsResponse, type MaskedItem, type MessageEnvelope, type QueryItemsRequest, type QueryItemsResponse, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, Type, type TypeWithLiterals, type UpdateItem, type UpdateItemRequest, type UpdateItemResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, bulkCreateItems, bulkDeleteItems, bulkDeleteItemsByFilter, bulkUpdateItems, countItems, createItem, deleteItem, getItem, listItems, queryItems, updateItem };
|