@objectstack/runtime 8.0.1 → 9.0.0

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.d.cts CHANGED
@@ -4,13 +4,13 @@ export { ObjectKernel } from '@objectstack/core';
4
4
  import { ClusterServicePluginOptions } from '@objectstack/service-cluster';
5
5
  import { ClusterCapabilityConfigInput, ExecutionContext } from '@objectstack/spec/kernel';
6
6
  import { z } from 'zod';
7
- import * as Contracts from '@objectstack/spec/contracts';
8
- import { ISeedLoaderService, IDataEngine, IMetadataService } from '@objectstack/spec/contracts';
9
- import { SeedLoaderRequest, SeedLoaderResult, ObjectDependencyGraph, Seed, SeedLoaderConfigInput, ExpressionBody, ScriptBody, HookBody, Hook } from '@objectstack/spec/data';
7
+ export { SeedLoaderService } from '@objectstack/objectql';
10
8
  import { SchemaDiffEntry } from '@objectstack/spec/shared';
11
9
  import { MetricsRegistry, ErrorReporter } from '@objectstack/observability';
12
10
  export { CapturedError, ErrorReporter, InMemoryErrorReporter, InMemoryMetricsRegistry, MetricSample, MetricsRegistry, NoopErrorReporter, NoopMetricsRegistry, OBSERVABILITY_ERRORS_SERVICE, OBSERVABILITY_METRICS_SERVICE, RUNTIME_METRICS } from '@objectstack/observability';
11
+ import * as Contracts from '@objectstack/spec/contracts';
13
12
  import { MiddlewareConfig, MiddlewareType } from '@objectstack/spec/system';
13
+ import { ExpressionBody, ScriptBody, HookBody, Hook } from '@objectstack/spec/data';
14
14
  export { RestApiPluginConfig, RestServer, RouteEntry, RouteGroupBuilder, RouteManager, createRestApiPlugin } from '@objectstack/rest';
15
15
  export { _resetEnvDeprecationWarnings, readEnvWithDeprecation } from '@objectstack/types';
16
16
 
@@ -301,58 +301,6 @@ declare function collectBundleActions(bundle: any): Array<{
301
301
  */
302
302
  declare function collectBundleFunctions(bundle: any): Record<string, (ctx: any) => any>;
303
303
 
304
- interface Logger {
305
- info(message: string, meta?: Record<string, any>): void;
306
- warn(message: string, meta?: Record<string, any>): void;
307
- error(message: string, error?: Error, meta?: Record<string, any>): void;
308
- debug(message: string, meta?: Record<string, any>): void;
309
- }
310
- /**
311
- * SeedLoaderService — Runtime implementation of ISeedLoaderService
312
- *
313
- * Provides metadata-driven seed data loading with:
314
- * - Automatic lookup/master_detail reference resolution via externalId
315
- * - Topological dependency ordering (parents before children)
316
- * - Multi-pass loading for circular references
317
- * - Dry-run validation mode
318
- * - Upsert support honoring SeedSchema mode
319
- * - Actionable error reporting
320
- */
321
- declare class SeedLoaderService implements ISeedLoaderService {
322
- private engine;
323
- private metadata;
324
- private logger;
325
- constructor(engine: IDataEngine, metadata: IMetadataService, logger: Logger);
326
- load(request: SeedLoaderRequest): Promise<SeedLoaderResult>;
327
- buildDependencyGraph(objectNames: string[]): Promise<ObjectDependencyGraph>;
328
- validate(datasets: Seed[], config?: SeedLoaderConfigInput): Promise<SeedLoaderResult>;
329
- private loadDataset;
330
- private resolveFromDatabase;
331
- private resolveDeferredUpdates;
332
- /**
333
- * Seed writes always run as a privileged system context. This bypasses
334
- * RBAC checks (so seeds can target system tables like `sys_*`) and
335
- * disables the SecurityPlugin's auto-injection of `organization_id` /
336
- * `owner_id` — seeds either declare those fields explicitly per
337
- * record, or are intentionally cross-tenant / global.
338
- */
339
- private static readonly SEED_OPTIONS;
340
- private writeRecord;
341
- /**
342
- * Kahn's algorithm for topological sort with cycle detection.
343
- */
344
- private topologicalSort;
345
- private findCycles;
346
- private filterByEnv;
347
- private orderDatasets;
348
- private buildReferenceMap;
349
- private loadExistingRecords;
350
- private looksLikeInternalId;
351
- private extractId;
352
- private buildEmptyResult;
353
- private buildResult;
354
- }
355
-
356
304
  /**
357
305
  * Payload of the `external.schema.drift` event emitted on the kernel bus by the
358
306
  * background drift checker (ADR-0015 §5.2). Consumed by `audit` / `notification`
@@ -2261,4 +2209,4 @@ declare function actionBodyRunnerFactory(runner: ScriptRunner, opts: FactoryOpti
2261
2209
  timeoutMs?: number;
2262
2210
  }) => ((actionCtx: any) => Promise<unknown>) | undefined;
2263
2211
 
2264
- export { AppPlugin, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentDriverRegistry, type ExternalSchemaDriftEvent, ExternalValidationPlugin, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, type KernelManager, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, SeedLoaderService, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createExternalValidationPlugin, createStandaloneStack, createSystemEnvironmentPlugin, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId };
2212
+ export { AppPlugin, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentDriverRegistry, type ExternalSchemaDriftEvent, ExternalValidationPlugin, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, type KernelManager, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createExternalValidationPlugin, createStandaloneStack, createSystemEnvironmentPlugin, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId };
package/dist/index.d.ts CHANGED
@@ -4,13 +4,13 @@ export { ObjectKernel } from '@objectstack/core';
4
4
  import { ClusterServicePluginOptions } from '@objectstack/service-cluster';
5
5
  import { ClusterCapabilityConfigInput, ExecutionContext } from '@objectstack/spec/kernel';
6
6
  import { z } from 'zod';
7
- import * as Contracts from '@objectstack/spec/contracts';
8
- import { ISeedLoaderService, IDataEngine, IMetadataService } from '@objectstack/spec/contracts';
9
- import { SeedLoaderRequest, SeedLoaderResult, ObjectDependencyGraph, Seed, SeedLoaderConfigInput, ExpressionBody, ScriptBody, HookBody, Hook } from '@objectstack/spec/data';
7
+ export { SeedLoaderService } from '@objectstack/objectql';
10
8
  import { SchemaDiffEntry } from '@objectstack/spec/shared';
11
9
  import { MetricsRegistry, ErrorReporter } from '@objectstack/observability';
12
10
  export { CapturedError, ErrorReporter, InMemoryErrorReporter, InMemoryMetricsRegistry, MetricSample, MetricsRegistry, NoopErrorReporter, NoopMetricsRegistry, OBSERVABILITY_ERRORS_SERVICE, OBSERVABILITY_METRICS_SERVICE, RUNTIME_METRICS } from '@objectstack/observability';
11
+ import * as Contracts from '@objectstack/spec/contracts';
13
12
  import { MiddlewareConfig, MiddlewareType } from '@objectstack/spec/system';
13
+ import { ExpressionBody, ScriptBody, HookBody, Hook } from '@objectstack/spec/data';
14
14
  export { RestApiPluginConfig, RestServer, RouteEntry, RouteGroupBuilder, RouteManager, createRestApiPlugin } from '@objectstack/rest';
15
15
  export { _resetEnvDeprecationWarnings, readEnvWithDeprecation } from '@objectstack/types';
16
16
 
@@ -301,58 +301,6 @@ declare function collectBundleActions(bundle: any): Array<{
301
301
  */
302
302
  declare function collectBundleFunctions(bundle: any): Record<string, (ctx: any) => any>;
303
303
 
304
- interface Logger {
305
- info(message: string, meta?: Record<string, any>): void;
306
- warn(message: string, meta?: Record<string, any>): void;
307
- error(message: string, error?: Error, meta?: Record<string, any>): void;
308
- debug(message: string, meta?: Record<string, any>): void;
309
- }
310
- /**
311
- * SeedLoaderService — Runtime implementation of ISeedLoaderService
312
- *
313
- * Provides metadata-driven seed data loading with:
314
- * - Automatic lookup/master_detail reference resolution via externalId
315
- * - Topological dependency ordering (parents before children)
316
- * - Multi-pass loading for circular references
317
- * - Dry-run validation mode
318
- * - Upsert support honoring SeedSchema mode
319
- * - Actionable error reporting
320
- */
321
- declare class SeedLoaderService implements ISeedLoaderService {
322
- private engine;
323
- private metadata;
324
- private logger;
325
- constructor(engine: IDataEngine, metadata: IMetadataService, logger: Logger);
326
- load(request: SeedLoaderRequest): Promise<SeedLoaderResult>;
327
- buildDependencyGraph(objectNames: string[]): Promise<ObjectDependencyGraph>;
328
- validate(datasets: Seed[], config?: SeedLoaderConfigInput): Promise<SeedLoaderResult>;
329
- private loadDataset;
330
- private resolveFromDatabase;
331
- private resolveDeferredUpdates;
332
- /**
333
- * Seed writes always run as a privileged system context. This bypasses
334
- * RBAC checks (so seeds can target system tables like `sys_*`) and
335
- * disables the SecurityPlugin's auto-injection of `organization_id` /
336
- * `owner_id` — seeds either declare those fields explicitly per
337
- * record, or are intentionally cross-tenant / global.
338
- */
339
- private static readonly SEED_OPTIONS;
340
- private writeRecord;
341
- /**
342
- * Kahn's algorithm for topological sort with cycle detection.
343
- */
344
- private topologicalSort;
345
- private findCycles;
346
- private filterByEnv;
347
- private orderDatasets;
348
- private buildReferenceMap;
349
- private loadExistingRecords;
350
- private looksLikeInternalId;
351
- private extractId;
352
- private buildEmptyResult;
353
- private buildResult;
354
- }
355
-
356
304
  /**
357
305
  * Payload of the `external.schema.drift` event emitted on the kernel bus by the
358
306
  * background drift checker (ADR-0015 §5.2). Consumed by `audit` / `notification`
@@ -2261,4 +2209,4 @@ declare function actionBodyRunnerFactory(runner: ScriptRunner, opts: FactoryOpti
2261
2209
  timeoutMs?: number;
2262
2210
  }) => ((actionCtx: any) => Promise<unknown>) | undefined;
2263
2211
 
2264
- export { AppPlugin, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentDriverRegistry, type ExternalSchemaDriftEvent, ExternalValidationPlugin, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, type KernelManager, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, SeedLoaderService, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createExternalValidationPlugin, createStandaloneStack, createSystemEnvironmentPlugin, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId };
2212
+ export { AppPlugin, DEFAULT_CLOUD_URL, DEFAULT_RATE_LIMITS, type DefaultHostConfigOptions, type DefaultHostConfigResult, type DispatcherPluginConfig, DriverPlugin, type EnvironmentDriverRegistry, type ExternalSchemaDriftEvent, ExternalValidationPlugin, HttpDispatcher, type HttpDispatcherResult, type HttpProtocolContext, HttpServer, type KernelManager, type LoadArtifactBundleOptions, MarketplaceInstallLocalPlugin, type MarketplaceInstallLocalPluginConfig, MarketplaceProxyPlugin, type MarketplaceProxyPluginConfig, MiddlewareManager, ObservabilityServicePlugin, type ObservabilityServicePluginOptions, QuickJSScriptRunner, type QuickJSScriptRunnerOptions, type RateLimitBucketConfig, type RateLimitDecision, type RateLimitDefaults, type RateLimitStore, RateLimiter, Runtime, type RuntimeConfig, RuntimeConfigPlugin, type RuntimeConfigPluginConfig, SYSTEM_ENVIRONMENT_ID, SandboxError, type ScriptContext, type ScriptOrigin, type ScriptResult, type ScriptRunOptions, type ScriptRunner, type SecurityHeadersOptions, type StandaloneStackConfig, type StandaloneStackResult, type SystemEnvironmentPluginConfig, type TraceContext, UnimplementedScriptRunner, actionBodyRunnerFactory, buildSecurityHeaders, collectBundleActions, collectBundleFunctions, collectBundleHooks, createDefaultHostConfig, createDispatcherPlugin, createExternalValidationPlugin, createStandaloneStack, createSystemEnvironmentPlugin, extractRequestId, formatTraceparent, generateRequestId, hookBodyRunnerFactory, isHttpUrl, loadArtifactBundle, mergeRuntimeModule, parseTraceparent, readArtifactSource, resolveCloudUrl, resolveDefaultArtifactPath, resolveErrorReporter, resolveMetrics, resolveObjectStackHome, resolveRequestId };