@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.
- package/dist/cjs/.tsbuildinfo +1 -1
- package/dist/cjs/common/browser.js +2 -1
- package/dist/cjs/common/node.js +5 -1
- package/dist/cjs/common/sentry-browser.js +27 -0
- package/dist/cjs/common/settings.js +5 -4
- package/dist/cjs/common/webhook.js +7 -3
- package/dist/cjs/types/common/browser.d.ts +1 -0
- package/dist/cjs/types/common/node.d.ts +2 -1
- package/dist/cjs/types/common/sentry-browser.d.ts +12 -0
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/node.js +2 -1
- package/dist/cjs-browser/common/sentry.js +11 -210
- package/dist/cjs-browser/common/settings.js +5 -4
- package/dist/cjs-browser/common/webhook.js +7 -3
- package/dist/cjs-browser/types/common/browser.d.ts +1 -0
- package/dist/cjs-browser/types/common/node.d.ts +2 -1
- package/dist/cjs-browser/types/common/sentry-browser.d.ts +12 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/browser.js +1 -0
- package/dist/esm/common/node.js +4 -1
- package/dist/esm/common/sentry-browser.js +22 -0
- package/dist/esm/common/settings.js +5 -4
- package/dist/esm/common/webhook.js +7 -3
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/node.js +1 -0
- package/dist/esm-browser/common/sentry.js +11 -177
- package/dist/esm-browser/common/settings.js +5 -4
- package/dist/esm-browser/common/webhook.js +7 -3
- package/package.json +4 -2
|
@@ -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;
|
package/dist/cjs/common/node.js
CHANGED
|
@@ -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.
|
|
13
|
-
const BUILD_COMMIT = "
|
|
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.
|
|
173
|
-
|
|
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
|
|
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 =
|
|
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
|
|
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,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;
|