@zyphr-dev/node-sdk 0.1.54 → 0.1.55
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 +73 -153
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -169
- package/dist/index.d.ts +70 -169
- package/dist/index.js +73 -138
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +0 -3
- package/src/client.ts +11 -0
- package/src/src/apis/AuthApplicationApi.ts +63 -0
- package/src/src/apis/EmailsApi.ts +4 -4
- package/src/src/apis/SMSApi.ts +50 -4
- package/src/src/apis/WebhooksApi.ts +0 -50
- package/src/src/models/WebhookDelivery.ts +0 -8
- package/src/src/models/WebhookDeliveryDetail.ts +0 -8
- package/src/src/models/index.ts +0 -3
- package/src/src/models/WebhookRegion.ts +0 -81
- package/src/src/models/WebhookRegionsResponse.ts +0 -88
- package/src/src/models/WebhookRegionsResponseData.ts +0 -81
package/dist/index.cjs
CHANGED
|
@@ -2080,18 +2080,6 @@ __export(index_exports, {
|
|
|
2080
2080
|
WebhookMetricsResponseFromJSONTyped: () => WebhookMetricsResponseFromJSONTyped,
|
|
2081
2081
|
WebhookMetricsResponseToJSON: () => WebhookMetricsResponseToJSON,
|
|
2082
2082
|
WebhookMetricsResponseToJSONTyped: () => WebhookMetricsResponseToJSONTyped,
|
|
2083
|
-
WebhookRegionFromJSON: () => WebhookRegionFromJSON,
|
|
2084
|
-
WebhookRegionFromJSONTyped: () => WebhookRegionFromJSONTyped,
|
|
2085
|
-
WebhookRegionToJSON: () => WebhookRegionToJSON,
|
|
2086
|
-
WebhookRegionToJSONTyped: () => WebhookRegionToJSONTyped,
|
|
2087
|
-
WebhookRegionsResponseDataFromJSON: () => WebhookRegionsResponseDataFromJSON,
|
|
2088
|
-
WebhookRegionsResponseDataFromJSONTyped: () => WebhookRegionsResponseDataFromJSONTyped,
|
|
2089
|
-
WebhookRegionsResponseDataToJSON: () => WebhookRegionsResponseDataToJSON,
|
|
2090
|
-
WebhookRegionsResponseDataToJSONTyped: () => WebhookRegionsResponseDataToJSONTyped,
|
|
2091
|
-
WebhookRegionsResponseFromJSON: () => WebhookRegionsResponseFromJSON,
|
|
2092
|
-
WebhookRegionsResponseFromJSONTyped: () => WebhookRegionsResponseFromJSONTyped,
|
|
2093
|
-
WebhookRegionsResponseToJSON: () => WebhookRegionsResponseToJSON,
|
|
2094
|
-
WebhookRegionsResponseToJSONTyped: () => WebhookRegionsResponseToJSONTyped,
|
|
2095
2083
|
WebhookReplayResponseFromJSON: () => WebhookReplayResponseFromJSON,
|
|
2096
2084
|
WebhookReplayResponseFromJSONTyped: () => WebhookReplayResponseFromJSONTyped,
|
|
2097
2085
|
WebhookReplayResponseToJSON: () => WebhookReplayResponseToJSON,
|
|
@@ -2677,9 +2665,6 @@ __export(index_exports, {
|
|
|
2677
2665
|
instanceOfWebhookJobResponse: () => instanceOfWebhookJobResponse,
|
|
2678
2666
|
instanceOfWebhookListResponse: () => instanceOfWebhookListResponse,
|
|
2679
2667
|
instanceOfWebhookMetricsResponse: () => instanceOfWebhookMetricsResponse,
|
|
2680
|
-
instanceOfWebhookRegion: () => instanceOfWebhookRegion,
|
|
2681
|
-
instanceOfWebhookRegionsResponse: () => instanceOfWebhookRegionsResponse,
|
|
2682
|
-
instanceOfWebhookRegionsResponseData: () => instanceOfWebhookRegionsResponseData,
|
|
2683
2668
|
instanceOfWebhookReplayResponse: () => instanceOfWebhookReplayResponse,
|
|
2684
2669
|
instanceOfWebhookResponse: () => instanceOfWebhookResponse,
|
|
2685
2670
|
instanceOfWebhookSecretRotateResponse: () => instanceOfWebhookSecretRotateResponse,
|
|
@@ -18938,7 +18923,6 @@ function WebhookDeliveryFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
18938
18923
|
"firstAttemptedAt": json["first_attempted_at"] == null ? void 0 : new Date(json["first_attempted_at"]),
|
|
18939
18924
|
"lastAttemptedAt": json["last_attempted_at"] == null ? void 0 : new Date(json["last_attempted_at"]),
|
|
18940
18925
|
"completedAt": json["completed_at"] == null ? void 0 : new Date(json["completed_at"]),
|
|
18941
|
-
"deliveryRegion": json["delivery_region"] == null ? void 0 : json["delivery_region"],
|
|
18942
18926
|
"createdAt": json["created_at"] == null ? void 0 : new Date(json["created_at"])
|
|
18943
18927
|
};
|
|
18944
18928
|
}
|
|
@@ -18964,7 +18948,6 @@ function WebhookDeliveryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
18964
18948
|
"first_attempted_at": value["firstAttemptedAt"] == null ? void 0 : value["firstAttemptedAt"].toISOString(),
|
|
18965
18949
|
"last_attempted_at": value["lastAttemptedAt"] == null ? void 0 : value["lastAttemptedAt"].toISOString(),
|
|
18966
18950
|
"completed_at": value["completedAt"] == null ? void 0 : value["completedAt"].toISOString(),
|
|
18967
|
-
"delivery_region": value["deliveryRegion"],
|
|
18968
18951
|
"created_at": value["createdAt"] == null ? void 0 : value["createdAt"].toISOString()
|
|
18969
18952
|
};
|
|
18970
18953
|
}
|
|
@@ -19002,7 +18985,6 @@ function WebhookDeliveryDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
19002
18985
|
"firstAttemptedAt": json["first_attempted_at"] == null ? void 0 : new Date(json["first_attempted_at"]),
|
|
19003
18986
|
"lastAttemptedAt": json["last_attempted_at"] == null ? void 0 : new Date(json["last_attempted_at"]),
|
|
19004
18987
|
"completedAt": json["completed_at"] == null ? void 0 : new Date(json["completed_at"]),
|
|
19005
|
-
"deliveryRegion": json["delivery_region"] == null ? void 0 : json["delivery_region"],
|
|
19006
18988
|
"createdAt": json["created_at"] == null ? void 0 : new Date(json["created_at"]),
|
|
19007
18989
|
"payload": json["payload"] == null ? void 0 : json["payload"],
|
|
19008
18990
|
"lastResponseBody": json["last_response_body"] == null ? void 0 : json["last_response_body"],
|
|
@@ -19032,7 +19014,6 @@ function WebhookDeliveryDetailToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
19032
19014
|
"first_attempted_at": value["firstAttemptedAt"] == null ? void 0 : value["firstAttemptedAt"].toISOString(),
|
|
19033
19015
|
"last_attempted_at": value["lastAttemptedAt"] == null ? void 0 : value["lastAttemptedAt"].toISOString(),
|
|
19034
19016
|
"completed_at": value["completedAt"] == null ? void 0 : value["completedAt"].toISOString(),
|
|
19035
|
-
"delivery_region": value["deliveryRegion"],
|
|
19036
19017
|
"created_at": value["createdAt"] == null ? void 0 : value["createdAt"].toISOString(),
|
|
19037
19018
|
"payload": value["payload"],
|
|
19038
19019
|
"last_response_body": value["lastResponseBody"],
|
|
@@ -19368,95 +19349,6 @@ function WebhookMetricsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
19368
19349
|
};
|
|
19369
19350
|
}
|
|
19370
19351
|
|
|
19371
|
-
// src/src/models/WebhookRegion.ts
|
|
19372
|
-
function instanceOfWebhookRegion(value) {
|
|
19373
|
-
return true;
|
|
19374
|
-
}
|
|
19375
|
-
function WebhookRegionFromJSON(json) {
|
|
19376
|
-
return WebhookRegionFromJSONTyped(json, false);
|
|
19377
|
-
}
|
|
19378
|
-
function WebhookRegionFromJSONTyped(json, ignoreDiscriminator) {
|
|
19379
|
-
if (json == null) {
|
|
19380
|
-
return json;
|
|
19381
|
-
}
|
|
19382
|
-
return {
|
|
19383
|
-
"code": json["code"] == null ? void 0 : json["code"],
|
|
19384
|
-
"name": json["name"] == null ? void 0 : json["name"],
|
|
19385
|
-
"staticIps": json["static_ips"] == null ? void 0 : json["static_ips"]
|
|
19386
|
-
};
|
|
19387
|
-
}
|
|
19388
|
-
function WebhookRegionToJSON(json) {
|
|
19389
|
-
return WebhookRegionToJSONTyped(json, false);
|
|
19390
|
-
}
|
|
19391
|
-
function WebhookRegionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
19392
|
-
if (value == null) {
|
|
19393
|
-
return value;
|
|
19394
|
-
}
|
|
19395
|
-
return {
|
|
19396
|
-
"code": value["code"],
|
|
19397
|
-
"name": value["name"],
|
|
19398
|
-
"static_ips": value["staticIps"]
|
|
19399
|
-
};
|
|
19400
|
-
}
|
|
19401
|
-
|
|
19402
|
-
// src/src/models/WebhookRegionsResponseData.ts
|
|
19403
|
-
function instanceOfWebhookRegionsResponseData(value) {
|
|
19404
|
-
return true;
|
|
19405
|
-
}
|
|
19406
|
-
function WebhookRegionsResponseDataFromJSON(json) {
|
|
19407
|
-
return WebhookRegionsResponseDataFromJSONTyped(json, false);
|
|
19408
|
-
}
|
|
19409
|
-
function WebhookRegionsResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
19410
|
-
if (json == null) {
|
|
19411
|
-
return json;
|
|
19412
|
-
}
|
|
19413
|
-
return {
|
|
19414
|
-
"regions": json["regions"] == null ? void 0 : json["regions"].map(WebhookRegionFromJSON),
|
|
19415
|
-
"defaultRegion": json["default_region"] == null ? void 0 : json["default_region"]
|
|
19416
|
-
};
|
|
19417
|
-
}
|
|
19418
|
-
function WebhookRegionsResponseDataToJSON(json) {
|
|
19419
|
-
return WebhookRegionsResponseDataToJSONTyped(json, false);
|
|
19420
|
-
}
|
|
19421
|
-
function WebhookRegionsResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
19422
|
-
if (value == null) {
|
|
19423
|
-
return value;
|
|
19424
|
-
}
|
|
19425
|
-
return {
|
|
19426
|
-
"regions": value["regions"] == null ? void 0 : value["regions"].map(WebhookRegionToJSON),
|
|
19427
|
-
"default_region": value["defaultRegion"]
|
|
19428
|
-
};
|
|
19429
|
-
}
|
|
19430
|
-
|
|
19431
|
-
// src/src/models/WebhookRegionsResponse.ts
|
|
19432
|
-
function instanceOfWebhookRegionsResponse(value) {
|
|
19433
|
-
return true;
|
|
19434
|
-
}
|
|
19435
|
-
function WebhookRegionsResponseFromJSON(json) {
|
|
19436
|
-
return WebhookRegionsResponseFromJSONTyped(json, false);
|
|
19437
|
-
}
|
|
19438
|
-
function WebhookRegionsResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
19439
|
-
if (json == null) {
|
|
19440
|
-
return json;
|
|
19441
|
-
}
|
|
19442
|
-
return {
|
|
19443
|
-
"data": json["data"] == null ? void 0 : WebhookRegionsResponseDataFromJSON(json["data"]),
|
|
19444
|
-
"meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"])
|
|
19445
|
-
};
|
|
19446
|
-
}
|
|
19447
|
-
function WebhookRegionsResponseToJSON(json) {
|
|
19448
|
-
return WebhookRegionsResponseToJSONTyped(json, false);
|
|
19449
|
-
}
|
|
19450
|
-
function WebhookRegionsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
19451
|
-
if (value == null) {
|
|
19452
|
-
return value;
|
|
19453
|
-
}
|
|
19454
|
-
return {
|
|
19455
|
-
"data": WebhookRegionsResponseDataToJSON(value["data"]),
|
|
19456
|
-
"meta": RequestMetaToJSON(value["meta"])
|
|
19457
|
-
};
|
|
19458
|
-
}
|
|
19459
|
-
|
|
19460
19352
|
// src/src/models/WebhookReplayResponse.ts
|
|
19461
19353
|
function instanceOfWebhookReplayResponse(value) {
|
|
19462
19354
|
return true;
|
|
@@ -19821,6 +19713,40 @@ function WithdrawSubscriberConsentRequestToJSONTyped(value, ignoreDiscriminator
|
|
|
19821
19713
|
|
|
19822
19714
|
// src/src/apis/AuthApplicationApi.ts
|
|
19823
19715
|
var AuthApplicationApi = class extends BaseAPI {
|
|
19716
|
+
/**
|
|
19717
|
+
* Returns a machine-readable JSON bundle of everything stored about one end user, for answering a GDPR Art. 15 (access) or Art. 20 (portability) request. Zyphr is a **processor**: we do not answer data subjects directly. This endpoint gives you, the controller, the data needed to respond to your own end user. **Credentials are deliberately excluded** and are listed in `export_metadata.excluded`: password hashes, session refresh-token hashes, MFA secrets, OAuth access/refresh tokens and WebAuthn public keys. These are authentication artifacts rather than personal data about the subject, and including them would turn this endpoint into a credential-exfiltration path. Message history is capped at the 1,000 most recent messages; `export_metadata.message_history_truncated` reports whether the cap was hit.
|
|
19718
|
+
* Export all data held about an end user
|
|
19719
|
+
*/
|
|
19720
|
+
async exportEndUserDataRaw(requestParameters, initOverrides) {
|
|
19721
|
+
if (requestParameters["id"] == null) {
|
|
19722
|
+
throw new RequiredError(
|
|
19723
|
+
"id",
|
|
19724
|
+
'Required parameter "id" was null or undefined when calling exportEndUserData().'
|
|
19725
|
+
);
|
|
19726
|
+
}
|
|
19727
|
+
if (requestParameters["userId"] == null) {
|
|
19728
|
+
throw new RequiredError(
|
|
19729
|
+
"userId",
|
|
19730
|
+
'Required parameter "userId" was null or undefined when calling exportEndUserData().'
|
|
19731
|
+
);
|
|
19732
|
+
}
|
|
19733
|
+
const queryParameters = {};
|
|
19734
|
+
const headerParameters = {};
|
|
19735
|
+
const response = await this.request({
|
|
19736
|
+
path: `/v1/applications/{id}/users/{userId}/export`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"]))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters["userId"]))),
|
|
19737
|
+
method: "GET",
|
|
19738
|
+
headers: headerParameters,
|
|
19739
|
+
query: queryParameters
|
|
19740
|
+
}, initOverrides);
|
|
19741
|
+
return new VoidApiResponse(response);
|
|
19742
|
+
}
|
|
19743
|
+
/**
|
|
19744
|
+
* Returns a machine-readable JSON bundle of everything stored about one end user, for answering a GDPR Art. 15 (access) or Art. 20 (portability) request. Zyphr is a **processor**: we do not answer data subjects directly. This endpoint gives you, the controller, the data needed to respond to your own end user. **Credentials are deliberately excluded** and are listed in `export_metadata.excluded`: password hashes, session refresh-token hashes, MFA secrets, OAuth access/refresh tokens and WebAuthn public keys. These are authentication artifacts rather than personal data about the subject, and including them would turn this endpoint into a credential-exfiltration path. Message history is capped at the 1,000 most recent messages; `export_metadata.message_history_truncated` reports whether the cap was hit.
|
|
19745
|
+
* Export all data held about an end user
|
|
19746
|
+
*/
|
|
19747
|
+
async exportEndUserData(id, userId, initOverrides) {
|
|
19748
|
+
await this.exportEndUserDataRaw({ id, userId }, initOverrides);
|
|
19749
|
+
}
|
|
19824
19750
|
/**
|
|
19825
19751
|
* Return non-sensitive metadata about the application whose credentials authenticated this request. Lets an integrator read their own application_id (the sole tenant discriminator embedded in every end-user token) directly from the API, rather than only from the dashboard UI or by decoding a token. Returns only id, name, the calling environment\'s mode, and the JWT signing algorithm — never secrets, signing keys, or account-internal fields.
|
|
19826
19752
|
* Get the authenticating application
|
|
@@ -23790,7 +23716,7 @@ var EmailsApi = class extends BaseAPI {
|
|
|
23790
23716
|
return await response.value();
|
|
23791
23717
|
}
|
|
23792
23718
|
/**
|
|
23793
|
-
* Queue an email for delivery. The email is processed asynchronously and you\'ll receive a message ID to track its status. You can provide content directly via `html`/`text` fields, or use a template by specifying `template_id` and `template_data`.
|
|
23719
|
+
* Queue an email for delivery. The email is processed asynchronously and you\'ll receive a message ID to track its status. You can provide content directly via `html`/`text` fields, or use a template by specifying `template_id` and `template_data`. **CAN-SPAM compliance — actions required from you:** - **Set `classification`** to `transactional` or `marketing`. Unclassified is treated as marketing, the stricter reading. Transactional mail (password resets, receipts) is exempt from the opt-out and postal-address requirements. - **Set your postal address** in project settings. Commercial email must carry a valid physical postal address — the most commonly missed CAN-SPAM element. Marketing sends without one are flagged. - **Include an unsubscribe mechanism** on commercial email. Zyphr enforces suppression automatically once someone opts out, but the link itself is yours to include. See [Compliance Requirements](https://zyphr.dev/guides/compliance-requirements).
|
|
23794
23720
|
* Send an email
|
|
23795
23721
|
*/
|
|
23796
23722
|
async sendEmailRaw(requestParameters, initOverrides) {
|
|
@@ -23816,7 +23742,7 @@ var EmailsApi = class extends BaseAPI {
|
|
|
23816
23742
|
return new JSONApiResponse(response, (jsonValue) => SendEmailResponseFromJSON(jsonValue));
|
|
23817
23743
|
}
|
|
23818
23744
|
/**
|
|
23819
|
-
* Queue an email for delivery. The email is processed asynchronously and you\'ll receive a message ID to track its status. You can provide content directly via `html`/`text` fields, or use a template by specifying `template_id` and `template_data`.
|
|
23745
|
+
* Queue an email for delivery. The email is processed asynchronously and you\'ll receive a message ID to track its status. You can provide content directly via `html`/`text` fields, or use a template by specifying `template_id` and `template_data`. **CAN-SPAM compliance — actions required from you:** - **Set `classification`** to `transactional` or `marketing`. Unclassified is treated as marketing, the stricter reading. Transactional mail (password resets, receipts) is exempt from the opt-out and postal-address requirements. - **Set your postal address** in project settings. Commercial email must carry a valid physical postal address — the most commonly missed CAN-SPAM element. Marketing sends without one are flagged. - **Include an unsubscribe mechanism** on commercial email. Zyphr enforces suppression automatically once someone opts out, but the link itself is yours to include. See [Compliance Requirements](https://zyphr.dev/guides/compliance-requirements).
|
|
23820
23746
|
* Send an email
|
|
23821
23747
|
*/
|
|
23822
23748
|
async sendEmail(sendEmailRequest, initOverrides) {
|
|
@@ -25201,6 +25127,31 @@ var SMSApi = class extends BaseAPI {
|
|
|
25201
25127
|
const response = await this.getSmsConfigRaw(initOverrides);
|
|
25202
25128
|
return await response.value();
|
|
25203
25129
|
}
|
|
25130
|
+
/**
|
|
25131
|
+
* Returns the URL to configure in your SMS provider so STOP/opt-out replies reach Zyphr. The token is generated on first request and is stable thereafter. **This is required for TCPA compliance.** Until your provider is pointed at this URL, opt-out replies stop at the provider and never reach us — from Zyphr\'s side the recipient never opted out, and sends continue. See [Compliance Requirements](https://zyphr.dev/guides/compliance-requirements).
|
|
25132
|
+
* Get the inbound SMS webhook URL
|
|
25133
|
+
*/
|
|
25134
|
+
async getSmsInboundWebhookRaw(initOverrides) {
|
|
25135
|
+
const queryParameters = {};
|
|
25136
|
+
const headerParameters = {};
|
|
25137
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
25138
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
25139
|
+
}
|
|
25140
|
+
const response = await this.request({
|
|
25141
|
+
path: `/sms/inbound-webhook`,
|
|
25142
|
+
method: "GET",
|
|
25143
|
+
headers: headerParameters,
|
|
25144
|
+
query: queryParameters
|
|
25145
|
+
}, initOverrides);
|
|
25146
|
+
return new VoidApiResponse(response);
|
|
25147
|
+
}
|
|
25148
|
+
/**
|
|
25149
|
+
* Returns the URL to configure in your SMS provider so STOP/opt-out replies reach Zyphr. The token is generated on first request and is stable thereafter. **This is required for TCPA compliance.** Until your provider is pointed at this URL, opt-out replies stop at the provider and never reach us — from Zyphr\'s side the recipient never opted out, and sends continue. See [Compliance Requirements](https://zyphr.dev/guides/compliance-requirements).
|
|
25150
|
+
* Get the inbound SMS webhook URL
|
|
25151
|
+
*/
|
|
25152
|
+
async getSmsInboundWebhook(initOverrides) {
|
|
25153
|
+
await this.getSmsInboundWebhookRaw(initOverrides);
|
|
25154
|
+
}
|
|
25204
25155
|
/**
|
|
25205
25156
|
* List SMS messages for the account with optional filtering and pagination.
|
|
25206
25157
|
* List SMS messages
|
|
@@ -25274,7 +25225,7 @@ var SMSApi = class extends BaseAPI {
|
|
|
25274
25225
|
return await response.value();
|
|
25275
25226
|
}
|
|
25276
25227
|
/**
|
|
25277
|
-
* Send a single SMS text message. Supports subscriber preference checks and scheduling.
|
|
25228
|
+
* Send a single SMS text message. Supports subscriber preference checks and scheduling. **TCPA compliance — actions required from you:** - **Configure the inbound webhook.** Zyphr only processes STOP/opt-out replies if your SMS provider is pointed at our inbound endpoint. Until you do this, opt-outs never reach us and we will keep delivering. See [Compliance Requirements](https://zyphr.dev/guides/compliance-requirements). - **Pass `recipient_timezone`** (IANA, e.g. `America/New_York`) so quiet hours (8am-9pm recipient-local) can be enforced. Without it we send and record that quiet hours could not be evaluated. We deliberately do not infer a timezone from the area code — people keep numbers when they move. - **Record consent** for marketing sends. Marketing requires prior express *written* consent; `express` consent covers transactional only. With no record on file we deliver and flag it, which is a gap in your evidence, not permission. - **Set `classification`.** Unclassified messages are treated as marketing, the stricter reading.
|
|
25278
25229
|
* Send an SMS message
|
|
25279
25230
|
*/
|
|
25280
25231
|
async sendSmsRaw(requestParameters, initOverrides) {
|
|
@@ -25300,7 +25251,7 @@ var SMSApi = class extends BaseAPI {
|
|
|
25300
25251
|
return new JSONApiResponse(response, (jsonValue) => SendSmsResponseFromJSON(jsonValue));
|
|
25301
25252
|
}
|
|
25302
25253
|
/**
|
|
25303
|
-
* Send a single SMS text message. Supports subscriber preference checks and scheduling.
|
|
25254
|
+
* Send a single SMS text message. Supports subscriber preference checks and scheduling. **TCPA compliance — actions required from you:** - **Configure the inbound webhook.** Zyphr only processes STOP/opt-out replies if your SMS provider is pointed at our inbound endpoint. Until you do this, opt-outs never reach us and we will keep delivering. See [Compliance Requirements](https://zyphr.dev/guides/compliance-requirements). - **Pass `recipient_timezone`** (IANA, e.g. `America/New_York`) so quiet hours (8am-9pm recipient-local) can be enforced. Without it we send and record that quiet hours could not be evaluated. We deliberately do not infer a timezone from the area code — people keep numbers when they move. - **Record consent** for marketing sends. Marketing requires prior express *written* consent; `express` consent covers transactional only. With no record on file we deliver and flag it, which is a gap in your evidence, not permission. - **Set `classification`.** Unclassified messages are treated as marketing, the stricter reading.
|
|
25304
25255
|
* Send an SMS message
|
|
25305
25256
|
*/
|
|
25306
25257
|
async sendSms(sendSmsRequest, initOverrides) {
|
|
@@ -28324,32 +28275,6 @@ var WebhooksApi = class extends BaseAPI {
|
|
|
28324
28275
|
const response = await this.getWebhookMetricsRaw({ id }, initOverrides);
|
|
28325
28276
|
return await response.value();
|
|
28326
28277
|
}
|
|
28327
|
-
/**
|
|
28328
|
-
* Get available webhook delivery regions. Requires multi_region plan feature (Enterprise only).
|
|
28329
|
-
* Get available webhook regions
|
|
28330
|
-
*/
|
|
28331
|
-
async getWebhookRegionsRaw(initOverrides) {
|
|
28332
|
-
const queryParameters = {};
|
|
28333
|
-
const headerParameters = {};
|
|
28334
|
-
if (this.configuration && this.configuration.apiKey) {
|
|
28335
|
-
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
28336
|
-
}
|
|
28337
|
-
const response = await this.request({
|
|
28338
|
-
path: `/v1/webhooks/regions`,
|
|
28339
|
-
method: "GET",
|
|
28340
|
-
headers: headerParameters,
|
|
28341
|
-
query: queryParameters
|
|
28342
|
-
}, initOverrides);
|
|
28343
|
-
return new JSONApiResponse(response, (jsonValue) => WebhookRegionsResponseFromJSON(jsonValue));
|
|
28344
|
-
}
|
|
28345
|
-
/**
|
|
28346
|
-
* Get available webhook delivery regions. Requires multi_region plan feature (Enterprise only).
|
|
28347
|
-
* Get available webhook regions
|
|
28348
|
-
*/
|
|
28349
|
-
async getWebhookRegions(initOverrides) {
|
|
28350
|
-
const response = await this.getWebhookRegionsRaw(initOverrides);
|
|
28351
|
-
return await response.value();
|
|
28352
|
-
}
|
|
28353
28278
|
/**
|
|
28354
28279
|
* Get webhook delivery usage statistics for the current billing period.
|
|
28355
28280
|
* Get webhook usage metrics
|
|
@@ -29332,6 +29257,15 @@ var Zyphr = class {
|
|
|
29332
29257
|
/** Publishable-key-safe utilities: password policy + pre-submit strength check. */
|
|
29333
29258
|
utility;
|
|
29334
29259
|
domains;
|
|
29260
|
+
/**
|
|
29261
|
+
* Multi-step workflow definitions and triggering (sc-7926).
|
|
29262
|
+
*
|
|
29263
|
+
* All 12 operations are API-key authenticated with dedicated
|
|
29264
|
+
* `workflows:read` / `workflows:write` / `workflows:execute` scopes, so this
|
|
29265
|
+
* is deliberate public surface. It was generated but never wired onto the
|
|
29266
|
+
* facade, which made the documented `zyphr.workflows.*` calls throw.
|
|
29267
|
+
*/
|
|
29268
|
+
workflows;
|
|
29335
29269
|
/** Inbound (received) email — read access. Requires the `email:read` scope. */
|
|
29336
29270
|
inbound;
|
|
29337
29271
|
waas;
|
|
@@ -29360,6 +29294,7 @@ var Zyphr = class {
|
|
|
29360
29294
|
this.devices = new DevicesApi(config);
|
|
29361
29295
|
this.utility = new UtilityApi(config);
|
|
29362
29296
|
this.domains = new DomainsApi(config);
|
|
29297
|
+
this.workflows = new WorkflowsApi(config);
|
|
29363
29298
|
this.inbound = new InboundEmailApi(config);
|
|
29364
29299
|
this.waas = {
|
|
29365
29300
|
applications: new WaaSApplicationsApi(config),
|
|
@@ -31604,18 +31539,6 @@ var SDK_VERSION = "0.1.0";
|
|
|
31604
31539
|
WebhookMetricsResponseFromJSONTyped,
|
|
31605
31540
|
WebhookMetricsResponseToJSON,
|
|
31606
31541
|
WebhookMetricsResponseToJSONTyped,
|
|
31607
|
-
WebhookRegionFromJSON,
|
|
31608
|
-
WebhookRegionFromJSONTyped,
|
|
31609
|
-
WebhookRegionToJSON,
|
|
31610
|
-
WebhookRegionToJSONTyped,
|
|
31611
|
-
WebhookRegionsResponseDataFromJSON,
|
|
31612
|
-
WebhookRegionsResponseDataFromJSONTyped,
|
|
31613
|
-
WebhookRegionsResponseDataToJSON,
|
|
31614
|
-
WebhookRegionsResponseDataToJSONTyped,
|
|
31615
|
-
WebhookRegionsResponseFromJSON,
|
|
31616
|
-
WebhookRegionsResponseFromJSONTyped,
|
|
31617
|
-
WebhookRegionsResponseToJSON,
|
|
31618
|
-
WebhookRegionsResponseToJSONTyped,
|
|
31619
31542
|
WebhookReplayResponseFromJSON,
|
|
31620
31543
|
WebhookReplayResponseFromJSONTyped,
|
|
31621
31544
|
WebhookReplayResponseToJSON,
|
|
@@ -32201,9 +32124,6 @@ var SDK_VERSION = "0.1.0";
|
|
|
32201
32124
|
instanceOfWebhookJobResponse,
|
|
32202
32125
|
instanceOfWebhookListResponse,
|
|
32203
32126
|
instanceOfWebhookMetricsResponse,
|
|
32204
|
-
instanceOfWebhookRegion,
|
|
32205
|
-
instanceOfWebhookRegionsResponse,
|
|
32206
|
-
instanceOfWebhookRegionsResponseData,
|
|
32207
32127
|
instanceOfWebhookReplayResponse,
|
|
32208
32128
|
instanceOfWebhookResponse,
|
|
32209
32129
|
instanceOfWebhookSecretRotateResponse,
|