@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.
- package/dist/index-BgAdqTbb.d.mts +1 -0
- package/dist/index-CEgs-Dz2.d.cts +1 -0
- package/dist/index.cjs +12056 -8
- package/dist/index.d.cts +12 -4
- package/dist/index.d.mts +12 -5
- package/dist/index.mjs +12018 -3
- package/dist/plugin-C3MaN5jp.mjs +1 -0
- package/dist/plugin-DHXHjv16.cjs +0 -0
- package/dist/plugin-Dhgjf-aI.d.mts +4441 -0
- package/dist/plugin-Dw1wCT6b.d.cts +4438 -0
- package/dist/types/index.cjs +2 -0
- package/dist/types/index.d.cts +2 -1
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.mjs +3 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +1 -41
- package/dist/types/plugin.d.mts +1 -41
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-CTUnla4x.mjs +1 -0
- package/dist/types-DHkg7xmX.cjs +0 -0
- package/package.json +5 -5
- package/dist/_virtual/rolldown_runtime.cjs +0 -37
- package/dist/_virtual/rolldown_runtime.mjs +0 -29
- package/dist/components/crypto.cjs +0 -147
- package/dist/components/crypto.d.cts +0 -13
- package/dist/components/crypto.d.mts +0 -13
- package/dist/components/crypto.mjs +0 -147
- package/dist/components/index.cjs +0 -1
- package/dist/components/index.d.mts +0 -1
- package/dist/components/index.mjs +0 -3
- package/dist/deepkit/schemas/reflection.cjs +0 -3998
- package/dist/deepkit/schemas/reflection.d.cts +0 -1560
- package/dist/deepkit/schemas/reflection.d.mts +0 -1560
- package/dist/deepkit/schemas/reflection.mjs +0 -3996
- package/dist/deepkit/schemas/reflection2.cjs +0 -4112
- package/dist/deepkit/schemas/reflection2.mjs +0 -4110
- package/dist/deepkit/src/capnp.cjs +0 -913
- package/dist/deepkit/src/capnp.mjs +0 -911
- package/dist/deepkit/src/esbuild-plugin.cjs +0 -47
- package/dist/deepkit/src/esbuild-plugin.mjs +0 -46
- package/dist/deepkit/src/reflect-type.cjs +0 -22
- package/dist/deepkit/src/reflect-type.mjs +0 -20
- package/dist/deepkit/src/resolve-reflections.cjs +0 -16
- package/dist/deepkit/src/resolve-reflections.mjs +0 -15
- package/dist/deepkit/src/transformer.cjs +0 -52
- package/dist/deepkit/src/transformer.mjs +0 -49
- package/dist/deepkit/src/transpile.cjs +0 -29
- package/dist/deepkit/src/transpile.mjs +0 -27
- package/dist/deepkit/src/types.d.cts +0 -10
- package/dist/deepkit/src/types.d.mts +0 -10
- package/dist/deepkit/src/utilities.cjs +0 -66
- package/dist/deepkit/src/utilities.mjs +0 -65
- package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -38
- package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -19
- package/dist/deepkit/src/vendor/type.cjs +0 -20
- package/dist/deepkit/src/vendor/type.d.cts +0 -7
- package/dist/deepkit/src/vendor/type.d.mts +0 -7
- package/dist/deepkit/src/vendor/type.mjs +0 -11
- package/dist/plugin-alloy/src/core/components/output.cjs +0 -38
- package/dist/plugin-alloy/src/core/components/output.mjs +0 -37
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +0 -20
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +0 -19
- package/dist/plugin-alloy/src/core/components/source-file.cjs +0 -60
- package/dist/plugin-alloy/src/core/components/source-file.mjs +0 -58
- package/dist/plugin-alloy/src/core/contexts/context.cjs +0 -60
- package/dist/plugin-alloy/src/core/contexts/context.mjs +0 -54
- package/dist/plugin-alloy/src/core/contexts/index.cjs +0 -2
- package/dist/plugin-alloy/src/core/contexts/index.mjs +0 -4
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +0 -46
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +0 -42
- package/dist/plugin-alloy/src/helpers/refkey.cjs +0 -16
- package/dist/plugin-alloy/src/helpers/refkey.mjs +0 -15
- package/dist/plugin-alloy/src/index.cjs +0 -90
- package/dist/plugin-alloy/src/index.mjs +0 -88
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +0 -7
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +0 -9
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +0 -5
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +0 -7
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +0 -17
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +0 -17
- package/dist/plugin-alloy/src/types/components.d.mts +0 -4
- package/dist/plugin-alloy/src/types/index.d.mts +0 -2
- package/dist/plugin-alloy/src/types/plugin.d.cts +0 -37
- package/dist/plugin-alloy/src/types/plugin.d.mts +0 -37
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +0 -47
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +0 -46
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +0 -75
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +0 -73
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +0 -359
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +0 -350
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +0 -143
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +0 -140
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +0 -53
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +0 -52
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +0 -94
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +0 -93
- package/dist/plugin-automd/src/index.cjs +0 -101
- package/dist/plugin-automd/src/index.mjs +0 -98
- package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
- package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
- package/dist/plugin-automd/src/types/toc.d.cts +0 -33
- package/dist/plugin-automd/src/types/toc.d.mts +0 -33
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -10
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -9
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -41
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -39
- package/dist/plugin-babel/src/helpers/filters.cjs +0 -23
- package/dist/plugin-babel/src/helpers/filters.mjs +0 -21
- package/dist/plugin-babel/src/helpers/index.cjs +0 -5
- package/dist/plugin-babel/src/helpers/index.mjs +0 -7
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -38
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -35
- package/dist/plugin-babel/src/helpers/options.cjs +0 -50
- package/dist/plugin-babel/src/helpers/options.mjs +0 -47
- package/dist/plugin-babel/src/index.cjs +0 -91
- package/dist/plugin-babel/src/index.mjs +0 -89
- package/dist/plugin-babel/src/types/index.d.mts +0 -1
- package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
- package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
- package/dist/plugin-env/src/babel/index.cjs +0 -1
- package/dist/plugin-env/src/babel/index.mjs +0 -3
- package/dist/plugin-env/src/babel/plugin.cjs +0 -121
- package/dist/plugin-env/src/babel/plugin.mjs +0 -119
- package/dist/plugin-env/src/components/docs.cjs +0 -9
- package/dist/plugin-env/src/components/docs.mjs +0 -11
- package/dist/plugin-env/src/components/env.cjs +0 -487
- package/dist/plugin-env/src/components/env.mjs +0 -484
- package/dist/plugin-env/src/components/index.cjs +0 -2
- package/dist/plugin-env/src/components/index.mjs +0 -4
- package/dist/plugin-env/src/helpers/automd-generator.cjs +0 -22
- package/dist/plugin-env/src/helpers/automd-generator.mjs +0 -21
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +0 -55
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +0 -54
- package/dist/plugin-env/src/helpers/index.cjs +0 -6
- package/dist/plugin-env/src/helpers/index.mjs +0 -8
- package/dist/plugin-env/src/helpers/load.cjs +0 -83
- package/dist/plugin-env/src/helpers/load.mjs +0 -80
- package/dist/plugin-env/src/helpers/persistence.cjs +0 -200
- package/dist/plugin-env/src/helpers/persistence.mjs +0 -189
- package/dist/plugin-env/src/helpers/reflect.cjs +0 -125
- package/dist/plugin-env/src/helpers/reflect.mjs +0 -117
- package/dist/plugin-env/src/helpers/source-file-env.cjs +0 -24
- package/dist/plugin-env/src/helpers/source-file-env.mjs +0 -23
- package/dist/plugin-env/src/helpers/template-helpers.cjs +0 -2
- package/dist/plugin-env/src/helpers/template-helpers.mjs +0 -4
- package/dist/plugin-env/src/index.cjs +0 -172
- package/dist/plugin-env/src/index.mjs +0 -170
- package/dist/plugin-env/src/types/plugin.d.cts +0 -151
- package/dist/plugin-env/src/types/plugin.d.mts +0 -153
- package/dist/plugin-env/src/types/runtime.d.cts +0 -792
- package/dist/plugin-env/src/types/runtime.d.mts +0 -792
- package/dist/powerlines/src/lib/build/esbuild.cjs +0 -102
- package/dist/powerlines/src/lib/build/esbuild.mjs +0 -100
- package/dist/powerlines/src/lib/entry.cjs +0 -12
- package/dist/powerlines/src/lib/entry.mjs +0 -14
- package/dist/powerlines/src/lib/logger.cjs +0 -41
- package/dist/powerlines/src/lib/logger.mjs +0 -39
- package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -35
- package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -34
- package/dist/powerlines/src/lib/utilities/file-header.cjs +0 -22
- package/dist/powerlines/src/lib/utilities/file-header.mjs +0 -21
- package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -30
- package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -29
- package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
- package/dist/powerlines/src/plugin-utils/paths.mjs +0 -3
- package/dist/powerlines/src/types/babel.d.cts +0 -22
- package/dist/powerlines/src/types/babel.d.mts +0 -22
- package/dist/powerlines/src/types/build.d.cts +0 -145
- package/dist/powerlines/src/types/build.d.mts +0 -147
- package/dist/powerlines/src/types/commands.d.cts +0 -8
- package/dist/powerlines/src/types/commands.d.mts +0 -9
- package/dist/powerlines/src/types/config.d.cts +0 -380
- package/dist/powerlines/src/types/config.d.mts +0 -381
- package/dist/powerlines/src/types/context.d.cts +0 -414
- package/dist/powerlines/src/types/context.d.mts +0 -416
- package/dist/powerlines/src/types/fs.d.cts +0 -486
- package/dist/powerlines/src/types/fs.d.mts +0 -486
- package/dist/powerlines/src/types/hooks.d.mts +0 -2
- package/dist/powerlines/src/types/plugin.d.cts +0 -231
- package/dist/powerlines/src/types/plugin.d.mts +0 -231
- package/dist/powerlines/src/types/resolved.d.cts +0 -82
- package/dist/powerlines/src/types/resolved.d.mts +0 -83
- package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
- package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { CryptoPluginContext,
|
|
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 };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { CryptoPluginContext,
|
|
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 };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-DHXHjv16.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import {
|
|
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 };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,42 +1,2 @@
|
|
|
1
|
-
import {
|
|
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 };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
135
|
+
"powerlines": "^0.36.27",
|
|
136
136
|
"@noble/ciphers": "^2.1.1"
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
|
-
"@powerlines/nx": "^0.11.
|
|
139
|
+
"@powerlines/nx": "^0.11.53",
|
|
140
140
|
"@types/node": "^24.10.4"
|
|
141
141
|
},
|
|
142
142
|
"publishConfig": { "access": "public" },
|
|
143
|
-
"gitHead": "
|
|
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";
|