@objectstack/objectql 3.3.0 → 4.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @objectstack/objectql@3.3.0 build /home/runner/work/spec/spec/packages/objectql
2
+ > @objectstack/objectql@4.0.0 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
- CJS dist/index.js 98.69 KB
14
- CJS dist/index.js.map 199.38 KB
15
- CJS ⚡️ Build success in 147ms
16
- ESM dist/index.mjs 96.95 KB
17
- ESM dist/index.mjs.map 198.08 KB
18
- ESM ⚡️ Build success in 148ms
13
+ ESM dist/index.mjs 102.95 KB
14
+ ESM dist/index.mjs.map 211.04 KB
15
+ ESM ⚡️ Build success in 184ms
16
+ CJS dist/index.js 104.68 KB
17
+ CJS dist/index.js.map 212.34 KB
18
+ CJS ⚡️ Build success in 187ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 25675ms
21
- DTS dist/index.d.mts 78.59 KB
22
- DTS dist/index.d.ts 78.59 KB
20
+ DTS ⚡️ Build success in 20424ms
21
+ DTS dist/index.d.mts 79.12 KB
22
+ DTS dist/index.d.ts 79.12 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @objectstack/objectql
2
2
 
3
+ ## 4.0.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e0b0a78: Deprecate DataEngineQueryOptions in favor of QueryAST-aligned EngineQueryOptions.
8
+
9
+ Engine, Protocol, and Client now use standard QueryAST parameter names:
10
+
11
+ - `filter` → `where`
12
+ - `select` → `fields`
13
+ - `sort` → `orderBy`
14
+ - `skip` → `offset`
15
+ - `populate` → `expand`
16
+ - `top` → `limit`
17
+
18
+ The old DataEngine\* schemas and types are preserved with `@deprecated` markers for backward compatibility.
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [f08ffc3]
23
+ - Updated dependencies [e0b0a78]
24
+ - @objectstack/spec@4.0.0
25
+ - @objectstack/core@4.0.0
26
+ - @objectstack/types@4.0.0
27
+
28
+ ## 3.3.1
29
+
30
+ ### Patch Changes
31
+
32
+ - @objectstack/spec@3.3.1
33
+ - @objectstack/core@3.3.1
34
+ - @objectstack/types@3.3.1
35
+
3
36
  ## 3.3.0
4
37
 
5
38
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import * as _objectstack_spec_data from '@objectstack/spec/data';
3
- import { ServiceObject, ObjectOwnership, HookContext, QueryAST, DataEngineQueryOptions, DataEngineInsertOptions, DataEngineUpdateOptions, DataEngineDeleteOptions, DataEngineCountOptions, DataEngineAggregateOptions } from '@objectstack/spec/data';
3
+ import { ObjectOwnership, ServiceObject, QueryAST, HookContext, EngineQueryOptions, DataEngineInsertOptions, EngineUpdateOptions, EngineDeleteOptions, EngineCountOptions, EngineAggregateOptions } from '@objectstack/spec/data';
4
4
  import { ObjectStackManifest, InstalledPackage, ExecutionContext } from '@objectstack/spec/kernel';
5
5
  import { ObjectStackProtocol, MetadataCacheRequest, MetadataCacheResponse, BatchUpdateRequest, BatchUpdateResponse, UpdateManyDataRequest, DeleteManyDataRequest } from '@objectstack/spec/api';
6
6
  import { IDataEngine, DriverInterface, Logger, Plugin, PluginContext, ObjectKernel } from '@objectstack/core';
@@ -1289,6 +1289,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1289
1289
  routes: {
1290
1290
  data: string;
1291
1291
  metadata: string;
1292
+ discovery?: string | undefined;
1292
1293
  ui?: string | undefined;
1293
1294
  auth?: string | undefined;
1294
1295
  automation?: string | undefined;
@@ -1301,6 +1302,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1301
1302
  notifications?: string | undefined;
1302
1303
  ai?: string | undefined;
1303
1304
  i18n?: string | undefined;
1305
+ feed?: string | undefined;
1304
1306
  };
1305
1307
  services: Record<string, {
1306
1308
  enabled: boolean;
@@ -1316,15 +1318,10 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1316
1318
  retryAfterMs?: number | undefined;
1317
1319
  } | undefined;
1318
1320
  }>;
1319
- capabilities: {
1320
- feed: boolean;
1321
- comments: boolean;
1322
- automation: boolean;
1323
- cron: boolean;
1324
- search: boolean;
1325
- export: boolean;
1326
- chunkedUpload: boolean;
1327
- };
1321
+ capabilities: Record<string, {
1322
+ enabled: boolean;
1323
+ description?: string;
1324
+ }>;
1328
1325
  }>;
1329
1326
  getMetaTypes(): Promise<{
1330
1327
  types: string[];
@@ -1453,6 +1450,20 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1453
1450
  }): Promise<{
1454
1451
  success: boolean;
1455
1452
  message: string;
1453
+ warning?: undefined;
1454
+ } | {
1455
+ success: boolean;
1456
+ message: string;
1457
+ warning: any;
1458
+ }>;
1459
+ /**
1460
+ * Hydrate SchemaRegistry from the database on startup.
1461
+ * Loads all active metadata records and registers them in the in-memory registry.
1462
+ * Safe to call repeatedly — idempotent (latest DB record wins).
1463
+ */
1464
+ loadMetaFromDb(): Promise<{
1465
+ loaded: number;
1466
+ errors: number;
1456
1467
  }>;
1457
1468
  listFeed(request: any): Promise<any>;
1458
1469
  createFeedItem(request: any): Promise<any>;
@@ -1652,14 +1663,13 @@ declare class ObjectQL implements IDataEngine {
1652
1663
  * @returns Records with expanded lookup fields (IDs replaced by full objects)
1653
1664
  */
1654
1665
  private expandRelatedRecords;
1655
- private toQueryAST;
1656
- find(object: string, query?: DataEngineQueryOptions): Promise<any[]>;
1657
- findOne(objectName: string, query?: DataEngineQueryOptions): Promise<any>;
1666
+ find(object: string, query?: EngineQueryOptions): Promise<any[]>;
1667
+ findOne(objectName: string, query?: EngineQueryOptions): Promise<any>;
1658
1668
  insert(object: string, data: any | any[], options?: DataEngineInsertOptions): Promise<any>;
1659
- update(object: string, data: any, options?: DataEngineUpdateOptions): Promise<any>;
1660
- delete(object: string, options?: DataEngineDeleteOptions): Promise<any>;
1661
- count(object: string, query?: DataEngineCountOptions): Promise<number>;
1662
- aggregate(object: string, query: DataEngineAggregateOptions): Promise<any[]>;
1669
+ update(object: string, data: any, options?: EngineUpdateOptions): Promise<any>;
1670
+ delete(object: string, options?: EngineDeleteOptions): Promise<any>;
1671
+ count(object: string, query?: EngineCountOptions): Promise<number>;
1672
+ aggregate(object: string, query: EngineAggregateOptions): Promise<any[]>;
1663
1673
  execute(command: any, options?: Record<string, any>): Promise<any>;
1664
1674
  /**
1665
1675
  * Register a single object definition.
@@ -1897,9 +1907,13 @@ declare class ObjectQLPlugin implements Plugin {
1897
1907
  /**
1898
1908
  * Synchronize all registered object schemas to the database.
1899
1909
  *
1900
- * Iterates every object in the SchemaRegistry and calls the
1901
- * responsible driver's `syncSchema()` for each one. This is
1902
- * idempotent drivers must tolerate repeated calls without
1910
+ * Groups objects by their responsible driver, then:
1911
+ * - If the driver advertises `supports.batchSchemaSync` and implements
1912
+ * `syncSchemasBatch()`, submits all schemas in a single call (reducing
1913
+ * network round-trips for remote drivers like Turso).
1914
+ * - Otherwise falls back to sequential `syncSchema()` per object.
1915
+ *
1916
+ * This is idempotent — drivers must tolerate repeated calls without
1903
1917
  * duplicating tables or erroring out.
1904
1918
  *
1905
1919
  * Drivers that do not implement `syncSchema` are silently skipped.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import * as _objectstack_spec_data from '@objectstack/spec/data';
3
- import { ServiceObject, ObjectOwnership, HookContext, QueryAST, DataEngineQueryOptions, DataEngineInsertOptions, DataEngineUpdateOptions, DataEngineDeleteOptions, DataEngineCountOptions, DataEngineAggregateOptions } from '@objectstack/spec/data';
3
+ import { ObjectOwnership, ServiceObject, QueryAST, HookContext, EngineQueryOptions, DataEngineInsertOptions, EngineUpdateOptions, EngineDeleteOptions, EngineCountOptions, EngineAggregateOptions } from '@objectstack/spec/data';
4
4
  import { ObjectStackManifest, InstalledPackage, ExecutionContext } from '@objectstack/spec/kernel';
5
5
  import { ObjectStackProtocol, MetadataCacheRequest, MetadataCacheResponse, BatchUpdateRequest, BatchUpdateResponse, UpdateManyDataRequest, DeleteManyDataRequest } from '@objectstack/spec/api';
6
6
  import { IDataEngine, DriverInterface, Logger, Plugin, PluginContext, ObjectKernel } from '@objectstack/core';
@@ -1289,6 +1289,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1289
1289
  routes: {
1290
1290
  data: string;
1291
1291
  metadata: string;
1292
+ discovery?: string | undefined;
1292
1293
  ui?: string | undefined;
1293
1294
  auth?: string | undefined;
1294
1295
  automation?: string | undefined;
@@ -1301,6 +1302,7 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1301
1302
  notifications?: string | undefined;
1302
1303
  ai?: string | undefined;
1303
1304
  i18n?: string | undefined;
1305
+ feed?: string | undefined;
1304
1306
  };
1305
1307
  services: Record<string, {
1306
1308
  enabled: boolean;
@@ -1316,15 +1318,10 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1316
1318
  retryAfterMs?: number | undefined;
1317
1319
  } | undefined;
1318
1320
  }>;
1319
- capabilities: {
1320
- feed: boolean;
1321
- comments: boolean;
1322
- automation: boolean;
1323
- cron: boolean;
1324
- search: boolean;
1325
- export: boolean;
1326
- chunkedUpload: boolean;
1327
- };
1321
+ capabilities: Record<string, {
1322
+ enabled: boolean;
1323
+ description?: string;
1324
+ }>;
1328
1325
  }>;
1329
1326
  getMetaTypes(): Promise<{
1330
1327
  types: string[];
@@ -1453,6 +1450,20 @@ declare class ObjectStackProtocolImplementation implements ObjectStackProtocol {
1453
1450
  }): Promise<{
1454
1451
  success: boolean;
1455
1452
  message: string;
1453
+ warning?: undefined;
1454
+ } | {
1455
+ success: boolean;
1456
+ message: string;
1457
+ warning: any;
1458
+ }>;
1459
+ /**
1460
+ * Hydrate SchemaRegistry from the database on startup.
1461
+ * Loads all active metadata records and registers them in the in-memory registry.
1462
+ * Safe to call repeatedly — idempotent (latest DB record wins).
1463
+ */
1464
+ loadMetaFromDb(): Promise<{
1465
+ loaded: number;
1466
+ errors: number;
1456
1467
  }>;
1457
1468
  listFeed(request: any): Promise<any>;
1458
1469
  createFeedItem(request: any): Promise<any>;
@@ -1652,14 +1663,13 @@ declare class ObjectQL implements IDataEngine {
1652
1663
  * @returns Records with expanded lookup fields (IDs replaced by full objects)
1653
1664
  */
1654
1665
  private expandRelatedRecords;
1655
- private toQueryAST;
1656
- find(object: string, query?: DataEngineQueryOptions): Promise<any[]>;
1657
- findOne(objectName: string, query?: DataEngineQueryOptions): Promise<any>;
1666
+ find(object: string, query?: EngineQueryOptions): Promise<any[]>;
1667
+ findOne(objectName: string, query?: EngineQueryOptions): Promise<any>;
1658
1668
  insert(object: string, data: any | any[], options?: DataEngineInsertOptions): Promise<any>;
1659
- update(object: string, data: any, options?: DataEngineUpdateOptions): Promise<any>;
1660
- delete(object: string, options?: DataEngineDeleteOptions): Promise<any>;
1661
- count(object: string, query?: DataEngineCountOptions): Promise<number>;
1662
- aggregate(object: string, query: DataEngineAggregateOptions): Promise<any[]>;
1669
+ update(object: string, data: any, options?: EngineUpdateOptions): Promise<any>;
1670
+ delete(object: string, options?: EngineDeleteOptions): Promise<any>;
1671
+ count(object: string, query?: EngineCountOptions): Promise<number>;
1672
+ aggregate(object: string, query: EngineAggregateOptions): Promise<any[]>;
1663
1673
  execute(command: any, options?: Record<string, any>): Promise<any>;
1664
1674
  /**
1665
1675
  * Register a single object definition.
@@ -1897,9 +1907,13 @@ declare class ObjectQLPlugin implements Plugin {
1897
1907
  /**
1898
1908
  * Synchronize all registered object schemas to the database.
1899
1909
  *
1900
- * Iterates every object in the SchemaRegistry and calls the
1901
- * responsible driver's `syncSchema()` for each one. This is
1902
- * idempotent drivers must tolerate repeated calls without
1910
+ * Groups objects by their responsible driver, then:
1911
+ * - If the driver advertises `supports.batchSchemaSync` and implements
1912
+ * `syncSchemasBatch()`, submits all schemas in a single call (reducing
1913
+ * network round-trips for remote drivers like Turso).
1914
+ * - Otherwise falls back to sequential `syncSchema()` per object.
1915
+ *
1916
+ * This is idempotent — drivers must tolerate repeated calls without
1903
1917
  * duplicating tables or erroring out.
1904
1918
  *
1905
1919
  * Drivers that do not implement `syncSchema` are silently skipped.