@blaxel/core 0.2.81 → 0.2.82-preview.145
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/settings.js +7 -2
- package/dist/cjs/common/settings.test.js +55 -0
- package/dist/cjs/types/common/settings.d.ts +1 -0
- package/dist/cjs/types/common/settings.test.d.ts +1 -0
- package/dist/cjs-browser/.tsbuildinfo +1 -1
- package/dist/cjs-browser/common/settings.js +7 -2
- package/dist/cjs-browser/common/settings.test.js +55 -0
- package/dist/cjs-browser/types/common/settings.d.ts +1 -0
- package/dist/cjs-browser/types/common/settings.test.d.ts +1 -0
- package/dist/esm/.tsbuildinfo +1 -1
- package/dist/esm/common/settings.js +7 -2
- package/dist/esm/common/settings.test.js +20 -0
- package/dist/esm-browser/.tsbuildinfo +1 -1
- package/dist/esm-browser/common/settings.js +7 -2
- package/dist/esm-browser/common/settings.test.js +20 -0
- package/package.json +1 -1
|
@@ -11,9 +11,10 @@ const index_js_1 = require("../authentication/index.js");
|
|
|
11
11
|
const env_js_1 = require("../common/env.js");
|
|
12
12
|
const node_js_1 = require("../common/node.js");
|
|
13
13
|
// Build info - these placeholders are replaced at build time by build:replace-imports
|
|
14
|
-
const BUILD_VERSION = "0.2.
|
|
15
|
-
const BUILD_COMMIT = "
|
|
14
|
+
const BUILD_VERSION = "0.2.82-preview.145";
|
|
15
|
+
const BUILD_COMMIT = "b6e081ff4ce9c6fee387b08e280bdfe804f52370";
|
|
16
16
|
const BUILD_SENTRY_DSN = "https://fd5e60e1c9820e1eef5ccebb84a07127@o4508714045276160.ingest.us.sentry.io/4510465864564736";
|
|
17
|
+
const BLAXEL_API_VERSION = "2026-04-16";
|
|
17
18
|
// Cache for config.yaml tracking value
|
|
18
19
|
let configTrackingValue = null;
|
|
19
20
|
let configTrackingLoaded = false;
|
|
@@ -164,11 +165,15 @@ class Settings {
|
|
|
164
165
|
get sentryDsn() {
|
|
165
166
|
return BUILD_SENTRY_DSN || "";
|
|
166
167
|
}
|
|
168
|
+
get apiVersion() {
|
|
169
|
+
return env_js_1.env.BL_API_VERSION || BLAXEL_API_VERSION;
|
|
170
|
+
}
|
|
167
171
|
get headers() {
|
|
168
172
|
const osArch = getOsArch();
|
|
169
173
|
return {
|
|
170
174
|
"x-blaxel-authorization": this.authorization,
|
|
171
175
|
"x-blaxel-workspace": this.workspace || "",
|
|
176
|
+
"Blaxel-Version": this.apiVersion,
|
|
172
177
|
"User-Agent": `blaxel/sdk/typescript/${this.version} (${osArch}) blaxel/${this.commit}`,
|
|
173
178
|
};
|
|
174
179
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
const vitest_1 = require("vitest");
|
|
37
|
+
const env_js_1 = require("./env.js");
|
|
38
|
+
(0, vitest_1.describe)('Settings.apiVersion', () => {
|
|
39
|
+
(0, vitest_1.beforeEach)(() => {
|
|
40
|
+
// Reset the module-level settings singleton between tests if needed
|
|
41
|
+
});
|
|
42
|
+
(0, vitest_1.afterEach)(() => {
|
|
43
|
+
delete env_js_1.env.BL_API_VERSION;
|
|
44
|
+
});
|
|
45
|
+
(0, vitest_1.it)('defaults to 2026-04-16 when BL_API_VERSION is not set', async () => {
|
|
46
|
+
delete env_js_1.env.BL_API_VERSION;
|
|
47
|
+
const { settings } = await Promise.resolve().then(() => __importStar(require('./settings.js')));
|
|
48
|
+
(0, vitest_1.expect)(settings.apiVersion).toBe('2026-04-16');
|
|
49
|
+
});
|
|
50
|
+
(0, vitest_1.it)('headers include Blaxel-Version set to the default', async () => {
|
|
51
|
+
delete env_js_1.env.BL_API_VERSION;
|
|
52
|
+
const { settings } = await Promise.resolve().then(() => __importStar(require('./settings.js')));
|
|
53
|
+
(0, vitest_1.expect)(settings.headers['Blaxel-Version']).toBe('2026-04-16');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|