@wix/auto_sdk_benefit-programs_transactions 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.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.context.d.ts +6 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.context.js +14 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.context.js.map +1 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.http.d.ts +15 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.http.js +132 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.http.js.map +1 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.meta.d.ts +16 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.meta.js +66 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.meta.js.map +1 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.public.d.ts +30 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.public.js +24 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.public.js.map +1 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.types.d.ts +512 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.types.js +50 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.types.js.map +1 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.universal.d.ts +614 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.universal.js +170 -0
- package/build/cjs/src/benefit-programs-v1-transaction-transactions.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.context.d.ts +6 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.context.js +6 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.context.js.map +1 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.http.d.ts +15 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.http.js +127 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.http.js.map +1 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.meta.d.ts +16 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.meta.js +38 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.meta.js.map +1 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.public.d.ts +30 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.public.js +14 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.public.js.map +1 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.types.d.ts +512 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.types.js +47 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.types.js.map +1 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.universal.d.ts +614 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.universal.js +142 -0
- package/build/es/src/benefit-programs-v1-transaction-transactions.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.context.d.ts +6 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.context.js +14 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.context.js.map +1 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.http.d.ts +15 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.http.js +132 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.http.js.map +1 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.meta.d.ts +16 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.meta.js +66 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.meta.js.map +1 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.public.d.ts +30 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.public.js +24 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.public.js.map +1 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.types.d.ts +512 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.types.js +50 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.types.js.map +1 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.universal.d.ts +614 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.universal.js +170 -0
- package/build/internal/cjs/src/benefit-programs-v1-transaction-transactions.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.context.d.ts +6 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.context.js +6 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.context.js.map +1 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.http.d.ts +15 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.http.js +127 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.http.js.map +1 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.meta.d.ts +16 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.meta.js +38 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.meta.js.map +1 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.public.d.ts +30 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.public.js +14 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.public.js.map +1 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.types.d.ts +512 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.types.js +47 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.types.js.map +1 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.universal.d.ts +614 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.universal.js +142 -0
- package/build/internal/es/src/benefit-programs-v1-transaction-transactions.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
export interface Transaction {
|
|
2
|
+
/**
|
|
3
|
+
* Transaction ID.
|
|
4
|
+
* @readonly
|
|
5
|
+
*/
|
|
6
|
+
_id?: string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Revision number, which increments by 1 each time the transaction is updated.
|
|
9
|
+
* @readonly
|
|
10
|
+
*/
|
|
11
|
+
revision?: string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Date and time the transaction was created.
|
|
14
|
+
* @readonly
|
|
15
|
+
*/
|
|
16
|
+
_createdDate?: Date | null;
|
|
17
|
+
/**
|
|
18
|
+
* Date and time the transaction was updated.
|
|
19
|
+
* @readonly
|
|
20
|
+
*/
|
|
21
|
+
_updatedDate?: Date | null;
|
|
22
|
+
/**
|
|
23
|
+
* The benefit pool associated with the balance object.
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
26
|
+
pool?: PoolInfo;
|
|
27
|
+
/** Absolute amount to adjust the balance with. This field is determined by the source and target balances. */
|
|
28
|
+
amount?: string;
|
|
29
|
+
/** Source balance. */
|
|
30
|
+
source?: BalanceType;
|
|
31
|
+
/** Target balance. */
|
|
32
|
+
target?: BalanceType;
|
|
33
|
+
/**
|
|
34
|
+
* Unique identifier, generated by the client.
|
|
35
|
+
* Used to recognize repeated attempts to make the same request.
|
|
36
|
+
* @readonly
|
|
37
|
+
*/
|
|
38
|
+
idempotencyKey?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Related transaction ID. For example, in the case of a cancelled reservation, the related transaction is the benefit redemption.
|
|
41
|
+
* @readonly
|
|
42
|
+
*/
|
|
43
|
+
relatedTransactionId?: string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Identity of the individual that enrolled in the program associated with this benefit transaction.
|
|
46
|
+
* @readonly
|
|
47
|
+
*/
|
|
48
|
+
beneficiary?: CommonIdentificationData;
|
|
49
|
+
/**
|
|
50
|
+
* The identity that created this transaction.
|
|
51
|
+
* @readonly
|
|
52
|
+
*/
|
|
53
|
+
instructingParty?: CommonIdentificationData;
|
|
54
|
+
/**
|
|
55
|
+
* Transaction status.
|
|
56
|
+
*
|
|
57
|
+
* `PENDING` is the initial status of a transaction. After the balance is updated, the status changes to `COMPLETED` if the transaction was successful, or `FAILED`, if the balance update fails.
|
|
58
|
+
*/
|
|
59
|
+
status?: TransactionStatus;
|
|
60
|
+
/**
|
|
61
|
+
* Additional transaction details.
|
|
62
|
+
* @readonly
|
|
63
|
+
*/
|
|
64
|
+
details?: TransactionDetails;
|
|
65
|
+
/**
|
|
66
|
+
* Custom field data for the transaction object.
|
|
67
|
+
*
|
|
68
|
+
* [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.
|
|
69
|
+
*/
|
|
70
|
+
extendedFields?: ExtendedFields;
|
|
71
|
+
}
|
|
72
|
+
export interface PoolInfo {
|
|
73
|
+
/**
|
|
74
|
+
* Benefit pool ID.
|
|
75
|
+
* @readonly
|
|
76
|
+
*/
|
|
77
|
+
_id?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Pool definition ID from which this benefit pool was instantiated.
|
|
80
|
+
* @readonly
|
|
81
|
+
*/
|
|
82
|
+
poolDefinitionId?: string | null;
|
|
83
|
+
/**
|
|
84
|
+
* ID for the program definition from which this benefit pool was provisioned.
|
|
85
|
+
* @readonly
|
|
86
|
+
*/
|
|
87
|
+
programDefinitionId?: string | null;
|
|
88
|
+
/**
|
|
89
|
+
* ID of the program to which this benefit pool belongs.
|
|
90
|
+
* @readonly
|
|
91
|
+
*/
|
|
92
|
+
programId?: string | null;
|
|
93
|
+
/** Total amount of credits available for this benefit pool. */
|
|
94
|
+
creditAmount?: string | null;
|
|
95
|
+
/** The external system that is the source of the pool creation. For example, `wix-pricing-plans`, `wix-loyalty`. */
|
|
96
|
+
namespace?: string | null;
|
|
97
|
+
}
|
|
98
|
+
export declare enum BalanceType {
|
|
99
|
+
UNDEFINED = "UNDEFINED",
|
|
100
|
+
/** Available balance. */
|
|
101
|
+
AVAILABLE = "AVAILABLE",
|
|
102
|
+
/** Reserved balance. */
|
|
103
|
+
RESERVED = "RESERVED",
|
|
104
|
+
/** External balance. */
|
|
105
|
+
EXTERNAL = "EXTERNAL"
|
|
106
|
+
}
|
|
107
|
+
export interface CommonIdentificationData extends CommonIdentificationDataIdOneOf {
|
|
108
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
109
|
+
anonymousVisitorId?: string;
|
|
110
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
111
|
+
memberId?: string;
|
|
112
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
113
|
+
wixUserId?: string;
|
|
114
|
+
}
|
|
115
|
+
/** @oneof */
|
|
116
|
+
export interface CommonIdentificationDataIdOneOf {
|
|
117
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
118
|
+
anonymousVisitorId?: string;
|
|
119
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
120
|
+
memberId?: string;
|
|
121
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
122
|
+
wixUserId?: string;
|
|
123
|
+
}
|
|
124
|
+
export declare enum IdentityType {
|
|
125
|
+
/** Unknown type. This value is not used. */
|
|
126
|
+
UNKNOWN = "UNKNOWN",
|
|
127
|
+
/** A site visitor who has not logged in. */
|
|
128
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
129
|
+
/** A logged-in site member. */
|
|
130
|
+
MEMBER = "MEMBER",
|
|
131
|
+
/** A Wix account holder, such as a site owner or contributor. */
|
|
132
|
+
WIX_USER = "WIX_USER"
|
|
133
|
+
}
|
|
134
|
+
export declare enum TransactionStatus {
|
|
135
|
+
UNDEFINED = "UNDEFINED",
|
|
136
|
+
/** Transaction is pending. */
|
|
137
|
+
PENDING = "PENDING",
|
|
138
|
+
/** Transaction completed. */
|
|
139
|
+
COMPLETED = "COMPLETED",
|
|
140
|
+
/** Transaction failed. */
|
|
141
|
+
FAILED = "FAILED"
|
|
142
|
+
}
|
|
143
|
+
export interface TransactionDetails {
|
|
144
|
+
/**
|
|
145
|
+
* Item associated with the balance change.
|
|
146
|
+
* The redemption of this item triggered the balance adjustment.
|
|
147
|
+
* @readonly
|
|
148
|
+
*/
|
|
149
|
+
item?: Item;
|
|
150
|
+
/** Quantity of an item related to the balance change. */
|
|
151
|
+
itemCount?: number | null;
|
|
152
|
+
/**
|
|
153
|
+
* Date and time the transaction was made.
|
|
154
|
+
* @readonly
|
|
155
|
+
*/
|
|
156
|
+
effectiveDate?: Date | null;
|
|
157
|
+
/**
|
|
158
|
+
* Reason for the transaction. For example, `Redemption` or `Manual adjustment`.
|
|
159
|
+
* @readonly
|
|
160
|
+
*/
|
|
161
|
+
reason?: string | null;
|
|
162
|
+
}
|
|
163
|
+
export interface Item {
|
|
164
|
+
/**
|
|
165
|
+
* Item ID.
|
|
166
|
+
* @readonly
|
|
167
|
+
*/
|
|
168
|
+
_id?: string | null;
|
|
169
|
+
/**
|
|
170
|
+
* External item ID.
|
|
171
|
+
* @readonly
|
|
172
|
+
*/
|
|
173
|
+
externalId?: string | null;
|
|
174
|
+
/**
|
|
175
|
+
* Item category. Distinguishes between different types of items. For example, `posts`, `groups`, `events`.
|
|
176
|
+
* @readonly
|
|
177
|
+
*/
|
|
178
|
+
category?: string | null;
|
|
179
|
+
/** @readonly */
|
|
180
|
+
itemSetId?: string | null;
|
|
181
|
+
/**
|
|
182
|
+
* Item display name.
|
|
183
|
+
* @readonly
|
|
184
|
+
*/
|
|
185
|
+
displayName?: string | null;
|
|
186
|
+
}
|
|
187
|
+
export interface ExtendedFields {
|
|
188
|
+
/**
|
|
189
|
+
* Extended field data. Each key corresponds to the namespace of the app that created the extended fields.
|
|
190
|
+
* The value of each key is structured according to the schema defined when the extended fields were configured.
|
|
191
|
+
*
|
|
192
|
+
* You can only access fields for which you have the appropriate permissions.
|
|
193
|
+
*
|
|
194
|
+
* Learn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields).
|
|
195
|
+
*/
|
|
196
|
+
namespaces?: Record<string, Record<string, any>>;
|
|
197
|
+
}
|
|
198
|
+
export interface CreateTransactionRequest {
|
|
199
|
+
/** Transaction to create. */
|
|
200
|
+
transaction?: Transaction;
|
|
201
|
+
}
|
|
202
|
+
export interface CreateTransactionResponse {
|
|
203
|
+
/** Created transaction. */
|
|
204
|
+
transaction?: Transaction;
|
|
205
|
+
}
|
|
206
|
+
export interface BulkCreateTransactionsRequest {
|
|
207
|
+
/** Transactions to be created. */
|
|
208
|
+
transactions?: Transaction[];
|
|
209
|
+
/**
|
|
210
|
+
* Whether to return the full item entities.
|
|
211
|
+
*
|
|
212
|
+
* Default: `false`
|
|
213
|
+
*/
|
|
214
|
+
returnEntity?: boolean;
|
|
215
|
+
}
|
|
216
|
+
export interface BulkCreateTransactionsResponse {
|
|
217
|
+
/**
|
|
218
|
+
* List of results for each transaction.
|
|
219
|
+
*
|
|
220
|
+
* Includes the transaction and whether the operation was successful.
|
|
221
|
+
*/
|
|
222
|
+
results?: BulkTransactionResult[];
|
|
223
|
+
/** Bulk action metadata. */
|
|
224
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
225
|
+
}
|
|
226
|
+
export interface BulkTransactionResult {
|
|
227
|
+
/** Metadata for the item. */
|
|
228
|
+
itemMetadata?: ItemMetadata;
|
|
229
|
+
/** Created transaction. */
|
|
230
|
+
transaction?: Transaction;
|
|
231
|
+
}
|
|
232
|
+
export interface ItemMetadata {
|
|
233
|
+
/** Item ID. Should always be available, unless it's impossible (for example, when failing to create an item). */
|
|
234
|
+
_id?: string | null;
|
|
235
|
+
/** Index of the item within the request array. Allows for correlation between request and response items. */
|
|
236
|
+
originalIndex?: number;
|
|
237
|
+
/** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */
|
|
238
|
+
success?: boolean;
|
|
239
|
+
/** Details about the error in case of failure. */
|
|
240
|
+
error?: ApplicationError;
|
|
241
|
+
}
|
|
242
|
+
export interface ApplicationError {
|
|
243
|
+
/** Error code. */
|
|
244
|
+
code?: string;
|
|
245
|
+
/** Description of the error. */
|
|
246
|
+
description?: string;
|
|
247
|
+
/** Data related to the error. */
|
|
248
|
+
data?: Record<string, any> | null;
|
|
249
|
+
}
|
|
250
|
+
export interface BulkActionMetadata {
|
|
251
|
+
/** Number of items that were successfully processed. */
|
|
252
|
+
totalSuccesses?: number;
|
|
253
|
+
/** Number of items that couldn't be processed. */
|
|
254
|
+
totalFailures?: number;
|
|
255
|
+
/** Number of failures without details because detailed failure threshold was exceeded. */
|
|
256
|
+
undetailedFailures?: number;
|
|
257
|
+
}
|
|
258
|
+
export interface UpdateTransactionRequest {
|
|
259
|
+
/** Transaction to update. */
|
|
260
|
+
transaction?: Transaction;
|
|
261
|
+
}
|
|
262
|
+
export interface UpdateTransactionResponse {
|
|
263
|
+
/** Updated transaction. */
|
|
264
|
+
transaction?: Transaction;
|
|
265
|
+
}
|
|
266
|
+
export interface BulkUpdateTransactionsRequest {
|
|
267
|
+
/** Transactions to update. */
|
|
268
|
+
transactions?: MaskedTransaction[];
|
|
269
|
+
/**
|
|
270
|
+
* Whether to return full transaction entities.
|
|
271
|
+
*
|
|
272
|
+
* Default: `false`
|
|
273
|
+
*/
|
|
274
|
+
returnEntity?: boolean;
|
|
275
|
+
}
|
|
276
|
+
export interface MaskedTransaction {
|
|
277
|
+
/** Transaction to be updated. */
|
|
278
|
+
transaction?: Transaction;
|
|
279
|
+
/** Explicit list of fields to update. */
|
|
280
|
+
fieldMask?: string[];
|
|
281
|
+
}
|
|
282
|
+
export interface BulkUpdateTransactionsResponse {
|
|
283
|
+
/**
|
|
284
|
+
* List of results for each Transaction.
|
|
285
|
+
*
|
|
286
|
+
* Includes the Transaction and whether the update was successful.
|
|
287
|
+
*/
|
|
288
|
+
results?: BulkTransactionResult[];
|
|
289
|
+
/** Bulk action metadata. */
|
|
290
|
+
bulkActionMetadata?: BulkActionMetadata;
|
|
291
|
+
}
|
|
292
|
+
export interface GetTransactionRequest {
|
|
293
|
+
/** Id of the transaction to retrieve. */
|
|
294
|
+
transactionId: string;
|
|
295
|
+
}
|
|
296
|
+
export interface GetTransactionResponse {
|
|
297
|
+
/** Retrieved transaction. */
|
|
298
|
+
transaction?: Transaction;
|
|
299
|
+
}
|
|
300
|
+
export interface QueryTransactionsRequest {
|
|
301
|
+
/** Query to select transactions. */
|
|
302
|
+
query: CursorQuery;
|
|
303
|
+
}
|
|
304
|
+
export interface CursorQuery extends CursorQueryPagingMethodOneOf {
|
|
305
|
+
/** 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`. */
|
|
306
|
+
cursorPaging?: CursorPaging;
|
|
307
|
+
/**
|
|
308
|
+
* Filter object in the following format:
|
|
309
|
+
* `"filter" : {
|
|
310
|
+
* "fieldName1": "value1",
|
|
311
|
+
* "fieldName2":{"$operator":"value2"}
|
|
312
|
+
* }`
|
|
313
|
+
* Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
314
|
+
*/
|
|
315
|
+
filter?: Record<string, any> | null;
|
|
316
|
+
/**
|
|
317
|
+
* Sort object in the following format:
|
|
318
|
+
* `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
319
|
+
*/
|
|
320
|
+
sort?: Sorting[];
|
|
321
|
+
}
|
|
322
|
+
/** @oneof */
|
|
323
|
+
export interface CursorQueryPagingMethodOneOf {
|
|
324
|
+
/** 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`. */
|
|
325
|
+
cursorPaging?: CursorPaging;
|
|
326
|
+
}
|
|
327
|
+
export interface Sorting {
|
|
328
|
+
/** Name of the field to sort by. */
|
|
329
|
+
fieldName?: string;
|
|
330
|
+
/** Sort order. */
|
|
331
|
+
order?: SortOrder;
|
|
332
|
+
}
|
|
333
|
+
export declare enum SortOrder {
|
|
334
|
+
/** Ascending sort order. */
|
|
335
|
+
ASC = "ASC",
|
|
336
|
+
/** Descending sort order. */
|
|
337
|
+
DESC = "DESC"
|
|
338
|
+
}
|
|
339
|
+
export interface CursorPaging {
|
|
340
|
+
/** Maximum number of items to return in the results. */
|
|
341
|
+
limit?: number | null;
|
|
342
|
+
/**
|
|
343
|
+
* Pointer to the next or previous page in the list of results.
|
|
344
|
+
*
|
|
345
|
+
* Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
346
|
+
* Not relevant for the first request.
|
|
347
|
+
*/
|
|
348
|
+
cursor?: string | null;
|
|
349
|
+
}
|
|
350
|
+
export interface QueryTransactionsResponse {
|
|
351
|
+
/** The retrieved transactions. */
|
|
352
|
+
transactions?: Transaction[];
|
|
353
|
+
/** Metadata for paginated results. */
|
|
354
|
+
metadata?: CursorPagingMetadata;
|
|
355
|
+
}
|
|
356
|
+
export interface CursorPagingMetadata {
|
|
357
|
+
/** Number of items returned in the response. */
|
|
358
|
+
count?: number | null;
|
|
359
|
+
/** Cursor strings that point to the next page, previous page, or both. */
|
|
360
|
+
cursors?: Cursors;
|
|
361
|
+
/**
|
|
362
|
+
* Whether there are more pages to retrieve following the current page.
|
|
363
|
+
*
|
|
364
|
+
* + `true`: Another page of results can be retrieved.
|
|
365
|
+
* + `false`: This is the last page.
|
|
366
|
+
*/
|
|
367
|
+
hasNext?: boolean | null;
|
|
368
|
+
}
|
|
369
|
+
export interface Cursors {
|
|
370
|
+
/** Cursor string pointing to the next page in the list of results. */
|
|
371
|
+
next?: string | null;
|
|
372
|
+
/** Cursor pointing to the previous page in the list of results. */
|
|
373
|
+
prev?: string | null;
|
|
374
|
+
}
|
|
375
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
376
|
+
createdEvent?: EntityCreatedEvent;
|
|
377
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
378
|
+
deletedEvent?: EntityDeletedEvent;
|
|
379
|
+
actionEvent?: ActionEvent;
|
|
380
|
+
/**
|
|
381
|
+
* Unique event ID.
|
|
382
|
+
* Allows clients to ignore duplicate webhooks.
|
|
383
|
+
*/
|
|
384
|
+
_id?: string;
|
|
385
|
+
/**
|
|
386
|
+
* Assumes actions are also always typed to an entity_type
|
|
387
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
388
|
+
*/
|
|
389
|
+
entityFqdn?: string;
|
|
390
|
+
/**
|
|
391
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
392
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
393
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
394
|
+
*/
|
|
395
|
+
slug?: string;
|
|
396
|
+
/** ID of the entity associated with the event. */
|
|
397
|
+
entityId?: string;
|
|
398
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
399
|
+
eventTime?: Date | null;
|
|
400
|
+
/**
|
|
401
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
402
|
+
* (for example, GDPR).
|
|
403
|
+
*/
|
|
404
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
405
|
+
/** If present, indicates the action that triggered the event. */
|
|
406
|
+
originatedFrom?: string | null;
|
|
407
|
+
/**
|
|
408
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
409
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
410
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
411
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
412
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
413
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
414
|
+
*/
|
|
415
|
+
entityEventSequence?: string | null;
|
|
416
|
+
}
|
|
417
|
+
/** @oneof */
|
|
418
|
+
export interface DomainEventBodyOneOf {
|
|
419
|
+
createdEvent?: EntityCreatedEvent;
|
|
420
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
421
|
+
deletedEvent?: EntityDeletedEvent;
|
|
422
|
+
actionEvent?: ActionEvent;
|
|
423
|
+
}
|
|
424
|
+
export interface EntityCreatedEvent {
|
|
425
|
+
entity?: string;
|
|
426
|
+
}
|
|
427
|
+
export interface RestoreInfo {
|
|
428
|
+
deletedDate?: Date | null;
|
|
429
|
+
}
|
|
430
|
+
export interface EntityUpdatedEvent {
|
|
431
|
+
/**
|
|
432
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
433
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
434
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
435
|
+
*/
|
|
436
|
+
currentEntity?: string;
|
|
437
|
+
}
|
|
438
|
+
export interface EntityDeletedEvent {
|
|
439
|
+
/** Entity that was deleted */
|
|
440
|
+
deletedEntity?: string | null;
|
|
441
|
+
}
|
|
442
|
+
export interface ActionEvent {
|
|
443
|
+
body?: string;
|
|
444
|
+
}
|
|
445
|
+
export interface MessageEnvelope {
|
|
446
|
+
/** App instance ID. */
|
|
447
|
+
instanceId?: string | null;
|
|
448
|
+
/** Event type. */
|
|
449
|
+
eventType?: string;
|
|
450
|
+
/** The identification type and identity data. */
|
|
451
|
+
identity?: IdentificationData;
|
|
452
|
+
/** Stringify payload. */
|
|
453
|
+
data?: string;
|
|
454
|
+
}
|
|
455
|
+
export interface IdentificationData extends IdentificationDataIdOneOf {
|
|
456
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
457
|
+
anonymousVisitorId?: string;
|
|
458
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
459
|
+
memberId?: string;
|
|
460
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
461
|
+
wixUserId?: string;
|
|
462
|
+
/** ID of an app. */
|
|
463
|
+
appId?: string;
|
|
464
|
+
/** @readonly */
|
|
465
|
+
identityType?: WebhookIdentityType;
|
|
466
|
+
}
|
|
467
|
+
/** @oneof */
|
|
468
|
+
export interface IdentificationDataIdOneOf {
|
|
469
|
+
/** ID of a site visitor that has not logged in to the site. */
|
|
470
|
+
anonymousVisitorId?: string;
|
|
471
|
+
/** ID of a site visitor that has logged in to the site. */
|
|
472
|
+
memberId?: string;
|
|
473
|
+
/** ID of a Wix user (site owner, contributor, etc.). */
|
|
474
|
+
wixUserId?: string;
|
|
475
|
+
/** ID of an app. */
|
|
476
|
+
appId?: string;
|
|
477
|
+
}
|
|
478
|
+
export declare enum WebhookIdentityType {
|
|
479
|
+
UNKNOWN = "UNKNOWN",
|
|
480
|
+
ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
|
|
481
|
+
MEMBER = "MEMBER",
|
|
482
|
+
WIX_USER = "WIX_USER",
|
|
483
|
+
APP = "APP"
|
|
484
|
+
}
|
|
485
|
+
interface PoolInfoNonNullableFields {
|
|
486
|
+
_id: string;
|
|
487
|
+
}
|
|
488
|
+
interface CommonIdentificationDataNonNullableFields {
|
|
489
|
+
anonymousVisitorId: string;
|
|
490
|
+
memberId: string;
|
|
491
|
+
wixUserId: string;
|
|
492
|
+
identityType: IdentityType;
|
|
493
|
+
}
|
|
494
|
+
export interface TransactionNonNullableFields {
|
|
495
|
+
pool?: PoolInfoNonNullableFields;
|
|
496
|
+
amount: string;
|
|
497
|
+
source: BalanceType;
|
|
498
|
+
target: BalanceType;
|
|
499
|
+
idempotencyKey: string;
|
|
500
|
+
beneficiary?: CommonIdentificationDataNonNullableFields;
|
|
501
|
+
instructingParty?: CommonIdentificationDataNonNullableFields;
|
|
502
|
+
status: TransactionStatus;
|
|
503
|
+
}
|
|
504
|
+
export interface GetTransactionResponseNonNullableFields {
|
|
505
|
+
transaction?: TransactionNonNullableFields;
|
|
506
|
+
}
|
|
507
|
+
export interface QueryTransactionsResponseNonNullableFields {
|
|
508
|
+
transactions: TransactionNonNullableFields[];
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Retrieves a transaction.
|
|
512
|
+
* @param transactionId - Id of the transaction to retrieve.
|
|
513
|
+
* @public
|
|
514
|
+
* @documentationMaturity preview
|
|
515
|
+
* @requiredField transactionId
|
|
516
|
+
* @permissionId BENEFIT_PROGRAMS.TRANSACTION_READ
|
|
517
|
+
* @returns Retrieved transaction.
|
|
518
|
+
* @fqn wix.benefit_programs.v1.transaction.TransactionService.GetTransaction
|
|
519
|
+
*/
|
|
520
|
+
export declare function getTransaction(transactionId: string): Promise<Transaction & TransactionNonNullableFields>;
|
|
521
|
+
/**
|
|
522
|
+
* Creates a query to retrieve a list of transactions.
|
|
523
|
+
*
|
|
524
|
+
* The `queryTransactions()` method builds a query to retrieve a list of transactions and returns a `TransactionsQueryBuilder` object.
|
|
525
|
+
*
|
|
526
|
+
* The returned object contains the query definition, which is used to run the query using the [`find()`](/transactions/transactions-query-builder/find) function.
|
|
527
|
+
*
|
|
528
|
+
* You can refine the query by chaining `TransactionsQueryBuilder` methods onto the query. `TransactionsQueryBuilder` methods enable you to filter, sort, and control the results that `queryTransactions()` returns.
|
|
529
|
+
*
|
|
530
|
+
* The following `TransactionsQueryBuilder` functions are supported for `queryTransactions()`. For a full description of the transaction object, see the object returned for the [`items`](/transactions/transactions-query-result/items) property in `TransactionsQueryResult`.
|
|
531
|
+
* @public
|
|
532
|
+
* @documentationMaturity preview
|
|
533
|
+
* @permissionId BENEFIT_PROGRAMS.TRANSACTION_READ
|
|
534
|
+
* @fqn wix.benefit_programs.v1.transaction.TransactionService.QueryTransactions
|
|
535
|
+
*/
|
|
536
|
+
export declare function queryTransactions(): TransactionsQueryBuilder;
|
|
537
|
+
interface QueryCursorResult {
|
|
538
|
+
cursors: Cursors;
|
|
539
|
+
hasNext: () => boolean;
|
|
540
|
+
hasPrev: () => boolean;
|
|
541
|
+
length: number;
|
|
542
|
+
pageSize: number;
|
|
543
|
+
}
|
|
544
|
+
export interface TransactionsQueryResult extends QueryCursorResult {
|
|
545
|
+
items: Transaction[];
|
|
546
|
+
query: TransactionsQueryBuilder;
|
|
547
|
+
next: () => Promise<TransactionsQueryResult>;
|
|
548
|
+
prev: () => Promise<TransactionsQueryResult>;
|
|
549
|
+
}
|
|
550
|
+
export interface TransactionsQueryBuilder {
|
|
551
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
552
|
+
* @param value - Value to compare against.
|
|
553
|
+
* @documentationMaturity preview
|
|
554
|
+
*/
|
|
555
|
+
eq: (propertyName: '_id' | '_createdDate' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id', value: any) => TransactionsQueryBuilder;
|
|
556
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
557
|
+
* @param value - Value to compare against.
|
|
558
|
+
* @documentationMaturity preview
|
|
559
|
+
*/
|
|
560
|
+
ne: (propertyName: '_id' | '_createdDate' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id', value: any) => TransactionsQueryBuilder;
|
|
561
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
562
|
+
* @param value - Value to compare against.
|
|
563
|
+
* @documentationMaturity preview
|
|
564
|
+
*/
|
|
565
|
+
ge: (propertyName: '_createdDate', value: any) => TransactionsQueryBuilder;
|
|
566
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
567
|
+
* @param value - Value to compare against.
|
|
568
|
+
* @documentationMaturity preview
|
|
569
|
+
*/
|
|
570
|
+
gt: (propertyName: '_createdDate', value: any) => TransactionsQueryBuilder;
|
|
571
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
572
|
+
* @param value - Value to compare against.
|
|
573
|
+
* @documentationMaturity preview
|
|
574
|
+
*/
|
|
575
|
+
le: (propertyName: '_createdDate', value: any) => TransactionsQueryBuilder;
|
|
576
|
+
/** @param propertyName - Property whose value is compared with `value`.
|
|
577
|
+
* @param value - Value to compare against.
|
|
578
|
+
* @documentationMaturity preview
|
|
579
|
+
*/
|
|
580
|
+
lt: (propertyName: '_createdDate', value: any) => TransactionsQueryBuilder;
|
|
581
|
+
/** @param propertyName - Property whose value is compared with `string`.
|
|
582
|
+
* @param string - String to compare against. Case-insensitive.
|
|
583
|
+
* @documentationMaturity preview
|
|
584
|
+
*/
|
|
585
|
+
startsWith: (propertyName: '_id' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id', value: string) => TransactionsQueryBuilder;
|
|
586
|
+
/** @param propertyName - Property whose value is compared with `values`.
|
|
587
|
+
* @param values - List of values to compare against.
|
|
588
|
+
* @documentationMaturity preview
|
|
589
|
+
*/
|
|
590
|
+
hasSome: (propertyName: '_id' | '_createdDate' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id', value: any[]) => TransactionsQueryBuilder;
|
|
591
|
+
/** @documentationMaturity preview */
|
|
592
|
+
in: (propertyName: '_id' | '_createdDate' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id', value: any) => TransactionsQueryBuilder;
|
|
593
|
+
/** @documentationMaturity preview */
|
|
594
|
+
exists: (propertyName: '_id' | '_createdDate' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id', value: boolean) => TransactionsQueryBuilder;
|
|
595
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
596
|
+
* @documentationMaturity preview
|
|
597
|
+
*/
|
|
598
|
+
ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id'>) => TransactionsQueryBuilder;
|
|
599
|
+
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
600
|
+
* @documentationMaturity preview
|
|
601
|
+
*/
|
|
602
|
+
descending: (...propertyNames: Array<'_id' | '_createdDate' | 'pool.id' | 'relatedTransactionId' | 'beneficiary.memberId' | 'beneficiary.wixUserId' | 'details.item.id'>) => TransactionsQueryBuilder;
|
|
603
|
+
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
604
|
+
* @documentationMaturity preview
|
|
605
|
+
*/
|
|
606
|
+
limit: (limit: number) => TransactionsQueryBuilder;
|
|
607
|
+
/** @param cursor - A pointer to specific record
|
|
608
|
+
* @documentationMaturity preview
|
|
609
|
+
*/
|
|
610
|
+
skipTo: (cursor: string) => TransactionsQueryBuilder;
|
|
611
|
+
/** @documentationMaturity preview */
|
|
612
|
+
find: () => Promise<TransactionsQueryResult>;
|
|
613
|
+
}
|
|
614
|
+
export {};
|