@zyphr-dev/node-sdk 0.1.14 → 0.1.17

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
@@ -352,6 +352,7 @@ __export(index_exports, {
352
352
  InboxNotificationResponseToJSON: () => InboxNotificationResponseToJSON,
353
353
  InboxNotificationResponseToJSONTyped: () => InboxNotificationResponseToJSONTyped,
354
354
  JSONApiResponse: () => JSONApiResponse,
355
+ ListAllInboxStatusEnum: () => ListAllInboxStatusEnum,
355
356
  ListDevicesPlatformEnum: () => ListDevicesPlatformEnum,
356
357
  ListEmailsStatusEnum: () => ListEmailsStatusEnum,
357
358
  ListPushStatusEnum: () => ListPushStatusEnum,
@@ -15487,6 +15488,49 @@ var InboxApi = class extends BaseAPI {
15487
15488
  const response = await this.getUnreadCountRaw({ subscriberId, externalId }, initOverrides);
15488
15489
  return await response.value();
15489
15490
  }
15491
+ /**
15492
+ * List all in-app notifications for the current project. Used by the dashboard to display all notifications without requiring a subscriber selection.
15493
+ * List all project notifications
15494
+ */
15495
+ async listAllInboxRaw(requestParameters, initOverrides) {
15496
+ const queryParameters = {};
15497
+ if (requestParameters["subscriberId"] != null) {
15498
+ queryParameters["subscriber_id"] = requestParameters["subscriberId"];
15499
+ }
15500
+ if (requestParameters["status"] != null) {
15501
+ queryParameters["status"] = requestParameters["status"];
15502
+ }
15503
+ if (requestParameters["category"] != null) {
15504
+ queryParameters["category"] = requestParameters["category"];
15505
+ }
15506
+ if (requestParameters["search"] != null) {
15507
+ queryParameters["search"] = requestParameters["search"];
15508
+ }
15509
+ if (requestParameters["limit"] != null) {
15510
+ queryParameters["limit"] = requestParameters["limit"];
15511
+ }
15512
+ if (requestParameters["offset"] != null) {
15513
+ queryParameters["offset"] = requestParameters["offset"];
15514
+ }
15515
+ const headerParameters = {};
15516
+ if (this.configuration && this.configuration.apiKey) {
15517
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
15518
+ }
15519
+ const response = await this.request({
15520
+ path: `/inbox/all`,
15521
+ method: "GET",
15522
+ headers: headerParameters,
15523
+ query: queryParameters
15524
+ }, initOverrides);
15525
+ return new VoidApiResponse(response);
15526
+ }
15527
+ /**
15528
+ * List all in-app notifications for the current project. Used by the dashboard to display all notifications without requiring a subscriber selection.
15529
+ * List all project notifications
15530
+ */
15531
+ async listAllInbox(subscriberId, status, category, search, limit, offset, initOverrides) {
15532
+ await this.listAllInboxRaw({ subscriberId, status, category, search, limit, offset }, initOverrides);
15533
+ }
15490
15534
  /**
15491
15535
  * Retrieve in-app notifications for a subscriber. Requires subscriber_id or external_id.
15492
15536
  * List inbox notifications
@@ -15817,6 +15861,11 @@ var InboxApi = class extends BaseAPI {
15817
15861
  await this.updateSubscriberPreferencesRaw({ updateSubscriberPreferencesRequest }, initOverrides);
15818
15862
  }
15819
15863
  };
15864
+ var ListAllInboxStatusEnum = {
15865
+ UNREAD: "unread",
15866
+ READ: "read",
15867
+ ARCHIVED: "archived"
15868
+ };
15820
15869
 
15821
15870
  // src/src/apis/PushApi.ts
15822
15871
  var PushApi = class extends BaseAPI {
@@ -19675,7 +19724,9 @@ var Zyphr = class {
19675
19724
  devices;
19676
19725
  waas;
19677
19726
  auth;
19727
+ options;
19678
19728
  constructor(options) {
19729
+ this.options = options;
19679
19730
  const config = new Configuration({
19680
19731
  basePath: options.baseUrl,
19681
19732
  apiKey: (name) => {
@@ -19721,6 +19772,9 @@ var Zyphr = class {
19721
19772
  * Use this when calling profile, session, or MFA endpoints that
19722
19773
  * require the end user's access token instead of the API key.
19723
19774
  *
19775
+ * Includes both the end-user Bearer token and the application
19776
+ * public key (X-Application-Key) required by user-scoped endpoints.
19777
+ *
19724
19778
  * @example
19725
19779
  * ```ts
19726
19780
  * const login = await zyphr.auth.login.loginEndUser({ ... });
@@ -19732,9 +19786,13 @@ var Zyphr = class {
19732
19786
  * ```
19733
19787
  */
19734
19788
  asEndUser(accessToken) {
19735
- return {
19736
- headers: { Authorization: `Bearer ${accessToken}` }
19789
+ const headers = {
19790
+ Authorization: `Bearer ${accessToken}`
19737
19791
  };
19792
+ if (this.options.applicationKey) {
19793
+ headers["X-Application-Key"] = this.options.applicationKey;
19794
+ }
19795
+ return { headers };
19738
19796
  }
19739
19797
  };
19740
19798
 
@@ -20074,6 +20132,7 @@ var SDK_VERSION = "0.1.0";
20074
20132
  InboxNotificationResponseToJSON,
20075
20133
  InboxNotificationResponseToJSONTyped,
20076
20134
  JSONApiResponse,
20135
+ ListAllInboxStatusEnum,
20077
20136
  ListDevicesPlatformEnum,
20078
20137
  ListEmailsStatusEnum,
20079
20138
  ListPushStatusEnum,