@loadstrike/loadstrike-sdk 1.0.29201 → 1.0.30001

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.
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BLACKBOX_LICENSING_API_BASE_URL_TOKEN = void 0;
4
+ exports.BLACKBOX_LICENSING_API_BASE_URL_TOKEN = "";
package/dist/cjs/local.js CHANGED
@@ -55,6 +55,7 @@ const childProcess = __importStar(require("node:child_process"));
55
55
  const node_crypto_1 = require("node:crypto");
56
56
  const correlation_js_1 = require("./correlation.js");
57
57
  const transports_js_1 = require("./transports.js");
58
+ const internal_build_js_1 = require("./internal-build.js");
58
59
  const DEFAULT_LICENSING_API_BASE_URL = "https://licensing.loadstrike.com";
59
60
  let developmentLicensingApiBaseUrlOverride;
60
61
  const BUILT_IN_WORKER_PLUGIN_NAMES = new Set([
@@ -529,7 +530,7 @@ function normalizeLicensingApiBaseUrl(value) {
529
530
  return normalized || DEFAULT_LICENSING_API_BASE_URL;
530
531
  }
531
532
  function resolveLicensingApiBaseUrl() {
532
- return normalizeLicensingApiBaseUrl(developmentLicensingApiBaseUrlOverride);
533
+ return normalizeLicensingApiBaseUrl(developmentLicensingApiBaseUrlOverride ?? resolveInternalBlackBoxLicensingApiBaseUrl());
533
534
  }
534
535
  function setDevelopmentLicensingApiBaseUrlOverride(value) {
535
536
  if (value != null && value.trim()) {
@@ -570,6 +571,21 @@ function isLoopbackHttpBaseUrl(value) {
570
571
  const host = parsed.hostname.trim().toLowerCase();
571
572
  return host === "localhost" || host === "127.0.0.1" || host === "[::1]" || host === "::1" || host.endsWith(".localhost");
572
573
  }
574
+ function resolveInternalBlackBoxLicensingApiBaseUrl() {
575
+ const compiledToken = String(internal_build_js_1.BLACKBOX_LICENSING_API_BASE_URL_TOKEN ?? "").trim();
576
+ if (!compiledToken) {
577
+ return undefined;
578
+ }
579
+ const envToken = String(process.env.LOADSTRIKE_INTERNAL_BLACKBOX_API_BASE_URL_TOKEN ?? "").trim();
580
+ if (!envToken || envToken !== compiledToken) {
581
+ return undefined;
582
+ }
583
+ const candidate = normalizeLicensingApiBaseUrl(process.env.LOADSTRIKE_INTERNAL_BLACKBOX_API_BASE_URL);
584
+ if (!isLoopbackHttpBaseUrl(candidate)) {
585
+ return undefined;
586
+ }
587
+ return candidate;
588
+ }
573
589
  function normalizeTimeoutMs(value) {
574
590
  if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
575
591
  return 10000;
@@ -0,0 +1 @@
1
+ export const BLACKBOX_LICENSING_API_BASE_URL_TOKEN = "";
package/dist/esm/local.js CHANGED
@@ -16,6 +16,7 @@ import * as childProcess from "node:child_process";
16
16
  import { createHash, createVerify, randomUUID } from "node:crypto";
17
17
  import { CorrelationStoreConfiguration, CrossPlatformTrackingRuntime, RedisCorrelationStoreOptions, RedisCorrelationStore, TrackingFieldSelector } from "./correlation.js";
18
18
  import { EndpointAdapterFactory, LOADSTRIKE_TRACE_ID_TRACKING_FIELD } from "./transports.js";
19
+ import { BLACKBOX_LICENSING_API_BASE_URL_TOKEN } from "./internal-build.js";
19
20
  const DEFAULT_LICENSING_API_BASE_URL = "https://licensing.loadstrike.com";
20
21
  let developmentLicensingApiBaseUrlOverride;
21
22
  const BUILT_IN_WORKER_PLUGIN_NAMES = new Set([
@@ -489,7 +490,7 @@ function normalizeLicensingApiBaseUrl(value) {
489
490
  return normalized || DEFAULT_LICENSING_API_BASE_URL;
490
491
  }
491
492
  function resolveLicensingApiBaseUrl() {
492
- return normalizeLicensingApiBaseUrl(developmentLicensingApiBaseUrlOverride);
493
+ return normalizeLicensingApiBaseUrl(developmentLicensingApiBaseUrlOverride ?? resolveInternalBlackBoxLicensingApiBaseUrl());
493
494
  }
494
495
  function setDevelopmentLicensingApiBaseUrlOverride(value) {
495
496
  if (value != null && value.trim()) {
@@ -530,6 +531,21 @@ function isLoopbackHttpBaseUrl(value) {
530
531
  const host = parsed.hostname.trim().toLowerCase();
531
532
  return host === "localhost" || host === "127.0.0.1" || host === "[::1]" || host === "::1" || host.endsWith(".localhost");
532
533
  }
534
+ function resolveInternalBlackBoxLicensingApiBaseUrl() {
535
+ const compiledToken = String(BLACKBOX_LICENSING_API_BASE_URL_TOKEN ?? "").trim();
536
+ if (!compiledToken) {
537
+ return undefined;
538
+ }
539
+ const envToken = String(process.env.LOADSTRIKE_INTERNAL_BLACKBOX_API_BASE_URL_TOKEN ?? "").trim();
540
+ if (!envToken || envToken !== compiledToken) {
541
+ return undefined;
542
+ }
543
+ const candidate = normalizeLicensingApiBaseUrl(process.env.LOADSTRIKE_INTERNAL_BLACKBOX_API_BASE_URL);
544
+ if (!isLoopbackHttpBaseUrl(candidate)) {
545
+ return undefined;
546
+ }
547
+ return candidate;
548
+ }
533
549
  function normalizeTimeoutMs(value) {
534
550
  if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) {
535
551
  return 10000;
@@ -0,0 +1 @@
1
+ export declare const BLACKBOX_LICENSING_API_BASE_URL_TOKEN = "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loadstrike/loadstrike-sdk",
3
- "version": "1.0.29201",
3
+ "version": "1.0.30001",
4
4
  "description": "TypeScript and JavaScript SDK for in-process load execution, traffic correlation, and reporting.",
5
5
  "keywords": [
6
6
  "load-testing",