@zyphr-dev/node-sdk 0.1.57 → 0.1.59

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 CHANGED
@@ -20535,7 +20535,7 @@ var AuthEmailTemplatesApi = class extends BaseAPI {
20535
20535
  // src/src/apis/AuthEmailVerificationApi.ts
20536
20536
  var AuthEmailVerificationApi = class extends BaseAPI {
20537
20537
  /**
20538
- * Verify the user\'s email using a token you collected yourself. IMPORTANT: the emailed verification LINK verifies the address server-side **on click** and then redirects to `redirect_url`. So if you take the token off that redirect and post it here, it is already redeemed — and this endpoint treats that as an idempotent **success** (`200` with `already_verified: true`), not an error. Only a genuinely invalid / expired / unknown token returns `400`. `send` / `confirm` / `resend` are NOT a mandatory matched set — `confirm` is for flows where you collect the token directly rather than landing the hosted redirect. Recommended pattern for the redirect landing: call `confirm`, ignore its result, then read the user\'s verified state back and report that — correct whether or not the link already consumed the token.
20538
+ * Verify the user\'s email using the token from the emailed link. Zyphr does NOT host auth pages and never redeems the token itself. The emailed link points at YOUR `redirect_url` with `?token=<raw>`; your app reads that token and posts it here. Nothing is verified until this call. This endpoint is idempotent: re-posting an already-redeemed token returns `200` with `already_verified: true` rather than an error, so a double submit or a link opened twice is safe. Only a genuinely invalid / expired / unknown token returns `400`. Note `redirect_url` is REQUIRED (snake_case) when sending the verification email — there is no hosted fallback page.
20539
20539
  * Confirm email verification
20540
20540
  */
20541
20541
  async confirmEmailVerificationRaw(requestParameters, initOverrides) {
@@ -20574,7 +20574,7 @@ var AuthEmailVerificationApi = class extends BaseAPI {
20574
20574
  return new JSONApiResponse(response, (jsonValue) => ConfirmEmailVerificationResponseFromJSON(jsonValue));
20575
20575
  }
20576
20576
  /**
20577
- * Verify the user\'s email using a token you collected yourself. IMPORTANT: the emailed verification LINK verifies the address server-side **on click** and then redirects to `redirect_url`. So if you take the token off that redirect and post it here, it is already redeemed — and this endpoint treats that as an idempotent **success** (`200` with `already_verified: true`), not an error. Only a genuinely invalid / expired / unknown token returns `400`. `send` / `confirm` / `resend` are NOT a mandatory matched set — `confirm` is for flows where you collect the token directly rather than landing the hosted redirect. Recommended pattern for the redirect landing: call `confirm`, ignore its result, then read the user\'s verified state back and report that — correct whether or not the link already consumed the token.
20577
+ * Verify the user\'s email using the token from the emailed link. Zyphr does NOT host auth pages and never redeems the token itself. The emailed link points at YOUR `redirect_url` with `?token=<raw>`; your app reads that token and posts it here. Nothing is verified until this call. This endpoint is idempotent: re-posting an already-redeemed token returns `200` with `already_verified: true` rather than an error, so a double submit or a link opened twice is safe. Only a genuinely invalid / expired / unknown token returns `400`. Note `redirect_url` is REQUIRED (snake_case) when sending the verification email — there is no hosted fallback page.
20578
20578
  * Confirm email verification
20579
20579
  */
20580
20580
  async confirmEmailVerification(confirmEmailVerificationRequest, initOverrides) {
@@ -24065,7 +24065,7 @@ var DevicesApi = class extends BaseAPI {
24065
24065
  return await response.value();
24066
24066
  }
24067
24067
  /**
24068
- * Register a device for push notifications. Registration is an upsert keyed on (project, token), so calling it on every app launch is safe and idempotent. Re-registering an existing token under a different `user_id` **reassigns** the device to that user — the previous association does not persist, so a push addressed to the old user will not reach this device. `user_id` is an opaque string you choose. It is stored verbatim with no foreign key, and `POST /v1/push` matches on exactly that value. No Subscriber record is created for you. Requires a secret API key, so call it from your backend and derive `user_id` from the authenticated session rather than the request body.
24068
+ * Register a device for push notifications. Registration is an upsert keyed on (project, token), so calling it on every app launch is safe and idempotent. Re-registering an existing token under a different `user_id` **reassigns** the device to that user — the previous association does not persist, so a push addressed to the old user will not reach this device. `user_id` is an opaque string you choose. It is stored verbatim with no foreign key, and `POST /v1/push` matches on exactly that value. No Subscriber record is created for you. Call this from your backend and derive `user_id` from the authenticated session rather than the request body. **Two credentials are accepted, and the choice matters for push routing:** - **Application credentials** — `X-Application-Key` + `X-Application-Secret` (`za_*`). The device is bound to that application, and pushes to it resolve *that application\'s* push provider credentials. Use this when a single project contains more than one app: APNs credentials are bound to a bundle id, so a device registered under the wrong application has its pushes rejected by Apple. The application is taken from the credential and can never be set from the request body. Using an **environment-scoped** key (`za_test_pub_*` / `za_live_pub_*`) also binds the device to that environment, which is what lets APNs sandbox and production credentials be configured separately. A legacy application-level key (`za_pub_*`) binds the application only, and such devices will not match an environment-scoped push config. - **Project secret API key** (`zy_*`) — the device is not bound to any application and resolves the project-level push provider config. This is the historical behaviour and remains supported.
24069
24069
  * Register a device
24070
24070
  */
24071
24071
  async registerDeviceRaw(requestParameters, initOverrides) {
@@ -24078,6 +24078,14 @@ var DevicesApi = class extends BaseAPI {
24078
24078
  const queryParameters = {};
24079
24079
  const headerParameters = {};
24080
24080
  headerParameters["Content-Type"] = "application/json";
24081
+ if (this.configuration && this.configuration.apiKey) {
24082
+ {
24083
+ const apiKeyValue = await this.configuration.apiKey("X-Application-Secret");
24084
+ if (apiKeyValue) {
24085
+ headerParameters["X-Application-Secret"] = apiKeyValue;
24086
+ }
24087
+ }
24088
+ }
24081
24089
  if (this.configuration && this.configuration.apiKey) {
24082
24090
  {
24083
24091
  const apiKeyValue = await this.configuration.apiKey("X-API-Key");
@@ -24086,6 +24094,14 @@ var DevicesApi = class extends BaseAPI {
24086
24094
  }
24087
24095
  }
24088
24096
  }
24097
+ if (this.configuration && this.configuration.apiKey) {
24098
+ {
24099
+ const apiKeyValue = await this.configuration.apiKey("X-Application-Key");
24100
+ if (apiKeyValue) {
24101
+ headerParameters["X-Application-Key"] = apiKeyValue;
24102
+ }
24103
+ }
24104
+ }
24089
24105
  const response = await this.request({
24090
24106
  path: `/devices`,
24091
24107
  method: "POST",
@@ -24096,7 +24112,7 @@ var DevicesApi = class extends BaseAPI {
24096
24112
  return new JSONApiResponse(response, (jsonValue) => DeviceResponseFromJSON(jsonValue));
24097
24113
  }
24098
24114
  /**
24099
- * Register a device for push notifications. Registration is an upsert keyed on (project, token), so calling it on every app launch is safe and idempotent. Re-registering an existing token under a different `user_id` **reassigns** the device to that user — the previous association does not persist, so a push addressed to the old user will not reach this device. `user_id` is an opaque string you choose. It is stored verbatim with no foreign key, and `POST /v1/push` matches on exactly that value. No Subscriber record is created for you. Requires a secret API key, so call it from your backend and derive `user_id` from the authenticated session rather than the request body.
24115
+ * Register a device for push notifications. Registration is an upsert keyed on (project, token), so calling it on every app launch is safe and idempotent. Re-registering an existing token under a different `user_id` **reassigns** the device to that user — the previous association does not persist, so a push addressed to the old user will not reach this device. `user_id` is an opaque string you choose. It is stored verbatim with no foreign key, and `POST /v1/push` matches on exactly that value. No Subscriber record is created for you. Call this from your backend and derive `user_id` from the authenticated session rather than the request body. **Two credentials are accepted, and the choice matters for push routing:** - **Application credentials** — `X-Application-Key` + `X-Application-Secret` (`za_*`). The device is bound to that application, and pushes to it resolve *that application\'s* push provider credentials. Use this when a single project contains more than one app: APNs credentials are bound to a bundle id, so a device registered under the wrong application has its pushes rejected by Apple. The application is taken from the credential and can never be set from the request body. Using an **environment-scoped** key (`za_test_pub_*` / `za_live_pub_*`) also binds the device to that environment, which is what lets APNs sandbox and production credentials be configured separately. A legacy application-level key (`za_pub_*`) binds the application only, and such devices will not match an environment-scoped push config. - **Project secret API key** (`zy_*`) — the device is not bound to any application and resolves the project-level push provider config. This is the historical behaviour and remains supported.
24100
24116
  * Register a device
24101
24117
  */
24102
24118
  async registerDevice(registerDeviceRequest, initOverrides) {