@powerlines/plugin-crypto 0.10.328 → 0.10.330
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.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { bytesToHex, randomBytes } from \"@noble/ciphers/utils.js\";\nimport env from \"@powerlines/plugin-env\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { cryptoModule } from \"./components/crypto\";\nimport { CryptoPluginContext, CryptoPluginOptions } from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\n\ndeclare module \"powerlines\" {\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { bytesToHex, randomBytes } from \"@noble/ciphers/utils.js\";\nimport env from \"@powerlines/plugin-env\";\nimport defu from \"defu\";\nimport { Plugin } from \"powerlines\";\nimport { cryptoModule } from \"./components/crypto\";\nimport { CryptoPluginContext, CryptoPluginOptions } from \"./types/plugin\";\n\nexport * from \"./components\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n crypto?: CryptoPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport function plugin<\n TContext extends CryptoPluginContext = CryptoPluginContext\n>(options: CryptoPluginOptions = {}) {\n return [\n env(options.env),\n {\n name: \"crypto\",\n config() {\n return {\n crypto: defu(options, {\n salt: `${\n (this.config.name ?? this.workspaceConfig?.name) ||\n this.packageJson?.name\n }-application`\n })\n };\n },\n configResolved() {\n this.dependencies[\"@noble/ciphers\"] = \"^2.0.1\";\n this.dependencies[\"@noble/hashes\"] = \"^2.0.1\";\n\n this.config.crypto.salt ??= this.env.parsed.SALT!;\n if (!this.config.crypto.salt) {\n this.warn(\n `No salt provided to the Crypto plugin - a salt value will be generated automatically. Please note: It's highly recommended to provide a unique salt value via the \\`salt\\` plugin option or the \\`SALT\\` environment variable.`\n );\n\n this.config.crypto.salt = bytesToHex(randomBytes(12));\n }\n\n this.config.crypto.encryptionKey ??= this.env.parsed.ENCRYPTION_KEY!;\n if (!this.config.crypto.encryptionKey) {\n this.warn(\n `No encryption key provided to the Crypto plugin - a secure key will be generated automatically. Please note: it's highly recommended to provide a secure encryption key via the \\`encryptionKey\\` plugin option or the \\`ENCRYPTION_KEY\\` environment variable.`\n );\n\n this.config.crypto.encryptionKey = bytesToHex(randomBytes(32));\n }\n },\n async prepare() {\n this.debug(\n `Preparing the Crypto runtime artifacts for the Powerlines project.`\n );\n\n await this.emitBuiltin(\n await Promise.resolve(cryptoModule(this)),\n \"crypto\"\n );\n }\n }\n ] as Plugin<TContext>[];\n}\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;AAqCA,SAAgB,OAEd,UAA+B,EAAE,EAAE;AACnC,QAAO,CACL,IAAI,QAAQ,IAAI,EAChB;EACE,MAAM;EACN,SAAS;AACP,UAAO,EACL,QAAQ,KAAK,SAAS,EACpB,MAAM,IACH,KAAK,OAAO,QAAQ,KAAK,iBAAiB,SAC3C,KAAK,aAAa,KACnB,eACF,CAAC,EACH;;EAEH,iBAAiB;AACf,QAAK,aAAa,oBAAoB;AACtC,QAAK,aAAa,mBAAmB;AAErC,QAAK,OAAO,OAAO,SAAS,KAAK,IAAI,OAAO;AAC5C,OAAI,CAAC,KAAK,OAAO,OAAO,MAAM;AAC5B,SAAK,KACH,iOACD;AAED,SAAK,OAAO,OAAO,OAAO,WAAW,YAAY,GAAG,CAAC;;AAGvD,QAAK,OAAO,OAAO,kBAAkB,KAAK,IAAI,OAAO;AACrD,OAAI,CAAC,KAAK,OAAO,OAAO,eAAe;AACrC,SAAK,KACH,kQACD;AAED,SAAK,OAAO,OAAO,gBAAgB,WAAW,YAAY,GAAG,CAAC;;;EAGlE,MAAM,UAAU;AACd,QAAK,MACH,qEACD;AAED,SAAM,KAAK,YACT,MAAM,QAAQ,QAAQ,aAAa,KAAK,CAAC,EACzC,SACD;;EAEJ,CACF;;AAGH,kBAAe"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-crypto",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.330",
|
|
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": {
|
|
@@ -87,19 +87,19 @@
|
|
|
87
87
|
"keywords": ["powerlines", "storm-software", "powerlines-plugin"],
|
|
88
88
|
"dependencies": {
|
|
89
89
|
"@noble/ciphers": "^2.1.1",
|
|
90
|
-
"@powerlines/plugin-env": "^0.16.
|
|
90
|
+
"@powerlines/plugin-env": "^0.16.21",
|
|
91
91
|
"@storm-software/config-tools": "^1.189.10",
|
|
92
92
|
"@stryke/path": "^0.26.6",
|
|
93
93
|
"defu": "^6.1.4",
|
|
94
|
-
"powerlines": "^0.39.
|
|
94
|
+
"powerlines": "^0.39.11"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
97
|
+
"@powerlines/plugin-plugin": "^0.12.254",
|
|
98
98
|
"@types/node": "^25.3.3"
|
|
99
99
|
},
|
|
100
100
|
"publishConfig": { "access": "public" },
|
|
101
101
|
"main": "./dist/index.cjs",
|
|
102
102
|
"module": "./dist/index.mjs",
|
|
103
103
|
"types": "./dist/index.d.cts",
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "e63eb5a0ecd0e5ee3e030388ad1c534b3ecb2136"
|
|
105
105
|
}
|