@powerlines/plugin-env 0.16.233 → 0.16.235
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/dist/babel/plugin.cjs +23 -71
- package/dist/babel/plugin.d.cts.map +1 -1
- package/dist/babel/plugin.d.mts.map +1 -1
- package/dist/babel/plugin.mjs +23 -71
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +14 -14
- package/dist/components/docs.d.cts +0 -2
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts +0 -2
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +14 -14
- package/dist/components/docs.mjs.map +1 -1
- package/dist/components/env-builtin.cjs +233 -426
- package/dist/components/env-builtin.d.cts +1 -4
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.d.mts +1 -4
- package/dist/components/env-builtin.d.mts.map +1 -1
- package/dist/components/env-builtin.mjs +236 -428
- package/dist/components/env-builtin.mjs.map +1 -1
- package/dist/helpers/index.cjs +9 -26
- package/dist/helpers/index.d.cts +3 -5
- package/dist/helpers/index.d.mts +3 -5
- package/dist/helpers/index.mjs +3 -5
- package/dist/helpers/load.cjs +8 -7
- package/dist/helpers/load.d.cts +3 -3
- package/dist/helpers/load.d.cts.map +1 -1
- package/dist/helpers/load.d.mts +3 -3
- package/dist/helpers/load.d.mts.map +1 -1
- package/dist/helpers/load.mjs +7 -6
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/schema.cjs +206 -0
- package/dist/helpers/schema.d.cts +53 -0
- package/dist/helpers/schema.d.cts.map +1 -0
- package/dist/helpers/schema.d.mts +53 -0
- package/dist/helpers/schema.d.mts.map +1 -0
- package/dist/helpers/schema.mjs +199 -0
- package/dist/helpers/schema.mjs.map +1 -0
- package/dist/index.cjs +23 -201
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +25 -203
- package/dist/index.mjs.map +1 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.mjs +2 -2
- package/dist/types/plugin.cjs +16 -24
- package/dist/types/plugin.d.cts +23 -57
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +23 -57
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs +16 -25
- package/dist/types/plugin.mjs.map +1 -1
- package/package.json +12 -26
- package/dist/helpers/create-reflection-resource.cjs +0 -23
- package/dist/helpers/create-reflection-resource.d.cts +0 -13
- package/dist/helpers/create-reflection-resource.d.cts.map +0 -1
- package/dist/helpers/create-reflection-resource.d.mts +0 -13
- package/dist/helpers/create-reflection-resource.d.mts.map +0 -1
- package/dist/helpers/create-reflection-resource.mjs +0 -23
- package/dist/helpers/create-reflection-resource.mjs.map +0 -1
- package/dist/helpers/persistence.cjs +0 -309
- package/dist/helpers/persistence.d.cts +0 -84
- package/dist/helpers/persistence.d.cts.map +0 -1
- package/dist/helpers/persistence.d.mts +0 -84
- package/dist/helpers/persistence.d.mts.map +0 -1
- package/dist/helpers/persistence.mjs +0 -297
- package/dist/helpers/persistence.mjs.map +0 -1
- package/dist/helpers/reflect.cjs +0 -290
- package/dist/helpers/reflect.d.cts +0 -68
- package/dist/helpers/reflect.d.cts.map +0 -1
- package/dist/helpers/reflect.d.mts +0 -68
- package/dist/helpers/reflect.d.mts.map +0 -1
- package/dist/helpers/reflect.mjs +0 -281
- package/dist/helpers/reflect.mjs.map +0 -1
- package/dist/helpers/template-helpers.cjs +0 -70
- package/dist/helpers/template-helpers.d.cts +0 -15
- package/dist/helpers/template-helpers.d.cts.map +0 -1
- package/dist/helpers/template-helpers.d.mts +0 -15
- package/dist/helpers/template-helpers.d.mts.map +0 -1
- package/dist/helpers/template-helpers.mjs +0 -69
- package/dist/helpers/template-helpers.mjs.map +0 -1
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { EnvInterface, SecretsInterface } from "../types/env.cjs";
|
|
2
|
-
import { EnvPluginContext } from "../types/plugin.cjs";
|
|
3
|
-
import { ReflectionClass, TypeClass, TypeObjectLiteral } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/reflect.d.ts
|
|
6
|
-
declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
7
|
-
declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
8
|
-
interface CreateEnvReflectionOptions {
|
|
9
|
-
type?: TypeObjectLiteral | TypeClass;
|
|
10
|
-
superReflection?: ReflectionClass<any>;
|
|
11
|
-
}
|
|
12
|
-
declare class BaseEnv implements EnvInterface {
|
|
13
|
-
APP_NAME: string;
|
|
14
|
-
APP_VERSION: string;
|
|
15
|
-
BUILD_ID: string;
|
|
16
|
-
BUILD_TIMESTAMP: string;
|
|
17
|
-
BUILD_CHECKSUM: string;
|
|
18
|
-
RELEASE_ID: string;
|
|
19
|
-
RELEASE_TAG: string;
|
|
20
|
-
ORGANIZATION: string;
|
|
21
|
-
PLATFORM: "node" | "browser" | "neutral";
|
|
22
|
-
MODE: "development" | "test" | "production";
|
|
23
|
-
ENVIRONMENT: string;
|
|
24
|
-
DEBUG: boolean;
|
|
25
|
-
TEST: boolean;
|
|
26
|
-
MINIMAL: boolean;
|
|
27
|
-
NO_COLOR: boolean;
|
|
28
|
-
FORCE_COLOR: number | boolean;
|
|
29
|
-
FORCE_HYPERLINK: number | boolean;
|
|
30
|
-
STACKTRACE: boolean;
|
|
31
|
-
INCLUDE_ERROR_DATA: boolean;
|
|
32
|
-
ERROR_URL: string;
|
|
33
|
-
DEFAULT_TIMEZONE: string;
|
|
34
|
-
DEFAULT_LOCALE: string;
|
|
35
|
-
CI: boolean;
|
|
36
|
-
}
|
|
37
|
-
declare class BaseSecrets implements SecretsInterface {
|
|
38
|
-
ENCRYPTION_KEY: string;
|
|
39
|
-
}
|
|
40
|
-
declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
41
|
-
declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
42
|
-
/**
|
|
43
|
-
* Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
* The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.
|
|
47
|
-
*
|
|
48
|
-
* @param context - The plugin context
|
|
49
|
-
* @param file - The file path to reflect the environment configuration type definition from
|
|
50
|
-
* @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.
|
|
51
|
-
* @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.
|
|
52
|
-
*/
|
|
53
|
-
declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
54
|
-
/**
|
|
55
|
-
* Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.
|
|
56
|
-
*
|
|
57
|
-
* @remarks
|
|
58
|
-
* The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.
|
|
59
|
-
*
|
|
60
|
-
* @param context - The plugin context
|
|
61
|
-
* @param file - The file path to reflect the secrets configuration type definition from
|
|
62
|
-
* @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.
|
|
63
|
-
* @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.
|
|
64
|
-
*/
|
|
65
|
-
declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
66
|
-
//#endregion
|
|
67
|
-
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
|
|
68
|
-
//# sourceMappingURL=reflect.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.cts","names":[],"sources":["../../src/helpers/reflect.ts"],"mappings":";;;;;iBAuCgB,mBAAA,CACd,OAAA,EAAS,gBAAA,EACT,WAAA,EAAa,eAAA,UACZ,eAAA;AAAA,iBAQa,uBAAA,CACd,OAAA,EAAS,gBAAA,EACT,WAAA,EAAa,eAAA,UACZ,eAAA;AAAA,UAQc,0BAAA;EACf,IAAA,GAAO,iBAAA,GAAoB,SAAA;EAC3B,eAAA,GAAkB,eAAA;AAAA;AAAA,cAGP,OAAA,YAAmB,YAAY;EAC1C,QAAA;EAEA,WAAA;EAEA,QAAA;EAEA,eAAA;EAEA,cAAA;EAEA,UAAA;EAEA,WAAA;EAEA,YAAA;EAEA,QAAA;EAEA,IAAA;EAEA,WAAA;EAEA,KAAA;EAEA,IAAA;EAEA,OAAA;EAEA,QAAA;EAEA,WAAA;EAEA,eAAA;EAEA,UAAA;EAEA,kBAAA;EAEA,SAAA;EAEA,gBAAA;EAEA,cAAA;EAEA,EAAA;AAAA;AAAA,cAGW,WAAA,YAAuB,gBAAgB;EAClD,cAAc;AAAA;AAAA,iBAGA,mBAAA,CACd,OAAA,EAAS,gBAAA,EACT,OAAA,GAAS,0BAAA,GACR,eAAA;AAAA,iBAyCa,uBAAA,CACd,OAAA,EAAS,gBAAA,EACT,OAAA,GAAS,0BAAA,GACR,eAAA;;;;;;;;;;;AAtGgC;iBA0Jb,UAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,WACA,IAAA,YAAa,OAAA,CAAA,eAAA;;;;;;;;;;;;iBAwCO,cAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,WACA,IAAA,YAAa,OAAA,CAAA,eAAA"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { EnvInterface, SecretsInterface } from "../types/env.mjs";
|
|
2
|
-
import { EnvPluginContext } from "../types/plugin.mjs";
|
|
3
|
-
import { ReflectionClass, TypeClass, TypeObjectLiteral } from "@powerlines/deepkit/vendor/type";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/reflect.d.ts
|
|
6
|
-
declare function mergeEnvReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
7
|
-
declare function mergeSecretsReflections(context: EnvPluginContext, reflections: ReflectionClass<any>[]): ReflectionClass<any>;
|
|
8
|
-
interface CreateEnvReflectionOptions {
|
|
9
|
-
type?: TypeObjectLiteral | TypeClass;
|
|
10
|
-
superReflection?: ReflectionClass<any>;
|
|
11
|
-
}
|
|
12
|
-
declare class BaseEnv implements EnvInterface {
|
|
13
|
-
APP_NAME: string;
|
|
14
|
-
APP_VERSION: string;
|
|
15
|
-
BUILD_ID: string;
|
|
16
|
-
BUILD_TIMESTAMP: string;
|
|
17
|
-
BUILD_CHECKSUM: string;
|
|
18
|
-
RELEASE_ID: string;
|
|
19
|
-
RELEASE_TAG: string;
|
|
20
|
-
ORGANIZATION: string;
|
|
21
|
-
PLATFORM: "node" | "browser" | "neutral";
|
|
22
|
-
MODE: "development" | "test" | "production";
|
|
23
|
-
ENVIRONMENT: string;
|
|
24
|
-
DEBUG: boolean;
|
|
25
|
-
TEST: boolean;
|
|
26
|
-
MINIMAL: boolean;
|
|
27
|
-
NO_COLOR: boolean;
|
|
28
|
-
FORCE_COLOR: number | boolean;
|
|
29
|
-
FORCE_HYPERLINK: number | boolean;
|
|
30
|
-
STACKTRACE: boolean;
|
|
31
|
-
INCLUDE_ERROR_DATA: boolean;
|
|
32
|
-
ERROR_URL: string;
|
|
33
|
-
DEFAULT_TIMEZONE: string;
|
|
34
|
-
DEFAULT_LOCALE: string;
|
|
35
|
-
CI: boolean;
|
|
36
|
-
}
|
|
37
|
-
declare class BaseSecrets implements SecretsInterface {
|
|
38
|
-
ENCRYPTION_KEY: string;
|
|
39
|
-
}
|
|
40
|
-
declare function createEnvReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
41
|
-
declare function createSecretsReflection(context: EnvPluginContext, options?: CreateEnvReflectionOptions): ReflectionClass<any>;
|
|
42
|
-
/**
|
|
43
|
-
* Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
* The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.
|
|
47
|
-
*
|
|
48
|
-
* @param context - The plugin context
|
|
49
|
-
* @param file - The file path to reflect the environment configuration type definition from
|
|
50
|
-
* @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.
|
|
51
|
-
* @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.
|
|
52
|
-
*/
|
|
53
|
-
declare function reflectEnv(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
54
|
-
/**
|
|
55
|
-
* Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.
|
|
56
|
-
*
|
|
57
|
-
* @remarks
|
|
58
|
-
* The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.
|
|
59
|
-
*
|
|
60
|
-
* @param context - The plugin context
|
|
61
|
-
* @param file - The file path to reflect the secrets configuration type definition from
|
|
62
|
-
* @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.
|
|
63
|
-
* @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.
|
|
64
|
-
*/
|
|
65
|
-
declare function reflectSecrets(context: EnvPluginContext, file?: string, name?: string): Promise<ReflectionClass<any>>;
|
|
66
|
-
//#endregion
|
|
67
|
-
export { BaseEnv, BaseSecrets, CreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
|
|
68
|
-
//# sourceMappingURL=reflect.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.d.mts","names":[],"sources":["../../src/helpers/reflect.ts"],"mappings":";;;;;iBAuCgB,mBAAA,CACd,OAAA,EAAS,gBAAA,EACT,WAAA,EAAa,eAAA,UACZ,eAAA;AAAA,iBAQa,uBAAA,CACd,OAAA,EAAS,gBAAA,EACT,WAAA,EAAa,eAAA,UACZ,eAAA;AAAA,UAQc,0BAAA;EACf,IAAA,GAAO,iBAAA,GAAoB,SAAA;EAC3B,eAAA,GAAkB,eAAA;AAAA;AAAA,cAGP,OAAA,YAAmB,YAAY;EAC1C,QAAA;EAEA,WAAA;EAEA,QAAA;EAEA,eAAA;EAEA,cAAA;EAEA,UAAA;EAEA,WAAA;EAEA,YAAA;EAEA,QAAA;EAEA,IAAA;EAEA,WAAA;EAEA,KAAA;EAEA,IAAA;EAEA,OAAA;EAEA,QAAA;EAEA,WAAA;EAEA,eAAA;EAEA,UAAA;EAEA,kBAAA;EAEA,SAAA;EAEA,gBAAA;EAEA,cAAA;EAEA,EAAA;AAAA;AAAA,cAGW,WAAA,YAAuB,gBAAgB;EAClD,cAAc;AAAA;AAAA,iBAGA,mBAAA,CACd,OAAA,EAAS,gBAAA,EACT,OAAA,GAAS,0BAAA,GACR,eAAA;AAAA,iBAyCa,uBAAA,CACd,OAAA,EAAS,gBAAA,EACT,OAAA,GAAS,0BAAA,GACR,eAAA;;;;;;;;;;;AAtGgC;iBA0Jb,UAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,WACA,IAAA,YAAa,OAAA,CAAA,eAAA;;;;;;;;;;;;iBAwCO,cAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,WACA,IAAA,YAAa,OAAA,CAAA,eAAA"}
|
package/dist/helpers/reflect.mjs
DELETED
|
@@ -1,281 +0,0 @@
|
|
|
1
|
-
import { __ΩEnvPluginContext } from "../types/plugin.mjs";
|
|
2
|
-
import { __ΩEnvInterface, __ΩSecretsInterface } from "../types/env.mjs";
|
|
3
|
-
import { getEnvDefaultTypeDefinition, getSecretsDefaultTypeDefinition, readEnvTypeReflection, readSecretsReflection } from "./persistence.mjs";
|
|
4
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
5
|
-
import { ReflectionClass, ReflectionKind, merge, resolveClassType } from "@powerlines/deepkit/vendor/type";
|
|
6
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
7
|
-
import { resolveReflection } from "@powerlines/schema/resolve";
|
|
8
|
-
import { isParentPath } from "@stryke/path/is-parent-path";
|
|
9
|
-
|
|
10
|
-
//#region src/helpers/reflect.ts
|
|
11
|
-
function __assignType(fn, args) {
|
|
12
|
-
fn.__type = args;
|
|
13
|
-
return fn;
|
|
14
|
-
}
|
|
15
|
-
function mergeEnvReflections(context, reflections) {
|
|
16
|
-
return createEnvReflection(context, { type: merge(reflections.map(__assignType((reflection) => reflection.type, [
|
|
17
|
-
"reflection",
|
|
18
|
-
"",
|
|
19
|
-
"P\"2!\"/\""
|
|
20
|
-
]))) });
|
|
21
|
-
}
|
|
22
|
-
mergeEnvReflections.__type = [
|
|
23
|
-
() => __ΩEnvPluginContext,
|
|
24
|
-
"context",
|
|
25
|
-
"reflections",
|
|
26
|
-
"mergeEnvReflections",
|
|
27
|
-
"Pn!2\"!F2#!/$"
|
|
28
|
-
];
|
|
29
|
-
function mergeSecretsReflections(context, reflections) {
|
|
30
|
-
return createSecretsReflection(context, { type: merge(reflections.map(__assignType((reflection) => reflection.type, [
|
|
31
|
-
"reflection",
|
|
32
|
-
"",
|
|
33
|
-
"P\"2!\"/\""
|
|
34
|
-
]))) });
|
|
35
|
-
}
|
|
36
|
-
mergeSecretsReflections.__type = [
|
|
37
|
-
() => __ΩEnvPluginContext,
|
|
38
|
-
"context",
|
|
39
|
-
"reflections",
|
|
40
|
-
"mergeSecretsReflections",
|
|
41
|
-
"Pn!2\"!F2#!/$"
|
|
42
|
-
];
|
|
43
|
-
const __ΩCreateEnvReflectionOptions = [
|
|
44
|
-
"type",
|
|
45
|
-
"superReflection",
|
|
46
|
-
"CreateEnvReflectionOptions",
|
|
47
|
-
"PP!!J4!8!4\"8Mw#y"
|
|
48
|
-
];
|
|
49
|
-
var BaseEnv = class {
|
|
50
|
-
APP_NAME;
|
|
51
|
-
APP_VERSION;
|
|
52
|
-
BUILD_ID;
|
|
53
|
-
BUILD_TIMESTAMP;
|
|
54
|
-
BUILD_CHECKSUM;
|
|
55
|
-
RELEASE_ID;
|
|
56
|
-
RELEASE_TAG;
|
|
57
|
-
ORGANIZATION;
|
|
58
|
-
PLATFORM = "neutral";
|
|
59
|
-
MODE = "production";
|
|
60
|
-
ENVIRONMENT;
|
|
61
|
-
DEBUG = false;
|
|
62
|
-
TEST = false;
|
|
63
|
-
MINIMAL = false;
|
|
64
|
-
NO_COLOR = false;
|
|
65
|
-
FORCE_COLOR = false;
|
|
66
|
-
FORCE_HYPERLINK = false;
|
|
67
|
-
STACKTRACE = false;
|
|
68
|
-
INCLUDE_ERROR_DATA = false;
|
|
69
|
-
ERROR_URL;
|
|
70
|
-
DEFAULT_TIMEZONE;
|
|
71
|
-
DEFAULT_LOCALE;
|
|
72
|
-
CI = false;
|
|
73
|
-
static __type = [
|
|
74
|
-
"APP_NAME",
|
|
75
|
-
"APP_VERSION",
|
|
76
|
-
"BUILD_ID",
|
|
77
|
-
"BUILD_TIMESTAMP",
|
|
78
|
-
"BUILD_CHECKSUM",
|
|
79
|
-
"RELEASE_ID",
|
|
80
|
-
"RELEASE_TAG",
|
|
81
|
-
"ORGANIZATION",
|
|
82
|
-
"node",
|
|
83
|
-
"browser",
|
|
84
|
-
"neutral",
|
|
85
|
-
"PLATFORM",
|
|
86
|
-
function() {
|
|
87
|
-
return "neutral";
|
|
88
|
-
},
|
|
89
|
-
"development",
|
|
90
|
-
"test",
|
|
91
|
-
"production",
|
|
92
|
-
"MODE",
|
|
93
|
-
function() {
|
|
94
|
-
return "production";
|
|
95
|
-
},
|
|
96
|
-
"ENVIRONMENT",
|
|
97
|
-
"DEBUG",
|
|
98
|
-
function() {
|
|
99
|
-
return false;
|
|
100
|
-
},
|
|
101
|
-
"TEST",
|
|
102
|
-
function() {
|
|
103
|
-
return false;
|
|
104
|
-
},
|
|
105
|
-
"MINIMAL",
|
|
106
|
-
function() {
|
|
107
|
-
return false;
|
|
108
|
-
},
|
|
109
|
-
"NO_COLOR",
|
|
110
|
-
function() {
|
|
111
|
-
return false;
|
|
112
|
-
},
|
|
113
|
-
"FORCE_COLOR",
|
|
114
|
-
function() {
|
|
115
|
-
return false;
|
|
116
|
-
},
|
|
117
|
-
"FORCE_HYPERLINK",
|
|
118
|
-
function() {
|
|
119
|
-
return false;
|
|
120
|
-
},
|
|
121
|
-
"STACKTRACE",
|
|
122
|
-
function() {
|
|
123
|
-
return false;
|
|
124
|
-
},
|
|
125
|
-
"INCLUDE_ERROR_DATA",
|
|
126
|
-
function() {
|
|
127
|
-
return false;
|
|
128
|
-
},
|
|
129
|
-
"ERROR_URL",
|
|
130
|
-
"DEFAULT_TIMEZONE",
|
|
131
|
-
"DEFAULT_LOCALE",
|
|
132
|
-
"CI",
|
|
133
|
-
function() {
|
|
134
|
-
return false;
|
|
135
|
-
},
|
|
136
|
-
() => __ΩEnvInterface,
|
|
137
|
-
"BaseEnv",
|
|
138
|
-
"&3!&3\"&3#&3$&3%&3&&3'&3(P.).*.+J3,>-P.../.0J31>2&33)34>5)36>7)38>9)3:>;P')J3<>=P')J3>>?)3@>A)3B>C&3D&3E&3F)3G>H5nIx\"wJ"
|
|
139
|
-
];
|
|
140
|
-
};
|
|
141
|
-
var BaseSecrets = class {
|
|
142
|
-
ENCRYPTION_KEY;
|
|
143
|
-
static __type = [
|
|
144
|
-
"ENCRYPTION_KEY",
|
|
145
|
-
() => __ΩSecretsInterface,
|
|
146
|
-
"BaseSecrets",
|
|
147
|
-
"&3!5n\"x\"w#"
|
|
148
|
-
];
|
|
149
|
-
};
|
|
150
|
-
function createEnvReflection(context, options = {}) {
|
|
151
|
-
const parent = options.superReflection ?? new ReflectionClass({
|
|
152
|
-
kind: ReflectionKind.class,
|
|
153
|
-
description: `The base environment configuration definition for the ${titleCase(context.config.name)} project.`,
|
|
154
|
-
classType: BaseEnv,
|
|
155
|
-
types: [],
|
|
156
|
-
implements: [{
|
|
157
|
-
kind: ReflectionKind.objectLiteral,
|
|
158
|
-
typeName: "EnvInterface",
|
|
159
|
-
description: `The environment configuration interface definition for the ${titleCase(context.config.name)} project.`,
|
|
160
|
-
types: []
|
|
161
|
-
}]
|
|
162
|
-
});
|
|
163
|
-
parent.name = "Env";
|
|
164
|
-
const result = new ReflectionClass(options.type ?? {
|
|
165
|
-
kind: ReflectionKind.objectLiteral,
|
|
166
|
-
typeName: "Env",
|
|
167
|
-
description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${titleCase(context.config.name)} application` : "application"}.`,
|
|
168
|
-
types: []
|
|
169
|
-
}, parent);
|
|
170
|
-
result.name = "Env";
|
|
171
|
-
return result;
|
|
172
|
-
}
|
|
173
|
-
createEnvReflection.__type = [
|
|
174
|
-
() => __ΩEnvPluginContext,
|
|
175
|
-
"context",
|
|
176
|
-
() => __ΩCreateEnvReflectionOptions,
|
|
177
|
-
"options",
|
|
178
|
-
() => ({}),
|
|
179
|
-
"createEnvReflection",
|
|
180
|
-
"Pn!2\"n#2$>%!/&"
|
|
181
|
-
];
|
|
182
|
-
function createSecretsReflection(context, options = {}) {
|
|
183
|
-
const parent = options.superReflection ?? new ReflectionClass({
|
|
184
|
-
kind: ReflectionKind.class,
|
|
185
|
-
description: `The base secrets configuration definition for the ${titleCase(context.config.name)} project.`,
|
|
186
|
-
classType: BaseSecrets,
|
|
187
|
-
types: [],
|
|
188
|
-
implements: [{
|
|
189
|
-
kind: ReflectionKind.objectLiteral,
|
|
190
|
-
typeName: "SecretsInterface",
|
|
191
|
-
description: `The secrets configuration interface definition for the ${titleCase(context.config.name)} project.`,
|
|
192
|
-
types: []
|
|
193
|
-
}]
|
|
194
|
-
});
|
|
195
|
-
parent.name = "Secrets";
|
|
196
|
-
const result = new ReflectionClass(options.type ?? {
|
|
197
|
-
kind: ReflectionKind.objectLiteral,
|
|
198
|
-
typeName: "Secrets",
|
|
199
|
-
description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${titleCase(context.config.name)} application` : "application"}.`,
|
|
200
|
-
types: []
|
|
201
|
-
}, parent);
|
|
202
|
-
result.name = "Secrets";
|
|
203
|
-
return result;
|
|
204
|
-
}
|
|
205
|
-
createSecretsReflection.__type = [
|
|
206
|
-
() => __ΩEnvPluginContext,
|
|
207
|
-
"context",
|
|
208
|
-
() => __ΩCreateEnvReflectionOptions,
|
|
209
|
-
"options",
|
|
210
|
-
() => ({}),
|
|
211
|
-
"createSecretsReflection",
|
|
212
|
-
"Pn!2\"n#2$>%!/&"
|
|
213
|
-
];
|
|
214
|
-
/**
|
|
215
|
-
* Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.
|
|
216
|
-
*
|
|
217
|
-
* @remarks
|
|
218
|
-
* The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.
|
|
219
|
-
*
|
|
220
|
-
* @param context - The plugin context
|
|
221
|
-
* @param file - The file path to reflect the environment configuration type definition from
|
|
222
|
-
* @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.
|
|
223
|
-
* @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.
|
|
224
|
-
*/
|
|
225
|
-
async function reflectEnv(context, file, name) {
|
|
226
|
-
let config;
|
|
227
|
-
if (file) config = resolveClassType(await resolveReflection(context, {
|
|
228
|
-
file: !isParentPath(file, context.config.cwd) ? joinPaths(context.config.cwd, file) : file,
|
|
229
|
-
name
|
|
230
|
-
}));
|
|
231
|
-
return mergeEnvReflections(context, [
|
|
232
|
-
await readEnvTypeReflection(context, "env"),
|
|
233
|
-
config,
|
|
234
|
-
resolveClassType(await resolveReflection(context, await getEnvDefaultTypeDefinition(context)))
|
|
235
|
-
].filter(Boolean));
|
|
236
|
-
}
|
|
237
|
-
reflectEnv.__type = [
|
|
238
|
-
() => __ΩEnvPluginContext,
|
|
239
|
-
"context",
|
|
240
|
-
"file",
|
|
241
|
-
"name",
|
|
242
|
-
"reflectEnv",
|
|
243
|
-
"Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.",
|
|
244
|
-
"Pn!2\"&2#8&2$8\"/%?&"
|
|
245
|
-
];
|
|
246
|
-
/**
|
|
247
|
-
* Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.
|
|
248
|
-
*
|
|
249
|
-
* @remarks
|
|
250
|
-
* The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.
|
|
251
|
-
*
|
|
252
|
-
* @param context - The plugin context
|
|
253
|
-
* @param file - The file path to reflect the secrets configuration type definition from
|
|
254
|
-
* @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.
|
|
255
|
-
* @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.
|
|
256
|
-
*/
|
|
257
|
-
async function reflectSecrets(context, file, name) {
|
|
258
|
-
let config;
|
|
259
|
-
if (file) config = resolveClassType(await resolveReflection(context, {
|
|
260
|
-
file: !isParentPath(file, context.config.cwd) ? joinPaths(context.config.cwd, file) : file,
|
|
261
|
-
name
|
|
262
|
-
}));
|
|
263
|
-
return mergeSecretsReflections(context, [
|
|
264
|
-
await readSecretsReflection(context),
|
|
265
|
-
config,
|
|
266
|
-
resolveClassType(await resolveReflection(context, await getSecretsDefaultTypeDefinition(context)))
|
|
267
|
-
].filter(Boolean));
|
|
268
|
-
}
|
|
269
|
-
reflectSecrets.__type = [
|
|
270
|
-
() => __ΩEnvPluginContext,
|
|
271
|
-
"context",
|
|
272
|
-
"file",
|
|
273
|
-
"name",
|
|
274
|
-
"reflectSecrets",
|
|
275
|
-
"Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.",
|
|
276
|
-
"Pn!2\"&2#8&2$8\"/%?&"
|
|
277
|
-
];
|
|
278
|
-
|
|
279
|
-
//#endregion
|
|
280
|
-
export { BaseEnv, BaseSecrets, __ΩCreateEnvReflectionOptions, createEnvReflection, createSecretsReflection, mergeEnvReflections, mergeSecretsReflections, reflectEnv, reflectSecrets };
|
|
281
|
-
//# sourceMappingURL=reflect.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reflect.mjs","names":[],"sources":["../../src/helpers/reflect.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n merge,\n ReflectionClass,\n ReflectionKind,\n resolveClassType,\n TypeClass,\n TypeObjectLiteral\n} from \"@powerlines/deepkit/vendor/type\";\nimport { resolveReflection } from \"@powerlines/schema/resolve\";\nimport { isParentPath } from \"@stryke/path/is-parent-path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvInterface, SecretsInterface } from \"../types/env\";\nimport { EnvPluginContext } from \"../types/plugin\";\nimport {\n getEnvDefaultTypeDefinition,\n getSecretsDefaultTypeDefinition,\n readEnvTypeReflection,\n readSecretsReflection\n} from \"./persistence\";\n\nexport function mergeEnvReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createEnvReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport function mergeSecretsReflections(\n context: EnvPluginContext,\n reflections: ReflectionClass<any>[]\n): ReflectionClass<any> {\n const reflection = createSecretsReflection(context, {\n type: merge(reflections.map(reflection => reflection.type))\n });\n\n return reflection;\n}\n\nexport interface CreateEnvReflectionOptions {\n type?: TypeObjectLiteral | TypeClass;\n superReflection?: ReflectionClass<any>;\n}\n\nexport class BaseEnv implements EnvInterface {\n APP_NAME!: string;\n\n APP_VERSION!: string;\n\n BUILD_ID!: string;\n\n BUILD_TIMESTAMP!: string;\n\n BUILD_CHECKSUM!: string;\n\n RELEASE_ID!: string;\n\n RELEASE_TAG!: string;\n\n ORGANIZATION!: string;\n\n PLATFORM: \"node\" | \"browser\" | \"neutral\" = \"neutral\";\n\n MODE: \"development\" | \"test\" | \"production\" = \"production\";\n\n ENVIRONMENT!: string;\n\n DEBUG: boolean = false;\n\n TEST: boolean = false;\n\n MINIMAL: boolean = false;\n\n NO_COLOR: boolean = false;\n\n FORCE_COLOR: number | boolean = false;\n\n FORCE_HYPERLINK: number | boolean = false;\n\n STACKTRACE: boolean = false;\n\n INCLUDE_ERROR_DATA: boolean = false;\n\n ERROR_URL!: string;\n\n DEFAULT_TIMEZONE!: string;\n\n DEFAULT_LOCALE!: string;\n\n CI: boolean = false;\n}\n\nexport class BaseSecrets implements SecretsInterface {\n ENCRYPTION_KEY!: string;\n}\n\nexport function createEnvReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base environment configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseEnv,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"EnvInterface\",\n description: `The environment configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Env\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `A schema describing the list of available environment variables that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Env\";\n\n return result;\n}\n\nexport function createSecretsReflection(\n context: EnvPluginContext,\n options: CreateEnvReflectionOptions = {}\n): ReflectionClass<any> {\n const parent =\n options.superReflection ??\n new ReflectionClass({\n kind: ReflectionKind.class,\n description: `The base secrets configuration definition for the ${titleCase(\n context.config.name\n )} project.`,\n classType: BaseSecrets,\n types: [],\n implements: [\n {\n kind: ReflectionKind.objectLiteral,\n typeName: \"SecretsInterface\",\n description: `The secrets configuration interface definition for the ${titleCase(\n context.config.name\n )} project.`,\n types: []\n }\n ]\n });\n parent.name = \"Secrets\";\n\n const result = new ReflectionClass(\n options.type ?? {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `A schema describing the list of available environment secrets that can be used by the ${\n context.config.name\n ? `${titleCase(context.config.name)} application`\n : \"application\"\n }.`,\n types: []\n },\n parent\n );\n result.name = \"Secrets\";\n\n return result;\n}\n\n/**\n * Reflects the environment configuration type definition from the provided file and name, and merges it with the default environment configuration reflection and the currently used environment configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the environment configuration type definition from\n * @param name - The name of the type definition to reflect the environment configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the environment configuration type definition, merged with the default environment configuration reflection and the currently used environment configuration reflection. The resulting reflection will contain the structure of the expected environment variables as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default environment configuration reflection.\n */\nexport async function reflectEnv(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await resolveReflection(context, {\n file: !isParentPath(file, context.config.cwd)\n ? joinPaths(context.config.cwd, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeEnvReflections(\n context,\n [\n await readEnvTypeReflection(context, \"env\"),\n config,\n resolveClassType(\n await resolveReflection(\n context,\n await getEnvDefaultTypeDefinition(context)\n )\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n\n/**\n * Reflects the secrets configuration type definition from the provided file and name, and merges it with the default secrets configuration reflection and the currently used secrets configuration reflection.\n *\n * @remarks\n * The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n *\n * @param context - The plugin context\n * @param file - The file path to reflect the secrets configuration type definition from\n * @param name - The name of the type definition to reflect the secrets configuration from, if the file contains multiple type definitions. If not provided, the first type definition found in the file will be used.\n * @returns A reflection of the secrets configuration type definition, merged with the default secrets configuration reflection and the currently used secrets configuration reflection. The resulting reflection will contain the structure of the expected environment secrets as defined by the type definitions provided in the plugin configuration, as well as any additional properties that are currently used in the source code and defined in the default secrets configuration reflection.\n */\nexport async function reflectSecrets(\n context: EnvPluginContext,\n file?: string,\n name?: string\n) {\n let config: ReflectionClass<any> | undefined;\n if (file) {\n const configType = await resolveReflection(context, {\n file: !isParentPath(file, context.config.cwd)\n ? joinPaths(context.config.cwd, file)\n : file,\n name\n });\n\n config = resolveClassType(configType);\n }\n\n return mergeSecretsReflections(\n context,\n [\n await readSecretsReflection(context),\n config,\n resolveClassType(\n await resolveReflection(\n context,\n await getSecretsDefaultTypeDefinition(context)\n )\n )\n ].filter(Boolean) as ReflectionClass<any>[]\n );\n}\n"],"mappings":"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"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
const require_types_plugin = require('../types/plugin.cjs');
|
|
4
|
-
const require_helpers_persistence = require('./persistence.cjs');
|
|
5
|
-
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
6
|
-
|
|
7
|
-
//#region src/helpers/template-helpers.ts
|
|
8
|
-
function __assignType(fn, args) {
|
|
9
|
-
fn.__type = args;
|
|
10
|
-
return fn;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Creates the reflection data used when generating runtime template files.
|
|
14
|
-
*
|
|
15
|
-
* @param context - The context for the configuration plugin.
|
|
16
|
-
* @param name - The name of the configuration template.
|
|
17
|
-
* @returns The reflection for the specified configuration template.
|
|
18
|
-
*/
|
|
19
|
-
async function createTemplateReflection(context, name) {
|
|
20
|
-
const reflection = await require_helpers_persistence.readEnvTypeReflection(context, name);
|
|
21
|
-
reflection.getProperties().forEach(__assignType((prop) => {
|
|
22
|
-
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
23
|
-
reflection.addProperty({
|
|
24
|
-
name: alias,
|
|
25
|
-
optional: prop.isOptional() ? true : void 0,
|
|
26
|
-
readonly: prop.isReadonly() ? true : void 0,
|
|
27
|
-
description: prop.getDescription(),
|
|
28
|
-
visibility: prop.getVisibility(),
|
|
29
|
-
type: prop.getType(),
|
|
30
|
-
default: prop.getDefaultValue(),
|
|
31
|
-
tags: {
|
|
32
|
-
hidden: prop.isHidden(),
|
|
33
|
-
ignore: prop.isIgnored(),
|
|
34
|
-
internal: prop.isInternal(),
|
|
35
|
-
runtime: prop.isRuntime(),
|
|
36
|
-
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
37
|
-
"a",
|
|
38
|
-
"",
|
|
39
|
-
"P\"2!\"/\""
|
|
40
|
-
])).concat(prop.name),
|
|
41
|
-
title: prop.getTitle() || (0, _stryke_string_format_title_case.titleCase)(prop.name),
|
|
42
|
-
readonly: prop.isReadonly(),
|
|
43
|
-
permission: prop.getPermission(),
|
|
44
|
-
domain: prop.getDomain()
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}, [
|
|
48
|
-
"alias",
|
|
49
|
-
"",
|
|
50
|
-
"P\"2!\"/\""
|
|
51
|
-
]));
|
|
52
|
-
}, [
|
|
53
|
-
"prop",
|
|
54
|
-
"",
|
|
55
|
-
"P\"2!\"/\""
|
|
56
|
-
]));
|
|
57
|
-
return reflection;
|
|
58
|
-
}
|
|
59
|
-
createTemplateReflection.__type = [
|
|
60
|
-
() => require_types_plugin.__ΩEnvPluginContext,
|
|
61
|
-
"context",
|
|
62
|
-
() => require_types_plugin.__ΩEnvType,
|
|
63
|
-
"name",
|
|
64
|
-
"createTemplateReflection",
|
|
65
|
-
"Creates the reflection data used when generating runtime template files.",
|
|
66
|
-
"Pn!2\"n#2$8!`/%?&"
|
|
67
|
-
];
|
|
68
|
-
|
|
69
|
-
//#endregion
|
|
70
|
-
exports.createTemplateReflection = createTemplateReflection;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext, EnvType } from "../types/plugin.cjs";
|
|
2
|
-
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/template-helpers.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Creates the reflection data used when generating runtime template files.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The context for the configuration plugin.
|
|
9
|
-
* @param name - The name of the configuration template.
|
|
10
|
-
* @returns The reflection for the specified configuration template.
|
|
11
|
-
*/
|
|
12
|
-
declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { createTemplateReflection };
|
|
15
|
-
//# sourceMappingURL=template-helpers.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-helpers.d.cts","names":[],"sources":["../../src/helpers/template-helpers.ts"],"mappings":";;;;;;AA8BA;;;;;iBAAsB,wBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,GAAO,OAAA,GACN,OAAA,CAAQ,eAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { EnvPluginContext, EnvType } from "../types/plugin.mjs";
|
|
2
|
-
import { ReflectionClass } from "@powerlines/deepkit/vendor/type";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/template-helpers.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* Creates the reflection data used when generating runtime template files.
|
|
7
|
-
*
|
|
8
|
-
* @param context - The context for the configuration plugin.
|
|
9
|
-
* @param name - The name of the configuration template.
|
|
10
|
-
* @returns The reflection for the specified configuration template.
|
|
11
|
-
*/
|
|
12
|
-
declare function createTemplateReflection(context: EnvPluginContext, name?: EnvType): Promise<ReflectionClass<any>>;
|
|
13
|
-
//#endregion
|
|
14
|
-
export { createTemplateReflection };
|
|
15
|
-
//# sourceMappingURL=template-helpers.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-helpers.d.mts","names":[],"sources":["../../src/helpers/template-helpers.ts"],"mappings":";;;;;;AA8BA;;;;;iBAAsB,wBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,GAAO,OAAA,GACN,OAAA,CAAQ,eAAA"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { __ΩEnvPluginContext, __ΩEnvType } from "../types/plugin.mjs";
|
|
2
|
-
import { readEnvTypeReflection } from "./persistence.mjs";
|
|
3
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/template-helpers.ts
|
|
6
|
-
function __assignType(fn, args) {
|
|
7
|
-
fn.__type = args;
|
|
8
|
-
return fn;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Creates the reflection data used when generating runtime template files.
|
|
12
|
-
*
|
|
13
|
-
* @param context - The context for the configuration plugin.
|
|
14
|
-
* @param name - The name of the configuration template.
|
|
15
|
-
* @returns The reflection for the specified configuration template.
|
|
16
|
-
*/
|
|
17
|
-
async function createTemplateReflection(context, name) {
|
|
18
|
-
const reflection = await readEnvTypeReflection(context, name);
|
|
19
|
-
reflection.getProperties().forEach(__assignType((prop) => {
|
|
20
|
-
prop.getAlias().filter(Boolean).forEach(__assignType((alias) => {
|
|
21
|
-
reflection.addProperty({
|
|
22
|
-
name: alias,
|
|
23
|
-
optional: prop.isOptional() ? true : void 0,
|
|
24
|
-
readonly: prop.isReadonly() ? true : void 0,
|
|
25
|
-
description: prop.getDescription(),
|
|
26
|
-
visibility: prop.getVisibility(),
|
|
27
|
-
type: prop.getType(),
|
|
28
|
-
default: prop.getDefaultValue(),
|
|
29
|
-
tags: {
|
|
30
|
-
hidden: prop.isHidden(),
|
|
31
|
-
ignore: prop.isIgnored(),
|
|
32
|
-
internal: prop.isInternal(),
|
|
33
|
-
runtime: prop.isRuntime(),
|
|
34
|
-
alias: prop.getAlias().filter(__assignType((a) => a !== alias, [
|
|
35
|
-
"a",
|
|
36
|
-
"",
|
|
37
|
-
"P\"2!\"/\""
|
|
38
|
-
])).concat(prop.name),
|
|
39
|
-
title: prop.getTitle() || titleCase(prop.name),
|
|
40
|
-
readonly: prop.isReadonly(),
|
|
41
|
-
permission: prop.getPermission(),
|
|
42
|
-
domain: prop.getDomain()
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
}, [
|
|
46
|
-
"alias",
|
|
47
|
-
"",
|
|
48
|
-
"P\"2!\"/\""
|
|
49
|
-
]));
|
|
50
|
-
}, [
|
|
51
|
-
"prop",
|
|
52
|
-
"",
|
|
53
|
-
"P\"2!\"/\""
|
|
54
|
-
]));
|
|
55
|
-
return reflection;
|
|
56
|
-
}
|
|
57
|
-
createTemplateReflection.__type = [
|
|
58
|
-
() => __ΩEnvPluginContext,
|
|
59
|
-
"context",
|
|
60
|
-
() => __ΩEnvType,
|
|
61
|
-
"name",
|
|
62
|
-
"createTemplateReflection",
|
|
63
|
-
"Creates the reflection data used when generating runtime template files.",
|
|
64
|
-
"Pn!2\"n#2$8!`/%?&"
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
//#endregion
|
|
68
|
-
export { createTemplateReflection };
|
|
69
|
-
//# sourceMappingURL=template-helpers.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template-helpers.mjs","names":[],"sources":["../../src/helpers/template-helpers.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { ReflectionClass } from \"@powerlines/deepkit/vendor/type\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { EnvPluginContext, EnvType } from \"../types/plugin\";\nimport { readEnvTypeReflection } from \"./persistence\";\n\n/**\n * Creates the reflection data used when generating runtime template files.\n *\n * @param context - The context for the configuration plugin.\n * @param name - The name of the configuration template.\n * @returns The reflection for the specified configuration template.\n */\nexport async function createTemplateReflection(\n context: EnvPluginContext,\n name?: EnvType\n): Promise<ReflectionClass<any>> {\n const reflection = await readEnvTypeReflection(context, name);\n\n reflection.getProperties().forEach(prop => {\n const aliases = prop.getAlias();\n aliases.filter(Boolean).forEach(alias => {\n reflection.addProperty({\n name: alias,\n optional: prop.isOptional() ? true : undefined,\n readonly: prop.isReadonly() ? true : undefined,\n description: prop.getDescription(),\n visibility: prop.getVisibility(),\n type: prop.getType(),\n default: prop.getDefaultValue(),\n tags: {\n hidden: prop.isHidden(),\n ignore: prop.isIgnored(),\n internal: prop.isInternal(),\n runtime: prop.isRuntime(),\n alias: prop\n .getAlias()\n .filter(a => a !== alias)\n .concat(prop.name),\n title: prop.getTitle() || titleCase(prop.name),\n readonly: prop.isReadonly(),\n permission: prop.getPermission(),\n domain: prop.getDomain()\n }\n });\n });\n });\n\n return reflection;\n}\n"],"mappings":";;;;;AAIA,SAAM,aAAS,IAAW,MAAM;CAC/B,GAAG,SAAU;CACb,OAAQ;AACT;;;;;;;;;CAWA,MAAQ,aAAC,MAAkB,sBAAkB,SAAQ,IAAO;CAC5D,WAAS,cAAkB,EAAC,QAAO,cAAc,SAAM;EAEvD,AADS,KAAgB,SAChB,EAAA,OAAA,OAAA,EAAA,QAAwB,cAAQ,UAAY;;IAEnD,MAAA;IACC,UAAY,KAAA,WAAgB,IAAK,OAAK;IACxC,UAAA,KAAA,WAAA,IAAA,OAAA;IACG,aAAgB,KAAI,eAAgB;IACpC,YAAgB,KAAK,cAAQ;IAC7B,MAAQ,KAAI,QAAW;IACzB,SAAA,KAAA,gBAAA;IACK,MAAM;KACH,QAAC,KAAA,SAAgB;KAClB,QAAA,KAAA,UAAA;KACC,UAAC,KAAA,WAAsB;KACzB,SAAW,KAAE,UAAM;;;;;;KAEzB,OAAW,KAAA,SAAgB,KAAO,UAAS,KAAA,IAAA;KACnC,UAAU,KAAK,WAAU;KAC/B,YAAe,KAAQ,cAAc;KACnC,QAAW,KAAA,UAAY;IACrB;GACF,CAAC;EACH,GAAG;GAAC;GAAS;GAAC;EAAK,CAAA,CAAA;CACrB,GAAG;EAAC;EAAE;EAAA;CAAkB,CAAA,CAAA;CACxB,OAAM;AACR;AACA,yBAAsB,SAAA;OAAiB;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA;AAAA"}
|