keryx 0.11.0 → 0.11.2
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/api.ts +3 -2
- package/config/index.ts +29 -1
- package/package.json +1 -1
- package/util/scaffold.ts +2 -2
package/api.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { API } from "./classes/API";
|
|
2
2
|
import type { Logger } from "./classes/Logger";
|
|
3
|
+
import type { KeryxConfig } from "./config";
|
|
3
4
|
import { config as Config } from "./config";
|
|
4
5
|
|
|
5
6
|
export {
|
|
@@ -30,14 +31,14 @@ export type {
|
|
|
30
31
|
declare namespace globalThis {
|
|
31
32
|
let api: API;
|
|
32
33
|
let logger: Logger;
|
|
33
|
-
let config:
|
|
34
|
+
let config: KeryxConfig;
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
if (!globalThis.api) {
|
|
37
38
|
// @ts-ignore — augmented API properties (db, redis, etc.) are set later by initializers at runtime
|
|
38
39
|
globalThis.api = new API();
|
|
39
40
|
globalThis.logger = globalThis.api.logger;
|
|
40
|
-
globalThis.config = Config;
|
|
41
|
+
globalThis.config = Config as KeryxConfig;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
/** The global API singleton. All framework state (actions, db, redis, etc.) is accessed through this object. */
|
package/config/index.ts
CHANGED
|
@@ -26,4 +26,32 @@ export const config = {
|
|
|
26
26
|
tasks: configTasks,
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
/**
|
|
30
|
+
* The type of the merged configuration object. Applications can extend this
|
|
31
|
+
* via module augmentation to add custom config sections:
|
|
32
|
+
*
|
|
33
|
+
* ```typescript
|
|
34
|
+
* declare module "keryx" {
|
|
35
|
+
* interface KeryxConfig {
|
|
36
|
+
* audit: { retentionDays: number };
|
|
37
|
+
* }
|
|
38
|
+
* }
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export interface KeryxConfig {
|
|
42
|
+
actions: typeof configActions;
|
|
43
|
+
channels: typeof configChannels;
|
|
44
|
+
process: typeof configProcess;
|
|
45
|
+
logger: typeof configLogger;
|
|
46
|
+
database: typeof configDatabase;
|
|
47
|
+
observability: typeof configObservability;
|
|
48
|
+
redis: typeof configRedis;
|
|
49
|
+
rateLimit: typeof configRateLimit;
|
|
50
|
+
session: typeof configSession;
|
|
51
|
+
server: {
|
|
52
|
+
cli: typeof configServerCli;
|
|
53
|
+
web: typeof configServerWeb;
|
|
54
|
+
mcp: typeof configServerMcp;
|
|
55
|
+
};
|
|
56
|
+
tasks: typeof configTasks;
|
|
57
|
+
}
|
package/package.json
CHANGED
package/util/scaffold.ts
CHANGED
|
@@ -105,11 +105,11 @@ export async function generateConfigFileContents(): Promise<
|
|
|
105
105
|
);
|
|
106
106
|
|
|
107
107
|
// In index.ts, change `export const config` to `export default`
|
|
108
|
-
// and remove the KeryxConfig
|
|
108
|
+
// and remove the KeryxConfig interface export (it comes from the package)
|
|
109
109
|
if (file === "index.ts") {
|
|
110
110
|
content = content.replace("export const config =", "export default");
|
|
111
111
|
content = content.replace(
|
|
112
|
-
/\nexport
|
|
112
|
+
/\nexport interface KeryxConfig \{[\s\S]*?\}\n/,
|
|
113
113
|
"\n",
|
|
114
114
|
);
|
|
115
115
|
}
|