@futurewindai/wotchi 0.1.0-beta.1 → 0.1.0-beta.5
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/README.md +182 -56
- package/SECURITY.md +2 -2
- package/dist/cjs/core/client.js +380 -21
- package/dist/cjs/core/config.js +177 -18
- package/dist/cjs/core/diagnostics.js +12 -1
- package/dist/cjs/core/group-store.js +15 -1
- package/dist/cjs/core/incident-builder.js +18 -0
- package/dist/cjs/core/incident-policy.js +2 -7
- package/dist/cjs/core/limits.js +13 -0
- package/dist/cjs/core/normalize.js +10 -5
- package/dist/cjs/core/notification-queue.js +20 -3
- package/dist/cjs/core/redact.js +83 -8
- package/dist/cjs/index.js +3 -1
- package/dist/cjs/integrations/express/error-handler.js +4 -1
- package/dist/cjs/integrations/express/index.js +4 -1
- package/dist/cjs/integrations/express/state.js +30 -0
- package/dist/cjs/integrations/express/status-observer.js +86 -0
- package/dist/cjs/integrations/nest/exception-filter.js +9 -1
- package/dist/cjs/integrations/nest/index.js +3 -1
- package/dist/cjs/integrations/nest/register.js +9 -0
- package/dist/cjs/integrations/request-context.js +83 -1
- package/dist/cjs/notifiers/alert-payload.js +20 -0
- package/dist/cjs/notifiers/console.js +100 -10
- package/dist/cjs/notifiers/telegram-format.js +75 -5
- package/dist/cjs/notifiers/webhook-http.js +394 -0
- package/dist/cjs/notifiers/webhook.js +28 -0
- package/dist/esm/core/client.js +380 -21
- package/dist/esm/core/config.js +177 -18
- package/dist/esm/core/diagnostics.js +12 -1
- package/dist/esm/core/group-store.js +15 -1
- package/dist/esm/core/incident-builder.js +18 -0
- package/dist/esm/core/incident-policy.js +2 -7
- package/dist/esm/core/limits.js +10 -0
- package/dist/esm/core/normalize.js +10 -5
- package/dist/esm/core/notification-queue.js +20 -3
- package/dist/esm/core/redact.js +83 -8
- package/dist/esm/index.js +2 -1
- package/dist/esm/integrations/express/error-handler.js +4 -1
- package/dist/esm/integrations/express/index.js +2 -1
- package/dist/esm/integrations/express/state.js +26 -0
- package/dist/esm/integrations/express/status-observer.js +83 -0
- package/dist/esm/integrations/nest/exception-filter.js +9 -1
- package/dist/esm/integrations/nest/index.js +2 -2
- package/dist/esm/integrations/nest/register.js +8 -0
- package/dist/esm/integrations/request-context.js +83 -1
- package/dist/esm/notifiers/alert-payload.js +16 -0
- package/dist/esm/notifiers/console.js +100 -10
- package/dist/esm/notifiers/telegram-format.js +75 -5
- package/dist/esm/notifiers/webhook-http.js +387 -0
- package/dist/esm/notifiers/webhook.js +24 -0
- package/dist/types/core/config.d.ts +7 -1
- package/dist/types/core/diagnostics.d.ts +5 -1
- package/dist/types/core/limits.d.ts +10 -0
- package/dist/types/core/notification-queue.d.ts +5 -1
- package/dist/types/core/types.d.ts +97 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/integrations/express/index.d.ts +4 -2
- package/dist/types/integrations/express/state.d.ts +2 -0
- package/dist/types/integrations/express/status-observer.d.ts +11 -0
- package/dist/types/integrations/nest/index.d.ts +4 -3
- package/dist/types/integrations/nest/register.d.ts +3 -0
- package/dist/types/integrations/request-context.d.ts +3 -0
- package/dist/types/notifiers/alert-payload.d.ts +5 -0
- package/dist/types/notifiers/console.d.ts +1 -1
- package/dist/types/notifiers/webhook-http.d.ts +37 -0
- package/dist/types/notifiers/webhook.d.ts +4 -0
- package/dist/types-cjs/core/client.d.cts +2 -0
- package/dist/types-cjs/core/config.d.cts +35 -0
- package/dist/types-cjs/core/diagnostics.d.cts +11 -0
- package/dist/types-cjs/core/errors.d.cts +3 -0
- package/dist/types-cjs/core/fingerprint.d.cts +3 -0
- package/dist/types-cjs/core/group-store.d.cts +15 -0
- package/dist/types-cjs/core/incident-builder.d.cts +3 -0
- package/dist/types-cjs/core/incident-policy.d.cts +15 -0
- package/dist/types-cjs/core/limits.d.cts +10 -0
- package/dist/types-cjs/core/normalize.d.cts +17 -0
- package/dist/types-cjs/core/notification-queue.d.cts +20 -0
- package/dist/types-cjs/core/process-monitor.d.cts +5 -0
- package/dist/types-cjs/core/redact.d.cts +11 -0
- package/dist/types-cjs/core/rolling-window.d.cts +12 -0
- package/dist/types-cjs/core/stack-frame.d.cts +2 -0
- package/dist/types-cjs/core/types.d.cts +205 -0
- package/dist/types-cjs/index.d.cts +11 -0
- package/dist/types-cjs/integrations/express/error-handler.d.cts +4 -0
- package/dist/types-cjs/integrations/express/index.d.cts +9 -0
- package/dist/types-cjs/integrations/express/request-context.d.cts +5 -0
- package/dist/types-cjs/integrations/express/state.d.cts +2 -0
- package/dist/types-cjs/integrations/express/status-observer.d.cts +11 -0
- package/dist/types-cjs/integrations/nest/exception-filter.d.cts +10 -0
- package/dist/types-cjs/integrations/nest/index.d.cts +5 -0
- package/dist/types-cjs/integrations/nest/register.d.cts +13 -0
- package/dist/types-cjs/integrations/nest/request-context.d.cts +5 -0
- package/dist/types-cjs/integrations/request-context.d.cts +16 -0
- package/dist/types-cjs/notifiers/alert-payload.d.cts +5 -0
- package/dist/types-cjs/notifiers/console.d.cts +3 -0
- package/dist/types-cjs/notifiers/telegram-format.d.cts +2 -0
- package/dist/types-cjs/notifiers/telegram-http.d.cts +21 -0
- package/dist/types-cjs/notifiers/telegram.d.cts +4 -0
- package/dist/types-cjs/notifiers/webhook-http.d.cts +37 -0
- package/dist/types-cjs/notifiers/webhook.d.cts +4 -0
- package/package.json +28 -6
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TelegramNotifierOptions, WotchiNotifier } from "../core/types.js";
|
|
2
|
+
import { type TelegramRequestFunction } from "./telegram-http.js";
|
|
3
|
+
export declare function createTelegramNotifier(options: TelegramNotifierOptions, request?: TelegramRequestFunction): WotchiNotifier;
|
|
4
|
+
export declare function telegramNotifier(options: TelegramNotifierOptions): WotchiNotifier;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IncidentAlert, WebhookNotifierOptions } from "../core/types.js";
|
|
2
|
+
export interface WebhookRequestOptions {
|
|
3
|
+
protocol: "http:" | "https:";
|
|
4
|
+
hostname: string;
|
|
5
|
+
port?: string;
|
|
6
|
+
method: "POST";
|
|
7
|
+
path: string;
|
|
8
|
+
headers: Record<string, string | number>;
|
|
9
|
+
allowPrivateDestinations?: boolean;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
}
|
|
12
|
+
export interface WebhookResponse {
|
|
13
|
+
statusCode: number;
|
|
14
|
+
headers: Record<string, string | string[] | undefined>;
|
|
15
|
+
body: string;
|
|
16
|
+
}
|
|
17
|
+
export type WebhookRequestFunction = (options: WebhookRequestOptions, body: string, timeoutMs: number) => Promise<WebhookResponse>;
|
|
18
|
+
export interface WebhookSendOptions {
|
|
19
|
+
url: string;
|
|
20
|
+
alert: IncidentAlert;
|
|
21
|
+
headers?: Record<string, string>;
|
|
22
|
+
timeoutMs?: number;
|
|
23
|
+
maxRetries?: number;
|
|
24
|
+
allowHttpLoopback?: boolean;
|
|
25
|
+
allowPrivateDestinations?: boolean;
|
|
26
|
+
payloadBuilder?: (alert: Readonly<IncidentAlert>) => unknown;
|
|
27
|
+
}
|
|
28
|
+
export declare function normalizeWebhookOptions(options: WebhookNotifierOptions): {
|
|
29
|
+
url: URL;
|
|
30
|
+
headers?: Record<string, string>;
|
|
31
|
+
timeoutMs: number;
|
|
32
|
+
maxRetries: number;
|
|
33
|
+
allowHttpLoopback: boolean;
|
|
34
|
+
allowPrivateDestinations: boolean;
|
|
35
|
+
payloadBuilder?: WebhookNotifierOptions["payloadBuilder"];
|
|
36
|
+
};
|
|
37
|
+
export declare function sendWebhookAlert(options: WebhookSendOptions, request?: WebhookRequestFunction): Promise<void>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { WebhookNotifierOptions, WotchiNotifier } from "../core/types.js";
|
|
2
|
+
import { type WebhookRequestFunction } from "./webhook-http.js";
|
|
3
|
+
export declare function createWebhookNotifier(options: WebhookNotifierOptions, request?: WebhookRequestFunction): WotchiNotifier;
|
|
4
|
+
export declare function webhookNotifier(options: WebhookNotifierOptions): WotchiNotifier;
|
package/package.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futurewindai/wotchi",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-beta.5",
|
|
4
|
+
"description": "Low-noise error alerts for Node.js, Express, and NestJS applications",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"nodejs",
|
|
7
|
+
"typescript",
|
|
8
|
+
"express",
|
|
9
|
+
"nestjs",
|
|
10
|
+
"error-monitoring",
|
|
11
|
+
"incident-management",
|
|
12
|
+
"alerting",
|
|
13
|
+
"observability",
|
|
14
|
+
"telegram",
|
|
15
|
+
"webhook"
|
|
16
|
+
],
|
|
5
17
|
"license": "Apache-2.0",
|
|
6
18
|
"type": "module",
|
|
7
19
|
"engines": {
|
|
@@ -23,17 +35,26 @@
|
|
|
23
35
|
"types": "./dist/types/index.d.ts",
|
|
24
36
|
"exports": {
|
|
25
37
|
".": {
|
|
26
|
-
"types":
|
|
38
|
+
"types": {
|
|
39
|
+
"import": "./dist/types/index.d.ts",
|
|
40
|
+
"require": "./dist/types-cjs/index.d.cts"
|
|
41
|
+
},
|
|
27
42
|
"import": "./dist/esm/index.js",
|
|
28
43
|
"require": "./dist/cjs/index.js"
|
|
29
44
|
},
|
|
30
45
|
"./express": {
|
|
31
|
-
"types":
|
|
46
|
+
"types": {
|
|
47
|
+
"import": "./dist/types/integrations/express/index.d.ts",
|
|
48
|
+
"require": "./dist/types-cjs/integrations/express/index.d.cts"
|
|
49
|
+
},
|
|
32
50
|
"import": "./dist/esm/integrations/express/index.js",
|
|
33
51
|
"require": "./dist/cjs/integrations/express/index.js"
|
|
34
52
|
},
|
|
35
53
|
"./nest": {
|
|
36
|
-
"types":
|
|
54
|
+
"types": {
|
|
55
|
+
"import": "./dist/types/integrations/nest/index.d.ts",
|
|
56
|
+
"require": "./dist/types-cjs/integrations/nest/index.d.cts"
|
|
57
|
+
},
|
|
37
58
|
"import": "./dist/esm/integrations/nest/index.js",
|
|
38
59
|
"require": "./dist/cjs/integrations/nest/index.js"
|
|
39
60
|
}
|
|
@@ -42,7 +63,7 @@
|
|
|
42
63
|
"type": "git",
|
|
43
64
|
"url": "git+ssh://git@github.com/FutureWindAI/Wotchi.git"
|
|
44
65
|
},
|
|
45
|
-
"homepage": "https://github.com/FutureWindAI/Wotchi
|
|
66
|
+
"homepage": "https://github.com/FutureWindAI/Wotchi",
|
|
46
67
|
"bugs": {
|
|
47
68
|
"url": "https://github.com/FutureWindAI/Wotchi/issues"
|
|
48
69
|
},
|
|
@@ -53,6 +74,7 @@
|
|
|
53
74
|
"build:types": "tsc -p tsconfig.types.json",
|
|
54
75
|
"build": "npm run clean && npm run build:esm && npm run build:cjs && npm run build:types && node scripts/prepare-package.mjs",
|
|
55
76
|
"stand": "node scripts/start-test-stand.mjs",
|
|
77
|
+
"stand:production": "node scripts/start-nest-production-stand.mjs",
|
|
56
78
|
"typecheck": "tsc -p tsconfig.base.json --noEmit",
|
|
57
79
|
"lint": "eslint .",
|
|
58
80
|
"format": "prettier --write .",
|