@withwiz/toolkit 0.2.1 → 0.2.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/dist/auth/index.js +18 -18
- package/dist/{chunk-6JZQE7ZQ.js → chunk-GSUQE3SZ.js} +8 -8
- package/dist/{chunk-FH6E36YZ.js → chunk-SLG26KHZ.js} +1 -1
- package/dist/components/ui/DataTable.js +6 -6
- package/dist/components/ui/data-table/DataTable.js +6 -6
- package/dist/components/ui/data-table/DataTableFilters.js +2 -2
- package/dist/components/ui/data-table/DataTableSearch.js +2 -2
- package/dist/constants/index.js +13 -13
- package/dist/error/index.d.ts +0 -4
- package/dist/error/index.js +12 -80
- package/dist/geolocation/index.js +4 -4
- package/dist/geolocation/providers/index.js +4 -4
- package/dist/middleware/error-handler.js +2 -2
- package/dist/middleware/index.js +3 -3
- package/dist/middleware/wrappers.js +3 -3
- package/dist/utils/format-number.js +30 -4
- package/dist/utils/input-validation.js +4 -4
- package/dist/utils/short-code-generator.js +36 -4
- package/dist/utils/url-normalizer.js +194 -10
- package/package.json +1 -2
- package/dist/chunk-5ATB5D6S.js +0 -40
- package/dist/chunk-6C7HQIX4.js +0 -13
- package/dist/chunk-6UAYU5NU.js +0 -102
- package/dist/chunk-7VJNLGAS.js +0 -110
- package/dist/chunk-7XFHGAJP.js +0 -0
- package/dist/chunk-A6EAAWMK.js +0 -50
- package/dist/chunk-COK4ZXNG.js +0 -0
- package/dist/chunk-EQYTE7WD.js +0 -139
- package/dist/chunk-FW3IEJ7H.js +0 -71
- package/dist/chunk-HGC4CCKB.js +0 -29
- package/dist/chunk-JS5VI3OW.js +0 -143
- package/dist/chunk-MYLGYX4K.js +0 -57
- package/dist/chunk-TDZJ6SAI.js +0 -34
- package/dist/chunk-TEIYA7U4.js +0 -72
- package/dist/chunk-ULF5RDDX.js +0 -0
- package/dist/chunk-VWODEQ5C.js +0 -204
- package/dist/chunk-Y2TUZFCP.js +0 -0
- package/dist/chunk-YJ3TLEW3.js +0 -100
- package/dist/chunk-ZHVUK5OY.js +0 -314
- package/dist/chunk-ZZIKRBJU.js +0 -96
- package/dist/error/components/EmptyState.d.ts +0 -50
- package/dist/error/components/ErrorAlert.d.ts +0 -50
- package/dist/error/components/ErrorPage.d.ts +0 -39
- package/dist/error/components/LoadingState.d.ts +0 -37
- package/dist/error/components/index.d.ts +0 -13
- package/dist/error/components/index.js +0 -18
- package/dist/error/hooks/index.d.ts +0 -7
- package/dist/error/hooks/index.js +0 -14
- package/dist/error/hooks/useErrorHandler.d.ts +0 -67
- package/dist/error/hooks/useErrorHandler.js +0 -14
- package/dist/error/logging/error-logger.d.ts +0 -77
- package/dist/error/logging/error-logger.js +0 -10
- package/dist/error/logging/index.d.ts +0 -9
- package/dist/error/logging/index.js +0 -35
- package/dist/error/logging/transports/base.d.ts +0 -30
- package/dist/error/logging/transports/base.js +0 -7
- package/dist/error/logging/transports/console.d.ts +0 -40
- package/dist/error/logging/transports/console.js +0 -9
- package/dist/error/logging/transports/file.d.ts +0 -49
- package/dist/error/logging/transports/file.js +0 -8
- package/dist/error/logging/transports/index.d.ts +0 -12
- package/dist/error/logging/transports/index.js +0 -25
- package/dist/error/logging/transports/sentry.d.ts +0 -44
- package/dist/error/logging/transports/sentry.js +0 -9
- package/dist/error/logging/transports/slack.d.ts +0 -51
- package/dist/error/logging/transports/slack.js +0 -9
- package/dist/error/logging/types.d.ts +0 -83
- package/dist/error/logging/types.js +0 -7
- package/dist/error/recovery/circuit-breaker.d.ts +0 -85
- package/dist/error/recovery/circuit-breaker.js +0 -9
- package/dist/error/recovery/degradation.d.ts +0 -56
- package/dist/error/recovery/degradation.js +0 -7
- package/dist/error/recovery/fallback.d.ts +0 -55
- package/dist/error/recovery/fallback.js +0 -11
- package/dist/error/recovery/index.d.ts +0 -12
- package/dist/error/recovery/index.js +0 -26
- package/dist/error/recovery/retry.d.ts +0 -44
- package/dist/error/recovery/retry.js +0 -7
- package/dist/utils/shared-utils.d.ts +0 -25
- package/dist/utils/shared-utils.js +0 -43
- package/dist/{chunk-SEZJN4TC.js → chunk-LJEGM4OO.js} +3 -3
- package/dist/{chunk-S73334QY.js → chunk-QF6FH4GZ.js} +3 -3
- package/dist/{chunk-KHYY4KCV.js → chunk-TH45RVP7.js} +3 -3
- package/dist/{chunk-5OWZKYWQ.js → chunk-TMVS4F7E.js} +3 -3
package/dist/auth/index.js
CHANGED
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TokenGenerator
|
|
3
|
-
} from "../chunk-GDWEDUHO.js";
|
|
4
1
|
import {
|
|
5
2
|
OAuthManager
|
|
6
3
|
} from "../chunk-V5K5FYU7.js";
|
|
4
|
+
import {
|
|
5
|
+
DEFAULT_PASSWORD_CONFIG,
|
|
6
|
+
createPasswordHasher,
|
|
7
|
+
createPasswordSchema,
|
|
8
|
+
createPasswordValidator,
|
|
9
|
+
getPasswordStrength,
|
|
10
|
+
passwordValidator,
|
|
11
|
+
validatePassword
|
|
12
|
+
} from "../chunk-G26T2PRQ.js";
|
|
13
|
+
import {
|
|
14
|
+
PasswordHasher,
|
|
15
|
+
PasswordValidator,
|
|
16
|
+
defaultPasswordSchema,
|
|
17
|
+
strongPasswordSchema
|
|
18
|
+
} from "../chunk-IHXRF3BH.js";
|
|
19
|
+
import {
|
|
20
|
+
TokenGenerator
|
|
21
|
+
} from "../chunk-GDWEDUHO.js";
|
|
7
22
|
import {
|
|
8
23
|
JWTClientManager,
|
|
9
24
|
clearStoredTokens,
|
|
@@ -20,21 +35,6 @@ import {
|
|
|
20
35
|
isTokenExpiringSoon,
|
|
21
36
|
storeTokens
|
|
22
37
|
} from "../chunk-XRRPEBKB.js";
|
|
23
|
-
import {
|
|
24
|
-
DEFAULT_PASSWORD_CONFIG,
|
|
25
|
-
createPasswordHasher,
|
|
26
|
-
createPasswordSchema,
|
|
27
|
-
createPasswordValidator,
|
|
28
|
-
getPasswordStrength,
|
|
29
|
-
passwordValidator,
|
|
30
|
-
validatePassword
|
|
31
|
-
} from "../chunk-G26T2PRQ.js";
|
|
32
|
-
import {
|
|
33
|
-
PasswordHasher,
|
|
34
|
-
PasswordValidator,
|
|
35
|
-
defaultPasswordSchema,
|
|
36
|
-
strongPasswordSchema
|
|
37
|
-
} from "../chunk-IHXRF3BH.js";
|
|
38
38
|
import {
|
|
39
39
|
OAuthProvider,
|
|
40
40
|
PasswordStrength,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DataTableBody
|
|
3
|
-
} from "./chunk-7IY3RQQL.js";
|
|
4
|
-
import {
|
|
5
|
-
DataTableBulkActions
|
|
6
|
-
} from "./chunk-MAATEX2R.js";
|
|
7
1
|
import {
|
|
8
2
|
DataTableFilters
|
|
9
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LJEGM4OO.js";
|
|
10
4
|
import {
|
|
11
5
|
DataTablePagination
|
|
12
6
|
} from "./chunk-IPXPCBDO.js";
|
|
13
7
|
import {
|
|
14
8
|
DataTableSearch
|
|
15
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-TH45RVP7.js";
|
|
10
|
+
import {
|
|
11
|
+
DataTableBody
|
|
12
|
+
} from "./chunk-7IY3RQQL.js";
|
|
13
|
+
import {
|
|
14
|
+
DataTableBulkActions
|
|
15
|
+
} from "./chunk-MAATEX2R.js";
|
|
16
16
|
import {
|
|
17
17
|
DEFAULT_LABELS
|
|
18
18
|
} from "./chunk-NY5QXT33.js";
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DataTable
|
|
3
|
-
} from "../../chunk-
|
|
3
|
+
} from "../../chunk-GSUQE3SZ.js";
|
|
4
|
+
import "../../chunk-LJEGM4OO.js";
|
|
5
|
+
import "../../chunk-IPXPCBDO.js";
|
|
6
|
+
import "../../chunk-TH45RVP7.js";
|
|
4
7
|
import "../../chunk-7IY3RQQL.js";
|
|
5
8
|
import "../../chunk-MAATEX2R.js";
|
|
6
|
-
import "../../chunk-SEZJN4TC.js";
|
|
7
|
-
import "../../chunk-IPXPCBDO.js";
|
|
8
|
-
import "../../chunk-KHYY4KCV.js";
|
|
9
9
|
import "../../chunk-NY5QXT33.js";
|
|
10
|
-
import "../../chunk-34WAGUT5.js";
|
|
11
|
-
import "../../chunk-RJUVBBZG.js";
|
|
12
10
|
import "../../chunk-IJEZ7G7S.js";
|
|
13
11
|
import "../../chunk-YJWLWUFK.js";
|
|
14
12
|
import "../../chunk-WDUFQFDP.js";
|
|
13
|
+
import "../../chunk-34WAGUT5.js";
|
|
15
14
|
import "../../chunk-F6LCSFSU.js";
|
|
16
15
|
import "../../chunk-L25BNU3E.js";
|
|
16
|
+
import "../../chunk-RJUVBBZG.js";
|
|
17
17
|
import "../../chunk-62FLBG6B.js";
|
|
18
18
|
import "../../chunk-ORMEWXMH.js";
|
|
19
19
|
export {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
DataTable
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-GSUQE3SZ.js";
|
|
5
|
+
import "../../../chunk-LJEGM4OO.js";
|
|
6
|
+
import "../../../chunk-IPXPCBDO.js";
|
|
7
|
+
import "../../../chunk-TH45RVP7.js";
|
|
5
8
|
import "../../../chunk-7IY3RQQL.js";
|
|
6
9
|
import "../../../chunk-MAATEX2R.js";
|
|
7
|
-
import "../../../chunk-SEZJN4TC.js";
|
|
8
|
-
import "../../../chunk-IPXPCBDO.js";
|
|
9
|
-
import "../../../chunk-KHYY4KCV.js";
|
|
10
10
|
import "../../../chunk-NY5QXT33.js";
|
|
11
|
-
import "../../../chunk-34WAGUT5.js";
|
|
12
|
-
import "../../../chunk-RJUVBBZG.js";
|
|
13
11
|
import "../../../chunk-IJEZ7G7S.js";
|
|
14
12
|
import "../../../chunk-YJWLWUFK.js";
|
|
15
13
|
import "../../../chunk-WDUFQFDP.js";
|
|
14
|
+
import "../../../chunk-34WAGUT5.js";
|
|
16
15
|
import "../../../chunk-F6LCSFSU.js";
|
|
17
16
|
import "../../../chunk-L25BNU3E.js";
|
|
17
|
+
import "../../../chunk-RJUVBBZG.js";
|
|
18
18
|
import "../../../chunk-62FLBG6B.js";
|
|
19
19
|
import "../../../chunk-ORMEWXMH.js";
|
|
20
20
|
export {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
DataTableFilters
|
|
4
|
-
} from "../../../chunk-
|
|
5
|
-
import "../../../chunk-RJUVBBZG.js";
|
|
4
|
+
} from "../../../chunk-LJEGM4OO.js";
|
|
6
5
|
import "../../../chunk-IJEZ7G7S.js";
|
|
7
6
|
import "../../../chunk-WDUFQFDP.js";
|
|
8
7
|
import "../../../chunk-L25BNU3E.js";
|
|
8
|
+
import "../../../chunk-RJUVBBZG.js";
|
|
9
9
|
import "../../../chunk-62FLBG6B.js";
|
|
10
10
|
import "../../../chunk-ORMEWXMH.js";
|
|
11
11
|
export {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
DataTableSearch
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-TH45RVP7.js";
|
|
5
5
|
import "../../../chunk-NY5QXT33.js";
|
|
6
|
-
import "../../../chunk-RJUVBBZG.js";
|
|
7
6
|
import "../../../chunk-L25BNU3E.js";
|
|
7
|
+
import "../../../chunk-RJUVBBZG.js";
|
|
8
8
|
import "../../../chunk-62FLBG6B.js";
|
|
9
9
|
import "../../../chunk-ORMEWXMH.js";
|
|
10
10
|
export {
|
package/dist/constants/index.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ERROR_CODES,
|
|
3
|
-
HTTP_STATUS,
|
|
4
|
-
formatErrorMessage,
|
|
5
|
-
getAllErrorCodes,
|
|
6
|
-
getDefaultErrorMessage,
|
|
7
|
-
getErrorByCode,
|
|
8
|
-
getErrorCategory,
|
|
9
|
-
getErrorCodesByCategory,
|
|
10
|
-
getErrorInfo,
|
|
11
|
-
getHttpStatus,
|
|
12
|
-
getLogLevel
|
|
13
|
-
} from "../chunk-Y3OTJH2S.js";
|
|
14
1
|
import {
|
|
15
2
|
GENERIC_CONFIRM_MESSAGES,
|
|
16
3
|
GENERIC_ERROR_MESSAGES,
|
|
@@ -44,6 +31,19 @@ import {
|
|
|
44
31
|
URL,
|
|
45
32
|
USER_INPUT
|
|
46
33
|
} from "../chunk-LNV2E4I6.js";
|
|
34
|
+
import {
|
|
35
|
+
ERROR_CODES,
|
|
36
|
+
HTTP_STATUS,
|
|
37
|
+
formatErrorMessage,
|
|
38
|
+
getAllErrorCodes,
|
|
39
|
+
getDefaultErrorMessage,
|
|
40
|
+
getErrorByCode,
|
|
41
|
+
getErrorCategory,
|
|
42
|
+
getErrorCodesByCategory,
|
|
43
|
+
getErrorInfo,
|
|
44
|
+
getHttpStatus,
|
|
45
|
+
getLogLevel
|
|
46
|
+
} from "../chunk-Y3OTJH2S.js";
|
|
47
47
|
import "../chunk-ORMEWXMH.js";
|
|
48
48
|
export {
|
|
49
49
|
API_KEY,
|
package/dist/error/index.d.ts
CHANGED
|
@@ -20,7 +20,3 @@ export * from "./error-handler";
|
|
|
20
20
|
export { getFriendlyMessage, getErrorDisplayInfo, formatFriendlyError, type IFriendlyMessage, type IErrorDisplay, } from "./friendly-messages-v2";
|
|
21
21
|
export * from "./error-display";
|
|
22
22
|
export * from "./ErrorBoundary";
|
|
23
|
-
export * from "./components";
|
|
24
|
-
export * from "./hooks";
|
|
25
|
-
export * from "./logging";
|
|
26
|
-
export * from "./recovery";
|
package/dist/error/index.js
CHANGED
|
@@ -1,72 +1,12 @@
|
|
|
1
|
-
import "../chunk-ULF5RDDX.js";
|
|
2
|
-
import {
|
|
3
|
-
withFallback,
|
|
4
|
-
withFallbackChain,
|
|
5
|
-
withFallbackFn
|
|
6
|
-
} from "../chunk-MYLGYX4K.js";
|
|
7
|
-
import {
|
|
8
|
-
withRetry
|
|
9
|
-
} from "../chunk-A6EAAWMK.js";
|
|
10
|
-
import "../chunk-Y2TUZFCP.js";
|
|
11
|
-
import {
|
|
12
|
-
useErrorHandler
|
|
13
|
-
} from "../chunk-6UAYU5NU.js";
|
|
14
|
-
import "../chunk-7XFHGAJP.js";
|
|
15
|
-
import "../chunk-COK4ZXNG.js";
|
|
16
|
-
import {
|
|
17
|
-
ConsoleTransport
|
|
18
|
-
} from "../chunk-FW3IEJ7H.js";
|
|
19
|
-
import {
|
|
20
|
-
FileTransport
|
|
21
|
-
} from "../chunk-YJ3TLEW3.js";
|
|
22
|
-
import {
|
|
23
|
-
SentryTransport
|
|
24
|
-
} from "../chunk-ZZIKRBJU.js";
|
|
25
|
-
import {
|
|
26
|
-
SlackTransport
|
|
27
|
-
} from "../chunk-EQYTE7WD.js";
|
|
28
|
-
import {
|
|
29
|
-
BaseTransport
|
|
30
|
-
} from "../chunk-HGC4CCKB.js";
|
|
31
|
-
import {
|
|
32
|
-
ErrorLogger
|
|
33
|
-
} from "../chunk-JS5VI3OW.js";
|
|
34
|
-
import {
|
|
35
|
-
ELogLevel
|
|
36
|
-
} from "../chunk-6C7HQIX4.js";
|
|
37
|
-
import {
|
|
38
|
-
CircuitBreaker,
|
|
39
|
-
ECircuitState
|
|
40
|
-
} from "../chunk-7VJNLGAS.js";
|
|
41
|
-
import {
|
|
42
|
-
FeatureDegradation
|
|
43
|
-
} from "../chunk-TEIYA7U4.js";
|
|
44
|
-
import {
|
|
45
|
-
EmptyState,
|
|
46
|
-
ErrorAlert,
|
|
47
|
-
ErrorPage,
|
|
48
|
-
LoadingState
|
|
49
|
-
} from "../chunk-ZHVUK5OY.js";
|
|
50
1
|
import {
|
|
51
2
|
LocaleDetector
|
|
52
3
|
} from "../chunk-XHZ5L4FO.js";
|
|
53
|
-
import {
|
|
54
|
-
extractErrorInfo,
|
|
55
|
-
formatInlineError,
|
|
56
|
-
getDefaultErrorCode,
|
|
57
|
-
getErrorIcon,
|
|
58
|
-
handleApiResponse,
|
|
59
|
-
showFriendlyError
|
|
60
|
-
} from "../chunk-3DZA6AGS.js";
|
|
61
4
|
import {
|
|
62
5
|
ErrorResponse,
|
|
63
6
|
errorToResponse,
|
|
64
7
|
processError,
|
|
65
8
|
withErrorHandler
|
|
66
9
|
} from "../chunk-GPBOMJSZ.js";
|
|
67
|
-
import {
|
|
68
|
-
AppError
|
|
69
|
-
} from "../chunk-MLGO3HLS.js";
|
|
70
10
|
import {
|
|
71
11
|
formatFriendlyError,
|
|
72
12
|
getErrorDisplayInfo as getErrorDisplayInfo2,
|
|
@@ -81,6 +21,17 @@ import {
|
|
|
81
21
|
} from "../chunk-EEUBKZV4.js";
|
|
82
22
|
import "../chunk-N4YGR5WH.js";
|
|
83
23
|
import "../chunk-KXAWBFJN.js";
|
|
24
|
+
import {
|
|
25
|
+
AppError
|
|
26
|
+
} from "../chunk-MLGO3HLS.js";
|
|
27
|
+
import {
|
|
28
|
+
extractErrorInfo,
|
|
29
|
+
formatInlineError,
|
|
30
|
+
getDefaultErrorCode,
|
|
31
|
+
getErrorIcon,
|
|
32
|
+
handleApiResponse,
|
|
33
|
+
showFriendlyError
|
|
34
|
+
} from "../chunk-3DZA6AGS.js";
|
|
84
35
|
import {
|
|
85
36
|
getErrorDisplayInfo
|
|
86
37
|
} from "../chunk-2DVWSDST.js";
|
|
@@ -234,27 +185,13 @@ function InlineError({
|
|
|
234
185
|
}
|
|
235
186
|
export {
|
|
236
187
|
AppError,
|
|
237
|
-
BaseTransport,
|
|
238
|
-
CircuitBreaker,
|
|
239
|
-
ConsoleTransport,
|
|
240
|
-
ECircuitState,
|
|
241
|
-
ELogLevel,
|
|
242
188
|
ERROR_CODES,
|
|
243
|
-
EmptyState,
|
|
244
|
-
ErrorAlert,
|
|
245
189
|
ErrorBoundary,
|
|
246
190
|
ErrorCard,
|
|
247
|
-
ErrorLogger,
|
|
248
|
-
ErrorPage,
|
|
249
191
|
ErrorResponse,
|
|
250
|
-
FeatureDegradation,
|
|
251
|
-
FileTransport,
|
|
252
192
|
HTTP_STATUS,
|
|
253
193
|
InlineError,
|
|
254
|
-
LoadingState,
|
|
255
194
|
LocaleDetector,
|
|
256
|
-
SentryTransport,
|
|
257
|
-
SlackTransport,
|
|
258
195
|
errorToResponse,
|
|
259
196
|
extractErrorInfo,
|
|
260
197
|
formatErrorMessage,
|
|
@@ -280,10 +217,5 @@ export {
|
|
|
280
217
|
processError,
|
|
281
218
|
showFriendlyError,
|
|
282
219
|
supportedLocales,
|
|
283
|
-
|
|
284
|
-
withErrorHandler,
|
|
285
|
-
withFallback,
|
|
286
|
-
withFallbackChain,
|
|
287
|
-
withFallbackFn,
|
|
288
|
-
withRetry
|
|
220
|
+
withErrorHandler
|
|
289
221
|
};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GeoIPProviderFactory
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import {
|
|
5
|
-
IPApiProvider
|
|
6
|
-
} from "../chunk-DEEJBDJE.js";
|
|
3
|
+
} from "../chunk-QF6FH4GZ.js";
|
|
7
4
|
import {
|
|
8
5
|
IPApiCoProvider
|
|
9
6
|
} from "../chunk-VSGKVZB4.js";
|
|
@@ -13,6 +10,9 @@ import {
|
|
|
13
10
|
import {
|
|
14
11
|
MaxMindProvider
|
|
15
12
|
} from "../chunk-4NWJ3WCZ.js";
|
|
13
|
+
import {
|
|
14
|
+
IPApiProvider
|
|
15
|
+
} from "../chunk-DEEJBDJE.js";
|
|
16
16
|
import {
|
|
17
17
|
BaseGeoIPProvider,
|
|
18
18
|
truncateString
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GeoIPProviderFactory
|
|
3
|
-
} from "../../chunk-
|
|
4
|
-
import {
|
|
5
|
-
IPApiProvider
|
|
6
|
-
} from "../../chunk-DEEJBDJE.js";
|
|
3
|
+
} from "../../chunk-QF6FH4GZ.js";
|
|
7
4
|
import {
|
|
8
5
|
IPApiCoProvider
|
|
9
6
|
} from "../../chunk-VSGKVZB4.js";
|
|
@@ -13,6 +10,9 @@ import {
|
|
|
13
10
|
import {
|
|
14
11
|
MaxMindProvider
|
|
15
12
|
} from "../../chunk-4NWJ3WCZ.js";
|
|
13
|
+
import {
|
|
14
|
+
IPApiProvider
|
|
15
|
+
} from "../../chunk-DEEJBDJE.js";
|
|
16
16
|
import {
|
|
17
17
|
BaseGeoIPProvider,
|
|
18
18
|
truncateString
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
errorHandlerMiddleware
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-MLGO3HLS.js";
|
|
3
|
+
} from "../chunk-TMVS4F7E.js";
|
|
5
4
|
import "../chunk-EEUBKZV4.js";
|
|
6
5
|
import "../chunk-N4YGR5WH.js";
|
|
7
6
|
import "../chunk-KXAWBFJN.js";
|
|
7
|
+
import "../chunk-MLGO3HLS.js";
|
|
8
8
|
import "../chunk-Y3OTJH2S.js";
|
|
9
9
|
import "../chunk-EZR55KV2.js";
|
|
10
10
|
import "../chunk-ORMEWXMH.js";
|
package/dist/middleware/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-SLG26KHZ.js";
|
|
8
8
|
import {
|
|
9
9
|
MiddlewareChain
|
|
10
10
|
} from "../chunk-4ODT3Q4A.js";
|
|
@@ -33,15 +33,15 @@ import {
|
|
|
33
33
|
} from "../chunk-FOKAATUQ.js";
|
|
34
34
|
import {
|
|
35
35
|
errorHandlerMiddleware
|
|
36
|
-
} from "../chunk-
|
|
36
|
+
} from "../chunk-TMVS4F7E.js";
|
|
37
37
|
import {
|
|
38
38
|
initRequestMiddleware
|
|
39
39
|
} from "../chunk-62Q7DN5G.js";
|
|
40
40
|
import "../chunk-XHZ5L4FO.js";
|
|
41
|
-
import "../chunk-MLGO3HLS.js";
|
|
42
41
|
import "../chunk-EEUBKZV4.js";
|
|
43
42
|
import "../chunk-N4YGR5WH.js";
|
|
44
43
|
import "../chunk-KXAWBFJN.js";
|
|
44
|
+
import "../chunk-MLGO3HLS.js";
|
|
45
45
|
import "../chunk-Y3OTJH2S.js";
|
|
46
46
|
import "../chunk-T3LJYAMO.js";
|
|
47
47
|
import "../chunk-AIH3F7JV.js";
|
|
@@ -4,20 +4,20 @@ import {
|
|
|
4
4
|
withCustomApi,
|
|
5
5
|
withOptionalAuthApi,
|
|
6
6
|
withPublicApi
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-SLG26KHZ.js";
|
|
8
8
|
import "../chunk-4ODT3Q4A.js";
|
|
9
9
|
import "../chunk-H5I5GWAA.js";
|
|
10
10
|
import "../chunk-KAWVMIRJ.js";
|
|
11
11
|
import "../chunk-WSQMXMTL.js";
|
|
12
12
|
import "../chunk-UXQRU3EM.js";
|
|
13
13
|
import "../chunk-FOKAATUQ.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-TMVS4F7E.js";
|
|
15
15
|
import "../chunk-62Q7DN5G.js";
|
|
16
16
|
import "../chunk-XHZ5L4FO.js";
|
|
17
|
-
import "../chunk-MLGO3HLS.js";
|
|
18
17
|
import "../chunk-EEUBKZV4.js";
|
|
19
18
|
import "../chunk-N4YGR5WH.js";
|
|
20
19
|
import "../chunk-KXAWBFJN.js";
|
|
20
|
+
import "../chunk-MLGO3HLS.js";
|
|
21
21
|
import "../chunk-Y3OTJH2S.js";
|
|
22
22
|
import "../chunk-T3LJYAMO.js";
|
|
23
23
|
import "../chunk-AIH3F7JV.js";
|
|
@@ -1,8 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
formatChartNumber,
|
|
3
|
-
formatNumber
|
|
4
|
-
} from "../chunk-TDZJ6SAI.js";
|
|
5
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/format-number.ts
|
|
4
|
+
function formatNumber(num) {
|
|
5
|
+
if (num === null || num === void 0) {
|
|
6
|
+
return "-";
|
|
7
|
+
}
|
|
8
|
+
const numericValue = typeof num === "string" ? parseFloat(num) : num;
|
|
9
|
+
if (isNaN(numericValue)) {
|
|
10
|
+
return "NaN";
|
|
11
|
+
}
|
|
12
|
+
if (!isFinite(numericValue)) {
|
|
13
|
+
return numericValue > 0 ? "Infinity" : "-Infinity";
|
|
14
|
+
}
|
|
15
|
+
const isNegative = numericValue < 0;
|
|
16
|
+
const absNum = Math.abs(numericValue);
|
|
17
|
+
if (absNum < 1e3) {
|
|
18
|
+
return numericValue.toString();
|
|
19
|
+
}
|
|
20
|
+
if (absNum < 1e6) {
|
|
21
|
+
return numericValue.toLocaleString();
|
|
22
|
+
}
|
|
23
|
+
if (absNum < 1e7) {
|
|
24
|
+
return numericValue.toLocaleString();
|
|
25
|
+
}
|
|
26
|
+
const formatted = (absNum / 1e6).toFixed(1) + "M";
|
|
27
|
+
return isNegative ? "-" + formatted : formatted;
|
|
28
|
+
}
|
|
29
|
+
function formatChartNumber(num) {
|
|
30
|
+
return formatNumber(num);
|
|
31
|
+
}
|
|
6
32
|
export {
|
|
7
33
|
formatChartNumber,
|
|
8
34
|
formatNumber
|
|
@@ -74,7 +74,7 @@ function escapeHTML(input) {
|
|
|
74
74
|
if (typeof input !== "string") {
|
|
75
75
|
return "";
|
|
76
76
|
}
|
|
77
|
-
return input.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")
|
|
77
|
+
return input.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
78
78
|
}
|
|
79
79
|
function detectXSS(input) {
|
|
80
80
|
if (typeof input !== "string") {
|
|
@@ -149,14 +149,14 @@ function sanitizeInput(input, options = {}) {
|
|
|
149
149
|
if (trim) {
|
|
150
150
|
sanitized = sanitized.trim();
|
|
151
151
|
}
|
|
152
|
-
if (sanitized.length > maxLength) {
|
|
153
|
-
sanitized = sanitized.substring(0, maxLength);
|
|
154
|
-
}
|
|
155
152
|
if (!allowHTML) {
|
|
156
153
|
sanitized = escapeHTML(sanitized);
|
|
157
154
|
}
|
|
158
155
|
sanitized = sanitized.replace(/\0/g, "");
|
|
159
156
|
sanitized = sanitized.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, "");
|
|
157
|
+
if (sanitized.length > maxLength) {
|
|
158
|
+
sanitized = sanitized.substring(0, maxLength);
|
|
159
|
+
}
|
|
160
160
|
return sanitized;
|
|
161
161
|
}
|
|
162
162
|
function validateFilename(filename) {
|
|
@@ -1,8 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
generateShortCode,
|
|
3
|
-
generateUniqueShortCode
|
|
4
|
-
} from "../chunk-5ATB5D6S.js";
|
|
5
1
|
import "../chunk-ORMEWXMH.js";
|
|
2
|
+
|
|
3
|
+
// src/utils/short-code-generator.ts
|
|
4
|
+
function generateShortCode(length = 8) {
|
|
5
|
+
if (!Number.isInteger(length) || length <= 0) {
|
|
6
|
+
throw new Error("length must be a positive integer");
|
|
7
|
+
}
|
|
8
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
9
|
+
let result = "";
|
|
10
|
+
for (let i = 0; i < length; i++) {
|
|
11
|
+
result += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
12
|
+
}
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
async function generateUniqueShortCode(options = {}) {
|
|
16
|
+
const {
|
|
17
|
+
length = 8,
|
|
18
|
+
maxAttempts = 100,
|
|
19
|
+
checkDuplicate
|
|
20
|
+
} = options;
|
|
21
|
+
let shortCode;
|
|
22
|
+
let attempts = 0;
|
|
23
|
+
do {
|
|
24
|
+
shortCode = generateShortCode(length);
|
|
25
|
+
attempts++;
|
|
26
|
+
if (checkDuplicate) {
|
|
27
|
+
const isDuplicate = await checkDuplicate(shortCode);
|
|
28
|
+
if (!isDuplicate) break;
|
|
29
|
+
} else {
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
if (attempts >= maxAttempts) {
|
|
33
|
+
throw new Error("Failed to generate unique shortCode after multiple attempts");
|
|
34
|
+
}
|
|
35
|
+
} while (true);
|
|
36
|
+
return shortCode;
|
|
37
|
+
}
|
|
6
38
|
export {
|
|
7
39
|
generateShortCode,
|
|
8
40
|
generateUniqueShortCode
|