@tsed/config 8.18.1 → 8.19.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.
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { Type } from "@tsed/core";
|
|
2
|
-
import { JsonSchema } from "@tsed/schema";
|
|
3
2
|
export interface ConfigSourceOptions<Opts = any> {
|
|
4
3
|
/**
|
|
5
4
|
* The name of the configuration provider.
|
|
@@ -25,9 +24,13 @@ export interface ConfigSourceOptions<Opts = any> {
|
|
|
25
24
|
*/
|
|
26
25
|
options: Opts;
|
|
27
26
|
/**
|
|
28
|
-
*
|
|
27
|
+
* A JsonSchema instance to validate the configuration values against.
|
|
29
28
|
*/
|
|
30
|
-
validationSchema?:
|
|
29
|
+
validationSchema?: {
|
|
30
|
+
toJSON(opts: Record<string, unknown>): Record<string, unknown> & {
|
|
31
|
+
required?: string[];
|
|
32
|
+
};
|
|
33
|
+
};
|
|
31
34
|
/**
|
|
32
35
|
* Enable FileSystem Watch mode. ConfigSource must implement the `watch()` method.
|
|
33
36
|
*/
|
|
@@ -3,7 +3,11 @@ import type { ConfigSource, InitialConfigSourceOptions } from "../interfaces/Con
|
|
|
3
3
|
export declare function withOptions<Opts>(use: Type<ConfigSource<Opts>>, { name, priority, validationSchema, enabled, refreshOn, watch, ...opts }: InitialConfigSourceOptions & Opts): {
|
|
4
4
|
name: string | undefined;
|
|
5
5
|
priority: number | undefined;
|
|
6
|
-
validationSchema:
|
|
6
|
+
validationSchema: {
|
|
7
|
+
toJSON(opts: Record<string, unknown>): Record<string, unknown> & {
|
|
8
|
+
required?: string[];
|
|
9
|
+
};
|
|
10
|
+
} | undefined;
|
|
7
11
|
use: Type<ConfigSource<Opts>>;
|
|
8
12
|
watch: boolean | undefined;
|
|
9
13
|
refreshOn: "request" | "response" | undefined;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/config",
|
|
3
3
|
"description": "Configuration management for Ts.ED",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.
|
|
5
|
+
"version": "8.19.0",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Ts.ED",
|
|
8
8
|
"Configuration",
|
|
@@ -64,16 +64,16 @@
|
|
|
64
64
|
"tslib": "2.7.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@tsed/barrels": "8.
|
|
68
|
-
"@tsed/core": "8.
|
|
69
|
-
"@tsed/di": "8.
|
|
70
|
-
"@tsed/typescript": "8.
|
|
67
|
+
"@tsed/barrels": "8.19.0",
|
|
68
|
+
"@tsed/core": "8.19.0",
|
|
69
|
+
"@tsed/di": "8.19.0",
|
|
70
|
+
"@tsed/typescript": "8.19.0",
|
|
71
71
|
"@types/js-yaml": "4.0.9",
|
|
72
72
|
"dotenv": "^16.5.0",
|
|
73
73
|
"dotenv-expand": "^12.0.2",
|
|
74
74
|
"dotenv-flow": "^4.1.0",
|
|
75
75
|
"eslint": "9.12.0",
|
|
76
|
-
"typescript": "5.
|
|
76
|
+
"typescript": "5.9.3",
|
|
77
77
|
"vitest": "3.2.4"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type {Type} from "@tsed/core";
|
|
2
|
-
import {JsonSchema} from "@tsed/schema";
|
|
3
2
|
|
|
4
3
|
export interface ConfigSourceOptions<Opts = any> {
|
|
5
4
|
/**
|
|
@@ -28,9 +27,9 @@ export interface ConfigSourceOptions<Opts = any> {
|
|
|
28
27
|
*/
|
|
29
28
|
options: Opts;
|
|
30
29
|
/**
|
|
31
|
-
*
|
|
30
|
+
* A JsonSchema instance to validate the configuration values against.
|
|
32
31
|
*/
|
|
33
|
-
validationSchema?:
|
|
32
|
+
validationSchema?: {toJSON(opts: Record<string, unknown>): Record<string, unknown> & {required?: string[]}};
|
|
34
33
|
/**
|
|
35
34
|
* Enable FileSystem Watch mode. ConfigSource must implement the `watch()` method.
|
|
36
35
|
*/
|
|
@@ -55,7 +54,9 @@ export interface ConfigSource<Opts = any> {
|
|
|
55
54
|
options: Opts;
|
|
56
55
|
|
|
57
56
|
$onInit?(): Promise<void> | void;
|
|
57
|
+
|
|
58
58
|
$onDestroy?(): Promise<void> | void;
|
|
59
|
+
|
|
59
60
|
/**
|
|
60
61
|
* Load configuration from the source.
|
|
61
62
|
*/
|