@dscvr-one/canvas-interface
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -449,2 +449,171 @@ import * as zod from 'zod'; | ||
}>; | ||
declare const createPostRequestSchema: zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:create-post-request">; | ||
payload: zod.ZodObject<{ | ||
htmlContent: zod.ZodString; | ||
}, "strip", zod.ZodTypeAny, { | ||
htmlContent: string; | ||
}, { | ||
htmlContent: string; | ||
}>; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:create-post-request"; | ||
payload: { | ||
htmlContent: string; | ||
}; | ||
}, { | ||
type: "user:create-post-request"; | ||
payload: { | ||
htmlContent: string; | ||
}; | ||
}>; | ||
declare const createPostResponseSchema: zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:create-post-response">; | ||
untrusted: zod.ZodUnion<[zod.ZodObject<{ | ||
success: zod.ZodLiteral<true>; | ||
contentId: zod.ZodBigInt; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: true; | ||
contentId: bigint; | ||
}, { | ||
success: true; | ||
contentId: bigint; | ||
}>, zod.ZodObject<{ | ||
success: zod.ZodLiteral<false>; | ||
errorReason: zod.ZodEnum<["user-cancelled", "error"]>; | ||
error: zod.ZodOptional<zod.ZodString>; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}>]>; | ||
trustedBytes: zod.ZodString; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:create-post-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
contentId: bigint; | ||
}; | ||
trustedBytes: string; | ||
}, { | ||
type: "user:create-post-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
contentId: bigint; | ||
}; | ||
trustedBytes: string; | ||
}>; | ||
declare const copyToClipboardRequestSchema: zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:copy-to-clipboard-request">; | ||
payload: zod.ZodObject<{ | ||
content: zod.ZodString; | ||
}, "strip", zod.ZodTypeAny, { | ||
content: string; | ||
}, { | ||
content: string; | ||
}>; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:copy-to-clipboard-request"; | ||
payload: { | ||
content: string; | ||
}; | ||
}, { | ||
type: "user:copy-to-clipboard-request"; | ||
payload: { | ||
content: string; | ||
}; | ||
}>; | ||
declare const copyToClipboardResponseSchema: zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:copy-to-clipboard-response">; | ||
untrusted: zod.ZodUnion<[zod.ZodObject<{ | ||
success: zod.ZodLiteral<true>; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: true; | ||
}, { | ||
success: true; | ||
}>, zod.ZodObject<{ | ||
success: zod.ZodLiteral<false>; | ||
errorReason: zod.ZodEnum<["user-cancelled", "error"]>; | ||
error: zod.ZodOptional<zod.ZodString>; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}>]>; | ||
trustedBytes: zod.ZodString; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:copy-to-clipboard-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
}; | ||
trustedBytes: string; | ||
}, { | ||
type: "user:copy-to-clipboard-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
}; | ||
trustedBytes: string; | ||
}>; | ||
declare const contentReactionResponseSchema: zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:content-reaction-response">; | ||
untrusted: zod.ZodUnion<[zod.ZodObject<{ | ||
status: zod.ZodLiteral<"reacted">; | ||
reaction: zod.ZodString; | ||
}, "strip", zod.ZodTypeAny, { | ||
status: "reacted"; | ||
reaction: string; | ||
}, { | ||
status: "reacted"; | ||
reaction: string; | ||
}>, zod.ZodObject<{ | ||
status: zod.ZodLiteral<"cleared">; | ||
}, "strip", zod.ZodTypeAny, { | ||
status: "cleared"; | ||
}, { | ||
status: "cleared"; | ||
}>]>; | ||
trustedBytes: zod.ZodString; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:content-reaction-response"; | ||
untrusted: { | ||
status: "reacted"; | ||
reaction: string; | ||
} | { | ||
status: "cleared"; | ||
}; | ||
trustedBytes: string; | ||
}, { | ||
type: "user:content-reaction-response"; | ||
untrusted: { | ||
status: "reacted"; | ||
reaction: string; | ||
} | { | ||
status: "cleared"; | ||
}; | ||
trustedBytes: string; | ||
}>; | ||
interface InitialInteractionRequest extends BaseClientMessage<typeof initialInteractionRequestSchema> { | ||
@@ -465,5 +634,20 @@ } | ||
} | ||
interface CreatePostRequest extends BaseClientMessage<typeof createPostRequestSchema> { | ||
} | ||
interface CreatePostResponse extends BaseHostMessage<typeof createPostResponseSchema> { | ||
} | ||
interface CopyToClipboardRequest extends BaseClientMessage<typeof copyToClipboardRequestSchema> { | ||
} | ||
interface CopyToClipboardResponse extends BaseHostMessage<typeof copyToClipboardResponseSchema> { | ||
} | ||
interface ContentReactionResponse extends BaseHostMessage<typeof contentReactionResponseSchema> { | ||
} | ||
type user_ConnectWalletRequest = ConnectWalletRequest; | ||
type user_ConnectWalletResponse = ConnectWalletResponse; | ||
type user_ContentReactionResponse = ContentReactionResponse; | ||
type user_CopyToClipboardRequest = CopyToClipboardRequest; | ||
type user_CopyToClipboardResponse = CopyToClipboardResponse; | ||
type user_CreatePostRequest = CreatePostRequest; | ||
type user_CreatePostResponse = CreatePostResponse; | ||
type user_InitialInteractionRequest = InitialInteractionRequest; | ||
@@ -477,2 +661,7 @@ type user_OpenLnkRequest = OpenLnkRequest; | ||
declare const user_connectWalletResponseSchema: typeof connectWalletResponseSchema; | ||
declare const user_contentReactionResponseSchema: typeof contentReactionResponseSchema; | ||
declare const user_copyToClipboardRequestSchema: typeof copyToClipboardRequestSchema; | ||
declare const user_copyToClipboardResponseSchema: typeof copyToClipboardResponseSchema; | ||
declare const user_createPostRequestSchema: typeof createPostRequestSchema; | ||
declare const user_createPostResponseSchema: typeof createPostResponseSchema; | ||
declare const user_initialInteractionRequestSchema: typeof initialInteractionRequestSchema; | ||
@@ -485,3 +674,3 @@ declare const user_openLnkRequestSchema: typeof openLnkRequestSchema; | ||
declare namespace user { | ||
export { type user_ConnectWalletRequest as ConnectWalletRequest, type user_ConnectWalletResponse as ConnectWalletResponse, type user_InitialInteractionRequest as InitialInteractionRequest, type user_OpenLnkRequest as OpenLnkRequest, type user_ResizeRequest as ResizeRequest, type user_SignAndSendTransactionRequest as SignAndSendTransactionRequest, type user_SignAndSendTransactionResponse as SignAndSendTransactionResponse, type user_UnsignedTransaction as UnsignedTransaction, user_connectWalletRequestSchema as connectWalletRequestSchema, user_connectWalletResponseSchema as connectWalletResponseSchema, user_initialInteractionRequestSchema as initialInteractionRequestSchema, user_openLnkRequestSchema as openLnkRequestSchema, user_resizeRequestSchema as resizeRequestSchema, user_signAndSendTransactionRequestSchema as signAndSendTransactionRequestSchema, user_signAndSendTransactionResponseSchema as signAndSendTransactionResponseSchema, user_unsignedTransactionSchema as unsignedTransactionSchema }; | ||
export { type user_ConnectWalletRequest as ConnectWalletRequest, type user_ConnectWalletResponse as ConnectWalletResponse, type user_ContentReactionResponse as ContentReactionResponse, type user_CopyToClipboardRequest as CopyToClipboardRequest, type user_CopyToClipboardResponse as CopyToClipboardResponse, type user_CreatePostRequest as CreatePostRequest, type user_CreatePostResponse as CreatePostResponse, type user_InitialInteractionRequest as InitialInteractionRequest, type user_OpenLnkRequest as OpenLnkRequest, type user_ResizeRequest as ResizeRequest, type user_SignAndSendTransactionRequest as SignAndSendTransactionRequest, type user_SignAndSendTransactionResponse as SignAndSendTransactionResponse, type user_UnsignedTransaction as UnsignedTransaction, user_connectWalletRequestSchema as connectWalletRequestSchema, user_connectWalletResponseSchema as connectWalletResponseSchema, user_contentReactionResponseSchema as contentReactionResponseSchema, user_copyToClipboardRequestSchema as copyToClipboardRequestSchema, user_copyToClipboardResponseSchema as copyToClipboardResponseSchema, user_createPostRequestSchema as createPostRequestSchema, user_createPostResponseSchema as createPostResponseSchema, user_initialInteractionRequestSchema as initialInteractionRequestSchema, user_openLnkRequestSchema as openLnkRequestSchema, user_resizeRequestSchema as resizeRequestSchema, user_signAndSendTransactionRequestSchema as signAndSendTransactionRequestSchema, user_signAndSendTransactionResponseSchema as signAndSendTransactionResponseSchema, user_unsignedTransactionSchema as unsignedTransactionSchema }; | ||
} | ||
@@ -606,2 +795,40 @@ | ||
}; | ||
}>, zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:create-post-request">; | ||
payload: zod.ZodObject<{ | ||
htmlContent: zod.ZodString; | ||
}, "strip", zod.ZodTypeAny, { | ||
htmlContent: string; | ||
}, { | ||
htmlContent: string; | ||
}>; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:create-post-request"; | ||
payload: { | ||
htmlContent: string; | ||
}; | ||
}, { | ||
type: "user:create-post-request"; | ||
payload: { | ||
htmlContent: string; | ||
}; | ||
}>, zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:copy-to-clipboard-request">; | ||
payload: zod.ZodObject<{ | ||
content: zod.ZodString; | ||
}, "strip", zod.ZodTypeAny, { | ||
content: string; | ||
}, { | ||
content: string; | ||
}>; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:copy-to-clipboard-request"; | ||
payload: { | ||
content: string; | ||
}; | ||
}, { | ||
type: "user:copy-to-clipboard-request"; | ||
payload: { | ||
content: string; | ||
}; | ||
}>]; | ||
@@ -814,2 +1041,128 @@ declare const coreHostSchemas: readonly [zod.ZodObject<{ | ||
trustedBytes: string; | ||
}>, zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:create-post-response">; | ||
untrusted: zod.ZodUnion<[zod.ZodObject<{ | ||
success: zod.ZodLiteral<true>; | ||
contentId: zod.ZodBigInt; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: true; | ||
contentId: bigint; | ||
}, { | ||
success: true; | ||
contentId: bigint; | ||
}>, zod.ZodObject<{ | ||
success: zod.ZodLiteral<false>; | ||
errorReason: zod.ZodEnum<["user-cancelled", "error"]>; | ||
error: zod.ZodOptional<zod.ZodString>; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}>]>; | ||
trustedBytes: zod.ZodString; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:create-post-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
contentId: bigint; | ||
}; | ||
trustedBytes: string; | ||
}, { | ||
type: "user:create-post-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
contentId: bigint; | ||
}; | ||
trustedBytes: string; | ||
}>, zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:copy-to-clipboard-response">; | ||
untrusted: zod.ZodUnion<[zod.ZodObject<{ | ||
success: zod.ZodLiteral<true>; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: true; | ||
}, { | ||
success: true; | ||
}>, zod.ZodObject<{ | ||
success: zod.ZodLiteral<false>; | ||
errorReason: zod.ZodEnum<["user-cancelled", "error"]>; | ||
error: zod.ZodOptional<zod.ZodString>; | ||
}, "strip", zod.ZodTypeAny, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}, { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
}>]>; | ||
trustedBytes: zod.ZodString; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:copy-to-clipboard-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
}; | ||
trustedBytes: string; | ||
}, { | ||
type: "user:copy-to-clipboard-response"; | ||
untrusted: { | ||
success: false; | ||
errorReason: "error" | "user-cancelled"; | ||
error?: string | undefined; | ||
} | { | ||
success: true; | ||
}; | ||
trustedBytes: string; | ||
}>, zod.ZodObject<{ | ||
type: zod.ZodLiteral<"user:content-reaction-response">; | ||
untrusted: zod.ZodUnion<[zod.ZodObject<{ | ||
status: zod.ZodLiteral<"reacted">; | ||
reaction: zod.ZodString; | ||
}, "strip", zod.ZodTypeAny, { | ||
status: "reacted"; | ||
reaction: string; | ||
}, { | ||
status: "reacted"; | ||
reaction: string; | ||
}>, zod.ZodObject<{ | ||
status: zod.ZodLiteral<"cleared">; | ||
}, "strip", zod.ZodTypeAny, { | ||
status: "cleared"; | ||
}, { | ||
status: "cleared"; | ||
}>]>; | ||
trustedBytes: zod.ZodString; | ||
}, zod.UnknownKeysParam, zod.ZodTypeAny, { | ||
type: "user:content-reaction-response"; | ||
untrusted: { | ||
status: "reacted"; | ||
reaction: string; | ||
} | { | ||
status: "cleared"; | ||
}; | ||
trustedBytes: string; | ||
}, { | ||
type: "user:content-reaction-response"; | ||
untrusted: { | ||
status: "reacted"; | ||
reaction: string; | ||
} | { | ||
status: "cleared"; | ||
}; | ||
trustedBytes: string; | ||
}>]; | ||
@@ -816,0 +1169,0 @@ type CoreClientMessageSchema = (typeof coreClientSchemas)[number]; |
@@ -107,2 +107,7 @@ var __defProp = Object.defineProperty; | ||
connectWalletResponseSchema: () => connectWalletResponseSchema, | ||
contentReactionResponseSchema: () => contentReactionResponseSchema, | ||
copyToClipboardRequestSchema: () => copyToClipboardRequestSchema, | ||
copyToClipboardResponseSchema: () => copyToClipboardResponseSchema, | ||
createPostRequestSchema: () => createPostRequestSchema, | ||
createPostResponseSchema: () => createPostResponseSchema, | ||
initialInteractionRequestSchema: () => initialInteractionRequestSchema, | ||
@@ -172,2 +177,45 @@ openLnkRequestSchema: () => openLnkRequestSchema, | ||
); | ||
var createPostRequestSchema = createClientMessageSchema( | ||
"user:create-post-request", | ||
zod3.object({ | ||
htmlContent: zod3.string() | ||
}) | ||
); | ||
var createPostResponseSchema = createHostMessageSchema( | ||
"user:create-post-response", | ||
zod3.union([ | ||
zod3.object({ | ||
success: zod3.literal(true), | ||
contentId: zod3.bigint() | ||
}), | ||
createFailedResponsePayload(["user-cancelled", "error"]) | ||
]) | ||
); | ||
var copyToClipboardRequestSchema = createClientMessageSchema( | ||
"user:copy-to-clipboard-request", | ||
zod3.object({ | ||
content: zod3.string() | ||
}) | ||
); | ||
var copyToClipboardResponseSchema = createHostMessageSchema( | ||
"user:copy-to-clipboard-response", | ||
zod3.union([ | ||
zod3.object({ | ||
success: zod3.literal(true) | ||
}), | ||
createFailedResponsePayload(["user-cancelled", "error"]) | ||
]) | ||
); | ||
var contentReactionResponseSchema = createHostMessageSchema( | ||
"user:content-reaction-response", | ||
zod3.union([ | ||
zod3.object({ | ||
status: zod3.literal("reacted"), | ||
reaction: zod3.string() | ||
}), | ||
zod3.object({ | ||
status: zod3.literal("cleared") | ||
}) | ||
]) | ||
); | ||
@@ -182,3 +230,5 @@ // src/schema/core.ts | ||
signAndSendTransactionRequestSchema, | ||
openLnkRequestSchema | ||
openLnkRequestSchema, | ||
createPostRequestSchema, | ||
copyToClipboardRequestSchema | ||
]; | ||
@@ -189,3 +239,6 @@ var coreHostSchemas = [ | ||
connectWalletResponseSchema, | ||
signAndSendTransactionResponseSchema | ||
signAndSendTransactionResponseSchema, | ||
createPostResponseSchema, | ||
copyToClipboardResponseSchema, | ||
contentReactionResponseSchema | ||
]; | ||
@@ -192,0 +245,0 @@ var parseCoreClientMessage = (message) => { |
{ | ||
"name": "@dscvr-one/canvas-interface", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Types for iframes to interact with dscvr", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
134732
1804