@checkstack/integration-webex-backend 0.0.22 → 0.0.24

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,47 @@
1
1
  # @checkstack/integration-webex-backend
2
2
 
3
+ ## 0.0.24
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [26d8bae]
8
+ - @checkstack/backend-api@0.12.0
9
+ - @checkstack/integration-backend@0.1.19
10
+
11
+ ## 0.0.23
12
+
13
+ ### Patch Changes
14
+
15
+ - d1a2796: Enforce stricter code quality standards and eliminate AI slop anti-patterns.
16
+
17
+ **New utility**
18
+
19
+ - `extractErrorMessage(error, fallback?)` in `@checkstack/common` for consistent error extraction
20
+
21
+ **ESLint rules**
22
+
23
+ - `react-hooks/rules-of-hooks` and `exhaustive-deps` for hook correctness
24
+ - `no-console` in frontend packages — forces `toast` over silent `console.error`
25
+ - `no-restricted-syntax` banning `instanceof Error` — forces `extractErrorMessage`
26
+ - Custom `no-eslint-disable-any` rule preventing `@typescript-eslint/no-explicit-any` circumvention
27
+
28
+ **Refactoring**
29
+
30
+ - Replace 141 `instanceof Error` boilerplate patterns across the codebase
31
+ - Replace swallowed `console.error` with user-visible `toast.error()` feedback
32
+ - Remove 15 redundant `as` type casts in IntegrationsPage and ProviderConnectionsPage
33
+ - Consolidate 3 identical callback handlers into `handleDialogClose`
34
+ - Fix conditional React hook call in `FormField.tsx`
35
+ - Fix unstable useMemo deps in `Dashboard.tsx`
36
+ - Replace `useEffect`→`setState` with derived `useMemo` in `RegisterPage.tsx`
37
+ - Rewrite `keystore.test.ts` with typed `DrizzleMockChain` (eliminating 7 `any` suppressions)
38
+ - Delete obvious comments in `encryption.ts` and Teams `provider.ts`
39
+
40
+ - Updated dependencies [d1a2796]
41
+ - @checkstack/common@0.6.5
42
+ - @checkstack/backend-api@0.11.1
43
+ - @checkstack/integration-backend@0.1.18
44
+
3
45
  ## 0.0.22
4
46
 
5
47
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checkstack/integration-webex-backend",
3
- "version": "0.0.22",
3
+ "version": "0.0.24",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
6
6
  "checkstack": {
@@ -12,14 +12,14 @@
12
12
  "lint:code": "eslint . --max-warnings 0"
13
13
  },
14
14
  "dependencies": {
15
- "@checkstack/backend-api": "0.10.0",
16
- "@checkstack/integration-backend": "0.1.15",
17
- "@checkstack/common": "0.6.4",
15
+ "@checkstack/backend-api": "0.11.1",
16
+ "@checkstack/integration-backend": "0.1.18",
17
+ "@checkstack/common": "0.6.5",
18
18
  "zod": "^4.2.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/bun": "^1.0.0",
22
22
  "typescript": "^5.0.0",
23
- "@checkstack/tsconfig": "0.0.4"
23
+ "@checkstack/tsconfig": "0.0.5"
24
24
  }
25
25
  }
@@ -153,13 +153,23 @@ describe("Webex Integration Provider", () => {
153
153
  });
154
154
 
155
155
  it("returns failure for invalid config", async () => {
156
- // Pass config with empty botToken - passes validation but fails API call
157
- const result = await webexProvider.testConnection!({
158
- botToken: "",
159
- });
156
+ // Explicitly mock fetch to simulate network error for empty token
157
+ const mockFetch = spyOn(globalThis, "fetch").mockImplementation(
158
+ (async () => {
159
+ throw new TypeError("fetch failed");
160
+ }) as unknown as typeof fetch
161
+ );
160
162
 
161
- expect(result.success).toBe(false);
162
- expect(result.message).toContain("failed");
163
+ try {
164
+ const result = await webexProvider.testConnection!({
165
+ botToken: "",
166
+ });
167
+
168
+ expect(result.success).toBe(false);
169
+ expect(result.message).toContain("failed");
170
+ } finally {
171
+ mockFetch.mockRestore();
172
+ }
163
173
  });
164
174
  });
165
175
 
package/src/provider.ts CHANGED
@@ -8,6 +8,7 @@ import type {
8
8
  ConnectionOption,
9
9
  TestConnectionResult,
10
10
  } from "@checkstack/integration-backend";
11
+ import { extractErrorMessage } from "@checkstack/common";
11
12
 
12
13
  // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
14
  // Resolver Names
@@ -96,7 +97,7 @@ async function fetchWebexRooms(
96
97
  const data = (await response.json()) as WebexRoomsResponse;
97
98
  return { success: true, rooms: data.items ?? [] };
98
99
  } catch (error) {
99
- const message = error instanceof Error ? error.message : "Unknown error";
100
+ const message = extractErrorMessage(error, "Unknown error");
100
101
  return { success: false, error: message };
101
102
  }
102
103
  }
@@ -136,7 +137,7 @@ async function sendWebexMessage(params: {
136
137
  const data = (await response.json()) as WebexMessageResponse;
137
138
  return { success: true, messageId: data.id };
138
139
  } catch (error) {
139
- const message = error instanceof Error ? error.message : "Unknown error";
140
+ const message = extractErrorMessage(error, "Unknown error");
140
141
  return { success: false, error: message };
141
142
  }
142
143
  }
@@ -161,7 +162,7 @@ async function testWebexConnection(
161
162
  const data = (await response.json()) as WebexMeResponse;
162
163
  return { success: true, botName: data.displayName };
163
164
  } catch (error) {
164
- const message = error instanceof Error ? error.message : "Unknown error";
165
+ const message = extractErrorMessage(error, "Unknown error");
165
166
  return { success: false, error: message };
166
167
  }
167
168
  }
@@ -298,7 +299,7 @@ export const webexProvider: IntegrationProvider<
298
299
  };
299
300
  } catch (error) {
300
301
  const message =
301
- error instanceof Error ? error.message : "Invalid configuration";
302
+ extractErrorMessage(error, "Invalid configuration");
302
303
  return {
303
304
  success: false,
304
305
  message: `Validation failed: ${message}`,