@blaxel/core 0.2.54 → 0.2.55-preview.17

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,11 +1,12 @@
1
1
  "use strict";
2
2
  /* eslint-disable */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.dotenv = exports.path = exports.os = exports.fs = void 0;
4
+ exports.dotenv = exports.path = exports.os = exports.fs = exports.crypto = void 0;
5
5
  exports.getWebSocket = getWebSocket;
6
6
  // Browser-compatible exports for Node.js modules
7
7
  // In browser environments, Node.js built-in modules are not available
8
8
  // All Node.js modules are null in browser
9
+ exports.crypto = null;
9
10
  exports.fs = null;
10
11
  exports.os = null;
11
12
  exports.path = null;
@@ -34,12 +34,13 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.path = exports.os = exports.fs = exports.dotenv = void 0;
37
+ exports.path = exports.os = exports.fs = exports.dotenv = exports.crypto = void 0;
38
38
  exports.getWebSocket = getWebSocket;
39
39
  // Import Node.js built-in modules using ES6 imports for ESM compatibility
40
40
  const fsImport = __importStar(require("fs"));
41
41
  const osImport = __importStar(require("os"));
42
42
  const pathImport = __importStar(require("path"));
43
+ const cryptoImport = __importStar(require("crypto"));
43
44
  // Detect environments
44
45
  const isNode = typeof process !== "undefined" &&
45
46
  process.versions != null &&
@@ -52,6 +53,8 @@ let os = null;
52
53
  exports.os = os;
53
54
  let path = null;
54
55
  exports.path = path;
56
+ let crypto = null;
57
+ exports.crypto = crypto;
55
58
  let dotenv = null;
56
59
  exports.dotenv = dotenv;
57
60
  let ws = null; // Used internally by getWebSocket() for caching
@@ -60,6 +63,7 @@ if (isNode && !isBrowser) {
60
63
  exports.fs = fs = fsImport;
61
64
  exports.os = os = osImport;
62
65
  exports.path = path = pathImport;
66
+ exports.crypto = crypto = cryptoImport;
63
67
  // Try to load optional dependencies
64
68
  try {
65
69
  exports.dotenv = dotenv = eval("require")("dotenv");
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.initSentry = initSentry;
5
+ exports.flushSentry = flushSentry;
6
+ exports.isSentryInitialized = isSentryInitialized;
7
+ // Browser/Edge-compatible exports for Sentry
8
+ // In browser/edge environments, @sentry/node is not available
9
+ // All functions are no-ops
10
+ /**
11
+ * Initialize Sentry - no-op in browser/edge environments.
12
+ */
13
+ function initSentry() {
14
+ // No-op in browser/edge environments
15
+ }
16
+ /**
17
+ * Flush pending Sentry events - no-op in browser/edge environments.
18
+ */
19
+ async function flushSentry(_timeout = 2000) {
20
+ // No-op in browser/edge environments
21
+ }
22
+ /**
23
+ * Check if Sentry is initialized - always returns false in browser/edge environments.
24
+ */
25
+ function isSentryInitialized() {
26
+ return false;
27
+ }
@@ -9,8 +9,8 @@ const index_js_1 = require("../authentication/index.js");
9
9
  const env_js_1 = require("../common/env.js");
10
10
  const node_js_1 = require("../common/node.js");
11
11
  // Build info - these placeholders are replaced at build time by build:replace-imports
12
- const BUILD_VERSION = "0.2.54";
13
- const BUILD_COMMIT = "36d148e9b7f9dd2134c772d954c8297b3c958ec3";
12
+ const BUILD_VERSION = "0.2.55-preview.17";
13
+ const BUILD_COMMIT = "1efcf3565af2e54805e7526888bebaf2347c5886";
14
14
  const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
15
15
  // Cache for config.yaml tracking value
16
16
  let configTrackingValue = null;
@@ -169,8 +169,9 @@ class Settings {
169
169
  }
170
170
  get tracking() {
171
171
  // Environment variable has highest priority
172
- if (env_js_1.env.BL_TRACKING !== undefined) {
173
- return env_js_1.env.BL_TRACKING === "true";
172
+ if (env_js_1.env.DO_NOT_TRACK !== undefined) {
173
+ // DO_NOT_TRACK has inverted semantics: true means tracking disabled
174
+ return env_js_1.env.DO_NOT_TRACK !== "true" && env_js_1.env.DO_NOT_TRACK !== "1";
174
175
  }
175
176
  // Then check config.yaml
176
177
  const configValue = getConfigTracking();
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.verifyWebhookSignature = verifyWebhookSignature;
4
4
  exports.verifyWebhookFromRequest = verifyWebhookFromRequest;
5
- const crypto_1 = require("crypto");
5
+ const node_js_1 = require("./node.js");
6
6
  /**
7
7
  * Verify the HMAC-SHA256 signature of a webhook callback from async-sidecar
8
8
  *
@@ -35,6 +35,10 @@ function verifyWebhookSignature(options) {
35
35
  if (!body || !signature || !secret) {
36
36
  return false;
37
37
  }
38
+ // crypto is only available in Node.js environments
39
+ if (!node_js_1.crypto) {
40
+ throw new Error('verifyWebhookSignature is only available in Node.js environments');
41
+ }
38
42
  try {
39
43
  // Verify timestamp if provided (prevents replay attacks)
40
44
  if (timestamp) {
@@ -48,11 +52,11 @@ function verifyWebhookSignature(options) {
48
52
  // Extract hex signature from "sha256=<hex>" format
49
53
  const expectedSignature = signature.replace('sha256=', '');
50
54
  // Compute HMAC-SHA256 signature
51
- const hmac = (0, crypto_1.createHmac)('sha256', secret);
55
+ const hmac = node_js_1.crypto.createHmac('sha256', secret);
52
56
  hmac.update(body);
53
57
  const computedSignature = hmac.digest('hex');
54
58
  // Timing-safe comparison to prevent timing attacks
55
- return (0, crypto_1.timingSafeEqual)(Buffer.from(expectedSignature, 'hex'), Buffer.from(computedSignature, 'hex'));
59
+ return node_js_1.crypto.timingSafeEqual(Buffer.from(expectedSignature, 'hex'), Buffer.from(computedSignature, 'hex'));
56
60
  }
57
61
  catch {
58
62
  // Invalid signature format or other error
@@ -1,3 +1,4 @@
1
+ export declare const crypto: any;
1
2
  export declare const fs: any;
2
3
  export declare const os: any;
3
4
  export declare const path: any;
@@ -1,6 +1,7 @@
1
1
  declare let fs: typeof import("fs") | null;
2
2
  declare let os: typeof import("os") | null;
3
3
  declare let path: typeof import("path") | null;
4
+ declare let crypto: typeof import("crypto") | null;
4
5
  declare let dotenv: typeof import("dotenv") | null;
5
6
  export declare function getWebSocket(): Promise<any>;
6
- export { dotenv, fs, os, path };
7
+ export { crypto, dotenv, fs, os, path };
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Initialize Sentry - no-op in browser/edge environments.
3
+ */
4
+ export declare function initSentry(): void;
5
+ /**
6
+ * Flush pending Sentry events - no-op in browser/edge environments.
7
+ */
8
+ export declare function flushSentry(_timeout?: number): Promise<void>;
9
+ /**
10
+ * Check if Sentry is initialized - always returns false in browser/edge environments.
11
+ */
12
+ export declare function isSentryInitialized(): boolean;