@keystrokehq/sendgrid 0.0.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.
Files changed (63) hide show
  1. package/README.md +225 -0
  2. package/dist/_official/index.d.mts +2 -0
  3. package/dist/_official/index.mjs +3 -0
  4. package/dist/_runtime/index.d.mts +2 -0
  5. package/dist/_runtime/index.mjs +3 -0
  6. package/dist/alerts.d.mts +193 -0
  7. package/dist/alerts.mjs +101 -0
  8. package/dist/api-keys.d.mts +160 -0
  9. package/dist/api-keys.mjs +113 -0
  10. package/dist/client.d.mts +73 -0
  11. package/dist/client.mjs +261 -0
  12. package/dist/connection.d.mts +2 -0
  13. package/dist/connection.mjs +3 -0
  14. package/dist/domains.d.mts +114 -0
  15. package/dist/domains.mjs +62 -0
  16. package/dist/email-validation.d.mts +134 -0
  17. package/dist/email-validation.mjs +73 -0
  18. package/dist/events.d.mts +69 -0
  19. package/dist/events.mjs +28 -0
  20. package/dist/factory-BSL0D2L0.mjs +25 -0
  21. package/dist/index.d.mts +1 -0
  22. package/dist/index.mjs +1 -0
  23. package/dist/integration-37BovSeK.mjs +23 -0
  24. package/dist/integration-CmJ2TILG.d.mts +57 -0
  25. package/dist/mail-send.d.mts +315 -0
  26. package/dist/mail-send.mjs +218 -0
  27. package/dist/marketing-contacts.d.mts +607 -0
  28. package/dist/marketing-contacts.mjs +277 -0
  29. package/dist/marketing-customfields.d.mts +94 -0
  30. package/dist/marketing-customfields.mjs +70 -0
  31. package/dist/marketing-lists.d.mts +184 -0
  32. package/dist/marketing-lists.mjs +130 -0
  33. package/dist/marketing-segments.d.mts +340 -0
  34. package/dist/marketing-segments.mjs +179 -0
  35. package/dist/marketing-singlesends.d.mts +648 -0
  36. package/dist/marketing-singlesends.mjs +277 -0
  37. package/dist/operations.d.mts +25 -0
  38. package/dist/operations.mjs +69 -0
  39. package/dist/schemas/index.d.mts +1395 -0
  40. package/dist/schemas/index.mjs +3 -0
  41. package/dist/sender-identities.d.mts +218 -0
  42. package/dist/sender-identities.mjs +109 -0
  43. package/dist/senders.d.mts +227 -0
  44. package/dist/senders.mjs +83 -0
  45. package/dist/shared-CQ8JFNXi.mjs +13 -0
  46. package/dist/stats.d.mts +215 -0
  47. package/dist/stats.mjs +107 -0
  48. package/dist/suppressions.d.mts +785 -0
  49. package/dist/suppressions.mjs +539 -0
  50. package/dist/templates.d.mts +451 -0
  51. package/dist/templates.mjs +238 -0
  52. package/dist/triggers.d.mts +35 -0
  53. package/dist/triggers.mjs +98 -0
  54. package/dist/user-account.d.mts +108 -0
  55. package/dist/user-account.mjs +59 -0
  56. package/dist/verification.d.mts +67 -0
  57. package/dist/verification.mjs +72 -0
  58. package/dist/webhooks/event.d.mts +287 -0
  59. package/dist/webhooks/event.mjs +147 -0
  60. package/dist/webhooks/parse.d.mts +172 -0
  61. package/dist/webhooks/parse.mjs +125 -0
  62. package/dist/webhooks-CKdsIikb.mjs +735 -0
  63. package/package.json +162 -0
@@ -0,0 +1,3 @@
1
+ import { $ as sendgridSingleSendTestInputSchema, $t as sendgridAlertFrequencySchema, A as sendgridInvalidEmailRecordSchema, At as sendgridAuthenticatedDomainListSchema, B as sendgridStatBucketSchema, Bt as sendgridContactExportSchema, C as sendgridBounceListSchema, Ct as sendgridListSchema, D as sendgridGroupSuppressionEntrySchema, Dt as sendgridEmailValidationResponseSchema, E as sendgridGlobalSuppressionSchema, Et as sendgridBulkEmailValidationPresignedUrlSchema, F as sendgridAggregationSchema, Ft as sendgridCustomFieldListSchema, G as sendgridSingleSendListSchema, Gt as sendgridContactSearchResultSchema, H as sendgridStatMetricSchema, Ht as sendgridContactImportSchema, I as sendgridAutomationStatsSchema, It as sendgridContactBatchResultSchema, J as sendgridSingleSendSearchInputSchema, Jt as sendgridUpsertContactsResultSchema, K as sendgridSingleSendScheduleInputSchema, Kt as sendgridFieldDefinitionListSchema, L as sendgridCategoryStatsSchema, Lt as sendgridContactCountSchema, M as sendgridSpamReportRecordSchema, Mt as sendgridDnsRecordSchema, N as sendgridSuppressionGroupListSchema, Nt as sendgridDomainValidateResultSchema, O as sendgridGroupSuppressionListSchema, Ot as sendgridEmailValidationResultSchema, P as sendgridSuppressionGroupSchema, Pt as sendgridCustomFieldDefinitionSchema, Q as sendgridSingleSendStatusSchema, Qt as sendgridApiKeyWithKeySchema, R as sendgridEngagementQualitySchema, Rt as sendgridContactDeleteResultSchema, S as sendgridBlockRecordSchema, St as sendgridListRemoveContactsResultSchema, T as sendgridGlobalSuppressionListSchema, Tt as sendgridBulkEmailValidationJobSchema, U as sendgridSingleSendClicksSchema, Ut as sendgridContactInputSchema, V as sendgridStatEntrySchema, Vt as sendgridContactIdentifierSchema, W as sendgridSingleSendEmailConfigSchema, Wt as sendgridContactSchema, X as sendgridSingleSendStatsListSchema, Xt as sendgridApiKeySchema, Y as sendgridSingleSendSendToSchema, Yt as sendgridApiKeyListSchema, Z as sendgridSingleSendStatsSchema, Zt as sendgridApiKeyScopeSchema, _ as sendgridTemplateGenerationSchema, _t as sendgridScheduledSendSchema, a as sendgridInboundParsePayloadSchema, an as sendgridEmptySuccessSchema, at as sendgridSegmentListSchema, b as sendgridTemplateVersionSchema, bt as sendgridListCollectionSchema, c as sendgridParseStatsBucketSchema, cn as sendgridLooseObject, ct as sendgridAttachmentSchema, d as sendgridSignedPublicKeySchema, dt as sendgridMailContentSchema, en as sendgridAlertListSchema, et as sendgridSenderAddressSchema, f as sendgridAccountInfoSchema, ft as sendgridMailSendInputSchema, g as sendgridUserProfileSchema, gt as sendgridScheduledSendListSchema, h as sendgridUserEmailSchema, ht as sendgridPersonalizationSchema, i as sendgridEventWebhookSettingsSchema, in as sendgridEmailSchema, it as sendgridVerifiedSenderSchema, j as sendgridSpamReportListSchema, jt as sendgridAuthenticatedDomainSchema, k as sendgridInvalidEmailListSchema, kt as sendgridEmailValidationVerdictSchema, l as sendgridParseStatsSchema, ln as sendgridPaginationMetadataSchema, lt as sendgridBatchIdSchema, m as sendgridScopesSchema, mt as sendgridMailSettingsSchema, n as sendgridEventWebhookListSchema, nn as sendgridAlertTypeSchema, nt as sendgridSenderSchema, o as sendgridParseSettingListSchema, on as sendgridIdSchema, ot as sendgridSegmentSchema, p as sendgridCreditBalanceSchema, pt as sendgridMailSendResultSchema, q as sendgridSingleSendSchema, qt as sendgridFieldDefinitionSchema, r as sendgridEventWebhookPayloadSchema, rn as sendgridAsmSchema, rt as sendgridVerifiedSenderListSchema, s as sendgridParseSettingSchema, sn as sendgridIsoDatetimeSchema, st as sendgridSegmentStatusSchema, t as sendgridEventWebhookEventSchema, tn as sendgridAlertSchema, tt as sendgridSenderListSchema, u as sendgridSignatureToggleSchema, un as sendgridUnixSecondsSchema, ut as sendgridEmailAddressSchema, v as sendgridTemplateListSchema, vt as sendgridScheduledSendStatusSchema, w as sendgridBounceRecordSchema, wt as sendgridBulkEmailValidationJobListSchema, x as sendgridBlockListSchema, xt as sendgridListContactCountSchema, y as sendgridTemplateSchema, yt as sendgridTrackingSettingsSchema, z as sendgridStatBucketListSchema, zt as sendgridContactExportListSchema } from "../webhooks-CKdsIikb.mjs";
2
+
3
+ export { sendgridAccountInfoSchema, sendgridAggregationSchema, sendgridAlertFrequencySchema, sendgridAlertListSchema, sendgridAlertSchema, sendgridAlertTypeSchema, sendgridApiKeyListSchema, sendgridApiKeySchema, sendgridApiKeyScopeSchema, sendgridApiKeyWithKeySchema, sendgridAsmSchema, sendgridAttachmentSchema, sendgridAuthenticatedDomainListSchema, sendgridAuthenticatedDomainSchema, sendgridAutomationStatsSchema, sendgridBatchIdSchema, sendgridBlockListSchema, sendgridBlockRecordSchema, sendgridBounceListSchema, sendgridBounceRecordSchema, sendgridBulkEmailValidationJobListSchema, sendgridBulkEmailValidationJobSchema, sendgridBulkEmailValidationPresignedUrlSchema, sendgridCategoryStatsSchema, sendgridContactBatchResultSchema, sendgridContactCountSchema, sendgridContactDeleteResultSchema, sendgridContactExportListSchema, sendgridContactExportSchema, sendgridContactIdentifierSchema, sendgridContactImportSchema, sendgridContactInputSchema, sendgridContactSchema, sendgridContactSearchResultSchema, sendgridCreditBalanceSchema, sendgridCustomFieldDefinitionSchema, sendgridCustomFieldListSchema, sendgridDnsRecordSchema, sendgridDomainValidateResultSchema, sendgridEmailAddressSchema, sendgridEmailSchema, sendgridEmailValidationResponseSchema, sendgridEmailValidationResultSchema, sendgridEmailValidationVerdictSchema, sendgridEmptySuccessSchema, sendgridEngagementQualitySchema, sendgridEventWebhookEventSchema, sendgridEventWebhookListSchema, sendgridEventWebhookPayloadSchema, sendgridEventWebhookSettingsSchema, sendgridFieldDefinitionListSchema, sendgridFieldDefinitionSchema, sendgridGlobalSuppressionListSchema, sendgridGlobalSuppressionSchema, sendgridGroupSuppressionEntrySchema, sendgridGroupSuppressionListSchema, sendgridIdSchema, sendgridInboundParsePayloadSchema, sendgridInvalidEmailListSchema, sendgridInvalidEmailRecordSchema, sendgridIsoDatetimeSchema, sendgridListCollectionSchema, sendgridListContactCountSchema, sendgridListRemoveContactsResultSchema, sendgridListSchema, sendgridLooseObject, sendgridMailContentSchema, sendgridMailSendInputSchema, sendgridMailSendResultSchema, sendgridMailSettingsSchema, sendgridPaginationMetadataSchema, sendgridParseSettingListSchema, sendgridParseSettingSchema, sendgridParseStatsBucketSchema, sendgridParseStatsSchema, sendgridPersonalizationSchema, sendgridScheduledSendListSchema, sendgridScheduledSendSchema, sendgridScheduledSendStatusSchema, sendgridScopesSchema, sendgridSegmentListSchema, sendgridSegmentSchema, sendgridSegmentStatusSchema, sendgridSenderAddressSchema, sendgridSenderListSchema, sendgridSenderSchema, sendgridSignatureToggleSchema, sendgridSignedPublicKeySchema, sendgridSingleSendClicksSchema, sendgridSingleSendEmailConfigSchema, sendgridSingleSendListSchema, sendgridSingleSendScheduleInputSchema, sendgridSingleSendSchema, sendgridSingleSendSearchInputSchema, sendgridSingleSendSendToSchema, sendgridSingleSendStatsListSchema, sendgridSingleSendStatsSchema, sendgridSingleSendStatusSchema, sendgridSingleSendTestInputSchema, sendgridSpamReportListSchema, sendgridSpamReportRecordSchema, sendgridStatBucketListSchema, sendgridStatBucketSchema, sendgridStatEntrySchema, sendgridStatMetricSchema, sendgridSuppressionGroupListSchema, sendgridSuppressionGroupSchema, sendgridTemplateGenerationSchema, sendgridTemplateListSchema, sendgridTemplateSchema, sendgridTemplateVersionSchema, sendgridTrackingSettingsSchema, sendgridUnixSecondsSchema, sendgridUpsertContactsResultSchema, sendgridUserEmailSchema, sendgridUserProfileSchema, sendgridVerifiedSenderListSchema, sendgridVerifiedSenderSchema };
@@ -0,0 +1,218 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
3
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
4
+
5
+ //#region src/sender-identities.d.ts
6
+ declare const createSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ nickname: z.ZodString;
8
+ from_email: z.ZodString;
9
+ from_name: z.ZodOptional<z.ZodString>;
10
+ reply_to: z.ZodOptional<z.ZodString>;
11
+ reply_to_name: z.ZodOptional<z.ZodString>;
12
+ address: z.ZodOptional<z.ZodString>;
13
+ address2: z.ZodOptional<z.ZodString>;
14
+ city: z.ZodOptional<z.ZodString>;
15
+ state: z.ZodOptional<z.ZodString>;
16
+ zip: z.ZodOptional<z.ZodString>;
17
+ country: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>, z.ZodObject<{
19
+ id: z.ZodNumber;
20
+ nickname: z.ZodString;
21
+ from_email: z.ZodString;
22
+ from_name: z.ZodOptional<z.ZodString>;
23
+ reply_to: z.ZodOptional<z.ZodString>;
24
+ reply_to_name: z.ZodOptional<z.ZodString>;
25
+ address: z.ZodOptional<z.ZodString>;
26
+ address2: z.ZodOptional<z.ZodString>;
27
+ city: z.ZodOptional<z.ZodString>;
28
+ state: z.ZodOptional<z.ZodString>;
29
+ zip: z.ZodOptional<z.ZodString>;
30
+ country: z.ZodOptional<z.ZodString>;
31
+ verified: z.ZodOptional<z.ZodBoolean>;
32
+ locked: z.ZodOptional<z.ZodBoolean>;
33
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
34
+ SENDGRID_API_KEY: z.ZodString;
35
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
36
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
37
+ global: "global";
38
+ eu: "eu";
39
+ }>>;
40
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
41
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
42
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
43
+ SENDGRID_API_KEY: z.ZodString;
44
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
45
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
46
+ global: "global";
47
+ eu: "eu";
48
+ }>>;
49
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
50
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>>[] | undefined>], undefined>;
52
+ declare const updateSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
53
+ nickname: z.ZodOptional<z.ZodString>;
54
+ from_email: z.ZodOptional<z.ZodString>;
55
+ from_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
56
+ reply_to: z.ZodOptional<z.ZodOptional<z.ZodString>>;
57
+ reply_to_name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
58
+ address: z.ZodOptional<z.ZodOptional<z.ZodString>>;
59
+ address2: z.ZodOptional<z.ZodOptional<z.ZodString>>;
60
+ city: z.ZodOptional<z.ZodOptional<z.ZodString>>;
61
+ state: z.ZodOptional<z.ZodOptional<z.ZodString>>;
62
+ zip: z.ZodOptional<z.ZodOptional<z.ZodString>>;
63
+ country: z.ZodOptional<z.ZodOptional<z.ZodString>>;
64
+ id: z.ZodNumber;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ id: z.ZodNumber;
67
+ nickname: z.ZodString;
68
+ from_email: z.ZodString;
69
+ from_name: z.ZodOptional<z.ZodString>;
70
+ reply_to: z.ZodOptional<z.ZodString>;
71
+ reply_to_name: z.ZodOptional<z.ZodString>;
72
+ address: z.ZodOptional<z.ZodString>;
73
+ address2: z.ZodOptional<z.ZodString>;
74
+ city: z.ZodOptional<z.ZodString>;
75
+ state: z.ZodOptional<z.ZodString>;
76
+ zip: z.ZodOptional<z.ZodString>;
77
+ country: z.ZodOptional<z.ZodString>;
78
+ verified: z.ZodOptional<z.ZodBoolean>;
79
+ locked: z.ZodOptional<z.ZodBoolean>;
80
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
81
+ SENDGRID_API_KEY: z.ZodString;
82
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
83
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
84
+ global: "global";
85
+ eu: "eu";
86
+ }>>;
87
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
88
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
90
+ SENDGRID_API_KEY: z.ZodString;
91
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
92
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
93
+ global: "global";
94
+ eu: "eu";
95
+ }>>;
96
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
97
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
98
+ }, z.core.$strip>>[] | undefined>], undefined>;
99
+ declare const deleteSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
100
+ id: z.ZodNumber;
101
+ }, z.core.$strip>, z.ZodObject<{
102
+ success: z.ZodBoolean;
103
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
104
+ SENDGRID_API_KEY: z.ZodString;
105
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
106
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
107
+ global: "global";
108
+ eu: "eu";
109
+ }>>;
110
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
111
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
113
+ SENDGRID_API_KEY: z.ZodString;
114
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
115
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
116
+ global: "global";
117
+ eu: "eu";
118
+ }>>;
119
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
120
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
121
+ }, z.core.$strip>>[] | undefined>], undefined>;
122
+ declare const getSenderIdentity: _keystrokehq_core0.Operation<z.ZodObject<{
123
+ id: z.ZodNumber;
124
+ }, z.core.$strip>, z.ZodObject<{
125
+ id: z.ZodNumber;
126
+ nickname: z.ZodString;
127
+ from_email: z.ZodString;
128
+ from_name: z.ZodOptional<z.ZodString>;
129
+ reply_to: z.ZodOptional<z.ZodString>;
130
+ reply_to_name: z.ZodOptional<z.ZodString>;
131
+ address: z.ZodOptional<z.ZodString>;
132
+ address2: z.ZodOptional<z.ZodString>;
133
+ city: z.ZodOptional<z.ZodString>;
134
+ state: z.ZodOptional<z.ZodString>;
135
+ zip: z.ZodOptional<z.ZodString>;
136
+ country: z.ZodOptional<z.ZodString>;
137
+ verified: z.ZodOptional<z.ZodBoolean>;
138
+ locked: z.ZodOptional<z.ZodBoolean>;
139
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
140
+ SENDGRID_API_KEY: z.ZodString;
141
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
142
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
143
+ global: "global";
144
+ eu: "eu";
145
+ }>>;
146
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
147
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
149
+ SENDGRID_API_KEY: z.ZodString;
150
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
151
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
152
+ global: "global";
153
+ eu: "eu";
154
+ }>>;
155
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
156
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
157
+ }, z.core.$strip>>[] | undefined>], undefined>;
158
+ declare const listSenderIdentities: _keystrokehq_core0.Operation<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
159
+ results: z.ZodArray<z.ZodObject<{
160
+ id: z.ZodNumber;
161
+ nickname: z.ZodString;
162
+ from_email: z.ZodString;
163
+ from_name: z.ZodOptional<z.ZodString>;
164
+ reply_to: z.ZodOptional<z.ZodString>;
165
+ reply_to_name: z.ZodOptional<z.ZodString>;
166
+ address: z.ZodOptional<z.ZodString>;
167
+ address2: z.ZodOptional<z.ZodString>;
168
+ city: z.ZodOptional<z.ZodString>;
169
+ state: z.ZodOptional<z.ZodString>;
170
+ zip: z.ZodOptional<z.ZodString>;
171
+ country: z.ZodOptional<z.ZodString>;
172
+ verified: z.ZodOptional<z.ZodBoolean>;
173
+ locked: z.ZodOptional<z.ZodBoolean>;
174
+ }, z.core.$catchall<z.ZodUnknown>>>;
175
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
176
+ SENDGRID_API_KEY: z.ZodString;
177
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
178
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
179
+ global: "global";
180
+ eu: "eu";
181
+ }>>;
182
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
183
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
184
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
185
+ SENDGRID_API_KEY: z.ZodString;
186
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
187
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
188
+ global: "global";
189
+ eu: "eu";
190
+ }>>;
191
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
192
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
193
+ }, z.core.$strip>>[] | undefined>], undefined>;
194
+ declare const resendSenderIdentityVerification: _keystrokehq_core0.Operation<z.ZodObject<{
195
+ id: z.ZodNumber;
196
+ }, z.core.$strip>, z.ZodObject<{
197
+ success: z.ZodBoolean;
198
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
199
+ SENDGRID_API_KEY: z.ZodString;
200
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
201
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
202
+ global: "global";
203
+ eu: "eu";
204
+ }>>;
205
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
206
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
207
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
208
+ SENDGRID_API_KEY: z.ZodString;
209
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
210
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
211
+ global: "global";
212
+ eu: "eu";
213
+ }>>;
214
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
215
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$strip>>[] | undefined>], undefined>;
217
+ //#endregion
218
+ export { createSenderIdentity, deleteSenderIdentity, getSenderIdentity, listSenderIdentities, resendSenderIdentityVerification, updateSenderIdentity };
@@ -0,0 +1,109 @@
1
+ import { n as __exportAll, t as sendgridOperation } from "./factory-BSL0D2L0.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: "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: "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: "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: "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: "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: "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 };
@@ -0,0 +1,227 @@
1
+ import { z } from "zod";
2
+ import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
3
+ import * as _keystrokehq_core0 from "@keystrokehq/core";
4
+
5
+ //#region src/senders.d.ts
6
+ declare const createSender: _keystrokehq_core0.Operation<z.ZodObject<{
7
+ nickname: z.ZodString;
8
+ from: z.ZodObject<{
9
+ email: z.ZodString;
10
+ name: z.ZodOptional<z.ZodString>;
11
+ }, z.core.$strip>;
12
+ reply_to: z.ZodObject<{
13
+ email: z.ZodString;
14
+ name: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>;
16
+ address: z.ZodString;
17
+ address_2: z.ZodOptional<z.ZodString>;
18
+ city: z.ZodString;
19
+ state: z.ZodOptional<z.ZodString>;
20
+ zip: z.ZodOptional<z.ZodString>;
21
+ country: z.ZodString;
22
+ }, z.core.$strip>, z.ZodObject<{
23
+ id: z.ZodNumber;
24
+ nickname: z.ZodString;
25
+ from: z.ZodOptional<z.ZodObject<{
26
+ email: z.ZodString;
27
+ name: z.ZodOptional<z.ZodString>;
28
+ }, z.core.$strip>>;
29
+ reply_to: z.ZodOptional<z.ZodObject<{
30
+ email: z.ZodString;
31
+ name: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$strip>>;
33
+ address: z.ZodOptional<z.ZodString>;
34
+ address_2: z.ZodOptional<z.ZodString>;
35
+ city: z.ZodOptional<z.ZodString>;
36
+ state: z.ZodOptional<z.ZodString>;
37
+ zip: z.ZodOptional<z.ZodString>;
38
+ country: z.ZodOptional<z.ZodString>;
39
+ verified: z.ZodOptional<z.ZodBoolean>;
40
+ locked: z.ZodOptional<z.ZodBoolean>;
41
+ created_at: z.ZodOptional<z.ZodNumber>;
42
+ updated_at: z.ZodOptional<z.ZodNumber>;
43
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
44
+ SENDGRID_API_KEY: z.ZodString;
45
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
46
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
47
+ global: "global";
48
+ eu: "eu";
49
+ }>>;
50
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
51
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
52
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
53
+ SENDGRID_API_KEY: z.ZodString;
54
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
55
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
56
+ global: "global";
57
+ eu: "eu";
58
+ }>>;
59
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
60
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
61
+ }, z.core.$strip>>[] | undefined>], undefined>;
62
+ declare const updateSender: _keystrokehq_core0.Operation<z.ZodObject<{
63
+ nickname: z.ZodOptional<z.ZodString>;
64
+ from: z.ZodOptional<z.ZodObject<{
65
+ email: z.ZodString;
66
+ name: z.ZodOptional<z.ZodString>;
67
+ }, z.core.$strip>>;
68
+ reply_to: z.ZodOptional<z.ZodObject<{
69
+ email: z.ZodString;
70
+ name: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strip>>;
72
+ address: z.ZodOptional<z.ZodString>;
73
+ address_2: z.ZodOptional<z.ZodOptional<z.ZodString>>;
74
+ city: z.ZodOptional<z.ZodString>;
75
+ state: z.ZodOptional<z.ZodOptional<z.ZodString>>;
76
+ zip: z.ZodOptional<z.ZodOptional<z.ZodString>>;
77
+ country: z.ZodOptional<z.ZodString>;
78
+ senderId: z.ZodNumber;
79
+ }, z.core.$strip>, z.ZodObject<{
80
+ id: z.ZodNumber;
81
+ nickname: z.ZodString;
82
+ from: z.ZodOptional<z.ZodObject<{
83
+ email: z.ZodString;
84
+ name: z.ZodOptional<z.ZodString>;
85
+ }, z.core.$strip>>;
86
+ reply_to: z.ZodOptional<z.ZodObject<{
87
+ email: z.ZodString;
88
+ name: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strip>>;
90
+ address: z.ZodOptional<z.ZodString>;
91
+ address_2: z.ZodOptional<z.ZodString>;
92
+ city: z.ZodOptional<z.ZodString>;
93
+ state: z.ZodOptional<z.ZodString>;
94
+ zip: z.ZodOptional<z.ZodString>;
95
+ country: z.ZodOptional<z.ZodString>;
96
+ verified: z.ZodOptional<z.ZodBoolean>;
97
+ locked: z.ZodOptional<z.ZodBoolean>;
98
+ created_at: z.ZodOptional<z.ZodNumber>;
99
+ updated_at: z.ZodOptional<z.ZodNumber>;
100
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
101
+ SENDGRID_API_KEY: z.ZodString;
102
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
103
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
104
+ global: "global";
105
+ eu: "eu";
106
+ }>>;
107
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
108
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
110
+ SENDGRID_API_KEY: z.ZodString;
111
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
112
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
113
+ global: "global";
114
+ eu: "eu";
115
+ }>>;
116
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
117
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
118
+ }, z.core.$strip>>[] | undefined>], undefined>;
119
+ declare const deleteSender: _keystrokehq_core0.Operation<z.ZodObject<{
120
+ senderId: z.ZodNumber;
121
+ }, z.core.$strip>, z.ZodObject<{
122
+ success: z.ZodBoolean;
123
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
124
+ SENDGRID_API_KEY: z.ZodString;
125
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
126
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
127
+ global: "global";
128
+ eu: "eu";
129
+ }>>;
130
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
131
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
132
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
133
+ SENDGRID_API_KEY: z.ZodString;
134
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
135
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
136
+ global: "global";
137
+ eu: "eu";
138
+ }>>;
139
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
140
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
141
+ }, z.core.$strip>>[] | undefined>], undefined>;
142
+ declare const getSender: _keystrokehq_core0.Operation<z.ZodObject<{
143
+ senderId: z.ZodNumber;
144
+ }, z.core.$strip>, z.ZodObject<{
145
+ id: z.ZodNumber;
146
+ nickname: z.ZodString;
147
+ from: z.ZodOptional<z.ZodObject<{
148
+ email: z.ZodString;
149
+ name: z.ZodOptional<z.ZodString>;
150
+ }, z.core.$strip>>;
151
+ reply_to: z.ZodOptional<z.ZodObject<{
152
+ email: z.ZodString;
153
+ name: z.ZodOptional<z.ZodString>;
154
+ }, z.core.$strip>>;
155
+ address: z.ZodOptional<z.ZodString>;
156
+ address_2: z.ZodOptional<z.ZodString>;
157
+ city: z.ZodOptional<z.ZodString>;
158
+ state: z.ZodOptional<z.ZodString>;
159
+ zip: z.ZodOptional<z.ZodString>;
160
+ country: z.ZodOptional<z.ZodString>;
161
+ verified: z.ZodOptional<z.ZodBoolean>;
162
+ locked: z.ZodOptional<z.ZodBoolean>;
163
+ created_at: z.ZodOptional<z.ZodNumber>;
164
+ updated_at: z.ZodOptional<z.ZodNumber>;
165
+ }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"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>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
175
+ SENDGRID_API_KEY: z.ZodString;
176
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
177
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
178
+ global: "global";
179
+ eu: "eu";
180
+ }>>;
181
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
182
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
183
+ }, z.core.$strip>>[] | undefined>], undefined>;
184
+ declare const listSenders: _keystrokehq_core0.Operation<z.ZodOptional<z.ZodObject<{}, z.core.$strip>>, z.ZodObject<{
185
+ results: z.ZodArray<z.ZodObject<{
186
+ id: z.ZodNumber;
187
+ nickname: z.ZodString;
188
+ from: z.ZodOptional<z.ZodObject<{
189
+ email: z.ZodString;
190
+ name: z.ZodOptional<z.ZodString>;
191
+ }, z.core.$strip>>;
192
+ reply_to: z.ZodOptional<z.ZodObject<{
193
+ email: z.ZodString;
194
+ name: z.ZodOptional<z.ZodString>;
195
+ }, z.core.$strip>>;
196
+ address: z.ZodOptional<z.ZodString>;
197
+ address_2: z.ZodOptional<z.ZodString>;
198
+ city: z.ZodOptional<z.ZodString>;
199
+ state: z.ZodOptional<z.ZodString>;
200
+ zip: z.ZodOptional<z.ZodString>;
201
+ country: z.ZodOptional<z.ZodString>;
202
+ verified: z.ZodOptional<z.ZodBoolean>;
203
+ locked: z.ZodOptional<z.ZodBoolean>;
204
+ created_at: z.ZodOptional<z.ZodNumber>;
205
+ updated_at: z.ZodOptional<z.ZodNumber>;
206
+ }, z.core.$catchall<z.ZodUnknown>>>;
207
+ }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
208
+ SENDGRID_API_KEY: z.ZodString;
209
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
210
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
211
+ global: "global";
212
+ eu: "eu";
213
+ }>>;
214
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
215
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
216
+ }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
217
+ SENDGRID_API_KEY: z.ZodString;
218
+ SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
219
+ SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
220
+ global: "global";
221
+ eu: "eu";
222
+ }>>;
223
+ SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
224
+ SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
225
+ }, z.core.$strip>>[] | undefined>], undefined>;
226
+ //#endregion
227
+ export { createSender, deleteSender, getSender, listSenders, updateSender };
@@ -0,0 +1,83 @@
1
+ import { n as __exportAll, t as sendgridOperation } from "./factory-BSL0D2L0.mjs";
2
+ import { createSendGridClient } from "./client.mjs";
3
+ import { et as sendgridSenderAddressSchema, nt as sendgridSenderSchema, tt as sendgridSenderListSchema } from "./webhooks-CKdsIikb.mjs";
4
+ import { z } from "zod";
5
+
6
+ //#region src/senders.ts
7
+ var senders_exports = /* @__PURE__ */ __exportAll({
8
+ createSender: () => createSender,
9
+ deleteSender: () => deleteSender,
10
+ getSender: () => getSender,
11
+ listSenders: () => listSenders,
12
+ updateSender: () => updateSender
13
+ });
14
+ const senderId = z.number().int().positive();
15
+ const createSender = sendgridOperation({
16
+ id: "create_sender",
17
+ name: "Create Marketing Sender",
18
+ description: "Create a Marketing Campaigns sender.",
19
+ input: sendgridSenderAddressSchema,
20
+ output: sendgridSenderSchema,
21
+ needsApproval: true,
22
+ run: async (input, credentials) => {
23
+ const response = await createSendGridClient(credentials).request("/marketing/senders", {
24
+ method: "POST",
25
+ body: input
26
+ });
27
+ return sendgridSenderSchema.parse(response);
28
+ }
29
+ });
30
+ const updateSender = sendgridOperation({
31
+ id: "update_sender",
32
+ name: "Update Marketing Sender",
33
+ description: "Update a Marketing Campaigns sender.",
34
+ input: sendgridSenderAddressSchema.partial().extend({ senderId }),
35
+ output: sendgridSenderSchema,
36
+ needsApproval: true,
37
+ run: async (input, credentials) => {
38
+ const client = createSendGridClient(credentials);
39
+ const { senderId: id, ...rest } = input;
40
+ const response = await client.request(`/marketing/senders/${id}`, {
41
+ method: "PATCH",
42
+ body: rest
43
+ });
44
+ return sendgridSenderSchema.parse(response);
45
+ }
46
+ });
47
+ const deleteSender = sendgridOperation({
48
+ id: "delete_sender",
49
+ name: "Delete Marketing Sender",
50
+ description: "Delete a Marketing Campaigns sender.",
51
+ input: z.object({ senderId }),
52
+ output: z.object({ success: z.boolean() }),
53
+ needsApproval: true,
54
+ run: async (input, credentials) => {
55
+ await createSendGridClient(credentials).request(`/marketing/senders/${input.senderId}`, { method: "DELETE" });
56
+ return { success: true };
57
+ }
58
+ });
59
+ const getSender = sendgridOperation({
60
+ id: "get_sender",
61
+ name: "Get Marketing Sender",
62
+ description: "Retrieve a Marketing Campaigns sender by ID.",
63
+ input: z.object({ senderId }),
64
+ output: sendgridSenderSchema,
65
+ run: async (input, credentials) => {
66
+ const response = await createSendGridClient(credentials).request(`/marketing/senders/${input.senderId}`);
67
+ return sendgridSenderSchema.parse(response);
68
+ }
69
+ });
70
+ const listSenders = sendgridOperation({
71
+ id: "list_senders",
72
+ name: "List Marketing Senders",
73
+ description: "List all Marketing Campaigns senders.",
74
+ input: z.object({}).optional(),
75
+ output: sendgridSenderListSchema,
76
+ run: async (_input, credentials) => {
77
+ const response = await createSendGridClient(credentials).request("/marketing/senders");
78
+ return sendgridSenderListSchema.parse(response ?? { results: [] });
79
+ }
80
+ });
81
+
82
+ //#endregion
83
+ export { createSender, deleteSender, getSender, listSenders, senders_exports as t, updateSender };
@@ -0,0 +1,13 @@
1
+ //#region src/shared.ts
2
+ function asRecord(value) {
3
+ return typeof value === "object" && value !== null ? value : {};
4
+ }
5
+ function stringIfPresent(value) {
6
+ return typeof value === "string" && value.length > 0 ? value : void 0;
7
+ }
8
+ function omitUndefined(value) {
9
+ return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
10
+ }
11
+
12
+ //#endregion
13
+ export { omitUndefined as n, stringIfPresent as r, asRecord as t };