@riocrypto/common-server 1.0.1392 → 1.0.1393
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/invopop-client.js +8 -8
- package/build/models/user.d.ts +2 -86
- package/build/models/user.js +1 -156
- package/package.json +2 -2
|
@@ -23,7 +23,7 @@ class InvopopClient {
|
|
|
23
23
|
this.baseUrl = "https://api.invopop.com";
|
|
24
24
|
}
|
|
25
25
|
createJob(order, user) {
|
|
26
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
26
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
28
|
const uuid = (0, uuid_1.v1)();
|
|
29
29
|
const operationDate = new Date(order.createdAt);
|
|
@@ -60,24 +60,24 @@ class InvopopClient {
|
|
|
60
60
|
],
|
|
61
61
|
},
|
|
62
62
|
customer: {
|
|
63
|
-
name: ((_a = user.invoicing) === null || _a === void 0 ? void 0 : _a.MX.fiscalName)
|
|
64
|
-
? (
|
|
63
|
+
name: ((_b = (_a = user.invoicing) === null || _a === void 0 ? void 0 : _a.MX) === null || _b === void 0 ? void 0 : _b.fiscalName)
|
|
64
|
+
? (_c = user.invoicing) === null || _c === void 0 ? void 0 : _c.MX.fiscalName.toLocaleUpperCase()
|
|
65
65
|
: (0, common_1.getUserName)(user),
|
|
66
66
|
tax_id: {
|
|
67
67
|
country: "MX",
|
|
68
|
-
zone: ((
|
|
68
|
+
zone: ((_e = (_d = user.invoicing) === null || _d === void 0 ? void 0 : _d.MX) === null || _e === void 0 ? void 0 : _e.shouldInvoice)
|
|
69
69
|
? user.address.postalCode
|
|
70
70
|
: "66260",
|
|
71
|
-
code: ((
|
|
71
|
+
code: ((_g = (_f = user.KYC) === null || _f === void 0 ? void 0 : _f.MX) === null || _g === void 0 ? void 0 : _g.taxId) || "XAXX010101000",
|
|
72
72
|
},
|
|
73
73
|
identities: [
|
|
74
74
|
{
|
|
75
75
|
key: "mx-cfdi-fiscal-regime",
|
|
76
|
-
code: ((
|
|
76
|
+
code: ((_k = (_j = (_h = user.invoicing) === null || _h === void 0 ? void 0 : _h.MX) === null || _j === void 0 ? void 0 : _j.fiscalRegimenCode) === null || _k === void 0 ? void 0 : _k.toString()) || "616",
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
key: "mx-cfdi-use",
|
|
80
|
-
code: ((
|
|
80
|
+
code: ((_m = (_l = user.invoicing) === null || _l === void 0 ? void 0 : _l.MX) === null || _m === void 0 ? void 0 : _m.shouldInvoice) ? "G03" : "S01",
|
|
81
81
|
},
|
|
82
82
|
],
|
|
83
83
|
},
|
|
@@ -88,7 +88,7 @@ class InvopopClient {
|
|
|
88
88
|
item: {
|
|
89
89
|
name: "Facilitación de Compra-Venta de Activos Virtuales",
|
|
90
90
|
identities: [{ key: "mx-cfdi-prod-serv", code: "80151500" }],
|
|
91
|
-
price: (
|
|
91
|
+
price: (_o = order.actualFees.platformFeeFiat) === null || _o === void 0 ? void 0 : _o.toFixed(2),
|
|
92
92
|
},
|
|
93
93
|
taxes: [
|
|
94
94
|
{
|
package/build/models/user.d.ts
CHANGED
|
@@ -91,23 +91,7 @@ interface UserAttrs {
|
|
|
91
91
|
taxId?: string;
|
|
92
92
|
usKYCStatus?: "none" | "pending" | "failed" | "approved";
|
|
93
93
|
KYC?: {
|
|
94
|
-
|
|
95
|
-
status?: KYCStatus;
|
|
96
|
-
personalId?: string;
|
|
97
|
-
taxId?: string;
|
|
98
|
-
files?: {
|
|
99
|
-
certificateOfIncorporation?: string;
|
|
100
|
-
kycReport?: string;
|
|
101
|
-
taxTranscript?: string;
|
|
102
|
-
proofOfAddress?: string;
|
|
103
|
-
businessRegistration?: string;
|
|
104
|
-
taxIdentificationCertificate?: string;
|
|
105
|
-
legalRepresentativeIdPowerOfAttorney?: string;
|
|
106
|
-
personalIdentificationCertificate?: string;
|
|
107
|
-
extraFiles?: string[];
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
PE?: {
|
|
94
|
+
[country in CountryOfOrigin]: {
|
|
111
95
|
status?: KYCStatus;
|
|
112
96
|
personalId?: string;
|
|
113
97
|
taxId?: string;
|
|
@@ -123,32 +107,6 @@ interface UserAttrs {
|
|
|
123
107
|
extraFiles?: string[];
|
|
124
108
|
};
|
|
125
109
|
};
|
|
126
|
-
US?: {
|
|
127
|
-
status?: KYCStatus;
|
|
128
|
-
personalId?: string;
|
|
129
|
-
taxId?: string;
|
|
130
|
-
files?: {
|
|
131
|
-
certificateOfIncorporation?: string;
|
|
132
|
-
kycReport?: string;
|
|
133
|
-
extraFiles?: string[];
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
BR?: {
|
|
137
|
-
status: KYCStatus;
|
|
138
|
-
personalId?: string;
|
|
139
|
-
taxId?: string;
|
|
140
|
-
files?: {
|
|
141
|
-
certificateOfIncorporation?: string;
|
|
142
|
-
kycReport?: string;
|
|
143
|
-
taxTranscript?: string;
|
|
144
|
-
proofOfAddress?: string;
|
|
145
|
-
businessRegistration?: string;
|
|
146
|
-
taxIdentificationCertificate?: string;
|
|
147
|
-
legalRepresentativeIdPowerOfAttorney?: string;
|
|
148
|
-
personalIdentificationCertificate?: string;
|
|
149
|
-
extraFiles?: string[];
|
|
150
|
-
};
|
|
151
|
-
};
|
|
152
110
|
};
|
|
153
111
|
address: {
|
|
154
112
|
street1: string;
|
|
@@ -261,49 +219,7 @@ interface UserDoc extends Document {
|
|
|
261
219
|
taxId?: string;
|
|
262
220
|
usKYCStatus?: "none" | "pending" | "failed" | "approved";
|
|
263
221
|
KYC?: {
|
|
264
|
-
|
|
265
|
-
status?: KYCStatus;
|
|
266
|
-
personalId?: string;
|
|
267
|
-
taxId?: string;
|
|
268
|
-
files?: {
|
|
269
|
-
certificateOfIncorporation?: string;
|
|
270
|
-
kycReport?: string;
|
|
271
|
-
taxTranscript?: string;
|
|
272
|
-
proofOfAddress?: string;
|
|
273
|
-
businessRegistration?: string;
|
|
274
|
-
taxIdentificationCertificate?: string;
|
|
275
|
-
legalRepresentativeIdPowerOfAttorney?: string;
|
|
276
|
-
personalIdentificationCertificate?: string;
|
|
277
|
-
extraFiles?: string[];
|
|
278
|
-
};
|
|
279
|
-
};
|
|
280
|
-
PE?: {
|
|
281
|
-
status?: KYCStatus;
|
|
282
|
-
personalId?: string;
|
|
283
|
-
taxId?: string;
|
|
284
|
-
files?: {
|
|
285
|
-
certificateOfIncorporation?: string;
|
|
286
|
-
kycReport?: string;
|
|
287
|
-
taxTranscript?: string;
|
|
288
|
-
proofOfAddress?: string;
|
|
289
|
-
businessRegistration?: string;
|
|
290
|
-
taxIdentificationCertificate?: string;
|
|
291
|
-
legalRepresentativeIdPowerOfAttorney?: string;
|
|
292
|
-
personalIdentificationCertificate?: string;
|
|
293
|
-
extraFiles?: string[];
|
|
294
|
-
};
|
|
295
|
-
};
|
|
296
|
-
US?: {
|
|
297
|
-
status?: KYCStatus;
|
|
298
|
-
personalId?: string;
|
|
299
|
-
taxId?: string;
|
|
300
|
-
files?: {
|
|
301
|
-
certificateOfIncorporation?: string;
|
|
302
|
-
kycReport?: string;
|
|
303
|
-
extraFiles?: string[];
|
|
304
|
-
};
|
|
305
|
-
};
|
|
306
|
-
BR?: {
|
|
222
|
+
[country in CountryOfOrigin]: {
|
|
307
223
|
status?: KYCStatus;
|
|
308
224
|
personalId?: string;
|
|
309
225
|
taxId?: string;
|
package/build/models/user.js
CHANGED
|
@@ -333,162 +333,7 @@ const buildUser = (mongoose) => {
|
|
|
333
333
|
required: true,
|
|
334
334
|
},
|
|
335
335
|
},
|
|
336
|
-
KYC:
|
|
337
|
-
MX: {
|
|
338
|
-
status: {
|
|
339
|
-
type: String,
|
|
340
|
-
required: true,
|
|
341
|
-
},
|
|
342
|
-
personalId: {
|
|
343
|
-
type: String,
|
|
344
|
-
},
|
|
345
|
-
taxId: {
|
|
346
|
-
type: String,
|
|
347
|
-
},
|
|
348
|
-
files: {
|
|
349
|
-
certificateOfIncorporation: {
|
|
350
|
-
type: String,
|
|
351
|
-
},
|
|
352
|
-
kycReport: {
|
|
353
|
-
type: String,
|
|
354
|
-
},
|
|
355
|
-
taxTranscript: {
|
|
356
|
-
type: String,
|
|
357
|
-
},
|
|
358
|
-
proofOfAddress: {
|
|
359
|
-
type: String,
|
|
360
|
-
},
|
|
361
|
-
businessRegistration: {
|
|
362
|
-
type: String,
|
|
363
|
-
},
|
|
364
|
-
taxIdentificationCertificate: {
|
|
365
|
-
type: String,
|
|
366
|
-
},
|
|
367
|
-
legalRepresentativeIdPowerOfAttorney: {
|
|
368
|
-
type: String,
|
|
369
|
-
},
|
|
370
|
-
personalIdentificationCertificate: {
|
|
371
|
-
type: String,
|
|
372
|
-
},
|
|
373
|
-
extraFiles: [
|
|
374
|
-
{
|
|
375
|
-
type: String,
|
|
376
|
-
},
|
|
377
|
-
],
|
|
378
|
-
},
|
|
379
|
-
},
|
|
380
|
-
PE: {
|
|
381
|
-
status: {
|
|
382
|
-
type: String,
|
|
383
|
-
required: true,
|
|
384
|
-
},
|
|
385
|
-
personalId: {
|
|
386
|
-
type: String,
|
|
387
|
-
},
|
|
388
|
-
taxId: {
|
|
389
|
-
type: String,
|
|
390
|
-
},
|
|
391
|
-
files: {
|
|
392
|
-
certificateOfIncorporation: {
|
|
393
|
-
type: String,
|
|
394
|
-
},
|
|
395
|
-
kycReport: {
|
|
396
|
-
type: String,
|
|
397
|
-
},
|
|
398
|
-
taxTranscript: {
|
|
399
|
-
type: String,
|
|
400
|
-
},
|
|
401
|
-
proofOfAddress: {
|
|
402
|
-
type: String,
|
|
403
|
-
},
|
|
404
|
-
businessRegistration: {
|
|
405
|
-
type: String,
|
|
406
|
-
},
|
|
407
|
-
taxIdentificationCertificate: {
|
|
408
|
-
type: String,
|
|
409
|
-
},
|
|
410
|
-
legalRepresentativeIdPowerOfAttorney: {
|
|
411
|
-
type: String,
|
|
412
|
-
},
|
|
413
|
-
personalIdentificationCertificate: {
|
|
414
|
-
type: String,
|
|
415
|
-
},
|
|
416
|
-
extraFiles: [
|
|
417
|
-
{
|
|
418
|
-
type: String,
|
|
419
|
-
},
|
|
420
|
-
],
|
|
421
|
-
},
|
|
422
|
-
},
|
|
423
|
-
US: {
|
|
424
|
-
status: {
|
|
425
|
-
type: String,
|
|
426
|
-
required: true,
|
|
427
|
-
},
|
|
428
|
-
personalId: {
|
|
429
|
-
type: String,
|
|
430
|
-
},
|
|
431
|
-
taxId: {
|
|
432
|
-
type: String,
|
|
433
|
-
},
|
|
434
|
-
files: {
|
|
435
|
-
certificateOfIncorporation: {
|
|
436
|
-
type: String,
|
|
437
|
-
},
|
|
438
|
-
kycReport: {
|
|
439
|
-
type: String,
|
|
440
|
-
},
|
|
441
|
-
extraFiles: [
|
|
442
|
-
{
|
|
443
|
-
type: String,
|
|
444
|
-
},
|
|
445
|
-
],
|
|
446
|
-
},
|
|
447
|
-
},
|
|
448
|
-
BR: {
|
|
449
|
-
status: {
|
|
450
|
-
type: String,
|
|
451
|
-
required: true,
|
|
452
|
-
},
|
|
453
|
-
personalId: {
|
|
454
|
-
type: String,
|
|
455
|
-
},
|
|
456
|
-
taxId: {
|
|
457
|
-
type: String,
|
|
458
|
-
},
|
|
459
|
-
files: {
|
|
460
|
-
certificateOfIncorporation: {
|
|
461
|
-
type: String,
|
|
462
|
-
},
|
|
463
|
-
kycReport: {
|
|
464
|
-
type: String,
|
|
465
|
-
},
|
|
466
|
-
taxTranscript: {
|
|
467
|
-
type: String,
|
|
468
|
-
},
|
|
469
|
-
proofOfAddress: {
|
|
470
|
-
type: String,
|
|
471
|
-
},
|
|
472
|
-
businessRegistration: {
|
|
473
|
-
type: String,
|
|
474
|
-
},
|
|
475
|
-
taxIdentificationCertificate: {
|
|
476
|
-
type: String,
|
|
477
|
-
},
|
|
478
|
-
legalRepresentativeIdPowerOfAttorney: {
|
|
479
|
-
type: String,
|
|
480
|
-
},
|
|
481
|
-
personalIdentificationCertificate: {
|
|
482
|
-
type: String,
|
|
483
|
-
},
|
|
484
|
-
extraFiles: [
|
|
485
|
-
{
|
|
486
|
-
type: String,
|
|
487
|
-
},
|
|
488
|
-
],
|
|
489
|
-
},
|
|
490
|
-
},
|
|
491
|
-
},
|
|
336
|
+
KYC: Object,
|
|
492
337
|
invoicing: {
|
|
493
338
|
MX: {
|
|
494
339
|
shouldInvoice: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1393",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
|
-
"@riocrypto/common": "^1.0.
|
|
30
|
+
"@riocrypto/common": "^1.0.1214",
|
|
31
31
|
"@types/express": "^4.17.13",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"ccxt": "^3.0.30",
|