@elapse/sdk 0.1.0 → 0.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.
- package/README.md +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -73,6 +73,6 @@ Everything thrown extends `ElapseError`: `ElapseAuthenticationError` (401/403),
|
|
|
73
73
|
|
|
74
74
|
## Keep the secret key server-side
|
|
75
75
|
|
|
76
|
-
`sk_…` keys authorise everything on your account. Read them from the server environment only. The SDK refuses to construct in a browser. Webhooks documentation: <https://docs.elapse.
|
|
76
|
+
`sk_…` keys authorise everything on your account. Read them from the server environment only. The SDK refuses to construct in a browser. Webhooks documentation: <https://docs.elapse.finance/webhooks>.
|
|
77
77
|
|
|
78
78
|
Node 20+. Zero runtime dependencies. MIT.
|
package/dist/index.cjs
CHANGED
|
@@ -68,7 +68,7 @@ var ElapseSignatureVerificationError = class extends ElapseError {
|
|
|
68
68
|
|
|
69
69
|
// src/http.ts
|
|
70
70
|
var import_node_crypto = require("crypto");
|
|
71
|
-
var VERSION = "0.1.
|
|
71
|
+
var VERSION = "0.1.1";
|
|
72
72
|
var Transport = class {
|
|
73
73
|
/** A real private field: `util.inspect` and `console.log` never show it (BR-SDK-002). */
|
|
74
74
|
#cfg;
|
|
@@ -335,7 +335,7 @@ var Elapse = class {
|
|
|
335
335
|
if (!config || typeof config.secretKey !== "string" || config.secretKey.length === 0) {
|
|
336
336
|
throw new ElapseInvalidRequestError("Missing secretKey. Pass { secretKey: 'sk_test_\u2026' } from your server environment.");
|
|
337
337
|
}
|
|
338
|
-
this.baseUrl = (config.baseUrl ?? "https://api.elapse.
|
|
338
|
+
this.baseUrl = (config.baseUrl ?? "https://api.elapse.finance").replace(/\/+$/, "");
|
|
339
339
|
this.maxRetries = config.maxRetries ?? 2;
|
|
340
340
|
this.timeoutMs = config.timeoutMs ?? 3e4;
|
|
341
341
|
this.#transport = new Transport({ secretKey: config.secretKey, baseUrl: this.baseUrl, maxRetries: this.maxRetries, timeoutMs: this.timeoutMs });
|
package/dist/index.d.cts
CHANGED
|
@@ -326,7 +326,7 @@ declare class ElapseSignatureVerificationError extends ElapseError {
|
|
|
326
326
|
interface ElapseConfig {
|
|
327
327
|
/** `sk_test_…` or `sk_live_…`, usually `process.env.ELAPSE_SECRET_KEY`. Server-side only. `undefined` throws at construction. */
|
|
328
328
|
secretKey: string | undefined;
|
|
329
|
-
/** Defaults to `https://api.elapse.
|
|
329
|
+
/** Defaults to `https://api.elapse.finance`. */
|
|
330
330
|
baseUrl?: string;
|
|
331
331
|
/** Transient-failure retries (network, 429, 5xx). Default 2. */
|
|
332
332
|
maxRetries?: number;
|
package/dist/index.d.ts
CHANGED
|
@@ -326,7 +326,7 @@ declare class ElapseSignatureVerificationError extends ElapseError {
|
|
|
326
326
|
interface ElapseConfig {
|
|
327
327
|
/** `sk_test_…` or `sk_live_…`, usually `process.env.ELAPSE_SECRET_KEY`. Server-side only. `undefined` throws at construction. */
|
|
328
328
|
secretKey: string | undefined;
|
|
329
|
-
/** Defaults to `https://api.elapse.
|
|
329
|
+
/** Defaults to `https://api.elapse.finance`. */
|
|
330
330
|
baseUrl?: string;
|
|
331
331
|
/** Transient-failure retries (network, 429, 5xx). Default 2. */
|
|
332
332
|
maxRetries?: number;
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,7 @@ var ElapseSignatureVerificationError = class extends ElapseError {
|
|
|
35
35
|
|
|
36
36
|
// src/http.ts
|
|
37
37
|
import { randomUUID } from "crypto";
|
|
38
|
-
var VERSION = "0.1.
|
|
38
|
+
var VERSION = "0.1.1";
|
|
39
39
|
var Transport = class {
|
|
40
40
|
/** A real private field: `util.inspect` and `console.log` never show it (BR-SDK-002). */
|
|
41
41
|
#cfg;
|
|
@@ -302,7 +302,7 @@ var Elapse = class {
|
|
|
302
302
|
if (!config || typeof config.secretKey !== "string" || config.secretKey.length === 0) {
|
|
303
303
|
throw new ElapseInvalidRequestError("Missing secretKey. Pass { secretKey: 'sk_test_\u2026' } from your server environment.");
|
|
304
304
|
}
|
|
305
|
-
this.baseUrl = (config.baseUrl ?? "https://api.elapse.
|
|
305
|
+
this.baseUrl = (config.baseUrl ?? "https://api.elapse.finance").replace(/\/+$/, "");
|
|
306
306
|
this.maxRetries = config.maxRetries ?? 2;
|
|
307
307
|
this.timeoutMs = config.timeoutMs ?? 3e4;
|
|
308
308
|
this.#transport = new Transport({ secretKey: config.secretKey, baseUrl: this.baseUrl, maxRetries: this.maxRetries, timeoutMs: this.timeoutMs });
|