autotel-subscribers 59.0.0 → 59.0.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.
@@ -27,7 +27,7 @@ interface TestSuiteResult {
27
27
  * 3. Deals with errors gracefully
28
28
  * 4. Shuts down cleanly
29
29
  */
30
- declare class SubscriberTestHarness {
30
+ export declare class SubscriberTestHarness {
31
31
  private subscriber;
32
32
  constructor(subscriber: EventSubscriber);
33
33
  /**
@@ -93,7 +93,7 @@ interface MockServerOptions {
93
93
  *
94
94
  * Records all incoming requests so you can assert on them in tests.
95
95
  */
96
- declare class MockWebhookServer {
96
+ export declare class MockWebhookServer {
97
97
  private server?;
98
98
  private requests;
99
99
  private options;
@@ -151,4 +151,4 @@ declare class MockWebhookServer {
151
151
  private parseBody;
152
152
  }
153
153
  //#endregion
154
- export { MockEventSubscriber, type MockServerOptions, MockWebhookServer, type RecordedRequest, SubscriberTestHarness, type TestResult, type TestSuiteResult };
154
+ export { MockEventSubscriber, type MockServerOptions, type RecordedRequest, type TestResult, type TestSuiteResult };
package/dist/testing.d.ts CHANGED
@@ -27,7 +27,7 @@ interface TestSuiteResult {
27
27
  * 3. Deals with errors gracefully
28
28
  * 4. Shuts down cleanly
29
29
  */
30
- declare class SubscriberTestHarness {
30
+ export declare class SubscriberTestHarness {
31
31
  private subscriber;
32
32
  constructor(subscriber: EventSubscriber);
33
33
  /**
@@ -93,7 +93,7 @@ interface MockServerOptions {
93
93
  *
94
94
  * Records all incoming requests so you can assert on them in tests.
95
95
  */
96
- declare class MockWebhookServer {
96
+ export declare class MockWebhookServer {
97
97
  private server?;
98
98
  private requests;
99
99
  private options;
@@ -151,4 +151,4 @@ declare class MockWebhookServer {
151
151
  private parseBody;
152
152
  }
153
153
  //#endregion
154
- export { MockEventSubscriber, type MockServerOptions, MockWebhookServer, type RecordedRequest, SubscriberTestHarness, type TestResult, type TestSuiteResult };
154
+ export { MockEventSubscriber, type MockServerOptions, type RecordedRequest, type TestResult, type TestSuiteResult };
@@ -1,6 +1,6 @@
1
1
  import { EventAttributes, EventSubscriber, EventTrackingOptions, FunnelStatus, OutcomeStatus } from "autotel/event-subscriber";
2
2
  //#region src/webhook.d.ts
3
- interface WebhookConfig {
3
+ export interface WebhookConfig {
4
4
  url: string;
5
5
  headers?: Record<string, string>;
6
6
  enabled?: boolean;
@@ -9,7 +9,7 @@ interface WebhookConfig {
9
9
  timeoutMs?: number;
10
10
  retryDelayMs?: number;
11
11
  }
12
- declare class WebhookSubscriber implements EventSubscriber {
12
+ export declare class WebhookSubscriber implements EventSubscriber {
13
13
  readonly name = "WebhookSubscriber";
14
14
  readonly version = "1.1.0";
15
15
  private readonly config;
@@ -26,5 +26,4 @@ declare class WebhookSubscriber implements EventSubscriber {
26
26
  private trackRequest;
27
27
  shutdown(): Promise<void>;
28
28
  }
29
- //#endregion
30
- export { WebhookConfig, WebhookSubscriber };
29
+ //#endregion
package/dist/webhook.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { EventAttributes, EventSubscriber, EventTrackingOptions, FunnelStatus, OutcomeStatus } from "autotel/event-subscriber";
2
2
  //#region src/webhook.d.ts
3
- interface WebhookConfig {
3
+ export interface WebhookConfig {
4
4
  url: string;
5
5
  headers?: Record<string, string>;
6
6
  enabled?: boolean;
@@ -9,7 +9,7 @@ interface WebhookConfig {
9
9
  timeoutMs?: number;
10
10
  retryDelayMs?: number;
11
11
  }
12
- declare class WebhookSubscriber implements EventSubscriber {
12
+ export declare class WebhookSubscriber implements EventSubscriber {
13
13
  readonly name = "WebhookSubscriber";
14
14
  readonly version = "1.1.0";
15
15
  private readonly config;
@@ -26,5 +26,4 @@ declare class WebhookSubscriber implements EventSubscriber {
26
26
  private trackRequest;
27
27
  shutdown(): Promise<void>;
28
28
  }
29
- //#endregion
30
- export { WebhookConfig, WebhookSubscriber };
29
+ //#endregion
@@ -18,6 +18,7 @@
18
18
  import { Event } from 'autotel/event';
19
19
  import { PostHogSubscriber } from 'autotel-posthog/subscriber';
20
20
  import { PostHog } from 'posthog-node';
21
+ import { pathToFileURL } from 'node:url';
21
22
 
22
23
  // ============================================================================
23
24
  // Example 1: Basic Event Tracking
@@ -424,7 +425,10 @@ async function main() {
424
425
  }
425
426
 
426
427
  // Run if this file is executed directly
427
- if (require.main === module) {
428
+ if (
429
+ process.argv[1] &&
430
+ import.meta.url === pathToFileURL(process.argv[1]).href
431
+ ) {
428
432
  main().catch(console.error);
429
433
  }
430
434
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "autotel-subscribers",
3
- "version": "59.0.0",
3
+ "version": "59.0.2",
4
4
  "description": "Write Once, Observe Anywhere - Event subscribers for autotel (Mixpanel, Amplitude, Segment, Slack, webhooks, Loki, file)",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -108,7 +108,7 @@
108
108
  "slow-redact": "^0.3.2"
109
109
  },
110
110
  "peerDependencies": {
111
- "autotel": "7.9.0"
111
+ "autotel": "7.10.1"
112
112
  },
113
113
  "peerDependenciesMeta": {
114
114
  "posthog-node": {
@@ -125,27 +125,22 @@
125
125
  }
126
126
  },
127
127
  "devDependencies": {
128
- "@amplitude/analytics-node": "^1.5.69",
128
+ "@amplitude/analytics-node": "^1.5.75",
129
129
  "@arethetypeswrong/cli": "^0.18.5",
130
- "@cloudflare/workers-types": "^5.20260728.1",
131
- "@prisma/client": "^7.9.1",
130
+ "@cloudflare/workers-types": "^5.20260928.1",
131
+ "@prisma/client": "^7.10.0",
132
132
  "@segment/analytics-node": "^3.1.0",
133
- "@types/node": "^26.1.2",
134
- "@typescript-eslint/eslint-plugin": "^8.65.0",
135
- "@typescript-eslint/parser": "^8.65.0",
136
- "autotel": "7.9.0",
137
- "drizzle-orm": "^0.45.2",
138
- "eslint-config-prettier": "^10.1.8",
139
- "eslint-plugin-unicorn": "^64.0.0",
140
- "mixpanel": "^0.22.0",
141
- "mongoose": "^9.8.1",
142
- "posthog-node": "^5.46.1",
143
- "prettier": "^3.9.6",
133
+ "@types/node": "^26.6.3",
134
+ "autotel": "7.10.1",
135
+ "drizzle-orm": "^0.45.3",
136
+ "mixpanel": "^0.24.0",
137
+ "mongoose": "^9.10.2",
138
+ "posthog-node": "^5.54.1",
139
+ "prettier": "^3.9.9",
144
140
  "rimraf": "^6.1.3",
145
- "tsdown": "^0.22.14",
146
- "typescript": "^6.0.3",
147
- "typescript-eslint": "^8.65.0",
148
- "vitest": "^4.1.10"
141
+ "tsdown": "^0.23.0",
142
+ "typescript": "^7.0.2",
143
+ "vitest": "^5.0.2"
149
144
  },
150
145
  "repository": {
151
146
  "type": "git",
@@ -158,8 +153,8 @@
158
153
  "scripts": {
159
154
  "build": "tsdown",
160
155
  "dev": "tsdown --watch",
161
- "lint": "eslint 'src/**/*.ts' 'examples/**/*.ts'",
162
- "lint:fix": "eslint 'src/**/*.ts' 'examples/**/*.ts' --fix",
156
+ "lint": "oxlint -c oxlint.json --disable-nested-config src examples",
157
+ "lint:fix": "pnpm lint --fix",
163
158
  "type-check": "tsc --noEmit",
164
159
  "test": "vitest run",
165
160
  "test:watch": "vitest"