@uglyunicorn/pie 0.1.2 → 0.1.4

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/body.txt CHANGED
@@ -0,0 +1,3 @@
1
+ * Refactor CipherContext type in hpke.ts for clarity and consistency; update exports in index.ts
2
+
3
+ * Update package version to 0.1.4 in package.json
package/package.json CHANGED
@@ -1,8 +1,24 @@
1
1
  {
2
2
  "name": "@uglyunicorn/pie",
3
- "version": "0.1.2",
4
- "module": "src/index.ts",
3
+ "version": "0.1.4",
4
+ "description": "Schema-validated envelopes using HPKE",
5
+ "keywords": [
6
+ "schema",
7
+ "envelope",
8
+ "hpke",
9
+ "valibot"
10
+ ],
5
11
  "type": "module",
12
+ "license": "MIT",
13
+ "author": "Ugly Unicorn",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/uglyunicorn-eh/pie.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/uglyunicorn-eh/pie/issues"
20
+ },
21
+ "homepage": "https://github.com/uglyunicorn-eh/pie#readme",
6
22
  "scripts": {
7
23
  "build": "bun run scripts/build.ts && bun run build:types",
8
24
  "build:types": "tsc --project tsconfig.build.json",
@@ -9,7 +9,7 @@ import {
9
9
  } from "hpke";
10
10
 
11
11
  import { decodeBuffer, deserialize, encodeBuffer, serialize } from "../lib/utils";
12
- import type { CipherContext, DecipherContext, RetranslateContext } from "..";
12
+ import type { CipherContext as CipherContextType, DecipherContext, RetranslateContext } from "..";
13
13
 
14
14
  export class HpkeEnvelopeError extends Error {}
15
15
 
@@ -18,6 +18,8 @@ export interface Envelope {
18
18
  enc: string;
19
19
  }
20
20
 
21
+ export type CipherContext = CipherContextType<Envelope>;
22
+
21
23
  export function createCipherSuite(): CipherSuite {
22
24
  return new CipherSuite(KEM_DHKEM_P256_HKDF_SHA256, KDF_HKDF_SHA256, AEAD_AES_128_GCM);
23
25
  }
@@ -89,7 +91,7 @@ export async function openEnvelope<T>(
89
91
  return validated.value;
90
92
  }
91
93
 
92
- export function envelopeContext(opts: { out: Pick<KeyPair, "publicKey"> }): CipherContext<Envelope>;
94
+ export function envelopeContext(opts: { out: Pick<KeyPair, "publicKey"> }): CipherContext;
93
95
 
94
96
  export function envelopeContext(opts: {
95
97
  in: Pick<KeyPair, "privateKey">;
@@ -119,7 +121,7 @@ export function envelopeContext(opts?: any) {
119
121
  if (opts?.out) {
120
122
  return {
121
123
  seal: (schema, data) => sealEnvelope(schema, data, opts.out.publicKey),
122
- } as CipherContext<Envelope>;
124
+ } as CipherContext;
123
125
  }
124
126
 
125
127
  return undefined;
@@ -1 +1 @@
1
- export { createCipherSuite, envelopeContext } from "./hpke";
1
+ export { createCipherSuite, envelopeContext, type CipherContext, type Envelope } from "./hpke";