@checkstack/integration-backend 0.1.17 → 0.1.19

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/CHANGELOG.md CHANGED
@@ -1,5 +1,51 @@
1
1
  # @checkstack/integration-backend
2
2
 
3
+ ## 0.1.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [26d8bae]
8
+ - @checkstack/backend-api@0.12.0
9
+ - @checkstack/command-backend@0.1.19
10
+ - @checkstack/queue-api@0.2.13
11
+
12
+ ## 0.1.18
13
+
14
+ ### Patch Changes
15
+
16
+ - d1a2796: Enforce stricter code quality standards and eliminate AI slop anti-patterns.
17
+
18
+ **New utility**
19
+
20
+ - `extractErrorMessage(error, fallback?)` in `@checkstack/common` for consistent error extraction
21
+
22
+ **ESLint rules**
23
+
24
+ - `react-hooks/rules-of-hooks` and `exhaustive-deps` for hook correctness
25
+ - `no-console` in frontend packages — forces `toast` over silent `console.error`
26
+ - `no-restricted-syntax` banning `instanceof Error` — forces `extractErrorMessage`
27
+ - Custom `no-eslint-disable-any` rule preventing `@typescript-eslint/no-explicit-any` circumvention
28
+
29
+ **Refactoring**
30
+
31
+ - Replace 141 `instanceof Error` boilerplate patterns across the codebase
32
+ - Replace swallowed `console.error` with user-visible `toast.error()` feedback
33
+ - Remove 15 redundant `as` type casts in IntegrationsPage and ProviderConnectionsPage
34
+ - Consolidate 3 identical callback handlers into `handleDialogClose`
35
+ - Fix conditional React hook call in `FormField.tsx`
36
+ - Fix unstable useMemo deps in `Dashboard.tsx`
37
+ - Replace `useEffect`→`setState` with derived `useMemo` in `RegisterPage.tsx`
38
+ - Rewrite `keystore.test.ts` with typed `DrizzleMockChain` (eliminating 7 `any` suppressions)
39
+ - Delete obvious comments in `encryption.ts` and Teams `provider.ts`
40
+
41
+ - Updated dependencies [d1a2796]
42
+ - @checkstack/common@0.6.5
43
+ - @checkstack/backend-api@0.11.1
44
+ - @checkstack/command-backend@0.1.18
45
+ - @checkstack/integration-common@0.2.8
46
+ - @checkstack/signal-common@0.1.9
47
+ - @checkstack/queue-api@0.2.12
48
+
3
49
  ## 0.1.17
4
50
 
5
51
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/integration-backend",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "checkstack": {
@@ -14,12 +14,12 @@
14
14
  "test": "bun test"
15
15
  },
16
16
  "dependencies": {
17
- "@checkstack/integration-common": "0.2.7",
18
- "@checkstack/backend-api": "0.10.0",
19
- "@checkstack/signal-common": "0.1.8",
20
- "@checkstack/queue-api": "0.2.9",
21
- "@checkstack/common": "0.6.4",
22
- "@checkstack/command-backend": "0.1.15",
17
+ "@checkstack/integration-common": "0.2.8",
18
+ "@checkstack/backend-api": "0.11.1",
19
+ "@checkstack/signal-common": "0.1.9",
20
+ "@checkstack/queue-api": "0.2.12",
21
+ "@checkstack/common": "0.6.5",
22
+ "@checkstack/command-backend": "0.1.18",
23
23
  "drizzle-orm": "^0.45.0",
24
24
  "zod": "^4.2.1",
25
25
  "@orpc/server": "^1.13.2"
@@ -27,8 +27,8 @@
27
27
  "devDependencies": {
28
28
  "@checkstack/drizzle-helper": "0.0.4",
29
29
  "@checkstack/scripts": "0.1.2",
30
- "@checkstack/tsconfig": "0.0.4",
31
- "@checkstack/test-utils-backend": "0.1.15",
30
+ "@checkstack/tsconfig": "0.0.5",
31
+ "@checkstack/test-utils-backend": "0.1.18",
32
32
  "@types/node": "^20.0.0",
33
33
  "typescript": "^5.0.0"
34
34
  }
@@ -8,6 +8,7 @@ import type { IntegrationProviderRegistry } from "./provider-registry";
8
8
  import type { ConnectionStore } from "./connection-store";
9
9
  import * as schema from "./schema";
10
10
  import { INTEGRATION_DELIVERY_COMPLETED } from "@checkstack/integration-common";
11
+ import { extractErrorMessage } from "@checkstack/common";
11
12
 
12
13
  /**
13
14
  * Event payload for delivery routing
@@ -201,7 +202,7 @@ export function createDeliveryCoordinator(
201
202
  }
202
203
  } catch (error) {
203
204
  const errorMessage =
204
- error instanceof Error ? error.message : String(error);
205
+ extractErrorMessage(error);
205
206
 
206
207
  // Get current attempt count
207
208
  const [log] = await db
@@ -5,6 +5,7 @@ import type {
5
5
  import type { IntegrationEventRegistry } from "./event-registry";
6
6
  import type { DeliveryCoordinator } from "./delivery-coordinator";
7
7
  import type { RegisteredIntegrationEvent } from "./provider-types";
8
+ import { extractErrorMessage } from "@checkstack/common";
8
9
 
9
10
  /**
10
11
  * Hook subscription function type (matches env.onHook signature)
@@ -84,7 +85,7 @@ function subscribeToEvent(
84
85
  } catch (error) {
85
86
  logger.error(
86
87
  `Failed to route integration event ${event.eventId}:`,
87
- error instanceof Error ? error.message : String(error)
88
+ extractErrorMessage(error)
88
89
  );
89
90
  // Don't re-throw - we don't want to fail the entire hook chain
90
91
  // The event will be logged but not retried at the hook level
package/src/router.ts CHANGED
@@ -17,6 +17,7 @@ import {
17
17
  integrationContract,
18
18
  INTEGRATION_SUBSCRIPTION_CHANGED,
19
19
  } from "@checkstack/integration-common";
20
+ import { extractErrorMessage } from "@checkstack/common";
20
21
 
21
22
  /**
22
23
  * Recursively extracts flattened property paths from a JSON Schema.
@@ -430,7 +431,7 @@ export function createIntegrationRouter(deps: RouterDeps) {
430
431
  } catch (error) {
431
432
  return {
432
433
  success: false,
433
- message: error instanceof Error ? error.message : String(error),
434
+ message: extractErrorMessage(error),
434
435
  };
435
436
  }
436
437
  }
@@ -544,7 +545,7 @@ export function createIntegrationRouter(deps: RouterDeps) {
544
545
  } catch (error) {
545
546
  throw new ORPCError("NOT_FOUND", {
546
547
  message:
547
- error instanceof Error ? error.message : "Connection not found",
548
+ extractErrorMessage(error, "Connection not found"),
548
549
  });
549
550
  }
550
551
  }),
@@ -590,7 +591,7 @@ export function createIntegrationRouter(deps: RouterDeps) {
590
591
  } catch (error) {
591
592
  return {
592
593
  success: false,
593
- message: error instanceof Error ? error.message : String(error),
594
+ message: extractErrorMessage(error),
594
595
  };
595
596
  }
596
597
  }),
@@ -632,7 +633,7 @@ export function createIntegrationRouter(deps: RouterDeps) {
632
633
  logger.error(`Failed to get connection options: ${error}`);
633
634
  throw new ORPCError("INTERNAL_SERVER_ERROR", {
634
635
  message:
635
- error instanceof Error ? error.message : "Failed to fetch options",
636
+ extractErrorMessage(error, "Failed to fetch options"),
636
637
  });
637
638
  }
638
639
  }),