@withwiz/toolkit 0.1.1 → 0.1.3

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024-2025 WithWiz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -1,6 +1,22 @@
1
1
  import {
2
2
  TokenGenerator
3
3
  } from "../chunk-GDWEDUHO.js";
4
+ import {
5
+ JWTClientManager,
6
+ clearStoredTokens,
7
+ clearTokens,
8
+ createApiHeaders,
9
+ createAuthHeader,
10
+ decodeJWTPayload,
11
+ extractUserFromToken,
12
+ getStoredTokens,
13
+ getTokenExpirationString,
14
+ getTokenIssuedAtString,
15
+ getTokenRemainingTime,
16
+ isTokenExpired,
17
+ isTokenExpiringSoon,
18
+ storeTokens
19
+ } from "../chunk-XRRPEBKB.js";
4
20
  import {
5
21
  OAuthManager
6
22
  } from "../chunk-V5K5FYU7.js";
@@ -19,22 +35,6 @@ import {
19
35
  defaultPasswordSchema,
20
36
  strongPasswordSchema
21
37
  } from "../chunk-IHXRF3BH.js";
22
- import {
23
- JWTClientManager,
24
- clearStoredTokens,
25
- clearTokens,
26
- createApiHeaders,
27
- createAuthHeader,
28
- decodeJWTPayload,
29
- extractUserFromToken,
30
- getStoredTokens,
31
- getTokenExpirationString,
32
- getTokenIssuedAtString,
33
- getTokenRemainingTime,
34
- isTokenExpired,
35
- isTokenExpiringSoon,
36
- storeTokens
37
- } from "../chunk-XRRPEBKB.js";
38
38
  import {
39
39
  OAuthProvider,
40
40
  PasswordStrength,
@@ -1,3 +1,29 @@
1
+ import "../chunk-ULF5RDDX.js";
2
+ import {
3
+ withRetry
4
+ } from "../chunk-A6EAAWMK.js";
5
+ import {
6
+ CircuitBreaker,
7
+ ECircuitState
8
+ } from "../chunk-7VJNLGAS.js";
9
+ import {
10
+ FeatureDegradation
11
+ } from "../chunk-TEIYA7U4.js";
12
+ import {
13
+ withFallback,
14
+ withFallbackChain,
15
+ withFallbackFn
16
+ } from "../chunk-MYLGYX4K.js";
17
+ import {
18
+ EmptyState,
19
+ ErrorAlert,
20
+ ErrorPage,
21
+ LoadingState
22
+ } from "../chunk-ZHVUK5OY.js";
23
+ import "../chunk-Y2TUZFCP.js";
24
+ import {
25
+ useErrorHandler
26
+ } from "../chunk-IAJNC34M.js";
1
27
  import "../chunk-7XFHGAJP.js";
2
28
  import "../chunk-COK4ZXNG.js";
3
29
  import {
@@ -21,32 +47,6 @@ import {
21
47
  import {
22
48
  ELogLevel
23
49
  } from "../chunk-6C7HQIX4.js";
24
- import "../chunk-ULF5RDDX.js";
25
- import {
26
- withRetry
27
- } from "../chunk-A6EAAWMK.js";
28
- import {
29
- EmptyState,
30
- ErrorAlert,
31
- ErrorPage,
32
- LoadingState
33
- } from "../chunk-ZHVUK5OY.js";
34
- import "../chunk-Y2TUZFCP.js";
35
- import {
36
- useErrorHandler
37
- } from "../chunk-IAJNC34M.js";
38
- import {
39
- CircuitBreaker,
40
- ECircuitState
41
- } from "../chunk-7VJNLGAS.js";
42
- import {
43
- FeatureDegradation
44
- } from "../chunk-TEIYA7U4.js";
45
- import {
46
- withFallback,
47
- withFallbackChain,
48
- withFallbackFn
49
- } from "../chunk-MYLGYX4K.js";
50
50
  import {
51
51
  LocaleDetector
52
52
  } from "../chunk-XHZ5L4FO.js";
@@ -34,6 +34,20 @@ import {
34
34
  isValidJSON,
35
35
  isValidUrl
36
36
  } from "../chunk-EUQATJLI.js";
37
+ import {
38
+ createPaginatedResponse,
39
+ getReferer,
40
+ getSearchParam,
41
+ getUserAgent,
42
+ parseBooleanParam,
43
+ parseFilters,
44
+ parseNumberParam,
45
+ parsePagination,
46
+ parseRequestBody,
47
+ parseSort,
48
+ requireAdmin,
49
+ validateAndParse
50
+ } from "../chunk-2KAPUVIS.js";
37
51
  import {
38
52
  getAllowedOrigins,
39
53
  getCorsConfig,
@@ -67,20 +81,6 @@ import {
67
81
  throwValidationError,
68
82
  withErrorHandling
69
83
  } from "../chunk-XPASCCUA.js";
70
- import {
71
- createPaginatedResponse,
72
- getReferer,
73
- getSearchParam,
74
- getUserAgent,
75
- parseBooleanParam,
76
- parseFilters,
77
- parseNumberParam,
78
- parsePagination,
79
- parseRequestBody,
80
- parseSort,
81
- requireAdmin,
82
- validateAndParse
83
- } from "../chunk-2KAPUVIS.js";
84
84
  import "../chunk-MLGO3HLS.js";
85
85
  import "../chunk-Y3OTJH2S.js";
86
86
  import "../chunk-EZR55KV2.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@withwiz/toolkit",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Shared utility library for withwiz projects",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -28,6 +28,7 @@
28
28
  "./cache/cache-invalidation": "./dist/cache/cache-invalidation.js",
29
29
  "./cache/cache-defaults": "./dist/cache/cache-defaults.js",
30
30
  "./cache/cache-env": "./dist/cache/cache-env.js",
31
+ "./cache/hybrid-cache-manager": "./dist/cache/hybrid-cache-manager.js",
31
32
  "./components/ui/*": "./dist/components/ui/*.js",
32
33
  "./constants": "./dist/constants/index.js",
33
34
  "./constants/error-codes": "./dist/constants/error-codes.js",
@@ -57,6 +58,7 @@
57
58
  "./storage": "./dist/storage/r2-storage.js",
58
59
  "./storage/r2-storage": "./dist/storage/r2-storage.js",
59
60
  "./system": "./dist/system/index.js",
61
+ "./system/types": "./dist/system/types.js",
60
62
  "./system/health-check": "./dist/system/health-check.js",
61
63
  "./types/i18n": "./dist/types/i18n.js",
62
64
  "./types/api": "./dist/types/api.js",
@@ -90,11 +92,14 @@
90
92
  "build": "tsup && tsc --emitDeclarationOnly --skipLibCheck",
91
93
  "build:js": "tsup",
92
94
  "build:types": "tsc --emitDeclarationOnly --skipLibCheck",
93
- "test": "vitest run --project shared",
94
- "test:watch": "vitest --project shared",
95
- "test:coverage": "vitest run --project shared --coverage",
96
- "test:unit": "vitest run --project shared",
97
- "test:integration": "vitest run --project shared"
95
+ "test": "vitest run -c __tests__/vitest.config.ts",
96
+ "test:watch": "vitest -c __tests__/vitest.config.ts",
97
+ "test:coverage": "vitest run -c __tests__/vitest.config.ts --project shared --coverage",
98
+ "test:unit": "vitest run -c __tests__/vitest.config.ts __tests__/unit",
99
+ "test:integration": "vitest run -c __tests__/vitest.config.ts __tests__/integration",
100
+ "test:security": "vitest run -c __tests__/vitest.config.ts __tests__/security",
101
+ "test:performance": "vitest run -c __tests__/vitest.config.ts __tests__/performance",
102
+ "test:accessibility": "vitest run -c __tests__/vitest.config.ts __tests__/accessibility"
98
103
  },
99
104
  "dependencies": {
100
105
  "@aws-sdk/client-s3": "^3.988.0",
@@ -118,13 +123,19 @@
118
123
  "@nivo/core": "^0.99.0",
119
124
  "@nivo/geo": "^0.99.0",
120
125
  "@radix-ui/react-select": "^2.2.6",
126
+ "@testing-library/react": "^16.3.2",
127
+ "@testing-library/user-event": "^14.5.1",
121
128
  "@types/bcryptjs": "^3.0.0",
122
129
  "@types/node": "^20",
123
130
  "@types/react": "19.2.7",
124
131
  "@types/react-dom": "19.2.3",
132
+ "@vitest/coverage-v8": "^4.0.18",
133
+ "@vitest/ui": "^4.0.18",
125
134
  "date-fns": "^4.1.0",
135
+ "jsdom": "^24.1.0",
126
136
  "next": "15",
127
137
  "tsup": "^8.0.0",
128
- "typescript": "^5"
138
+ "typescript": "^5",
139
+ "vitest": "^4.0.18"
129
140
  }
130
141
  }