@zeph-to/hook-sdk 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +4 -2
- package/dist/zeph-hook.js +2 -2
- package/package.json +8 -2
package/dist/cli.js
CHANGED
|
@@ -52,7 +52,8 @@ Options:
|
|
|
52
52
|
--json Output JSON format
|
|
53
53
|
|
|
54
54
|
Environment:
|
|
55
|
-
ZEPH_API_KEY API key (fallback when --key not provided)
|
|
55
|
+
ZEPH_API_KEY API key (fallback when --key not provided)
|
|
56
|
+
ZEPH_BASE_URL API base URL (fallback when --base-url not provided)`);
|
|
56
57
|
};
|
|
57
58
|
const printError = (message, isJson) => {
|
|
58
59
|
if (isJson) {
|
|
@@ -93,9 +94,10 @@ const main = async () => {
|
|
|
93
94
|
printError('API key required. Use --key or set ZEPH_API_KEY', isJson);
|
|
94
95
|
return 3;
|
|
95
96
|
}
|
|
97
|
+
const baseUrl = args['base-url'] || process.env.ZEPH_BASE_URL;
|
|
96
98
|
const hook = new zeph_hook_js_1.ZephHook({
|
|
97
99
|
apiKey,
|
|
98
|
-
baseUrl
|
|
100
|
+
...(baseUrl && { baseUrl }),
|
|
99
101
|
});
|
|
100
102
|
try {
|
|
101
103
|
const result = await hook.notify({
|
package/dist/zeph-hook.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ZephHook = void 0;
|
|
4
4
|
const errors_js_1 = require("./errors.js");
|
|
5
|
-
const DEFAULT_BASE_URL = 'https://api.zeph.to';
|
|
5
|
+
const DEFAULT_BASE_URL = 'https://api.zeph.to/v1';
|
|
6
6
|
const DEFAULT_TIMEOUT_MS = 30_000;
|
|
7
7
|
class ZephHook {
|
|
8
8
|
apiKey;
|
|
@@ -21,7 +21,7 @@ class ZephHook {
|
|
|
21
21
|
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
22
22
|
let response;
|
|
23
23
|
try {
|
|
24
|
-
response = await fetch(`${this.baseUrl}/
|
|
24
|
+
response = await fetch(`${this.baseUrl}/pushes/send`, {
|
|
25
25
|
method: 'POST',
|
|
26
26
|
headers: {
|
|
27
27
|
'Content-Type': 'application/json',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeph-to/hook-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Zeph push notification SDK + CLI — zero dependencies",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -30,6 +30,12 @@
|
|
|
30
30
|
"directory": "libs/hook-sdk"
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/tak-bro/encl/tree/main/libs/hook-sdk",
|
|
33
|
-
"keywords": [
|
|
33
|
+
"keywords": [
|
|
34
|
+
"zeph",
|
|
35
|
+
"push",
|
|
36
|
+
"notification",
|
|
37
|
+
"cli",
|
|
38
|
+
"webhook"
|
|
39
|
+
],
|
|
34
40
|
"license": "MIT"
|
|
35
41
|
}
|