@wix/auto_sdk_email-transmissions_email-transmissions 1.0.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 (52) hide show
  1. package/build/cjs/index.d.ts +46 -0
  2. package/build/cjs/index.js +488 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +744 -0
  5. package/build/cjs/index.typings.js +434 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +551 -0
  8. package/build/cjs/meta.js +343 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/schemas.d.ts +423 -0
  11. package/build/cjs/schemas.js +748 -0
  12. package/build/cjs/schemas.js.map +1 -0
  13. package/build/es/index.d.mts +46 -0
  14. package/build/es/index.mjs +454 -0
  15. package/build/es/index.mjs.map +1 -0
  16. package/build/es/index.typings.d.mts +744 -0
  17. package/build/es/index.typings.mjs +399 -0
  18. package/build/es/index.typings.mjs.map +1 -0
  19. package/build/es/meta.d.mts +551 -0
  20. package/build/es/meta.mjs +307 -0
  21. package/build/es/meta.mjs.map +1 -0
  22. package/build/es/package.json +3 -0
  23. package/build/es/schemas.d.mts +423 -0
  24. package/build/es/schemas.mjs +704 -0
  25. package/build/es/schemas.mjs.map +1 -0
  26. package/build/internal/cjs/index.d.ts +46 -0
  27. package/build/internal/cjs/index.js +488 -0
  28. package/build/internal/cjs/index.js.map +1 -0
  29. package/build/internal/cjs/index.typings.d.ts +744 -0
  30. package/build/internal/cjs/index.typings.js +434 -0
  31. package/build/internal/cjs/index.typings.js.map +1 -0
  32. package/build/internal/cjs/meta.d.ts +551 -0
  33. package/build/internal/cjs/meta.js +343 -0
  34. package/build/internal/cjs/meta.js.map +1 -0
  35. package/build/internal/cjs/schemas.d.ts +423 -0
  36. package/build/internal/cjs/schemas.js +748 -0
  37. package/build/internal/cjs/schemas.js.map +1 -0
  38. package/build/internal/es/index.d.mts +46 -0
  39. package/build/internal/es/index.mjs +454 -0
  40. package/build/internal/es/index.mjs.map +1 -0
  41. package/build/internal/es/index.typings.d.mts +744 -0
  42. package/build/internal/es/index.typings.mjs +399 -0
  43. package/build/internal/es/index.typings.mjs.map +1 -0
  44. package/build/internal/es/meta.d.mts +551 -0
  45. package/build/internal/es/meta.mjs +307 -0
  46. package/build/internal/es/meta.mjs.map +1 -0
  47. package/build/internal/es/schemas.d.mts +423 -0
  48. package/build/internal/es/schemas.mjs +704 -0
  49. package/build/internal/es/schemas.mjs.map +1 -0
  50. package/meta/package.json +3 -0
  51. package/package.json +61 -0
  52. package/schemas/package.json +3 -0
@@ -0,0 +1,704 @@
1
+ // src/emails-transmissions-v1-email-transmission-email-transmissions.schemas.ts
2
+ import * as z from "zod";
3
+ var SendEmailTransmissionRequest = z.object({
4
+ emailTransmission: z.intersection(
5
+ z.object({
6
+ _id: z.string().describe("EmailTransmission ID.").regex(
7
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
8
+ "Must be a valid GUID"
9
+ ).optional(),
10
+ _createdDate: z.date().describe("Date and time the EmailTransmission was created.").optional().nullable(),
11
+ _updatedDate: z.date().describe("Date and time the EmailTransmission was last updated.").optional().nullable(),
12
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
13
+ "Revision number, which increments by 1 each time the EmailTransmission is updated."
14
+ ).optional().nullable(),
15
+ emailSubject: z.string().describe("Email subject (optional). Default - empty.").max(200).optional().nullable(),
16
+ emailHtmlContent: z.string().describe(
17
+ "Full HTML content of the email to be sent.\nNote that this field is not returned in the QueryEmailTransmissions endpoint for performance reasons. Use GetEmailTransmission to retrieve the full content of a specific email transmission.\nImportant: in order to save storage space, this field will only be stored for 30 days after the email transmission is created. After that, it will be deleted and will not be retrievable anymore."
18
+ ).max(1e6),
19
+ metadata: z.record(z.string(), z.string()).describe(
20
+ "Request metadata (optional). Default - empty.\nProvided values will be passed to the ESP and then included in various callbacks to identify the context in which an email was sent.\nLength of each key and value must be between 1 and 50 alphanumeric characters."
21
+ ).optional(),
22
+ senderName: z.string().describe("Sender name (optional). Default - empty.").min(1).max(50).optional().nullable(),
23
+ senderEmailAddress: z.string().describe(
24
+ 'Sender email address (optional). Default - wix owned email address (for example "no-reply@wixsitemail.com").\nIf provided sender email address is unauthenticated and cannot be used for sending emails (for example gmail.com), it will be replaced with wix owned email address.\nIn that case provided email address will be used as reply-to unless reply-to email address is provided explicitly.'
25
+ ).email().optional().nullable(),
26
+ replyTo: z.intersection(
27
+ z.object({
28
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
29
+ failureReason: z.enum([
30
+ "NONE",
31
+ "RECIPIENT_NOT_FOUND",
32
+ "EMAIL_ADDRESS_MISSING",
33
+ "EMAIL_ADDRESS_INVALID",
34
+ "EMAIL_ADDRESS_BOUNCED",
35
+ "MARKETING_CONSENT_NOT_GIVEN",
36
+ "NOT_SITE_COLLABORATOR"
37
+ ]).optional()
38
+ }),
39
+ z.xor([
40
+ z.object({
41
+ userId: z.never().optional(),
42
+ emailAddress: z.never().optional(),
43
+ contactId: z.string().describe(
44
+ "Recipient email address will be resolved from Contacts API."
45
+ ).regex(
46
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
47
+ "Must be a valid GUID"
48
+ )
49
+ }),
50
+ z.object({
51
+ contactId: z.never().optional(),
52
+ emailAddress: z.never().optional(),
53
+ userId: z.string().describe(
54
+ "Recipient email address will be resolved from Users API."
55
+ ).regex(
56
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
57
+ "Must be a valid GUID"
58
+ )
59
+ }),
60
+ z.object({
61
+ contactId: z.never().optional(),
62
+ userId: z.never().optional(),
63
+ emailAddress: z.string().describe(
64
+ "Contact will be created with this email address if it does not exist yet."
65
+ ).email()
66
+ })
67
+ ])
68
+ ).describe(
69
+ 'Recipient to whom replies will be sent (optional). Default - empty (which effectively resolves to "sender_email_address").'
70
+ ).optional(),
71
+ toRecipients: z.array(
72
+ z.intersection(
73
+ z.object({
74
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
75
+ failureReason: z.enum([
76
+ "NONE",
77
+ "RECIPIENT_NOT_FOUND",
78
+ "EMAIL_ADDRESS_MISSING",
79
+ "EMAIL_ADDRESS_INVALID",
80
+ "EMAIL_ADDRESS_BOUNCED",
81
+ "MARKETING_CONSENT_NOT_GIVEN",
82
+ "NOT_SITE_COLLABORATOR"
83
+ ]).optional()
84
+ }),
85
+ z.xor([
86
+ z.object({
87
+ userId: z.never().optional(),
88
+ emailAddress: z.never().optional(),
89
+ contactId: z.string().describe(
90
+ "Recipient email address will be resolved from Contacts API."
91
+ ).regex(
92
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
93
+ "Must be a valid GUID"
94
+ )
95
+ }),
96
+ z.object({
97
+ contactId: z.never().optional(),
98
+ emailAddress: z.never().optional(),
99
+ userId: z.string().describe(
100
+ "Recipient email address will be resolved from Users API."
101
+ ).regex(
102
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
103
+ "Must be a valid GUID"
104
+ )
105
+ }),
106
+ z.object({
107
+ contactId: z.never().optional(),
108
+ userId: z.never().optional(),
109
+ emailAddress: z.string().describe(
110
+ "Contact will be created with this email address if it does not exist yet."
111
+ ).email()
112
+ })
113
+ ])
114
+ )
115
+ ).min(1).max(100),
116
+ type: z.enum(["TRANSACTIONAL", "MARKETING"]),
117
+ status: z.enum(["ACCEPTED", "IN_PROGRESS", "PROCESSED", "REJECTED"]).optional()
118
+ }),
119
+ z.intersection(
120
+ z.xor([
121
+ z.object({ marketingOptions: z.never().optional() }),
122
+ z.object({
123
+ marketingOptions: z.object({
124
+ unsubscribeUrlPlaceholder: z.string().describe(
125
+ "Placeholder that will be replaced with the actual unsubscribe URL in the email content (optional, case sensitive).\nMake sure it's unique and not used anywhere else in the email content.\nFor example, you can use a placeholder like {{unsubscribe_url}} or [UNSUBSCRIBE_URL].\nIf it's not provided, then unsubscribe URL (in site main language) text will be added to the bottom of the email."
126
+ ).max(100).optional().nullable()
127
+ }).describe("Options for marketing email.")
128
+ })
129
+ ]),
130
+ z.xor([
131
+ z.object({ rejectedOptions: z.never().optional() }),
132
+ z.object({
133
+ rejectedOptions: z.object({
134
+ rejectionReasons: z.array(
135
+ z.enum([
136
+ "BLACKLISTED_SENDER_EMAIL",
137
+ "BLACKLISTED_SENDER_NAME",
138
+ "BLACKLISTED_REPLY_TO_EMAIL",
139
+ "BLACKLISTED_REPLY_TO_NAME",
140
+ "BLACKLISTED_LINK",
141
+ "BLACKLISTED_TEXT"
142
+ ])
143
+ ).min(1).max(10).optional()
144
+ }).describe("Options for rejected email transmission.")
145
+ })
146
+ ])
147
+ )
148
+ ).describe("EmailTransmission to be created."),
149
+ options: z.object({
150
+ idempotencyKey: z.string().describe(
151
+ "Idempotency key used to prevent duplicate email transmissions (optional).\nIf a request with the same idempotency key is received, the server will return the same response as the original request."
152
+ ).regex(
153
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
154
+ "Must be a valid GUID"
155
+ ).optional().nullable()
156
+ }).optional()
157
+ });
158
+ var SendEmailTransmissionResponse = z.object({
159
+ emailTransmission: z.intersection(
160
+ z.object({
161
+ _id: z.string().describe("EmailTransmission ID.").regex(
162
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
163
+ "Must be a valid GUID"
164
+ ).optional(),
165
+ _createdDate: z.date().describe("Date and time the EmailTransmission was created.").optional().nullable(),
166
+ _updatedDate: z.date().describe("Date and time the EmailTransmission was last updated.").optional().nullable(),
167
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
168
+ "Revision number, which increments by 1 each time the EmailTransmission is updated."
169
+ ).optional().nullable(),
170
+ emailSubject: z.string().describe("Email subject (optional). Default - empty.").max(200).optional().nullable(),
171
+ emailHtmlContent: z.string().describe(
172
+ "Full HTML content of the email to be sent.\nNote that this field is not returned in the QueryEmailTransmissions endpoint for performance reasons. Use GetEmailTransmission to retrieve the full content of a specific email transmission.\nImportant: in order to save storage space, this field will only be stored for 30 days after the email transmission is created. After that, it will be deleted and will not be retrievable anymore."
173
+ ).max(1e6).optional(),
174
+ metadata: z.record(z.string(), z.string()).describe(
175
+ "Request metadata (optional). Default - empty.\nProvided values will be passed to the ESP and then included in various callbacks to identify the context in which an email was sent.\nLength of each key and value must be between 1 and 50 alphanumeric characters."
176
+ ).optional(),
177
+ senderName: z.string().describe("Sender name (optional). Default - empty.").min(1).max(50).optional().nullable(),
178
+ senderEmailAddress: z.string().describe(
179
+ 'Sender email address (optional). Default - wix owned email address (for example "no-reply@wixsitemail.com").\nIf provided sender email address is unauthenticated and cannot be used for sending emails (for example gmail.com), it will be replaced with wix owned email address.\nIn that case provided email address will be used as reply-to unless reply-to email address is provided explicitly.'
180
+ ).email().optional().nullable(),
181
+ replyTo: z.intersection(
182
+ z.object({
183
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
184
+ failureReason: z.enum([
185
+ "NONE",
186
+ "RECIPIENT_NOT_FOUND",
187
+ "EMAIL_ADDRESS_MISSING",
188
+ "EMAIL_ADDRESS_INVALID",
189
+ "EMAIL_ADDRESS_BOUNCED",
190
+ "MARKETING_CONSENT_NOT_GIVEN",
191
+ "NOT_SITE_COLLABORATOR"
192
+ ]).describe(
193
+ "Failure reason - filled if the recipient was skipped and the email was not sent to them. Otherwise, it will be NONE."
194
+ ).optional()
195
+ }),
196
+ z.xor([
197
+ z.object({
198
+ contactId: z.never().optional(),
199
+ userId: z.never().optional(),
200
+ emailAddress: z.never().optional()
201
+ }),
202
+ z.object({
203
+ userId: z.never().optional(),
204
+ emailAddress: z.never().optional(),
205
+ contactId: z.string().describe(
206
+ "Recipient email address will be resolved from Contacts API."
207
+ ).regex(
208
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
209
+ "Must be a valid GUID"
210
+ )
211
+ }),
212
+ z.object({
213
+ contactId: z.never().optional(),
214
+ emailAddress: z.never().optional(),
215
+ userId: z.string().describe(
216
+ "Recipient email address will be resolved from Users API."
217
+ ).regex(
218
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
219
+ "Must be a valid GUID"
220
+ )
221
+ }),
222
+ z.object({
223
+ contactId: z.never().optional(),
224
+ userId: z.never().optional(),
225
+ emailAddress: z.string().describe(
226
+ "Contact will be created with this email address if it does not exist yet."
227
+ ).email()
228
+ })
229
+ ])
230
+ ).describe(
231
+ 'Recipient to whom replies will be sent (optional). Default - empty (which effectively resolves to "sender_email_address").'
232
+ ).optional(),
233
+ toRecipients: z.array(
234
+ z.intersection(
235
+ z.object({
236
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
237
+ failureReason: z.enum([
238
+ "NONE",
239
+ "RECIPIENT_NOT_FOUND",
240
+ "EMAIL_ADDRESS_MISSING",
241
+ "EMAIL_ADDRESS_INVALID",
242
+ "EMAIL_ADDRESS_BOUNCED",
243
+ "MARKETING_CONSENT_NOT_GIVEN",
244
+ "NOT_SITE_COLLABORATOR"
245
+ ]).describe(
246
+ "Failure reason - filled if the recipient was skipped and the email was not sent to them. Otherwise, it will be NONE."
247
+ ).optional()
248
+ }),
249
+ z.xor([
250
+ z.object({
251
+ contactId: z.never().optional(),
252
+ userId: z.never().optional(),
253
+ emailAddress: z.never().optional()
254
+ }),
255
+ z.object({
256
+ userId: z.never().optional(),
257
+ emailAddress: z.never().optional(),
258
+ contactId: z.string().describe(
259
+ "Recipient email address will be resolved from Contacts API."
260
+ ).regex(
261
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
262
+ "Must be a valid GUID"
263
+ )
264
+ }),
265
+ z.object({
266
+ contactId: z.never().optional(),
267
+ emailAddress: z.never().optional(),
268
+ userId: z.string().describe(
269
+ "Recipient email address will be resolved from Users API."
270
+ ).regex(
271
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
272
+ "Must be a valid GUID"
273
+ )
274
+ }),
275
+ z.object({
276
+ contactId: z.never().optional(),
277
+ userId: z.never().optional(),
278
+ emailAddress: z.string().describe(
279
+ "Contact will be created with this email address if it does not exist yet."
280
+ ).email()
281
+ })
282
+ ])
283
+ )
284
+ ).min(1).max(100).optional(),
285
+ type: z.enum(["TRANSACTIONAL", "MARKETING"]).describe("Email type - transactional or marketing.").optional(),
286
+ status: z.enum(["ACCEPTED", "IN_PROGRESS", "PROCESSED", "REJECTED"]).describe("Email transmission status.").optional()
287
+ }),
288
+ z.intersection(
289
+ z.xor([
290
+ z.object({ marketingOptions: z.never().optional() }),
291
+ z.object({
292
+ marketingOptions: z.object({
293
+ unsubscribeUrlPlaceholder: z.string().describe(
294
+ "Placeholder that will be replaced with the actual unsubscribe URL in the email content (optional, case sensitive).\nMake sure it's unique and not used anywhere else in the email content.\nFor example, you can use a placeholder like {{unsubscribe_url}} or [UNSUBSCRIBE_URL].\nIf it's not provided, then unsubscribe URL (in site main language) text will be added to the bottom of the email."
295
+ ).max(100).optional().nullable()
296
+ }).describe("Options for marketing email.")
297
+ })
298
+ ]),
299
+ z.xor([
300
+ z.object({ rejectedOptions: z.never().optional() }),
301
+ z.object({
302
+ rejectedOptions: z.object({
303
+ rejectionReasons: z.array(
304
+ z.enum([
305
+ "BLACKLISTED_SENDER_EMAIL",
306
+ "BLACKLISTED_SENDER_NAME",
307
+ "BLACKLISTED_REPLY_TO_EMAIL",
308
+ "BLACKLISTED_REPLY_TO_NAME",
309
+ "BLACKLISTED_LINK",
310
+ "BLACKLISTED_TEXT"
311
+ ])
312
+ ).min(1).max(10).optional()
313
+ }).describe("Options for rejected email transmission.")
314
+ })
315
+ ])
316
+ )
317
+ ).describe("The created EmailTransmission.").optional()
318
+ });
319
+ var GetEmailTransmissionRequest = z.object({
320
+ emailTransmissionId: z.string().describe("ID of the EmailTransmission to retrieve.").regex(
321
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
322
+ "Must be a valid GUID"
323
+ )
324
+ });
325
+ var GetEmailTransmissionResponse = z.intersection(
326
+ z.object({
327
+ _id: z.string().describe("EmailTransmission ID.").regex(
328
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
329
+ "Must be a valid GUID"
330
+ ).optional(),
331
+ _createdDate: z.date().describe("Date and time the EmailTransmission was created.").optional().nullable(),
332
+ _updatedDate: z.date().describe("Date and time the EmailTransmission was last updated.").optional().nullable(),
333
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
334
+ "Revision number, which increments by 1 each time the EmailTransmission is updated."
335
+ ).optional().nullable(),
336
+ emailSubject: z.string().describe("Email subject (optional). Default - empty.").max(200).optional().nullable(),
337
+ emailHtmlContent: z.string().describe(
338
+ "Full HTML content of the email to be sent.\nNote that this field is not returned in the QueryEmailTransmissions endpoint for performance reasons. Use GetEmailTransmission to retrieve the full content of a specific email transmission.\nImportant: in order to save storage space, this field will only be stored for 30 days after the email transmission is created. After that, it will be deleted and will not be retrievable anymore."
339
+ ).max(1e6).optional(),
340
+ metadata: z.record(z.string(), z.string()).describe(
341
+ "Request metadata (optional). Default - empty.\nProvided values will be passed to the ESP and then included in various callbacks to identify the context in which an email was sent.\nLength of each key and value must be between 1 and 50 alphanumeric characters."
342
+ ).optional(),
343
+ senderName: z.string().describe("Sender name (optional). Default - empty.").min(1).max(50).optional().nullable(),
344
+ senderEmailAddress: z.string().describe(
345
+ 'Sender email address (optional). Default - wix owned email address (for example "no-reply@wixsitemail.com").\nIf provided sender email address is unauthenticated and cannot be used for sending emails (for example gmail.com), it will be replaced with wix owned email address.\nIn that case provided email address will be used as reply-to unless reply-to email address is provided explicitly.'
346
+ ).email().optional().nullable(),
347
+ replyTo: z.intersection(
348
+ z.object({
349
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
350
+ failureReason: z.enum([
351
+ "NONE",
352
+ "RECIPIENT_NOT_FOUND",
353
+ "EMAIL_ADDRESS_MISSING",
354
+ "EMAIL_ADDRESS_INVALID",
355
+ "EMAIL_ADDRESS_BOUNCED",
356
+ "MARKETING_CONSENT_NOT_GIVEN",
357
+ "NOT_SITE_COLLABORATOR"
358
+ ]).describe(
359
+ "Failure reason - filled if the recipient was skipped and the email was not sent to them. Otherwise, it will be NONE."
360
+ ).optional()
361
+ }),
362
+ z.xor([
363
+ z.object({
364
+ contactId: z.never().optional(),
365
+ userId: z.never().optional(),
366
+ emailAddress: z.never().optional()
367
+ }),
368
+ z.object({
369
+ userId: z.never().optional(),
370
+ emailAddress: z.never().optional(),
371
+ contactId: z.string().describe(
372
+ "Recipient email address will be resolved from Contacts API."
373
+ ).regex(
374
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
375
+ "Must be a valid GUID"
376
+ )
377
+ }),
378
+ z.object({
379
+ contactId: z.never().optional(),
380
+ emailAddress: z.never().optional(),
381
+ userId: z.string().describe(
382
+ "Recipient email address will be resolved from Users API."
383
+ ).regex(
384
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
385
+ "Must be a valid GUID"
386
+ )
387
+ }),
388
+ z.object({
389
+ contactId: z.never().optional(),
390
+ userId: z.never().optional(),
391
+ emailAddress: z.string().describe(
392
+ "Contact will be created with this email address if it does not exist yet."
393
+ ).email()
394
+ })
395
+ ])
396
+ ).describe(
397
+ 'Recipient to whom replies will be sent (optional). Default - empty (which effectively resolves to "sender_email_address").'
398
+ ).optional(),
399
+ toRecipients: z.array(
400
+ z.intersection(
401
+ z.object({
402
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
403
+ failureReason: z.enum([
404
+ "NONE",
405
+ "RECIPIENT_NOT_FOUND",
406
+ "EMAIL_ADDRESS_MISSING",
407
+ "EMAIL_ADDRESS_INVALID",
408
+ "EMAIL_ADDRESS_BOUNCED",
409
+ "MARKETING_CONSENT_NOT_GIVEN",
410
+ "NOT_SITE_COLLABORATOR"
411
+ ]).describe(
412
+ "Failure reason - filled if the recipient was skipped and the email was not sent to them. Otherwise, it will be NONE."
413
+ ).optional()
414
+ }),
415
+ z.xor([
416
+ z.object({
417
+ contactId: z.never().optional(),
418
+ userId: z.never().optional(),
419
+ emailAddress: z.never().optional()
420
+ }),
421
+ z.object({
422
+ userId: z.never().optional(),
423
+ emailAddress: z.never().optional(),
424
+ contactId: z.string().describe(
425
+ "Recipient email address will be resolved from Contacts API."
426
+ ).regex(
427
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
428
+ "Must be a valid GUID"
429
+ )
430
+ }),
431
+ z.object({
432
+ contactId: z.never().optional(),
433
+ emailAddress: z.never().optional(),
434
+ userId: z.string().describe(
435
+ "Recipient email address will be resolved from Users API."
436
+ ).regex(
437
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
438
+ "Must be a valid GUID"
439
+ )
440
+ }),
441
+ z.object({
442
+ contactId: z.never().optional(),
443
+ userId: z.never().optional(),
444
+ emailAddress: z.string().describe(
445
+ "Contact will be created with this email address if it does not exist yet."
446
+ ).email()
447
+ })
448
+ ])
449
+ )
450
+ ).min(1).max(100).optional(),
451
+ type: z.enum(["TRANSACTIONAL", "MARKETING"]).describe("Email type - transactional or marketing.").optional(),
452
+ status: z.enum(["ACCEPTED", "IN_PROGRESS", "PROCESSED", "REJECTED"]).describe("Email transmission status.").optional()
453
+ }),
454
+ z.intersection(
455
+ z.xor([
456
+ z.object({ marketingOptions: z.never().optional() }),
457
+ z.object({
458
+ marketingOptions: z.object({
459
+ unsubscribeUrlPlaceholder: z.string().describe(
460
+ "Placeholder that will be replaced with the actual unsubscribe URL in the email content (optional, case sensitive).\nMake sure it's unique and not used anywhere else in the email content.\nFor example, you can use a placeholder like {{unsubscribe_url}} or [UNSUBSCRIBE_URL].\nIf it's not provided, then unsubscribe URL (in site main language) text will be added to the bottom of the email."
461
+ ).max(100).optional().nullable()
462
+ }).describe("Options for marketing email.")
463
+ })
464
+ ]),
465
+ z.xor([
466
+ z.object({ rejectedOptions: z.never().optional() }),
467
+ z.object({
468
+ rejectedOptions: z.object({
469
+ rejectionReasons: z.array(
470
+ z.enum([
471
+ "BLACKLISTED_SENDER_EMAIL",
472
+ "BLACKLISTED_SENDER_NAME",
473
+ "BLACKLISTED_REPLY_TO_EMAIL",
474
+ "BLACKLISTED_REPLY_TO_NAME",
475
+ "BLACKLISTED_LINK",
476
+ "BLACKLISTED_TEXT"
477
+ ])
478
+ ).min(1).max(10).optional()
479
+ }).describe("Options for rejected email transmission.")
480
+ })
481
+ ])
482
+ )
483
+ );
484
+ var QueryEmailTransmissionsRequest = z.object({
485
+ query: z.intersection(
486
+ z.object({
487
+ filter: z.record(z.string(), z.any()).describe(
488
+ 'Filter object in the following format:\n`"filter" : {\n"fieldName1": "value1",\n"fieldName2":{"$operator":"value2"}\n}`\nExample of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`'
489
+ ).optional().nullable(),
490
+ sort: z.array(
491
+ z.object({
492
+ fieldName: z.string().describe("Name of the field to sort by.").min(1).max(50).optional(),
493
+ order: z.enum(["ASC", "DESC"]).optional()
494
+ })
495
+ ).max(4).optional()
496
+ }),
497
+ z.xor([
498
+ z.object({ cursorPaging: z.never().optional() }),
499
+ z.object({
500
+ cursorPaging: z.object({
501
+ limit: z.number().int().describe("Number of items to load.").min(0).max(100).optional().nullable(),
502
+ cursor: z.string().describe(
503
+ "Pointer to the next or previous page in the list of results.\n\nYou can get the relevant cursor token\nfrom the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
504
+ ).max(1e3).optional().nullable()
505
+ }).describe(
506
+ "Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`."
507
+ )
508
+ })
509
+ ])
510
+ ).describe("WQL expression.")
511
+ });
512
+ var QueryEmailTransmissionsResponse = z.object({
513
+ emailTransmissions: z.array(
514
+ z.intersection(
515
+ z.object({
516
+ _id: z.string().describe("EmailTransmission ID.").regex(
517
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
518
+ "Must be a valid GUID"
519
+ ).optional(),
520
+ _createdDate: z.date().describe("Date and time the EmailTransmission was created.").optional().nullable(),
521
+ _updatedDate: z.date().describe("Date and time the EmailTransmission was last updated.").optional().nullable(),
522
+ revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
523
+ "Revision number, which increments by 1 each time the EmailTransmission is updated."
524
+ ).optional().nullable(),
525
+ emailSubject: z.string().describe("Email subject (optional). Default - empty.").max(200).optional().nullable(),
526
+ emailHtmlContent: z.string().describe(
527
+ "Full HTML content of the email to be sent.\nNote that this field is not returned in the QueryEmailTransmissions endpoint for performance reasons. Use GetEmailTransmission to retrieve the full content of a specific email transmission.\nImportant: in order to save storage space, this field will only be stored for 30 days after the email transmission is created. After that, it will be deleted and will not be retrievable anymore."
528
+ ).max(1e6).optional(),
529
+ metadata: z.record(z.string(), z.string()).describe(
530
+ "Request metadata (optional). Default - empty.\nProvided values will be passed to the ESP and then included in various callbacks to identify the context in which an email was sent.\nLength of each key and value must be between 1 and 50 alphanumeric characters."
531
+ ).optional(),
532
+ senderName: z.string().describe("Sender name (optional). Default - empty.").min(1).max(50).optional().nullable(),
533
+ senderEmailAddress: z.string().describe(
534
+ 'Sender email address (optional). Default - wix owned email address (for example "no-reply@wixsitemail.com").\nIf provided sender email address is unauthenticated and cannot be used for sending emails (for example gmail.com), it will be replaced with wix owned email address.\nIn that case provided email address will be used as reply-to unless reply-to email address is provided explicitly.'
535
+ ).email().optional().nullable(),
536
+ replyTo: z.intersection(
537
+ z.object({
538
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
539
+ failureReason: z.enum([
540
+ "NONE",
541
+ "RECIPIENT_NOT_FOUND",
542
+ "EMAIL_ADDRESS_MISSING",
543
+ "EMAIL_ADDRESS_INVALID",
544
+ "EMAIL_ADDRESS_BOUNCED",
545
+ "MARKETING_CONSENT_NOT_GIVEN",
546
+ "NOT_SITE_COLLABORATOR"
547
+ ]).describe(
548
+ "Failure reason - filled if the recipient was skipped and the email was not sent to them. Otherwise, it will be NONE."
549
+ ).optional()
550
+ }),
551
+ z.xor([
552
+ z.object({
553
+ contactId: z.never().optional(),
554
+ userId: z.never().optional(),
555
+ emailAddress: z.never().optional()
556
+ }),
557
+ z.object({
558
+ userId: z.never().optional(),
559
+ emailAddress: z.never().optional(),
560
+ contactId: z.string().describe(
561
+ "Recipient email address will be resolved from Contacts API."
562
+ ).regex(
563
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
564
+ "Must be a valid GUID"
565
+ )
566
+ }),
567
+ z.object({
568
+ contactId: z.never().optional(),
569
+ emailAddress: z.never().optional(),
570
+ userId: z.string().describe(
571
+ "Recipient email address will be resolved from Users API."
572
+ ).regex(
573
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
574
+ "Must be a valid GUID"
575
+ )
576
+ }),
577
+ z.object({
578
+ contactId: z.never().optional(),
579
+ userId: z.never().optional(),
580
+ emailAddress: z.string().describe(
581
+ "Contact will be created with this email address if it does not exist yet."
582
+ ).email()
583
+ })
584
+ ])
585
+ ).describe(
586
+ 'Recipient to whom replies will be sent (optional). Default - empty (which effectively resolves to "sender_email_address").'
587
+ ).optional(),
588
+ toRecipients: z.array(
589
+ z.intersection(
590
+ z.object({
591
+ name: z.string().describe("Recipient name (optional). Default - empty.").min(1).max(50).optional().nullable(),
592
+ failureReason: z.enum([
593
+ "NONE",
594
+ "RECIPIENT_NOT_FOUND",
595
+ "EMAIL_ADDRESS_MISSING",
596
+ "EMAIL_ADDRESS_INVALID",
597
+ "EMAIL_ADDRESS_BOUNCED",
598
+ "MARKETING_CONSENT_NOT_GIVEN",
599
+ "NOT_SITE_COLLABORATOR"
600
+ ]).describe(
601
+ "Failure reason - filled if the recipient was skipped and the email was not sent to them. Otherwise, it will be NONE."
602
+ ).optional()
603
+ }),
604
+ z.xor([
605
+ z.object({
606
+ contactId: z.never().optional(),
607
+ userId: z.never().optional(),
608
+ emailAddress: z.never().optional()
609
+ }),
610
+ z.object({
611
+ userId: z.never().optional(),
612
+ emailAddress: z.never().optional(),
613
+ contactId: z.string().describe(
614
+ "Recipient email address will be resolved from Contacts API."
615
+ ).regex(
616
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
617
+ "Must be a valid GUID"
618
+ )
619
+ }),
620
+ z.object({
621
+ contactId: z.never().optional(),
622
+ emailAddress: z.never().optional(),
623
+ userId: z.string().describe(
624
+ "Recipient email address will be resolved from Users API."
625
+ ).regex(
626
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
627
+ "Must be a valid GUID"
628
+ )
629
+ }),
630
+ z.object({
631
+ contactId: z.never().optional(),
632
+ userId: z.never().optional(),
633
+ emailAddress: z.string().describe(
634
+ "Contact will be created with this email address if it does not exist yet."
635
+ ).email()
636
+ })
637
+ ])
638
+ )
639
+ ).min(1).max(100).optional(),
640
+ type: z.enum(["TRANSACTIONAL", "MARKETING"]).describe("Email type - transactional or marketing.").optional(),
641
+ status: z.enum(["ACCEPTED", "IN_PROGRESS", "PROCESSED", "REJECTED"]).describe("Email transmission status.").optional()
642
+ }),
643
+ z.intersection(
644
+ z.xor([
645
+ z.object({ marketingOptions: z.never().optional() }),
646
+ z.object({
647
+ marketingOptions: z.object({
648
+ unsubscribeUrlPlaceholder: z.string().describe(
649
+ "Placeholder that will be replaced with the actual unsubscribe URL in the email content (optional, case sensitive).\nMake sure it's unique and not used anywhere else in the email content.\nFor example, you can use a placeholder like {{unsubscribe_url}} or [UNSUBSCRIBE_URL].\nIf it's not provided, then unsubscribe URL (in site main language) text will be added to the bottom of the email."
650
+ ).max(100).optional().nullable()
651
+ }).describe("Options for marketing email.")
652
+ })
653
+ ]),
654
+ z.xor([
655
+ z.object({ rejectedOptions: z.never().optional() }),
656
+ z.object({
657
+ rejectedOptions: z.object({
658
+ rejectionReasons: z.array(
659
+ z.enum([
660
+ "BLACKLISTED_SENDER_EMAIL",
661
+ "BLACKLISTED_SENDER_NAME",
662
+ "BLACKLISTED_REPLY_TO_EMAIL",
663
+ "BLACKLISTED_REPLY_TO_NAME",
664
+ "BLACKLISTED_LINK",
665
+ "BLACKLISTED_TEXT"
666
+ ])
667
+ ).min(1).max(10).optional()
668
+ }).describe("Options for rejected email transmission.")
669
+ })
670
+ ])
671
+ )
672
+ )
673
+ ).optional(),
674
+ pagingMetadata: z.object({
675
+ count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
676
+ cursors: z.object({
677
+ next: z.string().describe("Cursor pointing to next page in the list of results.").max(1e3).optional().nullable(),
678
+ prev: z.string().describe(
679
+ "Cursor pointing to previous page in the list of results."
680
+ ).max(1e3).optional().nullable()
681
+ }).describe("Offset that was requested.").optional(),
682
+ hasNext: z.boolean().describe(
683
+ "Indicates if there are more results after the current page.\nIf `true`, another page of results can be retrieved.\nIf `false`, this is the last page."
684
+ ).optional().nullable()
685
+ }).describe("Paging metadata").optional()
686
+ });
687
+ var DeleteEmailTransmissionRequest = z.object({
688
+ emailTransmissionId: z.string().describe("Id of the EmailTransmission to delete.").regex(
689
+ /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
690
+ "Must be a valid GUID"
691
+ )
692
+ });
693
+ var DeleteEmailTransmissionResponse = z.object({});
694
+ export {
695
+ DeleteEmailTransmissionRequest,
696
+ DeleteEmailTransmissionResponse,
697
+ GetEmailTransmissionRequest,
698
+ GetEmailTransmissionResponse,
699
+ QueryEmailTransmissionsRequest,
700
+ QueryEmailTransmissionsResponse,
701
+ SendEmailTransmissionRequest,
702
+ SendEmailTransmissionResponse
703
+ };
704
+ //# sourceMappingURL=schemas.mjs.map