@affinidi-tdk/iota-browser
Version:
Browser module to fetch data through Affinidi Iota Framework
175 lines (174 loc) • 5.71 kB
TypeScript
import { z } from 'zod';
export declare const EventTypes: {
readonly PrepareRequest: "prepareRequest";
readonly SignedRequest: "signedRequest";
readonly ResponseCallback: "response-callback";
readonly Error: "error";
};
declare const prepareRequestEventSchema: z.ZodObject<z.objectUtil.extendShape<{
eventType: z.ZodNativeEnum<{
readonly PrepareRequest: "prepareRequest";
readonly SignedRequest: "signedRequest";
readonly ResponseCallback: "response-callback";
readonly Error: "error";
}>;
correlationId: z.ZodString;
}, {
eventType: z.ZodLiteral<"prepareRequest">;
queryId: z.ZodString;
tokenMaxAge: z.ZodOptional<z.ZodNumber>;
audience: z.ZodOptional<z.ZodString>;
}>, "strip", z.ZodTypeAny, {
eventType: "prepareRequest";
correlationId: string;
queryId: string;
tokenMaxAge?: number | undefined;
audience?: string | undefined;
}, {
eventType: "prepareRequest";
correlationId: string;
queryId: string;
tokenMaxAge?: number | undefined;
audience?: string | undefined;
}>;
export type PrepareRequestEvent = z.infer<typeof prepareRequestEventSchema>;
export declare const signedRequestEventSchema: z.ZodObject<z.objectUtil.extendShape<{
eventType: z.ZodNativeEnum<{
readonly PrepareRequest: "prepareRequest";
readonly SignedRequest: "signedRequest";
readonly ResponseCallback: "response-callback";
readonly Error: "error";
}>;
correlationId: z.ZodString;
}, {
eventType: z.ZodLiteral<"signedRequest">;
data: z.ZodObject<{
jwt: z.ZodString;
}, "strip", z.ZodTypeAny, {
jwt: string;
}, {
jwt: string;
}>;
}>, "strip", z.ZodTypeAny, {
eventType: "signedRequest";
correlationId: string;
data: {
jwt: string;
};
}, {
eventType: "signedRequest";
correlationId: string;
data: {
jwt: string;
};
}>;
export type SignedRequestEvent = z.infer<typeof signedRequestEventSchema>;
export declare const signedRequestJWTSchema: z.ZodObject<{
client_id: z.ZodString;
}, "strip", z.ZodTypeAny, {
client_id: string;
}, {
client_id: string;
}>;
export type SignedRequestJWT = z.infer<typeof signedRequestJWTSchema>;
export declare const responseCallbackEventSchema: z.ZodObject<z.objectUtil.extendShape<{
eventType: z.ZodNativeEnum<{
readonly PrepareRequest: "prepareRequest";
readonly SignedRequest: "signedRequest";
readonly ResponseCallback: "response-callback";
readonly Error: "error";
}>;
correlationId: z.ZodString;
}, {
eventType: z.ZodLiteral<"response-callback">;
vpToken: z.ZodString;
presentationSubmission: z.ZodString;
}>, "strip", z.ZodTypeAny, {
eventType: "response-callback";
correlationId: string;
vpToken: string;
presentationSubmission: string;
}, {
eventType: "response-callback";
correlationId: string;
vpToken: string;
presentationSubmission: string;
}>;
export type ResponseCallbackEvent = z.infer<typeof responseCallbackEventSchema>;
export declare const errorEventSchema: z.ZodObject<z.objectUtil.extendShape<{
eventType: z.ZodNativeEnum<{
readonly PrepareRequest: "prepareRequest";
readonly SignedRequest: "signedRequest";
readonly ResponseCallback: "response-callback";
readonly Error: "error";
}>;
correlationId: z.ZodString;
}, {
eventType: z.ZodLiteral<"error">;
error: z.ZodObject<{
message: z.ZodString;
httpStatusCode: z.ZodNumber;
details: z.ZodOptional<z.ZodArray<z.ZodObject<{
issue: z.ZodOptional<z.ZodString>;
field: z.ZodOptional<z.ZodString>;
value: z.ZodOptional<z.ZodString>;
location: z.ZodOptional<z.ZodEnum<["body", "path", "query"]>>;
}, "strip", z.ZodTypeAny, {
value?: string | undefined;
issue?: string | undefined;
field?: string | undefined;
location?: "path" | "body" | "query" | undefined;
}, {
value?: string | undefined;
issue?: string | undefined;
field?: string | undefined;
location?: "path" | "body" | "query" | undefined;
}>, "many">>;
}, "strip", z.ZodTypeAny, {
message: string;
httpStatusCode: number;
details?: {
value?: string | undefined;
issue?: string | undefined;
field?: string | undefined;
location?: "path" | "body" | "query" | undefined;
}[] | undefined;
}, {
message: string;
httpStatusCode: number;
details?: {
value?: string | undefined;
issue?: string | undefined;
field?: string | undefined;
location?: "path" | "body" | "query" | undefined;
}[] | undefined;
}>;
}>, "strip", z.ZodTypeAny, {
error: {
message: string;
httpStatusCode: number;
details?: {
value?: string | undefined;
issue?: string | undefined;
field?: string | undefined;
location?: "path" | "body" | "query" | undefined;
}[] | undefined;
};
eventType: "error";
correlationId: string;
}, {
error: {
message: string;
httpStatusCode: number;
details?: {
value?: string | undefined;
issue?: string | undefined;
field?: string | undefined;
location?: "path" | "body" | "query" | undefined;
}[] | undefined;
};
eventType: "error";
correlationId: string;
}>;
export type ErrorEvent = z.infer<typeof errorEventSchema>;
export {};