@wix/auto_sdk_benefit-programs_pool-definition-items 1.0.7 → 1.0.8

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.
Files changed (49) hide show
  1. package/build/cjs/index.d.ts +8 -3
  2. package/build/cjs/index.js +249 -2
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +188 -2
  5. package/build/cjs/index.typings.js +223 -2
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +3 -2
  8. package/build/cjs/meta.js +52 -0
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/schemas.d.ts +52 -1
  11. package/build/cjs/schemas.js +101 -0
  12. package/build/cjs/schemas.js.map +1 -1
  13. package/build/es/index.d.mts +8 -3
  14. package/build/es/index.mjs +250 -2
  15. package/build/es/index.mjs.map +1 -1
  16. package/build/es/index.typings.d.mts +188 -2
  17. package/build/es/index.typings.mjs +223 -2
  18. package/build/es/index.typings.mjs.map +1 -1
  19. package/build/es/meta.d.mts +3 -2
  20. package/build/es/meta.mjs +51 -0
  21. package/build/es/meta.mjs.map +1 -1
  22. package/build/es/schemas.d.mts +52 -1
  23. package/build/es/schemas.mjs +99 -0
  24. package/build/es/schemas.mjs.map +1 -1
  25. package/build/internal/cjs/index.d.ts +8 -3
  26. package/build/internal/cjs/index.js +249 -2
  27. package/build/internal/cjs/index.js.map +1 -1
  28. package/build/internal/cjs/index.typings.d.ts +188 -2
  29. package/build/internal/cjs/index.typings.js +223 -2
  30. package/build/internal/cjs/index.typings.js.map +1 -1
  31. package/build/internal/cjs/meta.d.ts +3 -2
  32. package/build/internal/cjs/meta.js +52 -0
  33. package/build/internal/cjs/meta.js.map +1 -1
  34. package/build/internal/cjs/schemas.d.ts +52 -1
  35. package/build/internal/cjs/schemas.js +101 -0
  36. package/build/internal/cjs/schemas.js.map +1 -1
  37. package/build/internal/es/index.d.mts +8 -3
  38. package/build/internal/es/index.mjs +250 -2
  39. package/build/internal/es/index.mjs.map +1 -1
  40. package/build/internal/es/index.typings.d.mts +188 -2
  41. package/build/internal/es/index.typings.mjs +223 -2
  42. package/build/internal/es/index.typings.mjs.map +1 -1
  43. package/build/internal/es/meta.d.mts +3 -2
  44. package/build/internal/es/meta.mjs +51 -0
  45. package/build/internal/es/meta.mjs.map +1 -1
  46. package/build/internal/es/schemas.d.mts +52 -1
  47. package/build/internal/es/schemas.mjs +99 -0
  48. package/build/internal/es/schemas.mjs.map +1 -1
  49. package/package.json +2 -2
@@ -1,8 +1,14 @@
1
1
  // src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
2
2
  import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
3
- import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-all-nested-keys";
3
+ import { queryBuilder } from "@wix/sdk-runtime/query-builder";
4
+ import {
5
+ renameKeysFromSDKRequestToRESTRequest,
6
+ renameKeysFromRESTResponseToSDKResponse
7
+ } from "@wix/sdk-runtime/rename-all-nested-keys";
4
8
 
5
9
  // src/benefit-programs-v1-pool-definition-item-pool-definition-items.http.ts
10
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
11
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
6
12
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
7
13
  function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(opts) {
8
14
  const domainToMappings = {
@@ -28,6 +34,34 @@ function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceU
28
34
  return resolveUrl(Object.assign(opts, { domainToMappings }));
29
35
  }
30
36
  var PACKAGE_NAME = "@wix/auto_sdk_benefit-programs_pool-definition-items";
37
+ function queryPoolDefinitionItems(payload) {
38
+ function __queryPoolDefinitionItems({ host }) {
39
+ const metadata = {
40
+ entityFqdn: "wix.benefit_programs.v1.pool_definition_item",
41
+ method: "POST",
42
+ methodFqn: "wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems",
43
+ packageName: PACKAGE_NAME,
44
+ migrationOptions: {
45
+ optInTransformResponse: true
46
+ },
47
+ url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(
48
+ { protoPath: "/v1/pool-definition-items/query", data: payload, host }
49
+ ),
50
+ data: payload,
51
+ transformResponse: (payload2) => transformPaths(payload2, [
52
+ {
53
+ transformFn: transformRESTTimestampToSDKTimestamp,
54
+ paths: [
55
+ { path: "poolDefinitionItems.createdDate" },
56
+ { path: "poolDefinitionItems.updatedDate" }
57
+ ]
58
+ }
59
+ ])
60
+ };
61
+ return metadata;
62
+ }
63
+ return __queryPoolDefinitionItems;
64
+ }
31
65
  function removeItemsFromBenefit(payload) {
32
66
  function __removeItemsFromBenefit({ host }) {
33
67
  const metadata = {
@@ -75,8 +109,108 @@ function addItemsToBenefit(payload) {
75
109
  return __addItemsToBenefit;
76
110
  }
77
111
 
112
+ // src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
113
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
114
+
78
115
  // src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts
79
116
  import * as z from "zod";
117
+ var QueryPoolDefinitionItemsRequest = z.object({
118
+ query: z.intersection(
119
+ z.object({
120
+ filter: z.record(z.string(), z.any()).describe(
121
+ 'Filter object in the following format:\n`"filter" : {\n"fieldName1": "value1",\n"fieldName2":{"$operator":"value2"}\n}`\nExample of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`'
122
+ ).optional().nullable(),
123
+ sort: z.array(
124
+ z.object({
125
+ fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
126
+ order: z.enum(["ASC", "DESC"]).optional()
127
+ })
128
+ ).max(5).optional()
129
+ }),
130
+ z.xor([
131
+ z.object({ cursorPaging: z.never().optional() }),
132
+ z.object({
133
+ cursorPaging: z.object({
134
+ limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(1e3).optional().nullable(),
135
+ cursor: z.string().describe(
136
+ "Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
137
+ ).max(16e3).optional().nullable()
138
+ }).describe(
139
+ "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`."
140
+ )
141
+ })
142
+ ])
143
+ ).describe("Query to select benefit items."),
144
+ options: z.object({
145
+ fields: z.array(
146
+ z.enum(["POOL_DEFINITION", "PROGRAM_DEFINITION", "BENEFIT", "ITEM"])
147
+ ).max(4).optional()
148
+ }).optional()
149
+ });
150
+ var QueryPoolDefinitionItemsResponse = z.object({
151
+ poolDefinitionItems: z.array(
152
+ z.object({
153
+ _id: z.string().describe("Benefit item ID.").regex(
154
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
155
+ "Must be a valid GUID"
156
+ ).optional(),
157
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
158
+ "Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the item.\n\nIgnored when creating an item."
159
+ ).optional().nullable(),
160
+ _createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
161
+ _updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
162
+ externalId: z.string().describe(
163
+ "External item ID assigned by the provider of the items.\n\nFor example, if the benefit items are products, this ID corresponds to the specific product ID in the supplier's system."
164
+ ).regex(
165
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
166
+ "Must be a valid GUID"
167
+ ).optional(),
168
+ category: z.string().describe(
169
+ "Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups."
170
+ ).max(20).optional(),
171
+ providerAppId: z.string().describe(
172
+ "ID of the application providing the benefit item.\n\nID of the external application supplying the items. Each item's external ID is unique to its respective provider's application."
173
+ ).regex(
174
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
175
+ "Must be a valid GUID"
176
+ ).optional(),
177
+ namespace: z.string().describe(
178
+ "Module name of the item provider's application that originated the items.\n\nFor example, `store-inventory` or `fitness-resources`."
179
+ ).min(1).max(20).optional(),
180
+ poolDefinitionId: z.string().describe("Pool definition id").regex(
181
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
182
+ "Must be a valid GUID"
183
+ ).optional(),
184
+ itemSetId: z.string().describe("Item set ID.").regex(
185
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
186
+ "Must be a valid GUID"
187
+ ).optional(),
188
+ itemId: z.string().describe("Item set ID.").regex(
189
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
190
+ "Must be a valid GUID"
191
+ ).optional(),
192
+ benefitKey: z.string().describe(
193
+ "Unique identifier for the benefit associated with this item."
194
+ ).max(64).optional()
195
+ })
196
+ ).optional(),
197
+ metadata: z.object({
198
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
199
+ cursors: z.object({
200
+ next: z.string().describe(
201
+ "Cursor string pointing to the next page in the list of results."
202
+ ).max(16e3).optional().nullable(),
203
+ prev: z.string().describe(
204
+ "Cursor pointing to the previous page in the list of results."
205
+ ).max(16e3).optional().nullable()
206
+ }).describe(
207
+ "Cursor strings that point to the next page, previous page, or both."
208
+ ).optional(),
209
+ hasNext: z.boolean().describe(
210
+ "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."
211
+ ).optional().nullable()
212
+ }).describe("Metadata for paginated results.").optional()
213
+ });
80
214
  var RemoveItemsFromBenefitRequest = z.object({
81
215
  itemReferences: z.array(
82
216
  z.object({
@@ -117,6 +251,7 @@ var AddItemsToBenefitRequest = z.object({
117
251
  var AddItemsToBenefitResponse = z.object({});
118
252
 
119
253
  // src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
254
+ import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
120
255
  var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
121
256
  SortOrder2["ASC"] = "ASC";
122
257
  SortOrder2["DESC"] = "DESC";
@@ -137,6 +272,89 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
137
272
  WebhookIdentityType2["APP"] = "APP";
138
273
  return WebhookIdentityType2;
139
274
  })(WebhookIdentityType || {});
275
+ function queryPoolDefinitionItems2(options) {
276
+ const { httpClient, sideEffects } = arguments[1];
277
+ return queryBuilder({
278
+ func: async (payload) => {
279
+ const reqOpts = queryPoolDefinitionItems(
280
+ { ...payload, ...options ?? {} }
281
+ );
282
+ sideEffects?.onSiteCall?.();
283
+ try {
284
+ const result = await httpClient.request(reqOpts);
285
+ sideEffects?.onSuccess?.(result);
286
+ return result;
287
+ } catch (err) {
288
+ sideEffects?.onError?.(err);
289
+ throw err;
290
+ }
291
+ },
292
+ requestTransformer: (query) => {
293
+ const args = [query, options];
294
+ return renameKeysFromSDKRequestToRESTRequest({
295
+ ...args?.[1],
296
+ query: args?.[0]
297
+ });
298
+ },
299
+ responseTransformer: ({
300
+ data
301
+ }) => {
302
+ const transformedData = renameKeysFromRESTResponseToSDKResponse(
303
+ transformPaths2(data, [])
304
+ );
305
+ return {
306
+ items: transformedData?.poolDefinitionItems,
307
+ pagingMetadata: transformedData?.metadata
308
+ };
309
+ },
310
+ errorTransformer: (err) => {
311
+ const transformedError = sdkTransformError(err, {
312
+ spreadPathsToArguments: {},
313
+ explicitPathsToArguments: { query: "$[0]" },
314
+ singleArgumentUnchanged: false
315
+ });
316
+ throw transformedError;
317
+ },
318
+ pagingMethod: "CURSOR",
319
+ transformationPaths: {}
320
+ });
321
+ }
322
+ async function typedQueryPoolDefinitionItems(query, options) {
323
+ const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
324
+ if (validateRequestSchema) {
325
+ QueryPoolDefinitionItemsRequest.parse({ query, options });
326
+ }
327
+ const payload = renameKeysFromSDKRequestToRESTRequest({
328
+ query,
329
+ ...options
330
+ });
331
+ const reqOpts = queryPoolDefinitionItems(
332
+ payload
333
+ );
334
+ sideEffects?.onSiteCall?.();
335
+ try {
336
+ const result = await httpClient.request(reqOpts);
337
+ sideEffects?.onSuccess?.(result);
338
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
339
+ } catch (err) {
340
+ const transformedError = sdkTransformError(
341
+ err,
342
+ {
343
+ spreadPathsToArguments: {},
344
+ explicitPathsToArguments: { query: "$[0]" },
345
+ singleArgumentUnchanged: false
346
+ },
347
+ ["query", "options"]
348
+ );
349
+ sideEffects?.onError?.(err);
350
+ throw transformedError;
351
+ }
352
+ }
353
+ var utils = {
354
+ query: {
355
+ ...createQueryUtils()
356
+ }
357
+ };
140
358
  async function removeItemsFromBenefit2(itemReferences, options) {
141
359
  const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
142
360
  if (validateRequestSchema) {
@@ -210,6 +428,9 @@ export {
210
428
  SortOrder,
211
429
  WebhookIdentityType,
212
430
  addItemsToBenefit2 as addItemsToBenefit,
213
- removeItemsFromBenefit2 as removeItemsFromBenefit
431
+ queryPoolDefinitionItems2 as queryPoolDefinitionItems,
432
+ removeItemsFromBenefit2 as removeItemsFromBenefit,
433
+ typedQueryPoolDefinitionItems,
434
+ utils
214
435
  };
215
436
  //# sourceMappingURL=index.typings.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts","../../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.http.ts","../../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBenefitProgramsV1PoolDefinitionItem from './benefit-programs-v1-pool-definition-item-pool-definition-items.http.js';\n// @ts-ignore\nimport {\n RemoveItemsFromBenefitRequest as RemoveItemsFromBenefitRequestSchema,\n AddItemsToBenefitRequest as AddItemsToBenefitRequestSchema,\n} from './benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.js';\n\nexport interface PoolDefinitionItem {\n /**\n * Benefit item ID.\n * @format GUID\n * @readonly\n */\n _id?: string;\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 item.\n *\n * Ignored when creating an 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 * External item ID assigned by the provider of the items.\n *\n * For example, if the benefit items are products, this ID corresponds to the specific product ID in the supplier's system.\n * @format GUID\n * @immutable\n * @readonly\n */\n externalId?: string;\n /**\n * Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups.\n * @maxLength 20\n * @immutable\n * @readonly\n */\n category?: string;\n /**\n * ID of the application providing the benefit item.\n *\n * ID of the external application supplying the items. Each item's external ID is unique to its respective provider's application.\n * @format GUID\n * @immutable\n * @readonly\n */\n providerAppId?: string;\n /**\n * Module name of the item provider's application that originated the items.\n *\n * For example, `store-inventory` or `fitness-resources`.\n * @minLength 1\n * @maxLength 20\n * @immutable\n * @readonly\n */\n namespace?: string;\n /**\n * Pool definition id\n * @format GUID\n * @immutable\n * @readonly\n */\n poolDefinitionId?: string;\n /**\n * Item set ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemSetId?: string;\n /**\n * Additional data related to the benefit item.\n * @internal\n * @readonly\n */\n poolDefinition?: PoolDefinitionInfo;\n /**\n * Program definitions associated with the pool definition.\n * @internal\n * @maxSize 20\n * @readonly\n */\n programDefinitions?: ProgramDefinitionInfo[];\n /**\n * Item set ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemId?: string;\n /**\n * Benefit information\n * @internal\n * @readonly\n */\n benefitInfo?: BenefitInfo;\n /**\n * Additional item data related to the benefit item.\n * @internal\n * @readonly\n */\n itemInfo?: ItemInfo;\n /**\n * Unique identifier for the benefit associated with this item.\n * @maxLength 64\n * @immutable\n * @readonly\n */\n benefitKey?: string;\n}\n\nexport interface PoolDefinitionInfo {\n /**\n * Pool definition name.\n * @maxLength 64\n */\n displayName?: string;\n /**\n * Pool definition description.\n * @maxLength 450\n */\n description?: string | null;\n /**\n * Credit settings.\n *\n * If this object is empty, you can't set a price for the benefit.\n */\n creditConfiguration?: CreditConfiguration;\n}\n\nexport interface CreditConfiguration {\n /**\n * Initial available amount for associated balances.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n amount?: string;\n /**\n * Credit unit display name.\n * @maxLength 32\n */\n unitDisplayName?: string | null;\n /**\n * Credit unit type.\n * @internal\n * @maxLength 16\n */\n unitType?: string | null;\n}\n\nexport interface ProgramDefinitionInfo {\n /**\n * Program definition id\n * @format GUID\n */\n _id?: string;\n /**\n * Program definition external id\n * @format GUID\n */\n externalId?: string | null;\n /**\n * Program definition name\n * @maxLength 64\n */\n displayName?: string | null;\n /**\n * Program definition description.\n * @maxLength 450\n */\n description?: string | null;\n}\n\nexport interface BenefitInfo {\n /**\n * Price of the benefit in credits. The price is the same for all of this benefit's items.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n price?: string | null;\n /**\n * Benefit name.\n * @maxLength 40\n */\n displayName?: string | null;\n /**\n * Benefit description.\n * @maxLength 255\n */\n description?: string | null;\n}\n\nexport interface ItemInfo {\n /**\n * Item display name.\n * @maxLength 64\n */\n displayName?: string | null;\n}\n\nexport interface PoolDefinitionItemDeactivated {\n /** The pool definition item that was deactivated. */\n poolDefinitionItem?: PoolDefinitionItem;\n}\n\nexport interface QueryPoolDefinitionItemsRequest {\n /** Query to select benefit items. */\n query?: CursorQuery;\n /**\n * Fields to be included in the response.\n * @maxSize 4\n */\n fields?: RequestedFieldsWithLiterals[];\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 * Name of the 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 CursorPaging {\n /**\n * Maximum number of items to return in the results.\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 enum RequestedFields {\n POOL_DEFINITION = 'POOL_DEFINITION',\n PROGRAM_DEFINITION = 'PROGRAM_DEFINITION',\n BENEFIT = 'BENEFIT',\n ITEM = 'ITEM',\n}\n\n/** @enumType */\nexport type RequestedFieldsWithLiterals =\n | RequestedFields\n | 'POOL_DEFINITION'\n | 'PROGRAM_DEFINITION'\n | 'BENEFIT'\n | 'ITEM';\n\nexport interface QueryPoolDefinitionItemsResponse {\n /** List of items. */\n poolDefinitionItems?: PoolDefinitionItem[];\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 InvalidatePoolDefinitionItemsRequest {\n /**\n * The pool definition ID whose items are to be invalidated\n * @format GUID\n */\n poolDefinitionId?: string;\n /**\n * List of item set ids whose items are to be invalidated\n * @maxSize 10\n * @format GUID\n */\n itemSetIds?: string[];\n}\n\nexport interface InvalidatePoolDefinitionItemsResponse {}\n\nexport interface RemoveItemsFromBenefitRequest {\n /**\n * Items to remove from the benefit's item set.\n * @minSize 1\n * @maxSize 100\n */\n itemReferences: ItemReference[];\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n\nexport interface ItemReference {\n /**\n * External item ID assigned by the provider.\n * @format GUID\n */\n externalId?: string;\n /**\n * Item category.\n * @maxLength 20\n */\n category?: string;\n}\n\nexport interface RemoveItemsFromBenefitResponse {}\n\nexport interface AddItemsToBenefitRequest {\n /**\n * Items to add to the benefit's item set.\n * @minSize 1\n * @maxSize 100\n */\n itemReferences: ItemReference[];\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n\nexport interface AddItemsToBenefitResponse {}\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 /** Details related to the account */\n accountInfo?: AccountInfo;\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\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Removes items from a benefit's item set, resolved by pool definition ID and benefit key.\n * @param itemReferences - Items to remove from the benefit's item set.\n * @public\n * @documentationMaturity preview\n * @requiredField itemReferences\n * @requiredField itemReferences.externalId\n * @requiredField options\n * @requiredField options.benefitKey\n * @requiredField options.poolDefinitionId\n * @permissionId benefit_programs:v1:pool_definition_item:remove_items_from_benefit\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit\n */\nexport async function removeItemsFromBenefit(\n itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[],\n options: NonNullablePaths<\n RemoveItemsFromBenefitOptions,\n `benefitKey` | `poolDefinitionId`,\n 2\n >\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n RemoveItemsFromBenefitRequestSchema.parse({ itemReferences, options });\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n itemReferences: itemReferences,\n poolDefinitionId: options?.poolDefinitionId,\n benefitKey: options?.benefitKey,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1PoolDefinitionItem.removeItemsFromBenefit(\n payload\n );\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: {\n itemReferences: '$[0]',\n poolDefinitionId: '$[1].poolDefinitionId',\n benefitKey: '$[1].benefitKey',\n },\n singleArgumentUnchanged: false,\n },\n ['itemReferences', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RemoveItemsFromBenefitOptions {\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n\n/**\n * Adds items to a benefit's item set, resolved by pool definition ID and benefit key.\n * @param itemReferences - Items to add to the benefit's item set.\n * @public\n * @documentationMaturity preview\n * @requiredField itemReferences\n * @requiredField itemReferences.externalId\n * @requiredField options\n * @requiredField options.benefitKey\n * @requiredField options.poolDefinitionId\n * @permissionId benefit_programs:v1:pool_definition_item:add_items_to_benefit\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit\n */\nexport async function addItemsToBenefit(\n itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[],\n options: NonNullablePaths<\n AddItemsToBenefitOptions,\n `benefitKey` | `poolDefinitionId`,\n 2\n >\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n AddItemsToBenefitRequestSchema.parse({ itemReferences, options });\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n itemReferences: itemReferences,\n poolDefinitionId: options?.poolDefinitionId,\n benefitKey: options?.benefitKey,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1PoolDefinitionItem.addItemsToBenefit(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: {\n itemReferences: '$[0]',\n poolDefinitionId: '$[1].poolDefinitionId',\n benefitKey: '$[1].benefitKey',\n },\n singleArgumentUnchanged: false,\n },\n ['itemReferences', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface AddItemsToBenefitOptions {\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/benefit-programs/v1/pool-definition-items',\n destPath: '/v1/pool-definition-items',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/benefit-programs/v1/pool-definition-items',\n destPath: '/v1/pool-definition-items',\n },\n ],\n _: [\n {\n srcPath: '/_api/benefit-programs/v1/pool-definition-items',\n destPath: '/v1/pool-definition-items',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_benefit-programs_pool-definition-items';\n\n/** Removes items from a benefit's item set, resolved by pool definition ID and benefit key. */\nexport function removeItemsFromBenefit(\n payload: object\n): RequestOptionsFactory<any> {\n function __removeItemsFromBenefit({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.pool_definition_item',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(\n {\n protoPath: '/v1/pool-definition-items/remove-items-from-benefit',\n data: payload,\n host,\n }\n ),\n data: payload,\n };\n\n return metadata;\n }\n\n return __removeItemsFromBenefit;\n}\n\n/** Adds items to a benefit's item set, resolved by pool definition ID and benefit key. */\nexport function addItemsToBenefit(payload: object): RequestOptionsFactory<any> {\n function __addItemsToBenefit({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.pool_definition_item',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(\n {\n protoPath: '/v1/pool-definition-items/add-items-to-benefit',\n data: payload,\n host,\n }\n ),\n data: payload,\n };\n\n return metadata;\n }\n\n return __addItemsToBenefit;\n}\n","import * as z from 'zod';\n\nexport const RemoveItemsFromBenefitRequest = z.object({\n itemReferences: z\n .array(\n z.object({\n externalId: z\n .string()\n .describe('External item ID assigned by the provider.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n category: z.string().describe('Item category.').max(20).optional(),\n })\n )\n .min(1)\n .max(100),\n options: z.object({\n poolDefinitionId: z\n .string()\n .describe('ID of the pool definition associated with the benefit.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n benefitKey: z\n .string()\n .describe('Key identifying the benefit within the pool definition.')\n .max(64),\n }),\n});\nexport const RemoveItemsFromBenefitResponse = z.object({});\nexport const AddItemsToBenefitRequest = z.object({\n itemReferences: z\n .array(\n z.object({\n externalId: z\n .string()\n .describe('External item ID assigned by the provider.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n category: z.string().describe('Item category.').max(20).optional(),\n })\n )\n .min(1)\n .max(100),\n options: z.object({\n poolDefinitionId: z\n .string()\n .describe('ID of the pool definition associated with the benefit.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n benefitKey: z\n .string()\n .describe('Key identifying the benefit within the pool definition.')\n .max(64),\n }),\n});\nexport const AddItemsToBenefitResponse = z.object({});\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,0EACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,uBACd,SAC4B;AAC5B,WAAS,yBAAyB,EAAE,KAAK,GAAQ;AAC/C,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,Q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aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,gBAAgB;AAAA,UAChB,kBAAkB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,kBAAkB,SAAS;AAAA,IAC9B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AA6BA,eAAsBC,mBACpB,gBACA,SAKe;AAEf,QAAM,EAAE,YAAY,aAAa,sBAAsB,IAAI,UAAU,CAAC;AAMtE,MAAI,uBAAuB;AACzB,6BAA+B,MAAM,EAAE,gBAAgB,QAAQ,CAAC;AAAA,EAClE;AAEA,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,kBAAkB,SAAS;AAAA,IAC3B,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAC6C,kBAAkB,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,gBAAgB;AAAA,UAChB,kBAAkB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,kBAAkB,SAAS;AAAA,IAC9B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["SortOrder","RequestedFields","WebhookIdentityType","removeItemsFromBenefit","addItemsToBenefit"]}
1
+ {"version":3,"sources":["../../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts","../../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.http.ts","../../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.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 {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixBenefitProgramsV1PoolDefinitionItem from './benefit-programs-v1-pool-definition-item-pool-definition-items.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport {\n QueryPoolDefinitionItemsRequest as QueryPoolDefinitionItemsRequestSchema,\n RemoveItemsFromBenefitRequest as RemoveItemsFromBenefitRequestSchema,\n AddItemsToBenefitRequest as AddItemsToBenefitRequestSchema,\n} from './benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.js';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\nexport interface PoolDefinitionItem {\n /**\n * Benefit item ID.\n * @format GUID\n * @readonly\n */\n _id?: string;\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 item.\n *\n * Ignored when creating an 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 * External item ID assigned by the provider of the items.\n *\n * For example, if the benefit items are products, this ID corresponds to the specific product ID in the supplier's system.\n * @format GUID\n * @immutable\n * @readonly\n */\n externalId?: string;\n /**\n * Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups.\n * @maxLength 20\n * @immutable\n * @readonly\n */\n category?: string;\n /**\n * ID of the application providing the benefit item.\n *\n * ID of the external application supplying the items. Each item's external ID is unique to its respective provider's application.\n * @format GUID\n * @immutable\n * @readonly\n */\n providerAppId?: string;\n /**\n * Module name of the item provider's application that originated the items.\n *\n * For example, `store-inventory` or `fitness-resources`.\n * @minLength 1\n * @maxLength 20\n * @immutable\n * @readonly\n */\n namespace?: string;\n /**\n * Pool definition id\n * @format GUID\n * @immutable\n * @readonly\n */\n poolDefinitionId?: string;\n /**\n * Item set ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemSetId?: string;\n /**\n * Additional data related to the benefit item.\n * @internal\n * @readonly\n */\n poolDefinition?: PoolDefinitionInfo;\n /**\n * Program definitions associated with the pool definition.\n * @internal\n * @maxSize 20\n * @readonly\n */\n programDefinitions?: ProgramDefinitionInfo[];\n /**\n * Item set ID.\n * @format GUID\n * @immutable\n * @readonly\n */\n itemId?: string;\n /**\n * Benefit information\n * @internal\n * @readonly\n */\n benefitInfo?: BenefitInfo;\n /**\n * Additional item data related to the benefit item.\n * @internal\n * @readonly\n */\n itemInfo?: ItemInfo;\n /**\n * Unique identifier for the benefit associated with this item.\n * @maxLength 64\n * @immutable\n * @readonly\n */\n benefitKey?: string;\n}\n\nexport interface PoolDefinitionInfo {\n /**\n * Pool definition name.\n * @maxLength 64\n */\n displayName?: string;\n /**\n * Pool definition description.\n * @maxLength 450\n */\n description?: string | null;\n /**\n * Credit settings.\n *\n * If this object is empty, you can't set a price for the benefit.\n */\n creditConfiguration?: CreditConfiguration;\n}\n\nexport interface CreditConfiguration {\n /**\n * Initial available amount for associated balances.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n amount?: string;\n /**\n * Credit unit display name.\n * @maxLength 32\n */\n unitDisplayName?: string | null;\n /**\n * Credit unit type.\n * @internal\n * @maxLength 16\n */\n unitType?: string | null;\n}\n\nexport interface ProgramDefinitionInfo {\n /**\n * Program definition id\n * @format GUID\n */\n _id?: string;\n /**\n * Program definition external id\n * @format GUID\n */\n externalId?: string | null;\n /**\n * Program definition name\n * @maxLength 64\n */\n displayName?: string | null;\n /**\n * Program definition description.\n * @maxLength 450\n */\n description?: string | null;\n}\n\nexport interface BenefitInfo {\n /**\n * Price of the benefit in credits. The price is the same for all of this benefit's items.\n * @decimalValue options { gte:0, maxScale:4 }\n */\n price?: string | null;\n /**\n * Benefit name.\n * @maxLength 40\n */\n displayName?: string | null;\n /**\n * Benefit description.\n * @maxLength 255\n */\n description?: string | null;\n}\n\nexport interface ItemInfo {\n /**\n * Item display name.\n * @maxLength 64\n */\n displayName?: string | null;\n}\n\nexport interface PoolDefinitionItemDeactivated {\n /** The pool definition item that was deactivated. */\n poolDefinitionItem?: PoolDefinitionItem;\n}\n\nexport interface QueryPoolDefinitionItemsRequest {\n /** Query to select benefit items. */\n query?: CursorQuery;\n /**\n * Fields to be included in the response.\n * @maxSize 4\n */\n fields?: RequestedFieldsWithLiterals[];\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 * Name of the 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 CursorPaging {\n /**\n * Maximum number of items to return in the results.\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 enum RequestedFields {\n POOL_DEFINITION = 'POOL_DEFINITION',\n PROGRAM_DEFINITION = 'PROGRAM_DEFINITION',\n BENEFIT = 'BENEFIT',\n ITEM = 'ITEM',\n}\n\n/** @enumType */\nexport type RequestedFieldsWithLiterals =\n | RequestedFields\n | 'POOL_DEFINITION'\n | 'PROGRAM_DEFINITION'\n | 'BENEFIT'\n | 'ITEM';\n\nexport interface QueryPoolDefinitionItemsResponse {\n /** List of items. */\n poolDefinitionItems?: PoolDefinitionItem[];\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 InvalidatePoolDefinitionItemsRequest {\n /**\n * The pool definition ID whose items are to be invalidated\n * @format GUID\n */\n poolDefinitionId?: string;\n /**\n * List of item set ids whose items are to be invalidated\n * @maxSize 10\n * @format GUID\n */\n itemSetIds?: string[];\n}\n\nexport interface InvalidatePoolDefinitionItemsResponse {}\n\nexport interface RemoveItemsFromBenefitRequest {\n /**\n * Items to remove from the benefit's item set.\n * @minSize 1\n * @maxSize 100\n */\n itemReferences: ItemReference[];\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n\nexport interface ItemReference {\n /**\n * External item ID assigned by the provider.\n * @format GUID\n */\n externalId?: string;\n /**\n * Item category.\n * @maxLength 20\n */\n category?: string;\n}\n\nexport interface RemoveItemsFromBenefitResponse {}\n\nexport interface AddItemsToBenefitRequest {\n /**\n * Items to add to the benefit's item set.\n * @minSize 1\n * @maxSize 100\n */\n itemReferences: ItemReference[];\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n\nexport interface AddItemsToBenefitResponse {}\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 /** Details related to the account */\n accountInfo?: AccountInfo;\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\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Creates a query to retrieve a list of poolDefinitionItems.\n *\n * The `queryPoolDefinitionItems()` method builds a query to retrieve a list of poolDefinitionItems and returns a `PoolDefinitionItemsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the [`find()`](/poolDefinitionItems/poolDefinitionItems-query-builder/find) function.\n *\n * You can refine the query by chaining `PoolDefinitionItemsQueryBuilder` methods onto the query. `PoolDefinitionItemsQueryBuilder` methods enable you to filter, sort, and control the results that `queryPoolDefinitionItems()` returns.\n *\n * The following `PoolDefinitionItemsQueryBuilder` functions are supported for `queryPoolDefinitionItems()`. For a full description of the item object, see the object returned for the [`poolDefinitionItems`](/poolDefinitionItems/poolDefinitionItems-query-result/poolDefinitionItems) property in `PoolDefinitionItemsQueryResult`.\n * @public\n * @documentationMaturity preview\n * @permissionId benefit_programs:v1:pool_definition_item:query_pool_definition_items\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems\n */\nexport function queryPoolDefinitionItems(\n options?: QueryPoolDefinitionItemsOptions\n): PoolDefinitionItemsQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<\n PoolDefinitionItem,\n 'CURSOR',\n QueryPoolDefinitionItemsRequest,\n QueryPoolDefinitionItemsResponse\n >({\n func: async (payload: QueryPoolDefinitionItemsRequest) => {\n const reqOpts =\n ambassadorWixBenefitProgramsV1PoolDefinitionItem.queryPoolDefinitionItems(\n { ...payload, ...(options ?? {}) }\n );\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: QueryPoolDefinitionItemsRequest['query']) => {\n const args = [query, options] as [\n QueryPoolDefinitionItemsRequest['query'],\n QueryPoolDefinitionItemsOptions\n ];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({\n data,\n }: HttpResponse<QueryPoolDefinitionItemsResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.poolDefinitionItems,\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\nexport interface QueryPoolDefinitionItemsOptions {\n /**\n * Fields to be included in the response.\n * @maxSize 4\n */\n fields?: RequestedFieldsWithLiterals[] | undefined;\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface PoolDefinitionItemsQueryResult extends QueryCursorResult {\n items: PoolDefinitionItem[];\n query: PoolDefinitionItemsQueryBuilder;\n next: () => Promise<PoolDefinitionItemsQueryResult>;\n prev: () => Promise<PoolDefinitionItemsQueryResult>;\n}\n\nexport interface PoolDefinitionItemsQueryBuilder {\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: string\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any[]\n ) => PoolDefinitionItemsQueryBuilder;\n /** @documentationMaturity preview */\n in: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: any\n ) => PoolDefinitionItemsQueryBuilder;\n /** @documentationMaturity preview */\n exists: (\n propertyName:\n | '_id'\n | '_createdDate'\n | 'externalId'\n | 'category'\n | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey',\n value: boolean\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey'\n >\n ) => PoolDefinitionItemsQueryBuilder;\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 | 'providerAppId'\n | 'namespace'\n | 'poolDefinitionId'\n | 'itemSetId'\n | 'programDefinitions.id'\n | 'programDefinitions.externalId'\n | 'benefitKey'\n >\n ) => PoolDefinitionItemsQueryBuilder;\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) => PoolDefinitionItemsQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => PoolDefinitionItemsQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<PoolDefinitionItemsQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems\n * @requiredField query\n */\nexport async function typedQueryPoolDefinitionItems(\n query: PoolDefinitionItemQuery,\n options?: QueryPoolDefinitionItemsOptions\n): Promise<\n NonNullablePaths<\n QueryPoolDefinitionItemsResponse,\n | `poolDefinitionItems`\n | `poolDefinitionItems.${number}._id`\n | `poolDefinitionItems.${number}.externalId`\n | `poolDefinitionItems.${number}.category`\n | `poolDefinitionItems.${number}.providerAppId`\n | `poolDefinitionItems.${number}.namespace`\n | `poolDefinitionItems.${number}.poolDefinitionId`\n | `poolDefinitionItems.${number}.itemSetId`\n | `poolDefinitionItems.${number}.itemId`\n | `poolDefinitionItems.${number}.benefitKey`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n QueryPoolDefinitionItemsRequestSchema.parse({ query, options });\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: query,\n ...options,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1PoolDefinitionItem.queryPoolDefinitionItems(\n payload\n );\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: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface PoolDefinitionItemQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['programDefinitions._id', 'programDefinitions.externalId'];\n operators: ['$hasAll', '$hasSome'];\n sort: 'BOTH';\n },\n {\n fields: [\n '_createdDate',\n '_id',\n 'benefitKey',\n 'category',\n 'externalId',\n 'itemSetId',\n 'namespace',\n 'poolDefinitionId',\n 'providerAppId'\n ];\n operators: '*';\n sort: 'BOTH';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<\n PoolDefinitionItem,\n PoolDefinitionItemQuerySpec\n>;\nexport type PoolDefinitionItemQuery = {\n /** \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 */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 1000 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | 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?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\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?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object in the following format:\n `[{\"fieldName\":\"sortField1\",\"order\":\"ASC\"},{\"fieldName\":\"sortField2\",\"order\":\"DESC\"}]` \n @maxSize: 5 \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n }[];\n};\n\nexport const utils = {\n query: {\n ...createQueryUtils<\n PoolDefinitionItem,\n PoolDefinitionItemQuerySpec,\n PoolDefinitionItemQuery\n >(),\n },\n};\n\n/**\n * Removes items from a benefit's item set, resolved by pool definition ID and benefit key.\n * @param itemReferences - Items to remove from the benefit's item set.\n * @public\n * @documentationMaturity preview\n * @requiredField itemReferences\n * @requiredField itemReferences.externalId\n * @requiredField options\n * @requiredField options.benefitKey\n * @requiredField options.poolDefinitionId\n * @permissionId benefit_programs:v1:pool_definition_item:remove_items_from_benefit\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit\n */\nexport async function removeItemsFromBenefit(\n itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[],\n options: NonNullablePaths<\n RemoveItemsFromBenefitOptions,\n `benefitKey` | `poolDefinitionId`,\n 2\n >\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n RemoveItemsFromBenefitRequestSchema.parse({ itemReferences, options });\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n itemReferences: itemReferences,\n poolDefinitionId: options?.poolDefinitionId,\n benefitKey: options?.benefitKey,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1PoolDefinitionItem.removeItemsFromBenefit(\n payload\n );\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: {\n itemReferences: '$[0]',\n poolDefinitionId: '$[1].poolDefinitionId',\n benefitKey: '$[1].benefitKey',\n },\n singleArgumentUnchanged: false,\n },\n ['itemReferences', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RemoveItemsFromBenefitOptions {\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n\n/**\n * Adds items to a benefit's item set, resolved by pool definition ID and benefit key.\n * @param itemReferences - Items to add to the benefit's item set.\n * @public\n * @documentationMaturity preview\n * @requiredField itemReferences\n * @requiredField itemReferences.externalId\n * @requiredField options\n * @requiredField options.benefitKey\n * @requiredField options.poolDefinitionId\n * @permissionId benefit_programs:v1:pool_definition_item:add_items_to_benefit\n * @applicableIdentity APP\n * @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit\n */\nexport async function addItemsToBenefit(\n itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[],\n options: NonNullablePaths<\n AddItemsToBenefitOptions,\n `benefitKey` | `poolDefinitionId`,\n 2\n >\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects, validateRequestSchema } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n validateRequestSchema?: boolean;\n };\n\n if (validateRequestSchema) {\n AddItemsToBenefitRequestSchema.parse({ itemReferences, options });\n }\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n itemReferences: itemReferences,\n poolDefinitionId: options?.poolDefinitionId,\n benefitKey: options?.benefitKey,\n });\n\n const reqOpts =\n ambassadorWixBenefitProgramsV1PoolDefinitionItem.addItemsToBenefit(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: {\n itemReferences: '$[0]',\n poolDefinitionId: '$[1].poolDefinitionId',\n benefitKey: '$[1].benefitKey',\n },\n singleArgumentUnchanged: false,\n },\n ['itemReferences', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface AddItemsToBenefitOptions {\n /**\n * ID of the pool definition associated with the benefit.\n * @format GUID\n */\n poolDefinitionId: string;\n /**\n * Key identifying the benefit within the pool definition.\n * @maxLength 64\n */\n benefitKey: string;\n}\n","import { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www.wixapis.com': [\n {\n srcPath: '/benefit-programs/v1/pool-definition-items',\n destPath: '/v1/pool-definition-items',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/benefit-programs/v1/pool-definition-items',\n destPath: '/v1/pool-definition-items',\n },\n ],\n _: [\n {\n srcPath: '/_api/benefit-programs/v1/pool-definition-items',\n destPath: '/v1/pool-definition-items',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_benefit-programs_pool-definition-items';\n\n/**\n * Creates a query to retrieve a list of poolDefinitionItems.\n *\n * The `queryPoolDefinitionItems()` method builds a query to retrieve a list of poolDefinitionItems and returns a `PoolDefinitionItemsQueryBuilder` object.\n *\n * The returned object contains the query definition, which is used to run the query using the [`find()`](/poolDefinitionItems/poolDefinitionItems-query-builder/find) function.\n *\n * You can refine the query by chaining `PoolDefinitionItemsQueryBuilder` methods onto the query. `PoolDefinitionItemsQueryBuilder` methods enable you to filter, sort, and control the results that `queryPoolDefinitionItems()` returns.\n *\n * The following `PoolDefinitionItemsQueryBuilder` functions are supported for `queryPoolDefinitionItems()`. For a full description of the item object, see the object returned for the [`poolDefinitionItems`](/poolDefinitionItems/poolDefinitionItems-query-result/poolDefinitionItems) property in `PoolDefinitionItemsQueryResult`.\n */\nexport function queryPoolDefinitionItems(\n payload: object\n): RequestOptionsFactory<any> {\n function __queryPoolDefinitionItems({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.pool_definition_item',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(\n { protoPath: '/v1/pool-definition-items/query', data: payload, host }\n ),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'poolDefinitionItems.createdDate' },\n { path: 'poolDefinitionItems.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryPoolDefinitionItems;\n}\n\n/** Removes items from a benefit's item set, resolved by pool definition ID and benefit key. */\nexport function removeItemsFromBenefit(\n payload: object\n): RequestOptionsFactory<any> {\n function __removeItemsFromBenefit({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.pool_definition_item',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(\n {\n protoPath: '/v1/pool-definition-items/remove-items-from-benefit',\n data: payload,\n host,\n }\n ),\n data: payload,\n };\n\n return metadata;\n }\n\n return __removeItemsFromBenefit;\n}\n\n/** Adds items to a benefit's item set, resolved by pool definition ID and benefit key. */\nexport function addItemsToBenefit(payload: object): RequestOptionsFactory<any> {\n function __addItemsToBenefit({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.benefit_programs.v1.pool_definition_item',\n method: 'POST' as any,\n methodFqn:\n 'wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(\n {\n protoPath: '/v1/pool-definition-items/add-items-to-benefit',\n data: payload,\n host,\n }\n ),\n data: payload,\n };\n\n return metadata;\n }\n\n return __addItemsToBenefit;\n}\n","import * as z from 'zod';\n\nexport const QueryPoolDefinitionItemsRequest = z.object({\n query: z\n .intersection(\n z.object({\n filter: z\n .record(z.string(), z.any())\n .describe(\n 'Filter object in the following format:\\n`\"filter\" : {\\n\"fieldName1\": \"value1\",\\n\"fieldName2\":{\"$operator\":\"value2\"}\\n}`\\nExample of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`'\n )\n .optional()\n .nullable(),\n sort: z\n .array(\n z.object({\n fieldName: z\n .string()\n .describe('Name of the field to sort by.')\n .max(512)\n .optional(),\n order: z.enum(['ASC', 'DESC']).optional(),\n })\n )\n .max(5)\n .optional(),\n }),\n z.xor([\n z.object({ cursorPaging: z.never().optional() }),\n z.object({\n cursorPaging: z\n .object({\n limit: z\n .number()\n .int()\n .describe('Maximum number of items to return in the results.')\n .min(0)\n .max(1000)\n .optional()\n .nullable(),\n cursor: z\n .string()\n .describe(\n \"Pointer to the next or previous page in the list of results.\\n\\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\\nNot relevant for the first request.\"\n )\n .max(16000)\n .optional()\n .nullable(),\n })\n .describe(\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 ),\n }),\n ])\n )\n .describe('Query to select benefit items.'),\n options: z\n .object({\n fields: z\n .array(\n z.enum(['POOL_DEFINITION', 'PROGRAM_DEFINITION', 'BENEFIT', 'ITEM'])\n )\n .max(4)\n .optional(),\n })\n .optional(),\n});\nexport const QueryPoolDefinitionItemsResponse = z.object({\n poolDefinitionItems: z\n .array(\n z.object({\n _id: z\n .string()\n .describe('Benefit item ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n revision: z\n .string()\n .regex(/^-?\\d+$/, 'Must be a valid Int64 string')\n .describe(\n 'Revision number, which increments by 1 each time the benefit item is updated.\\nTo prevent conflicting changes, the current revision must be passed when updating the item.\\n\\nIgnored when creating an item.'\n )\n .optional()\n .nullable(),\n _createdDate: z\n .date()\n .describe('Date and time the item was created.')\n .optional()\n .nullable(),\n _updatedDate: z\n .date()\n .describe('Date and time the item was updated.')\n .optional()\n .nullable(),\n externalId: z\n .string()\n .describe(\n \"External item ID assigned by the provider of the items.\\n\\nFor example, if the benefit items are products, this ID corresponds to the specific product ID in the supplier's system.\"\n )\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n category: z\n .string()\n .describe(\n 'Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups.'\n )\n .max(20)\n .optional(),\n providerAppId: z\n .string()\n .describe(\n \"ID of the application providing the benefit item.\\n\\nID of the external application supplying the items. Each item's external ID is unique to its respective provider's application.\"\n )\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n namespace: z\n .string()\n .describe(\n \"Module name of the item provider's application that originated the items.\\n\\nFor example, `store-inventory` or `fitness-resources`.\"\n )\n .min(1)\n .max(20)\n .optional(),\n poolDefinitionId: z\n .string()\n .describe('Pool definition id')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n itemSetId: z\n .string()\n .describe('Item set ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n itemId: z\n .string()\n .describe('Item set ID.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n )\n .optional(),\n benefitKey: z\n .string()\n .describe(\n 'Unique identifier for the benefit associated with this item.'\n )\n .max(64)\n .optional(),\n })\n )\n .optional(),\n metadata: z\n .object({\n count: z\n .number()\n .int()\n .describe('Number of items returned in the response.')\n .optional()\n .nullable(),\n cursors: z\n .object({\n next: z\n .string()\n .describe(\n 'Cursor string pointing to the next page in the list of results.'\n )\n .max(16000)\n .optional()\n .nullable(),\n prev: z\n .string()\n .describe(\n 'Cursor pointing to the previous page in the list of results.'\n )\n .max(16000)\n .optional()\n .nullable(),\n })\n .describe(\n 'Cursor strings that point to the next page, previous page, or both.'\n )\n .optional(),\n hasNext: z\n .boolean()\n .describe(\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 .optional()\n .nullable(),\n })\n .describe('Metadata for paginated results.')\n .optional(),\n});\nexport const RemoveItemsFromBenefitRequest = z.object({\n itemReferences: z\n .array(\n z.object({\n externalId: z\n .string()\n .describe('External item ID assigned by the provider.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n category: z.string().describe('Item category.').max(20).optional(),\n })\n )\n .min(1)\n .max(100),\n options: z.object({\n poolDefinitionId: z\n .string()\n .describe('ID of the pool definition associated with the benefit.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n benefitKey: z\n .string()\n .describe('Key identifying the benefit within the pool definition.')\n .max(64),\n }),\n});\nexport const RemoveItemsFromBenefitResponse = z.object({});\nexport const AddItemsToBenefitRequest = z.object({\n itemReferences: z\n .array(\n z.object({\n externalId: z\n .string()\n .describe('External item ID assigned by the provider.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n category: z.string().describe('Item category.').max(20).optional(),\n })\n )\n .min(1)\n .max(100),\n options: z.object({\n poolDefinitionId: z\n .string()\n .describe('ID of the pool definition associated with the benefit.')\n .regex(\n /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n 'Must be a valid GUID'\n ),\n benefitKey: z\n .string()\n .describe('Key identifying the benefit within the pool definition.')\n .max(64),\n }),\n});\nexport const AddItemsToBenefitResponse = z.object({});\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,oBAAoB;AAC7B;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACLP,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,0EACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAad,SAAS,yBACd,SAC4B;AAC5B,WAAS,2BAA2B,EAAE,KAAK,GAAQ;AACjD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAA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,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,gBAAgB;AAAA,UAChB,kBAAkB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,kBAAkB,SAAS;AAAA,IAC9B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AA6BA,eAAsBC,mBACpB,gBACA,SAKe;AAEf,QAAM,EAAE,YAAY,aAAa,sBAAsB,IAAI,UAAU,CAAC;AAMtE,MAAI,uBAAuB;AACzB,6BAA+B,MAAM,EAAE,gBAAgB,QAAQ,CAAC;AAAA,EAClE;AAEA,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA,kBAAkB,SAAS;AAAA,IAC3B,YAAY,SAAS;AAAA,EACvB,CAAC;AAED,QAAM,UAC6C,kBAAkB,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,gBAAgB;AAAA,UAChB,kBAAkB;AAAA,UAClB,YAAY;AAAA,QACd;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,kBAAkB,SAAS;AAAA,IAC9B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","transformPaths","SortOrder","RequestedFields","WebhookIdentityType","queryPoolDefinitionItems","transformPaths","removeItemsFromBenefit","addItemsToBenefit"]}
@@ -1,4 +1,4 @@
1
- import { RemoveItemsFromBenefitRequest as RemoveItemsFromBenefitRequest$1, RemoveItemsFromBenefitResponse as RemoveItemsFromBenefitResponse$1, AddItemsToBenefitRequest as AddItemsToBenefitRequest$1, AddItemsToBenefitResponse as AddItemsToBenefitResponse$1 } from './index.typings.mjs';
1
+ import { QueryPoolDefinitionItemsRequest as QueryPoolDefinitionItemsRequest$1, QueryPoolDefinitionItemsResponse as QueryPoolDefinitionItemsResponse$1, RemoveItemsFromBenefitRequest as RemoveItemsFromBenefitRequest$1, RemoveItemsFromBenefitResponse as RemoveItemsFromBenefitResponse$1, AddItemsToBenefitRequest as AddItemsToBenefitRequest$1, AddItemsToBenefitResponse as AddItemsToBenefitResponse$1 } from './index.typings.mjs';
2
2
  import '@wix/sdk-types';
3
3
 
4
4
  interface PoolDefinitionItem {
@@ -505,7 +505,8 @@ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q
505
505
  __responseType: Q;
506
506
  __originalResponseType: R;
507
507
  };
508
+ declare function queryPoolDefinitionItems(): __PublicMethodMetaInfo<'POST', {}, QueryPoolDefinitionItemsRequest$1, QueryPoolDefinitionItemsRequest, QueryPoolDefinitionItemsResponse$1, QueryPoolDefinitionItemsResponse>;
508
509
  declare function removeItemsFromBenefit(): __PublicMethodMetaInfo<'POST', {}, RemoveItemsFromBenefitRequest$1, RemoveItemsFromBenefitRequest, RemoveItemsFromBenefitResponse$1, RemoveItemsFromBenefitResponse>;
509
510
  declare function addItemsToBenefit(): __PublicMethodMetaInfo<'POST', {}, AddItemsToBenefitRequest$1, AddItemsToBenefitRequest, AddItemsToBenefitResponse$1, AddItemsToBenefitResponse>;
510
511
 
511
- export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type AddItemsToBenefitRequest as AddItemsToBenefitRequestOriginal, type AddItemsToBenefitResponse as AddItemsToBenefitResponseOriginal, type BenefitInfo as BenefitInfoOriginal, type CreditConfiguration as CreditConfigurationOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type CursorQuery as CursorQueryOriginal, type CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal, type Cursors as CursorsOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type InvalidatePoolDefinitionItemsRequest as InvalidatePoolDefinitionItemsRequestOriginal, type InvalidatePoolDefinitionItemsResponse as InvalidatePoolDefinitionItemsResponseOriginal, type ItemInfo as ItemInfoOriginal, type ItemReference as ItemReferenceOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type PoolDefinitionInfo as PoolDefinitionInfoOriginal, type PoolDefinitionItemDeactivated as PoolDefinitionItemDeactivatedOriginal, type PoolDefinitionItem as PoolDefinitionItemOriginal, type ProgramDefinitionInfo as ProgramDefinitionInfoOriginal, type QueryPoolDefinitionItemsRequest as QueryPoolDefinitionItemsRequestOriginal, type QueryPoolDefinitionItemsResponse as QueryPoolDefinitionItemsResponseOriginal, type RemoveItemsFromBenefitRequest as RemoveItemsFromBenefitRequestOriginal, type RemoveItemsFromBenefitResponse as RemoveItemsFromBenefitResponseOriginal, RequestedFields as RequestedFieldsOriginal, type RequestedFieldsWithLiterals as RequestedFieldsWithLiteralsOriginal, type RestoreInfo as RestoreInfoOriginal, SortOrder as SortOrderOriginal, type SortOrderWithLiterals as SortOrderWithLiteralsOriginal, type Sorting as SortingOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, addItemsToBenefit, removeItemsFromBenefit };
512
+ export { type AccountInfo as AccountInfoOriginal, type ActionEvent as ActionEventOriginal, type AddItemsToBenefitRequest as AddItemsToBenefitRequestOriginal, type AddItemsToBenefitResponse as AddItemsToBenefitResponseOriginal, type BenefitInfo as BenefitInfoOriginal, type CreditConfiguration as CreditConfigurationOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type CursorQuery as CursorQueryOriginal, type CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOfOriginal, type Cursors as CursorsOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type InvalidatePoolDefinitionItemsRequest as InvalidatePoolDefinitionItemsRequestOriginal, type InvalidatePoolDefinitionItemsResponse as InvalidatePoolDefinitionItemsResponseOriginal, type ItemInfo as ItemInfoOriginal, type ItemReference as ItemReferenceOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type PoolDefinitionInfo as PoolDefinitionInfoOriginal, type PoolDefinitionItemDeactivated as PoolDefinitionItemDeactivatedOriginal, type PoolDefinitionItem as PoolDefinitionItemOriginal, type ProgramDefinitionInfo as ProgramDefinitionInfoOriginal, type QueryPoolDefinitionItemsRequest as QueryPoolDefinitionItemsRequestOriginal, type QueryPoolDefinitionItemsResponse as QueryPoolDefinitionItemsResponseOriginal, type RemoveItemsFromBenefitRequest as RemoveItemsFromBenefitRequestOriginal, type RemoveItemsFromBenefitResponse as RemoveItemsFromBenefitResponseOriginal, RequestedFields as RequestedFieldsOriginal, type RequestedFieldsWithLiterals as RequestedFieldsWithLiteralsOriginal, type RestoreInfo as RestoreInfoOriginal, SortOrder as SortOrderOriginal, type SortOrderWithLiterals as SortOrderWithLiteralsOriginal, type Sorting as SortingOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, addItemsToBenefit, queryPoolDefinitionItems, removeItemsFromBenefit };
@@ -1,4 +1,6 @@
1
1
  // src/benefit-programs-v1-pool-definition-item-pool-definition-items.http.ts
2
+ import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
3
+ import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
2
4
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
3
5
  function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(opts) {
4
6
  const domainToMappings = {
@@ -24,6 +26,34 @@ function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceU
24
26
  return resolveUrl(Object.assign(opts, { domainToMappings }));
25
27
  }
26
28
  var PACKAGE_NAME = "@wix/auto_sdk_benefit-programs_pool-definition-items";
29
+ function queryPoolDefinitionItems(payload) {
30
+ function __queryPoolDefinitionItems({ host }) {
31
+ const metadata = {
32
+ entityFqdn: "wix.benefit_programs.v1.pool_definition_item",
33
+ method: "POST",
34
+ methodFqn: "wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems",
35
+ packageName: PACKAGE_NAME,
36
+ migrationOptions: {
37
+ optInTransformResponse: true
38
+ },
39
+ url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(
40
+ { protoPath: "/v1/pool-definition-items/query", data: payload, host }
41
+ ),
42
+ data: payload,
43
+ transformResponse: (payload2) => transformPaths(payload2, [
44
+ {
45
+ transformFn: transformRESTTimestampToSDKTimestamp,
46
+ paths: [
47
+ { path: "poolDefinitionItems.createdDate" },
48
+ { path: "poolDefinitionItems.updatedDate" }
49
+ ]
50
+ }
51
+ ])
52
+ };
53
+ return metadata;
54
+ }
55
+ return __queryPoolDefinitionItems;
56
+ }
27
57
  function removeItemsFromBenefit(payload) {
28
58
  function __removeItemsFromBenefit({ host }) {
29
59
  const metadata = {
@@ -94,6 +124,26 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
94
124
  })(WebhookIdentityType || {});
95
125
 
96
126
  // src/benefit-programs-v1-pool-definition-item-pool-definition-items.meta.ts
127
+ function queryPoolDefinitionItems2() {
128
+ const payload = {};
129
+ const getRequestOptions = queryPoolDefinitionItems(
130
+ payload
131
+ );
132
+ const getUrl = (context) => {
133
+ const { url } = getRequestOptions(context);
134
+ return url;
135
+ };
136
+ return {
137
+ getUrl,
138
+ httpMethod: "POST",
139
+ path: "/v1/pool-definition-items/query",
140
+ pathParams: {},
141
+ __requestType: null,
142
+ __originalRequestType: null,
143
+ __responseType: null,
144
+ __originalResponseType: null
145
+ };
146
+ }
97
147
  function removeItemsFromBenefit2() {
98
148
  const payload = {};
99
149
  const getRequestOptions = removeItemsFromBenefit(
@@ -137,6 +187,7 @@ export {
137
187
  SortOrder as SortOrderOriginal,
138
188
  WebhookIdentityType as WebhookIdentityTypeOriginal,
139
189
  addItemsToBenefit2 as addItemsToBenefit,
190
+ queryPoolDefinitionItems2 as queryPoolDefinitionItems,
140
191
  removeItemsFromBenefit2 as removeItemsFromBenefit
141
192
  };
142
193
  //# sourceMappingURL=meta.mjs.map