@owlmeans/server-api 0.1.18-rc.2 → 0.1.18-rc.21
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/README.md +32 -34
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/server-api/SKILL.md +27 -24
- package/build/helper.d.ts.map +1 -1
- package/build/helper.js +10 -1
- package/build/helper.js.map +1 -1
- package/build/hold.d.ts +52 -0
- package/build/hold.d.ts.map +1 -0
- package/build/hold.js +56 -0
- package/build/hold.js.map +1 -0
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/protocol.d.ts +26 -0
- package/build/protocol.d.ts.map +1 -0
- package/build/protocol.js +41 -0
- package/build/protocol.js.map +1 -0
- package/build/server.d.ts.map +1 -1
- package/build/server.js +7 -12
- package/build/server.js.map +1 -1
- package/build/types.d.ts +1 -2
- package/build/types.d.ts.map +1 -1
- package/build/utils/error.d.ts +13 -0
- package/build/utils/error.d.ts.map +1 -1
- package/build/utils/error.js +21 -4
- package/build/utils/error.js.map +1 -1
- package/build/utils/guards.d.ts.map +1 -1
- package/build/utils/guards.js +11 -15
- package/build/utils/guards.js.map +1 -1
- package/build/utils/payload.d.ts.map +1 -1
- package/build/utils/payload.js +3 -0
- package/build/utils/payload.js.map +1 -1
- package/build/utils/server.d.ts.map +1 -1
- package/build/utils/server.js +4 -1
- package/build/utils/server.js.map +1 -1
- package/package.json +10 -10
- package/src/helper.ts +10 -1
- package/src/hold.ts +84 -0
- package/src/index.ts +2 -0
- package/src/protocol.ts +104 -0
- package/src/server.ts +34 -43
- package/src/types.ts +1 -3
- package/src/utils/error.ts +20 -3
- package/src/utils/guards.ts +10 -17
- package/src/utils/payload.ts +3 -0
- package/src/utils/server.ts +4 -1
- package/build/.gitkeep +0 -0
package/src/utils/payload.ts
CHANGED
|
@@ -9,6 +9,9 @@ export const provideRequest = (alias: string, req: Request, provision?: boolean)
|
|
|
9
9
|
return {
|
|
10
10
|
alias,
|
|
11
11
|
auth: (req as any)._auth ?? undefined,
|
|
12
|
+
// Resolved once by `authorize` and carried by reference, exactly like `_auth`, so a handler
|
|
13
|
+
// reached through any path sees the same entity the guard admitted.
|
|
14
|
+
entity: (req as any)._entity ?? undefined,
|
|
12
15
|
params: req.params as Record<string, string | number | undefined | null>,
|
|
13
16
|
body: req.body as Record<string, any>,
|
|
14
17
|
headers: req.headers,
|
package/src/utils/server.ts
CHANGED
|
@@ -23,7 +23,10 @@ export const canServeModule = (context: Context, module: CommonEntrypoint): modu
|
|
|
23
23
|
if (module.route.route.service != null && module.route.route.service !== context.cfg.service) {
|
|
24
24
|
return false
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
// Only the protocols HTTP actually carries. A socket is upgraded elsewhere and a queued job is
|
|
27
|
+
// taken off the broker by the worker — mounting either on the HTTP server would answer it twice.
|
|
28
|
+
if (module.route.route.protocol === RouteProtocols.SOCKET
|
|
29
|
+
|| module.route.route.protocol === RouteProtocols.QUEUE) {
|
|
27
30
|
return false
|
|
28
31
|
}
|
|
29
32
|
|
package/build/.gitkeep
DELETED
|
File without changes
|