@wix/auto_sdk_benefit-programs_pool-definition-items 1.0.10 → 1.0.12
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 +150 -39
- package/build/cjs/index.typings.js +2 -0
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +123 -22
- 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 +150 -39
- package/build/es/index.typings.mjs +2 -0
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +123 -22
- 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 +128 -48
- 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 +123 -22
- 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 +128 -48
- 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 +123 -22
- 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,48 +56,48 @@ 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
|
-
*
|
|
80
|
-
*
|
|
74
|
+
* Pool definition details including display name, description, and credit settings. Only populated when
|
|
75
|
+
* POOL_DEFINITION is included in the fields request parameter.
|
|
81
76
|
* @readonly
|
|
82
77
|
*/
|
|
83
78
|
poolDefinition?: PoolDefinitionInfo;
|
|
84
79
|
/**
|
|
85
|
-
* Program definitions
|
|
86
|
-
*
|
|
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.
|
|
87
82
|
* @maxSize 20
|
|
88
83
|
* @readonly
|
|
89
84
|
*/
|
|
90
85
|
programDefinitions?: ProgramDefinitionInfo[];
|
|
91
86
|
/**
|
|
92
|
-
* Item
|
|
87
|
+
* Item ID.
|
|
93
88
|
* @format GUID
|
|
94
89
|
* @immutable
|
|
95
90
|
* @readonly
|
|
96
91
|
*/
|
|
97
92
|
itemId?: string;
|
|
98
93
|
/**
|
|
99
|
-
*
|
|
100
|
-
*
|
|
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.
|
|
101
96
|
* @readonly
|
|
102
97
|
*/
|
|
103
98
|
benefitInfo?: BenefitInfo;
|
|
104
99
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @internal
|
|
100
|
+
* Display name for the catalog item. Only populated when ITEM is included in the fields request parameter.
|
|
107
101
|
* @readonly
|
|
108
102
|
*/
|
|
109
103
|
itemInfo?: ItemInfo;
|
|
@@ -114,6 +108,14 @@ interface PoolDefinitionItem {
|
|
|
114
108
|
* @readonly
|
|
115
109
|
*/
|
|
116
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;
|
|
117
119
|
}
|
|
118
120
|
interface PoolDefinitionInfo {
|
|
119
121
|
/**
|
|
@@ -126,16 +128,12 @@ interface PoolDefinitionInfo {
|
|
|
126
128
|
* @maxLength 450
|
|
127
129
|
*/
|
|
128
130
|
description?: string | null;
|
|
129
|
-
/**
|
|
130
|
-
* Credit settings.
|
|
131
|
-
*
|
|
132
|
-
* If this object is empty, you can't set a price for the benefit.
|
|
133
|
-
*/
|
|
131
|
+
/** Credit configuration for this pool definition. When absent, benefits in this pool do not support credit-based pricing. */
|
|
134
132
|
creditConfiguration?: CreditConfiguration;
|
|
135
133
|
}
|
|
136
134
|
interface CreditConfiguration {
|
|
137
135
|
/**
|
|
138
|
-
*
|
|
136
|
+
* Number of credits initially granted to a subscriber when this pool definition's benefits are activated.
|
|
139
137
|
* @decimalValue options { gte:0, maxScale:4 }
|
|
140
138
|
*/
|
|
141
139
|
amount?: string;
|
|
@@ -146,7 +144,6 @@ interface CreditConfiguration {
|
|
|
146
144
|
unitDisplayName?: string | null;
|
|
147
145
|
/**
|
|
148
146
|
* Credit unit type.
|
|
149
|
-
* @internal
|
|
150
147
|
* @maxLength 16
|
|
151
148
|
*/
|
|
152
149
|
unitType?: string | null;
|
|
@@ -193,14 +190,19 @@ interface BenefitInfo {
|
|
|
193
190
|
interface ItemInfo {
|
|
194
191
|
/**
|
|
195
192
|
* Item display name.
|
|
196
|
-
* @maxLength
|
|
193
|
+
* @maxLength 400
|
|
197
194
|
*/
|
|
198
195
|
displayName?: string | null;
|
|
199
196
|
}
|
|
197
|
+
/** Deprecated: use PoolDefinitionItemRemoved instead. Will be removed after clients are migrated. */
|
|
200
198
|
interface PoolDefinitionItemDeactivated {
|
|
201
199
|
/** The pool definition item that was deactivated. */
|
|
202
200
|
poolDefinitionItem?: PoolDefinitionItem;
|
|
203
201
|
}
|
|
202
|
+
interface PoolDefinitionItemRemoved {
|
|
203
|
+
/** The pool definition item that was removed from the benefit. */
|
|
204
|
+
poolDefinitionItem?: PoolDefinitionItem;
|
|
205
|
+
}
|
|
204
206
|
interface QueryPoolDefinitionItemsRequest {
|
|
205
207
|
/** Query to select benefit items. */
|
|
206
208
|
query?: CursorQuery;
|
|
@@ -265,9 +267,13 @@ interface CursorPaging {
|
|
|
265
267
|
cursor?: string | null;
|
|
266
268
|
}
|
|
267
269
|
declare enum RequestedFields {
|
|
270
|
+
/** Populates the pool_definition field with display name, description, and credit configuration. */
|
|
268
271
|
POOL_DEFINITION = "POOL_DEFINITION",
|
|
272
|
+
/** Populates the program_definitions field with display_name and description. */
|
|
269
273
|
PROGRAM_DEFINITION = "PROGRAM_DEFINITION",
|
|
274
|
+
/** Populates the benefit_info field with credit price, name, and description. */
|
|
270
275
|
BENEFIT = "BENEFIT",
|
|
276
|
+
/** Populates the item_info field with the catalog item's display name. */
|
|
271
277
|
ITEM = "ITEM"
|
|
272
278
|
}
|
|
273
279
|
/** @enumType */
|
|
@@ -349,6 +355,47 @@ interface ItemReference {
|
|
|
349
355
|
category?: string;
|
|
350
356
|
}
|
|
351
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;
|
|
352
399
|
}
|
|
353
400
|
interface AddItemsToBenefitRequest {
|
|
354
401
|
/**
|
|
@@ -369,6 +416,17 @@ interface AddItemsToBenefitRequest {
|
|
|
369
416
|
benefitKey: string;
|
|
370
417
|
}
|
|
371
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;
|
|
372
430
|
}
|
|
373
431
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
374
432
|
createdEvent?: EntityCreatedEvent;
|
|
@@ -523,6 +581,18 @@ interface AccountInfo {
|
|
|
523
581
|
*/
|
|
524
582
|
siteId?: string | null;
|
|
525
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
|
+
};
|
|
526
596
|
/**
|
|
527
597
|
* Creates a query to retrieve a list of poolDefinitionItems.
|
|
528
598
|
*
|
|
@@ -565,54 +635,54 @@ interface PoolDefinitionItemsQueryBuilder {
|
|
|
565
635
|
* @param value - Value to compare against.
|
|
566
636
|
* @documentationMaturity preview
|
|
567
637
|
*/
|
|
568
|
-
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;
|
|
569
639
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
570
640
|
* @param value - Value to compare against.
|
|
571
641
|
* @documentationMaturity preview
|
|
572
642
|
*/
|
|
573
|
-
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;
|
|
574
644
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
575
645
|
* @param value - Value to compare against.
|
|
576
646
|
* @documentationMaturity preview
|
|
577
647
|
*/
|
|
578
|
-
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;
|
|
579
649
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
580
650
|
* @param value - Value to compare against.
|
|
581
651
|
* @documentationMaturity preview
|
|
582
652
|
*/
|
|
583
|
-
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;
|
|
584
654
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
585
655
|
* @param value - Value to compare against.
|
|
586
656
|
* @documentationMaturity preview
|
|
587
657
|
*/
|
|
588
|
-
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;
|
|
589
659
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
590
660
|
* @param value - Value to compare against.
|
|
591
661
|
* @documentationMaturity preview
|
|
592
662
|
*/
|
|
593
|
-
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;
|
|
594
664
|
/** @param propertyName - Property whose value is compared with `string`.
|
|
595
665
|
* @param string - String to compare against. Case-insensitive.
|
|
596
666
|
* @documentationMaturity preview
|
|
597
667
|
*/
|
|
598
|
-
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;
|
|
599
669
|
/** @param propertyName - Property whose value is compared with `values`.
|
|
600
670
|
* @param values - List of values to compare against.
|
|
601
671
|
* @documentationMaturity preview
|
|
602
672
|
*/
|
|
603
|
-
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;
|
|
604
674
|
/** @documentationMaturity preview */
|
|
605
|
-
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;
|
|
606
676
|
/** @documentationMaturity preview */
|
|
607
|
-
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;
|
|
608
678
|
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
609
679
|
* @documentationMaturity preview
|
|
610
680
|
*/
|
|
611
|
-
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;
|
|
612
682
|
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
613
683
|
* @documentationMaturity preview
|
|
614
684
|
*/
|
|
615
|
-
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;
|
|
616
686
|
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
617
687
|
* @documentationMaturity preview
|
|
618
688
|
*/
|
|
@@ -629,7 +699,7 @@ interface PoolDefinitionItemsQueryBuilder {
|
|
|
629
699
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems
|
|
630
700
|
* @requiredField query
|
|
631
701
|
*/
|
|
632
|
-
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>>;
|
|
633
703
|
interface PoolDefinitionItemQuerySpec extends QuerySpec {
|
|
634
704
|
paging: 'cursor';
|
|
635
705
|
wql: [
|
|
@@ -645,6 +715,7 @@ interface PoolDefinitionItemQuerySpec extends QuerySpec {
|
|
|
645
715
|
'benefitKey',
|
|
646
716
|
'category',
|
|
647
717
|
'externalId',
|
|
718
|
+
'itemReferenceSearchKey',
|
|
648
719
|
'itemSetId',
|
|
649
720
|
'namespace',
|
|
650
721
|
'poolDefinitionId',
|
|
@@ -709,7 +780,9 @@ declare const utils: {
|
|
|
709
780
|
};
|
|
710
781
|
};
|
|
711
782
|
/**
|
|
712
|
-
* 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`.
|
|
713
786
|
* @param itemReferences - Items to remove from the benefit's item set.
|
|
714
787
|
* @public
|
|
715
788
|
* @documentationMaturity preview
|
|
@@ -722,7 +795,9 @@ declare const utils: {
|
|
|
722
795
|
* @applicableIdentity APP
|
|
723
796
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit
|
|
724
797
|
*/
|
|
725
|
-
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
|
+
}>;
|
|
726
801
|
interface RemoveItemsFromBenefitOptions {
|
|
727
802
|
/**
|
|
728
803
|
* ID of the pool definition associated with the benefit.
|
|
@@ -736,7 +811,10 @@ interface RemoveItemsFromBenefitOptions {
|
|
|
736
811
|
benefitKey: string;
|
|
737
812
|
}
|
|
738
813
|
/**
|
|
739
|
-
*
|
|
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.
|
|
740
818
|
* @param itemReferences - Items to add to the benefit's item set.
|
|
741
819
|
* @public
|
|
742
820
|
* @documentationMaturity preview
|
|
@@ -749,7 +827,9 @@ interface RemoveItemsFromBenefitOptions {
|
|
|
749
827
|
* @applicableIdentity APP
|
|
750
828
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit
|
|
751
829
|
*/
|
|
752
|
-
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
|
+
}>;
|
|
753
833
|
interface AddItemsToBenefitOptions {
|
|
754
834
|
/**
|
|
755
835
|
* ID of the pool definition associated with the benefit.
|
|
@@ -763,4 +843,4 @@ interface AddItemsToBenefitOptions {
|
|
|
763
843
|
benefitKey: string;
|
|
764
844
|
}
|
|
765
845
|
|
|
766
|
-
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 };
|
|
@@ -256,6 +256,7 @@ async function removeItemsFromBenefit2(itemReferences, options) {
|
|
|
256
256
|
try {
|
|
257
257
|
const result = await httpClient.request(reqOpts);
|
|
258
258
|
sideEffects?.onSuccess?.(result);
|
|
259
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
259
260
|
} catch (err) {
|
|
260
261
|
const transformedError = (0, import_transform_error.transformError)(
|
|
261
262
|
err,
|
|
@@ -286,6 +287,7 @@ async function addItemsToBenefit2(itemReferences, options) {
|
|
|
286
287
|
try {
|
|
287
288
|
const result = await httpClient.request(reqOpts);
|
|
288
289
|
sideEffects?.onSuccess?.(result);
|
|
290
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
289
291
|
} catch (err) {
|
|
290
292
|
const transformedError = (0, import_transform_error.transformError)(
|
|
291
293
|
err,
|