@wix/auto_sdk_benefit-programs_pool-definition-items 1.0.8 → 1.0.9
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 +5 -14
- package/build/cjs/index.js +8 -312
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +2 -188
- package/build/cjs/index.typings.js +4 -282
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +2 -3
- package/build/cjs/meta.js +0 -52
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +1 -52
- package/build/cjs/schemas.js +0 -101
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +5 -14
- package/build/es/index.mjs +8 -303
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +2 -188
- package/build/es/index.typings.mjs +4 -272
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +2 -3
- package/build/es/meta.mjs +0 -51
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +1 -52
- package/build/es/schemas.mjs +0 -99
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +5 -14
- package/build/internal/cjs/index.js +8 -312
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +2 -188
- package/build/internal/cjs/index.typings.js +4 -282
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +2 -3
- package/build/internal/cjs/meta.js +0 -52
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +1 -52
- package/build/internal/cjs/schemas.js +0 -101
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +5 -14
- package/build/internal/es/index.mjs +8 -303
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +2 -188
- package/build/internal/es/index.typings.mjs +4 -272
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +2 -3
- package/build/internal/es/meta.mjs +0 -51
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +1 -52
- package/build/internal/es/schemas.mjs +0 -99
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
package/build/es/schemas.mjs
CHANGED
|
@@ -1,102 +1,5 @@
|
|
|
1
1
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
var QueryPoolDefinitionItemsRequest = z.object({
|
|
4
|
-
query: z.intersection(
|
|
5
|
-
z.object({
|
|
6
|
-
filter: z.record(z.string(), z.any()).describe(
|
|
7
|
-
'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`'
|
|
8
|
-
).optional().nullable(),
|
|
9
|
-
sort: z.array(
|
|
10
|
-
z.object({
|
|
11
|
-
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
12
|
-
order: z.enum(["ASC", "DESC"]).optional()
|
|
13
|
-
})
|
|
14
|
-
).max(5).optional()
|
|
15
|
-
}),
|
|
16
|
-
z.xor([
|
|
17
|
-
z.object({ cursorPaging: z.never().optional() }),
|
|
18
|
-
z.object({
|
|
19
|
-
cursorPaging: z.object({
|
|
20
|
-
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(1e3).optional().nullable(),
|
|
21
|
-
cursor: z.string().describe(
|
|
22
|
-
"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."
|
|
23
|
-
).max(16e3).optional().nullable()
|
|
24
|
-
}).describe(
|
|
25
|
-
"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`."
|
|
26
|
-
)
|
|
27
|
-
})
|
|
28
|
-
])
|
|
29
|
-
).describe("Query to select benefit items."),
|
|
30
|
-
options: z.object({
|
|
31
|
-
fields: z.array(
|
|
32
|
-
z.enum(["POOL_DEFINITION", "PROGRAM_DEFINITION", "BENEFIT", "ITEM"])
|
|
33
|
-
).max(4).optional()
|
|
34
|
-
}).optional()
|
|
35
|
-
});
|
|
36
|
-
var QueryPoolDefinitionItemsResponse = z.object({
|
|
37
|
-
poolDefinitionItems: z.array(
|
|
38
|
-
z.object({
|
|
39
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
40
|
-
/^[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}$/,
|
|
41
|
-
"Must be a valid GUID"
|
|
42
|
-
).optional(),
|
|
43
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
44
|
-
"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."
|
|
45
|
-
).optional().nullable(),
|
|
46
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
47
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
48
|
-
externalId: z.string().describe(
|
|
49
|
-
"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."
|
|
50
|
-
).regex(
|
|
51
|
-
/^[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}$/,
|
|
52
|
-
"Must be a valid GUID"
|
|
53
|
-
).optional(),
|
|
54
|
-
category: z.string().describe(
|
|
55
|
-
"Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups."
|
|
56
|
-
).max(20).optional(),
|
|
57
|
-
providerAppId: z.string().describe(
|
|
58
|
-
"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."
|
|
59
|
-
).regex(
|
|
60
|
-
/^[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}$/,
|
|
61
|
-
"Must be a valid GUID"
|
|
62
|
-
).optional(),
|
|
63
|
-
namespace: z.string().describe(
|
|
64
|
-
"Module name of the item provider's application that originated the items.\n\nFor example, `store-inventory` or `fitness-resources`."
|
|
65
|
-
).min(1).max(20).optional(),
|
|
66
|
-
poolDefinitionId: z.string().describe("Pool definition id").regex(
|
|
67
|
-
/^[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}$/,
|
|
68
|
-
"Must be a valid GUID"
|
|
69
|
-
).optional(),
|
|
70
|
-
itemSetId: z.string().describe("Item set ID.").regex(
|
|
71
|
-
/^[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}$/,
|
|
72
|
-
"Must be a valid GUID"
|
|
73
|
-
).optional(),
|
|
74
|
-
itemId: z.string().describe("Item set ID.").regex(
|
|
75
|
-
/^[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}$/,
|
|
76
|
-
"Must be a valid GUID"
|
|
77
|
-
).optional(),
|
|
78
|
-
benefitKey: z.string().describe(
|
|
79
|
-
"Unique identifier for the benefit associated with this item."
|
|
80
|
-
).max(64).optional()
|
|
81
|
-
})
|
|
82
|
-
).optional(),
|
|
83
|
-
metadata: z.object({
|
|
84
|
-
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
85
|
-
cursors: z.object({
|
|
86
|
-
next: z.string().describe(
|
|
87
|
-
"Cursor string pointing to the next page in the list of results."
|
|
88
|
-
).max(16e3).optional().nullable(),
|
|
89
|
-
prev: z.string().describe(
|
|
90
|
-
"Cursor pointing to the previous page in the list of results."
|
|
91
|
-
).max(16e3).optional().nullable()
|
|
92
|
-
}).describe(
|
|
93
|
-
"Cursor strings that point to the next page, previous page, or both."
|
|
94
|
-
).optional(),
|
|
95
|
-
hasNext: z.boolean().describe(
|
|
96
|
-
"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."
|
|
97
|
-
).optional().nullable()
|
|
98
|
-
}).describe("Metadata for paginated results.").optional()
|
|
99
|
-
});
|
|
100
3
|
var RemoveItemsFromBenefitRequest = z.object({
|
|
101
4
|
itemReferences: z.array(
|
|
102
5
|
z.object({
|
|
@@ -138,8 +41,6 @@ var AddItemsToBenefitResponse = z.object({});
|
|
|
138
41
|
export {
|
|
139
42
|
AddItemsToBenefitRequest,
|
|
140
43
|
AddItemsToBenefitResponse,
|
|
141
|
-
QueryPoolDefinitionItemsRequest,
|
|
142
|
-
QueryPoolDefinitionItemsResponse,
|
|
143
44
|
RemoveItemsFromBenefitRequest,
|
|
144
45
|
RemoveItemsFromBenefitResponse
|
|
145
46
|
};
|
package/build/es/schemas.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts"],"sourcesContent":["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":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts"],"sourcesContent":["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,YAAY,OAAO;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,10 +1,8 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { ItemReference, RemoveItemsFromBenefitOptions, AddItemsToBenefitOptions
|
|
3
|
-
export { AccountInfo, ActionEvent, AddItemsToBenefitRequest, AddItemsToBenefitResponse, BenefitInfo,
|
|
2
|
+
import { ItemReference, RemoveItemsFromBenefitOptions, AddItemsToBenefitOptions } from './index.typings.js';
|
|
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.js';
|
|
4
4
|
|
|
5
|
-
declare function removeItemsFromBenefit$1(httpClient: HttpClient
|
|
6
|
-
validateRequestSchema?: boolean;
|
|
7
|
-
}): RemoveItemsFromBenefitSignature;
|
|
5
|
+
declare function removeItemsFromBenefit$1(httpClient: HttpClient): RemoveItemsFromBenefitSignature;
|
|
8
6
|
interface RemoveItemsFromBenefitSignature {
|
|
9
7
|
/**
|
|
10
8
|
* Removes items from a benefit's item set, resolved by pool definition ID and benefit key.
|
|
@@ -12,9 +10,7 @@ interface RemoveItemsFromBenefitSignature {
|
|
|
12
10
|
*/
|
|
13
11
|
(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<RemoveItemsFromBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<void>;
|
|
14
12
|
}
|
|
15
|
-
declare function addItemsToBenefit$1(httpClient: HttpClient
|
|
16
|
-
validateRequestSchema?: boolean;
|
|
17
|
-
}): AddItemsToBenefitSignature;
|
|
13
|
+
declare function addItemsToBenefit$1(httpClient: HttpClient): AddItemsToBenefitSignature;
|
|
18
14
|
interface AddItemsToBenefitSignature {
|
|
19
15
|
/**
|
|
20
16
|
* Adds items to a benefit's item set, resolved by pool definition ID and benefit key.
|
|
@@ -23,12 +19,7 @@ interface AddItemsToBenefitSignature {
|
|
|
23
19
|
(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<AddItemsToBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<void>;
|
|
24
20
|
}
|
|
25
21
|
|
|
26
|
-
declare function customQueryPoolDefinitionItems(httpClient: HttpClient): {
|
|
27
|
-
(query: PoolDefinitionItemQuery, options?: QueryPoolDefinitionItemsOptions): ReturnType<typeof typedQueryPoolDefinitionItems>;
|
|
28
|
-
(options?: QueryPoolDefinitionItemsOptions): PoolDefinitionItemsQueryBuilder;
|
|
29
|
-
};
|
|
30
22
|
declare const removeItemsFromBenefit: MaybeContext<BuildRESTFunction<typeof removeItemsFromBenefit$1> & typeof removeItemsFromBenefit$1>;
|
|
31
23
|
declare const addItemsToBenefit: MaybeContext<BuildRESTFunction<typeof addItemsToBenefit$1> & typeof addItemsToBenefit$1>;
|
|
32
|
-
declare const queryPoolDefinitionItems: MaybeContext<BuildRESTFunction<typeof customQueryPoolDefinitionItems> & typeof customQueryPoolDefinitionItems>;
|
|
33
24
|
|
|
34
|
-
export { AddItemsToBenefitOptions, ItemReference,
|
|
25
|
+
export { AddItemsToBenefitOptions, ItemReference, RemoveItemsFromBenefitOptions, addItemsToBenefit, removeItemsFromBenefit };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// index.ts
|
|
@@ -34,20 +24,15 @@ __export(index_exports, {
|
|
|
34
24
|
SortOrder: () => SortOrder,
|
|
35
25
|
WebhookIdentityType: () => WebhookIdentityType,
|
|
36
26
|
addItemsToBenefit: () => addItemsToBenefit4,
|
|
37
|
-
|
|
38
|
-
removeItemsFromBenefit: () => removeItemsFromBenefit4,
|
|
39
|
-
utils: () => utils
|
|
27
|
+
removeItemsFromBenefit: () => removeItemsFromBenefit4
|
|
40
28
|
});
|
|
41
29
|
module.exports = __toCommonJS(index_exports);
|
|
42
30
|
|
|
43
31
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
|
|
44
32
|
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
45
|
-
var import_query_builder = require("@wix/sdk-runtime/query-builder");
|
|
46
33
|
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
47
34
|
|
|
48
35
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.http.ts
|
|
49
|
-
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
50
|
-
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
51
36
|
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
52
37
|
function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(opts) {
|
|
53
38
|
const domainToMappings = {
|
|
@@ -73,34 +58,6 @@ function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceU
|
|
|
73
58
|
return (0, import_rest_modules.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
74
59
|
}
|
|
75
60
|
var PACKAGE_NAME = "@wix/auto_sdk_benefit-programs_pool-definition-items";
|
|
76
|
-
function queryPoolDefinitionItems(payload) {
|
|
77
|
-
function __queryPoolDefinitionItems({ host }) {
|
|
78
|
-
const metadata = {
|
|
79
|
-
entityFqdn: "wix.benefit_programs.v1.pool_definition_item",
|
|
80
|
-
method: "POST",
|
|
81
|
-
methodFqn: "wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems",
|
|
82
|
-
packageName: PACKAGE_NAME,
|
|
83
|
-
migrationOptions: {
|
|
84
|
-
optInTransformResponse: true
|
|
85
|
-
},
|
|
86
|
-
url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(
|
|
87
|
-
{ protoPath: "/v1/pool-definition-items/query", data: payload, host }
|
|
88
|
-
),
|
|
89
|
-
data: payload,
|
|
90
|
-
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
91
|
-
{
|
|
92
|
-
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
93
|
-
paths: [
|
|
94
|
-
{ path: "poolDefinitionItems.createdDate" },
|
|
95
|
-
{ path: "poolDefinitionItems.updatedDate" }
|
|
96
|
-
]
|
|
97
|
-
}
|
|
98
|
-
])
|
|
99
|
-
};
|
|
100
|
-
return metadata;
|
|
101
|
-
}
|
|
102
|
-
return __queryPoolDefinitionItems;
|
|
103
|
-
}
|
|
104
61
|
function removeItemsFromBenefit(payload) {
|
|
105
62
|
function __removeItemsFromBenefit({ host }) {
|
|
106
63
|
const metadata = {
|
|
@@ -149,148 +106,6 @@ function addItemsToBenefit(payload) {
|
|
|
149
106
|
}
|
|
150
107
|
|
|
151
108
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
|
|
152
|
-
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
153
|
-
|
|
154
|
-
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts
|
|
155
|
-
var z = __toESM(require("zod"));
|
|
156
|
-
var QueryPoolDefinitionItemsRequest = z.object({
|
|
157
|
-
query: z.intersection(
|
|
158
|
-
z.object({
|
|
159
|
-
filter: z.record(z.string(), z.any()).describe(
|
|
160
|
-
'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`'
|
|
161
|
-
).optional().nullable(),
|
|
162
|
-
sort: z.array(
|
|
163
|
-
z.object({
|
|
164
|
-
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
165
|
-
order: z.enum(["ASC", "DESC"]).optional()
|
|
166
|
-
})
|
|
167
|
-
).max(5).optional()
|
|
168
|
-
}),
|
|
169
|
-
z.xor([
|
|
170
|
-
z.object({ cursorPaging: z.never().optional() }),
|
|
171
|
-
z.object({
|
|
172
|
-
cursorPaging: z.object({
|
|
173
|
-
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(1e3).optional().nullable(),
|
|
174
|
-
cursor: z.string().describe(
|
|
175
|
-
"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."
|
|
176
|
-
).max(16e3).optional().nullable()
|
|
177
|
-
}).describe(
|
|
178
|
-
"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`."
|
|
179
|
-
)
|
|
180
|
-
})
|
|
181
|
-
])
|
|
182
|
-
).describe("Query to select benefit items."),
|
|
183
|
-
options: z.object({
|
|
184
|
-
fields: z.array(
|
|
185
|
-
z.enum(["POOL_DEFINITION", "PROGRAM_DEFINITION", "BENEFIT", "ITEM"])
|
|
186
|
-
).max(4).optional()
|
|
187
|
-
}).optional()
|
|
188
|
-
});
|
|
189
|
-
var QueryPoolDefinitionItemsResponse = z.object({
|
|
190
|
-
poolDefinitionItems: z.array(
|
|
191
|
-
z.object({
|
|
192
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
193
|
-
/^[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}$/,
|
|
194
|
-
"Must be a valid GUID"
|
|
195
|
-
).optional(),
|
|
196
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
197
|
-
"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."
|
|
198
|
-
).optional().nullable(),
|
|
199
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
200
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
201
|
-
externalId: z.string().describe(
|
|
202
|
-
"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."
|
|
203
|
-
).regex(
|
|
204
|
-
/^[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}$/,
|
|
205
|
-
"Must be a valid GUID"
|
|
206
|
-
).optional(),
|
|
207
|
-
category: z.string().describe(
|
|
208
|
-
"Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups."
|
|
209
|
-
).max(20).optional(),
|
|
210
|
-
providerAppId: z.string().describe(
|
|
211
|
-
"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."
|
|
212
|
-
).regex(
|
|
213
|
-
/^[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}$/,
|
|
214
|
-
"Must be a valid GUID"
|
|
215
|
-
).optional(),
|
|
216
|
-
namespace: z.string().describe(
|
|
217
|
-
"Module name of the item provider's application that originated the items.\n\nFor example, `store-inventory` or `fitness-resources`."
|
|
218
|
-
).min(1).max(20).optional(),
|
|
219
|
-
poolDefinitionId: z.string().describe("Pool definition id").regex(
|
|
220
|
-
/^[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}$/,
|
|
221
|
-
"Must be a valid GUID"
|
|
222
|
-
).optional(),
|
|
223
|
-
itemSetId: z.string().describe("Item set ID.").regex(
|
|
224
|
-
/^[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}$/,
|
|
225
|
-
"Must be a valid GUID"
|
|
226
|
-
).optional(),
|
|
227
|
-
itemId: z.string().describe("Item set ID.").regex(
|
|
228
|
-
/^[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}$/,
|
|
229
|
-
"Must be a valid GUID"
|
|
230
|
-
).optional(),
|
|
231
|
-
benefitKey: z.string().describe(
|
|
232
|
-
"Unique identifier for the benefit associated with this item."
|
|
233
|
-
).max(64).optional()
|
|
234
|
-
})
|
|
235
|
-
).optional(),
|
|
236
|
-
metadata: z.object({
|
|
237
|
-
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
238
|
-
cursors: z.object({
|
|
239
|
-
next: z.string().describe(
|
|
240
|
-
"Cursor string pointing to the next page in the list of results."
|
|
241
|
-
).max(16e3).optional().nullable(),
|
|
242
|
-
prev: z.string().describe(
|
|
243
|
-
"Cursor pointing to the previous page in the list of results."
|
|
244
|
-
).max(16e3).optional().nullable()
|
|
245
|
-
}).describe(
|
|
246
|
-
"Cursor strings that point to the next page, previous page, or both."
|
|
247
|
-
).optional(),
|
|
248
|
-
hasNext: z.boolean().describe(
|
|
249
|
-
"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."
|
|
250
|
-
).optional().nullable()
|
|
251
|
-
}).describe("Metadata for paginated results.").optional()
|
|
252
|
-
});
|
|
253
|
-
var RemoveItemsFromBenefitRequest = z.object({
|
|
254
|
-
itemReferences: z.array(
|
|
255
|
-
z.object({
|
|
256
|
-
externalId: z.string().describe("External item ID assigned by the provider.").regex(
|
|
257
|
-
/^[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}$/,
|
|
258
|
-
"Must be a valid GUID"
|
|
259
|
-
),
|
|
260
|
-
category: z.string().describe("Item category.").max(20).optional()
|
|
261
|
-
})
|
|
262
|
-
).min(1).max(100),
|
|
263
|
-
options: z.object({
|
|
264
|
-
poolDefinitionId: z.string().describe("ID of the pool definition associated with the benefit.").regex(
|
|
265
|
-
/^[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}$/,
|
|
266
|
-
"Must be a valid GUID"
|
|
267
|
-
),
|
|
268
|
-
benefitKey: z.string().describe("Key identifying the benefit within the pool definition.").max(64)
|
|
269
|
-
})
|
|
270
|
-
});
|
|
271
|
-
var RemoveItemsFromBenefitResponse = z.object({});
|
|
272
|
-
var AddItemsToBenefitRequest = z.object({
|
|
273
|
-
itemReferences: z.array(
|
|
274
|
-
z.object({
|
|
275
|
-
externalId: z.string().describe("External item ID assigned by the provider.").regex(
|
|
276
|
-
/^[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}$/,
|
|
277
|
-
"Must be a valid GUID"
|
|
278
|
-
),
|
|
279
|
-
category: z.string().describe("Item category.").max(20).optional()
|
|
280
|
-
})
|
|
281
|
-
).min(1).max(100),
|
|
282
|
-
options: z.object({
|
|
283
|
-
poolDefinitionId: z.string().describe("ID of the pool definition associated with the benefit.").regex(
|
|
284
|
-
/^[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}$/,
|
|
285
|
-
"Must be a valid GUID"
|
|
286
|
-
),
|
|
287
|
-
benefitKey: z.string().describe("Key identifying the benefit within the pool definition.").max(64)
|
|
288
|
-
})
|
|
289
|
-
});
|
|
290
|
-
var AddItemsToBenefitResponse = z.object({});
|
|
291
|
-
|
|
292
|
-
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
|
|
293
|
-
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
294
109
|
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
295
110
|
SortOrder2["ASC"] = "ASC";
|
|
296
111
|
SortOrder2["DESC"] = "DESC";
|
|
@@ -311,94 +126,8 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
311
126
|
WebhookIdentityType2["APP"] = "APP";
|
|
312
127
|
return WebhookIdentityType2;
|
|
313
128
|
})(WebhookIdentityType || {});
|
|
314
|
-
function queryPoolDefinitionItems2(options) {
|
|
315
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
316
|
-
return (0, import_query_builder.queryBuilder)({
|
|
317
|
-
func: async (payload) => {
|
|
318
|
-
const reqOpts = queryPoolDefinitionItems(
|
|
319
|
-
{ ...payload, ...options ?? {} }
|
|
320
|
-
);
|
|
321
|
-
sideEffects?.onSiteCall?.();
|
|
322
|
-
try {
|
|
323
|
-
const result = await httpClient.request(reqOpts);
|
|
324
|
-
sideEffects?.onSuccess?.(result);
|
|
325
|
-
return result;
|
|
326
|
-
} catch (err) {
|
|
327
|
-
sideEffects?.onError?.(err);
|
|
328
|
-
throw err;
|
|
329
|
-
}
|
|
330
|
-
},
|
|
331
|
-
requestTransformer: (query) => {
|
|
332
|
-
const args = [query, options];
|
|
333
|
-
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
334
|
-
...args?.[1],
|
|
335
|
-
query: args?.[0]
|
|
336
|
-
});
|
|
337
|
-
},
|
|
338
|
-
responseTransformer: ({
|
|
339
|
-
data
|
|
340
|
-
}) => {
|
|
341
|
-
const transformedData = (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
|
|
342
|
-
(0, import_transform_paths2.transformPaths)(data, [])
|
|
343
|
-
);
|
|
344
|
-
return {
|
|
345
|
-
items: transformedData?.poolDefinitionItems,
|
|
346
|
-
pagingMetadata: transformedData?.metadata
|
|
347
|
-
};
|
|
348
|
-
},
|
|
349
|
-
errorTransformer: (err) => {
|
|
350
|
-
const transformedError = (0, import_transform_error.transformError)(err, {
|
|
351
|
-
spreadPathsToArguments: {},
|
|
352
|
-
explicitPathsToArguments: { query: "$[0]" },
|
|
353
|
-
singleArgumentUnchanged: false
|
|
354
|
-
});
|
|
355
|
-
throw transformedError;
|
|
356
|
-
},
|
|
357
|
-
pagingMethod: "CURSOR",
|
|
358
|
-
transformationPaths: {}
|
|
359
|
-
});
|
|
360
|
-
}
|
|
361
|
-
async function typedQueryPoolDefinitionItems(query, options) {
|
|
362
|
-
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
363
|
-
if (validateRequestSchema) {
|
|
364
|
-
QueryPoolDefinitionItemsRequest.parse({ query, options });
|
|
365
|
-
}
|
|
366
|
-
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
367
|
-
query,
|
|
368
|
-
...options
|
|
369
|
-
});
|
|
370
|
-
const reqOpts = queryPoolDefinitionItems(
|
|
371
|
-
payload
|
|
372
|
-
);
|
|
373
|
-
sideEffects?.onSiteCall?.();
|
|
374
|
-
try {
|
|
375
|
-
const result = await httpClient.request(reqOpts);
|
|
376
|
-
sideEffects?.onSuccess?.(result);
|
|
377
|
-
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
378
|
-
} catch (err) {
|
|
379
|
-
const transformedError = (0, import_transform_error.transformError)(
|
|
380
|
-
err,
|
|
381
|
-
{
|
|
382
|
-
spreadPathsToArguments: {},
|
|
383
|
-
explicitPathsToArguments: { query: "$[0]" },
|
|
384
|
-
singleArgumentUnchanged: false
|
|
385
|
-
},
|
|
386
|
-
["query", "options"]
|
|
387
|
-
);
|
|
388
|
-
sideEffects?.onError?.(err);
|
|
389
|
-
throw transformedError;
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
var utils = {
|
|
393
|
-
query: {
|
|
394
|
-
...(0, import_query_builder_utils.createQueryUtils)()
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
129
|
async function removeItemsFromBenefit2(itemReferences, options) {
|
|
398
|
-
const { httpClient, sideEffects
|
|
399
|
-
if (validateRequestSchema) {
|
|
400
|
-
RemoveItemsFromBenefitRequest.parse({ itemReferences, options });
|
|
401
|
-
}
|
|
130
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
402
131
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
403
132
|
itemReferences,
|
|
404
133
|
poolDefinitionId: options?.poolDefinitionId,
|
|
@@ -430,10 +159,7 @@ async function removeItemsFromBenefit2(itemReferences, options) {
|
|
|
430
159
|
}
|
|
431
160
|
}
|
|
432
161
|
async function addItemsToBenefit2(itemReferences, options) {
|
|
433
|
-
const { httpClient, sideEffects
|
|
434
|
-
if (validateRequestSchema) {
|
|
435
|
-
AddItemsToBenefitRequest.parse({ itemReferences, options });
|
|
436
|
-
}
|
|
162
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
437
163
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
438
164
|
itemReferences,
|
|
439
165
|
poolDefinitionId: options?.poolDefinitionId,
|
|
@@ -464,63 +190,33 @@ async function addItemsToBenefit2(itemReferences, options) {
|
|
|
464
190
|
}
|
|
465
191
|
|
|
466
192
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.public.ts
|
|
467
|
-
function
|
|
468
|
-
return (options) => queryPoolDefinitionItems2(
|
|
469
|
-
options,
|
|
470
|
-
// @ts-ignore
|
|
471
|
-
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
472
|
-
);
|
|
473
|
-
}
|
|
474
|
-
function typedQueryPoolDefinitionItems2(httpClient, __options) {
|
|
475
|
-
return (query, options) => typedQueryPoolDefinitionItems(
|
|
476
|
-
query,
|
|
477
|
-
options,
|
|
478
|
-
// @ts-ignore
|
|
479
|
-
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
480
|
-
);
|
|
481
|
-
}
|
|
482
|
-
function removeItemsFromBenefit3(httpClient, __options) {
|
|
193
|
+
function removeItemsFromBenefit3(httpClient) {
|
|
483
194
|
return (itemReferences, options) => removeItemsFromBenefit2(
|
|
484
195
|
itemReferences,
|
|
485
196
|
options,
|
|
486
197
|
// @ts-ignore
|
|
487
|
-
{ httpClient
|
|
198
|
+
{ httpClient }
|
|
488
199
|
);
|
|
489
200
|
}
|
|
490
|
-
function addItemsToBenefit3(httpClient
|
|
201
|
+
function addItemsToBenefit3(httpClient) {
|
|
491
202
|
return (itemReferences, options) => addItemsToBenefit2(
|
|
492
203
|
itemReferences,
|
|
493
204
|
options,
|
|
494
205
|
// @ts-ignore
|
|
495
|
-
{ httpClient
|
|
206
|
+
{ httpClient }
|
|
496
207
|
);
|
|
497
208
|
}
|
|
498
209
|
|
|
499
210
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.context.ts
|
|
500
211
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
501
|
-
var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
|
|
502
|
-
function customQueryPoolDefinitionItems(httpClient) {
|
|
503
|
-
const router = (0, import_query_method_router.createQueryOverloadRouter)({
|
|
504
|
-
builderQueryFunction: (options) => queryPoolDefinitionItems3(httpClient)(options),
|
|
505
|
-
typedQueryFunction: (query, options) => typedQueryPoolDefinitionItems2(httpClient)(query, options),
|
|
506
|
-
hasOptionsParameter: true
|
|
507
|
-
});
|
|
508
|
-
function overloadedQuery(queryOrOptions, options) {
|
|
509
|
-
return router(...arguments);
|
|
510
|
-
}
|
|
511
|
-
return overloadedQuery;
|
|
512
|
-
}
|
|
513
212
|
var removeItemsFromBenefit4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(removeItemsFromBenefit3);
|
|
514
213
|
var addItemsToBenefit4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(addItemsToBenefit3);
|
|
515
|
-
var queryPoolDefinitionItems4 = /* @__PURE__ */ (0, import_rest_modules2.createRESTModule)(customQueryPoolDefinitionItems);
|
|
516
214
|
// Annotate the CommonJS export names for ESM import in node:
|
|
517
215
|
0 && (module.exports = {
|
|
518
216
|
RequestedFields,
|
|
519
217
|
SortOrder,
|
|
520
218
|
WebhookIdentityType,
|
|
521
219
|
addItemsToBenefit,
|
|
522
|
-
|
|
523
|
-
removeItemsFromBenefit,
|
|
524
|
-
utils
|
|
220
|
+
removeItemsFromBenefit
|
|
525
221
|
});
|
|
526
222
|
//# sourceMappingURL=index.js.map
|