@astralbeam/sdk 0.30.7 → 0.31.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/server.js CHANGED
@@ -1,5 +1,5 @@
1
- import { a as serializeJoseHeader, c as validateCritDuplicates, d as JOSENotSupported, f as JWSInvalid, g as encoder, h as encode$1, i as isObject, l as decode, m as concat, n as assertNotSet, o as validateB64, p as JWTInvalid, r as isDisjoint, s as validateCrit, t as JWS_RECOGNIZED, u as encode } from "./validate-DB08s2p8.js";
2
- // ../node_modules/.bun/jose@6.2.15/node_modules/jose/dist/webapi/lib/key.js
1
+ import { a as serializeJoseHeader, c as validateCritDuplicates, d as JOSENotSupported, f as JWSInvalid, g as encoder, h as encode$1, i as isObject, l as decode, m as concat, n as assertNotSet, o as validateB64, p as JWTInvalid, r as isDisjoint, s as validateCrit, t as JWS_RECOGNIZED, u as encode } from "./validate-hedvHnsO.js";
2
+ // ../node_modules/.bun/jose@6.2.18/node_modules/jose/dist/webapi/lib/key.js
3
3
  const tag = (key) => key[Symbol.toStringTag];
4
4
  const jwkMatchesOp = (entry, key, usage) => {
5
5
  const { alg } = entry;
@@ -7,6 +7,7 @@ const jwkMatchesOp = (entry, key, usage) => {
7
7
  const expected = usage === "sign" || usage === "verify" ? "sig" : "enc";
8
8
  if (key.use !== expected) throw new TypeError(`Invalid key for this operation, its "use" must be "${expected}" when present`);
9
9
  }
10
+ if (key.kty === "AKP" && key.alg === void 0) throw new TypeError("missing \"alg\" (Algorithm) Parameter value");
10
11
  if (key.alg !== void 0 && key.alg !== alg) throw new TypeError(`Invalid key for this operation, its "alg" must be "${alg}" when present`);
11
12
  if (Array.isArray(key.key_ops)) {
12
13
  const expectedKeyOp = usage === "encrypt" || usage === "decrypt" ? entry.ops?.[usage === "encrypt" ? 0 : 1] : usage;
@@ -127,7 +128,7 @@ async function jwkToKey(entry, jwk, extractable) {
127
128
  async function rawKey(key, expected, usage, extractable = !1) {
128
129
  return key instanceof Uint8Array && (key = await crypto.subtle.importKey("raw", key, expected, extractable, [usage])), checkCryptoKey(key, expected, usage), key;
129
130
  }
130
- // ../node_modules/.bun/jose@6.2.15/node_modules/jose/dist/webapi/lib/key_descriptor.js
131
+ // ../node_modules/.bun/jose@6.2.18/node_modules/jose/dist/webapi/lib/key_descriptor.js
131
132
  function table(entries) {
132
133
  const out = { __proto__: null };
133
134
  for (const alg in entries) out[alg] = {
@@ -136,7 +137,7 @@ function table(entries) {
136
137
  };
137
138
  return out;
138
139
  }
139
- // ../node_modules/.bun/jose@6.2.15/node_modules/jose/dist/webapi/lib/jws_algorithms.js
140
+ // ../node_modules/.bun/jose@6.2.18/node_modules/jose/dist/webapi/lib/jws_algorithms.js
140
141
  const sig = [["verify"], ["sign"]];
141
142
  function hmac(bits) {
142
143
  const subtle = {
@@ -225,7 +226,7 @@ function jwsAlgorithm(alg) {
225
226
  if (!entry) throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
226
227
  return entry;
227
228
  }
228
- // ../node_modules/.bun/jose@6.2.15/node_modules/jose/dist/webapi/lib/jwt_claims_set.js
229
+ // ../node_modules/.bun/jose@6.2.18/node_modules/jose/dist/webapi/lib/jwt_claims_set.js
229
230
  const epoch = (date) => Math.floor(date.getTime() / 1e3);
230
231
  const multipliers = {
231
232
  s: 1,
@@ -244,7 +245,7 @@ function secs(str) {
244
245
  const matched = REGEX.exec(str);
245
246
  (!matched || matched[4] && matched[1]) && invalidDuration();
246
247
  const value = parseFloat(matched[2]), durationSeconds = Math.round(value * multipliers[matched[3][0].toLowerCase()]);
247
- return Number.isFinite(durationSeconds) || invalidDuration(), matched[1] === "-" || matched[4] === "ago" ? -durationSeconds : durationSeconds;
248
+ return Number.isFinite(durationSeconds) || invalidDuration(), matched[1] === "-" || matched[4]?.toLowerCase() === "ago" ? -durationSeconds : durationSeconds;
248
249
  }
249
250
  function validateInput(label, input) {
250
251
  if (!Number.isFinite(input)) throw new TypeError(`Invalid ${label} input`);
@@ -303,7 +304,7 @@ var JWTClaimsBuilder = class {
303
304
  return value === void 0 ? claimsSet.iat = epoch(/* @__PURE__ */ new Date()) : typeof value == "string" ? claimsSet.iat = validateInput("setIssuedAt", epoch(/* @__PURE__ */ new Date()) + secs(value)) : claimsSet.iat = numericDate(value, "setIssuedAt"), this;
304
305
  }
305
306
  };
306
- // ../node_modules/.bun/jose@6.2.15/node_modules/jose/dist/webapi/lib/jws_sign.js
307
+ // ../node_modules/.bun/jose@6.2.18/node_modules/jose/dist/webapi/lib/jws_sign.js
307
308
  async function createSignature(input, key, rejectUnencoded) {
308
309
  let [payload, protectedHeader, unprotectedHeader, crit] = input, encodedProtectedHeader = "";
309
310
  if (protectedHeader !== void 0) {
@@ -345,7 +346,7 @@ async function createCompactSignature(payload, protectedHeader, crit, key, rejec
345
346
  ], key, rejectUnencoded);
346
347
  return `${jws.protected}.${jws.payload}.${jws.signature}`;
347
348
  }
348
- // ../node_modules/.bun/jose@6.2.15/node_modules/jose/dist/webapi/jwt/sign.js
349
+ // ../node_modules/.bun/jose@6.2.18/node_modules/jose/dist/webapi/jwt/sign.js
349
350
  const SignJWT_base = JWTClaimsBuilder;
350
351
  var SignJWT = class extends SignJWT_base {
351
352
  #protectedHeader;