@keystrokehq/sendgrid 0.0.15 → 0.0.16-integration-id-canonicalization.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 +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
|
@@ -1,277 +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 { $ as sendgridSingleSendTestInputSchema, G as sendgridSingleSendListSchema, J as sendgridSingleSendSearchInputSchema, K as sendgridSingleSendScheduleInputSchema, U as sendgridSingleSendClicksSchema, W as sendgridSingleSendEmailConfigSchema, X as sendgridSingleSendStatsListSchema, Y as sendgridSingleSendSendToSchema, Z as sendgridSingleSendStatsSchema, on as sendgridIdSchema, q as sendgridSingleSendSchema } from "./webhooks-CKdsIikb.mjs";
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
//#region src/marketing-singlesends.ts
|
|
8
|
-
var marketing_singlesends_exports = /* @__PURE__ */ __exportAll({
|
|
9
|
-
bulkDeleteSingleSends: () => bulkDeleteSingleSends,
|
|
10
|
-
createSingleSend: () => createSingleSend,
|
|
11
|
-
deleteSingleSend: () => deleteSingleSend,
|
|
12
|
-
duplicateSingleSend: () => duplicateSingleSend,
|
|
13
|
-
getSingleSend: () => getSingleSend,
|
|
14
|
-
getSingleSendClickStats: () => getSingleSendClickStats,
|
|
15
|
-
getSingleSendStats: () => getSingleSendStats,
|
|
16
|
-
listSingleSendStats: () => listSingleSendStats,
|
|
17
|
-
listSingleSends: () => listSingleSends,
|
|
18
|
-
scheduleSingleSend: () => scheduleSingleSend,
|
|
19
|
-
searchSingleSends: () => searchSingleSends,
|
|
20
|
-
sendTestMarketingEmail: () => sendTestMarketingEmail,
|
|
21
|
-
unscheduleSingleSend: () => unscheduleSingleSend,
|
|
22
|
-
updateSingleSend: () => updateSingleSend
|
|
23
|
-
});
|
|
24
|
-
function base(path = "") {
|
|
25
|
-
return `/marketing/singlesends${path}`;
|
|
26
|
-
}
|
|
27
|
-
function stats(path = "") {
|
|
28
|
-
return `/marketing/stats/singlesends${path}`;
|
|
29
|
-
}
|
|
30
|
-
const singleSendBody = z.object({
|
|
31
|
-
name: z.string().min(1),
|
|
32
|
-
categories: z.array(z.string()).max(10).optional(),
|
|
33
|
-
sendAt: z.iso.datetime().optional(),
|
|
34
|
-
sendTo: sendgridSingleSendSendToSchema.optional(),
|
|
35
|
-
emailConfig: sendgridSingleSendEmailConfigSchema.optional()
|
|
36
|
-
});
|
|
37
|
-
function mapSingleSendBody(input) {
|
|
38
|
-
return omitUndefined({
|
|
39
|
-
name: input.name,
|
|
40
|
-
categories: input.categories,
|
|
41
|
-
send_at: input.sendAt,
|
|
42
|
-
send_to: input.sendTo,
|
|
43
|
-
email_config: input.emailConfig
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
const createSingleSend = sendgridOperation({
|
|
47
|
-
id: "sendgrid.create-single-send",
|
|
48
|
-
name: "Create Single Send",
|
|
49
|
-
description: "Create a marketing Single Send campaign.",
|
|
50
|
-
input: singleSendBody,
|
|
51
|
-
output: sendgridSingleSendSchema,
|
|
52
|
-
needsApproval: true,
|
|
53
|
-
run: async (input, credentials) => {
|
|
54
|
-
const response = await createSendGridClient(credentials).request(base(), {
|
|
55
|
-
method: "POST",
|
|
56
|
-
body: mapSingleSendBody(input)
|
|
57
|
-
});
|
|
58
|
-
return sendgridSingleSendSchema.parse(response);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
const updateSingleSend = sendgridOperation({
|
|
62
|
-
id: "sendgrid.update-single-send",
|
|
63
|
-
name: "Update Single Send",
|
|
64
|
-
description: "Update a Single Send campaign.",
|
|
65
|
-
input: singleSendBody.partial().extend({ id: sendgridIdSchema }),
|
|
66
|
-
output: sendgridSingleSendSchema,
|
|
67
|
-
needsApproval: true,
|
|
68
|
-
run: async (input, credentials) => {
|
|
69
|
-
const response = await createSendGridClient(credentials).request(base(`/${encodeURIComponent(input.id)}`), {
|
|
70
|
-
method: "PATCH",
|
|
71
|
-
body: omitUndefined({
|
|
72
|
-
name: input.name,
|
|
73
|
-
categories: input.categories,
|
|
74
|
-
send_at: input.sendAt,
|
|
75
|
-
send_to: input.sendTo,
|
|
76
|
-
email_config: input.emailConfig
|
|
77
|
-
})
|
|
78
|
-
});
|
|
79
|
-
return sendgridSingleSendSchema.parse(response);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
const duplicateSingleSend = sendgridOperation({
|
|
83
|
-
id: "sendgrid.duplicate-single-send",
|
|
84
|
-
name: "Duplicate Single Send",
|
|
85
|
-
description: "Duplicate a Single Send campaign.",
|
|
86
|
-
input: z.object({
|
|
87
|
-
id: sendgridIdSchema,
|
|
88
|
-
name: z.string().min(1).optional()
|
|
89
|
-
}),
|
|
90
|
-
output: sendgridSingleSendSchema,
|
|
91
|
-
needsApproval: true,
|
|
92
|
-
run: async (input, credentials) => {
|
|
93
|
-
const response = await createSendGridClient(credentials).request(base(`/${encodeURIComponent(input.id)}`), {
|
|
94
|
-
method: "POST",
|
|
95
|
-
body: omitUndefined({ name: input.name })
|
|
96
|
-
});
|
|
97
|
-
return sendgridSingleSendSchema.parse(response);
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
const deleteSingleSend = sendgridOperation({
|
|
101
|
-
id: "sendgrid.delete-single-send",
|
|
102
|
-
name: "Delete Single Send",
|
|
103
|
-
description: "Delete a Single Send by ID.",
|
|
104
|
-
input: z.object({ id: sendgridIdSchema }),
|
|
105
|
-
output: z.object({ success: z.boolean() }),
|
|
106
|
-
needsApproval: true,
|
|
107
|
-
run: async (input, credentials) => {
|
|
108
|
-
await createSendGridClient(credentials).request(base(`/${encodeURIComponent(input.id)}`), { method: "DELETE" });
|
|
109
|
-
return { success: true };
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
const bulkDeleteSingleSends = sendgridOperation({
|
|
113
|
-
id: "sendgrid.bulk-delete-single-sends",
|
|
114
|
-
name: "Bulk Delete Single Sends",
|
|
115
|
-
description: "Delete multiple Single Sends at once.",
|
|
116
|
-
input: z.object({ ids: z.array(sendgridIdSchema).min(1).max(100) }),
|
|
117
|
-
output: z.object({ success: z.boolean() }),
|
|
118
|
-
needsApproval: true,
|
|
119
|
-
run: async (input, credentials) => {
|
|
120
|
-
await createSendGridClient(credentials).request(base(), {
|
|
121
|
-
method: "DELETE",
|
|
122
|
-
query: { ids: input.ids.join(",") }
|
|
123
|
-
});
|
|
124
|
-
return { success: true };
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
const getSingleSend = sendgridOperation({
|
|
128
|
-
id: "sendgrid.get-single-send",
|
|
129
|
-
name: "Get Single Send",
|
|
130
|
-
description: "Retrieve a Single Send by ID.",
|
|
131
|
-
input: z.object({ id: sendgridIdSchema }),
|
|
132
|
-
output: sendgridSingleSendSchema,
|
|
133
|
-
run: async (input, credentials) => {
|
|
134
|
-
const response = await createSendGridClient(credentials).request(base(`/${encodeURIComponent(input.id)}`));
|
|
135
|
-
return sendgridSingleSendSchema.parse(response);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
const listSingleSends = sendgridOperation({
|
|
139
|
-
id: "sendgrid.list-single-sends",
|
|
140
|
-
name: "List Single Sends",
|
|
141
|
-
description: "List all Single Sends on the account.",
|
|
142
|
-
input: z.object({
|
|
143
|
-
pageSize: z.number().int().positive().max(100).optional(),
|
|
144
|
-
pageToken: z.string().min(1).optional()
|
|
145
|
-
}).optional(),
|
|
146
|
-
output: sendgridSingleSendListSchema,
|
|
147
|
-
run: async (input, credentials) => {
|
|
148
|
-
const response = await createSendGridClient(credentials).request(base(), { query: omitUndefined({
|
|
149
|
-
page_size: input?.pageSize,
|
|
150
|
-
page_token: input?.pageToken
|
|
151
|
-
}) });
|
|
152
|
-
return sendgridSingleSendListSchema.parse(response ?? { result: [] });
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
const searchSingleSends = sendgridOperation({
|
|
156
|
-
id: "sendgrid.search-single-sends",
|
|
157
|
-
name: "Search Single Sends",
|
|
158
|
-
description: "Search Single Sends by name, status, or categories.",
|
|
159
|
-
input: sendgridSingleSendSearchInputSchema,
|
|
160
|
-
output: sendgridSingleSendListSchema,
|
|
161
|
-
run: async (input, credentials) => {
|
|
162
|
-
const response = await createSendGridClient(credentials).request(base("/search"), {
|
|
163
|
-
method: "POST",
|
|
164
|
-
body: omitUndefined({
|
|
165
|
-
name: input.name,
|
|
166
|
-
status: input.status,
|
|
167
|
-
categories: input.categories
|
|
168
|
-
})
|
|
169
|
-
});
|
|
170
|
-
return sendgridSingleSendListSchema.parse(response ?? { result: [] });
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
const scheduleSingleSend = sendgridOperation({
|
|
174
|
-
id: "sendgrid.schedule-single-send",
|
|
175
|
-
name: "Schedule Single Send",
|
|
176
|
-
description: "Schedule a Single Send for future delivery (pass `send_at: \"now\"` to send immediately).",
|
|
177
|
-
input: z.object({ id: sendgridIdSchema }).and(sendgridSingleSendScheduleInputSchema),
|
|
178
|
-
output: sendgridSingleSendSchema,
|
|
179
|
-
needsApproval: true,
|
|
180
|
-
run: async (input, credentials) => {
|
|
181
|
-
const response = await createSendGridClient(credentials).request(base(`/${encodeURIComponent(input.id)}/schedule`), {
|
|
182
|
-
method: "PUT",
|
|
183
|
-
body: { send_at: input.send_at }
|
|
184
|
-
});
|
|
185
|
-
return sendgridSingleSendSchema.parse(response);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
const unscheduleSingleSend = sendgridOperation({
|
|
189
|
-
id: "sendgrid.unschedule-single-send",
|
|
190
|
-
name: "Unschedule Single Send",
|
|
191
|
-
description: "Cancel a scheduled Single Send delivery.",
|
|
192
|
-
input: z.object({ id: sendgridIdSchema }),
|
|
193
|
-
output: z.object({ success: z.boolean() }),
|
|
194
|
-
needsApproval: true,
|
|
195
|
-
run: async (input, credentials) => {
|
|
196
|
-
await createSendGridClient(credentials).request(base(`/${encodeURIComponent(input.id)}/schedule`), { method: "DELETE" });
|
|
197
|
-
return { success: true };
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
const sendTestMarketingEmail = sendgridOperation({
|
|
201
|
-
id: "sendgrid.send-test-marketing-email",
|
|
202
|
-
name: "Send Test Marketing Email",
|
|
203
|
-
description: "Send a Marketing Campaigns test email to the given recipients.",
|
|
204
|
-
input: sendgridSingleSendTestInputSchema,
|
|
205
|
-
output: z.object({ success: z.boolean() }),
|
|
206
|
-
needsApproval: true,
|
|
207
|
-
run: async (input, credentials) => {
|
|
208
|
-
await createSendGridClient(credentials).request("/marketing/test/send_email", {
|
|
209
|
-
method: "POST",
|
|
210
|
-
body: omitUndefined({
|
|
211
|
-
template_id: input.template_id,
|
|
212
|
-
version_id_override: input.version_id_override,
|
|
213
|
-
sender_id: input.sender_id,
|
|
214
|
-
custom_unsubscribe_url: input.custom_unsubscribe_url,
|
|
215
|
-
suppression_group_id: input.suppression_group_id,
|
|
216
|
-
emails: input.emails,
|
|
217
|
-
from_address: input.from_address
|
|
218
|
-
})
|
|
219
|
-
});
|
|
220
|
-
return { success: true };
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
const listSingleSendStats = sendgridOperation({
|
|
224
|
-
id: "sendgrid.list-single-send-stats",
|
|
225
|
-
name: "List All Single Send Stats",
|
|
226
|
-
description: "Return aggregated engagement stats across all Single Sends.",
|
|
227
|
-
input: z.object({
|
|
228
|
-
aggregatedBy: z.enum([
|
|
229
|
-
"total",
|
|
230
|
-
"day",
|
|
231
|
-
"week",
|
|
232
|
-
"month"
|
|
233
|
-
]).optional(),
|
|
234
|
-
pageSize: z.number().int().positive().max(100).optional()
|
|
235
|
-
}).optional(),
|
|
236
|
-
output: sendgridSingleSendStatsListSchema,
|
|
237
|
-
run: async (input, credentials) => {
|
|
238
|
-
const response = await createSendGridClient(credentials).request(stats(), { query: omitUndefined({
|
|
239
|
-
aggregated_by: input?.aggregatedBy,
|
|
240
|
-
page_size: input?.pageSize
|
|
241
|
-
}) });
|
|
242
|
-
return sendgridSingleSendStatsListSchema.parse(response ?? { results: [] });
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
const getSingleSendStats = sendgridOperation({
|
|
246
|
-
id: "sendgrid.get-single-send-stats",
|
|
247
|
-
name: "Get Single Send Stats",
|
|
248
|
-
description: "Return engagement stats for a single Single Send.",
|
|
249
|
-
input: z.object({
|
|
250
|
-
id: sendgridIdSchema,
|
|
251
|
-
aggregatedBy: z.enum([
|
|
252
|
-
"total",
|
|
253
|
-
"day",
|
|
254
|
-
"week",
|
|
255
|
-
"month"
|
|
256
|
-
]).optional()
|
|
257
|
-
}),
|
|
258
|
-
output: sendgridSingleSendStatsSchema,
|
|
259
|
-
run: async (input, credentials) => {
|
|
260
|
-
const response = await createSendGridClient(credentials).request(stats(`/${encodeURIComponent(input.id)}`), { query: omitUndefined({ aggregated_by: input.aggregatedBy }) });
|
|
261
|
-
return sendgridSingleSendStatsSchema.parse(response);
|
|
262
|
-
}
|
|
263
|
-
});
|
|
264
|
-
const getSingleSendClickStats = sendgridOperation({
|
|
265
|
-
id: "sendgrid.get-single-send-click-stats",
|
|
266
|
-
name: "Get Single Send Click Tracking Stats",
|
|
267
|
-
description: "Return click-tracking breakdown for a Single Send.",
|
|
268
|
-
input: z.object({ id: sendgridIdSchema }),
|
|
269
|
-
output: sendgridSingleSendClicksSchema,
|
|
270
|
-
run: async (input, credentials) => {
|
|
271
|
-
const response = await createSendGridClient(credentials).request(stats(`/${encodeURIComponent(input.id)}/links`));
|
|
272
|
-
return sendgridSingleSendClicksSchema.parse(response);
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
//#endregion
|
|
277
|
-
export { bulkDeleteSingleSends, createSingleSend, deleteSingleSend, duplicateSingleSend, getSingleSend, getSingleSendClickStats, getSingleSendStats, listSingleSendStats, listSingleSends, scheduleSingleSend, searchSingleSends, sendTestMarketingEmail, marketing_singlesends_exports as t, unscheduleSingleSend, updateSingleSend };
|
package/dist/operations.d.mts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
//#region src/operations.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Registry of every featured operation exported by this package, indexed by
|
|
4
|
-
* its operation id. Use this for tooling that needs to enumerate the SendGrid
|
|
5
|
-
* surface (coverage matrices, runtime wiring, introspection).
|
|
6
|
-
*
|
|
7
|
-
* Phase-1 scope: the 153 operations covering Mail Send, Templates, Marketing
|
|
8
|
-
* Contacts/Lists/Segments/Single Sends/Custom Fields, Senders + Sender
|
|
9
|
-
* Identities, Suppressions, Email Validation, Stats, User Account, Alerts,
|
|
10
|
-
* Domains, API Keys, Event Webhook config, and Inbound Parse config.
|
|
11
|
-
*
|
|
12
|
-
* See `IMPLEMENTATION_NOTES.md` § 4 Q4 for the phase-1 scope rationale and
|
|
13
|
-
* the list of provider endpoints intentionally left unwrapped.
|
|
14
|
-
*/
|
|
15
|
-
type AnyOperation = {
|
|
16
|
-
readonly id: string;
|
|
17
|
-
readonly name: string;
|
|
18
|
-
readonly description: string;
|
|
19
|
-
readonly needsApproval?: boolean;
|
|
20
|
-
};
|
|
21
|
-
declare const sendgridOperations: Readonly<Record<string, AnyOperation>>;
|
|
22
|
-
declare const sendgridOperationIds: readonly string[];
|
|
23
|
-
declare const sendgridOperationCount: number;
|
|
24
|
-
//#endregion
|
|
25
|
-
export { sendgridOperationCount, sendgridOperationIds, sendgridOperations };
|
package/dist/operations.mjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { t as mail_send_exports } from "./mail-send.mjs";
|
|
2
|
-
import { t as templates_exports } from "./templates.mjs";
|
|
3
|
-
import { t as marketing_contacts_exports } from "./marketing-contacts.mjs";
|
|
4
|
-
import { t as marketing_lists_exports } from "./marketing-lists.mjs";
|
|
5
|
-
import { t as marketing_segments_exports } from "./marketing-segments.mjs";
|
|
6
|
-
import { t as marketing_singlesends_exports } from "./marketing-singlesends.mjs";
|
|
7
|
-
import { t as marketing_customfields_exports } from "./marketing-customfields.mjs";
|
|
8
|
-
import { t as senders_exports } from "./senders.mjs";
|
|
9
|
-
import { t as sender_identities_exports } from "./sender-identities.mjs";
|
|
10
|
-
import { t as suppressions_exports } from "./suppressions.mjs";
|
|
11
|
-
import { t as email_validation_exports } from "./email-validation.mjs";
|
|
12
|
-
import { t as stats_exports } from "./stats.mjs";
|
|
13
|
-
import { t as user_account_exports } from "./user-account.mjs";
|
|
14
|
-
import { t as alerts_exports } from "./alerts.mjs";
|
|
15
|
-
import { t as domains_exports } from "./domains.mjs";
|
|
16
|
-
import { t as api_keys_exports } from "./api-keys.mjs";
|
|
17
|
-
import { t as event_exports } from "./webhooks/event.mjs";
|
|
18
|
-
import { t as parse_exports } from "./webhooks/parse.mjs";
|
|
19
|
-
|
|
20
|
-
//#region src/operations.ts
|
|
21
|
-
/**
|
|
22
|
-
* Registry of every featured operation exported by this package, indexed by
|
|
23
|
-
* its operation id. Use this for tooling that needs to enumerate the SendGrid
|
|
24
|
-
* surface (coverage matrices, runtime wiring, introspection).
|
|
25
|
-
*
|
|
26
|
-
* Phase-1 scope: the 153 operations covering Mail Send, Templates, Marketing
|
|
27
|
-
* Contacts/Lists/Segments/Single Sends/Custom Fields, Senders + Sender
|
|
28
|
-
* Identities, Suppressions, Email Validation, Stats, User Account, Alerts,
|
|
29
|
-
* Domains, API Keys, Event Webhook config, and Inbound Parse config.
|
|
30
|
-
*
|
|
31
|
-
* See `IMPLEMENTATION_NOTES.md` § 4 Q4 for the phase-1 scope rationale and
|
|
32
|
-
* the list of provider endpoints intentionally left unwrapped.
|
|
33
|
-
*/
|
|
34
|
-
function collect(mod) {
|
|
35
|
-
return Object.values(mod).filter((value) => typeof value === "object" && value !== null && "id" in value && "name" in value && "description" in value && typeof value.id === "string");
|
|
36
|
-
}
|
|
37
|
-
const allOperations = [
|
|
38
|
-
...collect(mail_send_exports),
|
|
39
|
-
...collect(templates_exports),
|
|
40
|
-
...collect(marketing_contacts_exports),
|
|
41
|
-
...collect(marketing_lists_exports),
|
|
42
|
-
...collect(marketing_segments_exports),
|
|
43
|
-
...collect(marketing_singlesends_exports),
|
|
44
|
-
...collect(marketing_customfields_exports),
|
|
45
|
-
...collect(senders_exports),
|
|
46
|
-
...collect(sender_identities_exports),
|
|
47
|
-
...collect(suppressions_exports),
|
|
48
|
-
...collect(email_validation_exports),
|
|
49
|
-
...collect(stats_exports),
|
|
50
|
-
...collect(user_account_exports),
|
|
51
|
-
...collect(alerts_exports),
|
|
52
|
-
...collect(domains_exports),
|
|
53
|
-
...collect(api_keys_exports),
|
|
54
|
-
...collect(event_exports),
|
|
55
|
-
...collect(parse_exports)
|
|
56
|
-
];
|
|
57
|
-
const operationsById = Object.freeze(Object.fromEntries(allOperations.map((op) => [op.id, op])));
|
|
58
|
-
if (allOperations.length !== Object.keys(operationsById).length) {
|
|
59
|
-
const counts = /* @__PURE__ */ new Map();
|
|
60
|
-
for (const op of allOperations) counts.set(op.id, (counts.get(op.id) ?? 0) + 1);
|
|
61
|
-
const duplicates = [...counts.entries()].filter(([, n]) => n > 1).map(([id]) => id);
|
|
62
|
-
throw new Error(`Duplicate SendGrid operation ids detected: ${duplicates.join(", ")}. Each exported operation must have a unique id.`);
|
|
63
|
-
}
|
|
64
|
-
const sendgridOperations = operationsById;
|
|
65
|
-
const sendgridOperationIds = Object.freeze(Object.keys(operationsById).sort());
|
|
66
|
-
const sendgridOperationCount = sendgridOperationIds.length;
|
|
67
|
-
|
|
68
|
-
//#endregion
|
|
69
|
-
export { sendgridOperationCount, sendgridOperationIds, sendgridOperations };
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import * as _keystrokehq_core0 from "@keystrokehq/core";
|
|
3
|
-
|
|
4
|
-
//#region src/sender-identities.d.ts
|
|
5
|
-
declare const createSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
6
|
-
nickname: z.ZodString;
|
|
7
|
-
from_email: z.ZodString;
|
|
8
|
-
from_name: z.ZodOptional<z.ZodString>;
|
|
9
|
-
reply_to: z.ZodOptional<z.ZodString>;
|
|
10
|
-
reply_to_name: z.ZodOptional<z.ZodString>;
|
|
11
|
-
address: z.ZodOptional<z.ZodString>;
|
|
12
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
13
|
-
city: z.ZodOptional<z.ZodString>;
|
|
14
|
-
state: z.ZodOptional<z.ZodString>;
|
|
15
|
-
zip: z.ZodOptional<z.ZodString>;
|
|
16
|
-
country: z.ZodOptional<z.ZodString>;
|
|
17
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
18
|
-
id: z.ZodNumber;
|
|
19
|
-
nickname: z.ZodString;
|
|
20
|
-
from_email: z.ZodString;
|
|
21
|
-
from_name: z.ZodOptional<z.ZodString>;
|
|
22
|
-
reply_to: z.ZodOptional<z.ZodString>;
|
|
23
|
-
reply_to_name: z.ZodOptional<z.ZodString>;
|
|
24
|
-
address: z.ZodOptional<z.ZodString>;
|
|
25
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
26
|
-
city: z.ZodOptional<z.ZodString>;
|
|
27
|
-
state: z.ZodOptional<z.ZodString>;
|
|
28
|
-
zip: z.ZodOptional<z.ZodString>;
|
|
29
|
-
country: z.ZodOptional<z.ZodString>;
|
|
30
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
33
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
34
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
35
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
36
|
-
global: "global";
|
|
37
|
-
eu: "eu";
|
|
38
|
-
}>>;
|
|
39
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
40
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
41
|
-
}, z.core.$strip>>], undefined>;
|
|
42
|
-
declare const updateSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
43
|
-
nickname: z.ZodOptional<z.ZodString>;
|
|
44
|
-
from_email: z.ZodOptional<z.ZodString>;
|
|
45
|
-
from_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
46
|
-
reply_to: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
47
|
-
reply_to_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
48
|
-
address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
49
|
-
address2: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
50
|
-
city: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
51
|
-
state: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
52
|
-
zip: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
53
|
-
country: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
54
|
-
id: z.ZodNumber;
|
|
55
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
56
|
-
id: z.ZodNumber;
|
|
57
|
-
nickname: z.ZodString;
|
|
58
|
-
from_email: z.ZodString;
|
|
59
|
-
from_name: z.ZodOptional<z.ZodString>;
|
|
60
|
-
reply_to: z.ZodOptional<z.ZodString>;
|
|
61
|
-
reply_to_name: z.ZodOptional<z.ZodString>;
|
|
62
|
-
address: z.ZodOptional<z.ZodString>;
|
|
63
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
64
|
-
city: z.ZodOptional<z.ZodString>;
|
|
65
|
-
state: z.ZodOptional<z.ZodString>;
|
|
66
|
-
zip: z.ZodOptional<z.ZodString>;
|
|
67
|
-
country: z.ZodOptional<z.ZodString>;
|
|
68
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
69
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
70
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
71
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
72
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
73
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
74
|
-
global: "global";
|
|
75
|
-
eu: "eu";
|
|
76
|
-
}>>;
|
|
77
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
78
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
79
|
-
}, z.core.$strip>>], undefined>;
|
|
80
|
-
declare const deleteSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
81
|
-
id: z.ZodNumber;
|
|
82
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
-
success: z.ZodBoolean;
|
|
84
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
85
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
86
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
87
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
88
|
-
global: "global";
|
|
89
|
-
eu: "eu";
|
|
90
|
-
}>>;
|
|
91
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
92
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
93
|
-
}, z.core.$strip>>], undefined>;
|
|
94
|
-
declare const getSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
95
|
-
id: z.ZodNumber;
|
|
96
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
97
|
-
id: z.ZodNumber;
|
|
98
|
-
nickname: z.ZodString;
|
|
99
|
-
from_email: z.ZodString;
|
|
100
|
-
from_name: z.ZodOptional<z.ZodString>;
|
|
101
|
-
reply_to: z.ZodOptional<z.ZodString>;
|
|
102
|
-
reply_to_name: z.ZodOptional<z.ZodString>;
|
|
103
|
-
address: z.ZodOptional<z.ZodString>;
|
|
104
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
105
|
-
city: z.ZodOptional<z.ZodString>;
|
|
106
|
-
state: z.ZodOptional<z.ZodString>;
|
|
107
|
-
zip: z.ZodOptional<z.ZodString>;
|
|
108
|
-
country: z.ZodOptional<z.ZodString>;
|
|
109
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
110
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
-
}, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
112
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
113
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
114
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
115
|
-
global: "global";
|
|
116
|
-
eu: "eu";
|
|
117
|
-
}>>;
|
|
118
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
119
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
120
|
-
}, z.core.$strip>>], undefined>;
|
|
121
|
-
declare const listSenderIdentities: _keystrokehq_core0.Operation<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
|
|
122
|
-
results: z.ZodArray<z.ZodObject<{
|
|
123
|
-
id: z.ZodNumber;
|
|
124
|
-
nickname: z.ZodString;
|
|
125
|
-
from_email: z.ZodString;
|
|
126
|
-
from_name: z.ZodOptional<z.ZodString>;
|
|
127
|
-
reply_to: z.ZodOptional<z.ZodString>;
|
|
128
|
-
reply_to_name: z.ZodOptional<z.ZodString>;
|
|
129
|
-
address: z.ZodOptional<z.ZodString>;
|
|
130
|
-
address2: z.ZodOptional<z.ZodString>;
|
|
131
|
-
city: z.ZodOptional<z.ZodString>;
|
|
132
|
-
state: z.ZodOptional<z.ZodString>;
|
|
133
|
-
zip: z.ZodOptional<z.ZodString>;
|
|
134
|
-
country: z.ZodOptional<z.ZodString>;
|
|
135
|
-
verified: z.ZodOptional<z.ZodBoolean>;
|
|
136
|
-
locked: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
-
}, z.core.$catchall<z.ZodUnknown>>>;
|
|
138
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
139
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
140
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
141
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
142
|
-
global: "global";
|
|
143
|
-
eu: "eu";
|
|
144
|
-
}>>;
|
|
145
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
146
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
147
|
-
}, z.core.$strip>>], undefined>;
|
|
148
|
-
declare const resendSenderIdentityVerification: _keystrokehq_core0.Operation<z.ZodObject<{
|
|
149
|
-
id: z.ZodNumber;
|
|
150
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
151
|
-
success: z.ZodBoolean;
|
|
152
|
-
}, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"keystroke:sendgrid", z.ZodObject<{
|
|
153
|
-
SENDGRID_API_KEY: z.ZodString;
|
|
154
|
-
SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
|
|
155
|
-
SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
|
|
156
|
-
global: "global";
|
|
157
|
-
eu: "eu";
|
|
158
|
-
}>>;
|
|
159
|
-
SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
|
|
160
|
-
SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
|
|
161
|
-
}, z.core.$strip>>], undefined>;
|
|
162
|
-
//#endregion
|
|
163
|
-
export { createSenderIdentity, deleteSenderIdentity, getSenderIdentity, listSenderIdentities, resendSenderIdentityVerification, updateSenderIdentity };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { n as __exportAll, t as sendgridOperation } from "./factory-7q6CQ75J.mjs";
|
|
2
|
-
import { createSendGridClient } from "./client.mjs";
|
|
3
|
-
import { in as sendgridEmailSchema, it as sendgridVerifiedSenderSchema, rt as sendgridVerifiedSenderListSchema } from "./webhooks-CKdsIikb.mjs";
|
|
4
|
-
import { z } from "zod";
|
|
5
|
-
|
|
6
|
-
//#region src/sender-identities.ts
|
|
7
|
-
var sender_identities_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
-
createSenderIdentity: () => createSenderIdentity,
|
|
9
|
-
deleteSenderIdentity: () => deleteSenderIdentity,
|
|
10
|
-
getSenderIdentity: () => getSenderIdentity,
|
|
11
|
-
listSenderIdentities: () => listSenderIdentities,
|
|
12
|
-
resendSenderIdentityVerification: () => resendSenderIdentityVerification,
|
|
13
|
-
updateSenderIdentity: () => updateSenderIdentity
|
|
14
|
-
});
|
|
15
|
-
const verifiedSenderId = z.number().int().positive();
|
|
16
|
-
const verifiedSenderInput = z.object({
|
|
17
|
-
nickname: z.string().min(1),
|
|
18
|
-
from_email: sendgridEmailSchema,
|
|
19
|
-
from_name: z.string().optional(),
|
|
20
|
-
reply_to: sendgridEmailSchema.optional(),
|
|
21
|
-
reply_to_name: z.string().optional(),
|
|
22
|
-
address: z.string().optional(),
|
|
23
|
-
address2: z.string().optional(),
|
|
24
|
-
city: z.string().optional(),
|
|
25
|
-
state: z.string().optional(),
|
|
26
|
-
zip: z.string().optional(),
|
|
27
|
-
country: z.string().optional()
|
|
28
|
-
});
|
|
29
|
-
const createSenderIdentity = sendgridOperation({
|
|
30
|
-
id: "sendgrid.create-sender-identity",
|
|
31
|
-
name: "Create Verified Sender Identity",
|
|
32
|
-
description: "Create a verified sender identity. SendGrid emails a verification link to `from_email`.",
|
|
33
|
-
input: verifiedSenderInput,
|
|
34
|
-
output: sendgridVerifiedSenderSchema,
|
|
35
|
-
needsApproval: true,
|
|
36
|
-
run: async (input, credentials) => {
|
|
37
|
-
const response = await createSendGridClient(credentials).request("/verified_senders", {
|
|
38
|
-
method: "POST",
|
|
39
|
-
body: input
|
|
40
|
-
});
|
|
41
|
-
return sendgridVerifiedSenderSchema.parse(response);
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const updateSenderIdentity = sendgridOperation({
|
|
45
|
-
id: "sendgrid.update-sender-identity",
|
|
46
|
-
name: "Update Verified Sender Identity",
|
|
47
|
-
description: "Update a verified sender identity.",
|
|
48
|
-
input: verifiedSenderInput.partial().extend({ id: verifiedSenderId }),
|
|
49
|
-
output: sendgridVerifiedSenderSchema,
|
|
50
|
-
needsApproval: true,
|
|
51
|
-
run: async (input, credentials) => {
|
|
52
|
-
const client = createSendGridClient(credentials);
|
|
53
|
-
const { id, ...rest } = input;
|
|
54
|
-
const response = await client.request(`/verified_senders/${id}`, {
|
|
55
|
-
method: "PATCH",
|
|
56
|
-
body: rest
|
|
57
|
-
});
|
|
58
|
-
return sendgridVerifiedSenderSchema.parse(response);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
const deleteSenderIdentity = sendgridOperation({
|
|
62
|
-
id: "sendgrid.delete-sender-identity",
|
|
63
|
-
name: "Delete Verified Sender Identity",
|
|
64
|
-
description: "Delete a verified sender identity.",
|
|
65
|
-
input: z.object({ id: verifiedSenderId }),
|
|
66
|
-
output: z.object({ success: z.boolean() }),
|
|
67
|
-
needsApproval: true,
|
|
68
|
-
run: async (input, credentials) => {
|
|
69
|
-
await createSendGridClient(credentials).request(`/verified_senders/${input.id}`, { method: "DELETE" });
|
|
70
|
-
return { success: true };
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
const getSenderIdentity = sendgridOperation({
|
|
74
|
-
id: "sendgrid.get-sender-identity",
|
|
75
|
-
name: "Get Verified Sender Identity",
|
|
76
|
-
description: "Retrieve a verified sender identity by ID.",
|
|
77
|
-
input: z.object({ id: verifiedSenderId }),
|
|
78
|
-
output: sendgridVerifiedSenderSchema,
|
|
79
|
-
run: async (input, credentials) => {
|
|
80
|
-
const response = await createSendGridClient(credentials).request(`/verified_senders/${input.id}`);
|
|
81
|
-
return sendgridVerifiedSenderSchema.parse(response);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
const listSenderIdentities = sendgridOperation({
|
|
85
|
-
id: "sendgrid.list-sender-identities",
|
|
86
|
-
name: "List Verified Sender Identities",
|
|
87
|
-
description: "List all verified sender identities.",
|
|
88
|
-
input: z.object({}).optional(),
|
|
89
|
-
output: sendgridVerifiedSenderListSchema,
|
|
90
|
-
run: async (_input, credentials) => {
|
|
91
|
-
const response = await createSendGridClient(credentials).request("/verified_senders");
|
|
92
|
-
return sendgridVerifiedSenderListSchema.parse(response ?? { results: [] });
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
const resendSenderIdentityVerification = sendgridOperation({
|
|
96
|
-
id: "sendgrid.resend-sender-identity-verification",
|
|
97
|
-
name: "Resend Sender Identity Verification",
|
|
98
|
-
description: "Resend the verification email for a pending sender identity.",
|
|
99
|
-
input: z.object({ id: verifiedSenderId }),
|
|
100
|
-
output: z.object({ success: z.boolean() }),
|
|
101
|
-
needsApproval: true,
|
|
102
|
-
run: async (input, credentials) => {
|
|
103
|
-
await createSendGridClient(credentials).request(`/verified_senders/resend/${input.id}`, { method: "POST" });
|
|
104
|
-
return { success: true };
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
//#endregion
|
|
109
|
-
export { createSenderIdentity, deleteSenderIdentity, getSenderIdentity, listSenderIdentities, resendSenderIdentityVerification, sender_identities_exports as t, updateSenderIdentity };
|