@lowerdeck/encryption 1.0.4 → 1.0.6

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/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # `@lowerdeck/encryption`
2
+
3
+ Encryption utility for securely encrypting and decrypting secrets using entity-specific passwords. Uses SHA-512 for key derivation and provides a simple API for secret management.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @lowerdeck/encryption
9
+ yarn add @lowerdeck/encryption
10
+ bun add @lowerdeck/encryption
11
+ pnpm add @lowerdeck/encryption
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```typescript
17
+ import { Encryption } from '@lowerdeck/encryption';
18
+
19
+ // Initialize with a master password
20
+ const encryption = new Encryption('master-password-123');
21
+
22
+ // Encrypt a secret for a specific entity
23
+ const encrypted = await encryption.encrypt({
24
+ secret: 'my-api-key',
25
+ entityId: 'user_123'
26
+ });
27
+
28
+ // Decrypt the secret
29
+ const decrypted = await encryption.decrypt({
30
+ encrypted,
31
+ entityId: 'user_123'
32
+ });
33
+ console.log(decrypted); // 'my-api-key'
34
+
35
+ // Different entity IDs produce different encryptions
36
+ await encryption.encrypt({
37
+ secret: 'same-secret',
38
+ entityId: 'user_456'
39
+ }); // Different encrypted output
40
+ ```
41
+
42
+ ## License
43
+
44
+ This project is licensed under the Apache License 2.0.
45
+
46
+ <div align="center">
47
+ <sub>Built with ❤️ by <a href="https://metorial.com">Metorial</a></sub>
48
+ </div>
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "@lowerdeck/encryption",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
+ "files": [
8
+ "src/**",
9
+ "dist/**",
10
+ "README.md",
11
+ "package.json"
12
+ ],
7
13
  "author": "Tobias Herber",
8
14
  "license": "Apache 2",
9
15
  "type": "module",
@@ -21,15 +27,15 @@
21
27
  "scripts": {
22
28
  "test": "vitest run --passWithNoTests",
23
29
  "lint": "prettier src/**/*.ts --check",
24
- "build": "microbundle"
30
+ "build": "rm -rf ./dist && microbundle"
25
31
  },
26
32
  "dependencies": {
27
- "@lowerdeck/base62": "^1.0.2",
28
- "@lowerdeck/id": "^1.0.3",
33
+ "@lowerdeck/base62": "^1.0.4",
34
+ "@lowerdeck/id": "^1.0.5",
29
35
  "base-x": "^5.0.0"
30
36
  },
31
37
  "devDependencies": {
32
- "@lowerdeck/tsconfig": "^1.0.0",
38
+ "@lowerdeck/tsconfig": "^1.0.1",
33
39
  "microbundle": "^0.15.1",
34
40
  "typescript": "5.8.2",
35
41
  "vitest": "^3.1.2"
@@ -1,9 +0,0 @@
1
- {
2
- "permissions": {
3
- "allow": [
4
- "Bash(npm run build:*)"
5
- ],
6
- "deny": [],
7
- "ask": []
8
- }
9
- }
@@ -1,13 +0,0 @@
1
-
2
- $ microbundle
3
- No name was provided for external module '@lowerdeck/id' in output.globals – guessing 'id'
4
- No name was provided for external module '@lowerdeck/base62' in output.globals – guessing 'base62'
5
- Build "@lowerdeck/encryption" to dist:
6
- 911 B: index.cjs.gz
7
- 829 B: index.cjs.br
8
- 770 B: index.module.js.gz
9
- 706 B: index.module.js.br
10
- 882 B: index.module.js.gz
11
- 821 B: index.module.js.br
12
- 995 B: index.umd.js.gz
13
- 896 B: index.umd.js.br
@@ -1,11 +0,0 @@
1
-
2
- $ vitest run --passWithNoTests
3
- [?25l
4
-  RUN  v3.2.4 /Users/tobias/code/metorial/metorial-enterprise/oss/src/packages/backend/encryption
5
-
6
- No test files found, exiting with code 0
7
-
8
- include: **/*.{test,spec}.?(c|m)[jt]s?(x)
9
- exclude: **/node_modules/**, **/dist/**, **/cypress/**, **/.{idea,git,cache,output,temp}/**, **/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build,eslint,prettier}.config.*
10
-
11
- [?25h
package/CHANGELOG.md DELETED
@@ -1,22 +0,0 @@
1
- # @lowerdeck/encryption
2
-
3
- ## 1.0.4
4
-
5
- ### Patch Changes
6
-
7
- - update versions
8
- - Updated dependencies
9
- - @lowerdeck/base62@1.0.2
10
- - @lowerdeck/id@1.0.3
11
-
12
- ## 1.0.3
13
-
14
- ### Patch Changes
15
-
16
- - Fix deps
17
-
18
- ## 1.0.2
19
-
20
- ### Patch Changes
21
-
22
- - Fix salts
package/tsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "https://json.schemastore.org/tsconfig",
3
- "extends": "@lowerdeck/tsconfig/base.json",
4
- "exclude": ["dist"],
5
- "compilerOptions": {
6
- "outDir": "dist"
7
- }
8
- }