@zyphr-dev/node-sdk 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1386,6 +1386,38 @@ function BatchPublishWaaSEvents201ResponseToJSONTyped(value, ignoreDiscriminator
1386
1386
  };
1387
1387
  }
1388
1388
 
1389
+ // src/src/models/BatchRecipient.ts
1390
+ function instanceOfBatchRecipient(value) {
1391
+ if (!("email" in value) || value["email"] === void 0) return false;
1392
+ return true;
1393
+ }
1394
+ function BatchRecipientFromJSON(json) {
1395
+ return BatchRecipientFromJSONTyped(json, false);
1396
+ }
1397
+ function BatchRecipientFromJSONTyped(json, ignoreDiscriminator) {
1398
+ if (json == null) {
1399
+ return json;
1400
+ }
1401
+ return {
1402
+ "email": json["email"],
1403
+ "name": json["name"] == null ? void 0 : json["name"],
1404
+ "variables": json["variables"] == null ? void 0 : json["variables"]
1405
+ };
1406
+ }
1407
+ function BatchRecipientToJSON(json) {
1408
+ return BatchRecipientToJSONTyped(json, false);
1409
+ }
1410
+ function BatchRecipientToJSONTyped(value, ignoreDiscriminator = false) {
1411
+ if (value == null) {
1412
+ return value;
1413
+ }
1414
+ return {
1415
+ "email": value["email"],
1416
+ "name": value["name"],
1417
+ "variables": value["variables"]
1418
+ };
1419
+ }
1420
+
1389
1421
  // src/src/models/BulkRetryWebhookDeliveriesRequest.ts
1390
1422
  var BulkRetryWebhookDeliveriesRequestStatusEnum = {
1391
1423
  FAILED: "failed",
@@ -7193,92 +7225,50 @@ function RevokeSessionRequestToJSONTyped(value, ignoreDiscriminator = false) {
7193
7225
  };
7194
7226
  }
7195
7227
 
7196
- // src/src/models/SendEmailRequest.ts
7197
- function instanceOfSendEmailRequest(value) {
7228
+ // src/src/models/SendBatchEmailRequest.ts
7229
+ function instanceOfSendBatchEmailRequest(value) {
7230
+ if (!("from" in value) || value["from"] === void 0) return false;
7198
7231
  if (!("to" in value) || value["to"] === void 0) return false;
7199
- if (!("subject" in value) || value["subject"] === void 0) return false;
7200
7232
  return true;
7201
7233
  }
7202
- function SendEmailRequestFromJSON(json) {
7203
- return SendEmailRequestFromJSONTyped(json, false);
7234
+ function SendBatchEmailRequestFromJSON(json) {
7235
+ return SendBatchEmailRequestFromJSONTyped(json, false);
7204
7236
  }
7205
- function SendEmailRequestFromJSONTyped(json, ignoreDiscriminator) {
7237
+ function SendBatchEmailRequestFromJSONTyped(json, ignoreDiscriminator) {
7206
7238
  if (json == null) {
7207
7239
  return json;
7208
7240
  }
7209
7241
  return {
7210
- "to": json["to"].map(EmailAddressFromJSON),
7211
- "from": json["from"] == null ? void 0 : EmailAddressFromJSON(json["from"]),
7242
+ "from": EmailAddressFromJSON(json["from"]),
7243
+ "to": json["to"].map(BatchRecipientFromJSON),
7212
7244
  "replyTo": json["reply_to"] == null ? void 0 : EmailAddressFromJSON(json["reply_to"]),
7213
- "cc": json["cc"] == null ? void 0 : json["cc"],
7214
- "bcc": json["bcc"] == null ? void 0 : json["bcc"],
7215
- "subject": json["subject"],
7245
+ "subject": json["subject"] == null ? void 0 : json["subject"],
7216
7246
  "html": json["html"] == null ? void 0 : json["html"],
7217
7247
  "text": json["text"] == null ? void 0 : json["text"],
7218
7248
  "templateId": json["template_id"] == null ? void 0 : json["template_id"],
7219
7249
  "templateData": json["template_data"] == null ? void 0 : json["template_data"],
7220
- "attachments": json["attachments"] == null ? void 0 : json["attachments"].map(EmailAttachmentFromJSON),
7221
- "headers": json["headers"] == null ? void 0 : json["headers"],
7222
7250
  "tags": json["tags"] == null ? void 0 : json["tags"],
7223
- "metadata": json["metadata"] == null ? void 0 : json["metadata"],
7224
- "scheduledAt": json["scheduled_at"] == null ? void 0 : new Date(json["scheduled_at"]),
7225
- "subscriberId": json["subscriber_id"] == null ? void 0 : json["subscriber_id"],
7226
- "category": json["category"] == null ? void 0 : json["category"]
7251
+ "metadata": json["metadata"] == null ? void 0 : json["metadata"]
7227
7252
  };
7228
7253
  }
7229
- function SendEmailRequestToJSON(json) {
7230
- return SendEmailRequestToJSONTyped(json, false);
7254
+ function SendBatchEmailRequestToJSON(json) {
7255
+ return SendBatchEmailRequestToJSONTyped(json, false);
7231
7256
  }
7232
- function SendEmailRequestToJSONTyped(value, ignoreDiscriminator = false) {
7257
+ function SendBatchEmailRequestToJSONTyped(value, ignoreDiscriminator = false) {
7233
7258
  if (value == null) {
7234
7259
  return value;
7235
7260
  }
7236
7261
  return {
7237
- "to": value["to"].map(EmailAddressToJSON),
7238
7262
  "from": EmailAddressToJSON(value["from"]),
7263
+ "to": value["to"].map(BatchRecipientToJSON),
7239
7264
  "reply_to": EmailAddressToJSON(value["replyTo"]),
7240
- "cc": value["cc"],
7241
- "bcc": value["bcc"],
7242
7265
  "subject": value["subject"],
7243
7266
  "html": value["html"],
7244
7267
  "text": value["text"],
7245
7268
  "template_id": value["templateId"],
7246
7269
  "template_data": value["templateData"],
7247
- "attachments": value["attachments"] == null ? void 0 : value["attachments"].map(EmailAttachmentToJSON),
7248
- "headers": value["headers"],
7249
7270
  "tags": value["tags"],
7250
- "metadata": value["metadata"],
7251
- "scheduled_at": value["scheduledAt"] == null ? void 0 : value["scheduledAt"].toISOString(),
7252
- "subscriber_id": value["subscriberId"],
7253
- "category": value["category"]
7254
- };
7255
- }
7256
-
7257
- // src/src/models/SendBatchEmailRequest.ts
7258
- function instanceOfSendBatchEmailRequest(value) {
7259
- if (!("messages" in value) || value["messages"] === void 0) return false;
7260
- return true;
7261
- }
7262
- function SendBatchEmailRequestFromJSON(json) {
7263
- return SendBatchEmailRequestFromJSONTyped(json, false);
7264
- }
7265
- function SendBatchEmailRequestFromJSONTyped(json, ignoreDiscriminator) {
7266
- if (json == null) {
7267
- return json;
7268
- }
7269
- return {
7270
- "messages": json["messages"].map(SendEmailRequestFromJSON)
7271
- };
7272
- }
7273
- function SendBatchEmailRequestToJSON(json) {
7274
- return SendBatchEmailRequestToJSONTyped(json, false);
7275
- }
7276
- function SendBatchEmailRequestToJSONTyped(value, ignoreDiscriminator = false) {
7277
- if (value == null) {
7278
- return value;
7279
- }
7280
- return {
7281
- "messages": value["messages"].map(SendEmailRequestToJSON)
7271
+ "metadata": value["metadata"]
7282
7272
  };
7283
7273
  }
7284
7274
 
@@ -7685,6 +7675,67 @@ function SendBatchSmsResponseToJSONTyped(value, ignoreDiscriminator = false) {
7685
7675
  };
7686
7676
  }
7687
7677
 
7678
+ // src/src/models/SendEmailRequest.ts
7679
+ function instanceOfSendEmailRequest(value) {
7680
+ if (!("to" in value) || value["to"] === void 0) return false;
7681
+ if (!("subject" in value) || value["subject"] === void 0) return false;
7682
+ return true;
7683
+ }
7684
+ function SendEmailRequestFromJSON(json) {
7685
+ return SendEmailRequestFromJSONTyped(json, false);
7686
+ }
7687
+ function SendEmailRequestFromJSONTyped(json, ignoreDiscriminator) {
7688
+ if (json == null) {
7689
+ return json;
7690
+ }
7691
+ return {
7692
+ "to": json["to"].map(EmailAddressFromJSON),
7693
+ "from": json["from"] == null ? void 0 : EmailAddressFromJSON(json["from"]),
7694
+ "replyTo": json["reply_to"] == null ? void 0 : EmailAddressFromJSON(json["reply_to"]),
7695
+ "cc": json["cc"] == null ? void 0 : json["cc"],
7696
+ "bcc": json["bcc"] == null ? void 0 : json["bcc"],
7697
+ "subject": json["subject"],
7698
+ "html": json["html"] == null ? void 0 : json["html"],
7699
+ "text": json["text"] == null ? void 0 : json["text"],
7700
+ "templateId": json["template_id"] == null ? void 0 : json["template_id"],
7701
+ "templateData": json["template_data"] == null ? void 0 : json["template_data"],
7702
+ "attachments": json["attachments"] == null ? void 0 : json["attachments"].map(EmailAttachmentFromJSON),
7703
+ "headers": json["headers"] == null ? void 0 : json["headers"],
7704
+ "tags": json["tags"] == null ? void 0 : json["tags"],
7705
+ "metadata": json["metadata"] == null ? void 0 : json["metadata"],
7706
+ "scheduledAt": json["scheduled_at"] == null ? void 0 : new Date(json["scheduled_at"]),
7707
+ "subscriberId": json["subscriber_id"] == null ? void 0 : json["subscriber_id"],
7708
+ "category": json["category"] == null ? void 0 : json["category"]
7709
+ };
7710
+ }
7711
+ function SendEmailRequestToJSON(json) {
7712
+ return SendEmailRequestToJSONTyped(json, false);
7713
+ }
7714
+ function SendEmailRequestToJSONTyped(value, ignoreDiscriminator = false) {
7715
+ if (value == null) {
7716
+ return value;
7717
+ }
7718
+ return {
7719
+ "to": value["to"].map(EmailAddressToJSON),
7720
+ "from": EmailAddressToJSON(value["from"]),
7721
+ "reply_to": EmailAddressToJSON(value["replyTo"]),
7722
+ "cc": value["cc"],
7723
+ "bcc": value["bcc"],
7724
+ "subject": value["subject"],
7725
+ "html": value["html"],
7726
+ "text": value["text"],
7727
+ "template_id": value["templateId"],
7728
+ "template_data": value["templateData"],
7729
+ "attachments": value["attachments"] == null ? void 0 : value["attachments"].map(EmailAttachmentToJSON),
7730
+ "headers": value["headers"],
7731
+ "tags": value["tags"],
7732
+ "metadata": value["metadata"],
7733
+ "scheduled_at": value["scheduledAt"] == null ? void 0 : value["scheduledAt"].toISOString(),
7734
+ "subscriber_id": value["subscriberId"],
7735
+ "category": value["category"]
7736
+ };
7737
+ }
7738
+
7688
7739
  // src/src/models/SendEmailResponseMeta.ts
7689
7740
  function instanceOfSendEmailResponseMeta(value) {
7690
7741
  return true;
@@ -9446,7 +9497,8 @@ function TemplateResponseFromJSONTyped(json, ignoreDiscriminator) {
9446
9497
  }
9447
9498
  return {
9448
9499
  "data": json["data"] == null ? void 0 : TemplateFromJSON(json["data"]),
9449
- "meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"])
9500
+ "meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"]),
9501
+ "warnings": json["warnings"] == null ? void 0 : json["warnings"]
9450
9502
  };
9451
9503
  }
9452
9504
  function TemplateResponseToJSON(json) {
@@ -9458,7 +9510,8 @@ function TemplateResponseToJSONTyped(value, ignoreDiscriminator = false) {
9458
9510
  }
9459
9511
  return {
9460
9512
  "data": TemplateToJSON(value["data"]),
9461
- "meta": RequestMetaToJSON(value["meta"])
9513
+ "meta": RequestMetaToJSON(value["meta"]),
9514
+ "warnings": value["warnings"]
9462
9515
  };
9463
9516
  }
9464
9517
 
@@ -14975,7 +15028,7 @@ var EmailsApi = class extends BaseAPI {
14975
15028
  return await response.value();
14976
15029
  }
14977
15030
  /**
14978
- * Send up to 100 emails in a single request. Each recipient gets their own message record.
15031
+ * Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
14979
15032
  * Send batch emails
14980
15033
  */
14981
15034
  async sendBatchEmailRaw(requestParameters, initOverrides) {
@@ -15001,7 +15054,7 @@ var EmailsApi = class extends BaseAPI {
15001
15054
  return new JSONApiResponse(response, (jsonValue) => SendBatchEmailResponseFromJSON(jsonValue));
15002
15055
  }
15003
15056
  /**
15004
- * Send up to 100 emails in a single request. Each recipient gets their own message record.
15057
+ * Send a single email to up to 100 recipients in one request. Each recipient gets their own message record. Provide either raw content (`subject` plus `html` and/or `text`) or a `template_id` with `template_data`. Per-recipient `variables` are merged on top of the batch-level `template_data`.
15005
15058
  * Send batch emails
15006
15059
  */
15007
15060
  async sendBatchEmail(sendBatchEmailRequest, initOverrides) {
@@ -20073,6 +20126,10 @@ export {
20073
20126
  BatchPublishWaaSEvents201ResponseFromJSONTyped,
20074
20127
  BatchPublishWaaSEvents201ResponseToJSON,
20075
20128
  BatchPublishWaaSEvents201ResponseToJSONTyped,
20129
+ BatchRecipientFromJSON,
20130
+ BatchRecipientFromJSONTyped,
20131
+ BatchRecipientToJSON,
20132
+ BatchRecipientToJSONTyped,
20076
20133
  BlobApiResponse,
20077
20134
  BulkRetryWebhookDeliveriesRequestFromJSON,
20078
20135
  BulkRetryWebhookDeliveriesRequestFromJSONTyped,
@@ -21558,6 +21615,7 @@ export {
21558
21615
  instanceOfAuthUserResponse,
21559
21616
  instanceOfAuthUserResponseData,
21560
21617
  instanceOfBatchPublishWaaSEvents201Response,
21618
+ instanceOfBatchRecipient,
21561
21619
  instanceOfBulkRetryWebhookDeliveriesRequest,
21562
21620
  instanceOfBulkUpsertAuthEmailTemplatesRequest,
21563
21621
  instanceOfBulkUpsertAuthEmailTemplatesResponse,