@wix/auto_sdk_benefit-programs_pool-definitions 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.context.d.ts +15 -0
  11. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.context.js +25 -0
  12. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.context.js.map +1 -0
  13. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.http.d.ts +63 -0
  14. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.http.js +480 -0
  15. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.http.js.map +1 -0
  16. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.meta.d.ts +29 -0
  17. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js +237 -0
  18. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js.map +1 -0
  19. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.public.d.ts +123 -0
  20. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.public.js +80 -0
  21. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.public.js.map +1 -0
  22. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.types.d.ts +821 -0
  23. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.types.js +92 -0
  24. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.types.js.map +1 -0
  25. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.universal.d.ts +1202 -0
  26. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js +601 -0
  27. package/build/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.context.d.ts +15 -0
  39. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.context.js +15 -0
  40. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.context.js.map +1 -0
  41. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.http.d.ts +63 -0
  42. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.http.js +466 -0
  43. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.http.js.map +1 -0
  44. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.meta.d.ts +29 -0
  45. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js +200 -0
  46. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js.map +1 -0
  47. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.public.d.ts +123 -0
  48. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.public.js +59 -0
  49. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.public.js.map +1 -0
  50. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.types.d.ts +821 -0
  51. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.types.js +89 -0
  52. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.types.js.map +1 -0
  53. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.universal.d.ts +1202 -0
  54. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js +564 -0
  55. package/build/es/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.context.d.ts +15 -0
  66. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.context.js +25 -0
  67. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.context.js.map +1 -0
  68. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.http.d.ts +63 -0
  69. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.http.js +480 -0
  70. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.http.js.map +1 -0
  71. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.meta.d.ts +29 -0
  72. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js +237 -0
  73. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js.map +1 -0
  74. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.public.d.ts +123 -0
  75. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.public.js +80 -0
  76. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.public.js.map +1 -0
  77. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.types.d.ts +821 -0
  78. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.types.js +92 -0
  79. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.types.js.map +1 -0
  80. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.universal.d.ts +1202 -0
  81. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js +601 -0
  82. package/build/internal/cjs/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.context.d.ts +15 -0
  93. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.context.js +15 -0
  94. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.context.js.map +1 -0
  95. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.http.d.ts +63 -0
  96. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.http.js +466 -0
  97. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.http.js.map +1 -0
  98. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.meta.d.ts +29 -0
  99. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js +200 -0
  100. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.meta.js.map +1 -0
  101. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.public.d.ts +123 -0
  102. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.public.js +59 -0
  103. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.public.js.map +1 -0
  104. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.types.d.ts +821 -0
  105. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.types.js +89 -0
  106. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.types.js.map +1 -0
  107. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.universal.d.ts +1202 -0
  108. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js +564 -0
  109. package/build/internal/es/src/benefit-programs-v1-pool-definition-pool-definitions.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,1202 @@
1
+ export interface PoolDefinition {
2
+ /**
3
+ * Pool definition ID.
4
+ * @readonly
5
+ */
6
+ _id?: string | null;
7
+ /**
8
+ * Revision number, which increments by 1 each time the pool definition is updated.
9
+ * To prevent conflicting changes, the current revision must be specified when updating the pool definition.
10
+ *
11
+ * Ignored when creating a pool definition.
12
+ * @readonly
13
+ */
14
+ revision?: string | null;
15
+ /**
16
+ * Date and time the pool definition was created.
17
+ * @readonly
18
+ */
19
+ _createdDate?: Date | null;
20
+ /**
21
+ * Date and time the pool definition was updated.
22
+ * @readonly
23
+ */
24
+ _updatedDate?: Date | null;
25
+ /** Name of the pool definition. */
26
+ displayName?: string;
27
+ /** List of program definitions that are associated with this pool definition. */
28
+ programDefinitionIds?: string[];
29
+ /**
30
+ * Benefit pool information.
31
+ *
32
+ * Includes the item, policy, and credit configurations.
33
+ */
34
+ details?: Details;
35
+ /**
36
+ * Application sub-module that represents the source of the pool definition. Specified by the external developer.
37
+ *
38
+ * This namespace is used to organize and retrieve pool definitions and their associated benefit pools.
39
+ *
40
+ * It should match the namespace used in the program definitions.
41
+ */
42
+ namespace?: string | null;
43
+ /**
44
+ * Custom field data for the pool definition object.
45
+ *
46
+ * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
47
+ */
48
+ extendedFields?: ExtendedFields;
49
+ }
50
+ export interface Details {
51
+ /** Array of benefits, each containing price and policy settings specific to that benefit within the pool. */
52
+ benefits?: Benefit[];
53
+ /**
54
+ * Settings that control the initial credits and renewal cycle configurations of the benefit pool.
55
+ *
56
+ * Default: Benefits may be redeemed without limit.
57
+ */
58
+ creditConfiguration?: CreditConfiguration;
59
+ /**
60
+ * Defines the redemption policy for a benefit pool. This includes specifying the days of the week and the hours during which the benefits can be redeemed.
61
+ *
62
+ * Policy types may be either:
63
+ *
64
+ * + FIXED INTERVALS: Specifies the timing during the day.
65
+ *
66
+ * + RATE LIMITED: Specifies how many times the benefit can be redeemed within a given renewal cycle.
67
+ *
68
+ * Each selected policy type must have its corresponding policy options. For example, the `fixedInterval` type requires `fixedIntervalOptions` to be included in the parameters.
69
+ *
70
+ * This parameter is the default policy for all the benefits in the benefit pool. It may be overridden for specific benefits in the `details.benefits.policyExpression` parameter.
71
+ */
72
+ policyExpression?: PolicyExpression;
73
+ /** Additional info set by the benefit provider. */
74
+ additionalData?: Record<string, any> | null;
75
+ }
76
+ export interface Benefit {
77
+ /**
78
+ * An unique identifier for a pool benefit.
79
+ *
80
+ * This key is consistent across the pool definition and all its associated benefit pools.
81
+ */
82
+ benefitKey?: string;
83
+ /**
84
+ * Represents the associated benefit item that belongs to a benefit pool.
85
+ *
86
+ * This ID is returned when calling Create Item.
87
+ *
88
+ * It is used to link the specific benefit item to its corresponding location within the benefit pool, ensuring proper association between the item and the pool definition.
89
+ * @readonly
90
+ */
91
+ itemSetId?: string | null;
92
+ /**
93
+ * Price of the benefit item as expressed in credits.
94
+ * Represents the cost to redeem the benefit.
95
+ *
96
+ * Don't set a price if the `details.creditConfiguration` is empty. Since the benefits have an unlimited redemption limit, they can't have an associated price.
97
+ */
98
+ price?: string | null;
99
+ /**
100
+ * Defines the redemption policy for a specific benefit. This includes specifying the days of the week and the hours during which the benefits can be redeemed.
101
+ *
102
+ * Overrides the default policies in `benefit.details`.
103
+ */
104
+ policyExpression?: PolicyExpression;
105
+ /** Additional info that was set by the benefit provider. */
106
+ additionalData?: Record<string, any> | null;
107
+ /** ID of the app providing the benefit. */
108
+ providerAppId?: string | null;
109
+ /** Benefit display name. */
110
+ displayName?: string | null;
111
+ /** Benefit description. */
112
+ description?: string | null;
113
+ }
114
+ export interface PolicyExpression extends PolicyExpressionExpressionOneOf {
115
+ /** Negates the expression. */
116
+ operatorNotOptions?: PolicyExpressionNot;
117
+ /** Combines the expressions with an `AND` operator. */
118
+ operatorAndOptions?: PolicyExpressionAnd;
119
+ /** Combines the expressions with an `OR` operator. */
120
+ operatorOrOptions?: PolicyExpressionOr;
121
+ /** Defines policy terms for benefit redemption. */
122
+ policyOptions?: Policy;
123
+ /**
124
+ * Declare type of policy conditions or settings to use. Use together with the associated policy options to construct policy terms.
125
+ *
126
+ * Different operators can be used to combine multiple policy terms.
127
+ */
128
+ type?: PolicyExpressionType;
129
+ }
130
+ /** @oneof */
131
+ export interface PolicyExpressionExpressionOneOf {
132
+ /** Negates the expression. */
133
+ operatorNotOptions?: PolicyExpressionNot;
134
+ /** Combines the expressions with an `AND` operator. */
135
+ operatorAndOptions?: PolicyExpressionAnd;
136
+ /** Combines the expressions with an `OR` operator. */
137
+ operatorOrOptions?: PolicyExpressionOr;
138
+ /** Defines policy terms for benefit redemption. */
139
+ policyOptions?: Policy;
140
+ }
141
+ export declare enum PolicyExpressionType {
142
+ UNKNOWN = "UNKNOWN",
143
+ /** Use with associated `operatorNotOptions`. */
144
+ OPERATOR_NOT = "OPERATOR_NOT",
145
+ /** Use with associated `operatorAndOptions`. */
146
+ OPERATOR_AND = "OPERATOR_AND",
147
+ /** Use with associated `operatorOrOptions`. */
148
+ OPERATOR_OR = "OPERATOR_OR",
149
+ /** Use with associated `policyOptions` to define a policy. */
150
+ POLICY = "POLICY"
151
+ }
152
+ export interface PolicyExpressionNot {
153
+ /** Specify policy terms where none of specified policy conditions should be met. Must specify an object with an `expressions` property. */
154
+ expression?: PolicyExpression;
155
+ }
156
+ export interface PolicyExpressionAnd {
157
+ /** Specify policy terms where all policy conditions must be met. Must specify an object with an `expressions` property. */
158
+ expressions?: PolicyExpression[];
159
+ }
160
+ export interface PolicyExpressionOr {
161
+ /** Specify policy terms where at least one of the possible specified policy conditions is met. Must specify an object with an `expressions` property. */
162
+ expressions?: PolicyExpression[];
163
+ }
164
+ export interface Policy extends PolicyPolicyOneOf {
165
+ /** Defines the timing of benefit policy redemption for specific days or hours. */
166
+ fixedIntervalOptions?: FixedIntervalPolicy;
167
+ /** Sets a limit on the number of times a benefit can be redeemed within a given renewal cycle. */
168
+ rateLimitedOptions?: RateLimitedPolicy;
169
+ /** Custom policy definition that is controlled by the CustomPolicyProvider. */
170
+ customOptions?: CustomPolicy;
171
+ /** Specific policy setting. Use together with its associated policy type options. For example, a fixed interval policy type should include a `fixedIntervalOptions` parameter. */
172
+ type?: Type;
173
+ }
174
+ /** @oneof */
175
+ export interface PolicyPolicyOneOf {
176
+ /** Defines the timing of benefit policy redemption for specific days or hours. */
177
+ fixedIntervalOptions?: FixedIntervalPolicy;
178
+ /** Sets a limit on the number of times a benefit can be redeemed within a given renewal cycle. */
179
+ rateLimitedOptions?: RateLimitedPolicy;
180
+ /** Custom policy definition that is controlled by the CustomPolicyProvider. */
181
+ customOptions?: CustomPolicy;
182
+ }
183
+ export declare enum Type {
184
+ /** Unknown policy type. */
185
+ UNKNOWN = "UNKNOWN",
186
+ /** Fixed interval policy type. */
187
+ FIXED_INTERVAL = "FIXED_INTERVAL",
188
+ /** Rate limited policy type. */
189
+ RATE_LIMITED = "RATE_LIMITED",
190
+ CUSTOM = "CUSTOM"
191
+ }
192
+ export interface FixedIntervalPolicy {
193
+ /** Weekday that this interval starts from. If this field is set, then `toWeekDay` must also be set. */
194
+ fromWeekDay?: WeekDay;
195
+ /** Weekday that this interval ends at. If this field is set, then `fromWeekDay` must also be set. */
196
+ toWeekDay?: WeekDay;
197
+ /** Hour that this interval starts from. If this field is set, then `toHour` must also be set. */
198
+ fromHour?: number | null;
199
+ /** Hour that this interval ends at. If this field is set, then `fromHour` must also be set. */
200
+ toHour?: number | null;
201
+ /** Minute that this interval starts from. If this field is set, then `toMinute` must also be set. */
202
+ fromMinute?: number | null;
203
+ /** Minute that this interval ends at. If this field is set, then `fromMinute` must also be set. */
204
+ toMinute?: number | null;
205
+ }
206
+ export declare enum WeekDay {
207
+ /** Unknown weekday. */
208
+ UNKNOWN = "UNKNOWN",
209
+ /** Monday. */
210
+ MONDAY = "MONDAY",
211
+ /** Tuesday. */
212
+ TUESDAY = "TUESDAY",
213
+ /** Wednesday. */
214
+ WEDNESDAY = "WEDNESDAY",
215
+ /** Thursday. */
216
+ THURSDAY = "THURSDAY",
217
+ /** Friday. */
218
+ FRIDAY = "FRIDAY",
219
+ /** Saturday. */
220
+ SATURDAY = "SATURDAY",
221
+ /** Sunday. */
222
+ SUNDAY = "SUNDAY"
223
+ }
224
+ export interface RateLimitedPolicy extends RateLimitedPolicyPeriodOneOf {
225
+ /**
226
+ * Defines the timing of benefit policy redemption for specific days or hours.
227
+ *
228
+ * Used to set the timing policy for a maximum limit of redemptions.
229
+ */
230
+ fixedIntervalOptions?: FixedIntervalPolicy;
231
+ /** Maximum number of times benefit can be redeemed per renewal cycle. */
232
+ times?: number;
233
+ /** Specific method of setting the benefit limit. `FIXED_INTERVAL` type must be used with its corresponding `fixIntervalPolicyOptions` parameter. */
234
+ type?: RateLimitedPolicyType;
235
+ }
236
+ /** @oneof */
237
+ export interface RateLimitedPolicyPeriodOneOf {
238
+ /**
239
+ * Defines the timing of benefit policy redemption for specific days or hours.
240
+ *
241
+ * Used to set the timing policy for a maximum limit of redemptions.
242
+ */
243
+ fixedIntervalOptions?: FixedIntervalPolicy;
244
+ }
245
+ export declare enum RateLimitedPolicyType {
246
+ /** Unknown rate limit method. */
247
+ UNKNOWN = "UNKNOWN",
248
+ /** Fixed interval rate limit. The intervals are set using `fixIntervalPolicyOptions`. */
249
+ FIXED_INTERVAL = "FIXED_INTERVAL",
250
+ /** Rate limit is set with `times` field above. */
251
+ PER_CYCLE = "PER_CYCLE"
252
+ }
253
+ /** Custom policy as implemented by the Entitlement Policy Provider */
254
+ export interface CustomPolicy {
255
+ /** References a specific custom policy on the provider's system */
256
+ _id?: string;
257
+ /** Custom policy provider id */
258
+ appId?: string | null;
259
+ /** Additional info for this custom policy. It's going to be passed to the policy provider during eligibility checks */
260
+ additionalData?: Record<string, any> | null;
261
+ }
262
+ export interface CreditConfiguration {
263
+ /** The initial total amount of credits available in this benefit pool. */
264
+ amount?: string;
265
+ /** Rollover configuration. */
266
+ rolloverConfiguration?: RolloverConfiguration;
267
+ /** Display name of the unit. */
268
+ unitDisplayName?: string | null;
269
+ }
270
+ export interface RolloverConfiguration {
271
+ /** Determine whether unused credits are rolled over to the new cycle. */
272
+ enabled?: boolean | null;
273
+ /**
274
+ * The maximum amount of credits that can be transferred to the next benefit renewal cycle.
275
+ *
276
+ * If current balance exceeds this cap, no credits will transfer into the next renewal cycle until the balance is within the allowable limit.
277
+ */
278
+ balanceCap?: string | null;
279
+ }
280
+ export interface ExtendedFields {
281
+ /**
282
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
283
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
284
+ *
285
+ * You can only access fields for which you have the appropriate permissions.
286
+ *
287
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
288
+ */
289
+ namespaces?: Record<string, Record<string, any>>;
290
+ }
291
+ export interface PoolDefinitionAddedToProgramDefinition {
292
+ /** PoolDefinition that was added to the program definition */
293
+ poolDefinition?: PoolDefinition;
294
+ /** Program Definition that the pool definition was added to */
295
+ programDefinitionId?: string;
296
+ /** Type of cascade */
297
+ cascadeType?: Cascade;
298
+ }
299
+ export declare enum Cascade {
300
+ /** Unknown cascade. */
301
+ UNKNOWN_CASCADE = "UNKNOWN_CASCADE",
302
+ /**
303
+ * Updates the associated benefit pools to reflect the new or modified pool definition. The benefits will appear in existing programs at the beginning of their next renewal cycle.
304
+ *
305
+ * Existing programs will be updated in their next renewal cycle.
306
+ */
307
+ NEXT_RENEWAL = "NEXT_RENEWAL",
308
+ /**
309
+ * Updates the associated benefit pools to reflect the new or modified pool definition immediately.
310
+ *
311
+ * Existing programs will be updated immediately.
312
+ */
313
+ IMMEDIATELY = "IMMEDIATELY",
314
+ /**
315
+ * Updates the associated benefit pools to reflect the new or modified pool definition the next time the benefit pools are provisioned to a program.
316
+ *
317
+ * Existing programs will remain unaffected. Only newly purchased programs will display the benefits of this pool definition.
318
+ */
319
+ FUTURE_PROVISIONS = "FUTURE_PROVISIONS"
320
+ }
321
+ export interface PoolDefinitionRemovedFromProgramDefinition {
322
+ /** PoolDefinition that was removed from the program definition */
323
+ poolDefinition?: PoolDefinition;
324
+ /** Program Definition that the pool definition was removed from */
325
+ programDefinitionId?: string;
326
+ /** Type of cascade */
327
+ cascadeType?: Cascade;
328
+ }
329
+ export interface CreatePoolDefinitionRequest {
330
+ /** Pool definition to create. */
331
+ poolDefinition: PoolDefinition;
332
+ /**
333
+ * Specifies the timing of updates to associated benefit pools.
334
+ * Determines how and when changes are applied to existing and future benefit pools.
335
+ * Must be provided if `programDefinitionIds` are included in the `poolDefinition` parameter.
336
+ */
337
+ cascade?: Cascade;
338
+ }
339
+ export interface CreatePoolDefinitionResponse {
340
+ /** Created pool definition. */
341
+ poolDefinition?: PoolDefinition;
342
+ }
343
+ export interface BulkCreatePoolDefinitionsRequest {
344
+ /** Pool definitions to create. */
345
+ poolDefinitions: PoolDefinition[];
346
+ /**
347
+ * Specifies the timing of updates to associated benefit pools.
348
+ * Determines how and when changes are applied to existing and future benefit pools.
349
+ * Must be provided if `programDefinitionIds` are included in the `poolDefinition` parameter.
350
+ */
351
+ cascade?: Cascade;
352
+ /**
353
+ * Whether to return the full pool definition entities.
354
+ *
355
+ * Default: `false`
356
+ */
357
+ returnEntity?: boolean;
358
+ }
359
+ export interface BulkCreatePoolDefinitionsResponse {
360
+ /**
361
+ * List of results for each pool definition.
362
+ *
363
+ * Includes the pool definition and whether the creation was successful.
364
+ */
365
+ results?: BulkPoolDefinitionResult[];
366
+ /** Bulk action metadata. */
367
+ bulkActionMetadata?: BulkActionMetadata;
368
+ }
369
+ export interface BulkPoolDefinitionResult {
370
+ /** Item metadata. */
371
+ itemMetadata?: ItemMetadata;
372
+ /** Pool definition. */
373
+ poolDefinition?: PoolDefinition;
374
+ }
375
+ export interface ItemMetadata {
376
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
377
+ _id?: string | null;
378
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
379
+ originalIndex?: number;
380
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
381
+ success?: boolean;
382
+ /** Details about the error in case of failure. */
383
+ error?: ApplicationError;
384
+ }
385
+ export interface ApplicationError {
386
+ /** Error code. */
387
+ code?: string;
388
+ /** Description of the error. */
389
+ description?: string;
390
+ /** Data related to the error. */
391
+ data?: Record<string, any> | null;
392
+ }
393
+ export interface BulkActionMetadata {
394
+ /** Number of items that were successfully processed. */
395
+ totalSuccesses?: number;
396
+ /** Number of items that couldn't be processed. */
397
+ totalFailures?: number;
398
+ /** Number of failures without details because detailed failure threshold was exceeded. */
399
+ undetailedFailures?: number;
400
+ }
401
+ export interface UpdatePoolDefinitionRequest {
402
+ /** Pool definition to update. */
403
+ poolDefinition: PoolDefinition;
404
+ /**
405
+ * Specifies the timing of updates to associated benefit pools.
406
+ * Determines how and when changes are applied to existing and future benefit pools.
407
+ * Required field.
408
+ */
409
+ cascade?: Cascade;
410
+ }
411
+ export interface UpdatePoolDefinitionResponse {
412
+ /** Updated pool definition. */
413
+ poolDefinition?: PoolDefinition;
414
+ }
415
+ export interface BulkUpdatePoolDefinitionsRequest {
416
+ /** Pool definitions to update. */
417
+ poolDefinitions?: MaskedPoolDefinition[];
418
+ /**
419
+ * Specifies the timing of updates to associated benefit pools.
420
+ * Determines how and when changes are applied to existing and future benefit pools.
421
+ * Required field.
422
+ */
423
+ cascade?: Cascade;
424
+ /**
425
+ * Whether to return the full pool definition entities.
426
+ *
427
+ * Default: `false`
428
+ */
429
+ returnEntity?: boolean;
430
+ }
431
+ export interface MaskedPoolDefinition {
432
+ /** Pool definition to be updated. */
433
+ poolDefinition?: PoolDefinition;
434
+ /** Explicit list of fields to update. */
435
+ fieldMask?: string[];
436
+ }
437
+ export interface BulkUpdatePoolDefinitionsResponse {
438
+ /**
439
+ * List of results for each pool definition.
440
+ *
441
+ * Includes the pool definition and whether the update was successful.
442
+ */
443
+ results?: BulkPoolDefinitionResult[];
444
+ /** Bulk action metadata. */
445
+ bulkActionMetadata?: BulkActionMetadata;
446
+ }
447
+ export interface DeletePoolDefinitionRequest {
448
+ /** ID of the pool definition to delete. */
449
+ poolDefinitionId: string;
450
+ /**
451
+ * Defines how the delete operation cascades to related pools.
452
+ * Specifies the timing of deletion regarding associated benefit pools.
453
+ * Required if the pool definition is associated with any program definition IDs.
454
+ */
455
+ cascade?: Cascade;
456
+ }
457
+ export interface DeletePoolDefinitionResponse {
458
+ }
459
+ export interface BulkDeletePoolDefinitionsRequest {
460
+ /** ID of the pool definitions to delete. */
461
+ poolDefinitionIds: string[];
462
+ /**
463
+ * Specifies the timing of updates to associated benefit pools.
464
+ * Required if any of the pool definitions listed for deletion are associated with a program definition ID.
465
+ */
466
+ cascade?: Cascade;
467
+ }
468
+ export interface BulkDeletePoolDefinitionsResponse {
469
+ /**
470
+ * List of results for each pool definition.
471
+ *
472
+ * Includes the pool definition and whether the deletion was successful.
473
+ */
474
+ results?: BulkPoolDefinitionResult[];
475
+ /** Bulk action metadata. */
476
+ bulkActionMetadata?: BulkActionMetadata;
477
+ }
478
+ export interface GetPoolDefinitionRequest {
479
+ /** ID of the pool definition to retrieve. */
480
+ poolDefinitionId: string;
481
+ }
482
+ export interface GetPoolDefinitionResponse {
483
+ /** Retrieved pool definition. */
484
+ poolDefinition?: PoolDefinition;
485
+ }
486
+ export interface QueryPoolDefinitionsRequest {
487
+ /** Query to select pool definitions. */
488
+ query?: CursorQuery;
489
+ }
490
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
491
+ /** 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`. */
492
+ cursorPaging?: CursorPaging;
493
+ /**
494
+ * Filter object in the following format:
495
+ * `"filter" : {
496
+ * "fieldName1": "value1",
497
+ * "fieldName2":{"$operator":"value2"}
498
+ * }`
499
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
500
+ */
501
+ filter?: Record<string, any> | null;
502
+ /**
503
+ * Sort object in the following format:
504
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
505
+ */
506
+ sort?: Sorting[];
507
+ }
508
+ /** @oneof */
509
+ export interface CursorQueryPagingMethodOneOf {
510
+ /** 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`. */
511
+ cursorPaging?: CursorPaging;
512
+ }
513
+ export interface Sorting {
514
+ /** Name of the field to sort by. */
515
+ fieldName?: string;
516
+ /** Sort order. */
517
+ order?: SortOrder;
518
+ }
519
+ export declare enum SortOrder {
520
+ /** Ascending sort order. */
521
+ ASC = "ASC",
522
+ /** Descending sort order. */
523
+ DESC = "DESC"
524
+ }
525
+ export interface CursorPaging {
526
+ /** Maximum number of items to return in the results. */
527
+ limit?: number | null;
528
+ /**
529
+ * Pointer to the next or previous page in the list of results.
530
+ *
531
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
532
+ * Not relevant for the first request.
533
+ */
534
+ cursor?: string | null;
535
+ }
536
+ export interface QueryPoolDefinitionsResponse {
537
+ /** List of pool definitions. */
538
+ poolDefinitions?: PoolDefinition[];
539
+ /** Metadata for the paginated results. */
540
+ metadata?: CursorPagingMetadata;
541
+ }
542
+ export interface CursorPagingMetadata {
543
+ /** Number of items returned in the response. */
544
+ count?: number | null;
545
+ /** Cursor strings that point to the next page, previous page, or both. */
546
+ cursors?: Cursors;
547
+ /**
548
+ * Whether there are more pages to retrieve following the current page.
549
+ *
550
+ * + `true`: Another page of results can be retrieved.
551
+ * + `false`: This is the last page.
552
+ */
553
+ hasNext?: boolean | null;
554
+ }
555
+ export interface Cursors {
556
+ /** Cursor string pointing to the next page in the list of results. */
557
+ next?: string | null;
558
+ /** Cursor pointing to the previous page in the list of results. */
559
+ prev?: string | null;
560
+ }
561
+ export interface AddPoolDefinitionToProgramDefinitionRequest {
562
+ /** Pool definition to assign to the program definition. */
563
+ poolDefinitionId: string;
564
+ /** Program definition that the pool definition is assigned to. */
565
+ programDefinitionId: string;
566
+ /**
567
+ * Specifies the timing of updates to associated benefit pools.
568
+ * Determines how and when changes are applied to existing and future benefit pools.
569
+ */
570
+ cascade: Cascade;
571
+ }
572
+ export interface AddPoolDefinitionToProgramDefinitionResponse {
573
+ /** Pool definition. */
574
+ poolDefinition?: PoolDefinition;
575
+ }
576
+ export interface RemovePoolDefinitionFromProgramDefinitionRequest {
577
+ /** ID of the pool definition to be removed from the program definition. */
578
+ poolDefinitionId: string;
579
+ /** ID of the program definition being removed from the pool definition. */
580
+ programDefinitionId: string;
581
+ /**
582
+ * Specifies the timing of updates to associated benefit pools.
583
+ * Determines how and when changes are applied to existing and future benefit pools.
584
+ */
585
+ cascade: Cascade;
586
+ }
587
+ export interface RemovePoolDefinitionFromProgramDefinitionResponse {
588
+ /** Updated pool definition. */
589
+ poolDefinition?: PoolDefinition;
590
+ }
591
+ export interface FindPoolDefinitionsByProgramDefinitionRequest {
592
+ /** ID of the program definition of which its assigned pool definitions are retrieved. */
593
+ programDefinitionId: string;
594
+ /**
595
+ * Application sub-module that represents the source of the pool definition. Specified by the external developer.
596
+ *
597
+ * This namespace is used to organize and retrieve pool definitions and their associated benefit pools.
598
+ *
599
+ * It should match the namespace used in the program definitions.
600
+ */
601
+ namespace: string;
602
+ }
603
+ export interface FindPoolDefinitionsByProgramDefinitionResponse {
604
+ /** Retrieved pool definitions. */
605
+ poolDefinitions?: PoolDefinition[];
606
+ }
607
+ export interface DomainEvent extends DomainEventBodyOneOf {
608
+ createdEvent?: EntityCreatedEvent;
609
+ updatedEvent?: EntityUpdatedEvent;
610
+ deletedEvent?: EntityDeletedEvent;
611
+ actionEvent?: ActionEvent;
612
+ /**
613
+ * Unique event ID.
614
+ * Allows clients to ignore duplicate webhooks.
615
+ */
616
+ _id?: string;
617
+ /**
618
+ * Assumes actions are also always typed to an entity_type
619
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
620
+ */
621
+ entityFqdn?: string;
622
+ /**
623
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
624
+ * This is although the created/updated/deleted notion is duplication of the oneof types
625
+ * Example: created/updated/deleted/started/completed/email_opened
626
+ */
627
+ slug?: string;
628
+ /** ID of the entity associated with the event. */
629
+ entityId?: string;
630
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
631
+ eventTime?: Date | null;
632
+ /**
633
+ * Whether the event was triggered as a result of a privacy regulation application
634
+ * (for example, GDPR).
635
+ */
636
+ triggeredByAnonymizeRequest?: boolean | null;
637
+ /** If present, indicates the action that triggered the event. */
638
+ originatedFrom?: string | null;
639
+ /**
640
+ * A sequence number defining the order of updates to the underlying entity.
641
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
642
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
643
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
644
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
645
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
646
+ */
647
+ entityEventSequence?: string | null;
648
+ }
649
+ /** @oneof */
650
+ export interface DomainEventBodyOneOf {
651
+ createdEvent?: EntityCreatedEvent;
652
+ updatedEvent?: EntityUpdatedEvent;
653
+ deletedEvent?: EntityDeletedEvent;
654
+ actionEvent?: ActionEvent;
655
+ }
656
+ export interface EntityCreatedEvent {
657
+ entity?: string;
658
+ }
659
+ export interface RestoreInfo {
660
+ deletedDate?: Date | null;
661
+ }
662
+ export interface EntityUpdatedEvent {
663
+ /**
664
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
665
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
666
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
667
+ */
668
+ currentEntity?: string;
669
+ }
670
+ export interface EntityDeletedEvent {
671
+ /** Entity that was deleted */
672
+ deletedEntity?: string | null;
673
+ }
674
+ export interface ActionEvent {
675
+ body?: string;
676
+ }
677
+ export interface MessageEnvelope {
678
+ /** App instance ID. */
679
+ instanceId?: string | null;
680
+ /** Event type. */
681
+ eventType?: string;
682
+ /** The identification type and identity data. */
683
+ identity?: IdentificationData;
684
+ /** Stringify payload. */
685
+ data?: string;
686
+ }
687
+ export interface IdentificationData extends IdentificationDataIdOneOf {
688
+ /** ID of a site visitor that has not logged in to the site. */
689
+ anonymousVisitorId?: string;
690
+ /** ID of a site visitor that has logged in to the site. */
691
+ memberId?: string;
692
+ /** ID of a Wix user (site owner, contributor, etc.). */
693
+ wixUserId?: string;
694
+ /** ID of an app. */
695
+ appId?: string;
696
+ /** @readonly */
697
+ identityType?: WebhookIdentityType;
698
+ }
699
+ /** @oneof */
700
+ export interface IdentificationDataIdOneOf {
701
+ /** ID of a site visitor that has not logged in to the site. */
702
+ anonymousVisitorId?: string;
703
+ /** ID of a site visitor that has logged in to the site. */
704
+ memberId?: string;
705
+ /** ID of a Wix user (site owner, contributor, etc.). */
706
+ wixUserId?: string;
707
+ /** ID of an app. */
708
+ appId?: string;
709
+ }
710
+ export declare enum WebhookIdentityType {
711
+ UNKNOWN = "UNKNOWN",
712
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
713
+ MEMBER = "MEMBER",
714
+ WIX_USER = "WIX_USER",
715
+ APP = "APP"
716
+ }
717
+ interface PolicyExpressionNotNonNullableFields {
718
+ expression?: PolicyExpressionNonNullableFields;
719
+ }
720
+ interface PolicyExpressionAndNonNullableFields {
721
+ expressions: PolicyExpressionNonNullableFields[];
722
+ }
723
+ interface PolicyExpressionOrNonNullableFields {
724
+ expressions: PolicyExpressionNonNullableFields[];
725
+ }
726
+ interface FixedIntervalPolicyNonNullableFields {
727
+ fromWeekDay: WeekDay;
728
+ toWeekDay: WeekDay;
729
+ }
730
+ interface RateLimitedPolicyNonNullableFields {
731
+ fixedIntervalOptions?: FixedIntervalPolicyNonNullableFields;
732
+ times: number;
733
+ type: RateLimitedPolicyType;
734
+ }
735
+ interface CustomPolicyNonNullableFields {
736
+ _id: string;
737
+ }
738
+ interface PolicyNonNullableFields {
739
+ fixedIntervalOptions?: FixedIntervalPolicyNonNullableFields;
740
+ rateLimitedOptions?: RateLimitedPolicyNonNullableFields;
741
+ customOptions?: CustomPolicyNonNullableFields;
742
+ type: Type;
743
+ }
744
+ interface PolicyExpressionNonNullableFields {
745
+ operatorNotOptions?: PolicyExpressionNotNonNullableFields;
746
+ operatorAndOptions?: PolicyExpressionAndNonNullableFields;
747
+ operatorOrOptions?: PolicyExpressionOrNonNullableFields;
748
+ policyOptions?: PolicyNonNullableFields;
749
+ type: PolicyExpressionType;
750
+ }
751
+ interface BenefitNonNullableFields {
752
+ benefitKey: string;
753
+ policyExpression?: PolicyExpressionNonNullableFields;
754
+ }
755
+ interface CreditConfigurationNonNullableFields {
756
+ amount: string;
757
+ }
758
+ interface DetailsNonNullableFields {
759
+ benefits: BenefitNonNullableFields[];
760
+ creditConfiguration?: CreditConfigurationNonNullableFields;
761
+ policyExpression?: PolicyExpressionNonNullableFields;
762
+ }
763
+ export interface PoolDefinitionNonNullableFields {
764
+ displayName: string;
765
+ programDefinitionIds: string[];
766
+ details?: DetailsNonNullableFields;
767
+ }
768
+ export interface CreatePoolDefinitionResponseNonNullableFields {
769
+ poolDefinition?: PoolDefinitionNonNullableFields;
770
+ }
771
+ interface ApplicationErrorNonNullableFields {
772
+ code: string;
773
+ description: string;
774
+ }
775
+ interface ItemMetadataNonNullableFields {
776
+ originalIndex: number;
777
+ success: boolean;
778
+ error?: ApplicationErrorNonNullableFields;
779
+ }
780
+ interface BulkPoolDefinitionResultNonNullableFields {
781
+ itemMetadata?: ItemMetadataNonNullableFields;
782
+ poolDefinition?: PoolDefinitionNonNullableFields;
783
+ }
784
+ interface BulkActionMetadataNonNullableFields {
785
+ totalSuccesses: number;
786
+ totalFailures: number;
787
+ undetailedFailures: number;
788
+ }
789
+ export interface BulkCreatePoolDefinitionsResponseNonNullableFields {
790
+ results: BulkPoolDefinitionResultNonNullableFields[];
791
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
792
+ }
793
+ export interface UpdatePoolDefinitionResponseNonNullableFields {
794
+ poolDefinition?: PoolDefinitionNonNullableFields;
795
+ }
796
+ export interface BulkUpdatePoolDefinitionsResponseNonNullableFields {
797
+ results: BulkPoolDefinitionResultNonNullableFields[];
798
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
799
+ }
800
+ export interface BulkDeletePoolDefinitionsResponseNonNullableFields {
801
+ results: BulkPoolDefinitionResultNonNullableFields[];
802
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
803
+ }
804
+ export interface GetPoolDefinitionResponseNonNullableFields {
805
+ poolDefinition?: PoolDefinitionNonNullableFields;
806
+ }
807
+ export interface QueryPoolDefinitionsResponseNonNullableFields {
808
+ poolDefinitions: PoolDefinitionNonNullableFields[];
809
+ }
810
+ export interface AddPoolDefinitionToProgramDefinitionResponseNonNullableFields {
811
+ poolDefinition?: PoolDefinitionNonNullableFields;
812
+ }
813
+ export interface RemovePoolDefinitionFromProgramDefinitionResponseNonNullableFields {
814
+ poolDefinition?: PoolDefinitionNonNullableFields;
815
+ }
816
+ export interface FindPoolDefinitionsByProgramDefinitionResponseNonNullableFields {
817
+ poolDefinitions: PoolDefinitionNonNullableFields[];
818
+ }
819
+ /**
820
+ * Creates a new pool definition.
821
+ *
822
+ * A pool definition can be assigned to multiple program definitions by specifying its program definition ID in the `programDefinitionIds` parameter.
823
+ *
824
+ * If `programDefinitionIds` included in the request are associated with any active programs, then new benefit pools will be instantly created and added to the programs.
825
+ *
826
+ * If you specify program definition IDs in the request, you must include the `cascade` parameter, to specify the timing of the update to existing programs.
827
+ * @param poolDefinition - Pool definition to create.
828
+ * @public
829
+ * @documentationMaturity preview
830
+ * @requiredField poolDefinition
831
+ * @requiredField poolDefinition.details
832
+ * @requiredField poolDefinition.details.benefits
833
+ * @requiredField poolDefinition.details.benefits.benefitKey
834
+ * @requiredField poolDefinition.details.benefits.providerAppId
835
+ * @requiredField poolDefinition.namespace
836
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_CREATE
837
+ * @returns Created pool definition.
838
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.CreatePoolDefinition
839
+ */
840
+ export declare function createPoolDefinition(poolDefinition: PoolDefinition, options?: CreatePoolDefinitionOptions): Promise<PoolDefinition & PoolDefinitionNonNullableFields>;
841
+ export interface CreatePoolDefinitionOptions {
842
+ /**
843
+ * Specifies the timing of updates to associated benefit pools.
844
+ * Determines how and when changes are applied to existing and future benefit pools.
845
+ * Must be provided if `programDefinitionIds` are included in the `poolDefinition` parameter.
846
+ */
847
+ cascade?: Cascade;
848
+ }
849
+ /**
850
+ * Creates new pool definitions.
851
+ * @param poolDefinitions - Pool definitions to create.
852
+ * @public
853
+ * @documentationMaturity preview
854
+ * @requiredField poolDefinitions
855
+ * @requiredField poolDefinitions.details
856
+ * @requiredField poolDefinitions.details.benefits
857
+ * @requiredField poolDefinitions.details.benefits.benefitKey
858
+ * @requiredField poolDefinitions.details.benefits.providerAppId
859
+ * @requiredField poolDefinitions.namespace
860
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_CREATE
861
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.BulkCreatePoolDefinitions
862
+ */
863
+ export declare function bulkCreatePoolDefinitions(poolDefinitions: PoolDefinition[], options?: BulkCreatePoolDefinitionsOptions): Promise<BulkCreatePoolDefinitionsResponse & BulkCreatePoolDefinitionsResponseNonNullableFields>;
864
+ export interface BulkCreatePoolDefinitionsOptions {
865
+ /**
866
+ * Specifies the timing of updates to associated benefit pools.
867
+ * Determines how and when changes are applied to existing and future benefit pools.
868
+ * Must be provided if `programDefinitionIds` are included in the `poolDefinition` parameter.
869
+ */
870
+ cascade?: Cascade;
871
+ /**
872
+ * Whether to return the full pool definition entities.
873
+ *
874
+ * Default: `false`
875
+ */
876
+ returnEntity?: boolean;
877
+ }
878
+ /**
879
+ * Updates a pool definition.
880
+ *
881
+ * Each time the pool definition is updated,
882
+ * `revision` increments by 1.
883
+ * The current `revision` must be passed when updating the pool definition.
884
+ * This ensures you're working with the latest pool definition
885
+ * and prevents unintended overwrites.
886
+ * @param _id - Pool definition ID.
887
+ * @public
888
+ * @documentationMaturity preview
889
+ * @requiredField _id
890
+ * @requiredField poolDefinition
891
+ * @requiredField poolDefinition.revision
892
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE
893
+ * @returns Updated pool definition.
894
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.UpdatePoolDefinition
895
+ */
896
+ export declare function updatePoolDefinition(_id: string | null, poolDefinition: UpdatePoolDefinition, options?: UpdatePoolDefinitionOptions): Promise<PoolDefinition & PoolDefinitionNonNullableFields>;
897
+ export interface UpdatePoolDefinition {
898
+ /**
899
+ * Pool definition ID.
900
+ * @readonly
901
+ */
902
+ _id?: string | null;
903
+ /**
904
+ * Revision number, which increments by 1 each time the pool definition is updated.
905
+ * To prevent conflicting changes, the current revision must be specified when updating the pool definition.
906
+ *
907
+ * Ignored when creating a pool definition.
908
+ * @readonly
909
+ */
910
+ revision?: string | null;
911
+ /**
912
+ * Date and time the pool definition was created.
913
+ * @readonly
914
+ */
915
+ _createdDate?: Date | null;
916
+ /**
917
+ * Date and time the pool definition was updated.
918
+ * @readonly
919
+ */
920
+ _updatedDate?: Date | null;
921
+ /** Name of the pool definition. */
922
+ displayName?: string;
923
+ /** List of program definitions that are associated with this pool definition. */
924
+ programDefinitionIds?: string[];
925
+ /**
926
+ * Benefit pool information.
927
+ *
928
+ * Includes the item, policy, and credit configurations.
929
+ */
930
+ details?: Details;
931
+ /**
932
+ * Application sub-module that represents the source of the pool definition. Specified by the external developer.
933
+ *
934
+ * This namespace is used to organize and retrieve pool definitions and their associated benefit pools.
935
+ *
936
+ * It should match the namespace used in the program definitions.
937
+ */
938
+ namespace?: string | null;
939
+ /**
940
+ * Custom field data for the pool definition object.
941
+ *
942
+ * [Extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields) must be configured in the app dashboard before they can be accessed with API calls.
943
+ */
944
+ extendedFields?: ExtendedFields;
945
+ }
946
+ export interface UpdatePoolDefinitionOptions {
947
+ /**
948
+ * Specifies the timing of updates to associated benefit pools.
949
+ * Determines how and when changes are applied to existing and future benefit pools.
950
+ * Required field.
951
+ */
952
+ cascade?: Cascade;
953
+ }
954
+ /**
955
+ * Updates multiple pool definitions.
956
+ * @public
957
+ * @documentationMaturity preview
958
+ * @requiredField options.poolDefinitions.poolDefinition
959
+ * @requiredField options.poolDefinitions.poolDefinition._id
960
+ * @requiredField options.poolDefinitions.poolDefinition.revision
961
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE
962
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.BulkUpdatePoolDefinitions
963
+ */
964
+ export declare function bulkUpdatePoolDefinitions(options?: BulkUpdatePoolDefinitionsOptions): Promise<BulkUpdatePoolDefinitionsResponse & BulkUpdatePoolDefinitionsResponseNonNullableFields>;
965
+ export interface BulkUpdatePoolDefinitionsOptions {
966
+ /** Pool definitions to update. */
967
+ poolDefinitions?: MaskedPoolDefinition[];
968
+ /**
969
+ * Specifies the timing of updates to associated benefit pools.
970
+ * Determines how and when changes are applied to existing and future benefit pools.
971
+ * Required field.
972
+ */
973
+ cascade?: Cascade;
974
+ /**
975
+ * Whether to return the full pool definition entities.
976
+ *
977
+ * Default: `false`
978
+ */
979
+ returnEntity?: boolean;
980
+ }
981
+ /**
982
+ * Deletes a pool definition.
983
+ * @param poolDefinitionId - ID of the pool definition to delete.
984
+ * @public
985
+ * @documentationMaturity preview
986
+ * @requiredField poolDefinitionId
987
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_DELETE
988
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.DeletePoolDefinition
989
+ */
990
+ export declare function deletePoolDefinition(poolDefinitionId: string, options?: DeletePoolDefinitionOptions): Promise<void>;
991
+ export interface DeletePoolDefinitionOptions {
992
+ /**
993
+ * Defines how the delete operation cascades to related pools.
994
+ * Specifies the timing of deletion regarding associated benefit pools.
995
+ * Required if the pool definition is associated with any program definition IDs.
996
+ */
997
+ cascade?: Cascade;
998
+ }
999
+ /**
1000
+ * Delete multiple pool definitions.
1001
+ * @param poolDefinitionIds - ID of the pool definitions to delete.
1002
+ * @public
1003
+ * @documentationMaturity preview
1004
+ * @requiredField poolDefinitionIds
1005
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_DELETE
1006
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.BulkDeletePoolDefinitions
1007
+ */
1008
+ export declare function bulkDeletePoolDefinitions(poolDefinitionIds: string[], options?: BulkDeletePoolDefinitionsOptions): Promise<BulkDeletePoolDefinitionsResponse & BulkDeletePoolDefinitionsResponseNonNullableFields>;
1009
+ export interface BulkDeletePoolDefinitionsOptions {
1010
+ /**
1011
+ * Specifies the timing of updates to associated benefit pools.
1012
+ * Required if any of the pool definitions listed for deletion are associated with a program definition ID.
1013
+ */
1014
+ cascade?: Cascade;
1015
+ }
1016
+ /**
1017
+ * Retrieves a pool definition.
1018
+ * @param poolDefinitionId - ID of the pool definition to retrieve.
1019
+ * @public
1020
+ * @documentationMaturity preview
1021
+ * @requiredField poolDefinitionId
1022
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_READ
1023
+ * @applicableIdentity VISITOR
1024
+ * @returns Retrieved pool definition.
1025
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.GetPoolDefinition
1026
+ */
1027
+ export declare function getPoolDefinition(poolDefinitionId: string): Promise<PoolDefinition & PoolDefinitionNonNullableFields>;
1028
+ /**
1029
+ * Creates a query to retrieve a list of pool definitions.
1030
+ *
1031
+ * The `queryPoolDefinitions()` method builds a query to retrieve a list of pool definitions and returns a `PoolDefinitionsQueryBuilder` object.
1032
+ *
1033
+ * The returned object contains the query definition, which is used to run the query using the [`find()`](/pool-definitions/pool-definitions-query-builder/find) function.
1034
+ *
1035
+ * You can refine the query by chaining `PoolDefinitionsQueryBuilder` methods onto the query. `PoolDefinitionsQueryBuilder` methods enable you to filter, sort, and control the results that `queryPoolDefinitions()` returns.
1036
+ *
1037
+ * The following `PoolDefinitionsQueryBuilder` functions are supported for `queryPoolDefinitions()`. For a full description of the pool definition object, see the object returned for the [`items`](/pool-definitions/pool-definitions-query-result/items) property in `PoolDefinitionsQueryResult`.
1038
+ * @public
1039
+ * @documentationMaturity preview
1040
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_READ
1041
+ * @applicableIdentity VISITOR
1042
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.QueryPoolDefinitions
1043
+ */
1044
+ export declare function queryPoolDefinitions(): PoolDefinitionsQueryBuilder;
1045
+ interface QueryCursorResult {
1046
+ cursors: Cursors;
1047
+ hasNext: () => boolean;
1048
+ hasPrev: () => boolean;
1049
+ length: number;
1050
+ pageSize: number;
1051
+ }
1052
+ export interface PoolDefinitionsQueryResult extends QueryCursorResult {
1053
+ items: PoolDefinition[];
1054
+ query: PoolDefinitionsQueryBuilder;
1055
+ next: () => Promise<PoolDefinitionsQueryResult>;
1056
+ prev: () => Promise<PoolDefinitionsQueryResult>;
1057
+ }
1058
+ export interface PoolDefinitionsQueryBuilder {
1059
+ /** @param propertyName - Property whose value is compared with `value`.
1060
+ * @param value - Value to compare against.
1061
+ * @documentationMaturity preview
1062
+ */
1063
+ eq: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder;
1064
+ /** @param propertyName - Property whose value is compared with `value`.
1065
+ * @param value - Value to compare against.
1066
+ * @documentationMaturity preview
1067
+ */
1068
+ ne: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder;
1069
+ /** @param propertyName - Property whose value is compared with `value`.
1070
+ * @param value - Value to compare against.
1071
+ * @documentationMaturity preview
1072
+ */
1073
+ ge: (propertyName: '_createdDate', value: any) => PoolDefinitionsQueryBuilder;
1074
+ /** @param propertyName - Property whose value is compared with `value`.
1075
+ * @param value - Value to compare against.
1076
+ * @documentationMaturity preview
1077
+ */
1078
+ gt: (propertyName: '_createdDate', value: any) => PoolDefinitionsQueryBuilder;
1079
+ /** @param propertyName - Property whose value is compared with `value`.
1080
+ * @param value - Value to compare against.
1081
+ * @documentationMaturity preview
1082
+ */
1083
+ le: (propertyName: '_createdDate', value: any) => PoolDefinitionsQueryBuilder;
1084
+ /** @param propertyName - Property whose value is compared with `value`.
1085
+ * @param value - Value to compare against.
1086
+ * @documentationMaturity preview
1087
+ */
1088
+ lt: (propertyName: '_createdDate', value: any) => PoolDefinitionsQueryBuilder;
1089
+ /** @param propertyName - Property whose value is compared with `string`.
1090
+ * @param string - String to compare against. Case-insensitive.
1091
+ * @documentationMaturity preview
1092
+ */
1093
+ startsWith: (propertyName: '_id' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: string) => PoolDefinitionsQueryBuilder;
1094
+ /** @param propertyName - Property whose value is compared with `values`.
1095
+ * @param values - List of values to compare against.
1096
+ * @documentationMaturity preview
1097
+ */
1098
+ hasSome: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any[]) => PoolDefinitionsQueryBuilder;
1099
+ /** @param propertyName - Property whose value is compared with `values`.
1100
+ * @param values - List of values to compare against.
1101
+ * @documentationMaturity preview
1102
+ */
1103
+ hasAll: (propertyName: 'programDefinitionIds', value: any[]) => PoolDefinitionsQueryBuilder;
1104
+ /** @documentationMaturity preview */
1105
+ in: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: any) => PoolDefinitionsQueryBuilder;
1106
+ /** @documentationMaturity preview */
1107
+ exists: (propertyName: '_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace', value: boolean) => PoolDefinitionsQueryBuilder;
1108
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1109
+ * @documentationMaturity preview
1110
+ */
1111
+ ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace'>) => PoolDefinitionsQueryBuilder;
1112
+ /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1113
+ * @documentationMaturity preview
1114
+ */
1115
+ descending: (...propertyNames: Array<'_id' | '_createdDate' | 'programDefinitionIds' | 'details.benefits.itemSetId' | 'details.benefits.providerAppId' | 'namespace'>) => PoolDefinitionsQueryBuilder;
1116
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1117
+ * @documentationMaturity preview
1118
+ */
1119
+ limit: (limit: number) => PoolDefinitionsQueryBuilder;
1120
+ /** @param cursor - A pointer to specific record
1121
+ * @documentationMaturity preview
1122
+ */
1123
+ skipTo: (cursor: string) => PoolDefinitionsQueryBuilder;
1124
+ /** @documentationMaturity preview */
1125
+ find: () => Promise<PoolDefinitionsQueryResult>;
1126
+ }
1127
+ /**
1128
+ * Assign a pool definition to a program definition.
1129
+ *
1130
+ * Links program definitions to existing pool definition so the defined pools will be included in the associated programs when they are provisioned.
1131
+ * @param poolDefinitionId - Pool definition to assign to the program definition.
1132
+ * @public
1133
+ * @documentationMaturity preview
1134
+ * @requiredField options
1135
+ * @requiredField options.cascade
1136
+ * @requiredField options.programDefinitionId
1137
+ * @requiredField poolDefinitionId
1138
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE
1139
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.AddPoolDefinitionToProgramDefinition
1140
+ */
1141
+ export declare function addPoolDefinitionToProgramDefinition(poolDefinitionId: string, options: AddPoolDefinitionToProgramDefinitionOptions): Promise<AddPoolDefinitionToProgramDefinitionResponse & AddPoolDefinitionToProgramDefinitionResponseNonNullableFields>;
1142
+ export interface AddPoolDefinitionToProgramDefinitionOptions {
1143
+ /** Program definition that the pool definition is assigned to. */
1144
+ programDefinitionId: string;
1145
+ /**
1146
+ * Specifies the timing of updates to associated benefit pools.
1147
+ * Determines how and when changes are applied to existing and future benefit pools.
1148
+ */
1149
+ cascade: Cascade;
1150
+ }
1151
+ /**
1152
+ * Unassign a pool definition from a program definition.
1153
+ *
1154
+ * This action prevents the programs from including the specified benefit pool in future provisioning cycles.
1155
+ *
1156
+ * Can modify or exclude benefit pools from active programs.
1157
+ * @param poolDefinitionId - ID of the pool definition to be removed from the program definition.
1158
+ * @public
1159
+ * @documentationMaturity preview
1160
+ * @requiredField options
1161
+ * @requiredField options.cascade
1162
+ * @requiredField options.programDefinitionId
1163
+ * @requiredField poolDefinitionId
1164
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_UPDATE
1165
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.RemovePoolDefinitionFromProgramDefinition
1166
+ */
1167
+ export declare function removePoolDefinitionFromProgramDefinition(poolDefinitionId: string, options: RemovePoolDefinitionFromProgramDefinitionOptions): Promise<RemovePoolDefinitionFromProgramDefinitionResponse & RemovePoolDefinitionFromProgramDefinitionResponseNonNullableFields>;
1168
+ export interface RemovePoolDefinitionFromProgramDefinitionOptions {
1169
+ /** ID of the program definition being removed from the pool definition. */
1170
+ programDefinitionId: string;
1171
+ /**
1172
+ * Specifies the timing of updates to associated benefit pools.
1173
+ * Determines how and when changes are applied to existing and future benefit pools.
1174
+ */
1175
+ cascade: Cascade;
1176
+ }
1177
+ /**
1178
+ * Retrieve all pool definitions associated with a specific program definition.
1179
+ *
1180
+ * Find multiple pool definitions that belong to a given program definition.
1181
+ * @param programDefinitionId - ID of the program definition of which its assigned pool definitions are retrieved.
1182
+ * @public
1183
+ * @documentationMaturity preview
1184
+ * @requiredField options
1185
+ * @requiredField options.namespace
1186
+ * @requiredField programDefinitionId
1187
+ * @permissionId BENEFIT_PROGRAMS.POOL_DEFINITION_READ
1188
+ * @applicableIdentity VISITOR
1189
+ * @fqn wix.benefit_programs.v1.pool_definition.PoolDefinitionService.FindPoolDefinitionsByProgramDefinition
1190
+ */
1191
+ export declare function findPoolDefinitionsByProgramDefinition(programDefinitionId: string, options: FindPoolDefinitionsByProgramDefinitionOptions): Promise<FindPoolDefinitionsByProgramDefinitionResponse & FindPoolDefinitionsByProgramDefinitionResponseNonNullableFields>;
1192
+ export interface FindPoolDefinitionsByProgramDefinitionOptions {
1193
+ /**
1194
+ * Application sub-module that represents the source of the pool definition. Specified by the external developer.
1195
+ *
1196
+ * This namespace is used to organize and retrieve pool definitions and their associated benefit pools.
1197
+ *
1198
+ * It should match the namespace used in the program definitions.
1199
+ */
1200
+ namespace: string;
1201
+ }
1202
+ export {};