libmodulor 0.29.0 → 0.30.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/CHANGELOG.md +40 -0
- package/README.md +2 -2
- package/dist/esm/apps/Helper/src/lib/layers/product.js +1 -1
- package/dist/esm/apps/Helper/src/lib/layers/project.js +6 -6
- package/dist/esm/apps/Helper/src/lib/layers/target.js +27 -11
- package/dist/esm/convention.d.ts +2 -0
- package/dist/esm/convention.js +1 -0
- package/dist/esm/dt/base/TObject.js +13 -5
- package/dist/esm/dt/index.d.ts +1 -1
- package/dist/esm/dt/targets/json-schema.d.ts +23 -11
- package/dist/esm/error/funcs.d.ts +1 -0
- package/dist/esm/error/funcs.js +4 -0
- package/dist/esm/error/index.d.ts +1 -1
- package/dist/esm/error/index.js +1 -1
- package/dist/esm/i18n/locales/de.js +2 -0
- package/dist/esm/i18n/locales/en.js +2 -0
- package/dist/esm/i18n/locales/es.js +2 -0
- package/dist/esm/i18n/locales/fr.js +2 -0
- package/dist/esm/i18n/types.d.ts +1 -1
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +3 -0
- package/dist/esm/index.node-express.d.ts +2 -0
- package/dist/esm/index.node-express.js +1 -0
- package/dist/esm/index.node-hono.d.ts +2 -0
- package/dist/esm/index.node-hono.js +1 -0
- package/dist/esm/index.node-mcp-express.d.ts +3 -0
- package/dist/esm/index.node-mcp-express.js +2 -0
- package/dist/esm/index.node-mcp-hono.d.ts +3 -0
- package/dist/esm/index.node-mcp-hono.js +2 -0
- package/dist/esm/index.node-mcp.d.ts +3 -1
- package/dist/esm/index.node-mcp.js +3 -1
- package/dist/esm/products/Helper/i18n.d.ts +2 -0
- package/dist/esm/std/lib/settings.js +4 -5
- package/dist/esm/target/edge-worker-hono-server/SyncEdgeWorkerHonoServerManager.d.ts +2 -0
- package/dist/esm/target/edge-worker-hono-server/SyncEdgeWorkerHonoServerManager.js +3 -0
- package/dist/esm/target/index.d.ts +1 -1
- package/dist/esm/target/index.js +1 -1
- package/dist/esm/target/lib/client/AuthDataStore.d.ts +5 -0
- package/dist/esm/target/lib/client/impl/InMemoryAuthDataStore.d.ts +7 -0
- package/dist/esm/target/lib/client/impl/InMemoryAuthDataStore.js +20 -0
- package/dist/esm/target/lib/client/impl/MixedServerClientManager.d.ts +15 -0
- package/dist/esm/target/lib/client/impl/MixedServerClientManager.js +44 -0
- package/dist/esm/target/lib/json-schema/error.d.ts +3 -0
- package/dist/esm/target/lib/json-schema/error.js +14 -0
- package/dist/esm/target/lib/json-schema/input.d.ts +16 -0
- package/dist/esm/target/lib/json-schema/input.js +67 -0
- package/dist/esm/target/lib/json-schema/output.d.ts +19 -0
- package/dist/esm/target/lib/json-schema/output.js +128 -0
- package/dist/esm/target/lib/manifest.d.ts +32 -1
- package/dist/esm/target/lib/manifest.js +22 -1
- package/dist/esm/target/lib/mcp-server/MCPServerRequestHandler.d.ts +16 -0
- package/dist/esm/target/lib/mcp-server/MCPServerRequestHandler.js +54 -0
- package/dist/esm/target/lib/mcp-server/consts.d.ts +1 -0
- package/dist/esm/target/lib/mcp-server/consts.js +1 -0
- package/dist/esm/target/lib/mcp-server/funcs.d.ts +13 -0
- package/dist/esm/target/lib/mcp-server/funcs.js +84 -0
- package/dist/esm/target/lib/mcp-server/http/MCPHTTPRequestHandlerBuilder.d.ts +14 -0
- package/dist/esm/target/lib/mcp-server/http/MCPHTTPRequestHandlerBuilder.js +1 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.d.ts +5 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.js +18 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.d.ts +15 -0
- package/dist/esm/target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.js +88 -0
- package/dist/esm/target/lib/mcp-server/http/express/types.d.ts +3 -0
- package/dist/esm/target/lib/mcp-server/http/express/types.js +1 -0
- package/dist/esm/target/lib/mcp-server/http/funcs.d.ts +6 -0
- package/dist/esm/target/lib/mcp-server/http/funcs.js +50 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.d.ts +5 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.js +18 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoProtocolRequestHandlerBuilder.d.ts +15 -0
- package/dist/esm/target/lib/mcp-server/http/hono/MCPHTTPHonoProtocolRequestHandlerBuilder.js +88 -0
- package/dist/esm/target/lib/mcp-server/http/hono/types.d.ts +3 -0
- package/dist/esm/target/lib/mcp-server/http/hono/types.js +1 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioRequestHandler.d.ts +31 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioRequestHandler.js +108 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.d.ts +7 -0
- package/dist/esm/target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.js +36 -0
- package/dist/esm/target/lib/mcp-server/stdio/consts.d.ts +2 -0
- package/dist/esm/target/lib/mcp-server/stdio/consts.js +3 -0
- package/dist/esm/target/lib/mcp-server/stdio/funcs.d.ts +2 -0
- package/dist/esm/target/lib/mcp-server/stdio/funcs.js +10 -0
- package/dist/esm/target/lib/mcp-server/stdio/input.d.ts +10 -0
- package/dist/esm/target/lib/mcp-server/stdio/input.js +15 -0
- package/dist/esm/target/lib/mcp-server/types.d.ts +2 -0
- package/dist/esm/target/lib/mcp-server/types.js +1 -0
- package/dist/esm/target/lib/openapi/OpenAPISpecBuilder.js +8 -4
- package/dist/esm/target/lib/openapi/funcs.d.ts +4 -9
- package/dist/esm/target/lib/openapi/funcs.js +18 -119
- package/dist/esm/target/lib/openapi/types.d.ts +5 -16
- package/dist/esm/target/lib/server/ServerBooter.d.ts +1 -1
- package/dist/esm/target/lib/server/ServerBooter.js +10 -0
- package/dist/esm/target/lib/server/ServerManager.d.ts +10 -0
- package/dist/esm/target/lib/server/ServerRequestHandler.d.ts +10 -5
- package/dist/esm/target/lib/server/ServerRequestHandler.js +35 -25
- package/dist/esm/target/lib/server/consts.js +4 -0
- package/dist/esm/target/lib/server-express/funcs.js +2 -6
- package/dist/esm/target/lib/server-hono/funcs.js +4 -2
- package/dist/esm/target/lib/shared.d.ts +1 -0
- package/dist/esm/target/lib/shared.js +1 -0
- package/dist/esm/target/nextjs-server/NextJSServerManager.d.ts +2 -0
- package/dist/esm/target/nextjs-server/NextJSServerManager.js +3 -0
- package/dist/esm/target/node-express-server/NodeExpressServerManager.d.ts +6 -2
- package/dist/esm/target/node-express-server/NodeExpressServerManager.js +15 -6
- package/dist/esm/target/node-hono-server/NodeHonoServerManager.d.ts +6 -2
- package/dist/esm/target/node-hono-server/NodeHonoServerManager.js +15 -6
- package/dist/esm/target/{node-mcp-server/NodeLocalStdioMCPServerManager.d.ts → node-mcp-server-stdio/NodeMCPStdioServerManager.d.ts} +9 -20
- package/dist/esm/target/node-mcp-server-stdio/NodeMCPStdioServerManager.js +108 -0
- package/dist/esm/testing/impl/newNodeAppTester.js +5 -0
- package/dist/esm/uc/cardinality.d.ts +7 -0
- package/dist/esm/uc/cardinality.js +14 -0
- package/dist/esm/uc/examples.d.ts +2 -0
- package/dist/esm/uc/examples.js +12 -0
- package/dist/esm/uc/helpers/UCOutputReader.d.ts +2 -2
- package/dist/esm/uc/helpers/UCOutputReader.js +2 -2
- package/dist/esm/uc/index.d.ts +2 -0
- package/dist/esm/uc/index.js +2 -0
- package/dist/esm/uc/input-field.d.ts +3 -6
- package/dist/esm/uc/input-field.js +5 -21
- package/dist/esm/uc/opi.d.ts +3 -1
- package/dist/esm/uc/opi.js +4 -1
- package/dist/esm/uc/output-field.d.ts +13 -1
- package/dist/esm/uc/output-field.js +9 -11
- package/dist/esm/utils/bundling/funcs.js +1 -1
- package/dist/esm/utils/bundling/vite/plugin.d.ts +1 -1
- package/dist/esm/utils/index.d.ts +1 -0
- package/dist/esm/utils/index.js +1 -0
- package/dist/esm/utils/streams/funcs.d.ts +2 -0
- package/dist/esm/utils/streams/funcs.js +10 -0
- package/package.json +20 -9
- package/dist/esm/target/lib/openapi/consts.d.ts +0 -2
- package/dist/esm/target/lib/openapi/consts.js +0 -1
- package/dist/esm/target/lib/openapi/input.d.ts +0 -16
- package/dist/esm/target/lib/openapi/input.js +0 -33
- package/dist/esm/target/node-mcp-server/NodeLocalStdioMCPServerManager.js +0 -188
- package/dist/esm/target/node-mcp-server/funcs.d.ts +0 -7
- package/dist/esm/target/node-mcp-server/funcs.js +0 -45
- package/dist/esm/target/node-mcp-server/types.d.ts +0 -15
- /package/dist/esm/target/{node-mcp-server/types.js → lib/client/AuthDataStore.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v0.30.0 (2026-05-25)
|
|
4
|
+
|
|
5
|
+
### ✨ Features
|
|
6
|
+
|
|
7
|
+
- Added cardinality support for use case output fields.
|
|
8
|
+
- Introduced target capability definitions to expose target features programmatically (see it in action here https://libmodulor.c100k.eu/docs/references/targets).
|
|
9
|
+
- Added a fully local MCP stdio server implementation.
|
|
10
|
+
- Added streamable HTTP support for MCP targets on Express and Hono.
|
|
11
|
+
- Added an option to dangerously skip public API key and auth checks for MCP targets.
|
|
12
|
+
|
|
13
|
+
### 🛠 OpenAPI & JSON Schema
|
|
14
|
+
|
|
15
|
+
- Fixed OpenAPI target handling for:
|
|
16
|
+
- `null` schemas
|
|
17
|
+
- nullable schemas
|
|
18
|
+
- empty `204` responses
|
|
19
|
+
- missing `additionalProperties`
|
|
20
|
+
- missing required fields
|
|
21
|
+
- Fixed JSON schema output generation to build schemas directly from definitions.
|
|
22
|
+
|
|
23
|
+
### ♻️ Refactors
|
|
24
|
+
|
|
25
|
+
- Renamed the MCP target to `node-mcp-server-stdio` (**breaking change**).
|
|
26
|
+
- Exposed `rawErr` in `ServerRequestHandler`.
|
|
27
|
+
- Harmonized import extensions across examples.
|
|
28
|
+
|
|
29
|
+
### 📦 Dependencies
|
|
30
|
+
|
|
31
|
+
- Bumped various minor and patch dependencies.
|
|
32
|
+
- Upgraded:
|
|
33
|
+
- Vite → 8.x
|
|
34
|
+
- Vitest → 4.x
|
|
35
|
+
|
|
36
|
+
### 📚 Documentation & Examples
|
|
37
|
+
|
|
38
|
+
- Updated changelog and command documentation.
|
|
39
|
+
- Adjusted Swagger example configuration to work correctly with CORS.
|
|
40
|
+
|
|
41
|
+
See all the changes here : https://github.com/c100k/libmodulor/compare/v0.29.0...master
|
|
42
|
+
|
|
3
43
|
## v0.29.0 (2026-05-10)
|
|
4
44
|
|
|
5
45
|
Report an error when the `onClose` handler of SSE has been missed only when it has streamed once.
|
package/README.md
CHANGED
|
@@ -37,7 +37,7 @@ pnpm libmodulor CreateProduct --productName CustomerPortal
|
|
|
37
37
|
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-express-server
|
|
38
38
|
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-hono-server
|
|
39
39
|
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-core-cli
|
|
40
|
-
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-mcp-server
|
|
40
|
+
pnpm libmodulor CreateTarget --productName CustomerPortal --targetName node-mcp-server-stdio
|
|
41
41
|
```
|
|
42
42
|
|
|
43
43
|
For more params, checkout the help section : `pnpm libmodulor --help`.
|
|
@@ -50,4 +50,4 @@ If you think you can help in any way, feel free to contact me (cf. `author` in `
|
|
|
50
50
|
|
|
51
51
|
## ⚖️ License
|
|
52
52
|
|
|
53
|
-
[LGPL-3.0](https://github.com/c100k/libmodulor/blob/v0.
|
|
53
|
+
[LGPL-3.0](https://github.com/c100k/libmodulor/blob/v0.30.0/LICENSE)
|
|
@@ -2,7 +2,7 @@ import { PRODUCT_I18N_FILE_NAME, PRODUCT_I18N_NAME, PRODUCT_MANIFEST_FILE_NAME,
|
|
|
2
2
|
import { I18N_DEFAULT_LANG } from '../../../../../i18n/index.js';
|
|
3
3
|
import { LIB_NAME } from '../consts.js';
|
|
4
4
|
const I18N_TS = `import type { ProductI18n } from '${LIB_NAME}';
|
|
5
|
-
import { I18n${I18N_DEFAULT_LANG.toLocaleUpperCase()} } from '
|
|
5
|
+
import { I18n${I18N_DEFAULT_LANG.toLocaleUpperCase()} } from '${LIB_NAME}/locales/${I18N_DEFAULT_LANG}';
|
|
6
6
|
|
|
7
7
|
export const ${PRODUCT_I18N_NAME} = {
|
|
8
8
|
${I18N_DEFAULT_LANG}: {
|
|
@@ -87,19 +87,19 @@ export const PACKAGE_JSON = (name) => `{
|
|
|
87
87
|
"reflect-metadata": "^0.2.2"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@biomejs/biome": "^2.4.
|
|
91
|
-
"@types/node": "^25.
|
|
92
|
-
"@vitest/coverage-v8": "^
|
|
90
|
+
"@biomejs/biome": "^2.4.15",
|
|
91
|
+
"@types/node": "^25.8.0",
|
|
92
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
93
93
|
"buffer": "^6.0.3",
|
|
94
94
|
"cookie-parser": "^1.4.7",
|
|
95
95
|
"express": "^5.2.1",
|
|
96
96
|
"express-fileupload": "^1.5.2",
|
|
97
|
-
"fast-check": "^4.
|
|
97
|
+
"fast-check": "^4.8.0",
|
|
98
98
|
"helmet": "^8.1.0",
|
|
99
99
|
"jose": "^6.2.3",
|
|
100
100
|
"typescript": "^6.0.3",
|
|
101
|
-
"vite": "^
|
|
102
|
-
"vitest": "^
|
|
101
|
+
"vite": "^8.0.13",
|
|
102
|
+
"vitest": "^4.1.6"
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
`;
|
|
@@ -56,6 +56,8 @@ import {
|
|
|
56
56
|
import { bindNodeCore } from '${LIB_NAME}/node';
|
|
57
57
|
import {
|
|
58
58
|
bindServer,
|
|
59
|
+
type MCPHTTPExpressRequestHandlerBuilder,
|
|
60
|
+
MCPHTTPExpressFakeRequestHandlerBuilder,
|
|
59
61
|
NodeExpressServerManager,
|
|
60
62
|
} from '${LIB_NAME}/node-express';
|
|
61
63
|
|
|
@@ -69,6 +71,9 @@ bindNodeCore(container);
|
|
|
69
71
|
bindServer(container);
|
|
70
72
|
bindProduct(container, ${PRODUCT_MANIFEST_NAME}, ${PRODUCT_I18N_NAME});
|
|
71
73
|
|
|
74
|
+
container
|
|
75
|
+
.bind<MCPHTTPExpressRequestHandlerBuilder>('MCPHTTPRequestHandlerBuilder')
|
|
76
|
+
.to(MCPHTTPExpressFakeRequestHandlerBuilder);
|
|
72
77
|
container.bind<ServerManager>('ServerManager').to(NodeExpressServerManager);
|
|
73
78
|
|
|
74
79
|
export default container;
|
|
@@ -84,6 +89,8 @@ import {
|
|
|
84
89
|
import { bindNodeCore } from '${LIB_NAME}/node';
|
|
85
90
|
import {
|
|
86
91
|
bindServer,
|
|
92
|
+
type MCPHTTPHonoRequestHandlerBuilder,
|
|
93
|
+
MCPHTTPHonoFakeRequestHandlerBuilder,
|
|
87
94
|
NodeHonoServerManager,
|
|
88
95
|
} from '${LIB_NAME}/node-hono';
|
|
89
96
|
|
|
@@ -97,20 +104,27 @@ bindNodeCore(container);
|
|
|
97
104
|
bindServer(container);
|
|
98
105
|
bindProduct(container, ${PRODUCT_MANIFEST_NAME}, ${PRODUCT_I18N_NAME});
|
|
99
106
|
|
|
107
|
+
container
|
|
108
|
+
.bind<MCPHTTPHonoRequestHandlerBuilder>('MCPHTTPRequestHandlerBuilder')
|
|
109
|
+
.to(MCPHTTPHonoFakeRequestHandlerBuilder);
|
|
100
110
|
container.bind<ServerManager>('ServerManager').to(NodeHonoServerManager);
|
|
101
111
|
|
|
102
112
|
export default container;
|
|
103
113
|
`;
|
|
104
|
-
const
|
|
114
|
+
const NODE_MCP_SERVER_STDIO_CONTAINER_TS = `import { Container } from 'inversify';
|
|
105
115
|
import {
|
|
106
116
|
bindCommon,
|
|
107
117
|
bindProduct,
|
|
108
118
|
CONTAINER_OPTS,
|
|
109
119
|
type ServerManager,
|
|
120
|
+
type UCClientConfirmManager,
|
|
110
121
|
updateSettings,
|
|
111
122
|
} from '${LIB_NAME}';
|
|
112
123
|
import { bindNodeCore } from '${LIB_NAME}/node';
|
|
113
|
-
import {
|
|
124
|
+
import {
|
|
125
|
+
MCPStdioUCClientConfirmManager,
|
|
126
|
+
NodeMCPStdioServerManager,
|
|
127
|
+
} from '${LIB_NAME}/node-mcp';
|
|
114
128
|
|
|
115
129
|
${COMMON_CONTAINER_IMPORTS}
|
|
116
130
|
|
|
@@ -121,13 +135,15 @@ updateSettings<S>(container, settings);
|
|
|
121
135
|
bindNodeCore(container);
|
|
122
136
|
bindProduct(container, Manifest, I18n);
|
|
123
137
|
|
|
124
|
-
container
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
(await container.rebind<UCClientConfirmManager>('UCClientConfirmManager')).to(
|
|
139
|
+
MCPStdioUCClientConfirmManager,
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
container.bind<ServerManager>('ServerManager').to(NodeMCPStdioServerManager);
|
|
127
143
|
|
|
128
144
|
export default container;
|
|
129
145
|
`;
|
|
130
|
-
const
|
|
146
|
+
const NODE_MCP_SERVER_STDIO_INDEX_TS = `import { MCPServerBooter } from '${LIB_NAME}/node-mcp';
|
|
131
147
|
|
|
132
148
|
import container from './container.js';
|
|
133
149
|
|
|
@@ -135,7 +151,7 @@ await container.get(MCPServerBooter).exec({
|
|
|
135
151
|
srcImporter: (path) => import(path),
|
|
136
152
|
});
|
|
137
153
|
`;
|
|
138
|
-
const
|
|
154
|
+
const NODE_MCP_SERVER_STDIO_SETTINGS_TS = `import {
|
|
139
155
|
type LoggerSettings,
|
|
140
156
|
type ServerClientManagerSettings,
|
|
141
157
|
TARGET_DEFAULT_SERVER_CLIENT_MANAGER_SETTINGS,
|
|
@@ -188,10 +204,10 @@ const MAPPING = {
|
|
|
188
204
|
[['.', 'index.ts'], SERVER_INDEX_TS],
|
|
189
205
|
[['.', 'settings.ts'], SERVER_SETTINGS_TS],
|
|
190
206
|
]),
|
|
191
|
-
'node-mcp-server': new Map([
|
|
192
|
-
[['.', 'container.ts'],
|
|
193
|
-
[['.', 'index.ts'],
|
|
194
|
-
[['.', 'settings.ts'],
|
|
207
|
+
'node-mcp-server-stdio': new Map([
|
|
208
|
+
[['.', 'container.ts'], NODE_MCP_SERVER_STDIO_CONTAINER_TS],
|
|
209
|
+
[['.', 'index.ts'], NODE_MCP_SERVER_STDIO_INDEX_TS],
|
|
210
|
+
[['.', 'settings.ts'], NODE_MCP_SERVER_STDIO_SETTINGS_TS],
|
|
195
211
|
]),
|
|
196
212
|
'node-stricli-cli': new Map(),
|
|
197
213
|
'react-native-pure': new Map(),
|
package/dist/esm/convention.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AppName } from './app/index.js';
|
|
2
|
+
import type { FileName } from './dt/index.js';
|
|
2
3
|
import type { ProductName } from './product/index.js';
|
|
3
4
|
import type { TargetName } from './target/index.js';
|
|
4
5
|
import type { UCName } from './uc/index.js';
|
|
@@ -60,3 +61,4 @@ export declare const UC_POLICY_FILE_NAME_SUFFIX: string;
|
|
|
60
61
|
export declare const PRODUCT_ROOT_FROM_PRODUCT_TARGET_PATH: string[];
|
|
61
62
|
export declare const APPS_PATH_FROM_PRODUCT_TARGET_PATH: string[];
|
|
62
63
|
export declare const TARGET_NAME_PLACEHOLDER: TargetName;
|
|
64
|
+
export declare const TARGET_DEF_FILE_NAME: FileName;
|
package/dist/esm/convention.js
CHANGED
|
@@ -38,8 +38,10 @@ export class TObject extends TBase {
|
|
|
38
38
|
}
|
|
39
39
|
jsonSchemaType() {
|
|
40
40
|
const example = this.example();
|
|
41
|
-
const
|
|
42
|
-
|
|
41
|
+
const exampleKV = Object.entries(example);
|
|
42
|
+
const properties = exampleKV.reduce((acc, [key, value]) => {
|
|
43
|
+
const k = key;
|
|
44
|
+
const typeofv = typeof value;
|
|
43
45
|
// TODO : Make this work recursively
|
|
44
46
|
switch (typeofv) {
|
|
45
47
|
case 'boolean':
|
|
@@ -49,11 +51,17 @@ export class TObject extends TBase {
|
|
|
49
51
|
case 'number':
|
|
50
52
|
acc[k] = { type: 'number' };
|
|
51
53
|
break;
|
|
52
|
-
case 'function':
|
|
53
54
|
case 'object':
|
|
55
|
+
acc[k] = {
|
|
56
|
+
additionalProperties: false,
|
|
57
|
+
properties: {},
|
|
58
|
+
type: 'object',
|
|
59
|
+
};
|
|
60
|
+
break;
|
|
61
|
+
case 'function':
|
|
54
62
|
case 'symbol':
|
|
55
63
|
case 'undefined':
|
|
56
|
-
|
|
64
|
+
// Nothing to do
|
|
57
65
|
break;
|
|
58
66
|
case 'string':
|
|
59
67
|
acc[k] = { type: 'string' };
|
|
@@ -63,7 +71,7 @@ export class TObject extends TBase {
|
|
|
63
71
|
}
|
|
64
72
|
return acc;
|
|
65
73
|
}, {});
|
|
66
|
-
return { properties, type: 'object' };
|
|
74
|
+
return { additionalProperties: false, properties, type: 'object' };
|
|
67
75
|
}
|
|
68
76
|
validate() {
|
|
69
77
|
const validation = super.validate();
|
package/dist/esm/dt/index.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export { TUsername, type Username } from './final/TUsername.js';
|
|
|
76
76
|
export { TUUID, type UUID } from './final/TUUID.js';
|
|
77
77
|
export { TYear, type Year } from './final/TYear.js';
|
|
78
78
|
export { TYesNo, type YesNo } from './final/TYesNo.js';
|
|
79
|
-
export type { JSONSchemaNumberFormat,
|
|
79
|
+
export type { JSONSchemaNumberFormat, JSONSchemaObject, JSONSchemaProperty, JSONSchemaStringFormat, JSONSchemaType, } from './targets/json-schema.js';
|
|
80
80
|
export type { RNInputMode } from './targets/rn.js';
|
|
81
81
|
export type { HTMLInputType } from './targets/web.js';
|
|
82
82
|
export { Validation, type Violation, type ViolationFormat, type ViolationI18n, type ViolationI18nable, type ViolationType, } from './Validation.js';
|
|
@@ -1,24 +1,36 @@
|
|
|
1
|
+
import type { StringKeys } from '../../utils/index.js';
|
|
2
|
+
import type { DataType } from '../DataType.js';
|
|
1
3
|
export type JSONSchemaNumberFormat = 'double' | 'float' | 'int32' | 'int64';
|
|
2
4
|
export type JSONSchemaStringFormat = 'binary' | 'byte' | 'date' | 'date-time' | 'email' | 'hostname' | 'ipv4' | 'ipv6' | 'password' | 'time' | 'uuid' | 'uri';
|
|
3
|
-
export type JSONSchemaObjectProperties = Record<string, JSONSchemaType>;
|
|
4
5
|
export type JSONSchemaType = {
|
|
5
|
-
type: 'array';
|
|
6
|
+
type: 'array' | ['array', 'null'];
|
|
6
7
|
items: JSONSchemaType;
|
|
7
|
-
maxItems?: number
|
|
8
|
-
minItems?: number
|
|
9
|
-
uniqueItems?: boolean
|
|
8
|
+
maxItems?: number;
|
|
9
|
+
minItems?: number;
|
|
10
|
+
uniqueItems?: boolean;
|
|
10
11
|
} | {
|
|
11
|
-
type: 'boolean';
|
|
12
|
+
type: 'boolean' | ['boolean', 'null'];
|
|
12
13
|
} | {
|
|
13
|
-
type: 'integer';
|
|
14
|
+
type: 'integer' | ['integer', 'null'];
|
|
14
15
|
} | {
|
|
15
|
-
type: 'number';
|
|
16
|
+
type: 'number' | ['number', 'null'];
|
|
16
17
|
format?: JSONSchemaNumberFormat;
|
|
17
18
|
} | {
|
|
18
|
-
|
|
19
|
-
properties
|
|
19
|
+
additionalProperties: false;
|
|
20
|
+
properties: Record<string, JSONSchemaType>;
|
|
20
21
|
required?: string[];
|
|
22
|
+
type: 'object' | ['object', 'null'];
|
|
21
23
|
} | {
|
|
22
|
-
type: 'string';
|
|
24
|
+
type: 'string' | ['string', 'null'];
|
|
23
25
|
format?: JSONSchemaStringFormat;
|
|
24
26
|
};
|
|
27
|
+
export type JSONSchemaProperty<T extends DataType> = JSONSchemaType & {
|
|
28
|
+
enum?: (T | null)[];
|
|
29
|
+
examples?: T[];
|
|
30
|
+
};
|
|
31
|
+
export interface JSONSchemaObject<T extends object> {
|
|
32
|
+
additionalProperties: false;
|
|
33
|
+
properties: Record<StringKeys<T>, JSONSchemaProperty<any>>;
|
|
34
|
+
required?: StringKeys<T>[];
|
|
35
|
+
type: 'object' | ['object', 'null'];
|
|
36
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { ErrorMessage, HTTPStatusNumber } from '../dt/index.js';
|
|
|
2
2
|
import type { Class } from '../utils/index.js';
|
|
3
3
|
import type { CustomError } from './CustomError.js';
|
|
4
4
|
export declare const ERROR_HTTP_STATUS_MAP: Map<HTTPStatusNumber, Class<CustomError>>;
|
|
5
|
+
export declare function logDevWarning(message: ErrorMessage): void;
|
|
5
6
|
export declare function isEmptyJSON(err: unknown): boolean;
|
|
6
7
|
export declare function isInvalidJSON(err: unknown): boolean;
|
|
7
8
|
export declare function throwCustomError(message: ErrorMessage, status: HTTPStatusNumber): never;
|
package/dist/esm/error/funcs.js
CHANGED
|
@@ -12,6 +12,10 @@ export const ERROR_HTTP_STATUS_MAP = new Map([
|
|
|
12
12
|
[500, InternalServerError],
|
|
13
13
|
[503, UnavailableError],
|
|
14
14
|
]);
|
|
15
|
+
export function logDevWarning(message) {
|
|
16
|
+
// biome-ignore lint/suspicious/noConsole: we want it
|
|
17
|
+
console.warn(`\x1b[1m\x1b[33m[WARNING] ${message}\x1b[0m`);
|
|
18
|
+
}
|
|
15
19
|
export function isEmptyJSON(err) {
|
|
16
20
|
return (err instanceof Error &&
|
|
17
21
|
err.message.toLowerCase().includes('unexpected end of json input'));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CustomError, type ServerError } from './CustomError.js';
|
|
2
2
|
export { ForbiddenAsNotFoundError } from './ForbiddenAsNotFoundError.js';
|
|
3
3
|
export { ForbiddenError } from './ForbiddenError.js';
|
|
4
|
-
export { ERROR_HTTP_STATUS_MAP, isEmptyJSON, isInvalidJSON, throwCustomError, } from './funcs.js';
|
|
4
|
+
export { ERROR_HTTP_STATUS_MAP, isEmptyJSON, isInvalidJSON, logDevWarning, throwCustomError, } from './funcs.js';
|
|
5
5
|
export { IllegalArgumentError } from './IllegalArgumentError.js';
|
|
6
6
|
export { InternalServerError } from './InternalServerError.js';
|
|
7
7
|
export { NotAvailableError } from './internal/NotAvailableError.js';
|
package/dist/esm/error/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { CustomError } from './CustomError.js';
|
|
2
2
|
export { ForbiddenAsNotFoundError } from './ForbiddenAsNotFoundError.js';
|
|
3
3
|
export { ForbiddenError } from './ForbiddenError.js';
|
|
4
|
-
export { ERROR_HTTP_STATUS_MAP, isEmptyJSON, isInvalidJSON, throwCustomError, } from './funcs.js';
|
|
4
|
+
export { ERROR_HTTP_STATUS_MAP, isEmptyJSON, isInvalidJSON, logDevWarning, throwCustomError, } from './funcs.js';
|
|
5
5
|
export { IllegalArgumentError } from './IllegalArgumentError.js';
|
|
6
6
|
export { InternalServerError } from './InternalServerError.js';
|
|
7
7
|
export { NotAvailableError } from './internal/NotAvailableError.js';
|
|
@@ -17,6 +17,8 @@ export const I18nDE = {
|
|
|
17
17
|
err_unauthorized: 'Nicht autorisiert',
|
|
18
18
|
err_unavailable: 'Nicht verfügbar',
|
|
19
19
|
err_unexpected: 'Unerwarteter Fehler',
|
|
20
|
+
res_200: 'OK',
|
|
21
|
+
res_204: 'Kein Inhalt',
|
|
20
22
|
uc_client_confirm_cancel: 'Abbrechen',
|
|
21
23
|
uc_client_confirm_confirm: 'Ja',
|
|
22
24
|
uc_client_confirm_message: '',
|
|
@@ -17,6 +17,8 @@ export const I18nEN = {
|
|
|
17
17
|
err_unauthorized: 'Unauthorized',
|
|
18
18
|
err_unavailable: 'Unavailable',
|
|
19
19
|
err_unexpected: 'Unexpected error',
|
|
20
|
+
res_200: 'OK',
|
|
21
|
+
res_204: 'No content',
|
|
20
22
|
uc_client_confirm_cancel: 'Cancel',
|
|
21
23
|
uc_client_confirm_confirm: 'Yes',
|
|
22
24
|
uc_client_confirm_message: '',
|
|
@@ -17,6 +17,8 @@ export const I18nES = {
|
|
|
17
17
|
err_unauthorized: 'No autorizado',
|
|
18
18
|
err_unavailable: 'No disponible',
|
|
19
19
|
err_unexpected: 'Error inesperado',
|
|
20
|
+
res_200: 'OK',
|
|
21
|
+
res_204: 'Sin contenido',
|
|
20
22
|
uc_client_confirm_cancel: 'Cancelar',
|
|
21
23
|
uc_client_confirm_confirm: 'Sí',
|
|
22
24
|
uc_client_confirm_message: '',
|
|
@@ -17,6 +17,8 @@ export const I18nFR = {
|
|
|
17
17
|
err_unauthorized: 'Non autorisé',
|
|
18
18
|
err_unavailable: 'Non disponible',
|
|
19
19
|
err_unexpected: 'Erreur inattendue',
|
|
20
|
+
res_200: 'OK',
|
|
21
|
+
res_204: 'Aucun contenu',
|
|
20
22
|
uc_client_confirm_cancel: 'Annuler',
|
|
21
23
|
uc_client_confirm_confirm: 'Oui',
|
|
22
24
|
uc_client_confirm_message: '',
|
package/dist/esm/i18n/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type I18nLanguageCode = 'de' | 'en' | 'es' | 'fr';
|
|
|
8
8
|
*/
|
|
9
9
|
export type I18nTranslation = string;
|
|
10
10
|
export type I18nTranslationKey = string;
|
|
11
|
-
export type I18nCoreKey = ViolationI18nable | `dt_FreeTextShort_constr_${keyof TStringConstraints}` | `dt_File_constr_${keyof TFileConstraints}` | `dt_YesNo_${YesNo}_${keyof UCWording}` | 'err_forbidden' | 'err_illegal_argument' | 'err_not_found' | 'err_uc_data_store_not_readable' | 'err_uc_data_store_not_writable' | 'err_unauthorized' | 'err_unavailable' | 'err_unexpected' | `uc_client_confirm_${keyof UCClientConfirmConfig}` | `uc_i_submit_${UCExecState}`;
|
|
11
|
+
export type I18nCoreKey = ViolationI18nable | `dt_FreeTextShort_constr_${keyof TStringConstraints}` | `dt_File_constr_${keyof TFileConstraints}` | `dt_YesNo_${YesNo}_${keyof UCWording}` | 'err_forbidden' | 'err_illegal_argument' | 'err_not_found' | 'err_uc_data_store_not_readable' | 'err_uc_data_store_not_writable' | 'err_unauthorized' | 'err_unavailable' | 'err_unexpected' | 'res_200' | 'res_204' | `uc_client_confirm_${keyof UCClientConfirmConfig}` | `uc_i_submit_${UCExecState}`;
|
|
12
12
|
export type I18nCoreTranslations = Record<I18nCoreKey, I18nTranslation>;
|
|
13
13
|
export type I18nSource = any;
|
|
14
14
|
export type I18nSourceSafe = {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -30,7 +30,10 @@ export * from './std/impl/UCDataStoreExternalResourceManager.js';
|
|
|
30
30
|
export * from './std/index.js';
|
|
31
31
|
export * from './target/index.js';
|
|
32
32
|
export * from './target/lib/cli/CLIManager.js';
|
|
33
|
+
export * from './target/lib/client/AuthDataStore.js';
|
|
33
34
|
export * from './target/lib/client/consts.js';
|
|
35
|
+
export * from './target/lib/client/impl/InMemoryAuthDataStore.js';
|
|
36
|
+
export * from './target/lib/client/impl/MixedServerClientManager.js';
|
|
34
37
|
export * from './target/lib/client/ServerClientManager.js';
|
|
35
38
|
export * from './target/lib/server/consts.js';
|
|
36
39
|
export * from './target/lib/server/EntrypointsBuilder.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -31,7 +31,10 @@ export * from './std/impl/UCDataStoreExternalResourceManager.js';
|
|
|
31
31
|
export * from './std/index.js';
|
|
32
32
|
export * from './target/index.js';
|
|
33
33
|
export * from './target/lib/cli/CLIManager.js';
|
|
34
|
+
export * from './target/lib/client/AuthDataStore.js';
|
|
34
35
|
export * from './target/lib/client/consts.js';
|
|
36
|
+
export * from './target/lib/client/impl/InMemoryAuthDataStore.js';
|
|
37
|
+
export * from './target/lib/client/impl/MixedServerClientManager.js';
|
|
35
38
|
export * from './target/lib/client/ServerClientManager.js';
|
|
36
39
|
export * from './target/lib/server/consts.js';
|
|
37
40
|
export * from './target/lib/server/EntrypointsBuilder.js';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { MCPHTTPExpressFakeRequestHandlerBuilder } from './target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.js';
|
|
2
|
+
export type { MCPHTTPExpressRequestHandlerBuilder } from './target/lib/mcp-server/http/express/types.js';
|
|
1
3
|
export { buildHandler, init, mountHandler, toFile, toReq, toRes, } from './target/lib/server-express/funcs.js';
|
|
2
4
|
export { HelmetMiddlewareBuilder } from './target/lib/server-express/HelmetMiddlewareBuilder.js';
|
|
3
5
|
export { NodeExpressServerManager } from './target/node-express-server/NodeExpressServerManager.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { MCPHTTPExpressFakeRequestHandlerBuilder } from './target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.js';
|
|
1
2
|
export { buildHandler, init, mountHandler, toFile, toReq, toRes, } from './target/lib/server-express/funcs.js';
|
|
2
3
|
export { HelmetMiddlewareBuilder } from './target/lib/server-express/HelmetMiddlewareBuilder.js';
|
|
3
4
|
export { NodeExpressServerManager } from './target/node-express-server/NodeExpressServerManager.js';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export { MCPHTTPHonoFakeRequestHandlerBuilder } from './target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.js';
|
|
2
|
+
export type { MCPHTTPHonoRequestHandlerBuilder } from './target/lib/mcp-server/http/hono/types.js';
|
|
1
3
|
export { buildHandler, init, mountHandler, toReq, toRes, } from './target/lib/server-hono/funcs.js';
|
|
2
4
|
export { NodeHonoServerManager } from './target/node-hono-server/NodeHonoServerManager.js';
|
|
3
5
|
export { bindServer } from './utils/ioc/bindServer.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { MCPHTTPHonoFakeRequestHandlerBuilder } from './target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.js';
|
|
1
2
|
export { buildHandler, init, mountHandler, toReq, toRes, } from './target/lib/server-hono/funcs.js';
|
|
2
3
|
export { NodeHonoServerManager } from './target/node-hono-server/NodeHonoServerManager.js';
|
|
3
4
|
export { bindServer } from './utils/ioc/bindServer.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { MCPHTTPExpressFakeRequestHandlerBuilder } from './target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.js';
|
|
2
|
+
export { MCPHTTPExpressProtocolRequestHandlerBuilder } from './target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.js';
|
|
3
|
+
export type { MCPHTTPExpressRequestHandlerBuilder } from './target/lib/mcp-server/http/express/types.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { MCPHTTPExpressFakeRequestHandlerBuilder } from './target/lib/mcp-server/http/express/MCPHTTPExpressFakeRequestHandlerBuilder.js';
|
|
2
|
+
export { MCPHTTPExpressProtocolRequestHandlerBuilder } from './target/lib/mcp-server/http/express/MCPHTTPExpressProtocolRequestHandlerBuilder.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { MCPHTTPHonoFakeRequestHandlerBuilder } from './target/lib/mcp-server/http/hono/MCPHTTPHonoFakeRequestHandlerBuilder.js';
|
|
2
|
+
export { MCPHTTPHonoProtocolRequestHandlerBuilder } from './target/lib/mcp-server/http/hono/MCPHTTPHonoProtocolRequestHandlerBuilder.js';
|
|
3
|
+
export type { MCPHTTPHonoRequestHandlerBuilder } from './target/lib/mcp-server/http/hono/types.js';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { MCPServerBooter } from './target/lib/mcp-server/MCPServerBooter.js';
|
|
2
|
-
export {
|
|
2
|
+
export { MCPStdioRequestHandler } from './target/lib/mcp-server/stdio/MCPStdioRequestHandler.js';
|
|
3
|
+
export { MCPStdioUCClientConfirmManager } from './target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.js';
|
|
4
|
+
export { NodeMCPStdioServerManager } from './target/node-mcp-server-stdio/NodeMCPStdioServerManager.js';
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { MCPServerBooter } from './target/lib/mcp-server/MCPServerBooter.js';
|
|
2
|
-
export {
|
|
2
|
+
export { MCPStdioRequestHandler } from './target/lib/mcp-server/stdio/MCPStdioRequestHandler.js';
|
|
3
|
+
export { MCPStdioUCClientConfirmManager } from './target/lib/mcp-server/stdio/MCPStdioUCClientConfirmManager.js';
|
|
4
|
+
export { NodeMCPStdioServerManager } from './target/node-mcp-server-stdio/NodeMCPStdioServerManager.js';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { logDevWarning } from '../../error/index.js';
|
|
1
2
|
const UNSAFE_SETTING = 'UNSAFE_CHANGE_ME';
|
|
2
3
|
export function unsafeDefaultSetting(suffix = '') {
|
|
3
4
|
return `${UNSAFE_SETTING}${suffix}`;
|
|
4
5
|
}
|
|
5
6
|
export function assertSettingNotUnsafe(key, value) {
|
|
6
7
|
if (typeof value === 'string' && value.startsWith(UNSAFE_SETTING)) {
|
|
7
|
-
throw new Error(`"${key}" still has the unsafe default value
|
|
8
|
+
throw new Error(`"${key}" still has the unsafe default value`);
|
|
8
9
|
}
|
|
9
10
|
if (Array.isArray(value)) {
|
|
10
11
|
for (const v of value) {
|
|
@@ -28,12 +29,10 @@ export function checkSettings(settings, throwIfViolations) {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
if (violations.length > 0) {
|
|
31
|
-
|
|
32
|
-
const message = `\x1b[1m\x1b[33m[WARNING] THE SETTINGS ARE NOT SAFE (THIS WILL THROW IN PROD) :\n${violations.join('\n')}\x1b[0m`;
|
|
32
|
+
const message = `Settings contain violations :\n${violations.join('\n')}`;
|
|
33
33
|
if (throwIfViolations) {
|
|
34
34
|
throw new Error(message);
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
console.warn(message);
|
|
36
|
+
logDevWarning(message);
|
|
38
37
|
}
|
|
39
38
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
2
|
import type { AppManifest } from '../../app/index.js';
|
|
3
3
|
import type { DirPath, URLPath } from '../../dt/index.js';
|
|
4
|
+
import type { ProductUCsLoaderOutput } from '../../product/index.js';
|
|
4
5
|
import type { Configurable, SettingsManager } from '../../std/index.js';
|
|
5
6
|
import type { UCDataStore, UCDef, UCHTTPContract, UCInput, UCManager, UCOPIBase } from '../../uc/index.js';
|
|
6
7
|
import type { OpenAPISpec } from '../lib/openapi/types.js';
|
|
@@ -28,6 +29,7 @@ export declare class SyncEdgeWorkerHonoServerManager implements Configurable<S>,
|
|
|
28
29
|
initSync(): void;
|
|
29
30
|
mount<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>(_appManifest: AppManifest, _ucd: UCDef<I, OPI0, OPI1>, _contract: UCHTTPContract): Promise<void>;
|
|
30
31
|
mountSync<I extends UCInput | undefined = undefined, OPI0 extends UCOPIBase | undefined = undefined, OPI1 extends UCOPIBase | undefined = undefined>(appManifest: AppManifest, ucd: UCDef<I, OPI0, OPI1>, contract: UCHTTPContract): void;
|
|
32
|
+
mountMCP(_ucs: ProductUCsLoaderOutput, _at: URLPath): Promise<void>;
|
|
31
33
|
mountOpenAPISpec(_spec: OpenAPISpec, _at: URLPath): Promise<void>;
|
|
32
34
|
mountStaticDir(_dirPath: DirPath): Promise<void>;
|
|
33
35
|
start(): Promise<void>;
|
|
@@ -55,6 +55,9 @@ let SyncEdgeWorkerHonoServerManager = class SyncEdgeWorkerHonoServerManager {
|
|
|
55
55
|
mountSync(appManifest, ucd, contract) {
|
|
56
56
|
mountHandler(contract, this.runtime, buildHandler(appManifest, ucd, contract, this.serverRequestHandler, this.ucManager, (c) => this.beforeExec(c)));
|
|
57
57
|
}
|
|
58
|
+
async mountMCP(_ucs, _at) {
|
|
59
|
+
throw new NotImplementedError('mountMCP');
|
|
60
|
+
}
|
|
58
61
|
async mountOpenAPISpec(_spec, _at) {
|
|
59
62
|
throw new NotImplementedError('mountOpenAPISpec');
|
|
60
63
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { TARGETS, type TargetName } from './lib/manifest.js';
|
|
1
|
+
export { TARGET_CAPABILITIES_SAMPLE, TARGETS, type TargetCapabilities, TargetCapability, type TargetDef, type TargetDefSrc, type TargetName, } from './lib/manifest.js';
|
|
2
2
|
export type { OpenAPISpec } from './lib/openapi/types.js';
|
package/dist/esm/target/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TARGETS } from './lib/manifest.js';
|
|
1
|
+
export { TARGET_CAPABILITIES_SAMPLE, TARGETS, TargetCapability, } from './lib/manifest.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { JWT } from '../../../../dt/index.js';
|
|
2
|
+
import type { AuthDataStore } from '../AuthDataStore.js';
|
|
3
|
+
export declare class InMemoryAuthDataStore implements AuthDataStore {
|
|
4
|
+
private jwt;
|
|
5
|
+
get(): Promise<JWT | null>;
|
|
6
|
+
set(jwt: JWT | null): Promise<void>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { injectable } from 'inversify';
|
|
8
|
+
let InMemoryAuthDataStore = class InMemoryAuthDataStore {
|
|
9
|
+
jwt = null;
|
|
10
|
+
async get() {
|
|
11
|
+
return this.jwt;
|
|
12
|
+
}
|
|
13
|
+
async set(jwt) {
|
|
14
|
+
this.jwt = jwt;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
InMemoryAuthDataStore = __decorate([
|
|
18
|
+
injectable()
|
|
19
|
+
], InMemoryAuthDataStore);
|
|
20
|
+
export { InMemoryAuthDataStore };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ApiKey, JWT, URL } from '../../../../dt/index.js';
|
|
2
|
+
import { SettingsServerClientManager } from '../../../../std/impl/SettingsServerClientManager.js';
|
|
3
|
+
import type { HTTPAPICallerBasicAuth } from '../../../../std/index.js';
|
|
4
|
+
import type { AuthDataStore } from '../AuthDataStore.js';
|
|
5
|
+
import type { ServerClientManager, ServerClientManagerOpts } from '../ServerClientManager.js';
|
|
6
|
+
export declare class MixedServerClientManager implements ServerClientManager {
|
|
7
|
+
private authDataStore;
|
|
8
|
+
private settingsServerClientManager;
|
|
9
|
+
constructor(authDataStore: AuthDataStore, settingsServerClientManager: SettingsServerClientManager);
|
|
10
|
+
authApiKey(opts?: ServerClientManagerOpts): Promise<ApiKey | null>;
|
|
11
|
+
authBasic(opts?: ServerClientManagerOpts): Promise<HTTPAPICallerBasicAuth | null>;
|
|
12
|
+
authJWT(_opts?: ServerClientManagerOpts): Promise<JWT | null>;
|
|
13
|
+
baseURL(opts?: ServerClientManagerOpts): Promise<URL>;
|
|
14
|
+
publicApiKey(opts?: ServerClientManagerOpts): Promise<ApiKey | null>;
|
|
15
|
+
}
|