@wix/auto_sdk_benefit-programs_pool-definition-items 1.0.9 → 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 +21 -7
- package/build/cjs/index.js +149 -2
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +323 -26
- package/build/cjs/index.typings.js +123 -2
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +124 -22
- package/build/cjs/meta.js +52 -0
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +114 -3
- package/build/cjs/schemas.js +223 -2
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +21 -7
- package/build/es/index.mjs +150 -2
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +323 -26
- package/build/es/index.typings.mjs +123 -2
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +124 -22
- package/build/es/meta.mjs +51 -0
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +114 -3
- package/build/es/schemas.mjs +221 -2
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +21 -7
- package/build/internal/cjs/index.js +149 -2
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +301 -35
- package/build/internal/cjs/index.typings.js +123 -2
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +124 -22
- package/build/internal/cjs/meta.js +52 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +114 -3
- package/build/internal/cjs/schemas.js +223 -2
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +21 -7
- package/build/internal/es/index.mjs +150 -2
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +301 -35
- package/build/internal/es/index.typings.mjs +123 -2
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +124 -22
- package/build/internal/es/meta.mjs +51 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +114 -3
- package/build/internal/es/schemas.mjs +221 -2
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,17 +1,15 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as _wix_sdk_types from '@wix/sdk-types';
|
|
2
|
+
import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
|
|
2
3
|
|
|
3
4
|
interface PoolDefinitionItem {
|
|
4
5
|
/**
|
|
5
|
-
* 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.
|
|
6
7
|
* @format GUID
|
|
7
8
|
* @readonly
|
|
8
9
|
*/
|
|
9
10
|
_id?: string;
|
|
10
11
|
/**
|
|
11
12
|
* Revision number, which increments by 1 each time the benefit item is updated.
|
|
12
|
-
* To prevent conflicting changes, the current revision must be passed when updating the item.
|
|
13
|
-
*
|
|
14
|
-
* Ignored when creating an item.
|
|
15
13
|
* @readonly
|
|
16
14
|
*/
|
|
17
15
|
revision?: string | null;
|
|
@@ -28,7 +26,7 @@ interface PoolDefinitionItem {
|
|
|
28
26
|
/**
|
|
29
27
|
* External item ID assigned by the provider of the items.
|
|
30
28
|
*
|
|
31
|
-
* 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.
|
|
32
30
|
* @format GUID
|
|
33
31
|
* @immutable
|
|
34
32
|
* @readonly
|
|
@@ -42,18 +40,15 @@ interface PoolDefinitionItem {
|
|
|
42
40
|
*/
|
|
43
41
|
category?: string;
|
|
44
42
|
/**
|
|
45
|
-
* ID of the application providing the benefit item.
|
|
46
|
-
*
|
|
47
|
-
* 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.
|
|
48
44
|
* @format GUID
|
|
49
45
|
* @immutable
|
|
50
46
|
* @readonly
|
|
51
47
|
*/
|
|
52
48
|
providerAppId?: string;
|
|
53
49
|
/**
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* 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.
|
|
57
52
|
* @minLength 1
|
|
58
53
|
* @maxLength 20
|
|
59
54
|
* @immutable
|
|
@@ -61,48 +56,48 @@ interface PoolDefinitionItem {
|
|
|
61
56
|
*/
|
|
62
57
|
namespace?: string;
|
|
63
58
|
/**
|
|
64
|
-
*
|
|
59
|
+
* ID of the pool definition - the configuration that defines a set of benefits and which items are accessible within each benefit.
|
|
65
60
|
* @format GUID
|
|
66
61
|
* @immutable
|
|
67
62
|
* @readonly
|
|
68
63
|
*/
|
|
69
64
|
poolDefinitionId?: string;
|
|
70
65
|
/**
|
|
71
|
-
*
|
|
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.
|
|
72
68
|
* @format GUID
|
|
73
69
|
* @immutable
|
|
74
70
|
* @readonly
|
|
75
71
|
*/
|
|
76
72
|
itemSetId?: string;
|
|
77
73
|
/**
|
|
78
|
-
*
|
|
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.
|
|
80
76
|
* @readonly
|
|
81
77
|
*/
|
|
82
78
|
poolDefinition?: PoolDefinitionInfo;
|
|
83
79
|
/**
|
|
84
|
-
* Program definitions
|
|
85
|
-
*
|
|
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.
|
|
86
82
|
* @maxSize 20
|
|
87
83
|
* @readonly
|
|
88
84
|
*/
|
|
89
85
|
programDefinitions?: ProgramDefinitionInfo[];
|
|
90
86
|
/**
|
|
91
|
-
* Item
|
|
87
|
+
* Item ID.
|
|
92
88
|
* @format GUID
|
|
93
89
|
* @immutable
|
|
94
90
|
* @readonly
|
|
95
91
|
*/
|
|
96
92
|
itemId?: string;
|
|
97
93
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
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.
|
|
100
96
|
* @readonly
|
|
101
97
|
*/
|
|
102
98
|
benefitInfo?: BenefitInfo;
|
|
103
99
|
/**
|
|
104
|
-
*
|
|
105
|
-
* @internal
|
|
100
|
+
* Display name for the catalog item. Only populated when ITEM is included in the fields request parameter.
|
|
106
101
|
* @readonly
|
|
107
102
|
*/
|
|
108
103
|
itemInfo?: ItemInfo;
|
|
@@ -113,6 +108,14 @@ interface PoolDefinitionItem {
|
|
|
113
108
|
* @readonly
|
|
114
109
|
*/
|
|
115
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;
|
|
116
119
|
}
|
|
117
120
|
interface PoolDefinitionInfo {
|
|
118
121
|
/**
|
|
@@ -125,16 +128,12 @@ interface PoolDefinitionInfo {
|
|
|
125
128
|
* @maxLength 450
|
|
126
129
|
*/
|
|
127
130
|
description?: string | null;
|
|
128
|
-
/**
|
|
129
|
-
* Credit settings.
|
|
130
|
-
*
|
|
131
|
-
* If this object is empty, you can't set a price for the benefit.
|
|
132
|
-
*/
|
|
131
|
+
/** Credit configuration for this pool definition. When absent, benefits in this pool do not support credit-based pricing. */
|
|
133
132
|
creditConfiguration?: CreditConfiguration;
|
|
134
133
|
}
|
|
135
134
|
interface CreditConfiguration {
|
|
136
135
|
/**
|
|
137
|
-
*
|
|
136
|
+
* Number of credits initially granted to a subscriber when this pool definition's benefits are activated.
|
|
138
137
|
* @decimalValue options { gte:0, maxScale:4 }
|
|
139
138
|
*/
|
|
140
139
|
amount?: string;
|
|
@@ -145,7 +144,6 @@ interface CreditConfiguration {
|
|
|
145
144
|
unitDisplayName?: string | null;
|
|
146
145
|
/**
|
|
147
146
|
* Credit unit type.
|
|
148
|
-
* @internal
|
|
149
147
|
* @maxLength 16
|
|
150
148
|
*/
|
|
151
149
|
unitType?: string | null;
|
|
@@ -196,10 +194,15 @@ interface ItemInfo {
|
|
|
196
194
|
*/
|
|
197
195
|
displayName?: string | null;
|
|
198
196
|
}
|
|
197
|
+
/** Deprecated: use PoolDefinitionItemRemoved instead. Will be removed after clients are migrated. */
|
|
199
198
|
interface PoolDefinitionItemDeactivated {
|
|
200
199
|
/** The pool definition item that was deactivated. */
|
|
201
200
|
poolDefinitionItem?: PoolDefinitionItem;
|
|
202
201
|
}
|
|
202
|
+
interface PoolDefinitionItemRemoved {
|
|
203
|
+
/** The pool definition item that was removed from the benefit. */
|
|
204
|
+
poolDefinitionItem?: PoolDefinitionItem;
|
|
205
|
+
}
|
|
203
206
|
interface QueryPoolDefinitionItemsRequest {
|
|
204
207
|
/** Query to select benefit items. */
|
|
205
208
|
query?: CursorQuery;
|
|
@@ -264,9 +267,13 @@ interface CursorPaging {
|
|
|
264
267
|
cursor?: string | null;
|
|
265
268
|
}
|
|
266
269
|
declare enum RequestedFields {
|
|
270
|
+
/** Populates the pool_definition field with display name, description, and credit configuration. */
|
|
267
271
|
POOL_DEFINITION = "POOL_DEFINITION",
|
|
272
|
+
/** Populates the program_definitions field with display_name and description. */
|
|
268
273
|
PROGRAM_DEFINITION = "PROGRAM_DEFINITION",
|
|
274
|
+
/** Populates the benefit_info field with credit price, name, and description. */
|
|
269
275
|
BENEFIT = "BENEFIT",
|
|
276
|
+
/** Populates the item_info field with the catalog item's display name. */
|
|
270
277
|
ITEM = "ITEM"
|
|
271
278
|
}
|
|
272
279
|
/** @enumType */
|
|
@@ -348,6 +355,47 @@ interface ItemReference {
|
|
|
348
355
|
category?: string;
|
|
349
356
|
}
|
|
350
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;
|
|
351
399
|
}
|
|
352
400
|
interface AddItemsToBenefitRequest {
|
|
353
401
|
/**
|
|
@@ -368,6 +416,17 @@ interface AddItemsToBenefitRequest {
|
|
|
368
416
|
benefitKey: string;
|
|
369
417
|
}
|
|
370
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;
|
|
371
430
|
}
|
|
372
431
|
interface DomainEvent extends DomainEventBodyOneOf {
|
|
373
432
|
createdEvent?: EntityCreatedEvent;
|
|
@@ -522,8 +581,208 @@ interface AccountInfo {
|
|
|
522
581
|
*/
|
|
523
582
|
siteId?: string | null;
|
|
524
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
|
+
};
|
|
596
|
+
/**
|
|
597
|
+
* Creates a query to retrieve a list of poolDefinitionItems.
|
|
598
|
+
*
|
|
599
|
+
* The `queryPoolDefinitionItems()` method builds a query to retrieve a list of poolDefinitionItems and returns a `PoolDefinitionItemsQueryBuilder` object.
|
|
600
|
+
*
|
|
601
|
+
* The returned object contains the query definition, which is used to run the query using the [`find()`](/poolDefinitionItems/poolDefinitionItems-query-builder/find) function.
|
|
602
|
+
*
|
|
603
|
+
* You can refine the query by chaining `PoolDefinitionItemsQueryBuilder` methods onto the query. `PoolDefinitionItemsQueryBuilder` methods enable you to filter, sort, and control the results that `queryPoolDefinitionItems()` returns.
|
|
604
|
+
*
|
|
605
|
+
* The following `PoolDefinitionItemsQueryBuilder` functions are supported for `queryPoolDefinitionItems()`. For a full description of the item object, see the object returned for the [`poolDefinitionItems`](/poolDefinitionItems/poolDefinitionItems-query-result/poolDefinitionItems) property in `PoolDefinitionItemsQueryResult`.
|
|
606
|
+
* @public
|
|
607
|
+
* @documentationMaturity preview
|
|
608
|
+
* @permissionId benefit_programs:v1:pool_definition_item:query_pool_definition_items
|
|
609
|
+
* @applicableIdentity APP
|
|
610
|
+
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems
|
|
611
|
+
*/
|
|
612
|
+
declare function queryPoolDefinitionItems(options?: QueryPoolDefinitionItemsOptions): PoolDefinitionItemsQueryBuilder;
|
|
613
|
+
interface QueryPoolDefinitionItemsOptions {
|
|
614
|
+
/**
|
|
615
|
+
* Fields to be included in the response.
|
|
616
|
+
* @maxSize 4
|
|
617
|
+
*/
|
|
618
|
+
fields?: RequestedFieldsWithLiterals[] | undefined;
|
|
619
|
+
}
|
|
620
|
+
interface QueryCursorResult {
|
|
621
|
+
cursors: Cursors;
|
|
622
|
+
hasNext: () => boolean;
|
|
623
|
+
hasPrev: () => boolean;
|
|
624
|
+
length: number;
|
|
625
|
+
pageSize: number;
|
|
626
|
+
}
|
|
627
|
+
interface PoolDefinitionItemsQueryResult extends QueryCursorResult {
|
|
628
|
+
items: PoolDefinitionItem[];
|
|
629
|
+
query: PoolDefinitionItemsQueryBuilder;
|
|
630
|
+
next: () => Promise<PoolDefinitionItemsQueryResult>;
|
|
631
|
+
prev: () => Promise<PoolDefinitionItemsQueryResult>;
|
|
632
|
+
}
|
|
633
|
+
interface PoolDefinitionItemsQueryBuilder {
|
|
634
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
635
|
+
* @param value - Value to compare against.
|
|
636
|
+
* @documentationMaturity preview
|
|
637
|
+
*/
|
|
638
|
+
eq: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
639
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
640
|
+
* @param value - Value to compare against.
|
|
641
|
+
* @documentationMaturity preview
|
|
642
|
+
*/
|
|
643
|
+
ne: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
644
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
645
|
+
* @param value - Value to compare against.
|
|
646
|
+
* @documentationMaturity preview
|
|
647
|
+
*/
|
|
648
|
+
ge: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
649
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
650
|
+
* @param value - Value to compare against.
|
|
651
|
+
* @documentationMaturity preview
|
|
652
|
+
*/
|
|
653
|
+
gt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
654
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
655
|
+
* @param value - Value to compare against.
|
|
656
|
+
* @documentationMaturity preview
|
|
657
|
+
*/
|
|
658
|
+
le: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
659
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
660
|
+
* @param value - Value to compare against.
|
|
661
|
+
* @documentationMaturity preview
|
|
662
|
+
*/
|
|
663
|
+
lt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
664
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
665
|
+
* @param string - String to compare against. Case-insensitive.
|
|
666
|
+
* @documentationMaturity preview
|
|
667
|
+
*/
|
|
668
|
+
startsWith: (propertyName: '_id' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: string) => PoolDefinitionItemsQueryBuilder;
|
|
669
|
+
/** @param propertyName - Property whose value is compared with `values`.
|
|
670
|
+
* @param values - List of values to compare against.
|
|
671
|
+
* @documentationMaturity preview
|
|
672
|
+
*/
|
|
673
|
+
hasSome: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any[]) => PoolDefinitionItemsQueryBuilder;
|
|
674
|
+
/** @documentationMaturity preview */
|
|
675
|
+
in: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
676
|
+
/** @documentationMaturity preview */
|
|
677
|
+
exists: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey', value: boolean) => PoolDefinitionItemsQueryBuilder;
|
|
678
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
679
|
+
* @documentationMaturity preview
|
|
680
|
+
*/
|
|
681
|
+
ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
682
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
683
|
+
* @documentationMaturity preview
|
|
684
|
+
*/
|
|
685
|
+
descending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey' | 'itemReferenceSearchKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
686
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
687
|
+
* @documentationMaturity preview
|
|
688
|
+
*/
|
|
689
|
+
limit: (limit: number) => PoolDefinitionItemsQueryBuilder;
|
|
690
|
+
/** @param cursor - A pointer to specific record
|
|
691
|
+
* @documentationMaturity preview
|
|
692
|
+
*/
|
|
693
|
+
skipTo: (cursor: string) => PoolDefinitionItemsQueryBuilder;
|
|
694
|
+
/** @documentationMaturity preview */
|
|
695
|
+
find: () => Promise<PoolDefinitionItemsQueryResult>;
|
|
696
|
+
}
|
|
697
|
+
/**
|
|
698
|
+
* @hidden
|
|
699
|
+
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems
|
|
700
|
+
* @requiredField query
|
|
701
|
+
*/
|
|
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>>;
|
|
703
|
+
interface PoolDefinitionItemQuerySpec extends QuerySpec {
|
|
704
|
+
paging: 'cursor';
|
|
705
|
+
wql: [
|
|
706
|
+
{
|
|
707
|
+
fields: ['programDefinitions._id', 'programDefinitions.externalId'];
|
|
708
|
+
operators: ['$hasAll', '$hasSome'];
|
|
709
|
+
sort: 'BOTH';
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
fields: [
|
|
713
|
+
'_createdDate',
|
|
714
|
+
'_id',
|
|
715
|
+
'benefitKey',
|
|
716
|
+
'category',
|
|
717
|
+
'externalId',
|
|
718
|
+
'itemReferenceSearchKey',
|
|
719
|
+
'itemSetId',
|
|
720
|
+
'namespace',
|
|
721
|
+
'poolDefinitionId',
|
|
722
|
+
'providerAppId'
|
|
723
|
+
];
|
|
724
|
+
operators: '*';
|
|
725
|
+
sort: 'BOTH';
|
|
726
|
+
}
|
|
727
|
+
];
|
|
728
|
+
}
|
|
729
|
+
type CommonQueryWithEntityContext = Query<PoolDefinitionItem, PoolDefinitionItemQuerySpec>;
|
|
730
|
+
type PoolDefinitionItemQuery = {
|
|
731
|
+
/**
|
|
732
|
+
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`.
|
|
733
|
+
*/
|
|
734
|
+
cursorPaging?: {
|
|
735
|
+
/**
|
|
736
|
+
Maximum number of items to return in the results.
|
|
737
|
+
@max: 1000
|
|
738
|
+
*/
|
|
739
|
+
limit?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit'] | null;
|
|
740
|
+
/**
|
|
741
|
+
Pointer to the next or previous page in the list of results.
|
|
742
|
+
|
|
743
|
+
Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
744
|
+
Not relevant for the first request.
|
|
745
|
+
@maxLength: 16000
|
|
746
|
+
*/
|
|
747
|
+
cursor?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor'] | null;
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
Filter object in the following format:
|
|
751
|
+
`"filter" : {
|
|
752
|
+
"fieldName1": "value1",
|
|
753
|
+
"fieldName2":{"$operator":"value2"}
|
|
754
|
+
}`
|
|
755
|
+
Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
756
|
+
*/
|
|
757
|
+
filter?: CommonQueryWithEntityContext['filter'] | null;
|
|
758
|
+
/**
|
|
759
|
+
Sort object in the following format:
|
|
760
|
+
`[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
761
|
+
@maxSize: 5
|
|
762
|
+
*/
|
|
763
|
+
sort?: {
|
|
764
|
+
/**
|
|
765
|
+
Name of the field to sort by.
|
|
766
|
+
@maxLength: 512
|
|
767
|
+
*/
|
|
768
|
+
fieldName?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['fieldName'];
|
|
769
|
+
/**
|
|
770
|
+
Sort order.
|
|
771
|
+
*/
|
|
772
|
+
order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
|
|
773
|
+
}[];
|
|
774
|
+
};
|
|
775
|
+
declare const utils: {
|
|
776
|
+
query: {
|
|
777
|
+
QueryBuilder: () => _wix_sdk_types.QueryBuilder<PoolDefinitionItem, PoolDefinitionItemQuerySpec, PoolDefinitionItemQuery>;
|
|
778
|
+
Filter: _wix_sdk_types.FilterFactory<PoolDefinitionItem, PoolDefinitionItemQuerySpec>;
|
|
779
|
+
Sort: _wix_sdk_types.SortFactory<PoolDefinitionItemQuerySpec>;
|
|
780
|
+
};
|
|
781
|
+
};
|
|
525
782
|
/**
|
|
526
|
-
* 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`.
|
|
527
786
|
* @param itemReferences - Items to remove from the benefit's item set.
|
|
528
787
|
* @public
|
|
529
788
|
* @documentationMaturity preview
|
|
@@ -536,7 +795,9 @@ interface AccountInfo {
|
|
|
536
795
|
* @applicableIdentity APP
|
|
537
796
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.RemoveItemsFromBenefit
|
|
538
797
|
*/
|
|
539
|
-
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
|
+
}>;
|
|
540
801
|
interface RemoveItemsFromBenefitOptions {
|
|
541
802
|
/**
|
|
542
803
|
* ID of the pool definition associated with the benefit.
|
|
@@ -550,7 +811,10 @@ interface RemoveItemsFromBenefitOptions {
|
|
|
550
811
|
benefitKey: string;
|
|
551
812
|
}
|
|
552
813
|
/**
|
|
553
|
-
*
|
|
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.
|
|
554
818
|
* @param itemReferences - Items to add to the benefit's item set.
|
|
555
819
|
* @public
|
|
556
820
|
* @documentationMaturity preview
|
|
@@ -563,7 +827,9 @@ interface RemoveItemsFromBenefitOptions {
|
|
|
563
827
|
* @applicableIdentity APP
|
|
564
828
|
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.AddItemsToBenefit
|
|
565
829
|
*/
|
|
566
|
-
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
|
+
}>;
|
|
567
833
|
interface AddItemsToBenefitOptions {
|
|
568
834
|
/**
|
|
569
835
|
* ID of the pool definition associated with the benefit.
|
|
@@ -577,4 +843,4 @@ interface AddItemsToBenefitOptions {
|
|
|
577
843
|
benefitKey: string;
|
|
578
844
|
}
|
|
579
845
|
|
|
580
|
-
export { type AccountInfo, type ActionEvent, type AddItemsToBenefitOptions, type AddItemsToBenefitRequest, type AddItemsToBenefitResponse, type BenefitInfo, 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 ProgramDefinitionInfo, type QueryPoolDefinitionItemsRequest, type QueryPoolDefinitionItemsResponse, type RemoveItemsFromBenefitOptions, type RemoveItemsFromBenefitRequest, type RemoveItemsFromBenefitResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addItemsToBenefit, removeItemsFromBenefit };
|
|
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 };
|