@wix/auto_sdk_benefit-programs_balances 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/cjs/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/cjs/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/cjs/src/benefit-programs-v1-balance-balances.http.js +15 -51
- package/build/cjs/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.meta.js +1 -20
- package/build/cjs/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/cjs/src/benefit-programs-v1-balance-balances.public.js +1 -7
- package/build/cjs/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.types.d.ts +67 -136
- package/build/cjs/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/cjs/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/cjs/src/benefit-programs-v1-balance-balances.universal.d.ts +94 -220
- package/build/cjs/src/benefit-programs-v1-balance-balances.universal.js +22 -65
- package/build/cjs/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/es/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/es/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/es/src/benefit-programs-v1-balance-balances.http.js +14 -49
- package/build/es/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/es/src/benefit-programs-v1-balance-balances.meta.js +0 -18
- package/build/es/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/es/src/benefit-programs-v1-balance-balances.public.js +1 -6
- package/build/es/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.types.d.ts +67 -136
- package/build/es/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/es/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/es/src/benefit-programs-v1-balance-balances.universal.d.ts +94 -220
- package/build/es/src/benefit-programs-v1-balance-balances.universal.js +21 -63
- package/build/es/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.js +15 -51
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.js +1 -20
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.js +1 -7
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.d.ts +67 -136
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.d.ts +94 -220
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.js +22 -65
- package/build/internal/cjs/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.context.d.ts +2 -3
- package/build/internal/es/src/benefit-programs-v1-balance-balances.context.js +1 -2
- package/build/internal/es/src/benefit-programs-v1-balance-balances.context.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.http.d.ts +14 -17
- package/build/internal/es/src/benefit-programs-v1-balance-balances.http.js +14 -49
- package/build/internal/es/src/benefit-programs-v1-balance-balances.http.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.d.ts +0 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.js +0 -18
- package/build/internal/es/src/benefit-programs-v1-balance-balances.meta.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.public.d.ts +20 -26
- package/build/internal/es/src/benefit-programs-v1-balance-balances.public.js +1 -6
- package/build/internal/es/src/benefit-programs-v1-balance-balances.public.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.types.d.ts +67 -136
- package/build/internal/es/src/benefit-programs-v1-balance-balances.types.js +4 -5
- package/build/internal/es/src/benefit-programs-v1-balance-balances.types.js.map +1 -1
- package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.d.ts +94 -220
- package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.js +21 -63
- package/build/internal/es/src/benefit-programs-v1-balance-balances.universal.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export interface Balance {
|
|
2
2
|
/**
|
|
3
|
-
* Balance ID
|
|
3
|
+
* Balance ID. This is the same as the associated pool's ID.
|
|
4
4
|
* @format GUID
|
|
5
5
|
* @immutable
|
|
6
6
|
*/
|
|
@@ -22,17 +22,17 @@ export interface Balance {
|
|
|
22
22
|
*/
|
|
23
23
|
_updatedDate?: Date | null;
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Beneficiary of the associated pool.
|
|
26
26
|
* @readonly
|
|
27
27
|
*/
|
|
28
28
|
beneficiary?: CommonIdentificationData;
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
30
|
+
* Available credits.
|
|
31
31
|
* @readonly
|
|
32
32
|
*/
|
|
33
33
|
amount?: BalanceAmount;
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Associated pool information.
|
|
36
36
|
* @readonly
|
|
37
37
|
*/
|
|
38
38
|
poolInfo?: PoolInfo;
|
|
@@ -42,7 +42,7 @@ export interface Balance {
|
|
|
42
42
|
*/
|
|
43
43
|
extendedFields?: ExtendedFields;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* ID of the transaction associated with the most recent change to the balance.
|
|
46
46
|
* @format GUID
|
|
47
47
|
* @readonly
|
|
48
48
|
*/
|
|
@@ -50,17 +50,17 @@ export interface Balance {
|
|
|
50
50
|
}
|
|
51
51
|
export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
|
|
52
52
|
/**
|
|
53
|
-
* ID of a site visitor that
|
|
53
|
+
* ID of a site visitor that hasn't logged in to the site.
|
|
54
54
|
* @format GUID
|
|
55
55
|
*/
|
|
56
56
|
anonymousVisitorId?: string;
|
|
57
57
|
/**
|
|
58
|
-
* ID of a site
|
|
58
|
+
* ID of a site member.
|
|
59
59
|
* @format GUID
|
|
60
60
|
*/
|
|
61
61
|
memberId?: string;
|
|
62
62
|
/**
|
|
63
|
-
* ID of a Wix user
|
|
63
|
+
* ID of a Wix user.
|
|
64
64
|
* @format GUID
|
|
65
65
|
*/
|
|
66
66
|
wixUserId?: string;
|
|
@@ -68,17 +68,17 @@ export interface CommonIdentificationData extends CommonIdentificationDataIdOneO
|
|
|
68
68
|
/** @oneof */
|
|
69
69
|
export interface CommonIdentificationDataIdOneOf {
|
|
70
70
|
/**
|
|
71
|
-
* ID of a site visitor that
|
|
71
|
+
* ID of a site visitor that hasn't logged in to the site.
|
|
72
72
|
* @format GUID
|
|
73
73
|
*/
|
|
74
74
|
anonymousVisitorId?: string;
|
|
75
75
|
/**
|
|
76
|
-
* ID of a site
|
|
76
|
+
* ID of a site member.
|
|
77
77
|
* @format GUID
|
|
78
78
|
*/
|
|
79
79
|
memberId?: string;
|
|
80
80
|
/**
|
|
81
|
-
* ID of a Wix user
|
|
81
|
+
* ID of a Wix user.
|
|
82
82
|
* @format GUID
|
|
83
83
|
*/
|
|
84
84
|
wixUserId?: string;
|
|
@@ -95,7 +95,7 @@ export declare enum IdentityType {
|
|
|
95
95
|
}
|
|
96
96
|
export interface BalanceAmount {
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Amount of available credits.
|
|
99
99
|
* @decimalValue options { maxScale:4 }
|
|
100
100
|
* @readonly
|
|
101
101
|
*/
|
|
@@ -104,37 +104,35 @@ export interface BalanceAmount {
|
|
|
104
104
|
export interface PoolInfo {
|
|
105
105
|
/**
|
|
106
106
|
* Pool ID.
|
|
107
|
-
*
|
|
108
|
-
* Represents the ID of the benefit pool linked to this balance.
|
|
109
107
|
* @format GUID
|
|
110
108
|
* @readonly
|
|
111
109
|
*/
|
|
112
110
|
_id?: string;
|
|
113
111
|
/**
|
|
114
|
-
*
|
|
112
|
+
* ID of the pool definition the pool was created from.
|
|
115
113
|
* @format GUID
|
|
116
114
|
* @readonly
|
|
117
115
|
*/
|
|
118
116
|
poolDefinitionId?: string | null;
|
|
119
117
|
/**
|
|
120
|
-
*
|
|
118
|
+
* ID of the program definition the pool was created from.
|
|
121
119
|
* @format GUID
|
|
122
120
|
* @readonly
|
|
123
121
|
*/
|
|
124
122
|
programDefinitionId?: string | null;
|
|
125
123
|
/**
|
|
126
|
-
*
|
|
124
|
+
* ID of the program that contains the pool.
|
|
127
125
|
* @format GUID
|
|
128
126
|
* @readonly
|
|
129
127
|
*/
|
|
130
128
|
programId?: string | null;
|
|
131
129
|
/**
|
|
132
|
-
*
|
|
130
|
+
* Available credits.
|
|
133
131
|
* @decimalValue options { gte:0, maxScale:4 }
|
|
134
132
|
*/
|
|
135
133
|
creditAmount?: string | null;
|
|
136
134
|
/**
|
|
137
|
-
*
|
|
135
|
+
* Namespace for your app or site's benefit programs.
|
|
138
136
|
* @minLength 1
|
|
139
137
|
* @maxLength 50
|
|
140
138
|
*/
|
|
@@ -153,7 +151,7 @@ export interface ExtendedFields {
|
|
|
153
151
|
}
|
|
154
152
|
export interface GetBalanceRequest {
|
|
155
153
|
/**
|
|
156
|
-
* ID of the pool
|
|
154
|
+
* ID of the pool associated with the balance to retrieve. This is also the ID of the balance.
|
|
157
155
|
* @format GUID
|
|
158
156
|
*/
|
|
159
157
|
poolId: string;
|
|
@@ -164,12 +162,12 @@ export interface GetBalanceResponse {
|
|
|
164
162
|
}
|
|
165
163
|
export interface ListBalancesRequest {
|
|
166
164
|
/**
|
|
167
|
-
* IDs of the pools
|
|
165
|
+
* List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.
|
|
168
166
|
* @format GUID
|
|
169
167
|
* @maxSize 100
|
|
170
168
|
*/
|
|
171
169
|
poolIds?: string[];
|
|
172
|
-
/** Cursor paging */
|
|
170
|
+
/** Cursor paging. */
|
|
173
171
|
cursorPaging?: CursorPaging;
|
|
174
172
|
}
|
|
175
173
|
export interface CursorPaging {
|
|
@@ -189,7 +187,7 @@ export interface CursorPaging {
|
|
|
189
187
|
}
|
|
190
188
|
export interface ListBalancesResponse {
|
|
191
189
|
/**
|
|
192
|
-
*
|
|
190
|
+
* Retrieved balances.
|
|
193
191
|
* @maxSize 100
|
|
194
192
|
*/
|
|
195
193
|
balances?: Balance[];
|
|
@@ -222,7 +220,7 @@ export interface Cursors {
|
|
|
222
220
|
prev?: string | null;
|
|
223
221
|
}
|
|
224
222
|
export interface QueryBalancesRequest {
|
|
225
|
-
/**
|
|
223
|
+
/** Filter, sort, and paging to apply to the query. */
|
|
226
224
|
query?: CursorQuery;
|
|
227
225
|
}
|
|
228
226
|
export interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
@@ -265,18 +263,18 @@ export declare enum SortOrder {
|
|
|
265
263
|
DESC = "DESC"
|
|
266
264
|
}
|
|
267
265
|
export interface QueryBalancesResponse {
|
|
268
|
-
/** List of balances. */
|
|
266
|
+
/** List of retrieved balances. */
|
|
269
267
|
balances?: Balance[];
|
|
270
268
|
/** Metadata for the paginated results. */
|
|
271
269
|
metadata?: CursorPagingMetadata;
|
|
272
270
|
}
|
|
273
271
|
export interface BalanceChangeBalanceRequest extends BalanceChangeBalanceRequestOperationOneOf {
|
|
274
|
-
/**
|
|
272
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
275
273
|
adjustOptions?: AdjustOptions;
|
|
276
|
-
/**
|
|
274
|
+
/** Set the balance to a specific amount of credits. */
|
|
277
275
|
setOptions?: SetOptions;
|
|
278
276
|
/**
|
|
279
|
-
* ID of the
|
|
277
|
+
* ID of the pool associated with the balance to change. This is also the ID of the balance.
|
|
280
278
|
* @format GUID
|
|
281
279
|
*/
|
|
282
280
|
poolId: string;
|
|
@@ -286,54 +284,37 @@ export interface BalanceChangeBalanceRequest extends BalanceChangeBalanceRequest
|
|
|
286
284
|
* @maxLength 200
|
|
287
285
|
*/
|
|
288
286
|
idempotencyKey: string;
|
|
289
|
-
/**
|
|
290
|
-
* Party requesting the balance change.
|
|
291
|
-
*
|
|
292
|
-
* Possible values could include:
|
|
293
|
-
*
|
|
294
|
-
* + App owner.
|
|
295
|
-
*
|
|
296
|
-
* + Pool beneficiary.
|
|
297
|
-
*
|
|
298
|
-
* + Site admin.
|
|
299
|
-
*/
|
|
287
|
+
/** Identity changing the balance. */
|
|
300
288
|
instructingParty?: CommonIdentificationData;
|
|
301
|
-
/**
|
|
302
|
-
* 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.
|
|
303
|
-
*
|
|
304
|
-
* Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
|
|
305
|
-
* 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.
|
|
306
|
-
*
|
|
307
|
-
* Use `SET` to change the entire balance to a specified amount.
|
|
308
|
-
* For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
|
|
309
|
-
*/
|
|
289
|
+
/** Balance change type. */
|
|
310
290
|
type?: ChangeBalanceRequestType;
|
|
311
|
-
/**
|
|
291
|
+
/** Details to send to the transaction created from this balance change. */
|
|
312
292
|
transactionDetails?: TransactionDetails;
|
|
313
293
|
}
|
|
314
294
|
/** @oneof */
|
|
315
295
|
export interface BalanceChangeBalanceRequestOperationOneOf {
|
|
316
|
-
/**
|
|
296
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
317
297
|
adjustOptions?: AdjustOptions;
|
|
318
|
-
/**
|
|
298
|
+
/** Set the balance to a specific amount of credits. */
|
|
319
299
|
setOptions?: SetOptions;
|
|
320
300
|
}
|
|
321
301
|
export declare enum ChangeBalanceRequestType {
|
|
322
|
-
/** Unknown
|
|
302
|
+
/** Unknown balance change type. */
|
|
323
303
|
UNKNOWN_OPERATION = "UNKNOWN_OPERATION",
|
|
324
|
-
/**
|
|
304
|
+
/** Use with `adjustOptions`. */
|
|
325
305
|
ADJUST = "ADJUST",
|
|
326
|
-
/**
|
|
327
|
-
SET = "SET"
|
|
328
|
-
SET_INITIAL = "SET_INITIAL"
|
|
306
|
+
/** Use with `setOptions`. */
|
|
307
|
+
SET = "SET"
|
|
329
308
|
}
|
|
330
309
|
export interface AdjustOptions {
|
|
331
310
|
/**
|
|
332
|
-
* Amount to
|
|
311
|
+
* Amount to change the balance's available credits by.
|
|
312
|
+
* - To increase the balance, specify a positive number.
|
|
313
|
+
* - To decrease the balance, specify a negative number.
|
|
333
314
|
* @decimalValue options { maxScale:4 }
|
|
334
315
|
*/
|
|
335
316
|
value?: string;
|
|
336
|
-
/**
|
|
317
|
+
/** Beneficiary of the associated pool. */
|
|
337
318
|
beneficiary?: CommonIdentificationData;
|
|
338
319
|
}
|
|
339
320
|
export declare enum LimitRule {
|
|
@@ -348,13 +329,13 @@ export declare enum LimitRule {
|
|
|
348
329
|
}
|
|
349
330
|
export interface SetOptions {
|
|
350
331
|
/**
|
|
351
|
-
*
|
|
332
|
+
* Amount to set the balance's available credits to.
|
|
352
333
|
*
|
|
353
|
-
* If
|
|
334
|
+
* If this is the same as the current value, no transaction is created.
|
|
354
335
|
* @decimalValue options { maxScale:4 }
|
|
355
336
|
*/
|
|
356
337
|
value?: string;
|
|
357
|
-
/**
|
|
338
|
+
/** Beneficiary of the associated pool. */
|
|
358
339
|
beneficiary?: CommonIdentificationData;
|
|
359
340
|
}
|
|
360
341
|
export interface SetInitialOptions {
|
|
@@ -368,20 +349,19 @@ export interface SetInitialOptions {
|
|
|
368
349
|
}
|
|
369
350
|
export interface TransactionDetails {
|
|
370
351
|
/**
|
|
371
|
-
* Item associated with the
|
|
372
|
-
* The redemption of this item triggered the balance adjustment.
|
|
352
|
+
* Item associated with the transaction.
|
|
373
353
|
* @readonly
|
|
374
354
|
*/
|
|
375
355
|
item?: Item;
|
|
376
|
-
/**
|
|
356
|
+
/** Amount of items associated with the transaction. */
|
|
377
357
|
itemCount?: number | null;
|
|
378
358
|
/**
|
|
379
|
-
* Date and time the transaction was
|
|
359
|
+
* Date and time the transaction was created.
|
|
380
360
|
* @readonly
|
|
381
361
|
*/
|
|
382
362
|
effectiveDate?: Date | null;
|
|
383
363
|
/**
|
|
384
|
-
* Reason for the transaction. For example, `Redemption
|
|
364
|
+
* Reason for the transaction. For example, `Redemption`.
|
|
385
365
|
* @readonly
|
|
386
366
|
* @maxLength 256
|
|
387
367
|
*/
|
|
@@ -395,34 +375,35 @@ export interface Item {
|
|
|
395
375
|
*/
|
|
396
376
|
_id?: string | null;
|
|
397
377
|
/**
|
|
398
|
-
*
|
|
378
|
+
* Item external ID.
|
|
399
379
|
* @format GUID
|
|
400
380
|
* @readonly
|
|
401
381
|
*/
|
|
402
382
|
externalId?: string | null;
|
|
403
383
|
/**
|
|
404
|
-
* Item category.
|
|
384
|
+
* Item category.
|
|
405
385
|
* @maxLength 20
|
|
406
386
|
* @readonly
|
|
407
387
|
*/
|
|
408
388
|
category?: string | null;
|
|
409
389
|
/**
|
|
390
|
+
* Item set ID.
|
|
410
391
|
* @format GUID
|
|
411
392
|
* @readonly
|
|
412
393
|
*/
|
|
413
394
|
itemSetId?: string | null;
|
|
414
395
|
/**
|
|
415
|
-
* Item
|
|
396
|
+
* Item name.
|
|
416
397
|
* @maxLength 64
|
|
417
398
|
* @readonly
|
|
418
399
|
*/
|
|
419
400
|
displayName?: string | null;
|
|
420
401
|
}
|
|
421
402
|
export interface ChangeBalanceResponse {
|
|
422
|
-
/**
|
|
403
|
+
/** Updated balance. */
|
|
423
404
|
balance?: Balance;
|
|
424
405
|
/**
|
|
425
|
-
* ID of the transaction
|
|
406
|
+
* ID of the transaction associated with this change in balance.
|
|
426
407
|
* @format GUID
|
|
427
408
|
*/
|
|
428
409
|
transactionId?: string | null;
|
|
@@ -451,7 +432,7 @@ export interface BalanceExceededLimits {
|
|
|
451
432
|
}
|
|
452
433
|
export interface BulkChangeBalancesRequest {
|
|
453
434
|
/**
|
|
454
|
-
*
|
|
435
|
+
* List of balances to change.
|
|
455
436
|
* @minSize 1
|
|
456
437
|
* @maxSize 100
|
|
457
438
|
*/
|
|
@@ -461,43 +442,25 @@ export interface BulkChangeBalancesRequest {
|
|
|
461
442
|
* Used to recognize repeated attempts to make the same request.
|
|
462
443
|
* @maxLength 200
|
|
463
444
|
*/
|
|
464
|
-
idempotencyKey
|
|
465
|
-
/** Whether to return the
|
|
445
|
+
idempotencyKey?: string;
|
|
446
|
+
/** Whether to return the full balance entities in the response. */
|
|
466
447
|
returnEntity?: boolean;
|
|
467
448
|
}
|
|
468
449
|
export declare enum Type {
|
|
469
|
-
/** Unknown
|
|
450
|
+
/** Unknown balance change type. */
|
|
470
451
|
UNKNOWN_OPERATION = "UNKNOWN_OPERATION"
|
|
471
452
|
}
|
|
472
453
|
export interface ChangeBalanceRequest extends ChangeBalanceRequestOperationOneOf {
|
|
473
454
|
/**
|
|
474
|
-
* ID of the
|
|
455
|
+
* ID of the pool associated with the balance to change. This is also the ID of the balance.
|
|
475
456
|
* @format GUID
|
|
476
457
|
*/
|
|
477
458
|
poolId?: string;
|
|
478
|
-
/**
|
|
479
|
-
* Party requesting the balance change.
|
|
480
|
-
*
|
|
481
|
-
* Possible values could include:
|
|
482
|
-
*
|
|
483
|
-
* + App owner.
|
|
484
|
-
*
|
|
485
|
-
* + Pool beneficiary.
|
|
486
|
-
*
|
|
487
|
-
* + Site admin.
|
|
488
|
-
*/
|
|
459
|
+
/** Identity changing the balance. */
|
|
489
460
|
instructingParty?: CommonIdentificationData;
|
|
490
|
-
/**
|
|
491
|
-
* 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.
|
|
492
|
-
*
|
|
493
|
-
* Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
|
|
494
|
-
* 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.
|
|
495
|
-
*
|
|
496
|
-
* Use `SET` to change the entire balance to a specified amount.
|
|
497
|
-
* For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
|
|
498
|
-
*/
|
|
461
|
+
/** Balance change type. */
|
|
499
462
|
type?: Type;
|
|
500
|
-
/**
|
|
463
|
+
/** Details to send to the transaction created from this balance change. */
|
|
501
464
|
transactionDetails?: TransactionDetails;
|
|
502
465
|
}
|
|
503
466
|
/** @oneof */
|
|
@@ -505,12 +468,12 @@ export interface ChangeBalanceRequestOperationOneOf {
|
|
|
505
468
|
}
|
|
506
469
|
export interface BulkChangeBalancesResponse {
|
|
507
470
|
/**
|
|
508
|
-
*
|
|
471
|
+
* Updated item and associated metadata.
|
|
509
472
|
* @minSize 1
|
|
510
473
|
* @maxSize 100
|
|
511
474
|
*/
|
|
512
475
|
results?: BulkChangeBalanceResult[];
|
|
513
|
-
/** Metadata
|
|
476
|
+
/** Metadata. */
|
|
514
477
|
bulkActionMetadata?: BulkActionMetadata;
|
|
515
478
|
}
|
|
516
479
|
export interface ItemMetadata {
|
|
@@ -535,9 +498,9 @@ export interface ApplicationError {
|
|
|
535
498
|
data?: Record<string, any> | null;
|
|
536
499
|
}
|
|
537
500
|
export interface BulkChangeBalanceResult {
|
|
538
|
-
/**
|
|
501
|
+
/** Item metadata. */
|
|
539
502
|
itemMetadata?: ItemMetadata;
|
|
540
|
-
/**
|
|
503
|
+
/** Updated item. */
|
|
541
504
|
balance?: Balance;
|
|
542
505
|
}
|
|
543
506
|
export interface BulkActionMetadata {
|
|
@@ -550,7 +513,7 @@ export interface BulkActionMetadata {
|
|
|
550
513
|
}
|
|
551
514
|
export interface RevertBalanceChangeRequest {
|
|
552
515
|
/**
|
|
553
|
-
* ID of the
|
|
516
|
+
* ID of the transaction associated with the balance change to revert.
|
|
554
517
|
* @format GUID
|
|
555
518
|
*/
|
|
556
519
|
transactionId: string;
|
|
@@ -560,22 +523,12 @@ export interface RevertBalanceChangeRequest {
|
|
|
560
523
|
* @maxLength 200
|
|
561
524
|
*/
|
|
562
525
|
idempotencyKey: string;
|
|
563
|
-
/**
|
|
564
|
-
* Party requesting the balance change.
|
|
565
|
-
*
|
|
566
|
-
* Possible values could include:
|
|
567
|
-
*
|
|
568
|
-
* + App owner.
|
|
569
|
-
*
|
|
570
|
-
* + Pool beneficiary.
|
|
571
|
-
*
|
|
572
|
-
* + Site admin.
|
|
573
|
-
*/
|
|
526
|
+
/** Identity reverting the balance change. */
|
|
574
527
|
instructingParty?: CommonIdentificationData;
|
|
575
528
|
}
|
|
576
529
|
export interface RevertBalanceChangeResponse {
|
|
577
530
|
/**
|
|
578
|
-
* ID of the
|
|
531
|
+
* ID of the transaction associated with the balance reversion.
|
|
579
532
|
* @format GUID
|
|
580
533
|
*/
|
|
581
534
|
transactionId?: string | null;
|
|
@@ -790,31 +743,9 @@ export interface QueryBalancesResponseNonNullableFields {
|
|
|
790
743
|
export interface ChangeBalanceResponseNonNullableFields {
|
|
791
744
|
balance?: BalanceNonNullableFields;
|
|
792
745
|
}
|
|
793
|
-
interface ApplicationErrorNonNullableFields {
|
|
794
|
-
code: string;
|
|
795
|
-
description: string;
|
|
796
|
-
}
|
|
797
|
-
interface ItemMetadataNonNullableFields {
|
|
798
|
-
originalIndex: number;
|
|
799
|
-
success: boolean;
|
|
800
|
-
error?: ApplicationErrorNonNullableFields;
|
|
801
|
-
}
|
|
802
|
-
interface BulkChangeBalanceResultNonNullableFields {
|
|
803
|
-
itemMetadata?: ItemMetadataNonNullableFields;
|
|
804
|
-
balance?: BalanceNonNullableFields;
|
|
805
|
-
}
|
|
806
|
-
interface BulkActionMetadataNonNullableFields {
|
|
807
|
-
totalSuccesses: number;
|
|
808
|
-
totalFailures: number;
|
|
809
|
-
undetailedFailures: number;
|
|
810
|
-
}
|
|
811
|
-
export interface BulkChangeBalancesResponseNonNullableFields {
|
|
812
|
-
results: BulkChangeBalanceResultNonNullableFields[];
|
|
813
|
-
bulkActionMetadata?: BulkActionMetadataNonNullableFields;
|
|
814
|
-
}
|
|
815
746
|
/**
|
|
816
|
-
* Retrieves a
|
|
817
|
-
* @param poolId - ID of the pool
|
|
747
|
+
* Retrieves a balance.
|
|
748
|
+
* @param poolId - ID of the pool associated with the balance to retrieve. This is also the ID of the balance.
|
|
818
749
|
* @public
|
|
819
750
|
* @documentationMaturity preview
|
|
820
751
|
* @requiredField poolId
|
|
@@ -831,7 +762,7 @@ export interface BulkChangeBalancesResponseNonNullableFields {
|
|
|
831
762
|
*/
|
|
832
763
|
export declare function getBalance(poolId: string): Promise<Balance & BalanceNonNullableFields>;
|
|
833
764
|
/**
|
|
834
|
-
* Retrieves a list of
|
|
765
|
+
* Retrieves a list of balances.
|
|
835
766
|
* @public
|
|
836
767
|
* @documentationMaturity preview
|
|
837
768
|
* @permissionId BENEFIT_PROGRAMS.BALANCE_READ
|
|
@@ -847,24 +778,26 @@ export declare function getBalance(poolId: string): Promise<Balance & BalanceNon
|
|
|
847
778
|
export declare function listBalances(options?: ListBalancesOptions): Promise<ListBalancesResponse & ListBalancesResponseNonNullableFields>;
|
|
848
779
|
export interface ListBalancesOptions {
|
|
849
780
|
/**
|
|
850
|
-
* IDs of the pools
|
|
781
|
+
* List of IDs of the pools associated with the balances to retrieve. These are also the IDs of the balances.
|
|
851
782
|
* @format GUID
|
|
852
783
|
* @maxSize 100
|
|
853
784
|
*/
|
|
854
785
|
poolIds?: string[];
|
|
855
|
-
/** Cursor paging */
|
|
786
|
+
/** Cursor paging. */
|
|
856
787
|
cursorPaging?: CursorPaging;
|
|
857
788
|
}
|
|
858
789
|
/**
|
|
859
790
|
* Creates a query to retrieve a list of balances.
|
|
860
791
|
*
|
|
861
|
-
* The
|
|
792
|
+
* The Query Balances method builds a query to retrieve a list of balances and returns a `BalancesQueryBuilder` object.
|
|
793
|
+
*
|
|
794
|
+
* The returned object contains the query definition, which is used to run the query using the `find()` method.
|
|
862
795
|
*
|
|
863
|
-
*
|
|
796
|
+
* You can refine the query by chaining `BalancesQueryBuilder` methods onto the query. `BalancesQueryBuilder` methods enable you to filter, sort, and control the results that Query Balances returns.
|
|
864
797
|
*
|
|
865
|
-
*
|
|
798
|
+
* Query Balances has a default paging limit of 50, which you can override.
|
|
866
799
|
*
|
|
867
|
-
*
|
|
800
|
+
* For a full description of the item object, see the object returned for the `items` property in `BalancesQueryResult`.
|
|
868
801
|
* @public
|
|
869
802
|
* @documentationMaturity preview
|
|
870
803
|
* @permissionScope SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
@@ -956,11 +889,10 @@ export interface BalancesQueryBuilder {
|
|
|
956
889
|
find: () => Promise<BalancesQueryResult>;
|
|
957
890
|
}
|
|
958
891
|
/**
|
|
959
|
-
*
|
|
892
|
+
* Changes the amount of available credits in a balance.
|
|
960
893
|
*
|
|
961
|
-
*
|
|
962
|
-
*
|
|
963
|
-
* @param poolId - ID of the benefit pool to adjust.
|
|
894
|
+
* You can adjust or set the amount of available credits.
|
|
895
|
+
* @param poolId - ID of the pool associated with the balance to change. This is also the ID of the balance.
|
|
964
896
|
* @param idempotencyKey - Unique identifier, generated by the client.
|
|
965
897
|
* Used to recognize repeated attempts to make the same request.
|
|
966
898
|
* @public
|
|
@@ -976,80 +908,32 @@ export interface BalancesQueryBuilder {
|
|
|
976
908
|
*/
|
|
977
909
|
export declare function changeBalance(poolId: string, idempotencyKey: string, options?: ChangeBalanceOptions): Promise<ChangeBalanceResponse & ChangeBalanceResponseNonNullableFields>;
|
|
978
910
|
export interface ChangeBalanceOptions extends ChangeBalanceOptionsOperationOneOf {
|
|
979
|
-
/**
|
|
980
|
-
* Party requesting the balance change.
|
|
981
|
-
*
|
|
982
|
-
* Possible values could include:
|
|
983
|
-
*
|
|
984
|
-
* + App owner.
|
|
985
|
-
*
|
|
986
|
-
* + Pool beneficiary.
|
|
987
|
-
*
|
|
988
|
-
* + Site admin.
|
|
989
|
-
*/
|
|
911
|
+
/** Identity changing the balance. */
|
|
990
912
|
instructingParty?: CommonIdentificationData;
|
|
991
|
-
/**
|
|
992
|
-
* 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.
|
|
993
|
-
*
|
|
994
|
-
* Use `ADJUST` to specify the number of credits to apply to the current balance of the benefit pool.
|
|
995
|
-
* 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.
|
|
996
|
-
*
|
|
997
|
-
* Use `SET` to change the entire balance to a specified amount.
|
|
998
|
-
* For example, if you apply `SET` with an amount of 10 credits, the resulting balance will be 10 credits, regardless of the initial balance.
|
|
999
|
-
*/
|
|
913
|
+
/** Balance change type. */
|
|
1000
914
|
type?: ChangeBalanceRequestType;
|
|
1001
|
-
/**
|
|
915
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
1002
916
|
adjustOptions?: AdjustOptions;
|
|
1003
|
-
/**
|
|
917
|
+
/** Set the balance to a specific amount of credits. */
|
|
1004
918
|
setOptions?: SetOptions;
|
|
1005
|
-
/**
|
|
919
|
+
/** Details to send to the transaction created from this balance change. */
|
|
1006
920
|
transactionDetails?: TransactionDetails;
|
|
1007
921
|
}
|
|
1008
922
|
/** @oneof */
|
|
1009
923
|
export interface ChangeBalanceOptionsOperationOneOf {
|
|
1010
|
-
/**
|
|
924
|
+
/** Adjust the balance by a specific amount of credits. */
|
|
1011
925
|
adjustOptions?: AdjustOptions;
|
|
1012
|
-
/**
|
|
926
|
+
/** Set the balance to a specific amount of credits. */
|
|
1013
927
|
setOptions?: SetOptions;
|
|
1014
928
|
}
|
|
1015
929
|
/**
|
|
1016
|
-
*
|
|
930
|
+
* Undoes a transaction created by calling Change Balance.
|
|
1017
931
|
*
|
|
1018
|
-
*
|
|
1019
|
-
*
|
|
1020
|
-
* @public
|
|
1021
|
-
* @documentationMaturity preview
|
|
1022
|
-
* @requiredField options.idempotencyKey
|
|
1023
|
-
* @requiredField options.requests.operation
|
|
1024
|
-
* @requiredField options.requests.poolId
|
|
1025
|
-
* @permissionId BENEFIT_PROGRAMS.BALANCE_CHANGE
|
|
1026
|
-
* @permissionScope SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
1027
|
-
* @permissionScopeId SCOPE.BENEFIT_PROGRAMS.MANAGE
|
|
1028
|
-
* @applicableIdentity APP
|
|
1029
|
-
* @fqn wix.benefit_programs.v1.balance.BalanceService.BulkChangeBalances
|
|
1030
|
-
*/
|
|
1031
|
-
export declare function bulkChangeBalances(options?: BulkChangeBalancesOptions): Promise<BulkChangeBalancesResponse & BulkChangeBalancesResponseNonNullableFields>;
|
|
1032
|
-
export interface BulkChangeBalancesOptions {
|
|
1033
|
-
/**
|
|
1034
|
-
* Requests
|
|
1035
|
-
* @minSize 1
|
|
1036
|
-
* @maxSize 100
|
|
1037
|
-
*/
|
|
1038
|
-
requests?: ChangeBalanceRequest[];
|
|
1039
|
-
/**
|
|
1040
|
-
* Unique identifier, generated by the client.
|
|
1041
|
-
* Used to recognize repeated attempts to make the same request.
|
|
1042
|
-
* @maxLength 200
|
|
1043
|
-
*/
|
|
1044
|
-
idempotencyKey: string;
|
|
1045
|
-
/** Whether to return the entity in the response */
|
|
1046
|
-
returnEntity?: boolean;
|
|
1047
|
-
}
|
|
1048
|
-
/**
|
|
1049
|
-
* Restores a previously changed balance.
|
|
932
|
+
* For example, if a transaction increased a balance's available credits by 5,
|
|
933
|
+
* calling Revert Balance Change with the transaction's ID will decrease the balance's available credit by 5.
|
|
1050
934
|
*
|
|
1051
|
-
*
|
|
1052
|
-
* @param transactionId - ID of the
|
|
935
|
+
* > **Note:** If the Change Balance call set the balance, Revert Transaction reverts the amount the balance changed by, ensuring subsequent balance changes are still reflected after the reversion.
|
|
936
|
+
* @param transactionId - ID of the transaction associated with the balance change to revert.
|
|
1053
937
|
* @param idempotencyKey - Unique identifier, generated by the client.
|
|
1054
938
|
* Used to recognize repeated attempts to make the same request.
|
|
1055
939
|
* @public
|
|
@@ -1064,17 +948,7 @@ export interface BulkChangeBalancesOptions {
|
|
|
1064
948
|
*/
|
|
1065
949
|
export declare function revertBalanceChange(transactionId: string, idempotencyKey: string, options?: RevertBalanceChangeOptions): Promise<RevertBalanceChangeResponse>;
|
|
1066
950
|
export interface RevertBalanceChangeOptions {
|
|
1067
|
-
/**
|
|
1068
|
-
* Party requesting the balance change.
|
|
1069
|
-
*
|
|
1070
|
-
* Possible values could include:
|
|
1071
|
-
*
|
|
1072
|
-
* + App owner.
|
|
1073
|
-
*
|
|
1074
|
-
* + Pool beneficiary.
|
|
1075
|
-
*
|
|
1076
|
-
* + Site admin.
|
|
1077
|
-
*/
|
|
951
|
+
/** Identity reverting the balance change. */
|
|
1078
952
|
instructingParty?: CommonIdentificationData;
|
|
1079
953
|
}
|
|
1080
954
|
export {};
|