@spinajs/configuration 2.0.179 → 2.0.181

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,8 +1,8 @@
1
- declare const config: {
2
- configuration: {
3
- isDevelopment: boolean;
4
- isProduction: boolean;
5
- };
6
- };
7
- export default config;
1
+ declare const config: {
2
+ configuration: {
3
+ isDevelopment: boolean;
4
+ isProduction: boolean;
5
+ };
6
+ };
7
+ export default config;
8
8
  //# sourceMappingURL=configuration.d.ts.map
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const config = {
4
- configuration: {
5
- isDevelopment: process.env.NODE_ENV === 'development',
6
- isProduction: process.env.NODE_ENV === 'production',
7
- },
8
- };
9
- exports.default = config;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const config = {
4
+ configuration: {
5
+ isDevelopment: process.env.NODE_ENV === 'development',
6
+ isProduction: process.env.NODE_ENV === 'production',
7
+ },
8
+ };
9
+ exports.default = config;
10
10
  //# sourceMappingURL=configuration.js.map
@@ -1,82 +1,82 @@
1
- import { ConfigurationSource, Configuration, ConfigurationOptions, IConfigurationSchema } from '@spinajs/configuration-common';
2
- import { Class, Container } from '@spinajs/di';
3
- import './sources.js';
4
- /**
5
- * HACK:
6
- * Becouse of ajv not supporting esm default exports we need to
7
- * check for default export module property and if not provided use module itself
8
- */
9
- export declare class FrameworkConfiguration extends Configuration {
10
- /**
11
- * Apps configuration base dir, where to look for app config
12
- */
13
- AppBaseDir: string;
14
- /**
15
- * Current running app name
16
- */
17
- RunApp: string;
18
- /**
19
- * Loaded & merged configuration
20
- */
21
- protected Config: Record<string, unknown>;
22
- protected CustomConfigPaths: string[];
23
- protected Sources: ConfigurationSource[];
24
- /**
25
- * We ignore this error because ajv have problems with
26
- * commonjs / esm default exports
27
- */
28
- protected Validator: any;
29
- protected ValidationSchemas: IConfigurationSchema[];
30
- get RootConfig(): Record<string, unknown>;
31
- protected Container: Container;
32
- /**
33
- *
34
- * @param app - application name, pass it when you run in application mode
35
- * @param baseDir - configuration base dir, where to look for application configs
36
- * @param cfgCustomPaths - custom cfg paths eg. to load config from non standard folders ( usefull in tests )
37
- */
38
- constructor(options?: ConfigurationOptions);
39
- /**
40
- * Get config value for given property. If value not exists it returns default value, if default value is not provided returns undefined
41
- *
42
- * @param path - path to property eg. ["system","dirs"]
43
- * @param defaultValue - optional, if value at specified path not exists returns default value
44
- */
45
- get<T>(path: string[] | string, defaultValue?: T): T;
46
- /**
47
- * Sets at given path configuration value. Use when you want to override config
48
- * loaded from files programatically
49
- *
50
- * @param path - config path
51
- * @param value - value to set
52
- */
53
- set(path: string[] | string, value: unknown): void;
54
- /**
55
- * Merge existing config value with new options instead overriding
56
- *
57
- * @param path - cfg path
58
- * @param value - value to merge
59
- */
60
- merge(path: string[] | string, value: unknown): void;
61
- resolve(): Promise<void>;
62
- mergeSource(sType: Class<ConfigurationSource>): Promise<void>;
63
- /**
64
- * Reloads configuration data
65
- */
66
- load(): Promise<void>;
67
- protected onLoad(): unknown;
68
- protected loadSources(): void;
69
- protected validate(): void;
70
- protected initValidator(): void;
71
- protected dir(toJoin: string): string;
72
- /**
73
- * adds app dirs to system.dirs config
74
- */
75
- protected applyAppDirs(): void;
76
- /**
77
- * runs configuration func on files
78
- * eg. when you want to configure stuff at beginning eq. external libs
79
- */
80
- protected configure(): void;
81
- }
1
+ import { ConfigurationSource, Configuration, ConfigurationOptions, IConfigurationSchema } from '@spinajs/configuration-common';
2
+ import { Class, Container } from '@spinajs/di';
3
+ import './sources.js';
4
+ /**
5
+ * HACK:
6
+ * Becouse of ajv not supporting esm default exports we need to
7
+ * check for default export module property and if not provided use module itself
8
+ */
9
+ export declare class FrameworkConfiguration extends Configuration {
10
+ /**
11
+ * Apps configuration base dir, where to look for app config
12
+ */
13
+ AppBaseDir: string;
14
+ /**
15
+ * Current running app name
16
+ */
17
+ RunApp: string;
18
+ /**
19
+ * Loaded & merged configuration
20
+ */
21
+ protected Config: Record<string, unknown>;
22
+ protected CustomConfigPaths: string[];
23
+ protected Sources: ConfigurationSource[];
24
+ /**
25
+ * We ignore this error because ajv have problems with
26
+ * commonjs / esm default exports
27
+ */
28
+ protected Validator: any;
29
+ protected ValidationSchemas: IConfigurationSchema[];
30
+ get RootConfig(): Record<string, unknown>;
31
+ protected Container: Container;
32
+ /**
33
+ *
34
+ * @param app - application name, pass it when you run in application mode
35
+ * @param baseDir - configuration base dir, where to look for application configs
36
+ * @param cfgCustomPaths - custom cfg paths eg. to load config from non standard folders ( usefull in tests )
37
+ */
38
+ constructor(options?: ConfigurationOptions);
39
+ /**
40
+ * Get config value for given property. If value not exists it returns default value, if default value is not provided returns undefined
41
+ *
42
+ * @param path - path to property eg. ["system","dirs"]
43
+ * @param defaultValue - optional, if value at specified path not exists returns default value
44
+ */
45
+ get<T>(path: string[] | string, defaultValue?: T): T;
46
+ /**
47
+ * Sets at given path configuration value. Use when you want to override config
48
+ * loaded from files programatically
49
+ *
50
+ * @param path - config path
51
+ * @param value - value to set
52
+ */
53
+ set(path: string[] | string, value: unknown): void;
54
+ /**
55
+ * Merge existing config value with new options instead overriding
56
+ *
57
+ * @param path - cfg path
58
+ * @param value - value to merge
59
+ */
60
+ merge(path: string[] | string, value: unknown): void;
61
+ resolve(): Promise<void>;
62
+ mergeSource(sType: Class<ConfigurationSource>): Promise<void>;
63
+ /**
64
+ * Reloads configuration data
65
+ */
66
+ load(): Promise<void>;
67
+ protected onLoad(): unknown;
68
+ protected loadSources(): void;
69
+ protected validate(): void;
70
+ protected initValidator(): void;
71
+ protected dir(toJoin: string): string;
72
+ /**
73
+ * adds app dirs to system.dirs config
74
+ */
75
+ protected applyAppDirs(): void;
76
+ /**
77
+ * runs configuration func on files
78
+ * eg. when you want to configure stuff at beginning eq. external libs
79
+ */
80
+ protected configure(): void;
81
+ }
82
82
  //# sourceMappingURL=configuration.d.ts.map