@zyphr-dev/node-sdk 0.1.54 → 0.1.56
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 +79 -157
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +97 -173
- package/dist/index.d.ts +97 -173
- package/dist/index.js +79 -142
- 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/AuthPasswordResetApi.ts +4 -4
- 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/InviteEndUser200ResponseData.ts +25 -0
- 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,
|
|
@@ -9169,7 +9154,8 @@ function InviteEndUser200ResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
9169
9154
|
return {
|
|
9170
9155
|
"userId": json["user_id"] == null ? void 0 : json["user_id"],
|
|
9171
9156
|
"created": json["created"] == null ? void 0 : json["created"],
|
|
9172
|
-
"linkSent": json["link_sent"] == null ? void 0 : json["link_sent"]
|
|
9157
|
+
"linkSent": json["link_sent"] == null ? void 0 : json["link_sent"],
|
|
9158
|
+
"linkSuppressedReason": json["link_suppressed_reason"] == null ? void 0 : json["link_suppressed_reason"]
|
|
9173
9159
|
};
|
|
9174
9160
|
}
|
|
9175
9161
|
function InviteEndUser200ResponseDataToJSON(json) {
|
|
@@ -9182,7 +9168,8 @@ function InviteEndUser200ResponseDataToJSONTyped(value, ignoreDiscriminator = fa
|
|
|
9182
9168
|
return {
|
|
9183
9169
|
"user_id": value["userId"],
|
|
9184
9170
|
"created": value["created"],
|
|
9185
|
-
"link_sent": value["linkSent"]
|
|
9171
|
+
"link_sent": value["linkSent"],
|
|
9172
|
+
"link_suppressed_reason": value["linkSuppressedReason"]
|
|
9186
9173
|
};
|
|
9187
9174
|
}
|
|
9188
9175
|
|
|
@@ -18938,7 +18925,6 @@ function WebhookDeliveryFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
18938
18925
|
"firstAttemptedAt": json["first_attempted_at"] == null ? void 0 : new Date(json["first_attempted_at"]),
|
|
18939
18926
|
"lastAttemptedAt": json["last_attempted_at"] == null ? void 0 : new Date(json["last_attempted_at"]),
|
|
18940
18927
|
"completedAt": json["completed_at"] == null ? void 0 : new Date(json["completed_at"]),
|
|
18941
|
-
"deliveryRegion": json["delivery_region"] == null ? void 0 : json["delivery_region"],
|
|
18942
18928
|
"createdAt": json["created_at"] == null ? void 0 : new Date(json["created_at"])
|
|
18943
18929
|
};
|
|
18944
18930
|
}
|
|
@@ -18964,7 +18950,6 @@ function WebhookDeliveryToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
18964
18950
|
"first_attempted_at": value["firstAttemptedAt"] == null ? void 0 : value["firstAttemptedAt"].toISOString(),
|
|
18965
18951
|
"last_attempted_at": value["lastAttemptedAt"] == null ? void 0 : value["lastAttemptedAt"].toISOString(),
|
|
18966
18952
|
"completed_at": value["completedAt"] == null ? void 0 : value["completedAt"].toISOString(),
|
|
18967
|
-
"delivery_region": value["deliveryRegion"],
|
|
18968
18953
|
"created_at": value["createdAt"] == null ? void 0 : value["createdAt"].toISOString()
|
|
18969
18954
|
};
|
|
18970
18955
|
}
|
|
@@ -19002,7 +18987,6 @@ function WebhookDeliveryDetailFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
19002
18987
|
"firstAttemptedAt": json["first_attempted_at"] == null ? void 0 : new Date(json["first_attempted_at"]),
|
|
19003
18988
|
"lastAttemptedAt": json["last_attempted_at"] == null ? void 0 : new Date(json["last_attempted_at"]),
|
|
19004
18989
|
"completedAt": json["completed_at"] == null ? void 0 : new Date(json["completed_at"]),
|
|
19005
|
-
"deliveryRegion": json["delivery_region"] == null ? void 0 : json["delivery_region"],
|
|
19006
18990
|
"createdAt": json["created_at"] == null ? void 0 : new Date(json["created_at"]),
|
|
19007
18991
|
"payload": json["payload"] == null ? void 0 : json["payload"],
|
|
19008
18992
|
"lastResponseBody": json["last_response_body"] == null ? void 0 : json["last_response_body"],
|
|
@@ -19032,7 +19016,6 @@ function WebhookDeliveryDetailToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
19032
19016
|
"first_attempted_at": value["firstAttemptedAt"] == null ? void 0 : value["firstAttemptedAt"].toISOString(),
|
|
19033
19017
|
"last_attempted_at": value["lastAttemptedAt"] == null ? void 0 : value["lastAttemptedAt"].toISOString(),
|
|
19034
19018
|
"completed_at": value["completedAt"] == null ? void 0 : value["completedAt"].toISOString(),
|
|
19035
|
-
"delivery_region": value["deliveryRegion"],
|
|
19036
19019
|
"created_at": value["createdAt"] == null ? void 0 : value["createdAt"].toISOString(),
|
|
19037
19020
|
"payload": value["payload"],
|
|
19038
19021
|
"last_response_body": value["lastResponseBody"],
|
|
@@ -19368,95 +19351,6 @@ function WebhookMetricsResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
19368
19351
|
};
|
|
19369
19352
|
}
|
|
19370
19353
|
|
|
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
19354
|
// src/src/models/WebhookReplayResponse.ts
|
|
19461
19355
|
function instanceOfWebhookReplayResponse(value) {
|
|
19462
19356
|
return true;
|
|
@@ -19821,6 +19715,40 @@ function WithdrawSubscriberConsentRequestToJSONTyped(value, ignoreDiscriminator
|
|
|
19821
19715
|
|
|
19822
19716
|
// src/src/apis/AuthApplicationApi.ts
|
|
19823
19717
|
var AuthApplicationApi = class extends BaseAPI {
|
|
19718
|
+
/**
|
|
19719
|
+
* 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.
|
|
19720
|
+
* Export all data held about an end user
|
|
19721
|
+
*/
|
|
19722
|
+
async exportEndUserDataRaw(requestParameters, initOverrides) {
|
|
19723
|
+
if (requestParameters["id"] == null) {
|
|
19724
|
+
throw new RequiredError(
|
|
19725
|
+
"id",
|
|
19726
|
+
'Required parameter "id" was null or undefined when calling exportEndUserData().'
|
|
19727
|
+
);
|
|
19728
|
+
}
|
|
19729
|
+
if (requestParameters["userId"] == null) {
|
|
19730
|
+
throw new RequiredError(
|
|
19731
|
+
"userId",
|
|
19732
|
+
'Required parameter "userId" was null or undefined when calling exportEndUserData().'
|
|
19733
|
+
);
|
|
19734
|
+
}
|
|
19735
|
+
const queryParameters = {};
|
|
19736
|
+
const headerParameters = {};
|
|
19737
|
+
const response = await this.request({
|
|
19738
|
+
path: `/v1/applications/{id}/users/{userId}/export`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"]))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters["userId"]))),
|
|
19739
|
+
method: "GET",
|
|
19740
|
+
headers: headerParameters,
|
|
19741
|
+
query: queryParameters
|
|
19742
|
+
}, initOverrides);
|
|
19743
|
+
return new VoidApiResponse(response);
|
|
19744
|
+
}
|
|
19745
|
+
/**
|
|
19746
|
+
* 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.
|
|
19747
|
+
* Export all data held about an end user
|
|
19748
|
+
*/
|
|
19749
|
+
async exportEndUserData(id, userId, initOverrides) {
|
|
19750
|
+
await this.exportEndUserDataRaw({ id, userId }, initOverrides);
|
|
19751
|
+
}
|
|
19824
19752
|
/**
|
|
19825
19753
|
* 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
19754
|
* Get the authenticating application
|
|
@@ -21766,7 +21694,7 @@ var AuthOrganizationsApi = class extends BaseAPI {
|
|
|
21766
21694
|
// src/src/apis/AuthPasswordResetApi.ts
|
|
21767
21695
|
var AuthPasswordResetApi = class extends BaseAPI {
|
|
21768
21696
|
/**
|
|
21769
|
-
* Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration.
|
|
21697
|
+
* Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
|
|
21770
21698
|
* Request a password reset
|
|
21771
21699
|
*/
|
|
21772
21700
|
async forgotPasswordRaw(requestParameters, initOverrides) {
|
|
@@ -21795,7 +21723,7 @@ var AuthPasswordResetApi = class extends BaseAPI {
|
|
|
21795
21723
|
return new JSONApiResponse(response, (jsonValue) => SuccessResultFromJSON(jsonValue));
|
|
21796
21724
|
}
|
|
21797
21725
|
/**
|
|
21798
|
-
* Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration.
|
|
21726
|
+
* Request a password reset email. Creates a reset token and sends an email to the user. Always returns success to prevent email enumeration — the response is identical whether or not the address is registered. An identity with **no password set** still receives a link, which sets a first password. This covers users migrated from a provider that cannot export password hashes. The one case where no email is sent (beyond an unknown address) is an identity that has no password but *does* have another way in — a linked OAuth provider and/or a passkey. Those users are not locked out, so no set-password link is sent; the attempt is recorded as a suppressed message visible via `GET /emails`.
|
|
21799
21727
|
* Request a password reset
|
|
21800
21728
|
*/
|
|
21801
21729
|
async forgotPassword(forgotPasswordRequest, initOverrides) {
|
|
@@ -23790,7 +23718,7 @@ var EmailsApi = class extends BaseAPI {
|
|
|
23790
23718
|
return await response.value();
|
|
23791
23719
|
}
|
|
23792
23720
|
/**
|
|
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`.
|
|
23721
|
+
* 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
23722
|
* Send an email
|
|
23795
23723
|
*/
|
|
23796
23724
|
async sendEmailRaw(requestParameters, initOverrides) {
|
|
@@ -23816,7 +23744,7 @@ var EmailsApi = class extends BaseAPI {
|
|
|
23816
23744
|
return new JSONApiResponse(response, (jsonValue) => SendEmailResponseFromJSON(jsonValue));
|
|
23817
23745
|
}
|
|
23818
23746
|
/**
|
|
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`.
|
|
23747
|
+
* 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
23748
|
* Send an email
|
|
23821
23749
|
*/
|
|
23822
23750
|
async sendEmail(sendEmailRequest, initOverrides) {
|
|
@@ -25201,6 +25129,31 @@ var SMSApi = class extends BaseAPI {
|
|
|
25201
25129
|
const response = await this.getSmsConfigRaw(initOverrides);
|
|
25202
25130
|
return await response.value();
|
|
25203
25131
|
}
|
|
25132
|
+
/**
|
|
25133
|
+
* 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).
|
|
25134
|
+
* Get the inbound SMS webhook URL
|
|
25135
|
+
*/
|
|
25136
|
+
async getSmsInboundWebhookRaw(initOverrides) {
|
|
25137
|
+
const queryParameters = {};
|
|
25138
|
+
const headerParameters = {};
|
|
25139
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
25140
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
25141
|
+
}
|
|
25142
|
+
const response = await this.request({
|
|
25143
|
+
path: `/sms/inbound-webhook`,
|
|
25144
|
+
method: "GET",
|
|
25145
|
+
headers: headerParameters,
|
|
25146
|
+
query: queryParameters
|
|
25147
|
+
}, initOverrides);
|
|
25148
|
+
return new VoidApiResponse(response);
|
|
25149
|
+
}
|
|
25150
|
+
/**
|
|
25151
|
+
* 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).
|
|
25152
|
+
* Get the inbound SMS webhook URL
|
|
25153
|
+
*/
|
|
25154
|
+
async getSmsInboundWebhook(initOverrides) {
|
|
25155
|
+
await this.getSmsInboundWebhookRaw(initOverrides);
|
|
25156
|
+
}
|
|
25204
25157
|
/**
|
|
25205
25158
|
* List SMS messages for the account with optional filtering and pagination.
|
|
25206
25159
|
* List SMS messages
|
|
@@ -25274,7 +25227,7 @@ var SMSApi = class extends BaseAPI {
|
|
|
25274
25227
|
return await response.value();
|
|
25275
25228
|
}
|
|
25276
25229
|
/**
|
|
25277
|
-
* Send a single SMS text message. Supports subscriber preference checks and scheduling.
|
|
25230
|
+
* 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
25231
|
* Send an SMS message
|
|
25279
25232
|
*/
|
|
25280
25233
|
async sendSmsRaw(requestParameters, initOverrides) {
|
|
@@ -25300,7 +25253,7 @@ var SMSApi = class extends BaseAPI {
|
|
|
25300
25253
|
return new JSONApiResponse(response, (jsonValue) => SendSmsResponseFromJSON(jsonValue));
|
|
25301
25254
|
}
|
|
25302
25255
|
/**
|
|
25303
|
-
* Send a single SMS text message. Supports subscriber preference checks and scheduling.
|
|
25256
|
+
* 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
25257
|
* Send an SMS message
|
|
25305
25258
|
*/
|
|
25306
25259
|
async sendSms(sendSmsRequest, initOverrides) {
|
|
@@ -28324,32 +28277,6 @@ var WebhooksApi = class extends BaseAPI {
|
|
|
28324
28277
|
const response = await this.getWebhookMetricsRaw({ id }, initOverrides);
|
|
28325
28278
|
return await response.value();
|
|
28326
28279
|
}
|
|
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
28280
|
/**
|
|
28354
28281
|
* Get webhook delivery usage statistics for the current billing period.
|
|
28355
28282
|
* Get webhook usage metrics
|
|
@@ -29332,6 +29259,15 @@ var Zyphr = class {
|
|
|
29332
29259
|
/** Publishable-key-safe utilities: password policy + pre-submit strength check. */
|
|
29333
29260
|
utility;
|
|
29334
29261
|
domains;
|
|
29262
|
+
/**
|
|
29263
|
+
* Multi-step workflow definitions and triggering (sc-7926).
|
|
29264
|
+
*
|
|
29265
|
+
* All 12 operations are API-key authenticated with dedicated
|
|
29266
|
+
* `workflows:read` / `workflows:write` / `workflows:execute` scopes, so this
|
|
29267
|
+
* is deliberate public surface. It was generated but never wired onto the
|
|
29268
|
+
* facade, which made the documented `zyphr.workflows.*` calls throw.
|
|
29269
|
+
*/
|
|
29270
|
+
workflows;
|
|
29335
29271
|
/** Inbound (received) email — read access. Requires the `email:read` scope. */
|
|
29336
29272
|
inbound;
|
|
29337
29273
|
waas;
|
|
@@ -29360,6 +29296,7 @@ var Zyphr = class {
|
|
|
29360
29296
|
this.devices = new DevicesApi(config);
|
|
29361
29297
|
this.utility = new UtilityApi(config);
|
|
29362
29298
|
this.domains = new DomainsApi(config);
|
|
29299
|
+
this.workflows = new WorkflowsApi(config);
|
|
29363
29300
|
this.inbound = new InboundEmailApi(config);
|
|
29364
29301
|
this.waas = {
|
|
29365
29302
|
applications: new WaaSApplicationsApi(config),
|
|
@@ -31604,18 +31541,6 @@ var SDK_VERSION = "0.1.0";
|
|
|
31604
31541
|
WebhookMetricsResponseFromJSONTyped,
|
|
31605
31542
|
WebhookMetricsResponseToJSON,
|
|
31606
31543
|
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
31544
|
WebhookReplayResponseFromJSON,
|
|
31620
31545
|
WebhookReplayResponseFromJSONTyped,
|
|
31621
31546
|
WebhookReplayResponseToJSON,
|
|
@@ -32201,9 +32126,6 @@ var SDK_VERSION = "0.1.0";
|
|
|
32201
32126
|
instanceOfWebhookJobResponse,
|
|
32202
32127
|
instanceOfWebhookListResponse,
|
|
32203
32128
|
instanceOfWebhookMetricsResponse,
|
|
32204
|
-
instanceOfWebhookRegion,
|
|
32205
|
-
instanceOfWebhookRegionsResponse,
|
|
32206
|
-
instanceOfWebhookRegionsResponseData,
|
|
32207
32129
|
instanceOfWebhookReplayResponse,
|
|
32208
32130
|
instanceOfWebhookResponse,
|
|
32209
32131
|
instanceOfWebhookSecretRotateResponse,
|