@wix/auto_sdk_benefit-programs_items 1.0.32 → 1.0.33

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/benefit-programs-v1-item-items.universal.ts","../../src/benefit-programs-v1-item-items.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, HttpResponse, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBenefitProgramsV1Item from './benefit-programs-v1-item-items.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Item {\n /**\n * Benefit item ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the benefit item is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the benefit item.\n *\n * Ignored when creating a benefit item.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the item was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the item was updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the item in the app providing it.\n *\n * For example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`.\n * @format GUID\n * @immutable\n * @readonly\n */\n externalId?: string | null;\n /**\n * Benefit item category.\n * @maxLength 20\n * @immutable\n * @readonly\n */\n category?: string | null;\n /**\n * Item set ID of the benefit that this benefit item is a part of.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemSetId?: string | null;\n /**\n * Benefit item display name.\n * @maxLength 64\n */\n displayName?: string | null;\n /**\n * ID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](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`.\n * @format GUID\n * @immutable\n * @readonly\n */\n providerAppId?: string | null;\n /**\n * 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.\n */\n extendedFields?: ExtendedFields;\n /**\n * 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.\n * @minLength 1\n * @maxLength 20\n * @immutable\n * @readonly\n */\n namespace?: string | null;\n}\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface ItemsCloned {\n /**\n * ID of the pool that had its items provisioned\n * @format GUID\n */\n itemSetId?: string;\n}\n\nexport interface CreateItemRequest {\n /** Item to create. */\n item: Item;\n}\n\nexport interface CreateItemResponse {\n /** Created item. */\n item?: Item;\n}\n\nexport interface BulkCreateItemsRequest {\n /**\n * Items to create.\n * @minSize 1\n * @maxSize 100\n */\n items: Item[];\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCreateItemsResponse {\n /**\n * List of created items and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkItemResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkItemResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /** Item. */\n item?: Item;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @format GUID\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface DeleteItemRequest {\n /**\n * Item ID.\n * @format GUID\n */\n itemId: string;\n}\n\nexport interface DeleteItemResponse {}\n\nexport interface BulkDeleteItemsRequest {\n /**\n * List of IDs of the items to delete.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n itemIds: string[];\n}\n\nexport interface BulkDeleteItemsResponse {\n /**\n * List of deleted items and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkItemResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkDeleteItemsByFilterRequest {\n /**\n * 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.\n * @minLength 1\n * @maxLength 20\n */\n namespace: string;\n /** Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */\n filter?: Record<string, any> | null;\n}\n\nexport interface BulkDeleteItemsByFilterResponse {\n /**\n * Job ID for item deletion. Retrieve job details using the Async Job API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/async-jobs/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/async-job/introduction)).\n * @format GUID\n */\n jobId?: string;\n}\n\nexport interface UpdateItemRequest {\n /** Item to update. */\n item: Item;\n}\n\nexport interface UpdateItemResponse {\n /** Updated item. */\n item?: Item;\n}\n\nexport interface BulkUpdateItemsRequest {\n /**\n * Items to update.\n * @minSize 1\n * @maxSize 100\n */\n items?: MaskedItem[];\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface MaskedItem {\n /** Item to update. */\n item?: Item;\n /** Explicit list of fields to update. */\n fieldMask?: string[];\n}\n\nexport interface BulkUpdateItemsResponse {\n /**\n * List of updated items and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkItemResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface GetItemRequest {\n /**\n * ID of the item to retrieve.\n * @format GUID\n */\n itemId: string;\n}\n\nexport interface GetItemResponse {\n /** Retrieved item. */\n item?: Item;\n}\n\nexport interface ListItemsRequest {\n /** Filter. */\n filter?: Filter;\n /** Cursor paging */\n cursorPaging?: CursorPaging;\n}\n\nexport enum Type {\n /** Unknown filter type. */\n UNKNOWN_FILTER = 'UNKNOWN_FILTER',\n /** Use with `filter.byItemSetIdAndReferenceOptions`. */\n BY_ITEM_SET_ID_AND_REFERENCE = 'BY_ITEM_SET_ID_AND_REFERENCE',\n /** Use with `filter.byReferenceOptions`. */\n BY_REFERENCE = 'BY_REFERENCE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_FILTER'\n | 'BY_ITEM_SET_ID_AND_REFERENCE'\n | 'BY_REFERENCE';\n\nexport interface ByItemSetIdAndReference {\n /**\n * Filter list.\n * @minSize 1\n * @maxSize 100\n */\n filters?: ByItemSetIdAndReferenceFilter[];\n}\n\nexport interface ByItemSetIdAndReferenceFilter {\n /**\n * ID set ID.\n * @format GUID\n */\n itemSetId?: string;\n /**\n * External item ID.\n * @format GUID\n */\n externalId?: string;\n /**\n * Item category.\n * @maxLength 20\n */\n category?: string;\n /**\n * *Required**. ID of the app providing the item.\n * @format GUID\n */\n providerAppId?: string;\n}\n\nexport interface ByReference {\n /**\n * Filter list.\n * @minSize 1\n * @maxSize 100\n */\n filters?: ByReferenceFilter[];\n}\n\nexport interface ByReferenceFilter {\n /**\n * External item ID.\n * @format GUID\n */\n externalId?: string;\n /**\n * Item category.\n * @maxLength 20\n */\n category?: string;\n /**\n * *Required**. ID of the app providing the item.\n * @format GUID\n */\n providerAppId?: string;\n}\n\nexport interface Filter extends FilterFilterOneOf {\n /** Filter the request by `itemSetId` and item reference. */\n byItemSetIdAndReferenceOptions?: ByItemSetIdAndReference;\n /** Filter the request item reference. */\n byReferenceOptions?: ByReference;\n /** Filter type. */\n type?: TypeWithLiterals;\n /**\n * Filter by namespace.\n * @minLength 1\n * @maxLength 20\n */\n namespace?: string;\n}\n\n/** @oneof */\nexport interface FilterFilterOneOf {\n /** Filter the request by `itemSetId` and item reference. */\n byItemSetIdAndReferenceOptions?: ByItemSetIdAndReference;\n /** Filter the request item reference. */\n byReferenceOptions?: ByReference;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return.\n * @max 1000\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListItemsResponse {\n /** Items. */\n items?: Item[];\n /** Metadata for paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * 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.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface QueryItemsRequest {\n /** Filter, sort, and paging to apply to the query. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface QueryItemsResponse {\n /** List of retrieved items. */\n items?: Item[];\n /** Metadata for paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface CountItemsRequest {\n /**\n * Items to count.\n *\n * Filter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).\n */\n filter?: Record<string, any> | null;\n}\n\nexport interface CountItemsResponse {\n /** Number of items fulfilling the specified filter conditions. */\n count?: number;\n}\n\nexport interface CloneItemsRequest {\n /**\n * Id of the item set to be cloned\n * @format GUID\n */\n itemSetId?: string;\n}\n\nexport interface CloneItemsResponse {\n /**\n * Id of the item set that these items were added to\n * @format GUID\n */\n clonedItemSetId?: string;\n /**\n * Id of the job that is cloning the item set\n * @format GUID\n */\n cloneJobId?: string;\n}\n\nexport interface BulkCloneItemSetsRequest {\n /**\n * Id of the item sets to be cloned\n * @format GUID\n * @minSize 1\n * @maxSize 1000\n */\n itemSetIds?: string[];\n}\n\nexport interface BulkCloneItemSetsResponse {\n /**\n * Results\n * @minSize 1\n * @maxSize 1000\n */\n results?: BulkCloneItemSetsResult[];\n /** Bulk action metadata */\n bulkActionMetadata?: BulkActionMetadata;\n /**\n * Id of the job that is cloning the item set\n * @format GUID\n */\n jobId?: string;\n}\n\nexport interface BulkCloneItemSetsResult {\n /** Item metadata */\n itemMetadata?: ItemMetadata;\n /**\n * Id of the item set that these items were added to\n * @format GUID\n */\n clonedItemSetId?: string;\n}\n\nexport interface AllocateItemSetsRequest {\n /**\n * Number of sets to allocate\n * @min 1\n * @max 1000\n */\n numberOfSets?: number;\n}\n\nexport interface AllocateItemSetsResponse {\n /**\n * ID that is a shared reference between a benefit pool and a specific item.\n * @format GUID\n */\n itemSetIds?: string[];\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type CountItemsApplicationErrors = {\n code?: 'TOO_MANY_TO_COUNT';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Creates a benefit item.\n * @param item - Item to create.\n * @public\n * @documentationMaturity preview\n * @requiredField item\n * @requiredField item.externalId\n * @requiredField item.itemSetId\n * @requiredField item.namespace\n * @requiredField item.providerAppId\n * @permissionId BENEFIT_PROGRAMS.ITEM_CREATE\n * @applicableIdentity APP\n * @returns Created item.\n * @fqn wix.benefit_programs.v1.item.ItemService.CreateItem\n */\nexport async function createItem(\n item: NonNullablePaths<\n Item,\n `externalId` | `itemSetId` | `namespace` | `providerAppId`,\n 2\n >\n): Promise<Item> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ item: item });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.createItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.item!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { item: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['item']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates benefit items.\n * @param items - Items to create.\n * @public\n * @documentationMaturity preview\n * @requiredField items\n * @requiredField items.externalId\n * @requiredField items.itemSetId\n * @requiredField items.namespace\n * @requiredField items.providerAppId\n * @permissionId BENEFIT_PROGRAMS.ITEM_CREATE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkCreateItems\n */\nexport async function bulkCreateItems(\n items: NonNullablePaths<\n Item,\n `externalId` | `itemSetId` | `namespace` | `providerAppId`,\n 2\n >[],\n options?: BulkCreateItemsOptions\n): Promise<\n NonNullablePaths<\n BulkCreateItemsResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n items: items,\n returnEntity: options?.returnEntity,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.bulkCreateItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n items: '$[0]',\n returnEntity: '$[1].returnEntity',\n },\n singleArgumentUnchanged: false,\n },\n ['items', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCreateItemsOptions {\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\n/**\n * Deletes a benefit item.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n * @param itemId - Item ID.\n * @public\n * @documentationMaturity preview\n * @requiredField itemId\n * @permissionId BENEFIT_PROGRAMS.ITEM_DELETE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.DeleteItem\n */\nexport async function deleteItem(itemId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ itemId: itemId });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.deleteItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { itemId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['itemId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Deletes benefit items.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n * @param itemIds - List of IDs of the items to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField itemIds\n * @permissionId BENEFIT_PROGRAMS.ITEM_DELETE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkDeleteItems\n */\nexport async function bulkDeleteItems(\n itemIds: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteItemsResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ itemIds: itemIds });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.bulkDeleteItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { itemIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['itemIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Deletes benefit items that fulfill the specified filter conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n * @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.\n * @public\n * @documentationMaturity preview\n * @requiredField namespace\n * @permissionId BENEFIT_PROGRAMS.ITEM_DELETE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkDeleteItemsByFilter\n */\nexport async function bulkDeleteItemsByFilter(\n namespace: string,\n options?: BulkDeleteItemsByFilterOptions\n): Promise<NonNullablePaths<BulkDeleteItemsByFilterResponse, `jobId`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n namespace: namespace,\n filter: options?.filter,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1Item.bulkDeleteItemsByFilter(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { namespace: '$[0]', filter: '$[1].filter' },\n singleArgumentUnchanged: false,\n },\n ['namespace', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkDeleteItemsByFilterOptions {\n /** Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */\n filter?: Record<string, any> | null;\n}\n\n/**\n * Updates a benefit item.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n * @param _id - Benefit item ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField item\n * @requiredField item.revision\n * @permissionId BENEFIT_PROGRAMS.ITEM_UPDATE\n * @applicableIdentity APP\n * @returns Updated item.\n * @fqn wix.benefit_programs.v1.item.ItemService.UpdateItem\n */\nexport async function updateItem(\n _id: string,\n item: NonNullablePaths<UpdateItem, `revision`, 2>\n): Promise<Item> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n item: { ...item, id: _id },\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.updateItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.item!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { item: '$[1]' },\n explicitPathsToArguments: { 'item.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'item']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateItem {\n /**\n * Benefit item ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the benefit item is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the benefit item.\n *\n * Ignored when creating a benefit item.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the item was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the item was updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the item in the app providing it.\n *\n * For example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`.\n * @format GUID\n * @immutable\n * @readonly\n */\n externalId?: string | null;\n /**\n * Benefit item category.\n * @maxLength 20\n * @immutable\n * @readonly\n */\n category?: string | null;\n /**\n * Item set ID of the benefit that this benefit item is a part of.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemSetId?: string | null;\n /**\n * Benefit item display name.\n * @maxLength 64\n */\n displayName?: string | null;\n /**\n * ID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](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`.\n * @format GUID\n * @immutable\n * @readonly\n */\n providerAppId?: string | null;\n /**\n * 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.\n */\n extendedFields?: ExtendedFields;\n /**\n * 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.\n * @minLength 1\n * @maxLength 20\n * @immutable\n * @readonly\n */\n namespace?: string | null;\n}\n\n/**\n * Updates benefit items.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n * @public\n * @documentationMaturity preview\n * @requiredField options.items.item\n * @requiredField options.items.item._id\n * @requiredField options.items.item.revision\n * @permissionId BENEFIT_PROGRAMS.ITEM_UPDATE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkUpdateItems\n */\nexport async function bulkUpdateItems(\n options?: NonNullablePaths<\n BulkUpdateItemsOptions,\n | `items.${number}.item`\n | `items.${number}.item._id`\n | `items.${number}.item.revision`,\n 5\n >\n): Promise<\n NonNullablePaths<\n BulkUpdateItemsResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n items: options?.items,\n returnEntity: options?.returnEntity,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.bulkUpdateItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n items: '$[0].items',\n returnEntity: '$[0].returnEntity',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkUpdateItemsOptions {\n /**\n * Items to update.\n * @minSize 1\n * @maxSize 100\n */\n items?: MaskedItem[];\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\n/**\n * Retrieves a benefit item.\n * @param itemId - ID of the item to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField itemId\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @returns Retrieved item.\n * @fqn wix.benefit_programs.v1.item.ItemService.GetItem\n */\nexport async function getItem(itemId: string): Promise<Item> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ itemId: itemId });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.getItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.item!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { itemId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['itemId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 1000 benefit items.\n * @public\n * @documentationMaturity preview\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.ListItems\n */\nexport async function listItems(\n options?: ListItemsOptions\n): Promise<NonNullablePaths<ListItemsResponse, `items`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n filter: options?.filter,\n cursorPaging: options?.cursorPaging,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.listItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n filter: '$[0].filter',\n cursorPaging: '$[0].cursorPaging',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListItemsOptions {\n /** Filter. */\n filter?: Filter;\n /** Cursor paging */\n cursorPaging?: CursorPaging;\n}\n\n/**\n * Creates a query to retrieve a list of items.\n *\n * The Query Items method builds a query to retrieve a list of items and returns a `ItemsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * 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.\n *\n * Query Items has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `ItemsQueryResult`.\n * @public\n * @documentationMaturity preview\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.QueryItems\n */\nexport function queryItems(): ItemsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Item, 'CURSOR', QueryItemsRequest, QueryItemsResponse>({\n func: async (payload: QueryItemsRequest) => {\n const reqOpts = ambassadorWixBenefitProgramsV1Item.queryItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryItemsRequest['query']) => {\n const args = [query, {}] as [QueryItemsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryItemsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.items,\n pagingMetadata: transformedData?.metadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface ItemsQueryResult extends QueryCursorResult {\n items: Item[];\n query: ItemsQueryBuilder;\n next: () => Promise<ItemsQueryResult>;\n prev: () => Promise<ItemsQueryResult>;\n}\n\nexport interface ItemsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName:\n | '_id'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: string\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n * @documentationMaturity preview\n */\n hasSome: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any[]\n ) => ItemsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: boolean\n ) => ItemsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace'\n >\n ) => ItemsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace'\n >\n ) => ItemsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => ItemsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => ItemsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<ItemsQueryResult>;\n}\n\n/**\n * Counts how many benefit items exist that fulfill the specified filtering conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n * @public\n * @documentationMaturity preview\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.CountItems\n */\nexport async function countItems(options?: CountItemsOptions): Promise<\n NonNullablePaths<CountItemsResponse, `count`, 2> & {\n __applicationErrorsType?: CountItemsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n filter: options?.filter,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.countItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { filter: '$[0].filter' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CountItemsOptions {\n /**\n * Items to count.\n *\n * Filter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).\n */\n filter?: Record<string, any> | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBenefitProgramsV1ItemItemServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {};\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_benefit-programs_items';\n\n/** Creates a benefit item. */\nexport function createItem(payload: object): RequestOptionsFactory<any> {\n function __createItem({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.CreateItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createItem;\n}\n\n/** Creates benefit items. */\nexport function bulkCreateItems(payload: object): RequestOptionsFactory<any> {\n function __bulkCreateItems({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'items.createdDate' }, { path: 'items.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.BulkCreateItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateItems;\n}\n\n/**\n * Deletes a benefit item.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n */\nexport function deleteItem(payload: object): RequestOptionsFactory<any> {\n function __deleteItem({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.DeleteItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/{itemId}/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __deleteItem;\n}\n\n/**\n * Deletes benefit items.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n */\nexport function bulkDeleteItems(payload: object): RequestOptionsFactory<any> {\n function __bulkDeleteItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.BulkDeleteItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/delete',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkDeleteItems;\n}\n\n/**\n * Deletes benefit items that fulfill the specified filter conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n */\nexport function bulkDeleteItemsByFilter(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkDeleteItemsByFilter({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.item.ItemService.BulkDeleteItemsByFilter',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/delete-by-filter',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteItemsByFilter;\n}\n\n/**\n * Updates a benefit item.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n */\nexport function updateItem(payload: object): RequestOptionsFactory<any> {\n function __updateItem({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'PATCH' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.UpdateItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/{item.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateItem;\n}\n\n/**\n * Updates benefit items.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n */\nexport function bulkUpdateItems(payload: object): RequestOptionsFactory<any> {\n function __bulkUpdateItems({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'items.fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'items.item.createdDate' },\n { path: 'items.item.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.BulkUpdateItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/update',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkUpdateItems;\n}\n\n/** Retrieves a benefit item. */\nexport function getItem(payload: object): RequestOptionsFactory<any> {\n function __getItem({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.GetItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/{itemId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getItem;\n}\n\n/** Retrieves a list of up to 1000 benefit items. */\nexport function listItems(payload: object): RequestOptionsFactory<any> {\n function __listItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.ListItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'items.createdDate' },\n { path: 'items.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listItems;\n}\n\n/**\n * Creates a query to retrieve a list of items.\n *\n * The Query Items method builds a query to retrieve a list of items and returns a `ItemsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * 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.\n *\n * Query Items has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `ItemsQueryResult`.\n */\nexport function queryItems(payload: object): RequestOptionsFactory<any> {\n function __queryItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.QueryItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'items.createdDate' },\n { path: 'items.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryItems;\n}\n\n/**\n * Counts how many benefit items exist that fulfill the specified filtering conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n */\nexport function countItems(payload: object): RequestOptionsFactory<any> {\n function __countItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.CountItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/count',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __countItems;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,8CACP,MACA;AACA,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ACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,QAAQ,cAAc;AAAA,QAClD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS;AAAA,IACZ;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","transformPaths","Type","SortOrder","WebhookIdentityType","createItem","bulkCreateItems","deleteItem","bulkDeleteItems","bulkDeleteItemsByFilter","updateItem","bulkUpdateItems","getItem","listItems","queryItems","countItems"]}
1
+ {"version":3,"sources":["../../src/benefit-programs-v1-item-items.universal.ts","../../src/benefit-programs-v1-item-items.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, HttpResponse, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBenefitProgramsV1Item from './benefit-programs-v1-item-items.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\n\nexport interface Item {\n /**\n * Benefit item ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the benefit item is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the benefit item.\n *\n * Ignored when creating a benefit item.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the item was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the item was updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the item in the app providing it.\n *\n * For example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`.\n * @format GUID\n * @immutable\n * @readonly\n */\n externalId?: string | null;\n /**\n * Benefit item category.\n * @maxLength 20\n * @immutable\n * @readonly\n */\n category?: string | null;\n /**\n * Item set ID of the benefit that this benefit item is a part of.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemSetId?: string | null;\n /**\n * Benefit item display name.\n * @maxLength 64\n */\n displayName?: string | null;\n /**\n * ID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](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`.\n * @format GUID\n * @immutable\n * @readonly\n */\n providerAppId?: string | null;\n /**\n * 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.\n */\n extendedFields?: ExtendedFields;\n /**\n * 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.\n * @minLength 1\n * @maxLength 20\n * @immutable\n * @readonly\n */\n namespace?: string | null;\n}\n\nexport interface ExtendedFields {\n /**\n * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\n * The value of each key is structured according to the schema defined when the extended fields were configured.\n *\n * You can only access fields for which you have the appropriate permissions.\n *\n * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).\n */\n namespaces?: Record<string, Record<string, any>>;\n}\n\nexport interface ItemsCloned {\n /**\n * ID of the pool that had its items provisioned\n * @format GUID\n */\n itemSetId?: string;\n}\n\nexport interface CreateItemRequest {\n /** Item to create. */\n item: Item;\n}\n\nexport interface CreateItemResponse {\n /** Created item. */\n item?: Item;\n}\n\nexport interface BulkCreateItemsRequest {\n /**\n * Items to create.\n * @minSize 1\n * @maxSize 100\n */\n items: Item[];\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface BulkCreateItemsResponse {\n /**\n * List of created items and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkItemResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkItemResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /** Item. */\n item?: Item;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @format GUID\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface DeleteItemRequest {\n /**\n * Item ID.\n * @format GUID\n */\n itemId: string;\n}\n\nexport interface DeleteItemResponse {}\n\nexport interface BulkDeleteItemsRequest {\n /**\n * List of IDs of the items to delete.\n * @minSize 1\n * @maxSize 100\n * @format GUID\n */\n itemIds: string[];\n}\n\nexport interface BulkDeleteItemsResponse {\n /**\n * List of deleted items and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkItemResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkDeleteItemsByFilterRequest {\n /**\n * 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.\n * @minLength 1\n * @maxLength 20\n */\n namespace: string;\n /** Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */\n filter?: Record<string, any> | null;\n}\n\nexport interface BulkDeleteItemsByFilterResponse {\n /**\n * Job ID for item deletion. Retrieve job details using the Async Job API ([SDK](https://dev.wix.com/docs/sdk/backend-modules/async-jobs/introduction) | [REST](https://dev.wix.com/docs/rest/business-management/async-job/introduction)).\n * @format GUID\n */\n jobId?: string;\n}\n\nexport interface UpdateItemRequest {\n /** Item to update. */\n item: Item;\n}\n\nexport interface UpdateItemResponse {\n /** Updated item. */\n item?: Item;\n}\n\nexport interface BulkUpdateItemsRequest {\n /**\n * Items to update.\n * @minSize 1\n * @maxSize 100\n */\n items?: MaskedItem[];\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\nexport interface MaskedItem {\n /** Item to update. */\n item?: Item;\n /** Explicit list of fields to update. */\n fieldMask?: string[];\n}\n\nexport interface BulkUpdateItemsResponse {\n /**\n * List of updated items and associated metadata.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkItemResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface GetItemRequest {\n /**\n * ID of the item to retrieve.\n * @format GUID\n */\n itemId: string;\n}\n\nexport interface GetItemResponse {\n /** Retrieved item. */\n item?: Item;\n}\n\nexport interface ListItemsRequest {\n /** Filter. */\n filter?: Filter;\n /** Cursor paging */\n cursorPaging?: CursorPaging;\n}\n\nexport enum Type {\n /** Unknown filter type. */\n UNKNOWN_FILTER = 'UNKNOWN_FILTER',\n /** Use with `filter.byItemSetIdAndReferenceOptions`. */\n BY_ITEM_SET_ID_AND_REFERENCE = 'BY_ITEM_SET_ID_AND_REFERENCE',\n /** Use with `filter.byReferenceOptions`. */\n BY_REFERENCE = 'BY_REFERENCE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_FILTER'\n | 'BY_ITEM_SET_ID_AND_REFERENCE'\n | 'BY_REFERENCE';\n\nexport interface ByItemSetIdAndReference {\n /**\n * Filter list.\n * @minSize 1\n * @maxSize 100\n */\n filters?: ByItemSetIdAndReferenceFilter[];\n}\n\nexport interface ByItemSetIdAndReferenceFilter {\n /**\n * ID set ID.\n * @format GUID\n */\n itemSetId?: string;\n /**\n * External item ID.\n * @format GUID\n */\n externalId?: string;\n /**\n * Item category.\n * @maxLength 20\n */\n category?: string;\n /**\n * *Required**. ID of the app providing the item.\n * @format GUID\n */\n providerAppId?: string;\n}\n\nexport interface ByReference {\n /**\n * Filter list.\n * @minSize 1\n * @maxSize 100\n */\n filters?: ByReferenceFilter[];\n}\n\nexport interface ByReferenceFilter {\n /**\n * External item ID.\n * @format GUID\n */\n externalId?: string;\n /**\n * Item category.\n * @maxLength 20\n */\n category?: string;\n /**\n * *Required**. ID of the app providing the item.\n * @format GUID\n */\n providerAppId?: string;\n}\n\nexport interface Filter extends FilterFilterOneOf {\n /** Filter the request by `itemSetId` and item reference. */\n byItemSetIdAndReferenceOptions?: ByItemSetIdAndReference;\n /** Filter the request item reference. */\n byReferenceOptions?: ByReference;\n /** Filter type. */\n type?: TypeWithLiterals;\n /**\n * Filter by namespace.\n * @minLength 1\n * @maxLength 20\n */\n namespace?: string;\n}\n\n/** @oneof */\nexport interface FilterFilterOneOf {\n /** Filter the request by `itemSetId` and item reference. */\n byItemSetIdAndReferenceOptions?: ByItemSetIdAndReference;\n /** Filter the request item reference. */\n byReferenceOptions?: ByReference;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return.\n * @max 1000\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListItemsResponse {\n /** Items. */\n items?: Item[];\n /** Metadata for paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * 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.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface QueryItemsRequest {\n /** Filter, sort, and paging to apply to the query. */\n query?: CursorQuery;\n}\n\nexport interface CursorQuery extends CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object in the following format:\n * `\"filter\" : {\n * \"fieldName1\": \"value1\",\n * \"fieldName2\":{\"$operator\":\"value2\"}\n * }`\n * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object in the following format:\n * `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]`\n * @maxSize 5\n */\n sort?: Sorting[];\n}\n\n/** @oneof */\nexport interface CursorQueryPagingMethodOneOf {\n /** 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`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface QueryItemsResponse {\n /** List of retrieved items. */\n items?: Item[];\n /** Metadata for paginated results. */\n metadata?: CursorPagingMetadata;\n}\n\nexport interface CountItemsRequest {\n /**\n * Items to count.\n *\n * Filter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).\n */\n filter?: Record<string, any> | null;\n}\n\nexport interface CountItemsResponse {\n /** Number of items fulfilling the specified filter conditions. */\n count?: number;\n}\n\nexport interface CloneItemsRequest {\n /**\n * Id of the item set to be cloned\n * @format GUID\n */\n itemSetId?: string;\n}\n\nexport interface CloneItemsResponse {\n /**\n * Id of the item set that these items were added to\n * @format GUID\n */\n clonedItemSetId?: string;\n /**\n * Id of the job that is cloning the item set\n * @format GUID\n */\n cloneJobId?: string;\n}\n\nexport interface BulkCloneItemSetsRequest {\n /**\n * Id of the item sets to be cloned\n * @format GUID\n * @minSize 1\n * @maxSize 1000\n */\n itemSetIds?: string[];\n}\n\nexport interface BulkCloneItemSetsResponse {\n /**\n * Results\n * @minSize 1\n * @maxSize 1000\n */\n results?: BulkCloneItemSetsResult[];\n /** Bulk action metadata */\n bulkActionMetadata?: BulkActionMetadata;\n /**\n * Id of the job that is cloning the item set\n * @format GUID\n */\n jobId?: string;\n}\n\nexport interface BulkCloneItemSetsResult {\n /** Item metadata */\n itemMetadata?: ItemMetadata;\n /**\n * Id of the item set that these items were added to\n * @format GUID\n */\n clonedItemSetId?: string;\n}\n\nexport interface AllocateItemSetsRequest {\n /**\n * Number of sets to allocate\n * @min 1\n * @max 1000\n */\n numberOfSets?: number;\n}\n\nexport interface AllocateItemSetsResponse {\n /**\n * ID that is a shared reference between a benefit pool and a specific item.\n * @format GUID\n */\n itemSetIds?: string[];\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type CountItemsApplicationErrors = {\n code?: 'TOO_MANY_TO_COUNT';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Creates a benefit item.\n * @param item - Item to create.\n * @public\n * @documentationMaturity preview\n * @requiredField item\n * @requiredField item.externalId\n * @requiredField item.itemSetId\n * @requiredField item.namespace\n * @requiredField item.providerAppId\n * @permissionId BENEFIT_PROGRAMS.ITEM_CREATE\n * @applicableIdentity APP\n * @returns Created item.\n * @fqn wix.benefit_programs.v1.item.ItemService.CreateItem\n */\nexport async function createItem(\n item: NonNullablePaths<\n Item,\n `externalId` | `itemSetId` | `namespace` | `providerAppId`,\n 2\n >\n): Promise<Item> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ item: item });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.createItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.item!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { item: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['item']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Creates benefit items.\n * @param items - Items to create.\n * @public\n * @documentationMaturity preview\n * @requiredField items\n * @requiredField items.externalId\n * @requiredField items.itemSetId\n * @requiredField items.namespace\n * @requiredField items.providerAppId\n * @permissionId BENEFIT_PROGRAMS.ITEM_CREATE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkCreateItems\n */\nexport async function bulkCreateItems(\n items: NonNullablePaths<\n Item,\n `externalId` | `itemSetId` | `namespace` | `providerAppId`,\n 2\n >[],\n options?: BulkCreateItemsOptions\n): Promise<\n NonNullablePaths<\n BulkCreateItemsResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n items: items,\n returnEntity: options?.returnEntity,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.bulkCreateItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n items: '$[0]',\n returnEntity: '$[1].returnEntity',\n },\n singleArgumentUnchanged: false,\n },\n ['items', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkCreateItemsOptions {\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\n/**\n * Deletes a benefit item.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n * @param itemId - Item ID.\n * @public\n * @documentationMaturity preview\n * @requiredField itemId\n * @permissionId BENEFIT_PROGRAMS.ITEM_DELETE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.DeleteItem\n */\nexport async function deleteItem(itemId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ itemId: itemId });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.deleteItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { itemId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['itemId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Deletes benefit items.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n * @param itemIds - List of IDs of the items to delete.\n * @public\n * @documentationMaturity preview\n * @requiredField itemIds\n * @permissionId BENEFIT_PROGRAMS.ITEM_DELETE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkDeleteItems\n */\nexport async function bulkDeleteItems(\n itemIds: string[]\n): Promise<\n NonNullablePaths<\n BulkDeleteItemsResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ itemIds: itemIds });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.bulkDeleteItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { itemIds: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['itemIds']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Deletes benefit items that fulfill the specified filter conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n * @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.\n * @public\n * @documentationMaturity preview\n * @requiredField namespace\n * @permissionId BENEFIT_PROGRAMS.ITEM_DELETE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkDeleteItemsByFilter\n */\nexport async function bulkDeleteItemsByFilter(\n namespace: string,\n options?: BulkDeleteItemsByFilterOptions\n): Promise<NonNullablePaths<BulkDeleteItemsByFilterResponse, `jobId`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n namespace: namespace,\n filter: options?.filter,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1Item.bulkDeleteItemsByFilter(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { namespace: '$[0]', filter: '$[1].filter' },\n singleArgumentUnchanged: false,\n },\n ['namespace', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkDeleteItemsByFilterOptions {\n /** Filter options. To learn more, see [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language). */\n filter?: Record<string, any> | null;\n}\n\n/**\n * Updates a benefit item.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n * @param _id - Benefit item ID.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField item\n * @requiredField item.revision\n * @permissionId BENEFIT_PROGRAMS.ITEM_UPDATE\n * @applicableIdentity APP\n * @returns Updated item.\n * @fqn wix.benefit_programs.v1.item.ItemService.UpdateItem\n */\nexport async function updateItem(\n _id: string,\n item: NonNullablePaths<UpdateItem, `revision`, 2>\n): Promise<Item> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n item: { ...item, id: _id },\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.updateItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.item!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: { item: '$[1]' },\n explicitPathsToArguments: { 'item.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'item']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateItem {\n /**\n * Benefit item ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n _id?: string | null;\n /**\n * Revision number, which increments by 1 each time the benefit item is updated.\n * To prevent conflicting changes, the current revision must be passed when updating the benefit item.\n *\n * Ignored when creating a benefit item.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the item was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the item was updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /**\n * ID of the item in the app providing it.\n *\n * For example, if the item is a product provided by Wix Stores, the `externalId` would be the Wix Stores `product Id`.\n * @format GUID\n * @immutable\n * @readonly\n */\n externalId?: string | null;\n /**\n * Benefit item category.\n * @maxLength 20\n * @immutable\n * @readonly\n */\n category?: string | null;\n /**\n * Item set ID of the benefit that this benefit item is a part of.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemSetId?: string | null;\n /**\n * Benefit item display name.\n * @maxLength 64\n */\n displayName?: string | null;\n /**\n * ID of the app ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/apps-created-by-wix) | [REST](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`.\n * @format GUID\n * @immutable\n * @readonly\n */\n providerAppId?: string | null;\n /**\n * 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.\n */\n extendedFields?: ExtendedFields;\n /**\n * 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.\n * @minLength 1\n * @maxLength 20\n * @immutable\n * @readonly\n */\n namespace?: string | null;\n}\n\n/**\n * Updates benefit items.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n * @public\n * @documentationMaturity preview\n * @requiredField options.items.item\n * @requiredField options.items.item._id\n * @requiredField options.items.item.revision\n * @permissionId BENEFIT_PROGRAMS.ITEM_UPDATE\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.BulkUpdateItems\n */\nexport async function bulkUpdateItems(\n options?: NonNullablePaths<\n BulkUpdateItemsOptions,\n | `items.${number}.item`\n | `items.${number}.item._id`\n | `items.${number}.item.revision`,\n 5\n >\n): Promise<\n NonNullablePaths<\n BulkUpdateItemsResponse,\n | `results`\n | `results.${number}.itemMetadata.originalIndex`\n | `results.${number}.itemMetadata.success`\n | `results.${number}.itemMetadata.error.code`\n | `results.${number}.itemMetadata.error.description`\n | `bulkActionMetadata.totalSuccesses`\n | `bulkActionMetadata.totalFailures`\n | `bulkActionMetadata.undetailedFailures`,\n 6\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n items: options?.items,\n returnEntity: options?.returnEntity,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.bulkUpdateItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n items: '$[0].items',\n returnEntity: '$[0].returnEntity',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface BulkUpdateItemsOptions {\n /**\n * Items to update.\n * @minSize 1\n * @maxSize 100\n */\n items?: MaskedItem[];\n /**\n * Whether to return the full item entities.\n *\n * Default: `false`\n */\n returnEntity?: boolean;\n}\n\n/**\n * Retrieves a benefit item.\n * @param itemId - ID of the item to retrieve.\n * @public\n * @documentationMaturity preview\n * @requiredField itemId\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @returns Retrieved item.\n * @fqn wix.benefit_programs.v1.item.ItemService.GetItem\n */\nexport async function getItem(itemId: string): Promise<Item> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({ itemId: itemId });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.getItem(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.item!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { itemId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['itemId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of up to 1000 benefit items.\n * @public\n * @documentationMaturity preview\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.ListItems\n */\nexport async function listItems(\n options?: ListItemsOptions\n): Promise<NonNullablePaths<ListItemsResponse, `items`, 2>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n filter: options?.filter,\n cursorPaging: options?.cursorPaging,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.listItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n filter: '$[0].filter',\n cursorPaging: '$[0].cursorPaging',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListItemsOptions {\n /** Filter. */\n filter?: Filter;\n /** Cursor paging */\n cursorPaging?: CursorPaging;\n}\n\n/**\n * Creates a query to retrieve a list of items.\n *\n * The Query Items method builds a query to retrieve a list of items and returns a `ItemsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * 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.\n *\n * Query Items has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `ItemsQueryResult`.\n * @public\n * @documentationMaturity preview\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.QueryItems\n */\nexport function queryItems(): ItemsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Item, 'CURSOR', QueryItemsRequest, QueryItemsResponse>({\n func: async (payload: QueryItemsRequest) => {\n const reqOpts = ambassadorWixBenefitProgramsV1Item.queryItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryItemsRequest['query']) => {\n const args = [query, {}] as [QueryItemsRequest['query'], {}];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryItemsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.items,\n pagingMetadata: transformedData?.metadata,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface ItemsQueryResult extends QueryCursorResult {\n items: Item[];\n query: ItemsQueryBuilder;\n next: () => Promise<ItemsQueryResult>;\n prev: () => Promise<ItemsQueryResult>;\n}\n\nexport interface ItemsQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ge: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n gt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n le: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n lt: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `string`.\n * @param string - String to compare against. Case-insensitive.\n * @documentationMaturity preview\n */\n startsWith: (\n propertyName:\n | '_id'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: string\n ) => ItemsQueryBuilder;\n /** @param propertyName - Property whose value is compared with `values`.\n * @param values - List of values to compare against.\n * @documentationMaturity preview\n */\n hasSome: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any[]\n ) => ItemsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: any\n ) => ItemsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace',\n value: boolean\n ) => ItemsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n ascending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace'\n >\n ) => ItemsQueryBuilder;\n /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.\n * @documentationMaturity preview\n */\n descending: (\n ...propertyNames: Array<\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'itemSetId'\n | 'providerAppId'\n | 'namespace'\n >\n ) => ItemsQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => ItemsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => ItemsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<ItemsQueryResult>;\n}\n\n/**\n * Counts how many benefit items exist that fulfill the specified filtering conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n * @public\n * @documentationMaturity preview\n * @permissionId BENEFIT_PROGRAMS.ITEM_READ\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.item.ItemService.CountItems\n */\nexport async function countItems(options?: CountItemsOptions): Promise<\n NonNullablePaths<CountItemsResponse, `count`, 2> & {\n __applicationErrorsType?: CountItemsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n filter: options?.filter,\n });\n\n const reqOpts = ambassadorWixBenefitProgramsV1Item.countItems(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { filter: '$[0].filter' },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface CountItemsOptions {\n /**\n * Items to count.\n *\n * Filter options. See [API Query Language](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language).\n */\n filter?: Record<string, any> | null;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBenefitProgramsV1ItemItemServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/benefit-programs-items',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-items',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-items',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/benefit-programs-items',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/benefit-programs-items',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-items',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/benefit-programs-items',\n destPath: '',\n },\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/benefit-programs-items',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/benefit-programs/v1/items',\n destPath: '/v1/items',\n },\n {\n srcPath: '/_api/benefit-programs/v1/bulk/items',\n destPath: '/v1/bulk/items',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_benefit-programs_items';\n\n/** Creates a benefit item. */\nexport function createItem(payload: object): RequestOptionsFactory<any> {\n function __createItem({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.CreateItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createItem;\n}\n\n/** Creates benefit items. */\nexport function bulkCreateItems(payload: object): RequestOptionsFactory<any> {\n function __bulkCreateItems({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'items.createdDate' }, { path: 'items.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.BulkCreateItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/create',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkCreateItems;\n}\n\n/**\n * Deletes a benefit item.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n */\nexport function deleteItem(payload: object): RequestOptionsFactory<any> {\n function __deleteItem({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.DeleteItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/{itemId}/delete',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __deleteItem;\n}\n\n/**\n * Deletes benefit items.\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n */\nexport function bulkDeleteItems(payload: object): RequestOptionsFactory<any> {\n function __bulkDeleteItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.BulkDeleteItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/delete',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkDeleteItems;\n}\n\n/**\n * Deletes benefit items that fulfill the specified filter conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n *\n * <blockquote class=\"caution\">\n * <strong>Caution:</strong>\n *\n * Deleting a benefit item removes the association between a benefit and the item with immediate effect. This may affect currently active pools.\n * </blockquote>\n */\nexport function bulkDeleteItemsByFilter(\n payload: object\n): RequestOptionsFactory<any> {\n function __bulkDeleteItemsByFilter({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.item.ItemService.BulkDeleteItemsByFilter',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/delete-by-filter',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __bulkDeleteItemsByFilter;\n}\n\n/**\n * Updates a benefit item.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n */\nexport function updateItem(payload: object): RequestOptionsFactory<any> {\n function __updateItem({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'PATCH' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.UpdateItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/{item.id}',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateItem;\n}\n\n/**\n * Updates benefit items.\n *\n * Each time the benefit item is updated,\n * `revision` increments by 1.\n * The current `revision` must be passed when updating the benefit item.\n * This ensures you're working with the latest benefit item\n * and prevents unintended overwrites.\n */\nexport function bulkUpdateItems(payload: object): RequestOptionsFactory<any> {\n function __bulkUpdateItems({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'items.fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'items.item.createdDate' },\n { path: 'items.item.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.BulkUpdateItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/bulk/items/update',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'results.item.createdDate' },\n { path: 'results.item.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __bulkUpdateItems;\n}\n\n/** Retrieves a benefit item. */\nexport function getItem(payload: object): RequestOptionsFactory<any> {\n function __getItem({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.GetItem',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/{itemId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'item.createdDate' }, { path: 'item.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getItem;\n}\n\n/** Retrieves a list of up to 1000 benefit items. */\nexport function listItems(payload: object): RequestOptionsFactory<any> {\n function __listItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'GET' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.ListItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'items.createdDate' },\n { path: 'items.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listItems;\n}\n\n/**\n * Creates a query to retrieve a list of items.\n *\n * The Query Items method builds a query to retrieve a list of items and returns a `ItemsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the `find()` method.\n *\n * 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.\n *\n * Query Items has a default paging limit of 50, which you can override.\n *\n * For a full description of the item object, see the object returned for the `items` property in `ItemsQueryResult`.\n */\nexport function queryItems(payload: object): RequestOptionsFactory<any> {\n function __queryItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.QueryItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/query',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'items.createdDate' },\n { path: 'items.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryItems;\n}\n\n/**\n * Counts how many benefit items exist that fulfill the specified filtering conditions.\n *\n * For a list of supported filters, see [Filtering and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/items/filtering-and-sorting).\n */\nexport function countItems(payload: object): RequestOptionsFactory<any> {\n function __countItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.item',\n method: 'POST' as any,\n methodFqn: 'wix.benefit_programs.v1.item.ItemService.CountItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1ItemItemServiceUrl({\n protoPath: '/v1/items/count',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __countItems;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,8CACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE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a,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","transformPaths","Type","SortOrder","WebhookIdentityType","createItem","bulkCreateItems","deleteItem","bulkDeleteItems","bulkDeleteItemsByFilter","updateItem","bulkUpdateItems","getItem","listItems","queryItems","countItems"]}
package/build/es/meta.mjs CHANGED
@@ -6,7 +6,132 @@ import { transformSDKFieldMaskToRESTFieldMask } from "@wix/sdk-runtime/transform
6
6
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
7
7
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
8
8
  function resolveWixBenefitProgramsV1ItemItemServiceUrl(opts) {
9
- const domainToMappings = {};
9
+ const domainToMappings = {
10
+ _: [
11
+ {
12
+ srcPath: "/_api/benefit-programs-items",
13
+ destPath: ""
14
+ },
15
+ {
16
+ srcPath: "/_api/benefit-programs/v1/items",
17
+ destPath: "/v1/items"
18
+ },
19
+ {
20
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
21
+ destPath: "/v1/bulk/items"
22
+ }
23
+ ],
24
+ "editor._base_domain_": [
25
+ {
26
+ srcPath: "/_api/benefit-programs-items",
27
+ destPath: ""
28
+ },
29
+ {
30
+ srcPath: "/_api/benefit-programs/v1/items",
31
+ destPath: "/v1/items"
32
+ },
33
+ {
34
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
35
+ destPath: "/v1/bulk/items"
36
+ }
37
+ ],
38
+ "blocks._base_domain_": [
39
+ {
40
+ srcPath: "/_api/benefit-programs-items",
41
+ destPath: ""
42
+ },
43
+ {
44
+ srcPath: "/_api/benefit-programs/v1/items",
45
+ destPath: "/v1/items"
46
+ },
47
+ {
48
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
49
+ destPath: "/v1/bulk/items"
50
+ }
51
+ ],
52
+ "create.editorx": [
53
+ {
54
+ srcPath: "/_api/benefit-programs-items",
55
+ destPath: ""
56
+ },
57
+ {
58
+ srcPath: "/_api/benefit-programs/v1/items",
59
+ destPath: "/v1/items"
60
+ },
61
+ {
62
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
63
+ destPath: "/v1/bulk/items"
64
+ }
65
+ ],
66
+ "editor.wixapps.net": [
67
+ {
68
+ srcPath: "/_api/benefit-programs-items",
69
+ destPath: ""
70
+ },
71
+ {
72
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
73
+ destPath: "/v1/bulk/items"
74
+ },
75
+ {
76
+ srcPath: "/_api/benefit-programs/v1/items",
77
+ destPath: "/v1/items"
78
+ }
79
+ ],
80
+ "manage._base_domain_": [
81
+ {
82
+ srcPath: "/_api/benefit-programs-items",
83
+ destPath: ""
84
+ },
85
+ {
86
+ srcPath: "/_api/benefit-programs/v1/items",
87
+ destPath: "/v1/items"
88
+ },
89
+ {
90
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
91
+ destPath: "/v1/bulk/items"
92
+ }
93
+ ],
94
+ "www._base_domain_": [
95
+ {
96
+ srcPath: "/_api/benefit-programs-items",
97
+ destPath: ""
98
+ },
99
+ {
100
+ srcPath: "/_api/benefit-programs/v1/items",
101
+ destPath: "/v1/items"
102
+ },
103
+ {
104
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
105
+ destPath: "/v1/bulk/items"
106
+ }
107
+ ],
108
+ "api._api_base_domain_": [
109
+ {
110
+ srcPath: "/benefit-programs-items",
111
+ destPath: ""
112
+ }
113
+ ],
114
+ "www.wixapis.com": [
115
+ {
116
+ srcPath: "/benefit-programs/v1/items",
117
+ destPath: "/v1/items"
118
+ },
119
+ {
120
+ srcPath: "/benefit-programs/v1/bulk/items",
121
+ destPath: "/v1/bulk/items"
122
+ }
123
+ ],
124
+ "*.dev.wix-code.com": [
125
+ {
126
+ srcPath: "/_api/benefit-programs/v1/items",
127
+ destPath: "/v1/items"
128
+ },
129
+ {
130
+ srcPath: "/_api/benefit-programs/v1/bulk/items",
131
+ destPath: "/v1/bulk/items"
132
+ }
133
+ ]
134
+ };
10
135
  return resolveUrl(Object.assign(opts, { domainToMappings }));
11
136
  }
12
137
  var PACKAGE_NAME = "@wix/auto_sdk_benefit-programs_items";