@powerlines/plugin-env 0.15.141 → 0.15.142

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.
Files changed (209) hide show
  1. package/dist/automd-generator-BNg74tyV.cjs +37 -0
  2. package/dist/automd-generator-DoKLIMuw.mjs +32 -0
  3. package/dist/automd-generator-DoKLIMuw.mjs.map +1 -0
  4. package/dist/babel/index.cjs +5 -2
  5. package/dist/babel/index.d.cts +14 -1
  6. package/dist/babel/index.d.mts +14 -1
  7. package/dist/babel/index.mjs +4 -1
  8. package/dist/babel/plugin.cjs +4 -140
  9. package/dist/babel/plugin.d.cts +14 -7
  10. package/dist/babel/plugin.d.mts +14 -7
  11. package/dist/babel/plugin.mjs +3 -138
  12. package/dist/babel-BZqmdVF4.cjs +0 -0
  13. package/dist/babel-DgietUY3.mjs +1 -0
  14. package/dist/chunk-CNVrAnJR.cjs +48 -0
  15. package/dist/{_virtual/rolldown_runtime.cjs → chunk-CsF2CmBJ.mjs} +6 -2
  16. package/dist/components/docs.cjs +13 -69
  17. package/dist/components/docs.d.cts +1 -21
  18. package/dist/components/docs.d.mts +1 -21
  19. package/dist/components/docs.mjs +12 -67
  20. package/dist/components/env.cjs +13 -588
  21. package/dist/components/env.d.cts +1 -19
  22. package/dist/components/env.d.mts +1 -19
  23. package/dist/components/env.mjs +11 -584
  24. package/dist/components/index.cjs +17 -5
  25. package/dist/components/index.d.cts +3 -2
  26. package/dist/components/index.d.mts +3 -2
  27. package/dist/components/index.mjs +14 -2
  28. package/dist/components-BUo6Koax.cjs +0 -0
  29. package/dist/components-DDFmImcI.mjs +1 -0
  30. package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs +23 -0
  31. package/dist/confbox.DA7CpUDY-DShUZ_rW.mjs.map +1 -0
  32. package/dist/confbox.DA7CpUDY-r6FXRsI6.cjs +28 -0
  33. package/dist/confbox.DnMsyigM-C13n3X-S.cjs +415 -0
  34. package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs +405 -0
  35. package/dist/confbox.DnMsyigM-V6Wj0LPC.mjs.map +1 -0
  36. package/dist/create-reflection-resource-B3friIs9.mjs +98 -0
  37. package/dist/create-reflection-resource-B3friIs9.mjs.map +1 -0
  38. package/dist/create-reflection-resource-BJj83ii4.cjs +103 -0
  39. package/dist/create-reflection-resource-DSLbLsX2.d.cts +16 -0
  40. package/dist/create-reflection-resource-DSLbLsX2.d.cts.map +1 -0
  41. package/dist/create-reflection-resource-DwWJAo-G.d.mts +16 -0
  42. package/dist/create-reflection-resource-DwWJAo-G.d.mts.map +1 -0
  43. package/dist/defu-CrqNIh1A.cjs +227 -0
  44. package/dist/defu-DV5Grr85.mjs +180 -0
  45. package/dist/defu-DV5Grr85.mjs.map +1 -0
  46. package/dist/dist-BQc8ZRwl.cjs +13 -0
  47. package/dist/dist-C_a6goTt.cjs +15282 -0
  48. package/dist/dist-CjWvISyq.mjs +15271 -0
  49. package/dist/dist-CjWvISyq.mjs.map +1 -0
  50. package/dist/dist-mV5Swt78.mjs +13 -0
  51. package/dist/dist-mV5Swt78.mjs.map +1 -0
  52. package/dist/docs-B-SDRHeg.cjs +75 -0
  53. package/dist/docs-B0d8pdIg.d.mts +23 -0
  54. package/dist/docs-B0d8pdIg.d.mts.map +1 -0
  55. package/dist/docs-DMfzQuvP.d.cts +23 -0
  56. package/dist/docs-DMfzQuvP.d.cts.map +1 -0
  57. package/dist/docs-DbRoWmL_.mjs +70 -0
  58. package/dist/docs-DbRoWmL_.mjs.map +1 -0
  59. package/dist/docs-helper-2fe7M3Th.mjs +24 -0
  60. package/dist/docs-helper-2fe7M3Th.mjs.map +1 -0
  61. package/dist/docs-helper-4MoQ5-R3.cjs +28 -0
  62. package/dist/env-BIyd8CTA.d.cts +21 -0
  63. package/dist/env-BIyd8CTA.d.cts.map +1 -0
  64. package/dist/env-BKmI7DyR.d.mts +21 -0
  65. package/dist/env-BKmI7DyR.d.mts.map +1 -0
  66. package/dist/env-D9oCn-AS.mjs +587 -0
  67. package/dist/env-D9oCn-AS.mjs.map +1 -0
  68. package/dist/env-R63eR4RP.cjs +598 -0
  69. package/dist/helpers/automd-generator.cjs +3 -31
  70. package/dist/helpers/automd-generator.d.cts +2 -1
  71. package/dist/helpers/automd-generator.d.cts.map +1 -0
  72. package/dist/helpers/automd-generator.d.mts +2 -1
  73. package/dist/helpers/automd-generator.d.mts.map +1 -0
  74. package/dist/helpers/automd-generator.mjs +2 -29
  75. package/dist/helpers/create-reflection-resource.cjs +11 -97
  76. package/dist/helpers/create-reflection-resource.d.cts +3 -14
  77. package/dist/helpers/create-reflection-resource.d.mts +3 -14
  78. package/dist/helpers/create-reflection-resource.mjs +10 -95
  79. package/dist/helpers/docs-helper.cjs +5 -23
  80. package/dist/helpers/docs-helper.d.cts +4 -2
  81. package/dist/helpers/docs-helper.d.cts.map +1 -0
  82. package/dist/helpers/docs-helper.d.mts +4 -2
  83. package/dist/helpers/docs-helper.d.mts.map +1 -0
  84. package/dist/helpers/docs-helper.mjs +4 -21
  85. package/dist/helpers/index.cjs +38 -32
  86. package/dist/helpers/index.d.cts +9 -6
  87. package/dist/helpers/index.d.mts +9 -6
  88. package/dist/helpers/index.mjs +12 -6
  89. package/dist/helpers/load.cjs +10 -134
  90. package/dist/helpers/load.d.cts +3 -34
  91. package/dist/helpers/load.d.mts +3 -34
  92. package/dist/helpers/load.mjs +8 -130
  93. package/dist/helpers/persistence.cjs +15 -321
  94. package/dist/helpers/persistence.d.cts +3 -83
  95. package/dist/helpers/persistence.d.mts +3 -83
  96. package/dist/helpers/persistence.mjs +4 -308
  97. package/dist/helpers/reflect.cjs +13 -262
  98. package/dist/helpers/reflect.d.cts +3 -45
  99. package/dist/helpers/reflect.d.mts +3 -45
  100. package/dist/helpers/reflect.mjs +4 -252
  101. package/dist/helpers/source-file-env.cjs +3 -57
  102. package/dist/helpers/source-file-env.d.cts +1 -7
  103. package/dist/helpers/source-file-env.d.mts +1 -7
  104. package/dist/helpers/source-file-env.mjs +1 -54
  105. package/dist/helpers/template-helpers.cjs +6 -69
  106. package/dist/helpers/template-helpers.d.cts +3 -14
  107. package/dist/helpers/template-helpers.d.mts +3 -14
  108. package/dist/helpers/template-helpers.mjs +5 -67
  109. package/dist/helpers-45e1bvAO.mjs +1 -0
  110. package/dist/helpers-DgYP3uej.cjs +0 -0
  111. package/dist/index-BNRXMhlr.d.mts +1 -0
  112. package/dist/index-Bdi8CvaN.d.cts +16 -0
  113. package/dist/index-Bdi8CvaN.d.cts.map +1 -0
  114. package/dist/index-CEDY7cmG.d.cts +1 -0
  115. package/dist/index-CREkvfw9.d.mts +1 -0
  116. package/dist/index-DSiHnMH2.d.cts +1 -0
  117. package/dist/index-Drhzdkqe.d.mts +16 -0
  118. package/dist/index-Drhzdkqe.d.mts.map +1 -0
  119. package/dist/index-dhjtMp5F.d.mts +1 -0
  120. package/dist/index-uTS5iDq_.d.cts +1 -0
  121. package/dist/index.cjs +257 -98
  122. package/dist/index.d.cts +14 -23
  123. package/dist/index.d.mts +14 -23
  124. package/dist/index.mjs +184 -23
  125. package/dist/index.mjs.map +1 -0
  126. package/dist/join-paths-BMg51Ddi.mjs +148 -0
  127. package/dist/join-paths-BMg51Ddi.mjs.map +1 -0
  128. package/dist/join-paths-Bc4rM2TX.cjs +159 -0
  129. package/dist/json5-DEV_07Nb.cjs +786 -0
  130. package/dist/json5-jq90mF9X.mjs +787 -0
  131. package/dist/json5-jq90mF9X.mjs.map +1 -0
  132. package/dist/jsonc-CBh70baJ.cjs +4 -0
  133. package/dist/jsonc-CDLU6bgi.mjs +4 -0
  134. package/dist/load-DPB0maqs.cjs +6594 -0
  135. package/dist/load-Dr5ybfL7.mjs +6579 -0
  136. package/dist/load-Dr5ybfL7.mjs.map +1 -0
  137. package/dist/load-GpP6cojj.d.mts +36 -0
  138. package/dist/load-GpP6cojj.d.mts.map +1 -0
  139. package/dist/load-PHGmxX_X.d.cts +36 -0
  140. package/dist/load-PHGmxX_X.d.cts.map +1 -0
  141. package/dist/multipart-parser-D65rtMfY.mjs +176 -0
  142. package/dist/multipart-parser-D65rtMfY.mjs.map +1 -0
  143. package/dist/multipart-parser-aEF5a4Xf.cjs +178 -0
  144. package/dist/node-Co8KdzkZ.cjs +3985 -0
  145. package/dist/node-D9MigVDD.mjs +3975 -0
  146. package/dist/node-D9MigVDD.mjs.map +1 -0
  147. package/dist/persistence-BR4cUaN6.d.cts +85 -0
  148. package/dist/persistence-BR4cUaN6.d.cts.map +1 -0
  149. package/dist/persistence-BsBxs9wt.mjs +586 -0
  150. package/dist/persistence-BsBxs9wt.mjs.map +1 -0
  151. package/dist/persistence-D_clXRxP.cjs +712 -0
  152. package/dist/persistence-DrKQZNCv.d.mts +85 -0
  153. package/dist/persistence-DrKQZNCv.d.mts.map +1 -0
  154. package/dist/plugin-CM1TSv1B.cjs +159 -0
  155. package/dist/plugin-CSVnrdpE.cjs +146 -0
  156. package/dist/plugin-CSe5f2cD.d.cts +155 -0
  157. package/dist/plugin-CSe5f2cD.d.cts.map +1 -0
  158. package/dist/plugin-DMbVjdcQ.d.mts +155 -0
  159. package/dist/plugin-DMbVjdcQ.d.mts.map +1 -0
  160. package/dist/plugin-Vyvy9w9Z.mjs +141 -0
  161. package/dist/plugin-Vyvy9w9Z.mjs.map +1 -0
  162. package/dist/plugin-eBjQJP6x.mjs +130 -0
  163. package/dist/plugin-eBjQJP6x.mjs.map +1 -0
  164. package/dist/reflect-Dm8a3c29.d.cts +47 -0
  165. package/dist/reflect-Dm8a3c29.d.cts.map +1 -0
  166. package/dist/reflect-Dpz8ifa0.d.mts +47 -0
  167. package/dist/reflect-Dpz8ifa0.d.mts.map +1 -0
  168. package/dist/runtime-BDzzR4wH.d.cts +792 -0
  169. package/dist/runtime-BDzzR4wH.d.cts.map +1 -0
  170. package/dist/runtime-C5ukCv3P.mjs +242 -0
  171. package/dist/runtime-C5ukCv3P.mjs.map +1 -0
  172. package/dist/runtime-g0TEIoZK.cjs +253 -0
  173. package/dist/runtime-lYSIZdMn.d.mts +792 -0
  174. package/dist/runtime-lYSIZdMn.d.mts.map +1 -0
  175. package/dist/source-file-env-4Vdtzc5-.cjs +68 -0
  176. package/dist/source-file-env-Brfopjyr.d.cts +9 -0
  177. package/dist/source-file-env-Brfopjyr.d.cts.map +1 -0
  178. package/dist/source-file-env-DWejSP2U.d.mts +9 -0
  179. package/dist/source-file-env-DWejSP2U.d.mts.map +1 -0
  180. package/dist/source-file-env-Tj-6qobx.mjs +57 -0
  181. package/dist/source-file-env-Tj-6qobx.mjs.map +1 -0
  182. package/dist/template-helpers-1SKodHKt.d.mts +16 -0
  183. package/dist/template-helpers-1SKodHKt.d.mts.map +1 -0
  184. package/dist/template-helpers-CCEjhw1B.mjs +70 -0
  185. package/dist/template-helpers-CCEjhw1B.mjs.map +1 -0
  186. package/dist/template-helpers-YVcwxmoF.cjs +75 -0
  187. package/dist/template-helpers-zyitPfMz.d.cts +16 -0
  188. package/dist/template-helpers-zyitPfMz.d.cts.map +1 -0
  189. package/dist/toml-DvrxV201.cjs +657 -0
  190. package/dist/toml-uuOYvEAO.mjs +658 -0
  191. package/dist/toml-uuOYvEAO.mjs.map +1 -0
  192. package/dist/types/index.cjs +10 -9
  193. package/dist/types/index.d.cts +3 -2
  194. package/dist/types/index.d.mts +3 -2
  195. package/dist/types/index.mjs +3 -2
  196. package/dist/types/plugin.cjs +7 -133
  197. package/dist/types/plugin.d.cts +2 -153
  198. package/dist/types/plugin.d.mts +2 -153
  199. package/dist/types/plugin.mjs +2 -127
  200. package/dist/types/runtime.cjs +3 -242
  201. package/dist/types/runtime.d.cts +1 -790
  202. package/dist/types/runtime.d.mts +1 -790
  203. package/dist/types/runtime.mjs +1 -239
  204. package/dist/types-DyPQho_C.mjs +1 -0
  205. package/dist/types-o3zWarRp.cjs +0 -0
  206. package/dist/yaml-CIn2Gddw.mjs +1055 -0
  207. package/dist/yaml-CIn2Gddw.mjs.map +1 -0
  208. package/dist/yaml-CQSFMRMS.cjs +1054 -0
  209. package/package.json +9 -9
@@ -0,0 +1,712 @@
1
+ const require_chunk = require('./chunk-CNVrAnJR.cjs');
2
+ const require_runtime = require('./runtime-g0TEIoZK.cjs');
3
+ const require_plugin = require('./plugin-CM1TSv1B.cjs');
4
+ const require_join_paths = require('./join-paths-Bc4rM2TX.cjs');
5
+ let __powerlines_deepkit_vendor_type = require("@powerlines/deepkit/vendor/type");
6
+ let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
7
+ let powerlines_types_context = require("powerlines/types/context");
8
+ let __powerlines_deepkit_capnp = require("@powerlines/deepkit/capnp");
9
+ let __powerlines_deepkit_resolve_reflections = require("@powerlines/deepkit/resolve-reflections");
10
+ let __powerlines_deepkit_schemas_reflection = require("@powerlines/deepkit/schemas/reflection");
11
+ let __stryke_capnp = require("@stryke/capnp");
12
+ __stryke_capnp = require_chunk.__toESM(__stryke_capnp);
13
+ let __stryke_fs_buffer = require("@stryke/fs/buffer");
14
+ let __stryke_type_checks_is_empty_object = require("@stryke/type-checks/is-empty-object");
15
+ let node_fs = require("node:fs");
16
+ let __powerlines_deepkit_reflect_type = require("@powerlines/deepkit/reflect-type");
17
+
18
+ //#region ../../node_modules/.pnpm/@stryke+path@0.26.3/node_modules/@stryke/path/dist/is-parent-path.mjs
19
+ /**
20
+ * Check if a given path is a parent of another path.
21
+ *
22
+ * @example
23
+ * ```ts
24
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src");
25
+ * // returns true
26
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project");
27
+ * // returns true
28
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/other");
29
+ * // returns false
30
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/other");
31
+ * // returns false
32
+ * isParentPath("/home/user/project/src/index.ts", "/home/user/project/src/index.ts");
33
+ * // returns false
34
+ * ```
35
+ *
36
+ * @param childPath - The path to check if it is a child of the parent path.
37
+ * @param parentPath - The path to check if it is a parent of the child path.
38
+ * @returns `true` if `childPath` is a child of `parentPath`, otherwise `false`.
39
+ */
40
+ function isParentPath(childPath, parentPath) {
41
+ const normalizedChild = require_join_paths.slash(childPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
42
+ const normalizedParent = require_join_paths.slash(parentPath.replaceAll(/\\/g, "/").replace(/\/*$/, ""))?.toLowerCase();
43
+ return childPath !== parentPath && normalizedChild !== normalizedParent && normalizedChild.startsWith(`${normalizedParent}/`);
44
+ }
45
+
46
+ //#endregion
47
+ //#region src/helpers/reflect.ts
48
+ function __assignType(fn, args) {
49
+ fn.__type = args;
50
+ return fn;
51
+ }
52
+ function mergeEnvReflections(context, reflections) {
53
+ return createEnvReflection(context, { type: (0, __powerlines_deepkit_vendor_type.merge)(reflections.map(__assignType((reflection) => reflection.type, [
54
+ "reflection",
55
+ "",
56
+ "P\"2!\"/\""
57
+ ]))) });
58
+ }
59
+ mergeEnvReflections.__type = [
60
+ () => require_plugin.__ΩEnvPluginContext,
61
+ "context",
62
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
63
+ "reflections",
64
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
65
+ "mergeEnvReflections",
66
+ "Pn!2\"P\"7#F2$P\"7%/&"
67
+ ];
68
+ function mergeSecretsReflections(context, reflections) {
69
+ return createSecretsReflection(context, { type: (0, __powerlines_deepkit_vendor_type.merge)(reflections.map(__assignType((reflection) => reflection.type, [
70
+ "reflection",
71
+ "",
72
+ "P\"2!\"/\""
73
+ ]))) });
74
+ }
75
+ mergeSecretsReflections.__type = [
76
+ () => require_plugin.__ΩEnvPluginContext,
77
+ "context",
78
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
79
+ "reflections",
80
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
81
+ "mergeSecretsReflections",
82
+ "Pn!2\"P\"7#F2$P\"7%/&"
83
+ ];
84
+ const __ΩCreateEnvReflectionOptions = [
85
+ () => __powerlines_deepkit_vendor_type.__ΩTypeObjectLiteral,
86
+ () => __powerlines_deepkit_vendor_type.__ΩTypeClass,
87
+ "type",
88
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
89
+ "superReflection",
90
+ "CreateEnvReflectionOptions",
91
+ "PPn!n\"J4#8P\"7$4%8Mw&y"
92
+ ];
93
+ var BaseEnv = class {
94
+ PLATFORM = "neutral";
95
+ MODE = "production";
96
+ DEBUG = false;
97
+ TEST = false;
98
+ MINIMAL = false;
99
+ NO_COLOR = false;
100
+ FORCE_COLOR = false;
101
+ FORCE_HYPERLINK = false;
102
+ STACKTRACE = false;
103
+ INCLUDE_ERROR_DATA = false;
104
+ CI = false;
105
+ static __type = [
106
+ "APP_NAME",
107
+ "APP_VERSION",
108
+ "BUILD_ID",
109
+ "BUILD_TIMESTAMP",
110
+ "BUILD_CHECKSUM",
111
+ "RELEASE_ID",
112
+ "RELEASE_TAG",
113
+ "ORGANIZATION",
114
+ "node",
115
+ "browser",
116
+ "neutral",
117
+ "PLATFORM",
118
+ function() {
119
+ return "neutral";
120
+ },
121
+ "development",
122
+ "test",
123
+ "production",
124
+ "MODE",
125
+ function() {
126
+ return "production";
127
+ },
128
+ "ENVIRONMENT",
129
+ "DEBUG",
130
+ function() {
131
+ return false;
132
+ },
133
+ "TEST",
134
+ function() {
135
+ return false;
136
+ },
137
+ "MINIMAL",
138
+ function() {
139
+ return false;
140
+ },
141
+ "NO_COLOR",
142
+ function() {
143
+ return false;
144
+ },
145
+ "FORCE_COLOR",
146
+ function() {
147
+ return false;
148
+ },
149
+ "FORCE_HYPERLINK",
150
+ function() {
151
+ return false;
152
+ },
153
+ "STACKTRACE",
154
+ function() {
155
+ return false;
156
+ },
157
+ "INCLUDE_ERROR_DATA",
158
+ function() {
159
+ return false;
160
+ },
161
+ "ERROR_URL",
162
+ "DEFAULT_TIMEZONE",
163
+ "DEFAULT_LOCALE",
164
+ "CI",
165
+ function() {
166
+ return false;
167
+ },
168
+ () => require_runtime.__ΩEnvInterface,
169
+ "BaseEnv",
170
+ "&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"
171
+ ];
172
+ };
173
+ var BaseSecrets = class {
174
+ static __type = [
175
+ "ENCRYPTION_KEY",
176
+ () => require_runtime.__ΩSecretsInterface,
177
+ "BaseSecrets",
178
+ "&3!5n\"x\"w#"
179
+ ];
180
+ };
181
+ function createEnvReflection(context, options = {}) {
182
+ const parent = options.superReflection ?? new __powerlines_deepkit_vendor_type.ReflectionClass({
183
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.class,
184
+ description: `The base environment configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
185
+ classType: BaseEnv,
186
+ types: [],
187
+ implements: [{
188
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
189
+ typeName: "EnvInterface",
190
+ description: `The environment configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
191
+ types: []
192
+ }]
193
+ });
194
+ parent.name = "Env";
195
+ const result = new __powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
196
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
197
+ typeName: "Env",
198
+ 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"}.`,
199
+ types: []
200
+ }, parent);
201
+ result.name = "Env";
202
+ return result;
203
+ }
204
+ createEnvReflection.__type = [
205
+ () => require_plugin.__ΩEnvPluginContext,
206
+ "context",
207
+ () => __ΩCreateEnvReflectionOptions,
208
+ "options",
209
+ () => ({}),
210
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
211
+ "createEnvReflection",
212
+ "Pn!2\"n#2$>%P\"7&/'"
213
+ ];
214
+ function createSecretsReflection(context, options = {}) {
215
+ const parent = options.superReflection ?? new __powerlines_deepkit_vendor_type.ReflectionClass({
216
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.class,
217
+ description: `The base secrets configuration definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
218
+ classType: BaseSecrets,
219
+ types: [],
220
+ implements: [{
221
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
222
+ typeName: "SecretsInterface",
223
+ description: `The secrets configuration interface definition for the ${(0, __stryke_string_format_title_case.titleCase)(context.config.name)} project.`,
224
+ types: []
225
+ }]
226
+ });
227
+ parent.name = "Secrets";
228
+ const result = new __powerlines_deepkit_vendor_type.ReflectionClass(options.type ?? {
229
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
230
+ typeName: "Secrets",
231
+ 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"}.`,
232
+ types: []
233
+ }, parent);
234
+ result.name = "Secrets";
235
+ return result;
236
+ }
237
+ createSecretsReflection.__type = [
238
+ () => require_plugin.__ΩEnvPluginContext,
239
+ "context",
240
+ () => __ΩCreateEnvReflectionOptions,
241
+ "options",
242
+ () => ({}),
243
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
244
+ "createSecretsReflection",
245
+ "Pn!2\"n#2$>%P\"7&/'"
246
+ ];
247
+ async function reflectEnv(context, file, name) {
248
+ let config;
249
+ if (file) config = (0, __powerlines_deepkit_vendor_type.resolveClassType)(await (0, __powerlines_deepkit_reflect_type.reflectType)(context, {
250
+ file: !isParentPath(file, context.workspaceConfig.workspaceRoot) ? require_join_paths.joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
251
+ name
252
+ }));
253
+ const defaultConfigType = await (0, __powerlines_deepkit_reflect_type.reflectType)(context, await getEnvDefaultTypeDefinition(context));
254
+ return mergeEnvReflections(context, [
255
+ await readEnvTypeReflection(context, "env"),
256
+ config,
257
+ (0, __powerlines_deepkit_vendor_type.resolveClassType)(defaultConfigType)
258
+ ].filter(Boolean));
259
+ }
260
+ reflectEnv.__type = [
261
+ () => require_plugin.__ΩEnvPluginContext,
262
+ "context",
263
+ "file",
264
+ "name",
265
+ "reflectEnv",
266
+ "Pn!2\"&2#8&2$8\"/%"
267
+ ];
268
+ async function reflectSecrets(context, file, name) {
269
+ let config;
270
+ if (file) config = (0, __powerlines_deepkit_vendor_type.resolveClassType)(await (0, __powerlines_deepkit_reflect_type.reflectType)(context, {
271
+ file: !isParentPath(file, context.workspaceConfig.workspaceRoot) ? require_join_paths.joinPaths(context.workspaceConfig.workspaceRoot, file) : file,
272
+ name
273
+ }));
274
+ const defaultSecretsType = await (0, __powerlines_deepkit_reflect_type.reflectType)(context, await getSecretsDefaultTypeDefinition(context));
275
+ return mergeSecretsReflections(context, [
276
+ await readSecretsReflection(context),
277
+ config,
278
+ (0, __powerlines_deepkit_vendor_type.resolveClassType)(defaultSecretsType)
279
+ ].filter(Boolean));
280
+ }
281
+ reflectSecrets.__type = [
282
+ () => require_plugin.__ΩEnvPluginContext,
283
+ "context",
284
+ "file",
285
+ "name",
286
+ "reflectSecrets",
287
+ "Pn!2\"&2#8&2$8\"/%"
288
+ ];
289
+
290
+ //#endregion
291
+ //#region src/helpers/persistence.ts
292
+ /**
293
+ * Resolves the runtime type definition file for the environment variables.
294
+ *
295
+ * @param context - The plugin context.
296
+ * @returns The runtime type definition file for the environment variables.
297
+ */
298
+ async function resolveRuntimeTypeFile(context) {
299
+ const resolved = await context.fs.resolve("@powerlines/plugin-env/types/runtime");
300
+ if (!resolved) throw new Error(`Failed to resolve the runtime type definition file for the environment variables. Please ensure that the "@powerlines/plugin-env" package is installed.`);
301
+ return resolved;
302
+ }
303
+ resolveRuntimeTypeFile.__type = [
304
+ () => powerlines_types_context.__ΩUnresolvedContext,
305
+ () => require_plugin.__ΩEnvPluginResolvedConfig,
306
+ "context",
307
+ "resolveRuntimeTypeFile",
308
+ "Resolves the runtime type definition file for the environment variables.",
309
+ "Pn\"o!\"2#&`/$?%"
310
+ ];
311
+ /**
312
+ * Gets the default type definition for the environment variables.
313
+ *
314
+ * @param context - The plugin context.
315
+ * @returns The default type definition for the environment variables.
316
+ */
317
+ async function getEnvDefaultTypeDefinition(context) {
318
+ return {
319
+ file: await resolveRuntimeTypeFile(context),
320
+ name: "EnvInterface"
321
+ };
322
+ }
323
+ getEnvDefaultTypeDefinition.__type = [
324
+ () => powerlines_types_context.__ΩUnresolvedContext,
325
+ () => require_plugin.__ΩEnvPluginResolvedConfig,
326
+ "context",
327
+ "getEnvDefaultTypeDefinition",
328
+ "Gets the default type definition for the environment variables.",
329
+ "Pn\"o!\"2#!`/$?%"
330
+ ];
331
+ /** Gets the default type definition for the environment secrets.
332
+ *
333
+ * @param context - The plugin context.
334
+ * @returns The default type definition for the environment secrets.
335
+ */
336
+ async function getSecretsDefaultTypeDefinition(context) {
337
+ return {
338
+ file: await resolveRuntimeTypeFile(context),
339
+ name: "SecretsInterface"
340
+ };
341
+ }
342
+ getSecretsDefaultTypeDefinition.__type = [
343
+ () => powerlines_types_context.__ΩUnresolvedContext,
344
+ () => require_plugin.__ΩEnvPluginResolvedConfig,
345
+ "context",
346
+ "getSecretsDefaultTypeDefinition",
347
+ "Pn\"o!\"2#!`/$"
348
+ ];
349
+ /**
350
+ * Gets the path to the environment type reflections.
351
+ *
352
+ * @param context - The plugin context.
353
+ * @param name - The name of the type reflections.
354
+ * @returns The path to the environment type reflections.
355
+ */
356
+ function getEnvTypeReflectionsPath(context, name = "env") {
357
+ return require_join_paths.joinPaths((0, __powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}-types.bin`);
358
+ }
359
+ getEnvTypeReflectionsPath.__type = [
360
+ () => powerlines_types_context.__ΩContext,
361
+ () => require_plugin.__ΩEnvPluginResolvedConfig,
362
+ "context",
363
+ () => require_plugin.__ΩEnvType,
364
+ "name",
365
+ () => "env",
366
+ "getEnvTypeReflectionsPath",
367
+ "Gets the path to the environment type reflections.",
368
+ "Pn\"o!\"2#n$2%>&&/'?("
369
+ ];
370
+ /**
371
+ * Reads the environment type reflection from the file system.
372
+ *
373
+ * @param context - The plugin context.
374
+ * @param name - The name of the type reflections.
375
+ * @returns The environment type reflection.
376
+ */
377
+ async function readEnvTypeReflection(context, name = "env") {
378
+ const filePath = getEnvTypeReflectionsPath(context, name);
379
+ if (!(0, node_fs.existsSync)(filePath)) {
380
+ if (!context.env.types.env || (0, __stryke_type_checks_is_empty_object.isEmptyObject)(context.env.types.env)) {
381
+ const reflection$1 = createEnvReflection(context);
382
+ const message = new __stryke_capnp.Message();
383
+ reflection$1.messageRoot = message.initRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes);
384
+ reflection$1.dataBuffer = message.toArrayBuffer();
385
+ context.env.types.env = reflection$1;
386
+ await writeEnvTypeReflection(context, context.env.types.env, name);
387
+ }
388
+ return context.env.types.env;
389
+ }
390
+ const buffer = await (0, __stryke_fs_buffer.readFileBuffer)(filePath);
391
+ const messageRoot = new __stryke_capnp.Message(buffer, false).getRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes);
392
+ const reflection = (0, __powerlines_deepkit_vendor_type.resolveClassType)((0, __powerlines_deepkit_vendor_type.deserializeType)((0, __powerlines_deepkit_capnp.convertFromCapnp)(messageRoot.types)));
393
+ context.env.types[name] = reflection;
394
+ context.env.types[name].messageRoot = messageRoot;
395
+ context.env.types[name].dataBuffer = buffer;
396
+ return reflection;
397
+ }
398
+ readEnvTypeReflection.__type = [
399
+ () => require_plugin.__ΩEnvPluginContext,
400
+ "context",
401
+ () => require_plugin.__ΩEnvType,
402
+ "name",
403
+ () => "env",
404
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
405
+ "readEnvTypeReflection",
406
+ "Reads the environment type reflection from the file system.",
407
+ "Pn!2\"n#2$>%P\"7&`/'?("
408
+ ];
409
+ /**
410
+ * Writes the environment type reflection to the file system.
411
+ *
412
+ * @param context - The plugin context.
413
+ * @param reflection - The environment type reflection to write.
414
+ * @param name - The name of the type reflections.
415
+ */
416
+ async function writeEnvTypeReflection(context, reflection, name = "env") {
417
+ const serialized = reflection.serializeType();
418
+ const message = new __stryke_capnp.Message();
419
+ (0, __powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
420
+ await (0, __stryke_fs_buffer.writeFileBuffer)(getEnvTypeReflectionsPath(context, name), message.toArrayBuffer());
421
+ }
422
+ writeEnvTypeReflection.__type = [
423
+ () => require_plugin.__ΩEnvPluginContext,
424
+ "context",
425
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
426
+ "reflection",
427
+ () => require_plugin.__ΩEnvType,
428
+ "name",
429
+ () => "env",
430
+ "writeEnvTypeReflection",
431
+ "Writes the environment type reflection to the file system.",
432
+ "Pn!2\"P\"7#2$n%2&>'\"/(?)"
433
+ ];
434
+ function getEnvReflectionsPath(context, name) {
435
+ return require_join_paths.joinPaths((0, __powerlines_deepkit_resolve_reflections.getReflectionsPath)(context), "env", `${name}.bin`);
436
+ }
437
+ getEnvReflectionsPath.__type = [
438
+ () => require_plugin.__ΩEnvPluginContext,
439
+ "context",
440
+ () => require_plugin.__ΩEnvType,
441
+ "name",
442
+ "getEnvReflectionsPath",
443
+ "Pn!2\"n#2$&/%"
444
+ ];
445
+ /**
446
+ * Reads the environment reflection data from the file system.
447
+ *
448
+ * @param context - The plugin context.
449
+ * @returns The environment reflection data.
450
+ */
451
+ async function readEnvReflection(context) {
452
+ const filePath = getEnvReflectionsPath(context, "env");
453
+ if (!(0, node_fs.existsSync)(filePath)) {
454
+ if (!context.env.types.env) context.env.types.env = await readEnvTypeReflection(context, "env");
455
+ if (!context.env.used.env || (0, __stryke_type_checks_is_empty_object.isEmptyObject)(context.env.used.env)) {
456
+ const reflection$1 = createEnvReflection(context, {
457
+ type: {
458
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
459
+ typeName: "Env",
460
+ description: `An object containing the environment configuration parameters that are used (at least once) by the ${context.config.name ? `${context.config.name} application` : "application"}.`,
461
+ types: []
462
+ },
463
+ superReflection: context.env.types.env
464
+ });
465
+ reflection$1.name = "Env";
466
+ const message = new __stryke_capnp.Message();
467
+ reflection$1.messageRoot = message.initRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes);
468
+ reflection$1.dataBuffer = message.toArrayBuffer();
469
+ context.env.used.env = reflection$1;
470
+ await writeEnvReflection(context, context.env.used.env, "env");
471
+ }
472
+ return context.env.used.env;
473
+ }
474
+ const buffer = await (0, __stryke_fs_buffer.readFileBuffer)(filePath);
475
+ const messageRoot = new __stryke_capnp.Message(buffer, false).getRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes);
476
+ const reflection = (0, __powerlines_deepkit_vendor_type.resolveClassType)((0, __powerlines_deepkit_vendor_type.deserializeType)((0, __powerlines_deepkit_capnp.convertFromCapnp)(messageRoot.types)));
477
+ context.env.used.env = reflection;
478
+ context.env.used.env.messageRoot = messageRoot;
479
+ context.env.used.env.dataBuffer = buffer;
480
+ return reflection;
481
+ }
482
+ readEnvReflection.__type = [
483
+ () => require_plugin.__ΩEnvPluginContext,
484
+ "context",
485
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
486
+ "readEnvReflection",
487
+ "Reads the environment reflection data from the file system.",
488
+ "Pn!2\"P\"7#`/$?%"
489
+ ];
490
+ /**
491
+ * Reads the secret environment reflection data from the file system.
492
+ *
493
+ * @param context - The plugin context.
494
+ * @returns The environment reflection data.
495
+ */
496
+ async function readSecretsReflection(context) {
497
+ const filePath = getEnvReflectionsPath(context, "secrets");
498
+ if (!(0, node_fs.existsSync)(filePath)) {
499
+ if (!context.env.types.secrets) context.env.types.secrets = await readEnvTypeReflection(context, "secrets");
500
+ if (!context.env.used.secrets || (0, __stryke_type_checks_is_empty_object.isEmptyObject)(context.env.used.secrets)) {
501
+ const reflection$1 = createEnvReflection(context, {
502
+ type: {
503
+ kind: __powerlines_deepkit_vendor_type.ReflectionKind.objectLiteral,
504
+ typeName: "Secrets",
505
+ description: `An object containing the secret configuration parameters that are used (at least once) by the ${context.config.name ? `${context.config.name} application` : "application"}.`,
506
+ types: []
507
+ },
508
+ superReflection: context.env.types.secrets
509
+ });
510
+ reflection$1.name = "Secrets";
511
+ const message = new __stryke_capnp.Message();
512
+ reflection$1.messageRoot = message.initRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes);
513
+ reflection$1.dataBuffer = message.toArrayBuffer();
514
+ context.env.used.secrets = reflection$1;
515
+ await writeEnvReflection(context, context.env.used.secrets, "secrets");
516
+ }
517
+ return context.env.used.secrets;
518
+ }
519
+ const buffer = await (0, __stryke_fs_buffer.readFileBuffer)(filePath);
520
+ const messageRoot = new __stryke_capnp.Message(buffer, false).getRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes);
521
+ const reflection = (0, __powerlines_deepkit_vendor_type.resolveClassType)((0, __powerlines_deepkit_vendor_type.deserializeType)((0, __powerlines_deepkit_capnp.convertFromCapnp)(messageRoot.types)));
522
+ context.env.used.secrets = reflection;
523
+ context.env.used.secrets.messageRoot = messageRoot;
524
+ context.env.used.secrets.dataBuffer = buffer;
525
+ return reflection;
526
+ }
527
+ readSecretsReflection.__type = [
528
+ () => require_plugin.__ΩEnvPluginContext,
529
+ "context",
530
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
531
+ "readSecretsReflection",
532
+ "Reads the secret environment reflection data from the file system.",
533
+ "Pn!2\"P\"7#`/$?%"
534
+ ];
535
+ /**
536
+ * Writes the environment reflection data to the file system.
537
+ *
538
+ * @param context - The plugin context.
539
+ * @param reflection - The reflection data to write.
540
+ * @param name - The name of the reflection (either "env" or "secrets").
541
+ */
542
+ async function writeEnvReflection(context, reflection, name = "env") {
543
+ const serialized = reflection.serializeType();
544
+ const message = new __stryke_capnp.Message();
545
+ (0, __powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
546
+ await (0, __stryke_fs_buffer.writeFileBuffer)(getEnvReflectionsPath(context, name), message.toArrayBuffer());
547
+ }
548
+ writeEnvReflection.__type = [
549
+ () => require_plugin.__ΩEnvPluginContext,
550
+ "context",
551
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
552
+ "reflection",
553
+ () => require_plugin.__ΩEnvType,
554
+ "name",
555
+ () => "env",
556
+ "writeEnvReflection",
557
+ "Writes the environment reflection data to the file system.",
558
+ "Pn!2\"P\"7#2$n%2&>'\"/(?)"
559
+ ];
560
+ /**
561
+ * Writes the environment reflection data to the file system.
562
+ *
563
+ * @param context - The plugin context.
564
+ * @param reflection - The reflection data to write.
565
+ * @param name - The name of the reflection (either "env" or "secrets").
566
+ */
567
+ function writeEnvReflectionSync(context, reflection, name = "env") {
568
+ const serialized = reflection.serializeType();
569
+ const message = new __stryke_capnp.Message();
570
+ (0, __powerlines_deepkit_capnp.convertToCapnp)(serialized, message.initRoot(__powerlines_deepkit_schemas_reflection.SerializedTypes)._initTypes(serialized.length));
571
+ (0, __stryke_fs_buffer.writeFileBufferSync)(getEnvReflectionsPath(context, name), message.toArrayBuffer());
572
+ }
573
+ writeEnvReflectionSync.__type = [
574
+ () => require_plugin.__ΩEnvPluginContext,
575
+ "context",
576
+ () => __powerlines_deepkit_vendor_type.ReflectionClass,
577
+ "reflection",
578
+ () => require_plugin.__ΩEnvType,
579
+ "name",
580
+ () => "env",
581
+ "writeEnvReflectionSync",
582
+ "Writes the environment reflection data to the file system.",
583
+ "Pn!2\"P\"7#2$n%2&>'\"/(?)"
584
+ ];
585
+
586
+ //#endregion
587
+ Object.defineProperty(exports, 'BaseEnv', {
588
+ enumerable: true,
589
+ get: function () {
590
+ return BaseEnv;
591
+ }
592
+ });
593
+ Object.defineProperty(exports, 'BaseSecrets', {
594
+ enumerable: true,
595
+ get: function () {
596
+ return BaseSecrets;
597
+ }
598
+ });
599
+ Object.defineProperty(exports, '__ΩCreateEnvReflectionOptions', {
600
+ enumerable: true,
601
+ get: function () {
602
+ return __ΩCreateEnvReflectionOptions;
603
+ }
604
+ });
605
+ Object.defineProperty(exports, 'createEnvReflection', {
606
+ enumerable: true,
607
+ get: function () {
608
+ return createEnvReflection;
609
+ }
610
+ });
611
+ Object.defineProperty(exports, 'createSecretsReflection', {
612
+ enumerable: true,
613
+ get: function () {
614
+ return createSecretsReflection;
615
+ }
616
+ });
617
+ Object.defineProperty(exports, 'getEnvDefaultTypeDefinition', {
618
+ enumerable: true,
619
+ get: function () {
620
+ return getEnvDefaultTypeDefinition;
621
+ }
622
+ });
623
+ Object.defineProperty(exports, 'getEnvReflectionsPath', {
624
+ enumerable: true,
625
+ get: function () {
626
+ return getEnvReflectionsPath;
627
+ }
628
+ });
629
+ Object.defineProperty(exports, 'getEnvTypeReflectionsPath', {
630
+ enumerable: true,
631
+ get: function () {
632
+ return getEnvTypeReflectionsPath;
633
+ }
634
+ });
635
+ Object.defineProperty(exports, 'getSecretsDefaultTypeDefinition', {
636
+ enumerable: true,
637
+ get: function () {
638
+ return getSecretsDefaultTypeDefinition;
639
+ }
640
+ });
641
+ Object.defineProperty(exports, 'isParentPath', {
642
+ enumerable: true,
643
+ get: function () {
644
+ return isParentPath;
645
+ }
646
+ });
647
+ Object.defineProperty(exports, 'mergeEnvReflections', {
648
+ enumerable: true,
649
+ get: function () {
650
+ return mergeEnvReflections;
651
+ }
652
+ });
653
+ Object.defineProperty(exports, 'mergeSecretsReflections', {
654
+ enumerable: true,
655
+ get: function () {
656
+ return mergeSecretsReflections;
657
+ }
658
+ });
659
+ Object.defineProperty(exports, 'readEnvReflection', {
660
+ enumerable: true,
661
+ get: function () {
662
+ return readEnvReflection;
663
+ }
664
+ });
665
+ Object.defineProperty(exports, 'readEnvTypeReflection', {
666
+ enumerable: true,
667
+ get: function () {
668
+ return readEnvTypeReflection;
669
+ }
670
+ });
671
+ Object.defineProperty(exports, 'readSecretsReflection', {
672
+ enumerable: true,
673
+ get: function () {
674
+ return readSecretsReflection;
675
+ }
676
+ });
677
+ Object.defineProperty(exports, 'reflectEnv', {
678
+ enumerable: true,
679
+ get: function () {
680
+ return reflectEnv;
681
+ }
682
+ });
683
+ Object.defineProperty(exports, 'reflectSecrets', {
684
+ enumerable: true,
685
+ get: function () {
686
+ return reflectSecrets;
687
+ }
688
+ });
689
+ Object.defineProperty(exports, 'resolveRuntimeTypeFile', {
690
+ enumerable: true,
691
+ get: function () {
692
+ return resolveRuntimeTypeFile;
693
+ }
694
+ });
695
+ Object.defineProperty(exports, 'writeEnvReflection', {
696
+ enumerable: true,
697
+ get: function () {
698
+ return writeEnvReflection;
699
+ }
700
+ });
701
+ Object.defineProperty(exports, 'writeEnvReflectionSync', {
702
+ enumerable: true,
703
+ get: function () {
704
+ return writeEnvReflectionSync;
705
+ }
706
+ });
707
+ Object.defineProperty(exports, 'writeEnvTypeReflection', {
708
+ enumerable: true,
709
+ get: function () {
710
+ return writeEnvTypeReflection;
711
+ }
712
+ });