@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/dist/hono.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context, ErrorHandler, MiddlewareHandler } from 'hono';
2
- import { A as AtlaSentDeniedError, a as AtlaSentError } from './protect-B6w-WQMB.cjs';
3
- export { P as Permit, b as ProtectRequest } from './protect-B6w-WQMB.cjs';
2
+ import { A as AtlaSentDeniedError, a as AtlaSentError } from './protect-Bk9q12ia.cjs';
3
+ export { P as Permit, b as ProtectRequest } from './protect-Bk9q12ia.cjs';
4
4
 
5
5
  /**
6
6
  * Hono middleware for AtlaSent execution-time authorization.
package/dist/hono.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Context, ErrorHandler, MiddlewareHandler } from 'hono';
2
- import { A as AtlaSentDeniedError, a as AtlaSentError } from './protect-B6w-WQMB.js';
3
- export { P as Permit, b as ProtectRequest } from './protect-B6w-WQMB.js';
2
+ import { A as AtlaSentDeniedError, a as AtlaSentError } from './protect-Bk9q12ia.js';
3
+ export { P as Permit, b as ProtectRequest } from './protect-Bk9q12ia.js';
4
4
 
5
5
  /**
6
6
  * Hono middleware for AtlaSent execution-time authorization.
package/dist/hono.js CHANGED
@@ -1903,6 +1903,48 @@ var AtlaSentClient = class {
1903
1903
  break;
1904
1904
  }
1905
1905
  }
1906
+ // ── License verification (self-hosted / air-gapped) ──────────────────────
1907
+ /**
1908
+ * Retrieve the license status of this self-hosted or air-gapped deployment.
1909
+ *
1910
+ * Calls `GET /v1/license`. Returns the current validity state, expiry,
1911
+ * enabled feature flags, and optional capacity limits for the installed
1912
+ * license key.
1913
+ *
1914
+ * Callers should check `result.status === "active"` before proceeding.
1915
+ * A `"grace"` status means the license has lapsed but a grace window
1916
+ * (`grace_until`) is still open — the deployment continues to function
1917
+ * but the license should be renewed immediately.
1918
+ *
1919
+ * Throws {@link AtlaSentError} on transport / auth failures.
1920
+ */
1921
+ async getLicense() {
1922
+ const { body, rateLimit } = await this.get("/v1/license");
1923
+ return { ...body, rateLimit };
1924
+ }
1925
+ /**
1926
+ * Validate a signed license blob against this deployment's installed
1927
+ * public key.
1928
+ *
1929
+ * Calls `POST /v1/license/verify`. Use this when onboarding a new license
1930
+ * key or rotating an expiring one — submit the blob received from AtlaSent
1931
+ * and check `result.valid` before applying the new license.
1932
+ *
1933
+ * A `valid: false` response is **not** thrown — inspect the returned
1934
+ * object. Only transport / server errors throw {@link AtlaSentError}.
1935
+ *
1936
+ * @param blob — The signed license blob string provided by AtlaSent.
1937
+ */
1938
+ async verifyLicense(blob) {
1939
+ if (!blob || typeof blob !== "string") {
1940
+ throw new AtlaSentError("blob is required", { code: "bad_request" });
1941
+ }
1942
+ const { body, rateLimit } = await this.post(
1943
+ "/v1/license/verify",
1944
+ { blob }
1945
+ );
1946
+ return { ...body, rateLimit };
1947
+ }
1906
1948
  async post(path, body, query) {
1907
1949
  return this.request(path, "POST", body, query);
1908
1950
  }