@blindpay/node 1.0.0 → 1.1.1

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.
Files changed (105) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +24 -37
  3. package/dist/{chunk-HKFAJXJG.mjs → chunk-3QQCDR3E.mjs} +12 -32
  4. package/dist/{chunk-LUDGZPXY.mjs → chunk-5XJJKYXE.mjs} +9 -16
  5. package/dist/chunk-64EFLUS3.mjs +106 -0
  6. package/dist/chunk-B5T7AQLH.mjs +38 -0
  7. package/dist/{chunk-VKN2AMCW.mjs → chunk-BONN6PYB.mjs} +12 -30
  8. package/dist/{chunk-M6IYYMRW.mjs → chunk-E7M4CJKR.mjs} +4 -12
  9. package/dist/chunk-IZYPRCCV.mjs +82 -0
  10. package/dist/{chunk-QVOSGLUO.mjs → chunk-LRHWT4JU.mjs} +6 -10
  11. package/dist/chunk-QGNLMN6Z.mjs +49 -0
  12. package/dist/{chunk-3CZJEDS5.mjs → chunk-RC5NN5UF.mjs} +5 -14
  13. package/dist/{chunk-GNDAATIJ.mjs → chunk-TBTA7A2P.mjs} +4 -12
  14. package/dist/{chunk-CNNEROQ7.mjs → chunk-UC57SCKQ.mjs} +6 -17
  15. package/dist/{chunk-UCAW3RTZ.mjs → chunk-W7NJUABI.mjs} +12 -20
  16. package/dist/{chunk-ES7RXEM7.mjs → chunk-YPXYUS2X.mjs} +46 -37
  17. package/dist/index.d.mts +14 -10
  18. package/dist/index.d.ts +14 -10
  19. package/dist/index.js +237 -435
  20. package/dist/index.mjs +19 -19
  21. package/dist/resources/api-keys/api-keys.test.js +238 -445
  22. package/dist/resources/api-keys/api-keys.test.mjs +19 -28
  23. package/dist/resources/api-keys/index.d.mts +20 -20
  24. package/dist/resources/api-keys/index.d.ts +20 -20
  25. package/dist/resources/api-keys/index.js +6 -10
  26. package/dist/resources/api-keys/index.mjs +1 -1
  27. package/dist/resources/available/available.test.js +235 -433
  28. package/dist/resources/available/available.test.mjs +16 -16
  29. package/dist/resources/bank-accounts/bank-accounts.test.js +245 -455
  30. package/dist/resources/bank-accounts/bank-accounts.test.mjs +26 -38
  31. package/dist/resources/bank-accounts/index.d.mts +22 -145
  32. package/dist/resources/bank-accounts/index.d.ts +22 -145
  33. package/dist/resources/bank-accounts/index.js +102 -184
  34. package/dist/resources/bank-accounts/index.mjs +1 -1
  35. package/dist/resources/instances/index.d.mts +9 -20
  36. package/dist/resources/instances/index.d.ts +9 -20
  37. package/dist/resources/instances/index.js +11 -20
  38. package/dist/resources/instances/index.mjs +1 -1
  39. package/dist/resources/instances/instances.test.js +239 -446
  40. package/dist/resources/instances/instances.test.mjs +20 -29
  41. package/dist/resources/partner-fees/index.d.mts +8 -18
  42. package/dist/resources/partner-fees/index.d.ts +8 -18
  43. package/dist/resources/partner-fees/index.js +5 -14
  44. package/dist/resources/partner-fees/index.mjs +1 -1
  45. package/dist/resources/partner-fees/partner-fees.test.js +238 -445
  46. package/dist/resources/partner-fees/partner-fees.test.mjs +19 -28
  47. package/dist/resources/payins/index.d.mts +15 -30
  48. package/dist/resources/payins/index.d.ts +15 -30
  49. package/dist/resources/payins/index.js +12 -20
  50. package/dist/resources/payins/index.mjs +1 -1
  51. package/dist/resources/payins/payins-quotes.test.js +235 -435
  52. package/dist/resources/payins/payins-quotes.test.mjs +16 -18
  53. package/dist/resources/payins/payins.test.js +240 -449
  54. package/dist/resources/payins/payins.test.mjs +21 -32
  55. package/dist/resources/payins/quotes.d.mts +3 -5
  56. package/dist/resources/payins/quotes.d.ts +3 -5
  57. package/dist/resources/payins/quotes.js +4 -12
  58. package/dist/resources/payins/quotes.mjs +1 -1
  59. package/dist/resources/payouts/index.d.mts +13 -28
  60. package/dist/resources/payouts/index.d.ts +13 -28
  61. package/dist/resources/payouts/index.js +12 -32
  62. package/dist/resources/payouts/index.mjs +1 -1
  63. package/dist/resources/payouts/payouts.test.js +239 -449
  64. package/dist/resources/payouts/payouts.test.mjs +20 -32
  65. package/dist/resources/quotes/index.d.mts +3 -5
  66. package/dist/resources/quotes/index.d.ts +3 -5
  67. package/dist/resources/quotes/index.js +4 -12
  68. package/dist/resources/quotes/index.mjs +1 -1
  69. package/dist/resources/quotes/quotes.test.js +235 -435
  70. package/dist/resources/quotes/quotes.test.mjs +16 -18
  71. package/dist/resources/receivers/index.d.mts +13 -27
  72. package/dist/resources/receivers/index.d.ts +13 -27
  73. package/dist/resources/receivers/index.js +12 -30
  74. package/dist/resources/receivers/index.mjs +1 -1
  75. package/dist/resources/receivers/receivers.test.js +241 -452
  76. package/dist/resources/receivers/receivers.test.mjs +22 -35
  77. package/dist/resources/virtual-accounts/index.d.mts +7 -12
  78. package/dist/resources/virtual-accounts/index.d.ts +7 -12
  79. package/dist/resources/virtual-accounts/index.js +9 -16
  80. package/dist/resources/virtual-accounts/index.mjs +1 -1
  81. package/dist/resources/virtual-accounts/virtual-accounts.test.js +238 -441
  82. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +19 -24
  83. package/dist/resources/wallets/blockchain.d.mts +23 -31
  84. package/dist/resources/wallets/blockchain.d.ts +23 -31
  85. package/dist/resources/wallets/blockchain.js +51 -33
  86. package/dist/resources/wallets/blockchain.mjs +1 -1
  87. package/dist/resources/wallets/blockchain.test.js +268 -451
  88. package/dist/resources/wallets/blockchain.test.mjs +49 -34
  89. package/dist/resources/wallets/offramp.d.mts +10 -13
  90. package/dist/resources/wallets/offramp.d.ts +10 -13
  91. package/dist/resources/wallets/offramp.js +14 -14
  92. package/dist/resources/wallets/offramp.mjs +1 -1
  93. package/dist/resources/wallets/offramp.test.js +241 -442
  94. package/dist/resources/wallets/offramp.test.mjs +22 -25
  95. package/dist/resources/webhooks/index.d.mts +9 -22
  96. package/dist/resources/webhooks/index.d.ts +9 -22
  97. package/dist/resources/webhooks/index.js +6 -17
  98. package/dist/resources/webhooks/index.mjs +1 -1
  99. package/dist/resources/webhooks/webhooks.test.js +239 -448
  100. package/dist/resources/webhooks/webhooks.test.mjs +20 -31
  101. package/package.json +2 -4
  102. package/dist/chunk-2DAKB5XK.mjs +0 -212
  103. package/dist/chunk-GEDDLCJY.mjs +0 -77
  104. package/dist/chunk-LK3JPQ6I.mjs +0 -49
  105. package/dist/chunk-LLWEHHKB.mjs +0 -47
@@ -5,23 +5,23 @@ import {
5
5
  it
6
6
  } from "../../chunk-GCCHFONX.mjs";
7
7
  import {
8
- Blindpay,
8
+ BlindPay,
9
9
  init_client
10
- } from "../../chunk-ES7RXEM7.mjs";
11
- import "../../chunk-GEDDLCJY.mjs";
12
- import "../../chunk-LK3JPQ6I.mjs";
13
- import "../../chunk-CNNEROQ7.mjs";
14
- import "../../chunk-GNDAATIJ.mjs";
15
- import "../../chunk-VKN2AMCW.mjs";
16
- import "../../chunk-LUDGZPXY.mjs";
17
- import "../../chunk-3CZJEDS5.mjs";
18
- import "../../chunk-UCAW3RTZ.mjs";
19
- import "../../chunk-M6IYYMRW.mjs";
20
- import "../../chunk-HKFAJXJG.mjs";
21
- import "../../chunk-QVOSGLUO.mjs";
22
- import "../../chunk-2DAKB5XK.mjs";
10
+ } from "../../chunk-YPXYUS2X.mjs";
11
+ import "../../chunk-IZYPRCCV.mjs";
12
+ import "../../chunk-QGNLMN6Z.mjs";
13
+ import "../../chunk-UC57SCKQ.mjs";
14
+ import "../../chunk-TBTA7A2P.mjs";
15
+ import "../../chunk-BONN6PYB.mjs";
16
+ import "../../chunk-5XJJKYXE.mjs";
17
+ import "../../chunk-RC5NN5UF.mjs";
18
+ import "../../chunk-W7NJUABI.mjs";
19
+ import "../../chunk-E7M4CJKR.mjs";
20
+ import "../../chunk-3QQCDR3E.mjs";
21
+ import "../../chunk-LRHWT4JU.mjs";
23
22
  import "../../chunk-QHMIK7U3.mjs";
24
- import "../../chunk-LLWEHHKB.mjs";
23
+ import "../../chunk-64EFLUS3.mjs";
24
+ import "../../chunk-B5T7AQLH.mjs";
25
25
  import {
26
26
  __async,
27
27
  __commonJS
@@ -34,7 +34,7 @@ var require_api_keys_test = __commonJS({
34
34
  init_client();
35
35
  describe("Api keys", () => {
36
36
  afterEach(() => fetchMock.resetMocks());
37
- const blindpay = new Blindpay("test-key");
37
+ const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
38
38
  describe("Create api key", () => {
39
39
  it("should create an api key", () => __async(null, null, function* () {
40
40
  const mockedApiKey = {
@@ -45,7 +45,6 @@ var require_api_keys_test = __commonJS({
45
45
  headers: { "Content-Type": "application/json" }
46
46
  });
47
47
  const { data, error } = yield blindpay.instances.apiKeys.create({
48
- instanceId: "in_000000000000",
49
48
  name: "test",
50
49
  permission: "full_access"
51
50
  });
@@ -70,10 +69,7 @@ var require_api_keys_test = __commonJS({
70
69
  fetchMock.mockResponseOnce(JSON.stringify(mockedApiKey), {
71
70
  headers: { "Content-Type": "application/json" }
72
71
  });
73
- const { data, error } = yield blindpay.instances.apiKeys.get({
74
- instanceId: "in_000000000000",
75
- id: "ap_000000000000"
76
- });
72
+ const { data, error } = yield blindpay.instances.apiKeys.get("ap_000000000000");
77
73
  globalExpect(error).toBeNull();
78
74
  globalExpect(data).toEqual(mockedApiKey);
79
75
  }));
@@ -97,9 +93,7 @@ var require_api_keys_test = __commonJS({
97
93
  fetchMock.mockResponseOnce(JSON.stringify(mockedApiKeys), {
98
94
  headers: { "Content-Type": "application/json" }
99
95
  });
100
- const { data, error } = yield blindpay.instances.apiKeys.list({
101
- instanceId: "in_000000000000"
102
- });
96
+ const { data, error } = yield blindpay.instances.apiKeys.list();
103
97
  globalExpect(error).toBeNull();
104
98
  globalExpect(data).toEqual(mockedApiKeys);
105
99
  }));
@@ -114,10 +108,7 @@ var require_api_keys_test = __commonJS({
114
108
  headers: { "Content-Type": "application/json" }
115
109
  }
116
110
  );
117
- const { data, error } = yield blindpay.instances.apiKeys.delete({
118
- instanceId: "in_000000000000",
119
- id: "ap_000000000000"
120
- });
111
+ const { data, error } = yield blindpay.instances.apiKeys.delete("ap_000000000000");
121
112
  globalExpect(error).toBeNull();
122
113
  globalExpect(data).toEqual({
123
114
  data: null
@@ -1,6 +1,6 @@
1
1
  import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.mjs';
2
2
 
3
- type ApiKey = {
3
+ type ListApiKeysResponse = Array<{
4
4
  id: string;
5
5
  name: string;
6
6
  permission: "full_access";
@@ -11,13 +11,8 @@ type ApiKey = {
11
11
  instance_id: string;
12
12
  created_at: string;
13
13
  updated_at: string;
14
- };
15
- type ListApiKeysInput = {
16
- instanceId: string;
17
- };
18
- type ListApiKeysResponse = ApiKey[];
14
+ }>;
19
15
  type CreateApiKeyInput = {
20
- instanceId: string;
21
16
  name: string;
22
17
  permission: "full_access";
23
18
  ip_whitelist?: string[];
@@ -26,20 +21,25 @@ type CreateApiKeyResponse = {
26
21
  id: string;
27
22
  token: string;
28
23
  };
29
- type GetApiKeyInput = {
30
- instanceId: string;
31
- id: string;
32
- };
33
- type GetApiKeyResponse = ApiKey;
34
- type DeleteApiKeyInput = {
35
- instanceId: string;
24
+ type GetApiKeyInput = string;
25
+ type GetApiKeyResponse = {
36
26
  id: string;
27
+ name: string;
28
+ permission: "full_access";
29
+ token: string;
30
+ ip_whitelist?: string[];
31
+ unkey_id: string;
32
+ last_used_at: string | null;
33
+ instance_id: string;
34
+ created_at: string;
35
+ updated_at: string;
37
36
  };
38
- declare function createApiKeysResource(client: InternalApiClient): {
39
- list({ instanceId }: ListApiKeysInput): Promise<BlindpayApiResponse<ListApiKeysResponse>>;
40
- create({ instanceId, ...data }: CreateApiKeyInput): Promise<BlindpayApiResponse<CreateApiKeyResponse>>;
41
- get({ instanceId, id }: GetApiKeyInput): Promise<BlindpayApiResponse<GetApiKeyResponse>>;
42
- delete({ instanceId, id }: DeleteApiKeyInput): Promise<BlindpayApiResponse<void>>;
37
+ type DeleteApiKeyInput = string;
38
+ declare function createApiKeysResource(instanceId: string, client: InternalApiClient): {
39
+ list(): Promise<BlindpayApiResponse<ListApiKeysResponse>>;
40
+ create({ ...data }: CreateApiKeyInput): Promise<BlindpayApiResponse<CreateApiKeyResponse>>;
41
+ get(id: GetApiKeyInput): Promise<BlindpayApiResponse<GetApiKeyResponse>>;
42
+ delete(id: DeleteApiKeyInput): Promise<BlindpayApiResponse<void>>;
43
43
  };
44
44
 
45
- export { type CreateApiKeyInput, type CreateApiKeyResponse, type DeleteApiKeyInput, type GetApiKeyInput, type GetApiKeyResponse, type ListApiKeysInput, type ListApiKeysResponse, createApiKeysResource };
45
+ export { type CreateApiKeyInput, type CreateApiKeyResponse, type DeleteApiKeyInput, type GetApiKeyInput, type GetApiKeyResponse, type ListApiKeysResponse, createApiKeysResource };
@@ -1,6 +1,6 @@
1
1
  import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.js';
2
2
 
3
- type ApiKey = {
3
+ type ListApiKeysResponse = Array<{
4
4
  id: string;
5
5
  name: string;
6
6
  permission: "full_access";
@@ -11,13 +11,8 @@ type ApiKey = {
11
11
  instance_id: string;
12
12
  created_at: string;
13
13
  updated_at: string;
14
- };
15
- type ListApiKeysInput = {
16
- instanceId: string;
17
- };
18
- type ListApiKeysResponse = ApiKey[];
14
+ }>;
19
15
  type CreateApiKeyInput = {
20
- instanceId: string;
21
16
  name: string;
22
17
  permission: "full_access";
23
18
  ip_whitelist?: string[];
@@ -26,20 +21,25 @@ type CreateApiKeyResponse = {
26
21
  id: string;
27
22
  token: string;
28
23
  };
29
- type GetApiKeyInput = {
30
- instanceId: string;
31
- id: string;
32
- };
33
- type GetApiKeyResponse = ApiKey;
34
- type DeleteApiKeyInput = {
35
- instanceId: string;
24
+ type GetApiKeyInput = string;
25
+ type GetApiKeyResponse = {
36
26
  id: string;
27
+ name: string;
28
+ permission: "full_access";
29
+ token: string;
30
+ ip_whitelist?: string[];
31
+ unkey_id: string;
32
+ last_used_at: string | null;
33
+ instance_id: string;
34
+ created_at: string;
35
+ updated_at: string;
37
36
  };
38
- declare function createApiKeysResource(client: InternalApiClient): {
39
- list({ instanceId }: ListApiKeysInput): Promise<BlindpayApiResponse<ListApiKeysResponse>>;
40
- create({ instanceId, ...data }: CreateApiKeyInput): Promise<BlindpayApiResponse<CreateApiKeyResponse>>;
41
- get({ instanceId, id }: GetApiKeyInput): Promise<BlindpayApiResponse<GetApiKeyResponse>>;
42
- delete({ instanceId, id }: DeleteApiKeyInput): Promise<BlindpayApiResponse<void>>;
37
+ type DeleteApiKeyInput = string;
38
+ declare function createApiKeysResource(instanceId: string, client: InternalApiClient): {
39
+ list(): Promise<BlindpayApiResponse<ListApiKeysResponse>>;
40
+ create({ ...data }: CreateApiKeyInput): Promise<BlindpayApiResponse<CreateApiKeyResponse>>;
41
+ get(id: GetApiKeyInput): Promise<BlindpayApiResponse<GetApiKeyResponse>>;
42
+ delete(id: DeleteApiKeyInput): Promise<BlindpayApiResponse<void>>;
43
43
  };
44
44
 
45
- export { type CreateApiKeyInput, type CreateApiKeyResponse, type DeleteApiKeyInput, type GetApiKeyInput, type GetApiKeyResponse, type ListApiKeysInput, type ListApiKeysResponse, createApiKeysResource };
45
+ export { type CreateApiKeyInput, type CreateApiKeyResponse, type DeleteApiKeyInput, type GetApiKeyInput, type GetApiKeyResponse, type ListApiKeysResponse, createApiKeysResource };
@@ -37,23 +37,19 @@ __export(api_keys_exports, {
37
37
  createApiKeysResource: () => createApiKeysResource
38
38
  });
39
39
  module.exports = __toCommonJS(api_keys_exports);
40
- function createApiKeysResource(client) {
40
+ function createApiKeysResource(instanceId, client) {
41
41
  return {
42
- list({ instanceId }) {
42
+ list() {
43
43
  return client.get(`/instances/${instanceId}/api-keys`);
44
44
  },
45
45
  create(_a) {
46
- var _b = _a, {
47
- instanceId
48
- } = _b, data = __objRest(_b, [
49
- "instanceId"
50
- ]);
46
+ var data = __objRest(_a, []);
51
47
  return client.post(`/instances/${instanceId}/api-keys`, data);
52
48
  },
53
- get({ instanceId, id }) {
54
- return client.get(`/instances/${instanceId}/api_keys/${id}`);
49
+ get(id) {
50
+ return client.get(`/instances/${instanceId}/api-keys/${id}`);
55
51
  },
56
- delete({ instanceId, id }) {
52
+ delete(id) {
57
53
  return client.delete(`/instances/${instanceId}/api-keys/${id}`);
58
54
  }
59
55
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  createApiKeysResource,
3
3
  init_api_keys
4
- } from "../../chunk-QVOSGLUO.mjs";
4
+ } from "../../chunk-LRHWT4JU.mjs";
5
5
  import "../../chunk-OBKEW4AQ.mjs";
6
6
  init_api_keys();
7
7
  export {