@atlasent/sdk 2.12.0 → 2.13.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 +9 -0
- package/dist/hono.cjs +42 -0
- package/dist/hono.cjs.map +1 -1
- package/dist/hono.d.cts +2 -2
- package/dist/hono.d.ts +2 -2
- package/dist/hono.js +42 -0
- package/dist/hono.js.map +1 -1
- package/dist/index.cjs +42 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -3
- package/dist/index.d.ts +36 -3
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -1
- package/dist/{protect-B6w-WQMB.d.cts → protect-Bk9q12ia.d.cts} +75 -1
- package/dist/{protect-B6w-WQMB.d.ts → protect-Bk9q12ia.d.ts} +75 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2203,6 +2203,48 @@ var AtlaSentClient = class {
|
|
|
2203
2203
|
break;
|
|
2204
2204
|
}
|
|
2205
2205
|
}
|
|
2206
|
+
// ── License verification (self-hosted / air-gapped) ──────────────────────
|
|
2207
|
+
/**
|
|
2208
|
+
* Retrieve the license status of this self-hosted or air-gapped deployment.
|
|
2209
|
+
*
|
|
2210
|
+
* Calls `GET /v1/license`. Returns the current validity state, expiry,
|
|
2211
|
+
* enabled feature flags, and optional capacity limits for the installed
|
|
2212
|
+
* license key.
|
|
2213
|
+
*
|
|
2214
|
+
* Callers should check `result.status === "active"` before proceeding.
|
|
2215
|
+
* A `"grace"` status means the license has lapsed but a grace window
|
|
2216
|
+
* (`grace_until`) is still open — the deployment continues to function
|
|
2217
|
+
* but the license should be renewed immediately.
|
|
2218
|
+
*
|
|
2219
|
+
* Throws {@link AtlaSentError} on transport / auth failures.
|
|
2220
|
+
*/
|
|
2221
|
+
async getLicense() {
|
|
2222
|
+
const { body, rateLimit } = await this.get("/v1/license");
|
|
2223
|
+
return { ...body, rateLimit };
|
|
2224
|
+
}
|
|
2225
|
+
/**
|
|
2226
|
+
* Validate a signed license blob against this deployment's installed
|
|
2227
|
+
* public key.
|
|
2228
|
+
*
|
|
2229
|
+
* Calls `POST /v1/license/verify`. Use this when onboarding a new license
|
|
2230
|
+
* key or rotating an expiring one — submit the blob received from AtlaSent
|
|
2231
|
+
* and check `result.valid` before applying the new license.
|
|
2232
|
+
*
|
|
2233
|
+
* A `valid: false` response is **not** thrown — inspect the returned
|
|
2234
|
+
* object. Only transport / server errors throw {@link AtlaSentError}.
|
|
2235
|
+
*
|
|
2236
|
+
* @param blob — The signed license blob string provided by AtlaSent.
|
|
2237
|
+
*/
|
|
2238
|
+
async verifyLicense(blob) {
|
|
2239
|
+
if (!blob || typeof blob !== "string") {
|
|
2240
|
+
throw new AtlaSentError("blob is required", { code: "bad_request" });
|
|
2241
|
+
}
|
|
2242
|
+
const { body, rateLimit } = await this.post(
|
|
2243
|
+
"/v1/license/verify",
|
|
2244
|
+
{ blob }
|
|
2245
|
+
);
|
|
2246
|
+
return { ...body, rateLimit };
|
|
2247
|
+
}
|
|
2206
2248
|
async post(path, body, query) {
|
|
2207
2249
|
return this.request(path, "POST", body, query);
|
|
2208
2250
|
}
|