@cuenca-mx/cuenca-js 0.0.1-dev.21 → 0.0.1-dev.22
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/README.md +0 -1
- package/build/identities-7fc7251d.mjs +289 -0
- package/build/{queries-0c03273e.cjs → identities-b7106a30.cjs} +20 -287
- package/build/index.cjs +78 -58
- package/build/index.mjs +29 -9
- package/build/queries-59c893b6.mjs +282 -0
- package/build/queries-bc02f9a8.cjs +296 -0
- package/build/requests/index.cjs +3 -2
- package/build/requests/index.mjs +2 -2
- package/build/types/index.cjs +20 -19
- package/build/types/index.mjs +2 -2
- package/build/umd/cuenca.umd.js +1 -1
- package/build/{walletTransactionRequest-60d3cf69.mjs → walletTransactionRequest-7334f8c5.mjs} +9 -2
- package/build/{walletTransactionRequest-f549e991.cjs → walletTransactionRequest-a1851594.cjs} +10 -2
- package/package.json +1 -1
- package/build/data-9edbb2a0.cjs +0 -13
- package/build/data-d5bcb7c8.mjs +0 -10
- package/build/queries-c73144c4.mjs +0 -546
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { ValidationError } from './errors/index.mjs';
|
|
2
|
+
import { d as dateToUTC } from './identities-7fc7251d.mjs';
|
|
3
|
+
|
|
4
|
+
class PageSize {
|
|
5
|
+
constructor(size) {
|
|
6
|
+
this.maxSize = 100;
|
|
7
|
+
this._ps = size;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
get size() {
|
|
11
|
+
return this._pageSize;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
set _ps(value) {
|
|
15
|
+
let validatedPageSize = this.maxSize;
|
|
16
|
+
if (value && value > 0 && value <= this.maxSize) {
|
|
17
|
+
validatedPageSize = value;
|
|
18
|
+
}
|
|
19
|
+
this._pageSize = validatedPageSize;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
class QueryParams {
|
|
24
|
+
constructor({
|
|
25
|
+
createdAfter,
|
|
26
|
+
createdBefore,
|
|
27
|
+
limit,
|
|
28
|
+
pageSize,
|
|
29
|
+
relatedTransaction,
|
|
30
|
+
userId,
|
|
31
|
+
count = false,
|
|
32
|
+
}) {
|
|
33
|
+
this.createdAfter = createdAfter;
|
|
34
|
+
this.createdBefore = createdBefore;
|
|
35
|
+
this._lmt = limit;
|
|
36
|
+
this.relatedTransaction = relatedTransaction;
|
|
37
|
+
this.userId = userId;
|
|
38
|
+
this.count = count;
|
|
39
|
+
this.pageSize = pageSize;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get limit() {
|
|
43
|
+
return this._limit;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Validator for limit
|
|
47
|
+
set _lmt(value) {
|
|
48
|
+
let validatedValue = null;
|
|
49
|
+
if (value && value >= 0) {
|
|
50
|
+
validatedValue = value;
|
|
51
|
+
}
|
|
52
|
+
this._limit = validatedValue;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
toObject() {
|
|
56
|
+
return {
|
|
57
|
+
created_after: this.createdAfter,
|
|
58
|
+
created_before: this.createdBefore,
|
|
59
|
+
limit: this.limit,
|
|
60
|
+
related_transaction: this.relatedTransaction,
|
|
61
|
+
user_id: this.userId,
|
|
62
|
+
page_size: this.pageSize && this.pageSize.size,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
toParams() {
|
|
67
|
+
const helper = { ...this.toObject() };
|
|
68
|
+
if (this.count) helper.count = 1;
|
|
69
|
+
Object.keys(helper).forEach((k) => {
|
|
70
|
+
if (helper[k] == null) delete helper[k];
|
|
71
|
+
});
|
|
72
|
+
return helper;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
toQueryString() {
|
|
76
|
+
return new URLSearchParams(this.toParams()).toString();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
class AccountQuery extends QueryParams {
|
|
81
|
+
constructor({ accountNumber, ...args }) {
|
|
82
|
+
super(args);
|
|
83
|
+
this.accountNumber = accountNumber;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
toObject() {
|
|
87
|
+
return Object.assign(super.toObject(), {
|
|
88
|
+
account_number: this.accountNumber,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
class ApiKeyQuery extends QueryParams {
|
|
94
|
+
constructor({ active, ...args }) {
|
|
95
|
+
super(args);
|
|
96
|
+
this.active = active;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
toObject() {
|
|
100
|
+
return Object.assign(super.toObject(), {
|
|
101
|
+
active: this.active,
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
class TransactionQuery extends QueryParams {
|
|
107
|
+
constructor({ status, ...args }) {
|
|
108
|
+
super(args);
|
|
109
|
+
this.status = status;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
toObject() {
|
|
113
|
+
return Object.assign(super.toObject(), {
|
|
114
|
+
status: this.status,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
class DepositQuery extends TransactionQuery {
|
|
120
|
+
constructor({ trackingKey, network, ...args }) {
|
|
121
|
+
super(args);
|
|
122
|
+
this.trackingKey = trackingKey;
|
|
123
|
+
this.network = network;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
toObject() {
|
|
127
|
+
return Object.assign(super.toObject(), {
|
|
128
|
+
tracking_key: this.trackingKey,
|
|
129
|
+
network: this.network,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
class TransferQuery extends TransactionQuery {
|
|
135
|
+
constructor({
|
|
136
|
+
accountNumber,
|
|
137
|
+
idempotencyKey,
|
|
138
|
+
trackingKey,
|
|
139
|
+
network,
|
|
140
|
+
...args
|
|
141
|
+
}) {
|
|
142
|
+
super(args);
|
|
143
|
+
this.accountNumber = accountNumber;
|
|
144
|
+
this.idempotencyKey = idempotencyKey;
|
|
145
|
+
this.trackingKey = trackingKey;
|
|
146
|
+
this.network = network;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
toObject() {
|
|
150
|
+
return Object.assign(super.toObject(), {
|
|
151
|
+
account_number: this.accountNumber,
|
|
152
|
+
idempotency_key: this.idempotencyKey,
|
|
153
|
+
tracking_key: this.trackingKey,
|
|
154
|
+
network: this.network,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
class BalanceEntryQuery extends QueryParams {
|
|
160
|
+
constructor({
|
|
161
|
+
fundingInstrumentUri,
|
|
162
|
+
count = false,
|
|
163
|
+
walletId = 'default',
|
|
164
|
+
...args
|
|
165
|
+
}) {
|
|
166
|
+
super(args);
|
|
167
|
+
this.fundingInstrumentUri = fundingInstrumentUri;
|
|
168
|
+
this.count = count;
|
|
169
|
+
this.walletId = walletId;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
toObject() {
|
|
173
|
+
return Object.assign(super.toObject(), {
|
|
174
|
+
wallet_id: this.walletId,
|
|
175
|
+
funding_instrument_uri: this.fundingInstrumentUri,
|
|
176
|
+
count: this.count,
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
class BillPaymentQuery extends QueryParams {
|
|
182
|
+
constructor({ accountNumber, ...args }) {
|
|
183
|
+
super(args);
|
|
184
|
+
this.accountNumber = accountNumber;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
toObject() {
|
|
188
|
+
return Object.assign(super.toObject(), {
|
|
189
|
+
account_number: this.accountNumber,
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
class CardTransactionQuery extends QueryParams {
|
|
195
|
+
constructor({ cardUri, ...args }) {
|
|
196
|
+
super(args);
|
|
197
|
+
this.cardUri = cardUri;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
toObject() {
|
|
201
|
+
return Object.assign(super.toObject(), {
|
|
202
|
+
card_uri: this.cardUri,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
class CardsQuery extends QueryParams {
|
|
208
|
+
constructor({ cardUri, count = false, ...args }) {
|
|
209
|
+
super(args);
|
|
210
|
+
this.cardUri = cardUri;
|
|
211
|
+
this.count = count;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
toObject() {
|
|
215
|
+
return Object.assign(super.toObject(), {
|
|
216
|
+
card_uri: this.cardUri,
|
|
217
|
+
count: this.count,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
class WalletTransactionQuery extends QueryParams {
|
|
223
|
+
constructor({ walletUri, ...args }) {
|
|
224
|
+
super(args);
|
|
225
|
+
this.walletUri = walletUri;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
toObject() {
|
|
229
|
+
return Object.assign(super.toObject(), {
|
|
230
|
+
wallet_uri: this.walletUri,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
class WalletQuery extends QueryParams {
|
|
236
|
+
constructor({ active, ...args }) {
|
|
237
|
+
super(args);
|
|
238
|
+
this.active = active;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
toObject() {
|
|
242
|
+
return Object.assign(super.toObject(), {
|
|
243
|
+
active: this.active,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
class StatementQuery extends QueryParams {
|
|
249
|
+
constructor({ month, year, ...args }) {
|
|
250
|
+
super(args);
|
|
251
|
+
this.d = { month, year };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
get month() {
|
|
255
|
+
return this._date.month;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
get year() {
|
|
259
|
+
return this._date.year;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
set d({ month, year }) {
|
|
263
|
+
const now = dateToUTC(Date.now());
|
|
264
|
+
now.setUTCDate(1);
|
|
265
|
+
const date = dateToUTC(`${year}-${month}-01`);
|
|
266
|
+
if (date.getTime() >= now.getTime()) {
|
|
267
|
+
throw new ValidationError(
|
|
268
|
+
`${year}-${month} is not a valid year-month pair`,
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
this._date = { month, year };
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
toObject() {
|
|
275
|
+
return Object.assign(super.toObject(), {
|
|
276
|
+
month: this.month,
|
|
277
|
+
year: this.year,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export { AccountQuery as A, BalanceEntryQuery as B, CardsQuery as C, DepositQuery as D, PageSize as P, QueryParams as Q, StatementQuery as S, TransferQuery as T, WalletQuery as W, ApiKeyQuery as a, BillPaymentQuery as b, CardTransactionQuery as c, WalletTransactionQuery as d };
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var errors_index = require('./errors/index.cjs');
|
|
4
|
+
var identities = require('./identities-b7106a30.cjs');
|
|
5
|
+
|
|
6
|
+
class PageSize {
|
|
7
|
+
constructor(size) {
|
|
8
|
+
this.maxSize = 100;
|
|
9
|
+
this._ps = size;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get size() {
|
|
13
|
+
return this._pageSize;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
set _ps(value) {
|
|
17
|
+
let validatedPageSize = this.maxSize;
|
|
18
|
+
if (value && value > 0 && value <= this.maxSize) {
|
|
19
|
+
validatedPageSize = value;
|
|
20
|
+
}
|
|
21
|
+
this._pageSize = validatedPageSize;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
class QueryParams {
|
|
26
|
+
constructor({
|
|
27
|
+
createdAfter,
|
|
28
|
+
createdBefore,
|
|
29
|
+
limit,
|
|
30
|
+
pageSize,
|
|
31
|
+
relatedTransaction,
|
|
32
|
+
userId,
|
|
33
|
+
count = false,
|
|
34
|
+
}) {
|
|
35
|
+
this.createdAfter = createdAfter;
|
|
36
|
+
this.createdBefore = createdBefore;
|
|
37
|
+
this._lmt = limit;
|
|
38
|
+
this.relatedTransaction = relatedTransaction;
|
|
39
|
+
this.userId = userId;
|
|
40
|
+
this.count = count;
|
|
41
|
+
this.pageSize = pageSize;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
get limit() {
|
|
45
|
+
return this._limit;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Validator for limit
|
|
49
|
+
set _lmt(value) {
|
|
50
|
+
let validatedValue = null;
|
|
51
|
+
if (value && value >= 0) {
|
|
52
|
+
validatedValue = value;
|
|
53
|
+
}
|
|
54
|
+
this._limit = validatedValue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
toObject() {
|
|
58
|
+
return {
|
|
59
|
+
created_after: this.createdAfter,
|
|
60
|
+
created_before: this.createdBefore,
|
|
61
|
+
limit: this.limit,
|
|
62
|
+
related_transaction: this.relatedTransaction,
|
|
63
|
+
user_id: this.userId,
|
|
64
|
+
page_size: this.pageSize && this.pageSize.size,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
toParams() {
|
|
69
|
+
const helper = { ...this.toObject() };
|
|
70
|
+
if (this.count) helper.count = 1;
|
|
71
|
+
Object.keys(helper).forEach((k) => {
|
|
72
|
+
if (helper[k] == null) delete helper[k];
|
|
73
|
+
});
|
|
74
|
+
return helper;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
toQueryString() {
|
|
78
|
+
return new URLSearchParams(this.toParams()).toString();
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
class AccountQuery extends QueryParams {
|
|
83
|
+
constructor({ accountNumber, ...args }) {
|
|
84
|
+
super(args);
|
|
85
|
+
this.accountNumber = accountNumber;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
toObject() {
|
|
89
|
+
return Object.assign(super.toObject(), {
|
|
90
|
+
account_number: this.accountNumber,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
class ApiKeyQuery extends QueryParams {
|
|
96
|
+
constructor({ active, ...args }) {
|
|
97
|
+
super(args);
|
|
98
|
+
this.active = active;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
toObject() {
|
|
102
|
+
return Object.assign(super.toObject(), {
|
|
103
|
+
active: this.active,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
class TransactionQuery extends QueryParams {
|
|
109
|
+
constructor({ status, ...args }) {
|
|
110
|
+
super(args);
|
|
111
|
+
this.status = status;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
toObject() {
|
|
115
|
+
return Object.assign(super.toObject(), {
|
|
116
|
+
status: this.status,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
class DepositQuery extends TransactionQuery {
|
|
122
|
+
constructor({ trackingKey, network, ...args }) {
|
|
123
|
+
super(args);
|
|
124
|
+
this.trackingKey = trackingKey;
|
|
125
|
+
this.network = network;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
toObject() {
|
|
129
|
+
return Object.assign(super.toObject(), {
|
|
130
|
+
tracking_key: this.trackingKey,
|
|
131
|
+
network: this.network,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
class TransferQuery extends TransactionQuery {
|
|
137
|
+
constructor({
|
|
138
|
+
accountNumber,
|
|
139
|
+
idempotencyKey,
|
|
140
|
+
trackingKey,
|
|
141
|
+
network,
|
|
142
|
+
...args
|
|
143
|
+
}) {
|
|
144
|
+
super(args);
|
|
145
|
+
this.accountNumber = accountNumber;
|
|
146
|
+
this.idempotencyKey = idempotencyKey;
|
|
147
|
+
this.trackingKey = trackingKey;
|
|
148
|
+
this.network = network;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
toObject() {
|
|
152
|
+
return Object.assign(super.toObject(), {
|
|
153
|
+
account_number: this.accountNumber,
|
|
154
|
+
idempotency_key: this.idempotencyKey,
|
|
155
|
+
tracking_key: this.trackingKey,
|
|
156
|
+
network: this.network,
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
class BalanceEntryQuery extends QueryParams {
|
|
162
|
+
constructor({
|
|
163
|
+
fundingInstrumentUri,
|
|
164
|
+
count = false,
|
|
165
|
+
walletId = 'default',
|
|
166
|
+
...args
|
|
167
|
+
}) {
|
|
168
|
+
super(args);
|
|
169
|
+
this.fundingInstrumentUri = fundingInstrumentUri;
|
|
170
|
+
this.count = count;
|
|
171
|
+
this.walletId = walletId;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
toObject() {
|
|
175
|
+
return Object.assign(super.toObject(), {
|
|
176
|
+
wallet_id: this.walletId,
|
|
177
|
+
funding_instrument_uri: this.fundingInstrumentUri,
|
|
178
|
+
count: this.count,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
class BillPaymentQuery extends QueryParams {
|
|
184
|
+
constructor({ accountNumber, ...args }) {
|
|
185
|
+
super(args);
|
|
186
|
+
this.accountNumber = accountNumber;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
toObject() {
|
|
190
|
+
return Object.assign(super.toObject(), {
|
|
191
|
+
account_number: this.accountNumber,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
class CardTransactionQuery extends QueryParams {
|
|
197
|
+
constructor({ cardUri, ...args }) {
|
|
198
|
+
super(args);
|
|
199
|
+
this.cardUri = cardUri;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
toObject() {
|
|
203
|
+
return Object.assign(super.toObject(), {
|
|
204
|
+
card_uri: this.cardUri,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
class CardsQuery extends QueryParams {
|
|
210
|
+
constructor({ cardUri, count = false, ...args }) {
|
|
211
|
+
super(args);
|
|
212
|
+
this.cardUri = cardUri;
|
|
213
|
+
this.count = count;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
toObject() {
|
|
217
|
+
return Object.assign(super.toObject(), {
|
|
218
|
+
card_uri: this.cardUri,
|
|
219
|
+
count: this.count,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
class WalletTransactionQuery extends QueryParams {
|
|
225
|
+
constructor({ walletUri, ...args }) {
|
|
226
|
+
super(args);
|
|
227
|
+
this.walletUri = walletUri;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
toObject() {
|
|
231
|
+
return Object.assign(super.toObject(), {
|
|
232
|
+
wallet_uri: this.walletUri,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
class WalletQuery extends QueryParams {
|
|
238
|
+
constructor({ active, ...args }) {
|
|
239
|
+
super(args);
|
|
240
|
+
this.active = active;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
toObject() {
|
|
244
|
+
return Object.assign(super.toObject(), {
|
|
245
|
+
active: this.active,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
class StatementQuery extends QueryParams {
|
|
251
|
+
constructor({ month, year, ...args }) {
|
|
252
|
+
super(args);
|
|
253
|
+
this.d = { month, year };
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
get month() {
|
|
257
|
+
return this._date.month;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
get year() {
|
|
261
|
+
return this._date.year;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
set d({ month, year }) {
|
|
265
|
+
const now = identities.dateToUTC(Date.now());
|
|
266
|
+
now.setUTCDate(1);
|
|
267
|
+
const date = identities.dateToUTC(`${year}-${month}-01`);
|
|
268
|
+
if (date.getTime() >= now.getTime()) {
|
|
269
|
+
throw new errors_index.ValidationError(
|
|
270
|
+
`${year}-${month} is not a valid year-month pair`,
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
this._date = { month, year };
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
toObject() {
|
|
277
|
+
return Object.assign(super.toObject(), {
|
|
278
|
+
month: this.month,
|
|
279
|
+
year: this.year,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
exports.AccountQuery = AccountQuery;
|
|
285
|
+
exports.ApiKeyQuery = ApiKeyQuery;
|
|
286
|
+
exports.BalanceEntryQuery = BalanceEntryQuery;
|
|
287
|
+
exports.BillPaymentQuery = BillPaymentQuery;
|
|
288
|
+
exports.CardTransactionQuery = CardTransactionQuery;
|
|
289
|
+
exports.CardsQuery = CardsQuery;
|
|
290
|
+
exports.DepositQuery = DepositQuery;
|
|
291
|
+
exports.PageSize = PageSize;
|
|
292
|
+
exports.QueryParams = QueryParams;
|
|
293
|
+
exports.StatementQuery = StatementQuery;
|
|
294
|
+
exports.TransferQuery = TransferQuery;
|
|
295
|
+
exports.WalletQuery = WalletQuery;
|
|
296
|
+
exports.WalletTransactionQuery = WalletTransactionQuery;
|
package/build/requests/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var walletTransactionRequest = require('../walletTransactionRequest-
|
|
5
|
+
var walletTransactionRequest = require('../walletTransactionRequest-a1851594.cjs');
|
|
6
6
|
require('../errors/index.cjs');
|
|
7
|
-
require('../
|
|
7
|
+
require('../identities-b7106a30.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -19,4 +19,5 @@ exports.TransferRequest = walletTransactionRequest.TransferRequest;
|
|
|
19
19
|
exports.UserCredentialRequest = walletTransactionRequest.UserCredentialRequest;
|
|
20
20
|
exports.UserCredentialUpdateRequest = walletTransactionRequest.UserCredentialUpdateRequest;
|
|
21
21
|
exports.UserLoginRequest = walletTransactionRequest.UserLoginRequest;
|
|
22
|
+
exports.UserUpdateRequest = walletTransactionRequest.UserUpdateRequest;
|
|
22
23
|
exports.WalletTransactionRequest = walletTransactionRequest.WalletTransactionRequest;
|
package/build/requests/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { A as ApiKeyUpdateRequest, a as ArpcRequest, C as CardActivationRequest, b as CardRequest, c as CardUpdateRequest, d as CardValidationRequest, S as SavingRequest, T as TransferRequest, U as UserCredentialRequest, e as UserCredentialUpdateRequest, f as UserLoginRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-
|
|
1
|
+
export { A as ApiKeyUpdateRequest, a as ArpcRequest, C as CardActivationRequest, b as CardRequest, c as CardUpdateRequest, d as CardValidationRequest, S as SavingRequest, T as TransferRequest, U as UserCredentialRequest, e as UserCredentialUpdateRequest, f as UserLoginRequest, g as UserUpdateRequest, W as WalletTransactionRequest } from '../walletTransactionRequest-7334f8c5.mjs';
|
|
2
2
|
import '../errors/index.mjs';
|
|
3
|
-
import '../
|
|
3
|
+
import '../identities-7fc7251d.mjs';
|
package/build/types/index.cjs
CHANGED
|
@@ -2,39 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var identities = require('../identities-b7106a30.cjs');
|
|
6
|
+
var queries = require('../queries-bc02f9a8.cjs');
|
|
6
7
|
require('../errors/index.cjs');
|
|
7
|
-
require('../data-9edbb2a0.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
+
exports.CardErrorType = identities.CardErrorType;
|
|
12
|
+
exports.CardFundingType = identities.CardFundingType;
|
|
13
|
+
exports.CardIssuer = identities.CardIssuer;
|
|
14
|
+
exports.CardStatus = identities.CardStatus;
|
|
15
|
+
exports.CardTransactionType = identities.CardTransactionType;
|
|
16
|
+
exports.CardType = identities.CardType;
|
|
17
|
+
exports.CommissionType = identities.CommissionType;
|
|
18
|
+
exports.DepositNetwork = identities.DepositNetwork;
|
|
19
|
+
exports.EntryType = identities.EntryType;
|
|
20
|
+
exports.FileFormat = identities.FileFormat;
|
|
21
|
+
exports.Phase = identities.Phase;
|
|
22
|
+
exports.SavingCategory = identities.SavingCategory;
|
|
23
|
+
exports.ServiceProviderCategory = identities.ServiceProviderCategory;
|
|
24
|
+
exports.TOSAgreements = identities.TOSAgreements;
|
|
25
|
+
exports.TrackDataMethod = identities.TrackDataMethod;
|
|
26
|
+
exports.TransactionStatus = identities.TransactionStatus;
|
|
27
|
+
exports.TransferNetwork = identities.TransferNetwork;
|
|
28
|
+
exports.WalletTransactionType = identities.WalletTransactionType;
|
|
11
29
|
exports.AccountQuery = queries.AccountQuery;
|
|
12
30
|
exports.ApiKeyQuery = queries.ApiKeyQuery;
|
|
13
31
|
exports.BalanceEntryQuery = queries.BalanceEntryQuery;
|
|
14
32
|
exports.BillPaymentQuery = queries.BillPaymentQuery;
|
|
15
|
-
exports.CardErrorType = queries.CardErrorType;
|
|
16
|
-
exports.CardFundingType = queries.CardFundingType;
|
|
17
|
-
exports.CardIssuer = queries.CardIssuer;
|
|
18
|
-
exports.CardStatus = queries.CardStatus;
|
|
19
33
|
exports.CardTransactionQuery = queries.CardTransactionQuery;
|
|
20
|
-
exports.CardTransactionType = queries.CardTransactionType;
|
|
21
|
-
exports.CardType = queries.CardType;
|
|
22
34
|
exports.CardsQuery = queries.CardsQuery;
|
|
23
|
-
exports.CommissionType = queries.CommissionType;
|
|
24
|
-
exports.DepositNetwork = queries.DepositNetwork;
|
|
25
35
|
exports.DepositQuery = queries.DepositQuery;
|
|
26
|
-
exports.EntryType = queries.EntryType;
|
|
27
|
-
exports.FileFormat = queries.FileFormat;
|
|
28
36
|
exports.PageSize = queries.PageSize;
|
|
29
|
-
exports.Phase = queries.Phase;
|
|
30
37
|
exports.QueryParams = queries.QueryParams;
|
|
31
|
-
exports.SavingCategory = queries.SavingCategory;
|
|
32
|
-
exports.ServiceProviderCategory = queries.ServiceProviderCategory;
|
|
33
38
|
exports.StatementQuery = queries.StatementQuery;
|
|
34
|
-
exports.TrackDataMethod = queries.TrackDataMethod;
|
|
35
|
-
exports.TransactionStatus = queries.TransactionStatus;
|
|
36
|
-
exports.TransferNetwork = queries.TransferNetwork;
|
|
37
39
|
exports.TransferQuery = queries.TransferQuery;
|
|
38
40
|
exports.WalletQuery = queries.WalletQuery;
|
|
39
41
|
exports.WalletTransactionQuery = queries.WalletTransactionQuery;
|
|
40
|
-
exports.WalletTransactionType = queries.WalletTransactionType;
|
package/build/types/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { f as CardErrorType, c as CardFundingType, C as CardIssuer, a as CardStatus, g as CardTransactionType, b as CardType, h as CommissionType, D as DepositNetwork, E as EntryType, F as FileFormat, P as Phase, S as SavingCategory, i as ServiceProviderCategory, k as TOSAgreements, l as TrackDataMethod, T as TransactionStatus, j as TransferNetwork, W as WalletTransactionType } from '../identities-7fc7251d.mjs';
|
|
2
|
+
export { A as AccountQuery, a as ApiKeyQuery, B as BalanceEntryQuery, b as BillPaymentQuery, c as CardTransactionQuery, C as CardsQuery, D as DepositQuery, P as PageSize, Q as QueryParams, S as StatementQuery, T as TransferQuery, W as WalletQuery, d as WalletTransactionQuery } from '../queries-59c893b6.mjs';
|
|
2
3
|
import '../errors/index.mjs';
|
|
3
|
-
import '../data-d5bcb7c8.mjs';
|