@julach-earzan/email-template-builder 0.1.0 → 0.1.1
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.
|
@@ -5,6 +5,17 @@ export type ApiEndpoint = {
|
|
|
5
5
|
url: string;
|
|
6
6
|
headers?: Record<string, string>;
|
|
7
7
|
};
|
|
8
|
+
export type TemplateListItem = {
|
|
9
|
+
id: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
updatedAt?: string;
|
|
12
|
+
createdAt?: string;
|
|
13
|
+
};
|
|
14
|
+
export type TemplateCrudPayload = {
|
|
15
|
+
name: string;
|
|
16
|
+
html: string;
|
|
17
|
+
template: EmailTemplate;
|
|
18
|
+
};
|
|
8
19
|
export declare function normalizeHttpMethod(method: string): string;
|
|
9
20
|
export declare function parseImageUrlFromResponse(data: unknown, custom?: (json: unknown) => string | undefined): string | undefined;
|
|
10
21
|
export declare function resolveUrlMaybeRelative(href: string, baseUrl: string): string;
|
|
@@ -28,3 +39,29 @@ export declare function postEmailExport(endpoint: ApiEndpoint, payload: {
|
|
|
28
39
|
}) => Record<string, string>;
|
|
29
40
|
}): Promise<Response>;
|
|
30
41
|
export declare function fetchTemplateFromEndpoint(endpoint: ApiEndpoint, credentials?: RequestCredentials): Promise<EmailTemplate>;
|
|
42
|
+
export declare function createTemplateRecord(baseUrl: string, payload: TemplateCrudPayload, options?: {
|
|
43
|
+
credentials?: RequestCredentials;
|
|
44
|
+
headers?: Record<string, string>;
|
|
45
|
+
}): Promise<{
|
|
46
|
+
id: string;
|
|
47
|
+
}>;
|
|
48
|
+
export declare function listTemplateRecords(baseUrl: string, params: {
|
|
49
|
+
page?: number;
|
|
50
|
+
limit?: number;
|
|
51
|
+
search?: string;
|
|
52
|
+
}, options?: {
|
|
53
|
+
credentials?: RequestCredentials;
|
|
54
|
+
headers?: Record<string, string>;
|
|
55
|
+
}): Promise<TemplateListItem[]>;
|
|
56
|
+
export declare function getTemplateRecord(baseUrl: string, id: string, options?: {
|
|
57
|
+
credentials?: RequestCredentials;
|
|
58
|
+
headers?: Record<string, string>;
|
|
59
|
+
}): Promise<EmailTemplate>;
|
|
60
|
+
export declare function updateTemplateRecord(baseUrl: string, id: string, payload: Partial<TemplateCrudPayload>, options?: {
|
|
61
|
+
credentials?: RequestCredentials;
|
|
62
|
+
headers?: Record<string, string>;
|
|
63
|
+
}): Promise<void>;
|
|
64
|
+
export declare function deleteTemplateRecord(baseUrl: string, id: string, options?: {
|
|
65
|
+
credentials?: RequestCredentials;
|
|
66
|
+
headers?: Record<string, string>;
|
|
67
|
+
}): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@julach-earzan/email-template-builder",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "React email template editor with drag-and-drop blocks, preview, HTML export, and optional upload/export API hooks.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "julach-earzan",
|