@objectstack/objectql 2.0.6 → 2.0.7

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @objectstack/objectql@2.0.6 build /home/runner/work/spec/spec/packages/objectql
2
+ > @objectstack/objectql@2.0.7 build /home/runner/work/spec/spec/packages/objectql
3
3
  > tsup --config ../../tsup.config.ts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -10,13 +10,13 @@
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
12
  CJS Build start
13
- ESM dist/index.mjs 71.78 KB
14
- ESM dist/index.mjs.map 145.78 KB
15
- ESM ⚡️ Build success in 80ms
16
- CJS dist/index.js 73.33 KB
17
- CJS dist/index.js.map 146.65 KB
18
- CJS ⚡️ Build success in 82ms
13
+ CJS dist/index.js 73.19 KB
14
+ CJS dist/index.js.map 146.61 KB
15
+ CJS ⚡️ Build success in 118ms
16
+ ESM dist/index.mjs 71.64 KB
17
+ ESM dist/index.mjs.map 145.73 KB
18
+ ESM ⚡️ Build success in 146ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 12684ms
21
- DTS dist/index.d.mts 70.72 KB
22
- DTS dist/index.d.ts 70.72 KB
20
+ DTS ⚡️ Build success in 13509ms
21
+ DTS dist/index.d.mts 71.96 KB
22
+ DTS dist/index.d.ts 71.96 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @objectstack/objectql
2
2
 
3
+ ## 2.0.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @objectstack/spec@2.0.7
9
+ - @objectstack/core@2.0.7
10
+ - @objectstack/types@2.0.7
11
+
3
12
  ## 2.0.6
4
13
 
5
14
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -454,11 +454,19 @@ declare class SchemaRegistry {
454
454
  keyPrefix?: string | undefined;
455
455
  } | {
456
456
  name: string;
457
- label: string;
457
+ label: string | {
458
+ key: string;
459
+ defaultValue?: string | undefined;
460
+ params?: Record<string, any> | undefined;
461
+ };
458
462
  active: boolean;
459
463
  isDefault: boolean;
460
464
  version?: string | undefined;
461
- description?: string | undefined;
465
+ description?: string | {
466
+ key: string;
467
+ defaultValue?: string | undefined;
468
+ params?: Record<string, any> | undefined;
469
+ } | undefined;
462
470
  icon?: string | undefined;
463
471
  branding?: {
464
472
  primaryColor?: string | undefined;
@@ -470,11 +478,24 @@ declare class SchemaRegistry {
470
478
  requiredPermissions?: string[] | undefined;
471
479
  objects?: unknown[] | undefined;
472
480
  apis?: unknown[] | undefined;
481
+ mobileNavigation?: {
482
+ mode: "drawer" | "bottom_nav" | "hamburger";
483
+ bottomNavItems?: string[] | undefined;
484
+ } | undefined;
485
+ aria?: {
486
+ ariaLabel?: string | {
487
+ key: string;
488
+ defaultValue?: string | undefined;
489
+ params?: Record<string, any> | undefined;
490
+ } | undefined;
491
+ ariaDescribedBy?: string | undefined;
492
+ role?: string | undefined;
493
+ } | undefined;
473
494
  } | {
474
495
  manifest: {
475
496
  id: string;
476
497
  version: string;
477
- type: "theme" | "driver" | "app" | "server" | "ui" | "agent" | "objectql" | "plugin" | "module" | "gateway" | "adapter";
498
+ type: "theme" | "driver" | "app" | "server" | "ui" | "module" | "agent" | "objectql" | "plugin" | "gateway" | "adapter";
478
499
  name: string;
479
500
  namespace?: string | undefined;
480
501
  description?: string | undefined;
@@ -542,6 +563,11 @@ declare class SchemaRegistry {
542
563
  service: string;
543
564
  methods?: string[] | undefined;
544
565
  }[] | undefined;
566
+ commands?: {
567
+ name: string;
568
+ description?: string | undefined;
569
+ module?: string | undefined;
570
+ }[] | undefined;
545
571
  } | undefined;
546
572
  data?: {
547
573
  object: string;
@@ -636,7 +662,7 @@ declare class SchemaRegistry {
636
662
  preload?: {
637
663
  enabled: boolean;
638
664
  priority: number;
639
- resources?: ("dependencies" | "code" | "metadata" | "assets" | "services")[] | undefined;
665
+ resources?: ("dependencies" | "code" | "metadata" | "services" | "assets")[] | undefined;
640
666
  conditions?: {
641
667
  routes?: string[] | undefined;
642
668
  roles?: string[] | undefined;
@@ -680,7 +706,7 @@ declare class SchemaRegistry {
680
706
  healthCheckInterval?: number | undefined;
681
707
  } | undefined;
682
708
  dependencyResolution?: {
683
- strategy: "strict" | "latest" | "compatible" | "pinned";
709
+ strategy: "strict" | "pinned" | "latest" | "compatible";
684
710
  conflictResolution: "latest" | "manual" | "fail" | "oldest";
685
711
  circularDependencies: "warn" | "error" | "allow";
686
712
  peerDependencies?: {
@@ -722,7 +748,7 @@ declare class SchemaRegistry {
722
748
  } | undefined;
723
749
  caching?: {
724
750
  enabled: boolean;
725
- storage: "hybrid" | "memory" | "disk" | "indexeddb";
751
+ storage: "hybrid" | "indexeddb" | "memory" | "disk";
726
752
  keyStrategy: "hash" | "version" | "timestamp";
727
753
  ttl?: number | undefined;
728
754
  maxSize?: number | undefined;
@@ -781,7 +807,7 @@ declare class SchemaRegistry {
781
807
  } | {
782
808
  id: string;
783
809
  version: string;
784
- type: "theme" | "driver" | "app" | "server" | "ui" | "agent" | "objectql" | "plugin" | "module" | "gateway" | "adapter";
810
+ type: "theme" | "driver" | "app" | "server" | "ui" | "module" | "agent" | "objectql" | "plugin" | "gateway" | "adapter";
785
811
  name: string;
786
812
  namespace?: string | undefined;
787
813
  description?: string | undefined;
@@ -849,6 +875,11 @@ declare class SchemaRegistry {
849
875
  service: string;
850
876
  methods?: string[] | undefined;
851
877
  }[] | undefined;
878
+ commands?: {
879
+ name: string;
880
+ description?: string | undefined;
881
+ module?: string | undefined;
882
+ }[] | undefined;
852
883
  } | undefined;
853
884
  data?: {
854
885
  object: string;
@@ -943,7 +974,7 @@ declare class SchemaRegistry {
943
974
  preload?: {
944
975
  enabled: boolean;
945
976
  priority: number;
946
- resources?: ("dependencies" | "code" | "metadata" | "assets" | "services")[] | undefined;
977
+ resources?: ("dependencies" | "code" | "metadata" | "services" | "assets")[] | undefined;
947
978
  conditions?: {
948
979
  routes?: string[] | undefined;
949
980
  roles?: string[] | undefined;
@@ -987,7 +1018,7 @@ declare class SchemaRegistry {
987
1018
  healthCheckInterval?: number | undefined;
988
1019
  } | undefined;
989
1020
  dependencyResolution?: {
990
- strategy: "strict" | "latest" | "compatible" | "pinned";
1021
+ strategy: "strict" | "pinned" | "latest" | "compatible";
991
1022
  conflictResolution: "latest" | "manual" | "fail" | "oldest";
992
1023
  circularDependencies: "warn" | "error" | "allow";
993
1024
  peerDependencies?: {
@@ -1029,7 +1060,7 @@ declare class SchemaRegistry {
1029
1060
  } | undefined;
1030
1061
  caching?: {
1031
1062
  enabled: boolean;
1032
- storage: "hybrid" | "memory" | "disk" | "indexeddb";
1063
+ storage: "hybrid" | "indexeddb" | "memory" | "disk";
1033
1064
  keyStrategy: "hash" | "version" | "timestamp";
1034
1065
  ttl?: number | undefined;
1035
1066
  maxSize?: number | undefined;
@@ -1126,18 +1157,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1126
1157
  getDiscovery(): Promise<{
1127
1158
  version: string;
1128
1159
  apiName: string;
1129
- capabilities: {
1130
- graphql: boolean;
1131
- search: boolean;
1132
- websockets: boolean;
1133
- files: boolean;
1134
- analytics: boolean;
1135
- ai: boolean;
1136
- workflow: boolean;
1137
- notifications: boolean;
1138
- i18n: boolean;
1139
- };
1140
- endpoints: {
1160
+ routes: {
1141
1161
  data: string;
1142
1162
  metadata: string;
1143
1163
  ui?: string | undefined;
@@ -1155,7 +1175,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1155
1175
  };
1156
1176
  services: Record<string, {
1157
1177
  enabled: boolean;
1158
- status: "degraded" | "available" | "unavailable" | "stub";
1178
+ status: "degraded" | "stub" | "available" | "unavailable";
1159
1179
  route?: string | undefined;
1160
1180
  provider?: string | undefined;
1161
1181
  message?: string | undefined;
@@ -1746,16 +1766,19 @@ declare class ScopedContext {
1746
1766
  * Provides a clean, injectable interface over SchemaRegistry.
1747
1767
  * Registered as the 'metadata' kernel service to eliminate
1748
1768
  * downstream packages needing to manually wrap SchemaRegistry.
1769
+ *
1770
+ * Implements the async IMetadataService interface.
1771
+ * Internally delegates to SchemaRegistry (in-memory) with Promise wrappers.
1749
1772
  */
1750
1773
  declare class MetadataFacade {
1751
1774
  /**
1752
1775
  * Register a metadata item
1753
1776
  */
1754
- register(type: string, definition: any): void;
1777
+ register(type: string, name: string, data: any): Promise<void>;
1755
1778
  /**
1756
1779
  * Get a metadata item by type and name
1757
1780
  */
1758
- get(type: string, name: string): any;
1781
+ get(type: string, name: string): Promise<any>;
1759
1782
  /**
1760
1783
  * Get the raw entry (with metadata wrapper)
1761
1784
  */
@@ -1763,23 +1786,31 @@ declare class MetadataFacade {
1763
1786
  /**
1764
1787
  * List all items of a type
1765
1788
  */
1766
- list(type: string): any[];
1789
+ list(type: string): Promise<any[]>;
1767
1790
  /**
1768
1791
  * Unregister a metadata item
1769
1792
  */
1770
- unregister(type: string, name: string): void;
1793
+ unregister(type: string, name: string): Promise<void>;
1794
+ /**
1795
+ * Check if a metadata item exists
1796
+ */
1797
+ exists(type: string, name: string): Promise<boolean>;
1798
+ /**
1799
+ * List all names of metadata items of a given type
1800
+ */
1801
+ listNames(type: string): Promise<string[]>;
1771
1802
  /**
1772
1803
  * Unregister all metadata from a package
1773
1804
  */
1774
- unregisterPackage(packageName: string): void;
1805
+ unregisterPackage(packageName: string): Promise<void>;
1775
1806
  /**
1776
1807
  * Convenience: get object definition
1777
1808
  */
1778
- getObject(name: string): any;
1809
+ getObject(name: string): Promise<any>;
1779
1810
  /**
1780
1811
  * Convenience: list all objects
1781
1812
  */
1782
- listObjects(): any[];
1813
+ listObjects(): Promise<any[]>;
1783
1814
  }
1784
1815
 
1785
1816
  declare class ObjectQLPlugin implements Plugin {
package/dist/index.d.ts CHANGED
@@ -454,11 +454,19 @@ declare class SchemaRegistry {
454
454
  keyPrefix?: string | undefined;
455
455
  } | {
456
456
  name: string;
457
- label: string;
457
+ label: string | {
458
+ key: string;
459
+ defaultValue?: string | undefined;
460
+ params?: Record<string, any> | undefined;
461
+ };
458
462
  active: boolean;
459
463
  isDefault: boolean;
460
464
  version?: string | undefined;
461
- description?: string | undefined;
465
+ description?: string | {
466
+ key: string;
467
+ defaultValue?: string | undefined;
468
+ params?: Record<string, any> | undefined;
469
+ } | undefined;
462
470
  icon?: string | undefined;
463
471
  branding?: {
464
472
  primaryColor?: string | undefined;
@@ -470,11 +478,24 @@ declare class SchemaRegistry {
470
478
  requiredPermissions?: string[] | undefined;
471
479
  objects?: unknown[] | undefined;
472
480
  apis?: unknown[] | undefined;
481
+ mobileNavigation?: {
482
+ mode: "drawer" | "bottom_nav" | "hamburger";
483
+ bottomNavItems?: string[] | undefined;
484
+ } | undefined;
485
+ aria?: {
486
+ ariaLabel?: string | {
487
+ key: string;
488
+ defaultValue?: string | undefined;
489
+ params?: Record<string, any> | undefined;
490
+ } | undefined;
491
+ ariaDescribedBy?: string | undefined;
492
+ role?: string | undefined;
493
+ } | undefined;
473
494
  } | {
474
495
  manifest: {
475
496
  id: string;
476
497
  version: string;
477
- type: "theme" | "driver" | "app" | "server" | "ui" | "agent" | "objectql" | "plugin" | "module" | "gateway" | "adapter";
498
+ type: "theme" | "driver" | "app" | "server" | "ui" | "module" | "agent" | "objectql" | "plugin" | "gateway" | "adapter";
478
499
  name: string;
479
500
  namespace?: string | undefined;
480
501
  description?: string | undefined;
@@ -542,6 +563,11 @@ declare class SchemaRegistry {
542
563
  service: string;
543
564
  methods?: string[] | undefined;
544
565
  }[] | undefined;
566
+ commands?: {
567
+ name: string;
568
+ description?: string | undefined;
569
+ module?: string | undefined;
570
+ }[] | undefined;
545
571
  } | undefined;
546
572
  data?: {
547
573
  object: string;
@@ -636,7 +662,7 @@ declare class SchemaRegistry {
636
662
  preload?: {
637
663
  enabled: boolean;
638
664
  priority: number;
639
- resources?: ("dependencies" | "code" | "metadata" | "assets" | "services")[] | undefined;
665
+ resources?: ("dependencies" | "code" | "metadata" | "services" | "assets")[] | undefined;
640
666
  conditions?: {
641
667
  routes?: string[] | undefined;
642
668
  roles?: string[] | undefined;
@@ -680,7 +706,7 @@ declare class SchemaRegistry {
680
706
  healthCheckInterval?: number | undefined;
681
707
  } | undefined;
682
708
  dependencyResolution?: {
683
- strategy: "strict" | "latest" | "compatible" | "pinned";
709
+ strategy: "strict" | "pinned" | "latest" | "compatible";
684
710
  conflictResolution: "latest" | "manual" | "fail" | "oldest";
685
711
  circularDependencies: "warn" | "error" | "allow";
686
712
  peerDependencies?: {
@@ -722,7 +748,7 @@ declare class SchemaRegistry {
722
748
  } | undefined;
723
749
  caching?: {
724
750
  enabled: boolean;
725
- storage: "hybrid" | "memory" | "disk" | "indexeddb";
751
+ storage: "hybrid" | "indexeddb" | "memory" | "disk";
726
752
  keyStrategy: "hash" | "version" | "timestamp";
727
753
  ttl?: number | undefined;
728
754
  maxSize?: number | undefined;
@@ -781,7 +807,7 @@ declare class SchemaRegistry {
781
807
  } | {
782
808
  id: string;
783
809
  version: string;
784
- type: "theme" | "driver" | "app" | "server" | "ui" | "agent" | "objectql" | "plugin" | "module" | "gateway" | "adapter";
810
+ type: "theme" | "driver" | "app" | "server" | "ui" | "module" | "agent" | "objectql" | "plugin" | "gateway" | "adapter";
785
811
  name: string;
786
812
  namespace?: string | undefined;
787
813
  description?: string | undefined;
@@ -849,6 +875,11 @@ declare class SchemaRegistry {
849
875
  service: string;
850
876
  methods?: string[] | undefined;
851
877
  }[] | undefined;
878
+ commands?: {
879
+ name: string;
880
+ description?: string | undefined;
881
+ module?: string | undefined;
882
+ }[] | undefined;
852
883
  } | undefined;
853
884
  data?: {
854
885
  object: string;
@@ -943,7 +974,7 @@ declare class SchemaRegistry {
943
974
  preload?: {
944
975
  enabled: boolean;
945
976
  priority: number;
946
- resources?: ("dependencies" | "code" | "metadata" | "assets" | "services")[] | undefined;
977
+ resources?: ("dependencies" | "code" | "metadata" | "services" | "assets")[] | undefined;
947
978
  conditions?: {
948
979
  routes?: string[] | undefined;
949
980
  roles?: string[] | undefined;
@@ -987,7 +1018,7 @@ declare class SchemaRegistry {
987
1018
  healthCheckInterval?: number | undefined;
988
1019
  } | undefined;
989
1020
  dependencyResolution?: {
990
- strategy: "strict" | "latest" | "compatible" | "pinned";
1021
+ strategy: "strict" | "pinned" | "latest" | "compatible";
991
1022
  conflictResolution: "latest" | "manual" | "fail" | "oldest";
992
1023
  circularDependencies: "warn" | "error" | "allow";
993
1024
  peerDependencies?: {
@@ -1029,7 +1060,7 @@ declare class SchemaRegistry {
1029
1060
  } | undefined;
1030
1061
  caching?: {
1031
1062
  enabled: boolean;
1032
- storage: "hybrid" | "memory" | "disk" | "indexeddb";
1063
+ storage: "hybrid" | "indexeddb" | "memory" | "disk";
1033
1064
  keyStrategy: "hash" | "version" | "timestamp";
1034
1065
  ttl?: number | undefined;
1035
1066
  maxSize?: number | undefined;
@@ -1126,18 +1157,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1126
1157
  getDiscovery(): Promise<{
1127
1158
  version: string;
1128
1159
  apiName: string;
1129
- capabilities: {
1130
- graphql: boolean;
1131
- search: boolean;
1132
- websockets: boolean;
1133
- files: boolean;
1134
- analytics: boolean;
1135
- ai: boolean;
1136
- workflow: boolean;
1137
- notifications: boolean;
1138
- i18n: boolean;
1139
- };
1140
- endpoints: {
1160
+ routes: {
1141
1161
  data: string;
1142
1162
  metadata: string;
1143
1163
  ui?: string | undefined;
@@ -1155,7 +1175,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1155
1175
  };
1156
1176
  services: Record<string, {
1157
1177
  enabled: boolean;
1158
- status: "degraded" | "available" | "unavailable" | "stub";
1178
+ status: "degraded" | "stub" | "available" | "unavailable";
1159
1179
  route?: string | undefined;
1160
1180
  provider?: string | undefined;
1161
1181
  message?: string | undefined;
@@ -1746,16 +1766,19 @@ declare class ScopedContext {
1746
1766
  * Provides a clean, injectable interface over SchemaRegistry.
1747
1767
  * Registered as the 'metadata' kernel service to eliminate
1748
1768
  * downstream packages needing to manually wrap SchemaRegistry.
1769
+ *
1770
+ * Implements the async IMetadataService interface.
1771
+ * Internally delegates to SchemaRegistry (in-memory) with Promise wrappers.
1749
1772
  */
1750
1773
  declare class MetadataFacade {
1751
1774
  /**
1752
1775
  * Register a metadata item
1753
1776
  */
1754
- register(type: string, definition: any): void;
1777
+ register(type: string, name: string, data: any): Promise<void>;
1755
1778
  /**
1756
1779
  * Get a metadata item by type and name
1757
1780
  */
1758
- get(type: string, name: string): any;
1781
+ get(type: string, name: string): Promise<any>;
1759
1782
  /**
1760
1783
  * Get the raw entry (with metadata wrapper)
1761
1784
  */
@@ -1763,23 +1786,31 @@ declare class MetadataFacade {
1763
1786
  /**
1764
1787
  * List all items of a type
1765
1788
  */
1766
- list(type: string): any[];
1789
+ list(type: string): Promise<any[]>;
1767
1790
  /**
1768
1791
  * Unregister a metadata item
1769
1792
  */
1770
- unregister(type: string, name: string): void;
1793
+ unregister(type: string, name: string): Promise<void>;
1794
+ /**
1795
+ * Check if a metadata item exists
1796
+ */
1797
+ exists(type: string, name: string): Promise<boolean>;
1798
+ /**
1799
+ * List all names of metadata items of a given type
1800
+ */
1801
+ listNames(type: string): Promise<string[]>;
1771
1802
  /**
1772
1803
  * Unregister all metadata from a package
1773
1804
  */
1774
- unregisterPackage(packageName: string): void;
1805
+ unregisterPackage(packageName: string): Promise<void>;
1775
1806
  /**
1776
1807
  * Convenience: get object definition
1777
1808
  */
1778
- getObject(name: string): any;
1809
+ getObject(name: string): Promise<any>;
1779
1810
  /**
1780
1811
  * Convenience: list all objects
1781
1812
  */
1782
- listObjects(): any[];
1813
+ listObjects(): Promise<any[]>;
1783
1814
  }
1784
1815
 
1785
1816
  declare class ObjectQLPlugin implements Plugin {
package/dist/index.js CHANGED
@@ -539,19 +539,20 @@ function simpleHash(str) {
539
539
  }
540
540
  var SERVICE_CONFIG = {
541
541
  auth: { route: "/api/v1/auth", plugin: "plugin-auth" },
542
- automation: { route: "/api/v1/automation", plugin: "plugin-automation", capability: "workflow" },
542
+ automation: { route: "/api/v1/automation", plugin: "plugin-automation" },
543
543
  cache: { route: "/api/v1/cache", plugin: "plugin-redis" },
544
544
  queue: { route: "/api/v1/queue", plugin: "plugin-bullmq" },
545
545
  job: { route: "/api/v1/jobs", plugin: "job-scheduler" },
546
546
  ui: { route: "/api/v1/ui", plugin: "ui-plugin" },
547
- workflow: { route: "/api/v1/workflow", plugin: "plugin-workflow", capability: "workflow" },
548
- realtime: { route: "/api/v1/realtime", plugin: "plugin-realtime", capability: "websockets" },
549
- notification: { route: "/api/v1/notifications", plugin: "plugin-notifications", capability: "notifications" },
550
- ai: { route: "/api/v1/ai", plugin: "plugin-ai", capability: "ai" },
551
- i18n: { route: "/api/v1/i18n", plugin: "plugin-i18n", capability: "i18n" },
552
- graphql: { route: "/graphql", plugin: "plugin-graphql", capability: "graphql" },
553
- "file-storage": { route: "/api/v1/storage", plugin: "plugin-storage", capability: "files" },
554
- search: { route: "/api/v1/search", plugin: "plugin-search", capability: "search" }
547
+ workflow: { route: "/api/v1/workflow", plugin: "plugin-workflow" },
548
+ realtime: { route: "/api/v1/realtime", plugin: "plugin-realtime" },
549
+ notification: { route: "/api/v1/notifications", plugin: "plugin-notifications" },
550
+ ai: { route: "/api/v1/ai", plugin: "plugin-ai" },
551
+ i18n: { route: "/api/v1/i18n", plugin: "plugin-i18n" },
552
+ graphql: { route: "/graphql", plugin: "plugin-graphql" },
553
+ // GraphQL uses /graphql by convention (not versioned REST)
554
+ "file-storage": { route: "/api/v1/storage", plugin: "plugin-storage" },
555
+ search: { route: "/api/v1/search", plugin: "plugin-search" }
555
556
  };
556
557
  var ObjectStackProtocolImplementation = class {
557
558
  constructor(engine, getServicesRegistry) {
@@ -562,9 +563,9 @@ var ObjectStackProtocolImplementation = class {
562
563
  const registeredServices = this.getServicesRegistry ? this.getServicesRegistry() : /* @__PURE__ */ new Map();
563
564
  const services = {
564
565
  // --- Kernel-provided (objectql is an example kernel implementation) ---
565
- metadata: { enabled: true, status: "degraded", route: "/api/meta", provider: "objectql", message: "In-memory registry only; DB persistence not yet implemented" },
566
- data: { enabled: true, status: "available", route: "/api/data", provider: "objectql" },
567
- analytics: { enabled: true, status: "available", route: "/api/analytics", provider: "objectql" }
566
+ metadata: { enabled: true, status: "degraded", route: "/api/v1/meta", provider: "objectql", message: "In-memory registry only; DB persistence not yet implemented" },
567
+ data: { enabled: true, status: "available", route: "/api/v1/data", provider: "objectql" },
568
+ analytics: { enabled: true, status: "available", route: "/api/v1/analytics", provider: "objectql" }
568
569
  };
569
570
  for (const [serviceName, config] of Object.entries(SERVICE_CONFIG)) {
570
571
  if (registeredServices.has(serviceName)) {
@@ -582,19 +583,7 @@ var ObjectStackProtocolImplementation = class {
582
583
  };
583
584
  }
584
585
  }
585
- const capabilities = {
586
- graphql: registeredServices.has("graphql"),
587
- search: registeredServices.has("search"),
588
- websockets: registeredServices.has("realtime"),
589
- files: registeredServices.has("file-storage"),
590
- analytics: true,
591
- // Always available via objectql
592
- ai: registeredServices.has("ai"),
593
- workflow: registeredServices.has("workflow") || registeredServices.has("automation"),
594
- notifications: registeredServices.has("notification"),
595
- i18n: registeredServices.has("i18n")
596
- };
597
- const serviceToEndpointKey = {
586
+ const serviceToRouteKey = {
598
587
  auth: "auth",
599
588
  automation: "automation",
600
589
  ui: "ui",
@@ -606,27 +595,26 @@ var ObjectStackProtocolImplementation = class {
606
595
  graphql: "graphql",
607
596
  "file-storage": "storage"
608
597
  };
609
- const optionalEndpoints = {
610
- analytics: "/api/analytics"
598
+ const optionalRoutes = {
599
+ analytics: "/api/v1/analytics"
611
600
  };
612
601
  for (const [serviceName, config] of Object.entries(SERVICE_CONFIG)) {
613
602
  if (registeredServices.has(serviceName)) {
614
- const endpointKey = serviceToEndpointKey[serviceName];
615
- if (endpointKey) {
616
- optionalEndpoints[endpointKey] = config.route;
603
+ const routeKey = serviceToRouteKey[serviceName];
604
+ if (routeKey) {
605
+ optionalRoutes[routeKey] = config.route;
617
606
  }
618
607
  }
619
608
  }
620
- const endpoints = {
621
- data: "/api/data",
622
- metadata: "/api/meta",
623
- ...optionalEndpoints
609
+ const routes = {
610
+ data: "/api/v1/data",
611
+ metadata: "/api/v1/meta",
612
+ ...optionalRoutes
624
613
  };
625
614
  return {
626
615
  version: "1.0",
627
616
  apiName: "ObjectStack API",
628
- capabilities,
629
- endpoints,
617
+ routes,
630
618
  services
631
619
  };
632
620
  }
@@ -1939,7 +1927,8 @@ var MetadataFacade = class {
1939
1927
  /**
1940
1928
  * Register a metadata item
1941
1929
  */
1942
- register(type, definition) {
1930
+ async register(type, name, data) {
1931
+ const definition = typeof data === "object" && data !== null ? { ...data, name: data.name ?? name } : data;
1943
1932
  if (type === "object") {
1944
1933
  SchemaRegistry.registerItem(type, definition, "name");
1945
1934
  } else {
@@ -1949,7 +1938,7 @@ var MetadataFacade = class {
1949
1938
  /**
1950
1939
  * Get a metadata item by type and name
1951
1940
  */
1952
- get(type, name) {
1941
+ async get(type, name) {
1953
1942
  const item = SchemaRegistry.getItem(type, name);
1954
1943
  return item?.content ?? item;
1955
1944
  }
@@ -1962,32 +1951,46 @@ var MetadataFacade = class {
1962
1951
  /**
1963
1952
  * List all items of a type
1964
1953
  */
1965
- list(type) {
1954
+ async list(type) {
1966
1955
  const items = SchemaRegistry.listItems(type);
1967
1956
  return items.map((item) => item?.content ?? item);
1968
1957
  }
1969
1958
  /**
1970
1959
  * Unregister a metadata item
1971
1960
  */
1972
- unregister(type, name) {
1961
+ async unregister(type, name) {
1973
1962
  SchemaRegistry.unregisterItem(type, name);
1974
1963
  }
1964
+ /**
1965
+ * Check if a metadata item exists
1966
+ */
1967
+ async exists(type, name) {
1968
+ const item = SchemaRegistry.getItem(type, name);
1969
+ return item !== void 0 && item !== null;
1970
+ }
1971
+ /**
1972
+ * List all names of metadata items of a given type
1973
+ */
1974
+ async listNames(type) {
1975
+ const items = SchemaRegistry.listItems(type);
1976
+ return items.map((item) => item?.name ?? item?.content?.name ?? "").filter(Boolean);
1977
+ }
1975
1978
  /**
1976
1979
  * Unregister all metadata from a package
1977
1980
  */
1978
- unregisterPackage(packageName) {
1981
+ async unregisterPackage(packageName) {
1979
1982
  SchemaRegistry.unregisterObjectsByPackage(packageName);
1980
1983
  }
1981
1984
  /**
1982
1985
  * Convenience: get object definition
1983
1986
  */
1984
- getObject(name) {
1987
+ async getObject(name) {
1985
1988
  return SchemaRegistry.getObject(name);
1986
1989
  }
1987
1990
  /**
1988
1991
  * Convenience: list all objects
1989
1992
  */
1990
- listObjects() {
1993
+ async listObjects() {
1991
1994
  return SchemaRegistry.getAllObjects();
1992
1995
  }
1993
1996
  };