@objectstack/objectql 3.3.1 → 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.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +25 -0
- package/dist/index.d.mts +27 -17
- package/dist/index.d.ts +27 -17
- package/dist/index.js +221 -109
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +221 -109
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/src/engine.test.ts +13 -13
- package/src/engine.ts +36 -77
- package/src/plugin.ts +2 -2
- package/src/protocol-data.test.ts +41 -38
- package/src/protocol-discovery.test.ts +25 -25
- package/src/protocol-meta.test.ts +440 -0
- package/src/protocol.ts +258 -68
- package/tsconfig.json +2 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/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
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mESM[39m Build start
|
|
12
12
|
[34mCJS[39m Build start
|
|
13
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
14
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
17
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m102.95 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m211.04 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 184ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.js [22m[32m104.68 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m212.34 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 187ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 20424ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m79.12 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m79.12 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
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
|
+
|
|
3
28
|
## 3.3.1
|
|
4
29
|
|
|
5
30
|
### 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,
|
|
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
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
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
|
-
|
|
1656
|
-
|
|
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?:
|
|
1660
|
-
delete(object: string, options?:
|
|
1661
|
-
count(object: string, query?:
|
|
1662
|
-
aggregate(object: string, query:
|
|
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.
|
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,
|
|
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
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
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
|
-
|
|
1656
|
-
|
|
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?:
|
|
1660
|
-
delete(object: string, options?:
|
|
1661
|
-
count(object: string, query?:
|
|
1662
|
-
aggregate(object: string, query:
|
|
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.
|