@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,79 +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
|
-
*
|
|
117
|
+
* Pool details, including display name and description.
|
|
118
|
+
*
|
|
119
|
+
* Returned only when `POOL` is included in the `fields` request parameter.
|
|
120
|
+
* @readonly
|
|
121
|
+
*/
|
|
122
|
+
pool?: PoolInfo;
|
|
123
|
+
/**
|
|
124
|
+
* Program details — `id`, `externalId`, and `displayName`.
|
|
125
|
+
*
|
|
126
|
+
* Returned only when `PROGRAM` is included in the `fields` request parameter.
|
|
127
|
+
* @readonly
|
|
128
|
+
*/
|
|
129
|
+
program?: ProgramInfo;
|
|
130
|
+
/**
|
|
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.
|
|
134
|
+
* @readonly
|
|
135
|
+
*/
|
|
136
|
+
programDefinition?: ProgramDefinitionInfo;
|
|
137
|
+
/**
|
|
138
|
+
* Item ID.
|
|
120
139
|
* @format GUID
|
|
121
140
|
* @immutable
|
|
122
141
|
* @readonly
|
|
123
142
|
*/
|
|
124
143
|
itemId?: string;
|
|
125
144
|
/**
|
|
126
|
-
*
|
|
145
|
+
* Display name for the catalog item.
|
|
146
|
+
*
|
|
147
|
+
* Returned only when `ITEM` is included in the `fields` request parameter.
|
|
148
|
+
* @readonly
|
|
149
|
+
*/
|
|
150
|
+
itemInfo?: ItemInfo;
|
|
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.
|
|
155
|
+
* @readonly
|
|
156
|
+
*/
|
|
157
|
+
benefitInfo?: BenefitInfo;
|
|
158
|
+
/**
|
|
159
|
+
* Unique identifier for the benefit that grants access to this item.
|
|
127
160
|
* @maxLength 64
|
|
128
161
|
* @immutable
|
|
129
162
|
* @readonly
|
|
130
163
|
*/
|
|
131
164
|
benefitKey?: string;
|
|
132
165
|
/**
|
|
133
|
-
*
|
|
134
|
-
* It's build by concatenating the following fields in this order, separated by a separator (e.g., "/"):
|
|
135
|
-
* - providerAppId
|
|
136
|
-
* - category
|
|
137
|
-
* - 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.
|
|
138
167
|
* @maxLength 94
|
|
139
168
|
* @immutable
|
|
140
169
|
* @readonly
|
|
@@ -188,11 +217,10 @@ declare enum IdentityType {
|
|
|
188
217
|
}
|
|
189
218
|
/** @enumType */
|
|
190
219
|
type IdentityTypeWithLiterals = IdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER';
|
|
220
|
+
/** Pool's display details. */
|
|
191
221
|
interface PoolInfo {
|
|
192
222
|
/**
|
|
193
|
-
* Pool name.
|
|
194
|
-
*
|
|
195
|
-
* 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.
|
|
196
224
|
* @maxLength 64
|
|
197
225
|
*/
|
|
198
226
|
displayName?: string;
|
|
@@ -202,36 +230,38 @@ interface PoolInfo {
|
|
|
202
230
|
*/
|
|
203
231
|
description?: string | null;
|
|
204
232
|
}
|
|
233
|
+
/** Program's identifying details. */
|
|
205
234
|
interface ProgramInfo {
|
|
206
235
|
/**
|
|
207
|
-
* Program
|
|
236
|
+
* Program ID.
|
|
208
237
|
* @format GUID
|
|
209
238
|
*/
|
|
210
239
|
_id?: string;
|
|
211
240
|
/**
|
|
212
|
-
*
|
|
241
|
+
* External program ID assigned by the provider.
|
|
213
242
|
* @format GUID
|
|
214
243
|
*/
|
|
215
244
|
externalId?: string | null;
|
|
216
245
|
/**
|
|
217
|
-
* Program name.
|
|
246
|
+
* Program's display name.
|
|
218
247
|
* @maxLength 64
|
|
219
248
|
*/
|
|
220
249
|
displayName?: string | null;
|
|
221
250
|
}
|
|
251
|
+
/** Program definition's display details. */
|
|
222
252
|
interface ProgramDefinitionInfo {
|
|
223
253
|
/**
|
|
224
|
-
* Program definition
|
|
254
|
+
* Program definition ID.
|
|
225
255
|
* @format GUID
|
|
226
256
|
*/
|
|
227
257
|
_id?: string;
|
|
228
258
|
/**
|
|
229
|
-
*
|
|
259
|
+
* External program definition ID assigned by the provider.
|
|
230
260
|
* @format GUID
|
|
231
261
|
*/
|
|
232
262
|
externalId?: string | null;
|
|
233
263
|
/**
|
|
234
|
-
* Program definition name
|
|
264
|
+
* Program definition's display name.
|
|
235
265
|
* @maxLength 64
|
|
236
266
|
*/
|
|
237
267
|
displayName?: string | null;
|
|
@@ -241,26 +271,30 @@ interface ProgramDefinitionInfo {
|
|
|
241
271
|
*/
|
|
242
272
|
description?: string | null;
|
|
243
273
|
}
|
|
274
|
+
/** Catalog item's display details. */
|
|
244
275
|
interface ItemInfo {
|
|
245
276
|
/**
|
|
246
|
-
* Item display name.
|
|
277
|
+
* Item's display name.
|
|
247
278
|
* @maxLength 64
|
|
248
279
|
*/
|
|
249
280
|
displayName?: string | null;
|
|
250
281
|
}
|
|
282
|
+
/** Pricing and display information for a benefit. */
|
|
251
283
|
interface BenefitInfo {
|
|
252
284
|
/**
|
|
253
|
-
*
|
|
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.
|
|
254
288
|
* @decimalValue options { gte:0, maxScale:4 }
|
|
255
289
|
*/
|
|
256
290
|
price?: string | null;
|
|
257
291
|
/**
|
|
258
|
-
* Unique identifier for this benefit.
|
|
292
|
+
* Unique identifier for this benefit. Same value as `poolItem.benefitKey`.
|
|
259
293
|
* @maxLength 64
|
|
260
294
|
*/
|
|
261
295
|
benefitKey?: string;
|
|
262
296
|
/**
|
|
263
|
-
* Benefit name.
|
|
297
|
+
* Benefit's display name.
|
|
264
298
|
* @maxLength 40
|
|
265
299
|
*/
|
|
266
300
|
displayName?: string | null;
|
|
@@ -270,15 +304,21 @@ interface BenefitInfo {
|
|
|
270
304
|
*/
|
|
271
305
|
description?: string | null;
|
|
272
306
|
}
|
|
307
|
+
/** Deprecated: use `PoolItemRemoved` instead. Will be removed on 2026-05-31 after clients have migrated. */
|
|
273
308
|
interface PoolItemDeactivated {
|
|
274
|
-
/**
|
|
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. */
|
|
275
315
|
poolItem?: PoolItem;
|
|
276
316
|
}
|
|
277
317
|
interface QueryPoolItemsRequest {
|
|
278
|
-
/** Query
|
|
318
|
+
/** Query options. */
|
|
279
319
|
query?: CursorQuery;
|
|
280
320
|
/**
|
|
281
|
-
*
|
|
321
|
+
* Optional enrichments to include in the response.
|
|
282
322
|
* @maxSize 5
|
|
283
323
|
*/
|
|
284
324
|
fields?: RequestedFieldsWithLiterals[];
|
|
@@ -338,18 +378,23 @@ interface CursorPaging {
|
|
|
338
378
|
cursor?: string | null;
|
|
339
379
|
}
|
|
340
380
|
declare enum RequestedFields {
|
|
381
|
+
/** Populates the `pool` field with the pool's display name and description. */
|
|
341
382
|
POOL = "POOL",
|
|
383
|
+
/** Populates the `program` field with the program's display name. */
|
|
342
384
|
PROGRAM = "PROGRAM",
|
|
385
|
+
/** Populates the `programDefinition` field with the program definition's display name and description. */
|
|
343
386
|
PROGRAM_DEFINITION = "PROGRAM_DEFINITION",
|
|
387
|
+
/** Populates the `itemInfo` field with the catalog item's display name. */
|
|
344
388
|
ITEM = "ITEM",
|
|
389
|
+
/** Populates the `benefitInfo` field with the benefit's credit price, name, and description. */
|
|
345
390
|
BENEFIT = "BENEFIT"
|
|
346
391
|
}
|
|
347
392
|
/** @enumType */
|
|
348
393
|
type RequestedFieldsWithLiterals = RequestedFields | 'POOL' | 'PROGRAM' | 'PROGRAM_DEFINITION' | 'ITEM' | 'BENEFIT';
|
|
349
394
|
interface QueryPoolItemsResponse {
|
|
350
|
-
/** List of items. */
|
|
395
|
+
/** List of retrieved pool items. */
|
|
351
396
|
poolItems?: PoolItem[];
|
|
352
|
-
/**
|
|
397
|
+
/** Paging metadata. */
|
|
353
398
|
metadata?: CursorPagingMetadata;
|
|
354
399
|
}
|
|
355
400
|
interface CursorPagingMetadata {
|
|
@@ -379,12 +424,12 @@ interface Cursors {
|
|
|
379
424
|
}
|
|
380
425
|
interface InvalidatePoolItemsRequest {
|
|
381
426
|
/**
|
|
382
|
-
*
|
|
427
|
+
* ID of the pool whose items are invalidated.
|
|
383
428
|
* @format GUID
|
|
384
429
|
*/
|
|
385
430
|
poolId?: string;
|
|
386
431
|
/**
|
|
387
|
-
*
|
|
432
|
+
* IDs of the item sets to invalidate. When empty, items for all benefits in the pool are invalidated.
|
|
388
433
|
* @maxSize 10
|
|
389
434
|
* @format GUID
|
|
390
435
|
*/
|
|
@@ -546,11 +591,20 @@ interface AccountInfo {
|
|
|
546
591
|
siteId?: string | null;
|
|
547
592
|
}
|
|
548
593
|
/**
|
|
549
|
-
* 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`
|
|
550
604
|
*
|
|
551
|
-
*
|
|
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).
|
|
552
606
|
*
|
|
553
|
-
*
|
|
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).
|
|
554
608
|
* @public
|
|
555
609
|
* @documentationMaturity preview
|
|
556
610
|
* @permissionId benefit_programs:v1:pool_item:query_pool_items
|
|
@@ -561,7 +615,7 @@ interface AccountInfo {
|
|
|
561
615
|
declare function queryPoolItems(options?: QueryPoolItemsOptions): PoolItemsQueryBuilder;
|
|
562
616
|
interface QueryPoolItemsOptions {
|
|
563
617
|
/**
|
|
564
|
-
*
|
|
618
|
+
* Optional enrichments to include in the response.
|
|
565
619
|
* @maxSize 5
|
|
566
620
|
*/
|
|
567
621
|
fields?: RequestedFieldsWithLiterals[] | undefined;
|
|
@@ -648,7 +702,7 @@ interface PoolItemsQueryBuilder {
|
|
|
648
702
|
* @fqn wix.benefit_programs.v1.pool_item.PoolItemService.QueryPoolItems
|
|
649
703
|
* @requiredField query
|
|
650
704
|
*/
|
|
651
|
-
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>>;
|
|
652
706
|
interface PoolItemQuerySpec extends QuerySpec {
|
|
653
707
|
paging: 'cursor';
|
|
654
708
|
wql: [
|
|
@@ -730,4 +784,4 @@ declare const utils: {
|
|
|
730
784
|
};
|
|
731
785
|
};
|
|
732
786
|
|
|
733
|
-
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
|