@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.cjs +124 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +255 -110
- package/dist/index.d.ts +255 -110
- package/dist/index.js +119 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +1 -0
- package/src/src/apis/EmailsApi.ts +4 -4
- package/src/src/models/BatchRecipient.ts +83 -0
- package/src/src/models/CreateTemplateRequest.ts +18 -3
- package/src/src/models/SendBatchEmailRequest.ts +95 -11
- package/src/src/models/TemplateResponse.ts +13 -0
- package/src/src/models/UpdateTemplateRequest.ts +9 -0
- package/src/src/models/index.ts +1 -0
package/dist/index.cjs
CHANGED
|
@@ -166,6 +166,10 @@ __export(index_exports, {
|
|
|
166
166
|
BatchPublishWaaSEvents201ResponseFromJSONTyped: () => BatchPublishWaaSEvents201ResponseFromJSONTyped,
|
|
167
167
|
BatchPublishWaaSEvents201ResponseToJSON: () => BatchPublishWaaSEvents201ResponseToJSON,
|
|
168
168
|
BatchPublishWaaSEvents201ResponseToJSONTyped: () => BatchPublishWaaSEvents201ResponseToJSONTyped,
|
|
169
|
+
BatchRecipientFromJSON: () => BatchRecipientFromJSON,
|
|
170
|
+
BatchRecipientFromJSONTyped: () => BatchRecipientFromJSONTyped,
|
|
171
|
+
BatchRecipientToJSON: () => BatchRecipientToJSON,
|
|
172
|
+
BatchRecipientToJSONTyped: () => BatchRecipientToJSONTyped,
|
|
169
173
|
BlobApiResponse: () => BlobApiResponse,
|
|
170
174
|
BulkRetryWebhookDeliveriesRequestFromJSON: () => BulkRetryWebhookDeliveriesRequestFromJSON,
|
|
171
175
|
BulkRetryWebhookDeliveriesRequestFromJSONTyped: () => BulkRetryWebhookDeliveriesRequestFromJSONTyped,
|
|
@@ -1651,6 +1655,7 @@ __export(index_exports, {
|
|
|
1651
1655
|
instanceOfAuthUserResponse: () => instanceOfAuthUserResponse,
|
|
1652
1656
|
instanceOfAuthUserResponseData: () => instanceOfAuthUserResponseData,
|
|
1653
1657
|
instanceOfBatchPublishWaaSEvents201Response: () => instanceOfBatchPublishWaaSEvents201Response,
|
|
1658
|
+
instanceOfBatchRecipient: () => instanceOfBatchRecipient,
|
|
1654
1659
|
instanceOfBulkRetryWebhookDeliveriesRequest: () => instanceOfBulkRetryWebhookDeliveriesRequest,
|
|
1655
1660
|
instanceOfBulkUpsertAuthEmailTemplatesRequest: () => instanceOfBulkUpsertAuthEmailTemplatesRequest,
|
|
1656
1661
|
instanceOfBulkUpsertAuthEmailTemplatesResponse: () => instanceOfBulkUpsertAuthEmailTemplatesResponse,
|
|
@@ -3385,6 +3390,38 @@ function BatchPublishWaaSEvents201ResponseToJSONTyped(value, ignoreDiscriminator
|
|
|
3385
3390
|
};
|
|
3386
3391
|
}
|
|
3387
3392
|
|
|
3393
|
+
// src/src/models/BatchRecipient.ts
|
|
3394
|
+
function instanceOfBatchRecipient(value) {
|
|
3395
|
+
if (!("email" in value) || value["email"] === void 0) return false;
|
|
3396
|
+
return true;
|
|
3397
|
+
}
|
|
3398
|
+
function BatchRecipientFromJSON(json) {
|
|
3399
|
+
return BatchRecipientFromJSONTyped(json, false);
|
|
3400
|
+
}
|
|
3401
|
+
function BatchRecipientFromJSONTyped(json, ignoreDiscriminator) {
|
|
3402
|
+
if (json == null) {
|
|
3403
|
+
return json;
|
|
3404
|
+
}
|
|
3405
|
+
return {
|
|
3406
|
+
"email": json["email"],
|
|
3407
|
+
"name": json["name"] == null ? void 0 : json["name"],
|
|
3408
|
+
"variables": json["variables"] == null ? void 0 : json["variables"]
|
|
3409
|
+
};
|
|
3410
|
+
}
|
|
3411
|
+
function BatchRecipientToJSON(json) {
|
|
3412
|
+
return BatchRecipientToJSONTyped(json, false);
|
|
3413
|
+
}
|
|
3414
|
+
function BatchRecipientToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3415
|
+
if (value == null) {
|
|
3416
|
+
return value;
|
|
3417
|
+
}
|
|
3418
|
+
return {
|
|
3419
|
+
"email": value["email"],
|
|
3420
|
+
"name": value["name"],
|
|
3421
|
+
"variables": value["variables"]
|
|
3422
|
+
};
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3388
3425
|
// src/src/models/BulkRetryWebhookDeliveriesRequest.ts
|
|
3389
3426
|
var BulkRetryWebhookDeliveriesRequestStatusEnum = {
|
|
3390
3427
|
FAILED: "failed",
|
|
@@ -9192,92 +9229,50 @@ function RevokeSessionRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
9192
9229
|
};
|
|
9193
9230
|
}
|
|
9194
9231
|
|
|
9195
|
-
// src/src/models/
|
|
9196
|
-
function
|
|
9232
|
+
// src/src/models/SendBatchEmailRequest.ts
|
|
9233
|
+
function instanceOfSendBatchEmailRequest(value) {
|
|
9234
|
+
if (!("from" in value) || value["from"] === void 0) return false;
|
|
9197
9235
|
if (!("to" in value) || value["to"] === void 0) return false;
|
|
9198
|
-
if (!("subject" in value) || value["subject"] === void 0) return false;
|
|
9199
9236
|
return true;
|
|
9200
9237
|
}
|
|
9201
|
-
function
|
|
9202
|
-
return
|
|
9238
|
+
function SendBatchEmailRequestFromJSON(json) {
|
|
9239
|
+
return SendBatchEmailRequestFromJSONTyped(json, false);
|
|
9203
9240
|
}
|
|
9204
|
-
function
|
|
9241
|
+
function SendBatchEmailRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
9205
9242
|
if (json == null) {
|
|
9206
9243
|
return json;
|
|
9207
9244
|
}
|
|
9208
9245
|
return {
|
|
9209
|
-
"
|
|
9210
|
-
"
|
|
9246
|
+
"from": EmailAddressFromJSON(json["from"]),
|
|
9247
|
+
"to": json["to"].map(BatchRecipientFromJSON),
|
|
9211
9248
|
"replyTo": json["reply_to"] == null ? void 0 : EmailAddressFromJSON(json["reply_to"]),
|
|
9212
|
-
"
|
|
9213
|
-
"bcc": json["bcc"] == null ? void 0 : json["bcc"],
|
|
9214
|
-
"subject": json["subject"],
|
|
9249
|
+
"subject": json["subject"] == null ? void 0 : json["subject"],
|
|
9215
9250
|
"html": json["html"] == null ? void 0 : json["html"],
|
|
9216
9251
|
"text": json["text"] == null ? void 0 : json["text"],
|
|
9217
9252
|
"templateId": json["template_id"] == null ? void 0 : json["template_id"],
|
|
9218
9253
|
"templateData": json["template_data"] == null ? void 0 : json["template_data"],
|
|
9219
|
-
"attachments": json["attachments"] == null ? void 0 : json["attachments"].map(EmailAttachmentFromJSON),
|
|
9220
|
-
"headers": json["headers"] == null ? void 0 : json["headers"],
|
|
9221
9254
|
"tags": json["tags"] == null ? void 0 : json["tags"],
|
|
9222
|
-
"metadata": json["metadata"] == null ? void 0 : json["metadata"]
|
|
9223
|
-
"scheduledAt": json["scheduled_at"] == null ? void 0 : new Date(json["scheduled_at"]),
|
|
9224
|
-
"subscriberId": json["subscriber_id"] == null ? void 0 : json["subscriber_id"],
|
|
9225
|
-
"category": json["category"] == null ? void 0 : json["category"]
|
|
9255
|
+
"metadata": json["metadata"] == null ? void 0 : json["metadata"]
|
|
9226
9256
|
};
|
|
9227
9257
|
}
|
|
9228
|
-
function
|
|
9229
|
-
return
|
|
9258
|
+
function SendBatchEmailRequestToJSON(json) {
|
|
9259
|
+
return SendBatchEmailRequestToJSONTyped(json, false);
|
|
9230
9260
|
}
|
|
9231
|
-
function
|
|
9261
|
+
function SendBatchEmailRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
9232
9262
|
if (value == null) {
|
|
9233
9263
|
return value;
|
|
9234
9264
|
}
|
|
9235
9265
|
return {
|
|
9236
|
-
"to": value["to"].map(EmailAddressToJSON),
|
|
9237
9266
|
"from": EmailAddressToJSON(value["from"]),
|
|
9267
|
+
"to": value["to"].map(BatchRecipientToJSON),
|
|
9238
9268
|
"reply_to": EmailAddressToJSON(value["replyTo"]),
|
|
9239
|
-
"cc": value["cc"],
|
|
9240
|
-
"bcc": value["bcc"],
|
|
9241
9269
|
"subject": value["subject"],
|
|
9242
9270
|
"html": value["html"],
|
|
9243
9271
|
"text": value["text"],
|
|
9244
9272
|
"template_id": value["templateId"],
|
|
9245
9273
|
"template_data": value["templateData"],
|
|
9246
|
-
"attachments": value["attachments"] == null ? void 0 : value["attachments"].map(EmailAttachmentToJSON),
|
|
9247
|
-
"headers": value["headers"],
|
|
9248
9274
|
"tags": value["tags"],
|
|
9249
|
-
"metadata": value["metadata"]
|
|
9250
|
-
"scheduled_at": value["scheduledAt"] == null ? void 0 : value["scheduledAt"].toISOString(),
|
|
9251
|
-
"subscriber_id": value["subscriberId"],
|
|
9252
|
-
"category": value["category"]
|
|
9253
|
-
};
|
|
9254
|
-
}
|
|
9255
|
-
|
|
9256
|
-
// src/src/models/SendBatchEmailRequest.ts
|
|
9257
|
-
function instanceOfSendBatchEmailRequest(value) {
|
|
9258
|
-
if (!("messages" in value) || value["messages"] === void 0) return false;
|
|
9259
|
-
return true;
|
|
9260
|
-
}
|
|
9261
|
-
function SendBatchEmailRequestFromJSON(json) {
|
|
9262
|
-
return SendBatchEmailRequestFromJSONTyped(json, false);
|
|
9263
|
-
}
|
|
9264
|
-
function SendBatchEmailRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
9265
|
-
if (json == null) {
|
|
9266
|
-
return json;
|
|
9267
|
-
}
|
|
9268
|
-
return {
|
|
9269
|
-
"messages": json["messages"].map(SendEmailRequestFromJSON)
|
|
9270
|
-
};
|
|
9271
|
-
}
|
|
9272
|
-
function SendBatchEmailRequestToJSON(json) {
|
|
9273
|
-
return SendBatchEmailRequestToJSONTyped(json, false);
|
|
9274
|
-
}
|
|
9275
|
-
function SendBatchEmailRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
9276
|
-
if (value == null) {
|
|
9277
|
-
return value;
|
|
9278
|
-
}
|
|
9279
|
-
return {
|
|
9280
|
-
"messages": value["messages"].map(SendEmailRequestToJSON)
|
|
9275
|
+
"metadata": value["metadata"]
|
|
9281
9276
|
};
|
|
9282
9277
|
}
|
|
9283
9278
|
|
|
@@ -9684,6 +9679,67 @@ function SendBatchSmsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
9684
9679
|
};
|
|
9685
9680
|
}
|
|
9686
9681
|
|
|
9682
|
+
// src/src/models/SendEmailRequest.ts
|
|
9683
|
+
function instanceOfSendEmailRequest(value) {
|
|
9684
|
+
if (!("to" in value) || value["to"] === void 0) return false;
|
|
9685
|
+
if (!("subject" in value) || value["subject"] === void 0) return false;
|
|
9686
|
+
return true;
|
|
9687
|
+
}
|
|
9688
|
+
function SendEmailRequestFromJSON(json) {
|
|
9689
|
+
return SendEmailRequestFromJSONTyped(json, false);
|
|
9690
|
+
}
|
|
9691
|
+
function SendEmailRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
9692
|
+
if (json == null) {
|
|
9693
|
+
return json;
|
|
9694
|
+
}
|
|
9695
|
+
return {
|
|
9696
|
+
"to": json["to"].map(EmailAddressFromJSON),
|
|
9697
|
+
"from": json["from"] == null ? void 0 : EmailAddressFromJSON(json["from"]),
|
|
9698
|
+
"replyTo": json["reply_to"] == null ? void 0 : EmailAddressFromJSON(json["reply_to"]),
|
|
9699
|
+
"cc": json["cc"] == null ? void 0 : json["cc"],
|
|
9700
|
+
"bcc": json["bcc"] == null ? void 0 : json["bcc"],
|
|
9701
|
+
"subject": json["subject"],
|
|
9702
|
+
"html": json["html"] == null ? void 0 : json["html"],
|
|
9703
|
+
"text": json["text"] == null ? void 0 : json["text"],
|
|
9704
|
+
"templateId": json["template_id"] == null ? void 0 : json["template_id"],
|
|
9705
|
+
"templateData": json["template_data"] == null ? void 0 : json["template_data"],
|
|
9706
|
+
"attachments": json["attachments"] == null ? void 0 : json["attachments"].map(EmailAttachmentFromJSON),
|
|
9707
|
+
"headers": json["headers"] == null ? void 0 : json["headers"],
|
|
9708
|
+
"tags": json["tags"] == null ? void 0 : json["tags"],
|
|
9709
|
+
"metadata": json["metadata"] == null ? void 0 : json["metadata"],
|
|
9710
|
+
"scheduledAt": json["scheduled_at"] == null ? void 0 : new Date(json["scheduled_at"]),
|
|
9711
|
+
"subscriberId": json["subscriber_id"] == null ? void 0 : json["subscriber_id"],
|
|
9712
|
+
"category": json["category"] == null ? void 0 : json["category"]
|
|
9713
|
+
};
|
|
9714
|
+
}
|
|
9715
|
+
function SendEmailRequestToJSON(json) {
|
|
9716
|
+
return SendEmailRequestToJSONTyped(json, false);
|
|
9717
|
+
}
|
|
9718
|
+
function SendEmailRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
9719
|
+
if (value == null) {
|
|
9720
|
+
return value;
|
|
9721
|
+
}
|
|
9722
|
+
return {
|
|
9723
|
+
"to": value["to"].map(EmailAddressToJSON),
|
|
9724
|
+
"from": EmailAddressToJSON(value["from"]),
|
|
9725
|
+
"reply_to": EmailAddressToJSON(value["replyTo"]),
|
|
9726
|
+
"cc": value["cc"],
|
|
9727
|
+
"bcc": value["bcc"],
|
|
9728
|
+
"subject": value["subject"],
|
|
9729
|
+
"html": value["html"],
|
|
9730
|
+
"text": value["text"],
|
|
9731
|
+
"template_id": value["templateId"],
|
|
9732
|
+
"template_data": value["templateData"],
|
|
9733
|
+
"attachments": value["attachments"] == null ? void 0 : value["attachments"].map(EmailAttachmentToJSON),
|
|
9734
|
+
"headers": value["headers"],
|
|
9735
|
+
"tags": value["tags"],
|
|
9736
|
+
"metadata": value["metadata"],
|
|
9737
|
+
"scheduled_at": value["scheduledAt"] == null ? void 0 : value["scheduledAt"].toISOString(),
|
|
9738
|
+
"subscriber_id": value["subscriberId"],
|
|
9739
|
+
"category": value["category"]
|
|
9740
|
+
};
|
|
9741
|
+
}
|
|
9742
|
+
|
|
9687
9743
|
// src/src/models/SendEmailResponseMeta.ts
|
|
9688
9744
|
function instanceOfSendEmailResponseMeta(value) {
|
|
9689
9745
|
return true;
|
|
@@ -11445,7 +11501,8 @@ function TemplateResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
11445
11501
|
}
|
|
11446
11502
|
return {
|
|
11447
11503
|
"data": json["data"] == null ? void 0 : TemplateFromJSON(json["data"]),
|
|
11448
|
-
"meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"])
|
|
11504
|
+
"meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"]),
|
|
11505
|
+
"warnings": json["warnings"] == null ? void 0 : json["warnings"]
|
|
11449
11506
|
};
|
|
11450
11507
|
}
|
|
11451
11508
|
function TemplateResponseToJSON(json) {
|
|
@@ -11457,7 +11514,8 @@ function TemplateResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
11457
11514
|
}
|
|
11458
11515
|
return {
|
|
11459
11516
|
"data": TemplateToJSON(value["data"]),
|
|
11460
|
-
"meta": RequestMetaToJSON(value["meta"])
|
|
11517
|
+
"meta": RequestMetaToJSON(value["meta"]),
|
|
11518
|
+
"warnings": value["warnings"]
|
|
11461
11519
|
};
|
|
11462
11520
|
}
|
|
11463
11521
|
|
|
@@ -16974,7 +17032,7 @@ var EmailsApi = class extends BaseAPI {
|
|
|
16974
17032
|
return await response.value();
|
|
16975
17033
|
}
|
|
16976
17034
|
/**
|
|
16977
|
-
* Send up to 100
|
|
17035
|
+
* 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`.
|
|
16978
17036
|
* Send batch emails
|
|
16979
17037
|
*/
|
|
16980
17038
|
async sendBatchEmailRaw(requestParameters, initOverrides) {
|
|
@@ -17000,7 +17058,7 @@ var EmailsApi = class extends BaseAPI {
|
|
|
17000
17058
|
return new JSONApiResponse(response, (jsonValue) => SendBatchEmailResponseFromJSON(jsonValue));
|
|
17001
17059
|
}
|
|
17002
17060
|
/**
|
|
17003
|
-
* Send up to 100
|
|
17061
|
+
* 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`.
|
|
17004
17062
|
* Send batch emails
|
|
17005
17063
|
*/
|
|
17006
17064
|
async sendBatchEmail(sendBatchEmailRequest, initOverrides) {
|
|
@@ -22073,6 +22131,10 @@ var SDK_VERSION = "0.1.0";
|
|
|
22073
22131
|
BatchPublishWaaSEvents201ResponseFromJSONTyped,
|
|
22074
22132
|
BatchPublishWaaSEvents201ResponseToJSON,
|
|
22075
22133
|
BatchPublishWaaSEvents201ResponseToJSONTyped,
|
|
22134
|
+
BatchRecipientFromJSON,
|
|
22135
|
+
BatchRecipientFromJSONTyped,
|
|
22136
|
+
BatchRecipientToJSON,
|
|
22137
|
+
BatchRecipientToJSONTyped,
|
|
22076
22138
|
BlobApiResponse,
|
|
22077
22139
|
BulkRetryWebhookDeliveriesRequestFromJSON,
|
|
22078
22140
|
BulkRetryWebhookDeliveriesRequestFromJSONTyped,
|
|
@@ -23558,6 +23620,7 @@ var SDK_VERSION = "0.1.0";
|
|
|
23558
23620
|
instanceOfAuthUserResponse,
|
|
23559
23621
|
instanceOfAuthUserResponseData,
|
|
23560
23622
|
instanceOfBatchPublishWaaSEvents201Response,
|
|
23623
|
+
instanceOfBatchRecipient,
|
|
23561
23624
|
instanceOfBulkRetryWebhookDeliveriesRequest,
|
|
23562
23625
|
instanceOfBulkUpsertAuthEmailTemplatesRequest,
|
|
23563
23626
|
instanceOfBulkUpsertAuthEmailTemplatesResponse,
|