@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.
- package/build/cjs/index.d.ts +8 -3
- package/build/cjs/index.js +249 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +188 -2
- package/build/cjs/index.typings.js +223 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +3 -2
- package/build/cjs/meta.js +52 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +52 -1
- package/build/cjs/schemas.js +101 -0
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +8 -3
- package/build/es/index.mjs +250 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +188 -2
- package/build/es/index.typings.mjs +223 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +3 -2
- package/build/es/meta.mjs +51 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +52 -1
- package/build/es/schemas.mjs +99 -0
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +8 -3
- package/build/internal/cjs/index.js +249 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +188 -2
- package/build/internal/cjs/index.typings.js +223 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +3 -2
- package/build/internal/cjs/meta.js +52 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +52 -1
- package/build/internal/cjs/schemas.js +101 -0
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +8 -3
- package/build/internal/es/index.mjs +250 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +188 -2
- package/build/internal/es/index.typings.mjs +223 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +3 -2
- package/build/internal/es/meta.mjs +51 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +52 -1
- package/build/internal/es/schemas.mjs +99 -0
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/schemas.js
CHANGED
|
@@ -32,6 +32,8 @@ var schemas_exports = {};
|
|
|
32
32
|
__export(schemas_exports, {
|
|
33
33
|
AddItemsToBenefitRequest: () => AddItemsToBenefitRequest,
|
|
34
34
|
AddItemsToBenefitResponse: () => AddItemsToBenefitResponse,
|
|
35
|
+
QueryPoolDefinitionItemsRequest: () => QueryPoolDefinitionItemsRequest,
|
|
36
|
+
QueryPoolDefinitionItemsResponse: () => QueryPoolDefinitionItemsResponse,
|
|
35
37
|
RemoveItemsFromBenefitRequest: () => RemoveItemsFromBenefitRequest,
|
|
36
38
|
RemoveItemsFromBenefitResponse: () => RemoveItemsFromBenefitResponse
|
|
37
39
|
});
|
|
@@ -39,6 +41,103 @@ module.exports = __toCommonJS(schemas_exports);
|
|
|
39
41
|
|
|
40
42
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts
|
|
41
43
|
var z = __toESM(require("zod"));
|
|
44
|
+
var QueryPoolDefinitionItemsRequest = z.object({
|
|
45
|
+
query: z.intersection(
|
|
46
|
+
z.object({
|
|
47
|
+
filter: z.record(z.string(), z.any()).describe(
|
|
48
|
+
'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`'
|
|
49
|
+
).optional().nullable(),
|
|
50
|
+
sort: z.array(
|
|
51
|
+
z.object({
|
|
52
|
+
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
53
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
54
|
+
})
|
|
55
|
+
).max(5).optional()
|
|
56
|
+
}),
|
|
57
|
+
z.xor([
|
|
58
|
+
z.object({ cursorPaging: z.never().optional() }),
|
|
59
|
+
z.object({
|
|
60
|
+
cursorPaging: z.object({
|
|
61
|
+
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(1e3).optional().nullable(),
|
|
62
|
+
cursor: z.string().describe(
|
|
63
|
+
"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."
|
|
64
|
+
).max(16e3).optional().nullable()
|
|
65
|
+
}).describe(
|
|
66
|
+
"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`."
|
|
67
|
+
)
|
|
68
|
+
})
|
|
69
|
+
])
|
|
70
|
+
).describe("Query to select benefit items."),
|
|
71
|
+
options: z.object({
|
|
72
|
+
fields: z.array(
|
|
73
|
+
z.enum(["POOL_DEFINITION", "PROGRAM_DEFINITION", "BENEFIT", "ITEM"])
|
|
74
|
+
).max(4).optional()
|
|
75
|
+
}).optional()
|
|
76
|
+
});
|
|
77
|
+
var QueryPoolDefinitionItemsResponse = z.object({
|
|
78
|
+
poolDefinitionItems: z.array(
|
|
79
|
+
z.object({
|
|
80
|
+
_id: z.string().describe("Benefit item ID.").regex(
|
|
81
|
+
/^[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}$/,
|
|
82
|
+
"Must be a valid GUID"
|
|
83
|
+
).optional(),
|
|
84
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
85
|
+
"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."
|
|
86
|
+
).optional().nullable(),
|
|
87
|
+
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
88
|
+
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
89
|
+
externalId: z.string().describe(
|
|
90
|
+
"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."
|
|
91
|
+
).regex(
|
|
92
|
+
/^[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}$/,
|
|
93
|
+
"Must be a valid GUID"
|
|
94
|
+
).optional(),
|
|
95
|
+
category: z.string().describe(
|
|
96
|
+
"Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups."
|
|
97
|
+
).max(20).optional(),
|
|
98
|
+
providerAppId: z.string().describe(
|
|
99
|
+
"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."
|
|
100
|
+
).regex(
|
|
101
|
+
/^[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}$/,
|
|
102
|
+
"Must be a valid GUID"
|
|
103
|
+
).optional(),
|
|
104
|
+
namespace: z.string().describe(
|
|
105
|
+
"Module name of the item provider's application that originated the items.\n\nFor example, `store-inventory` or `fitness-resources`."
|
|
106
|
+
).min(1).max(20).optional(),
|
|
107
|
+
poolDefinitionId: z.string().describe("Pool definition id").regex(
|
|
108
|
+
/^[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}$/,
|
|
109
|
+
"Must be a valid GUID"
|
|
110
|
+
).optional(),
|
|
111
|
+
itemSetId: z.string().describe("Item set ID.").regex(
|
|
112
|
+
/^[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}$/,
|
|
113
|
+
"Must be a valid GUID"
|
|
114
|
+
).optional(),
|
|
115
|
+
itemId: z.string().describe("Item set ID.").regex(
|
|
116
|
+
/^[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}$/,
|
|
117
|
+
"Must be a valid GUID"
|
|
118
|
+
).optional(),
|
|
119
|
+
benefitKey: z.string().describe(
|
|
120
|
+
"Unique identifier for the benefit associated with this item."
|
|
121
|
+
).max(64).optional()
|
|
122
|
+
})
|
|
123
|
+
).optional(),
|
|
124
|
+
metadata: z.object({
|
|
125
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
126
|
+
cursors: z.object({
|
|
127
|
+
next: z.string().describe(
|
|
128
|
+
"Cursor string pointing to the next page in the list of results."
|
|
129
|
+
).max(16e3).optional().nullable(),
|
|
130
|
+
prev: z.string().describe(
|
|
131
|
+
"Cursor pointing to the previous page in the list of results."
|
|
132
|
+
).max(16e3).optional().nullable()
|
|
133
|
+
}).describe(
|
|
134
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
135
|
+
).optional(),
|
|
136
|
+
hasNext: z.boolean().describe(
|
|
137
|
+
"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."
|
|
138
|
+
).optional().nullable()
|
|
139
|
+
}).describe("Metadata for paginated results.").optional()
|
|
140
|
+
});
|
|
42
141
|
var RemoveItemsFromBenefitRequest = z.object({
|
|
43
142
|
itemReferences: z.array(
|
|
44
143
|
z.object({
|
|
@@ -81,6 +180,8 @@ var AddItemsToBenefitResponse = z.object({});
|
|
|
81
180
|
0 && (module.exports = {
|
|
82
181
|
AddItemsToBenefitRequest,
|
|
83
182
|
AddItemsToBenefitResponse,
|
|
183
|
+
QueryPoolDefinitionItemsRequest,
|
|
184
|
+
QueryPoolDefinitionItemsResponse,
|
|
84
185
|
RemoveItemsFromBenefitRequest,
|
|
85
186
|
RemoveItemsFromBenefitResponse
|
|
86
187
|
});
|
package/build/cjs/schemas.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../schemas.ts","../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts"],"sourcesContent":["export * from './src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.js';\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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,QAAmB;AAEZ,IAAM,gCAAkC,SAAO;AAAA,EACpD,gBACG;AAAA,IACG,SAAO;AAAA,MACP,YACG,SAAO,EACP,SAAS,4CAA4C,EACrD;AAAA,QACC;AAAA,QACA;AAAA,MACF;AAAA,MACF,UAAY,SAAO,EAAE,SAAS,gBAAgB,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,IACnE,CAAC;AAAA,EACH,EACC,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,EACV,SAAW,SAAO;AAAA,IAChB,kBACG,SAAO,EACP,SAAS,wDAAwD,EACjE;AAAA,MACC;AAAA,MACA;AAAA,IACF;AAAA,IACF,YACG,SAAO,EACP,SAAS,yDAAyD,EAClE,IAAI,EAAE;AAAA,EACX,CAAC;AACH,CAAC;AACM,IAAM,iCAAmC,SAAO,CAAC,CAAC;AAClD,IAAM,2BAA6B,SAAO;AAAA,EAC/C,gBACG;AAAA,IACG,SAAO;AAAA,MACP,YACG,SAAO,EACP,SAAS,4CAA4C,EACrD;AAAA,QACC;AAAA,QACA;AAAA,MACF;AAAA,MACF,UAAY,SAAO,EAAE,SAAS,gBAAgB,EAAE,IAAI,EAAE,EAAE,SAAS;AAAA,IACnE,CAAC;AAAA,EACH,EACC,IAAI,CAAC,EACL,IAAI,GAAG;AAAA,EACV,SAAW,SAAO;AAAA,IAChB,kBACG,SAAO,EACP,SAAS,wDAAwD,EACjE;AAAA,MACC;AAAA,MACA;AAAA,IACF;AAAA,IACF,YACG,SAAO,EACP,SAAS,yDAAyD,EAClE,IAAI,EAAE;AAAA,EACX,CAAC;AACH,CAAC;AACM,IAAM,4BAA8B,SAAO,CAAC,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../schemas.ts","../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts"],"sourcesContent":["export * from './src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.js';\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":"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","names":[]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { ItemReference, RemoveItemsFromBenefitOptions, AddItemsToBenefitOptions } from './index.typings.mjs';
|
|
3
|
-
export { AccountInfo, ActionEvent, AddItemsToBenefitRequest, AddItemsToBenefitResponse, BenefitInfo, CreditConfiguration, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, IdentificationData, IdentificationDataIdOneOf, InvalidatePoolDefinitionItemsRequest, InvalidatePoolDefinitionItemsResponse, ItemInfo, MessageEnvelope, PoolDefinitionInfo, PoolDefinitionItem, PoolDefinitionItemDeactivated, ProgramDefinitionInfo, QueryPoolDefinitionItemsRequest, QueryPoolDefinitionItemsResponse, RemoveItemsFromBenefitRequest, RemoveItemsFromBenefitResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
|
|
2
|
+
import { ItemReference, RemoveItemsFromBenefitOptions, AddItemsToBenefitOptions, PoolDefinitionItemQuery, QueryPoolDefinitionItemsOptions, typedQueryPoolDefinitionItems, PoolDefinitionItemsQueryBuilder } from './index.typings.mjs';
|
|
3
|
+
export { AccountInfo, ActionEvent, AddItemsToBenefitRequest, AddItemsToBenefitResponse, BenefitInfo, CommonQueryWithEntityContext, CreditConfiguration, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, IdentificationData, IdentificationDataIdOneOf, InvalidatePoolDefinitionItemsRequest, InvalidatePoolDefinitionItemsResponse, ItemInfo, MessageEnvelope, PoolDefinitionInfo, PoolDefinitionItem, PoolDefinitionItemDeactivated, PoolDefinitionItemQuerySpec, PoolDefinitionItemsQueryResult, ProgramDefinitionInfo, QueryPoolDefinitionItemsRequest, QueryPoolDefinitionItemsResponse, RemoveItemsFromBenefitRequest, RemoveItemsFromBenefitResponse, RequestedFields, RequestedFieldsWithLiterals, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, WebhookIdentityType, WebhookIdentityTypeWithLiterals, utils } from './index.typings.mjs';
|
|
4
4
|
|
|
5
5
|
declare function removeItemsFromBenefit$1(httpClient: HttpClient, __options?: {
|
|
6
6
|
validateRequestSchema?: boolean;
|
|
@@ -23,7 +23,12 @@ interface AddItemsToBenefitSignature {
|
|
|
23
23
|
(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<AddItemsToBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<void>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
declare function customQueryPoolDefinitionItems(httpClient: HttpClient): {
|
|
27
|
+
(query: PoolDefinitionItemQuery, options?: QueryPoolDefinitionItemsOptions): ReturnType<typeof typedQueryPoolDefinitionItems>;
|
|
28
|
+
(options?: QueryPoolDefinitionItemsOptions): PoolDefinitionItemsQueryBuilder;
|
|
29
|
+
};
|
|
26
30
|
declare const removeItemsFromBenefit: MaybeContext<BuildRESTFunction<typeof removeItemsFromBenefit$1> & typeof removeItemsFromBenefit$1>;
|
|
27
31
|
declare const addItemsToBenefit: MaybeContext<BuildRESTFunction<typeof addItemsToBenefit$1> & typeof addItemsToBenefit$1>;
|
|
32
|
+
declare const queryPoolDefinitionItems: MaybeContext<BuildRESTFunction<typeof customQueryPoolDefinitionItems> & typeof customQueryPoolDefinitionItems>;
|
|
28
33
|
|
|
29
|
-
export { AddItemsToBenefitOptions, ItemReference, RemoveItemsFromBenefitOptions, addItemsToBenefit, removeItemsFromBenefit };
|
|
34
|
+
export { AddItemsToBenefitOptions, ItemReference, PoolDefinitionItemQuery, PoolDefinitionItemsQueryBuilder, QueryPoolDefinitionItemsOptions, RemoveItemsFromBenefitOptions, addItemsToBenefit, queryPoolDefinitionItems, removeItemsFromBenefit };
|
package/build/es/index.mjs
CHANGED
|
@@ -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 {
|
|
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) {
|
|
@@ -207,6 +425,21 @@ async function addItemsToBenefit2(itemReferences, options) {
|
|
|
207
425
|
}
|
|
208
426
|
|
|
209
427
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.public.ts
|
|
428
|
+
function queryPoolDefinitionItems3(httpClient, __options) {
|
|
429
|
+
return (options) => queryPoolDefinitionItems2(
|
|
430
|
+
options,
|
|
431
|
+
// @ts-ignore
|
|
432
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
433
|
+
);
|
|
434
|
+
}
|
|
435
|
+
function typedQueryPoolDefinitionItems2(httpClient, __options) {
|
|
436
|
+
return (query, options) => typedQueryPoolDefinitionItems(
|
|
437
|
+
query,
|
|
438
|
+
options,
|
|
439
|
+
// @ts-ignore
|
|
440
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
441
|
+
);
|
|
442
|
+
}
|
|
210
443
|
function removeItemsFromBenefit3(httpClient, __options) {
|
|
211
444
|
return (itemReferences, options) => removeItemsFromBenefit2(
|
|
212
445
|
itemReferences,
|
|
@@ -226,13 +459,28 @@ function addItemsToBenefit3(httpClient, __options) {
|
|
|
226
459
|
|
|
227
460
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.context.ts
|
|
228
461
|
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
462
|
+
import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
|
|
463
|
+
function customQueryPoolDefinitionItems(httpClient) {
|
|
464
|
+
const router = createQueryOverloadRouter({
|
|
465
|
+
builderQueryFunction: (options) => queryPoolDefinitionItems3(httpClient)(options),
|
|
466
|
+
typedQueryFunction: (query, options) => typedQueryPoolDefinitionItems2(httpClient)(query, options),
|
|
467
|
+
hasOptionsParameter: true
|
|
468
|
+
});
|
|
469
|
+
function overloadedQuery(queryOrOptions, options) {
|
|
470
|
+
return router(...arguments);
|
|
471
|
+
}
|
|
472
|
+
return overloadedQuery;
|
|
473
|
+
}
|
|
229
474
|
var removeItemsFromBenefit4 = /* @__PURE__ */ createRESTModule(removeItemsFromBenefit3);
|
|
230
475
|
var addItemsToBenefit4 = /* @__PURE__ */ createRESTModule(addItemsToBenefit3);
|
|
476
|
+
var queryPoolDefinitionItems4 = /* @__PURE__ */ createRESTModule(customQueryPoolDefinitionItems);
|
|
231
477
|
export {
|
|
232
478
|
RequestedFields,
|
|
233
479
|
SortOrder,
|
|
234
480
|
WebhookIdentityType,
|
|
235
481
|
addItemsToBenefit4 as addItemsToBenefit,
|
|
236
|
-
|
|
482
|
+
queryPoolDefinitionItems4 as queryPoolDefinitionItems,
|
|
483
|
+
removeItemsFromBenefit4 as removeItemsFromBenefit,
|
|
484
|
+
utils
|
|
237
485
|
};
|
|
238
486
|
//# sourceMappingURL=index.mjs.map
|