@wix/auto_sdk_benefit-programs_pools 1.0.76 → 1.0.77

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.
Files changed (39) hide show
  1. package/build/cjs/index.js +3 -4
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.d.ts +4 -12
  4. package/build/cjs/index.typings.js +2 -3
  5. package/build/cjs/index.typings.js.map +1 -1
  6. package/build/cjs/meta.js +1 -0
  7. package/build/cjs/meta.js.map +1 -1
  8. package/build/cjs/schemas.js +18 -18
  9. package/build/cjs/schemas.js.map +1 -1
  10. package/build/es/index.mjs +3 -4
  11. package/build/es/index.mjs.map +1 -1
  12. package/build/es/index.typings.d.mts +4 -12
  13. package/build/es/index.typings.mjs +2 -3
  14. package/build/es/index.typings.mjs.map +1 -1
  15. package/build/es/meta.mjs +1 -0
  16. package/build/es/meta.mjs.map +1 -1
  17. package/build/es/schemas.mjs +18 -18
  18. package/build/es/schemas.mjs.map +1 -1
  19. package/build/internal/cjs/index.js +3 -4
  20. package/build/internal/cjs/index.js.map +1 -1
  21. package/build/internal/cjs/index.typings.d.ts +138 -12
  22. package/build/internal/cjs/index.typings.js +2 -3
  23. package/build/internal/cjs/index.typings.js.map +1 -1
  24. package/build/internal/cjs/meta.d.ts +239 -0
  25. package/build/internal/cjs/meta.js +1 -0
  26. package/build/internal/cjs/meta.js.map +1 -1
  27. package/build/internal/cjs/schemas.js +18 -18
  28. package/build/internal/cjs/schemas.js.map +1 -1
  29. package/build/internal/es/index.mjs +3 -4
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +138 -12
  32. package/build/internal/es/index.typings.mjs +2 -3
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +239 -0
  35. package/build/internal/es/meta.mjs +1 -0
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/build/internal/es/schemas.mjs +18 -18
  38. package/build/internal/es/schemas.mjs.map +1 -1
  39. package/package.json +4 -4
@@ -102,6 +102,37 @@ interface Pool {
102
102
  * @readonly
103
103
  */
104
104
  renewalCount?: number | null;
105
+ /**
106
+ * Previous status of the benefit pool.
107
+ * @internal
108
+ * @readonly
109
+ */
110
+ previousStatus?: PoolStatusWithLiterals;
111
+ /**
112
+ * Origin of the benefit pool.
113
+ * @internal
114
+ * @readonly
115
+ * @immutable
116
+ */
117
+ origin?: PoolOriginWithLiterals;
118
+ /**
119
+ * Action to be performed on pool renewal
120
+ * @internal
121
+ * @readonly
122
+ */
123
+ renewalAction?: PoolRenewalAction;
124
+ /**
125
+ * Pool description.
126
+ * @internal
127
+ * @maxLength 450
128
+ */
129
+ description?: string | null;
130
+ /**
131
+ * Monotonic counter incremented on every change, including system/materialization updates that do not bump revision.
132
+ * @internal
133
+ * @readonly
134
+ */
135
+ changesCounter?: string | null;
105
136
  }
106
137
  declare enum PoolStatus {
107
138
  /** Pool is active. */
@@ -135,6 +166,12 @@ interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
135
166
  * @format GUID
136
167
  */
137
168
  wixUserId?: string;
169
+ /**
170
+ * Identity type.
171
+ * @internal
172
+ * @readonly
173
+ */
174
+ identityType?: IdentityTypeWithLiterals;
138
175
  }
139
176
  /** @oneof */
140
177
  interface CommonIdentificationDataIdOneOf {
@@ -178,6 +215,19 @@ interface Details {
178
215
  * If this object is empty, you can't set a price for the benefit.
179
216
  */
180
217
  creditConfiguration?: CreditConfiguration;
218
+ /**
219
+ * Defines when benefits can be redeemed.
220
+ *
221
+ * Benefit redemption can be limited by:
222
+ * - **Fixed intervals**: Benefits can be redeemed during specific times of the day or week.
223
+ * - **Rate limited**: Up to a maximum amount of benefits can be redeemed in a specified time period.
224
+ *
225
+ * Expressions can be combined using the *not*, *and*, and *or* operators.
226
+ *
227
+ * Each benefit can override this policy.
228
+ * @internal
229
+ */
230
+ policyExpression?: PolicyExpression;
181
231
  /** Additional information relating to this object. */
182
232
  additionalData?: Record<string, any> | null;
183
233
  }
@@ -201,6 +251,11 @@ interface Benefit {
201
251
  * @decimalValue options { gte:0, maxScale:4 }
202
252
  */
203
253
  price?: string | null;
254
+ /**
255
+ * Overrides the default policy expression in `benefit.details`.
256
+ * @internal
257
+ */
258
+ policyExpression?: PolicyExpression;
204
259
  /** Additional information for this benefit. */
205
260
  additionalData?: Record<string, any> | null;
206
261
  /**
@@ -719,6 +774,11 @@ interface GetPoolResponse {
719
774
  interface UpdatePoolRequest {
720
775
  /** Pool to update. */
721
776
  pool: Pool;
777
+ /**
778
+ * Explicit list of fields to update.
779
+ * @internal
780
+ */
781
+ fieldMask?: string[];
722
782
  }
723
783
  interface UpdatePoolResponse {
724
784
  /** Updated pool. */
@@ -736,6 +796,11 @@ interface DeletePoolResponse {
736
796
  interface QueryPoolsRequest {
737
797
  /** Filter, sort, and paging to apply to the query. */
738
798
  query?: CursorQuery;
799
+ /**
800
+ * If true, the response will reflect a consistent snapshot of the data as of the time the request was received.
801
+ * @internal
802
+ */
803
+ consistent?: boolean | null;
739
804
  }
740
805
  interface CursorQuery extends CursorQueryPagingMethodOneOf {
741
806
  /** 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`. */
@@ -769,6 +834,20 @@ interface Sorting {
769
834
  * Default: `ASC`
770
835
  */
771
836
  order?: SortOrderWithLiterals;
837
+ /**
838
+ * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
839
+ * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
840
+ *
841
+ * If multiple filters are provided, they are combined with AND operator.
842
+ *
843
+ * Example:
844
+ * Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
845
+ * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
846
+ * { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
847
+ * @internal
848
+ * @maxSize 10
849
+ */
850
+ selectItemsBy?: Record<string, any>[] | null;
772
851
  }
773
852
  declare enum SortOrder {
774
853
  /** Ascending sort order. */
@@ -1250,6 +1329,11 @@ declare enum BenefitResultType {
1250
1329
  ELIGIBLE_BENEFIT = "ELIGIBLE_BENEFIT",
1251
1330
  /** Balance is lower than the cost of redeeming the items. */
1252
1331
  NOT_ENOUGH_BALANCE = "NOT_ENOUGH_BALANCE",
1332
+ /**
1333
+ * Policy is false.
1334
+ * @internal
1335
+ */
1336
+ POLICY_EXPRESSION_EVALUATED_TO_FALSE = "POLICY_EXPRESSION_EVALUATED_TO_FALSE",
1253
1337
  /** Pool isn't active. */
1254
1338
  POOL_NOT_ACTIVE = "POOL_NOT_ACTIVE",
1255
1339
  /** Invalid benefit details provided. */
@@ -2063,6 +2147,37 @@ interface UpdatePool {
2063
2147
  * @readonly
2064
2148
  */
2065
2149
  renewalCount?: number | null;
2150
+ /**
2151
+ * Previous status of the benefit pool.
2152
+ * @internal
2153
+ * @readonly
2154
+ */
2155
+ previousStatus?: PoolStatusWithLiterals;
2156
+ /**
2157
+ * Origin of the benefit pool.
2158
+ * @internal
2159
+ * @readonly
2160
+ * @immutable
2161
+ */
2162
+ origin?: PoolOriginWithLiterals;
2163
+ /**
2164
+ * Action to be performed on pool renewal
2165
+ * @internal
2166
+ * @readonly
2167
+ */
2168
+ renewalAction?: PoolRenewalAction;
2169
+ /**
2170
+ * Pool description.
2171
+ * @internal
2172
+ * @maxLength 450
2173
+ */
2174
+ description?: string | null;
2175
+ /**
2176
+ * Monotonic counter incremented on every change, including system/materialization updates that do not bump revision.
2177
+ * @internal
2178
+ * @readonly
2179
+ */
2180
+ changesCounter?: string | null;
2066
2181
  }
2067
2182
  /**
2068
2183
  * Creates a query to retrieve a list of pools.
@@ -2083,6 +2198,11 @@ interface UpdatePool {
2083
2198
  */
2084
2199
  declare function queryPools(options?: QueryPoolsOptions): PoolsQueryBuilder;
2085
2200
  interface QueryPoolsOptions {
2201
+ /**
2202
+ * If true, the response will reflect a consistent snapshot of the data as of the time the request was received.
2203
+ * @internal
2204
+ */
2205
+ consistent?: boolean | null | undefined;
2086
2206
  }
2087
2207
  interface QueryCursorResult {
2088
2208
  cursors: Cursors;
@@ -2101,11 +2221,11 @@ interface PoolsQueryBuilder {
2101
2221
  /** @param propertyName - Property whose value is compared with `value`.
2102
2222
  * @param value - Value to compare against.
2103
2223
  */
2104
- eq: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: any) => PoolsQueryBuilder;
2224
+ eq: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: any) => PoolsQueryBuilder;
2105
2225
  /** @param propertyName - Property whose value is compared with `value`.
2106
2226
  * @param value - Value to compare against.
2107
2227
  */
2108
- ne: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: any) => PoolsQueryBuilder;
2228
+ ne: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: any) => PoolsQueryBuilder;
2109
2229
  /** @param propertyName - Property whose value is compared with `value`.
2110
2230
  * @param value - Value to compare against.
2111
2231
  */
@@ -2126,11 +2246,7 @@ interface PoolsQueryBuilder {
2126
2246
  * @param string - String to compare against. Case-insensitive.
2127
2247
  */
2128
2248
  startsWith: (propertyName: '_id' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: string) => PoolsQueryBuilder;
2129
- /** @param propertyName - Property whose value is compared with `values`.
2130
- * @param values - List of values to compare against.
2131
- */
2132
- hasSome: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: any[]) => PoolsQueryBuilder;
2133
- in: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: any) => PoolsQueryBuilder;
2249
+ in: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: any) => PoolsQueryBuilder;
2134
2250
  exists: (propertyName: '_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id', value: boolean) => PoolsQueryBuilder;
2135
2251
  /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments. */
2136
2252
  ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'poolDefinitionId' | 'programDefinitionId' | 'programId' | 'status' | 'beneficiary' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace' | 'programDefinition.id' | 'program.id'>) => PoolsQueryBuilder;
@@ -2216,14 +2332,24 @@ type PoolQuery = {
2216
2332
  Default: `ASC`
2217
2333
  */
2218
2334
  order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
2335
+ /**
2336
+ When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
2337
+ a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
2338
+
2339
+ If multiple filters are provided, they are combined with AND operator.
2340
+
2341
+ Example:
2342
+ Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
2343
+ and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
2344
+ { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
2345
+ @internal: undefined,
2346
+ @maxSize: 10
2347
+ */
2348
+ selectItemsBy?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['selectItemsBy'] | null;
2219
2349
  }[];
2220
2350
  };
2221
2351
  declare const utils: {
2222
- query: {
2223
- QueryBuilder: () => _wix_sdk_types.QueryBuilder<Pool, PoolQuerySpec, PoolQuery>;
2224
- Filter: _wix_sdk_types.FilterFactory<Pool, PoolQuerySpec>;
2225
- Sort: _wix_sdk_types.SortFactory<PoolQuerySpec>;
2226
- };
2352
+ query: _wix_sdk_types.QueryHelpers<Pool, PoolQuerySpec, PoolQuery>;
2227
2353
  };
2228
2354
  /**
2229
2355
  * Redeems a specified benefit.
@@ -560,6 +560,7 @@ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
560
560
  var BenefitResultType = /* @__PURE__ */ ((BenefitResultType2) => {
561
561
  BenefitResultType2["ELIGIBLE_BENEFIT"] = "ELIGIBLE_BENEFIT";
562
562
  BenefitResultType2["NOT_ENOUGH_BALANCE"] = "NOT_ENOUGH_BALANCE";
563
+ BenefitResultType2["POLICY_EXPRESSION_EVALUATED_TO_FALSE"] = "POLICY_EXPRESSION_EVALUATED_TO_FALSE";
563
564
  BenefitResultType2["POOL_NOT_ACTIVE"] = "POOL_NOT_ACTIVE";
564
565
  BenefitResultType2["BENEFIT_NOT_FOUND"] = "BENEFIT_NOT_FOUND";
565
566
  BenefitResultType2["POOL_NOT_FOUND"] = "POOL_NOT_FOUND";
@@ -704,9 +705,7 @@ async function typedQueryPools(query, options) {
704
705
  }
705
706
  }
706
707
  var utils = {
707
- query: {
708
- ...createQueryUtils()
709
- }
708
+ query: /* @__PURE__ */ createQueryUtils()
710
709
  };
711
710
  async function redeemBenefit2(poolId, options) {
712
711
  const { httpClient, sideEffects } = arguments[2];