Sign In

@templatical/core

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@templatical/core - npm Package Compare versions

Comparing version
0.22.0
to
0.23.0
+54
-10
dist/cloud/index.d.ts
import { r as UseEditorReturn$1 } from "../editor-BIIsaIoN.js";
import { AiChatMessage, AiConfig, AuthConfig, AuthRequestOptions, Block, Collaborator, Comment, CommentEvent, CommentThread, CustomFont, EditorState, ExportResult, FontsConfig, HealthCheckResult, McpOperationPayload, MergeTag, PlanConfig, PlanFeatures, SavedBlock, SavedBlocksProvider, ScoringCategory, ScoringFinding, ScoringResult, SdkAuthConfig, Template, TemplateContent, TemplateDefaults, TemplateSettings, TemplateSnapshot, TestEmailConfig, UiTheme, UserConfig, ViewportSize, WebSocketServerConfig } from "@templatical/types";
import { AiChatMessage, AiConfig, AuthConfig, AuthRequestOptions, Block, Collaborator, Comment, CommentEvent, CommentThread, CustomFont, EditorState, ExportResult, FontsConfig, HealthCheckResult, McpOperationPayload, MergeTag, PlanConfig, PlanFeatures, SavedBlock, SavedBlocksProvider, ScoringCategory, ScoringFinding, ScoringResult, SdkAuthConfig, Template, TemplateContent, TemplateDefaults, TemplateSettings, TemplateSnapshot, TestEmailConfig, TestEmailProvider, UiTheme, UserConfig, ViewportSize, WebSocketServerConfig } from "@templatical/types";
import { ComputedRef, DeepReadonly, Ref, ref } from "vue";

@@ -452,20 +452,64 @@ import { Channel, PresenceChannel } from "pusher-js";

//#region src/cloud/test-email.d.ts
/**
* Cloud's test-email *configuration* — whether the project has the feature, who
* may be sent to, and the signature that lets the backend verify that list.
*
* Sending itself lives in `createCloudTestEmailProvider`, which plugs into the
* shared `useTestEmailFeature` seam in `@templatical/editor` alongside a
* consumer's own sender. Keeping the send body in exactly one place is the point:
* both editors then drive identical UI, state and error handling, so the sending
* spinner, the inline error and the success confirmation can't drift apart.
*/
interface UseTestEmailOptions {
authManager: AuthManager;
getTemplateId: () => string | null;
save: () => Promise<Template>;
exportHtml: (templateId: string) => Promise<ExportResult>;
onError?: (error: Error) => void;
/** Gates reading the config off the auth manager until the JWT has resolved. */
isAuthReady?: Ref<boolean>;
onBeforeTestEmail?: (html: string) => string | Promise<string>;
}
interface UseTestEmailReturn {
/** Whether the project's token carries a test-email config at all. */
isEnabled: ComputedRef<boolean>;
/**
* Addresses the project permits. Empty until auth resolves — read it
* reactively, never snapshot it, or it stays empty for the session.
*/
allowedEmails: ComputedRef<string[]>;
isSending: Ref<boolean>;
error: Ref<string | null>;
sendTestEmail: (recipient: string) => Promise<void>;
/** The signature accompanying {@link allowedEmails}, or `null` when disabled. */
getSignature: () => string | null;
}
declare function useTestEmail(options: UseTestEmailOptions): UseTestEmailReturn;
//#endregion
//#region src/cloud/test-email-provider.d.ts
interface CreateCloudTestEmailProviderOptions {
authManager: AuthManager;
getTemplateId: () => string | null;
save: () => Promise<Template>;
exportHtml: (templateId: string) => Promise<ExportResult>;
/**
* The project's allowed recipients, from the signed JWT.
*
* Taken as a `ComputedRef` rather than an array because it only becomes
* populated once auth resolves — see the getter note on the returned provider.
*/
allowedEmails: ComputedRef<string[]>;
/** The signature that lets the backend verify {@link allowedEmails}. */
getSignature: () => string | null;
onBeforeTestEmail?: (html: string) => string | Promise<string>;
}
/**
* Templatical Cloud's test-email sender, shaped as a {@link TestEmailProvider}
* so it plugs into the same editor seam a consumer's own sender would.
*
* Two things about it are deliberately unlike a BYO provider:
*
* - **It ignores `payload.content` and `payload.allowedRecipients`.** Cloud saves
* the template, has its backend render the HTML, and derives the allowlist plus
* its signature from the auth manager. Trusting the echoed payload would swap a
* server-signed list for an unsigned browser value. The contract is "send a test
* of the current template" — how an adapter obtains the bytes is its business,
* so this is honest rather than a smell. Don't "fix" it.
* - **It never sets `includeMjml`.** Cloud renders server-side, so the editor
* should not spend a render pass producing MJML nobody reads.
*/
declare function createCloudTestEmailProvider(options: CreateCloudTestEmailProviderOptions): TestEmailProvider;
//#endregion
//#region src/cloud/export.d.ts

@@ -512,3 +556,3 @@ interface UseExportOptions {

//#endregion
export { API_ROUTES, ApiClient, type AuthConfig, AuthManager, type AuthRequestOptions, type CommentBroadcastPayload, type DesignReferenceInput, type PresenceMember, type SdkAuthConfig, type TestEmailConfig, type UseAiChatOptions, type UseAiChatReturn, type UseAiConfigReturn, type UseAiRewriteOptions, type UseAiRewriteReturn, type UseCollaborationOptions, type UseCollaborationReturn, type UseCommentListenerOptions, type UseCommentsOptions, type UseCommentsReturn, type UseDesignReferenceOptions, type UseDesignReferenceReturn, type UseEditorOptions, type UseEditorReturn, type UseExportOptions, type UseExportReturn, type UseMcpListenerOptions, type UsePlanConfigOptions, type UsePlanConfigReturn, type UseSnapshotHistoryOptions, type UseSnapshotHistoryReturn, type UseTemplateScoringOptions, type UseTemplateScoringReturn, type UseTestEmailOptions, type UseTestEmailReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UserConfig, WebSocketClient, type WebSocketClientOptions, type WebSocketConfig, buildUrl, createCloudSavedBlocksProvider, createSdkAuthManager, handleOperation, performHealthCheck, resolveWebSocketConfig, useAiChat, useAiConfig, useAiRewrite, useCollaboration, useCollaborationBroadcast, useCommentListener, useComments, useDesignReference, useEditor, useExport, useMcpListener, usePlanConfig, useSnapshotHistory, useTemplateScoring, useTestEmail, useWebSocket };
export { API_ROUTES, ApiClient, type AuthConfig, AuthManager, type AuthRequestOptions, type CommentBroadcastPayload, type CreateCloudTestEmailProviderOptions, type DesignReferenceInput, type PresenceMember, type SdkAuthConfig, type TestEmailConfig, type UseAiChatOptions, type UseAiChatReturn, type UseAiConfigReturn, type UseAiRewriteOptions, type UseAiRewriteReturn, type UseCollaborationOptions, type UseCollaborationReturn, type UseCommentListenerOptions, type UseCommentsOptions, type UseCommentsReturn, type UseDesignReferenceOptions, type UseDesignReferenceReturn, type UseEditorOptions, type UseEditorReturn, type UseExportOptions, type UseExportReturn, type UseMcpListenerOptions, type UsePlanConfigOptions, type UsePlanConfigReturn, type UseSnapshotHistoryOptions, type UseSnapshotHistoryReturn, type UseTemplateScoringOptions, type UseTemplateScoringReturn, type UseTestEmailOptions, type UseTestEmailReturn, type UseWebSocketOptions, type UseWebSocketReturn, type UserConfig, WebSocketClient, type WebSocketClientOptions, type WebSocketConfig, buildUrl, createCloudSavedBlocksProvider, createCloudTestEmailProvider, createSdkAuthManager, handleOperation, performHealthCheck, resolveWebSocketConfig, useAiChat, useAiConfig, useAiRewrite, useCollaboration, useCollaborationBroadcast, useCommentListener, useComments, useDesignReference, useEditor, useExport, useMcpListener, usePlanConfig, useSnapshotHistory, useTemplateScoring, useTestEmail, useWebSocket };
//# sourceMappingURL=index.d.ts.map
+2
-2
{
"name": "@templatical/core",
"description": "Framework-agnostic editor logic for Templatical email editor",
"version": "0.22.0",
"version": "0.23.0",
"bugs": "https://github.com/templatical/sdk/issues",
"dependencies": {
"@vue/reactivity": "^3.5.40",
"@templatical/types": "0.22.0"
"@templatical/types": "0.23.0"
},

@@ -10,0 +10,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display