@riocrypto/common-server 1.0.1951 → 1.0.1954
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/clients/bitso-client.js +7 -8
- package/build/clients/bridge-client.js +6 -6
- package/build/clients/cluster-client.js +7 -4
- package/build/clients/coincover-client.js +1 -1
- package/build/clients/fireblocks-client.js +10 -10
- package/build/clients/secret-manager-client.js +2 -2
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/middlewares/not-sandbox.js +2 -1
- package/build/models/bank-payment.d.ts +0 -12
- package/build/models/bank-payment.js +0 -18
- package/build/models/bulk-bank-payment.d.ts +32 -0
- package/build/models/bulk-bank-payment.js +60 -0
- package/package.json +2 -2
|
@@ -30,7 +30,7 @@ class BitsoClient {
|
|
|
30
30
|
}
|
|
31
31
|
createClabe() {
|
|
32
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
33
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
34
34
|
throw new Error("Bitso create clabe not allowed in sandbox");
|
|
35
35
|
}
|
|
36
36
|
const requestConfig = {
|
|
@@ -47,7 +47,7 @@ class BitsoClient {
|
|
|
47
47
|
}
|
|
48
48
|
createReceivingAccount(user, bankAccount) {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
50
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
51
51
|
throw new Error("Bitso create receiving account not allowed in sandbox");
|
|
52
52
|
}
|
|
53
53
|
const requestConfig = {
|
|
@@ -82,7 +82,7 @@ class BitsoClient {
|
|
|
82
82
|
}
|
|
83
83
|
deleteReceivingAccount(bitsoReceivingAccountId) {
|
|
84
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
85
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
86
86
|
throw new Error("Bitso delete receiving account not allowed in sandbox");
|
|
87
87
|
}
|
|
88
88
|
const requestConfig = {
|
|
@@ -99,7 +99,7 @@ class BitsoClient {
|
|
|
99
99
|
}
|
|
100
100
|
createWithdraw(bitsoReceivingAccountId, amount, concept, rfc) {
|
|
101
101
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
102
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
103
103
|
throw new Error("Bitso withdraw not allowed in sandbox");
|
|
104
104
|
}
|
|
105
105
|
const requestConfig = {
|
|
@@ -146,7 +146,7 @@ class BitsoClient {
|
|
|
146
146
|
}
|
|
147
147
|
createLimitOrder(asset, amount, price, side) {
|
|
148
148
|
return __awaiter(this, void 0, void 0, function* () {
|
|
149
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
149
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
150
150
|
throw new Error("Bitso limit orders not allowed in sandbox");
|
|
151
151
|
}
|
|
152
152
|
const major = amount / price;
|
|
@@ -243,7 +243,7 @@ class BitsoClient {
|
|
|
243
243
|
}
|
|
244
244
|
cancelOrder(oid) {
|
|
245
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
246
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
246
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
247
247
|
throw new Error("Bitso cancel order not allowed in sandbox");
|
|
248
248
|
}
|
|
249
249
|
const requestConfig = {
|
|
@@ -366,7 +366,7 @@ class BitsoClient {
|
|
|
366
366
|
}
|
|
367
367
|
createCryptoWithdrawal(amount, crypto, address) {
|
|
368
368
|
return __awaiter(this, void 0, void 0, function* () {
|
|
369
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
369
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
370
370
|
throw new Error("Bitso withdraw not allowed in sandbox");
|
|
371
371
|
}
|
|
372
372
|
let asset;
|
|
@@ -442,7 +442,6 @@ const buildBitsoClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
442
442
|
throw new common_1.SecretManagerError();
|
|
443
443
|
}
|
|
444
444
|
const env = process.env.RIO_ENV === common_1.RioEnv.Production ||
|
|
445
|
-
process.env.RIO_ENV === common_1.RioEnv.Staging ||
|
|
446
445
|
process.env.RIO_ENV === common_1.RioEnv.Development
|
|
447
446
|
? "production"
|
|
448
447
|
: "sandbox";
|
|
@@ -21,7 +21,7 @@ const uuid_1 = require("uuid");
|
|
|
21
21
|
class BridgeClient {
|
|
22
22
|
constructor(apiKey) {
|
|
23
23
|
this.apiKey = apiKey;
|
|
24
|
-
if ([common_1.RioEnv.Production, common_1.RioEnv.
|
|
24
|
+
if ([common_1.RioEnv.Production, common_1.RioEnv.Development].includes(process.env.RIO_ENV)) {
|
|
25
25
|
this.baseUrl = "https://api.bridge.xyz";
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
@@ -55,7 +55,7 @@ class BridgeClient {
|
|
|
55
55
|
}
|
|
56
56
|
createTransfer(bridgeCustomerId, amountInUSD, source, destination, developerFee) {
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
58
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
59
59
|
throw new Error("Bridge transfers are disabled in sandbox mode.");
|
|
60
60
|
}
|
|
61
61
|
const { data } = yield axios_with_logging_1.default.post(`${this.baseUrl}/v0/transfers`, {
|
|
@@ -112,7 +112,7 @@ class BridgeClient {
|
|
|
112
112
|
}
|
|
113
113
|
createLiquidationAddress(bridgeCustomerId, currency, chain, externalAccountId) {
|
|
114
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
115
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
116
116
|
throw new Error("Bridge liquidation addresses are disabled in sandbox mode.");
|
|
117
117
|
}
|
|
118
118
|
const { data } = yield axios_with_logging_1.default.post(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/liquidation_addresses`, {
|
|
@@ -162,7 +162,7 @@ class BridgeClient {
|
|
|
162
162
|
}
|
|
163
163
|
createPlaidLinkToken(bridgeCustomerId) {
|
|
164
164
|
return __awaiter(this, void 0, void 0, function* () {
|
|
165
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
165
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
166
166
|
throw new Error("Bridge plaid link tokens are disabled in sandbox mode.");
|
|
167
167
|
}
|
|
168
168
|
const { data } = yield axios_with_logging_1.default.post(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/plaid_link_requests`, undefined, {
|
|
@@ -196,7 +196,7 @@ class BridgeClient {
|
|
|
196
196
|
}
|
|
197
197
|
exchangePlaidPublicToken(linkToken, publicToken) {
|
|
198
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
199
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
200
200
|
throw new Error("Bridge plaid exchange public token is disabled in sandbox mode.");
|
|
201
201
|
}
|
|
202
202
|
const { data } = yield axios_with_logging_1.default.post(`${this.baseUrl}/v0/plaid_exchange_public_token/${linkToken}`, {
|
|
@@ -211,7 +211,7 @@ class BridgeClient {
|
|
|
211
211
|
}
|
|
212
212
|
createExternalAccount(bridgeCustomerId, bankName, accountNumber, routingNumber, accountOwnerName, address) {
|
|
213
213
|
return __awaiter(this, void 0, void 0, function* () {
|
|
214
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
214
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
215
215
|
throw new Error("Bridge external accounts are disabled in sandbox mode.");
|
|
216
216
|
}
|
|
217
217
|
const { data } = yield axios_with_logging_1.default.post(`${this.baseUrl}/v0/customers/${bridgeCustomerId}/external_accounts`, {
|
|
@@ -30,16 +30,19 @@ class ClusterClient {
|
|
|
30
30
|
hostHeader = "";
|
|
31
31
|
break;
|
|
32
32
|
case common_1.RioEnv.Development:
|
|
33
|
-
hostHeader = "dev.
|
|
33
|
+
hostHeader = "app.dev.rio.trade";
|
|
34
34
|
break;
|
|
35
35
|
case common_1.RioEnv.Production:
|
|
36
|
-
hostHeader = "
|
|
36
|
+
hostHeader = "app.rio.trade";
|
|
37
37
|
break;
|
|
38
38
|
case common_1.RioEnv.Sandbox:
|
|
39
|
-
hostHeader = "sandbox.
|
|
39
|
+
hostHeader = "app.sandbox.rio.trade";
|
|
40
|
+
break;
|
|
41
|
+
case common_1.RioEnv.Test:
|
|
42
|
+
hostHeader = "app.test.rio.trade";
|
|
40
43
|
break;
|
|
41
44
|
default:
|
|
42
|
-
hostHeader = "sandbox.
|
|
45
|
+
hostHeader = "app.sandbox.rio.trade";
|
|
43
46
|
}
|
|
44
47
|
this.axios.defaults.headers.common["Host"] = hostHeader;
|
|
45
48
|
}
|
|
@@ -34,7 +34,7 @@ class CoincoverClient {
|
|
|
34
34
|
const highestOnboardingCountry = (0, common_1.getHighestOnboardingStatus)(user).country;
|
|
35
35
|
return (_b = (_a = user.onboarding[highestOnboardingCountry]) === null || _a === void 0 ? void 0 : _a.address) === null || _b === void 0 ? void 0 : _b.country;
|
|
36
36
|
};
|
|
37
|
-
if ([common_1.RioEnv.Development, common_1.RioEnv.Production
|
|
37
|
+
if ([common_1.RioEnv.Development, common_1.RioEnv.Production].includes(process.env.RIO_ENV)) {
|
|
38
38
|
this.baseUrl = "https://api.txm.coincover.com";
|
|
39
39
|
}
|
|
40
40
|
else {
|
|
@@ -54,7 +54,7 @@ class FireblocksClient {
|
|
|
54
54
|
}
|
|
55
55
|
withdrawFromExchange(rioId, crypto, address, amountCrypto) {
|
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
57
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
58
58
|
throw new Error("Withdrawals are disabled in sandbox mode.");
|
|
59
59
|
}
|
|
60
60
|
yield this.fireblocks.createTransaction({
|
|
@@ -85,7 +85,7 @@ class FireblocksClient {
|
|
|
85
85
|
if (destination.address && destination.fireblocksWalletId) {
|
|
86
86
|
throw new Error("Either address or fireblocksWalletId must be provided, not both.");
|
|
87
87
|
}
|
|
88
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
88
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
89
89
|
throw new Error("Withdrawals are disabled in sandbox mode.");
|
|
90
90
|
}
|
|
91
91
|
const response = yield this.fireblocks.createTransaction({
|
|
@@ -279,7 +279,7 @@ class FireblocksClient {
|
|
|
279
279
|
}
|
|
280
280
|
createVault(userId, name, type, number) {
|
|
281
281
|
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
282
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
283
283
|
throw new Error("Vault creation is disabled in sandbox mode.");
|
|
284
284
|
}
|
|
285
285
|
let vaultName = number
|
|
@@ -291,7 +291,7 @@ class FireblocksClient {
|
|
|
291
291
|
}
|
|
292
292
|
createWallet(vaultId, crypto) {
|
|
293
293
|
return __awaiter(this, void 0, void 0, function* () {
|
|
294
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
294
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
295
295
|
throw new Error("Wallet creation is disabled in sandbox mode.");
|
|
296
296
|
}
|
|
297
297
|
const wallet = yield this.fireblocks.createVaultAsset(vaultId, crypto);
|
|
@@ -300,7 +300,7 @@ class FireblocksClient {
|
|
|
300
300
|
}
|
|
301
301
|
internalTransfer(rioId, crypto, sourceVaultId, destinationVaultId, amountCrypto, notes) {
|
|
302
302
|
return __awaiter(this, void 0, void 0, function* () {
|
|
303
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
303
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
304
304
|
throw new Error("Internal transfers are disabled in sandbox mode.");
|
|
305
305
|
}
|
|
306
306
|
const response = yield this.fireblocks.createTransaction({
|
|
@@ -324,7 +324,7 @@ class FireblocksClient {
|
|
|
324
324
|
}
|
|
325
325
|
externalTransfer(rioId, crypto, sourceVaultId, destinationAddress, amountCrypto, notes) {
|
|
326
326
|
return __awaiter(this, void 0, void 0, function* () {
|
|
327
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
327
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
328
328
|
throw new Error("External transfers are disabled in sandbox mode.");
|
|
329
329
|
}
|
|
330
330
|
const response = yield this.fireblocks.createTransaction({
|
|
@@ -350,7 +350,7 @@ class FireblocksClient {
|
|
|
350
350
|
}
|
|
351
351
|
transferToExchange(rioId, crypto, sourceVaultId, destinationExchangeId, amountCrypto, notes) {
|
|
352
352
|
return __awaiter(this, void 0, void 0, function* () {
|
|
353
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
353
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
354
354
|
throw new Error("Transfers to exchanges are disabled in sandbox mode.");
|
|
355
355
|
}
|
|
356
356
|
const response = yield this.fireblocks.createTransaction({
|
|
@@ -374,7 +374,7 @@ class FireblocksClient {
|
|
|
374
374
|
}
|
|
375
375
|
transferFromExchangeToExchange(rioId, crypto, sourceExchangeId, destinationExchangeId, amountCrypto, notes) {
|
|
376
376
|
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
377
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
378
378
|
throw new Error("Transfers from exchanges to exchanges are disabled in sandbox mode.");
|
|
379
379
|
}
|
|
380
380
|
const response = yield this.fireblocks.createTransaction({
|
|
@@ -398,7 +398,7 @@ class FireblocksClient {
|
|
|
398
398
|
}
|
|
399
399
|
transferFromExchange(rioId, crypto, sourceExchangeId, destinationVaultId, amountCrypto, notes) {
|
|
400
400
|
return __awaiter(this, void 0, void 0, function* () {
|
|
401
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
401
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
402
402
|
throw new Error("Transfers from exchanges are disabled in sandbox mode.");
|
|
403
403
|
}
|
|
404
404
|
const response = yield this.fireblocks.createTransaction({
|
|
@@ -422,7 +422,7 @@ class FireblocksClient {
|
|
|
422
422
|
}
|
|
423
423
|
sweep(rioId, vaultId, assetId, amount) {
|
|
424
424
|
return __awaiter(this, void 0, void 0, function* () {
|
|
425
|
-
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local].includes(process.env.RIO_ENV)) {
|
|
425
|
+
if ([common_1.RioEnv.Sandbox, common_1.RioEnv.Local, common_1.RioEnv.Test].includes(process.env.RIO_ENV)) {
|
|
426
426
|
throw new Error("Sweeps are disabled in sandbox mode.");
|
|
427
427
|
}
|
|
428
428
|
yield this.fireblocks.createTransaction({
|
|
@@ -63,8 +63,8 @@ class SecretManagerClient {
|
|
|
63
63
|
else if (this.env === common_1.RioEnv.Sandbox || this.env === common_1.RioEnv.Local) {
|
|
64
64
|
file = "sandbox-secrets";
|
|
65
65
|
}
|
|
66
|
-
else if (this.env === common_1.RioEnv.
|
|
67
|
-
file = "
|
|
66
|
+
else if (this.env === common_1.RioEnv.Test) {
|
|
67
|
+
file = "test-secrets";
|
|
68
68
|
}
|
|
69
69
|
else if (this.env === common_1.RioEnv.Production) {
|
|
70
70
|
file = "production-secrets";
|
package/build/index.d.ts
CHANGED
|
@@ -71,6 +71,7 @@ export * from "./models/async-fx-trade";
|
|
|
71
71
|
export * from "./models/internal-transfer";
|
|
72
72
|
export * from "./models/internal-balances";
|
|
73
73
|
export * from "./models/internal-trade";
|
|
74
|
+
export * from "./models/bulk-bank-payment";
|
|
74
75
|
export * from "./clients/axios-with-logging";
|
|
75
76
|
export * from "./clients/slack-client";
|
|
76
77
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -87,6 +87,7 @@ __exportStar(require("./models/async-fx-trade"), exports);
|
|
|
87
87
|
__exportStar(require("./models/internal-transfer"), exports);
|
|
88
88
|
__exportStar(require("./models/internal-balances"), exports);
|
|
89
89
|
__exportStar(require("./models/internal-trade"), exports);
|
|
90
|
+
__exportStar(require("./models/bulk-bank-payment"), exports);
|
|
90
91
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
91
92
|
__exportStar(require("./clients/slack-client"), exports);
|
|
92
93
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.notSandbox = void 0;
|
|
4
4
|
const common_1 = require("@riocrypto/common");
|
|
5
5
|
const notSandbox = (req, res, next) => {
|
|
6
|
-
if (process.env.RIO_ENV === common_1.RioEnv.Sandbox
|
|
6
|
+
if (process.env.RIO_ENV === common_1.RioEnv.Sandbox ||
|
|
7
|
+
process.env.RIO_ENV === common_1.RioEnv.Test) {
|
|
7
8
|
throw new common_1.UnavailableInSandboxError();
|
|
8
9
|
}
|
|
9
10
|
next();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Mongoose, Model, Document } from "mongoose";
|
|
2
2
|
interface BankPaymentAttrs {
|
|
3
3
|
orderId: string;
|
|
4
|
-
PIXBarcode?: string;
|
|
5
4
|
USBankTransferMethod?: "wire" | "ach_push";
|
|
6
5
|
bankName?: string;
|
|
7
6
|
companyName?: string;
|
|
@@ -10,11 +9,6 @@ interface BankPaymentAttrs {
|
|
|
10
9
|
accountNumber?: string;
|
|
11
10
|
routingNumber?: string;
|
|
12
11
|
reference?: string;
|
|
13
|
-
clabe?: string;
|
|
14
|
-
ruc?: string;
|
|
15
|
-
rfc?: string;
|
|
16
|
-
swiftCode?: string;
|
|
17
|
-
cci?: string;
|
|
18
12
|
CLABE?: string;
|
|
19
13
|
RUC?: string;
|
|
20
14
|
RFC?: string;
|
|
@@ -23,7 +17,6 @@ interface BankPaymentAttrs {
|
|
|
23
17
|
}
|
|
24
18
|
interface BankPaymentDoc extends Document {
|
|
25
19
|
orderId: string;
|
|
26
|
-
PIXBarcode?: string;
|
|
27
20
|
USBankTransferMethod?: "wire" | "ach_push";
|
|
28
21
|
bankName?: string;
|
|
29
22
|
companyName?: string;
|
|
@@ -32,11 +25,6 @@ interface BankPaymentDoc extends Document {
|
|
|
32
25
|
accountNumber?: string;
|
|
33
26
|
routingNumber?: string;
|
|
34
27
|
reference?: string;
|
|
35
|
-
clabe?: string;
|
|
36
|
-
ruc?: string;
|
|
37
|
-
rfc?: string;
|
|
38
|
-
swiftCode?: string;
|
|
39
|
-
cci?: string;
|
|
40
28
|
CLABE?: string;
|
|
41
29
|
RUC?: string;
|
|
42
30
|
RFC?: string;
|
|
@@ -11,9 +11,6 @@ const buildBankPayment = (mongoose) => {
|
|
|
11
11
|
type: String,
|
|
12
12
|
required: true,
|
|
13
13
|
},
|
|
14
|
-
PIXBarcode: {
|
|
15
|
-
type: String,
|
|
16
|
-
},
|
|
17
14
|
bankName: {
|
|
18
15
|
type: String,
|
|
19
16
|
},
|
|
@@ -42,21 +39,6 @@ const buildBankPayment = (mongoose) => {
|
|
|
42
39
|
reference: {
|
|
43
40
|
type: String,
|
|
44
41
|
},
|
|
45
|
-
clabe: {
|
|
46
|
-
type: String,
|
|
47
|
-
},
|
|
48
|
-
ruc: {
|
|
49
|
-
type: String,
|
|
50
|
-
},
|
|
51
|
-
rfc: {
|
|
52
|
-
type: String,
|
|
53
|
-
},
|
|
54
|
-
swiftCode: {
|
|
55
|
-
type: String,
|
|
56
|
-
},
|
|
57
|
-
cci: {
|
|
58
|
-
type: String,
|
|
59
|
-
},
|
|
60
42
|
CLABE: {
|
|
61
43
|
type: String,
|
|
62
44
|
},
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
2
|
+
interface BulkBankPaymentAttrs {
|
|
3
|
+
orderIds: string[];
|
|
4
|
+
bankName?: string;
|
|
5
|
+
companyName?: string;
|
|
6
|
+
companyAddress?: string;
|
|
7
|
+
bankAddress?: string;
|
|
8
|
+
reference?: string;
|
|
9
|
+
CLABE?: string;
|
|
10
|
+
RUC?: string;
|
|
11
|
+
RFC?: string;
|
|
12
|
+
CCI?: string;
|
|
13
|
+
status: string;
|
|
14
|
+
}
|
|
15
|
+
interface BulkBankPaymentDoc extends Document {
|
|
16
|
+
orderIds: string[];
|
|
17
|
+
bankName?: string;
|
|
18
|
+
companyName?: string;
|
|
19
|
+
companyAddress?: string;
|
|
20
|
+
bankAddress?: string;
|
|
21
|
+
reference?: string;
|
|
22
|
+
CLABE?: string;
|
|
23
|
+
RUC?: string;
|
|
24
|
+
RFC?: string;
|
|
25
|
+
CCI?: string;
|
|
26
|
+
status: string;
|
|
27
|
+
}
|
|
28
|
+
interface BulkBankPaymentModel extends Model<BulkBankPaymentDoc> {
|
|
29
|
+
build(attrs: BulkBankPaymentAttrs): BulkBankPaymentDoc;
|
|
30
|
+
}
|
|
31
|
+
declare const buildBulkBankPayment: (mongoose: Mongoose) => BulkBankPaymentModel;
|
|
32
|
+
export { buildBulkBankPayment, BulkBankPaymentDoc, BulkBankPaymentAttrs };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBulkBankPayment = void 0;
|
|
4
|
+
const buildBulkBankPayment = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.BulkBankPayment) {
|
|
7
|
+
return mongoose.model("BulkBankPayment");
|
|
8
|
+
}
|
|
9
|
+
const BulkBankPaymentSchema = new mongoose.Schema({
|
|
10
|
+
orderId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
bankName: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
companyName: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
companyAddress: {
|
|
21
|
+
type: String,
|
|
22
|
+
},
|
|
23
|
+
bankAddress: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
reference: {
|
|
31
|
+
type: String,
|
|
32
|
+
},
|
|
33
|
+
CLABE: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
RUC: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
RFC: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
CCI: {
|
|
43
|
+
type: String,
|
|
44
|
+
},
|
|
45
|
+
}, {
|
|
46
|
+
toJSON: {
|
|
47
|
+
transform(doc, ret) {
|
|
48
|
+
ret.id = ret._id.valueOf();
|
|
49
|
+
delete ret._id;
|
|
50
|
+
delete ret.__v;
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
BulkBankPaymentSchema.statics.build = (attrs) => {
|
|
55
|
+
return new BulkBankPayment(attrs);
|
|
56
|
+
};
|
|
57
|
+
const BulkBankPayment = mongoose.model("BulkBankPayment", BulkBankPaymentSchema);
|
|
58
|
+
return BulkBankPayment;
|
|
59
|
+
};
|
|
60
|
+
exports.buildBulkBankPayment = buildBulkBankPayment;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1954",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1719",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|