@usehercules/sdk 1.5.0 → 1.6.0

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.
Files changed (105) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +11 -3
  3. package/client.d.mts +3 -0
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +3 -0
  6. package/client.d.ts.map +1 -1
  7. package/client.js +3 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +3 -0
  10. package/client.mjs.map +1 -1
  11. package/package.json +1 -1
  12. package/resources/beta/beta.d.mts +0 -4
  13. package/resources/beta/beta.d.mts.map +1 -1
  14. package/resources/beta/beta.d.ts +0 -4
  15. package/resources/beta/beta.d.ts.map +1 -1
  16. package/resources/beta/beta.js +0 -4
  17. package/resources/beta/beta.js.map +1 -1
  18. package/resources/beta/beta.mjs +0 -4
  19. package/resources/beta/beta.mjs.map +1 -1
  20. package/resources/beta/index.d.mts +0 -1
  21. package/resources/beta/index.d.mts.map +1 -1
  22. package/resources/beta/index.d.ts +0 -1
  23. package/resources/beta/index.d.ts.map +1 -1
  24. package/resources/beta/index.js +1 -3
  25. package/resources/beta/index.js.map +1 -1
  26. package/resources/beta/index.mjs +0 -1
  27. package/resources/beta/index.mjs.map +1 -1
  28. package/resources/index.d.mts +1 -0
  29. package/resources/index.d.mts.map +1 -1
  30. package/resources/index.d.ts +1 -0
  31. package/resources/index.d.ts.map +1 -1
  32. package/resources/index.js +3 -1
  33. package/resources/index.js.map +1 -1
  34. package/resources/index.mjs +1 -0
  35. package/resources/index.mjs.map +1 -1
  36. package/resources/{beta/push-notifications → push-notifications}/index.d.mts +1 -0
  37. package/resources/push-notifications/index.d.mts.map +1 -0
  38. package/resources/{beta/push-notifications → push-notifications}/index.d.ts +1 -0
  39. package/resources/push-notifications/index.d.ts.map +1 -0
  40. package/resources/{beta/push-notifications → push-notifications}/index.js +3 -1
  41. package/resources/push-notifications/index.js.map +1 -0
  42. package/resources/{beta/push-notifications → push-notifications}/index.mjs +1 -0
  43. package/resources/push-notifications/index.mjs.map +1 -0
  44. package/resources/{beta/push-notifications → push-notifications}/push-notifications.d.mts +19 -9
  45. package/resources/push-notifications/push-notifications.d.mts.map +1 -0
  46. package/resources/{beta/push-notifications → push-notifications}/push-notifications.d.ts +19 -9
  47. package/resources/push-notifications/push-notifications.d.ts.map +1 -0
  48. package/resources/{beta/push-notifications → push-notifications}/push-notifications.js +9 -4
  49. package/resources/push-notifications/push-notifications.js.map +1 -0
  50. package/resources/{beta/push-notifications → push-notifications}/push-notifications.mjs +8 -3
  51. package/resources/push-notifications/push-notifications.mjs.map +1 -0
  52. package/resources/{beta/push-notifications → push-notifications}/subscriptions.d.mts +3 -3
  53. package/resources/push-notifications/subscriptions.d.mts.map +1 -0
  54. package/resources/{beta/push-notifications → push-notifications}/subscriptions.d.ts +3 -3
  55. package/resources/push-notifications/subscriptions.d.ts.map +1 -0
  56. package/resources/{beta/push-notifications → push-notifications}/subscriptions.js +2 -2
  57. package/resources/push-notifications/subscriptions.js.map +1 -0
  58. package/resources/{beta/push-notifications → push-notifications}/subscriptions.mjs +2 -2
  59. package/resources/push-notifications/subscriptions.mjs.map +1 -0
  60. package/resources/push-notifications/topics.d.mts +75 -0
  61. package/resources/push-notifications/topics.d.mts.map +1 -0
  62. package/resources/push-notifications/topics.d.ts +75 -0
  63. package/resources/push-notifications/topics.d.ts.map +1 -0
  64. package/resources/push-notifications/topics.js +28 -0
  65. package/resources/push-notifications/topics.js.map +1 -0
  66. package/resources/push-notifications/topics.mjs +24 -0
  67. package/resources/push-notifications/topics.mjs.map +1 -0
  68. package/resources/push-notifications.d.mts.map +1 -0
  69. package/resources/push-notifications.d.ts.map +1 -0
  70. package/resources/{beta/push-notifications.js → push-notifications.js} +1 -1
  71. package/resources/push-notifications.js.map +1 -0
  72. package/resources/push-notifications.mjs.map +1 -0
  73. package/src/client.ts +15 -0
  74. package/src/resources/beta/beta.ts +0 -18
  75. package/src/resources/beta/index.ts +0 -6
  76. package/src/resources/index.ts +6 -0
  77. package/src/resources/{beta/push-notifications → push-notifications}/index.ts +9 -0
  78. package/src/resources/{beta/push-notifications → push-notifications}/push-notifications.ts +38 -9
  79. package/src/resources/{beta/push-notifications → push-notifications}/subscriptions.ts +4 -4
  80. package/src/resources/push-notifications/topics.ts +101 -0
  81. package/src/version.ts +1 -1
  82. package/version.d.mts +1 -1
  83. package/version.d.ts +1 -1
  84. package/version.js +1 -1
  85. package/version.mjs +1 -1
  86. package/resources/beta/push-notifications/index.d.mts.map +0 -1
  87. package/resources/beta/push-notifications/index.d.ts.map +0 -1
  88. package/resources/beta/push-notifications/index.js.map +0 -1
  89. package/resources/beta/push-notifications/index.mjs.map +0 -1
  90. package/resources/beta/push-notifications/push-notifications.d.mts.map +0 -1
  91. package/resources/beta/push-notifications/push-notifications.d.ts.map +0 -1
  92. package/resources/beta/push-notifications/push-notifications.js.map +0 -1
  93. package/resources/beta/push-notifications/push-notifications.mjs.map +0 -1
  94. package/resources/beta/push-notifications/subscriptions.d.mts.map +0 -1
  95. package/resources/beta/push-notifications/subscriptions.d.ts.map +0 -1
  96. package/resources/beta/push-notifications/subscriptions.js.map +0 -1
  97. package/resources/beta/push-notifications/subscriptions.mjs.map +0 -1
  98. package/resources/beta/push-notifications.d.mts.map +0 -1
  99. package/resources/beta/push-notifications.d.ts.map +0 -1
  100. package/resources/beta/push-notifications.js.map +0 -1
  101. package/resources/beta/push-notifications.mjs.map +0 -1
  102. /package/resources/{beta/push-notifications.d.mts → push-notifications.d.mts} +0 -0
  103. /package/resources/{beta/push-notifications.d.ts → push-notifications.d.ts} +0 -0
  104. /package/resources/{beta/push-notifications.mjs → push-notifications.mjs} +0 -0
  105. /package/src/resources/{beta/push-notifications.ts → push-notifications.ts} +0 -0
@@ -1,3 +1,4 @@
1
1
  export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationSendResponse, type PushNotificationSendParams, } from "./push-notifications.mjs";
2
2
  export { Subscriptions, type SubscriptionCreateResponse, type SubscriptionDeleteResponse, type SubscriptionCreateParams, } from "./subscriptions.mjs";
3
+ export { Topics, type TopicListResponse, type TopicSubscribeResponse, type TopicUnsubscribeResponse, type TopicListParams, type TopicSubscribeParams, type TopicUnsubscribeParams, } from "./topics.mjs";
3
4
  //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/push-notifications/index.ts"],"names":[],"mappings":"OAEO,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,GAChC;OACM,EACL,aAAa,EACb,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B;OACM,EACL,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B"}
@@ -1,3 +1,4 @@
1
1
  export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationSendResponse, type PushNotificationSendParams, } from "./push-notifications.js";
2
2
  export { Subscriptions, type SubscriptionCreateResponse, type SubscriptionDeleteResponse, type SubscriptionCreateParams, } from "./subscriptions.js";
3
+ export { Topics, type TopicListResponse, type TopicSubscribeResponse, type TopicUnsubscribeResponse, type TopicListParams, type TopicSubscribeParams, type TopicUnsubscribeParams, } from "./topics.js";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/push-notifications/index.ts"],"names":[],"mappings":"OAEO,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,GAChC;OACM,EACL,aAAa,EACb,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,GAC9B;OACM,EACL,MAAM,EACN,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,GAC5B"}
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Subscriptions = exports.PushNotifications = void 0;
4
+ exports.Topics = exports.Subscriptions = exports.PushNotifications = void 0;
5
5
  var push_notifications_1 = require("./push-notifications.js");
6
6
  Object.defineProperty(exports, "PushNotifications", { enumerable: true, get: function () { return push_notifications_1.PushNotifications; } });
7
7
  var subscriptions_1 = require("./subscriptions.js");
8
8
  Object.defineProperty(exports, "Subscriptions", { enumerable: true, get: function () { return subscriptions_1.Subscriptions; } });
9
+ var topics_1 = require("./topics.js");
10
+ Object.defineProperty(exports, "Topics", { enumerable: true, get: function () { return topics_1.Topics; } });
9
11
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/push-notifications/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAK8B;AAJ5B,uHAAA,iBAAiB,OAAA;AAKnB,oDAKyB;AAJvB,8GAAA,aAAa,OAAA;AAKf,sCAQkB;AAPhB,gGAAA,MAAM,OAAA"}
@@ -1,4 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
  export { PushNotifications, } from "./push-notifications.mjs";
3
3
  export { Subscriptions, } from "./subscriptions.mjs";
4
+ export { Topics, } from "./topics.mjs";
4
5
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/push-notifications/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,iBAAiB,GAIlB;OACM,EACL,aAAa,GAId;OACM,EACL,MAAM,GAOP"}
@@ -1,10 +1,13 @@
1
- import { APIResource } from "../../../core/resource.mjs";
1
+ import { APIResource } from "../../core/resource.mjs";
2
2
  import * as SubscriptionsAPI from "./subscriptions.mjs";
3
3
  import { SubscriptionCreateParams, SubscriptionCreateResponse, SubscriptionDeleteResponse, Subscriptions } from "./subscriptions.mjs";
4
- import { APIPromise } from "../../../core/api-promise.mjs";
5
- import { RequestOptions } from "../../../internal/request-options.mjs";
4
+ import * as TopicsAPI from "./topics.mjs";
5
+ import { TopicListParams, TopicListResponse, TopicSubscribeParams, TopicSubscribeResponse, TopicUnsubscribeParams, TopicUnsubscribeResponse, Topics } from "./topics.mjs";
6
+ import { APIPromise } from "../../core/api-promise.mjs";
7
+ import { RequestOptions } from "../../internal/request-options.mjs";
6
8
  export declare class PushNotifications extends APIResource {
7
9
  subscriptions: SubscriptionsAPI.Subscriptions;
10
+ topics: TopicsAPI.Topics;
8
11
  /**
9
12
  * Enables push notifications for the app by generating VAPID keys. Idempotent -
10
13
  * returns existing keys if already enabled. Hercules recommends calling this
@@ -12,8 +15,9 @@ export declare class PushNotifications extends APIResource {
12
15
  */
13
16
  enable(options?: RequestOptions): APIPromise<PushNotificationEnableResponse>;
14
17
  /**
15
- * Sends push notifications to specified visitors. Omit visitorIds to broadcast to
16
- * all subscribers. Returns the count of successful and failed deliveries.
18
+ * Sends push notifications to specified visitors and/or topics. Specify
19
+ * visitorIds, topics, or both (combined as union). Omit both to broadcast to all
20
+ * subscribers.
17
21
  */
18
22
  send(body: PushNotificationSendParams, options?: RequestOptions): APIPromise<PushNotificationSendResponse>;
19
23
  }
@@ -59,20 +63,26 @@ export interface PushNotificationSendParams {
59
63
  [key: string]: unknown;
60
64
  };
61
65
  /**
62
- * Icon URL
66
+ * Icon URL (small icon displayed in the notification)
63
67
  */
64
68
  icon?: string;
65
69
  /**
66
- * URL to open when notification is clicked
70
+ * Image URL (larger image displayed in the notification body)
67
71
  */
68
- url?: string;
72
+ image?: string;
69
73
  /**
70
- * Visitor IDs to send to. Omit to broadcast to all subscribers.
74
+ * Topics to send to. All visitors subscribed to any of these topics will receive
75
+ * the notification. Combined with visitorIds as a union.
76
+ */
77
+ topics?: Array<string>;
78
+ /**
79
+ * Visitor IDs to send to. Combined with topics as a union.
71
80
  */
72
81
  visitorIds?: Array<string>;
73
82
  }
74
83
  export declare namespace PushNotifications {
75
84
  export { type PushNotificationEnableResponse as PushNotificationEnableResponse, type PushNotificationSendResponse as PushNotificationSendResponse, type PushNotificationSendParams as PushNotificationSendParams, };
76
85
  export { Subscriptions as Subscriptions, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, type SubscriptionCreateParams as SubscriptionCreateParams, };
86
+ export { Topics as Topics, type TopicListResponse as TopicListResponse, type TopicSubscribeResponse as TopicSubscribeResponse, type TopicUnsubscribeResponse as TopicUnsubscribeResponse, type TopicListParams as TopicListParams, type TopicSubscribeParams as TopicSubscribeParams, type TopicUnsubscribeParams as TopicUnsubscribeParams, };
77
87
  }
78
88
  //# sourceMappingURL=push-notifications.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.d.mts","sourceRoot":"","sources":["../../src/resources/push-notifications/push-notifications.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,aAAa,EACd;OACM,KAAK,SAAS;OACd,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,MAAM,EACP;OACM,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;IACjG,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc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M,EAChB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -1,10 +1,13 @@
1
- import { APIResource } from "../../../core/resource.js";
1
+ import { APIResource } from "../../core/resource.js";
2
2
  import * as SubscriptionsAPI from "./subscriptions.js";
3
3
  import { SubscriptionCreateParams, SubscriptionCreateResponse, SubscriptionDeleteResponse, Subscriptions } from "./subscriptions.js";
4
- import { APIPromise } from "../../../core/api-promise.js";
5
- import { RequestOptions } from "../../../internal/request-options.js";
4
+ import * as TopicsAPI from "./topics.js";
5
+ import { TopicListParams, TopicListResponse, TopicSubscribeParams, TopicSubscribeResponse, TopicUnsubscribeParams, TopicUnsubscribeResponse, Topics } from "./topics.js";
6
+ import { APIPromise } from "../../core/api-promise.js";
7
+ import { RequestOptions } from "../../internal/request-options.js";
6
8
  export declare class PushNotifications extends APIResource {
7
9
  subscriptions: SubscriptionsAPI.Subscriptions;
10
+ topics: TopicsAPI.Topics;
8
11
  /**
9
12
  * Enables push notifications for the app by generating VAPID keys. Idempotent -
10
13
  * returns existing keys if already enabled. Hercules recommends calling this
@@ -12,8 +15,9 @@ export declare class PushNotifications extends APIResource {
12
15
  */
13
16
  enable(options?: RequestOptions): APIPromise<PushNotificationEnableResponse>;
14
17
  /**
15
- * Sends push notifications to specified visitors. Omit visitorIds to broadcast to
16
- * all subscribers. Returns the count of successful and failed deliveries.
18
+ * Sends push notifications to specified visitors and/or topics. Specify
19
+ * visitorIds, topics, or both (combined as union). Omit both to broadcast to all
20
+ * subscribers.
17
21
  */
18
22
  send(body: PushNotificationSendParams, options?: RequestOptions): APIPromise<PushNotificationSendResponse>;
19
23
  }
@@ -59,20 +63,26 @@ export interface PushNotificationSendParams {
59
63
  [key: string]: unknown;
60
64
  };
61
65
  /**
62
- * Icon URL
66
+ * Icon URL (small icon displayed in the notification)
63
67
  */
64
68
  icon?: string;
65
69
  /**
66
- * URL to open when notification is clicked
70
+ * Image URL (larger image displayed in the notification body)
67
71
  */
68
- url?: string;
72
+ image?: string;
69
73
  /**
70
- * Visitor IDs to send to. Omit to broadcast to all subscribers.
74
+ * Topics to send to. All visitors subscribed to any of these topics will receive
75
+ * the notification. Combined with visitorIds as a union.
76
+ */
77
+ topics?: Array<string>;
78
+ /**
79
+ * Visitor IDs to send to. Combined with topics as a union.
71
80
  */
72
81
  visitorIds?: Array<string>;
73
82
  }
74
83
  export declare namespace PushNotifications {
75
84
  export { type PushNotificationEnableResponse as PushNotificationEnableResponse, type PushNotificationSendResponse as PushNotificationSendResponse, type PushNotificationSendParams as PushNotificationSendParams, };
76
85
  export { Subscriptions as Subscriptions, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, type SubscriptionCreateParams as SubscriptionCreateParams, };
86
+ export { Topics as Topics, type TopicListResponse as TopicListResponse, type TopicSubscribeResponse as TopicSubscribeResponse, type TopicUnsubscribeResponse as TopicUnsubscribeResponse, type TopicListParams as TopicListParams, type TopicSubscribeParams as TopicSubscribeParams, type TopicUnsubscribeParams as TopicUnsubscribeParams, };
77
87
  }
78
88
  //# sourceMappingURL=push-notifications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.d.ts","sourceRoot":"","sources":["../../src/resources/push-notifications/push-notifications.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,aAAa,EACd;OACM,KAAK,SAAS;OACd,EACL,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EACtB,wBAAwB,EACxB,MAAM,EACP;OACM,EAAE,UAAU,EAAE;OAC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GAC9D,CAAC;IAEF,OAAO,EACL,aAAa,IAAI,aAAa,EAC9B,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -2,14 +2,17 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.PushNotifications = void 0;
5
- const tslib_1 = require("../../../internal/tslib.js");
6
- const resource_1 = require("../../../core/resource.js");
5
+ const tslib_1 = require("../../internal/tslib.js");
6
+ const resource_1 = require("../../core/resource.js");
7
7
  const SubscriptionsAPI = tslib_1.__importStar(require("./subscriptions.js"));
8
8
  const subscriptions_1 = require("./subscriptions.js");
9
+ const TopicsAPI = tslib_1.__importStar(require("./topics.js"));
10
+ const topics_1 = require("./topics.js");
9
11
  class PushNotifications extends resource_1.APIResource {
10
12
  constructor() {
11
13
  super(...arguments);
12
14
  this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
15
+ this.topics = new TopicsAPI.Topics(this._client);
13
16
  }
14
17
  /**
15
18
  * Enables push notifications for the app by generating VAPID keys. Idempotent -
@@ -20,8 +23,9 @@ class PushNotifications extends resource_1.APIResource {
20
23
  return this._client.post('/v1/push-notifications/enable', options);
21
24
  }
22
25
  /**
23
- * Sends push notifications to specified visitors. Omit visitorIds to broadcast to
24
- * all subscribers. Returns the count of successful and failed deliveries.
26
+ * Sends push notifications to specified visitors and/or topics. Specify
27
+ * visitorIds, topics, or both (combined as union). Omit both to broadcast to all
28
+ * subscribers.
25
29
  */
26
30
  send(body, options) {
27
31
  return this._client.post('/v1/push-notifications/send', { body, ...options });
@@ -29,4 +33,5 @@ class PushNotifications extends resource_1.APIResource {
29
33
  }
30
34
  exports.PushNotifications = PushNotifications;
31
35
  PushNotifications.Subscriptions = subscriptions_1.Subscriptions;
36
+ PushNotifications.Topics = topics_1.Topics;
32
37
  //# sourceMappingURL=push-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.js","sourceRoot":"","sources":["../../src/resources/push-notifications/push-notifications.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6EAAoD;AACpD,sDAKyB;AACzB,+DAAsC;AACtC,wCAQkB;AAIlB,MAAa,iBAAkB,SAAQ,sBAAW;IAAlD;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmBhE,CAAC;IAjBC;;;;OAIG;IACH,MAAM,CAAC,OAAwB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,IAAgC,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;CACF;AArBD,8CAqBC;AAsED,iBAAiB,CAAC,aAAa,GAAG,6BAAa,CAAC;AAChD,iBAAiB,CAAC,MAAM,GAAG,eAAM,CAAC"}
@@ -1,11 +1,14 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../../core/resource.mjs";
2
+ import { APIResource } from "../../core/resource.mjs";
3
3
  import * as SubscriptionsAPI from "./subscriptions.mjs";
4
4
  import { Subscriptions, } from "./subscriptions.mjs";
5
+ import * as TopicsAPI from "./topics.mjs";
6
+ import { Topics, } from "./topics.mjs";
5
7
  export class PushNotifications extends APIResource {
6
8
  constructor() {
7
9
  super(...arguments);
8
10
  this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
11
+ this.topics = new TopicsAPI.Topics(this._client);
9
12
  }
10
13
  /**
11
14
  * Enables push notifications for the app by generating VAPID keys. Idempotent -
@@ -16,12 +19,14 @@ export class PushNotifications extends APIResource {
16
19
  return this._client.post('/v1/push-notifications/enable', options);
17
20
  }
18
21
  /**
19
- * Sends push notifications to specified visitors. Omit visitorIds to broadcast to
20
- * all subscribers. Returns the count of successful and failed deliveries.
22
+ * Sends push notifications to specified visitors and/or topics. Specify
23
+ * visitorIds, topics, or both (combined as union). Omit both to broadcast to all
24
+ * subscribers.
21
25
  */
22
26
  send(body, options) {
23
27
  return this._client.post('/v1/push-notifications/send', { body, ...options });
24
28
  }
25
29
  }
26
30
  PushNotifications.Subscriptions = Subscriptions;
31
+ PushNotifications.Topics = Topics;
27
32
  //# sourceMappingURL=push-notifications.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.mjs","sourceRoot":"","sources":["../../src/resources/push-notifications/push-notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EAIL,aAAa,GACd;OACM,KAAK,SAAS;OACd,EAOL,MAAM,GACP;AAID,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAAlD;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjG,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAmBhE,CAAC;IAjBC;;;;OAIG;IACH,MAAM,CAAC,OAAwB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;OAIG;IACH,IAAI,CAAC,IAAgC,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;CACF;AAsED,iBAAiB,CAAC,aAAa,GAAG,aAAa,CAAC;AAChD,iBAAiB,CAAC,MAAM,GAAG,MAAM,CAAC"}
@@ -1,6 +1,6 @@
1
- import { APIResource } from "../../../core/resource.mjs";
2
- import { APIPromise } from "../../../core/api-promise.mjs";
3
- import { RequestOptions } from "../../../internal/request-options.mjs";
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
4
  export declare class Subscriptions extends APIResource {
5
5
  /**
6
6
  * Registers a push subscription for a visitor. Upserts by endpoint to handle
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../src/resources/push-notifications/subscriptions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAIxG;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGrF;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,YAAY,EAAE,wBAAwB,CAAC,YAAY,CAAC;IAEpD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yBAAiB,wBAAwB,CAAC;IACxC;;OAEG;IACH,UAAiB,YAAY;QAC3B;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;QAExB;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAChC;IAED,UAAiB,YAAY,CAAC;QAC5B,UAAiB,IAAI;YACnB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YAEb;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -1,6 +1,6 @@
1
- import { APIResource } from "../../../core/resource.js";
2
- import { APIPromise } from "../../../core/api-promise.js";
3
- import { RequestOptions } from "../../../internal/request-options.js";
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
4
  export declare class Subscriptions extends APIResource {
5
5
  /**
6
6
  * Registers a push subscription for a visitor. Upserts by endpoint to handle
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/resources/push-notifications/subscriptions.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,wBAAwB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;IAIxG;;OAEG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,0BAA0B,CAAC;CAGrF;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,YAAY,EAAE,wBAAwB,CAAC,YAAY,CAAC;IAEpD;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,yBAAiB,wBAAwB,CAAC;IACxC;;OAEG;IACH,UAAiB,YAAY;QAC3B;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB,IAAI,EAAE,YAAY,CAAC,IAAI,CAAC;QAExB;;WAEG;QACH,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KAChC;IAED,UAAiB,YAAY,CAAC;QAC5B,UAAiB,IAAI;YACnB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YAEb;;eAEG;YACH,MAAM,EAAE,MAAM,CAAC;SAChB;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,aAAa,CAAC;IACrC,OAAO,EACL,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,0BAA0B,IAAI,0BAA0B,EAC7D,KAAK,wBAAwB,IAAI,wBAAwB,GAC1D,CAAC;CACH"}
@@ -2,8 +2,8 @@
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.Subscriptions = void 0;
5
- const resource_1 = require("../../../core/resource.js");
6
- const path_1 = require("../../../internal/utils/path.js");
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
7
  class Subscriptions extends resource_1.APIResource {
8
8
  /**
9
9
  * Registers a push subscription for a visitor. Upserts by endpoint to handle
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../src/resources/push-notifications/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAGlD,uDAAiD;AAEjD,MAAa,aAAc,SAAQ,sBAAW;IAC5C;;;OAGG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,wCAAwC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;CACF;AAfD,sCAeC"}
@@ -1,6 +1,6 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
- import { APIResource } from "../../../core/resource.mjs";
3
- import { path } from "../../../internal/utils/path.mjs";
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ import { path } from "../../internal/utils/path.mjs";
4
4
  export class Subscriptions extends APIResource {
5
5
  /**
6
6
  * Registers a push subscription for a visitor. Upserts by endpoint to handle
@@ -0,0 +1 @@
1
+ {"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../src/resources/push-notifications/subscriptions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;OAGG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,sCAAsC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzF,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,wCAAwC,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACxF,CAAC;CACF"}
@@ -0,0 +1,75 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import { APIPromise } from "../../core/api-promise.mjs";
3
+ import { RequestOptions } from "../../internal/request-options.mjs";
4
+ export declare class Topics extends APIResource {
5
+ /**
6
+ * Lists all topics a visitor is subscribed to.
7
+ */
8
+ list(query: TopicListParams, options?: RequestOptions): APIPromise<TopicListResponse>;
9
+ /**
10
+ * Subscribes a visitor to topics. Topics are per-visitor, so all devices for this
11
+ * visitor will receive notifications sent to these topics.
12
+ */
13
+ subscribe(body: TopicSubscribeParams, options?: RequestOptions): APIPromise<TopicSubscribeResponse>;
14
+ /**
15
+ * Unsubscribes a visitor from specified topics.
16
+ */
17
+ unsubscribe(body: TopicUnsubscribeParams, options?: RequestOptions): APIPromise<TopicUnsubscribeResponse>;
18
+ }
19
+ /**
20
+ * List of topics the visitor is subscribed to.
21
+ */
22
+ export interface TopicListResponse {
23
+ /**
24
+ * Topics the visitor is subscribed to
25
+ */
26
+ topics: Array<string>;
27
+ }
28
+ /**
29
+ * The visitor's updated topic subscriptions.
30
+ */
31
+ export interface TopicSubscribeResponse {
32
+ /**
33
+ * Topics the visitor is now subscribed to
34
+ */
35
+ topics: Array<string>;
36
+ }
37
+ /**
38
+ * The visitor's remaining topic subscriptions after unsubscribing.
39
+ */
40
+ export interface TopicUnsubscribeResponse {
41
+ /**
42
+ * Topics the visitor is still subscribed to
43
+ */
44
+ topics: Array<string>;
45
+ }
46
+ export interface TopicListParams {
47
+ /**
48
+ * Visitor ID to list topics for
49
+ */
50
+ visitorId: string;
51
+ }
52
+ export interface TopicSubscribeParams {
53
+ /**
54
+ * Topic names to subscribe to (e.g., 'announcements', 'channel:general')
55
+ */
56
+ topics: Array<string>;
57
+ /**
58
+ * Visitor ID to subscribe to topics
59
+ */
60
+ visitorId: string;
61
+ }
62
+ export interface TopicUnsubscribeParams {
63
+ /**
64
+ * Topic names to unsubscribe from
65
+ */
66
+ topics: Array<string>;
67
+ /**
68
+ * Visitor ID to unsubscribe from topics
69
+ */
70
+ visitorId: string;
71
+ }
72
+ export declare namespace Topics {
73
+ export { type TopicListResponse as TopicListResponse, type TopicSubscribeResponse as TopicSubscribeResponse, type TopicUnsubscribeResponse as TopicUnsubscribeResponse, type TopicListParams as TopicListParams, type TopicSubscribeParams as TopicSubscribeParams, type TopicUnsubscribeParams as TopicUnsubscribeParams, };
74
+ }
75
+ //# sourceMappingURL=topics.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topics.d.mts","sourceRoot":"","sources":["../../src/resources/push-notifications/topics.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iBAAiB,CAAC;IAIrF;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,sBAAsB,CAAC;IAInG;;OAEG;IACH,WAAW,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;CAG1G;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,CAAC,OAAO,WAAW,MAAM,CAAC;IAC9B,OAAO,EACL,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,75 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import { APIPromise } from "../../core/api-promise.js";
3
+ import { RequestOptions } from "../../internal/request-options.js";
4
+ export declare class Topics extends APIResource {
5
+ /**
6
+ * Lists all topics a visitor is subscribed to.
7
+ */
8
+ list(query: TopicListParams, options?: RequestOptions): APIPromise<TopicListResponse>;
9
+ /**
10
+ * Subscribes a visitor to topics. Topics are per-visitor, so all devices for this
11
+ * visitor will receive notifications sent to these topics.
12
+ */
13
+ subscribe(body: TopicSubscribeParams, options?: RequestOptions): APIPromise<TopicSubscribeResponse>;
14
+ /**
15
+ * Unsubscribes a visitor from specified topics.
16
+ */
17
+ unsubscribe(body: TopicUnsubscribeParams, options?: RequestOptions): APIPromise<TopicUnsubscribeResponse>;
18
+ }
19
+ /**
20
+ * List of topics the visitor is subscribed to.
21
+ */
22
+ export interface TopicListResponse {
23
+ /**
24
+ * Topics the visitor is subscribed to
25
+ */
26
+ topics: Array<string>;
27
+ }
28
+ /**
29
+ * The visitor's updated topic subscriptions.
30
+ */
31
+ export interface TopicSubscribeResponse {
32
+ /**
33
+ * Topics the visitor is now subscribed to
34
+ */
35
+ topics: Array<string>;
36
+ }
37
+ /**
38
+ * The visitor's remaining topic subscriptions after unsubscribing.
39
+ */
40
+ export interface TopicUnsubscribeResponse {
41
+ /**
42
+ * Topics the visitor is still subscribed to
43
+ */
44
+ topics: Array<string>;
45
+ }
46
+ export interface TopicListParams {
47
+ /**
48
+ * Visitor ID to list topics for
49
+ */
50
+ visitorId: string;
51
+ }
52
+ export interface TopicSubscribeParams {
53
+ /**
54
+ * Topic names to subscribe to (e.g., 'announcements', 'channel:general')
55
+ */
56
+ topics: Array<string>;
57
+ /**
58
+ * Visitor ID to subscribe to topics
59
+ */
60
+ visitorId: string;
61
+ }
62
+ export interface TopicUnsubscribeParams {
63
+ /**
64
+ * Topic names to unsubscribe from
65
+ */
66
+ topics: Array<string>;
67
+ /**
68
+ * Visitor ID to unsubscribe from topics
69
+ */
70
+ visitorId: string;
71
+ }
72
+ export declare namespace Topics {
73
+ export { type TopicListResponse as TopicListResponse, type TopicSubscribeResponse as TopicSubscribeResponse, type TopicUnsubscribeResponse as TopicUnsubscribeResponse, type TopicListParams as TopicListParams, type TopicSubscribeParams as TopicSubscribeParams, type TopicUnsubscribeParams as TopicUnsubscribeParams, };
74
+ }
75
+ //# sourceMappingURL=topics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["../../src/resources/push-notifications/topics.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,MAAO,SAAQ,WAA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AAK,sBAAsB,IAAI,sBAAsB,GACtD,CAAC;CACH"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Topics = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ class Topics extends resource_1.APIResource {
7
+ /**
8
+ * Lists all topics a visitor is subscribed to.
9
+ */
10
+ list(query, options) {
11
+ return this._client.get('/v1/push-notifications/topics', { query, ...options });
12
+ }
13
+ /**
14
+ * Subscribes a visitor to topics. Topics are per-visitor, so all devices for this
15
+ * visitor will receive notifications sent to these topics.
16
+ */
17
+ subscribe(body, options) {
18
+ return this._client.post('/v1/push-notifications/topics/subscribe', { body, ...options });
19
+ }
20
+ /**
21
+ * Unsubscribes a visitor from specified topics.
22
+ */
23
+ unsubscribe(body, options) {
24
+ return this._client.post('/v1/push-notifications/topics/unsubscribe', { body, ...options });
25
+ }
26
+ }
27
+ exports.Topics = Topics;
28
+ //# sourceMappingURL=topics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topics.js","sourceRoot":"","sources":["../../src/resources/push-notifications/topics.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,MAAa,MAAO,SAAQ,sBAAW;IACrC;;OAEG;IACH,IAAI,CAAC,KAAsB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,IAA4B,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2CAA2C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF;AAtBD,wBAsBC"}
@@ -0,0 +1,24 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../../core/resource.mjs";
3
+ export class Topics extends APIResource {
4
+ /**
5
+ * Lists all topics a visitor is subscribed to.
6
+ */
7
+ list(query, options) {
8
+ return this._client.get('/v1/push-notifications/topics', { query, ...options });
9
+ }
10
+ /**
11
+ * Subscribes a visitor to topics. Topics are per-visitor, so all devices for this
12
+ * visitor will receive notifications sent to these topics.
13
+ */
14
+ subscribe(body, options) {
15
+ return this._client.post('/v1/push-notifications/topics/subscribe', { body, ...options });
16
+ }
17
+ /**
18
+ * Unsubscribes a visitor from specified topics.
19
+ */
20
+ unsubscribe(body, options) {
21
+ return this._client.post('/v1/push-notifications/topics/unsubscribe', { body, ...options });
22
+ }
23
+ }
24
+ //# sourceMappingURL=topics.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"topics.mjs","sourceRoot":"","sources":["../../src/resources/push-notifications/topics.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;AAItB,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;OAEG;IACH,IAAI,CAAC,KAAsB,EAAE,OAAwB;QACnD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACH,SAAS,CAAC,IAA0B,EAAE,OAAwB;QAC5D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yCAAyC,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,IAA4B,EAAE,OAAwB;QAChE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,2CAA2C,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9F,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.d.mts","sourceRoot":"","sources":["../src/resources/push-notifications.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.d.ts","sourceRoot":"","sources":["../src/resources/push-notifications.ts"],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- const tslib_1 = require("../../internal/tslib.js");
4
+ const tslib_1 = require("../internal/tslib.js");
5
5
  tslib_1.__exportStar(require("./push-notifications/index.js"), exports);
6
6
  //# sourceMappingURL=push-notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.js","sourceRoot":"","sources":["../src/resources/push-notifications.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wEAA2C"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"push-notifications.mjs","sourceRoot":"","sources":["../src/resources/push-notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
package/src/client.ts CHANGED
@@ -19,6 +19,12 @@ import * as Uploads from './core/uploads';
19
19
  import * as API from './resources/index';
20
20
  import { APIPromise } from './core/api-promise';
21
21
  import { Beta } from './resources/beta/beta';
22
+ import {
23
+ PushNotificationEnableResponse,
24
+ PushNotificationSendParams,
25
+ PushNotificationSendResponse,
26
+ PushNotifications,
27
+ } from './resources/push-notifications/push-notifications';
22
28
  import { type Fetch } from './internal/builtin-types';
23
29
  import { HeadersLike, NullableHeaders, buildHeaders } from './internal/headers';
24
30
  import { FinalRequestOptions, RequestOptions } from './internal/request-options';
@@ -754,9 +760,11 @@ export class Hercules {
754
760
  static toFile = Uploads.toFile;
755
761
 
756
762
  beta: API.Beta = new API.Beta(this);
763
+ pushNotifications: API.PushNotifications = new API.PushNotifications(this);
757
764
  }
758
765
 
759
766
  Hercules.Beta = Beta;
767
+ Hercules.PushNotifications = PushNotifications;
760
768
 
761
769
  export declare namespace Hercules {
762
770
  export type RequestOptions = Opts.RequestOptions;
@@ -765,4 +773,11 @@ export declare namespace Hercules {
765
773
  export { type CursorIDPageParams as CursorIDPageParams, type CursorIDPageResponse as CursorIDPageResponse };
766
774
 
767
775
  export { Beta as Beta };
776
+
777
+ export {
778
+ PushNotifications as PushNotifications,
779
+ type PushNotificationEnableResponse as PushNotificationEnableResponse,
780
+ type PushNotificationSendResponse as PushNotificationSendResponse,
781
+ type PushNotificationSendParams as PushNotificationSendParams,
782
+ };
768
783
  }