@objectstack/runtime 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 +8 -8
- package/CHANGELOG.md +45 -0
- package/dist/index.cjs +27 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +27 -5
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/http-dispatcher.root.test.ts +15 -0
- package/src/http-dispatcher.test.ts +2 -1
- package/src/http-dispatcher.ts +46 -4
- package/src/seed-loader.ts +3 -3
- package/tsconfig.json +2 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @objectstack/runtime@
|
|
2
|
+
> @objectstack/runtime@4.0.0 build /home/runner/work/spec/spec/packages/runtime
|
|
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.js [22m[
|
|
14
|
-
[32mESM[39m [1mdist/index.js.map [22m[
|
|
15
|
-
[32mESM[39m ⚡️ Build success in
|
|
16
|
-
[32mCJS[39m [1mdist/index.cjs [22m[
|
|
17
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in
|
|
13
|
+
[32mESM[39m [1mdist/index.js [22m[32m88.17 KB[39m
|
|
14
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m190.67 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 223ms
|
|
16
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m90.76 KB[39m
|
|
17
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m190.74 KB[39m
|
|
18
|
+
[32mCJS[39m ⚡️ Build success in 232ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 5188ms
|
|
21
21
|
[32mDTS[39m [1mdist/index.d.ts [22m[32m24.35 KB[39m
|
|
22
22
|
[32mDTS[39m [1mdist/index.d.cts [22m[32m24.35 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,50 @@
|
|
|
1
1
|
# @objectstack/runtime
|
|
2
2
|
|
|
3
|
+
## 4.0.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f08ffc3: Fix discovery API endpoint routing and protocol consistency.
|
|
8
|
+
|
|
9
|
+
**Discovery route standardization:**
|
|
10
|
+
|
|
11
|
+
- All adapters (Express, Fastify, Hono, NestJS, Next.js, Nuxt, SvelteKit) now mount the discovery endpoint at `{prefix}/discovery` instead of `{prefix}` root.
|
|
12
|
+
- `.well-known/objectstack` redirects now point to `{prefix}/discovery`.
|
|
13
|
+
- Client `connect()` fallback URL changed from `/api/v1` to `/api/v1/discovery`.
|
|
14
|
+
- Runtime dispatcher handles both `/discovery` (standard) and `/` (legacy) for backward compatibility.
|
|
15
|
+
|
|
16
|
+
**Schema & route alignment:**
|
|
17
|
+
|
|
18
|
+
- Added `storage` (service: `file-storage`) and `feed` (service: `data`) routes to `DEFAULT_DISPATCHER_ROUTES`.
|
|
19
|
+
- Added `feed` and `discovery` fields to `ApiRoutesSchema`.
|
|
20
|
+
- Unified `GetDiscoveryResponseSchema` with `DiscoverySchema` as single source of truth.
|
|
21
|
+
- Client `getRoute('feed')` fallback updated from `/api/v1/data` to `/api/v1/feed`.
|
|
22
|
+
|
|
23
|
+
**Type safety:**
|
|
24
|
+
|
|
25
|
+
- Extracted `ApiRouteType` from `ApiRoutes` keys for type-safe client route resolution.
|
|
26
|
+
- Removed `as any` type casting in client route access.
|
|
27
|
+
|
|
28
|
+
- e0b0a78: Deprecate DataEngineQueryOptions in favor of QueryAST-aligned EngineQueryOptions.
|
|
29
|
+
|
|
30
|
+
Engine, Protocol, and Client now use standard QueryAST parameter names:
|
|
31
|
+
|
|
32
|
+
- `filter` → `where`
|
|
33
|
+
- `select` → `fields`
|
|
34
|
+
- `sort` → `orderBy`
|
|
35
|
+
- `skip` → `offset`
|
|
36
|
+
- `populate` → `expand`
|
|
37
|
+
- `top` → `limit`
|
|
38
|
+
|
|
39
|
+
The old DataEngine\* schemas and types are preserved with `@deprecated` markers for backward compatibility.
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [f08ffc3]
|
|
42
|
+
- Updated dependencies [e0b0a78]
|
|
43
|
+
- @objectstack/spec@4.0.0
|
|
44
|
+
- @objectstack/core@4.0.0
|
|
45
|
+
- @objectstack/rest@4.0.0
|
|
46
|
+
- @objectstack/types@4.0.0
|
|
47
|
+
|
|
3
48
|
## 3.3.1
|
|
4
49
|
|
|
5
50
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -342,8 +342,8 @@ var SeedLoaderService = class {
|
|
|
342
342
|
async resolveFromDatabase(targetObject, targetField, value) {
|
|
343
343
|
try {
|
|
344
344
|
const records = await this.engine.find(targetObject, {
|
|
345
|
-
|
|
346
|
-
|
|
345
|
+
where: { [targetField]: value },
|
|
346
|
+
fields: ["id"],
|
|
347
347
|
limit: 1
|
|
348
348
|
});
|
|
349
349
|
if (records && records.length > 0) {
|
|
@@ -563,7 +563,7 @@ var SeedLoaderService = class {
|
|
|
563
563
|
const map = /* @__PURE__ */ new Map();
|
|
564
564
|
try {
|
|
565
565
|
const records = await this.engine.find(objectName, {
|
|
566
|
-
|
|
566
|
+
fields: ["id", externalId]
|
|
567
567
|
});
|
|
568
568
|
for (const record of records || []) {
|
|
569
569
|
const key = String(record[externalId] ?? "");
|
|
@@ -1286,7 +1286,29 @@ var HttpDispatcher = class {
|
|
|
1286
1286
|
}
|
|
1287
1287
|
} else {
|
|
1288
1288
|
if (m === "GET") {
|
|
1289
|
-
const
|
|
1289
|
+
const normalized = { ...query };
|
|
1290
|
+
if (normalized.filter != null || normalized.filters != null) {
|
|
1291
|
+
normalized.where = normalized.where ?? normalized.filter ?? normalized.filters;
|
|
1292
|
+
delete normalized.filter;
|
|
1293
|
+
delete normalized.filters;
|
|
1294
|
+
}
|
|
1295
|
+
if (normalized.select != null && normalized.fields == null) {
|
|
1296
|
+
normalized.fields = normalized.select;
|
|
1297
|
+
delete normalized.select;
|
|
1298
|
+
}
|
|
1299
|
+
if (normalized.sort != null && normalized.orderBy == null) {
|
|
1300
|
+
normalized.orderBy = normalized.sort;
|
|
1301
|
+
delete normalized.sort;
|
|
1302
|
+
}
|
|
1303
|
+
if (normalized.top != null && normalized.limit == null) {
|
|
1304
|
+
normalized.limit = normalized.top;
|
|
1305
|
+
delete normalized.top;
|
|
1306
|
+
}
|
|
1307
|
+
if (normalized.skip != null && normalized.offset == null) {
|
|
1308
|
+
normalized.offset = normalized.skip;
|
|
1309
|
+
delete normalized.skip;
|
|
1310
|
+
}
|
|
1311
|
+
const result = await broker.call("data.query", { object: objectName, query: normalized }, { request: context.request });
|
|
1290
1312
|
return { handled: true, response: this.success(result) };
|
|
1291
1313
|
}
|
|
1292
1314
|
if (m === "POST") {
|
|
@@ -1736,7 +1758,7 @@ var HttpDispatcher = class {
|
|
|
1736
1758
|
*/
|
|
1737
1759
|
async dispatch(method, path, body, query, context) {
|
|
1738
1760
|
const cleanPath = path.replace(/\/$/, "");
|
|
1739
|
-
if (cleanPath === "" && method === "GET") {
|
|
1761
|
+
if ((cleanPath === "/discovery" || cleanPath === "") && method === "GET") {
|
|
1740
1762
|
const info = await this.getDiscoveryInfo("");
|
|
1741
1763
|
return {
|
|
1742
1764
|
handled: true,
|