@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.
Files changed (101) hide show
  1. package/README.md +182 -56
  2. package/SECURITY.md +2 -2
  3. package/dist/cjs/core/client.js +380 -21
  4. package/dist/cjs/core/config.js +177 -18
  5. package/dist/cjs/core/diagnostics.js +12 -1
  6. package/dist/cjs/core/group-store.js +15 -1
  7. package/dist/cjs/core/incident-builder.js +18 -0
  8. package/dist/cjs/core/incident-policy.js +2 -7
  9. package/dist/cjs/core/limits.js +13 -0
  10. package/dist/cjs/core/normalize.js +10 -5
  11. package/dist/cjs/core/notification-queue.js +20 -3
  12. package/dist/cjs/core/redact.js +83 -8
  13. package/dist/cjs/index.js +3 -1
  14. package/dist/cjs/integrations/express/error-handler.js +4 -1
  15. package/dist/cjs/integrations/express/index.js +4 -1
  16. package/dist/cjs/integrations/express/state.js +30 -0
  17. package/dist/cjs/integrations/express/status-observer.js +86 -0
  18. package/dist/cjs/integrations/nest/exception-filter.js +9 -1
  19. package/dist/cjs/integrations/nest/index.js +3 -1
  20. package/dist/cjs/integrations/nest/register.js +9 -0
  21. package/dist/cjs/integrations/request-context.js +83 -1
  22. package/dist/cjs/notifiers/alert-payload.js +20 -0
  23. package/dist/cjs/notifiers/console.js +100 -10
  24. package/dist/cjs/notifiers/telegram-format.js +75 -5
  25. package/dist/cjs/notifiers/webhook-http.js +394 -0
  26. package/dist/cjs/notifiers/webhook.js +28 -0
  27. package/dist/esm/core/client.js +380 -21
  28. package/dist/esm/core/config.js +177 -18
  29. package/dist/esm/core/diagnostics.js +12 -1
  30. package/dist/esm/core/group-store.js +15 -1
  31. package/dist/esm/core/incident-builder.js +18 -0
  32. package/dist/esm/core/incident-policy.js +2 -7
  33. package/dist/esm/core/limits.js +10 -0
  34. package/dist/esm/core/normalize.js +10 -5
  35. package/dist/esm/core/notification-queue.js +20 -3
  36. package/dist/esm/core/redact.js +83 -8
  37. package/dist/esm/index.js +2 -1
  38. package/dist/esm/integrations/express/error-handler.js +4 -1
  39. package/dist/esm/integrations/express/index.js +2 -1
  40. package/dist/esm/integrations/express/state.js +26 -0
  41. package/dist/esm/integrations/express/status-observer.js +83 -0
  42. package/dist/esm/integrations/nest/exception-filter.js +9 -1
  43. package/dist/esm/integrations/nest/index.js +2 -2
  44. package/dist/esm/integrations/nest/register.js +8 -0
  45. package/dist/esm/integrations/request-context.js +83 -1
  46. package/dist/esm/notifiers/alert-payload.js +16 -0
  47. package/dist/esm/notifiers/console.js +100 -10
  48. package/dist/esm/notifiers/telegram-format.js +75 -5
  49. package/dist/esm/notifiers/webhook-http.js +387 -0
  50. package/dist/esm/notifiers/webhook.js +24 -0
  51. package/dist/types/core/config.d.ts +7 -1
  52. package/dist/types/core/diagnostics.d.ts +5 -1
  53. package/dist/types/core/limits.d.ts +10 -0
  54. package/dist/types/core/notification-queue.d.ts +5 -1
  55. package/dist/types/core/types.d.ts +97 -1
  56. package/dist/types/index.d.ts +4 -2
  57. package/dist/types/integrations/express/index.d.ts +4 -2
  58. package/dist/types/integrations/express/state.d.ts +2 -0
  59. package/dist/types/integrations/express/status-observer.d.ts +11 -0
  60. package/dist/types/integrations/nest/index.d.ts +4 -3
  61. package/dist/types/integrations/nest/register.d.ts +3 -0
  62. package/dist/types/integrations/request-context.d.ts +3 -0
  63. package/dist/types/notifiers/alert-payload.d.ts +5 -0
  64. package/dist/types/notifiers/console.d.ts +1 -1
  65. package/dist/types/notifiers/webhook-http.d.ts +37 -0
  66. package/dist/types/notifiers/webhook.d.ts +4 -0
  67. package/dist/types-cjs/core/client.d.cts +2 -0
  68. package/dist/types-cjs/core/config.d.cts +35 -0
  69. package/dist/types-cjs/core/diagnostics.d.cts +11 -0
  70. package/dist/types-cjs/core/errors.d.cts +3 -0
  71. package/dist/types-cjs/core/fingerprint.d.cts +3 -0
  72. package/dist/types-cjs/core/group-store.d.cts +15 -0
  73. package/dist/types-cjs/core/incident-builder.d.cts +3 -0
  74. package/dist/types-cjs/core/incident-policy.d.cts +15 -0
  75. package/dist/types-cjs/core/limits.d.cts +10 -0
  76. package/dist/types-cjs/core/normalize.d.cts +17 -0
  77. package/dist/types-cjs/core/notification-queue.d.cts +20 -0
  78. package/dist/types-cjs/core/process-monitor.d.cts +5 -0
  79. package/dist/types-cjs/core/redact.d.cts +11 -0
  80. package/dist/types-cjs/core/rolling-window.d.cts +12 -0
  81. package/dist/types-cjs/core/stack-frame.d.cts +2 -0
  82. package/dist/types-cjs/core/types.d.cts +205 -0
  83. package/dist/types-cjs/index.d.cts +11 -0
  84. package/dist/types-cjs/integrations/express/error-handler.d.cts +4 -0
  85. package/dist/types-cjs/integrations/express/index.d.cts +9 -0
  86. package/dist/types-cjs/integrations/express/request-context.d.cts +5 -0
  87. package/dist/types-cjs/integrations/express/state.d.cts +2 -0
  88. package/dist/types-cjs/integrations/express/status-observer.d.cts +11 -0
  89. package/dist/types-cjs/integrations/nest/exception-filter.d.cts +10 -0
  90. package/dist/types-cjs/integrations/nest/index.d.cts +5 -0
  91. package/dist/types-cjs/integrations/nest/register.d.cts +13 -0
  92. package/dist/types-cjs/integrations/nest/request-context.d.cts +5 -0
  93. package/dist/types-cjs/integrations/request-context.d.cts +16 -0
  94. package/dist/types-cjs/notifiers/alert-payload.d.cts +5 -0
  95. package/dist/types-cjs/notifiers/console.d.cts +3 -0
  96. package/dist/types-cjs/notifiers/telegram-format.d.cts +2 -0
  97. package/dist/types-cjs/notifiers/telegram-http.d.cts +21 -0
  98. package/dist/types-cjs/notifiers/telegram.d.cts +4 -0
  99. package/dist/types-cjs/notifiers/webhook-http.d.cts +37 -0
  100. package/dist/types-cjs/notifiers/webhook.d.cts +4 -0
  101. 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.1",
4
- "description": "Lightweight incident alerts for Node.js, Express, and NestJS applications",
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": "./dist/types/index.d.ts",
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": "./dist/types/integrations/express/index.d.ts",
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": "./dist/types/integrations/nest/index.d.ts",
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#readme",
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 .",