@blindpay/node 1.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.
Files changed (139) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +124 -0
  3. package/dist/api-client-Cw2mNJeR.d.mts +349 -0
  4. package/dist/api-client-Cw2mNJeR.d.ts +349 -0
  5. package/dist/chunk-2DAKB5XK.mjs +212 -0
  6. package/dist/chunk-3CZJEDS5.mjs +41 -0
  7. package/dist/chunk-CNNEROQ7.mjs +46 -0
  8. package/dist/chunk-ES7RXEM7.mjs +245 -0
  9. package/dist/chunk-GCCHFONX.mjs +17893 -0
  10. package/dist/chunk-GEDDLCJY.mjs +77 -0
  11. package/dist/chunk-GNDAATIJ.mjs +35 -0
  12. package/dist/chunk-HKFAJXJG.mjs +65 -0
  13. package/dist/chunk-LK3JPQ6I.mjs +49 -0
  14. package/dist/chunk-LLWEHHKB.mjs +47 -0
  15. package/dist/chunk-LUDGZPXY.mjs +51 -0
  16. package/dist/chunk-M6IYYMRW.mjs +35 -0
  17. package/dist/chunk-OBKEW4AQ.mjs +91 -0
  18. package/dist/chunk-QHMIK7U3.mjs +24 -0
  19. package/dist/chunk-QVOSGLUO.mjs +36 -0
  20. package/dist/chunk-UCAW3RTZ.mjs +47 -0
  21. package/dist/chunk-VKN2AMCW.mjs +57 -0
  22. package/dist/index.d.mts +81 -0
  23. package/dist/index.d.ts +81 -0
  24. package/dist/index.js +895 -0
  25. package/dist/index.mjs +95 -0
  26. package/dist/magic-string.es-6D2DRE4K.mjs +1325 -0
  27. package/dist/resources/api-keys/api-keys.test.d.mts +2 -0
  28. package/dist/resources/api-keys/api-keys.test.d.ts +2 -0
  29. package/dist/resources/api-keys/api-keys.test.js +19881 -0
  30. package/dist/resources/api-keys/api-keys.test.mjs +130 -0
  31. package/dist/resources/api-keys/index.d.mts +45 -0
  32. package/dist/resources/api-keys/index.d.ts +45 -0
  33. package/dist/resources/api-keys/index.js +64 -0
  34. package/dist/resources/api-keys/index.mjs +9 -0
  35. package/dist/resources/available/available.test.d.mts +2 -0
  36. package/dist/resources/available/available.test.d.ts +2 -0
  37. package/dist/resources/available/available.test.js +19877 -0
  38. package/dist/resources/available/available.test.mjs +122 -0
  39. package/dist/resources/available/index.d.mts +25 -0
  40. package/dist/resources/available/index.d.ts +25 -0
  41. package/dist/resources/available/index.js +39 -0
  42. package/dist/resources/available/index.mjs +9 -0
  43. package/dist/resources/bank-accounts/bank-accounts.test.d.mts +2 -0
  44. package/dist/resources/bank-accounts/bank-accounts.test.d.ts +2 -0
  45. package/dist/resources/bank-accounts/bank-accounts.test.js +20173 -0
  46. package/dist/resources/bank-accounts/bank-accounts.test.mjs +418 -0
  47. package/dist/resources/bank-accounts/index.d.mts +414 -0
  48. package/dist/resources/bank-accounts/index.d.ts +414 -0
  49. package/dist/resources/bank-accounts/index.js +227 -0
  50. package/dist/resources/bank-accounts/index.mjs +9 -0
  51. package/dist/resources/instances/index.d.mts +42 -0
  52. package/dist/resources/instances/index.d.ts +42 -0
  53. package/dist/resources/instances/index.js +75 -0
  54. package/dist/resources/instances/index.mjs +9 -0
  55. package/dist/resources/instances/instances.test.d.mts +2 -0
  56. package/dist/resources/instances/instances.test.d.ts +2 -0
  57. package/dist/resources/instances/instances.test.js +19873 -0
  58. package/dist/resources/instances/instances.test.mjs +118 -0
  59. package/dist/resources/partner-fees/index.d.mts +65 -0
  60. package/dist/resources/partner-fees/index.d.ts +65 -0
  61. package/dist/resources/partner-fees/index.js +69 -0
  62. package/dist/resources/partner-fees/index.mjs +9 -0
  63. package/dist/resources/partner-fees/partner-fees.test.d.mts +2 -0
  64. package/dist/resources/partner-fees/partner-fees.test.d.ts +2 -0
  65. package/dist/resources/partner-fees/partner-fees.test.js +19889 -0
  66. package/dist/resources/partner-fees/partner-fees.test.mjs +134 -0
  67. package/dist/resources/payins/index.d.mts +200 -0
  68. package/dist/resources/payins/index.d.ts +200 -0
  69. package/dist/resources/payins/index.js +75 -0
  70. package/dist/resources/payins/index.mjs +9 -0
  71. package/dist/resources/payins/payins-quotes.test.d.mts +2 -0
  72. package/dist/resources/payins/payins-quotes.test.d.ts +2 -0
  73. package/dist/resources/payins/payins-quotes.test.js +19852 -0
  74. package/dist/resources/payins/payins-quotes.test.mjs +97 -0
  75. package/dist/resources/payins/payins.test.d.mts +2 -0
  76. package/dist/resources/payins/payins.test.d.ts +2 -0
  77. package/dist/resources/payins/payins.test.js +20268 -0
  78. package/dist/resources/payins/payins.test.mjs +513 -0
  79. package/dist/resources/payins/quotes.d.mts +45 -0
  80. package/dist/resources/payins/quotes.d.ts +45 -0
  81. package/dist/resources/payins/quotes.js +63 -0
  82. package/dist/resources/payins/quotes.mjs +9 -0
  83. package/dist/resources/payouts/index.d.mts +155 -0
  84. package/dist/resources/payouts/index.d.ts +155 -0
  85. package/dist/resources/payouts/index.js +93 -0
  86. package/dist/resources/payouts/index.mjs +9 -0
  87. package/dist/resources/payouts/payouts.test.d.mts +2 -0
  88. package/dist/resources/payouts/payouts.test.d.ts +2 -0
  89. package/dist/resources/payouts/payouts.test.js +20346 -0
  90. package/dist/resources/payouts/payouts.test.mjs +591 -0
  91. package/dist/resources/quotes/index.d.mts +59 -0
  92. package/dist/resources/quotes/index.d.ts +59 -0
  93. package/dist/resources/quotes/index.js +63 -0
  94. package/dist/resources/quotes/index.mjs +9 -0
  95. package/dist/resources/quotes/quotes.test.d.mts +2 -0
  96. package/dist/resources/quotes/quotes.test.d.ts +2 -0
  97. package/dist/resources/quotes/quotes.test.js +19866 -0
  98. package/dist/resources/quotes/quotes.test.mjs +111 -0
  99. package/dist/resources/receivers/index.d.mts +205 -0
  100. package/dist/resources/receivers/index.d.ts +205 -0
  101. package/dist/resources/receivers/index.js +85 -0
  102. package/dist/resources/receivers/index.mjs +9 -0
  103. package/dist/resources/receivers/receivers.test.d.mts +2 -0
  104. package/dist/resources/receivers/receivers.test.d.ts +2 -0
  105. package/dist/resources/receivers/receivers.test.js +20145 -0
  106. package/dist/resources/receivers/receivers.test.mjs +390 -0
  107. package/dist/resources/virtual-accounts/index.d.mts +58 -0
  108. package/dist/resources/virtual-accounts/index.d.ts +58 -0
  109. package/dist/resources/virtual-accounts/index.js +79 -0
  110. package/dist/resources/virtual-accounts/index.mjs +9 -0
  111. package/dist/resources/virtual-accounts/virtual-accounts.test.d.mts +2 -0
  112. package/dist/resources/virtual-accounts/virtual-accounts.test.d.ts +2 -0
  113. package/dist/resources/virtual-accounts/virtual-accounts.test.js +19902 -0
  114. package/dist/resources/virtual-accounts/virtual-accounts.test.mjs +147 -0
  115. package/dist/resources/wallets/blockchain.d.mts +83 -0
  116. package/dist/resources/wallets/blockchain.d.ts +83 -0
  117. package/dist/resources/wallets/blockchain.js +105 -0
  118. package/dist/resources/wallets/blockchain.mjs +9 -0
  119. package/dist/resources/wallets/blockchain.test.d.mts +2 -0
  120. package/dist/resources/wallets/blockchain.test.d.ts +2 -0
  121. package/dist/resources/wallets/blockchain.test.js +19897 -0
  122. package/dist/resources/wallets/blockchain.test.mjs +142 -0
  123. package/dist/resources/wallets/offramp.d.mts +46 -0
  124. package/dist/resources/wallets/offramp.d.ts +46 -0
  125. package/dist/resources/wallets/offramp.js +77 -0
  126. package/dist/resources/wallets/offramp.mjs +9 -0
  127. package/dist/resources/wallets/offramp.test.d.mts +2 -0
  128. package/dist/resources/wallets/offramp.test.d.ts +2 -0
  129. package/dist/resources/wallets/offramp.test.js +19872 -0
  130. package/dist/resources/wallets/offramp.test.mjs +117 -0
  131. package/dist/resources/webhooks/index.d.mts +49 -0
  132. package/dist/resources/webhooks/index.d.ts +49 -0
  133. package/dist/resources/webhooks/index.js +74 -0
  134. package/dist/resources/webhooks/index.mjs +9 -0
  135. package/dist/resources/webhooks/webhooks.test.d.mts +2 -0
  136. package/dist/resources/webhooks/webhooks.test.d.ts +2 -0
  137. package/dist/resources/webhooks/webhooks.test.js +19878 -0
  138. package/dist/resources/webhooks/webhooks.test.mjs +123 -0
  139. package/package.json +65 -0
@@ -0,0 +1,130 @@
1
+ import {
2
+ describe,
3
+ globalExpect,
4
+ init_dist,
5
+ it
6
+ } from "../../chunk-GCCHFONX.mjs";
7
+ import {
8
+ Blindpay,
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";
23
+ import "../../chunk-QHMIK7U3.mjs";
24
+ import "../../chunk-LLWEHHKB.mjs";
25
+ import {
26
+ __async,
27
+ __commonJS
28
+ } from "../../chunk-OBKEW4AQ.mjs";
29
+
30
+ // src/resources/api-keys/api-keys.test.ts
31
+ var require_api_keys_test = __commonJS({
32
+ "src/resources/api-keys/api-keys.test.ts"(exports) {
33
+ init_dist();
34
+ init_client();
35
+ describe("Api keys", () => {
36
+ afterEach(() => fetchMock.resetMocks());
37
+ const blindpay = new Blindpay("test-key");
38
+ describe("Create api key", () => {
39
+ it("should create an api key", () => __async(null, null, function* () {
40
+ const mockedApiKey = {
41
+ id: "ap_000000000000",
42
+ token: "token"
43
+ };
44
+ fetchMock.mockResponseOnce(JSON.stringify(mockedApiKey), {
45
+ headers: { "Content-Type": "application/json" }
46
+ });
47
+ const { data, error } = yield blindpay.instances.apiKeys.create({
48
+ instanceId: "in_000000000000",
49
+ name: "test",
50
+ permission: "full_access"
51
+ });
52
+ globalExpect(error).toBeNull();
53
+ globalExpect(data).toEqual(mockedApiKey);
54
+ }));
55
+ });
56
+ describe("Get api key", () => {
57
+ it("should get an api key", () => __async(null, null, function* () {
58
+ const mockedApiKey = {
59
+ id: "ap_000000000000",
60
+ token: "token",
61
+ name: "test",
62
+ permission: "full_access",
63
+ ip_whitelist: ["127.0.0.1"],
64
+ unkey_id: "key_123456789",
65
+ last_used_at: "2024-01-01T00:00:00.000Z",
66
+ instance_id: "in_000000000000",
67
+ created_at: "2021-01-01",
68
+ updated_at: "2021-01-01"
69
+ };
70
+ fetchMock.mockResponseOnce(JSON.stringify(mockedApiKey), {
71
+ headers: { "Content-Type": "application/json" }
72
+ });
73
+ const { data, error } = yield blindpay.instances.apiKeys.get({
74
+ instanceId: "in_000000000000",
75
+ id: "ap_000000000000"
76
+ });
77
+ globalExpect(error).toBeNull();
78
+ globalExpect(data).toEqual(mockedApiKey);
79
+ }));
80
+ });
81
+ describe("List api keys", () => {
82
+ it("should list api keys", () => __async(null, null, function* () {
83
+ const mockedApiKeys = [
84
+ {
85
+ id: "ap_000000000000",
86
+ token: "token",
87
+ name: "test",
88
+ permission: "full_access",
89
+ ip_whitelist: ["127.0.0.1"],
90
+ unkey_id: "key_123456789",
91
+ last_used_at: "2024-01-01T00:00:00.000Z",
92
+ instance_id: "in_000000000000",
93
+ created_at: "2021-01-01",
94
+ updated_at: "2021-01-01"
95
+ }
96
+ ];
97
+ fetchMock.mockResponseOnce(JSON.stringify(mockedApiKeys), {
98
+ headers: { "Content-Type": "application/json" }
99
+ });
100
+ const { data, error } = yield blindpay.instances.apiKeys.list({
101
+ instanceId: "in_000000000000"
102
+ });
103
+ globalExpect(error).toBeNull();
104
+ globalExpect(data).toEqual(mockedApiKeys);
105
+ }));
106
+ });
107
+ describe("Delete api key", () => {
108
+ it("should delete an api key", () => __async(null, null, function* () {
109
+ fetchMock.mockResponseOnce(
110
+ JSON.stringify({
111
+ data: null
112
+ }),
113
+ {
114
+ headers: { "Content-Type": "application/json" }
115
+ }
116
+ );
117
+ const { data, error } = yield blindpay.instances.apiKeys.delete({
118
+ instanceId: "in_000000000000",
119
+ id: "ap_000000000000"
120
+ });
121
+ globalExpect(error).toBeNull();
122
+ globalExpect(data).toEqual({
123
+ data: null
124
+ });
125
+ }));
126
+ });
127
+ });
128
+ }
129
+ });
130
+ export default require_api_keys_test();
@@ -0,0 +1,45 @@
1
+ import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.mjs';
2
+
3
+ type ApiKey = {
4
+ id: string;
5
+ name: string;
6
+ permission: "full_access";
7
+ token: string;
8
+ ip_whitelist?: string[];
9
+ unkey_id: string;
10
+ last_used_at: string | null;
11
+ instance_id: string;
12
+ created_at: string;
13
+ updated_at: string;
14
+ };
15
+ type ListApiKeysInput = {
16
+ instanceId: string;
17
+ };
18
+ type ListApiKeysResponse = ApiKey[];
19
+ type CreateApiKeyInput = {
20
+ instanceId: string;
21
+ name: string;
22
+ permission: "full_access";
23
+ ip_whitelist?: string[];
24
+ };
25
+ type CreateApiKeyResponse = {
26
+ id: string;
27
+ token: string;
28
+ };
29
+ type GetApiKeyInput = {
30
+ instanceId: string;
31
+ id: string;
32
+ };
33
+ type GetApiKeyResponse = ApiKey;
34
+ type DeleteApiKeyInput = {
35
+ instanceId: string;
36
+ id: string;
37
+ };
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>>;
43
+ };
44
+
45
+ export { type CreateApiKeyInput, type CreateApiKeyResponse, type DeleteApiKeyInput, type GetApiKeyInput, type GetApiKeyResponse, type ListApiKeysInput, type ListApiKeysResponse, createApiKeysResource };
@@ -0,0 +1,45 @@
1
+ import { I as InternalApiClient, B as BlindpayApiResponse } from '../../api-client-Cw2mNJeR.js';
2
+
3
+ type ApiKey = {
4
+ id: string;
5
+ name: string;
6
+ permission: "full_access";
7
+ token: string;
8
+ ip_whitelist?: string[];
9
+ unkey_id: string;
10
+ last_used_at: string | null;
11
+ instance_id: string;
12
+ created_at: string;
13
+ updated_at: string;
14
+ };
15
+ type ListApiKeysInput = {
16
+ instanceId: string;
17
+ };
18
+ type ListApiKeysResponse = ApiKey[];
19
+ type CreateApiKeyInput = {
20
+ instanceId: string;
21
+ name: string;
22
+ permission: "full_access";
23
+ ip_whitelist?: string[];
24
+ };
25
+ type CreateApiKeyResponse = {
26
+ id: string;
27
+ token: string;
28
+ };
29
+ type GetApiKeyInput = {
30
+ instanceId: string;
31
+ id: string;
32
+ };
33
+ type GetApiKeyResponse = ApiKey;
34
+ type DeleteApiKeyInput = {
35
+ instanceId: string;
36
+ id: string;
37
+ };
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>>;
43
+ };
44
+
45
+ export { type CreateApiKeyInput, type CreateApiKeyResponse, type DeleteApiKeyInput, type GetApiKeyInput, type GetApiKeyResponse, type ListApiKeysInput, type ListApiKeysResponse, createApiKeysResource };
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __objRest = (source, exclude) => {
9
+ var target = {};
10
+ for (var prop in source)
11
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
12
+ target[prop] = source[prop];
13
+ if (source != null && __getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(source)) {
15
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
16
+ target[prop] = source[prop];
17
+ }
18
+ return target;
19
+ };
20
+ var __export = (target, all) => {
21
+ for (var name in all)
22
+ __defProp(target, name, { get: all[name], enumerable: true });
23
+ };
24
+ var __copyProps = (to, from, except, desc) => {
25
+ if (from && typeof from === "object" || typeof from === "function") {
26
+ for (let key of __getOwnPropNames(from))
27
+ if (!__hasOwnProp.call(to, key) && key !== except)
28
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
29
+ }
30
+ return to;
31
+ };
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // src/resources/api-keys/index.ts
35
+ var api_keys_exports = {};
36
+ __export(api_keys_exports, {
37
+ createApiKeysResource: () => createApiKeysResource
38
+ });
39
+ module.exports = __toCommonJS(api_keys_exports);
40
+ function createApiKeysResource(client) {
41
+ return {
42
+ list({ instanceId }) {
43
+ return client.get(`/instances/${instanceId}/api-keys`);
44
+ },
45
+ create(_a) {
46
+ var _b = _a, {
47
+ instanceId
48
+ } = _b, data = __objRest(_b, [
49
+ "instanceId"
50
+ ]);
51
+ return client.post(`/instances/${instanceId}/api-keys`, data);
52
+ },
53
+ get({ instanceId, id }) {
54
+ return client.get(`/instances/${instanceId}/api_keys/${id}`);
55
+ },
56
+ delete({ instanceId, id }) {
57
+ return client.delete(`/instances/${instanceId}/api-keys/${id}`);
58
+ }
59
+ };
60
+ }
61
+ // Annotate the CommonJS export names for ESM import in node:
62
+ 0 && (module.exports = {
63
+ createApiKeysResource
64
+ });
@@ -0,0 +1,9 @@
1
+ import {
2
+ createApiKeysResource,
3
+ init_api_keys
4
+ } from "../../chunk-QVOSGLUO.mjs";
5
+ import "../../chunk-OBKEW4AQ.mjs";
6
+ init_api_keys();
7
+ export {
8
+ createApiKeysResource
9
+ };
@@ -0,0 +1,2 @@
1
+
2
+ export { }
@@ -0,0 +1,2 @@
1
+
2
+ export { }