@wix/auto_sdk_benefit-programs_items 1.0.33 → 1.0.35
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 +8 -21
- package/build/cjs/index.js +43 -1
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +11 -35
- package/build/cjs/index.typings.js +25 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +8 -21
- package/build/es/index.mjs +43 -1
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +11 -35
- package/build/es/index.typings.mjs +24 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +8 -21
- package/build/internal/cjs/index.js +43 -1
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +11 -35
- package/build/internal/cjs/index.typings.js +25 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/es/index.d.mts +8 -21
- package/build/internal/es/index.mjs +43 -1
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +11 -35
- package/build/internal/es/index.typings.mjs +24 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -664,7 +664,6 @@ type CountItemsApplicationErrors = {
|
|
|
664
664
|
* Creates a benefit item.
|
|
665
665
|
* @param item - Item to create.
|
|
666
666
|
* @public
|
|
667
|
-
* @documentationMaturity preview
|
|
668
667
|
* @requiredField item
|
|
669
668
|
* @requiredField item.externalId
|
|
670
669
|
* @requiredField item.itemSetId
|
|
@@ -680,7 +679,6 @@ declare function createItem(item: NonNullablePaths<Item, `externalId` | `itemSet
|
|
|
680
679
|
* Creates benefit items.
|
|
681
680
|
* @param items - Items to create.
|
|
682
681
|
* @public
|
|
683
|
-
* @documentationMaturity preview
|
|
684
682
|
* @requiredField items
|
|
685
683
|
* @requiredField items.externalId
|
|
686
684
|
* @requiredField items.itemSetId
|
|
@@ -709,7 +707,6 @@ interface BulkCreateItemsOptions {
|
|
|
709
707
|
* </blockquote>
|
|
710
708
|
* @param itemId - Item ID.
|
|
711
709
|
* @public
|
|
712
|
-
* @documentationMaturity preview
|
|
713
710
|
* @requiredField itemId
|
|
714
711
|
* @permissionId BENEFIT_PROGRAMS.ITEM_DELETE
|
|
715
712
|
* @applicableIdentity APP
|
|
@@ -726,7 +723,6 @@ declare function deleteItem(itemId: string): Promise<void>;
|
|
|
726
723
|
* </blockquote>
|
|
727
724
|
* @param itemIds - List of IDs of the items to delete.
|
|
728
725
|
* @public
|
|
729
|
-
* @documentationMaturity preview
|
|
730
726
|
* @requiredField itemIds
|
|
731
727
|
* @permissionId BENEFIT_PROGRAMS.ITEM_DELETE
|
|
732
728
|
* @applicableIdentity APP
|
|
@@ -745,7 +741,6 @@ declare function bulkDeleteItems(itemIds: string[]): Promise<NonNullablePaths<Bu
|
|
|
745
741
|
* </blockquote>
|
|
746
742
|
* @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.
|
|
747
743
|
* @public
|
|
748
|
-
* @documentationMaturity preview
|
|
749
744
|
* @requiredField namespace
|
|
750
745
|
* @permissionId BENEFIT_PROGRAMS.ITEM_DELETE
|
|
751
746
|
* @applicableIdentity APP
|
|
@@ -766,7 +761,6 @@ interface BulkDeleteItemsByFilterOptions {
|
|
|
766
761
|
* and prevents unintended overwrites.
|
|
767
762
|
* @param _id - Benefit item ID.
|
|
768
763
|
* @public
|
|
769
|
-
* @documentationMaturity preview
|
|
770
764
|
* @requiredField _id
|
|
771
765
|
* @requiredField item
|
|
772
766
|
* @requiredField item.revision
|
|
@@ -860,7 +854,6 @@ interface UpdateItem {
|
|
|
860
854
|
* This ensures you're working with the latest benefit item
|
|
861
855
|
* and prevents unintended overwrites.
|
|
862
856
|
* @public
|
|
863
|
-
* @documentationMaturity preview
|
|
864
857
|
* @requiredField options.items.item
|
|
865
858
|
* @requiredField options.items.item._id
|
|
866
859
|
* @requiredField options.items.item.revision
|
|
@@ -887,7 +880,6 @@ interface BulkUpdateItemsOptions {
|
|
|
887
880
|
* Retrieves a benefit item.
|
|
888
881
|
* @param itemId - ID of the item to retrieve.
|
|
889
882
|
* @public
|
|
890
|
-
* @documentationMaturity preview
|
|
891
883
|
* @requiredField itemId
|
|
892
884
|
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
893
885
|
* @applicableIdentity APP
|
|
@@ -898,7 +890,6 @@ declare function getItem(itemId: string): Promise<Item>;
|
|
|
898
890
|
/**
|
|
899
891
|
* Retrieves a list of up to 1000 benefit items.
|
|
900
892
|
* @public
|
|
901
|
-
* @documentationMaturity preview
|
|
902
893
|
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
903
894
|
* @applicableIdentity APP
|
|
904
895
|
* @fqn wix.benefit_programs.v1.item.ItemService.ListItems
|
|
@@ -923,7 +914,6 @@ interface ListItemsOptions {
|
|
|
923
914
|
*
|
|
924
915
|
* For a full description of the item object, see the object returned for the `items` property in `ItemsQueryResult`.
|
|
925
916
|
* @public
|
|
926
|
-
* @documentationMaturity preview
|
|
927
917
|
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
928
918
|
* @applicableIdentity APP
|
|
929
919
|
* @fqn wix.benefit_programs.v1.item.ItemService.QueryItems
|
|
@@ -945,73 +935,59 @@ interface ItemsQueryResult extends QueryCursorResult {
|
|
|
945
935
|
interface ItemsQueryBuilder {
|
|
946
936
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
947
937
|
* @param value - Value to compare against.
|
|
948
|
-
* @documentationMaturity preview
|
|
949
938
|
*/
|
|
950
939
|
eq: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any) => ItemsQueryBuilder;
|
|
951
940
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
952
941
|
* @param value - Value to compare against.
|
|
953
|
-
* @documentationMaturity preview
|
|
954
942
|
*/
|
|
955
943
|
ne: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any) => ItemsQueryBuilder;
|
|
956
944
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
957
945
|
* @param value - Value to compare against.
|
|
958
|
-
* @documentationMaturity preview
|
|
959
946
|
*/
|
|
960
947
|
ge: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any) => ItemsQueryBuilder;
|
|
961
948
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
962
949
|
* @param value - Value to compare against.
|
|
963
|
-
* @documentationMaturity preview
|
|
964
950
|
*/
|
|
965
951
|
gt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any) => ItemsQueryBuilder;
|
|
966
952
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
967
953
|
* @param value - Value to compare against.
|
|
968
|
-
* @documentationMaturity preview
|
|
969
954
|
*/
|
|
970
955
|
le: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any) => ItemsQueryBuilder;
|
|
971
956
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
972
957
|
* @param value - Value to compare against.
|
|
973
|
-
* @documentationMaturity preview
|
|
974
958
|
*/
|
|
975
959
|
lt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any) => ItemsQueryBuilder;
|
|
976
960
|
/** @param propertyName - Property whose value is compared with `string`.
|
|
977
961
|
* @param string - String to compare against. Case-insensitive.
|
|
978
|
-
* @documentationMaturity preview
|
|
979
962
|
*/
|
|
980
963
|
startsWith: (propertyName: '_id' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: string) => ItemsQueryBuilder;
|
|
981
964
|
/** @param propertyName - Property whose value is compared with `values`.
|
|
982
965
|
* @param values - List of values to compare against.
|
|
983
|
-
* @documentationMaturity preview
|
|
984
966
|
*/
|
|
985
967
|
hasSome: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any[]) => ItemsQueryBuilder;
|
|
986
|
-
/** @documentationMaturity preview */
|
|
987
968
|
in: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: any) => ItemsQueryBuilder;
|
|
988
|
-
/** @documentationMaturity preview */
|
|
989
969
|
exists: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace', value: boolean) => ItemsQueryBuilder;
|
|
990
|
-
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
991
|
-
* @documentationMaturity preview
|
|
992
|
-
*/
|
|
970
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
|
|
993
971
|
ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace'>) => ItemsQueryBuilder;
|
|
994
|
-
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
995
|
-
* @documentationMaturity preview
|
|
996
|
-
*/
|
|
972
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
|
|
997
973
|
descending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'itemSetId' | 'providerAppId' | 'namespace'>) => ItemsQueryBuilder;
|
|
998
|
-
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
999
|
-
* @documentationMaturity preview
|
|
1000
|
-
*/
|
|
974
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object. */
|
|
1001
975
|
limit: (limit: number) => ItemsQueryBuilder;
|
|
1002
|
-
/** @param cursor - A pointer to specific record
|
|
1003
|
-
* @documentationMaturity preview
|
|
1004
|
-
*/
|
|
976
|
+
/** @param cursor - A pointer to specific record */
|
|
1005
977
|
skipTo: (cursor: string) => ItemsQueryBuilder;
|
|
1006
|
-
/** @documentationMaturity preview */
|
|
1007
978
|
find: () => Promise<ItemsQueryResult>;
|
|
1008
979
|
}
|
|
980
|
+
/**
|
|
981
|
+
* @hidden
|
|
982
|
+
* @fqn wix.benefit_programs.v1.item.ItemService.QueryItems
|
|
983
|
+
* @requiredField query
|
|
984
|
+
*/
|
|
985
|
+
declare function typedQueryItems(query: CursorQuery): Promise<NonNullablePaths<QueryItemsResponse, `items`, 2>>;
|
|
1009
986
|
/**
|
|
1010
987
|
* Counts how many benefit items exist that fulfill the specified filtering conditions.
|
|
1011
988
|
*
|
|
1012
989
|
* For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).
|
|
1013
990
|
* @public
|
|
1014
|
-
* @documentationMaturity preview
|
|
1015
991
|
* @permissionId BENEFIT_PROGRAMS.ITEM_READ
|
|
1016
992
|
* @applicableIdentity APP
|
|
1017
993
|
* @fqn wix.benefit_programs.v1.item.ItemService.CountItems
|
|
@@ -1028,4 +1004,4 @@ interface CountItemsOptions {
|
|
|
1028
1004
|
filter?: Record<string, any> | null;
|
|
1029
1005
|
}
|
|
1030
1006
|
|
|
1031
|
-
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 };
|
|
1007
|
+
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, typedQueryItems, updateItem };
|
|
@@ -33,6 +33,7 @@ __export(index_typings_exports, {
|
|
|
33
33
|
getItem: () => getItem2,
|
|
34
34
|
listItems: () => listItems2,
|
|
35
35
|
queryItems: () => queryItems2,
|
|
36
|
+
typedQueryItems: () => typedQueryItems,
|
|
36
37
|
updateItem: () => updateItem2
|
|
37
38
|
});
|
|
38
39
|
module.exports = __toCommonJS(index_typings_exports);
|
|
@@ -802,6 +803,29 @@ function queryItems2() {
|
|
|
802
803
|
transformationPaths: {}
|
|
803
804
|
});
|
|
804
805
|
}
|
|
806
|
+
async function typedQueryItems(query) {
|
|
807
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
808
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
809
|
+
const reqOpts = queryItems(payload);
|
|
810
|
+
sideEffects?.onSiteCall?.();
|
|
811
|
+
try {
|
|
812
|
+
const result = await httpClient.request(reqOpts);
|
|
813
|
+
sideEffects?.onSuccess?.(result);
|
|
814
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
815
|
+
} catch (err) {
|
|
816
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
817
|
+
err,
|
|
818
|
+
{
|
|
819
|
+
spreadPathsToArguments: {},
|
|
820
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
821
|
+
singleArgumentUnchanged: false
|
|
822
|
+
},
|
|
823
|
+
["query"]
|
|
824
|
+
);
|
|
825
|
+
sideEffects?.onError?.(err);
|
|
826
|
+
throw transformedError;
|
|
827
|
+
}
|
|
828
|
+
}
|
|
805
829
|
async function countItems2(options) {
|
|
806
830
|
const { httpClient, sideEffects } = arguments[1];
|
|
807
831
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
@@ -842,6 +866,7 @@ async function countItems2(options) {
|
|
|
842
866
|
getItem,
|
|
843
867
|
listItems,
|
|
844
868
|
queryItems,
|
|
869
|
+
typedQueryItems,
|
|
845
870
|
updateItem
|
|
846
871
|
});
|
|
847
872
|
//# sourceMappingURL=index.typings.js.map
|