@futurewindai/wotchi 0.1.0-beta.1 → 0.1.0-beta.2
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 +110 -61
- package/SECURITY.md +2 -2
- package/dist/cjs/core/client.js +13 -3
- package/dist/cjs/core/redact.js +31 -2
- package/dist/cjs/integrations/express/error-handler.js +2 -0
- package/dist/cjs/integrations/express/index.js +3 -1
- package/dist/cjs/integrations/express/state.js +30 -0
- package/dist/cjs/integrations/express/status-observer.js +80 -0
- package/dist/cjs/integrations/nest/index.js +2 -1
- package/dist/cjs/integrations/nest/register.js +9 -0
- package/dist/cjs/notifiers/console.js +32 -12
- package/dist/esm/core/client.js +13 -3
- package/dist/esm/core/redact.js +31 -2
- package/dist/esm/integrations/express/error-handler.js +2 -0
- package/dist/esm/integrations/express/index.js +1 -0
- package/dist/esm/integrations/express/state.js +26 -0
- package/dist/esm/integrations/express/status-observer.js +77 -0
- package/dist/esm/integrations/nest/index.js +1 -1
- package/dist/esm/integrations/nest/register.js +8 -0
- package/dist/esm/notifiers/console.js +32 -12
- package/dist/types/core/types.d.ts +2 -0
- package/dist/types/integrations/express/index.d.ts +2 -0
- 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 +2 -1
- package/dist/types/integrations/nest/register.d.ts +3 -0
- package/dist/types/notifiers/console.d.ts +1 -1
- package/dist/types-cjs/core/client.d.cts +2 -0
- package/dist/types-cjs/core/config.d.cts +29 -0
- package/dist/types-cjs/core/diagnostics.d.cts +7 -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/normalize.d.cts +17 -0
- package/dist/types-cjs/core/notification-queue.d.cts +16 -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 +111 -0
- package/dist/types-cjs/index.d.cts +9 -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 +13 -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/package.json +26 -6
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WotchiRequestContext } from "../core/types.js";
|
|
2
|
+
export interface RequestContextOptions {
|
|
3
|
+
requestIdProperty?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function normalizeRoutePath(value: unknown): string | undefined;
|
|
6
|
+
export interface RequestContextInput {
|
|
7
|
+
request?: unknown;
|
|
8
|
+
method?: unknown;
|
|
9
|
+
route?: unknown;
|
|
10
|
+
statusCode?: unknown;
|
|
11
|
+
options?: RequestContextOptions;
|
|
12
|
+
}
|
|
13
|
+
export declare function buildRequestContext(input: RequestContextInput): WotchiRequestContext | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ConsoleNotifierOptions, IncidentAlert, WotchiNotifier } from "../core/types.js";
|
|
2
|
+
export declare function formatConsoleAlert(alert: IncidentAlert, format?: "text" | "json"): string;
|
|
3
|
+
export declare function consoleNotifier(options?: ConsoleNotifierOptions): WotchiNotifier;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { RequestOptions } from "node:https";
|
|
2
|
+
export interface TelegramHttpRequestOptions extends RequestOptions {
|
|
3
|
+
protocol: "https:";
|
|
4
|
+
hostname: "api.telegram.org";
|
|
5
|
+
method: "POST";
|
|
6
|
+
path: string;
|
|
7
|
+
headers: Record<string, string | number>;
|
|
8
|
+
}
|
|
9
|
+
export interface TelegramHttpResponse {
|
|
10
|
+
statusCode: number;
|
|
11
|
+
headers: Record<string, string | string[] | undefined>;
|
|
12
|
+
body: string;
|
|
13
|
+
}
|
|
14
|
+
export type TelegramRequestFunction = (options: TelegramHttpRequestOptions, body: string, timeoutMs: number) => Promise<TelegramHttpResponse>;
|
|
15
|
+
export interface TelegramSendOptions {
|
|
16
|
+
botToken: string;
|
|
17
|
+
chatId: string;
|
|
18
|
+
text: string;
|
|
19
|
+
timeoutMs?: number;
|
|
20
|
+
}
|
|
21
|
+
export declare function sendTelegramMessage(options: TelegramSendOptions, request?: TelegramRequestFunction): Promise<void>;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futurewindai/wotchi",
|
|
3
|
-
"version": "0.1.0-beta.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-beta.2",
|
|
4
|
+
"description": "Bounded incident 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
|
+
],
|
|
5
16
|
"license": "Apache-2.0",
|
|
6
17
|
"type": "module",
|
|
7
18
|
"engines": {
|
|
@@ -23,17 +34,26 @@
|
|
|
23
34
|
"types": "./dist/types/index.d.ts",
|
|
24
35
|
"exports": {
|
|
25
36
|
".": {
|
|
26
|
-
"types":
|
|
37
|
+
"types": {
|
|
38
|
+
"import": "./dist/types/index.d.ts",
|
|
39
|
+
"require": "./dist/types-cjs/index.d.cts"
|
|
40
|
+
},
|
|
27
41
|
"import": "./dist/esm/index.js",
|
|
28
42
|
"require": "./dist/cjs/index.js"
|
|
29
43
|
},
|
|
30
44
|
"./express": {
|
|
31
|
-
"types":
|
|
45
|
+
"types": {
|
|
46
|
+
"import": "./dist/types/integrations/express/index.d.ts",
|
|
47
|
+
"require": "./dist/types-cjs/integrations/express/index.d.cts"
|
|
48
|
+
},
|
|
32
49
|
"import": "./dist/esm/integrations/express/index.js",
|
|
33
50
|
"require": "./dist/cjs/integrations/express/index.js"
|
|
34
51
|
},
|
|
35
52
|
"./nest": {
|
|
36
|
-
"types":
|
|
53
|
+
"types": {
|
|
54
|
+
"import": "./dist/types/integrations/nest/index.d.ts",
|
|
55
|
+
"require": "./dist/types-cjs/integrations/nest/index.d.cts"
|
|
56
|
+
},
|
|
37
57
|
"import": "./dist/esm/integrations/nest/index.js",
|
|
38
58
|
"require": "./dist/cjs/integrations/nest/index.js"
|
|
39
59
|
}
|
|
@@ -42,7 +62,7 @@
|
|
|
42
62
|
"type": "git",
|
|
43
63
|
"url": "git+ssh://git@github.com/FutureWindAI/Wotchi.git"
|
|
44
64
|
},
|
|
45
|
-
"homepage": "https://
|
|
65
|
+
"homepage": "https://www.npmjs.com/package/@futurewindai/wotchi",
|
|
46
66
|
"bugs": {
|
|
47
67
|
"url": "https://github.com/FutureWindAI/Wotchi/issues"
|
|
48
68
|
},
|