@powerlines/plugin-crypto 0.10.96 → 0.10.97

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 (99) hide show
  1. package/dist/_virtual/rolldown_runtime.cjs +37 -1
  2. package/dist/_virtual/rolldown_runtime.mjs +29 -1
  3. package/dist/components/crypto.cjs +24 -10
  4. package/dist/components/crypto.mjs +24 -10
  5. package/dist/components/index.cjs +1 -1
  6. package/dist/components/index.mjs +3 -1
  7. package/dist/deepkit/schemas/reflection.cjs +3998 -1
  8. package/dist/deepkit/schemas/reflection.mjs +3996 -1
  9. package/dist/deepkit/schemas/reflection2.cjs +4112 -1
  10. package/dist/deepkit/schemas/reflection2.mjs +4110 -1
  11. package/dist/deepkit/src/capnp.cjs +913 -1
  12. package/dist/deepkit/src/capnp.mjs +911 -1
  13. package/dist/deepkit/src/esbuild-plugin.cjs +47 -4
  14. package/dist/deepkit/src/esbuild-plugin.mjs +46 -4
  15. package/dist/deepkit/src/reflect-type.cjs +22 -1
  16. package/dist/deepkit/src/reflect-type.mjs +20 -1
  17. package/dist/deepkit/src/resolve-reflections.cjs +16 -1
  18. package/dist/deepkit/src/resolve-reflections.mjs +15 -1
  19. package/dist/deepkit/src/transformer.cjs +52 -1
  20. package/dist/deepkit/src/transformer.mjs +49 -1
  21. package/dist/deepkit/src/transpile.cjs +29 -1
  22. package/dist/deepkit/src/transpile.mjs +27 -1
  23. package/dist/deepkit/src/utilities.cjs +66 -1
  24. package/dist/deepkit/src/utilities.mjs +65 -1
  25. package/dist/deepkit/src/vendor/type-compiler/index.cjs +38 -1
  26. package/dist/deepkit/src/vendor/type-compiler/index.mjs +19 -1
  27. package/dist/deepkit/src/vendor/type.cjs +20 -1
  28. package/dist/deepkit/src/vendor/type.mjs +11 -1
  29. package/dist/index.cjs +46 -1
  30. package/dist/index.mjs +41 -1
  31. package/dist/plugin-alloy/src/core/components/output.cjs +38 -1
  32. package/dist/plugin-alloy/src/core/components/output.mjs +37 -1
  33. package/dist/plugin-alloy/src/core/contexts/context.cjs +11 -1
  34. package/dist/plugin-alloy/src/core/contexts/context.mjs +10 -1
  35. package/dist/plugin-alloy/src/index.cjs +90 -1
  36. package/dist/plugin-alloy/src/index.mjs +88 -1
  37. package/dist/plugin-automd/src/index.cjs +101 -1
  38. package/dist/plugin-automd/src/index.mjs +98 -1
  39. package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -1
  40. package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -1
  41. package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -1
  42. package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -1
  43. package/dist/plugin-babel/src/helpers/filters.cjs +23 -1
  44. package/dist/plugin-babel/src/helpers/filters.mjs +21 -1
  45. package/dist/plugin-babel/src/helpers/index.cjs +5 -1
  46. package/dist/plugin-babel/src/helpers/index.mjs +7 -1
  47. package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -1
  48. package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -1
  49. package/dist/plugin-babel/src/helpers/options.cjs +50 -1
  50. package/dist/plugin-babel/src/helpers/options.mjs +47 -1
  51. package/dist/plugin-babel/src/index.cjs +91 -1
  52. package/dist/plugin-babel/src/index.mjs +89 -1
  53. package/dist/plugin-env/src/babel/index.cjs +1 -1
  54. package/dist/plugin-env/src/babel/index.mjs +3 -1
  55. package/dist/plugin-env/src/babel/plugin.cjs +120 -4
  56. package/dist/plugin-env/src/babel/plugin.mjs +118 -4
  57. package/dist/plugin-env/src/components/docs.cjs +9 -1
  58. package/dist/plugin-env/src/components/docs.mjs +11 -1
  59. package/dist/plugin-env/src/components/env.cjs +349 -11
  60. package/dist/plugin-env/src/components/env.mjs +347 -9
  61. package/dist/plugin-env/src/components/index.cjs +2 -1
  62. package/dist/plugin-env/src/components/index.mjs +4 -1
  63. package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -1
  64. package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -1
  65. package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -1
  66. package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -1
  67. package/dist/plugin-env/src/helpers/index.cjs +6 -1
  68. package/dist/plugin-env/src/helpers/index.mjs +8 -1
  69. package/dist/plugin-env/src/helpers/load.cjs +83 -1
  70. package/dist/plugin-env/src/helpers/load.mjs +80 -1
  71. package/dist/plugin-env/src/helpers/persistence.cjs +200 -1
  72. package/dist/plugin-env/src/helpers/persistence.mjs +189 -1
  73. package/dist/plugin-env/src/helpers/reflect.cjs +125 -1
  74. package/dist/plugin-env/src/helpers/reflect.mjs +117 -1
  75. package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -1
  76. package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -1
  77. package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -1
  78. package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -1
  79. package/dist/plugin-env/src/index.cjs +167 -5
  80. package/dist/plugin-env/src/index.mjs +165 -5
  81. package/dist/powerlines/src/lib/build/esbuild.cjs +102 -14
  82. package/dist/powerlines/src/lib/build/esbuild.mjs +100 -14
  83. package/dist/powerlines/src/lib/entry.cjs +12 -1
  84. package/dist/powerlines/src/lib/entry.mjs +14 -1
  85. package/dist/powerlines/src/lib/logger.cjs +41 -1
  86. package/dist/powerlines/src/lib/logger.mjs +39 -1
  87. package/dist/powerlines/src/lib/utilities/bundle.cjs +35 -1
  88. package/dist/powerlines/src/lib/utilities/bundle.mjs +34 -1
  89. package/dist/powerlines/src/lib/utilities/file-header.cjs +19 -7
  90. package/dist/powerlines/src/lib/utilities/file-header.mjs +18 -7
  91. package/dist/powerlines/src/lib/utilities/resolve.cjs +30 -1
  92. package/dist/powerlines/src/lib/utilities/resolve.mjs +29 -1
  93. package/dist/powerlines/src/plugin-utils/paths.cjs +1 -1
  94. package/dist/powerlines/src/plugin-utils/paths.mjs +3 -1
  95. package/dist/powerlines/src/types/context.d.cts +27 -3
  96. package/dist/powerlines/src/types/context.d.mts +27 -3
  97. package/dist/types/index.mjs +1 -1
  98. package/dist/types/plugin.mjs +1 -1
  99. package/package.json +6 -6
@@ -1 +1,37 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(e,n,r,i)=>{i&&(t(e,Symbol.toStringTag,{value:`Module`}),r&&t(r,Symbol.toStringTag,{value:`Module`})),o(e,n,`default`),r&&o(r,n,`default`)},c=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));exports.__reExport=s,exports.__toESM=c;
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 +1,29 @@
1
- var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,i=(i,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!r.call(i,d)&&d!==o&&e(i,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return i},a=(t,n,r,a)=>{a&&(e(t,Symbol.toStringTag,{value:`Module`}),r&&e(r,Symbol.toStringTag,{value:`Module`})),i(t,n,`default`),r&&i(r,n,`default`)};export{a as __reExport};
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,19 +1,29 @@
1
- const e=require(`../powerlines/src/lib/utilities/file-header.cjs`);function t(t){return`
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 `
2
12
  /**
3
13
  * The cryptography module provides custom helper functions to support encrypting and decrypting data.
4
14
  *
5
- * @module ${t.config.output.builtinPrefix}:crypto
15
+ * @module ${context.config.output.builtinPrefix}:crypto
6
16
  */
7
17
 
8
- ${e.getFileHeader(t)}
18
+ ${require_file_header.getFileHeader(context)}
9
19
 
10
20
  import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
11
21
  import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
12
22
  import { scrypt } from "@noble/hashes/scrypt.js";
13
23
  import { blake3 } from "@noble/hashes/blake3.js";
14
- ${t.config.crypto.encryptionKey?`
24
+ ${context.config.crypto.encryptionKey ? `
15
25
  const nonce = randomBytes(24);
16
- const chacha = xchacha20poly1305(hexToBytes("${t.config.crypto.encryptionKey}"), nonce);
26
+ const chacha = xchacha20poly1305(hexToBytes("${context.config.crypto.encryptionKey}"), nonce);
17
27
 
18
28
  /**
19
29
  * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
@@ -48,7 +58,7 @@ export function decrypt(encrypted: string): string {
48
58
 
49
59
  return new TextDecoder().decode(decrypted);
50
60
  }
51
- `:``}
61
+ ` : ""}
52
62
 
53
63
  /**
54
64
  * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
@@ -62,7 +72,7 @@ export function decrypt(encrypted: string): string {
62
72
  export function encryptWithPassword(password: string, plaintext: string): string {
63
73
  const key = scrypt(
64
74
  new TextEncoder().encode(password),
65
- hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
75
+ hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
66
76
  1048576, // requires 1GB of RAM to calculate
67
77
  8,
68
78
  1,
@@ -88,7 +98,7 @@ export function encryptWithPassword(password: string, plaintext: string): string
88
98
  export function decryptWithPassword(password: string, encrypted: string): string {
89
99
  const key = scrypt(
90
100
  new TextEncoder().encode(password),
91
- hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
101
+ hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
92
102
  1048576, // requires 1GB of RAM to calculate
93
103
  8,
94
104
  1,
@@ -115,7 +125,7 @@ export function decryptWithPassword(password: string, encrypted: string): string
115
125
  export function hash(data: string): string {
116
126
  return Buffer.from(
117
127
  blake3(new TextEncoder().encode(data), {
118
- key: ${t.config.crypto.salt?`hexToBytes("${t.config.crypto.salt}")`:`new TextEncoder().encode("powerlines")`})
128
+ key: ${context.config.crypto.salt ? `hexToBytes("${context.config.crypto.salt}")` : "new TextEncoder().encode(\"powerlines\")"})
119
129
  })
120
130
  ).toString("hex");
121
131
  }
@@ -130,4 +140,8 @@ export * from '@noble/hashes/pbkdf2.js';
130
140
  export * from '@noble/hashes/scrypt.js';
131
141
  export * from '@noble/hashes/utils.js';
132
142
 
133
- `}exports.cryptoModule=t;
143
+ `;
144
+ }
145
+
146
+ //#endregion
147
+ exports.cryptoModule = cryptoModule;
@@ -1,19 +1,29 @@
1
- import{getFileHeader as e}from"../powerlines/src/lib/utilities/file-header.mjs";function t(t){return`
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 `
2
12
  /**
3
13
  * The cryptography module provides custom helper functions to support encrypting and decrypting data.
4
14
  *
5
- * @module ${t.config.output.builtinPrefix}:crypto
15
+ * @module ${context.config.output.builtinPrefix}:crypto
6
16
  */
7
17
 
8
- ${e(t)}
18
+ ${getFileHeader(context)}
9
19
 
10
20
  import { xchacha20poly1305, chacha20poly1305 } from "@noble/ciphers/chacha.js";
11
21
  import { randomBytes, managedNonce, hexToBytes } from "@noble/ciphers/utils.js";
12
22
  import { scrypt } from "@noble/hashes/scrypt.js";
13
23
  import { blake3 } from "@noble/hashes/blake3.js";
14
- ${t.config.crypto.encryptionKey?`
24
+ ${context.config.crypto.encryptionKey ? `
15
25
  const nonce = randomBytes(24);
16
- const chacha = xchacha20poly1305(hexToBytes("${t.config.crypto.encryptionKey}"), nonce);
26
+ const chacha = xchacha20poly1305(hexToBytes("${context.config.crypto.encryptionKey}"), nonce);
17
27
 
18
28
  /**
19
29
  * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher.
@@ -48,7 +58,7 @@ export function decrypt(encrypted: string): string {
48
58
 
49
59
  return new TextDecoder().decode(decrypted);
50
60
  }
51
- `:``}
61
+ ` : ""}
52
62
 
53
63
  /**
54
64
  * Symmetrically encrypts data using the [ChaCha20-Poly1305](https://en.wikipedia.org/wiki/ChaCha20-Poly1305) cipher with a password.
@@ -62,7 +72,7 @@ export function decrypt(encrypted: string): string {
62
72
  export function encryptWithPassword(password: string, plaintext: string): string {
63
73
  const key = scrypt(
64
74
  new TextEncoder().encode(password),
65
- hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
75
+ hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
66
76
  1048576, // requires 1GB of RAM to calculate
67
77
  8,
68
78
  1,
@@ -88,7 +98,7 @@ export function encryptWithPassword(password: string, plaintext: string): string
88
98
  export function decryptWithPassword(password: string, encrypted: string): string {
89
99
  const key = scrypt(
90
100
  new TextEncoder().encode(password),
91
- hexToBytes("${t.config.crypto.salt?t.config.crypto.salt:`nonce`}"),
101
+ hexToBytes("${context.config.crypto.salt ? context.config.crypto.salt : "nonce"}"),
92
102
  1048576, // requires 1GB of RAM to calculate
93
103
  8,
94
104
  1,
@@ -115,7 +125,7 @@ export function decryptWithPassword(password: string, encrypted: string): string
115
125
  export function hash(data: string): string {
116
126
  return Buffer.from(
117
127
  blake3(new TextEncoder().encode(data), {
118
- key: ${t.config.crypto.salt?`hexToBytes("${t.config.crypto.salt}")`:`new TextEncoder().encode("powerlines")`})
128
+ key: ${context.config.crypto.salt ? `hexToBytes("${context.config.crypto.salt}")` : "new TextEncoder().encode(\"powerlines\")"})
119
129
  })
120
130
  ).toString("hex");
121
131
  }
@@ -130,4 +140,8 @@ export * from '@noble/hashes/pbkdf2.js';
130
140
  export * from '@noble/hashes/scrypt.js';
131
141
  export * from '@noble/hashes/utils.js';
132
142
 
133
- `}export{t as cryptoModule};
143
+ `;
144
+ }
145
+
146
+ //#endregion
147
+ export { cryptoModule };
@@ -1 +1 @@
1
- const e=require(`./crypto.cjs`);
1
+ const require_crypto = require('./crypto.cjs');
@@ -1 +1,3 @@
1
- import{cryptoModule as e}from"./crypto.mjs";export{};
1
+ import { cryptoModule } from "./crypto.mjs";
2
+
3
+ export { };