@keystrokehq/sendgrid 0.0.9 → 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.
Files changed (69) hide show
  1. package/README.md +59 -111
  2. package/dist/credential-sets/index.d.mts +2 -0
  3. package/dist/credential-sets/index.mjs +3 -0
  4. package/dist/index.d.mts +4 -1
  5. package/dist/index.mjs +5 -1
  6. package/dist/operations/index.d.mts +2 -0
  7. package/dist/operations/index.mjs +3 -0
  8. package/dist/schemas/index.d.mts +8 -8
  9. package/dist/schemas/index.mjs +1 -1
  10. package/dist/sendgrid.credential-set-CzYmlJ2Y.mjs +25 -0
  11. package/dist/sendgrid.credential-set-ivRIiUDy.d.mts +32 -0
  12. package/dist/validate-email.operation-CCCDxLjH.mjs +4301 -0
  13. package/dist/validate-email.operation-DY4rCHFE.d.mts +5436 -0
  14. package/package.json +8 -96
  15. package/dist/_official/index.d.mts +0 -2
  16. package/dist/_official/index.mjs +0 -3
  17. package/dist/_runtime/index.d.mts +0 -2
  18. package/dist/_runtime/index.mjs +0 -3
  19. package/dist/alerts.d.mts +0 -193
  20. package/dist/alerts.mjs +0 -101
  21. package/dist/api-keys.d.mts +0 -160
  22. package/dist/api-keys.mjs +0 -113
  23. package/dist/client.d.mts +0 -73
  24. package/dist/client.mjs +0 -260
  25. package/dist/connection.d.mts +0 -2
  26. package/dist/connection.mjs +0 -3
  27. package/dist/domains.d.mts +0 -114
  28. package/dist/domains.mjs +0 -62
  29. package/dist/email-validation.d.mts +0 -134
  30. package/dist/email-validation.mjs +0 -73
  31. package/dist/events.d.mts +0 -69
  32. package/dist/events.mjs +0 -28
  33. package/dist/factory-CToXR1jp.mjs +0 -24
  34. package/dist/integration-C9EALG65.mjs +0 -113
  35. package/dist/integration-zx-jmybs.d.mts +0 -56
  36. package/dist/mail-send.d.mts +0 -315
  37. package/dist/mail-send.mjs +0 -218
  38. package/dist/marketing-contacts.d.mts +0 -607
  39. package/dist/marketing-contacts.mjs +0 -277
  40. package/dist/marketing-customfields.d.mts +0 -94
  41. package/dist/marketing-customfields.mjs +0 -70
  42. package/dist/marketing-lists.d.mts +0 -184
  43. package/dist/marketing-lists.mjs +0 -130
  44. package/dist/marketing-segments.d.mts +0 -340
  45. package/dist/marketing-segments.mjs +0 -179
  46. package/dist/marketing-singlesends.d.mts +0 -648
  47. package/dist/marketing-singlesends.mjs +0 -277
  48. package/dist/operations.d.mts +0 -25
  49. package/dist/operations.mjs +0 -69
  50. package/dist/sender-identities.d.mts +0 -218
  51. package/dist/sender-identities.mjs +0 -109
  52. package/dist/senders.d.mts +0 -227
  53. package/dist/senders.mjs +0 -83
  54. package/dist/shared-BayZ0Lt6.mjs +0 -46
  55. package/dist/stats.d.mts +0 -215
  56. package/dist/stats.mjs +0 -107
  57. package/dist/suppressions.d.mts +0 -785
  58. package/dist/suppressions.mjs +0 -539
  59. package/dist/templates.d.mts +0 -451
  60. package/dist/templates.mjs +0 -238
  61. package/dist/user-account.d.mts +0 -108
  62. package/dist/user-account.mjs +0 -59
  63. package/dist/verification.d.mts +0 -67
  64. package/dist/verification.mjs +0 -72
  65. package/dist/webhooks/event.d.mts +0 -287
  66. package/dist/webhooks/event.mjs +0 -147
  67. package/dist/webhooks/parse.d.mts +0 -172
  68. package/dist/webhooks/parse.mjs +0 -125
  69. /package/dist/{webhooks-CKdsIikb.mjs → webhooks-dVOd93Hd.mjs} +0 -0
@@ -1,109 +0,0 @@
1
- import { n as __exportAll, t as sendgridOperation } from "./factory-CToXR1jp.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 };
@@ -1,227 +0,0 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
- import { z } from "zod";
3
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
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 };
package/dist/senders.mjs DELETED
@@ -1,83 +0,0 @@
1
- import { n as __exportAll, t as sendgridOperation } from "./factory-CToXR1jp.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: "sendgrid.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: "sendgrid.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: "sendgrid.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: "sendgrid.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: "sendgrid.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 };
@@ -1,46 +0,0 @@
1
- import { Operation } from "@keystrokehq/core";
2
- import { z } from "zod";
3
- import "@keystrokehq/core/trigger";
4
-
5
- //#region ../../packages/integration-authoring/dist/index.mjs
6
- function isThenable(value) {
7
- return !!value && typeof value === "object" && "then" in value && typeof value.then === "function";
8
- }
9
- function createErrorNormalizingProxy(target, normalizeError, path = []) {
10
- return new Proxy(target, { get(obj, property, receiver) {
11
- const value = Reflect.get(obj, property, receiver);
12
- if (typeof value === "function") return (...args) => {
13
- try {
14
- const result = value.apply(obj, args);
15
- if (isThenable(result)) return result.then(void 0, (error) => {
16
- throw normalizeError(error, { methodPath: [...path, String(property)].join(".") });
17
- });
18
- return result;
19
- } catch (error) {
20
- throw normalizeError(error, { methodPath: [...path, String(property)].join(".") });
21
- }
22
- };
23
- if (value && typeof value === "object") return createErrorNormalizingProxy(value, normalizeError, [...path, String(property)]);
24
- return value;
25
- } });
26
- }
27
- const IntegrationConfigSchema = z.object({
28
- id: z.string().min(1),
29
- name: z.string().min(1),
30
- description: z.string().optional()
31
- });
32
-
33
- //#endregion
34
- //#region src/shared.ts
35
- function asRecord(value) {
36
- return typeof value === "object" && value !== null ? value : {};
37
- }
38
- function stringIfPresent(value) {
39
- return typeof value === "string" && value.length > 0 ? value : void 0;
40
- }
41
- function omitUndefined(value) {
42
- return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0));
43
- }
44
-
45
- //#endregion
46
- export { createErrorNormalizingProxy as i, omitUndefined as n, stringIfPresent as r, asRecord as t };
package/dist/stats.d.mts DELETED
@@ -1,215 +0,0 @@
1
- import * as _keystrokehq_core0 from "@keystrokehq/core";
2
- import { z } from "zod";
3
- import * as _keystrokehq_core_credential_set0 from "@keystrokehq/core/credential-set";
4
-
5
- //#region src/stats.d.ts
6
- declare const getGlobalEmailStats: _keystrokehq_core0.Operation<z.ZodObject<{
7
- startDate: z.ZodISODate;
8
- endDate: z.ZodOptional<z.ZodISODate>;
9
- aggregatedBy: z.ZodOptional<z.ZodEnum<{
10
- day: "day";
11
- week: "week";
12
- month: "month";
13
- }>>;
14
- }, z.core.$strip>, z.ZodArray<z.ZodObject<{
15
- date: z.ZodString;
16
- stats: z.ZodArray<z.ZodObject<{
17
- type: z.ZodString;
18
- name: z.ZodString;
19
- metrics: z.ZodObject<{
20
- requests: z.ZodOptional<z.ZodNumber>;
21
- delivered: z.ZodOptional<z.ZodNumber>;
22
- opens: z.ZodOptional<z.ZodNumber>;
23
- unique_opens: z.ZodOptional<z.ZodNumber>;
24
- clicks: z.ZodOptional<z.ZodNumber>;
25
- unique_clicks: z.ZodOptional<z.ZodNumber>;
26
- bounces: z.ZodOptional<z.ZodNumber>;
27
- bounce_drops: z.ZodOptional<z.ZodNumber>;
28
- blocks: z.ZodOptional<z.ZodNumber>;
29
- spam_reports: z.ZodOptional<z.ZodNumber>;
30
- unsubscribes: z.ZodOptional<z.ZodNumber>;
31
- unique_unsubscribes: z.ZodOptional<z.ZodNumber>;
32
- processed: z.ZodOptional<z.ZodNumber>;
33
- deferred: z.ZodOptional<z.ZodNumber>;
34
- invalid_emails: z.ZodOptional<z.ZodNumber>;
35
- }, z.core.$catchall<z.ZodUnknown>>;
36
- }, z.core.$strip>>;
37
- }, z.core.$strip>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
38
- SENDGRID_API_KEY: z.ZodString;
39
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
40
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
41
- global: "global";
42
- eu: "eu";
43
- }>>;
44
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
45
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
46
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
47
- SENDGRID_API_KEY: z.ZodString;
48
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
49
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
50
- global: "global";
51
- eu: "eu";
52
- }>>;
53
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
54
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
55
- }, z.core.$strip>>[] | undefined>], undefined>;
56
- declare const getCategoryStats: _keystrokehq_core0.Operation<z.ZodObject<{
57
- startDate: z.ZodISODate;
58
- endDate: z.ZodOptional<z.ZodISODate>;
59
- aggregatedBy: z.ZodOptional<z.ZodEnum<{
60
- day: "day";
61
- week: "week";
62
- month: "month";
63
- }>>;
64
- categories: z.ZodArray<z.ZodString>;
65
- }, z.core.$strip>, z.ZodArray<z.ZodObject<{
66
- date: z.ZodString;
67
- stats: z.ZodArray<z.ZodObject<{
68
- type: z.ZodString;
69
- name: z.ZodString;
70
- metrics: z.ZodObject<{
71
- requests: z.ZodOptional<z.ZodNumber>;
72
- delivered: z.ZodOptional<z.ZodNumber>;
73
- opens: z.ZodOptional<z.ZodNumber>;
74
- unique_opens: z.ZodOptional<z.ZodNumber>;
75
- clicks: z.ZodOptional<z.ZodNumber>;
76
- unique_clicks: z.ZodOptional<z.ZodNumber>;
77
- bounces: z.ZodOptional<z.ZodNumber>;
78
- bounce_drops: z.ZodOptional<z.ZodNumber>;
79
- blocks: z.ZodOptional<z.ZodNumber>;
80
- spam_reports: z.ZodOptional<z.ZodNumber>;
81
- unsubscribes: z.ZodOptional<z.ZodNumber>;
82
- unique_unsubscribes: z.ZodOptional<z.ZodNumber>;
83
- processed: z.ZodOptional<z.ZodNumber>;
84
- deferred: z.ZodOptional<z.ZodNumber>;
85
- invalid_emails: z.ZodOptional<z.ZodNumber>;
86
- }, z.core.$catchall<z.ZodUnknown>>;
87
- }, z.core.$strip>>;
88
- }, z.core.$strip>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
89
- SENDGRID_API_KEY: z.ZodString;
90
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
91
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
92
- global: "global";
93
- eu: "eu";
94
- }>>;
95
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
96
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
97
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
98
- SENDGRID_API_KEY: z.ZodString;
99
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
100
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
101
- global: "global";
102
- eu: "eu";
103
- }>>;
104
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
105
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
106
- }, z.core.$strip>>[] | undefined>], undefined>;
107
- declare const listAutomationStats: _keystrokehq_core0.Operation<z.ZodOptional<z.ZodObject<{
108
- pageSize: z.ZodOptional<z.ZodNumber>;
109
- aggregatedBy: z.ZodOptional<z.ZodEnum<{
110
- day: "day";
111
- week: "week";
112
- month: "month";
113
- total: "total";
114
- }>>;
115
- }, z.core.$strip>>, z.ZodObject<{
116
- results: z.ZodArray<z.ZodUnknown>;
117
- _metadata: z.ZodOptional<z.ZodUnknown>;
118
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
119
- SENDGRID_API_KEY: z.ZodString;
120
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
121
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
122
- global: "global";
123
- eu: "eu";
124
- }>>;
125
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
126
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
127
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
128
- SENDGRID_API_KEY: z.ZodString;
129
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
130
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
131
- global: "global";
132
- eu: "eu";
133
- }>>;
134
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
135
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
136
- }, z.core.$strip>>[] | undefined>], undefined>;
137
- declare const getEngagementQualityScores: _keystrokehq_core0.Operation<z.ZodObject<{
138
- from: z.ZodISODate;
139
- to: z.ZodISODate;
140
- }, z.core.$strip>, z.ZodObject<{
141
- account_id: z.ZodOptional<z.ZodString>;
142
- date: z.ZodOptional<z.ZodString>;
143
- metrics: z.ZodOptional<z.ZodUnknown>;
144
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
145
- SENDGRID_API_KEY: z.ZodString;
146
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
147
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
148
- global: "global";
149
- eu: "eu";
150
- }>>;
151
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
152
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
153
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
154
- SENDGRID_API_KEY: z.ZodString;
155
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
156
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
157
- global: "global";
158
- eu: "eu";
159
- }>>;
160
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
161
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
162
- }, z.core.$strip>>[] | undefined>], undefined>;
163
- declare const listMailboxProviderStats: _keystrokehq_core0.Operation<z.ZodObject<{
164
- startDate: z.ZodISODate;
165
- endDate: z.ZodOptional<z.ZodISODate>;
166
- aggregatedBy: z.ZodOptional<z.ZodEnum<{
167
- day: "day";
168
- week: "week";
169
- month: "month";
170
- }>>;
171
- mailboxProviders: z.ZodOptional<z.ZodArray<z.ZodString>>;
172
- }, z.core.$strip>, z.ZodArray<z.ZodObject<{
173
- date: z.ZodString;
174
- stats: z.ZodArray<z.ZodObject<{
175
- type: z.ZodString;
176
- name: z.ZodString;
177
- metrics: z.ZodObject<{
178
- requests: z.ZodOptional<z.ZodNumber>;
179
- delivered: z.ZodOptional<z.ZodNumber>;
180
- opens: z.ZodOptional<z.ZodNumber>;
181
- unique_opens: z.ZodOptional<z.ZodNumber>;
182
- clicks: z.ZodOptional<z.ZodNumber>;
183
- unique_clicks: z.ZodOptional<z.ZodNumber>;
184
- bounces: z.ZodOptional<z.ZodNumber>;
185
- bounce_drops: z.ZodOptional<z.ZodNumber>;
186
- blocks: z.ZodOptional<z.ZodNumber>;
187
- spam_reports: z.ZodOptional<z.ZodNumber>;
188
- unsubscribes: z.ZodOptional<z.ZodNumber>;
189
- unique_unsubscribes: z.ZodOptional<z.ZodNumber>;
190
- processed: z.ZodOptional<z.ZodNumber>;
191
- deferred: z.ZodOptional<z.ZodNumber>;
192
- invalid_emails: z.ZodOptional<z.ZodNumber>;
193
- }, z.core.$catchall<z.ZodUnknown>>;
194
- }, z.core.$strip>>;
195
- }, z.core.$strip>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
196
- SENDGRID_API_KEY: z.ZodString;
197
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
198
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
199
- global: "global";
200
- eu: "eu";
201
- }>>;
202
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
203
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
204
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
205
- SENDGRID_API_KEY: z.ZodString;
206
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
207
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
208
- global: "global";
209
- eu: "eu";
210
- }>>;
211
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
212
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
213
- }, z.core.$strip>>[] | undefined>], undefined>;
214
- //#endregion
215
- export { getCategoryStats, getEngagementQualityScores, getGlobalEmailStats, listAutomationStats, listMailboxProviderStats };