@objectstack/core 4.0.1 → 4.0.2

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
@@ -1681,6 +1681,26 @@ declare function createMemoryI18n(): {
1681
1681
  setDefaultLocale(locale: string): void;
1682
1682
  };
1683
1683
 
1684
+ /**
1685
+ * In-memory metadata service fallback.
1686
+ *
1687
+ * Implements the IMetadataService contract with a simple Map-of-Maps store.
1688
+ * Used by ObjectKernel as an automatic fallback when no real metadata plugin
1689
+ * (e.g. MetadataPlugin with file-system persistence) is registered.
1690
+ */
1691
+ declare function createMemoryMetadata(): {
1692
+ _fallback: boolean;
1693
+ _serviceName: string;
1694
+ register(type: string, name: string, data: any): Promise<void>;
1695
+ get(type: string, name: string): Promise<any>;
1696
+ list(type: string): Promise<any[]>;
1697
+ unregister(type: string, name: string): Promise<void>;
1698
+ exists(type: string, name: string): Promise<boolean>;
1699
+ listNames(type: string): Promise<string[]>;
1700
+ getObject(name: string): Promise<any>;
1701
+ listObjects(): Promise<any[]>;
1702
+ };
1703
+
1684
1704
  /**
1685
1705
  * Map of core-criticality service names to their in-memory fallback factories.
1686
1706
  * Used by ObjectKernel.validateSystemRequirements() to auto-inject fallbacks
@@ -2113,4 +2133,4 @@ declare class PackageManager {
2113
2133
  getSnapshot(packageId: string): PackageSnapshot | undefined;
2114
2134
  }
2115
2135
 
2116
- export { ApiRegistry, type ApiRegistryPluginConfig, CORE_FALLBACK_FACTORIES, DependencyResolver, HotReloadManager, type InstallResult, type InstalledPackageRecord, type KernelState, LiteKernel, type NamespaceCheckResult, type NamespaceConflict, type NamespaceEntry, NamespaceResolver, ObjectKernel, ObjectKernelBase, type ObjectKernelConfig, ObjectLogger, PackageManager, type PackageSnapshot, type PermissionCheckResult$1 as PermissionCheckResult, type PermissionGrant, type Plugin, PluginConfigValidator, type PluginContext, PluginHealthMonitor, type PluginHealthStatus, type PluginLoadResult, PluginLoader, type PluginMetadata, type PermissionCheckResult as PluginPermissionCheckResult, PluginPermissionEnforcer, PluginPermissionManager, type PluginPermissions, PluginSandboxRuntime, PluginSecurityScanner, type PluginSignatureConfig, PluginSignatureVerifier, type PluginStartupResult, index as QA, type ResourceUsage, type RollbackResult, type SandboxContext, type ScanTarget, SecurePluginContext, type SecurityIssue, SemanticVersionManager, type ServiceFactory, ServiceLifecycle, type ServiceRegistration, type SignatureVerificationResult, type UpgradeResult, type VersionCompatibility, createApiRegistryPlugin, createLogger, createMemoryCache, createMemoryI18n, createMemoryJob, createMemoryQueue, createPluginConfigValidator, createPluginPermissionEnforcer, getEnv, getMemoryUsage, isNode, resolveLocale, safeExit };
2136
+ export { ApiRegistry, type ApiRegistryPluginConfig, CORE_FALLBACK_FACTORIES, DependencyResolver, HotReloadManager, type InstallResult, type InstalledPackageRecord, type KernelState, LiteKernel, type NamespaceCheckResult, type NamespaceConflict, type NamespaceEntry, NamespaceResolver, ObjectKernel, ObjectKernelBase, type ObjectKernelConfig, ObjectLogger, PackageManager, type PackageSnapshot, type PermissionCheckResult$1 as PermissionCheckResult, type PermissionGrant, type Plugin, PluginConfigValidator, type PluginContext, PluginHealthMonitor, type PluginHealthStatus, type PluginLoadResult, PluginLoader, type PluginMetadata, type PermissionCheckResult as PluginPermissionCheckResult, PluginPermissionEnforcer, PluginPermissionManager, type PluginPermissions, PluginSandboxRuntime, PluginSecurityScanner, type PluginSignatureConfig, PluginSignatureVerifier, type PluginStartupResult, index as QA, type ResourceUsage, type RollbackResult, type SandboxContext, type ScanTarget, SecurePluginContext, type SecurityIssue, SemanticVersionManager, type ServiceFactory, ServiceLifecycle, type ServiceRegistration, type SignatureVerificationResult, type UpgradeResult, type VersionCompatibility, createApiRegistryPlugin, createLogger, createMemoryCache, createMemoryI18n, createMemoryJob, createMemoryMetadata, createMemoryQueue, createPluginConfigValidator, createPluginPermissionEnforcer, getEnv, getMemoryUsage, isNode, resolveLocale, safeExit };
package/dist/index.d.ts CHANGED
@@ -1681,6 +1681,26 @@ declare function createMemoryI18n(): {
1681
1681
  setDefaultLocale(locale: string): void;
1682
1682
  };
1683
1683
 
1684
+ /**
1685
+ * In-memory metadata service fallback.
1686
+ *
1687
+ * Implements the IMetadataService contract with a simple Map-of-Maps store.
1688
+ * Used by ObjectKernel as an automatic fallback when no real metadata plugin
1689
+ * (e.g. MetadataPlugin with file-system persistence) is registered.
1690
+ */
1691
+ declare function createMemoryMetadata(): {
1692
+ _fallback: boolean;
1693
+ _serviceName: string;
1694
+ register(type: string, name: string, data: any): Promise<void>;
1695
+ get(type: string, name: string): Promise<any>;
1696
+ list(type: string): Promise<any[]>;
1697
+ unregister(type: string, name: string): Promise<void>;
1698
+ exists(type: string, name: string): Promise<boolean>;
1699
+ listNames(type: string): Promise<string[]>;
1700
+ getObject(name: string): Promise<any>;
1701
+ listObjects(): Promise<any[]>;
1702
+ };
1703
+
1684
1704
  /**
1685
1705
  * Map of core-criticality service names to their in-memory fallback factories.
1686
1706
  * Used by ObjectKernel.validateSystemRequirements() to auto-inject fallbacks
@@ -2113,4 +2133,4 @@ declare class PackageManager {
2113
2133
  getSnapshot(packageId: string): PackageSnapshot | undefined;
2114
2134
  }
2115
2135
 
2116
- export { ApiRegistry, type ApiRegistryPluginConfig, CORE_FALLBACK_FACTORIES, DependencyResolver, HotReloadManager, type InstallResult, type InstalledPackageRecord, type KernelState, LiteKernel, type NamespaceCheckResult, type NamespaceConflict, type NamespaceEntry, NamespaceResolver, ObjectKernel, ObjectKernelBase, type ObjectKernelConfig, ObjectLogger, PackageManager, type PackageSnapshot, type PermissionCheckResult$1 as PermissionCheckResult, type PermissionGrant, type Plugin, PluginConfigValidator, type PluginContext, PluginHealthMonitor, type PluginHealthStatus, type PluginLoadResult, PluginLoader, type PluginMetadata, type PermissionCheckResult as PluginPermissionCheckResult, PluginPermissionEnforcer, PluginPermissionManager, type PluginPermissions, PluginSandboxRuntime, PluginSecurityScanner, type PluginSignatureConfig, PluginSignatureVerifier, type PluginStartupResult, index as QA, type ResourceUsage, type RollbackResult, type SandboxContext, type ScanTarget, SecurePluginContext, type SecurityIssue, SemanticVersionManager, type ServiceFactory, ServiceLifecycle, type ServiceRegistration, type SignatureVerificationResult, type UpgradeResult, type VersionCompatibility, createApiRegistryPlugin, createLogger, createMemoryCache, createMemoryI18n, createMemoryJob, createMemoryQueue, createPluginConfigValidator, createPluginPermissionEnforcer, getEnv, getMemoryUsage, isNode, resolveLocale, safeExit };
2136
+ export { ApiRegistry, type ApiRegistryPluginConfig, CORE_FALLBACK_FACTORIES, DependencyResolver, HotReloadManager, type InstallResult, type InstalledPackageRecord, type KernelState, LiteKernel, type NamespaceCheckResult, type NamespaceConflict, type NamespaceEntry, NamespaceResolver, ObjectKernel, ObjectKernelBase, type ObjectKernelConfig, ObjectLogger, PackageManager, type PackageSnapshot, type PermissionCheckResult$1 as PermissionCheckResult, type PermissionGrant, type Plugin, PluginConfigValidator, type PluginContext, PluginHealthMonitor, type PluginHealthStatus, type PluginLoadResult, PluginLoader, type PluginMetadata, type PermissionCheckResult as PluginPermissionCheckResult, PluginPermissionEnforcer, PluginPermissionManager, type PluginPermissions, PluginSandboxRuntime, PluginSecurityScanner, type PluginSignatureConfig, PluginSignatureVerifier, type PluginStartupResult, index as QA, type ResourceUsage, type RollbackResult, type SandboxContext, type ScanTarget, SecurePluginContext, type SecurityIssue, SemanticVersionManager, type ServiceFactory, ServiceLifecycle, type ServiceRegistration, type SignatureVerificationResult, type UpgradeResult, type VersionCompatibility, createApiRegistryPlugin, createLogger, createMemoryCache, createMemoryI18n, createMemoryJob, createMemoryMetadata, createMemoryQueue, createPluginConfigValidator, createPluginPermissionEnforcer, getEnv, getMemoryUsage, isNode, resolveLocale, safeExit };
package/dist/index.js CHANGED
@@ -1091,8 +1091,50 @@ function createMemoryI18n() {
1091
1091
  };
1092
1092
  }
1093
1093
 
1094
+ // src/fallbacks/memory-metadata.ts
1095
+ function createMemoryMetadata() {
1096
+ const store = /* @__PURE__ */ new Map();
1097
+ function getTypeMap(type) {
1098
+ let map = store.get(type);
1099
+ if (!map) {
1100
+ map = /* @__PURE__ */ new Map();
1101
+ store.set(type, map);
1102
+ }
1103
+ return map;
1104
+ }
1105
+ return {
1106
+ _fallback: true,
1107
+ _serviceName: "metadata",
1108
+ async register(type, name, data) {
1109
+ getTypeMap(type).set(name, data);
1110
+ },
1111
+ async get(type, name) {
1112
+ return getTypeMap(type).get(name);
1113
+ },
1114
+ async list(type) {
1115
+ return Array.from(getTypeMap(type).values());
1116
+ },
1117
+ async unregister(type, name) {
1118
+ getTypeMap(type).delete(name);
1119
+ },
1120
+ async exists(type, name) {
1121
+ return getTypeMap(type).has(name);
1122
+ },
1123
+ async listNames(type) {
1124
+ return Array.from(getTypeMap(type).keys());
1125
+ },
1126
+ async getObject(name) {
1127
+ return getTypeMap("object").get(name);
1128
+ },
1129
+ async listObjects() {
1130
+ return Array.from(getTypeMap("object").values());
1131
+ }
1132
+ };
1133
+ }
1134
+
1094
1135
  // src/fallbacks/index.ts
1095
1136
  var CORE_FALLBACK_FACTORIES = {
1137
+ metadata: createMemoryMetadata,
1096
1138
  cache: createMemoryCache,
1097
1139
  queue: createMemoryQueue,
1098
1140
  job: createMemoryJob,
@@ -4920,6 +4962,7 @@ export {
4920
4962
  createMemoryCache,
4921
4963
  createMemoryI18n,
4922
4964
  createMemoryJob,
4965
+ createMemoryMetadata,
4923
4966
  createMemoryQueue,
4924
4967
  createPluginConfigValidator,
4925
4968
  createPluginPermissionEnforcer,