@zk-email/sdk 0.0.86-1 → 0.0.86-3

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.
Files changed (45) hide show
  1. package/dist/assets/localProverWorker-DkBS78Vu.js +76 -0
  2. package/dist/assets/localProverWorker-DkBS78Vu.js.map +1 -0
  3. package/dist/ccip-C1_QoADM.js +2 -0
  4. package/dist/ccip-C1_QoADM.js.map +1 -0
  5. package/dist/ccip-DnkZqQmT.mjs +147 -0
  6. package/dist/ccip-DnkZqQmT.mjs.map +1 -0
  7. package/dist/index-CfUVEXW_.js +41 -0
  8. package/dist/index-CfUVEXW_.js.map +1 -0
  9. package/dist/index-DnjJIihA.mjs +13497 -0
  10. package/dist/index-DnjJIihA.mjs.map +1 -0
  11. package/dist/types/auth.d.ts +3 -0
  12. package/dist/types/blueprint.d.ts +129 -0
  13. package/dist/types/blueprintValidation.d.ts +82 -0
  14. package/dist/types/chain/index.d.ts +2 -0
  15. package/dist/types/index.d.ts +24 -0
  16. package/dist/types/localProverWorker.d.ts +2 -0
  17. package/dist/types/proof.d.ts +52 -0
  18. package/dist/types/prover.d.ts +27 -0
  19. package/dist/types/relayerUtils.d.ts +13 -0
  20. package/dist/types/types/auth.d.ts +16 -0
  21. package/dist/types/types/blueprint.d.ts +153 -0
  22. package/dist/types/types/index.d.ts +6 -0
  23. package/dist/types/types/proof.d.ts +56 -0
  24. package/dist/types/types/prover.d.ts +8 -0
  25. package/dist/types/types/sdk.d.ts +5 -0
  26. package/dist/types/types/utils.d.ts +8 -0
  27. package/dist/types/user.d.ts +5 -0
  28. package/dist/types/utils.d.ts +7 -0
  29. package/dist/zk-email-sdk.cjs.js +2 -0
  30. package/dist/zk-email-sdk.cjs.js.map +1 -0
  31. package/dist/zk-email-sdk.es.js +18 -0
  32. package/dist/zk-email-sdk.es.js.map +1 -0
  33. package/package.json +15 -12
  34. package/dist/index.d.mts +0 -553
  35. package/dist/index.d.ts +0 -553
  36. package/dist/index.js +0 -4
  37. package/dist/index.js.map +0 -1
  38. package/dist/index.mjs +0 -4
  39. package/dist/index.mjs.map +0 -1
  40. package/dist/localProverWorker.d.mts +0 -4
  41. package/dist/localProverWorker.d.ts +0 -4
  42. package/dist/localProverWorker.js +0 -2
  43. package/dist/localProverWorker.js.map +0 -1
  44. package/dist/localProverWorker.mjs +0 -2
  45. package/dist/localProverWorker.mjs.map +0 -1
@@ -0,0 +1,3 @@
1
+ import { Auth } from "./types/auth";
2
+ export declare function getLoginWithGithubUrl(callbackUrl: string, githubClientId?: string): string;
3
+ export declare function getTokenFromAuth(auth: Auth): Promise<string>;
@@ -0,0 +1,129 @@
1
+ import { Prover } from "./prover";
2
+ import { BlueprintProps, ChunkedZkeyUrl, DownloadUrls, ListBlueprintsOptions, Status } from "./types/blueprint";
3
+ import { Auth } from "./types/auth";
4
+ import { Proof } from "./proof";
5
+ import { blueprintFormSchema } from "./blueprintValidation";
6
+ import { ProverOptions } from "./types";
7
+ /**
8
+ * Represents a Regex Blueprint including the decomposed regex access to the circuit.
9
+ */
10
+ export declare class Blueprint {
11
+ props: BlueprintProps;
12
+ auth?: Auth;
13
+ baseUrl: string;
14
+ stars: number;
15
+ static readonly formSchema: typeof blueprintFormSchema;
16
+ private lastCheckedStatus;
17
+ constructor(props: BlueprintProps, baseUrl: string, auth?: Auth);
18
+ addAuth(auth: Auth): void;
19
+ /**
20
+ * Fetches an existing RegexBlueprint from the database.
21
+ * @param {string} id - Id of the RegexBlueprint.
22
+ * @returns A promise that resolves to a new instance of RegexBlueprint.
23
+ */
24
+ static getBlueprintById(id: string, baseUrl: string, auth?: Auth): Promise<Blueprint>;
25
+ /**
26
+ * Fetches an existing RegexBlueprint by slug from the database.
27
+ * @param slug - Slug of the blueprint. Must include version, e.g. "slug:v1"
28
+ * @param version - Version of the slug.
29
+ * @returns A promise that resolves to a new instance of RegexBlueprint.
30
+ */
31
+ static getBlueprintBySlug(slug: string, baseUrl: string, auth?: Auth): Promise<Blueprint>;
32
+ private static responseToBlueprintProps;
33
+ private static blueprintPropsToRequest;
34
+ /**
35
+ * Submits a new RegexBlueprint to the registry as draft.
36
+ * This does not compile the circuits yet and you will still be able to make changes.
37
+ * @returns A promise. Once it resolves, `getId` can be called.
38
+ */
39
+ submitDraft(): Promise<void>;
40
+ /**
41
+ * Submits a new version of the RegexBlueprint to the registry as draft.
42
+ * This does not compile the circuits yet and you will still be able to make changes.
43
+ * @param newProps - The updated blueprint props.
44
+ * @returns A promise. Once it resolves, the current Blueprint will be replaced with the new one.
45
+ */
46
+ submitNewVersionDraft(newProps: BlueprintProps): Promise<void>;
47
+ /**
48
+ * Submits a new version of the blueprint. This will save the new blueprint version
49
+ * and start the compilation.
50
+ * This will also overwrite the current Blueprint with its new version, even if the last
51
+ * version was not compiled yet.
52
+ * @param newProps - The updated blueprint props.
53
+ */
54
+ submitNewVersion(newProps: BlueprintProps): Promise<void>;
55
+ /**
56
+ * Lists blueblueprints, only including the latest version per unique slug.
57
+ * @param options - Options to filter the blueprints by.
58
+ * @returns A promise. Once it resolves, `getId` can be called.
59
+ */
60
+ static listBlueprints(baseUrl: string, options?: ListBlueprintsOptions, auth?: Auth): Promise<Blueprint[]>;
61
+ /**
62
+ * Submits a blueprint. This will save the blueprint if it didn't exist before
63
+ * and start the compilation.
64
+ */
65
+ submit(): Promise<void>;
66
+ private _checkStatus;
67
+ /**
68
+ * Checks the status of blueprint.
69
+ * checkStatus can be used in a while(await checkStatus()) loop, since it will wait a fixed
70
+ * amount of time the second time you call it.
71
+ * @returns A promise with the Status.
72
+ */
73
+ checkStatus(): Promise<Status>;
74
+ /**
75
+ * Get the id of the blueprint.
76
+ * @returns The id of the blueprint. If it was not saved yet, return null.
77
+ */
78
+ getId(): string | null;
79
+ /**
80
+ * Returns a download link for the ZKeys of the blueprint.
81
+ * @returns The the url to download the ZKeys.
82
+ */
83
+ getZKeyDownloadLink(): Promise<DownloadUrls>;
84
+ /**
85
+ * Directly starts a download of the ZKeys in the browser.
86
+ * Must be called within a user action, like a button click.
87
+ */
88
+ startZKeyDownload(): Promise<void>;
89
+ /**
90
+ * Creates an instance of Prover with which you can create proofs.
91
+ * @returns An instance of Prover.
92
+ */
93
+ createProver(options?: ProverOptions): Prover;
94
+ /**
95
+ * Verifies a proof on chain.
96
+ * @param proof - The generated proof you want to verify.
97
+ * @returns A true if the verification was successfull, false if it failed.
98
+ */
99
+ verifyProofOnChain(proof: Proof): Promise<boolean>;
100
+ /**
101
+ * Returns a deep cloned version of the Blueprints props.
102
+ * This can be used to update properties and then to use them with createNewVersion.
103
+ * @param proof - The generated proof you want to verify.
104
+ * @returns A true if the verification was successfull, false if it failed.
105
+ */
106
+ getClonedProps(): BlueprintProps;
107
+ /**
108
+ * Returns true if the blueprint can be updated. A blueprint can be updated if the circuits
109
+ * haven't beed compiled yet, i.e. the status is not Done. The blueprint also must be saved
110
+ * already before it can be updated.
111
+ * @returns true if it can be updated
112
+ */
113
+ canUpdate(): boolean;
114
+ /**
115
+ * Updates an existing blueprint that is not compiled yet.
116
+ * @param newProps - The props the blueprint should be updated to.
117
+ * @returns a promise.
118
+ */
119
+ update(newProps: BlueprintProps): Promise<void>;
120
+ listAllVersions(): Promise<Blueprint[]>;
121
+ addStar(): Promise<number>;
122
+ removeStar(): Promise<number>;
123
+ getStars(): Promise<number>;
124
+ cancelCompilation(): Promise<void>;
125
+ delete(): Promise<void>;
126
+ getChunkedZkeyUrls(): Promise<ChunkedZkeyUrl[]>;
127
+ getWasmUrl(): Promise<string>;
128
+ }
129
+ export * from "./types/blueprint";
@@ -0,0 +1,82 @@
1
+ import { z } from "zod";
2
+ export declare const blueprintFormSchema: z.ZodObject<{
3
+ title: z.ZodString;
4
+ circuitName: z.ZodString;
5
+ description: z.ZodString;
6
+ emailQuery: z.ZodString;
7
+ ignoreBodyHashCheck: z.ZodBoolean;
8
+ shaPrecomputeSelector: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
9
+ senderDomain: z.ZodEffects<z.ZodString, string, string>;
10
+ emailBodyMaxLength: z.ZodEffects<z.ZodNumber, number, number>;
11
+ emailHeaderMaxLength: z.ZodDefault<z.ZodEffects<z.ZodNumber, number, number>>;
12
+ decomposedRegexes: z.ZodArray<z.ZodObject<{
13
+ name: z.ZodEffects<z.ZodString, string, string>;
14
+ maxLength: z.ZodDefault<z.ZodNumber>;
15
+ location: z.ZodString;
16
+ parts: z.ZodUnion<[z.ZodOptional<z.ZodEffects<z.ZodString, any[], string>>, z.ZodArray<z.ZodAny, "many">]>;
17
+ }, "strip", z.ZodTypeAny, {
18
+ name: string;
19
+ maxLength: number;
20
+ location: string;
21
+ parts?: any[] | undefined;
22
+ }, {
23
+ name: string;
24
+ location: string;
25
+ maxLength?: number | undefined;
26
+ parts?: string | any[] | undefined;
27
+ }>, "many">;
28
+ externalInputs: z.ZodOptional<z.ZodArray<z.ZodObject<{
29
+ name: z.ZodString;
30
+ maxLength: z.ZodDefault<z.ZodNumber>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ name: string;
33
+ maxLength: number;
34
+ }, {
35
+ name: string;
36
+ maxLength?: number | undefined;
37
+ }>, "many">>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ description: string;
40
+ title: string;
41
+ circuitName: string;
42
+ emailQuery: string;
43
+ ignoreBodyHashCheck: boolean;
44
+ senderDomain: string;
45
+ emailBodyMaxLength: number;
46
+ emailHeaderMaxLength: number;
47
+ decomposedRegexes: {
48
+ name: string;
49
+ maxLength: number;
50
+ location: string;
51
+ parts?: any[] | undefined;
52
+ }[];
53
+ shaPrecomputeSelector?: string | undefined;
54
+ externalInputs?: {
55
+ name: string;
56
+ maxLength: number;
57
+ }[] | undefined;
58
+ }, {
59
+ description: string;
60
+ title: string;
61
+ circuitName: string;
62
+ emailQuery: string;
63
+ ignoreBodyHashCheck: boolean;
64
+ senderDomain: string;
65
+ emailBodyMaxLength: number;
66
+ decomposedRegexes: {
67
+ name: string;
68
+ location: string;
69
+ maxLength?: number | undefined;
70
+ parts?: string | any[] | undefined;
71
+ }[];
72
+ shaPrecomputeSelector?: string | undefined;
73
+ emailHeaderMaxLength?: number | undefined;
74
+ externalInputs?: {
75
+ name: string;
76
+ maxLength?: number | undefined;
77
+ }[] | undefined;
78
+ }>;
79
+ export type ValidationErrors = {
80
+ [K in keyof z.infer<typeof blueprintFormSchema>]?: string;
81
+ };
82
+ export { ZodError } from "zod";
@@ -0,0 +1,2 @@
1
+ import { Proof } from "../proof";
2
+ export declare function verifyProofOnChain(proof: Proof): Promise<void>;
@@ -0,0 +1,24 @@
1
+ import { Blueprint, BlueprintProps, ListBlueprintsOptions } from "./blueprint";
2
+ import { Proof } from "./proof";
3
+ import { SdkOptions } from "./types/sdk";
4
+ export * from "./types/blueprint";
5
+ export { Blueprint } from "./blueprint";
6
+ export * from "./types/proof";
7
+ export { Proof } from "./proof";
8
+ export * from "./types/prover";
9
+ export type { Auth } from "./types/auth";
10
+ export type { ParsedEmail } from "./types/utils";
11
+ export type { ValidationErrors } from "./blueprintValidation";
12
+ export { startJsonFileDownload, getDKIMSelector } from "./utils";
13
+ export { testDecomposedRegex, parseEmail, generateProofInputs, testBlueprint, } from "./relayerUtils";
14
+ export { getLoginWithGithubUrl } from "./auth";
15
+ export { ZodError } from "./blueprintValidation";
16
+ declare const _default: (sdkOptions?: SdkOptions) => {
17
+ createBlueprint(props: BlueprintProps): Blueprint;
18
+ getBlueprint(slug: string): Promise<Blueprint>;
19
+ getBlueprintById(id: string): Promise<Blueprint>;
20
+ listBlueprints(options?: ListBlueprintsOptions): Promise<Blueprint[]>;
21
+ getProof(id: string): Promise<Proof>;
22
+ getStarredBlueprints(): Promise<string[]>;
23
+ };
24
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export declare const uncompressGz: (arrayBuffer: ArrayBuffer) => Promise<any>;
2
+ export declare function downloadFromUrl(fileUrl: string, targetFileName: string, compressed?: boolean): Promise<void>;
@@ -0,0 +1,52 @@
1
+ import { Blueprint } from "./blueprint";
2
+ import { ProofProps, ProofResponse, ProofStatus } from "./types/proof";
3
+ /**
4
+ * A generated proof. You get get proof data and verify proofs on chain.
5
+ */
6
+ export declare class Proof {
7
+ blueprint: Blueprint;
8
+ props: ProofProps;
9
+ private lastCheckedStatus;
10
+ constructor(blueprint: Blueprint, props: ProofProps);
11
+ getId(): string;
12
+ /**
13
+ * Returns a download link for the files of the proof.
14
+ * @returns The the url to download a zip of the proof files.
15
+ */
16
+ getProofDataDownloadLink(): Promise<string>;
17
+ startFilesDownload(): Promise<void>;
18
+ /**
19
+ * Checks the status of proof.
20
+ * checkStatus can be used in a while(await checkStatus()) loop, since it will wait a fixed
21
+ * amount of time before the second time you call it.
22
+ * @returns A promise with the Status.
23
+ */
24
+ checkStatus(): Promise<ProofStatus>;
25
+ waitForCompletion(): Promise<ProofStatus>;
26
+ /**
27
+ * Verifies the proof on chain using the verifier contract defined in the blueprint.
28
+ * Will throw an error if it cannot verify the proof. If the function call succeeds,
29
+ * the proof was validated.
30
+ */
31
+ verifyOnChain(): Promise<void>;
32
+ /**
33
+ * Generates call data for the proof that can be used to verify the proof on chain.
34
+ */
35
+ createCallData(): Promise<(bigint[] | bigint[][])[]>;
36
+ /**
37
+ * Fetches an existing Proof from the database.
38
+ * @param id - Id of the Proof.
39
+ * @returns A promise that resolves to a new instance of Proof.
40
+ */
41
+ static getProofById(id: string, baseUrl: string): Promise<Proof>;
42
+ static responseToProofProps(response: ProofResponse): ProofProps;
43
+ /**
44
+ * @returns The public data and proof data.
45
+ */
46
+ getProofData(): {
47
+ proofData: string;
48
+ publicData: string;
49
+ publicOutputs: string[];
50
+ externalInputs: string;
51
+ };
52
+ }
@@ -0,0 +1,27 @@
1
+ import { Blueprint } from "./blueprint";
2
+ import { Proof } from "./proof";
3
+ import { ExternalInputInput, ProverOptions } from "./types/prover";
4
+ /**
5
+ * Represents a Prover generated from a blueprint that can generate Proofs
6
+ */
7
+ export declare class Prover {
8
+ options: ProverOptions;
9
+ blueprint: Blueprint;
10
+ constructor(blueprint: Blueprint, options?: ProverOptions);
11
+ /**
12
+ * Generates a proof for a given email.
13
+ * @param eml - Email to prove agains the blueprint of this Prover.
14
+ * @returns A promise that resolves to a new instance of Proof. The Proof will have the status
15
+ * Done or Failed.
16
+ */
17
+ generateProof(eml: string, externalInputs?: ExternalInputInput[]): Promise<Proof>;
18
+ generateLocalProof(eml: string, externalInputs?: ExternalInputInput[]): Promise<Proof>;
19
+ generateProofInputs(eml: string, externalInputs?: ExternalInputInput[]): Promise<string>;
20
+ /**
21
+ * Starts proving for a given email.
22
+ * @param eml - Email to prove agains the blueprint of this Prover.
23
+ * @returns A promise that resolves to a new instance of Proof. The Proof will have the status
24
+ * InProgress.
25
+ */
26
+ generateProofRequest(eml: string, externalInputs?: ExternalInputInput[]): Promise<Proof>;
27
+ }
@@ -0,0 +1,13 @@
1
+ import { DecomposedRegex, DecomposedRegexJson } from "./blueprint";
2
+ import { BlueprintProps, GenerateProofInputsParams, ParsedEmail, ExternalInputInput } from "./types";
3
+ export declare function parseEmail(eml: string): Promise<ParsedEmail>;
4
+ export declare function testBlueprint(eml: string, blueprint: BlueprintProps, revealPrivate?: boolean): Promise<string[][]>;
5
+ export declare function testDecomposedRegex(body: string, header: string, decomposedRegex: DecomposedRegex | DecomposedRegexJson, revealPrivate?: boolean): Promise<string[]>;
6
+ export declare function generateProofInputs(eml: string, decomposedRegexes: DecomposedRegex[], externalInputs: ExternalInputInput[], params: GenerateProofInputsParams): Promise<string>;
7
+ export declare function getMaxEmailBodyLength(emlContent: string, shaPrecomputeSelector: string): Promise<number>;
8
+ export declare function extractEMLDetails(emlContent: string): Promise<{
9
+ senderDomain: string | null;
10
+ headerLength: number;
11
+ emailQuery: string;
12
+ emailBodyMaxLength: number;
13
+ }>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Interface for authentication for creating and updating blueprints
3
+ */
4
+ export type Auth = {
5
+ /**
6
+ * Retrieves the authentication token
7
+ * e.g. from a req for next.js or the localstorage for frontend
8
+ * @returns Promise that resolves to the token string or null if no token exists
9
+ */
10
+ getToken: () => Promise<string | null>;
11
+ /**
12
+ * Callback triggered when the authentication token expires
13
+ * @returns Promise that resolves when expired token is handled
14
+ */
15
+ onTokenExpired: () => Promise<void>;
16
+ };
@@ -0,0 +1,153 @@
1
+ export type BlueprintProps = {
2
+ id?: string;
3
+ title: string;
4
+ description?: string;
5
+ slug?: string;
6
+ tags?: string[];
7
+ emailQuery?: string;
8
+ circuitName: string;
9
+ ignoreBodyHashCheck?: boolean;
10
+ shaPrecomputeSelector?: string;
11
+ emailBodyMaxLength?: number;
12
+ emailHeaderMaxLength?: number;
13
+ removeSoftLinebreaks?: boolean;
14
+ githubUsername?: string;
15
+ senderDomain?: string;
16
+ enableHeaderMasking?: boolean;
17
+ enableBodyMasking?: boolean;
18
+ zkFramework?: ZkFramework;
19
+ isPublic?: boolean;
20
+ createdAt?: Date;
21
+ updatedAt?: Date;
22
+ externalInputs?: ExternalInput[];
23
+ decomposedRegexes: DecomposedRegex[];
24
+ status?: Status;
25
+ verifierContract?: VerifierContract;
26
+ version?: number;
27
+ stars?: number;
28
+ };
29
+ export type DecomposedRegex = {
30
+ parts: DecomposedRegexPart[];
31
+ name: string;
32
+ maxLength: number;
33
+ location: "body" | "header";
34
+ };
35
+ export type DecomposedRegexPart = {
36
+ isPublic: boolean;
37
+ regexDef: string;
38
+ };
39
+ export type DecomposedRegexJson = {
40
+ parts: DecomposedRegexPartJson[];
41
+ name: string;
42
+ max_length: number;
43
+ location: "body" | "header";
44
+ };
45
+ export type DecomposedRegexPartJson = {
46
+ is_public: boolean;
47
+ regex_def: string;
48
+ };
49
+ export type ExternalInput = {
50
+ name: string;
51
+ maxLength: number;
52
+ };
53
+ export declare enum ZkFramework {
54
+ Circom = "circom"
55
+ }
56
+ export declare enum Status {
57
+ None = 0,
58
+ Draft = 1,
59
+ InProgress = 2,
60
+ Done = 3,
61
+ Failed = 4
62
+ }
63
+ export type VerifierContract = {
64
+ address?: string;
65
+ chain: number;
66
+ };
67
+ export type BlueprintRequest = {
68
+ id?: string;
69
+ title: string;
70
+ description?: string;
71
+ slug?: string;
72
+ tags?: string[];
73
+ email_query?: string;
74
+ circuit_name?: string;
75
+ ignore_body_hash_check?: boolean;
76
+ sha_precompute_selector?: string;
77
+ email_body_max_length?: number;
78
+ email_header_max_length?: number;
79
+ remove_soft_linebreaks?: boolean;
80
+ github_username?: string;
81
+ sender_domain?: string;
82
+ enable_header_masking?: boolean;
83
+ enable_body_masking?: boolean;
84
+ zk_framework?: string;
85
+ is_public?: boolean;
86
+ external_inputs?: ExternalInputResponse[];
87
+ decomposed_regexes: DecomposedRegexResponse[];
88
+ status?: string;
89
+ verifier_contract_address?: string;
90
+ verifier_contract_chain?: number;
91
+ version?: number;
92
+ };
93
+ export type BlueprintResponse = {
94
+ id: string;
95
+ title: string;
96
+ description: string;
97
+ slug: string;
98
+ tags: string[];
99
+ email_query: string;
100
+ circuit_name: string;
101
+ ignore_body_hash_check: boolean;
102
+ sha_precompute_selector: string;
103
+ email_body_max_length: number;
104
+ email_header_max_length?: number;
105
+ remove_soft_linebreaks?: boolean;
106
+ github_username?: string;
107
+ sender_domain: string;
108
+ enable_header_masking?: boolean;
109
+ enable_body_masking?: boolean;
110
+ zk_framework: string;
111
+ is_public: boolean;
112
+ created_at: ServerDate;
113
+ updated_at: ServerDate;
114
+ external_inputs: ExternalInputResponse[];
115
+ decomposed_regexes: DecomposedRegexResponse[];
116
+ status: number;
117
+ verifier_contract_address: string;
118
+ verifier_contract_chain: number;
119
+ version: number;
120
+ stars: number;
121
+ };
122
+ export type ServerDate = {
123
+ seconds: number;
124
+ nanos: number;
125
+ };
126
+ export type ExternalInputResponse = {
127
+ name: string;
128
+ max_length: number;
129
+ };
130
+ export type DecomposedRegexResponse = {
131
+ parts: DecomposedRegexPartResponse[];
132
+ name: string;
133
+ max_length: number;
134
+ location: "body" | "header";
135
+ };
136
+ export type DecomposedRegexPartResponse = {
137
+ is_public: boolean;
138
+ regex_def: string;
139
+ };
140
+ export type ListBlueprintsOptions = {
141
+ skip?: number;
142
+ limit?: number;
143
+ sort?: -1 | 1;
144
+ sortBy?: "updatedAt" | "stars";
145
+ status?: Status[];
146
+ isPublic?: boolean;
147
+ search?: string;
148
+ };
149
+ export type DownloadUrls = Record<string, string>;
150
+ export type ChunkedZkeyUrl = {
151
+ url: string;
152
+ suffix: "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k";
153
+ };
@@ -0,0 +1,6 @@
1
+ export * from "./auth";
2
+ export * from "./blueprint";
3
+ export * from "./proof";
4
+ export * from "./prover";
5
+ export * from "./sdk";
6
+ export * from "./utils";
@@ -0,0 +1,56 @@
1
+ import { ServerDate } from "./blueprint";
2
+ export declare enum ProofStatus {
3
+ None = 0,
4
+ InProgress = 1,
5
+ Done = 2,
6
+ Failed = 3
7
+ }
8
+ export type ProofProps = {
9
+ id: string;
10
+ blueprintId: string;
11
+ input: string;
12
+ proofData?: string;
13
+ publicData?: string;
14
+ publicOutputs?: string[];
15
+ externalInputs?: string;
16
+ status?: ProofStatus;
17
+ startedAt?: Date;
18
+ provedAt?: Date;
19
+ };
20
+ export type ProofResponse = {
21
+ id: string;
22
+ blueprint_id: string;
23
+ input: string;
24
+ proof?: string;
25
+ public?: string;
26
+ external_inputs?: string;
27
+ public_outputs?: string[];
28
+ started_at: ServerDate;
29
+ proved_at?: ServerDate;
30
+ status: number;
31
+ };
32
+ export type ProofRequest = {
33
+ blueprint_id: string;
34
+ input: any;
35
+ external_inputs: any;
36
+ };
37
+ export type GenerateProofInputsParams = {
38
+ emailHeaderMaxLength: number;
39
+ emailBodyMaxLength: number;
40
+ ignoreBodyHashCheck: boolean;
41
+ removeSoftLinebreaks: boolean;
42
+ shaPrecomputeSelector?: string;
43
+ };
44
+ export type GenerateProofInputsParamsInternal = {
45
+ maxHeaderLength: number;
46
+ maxBodyLength: number;
47
+ ignoreBodyHashCheck: boolean;
48
+ removeSoftLinesBreaks: boolean;
49
+ shaPrecomputeSelector?: string;
50
+ };
51
+ export type ProofData = {
52
+ pi_a: [string, string, string];
53
+ pi_b: [[string, string], [string, string], [string, string]];
54
+ pi_c: [string, string, string];
55
+ protocol: string;
56
+ };
@@ -0,0 +1,8 @@
1
+ export type ProverOptions = {
2
+ isLocal: boolean;
3
+ };
4
+ export type ExternalInputInput = {
5
+ name: string;
6
+ value: string;
7
+ maxLength: number;
8
+ };
@@ -0,0 +1,5 @@
1
+ import { Auth } from "./auth";
2
+ export type SdkOptions = {
3
+ auth?: Auth;
4
+ baseUrl?: string;
5
+ };
@@ -0,0 +1,8 @@
1
+ export type ParsedEmail = {
2
+ canonicalizedHeader: string;
3
+ canonicalizedBody: string;
4
+ signature: number[];
5
+ publicKey: any[];
6
+ cleanedBody: string;
7
+ headers: Map<string, string[]>;
8
+ };
@@ -0,0 +1,5 @@
1
+ import { Auth } from "./types";
2
+ /**
3
+ * @returns An array of slugs that the user starred
4
+ */
5
+ export declare function getStarredBlueprints(baseUrl: string, auth: Auth): Promise<string[]>;
@@ -0,0 +1,7 @@
1
+ import { Auth } from "./types/auth";
2
+ export declare function post<T>(url: string, data?: object | null, auth?: Auth): Promise<T>;
3
+ export declare function patch<T>(url: string, data?: object | null, auth?: Auth): Promise<T>;
4
+ export declare function get<T>(url: string, queryParams?: object | null, auth?: Auth): Promise<T>;
5
+ export declare function del<T>(url: string, data?: object | null, auth?: Auth): Promise<T>;
6
+ export declare function startJsonFileDownload(json: string, name?: string): void;
7
+ export declare function getDKIMSelector(emlContent: string): string | null;
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-CfUVEXW_.js");exports.Blueprint=e.Blueprint;exports.Proof=e.Proof;Object.defineProperty(exports,"ProofStatus",{enumerable:!0,get:()=>e.ProofStatus});Object.defineProperty(exports,"Status",{enumerable:!0,get:()=>e.Status});Object.defineProperty(exports,"ZkFramework",{enumerable:!0,get:()=>e.ZkFramework});exports.ZodError=e.ZodError;exports.default=e.index;exports.generateProofInputs=e.generateProofInputs;exports.getDKIMSelector=e.getDKIMSelector;exports.getLoginWithGithubUrl=e.getLoginWithGithubUrl;exports.parseEmail=e.parseEmail;exports.startJsonFileDownload=e.startJsonFileDownload;exports.testBlueprint=e.testBlueprint;exports.testDecomposedRegex=e.testDecomposedRegex;
2
+ //# sourceMappingURL=zk-email-sdk.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zk-email-sdk.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import { h as t, P as e, q as o, S as r, o as l, Z as n, f as i, l as p, k as u, n as f, p as g, j as m, m as d, t as P } from "./index-DnjJIihA.mjs";
2
+ export {
3
+ t as Blueprint,
4
+ e as Proof,
5
+ o as ProofStatus,
6
+ r as Status,
7
+ l as ZkFramework,
8
+ n as ZodError,
9
+ i as default,
10
+ p as generateProofInputs,
11
+ u as getDKIMSelector,
12
+ f as getLoginWithGithubUrl,
13
+ g as parseEmail,
14
+ m as startJsonFileDownload,
15
+ d as testBlueprint,
16
+ P as testDecomposedRegex
17
+ };
18
+ //# sourceMappingURL=zk-email-sdk.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zk-email-sdk.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}