@vexpay/node 0.14.0 → 0.15.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/README.md +4 -4
- package/dist/index.cjs +39 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +573 -34
- package/dist/index.d.ts +573 -34
- package/dist/index.js +39 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -62,7 +62,7 @@ function errorFromResponse(status, body, requestId) {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// src/version.ts
|
|
65
|
-
var VERSION = "0.
|
|
65
|
+
var VERSION = "0.15.0";
|
|
66
66
|
|
|
67
67
|
// src/core.ts
|
|
68
68
|
var INITIAL_RETRY_DELAY_MS = 500;
|
|
@@ -321,6 +321,11 @@ var ROUTES = {
|
|
|
321
321
|
TenantPayoutAccount_startVerify: { method: "POST", path: "/v1/tenant/payout-account/verify/start" },
|
|
322
322
|
TenantPayoutAccount_upsert: { method: "PUT", path: "/v1/tenant/payout-account" },
|
|
323
323
|
TenantPayoutAccount_upsertPost: { method: "POST", path: "/v1/tenant/payout-account" },
|
|
324
|
+
TestClocks_advance: { method: "POST", path: "/v1/test-clocks/{id}/advance" },
|
|
325
|
+
TestClocks_create: { method: "POST", path: "/v1/test-clocks" },
|
|
326
|
+
TestClocks_list: { method: "GET", path: "/v1/test-clocks" },
|
|
327
|
+
TestClocks_remove: { method: "DELETE", path: "/v1/test-clocks/{id}" },
|
|
328
|
+
TestClocks_retrieve: { method: "GET", path: "/v1/test-clocks/{id}" },
|
|
324
329
|
Topups_create: { method: "POST", path: "/v1/balance/topups" },
|
|
325
330
|
Topups_get: { method: "GET", path: "/v1/balance/topups/{id}" },
|
|
326
331
|
Topups_instant: { method: "POST", path: "/v1/balance/topups/{id}/instant" },
|
|
@@ -588,6 +593,33 @@ var PaymentMethods = class extends APIResource {
|
|
|
588
593
|
return this.call("PaymentMethods_detach", { path: { id } }, options);
|
|
589
594
|
}
|
|
590
595
|
};
|
|
596
|
+
var TestClocks = class extends APIResource {
|
|
597
|
+
/** `frozenTime` is an ISO 8601 time. */
|
|
598
|
+
create(params, options) {
|
|
599
|
+
return this.call("TestClocks_create", { body: params }, options);
|
|
600
|
+
}
|
|
601
|
+
/** Await for one page, or `for await` over every clock (newest first). */
|
|
602
|
+
list(params = {}, options) {
|
|
603
|
+
return new PagePromise(
|
|
604
|
+
(cursor) => this.call("TestClocks_list", { query: { ...params, cursor } }, options),
|
|
605
|
+
params.cursor
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
retrieve(id, options) {
|
|
609
|
+
return this.call("TestClocks_retrieve", { path: { id } }, options);
|
|
610
|
+
}
|
|
611
|
+
/** Deletes the clock with its customers, subscriptions, invoices and payment methods. */
|
|
612
|
+
delete(id, options) {
|
|
613
|
+
return this.call("TestClocks_remove", { path: { id } }, options);
|
|
614
|
+
}
|
|
615
|
+
/**
|
|
616
|
+
* Move the clock forward (at most two intervals of its shortest subscription). It returns at
|
|
617
|
+
* once with `status: "advancing"`; poll `retrieve` or wait for `test_clock.ready`.
|
|
618
|
+
*/
|
|
619
|
+
advance(id, params, options) {
|
|
620
|
+
return this.call("TestClocks_advance", { path: { id }, body: params }, options);
|
|
621
|
+
}
|
|
622
|
+
};
|
|
591
623
|
|
|
592
624
|
// src/resources/commerce.ts
|
|
593
625
|
var CheckoutSessions = class extends APIResource {
|
|
@@ -1018,6 +1050,8 @@ var WEBHOOK_EVENT_NAMES = [
|
|
|
1018
1050
|
"payment_method.attached",
|
|
1019
1051
|
"payment_method.updated",
|
|
1020
1052
|
"payment_method.detached",
|
|
1053
|
+
"test_clock.advancing",
|
|
1054
|
+
"test_clock.ready",
|
|
1021
1055
|
"notification.test"
|
|
1022
1056
|
];
|
|
1023
1057
|
var SIGNATURE_HEADER = "VexPay-Signature";
|
|
@@ -1098,7 +1132,7 @@ var Webhooks = class {
|
|
|
1098
1132
|
};
|
|
1099
1133
|
|
|
1100
1134
|
// src/client.ts
|
|
1101
|
-
var DEFAULT_BASE_URL = "https://api.
|
|
1135
|
+
var DEFAULT_BASE_URL = "https://api.vexpay.app";
|
|
1102
1136
|
var VexPay = class {
|
|
1103
1137
|
/** @internal */
|
|
1104
1138
|
http;
|
|
@@ -1130,6 +1164,8 @@ var VexPay = class {
|
|
|
1130
1164
|
setupSessions;
|
|
1131
1165
|
/** Billing: domiciliación payment methods (bolívar methods your account takes: `payments.methods()`). */
|
|
1132
1166
|
paymentMethods;
|
|
1167
|
+
/** Billing, test mode only: simulated time for trials, renewals and dunning. */
|
|
1168
|
+
testClocks;
|
|
1133
1169
|
/** Offline helpers: `constructEvent` verifies deliveries; no API calls. */
|
|
1134
1170
|
webhooks = new Webhooks();
|
|
1135
1171
|
constructor(apiKey, options = {}) {
|
|
@@ -1170,6 +1206,7 @@ var VexPay = class {
|
|
|
1170
1206
|
this.invoices = new Invoices(this.http);
|
|
1171
1207
|
this.setupSessions = new SetupSessions(this.http);
|
|
1172
1208
|
this.paymentMethods = new PaymentMethods(this.http);
|
|
1209
|
+
this.testClocks = new TestClocks(this.http);
|
|
1173
1210
|
}
|
|
1174
1211
|
};
|
|
1175
1212
|
export {
|