@sudobility/testomniac_lib 0.0.11 → 0.0.12
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/README.md +66 -0
- package/package.json +5 -5
package/README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# @sudobility/testomniac_lib
|
|
2
|
+
|
|
3
|
+
Business logic library with Zustand stores for the Testomniac AI-powered automated UI testing platform.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add @sudobility/testomniac_lib
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { useHistoriesManager } from "@sudobility/testomniac_lib";
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
histories,
|
|
18
|
+
total,
|
|
19
|
+
percentage,
|
|
20
|
+
isLoading,
|
|
21
|
+
createHistory,
|
|
22
|
+
updateHistory,
|
|
23
|
+
deleteHistory,
|
|
24
|
+
} = useHistoriesManager({
|
|
25
|
+
baseUrl: "http://localhost:8022",
|
|
26
|
+
networkClient,
|
|
27
|
+
userId: "firebase-uid",
|
|
28
|
+
token,
|
|
29
|
+
autoFetch: true,
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## API
|
|
34
|
+
|
|
35
|
+
### useHistoriesManager
|
|
36
|
+
|
|
37
|
+
Unified hook combining API client hooks + Zustand store + business logic:
|
|
38
|
+
|
|
39
|
+
- Percentage calculation: `(userSum / globalTotal) * 100`
|
|
40
|
+
- Per-user cache isolation via Zustand store
|
|
41
|
+
- Auto-fetch on mount (configurable)
|
|
42
|
+
- Token reactivity (resets state on user change)
|
|
43
|
+
|
|
44
|
+
### useHistoriesStore
|
|
45
|
+
|
|
46
|
+
Zustand store with per-user client-side cache. Operations: `set`, `get`, `add`, `update`, `remove`.
|
|
47
|
+
|
|
48
|
+
## Development
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bun run build # Build ESM
|
|
52
|
+
bun test # Run tests
|
|
53
|
+
bun run verify # All checks + build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Related Packages
|
|
57
|
+
|
|
58
|
+
- `testomniac_types` -- Shared type definitions
|
|
59
|
+
- `testomniac_client` -- API client SDK
|
|
60
|
+
- `testomniac_api` -- Backend API server
|
|
61
|
+
- `testomniac_app` -- Web app consumer
|
|
62
|
+
- `testomniac_app_rn` -- React Native app consumer
|
|
63
|
+
|
|
64
|
+
## License
|
|
65
|
+
|
|
66
|
+
BUSL-1.1
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/testomniac_lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Business logic library for Starter with Zustand stores",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
"author": "Sudobility",
|
|
36
36
|
"license": "BUSL-1.1",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@sudobility/types": "^1.9.
|
|
38
|
+
"@sudobility/types": "^1.9.57",
|
|
39
39
|
"@tanstack/react-query": ">=5.0.0",
|
|
40
40
|
"react": ">=18.0.0",
|
|
41
41
|
"zustand": ">=5.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@eslint/js": "^9.38.0",
|
|
45
|
-
"@sudobility/testomniac_client": "^0.0.
|
|
46
|
-
"@sudobility/testomniac_types": "^0.0.
|
|
47
|
-
"@sudobility/types": "^1.9.
|
|
45
|
+
"@sudobility/testomniac_client": "^0.0.14",
|
|
46
|
+
"@sudobility/testomniac_types": "^0.0.9",
|
|
47
|
+
"@sudobility/types": "^1.9.57",
|
|
48
48
|
"@tanstack/react-query": "^5.90.5",
|
|
49
49
|
"@testing-library/react": "^16.3.2",
|
|
50
50
|
"@testing-library/react-hooks": "^8.0.1",
|