Encrypted, ephemeral, private memos on atproto

fix(consumer): relax exported types

graham.systems 0b821bda e81acb6c

verified
Changed files
+14 -4
packages
+12 -2
packages/consumer/client.ts
··· 5 5 } from "@cistern/shared"; 6 6 import { decryptText, generateKeys } from "@cistern/crypto"; 7 7 import { generateRandomName } from "@puregarlic/randimal"; 8 - import { is, parse, type RecordKey } from "@atcute/lexicons"; 8 + import { 9 + is, 10 + isResourceUri, 11 + parse, 12 + type RecordKey, 13 + type ResourceUri, 14 + } from "@atcute/lexicons"; 9 15 import { JetstreamSubscription } from "@atcute/jetstream"; 10 16 import type { Did } from "@atcute/lexicons/syntax"; 11 17 import type { Client } from "@atcute/client"; ··· 35 41 this.keypair = params.options.keypair 36 42 ? { 37 43 privateKey: Uint8Array.fromBase64(params.options.keypair.privateKey), 38 - publicKey: params.options.keypair.publicKey, 44 + publicKey: params.options.keypair.publicKey as ResourceUri, 39 45 } 40 46 : undefined; 41 47 this.rpc = params.rpc; ··· 214 220 options: ConsumerOptions, 215 221 ): Promise<Consumer> { 216 222 const reqs = await produceRequirements(options); 223 + 224 + if (options.keypair && !isResourceUri(options.keypair.publicKey)) { 225 + throw new Error("provided public key is not a valid AT URI"); 226 + } 217 227 218 228 return new Consumer(reqs); 219 229 }
+1 -1
packages/consumer/deno.jsonc
··· 1 1 { 2 2 "name": "@cistern/consumer", 3 - "version": "1.0.1", 3 + "version": "1.0.2", 4 4 "license": "MIT", 5 5 "exports": { 6 6 ".": "./mod.ts"
+1 -1
packages/consumer/types.ts
··· 9 9 privateKey: string; 10 10 11 11 /** An AT URI to the `app.cistern.pubkey` record derived from this private key */ 12 - publicKey: ResourceUri; 12 + publicKey: string; 13 13 } 14 14 15 15 /**