@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.js CHANGED
@@ -16230,7 +16230,6 @@ function WebhookDeliveryFromJSONTyped(json, ignoreDiscriminator) {
16230
16230
  "firstAttemptedAt": json["first_attempted_at"] == null ? void 0 : new Date(json["first_attempted_at"]),
16231
16231
  "lastAttemptedAt": json["last_attempted_at"] == null ? void 0 : new Date(json["last_attempted_at"]),
16232
16232
  "completedAt": json["completed_at"] == null ? void 0 : new Date(json["completed_at"]),
16233
- "deliveryRegion": json["delivery_region"] == null ? void 0 : json["delivery_region"],
16234
16233
  "createdAt": json["created_at"] == null ? void 0 : new Date(json["created_at"])
16235
16234
  };
16236
16235
  }
@@ -16256,7 +16255,6 @@ function WebhookDeliveryToJSONTyped(value, ignoreDiscriminator = false) {
16256
16255
  "first_attempted_at": value["firstAttemptedAt"] == null ? void 0 : value["firstAttemptedAt"].toISOString(),
16257
16256
  "last_attempted_at": value["lastAttemptedAt"] == null ? void 0 : value["lastAttemptedAt"].toISOString(),
16258
16257
  "completed_at": value["completedAt"] == null ? void 0 : value["completedAt"].toISOString(),
16259
- "delivery_region": value["deliveryRegion"],
16260
16258
  "created_at": value["createdAt"] == null ? void 0 : value["createdAt"].toISOString()
16261
16259
  };
16262
16260
  }
@@ -16294,7 +16292,6 @@ function WebhookDeliveryDetailFromJSONTyped(json, ignoreDiscriminator) {
16294
16292
  "firstAttemptedAt": json["first_attempted_at"] == null ? void 0 : new Date(json["first_attempted_at"]),
16295
16293
  "lastAttemptedAt": json["last_attempted_at"] == null ? void 0 : new Date(json["last_attempted_at"]),
16296
16294
  "completedAt": json["completed_at"] == null ? void 0 : new Date(json["completed_at"]),
16297
- "deliveryRegion": json["delivery_region"] == null ? void 0 : json["delivery_region"],
16298
16295
  "createdAt": json["created_at"] == null ? void 0 : new Date(json["created_at"]),
16299
16296
  "payload": json["payload"] == null ? void 0 : json["payload"],
16300
16297
  "lastResponseBody": json["last_response_body"] == null ? void 0 : json["last_response_body"],
@@ -16324,7 +16321,6 @@ function WebhookDeliveryDetailToJSONTyped(value, ignoreDiscriminator = false) {
16324
16321
  "first_attempted_at": value["firstAttemptedAt"] == null ? void 0 : value["firstAttemptedAt"].toISOString(),
16325
16322
  "last_attempted_at": value["lastAttemptedAt"] == null ? void 0 : value["lastAttemptedAt"].toISOString(),
16326
16323
  "completed_at": value["completedAt"] == null ? void 0 : value["completedAt"].toISOString(),
16327
- "delivery_region": value["deliveryRegion"],
16328
16324
  "created_at": value["createdAt"] == null ? void 0 : value["createdAt"].toISOString(),
16329
16325
  "payload": value["payload"],
16330
16326
  "last_response_body": value["lastResponseBody"],
@@ -16660,95 +16656,6 @@ function WebhookMetricsResponseToJSONTyped(value, ignoreDiscriminator = false) {
16660
16656
  };
16661
16657
  }
16662
16658
 
16663
- // src/src/models/WebhookRegion.ts
16664
- function instanceOfWebhookRegion(value) {
16665
- return true;
16666
- }
16667
- function WebhookRegionFromJSON(json) {
16668
- return WebhookRegionFromJSONTyped(json, false);
16669
- }
16670
- function WebhookRegionFromJSONTyped(json, ignoreDiscriminator) {
16671
- if (json == null) {
16672
- return json;
16673
- }
16674
- return {
16675
- "code": json["code"] == null ? void 0 : json["code"],
16676
- "name": json["name"] == null ? void 0 : json["name"],
16677
- "staticIps": json["static_ips"] == null ? void 0 : json["static_ips"]
16678
- };
16679
- }
16680
- function WebhookRegionToJSON(json) {
16681
- return WebhookRegionToJSONTyped(json, false);
16682
- }
16683
- function WebhookRegionToJSONTyped(value, ignoreDiscriminator = false) {
16684
- if (value == null) {
16685
- return value;
16686
- }
16687
- return {
16688
- "code": value["code"],
16689
- "name": value["name"],
16690
- "static_ips": value["staticIps"]
16691
- };
16692
- }
16693
-
16694
- // src/src/models/WebhookRegionsResponseData.ts
16695
- function instanceOfWebhookRegionsResponseData(value) {
16696
- return true;
16697
- }
16698
- function WebhookRegionsResponseDataFromJSON(json) {
16699
- return WebhookRegionsResponseDataFromJSONTyped(json, false);
16700
- }
16701
- function WebhookRegionsResponseDataFromJSONTyped(json, ignoreDiscriminator) {
16702
- if (json == null) {
16703
- return json;
16704
- }
16705
- return {
16706
- "regions": json["regions"] == null ? void 0 : json["regions"].map(WebhookRegionFromJSON),
16707
- "defaultRegion": json["default_region"] == null ? void 0 : json["default_region"]
16708
- };
16709
- }
16710
- function WebhookRegionsResponseDataToJSON(json) {
16711
- return WebhookRegionsResponseDataToJSONTyped(json, false);
16712
- }
16713
- function WebhookRegionsResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
16714
- if (value == null) {
16715
- return value;
16716
- }
16717
- return {
16718
- "regions": value["regions"] == null ? void 0 : value["regions"].map(WebhookRegionToJSON),
16719
- "default_region": value["defaultRegion"]
16720
- };
16721
- }
16722
-
16723
- // src/src/models/WebhookRegionsResponse.ts
16724
- function instanceOfWebhookRegionsResponse(value) {
16725
- return true;
16726
- }
16727
- function WebhookRegionsResponseFromJSON(json) {
16728
- return WebhookRegionsResponseFromJSONTyped(json, false);
16729
- }
16730
- function WebhookRegionsResponseFromJSONTyped(json, ignoreDiscriminator) {
16731
- if (json == null) {
16732
- return json;
16733
- }
16734
- return {
16735
- "data": json["data"] == null ? void 0 : WebhookRegionsResponseDataFromJSON(json["data"]),
16736
- "meta": json["meta"] == null ? void 0 : RequestMetaFromJSON(json["meta"])
16737
- };
16738
- }
16739
- function WebhookRegionsResponseToJSON(json) {
16740
- return WebhookRegionsResponseToJSONTyped(json, false);
16741
- }
16742
- function WebhookRegionsResponseToJSONTyped(value, ignoreDiscriminator = false) {
16743
- if (value == null) {
16744
- return value;
16745
- }
16746
- return {
16747
- "data": WebhookRegionsResponseDataToJSON(value["data"]),
16748
- "meta": RequestMetaToJSON(value["meta"])
16749
- };
16750
- }
16751
-
16752
16659
  // src/src/models/WebhookReplayResponse.ts
16753
16660
  function instanceOfWebhookReplayResponse(value) {
16754
16661
  return true;
@@ -17113,6 +17020,40 @@ function WithdrawSubscriberConsentRequestToJSONTyped(value, ignoreDiscriminator
17113
17020
 
17114
17021
  // src/src/apis/AuthApplicationApi.ts
17115
17022
  var AuthApplicationApi = class extends BaseAPI {
17023
+ /**
17024
+ * 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.
17025
+ * Export all data held about an end user
17026
+ */
17027
+ async exportEndUserDataRaw(requestParameters, initOverrides) {
17028
+ if (requestParameters["id"] == null) {
17029
+ throw new RequiredError(
17030
+ "id",
17031
+ 'Required parameter "id" was null or undefined when calling exportEndUserData().'
17032
+ );
17033
+ }
17034
+ if (requestParameters["userId"] == null) {
17035
+ throw new RequiredError(
17036
+ "userId",
17037
+ 'Required parameter "userId" was null or undefined when calling exportEndUserData().'
17038
+ );
17039
+ }
17040
+ const queryParameters = {};
17041
+ const headerParameters = {};
17042
+ const response = await this.request({
17043
+ path: `/v1/applications/{id}/users/{userId}/export`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"]))).replace(`{${"userId"}}`, encodeURIComponent(String(requestParameters["userId"]))),
17044
+ method: "GET",
17045
+ headers: headerParameters,
17046
+ query: queryParameters
17047
+ }, initOverrides);
17048
+ return new VoidApiResponse(response);
17049
+ }
17050
+ /**
17051
+ * 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.
17052
+ * Export all data held about an end user
17053
+ */
17054
+ async exportEndUserData(id, userId, initOverrides) {
17055
+ await this.exportEndUserDataRaw({ id, userId }, initOverrides);
17056
+ }
17116
17057
  /**
17117
17058
  * 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.
17118
17059
  * Get the authenticating application
@@ -21082,7 +21023,7 @@ var EmailsApi = class extends BaseAPI {
21082
21023
  return await response.value();
21083
21024
  }
21084
21025
  /**
21085
- * 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`.
21026
+ * 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).
21086
21027
  * Send an email
21087
21028
  */
21088
21029
  async sendEmailRaw(requestParameters, initOverrides) {
@@ -21108,7 +21049,7 @@ var EmailsApi = class extends BaseAPI {
21108
21049
  return new JSONApiResponse(response, (jsonValue) => SendEmailResponseFromJSON(jsonValue));
21109
21050
  }
21110
21051
  /**
21111
- * 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`.
21052
+ * 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).
21112
21053
  * Send an email
21113
21054
  */
21114
21055
  async sendEmail(sendEmailRequest, initOverrides) {
@@ -22493,6 +22434,31 @@ var SMSApi = class extends BaseAPI {
22493
22434
  const response = await this.getSmsConfigRaw(initOverrides);
22494
22435
  return await response.value();
22495
22436
  }
22437
+ /**
22438
+ * 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).
22439
+ * Get the inbound SMS webhook URL
22440
+ */
22441
+ async getSmsInboundWebhookRaw(initOverrides) {
22442
+ const queryParameters = {};
22443
+ const headerParameters = {};
22444
+ if (this.configuration && this.configuration.apiKey) {
22445
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
22446
+ }
22447
+ const response = await this.request({
22448
+ path: `/sms/inbound-webhook`,
22449
+ method: "GET",
22450
+ headers: headerParameters,
22451
+ query: queryParameters
22452
+ }, initOverrides);
22453
+ return new VoidApiResponse(response);
22454
+ }
22455
+ /**
22456
+ * 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).
22457
+ * Get the inbound SMS webhook URL
22458
+ */
22459
+ async getSmsInboundWebhook(initOverrides) {
22460
+ await this.getSmsInboundWebhookRaw(initOverrides);
22461
+ }
22496
22462
  /**
22497
22463
  * List SMS messages for the account with optional filtering and pagination.
22498
22464
  * List SMS messages
@@ -22566,7 +22532,7 @@ var SMSApi = class extends BaseAPI {
22566
22532
  return await response.value();
22567
22533
  }
22568
22534
  /**
22569
- * Send a single SMS text message. Supports subscriber preference checks and scheduling.
22535
+ * 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.
22570
22536
  * Send an SMS message
22571
22537
  */
22572
22538
  async sendSmsRaw(requestParameters, initOverrides) {
@@ -22592,7 +22558,7 @@ var SMSApi = class extends BaseAPI {
22592
22558
  return new JSONApiResponse(response, (jsonValue) => SendSmsResponseFromJSON(jsonValue));
22593
22559
  }
22594
22560
  /**
22595
- * Send a single SMS text message. Supports subscriber preference checks and scheduling.
22561
+ * 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.
22596
22562
  * Send an SMS message
22597
22563
  */
22598
22564
  async sendSms(sendSmsRequest, initOverrides) {
@@ -25616,32 +25582,6 @@ var WebhooksApi = class extends BaseAPI {
25616
25582
  const response = await this.getWebhookMetricsRaw({ id }, initOverrides);
25617
25583
  return await response.value();
25618
25584
  }
25619
- /**
25620
- * Get available webhook delivery regions. Requires multi_region plan feature (Enterprise only).
25621
- * Get available webhook regions
25622
- */
25623
- async getWebhookRegionsRaw(initOverrides) {
25624
- const queryParameters = {};
25625
- const headerParameters = {};
25626
- if (this.configuration && this.configuration.apiKey) {
25627
- headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
25628
- }
25629
- const response = await this.request({
25630
- path: `/v1/webhooks/regions`,
25631
- method: "GET",
25632
- headers: headerParameters,
25633
- query: queryParameters
25634
- }, initOverrides);
25635
- return new JSONApiResponse(response, (jsonValue) => WebhookRegionsResponseFromJSON(jsonValue));
25636
- }
25637
- /**
25638
- * Get available webhook delivery regions. Requires multi_region plan feature (Enterprise only).
25639
- * Get available webhook regions
25640
- */
25641
- async getWebhookRegions(initOverrides) {
25642
- const response = await this.getWebhookRegionsRaw(initOverrides);
25643
- return await response.value();
25644
- }
25645
25585
  /**
25646
25586
  * Get webhook delivery usage statistics for the current billing period.
25647
25587
  * Get webhook usage metrics
@@ -26624,6 +26564,15 @@ var Zyphr = class {
26624
26564
  /** Publishable-key-safe utilities: password policy + pre-submit strength check. */
26625
26565
  utility;
26626
26566
  domains;
26567
+ /**
26568
+ * Multi-step workflow definitions and triggering (sc-7926).
26569
+ *
26570
+ * All 12 operations are API-key authenticated with dedicated
26571
+ * `workflows:read` / `workflows:write` / `workflows:execute` scopes, so this
26572
+ * is deliberate public surface. It was generated but never wired onto the
26573
+ * facade, which made the documented `zyphr.workflows.*` calls throw.
26574
+ */
26575
+ workflows;
26627
26576
  /** Inbound (received) email — read access. Requires the `email:read` scope. */
26628
26577
  inbound;
26629
26578
  waas;
@@ -26652,6 +26601,7 @@ var Zyphr = class {
26652
26601
  this.devices = new DevicesApi(config);
26653
26602
  this.utility = new UtilityApi(config);
26654
26603
  this.domains = new DomainsApi(config);
26604
+ this.workflows = new WorkflowsApi(config);
26655
26605
  this.inbound = new InboundEmailApi(config);
26656
26606
  this.waas = {
26657
26607
  applications: new WaaSApplicationsApi(config),
@@ -28895,18 +28845,6 @@ export {
28895
28845
  WebhookMetricsResponseFromJSONTyped,
28896
28846
  WebhookMetricsResponseToJSON,
28897
28847
  WebhookMetricsResponseToJSONTyped,
28898
- WebhookRegionFromJSON,
28899
- WebhookRegionFromJSONTyped,
28900
- WebhookRegionToJSON,
28901
- WebhookRegionToJSONTyped,
28902
- WebhookRegionsResponseDataFromJSON,
28903
- WebhookRegionsResponseDataFromJSONTyped,
28904
- WebhookRegionsResponseDataToJSON,
28905
- WebhookRegionsResponseDataToJSONTyped,
28906
- WebhookRegionsResponseFromJSON,
28907
- WebhookRegionsResponseFromJSONTyped,
28908
- WebhookRegionsResponseToJSON,
28909
- WebhookRegionsResponseToJSONTyped,
28910
28848
  WebhookReplayResponseFromJSON,
28911
28849
  WebhookReplayResponseFromJSONTyped,
28912
28850
  WebhookReplayResponseToJSON,
@@ -29492,9 +29430,6 @@ export {
29492
29430
  instanceOfWebhookJobResponse,
29493
29431
  instanceOfWebhookListResponse,
29494
29432
  instanceOfWebhookMetricsResponse,
29495
- instanceOfWebhookRegion,
29496
- instanceOfWebhookRegionsResponse,
29497
- instanceOfWebhookRegionsResponseData,
29498
29433
  instanceOfWebhookReplayResponse,
29499
29434
  instanceOfWebhookResponse,
29500
29435
  instanceOfWebhookSecretRotateResponse,