@wix/auto_sdk_benefit-programs_pool-definition-items 1.0.10 → 1.0.11
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 +16 -7
- package/build/cjs/index.js +2 -0
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +149 -38
- package/build/cjs/index.typings.js +2 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +122 -21
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +62 -2
- package/build/cjs/schemas.js +131 -11
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +16 -7
- package/build/es/index.mjs +2 -0
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +149 -38
- package/build/es/index.typings.mjs +2 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +122 -21
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +62 -2
- package/build/es/schemas.mjs +131 -11
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +16 -7
- package/build/internal/cjs/index.js +2 -0
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +127 -47
- package/build/internal/cjs/index.typings.js +2 -0
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +122 -21
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +62 -2
- package/build/internal/cjs/schemas.js +131 -11
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +16 -7
- package/build/internal/es/index.mjs +2 -0
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +127 -47
- package/build/internal/es/index.typings.mjs +2 -0
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +122 -21
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +62 -2
- package/build/internal/es/schemas.mjs +131 -11
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -3,16 +3,13 @@ import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
|
|
|
3
3
|
|
|
4
4
|
interface PoolDefinitionItem {
|
|
5
5
|
/**
|
|
6
|
-
* Benefit item ID.
|
|
6
|
+
* Benefit item ID. Deterministically generated from pool_definition_id and item_id — if you know both, you can compute the ID without querying.
|
|
7
7
|
* @format GUID
|
|
8
8
|
* @readonly
|
|
9
9
|
*/
|
|
10
10
|
_id?: string;
|
|
11
11
|
/**
|
|
12
12
|
* Revision number, which increments by 1 each time the benefit item is updated.
|
|
13
|
-
* To prevent conflicting changes, the current revision must be passed when updating the item.
|
|
14
|
-
*
|
|
15
|
-
* Ignored when creating an item.
|
|
16
13
|
* @readonly
|
|
17
14
|
*/
|
|
18
15
|
revision?: string | null;
|
|
@@ -29,7 +26,7 @@ interface PoolDefinitionItem {
|
|
|
29
26
|
/**
|
|
30
27
|
* External item ID assigned by the provider of the items.
|
|
31
28
|
*
|
|
32
|
-
* For example, if the benefit items are products, this ID corresponds to the specific product ID in the
|
|
29
|
+
* For example, if the benefit items are products, this ID corresponds to the specific product ID in the provider's system.
|
|
33
30
|
* @format GUID
|
|
34
31
|
* @immutable
|
|
35
32
|
* @readonly
|
|
@@ -43,18 +40,15 @@ interface PoolDefinitionItem {
|
|
|
43
40
|
*/
|
|
44
41
|
category?: string;
|
|
45
42
|
/**
|
|
46
|
-
* ID of the application providing the benefit item.
|
|
47
|
-
*
|
|
48
|
-
* ID of the external application supplying the items. Each item's external ID is unique to its respective provider's application.
|
|
43
|
+
* ID of the application providing the benefit items. Each item's external_id is unique within its provider application.
|
|
49
44
|
* @format GUID
|
|
50
45
|
* @immutable
|
|
51
46
|
* @readonly
|
|
52
47
|
*/
|
|
53
48
|
providerAppId?: string;
|
|
54
49
|
/**
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
* For example, `store-inventory` or `fitness-resources`.
|
|
50
|
+
* Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you
|
|
51
|
+
* created and entities that other apps created.
|
|
58
52
|
* @minLength 1
|
|
59
53
|
* @maxLength 20
|
|
60
54
|
* @immutable
|
|
@@ -62,26 +56,51 @@ interface PoolDefinitionItem {
|
|
|
62
56
|
*/
|
|
63
57
|
namespace?: string;
|
|
64
58
|
/**
|
|
65
|
-
*
|
|
59
|
+
* ID of the pool definition - the configuration that defines a set of benefits and which items are accessible within each benefit.
|
|
66
60
|
* @format GUID
|
|
67
61
|
* @immutable
|
|
68
62
|
* @readonly
|
|
69
63
|
*/
|
|
70
64
|
poolDefinitionId?: string;
|
|
71
65
|
/**
|
|
72
|
-
*
|
|
66
|
+
* Internal grouping identifier for this benefit's item set. Use pool_definition_id together with benefit_key
|
|
67
|
+
* to identify a benefit — item_set_id is an implementation detail.
|
|
73
68
|
* @format GUID
|
|
74
69
|
* @immutable
|
|
75
70
|
* @readonly
|
|
76
71
|
*/
|
|
77
72
|
itemSetId?: string;
|
|
78
73
|
/**
|
|
79
|
-
*
|
|
74
|
+
* Pool definition details including display name, description, and credit settings. Only populated when
|
|
75
|
+
* POOL_DEFINITION is included in the fields request parameter.
|
|
76
|
+
* @readonly
|
|
77
|
+
*/
|
|
78
|
+
poolDefinition?: PoolDefinitionInfo;
|
|
79
|
+
/**
|
|
80
|
+
* Program definitions that include this item as an accessible benefit. Only id and external_id are
|
|
81
|
+
* returned by default; request PROGRAM_DEFINITION to include display_name and description.
|
|
82
|
+
* @maxSize 20
|
|
83
|
+
* @readonly
|
|
84
|
+
*/
|
|
85
|
+
programDefinitions?: ProgramDefinitionInfo[];
|
|
86
|
+
/**
|
|
87
|
+
* Item ID.
|
|
80
88
|
* @format GUID
|
|
81
89
|
* @immutable
|
|
82
90
|
* @readonly
|
|
83
91
|
*/
|
|
84
92
|
itemId?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Pricing and display information for the associated benefit, including credit price, name, and description.
|
|
95
|
+
* Only populated when BENEFIT is included in the fields request parameter.
|
|
96
|
+
* @readonly
|
|
97
|
+
*/
|
|
98
|
+
benefitInfo?: BenefitInfo;
|
|
99
|
+
/**
|
|
100
|
+
* Display name for the catalog item. Only populated when ITEM is included in the fields request parameter.
|
|
101
|
+
* @readonly
|
|
102
|
+
*/
|
|
103
|
+
itemInfo?: ItemInfo;
|
|
85
104
|
/**
|
|
86
105
|
* Unique identifier for the benefit associated with this item.
|
|
87
106
|
* @maxLength 64
|
|
@@ -89,6 +108,14 @@ interface PoolDefinitionItem {
|
|
|
89
108
|
* @readonly
|
|
90
109
|
*/
|
|
91
110
|
benefitKey?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Pre-computed search key for the item reference, built by concatenating provider_app_id, category, and external_id
|
|
113
|
+
* separated by /. Use this field for efficient single-field filtering instead of composing three separate conditions.
|
|
114
|
+
* @maxLength 94
|
|
115
|
+
* @immutable
|
|
116
|
+
* @readonly
|
|
117
|
+
*/
|
|
118
|
+
itemReferenceSearchKey?: string;
|
|
92
119
|
}
|
|
93
120
|
interface PoolDefinitionInfo {
|
|
94
121
|
/**
|
|
@@ -101,16 +128,12 @@ interface PoolDefinitionInfo {
|
|
|
101
128
|
* @maxLength 450
|
|
102
129
|
*/
|
|
103
130
|
description?: string | null;
|
|
104
|
-
/**
|
|
105
|
-
* Credit settings.
|
|
106
|
-
*
|
|
107
|
-
* If this object is empty, you can't set a price for the benefit.
|
|
108
|
-
*/
|
|
131
|
+
/** Credit configuration for this pool definition. When absent, benefits in this pool do not support credit-based pricing. */
|
|
109
132
|
creditConfiguration?: CreditConfiguration;
|
|
110
133
|
}
|
|
111
134
|
interface CreditConfiguration {
|
|
112
135
|
/**
|
|
113
|
-
*
|
|
136
|
+
* Number of credits initially granted to a subscriber when this pool definition's benefits are activated.
|
|
114
137
|
* @decimalValue options { gte:0, maxScale:4 }
|
|
115
138
|
*/
|
|
116
139
|
amount?: string;
|
|
@@ -119,6 +142,11 @@ interface CreditConfiguration {
|
|
|
119
142
|
* @maxLength 32
|
|
120
143
|
*/
|
|
121
144
|
unitDisplayName?: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Credit unit type.
|
|
147
|
+
* @maxLength 16
|
|
148
|
+
*/
|
|
149
|
+
unitType?: string | null;
|
|
122
150
|
}
|
|
123
151
|
interface ProgramDefinitionInfo {
|
|
124
152
|
/**
|
|
@@ -166,10 +194,15 @@ interface ItemInfo {
|
|
|
166
194
|
*/
|
|
167
195
|
displayName?: string | null;
|
|
168
196
|
}
|
|
197
|
+
/** Deprecated: use PoolDefinitionItemRemoved instead. Will be removed after clients are migrated. */
|
|
169
198
|
interface PoolDefinitionItemDeactivated {
|
|
170
199
|
/** The pool definition item that was deactivated. */
|
|
171
200
|
poolDefinitionItem?: PoolDefinitionItem;
|
|
172
201
|
}
|
|
202
|
+
interface PoolDefinitionItemRemoved {
|
|
203
|
+
/** The pool definition item that was removed from the benefit. */
|
|
204
|
+
poolDefinitionItem?: PoolDefinitionItem;
|
|
205
|
+
}
|
|
173
206
|
interface QueryPoolDefinitionItemsRequest {
|
|
174
207
|
/** Query to select benefit items. */
|
|
175
208
|
query?: CursorQuery;
|
|
@@ -234,9 +267,13 @@ interface CursorPaging {
|
|
|
234
267
|
cursor?: string | null;
|
|
235
268
|
}
|
|
236
269
|
declare enum RequestedFields {
|
|
270
|
+
/** Populates the pool_definition field with display name, description, and credit configuration. */
|
|
237
271
|
POOL_DEFINITION = "POOL_DEFINITION",
|
|
272
|
+
/** Populates the program_definitions field with display_name and description. */
|
|
238
273
|
PROGRAM_DEFINITION = "PROGRAM_DEFINITION",
|
|
274
|
+
/** Populates the benefit_info field with credit price, name, and description. */
|
|
239
275
|
BENEFIT = "BENEFIT",
|
|
276
|
+
/** Populates the item_info field with the catalog item's display name. */
|
|
240
277
|
ITEM = "ITEM"
|
|
241
278
|
}
|
|
242
279
|
/** @enumType */
|
|
@@ -318,6 +355,47 @@ interface ItemReference {
|
|
|
318
355
|
category?: string;
|
|
319
356
|
}
|
|
320
357
|
interface RemoveItemsFromBenefitResponse {
|
|
358
|
+
/**
|
|
359
|
+
* Per-item results aligned 1:1 with `item_references` from the request — `item_metadata.original_index` always
|
|
360
|
+
* refers to the position in the request. Item references that did not match any registered item appear here as
|
|
361
|
+
* failures with `item_metadata.error.code` set to `NOT_FOUND`.
|
|
362
|
+
*/
|
|
363
|
+
results?: BulkRemoveItemResult[];
|
|
364
|
+
/** Aggregate counts (successes, failures) for the bulk operation. Unresolved item references are counted as failures. */
|
|
365
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
366
|
+
}
|
|
367
|
+
interface BulkRemoveItemResult {
|
|
368
|
+
/** Outcome metadata for a single item — includes the underlying item ID, success flag, and error details on failure. */
|
|
369
|
+
itemMetadata?: ItemMetadata;
|
|
370
|
+
}
|
|
371
|
+
interface ItemMetadata {
|
|
372
|
+
/**
|
|
373
|
+
* Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).
|
|
374
|
+
* @format GUID
|
|
375
|
+
*/
|
|
376
|
+
_id?: string | null;
|
|
377
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
378
|
+
originalIndex?: number;
|
|
379
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
380
|
+
success?: boolean;
|
|
381
|
+
/** Details about the error in case of failure. */
|
|
382
|
+
error?: ApplicationError;
|
|
383
|
+
}
|
|
384
|
+
interface ApplicationError {
|
|
385
|
+
/** Error code. */
|
|
386
|
+
code?: string;
|
|
387
|
+
/** Description of the error. */
|
|
388
|
+
description?: string;
|
|
389
|
+
/** Data related to the error. */
|
|
390
|
+
data?: Record<string, any> | null;
|
|
391
|
+
}
|
|
392
|
+
interface BulkActionMetadata {
|
|
393
|
+
/** Number of items that were successfully processed. */
|
|
394
|
+
totalSuccesses?: number;
|
|
395
|
+
/** Number of items that couldn't be processed. */
|
|
396
|
+
totalFailures?: number;
|
|
397
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
398
|
+
undetailedFailures?: number;
|
|
321
399
|
}
|
|
322
400
|
interface AddItemsToBenefitRequest {
|
|
323
401
|
/**
|
|
@@ -338,6 +416,17 @@ interface AddItemsToBenefitRequest {
|
|
|
338
416
|
benefitKey: string;
|
|
339
417
|
}
|
|
340
418
|
interface AddItemsToBenefitResponse {
|
|
419
|
+
/** Per-item results — `item_metadata.original_index` corresponds to the order of `item_references` in the request. */
|
|
420
|
+
results?: BulkAddItemResult[];
|
|
421
|
+
/** Aggregate counts (successes, failures) for the bulk operation. */
|
|
422
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
423
|
+
}
|
|
424
|
+
interface BulkAddItemResult {
|
|
425
|
+
/**
|
|
426
|
+
* Outcome metadata for the catalog item created in the underlying item service. The item ID here is the Item entity
|
|
427
|
+
* ID — PoolDefinitionItem records are created asynchronously and their IDs are not returned in this response.
|
|
428
|
+
*/
|
|
429
|
+
itemMetadata?: ItemMetadata;
|
|
341
430
|
}
|
|
342
431
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
343
432
|
createdEvent?: EntityCreatedEvent;
|
|
@@ -492,6 +581,18 @@ interface AccountInfo {
|
|
|
492
581
|
*/
|
|
493
582
|
siteId?: string | null;
|
|
494
583
|
}
|
|
584
|
+
/** @docsIgnore */
|
|
585
|
+
type RemoveItemsFromBenefitApplicationErrors = {
|
|
586
|
+
code?: 'POOL_DEFINITION_BENEFIT_NOT_FOUND';
|
|
587
|
+
description?: string;
|
|
588
|
+
data?: Record<string, any>;
|
|
589
|
+
};
|
|
590
|
+
/** @docsIgnore */
|
|
591
|
+
type AddItemsToBenefitApplicationErrors = {
|
|
592
|
+
code?: 'POOL_DEFINITION_BENEFIT_NOT_FOUND';
|
|
593
|
+
description?: string;
|
|
594
|
+
data?: Record<string, any>;
|
|
595
|
+
};
|
|
495
596
|
/**
|
|
496
597
|
* Creates a query to retrieve a list of poolDefinitionItems.
|
|
497
598
|
*
|
|
@@ -534,54 +635,54 @@ interface PoolDefinitionItemsQueryBuilder {
|
|
|
534
635
|
* @param value - Value to compare against.
|
|
535
636
|
* @documentationMaturity preview
|
|
536
637
|
*/
|
|
537
|
-
eq: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
638
|
+
eq: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
538
639
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
539
640
|
* @param value - Value to compare against.
|
|
540
641
|
* @documentationMaturity preview
|
|
541
642
|
*/
|
|
542
|
-
ne: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
643
|
+
ne: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
543
644
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
544
645
|
* @param value - Value to compare against.
|
|
545
646
|
* @documentationMaturity preview
|
|
546
647
|
*/
|
|
547
|
-
ge: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
648
|
+
ge: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
548
649
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
549
650
|
* @param value - Value to compare against.
|
|
550
651
|
* @documentationMaturity preview
|
|
551
652
|
*/
|
|
552
|
-
gt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
653
|
+
gt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
553
654
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
554
655
|
* @param value - Value to compare against.
|
|
555
656
|
* @documentationMaturity preview
|
|
556
657
|
*/
|
|
557
|
-
le: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
658
|
+
le: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
558
659
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
559
660
|
* @param value - Value to compare against.
|
|
560
661
|
* @documentationMaturity preview
|
|
561
662
|
*/
|
|
562
|
-
lt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
663
|
+
lt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
563
664
|
/** @param propertyName - Property whose value is compared with `string`.
|
|
564
665
|
* @param string - String to compare against. Case-insensitive.
|
|
565
666
|
* @documentationMaturity preview
|
|
566
667
|
*/
|
|
567
|
-
startsWith: (propertyName: '_id' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: string) => PoolDefinitionItemsQueryBuilder;
|
|
668
|
+
startsWith: (propertyName: '_id' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: string) => PoolDefinitionItemsQueryBuilder;
|
|
568
669
|
/** @param propertyName - Property whose value is compared with `values`.
|
|
569
670
|
* @param values - List of values to compare against.
|
|
570
671
|
* @documentationMaturity preview
|
|
571
672
|
*/
|
|
572
|
-
hasSome: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any[]) => PoolDefinitionItemsQueryBuilder;
|
|
673
|
+
hasSome: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any[]) => PoolDefinitionItemsQueryBuilder;
|
|
573
674
|
/** @documentationMaturity preview */
|
|
574
|
-
in: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
675
|
+
in: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
575
676
|
/** @documentationMaturity preview */
|
|
576
|
-
exists: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: boolean) => PoolDefinitionItemsQueryBuilder;
|
|
677
|
+
exists: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: boolean) => PoolDefinitionItemsQueryBuilder;
|
|
577
678
|
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
578
679
|
* @documentationMaturity preview
|
|
579
680
|
*/
|
|
580
|
-
ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
681
|
+
ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
581
682
|
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
582
683
|
* @documentationMaturity preview
|
|
583
684
|
*/
|
|
584
|
-
descending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
685
|
+
descending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
585
686
|
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
586
687
|
* @documentationMaturity preview
|
|
587
688
|
*/
|
|
@@ -598,7 +699,7 @@ interface PoolDefinitionItemsQueryBuilder {
|
|
|
598
699
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems
|
|
599
700
|
* @requiredField query
|
|
600
701
|
*/
|
|
601
|
-
declare function typedQueryPoolDefinitionItems(query: PoolDefinitionItemQuery, options?: QueryPoolDefinitionItemsOptions): Promise<NonNullablePaths<QueryPoolDefinitionItemsResponse, `poolDefinitionItems` | `poolDefinitionItems.${number}._id` | `poolDefinitionItems.${number}.externalId` | `poolDefinitionItems.${number}.category` | `poolDefinitionItems.${number}.providerAppId` | `poolDefinitionItems.${number}.namespace` | `poolDefinitionItems.${number}.poolDefinitionId` | `poolDefinitionItems.${number}.itemSetId` | `poolDefinitionItems.${number}.itemId` | `poolDefinitionItems.${number}.benefitKey`,
|
|
702
|
+
declare function typedQueryPoolDefinitionItems(query: PoolDefinitionItemQuery, options?: QueryPoolDefinitionItemsOptions): Promise<NonNullablePaths<QueryPoolDefinitionItemsResponse, `poolDefinitionItems` | `poolDefinitionItems.${number}._id` | `poolDefinitionItems.${number}.externalId` | `poolDefinitionItems.${number}.category` | `poolDefinitionItems.${number}.providerAppId` | `poolDefinitionItems.${number}.namespace` | `poolDefinitionItems.${number}.poolDefinitionId` | `poolDefinitionItems.${number}.itemSetId` | `poolDefinitionItems.${number}.poolDefinition.displayName` | `poolDefinitionItems.${number}.poolDefinition.creditConfiguration.amount` | `poolDefinitionItems.${number}.itemId` | `poolDefinitionItems.${number}.benefitKey` | `poolDefinitionItems.${number}.itemReferenceSearchKey`, 6>>;
|
|
602
703
|
interface PoolDefinitionItemQuerySpec extends QuerySpec {
|
|
603
704
|
paging: 'cursor';
|
|
604
705
|
wql: [
|
|
@@ -614,6 +715,7 @@ interface PoolDefinitionItemQuerySpec extends QuerySpec {
|
|
|
614
715
|
'benefitKey',
|
|
615
716
|
'category',
|
|
616
717
|
'externalId',
|
|
718
|
+
'itemReferenceSearchKey',
|
|
617
719
|
'itemSetId',
|
|
618
720
|
'namespace',
|
|
619
721
|
'poolDefinitionId',
|
|
@@ -678,7 +780,9 @@ declare const utils: {
|
|
|
678
780
|
};
|
|
679
781
|
};
|
|
680
782
|
/**
|
|
681
|
-
* Removes items from a benefit
|
|
783
|
+
* Removes items from a benefit. Items are removed asynchronously — they may briefly still appear in
|
|
784
|
+
* QueryPoolDefinitionItems results after the call returns.
|
|
785
|
+
* Item references not matching any registered item appear in results as per-item failures with `item_metadata.error.code` set to `NOT_FOUND`.
|
|
682
786
|
* @param itemReferences - Items to remove from the benefit's item set.
|
|
683
787
|
* @public
|
|
684
788
|
* @documentationMaturity preview
|
|
@@ -691,7 +795,9 @@ declare const utils: {
|
|
|
691
795
|
* @applicableIdentity APP
|
|
692
796
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit
|
|
693
797
|
*/
|
|
694
|
-
declare function removeItemsFromBenefit(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<RemoveItemsFromBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<
|
|
798
|
+
declare function removeItemsFromBenefit(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<RemoveItemsFromBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<NonNullablePaths<RemoveItemsFromBenefitResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6> & {
|
|
799
|
+
__applicationErrorsType?: RemoveItemsFromBenefitApplicationErrors;
|
|
800
|
+
}>;
|
|
695
801
|
interface RemoveItemsFromBenefitOptions {
|
|
696
802
|
/**
|
|
697
803
|
* ID of the pool definition associated with the benefit.
|
|
@@ -705,7 +811,10 @@ interface RemoveItemsFromBenefitOptions {
|
|
|
705
811
|
benefitKey: string;
|
|
706
812
|
}
|
|
707
813
|
/**
|
|
708
|
-
*
|
|
814
|
+
* Registers items with a benefit. This is an eventually consistent operation — items may take a short time to appear
|
|
815
|
+
* in QueryPoolDefinitionItems results after the call returns. Uses a partial success model — items already registered
|
|
816
|
+
* with the benefit return a per-item error in results.item_metadata while successfully added items are unaffected.
|
|
817
|
+
* Check bulk_action_metadata for overall counts and results for per-item outcomes.
|
|
709
818
|
* @param itemReferences - Items to add to the benefit's item set.
|
|
710
819
|
* @public
|
|
711
820
|
* @documentationMaturity preview
|
|
@@ -718,7 +827,9 @@ interface RemoveItemsFromBenefitOptions {
|
|
|
718
827
|
* @applicableIdentity APP
|
|
719
828
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit
|
|
720
829
|
*/
|
|
721
|
-
declare function addItemsToBenefit(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<AddItemsToBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<
|
|
830
|
+
declare function addItemsToBenefit(itemReferences: NonNullablePaths<ItemReference, `externalId`, 2>[], options: NonNullablePaths<AddItemsToBenefitOptions, `benefitKey` | `poolDefinitionId`, 2>): Promise<NonNullablePaths<AddItemsToBenefitResponse, `results` | `results.${number}.itemMetadata.originalIndex` | `results.${number}.itemMetadata.success` | `results.${number}.itemMetadata.error.code` | `results.${number}.itemMetadata.error.description` | `bulkActionMetadata.totalSuccesses` | `bulkActionMetadata.totalFailures` | `bulkActionMetadata.undetailedFailures`, 6> & {
|
|
831
|
+
__applicationErrorsType?: AddItemsToBenefitApplicationErrors;
|
|
832
|
+
}>;
|
|
722
833
|
interface AddItemsToBenefitOptions {
|
|
723
834
|
/**
|
|
724
835
|
* ID of the pool definition associated with the benefit.
|
|
@@ -732,4 +843,4 @@ interface AddItemsToBenefitOptions {
|
|
|
732
843
|
benefitKey: string;
|
|
733
844
|
}
|
|
734
845
|
|
|
735
|
-
export { type AccountInfo, type ActionEvent, type AddItemsToBenefitOptions, type AddItemsToBenefitRequest, type AddItemsToBenefitResponse, type BenefitInfo, type CommonQueryWithEntityContext, type CreditConfiguration, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IdentificationData, type IdentificationDataIdOneOf, type InvalidatePoolDefinitionItemsRequest, type InvalidatePoolDefinitionItemsResponse, type ItemInfo, type ItemReference, type MessageEnvelope, type PoolDefinitionInfo, type PoolDefinitionItem, type PoolDefinitionItemDeactivated, type PoolDefinitionItemQuery, type PoolDefinitionItemQuerySpec, type PoolDefinitionItemsQueryBuilder, type PoolDefinitionItemsQueryResult, type ProgramDefinitionInfo, type QueryPoolDefinitionItemsOptions, type QueryPoolDefinitionItemsRequest, type QueryPoolDefinitionItemsResponse, type RemoveItemsFromBenefitOptions, type RemoveItemsFromBenefitRequest, type RemoveItemsFromBenefitResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addItemsToBenefit, queryPoolDefinitionItems, removeItemsFromBenefit, typedQueryPoolDefinitionItems, utils };
|
|
846
|
+
export { type AccountInfo, type ActionEvent, type AddItemsToBenefitApplicationErrors, type AddItemsToBenefitOptions, type AddItemsToBenefitRequest, type AddItemsToBenefitResponse, type ApplicationError, type BenefitInfo, type BulkActionMetadata, type BulkAddItemResult, type BulkRemoveItemResult, type CommonQueryWithEntityContext, type CreditConfiguration, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IdentificationData, type IdentificationDataIdOneOf, type InvalidatePoolDefinitionItemsRequest, type InvalidatePoolDefinitionItemsResponse, type ItemInfo, type ItemMetadata, type ItemReference, type MessageEnvelope, type PoolDefinitionInfo, type PoolDefinitionItem, type PoolDefinitionItemDeactivated, type PoolDefinitionItemQuery, type PoolDefinitionItemQuerySpec, type PoolDefinitionItemRemoved, type PoolDefinitionItemsQueryBuilder, type PoolDefinitionItemsQueryResult, type ProgramDefinitionInfo, type QueryPoolDefinitionItemsOptions, type QueryPoolDefinitionItemsRequest, type QueryPoolDefinitionItemsResponse, type RemoveItemsFromBenefitApplicationErrors, type RemoveItemsFromBenefitOptions, type RemoveItemsFromBenefitRequest, type RemoveItemsFromBenefitResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addItemsToBenefit, queryPoolDefinitionItems, removeItemsFromBenefit, typedQueryPoolDefinitionItems, utils };
|
|
@@ -226,6 +226,7 @@ async function removeItemsFromBenefit2(itemReferences, options) {
|
|
|
226
226
|
try {
|
|
227
227
|
const result = await httpClient.request(reqOpts);
|
|
228
228
|
sideEffects?.onSuccess?.(result);
|
|
229
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
229
230
|
} catch (err) {
|
|
230
231
|
const transformedError = sdkTransformError(
|
|
231
232
|
err,
|
|
@@ -256,6 +257,7 @@ async function addItemsToBenefit2(itemReferences, options) {
|
|
|
256
257
|
try {
|
|
257
258
|
const result = await httpClient.request(reqOpts);
|
|
258
259
|
sideEffects?.onSuccess?.(result);
|
|
260
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
259
261
|
} catch (err) {
|
|
260
262
|
const transformedError = sdkTransformError(
|
|
261
263
|
err,
|