@templatical/core 0.49.0 → 0.50.0
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.
- package/README.md +1 -1
- package/dist/cloud/index.d.ts +3 -100
- package/dist/cloud/index.js +1 -627
- package/dist/cloud/index.js.map +1 -1
- package/dist/index.d.ts +32 -21
- package/dist/index.js +125 -189
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ watch(editor.content, (next) => {
|
|
|
57
57
|
|
|
58
58
|
## Cloud subpath
|
|
59
59
|
|
|
60
|
-
The `@templatical/core/cloud` subpath provides Templatical Cloud integrations (Auth, API client, WebSocket,
|
|
60
|
+
The `@templatical/core/cloud` subpath provides Templatical Cloud integrations (Auth, API client, WebSocket, comments, and `createCloudSavedBlocksProvider`). Used by `@templatical/editor`'s `initCloud()`.
|
|
61
61
|
|
|
62
62
|
## Documentation
|
|
63
63
|
|
package/dist/cloud/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ComputedRef, Ref
|
|
1
|
+
import { AuthConfig, AuthRequestOptions, Block, CommentResponse, CommentsProvider, CustomFont, ExportResult, FontsConfig, HealthCheckResult, MediaProvider, PlanConfig, PlanFeatures, RenderProvider, SavedBlock, SavedBlocksProvider, SdkAuthConfig, Template, TemplateContent, TemplatePatch, TemplateVersionResponse, TemplatesProvider, TestEmailConfig, TestEmailProvider, UserConfig, VersionHistoryProvider, WebSocketServerConfig } from "@templatical/types";
|
|
2
|
+
import { ComputedRef, Ref } from "vue";
|
|
3
3
|
import { Channel, PresenceChannel } from "pusher-js";
|
|
4
4
|
//#region src/cloud/auth.d.ts
|
|
5
5
|
/**
|
|
@@ -233,13 +233,6 @@ export declare const API_ROUTES: {
|
|
|
233
233
|
readonly "comments.update": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/comments/{comment}";
|
|
234
234
|
readonly "comments.destroy": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/comments/{comment}";
|
|
235
235
|
readonly "comments.resolve": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/comments/{comment}/resolve";
|
|
236
|
-
readonly "ai.generate": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/ai/generate";
|
|
237
|
-
readonly "ai.conversationMessages": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/ai/conversation-messages";
|
|
238
|
-
readonly "ai.suggestions": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/ai/suggestions";
|
|
239
|
-
readonly "ai.rewriteText": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/ai/rewrite-text";
|
|
240
|
-
readonly "ai.score": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/ai/score";
|
|
241
|
-
readonly "ai.fixFinding": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/ai/fix-finding";
|
|
242
|
-
readonly "ai.generateFromDesign": "/api/v1/projects/{project}/tenants/{tenant}/templates/{template}/ai/generate-from-design";
|
|
243
236
|
readonly "media.upload": "/api/v1/projects/{project}/tenants/{tenant}/media/upload";
|
|
244
237
|
readonly "media.browse": "/api/v1/projects/{project}/tenants/{tenant}/media/browse";
|
|
245
238
|
readonly "media.delete": "/api/v1/projects/{project}/tenants/{tenant}/media/delete";
|
|
@@ -291,96 +284,6 @@ export declare class WebSocketClient {
|
|
|
291
284
|
get isConnected(): boolean;
|
|
292
285
|
}
|
|
293
286
|
//#endregion
|
|
294
|
-
//#region src/cloud/ai-chat.d.ts
|
|
295
|
-
interface UseAiChatOptions {
|
|
296
|
-
authManager: AuthManager;
|
|
297
|
-
getTemplateId: () => string | null;
|
|
298
|
-
onApply?: (content: TemplateContent) => void;
|
|
299
|
-
onError?: (error: Error) => void;
|
|
300
|
-
}
|
|
301
|
-
interface UseAiChatReturn {
|
|
302
|
-
messages: ReturnType<typeof ref<AiChatMessage[]>>;
|
|
303
|
-
isGenerating: ReturnType<typeof ref<boolean>>;
|
|
304
|
-
isLoadingHistory: ReturnType<typeof ref<boolean>>;
|
|
305
|
-
isLastChangeReverted: ReturnType<typeof ref<boolean>>;
|
|
306
|
-
lastApplyMessageId: ReturnType<typeof ref<string | null>>;
|
|
307
|
-
error: ReturnType<typeof ref<string | null>>;
|
|
308
|
-
failedPrompt: ReturnType<typeof ref<string | null>>;
|
|
309
|
-
suggestions: ReturnType<typeof ref<string[]>>;
|
|
310
|
-
isLoadingSuggestions: ReturnType<typeof ref<boolean>>;
|
|
311
|
-
sendPrompt: (prompt: string, currentContent: TemplateContent, mergeTags: MergeTag[]) => Promise<TemplateContent | null>;
|
|
312
|
-
toggleLastRevert: () => void;
|
|
313
|
-
loadConversation: () => Promise<void>;
|
|
314
|
-
loadSuggestions: (currentContent: TemplateContent, mergeTags: MergeTag[]) => Promise<void>;
|
|
315
|
-
clearChat: () => void;
|
|
316
|
-
}
|
|
317
|
-
export declare function useAiChat(options: UseAiChatOptions): UseAiChatReturn;
|
|
318
|
-
//#endregion
|
|
319
|
-
//#region src/cloud/ai-rewrite.d.ts
|
|
320
|
-
interface UseAiRewriteOptions {
|
|
321
|
-
authManager: AuthManager;
|
|
322
|
-
getTemplateId: () => string | null;
|
|
323
|
-
}
|
|
324
|
-
interface UseAiRewriteReturn {
|
|
325
|
-
isRewriting: ReturnType<typeof ref<boolean>>;
|
|
326
|
-
streamingText: ReturnType<typeof ref<string>>;
|
|
327
|
-
previousContent: ReturnType<typeof ref<string | null>>;
|
|
328
|
-
rewrittenContent: ReturnType<typeof ref<string | null>>;
|
|
329
|
-
isReverted: ReturnType<typeof ref<boolean>>;
|
|
330
|
-
error: ReturnType<typeof ref<string | null>>;
|
|
331
|
-
rewrite: (content: string, instruction: string, mergeTags: MergeTag[]) => Promise<string | null>;
|
|
332
|
-
undo: () => string | null;
|
|
333
|
-
redo: () => string | null;
|
|
334
|
-
reset: () => void;
|
|
335
|
-
}
|
|
336
|
-
export declare function useAiRewrite(options: UseAiRewriteOptions): UseAiRewriteReturn;
|
|
337
|
-
//#endregion
|
|
338
|
-
//#region src/cloud/ai-config.d.ts
|
|
339
|
-
interface UseAiConfigReturn {
|
|
340
|
-
isFeatureEnabled: (feature: keyof AiConfig) => boolean;
|
|
341
|
-
hasAnyMenuFeature: ComputedRef<boolean>;
|
|
342
|
-
}
|
|
343
|
-
export declare function useAiConfig(config?: AiConfig | false): UseAiConfigReturn;
|
|
344
|
-
//#endregion
|
|
345
|
-
//#region src/cloud/template-scoring.d.ts
|
|
346
|
-
interface UseTemplateScoringOptions {
|
|
347
|
-
authManager: AuthManager;
|
|
348
|
-
getTemplateId: () => string | null;
|
|
349
|
-
}
|
|
350
|
-
interface UseTemplateScoringReturn {
|
|
351
|
-
isScoring: ReturnType<typeof ref<boolean>>;
|
|
352
|
-
scoringResult: ReturnType<typeof ref<ScoringResult | null>>;
|
|
353
|
-
error: ReturnType<typeof ref<string | null>>;
|
|
354
|
-
fixingFindingId: ReturnType<typeof ref<string | null>>;
|
|
355
|
-
fixStreamingText: ReturnType<typeof ref<string>>;
|
|
356
|
-
fixError: ReturnType<typeof ref<string | null>>;
|
|
357
|
-
score: (content: TemplateContent, mergeTags: MergeTag[]) => Promise<ScoringResult | null>;
|
|
358
|
-
fixFinding: (blockContent: string, finding: ScoringFinding, mergeTags: MergeTag[]) => Promise<string | null>;
|
|
359
|
-
removeFinding: (category: ScoringCategory, findingId: string) => void;
|
|
360
|
-
reset: () => void;
|
|
361
|
-
}
|
|
362
|
-
export declare function useTemplateScoring(options: UseTemplateScoringOptions): UseTemplateScoringReturn;
|
|
363
|
-
//#endregion
|
|
364
|
-
//#region src/cloud/design-reference.d.ts
|
|
365
|
-
interface UseDesignReferenceOptions {
|
|
366
|
-
authManager: AuthManager;
|
|
367
|
-
getTemplateId: () => string | null;
|
|
368
|
-
onApply?: (content: TemplateContent) => void;
|
|
369
|
-
onError?: (error: Error) => void;
|
|
370
|
-
}
|
|
371
|
-
interface UseDesignReferenceReturn {
|
|
372
|
-
isGenerating: ReturnType<typeof ref<boolean>>;
|
|
373
|
-
error: ReturnType<typeof ref<string | null>>;
|
|
374
|
-
generate: (input: DesignReferenceInput) => Promise<TemplateContent | null>;
|
|
375
|
-
reset: () => void;
|
|
376
|
-
}
|
|
377
|
-
interface DesignReferenceInput {
|
|
378
|
-
prompt?: string;
|
|
379
|
-
imageUpload?: File;
|
|
380
|
-
pdfUpload?: File;
|
|
381
|
-
}
|
|
382
|
-
export declare function useDesignReference(options: UseDesignReferenceOptions): UseDesignReferenceReturn;
|
|
383
|
-
//#endregion
|
|
384
287
|
//#region src/cloud/comments-provider.d.ts
|
|
385
288
|
/**
|
|
386
289
|
* The two methods this adapter needs from a Pusher channel, named structurally.
|
|
@@ -690,5 +593,5 @@ interface HealthCheckOptions {
|
|
|
690
593
|
}
|
|
691
594
|
export declare function performHealthCheck(options?: HealthCheckOptions): Promise<HealthCheckResult>;
|
|
692
595
|
//#endregion
|
|
693
|
-
export type { AuthConfig, AuthRequestOptions, CloudMediaBrowseParams, CloudMediaBrowseResponse, CloudMediaFolder, CloudMediaItem, CloudMediaUsageInfo, CloudMediaUsageResponse, CreateCloudCommentsProviderOptions, CreateCloudRenderProviderOptions, CreateCloudTestEmailProviderOptions,
|
|
596
|
+
export type { AuthConfig, AuthRequestOptions, CloudMediaBrowseParams, CloudMediaBrowseResponse, CloudMediaFolder, CloudMediaItem, CloudMediaUsageInfo, CloudMediaUsageResponse, CreateCloudCommentsProviderOptions, CreateCloudRenderProviderOptions, CreateCloudTestEmailProviderOptions, ExportFontsPayload, PresenceMember, RealtimeChannel, SdkAuthConfig, TestEmailConfig, UseExportOptions, UseExportReturn, UsePlanConfigOptions, UsePlanConfigReturn, UseTestEmailOptions, UseTestEmailReturn, UseWebSocketOptions, UseWebSocketReturn, UserConfig, WebSocketClientOptions, WebSocketConfig };
|
|
694
597
|
//# sourceMappingURL=index.d.ts.map
|