@wix/auto_sdk_benefit-programs_pool-items 1.0.0 → 1.0.2
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 +1 -1
- package/build/cjs/index.js +5 -183
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +110 -56
- package/build/cjs/index.typings.js +1 -179
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +96 -51
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +24 -0
- package/build/cjs/schemas.js +89 -25
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +1 -1
- package/build/es/index.mjs +5 -173
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +110 -56
- package/build/es/index.typings.mjs +1 -169
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +96 -51
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +24 -0
- package/build/es/schemas.mjs +89 -25
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +1 -1
- package/build/internal/cjs/index.js +5 -183
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +90 -66
- package/build/internal/cjs/index.typings.js +1 -179
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +96 -51
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +24 -0
- package/build/internal/cjs/schemas.js +89 -25
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +1 -1
- package/build/internal/es/index.mjs +5 -173
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +90 -66
- package/build/internal/es/index.typings.mjs +1 -169
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +96 -51
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +24 -0
- package/build/internal/es/schemas.mjs +89 -25
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,60 +1,58 @@
|
|
|
1
1
|
import * as _wix_sdk_types from '@wix/sdk-types';
|
|
2
2
|
import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* A pool item represents a specific catalog item that a beneficiary can access as part of a benefit in their pool. Pool items are created automatically when items become available to a beneficiary, and they're removed when the items are revoked.
|
|
6
|
+
*
|
|
7
|
+
* Each pool item links a beneficiary's pool to a single catalog item, surfacing pricing, display details, and references to the underlying pool, program, pool definition, and program definition.
|
|
8
|
+
*/
|
|
4
9
|
interface PoolItem {
|
|
5
10
|
/**
|
|
6
|
-
*
|
|
11
|
+
* Pool item ID. Generated deterministically from `poolId` and `itemId`.
|
|
7
12
|
* @format GUID
|
|
8
13
|
* @readonly
|
|
9
14
|
*/
|
|
10
15
|
_id?: string;
|
|
11
16
|
/**
|
|
12
|
-
* Revision number, which increments by 1 each time the
|
|
13
|
-
* To prevent conflicting changes, the current revision must be passed when updating the item.
|
|
14
|
-
*
|
|
15
|
-
* Ignored when creating an item.
|
|
17
|
+
* Revision number, which increments by 1 each time the pool item is updated.
|
|
16
18
|
* @readonly
|
|
17
19
|
*/
|
|
18
20
|
revision?: string | null;
|
|
19
21
|
/**
|
|
20
|
-
* Date and time the item was created.
|
|
22
|
+
* Date and time the pool item was created.
|
|
21
23
|
* @readonly
|
|
22
24
|
*/
|
|
23
25
|
_createdDate?: Date | null;
|
|
24
26
|
/**
|
|
25
|
-
* Date and time the item was updated.
|
|
27
|
+
* Date and time the pool item was updated.
|
|
26
28
|
* @readonly
|
|
27
29
|
*/
|
|
28
30
|
_updatedDate?: Date | null;
|
|
29
31
|
/**
|
|
30
32
|
* External item ID assigned by the provider of the items.
|
|
31
33
|
*
|
|
32
|
-
* For example, if the
|
|
34
|
+
* For example, if the items are products, this ID corresponds to the specific product ID in the provider's system.
|
|
33
35
|
* @format GUID
|
|
34
36
|
* @immutable
|
|
35
37
|
* @readonly
|
|
36
38
|
*/
|
|
37
39
|
externalId?: string;
|
|
38
40
|
/**
|
|
39
|
-
* Item category. Groups benefit items together for organization and management
|
|
41
|
+
* Item category. Groups benefit items together for organization and management. For example, `classes`, `posts`, or `groups`.
|
|
40
42
|
* @maxLength 20
|
|
41
43
|
* @immutable
|
|
42
44
|
* @readonly
|
|
43
45
|
*/
|
|
44
46
|
category?: string;
|
|
45
47
|
/**
|
|
46
|
-
* ID of the application
|
|
47
|
-
*
|
|
48
|
-
* ID of the external application supplying the items. Each item's external ID is unique to its respective provider's application.
|
|
48
|
+
* ID of the application that provides the benefit items. Each item's `externalId` is unique within its provider application.
|
|
49
49
|
* @format GUID
|
|
50
50
|
* @immutable
|
|
51
51
|
* @readonly
|
|
52
52
|
*/
|
|
53
53
|
providerAppId?: string;
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* For example, `store-inventory` or `fitness-resources`.
|
|
55
|
+
* Namespace for your app or site's benefit programs. Namespaces let you distinguish between entities that you created and entities that other apps created.
|
|
58
56
|
* @minLength 1
|
|
59
57
|
* @maxLength 20
|
|
60
58
|
* @immutable
|
|
@@ -62,109 +60,110 @@ interface PoolItem {
|
|
|
62
60
|
*/
|
|
63
61
|
namespace?: string;
|
|
64
62
|
/**
|
|
65
|
-
*
|
|
63
|
+
* ID of the pool that contains this item. A pool is the runtime container of benefits and items provisioned for a beneficiary.
|
|
66
64
|
* @format GUID
|
|
67
65
|
* @immutable
|
|
68
66
|
* @readonly
|
|
69
67
|
*/
|
|
70
68
|
poolId?: string;
|
|
71
69
|
/**
|
|
72
|
-
*
|
|
70
|
+
* ID of the program that contains this pool item. The program is the runtime instance of a program definition for a specific beneficiary.
|
|
73
71
|
* @format GUID
|
|
74
72
|
* @immutable
|
|
75
73
|
* @readonly
|
|
76
74
|
*/
|
|
77
75
|
programId?: string | null;
|
|
78
76
|
/**
|
|
79
|
-
*
|
|
77
|
+
* External program ID assigned by the provider.
|
|
80
78
|
* @format GUID
|
|
81
79
|
* @readonly
|
|
82
80
|
*/
|
|
83
81
|
externalProgramId?: string | null;
|
|
84
82
|
/**
|
|
85
|
-
*
|
|
83
|
+
* ID of the program definition that's the template for this pool item's program.
|
|
86
84
|
* @format GUID
|
|
87
85
|
* @immutable
|
|
88
86
|
* @readonly
|
|
89
87
|
*/
|
|
90
88
|
programDefinitionId?: string | null;
|
|
91
89
|
/**
|
|
92
|
-
*
|
|
90
|
+
* External program definition ID assigned by the provider.
|
|
93
91
|
* @format GUID
|
|
94
92
|
* @immutable
|
|
95
93
|
* @readonly
|
|
96
94
|
*/
|
|
97
95
|
externalProgramDefinitionId?: string | null;
|
|
98
96
|
/**
|
|
99
|
-
*
|
|
97
|
+
* ID of the pool definition that's the template for this pool item's pool.
|
|
100
98
|
* @format GUID
|
|
101
99
|
* @immutable
|
|
102
100
|
* @readonly
|
|
103
101
|
*/
|
|
104
102
|
poolDefinitionId?: string | null;
|
|
105
103
|
/**
|
|
106
|
-
*
|
|
104
|
+
* Internal grouping identifier for this benefit's item set. Use `poolId` together with `benefitKey` to identify a benefit — `itemSetId` is an implementation detail.
|
|
107
105
|
* @format GUID
|
|
108
106
|
* @immutable
|
|
109
107
|
* @readonly
|
|
110
108
|
*/
|
|
111
109
|
itemSetId?: string;
|
|
112
110
|
/**
|
|
113
|
-
*
|
|
111
|
+
* Beneficiary of the pool — the member, contact, or visitor who holds this pool item.
|
|
114
112
|
* @readonly
|
|
115
113
|
* @immutable
|
|
116
114
|
*/
|
|
117
115
|
beneficiary?: CommonIdentificationData;
|
|
118
116
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
117
|
+
* Pool details, including display name and description.
|
|
118
|
+
*
|
|
119
|
+
* Returned only when `POOL` is included in the `fields` request parameter.
|
|
121
120
|
* @readonly
|
|
122
121
|
*/
|
|
123
122
|
pool?: PoolInfo;
|
|
124
123
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
124
|
+
* Program details — `id`, `externalId`, and `displayName`.
|
|
125
|
+
*
|
|
126
|
+
* Returned only when `PROGRAM` is included in the `fields` request parameter.
|
|
127
127
|
* @readonly
|
|
128
128
|
*/
|
|
129
129
|
program?: ProgramInfo;
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
132
|
-
*
|
|
131
|
+
* Program definition that includes this item as an accessible benefit.
|
|
132
|
+
*
|
|
133
|
+
* Returned only when `PROGRAM_DEFINITION` is included in the `fields` request parameter.
|
|
133
134
|
* @readonly
|
|
134
135
|
*/
|
|
135
136
|
programDefinition?: ProgramDefinitionInfo;
|
|
136
137
|
/**
|
|
137
|
-
* Item
|
|
138
|
+
* Item ID.
|
|
138
139
|
* @format GUID
|
|
139
140
|
* @immutable
|
|
140
141
|
* @readonly
|
|
141
142
|
*/
|
|
142
143
|
itemId?: string;
|
|
143
144
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
145
|
+
* Display name for the catalog item.
|
|
146
|
+
*
|
|
147
|
+
* Returned only when `ITEM` is included in the `fields` request parameter.
|
|
146
148
|
* @readonly
|
|
147
149
|
*/
|
|
148
150
|
itemInfo?: ItemInfo;
|
|
149
151
|
/**
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
+
* Pricing and display information for the associated benefit, including credit price, name, and description.
|
|
153
|
+
*
|
|
154
|
+
* Returned only when `BENEFIT` is included in the `fields` request parameter.
|
|
152
155
|
* @readonly
|
|
153
156
|
*/
|
|
154
157
|
benefitInfo?: BenefitInfo;
|
|
155
158
|
/**
|
|
156
|
-
* Unique identifier for the benefit
|
|
159
|
+
* Unique identifier for the benefit that grants access to this item.
|
|
157
160
|
* @maxLength 64
|
|
158
161
|
* @immutable
|
|
159
162
|
* @readonly
|
|
160
163
|
*/
|
|
161
164
|
benefitKey?: string;
|
|
162
165
|
/**
|
|
163
|
-
*
|
|
164
|
-
* It's build by concatenating the following fields in this order, separated by a separator (e.g., "/"):
|
|
165
|
-
* - providerAppId
|
|
166
|
-
* - category
|
|
167
|
-
* - externalId
|
|
166
|
+
* Pre-computed search key for the item reference, built by concatenating `providerAppId`, `category`, and `externalId` separated by `/`. Use this field for efficient single-field filtering instead of composing three separate conditions.
|
|
168
167
|
* @maxLength 94
|
|
169
168
|
* @immutable
|
|
170
169
|
* @readonly
|
|
@@ -218,11 +217,10 @@ declare enum IdentityType {
|
|
|
218
217
|
}
|
|
219
218
|
/** @enumType */
|
|
220
219
|
type IdentityTypeWithLiterals = IdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER';
|
|
220
|
+
/** Pool's display details. */
|
|
221
221
|
interface PoolInfo {
|
|
222
222
|
/**
|
|
223
|
-
* Pool name.
|
|
224
|
-
*
|
|
225
|
-
* You may want to use the same name that's used in the associated pool definition.
|
|
223
|
+
* Pool's display name. Often matches the name on the associated pool definition.
|
|
226
224
|
* @maxLength 64
|
|
227
225
|
*/
|
|
228
226
|
displayName?: string;
|
|
@@ -232,36 +230,38 @@ interface PoolInfo {
|
|
|
232
230
|
*/
|
|
233
231
|
description?: string | null;
|
|
234
232
|
}
|
|
233
|
+
/** Program's identifying details. */
|
|
235
234
|
interface ProgramInfo {
|
|
236
235
|
/**
|
|
237
|
-
* Program
|
|
236
|
+
* Program ID.
|
|
238
237
|
* @format GUID
|
|
239
238
|
*/
|
|
240
239
|
_id?: string;
|
|
241
240
|
/**
|
|
242
|
-
*
|
|
241
|
+
* External program ID assigned by the provider.
|
|
243
242
|
* @format GUID
|
|
244
243
|
*/
|
|
245
244
|
externalId?: string | null;
|
|
246
245
|
/**
|
|
247
|
-
* Program name.
|
|
246
|
+
* Program's display name.
|
|
248
247
|
* @maxLength 64
|
|
249
248
|
*/
|
|
250
249
|
displayName?: string | null;
|
|
251
250
|
}
|
|
251
|
+
/** Program definition's display details. */
|
|
252
252
|
interface ProgramDefinitionInfo {
|
|
253
253
|
/**
|
|
254
|
-
* Program definition
|
|
254
|
+
* Program definition ID.
|
|
255
255
|
* @format GUID
|
|
256
256
|
*/
|
|
257
257
|
_id?: string;
|
|
258
258
|
/**
|
|
259
|
-
*
|
|
259
|
+
* External program definition ID assigned by the provider.
|
|
260
260
|
* @format GUID
|
|
261
261
|
*/
|
|
262
262
|
externalId?: string | null;
|
|
263
263
|
/**
|
|
264
|
-
* Program definition name
|
|
264
|
+
* Program definition's display name.
|
|
265
265
|
* @maxLength 64
|
|
266
266
|
*/
|
|
267
267
|
displayName?: string | null;
|
|
@@ -271,26 +271,30 @@ interface ProgramDefinitionInfo {
|
|
|
271
271
|
*/
|
|
272
272
|
description?: string | null;
|
|
273
273
|
}
|
|
274
|
+
/** Catalog item's display details. */
|
|
274
275
|
interface ItemInfo {
|
|
275
276
|
/**
|
|
276
|
-
* Item display name.
|
|
277
|
+
* Item's display name.
|
|
277
278
|
* @maxLength 64
|
|
278
279
|
*/
|
|
279
280
|
displayName?: string | null;
|
|
280
281
|
}
|
|
282
|
+
/** Pricing and display information for a benefit. */
|
|
281
283
|
interface BenefitInfo {
|
|
282
284
|
/**
|
|
283
|
-
*
|
|
285
|
+
* Cost of the benefit in credits. The cost is the same for all items in this benefit.
|
|
286
|
+
*
|
|
287
|
+
* Credits are a configurable unit defined on the parent pool definition. The unit type is set in the pool definition's credit configuration. Absent when no credit-based pricing is configured for this benefit.
|
|
284
288
|
* @decimalValue options { gte:0, maxScale:4 }
|
|
285
289
|
*/
|
|
286
290
|
price?: string | null;
|
|
287
291
|
/**
|
|
288
|
-
* Unique identifier for this benefit.
|
|
292
|
+
* Unique identifier for this benefit. Same value as `poolItem.benefitKey`.
|
|
289
293
|
* @maxLength 64
|
|
290
294
|
*/
|
|
291
295
|
benefitKey?: string;
|
|
292
296
|
/**
|
|
293
|
-
* Benefit name.
|
|
297
|
+
* Benefit's display name.
|
|
294
298
|
* @maxLength 40
|
|
295
299
|
*/
|
|
296
300
|
displayName?: string | null;
|
|
@@ -300,15 +304,21 @@ interface BenefitInfo {
|
|
|
300
304
|
*/
|
|
301
305
|
description?: string | null;
|
|
302
306
|
}
|
|
307
|
+
/** Deprecated: use `PoolItemRemoved` instead. Will be removed on 2026-05-31 after clients have migrated. */
|
|
303
308
|
interface PoolItemDeactivated {
|
|
304
|
-
/**
|
|
309
|
+
/** Pool item that was deactivated. */
|
|
310
|
+
poolItem?: PoolItem;
|
|
311
|
+
}
|
|
312
|
+
/** Payload for the `PoolItemRemoved` action event. */
|
|
313
|
+
interface PoolItemRemoved {
|
|
314
|
+
/** Pool item that was removed from its benefit. */
|
|
305
315
|
poolItem?: PoolItem;
|
|
306
316
|
}
|
|
307
317
|
interface QueryPoolItemsRequest {
|
|
308
|
-
/** Query
|
|
318
|
+
/** Query options. */
|
|
309
319
|
query?: CursorQuery;
|
|
310
320
|
/**
|
|
311
|
-
*
|
|
321
|
+
* Optional enrichments to include in the response.
|
|
312
322
|
* @maxSize 5
|
|
313
323
|
*/
|
|
314
324
|
fields?: RequestedFieldsWithLiterals[];
|
|
@@ -368,18 +378,23 @@ interface CursorPaging {
|
|
|
368
378
|
cursor?: string | null;
|
|
369
379
|
}
|
|
370
380
|
declare enum RequestedFields {
|
|
381
|
+
/** Populates the `pool` field with the pool's display name and description. */
|
|
371
382
|
POOL = "POOL",
|
|
383
|
+
/** Populates the `program` field with the program's display name. */
|
|
372
384
|
PROGRAM = "PROGRAM",
|
|
385
|
+
/** Populates the `programDefinition` field with the program definition's display name and description. */
|
|
373
386
|
PROGRAM_DEFINITION = "PROGRAM_DEFINITION",
|
|
387
|
+
/** Populates the `itemInfo` field with the catalog item's display name. */
|
|
374
388
|
ITEM = "ITEM",
|
|
389
|
+
/** Populates the `benefitInfo` field with the benefit's credit price, name, and description. */
|
|
375
390
|
BENEFIT = "BENEFIT"
|
|
376
391
|
}
|
|
377
392
|
/** @enumType */
|
|
378
393
|
type RequestedFieldsWithLiterals = RequestedFields | 'POOL' | 'PROGRAM' | 'PROGRAM_DEFINITION' | 'ITEM' | 'BENEFIT';
|
|
379
394
|
interface QueryPoolItemsResponse {
|
|
380
|
-
/** List of items. */
|
|
395
|
+
/** List of retrieved pool items. */
|
|
381
396
|
poolItems?: PoolItem[];
|
|
382
|
-
/**
|
|
397
|
+
/** Paging metadata. */
|
|
383
398
|
metadata?: CursorPagingMetadata;
|
|
384
399
|
}
|
|
385
400
|
interface CursorPagingMetadata {
|
|
@@ -409,12 +424,12 @@ interface Cursors {
|
|
|
409
424
|
}
|
|
410
425
|
interface InvalidatePoolItemsRequest {
|
|
411
426
|
/**
|
|
412
|
-
*
|
|
427
|
+
* ID of the pool whose items are invalidated.
|
|
413
428
|
* @format GUID
|
|
414
429
|
*/
|
|
415
430
|
poolId?: string;
|
|
416
431
|
/**
|
|
417
|
-
*
|
|
432
|
+
* IDs of the item sets to invalidate. When empty, items for all benefits in the pool are invalidated.
|
|
418
433
|
* @maxSize 10
|
|
419
434
|
* @format GUID
|
|
420
435
|
*/
|
|
@@ -576,11 +591,20 @@ interface AccountInfo {
|
|
|
576
591
|
siteId?: string | null;
|
|
577
592
|
}
|
|
578
593
|
/**
|
|
579
|
-
* Retrieves a list of
|
|
594
|
+
* Retrieves a list of up to 1,000 pool items, given the provided paging, filtering, and sorting.
|
|
595
|
+
*
|
|
596
|
+
* Returns only active pool items — soft-deleted pool items are automatically excluded from the response.
|
|
597
|
+
*
|
|
598
|
+
* When called by a logged-in member without an explicit `beneficiary.memberId` filter, the response is automatically scoped to the calling member. App callers must include a `beneficiary.memberId` filter to scope the response to a specific beneficiary.
|
|
599
|
+
*
|
|
600
|
+
* Query Pool Items runs with these defaults, which you can override:
|
|
601
|
+
*
|
|
602
|
+
* - `createdDate` is sorted in `DESC` order
|
|
603
|
+
* - `cursorPaging.limit` is `50`
|
|
580
604
|
*
|
|
581
|
-
*
|
|
605
|
+
* To learn about working with Query methods, see [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language), [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging), and [Field Projection](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-field-projection).
|
|
582
606
|
*
|
|
583
|
-
*
|
|
607
|
+
* For a detailed list of supported filters, see [Pool Items: Supported Filters and Sorting](https://dev.wix.com/docs/rest/business-solutions/benefit-programs/item-v1/filtering-and-sorting).
|
|
584
608
|
* @public
|
|
585
609
|
* @documentationMaturity preview
|
|
586
610
|
* @permissionId benefit_programs:v1:pool_item:query_pool_items
|
|
@@ -591,7 +615,7 @@ interface AccountInfo {
|
|
|
591
615
|
declare function queryPoolItems(options?: QueryPoolItemsOptions): PoolItemsQueryBuilder;
|
|
592
616
|
interface QueryPoolItemsOptions {
|
|
593
617
|
/**
|
|
594
|
-
*
|
|
618
|
+
* Optional enrichments to include in the response.
|
|
595
619
|
* @maxSize 5
|
|
596
620
|
*/
|
|
597
621
|
fields?: RequestedFieldsWithLiterals[] | undefined;
|
|
@@ -678,7 +702,7 @@ interface PoolItemsQueryBuilder {
|
|
|
678
702
|
* @fqn wix.benefit_programs.v1.pool_item.PoolItemService.QueryPoolItems
|
|
679
703
|
* @requiredField query
|
|
680
704
|
*/
|
|
681
|
-
declare function typedQueryPoolItems(query: PoolItemQuery, options?: QueryPoolItemsOptions): Promise<NonNullablePaths<QueryPoolItemsResponse, `poolItems` | `poolItems.${number}._id` | `poolItems.${number}.externalId` | `poolItems.${number}.category` | `poolItems.${number}.providerAppId` | `poolItems.${number}.namespace` | `poolItems.${number}.poolId` | `poolItems.${number}.itemSetId` | `poolItems.${number}.beneficiary.anonymousVisitorId` | `poolItems.${number}.beneficiary.memberId` | `poolItems.${number}.beneficiary.wixUserId` | `poolItems.${number}.itemId` | `poolItems.${number}.benefitKey` | `poolItems.${number}.itemReferenceSearchKey`, 5>>;
|
|
705
|
+
declare function typedQueryPoolItems(query: PoolItemQuery, options?: QueryPoolItemsOptions): Promise<NonNullablePaths<QueryPoolItemsResponse, `poolItems` | `poolItems.${number}._id` | `poolItems.${number}.externalId` | `poolItems.${number}.category` | `poolItems.${number}.providerAppId` | `poolItems.${number}.namespace` | `poolItems.${number}.poolId` | `poolItems.${number}.itemSetId` | `poolItems.${number}.beneficiary.anonymousVisitorId` | `poolItems.${number}.beneficiary.memberId` | `poolItems.${number}.beneficiary.wixUserId` | `poolItems.${number}.pool.displayName` | `poolItems.${number}.program._id` | `poolItems.${number}.programDefinition._id` | `poolItems.${number}.itemId` | `poolItems.${number}.benefitInfo.benefitKey` | `poolItems.${number}.benefitKey` | `poolItems.${number}.itemReferenceSearchKey`, 5>>;
|
|
682
706
|
interface PoolItemQuerySpec extends QuerySpec {
|
|
683
707
|
paging: 'cursor';
|
|
684
708
|
wql: [
|
|
@@ -760,4 +784,4 @@ declare const utils: {
|
|
|
760
784
|
};
|
|
761
785
|
};
|
|
762
786
|
|
|
763
|
-
export { type AccountInfo, type ActionEvent, type BenefitInfo, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, type CommonQueryWithEntityContext, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type InvalidatePoolItemsRequest, type InvalidatePoolItemsResponse, type ItemInfo, type MessageEnvelope, type PoolInfo, type PoolItem, type PoolItemDeactivated, type PoolItemQuery, type PoolItemQuerySpec, type PoolItemsQueryBuilder, type PoolItemsQueryResult, type ProgramDefinitionInfo, type ProgramInfo, type QueryPoolItemsOptions, type QueryPoolItemsRequest, type QueryPoolItemsResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, queryPoolItems, typedQueryPoolItems, utils };
|
|
787
|
+
export { type AccountInfo, type ActionEvent, type BenefitInfo, type CommonIdentificationData, type CommonIdentificationDataIdOneOf, type CommonQueryWithEntityContext, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IdentificationData, type IdentificationDataIdOneOf, IdentityType, type IdentityTypeWithLiterals, type InvalidatePoolItemsRequest, type InvalidatePoolItemsResponse, type ItemInfo, type MessageEnvelope, type PoolInfo, type PoolItem, type PoolItemDeactivated, type PoolItemQuery, type PoolItemQuerySpec, type PoolItemRemoved, type PoolItemsQueryBuilder, type PoolItemsQueryResult, type ProgramDefinitionInfo, type ProgramInfo, type QueryPoolItemsOptions, type QueryPoolItemsRequest, type QueryPoolItemsResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, queryPoolItems, typedQueryPoolItems, utils };
|
|
@@ -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.typings.ts
|
|
@@ -106,171 +96,6 @@ function queryPoolItems(payload) {
|
|
|
106
96
|
|
|
107
97
|
// src/benefit-programs-v1-pool-item-pool-items.universal.ts
|
|
108
98
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
109
|
-
|
|
110
|
-
// src/benefit-programs-v1-pool-item-pool-items.schemas.ts
|
|
111
|
-
var z = __toESM(require("zod"));
|
|
112
|
-
var QueryPoolItemsRequest = z.object({
|
|
113
|
-
query: z.intersection(
|
|
114
|
-
z.object({
|
|
115
|
-
filter: z.record(z.string(), z.any()).describe(
|
|
116
|
-
'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`'
|
|
117
|
-
).optional().nullable(),
|
|
118
|
-
sort: z.array(
|
|
119
|
-
z.object({
|
|
120
|
-
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
121
|
-
order: z.enum(["ASC", "DESC"]).optional()
|
|
122
|
-
})
|
|
123
|
-
).max(5).optional()
|
|
124
|
-
}),
|
|
125
|
-
z.xor([
|
|
126
|
-
z.object({ cursorPaging: z.never().optional() }),
|
|
127
|
-
z.object({
|
|
128
|
-
cursorPaging: z.object({
|
|
129
|
-
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(1e3).optional().nullable(),
|
|
130
|
-
cursor: z.string().describe(
|
|
131
|
-
"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."
|
|
132
|
-
).max(16e3).optional().nullable()
|
|
133
|
-
}).describe(
|
|
134
|
-
"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`."
|
|
135
|
-
)
|
|
136
|
-
})
|
|
137
|
-
])
|
|
138
|
-
).describe("Query to select benefit items."),
|
|
139
|
-
options: z.object({
|
|
140
|
-
fields: z.array(
|
|
141
|
-
z.enum(["POOL", "PROGRAM", "PROGRAM_DEFINITION", "ITEM", "BENEFIT"])
|
|
142
|
-
).max(5).optional()
|
|
143
|
-
}).optional()
|
|
144
|
-
});
|
|
145
|
-
var QueryPoolItemsResponse = z.object({
|
|
146
|
-
poolItems: z.array(
|
|
147
|
-
z.object({
|
|
148
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
149
|
-
/^[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}$/,
|
|
150
|
-
"Must be a valid GUID"
|
|
151
|
-
).optional(),
|
|
152
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
153
|
-
"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."
|
|
154
|
-
).optional().nullable(),
|
|
155
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
156
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
157
|
-
externalId: z.string().describe(
|
|
158
|
-
"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."
|
|
159
|
-
).regex(
|
|
160
|
-
/^[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}$/,
|
|
161
|
-
"Must be a valid GUID"
|
|
162
|
-
).optional(),
|
|
163
|
-
category: z.string().describe(
|
|
164
|
-
"Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups."
|
|
165
|
-
).max(20).optional(),
|
|
166
|
-
providerAppId: z.string().describe(
|
|
167
|
-
"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."
|
|
168
|
-
).regex(
|
|
169
|
-
/^[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}$/,
|
|
170
|
-
"Must be a valid GUID"
|
|
171
|
-
).optional(),
|
|
172
|
-
namespace: z.string().describe(
|
|
173
|
-
"Module name of the item provider's application that originated the items.\n\nFor example, `store-inventory` or `fitness-resources`."
|
|
174
|
-
).min(1).max(20).optional(),
|
|
175
|
-
poolId: z.string().describe("Pool id").regex(
|
|
176
|
-
/^[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}$/,
|
|
177
|
-
"Must be a valid GUID"
|
|
178
|
-
).optional(),
|
|
179
|
-
programId: z.string().describe("Program id").regex(
|
|
180
|
-
/^[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}$/,
|
|
181
|
-
"Must be a valid GUID"
|
|
182
|
-
).optional().nullable(),
|
|
183
|
-
externalProgramId: z.string().describe("Program external id").regex(
|
|
184
|
-
/^[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}$/,
|
|
185
|
-
"Must be a valid GUID"
|
|
186
|
-
).optional().nullable(),
|
|
187
|
-
programDefinitionId: z.string().describe("Program definition id").regex(
|
|
188
|
-
/^[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}$/,
|
|
189
|
-
"Must be a valid GUID"
|
|
190
|
-
).optional().nullable(),
|
|
191
|
-
externalProgramDefinitionId: z.string().describe("Program definition external id").regex(
|
|
192
|
-
/^[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}$/,
|
|
193
|
-
"Must be a valid GUID"
|
|
194
|
-
).optional().nullable(),
|
|
195
|
-
poolDefinitionId: z.string().describe("Pool definition id").regex(
|
|
196
|
-
/^[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}$/,
|
|
197
|
-
"Must be a valid GUID"
|
|
198
|
-
).optional().nullable(),
|
|
199
|
-
itemSetId: z.string().describe("Item set ID.").regex(
|
|
200
|
-
/^[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}$/,
|
|
201
|
-
"Must be a valid GUID"
|
|
202
|
-
).optional(),
|
|
203
|
-
beneficiary: z.intersection(
|
|
204
|
-
z.object({}),
|
|
205
|
-
z.xor([
|
|
206
|
-
z.object({
|
|
207
|
-
anonymousVisitorId: z.never().optional(),
|
|
208
|
-
memberId: z.never().optional(),
|
|
209
|
-
wixUserId: z.never().optional()
|
|
210
|
-
}),
|
|
211
|
-
z.object({
|
|
212
|
-
memberId: z.never().optional(),
|
|
213
|
-
wixUserId: z.never().optional(),
|
|
214
|
-
anonymousVisitorId: z.string().describe(
|
|
215
|
-
"ID of a site visitor that hasn't logged in to the site."
|
|
216
|
-
).regex(
|
|
217
|
-
/^[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}$/,
|
|
218
|
-
"Must be a valid GUID"
|
|
219
|
-
)
|
|
220
|
-
}),
|
|
221
|
-
z.object({
|
|
222
|
-
anonymousVisitorId: z.never().optional(),
|
|
223
|
-
wixUserId: z.never().optional(),
|
|
224
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
225
|
-
/^[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}$/,
|
|
226
|
-
"Must be a valid GUID"
|
|
227
|
-
)
|
|
228
|
-
}),
|
|
229
|
-
z.object({
|
|
230
|
-
anonymousVisitorId: z.never().optional(),
|
|
231
|
-
memberId: z.never().optional(),
|
|
232
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
233
|
-
/^[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}$/,
|
|
234
|
-
"Must be a valid GUID"
|
|
235
|
-
)
|
|
236
|
-
})
|
|
237
|
-
])
|
|
238
|
-
).describe("Who is getting the benefit").optional(),
|
|
239
|
-
itemId: z.string().describe("Item set ID.").regex(
|
|
240
|
-
/^[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}$/,
|
|
241
|
-
"Must be a valid GUID"
|
|
242
|
-
).optional(),
|
|
243
|
-
benefitKey: z.string().describe(
|
|
244
|
-
"Unique identifier for the benefit associated with this item."
|
|
245
|
-
).max(64).optional(),
|
|
246
|
-
itemReferenceSearchKey: z.string().describe(
|
|
247
|
-
`Search key for the item reference, which is a unique identifier for searching and referencing the item within the provider's system.
|
|
248
|
-
It's build by concatenating the following fields in this order, separated by a separator (e.g., "/"):
|
|
249
|
-
- providerAppId
|
|
250
|
-
- category
|
|
251
|
-
- externalId`
|
|
252
|
-
).max(94).optional()
|
|
253
|
-
})
|
|
254
|
-
).optional(),
|
|
255
|
-
metadata: z.object({
|
|
256
|
-
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
257
|
-
cursors: z.object({
|
|
258
|
-
next: z.string().describe(
|
|
259
|
-
"Cursor string pointing to the next page in the list of results."
|
|
260
|
-
).max(16e3).optional().nullable(),
|
|
261
|
-
prev: z.string().describe(
|
|
262
|
-
"Cursor pointing to the previous page in the list of results."
|
|
263
|
-
).max(16e3).optional().nullable()
|
|
264
|
-
}).describe(
|
|
265
|
-
"Cursor strings that point to the next page, previous page, or both."
|
|
266
|
-
).optional(),
|
|
267
|
-
hasNext: z.boolean().describe(
|
|
268
|
-
"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."
|
|
269
|
-
).optional().nullable()
|
|
270
|
-
}).describe("Metadata for paginated results.").optional()
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
// src/benefit-programs-v1-pool-item-pool-items.universal.ts
|
|
274
99
|
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
275
100
|
var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
|
|
276
101
|
IdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
@@ -347,10 +172,7 @@ function queryPoolItems2(options) {
|
|
|
347
172
|
});
|
|
348
173
|
}
|
|
349
174
|
async function typedQueryPoolItems(query, options) {
|
|
350
|
-
const { httpClient, sideEffects
|
|
351
|
-
if (validateRequestSchema) {
|
|
352
|
-
QueryPoolItemsRequest.parse({ query, options });
|
|
353
|
-
}
|
|
175
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
354
176
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
355
177
|
query,
|
|
356
178
|
...options
|