@keystrokehq/sendgrid 0.0.15 → 0.0.16-integration-id-canonicalization.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.
- package/README.md +59 -111
- package/dist/credential-sets/index.d.mts +2 -0
- package/dist/credential-sets/index.mjs +3 -0
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +5 -1
- package/dist/operations/index.d.mts +2 -0
- package/dist/operations/index.mjs +3 -0
- package/dist/schemas/index.d.mts +5 -5
- package/dist/schemas/index.mjs +1 -1
- package/dist/{integration-DHWfpe0w.mjs → sendgrid.credential-set-CzYmlJ2Y.mjs} +9 -8
- package/dist/sendgrid.credential-set-ivRIiUDy.d.mts +32 -0
- package/dist/validate-email.operation-CCCDxLjH.mjs +4301 -0
- package/dist/validate-email.operation-DY4rCHFE.d.mts +5436 -0
- package/package.json +11 -99
- package/dist/_official/index.d.mts +0 -2
- package/dist/_official/index.mjs +0 -3
- package/dist/_runtime/index.d.mts +0 -2
- package/dist/_runtime/index.mjs +0 -3
- package/dist/alerts.d.mts +0 -147
- package/dist/alerts.mjs +0 -101
- package/dist/api-keys.d.mts +0 -105
- package/dist/api-keys.mjs +0 -113
- package/dist/client.d.mts +0 -73
- package/dist/client.mjs +0 -261
- package/dist/connection.d.mts +0 -2
- package/dist/connection.mjs +0 -3
- package/dist/domains.d.mts +0 -86
- package/dist/domains.mjs +0 -62
- package/dist/email-validation.d.mts +0 -97
- package/dist/email-validation.mjs +0 -73
- package/dist/events.d.mts +0 -69
- package/dist/events.mjs +0 -28
- package/dist/factory-7q6CQ75J.mjs +0 -25
- package/dist/integration-Cj4Xzfq_.d.mts +0 -48
- package/dist/mail-send.d.mts +0 -242
- package/dist/mail-send.mjs +0 -218
- package/dist/marketing-contacts.d.mts +0 -462
- package/dist/marketing-contacts.mjs +0 -277
- package/dist/marketing-customfields.d.mts +0 -66
- package/dist/marketing-customfields.mjs +0 -70
- package/dist/marketing-lists.d.mts +0 -120
- package/dist/marketing-lists.mjs +0 -130
- package/dist/marketing-segments.d.mts +0 -249
- package/dist/marketing-segments.mjs +0 -179
- package/dist/marketing-singlesends.d.mts +0 -521
- package/dist/marketing-singlesends.mjs +0 -277
- package/dist/operations.d.mts +0 -25
- package/dist/operations.mjs +0 -69
- package/dist/sender-identities.d.mts +0 -163
- package/dist/sender-identities.mjs +0 -109
- package/dist/senders.d.mts +0 -181
- package/dist/senders.mjs +0 -83
- package/dist/shared-CQ8JFNXi.mjs +0 -13
- package/dist/stats.d.mts +0 -169
- package/dist/stats.mjs +0 -107
- package/dist/suppressions.d.mts +0 -505
- package/dist/suppressions.mjs +0 -539
- package/dist/templates.d.mts +0 -351
- package/dist/templates.mjs +0 -238
- package/dist/user-account.d.mts +0 -71
- package/dist/user-account.mjs +0 -59
- package/dist/verification.d.mts +0 -67
- package/dist/verification.mjs +0 -72
- package/dist/webhooks/event.d.mts +0 -214
- package/dist/webhooks/event.mjs +0 -147
- package/dist/webhooks/parse.d.mts +0 -117
- package/dist/webhooks/parse.mjs +0 -125
- /package/dist/{webhooks-CKdsIikb.mjs → webhooks-dVOd93Hd.mjs} +0 -0
package/dist/events.d.mts
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region src/events.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* SendGrid Event Webhook event-name constants. Each webhook helper in
|
|
6
|
-
* `./triggers` pins `event` to one of these values.
|
|
7
|
-
*/
|
|
8
|
-
declare const sendgridEventWebhookEventNames: readonly ["processed", "dropped", "deferred", "delivered", "bounce", "open", "click", "spam_report", "unsubscribe", "group_unsubscribe", "group_resubscribe"];
|
|
9
|
-
type SendGridEventWebhookEventName = (typeof sendgridEventWebhookEventNames)[number];
|
|
10
|
-
declare const sendgridEventWebhookEventNameSchema: z.ZodEnum<{
|
|
11
|
-
processed: "processed";
|
|
12
|
-
dropped: "dropped";
|
|
13
|
-
deferred: "deferred";
|
|
14
|
-
delivered: "delivered";
|
|
15
|
-
bounce: "bounce";
|
|
16
|
-
open: "open";
|
|
17
|
-
click: "click";
|
|
18
|
-
spam_report: "spam_report";
|
|
19
|
-
unsubscribe: "unsubscribe";
|
|
20
|
-
group_unsubscribe: "group_unsubscribe";
|
|
21
|
-
group_resubscribe: "group_resubscribe";
|
|
22
|
-
}>;
|
|
23
|
-
declare const sendgridEventEnvelopeSchema: z.ZodArray<z.ZodObject<{
|
|
24
|
-
email: z.ZodString;
|
|
25
|
-
timestamp: z.ZodNumber;
|
|
26
|
-
event: z.ZodString;
|
|
27
|
-
'smtp-id': z.ZodOptional<z.ZodString>;
|
|
28
|
-
sg_event_id: z.ZodString;
|
|
29
|
-
sg_message_id: z.ZodOptional<z.ZodString>;
|
|
30
|
-
category: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
31
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
32
|
-
status: z.ZodOptional<z.ZodString>;
|
|
33
|
-
response: z.ZodOptional<z.ZodString>;
|
|
34
|
-
attempt: z.ZodOptional<z.ZodString>;
|
|
35
|
-
url: z.ZodOptional<z.ZodString>;
|
|
36
|
-
useragent: z.ZodOptional<z.ZodString>;
|
|
37
|
-
ip: z.ZodOptional<z.ZodString>;
|
|
38
|
-
asm_group_id: z.ZodOptional<z.ZodNumber>;
|
|
39
|
-
tls: z.ZodOptional<z.ZodNumber>;
|
|
40
|
-
type: z.ZodOptional<z.ZodString>;
|
|
41
|
-
bounce_classification: z.ZodOptional<z.ZodString>;
|
|
42
|
-
sg_machine_open: z.ZodOptional<z.ZodBoolean>;
|
|
43
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
44
|
-
declare const sendgridEventSchema: z.ZodObject<{
|
|
45
|
-
email: z.ZodString;
|
|
46
|
-
timestamp: z.ZodNumber;
|
|
47
|
-
event: z.ZodString;
|
|
48
|
-
'smtp-id': z.ZodOptional<z.ZodString>;
|
|
49
|
-
sg_event_id: z.ZodString;
|
|
50
|
-
sg_message_id: z.ZodOptional<z.ZodString>;
|
|
51
|
-
category: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
52
|
-
reason: z.ZodOptional<z.ZodString>;
|
|
53
|
-
status: z.ZodOptional<z.ZodString>;
|
|
54
|
-
response: z.ZodOptional<z.ZodString>;
|
|
55
|
-
attempt: z.ZodOptional<z.ZodString>;
|
|
56
|
-
url: z.ZodOptional<z.ZodString>;
|
|
57
|
-
useragent: z.ZodOptional<z.ZodString>;
|
|
58
|
-
ip: z.ZodOptional<z.ZodString>;
|
|
59
|
-
asm_group_id: z.ZodOptional<z.ZodNumber>;
|
|
60
|
-
tls: z.ZodOptional<z.ZodNumber>;
|
|
61
|
-
type: z.ZodOptional<z.ZodString>;
|
|
62
|
-
bounce_classification: z.ZodOptional<z.ZodString>;
|
|
63
|
-
sg_machine_open: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
-
}, z.core.$catchall<z.ZodUnknown>>;
|
|
65
|
-
type SendGridEvent = z.output<typeof sendgridEventSchema>;
|
|
66
|
-
declare const sendgridInboundParseEventName: "inbound_parse.received";
|
|
67
|
-
type SendGridInboundParseEventName = typeof sendgridInboundParseEventName;
|
|
68
|
-
//#endregion
|
|
69
|
-
export { SendGridEvent, SendGridEventWebhookEventName, SendGridInboundParseEventName, sendgridEventEnvelopeSchema, sendgridEventSchema, sendgridEventWebhookEventNameSchema, sendgridEventWebhookEventNames, sendgridInboundParseEventName };
|
package/dist/events.mjs
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { r as sendgridEventWebhookPayloadSchema, t as sendgridEventWebhookEventSchema } from "./webhooks-CKdsIikb.mjs";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/events.ts
|
|
5
|
-
/**
|
|
6
|
-
* SendGrid Event Webhook event-name constants. Each webhook helper in
|
|
7
|
-
* `./triggers` pins `event` to one of these values.
|
|
8
|
-
*/
|
|
9
|
-
const sendgridEventWebhookEventNames = [
|
|
10
|
-
"processed",
|
|
11
|
-
"dropped",
|
|
12
|
-
"deferred",
|
|
13
|
-
"delivered",
|
|
14
|
-
"bounce",
|
|
15
|
-
"open",
|
|
16
|
-
"click",
|
|
17
|
-
"spam_report",
|
|
18
|
-
"unsubscribe",
|
|
19
|
-
"group_unsubscribe",
|
|
20
|
-
"group_resubscribe"
|
|
21
|
-
];
|
|
22
|
-
const sendgridEventWebhookEventNameSchema = z.enum(sendgridEventWebhookEventNames);
|
|
23
|
-
const sendgridEventEnvelopeSchema = sendgridEventWebhookPayloadSchema;
|
|
24
|
-
const sendgridEventSchema = sendgridEventWebhookEventSchema;
|
|
25
|
-
const sendgridInboundParseEventName = "inbound_parse.received";
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { sendgridEventEnvelopeSchema, sendgridEventSchema, sendgridEventWebhookEventNameSchema, sendgridEventWebhookEventNames, sendgridInboundParseEventName };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { t as sendgrid } from "./integration-DHWfpe0w.mjs";
|
|
2
|
-
import { createOfficialOperationFactory } from "@keystrokehq/integration-authoring/official";
|
|
3
|
-
|
|
4
|
-
//#region \0rolldown/runtime.js
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __exportAll = (all, no_symbols) => {
|
|
7
|
-
let target = {};
|
|
8
|
-
for (var name in all) {
|
|
9
|
-
__defProp(target, name, {
|
|
10
|
-
get: all[name],
|
|
11
|
-
enumerable: true
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
if (!no_symbols) {
|
|
15
|
-
__defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
16
|
-
}
|
|
17
|
-
return target;
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/factory.ts
|
|
22
|
-
const sendgridOperation = createOfficialOperationFactory(sendgrid);
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { __exportAll as n, sendgridOperation as t };
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import * as _keystrokehq_integration_authoring_official0 from "@keystrokehq/integration-authoring/official";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
4
|
-
import { InferCredentialSetAuth } from "@keystrokehq/core/credential-set";
|
|
5
|
-
|
|
6
|
-
//#region src/integration.d.ts
|
|
7
|
-
declare const sendgridOfficialIntegration: {
|
|
8
|
-
id: "sendgrid";
|
|
9
|
-
name: string;
|
|
10
|
-
description: string;
|
|
11
|
-
credentialType: "manual";
|
|
12
|
-
auth: z.ZodObject<{
|
|
13
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
14
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
15
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
16
|
-
global: "global";
|
|
17
|
-
eu: "eu";
|
|
18
|
-
}>>;
|
|
19
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
20
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
proxy: {
|
|
23
|
-
hosts: string[];
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
declare const sendgridBundle: _keystrokehq_integration_authoring_official0.OfficialIntegrationBundle<"sendgrid", z.ZodObject<{
|
|
27
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
28
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
29
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
30
|
-
global: "global";
|
|
31
|
-
eu: "eu";
|
|
32
|
-
}>>;
|
|
33
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
34
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
35
|
-
}, z.core.$strip>>;
|
|
36
|
-
declare const sendgrid: _keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
37
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
38
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
39
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
40
|
-
global: "global";
|
|
41
|
-
eu: "eu";
|
|
42
|
-
}>>;
|
|
43
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
44
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
type SendGridCredentials = InferCredentialSetAuth<typeof sendgrid>;
|
|
47
|
-
//#endregion
|
|
48
|
-
export { sendgridOfficialIntegration as i, sendgrid as n, sendgridBundle as r, SendGridCredentials as t };
|
package/dist/mail-send.d.mts
DELETED
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/mail-send.d.ts
|
|
5
|
-
declare const sendEmail: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
6
|
-
personalizations: z.ZodArray<z.ZodObject<{
|
|
7
|
-
to: z.ZodArray<z.ZodObject<{
|
|
8
|
-
email: z.ZodString;
|
|
9
|
-
name: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, z.core.$strip>>;
|
|
11
|
-
cc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
12
|
-
email: z.ZodString;
|
|
13
|
-
name: z.ZodOptional<z.ZodString>;
|
|
14
|
-
}, z.core.$strip>>>;
|
|
15
|
-
bcc: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
16
|
-
email: z.ZodString;
|
|
17
|
-
name: z.ZodOptional<z.ZodString>;
|
|
18
|
-
}, z.core.$strip>>>;
|
|
19
|
-
from: z.ZodOptional<z.ZodObject<{
|
|
20
|
-
email: z.ZodString;
|
|
21
|
-
name: z.ZodOptional<z.ZodString>;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
|
-
subject: z.ZodOptional<z.ZodString>;
|
|
24
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
25
|
-
substitutions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
26
|
-
dynamicTemplateData: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
27
|
-
customArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
28
|
-
sendAt: z.ZodOptional<z.ZodNumber>;
|
|
29
|
-
}, z.core.$strip>>;
|
|
30
|
-
from: z.ZodObject<{
|
|
31
|
-
email: z.ZodString;
|
|
32
|
-
name: z.ZodOptional<z.ZodString>;
|
|
33
|
-
}, z.core.$strip>;
|
|
34
|
-
replyTo: z.ZodOptional<z.ZodObject<{
|
|
35
|
-
email: z.ZodString;
|
|
36
|
-
name: z.ZodOptional<z.ZodString>;
|
|
37
|
-
}, z.core.$strip>>;
|
|
38
|
-
replyToList: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
-
email: z.ZodString;
|
|
40
|
-
name: z.ZodOptional<z.ZodString>;
|
|
41
|
-
}, z.core.$strip>>>;
|
|
42
|
-
subject: z.ZodOptional<z.ZodString>;
|
|
43
|
-
content: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
-
type: z.ZodUnion<[z.ZodEnum<{
|
|
45
|
-
"text/plain": "text/plain";
|
|
46
|
-
"text/html": "text/html";
|
|
47
|
-
}>, z.ZodString]>;
|
|
48
|
-
value: z.ZodString;
|
|
49
|
-
}, z.core.$strip>>>;
|
|
50
|
-
templateId: z.ZodOptional<z.ZodString>;
|
|
51
|
-
attachments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
52
|
-
content: z.ZodString;
|
|
53
|
-
type: z.ZodOptional<z.ZodString>;
|
|
54
|
-
filename: z.ZodString;
|
|
55
|
-
disposition: z.ZodOptional<z.ZodEnum<{
|
|
56
|
-
attachment: "attachment";
|
|
57
|
-
inline: "inline";
|
|
58
|
-
}>>;
|
|
59
|
-
contentId: z.ZodOptional<z.ZodString>;
|
|
60
|
-
}, z.core.$strip>>>;
|
|
61
|
-
categories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
-
customArgs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
63
|
-
sendAt: z.ZodOptional<z.ZodNumber>;
|
|
64
|
-
batchId: z.ZodOptional<z.ZodString>;
|
|
65
|
-
asm: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
group_id: z.ZodNumber;
|
|
67
|
-
groups_to_display: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
68
|
-
}, z.core.$strip>>;
|
|
69
|
-
ipPoolName: z.ZodOptional<z.ZodString>;
|
|
70
|
-
mailSettings: z.ZodOptional<z.ZodObject<{
|
|
71
|
-
sandboxMode: z.ZodOptional<z.ZodObject<{
|
|
72
|
-
enable: z.ZodBoolean;
|
|
73
|
-
}, z.core.$strip>>;
|
|
74
|
-
bypassListManagement: z.ZodOptional<z.ZodObject<{
|
|
75
|
-
enable: z.ZodBoolean;
|
|
76
|
-
}, z.core.$strip>>;
|
|
77
|
-
bypassSpamManagement: z.ZodOptional<z.ZodObject<{
|
|
78
|
-
enable: z.ZodBoolean;
|
|
79
|
-
}, z.core.$strip>>;
|
|
80
|
-
bypassBounceManagement: z.ZodOptional<z.ZodObject<{
|
|
81
|
-
enable: z.ZodBoolean;
|
|
82
|
-
}, z.core.$strip>>;
|
|
83
|
-
bypassUnsubscribeManagement: z.ZodOptional<z.ZodObject<{
|
|
84
|
-
enable: z.ZodBoolean;
|
|
85
|
-
}, z.core.$strip>>;
|
|
86
|
-
footer: z.ZodOptional<z.ZodObject<{
|
|
87
|
-
enable: z.ZodBoolean;
|
|
88
|
-
text: z.ZodOptional<z.ZodString>;
|
|
89
|
-
html: z.ZodOptional<z.ZodString>;
|
|
90
|
-
}, z.core.$strip>>;
|
|
91
|
-
}, z.core.$strip>>;
|
|
92
|
-
trackingSettings: z.ZodOptional<z.ZodObject<{
|
|
93
|
-
clickTracking: z.ZodOptional<z.ZodObject<{
|
|
94
|
-
enable: z.ZodBoolean;
|
|
95
|
-
enableText: z.ZodOptional<z.ZodBoolean>;
|
|
96
|
-
}, z.core.$strip>>;
|
|
97
|
-
openTracking: z.ZodOptional<z.ZodObject<{
|
|
98
|
-
enable: z.ZodBoolean;
|
|
99
|
-
substitutionTag: z.ZodOptional<z.ZodString>;
|
|
100
|
-
}, z.core.$strip>>;
|
|
101
|
-
subscriptionTracking: z.ZodOptional<z.ZodObject<{
|
|
102
|
-
enable: z.ZodBoolean;
|
|
103
|
-
}, z.core.$strip>>;
|
|
104
|
-
ganalytics: z.ZodOptional<z.ZodObject<{
|
|
105
|
-
enable: z.ZodBoolean;
|
|
106
|
-
utmSource: z.ZodOptional<z.ZodString>;
|
|
107
|
-
utmMedium: z.ZodOptional<z.ZodString>;
|
|
108
|
-
utmTerm: z.ZodOptional<z.ZodString>;
|
|
109
|
-
utmContent: z.ZodOptional<z.ZodString>;
|
|
110
|
-
utmCampaign: z.ZodOptional<z.ZodString>;
|
|
111
|
-
}, z.core.$strip>>;
|
|
112
|
-
}, z.core.$strip>>;
|
|
113
|
-
headers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
114
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
115
|
-
messageId: z.ZodOptional<z.ZodString>;
|
|
116
|
-
accepted: z.ZodBoolean;
|
|
117
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
118
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
119
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
120
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
121
|
-
global: "global";
|
|
122
|
-
eu: "eu";
|
|
123
|
-
}>>;
|
|
124
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
125
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
126
|
-
}, z.core.$strip>>], undefined>;
|
|
127
|
-
declare const createBatchId: _keystrokehq_core0.Operation<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
128
|
-
batch_id: z.ZodString;
|
|
129
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
130
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
131
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
132
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
133
|
-
global: "global";
|
|
134
|
-
eu: "eu";
|
|
135
|
-
}>>;
|
|
136
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
137
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
138
|
-
}, z.core.$strip>>], undefined>;
|
|
139
|
-
declare const validateBatchId: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
140
|
-
batchId: z.ZodString;
|
|
141
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
-
batch_id: z.ZodString;
|
|
143
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
144
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
145
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
146
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
147
|
-
global: "global";
|
|
148
|
-
eu: "eu";
|
|
149
|
-
}>>;
|
|
150
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
151
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
152
|
-
}, z.core.$strip>>], undefined>;
|
|
153
|
-
declare const cancelOrPauseScheduledSend: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
154
|
-
batchId: z.ZodString;
|
|
155
|
-
status: z.ZodEnum<{
|
|
156
|
-
cancel: "cancel";
|
|
157
|
-
pause: "pause";
|
|
158
|
-
}>;
|
|
159
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
160
|
-
batch_id: z.ZodString;
|
|
161
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
162
|
-
cancel: "cancel";
|
|
163
|
-
pause: "pause";
|
|
164
|
-
}>>;
|
|
165
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
166
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
167
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
168
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
169
|
-
global: "global";
|
|
170
|
-
eu: "eu";
|
|
171
|
-
}>>;
|
|
172
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
173
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
174
|
-
}, z.core.$strip>>], undefined>;
|
|
175
|
-
declare const updateScheduledSend: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
176
|
-
batchId: z.ZodString;
|
|
177
|
-
status: z.ZodEnum<{
|
|
178
|
-
cancel: "cancel";
|
|
179
|
-
pause: "pause";
|
|
180
|
-
}>;
|
|
181
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
182
|
-
success: z.ZodBoolean;
|
|
183
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
184
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
185
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
186
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
187
|
-
global: "global";
|
|
188
|
-
eu: "eu";
|
|
189
|
-
}>>;
|
|
190
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
191
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
192
|
-
}, z.core.$strip>>], undefined>;
|
|
193
|
-
declare const deleteScheduledSend: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
194
|
-
batchId: z.ZodString;
|
|
195
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
196
|
-
success: z.ZodBoolean;
|
|
197
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
198
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
199
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
200
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
201
|
-
global: "global";
|
|
202
|
-
eu: "eu";
|
|
203
|
-
}>>;
|
|
204
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
205
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
206
|
-
}, z.core.$strip>>], undefined>;
|
|
207
|
-
declare const listScheduledSends: _keystrokehq_core0.Operation<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodArray<z.ZodObject<{
|
|
208
|
-
batch_id: z.ZodString;
|
|
209
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
210
|
-
cancel: "cancel";
|
|
211
|
-
pause: "pause";
|
|
212
|
-
}>>;
|
|
213
|
-
}, z.core.$catchall<z.ZodUnknown>>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
214
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
215
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
216
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
217
|
-
global: "global";
|
|
218
|
-
eu: "eu";
|
|
219
|
-
}>>;
|
|
220
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
221
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
222
|
-
}, z.core.$strip>>], undefined>;
|
|
223
|
-
declare const getScheduledSend: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
224
|
-
batchId: z.ZodString;
|
|
225
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
226
|
-
batch_id: z.ZodString;
|
|
227
|
-
status: z.ZodOptional<z.ZodEnum<{
|
|
228
|
-
cancel: "cancel";
|
|
229
|
-
pause: "pause";
|
|
230
|
-
}>>;
|
|
231
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
232
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
233
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
234
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
235
|
-
global: "global";
|
|
236
|
-
eu: "eu";
|
|
237
|
-
}>>;
|
|
238
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
239
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
240
|
-
}, z.core.$strip>>], undefined>;
|
|
241
|
-
//#endregion
|
|
242
|
-
export { cancelOrPauseScheduledSend, createBatchId, deleteScheduledSend, getScheduledSend, listScheduledSends, sendEmail, updateScheduledSend, validateBatchId };
|
package/dist/mail-send.mjs
DELETED
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import { n as __exportAll, t as sendgridOperation } from "./factory-7q6CQ75J.mjs";
|
|
2
|
-
import { n as omitUndefined } from "./shared-CQ8JFNXi.mjs";
|
|
3
|
-
import { createSendGridClient } from "./client.mjs";
|
|
4
|
-
import { _t as sendgridScheduledSendSchema, ft as sendgridMailSendInputSchema, gt as sendgridScheduledSendListSchema, lt as sendgridBatchIdSchema, on as sendgridIdSchema, pt as sendgridMailSendResultSchema, vt as sendgridScheduledSendStatusSchema } from "./webhooks-CKdsIikb.mjs";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
//#region src/mail-send.ts
|
|
8
|
-
var mail_send_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
-
cancelOrPauseScheduledSend: () => cancelOrPauseScheduledSend,
|
|
10
|
-
createBatchId: () => createBatchId,
|
|
11
|
-
deleteScheduledSend: () => deleteScheduledSend,
|
|
12
|
-
getScheduledSend: () => getScheduledSend,
|
|
13
|
-
listScheduledSends: () => listScheduledSends,
|
|
14
|
-
sendEmail: () => sendEmail,
|
|
15
|
-
updateScheduledSend: () => updateScheduledSend,
|
|
16
|
-
validateBatchId: () => validateBatchId
|
|
17
|
-
});
|
|
18
|
-
function mapEmailAddress(value) {
|
|
19
|
-
return omitUndefined({
|
|
20
|
-
email: value.email,
|
|
21
|
-
name: value.name
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function mapEmailAddressList(value) {
|
|
25
|
-
if (!value) return void 0;
|
|
26
|
-
return value.map(mapEmailAddress);
|
|
27
|
-
}
|
|
28
|
-
function mapPersonalization(p) {
|
|
29
|
-
return omitUndefined({
|
|
30
|
-
to: p.to.map(mapEmailAddress),
|
|
31
|
-
cc: mapEmailAddressList(p.cc),
|
|
32
|
-
bcc: mapEmailAddressList(p.bcc),
|
|
33
|
-
from: p.from ? mapEmailAddress(p.from) : void 0,
|
|
34
|
-
subject: p.subject,
|
|
35
|
-
headers: p.headers,
|
|
36
|
-
substitutions: p.substitutions,
|
|
37
|
-
dynamic_template_data: p.dynamicTemplateData,
|
|
38
|
-
custom_args: p.customArgs,
|
|
39
|
-
send_at: p.sendAt
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function mapMailSettings(settings) {
|
|
43
|
-
if (!settings) return void 0;
|
|
44
|
-
return omitUndefined({
|
|
45
|
-
sandbox_mode: settings.sandboxMode,
|
|
46
|
-
bypass_list_management: settings.bypassListManagement,
|
|
47
|
-
bypass_spam_management: settings.bypassSpamManagement,
|
|
48
|
-
bypass_bounce_management: settings.bypassBounceManagement,
|
|
49
|
-
bypass_unsubscribe_management: settings.bypassUnsubscribeManagement,
|
|
50
|
-
footer: settings.footer
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function mapTrackingSettings(settings) {
|
|
54
|
-
if (!settings) return void 0;
|
|
55
|
-
return omitUndefined({
|
|
56
|
-
click_tracking: settings.clickTracking ? omitUndefined({
|
|
57
|
-
enable: settings.clickTracking.enable,
|
|
58
|
-
enable_text: settings.clickTracking.enableText
|
|
59
|
-
}) : void 0,
|
|
60
|
-
open_tracking: settings.openTracking ? omitUndefined({
|
|
61
|
-
enable: settings.openTracking.enable,
|
|
62
|
-
substitution_tag: settings.openTracking.substitutionTag
|
|
63
|
-
}) : void 0,
|
|
64
|
-
subscription_tracking: settings.subscriptionTracking,
|
|
65
|
-
ganalytics: settings.ganalytics ? omitUndefined({
|
|
66
|
-
enable: settings.ganalytics.enable,
|
|
67
|
-
utm_source: settings.ganalytics.utmSource,
|
|
68
|
-
utm_medium: settings.ganalytics.utmMedium,
|
|
69
|
-
utm_term: settings.ganalytics.utmTerm,
|
|
70
|
-
utm_content: settings.ganalytics.utmContent,
|
|
71
|
-
utm_campaign: settings.ganalytics.utmCampaign
|
|
72
|
-
}) : void 0
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function mapMailSendInput(input) {
|
|
76
|
-
return omitUndefined({
|
|
77
|
-
personalizations: input.personalizations.map(mapPersonalization),
|
|
78
|
-
from: mapEmailAddress(input.from),
|
|
79
|
-
reply_to: input.replyTo ? mapEmailAddress(input.replyTo) : void 0,
|
|
80
|
-
reply_to_list: mapEmailAddressList(input.replyToList),
|
|
81
|
-
subject: input.subject,
|
|
82
|
-
content: input.content,
|
|
83
|
-
template_id: input.templateId,
|
|
84
|
-
attachments: input.attachments?.map((a) => omitUndefined({
|
|
85
|
-
content: a.content,
|
|
86
|
-
type: a.type,
|
|
87
|
-
filename: a.filename,
|
|
88
|
-
disposition: a.disposition,
|
|
89
|
-
content_id: a.contentId
|
|
90
|
-
})),
|
|
91
|
-
categories: input.categories,
|
|
92
|
-
custom_args: input.customArgs,
|
|
93
|
-
send_at: input.sendAt,
|
|
94
|
-
batch_id: input.batchId,
|
|
95
|
-
asm: input.asm,
|
|
96
|
-
ip_pool_name: input.ipPoolName,
|
|
97
|
-
mail_settings: mapMailSettings(input.mailSettings),
|
|
98
|
-
tracking_settings: mapTrackingSettings(input.trackingSettings),
|
|
99
|
-
headers: input.headers
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
const sendEmail = sendgridOperation({
|
|
103
|
-
id: "sendgrid.send-email",
|
|
104
|
-
name: "Send Email",
|
|
105
|
-
description: "Send a transactional email via SendGrid (v3 Mail Send). Supports personalizations, dynamic templates, attachments, categories, custom args, sandbox mode, scheduled `send_at`, batch IDs, and ASM.",
|
|
106
|
-
input: sendgridMailSendInputSchema,
|
|
107
|
-
output: sendgridMailSendResultSchema,
|
|
108
|
-
needsApproval: true,
|
|
109
|
-
run: async (input, credentials) => {
|
|
110
|
-
const header = (await createSendGridClient(credentials).request("/mail/send", {
|
|
111
|
-
method: "POST",
|
|
112
|
-
body: mapMailSendInput(input)
|
|
113
|
-
}))?.messageId;
|
|
114
|
-
return sendgridMailSendResultSchema.parse({
|
|
115
|
-
accepted: true,
|
|
116
|
-
...header !== void 0 ? { messageId: header } : {}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
const createBatchId = sendgridOperation({
|
|
121
|
-
id: "sendgrid.create-batch-id",
|
|
122
|
-
name: "Create Batch ID",
|
|
123
|
-
description: "Mint a new batch ID. Use the returned ID as `batchId` on subsequent Mail Send calls to later cancel or pause all messages in the batch.",
|
|
124
|
-
input: z.object({}).optional(),
|
|
125
|
-
output: sendgridBatchIdSchema,
|
|
126
|
-
needsApproval: true,
|
|
127
|
-
run: async (_input, credentials) => {
|
|
128
|
-
const response = await createSendGridClient(credentials).request("/mail/batch", { method: "POST" });
|
|
129
|
-
return sendgridBatchIdSchema.parse(response);
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
const validateBatchId = sendgridOperation({
|
|
133
|
-
id: "sendgrid.validate-batch-id",
|
|
134
|
-
name: "Validate Batch ID",
|
|
135
|
-
description: "Confirm a batch ID exists and is usable.",
|
|
136
|
-
input: z.object({ batchId: sendgridIdSchema }),
|
|
137
|
-
output: sendgridBatchIdSchema,
|
|
138
|
-
run: async (input, credentials) => {
|
|
139
|
-
const response = await createSendGridClient(credentials).request(`/mail/batch/${encodeURIComponent(input.batchId)}`);
|
|
140
|
-
return sendgridBatchIdSchema.parse(response);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const cancelOrPauseScheduledSend = sendgridOperation({
|
|
144
|
-
id: "sendgrid.cancel-or-pause-scheduled-send",
|
|
145
|
-
name: "Cancel or Pause Scheduled Send",
|
|
146
|
-
description: "Mark a batch ID as `cancel` or `pause`. Applies to all messages with that batch ID scheduled in the future.",
|
|
147
|
-
input: z.object({
|
|
148
|
-
batchId: sendgridIdSchema,
|
|
149
|
-
status: sendgridScheduledSendStatusSchema
|
|
150
|
-
}),
|
|
151
|
-
output: sendgridScheduledSendSchema,
|
|
152
|
-
needsApproval: true,
|
|
153
|
-
run: async (input, credentials) => {
|
|
154
|
-
const response = await createSendGridClient(credentials).request("/user/scheduled_sends", {
|
|
155
|
-
method: "POST",
|
|
156
|
-
body: {
|
|
157
|
-
batch_id: input.batchId,
|
|
158
|
-
status: input.status
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
return sendgridScheduledSendSchema.parse(response);
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
const updateScheduledSend = sendgridOperation({
|
|
165
|
-
id: "sendgrid.update-scheduled-send",
|
|
166
|
-
name: "Update Scheduled Send",
|
|
167
|
-
description: "Toggle a scheduled batch between `cancel` and `pause`.",
|
|
168
|
-
input: z.object({
|
|
169
|
-
batchId: sendgridIdSchema,
|
|
170
|
-
status: sendgridScheduledSendStatusSchema
|
|
171
|
-
}),
|
|
172
|
-
output: z.object({ success: z.boolean() }),
|
|
173
|
-
needsApproval: true,
|
|
174
|
-
run: async (input, credentials) => {
|
|
175
|
-
await createSendGridClient(credentials).request(`/user/scheduled_sends/${encodeURIComponent(input.batchId)}`, {
|
|
176
|
-
method: "PATCH",
|
|
177
|
-
body: { status: input.status }
|
|
178
|
-
});
|
|
179
|
-
return { success: true };
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
const deleteScheduledSend = sendgridOperation({
|
|
183
|
-
id: "sendgrid.delete-scheduled-send",
|
|
184
|
-
name: "Delete Cancellation or Pause from Scheduled Send",
|
|
185
|
-
description: "Remove the cancellation or pause on a scheduled batch ID, allowing messages to send on schedule again.",
|
|
186
|
-
input: z.object({ batchId: sendgridIdSchema }),
|
|
187
|
-
output: z.object({ success: z.boolean() }),
|
|
188
|
-
needsApproval: true,
|
|
189
|
-
run: async (input, credentials) => {
|
|
190
|
-
await createSendGridClient(credentials).request(`/user/scheduled_sends/${encodeURIComponent(input.batchId)}`, { method: "DELETE" });
|
|
191
|
-
return { success: true };
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
const listScheduledSends = sendgridOperation({
|
|
195
|
-
id: "sendgrid.list-scheduled-sends",
|
|
196
|
-
name: "List Scheduled Sends",
|
|
197
|
-
description: "Retrieve all scheduled batches currently paused or cancelled.",
|
|
198
|
-
input: z.object({}).optional(),
|
|
199
|
-
output: sendgridScheduledSendListSchema,
|
|
200
|
-
run: async (_input, credentials) => {
|
|
201
|
-
const response = await createSendGridClient(credentials).request("/user/scheduled_sends");
|
|
202
|
-
return sendgridScheduledSendListSchema.parse(response ?? []);
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
const getScheduledSend = sendgridOperation({
|
|
206
|
-
id: "sendgrid.get-scheduled-send",
|
|
207
|
-
name: "Get Scheduled Send",
|
|
208
|
-
description: "Retrieve the current `cancel`/`pause` state of a batch ID.",
|
|
209
|
-
input: z.object({ batchId: sendgridIdSchema }),
|
|
210
|
-
output: sendgridScheduledSendSchema,
|
|
211
|
-
run: async (input, credentials) => {
|
|
212
|
-
const response = await createSendGridClient(credentials).request(`/user/scheduled_sends/${encodeURIComponent(input.batchId)}`);
|
|
213
|
-
return sendgridScheduledSendSchema.parse(response);
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
//#endregion
|
|
218
|
-
export { cancelOrPauseScheduledSend, createBatchId, deleteScheduledSend, getScheduledSend, listScheduledSends, sendEmail, mail_send_exports as t, updateScheduledSend, validateBatchId };
|