@wix/auto_sdk_benefit-programs_pool-definitions 1.0.66 → 1.0.67
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.js +2 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +5 -9
- package/build/cjs/index.typings.js +1 -3
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.js +28 -24
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.mjs +2 -4
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +5 -9
- package/build/es/index.typings.mjs +1 -3
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.mjs +28 -24
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.js +2 -4
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +94 -9
- package/build/internal/cjs/index.typings.js +1 -3
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +122 -0
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.js +28 -24
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.mjs +2 -4
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +94 -9
- package/build/internal/es/index.typings.mjs +1 -3
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +122 -0
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.mjs +28 -24
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -66,6 +66,12 @@ interface PoolDefinition {
|
|
|
66
66
|
* @maxLength 450
|
|
67
67
|
*/
|
|
68
68
|
description?: string | null;
|
|
69
|
+
/**
|
|
70
|
+
* Monotonic counter incremented on every change, including system/materialization updates that do not bump revision.
|
|
71
|
+
* @internal
|
|
72
|
+
* @readonly
|
|
73
|
+
*/
|
|
74
|
+
changesCounter?: string | null;
|
|
69
75
|
}
|
|
70
76
|
interface Details {
|
|
71
77
|
/**
|
|
@@ -79,6 +85,19 @@ interface Details {
|
|
|
79
85
|
* If this object is empty, you can't set a price for the benefit.
|
|
80
86
|
*/
|
|
81
87
|
creditConfiguration?: CreditConfiguration;
|
|
88
|
+
/**
|
|
89
|
+
* Defines when benefits can be redeemed.
|
|
90
|
+
*
|
|
91
|
+
* Benefit redemption can be limited by:
|
|
92
|
+
* - **Fixed intervals**: Benefits can be redeemed during specific times of the day or week.
|
|
93
|
+
* - **Rate limited**: Up to a maximum amount of benefits can be redeemed in a specified time period.
|
|
94
|
+
*
|
|
95
|
+
* Expressions can be combined using the *not*, *and*, and *or* operators.
|
|
96
|
+
*
|
|
97
|
+
* Each benefit can override this policy.
|
|
98
|
+
* @internal
|
|
99
|
+
*/
|
|
100
|
+
policyExpression?: PolicyExpression;
|
|
82
101
|
/** Additional information relating to this object. */
|
|
83
102
|
additionalData?: Record<string, any> | null;
|
|
84
103
|
}
|
|
@@ -102,6 +121,11 @@ interface Benefit {
|
|
|
102
121
|
* @decimalValue options { gte:0, maxScale:4 }
|
|
103
122
|
*/
|
|
104
123
|
price?: string | null;
|
|
124
|
+
/**
|
|
125
|
+
* Overrides the default policy expression in `benefit.details`.
|
|
126
|
+
* @internal
|
|
127
|
+
*/
|
|
128
|
+
policyExpression?: PolicyExpression;
|
|
105
129
|
/** Additional information for this benefit. */
|
|
106
130
|
additionalData?: Record<string, any> | null;
|
|
107
131
|
/**
|
|
@@ -513,6 +537,11 @@ interface BulkActionMetadata {
|
|
|
513
537
|
interface UpdatePoolDefinitionRequest {
|
|
514
538
|
/** Pool definition to update. */
|
|
515
539
|
poolDefinition: PoolDefinition;
|
|
540
|
+
/**
|
|
541
|
+
* Explicit list of fields to update.
|
|
542
|
+
* @internal
|
|
543
|
+
*/
|
|
544
|
+
fieldMask?: string[];
|
|
516
545
|
/** *Required.** Determines when the changes to this pool definition and program definitions containing it will be applied to associated programs and pools. */
|
|
517
546
|
cascade?: CascadeWithLiterals;
|
|
518
547
|
}
|
|
@@ -598,6 +627,19 @@ interface GetPoolDefinitionResponse {
|
|
|
598
627
|
interface QueryPoolDefinitionsRequest {
|
|
599
628
|
/** Filter, sort, and paging to apply to the query. */
|
|
600
629
|
query?: CursorQuery;
|
|
630
|
+
/**
|
|
631
|
+
* If true, the response will reflect a consistent snapshot of the data as of the time the request was received.
|
|
632
|
+
* @internal
|
|
633
|
+
*/
|
|
634
|
+
consistent?: boolean | null;
|
|
635
|
+
/**
|
|
636
|
+
* HACK FIXME PPNP-4611. Supersedes the page limit provided in the CursorQuery. Provides a way for trusted clients to query large
|
|
637
|
+
* amounts of data because necessary index crashes mysql cluster so the only option is to perform filtering in memory
|
|
638
|
+
* https://wix.slack.com/archives/C0E3MBAGH/p1765097287055939
|
|
639
|
+
* @internal
|
|
640
|
+
* @max 10000
|
|
641
|
+
*/
|
|
642
|
+
overrideLimit?: number | null;
|
|
601
643
|
}
|
|
602
644
|
interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
603
645
|
/** 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`. */
|
|
@@ -631,6 +673,20 @@ interface Sorting {
|
|
|
631
673
|
* Default: `ASC`
|
|
632
674
|
*/
|
|
633
675
|
order?: SortOrderWithLiterals;
|
|
676
|
+
/**
|
|
677
|
+
* When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
|
|
678
|
+
* a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
|
|
679
|
+
*
|
|
680
|
+
* If multiple filters are provided, they are combined with AND operator.
|
|
681
|
+
*
|
|
682
|
+
* Example:
|
|
683
|
+
* Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
|
|
684
|
+
* and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
|
|
685
|
+
* { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
|
|
686
|
+
* @internal
|
|
687
|
+
* @maxSize 10
|
|
688
|
+
*/
|
|
689
|
+
selectItemsBy?: Record<string, any>[] | null;
|
|
634
690
|
}
|
|
635
691
|
declare enum SortOrder {
|
|
636
692
|
/** Ascending sort order. */
|
|
@@ -1068,6 +1124,12 @@ interface UpdatePoolDefinition {
|
|
|
1068
1124
|
* @maxLength 450
|
|
1069
1125
|
*/
|
|
1070
1126
|
description?: string | null;
|
|
1127
|
+
/**
|
|
1128
|
+
* Monotonic counter incremented on every change, including system/materialization updates that do not bump revision.
|
|
1129
|
+
* @internal
|
|
1130
|
+
* @readonly
|
|
1131
|
+
*/
|
|
1132
|
+
changesCounter?: string | null;
|
|
1071
1133
|
}
|
|
1072
1134
|
interface UpdatePoolDefinitionOptions {
|
|
1073
1135
|
/** Required.** Determines when the changes to this pool definition and program definitions containing it will be applied to associated programs and pools. */
|
|
@@ -1158,6 +1220,19 @@ declare function getPoolDefinition(poolDefinitionId: string): Promise<NonNullabl
|
|
|
1158
1220
|
*/
|
|
1159
1221
|
declare function queryPoolDefinitions(options?: QueryPoolDefinitionsOptions): PoolDefinitionsQueryBuilder;
|
|
1160
1222
|
interface QueryPoolDefinitionsOptions {
|
|
1223
|
+
/**
|
|
1224
|
+
* If true, the response will reflect a consistent snapshot of the data as of the time the request was received.
|
|
1225
|
+
* @internal
|
|
1226
|
+
*/
|
|
1227
|
+
consistent?: boolean | null | undefined;
|
|
1228
|
+
/**
|
|
1229
|
+
* HACK FIXME PPNP-4611. Supersedes the page limit provided in the CursorQuery. Provides a way for trusted clients to query large
|
|
1230
|
+
* amounts of data because necessary index crashes mysql cluster so the only option is to perform filtering in memory
|
|
1231
|
+
* https://wix.slack.com/archives/C0E3MBAGH/p1765097287055939
|
|
1232
|
+
* @internal
|
|
1233
|
+
* @max 10000
|
|
1234
|
+
*/
|
|
1235
|
+
overrideLimit?: number | null | undefined;
|
|
1161
1236
|
}
|
|
1162
1237
|
interface QueryCursorResult {
|
|
1163
1238
|
cursors: Cursors;
|
|
@@ -1176,11 +1251,11 @@ interface PoolDefinitionsQueryBuilder {
|
|
|
1176
1251
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
1177
1252
|
* @param value - Value to compare against.
|
|
1178
1253
|
*/
|
|
1179
|
-
eq: (propertyName: '_id' | '_createdDate' | '
|
|
1254
|
+
eq: (propertyName: '_id' | '_createdDate' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder;
|
|
1180
1255
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
1181
1256
|
* @param value - Value to compare against.
|
|
1182
1257
|
*/
|
|
1183
|
-
ne: (propertyName: '_id' | '_createdDate' | '
|
|
1258
|
+
ne: (propertyName: '_id' | '_createdDate' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder;
|
|
1184
1259
|
/** @param propertyName - Property whose value is compared with `value`.
|
|
1185
1260
|
* @param value - Value to compare against.
|
|
1186
1261
|
*/
|
|
@@ -1204,12 +1279,12 @@ interface PoolDefinitionsQueryBuilder {
|
|
|
1204
1279
|
/** @param propertyName - Property whose value is compared with `values`.
|
|
1205
1280
|
* @param values - List of values to compare against.
|
|
1206
1281
|
*/
|
|
1207
|
-
hasSome: (propertyName: '
|
|
1282
|
+
hasSome: (propertyName: 'programDefinitionIds', value: any[]) => PoolDefinitionsQueryBuilder;
|
|
1208
1283
|
/** @param propertyName - Property whose value is compared with `values`.
|
|
1209
1284
|
* @param values - List of values to compare against.
|
|
1210
1285
|
*/
|
|
1211
1286
|
hasAll: (propertyName: 'programDefinitionIds', value: any[]) => PoolDefinitionsQueryBuilder;
|
|
1212
|
-
in: (propertyName: '_id' | '_createdDate' | '
|
|
1287
|
+
in: (propertyName: '_id' | '_createdDate' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder;
|
|
1213
1288
|
exists: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: boolean) => PoolDefinitionsQueryBuilder;
|
|
1214
1289
|
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
|
|
1215
1290
|
ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace'>) => PoolDefinitionsQueryBuilder;
|
|
@@ -1288,14 +1363,24 @@ type PoolDefinitionQuery = {
|
|
|
1288
1363
|
Default: `ASC`
|
|
1289
1364
|
*/
|
|
1290
1365
|
order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
|
|
1366
|
+
/**
|
|
1367
|
+
When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
|
|
1368
|
+
a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
|
|
1369
|
+
|
|
1370
|
+
If multiple filters are provided, they are combined with AND operator.
|
|
1371
|
+
|
|
1372
|
+
Example:
|
|
1373
|
+
Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
|
|
1374
|
+
and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
|
|
1375
|
+
{ fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
|
|
1376
|
+
@internal: undefined,
|
|
1377
|
+
@maxSize: 10
|
|
1378
|
+
*/
|
|
1379
|
+
selectItemsBy?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['selectItemsBy'] | null;
|
|
1291
1380
|
}[];
|
|
1292
1381
|
};
|
|
1293
1382
|
declare const utils: {
|
|
1294
|
-
query:
|
|
1295
|
-
QueryBuilder: () => _wix_sdk_types.QueryBuilder<PoolDefinition, PoolDefinitionQuerySpec, PoolDefinitionQuery>;
|
|
1296
|
-
Filter: _wix_sdk_types.FilterFactory<PoolDefinition, PoolDefinitionQuerySpec>;
|
|
1297
|
-
Sort: _wix_sdk_types.SortFactory<PoolDefinitionQuerySpec>;
|
|
1298
|
-
};
|
|
1383
|
+
query: _wix_sdk_types.QueryHelpers<PoolDefinition, PoolDefinitionQuerySpec, PoolDefinitionQuery>;
|
|
1299
1384
|
};
|
|
1300
1385
|
/**
|
|
1301
1386
|
* Adds a pool definition to a program definition.
|
|
@@ -889,9 +889,7 @@ async function typedQueryPoolDefinitions(query, options) {
|
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
var utils = {
|
|
892
|
-
query:
|
|
893
|
-
...(0, import_query_builder_utils.createQueryUtils)()
|
|
894
|
-
}
|
|
892
|
+
query: /* @__PURE__ */ (0, import_query_builder_utils.createQueryUtils)()
|
|
895
893
|
};
|
|
896
894
|
async function addPoolDefinitionToProgramDefinition2(poolDefinitionId, options) {
|
|
897
895
|
const { httpClient, sideEffects } = arguments[2];
|