@teamscala/service-boot 0.23.292 → 0.23.294
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/package.json +10 -2
- package/src/asset-proxy.test.ts +32 -0
- package/src/asset-proxy.ts +1 -1
- package/src/attach-transfers-upload.d.ts +1 -1
- package/src/attach-transfers-upload.test.ts +25 -0
- package/src/attach-transfers-upload.ts +2 -2
- package/src/build-client-assets/input-hashing.ts +2 -1
- package/src/fn-routers/cache-admin-router.d.ts +2 -2
- package/src/fn-routers/proposal-send-router.d.ts +2 -2
- package/src/fn-routers/public-agreement-router.d.ts +40 -32
- package/src/fn-routers/public-gpt-session-router.d.ts +20 -2
- package/src/fn-routers/public-gpt-session-router.ts +1 -1
- package/src/fn-routers/sign-in-flow-router.d.ts +41 -9
- package/src/fn-routers/task-sync-projection.d.ts +120 -0
- package/src/fn-routers/task-sync-projection.test.ts +123 -0
- package/src/fn-routers/task-sync-projection.ts +201 -0
- package/src/fn-routers/task-sync-router.d.ts +1 -70
- package/src/fn-routers/task-sync-router.test.ts +41 -3
- package/src/fn-routers/task-sync-router.ts +17 -136
- package/src/pg-boss-handler-registry.d.ts +1 -1
- package/src/register-registry-page-route/graph-cache.d.ts +2 -2
- package/src/resource-not-found.test.ts +47 -0
- package/src/resource-not-found.ts +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @system service-boot
|
|
3
|
+
* @status handwritten
|
|
4
|
+
* @edit edit directly
|
|
5
|
+
*
|
|
6
|
+
* Co-located tests for the resource-not-found public API: the error class +
|
|
7
|
+
* the response builder are pure (no S3), so the behaviour is exercised directly.
|
|
8
|
+
*/
|
|
9
|
+
import { describe, expect, it } from "bun:test";
|
|
10
|
+
import { PrimaryResourceMissingError, buildResourceNotFoundResponse } from "./resource-not-found.ts";
|
|
11
|
+
|
|
12
|
+
describe("PrimaryResourceMissingError", () => {
|
|
13
|
+
it("is an Error carrying resourceType + httpStatus", () => {
|
|
14
|
+
const err = new PrimaryResourceMissingError("project", 404);
|
|
15
|
+
expect(err).toBeInstanceOf(Error);
|
|
16
|
+
expect(err.resourceType).toBe("project");
|
|
17
|
+
expect(err.httpStatus).toBe(404);
|
|
18
|
+
expect(err.empty).toBe(false);
|
|
19
|
+
expect(err.message).toContain("project");
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("defaults httpStatus to 404 + supports the empty variant", () => {
|
|
23
|
+
const dead = new PrimaryResourceMissingError("roadmap");
|
|
24
|
+
expect(dead.httpStatus).toBe(404);
|
|
25
|
+
const empty = new PrimaryResourceMissingError("roadmap", 200, { empty: true });
|
|
26
|
+
expect(empty.httpStatus).toBe(200);
|
|
27
|
+
expect(empty.empty).toBe(true);
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
describe("buildResourceNotFoundResponse", () => {
|
|
32
|
+
it("returns a 404 Response for a dead link", () => {
|
|
33
|
+
const res = buildResourceNotFoundResponse("project");
|
|
34
|
+
expect(res).toBeInstanceOf(Response);
|
|
35
|
+
expect(res.status).toBe(404);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("returns a 200 Response for the bare root (no resource selected)", () => {
|
|
39
|
+
const res = buildResourceNotFoundResponse("project", undefined, 200);
|
|
40
|
+
expect(res.status).toBe(200);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("renders the empty-page surface when opts.empty", () => {
|
|
44
|
+
const res = buildResourceNotFoundResponse("project", undefined, 200, { empty: true });
|
|
45
|
+
expect(res.status).toBe(200);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
* floor that must always exist.
|
|
29
29
|
*/
|
|
30
30
|
|
|
31
|
-
import { getClient } from "@teamscala/
|
|
31
|
+
import { getClient } from "@teamscala/object-storage/create/client/get-client";
|
|
32
32
|
import { createCache } from "@teamscala/cache/create-cache";
|
|
33
33
|
import { getServerClient } from "@teamscala/orpc/server-client-registry";
|
|
34
34
|
import { loadRegistryConfig } from "@teamscala/db/registry/load-config";
|