@objectstack/runtime 7.2.0 → 7.2.1
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/index.cjs +18 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/package.json +18 -18
package/dist/index.d.cts
CHANGED
|
@@ -12,6 +12,7 @@ export { CapturedError, ErrorReporter, InMemoryErrorReporter, InMemoryMetricsReg
|
|
|
12
12
|
import { MiddlewareConfig, MiddlewareType } from '@objectstack/spec/system';
|
|
13
13
|
import { EnvironmentArtifact } from '@objectstack/spec/cloud';
|
|
14
14
|
export { RestApiPluginConfig, RestServer, RouteEntry, RouteGroupBuilder, RouteManager, createRestApiPlugin } from '@objectstack/rest';
|
|
15
|
+
export { _resetEnvDeprecationWarnings, readEnvWithDeprecation } from '@objectstack/types';
|
|
15
16
|
|
|
16
17
|
interface RuntimeConfig {
|
|
17
18
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { CapturedError, ErrorReporter, InMemoryErrorReporter, InMemoryMetricsReg
|
|
|
12
12
|
import { MiddlewareConfig, MiddlewareType } from '@objectstack/spec/system';
|
|
13
13
|
import { EnvironmentArtifact } from '@objectstack/spec/cloud';
|
|
14
14
|
export { RestApiPluginConfig, RestServer, RouteEntry, RouteGroupBuilder, RouteManager, createRestApiPlugin } from '@objectstack/rest';
|
|
15
|
+
export { _resetEnvDeprecationWarnings, readEnvWithDeprecation } from '@objectstack/types';
|
|
15
16
|
|
|
16
17
|
interface RuntimeConfig {
|
|
17
18
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1202,6 +1202,7 @@ __export(app_plugin_exports, {
|
|
|
1202
1202
|
collectBundleFunctions: () => collectBundleFunctions,
|
|
1203
1203
|
collectBundleHooks: () => collectBundleHooks
|
|
1204
1204
|
});
|
|
1205
|
+
import { readEnvWithDeprecation } from "@objectstack/types";
|
|
1205
1206
|
function collectBundleHooks(bundle) {
|
|
1206
1207
|
const out = [];
|
|
1207
1208
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -1591,7 +1592,7 @@ var init_app_plugin = __esm({
|
|
|
1591
1592
|
} catch (e) {
|
|
1592
1593
|
ctx.logger.warn("[Seeder] Failed to register seed-datasets/seed-replayer service", { error: e?.message });
|
|
1593
1594
|
}
|
|
1594
|
-
const multiTenant = String(
|
|
1595
|
+
const multiTenant = String(readEnvWithDeprecation("OS_MULTI_ORG_ENABLED", "OS_MULTI_TENANT") ?? "false").toLowerCase() !== "false";
|
|
1595
1596
|
if (multiTenant) {
|
|
1596
1597
|
ctx.logger.info("[Seeder] multi-tenant mode \u2014 skipping inline seed; per-org replay will run on sys_organization insert");
|
|
1597
1598
|
} else {
|
|
@@ -2245,6 +2246,7 @@ import { resolve as resolvePath2 } from "path";
|
|
|
2245
2246
|
import { mkdirSync } from "fs";
|
|
2246
2247
|
import { homedir } from "os";
|
|
2247
2248
|
import { z } from "zod";
|
|
2249
|
+
import { readEnvWithDeprecation as readEnvWithDeprecation2 } from "@objectstack/types";
|
|
2248
2250
|
function resolveObjectStackHome() {
|
|
2249
2251
|
const raw = process.env.OS_HOME?.trim();
|
|
2250
2252
|
if (raw && raw.length > 0) {
|
|
@@ -2294,7 +2296,7 @@ async function createStandaloneStack(config) {
|
|
|
2294
2296
|
const environmentId = cfg.environmentId ?? process.env.OS_ENVIRONMENT_ID ?? "proj_local";
|
|
2295
2297
|
const artifactPathInput = cfg.artifactPath ?? process.env.OS_ARTIFACT_PATH ?? resolvePath2(cwd, "dist/objectstack.json");
|
|
2296
2298
|
const artifactPath = isHttpUrl(artifactPathInput) ? artifactPathInput : artifactPathInput.startsWith("/") ? artifactPathInput : resolvePath2(cwd, artifactPathInput);
|
|
2297
|
-
const dbUrl = cfg.databaseUrl ??
|
|
2299
|
+
const dbUrl = cfg.databaseUrl ?? readEnvWithDeprecation2("OS_DATABASE_URL", "DATABASE_URL")?.trim() ?? process.env.TURSO_DATABASE_URL?.trim() ?? (process.env.OS_HOME?.trim() ? `file:${resolvePath2(resolveObjectStackHome(), "data/standalone.db")}` : cfg.projectRoot ? `file:${resolvePath2(cfg.projectRoot, ".objectstack/data/standalone.db")}` : `file:${resolvePath2(resolveObjectStackHome(), "data/standalone.db")}`);
|
|
2298
2300
|
const explicitDriver = cfg.databaseDriver ?? process.env.OS_DATABASE_DRIVER?.trim();
|
|
2299
2301
|
const dbDriver = explicitDriver ?? detectDriverFromUrl(dbUrl);
|
|
2300
2302
|
let driverPlugin;
|
|
@@ -2457,6 +2459,7 @@ init_seed_loader();
|
|
|
2457
2459
|
|
|
2458
2460
|
// src/http-dispatcher.ts
|
|
2459
2461
|
import { getEnv, resolveLocale } from "@objectstack/core";
|
|
2462
|
+
import { readEnvWithDeprecation as readEnvWithDeprecation3 } from "@objectstack/types";
|
|
2460
2463
|
import { CoreServiceName } from "@objectstack/spec/system";
|
|
2461
2464
|
import { pluralToSingular } from "@objectstack/spec/shared";
|
|
2462
2465
|
|
|
@@ -3947,7 +3950,7 @@ var _HttpDispatcher = class _HttpDispatcher {
|
|
|
3947
3950
|
}
|
|
3948
3951
|
}
|
|
3949
3952
|
if (parts.length === 3 && parts[0] === "admin" && parts[1] === "platform-sso" && parts[2] === "backfill" && m === "POST") {
|
|
3950
|
-
const baseSecret = (
|
|
3953
|
+
const baseSecret = (readEnvWithDeprecation3("OS_AUTH_SECRET", ["AUTH_SECRET", "BETTER_AUTH_SECRET"]) ?? "").trim();
|
|
3951
3954
|
if (!baseSecret) {
|
|
3952
3955
|
return { handled: true, response: this.error("OS_AUTH_SECRET not configured on this worker", 503) };
|
|
3953
3956
|
}
|
|
@@ -4137,7 +4140,7 @@ var _HttpDispatcher = class _HttpDispatcher {
|
|
|
4137
4140
|
});
|
|
4138
4141
|
try {
|
|
4139
4142
|
const { seedPlatformSsoClient: seedPlatformSsoClient2 } = await Promise.resolve().then(() => (init_platform_sso(), platform_sso_exports));
|
|
4140
|
-
const baseSecret = (
|
|
4143
|
+
const baseSecret = (readEnvWithDeprecation3("OS_AUTH_SECRET", ["AUTH_SECRET", "BETTER_AUTH_SECRET"]) ?? "").trim();
|
|
4141
4144
|
if (baseSecret) {
|
|
4142
4145
|
await seedPlatformSsoClient2({
|
|
4143
4146
|
ql,
|
|
@@ -7607,6 +7610,7 @@ init_driver_plugin();
|
|
|
7607
7610
|
init_app_plugin();
|
|
7608
7611
|
import { createHmac as createHmac2 } from "crypto";
|
|
7609
7612
|
import { ObjectKernel as ObjectKernel3 } from "@objectstack/core";
|
|
7613
|
+
import { readEnvWithDeprecation as readEnvWithDeprecation4 } from "@objectstack/types";
|
|
7610
7614
|
|
|
7611
7615
|
// src/cloud/capability-loader.ts
|
|
7612
7616
|
var CAPABILITY_PROVIDERS = {
|
|
@@ -7744,7 +7748,7 @@ var ArtifactKernelFactory = class {
|
|
|
7744
7748
|
this.envRegistry = config.envRegistry;
|
|
7745
7749
|
this.logger = config.logger ?? console;
|
|
7746
7750
|
this.kernelConfig = config.kernelConfig;
|
|
7747
|
-
this.authBaseSecret = (config.authBaseSecret ??
|
|
7751
|
+
this.authBaseSecret = (config.authBaseSecret ?? readEnvWithDeprecation4("OS_AUTH_SECRET", ["AUTH_SECRET", "BETTER_AUTH_SECRET"]) ?? "").trim();
|
|
7748
7752
|
}
|
|
7749
7753
|
async create(environmentId) {
|
|
7750
7754
|
let cached = this.envRegistry.peekById(environmentId);
|
|
@@ -7857,7 +7861,7 @@ var ArtifactKernelFactory = class {
|
|
|
7857
7861
|
this.logger.warn?.("[ArtifactKernelFactory] OS_AUTH_SECRET not set \u2014 per-project AuthPlugin skipped (auth endpoints will return 404)", { environmentId });
|
|
7858
7862
|
}
|
|
7859
7863
|
try {
|
|
7860
|
-
const multiTenant = String(
|
|
7864
|
+
const multiTenant = String(readEnvWithDeprecation4("OS_MULTI_ORG_ENABLED", "OS_MULTI_TENANT") ?? "false").toLowerCase() !== "false";
|
|
7861
7865
|
if (multiTenant) {
|
|
7862
7866
|
try {
|
|
7863
7867
|
const { OrgScopingPlugin } = await import("@objectstack/plugin-org-scoping");
|
|
@@ -9060,6 +9064,7 @@ async function createObjectOSStack(config) {
|
|
|
9060
9064
|
// src/cloud/marketplace-install-local-plugin.ts
|
|
9061
9065
|
import { existsSync as existsSync2, mkdirSync as mkdirSync3, readFileSync, readdirSync, unlinkSync, writeFileSync as writeFileSync2 } from "fs";
|
|
9062
9066
|
import { join, resolve } from "path";
|
|
9067
|
+
import { readEnvWithDeprecation as readEnvWithDeprecation5 } from "@objectstack/types";
|
|
9063
9068
|
var ROUTE_BASE = "/api/v1/marketplace/install-local";
|
|
9064
9069
|
var DEFAULT_DIR = ".objectstack/installed-packages";
|
|
9065
9070
|
function safeFilename(manifestId) {
|
|
@@ -9582,7 +9587,7 @@ var MarketplaceInstallLocalPlugin = class {
|
|
|
9582
9587
|
}
|
|
9583
9588
|
}
|
|
9584
9589
|
if (opts.seedNow && datasets.length > 0) {
|
|
9585
|
-
const multiTenant = String(
|
|
9590
|
+
const multiTenant = String(readEnvWithDeprecation5("OS_MULTI_ORG_ENABLED", "OS_MULTI_TENANT") ?? "false").toLowerCase() !== "false";
|
|
9586
9591
|
try {
|
|
9587
9592
|
const ql = ctx.getService("objectql");
|
|
9588
9593
|
let metadata;
|
|
@@ -9733,6 +9738,7 @@ import {
|
|
|
9733
9738
|
createRestApiPlugin
|
|
9734
9739
|
} from "@objectstack/rest";
|
|
9735
9740
|
export * from "@objectstack/core";
|
|
9741
|
+
import { readEnvWithDeprecation as readEnvWithDeprecation6, _resetEnvDeprecationWarnings } from "@objectstack/types";
|
|
9736
9742
|
export {
|
|
9737
9743
|
AppPlugin,
|
|
9738
9744
|
ArtifactApiClient,
|
|
@@ -9770,6 +9776,7 @@ export {
|
|
|
9770
9776
|
SandboxError,
|
|
9771
9777
|
SeedLoaderService,
|
|
9772
9778
|
UnimplementedScriptRunner,
|
|
9779
|
+
_resetEnvDeprecationWarnings,
|
|
9773
9780
|
actionBodyRunnerFactory,
|
|
9774
9781
|
backfillPlatformSsoClients,
|
|
9775
9782
|
buildPlatformSsoRedirectUri,
|
|
@@ -9794,6 +9801,7 @@ export {
|
|
|
9794
9801
|
mergeRuntimeModule,
|
|
9795
9802
|
parseTraceparent,
|
|
9796
9803
|
readArtifactSource,
|
|
9804
|
+
readEnvWithDeprecation6 as readEnvWithDeprecation,
|
|
9797
9805
|
resolveCloudUrl,
|
|
9798
9806
|
resolveDefaultArtifactPath,
|
|
9799
9807
|
resolveErrorReporter,
|