@arkyn/server 3.0.1-beta.154 → 3.0.1-beta.156

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.
Files changed (91) hide show
  1. package/dist/index.js +1301 -37
  2. package/dist/modules/http/api/_logRequest.js +69 -0
  3. package/dist/modules/http/api/_makeRequest.js +69 -0
  4. package/dist/modules/http/api/deleteRequest.js +13 -0
  5. package/dist/modules/http/api/getRequest.js +12 -0
  6. package/dist/modules/http/api/patchRequest.js +13 -0
  7. package/dist/modules/http/api/postRequest.js +13 -0
  8. package/dist/modules/http/api/putRequest.js +13 -0
  9. package/dist/modules/http/badResponses/_badResponse.js +59 -0
  10. package/dist/modules/http/badResponses/badGateway.js +30 -0
  11. package/dist/modules/http/badResponses/badRequest.js +30 -0
  12. package/dist/modules/http/badResponses/conflict.js +30 -0
  13. package/dist/modules/http/badResponses/forbidden.js +30 -0
  14. package/dist/modules/http/badResponses/notFound.js +30 -0
  15. package/dist/modules/http/badResponses/notImplemented.js +30 -0
  16. package/dist/modules/http/badResponses/serverError.js +30 -0
  17. package/dist/modules/http/badResponses/unauthorized.js +30 -0
  18. package/dist/modules/http/badResponses/unprocessableEntity.js +36 -0
  19. package/dist/modules/http/successResponses/_successResponse.js +69 -0
  20. package/dist/modules/http/successResponses/created.js +30 -0
  21. package/dist/modules/http/successResponses/found.js +30 -0
  22. package/dist/modules/http/successResponses/noContent.js +21 -0
  23. package/dist/modules/http/successResponses/success.js +30 -0
  24. package/dist/modules/http/successResponses/updated.js +30 -0
  25. package/dist/modules/index.js +68 -0
  26. package/dist/modules/services/apiService.js +129 -0
  27. package/dist/modules/services/debugService.js +66 -0
  28. package/dist/modules/services/logMapperService.js +52 -0
  29. package/dist/modules/services/logService.js +31 -0
  30. package/dist/modules/utilities/decodeRequestBody.js +22 -0
  31. package/dist/modules/utilities/decodeRequestErrorMessage.js +7 -0
  32. package/dist/modules/utilities/errorHandler.js +54 -0
  33. package/dist/modules/utilities/flushDebugLogs.js +20 -0
  34. package/dist/modules/utilities/formAsyncParse.js +19 -0
  35. package/dist/modules/utilities/formParse.js +19 -0
  36. package/dist/modules/utilities/getScopedParams.js +11 -0
  37. package/dist/modules/utilities/schemaValidator.js +106 -0
  38. package/dist/modules/validations/validateCep.js +9 -0
  39. package/dist/modules/validations/validateCnpj.js +31 -0
  40. package/dist/modules/validations/validateCpf.js +28 -0
  41. package/dist/modules/validations/validateDate.js +27 -0
  42. package/dist/modules/validations/validateEmail.js +53 -0
  43. package/dist/modules/validations/validatePassword.js +16 -0
  44. package/dist/modules/validations/validatePhone.js +10 -0
  45. package/dist/modules/validations/validateRg.js +8 -0
  46. package/package.json +121 -87
  47. package/dist/bundle.js +0 -3014
  48. package/dist/bundle.umd.cjs +0 -9
  49. package/dist/http/api/_logRequest.js +0 -109
  50. package/dist/http/api/_makeRequest.js +0 -116
  51. package/dist/http/api/deleteRequest.js +0 -18
  52. package/dist/http/api/getRequest.js +0 -17
  53. package/dist/http/api/patchRequest.js +0 -18
  54. package/dist/http/api/postRequest.js +0 -18
  55. package/dist/http/api/putRequest.js +0 -18
  56. package/dist/http/badResponses/_badResponse.js +0 -62
  57. package/dist/http/badResponses/badGateway.js +0 -43
  58. package/dist/http/badResponses/badRequest.js +0 -41
  59. package/dist/http/badResponses/conflict.js +0 -42
  60. package/dist/http/badResponses/forbidden.js +0 -41
  61. package/dist/http/badResponses/notFound.js +0 -41
  62. package/dist/http/badResponses/notImplemented.js +0 -41
  63. package/dist/http/badResponses/serverError.js +0 -41
  64. package/dist/http/badResponses/unauthorized.js +0 -42
  65. package/dist/http/badResponses/unprocessableEntity.js +0 -53
  66. package/dist/http/successResponses/_successResponse.js +0 -75
  67. package/dist/http/successResponses/created.js +0 -41
  68. package/dist/http/successResponses/found.js +0 -41
  69. package/dist/http/successResponses/noContent.js +0 -32
  70. package/dist/http/successResponses/success.js +0 -41
  71. package/dist/http/successResponses/updated.js +0 -42
  72. package/dist/services/apiService.js +0 -174
  73. package/dist/services/debugService.js +0 -82
  74. package/dist/services/logMapperService.js +0 -68
  75. package/dist/services/logService.js +0 -35
  76. package/dist/utilities/decodeRequestBody.js +0 -40
  77. package/dist/utilities/decodeRequestErrorMessage.js +0 -36
  78. package/dist/utilities/errorHandler.js +0 -74
  79. package/dist/utilities/flushDebugLogs.js +0 -39
  80. package/dist/utilities/formAsyncParse.js +0 -37
  81. package/dist/utilities/formParse.js +0 -37
  82. package/dist/utilities/getScopedParams.js +0 -26
  83. package/dist/utilities/schemaValidator.js +0 -119
  84. package/dist/validations/validateCep.js +0 -27
  85. package/dist/validations/validateCnpj.js +0 -59
  86. package/dist/validations/validateCpf.js +0 -54
  87. package/dist/validations/validateDate.js +0 -51
  88. package/dist/validations/validateEmail.js +0 -111
  89. package/dist/validations/validatePassword.js +0 -34
  90. package/dist/validations/validatePhone.js +0 -28
  91. package/dist/validations/validateRg.js +0 -31
@@ -0,0 +1,106 @@
1
+ import { ServerError as i } from "../http/badResponses/serverError.js";
2
+ import { UnprocessableEntity as a } from "../http/badResponses/unprocessableEntity.js";
3
+ import { formAsyncParse as f } from "./formAsyncParse.js";
4
+ import { formParse as n } from "./formParse.js";
5
+ function c(o) {
6
+ const r = "Error validating:", e = o.issues.map(
7
+ ({ path: s, message: t }) => `-> ${s.join(".")}: ${t}`
8
+ );
9
+ return [r, ...e].join(`
10
+ `);
11
+ }
12
+ class E {
13
+ /**
14
+ * @param schema - The Zod schema used for all validation methods on this instance.
15
+ */
16
+ constructor(r) {
17
+ this.schema = r;
18
+ }
19
+ /**
20
+ * Returns `true` if the data satisfies the schema, `false` otherwise. Never throws.
21
+ *
22
+ * @param data - The value to check.
23
+ */
24
+ isValid(r) {
25
+ return this.schema.safeParse(r).success;
26
+ }
27
+ /**
28
+ * Validates data and returns the raw Zod `safeParseResult` without throwing.
29
+ * Useful when you need access to the full error details.
30
+ *
31
+ * @param data - The value to validate.
32
+ */
33
+ safeValidate(r) {
34
+ return this.schema.safeParse(r);
35
+ }
36
+ /**
37
+ * Validates data and returns the typed result, throwing `ServerError` on failure.
38
+ * Use for validating internal/trusted data (e.g. env vars, config objects).
39
+ *
40
+ * @param data - The value to validate.
41
+ * @throws `ServerError` with a formatted field-by-field error message.
42
+ */
43
+ validate(r) {
44
+ try {
45
+ return this.schema.parse(r);
46
+ } catch (e) {
47
+ throw new i(c(e));
48
+ }
49
+ }
50
+ /**
51
+ * Validates form data and returns the typed result, throwing `UnprocessableEntity` on failure.
52
+ * The error includes `fieldErrors`, `fields`, and `data.scrollTo` (first failing field name).
53
+ *
54
+ * @param data - The raw form data to validate.
55
+ * @param message - Optional human-readable error message for the 422 response.
56
+ * @throws `UnprocessableEntity` with structured field errors for client-side form handling.
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * const validator = new SchemaValidator(registerSchema);
61
+ * const body = validator.formValidate(await decodeRequestBody(request));
62
+ * ```
63
+ */
64
+ formValidate(r, e) {
65
+ const s = n([r, this.schema]);
66
+ if ("fieldErrors" in s) {
67
+ const t = Object.keys(s.fieldErrors)[0];
68
+ throw new a({
69
+ fields: s.fields,
70
+ fieldErrors: s.fieldErrors,
71
+ data: { scrollTo: t },
72
+ message: e
73
+ });
74
+ }
75
+ return s.data;
76
+ }
77
+ /**
78
+ * Async version of `formValidate` for schemas with async refinements (e.g. uniqueness checks).
79
+ *
80
+ * @param data - The raw form data to validate.
81
+ * @param message - Optional human-readable error message for the 422 response.
82
+ * @throws `UnprocessableEntity` with structured field errors for client-side form handling.
83
+ *
84
+ * @example
85
+ * ```typescript
86
+ * const validator = new SchemaValidator(registerSchema);
87
+ * const body = await validator.formAsyncValidate(await decodeRequestBody(request));
88
+ * ```
89
+ */
90
+ async formAsyncValidate(r, e) {
91
+ const s = await f([r, this.schema]);
92
+ if ("fieldErrors" in s) {
93
+ const t = Object.keys(s.fieldErrors)[0];
94
+ throw new a({
95
+ fields: s.fields,
96
+ fieldErrors: s.fieldErrors,
97
+ data: { scrollTo: t },
98
+ message: e
99
+ });
100
+ }
101
+ return s.data;
102
+ }
103
+ }
104
+ export {
105
+ E as SchemaValidator
106
+ };
@@ -0,0 +1,9 @@
1
+ import { removeNonNumeric as i } from "@arkyn/shared";
2
+ function c(t) {
3
+ if (!(/^\d{5}-\d{3}$/.test(t) || /^\d{8}$/.test(t))) return !1;
4
+ const e = i(t), o = 8, n = /^\d{8}$/.test(e);
5
+ return e.length === o && n;
6
+ }
7
+ export {
8
+ c as validateCep
9
+ };
@@ -0,0 +1,31 @@
1
+ import { removeNonNumeric as f } from "@arkyn/shared";
2
+ function l(t) {
3
+ return t.length !== 14;
4
+ }
5
+ function o(t) {
6
+ const [i] = t;
7
+ return [...t].every((e) => e === i);
8
+ }
9
+ function s(t, i) {
10
+ let e = 0;
11
+ for (let n = 0; n < i.length; n++)
12
+ e += parseInt(t[n]) * i[n];
13
+ const r = e % 11;
14
+ return r < 2 ? 0 : 11 - r;
15
+ }
16
+ function u(t) {
17
+ return t.slice(12);
18
+ }
19
+ function g(t) {
20
+ if (!t || t.length > 18 || t.length < 14 || /\s/.test(t)) return !1;
21
+ const e = f(t);
22
+ if (l(e) || o(e)) return !1;
23
+ const r = e.slice(0, 12), n = s(r, [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]), c = s(
24
+ r + n,
25
+ [6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]
26
+ );
27
+ return u(e) === `${n}${c}`;
28
+ }
29
+ export {
30
+ g as validateCnpj
31
+ };
@@ -0,0 +1,28 @@
1
+ import { removeNonNumeric as o } from "@arkyn/shared";
2
+ function c(t) {
3
+ return t.length !== 11;
4
+ }
5
+ function f(t) {
6
+ const [n] = t;
7
+ return [...t].every((e) => e === n);
8
+ }
9
+ function s(t, n) {
10
+ let e = 0;
11
+ for (const r of t)
12
+ n > 1 && (e += parseInt(r) * n--);
13
+ const i = e % 11;
14
+ return i < 2 ? 0 : 11 - i;
15
+ }
16
+ function l(t) {
17
+ return t.slice(9);
18
+ }
19
+ function a(t) {
20
+ if (!t || t.length > 14 || t.length < 11 || /\s/.test(t)) return !1;
21
+ const e = o(t);
22
+ if (c(e) || f(e)) return !1;
23
+ const i = s(e, 10), r = s(e, 11);
24
+ return l(e) === `${i}${r}`;
25
+ }
26
+ export {
27
+ a as validateCpf
28
+ };
@@ -0,0 +1,27 @@
1
+ import { ValidateDateService as D } from "@arkyn/shared";
2
+ function v(i, a) {
3
+ const m = (a == null ? void 0 : a.inputFormat) || "brazilianDate", u = (a == null ? void 0 : a.minYear) || 1900, d = (a == null ? void 0 : a.maxYear) || 3e3, s = new D();
4
+ s.validateInputFormat(m);
5
+ let e, r, t;
6
+ const l = i.split(/[-/]/).map(Number);
7
+ if (l.length !== 3) return !1;
8
+ try {
9
+ switch (m) {
10
+ case "brazilianDate":
11
+ [e, r, t] = l, s.validateDateParts(t, r, e);
12
+ break;
13
+ case "isoDate":
14
+ [r, e, t] = l, s.validateDateParts(t, r, e);
15
+ break;
16
+ case "timestamp":
17
+ [t, r, e] = l, s.validateDateParts(t, r, e);
18
+ break;
19
+ }
20
+ return !(t < u || t > d);
21
+ } catch {
22
+ return !1;
23
+ }
24
+ }
25
+ export {
26
+ v as validateDate
27
+ };
@@ -0,0 +1,53 @@
1
+ import s from "node:dns";
2
+ function i(t) {
3
+ return /^[a-zA-Z0-9.!$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(t);
4
+ }
5
+ function f(t) {
6
+ return !(t.length === 0 || t.length > 64 || t.startsWith(".") || t.endsWith(".") || t.includes("..") || !/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+$/.test(t));
7
+ }
8
+ function a(t) {
9
+ return !(t.length === 0 || t.length > 63 || t.startsWith("-") || t.endsWith("-") || !/^[a-zA-Z0-9-]+$/.test(t));
10
+ }
11
+ function u(t) {
12
+ if (t.length === 0 || t.length > 253 || t.startsWith(".") || t.endsWith(".") || t.startsWith("-") || t.endsWith("-"))
13
+ return !1;
14
+ const e = t.split(".");
15
+ if (e.length < 2) return !1;
16
+ for (const r of e) if (!a(r)) return !1;
17
+ const n = e[e.length - 1];
18
+ return !(n.length < 2 || !/^[a-zA-Z]+$/.test(n));
19
+ }
20
+ function l(t) {
21
+ const e = t.split("@");
22
+ if (e.length !== 2) return !1;
23
+ const [n, r] = e;
24
+ return !(!f(n) || !u(r));
25
+ }
26
+ function o(t) {
27
+ const e = t.split("@");
28
+ return e.length === 2 ? e[1].toLowerCase() : null;
29
+ }
30
+ const c = ["MX", "A", "AAAA"];
31
+ async function h(t, e) {
32
+ var n, r;
33
+ try {
34
+ return await ((r = (n = s) == null ? void 0 : n.promises) == null ? void 0 : r.resolve(t, e)), !0;
35
+ } catch {
36
+ return !1;
37
+ }
38
+ }
39
+ async function d(t) {
40
+ for (const e of c)
41
+ if (await h(t, e)) return !0;
42
+ return !1;
43
+ }
44
+ async function A(t) {
45
+ if (!t || typeof t != "string") return !1;
46
+ const e = t.trim();
47
+ if (!i(e) || !l(e)) return !1;
48
+ const n = o(e);
49
+ return n ? await d(n) : !1;
50
+ }
51
+ export {
52
+ A as validateEmail
53
+ };
@@ -0,0 +1,16 @@
1
+ function l(t) {
2
+ if (!t) return !1;
3
+ const e = t.length >= 8, n = /[A-Z]/.test(t), c = /[a-z]/.test(t), h = /\d/.test(t), s = /[!@#$%^&*(),.?":;{}|<>_\-+=~`[\]\\\/]/.test(
4
+ t
5
+ );
6
+ return [
7
+ e,
8
+ n,
9
+ c,
10
+ h,
11
+ s
12
+ ].every((i) => i);
13
+ }
14
+ export {
15
+ l as validatePassword
16
+ };
@@ -0,0 +1,10 @@
1
+ import { countries as e } from "@arkyn/templates";
2
+ import { isValidPhoneNumber as i, parsePhoneNumberWithError as u } from "libphonenumber-js";
3
+ function m(t) {
4
+ if (!i(t)) return !1;
5
+ const r = u(t), o = r == null ? void 0 : r.country;
6
+ return !(!o || !e.find((n) => n.iso === o));
7
+ }
8
+ export {
9
+ m as validatePhone
10
+ };
@@ -0,0 +1,8 @@
1
+ function i(t) {
2
+ if (!t || !/^[0-9a-zA-Z.-]+$/.test(t)) return !1;
3
+ const e = t.replace(/[^a-zA-Z0-9]/g, "");
4
+ return e.length < 7 || e.length > 9 ? !1 : /^[0-9]{7,8}[0-9Xx]?$/.test(e);
5
+ }
6
+ export {
7
+ i as validateRg
8
+ };
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@arkyn/server",
3
- "version": "3.0.1-beta.154",
3
+ "version": "3.0.1-beta.156",
4
4
  "author": "Arkyn | Lucas Gonçalves",
5
- "main": "./dist/bundle.js",
6
- "module": "./dist/bundle.js",
5
+ "main": "./dist/index.js",
6
+ "module": "./dist/index.js",
7
7
  "type": "module",
8
8
  "types": "./dist/index.d.ts",
9
9
  "license": "Apache-2.0",
@@ -26,158 +26,192 @@
26
26
  "directory": "packages/server"
27
27
  },
28
28
  "sideEffects": false,
29
+ "scripts": {
30
+ "build": "bunx vite build && bunx tsc --project tsconfig.json --emitDeclarationOnly && bun ./generate-exports.ts",
31
+ "test": "vitest --config vitest.config.ts",
32
+ "typecheck": "bunx tsc --project tsconfig.json --noEmit"
33
+ },
34
+ "peerDependencies": {
35
+ "@arkyn/shared": ">=3.0.1-beta.145",
36
+ "@arkyn/templates": ">=3.0.1-beta.145",
37
+ "zod": ">=4.3.6"
38
+ },
39
+ "devDependencies": {
40
+ "bun-types": "latest",
41
+ "vitest": "^3.2.4",
42
+ "typescript": "^5.9.3",
43
+ "vite": "^5.4.21"
44
+ },
29
45
  "exports": {
30
46
  ".": {
31
- "import": "./dist/bundle.js",
32
- "types": "./dist/index.d.ts"
47
+ "import": "./dist/index.js",
48
+ "types": "./dist/index.d.ts",
49
+ "default": "./dist/index.js"
33
50
  },
34
51
  "./apiService": {
35
- "import": "./dist/services/apiService/index.js",
36
- "types": "./dist/services/apiService/index.d.ts"
52
+ "import": "./dist/modules/services/apiService.js",
53
+ "types": "./dist/services/apiService.d.ts",
54
+ "default": "./dist/modules/services/apiService.js"
37
55
  },
38
56
  "./badGateway": {
39
- "import": "./dist/http/badResponses/badGateway/index.js",
40
- "types": "./dist/http/badResponses/badGateway/index.d.ts"
57
+ "import": "./dist/modules/http/badResponses/badGateway.js",
58
+ "types": "./dist/http/badResponses/badGateway.d.ts",
59
+ "default": "./dist/modules/http/badResponses/badGateway.js"
41
60
  },
42
61
  "./badRequest": {
43
- "import": "./dist/http/badResponses/badRequest/index.js",
44
- "types": "./dist/http/badResponses/badRequest/index.d.ts"
62
+ "import": "./dist/modules/http/badResponses/badRequest.js",
63
+ "types": "./dist/http/badResponses/badRequest.d.ts",
64
+ "default": "./dist/modules/http/badResponses/badRequest.js"
45
65
  },
46
66
  "./conflict": {
47
- "import": "./dist/http/badResponses/conflict/index.js",
48
- "types": "./dist/http/badResponses/conflict/index.d.ts"
67
+ "import": "./dist/modules/http/badResponses/conflict.js",
68
+ "types": "./dist/http/badResponses/conflict.d.ts",
69
+ "default": "./dist/modules/http/badResponses/conflict.js"
49
70
  },
50
71
  "./created": {
51
- "import": "./dist/http/successResponses/created/index.js",
52
- "types": "./dist/http/successResponses/created/index.d.ts"
72
+ "import": "./dist/modules/http/successResponses/created.js",
73
+ "types": "./dist/http/successResponses/created.d.ts",
74
+ "default": "./dist/modules/http/successResponses/created.js"
53
75
  },
54
76
  "./debugService": {
55
- "import": "./dist/services/debugService/index.js",
56
- "types": "./dist/services/debugService/index.d.ts"
77
+ "import": "./dist/modules/services/debugService.js",
78
+ "types": "./dist/services/debugService.d.ts",
79
+ "default": "./dist/modules/services/debugService.js"
57
80
  },
58
81
  "./decodeRequestBody": {
59
- "import": "./dist/utilities/decodeRequestBody/index.js",
60
- "types": "./dist/utilities/decodeRequestBody/index.d.ts"
82
+ "import": "./dist/modules/utilities/decodeRequestBody.js",
83
+ "types": "./dist/utilities/decodeRequestBody.d.ts",
84
+ "default": "./dist/modules/utilities/decodeRequestBody.js"
61
85
  },
62
86
  "./decodeRequestErrorMessage": {
63
- "import": "./dist/utilities/decodeRequestErrorMessage/index.js",
64
- "types": "./dist/utilities/decodeRequestErrorMessage/index.d.ts"
87
+ "import": "./dist/modules/utilities/decodeRequestErrorMessage.js",
88
+ "types": "./dist/utilities/decodeRequestErrorMessage.d.ts",
89
+ "default": "./dist/modules/utilities/decodeRequestErrorMessage.js"
65
90
  },
66
91
  "./errorHandler": {
67
- "import": "./dist/utilities/errorHandler/index.js",
68
- "types": "./dist/utilities/errorHandler/index.d.ts"
92
+ "import": "./dist/modules/utilities/errorHandler.js",
93
+ "types": "./dist/utilities/errorHandler.d.ts",
94
+ "default": "./dist/modules/utilities/errorHandler.js"
69
95
  },
70
96
  "./flushDebugLogs": {
71
- "import": "./dist/utilities/flushDebugLogs/index.js",
72
- "types": "./dist/utilities/flushDebugLogs/index.d.ts"
97
+ "import": "./dist/modules/utilities/flushDebugLogs.js",
98
+ "types": "./dist/utilities/flushDebugLogs.d.ts",
99
+ "default": "./dist/modules/utilities/flushDebugLogs.js"
73
100
  },
74
101
  "./forbidden": {
75
- "import": "./dist/http/badResponses/forbidden/index.js",
76
- "types": "./dist/http/badResponses/forbidden/index.d.ts"
102
+ "import": "./dist/modules/http/badResponses/forbidden.js",
103
+ "types": "./dist/http/badResponses/forbidden.d.ts",
104
+ "default": "./dist/modules/http/badResponses/forbidden.js"
77
105
  },
78
106
  "./formAsyncParse": {
79
- "import": "./dist/utilities/formAsyncParse/index.js",
80
- "types": "./dist/utilities/formAsyncParse/index.d.ts"
107
+ "import": "./dist/modules/utilities/formAsyncParse.js",
108
+ "types": "./dist/utilities/formAsyncParse.d.ts",
109
+ "default": "./dist/modules/utilities/formAsyncParse.js"
81
110
  },
82
111
  "./formParse": {
83
- "import": "./dist/utilities/formParse/index.js",
84
- "types": "./dist/utilities/formParse/index.d.ts"
112
+ "import": "./dist/modules/utilities/formParse.js",
113
+ "types": "./dist/utilities/formParse.d.ts",
114
+ "default": "./dist/modules/utilities/formParse.js"
85
115
  },
86
116
  "./found": {
87
- "import": "./dist/http/successResponses/found/index.js",
88
- "types": "./dist/http/successResponses/found/index.d.ts"
117
+ "import": "./dist/modules/http/successResponses/found.js",
118
+ "types": "./dist/http/successResponses/found.d.ts",
119
+ "default": "./dist/modules/http/successResponses/found.js"
89
120
  },
90
121
  "./getScopedParams": {
91
- "import": "./dist/utilities/getScopedParams/index.js",
92
- "types": "./dist/utilities/getScopedParams/index.d.ts"
122
+ "import": "./dist/modules/utilities/getScopedParams.js",
123
+ "types": "./dist/utilities/getScopedParams.d.ts",
124
+ "default": "./dist/modules/utilities/getScopedParams.js"
93
125
  },
94
126
  "./logService": {
95
- "import": "./dist/services/logService/index.js",
96
- "types": "./dist/services/logService/index.d.ts"
127
+ "import": "./dist/modules/services/logService.js",
128
+ "types": "./dist/services/logService.d.ts",
129
+ "default": "./dist/modules/services/logService.js"
97
130
  },
98
131
  "./noContent": {
99
- "import": "./dist/http/successResponses/noContent/index.js",
100
- "types": "./dist/http/successResponses/noContent/index.d.ts"
132
+ "import": "./dist/modules/http/successResponses/noContent.js",
133
+ "types": "./dist/http/successResponses/noContent.d.ts",
134
+ "default": "./dist/modules/http/successResponses/noContent.js"
101
135
  },
102
136
  "./notFound": {
103
- "import": "./dist/http/badResponses/notFound/index.js",
104
- "types": "./dist/http/badResponses/notFound/index.d.ts"
137
+ "import": "./dist/modules/http/badResponses/notFound.js",
138
+ "types": "./dist/http/badResponses/notFound.d.ts",
139
+ "default": "./dist/modules/http/badResponses/notFound.js"
105
140
  },
106
141
  "./notImplemented": {
107
- "import": "./dist/http/badResponses/notImplemented/index.js",
108
- "types": "./dist/http/badResponses/notImplemented/index.d.ts"
142
+ "import": "./dist/modules/http/badResponses/notImplemented.js",
143
+ "types": "./dist/http/badResponses/notImplemented.d.ts",
144
+ "default": "./dist/modules/http/badResponses/notImplemented.js"
109
145
  },
110
146
  "./schemaValidator": {
111
- "import": "./dist/utilities/schemaValidator/index.js",
112
- "types": "./dist/utilities/schemaValidator/index.d.ts"
147
+ "import": "./dist/modules/utilities/schemaValidator.js",
148
+ "types": "./dist/utilities/schemaValidator.d.ts",
149
+ "default": "./dist/modules/utilities/schemaValidator.js"
113
150
  },
114
151
  "./serverError": {
115
- "import": "./dist/http/badResponses/serverError/index.js",
116
- "types": "./dist/http/badResponses/serverError/index.d.ts"
152
+ "import": "./dist/modules/http/badResponses/serverError.js",
153
+ "types": "./dist/http/badResponses/serverError.d.ts",
154
+ "default": "./dist/modules/http/badResponses/serverError.js"
117
155
  },
118
156
  "./success": {
119
- "import": "./dist/http/successResponses/success/index.js",
120
- "types": "./dist/http/successResponses/success/index.d.ts"
157
+ "import": "./dist/modules/http/successResponses/success.js",
158
+ "types": "./dist/http/successResponses/success.d.ts",
159
+ "default": "./dist/modules/http/successResponses/success.js"
121
160
  },
122
161
  "./unauthorized": {
123
- "import": "./dist/http/badResponses/unauthorized/index.js",
124
- "types": "./dist/http/badResponses/unauthorized/index.d.ts"
162
+ "import": "./dist/modules/http/badResponses/unauthorized.js",
163
+ "types": "./dist/http/badResponses/unauthorized.d.ts",
164
+ "default": "./dist/modules/http/badResponses/unauthorized.js"
125
165
  },
126
166
  "./unprocessableEntity": {
127
- "import": "./dist/http/badResponses/unprocessableEntity/index.js",
128
- "types": "./dist/http/badResponses/unprocessableEntity/index.d.ts"
167
+ "import": "./dist/modules/http/badResponses/unprocessableEntity.js",
168
+ "types": "./dist/http/badResponses/unprocessableEntity.d.ts",
169
+ "default": "./dist/modules/http/badResponses/unprocessableEntity.js"
129
170
  },
130
171
  "./updated": {
131
- "import": "./dist/http/successResponses/updated/index.js",
132
- "types": "./dist/http/successResponses/updated/index.d.ts"
172
+ "import": "./dist/modules/http/successResponses/updated.js",
173
+ "types": "./dist/http/successResponses/updated.d.ts",
174
+ "default": "./dist/modules/http/successResponses/updated.js"
133
175
  },
134
176
  "./validateCep": {
135
- "import": "./dist/validations/validateCep/index.js",
136
- "types": "./dist/validations/validateCep/index.d.ts"
177
+ "import": "./dist/modules/validations/validateCep.js",
178
+ "types": "./dist/validations/validateCep.d.ts",
179
+ "default": "./dist/modules/validations/validateCep.js"
137
180
  },
138
181
  "./validateCnpj": {
139
- "import": "./dist/validations/validateCnpj/index.js",
140
- "types": "./dist/validations/validateCnpj/index.d.ts"
182
+ "import": "./dist/modules/validations/validateCnpj.js",
183
+ "types": "./dist/validations/validateCnpj.d.ts",
184
+ "default": "./dist/modules/validations/validateCnpj.js"
141
185
  },
142
186
  "./validateCpf": {
143
- "import": "./dist/validations/validateCpf/index.js",
144
- "types": "./dist/validations/validateCpf/index.d.ts"
187
+ "import": "./dist/modules/validations/validateCpf.js",
188
+ "types": "./dist/validations/validateCpf.d.ts",
189
+ "default": "./dist/modules/validations/validateCpf.js"
145
190
  },
146
191
  "./validateDate": {
147
- "import": "./dist/validations/validateDate/index.js",
148
- "types": "./dist/validations/validateDate/index.d.ts"
192
+ "import": "./dist/modules/validations/validateDate.js",
193
+ "types": "./dist/validations/validateDate.d.ts",
194
+ "default": "./dist/modules/validations/validateDate.js"
149
195
  },
150
196
  "./validateEmail": {
151
- "import": "./dist/validations/validateEmail/index.js",
152
- "types": "./dist/validations/validateEmail/index.d.ts"
197
+ "import": "./dist/modules/validations/validateEmail.js",
198
+ "types": "./dist/validations/validateEmail.d.ts",
199
+ "default": "./dist/modules/validations/validateEmail.js"
153
200
  },
154
201
  "./validatePassword": {
155
- "import": "./dist/validations/validatePassword/index.js",
156
- "types": "./dist/validations/validatePassword/index.d.ts"
202
+ "import": "./dist/modules/validations/validatePassword.js",
203
+ "types": "./dist/validations/validatePassword.d.ts",
204
+ "default": "./dist/modules/validations/validatePassword.js"
157
205
  },
158
206
  "./validatePhone": {
159
- "import": "./dist/validations/validatePhone/index.js",
160
- "types": "./dist/validations/validatePhone/index.d.ts"
207
+ "import": "./dist/modules/validations/validatePhone.js",
208
+ "types": "./dist/validations/validatePhone.d.ts",
209
+ "default": "./dist/modules/validations/validatePhone.js"
161
210
  },
162
211
  "./validateRg": {
163
- "import": "./dist/validations/validateRg/index.js",
164
- "types": "./dist/validations/validateRg/index.d.ts"
212
+ "import": "./dist/modules/validations/validateRg.js",
213
+ "types": "./dist/validations/validateRg.d.ts",
214
+ "default": "./dist/modules/validations/validateRg.js"
165
215
  }
166
- },
167
- "scripts": {
168
- "build": "bunx vite build && tsc && bun ./generate-exports.ts",
169
- "test": "vitest --config vitest.config.ts",
170
- "typecheck": "bunx tsc --project tsconfig.json --noEmit"
171
- },
172
- "peerDependencies": {
173
- "@arkyn/shared": ">=3.0.1-beta.145",
174
- "@arkyn/templates": ">=3.0.1-beta.145",
175
- "zod": ">=4.0.0"
176
- },
177
- "devDependencies": {
178
- "bun-types": "latest",
179
- "vitest": "^3.2.4",
180
- "typescript": "^5.9.3",
181
- "vite": "^5.4.21"
182
216
  }
183
217
  }