@blindpay/node 3.10.0 → 4.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/dist/{chunk-7PWF4J3Z.mjs → chunk-ECYZLQUR.mjs} +12 -12
- package/dist/{chunk-N4F3FBNB.mjs → chunk-L23IOSI3.mjs} +40 -40
- package/dist/chunk-SLKVEQUY.mjs +76 -0
- package/dist/{chunk-LEPGLH7Q.mjs → chunk-SWTOSLUI.mjs} +10 -10
- package/dist/{chunk-KMU6V4LW.mjs → chunk-TVOMVVOO.mjs} +11 -11
- package/dist/{chunk-FG25JHDX.mjs → chunk-VAVDEV6P.mjs} +14 -14
- package/dist/{chunk-QGNLMN6Z.mjs → chunk-YHI3J2CL.mjs} +7 -7
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +148 -141
- package/dist/index.mjs +12 -12
- package/dist/resources/api-keys/api-keys.test.js +146 -139
- package/dist/resources/api-keys/api-keys.test.mjs +7 -7
- package/dist/resources/available/available.test.js +146 -139
- package/dist/resources/available/available.test.mjs +7 -7
- package/dist/resources/bank-accounts/bank-accounts.test.js +173 -166
- package/dist/resources/bank-accounts/bank-accounts.test.mjs +34 -34
- package/dist/resources/bank-accounts/index.d.mts +29 -29
- package/dist/resources/bank-accounts/index.d.ts +29 -29
- package/dist/resources/bank-accounts/index.js +40 -40
- package/dist/resources/bank-accounts/index.mjs +1 -1
- package/dist/resources/{receivers/receivers.test.js → customers/customers.test.js} +200 -193
- package/dist/resources/{receivers/receivers.test.mjs → customers/customers.test.mjs} +64 -64
- package/dist/resources/{receivers → customers}/index.d.mts +23 -23
- package/dist/resources/{receivers → customers}/index.d.ts +23 -23
- package/dist/resources/{receivers → customers}/index.js +32 -25
- package/dist/resources/customers/index.mjs +9 -0
- package/dist/resources/fees/fees.test.js +146 -139
- package/dist/resources/fees/fees.test.mjs +7 -7
- package/dist/resources/instances/instances.test.js +146 -139
- package/dist/resources/instances/instances.test.mjs +7 -7
- package/dist/resources/partner-fees/partner-fees.test.js +146 -139
- package/dist/resources/partner-fees/partner-fees.test.mjs +7 -7
- package/dist/resources/payins/payins-quotes.test.js +146 -139
- package/dist/resources/payins/payins-quotes.test.mjs +7 -7
- package/dist/resources/payins/payins.test.js +146 -139
- package/dist/resources/payins/payins.test.mjs +7 -7
- package/dist/resources/payouts/payouts.test.js +146 -139
- package/dist/resources/payouts/payouts.test.mjs +7 -7
- package/dist/resources/quotes/quotes.test.js +146 -139
- package/dist/resources/quotes/quotes.test.mjs +7 -7
- package/dist/resources/terms-of-service/terms-of-service.test.js +146 -139
- package/dist/resources/terms-of-service/terms-of-service.test.mjs +7 -7
- package/dist/resources/transfers/transfers.test.js +146 -139
- package/dist/resources/transfers/transfers.test.mjs +7 -7
- package/dist/resources/upload/upload.test.js +146 -139
- package/dist/resources/upload/upload.test.mjs +7 -7
- package/dist/resources/virtual-accounts/index.d.mts +7 -7
- package/dist/resources/virtual-accounts/index.d.ts +7 -7
- package/dist/resources/virtual-accounts/index.js +10 -10
- package/dist/resources/virtual-accounts/index.mjs +1 -1
- package/dist/resources/virtual-accounts/virtual-accounts.test.js +150 -143
- package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +11 -11
- package/dist/resources/wallets/blockchain.d.mts +13 -13
- package/dist/resources/wallets/blockchain.d.ts +13 -13
- package/dist/resources/wallets/blockchain.js +14 -14
- package/dist/resources/wallets/blockchain.mjs +1 -1
- package/dist/resources/wallets/blockchain.test.js +154 -147
- package/dist/resources/wallets/blockchain.test.mjs +15 -15
- package/dist/resources/wallets/custodial.d.mts +9 -9
- package/dist/resources/wallets/custodial.d.ts +9 -9
- package/dist/resources/wallets/custodial.js +11 -11
- package/dist/resources/wallets/custodial.mjs +1 -1
- package/dist/resources/wallets/custodial.test.js +150 -143
- package/dist/resources/wallets/custodial.test.mjs +11 -11
- package/dist/resources/wallets/offramp.d.mts +7 -7
- package/dist/resources/wallets/offramp.d.ts +7 -7
- package/dist/resources/wallets/offramp.js +7 -7
- package/dist/resources/wallets/offramp.mjs +1 -1
- package/dist/resources/wallets/offramp.test.js +152 -145
- package/dist/resources/wallets/offramp.test.mjs +13 -13
- package/dist/resources/webhooks/webhooks.test.js +146 -139
- package/dist/resources/webhooks/webhooks.test.mjs +7 -7
- package/package.json +1 -1
- package/dist/chunk-YIZJM2GU.mjs +0 -69
- package/dist/resources/receivers/index.mjs +0 -9
- /package/dist/resources/{receivers/receivers.test.d.mts → customers/customers.test.d.mts} +0 -0
- /package/dist/resources/{receivers/receivers.test.d.ts → customers/customers.test.d.ts} +0 -0
|
@@ -8,42 +8,42 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
BlindPay,
|
|
10
10
|
init_client
|
|
11
|
-
} from "../../chunk-
|
|
12
|
-
import "../../chunk-
|
|
13
|
-
import "../../chunk-
|
|
14
|
-
import "../../chunk-
|
|
11
|
+
} from "../../chunk-ECYZLQUR.mjs";
|
|
12
|
+
import "../../chunk-VAVDEV6P.mjs";
|
|
13
|
+
import "../../chunk-TVOMVVOO.mjs";
|
|
14
|
+
import "../../chunk-YHI3J2CL.mjs";
|
|
15
15
|
import "../../chunk-UC57SCKQ.mjs";
|
|
16
16
|
import "../../chunk-ISHZTBAN.mjs";
|
|
17
17
|
import "../../chunk-UDRMLZWT.mjs";
|
|
18
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-SWTOSLUI.mjs";
|
|
19
19
|
import "../../chunk-E7M4CJKR.mjs";
|
|
20
20
|
import "../../chunk-F5Z45GCA.mjs";
|
|
21
21
|
import "../../chunk-TBTA7A2P.mjs";
|
|
22
|
-
import "../../chunk-YIZJM2GU.mjs";
|
|
23
22
|
import "../../chunk-Z6EYX4D3.mjs";
|
|
23
|
+
import "../../chunk-SLKVEQUY.mjs";
|
|
24
24
|
import "../../chunk-ALHMJWQN.mjs";
|
|
25
25
|
import "../../chunk-KYOUR4KX.mjs";
|
|
26
26
|
import "../../chunk-RC5NN5UF.mjs";
|
|
27
27
|
import "../../chunk-VGU72ZNI.mjs";
|
|
28
28
|
import "../../chunk-LRHWT4JU.mjs";
|
|
29
29
|
import "../../chunk-WE73MTQL.mjs";
|
|
30
|
-
import "../../chunk-
|
|
30
|
+
import "../../chunk-L23IOSI3.mjs";
|
|
31
31
|
import {
|
|
32
32
|
__async,
|
|
33
33
|
__commonJS
|
|
34
34
|
} from "../../chunk-OBKEW4AQ.mjs";
|
|
35
35
|
|
|
36
|
-
// src/resources/
|
|
37
|
-
var
|
|
38
|
-
"src/resources/
|
|
36
|
+
// src/resources/customers/customers.test.ts
|
|
37
|
+
var require_customers_test = __commonJS({
|
|
38
|
+
"src/resources/customers/customers.test.ts"(exports) {
|
|
39
39
|
init_dist();
|
|
40
40
|
init_client();
|
|
41
|
-
describe("
|
|
41
|
+
describe("Customers", () => {
|
|
42
42
|
afterEach(() => fetchMock.resetMocks());
|
|
43
43
|
const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
|
|
44
|
-
describe("List
|
|
45
|
-
it("should list
|
|
46
|
-
const
|
|
44
|
+
describe("List customers", () => {
|
|
45
|
+
it("should list customers", () => __async(null, null, function* () {
|
|
46
|
+
const mockedCustomers = {
|
|
47
47
|
data: [
|
|
48
48
|
{
|
|
49
49
|
id: "re_Euw7HN4OdxPn",
|
|
@@ -203,23 +203,23 @@ var require_receivers_test = __commonJS({
|
|
|
203
203
|
prev_page: ""
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
fetchMock.mockResponseOnce(JSON.stringify(
|
|
206
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomers), {
|
|
207
207
|
headers: { "Content-Type": "application/json" }
|
|
208
208
|
});
|
|
209
|
-
const { data, error } = yield blindpay.
|
|
209
|
+
const { data, error } = yield blindpay.customers.list();
|
|
210
210
|
globalExpect(error).toBeNull();
|
|
211
|
-
globalExpect(data).toEqual(
|
|
211
|
+
globalExpect(data).toEqual(mockedCustomers);
|
|
212
212
|
}));
|
|
213
213
|
});
|
|
214
|
-
describe("Create
|
|
215
|
-
it("should create an individual
|
|
216
|
-
const
|
|
214
|
+
describe("Create customer", () => {
|
|
215
|
+
it("should create an individual customer with standard KYC", () => __async(null, null, function* () {
|
|
216
|
+
const mockedCustomer = {
|
|
217
217
|
id: "re_Euw7HN4OdxPn"
|
|
218
218
|
};
|
|
219
|
-
fetchMock.mockResponseOnce(JSON.stringify(
|
|
219
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
220
220
|
headers: { "Content-Type": "application/json" }
|
|
221
221
|
});
|
|
222
|
-
const { data, error } = yield blindpay.
|
|
222
|
+
const { data, error } = yield blindpay.customers.createIndividualWithStandardKYC({
|
|
223
223
|
email: "bernardo.simonassi@gmail.com",
|
|
224
224
|
country: "BR",
|
|
225
225
|
tax_id: "12345678900",
|
|
@@ -243,14 +243,14 @@ var require_receivers_test = __commonJS({
|
|
|
243
243
|
globalExpect(error).toBeNull();
|
|
244
244
|
globalExpect(data).toEqual({ id: "re_Euw7HN4OdxPn" });
|
|
245
245
|
}));
|
|
246
|
-
it("should create an individual
|
|
247
|
-
const
|
|
246
|
+
it("should create an individual customer with enhanced KYC", () => __async(null, null, function* () {
|
|
247
|
+
const mockedCustomer = {
|
|
248
248
|
id: "re_YuaMcI2B8zbQ"
|
|
249
249
|
};
|
|
250
|
-
fetchMock.mockResponseOnce(JSON.stringify(
|
|
250
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
251
251
|
headers: { "Content-Type": "application/json" }
|
|
252
252
|
});
|
|
253
|
-
const { data, error } = yield blindpay.
|
|
253
|
+
const { data, error } = yield blindpay.customers.createIndividualWithEnhancedKYC({
|
|
254
254
|
email: "bernardo.simonassi@gmail.com",
|
|
255
255
|
country: "BR",
|
|
256
256
|
tax_id: "12345678900",
|
|
@@ -279,14 +279,14 @@ var require_receivers_test = __commonJS({
|
|
|
279
279
|
globalExpect(error).toBeNull();
|
|
280
280
|
globalExpect(data).toEqual({ id: "re_YuaMcI2B8zbQ" });
|
|
281
281
|
}));
|
|
282
|
-
it("should create a business
|
|
283
|
-
const
|
|
282
|
+
it("should create a business customer with standard KYB", () => __async(null, null, function* () {
|
|
283
|
+
const mockedCustomer = {
|
|
284
284
|
id: "re_IOxAUL24LG7P"
|
|
285
285
|
};
|
|
286
|
-
fetchMock.mockResponseOnce(JSON.stringify(
|
|
286
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
287
287
|
headers: { "Content-Type": "application/json" }
|
|
288
288
|
});
|
|
289
|
-
const { data, error } = yield blindpay.
|
|
289
|
+
const { data, error } = yield blindpay.customers.createBusinessWithStandardKYB({
|
|
290
290
|
email: "contato@empresa.com.br",
|
|
291
291
|
country: "BR",
|
|
292
292
|
tax_id: "20096178000195",
|
|
@@ -339,9 +339,9 @@ var require_receivers_test = __commonJS({
|
|
|
339
339
|
globalExpect(data).toEqual({ id: "re_IOxAUL24LG7P" });
|
|
340
340
|
}));
|
|
341
341
|
});
|
|
342
|
-
describe("Get
|
|
343
|
-
it("should get a
|
|
344
|
-
const
|
|
342
|
+
describe("Get customer", () => {
|
|
343
|
+
it("should get a customer with new fields", () => __async(null, null, function* () {
|
|
344
|
+
const mockedCustomer = {
|
|
345
345
|
id: "re_YuaMcI2B8zbQ",
|
|
346
346
|
is_tos_accepted: true,
|
|
347
347
|
type: "individual",
|
|
@@ -398,15 +398,15 @@ var require_receivers_test = __commonJS({
|
|
|
398
398
|
external_id: "ext_123",
|
|
399
399
|
is_fbo: false
|
|
400
400
|
};
|
|
401
|
-
fetchMock.mockResponseOnce(JSON.stringify(
|
|
401
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
402
402
|
headers: { "Content-Type": "application/json" }
|
|
403
403
|
});
|
|
404
|
-
const { data, error } = yield blindpay.
|
|
404
|
+
const { data, error } = yield blindpay.customers.get("re_YuaMcI2B8zbQ");
|
|
405
405
|
globalExpect(error).toBeNull();
|
|
406
|
-
globalExpect(data).toEqual(
|
|
406
|
+
globalExpect(data).toEqual(mockedCustomer);
|
|
407
407
|
}));
|
|
408
|
-
it("should get a
|
|
409
|
-
const
|
|
408
|
+
it("should get a customer", () => __async(null, null, function* () {
|
|
409
|
+
const mockedCustomer = {
|
|
410
410
|
id: "re_YuaMcI2B8zbQ",
|
|
411
411
|
is_tos_accepted: true,
|
|
412
412
|
type: "individual",
|
|
@@ -456,21 +456,21 @@ var require_receivers_test = __commonJS({
|
|
|
456
456
|
monthly: 1e6
|
|
457
457
|
}
|
|
458
458
|
};
|
|
459
|
-
fetchMock.mockResponseOnce(JSON.stringify(
|
|
459
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomer), {
|
|
460
460
|
headers: { "Content-Type": "application/json" }
|
|
461
461
|
});
|
|
462
|
-
const { data, error } = yield blindpay.
|
|
462
|
+
const { data, error } = yield blindpay.customers.get("re_YuaMcI2B8zbQ");
|
|
463
463
|
globalExpect(error).toBeNull();
|
|
464
|
-
globalExpect(data).toEqual(
|
|
464
|
+
globalExpect(data).toEqual(mockedCustomer);
|
|
465
465
|
}));
|
|
466
466
|
});
|
|
467
|
-
describe("Update
|
|
468
|
-
it("should update a
|
|
467
|
+
describe("Update customer", () => {
|
|
468
|
+
it("should update a customer", () => __async(null, null, function* () {
|
|
469
469
|
fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
|
|
470
470
|
headers: { "Content-Type": "application/json" }
|
|
471
471
|
});
|
|
472
|
-
const { data, error } = yield blindpay.
|
|
473
|
-
|
|
472
|
+
const { data, error } = yield blindpay.customers.update({
|
|
473
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
474
474
|
email: "bernardo.simonassi@gmail.com",
|
|
475
475
|
tax_id: "12345678900",
|
|
476
476
|
address_line_1: "Av. Paulista, 1000",
|
|
@@ -530,19 +530,19 @@ var require_receivers_test = __commonJS({
|
|
|
530
530
|
globalExpect(data).toEqual({ data: null });
|
|
531
531
|
}));
|
|
532
532
|
});
|
|
533
|
-
describe("Delete
|
|
534
|
-
it("should delete a
|
|
533
|
+
describe("Delete customer", () => {
|
|
534
|
+
it("should delete a customer", () => __async(null, null, function* () {
|
|
535
535
|
fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
|
|
536
536
|
headers: { "Content-Type": "application/json" }
|
|
537
537
|
});
|
|
538
|
-
const { data, error } = yield blindpay.
|
|
538
|
+
const { data, error } = yield blindpay.customers.delete("re_YuaMcI2B8zbQ");
|
|
539
539
|
globalExpect(error).toBeNull();
|
|
540
540
|
globalExpect(data).toEqual({ data: null });
|
|
541
541
|
}));
|
|
542
542
|
});
|
|
543
|
-
describe("Get
|
|
544
|
-
it("should get
|
|
545
|
-
const
|
|
543
|
+
describe("Get customer limits", () => {
|
|
544
|
+
it("should get customer limits", () => __async(null, null, function* () {
|
|
545
|
+
const mockedCustomerLimits = {
|
|
546
546
|
limits: {
|
|
547
547
|
payin: {
|
|
548
548
|
daily: 1e4,
|
|
@@ -554,20 +554,20 @@ var require_receivers_test = __commonJS({
|
|
|
554
554
|
}
|
|
555
555
|
}
|
|
556
556
|
};
|
|
557
|
-
fetchMock.mockResponseOnce(JSON.stringify(
|
|
557
|
+
fetchMock.mockResponseOnce(JSON.stringify(mockedCustomerLimits), {
|
|
558
558
|
headers: { "Content-Type": "application/json" }
|
|
559
559
|
});
|
|
560
|
-
const { data, error } = yield blindpay.
|
|
560
|
+
const { data, error } = yield blindpay.customers.getLimits("re_YuaMcI2B8zbQ");
|
|
561
561
|
globalExpect(error).toBeNull();
|
|
562
|
-
globalExpect(data).toEqual(
|
|
562
|
+
globalExpect(data).toEqual(mockedCustomerLimits);
|
|
563
563
|
}));
|
|
564
564
|
});
|
|
565
565
|
describe("Get limit increase requests", () => {
|
|
566
|
-
it("should get limit increase requests for a
|
|
566
|
+
it("should get limit increase requests for a customer", () => __async(null, null, function* () {
|
|
567
567
|
const mockedLimitIncreaseRequests = [
|
|
568
568
|
{
|
|
569
569
|
id: "rl_000000000000",
|
|
570
|
-
|
|
570
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
571
571
|
status: "in_review",
|
|
572
572
|
daily: 5e4,
|
|
573
573
|
monthly: 25e4,
|
|
@@ -579,7 +579,7 @@ var require_receivers_test = __commonJS({
|
|
|
579
579
|
},
|
|
580
580
|
{
|
|
581
581
|
id: "rl_000000000000",
|
|
582
|
-
|
|
582
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
583
583
|
status: "approved",
|
|
584
584
|
daily: 3e4,
|
|
585
585
|
monthly: 15e4,
|
|
@@ -593,7 +593,7 @@ var require_receivers_test = __commonJS({
|
|
|
593
593
|
fetchMock.mockResponseOnce(JSON.stringify(mockedLimitIncreaseRequests), {
|
|
594
594
|
headers: { "Content-Type": "application/json" }
|
|
595
595
|
});
|
|
596
|
-
const { data, error } = yield blindpay.
|
|
596
|
+
const { data, error } = yield blindpay.customers.getLimitIncreaseRequests("re_YuaMcI2B8zbQ");
|
|
597
597
|
globalExpect(error).toBeNull();
|
|
598
598
|
globalExpect(data).toEqual(mockedLimitIncreaseRequests);
|
|
599
599
|
}));
|
|
@@ -603,7 +603,7 @@ var require_receivers_test = __commonJS({
|
|
|
603
603
|
const mockedLimitIncreaseRequests = [
|
|
604
604
|
{
|
|
605
605
|
id: "rl_000000000000",
|
|
606
|
-
|
|
606
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
607
607
|
status: "approved",
|
|
608
608
|
daily: 5e4,
|
|
609
609
|
monthly: 25e4,
|
|
@@ -620,21 +620,21 @@ var require_receivers_test = __commonJS({
|
|
|
620
620
|
fetchMock.mockResponseOnce(JSON.stringify(mockedLimitIncreaseRequests), {
|
|
621
621
|
headers: { "Content-Type": "application/json" }
|
|
622
622
|
});
|
|
623
|
-
const { data, error } = yield blindpay.
|
|
623
|
+
const { data, error } = yield blindpay.customers.getLimitIncreaseRequests("re_YuaMcI2B8zbQ");
|
|
624
624
|
globalExpect(error).toBeNull();
|
|
625
625
|
globalExpect(data).toEqual(mockedLimitIncreaseRequests);
|
|
626
626
|
}));
|
|
627
627
|
});
|
|
628
628
|
describe("Request limit increase", () => {
|
|
629
|
-
it("should request a limit increase for a
|
|
629
|
+
it("should request a limit increase for a customer", () => __async(null, null, function* () {
|
|
630
630
|
const mockedResponse = {
|
|
631
631
|
id: "rl_000000000000"
|
|
632
632
|
};
|
|
633
633
|
fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
|
|
634
634
|
headers: { "Content-Type": "application/json" }
|
|
635
635
|
});
|
|
636
|
-
const { data, error } = yield blindpay.
|
|
637
|
-
|
|
636
|
+
const { data, error } = yield blindpay.customers.requestLimitIncrease({
|
|
637
|
+
customer_id: "re_YuaMcI2B8zbQ",
|
|
638
638
|
daily: 1e5,
|
|
639
639
|
monthly: 5e5,
|
|
640
640
|
per_transaction: 5e4,
|
|
@@ -648,4 +648,4 @@ var require_receivers_test = __commonJS({
|
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
650
|
});
|
|
651
|
-
export default
|
|
651
|
+
export default require_customers_test();
|
|
@@ -45,7 +45,7 @@ type Owner = {
|
|
|
45
45
|
title: string | null;
|
|
46
46
|
tax_type?: OwnerTaxType | null;
|
|
47
47
|
instance_id?: string;
|
|
48
|
-
|
|
48
|
+
customer_id?: string;
|
|
49
49
|
};
|
|
50
50
|
type IndividualWithStandardKYC = {
|
|
51
51
|
id: string;
|
|
@@ -346,22 +346,22 @@ type CreateBusinessWithStandardKYBInput = {
|
|
|
346
346
|
type CreateBusinessWithStandardKYBResponse = {
|
|
347
347
|
id: string;
|
|
348
348
|
};
|
|
349
|
-
type
|
|
349
|
+
type ListCustomersInput = PaginationParams & {
|
|
350
350
|
full_name?: string;
|
|
351
|
-
|
|
351
|
+
customer_name?: string;
|
|
352
352
|
status?: string;
|
|
353
|
-
|
|
353
|
+
customer_id?: string;
|
|
354
354
|
bank_account_id?: string;
|
|
355
355
|
country?: Country;
|
|
356
356
|
};
|
|
357
|
-
type
|
|
357
|
+
type ListCustomersResponse = {
|
|
358
358
|
data: Array<IndividualWithStandardKYC | IndividualWithEnhancedKYC | BusinessWithStandardKYB>;
|
|
359
359
|
pagination: PaginationMetadata;
|
|
360
360
|
};
|
|
361
|
-
type
|
|
362
|
-
type
|
|
363
|
-
type
|
|
364
|
-
|
|
361
|
+
type GetCustomerInput = string;
|
|
362
|
+
type GetCustomerResponse = IndividualWithStandardKYC | IndividualWithEnhancedKYC | BusinessWithStandardKYB;
|
|
363
|
+
type UpdateCustomerInput = {
|
|
364
|
+
customer_id: string;
|
|
365
365
|
account_purpose?: AccountPurpose | null;
|
|
366
366
|
address_line_1?: string;
|
|
367
367
|
address_line_2?: string;
|
|
@@ -408,9 +408,9 @@ type UpdateReceiverInput = {
|
|
|
408
408
|
recipient_relationship?: RecipientRelationship | null;
|
|
409
409
|
sole_proprietor_doc_type?: SoleProprietorDocType | null;
|
|
410
410
|
};
|
|
411
|
-
type
|
|
412
|
-
type
|
|
413
|
-
type
|
|
411
|
+
type DeleteCustomerInput = string;
|
|
412
|
+
type GetCustomerLimitsInput = string;
|
|
413
|
+
type GetCustomerLimitsResponse = {
|
|
414
414
|
limits: {
|
|
415
415
|
payin: {
|
|
416
416
|
daily: number;
|
|
@@ -427,7 +427,7 @@ type LimitIncreaseRequestStatus = "in_review" | "approved" | "rejected";
|
|
|
427
427
|
type LimitIncreaseRequestSupportingDocumentType = "individual_bank_statement" | "individual_tax_return" | "individual_proof_of_income" | "business_bank_statement" | "business_financial_statements" | "business_tax_return";
|
|
428
428
|
type GetLimitIncreaseRequestsResponse = Array<{
|
|
429
429
|
id: string;
|
|
430
|
-
|
|
430
|
+
customer_id: string;
|
|
431
431
|
status: LimitIncreaseRequestStatus;
|
|
432
432
|
daily: number;
|
|
433
433
|
monthly: number;
|
|
@@ -441,7 +441,7 @@ type GetLimitIncreaseRequestsResponse = Array<{
|
|
|
441
441
|
approved_monthly?: number | null;
|
|
442
442
|
}>;
|
|
443
443
|
type RequestLimitIncreaseInput = {
|
|
444
|
-
|
|
444
|
+
customer_id: string;
|
|
445
445
|
daily: number;
|
|
446
446
|
monthly: number;
|
|
447
447
|
per_transaction: number;
|
|
@@ -451,17 +451,17 @@ type RequestLimitIncreaseInput = {
|
|
|
451
451
|
type RequestLimitIncreaseResponse = {
|
|
452
452
|
id: string;
|
|
453
453
|
};
|
|
454
|
-
declare function
|
|
455
|
-
list(params?:
|
|
454
|
+
declare function createCustomersResource(instanceId: string, client: InternalApiClient): {
|
|
455
|
+
list(params?: ListCustomersInput): Promise<BlindpayApiResponse<ListCustomersResponse>>;
|
|
456
456
|
createIndividualWithStandardKYC(data: CreateIndividualWithStandardKYCInput): Promise<BlindpayApiResponse<CreateIndividualWithStandardKYCResponse>>;
|
|
457
457
|
createIndividualWithEnhancedKYC(data: CreateIndividualWithEnhancedKYCInput): Promise<BlindpayApiResponse<CreateIndividualWithEnhancedKYCResponse>>;
|
|
458
458
|
createBusinessWithStandardKYB(data: CreateBusinessWithStandardKYBInput): Promise<BlindpayApiResponse<CreateBusinessWithStandardKYBResponse>>;
|
|
459
|
-
get(
|
|
460
|
-
update({
|
|
461
|
-
delete(
|
|
462
|
-
getLimits(
|
|
463
|
-
getLimitIncreaseRequests(
|
|
464
|
-
requestLimitIncrease({
|
|
459
|
+
get(customer_id: GetCustomerInput): Promise<BlindpayApiResponse<GetCustomerResponse>>;
|
|
460
|
+
update({ customer_id, ...data }: UpdateCustomerInput): Promise<BlindpayApiResponse<void>>;
|
|
461
|
+
delete(customer_id: DeleteCustomerInput): Promise<BlindpayApiResponse<void>>;
|
|
462
|
+
getLimits(customer_id: GetCustomerLimitsInput): Promise<BlindpayApiResponse<GetCustomerLimitsResponse>>;
|
|
463
|
+
getLimitIncreaseRequests(customer_id: GetLimitIncreaseRequestsInput): Promise<BlindpayApiResponse<GetLimitIncreaseRequestsResponse>>;
|
|
464
|
+
requestLimitIncrease({ customer_id, ...data }: RequestLimitIncreaseInput): Promise<BlindpayApiResponse<RequestLimitIncreaseResponse>>;
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
export { type AmlHits, type AmlStatus, type BusinessWithStandardKYB, type CreateBusinessWithStandardKYBInput, type CreateBusinessWithStandardKYBResponse, type CreateIndividualWithEnhancedKYCInput, type CreateIndividualWithEnhancedKYCResponse, type CreateIndividualWithStandardKYCInput, type CreateIndividualWithStandardKYCResponse, type
|
|
467
|
+
export { type AmlHits, type AmlStatus, type BusinessWithStandardKYB, type CreateBusinessWithStandardKYBInput, type CreateBusinessWithStandardKYBResponse, type CreateIndividualWithEnhancedKYCInput, type CreateIndividualWithEnhancedKYCResponse, type CreateIndividualWithStandardKYCInput, type CreateIndividualWithStandardKYCResponse, type DeleteCustomerInput, type FraudWarning, type GetCustomerInput, type GetCustomerLimitsInput, type GetCustomerLimitsResponse, type GetCustomerResponse, type GetLimitIncreaseRequestsInput, type GetLimitIncreaseRequestsResponse, type IdentificationDocument, type IndividualWithEnhancedKYC, type IndividualWithStandardKYC, type KycType, type LimitIncreaseRequestStatus, type LimitIncreaseRequestSupportingDocumentType, type ListCustomersInput, type ListCustomersResponse, type Owner, type OwnerRole, type OwnerTaxType, type ProofOfAddressDocType, type RequestLimitIncreaseInput, type RequestLimitIncreaseResponse, type UpdateCustomerInput, createCustomersResource };
|
|
@@ -45,7 +45,7 @@ type Owner = {
|
|
|
45
45
|
title: string | null;
|
|
46
46
|
tax_type?: OwnerTaxType | null;
|
|
47
47
|
instance_id?: string;
|
|
48
|
-
|
|
48
|
+
customer_id?: string;
|
|
49
49
|
};
|
|
50
50
|
type IndividualWithStandardKYC = {
|
|
51
51
|
id: string;
|
|
@@ -346,22 +346,22 @@ type CreateBusinessWithStandardKYBInput = {
|
|
|
346
346
|
type CreateBusinessWithStandardKYBResponse = {
|
|
347
347
|
id: string;
|
|
348
348
|
};
|
|
349
|
-
type
|
|
349
|
+
type ListCustomersInput = PaginationParams & {
|
|
350
350
|
full_name?: string;
|
|
351
|
-
|
|
351
|
+
customer_name?: string;
|
|
352
352
|
status?: string;
|
|
353
|
-
|
|
353
|
+
customer_id?: string;
|
|
354
354
|
bank_account_id?: string;
|
|
355
355
|
country?: Country;
|
|
356
356
|
};
|
|
357
|
-
type
|
|
357
|
+
type ListCustomersResponse = {
|
|
358
358
|
data: Array<IndividualWithStandardKYC | IndividualWithEnhancedKYC | BusinessWithStandardKYB>;
|
|
359
359
|
pagination: PaginationMetadata;
|
|
360
360
|
};
|
|
361
|
-
type
|
|
362
|
-
type
|
|
363
|
-
type
|
|
364
|
-
|
|
361
|
+
type GetCustomerInput = string;
|
|
362
|
+
type GetCustomerResponse = IndividualWithStandardKYC | IndividualWithEnhancedKYC | BusinessWithStandardKYB;
|
|
363
|
+
type UpdateCustomerInput = {
|
|
364
|
+
customer_id: string;
|
|
365
365
|
account_purpose?: AccountPurpose | null;
|
|
366
366
|
address_line_1?: string;
|
|
367
367
|
address_line_2?: string;
|
|
@@ -408,9 +408,9 @@ type UpdateReceiverInput = {
|
|
|
408
408
|
recipient_relationship?: RecipientRelationship | null;
|
|
409
409
|
sole_proprietor_doc_type?: SoleProprietorDocType | null;
|
|
410
410
|
};
|
|
411
|
-
type
|
|
412
|
-
type
|
|
413
|
-
type
|
|
411
|
+
type DeleteCustomerInput = string;
|
|
412
|
+
type GetCustomerLimitsInput = string;
|
|
413
|
+
type GetCustomerLimitsResponse = {
|
|
414
414
|
limits: {
|
|
415
415
|
payin: {
|
|
416
416
|
daily: number;
|
|
@@ -427,7 +427,7 @@ type LimitIncreaseRequestStatus = "in_review" | "approved" | "rejected";
|
|
|
427
427
|
type LimitIncreaseRequestSupportingDocumentType = "individual_bank_statement" | "individual_tax_return" | "individual_proof_of_income" | "business_bank_statement" | "business_financial_statements" | "business_tax_return";
|
|
428
428
|
type GetLimitIncreaseRequestsResponse = Array<{
|
|
429
429
|
id: string;
|
|
430
|
-
|
|
430
|
+
customer_id: string;
|
|
431
431
|
status: LimitIncreaseRequestStatus;
|
|
432
432
|
daily: number;
|
|
433
433
|
monthly: number;
|
|
@@ -441,7 +441,7 @@ type GetLimitIncreaseRequestsResponse = Array<{
|
|
|
441
441
|
approved_monthly?: number | null;
|
|
442
442
|
}>;
|
|
443
443
|
type RequestLimitIncreaseInput = {
|
|
444
|
-
|
|
444
|
+
customer_id: string;
|
|
445
445
|
daily: number;
|
|
446
446
|
monthly: number;
|
|
447
447
|
per_transaction: number;
|
|
@@ -451,17 +451,17 @@ type RequestLimitIncreaseInput = {
|
|
|
451
451
|
type RequestLimitIncreaseResponse = {
|
|
452
452
|
id: string;
|
|
453
453
|
};
|
|
454
|
-
declare function
|
|
455
|
-
list(params?:
|
|
454
|
+
declare function createCustomersResource(instanceId: string, client: InternalApiClient): {
|
|
455
|
+
list(params?: ListCustomersInput): Promise<BlindpayApiResponse<ListCustomersResponse>>;
|
|
456
456
|
createIndividualWithStandardKYC(data: CreateIndividualWithStandardKYCInput): Promise<BlindpayApiResponse<CreateIndividualWithStandardKYCResponse>>;
|
|
457
457
|
createIndividualWithEnhancedKYC(data: CreateIndividualWithEnhancedKYCInput): Promise<BlindpayApiResponse<CreateIndividualWithEnhancedKYCResponse>>;
|
|
458
458
|
createBusinessWithStandardKYB(data: CreateBusinessWithStandardKYBInput): Promise<BlindpayApiResponse<CreateBusinessWithStandardKYBResponse>>;
|
|
459
|
-
get(
|
|
460
|
-
update({
|
|
461
|
-
delete(
|
|
462
|
-
getLimits(
|
|
463
|
-
getLimitIncreaseRequests(
|
|
464
|
-
requestLimitIncrease({
|
|
459
|
+
get(customer_id: GetCustomerInput): Promise<BlindpayApiResponse<GetCustomerResponse>>;
|
|
460
|
+
update({ customer_id, ...data }: UpdateCustomerInput): Promise<BlindpayApiResponse<void>>;
|
|
461
|
+
delete(customer_id: DeleteCustomerInput): Promise<BlindpayApiResponse<void>>;
|
|
462
|
+
getLimits(customer_id: GetCustomerLimitsInput): Promise<BlindpayApiResponse<GetCustomerLimitsResponse>>;
|
|
463
|
+
getLimitIncreaseRequests(customer_id: GetLimitIncreaseRequestsInput): Promise<BlindpayApiResponse<GetLimitIncreaseRequestsResponse>>;
|
|
464
|
+
requestLimitIncrease({ customer_id, ...data }: RequestLimitIncreaseInput): Promise<BlindpayApiResponse<RequestLimitIncreaseResponse>>;
|
|
465
465
|
};
|
|
466
466
|
|
|
467
|
-
export { type AmlHits, type AmlStatus, type BusinessWithStandardKYB, type CreateBusinessWithStandardKYBInput, type CreateBusinessWithStandardKYBResponse, type CreateIndividualWithEnhancedKYCInput, type CreateIndividualWithEnhancedKYCResponse, type CreateIndividualWithStandardKYCInput, type CreateIndividualWithStandardKYCResponse, type
|
|
467
|
+
export { type AmlHits, type AmlStatus, type BusinessWithStandardKYB, type CreateBusinessWithStandardKYBInput, type CreateBusinessWithStandardKYBResponse, type CreateIndividualWithEnhancedKYCInput, type CreateIndividualWithEnhancedKYCResponse, type CreateIndividualWithStandardKYCInput, type CreateIndividualWithStandardKYCResponse, type DeleteCustomerInput, type FraudWarning, type GetCustomerInput, type GetCustomerLimitsInput, type GetCustomerLimitsResponse, type GetCustomerResponse, type GetLimitIncreaseRequestsInput, type GetLimitIncreaseRequestsResponse, type IdentificationDocument, type IndividualWithEnhancedKYC, type IndividualWithStandardKYC, type KycType, type LimitIncreaseRequestStatus, type LimitIncreaseRequestSupportingDocumentType, type ListCustomersInput, type ListCustomersResponse, type Owner, type OwnerRole, type OwnerTaxType, type ProofOfAddressDocType, type RequestLimitIncreaseInput, type RequestLimitIncreaseResponse, type UpdateCustomerInput, createCustomersResource };
|
|
@@ -43,60 +43,67 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
43
43
|
};
|
|
44
44
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
45
|
|
|
46
|
-
// src/resources/
|
|
47
|
-
var
|
|
48
|
-
__export(
|
|
49
|
-
|
|
46
|
+
// src/resources/customers/index.ts
|
|
47
|
+
var customers_exports = {};
|
|
48
|
+
__export(customers_exports, {
|
|
49
|
+
createCustomersResource: () => createCustomersResource
|
|
50
50
|
});
|
|
51
|
-
module.exports = __toCommonJS(
|
|
52
|
-
function
|
|
51
|
+
module.exports = __toCommonJS(customers_exports);
|
|
52
|
+
function createCustomersResource(instanceId, client) {
|
|
53
53
|
return {
|
|
54
54
|
list(params) {
|
|
55
|
-
const
|
|
56
|
-
|
|
55
|
+
const wireParams = params ? Object.fromEntries(
|
|
56
|
+
Object.entries(params).map(([k, v]) => {
|
|
57
|
+
if (k === "customer_id") return ["receiver_id", v];
|
|
58
|
+
if (k === "customer_name") return ["receiver_name", v];
|
|
59
|
+
return [k, v];
|
|
60
|
+
})
|
|
61
|
+
) : void 0;
|
|
62
|
+
const queryParams = wireParams ? `?${new URLSearchParams(wireParams)}` : "";
|
|
63
|
+
return client.get(`/instances/${instanceId}/customers${queryParams}`);
|
|
57
64
|
},
|
|
58
65
|
createIndividualWithStandardKYC(data) {
|
|
59
|
-
return client.post(`/instances/${instanceId}/
|
|
66
|
+
return client.post(`/instances/${instanceId}/customers`, __spreadValues({
|
|
60
67
|
kyc_type: "standard",
|
|
61
68
|
type: "individual"
|
|
62
69
|
}, data));
|
|
63
70
|
},
|
|
64
71
|
createIndividualWithEnhancedKYC(data) {
|
|
65
|
-
return client.post(`/instances/${instanceId}/
|
|
72
|
+
return client.post(`/instances/${instanceId}/customers`, __spreadValues({
|
|
66
73
|
kyc_type: "enhanced",
|
|
67
74
|
type: "individual"
|
|
68
75
|
}, data));
|
|
69
76
|
},
|
|
70
77
|
createBusinessWithStandardKYB(data) {
|
|
71
|
-
return client.post(`/instances/${instanceId}/
|
|
78
|
+
return client.post(`/instances/${instanceId}/customers`, __spreadValues({
|
|
72
79
|
kyc_type: "standard",
|
|
73
80
|
type: "business"
|
|
74
81
|
}, data));
|
|
75
82
|
},
|
|
76
|
-
get(
|
|
77
|
-
return client.get(`/instances/${instanceId}/
|
|
83
|
+
get(customer_id) {
|
|
84
|
+
return client.get(`/instances/${instanceId}/customers/${customer_id}`);
|
|
78
85
|
},
|
|
79
86
|
update(_a) {
|
|
80
|
-
var _b = _a, {
|
|
81
|
-
return client.put(`/instances/${instanceId}/
|
|
87
|
+
var _b = _a, { customer_id } = _b, data = __objRest(_b, ["customer_id"]);
|
|
88
|
+
return client.put(`/instances/${instanceId}/customers/${customer_id}`, data);
|
|
82
89
|
},
|
|
83
|
-
delete(
|
|
84
|
-
return client.delete(`/instances/${instanceId}/
|
|
90
|
+
delete(customer_id) {
|
|
91
|
+
return client.delete(`/instances/${instanceId}/customers/${customer_id}`);
|
|
85
92
|
},
|
|
86
|
-
getLimits(
|
|
87
|
-
return client.get(`/instances/${instanceId}/limits/
|
|
93
|
+
getLimits(customer_id) {
|
|
94
|
+
return client.get(`/instances/${instanceId}/limits/customers/${customer_id}`);
|
|
88
95
|
},
|
|
89
|
-
getLimitIncreaseRequests(
|
|
90
|
-
return client.get(`/instances/${instanceId}/
|
|
96
|
+
getLimitIncreaseRequests(customer_id) {
|
|
97
|
+
return client.get(`/instances/${instanceId}/customers/${customer_id}/limit-increase`);
|
|
91
98
|
},
|
|
92
99
|
requestLimitIncrease(_c) {
|
|
93
100
|
var _d = _c, {
|
|
94
|
-
|
|
101
|
+
customer_id
|
|
95
102
|
} = _d, data = __objRest(_d, [
|
|
96
|
-
"
|
|
103
|
+
"customer_id"
|
|
97
104
|
]);
|
|
98
105
|
return client.post(
|
|
99
|
-
`/instances/${instanceId}/
|
|
106
|
+
`/instances/${instanceId}/customers/${customer_id}/limit-increase`,
|
|
100
107
|
data
|
|
101
108
|
);
|
|
102
109
|
}
|
|
@@ -104,5 +111,5 @@ function createReceiversResource(instanceId, client) {
|
|
|
104
111
|
}
|
|
105
112
|
// Annotate the CommonJS export names for ESM import in node:
|
|
106
113
|
0 && (module.exports = {
|
|
107
|
-
|
|
114
|
+
createCustomersResource
|
|
108
115
|
});
|