@powerlines/plugin-crypto 0.10.106 → 0.10.108

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 (184) hide show
  1. package/dist/index-BgAdqTbb.d.mts +1 -0
  2. package/dist/index-CEgs-Dz2.d.cts +1 -0
  3. package/dist/index.cjs +12056 -8
  4. package/dist/index.d.cts +12 -4
  5. package/dist/index.d.mts +12 -5
  6. package/dist/index.mjs +12018 -3
  7. package/dist/plugin-C3MaN5jp.mjs +1 -0
  8. package/dist/plugin-DHXHjv16.cjs +0 -0
  9. package/dist/plugin-Dhgjf-aI.d.mts +4441 -0
  10. package/dist/plugin-Dw1wCT6b.d.cts +4438 -0
  11. package/dist/types/index.cjs +2 -0
  12. package/dist/types/index.d.cts +2 -1
  13. package/dist/types/index.d.mts +2 -1
  14. package/dist/types/index.mjs +3 -0
  15. package/dist/types/plugin.cjs +1 -0
  16. package/dist/types/plugin.d.cts +1 -41
  17. package/dist/types/plugin.d.mts +1 -41
  18. package/dist/types/plugin.mjs +2 -0
  19. package/dist/types-CTUnla4x.mjs +1 -0
  20. package/dist/types-DHkg7xmX.cjs +0 -0
  21. package/package.json +5 -5
  22. package/dist/_virtual/rolldown_runtime.cjs +0 -37
  23. package/dist/_virtual/rolldown_runtime.mjs +0 -29
  24. package/dist/components/crypto.cjs +0 -147
  25. package/dist/components/crypto.d.cts +0 -13
  26. package/dist/components/crypto.d.mts +0 -13
  27. package/dist/components/crypto.mjs +0 -147
  28. package/dist/components/index.cjs +0 -1
  29. package/dist/components/index.d.mts +0 -1
  30. package/dist/components/index.mjs +0 -3
  31. package/dist/deepkit/schemas/reflection.cjs +0 -3998
  32. package/dist/deepkit/schemas/reflection.d.cts +0 -1560
  33. package/dist/deepkit/schemas/reflection.d.mts +0 -1560
  34. package/dist/deepkit/schemas/reflection.mjs +0 -3996
  35. package/dist/deepkit/schemas/reflection2.cjs +0 -4112
  36. package/dist/deepkit/schemas/reflection2.mjs +0 -4110
  37. package/dist/deepkit/src/capnp.cjs +0 -913
  38. package/dist/deepkit/src/capnp.mjs +0 -911
  39. package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
  40. package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
  41. package/dist/deepkit/src/reflect-type.cjs +0 -22
  42. package/dist/deepkit/src/reflect-type.mjs +0 -20
  43. package/dist/deepkit/src/resolve-reflections.cjs +0 -16
  44. package/dist/deepkit/src/resolve-reflections.mjs +0 -15
  45. package/dist/deepkit/src/transformer.cjs +0 -52
  46. package/dist/deepkit/src/transformer.mjs +0 -49
  47. package/dist/deepkit/src/transpile.cjs +0 -29
  48. package/dist/deepkit/src/transpile.mjs +0 -27
  49. package/dist/deepkit/src/types.d.cts +0 -10
  50. package/dist/deepkit/src/types.d.mts +0 -10
  51. package/dist/deepkit/src/utilities.cjs +0 -66
  52. package/dist/deepkit/src/utilities.mjs +0 -65
  53. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
  54. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
  55. package/dist/deepkit/src/vendor/type.cjs +0 -20
  56. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  57. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  58. package/dist/deepkit/src/vendor/type.mjs +0 -11
  59. package/dist/plugin-alloy/src/core/components/output.cjs +0 -38
  60. package/dist/plugin-alloy/src/core/components/output.mjs +0 -37
  61. package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -20
  62. package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -19
  63. package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -60
  64. package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -58
  65. package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
  66. package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
  67. package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
  68. package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
  69. package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
  70. package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
  71. package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
  72. package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
  73. package/dist/plugin-alloy/src/index.cjs +0 -90
  74. package/dist/plugin-alloy/src/index.mjs +0 -88
  75. package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -7
  76. package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -9
  77. package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -5
  78. package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -7
  79. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -17
  80. package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
  81. package/dist/plugin-alloy/src/types/components.d.mts +0 -4
  82. package/dist/plugin-alloy/src/types/index.d.mts +0 -2
  83. package/dist/plugin-alloy/src/types/plugin.d.cts +0 -37
  84. package/dist/plugin-alloy/src/types/plugin.d.mts +0 -37
  85. package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -47
  86. package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -46
  87. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -75
  88. package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -73
  89. package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -359
  90. package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -350
  91. package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -143
  92. package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -140
  93. package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -53
  94. package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -52
  95. package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -94
  96. package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -93
  97. package/dist/plugin-automd/src/index.cjs +0 -101
  98. package/dist/plugin-automd/src/index.mjs +0 -98
  99. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  100. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  101. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  102. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  103. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
  104. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
  105. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
  106. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
  107. package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
  108. package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
  109. package/dist/plugin-babel/src/helpers/index.cjs +0 -5
  110. package/dist/plugin-babel/src/helpers/index.mjs +0 -7
  111. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
  112. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
  113. package/dist/plugin-babel/src/helpers/options.cjs +0 -50
  114. package/dist/plugin-babel/src/helpers/options.mjs +0 -47
  115. package/dist/plugin-babel/src/index.cjs +0 -91
  116. package/dist/plugin-babel/src/index.mjs +0 -89
  117. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  118. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  119. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  120. package/dist/plugin-env/src/babel/index.cjs +0 -1
  121. package/dist/plugin-env/src/babel/index.mjs +0 -3
  122. package/dist/plugin-env/src/babel/plugin.cjs +0 -121
  123. package/dist/plugin-env/src/babel/plugin.mjs +0 -119
  124. package/dist/plugin-env/src/components/docs.cjs +0 -9
  125. package/dist/plugin-env/src/components/docs.mjs +0 -11
  126. package/dist/plugin-env/src/components/env.cjs +0 -487
  127. package/dist/plugin-env/src/components/env.mjs +0 -484
  128. package/dist/plugin-env/src/components/index.cjs +0 -2
  129. package/dist/plugin-env/src/components/index.mjs +0 -4
  130. package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
  131. package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
  132. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
  133. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
  134. package/dist/plugin-env/src/helpers/index.cjs +0 -6
  135. package/dist/plugin-env/src/helpers/index.mjs +0 -8
  136. package/dist/plugin-env/src/helpers/load.cjs +0 -83
  137. package/dist/plugin-env/src/helpers/load.mjs +0 -80
  138. package/dist/plugin-env/src/helpers/persistence.cjs +0 -200
  139. package/dist/plugin-env/src/helpers/persistence.mjs +0 -189
  140. package/dist/plugin-env/src/helpers/reflect.cjs +0 -125
  141. package/dist/plugin-env/src/helpers/reflect.mjs +0 -117
  142. package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
  143. package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
  144. package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
  145. package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
  146. package/dist/plugin-env/src/index.cjs +0 -172
  147. package/dist/plugin-env/src/index.mjs +0 -170
  148. package/dist/plugin-env/src/types/plugin.d.cts +0 -151
  149. package/dist/plugin-env/src/types/plugin.d.mts +0 -153
  150. package/dist/plugin-env/src/types/runtime.d.cts +0 -792
  151. package/dist/plugin-env/src/types/runtime.d.mts +0 -792
  152. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
  153. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
  154. package/dist/powerlines/src/lib/entry.cjs +0 -12
  155. package/dist/powerlines/src/lib/entry.mjs +0 -14
  156. package/dist/powerlines/src/lib/logger.cjs +0 -41
  157. package/dist/powerlines/src/lib/logger.mjs +0 -39
  158. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
  159. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
  160. package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -22
  161. package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -21
  162. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
  163. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
  164. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  165. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
  166. package/dist/powerlines/src/types/babel.d.cts +0 -22
  167. package/dist/powerlines/src/types/babel.d.mts +0 -22
  168. package/dist/powerlines/src/types/build.d.cts +0 -145
  169. package/dist/powerlines/src/types/build.d.mts +0 -147
  170. package/dist/powerlines/src/types/commands.d.cts +0 -8
  171. package/dist/powerlines/src/types/commands.d.mts +0 -9
  172. package/dist/powerlines/src/types/config.d.cts +0 -380
  173. package/dist/powerlines/src/types/config.d.mts +0 -381
  174. package/dist/powerlines/src/types/context.d.cts +0 -414
  175. package/dist/powerlines/src/types/context.d.mts +0 -416
  176. package/dist/powerlines/src/types/fs.d.cts +0 -486
  177. package/dist/powerlines/src/types/fs.d.mts +0 -486
  178. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  179. package/dist/powerlines/src/types/plugin.d.cts +0 -231
  180. package/dist/powerlines/src/types/plugin.d.mts +0 -231
  181. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  182. package/dist/powerlines/src/types/resolved.d.mts +0 -83
  183. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  184. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
@@ -0,0 +1,2 @@
1
+ require('../plugin-DHXHjv16.cjs');
2
+ require('../types-DHkg7xmX.cjs');
@@ -1,2 +1,3 @@
1
- import { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig } from "./plugin.cjs";
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-Dw1wCT6b.cjs";
2
+ import "../index-CEgs-Dz2.cjs";
2
3
  export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -1,2 +1,3 @@
1
- import { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig } from "./plugin.mjs";
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-Dhgjf-aI.mjs";
2
+ import "../index-BgAdqTbb.mjs";
2
3
  export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -1 +1,4 @@
1
+ import "../plugin-C3MaN5jp.mjs";
2
+ import "../types-CTUnla4x.mjs";
3
+
1
4
  export { };
@@ -0,0 +1 @@
1
+ require('../plugin-DHXHjv16.cjs');
@@ -1,42 +1,2 @@
1
- import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "../plugin-env/src/types/plugin.cjs";
2
-
3
- //#region src/types/plugin.d.ts
4
- interface CryptoPluginOptions {
5
- /**
6
- * The application specific secret used for encrypting and decrypting data.
7
- *
8
- * @remarks
9
- * If not provided, the plugin will attempt to read the key from the `SALT` environment variable.
10
- */
11
- salt?: string;
12
- /**
13
- * The encryption key used for encrypting and decrypting data.
14
- *
15
- * @remarks
16
- * If not provided, the plugin will attempt to read the key from the `ENCRYPTION_KEY` environment variable.
17
- */
18
- encryptionKey?: string;
19
- /**
20
- * Options for the Env plugin.
21
- */
22
- env?: EnvPluginOptions;
23
- }
24
- interface CryptoPluginUserConfig extends EnvPluginUserConfig {
25
- /**
26
- * Options for the Crypto plugin.
27
- */
28
- crypto?: Omit<CryptoPluginOptions, "env">;
29
- }
30
- interface CryptoPluginResolvedConfig extends EnvPluginResolvedConfig {
31
- /**
32
- * Options for the Crypto plugin.
33
- */
34
- crypto: Required<Omit<CryptoPluginOptions, "env">>;
35
- }
36
- type CryptoPluginContext<TResolvedConfig extends CryptoPluginResolvedConfig = CryptoPluginResolvedConfig> = EnvPluginContext<TResolvedConfig>;
37
- declare type __ΩCryptoPluginOptions = any[];
38
- declare type __ΩCryptoPluginUserConfig = any[];
39
- declare type __ΩCryptoPluginResolvedConfig = any[];
40
- declare type __ΩCryptoPluginContext = any[];
41
- //#endregion
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-Dw1wCT6b.cjs";
42
2
  export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -1,42 +1,2 @@
1
- import { EnvPluginContext, EnvPluginOptions, EnvPluginResolvedConfig, EnvPluginUserConfig } from "../plugin-env/src/types/plugin.mjs";
2
-
3
- //#region src/types/plugin.d.ts
4
- interface CryptoPluginOptions {
5
- /**
6
- * The application specific secret used for encrypting and decrypting data.
7
- *
8
- * @remarks
9
- * If not provided, the plugin will attempt to read the key from the `SALT` environment variable.
10
- */
11
- salt?: string;
12
- /**
13
- * The encryption key used for encrypting and decrypting data.
14
- *
15
- * @remarks
16
- * If not provided, the plugin will attempt to read the key from the `ENCRYPTION_KEY` environment variable.
17
- */
18
- encryptionKey?: string;
19
- /**
20
- * Options for the Env plugin.
21
- */
22
- env?: EnvPluginOptions;
23
- }
24
- interface CryptoPluginUserConfig extends EnvPluginUserConfig {
25
- /**
26
- * Options for the Crypto plugin.
27
- */
28
- crypto?: Omit<CryptoPluginOptions, "env">;
29
- }
30
- interface CryptoPluginResolvedConfig extends EnvPluginResolvedConfig {
31
- /**
32
- * Options for the Crypto plugin.
33
- */
34
- crypto: Required<Omit<CryptoPluginOptions, "env">>;
35
- }
36
- type CryptoPluginContext<TResolvedConfig extends CryptoPluginResolvedConfig = CryptoPluginResolvedConfig> = EnvPluginContext<TResolvedConfig>;
37
- declare type __ΩCryptoPluginOptions = any[];
38
- declare type __ΩCryptoPluginUserConfig = any[];
39
- declare type __ΩCryptoPluginResolvedConfig = any[];
40
- declare type __ΩCryptoPluginContext = any[];
41
- //#endregion
1
+ import { a as __ΩCryptoPluginContext, c as __ΩCryptoPluginUserConfig, i as CryptoPluginUserConfig, n as CryptoPluginOptions, o as __ΩCryptoPluginOptions, r as CryptoPluginResolvedConfig, s as __ΩCryptoPluginResolvedConfig, t as CryptoPluginContext } from "../plugin-Dhgjf-aI.mjs";
42
2
  export { CryptoPluginContext, CryptoPluginOptions, CryptoPluginResolvedConfig, CryptoPluginUserConfig, __ΩCryptoPluginContext, __ΩCryptoPluginOptions, __ΩCryptoPluginResolvedConfig, __ΩCryptoPluginUserConfig };
@@ -1 +1,3 @@
1
+ import "../plugin-C3MaN5jp.mjs";
2
+
1
3
  export { };
@@ -0,0 +1 @@
1
+ export { };
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-crypto",
3
- "version": "0.10.106",
3
+ "version": "0.10.108",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin that provides unique identifier generation capabilities at runtime by adding the `id` builtin module.",
6
6
  "repository": {
@@ -128,17 +128,17 @@
128
128
  "files": ["dist/**/*"],
129
129
  "keywords": ["powerlines", "storm-software", "powerlines-plugin"],
130
130
  "dependencies": {
131
- "@powerlines/plugin-env": "^0.15.3",
131
+ "@powerlines/plugin-env": "^0.15.5",
132
132
  "@storm-software/config-tools": "^1.188.75",
133
133
  "@stryke/path": "^0.24.1",
134
134
  "defu": "^6.1.4",
135
- "powerlines": "^0.36.26",
135
+ "powerlines": "^0.36.27",
136
136
  "@noble/ciphers": "^2.1.1"
137
137
  },
138
138
  "devDependencies": {
139
- "@powerlines/nx": "^0.11.52",
139
+ "@powerlines/nx": "^0.11.53",
140
140
  "@types/node": "^24.10.4"
141
141
  },
142
142
  "publishConfig": { "access": "public" },
143
- "gitHead": "9e66d0e1d9210071bcabcd4e4dc04ad4d2bbfe15"
143
+ "gitHead": "fbc59ce584fd0f78d90d2dbaa18f9c9267bd3b61"
144
144
  }
@@ -1,37 +0,0 @@
1
- //#region rolldown:runtime
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __reExport = (target, mod, secondTarget, symbols) => {
23
- if (symbols) {
24
- __defProp(target, Symbol.toStringTag, { value: "Module" });
25
- secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
26
- }
27
- __copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
28
- };
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
- value: mod,
31
- enumerable: true
32
- }) : target, mod));
33
-
34
- //#endregion
35
-
36
- exports.__reExport = __reExport;
37
- exports.__toESM = __toESM;
@@ -1,29 +0,0 @@
1
- //#region rolldown:runtime
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __copyProps = (to, from, except, desc) => {
7
- if (from && typeof from === "object" || typeof from === "function") {
8
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
9
- key = keys[i];
10
- if (!__hasOwnProp.call(to, key) && key !== except) {
11
- __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- }
17
- }
18
- return to;
19
- };
20
- var __reExport = (target, mod, secondTarget, symbols) => {
21
- if (symbols) {
22
- __defProp(target, Symbol.toStringTag, { value: "Module" });
23
- secondTarget && __defProp(secondTarget, Symbol.toStringTag, { value: "Module" });
24
- }
25
- __copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default");
26
- };
27
-
28
- //#endregion
29
- export { __reExport };
@@ -1,147 +0,0 @@
1
- const require_file_header = require('../powerlines/src/lib/utilities/file-header.cjs');
2
-
3
- //#region src/components/crypto.ts
4
- /**
5
- * Generates the crypto module content.
6
- *
7
- * @param context - The build context containing runtime information.
8
- * @returns A string representing the crypto module code.
9
- */
10
- function cryptoModule(context) {
11
- return `
12
- /**
13
- * The cryptography module provides custom helper functions to support encrypting and decrypting data.
14
- *
15
- * @module ${context.config.output.builtinPrefix}:crypto
16
- */
17
-
18
- ${require_file_header.getFileHeader(context)}
19
-
20
- import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
21
- import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
22
- import { scrypt } from "@noble/hashes/scrypt.js";
23
- import { blake3 } from "@noble/hashes/blake3.js";
24
- ${context.config.crypto.encryptionKey ? `
25
- const nonce = randomBytes(24);
26
- const chacha = xchacha20poly1305(hexToBytes("${context.config.crypto.encryptionKey}"), nonce);
27
-
28
- /**
29
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
30
- *
31
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
32
- *
33
- * @param plaintext - The data to encrypt.
34
- * @returns The encrypted data.
35
- */
36
- export function encrypt(plaintext: string): string {
37
- return chacha.encrypt(
38
- nonce,
39
- new TextEncoder().encode(plaintext),
40
- null
41
- );
42
- }
43
-
44
- /**
45
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
46
- *
47
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
48
- *
49
- * @param encrypted - The encrypted data to decrypt.
50
- * @returns The decrypted data.
51
- */
52
- export function decrypt(encrypted: string): string {
53
- const decrypted = chacha.decrypt(
54
- nonce,
55
- encrypted,
56
- null
57
- );
58
-
59
- return new TextDecoder().decode(decrypted);
60
- }
61
- ` : ""}
62
-
63
- /**
64
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
65
- *
66
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
67
- *
68
- * @param password - The password used to derive the encryption key.
69
- * @param plaintext - The data to encrypt.
70
- * @returns The encrypted data.
71
- */
72
- export function encryptWithPassword(password: string, plaintext: string): string {
73
- const key = scrypt(
74
- new TextEncoder().encode(password),
75
- hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
76
- 1048576, // requires 1GB of RAM to calculate
77
- 8,
78
- 1,
79
- 32
80
- );
81
-
82
- return chacha20poly1305(key).encrypt(
83
- nonce,
84
- new TextEncoder().encode(plaintext),
85
- null
86
- );
87
- }
88
-
89
- /**
90
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
91
- *
92
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
93
- *
94
- * @param password - The password used to derive the decryption key.
95
- * @param encrypted - The encrypted data to decrypt.
96
- * @returns The decrypted data.
97
- */
98
- export function decryptWithPassword(password: string, encrypted: string): string {
99
- const key = scrypt(
100
- new TextEncoder().encode(password),
101
- hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
102
- 1048576, // requires 1GB of RAM to calculate
103
- 8,
104
- 1,
105
- 32
106
- );
107
-
108
- const decrypted = chacha20poly1305(key).decrypt(
109
- nonce,
110
- encrypted,
111
- null
112
- );
113
-
114
- return new TextDecoder().decode(decrypted);
115
- }
116
-
117
- /**
118
- * Hashes data using the [BLAKE3](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3) hash function.
119
- *
120
- * @see https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3
121
- *
122
- * @param data - The data to hash.
123
- * @returns The hashed data.
124
- */
125
- export function hash(data: string): string {
126
- return Buffer.from(
127
- blake3(new TextEncoder().encode(data), {
128
- key: ${context.config.crypto.salt ? `hexToBytes("${context.config.crypto.salt}")` : "new TextEncoder().encode(\"powerlines\")"})
129
- })
130
- ).toString("hex");
131
- }
132
-
133
- // Export noble cipher and hash functions for advanced usage
134
-
135
- export * from "@noble/ciphers/chacha.js";
136
- export * from "@noble/ciphers/aes.js";
137
- export * from "@noble/ciphers/utils.js";
138
- export * from '@noble/hashes/blake3.js';
139
- export * from '@noble/hashes/pbkdf2.js';
140
- export * from '@noble/hashes/scrypt.js';
141
- export * from '@noble/hashes/utils.js';
142
-
143
- `;
144
- }
145
-
146
- //#endregion
147
- exports.cryptoModule = cryptoModule;
@@ -1,13 +0,0 @@
1
- import { CryptoPluginContext } from "../types/plugin.cjs";
2
-
3
- //#region src/components/crypto.d.ts
4
-
5
- /**
6
- * Generates the crypto module content.
7
- *
8
- * @param context - The build context containing runtime information.
9
- * @returns A string representing the crypto module code.
10
- */
11
- declare function cryptoModule(context: CryptoPluginContext): string;
12
- //#endregion
13
- export { cryptoModule };
@@ -1,13 +0,0 @@
1
- import { CryptoPluginContext } from "../types/plugin.mjs";
2
-
3
- //#region src/components/crypto.d.ts
4
-
5
- /**
6
- * Generates the crypto module content.
7
- *
8
- * @param context - The build context containing runtime information.
9
- * @returns A string representing the crypto module code.
10
- */
11
- declare function cryptoModule(context: CryptoPluginContext): string;
12
- //#endregion
13
- export { cryptoModule };
@@ -1,147 +0,0 @@
1
- import { getFileHeader } from "../powerlines/src/lib/utilities/file-header.mjs";
2
-
3
- //#region src/components/crypto.ts
4
- /**
5
- * Generates the crypto module content.
6
- *
7
- * @param context - The build context containing runtime information.
8
- * @returns A string representing the crypto module code.
9
- */
10
- function cryptoModule(context) {
11
- return `
12
- /**
13
- * The cryptography module provides custom helper functions to support encrypting and decrypting data.
14
- *
15
- * @module ${context.config.output.builtinPrefix}:crypto
16
- */
17
-
18
- ${getFileHeader(context)}
19
-
20
- import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
21
- import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
22
- import { scrypt } from "@noble/hashes/scrypt.js";
23
- import { blake3 } from "@noble/hashes/blake3.js";
24
- ${context.config.crypto.encryptionKey ? `
25
- const nonce = randomBytes(24);
26
- const chacha = xchacha20poly1305(hexToBytes("${context.config.crypto.encryptionKey}"), nonce);
27
-
28
- /**
29
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
30
- *
31
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
32
- *
33
- * @param plaintext - The data to encrypt.
34
- * @returns The encrypted data.
35
- */
36
- export function encrypt(plaintext: string): string {
37
- return chacha.encrypt(
38
- nonce,
39
- new TextEncoder().encode(plaintext),
40
- null
41
- );
42
- }
43
-
44
- /**
45
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
46
- *
47
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
48
- *
49
- * @param encrypted - The encrypted data to decrypt.
50
- * @returns The decrypted data.
51
- */
52
- export function decrypt(encrypted: string): string {
53
- const decrypted = chacha.decrypt(
54
- nonce,
55
- encrypted,
56
- null
57
- );
58
-
59
- return new TextDecoder().decode(decrypted);
60
- }
61
- ` : ""}
62
-
63
- /**
64
- * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
65
- *
66
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
67
- *
68
- * @param password - The password used to derive the encryption key.
69
- * @param plaintext - The data to encrypt.
70
- * @returns The encrypted data.
71
- */
72
- export function encryptWithPassword(password: string, plaintext: string): string {
73
- const key = scrypt(
74
- new TextEncoder().encode(password),
75
- hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
76
- 1048576, // requires 1GB of RAM to calculate
77
- 8,
78
- 1,
79
- 32
80
- );
81
-
82
- return chacha20poly1305(key).encrypt(
83
- nonce,
84
- new TextEncoder().encode(plaintext),
85
- null
86
- );
87
- }
88
-
89
- /**
90
- * Symmetrically decrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
91
- *
92
- * @see https://en.wikipedia.org/wiki/ChaCha20-Poly1305
93
- *
94
- * @param password - The password used to derive the decryption key.
95
- * @param encrypted - The encrypted data to decrypt.
96
- * @returns The decrypted data.
97
- */
98
- export function decryptWithPassword(password: string, encrypted: string): string {
99
- const key = scrypt(
100
- new TextEncoder().encode(password),
101
- hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
102
- 1048576, // requires 1GB of RAM to calculate
103
- 8,
104
- 1,
105
- 32
106
- );
107
-
108
- const decrypted = chacha20poly1305(key).decrypt(
109
- nonce,
110
- encrypted,
111
- null
112
- );
113
-
114
- return new TextDecoder().decode(decrypted);
115
- }
116
-
117
- /**
118
- * Hashes data using the [BLAKE3](https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3) hash function.
119
- *
120
- * @see https://en.wikipedia.org/wiki/BLAKE_(hash_function)#BLAKE3
121
- *
122
- * @param data - The data to hash.
123
- * @returns The hashed data.
124
- */
125
- export function hash(data: string): string {
126
- return Buffer.from(
127
- blake3(new TextEncoder().encode(data), {
128
- key: ${context.config.crypto.salt ? `hexToBytes("${context.config.crypto.salt}")` : "new TextEncoder().encode(\"powerlines\")"})
129
- })
130
- ).toString("hex");
131
- }
132
-
133
- // Export noble cipher and hash functions for advanced usage
134
-
135
- export * from "@noble/ciphers/chacha.js";
136
- export * from "@noble/ciphers/aes.js";
137
- export * from "@noble/ciphers/utils.js";
138
- export * from '@noble/hashes/blake3.js';
139
- export * from '@noble/hashes/pbkdf2.js';
140
- export * from '@noble/hashes/scrypt.js';
141
- export * from '@noble/hashes/utils.js';
142
-
143
- `;
144
- }
145
-
146
- //#endregion
147
- export { cryptoModule };
@@ -1 +0,0 @@
1
- const require_crypto = require('./crypto.cjs');
@@ -1 +0,0 @@
1
- import { cryptoModule } from "./crypto.mjs";
@@ -1,3 +0,0 @@
1
- import { cryptoModule } from "./crypto.mjs";
2
-
3
- export { };