@arkyn/server 3.0.1-beta.201 → 3.0.1-beta.204
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +184 -1
- package/README.md +1 -1
- package/dist/http/api/{deleteRequest.d.ts → _deleteRequest.d.ts} +1 -1
- package/dist/http/api/_deleteRequest.d.ts.map +1 -0
- package/dist/http/api/{getRequest.d.ts → _getRequest.d.ts} +1 -1
- package/dist/http/api/_getRequest.d.ts.map +1 -0
- package/dist/{services/logMapperService.d.ts → http/api/_logMapperService.d.ts} +1 -1
- package/dist/http/api/_logMapperService.d.ts.map +1 -0
- package/dist/http/api/{patchRequest.d.ts → _patchRequest.d.ts} +1 -1
- package/dist/http/api/_patchRequest.d.ts.map +1 -0
- package/dist/http/api/{postRequest.d.ts → _postRequest.d.ts} +1 -1
- package/dist/http/api/_postRequest.d.ts.map +1 -0
- package/dist/http/api/{putRequest.d.ts → _putRequest.d.ts} +1 -1
- package/dist/http/api/_putRequest.d.ts.map +1 -0
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -0
- package/dist/modules/http/api/{deleteRequest.js → _deleteRequest.js} +3 -1
- package/dist/modules/http/api/_deleteRequest.js.map +1 -0
- package/dist/modules/http/api/{getRequest.js → _getRequest.js} +3 -1
- package/dist/modules/http/api/_getRequest.js.map +1 -0
- package/dist/modules/{services/logMapperService.js → http/api/_logMapperService.js} +3 -1
- package/dist/modules/http/api/_logMapperService.js.map +1 -0
- package/dist/modules/http/api/_logRequest.js +2 -0
- package/dist/modules/http/api/_logRequest.js.map +1 -0
- package/dist/modules/http/api/_makeRequest.js +3 -1
- package/dist/modules/http/api/_makeRequest.js.map +1 -0
- package/dist/modules/http/api/{patchRequest.js → _patchRequest.js} +3 -1
- package/dist/modules/http/api/_patchRequest.js.map +1 -0
- package/dist/modules/http/api/{postRequest.js → _postRequest.js} +3 -1
- package/dist/modules/http/api/_postRequest.js.map +1 -0
- package/dist/modules/http/api/{putRequest.js → _putRequest.js} +3 -1
- package/dist/modules/http/api/_putRequest.js.map +1 -0
- package/dist/modules/http/badResponses/_badResponse.js +2 -0
- package/dist/modules/http/badResponses/_badResponse.js.map +1 -0
- package/dist/modules/http/badResponses/badGateway.js +2 -0
- package/dist/modules/http/badResponses/badGateway.js.map +1 -0
- package/dist/modules/http/badResponses/badRequest.js +2 -0
- package/dist/modules/http/badResponses/badRequest.js.map +1 -0
- package/dist/modules/http/badResponses/conflict.js +2 -0
- package/dist/modules/http/badResponses/conflict.js.map +1 -0
- package/dist/modules/http/badResponses/forbidden.js +2 -0
- package/dist/modules/http/badResponses/forbidden.js.map +1 -0
- package/dist/modules/http/badResponses/notFound.js +2 -0
- package/dist/modules/http/badResponses/notFound.js.map +1 -0
- package/dist/modules/http/badResponses/notImplemented.js +2 -0
- package/dist/modules/http/badResponses/notImplemented.js.map +1 -0
- package/dist/modules/http/badResponses/serverError.js +2 -0
- package/dist/modules/http/badResponses/serverError.js.map +1 -0
- package/dist/modules/http/badResponses/unauthorized.js +2 -0
- package/dist/modules/http/badResponses/unauthorized.js.map +1 -0
- package/dist/modules/http/badResponses/unprocessableEntity.js +2 -0
- package/dist/modules/http/badResponses/unprocessableEntity.js.map +1 -0
- package/dist/modules/http/successResponses/_successResponse.js +2 -0
- package/dist/modules/http/successResponses/_successResponse.js.map +1 -0
- package/dist/modules/http/successResponses/created.js +2 -0
- package/dist/modules/http/successResponses/created.js.map +1 -0
- package/dist/modules/http/successResponses/found.js +2 -0
- package/dist/modules/http/successResponses/found.js.map +1 -0
- package/dist/modules/http/successResponses/noContent.js +2 -0
- package/dist/modules/http/successResponses/noContent.js.map +1 -0
- package/dist/modules/http/successResponses/success.js +2 -0
- package/dist/modules/http/successResponses/success.js.map +1 -0
- package/dist/modules/http/successResponses/updated.js +2 -0
- package/dist/modules/http/successResponses/updated.js.map +1 -0
- package/dist/modules/services/apiService.js +7 -5
- package/dist/modules/services/apiService.js.map +1 -0
- package/dist/modules/services/debugService.js +2 -0
- package/dist/modules/services/debugService.js.map +1 -0
- package/dist/modules/services/logService.js +2 -0
- package/dist/modules/services/logService.js.map +1 -0
- package/dist/modules/utilities/decodeRequestBody.js +2 -0
- package/dist/modules/utilities/decodeRequestBody.js.map +1 -0
- package/dist/modules/utilities/decodeRequestErrorMessage.js +2 -0
- package/dist/modules/utilities/decodeRequestErrorMessage.js.map +1 -0
- package/dist/modules/utilities/errorHandler.js +2 -0
- package/dist/modules/utilities/errorHandler.js.map +1 -0
- package/dist/modules/utilities/flushDebugLogs.js +2 -0
- package/dist/modules/utilities/flushDebugLogs.js.map +1 -0
- package/dist/modules/utilities/formAsyncParse.js +2 -0
- package/dist/modules/utilities/formAsyncParse.js.map +1 -0
- package/dist/modules/utilities/formParse.js +2 -0
- package/dist/modules/utilities/formParse.js.map +1 -0
- package/dist/modules/utilities/getScopedParams.js +2 -0
- package/dist/modules/utilities/getScopedParams.js.map +1 -0
- package/dist/modules/utilities/schemaValidator.js +2 -0
- package/dist/modules/utilities/schemaValidator.js.map +1 -0
- package/dist/modules/validations/validateCep.js +2 -0
- package/dist/modules/validations/validateCep.js.map +1 -0
- package/dist/modules/validations/validateCnpj.js +2 -0
- package/dist/modules/validations/validateCnpj.js.map +1 -0
- package/dist/modules/validations/validateCpf.js +2 -0
- package/dist/modules/validations/validateCpf.js.map +1 -0
- package/dist/modules/validations/validateDate.js +2 -0
- package/dist/modules/validations/validateDate.js.map +1 -0
- package/dist/modules/validations/validateEmail.js +2 -0
- package/dist/modules/validations/validateEmail.js.map +1 -0
- package/dist/modules/validations/validatePassword.js +2 -0
- package/dist/modules/validations/validatePassword.js.map +1 -0
- package/dist/modules/validations/validatePhone.js +2 -0
- package/dist/modules/validations/validatePhone.js.map +1 -0
- package/dist/modules/validations/validateRg.js +2 -0
- package/dist/modules/validations/validateRg.js.map +1 -0
- package/package.json +116 -5
- package/dist/http/api/deleteRequest.d.ts.map +0 -1
- package/dist/http/api/getRequest.d.ts.map +0 -1
- package/dist/http/api/patchRequest.d.ts.map +0 -1
- package/dist/http/api/postRequest.d.ts.map +0 -1
- package/dist/http/api/putRequest.d.ts.map +0 -1
- package/dist/modules/index.js +0 -34
- package/dist/services/logMapperService.d.ts.map +0 -1
package/LICENSE.txt
CHANGED
|
@@ -1,10 +1,193 @@
|
|
|
1
|
+
|
|
1
2
|
Apache License
|
|
2
3
|
Version 2.0, January 2004
|
|
3
4
|
http://www.apache.org/licenses/
|
|
4
5
|
|
|
5
6
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 - Arkyn | Lucas Eduardo Gonçalves
|
|
8
191
|
|
|
9
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
10
193
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -22,7 +22,7 @@ Backend code — Remix/React Router loaders and actions, or any fetch-based serv
|
|
|
22
22
|
|
|
23
23
|
## 📋 Prerequisites
|
|
24
24
|
|
|
25
|
-
- **Node.js** `>=
|
|
25
|
+
- **Node.js** `>=18.0.0` or **Bun** `>=1.0.0`
|
|
26
26
|
- Peer dependencies (install alongside `@arkyn/server`):
|
|
27
27
|
- `zod >=4.4.3` — required by `SchemaValidator`, `formParse`, and `formAsyncParse`.
|
|
28
28
|
- `libphonenumber-js >=1.13.7` — required by `validatePhone`.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_deleteRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/_deleteRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,aAAa,CAAC,CAAC,GAAG,GAAG,EACnC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_getRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/_getRequest.ts"],"names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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;IAExC,YAAY,EAAE,GAAG,CAAC;CAClB,CAAC;AAEF;;;;;GAKG;AACH,cAAM,gBAAgB;IACrB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAiBzB;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAY7B;;;;;OAKG;IACH,MAAM,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,WAAW;CAiB7C;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_patchRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/_patchRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,YAAY,CAAC,CAAC,GAAG,GAAG,EAClC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_postRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/_postRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,WAAW,CAAC,CAAC,GAAG,GAAG,EACjC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_putRequest.d.ts","sourceRoot":"","sources":["../../../src/http/api/_putRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAe,MAAM,gBAAgB,CAAC;AAElE,KAAK,UAAU,GAAG;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF;;;;;;GAMG;AAGH,iBAAe,UAAU,CAAC,CAAC,GAAG,GAAG,EAChC,KAAK,EAAE,UAAU,GACf,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAQ5B;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -592,7 +592,7 @@ async function A(e) {
|
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
//#endregion
|
|
595
|
-
//#region src/http/api/
|
|
595
|
+
//#region src/http/api/_deleteRequest.ts
|
|
596
596
|
async function j(e) {
|
|
597
597
|
return A({
|
|
598
598
|
method: "DELETE",
|
|
@@ -603,7 +603,7 @@ async function j(e) {
|
|
|
603
603
|
});
|
|
604
604
|
}
|
|
605
605
|
//#endregion
|
|
606
|
-
//#region src/http/api/
|
|
606
|
+
//#region src/http/api/_getRequest.ts
|
|
607
607
|
async function M(e) {
|
|
608
608
|
return A({
|
|
609
609
|
method: "GET",
|
|
@@ -613,7 +613,7 @@ async function M(e) {
|
|
|
613
613
|
});
|
|
614
614
|
}
|
|
615
615
|
//#endregion
|
|
616
|
-
//#region src/http/api/
|
|
616
|
+
//#region src/http/api/_patchRequest.ts
|
|
617
617
|
async function ee(e) {
|
|
618
618
|
return A({
|
|
619
619
|
method: "PATCH",
|
|
@@ -624,7 +624,7 @@ async function ee(e) {
|
|
|
624
624
|
});
|
|
625
625
|
}
|
|
626
626
|
//#endregion
|
|
627
|
-
//#region src/http/api/
|
|
627
|
+
//#region src/http/api/_postRequest.ts
|
|
628
628
|
async function N(e) {
|
|
629
629
|
return A({
|
|
630
630
|
method: "POST",
|
|
@@ -635,7 +635,7 @@ async function N(e) {
|
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
637
|
//#endregion
|
|
638
|
-
//#region src/http/api/
|
|
638
|
+
//#region src/http/api/_putRequest.ts
|
|
639
639
|
async function P(e) {
|
|
640
640
|
return A({
|
|
641
641
|
method: "PUT",
|
|
@@ -1065,3 +1065,5 @@ function he(e) {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
//#endregion
|
|
1067
1067
|
export { F as ApiService, f as BadGateway, p as BadRequest, m as Conflict, S as Created, l as DebugService, h as Forbidden, C as Found, O as LogService, w as NoContent, g as NotFound, _ as NotImplemented, U as SchemaValidator, v as ServerError, T as Success, y as Unauthorized, b as UnprocessableEntity, E as Updated, I as decodeRequestBody, L as decodeRequestErrorMessage, R as errorHandler, u as flushDebugLogs, z as formAsyncParse, B as formParse, V as getScopedParams, W as validateCep, te as validateCnpj, ne as validateCpf, re as validateDate, fe as validateEmail, pe as validatePassword, me as validatePhone, he as validateRg };
|
|
1068
|
+
|
|
1069
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/services/debugService.ts","../src/utilities/flushDebugLogs.ts","../src/http/badResponses/_badResponse.ts","../src/http/badResponses/badGateway.ts","../src/http/badResponses/badRequest.ts","../src/http/badResponses/conflict.ts","../src/http/badResponses/forbidden.ts","../src/http/badResponses/notFound.ts","../src/http/badResponses/notImplemented.ts","../src/http/badResponses/serverError.ts","../src/http/badResponses/unauthorized.ts","../src/http/badResponses/unprocessableEntity.ts","../src/http/successResponses/_successResponse.ts","../src/http/successResponses/created.ts","../src/http/successResponses/found.ts","../src/http/successResponses/noContent.ts","../src/http/successResponses/success.ts","../src/http/successResponses/updated.ts","../src/http/api/_logMapperService.ts","../src/services/logService.ts","../src/http/api/_logRequest.ts","../src/http/api/_makeRequest.ts","../src/http/api/_deleteRequest.ts","../src/http/api/_getRequest.ts","../src/http/api/_patchRequest.ts","../src/http/api/_postRequest.ts","../src/http/api/_putRequest.ts","../src/services/apiService.ts","../src/utilities/decodeRequestBody.ts","../src/utilities/decodeRequestErrorMessage.ts","../src/utilities/errorHandler.ts","../src/utilities/formAsyncParse.ts","../src/utilities/formParse.ts","../src/utilities/getScopedParams.ts","../src/utilities/schemaValidator.ts","../src/validations/validateCep.ts","../src/validations/validateCnpj.ts","../src/validations/validateCpf.ts","../src/validations/validateDate.ts","../src/validations/validateEmail.ts","../src/validations/validatePassword.ts","../src/validations/validatePhone.ts","../src/validations/validateRg.ts"],"sourcesContent":["import path from \"node:path\";\n\n/**\n * Manages stack-trace configuration for debug output, allowing specific adapter/wrapper files\n * to be skipped so logs show the actual business-logic caller.\n *\n * @example\n * ```typescript\n * // Skip httpAdapter.ts so debug output shows the calling route instead\n * DebugService.setIgnoreFile(\"httpAdapter.ts\");\n * ```\n */\n\nclass DebugService {\n\t/**\n\t * The name of the file to ignore when analyzing the stack trace.\n\t * When set, the `getCaller` function will skip stack frames containing this file name.\n\t */\n\tstatic ignoreFiles: string[] = [];\n\n\t/**\n\t * Adds a file name to the ignore list so it is skipped when resolving the caller in stack traces.\n\t *\n\t * @param file - File name to ignore (e.g. `\"httpAdapter.ts\"`).\n\t */\n\tstatic setIgnoreFile(file: string): void {\n\t\tDebugService.ignoreFiles.push(file);\n\t}\n\n\t/** Resets the ignore list, restoring full stack trace analysis. */\n\tstatic clearIgnoreFiles(): void {\n\t\tDebugService.ignoreFiles = [];\n\t}\n\n\t/**\n\t * Resolves the file path and function name of the code that triggered the current debug call,\n\t * skipping internal node modules and any files registered with `setIgnoreFile`.\n\t *\n\t * @returns `{ functionName, callerInfo }` — caller function name and file path relative to `process.cwd()`.\n\t */\n\tstatic getCaller() {\n\t\tconst projectRoot = process.cwd();\n\n\t\tconst err = new Error();\n\t\tconst stack = err.stack || \"\";\n\t\tconst stackLines = stack.split(\"\\n\").map((line) => line.trim());\n\n\t\tlet callerIndex = 2;\n\n\t\twhile (\n\t\t\tcallerIndex < stackLines.length &&\n\t\t\t(stackLines[callerIndex].includes(\"node:internal\") ||\n\t\t\t\tstackLines[callerIndex].includes(\"/node_modules/\"))\n\t\t) {\n\t\t\tcallerIndex++;\n\t\t}\n\n\t\tif (DebugService.ignoreFiles.length > 0) {\n\t\t\twhile (\n\t\t\t\tcallerIndex < stackLines.length &&\n\t\t\t\tDebugService.ignoreFiles.some((ignoreFile) =>\n\t\t\t\t\tstackLines[callerIndex].includes(ignoreFile),\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tcallerIndex++;\n\t\t\t}\n\t\t}\n\n\t\tconst callerLine = stackLines[callerIndex] || \"\";\n\n\t\tlet functionName = \"Unknown function\";\n\t\tlet callerInfo = \"Unknown caller\";\n\n\t\tconst namedFunctionMatch = callerLine.match(/at\\s+([^(\\s]+)\\s+\\(([^)]+)\\)/);\n\t\tif (namedFunctionMatch) {\n\t\t\tfunctionName = namedFunctionMatch[1];\n\t\t\tcallerInfo = namedFunctionMatch[2];\n\t\t} else {\n\t\t\tconst anonymousFunctionMatch = callerLine.match(/at\\s+(.+)/);\n\t\t\tif (anonymousFunctionMatch) {\n\t\t\t\tcallerInfo = anonymousFunctionMatch[1];\n\n\t\t\t\tconst objectMethodMatch = callerInfo.match(/at\\s+([^(\\s]+)\\s+/);\n\t\t\t\tif (objectMethodMatch && objectMethodMatch[1] !== \"new\") {\n\t\t\t\t\tfunctionName = objectMethodMatch[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (callerInfo.includes(\"(\")) {\n\t\t\tcallerInfo = callerInfo.substring(\n\t\t\t\tcallerInfo.indexOf(\"(\") + 1,\n\t\t\t\tcallerInfo.lastIndexOf(\")\"),\n\t\t\t);\n\t\t}\n\n\t\tcallerInfo = callerInfo.split(\":\").slice(0, -2).join(\":\");\n\n\t\ttry {\n\t\t\tcallerInfo = path.relative(projectRoot, callerInfo);\n\t\t} catch (_e) {}\n\n\t\treturn { functionName, callerInfo };\n\t}\n}\n\nexport { DebugService };\n","/**\n * Writes colored `[name] message` lines to the console, but only when\n * `NODE_ENV === \"development\"` or `DEBUG_MODE === \"true\"`. No-op in production.\n *\n * @param props.name - Label shown before each line (e.g. `\"API\"`, `\"Auth\"`).\n * @param props.scheme - Color of the label tag: `\"cyan\"` info, `\"green\"` success, `\"yellow\"` warning, `\"red\"` error.\n * @param props.debugs - Lines of text to print, one per console entry.\n *\n * @example\n * ```typescript\n * flushDebugLogs({\n * name: \"API\",\n * scheme: \"cyan\",\n * debugs: [\"POST /api/users\", \"Status: 201\"],\n * });\n * ```\n */\n\nfunction flushDebugLogs(props: {\n\tscheme: \"yellow\" | \"cyan\" | \"red\" | \"green\";\n\tname: string;\n\tdebugs: string[];\n}): void {\n\tconst isDebugMode =\n\t\tprocess.env.NODE_ENV === \"development\" ||\n\t\tprocess.env?.DEBUG_MODE === \"true\";\n\n\tif (isDebugMode) {\n\t\tconst reset = \"\\x1b[0m\";\n\n\t\tconst colors = {\n\t\t\tyellow: \"\\x1b[33m\",\n\t\t\tcyan: \"\\x1b[36m\",\n\t\t\tred: \"\\x1b[31m\",\n\t\t\tgreen: \"\\x1b[32m\",\n\t\t};\n\n\t\tconst debugName = `${colors[props.scheme]}[${props.name}]${reset}`;\n\t\tlet consoleData = `\\n`;\n\n\t\tprops.debugs.forEach((debug, index) => {\n\t\t\tconsoleData += `${debugName} ${debug.trim()}`;\n\t\t\tif (index < props.debugs.length - 1) consoleData += `\\n`;\n\t\t});\n\n\t\tconsole.log(consoleData);\n\t}\n}\n\nexport { flushDebugLogs };\n","import { formatJsonString } from \"@arkyn/shared\";\n\nimport { DebugService } from \"../../services/debugService\";\nimport { flushDebugLogs } from \"../../utilities/flushDebugLogs\";\n\nclass BadResponse {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tprivate _cause?: any;\n\tprivate _name: string = \"BadResponse\";\n\tprivate _status: number = 500;\n\tprivate _statusText: string = \"Unknown error\";\n\tprivate _debugColor: \"green\" | \"yellow\" | \"cyan\" | \"red\" = \"red\";\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tget cause(): any {\n\t\treturn this._cause;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tset cause(value: any) {\n\t\tthis._cause = value;\n\t}\n\n\tget name(): string {\n\t\treturn this._name;\n\t}\n\n\tset name(value: string) {\n\t\tthis._name = value;\n\t}\n\n\tget status(): number {\n\t\treturn this._status;\n\t}\n\n\tset status(value: number) {\n\t\tthis._status = value;\n\t}\n\n\tget statusText(): string {\n\t\treturn this._statusText;\n\t}\n\n\tset statusText(value: string) {\n\t\tthis._statusText = value;\n\t}\n\n\tget debugColor(): \"green\" | \"yellow\" | \"cyan\" | \"red\" {\n\t\treturn this._debugColor;\n\t}\n\n\tset debugColor(value: \"green\" | \"yellow\" | \"cyan\" | \"red\") {\n\t\tif (![\"green\", \"yellow\", \"cyan\", \"red\"].includes(value)) return;\n\t\tthis._debugColor = value;\n\t}\n\n\tonDebug() {\n\t\tconst debugs: string[] = [];\n\t\tconst { callerInfo, functionName } = DebugService.getCaller();\n\n\t\tdebugs.push(`Caller Function: ${functionName}`);\n\t\tdebugs.push(`Caller Location: ${callerInfo}`);\n\n\t\tif (this._statusText) debugs.push(`Message: ${this._statusText}`);\n\t\tif (this._cause) {\n\t\t\tdebugs.push(`Cause: ${formatJsonString(JSON.stringify(this._cause))}`);\n\t\t}\n\n\t\tflushDebugLogs({ scheme: \"red\", name: this._name, debugs });\n\t}\n\n\tmakeBody() {\n\t\treturn {\n\t\t\tname: this._name,\n\t\t\tmessage: this._statusText,\n\t\t\tcause: this._cause,\n\t\t};\n\t}\n}\n\nexport { BadResponse };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 502 Bad Gateway — the upstream server returned an invalid or unexpected response.\n *\n * Throw inside a server action/loader and catch with `errorHandler`, or call `.toJson()` directly.\n *\n * @example\n * ```typescript\n * throw new BadGateway(\"Payment gateway unavailable\");\n * ```\n */\nclass BadGateway extends BadResponse {\n\t/**\n\t * @param message - Error description sent in the response body and logged for debugging.\n\t * @param cause - Optional extra context (serialized to JSON in the response).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"BadGateway\";\n\t\tthis.status = 502;\n\t\tthis.statusText = message;\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { BadGateway };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 400 Bad Request — the request is malformed or contains invalid data.\n *\n * @example\n * ```typescript\n * throw new BadRequest(\"Invalid request body\");\n * ```\n */\nclass BadRequest extends BadResponse {\n\t/**\n\t * @param message - Error description.\n\t * @param cause - Optional extra context (serialized to JSON).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"BadRequest\";\n\t\tthis.status = 400;\n\t\tthis.statusText = message;\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { BadRequest };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 409 Conflict — the request conflicts with the current state of the server (e.g. duplicate record).\n *\n * @example\n * ```typescript\n * throw new Conflict(\"Email already in use\");\n * ```\n */\nclass Conflict extends BadResponse {\n\t/**\n\t * @param message - Error description.\n\t * @param cause - Optional extra context (serialized to JSON).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"Conflict\";\n\t\tthis.status = 409;\n\t\tthis.statusText = message;\n\t\tthis.debugColor = \"yellow\";\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { Conflict };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 403 Forbidden — authenticated but not authorized to access this resource.\n *\n * @example\n * ```typescript\n * throw new Forbidden(\"You don't have permission to delete this resource\");\n * ```\n */\nclass Forbidden extends BadResponse {\n\t/**\n\t * @param message - Error description.\n\t * @param cause - Optional extra context (serialized to JSON).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"Forbidden\";\n\t\tthis.status = 403;\n\t\tthis.statusText = message;\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { Forbidden };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 404 Not Found — the requested resource does not exist.\n *\n * @example\n * ```typescript\n * throw new NotFound(\"Product not found\");\n * ```\n */\nclass NotFound extends BadResponse {\n\t/**\n\t * @param message - Error description.\n\t * @param cause - Optional extra context (serialized to JSON).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"NotFound\";\n\t\tthis.status = 404;\n\t\tthis.statusText = message;\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { NotFound };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 501 Not Implemented — the server does not support the functionality required to fulfill the request.\n *\n * @example\n * ```typescript\n * throw new NotImplemented(\"Webhook delivery is not yet implemented\");\n * ```\n */\nclass NotImplemented extends BadResponse {\n\t/**\n\t * @param message - Error description.\n\t * @param cause - Optional extra context (serialized to JSON).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"NotImplemented\";\n\t\tthis.status = 501;\n\t\tthis.statusText = message;\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { NotImplemented };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 500 Internal Server Error — an unexpected condition prevented the server from fulfilling the request.\n *\n * @example\n * ```typescript\n * throw new ServerError(\"Failed to connect to the database\");\n * ```\n */\nclass ServerError extends BadResponse {\n\t/**\n\t * @param message - Error description.\n\t * @param cause - Optional extra context (serialized to JSON).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"ServerError\";\n\t\tthis.status = 500;\n\t\tthis.statusText = message;\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { ServerError };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 401 Unauthorized — the request lacks valid authentication credentials.\n *\n * @example\n * ```typescript\n * throw new Unauthorized(\"Invalid or expired token\");\n * ```\n */\nclass Unauthorized extends BadResponse {\n\t/**\n\t * @param message - Error description.\n\t * @param cause - Optional extra context (serialized to JSON).\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, cause?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"Unauthorized\";\n\t\tthis.status = 401;\n\t\tthis.statusText = message;\n\t\tthis.debugColor = \"yellow\";\n\t\tthis.cause = cause ? JSON.stringify(cause) : undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { Unauthorized };\n","import { BadResponse } from \"./_badResponse\";\n\n/**\n * HTTP 422 Unprocessable Entity — the request is well-formed but contains semantic validation errors.\n * Typically used for form field validation failures.\n *\n * @example\n * ```typescript\n * throw new UnprocessableEntity({\n * message: \"Validation failed\",\n * fieldErrors: { email: \"Invalid email format\", age: \"Must be 18 or older\" },\n * fields: { email: \"not-an-email\", age: \"15\" },\n * });\n * ```\n */\nclass UnprocessableEntity extends BadResponse {\n\t/**\n\t * @param props.message - Human-readable description of the error.\n\t * @param props.fieldErrors - Per-field validation messages keyed by field name.\n\t * @param props.fields - Original submitted field values (useful for repopulating forms).\n\t * @param props.data - Any extra data to include in the response body.\n\t */\n\tconstructor(props: {\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tdata?: any;\n\t\tfieldErrors?: Record<string, string>;\n\t\tfields?: Record<string, string>;\n\t\tmessage?: string;\n\t}) {\n\t\tsuper();\n\n\t\tthis.name = \"UnprocessableEntity\";\n\t\tthis.status = 422;\n\t\tthis.statusText = props.message || \"Unprocessable entity\";\n\t\tthis.debugColor = \"yellow\";\n\t\tthis.cause = {\n\t\t\tdata: props.data,\n\t\t\tfieldErrors: props.fieldErrors,\n\t\t\tfields: props.fields,\n\t\t};\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.makeBody()), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.makeBody(), responseInit);\n\t}\n}\n\nexport { UnprocessableEntity };\n","import { DebugService } from \"../../services/debugService\";\nimport { flushDebugLogs } from \"../../utilities/flushDebugLogs\";\n\n/**\n * Base class for handling successful HTTP responses with debugging capabilities.\n * Provides logging functionality to track response and their context.\n */\nclass SuccessResponse {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tprivate _body: any = null;\n\tprivate _name: string = \"SuccessResponse\";\n\tprivate _status: number = 200;\n\tprivate _statusText: string = \"OK\";\n\tprivate _debugColor: \"green\" | \"yellow\" | \"cyan\" | \"red\" = \"green\";\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tget body(): any {\n\t\treturn this._body;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tset body(value: any) {\n\t\tthis._body = value ?? null;\n\t}\n\n\tget name(): string {\n\t\treturn this._name;\n\t}\n\n\tset name(value: string) {\n\t\tthis._name = value;\n\t}\n\n\tget status(): number {\n\t\treturn this._status;\n\t}\n\n\tset status(value: number) {\n\t\tthis._status = value;\n\t}\n\n\tget statusText(): string {\n\t\treturn this._statusText;\n\t}\n\n\tset statusText(value: string) {\n\t\tthis._statusText = value;\n\t}\n\n\tget debugColor(): \"green\" | \"yellow\" | \"cyan\" | \"red\" {\n\t\treturn this._debugColor;\n\t}\n\n\tset debugColor(value: \"green\" | \"yellow\" | \"cyan\" | \"red\") {\n\t\tif (![\"green\", \"yellow\", \"cyan\", \"red\"].includes(value)) return;\n\t\tthis._debugColor = value;\n\t}\n\n\t/**\n\t * Logs debug information for success responses including caller context and response details.\n\t *\n\t * @param {any} body - The response body or success data to be logged\n\t *\n\t * @example\n\t * ```typescript\n\t * const SuccessResponse = new SuccessResponse();\n\t * SuccessResponse.onDebug({ data: \"Operation completed successfully\" });\n\t * ```\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tonDebug(body?: any): void {\n\t\tconst debugs: string[] = [];\n\t\tconst { callerInfo, functionName } = DebugService.getCaller();\n\n\t\tdebugs.push(`Caller Function: ${functionName}`);\n\t\tdebugs.push(`Caller Location: ${callerInfo}`);\n\n\t\tif (this.statusText) debugs.push(`Message: ${this.statusText}`);\n\t\tif (body) debugs.push(`Body: ${JSON.stringify(body)}`);\n\n\t\tflushDebugLogs({ scheme: this._debugColor, name: this.name, debugs });\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tmakeBody(): any {\n\t\treturn {\n\t\t\tname: this.name,\n\t\t\tmessage: this.statusText,\n\t\t\tbody: this.body,\n\t\t};\n\t}\n}\n\nexport { SuccessResponse };\n","import { SuccessResponse } from \"./_successResponse\";\n\n/**\n * HTTP 201 Created — the request succeeded and a new resource was created.\n *\n * @example\n * ```typescript\n * return new Created(\"User created successfully\", { id: user.id }).toJson();\n * ```\n */\nclass Created extends SuccessResponse {\n\t/**\n\t * @param message - Description included in the response status text.\n\t * @param body - Data to include in the response body.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, body?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"Created\";\n\t\tthis.status = 201;\n\t\tthis.statusText = message;\n\t\tthis.body = body || undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.body), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.body, responseInit);\n\t}\n}\n\nexport { Created };\n","import { SuccessResponse } from \"./_successResponse\";\n\n/**\n * HTTP 302 Found — the resource was located and the response includes it in the body.\n *\n * @example\n * ```typescript\n * return new Found(\"Products retrieved\", { products }).toJson();\n * ```\n */\nclass Found extends SuccessResponse {\n\t/**\n\t * @param message - Description included in the response status text.\n\t * @param body - Data to include in the response body.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, body?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"Found\";\n\t\tthis.status = 302;\n\t\tthis.statusText = message;\n\t\tthis.body = body || undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.body), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.body, responseInit);\n\t}\n}\n\nexport { Found };\n","import { SuccessResponse } from \"./_successResponse\";\n\n/**\n * HTTP 204 No Content — the request succeeded but there is no content to return.\n * Typically used for delete or update operations where a body is not needed.\n *\n * @example\n * ```typescript\n * return new NoContent(\"Record deleted\").toResponse();\n * ```\n */\nclass NoContent extends SuccessResponse {\n\t/**\n\t * @param message - Description included in the response status text.\n\t */\n\tconstructor(message: string) {\n\t\tsuper();\n\n\t\tthis.name = \"NoContent\";\n\t\tthis.status = 204;\n\t\tthis.statusText = message;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header and no body. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(null, responseInit);\n\t}\n}\n\nexport { NoContent };\n","import { SuccessResponse } from \"./_successResponse\";\n\n/**\n * HTTP 200 OK — the request succeeded and the response body contains the result.\n *\n * @example\n * ```typescript\n * return new Success(\"Order fetched\", { order }).toJson();\n * ```\n */\nclass Success extends SuccessResponse {\n\t/**\n\t * @param message - Description included in the response status text.\n\t * @param body - Data to include in the response body.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, body?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"Success\";\n\t\tthis.status = 200;\n\t\tthis.statusText = message;\n\t\tthis.body = body || undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.body), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.body, responseInit);\n\t}\n}\n\nexport { Success };\n","import { SuccessResponse } from \"./_successResponse\";\n\n/**\n * HTTP 200 OK — the request succeeded and the resource was updated.\n * Semantically equivalent to `Success` but signals an update operation to consumers.\n *\n * @example\n * ```typescript\n * return new Updated(\"Profile updated\", { user }).toJson();\n * ```\n */\nclass Updated extends SuccessResponse {\n\t/**\n\t * @param message - Description included in the response status text.\n\t * @param body - Data to include in the response body.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconstructor(message: string, body?: any) {\n\t\tsuper();\n\n\t\tthis.name = \"Updated\";\n\t\tthis.status = 200;\n\t\tthis.statusText = message;\n\t\tthis.body = body || undefined;\n\n\t\tthis.onDebug();\n\t}\n\n\t/** Converts to a `Response` with `Content-Type: application/json` header. */\n\ttoResponse(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\theaders: { \"Content-Type\": \"application/json\" },\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn new Response(JSON.stringify(this.body), responseInit);\n\t}\n\n\t/** Converts to a `Response` using `Response.json()`. Alternative to `toResponse()`. */\n\ttoJson(): Response {\n\t\tconst responseInit: ResponseInit = {\n\t\t\tstatus: this.status,\n\t\t\tstatusText: this.statusText,\n\t\t};\n\n\t\treturn Response.json(this.body, responseInit);\n\t}\n}\n\nexport { Updated };\n","/**\n * Input properties for log mapping.\n *\n * @typedef {object} InputProps\n * @property {number} status - HTTP response status code.\n * @property {string} url - The request URL.\n * @property {\"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\"} method - HTTP method used.\n * @property {HeadersInit} requestHeaders - Headers sent with the request.\n * @property {HeadersInit} responseHeaders - Headers received in the response.\n * @property {any} requestBody - Body of the request.\n * @property {number} elapsedTime - Time elapsed for the request in milliseconds.\n * @property {any} responseBody - Body of the response.\n * @property {URLSearchParams} queryParams - Query parameters from the URL.\n */\ntype InputProps = {\n\tstatus: number;\n\trawUrl: string;\n\turlParams?: Record<string, string>;\n\tmethod: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\";\n\trequestHeaders: HeadersInit;\n\tresponseHeaders: HeadersInit;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\trequestBody: any;\n\telapsedTime: number;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tresponseBody: any;\n\tqueryParams: URLSearchParams;\n};\n\n/**\n * Output properties after log mapping transformation.\n *\n * @typedef {object} OutputProps\n * @property {string} rawUrl - The original request URL.\n * @property {number} status - HTTP response status code.\n * @property {\"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\"} method - HTTP method used.\n * @property {string | null} token - Authentication token (if present).\n * @property {number} elapsedTime - Time elapsed for the request in milliseconds.\n * @property {Record<string, string>} requestHeaders - Mapped request headers.\n * @property {Record<string, string>} requestBody - Mapped request body.\n * @property {Record<string, string>} queryParams - Mapped query parameters.\n * @property {Record<string, string>} responseHeaders - Mapped response headers.\n * @property {any} responseBody - The response body.\n */\ntype OutputProps = {\n\trawUrl: string;\n\tstatus: number;\n\tmethod: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\";\n\ttoken: string | null;\n\telapsedTime: number;\n\trequestHeaders: Record<string, string>;\n\trequestBody: Record<string, string>;\n\tqueryParams: Record<string, string>;\n\tresponseHeaders: Record<string, string>;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tresponseBody: any;\n};\n\n/**\n * Static service for mapping HTTP request/response data into a standardized log format.\n *\n * Provides utilities to transform headers and query parameters into plain objects,\n * and produces a unified output structure for logging purposes.\n */\nclass LogMapperService {\n\t/**\n\t * Converts various header formats into a plain key-value object.\n\t *\n\t * @param {HeadersInit} headers - The headers to map.\n\t * @returns {Record<string, string>} A plain object with header key-value pairs.\n\t * @private\n\t */\n\tprivate static mapHeaders(headers: HeadersInit): Record<string, string> {\n\t\tif (headers instanceof Headers) {\n\t\t\treturn Object.fromEntries(headers.entries());\n\t\t} else if (typeof headers === \"object\") {\n\t\t\treturn Object.entries(headers).reduce(\n\t\t\t\t(acc, [key, value]) => {\n\t\t\t\t\tif (typeof value === \"string\") acc[key] = value;\n\t\t\t\t\telse if (Array.isArray(value)) acc[key] = value.join(\", \");\n\t\t\t\t\telse acc[key] = JSON.stringify(value);\n\t\t\t\t\treturn acc;\n\t\t\t\t},\n\t\t\t\t{} as Record<string, string>,\n\t\t\t);\n\t\t}\n\t\treturn {};\n\t}\n\n\t/**\n\t * Converts URLSearchParams into a plain key-value object.\n\t *\n\t * @param {URLSearchParams} queryParams - The query parameters to map.\n\t * @returns {Record<string, string>} A plain object with query parameter key-value pairs.\n\t * @private\n\t */\n\tprivate static mapQueryParams(\n\t\tqueryParams: URLSearchParams,\n\t): Record<string, string> {\n\t\tconst params: Record<string, string> = {};\n\n\t\tqueryParams.forEach((value, key) => {\n\t\t\tparams[key] = value;\n\t\t});\n\n\t\treturn params;\n\t}\n\n\t/**\n\t * Transforms raw HTTP request/response data into a standardized log output format.\n\t *\n\t * @param {InputProps} props - The input properties containing request/response data.\n\t * @returns {OutputProps} The mapped output object ready for logging.\n\t */\n\tstatic handle(props: InputProps): OutputProps {\n\t\treturn {\n\t\t\trawUrl: props.rawUrl,\n\t\t\tstatus: props.status,\n\t\t\tmethod: props.method,\n\t\t\ttoken: null,\n\t\t\telapsedTime: props.elapsedTime,\n\t\t\trequestHeaders: LogMapperService.mapHeaders(props.requestHeaders),\n\t\t\trequestBody: props.requestBody || null,\n\t\t\tqueryParams: {\n\t\t\t\t...LogMapperService.mapQueryParams(props.queryParams),\n\t\t\t\t...props.urlParams,\n\t\t\t},\n\t\t\tresponseHeaders: LogMapperService.mapHeaders(props.responseHeaders),\n\t\t\tresponseBody: props.responseBody || null,\n\t\t};\n\t}\n}\n\nexport { LogMapperService };\n","/**\n * Static service for log endpoint configuration and access.\n *\n * Stores a singleton configuration containing the traffic source identifier,\n * user token, and log ingestion URL.\n */\nclass LogService {\n\tprivate static config?: {\n\t\ttrafficSourceId: string;\n\t\tuserToken: string;\n\t\tapiUrl: string;\n\t};\n\n\t/**\n\t * Sets the log service configuration once. Subsequent calls are ignored.\n\t *\n\t * @param config.trafficSourceId - Traffic source identifier.\n\t * @param config.userToken - User token for authentication.\n\t * @param config.logBaseApiUrl - Override the default log ingestion base URL.\n\t */\n\tstatic setConfig(config: {\n\t\ttrafficSourceId: string;\n\t\tuserToken: string;\n\t\tlogBaseApiUrl?: string;\n\t}): void {\n\t\tif (LogService.config) return;\n\n\t\tconst { trafficSourceId, userToken, logBaseApiUrl } = config;\n\t\tconst baseUrl = logBaseApiUrl || `http://62.238.8.44:8081`;\n\t\tconst apiUrl = `${baseUrl}/ingest-log`;\n\n\t\tLogService.config = { trafficSourceId, userToken, apiUrl };\n\t}\n\n\t/** Returns the stored configuration, or `undefined` if `setConfig` has not been called. */\n\tstatic getConfig():\n\t\t| { trafficSourceId: string; userToken: string; apiUrl: string }\n\t\t| undefined {\n\t\treturn LogService.config;\n\t}\n\n\t/**\n\t * Resets the stored configuration, allowing a new initialization.\n\t */\n\tstatic resetConfig() {\n\t\tLogService.config = undefined;\n\t}\n}\n\nexport { LogService };\n","import { formatJsonObject } from \"@arkyn/shared\";\nimport { flushDebugLogs } from \"../..\";\nimport { LogService } from \"../../services/logService\";\n\ntype ConfigProps = {\n\trawUrl: string;\n\tstatus: number;\n\tmethod: \"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\";\n\ttoken: string | null;\n\telapsedTime: number;\n\trequestHeaders: Record<string, string>;\n\trequestBody: Record<string, string>;\n\tqueryParams: Record<string, string>;\n\tresponseHeaders: Record<string, string>;\n\tresponseBody: Record<string, string>;\n};\n\n/**\n * Sends a request to the inbox flow API with the provided configuration.\n *\n * - This function retrieves the inbox flow configuration using `LogService.getConfig()`.\n * - If the configuration is not available, the function will return early without performing any action.\n * - In a development environment (`NODE_ENV === \"development\"`), the function will also return early.\n * - The request is sent as a POST request to the inbox API URL with the provided configuration details.\n * - If an error occurs during the request, it will be logged using the `httpDebug` service.\n *\n * @param {ConfigProps} config - The configuration object for the request.\n * @param {string} config.rawUrl - The raw URL of the request.\n * @param {number} config.status - The HTTP status code associated with the request.\n * @param {\"GET\" | \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\"} config.method - The HTTP method used for the request. Can be \"POST\", \"GET\", \"PUT\", \"DELETE\", or \"PATCH\".\n * @param {string | null} config.token - The authentication token for the request.\n * @param {number} config.elapsedTime - The elapsed time for the request in milliseconds.\n * @param {Record<string, string>} config.requestHeaders - The headers sent with the request.\n * @param {Record<string, string>} config.requestBody - The body of the request, if applicable.\n * @param {Record<string, string>} config.queryParams - The query parameters for the request.\n * @param {Record<string, string>} config.responseHeaders - The headers received in the response.\n * @param {Record<string, string>} config.responseBody - The body of the response received.\n *\n * @remarks\n *\n * @returns {Promise<void>} A promise that resolves when the request is complete.\n *\n * @example\n * ```typescript\n * const config = {\n * rawUrl: \"https://example.com/api/data\",\n * status: 200,\n * method: \"GET\",\n * token: \"auth-token-123\",\n * elapsedTime: 150,\n * requestHeaders: { \"Accept\": \"application/json\", \"Authorization\": \"Bearer token123\" },\n * requestBody: {},\n * queryParams: { \"page\": \"1\", \"limit\": \"10\" },\n * responseHeaders: { \"Content-Type\": \"application/json\" },\n * responseBody: { \"data\": \"example response\" }\n * };\n *\n * await logRequest(config);\n * ```\n */\n\nasync function logRequest(config: ConfigProps): Promise<void> {\n\tconst arkynService = LogService.getConfig();\n\tif (!arkynService) return;\n\n\tconst { userToken, apiUrl, trafficSourceId } = arkynService;\n\n\tconst {\n\t\telapsedTime,\n\t\tmethod,\n\t\tqueryParams,\n\t\trequestBody,\n\t\trequestHeaders,\n\t\tresponseBody,\n\t\tresponseHeaders,\n\t\tstatus,\n\t\trawUrl,\n\t} = config;\n\n\tif (process.env.NODE_ENV === \"development\") return;\n\n\ttry {\n\t\tconst url = new URL(rawUrl);\n\n\t\tlet protocol: \"http\" | \"https\" = \"https\";\n\t\tif (url.protocol === \"http:\") protocol = \"http\";\n\n\t\tconst body = JSON.stringify({\n\t\t\tdomainUrl: `${url.protocol}//${url.host}`,\n\t\t\tpathnameUrl: url.pathname,\n\t\t\ttrafficSourceId: trafficSourceId,\n\t\t\tstatus,\n\t\t\tprotocol,\n\t\t\tmethod: method.toLowerCase(),\n\t\t\ttrafficUserId: null,\n\t\t\telapsedTime,\n\t\t\trequestHeaders: JSON.stringify(requestHeaders),\n\t\t\trequestBody: JSON.stringify(requestBody),\n\t\t\tqueryParams: JSON.stringify(queryParams),\n\t\t\tresponseHeaders: JSON.stringify(responseHeaders),\n\t\t\tresponseBody: JSON.stringify(responseBody),\n\t\t});\n\n\t\tconst headers = {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\tAuthorization: `Bearer ${userToken}`,\n\t\t};\n\n\t\tconst fetchResponse = await fetch(apiUrl, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody,\n\t\t\theaders,\n\t\t});\n\n\t\tif (!fetchResponse.ok) {\n\t\t\tconst errorText = await fetchResponse.text();\n\t\t\tconst errorStatus = fetchResponse.status;\n\t\t\tconst errorStatusText = fetchResponse.statusText;\n\t\t\tconst jsonResponse = await fetchResponse.json().catch(() => null);\n\n\t\t\tflushDebugLogs({\n\t\t\t\tname: \"LogError\",\n\t\t\t\tscheme: \"red\",\n\t\t\t\tdebugs: [\n\t\t\t\t\t`Failed to log request.`,\n\t\t\t\t\t`Status: ${errorStatus} ${errorStatusText}.`,\n\t\t\t\t\t`Status text: ${errorText}.`,\n\t\t\t\t\t`JSON Response: ${jsonResponse ? formatJsonObject(jsonResponse, 0) : \"No JSON response\"}`,\n\t\t\t\t],\n\t\t\t});\n\t\t}\n\t} catch (err) {\n\t\tflushDebugLogs({\n\t\t\tdebugs: [`Error sending request: ${err}`],\n\t\t\tname: \"LogError\",\n\t\t\tscheme: \"red\",\n\t\t});\n\t}\n}\n\nexport { logRequest };\n","import { flushDebugLogs } from \"../..\";\nimport { LogMapperService } from \"./_logMapperService\";\nimport { logRequest } from \"./_logRequest\";\n\ntype InputProps = {\n\turl: string;\n\tmethod: \"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\" | \"GET\";\n\turlParams?: Record<string, string>;\n\theaders?: HeadersInit;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tbody?: any;\n};\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype ApiSuccessResponse<T = any> = {\n\tsuccess: true;\n\tstatus: number;\n\tmessage: string;\n\tresponse: T;\n\tcause: null;\n};\n\ntype ApiFailedResponse = {\n\tsuccess: false;\n\tstatus: number;\n\tmessage: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tresponse: any;\n\tcause: string | Error | null;\n};\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype ApiResponseDTO<T = any> = ApiSuccessResponse<T> | ApiFailedResponse;\n\n/**\n * Makes an HTTP request using the Fetch API and returns a standardized response.\n *\n * @template {any} T - The expected type of the response data.\n *\n * @param {\"POST\" | \"PUT\" | \"DELETE\" | \"PATCH\" | \"GET\"} method - The HTTP method to use for the request. Supported methods are:\n * - \"POST\": Create a new resource.\n * - \"PUT\": Update an existing resource.\n * - \"DELETE\": Remove a resource.\n * - \"PATCH\": Partially update a resource.\n * - \"GET\": Retrieve a resource.\n * @param {string} url - The URL to which the request is sent.\n * @param {HeadersInit} headers - Optional headers to include in the request. Defaults to an empty object.\n * @param {any} body - Optional body to include in the request. Should be serializable to JSON.\n *\n * @returns {ApiResponseDTO<T>} A promise that resolves to an `ApiResponseDTO<T>` object containing:\n * - `success`: A boolean indicating whether the request was successful.\n * - `status`: The HTTP status code of the response.\n * - `message`: A message describing the result of the request.\n * - `response`: The parsed JSON response data, or `null` if parsing fails.\n * - `cause`: Additional error information, if applicable.\n *\n * @example\n * ```typescript\n * import { makeRequest } from \"./makeRequest\";\n *\n * async function fetchData() {\n * const response = await makeRequest(\"GET\", \"https://api.example.com/data\");\n * if (response.success) {\n * console.log(\"Data:\", response.response);\n * } else {\n * console.error(\"Error:\", response.message);\n * }\n * }\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nasync function makeRequest<T = any>(\n\tinput: InputProps,\n): Promise<ApiResponseDTO<T>> {\n\tlet url = input.url;\n\n\tif (input.urlParams) {\n\t\tObject.entries(input.urlParams).forEach(([key, value]) => {\n\t\t\turl = url.replaceAll(`:${key}`, value);\n\t\t});\n\t}\n\n\tconst successMessage = {\n\t\tPOST: \"Resource created successfully\",\n\t\tPUT: \"Resource updated successfully\",\n\t\tDELETE: \"Resource deleted successfully\",\n\t\tPATCH: \"Resource patched successfully\",\n\t\tGET: \"Request successful\",\n\t};\n\n\ttry {\n\t\tconst startTime = performance.now();\n\n\t\tconst headers = { ...input.headers, \"Content-Type\": \"application/json\" };\n\t\tconst response = await fetch(url, {\n\t\t\theaders,\n\t\t\tmethod: input.method,\n\t\t\tbody: input.body ? JSON.stringify(input.body) : undefined,\n\t\t});\n\n\t\tconst elapsedTime = performance.now() - startTime;\n\t\tconst status = response.status;\n\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tlet data: any = null;\n\t\ttry {\n\t\t\tdata = await response.json();\n\t\t} catch {\n\t\t\tdata = null;\n\t\t}\n\n\t\tconst logData = LogMapperService.handle({\n\t\t\telapsedTime,\n\t\t\tmethod: input.method,\n\t\t\tqueryParams: new URL(url).searchParams,\n\t\t\trequestHeaders: headers,\n\t\t\trequestBody: input.body,\n\t\t\tresponseBody: data,\n\t\t\tresponseHeaders: response.headers,\n\t\t\tstatus,\n\t\t\trawUrl: input.url,\n\t\t\turlParams: input.urlParams,\n\t\t});\n\n\t\tlogRequest(logData);\n\n\t\tif (!response.ok) {\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\tstatus,\n\t\t\t\tmessage: data?.message || response.statusText || \"Request failed\",\n\t\t\t\tresponse: data,\n\t\t\t\tcause: null,\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tstatus,\n\t\t\tmessage: data?.message || successMessage[input.method],\n\t\t\tresponse: data,\n\t\t\tcause: null,\n\t\t};\n\t} catch (err) {\n\t\tflushDebugLogs({\n\t\t\tdebugs: [`Network error or request failed: ${err}`],\n\t\t\tname: \"MakeRequestError\",\n\t\t\tscheme: \"red\",\n\t\t});\n\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tstatus: 0,\n\t\t\tmessage: \"Network error or request failed\",\n\t\t\tresponse: null,\n\t\t\tcause: err instanceof Error ? err.message : String(err),\n\t\t};\n\t}\n}\n\nexport { type ApiResponseDTO, makeRequest };\n","import { type ApiResponseDTO, makeRequest } from \"./_makeRequest\";\n\ntype InputProps = {\n\turl: string;\n\turlParams?: Record<string, string>;\n\theaders?: HeadersInit;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tbody?: any;\n};\n\n/**\n * Sends a DELETE request to the specified URL with optional headers and body.\n *\n * @template T - The expected type of the response data.\n * @param {InputProps} input - The options for the DELETE request, including URL, URL parameters, headers, and body.\n * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nasync function deleteRequest<T = any>(\n\tinput: InputProps,\n): Promise<ApiResponseDTO<T>> {\n\treturn makeRequest({\n\t\tmethod: \"DELETE\",\n\t\turl: input.url,\n\t\turlParams: input.urlParams,\n\t\theaders: input.headers,\n\t\tbody: input.body,\n\t});\n}\n\nexport { deleteRequest };\n","import { type ApiResponseDTO, makeRequest } from \"./_makeRequest\";\n\ntype InputProps = {\n\turl: string;\n\turlParams?: Record<string, string>;\n\theaders?: HeadersInit;\n};\n\n/**\n * Sends a GET request to the specified URL with optional headers.\n *\n * @template T - The expected type of the response data.\n * @param {InputProps} input - The options for the GET request, including URL, URL parameters, and headers.\n * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nasync function getRequest<T = any>(\n\tinput: InputProps,\n): Promise<ApiResponseDTO<T>> {\n\treturn makeRequest({\n\t\tmethod: \"GET\",\n\t\turl: input.url,\n\t\turlParams: input.urlParams,\n\t\theaders: input.headers,\n\t});\n}\n\nexport { getRequest };\n","import { type ApiResponseDTO, makeRequest } from \"./_makeRequest\";\n\ntype InputProps = {\n\turl: string;\n\turlParams?: Record<string, string>;\n\theaders?: HeadersInit;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tbody?: any;\n};\n\n/**\n * Sends a PATCH request to the specified URL with optional headers and body.\n *\n * @template T - The expected type of the response data.\n * @param {InputProps} input - The options for the PATCH request, including URL, URL parameters, headers, and body.\n * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nasync function patchRequest<T = any>(\n\tinput: InputProps,\n): Promise<ApiResponseDTO<T>> {\n\treturn makeRequest({\n\t\tmethod: \"PATCH\",\n\t\turl: input.url,\n\t\turlParams: input.urlParams,\n\t\theaders: input.headers,\n\t\tbody: input.body,\n\t});\n}\n\nexport { patchRequest };\n","import { type ApiResponseDTO, makeRequest } from \"./_makeRequest\";\n\ntype InputProps = {\n\turl: string;\n\turlParams?: Record<string, string>;\n\theaders?: HeadersInit;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tbody?: any;\n};\n\n/**\n * Sends a POST request to the specified URL with optional headers and body.\n *\n * @template T - The expected type of the response data.\n * @param {InputProps} input - The options for the POST request, including URL, URL parameters, headers, and body.\n * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nasync function postRequest<T = any>(\n\tinput: InputProps,\n): Promise<ApiResponseDTO<T>> {\n\treturn makeRequest({\n\t\tmethod: \"POST\",\n\t\turl: input.url,\n\t\turlParams: input.urlParams,\n\t\theaders: input.headers,\n\t\tbody: input.body,\n\t});\n}\n\nexport { postRequest };\n","import { type ApiResponseDTO, makeRequest } from \"./_makeRequest\";\n\ntype InputProps = {\n\turl: string;\n\turlParams?: Record<string, string>;\n\theaders?: HeadersInit;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tbody?: any;\n};\n\n/**\n * Sends a PUT request to the specified URL with optional headers and body.\n *\n * @template T - The expected type of the response data.\n * @param {InputProps} input - The options for the PUT request, including URL, URL parameters, headers, and body.\n * @returns {Promise<ApiResponseDTO<T>>} A promise that resolves to the API response.\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nasync function putRequest<T = any>(\n\tinput: InputProps,\n): Promise<ApiResponseDTO<T>> {\n\treturn makeRequest({\n\t\tmethod: \"PUT\",\n\t\turl: input.url,\n\t\turlParams: input.urlParams,\n\t\theaders: input.headers,\n\t\tbody: input.body,\n\t});\n}\n\nexport { putRequest };\n","import { deleteRequest } from \"../http/api/_deleteRequest\";\nimport { getRequest } from \"../http/api/_getRequest\";\nimport { patchRequest } from \"../http/api/_patchRequest\";\nimport { postRequest } from \"../http/api/_postRequest\";\nimport { putRequest } from \"../http/api/_putRequest\";\nimport { flushDebugLogs } from \"../utilities/flushDebugLogs\";\n\ntype ApiServiceConstructorProps = {\n\t/** Base URL prepended to every request path (e.g. `\"https://api.example.com\"`). */\n\tbaseUrl: string;\n\t/** Default headers merged into every request. */\n\tbaseHeaders?: HeadersInit;\n\t/** Default Bearer token; can be overridden per request via `data.token`. */\n\tbaseToken?: string | null;\n\t/** When `true`, logs each request and response to the console in development. */\n\tenableDebug?: boolean;\n};\n\ntype ApiRequestDataWithoutBodyProps = {\n\theaders?: HeadersInit;\n\ttoken?: string;\n\turlParams?: Record<string, string>;\n};\n\ntype ApiRequestDataWithBodyProps = {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tbody?: any;\n\theaders?: HeadersInit;\n\ttoken?: string;\n\turlParams?: Record<string, string>;\n};\n\ntype DebugConfig = {\n\theaders?: HeadersInit;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tbody?: any;\n\tstatus: number;\n\tmessage: string;\n};\n\n/**\n * HTTP client for external API calls. Wraps fetch with base URL, default headers, optional auth token,\n * and per-request overrides for all standard HTTP methods.\n *\n * @example\n * ```typescript\n * const api = new ApiService({\n * baseUrl: \"https://api.example.com\",\n * baseToken: session.token,\n * enableDebug: true,\n * });\n *\n * const { data } = await api.get(\"/users/me\");\n * const { data: created } = await api.post(\"/orders\", { body: { productId: 1 } });\n * ```\n */\nclass ApiService {\n\tprivate baseUrl: string;\n\tprivate baseHeaders?: HeadersInit;\n\tprivate baseToken?: string;\n\tprivate enableDebug?: boolean;\n\n\tconstructor(props: ApiServiceConstructorProps) {\n\t\tthis.baseUrl = props.baseUrl;\n\t\tthis.baseHeaders = props.baseHeaders || undefined;\n\t\tthis.baseToken = props.baseToken || undefined;\n\t\tthis.enableDebug = props.enableDebug || false;\n\t}\n\n\tprivate onDebug(endpoint: string, method: string, data: DebugConfig) {\n\t\tif (this.enableDebug) {\n\t\t\tconst debugs: string[] = [];\n\t\t\tconst json = (data: unknown) => JSON.stringify(data, null, 2);\n\n\t\t\tdebugs.push(`Base URL: ${this.baseUrl}`);\n\t\t\tdebugs.push(`Endpoint: ${endpoint}`);\n\t\t\tdebugs.push(`Status/Method: ${method} => ${data.status}`);\n\t\t\tdebugs.push(`Message: ${data.message}`);\n\n\t\t\tif (data.headers) debugs.push(`Headers: ${json(data.headers)}`);\n\t\t\tif (data.body) debugs.push(`Body: ${json(data.body)}`);\n\n\t\t\tflushDebugLogs({ debugs, name: \"ApiDebug\", scheme: \"yellow\" });\n\t\t}\n\t}\n\n\tprivate generateHeaders(\n\t\tinitHeaders: HeadersInit,\n\t\ttoken?: string,\n\t): HeadersInit {\n\t\tlet headers: HeadersInit = {};\n\t\tif (this.baseToken) headers = { Authorization: `Bearer ${this.baseToken}` };\n\t\tif (this.baseHeaders) headers = { ...headers, ...this.baseHeaders };\n\n\t\tif (initHeaders) headers = { ...headers, ...initHeaders };\n\t\tif (token) headers = { ...headers, Authorization: `Bearer ${token}` };\n\n\t\treturn headers;\n\t}\n\n\t/**\n\t * Sends a get request to the specified endpoint.\n\t * @param endpoint - The API endpoint to send the get request to.\n\t * @param data - The request data, including optional headers and token.\n\t * @returns The API response data.\n\t */\n\n\tasync get(endpoint: string, data?: ApiRequestDataWithoutBodyProps) {\n\t\tconst headers = this.generateHeaders(data?.headers || {}, data?.token);\n\n\t\tconst response = await getRequest({\n\t\t\turl: this.baseUrl + endpoint,\n\t\t\turlParams: data?.urlParams || {},\n\t\t\theaders,\n\t\t});\n\n\t\tthis.onDebug(endpoint, \"get\", {\n\t\t\theaders,\n\t\t\tmessage: response.message,\n\t\t\tstatus: response.status,\n\t\t});\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Sends a post request to the specified endpoint.\n\t * @param endpoint - The API endpoint to send the post request to.\n\t * @param data - The request data, including body, optional headers, and token.\n\t * @returns The API response data.\n\t */\n\n\tasync post(endpoint: string, data?: ApiRequestDataWithBodyProps) {\n\t\tconst headers = this.generateHeaders(data?.headers || {}, data?.token);\n\t\tconst body = data?.body;\n\n\t\tconst response = await postRequest({\n\t\t\turl: this.baseUrl + endpoint,\n\t\t\turlParams: data?.urlParams || {},\n\t\t\theaders,\n\t\t\tbody,\n\t\t});\n\n\t\tthis.onDebug(endpoint, \"post\", {\n\t\t\theaders,\n\t\t\tbody,\n\t\t\tmessage: response.message,\n\t\t\tstatus: response.status,\n\t\t});\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Sends a put request to the specified endpoint.\n\t * @param endpoint - The API endpoint to send the put request to.\n\t * @param data - The request data, including body, optional headers, and token.\n\t * @returns The API response data.\n\t */\n\n\tasync put(endpoint: string, data?: ApiRequestDataWithBodyProps) {\n\t\tconst headers = this.generateHeaders(data?.headers || {}, data?.token);\n\t\tconst body = data?.body;\n\n\t\tconst response = await putRequest({\n\t\t\turl: this.baseUrl + endpoint,\n\t\t\turlParams: data?.urlParams || {},\n\t\t\theaders,\n\t\t\tbody,\n\t\t});\n\n\t\tthis.onDebug(endpoint, \"put\", {\n\t\t\theaders,\n\t\t\tbody,\n\t\t\tmessage: response.message,\n\t\t\tstatus: response.status,\n\t\t});\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Sends a patch request to the specified endpoint.\n\t * @param endpoint - The API endpoint to send the patch request to.\n\t * @param data - The request data, including body, optional headers, and token.\n\t * @returns The API response data.\n\t */\n\n\tasync patch(endpoint: string, data?: ApiRequestDataWithBodyProps) {\n\t\tconst headers = this.generateHeaders(data?.headers || {}, data?.token);\n\t\tconst body = data?.body;\n\n\t\tconst response = await patchRequest({\n\t\t\turl: this.baseUrl + endpoint,\n\t\t\turlParams: data?.urlParams || {},\n\t\t\theaders,\n\t\t\tbody,\n\t\t});\n\n\t\tthis.onDebug(endpoint, \"patch\", {\n\t\t\theaders,\n\t\t\tbody,\n\t\t\tmessage: response.message,\n\t\t\tstatus: response.status,\n\t\t});\n\n\t\treturn response;\n\t}\n\n\t/**\n\t * Sends a delete request to the specified endpoint.\n\t * @param endpoint - The API endpoint to send the delete request to.\n\t * @param data - The request data, including body, optional headers, and token.\n\t * @returns The API response data.\n\t */\n\n\tasync delete(endpoint: string, data?: ApiRequestDataWithBodyProps) {\n\t\tconst headers = this.generateHeaders(data?.headers || {}, data?.token);\n\t\tconst body = data?.body;\n\n\t\tconst response = await deleteRequest({\n\t\t\turl: this.baseUrl + endpoint,\n\t\t\turlParams: data?.urlParams || {},\n\t\t\theaders,\n\t\t\tbody,\n\t\t});\n\n\t\tthis.onDebug(endpoint, \"delete\", {\n\t\t\theaders,\n\t\t\tbody,\n\t\t\tmessage: response.message,\n\t\t\tstatus: response.status,\n\t\t});\n\n\t\treturn response;\n\t}\n}\n\nexport { ApiService };\n","import { BadRequest } from \"../http/badResponses/badRequest\";\n\n/**\n * Decodes a request body into a plain object, trying JSON first then URL-encoded form data.\n * Throws `BadRequest` if neither format can be parsed.\n *\n * @param request - The incoming request whose body will be decoded.\n * @returns The decoded body as a plain object.\n *\n * @example\n * ```typescript\n * export async function action({ request }: ActionFunctionArgs) {\n * const body = await decodeRequestBody(request);\n * // body is now a plain JS object\n * }\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nasync function decodeRequestBody(request: Request): Promise<any> {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tlet data: any;\n\n\tconst arrayBuffer = await request.arrayBuffer();\n\tconst text = new TextDecoder().decode(arrayBuffer);\n\n\ttry {\n\t\tdata = JSON.parse(text);\n\t} catch (_jsonError) {\n\t\ttry {\n\t\t\tif (text.includes(\"=\")) {\n\t\t\t\tconst formData = new URLSearchParams(text);\n\t\t\t\tdata = Object.fromEntries(formData.entries());\n\t\t\t} else {\n\t\t\t\tthrow new BadRequest(\"Invalid URLSearchParams format\");\n\t\t\t}\n\t\t} catch (_formDataError) {\n\t\t\tthrow new BadRequest(\"Failed to extract data from request\");\n\t\t}\n\t}\n\n\treturn data;\n}\n\nexport { decodeRequestBody };\n","/**\n * Extracts a human-readable error message from an API response body or a `Response` object.\n * Checks `data.message`, `data.operator_erro_message`, `data.error`, `data.error.message`,\n * and `response.statusText` in that order. Falls back to `\"Missing error message\"`.\n *\n * @param data - Parsed response body that may contain error info.\n * @param response - The raw `Response` object, used as a fallback for `statusText`.\n * @returns The first non-empty string error message found.\n *\n * @example\n * ```typescript\n * const res = await fetch(\"/api/orders\");\n * const data = await res.json().catch(() => null);\n * const message = decodeRequestErrorMessage(data, res);\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction decodeRequestErrorMessage(data: any, response: Response): string {\n\tif (data?.message && typeof data?.message === \"string\") {\n\t\treturn data?.message;\n\t}\n\n\tif (\n\t\tdata?.operator_erro_message &&\n\t\ttypeof data?.operator_erro_message === \"string\"\n\t) {\n\t\treturn data?.operator_erro_message;\n\t}\n\n\tif (data?.error && typeof data?.error === \"string\") {\n\t\treturn data?.error;\n\t}\n\n\tif (data?.error?.message && typeof data?.error?.message === \"string\") {\n\t\treturn data?.error?.message;\n\t}\n\n\tif (response?.statusText && typeof response?.statusText === \"string\") {\n\t\treturn response?.statusText;\n\t}\n\n\treturn \"Missing error message\";\n}\n\nexport { decodeRequestErrorMessage };\n","import { BadGateway } from \"../http/badResponses/badGateway\";\nimport { BadRequest } from \"../http/badResponses/badRequest\";\nimport { Conflict } from \"../http/badResponses/conflict\";\nimport { Forbidden } from \"../http/badResponses/forbidden\";\nimport { NotFound } from \"../http/badResponses/notFound\";\nimport { NotImplemented } from \"../http/badResponses/notImplemented\";\nimport { ServerError } from \"../http/badResponses/serverError\";\nimport { Unauthorized } from \"../http/badResponses/unauthorized\";\nimport { UnprocessableEntity } from \"../http/badResponses/unprocessableEntity\";\n\nimport { Created } from \"../http/successResponses/created\";\nimport { Found } from \"../http/successResponses/found\";\nimport { NoContent } from \"../http/successResponses/noContent\";\nimport { Success } from \"../http/successResponses/success\";\nimport { Updated } from \"../http/successResponses/updated\";\n\n/**\n * Converts any thrown value into a `Response`. Recognizes all `@arkyn/server` success and error\n * response classes, native `Response` objects, and falls back to a 500 `ServerError` for anything else.\n *\n * Intended to be used as the catch handler of a route action or loader:\n *\n * @param error - The thrown value to convert.\n * @returns A `Response` with the appropriate HTTP status, headers, and JSON body.\n *\n * @example\n * ```typescript\n * export async function action({ request }: ActionFunctionArgs) {\n * try {\n * const user = await findUser(id);\n * if (!user) throw new NotFound(\"User not found\");\n * return new Success(\"User retrieved\", { user }).toJson();\n * } catch (error) {\n * return errorHandler(error);\n * }\n * }\n * ```\n */\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction errorHandler(error: any): Response {\n\tswitch (true) {\n\t\tcase error instanceof Response:\n\t\t\treturn error;\n\t\tcase error instanceof Found:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof Created:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof Updated:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof Success:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof NoContent:\n\t\t\treturn error.toResponse();\n\t}\n\n\tswitch (true) {\n\t\tcase error instanceof BadGateway:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof BadRequest:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof Conflict:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof Forbidden:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof NotFound:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof NotImplemented:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof ServerError:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof Unauthorized:\n\t\t\treturn error.toResponse();\n\t\tcase error instanceof UnprocessableEntity:\n\t\t\treturn error.toResponse();\n\t}\n\n\treturn new ServerError(\"Server error\", error).toResponse();\n}\n\nexport { errorHandler };\n","import type { ZodType } from \"zod\";\n\ntype SuccessResponse<T extends FormParseProps> = {\n\tsuccess: true;\n\tdata: T[1] extends ZodType<infer U> ? U : never;\n};\n\ntype ErrorResponse = {\n\tsuccess: false;\n\tfields: { [x: string]: string };\n\tfieldErrors: { [x: string]: string };\n};\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype FormParseProps = [formData: { [k: string]: any }, schema: ZodType];\n\ntype FormParseReturnType<T extends FormParseProps> =\n\t| SuccessResponse<T>\n\t| ErrorResponse;\n\n/**\n * Async variant of `formParse` — uses `safeParseAsync` to support Zod schemas with async refinements.\n * Returns `{ success: true, data }` on success or `{ success: false, fieldErrors, fields }` on failure.\n *\n * @param formData - The raw form data object to validate.\n * @param schema - The Zod schema to validate against.\n *\n * @example\n * ```typescript\n * const schema = z.object({ email: z.string().email() });\n * const result = await formAsyncParse([{ email: \"bad\" }, schema]);\n *\n * if (!result.success) {\n * console.log(result.fieldErrors); // { email: \"Invalid email\" }\n * }\n * ```\n */\n\nasync function formAsyncParse<T extends FormParseProps>([\n\tformData,\n\tschema,\n]: T): Promise<FormParseReturnType<T>> {\n\tconst zodResponse = await schema.safeParseAsync(formData);\n\n\tif (zodResponse.success === false) {\n\t\tconst errorsObject = Object.fromEntries(\n\t\t\tzodResponse.error.issues.map((item) => {\n\t\t\t\treturn [item.path.join(\".\"), item.message];\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tfieldErrors: errorsObject,\n\t\t\tfields: formData,\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: zodResponse.data as T[1] extends ZodType<infer U> ? U : never,\n\t\t};\n\t}\n}\n\nexport { formAsyncParse };\n","import type { ZodType } from \"zod\";\n\ntype SuccessResponse<T extends FormParseProps> = {\n\tsuccess: true;\n\tdata: T[1] extends ZodType<infer U> ? U : never;\n};\n\ntype ErrorResponse = {\n\tsuccess: false;\n\tfields: { [x: string]: string };\n\tfieldErrors: { [x: string]: string };\n};\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype FormParseProps = [formData: { [k: string]: any }, schema: ZodType];\n\ntype FormParseReturnType<T extends FormParseProps> =\n\t| SuccessResponse<T>\n\t| ErrorResponse;\n\n/**\n * Validates form data against a Zod schema synchronously.\n * Returns `{ success: true, data }` on success or `{ success: false, fieldErrors, fields }` on failure.\n *\n * @param formData - The raw form data object to validate.\n * @param schema - The Zod schema to validate against.\n *\n * @example\n * ```typescript\n * const schema = z.object({ name: z.string().min(1, \"Required\"), age: z.number().min(18) });\n * const result = formParse([{ name: \"\", age: 15 }, schema]);\n *\n * if (!result.success) {\n * console.log(result.fieldErrors); // { name: \"Required\", age: \"...\" }\n * }\n * ```\n */\n\nfunction formParse<T extends FormParseProps>([\n\tformData,\n\tschema,\n]: T): FormParseReturnType<T> {\n\tconst zodResponse = schema.safeParse(formData);\n\n\tif (zodResponse.success === false) {\n\t\tconst errorsObject = Object.fromEntries(\n\t\t\tzodResponse.error.issues.map((item) => {\n\t\t\t\treturn [item.path.join(\".\"), item.message];\n\t\t\t}),\n\t\t);\n\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\tfieldErrors: errorsObject,\n\t\t\tfields: formData,\n\t\t};\n\t} else {\n\t\treturn {\n\t\t\tsuccess: true,\n\t\t\tdata: zodResponse.data as T[1] extends ZodType<infer U> ? U : never,\n\t\t};\n\t}\n}\n\nexport { formParse };\n","/**\n * Extracts URL search parameters from a request, optionally filtered by a namespace prefix\n * (e.g. `scope:key` → `key`). Without a scope, returns all search params as-is.\n *\n * @param request - The incoming request whose URL will be parsed.\n * @param scope - Namespace prefix to filter by (e.g. `\"table\"` matches `table:page`, `table:sort`).\n * @returns A `URLSearchParams` object with the matching params, stripped of the scope prefix.\n *\n * @example\n * ```typescript\n * // URL: /products?table:page=2&table:sort=asc&other=1\n * const params = getScopedParams(request, \"table\");\n * params.get(\"page\"); // \"2\"\n * params.get(\"sort\"); // \"asc\"\n * ```\n */\n\nfunction getScopedParams(request: Request, scope: string = \"\") {\n\tconst url = new URL(request.url);\n\tif (scope === \"\") return url.searchParams;\n\n\tconst scopedSearchParams: [string, string][] = Array.from(\n\t\turl.searchParams.entries(),\n\t)\n\t\t.filter(([key]) => key.startsWith(`${scope}:`))\n\t\t.map(([key, value]) => [key.replace(`${scope}:`, \"\"), value]);\n\n\treturn new URLSearchParams(scopedSearchParams);\n}\n\nexport { getScopedParams };\n","import type { ZodType, z } from \"zod\";\n\nimport { ServerError } from \"../http/badResponses/serverError\";\nimport { UnprocessableEntity } from \"../http/badResponses/unprocessableEntity\";\nimport { formAsyncParse } from \"./formAsyncParse\";\nimport { formParse } from \"./formParse\";\n\nfunction formatErrorMessage(error: z.ZodError) {\n\tconst title = \"Error validating:\";\n\tconst lines = error.issues.map(\n\t\t({ path, message }) => `-> ${path.join(\".\")}: ${message}`,\n\t);\n\n\treturn [title, ...lines].join(\"\\n\");\n}\n\n/**\n * Wraps a Zod schema with convenience validation methods suited for server-side use:\n * - `isValid` — boolean check, no throws\n * - `safeValidate` — raw Zod result, no throws\n * - `validate` — throws `ServerError` on failure (for trusted/internal data)\n * - `formValidate` / `formAsyncValidate` — throws `UnprocessableEntity` on failure (for user-submitted forms)\n *\n * @example\n * ```typescript\n * const validator = new SchemaValidator(z.object({ email: z.string().email() }));\n *\n * // Inside a Remix action:\n * const body = validator.formValidate(await decodeRequestBody(request));\n * ```\n */\nclass SchemaValidator<T extends ZodType> {\n\t/**\n\t * @param schema - The Zod schema used for all validation methods on this instance.\n\t */\n\tconstructor(readonly schema: T) {}\n\n\t/**\n\t * Returns `true` if the data satisfies the schema, `false` otherwise. Never throws.\n\t *\n\t * @param data - The value to check.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tisValid(data: any): boolean {\n\t\treturn this.schema.safeParse(data).success;\n\t}\n\n\t/**\n\t * Validates data and returns the raw Zod `safeParseResult` without throwing.\n\t * Useful when you need access to the full error details.\n\t *\n\t * @param data - The value to validate.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tsafeValidate(data: any): z.ZodSafeParseResult<z.infer<T>> {\n\t\treturn this.schema.safeParse(data);\n\t}\n\n\t/**\n\t * Validates data and returns the typed result, throwing `ServerError` on failure.\n\t * Use for validating internal/trusted data (e.g. env vars, config objects).\n\t *\n\t * @param data - The value to validate.\n\t * @throws `ServerError` with a formatted field-by-field error message.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tvalidate(data: any): z.infer<T> {\n\t\ttry {\n\t\t\treturn this.schema.parse(data);\n\t\t} catch (error) {\n\t\t\tthrow new ServerError(formatErrorMessage(error as z.ZodError));\n\t\t}\n\t}\n\n\t/**\n\t * Validates form data and returns the typed result, throwing `UnprocessableEntity` on failure.\n\t * The error includes `fieldErrors`, `fields`, and `data.scrollTo` (first failing field name).\n\t *\n\t * @param data - The raw form data to validate.\n\t * @param message - Optional human-readable error message for the 422 response.\n\t * @throws `UnprocessableEntity` with structured field errors for client-side form handling.\n\t *\n\t * @example\n\t * ```typescript\n\t * const validator = new SchemaValidator(registerSchema);\n\t * const body = validator.formValidate(await decodeRequestBody(request));\n\t * ```\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tformValidate(data: any, message?: string): z.infer<T> {\n\t\tconst formParsed = formParse([data, this.schema]);\n\n\t\tif (\"fieldErrors\" in formParsed) {\n\t\t\tconst firstErrorKey = Object.keys(formParsed.fieldErrors)[0];\n\n\t\t\tthrow new UnprocessableEntity({\n\t\t\t\tfields: formParsed.fields,\n\t\t\t\tfieldErrors: formParsed.fieldErrors,\n\t\t\t\tdata: { scrollTo: firstErrorKey },\n\t\t\t\tmessage,\n\t\t\t});\n\t\t}\n\n\t\treturn formParsed.data as z.infer<T>;\n\t}\n\n\t/**\n\t * Async version of `formValidate` for schemas with async refinements (e.g. uniqueness checks).\n\t *\n\t * @param data - The raw form data to validate.\n\t * @param message - Optional human-readable error message for the 422 response.\n\t * @throws `UnprocessableEntity` with structured field errors for client-side form handling.\n\t *\n\t * @example\n\t * ```typescript\n\t * const validator = new SchemaValidator(registerSchema);\n\t * const body = await validator.formAsyncValidate(await decodeRequestBody(request));\n\t * ```\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tasync formAsyncValidate(data: any, message?: string): Promise<z.infer<T>> {\n\t\tconst formParsed = await formAsyncParse([data, this.schema]);\n\n\t\tif (\"fieldErrors\" in formParsed) {\n\t\t\tconst firstErrorKey = Object.keys(formParsed.fieldErrors)[0];\n\n\t\t\tthrow new UnprocessableEntity({\n\t\t\t\tfields: formParsed.fields,\n\t\t\t\tfieldErrors: formParsed.fieldErrors,\n\t\t\t\tdata: { scrollTo: firstErrorKey },\n\t\t\t\tmessage,\n\t\t\t});\n\t\t}\n\n\t\treturn formParsed.data as z.infer<T>;\n\t}\n}\n\nexport { SchemaValidator };\n","import { removeNonNumeric } from \"@arkyn/shared\";\n\n/**\n * Validates a Brazilian CEP (postal code).\n *\n * A valid CEP must contain exactly 8 numeric digits,\n * optionally formatted as \"12345-678\".\n *\n * @param rawCep - CEP value, with or without formatting.\n * @returns `true` if the CEP is valid, otherwise `false`.\n *\n * @example\n * ```typescript\n * validateCep(\"12345-678\"); // true\n * validateCep(\"12345678\"); // true\n * validateCep(\"ABCDE-123\"); // false\n * ```\n */\n\nfunction validateCep(rawCep: string): boolean {\n\tconst validFormat = /^\\d{5}-\\d{3}$/.test(rawCep) || /^\\d{8}$/.test(rawCep);\n\tif (!validFormat) return false;\n\n\tconst cep = removeNonNumeric(rawCep);\n\n\tconst CEP_LENGTH = 8;\n\tconst isOnlyDigits = /^\\d{8}$/.test(cep);\n\n\treturn cep.length === CEP_LENGTH && isOnlyDigits;\n}\n\nexport { validateCep };\n","import { removeNonNumeric } from \"@arkyn/shared\";\n\nfunction isInvalidLength(cnpj: string) {\n\tconst CNPJ_LENGTH = 14;\n\treturn cnpj.length !== CNPJ_LENGTH;\n}\n\nfunction hasAllDigitsEqual(cnpj: string) {\n\tconst [firstDigit] = cnpj;\n\treturn [...cnpj].every((digit) => digit === firstDigit);\n}\n\nfunction calculateDigit(cnpj: string, multipliers: number[]) {\n\tlet total = 0;\n\tfor (let i = 0; i < multipliers.length; i++) {\n\t\ttotal += parseInt(cnpj[i], 10) * multipliers[i];\n\t}\n\tconst rest = total % 11;\n\treturn rest < 2 ? 0 : 11 - rest;\n}\n\nfunction extractDigit(cnpj: string) {\n\treturn cnpj.slice(12);\n}\n\n/**\n * Validates a Brazilian CNPJ (Cadastro Nacional da Pessoa Jurídica) number.\n *\n * This function performs:\n * - Sanitization (removes non-digit characters).\n * - Length check (must be 14 digits).\n * - Repeating digits check (invalid if all digits are the same).\n * - Verifies the two check digits with the proper weights.\n *\n * @param rawCnpj - CNPJ string, possibly formatted.\n * @returns `true` if valid, otherwise `false`.\n *\n * @example\n * ```typescript\n * validateCnpj(\"12.345.678/0001-95\"); // false\n * validateCnpj(\"11.444.777/0001-61\"); // true\n * ```\n */\n\nfunction validateCnpj(rawCnpj: string): boolean {\n\tif (!rawCnpj) return false;\n\tif (rawCnpj.length > 18) return false;\n\tif (rawCnpj.length < 14) return false;\n\n\tconst hasSpaces = /\\s/.test(rawCnpj);\n\tif (hasSpaces) return false;\n\n\tconst cnpj = removeNonNumeric(rawCnpj);\n\n\tif (isInvalidLength(cnpj)) return false;\n\tif (hasAllDigitsEqual(cnpj)) return false;\n\n\tconst base = cnpj.slice(0, 12);\n\tconst digit1 = calculateDigit(base, [5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2]);\n\tconst digit2 = calculateDigit(\n\t\tbase + digit1,\n\t\t[6, 5, 4, 3, 2, 9, 8, 7, 6, 5, 4, 3, 2],\n\t);\n\n\treturn extractDigit(cnpj) === `${digit1}${digit2}`;\n}\n\nexport { validateCnpj };\n","import { removeNonNumeric } from \"@arkyn/shared\";\n\nfunction isInvalidLength(cpf: string) {\n\tconst CPF_LENGTH = 11;\n\treturn cpf.length !== CPF_LENGTH;\n}\n\nfunction hasAllDigitsEqual(cpf: string) {\n\tconst [firstCpfDigit] = cpf;\n\treturn [...cpf].every((digit) => digit === firstCpfDigit);\n}\n\nfunction calculateDigit(cpf: string, factor: number) {\n\tlet total = 0;\n\tfor (const digit of cpf) {\n\t\tif (factor > 1) total += parseInt(digit, 10) * factor--;\n\t}\n\tconst rest = total % 11;\n\treturn rest < 2 ? 0 : 11 - rest;\n}\n\nfunction extractDigit(cpf: string) {\n\treturn cpf.slice(9);\n}\n\n/**\n * Validates a Brazilian CPF number. Strips formatting, checks length, rejects\n * repeated-digit sequences, and verifies both check digits with the CPF algorithm.\n *\n * @param rawCpf - CPF string, with or without formatting (dots and dashes).\n * @returns `true` if the CPF is valid, otherwise `false`.\n *\n * @example\n * ```typescript\n * validateCpf(\"123.456.789-09\"); // false\n * validateCpf(\"111.444.777-35\"); // true\n * ```\n */\n\nfunction validateCpf(rawCpf: string): boolean {\n\tif (!rawCpf) return false;\n\tif (rawCpf.length > 14) return false;\n\tif (rawCpf.length < 11) return false;\n\n\tconst hasSpaces = /\\s/.test(rawCpf);\n\tif (hasSpaces) return false;\n\n\tconst cpf = removeNonNumeric(rawCpf);\n\n\tif (isInvalidLength(cpf)) return false;\n\tif (hasAllDigitsEqual(cpf)) return false;\n\n\tconst digit1 = calculateDigit(cpf, 10);\n\tconst digit2 = calculateDigit(cpf, 11);\n\n\treturn extractDigit(cpf) === `${digit1}${digit2}`;\n}\n\nexport { validateCpf };\n","import { ValidateDateService } from \"@arkyn/shared\";\n\n/**\n * Validates a date string against a format and optional year bounds.\n *\n * @param date - The date string to validate.\n * @param config.inputFormat - Parsing format: `\"brazilianDate\"` (DD/MM/YYYY, default), `\"isoDate\"` (MM-DD-YYYY), or `\"timestamp\"` (YYYY-MM-DD).\n * @param config.minYear - Minimum allowed year. Defaults to 1900.\n * @param config.maxYear - Maximum allowed year. Defaults to 3000.\n * @returns `true` if the date is valid according to the format and bounds, otherwise `false`.\n *\n * @example\n * ```typescript\n * validateDate(\"31/12/2023\"); // true\n * validateDate(\"2023-12-31\", { inputFormat: \"timestamp\", minYear: 2000, maxYear: 2100 }); // true\n * validateDate(\"29/02/2023\"); // false (not a leap year)\n * ```\n */\n\nfunction validateDate(\n\tdate: string,\n\tconfig?: {\n\t\tinputFormat?: \"brazilianDate\" | \"isoDate\" | \"timestamp\";\n\t\tminYear?: number;\n\t\tmaxYear?: number;\n\t},\n): boolean {\n\tconst inputFormat = config?.inputFormat || \"brazilianDate\";\n\tconst minYear = config?.minYear || 1900;\n\tconst maxYear = config?.maxYear || 3000;\n\n\tconst validateDateService = new ValidateDateService();\n\tvalidateDateService.validateInputFormat(inputFormat);\n\n\tlet day: number, month: number, year: number;\n\tconst dateParts = date.split(/[-/]/).map(Number);\n\n\tif (dateParts.length !== 3) return false;\n\n\ttry {\n\t\tswitch (inputFormat) {\n\t\t\tcase \"brazilianDate\":\n\t\t\t\t[day, month, year] = dateParts;\n\t\t\t\tvalidateDateService.validateDateParts(year, month, day);\n\t\t\t\tbreak;\n\t\t\tcase \"isoDate\":\n\t\t\t\t[month, day, year] = dateParts;\n\t\t\t\tvalidateDateService.validateDateParts(year, month, day);\n\t\t\t\tbreak;\n\t\t\tcase \"timestamp\":\n\t\t\t\t[year, month, day] = dateParts;\n\t\t\t\tvalidateDateService.validateDateParts(year, month, day);\n\t\t\t\tbreak;\n\t\t}\n\t\tif (year < minYear || year > maxYear) return false;\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport { validateDate };\n","import dns from \"node:dns\";\n\nfunction isValidBasicFormat(email: string): boolean {\n\tconst emailRegex =\n\t\t/^[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])?)*$/;\n\n\treturn emailRegex.test(email);\n}\n\nfunction isValidLocalPart(localPart: string): boolean {\n\tif (localPart.length === 0 || localPart.length > 64) return false;\n\tif (localPart.startsWith(\".\") || localPart.endsWith(\".\")) return false;\n\tif (localPart.includes(\"..\")) return false;\n\n\tconst validLocalRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+$/;\n\tif (!validLocalRegex.test(localPart)) return false;\n\n\treturn true;\n}\n\nfunction isValidDomainLabel(label: string): boolean {\n\tif (label.length === 0 || label.length > 63) return false;\n\tif (label.startsWith(\"-\") || label.endsWith(\"-\")) return false;\n\tif (!/^[a-zA-Z0-9-]+$/.test(label)) return false;\n\treturn true;\n}\n\nfunction isValidDomainPart(domainPart: string): boolean {\n\tif (domainPart.length === 0 || domainPart.length > 253) return false;\n\n\tif (\n\t\tdomainPart.startsWith(\".\") ||\n\t\tdomainPart.endsWith(\".\") ||\n\t\tdomainPart.startsWith(\"-\") ||\n\t\tdomainPart.endsWith(\"-\")\n\t) {\n\t\treturn false;\n\t}\n\n\tconst labels = domainPart.split(\".\");\n\tif (labels.length < 2) return false;\n\n\tfor (const label of labels) if (!isValidDomainLabel(label)) return false;\n\n\tconst tld = labels[labels.length - 1];\n\tif (tld.length < 2 || !/^[a-zA-Z]+$/.test(tld)) return false;\n\n\treturn true;\n}\n\nfunction isValidAdvancedSyntax(email: string): boolean {\n\tconst parts = email.split(\"@\");\n\tif (parts.length !== 2) return false;\n\n\tconst [localPart, domainPart] = parts;\n\n\tif (!isValidLocalPart(localPart)) return false;\n\tif (!isValidDomainPart(domainPart)) return false;\n\treturn true;\n}\n\nfunction extractDomain(email: string): string | null {\n\tconst parts = email.split(\"@\");\n\treturn parts.length === 2 ? parts[1].toLowerCase() : null;\n}\n\nconst DNS_RECORD_TYPES = [\"MX\", \"A\", \"AAAA\"] as const;\n\nasync function tryResolveDnsRecord(\n\tdomain: string,\n\trecordType: string,\n): Promise<boolean> {\n\ttry {\n\t\tawait dns?.promises?.resolve(domain, recordType);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function isValidDns(domain: string): Promise<boolean> {\n\tfor (const recordType of DNS_RECORD_TYPES) {\n\t\tconst hasRecord = await tryResolveDnsRecord(domain, recordType);\n\t\tif (hasRecord) return true;\n\t}\n\treturn false;\n}\n\n/**\n * Validates if an email address is valid in all possible ways, including DNS validation.\n *\n * This function performs comprehensive email validation by:\n * - Checking basic email format and syntax\n * - Validating advanced RFC 5322 compliance rules\n * - Verifying that the domain has valid MX or A records in DNS\n *\n * @param rawEmail - The email address to validate.\n * @returns `true` if the email passes format checks and its domain resolves in DNS, otherwise `false`.\n *\n * @example\n * ```typescript\n * await validateEmail(\"user@gmail.com\"); // true\n * await validateEmail(\"user@gmil.com\"); // false (invalid domain)\n * await validateEmail(\"invalid-email\"); // false (invalid format)\n * ```\n */\n\nasync function validateEmail(rawEmail: string): Promise<boolean> {\n\tif (!rawEmail || typeof rawEmail !== \"string\") return false;\n\tconst email = rawEmail.trim();\n\n\tif (!isValidBasicFormat(email)) return false;\n\tif (!isValidAdvancedSyntax(email)) return false;\n\n\tconst domain = extractDomain(email);\n\tif (!domain) return false;\n\n\treturn await isValidDns(domain);\n}\n\nexport { validateEmail };\n","/**\n * Validates a password based on the following rules:\n * - At least 8 characters\n * - At least 1 uppercase letter\n * - At least 1 letter (any case)\n * - At least 1 number\n * - At least 1 special character\n *\n * @param rawPassword - The password string to validate.\n * @returns `true` if the password meets all rules, otherwise `false`.\n *\n * @example\n * ```ts\n * validatePassword(\"Senha@123\"); // true\n * validatePassword(\"senha123\"); // false (no uppercase, no special char)\n * ```\n */\n\nfunction validatePassword(rawPassword: string): boolean {\n\tif (!rawPassword) return false;\n\n\tconst hasMinLength = rawPassword.length >= 8;\n\tconst hasUppercase = /[A-Z]/.test(rawPassword);\n\tconst hasLetter = /[a-z]/.test(rawPassword);\n\tconst hasNumber = /\\d/.test(rawPassword);\n\tconst hasSpecialChar = /[!@#$%^&*(),.?\":;{}|<>_\\-+=~`[\\]\\\\/]/.test(\n\t\trawPassword,\n\t);\n\n\treturn [\n\t\thasMinLength,\n\t\thasUppercase,\n\t\thasLetter,\n\t\thasNumber,\n\t\thasSpecialChar,\n\t].every((condition) => condition);\n}\n\nexport { validatePassword };\n","import { countries } from \"@arkyn/templates\";\nimport {\n\tisValidPhoneNumber,\n\tparsePhoneNumberWithError,\n} from \"libphonenumber-js\";\n\n/**\n * Validates an international phone number using `libphonenumber-js`, then confirms\n * the parsed country code is present in the supported countries list.\n *\n * @param rawPhone - Phone number in E.164 format (e.g. `\"+5532912345678\"`).\n * @returns `true` if the number is valid and the country is supported, otherwise `false`.\n *\n * @example\n * ```typescript\n * validatePhone(\"+5532912345678\"); // true (Brazil)\n * validatePhone(\"+55329123456178\"); // false (invalid)\n * ```\n */\n\nfunction validatePhone(rawPhone: string): boolean {\n\tif (!isValidPhoneNumber(rawPhone)) return false;\n\n\tconst parsedPhone = parsePhoneNumberWithError(rawPhone);\n\n\tconst countryCode = parsedPhone?.country;\n\tif (!countryCode) return false;\n\n\tconst country = countries.find((c) => c.iso === countryCode);\n\tif (!country) return false;\n\n\treturn true;\n}\n\nexport { validatePhone };\n","/**\n * Validates a Brazilian RG (Registro Geral) in a generic way.\n *\n * This function does a basic structure validation:\n * - Removes non-alphanumeric characters.\n * - Ensures length is reasonable (7–9 digits).\n * - Optionally allows for a final letter (verifier).\n *\n * @param rawRg - RG string, possibly formatted.\n * @returns `true` if format seems valid, otherwise `false`.\n *\n * @example\n * ```ts\n * validateRg(\"12.345.678-9\"); // true\n * validateRg(\"MG-12.345.678\"); // false (not supported)\n * validateRg(\"12345678X\"); // true\n * ```\n */\n\nfunction validateRg(rawRg: string): boolean {\n\tif (!rawRg) return false;\n\n\tconst validFormat = /^[0-9a-zA-Z.-]+$/.test(rawRg);\n\tif (!validFormat) return false;\n\n\tconst rg = rawRg.replace(/[^a-zA-Z0-9]/g, \"\");\n\n\tif (rg.length < 7 || rg.length > 9) return false;\n\n\tconst isValidFormat = /^[0-9]{7,8}[0-9Xx]?$/.test(rg);\n\n\treturn isValidFormat;\n}\n\nexport { validateRg };\n"],"mappings":";;;;;;AAaA,IAAM,IAAN,MAAM,EAAa;CAKlB,OAAO,cAAwB,CAAC;CAOhC,OAAO,cAAc,GAAoB;EACxC,EAAa,YAAY,KAAK,CAAI;CACnC;CAGA,OAAO,mBAAyB;EAC/B,EAAa,cAAc,CAAC;CAC7B;CAQA,OAAO,YAAY;EAClB,IAAM,IAAc,QAAQ,IAAI,GAI1B,MADQ,gBADE,MACF,EAAA,CAAI,SAAS,GAAA,CACF,MAAM,IAAI,CAAC,CAAC,KAAK,MAAS,EAAK,KAAK,CAAC,GAE1D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,SAAS,IAAU,KAErB,uBAAuB,KAAK,CAE3C;AACR"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { makeRequest as e } from "./_makeRequest.js";
|
|
2
|
-
//#region src/http/api/
|
|
2
|
+
//#region src/http/api/_deleteRequest.ts
|
|
3
3
|
async function t(t) {
|
|
4
4
|
return e({
|
|
5
5
|
method: "DELETE",
|
|
@@ -11,3 +11,5 @@ async function t(t) {
|
|
|
11
11
|
}
|
|
12
12
|
//#endregion
|
|
13
13
|
export { t as deleteRequest };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=_deleteRequest.js.map
|