@sudobility/testomniac_lib 0.0.43 → 0.0.44

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.
@@ -1,5 +1,5 @@
1
1
  import type { NetworkClient } from '@sudobility/types';
2
- import type { ProjectSummaryResponse } from '@sudobility/testomniac_types';
2
+ import type { ProductSummaryResponse } from '@sudobility/testomniac_types';
3
3
  import type { FirebaseIdToken } from '@sudobility/testomniac_client';
4
4
  interface UseDashboardManagerConfig {
5
5
  networkClient: NetworkClient;
@@ -9,10 +9,10 @@ interface UseDashboardManagerConfig {
9
9
  enabled?: boolean;
10
10
  }
11
11
  export declare function useDashboardManager(config: UseDashboardManagerConfig): {
12
- projects: ProjectSummaryResponse[];
12
+ products: ProductSummaryResponse[];
13
13
  isLoading: boolean;
14
14
  error: Error | null;
15
- refetchProjects: () => Promise<void>;
15
+ refetchProducts: () => Promise<void>;
16
16
  };
17
17
  export {};
18
18
  //# sourceMappingURL=useDashboardManager.d.ts.map
@@ -2,21 +2,21 @@ import { useCallback, useEffect, useMemo, useState } from 'react';
2
2
  import { TestomniacClient } from '@sudobility/testomniac_client';
3
3
  export function useDashboardManager(config) {
4
4
  const { networkClient, baseUrl, entitySlug, token, enabled = true } = config;
5
- const [projects, setProjects] = useState([]);
5
+ const [products, setProducts] = useState([]);
6
6
  const [isLoading, setIsLoading] = useState(false);
7
7
  const [error, setError] = useState(null);
8
8
  const client = useMemo(() => new TestomniacClient({ networkClient, baseUrl }), [networkClient, baseUrl]);
9
- const fetchProjects = useCallback(async () => {
9
+ const fetchProducts = useCallback(async () => {
10
10
  setIsLoading(true);
11
11
  setError(null);
12
12
  try {
13
- const response = await client.getEntityProjects(entitySlug, token);
13
+ const response = await client.getEntityProducts(entitySlug, token);
14
14
  if (response.success && response.data) {
15
- setProjects(response.data);
15
+ setProducts(response.data);
16
16
  }
17
17
  }
18
18
  catch (err) {
19
- setError(err instanceof Error ? err : new Error('Failed to fetch projects'));
19
+ setError(err instanceof Error ? err : new Error('Failed to fetch products'));
20
20
  }
21
21
  finally {
22
22
  setIsLoading(false);
@@ -24,14 +24,14 @@ export function useDashboardManager(config) {
24
24
  }, [client, entitySlug, token]);
25
25
  useEffect(() => {
26
26
  if (enabled) {
27
- void fetchProjects();
27
+ void fetchProducts();
28
28
  }
29
- }, [enabled, fetchProjects]);
29
+ }, [enabled, fetchProducts]);
30
30
  return {
31
- projects,
31
+ products,
32
32
  isLoading,
33
33
  error,
34
- refetchProjects: fetchProjects,
34
+ refetchProducts: fetchProducts,
35
35
  };
36
36
  }
37
37
  //# sourceMappingURL=useDashboardManager.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sudobility/testomniac_lib",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "Testomniac business logic library with Zustand stores",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -42,8 +42,8 @@
42
42
  },
43
43
  "devDependencies": {
44
44
  "@eslint/js": "^9.38.0",
45
- "@sudobility/testomniac_client": "^0.0.43",
46
- "@sudobility/testomniac_types": "^0.0.37",
45
+ "@sudobility/testomniac_client": "^0.0.44",
46
+ "@sudobility/testomniac_types": "^0.0.38",
47
47
  "@sudobility/types": "^1.9.61",
48
48
  "@tanstack/react-query": "^5.90.5",
49
49
  "@testing-library/react": "^16.3.2",