@withwiz/toolkit 0.10.0 → 0.12.0
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 +6 -0
- package/dist/{chunk-Z64GNAB7.js → chunk-2SV6VZOC.js} +2 -2
- package/dist/{chunk-3P4TZM3O.js → chunk-3EEOZHIJ.js} +3 -3
- package/dist/chunk-4JZIIMAF.js +33 -0
- package/dist/{chunk-BICSVLN7.js → chunk-4OFL7KZ7.js} +11 -11
- package/dist/{chunk-XDB3K74B.js → chunk-4OKAMI6O.js} +1 -1
- package/dist/{chunk-W27FQNP6.js → chunk-5MPMPXIR.js} +1 -1
- package/dist/{chunk-XQIAXMRY.js → chunk-5VZIAXO2.js} +2 -1
- package/dist/{chunk-465MEI5K.js → chunk-6E2Q27EN.js} +1 -1
- package/dist/chunk-6NFMRZWB.js +8 -0
- package/dist/{chunk-HZN44RWL.js → chunk-7Q6SMNMN.js} +7 -7
- package/dist/{chunk-SROPI74N.js → chunk-AWFP2KAU.js} +1 -1
- package/dist/{chunk-7S2PCYNT.js → chunk-B2JZPUQ3.js} +2 -2
- package/dist/{chunk-HV6A6Z5R.js → chunk-BPDYEB37.js} +1 -1
- package/dist/{chunk-BRFW2LL2.js → chunk-D4QADM6T.js} +2 -2
- package/dist/{chunk-6NEGFM32.js → chunk-DTRXWS7G.js} +25 -16
- package/dist/{chunk-UIWR5MXM.js → chunk-ETXMWDXV.js} +1 -1
- package/dist/{chunk-4TGPAUJV.js → chunk-F2FTS6H4.js} +2 -2
- package/dist/{chunk-P4MGYRJM.js → chunk-G4IGD3AZ.js} +33 -13
- package/dist/{chunk-VHRBXD7U.js → chunk-HNFYO5XV.js} +10 -6
- package/dist/{chunk-23LQJYZN.js → chunk-KAS5ILUM.js} +1 -1
- package/dist/{chunk-KHXS4DGA.js → chunk-LFJ24NDO.js} +8 -8
- package/dist/{chunk-TRGFXIEF.js → chunk-M4ZVQFOH.js} +2 -2
- package/dist/{chunk-ATAQRXTH.js → chunk-MCPPJI3T.js} +1 -1
- package/dist/{chunk-ZEHNCHIV.js → chunk-MTRPUJ4B.js} +1 -1
- package/dist/{chunk-R7EFDSPZ.js → chunk-NHFIOK2D.js} +5 -5
- package/dist/{chunk-5Z5CZAZP.js → chunk-NT6URT4W.js} +14 -14
- package/dist/{chunk-Y6CPPBJI.js → chunk-OEZPVNSA.js} +1 -1
- package/dist/{chunk-KZ4PDS5K.js → chunk-RWN47K7J.js} +1 -1
- package/dist/{chunk-N3TCQ5BF.js → chunk-TQMQ5XXG.js} +17 -2
- package/dist/{chunk-OII5BXCZ.js → chunk-U2TGXJ3A.js} +1 -1
- package/dist/{chunk-5S7M2AJL.js → chunk-W2FBLCOR.js} +1 -1
- package/dist/{chunk-XF3WUF3F.js → chunk-ZFBY2FNS.js} +2 -2
- package/dist/{chunk-2GK4LDPV.js → chunk-ZLUID5BU.js} +2 -2
- package/dist/core/api-key/api-key.service.d.ts +1 -0
- package/dist/core/api-key/api-key.service.js +3 -2
- package/dist/core/api-key/errors.d.ts +21 -0
- package/dist/core/api-key/errors.js +11 -0
- package/dist/core/api-key/index.d.ts +1 -0
- package/dist/core/api-key/index.js +15 -7
- package/dist/core/auth/adapters/sql/email-token-repository.js +2 -2
- package/dist/core/auth/adapters/sql/index.js +8 -8
- package/dist/core/auth/adapters/sql/oauth-account-repository.js +2 -2
- package/dist/core/auth/adapters/sql/user-repository.js +2 -2
- package/dist/core/auth/config.js +2 -1
- package/dist/core/auth/cookie-names.d.ts +3 -0
- package/dist/core/auth/cookie-names.js +9 -0
- package/dist/core/auth/index.js +9 -8
- package/dist/core/auth/jwt/cookie.js +4 -3
- package/dist/core/auth/jwt/index.js +4 -3
- package/dist/core/auth/oauth/index.js +7 -7
- package/dist/core/auth/oauth/providers/index.js +6 -6
- package/dist/core/auth/services/cache-token-stores.d.ts +45 -0
- package/dist/core/auth/services/cache-token-stores.js +59 -0
- package/dist/core/auth/services/index.js +4 -3
- package/dist/core/auth/services/login.service.js +4 -3
- package/dist/core/auth/services/oauth-callback.service.js +4 -3
- package/dist/core/auth/services/token-refresh.service.js +4 -3
- package/dist/core/auth/token-delivery.js +5 -4
- package/dist/core/cache/cache-config.js +4 -4
- package/dist/core/cache/cache-env.js +3 -3
- package/dist/core/cache/cache-factory.js +9 -9
- package/dist/core/cache/cache-invalidation.js +10 -10
- package/dist/core/cache/cache-redis.js +4 -4
- package/dist/core/cache/cache-wrapper.js +10 -10
- package/dist/core/cache/cache.js +16 -16
- package/dist/core/cache/config.js +2 -2
- package/dist/core/cache/hybrid-cache-manager.js +5 -5
- package/dist/core/cache/index.js +16 -16
- package/dist/core/cache/noop-cache-manager.js +5 -5
- package/dist/core/cache/redis-cache-manager.js +5 -5
- package/dist/core/constants/error-codes.js +1 -1
- package/dist/core/constants/index.js +1 -1
- package/dist/core/error/app-error.js +2 -2
- package/dist/core/error/friendly-messages-v2.js +2 -2
- package/dist/core/error/friendly-messages.js +1 -1
- package/dist/core/error/index.js +5 -5
- package/dist/core/storage/r2-storage.js +2 -2
- package/dist/core/system/environment.js +6 -5
- package/dist/core/system/health-check.js +3 -3
- package/dist/core/system/index.js +10 -9
- package/dist/core/utils/optimistic-lock.js +2 -2
- package/dist/initialize.js +11 -10
- package/dist/next/auth-handlers/index.js +14 -13
- package/dist/next/auth-handlers/login.handler.js +6 -5
- package/dist/next/auth-handlers/logout.handler.js +5 -4
- package/dist/next/auth-handlers/me.handler.js +6 -5
- package/dist/next/auth-handlers/oauth-authorize.handler.js +4 -4
- package/dist/next/auth-handlers/oauth-callback.handler.js +8 -7
- package/dist/next/auth-handlers/refresh.handler.js +6 -5
- package/dist/next/auth-types/handler-types.js +5 -4
- package/dist/next/auth-types/index.js +5 -4
- package/dist/next/error/error-handler.js +4 -4
- package/dist/next/error/index.js +5 -5
- package/dist/next/middleware/auth.js +10 -9
- package/dist/next/middleware/error-handler.js +5 -5
- package/dist/next/middleware/index.js +27 -26
- package/dist/next/middleware/rate-limit.js +3 -3
- package/dist/next/middleware/wrappers.js +16 -15
- package/dist/next/oapi/api-key-auth.js +6 -5
- package/dist/next/oapi/index.js +6 -5
- package/dist/next/proxy.d.ts +38 -0
- package/dist/next/proxy.js +53 -0
- package/dist/next/utils/api-helpers.js +2 -2
- package/dist/next/utils/error-processor.js +3 -3
- package/dist/next/utils/index.js +27 -27
- package/package.json +13 -3
- package/dist/{chunk-GSRAIDD7.js → chunk-6A5JHOBB.js} +3 -3
- package/dist/{chunk-43XXILCX.js → chunk-BTYH4MHU.js} +3 -3
- package/dist/{chunk-MXWSG6ER.js → chunk-KYUJ6D65.js} +0 -0
- package/dist/{chunk-ER6LSA4M.js → chunk-P7WHMKN5.js} +6 -6
- package/dist/{chunk-7KIM5MHV.js → chunk-RHYETIUR.js} +3 -3
- package/dist/{chunk-5VDT3ZB4.js → chunk-VQJY52YF.js} +3 -3
package/dist/next/utils/index.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
boolFormatter,
|
|
3
|
+
createCsvHeader,
|
|
4
|
+
createSimpleCsvResponse,
|
|
5
|
+
createStreamingCsvResponse,
|
|
6
|
+
dateFormatter,
|
|
7
|
+
escapeCsvField,
|
|
8
|
+
rowToCsv
|
|
9
|
+
} from "../../chunk-DVCGAI5N.js";
|
|
10
|
+
import {
|
|
11
|
+
ErrorProcessor,
|
|
12
|
+
errorToResponse,
|
|
13
|
+
handlePrismaError,
|
|
14
|
+
processError,
|
|
15
|
+
throwBadRequestError,
|
|
16
|
+
throwBusinessRuleError,
|
|
17
|
+
throwConflictError,
|
|
18
|
+
throwForbiddenError,
|
|
19
|
+
throwNotFoundError,
|
|
20
|
+
throwUnauthorizedError,
|
|
21
|
+
throwValidationError,
|
|
22
|
+
withErrorHandling
|
|
23
|
+
} from "../../chunk-D4QADM6T.js";
|
|
1
24
|
import {
|
|
2
25
|
createPaginatedResponse,
|
|
3
26
|
getReferer,
|
|
@@ -11,7 +34,7 @@ import {
|
|
|
11
34
|
parseSort,
|
|
12
35
|
requireAdmin,
|
|
13
36
|
validateAndParse
|
|
14
|
-
} from "../../chunk-
|
|
37
|
+
} from "../../chunk-KAS5ILUM.js";
|
|
15
38
|
import {
|
|
16
39
|
getAllowedOrigins,
|
|
17
40
|
getCorsConfig,
|
|
@@ -22,35 +45,12 @@ import {
|
|
|
22
45
|
withPublicCORS,
|
|
23
46
|
withRestrictedCORS
|
|
24
47
|
} from "../../chunk-34L7HTM7.js";
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
createCsvHeader,
|
|
28
|
-
createSimpleCsvResponse,
|
|
29
|
-
createStreamingCsvResponse,
|
|
30
|
-
dateFormatter,
|
|
31
|
-
escapeCsvField,
|
|
32
|
-
rowToCsv
|
|
33
|
-
} from "../../chunk-DVCGAI5N.js";
|
|
34
|
-
import {
|
|
35
|
-
ErrorProcessor,
|
|
36
|
-
errorToResponse,
|
|
37
|
-
handlePrismaError,
|
|
38
|
-
processError,
|
|
39
|
-
throwBadRequestError,
|
|
40
|
-
throwBusinessRuleError,
|
|
41
|
-
throwConflictError,
|
|
42
|
-
throwForbiddenError,
|
|
43
|
-
throwNotFoundError,
|
|
44
|
-
throwUnauthorizedError,
|
|
45
|
-
throwValidationError,
|
|
46
|
-
withErrorHandling
|
|
47
|
-
} from "../../chunk-BRFW2LL2.js";
|
|
48
|
-
import "../../chunk-ATAQRXTH.js";
|
|
49
|
-
import "../../chunk-XQIAXMRY.js";
|
|
48
|
+
import "../../chunk-MCPPJI3T.js";
|
|
49
|
+
import "../../chunk-5VZIAXO2.js";
|
|
50
50
|
import "../../chunk-QAIN3WNN.js";
|
|
51
51
|
import "../../chunk-7ZO5UNTJ.js";
|
|
52
|
-
import "../../chunk-7YWUKMZD.js";
|
|
53
52
|
import "../../chunk-IKZB26SK.js";
|
|
53
|
+
import "../../chunk-7YWUKMZD.js";
|
|
54
54
|
import "../../chunk-PX535BHW.js";
|
|
55
55
|
import "../../chunk-6J2EJVND.js";
|
|
56
56
|
import "../../chunk-F3R3UYBF.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@withwiz/toolkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "Shared utility library for withwiz projects",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -31,8 +31,12 @@
|
|
|
31
31
|
},
|
|
32
32
|
"exports": {
|
|
33
33
|
"./initialize": "./dist/initialize.js",
|
|
34
|
-
"./core/api-key": {
|
|
34
|
+
"./core/api-key": {
|
|
35
|
+
"types": "./dist/core/api-key/index.d.ts",
|
|
36
|
+
"import": "./dist/core/api-key/index.js"
|
|
37
|
+
},
|
|
35
38
|
"./core/api-key/types": "./dist/core/api-key/types.js",
|
|
39
|
+
"./core/api-key/errors": "./dist/core/api-key/errors.js",
|
|
36
40
|
"./core/api-key/ports": "./dist/core/api-key/ports.js",
|
|
37
41
|
"./core/api-key/key-generator": "./dist/core/api-key/key-generator.js",
|
|
38
42
|
"./core/api-key/ip-whitelist": "./dist/core/api-key/ip-whitelist.js",
|
|
@@ -41,6 +45,7 @@
|
|
|
41
45
|
"./core/auth": "./dist/core/auth/index.js",
|
|
42
46
|
"./core/auth/adapters/sql": "./dist/core/auth/adapters/sql/index.js",
|
|
43
47
|
"./core/auth/config": "./dist/core/auth/config.js",
|
|
48
|
+
"./core/auth/cookie-names": "./dist/core/auth/cookie-names.js",
|
|
44
49
|
"./core/auth/duration": "./dist/core/auth/duration.js",
|
|
45
50
|
"./core/auth/email": "./dist/core/auth/email/index.js",
|
|
46
51
|
"./core/auth/email/sender": "./dist/core/auth/email/sender.js",
|
|
@@ -61,6 +66,7 @@
|
|
|
61
66
|
"./core/auth/password/client-helper": "./dist/core/auth/password/client-helper.js",
|
|
62
67
|
"./core/auth/password/hasher": "./dist/core/auth/password/hasher.js",
|
|
63
68
|
"./core/auth/services": "./dist/core/auth/services/index.js",
|
|
69
|
+
"./core/auth/services/cache-token-stores": "./dist/core/auth/services/cache-token-stores.js",
|
|
64
70
|
"./core/auth/services/email-verification.service": "./dist/core/auth/services/email-verification.service.js",
|
|
65
71
|
"./core/auth/services/login.service": "./dist/core/auth/services/login.service.js",
|
|
66
72
|
"./core/auth/services/oauth-callback.service": "./dist/core/auth/services/oauth-callback.service.js",
|
|
@@ -170,10 +176,14 @@
|
|
|
170
176
|
"import": "./dist/next/error/index.js"
|
|
171
177
|
},
|
|
172
178
|
"./next/error/locale-detector": "./dist/next/error/locale-detector.js",
|
|
173
|
-
"./next/oapi": {
|
|
179
|
+
"./next/oapi": {
|
|
180
|
+
"types": "./dist/next/oapi/index.d.ts",
|
|
181
|
+
"import": "./dist/next/oapi/index.js"
|
|
182
|
+
},
|
|
174
183
|
"./next/oapi/api-key-auth": "./dist/next/oapi/api-key-auth.js",
|
|
175
184
|
"./next/oapi/openapi-spec": "./dist/next/oapi/openapi-spec.js",
|
|
176
185
|
"./next/oapi/helpers": "./dist/next/oapi/helpers.js",
|
|
186
|
+
"./next/proxy": "./dist/next/proxy.js",
|
|
177
187
|
"./next/middleware": "./dist/next/middleware/index.js",
|
|
178
188
|
"./next/middleware/auth": "./dist/next/middleware/auth.js",
|
|
179
189
|
"./next/middleware/cors": "./dist/next/middleware/cors.js",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveConfig
|
|
3
|
-
} from "./chunk-E4TKORMQ.js";
|
|
4
1
|
import {
|
|
5
2
|
ParamBuilder,
|
|
6
3
|
columnList,
|
|
7
4
|
getDialect
|
|
8
5
|
} from "./chunk-2JUFL4KX.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveConfig
|
|
8
|
+
} from "./chunk-E4TKORMQ.js";
|
|
9
9
|
|
|
10
10
|
// src/core/auth/adapters/sql/user-repository.ts
|
|
11
11
|
import { randomUUID } from "crypto";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveConfig
|
|
3
|
-
} from "./chunk-E4TKORMQ.js";
|
|
4
1
|
import {
|
|
5
2
|
ParamBuilder,
|
|
6
3
|
columnList,
|
|
7
4
|
getDialect
|
|
8
5
|
} from "./chunk-2JUFL4KX.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveConfig
|
|
8
|
+
} from "./chunk-E4TKORMQ.js";
|
|
9
9
|
|
|
10
10
|
// src/core/auth/adapters/sql/email-token-repository.ts
|
|
11
11
|
import { randomUUID } from "crypto";
|
|
File without changes
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MicrosoftOAuthProvider
|
|
3
|
-
} from "./chunk-GSSHHVHF.js";
|
|
4
|
-
import {
|
|
5
|
-
GitHubOAuthProvider
|
|
6
|
-
} from "./chunk-HIZ7USIF.js";
|
|
7
1
|
import {
|
|
8
2
|
GoogleOAuthProvider
|
|
9
3
|
} from "./chunk-GF3DKZIW.js";
|
|
@@ -13,6 +7,12 @@ import {
|
|
|
13
7
|
import {
|
|
14
8
|
MetaOAuthProvider
|
|
15
9
|
} from "./chunk-33RIHX7O.js";
|
|
10
|
+
import {
|
|
11
|
+
MicrosoftOAuthProvider
|
|
12
|
+
} from "./chunk-GSSHHVHF.js";
|
|
13
|
+
import {
|
|
14
|
+
GitHubOAuthProvider
|
|
15
|
+
} from "./chunk-HIZ7USIF.js";
|
|
16
16
|
import {
|
|
17
17
|
OAuthError
|
|
18
18
|
} from "./chunk-5GWGARXI.js";
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ConfigurationError
|
|
3
|
-
} from "./chunk-F3R3UYBF.js";
|
|
4
1
|
import {
|
|
5
2
|
CACHE_DURATION_DEFAULTS,
|
|
6
3
|
CACHE_FALLBACK_DEFAULTS,
|
|
@@ -8,6 +5,9 @@ import {
|
|
|
8
5
|
CACHE_TTL_DEFAULTS,
|
|
9
6
|
INMEMORY_CACHE_DEFAULTS
|
|
10
7
|
} from "./chunk-ERFD6YAW.js";
|
|
8
|
+
import {
|
|
9
|
+
ConfigurationError
|
|
10
|
+
} from "./chunk-F3R3UYBF.js";
|
|
11
11
|
import {
|
|
12
12
|
__spreadValues
|
|
13
13
|
} from "./chunk-N3ETBM74.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveConfig
|
|
3
|
-
} from "./chunk-E4TKORMQ.js";
|
|
4
1
|
import {
|
|
5
2
|
ParamBuilder,
|
|
6
3
|
columnList,
|
|
7
4
|
getDialect
|
|
8
5
|
} from "./chunk-2JUFL4KX.js";
|
|
6
|
+
import {
|
|
7
|
+
resolveConfig
|
|
8
|
+
} from "./chunk-E4TKORMQ.js";
|
|
9
9
|
|
|
10
10
|
// src/core/auth/adapters/sql/oauth-account-repository.ts
|
|
11
11
|
import { randomUUID } from "crypto";
|