@usehercules/sdk 1.4.0 → 1.5.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.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/resources/beta/beta.d.mts +4 -0
- package/resources/beta/beta.d.mts.map +1 -1
- package/resources/beta/beta.d.ts +4 -0
- package/resources/beta/beta.d.ts.map +1 -1
- package/resources/beta/beta.js +4 -0
- package/resources/beta/beta.js.map +1 -1
- package/resources/beta/beta.mjs +4 -0
- package/resources/beta/beta.mjs.map +1 -1
- package/resources/beta/index.d.mts +1 -0
- package/resources/beta/index.d.mts.map +1 -1
- package/resources/beta/index.d.ts +1 -0
- package/resources/beta/index.d.ts.map +1 -1
- package/resources/beta/index.js +3 -1
- package/resources/beta/index.js.map +1 -1
- package/resources/beta/index.mjs +1 -0
- package/resources/beta/index.mjs.map +1 -1
- package/resources/beta/push-notifications/index.d.mts +3 -0
- package/resources/beta/push-notifications/index.d.mts.map +1 -0
- package/resources/beta/push-notifications/index.d.ts +3 -0
- package/resources/beta/push-notifications/index.d.ts.map +1 -0
- package/resources/beta/push-notifications/index.js +9 -0
- package/resources/beta/push-notifications/index.js.map +1 -0
- package/resources/beta/push-notifications/index.mjs +4 -0
- package/resources/beta/push-notifications/index.mjs.map +1 -0
- package/resources/beta/push-notifications/push-notifications.d.mts +78 -0
- package/resources/beta/push-notifications/push-notifications.d.mts.map +1 -0
- package/resources/beta/push-notifications/push-notifications.d.ts +78 -0
- package/resources/beta/push-notifications/push-notifications.d.ts.map +1 -0
- package/resources/beta/push-notifications/push-notifications.js +32 -0
- package/resources/beta/push-notifications/push-notifications.js.map +1 -0
- package/resources/beta/push-notifications/push-notifications.mjs +27 -0
- package/resources/beta/push-notifications/push-notifications.mjs.map +1 -0
- package/resources/beta/push-notifications/subscriptions.d.mts +74 -0
- package/resources/beta/push-notifications/subscriptions.d.mts.map +1 -0
- package/resources/beta/push-notifications/subscriptions.d.ts +74 -0
- package/resources/beta/push-notifications/subscriptions.d.ts.map +1 -0
- package/resources/beta/push-notifications/subscriptions.js +23 -0
- package/resources/beta/push-notifications/subscriptions.js.map +1 -0
- package/resources/beta/push-notifications/subscriptions.mjs +19 -0
- package/resources/beta/push-notifications/subscriptions.mjs.map +1 -0
- package/resources/beta/push-notifications.d.mts +2 -0
- package/resources/beta/push-notifications.d.mts.map +1 -0
- package/resources/beta/push-notifications.d.ts +2 -0
- package/resources/beta/push-notifications.d.ts.map +1 -0
- package/resources/beta/push-notifications.js +6 -0
- package/resources/beta/push-notifications.js.map +1 -0
- package/resources/beta/push-notifications.mjs +3 -0
- package/resources/beta/push-notifications.mjs.map +1 -0
- package/src/resources/beta/beta.ts +18 -0
- package/src/resources/beta/index.ts +6 -0
- package/src/resources/beta/push-notifications/index.ts +14 -0
- package/src/resources/beta/push-notifications/push-notifications.ts +112 -0
- package/src/resources/beta/push-notifications/subscriptions.ts +96 -0
- package/src/resources/beta/push-notifications.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.5.0 (2026-01-05)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v1.4.0...v1.5.0](https://github.com/withzeusai/hercules-sdk-typescript/compare/v1.4.0...v1.5.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** update api ([96661ae](https://github.com/withzeusai/hercules-sdk-typescript/commit/96661ae04c97dd51b21ca500b16d775c5df04ecc))
|
|
10
|
+
|
|
3
11
|
## 1.4.0 (2026-01-02)
|
|
4
12
|
|
|
5
13
|
Full Changelog: [v1.3.0...v1.4.0](https://github.com/withzeusai/hercules-sdk-typescript/compare/v1.3.0...v1.4.0)
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.mjs";
|
|
2
2
|
import * as PayAPI from "./pay/pay.mjs";
|
|
3
3
|
import { Pay, PayCancelParams, PayCancelResponse, PayCheckParams, PayCheckResponse, PayCheckoutParams, PayCheckoutResponse } from "./pay/pay.mjs";
|
|
4
|
+
import * as PushNotificationsAPI from "./push-notifications/push-notifications.mjs";
|
|
5
|
+
import { PushNotificationEnableResponse, PushNotificationSendParams, PushNotificationSendResponse, PushNotifications } from "./push-notifications/push-notifications.mjs";
|
|
4
6
|
export declare class Beta extends APIResource {
|
|
5
7
|
pay: PayAPI.Pay;
|
|
8
|
+
pushNotifications: PushNotificationsAPI.PushNotifications;
|
|
6
9
|
}
|
|
7
10
|
export declare namespace Beta {
|
|
8
11
|
export { Pay as Pay, type PayCancelResponse as PayCancelResponse, type PayCheckResponse as PayCheckResponse, type PayCheckoutResponse as PayCheckoutResponse, type PayCancelParams as PayCancelParams, type PayCheckParams as PayCheckParams, type PayCheckoutParams as PayCheckoutParams, };
|
|
12
|
+
export { PushNotifications as PushNotifications, type PushNotificationEnableResponse as PushNotificationEnableResponse, type PushNotificationSendResponse as PushNotificationSendResponse, type PushNotificationSendParams as PushNotificationSendParams, };
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=beta.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.d.mts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;
|
|
1
|
+
{"version":3,"file":"beta.d.mts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB;OACM,KAAK,oBAAoB;OACzB,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EAClB;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;IAC/C,iBAAiB,EAAE,oBAAoB,CAAC,iBAAiB,CAEvD;CACH;AAKD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,GAAG,IAAI,GAAG,EACV,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,iBAAiB,IAAI,iBAAiB,EACtC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
package/resources/beta/beta.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { APIResource } from "../../core/resource.js";
|
|
2
2
|
import * as PayAPI from "./pay/pay.js";
|
|
3
3
|
import { Pay, PayCancelParams, PayCancelResponse, PayCheckParams, PayCheckResponse, PayCheckoutParams, PayCheckoutResponse } from "./pay/pay.js";
|
|
4
|
+
import * as PushNotificationsAPI from "./push-notifications/push-notifications.js";
|
|
5
|
+
import { PushNotificationEnableResponse, PushNotificationSendParams, PushNotificationSendResponse, PushNotifications } from "./push-notifications/push-notifications.js";
|
|
4
6
|
export declare class Beta extends APIResource {
|
|
5
7
|
pay: PayAPI.Pay;
|
|
8
|
+
pushNotifications: PushNotificationsAPI.PushNotifications;
|
|
6
9
|
}
|
|
7
10
|
export declare namespace Beta {
|
|
8
11
|
export { Pay as Pay, type PayCancelResponse as PayCancelResponse, type PayCheckResponse as PayCheckResponse, type PayCheckoutResponse as PayCheckoutResponse, type PayCancelParams as PayCancelParams, type PayCheckParams as PayCheckParams, type PayCheckoutParams as PayCheckoutParams, };
|
|
12
|
+
export { PushNotifications as PushNotifications, type PushNotificationEnableResponse as PushNotificationEnableResponse, type PushNotificationSendResponse as PushNotificationSendResponse, type PushNotificationSendParams as PushNotificationSendParams, };
|
|
9
13
|
}
|
|
10
14
|
//# sourceMappingURL=beta.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;
|
|
1
|
+
{"version":3,"file":"beta.d.ts","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,EACH,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,mBAAmB,EACpB;OACM,KAAK,oBAAoB;OACzB,EACL,8BAA8B,EAC9B,0BAA0B,EAC1B,4BAA4B,EAC5B,iBAAiB,EAClB;AAED,qBAAa,IAAK,SAAQ,WAAW;IACnC,GAAG,EAAE,MAAM,CAAC,GAAG,CAAgC;IAC/C,iBAAiB,EAAE,oBAAoB,CAAC,iBAAiB,CAEvD;CACH;AAKD,MAAM,CAAC,OAAO,WAAW,IAAI,CAAC;IAC5B,OAAO,EACL,GAAG,IAAI,GAAG,EACV,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;IAEF,OAAO,EACL,iBAAiB,IAAI,iBAAiB,EACtC,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,GAC9D,CAAC;CACH"}
|
package/resources/beta/beta.js
CHANGED
|
@@ -6,12 +6,16 @@ const tslib_1 = require("../../internal/tslib.js");
|
|
|
6
6
|
const resource_1 = require("../../core/resource.js");
|
|
7
7
|
const PayAPI = tslib_1.__importStar(require("./pay/pay.js"));
|
|
8
8
|
const pay_1 = require("./pay/pay.js");
|
|
9
|
+
const PushNotificationsAPI = tslib_1.__importStar(require("./push-notifications/push-notifications.js"));
|
|
10
|
+
const push_notifications_1 = require("./push-notifications/push-notifications.js");
|
|
9
11
|
class Beta extends resource_1.APIResource {
|
|
10
12
|
constructor() {
|
|
11
13
|
super(...arguments);
|
|
12
14
|
this.pay = new PayAPI.Pay(this._client);
|
|
15
|
+
this.pushNotifications = new PushNotificationsAPI.PushNotifications(this._client);
|
|
13
16
|
}
|
|
14
17
|
}
|
|
15
18
|
exports.Beta = Beta;
|
|
16
19
|
Beta.Pay = pay_1.Pay;
|
|
20
|
+
Beta.PushNotifications = push_notifications_1.PushNotifications;
|
|
17
21
|
//# sourceMappingURL=beta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAQmB;
|
|
1
|
+
{"version":3,"file":"beta.js","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,qDAAkD;AAClD,6DAAoC;AACpC,sCAQmB;AACnB,yGAAgF;AAChF,mFAKiD;AAEjD,MAAa,IAAK,SAAQ,sBAAW;IAArC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,sBAAiB,GAA2C,IAAI,oBAAoB,CAAC,iBAAiB,CACpG,IAAI,CAAC,OAAO,CACb,CAAC;IACJ,CAAC;CAAA;AALD,oBAKC;AAED,IAAI,CAAC,GAAG,GAAG,SAAG,CAAC;AACf,IAAI,CAAC,iBAAiB,GAAG,sCAAiB,CAAC"}
|
package/resources/beta/beta.mjs
CHANGED
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
import { APIResource } from "../../core/resource.mjs";
|
|
3
3
|
import * as PayAPI from "./pay/pay.mjs";
|
|
4
4
|
import { Pay, } from "./pay/pay.mjs";
|
|
5
|
+
import * as PushNotificationsAPI from "./push-notifications/push-notifications.mjs";
|
|
6
|
+
import { PushNotifications, } from "./push-notifications/push-notifications.mjs";
|
|
5
7
|
export class Beta extends APIResource {
|
|
6
8
|
constructor() {
|
|
7
9
|
super(...arguments);
|
|
8
10
|
this.pay = new PayAPI.Pay(this._client);
|
|
11
|
+
this.pushNotifications = new PushNotificationsAPI.PushNotifications(this._client);
|
|
9
12
|
}
|
|
10
13
|
}
|
|
11
14
|
Beta.Pay = Pay;
|
|
15
|
+
Beta.PushNotifications = PushNotifications;
|
|
12
16
|
//# sourceMappingURL=beta.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,GAOJ;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"beta.mjs","sourceRoot":"","sources":["../../src/resources/beta/beta.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EACL,GAAG,GAOJ;OACM,KAAK,oBAAoB;OACzB,EAIL,iBAAiB,GAClB;AAED,MAAM,OAAO,IAAK,SAAQ,WAAW;IAArC;;QACE,QAAG,GAAe,IAAI,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC/C,sBAAiB,GAA2C,IAAI,oBAAoB,CAAC,iBAAiB,CACpG,IAAI,CAAC,OAAO,CACb,CAAC;IACJ,CAAC;CAAA;AAED,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;AACf,IAAI,CAAC,iBAAiB,GAAG,iBAAiB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Beta } from "./beta.mjs";
|
|
2
2
|
export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay/index.mjs";
|
|
3
|
+
export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationSendResponse, type PushNotificationSendParams, } from "./push-notifications/index.mjs";
|
|
3
4
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB"}
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB;OACM,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,GAChC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { Beta } from "./beta.js";
|
|
2
2
|
export { Pay, type PayCancelResponse, type PayCheckResponse, type PayCheckoutResponse, type PayCancelParams, type PayCheckParams, type PayCheckoutParams, } from "./pay/index.js";
|
|
3
|
+
export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationSendResponse, type PushNotificationSendParams, } from "./push-notifications/index.js";
|
|
3
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"OAEO,EAAE,IAAI,EAAE;OACR,EACL,GAAG,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB;OACM,EACL,iBAAiB,EACjB,KAAK,8BAA8B,EACnC,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,GAChC"}
|
package/resources/beta/index.js
CHANGED
|
@@ -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.Pay = exports.Beta = void 0;
|
|
4
|
+
exports.PushNotifications = exports.Pay = exports.Beta = void 0;
|
|
5
5
|
var beta_1 = require("./beta.js");
|
|
6
6
|
Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
|
|
7
7
|
var index_1 = require("./pay/index.js");
|
|
8
8
|
Object.defineProperty(exports, "Pay", { enumerable: true, get: function () { return index_1.Pay; } });
|
|
9
|
+
var index_2 = require("./push-notifications/index.js");
|
|
10
|
+
Object.defineProperty(exports, "PushNotifications", { enumerable: true, get: function () { return index_2.PushNotifications; } });
|
|
9
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,wCAQqB;AAPnB,4FAAA,GAAG,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,wCAQqB;AAPnB,4FAAA,GAAG,OAAA;AAQL,uDAKoC;AAJlC,0GAAA,iBAAiB,OAAA"}
|
package/resources/beta/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
export { Beta } from "./beta.mjs";
|
|
3
3
|
export { Pay, } from "./pay/index.mjs";
|
|
4
|
+
export { PushNotifications, } from "./push-notifications/index.mjs";
|
|
4
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,GAAG,GAOJ"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/beta/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAAE;OACR,EACL,GAAG,GAOJ;OACM,EACL,iBAAiB,GAIlB"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationSendResponse, type PushNotificationSendParams, } from "./push-notifications.mjs";
|
|
2
|
+
export { Subscriptions, type SubscriptionCreateResponse, type SubscriptionDeleteResponse, type SubscriptionCreateParams, } from "./subscriptions.mjs";
|
|
3
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/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"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { PushNotifications, type PushNotificationEnableResponse, type PushNotificationSendResponse, type PushNotificationSendParams, } from "./push-notifications.js";
|
|
2
|
+
export { Subscriptions, type SubscriptionCreateResponse, type SubscriptionDeleteResponse, type SubscriptionCreateParams, } from "./subscriptions.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
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.Subscriptions = exports.PushNotifications = void 0;
|
|
5
|
+
var push_notifications_1 = require("./push-notifications.js");
|
|
6
|
+
Object.defineProperty(exports, "PushNotifications", { enumerable: true, get: function () { return push_notifications_1.PushNotifications; } });
|
|
7
|
+
var subscriptions_1 = require("./subscriptions.js");
|
|
8
|
+
Object.defineProperty(exports, "Subscriptions", { enumerable: true, get: function () { return subscriptions_1.Subscriptions; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/resources/beta/push-notifications/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,8DAK8B;AAJ5B,uHAAA,iBAAiB,OAAA;AAKnB,oDAKyB;AAJvB,8GAAA,aAAa,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../../src/resources/beta/push-notifications/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,iBAAiB,GAIlB;OACM,EACL,aAAa,GAId"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
2
|
+
import * as SubscriptionsAPI from "./subscriptions.mjs";
|
|
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";
|
|
6
|
+
export declare class PushNotifications extends APIResource {
|
|
7
|
+
subscriptions: SubscriptionsAPI.Subscriptions;
|
|
8
|
+
/**
|
|
9
|
+
* Enables push notifications for the app by generating VAPID keys. Idempotent -
|
|
10
|
+
* returns existing keys if already enabled. Hercules recommends calling this
|
|
11
|
+
* during app initialization.
|
|
12
|
+
*/
|
|
13
|
+
enable(options?: RequestOptions): APIPromise<PushNotificationEnableResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Sends push notifications to specified visitors. Omit visitorIds to broadcast to
|
|
16
|
+
* all subscribers. Returns the count of successful and failed deliveries.
|
|
17
|
+
*/
|
|
18
|
+
send(body: PushNotificationSendParams, options?: RequestOptions): APIPromise<PushNotificationSendResponse>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Response containing the VAPID public key for push subscriptions.
|
|
22
|
+
*/
|
|
23
|
+
export interface PushNotificationEnableResponse {
|
|
24
|
+
/**
|
|
25
|
+
* VAPID public key for push subscription (base64url encoded)
|
|
26
|
+
*/
|
|
27
|
+
vapidPublicKey: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Result of the send operation with success and failure counts.
|
|
31
|
+
*/
|
|
32
|
+
export interface PushNotificationSendResponse {
|
|
33
|
+
/**
|
|
34
|
+
* Number of notifications that failed to send
|
|
35
|
+
*/
|
|
36
|
+
failed: number;
|
|
37
|
+
/**
|
|
38
|
+
* Number of notifications successfully sent
|
|
39
|
+
*/
|
|
40
|
+
sent: number;
|
|
41
|
+
}
|
|
42
|
+
export interface PushNotificationSendParams {
|
|
43
|
+
/**
|
|
44
|
+
* Notification title
|
|
45
|
+
*/
|
|
46
|
+
title: string;
|
|
47
|
+
/**
|
|
48
|
+
* Badge URL for mobile devices
|
|
49
|
+
*/
|
|
50
|
+
badge?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Notification body text
|
|
53
|
+
*/
|
|
54
|
+
body?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Custom data payload to include with the notification
|
|
57
|
+
*/
|
|
58
|
+
data?: {
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Icon URL
|
|
63
|
+
*/
|
|
64
|
+
icon?: string;
|
|
65
|
+
/**
|
|
66
|
+
* URL to open when notification is clicked
|
|
67
|
+
*/
|
|
68
|
+
url?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Visitor IDs to send to. Omit to broadcast to all subscribers.
|
|
71
|
+
*/
|
|
72
|
+
visitorIds?: Array<string>;
|
|
73
|
+
}
|
|
74
|
+
export declare namespace PushNotifications {
|
|
75
|
+
export { type PushNotificationEnableResponse as PushNotificationEnableResponse, type PushNotificationSendResponse as PushNotificationSendResponse, type PushNotificationSendParams as PushNotificationSendParams, };
|
|
76
|
+
export { Subscriptions as Subscriptions, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, type SubscriptionCreateParams as SubscriptionCreateParams, };
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=push-notifications.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/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,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;IAEjG;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;IAI5E;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;CAG3G;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID,MAAM,CAAC,OAAO,WAAW,iBAAiB,CAAC;IACzC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,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;CACH"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { APIResource } from "../../../core/resource.js";
|
|
2
|
+
import * as SubscriptionsAPI from "./subscriptions.js";
|
|
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";
|
|
6
|
+
export declare class PushNotifications extends APIResource {
|
|
7
|
+
subscriptions: SubscriptionsAPI.Subscriptions;
|
|
8
|
+
/**
|
|
9
|
+
* Enables push notifications for the app by generating VAPID keys. Idempotent -
|
|
10
|
+
* returns existing keys if already enabled. Hercules recommends calling this
|
|
11
|
+
* during app initialization.
|
|
12
|
+
*/
|
|
13
|
+
enable(options?: RequestOptions): APIPromise<PushNotificationEnableResponse>;
|
|
14
|
+
/**
|
|
15
|
+
* Sends push notifications to specified visitors. Omit visitorIds to broadcast to
|
|
16
|
+
* all subscribers. Returns the count of successful and failed deliveries.
|
|
17
|
+
*/
|
|
18
|
+
send(body: PushNotificationSendParams, options?: RequestOptions): APIPromise<PushNotificationSendResponse>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Response containing the VAPID public key for push subscriptions.
|
|
22
|
+
*/
|
|
23
|
+
export interface PushNotificationEnableResponse {
|
|
24
|
+
/**
|
|
25
|
+
* VAPID public key for push subscription (base64url encoded)
|
|
26
|
+
*/
|
|
27
|
+
vapidPublicKey: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Result of the send operation with success and failure counts.
|
|
31
|
+
*/
|
|
32
|
+
export interface PushNotificationSendResponse {
|
|
33
|
+
/**
|
|
34
|
+
* Number of notifications that failed to send
|
|
35
|
+
*/
|
|
36
|
+
failed: number;
|
|
37
|
+
/**
|
|
38
|
+
* Number of notifications successfully sent
|
|
39
|
+
*/
|
|
40
|
+
sent: number;
|
|
41
|
+
}
|
|
42
|
+
export interface PushNotificationSendParams {
|
|
43
|
+
/**
|
|
44
|
+
* Notification title
|
|
45
|
+
*/
|
|
46
|
+
title: string;
|
|
47
|
+
/**
|
|
48
|
+
* Badge URL for mobile devices
|
|
49
|
+
*/
|
|
50
|
+
badge?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Notification body text
|
|
53
|
+
*/
|
|
54
|
+
body?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Custom data payload to include with the notification
|
|
57
|
+
*/
|
|
58
|
+
data?: {
|
|
59
|
+
[key: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Icon URL
|
|
63
|
+
*/
|
|
64
|
+
icon?: string;
|
|
65
|
+
/**
|
|
66
|
+
* URL to open when notification is clicked
|
|
67
|
+
*/
|
|
68
|
+
url?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Visitor IDs to send to. Omit to broadcast to all subscribers.
|
|
71
|
+
*/
|
|
72
|
+
visitorIds?: Array<string>;
|
|
73
|
+
}
|
|
74
|
+
export declare namespace PushNotifications {
|
|
75
|
+
export { type PushNotificationEnableResponse as PushNotificationEnableResponse, type PushNotificationSendResponse as PushNotificationSendResponse, type PushNotificationSendParams as PushNotificationSendParams, };
|
|
76
|
+
export { Subscriptions as Subscriptions, type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, type SubscriptionCreateParams as SubscriptionCreateParams, };
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=push-notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/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,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB,qBAAa,iBAAkB,SAAQ,WAAW;IAChD,aAAa,EAAE,gBAAgB,CAAC,aAAa,CAAoD;IAEjG;;;;OAIG;IACH,MAAM,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,8BAA8B,CAAC;IAI5E;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,0BAA0B,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,4BAA4B,CAAC;CAG3G;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;OAEG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,IAAI,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAElC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC5B;AAID,MAAM,CAAC,OAAO,WAAW,iBAAiB,CAAC;IACzC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,4BAA4B,IAAI,4BAA4B,EACjE,KAAK,0BAA0B,IAAI,0BAA0B,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;CACH"}
|
|
@@ -0,0 +1,32 @@
|
|
|
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.PushNotifications = void 0;
|
|
5
|
+
const tslib_1 = require("../../../internal/tslib.js");
|
|
6
|
+
const resource_1 = require("../../../core/resource.js");
|
|
7
|
+
const SubscriptionsAPI = tslib_1.__importStar(require("./subscriptions.js"));
|
|
8
|
+
const subscriptions_1 = require("./subscriptions.js");
|
|
9
|
+
class PushNotifications extends resource_1.APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Enables push notifications for the app by generating VAPID keys. Idempotent -
|
|
16
|
+
* returns existing keys if already enabled. Hercules recommends calling this
|
|
17
|
+
* during app initialization.
|
|
18
|
+
*/
|
|
19
|
+
enable(options) {
|
|
20
|
+
return this._client.post('/v1/push-notifications/enable', options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Sends push notifications to specified visitors. Omit visitorIds to broadcast to
|
|
24
|
+
* all subscribers. Returns the count of successful and failed deliveries.
|
|
25
|
+
*/
|
|
26
|
+
send(body, options) {
|
|
27
|
+
return this._client.post('/v1/push-notifications/send', { body, ...options });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.PushNotifications = PushNotifications;
|
|
31
|
+
PushNotifications.Subscriptions = subscriptions_1.Subscriptions;
|
|
32
|
+
//# sourceMappingURL=push-notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.js","sourceRoot":"","sources":["../../../src/resources/beta/push-notifications/push-notifications.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,6EAAoD;AACpD,sDAKyB;AAIzB,MAAa,iBAAkB,SAAQ,sBAAW;IAAlD;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkBnG,CAAC;IAhBC;;;;OAIG;IACH,MAAM,CAAC,OAAwB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;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;AAnBD,8CAmBC;AAgED,iBAAiB,CAAC,aAAa,GAAG,6BAAa,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../../../core/resource.mjs";
|
|
3
|
+
import * as SubscriptionsAPI from "./subscriptions.mjs";
|
|
4
|
+
import { Subscriptions, } from "./subscriptions.mjs";
|
|
5
|
+
export class PushNotifications extends APIResource {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Enables push notifications for the app by generating VAPID keys. Idempotent -
|
|
12
|
+
* returns existing keys if already enabled. Hercules recommends calling this
|
|
13
|
+
* during app initialization.
|
|
14
|
+
*/
|
|
15
|
+
enable(options) {
|
|
16
|
+
return this._client.post('/v1/push-notifications/enable', options);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Sends push notifications to specified visitors. Omit visitorIds to broadcast to
|
|
20
|
+
* all subscribers. Returns the count of successful and failed deliveries.
|
|
21
|
+
*/
|
|
22
|
+
send(body, options) {
|
|
23
|
+
return this._client.post('/v1/push-notifications/send', { body, ...options });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
PushNotifications.Subscriptions = Subscriptions;
|
|
27
|
+
//# sourceMappingURL=push-notifications.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.mjs","sourceRoot":"","sources":["../../../src/resources/beta/push-notifications/push-notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OACf,KAAK,gBAAgB;OACrB,EAIL,aAAa,GACd;AAID,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAAlD;;QACE,kBAAa,GAAmC,IAAI,gBAAgB,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAkBnG,CAAC;IAhBC;;;;OAIG;IACH,MAAM,CAAC,OAAwB;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,+BAA+B,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;OAGG;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;AAgED,iBAAiB,CAAC,aAAa,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 Subscriptions extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Registers a push subscription for a visitor. Upserts by endpoint to handle
|
|
7
|
+
* re-subscriptions gracefully.
|
|
8
|
+
*/
|
|
9
|
+
create(body: SubscriptionCreateParams, options?: RequestOptions): APIPromise<SubscriptionCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Removes a push subscription by ID.
|
|
12
|
+
*/
|
|
13
|
+
delete(id: string, options?: RequestOptions): APIPromise<SubscriptionDeleteResponse>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The created or updated subscription.
|
|
17
|
+
*/
|
|
18
|
+
export interface SubscriptionCreateResponse {
|
|
19
|
+
/**
|
|
20
|
+
* Subscription ID
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Result of the unsubscribe operation.
|
|
26
|
+
*/
|
|
27
|
+
export interface SubscriptionDeleteResponse {
|
|
28
|
+
/**
|
|
29
|
+
* Whether the subscription was removed
|
|
30
|
+
*/
|
|
31
|
+
success: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface SubscriptionCreateParams {
|
|
34
|
+
/**
|
|
35
|
+
* Web Push subscription object from pushManager.subscribe()
|
|
36
|
+
*/
|
|
37
|
+
subscription: SubscriptionCreateParams.Subscription;
|
|
38
|
+
/**
|
|
39
|
+
* Unique identifier for the subscriber (e.g., userId)
|
|
40
|
+
*/
|
|
41
|
+
visitorId: string;
|
|
42
|
+
}
|
|
43
|
+
export declare namespace SubscriptionCreateParams {
|
|
44
|
+
/**
|
|
45
|
+
* Web Push subscription object from pushManager.subscribe()
|
|
46
|
+
*/
|
|
47
|
+
interface Subscription {
|
|
48
|
+
/**
|
|
49
|
+
* Push service endpoint URL
|
|
50
|
+
*/
|
|
51
|
+
endpoint: string;
|
|
52
|
+
keys: Subscription.Keys;
|
|
53
|
+
/**
|
|
54
|
+
* Subscription expiration timestamp
|
|
55
|
+
*/
|
|
56
|
+
expirationTime?: number | null;
|
|
57
|
+
}
|
|
58
|
+
namespace Subscription {
|
|
59
|
+
interface Keys {
|
|
60
|
+
/**
|
|
61
|
+
* Authentication secret (base64url encoded)
|
|
62
|
+
*/
|
|
63
|
+
auth: string;
|
|
64
|
+
/**
|
|
65
|
+
* P-256 Diffie-Hellman public key (base64url encoded)
|
|
66
|
+
*/
|
|
67
|
+
p256dh: string;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export declare namespace Subscriptions {
|
|
72
|
+
export { type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, type SubscriptionCreateParams as SubscriptionCreateParams, };
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=subscriptions.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.mts","sourceRoot":"","sources":["../../../src/resources/beta/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"}
|
|
@@ -0,0 +1,74 @@
|
|
|
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 Subscriptions extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Registers a push subscription for a visitor. Upserts by endpoint to handle
|
|
7
|
+
* re-subscriptions gracefully.
|
|
8
|
+
*/
|
|
9
|
+
create(body: SubscriptionCreateParams, options?: RequestOptions): APIPromise<SubscriptionCreateResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Removes a push subscription by ID.
|
|
12
|
+
*/
|
|
13
|
+
delete(id: string, options?: RequestOptions): APIPromise<SubscriptionDeleteResponse>;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The created or updated subscription.
|
|
17
|
+
*/
|
|
18
|
+
export interface SubscriptionCreateResponse {
|
|
19
|
+
/**
|
|
20
|
+
* Subscription ID
|
|
21
|
+
*/
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Result of the unsubscribe operation.
|
|
26
|
+
*/
|
|
27
|
+
export interface SubscriptionDeleteResponse {
|
|
28
|
+
/**
|
|
29
|
+
* Whether the subscription was removed
|
|
30
|
+
*/
|
|
31
|
+
success: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface SubscriptionCreateParams {
|
|
34
|
+
/**
|
|
35
|
+
* Web Push subscription object from pushManager.subscribe()
|
|
36
|
+
*/
|
|
37
|
+
subscription: SubscriptionCreateParams.Subscription;
|
|
38
|
+
/**
|
|
39
|
+
* Unique identifier for the subscriber (e.g., userId)
|
|
40
|
+
*/
|
|
41
|
+
visitorId: string;
|
|
42
|
+
}
|
|
43
|
+
export declare namespace SubscriptionCreateParams {
|
|
44
|
+
/**
|
|
45
|
+
* Web Push subscription object from pushManager.subscribe()
|
|
46
|
+
*/
|
|
47
|
+
interface Subscription {
|
|
48
|
+
/**
|
|
49
|
+
* Push service endpoint URL
|
|
50
|
+
*/
|
|
51
|
+
endpoint: string;
|
|
52
|
+
keys: Subscription.Keys;
|
|
53
|
+
/**
|
|
54
|
+
* Subscription expiration timestamp
|
|
55
|
+
*/
|
|
56
|
+
expirationTime?: number | null;
|
|
57
|
+
}
|
|
58
|
+
namespace Subscription {
|
|
59
|
+
interface Keys {
|
|
60
|
+
/**
|
|
61
|
+
* Authentication secret (base64url encoded)
|
|
62
|
+
*/
|
|
63
|
+
auth: string;
|
|
64
|
+
/**
|
|
65
|
+
* P-256 Diffie-Hellman public key (base64url encoded)
|
|
66
|
+
*/
|
|
67
|
+
p256dh: string;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export declare namespace Subscriptions {
|
|
72
|
+
export { type SubscriptionCreateResponse as SubscriptionCreateResponse, type SubscriptionDeleteResponse as SubscriptionDeleteResponse, type SubscriptionCreateParams as SubscriptionCreateParams, };
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../../src/resources/beta/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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.Subscriptions = void 0;
|
|
5
|
+
const resource_1 = require("../../../core/resource.js");
|
|
6
|
+
const path_1 = require("../../../internal/utils/path.js");
|
|
7
|
+
class Subscriptions extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Registers a push subscription for a visitor. Upserts by endpoint to handle
|
|
10
|
+
* re-subscriptions gracefully.
|
|
11
|
+
*/
|
|
12
|
+
create(body, options) {
|
|
13
|
+
return this._client.post('/v1/push-notifications/subscriptions', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Removes a push subscription by ID.
|
|
17
|
+
*/
|
|
18
|
+
delete(id, options) {
|
|
19
|
+
return this._client.delete((0, path_1.path) `/v1/push-notifications/subscriptions/${id}`, options);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.Subscriptions = Subscriptions;
|
|
23
|
+
//# sourceMappingURL=subscriptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.js","sourceRoot":"","sources":["../../../src/resources/beta/push-notifications/subscriptions.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wDAAqD;AAGrD,0DAAoD;AAEpD,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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
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";
|
|
4
|
+
export class Subscriptions extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Registers a push subscription for a visitor. Upserts by endpoint to handle
|
|
7
|
+
* re-subscriptions gracefully.
|
|
8
|
+
*/
|
|
9
|
+
create(body, options) {
|
|
10
|
+
return this._client.post('/v1/push-notifications/subscriptions', { body, ...options });
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Removes a push subscription by ID.
|
|
14
|
+
*/
|
|
15
|
+
delete(id, options) {
|
|
16
|
+
return this._client.delete(path `/v1/push-notifications/subscriptions/${id}`, options);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=subscriptions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.mjs","sourceRoot":"","sources":["../../../src/resources/beta/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 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.d.mts","sourceRoot":"","sources":["../../src/resources/beta/push-notifications.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.d.ts","sourceRoot":"","sources":["../../src/resources/beta/push-notifications.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
const tslib_1 = require("../../internal/tslib.js");
|
|
5
|
+
tslib_1.__exportStar(require("./push-notifications/index.js"), exports);
|
|
6
|
+
//# sourceMappingURL=push-notifications.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.js","sourceRoot":"","sources":["../../src/resources/beta/push-notifications.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,wEAA2C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-notifications.mjs","sourceRoot":"","sources":["../../src/resources/beta/push-notifications.ts"],"names":[],"mappings":"AAAA,sFAAsF"}
|
|
@@ -11,12 +11,23 @@ import {
|
|
|
11
11
|
PayCheckoutParams,
|
|
12
12
|
PayCheckoutResponse,
|
|
13
13
|
} from './pay/pay';
|
|
14
|
+
import * as PushNotificationsAPI from './push-notifications/push-notifications';
|
|
15
|
+
import {
|
|
16
|
+
PushNotificationEnableResponse,
|
|
17
|
+
PushNotificationSendParams,
|
|
18
|
+
PushNotificationSendResponse,
|
|
19
|
+
PushNotifications,
|
|
20
|
+
} from './push-notifications/push-notifications';
|
|
14
21
|
|
|
15
22
|
export class Beta extends APIResource {
|
|
16
23
|
pay: PayAPI.Pay = new PayAPI.Pay(this._client);
|
|
24
|
+
pushNotifications: PushNotificationsAPI.PushNotifications = new PushNotificationsAPI.PushNotifications(
|
|
25
|
+
this._client,
|
|
26
|
+
);
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
Beta.Pay = Pay;
|
|
30
|
+
Beta.PushNotifications = PushNotifications;
|
|
20
31
|
|
|
21
32
|
export declare namespace Beta {
|
|
22
33
|
export {
|
|
@@ -28,4 +39,11 @@ export declare namespace Beta {
|
|
|
28
39
|
type PayCheckParams as PayCheckParams,
|
|
29
40
|
type PayCheckoutParams as PayCheckoutParams,
|
|
30
41
|
};
|
|
42
|
+
|
|
43
|
+
export {
|
|
44
|
+
PushNotifications as PushNotifications,
|
|
45
|
+
type PushNotificationEnableResponse as PushNotificationEnableResponse,
|
|
46
|
+
type PushNotificationSendResponse as PushNotificationSendResponse,
|
|
47
|
+
type PushNotificationSendParams as PushNotificationSendParams,
|
|
48
|
+
};
|
|
31
49
|
}
|
|
@@ -10,3 +10,9 @@ export {
|
|
|
10
10
|
type PayCheckParams,
|
|
11
11
|
type PayCheckoutParams,
|
|
12
12
|
} from './pay/index';
|
|
13
|
+
export {
|
|
14
|
+
PushNotifications,
|
|
15
|
+
type PushNotificationEnableResponse,
|
|
16
|
+
type PushNotificationSendResponse,
|
|
17
|
+
type PushNotificationSendParams,
|
|
18
|
+
} from './push-notifications/index';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
export {
|
|
4
|
+
PushNotifications,
|
|
5
|
+
type PushNotificationEnableResponse,
|
|
6
|
+
type PushNotificationSendResponse,
|
|
7
|
+
type PushNotificationSendParams,
|
|
8
|
+
} from './push-notifications';
|
|
9
|
+
export {
|
|
10
|
+
Subscriptions,
|
|
11
|
+
type SubscriptionCreateResponse,
|
|
12
|
+
type SubscriptionDeleteResponse,
|
|
13
|
+
type SubscriptionCreateParams,
|
|
14
|
+
} from './subscriptions';
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as SubscriptionsAPI from './subscriptions';
|
|
5
|
+
import {
|
|
6
|
+
SubscriptionCreateParams,
|
|
7
|
+
SubscriptionCreateResponse,
|
|
8
|
+
SubscriptionDeleteResponse,
|
|
9
|
+
Subscriptions,
|
|
10
|
+
} from './subscriptions';
|
|
11
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
12
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
13
|
+
|
|
14
|
+
export class PushNotifications extends APIResource {
|
|
15
|
+
subscriptions: SubscriptionsAPI.Subscriptions = new SubscriptionsAPI.Subscriptions(this._client);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Enables push notifications for the app by generating VAPID keys. Idempotent -
|
|
19
|
+
* returns existing keys if already enabled. Hercules recommends calling this
|
|
20
|
+
* during app initialization.
|
|
21
|
+
*/
|
|
22
|
+
enable(options?: RequestOptions): APIPromise<PushNotificationEnableResponse> {
|
|
23
|
+
return this._client.post('/v1/push-notifications/enable', options);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sends push notifications to specified visitors. Omit visitorIds to broadcast to
|
|
28
|
+
* all subscribers. Returns the count of successful and failed deliveries.
|
|
29
|
+
*/
|
|
30
|
+
send(body: PushNotificationSendParams, options?: RequestOptions): APIPromise<PushNotificationSendResponse> {
|
|
31
|
+
return this._client.post('/v1/push-notifications/send', { body, ...options });
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Response containing the VAPID public key for push subscriptions.
|
|
37
|
+
*/
|
|
38
|
+
export interface PushNotificationEnableResponse {
|
|
39
|
+
/**
|
|
40
|
+
* VAPID public key for push subscription (base64url encoded)
|
|
41
|
+
*/
|
|
42
|
+
vapidPublicKey: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Result of the send operation with success and failure counts.
|
|
47
|
+
*/
|
|
48
|
+
export interface PushNotificationSendResponse {
|
|
49
|
+
/**
|
|
50
|
+
* Number of notifications that failed to send
|
|
51
|
+
*/
|
|
52
|
+
failed: number;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Number of notifications successfully sent
|
|
56
|
+
*/
|
|
57
|
+
sent: number;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface PushNotificationSendParams {
|
|
61
|
+
/**
|
|
62
|
+
* Notification title
|
|
63
|
+
*/
|
|
64
|
+
title: string;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Badge URL for mobile devices
|
|
68
|
+
*/
|
|
69
|
+
badge?: string;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Notification body text
|
|
73
|
+
*/
|
|
74
|
+
body?: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Custom data payload to include with the notification
|
|
78
|
+
*/
|
|
79
|
+
data?: { [key: string]: unknown };
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Icon URL
|
|
83
|
+
*/
|
|
84
|
+
icon?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* URL to open when notification is clicked
|
|
88
|
+
*/
|
|
89
|
+
url?: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Visitor IDs to send to. Omit to broadcast to all subscribers.
|
|
93
|
+
*/
|
|
94
|
+
visitorIds?: Array<string>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
PushNotifications.Subscriptions = Subscriptions;
|
|
98
|
+
|
|
99
|
+
export declare namespace PushNotifications {
|
|
100
|
+
export {
|
|
101
|
+
type PushNotificationEnableResponse as PushNotificationEnableResponse,
|
|
102
|
+
type PushNotificationSendResponse as PushNotificationSendResponse,
|
|
103
|
+
type PushNotificationSendParams as PushNotificationSendParams,
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export {
|
|
107
|
+
Subscriptions as Subscriptions,
|
|
108
|
+
type SubscriptionCreateResponse as SubscriptionCreateResponse,
|
|
109
|
+
type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
|
|
110
|
+
type SubscriptionCreateParams as SubscriptionCreateParams,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../../../internal/request-options';
|
|
6
|
+
import { path } from '../../../internal/utils/path';
|
|
7
|
+
|
|
8
|
+
export class Subscriptions extends APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Registers a push subscription for a visitor. Upserts by endpoint to handle
|
|
11
|
+
* re-subscriptions gracefully.
|
|
12
|
+
*/
|
|
13
|
+
create(body: SubscriptionCreateParams, options?: RequestOptions): APIPromise<SubscriptionCreateResponse> {
|
|
14
|
+
return this._client.post('/v1/push-notifications/subscriptions', { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Removes a push subscription by ID.
|
|
19
|
+
*/
|
|
20
|
+
delete(id: string, options?: RequestOptions): APIPromise<SubscriptionDeleteResponse> {
|
|
21
|
+
return this._client.delete(path`/v1/push-notifications/subscriptions/${id}`, options);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The created or updated subscription.
|
|
27
|
+
*/
|
|
28
|
+
export interface SubscriptionCreateResponse {
|
|
29
|
+
/**
|
|
30
|
+
* Subscription ID
|
|
31
|
+
*/
|
|
32
|
+
id: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Result of the unsubscribe operation.
|
|
37
|
+
*/
|
|
38
|
+
export interface SubscriptionDeleteResponse {
|
|
39
|
+
/**
|
|
40
|
+
* Whether the subscription was removed
|
|
41
|
+
*/
|
|
42
|
+
success: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface SubscriptionCreateParams {
|
|
46
|
+
/**
|
|
47
|
+
* Web Push subscription object from pushManager.subscribe()
|
|
48
|
+
*/
|
|
49
|
+
subscription: SubscriptionCreateParams.Subscription;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Unique identifier for the subscriber (e.g., userId)
|
|
53
|
+
*/
|
|
54
|
+
visitorId: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export namespace SubscriptionCreateParams {
|
|
58
|
+
/**
|
|
59
|
+
* Web Push subscription object from pushManager.subscribe()
|
|
60
|
+
*/
|
|
61
|
+
export interface Subscription {
|
|
62
|
+
/**
|
|
63
|
+
* Push service endpoint URL
|
|
64
|
+
*/
|
|
65
|
+
endpoint: string;
|
|
66
|
+
|
|
67
|
+
keys: Subscription.Keys;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Subscription expiration timestamp
|
|
71
|
+
*/
|
|
72
|
+
expirationTime?: number | null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export namespace Subscription {
|
|
76
|
+
export interface Keys {
|
|
77
|
+
/**
|
|
78
|
+
* Authentication secret (base64url encoded)
|
|
79
|
+
*/
|
|
80
|
+
auth: string;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* P-256 Diffie-Hellman public key (base64url encoded)
|
|
84
|
+
*/
|
|
85
|
+
p256dh: string;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export declare namespace Subscriptions {
|
|
91
|
+
export {
|
|
92
|
+
type SubscriptionCreateResponse as SubscriptionCreateResponse,
|
|
93
|
+
type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
|
|
94
|
+
type SubscriptionCreateParams as SubscriptionCreateParams,
|
|
95
|
+
};
|
|
96
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.5.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.5.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.5.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|