@uglyunicorn/pie 0.1.0 → 0.1.2
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 +21 -1
- package/body.txt +0 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Validate payloads with your schema, seal with a public key, and open with the ma
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
bun add @uglyunicorn/pie valibot
|
|
12
|
+
bun add @uglyunicorn/pie valibot hpke
|
|
13
13
|
# or: npm install @uglyunicorn/pie valibot
|
|
14
14
|
```
|
|
15
15
|
|
|
@@ -64,3 +64,23 @@ Output:
|
|
|
64
64
|
"weight": 70
|
|
65
65
|
}
|
|
66
66
|
```
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
const decryptContext = envelopeContext({ in: keyPair });
|
|
70
|
+
|
|
71
|
+
const decrypted = await v.parseAsync(userProfileSchema(decryptContext), sealed);
|
|
72
|
+
console.log(decrypted);
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Output:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"identity": {
|
|
80
|
+
"name": "John Doe",
|
|
81
|
+
"email": "john.doe@example.com"
|
|
82
|
+
},
|
|
83
|
+
"height": 180,
|
|
84
|
+
"weight": 70
|
|
85
|
+
}
|
|
86
|
+
```
|
package/body.txt
CHANGED