@hybrd/xmtp 1.3.1 → 1.3.2

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.
@@ -1,6 +1,6 @@
1
1
 
2
2
  
3
- > @hybrd/xmtp@1.3.1 build /Users/ian/Projects/01/hybrid/packages/xmtp
3
+ > @hybrd/xmtp@1.3.2 build /Users/ian/Projects/01/hybrid/packages/xmtp
4
4
  > tsup
5
5
 
6
6
  CLI Building entry: {"index":"src/index.ts"}
@@ -12,7 +12,7 @@
12
12
  CJS Build start
13
13
  ESM Build start
14
14
 
15
- [2:26:40 PM]  WARN  ▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
15
+ [5:19:03 PM]  WARN  ▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
16
16
 
17
17
  scripts/revoke-installations.ts:89:4:
18
18
   89 │ if (import.meta.url === file://${process.argv[1]}) {
@@ -23,7 +23,7 @@
23
23
 
24
24
 
25
25
 
26
- [2:26:40 PM]  WARN  ▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
26
+ [5:19:03 PM]  WARN  ▲ [WARNING] "import.meta" is not available with the "cjs" output format and will be empty [empty-import-meta]
27
27
 
28
28
  src/client.ts:21:33:
29
29
   21 │ const __filename = fileURLToPath(import.meta.url)
@@ -33,13 +33,13 @@
33
33
 
34
34
 
35
35
 
36
- ESM dist/index.js 114.51 KB
37
- ESM dist/index.js.map 218.75 KB
38
- ESM ⚡️ Build success in 101ms
39
- CJS dist/index.cjs 119.82 KB
40
- CJS dist/index.cjs.map 219.25 KB
41
- CJS ⚡️ Build success in 101ms
36
+ ESM dist/index.js 114.52 KB
37
+ ESM dist/index.js.map 218.83 KB
38
+ ESM ⚡️ Build success in 126ms
39
+ CJS dist/index.cjs 119.83 KB
40
+ CJS dist/index.cjs.map 219.34 KB
41
+ CJS ⚡️ Build success in 126ms
42
42
  DTS Build start
43
- DTS ⚡️ Build success in 3819ms
43
+ DTS ⚡️ Build success in 3917ms
44
44
  DTS dist/index.d.cts 29.23 KB
45
45
  DTS dist/index.d.ts 29.23 KB
@@ -1,5 +1,5 @@
1
1
 
2
2
  
3
- > @hybrd/xmtp@1.2.8 typecheck /Users/ian/Projects/01/hybrid/packages/xmtp
3
+ > @hybrd/xmtp@1.3.1 typecheck /Users/ian/Projects/01/hybrid/packages/xmtp
4
4
  > tsc --noEmit
5
5
 
package/dist/index.cjs CHANGED
@@ -3349,7 +3349,7 @@ function getValidatedPayload(c) {
3349
3349
  }
3350
3350
  return validateXMTPToolsToken(token);
3351
3351
  }
3352
- var JWT_SECRET = (() => {
3352
+ function getJwtSecret() {
3353
3353
  const secret = process.env.XMTP_ENCRYPTION_KEY;
3354
3354
  const nodeEnv = process.env.NODE_ENV || "development";
3355
3355
  if (nodeEnv === "production" && !secret) {
@@ -3364,8 +3364,8 @@ var JWT_SECRET = (() => {
3364
3364
  return "fallback-secret-for-dev-only";
3365
3365
  }
3366
3366
  return secret;
3367
- })();
3368
- var API_KEY = (() => {
3367
+ }
3368
+ function getApiKey() {
3369
3369
  const apiKey = process.env.XMTP_API_KEY;
3370
3370
  const nodeEnv = process.env.NODE_ENV || "development";
3371
3371
  if (nodeEnv === "production" && !apiKey) {
@@ -3380,7 +3380,7 @@ var API_KEY = (() => {
3380
3380
  return "fallback-api-key-for-dev-only";
3381
3381
  }
3382
3382
  return apiKey;
3383
- })();
3383
+ }
3384
3384
  var JWT_EXPIRY = 5 * 60;
3385
3385
  function generateXMTPToolsToken(payload) {
3386
3386
  const now = Math.floor(Date.now() / 1e3);
@@ -3389,12 +3389,12 @@ function generateXMTPToolsToken(payload) {
3389
3389
  issued: now,
3390
3390
  expires: now + JWT_EXPIRY
3391
3391
  };
3392
- return import_jsonwebtoken.default.sign(fullPayload, JWT_SECRET, {
3392
+ return import_jsonwebtoken.default.sign(fullPayload, getJwtSecret(), {
3393
3393
  expiresIn: JWT_EXPIRY
3394
3394
  });
3395
3395
  }
3396
3396
  function validateXMTPToolsToken(token) {
3397
- if (token === API_KEY) {
3397
+ if (token === getApiKey()) {
3398
3398
  console.log("\u{1F511} [Auth] Using API key authentication");
3399
3399
  const now = Math.floor(Date.now() / 1e3);
3400
3400
  return {
@@ -3408,7 +3408,7 @@ function validateXMTPToolsToken(token) {
3408
3408
  };
3409
3409
  }
3410
3410
  try {
3411
- const decoded = import_jsonwebtoken.default.verify(token, JWT_SECRET);
3411
+ const decoded = import_jsonwebtoken.default.verify(token, getJwtSecret());
3412
3412
  console.log("\u{1F511} [Auth] Using JWT token authentication");
3413
3413
  const now = Math.floor(Date.now() / 1e3);
3414
3414
  if (decoded.expires < now) {