@powerlines/plugin-env 0.16.59 → 0.16.61
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/README.md +14 -16
- package/dist/_virtual/{rolldown_runtime.cjs → _rolldown/runtime.cjs} +1 -3
- package/dist/_virtual/{rolldown_runtime.mjs → _rolldown/runtime.mjs} +2 -3
- package/dist/babel/index.cjs +1 -0
- package/dist/babel/plugin.cjs +20 -19
- package/dist/babel/plugin.d.cts +0 -1
- package/dist/babel/plugin.d.cts.map +1 -1
- package/dist/babel/plugin.d.mts +0 -1
- package/dist/babel/plugin.d.mts.map +1 -1
- package/dist/babel/plugin.mjs +3 -3
- package/dist/babel/plugin.mjs.map +1 -1
- package/dist/components/docs.cjs +26 -25
- package/dist/components/docs.d.cts.map +1 -1
- package/dist/components/docs.d.mts.map +1 -1
- package/dist/components/docs.mjs +1 -1
- package/dist/components/env-builtin.cjs +155 -153
- package/dist/components/env-builtin.d.cts +0 -1
- package/dist/components/env-builtin.d.cts.map +1 -1
- package/dist/components/env-builtin.d.mts +0 -1
- package/dist/components/env-builtin.d.mts.map +1 -1
- package/dist/components/env-builtin.mjs +1 -1
- package/dist/components/index.cjs +1 -0
- package/dist/helpers/automd-generator.cjs +4 -3
- package/dist/helpers/automd-generator.d.cts +2 -3
- package/dist/helpers/automd-generator.d.cts.map +1 -1
- package/dist/helpers/automd-generator.d.mts +2 -3
- package/dist/helpers/automd-generator.d.mts.map +1 -1
- package/dist/helpers/automd-generator.mjs +1 -1
- package/dist/helpers/automd-generator.mjs.map +1 -1
- package/dist/helpers/create-reflection-resource.cjs +1 -0
- package/dist/helpers/create-reflection-resource.d.cts +0 -1
- package/dist/helpers/create-reflection-resource.d.cts.map +1 -1
- package/dist/helpers/create-reflection-resource.d.mts +0 -1
- package/dist/helpers/create-reflection-resource.d.mts.map +1 -1
- package/dist/helpers/create-reflection-resource.mjs.map +1 -1
- package/dist/helpers/docs-helper.cjs +4 -2
- package/dist/helpers/docs-helper.d.cts +0 -1
- package/dist/helpers/docs-helper.d.cts.map +1 -1
- package/dist/helpers/docs-helper.d.mts +0 -1
- package/dist/helpers/docs-helper.d.mts.map +1 -1
- package/dist/helpers/docs-helper.mjs +1 -1
- package/dist/helpers/docs-helper.mjs.map +1 -1
- package/dist/helpers/index.cjs +1 -0
- package/dist/helpers/load.cjs +19 -17
- package/dist/helpers/load.d.cts +0 -1
- package/dist/helpers/load.d.cts.map +1 -1
- package/dist/helpers/load.d.mts +0 -1
- package/dist/helpers/load.d.mts.map +1 -1
- package/dist/helpers/load.mjs +2 -2
- package/dist/helpers/load.mjs.map +1 -1
- package/dist/helpers/persistence.cjs +59 -58
- package/dist/helpers/persistence.d.cts +0 -1
- package/dist/helpers/persistence.d.cts.map +1 -1
- package/dist/helpers/persistence.d.mts +0 -1
- package/dist/helpers/persistence.d.mts.map +1 -1
- package/dist/helpers/persistence.mjs +15 -15
- package/dist/helpers/persistence.mjs.map +1 -1
- package/dist/helpers/reflect.cjs +40 -39
- package/dist/helpers/reflect.d.cts.map +1 -1
- package/dist/helpers/reflect.d.mts.map +1 -1
- package/dist/helpers/reflect.mjs +2 -2
- package/dist/helpers/reflect.mjs.map +1 -1
- package/dist/helpers/source-file-env.cjs +8 -7
- package/dist/helpers/source-file-env.d.cts.map +1 -1
- package/dist/helpers/source-file-env.d.mts.map +1 -1
- package/dist/helpers/source-file-env.mjs.map +1 -1
- package/dist/helpers/template-helpers.cjs +6 -5
- package/dist/helpers/template-helpers.d.cts +0 -1
- package/dist/helpers/template-helpers.d.cts.map +1 -1
- package/dist/helpers/template-helpers.d.mts +0 -1
- package/dist/helpers/template-helpers.d.mts.map +1 -1
- package/dist/helpers/template-helpers.mjs.map +1 -1
- package/dist/index.cjs +49 -49
- package/dist/index.d.cts +0 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.cjs +7 -7
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs +6 -6
- package/dist/node_modules/.pnpm/c12@3.3.3_magicast@0.5.2/node_modules/c12/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.cjs +6 -6
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs +6 -6
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/_format.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/json.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.cjs +655 -655
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs +655 -655
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/js-yaml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.cjs +179 -179
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs +179 -179
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/json5.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.cjs +188 -188
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs +188 -188
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/jsonc-parser.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.cjs +297 -297
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs +297 -297
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.cjs +8 -8
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs +8 -8
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/_chunks/rolldown-runtime.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs +4 -4
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/json5.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.cjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs +3 -3
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/jsonc.mjs.map +1 -1
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.cjs +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs +2 -2
- package/dist/node_modules/.pnpm/confbox@0.2.4/node_modules/confbox/dist/yaml.mjs.map +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.cjs +5 -5
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs +4 -4
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/lib/main.mjs.map +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.cjs +2 -2
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs +1 -1
- package/dist/node_modules/.pnpm/dotenv@17.3.1/node_modules/dotenv/package.mjs.map +1 -1
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.cjs +18 -18
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs +2 -2
- package/dist/node_modules/.pnpm/exsolve@1.0.8/node_modules/exsolve/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.cjs +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.cjs +1308 -1311
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs +1294 -1297
- package/dist/node_modules/.pnpm/giget@2.0.0/node_modules/giget/dist/shared/giget.OCaTp9b-.mjs.map +1 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.cjs +2194 -2194
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs +2193 -2193
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/dist/jiti.mjs.map +1 -1
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.cjs +3 -3
- package/dist/node_modules/.pnpm/jiti@2.6.1/node_modules/jiti/lib/jiti.mjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.cjs +3 -3
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/chunks/multipart-parser.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/index.mjs +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.cjs +34 -34
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs +33 -33
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/node.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.cjs +221 -223
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs +220 -222
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/proxy.mjs.map +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/dist/shared/node-fetch-native.DhEqb06g.mjs +1 -1
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.cjs +2 -2
- package/dist/node_modules/.pnpm/node-fetch-native@1.6.7/node_modules/node-fetch-native/lib/index.mjs +1 -1
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.cjs +3 -3
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs +5 -5
- package/dist/node_modules/.pnpm/nypm@0.6.5/node_modules/nypm/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/ohash@2.0.11/node_modules/ohash/dist/crypto/node/index.cjs +1 -1
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.cjs +6 -6
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs +5 -5
- package/dist/node_modules/.pnpm/pkg-types@2.3.0/node_modules/pkg-types/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.cjs +10 -10
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs +16 -16
- package/dist/node_modules/.pnpm/rc9@2.1.2/node_modules/rc9/dist/index.mjs.map +1 -1
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.cjs +412 -412
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs +189 -189
- package/dist/node_modules/.pnpm/tinyexec@1.0.2/node_modules/tinyexec/dist/main.mjs.map +1 -1
- package/dist/types/index.cjs +1 -0
- package/dist/types/plugin.cjs +20 -19
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts.map +1 -1
- package/dist/types/plugin.mjs.map +1 -1
- package/dist/types/runtime.cjs +1 -0
- package/dist/types/runtime.d.cts.map +1 -1
- package/dist/types/runtime.d.mts.map +1 -1
- package/dist/types/runtime.mjs.map +1 -1
- package/package.json +45 -26
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.cjs +0 -37
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs +0 -38
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/parse-type-definition.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/to-array.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/get-object-tag.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/index.cjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/index.mjs +0 -5
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.cjs +0 -6
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs +0 -7
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-buffer.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-collection.cjs +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-collection.mjs +0 -3
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.cjs +0 -19
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs +0 -20
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.cjs +0 -63
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs +0 -64
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-plain-object.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/is-string.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs +0 -17
- package/dist/node_modules/.pnpm/@stryke_convert@0.6.53/node_modules/@stryke/convert/dist/type-checks/src/type-detect.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.cjs +0 -32
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs +0 -33
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.cjs +0 -28
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs +0 -29
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-type.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.cjs +0 -122
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs +0 -123
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.cjs +0 -12
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs +0 -9
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/regex.mjs.map +0 -1
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.cjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs +0 -15
- package/dist/node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/slash.mjs.map +0 -1
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_types_plugin = require('../types/plugin.cjs');
|
|
3
|
-
const require_join_paths = require('../node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.cjs');
|
|
4
4
|
const require_helpers_reflect = require('./reflect.cjs');
|
|
5
|
-
let
|
|
5
|
+
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
6
6
|
let powerlines = require("powerlines");
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
let
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
let
|
|
13
|
-
let
|
|
7
|
+
let _powerlines_deepkit_capnp = require("@powerlines/deepkit/capnp");
|
|
8
|
+
let _powerlines_deepkit_resolve_reflections = require("@powerlines/deepkit/resolve-reflections");
|
|
9
|
+
let _powerlines_deepkit_schemas_reflection = require("@powerlines/deepkit/schemas/reflection");
|
|
10
|
+
let _stryke_capnp = require("@stryke/capnp");
|
|
11
|
+
_stryke_capnp = require_runtime.__toESM(_stryke_capnp);
|
|
12
|
+
let _stryke_fs_buffer = require("@stryke/fs/buffer");
|
|
13
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
14
|
+
let _stryke_type_checks_is_empty_object = require("@stryke/type-checks/is-empty-object");
|
|
14
15
|
let node_fs = require("node:fs");
|
|
15
16
|
|
|
16
17
|
//#region src/helpers/persistence.ts
|
|
@@ -79,7 +80,7 @@ getSecretsDefaultTypeDefinition.__type = [
|
|
|
79
80
|
* @returns The path to the environment type reflections.
|
|
80
81
|
*/
|
|
81
82
|
function getEnvTypeReflectionsPath(context, name = "env") {
|
|
82
|
-
return
|
|
83
|
+
return (0, _stryke_path_join_paths.joinPaths)((0, _powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}-types.bin`);
|
|
83
84
|
}
|
|
84
85
|
getEnvTypeReflectionsPath.__type = [
|
|
85
86
|
() => powerlines.__ΩContext,
|
|
@@ -102,19 +103,19 @@ getEnvTypeReflectionsPath.__type = [
|
|
|
102
103
|
async function readEnvTypeReflection(context, name = "env") {
|
|
103
104
|
const filePath = getEnvTypeReflectionsPath(context, name);
|
|
104
105
|
if (!(0, node_fs.existsSync)(filePath)) {
|
|
105
|
-
if (!context.env.types.env || (0,
|
|
106
|
-
const reflection
|
|
107
|
-
const message = new
|
|
108
|
-
reflection
|
|
109
|
-
reflection
|
|
110
|
-
context.env.types.env = reflection
|
|
106
|
+
if (!context.env.types.env || (0, _stryke_type_checks_is_empty_object.isEmptyObject)(context.env.types.env)) {
|
|
107
|
+
const reflection = require_helpers_reflect.createEnvReflection(context);
|
|
108
|
+
const message = new _stryke_capnp.Message();
|
|
109
|
+
reflection.messageRoot = message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes);
|
|
110
|
+
reflection.dataBuffer = message.toArrayBuffer();
|
|
111
|
+
context.env.types.env = reflection;
|
|
111
112
|
await writeEnvTypeReflection(context, context.env.types.env, name);
|
|
112
113
|
}
|
|
113
114
|
return context.env.types.env;
|
|
114
115
|
}
|
|
115
|
-
const buffer = await (0,
|
|
116
|
-
const messageRoot = new
|
|
117
|
-
const reflection = (0,
|
|
116
|
+
const buffer = await (0, _stryke_fs_buffer.readFileBuffer)(filePath);
|
|
117
|
+
const messageRoot = new _stryke_capnp.Message(buffer, false).getRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes);
|
|
118
|
+
const reflection = (0, _powerlines_deepkit_vendor_type.resolveClassType)((0, _powerlines_deepkit_vendor_type.deserializeType)((0, _powerlines_deepkit_capnp.convertFromCapnp)(messageRoot.types)));
|
|
118
119
|
context.env.types[name] = reflection;
|
|
119
120
|
context.env.types[name].messageRoot = messageRoot;
|
|
120
121
|
context.env.types[name].dataBuffer = buffer;
|
|
@@ -126,7 +127,7 @@ readEnvTypeReflection.__type = [
|
|
|
126
127
|
() => require_types_plugin.__ΩEnvType,
|
|
127
128
|
"name",
|
|
128
129
|
() => "env",
|
|
129
|
-
() =>
|
|
130
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
130
131
|
"readEnvTypeReflection",
|
|
131
132
|
"Reads the environment type reflection from the file system.",
|
|
132
133
|
"Pn!2\"n#2$>%P\"7&`/'?("
|
|
@@ -140,14 +141,14 @@ readEnvTypeReflection.__type = [
|
|
|
140
141
|
*/
|
|
141
142
|
async function writeEnvTypeReflection(context, reflection, name = "env") {
|
|
142
143
|
const serialized = reflection.serializeType();
|
|
143
|
-
const message = new
|
|
144
|
-
(0,
|
|
145
|
-
await (0,
|
|
144
|
+
const message = new _stryke_capnp.Message();
|
|
145
|
+
(0, _powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
|
|
146
|
+
await (0, _stryke_fs_buffer.writeFileBuffer)(getEnvTypeReflectionsPath(context, name), message.toArrayBuffer());
|
|
146
147
|
}
|
|
147
148
|
writeEnvTypeReflection.__type = [
|
|
148
149
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
149
150
|
"context",
|
|
150
|
-
() =>
|
|
151
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
151
152
|
"reflection",
|
|
152
153
|
() => require_types_plugin.__ΩEnvType,
|
|
153
154
|
"name",
|
|
@@ -157,7 +158,7 @@ writeEnvTypeReflection.__type = [
|
|
|
157
158
|
"Pn!2\"P\"7#2$n%2&>'\"/(?)"
|
|
158
159
|
];
|
|
159
160
|
function getEnvReflectionsPath(context, name) {
|
|
160
|
-
return
|
|
161
|
+
return (0, _stryke_path_join_paths.joinPaths)((0, _powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}.bin`);
|
|
161
162
|
}
|
|
162
163
|
getEnvReflectionsPath.__type = [
|
|
163
164
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
@@ -177,28 +178,28 @@ async function readEnvReflection(context) {
|
|
|
177
178
|
const filePath = getEnvReflectionsPath(context, "env");
|
|
178
179
|
if (!(0, node_fs.existsSync)(filePath)) {
|
|
179
180
|
if (!context.env.types.env) context.env.types.env = await readEnvTypeReflection(context, "env");
|
|
180
|
-
if (!context.env.used.env || (0,
|
|
181
|
-
const reflection
|
|
181
|
+
if (!context.env.used.env || (0, _stryke_type_checks_is_empty_object.isEmptyObject)(context.env.used.env)) {
|
|
182
|
+
const reflection = require_helpers_reflect.createEnvReflection(context, {
|
|
182
183
|
type: {
|
|
183
|
-
kind:
|
|
184
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
184
185
|
typeName: "Env",
|
|
185
186
|
description: `An object containing the environment configuration parameters that are used (at least once) by the ${context.config.name ? `${context.config.name} application` : "application"}.`,
|
|
186
187
|
types: []
|
|
187
188
|
},
|
|
188
189
|
superReflection: context.env.types.env
|
|
189
190
|
});
|
|
190
|
-
reflection
|
|
191
|
-
const message = new
|
|
192
|
-
reflection
|
|
193
|
-
reflection
|
|
194
|
-
context.env.used.env = reflection
|
|
191
|
+
reflection.name = "Env";
|
|
192
|
+
const message = new _stryke_capnp.Message();
|
|
193
|
+
reflection.messageRoot = message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes);
|
|
194
|
+
reflection.dataBuffer = message.toArrayBuffer();
|
|
195
|
+
context.env.used.env = reflection;
|
|
195
196
|
await writeEnvReflection(context, context.env.used.env, "env");
|
|
196
197
|
}
|
|
197
198
|
return context.env.used.env;
|
|
198
199
|
}
|
|
199
|
-
const buffer = await (0,
|
|
200
|
-
const messageRoot = new
|
|
201
|
-
const reflection = (0,
|
|
200
|
+
const buffer = await (0, _stryke_fs_buffer.readFileBuffer)(filePath);
|
|
201
|
+
const messageRoot = new _stryke_capnp.Message(buffer, false).getRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes);
|
|
202
|
+
const reflection = (0, _powerlines_deepkit_vendor_type.resolveClassType)((0, _powerlines_deepkit_vendor_type.deserializeType)((0, _powerlines_deepkit_capnp.convertFromCapnp)(messageRoot.types)));
|
|
202
203
|
context.env.used.env = reflection;
|
|
203
204
|
context.env.used.env.messageRoot = messageRoot;
|
|
204
205
|
context.env.used.env.dataBuffer = buffer;
|
|
@@ -207,7 +208,7 @@ async function readEnvReflection(context) {
|
|
|
207
208
|
readEnvReflection.__type = [
|
|
208
209
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
209
210
|
"context",
|
|
210
|
-
() =>
|
|
211
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
211
212
|
"readEnvReflection",
|
|
212
213
|
"Reads the environment reflection data from the file system.",
|
|
213
214
|
"Pn!2\"P\"7#`/$?%"
|
|
@@ -222,28 +223,28 @@ async function readSecretsReflection(context) {
|
|
|
222
223
|
const filePath = getEnvReflectionsPath(context, "secrets");
|
|
223
224
|
if (!(0, node_fs.existsSync)(filePath)) {
|
|
224
225
|
if (!context.env.types.secrets) context.env.types.secrets = await readEnvTypeReflection(context, "secrets");
|
|
225
|
-
if (!context.env.used.secrets || (0,
|
|
226
|
-
const reflection
|
|
226
|
+
if (!context.env.used.secrets || (0, _stryke_type_checks_is_empty_object.isEmptyObject)(context.env.used.secrets)) {
|
|
227
|
+
const reflection = require_helpers_reflect.createEnvReflection(context, {
|
|
227
228
|
type: {
|
|
228
|
-
kind:
|
|
229
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
229
230
|
typeName: "Secrets",
|
|
230
231
|
description: `An object containing the secret configuration parameters that are used (at least once) by the ${context.config.name ? `${context.config.name} application` : "application"}.`,
|
|
231
232
|
types: []
|
|
232
233
|
},
|
|
233
234
|
superReflection: context.env.types.secrets
|
|
234
235
|
});
|
|
235
|
-
reflection
|
|
236
|
-
const message = new
|
|
237
|
-
reflection
|
|
238
|
-
reflection
|
|
239
|
-
context.env.used.secrets = reflection
|
|
236
|
+
reflection.name = "Secrets";
|
|
237
|
+
const message = new _stryke_capnp.Message();
|
|
238
|
+
reflection.messageRoot = message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes);
|
|
239
|
+
reflection.dataBuffer = message.toArrayBuffer();
|
|
240
|
+
context.env.used.secrets = reflection;
|
|
240
241
|
await writeEnvReflection(context, context.env.used.secrets, "secrets");
|
|
241
242
|
}
|
|
242
243
|
return context.env.used.secrets;
|
|
243
244
|
}
|
|
244
|
-
const buffer = await (0,
|
|
245
|
-
const messageRoot = new
|
|
246
|
-
const reflection = (0,
|
|
245
|
+
const buffer = await (0, _stryke_fs_buffer.readFileBuffer)(filePath);
|
|
246
|
+
const messageRoot = new _stryke_capnp.Message(buffer, false).getRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes);
|
|
247
|
+
const reflection = (0, _powerlines_deepkit_vendor_type.resolveClassType)((0, _powerlines_deepkit_vendor_type.deserializeType)((0, _powerlines_deepkit_capnp.convertFromCapnp)(messageRoot.types)));
|
|
247
248
|
context.env.used.secrets = reflection;
|
|
248
249
|
context.env.used.secrets.messageRoot = messageRoot;
|
|
249
250
|
context.env.used.secrets.dataBuffer = buffer;
|
|
@@ -252,7 +253,7 @@ async function readSecretsReflection(context) {
|
|
|
252
253
|
readSecretsReflection.__type = [
|
|
253
254
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
254
255
|
"context",
|
|
255
|
-
() =>
|
|
256
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
256
257
|
"readSecretsReflection",
|
|
257
258
|
"Reads the secret environment reflection data from the file system.",
|
|
258
259
|
"Pn!2\"P\"7#`/$?%"
|
|
@@ -266,14 +267,14 @@ readSecretsReflection.__type = [
|
|
|
266
267
|
*/
|
|
267
268
|
async function writeEnvReflection(context, reflection, name = "env") {
|
|
268
269
|
const serialized = reflection.serializeType();
|
|
269
|
-
const message = new
|
|
270
|
-
(0,
|
|
271
|
-
await (0,
|
|
270
|
+
const message = new _stryke_capnp.Message();
|
|
271
|
+
(0, _powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
|
|
272
|
+
await (0, _stryke_fs_buffer.writeFileBuffer)(getEnvReflectionsPath(context, name), message.toArrayBuffer());
|
|
272
273
|
}
|
|
273
274
|
writeEnvReflection.__type = [
|
|
274
275
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
275
276
|
"context",
|
|
276
|
-
() =>
|
|
277
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
277
278
|
"reflection",
|
|
278
279
|
() => require_types_plugin.__ΩEnvType,
|
|
279
280
|
"name",
|
|
@@ -291,14 +292,14 @@ writeEnvReflection.__type = [
|
|
|
291
292
|
*/
|
|
292
293
|
function writeEnvReflectionSync(context, reflection, name = "env") {
|
|
293
294
|
const serialized = reflection.serializeType();
|
|
294
|
-
const message = new
|
|
295
|
-
(0,
|
|
296
|
-
(0,
|
|
295
|
+
const message = new _stryke_capnp.Message();
|
|
296
|
+
(0, _powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(_powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
|
|
297
|
+
(0, _stryke_fs_buffer.writeFileBufferSync)(getEnvReflectionsPath(context, name), message.toArrayBuffer());
|
|
297
298
|
}
|
|
298
299
|
writeEnvReflectionSync.__type = [
|
|
299
300
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
300
301
|
"context",
|
|
301
|
-
() =>
|
|
302
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
302
303
|
"reflection",
|
|
303
304
|
() => require_types_plugin.__ΩEnvType,
|
|
304
305
|
"name",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.cts","names":[],"sources":["../../src/helpers/persistence.ts"],"
|
|
1
|
+
{"version":3,"file":"persistence.d.cts","names":[],"sources":["../../src/helpers/persistence.ts"],"mappings":";;;;;;;;AAoDA;;;;iBAAsB,sBAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA;;;;;;;iBAmBmB,2BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;AAFX;;;iBAcsB,+BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;;;;;;iBAcK,yBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,uBAAA,GACjB,IAAA,GAAM,OAAA;;;;;AAlBR;;;iBA8BsB,qBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,GAAM,OAAA,GACL,OAAA,CAAQ,eAAA;;;;;;;;iBAuCW,sBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;AAAA,iBAeP,qBAAA,CACd,OAAA,EAAS,gBAAA,EACT,IAAA,EAAM,OAAA;;;;AA5ER;;;iBAuFsB,iBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;;;iBAuDW,qBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;AApIX;;;iBA+LsB,kBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;;;;;;;;iBAsBP,sBAAA,CACd,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.mts","names":[],"sources":["../../src/helpers/persistence.ts"],"
|
|
1
|
+
{"version":3,"file":"persistence.d.mts","names":[],"sources":["../../src/helpers/persistence.ts"],"mappings":";;;;;;;;AAoDA;;;;iBAAsB,sBAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA;;;;;;;iBAmBmB,2BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;AAFX;;;iBAcsB,+BAAA,CACpB,OAAA,EAAS,iBAAA,CAAkB,uBAAA,IAC1B,OAAA,CAAQ,cAAA;;;;;;;;iBAcK,yBAAA,CACd,OAAA,EAAS,OAAA,CAAQ,uBAAA,GACjB,IAAA,GAAM,OAAA;;;;;AAlBR;;;iBA8BsB,qBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,IAAA,GAAM,OAAA,GACL,OAAA,CAAQ,eAAA;;;;;;;;iBAuCW,sBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;AAAA,iBAeP,qBAAA,CACd,OAAA,EAAS,gBAAA,EACT,IAAA,EAAM,OAAA;;;;AA5ER;;;iBAuFsB,iBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;;;iBAuDW,qBAAA,CACpB,OAAA,EAAS,gBAAA,GACR,OAAA,CAAQ,eAAA;;;;;AApIX;;;iBA+LsB,kBAAA,CACpB,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA,GAAe,OAAA;;;;;;;;iBAsBP,sBAAA,CACd,OAAA,EAAS,gBAAA,EACT,UAAA,EAAY,eAAA,OACZ,IAAA,GAAM,OAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { __ΩEnvPluginContext, __ΩEnvPluginResolvedConfig, __ΩEnvType } from "../types/plugin.mjs";
|
|
2
|
-
import { joinPaths } from "../node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.mjs";
|
|
3
2
|
import { createEnvReflection } from "./reflect.mjs";
|
|
4
3
|
import { ReflectionClass, ReflectionKind, deserializeType, resolveClassType } from "@powerlines/deepkit/vendor/type";
|
|
5
4
|
import { __ΩContext, __ΩUnresolvedContext } from "powerlines";
|
|
@@ -8,6 +7,7 @@ import { getReflectionsPath } from "@powerlines/deepkit/resolve-reflections";
|
|
|
8
7
|
import { SerializedTypes } from "@powerlines/deepkit/schemas/reflection";
|
|
9
8
|
import * as capnp from "@stryke/capnp";
|
|
10
9
|
import { readFileBuffer, writeFileBuffer, writeFileBufferSync } from "@stryke/fs/buffer";
|
|
10
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
11
11
|
import { isEmptyObject } from "@stryke/type-checks/is-empty-object";
|
|
12
12
|
import { existsSync } from "node:fs";
|
|
13
13
|
|
|
@@ -101,11 +101,11 @@ async function readEnvTypeReflection(context, name = "env") {
|
|
|
101
101
|
const filePath = getEnvTypeReflectionsPath(context, name);
|
|
102
102
|
if (!existsSync(filePath)) {
|
|
103
103
|
if (!context.env.types.env || isEmptyObject(context.env.types.env)) {
|
|
104
|
-
const reflection
|
|
104
|
+
const reflection = createEnvReflection(context);
|
|
105
105
|
const message = new capnp.Message();
|
|
106
|
-
reflection
|
|
107
|
-
reflection
|
|
108
|
-
context.env.types.env = reflection
|
|
106
|
+
reflection.messageRoot = message.initRoot(SerializedTypes);
|
|
107
|
+
reflection.dataBuffer = message.toArrayBuffer();
|
|
108
|
+
context.env.types.env = reflection;
|
|
109
109
|
await writeEnvTypeReflection(context, context.env.types.env, name);
|
|
110
110
|
}
|
|
111
111
|
return context.env.types.env;
|
|
@@ -176,7 +176,7 @@ async function readEnvReflection(context) {
|
|
|
176
176
|
if (!existsSync(filePath)) {
|
|
177
177
|
if (!context.env.types.env) context.env.types.env = await readEnvTypeReflection(context, "env");
|
|
178
178
|
if (!context.env.used.env || isEmptyObject(context.env.used.env)) {
|
|
179
|
-
const reflection
|
|
179
|
+
const reflection = createEnvReflection(context, {
|
|
180
180
|
type: {
|
|
181
181
|
kind: ReflectionKind.objectLiteral,
|
|
182
182
|
typeName: "Env",
|
|
@@ -185,11 +185,11 @@ async function readEnvReflection(context) {
|
|
|
185
185
|
},
|
|
186
186
|
superReflection: context.env.types.env
|
|
187
187
|
});
|
|
188
|
-
reflection
|
|
188
|
+
reflection.name = "Env";
|
|
189
189
|
const message = new capnp.Message();
|
|
190
|
-
reflection
|
|
191
|
-
reflection
|
|
192
|
-
context.env.used.env = reflection
|
|
190
|
+
reflection.messageRoot = message.initRoot(SerializedTypes);
|
|
191
|
+
reflection.dataBuffer = message.toArrayBuffer();
|
|
192
|
+
context.env.used.env = reflection;
|
|
193
193
|
await writeEnvReflection(context, context.env.used.env, "env");
|
|
194
194
|
}
|
|
195
195
|
return context.env.used.env;
|
|
@@ -221,7 +221,7 @@ async function readSecretsReflection(context) {
|
|
|
221
221
|
if (!existsSync(filePath)) {
|
|
222
222
|
if (!context.env.types.secrets) context.env.types.secrets = await readEnvTypeReflection(context, "secrets");
|
|
223
223
|
if (!context.env.used.secrets || isEmptyObject(context.env.used.secrets)) {
|
|
224
|
-
const reflection
|
|
224
|
+
const reflection = createEnvReflection(context, {
|
|
225
225
|
type: {
|
|
226
226
|
kind: ReflectionKind.objectLiteral,
|
|
227
227
|
typeName: "Secrets",
|
|
@@ -230,11 +230,11 @@ async function readSecretsReflection(context) {
|
|
|
230
230
|
},
|
|
231
231
|
superReflection: context.env.types.secrets
|
|
232
232
|
});
|
|
233
|
-
reflection
|
|
233
|
+
reflection.name = "Secrets";
|
|
234
234
|
const message = new capnp.Message();
|
|
235
|
-
reflection
|
|
236
|
-
reflection
|
|
237
|
-
context.env.used.secrets = reflection
|
|
235
|
+
reflection.messageRoot = message.initRoot(SerializedTypes);
|
|
236
|
+
reflection.dataBuffer = message.toArrayBuffer();
|
|
237
|
+
context.env.used.secrets = reflection;
|
|
238
238
|
await writeEnvReflection(context, context.env.used.secrets, "secrets");
|
|
239
239
|
}
|
|
240
240
|
return context.env.used.secrets;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.mjs","names":[],"sources":["../../src/helpers/persistence.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 { convertFromCapnp, convertToCapnp } from \"@powerlines/deepkit/capnp\";\nimport { getReflectionsPath } from \"@powerlines/deepkit/resolve-reflections\";\nimport { SerializedTypes } from \"@powerlines/deepkit/schemas/reflection\";\nimport { Reflection } from \"@powerlines/deepkit/types\";\nimport {\n deserializeType,\n ReflectionClass,\n ReflectionKind,\n resolveClassType\n} from \"@powerlines/deepkit/vendor/type\";\nimport * as capnp from \"@stryke/capnp\";\nimport {\n readFileBuffer,\n writeFileBuffer,\n writeFileBufferSync\n} from \"@stryke/fs/buffer\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport type { TypeDefinition } from \"@stryke/types/configuration\";\nimport { existsSync } from \"node:fs\";\nimport { Context, UnresolvedContext } from \"powerlines\";\nimport {\n EnvPluginContext,\n EnvPluginResolvedConfig,\n EnvType\n} from \"../types/plugin\";\nimport { createEnvReflection } from \"./reflect\";\n\n/**\n * Resolves the runtime type definition file for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The runtime type definition file for the environment variables.\n */\nexport async function resolveRuntimeTypeFile(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<string> {\n const resolved = await context.fs.resolve(\n \"@powerlines/plugin-env/types/runtime\"\n );\n if (!resolved) {\n throw new Error(\n `Failed to resolve the runtime type definition file for the environment variables. Please ensure that the \"@powerlines/plugin-env\" package is installed.`\n );\n }\n\n return resolved;\n}\n\n/**\n * Gets the default type definition for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment variables.\n */\nexport async function getEnvDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"EnvInterface\"\n };\n}\n\n/** Gets the default type definition for the environment secrets.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment secrets.\n */\nexport async function getSecretsDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"SecretsInterface\"\n };\n}\n\n/**\n * Gets the path to the environment type reflections.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The path to the environment type reflections.\n */\nexport function getEnvTypeReflectionsPath(\n context: Context<EnvPluginResolvedConfig>,\n name: EnvType = \"env\"\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}-types.bin`);\n}\n\n/**\n * Reads the environment type reflection from the file system.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The environment type reflection.\n */\nexport async function readEnvTypeReflection(\n context: EnvPluginContext,\n name: EnvType = \"env\"\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvTypeReflectionsPath(context, name);\n if (!existsSync(filePath)) {\n if (!context.env.types.env || isEmptyObject(context.env.types.env)) {\n const reflection = createEnvReflection(context) as Reflection;\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.types.env = reflection;\n await writeEnvTypeReflection(context, context.env.types.env, name);\n }\n\n return context.env.types.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.types[name] = reflection;\n context.env.types[name].messageRoot = messageRoot;\n context.env.types[name].dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment type reflection to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The environment type reflection to write.\n * @param name - The name of the type reflections.\n */\nexport async function writeEnvTypeReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvTypeReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\nexport function getEnvReflectionsPath(\n context: EnvPluginContext,\n name: EnvType\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}.bin`);\n}\n\n/**\n * Reads the environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readEnvReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"env\");\n if (!existsSync(filePath)) {\n if (!context.env.types.env) {\n context.env.types.env = await readEnvTypeReflection(context, \"env\");\n }\n\n if (!context.env.used.env || isEmptyObject(context.env.used.env)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.env\n }) as Reflection;\n reflection.name = \"Env\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.env = reflection;\n await writeEnvReflection(context, context.env.used.env, \"env\");\n }\n\n return context.env.used.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.env = reflection;\n context.env.used.env.messageRoot = messageRoot;\n context.env.used.env.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Reads the secret environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readSecretsReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"secrets\");\n if (!existsSync(filePath)) {\n if (!context.env.types.secrets) {\n context.env.types.secrets = await readEnvTypeReflection(\n context,\n \"secrets\"\n );\n }\n\n if (!context.env.used.secrets || isEmptyObject(context.env.used.secrets)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.secrets\n }) as Reflection;\n reflection.name = \"Secrets\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.secrets = reflection;\n await writeEnvReflection(context, context.env.used.secrets, \"secrets\");\n }\n\n return context.env.used.secrets;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.secrets = reflection;\n context.env.used.secrets.messageRoot = messageRoot;\n context.env.used.secrets.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport async function writeEnvReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport function writeEnvReflectionSync(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n writeFileBufferSync(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,eAAsB,uBAAE,SAAA;CACpB,MAAM,WAAW,MAAM,QAAQ,GAAG,QAAQ,uCAAC;eAE7C,OAAA,IAAA,MAAA,0JAAA;AAED,QAAA;;AAED,uBAAuB,SAAS;OAAO;OAA4B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A;;;;;;;;AAQ1C,SAAgB,uBAAsB,SAAA,YAAA,OAAA,OAAA;CAClC,MAAM,aAAa,WAAW,eAAS;CACzC,MAAA,UAAA,IAAA,MAAA,SAAA;AAEE,gBAAe,YADF,QAAQ,SAAS,gBAAS,CACjB,WAAA,WAAA,OAAA,CAAA;AACtB,qBAAoB,sBAAS,SAAA,KAAA,EAAA,QAAA,eAAA,CAAA;;AAEjC,uBAAuB,SAAM;OAAA;CAAA;OAAA;CAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
|
|
1
|
+
{"version":3,"file":"persistence.mjs","names":[],"sources":["../../src/helpers/persistence.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 { convertFromCapnp, convertToCapnp } from \"@powerlines/deepkit/capnp\";\nimport { getReflectionsPath } from \"@powerlines/deepkit/resolve-reflections\";\nimport { SerializedTypes } from \"@powerlines/deepkit/schemas/reflection\";\nimport { Reflection } from \"@powerlines/deepkit/types\";\nimport {\n deserializeType,\n ReflectionClass,\n ReflectionKind,\n resolveClassType\n} from \"@powerlines/deepkit/vendor/type\";\nimport * as capnp from \"@stryke/capnp\";\nimport {\n readFileBuffer,\n writeFileBuffer,\n writeFileBufferSync\n} from \"@stryke/fs/buffer\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isEmptyObject } from \"@stryke/type-checks/is-empty-object\";\nimport type { TypeDefinition } from \"@stryke/types/configuration\";\nimport { existsSync } from \"node:fs\";\nimport { Context, UnresolvedContext } from \"powerlines\";\nimport {\n EnvPluginContext,\n EnvPluginResolvedConfig,\n EnvType\n} from \"../types/plugin\";\nimport { createEnvReflection } from \"./reflect\";\n\n/**\n * Resolves the runtime type definition file for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The runtime type definition file for the environment variables.\n */\nexport async function resolveRuntimeTypeFile(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<string> {\n const resolved = await context.fs.resolve(\n \"@powerlines/plugin-env/types/runtime\"\n );\n if (!resolved) {\n throw new Error(\n `Failed to resolve the runtime type definition file for the environment variables. Please ensure that the \"@powerlines/plugin-env\" package is installed.`\n );\n }\n\n return resolved;\n}\n\n/**\n * Gets the default type definition for the environment variables.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment variables.\n */\nexport async function getEnvDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"EnvInterface\"\n };\n}\n\n/** Gets the default type definition for the environment secrets.\n *\n * @param context - The plugin context.\n * @returns The default type definition for the environment secrets.\n */\nexport async function getSecretsDefaultTypeDefinition(\n context: UnresolvedContext<EnvPluginResolvedConfig>\n): Promise<TypeDefinition> {\n return {\n file: await resolveRuntimeTypeFile(context),\n name: \"SecretsInterface\"\n };\n}\n\n/**\n * Gets the path to the environment type reflections.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The path to the environment type reflections.\n */\nexport function getEnvTypeReflectionsPath(\n context: Context<EnvPluginResolvedConfig>,\n name: EnvType = \"env\"\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}-types.bin`);\n}\n\n/**\n * Reads the environment type reflection from the file system.\n *\n * @param context - The plugin context.\n * @param name - The name of the type reflections.\n * @returns The environment type reflection.\n */\nexport async function readEnvTypeReflection(\n context: EnvPluginContext,\n name: EnvType = \"env\"\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvTypeReflectionsPath(context, name);\n if (!existsSync(filePath)) {\n if (!context.env.types.env || isEmptyObject(context.env.types.env)) {\n const reflection = createEnvReflection(context) as Reflection;\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.types.env = reflection;\n await writeEnvTypeReflection(context, context.env.types.env, name);\n }\n\n return context.env.types.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.types[name] = reflection;\n context.env.types[name].messageRoot = messageRoot;\n context.env.types[name].dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment type reflection to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The environment type reflection to write.\n * @param name - The name of the type reflections.\n */\nexport async function writeEnvTypeReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvTypeReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\nexport function getEnvReflectionsPath(\n context: EnvPluginContext,\n name: EnvType\n): string {\n return joinPaths(getReflectionsPath(context), \"env\", `${name}.bin`);\n}\n\n/**\n * Reads the environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readEnvReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"env\");\n if (!existsSync(filePath)) {\n if (!context.env.types.env) {\n context.env.types.env = await readEnvTypeReflection(context, \"env\");\n }\n\n if (!context.env.used.env || isEmptyObject(context.env.used.env)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Env\",\n description: `An object containing the environment configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.env\n }) as Reflection;\n reflection.name = \"Env\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.env = reflection;\n await writeEnvReflection(context, context.env.used.env, \"env\");\n }\n\n return context.env.used.env;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.env = reflection;\n context.env.used.env.messageRoot = messageRoot;\n context.env.used.env.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Reads the secret environment reflection data from the file system.\n *\n * @param context - The plugin context.\n * @returns The environment reflection data.\n */\nexport async function readSecretsReflection(\n context: EnvPluginContext\n): Promise<ReflectionClass<any>> {\n const filePath = getEnvReflectionsPath(context, \"secrets\");\n if (!existsSync(filePath)) {\n if (!context.env.types.secrets) {\n context.env.types.secrets = await readEnvTypeReflection(\n context,\n \"secrets\"\n );\n }\n\n if (!context.env.used.secrets || isEmptyObject(context.env.used.secrets)) {\n const reflection = createEnvReflection(context, {\n type: {\n kind: ReflectionKind.objectLiteral,\n typeName: \"Secrets\",\n description: `An object containing the secret configuration parameters that are used (at least once) by the ${\n context.config.name\n ? `${context.config.name} application`\n : \"application\"\n }.`,\n types: []\n },\n superReflection: context.env.types.secrets\n }) as Reflection;\n reflection.name = \"Secrets\";\n\n const message = new capnp.Message();\n reflection.messageRoot = message.initRoot(SerializedTypes);\n reflection.dataBuffer = message.toArrayBuffer();\n\n context.env.used.secrets = reflection;\n await writeEnvReflection(context, context.env.used.secrets, \"secrets\");\n }\n\n return context.env.used.secrets;\n }\n\n const buffer = await readFileBuffer(filePath);\n const message = new capnp.Message(buffer, false);\n const messageRoot = message.getRoot(SerializedTypes);\n\n const reflection = resolveClassType(\n deserializeType(convertFromCapnp(messageRoot.types))\n );\n\n context.env.used.secrets = reflection;\n context.env.used.secrets.messageRoot = messageRoot;\n context.env.used.secrets.dataBuffer = buffer;\n\n return reflection;\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport async function writeEnvReflection(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n await writeFileBuffer(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n\n/**\n * Writes the environment reflection data to the file system.\n *\n * @param context - The plugin context.\n * @param reflection - The reflection data to write.\n * @param name - The name of the reflection (either \"env\" or \"secrets\").\n */\nexport function writeEnvReflectionSync(\n context: EnvPluginContext,\n reflection: ReflectionClass<any>,\n name: EnvType = \"env\"\n) {\n const serialized = reflection.serializeType();\n\n const message = new capnp.Message();\n const root = message.initRoot(SerializedTypes);\n\n convertToCapnp(serialized, root._initTypes(serialized.length));\n\n writeFileBufferSync(\n getEnvReflectionsPath(context, name),\n message.toArrayBuffer()\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2CA,eAAiB,uBAAO,SAAA;CACxB,MAAS,WAAA,MAAA,QAA0B,GAAG,QAAQ,uCAAC;eAE7C,OAAA,IAAA,MAAA,0JAAA;AAED,QAAA;;AAED,uBAAuB,SAAM;OAAU;OAA0B;CAAS;CAAA;CAAA;CAAA;CAAA;;;;;;;AAO1E,eAAG,4BAAA,SAAA;AACC,QAAG;EACH,MAAU,MAAK,uBAAA,QAAA;EACZ,MAAO;EACT;;;;;;;;;;;;;;;AAQL,eAAC,gCAAA,SAAA;AACG,QAAM;EACN,MAAQ,MAAI,uBAA2B,QAAK;EAC9C,MA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AA,KAAA,EAAA,QAAA,eAAA,CAAA;;AAEjC,uBAAkB,SAAW;OAAA;CAAA;OAAA;CAAA;OAAA;CAAA;OAAA;CAAA;CAAA;CAAA;CAAA"}
|
package/dist/helpers/reflect.cjs
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
2
3
|
const require_types_runtime = require('../types/runtime.cjs');
|
|
3
4
|
const require_types_plugin = require('../types/plugin.cjs');
|
|
4
|
-
const require_join_paths = require('../node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/join-paths.cjs');
|
|
5
|
-
const require_is_parent_path = require('../node_modules/.pnpm/@stryke_path@0.26.19/node_modules/@stryke/path/dist/is-parent-path.cjs');
|
|
6
5
|
const require_helpers_persistence = require('./persistence.cjs');
|
|
7
|
-
let
|
|
8
|
-
let
|
|
9
|
-
let
|
|
6
|
+
let _powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
|
|
7
|
+
let _stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
8
|
+
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
9
|
+
let _powerlines_deepkit_reflect_type = require("@powerlines/deepkit/reflect-type");
|
|
10
|
+
let _stryke_path_is_parent_path = require("@stryke/path/is-parent-path");
|
|
10
11
|
|
|
11
12
|
//#region src/helpers/reflect.ts
|
|
12
13
|
function __assignType(fn, args) {
|
|
@@ -14,7 +15,7 @@ function __assignType(fn, args) {
|
|
|
14
15
|
return fn;
|
|
15
16
|
}
|
|
16
17
|
function mergeEnvReflections(context, reflections) {
|
|
17
|
-
return createEnvReflection(context, { type: (0,
|
|
18
|
+
return createEnvReflection(context, { type: (0, _powerlines_deepkit_vendor_type.merge)(reflections.map(__assignType((reflection) => reflection.type, [
|
|
18
19
|
"reflection",
|
|
19
20
|
"",
|
|
20
21
|
"P\"2!\"/\""
|
|
@@ -23,14 +24,14 @@ function mergeEnvReflections(context, reflections) {
|
|
|
23
24
|
mergeEnvReflections.__type = [
|
|
24
25
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
25
26
|
"context",
|
|
26
|
-
() =>
|
|
27
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
27
28
|
"reflections",
|
|
28
|
-
() =>
|
|
29
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
29
30
|
"mergeEnvReflections",
|
|
30
31
|
"Pn!2\"P\"7#F2$P\"7%/&"
|
|
31
32
|
];
|
|
32
33
|
function mergeSecretsReflections(context, reflections) {
|
|
33
|
-
return createSecretsReflection(context, { type: (0,
|
|
34
|
+
return createSecretsReflection(context, { type: (0, _powerlines_deepkit_vendor_type.merge)(reflections.map(__assignType((reflection) => reflection.type, [
|
|
34
35
|
"reflection",
|
|
35
36
|
"",
|
|
36
37
|
"P\"2!\"/\""
|
|
@@ -39,17 +40,17 @@ function mergeSecretsReflections(context, reflections) {
|
|
|
39
40
|
mergeSecretsReflections.__type = [
|
|
40
41
|
() => require_types_plugin.__ΩEnvPluginContext,
|
|
41
42
|
"context",
|
|
42
|
-
() =>
|
|
43
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
43
44
|
"reflections",
|
|
44
|
-
() =>
|
|
45
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
45
46
|
"mergeSecretsReflections",
|
|
46
47
|
"Pn!2\"P\"7#F2$P\"7%/&"
|
|
47
48
|
];
|
|
48
49
|
const __ΩCreateEnvReflectionOptions = [
|
|
49
|
-
() =>
|
|
50
|
-
() =>
|
|
50
|
+
() => _powerlines_deepkit_vendor_type.__ΩTypeObjectLiteral,
|
|
51
|
+
() => _powerlines_deepkit_vendor_type.__ΩTypeClass,
|
|
51
52
|
"type",
|
|
52
|
-
() =>
|
|
53
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
53
54
|
"superReflection",
|
|
54
55
|
"CreateEnvReflectionOptions",
|
|
55
56
|
"PPn!n\"J4#8P\"7$4%8Mw&y"
|
|
@@ -143,23 +144,23 @@ var BaseSecrets = class {
|
|
|
143
144
|
];
|
|
144
145
|
};
|
|
145
146
|
function createEnvReflection(context, options = {}) {
|
|
146
|
-
const parent = options.superReflection ?? new
|
|
147
|
-
kind:
|
|
148
|
-
description: `The base environment configuration definition for the ${(0,
|
|
147
|
+
const parent = options.superReflection ?? new _powerlines_deepkit_vendor_type.ReflectionClass({
|
|
148
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.class,
|
|
149
|
+
description: `The base environment configuration definition for the ${(0, _stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
149
150
|
classType: BaseEnv,
|
|
150
151
|
types: [],
|
|
151
152
|
implements: [{
|
|
152
|
-
kind:
|
|
153
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
153
154
|
typeName: "EnvInterface",
|
|
154
|
-
description: `The environment configuration interface definition for the ${(0,
|
|
155
|
+
description: `The environment configuration interface definition for the ${(0, _stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
155
156
|
types: []
|
|
156
157
|
}]
|
|
157
158
|
});
|
|
158
159
|
parent.name = "Env";
|
|
159
|
-
const result = new
|
|
160
|
-
kind:
|
|
160
|
+
const result = new _powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
|
|
161
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
161
162
|
typeName: "Env",
|
|
162
|
-
description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${(0,
|
|
163
|
+
description: `A schema describing the list of available environment variables that can be used by the ${context.config.name ? `${(0, _stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
|
|
163
164
|
types: []
|
|
164
165
|
}, parent);
|
|
165
166
|
result.name = "Env";
|
|
@@ -171,28 +172,28 @@ createEnvReflection.__type = [
|
|
|
171
172
|
() => __ΩCreateEnvReflectionOptions,
|
|
172
173
|
"options",
|
|
173
174
|
() => ({}),
|
|
174
|
-
() =>
|
|
175
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
175
176
|
"createEnvReflection",
|
|
176
177
|
"Pn!2\"n#2$>%P\"7&/'"
|
|
177
178
|
];
|
|
178
179
|
function createSecretsReflection(context, options = {}) {
|
|
179
|
-
const parent = options.superReflection ?? new
|
|
180
|
-
kind:
|
|
181
|
-
description: `The base secrets configuration definition for the ${(0,
|
|
180
|
+
const parent = options.superReflection ?? new _powerlines_deepkit_vendor_type.ReflectionClass({
|
|
181
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.class,
|
|
182
|
+
description: `The base secrets configuration definition for the ${(0, _stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
182
183
|
classType: BaseSecrets,
|
|
183
184
|
types: [],
|
|
184
185
|
implements: [{
|
|
185
|
-
kind:
|
|
186
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
186
187
|
typeName: "SecretsInterface",
|
|
187
|
-
description: `The secrets configuration interface definition for the ${(0,
|
|
188
|
+
description: `The secrets configuration interface definition for the ${(0, _stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
|
|
188
189
|
types: []
|
|
189
190
|
}]
|
|
190
191
|
});
|
|
191
192
|
parent.name = "Secrets";
|
|
192
|
-
const result = new
|
|
193
|
-
kind:
|
|
193
|
+
const result = new _powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
|
|
194
|
+
kind: _powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
|
|
194
195
|
typeName: "Secrets",
|
|
195
|
-
description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${(0,
|
|
196
|
+
description: `A schema describing the list of available environment secrets that can be used by the ${context.config.name ? `${(0, _stryke_string_format_title_case.titleCase)(context.config.name)} application` : "application"}.`,
|
|
196
197
|
types: []
|
|
197
198
|
}, parent);
|
|
198
199
|
result.name = "Secrets";
|
|
@@ -204,7 +205,7 @@ createSecretsReflection.__type = [
|
|
|
204
205
|
() => __ΩCreateEnvReflectionOptions,
|
|
205
206
|
"options",
|
|
206
207
|
() => ({}),
|
|
207
|
-
() =>
|
|
208
|
+
() => _powerlines_deepkit_vendor_type.ReflectionClass,
|
|
208
209
|
"createSecretsReflection",
|
|
209
210
|
"Pn!2\"n#2$>%P\"7&/'"
|
|
210
211
|
];
|
|
@@ -221,14 +222,14 @@ createSecretsReflection.__type = [
|
|
|
221
222
|
*/
|
|
222
223
|
async function reflectEnv(context, file, name) {
|
|
223
224
|
let config;
|
|
224
|
-
if (file) config = (0,
|
|
225
|
-
file: !
|
|
225
|
+
if (file) config = (0, _powerlines_deepkit_vendor_type.resolveClassType)(await (0, _powerlines_deepkit_reflect_type.reflectType)(context, {
|
|
226
|
+
file: !(0, _stryke_path_is_parent_path.isParentPath)(file, context.workspaceConfig.workspaceRoot) ? (0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, file) : file,
|
|
226
227
|
name
|
|
227
228
|
}));
|
|
228
229
|
return mergeEnvReflections(context, [
|
|
229
230
|
await require_helpers_persistence.readEnvTypeReflection(context, "env"),
|
|
230
231
|
config,
|
|
231
|
-
(0,
|
|
232
|
+
(0, _powerlines_deepkit_vendor_type.resolveClassType)(await (0, _powerlines_deepkit_reflect_type.reflectType)(context, await require_helpers_persistence.getEnvDefaultTypeDefinition(context)))
|
|
232
233
|
].filter(Boolean));
|
|
233
234
|
}
|
|
234
235
|
reflectEnv.__type = [
|
|
@@ -253,14 +254,14 @@ reflectEnv.__type = [
|
|
|
253
254
|
*/
|
|
254
255
|
async function reflectSecrets(context, file, name) {
|
|
255
256
|
let config;
|
|
256
|
-
if (file) config = (0,
|
|
257
|
-
file: !
|
|
257
|
+
if (file) config = (0, _powerlines_deepkit_vendor_type.resolveClassType)(await (0, _powerlines_deepkit_reflect_type.reflectType)(context, {
|
|
258
|
+
file: !(0, _stryke_path_is_parent_path.isParentPath)(file, context.workspaceConfig.workspaceRoot) ? (0, _stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, file) : file,
|
|
258
259
|
name
|
|
259
260
|
}));
|
|
260
261
|
return mergeSecretsReflections(context, [
|
|
261
262
|
await require_helpers_persistence.readSecretsReflection(context),
|
|
262
263
|
config,
|
|
263
|
-
(0,
|
|
264
|
+
(0, _powerlines_deepkit_vendor_type.resolveClassType)(await (0, _powerlines_deepkit_reflect_type.reflectType)(context, await require_helpers_persistence.getSecretsDefaultTypeDefinition(context)))
|
|
264
265
|
].filter(Boolean));
|
|
265
266
|
}
|
|
266
267
|
reflectSecrets.__type = [
|