@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,277 +0,0 @@
1
- import { n as __exportAll, t as sendgridOperation } from "./factory-CToXR1jp.mjs";
2
- import { n as omitUndefined } from "./shared-BayZ0Lt6.mjs";
3
- import { createSendGridClient } from "./client.mjs";
4
- import { Bt as sendgridContactExportSchema, Gt as sendgridContactSearchResultSchema, Ht as sendgridContactImportSchema, It as sendgridContactBatchResultSchema, Jt as sendgridUpsertContactsResultSchema, Kt as sendgridFieldDefinitionListSchema, Lt as sendgridContactCountSchema, Rt as sendgridContactDeleteResultSchema, Ut as sendgridContactInputSchema, Wt as sendgridContactSchema, in as sendgridEmailSchema, on as sendgridIdSchema, zt as sendgridContactExportListSchema } from "./webhooks-CKdsIikb.mjs";
5
- import { z } from "zod";
6
-
7
- //#region src/marketing-contacts.ts
8
- var marketing_contacts_exports = /* @__PURE__ */ __exportAll({
9
- createContactExport: () => createContactExport,
10
- createContactImport: () => createContactImport,
11
- deleteContactIdentifier: () => deleteContactIdentifier,
12
- deleteContacts: () => deleteContacts,
13
- getContact: () => getContact,
14
- getContactCount: () => getContactCount,
15
- getContactExportStatus: () => getContactExportStatus,
16
- getContactImportStatus: () => getContactImportStatus,
17
- getContactSample: () => getContactSample,
18
- getContactsByEmails: () => getContactsByEmails,
19
- getContactsByIdentifiers: () => getContactsByIdentifiers,
20
- getContactsByIds: () => getContactsByIds,
21
- listContactExports: () => listContactExports,
22
- listFieldDefinitions: () => listFieldDefinitions,
23
- searchContacts: () => searchContacts,
24
- upsertContacts: () => upsertContacts
25
- });
26
- const contactIdsSchema = z.array(sendgridIdSchema).min(1).max(100);
27
- const upsertContacts = sendgridOperation({
28
- id: "sendgrid.upsert-contacts",
29
- name: "Add or Update Contacts",
30
- description: "Upsert up to 30,000 contacts in Marketing Contacts v3. Returns a job ID; processing is asynchronous.",
31
- input: z.object({
32
- listIds: z.array(sendgridIdSchema).optional(),
33
- contacts: z.array(sendgridContactInputSchema).min(1).max(3e4)
34
- }),
35
- output: sendgridUpsertContactsResultSchema,
36
- needsApproval: true,
37
- run: async (input, credentials) => {
38
- const response = await createSendGridClient(credentials).request("/marketing/contacts", {
39
- method: "PUT",
40
- body: omitUndefined({
41
- list_ids: input.listIds,
42
- contacts: input.contacts
43
- })
44
- });
45
- return sendgridUpsertContactsResultSchema.parse(response);
46
- }
47
- });
48
- const deleteContacts = sendgridOperation({
49
- id: "sendgrid.delete-contacts",
50
- name: "Delete Contacts",
51
- description: "Delete contacts by ID. Set `deleteAllContacts` to wipe every contact in the account.",
52
- input: z.object({
53
- ids: contactIdsSchema.optional(),
54
- deleteAllContacts: z.boolean().optional()
55
- }).refine((v) => v.ids !== void 0 !== (v.deleteAllContacts === true), { message: "Provide either `ids` or `deleteAllContacts: true`, not both." }),
56
- output: sendgridContactDeleteResultSchema,
57
- needsApproval: true,
58
- run: async (input, credentials) => {
59
- const response = await createSendGridClient(credentials).request("/marketing/contacts", {
60
- method: "DELETE",
61
- query: omitUndefined({
62
- ids: input.ids?.join(","),
63
- delete_all_contacts: input.deleteAllContacts ? "true" : void 0
64
- })
65
- });
66
- return sendgridContactDeleteResultSchema.parse(response);
67
- }
68
- });
69
- const getContact = sendgridOperation({
70
- id: "sendgrid.get-contact",
71
- name: "Get Contact by ID",
72
- description: "Retrieve a single contact by its SendGrid contact ID.",
73
- input: z.object({ contactId: sendgridIdSchema }),
74
- output: sendgridContactSchema,
75
- run: async (input, credentials) => {
76
- const response = await createSendGridClient(credentials).request(`/marketing/contacts/${encodeURIComponent(input.contactId)}`);
77
- return sendgridContactSchema.parse(response);
78
- }
79
- });
80
- const getContactsByIds = sendgridOperation({
81
- id: "sendgrid.get-contacts-by-ids",
82
- name: "Get Batched Contacts by IDs",
83
- description: "Fetch up to 100 contacts in a single batched request.",
84
- input: z.object({ ids: contactIdsSchema }),
85
- output: sendgridContactBatchResultSchema,
86
- run: async (input, credentials) => {
87
- const response = await createSendGridClient(credentials).request("/marketing/contacts/batch", {
88
- method: "POST",
89
- body: { ids: input.ids }
90
- });
91
- return sendgridContactBatchResultSchema.parse(response ?? { result: [] });
92
- }
93
- });
94
- const getContactsByEmails = sendgridOperation({
95
- id: "sendgrid.get-contacts-by-emails",
96
- name: "Get Contacts by Email Addresses",
97
- description: "Find contacts by email (up to 100 per request).",
98
- input: z.object({ emails: z.array(sendgridEmailSchema).min(1).max(100) }),
99
- output: sendgridContactSearchResultSchema,
100
- run: async (input, credentials) => {
101
- const response = await createSendGridClient(credentials).request("/marketing/contacts/search/emails", {
102
- method: "POST",
103
- body: { emails: input.emails }
104
- });
105
- return sendgridContactSearchResultSchema.parse({ result: Array.isArray(response?.result) ? response.result : Object.values(response?.result ?? {}).map((entry) => entry.contact ?? entry) });
106
- }
107
- });
108
- const getContactsByIdentifiers = sendgridOperation({
109
- id: "sendgrid.get-contacts-by-identifiers",
110
- name: "Get Contacts by Identifiers",
111
- description: "Find contacts by alternate identifiers (e.g. phone, WhatsApp).",
112
- input: z.object({
113
- identifierType: z.enum([
114
- "phone_number_id",
115
- "external_id",
116
- "anonymous_id",
117
- "whatsapp"
118
- ]),
119
- identifiers: z.array(z.string().min(1)).min(1).max(100)
120
- }),
121
- output: sendgridContactSearchResultSchema,
122
- run: async (input, credentials) => {
123
- const response = await createSendGridClient(credentials).request("/marketing/contacts/search/identifiers", {
124
- method: "POST",
125
- body: {
126
- identifier_type: input.identifierType,
127
- identifiers: input.identifiers
128
- }
129
- });
130
- return sendgridContactSearchResultSchema.parse(response ?? { result: [] });
131
- }
132
- });
133
- const getContactSample = sendgridOperation({
134
- id: "sendgrid.get-contact-sample",
135
- name: "Get Sample Contacts",
136
- description: "Return up to 50 sample contacts for inspection (not a full list).",
137
- input: z.object({}).optional(),
138
- output: sendgridContactSearchResultSchema,
139
- run: async (_input, credentials) => {
140
- const response = await createSendGridClient(credentials).request("/marketing/contacts");
141
- return sendgridContactSearchResultSchema.parse(response ?? { result: [] });
142
- }
143
- });
144
- const getContactCount = sendgridOperation({
145
- id: "sendgrid.get-contact-count",
146
- name: "Get Total Contact Count",
147
- description: "Return the total + billable contact count for the account.",
148
- input: z.object({}).optional(),
149
- output: sendgridContactCountSchema,
150
- run: async (_input, credentials) => {
151
- const response = await createSendGridClient(credentials).request("/marketing/contacts/count");
152
- return sendgridContactCountSchema.parse(response);
153
- }
154
- });
155
- const searchContacts = sendgridOperation({
156
- id: "sendgrid.search-contacts",
157
- name: "Search Contacts",
158
- description: "Search contacts using a SQL-like `query` expression. Example: `email LIKE '%@example.com' AND last_name = 'Smith'`.",
159
- input: z.object({ query: z.string().min(1) }),
160
- output: sendgridContactSearchResultSchema,
161
- run: async (input, credentials) => {
162
- const response = await createSendGridClient(credentials).request("/marketing/contacts/search", {
163
- method: "POST",
164
- body: { query: input.query }
165
- });
166
- return sendgridContactSearchResultSchema.parse(response ?? { result: [] });
167
- }
168
- });
169
- const createContactImport = sendgridOperation({
170
- id: "sendgrid.create-contact-import",
171
- name: "Create Contact Import",
172
- description: "Create a contact-import job. Returns presigned upload details you then PUT a CSV to.",
173
- input: z.object({
174
- fileType: z.enum(["csv"]).default("csv"),
175
- fieldMappings: z.array(z.string()).optional(),
176
- listIds: z.array(sendgridIdSchema).optional()
177
- }),
178
- output: sendgridContactImportSchema,
179
- needsApproval: true,
180
- run: async (input, credentials) => {
181
- const response = await createSendGridClient(credentials).request("/marketing/contacts/imports", {
182
- method: "PUT",
183
- body: omitUndefined({
184
- file_type: input.fileType,
185
- field_mappings: input.fieldMappings,
186
- list_ids: input.listIds
187
- })
188
- });
189
- return sendgridContactImportSchema.parse(response);
190
- }
191
- });
192
- const getContactImportStatus = sendgridOperation({
193
- id: "sendgrid.get-contact-import-status",
194
- name: "Get Contact Import Status",
195
- description: "Retrieve status for a contact-import job.",
196
- input: z.object({ importId: sendgridIdSchema }),
197
- output: sendgridContactImportSchema,
198
- run: async (input, credentials) => {
199
- const response = await createSendGridClient(credentials).request(`/marketing/contacts/imports/${encodeURIComponent(input.importId)}`);
200
- return sendgridContactImportSchema.parse(response);
201
- }
202
- });
203
- const createContactExport = sendgridOperation({
204
- id: "sendgrid.create-contact-export",
205
- name: "Create Contact Export",
206
- description: "Create a contact-export job. Returns a job ID you poll for CSV URLs.",
207
- input: z.object({
208
- listIds: z.array(sendgridIdSchema).optional(),
209
- segmentIds: z.array(sendgridIdSchema).optional(),
210
- fileType: z.enum(["csv", "json"]).default("csv"),
211
- maxFileSize: z.number().int().positive().optional(),
212
- notifications: z.object({ email: z.object({ addresses: z.array(sendgridEmailSchema) }) }).optional()
213
- }),
214
- output: sendgridContactExportSchema,
215
- needsApproval: true,
216
- run: async (input, credentials) => {
217
- const response = await createSendGridClient(credentials).request("/marketing/contacts/exports", {
218
- method: "POST",
219
- body: omitUndefined({
220
- list_ids: input.listIds,
221
- segment_ids: input.segmentIds,
222
- file_type: input.fileType,
223
- max_file_size: input.maxFileSize,
224
- notifications: input.notifications
225
- })
226
- });
227
- return sendgridContactExportSchema.parse(response);
228
- }
229
- });
230
- const getContactExportStatus = sendgridOperation({
231
- id: "sendgrid.get-contact-export-status",
232
- name: "Get Contact Export Status",
233
- description: "Retrieve status (and signed CSV URLs when ready) for a contact-export job.",
234
- input: z.object({ exportId: sendgridIdSchema }),
235
- output: sendgridContactExportSchema,
236
- run: async (input, credentials) => {
237
- const response = await createSendGridClient(credentials).request(`/marketing/contacts/exports/${encodeURIComponent(input.exportId)}`);
238
- return sendgridContactExportSchema.parse(response);
239
- }
240
- });
241
- const listContactExports = sendgridOperation({
242
- id: "sendgrid.list-contact-exports",
243
- name: "List Existing Contact Exports",
244
- description: "List all contact-export jobs.",
245
- input: z.object({}).optional(),
246
- output: sendgridContactExportListSchema,
247
- run: async (_input, credentials) => {
248
- const response = await createSendGridClient(credentials).request("/marketing/contacts/exports");
249
- return sendgridContactExportListSchema.parse(response ?? { result: [] });
250
- }
251
- });
252
- const listFieldDefinitions = sendgridOperation({
253
- id: "sendgrid.list-field-definitions",
254
- name: "List Custom and Reserved Fields",
255
- description: "Return all custom and reserved Marketing Contacts field definitions.",
256
- input: z.object({}).optional(),
257
- output: sendgridFieldDefinitionListSchema,
258
- run: async (_input, credentials) => {
259
- const response = await createSendGridClient(credentials).request("/marketing/field_definitions");
260
- return sendgridFieldDefinitionListSchema.parse(response);
261
- }
262
- });
263
- const deleteContactIdentifier = sendgridOperation({
264
- id: "sendgrid.delete-contact-identifier",
265
- name: "Delete Contact Identifier",
266
- description: "Remove an alternate identifier (phone, external id, whatsapp, etc.) from a contact.",
267
- input: z.object({ identifierId: sendgridIdSchema }),
268
- output: z.object({ success: z.boolean() }),
269
- needsApproval: true,
270
- run: async (input, credentials) => {
271
- await createSendGridClient(credentials).request(`/marketing/contacts/identifiers/${encodeURIComponent(input.identifierId)}`, { method: "DELETE" });
272
- return { success: true };
273
- }
274
- });
275
-
276
- //#endregion
277
- export { createContactExport, createContactImport, deleteContactIdentifier, deleteContacts, getContact, getContactCount, getContactExportStatus, getContactImportStatus, getContactSample, getContactsByEmails, getContactsByIdentifiers, getContactsByIds, listContactExports, listFieldDefinitions, searchContacts, marketing_contacts_exports as t, upsertContacts };
@@ -1,94 +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/marketing-customfields.d.ts
6
- declare const createCustomField: _keystrokehq_core0.Operation<z.ZodObject<{
7
- name: z.ZodString;
8
- fieldType: z.ZodEnum<{
9
- Text: "Text";
10
- Number: "Number";
11
- Date: "Date";
12
- }>;
13
- }, z.core.$strip>, z.ZodObject<{
14
- id: z.ZodString;
15
- name: z.ZodString;
16
- field_type: z.ZodEnum<{
17
- Text: "Text";
18
- Number: "Number";
19
- Date: "Date";
20
- }>;
21
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
22
- SENDGRID_API_KEY: z.ZodString;
23
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
24
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
25
- global: "global";
26
- eu: "eu";
27
- }>>;
28
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
29
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
30
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
31
- SENDGRID_API_KEY: z.ZodString;
32
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
33
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
34
- global: "global";
35
- eu: "eu";
36
- }>>;
37
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
38
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
39
- }, z.core.$strip>>[] | undefined>], undefined>;
40
- declare const updateCustomField: _keystrokehq_core0.Operation<z.ZodObject<{
41
- fieldId: z.ZodString;
42
- name: z.ZodString;
43
- }, z.core.$strip>, z.ZodObject<{
44
- id: z.ZodString;
45
- name: z.ZodString;
46
- field_type: z.ZodEnum<{
47
- Text: "Text";
48
- Number: "Number";
49
- Date: "Date";
50
- }>;
51
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
52
- SENDGRID_API_KEY: z.ZodString;
53
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
54
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
55
- global: "global";
56
- eu: "eu";
57
- }>>;
58
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
59
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
60
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
61
- SENDGRID_API_KEY: z.ZodString;
62
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
63
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
64
- global: "global";
65
- eu: "eu";
66
- }>>;
67
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
68
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
69
- }, z.core.$strip>>[] | undefined>], undefined>;
70
- declare const deleteCustomField: _keystrokehq_core0.Operation<z.ZodObject<{
71
- fieldId: z.ZodString;
72
- }, z.core.$strip>, z.ZodObject<{
73
- success: z.ZodBoolean;
74
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
75
- SENDGRID_API_KEY: z.ZodString;
76
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
77
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
78
- global: "global";
79
- eu: "eu";
80
- }>>;
81
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
82
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
83
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
84
- SENDGRID_API_KEY: z.ZodString;
85
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
86
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
87
- global: "global";
88
- eu: "eu";
89
- }>>;
90
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
91
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
92
- }, z.core.$strip>>[] | undefined>], undefined>;
93
- //#endregion
94
- export { createCustomField, deleteCustomField, updateCustomField };
@@ -1,70 +0,0 @@
1
- import { n as __exportAll, t as sendgridOperation } from "./factory-CToXR1jp.mjs";
2
- import { createSendGridClient } from "./client.mjs";
3
- import { Pt as sendgridCustomFieldDefinitionSchema, on as sendgridIdSchema } from "./webhooks-CKdsIikb.mjs";
4
- import { z } from "zod";
5
-
6
- //#region src/marketing-customfields.ts
7
- var marketing_customfields_exports = /* @__PURE__ */ __exportAll({
8
- createCustomField: () => createCustomField,
9
- deleteCustomField: () => deleteCustomField,
10
- updateCustomField: () => updateCustomField
11
- });
12
- const fieldType = z.enum([
13
- "Text",
14
- "Number",
15
- "Date"
16
- ]);
17
- const createCustomField = sendgridOperation({
18
- id: "sendgrid.create-custom-field",
19
- name: "Create Custom Field",
20
- description: "Create a Marketing Contacts custom field definition.",
21
- input: z.object({
22
- name: z.string().min(1),
23
- fieldType
24
- }),
25
- output: sendgridCustomFieldDefinitionSchema,
26
- needsApproval: true,
27
- run: async (input, credentials) => {
28
- const response = await createSendGridClient(credentials).request("/marketing/field_definitions", {
29
- method: "POST",
30
- body: {
31
- name: input.name,
32
- field_type: input.fieldType
33
- }
34
- });
35
- return sendgridCustomFieldDefinitionSchema.parse(response);
36
- }
37
- });
38
- const updateCustomField = sendgridOperation({
39
- id: "sendgrid.update-custom-field",
40
- name: "Update Custom Field",
41
- description: "Rename a Marketing Contacts custom field.",
42
- input: z.object({
43
- fieldId: sendgridIdSchema,
44
- name: z.string().min(1)
45
- }),
46
- output: sendgridCustomFieldDefinitionSchema,
47
- needsApproval: true,
48
- run: async (input, credentials) => {
49
- const response = await createSendGridClient(credentials).request(`/marketing/field_definitions/${encodeURIComponent(input.fieldId)}`, {
50
- method: "PATCH",
51
- body: { name: input.name }
52
- });
53
- return sendgridCustomFieldDefinitionSchema.parse(response);
54
- }
55
- });
56
- const deleteCustomField = sendgridOperation({
57
- id: "sendgrid.delete-custom-field",
58
- name: "Delete Custom Field",
59
- description: "Delete a Marketing Contacts custom field definition.",
60
- input: z.object({ fieldId: sendgridIdSchema }),
61
- output: z.object({ success: z.boolean() }),
62
- needsApproval: true,
63
- run: async (input, credentials) => {
64
- await createSendGridClient(credentials).request(`/marketing/field_definitions/${encodeURIComponent(input.fieldId)}`, { method: "DELETE" });
65
- return { success: true };
66
- }
67
- });
68
-
69
- //#endregion
70
- export { createCustomField, deleteCustomField, marketing_customfields_exports as t, updateCustomField };
@@ -1,184 +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/marketing-lists.d.ts
6
- declare const createList: _keystrokehq_core0.Operation<z.ZodObject<{
7
- name: z.ZodString;
8
- }, z.core.$strip>, z.ZodObject<{
9
- id: z.ZodString;
10
- name: z.ZodString;
11
- contact_count: z.ZodOptional<z.ZodNumber>;
12
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
13
- SENDGRID_API_KEY: z.ZodString;
14
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
15
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
16
- global: "global";
17
- eu: "eu";
18
- }>>;
19
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
20
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
21
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
22
- SENDGRID_API_KEY: z.ZodString;
23
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
24
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
25
- global: "global";
26
- eu: "eu";
27
- }>>;
28
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
29
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
30
- }, z.core.$strip>>[] | undefined>], undefined>;
31
- declare const updateList: _keystrokehq_core0.Operation<z.ZodObject<{
32
- listId: z.ZodString;
33
- name: z.ZodString;
34
- }, z.core.$strip>, z.ZodObject<{
35
- id: z.ZodString;
36
- name: z.ZodString;
37
- contact_count: z.ZodOptional<z.ZodNumber>;
38
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
39
- SENDGRID_API_KEY: z.ZodString;
40
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
41
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
42
- global: "global";
43
- eu: "eu";
44
- }>>;
45
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
46
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
47
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
48
- SENDGRID_API_KEY: z.ZodString;
49
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
50
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
51
- global: "global";
52
- eu: "eu";
53
- }>>;
54
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
55
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
56
- }, z.core.$strip>>[] | undefined>], undefined>;
57
- declare const listMarketingLists: _keystrokehq_core0.Operation<z.ZodOptional<z.ZodObject<{
58
- pageSize: z.ZodOptional<z.ZodNumber>;
59
- pageToken: z.ZodOptional<z.ZodString>;
60
- }, z.core.$strip>>, z.ZodObject<{
61
- result: z.ZodArray<z.ZodObject<{
62
- id: z.ZodString;
63
- name: z.ZodString;
64
- contact_count: z.ZodOptional<z.ZodNumber>;
65
- }, z.core.$catchall<z.ZodUnknown>>>;
66
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
67
- SENDGRID_API_KEY: z.ZodString;
68
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
69
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
70
- global: "global";
71
- eu: "eu";
72
- }>>;
73
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
74
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
75
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
76
- SENDGRID_API_KEY: z.ZodString;
77
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
78
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
79
- global: "global";
80
- eu: "eu";
81
- }>>;
82
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
83
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
84
- }, z.core.$strip>>[] | undefined>], undefined>;
85
- declare const getList: _keystrokehq_core0.Operation<z.ZodObject<{
86
- listId: z.ZodString;
87
- contactSampleSize: z.ZodOptional<z.ZodNumber>;
88
- }, z.core.$strip>, z.ZodObject<{
89
- id: z.ZodString;
90
- name: z.ZodString;
91
- contact_count: z.ZodOptional<z.ZodNumber>;
92
- }, z.core.$catchall<z.ZodUnknown>>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
93
- SENDGRID_API_KEY: z.ZodString;
94
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
95
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
96
- global: "global";
97
- eu: "eu";
98
- }>>;
99
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
100
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
101
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
102
- SENDGRID_API_KEY: z.ZodString;
103
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
104
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
105
- global: "global";
106
- eu: "eu";
107
- }>>;
108
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
109
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
110
- }, z.core.$strip>>[] | undefined>], undefined>;
111
- declare const getListContactCount: _keystrokehq_core0.Operation<z.ZodObject<{
112
- listId: z.ZodString;
113
- }, z.core.$strip>, z.ZodObject<{
114
- contact_count: z.ZodNumber;
115
- billable_count: z.ZodOptional<z.ZodNumber>;
116
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
117
- SENDGRID_API_KEY: z.ZodString;
118
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
119
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
120
- global: "global";
121
- eu: "eu";
122
- }>>;
123
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
124
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
125
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
126
- SENDGRID_API_KEY: z.ZodString;
127
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
128
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
129
- global: "global";
130
- eu: "eu";
131
- }>>;
132
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
133
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
134
- }, z.core.$strip>>[] | undefined>], undefined>;
135
- declare const removeContactsFromList: _keystrokehq_core0.Operation<z.ZodObject<{
136
- listId: z.ZodString;
137
- contactIds: z.ZodArray<z.ZodString>;
138
- }, z.core.$strip>, z.ZodObject<{
139
- job_id: z.ZodString;
140
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
141
- SENDGRID_API_KEY: z.ZodString;
142
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
143
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
144
- global: "global";
145
- eu: "eu";
146
- }>>;
147
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
148
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
149
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
150
- SENDGRID_API_KEY: z.ZodString;
151
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
152
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
153
- global: "global";
154
- eu: "eu";
155
- }>>;
156
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
157
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
158
- }, z.core.$strip>>[] | undefined>], undefined>;
159
- declare const deleteList: _keystrokehq_core0.Operation<z.ZodObject<{
160
- listId: z.ZodString;
161
- deleteContacts: z.ZodOptional<z.ZodBoolean>;
162
- }, z.core.$strip>, z.ZodObject<{
163
- success: z.ZodBoolean;
164
- }, z.core.$strip>, readonly [_keystrokehq_core0.CredentialSet<"sendgrid", z.ZodObject<{
165
- SENDGRID_API_KEY: z.ZodString;
166
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
167
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
168
- global: "global";
169
- eu: "eu";
170
- }>>;
171
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
172
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
173
- }, z.core.$strip>, readonly _keystrokehq_core_credential_set0.CredentialConnection<z.ZodObject<{
174
- SENDGRID_API_KEY: z.ZodString;
175
- SENDGRID_SUBUSER: z.ZodOptional<z.ZodString>;
176
- SENDGRID_ACCOUNT_REGION: z.ZodDefault<z.ZodEnum<{
177
- global: "global";
178
- eu: "eu";
179
- }>>;
180
- SENDGRID_EVENT_WEBHOOK_PUBLIC_KEY: z.ZodOptional<z.ZodString>;
181
- SENDGRID_INBOUND_PARSE_TOKEN: z.ZodOptional<z.ZodString>;
182
- }, z.core.$strip>>[] | undefined>], undefined>;
183
- //#endregion
184
- export { createList, deleteList, getList, getListContactCount, listMarketingLists, removeContactsFromList, updateList };