@lovable.dev/email-js 0.0.1 → 0.0.2
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/dist/index.cjs +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1 -1
- package/package.json +11 -10
package/dist/index.cjs
CHANGED
|
@@ -41,7 +41,7 @@ async function sendLovableEmail(payload, options) {
|
|
|
41
41
|
const sendUrl = options.sendUrl;
|
|
42
42
|
const apiBaseUrl = options.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
43
43
|
const url = sendUrl || `${apiBaseUrl.replace(/\/$/, "")}${DEFAULT_SEND_PATH}`;
|
|
44
|
-
const idempotencyKey = options.idempotencyKey ?? payload.run_id;
|
|
44
|
+
const idempotencyKey = options.idempotencyKey ?? payload.idempotency_key ?? payload.run_id;
|
|
45
45
|
const headers = {
|
|
46
46
|
[authHeader]: buildAuthHeaderValue(apiKey),
|
|
47
47
|
"Content-Type": "application/json"
|
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { EmailWebhookPayload } from '@lovable.dev/webhooks-js';
|
|
|
2
2
|
export { EmailWebhookPayload } from '@lovable.dev/webhooks-js';
|
|
3
3
|
|
|
4
4
|
interface EmailSendRequest {
|
|
5
|
-
run_id
|
|
5
|
+
run_id?: string;
|
|
6
6
|
to: string;
|
|
7
7
|
from: string;
|
|
8
8
|
sender_domain?: string;
|
|
@@ -13,6 +13,10 @@ interface EmailSendRequest {
|
|
|
13
13
|
reply_to?: string;
|
|
14
14
|
identity_id?: string;
|
|
15
15
|
test_mode?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
external_id?: string;
|
|
18
|
+
idempotency_key?: string;
|
|
19
|
+
unsubscribe_token?: string;
|
|
16
20
|
}
|
|
17
21
|
interface EmailSendResponse {
|
|
18
22
|
success: boolean;
|
|
@@ -32,4 +36,4 @@ declare function sendLovableEmail(payload: EmailSendRequest, options: SendEmailO
|
|
|
32
36
|
|
|
33
37
|
declare function parseEmailWebhookPayload(body: string): EmailWebhookPayload;
|
|
34
38
|
|
|
35
|
-
export { EmailSendRequest, EmailSendResponse, SendEmailOptions, parseEmailWebhookPayload, sendLovableEmail };
|
|
39
|
+
export { type EmailSendRequest, type EmailSendResponse, type SendEmailOptions, parseEmailWebhookPayload, sendLovableEmail };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { EmailWebhookPayload } from '@lovable.dev/webhooks-js';
|
|
|
2
2
|
export { EmailWebhookPayload } from '@lovable.dev/webhooks-js';
|
|
3
3
|
|
|
4
4
|
interface EmailSendRequest {
|
|
5
|
-
run_id
|
|
5
|
+
run_id?: string;
|
|
6
6
|
to: string;
|
|
7
7
|
from: string;
|
|
8
8
|
sender_domain?: string;
|
|
@@ -13,6 +13,10 @@ interface EmailSendRequest {
|
|
|
13
13
|
reply_to?: string;
|
|
14
14
|
identity_id?: string;
|
|
15
15
|
test_mode?: boolean;
|
|
16
|
+
label?: string;
|
|
17
|
+
external_id?: string;
|
|
18
|
+
idempotency_key?: string;
|
|
19
|
+
unsubscribe_token?: string;
|
|
16
20
|
}
|
|
17
21
|
interface EmailSendResponse {
|
|
18
22
|
success: boolean;
|
|
@@ -32,4 +36,4 @@ declare function sendLovableEmail(payload: EmailSendRequest, options: SendEmailO
|
|
|
32
36
|
|
|
33
37
|
declare function parseEmailWebhookPayload(body: string): EmailWebhookPayload;
|
|
34
38
|
|
|
35
|
-
export { EmailSendRequest, EmailSendResponse, SendEmailOptions, parseEmailWebhookPayload, sendLovableEmail };
|
|
39
|
+
export { type EmailSendRequest, type EmailSendResponse, type SendEmailOptions, parseEmailWebhookPayload, sendLovableEmail };
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ async function sendLovableEmail(payload, options) {
|
|
|
14
14
|
const sendUrl = options.sendUrl;
|
|
15
15
|
const apiBaseUrl = options.apiBaseUrl ?? DEFAULT_API_BASE_URL;
|
|
16
16
|
const url = sendUrl || `${apiBaseUrl.replace(/\/$/, "")}${DEFAULT_SEND_PATH}`;
|
|
17
|
-
const idempotencyKey = options.idempotencyKey ?? payload.run_id;
|
|
17
|
+
const idempotencyKey = options.idempotencyKey ?? payload.idempotency_key ?? payload.run_id;
|
|
18
18
|
const headers = {
|
|
19
19
|
[authHeader]: buildAuthHeaderValue(apiKey),
|
|
20
20
|
"Content-Type": "application/json"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovable.dev/email-js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Lovable Email JS",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
"files": [
|
|
10
10
|
"dist"
|
|
11
11
|
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
|
|
14
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
17
|
+
"clean": "rimraf dist",
|
|
18
|
+
"typecheck": "tsgo --noEmit"
|
|
19
|
+
},
|
|
12
20
|
"keywords": [
|
|
13
21
|
"lovable",
|
|
14
22
|
"email",
|
|
@@ -16,7 +24,7 @@
|
|
|
16
24
|
],
|
|
17
25
|
"license": "MIT",
|
|
18
26
|
"dependencies": {
|
|
19
|
-
"@lovable.dev/webhooks-js": "
|
|
27
|
+
"@lovable.dev/webhooks-js": "0.0.1"
|
|
20
28
|
},
|
|
21
29
|
"devDependencies": {
|
|
22
30
|
"@types/node": "^22",
|
|
@@ -24,12 +32,5 @@
|
|
|
24
32
|
"tsup": "^7.2.0",
|
|
25
33
|
"typescript": "^5",
|
|
26
34
|
"vitest": "^3"
|
|
27
|
-
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --outDir dist",
|
|
30
|
-
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
31
|
-
"test": "vitest run",
|
|
32
|
-
"typecheck": "tsc --noEmit",
|
|
33
|
-
"clean": "rimraf dist"
|
|
34
35
|
}
|
|
35
|
-
}
|
|
36
|
+
}
|