@intuitionrobotics/thunderstorm 2.0.1 → 2.0.3
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/dist/app-backend/core/Storm.d.ts.map +1 -1
- package/dist/app-backend/core/Storm.js +1 -3
- package/dist/app-backend/core/Storm.js.map +1 -1
- package/dist/app-backend/modules/server/HttpServer.d.ts +0 -1
- package/dist/app-backend/modules/server/HttpServer.d.ts.map +1 -1
- package/dist/app-backend/modules/server/HttpServer.js +0 -25
- package/dist/app-backend/modules/server/HttpServer.js.map +1 -1
- package/dist/app-backend/modules/server/server-api.d.ts +4 -12
- package/dist/app-backend/modules/server/server-api.d.ts.map +1 -1
- package/dist/app-backend/modules/server/server-api.js +17 -41
- package/dist/app-backend/modules/server/server-api.js.map +1 -1
- package/dist/backend.d.ts +1 -1
- package/dist/backend.d.ts.map +1 -1
- package/dist/backend.js +4 -1
- package/dist/backend.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/dist/app-backend/modules/server/mount.d.ts +0 -5
- package/dist/app-backend/modules/server/mount.d.ts.map +0 -1
- package/dist/app-backend/modules/server/mount.js +0 -37
- package/dist/app-backend/modules/server/mount.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intuitionrobotics/thunderstorm",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Thunderstorm",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"IR",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"react-dom": "^18.0.0",
|
|
41
41
|
"react-router-dom": "^5.1.2",
|
|
42
42
|
"react-select": "^5.0.0",
|
|
43
|
-
"@intuitionrobotics/firebase": "2.0.
|
|
44
|
-
"@intuitionrobotics/ts-common": "2.0.
|
|
43
|
+
"@intuitionrobotics/firebase": "2.0.3",
|
|
44
|
+
"@intuitionrobotics/ts-common": "2.0.3"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@types/react": "^18.0.0"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@types/react-router-dom": "^5.1.3",
|
|
59
59
|
"ts-node": "^9.1.1",
|
|
60
60
|
"typescript": "^5.3.0",
|
|
61
|
-
"@intuitionrobotics/testelot": "2.0.
|
|
61
|
+
"@intuitionrobotics/testelot": "2.0.3"
|
|
62
62
|
},
|
|
63
63
|
"typesVersions": {
|
|
64
64
|
"*": {
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { ExpressRouter } from "../../utils/types.js";
|
|
2
|
-
import type { ServerApi } from "./server-api.js";
|
|
3
|
-
export declare function mount<A extends ServerApi<any>>(router: ExpressRouter, path: string, api: A): void;
|
|
4
|
-
export declare function mountMany<A extends ServerApi<any>>(router: ExpressRouter, apis: A[]): void;
|
|
5
|
-
//# sourceMappingURL=mount.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../../src/main/app-backend/modules/server/mount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAiB/C,wBAAgB,KAAK,CAAC,CAAC,SAAS,SAAS,CAAC,GAAG,CAAC,EAC7C,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,CAAC,GACJ,IAAI,CAEN;AAaD,wBAAgB,SAAS,CAAC,CAAC,SAAS,SAAS,CAAC,GAAG,CAAC,EACjD,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,CAAC,EAAE,GACP,IAAI,CAQN"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { BadImplementationException } from "@intuitionrobotics/ts-common";
|
|
2
|
-
// The single helper that the hand-maintained routes file uses to attach a
|
|
3
|
-
// ServerApi to an Express Router. The endpoint's own `method` (POST, GET,
|
|
4
|
-
// etc.) drives which Router method gets called, which keeps the routes file
|
|
5
|
-
// from ever drifting POST/GET against the class's declared type.
|
|
6
|
-
//
|
|
7
|
-
// import {mount} from "@intuitionrobotics/thunderstorm/backend";
|
|
8
|
-
//
|
|
9
|
-
// const v1 = Router();
|
|
10
|
-
// mount(v1, "/register", new ServerApi_Register());
|
|
11
|
-
// mount(v1, "/types-testing/post-without-response-endpoint", endpointExample);
|
|
12
|
-
//
|
|
13
|
-
// `api.callWrapper` is the bound RequestHandler that runs validation,
|
|
14
|
-
// middleware composition, error mapping, and side-effect release for one
|
|
15
|
-
// request — exactly the same handler the old RouteResolver used.
|
|
16
|
-
export function mount(router, path, api) {
|
|
17
|
-
router[api.method](path, api.callWrapper);
|
|
18
|
-
}
|
|
19
|
-
// Bulk mount for dynamically-built endpoint arrays (e.g. DB API generator
|
|
20
|
-
// output, where each api carries its own URL fragment in `relativePath`).
|
|
21
|
-
//
|
|
22
|
-
// Static endpoints should use `mount()` and declare the path in the routes
|
|
23
|
-
// file. `mountMany()` is the escape hatch for the case where the URL is
|
|
24
|
-
// generated alongside the api at construction time and can't be hoisted
|
|
25
|
-
// into the routes file by hand.
|
|
26
|
-
//
|
|
27
|
-
// const dbApis: ServerApi<any>[] = MyDB.apis(); // each api has its own .relativePath
|
|
28
|
-
// const myThing = Router();
|
|
29
|
-
// mountMany(myThing, dbApis); // each mounts at "/${api.relativePath}"
|
|
30
|
-
export function mountMany(router, apis) {
|
|
31
|
-
for (const api of apis) {
|
|
32
|
-
if (!api.relativePath)
|
|
33
|
-
throw new BadImplementationException("mountMany: api missing relativePath. Either supply it in the api's constructor or use mount() with an explicit path.");
|
|
34
|
-
router[api.method](`/${api.relativePath}`, api.callWrapper);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=mount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mount.js","sourceRoot":"","sources":["../../../../src/main/app-backend/modules/server/mount.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,0BAA0B,EAAC,MAAM,8BAA8B,CAAC;AAExE,0EAA0E;AAC1E,0EAA0E;AAC1E,4EAA4E;AAC5E,iEAAiE;AACjE,EAAE;AACF,mEAAmE;AACnE,EAAE;AACF,yBAAyB;AACzB,sDAAsD;AACtD,iFAAiF;AACjF,EAAE;AACF,sEAAsE;AACtE,yEAAyE;AACzE,iEAAiE;AACjE,MAAM,UAAU,KAAK,CACpB,MAAqB,EACrB,IAAY,EACZ,GAAM;IAEN,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;AAC3C,CAAC;AAED,0EAA0E;AAC1E,0EAA0E;AAC1E,EAAE;AACF,2EAA2E;AAC3E,wEAAwE;AACxE,wEAAwE;AACxE,gCAAgC;AAChC,EAAE;AACF,2FAA2F;AAC3F,8BAA8B;AAC9B,+FAA+F;AAC/F,MAAM,UAAU,SAAS,CACxB,MAAqB,EACrB,IAAS;IAET,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,CAAC,GAAG,CAAC,YAAY;YACpB,MAAM,IAAI,0BAA0B,CACnC,sHAAsH,CACtH,CAAC;QACH,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,CAAC,YAAY,EAAE,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7D,CAAC;AACF,CAAC"}
|