@wix/auto_sdk_benefit-programs_balances 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-balance-balances.context.d.ts +10 -0
  11. package/build/cjs/src/benefit-programs-v1-balance-balances.context.js +20 -0
  12. package/build/cjs/src/benefit-programs-v1-balance-balances.context.js.map +1 -0
  13. package/build/cjs/src/benefit-programs-v1-balance-balances.http.d.ts +37 -0
  14. package/build/cjs/src/benefit-programs-v1-balance-balances.http.js +346 -0
  15. package/build/cjs/src/benefit-programs-v1-balance-balances.http.js.map +1 -0
  16. package/build/cjs/src/benefit-programs-v1-balance-balances.meta.d.ts +24 -0
  17. package/build/cjs/src/benefit-programs-v1-balance-balances.meta.js +142 -0
  18. package/build/cjs/src/benefit-programs-v1-balance-balances.meta.js.map +1 -0
  19. package/build/cjs/src/benefit-programs-v1-balance-balances.public.d.ts +72 -0
  20. package/build/cjs/src/benefit-programs-v1-balance-balances.public.js +50 -0
  21. package/build/cjs/src/benefit-programs-v1-balance-balances.public.js.map +1 -0
  22. package/build/cjs/src/benefit-programs-v1-balance-balances.types.d.ts +671 -0
  23. package/build/cjs/src/benefit-programs-v1-balance-balances.types.js +64 -0
  24. package/build/cjs/src/benefit-programs-v1-balance-balances.types.js.map +1 -0
  25. package/build/cjs/src/benefit-programs-v1-balance-balances.universal.d.ts +911 -0
  26. package/build/cjs/src/benefit-programs-v1-balance-balances.universal.js +381 -0
  27. package/build/cjs/src/benefit-programs-v1-balance-balances.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-balance-balances.context.d.ts +10 -0
  39. package/build/es/src/benefit-programs-v1-balance-balances.context.js +10 -0
  40. package/build/es/src/benefit-programs-v1-balance-balances.context.js.map +1 -0
  41. package/build/es/src/benefit-programs-v1-balance-balances.http.d.ts +37 -0
  42. package/build/es/src/benefit-programs-v1-balance-balances.http.js +337 -0
  43. package/build/es/src/benefit-programs-v1-balance-balances.http.js.map +1 -0
  44. package/build/es/src/benefit-programs-v1-balance-balances.meta.d.ts +24 -0
  45. package/build/es/src/benefit-programs-v1-balance-balances.meta.js +110 -0
  46. package/build/es/src/benefit-programs-v1-balance-balances.meta.js.map +1 -0
  47. package/build/es/src/benefit-programs-v1-balance-balances.public.d.ts +72 -0
  48. package/build/es/src/benefit-programs-v1-balance-balances.public.js +34 -0
  49. package/build/es/src/benefit-programs-v1-balance-balances.public.js.map +1 -0
  50. package/build/es/src/benefit-programs-v1-balance-balances.types.d.ts +671 -0
  51. package/build/es/src/benefit-programs-v1-balance-balances.types.js +61 -0
  52. package/build/es/src/benefit-programs-v1-balance-balances.types.js.map +1 -0
  53. package/build/es/src/benefit-programs-v1-balance-balances.universal.d.ts +911 -0
  54. package/build/es/src/benefit-programs-v1-balance-balances.universal.js +349 -0
  55. package/build/es/src/benefit-programs-v1-balance-balances.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-balance-balances.context.d.ts +10 -0
  66. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.js +20 -0
  67. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.js.map +1 -0
  68. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.d.ts +37 -0
  69. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.js +346 -0
  70. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.js.map +1 -0
  71. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.d.ts +24 -0
  72. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.js +142 -0
  73. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.js.map +1 -0
  74. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.d.ts +72 -0
  75. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.js +50 -0
  76. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.js.map +1 -0
  77. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.d.ts +671 -0
  78. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.js +64 -0
  79. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.js.map +1 -0
  80. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.d.ts +911 -0
  81. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.js +381 -0
  82. package/build/internal/cjs/src/benefit-programs-v1-balance-balances.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-balance-balances.context.d.ts +10 -0
  93. package/build/internal/es/src/benefit-programs-v1-balance-balances.context.js +10 -0
  94. package/build/internal/es/src/benefit-programs-v1-balance-balances.context.js.map +1 -0
  95. package/build/internal/es/src/benefit-programs-v1-balance-balances.http.d.ts +37 -0
  96. package/build/internal/es/src/benefit-programs-v1-balance-balances.http.js +337 -0
  97. package/build/internal/es/src/benefit-programs-v1-balance-balances.http.js.map +1 -0
  98. package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.d.ts +24 -0
  99. package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.js +110 -0
  100. package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.js.map +1 -0
  101. package/build/internal/es/src/benefit-programs-v1-balance-balances.public.d.ts +72 -0
  102. package/build/internal/es/src/benefit-programs-v1-balance-balances.public.js +34 -0
  103. package/build/internal/es/src/benefit-programs-v1-balance-balances.public.js.map +1 -0
  104. package/build/internal/es/src/benefit-programs-v1-balance-balances.types.d.ts +671 -0
  105. package/build/internal/es/src/benefit-programs-v1-balance-balances.types.js +61 -0
  106. package/build/internal/es/src/benefit-programs-v1-balance-balances.types.js.map +1 -0
  107. package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.d.ts +911 -0
  108. package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.js +349 -0
  109. package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,671 @@
1
+ export interface Balance {
2
+ /** Balance ID, which is the same as its associated pool ID. */
3
+ id?: string;
4
+ /**
5
+ * Revision number, which increments by 1 each time the balance is updated.
6
+ * To prevent conflicting changes, the current revision must be passed when updating the balance.
7
+ * @readonly
8
+ */
9
+ revision?: string | null;
10
+ /**
11
+ * Date and time the balance was created.
12
+ * @readonly
13
+ */
14
+ createdDate?: Date | null;
15
+ /**
16
+ * Date and time the balance was updated.
17
+ * @readonly
18
+ */
19
+ updatedDate?: Date | null;
20
+ /**
21
+ * Identity of the individual that enrolled in the program associated with this pool balance.
22
+ * @readonly
23
+ */
24
+ beneficiary?: CommonIdentificationData;
25
+ /**
26
+ * Benefit pool balance.
27
+ * @readonly
28
+ */
29
+ amount?: BalanceAmount;
30
+ /**
31
+ * Pool information.
32
+ * @readonly
33
+ */
34
+ poolInfo?: PoolInfo;
35
+ /**
36
+ * Custom field data for the balance object.
37
+ * [Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls.
38
+ */
39
+ extendedFields?: ExtendedFields;
40
+ /**
41
+ * Last transaction ID that triggered the change in balance.
42
+ * @readonly
43
+ */
44
+ lastTransactionId?: string | null;
45
+ }
46
+ export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
47
+ /** ID of a site visitor that has not logged in to the site. */
48
+ anonymousVisitorId?: string;
49
+ /** ID of a site visitor that has logged in to the site. */
50
+ memberId?: string;
51
+ /** ID of a Wix user (site owner, contributor, etc.). */
52
+ wixUserId?: string;
53
+ }
54
+ /** @oneof */
55
+ export interface CommonIdentificationDataIdOneOf {
56
+ /** ID of a site visitor that has not logged in to the site. */
57
+ anonymousVisitorId?: string;
58
+ /** ID of a site visitor that has logged in to the site. */
59
+ memberId?: string;
60
+ /** ID of a Wix user (site owner, contributor, etc.). */
61
+ wixUserId?: string;
62
+ }
63
+ export declare enum IdentityType {
64
+ /** Unknown type. This value is not used. */
65
+ UNKNOWN = "UNKNOWN",
66
+ /** A site visitor who has not logged in. */
67
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
68
+ /** A logged-in site member. */
69
+ MEMBER = "MEMBER",
70
+ /** A Wix account holder, such as a site owner or contributor. */
71
+ WIX_USER = "WIX_USER"
72
+ }
73
+ export interface BalanceAmount {
74
+ /**
75
+ * Total credits available in the benefit pool.
76
+ * @readonly
77
+ */
78
+ available?: string;
79
+ }
80
+ export interface PoolInfo {
81
+ /**
82
+ * Pool ID.
83
+ *
84
+ * Represents the ID of the benefit pool linked to this balance.
85
+ * @readonly
86
+ */
87
+ id?: string;
88
+ /**
89
+ * Pool definition that this benefit pool was instantiated from.
90
+ * @readonly
91
+ */
92
+ poolDefinitionId?: string | null;
93
+ /**
94
+ * Program definition from which this benefit pool's program was provisioned from.
95
+ * @readonly
96
+ */
97
+ programDefinitionId?: string | null;
98
+ /**
99
+ * Active program that this benefit pool belongs to.
100
+ * @readonly
101
+ */
102
+ programId?: string | null;
103
+ /** Total credits available in this benefit pool */
104
+ creditAmount?: string | null;
105
+ /** Module that is the source of this benefit pool creation. */
106
+ namespace?: string | null;
107
+ }
108
+ export interface ExtendedFields {
109
+ /**
110
+ * Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
111
+ * The value of each key is structured according to the schema defined when the extended fields were configured.
112
+ *
113
+ * You can only access fields for which you have the appropriate permissions.
114
+ *
115
+ * Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
116
+ */
117
+ namespaces?: Record<string, Record<string, any>>;
118
+ }
119
+ export interface GetBalanceRequest {
120
+ /** ID of the pool from which to retrieve the balance. */
121
+ poolId: string;
122
+ }
123
+ export interface GetBalanceResponse {
124
+ /** Retrieved balance. */
125
+ balance?: Balance;
126
+ }
127
+ export interface ListBalancesRequest {
128
+ /** IDs of the pools from which to receive the balances. */
129
+ poolIds?: string[];
130
+ /** Cursor paging */
131
+ cursorPaging?: CursorPaging;
132
+ }
133
+ export interface CursorPaging {
134
+ /** Maximum number of items to return in the results. */
135
+ limit?: number | null;
136
+ /**
137
+ * Pointer to the next or previous page in the list of results.
138
+ *
139
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
140
+ * Not relevant for the first request.
141
+ */
142
+ cursor?: string | null;
143
+ }
144
+ export interface ListBalancesResponse {
145
+ /** Balances. */
146
+ balances?: Balance[];
147
+ /** Metadata for paginated results. */
148
+ metadata?: CursorPagingMetadata;
149
+ }
150
+ export interface CursorPagingMetadata {
151
+ /** Number of items returned in the response. */
152
+ count?: number | null;
153
+ /** Cursor strings that point to the next page, previous page, or both. */
154
+ cursors?: Cursors;
155
+ /**
156
+ * Whether there are more pages to retrieve following the current page.
157
+ *
158
+ * + `true`: Another page of results can be retrieved.
159
+ * + `false`: This is the last page.
160
+ */
161
+ hasNext?: boolean | null;
162
+ }
163
+ export interface Cursors {
164
+ /** Cursor string pointing to the next page in the list of results. */
165
+ next?: string | null;
166
+ /** Cursor pointing to the previous page in the list of results. */
167
+ prev?: string | null;
168
+ }
169
+ export interface QueryBalancesRequest {
170
+ /** Query to select balances. */
171
+ query?: CursorQuery;
172
+ }
173
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
174
+ /** 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`. */
175
+ cursorPaging?: CursorPaging;
176
+ /**
177
+ * Filter object in the following format:
178
+ * `"filter" : {
179
+ * "fieldName1": "value1",
180
+ * "fieldName2":{"$operator":"value2"}
181
+ * }`
182
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
183
+ */
184
+ filter?: Record<string, any> | null;
185
+ /**
186
+ * Sort object in the following format:
187
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
188
+ */
189
+ sort?: Sorting[];
190
+ }
191
+ /** @oneof */
192
+ export interface CursorQueryPagingMethodOneOf {
193
+ /** 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`. */
194
+ cursorPaging?: CursorPaging;
195
+ }
196
+ export interface Sorting {
197
+ /** Name of the field to sort by. */
198
+ fieldName?: string;
199
+ /** Sort order. */
200
+ order?: SortOrder;
201
+ }
202
+ export declare enum SortOrder {
203
+ /** Ascending sort order. */
204
+ ASC = "ASC",
205
+ /** Descending sort order. */
206
+ DESC = "DESC"
207
+ }
208
+ export interface QueryBalancesResponse {
209
+ /** List of balances. */
210
+ balances?: Balance[];
211
+ /** Metadata for the paginated results. */
212
+ metadata?: CursorPagingMetadata;
213
+ }
214
+ export interface BalanceChangeBalanceRequest extends BalanceChangeBalanceRequestOperationOneOf {
215
+ /** Set the amount of credits to adjust the balance to. */
216
+ adjustOptions?: AdjustOptions;
217
+ /** Sets the balance to a specific amount. */
218
+ setOptions?: SetOptions;
219
+ /** ID of the benefit pool to adjust. */
220
+ poolId: string;
221
+ /**
222
+ * Unique identifier, generated by the client.
223
+ * Used to recognize repeated attempts to make the same request.
224
+ */
225
+ idempotencyKey: string;
226
+ /**
227
+ * Party requesting the balance change.
228
+ *
229
+ * Possible values could include:
230
+ *
231
+ * + App owner.
232
+ *
233
+ * + Pool beneficiary.
234
+ *
235
+ * + Site admin.
236
+ */
237
+ instructingParty?: CommonIdentificationData;
238
+ /**
239
+ * Specify the type of operation to change the balance. Depending on the selected balance change type, you must use the corresponding `adjustOptions` or `setOptions` parameter.
240
+ *
241
+ * Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
242
+ * For example, if there is a currently 10 credits, and you use `ADJUST` with an amount of 5, the resulting balance will be 15 credits (10+5) after the adjustment.
243
+ *
244
+ * Use `SET` to change the entire balance to a specified amount.
245
+ * For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
246
+ */
247
+ type?: ChangeBalanceRequestType;
248
+ /** Transaction details associated with the balance change. */
249
+ transactionDetails?: TransactionDetails;
250
+ }
251
+ /** @oneof */
252
+ export interface BalanceChangeBalanceRequestOperationOneOf {
253
+ /** Set the amount of credits to adjust the balance to. */
254
+ adjustOptions?: AdjustOptions;
255
+ /** Sets the balance to a specific amount. */
256
+ setOptions?: SetOptions;
257
+ }
258
+ export declare enum ChangeBalanceRequestType {
259
+ /** Unknown type of balance operation. */
260
+ UNKNOWN_OPERATION = "UNKNOWN_OPERATION",
261
+ /** Adjust the current balance by a specific amount. */
262
+ ADJUST = "ADJUST",
263
+ /** Set the balance to a specific amount. */
264
+ SET = "SET",
265
+ SET_INITIAL = "SET_INITIAL"
266
+ }
267
+ export interface AdjustOptions {
268
+ /** Amount to adjust the available balance by. Supports positive and negative values. */
269
+ value?: string;
270
+ /** Benefit pool owner associated with this balance. */
271
+ beneficiary?: CommonIdentificationData;
272
+ }
273
+ export declare enum LimitRule {
274
+ /** Unknown limit rule */
275
+ UNKNOWN_LIMIT_RULE = "UNKNOWN_LIMIT_RULE",
276
+ /** If the limit is exceeded, the operation will fail */
277
+ FAIL = "FAIL",
278
+ /** If the limit is exceeded, the operation will succeed but the balance never goes beyond the provided limits. For balance that was already outside of provided limits, it will not be changed. */
279
+ SOFT_ENFORCE = "SOFT_ENFORCE",
280
+ /** If the limit is exceeded, the operation will succeed but the balance will be adjusted so that it satisfies the provided limits. If the resulting balance is below the lower_limit, it will be set to the lower_limit. If the resulting balance is above the upper_limit, it will be set to the upper_limit. */
281
+ HARD_ENFORCE = "HARD_ENFORCE"
282
+ }
283
+ export interface SetOptions {
284
+ /**
285
+ * Set the available balance to the provided amount.
286
+ *
287
+ * If the value set to is equal to the current balance, no action or corresponding transaction occurs.
288
+ */
289
+ value?: string;
290
+ /** Benefit pool owner associated with this balance. */
291
+ beneficiary?: CommonIdentificationData;
292
+ }
293
+ export interface SetInitialOptions {
294
+ /** Set the available balance to the provided amount. */
295
+ value?: string;
296
+ /** Benefit pool owner associated with this balance. */
297
+ beneficiary?: CommonIdentificationData;
298
+ }
299
+ export interface TransactionDetails {
300
+ /**
301
+ * Item associated with the balance change.
302
+ * The redemption of this item triggered the balance adjustment.
303
+ * @readonly
304
+ */
305
+ item?: Item;
306
+ /** Quantity of an item related to the balance change. */
307
+ itemCount?: number | null;
308
+ /**
309
+ * Date and time the transaction was made.
310
+ * @readonly
311
+ */
312
+ effectiveDate?: Date | null;
313
+ /**
314
+ * Reason for the transaction. For example, `Redemption` or `Manual adjustment`.
315
+ * @readonly
316
+ */
317
+ reason?: string | null;
318
+ }
319
+ export interface Item {
320
+ /**
321
+ * Item ID.
322
+ * @readonly
323
+ */
324
+ id?: string | null;
325
+ /**
326
+ * External item ID.
327
+ * @readonly
328
+ */
329
+ externalId?: string | null;
330
+ /**
331
+ * Item category. Distinguishes between different types of items. For example, `posts`, `groups`, `events`.
332
+ * @readonly
333
+ */
334
+ category?: string | null;
335
+ /** @readonly */
336
+ itemSetId?: string | null;
337
+ /**
338
+ * Item display name.
339
+ * @readonly
340
+ */
341
+ displayName?: string | null;
342
+ }
343
+ export interface ChangeBalanceResponse {
344
+ /** Changed balance. */
345
+ balance?: Balance;
346
+ /** ID of the transaction resulting from the balance adjustment. */
347
+ transactionId?: string | null;
348
+ }
349
+ export interface BalanceExceededLimits {
350
+ /** Current balance */
351
+ balance?: BalanceAmount;
352
+ /**
353
+ * The requested amount
354
+ * @readonly
355
+ */
356
+ requested?: string;
357
+ /**
358
+ * Lower limit
359
+ * @readonly
360
+ */
361
+ lowerLimit?: string | null;
362
+ /**
363
+ * Upper limit
364
+ * @readonly
365
+ */
366
+ upperLimit?: string | null;
367
+ }
368
+ export interface BulkChangeBalancesRequest {
369
+ /** Requests */
370
+ requests?: ChangeBalanceRequest[];
371
+ /**
372
+ * Unique identifier, generated by the client.
373
+ * Used to recognize repeated attempts to make the same request.
374
+ */
375
+ idempotencyKey: string;
376
+ /** Whether to return the entity in the response */
377
+ returnEntity?: boolean;
378
+ }
379
+ export declare enum Type {
380
+ /** Unknown type of balance operation. */
381
+ UNKNOWN_OPERATION = "UNKNOWN_OPERATION"
382
+ }
383
+ export interface ChangeBalanceRequest extends ChangeBalanceRequestOperationOneOf {
384
+ /** ID of the benefit pool to adjust. */
385
+ poolId?: string;
386
+ /**
387
+ * Party requesting the balance change.
388
+ *
389
+ * Possible values could include:
390
+ *
391
+ * + App owner.
392
+ *
393
+ * + Pool beneficiary.
394
+ *
395
+ * + Site admin.
396
+ */
397
+ instructingParty?: CommonIdentificationData;
398
+ /**
399
+ * Specify the type of operation to change the balance. Depending on the selected balance change type, you must use the corresponding `adjustOptions` or `setOptions` parameter.
400
+ *
401
+ * Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
402
+ * For example, if there is a currently 10 credits, and you use `ADJUST` with an amount of 5, the resulting balance will be 15 credits (10+5) after the adjustment.
403
+ *
404
+ * Use `SET` to change the entire balance to a specified amount.
405
+ * For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
406
+ */
407
+ type?: Type;
408
+ /** Transaction details associated with the balance change. */
409
+ transactionDetails?: TransactionDetails;
410
+ }
411
+ /** @oneof */
412
+ export interface ChangeBalanceRequestOperationOneOf {
413
+ }
414
+ export interface BulkChangeBalancesResponse {
415
+ /** Results */
416
+ results?: BulkChangeBalanceResult[];
417
+ /** Metadata for the bulk action */
418
+ bulkActionMetadata?: BulkActionMetadata;
419
+ }
420
+ export interface ItemMetadata {
421
+ /** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
422
+ id?: string | null;
423
+ /** Index of the item within the request array. Allows for correlation between request and response items. */
424
+ originalIndex?: number;
425
+ /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
426
+ success?: boolean;
427
+ /** Details about the error in case of failure. */
428
+ error?: ApplicationError;
429
+ }
430
+ export interface ApplicationError {
431
+ /** Error code. */
432
+ code?: string;
433
+ /** Description of the error. */
434
+ description?: string;
435
+ /** Data related to the error. */
436
+ data?: Record<string, any> | null;
437
+ }
438
+ export interface BulkChangeBalanceResult {
439
+ /** Metadata for the item */
440
+ itemMetadata?: ItemMetadata;
441
+ /** Only exists if `returnEntity` was set to `true` in the request */
442
+ balance?: Balance;
443
+ }
444
+ export interface BulkActionMetadata {
445
+ /** Number of items that were successfully processed. */
446
+ totalSuccesses?: number;
447
+ /** Number of items that couldn't be processed. */
448
+ totalFailures?: number;
449
+ /** Number of failures without details because detailed failure threshold was exceeded. */
450
+ undetailedFailures?: number;
451
+ }
452
+ export interface RevertBalanceChangeRequest {
453
+ /** ID of the resulting transaction from the balance adjustment. */
454
+ transactionId: string;
455
+ /**
456
+ * Unique identifier, generated by the client.
457
+ * Used to recognize repeated attempts to make the same request.
458
+ */
459
+ idempotencyKey: string;
460
+ /**
461
+ * Party requesting the balance change.
462
+ *
463
+ * Possible values could include:
464
+ *
465
+ * + App owner.
466
+ *
467
+ * + Pool beneficiary.
468
+ *
469
+ * + Site admin.
470
+ */
471
+ instructingParty?: CommonIdentificationData;
472
+ }
473
+ export interface RevertBalanceChangeResponse {
474
+ /** ID of the resulting transaction from the balance adjustment. */
475
+ transactionId?: string | null;
476
+ }
477
+ export interface ChangeAlreadyReverted {
478
+ /** The id of the transaction which was already reverted */
479
+ originalTransactionId?: string;
480
+ /** The id of the transaction which reverted the original transaction */
481
+ revertedTransactionId?: string;
482
+ }
483
+ export interface NotEnoughBalance {
484
+ /** Current balance */
485
+ balance?: BalanceAmount;
486
+ /**
487
+ * The requested amount
488
+ * @readonly
489
+ */
490
+ requested?: string;
491
+ }
492
+ export interface GetTransactionReversibilityRequest {
493
+ /** Id of the transaction to get the reversibility */
494
+ transactionId?: string;
495
+ }
496
+ export interface GetTransactionReversibilityResponse {
497
+ /** The result of transaction reversibility validation */
498
+ transactionReversibility?: TransactionReversibility;
499
+ }
500
+ /** Transaction reversibility results */
501
+ export declare enum TransactionReversibility {
502
+ /** Transaction is allowed to be reverted */
503
+ TRANSACTION_IS_REVERSIBLE = "TRANSACTION_IS_REVERSIBLE",
504
+ /** Transaction isn't allowed to be reverted, because it was already reverted */
505
+ TRANSACTION_ALREADY_REVERSED = "TRANSACTION_ALREADY_REVERSED"
506
+ }
507
+ export interface DomainEvent extends DomainEventBodyOneOf {
508
+ createdEvent?: EntityCreatedEvent;
509
+ updatedEvent?: EntityUpdatedEvent;
510
+ deletedEvent?: EntityDeletedEvent;
511
+ actionEvent?: ActionEvent;
512
+ /**
513
+ * Unique event ID.
514
+ * Allows clients to ignore duplicate webhooks.
515
+ */
516
+ id?: string;
517
+ /**
518
+ * Assumes actions are also always typed to an entity_type
519
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
520
+ */
521
+ entityFqdn?: string;
522
+ /**
523
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
524
+ * This is although the created/updated/deleted notion is duplication of the oneof types
525
+ * Example: created/updated/deleted/started/completed/email_opened
526
+ */
527
+ slug?: string;
528
+ /** ID of the entity associated with the event. */
529
+ entityId?: string;
530
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
531
+ eventTime?: Date | null;
532
+ /**
533
+ * Whether the event was triggered as a result of a privacy regulation application
534
+ * (for example, GDPR).
535
+ */
536
+ triggeredByAnonymizeRequest?: boolean | null;
537
+ /** If present, indicates the action that triggered the event. */
538
+ originatedFrom?: string | null;
539
+ /**
540
+ * A sequence number defining the order of updates to the underlying entity.
541
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
542
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
543
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
544
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
545
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
546
+ */
547
+ entityEventSequence?: string | null;
548
+ }
549
+ /** @oneof */
550
+ export interface DomainEventBodyOneOf {
551
+ createdEvent?: EntityCreatedEvent;
552
+ updatedEvent?: EntityUpdatedEvent;
553
+ deletedEvent?: EntityDeletedEvent;
554
+ actionEvent?: ActionEvent;
555
+ }
556
+ export interface EntityCreatedEvent {
557
+ entityAsJson?: string;
558
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
559
+ restoreInfo?: RestoreInfo;
560
+ }
561
+ export interface RestoreInfo {
562
+ deletedDate?: Date | null;
563
+ }
564
+ export interface EntityUpdatedEvent {
565
+ /**
566
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
567
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
568
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
569
+ */
570
+ currentEntityAsJson?: string;
571
+ }
572
+ export interface EntityDeletedEvent {
573
+ /** Entity that was deleted */
574
+ deletedEntityAsJson?: string | null;
575
+ }
576
+ export interface ActionEvent {
577
+ bodyAsJson?: string;
578
+ }
579
+ export interface MessageEnvelope {
580
+ /** App instance ID. */
581
+ instanceId?: string | null;
582
+ /** Event type. */
583
+ eventType?: string;
584
+ /** The identification type and identity data. */
585
+ identity?: IdentificationData;
586
+ /** Stringify payload. */
587
+ data?: string;
588
+ }
589
+ export interface IdentificationData extends IdentificationDataIdOneOf {
590
+ /** ID of a site visitor that has not logged in to the site. */
591
+ anonymousVisitorId?: string;
592
+ /** ID of a site visitor that has logged in to the site. */
593
+ memberId?: string;
594
+ /** ID of a Wix user (site owner, contributor, etc.). */
595
+ wixUserId?: string;
596
+ /** ID of an app. */
597
+ appId?: string;
598
+ /** @readonly */
599
+ identityType?: WebhookIdentityType;
600
+ }
601
+ /** @oneof */
602
+ export interface IdentificationDataIdOneOf {
603
+ /** ID of a site visitor that has not logged in to the site. */
604
+ anonymousVisitorId?: string;
605
+ /** ID of a site visitor that has logged in to the site. */
606
+ memberId?: string;
607
+ /** ID of a Wix user (site owner, contributor, etc.). */
608
+ wixUserId?: string;
609
+ /** ID of an app. */
610
+ appId?: string;
611
+ }
612
+ export declare enum WebhookIdentityType {
613
+ UNKNOWN = "UNKNOWN",
614
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
615
+ MEMBER = "MEMBER",
616
+ WIX_USER = "WIX_USER",
617
+ APP = "APP"
618
+ }
619
+ interface CommonIdentificationDataNonNullableFields {
620
+ anonymousVisitorId: string;
621
+ memberId: string;
622
+ wixUserId: string;
623
+ identityType: IdentityType;
624
+ }
625
+ interface BalanceAmountNonNullableFields {
626
+ available: string;
627
+ }
628
+ interface PoolInfoNonNullableFields {
629
+ id: string;
630
+ }
631
+ interface BalanceNonNullableFields {
632
+ id: string;
633
+ beneficiary?: CommonIdentificationDataNonNullableFields;
634
+ amount?: BalanceAmountNonNullableFields;
635
+ poolInfo?: PoolInfoNonNullableFields;
636
+ }
637
+ export interface GetBalanceResponseNonNullableFields {
638
+ balance?: BalanceNonNullableFields;
639
+ }
640
+ export interface ListBalancesResponseNonNullableFields {
641
+ balances: BalanceNonNullableFields[];
642
+ }
643
+ export interface QueryBalancesResponseNonNullableFields {
644
+ balances: BalanceNonNullableFields[];
645
+ }
646
+ export interface ChangeBalanceResponseNonNullableFields {
647
+ balance?: BalanceNonNullableFields;
648
+ }
649
+ interface ApplicationErrorNonNullableFields {
650
+ code: string;
651
+ description: string;
652
+ }
653
+ interface ItemMetadataNonNullableFields {
654
+ originalIndex: number;
655
+ success: boolean;
656
+ error?: ApplicationErrorNonNullableFields;
657
+ }
658
+ interface BulkChangeBalanceResultNonNullableFields {
659
+ itemMetadata?: ItemMetadataNonNullableFields;
660
+ balance?: BalanceNonNullableFields;
661
+ }
662
+ interface BulkActionMetadataNonNullableFields {
663
+ totalSuccesses: number;
664
+ totalFailures: number;
665
+ undetailedFailures: number;
666
+ }
667
+ export interface BulkChangeBalancesResponseNonNullableFields {
668
+ results: BulkChangeBalanceResultNonNullableFields[];
669
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
670
+ }
671
+ export {};