@objectstack/runtime 4.0.2 → 4.0.4
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 +19 -0
- package/dist/index.cjs +225 -193
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -11
- package/dist/index.d.ts +9 -11
- package/dist/index.js +225 -193
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/app-plugin.ts +9 -0
- package/src/dispatcher-plugin.ts +93 -59
- package/src/http-dispatcher.root.test.ts +0 -3
- package/src/http-dispatcher.test.ts +105 -100
- package/src/http-dispatcher.ts +183 -187
- package/vitest.config.ts +1 -0
package/dist/index.d.cts
CHANGED
|
@@ -291,7 +291,11 @@ declare class HttpDispatcher {
|
|
|
291
291
|
* 404 Route Not Found — no route is registered for this path.
|
|
292
292
|
*/
|
|
293
293
|
private routeNotFound;
|
|
294
|
-
|
|
294
|
+
/**
|
|
295
|
+
* Direct data service dispatch — replaces broker.call('data.*').
|
|
296
|
+
* Tries protocol service first (supports expand/populate), falls back to ObjectQL.
|
|
297
|
+
*/
|
|
298
|
+
private callData;
|
|
295
299
|
/**
|
|
296
300
|
* Generates the discovery JSON response for the API root.
|
|
297
301
|
*
|
|
@@ -572,12 +576,12 @@ declare class HttpDispatcher {
|
|
|
572
576
|
* Standard: /metadata/:type/:name
|
|
573
577
|
* Fallback for backward compat: /metadata (all objects), /metadata/:objectName (get object)
|
|
574
578
|
*/
|
|
575
|
-
handleMetadata(path: string,
|
|
579
|
+
handleMetadata(path: string, _context: HttpProtocolContext, method?: string, body?: any, query?: any): Promise<HttpDispatcherResult>;
|
|
576
580
|
/**
|
|
577
581
|
* Handles Data requests
|
|
578
582
|
* path: sub-path after /data/ (e.g. "contacts", "contacts/123", "contacts/query")
|
|
579
583
|
*/
|
|
580
|
-
handleData(path: string, method: string, body: any, query: any,
|
|
584
|
+
handleData(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
581
585
|
/**
|
|
582
586
|
* Handles Analytics requests
|
|
583
587
|
* path: sub-path after /analytics/
|
|
@@ -608,14 +612,9 @@ declare class HttpDispatcher {
|
|
|
608
612
|
* - POST /packages/:id/publish → publish a package (metadata snapshot)
|
|
609
613
|
* - POST /packages/:id/revert → revert a package to last published state
|
|
610
614
|
*
|
|
611
|
-
* Uses ObjectQL SchemaRegistry directly (via the 'objectql' service)
|
|
612
|
-
* with broker fallback for backward compatibility.
|
|
613
|
-
*/
|
|
614
|
-
handlePackages(path: string, method: string, body: any, query: any, context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
615
|
-
/**
|
|
616
|
-
* Fallback: handle packages via broker (for backward compatibility)
|
|
615
|
+
* Uses ObjectQL SchemaRegistry directly (via the 'objectql' service).
|
|
617
616
|
*/
|
|
618
|
-
|
|
617
|
+
handlePackages(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
619
618
|
/**
|
|
620
619
|
* Handles Storage requests
|
|
621
620
|
* path: sub-path after /storage/
|
|
@@ -655,7 +654,6 @@ declare class HttpDispatcher {
|
|
|
655
654
|
* Tries multiple access patterns since kernel structure varies.
|
|
656
655
|
*/
|
|
657
656
|
private getObjectQLService;
|
|
658
|
-
private capitalize;
|
|
659
657
|
/**
|
|
660
658
|
* Handle AI service routes (/ai/chat, /ai/models, /ai/conversations, etc.)
|
|
661
659
|
* Resolves the AI service and its built-in route handlers, then dispatches.
|
package/dist/index.d.ts
CHANGED
|
@@ -291,7 +291,11 @@ declare class HttpDispatcher {
|
|
|
291
291
|
* 404 Route Not Found — no route is registered for this path.
|
|
292
292
|
*/
|
|
293
293
|
private routeNotFound;
|
|
294
|
-
|
|
294
|
+
/**
|
|
295
|
+
* Direct data service dispatch — replaces broker.call('data.*').
|
|
296
|
+
* Tries protocol service first (supports expand/populate), falls back to ObjectQL.
|
|
297
|
+
*/
|
|
298
|
+
private callData;
|
|
295
299
|
/**
|
|
296
300
|
* Generates the discovery JSON response for the API root.
|
|
297
301
|
*
|
|
@@ -572,12 +576,12 @@ declare class HttpDispatcher {
|
|
|
572
576
|
* Standard: /metadata/:type/:name
|
|
573
577
|
* Fallback for backward compat: /metadata (all objects), /metadata/:objectName (get object)
|
|
574
578
|
*/
|
|
575
|
-
handleMetadata(path: string,
|
|
579
|
+
handleMetadata(path: string, _context: HttpProtocolContext, method?: string, body?: any, query?: any): Promise<HttpDispatcherResult>;
|
|
576
580
|
/**
|
|
577
581
|
* Handles Data requests
|
|
578
582
|
* path: sub-path after /data/ (e.g. "contacts", "contacts/123", "contacts/query")
|
|
579
583
|
*/
|
|
580
|
-
handleData(path: string, method: string, body: any, query: any,
|
|
584
|
+
handleData(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
581
585
|
/**
|
|
582
586
|
* Handles Analytics requests
|
|
583
587
|
* path: sub-path after /analytics/
|
|
@@ -608,14 +612,9 @@ declare class HttpDispatcher {
|
|
|
608
612
|
* - POST /packages/:id/publish → publish a package (metadata snapshot)
|
|
609
613
|
* - POST /packages/:id/revert → revert a package to last published state
|
|
610
614
|
*
|
|
611
|
-
* Uses ObjectQL SchemaRegistry directly (via the 'objectql' service)
|
|
612
|
-
* with broker fallback for backward compatibility.
|
|
613
|
-
*/
|
|
614
|
-
handlePackages(path: string, method: string, body: any, query: any, context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
615
|
-
/**
|
|
616
|
-
* Fallback: handle packages via broker (for backward compatibility)
|
|
615
|
+
* Uses ObjectQL SchemaRegistry directly (via the 'objectql' service).
|
|
617
616
|
*/
|
|
618
|
-
|
|
617
|
+
handlePackages(path: string, method: string, body: any, query: any, _context: HttpProtocolContext): Promise<HttpDispatcherResult>;
|
|
619
618
|
/**
|
|
620
619
|
* Handles Storage requests
|
|
621
620
|
* path: sub-path after /storage/
|
|
@@ -655,7 +654,6 @@ declare class HttpDispatcher {
|
|
|
655
654
|
* Tries multiple access patterns since kernel structure varies.
|
|
656
655
|
*/
|
|
657
656
|
private getObjectQLService;
|
|
658
|
-
private capitalize;
|
|
659
657
|
/**
|
|
660
658
|
* Handle AI service routes (/ai/chat, /ai/models, /ai/conversations, etc.)
|
|
661
659
|
* Resolves the AI service and its built-in route handlers, then dispatches.
|