mirror of
https://github.com/Blah-IM/typescript-core.git
synced 2025-04-30 16:21:10 +00:00
feat(identity): export schema
This commit is contained in:
parent
c0627b5d96
commit
e39152d49c
2 changed files with 27 additions and 5 deletions
|
@ -51,8 +51,8 @@ export class BlahPublicKey {
|
|||
signedPayload: unknown,
|
||||
): Promise<{ payload: P; key: BlahPublicKey }> {
|
||||
const signedPayloadSchema = blahSignedPayloadSchemaOf(schema);
|
||||
const parsed = signedPayloadSchema.parse(signedPayload);
|
||||
return await BlahPublicKey.verifyPayload(parsed as BlahSignedPayload<P>);
|
||||
const parsed = signedPayloadSchema.parse(signedPayload) as z.infer<P>;
|
||||
return await BlahPublicKey.verifyPayload(parsed);
|
||||
}
|
||||
|
||||
async verifyPayload<P>(signedPayload: BlahSignedPayload<P>): Promise<P> {
|
||||
|
|
|
@ -1,4 +1,26 @@
|
|||
export type { BlahActKeyRecord } from "./actKey.ts";
|
||||
export type { BlahIdentityFile } from "./identityFile.ts";
|
||||
export type { BlahProfile } from "./profile.ts";
|
||||
import type z from "zod";
|
||||
|
||||
export * from "./identity.ts";
|
||||
|
||||
import {
|
||||
type BlahProfile,
|
||||
blahProfileSchema as internalBlahProfileSchema,
|
||||
} from "./profile.ts";
|
||||
const blahProfileSchema: z.ZodType<BlahProfile> = internalBlahProfileSchema;
|
||||
export { type BlahProfile, blahProfileSchema };
|
||||
|
||||
import {
|
||||
type BlahIdentityFile,
|
||||
blahIdentityFileSchema as internalBlahIdentityFileSchema,
|
||||
} from "./identityFile.ts";
|
||||
const blahIdentityFileSchema: z.ZodType<BlahIdentityFile> =
|
||||
internalBlahIdentityFileSchema;
|
||||
export { type BlahIdentityFile, blahIdentityFileSchema };
|
||||
|
||||
import {
|
||||
type BlahActKeyRecord,
|
||||
blahActKeyRecordSchema as internalBlahActKeyRecordSchema,
|
||||
} from "./actKey.ts";
|
||||
const blahActKeyRecordSchema: z.ZodType<BlahActKeyRecord> =
|
||||
internalBlahActKeyRecordSchema;
|
||||
export { type BlahActKeyRecord, blahActKeyRecordSchema };
|
||||
|
|
Loading…
Add table
Reference in a new issue