@arkyn/server 3.0.1-beta.166 → 3.0.1-beta.170

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 (135) hide show
  1. package/package.json +4 -3
  2. package/dist/http/api/_logRequest.d.ts +0 -58
  3. package/dist/http/api/_logRequest.d.ts.map +0 -1
  4. package/dist/http/api/_makeRequest.d.ts +0 -61
  5. package/dist/http/api/_makeRequest.d.ts.map +0 -1
  6. package/dist/http/api/deleteRequest.d.ts +0 -17
  7. package/dist/http/api/deleteRequest.d.ts.map +0 -1
  8. package/dist/http/api/getRequest.d.ts +0 -16
  9. package/dist/http/api/getRequest.d.ts.map +0 -1
  10. package/dist/http/api/patchRequest.d.ts +0 -17
  11. package/dist/http/api/patchRequest.d.ts.map +0 -1
  12. package/dist/http/api/postRequest.d.ts +0 -17
  13. package/dist/http/api/postRequest.d.ts.map +0 -1
  14. package/dist/http/api/putRequest.d.ts +0 -17
  15. package/dist/http/api/putRequest.d.ts.map +0 -1
  16. package/dist/http/badResponses/_badResponse.d.ts +0 -25
  17. package/dist/http/badResponses/_badResponse.d.ts.map +0 -1
  18. package/dist/http/badResponses/badGateway.d.ts +0 -24
  19. package/dist/http/badResponses/badGateway.d.ts.map +0 -1
  20. package/dist/http/badResponses/badRequest.d.ts +0 -22
  21. package/dist/http/badResponses/badRequest.d.ts.map +0 -1
  22. package/dist/http/badResponses/conflict.d.ts +0 -22
  23. package/dist/http/badResponses/conflict.d.ts.map +0 -1
  24. package/dist/http/badResponses/forbidden.d.ts +0 -22
  25. package/dist/http/badResponses/forbidden.d.ts.map +0 -1
  26. package/dist/http/badResponses/notFound.d.ts +0 -22
  27. package/dist/http/badResponses/notFound.d.ts.map +0 -1
  28. package/dist/http/badResponses/notImplemented.d.ts +0 -22
  29. package/dist/http/badResponses/notImplemented.d.ts.map +0 -1
  30. package/dist/http/badResponses/serverError.d.ts +0 -22
  31. package/dist/http/badResponses/serverError.d.ts.map +0 -1
  32. package/dist/http/badResponses/unauthorized.d.ts +0 -22
  33. package/dist/http/badResponses/unauthorized.d.ts.map +0 -1
  34. package/dist/http/badResponses/unprocessableEntity.d.ts +0 -34
  35. package/dist/http/badResponses/unprocessableEntity.d.ts.map +0 -1
  36. package/dist/http/successResponses/_successResponse.d.ts +0 -36
  37. package/dist/http/successResponses/_successResponse.d.ts.map +0 -1
  38. package/dist/http/successResponses/created.d.ts +0 -22
  39. package/dist/http/successResponses/created.d.ts.map +0 -1
  40. package/dist/http/successResponses/found.d.ts +0 -22
  41. package/dist/http/successResponses/found.d.ts.map +0 -1
  42. package/dist/http/successResponses/noContent.d.ts +0 -20
  43. package/dist/http/successResponses/noContent.d.ts.map +0 -1
  44. package/dist/http/successResponses/success.d.ts +0 -22
  45. package/dist/http/successResponses/success.d.ts.map +0 -1
  46. package/dist/http/successResponses/updated.d.ts +0 -23
  47. package/dist/http/successResponses/updated.d.ts.map +0 -1
  48. package/dist/index.d.ts +0 -34
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js +0 -1065
  51. package/dist/modules/http/api/_logRequest.js +0 -56
  52. package/dist/modules/http/api/_makeRequest.js +0 -70
  53. package/dist/modules/http/api/deleteRequest.js +0 -13
  54. package/dist/modules/http/api/getRequest.js +0 -12
  55. package/dist/modules/http/api/patchRequest.js +0 -13
  56. package/dist/modules/http/api/postRequest.js +0 -13
  57. package/dist/modules/http/api/putRequest.js +0 -13
  58. package/dist/modules/http/badResponses/_badResponse.js +0 -63
  59. package/dist/modules/http/badResponses/badGateway.js +0 -24
  60. package/dist/modules/http/badResponses/badRequest.js +0 -24
  61. package/dist/modules/http/badResponses/conflict.js +0 -24
  62. package/dist/modules/http/badResponses/forbidden.js +0 -24
  63. package/dist/modules/http/badResponses/notFound.js +0 -24
  64. package/dist/modules/http/badResponses/notImplemented.js +0 -24
  65. package/dist/modules/http/badResponses/serverError.js +0 -24
  66. package/dist/modules/http/badResponses/unauthorized.js +0 -24
  67. package/dist/modules/http/badResponses/unprocessableEntity.js +0 -28
  68. package/dist/modules/http/successResponses/_successResponse.js +0 -62
  69. package/dist/modules/http/successResponses/created.js +0 -24
  70. package/dist/modules/http/successResponses/found.js +0 -24
  71. package/dist/modules/http/successResponses/noContent.js +0 -17
  72. package/dist/modules/http/successResponses/success.js +0 -24
  73. package/dist/modules/http/successResponses/updated.js +0 -24
  74. package/dist/modules/index.js +0 -34
  75. package/dist/modules/services/apiService.js +0 -109
  76. package/dist/modules/services/debugService.js +0 -36
  77. package/dist/modules/services/logMapperService.js +0 -29
  78. package/dist/modules/services/logService.js +0 -21
  79. package/dist/modules/utilities/decodeRequestBody.js +0 -20
  80. package/dist/modules/utilities/decodeRequestErrorMessage.js +0 -6
  81. package/dist/modules/utilities/errorHandler.js +0 -39
  82. package/dist/modules/utilities/flushDebugLogs.js +0 -16
  83. package/dist/modules/utilities/formAsyncParse.js +0 -14
  84. package/dist/modules/utilities/formParse.js +0 -14
  85. package/dist/modules/utilities/getScopedParams.js +0 -9
  86. package/dist/modules/utilities/schemaValidator.js +0 -55
  87. package/dist/modules/validations/validateCep.js +0 -9
  88. package/dist/modules/validations/validateCnpj.js +0 -54
  89. package/dist/modules/validations/validateCpf.js +0 -27
  90. package/dist/modules/validations/validateDate.js +0 -26
  91. package/dist/modules/validations/validateEmail.js +0 -54
  92. package/dist/modules/validations/validatePassword.js +0 -12
  93. package/dist/modules/validations/validatePhone.js +0 -10
  94. package/dist/modules/validations/validateRg.js +0 -8
  95. package/dist/services/apiService.d.ts +0 -83
  96. package/dist/services/apiService.d.ts.map +0 -1
  97. package/dist/services/debugService.d.ts +0 -37
  98. package/dist/services/debugService.d.ts.map +0 -1
  99. package/dist/services/logMapperService.d.ts +0 -86
  100. package/dist/services/logMapperService.d.ts.map +0 -1
  101. package/dist/services/logService.d.ts +0 -33
  102. package/dist/services/logService.d.ts.map +0 -1
  103. package/dist/utilities/decodeRequestBody.d.ts +0 -18
  104. package/dist/utilities/decodeRequestBody.d.ts.map +0 -1
  105. package/dist/utilities/decodeRequestErrorMessage.d.ts +0 -19
  106. package/dist/utilities/decodeRequestErrorMessage.d.ts.map +0 -1
  107. package/dist/utilities/errorHandler.d.ts +0 -25
  108. package/dist/utilities/errorHandler.d.ts.map +0 -1
  109. package/dist/utilities/flushDebugLogs.d.ts +0 -24
  110. package/dist/utilities/flushDebugLogs.d.ts.map +0 -1
  111. package/dist/utilities/formAsyncParse.d.ts +0 -38
  112. package/dist/utilities/formAsyncParse.d.ts.map +0 -1
  113. package/dist/utilities/formParse.d.ts +0 -38
  114. package/dist/utilities/formParse.d.ts.map +0 -1
  115. package/dist/utilities/getScopedParams.d.ts +0 -19
  116. package/dist/utilities/getScopedParams.d.ts.map +0 -1
  117. package/dist/utilities/schemaValidator.d.ts +0 -75
  118. package/dist/utilities/schemaValidator.d.ts.map +0 -1
  119. package/dist/validations/validateCep.d.ts +0 -19
  120. package/dist/validations/validateCep.d.ts.map +0 -1
  121. package/dist/validations/validateCnpj.d.ts +0 -21
  122. package/dist/validations/validateCnpj.d.ts.map +0 -1
  123. package/dist/validations/validateCpf.d.ts +0 -16
  124. package/dist/validations/validateCpf.d.ts.map +0 -1
  125. package/dist/validations/validateDate.d.ts +0 -23
  126. package/dist/validations/validateDate.d.ts.map +0 -1
  127. package/dist/validations/validateEmail.d.ts +0 -21
  128. package/dist/validations/validateEmail.d.ts.map +0 -1
  129. package/dist/validations/validatePassword.d.ts +0 -20
  130. package/dist/validations/validatePassword.d.ts.map +0 -1
  131. package/dist/validations/validatePhone.d.ts +0 -16
  132. package/dist/validations/validatePhone.d.ts.map +0 -1
  133. package/dist/validations/validateRg.d.ts +0 -21
  134. package/dist/validations/validateRg.d.ts.map +0 -1
  135. package/generate-version.ts +0 -74
@@ -1,83 +0,0 @@
1
- type ApiServiceConstructorProps = {
2
- /** Base URL prepended to every request path (e.g. `"https://api.example.com"`). */
3
- baseUrl: string;
4
- /** Default headers merged into every request. */
5
- baseHeaders?: HeadersInit;
6
- /** Default Bearer token; can be overridden per request via `data.token`. */
7
- baseToken?: string | null;
8
- /** When `true`, logs each request and response to the console in development. */
9
- enableDebug?: boolean;
10
- };
11
- type ApiRequestDataWithoutBodyProps = {
12
- headers?: HeadersInit;
13
- token?: string;
14
- urlParams?: Record<string, string>;
15
- };
16
- type ApiRequestDataWithBodyProps = {
17
- body?: any;
18
- headers?: HeadersInit;
19
- token?: string;
20
- urlParams?: Record<string, string>;
21
- };
22
- /**
23
- * HTTP client for external API calls. Wraps fetch with base URL, default headers, optional auth token,
24
- * and per-request overrides for all standard HTTP methods.
25
- *
26
- * @example
27
- * ```typescript
28
- * const api = new ApiService({
29
- * baseUrl: "https://api.example.com",
30
- * baseToken: session.token,
31
- * enableDebug: true,
32
- * });
33
- *
34
- * const { data } = await api.get("/users/me");
35
- * const { data: created } = await api.post("/orders", { body: { productId: 1 } });
36
- * ```
37
- */
38
- declare class ApiService {
39
- private baseUrl;
40
- private baseHeaders?;
41
- private baseToken?;
42
- private enableDebug?;
43
- constructor(props: ApiServiceConstructorProps);
44
- private onDebug;
45
- private generateHeaders;
46
- /**
47
- * Sends a get request to the specified endpoint.
48
- * @param endpoint - The API endpoint to send the get request to.
49
- * @param data - The request data, including optional headers and token.
50
- * @returns The API response data.
51
- */
52
- get(endpoint: string, data?: ApiRequestDataWithoutBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
53
- /**
54
- * Sends a post request to the specified endpoint.
55
- * @param endpoint - The API endpoint to send the post request to.
56
- * @param data - The request data, including body, optional headers, and token.
57
- * @returns The API response data.
58
- */
59
- post(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
60
- /**
61
- * Sends a put request to the specified endpoint.
62
- * @param endpoint - The API endpoint to send the put request to.
63
- * @param data - The request data, including body, optional headers, and token.
64
- * @returns The API response data.
65
- */
66
- put(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
67
- /**
68
- * Sends a patch request to the specified endpoint.
69
- * @param endpoint - The API endpoint to send the patch request to.
70
- * @param data - The request data, including body, optional headers, and token.
71
- * @returns The API response data.
72
- */
73
- patch(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
74
- /**
75
- * Sends a delete request to the specified endpoint.
76
- * @param endpoint - The API endpoint to send the delete request to.
77
- * @param data - The request data, including body, optional headers, and token.
78
- * @returns The API response data.
79
- */
80
- delete(endpoint: string, data?: ApiRequestDataWithBodyProps): Promise<import("../http/api/_makeRequest").ApiResponseDTO<any>>;
81
- }
82
- export { ApiService };
83
- //# sourceMappingURL=apiService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"apiService.d.ts","sourceRoot":"","sources":["../../src/services/apiService.ts"],"names":[],"mappings":"AAOA,KAAK,0BAA0B,GAAG;IAChC,mFAAmF;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB,iDAAiD;IACjD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,iFAAiF;IACjF,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AAEF,KAAK,2BAA2B,GAAG;IACjC,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACpC,CAAC;AASF;;;;;;;;;;;;;;;GAeG;AACH,cAAM,UAAU;IACd,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,WAAW,CAAC,CAAc;IAClC,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,WAAW,CAAC,CAAU;gBAElB,KAAK,EAAE,0BAA0B;IAO7C,OAAO,CAAC,OAAO;IAiBf,OAAO,CAAC,eAAe;IAcvB;;;;;OAKG;IAEG,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,8BAA8B;IAkBjE;;;;;OAKG;IAEG,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAqB/D;;;;;OAKG;IAEG,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAqB9D;;;;;OAKG;IAEG,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;IAqBhE;;;;;OAKG;IAEG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,2BAA2B;CAoBlE;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,37 +0,0 @@
1
- /**
2
- * Manages stack-trace configuration for debug output, allowing specific adapter/wrapper files
3
- * to be skipped so logs show the actual business-logic caller.
4
- *
5
- * @example
6
- * ```typescript
7
- * // Skip httpAdapter.ts so debug output shows the calling route instead
8
- * DebugService.setIgnoreFile("httpAdapter.ts");
9
- * ```
10
- */
11
- declare class DebugService {
12
- /**
13
- * The name of the file to ignore when analyzing the stack trace.
14
- * When set, the `getCaller` function will skip stack frames containing this file name.
15
- */
16
- static ignoreFiles: string[];
17
- /**
18
- * Adds a file name to the ignore list so it is skipped when resolving the caller in stack traces.
19
- *
20
- * @param file - File name to ignore (e.g. `"httpAdapter.ts"`).
21
- */
22
- static setIgnoreFile(file: string): void;
23
- /** Resets the ignore list, restoring full stack trace analysis. */
24
- static clearIgnoreFiles(): void;
25
- /**
26
- * Resolves the file path and function name of the code that triggered the current debug call,
27
- * skipping internal node modules and any files registered with `setIgnoreFile`.
28
- *
29
- * @returns `{ functionName, callerInfo }` — caller function name and file path relative to `process.cwd()`.
30
- */
31
- static getCaller(): {
32
- functionName: string;
33
- callerInfo: string;
34
- };
35
- }
36
- export { DebugService };
37
- //# sourceMappingURL=debugService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debugService.d.ts","sourceRoot":"","sources":["../../src/services/debugService.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AAEH,cAAM,YAAY;IAChB;;;OAGG;IACH,MAAM,CAAC,WAAW,EAAE,MAAM,EAAE,CAAM;IAElC;;;;OAIG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAIxC,mEAAmE;IACnE,MAAM,CAAC,gBAAgB,IAAI,IAAI;IAI/B;;;;;OAKG;IACH,MAAM,CAAC,SAAS;;;;CAgEjB;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,86 +0,0 @@
1
- /**
2
- * Input properties for log mapping.
3
- *
4
- * @typedef {object} InputProps
5
- * @property {number} status - HTTP response status code.
6
- * @property {string} url - The request URL.
7
- * @property {"GET" | "POST" | "PUT" | "DELETE" | "PATCH"} method - HTTP method used.
8
- * @property {HeadersInit} requestHeaders - Headers sent with the request.
9
- * @property {HeadersInit} responseHeaders - Headers received in the response.
10
- * @property {any} requestBody - Body of the request.
11
- * @property {number} elapsedTime - Time elapsed for the request in milliseconds.
12
- * @property {any} responseBody - Body of the response.
13
- * @property {URLSearchParams} queryParams - Query parameters from the URL.
14
- */
15
- type InputProps = {
16
- status: number;
17
- rawUrl: string;
18
- urlParams?: Record<string, string>;
19
- method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
20
- requestHeaders: HeadersInit;
21
- responseHeaders: HeadersInit;
22
- requestBody: any;
23
- elapsedTime: number;
24
- responseBody: any;
25
- queryParams: URLSearchParams;
26
- };
27
- /**
28
- * Output properties after log mapping transformation.
29
- *
30
- * @typedef {object} OutputProps
31
- * @property {string} rawUrl - The original request URL.
32
- * @property {number} status - HTTP response status code.
33
- * @property {"GET" | "POST" | "PUT" | "DELETE" | "PATCH"} method - HTTP method used.
34
- * @property {string | null} token - Authentication token (if present).
35
- * @property {number} elapsedTime - Time elapsed for the request in milliseconds.
36
- * @property {Record<string, string>} requestHeaders - Mapped request headers.
37
- * @property {Record<string, string>} requestBody - Mapped request body.
38
- * @property {Record<string, string>} queryParams - Mapped query parameters.
39
- * @property {Record<string, string>} responseHeaders - Mapped response headers.
40
- * @property {any} responseBody - The response body.
41
- */
42
- type OutputProps = {
43
- rawUrl: string;
44
- status: number;
45
- method: "GET" | "POST" | "PUT" | "DELETE" | "PATCH";
46
- token: string | null;
47
- elapsedTime: number;
48
- requestHeaders: Record<string, string>;
49
- requestBody: Record<string, string>;
50
- queryParams: Record<string, string>;
51
- responseHeaders: Record<string, string>;
52
- responseBody: any;
53
- };
54
- /**
55
- * Static service for mapping HTTP request/response data into a standardized log format.
56
- *
57
- * Provides utilities to transform headers and query parameters into plain objects,
58
- * and produces a unified output structure for logging purposes.
59
- */
60
- declare class LogMapperService {
61
- /**
62
- * Converts various header formats into a plain key-value object.
63
- *
64
- * @param {HeadersInit} headers - The headers to map.
65
- * @returns {Record<string, string>} A plain object with header key-value pairs.
66
- * @private
67
- */
68
- private static mapHeaders;
69
- /**
70
- * Converts URLSearchParams into a plain key-value object.
71
- *
72
- * @param {URLSearchParams} queryParams - The query parameters to map.
73
- * @returns {Record<string, string>} A plain object with query parameter key-value pairs.
74
- * @private
75
- */
76
- private static mapQueryParams;
77
- /**
78
- * Transforms raw HTTP request/response data into a standardized log output format.
79
- *
80
- * @param {InputProps} props - The input properties containing request/response data.
81
- * @returns {OutputProps} The mapped output object ready for logging.
82
- */
83
- static handle(props: InputProps): OutputProps;
84
- }
85
- export { LogMapperService };
86
- //# sourceMappingURL=logMapperService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logMapperService.d.ts","sourceRoot":"","sources":["../../src/services/logMapperService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,KAAK,UAAU,GAAG;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpD,cAAc,EAAE,WAAW,CAAC;IAC5B,eAAe,EAAE,WAAW,CAAC;IAC7B,WAAW,EAAE,GAAG,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,GAAG,CAAC;IAClB,WAAW,EAAE,eAAe,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACvC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,YAAY,EAAE,GAAG,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,cAAM,gBAAgB;IACpB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAiBzB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAQ7B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW;CAiB9C;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Static service for log endpoint configuration and access.
3
- *
4
- * Stores a singleton configuration containing the traffic source identifier,
5
- * user token, and log ingestion URL.
6
- */
7
- declare class LogService {
8
- private static config?;
9
- /**
10
- * Sets the log service configuration once. Subsequent calls are ignored.
11
- *
12
- * @param config.trafficSourceId - Traffic source identifier.
13
- * @param config.userToken - User token for authentication.
14
- * @param config.logBaseApiUrl - Override the default log ingestion base URL.
15
- */
16
- static setConfig(config: {
17
- trafficSourceId: string;
18
- userToken: string;
19
- logBaseApiUrl?: string;
20
- }): void;
21
- /** Returns the stored configuration, or `undefined` if `setConfig` has not been called. */
22
- static getConfig(): {
23
- trafficSourceId: string;
24
- userToken: string;
25
- apiUrl: string;
26
- } | undefined;
27
- /**
28
- * Resets the stored configuration, allowing a new initialization.
29
- */
30
- static resetConfig(): void;
31
- }
32
- export { LogService };
33
- //# sourceMappingURL=logService.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logService.d.ts","sourceRoot":"","sources":["../../src/services/logService.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAIpB;IAEF;;;;;;OAMG;IACH,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE;QACvB,eAAe,EAAE,MAAM,CAAC;QACxB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,CAAC,EAAE,MAAM,CAAC;KACxB,GAAG,IAAI;IAUR,2FAA2F;IAC3F,MAAM,CAAC,SAAS,IACZ;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAC9D,SAAS;IAIb;;OAEG;IACH,MAAM,CAAC,WAAW;CAGnB;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * Decodes a request body into a plain object, trying JSON first then URL-encoded form data.
3
- * Throws `BadRequest` if neither format can be parsed.
4
- *
5
- * @param request - The incoming request whose body will be decoded.
6
- * @returns The decoded body as a plain object.
7
- *
8
- * @example
9
- * ```typescript
10
- * export async function action({ request }: ActionFunctionArgs) {
11
- * const body = await decodeRequestBody(request);
12
- * // body is now a plain JS object
13
- * }
14
- * ```
15
- */
16
- declare function decodeRequestBody(request: Request): Promise<any>;
17
- export { decodeRequestBody };
18
- //# sourceMappingURL=decodeRequestBody.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decodeRequestBody.d.ts","sourceRoot":"","sources":["../../src/utilities/decodeRequestBody.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AAEH,iBAAe,iBAAiB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAsB/D;AAED,OAAO,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Extracts a human-readable error message from an API response body or a `Response` object.
3
- * Checks `data.message`, `data.operator_erro_message`, `data.error`, `data.error.message`,
4
- * and `response.statusText` in that order. Falls back to `"Missing error message"`.
5
- *
6
- * @param data - Parsed response body that may contain error info.
7
- * @param response - The raw `Response` object, used as a fallback for `statusText`.
8
- * @returns The first non-empty string error message found.
9
- *
10
- * @example
11
- * ```typescript
12
- * const res = await fetch("/api/orders");
13
- * const data = await res.json().catch(() => null);
14
- * const message = decodeRequestErrorMessage(data, res);
15
- * ```
16
- */
17
- declare function decodeRequestErrorMessage(data: any, response: Response): string;
18
- export { decodeRequestErrorMessage };
19
- //# sourceMappingURL=decodeRequestErrorMessage.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"decodeRequestErrorMessage.d.ts","sourceRoot":"","sources":["../../src/utilities/decodeRequestErrorMessage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,iBAAS,yBAAyB,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAyBxE;AAED,OAAO,EAAE,yBAAyB,EAAE,CAAC"}
@@ -1,25 +0,0 @@
1
- /**
2
- * Converts any thrown value into a `Response`. Recognizes all `@arkyn/server` success and error
3
- * response classes, native `Response` objects, and falls back to a 500 `ServerError` for anything else.
4
- *
5
- * Intended to be used as the catch handler of a route action or loader:
6
- *
7
- * @param error - The thrown value to convert.
8
- * @returns A `Response` with the appropriate HTTP status, headers, and JSON body.
9
- *
10
- * @example
11
- * ```typescript
12
- * export async function action({ request }: ActionFunctionArgs) {
13
- * try {
14
- * const user = await findUser(id);
15
- * if (!user) throw new NotFound("User not found");
16
- * return new Success("User retrieved", { user }).toJson();
17
- * } catch (error) {
18
- * return errorHandler(error);
19
- * }
20
- * }
21
- * ```
22
- */
23
- declare function errorHandler(error: any): Response;
24
- export { errorHandler };
25
- //# sourceMappingURL=errorHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errorHandler.d.ts","sourceRoot":"","sources":["../../src/utilities/errorHandler.ts"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,QAAQ,CAsC1C;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,24 +0,0 @@
1
- /**
2
- * Writes colored `[name] message` lines to the console, but only when
3
- * `NODE_ENV === "development"` or `DEBUG_MODE === "true"`. No-op in production.
4
- *
5
- * @param props.name - Label shown before each line (e.g. `"API"`, `"Auth"`).
6
- * @param props.scheme - Color of the label tag: `"cyan"` info, `"green"` success, `"yellow"` warning, `"red"` error.
7
- * @param props.debugs - Lines of text to print, one per console entry.
8
- *
9
- * @example
10
- * ```typescript
11
- * flushDebugLogs({
12
- * name: "API",
13
- * scheme: "cyan",
14
- * debugs: ["POST /api/users", "Status: 201"],
15
- * });
16
- * ```
17
- */
18
- declare function flushDebugLogs(props: {
19
- scheme: "yellow" | "cyan" | "red" | "green";
20
- name: string;
21
- debugs: string[];
22
- }): void;
23
- export { flushDebugLogs };
24
- //# sourceMappingURL=flushDebugLogs.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"flushDebugLogs.d.ts","sourceRoot":"","sources":["../../src/utilities/flushDebugLogs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,iBAAS,cAAc,CAAC,KAAK,EAAE;IAC7B,MAAM,EAAE,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,GAAG,IAAI,CAyBP;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,38 +0,0 @@
1
- import type { ZodType } from "zod";
2
- type SuccessResponse<T extends FormParseProps> = {
3
- success: true;
4
- data: T[1] extends ZodType<infer U> ? U : never;
5
- };
6
- type ErrorResponse = {
7
- success: false;
8
- fields: {
9
- [x: string]: string;
10
- };
11
- fieldErrors: {
12
- [x: string]: string;
13
- };
14
- };
15
- type FormParseProps = [formData: {
16
- [k: string]: any;
17
- }, schema: ZodType];
18
- type FormParseReturnType<T extends FormParseProps> = SuccessResponse<T> | ErrorResponse;
19
- /**
20
- * Async variant of `formParse` — uses `safeParseAsync` to support Zod schemas with async refinements.
21
- * Returns `{ success: true, data }` on success or `{ success: false, fieldErrors, fields }` on failure.
22
- *
23
- * @param formData - The raw form data object to validate.
24
- * @param schema - The Zod schema to validate against.
25
- *
26
- * @example
27
- * ```typescript
28
- * const schema = z.object({ email: z.string().email() });
29
- * const result = await formAsyncParse([{ email: "bad" }, schema]);
30
- *
31
- * if (!result.success) {
32
- * console.log(result.fieldErrors); // { email: "Invalid email" }
33
- * }
34
- * ```
35
- */
36
- declare function formAsyncParse<T extends FormParseProps>([formData, schema,]: T): Promise<FormParseReturnType<T>>;
37
- export { formAsyncParse };
38
- //# sourceMappingURL=formAsyncParse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formAsyncParse.d.ts","sourceRoot":"","sources":["../../src/utilities/formAsyncParse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEnC,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/C,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAChC,WAAW,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC,CAAC;AAEF,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAExE,KAAK,mBAAmB,CAAC,CAAC,SAAS,cAAc,IAC7C,eAAe,CAAC,CAAC,CAAC,GAClB,aAAa,CAAC;AAElB;;;;;;;;;;;;;;;;GAgBG;AAEH,iBAAe,cAAc,CAAC,CAAC,SAAS,cAAc,EAAE,CACtD,QAAQ,EACR,MAAM,EACP,EAAE,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAqBrC;AAED,OAAO,EAAE,cAAc,EAAE,CAAC"}
@@ -1,38 +0,0 @@
1
- import type { ZodType } from "zod";
2
- type SuccessResponse<T extends FormParseProps> = {
3
- success: true;
4
- data: T[1] extends ZodType<infer U> ? U : never;
5
- };
6
- type ErrorResponse = {
7
- success: false;
8
- fields: {
9
- [x: string]: string;
10
- };
11
- fieldErrors: {
12
- [x: string]: string;
13
- };
14
- };
15
- type FormParseProps = [formData: {
16
- [k: string]: any;
17
- }, schema: ZodType];
18
- type FormParseReturnType<T extends FormParseProps> = SuccessResponse<T> | ErrorResponse;
19
- /**
20
- * Validates form data against a Zod schema synchronously.
21
- * Returns `{ success: true, data }` on success or `{ success: false, fieldErrors, fields }` on failure.
22
- *
23
- * @param formData - The raw form data object to validate.
24
- * @param schema - The Zod schema to validate against.
25
- *
26
- * @example
27
- * ```typescript
28
- * const schema = z.object({ name: z.string().min(1, "Required"), age: z.number().min(18) });
29
- * const result = formParse([{ name: "", age: 15 }, schema]);
30
- *
31
- * if (!result.success) {
32
- * console.log(result.fieldErrors); // { name: "Required", age: "..." }
33
- * }
34
- * ```
35
- */
36
- declare function formParse<T extends FormParseProps>([formData, schema,]: T): FormParseReturnType<T>;
37
- export { formParse };
38
- //# sourceMappingURL=formParse.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formParse.d.ts","sourceRoot":"","sources":["../../src/utilities/formParse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAEnC,KAAK,eAAe,CAAC,CAAC,SAAS,cAAc,IAAI;IAC/C,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;CACjD,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAChC,WAAW,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACtC,CAAC;AAEF,KAAK,cAAc,GAAG,CAAC,QAAQ,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;AAExE,KAAK,mBAAmB,CAAC,CAAC,SAAS,cAAc,IAC7C,eAAe,CAAC,CAAC,CAAC,GAClB,aAAa,CAAC;AAElB;;;;;;;;;;;;;;;;GAgBG;AAEH,iBAAS,SAAS,CAAC,CAAC,SAAS,cAAc,EAAE,CAC3C,QAAQ,EACR,MAAM,EACP,EAAE,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,CAqB5B;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Extracts URL search parameters from a request, optionally filtered by a namespace prefix
3
- * (e.g. `scope:key` → `key`). Without a scope, returns all search params as-is.
4
- *
5
- * @param request - The incoming request whose URL will be parsed.
6
- * @param scope - Namespace prefix to filter by (e.g. `"table"` matches `table:page`, `table:sort`).
7
- * @returns A `URLSearchParams` object with the matching params, stripped of the scope prefix.
8
- *
9
- * @example
10
- * ```typescript
11
- * // URL: /products?table:page=2&table:sort=asc&other=1
12
- * const params = getScopedParams(request, "table");
13
- * params.get("page"); // "2"
14
- * params.get("sort"); // "asc"
15
- * ```
16
- */
17
- declare function getScopedParams(request: Request, scope?: string): URLSearchParams;
18
- export { getScopedParams };
19
- //# sourceMappingURL=getScopedParams.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getScopedParams.d.ts","sourceRoot":"","sources":["../../src/utilities/getScopedParams.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,iBAAS,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,GAAE,MAAW,mBAW5D;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,75 +0,0 @@
1
- import type { ZodType, z } from "zod";
2
- /**
3
- * Wraps a Zod schema with convenience validation methods suited for server-side use:
4
- * - `isValid` — boolean check, no throws
5
- * - `safeValidate` — raw Zod result, no throws
6
- * - `validate` — throws `ServerError` on failure (for trusted/internal data)
7
- * - `formValidate` / `formAsyncValidate` — throws `UnprocessableEntity` on failure (for user-submitted forms)
8
- *
9
- * @example
10
- * ```typescript
11
- * const validator = new SchemaValidator(z.object({ email: z.string().email() }));
12
- *
13
- * // Inside a Remix action:
14
- * const body = validator.formValidate(await decodeRequestBody(request));
15
- * ```
16
- */
17
- declare class SchemaValidator<T extends ZodType> {
18
- readonly schema: T;
19
- /**
20
- * @param schema - The Zod schema used for all validation methods on this instance.
21
- */
22
- constructor(schema: T);
23
- /**
24
- * Returns `true` if the data satisfies the schema, `false` otherwise. Never throws.
25
- *
26
- * @param data - The value to check.
27
- */
28
- isValid(data: any): boolean;
29
- /**
30
- * Validates data and returns the raw Zod `safeParseResult` without throwing.
31
- * Useful when you need access to the full error details.
32
- *
33
- * @param data - The value to validate.
34
- */
35
- safeValidate(data: any): z.ZodSafeParseResult<z.infer<T>>;
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(data: any): z.infer<T>;
44
- /**
45
- * Validates form data and returns the typed result, throwing `UnprocessableEntity` on failure.
46
- * The error includes `fieldErrors`, `fields`, and `data.scrollTo` (first failing field name).
47
- *
48
- * @param data - The raw form data to validate.
49
- * @param message - Optional human-readable error message for the 422 response.
50
- * @throws `UnprocessableEntity` with structured field errors for client-side form handling.
51
- *
52
- * @example
53
- * ```typescript
54
- * const validator = new SchemaValidator(registerSchema);
55
- * const body = validator.formValidate(await decodeRequestBody(request));
56
- * ```
57
- */
58
- formValidate(data: any, message?: string): z.infer<T>;
59
- /**
60
- * Async version of `formValidate` for schemas with async refinements (e.g. uniqueness checks).
61
- *
62
- * @param data - The raw form data to validate.
63
- * @param message - Optional human-readable error message for the 422 response.
64
- * @throws `UnprocessableEntity` with structured field errors for client-side form handling.
65
- *
66
- * @example
67
- * ```typescript
68
- * const validator = new SchemaValidator(registerSchema);
69
- * const body = await validator.formAsyncValidate(await decodeRequestBody(request));
70
- * ```
71
- */
72
- formAsyncValidate(data: any, message?: string): Promise<z.infer<T>>;
73
- }
74
- export { SchemaValidator };
75
- //# sourceMappingURL=schemaValidator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schemaValidator.d.ts","sourceRoot":"","sources":["../../src/utilities/schemaValidator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBtC;;;;;;;;;;;;;;GAcG;AACH,cAAM,eAAe,CAAC,CAAC,SAAS,OAAO;IAIzB,QAAQ,CAAC,MAAM,EAAE,CAAC;IAH9B;;OAEG;gBACkB,MAAM,EAAE,CAAC;IAE9B;;;;OAIG;IACH,OAAO,CAAC,IAAI,EAAE,GAAG,GAAG,OAAO;IAI3B;;;;;OAKG;IACH,YAAY,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAIzD;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAQ/B;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAiBrD;;;;;;;;;;;;OAYG;IACG,iBAAiB,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;CAgB1E;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,19 +0,0 @@
1
- /**
2
- * Validates a Brazilian CEP (postal code).
3
- *
4
- * A valid CEP must contain exactly 8 numeric digits,
5
- * optionally formatted as "12345-678".
6
- *
7
- * @param rawCep - CEP value, with or without formatting.
8
- * @returns `true` if the CEP is valid, otherwise `false`.
9
- *
10
- * @example
11
- * ```typescript
12
- * validateCep("12345-678"); // true
13
- * validateCep("12345678"); // true
14
- * validateCep("ABCDE-123"); // false
15
- * ```
16
- */
17
- declare function validateCep(rawCep: string): boolean;
18
- export { validateCep };
19
- //# sourceMappingURL=validateCep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateCep.d.ts","sourceRoot":"","sources":["../../src/validations/validateCep.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,iBAAS,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAU5C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Validates a Brazilian CNPJ (Cadastro Nacional da Pessoa Jurídica) number.
3
- *
4
- * This function performs:
5
- * - Sanitization (removes non-digit characters).
6
- * - Length check (must be 14 digits).
7
- * - Repeating digits check (invalid if all digits are the same).
8
- * - Verifies the two check digits with the proper weights.
9
- *
10
- * @param rawCnpj - CNPJ string, possibly formatted.
11
- * @returns `true` if valid, otherwise `false`.
12
- *
13
- * @example
14
- * ```typescript
15
- * validateCnpj("12.345.678/0001-95"); // false
16
- * validateCnpj("11.444.777/0001-61"); // true
17
- * ```
18
- */
19
- declare function validateCnpj(rawCnpj: string): boolean;
20
- export { validateCnpj };
21
- //# sourceMappingURL=validateCnpj.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateCnpj.d.ts","sourceRoot":"","sources":["../../src/validations/validateCnpj.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAqB9C;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,16 +0,0 @@
1
- /**
2
- * Validates a Brazilian CPF number. Strips formatting, checks length, rejects
3
- * repeated-digit sequences, and verifies both check digits with the CPF algorithm.
4
- *
5
- * @param rawCpf - CPF string, with or without formatting (dots and dashes).
6
- * @returns `true` if the CPF is valid, otherwise `false`.
7
- *
8
- * @example
9
- * ```typescript
10
- * validateCpf("123.456.789-09"); // false
11
- * validateCpf("111.444.777-35"); // true
12
- * ```
13
- */
14
- declare function validateCpf(rawCpf: string): boolean;
15
- export { validateCpf };
16
- //# sourceMappingURL=validateCpf.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validateCpf.d.ts","sourceRoot":"","sources":["../../src/validations/validateCpf.ts"],"names":[],"mappings":"AAyBA;;;;;;;;;;;;GAYG;AAEH,iBAAS,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAiB5C;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,23 +0,0 @@
1
- /**
2
- * Validates a date string against a format and optional year bounds.
3
- *
4
- * @param date - The date string to validate.
5
- * @param config.inputFormat - Parsing format: `"brazilianDate"` (DD/MM/YYYY, default), `"isoDate"` (MM-DD-YYYY), or `"timestamp"` (YYYY-MM-DD).
6
- * @param config.minYear - Minimum allowed year. Defaults to 1900.
7
- * @param config.maxYear - Maximum allowed year. Defaults to 3000.
8
- * @returns `true` if the date is valid according to the format and bounds, otherwise `false`.
9
- *
10
- * @example
11
- * ```typescript
12
- * validateDate("31/12/2023"); // true
13
- * validateDate("2023-12-31", { inputFormat: "timestamp", minYear: 2000, maxYear: 2100 }); // true
14
- * validateDate("29/02/2023"); // false (not a leap year)
15
- * ```
16
- */
17
- declare function validateDate(date: string, config?: {
18
- inputFormat?: "brazilianDate" | "isoDate" | "timestamp";
19
- minYear?: number;
20
- maxYear?: number;
21
- }): boolean;
22
- export { validateDate };
23
- //# sourceMappingURL=validateDate.d.ts.map