@atlantjs/arch 15.7.7 → 15.7.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/package.json +4 -2
  2. package/src/@tool-box/tests/builder.abstract.util.d.ts +0 -1
  3. package/src/@tool-box/tests/builder.abstract.util.js +40 -0
  4. package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts +2 -3
  5. package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.js +15 -0
  6. package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts +1 -2
  7. package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.js +13 -0
  8. package/src/@tool-box/tests/builders/failures/failure.builder.d.ts +1 -2
  9. package/src/@tool-box/tests/builders/failures/failure.builder.js +18 -0
  10. package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts +2 -3
  11. package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.js +18 -0
  12. package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts +2 -3
  13. package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.js +15 -0
  14. package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts +2 -3
  15. package/src/@tool-box/tests/builders/user/email.edge.builder.js +15 -0
  16. package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts +2 -3
  17. package/src/@tool-box/tests/builders/user/username.edge.builder.js +15 -0
  18. package/src/@tool-box/tests/faker/faker.d.ts +0 -1
  19. package/src/@tool-box/tests/faker/faker.js +208 -0
  20. package/src/@tool-box/utils/convert-units/convert-units.d.ts +5 -6
  21. package/src/@tool-box/utils/convert-units/convert-units.js +154 -0
  22. package/src/@tool-box/utils/datatypes/boolean-utils.d.ts +0 -1
  23. package/src/@tool-box/utils/datatypes/boolean-utils.js +155 -0
  24. package/src/@tool-box/utils/datatypes/generic-types.d.ts +0 -1
  25. package/src/@tool-box/utils/datatypes/generic-types.js +3 -0
  26. package/src/@tool-box/utils/datatypes/plainify.d.ts +0 -1
  27. package/src/@tool-box/utils/datatypes/plainify.js +2 -0
  28. package/src/@tool-box/utils/datatypes/string-utils.d.ts +0 -1
  29. package/src/@tool-box/utils/datatypes/string-utils.js +292 -0
  30. package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts +2 -3
  31. package/src/@tool-box/utils/datetime/mappers/month.mapper.js +58 -0
  32. package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.d.ts +0 -1
  33. package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.js +18 -0
  34. package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.d.ts +0 -1
  35. package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.js +18 -0
  36. package/src/@tool-box/utils/ducts/common.d.ts +0 -1
  37. package/src/@tool-box/utils/ducts/common.js +47 -0
  38. package/src/@tool-box/utils/ducts/optional-type.d.ts +1 -2
  39. package/src/@tool-box/utils/ducts/optional-type.js +130 -0
  40. package/src/@tool-box/utils/ducts/return-type.d.ts +2 -3
  41. package/src/@tool-box/utils/ducts/return-type.js +69 -0
  42. package/src/@tool-box/utils/http-provider/http-provider-failure-response.d.ts +1 -2
  43. package/src/@tool-box/utils/http-provider/http-provider-failure-response.js +22 -0
  44. package/src/@tool-box/utils/http-provider/http-provider-success-response.d.ts +1 -2
  45. package/src/@tool-box/utils/http-provider/http-provider-success-response.js +22 -0
  46. package/src/@tool-box/utils/http-provider/http-provider.d.ts +4 -5
  47. package/src/@tool-box/utils/http-provider/http-provider.js +87 -0
  48. package/src/@tool-box/utils/logger/index.d.ts +0 -1
  49. package/src/@tool-box/utils/logger/index.js +31 -0
  50. package/src/@tool-box/utils/map/map.abstract.d.ts +0 -1
  51. package/src/@tool-box/utils/map/map.abstract.js +84 -0
  52. package/src/@tool-box/utils/random/random.d.ts +0 -1
  53. package/src/@tool-box/utils/random/random.js +260 -0
  54. package/src/@tool-box/utils/type-guard/guardian-exception.d.ts +0 -1
  55. package/src/@tool-box/utils/type-guard/guardian-exception.js +6 -0
  56. package/src/@tool-box/utils/type-guard/guardian.d.ts +2 -3
  57. package/src/@tool-box/utils/type-guard/guardian.js +625 -0
  58. package/src/@tool-box/utils/type-guard/guardian.type.d.ts +0 -1
  59. package/src/@tool-box/utils/type-guard/guardian.type.js +2 -0
  60. package/src/@tool-box/utils/validators/is-cron-expression.d.ts +0 -1
  61. package/src/@tool-box/utils/validators/is-cron-expression.js +39 -0
  62. package/src/@tool-box/utils/validators/is-date-string.d.ts +0 -1
  63. package/src/@tool-box/utils/validators/is-date-string.js +39 -0
  64. package/src/@tool-box/utils/validators/is-password-match.d.ts +0 -1
  65. package/src/@tool-box/utils/validators/is-password-match.js +27 -0
  66. package/src/@tool-box/utils/validators/is-password-policy.validator.d.ts +0 -1
  67. package/src/@tool-box/utils/validators/is-password-policy.validator.js +30 -0
  68. package/src/@tool-box/utils/validators/is-schedule.d.ts +0 -1
  69. package/src/@tool-box/utils/validators/is-schedule.js +43 -0
  70. package/src/@tool-box/utils/validators/is-time-string.d.ts +0 -1
  71. package/src/@tool-box/utils/validators/is-time-string.js +39 -0
  72. package/src/@tool-box/utils/validators/is-ulid.d.ts +0 -1
  73. package/src/@tool-box/utils/validators/is-ulid.js +39 -0
  74. package/src/index.d.ts +74 -75
  75. package/src/index.js +179 -0
  76. package/src/objects/@common/edges/email.edge.d.ts +1 -2
  77. package/src/objects/@common/edges/email.edge.js +88 -0
  78. package/src/objects/@common/edges/ulid.sketch.edge.d.ts +0 -1
  79. package/src/objects/@common/edges/ulid.sketch.edge.js +92 -0
  80. package/src/objects/@common/edges/url.edge.d.ts +1 -2
  81. package/src/objects/@common/edges/url.edge.js +270 -0
  82. package/src/objects/@common/edges/username.edge.d.ts +1 -2
  83. package/src/objects/@common/edges/username.edge.js +38 -0
  84. package/src/objects/@common/edges/uuid.sketch.edge.d.ts +0 -1
  85. package/src/objects/@common/edges/uuid.sketch.edge.js +146 -0
  86. package/src/objects/@common/points/environment.point.d.ts +0 -1
  87. package/src/objects/@common/points/environment.point.js +10 -0
  88. package/src/objects/@common/points/header-token-name.point.d.ts +0 -1
  89. package/src/objects/@common/points/header-token-name.point.js +10 -0
  90. package/src/objects/@common/points/http-status-codes.point.d.ts +0 -1
  91. package/src/objects/@common/points/http-status-codes.point.js +244 -0
  92. package/src/objects/amount/amount-value.edge.d.ts +1 -2
  93. package/src/objects/amount/amount-value.edge.js +76 -0
  94. package/src/objects/amount/amount.edge.d.ts +1 -2
  95. package/src/objects/amount/amount.edge.js +628 -0
  96. package/src/objects/amount/amount.polygon.d.ts +0 -1
  97. package/src/objects/amount/amount.polygon.js +2 -0
  98. package/src/objects/amount/amount.uv.d.ts +3 -4
  99. package/src/objects/amount/amount.uv.js +31 -0
  100. package/src/objects/amount/points/duration-unit.point.d.ts +0 -1
  101. package/src/objects/amount/points/duration-unit.point.js +15 -0
  102. package/src/objects/amount/points/energy-unit.point.d.ts +0 -1
  103. package/src/objects/amount/points/energy-unit.point.js +10 -0
  104. package/src/objects/amount/points/length-unit.point.d.ts +0 -1
  105. package/src/objects/amount/points/length-unit.point.js +10 -0
  106. package/src/objects/amount/points/mass-unit.point.d.ts +0 -1
  107. package/src/objects/amount/points/mass-unit.point.js +11 -0
  108. package/src/objects/amount/points/month-name.point.d.ts +0 -1
  109. package/src/objects/amount/points/month-name.point.js +18 -0
  110. package/src/objects/amount/points/object-unit.point.d.ts +0 -1
  111. package/src/objects/amount/points/object-unit.point.js +7 -0
  112. package/src/objects/amount/points/units.point.d.ts +5 -6
  113. package/src/objects/amount/points/units.point.js +2 -0
  114. package/src/objects/amount/points/volume-unit.point.d.ts +0 -1
  115. package/src/objects/amount/points/volume-unit.point.js +8 -0
  116. package/src/objects/amount/points/week-day.point.d.ts +0 -1
  117. package/src/objects/amount/points/week-day.point.js +13 -0
  118. package/src/objects/datetime/edges/datetime.edge.d.ts +2 -3
  119. package/src/objects/datetime/edges/datetime.edge.js +675 -0
  120. package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts +1 -2
  121. package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.js +16 -0
  122. package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts +1 -2
  123. package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.js +16 -0
  124. package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts +2 -3
  125. package/src/objects/datetime/edges/locale/day/today-to-language.mapper.js +12 -0
  126. package/src/objects/datetime/edges/locale/holidays-country.type.d.ts +0 -1
  127. package/src/objects/datetime/edges/locale/holidays-country.type.js +2 -0
  128. package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts +1 -2
  129. package/src/objects/datetime/edges/locale/month/month-to-english.mapper.js +21 -0
  130. package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts +1 -2
  131. package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.js +21 -0
  132. package/src/objects/datetime/points/month-name.enum.d.ts +0 -1
  133. package/src/objects/datetime/points/month-name.enum.js +18 -0
  134. package/src/objects/datetime/points/week-day.enum.d.ts +0 -1
  135. package/src/objects/datetime/points/week-day.enum.js +13 -0
  136. package/src/objects/failure/edges/failure.abstract.d.ts +1 -2
  137. package/src/objects/failure/edges/failure.abstract.js +27 -0
  138. package/src/objects/failure/edges/failure.abstract.polygon.d.ts +0 -1
  139. package/src/objects/failure/edges/failure.abstract.polygon.js +2 -0
  140. package/src/objects/language/points/language.point.d.ts +0 -1
  141. package/src/objects/language/points/language.point.js +135 -0
  142. package/src/objects/metadata/metadata.edge.d.ts +3 -4
  143. package/src/objects/metadata/metadata.edge.js +27 -0
  144. package/src/objects/metadata/metadata.polygon.d.ts +0 -1
  145. package/src/objects/metadata/metadata.polygon.js +2 -0
  146. package/src/objects/metadata/metadata.uv.d.ts +1 -2
  147. package/src/objects/metadata/metadata.uv.js +31 -0
  148. package/src/objects/password/password.edge.d.ts +2 -3
  149. package/src/objects/password/password.edge.js +176 -0
  150. package/src/objects/password/password.polygon.d.ts +1 -2
  151. package/src/objects/password/password.polygon.js +2 -0
  152. package/src/objects/password/steps/not-allowing-consecutive-chars-step.d.ts +2 -3
  153. package/src/objects/password/steps/not-allowing-consecutive-chars-step.js +35 -0
  154. package/src/objects/password/steps/not-allowing-date-step.d.ts +2 -3
  155. package/src/objects/password/steps/not-allowing-date-step.js +62 -0
  156. package/src/objects/password/steps/not-allowing-phone-step.d.ts +2 -3
  157. package/src/objects/password/steps/not-allowing-phone-step.js +28 -0
  158. package/src/objects/password/steps/not-allowing-repeated-chars-step.d.ts +2 -3
  159. package/src/objects/password/steps/not-allowing-repeated-chars-step.js +35 -0
  160. package/src/objects/password/steps/not-allowing-string-step.d.ts +2 -3
  161. package/src/objects/password/steps/not-allowing-string-step.js +20 -0
  162. package/src/objects/password/steps/not-allowing-these-chars-step.d.ts +2 -3
  163. package/src/objects/password/steps/not-allowing-these-chars-step.js +18 -0
  164. package/src/objects/password/steps/numeric-step.d.ts +2 -3
  165. package/src/objects/password/steps/numeric-step.js +13 -0
  166. package/src/objects/password/steps/with-at-least-one-letter-step.d.ts +2 -3
  167. package/src/objects/password/steps/with-at-least-one-letter-step.js +14 -0
  168. package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts +2 -3
  169. package/src/objects/password/steps/with-at-least-one-number-digit-step.js +14 -0
  170. package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts +2 -3
  171. package/src/objects/password/steps/with-at-least-one-special-char-step.js +14 -0
  172. package/src/objects/password/steps/with-length-step.d.ts +2 -3
  173. package/src/objects/password/steps/with-length-step.js +19 -0
  174. package/src/objects/password/validation-step.d.ts +1 -2
  175. package/src/objects/password/validation-step.js +9 -0
  176. package/src/objects/password/validation-step.type.d.ts +0 -1
  177. package/src/objects/password/validation-step.type.js +2 -0
  178. package/src/objects/primitives/boolean.edge.sketch.d.ts +0 -1
  179. package/src/objects/primitives/boolean.edge.sketch.js +148 -0
  180. package/src/objects/primitives/datetime.edge.sketch.d.ts +1 -2
  181. package/src/objects/primitives/datetime.edge.sketch.js +7 -0
  182. package/src/objects/primitives/number.edge.sketch.d.ts +0 -1
  183. package/src/objects/primitives/number.edge.sketch.js +347 -0
  184. package/src/objects/primitives/string.edge.sketch.d.ts +0 -1
  185. package/src/objects/primitives/string.edge.sketch.js +219 -0
  186. package/src/objects/scheduling/scheduling.edge.d.ts +6 -7
  187. package/src/objects/scheduling/scheduling.edge.failure.d.ts +1 -2
  188. package/src/objects/scheduling/scheduling.edge.failure.js +14 -0
  189. package/src/objects/scheduling/scheduling.edge.js +281 -0
  190. package/src/objects/time/time.edge.d.ts +1 -2
  191. package/src/objects/time/time.edge.js +448 -0
  192. package/src/objects-interface/edges/edge.abstract.d.ts +1 -2
  193. package/src/objects-interface/edges/edge.abstract.js +6 -0
  194. package/src/objects-interface/face.abstract.d.ts +2 -3
  195. package/src/objects-interface/face.abstract.js +6 -0
  196. package/src/objects-interface/solid.abstract.d.ts +5 -6
  197. package/src/objects-interface/solid.abstract.js +13 -0
  198. package/src/objects-interface/uv.abstract.d.ts +3 -4
  199. package/src/objects-interface/uv.abstract.js +6 -0
  200. package/src/objects-interface/vertices/vertex.abstract.d.ts +5 -6
  201. package/src/objects-interface/vertices/vertex.abstract.js +13 -0
  202. package/src/shared/payload.abstract.d.ts +0 -1
  203. package/src/shared/payload.abstract.js +6 -0
  204. package/src/shared/request.abstract.d.ts +5 -6
  205. package/src/shared/request.abstract.js +3 -0
  206. package/src/shared/response.abstract.d.ts +0 -1
  207. package/src/shared/response.abstract.js +6 -0
  208. package/{tsconfig-lib.json → tsconfig.lib.json} +0 -1
  209. package/tsconfig.tsbuildinfo +1 -1
  210. package/src/@tool-box/tests/builder.abstract.util.d.ts.map +0 -1
  211. package/src/@tool-box/tests/builders/datetime/datetime.edge.builder.d.ts.map +0 -1
  212. package/src/@tool-box/tests/builders/failures/dummies/failure.dummy.d.ts.map +0 -1
  213. package/src/@tool-box/tests/builders/failures/failure.builder.d.ts.map +0 -1
  214. package/src/@tool-box/tests/builders/metadata/metadata-uv.builder.d.ts.map +0 -1
  215. package/src/@tool-box/tests/builders/metadata/metadata.edge.builder.d.ts.map +0 -1
  216. package/src/@tool-box/tests/builders/user/email.edge.builder.d.ts.map +0 -1
  217. package/src/@tool-box/tests/builders/user/username.edge.builder.d.ts.map +0 -1
  218. package/src/@tool-box/tests/faker/faker.d.ts.map +0 -1
  219. package/src/@tool-box/utils/convert-units/convert-units.d.ts.map +0 -1
  220. package/src/@tool-box/utils/datatypes/boolean-utils.d.ts.map +0 -1
  221. package/src/@tool-box/utils/datatypes/generic-types.d.ts.map +0 -1
  222. package/src/@tool-box/utils/datatypes/plainify.d.ts.map +0 -1
  223. package/src/@tool-box/utils/datatypes/string-utils.d.ts.map +0 -1
  224. package/src/@tool-box/utils/datetime/mappers/month.mapper.d.ts.map +0 -1
  225. package/src/@tool-box/utils/datetime/mappers/points/month-abbreviation.enum.d.ts.map +0 -1
  226. package/src/@tool-box/utils/datetime/mappers/points/month-number.enum.d.ts.map +0 -1
  227. package/src/@tool-box/utils/ducts/common.d.ts.map +0 -1
  228. package/src/@tool-box/utils/ducts/optional-type.d.ts.map +0 -1
  229. package/src/@tool-box/utils/ducts/return-type.d.ts.map +0 -1
  230. package/src/@tool-box/utils/http-provider/http-provider-failure-response.d.ts.map +0 -1
  231. package/src/@tool-box/utils/http-provider/http-provider-success-response.d.ts.map +0 -1
  232. package/src/@tool-box/utils/http-provider/http-provider.d.ts.map +0 -1
  233. package/src/@tool-box/utils/logger/index.d.ts.map +0 -1
  234. package/src/@tool-box/utils/map/map.abstract.d.ts.map +0 -1
  235. package/src/@tool-box/utils/random/random.d.ts.map +0 -1
  236. package/src/@tool-box/utils/type-guard/guardian-exception.d.ts.map +0 -1
  237. package/src/@tool-box/utils/type-guard/guardian.d.ts.map +0 -1
  238. package/src/@tool-box/utils/type-guard/guardian.type.d.ts.map +0 -1
  239. package/src/@tool-box/utils/validators/is-cron-expression.d.ts.map +0 -1
  240. package/src/@tool-box/utils/validators/is-date-string.d.ts.map +0 -1
  241. package/src/@tool-box/utils/validators/is-password-match.d.ts.map +0 -1
  242. package/src/@tool-box/utils/validators/is-password-policy.validator.d.ts.map +0 -1
  243. package/src/@tool-box/utils/validators/is-schedule.d.ts.map +0 -1
  244. package/src/@tool-box/utils/validators/is-time-string.d.ts.map +0 -1
  245. package/src/@tool-box/utils/validators/is-ulid.d.ts.map +0 -1
  246. package/src/index.d.ts.map +0 -1
  247. package/src/objects/@common/edges/email.edge.d.ts.map +0 -1
  248. package/src/objects/@common/edges/ulid.sketch.edge.d.ts.map +0 -1
  249. package/src/objects/@common/edges/url.edge.d.ts.map +0 -1
  250. package/src/objects/@common/edges/username.edge.d.ts.map +0 -1
  251. package/src/objects/@common/edges/uuid.sketch.edge.d.ts.map +0 -1
  252. package/src/objects/@common/points/environment.point.d.ts.map +0 -1
  253. package/src/objects/@common/points/header-token-name.point.d.ts.map +0 -1
  254. package/src/objects/@common/points/http-status-codes.point.d.ts.map +0 -1
  255. package/src/objects/amount/amount-value.edge.d.ts.map +0 -1
  256. package/src/objects/amount/amount.edge.d.ts.map +0 -1
  257. package/src/objects/amount/amount.polygon.d.ts.map +0 -1
  258. package/src/objects/amount/amount.uv.d.ts.map +0 -1
  259. package/src/objects/amount/points/duration-unit.point.d.ts.map +0 -1
  260. package/src/objects/amount/points/energy-unit.point.d.ts.map +0 -1
  261. package/src/objects/amount/points/length-unit.point.d.ts.map +0 -1
  262. package/src/objects/amount/points/mass-unit.point.d.ts.map +0 -1
  263. package/src/objects/amount/points/month-name.point.d.ts.map +0 -1
  264. package/src/objects/amount/points/object-unit.point.d.ts.map +0 -1
  265. package/src/objects/amount/points/units.point.d.ts.map +0 -1
  266. package/src/objects/amount/points/volume-unit.point.d.ts.map +0 -1
  267. package/src/objects/amount/points/week-day.point.d.ts.map +0 -1
  268. package/src/objects/datetime/edges/datetime.edge.d.ts.map +0 -1
  269. package/src/objects/datetime/edges/locale/day/day-name-to-english.mapper.d.ts.map +0 -1
  270. package/src/objects/datetime/edges/locale/day/day-name-to-portuguese.mapper.d.ts.map +0 -1
  271. package/src/objects/datetime/edges/locale/day/today-to-language.mapper.d.ts.map +0 -1
  272. package/src/objects/datetime/edges/locale/holidays-country.type.d.ts.map +0 -1
  273. package/src/objects/datetime/edges/locale/month/month-to-english.mapper.d.ts.map +0 -1
  274. package/src/objects/datetime/edges/locale/month/month-to-portuguese.mapper.d.ts.map +0 -1
  275. package/src/objects/datetime/points/month-name.enum.d.ts.map +0 -1
  276. package/src/objects/datetime/points/week-day.enum.d.ts.map +0 -1
  277. package/src/objects/failure/edges/failure.abstract.d.ts.map +0 -1
  278. package/src/objects/failure/edges/failure.abstract.polygon.d.ts.map +0 -1
  279. package/src/objects/language/points/language.point.d.ts.map +0 -1
  280. package/src/objects/metadata/metadata.edge.d.ts.map +0 -1
  281. package/src/objects/metadata/metadata.polygon.d.ts.map +0 -1
  282. package/src/objects/metadata/metadata.uv.d.ts.map +0 -1
  283. package/src/objects/password/password.edge.d.ts.map +0 -1
  284. package/src/objects/password/password.polygon.d.ts.map +0 -1
  285. package/src/objects/password/steps/not-allowing-consecutive-chars-step.d.ts.map +0 -1
  286. package/src/objects/password/steps/not-allowing-date-step.d.ts.map +0 -1
  287. package/src/objects/password/steps/not-allowing-phone-step.d.ts.map +0 -1
  288. package/src/objects/password/steps/not-allowing-repeated-chars-step.d.ts.map +0 -1
  289. package/src/objects/password/steps/not-allowing-string-step.d.ts.map +0 -1
  290. package/src/objects/password/steps/not-allowing-these-chars-step.d.ts.map +0 -1
  291. package/src/objects/password/steps/numeric-step.d.ts.map +0 -1
  292. package/src/objects/password/steps/with-at-least-one-letter-step.d.ts.map +0 -1
  293. package/src/objects/password/steps/with-at-least-one-number-digit-step.d.ts.map +0 -1
  294. package/src/objects/password/steps/with-at-least-one-special-char-step.d.ts.map +0 -1
  295. package/src/objects/password/steps/with-length-step.d.ts.map +0 -1
  296. package/src/objects/password/validation-step.d.ts.map +0 -1
  297. package/src/objects/password/validation-step.type.d.ts.map +0 -1
  298. package/src/objects/primitives/boolean.edge.sketch.d.ts.map +0 -1
  299. package/src/objects/primitives/datetime.edge.sketch.d.ts.map +0 -1
  300. package/src/objects/primitives/number.edge.sketch.d.ts.map +0 -1
  301. package/src/objects/primitives/string.edge.sketch.d.ts.map +0 -1
  302. package/src/objects/scheduling/scheduling.edge.d.ts.map +0 -1
  303. package/src/objects/scheduling/scheduling.edge.failure.d.ts.map +0 -1
  304. package/src/objects/time/time.edge.d.ts.map +0 -1
  305. package/src/objects-interface/edges/edge.abstract.d.ts.map +0 -1
  306. package/src/objects-interface/face.abstract.d.ts.map +0 -1
  307. package/src/objects-interface/solid.abstract.d.ts.map +0 -1
  308. package/src/objects-interface/uv.abstract.d.ts.map +0 -1
  309. package/src/objects-interface/vertices/vertex.abstract.d.ts.map +0 -1
  310. package/src/shared/payload.abstract.d.ts.map +0 -1
  311. package/src/shared/request.abstract.d.ts.map +0 -1
  312. package/src/shared/response.abstract.d.ts.map +0 -1
  313. /package/{tsconfig-backend.json → tsconfig.backend.json} +0 -0
  314. /package/{tsconfig-default.json → tsconfig.base.json} +0 -0
  315. /package/{tsconfig-mobile.json → tsconfig.mobile.json} +0 -0
  316. /package/{tsconfig-web.json → tsconfig.web.json} +0 -0
@@ -0,0 +1,675 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DatetimeEdge = void 0;
7
+ const date_holidays_1 = __importDefault(require("date-holidays"));
8
+ const moment_1 = __importDefault(require("moment"));
9
+ const guardian_1 = require("../../../@tool-box/utils/type-guard/guardian");
10
+ const day_name_to_english_mapper_1 = require("../../../objects/datetime/edges/locale/day/day-name-to-english.mapper");
11
+ const day_name_to_portuguese_mapper_1 = require("../../../objects/datetime/edges/locale/day/day-name-to-portuguese.mapper");
12
+ const today_to_language_mapper_1 = require("../../../objects/datetime/edges/locale/day/today-to-language.mapper");
13
+ const month_to_english_mapper_1 = require("../../../objects/datetime/edges/locale/month/month-to-english.mapper");
14
+ const month_to_portuguese_mapper_1 = require("../../../objects/datetime/edges/locale/month/month-to-portuguese.mapper");
15
+ const week_day_enum_1 = require("../../../objects/datetime/points/week-day.enum");
16
+ const language_point_1 = require("../../../objects/language/points/language.point");
17
+ class DatetimeEdge {
18
+ value;
19
+ date;
20
+ constructor(value) {
21
+ this.value = value;
22
+ let dateValue;
23
+ if (guardian_1._.isUndefined(this.value)) {
24
+ dateValue = new Date(Date.now());
25
+ }
26
+ else if (guardian_1._.isTypeOf(this.value, "string")) {
27
+ const parsedDate = new Date(this.value);
28
+ if (Number.isNaN(parsedDate.getTime())) {
29
+ throw new Error(`Invalid date string: ${this.value}`);
30
+ }
31
+ dateValue = parsedDate;
32
+ }
33
+ else {
34
+ dateValue = this.value;
35
+ }
36
+ this.date = (0, moment_1.default)(dateValue);
37
+ this.validate();
38
+ }
39
+ /**
40
+ * Returns a human-friendly date string in the format "Day, Mon DD".
41
+ * Uses day and month names in the specified locale.
42
+ * @returns A formatted string such as "Sunday, Mar 29" or "Today, Apr 1"
43
+ * @example
44
+ * new DatetimeEdge(new Date("2026-03-29")).toFriendlyString() // "Sunday, Mar 29"
45
+ * new DatetimeEdge(new Date()).toFriendlyString() // "Today, Apr 1"
46
+ */
47
+ toFriendlyString(language) {
48
+ let dayOfWeekLabel = this.getDayOfWeek(language);
49
+ const monthLabel = this.getNameOfMonth(language);
50
+ if (this.isToday()) {
51
+ dayOfWeekLabel = new today_to_language_mapper_1.TodayToLanguageMapper().toMap(language);
52
+ }
53
+ const dayOfMonth = this.getDayOfMonth();
54
+ return `${dayOfWeekLabel}, ${monthLabel} ${dayOfMonth}`;
55
+ }
56
+ // ==================== Comparações ====================
57
+ /**
58
+ * Checks whether this date is later than another date.
59
+ * @param datetime - Date to compare against.
60
+ * @returns `true` if this date is greater than `datetime`; otherwise, `false`.
61
+ * @example
62
+ * new DatetimeEdge(new Date("2026-12-01")).isAfter(new DatetimeEdge(new Date("2026-01-01"))) // true
63
+ */
64
+ isAfter(datetime) {
65
+ return this.date.isAfter(datetime.toDate());
66
+ }
67
+ /**
68
+ * Checks whether this date is earlier than another date.
69
+ * @param datetime - Date to compare against.
70
+ * @returns `true` if this date is less than `datetime`; otherwise, `false`.
71
+ * @example
72
+ * new DatetimeEdge(new Date("2026-01-01")).isBefore(new DatetimeEdge(new Date("2026-12-01"))) // true
73
+ */
74
+ isBefore(datetime) {
75
+ return this.date.isBefore(datetime.toDate());
76
+ }
77
+ /**
78
+ * Checks whether this date is equal to another date.
79
+ * @param datetime - Date to compare against.
80
+ * @returns `true` if the dates are equal; otherwise, `false`.
81
+ * @example
82
+ * new DatetimeEdge(new Date("2026-01-01")).isEquals(new DatetimeEdge(new Date("2026-01-01"))) // true
83
+ */
84
+ isEquals(datetime) {
85
+ return this.date.isSame(datetime.toDate());
86
+ }
87
+ /**
88
+ * Verifica se esta data está entre duas outras datas (exclusivo).
89
+ * @param initialDate - Data inicial do intervalo
90
+ * @param finalDate - Data final do intervalo
91
+ * @returns true se this está entre initialDate e finalDate, false caso contrário
92
+ * @example
93
+ * new DatetimeEdge(new Date("2026-06-15")).isBetween(
94
+ * new DatetimeEdge(new Date("2026-01-01")),
95
+ * new DatetimeEdge(new Date("2026-12-31"))
96
+ * ) // true
97
+ */
98
+ isBetween(initialDate, finalDate) {
99
+ return this.date.isBetween(initialDate.toDate(), finalDate.toDate());
100
+ }
101
+ // ==================== Verificações de Dia ====================
102
+ /**
103
+ * Checks whether this date falls on a weekend (Saturday or Sunday).
104
+ * @returns `true` if the date is a Saturday or Sunday; otherwise, `false`.
105
+ * @example
106
+ * new DatetimeEdge(new Date("2026-03-14")).isWeekend() // true (Saturday)
107
+ * new DatetimeEdge(new Date("2026-03-12")).isWeekend() // false (Thursday)
108
+ */
109
+ isWeekend() {
110
+ return [week_day_enum_1.WeekDayEnum.saturday, week_day_enum_1.WeekDayEnum.sunday].includes(this.getStandardDayOfWeek());
111
+ }
112
+ /**
113
+ * Checks whether this date is a holiday in the specified country.
114
+ * @param country - The country whose holiday calendar will be used for validation.
115
+ * @returns `true` if the date is a holiday in the specified country; otherwise, `false`.
116
+ * @example
117
+ * new DatetimeEdge(new Date("2026-12-25")).isHoliday("BR") // true (Christmas Day)
118
+ * new DatetimeEdge(new Date("2026-03-12")).isHoliday("BR") // false
119
+ */
120
+ isHoliday(country) {
121
+ const holidays = new date_holidays_1.default(country);
122
+ return holidays.isHoliday(this.date.toDate()) !== false;
123
+ }
124
+ /**
125
+ * Checks whether the date is a business day (not a weekend or a holiday).
126
+ * @param country - The country whose holiday calendar will be used for validation.
127
+ * @returns `true` if the date is a business day; otherwise, `false`.
128
+ * @example
129
+ * new DatetimeEdge(new Date("2026-03-12")).isBusinessDay("BR") // true (Thursday)
130
+ * new DatetimeEdge(new Date("2026-12-25")).isBusinessDay("BR") // false (Christmas Day)
131
+ */
132
+ isBusinessDay(country) {
133
+ return !this.isWeekend() && !this.isHoliday(country);
134
+ }
135
+ /**
136
+ * Checks whether the date corresponds to today.
137
+ * @returns `true` if the date is today; otherwise, `false`.
138
+ * @example
139
+ * new DatetimeEdge(new Date()).isToday() // true
140
+ * new DatetimeEdge(new Date("2020-01-01")).isToday() // false
141
+ */
142
+ isToday() {
143
+ return this.date.isSame((0, moment_1.default)(), "day");
144
+ }
145
+ /**
146
+ * Checks whether the date corresponds to yesterday.
147
+ * @returns `true` if the date is yesterday; otherwise, `false`.
148
+ * @example
149
+ * new DatetimeEdge(new Date()).isYesterday() // false
150
+ */
151
+ isYesterday() {
152
+ return this.date.isSame((0, moment_1.default)().subtract(1, "day"), "day");
153
+ }
154
+ /**
155
+ * Checks whether the date corresponds to tomorrow.
156
+ * @returns `true` if the date is tomorrow; otherwise, `false`.
157
+ * @example
158
+ * new DatetimeEdge(new Date()).isTomorrow() // false
159
+ */
160
+ isTomorrow() {
161
+ return this.date.isSame((0, moment_1.default)().add(1, "day"), "day");
162
+ }
163
+ /**
164
+ * Checks whether the date is on the same day as another date.
165
+ * @param datetime - Date for comparison
166
+ * @returns `true` if both dates are on the same day, `false` otherwise
167
+ * @example
168
+ * const a = new DatetimeEdge(new Date("2026-03-12T08:00"));
169
+ * const b = new DatetimeEdge(new Date("2026-03-12T22:00"));
170
+ * a.isSameDay(b) // true
171
+ */
172
+ isSameDay(datetime) {
173
+ return this.date.isSame(datetime.toDate(), "day");
174
+ }
175
+ /**
176
+ * Checks whether the date is on the same month as another date.
177
+ * @param datetime - Date for comparison
178
+ * @returns `true` if both dates are on the same month and year, `false` otherwise
179
+ * @example
180
+ * const a = new DatetimeEdge(new Date("2026-03-01"));
181
+ * const b = new DatetimeEdge(new Date("2026-03-31"));
182
+ * a.isSameMonth(b) // true
183
+ */
184
+ isSameMonth(datetime) {
185
+ return this.date.isSame(datetime.toDate(), "month");
186
+ }
187
+ /**
188
+ * Checks whether the date is on the same year as another date.
189
+ * @param datetime - Date for comparison
190
+ * @returns `true` if both dates are on the same year, `false` otherwise
191
+ * @example
192
+ * const a = new DatetimeEdge(new Date("2026-01-01"));
193
+ * const b = new DatetimeEdge(new Date("2026-12-31"));
194
+ * a.isSameYear(b) // true
195
+ */
196
+ isSameYear(datetime) {
197
+ return this.date.isSame(datetime.toDate(), "year");
198
+ }
199
+ // ==================== Getters ====================
200
+ /**
201
+ * Returns the day of the week for the date.
202
+ * @returns Enum WeekDayEnum representing the day of the week
203
+ * @example
204
+ * new DatetimeEdge(new Date("2026-03-12")).getDayOfWeek() // WeekDayEnum.thursday
205
+ */
206
+ getDayOfWeek(language) {
207
+ let dayOfWeek = new day_name_to_english_mapper_1.DayNameToEnglishMapper().toMap(this.date.day());
208
+ if (guardian_1._.isEqual(language, language_point_1.LanguagePoint.portuguese)) {
209
+ dayOfWeek = new day_name_to_portuguese_mapper_1.DayNameToPortugueseMapper().toMap(this.date.day());
210
+ }
211
+ return dayOfWeek;
212
+ }
213
+ /**
214
+ * Returns the standard day of the week as a {@link WeekDayEnum} value.
215
+ * This internal method provides the canonical weekday representation
216
+ * used throughout the class before any localization or formatting is applied.
217
+ *
218
+ * @returns The corresponding {@link WeekDayEnum} for the current date.
219
+ * @example
220
+ * new DatetimeEdge(new Date("2026-03-12")).getStandardDayOfWeek() // WeekDayEnum.thursday
221
+ */
222
+ getStandardDayOfWeek() {
223
+ const daysOfWeek = [
224
+ week_day_enum_1.WeekDayEnum.sunday,
225
+ week_day_enum_1.WeekDayEnum.monday,
226
+ week_day_enum_1.WeekDayEnum.tuesday,
227
+ week_day_enum_1.WeekDayEnum.wednesday,
228
+ week_day_enum_1.WeekDayEnum.thursday,
229
+ week_day_enum_1.WeekDayEnum.friday,
230
+ week_day_enum_1.WeekDayEnum.saturday,
231
+ ];
232
+ return daysOfWeek[this.date.day()];
233
+ }
234
+ /**
235
+ * Returns the name of the month for the date.
236
+ * @returns Enum MonthNameEnum representing the month
237
+ * @example
238
+ * new DatetimeEdge(new Date("2026-03-12")).getNameOfMonth() // MonthNameEnum.march
239
+ */
240
+ getNameOfMonth(language) {
241
+ let month = new month_to_english_mapper_1.MonthNameToEnglishMapper().toMap(this.date.month());
242
+ if (guardian_1._.isEqual(language, language_point_1.LanguagePoint.portuguese)) {
243
+ month = new month_to_portuguese_mapper_1.MonthNameToPortugueseMapper().toMap(this.date.month());
244
+ }
245
+ return month;
246
+ }
247
+ /**
248
+ * Returns the day of the month for the date.
249
+ * @returns NNumber of the day (1-31)
250
+ * @example
251
+ * new DatetimeEdge(new Date("2026-03-12")).getDayOfMonth() // 12
252
+ */
253
+ getDayOfMonth() {
254
+ return this.date.date();
255
+ }
256
+ /**
257
+ * Returns the month number for the date (0-11).
258
+ * @returns Month number (0=January, 11=December)
259
+ * @example
260
+ * new DatetimeEdge(new Date("2026-03-12")).getNumberOfMonth() // 2
261
+ */
262
+ getNumberOfMonth() {
263
+ return this.date.month();
264
+ }
265
+ /**
266
+ * Returns the year of the date.
267
+ * @returns The year number.
268
+ * @example
269
+ * new DatetimeEdge(new Date("2026-03-12")).getYear() // 2026
270
+ */
271
+ getYear() {
272
+ return this.date.year();
273
+ }
274
+ /**
275
+ * Returns the hours of the date.
276
+ * @returns The hour number (0-23)
277
+ * @example
278
+ * new DatetimeEdge(new Date("2026-03-12T14:30:00")).getHours() // 14
279
+ */
280
+ getHours() {
281
+ return this.date.hours();
282
+ }
283
+ /**
284
+ * Returns the minutes of the date.
285
+ * @returns The minute number (0-59)
286
+ * @example
287
+ * new DatetimeEdge(new Date("2026-03-12T14:30:00")).getMinutes() // 30
288
+ */
289
+ getMinutes() {
290
+ return this.date.minutes();
291
+ }
292
+ /**
293
+ * Returns the seconds of the date.
294
+ * @returns The second number (0-59)
295
+ * @example
296
+ * new DatetimeEdge(new Date("2026-03-12T14:30:45")).getSeconds() // 45
297
+ */
298
+ getSeconds() {
299
+ return this.date.seconds();
300
+ }
301
+ // ==================== Operações Aritméticas ====================
302
+ /**
303
+ * Adds days to the date and returns a new instance.
304
+ * @param days - NNumber of days to add
305
+ * @returns New instance with the updated date
306
+ * @example
307
+ * new DatetimeEdge(new Date("2026-03-12")).addDays(5) // DatetimeEdge("2026-03-17")
308
+ */
309
+ addDays(days) {
310
+ return new DatetimeEdge(this.date.clone().add(days, "days").toDate());
311
+ }
312
+ /**
313
+ * Subtracts days from the date and returns a new instance.
314
+ * @param days - NNumber of days to subtract
315
+ * @returns New instance with the updated date
316
+ * @example
317
+ * new DatetimeEdge(new Date("2026-03-12")).subtractDays(5) // DatetimeEdge("2026-03-07")
318
+ */
319
+ subtractDays(days) {
320
+ return new DatetimeEdge(this.date.clone().subtract(days, "days").toDate());
321
+ }
322
+ /**
323
+ * Adds months to the date and returns a new instance.
324
+ * @param months - NNumber of months to add
325
+ * @returns New instance with the updated date
326
+ * @example
327
+ * new DatetimeEdge(new Date("2026-03-12")).addMonths(2) // DatetimeEdge("2026-05-12")
328
+ */
329
+ addMonths(months) {
330
+ return new DatetimeEdge(this.date.clone().add(months, "months").toDate());
331
+ }
332
+ /**
333
+ * Subtracts months from the date and returns a new instance.
334
+ * @param months - NNumber of months to subtract
335
+ * @returns New instance with the updated date
336
+ * @example
337
+ * new DatetimeEdge(new Date("2026-03-12")).subtractMonths(2) // DatetimeEdge("2026-01-12")
338
+ */
339
+ subtractMonths(months) {
340
+ return new DatetimeEdge(this.date.clone().subtract(months, "months").toDate());
341
+ }
342
+ /**
343
+ * Adds years to the date and returns a new instance.
344
+ * @param years - NNumber of years to add
345
+ * @returns New instance with the updated date
346
+ * @example
347
+ * new DatetimeEdge(new Date("2026-03-12")).addYears(1) // DatetimeEdge("2027-03-12")
348
+ */
349
+ addYears(years) {
350
+ return new DatetimeEdge(this.date.clone().add(years, "years").toDate());
351
+ }
352
+ /**
353
+ * Subtracts years from the date and returns a new instance.
354
+ * @param years - NNumber of years to subtract
355
+ * @returns New instance with the updated date
356
+ * @example
357
+ * new DatetimeEdge(new Date("2026-03-12")).subtractYears(1) // DatetimeEdge("2025-03-12")
358
+ */
359
+ subtractYears(years) {
360
+ return new DatetimeEdge(this.date.clone().subtract(years, "years").toDate());
361
+ }
362
+ /**
363
+ * Adds hours to the date and returns a new instance.
364
+ * @param hours - NNumber of hours to add
365
+ * @returns New instance with the updated date
366
+ * @example
367
+ * new DatetimeEdge(new Date("2026-03-12T08:00")).addHours(3) // DatetimeEdge("2026-03-12T11:00")
368
+ */
369
+ addHours(hours) {
370
+ return new DatetimeEdge(this.date.clone().add(hours, "hours").toDate());
371
+ }
372
+ /**
373
+ * Adds minutes to the date and returns a new instance.
374
+ * @param minutes - NNumber of minutes to add
375
+ * @returns New instance with the updated date
376
+ * @example
377
+ * new DatetimeEdge(new Date("2026-03-12T08:00")).addMinutes(30) // DatetimeEdge("2026-03-12T08:30")
378
+ */
379
+ addMinutes(minutes) {
380
+ return new DatetimeEdge(this.date.clone().add(minutes, "minutes").toDate());
381
+ }
382
+ /**
383
+ * Calculates the difference in days between this date and another.
384
+ * @param datetime - Date to calculate the difference from
385
+ * @returns NNumber of days difference (positive if this > datetime)
386
+ * @example
387
+ * new DatetimeEdge(new Date("2026-03-15")).diffInDays(new DatetimeEdge(new Date("2026-03-10"))) // 5
388
+ */
389
+ diffInDays(datetime) {
390
+ return this.date.diff(datetime.toDate(), "days");
391
+ }
392
+ /**
393
+ * Calculates the difference in months between this date and another.
394
+ * @param datetime - Date to calculate the difference from
395
+ * @returns NNumber of months difference (positive if this > datetime)
396
+ * @example
397
+ * new DatetimeEdge(new Date("2026-05-12")).diffInMonths(new DatetimeEdge(new Date("2026-03-12"))) // 2
398
+ */
399
+ diffInMonths(datetime) {
400
+ return this.date.diff(datetime.toDate(), "months");
401
+ }
402
+ /**
403
+ * Calculates the difference in years between this date and another date.
404
+ * @param datetime - Date to calculate the difference against.
405
+ * @returns The number of years between the dates (positive if this date is later than `datetime`).
406
+ * @example
407
+ * new DatetimeEdge(new Date("2028-03-12")).diffInYears(new DatetimeEdge(new Date("2026-03-12"))) // 2
408
+ */
409
+ diffInYears(datetime) {
410
+ return this.date.diff(datetime.toDate(), "years");
411
+ }
412
+ /**
413
+ * Calcula a diferença em horas entre esta data e outra.
414
+ * @param datetime - Data para calcular a diferença
415
+ * @returns Número de horas de diferença (positivo se this > datetime)
416
+ * @example
417
+ * new DatetimeEdge(new Date("2026-03-12T14:00")).diffInHours(new DatetimeEdge(new Date("2026-03-12T08:00"))) // 6
418
+ */
419
+ diffInHours(datetime) {
420
+ return this.date.diff(datetime.toDate(), "hours");
421
+ }
422
+ /**
423
+ * Calculates the difference in minutes between this date and another date.
424
+ * @param datetime - Date to calculate the difference against.
425
+ * @returns The number of minutes between the dates (positive if this date is later than `datetime`).
426
+ * @example
427
+ * new DatetimeEdge(new Date("2026-03-12T08:45")).diffInMinutes(new DatetimeEdge(new Date("2026-03-12T08:00"))) // 45
428
+ */
429
+ diffInMinutes(datetime) {
430
+ return this.date.diff(datetime.toDate(), "minutes");
431
+ }
432
+ /**
433
+ * Returns a human-readable difference between this date and the current moment.
434
+ * @returns A descriptive string such as "3 days ago.", "2 hours ago.", etc.
435
+ * @example
436
+ * new DatetimeEdge(new Date("2025-03-12")).diffFromNow() // "1 year ago."
437
+ */
438
+ diffFromNow() {
439
+ const now = (0, moment_1.default)();
440
+ const diffInSeconds = now.diff(this.date, "seconds");
441
+ const diffInMinutes = now.diff(this.date, "minutes");
442
+ const diffInHours = now.diff(this.date, "hours");
443
+ const diffInDays = now.diff(this.date, "days");
444
+ const diffInMonths = now.diff(this.date, "months");
445
+ const diffInYears = now.diff(this.date, "years");
446
+ if (diffInSeconds < 60) {
447
+ return `Há ${diffInSeconds} segundo${diffInSeconds === 1 ? "" : "s"}.`;
448
+ }
449
+ if (diffInMinutes < 60) {
450
+ return `Há ${diffInMinutes} minuto${diffInMinutes === 1 ? "" : "s"}.`;
451
+ }
452
+ if (diffInHours < 24) {
453
+ return `Há ${diffInHours} hora${diffInHours === 1 ? "" : "s"}.`;
454
+ }
455
+ if (diffInDays < 30) {
456
+ return `Há ${diffInDays} dia${diffInDays === 1 ? "" : "s"}.`;
457
+ }
458
+ if (diffInMonths < 12) {
459
+ return `Há ${diffInMonths} mês${diffInMonths === 1 ? "" : "es"}.`;
460
+ }
461
+ return `Há ${diffInYears} ano${diffInYears === 1 ? "" : "s"}.`;
462
+ }
463
+ // ==================== Início e Fim de Período ====================
464
+ /**
465
+ * Returns the start of the day (00:00:00.000) as a new instance.
466
+ * @returns A new instance with the time set to the beginning of the day
467
+ * @example
468
+ * new DatetimeEdge(new Date("2026-03-12T14:30")).startOfDay()
469
+ * // DatetimeEdge("2026-03-12T00:00:00.000")
470
+ */
471
+ startOfDay() {
472
+ return new DatetimeEdge(this.date.clone().startOf("day").toDate());
473
+ }
474
+ /**
475
+ * Returns the end of the day (23:59:59.999) as a new instance.
476
+ * @returns A new instance with the time set to the end of the day
477
+ * @example
478
+ * new DatetimeEdge(new Date("2026-03-12T08:00")).endOfDay()
479
+ * // DatetimeEdge("2026-03-12T23:59:59.999")
480
+ */
481
+ endOfDay() {
482
+ return new DatetimeEdge(this.date.clone().endOf("day").toDate());
483
+ }
484
+ /**
485
+ * Returns the start of the month as a new instance.
486
+ * @returns A new instance pointing to the first day of the month at midnight
487
+ * @example
488
+ * new DatetimeEdge(new Date("2026-03-12")).startOfMonth()
489
+ * // DatetimeEdge("2026-03-01T00:00:00.000")
490
+ */
491
+ startOfMonth() {
492
+ return new DatetimeEdge(this.date.clone().startOf("month").toDate());
493
+ }
494
+ /**
495
+ * Returns the end of the month as a new instance.
496
+ * @returns A new instance pointing to the last day of the month at the end of the day
497
+ * @example
498
+ * new DatetimeEdge(new Date("2026-03-12")).endOfMonth()
499
+ * // DatetimeEdge("2026-03-31T23:59:59.999")
500
+ */
501
+ endOfMonth() {
502
+ return new DatetimeEdge(this.date.clone().endOf("month").toDate());
503
+ }
504
+ /**
505
+ * Returns the start of the year as a new instance.
506
+ * @returns A new instance pointing to the first day of the year at midnight
507
+ * @example
508
+ * new DatetimeEdge(new Date("2026-03-12")).startOfYear()
509
+ * // DatetimeEdge("2026-01-01T00:00:00.000")
510
+ */
511
+ startOfYear() {
512
+ return new DatetimeEdge(this.date.clone().startOf("year").toDate());
513
+ }
514
+ /**
515
+ * Returns the end of the year as a new instance.
516
+ * @returns A new instance pointing to the last day of the year at the end of the day
517
+ * @example
518
+ * new DatetimeEdge(new Date("2026-03-12")).endOfYear()
519
+ * // DatetimeEdge("2026-12-31T23:59:59.999")
520
+ */
521
+ endOfYear() {
522
+ return new DatetimeEdge(this.date.clone().endOf("year").toDate());
523
+ }
524
+ // ==================== Clonagem e Imutabilidade ====================
525
+ /**
526
+ * Creates an independent copy of this DatetimeEdge instance.
527
+ * @returns A new instance with the same date value
528
+ * @example
529
+ * const dt1 = new DatetimeEdge(new Date("2026-03-12"));
530
+ * const dt2 = dt1.clone(); // independent instance
531
+ */
532
+ clone() {
533
+ return new DatetimeEdge(this.date.toDate());
534
+ }
535
+ /**
536
+ * Returns a new instance with the date changed, keeping the time.
537
+ * @param date - New Date object
538
+ * @returns New instance with the provided value
539
+ * @example
540
+ * new DatetimeEdge(new Date("2026-03-12")).withDate(new Date("2026-12-25"))
541
+ * // DatetimeEdge("2026-12-25")
542
+ */
543
+ withDate(date) {
544
+ return new DatetimeEdge(date);
545
+ }
546
+ // ==================== Formatação ====================
547
+ /**
548
+ * Returns the date in ISO 8601 format.
549
+ * @returns String in the format "YYYY-MM-DDTHH:mm:ss.sssZ"
550
+ * @example
551
+ * new DatetimeEdge(new Date("2026-03-12")).toISOString() // "2026-03-12T00:00:00.000Z"
552
+ */
553
+ toISOString() {
554
+ return this.date.toISOString();
555
+ }
556
+ /**
557
+ * Returns the date as a native Date object.
558
+ * @returns Date object representing this date
559
+ * @example
560
+ * new DatetimeEdge(new Date("2026-03-12")).toDate() // Date object
561
+ */
562
+ toDate() {
563
+ return this.date.toDate();
564
+ }
565
+ /**
566
+ * Returns the date in YYYY-MM-DD format.
567
+ * @returns String in the format "YYYY-MM-DD"
568
+ * @example
569
+ * new DatetimeEdge(new Date("2026-03-12")).toYYYYMMDD() // "2026-03-12"
570
+ */
571
+ toYYYYMMDD() {
572
+ return this.date.format("YYYY-MM-DD");
573
+ }
574
+ /**
575
+ * Returns the date in DD/MM/YYYY format (Brazilian standard).
576
+ * @returns String no formato "DD/MM/YYYY"
577
+ * @example
578
+ * new DatetimeEdge(new Date("2026-03-12")).toDDMMYYYY() // "12/03/2026"
579
+ */
580
+ toDDMMYYYY() {
581
+ return this.date.format("DD/MM/YYYY");
582
+ }
583
+ /**
584
+ * Returns the date and time in the format DD/MM/YYYY HH:mm.
585
+ * @returns A string in the format "DD/MM/YYYY HH:mm".
586
+ * @example
587
+ * new DatetimeEdge(new Date("2026-03-12T14:30")).toDDMMYYYYHHmm() // "12/03/2026 14:30"
588
+ */
589
+ toDDMMYYYYHHmm() {
590
+ return this.date.format("DD/MM/YYYY HH:mm");
591
+ }
592
+ /**
593
+ * Returns the date formatted with a custom pattern from moment.js.
594
+ * @param format - Formatting pattern (e.g., "YYYY-MM-DD HH:mm:ss")
595
+ * @returns Formatted string according to the provided pattern
596
+ * @example
597
+ * new DatetimeEdge(new Date("2026-03-12T14:30")).format("MMMM Do YYYY") // "March 12th 2026"
598
+ */
599
+ format(format) {
600
+ return this.date.format(format);
601
+ }
602
+ /**
603
+ * Returns the timestamp in milliseconds of the date.
604
+ * @returns NNumber of milliseconds since 01/01/1970 UTC
605
+ * @example
606
+ * new DatetimeEdge(new Date("2026-03-12")).timestamp() // 1773273600000
607
+ */
608
+ timestamp() {
609
+ return this.date.valueOf();
610
+ }
611
+ /**
612
+ * Returns the Unix timestamp in seconds of the date.
613
+ * @returns NNumber of seconds since 01/01/1970 UTC
614
+ * @example
615
+ * new DatetimeEdge(new Date("2026-03-12")).unix() // 1773273600
616
+ */
617
+ unix() {
618
+ return this.date.unix();
619
+ }
620
+ // ==================== Métodos Estáticos ====================
621
+ /**
622
+ * Creates a new DatetimeEdge representing the current moment.
623
+ * @returns New instance with the current date and time
624
+ * @example
625
+ * DatetimeEdge.now() // DatetimeEdge with the current date and time
626
+ */
627
+ static now() {
628
+ return new DatetimeEdge(new Date());
629
+ }
630
+ /**
631
+ * Returns the latest (most recent) date from an array.
632
+ * @param dates - Array of DatetimeEdge instances to compare
633
+ * @returns The instance with the latest date
634
+ * @throws {Error} If the array is empty
635
+ * @example
636
+ * DatetimeEdge.max([
637
+ * new DatetimeEdge(new Date("2026-01-01")),
638
+ * new DatetimeEdge(new Date("2026-06-15")),
639
+ * ]) // DatetimeEdge("2026-06-15")
640
+ */
641
+ static max(dates) {
642
+ if (dates.length === 0) {
643
+ throw new Error("Cannot find max of an empty array of dates.");
644
+ }
645
+ return dates.reduce((max, date) => (date.isAfter(max) ? date : max));
646
+ }
647
+ /**
648
+ * Returns the earliest (oldest) date from an array.
649
+ * @param dates - Array of DatetimeEdge instances to compare
650
+ * @returns The instance with the earliest date
651
+ * @throws {Error} If the array is empty
652
+ * @example
653
+ * DatetimeEdge.min([
654
+ * new DatetimeEdge(new Date("2026-01-01")),
655
+ * new DatetimeEdge(new Date("2026-06-15")),
656
+ * ]) // DatetimeEdge("2026-01-01")
657
+ */
658
+ static min(dates) {
659
+ if (dates.length === 0) {
660
+ throw new Error("Cannot find min of an empty array of dates.");
661
+ }
662
+ return dates.reduce((min, date) => (date.isBefore(min) ? date : min));
663
+ }
664
+ // ==================== Privados ====================
665
+ /**
666
+ * Validates whether the date provided to the constructor is a valid date.
667
+ * @throws {Error} If the date is invalid.
668
+ */
669
+ validate() {
670
+ if (!(0, moment_1.default)(this.date).isValid()) {
671
+ throw new Error(`${this.constructor.name} should be valid.`);
672
+ }
673
+ }
674
+ }
675
+ exports.DatetimeEdge = DatetimeEdge;
@@ -1,5 +1,4 @@
1
- import { MapAbstract } from "#/@tool-box/utils/map/map.abstract";
1
+ import { MapAbstract } from "../../../../../@tool-box/utils/map/map.abstract";
2
2
  export declare class DayNameToEnglishMapper extends MapAbstract<number, string> {
3
3
  protected map: Map<number, string>;
4
4
  }
5
- //# sourceMappingURL=day-name-to-english.mapper.d.ts.map