arcli 0.1.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +164 -4
  3. package/dist/cli/commands/billing-family.command.d.ts +2 -0
  4. package/dist/cli/commands/billing-family.command.js +30 -0
  5. package/dist/cli/commands/billing-family.command.js.map +1 -0
  6. package/dist/cli/commands/billing-shortcuts.command.d.ts +2 -0
  7. package/dist/cli/commands/billing-shortcuts.command.js +18 -0
  8. package/dist/cli/commands/billing-shortcuts.command.js.map +1 -0
  9. package/dist/cli/commands/billing.command.interactive-preview.d.ts +17 -0
  10. package/dist/cli/commands/billing.command.interactive-preview.js +65 -0
  11. package/dist/cli/commands/billing.command.interactive-preview.js.map +1 -0
  12. package/dist/cli/commands/billing.command.options.d.ts +2 -0
  13. package/dist/cli/commands/billing.command.options.js +49 -0
  14. package/dist/cli/commands/billing.command.options.js.map +1 -0
  15. package/dist/cli/commands/billing.command.output.d.ts +12 -0
  16. package/dist/cli/commands/billing.command.output.js +33 -0
  17. package/dist/cli/commands/billing.command.output.js.map +1 -0
  18. package/dist/cli/commands/billing.command.parser.d.ts +18 -0
  19. package/dist/cli/commands/billing.command.parser.js +136 -0
  20. package/dist/cli/commands/billing.command.parser.js.map +1 -0
  21. package/dist/cli/commands/billing.command.shared.d.ts +7 -0
  22. package/dist/cli/commands/billing.command.shared.js +78 -0
  23. package/dist/cli/commands/billing.command.shared.js.map +1 -0
  24. package/dist/cli/commands/billing.command.shortcuts.d.ts +7 -0
  25. package/dist/cli/commands/billing.command.shortcuts.js +52 -0
  26. package/dist/cli/commands/billing.command.shortcuts.js.map +1 -0
  27. package/dist/cli/commands/config.command.d.ts +2 -0
  28. package/dist/cli/commands/config.command.js +125 -0
  29. package/dist/cli/commands/config.command.js.map +1 -0
  30. package/dist/cli/commands/examples.command.d.ts +2 -0
  31. package/dist/cli/commands/examples.command.js +14 -0
  32. package/dist/cli/commands/examples.command.js.map +1 -0
  33. package/dist/cli/commands/storybook.command.d.ts +2 -0
  34. package/dist/cli/commands/storybook.command.js +26 -0
  35. package/dist/cli/commands/storybook.command.js.map +1 -0
  36. package/dist/cli/help.d.ts +10 -0
  37. package/dist/cli/help.js +473 -0
  38. package/dist/cli/help.js.map +1 -0
  39. package/dist/cli/index.d.ts +2 -0
  40. package/dist/cli/index.js +41 -0
  41. package/dist/cli/index.js.map +1 -0
  42. package/dist/cli/program.d.ts +2 -0
  43. package/dist/cli/program.js +28 -0
  44. package/dist/cli/program.js.map +1 -0
  45. package/dist/cli/types.d.ts +6 -0
  46. package/dist/cli/types.js +2 -0
  47. package/dist/cli/types.js.map +1 -0
  48. package/dist/cli/version.d.ts +1 -0
  49. package/dist/cli/version.js +2 -0
  50. package/dist/cli/version.js.map +1 -0
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.js +2 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/lib/dates/arca-date.d.ts +2 -0
  55. package/dist/lib/dates/arca-date.js +28 -0
  56. package/dist/lib/dates/arca-date.js.map +1 -0
  57. package/dist/lib/errors/app-error.d.ts +14 -0
  58. package/dist/lib/errors/app-error.js +29 -0
  59. package/dist/lib/errors/app-error.js.map +1 -0
  60. package/dist/lib/files/read-json-file.d.ts +1 -0
  61. package/dist/lib/files/read-json-file.js +21 -0
  62. package/dist/lib/files/read-json-file.js.map +1 -0
  63. package/dist/lib/paths/mask-path.d.ts +1 -0
  64. package/dist/lib/paths/mask-path.js +17 -0
  65. package/dist/lib/paths/mask-path.js.map +1 -0
  66. package/dist/lib/security/certificate.d.ts +7 -0
  67. package/dist/lib/security/certificate.js +16 -0
  68. package/dist/lib/security/certificate.js.map +1 -0
  69. package/dist/lib/security/pem.d.ts +5 -0
  70. package/dist/lib/security/pem.js +36 -0
  71. package/dist/lib/security/pem.js.map +1 -0
  72. package/dist/modules/billing/billing-response.d.ts +4 -0
  73. package/dist/modules/billing/billing-response.js +74 -0
  74. package/dist/modules/billing/billing-response.js.map +1 -0
  75. package/dist/modules/billing/billing.amounts.d.ts +9 -0
  76. package/dist/modules/billing/billing.amounts.js +30 -0
  77. package/dist/modules/billing/billing.amounts.js.map +1 -0
  78. package/dist/modules/billing/billing.associated-vouchers.d.ts +10 -0
  79. package/dist/modules/billing/billing.associated-vouchers.js +51 -0
  80. package/dist/modules/billing/billing.associated-vouchers.js.map +1 -0
  81. package/dist/modules/billing/billing.constants.d.ts +2 -0
  82. package/dist/modules/billing/billing.constants.js +3 -0
  83. package/dist/modules/billing/billing.constants.js.map +1 -0
  84. package/dist/modules/billing/billing.date-range.d.ts +8 -0
  85. package/dist/modules/billing/billing.date-range.js +45 -0
  86. package/dist/modules/billing/billing.date-range.js.map +1 -0
  87. package/dist/modules/billing/billing.display.d.ts +13 -0
  88. package/dist/modules/billing/billing.display.js +111 -0
  89. package/dist/modules/billing/billing.display.js.map +1 -0
  90. package/dist/modules/billing/billing.json-format.d.ts +6 -0
  91. package/dist/modules/billing/billing.json-format.js +5 -0
  92. package/dist/modules/billing/billing.json-format.js.map +1 -0
  93. package/dist/modules/billing/billing.labels.d.ts +9 -0
  94. package/dist/modules/billing/billing.labels.js +108 -0
  95. package/dist/modules/billing/billing.labels.js.map +1 -0
  96. package/dist/modules/billing/billing.mappers.d.ts +8 -0
  97. package/dist/modules/billing/billing.mappers.js +59 -0
  98. package/dist/modules/billing/billing.mappers.js.map +1 -0
  99. package/dist/modules/billing/billing.presenter.d.ts +7 -0
  100. package/dist/modules/billing/billing.presenter.js +3 -0
  101. package/dist/modules/billing/billing.presenter.js.map +1 -0
  102. package/dist/modules/billing/billing.schemas.d.ts +74 -0
  103. package/dist/modules/billing/billing.schemas.js +69 -0
  104. package/dist/modules/billing/billing.schemas.js.map +1 -0
  105. package/dist/modules/billing/billing.serialize.d.ts +8 -0
  106. package/dist/modules/billing/billing.serialize.js +51 -0
  107. package/dist/modules/billing/billing.serialize.js.map +1 -0
  108. package/dist/modules/billing/billing.service.d.ts +15 -0
  109. package/dist/modules/billing/billing.service.js +88 -0
  110. package/dist/modules/billing/billing.service.js.map +1 -0
  111. package/dist/modules/billing/billing.text.d.ts +8 -0
  112. package/dist/modules/billing/billing.text.js +44 -0
  113. package/dist/modules/billing/billing.text.js.map +1 -0
  114. package/dist/modules/billing/billing.types.d.ts +13 -0
  115. package/dist/modules/billing/billing.types.internal.d.ts +25 -0
  116. package/dist/modules/billing/billing.types.internal.js +2 -0
  117. package/dist/modules/billing/billing.types.internal.js.map +1 -0
  118. package/dist/modules/billing/billing.types.js +2 -0
  119. package/dist/modules/billing/billing.types.js.map +1 -0
  120. package/dist/modules/billing/billing.validation.d.ts +5 -0
  121. package/dist/modules/billing/billing.validation.js +45 -0
  122. package/dist/modules/billing/billing.validation.js.map +1 -0
  123. package/dist/modules/billing/voucher-kind-map.d.ts +9 -0
  124. package/dist/modules/billing/voucher-kind-map.js +180 -0
  125. package/dist/modules/billing/voucher-kind-map.js.map +1 -0
  126. package/dist/modules/config/config-doctor.d.ts +15 -0
  127. package/dist/modules/config/config-doctor.js +125 -0
  128. package/dist/modules/config/config-doctor.js.map +1 -0
  129. package/dist/modules/config/config-value-parser.d.ts +2 -0
  130. package/dist/modules/config/config-value-parser.js +71 -0
  131. package/dist/modules/config/config-value-parser.js.map +1 -0
  132. package/dist/modules/config/config.presenter.d.ts +7 -0
  133. package/dist/modules/config/config.presenter.js +80 -0
  134. package/dist/modules/config/config.presenter.js.map +1 -0
  135. package/dist/modules/config/config.schemas.d.ts +87 -0
  136. package/dist/modules/config/config.schemas.js +84 -0
  137. package/dist/modules/config/config.schemas.js.map +1 -0
  138. package/dist/modules/config/config.service.d.ts +20 -0
  139. package/dist/modules/config/config.service.js +78 -0
  140. package/dist/modules/config/config.service.js.map +1 -0
  141. package/dist/modules/examples/examples.d.ts +1 -0
  142. package/dist/modules/examples/examples.js +156 -0
  143. package/dist/modules/examples/examples.js.map +1 -0
  144. package/dist/modules/storybook/showcase-theme.d.ts +7 -0
  145. package/dist/modules/storybook/showcase-theme.js +6 -0
  146. package/dist/modules/storybook/showcase-theme.js.map +1 -0
  147. package/dist/modules/storybook/showcase.d.ts +2 -0
  148. package/dist/modules/storybook/showcase.js +310 -0
  149. package/dist/modules/storybook/showcase.js.map +1 -0
  150. package/dist/modules/update-check/update-check.presenter.d.ts +2 -0
  151. package/dist/modules/update-check/update-check.presenter.js +6 -0
  152. package/dist/modules/update-check/update-check.presenter.js.map +1 -0
  153. package/dist/modules/update-check/update-check.service.d.ts +8 -0
  154. package/dist/modules/update-check/update-check.service.js +72 -0
  155. package/dist/modules/update-check/update-check.service.js.map +1 -0
  156. package/dist/services/arca/arca-billing.gateway.d.ts +9 -0
  157. package/dist/services/arca/arca-billing.gateway.js +10 -0
  158. package/dist/services/arca/arca-billing.gateway.js.map +1 -0
  159. package/dist/services/arca/arca-client.factory.d.ts +5 -0
  160. package/dist/services/arca/arca-client.factory.js +7 -0
  161. package/dist/services/arca/arca-client.factory.js.map +1 -0
  162. package/dist/services/arca/arca-context.resolver.d.ts +44 -0
  163. package/dist/services/arca/arca-context.resolver.js +120 -0
  164. package/dist/services/arca/arca-context.resolver.js.map +1 -0
  165. package/dist/ui/components/contentPanel.d.ts +5 -0
  166. package/dist/ui/components/contentPanel.js +11 -0
  167. package/dist/ui/components/contentPanel.js.map +1 -0
  168. package/dist/ui/components/errorPanel.d.ts +1 -0
  169. package/dist/ui/components/errorPanel.js +13 -0
  170. package/dist/ui/components/errorPanel.js.map +1 -0
  171. package/dist/ui/components/index.d.ts +6 -0
  172. package/dist/ui/components/index.js +7 -0
  173. package/dist/ui/components/index.js.map +1 -0
  174. package/dist/ui/components/keyValuePanel.d.ts +3 -0
  175. package/dist/ui/components/keyValuePanel.js +14 -0
  176. package/dist/ui/components/keyValuePanel.js.map +1 -0
  177. package/dist/ui/components/noticePanel.d.ts +3 -0
  178. package/dist/ui/components/noticePanel.js +11 -0
  179. package/dist/ui/components/noticePanel.js.map +1 -0
  180. package/dist/ui/components/rawPanel.d.ts +1 -0
  181. package/dist/ui/components/rawPanel.js +5 -0
  182. package/dist/ui/components/rawPanel.js.map +1 -0
  183. package/dist/ui/components/statusPanel.d.ts +3 -0
  184. package/dist/ui/components/statusPanel.js +20 -0
  185. package/dist/ui/components/statusPanel.js.map +1 -0
  186. package/dist/ui/index.d.ts +5 -0
  187. package/dist/ui/index.js +6 -0
  188. package/dist/ui/index.js.map +1 -0
  189. package/dist/ui/presenters/billing.presenter.d.ts +2 -0
  190. package/dist/ui/presenters/billing.presenter.js +2 -0
  191. package/dist/ui/presenters/billing.presenter.js.map +1 -0
  192. package/dist/ui/presenters/config.presenter.d.ts +1 -0
  193. package/dist/ui/presenters/config.presenter.js +2 -0
  194. package/dist/ui/presenters/config.presenter.js.map +1 -0
  195. package/dist/ui/presenters/errors.presenter.d.ts +1 -0
  196. package/dist/ui/presenters/errors.presenter.js +89 -0
  197. package/dist/ui/presenters/errors.presenter.js.map +1 -0
  198. package/dist/ui/presenters/errors.zod-presenter.d.ts +2 -0
  199. package/dist/ui/presenters/errors.zod-presenter.js +82 -0
  200. package/dist/ui/presenters/errors.zod-presenter.js.map +1 -0
  201. package/dist/ui/presenters/index.d.ts +4 -0
  202. package/dist/ui/presenters/index.js +5 -0
  203. package/dist/ui/presenters/index.js.map +1 -0
  204. package/dist/ui/presenters/showcase.presenter.d.ts +1 -0
  205. package/dist/ui/presenters/showcase.presenter.js +2 -0
  206. package/dist/ui/presenters/showcase.presenter.js.map +1 -0
  207. package/dist/ui/primitives/index.d.ts +10 -0
  208. package/dist/ui/primitives/index.js +11 -0
  209. package/dist/ui/primitives/index.js.map +1 -0
  210. package/dist/ui/primitives/renderDivider.d.ts +5 -0
  211. package/dist/ui/primitives/renderDivider.js +5 -0
  212. package/dist/ui/primitives/renderDivider.js.map +1 -0
  213. package/dist/ui/primitives/renderFooter.d.ts +7 -0
  214. package/dist/ui/primitives/renderFooter.js +6 -0
  215. package/dist/ui/primitives/renderFooter.js.map +1 -0
  216. package/dist/ui/primitives/renderJson.d.ts +3 -0
  217. package/dist/ui/primitives/renderJson.js +19 -0
  218. package/dist/ui/primitives/renderJson.js.map +1 -0
  219. package/dist/ui/primitives/renderKeyValue.d.ts +14 -0
  220. package/dist/ui/primitives/renderKeyValue.js +34 -0
  221. package/dist/ui/primitives/renderKeyValue.js.map +1 -0
  222. package/dist/ui/primitives/renderLogo.d.ts +2 -0
  223. package/dist/ui/primitives/renderLogo.js +28 -0
  224. package/dist/ui/primitives/renderLogo.js.map +1 -0
  225. package/dist/ui/primitives/renderObject.d.ts +1 -0
  226. package/dist/ui/primitives/renderObject.js +19 -0
  227. package/dist/ui/primitives/renderObject.js.map +1 -0
  228. package/dist/ui/primitives/renderPanel.d.ts +23 -0
  229. package/dist/ui/primitives/renderPanel.js +114 -0
  230. package/dist/ui/primitives/renderPanel.js.map +1 -0
  231. package/dist/ui/primitives/renderSubtitle.d.ts +7 -0
  232. package/dist/ui/primitives/renderSubtitle.js +6 -0
  233. package/dist/ui/primitives/renderSubtitle.js.map +1 -0
  234. package/dist/ui/primitives/renderTable.d.ts +6 -0
  235. package/dist/ui/primitives/renderTable.js +14 -0
  236. package/dist/ui/primitives/renderTable.js.map +1 -0
  237. package/dist/ui/primitives/text.d.ts +18 -0
  238. package/dist/ui/primitives/text.js +154 -0
  239. package/dist/ui/primitives/text.js.map +1 -0
  240. package/dist/ui/stream/index.d.ts +1 -0
  241. package/dist/ui/stream/index.js +2 -0
  242. package/dist/ui/stream/index.js.map +1 -0
  243. package/dist/ui/stream/terminal-stream.d.ts +10 -0
  244. package/dist/ui/stream/terminal-stream.js +20 -0
  245. package/dist/ui/stream/terminal-stream.js.map +1 -0
  246. package/dist/ui/theme/index.d.ts +1 -0
  247. package/dist/ui/theme/index.js +2 -0
  248. package/dist/ui/theme/index.js.map +1 -0
  249. package/dist/ui/theme/theme.d.ts +27 -0
  250. package/dist/ui/theme/theme.js +41 -0
  251. package/dist/ui/theme/theme.js.map +1 -0
  252. package/llms.txt +157 -0
  253. package/package.json +98 -35
  254. package/.babelrc +0 -4
  255. package/.eslintignore +0 -1
  256. package/.eslintrc.js +0 -17
  257. package/.npmignore +0 -1
  258. package/lib/arcli.js +0 -275
  259. package/lib/arcli.min.js +0 -1
  260. package/src/config.js +0 -22
  261. package/src/consoler.js +0 -10
  262. package/src/index.js +0 -21
  263. package/src/init.js +0 -13
  264. package/src/run.js +0 -4
  265. package/src/spinner.js +0 -39
  266. package/tst/index.js +0 -26
  267. package/webpack.config.js +0 -47
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arca-date.js","sourceRoot":"","sources":["../../../src/lib/dates/arca-date.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,0BAA0B,GAAG,iEAAiE,CAAC;AAErG,MAAM,UAAU,oBAAoB,CAAC,KAAW;IAC9C,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,KAAa,EAAE,aAAa,GAAG,IAAI,IAAI,EAAE;IACzF,MAAM,eAAe,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IACrC,MAAM,SAAS,GAAG,qDAAqD,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAE9F,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,oBAAoB,CAAC,aAAa,KAAK,mBAAmB,0BAA0B,EAAE,CAAC,CAAC;IACpG,CAAC;IAED,MAAM,CAAC,EAAE,MAAM,EAAE,AAAD,EAAG,QAAQ,EAAE,YAAY,CAAC,GAAG,SAAS,CAAC;IACvD,MAAM,GAAG,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACpC,MAAM,KAAK,GAAG,CAAC,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAClF,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAEpE,IAAI,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;QACnH,MAAM,IAAI,oBAAoB,CAAC,aAAa,KAAK,iBAAiB,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,EAAE,CAAC;AACjC,CAAC;AAED,SAAS,WAAW,CAAC,YAAgC,EAAE,aAAmB;IACxE,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,OAAO,MAAM,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,YAAY,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;AACxE,CAAC"}
@@ -0,0 +1,14 @@
1
+ export declare class AppError extends Error {
2
+ readonly code: string;
3
+ readonly details?: Record<string, unknown>;
4
+ constructor(message: string, options: {
5
+ code: string;
6
+ details?: Record<string, unknown>;
7
+ });
8
+ }
9
+ export declare class ConfigurationError extends AppError {
10
+ constructor(message: string, details?: Record<string, unknown>);
11
+ }
12
+ export declare class InputValidationError extends AppError {
13
+ constructor(message: string, details?: Record<string, unknown>);
14
+ }
@@ -0,0 +1,29 @@
1
+ export class AppError extends Error {
2
+ code;
3
+ details;
4
+ constructor(message, options) {
5
+ super(message);
6
+ this.name = 'AppError';
7
+ this.code = options.code;
8
+ this.details = options.details;
9
+ }
10
+ }
11
+ export class ConfigurationError extends AppError {
12
+ constructor(message, details) {
13
+ super(message, {
14
+ code: 'CONFIGURATION_ERROR',
15
+ details,
16
+ });
17
+ this.name = 'ConfigurationError';
18
+ }
19
+ }
20
+ export class InputValidationError extends AppError {
21
+ constructor(message, details) {
22
+ super(message, {
23
+ code: 'INPUT_VALIDATION_ERROR',
24
+ details,
25
+ });
26
+ this.name = 'InputValidationError';
27
+ }
28
+ }
29
+ //# sourceMappingURL=app-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-error.js","sourceRoot":"","sources":["../../../src/lib/errors/app-error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAS,SAAQ,KAAK;IACjB,IAAI,CAAS;IACb,OAAO,CAA2B;IAElD,YAAmB,OAAe,EAAE,OAA4D;QAC9F,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;QACvB,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACjC,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,QAAQ;IAC9C,YAAmB,OAAe,EAAE,OAAiC;QACnE,KAAK,CAAC,OAAO,EAAE;YACb,IAAI,EAAE,qBAAqB;YAC3B,OAAO;SACR,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;IACnC,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,QAAQ;IAChD,YAAmB,OAAe,EAAE,OAAiC;QACnE,KAAK,CAAC,OAAO,EAAE;YACb,IAAI,EAAE,wBAAwB;YAC9B,OAAO;SACR,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF"}
@@ -0,0 +1 @@
1
+ export declare function readJsonFile<T>(filePath: string): T;
@@ -0,0 +1,21 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { InputValidationError } from '../errors/app-error.js';
3
+ export function readJsonFile(filePath) {
4
+ if (!existsSync(filePath)) {
5
+ throw new InputValidationError(`La ruta del archivo JSON no existe: ${filePath}`, {
6
+ path: filePath,
7
+ });
8
+ }
9
+ const rawContent = readFileSync(filePath, 'utf8');
10
+ try {
11
+ return JSON.parse(rawContent);
12
+ }
13
+ catch (error) {
14
+ const message = error instanceof Error ? error.message : 'JSON invalido';
15
+ throw new InputValidationError(`No se pudo leer el archivo JSON "${filePath}": ${message}`, {
16
+ cause: error instanceof Error ? error.message : 'JSON invalido',
17
+ path: filePath,
18
+ });
19
+ }
20
+ }
21
+ //# sourceMappingURL=read-json-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-json-file.js","sourceRoot":"","sources":["../../../src/lib/files/read-json-file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAE3D,MAAM,UAAU,YAAY,CAAI,QAAgB;IAC9C,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,oBAAoB,CAAC,uCAAuC,QAAQ,EAAE,EAAE;YAChF,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;IACL,CAAC;IAED,MAAM,UAAU,GAAG,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAElD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,UAAU,CAAM,CAAC;IACrC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QAEzE,MAAM,IAAI,oBAAoB,CAAC,oCAAoC,QAAQ,MAAM,OAAO,EAAE,EAAE;YAC1F,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;YAC/D,IAAI,EAAE,QAAQ;SACf,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function maskPath(filePath: string): string;
@@ -0,0 +1,17 @@
1
+ import { basename, dirname } from 'node:path';
2
+ export function maskPath(filePath) {
3
+ const normalizedPath = filePath.trim();
4
+ if (!normalizedPath) {
5
+ return filePath;
6
+ }
7
+ const fileName = basename(normalizedPath);
8
+ const parentDirectory = basename(dirname(normalizedPath));
9
+ if (!fileName) {
10
+ return normalizedPath;
11
+ }
12
+ if (!parentDirectory || parentDirectory === '.' || parentDirectory === fileName) {
13
+ return `.../${fileName}`;
14
+ }
15
+ return `.../${parentDirectory}/${fileName}`;
16
+ }
17
+ //# sourceMappingURL=mask-path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mask-path.js","sourceRoot":"","sources":["../../../src/lib/paths/mask-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE9C,MAAM,UAAU,QAAQ,CAAC,QAAgB;IACvC,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAEvC,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC1C,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;IAE1D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,cAAc,CAAC;IACxB,CAAC;IAED,IAAI,CAAC,eAAe,IAAI,eAAe,KAAK,GAAG,IAAI,eAAe,KAAK,QAAQ,EAAE,CAAC;QAChF,OAAO,OAAO,QAAQ,EAAE,CAAC;IAC3B,CAAC;IAED,OAAO,OAAO,eAAe,IAAI,QAAQ,EAAE,CAAC;AAC9C,CAAC"}
@@ -0,0 +1,7 @@
1
+ export interface CertificateExpiry {
2
+ readonly daysRemaining: number;
3
+ readonly expiresAt: Date;
4
+ readonly isExpired: boolean;
5
+ }
6
+ export declare function readCertificateExpiry(pemContent: string): CertificateExpiry;
7
+ export declare function isCertificateExpiringSoon(expiry: CertificateExpiry, thresholdDays: number): boolean;
@@ -0,0 +1,16 @@
1
+ import { X509Certificate } from 'node:crypto';
2
+ const MS_PER_DAY = 24 * 60 * 60 * 1000;
3
+ export function readCertificateExpiry(pemContent) {
4
+ const certificate = new X509Certificate(pemContent);
5
+ const expiresAt = new Date(certificate.validTo);
6
+ const daysRemaining = Math.ceil((expiresAt.getTime() - Date.now()) / MS_PER_DAY);
7
+ return {
8
+ daysRemaining,
9
+ expiresAt,
10
+ isExpired: daysRemaining < 0,
11
+ };
12
+ }
13
+ export function isCertificateExpiringSoon(expiry, thresholdDays) {
14
+ return !expiry.isExpired && expiry.daysRemaining <= thresholdDays;
15
+ }
16
+ //# sourceMappingURL=certificate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"certificate.js","sourceRoot":"","sources":["../../../src/lib/security/certificate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAQvC,MAAM,UAAU,qBAAqB,CAAC,UAAkB;IACtD,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,UAAU,CAAC,CAAC;IACpD,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC;IAEjF,OAAO;QACL,aAAa;QACb,SAAS;QACT,SAAS,EAAE,aAAa,GAAG,CAAC;KAC7B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAyB,EAAE,aAAqB;IACxF,OAAO,CAAC,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,aAAa,IAAI,aAAa,CAAC;AACpE,CAAC"}
@@ -0,0 +1,5 @@
1
+ type PemKind = 'certificado' | 'clave privada';
2
+ export declare function ensurePathExists(filePath: string, label: PemKind): void;
3
+ export declare function ensurePemFormat(content: string, filePath: string, label: PemKind): void;
4
+ export declare function readPemFile(filePath: string, label: PemKind): string;
5
+ export {};
@@ -0,0 +1,36 @@
1
+ import { existsSync, readFileSync } from 'node:fs';
2
+ import { ConfigurationError } from '../errors/app-error.js';
3
+ import { maskPath } from '../paths/mask-path.js';
4
+ function expectedPemHeader(kind) {
5
+ return kind === 'certificado' ? '-----BEGIN CERTIFICATE-----' : '-----BEGIN PRIVATE KEY-----';
6
+ }
7
+ function acceptedPemHeaders(kind) {
8
+ if (kind === 'certificado') {
9
+ return ['BEGIN CERTIFICATE'];
10
+ }
11
+ return ['BEGIN PRIVATE KEY', 'BEGIN RSA PRIVATE KEY', 'BEGIN EC PRIVATE KEY', 'BEGIN ENCRYPTED PRIVATE KEY'];
12
+ }
13
+ export function ensurePathExists(filePath, label) {
14
+ if (!existsSync(filePath)) {
15
+ throw new ConfigurationError(`La ruta del ${label} no existe: ${maskPath(filePath)}`, {
16
+ path: maskPath(filePath),
17
+ });
18
+ }
19
+ }
20
+ export function ensurePemFormat(content, filePath, label) {
21
+ const normalizedContent = content.trim();
22
+ const hasAcceptedHeader = acceptedPemHeaders(label).some((header) => normalizedContent.includes(`-----${header}-----`));
23
+ const hasAcceptedFooter = normalizedContent.includes('-----END');
24
+ if (!hasAcceptedHeader || !hasAcceptedFooter) {
25
+ throw new ConfigurationError(`La ${label === 'certificado' ? 'ruta del certificado' : 'ruta de la clave privada'} apunta a un archivo con formato PEM invalido: ${maskPath(filePath)}. Debe contener un bloque como ${expectedPemHeader(label)}.`, {
26
+ path: maskPath(filePath),
27
+ });
28
+ }
29
+ }
30
+ export function readPemFile(filePath, label) {
31
+ ensurePathExists(filePath, label);
32
+ const content = readFileSync(filePath, 'utf8');
33
+ ensurePemFormat(content, filePath, label);
34
+ return content;
35
+ }
36
+ //# sourceMappingURL=pem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pem.js","sourceRoot":"","sources":["../../../src/lib/security/pem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAI9C,SAAS,iBAAiB,CAAC,IAAa;IACtC,OAAO,IAAI,KAAK,aAAa,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,6BAA6B,CAAC;AAChG,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAa;IACvC,IAAI,IAAI,KAAK,aAAa,EAAE,CAAC;QAC3B,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,CAAC,mBAAmB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,6BAA6B,CAAC,CAAC;AAC/G,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,KAAc;IAC/D,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,kBAAkB,CAAC,eAAe,KAAK,eAAe,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE;YACpF,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;SACzB,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,QAAgB,EAAE,KAAc;IAC/E,MAAM,iBAAiB,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IACzC,MAAM,iBAAiB,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAClE,iBAAiB,CAAC,QAAQ,CAAC,QAAQ,MAAM,OAAO,CAAC,CAClD,CAAC;IACF,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;IAEjE,IAAI,CAAC,iBAAiB,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC7C,MAAM,IAAI,kBAAkB,CAC1B,MAAM,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,0BAA0B,kDAAkD,QAAQ,CAAC,QAAQ,CAAC,kCAAkC,iBAAiB,CAAC,KAAK,CAAC,GAAG,EACpN;YACE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC;SACzB,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAAgB,EAAE,KAAc;IAC1D,gBAAgB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAElC,MAAM,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAE/C,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAE1C,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { CreateVoucherResultDto } from '@arcasdk/core/lib/application/dto/electronic-billing';
2
+ import type { BillingResponseSummary } from './billing.types.internal';
3
+ export declare function createDryRunResponse(): BillingResponseSummary;
4
+ export declare function mapBillingResponse(response: CreateVoucherResultDto): BillingResponseSummary;
@@ -0,0 +1,74 @@
1
+ export function createDryRunResponse() {
2
+ return {
3
+ cae: null,
4
+ caeVencimiento: null,
5
+ errors: [],
6
+ events: [],
7
+ observaciones: [],
8
+ observacion: null,
9
+ raw: null,
10
+ resultado: null,
11
+ suggestions: [],
12
+ status: 'observado',
13
+ };
14
+ }
15
+ export function mapBillingResponse(response) {
16
+ const detail = response.response?.FeDetResp?.FECAEDetResponse?.[0];
17
+ const events = response.response?.Events?.Evt ?? [];
18
+ const errors = response.response?.Errors?.Err ?? [];
19
+ const observaciones = detail?.Observaciones?.Obs?.map((item) => item.Msg).filter((msg) => Boolean(msg)) ?? [];
20
+ const resultado = detail?.Resultado ?? null;
21
+ const suggestions = buildResponseSuggestions({
22
+ errors,
23
+ observaciones,
24
+ resultado,
25
+ });
26
+ return {
27
+ cae: response.cae ?? null,
28
+ caeVencimiento: response.caeFchVto ?? null,
29
+ errors,
30
+ events,
31
+ observaciones,
32
+ observacion: observaciones.join(' | ') || null,
33
+ raw: response,
34
+ resultado,
35
+ suggestions,
36
+ status: resolveBillingStatus({
37
+ errors,
38
+ observaciones,
39
+ resultado,
40
+ }),
41
+ };
42
+ }
43
+ function buildResponseSuggestions(options) {
44
+ const messages = [
45
+ ...options.observaciones,
46
+ ...options.errors
47
+ .map((error) => typeof error === 'object' && error && 'Msg' in error ? String(error.Msg ?? '') : '')
48
+ .filter(Boolean),
49
+ ].join(' | ');
50
+ const suggestions = new Set();
51
+ if (/transacci[oó]n activa/i.test(messages) || /error interno de base de datos/i.test(messages)) {
52
+ suggestions.add('ARCA devolvio un error transitorio. Espere unos segundos y vuelva a intentar la emision.');
53
+ }
54
+ if (/cuit receptora.*no existe/i.test(messages)) {
55
+ suggestions.add('Revise el CUIT del receptor o emita con un receptor valido del padron para testing.');
56
+ }
57
+ if (/objeto IVA es obligatorio/i.test(messages)) {
58
+ suggestions.add('Revise IVA receptor y el calculo de IVA del comprobante antes de reintentar.');
59
+ }
60
+ if (options.resultado === 'R' && suggestions.size === 0) {
61
+ suggestions.add('Revise observaciones y errores de ARCA antes de volver a emitir.');
62
+ }
63
+ return [...suggestions];
64
+ }
65
+ function resolveBillingStatus(options) {
66
+ if (options.resultado === 'R' || options.errors.length > 0) {
67
+ return 'rechazado';
68
+ }
69
+ if (options.resultado === 'A' && options.observaciones.length === 0) {
70
+ return 'aprobado';
71
+ }
72
+ return 'observado';
73
+ }
74
+ //# sourceMappingURL=billing-response.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing-response.js","sourceRoot":"","sources":["../../../src/modules/billing/billing-response.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,GAAG,EAAE,IAAI;QACT,cAAc,EAAE,IAAI;QACpB,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;QACV,aAAa,EAAE,EAAE;QACjB,WAAW,EAAE,IAAI;QACjB,GAAG,EAAE,IAAI;QACT,SAAS,EAAE,IAAI;QACf,WAAW,EAAE,EAAE;QACf,MAAM,EAAE,WAAW;KACpB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,QAAgC;IACjE,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC,CAAC;IACnE,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IACpD,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,CAAC;IACpD,MAAM,aAAa,GACjB,MAAM,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAiB,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACzG,MAAM,SAAS,GAAG,MAAM,EAAE,SAAS,IAAI,IAAI,CAAC;IAC5C,MAAM,WAAW,GAAG,wBAAwB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AC,GAAG,CAAC,8EAA8E,CAAC,CAAC;IAClG,CAAC;IAED,IAAI,OAAO,CAAC,SAAS,KAAK,GAAG,IAAI,WAAW,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;QACxD,WAAW,CAAC,GAAG,CAAC,kEAAkE,CAAC,CAAC;IACtF,CAAC;IAED,OAAO,CAAC,GAAG,WAAW,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,oBAAoB,CAAC,OAI7B;IACC,IAAI,OAAO,CAAC,SAAS,KAAK,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3D,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,IAAI,OAAO,CAAC,SAAS,KAAK,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpE,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { IIva } from '@arcasdk/core/lib/domain/types/voucher.types';
2
+ import type { BillingIvaCondition } from './billing.schemas';
3
+ import type { VoucherKindDefinition } from './billing.types';
4
+ export interface TaxAmounts {
5
+ readonly iva?: IIva[];
6
+ readonly ivaAmount: number;
7
+ readonly netAmount: number;
8
+ }
9
+ export declare function resolveTaxAmounts(totalAmount: number, ivaCondition: BillingIvaCondition, voucherKind: VoucherKindDefinition): TaxAmounts;
@@ -0,0 +1,30 @@
1
+ import Big from 'big.js';
2
+ const DEFAULT_IVA_ALIQUOT_ID = 5;
3
+ const DEFAULT_IVA_RATE = 0.21;
4
+ const IVA_TOTAL_MULTIPLIER = new Big(1).plus(DEFAULT_IVA_RATE);
5
+ export function resolveTaxAmounts(totalAmount, ivaCondition, voucherKind) {
6
+ const shouldApplyIva = voucherKind.letter === 'b' || (voucherKind.letter === 'a' && ivaCondition === 'responsable-inscripto');
7
+ if (!shouldApplyIva) {
8
+ return {
9
+ ivaAmount: 0,
10
+ netAmount: totalAmount,
11
+ };
12
+ }
13
+ const netAmount = roundAmount(new Big(totalAmount).div(IVA_TOTAL_MULTIPLIER));
14
+ const ivaAmount = roundAmount(new Big(totalAmount).minus(netAmount));
15
+ return {
16
+ iva: [
17
+ {
18
+ BaseImp: netAmount,
19
+ Id: DEFAULT_IVA_ALIQUOT_ID,
20
+ Importe: ivaAmount,
21
+ },
22
+ ],
23
+ ivaAmount,
24
+ netAmount,
25
+ };
26
+ }
27
+ function roundAmount(value) {
28
+ return value.round(2, Big.roundHalfUp).toNumber();
29
+ }
30
+ //# sourceMappingURL=billing.amounts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.amounts.js","sourceRoot":"","sources":["../../../src/modules/billing/billing.amounts.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,QAAQ,CAAC;AAKzB,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,gBAAgB,GAAG,IAAI,CAAC;AAC9B,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;AAQ/D,MAAM,UAAU,iBAAiB,CAC/B,WAAmB,EACnB,YAAiC,EACjC,WAAkC;IAElC,MAAM,cAAc,GAClB,WAAW,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,GAAG,IAAI,YAAY,KAAK,uBAAuB,CAAC,CAAC;IAEzG,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO;YACL,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,WAAW;SACvB,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC9E,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,GAAG,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC;IAErE,OAAO;QACL,GAAG,EAAE;YACH;gBACE,OAAO,EAAE,SAAS;gBAClB,EAAE,EAAE,sBAAsB;gBAC1B,OAAO,EAAE,SAAS;aACnB;SACF;QACD,SAAS;QACT,SAAS;KACV,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,KAAU;IAC7B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC,QAAQ,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ICbtesAsoc } from '@arcasdk/core/lib/domain/types/voucher.types';
2
+ import type { BillingCommandInput } from './billing.schemas';
3
+ import type { VoucherKindDefinition } from './billing.types';
4
+ interface ResolveAssociatedVoucherOptions {
5
+ readonly input: BillingCommandInput;
6
+ readonly requireVoucherKind: (shortcut: string) => VoucherKindDefinition;
7
+ readonly voucherKind: VoucherKindDefinition;
8
+ }
9
+ export declare function resolveAssociatedVouchers(options: ResolveAssociatedVoucherOptions): ICbtesAsoc[] | undefined;
10
+ export {};
@@ -0,0 +1,51 @@
1
+ import { InputValidationError } from '../../lib/errors/app-error.js';
2
+ import { formatVoucherLabel } from './billing.mappers.js';
3
+ export function resolveAssociatedVouchers(options) {
4
+ const { input, requireVoucherKind, voucherKind } = options;
5
+ if (!voucherKind.requiresAssociatedVoucher) {
6
+ if (input.associatedVoucher) {
7
+ throw new InputValidationError(`El comprobante ${formatVoucherLabel(voucherKind)} no usa comprobante asociado.`);
8
+ }
9
+ return undefined;
10
+ }
11
+ const associatedVoucher = input.associatedVoucher;
12
+ const associatedVoucherType = associatedVoucher?.tipo ?? resolveAssociatedVoucherType(associatedVoucher?.shortcut, requireVoucherKind);
13
+ const associatedVoucherKind = associatedVoucher?.shortcut
14
+ ? requireVoucherKind(associatedVoucher.shortcut)
15
+ : undefined;
16
+ if (!associatedVoucher?.numero ||
17
+ !associatedVoucher.puntoVenta ||
18
+ !associatedVoucherType ||
19
+ !associatedVoucher.cuit) {
20
+ throw new InputValidationError(`El comprobante ${formatVoucherLabel(voucherKind)} requiere comprobante asociado. Use --ac o --at, junto con --apv o --asociado-punto-venta, --ar y --acuit.`);
21
+ }
22
+ if (associatedVoucherKind) {
23
+ validateAssociatedVoucherKind(associatedVoucherKind, voucherKind);
24
+ }
25
+ return [
26
+ {
27
+ Cuit: associatedVoucher.cuit,
28
+ Nro: associatedVoucher.numero,
29
+ PtoVta: associatedVoucher.puntoVenta,
30
+ Tipo: associatedVoucherType,
31
+ },
32
+ ];
33
+ }
34
+ function resolveAssociatedVoucherType(shortcut, requireVoucherKind) {
35
+ if (!shortcut) {
36
+ return undefined;
37
+ }
38
+ return requireVoucherKind(shortcut).arcaType;
39
+ }
40
+ function validateAssociatedVoucherKind(associatedVoucherKind, voucherKind) {
41
+ if (associatedVoucherKind.family !== 'factura' && associatedVoucherKind.family !== 'factura-credito-electronica') {
42
+ throw new InputValidationError(`El comprobante asociado de ${formatVoucherLabel(voucherKind)} debe ser una factura, no otra nota.`);
43
+ }
44
+ if (associatedVoucherKind.letter !== voucherKind.letter) {
45
+ throw new InputValidationError(`El comprobante asociado debe usar la misma letra que ${formatVoucherLabel(voucherKind)}.`);
46
+ }
47
+ if (associatedVoucherKind.isElectronicCredit !== voucherKind.isElectronicCredit) {
48
+ throw new InputValidationError(`El comprobante asociado debe pertenecer a la misma categoria electronica que ${formatVoucherLabel(voucherKind)}.`);
49
+ }
50
+ }
51
+ //# sourceMappingURL=billing.associated-vouchers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.associated-vouchers.js","sourceRoot":"","sources":["../../../src/modules/billing/billing.associated-vouchers.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAUvD,MAAM,UAAU,yBAAyB,CAAC,OAAwC;IAChF,MAAM,EAAE,KAAK,EAAE,kBAAkB,EAAE,WAA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CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;AAC/C,CAAC;AAED,SAAS,6BAA6B,CACpC,qBAA4C,EAC5C,WAAkC;IAElC,IAAI,qBAAqB,CAAC,MAAM,KAAK,SAAS,IAAI,qBAAqB,CAAC,MAAM,KAAK,6BAA6B,EAAE,CAAC;QACjH,MAAM,IAAI,oBAAoB,CAC5B,8BAA8B,kBAAkB,CAAC,WAAW,CAAC,sCAAsC,CACpG,CAAC;IACJ,CAAC;IAED,IAAI,qBAAqB,CAAC,MAAM,KAAK,WAAW,CAAC,MAAM,EAAE,CAAC;QACxD,MAAM,IAAI,oBAAoB,CAC5B,wDAAwD,kBAAkB,CAAC,WAAW,CAAC,GAAG,CAC3F,CAAC;IACJ,CAAC;IAED,IAAI,qBAAqB,CAAC,kBAAkB,KAAK,WAAW,CAAC,kBAAkB,EAAE,CAAC;QAChF,MAAM,IAAI,oBAAoB,CAC5B,gFAAgF,kBAAkB,CAAC,WAAW,CAAC,GAAG,CACnH,CAAC;IACJ,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const DEFAULT_CURRENCY_CODE = "ARS";
2
+ export declare const DEFAULT_EXCHANGE_RATE = 1;
@@ -0,0 +1,3 @@
1
+ export const DEFAULT_CURRENCY_CODE = 'ARS';
2
+ export const DEFAULT_EXCHANGE_RATE = 1;
3
+ //# sourceMappingURL=billing.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.constants.js","sourceRoot":"","sources":["../../../src/modules/billing/billing.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { BillingCommandInput } from './billing.schemas';
2
+ export interface BillingDateRange {
3
+ readonly billingDate: string;
4
+ readonly paymentDueDate: string;
5
+ readonly serviceEndDate: string;
6
+ readonly serviceStartDate: string;
7
+ }
8
+ export declare function resolveBillingDateRange(input: BillingCommandInput): BillingDateRange;
@@ -0,0 +1,45 @@
1
+ import { formatDateAsArcaDate, parseArgentineDateInputAsArcaDate } from '../../lib/dates/arca-date.js';
2
+ import { ensureDateOrder, validateConceptDateInputs } from './billing.validation.js';
3
+ function resolvePaymentDateFromDueDay(dueDay) {
4
+ const referenceDate = new Date();
5
+ const paymentDate = new Date(referenceDate);
6
+ if (dueDay < referenceDate.getDate()) {
7
+ paymentDate.setMonth(paymentDate.getMonth() + 1);
8
+ }
9
+ paymentDate.setDate(dueDay);
10
+ return paymentDate;
11
+ }
12
+ export function resolveBillingDateRange(input) {
13
+ validateConceptDateInputs(input);
14
+ const billingDate = input.billingDate
15
+ ? parseArgentineDateInputAsArcaDate(input.billingDate)
16
+ : formatDateAsArcaDate(new Date());
17
+ if (input.billingDate) {
18
+ const serviceStartDate = input.serviceStartDate
19
+ ? parseArgentineDateInputAsArcaDate(input.serviceStartDate)
20
+ : billingDate;
21
+ const serviceEndDate = input.serviceEndDate ? parseArgentineDateInputAsArcaDate(input.serviceEndDate) : billingDate;
22
+ ensureDateOrder(serviceStartDate, serviceEndDate);
23
+ return {
24
+ billingDate,
25
+ paymentDueDate: serviceEndDate,
26
+ serviceEndDate,
27
+ serviceStartDate,
28
+ };
29
+ }
30
+ const paymentDate = input.dueDay ? resolvePaymentDateFromDueDay(input.dueDay) : new Date();
31
+ const serviceEndDate = input.serviceEndDate
32
+ ? parseArgentineDateInputAsArcaDate(input.serviceEndDate)
33
+ : formatDateAsArcaDate(paymentDate);
34
+ const serviceStartDate = input.serviceStartDate
35
+ ? parseArgentineDateInputAsArcaDate(input.serviceStartDate)
36
+ : serviceEndDate;
37
+ ensureDateOrder(serviceStartDate, serviceEndDate);
38
+ return {
39
+ billingDate,
40
+ paymentDueDate: serviceEndDate,
41
+ serviceEndDate,
42
+ serviceStartDate,
43
+ };
44
+ }
45
+ //# sourceMappingURL=billing.date-range.js.map
@@ -0,0 +1 @@
1
+ {"version":3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C9B,cAAc;YACd,gBAAgB;SACjB,CAAC;IACJ,CAAC;IAED,MAAM,WAAW,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,4BAA4B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;IAC3F,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc;QACzC,CAAC,CAAC,iCAAiC,CAAC,KAAK,CAAC,cAAc,CAAC;QACzD,CAAC,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAAC;IACtC,MAAM,gBAAgB,GAAG,KAAK,CAAC,gBAAgB;QAC7C,CAAC,CAAC,iCAAiC,CAAC,KAAK,CAAC,gBAAgB,CAAC;QAC3D,CAAC,CAAC,cAAc,CAAC;IAEnB,eAAe,CAAC,gBAAgB,EAAE,cAAc,CAAC,CAAC;IAElD,OAAO;QACL,WAAW;QACX,cAAc,EAAE,cAAc;QAC9B,cAAc;QACd,gBAAgB;KACjB,CAAC;AACJ,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { BillingExecutionResult } from './billing.types.internal';
2
+ export declare function formatEnvironmentBanner(environment: BillingExecutionResult['environment'] | undefined): string[];
3
+ export declare function formatStatusBadge(result: BillingExecutionResult): {
4
+ readonly label: string;
5
+ readonly tone: 'danger' | 'success' | 'warning';
6
+ };
7
+ export declare function formatVoucherSummary(result: BillingExecutionResult): Record<string, unknown>;
8
+ export declare function formatPayloadTable(result: BillingExecutionResult): string;
9
+ export declare function formatPayloadPreview(result: BillingExecutionResult): string;
10
+ export declare function formatResultPanel(result: BillingExecutionResult, status: {
11
+ readonly label: string;
12
+ readonly tone: 'danger' | 'success' | 'warning';
13
+ }): string;
@@ -0,0 +1,111 @@
1
+ import { keyValuePanel, noticePanel, renderKeyValueRows, renderTable, resolveKeyValueLabelWidth, statusPanel, toneText, } from '../../ui/index.js';
2
+ import { formatConceptLabel, formatCurrencyLabel, formatDateLabel, formatDecimalLabel, formatDocumentTypeLabel, formatIvaConditionLabel, formatMoneyLabel, formatNumericLabel, formatTaxIdLabel, } from './billing.labels.js';
3
+ import { getVoucherKindByArcaType } from './voucher-kind-map.js';
4
+ export function formatEnvironmentBanner(environment) {
5
+ if (environment !== 'testing') {
6
+ return [];
7
+ }
8
+ return [noticePanel('Estas utilizando el entorno de TESTING', 'warning')];
9
+ }
10
+ export function formatStatusBadge(result) {
11
+ switch (result.response.status) {
12
+ case 'aprobado':
13
+ return { label: 'APROBADO', tone: 'success' };
14
+ case 'rechazado':
15
+ return { label: 'RECHAZADO', tone: 'danger' };
16
+ default:
17
+ return { label: 'OBSERVADO', tone: 'warning' };
18
+ }
19
+ }
20
+ export function formatVoucherSummary(result) {
21
+ return {
22
+ cae: result.response.cae,
23
+ caeVencimiento: result.response.caeVencimiento,
24
+ comprobante: result.voucherKind.displayName,
25
+ errores: result.response.errors,
26
+ estado: result.response.status,
27
+ eventos: result.response.events,
28
+ observaciones: result.response.observaciones,
29
+ observacion: result.response.observacion,
30
+ solicitud: result.payload,
31
+ previsualizacion: result.dryRun,
32
+ resultado: result.response.resultado,
33
+ tipoArca: result.voucherKind.arcaType,
34
+ };
35
+ }
36
+ function formatFriendlyPayloadRows(result) {
37
+ const payload = result.payload;
38
+ const rows = [
39
+ ['Concepto', formatConceptLabel(payload.Concepto)],
40
+ ['Punto de venta', formatNumericLabel(payload.PtoVta)],
41
+ ['Fecha del comprobante', formatDateLabel(payload.CbteFch)],
42
+ ['Tipo de documento', formatDocumentTypeLabel(payload.DocTipo)],
43
+ [
44
+ 'Numero de documento',
45
+ typeof payload.DocNro === 'number'
46
+ ? payload.DocNro === 0
47
+ ? 'Sin especificar'
48
+ : payload.DocTipo === 80 || payload.DocTipo === 86
49
+ ? formatTaxIdLabel(payload.DocNro)
50
+ : formatNumericLabel(payload.DocNro)
51
+ : 'No informado',
52
+ ],
53
+ ['IVA receptor', formatIvaConditionLabel(payload.CondicionIVAReceptorId)],
54
+ ['Moneda', formatCurrencyLabel(payload.MonId)],
55
+ ['Cotizacion', formatDecimalLabel(payload.MonCotiz)],
56
+ ['Importe neto', formatMoneyLabel(payload.ImpNeto)],
57
+ ['Importe IVA', formatMoneyLabel(payload.ImpIVA)],
58
+ ['Importe tributos', formatMoneyLabel(payload.ImpTrib)],
59
+ ['Importe exento', formatMoneyLabel(payload.ImpOpEx)],
60
+ ['Importe total', formatMoneyLabel(payload.ImpTotal)],
61
+ ];
62
+ if (payload.FchServDesde) {
63
+ rows.push(['Servicio desde', formatDateLabel(payload.FchServDesde)]);
64
+ }
65
+ if (payload.FchServHasta) {
66
+ rows.push(['Servicio hasta', formatDateLabel(payload.FchServHasta)]);
67
+ }
68
+ if (payload.FchVtoPago) {
69
+ rows.push(['Vencimiento de pago', formatDateLabel(payload.FchVtoPago)]);
70
+ }
71
+ const associatedVoucher = payload.CbtesAsoc?.[0];
72
+ if (associatedVoucher) {
73
+ const associatedKind = getVoucherKindByArcaType(associatedVoucher.Tipo);
74
+ rows.push(['Comprobante asociado', associatedKind ? associatedKind.displayName : String(associatedVoucher.Tipo)]);
75
+ rows.push(['Punto de venta asociado', formatNumericLabel(associatedVoucher.PtoVta)]);
76
+ rows.push(['Numero asociado', formatNumericLabel(associatedVoucher.Nro)]);
77
+ rows.push(['CUIT asociado', formatTaxIdLabel(associatedVoucher.Cuit)]);
78
+ }
79
+ return rows;
80
+ }
81
+ export function formatPayloadTable(result) {
82
+ const rows = formatFriendlyPayloadRows(result);
83
+ return renderTable(rows, { labelWidth: resolveKeyValueLabelWidth('compact', rows) }).trimEnd();
84
+ }
85
+ export function formatPayloadPreview(result) {
86
+ const payloadTable = formatPayloadTable(result);
87
+ const footer = result.dryRun ? toneText('SIN EMITIR', 'warning') : undefined;
88
+ return keyValuePanel(result.voucherKind.displayName, [payloadTable], footer, 'compact');
89
+ }
90
+ export function formatResultPanel(result, status) {
91
+ const summaryRows = [
92
+ ['CAE', result.response.cae ?? 'N/D'],
93
+ ['Vencimiento CAE', formatDateLabel(result.response.caeVencimiento ?? undefined)],
94
+ ['Punto de venta', result.payload.PtoVta],
95
+ ['Importe total', formatMoneyLabel(result.payload.ImpTotal)],
96
+ ];
97
+ const countRows = [
98
+ ['Observaciones', result.response.observaciones.length],
99
+ ['Eventos', result.response.events.length],
100
+ ['Errores', result.response.errors.length],
101
+ ];
102
+ const labelWidth = resolveKeyValueLabelWidth('compact', [...summaryRows, ...countRows]);
103
+ const rows = [
104
+ ...renderKeyValueRows(summaryRows, { labelWidth }),
105
+ '',
106
+ ...renderKeyValueRows(countRows, { labelWidth }),
107
+ ];
108
+ const footer = toneText(status.label, status.tone);
109
+ return statusPanel(result.voucherKind.displayName, rows, footer, 'compact', status.tone);
110
+ }
111
+ //# sourceMappingURL=billing.display.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.display.js","sourceRoot":"","sources":["../../../src/modules/billing/billing.display.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,yBAAyB,EACzB,WAAW,EACX,QAAQ,GACT,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,MAAM,UAAU,uBAAuB,CAAC,WAA8D;IACpG,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,CAAC,WAAW,CAAC,wCAAwC,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,MAA8B;IAI9D,QAAQ,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC;QAC/B,KAAK,UAAU;YACb,OAAO,EAAE,KAAK,EAAE,UAA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jD,CAAC;IACF,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAEnD,OAAO,WAAW,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAC3F,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { BillingExecutionResult } from './billing.types.internal';
2
+ interface BillingJsonOptions {
3
+ readonly raw?: boolean;
4
+ }
5
+ export declare function formatBillingResultAsJson(result: BillingExecutionResult, options?: BillingJsonOptions): string;
6
+ export {};
@@ -0,0 +1,5 @@
1
+ import { serializeBillingResult } from './billing.serialize.js';
2
+ export function formatBillingResultAsJson(result, options = {}) {
3
+ return JSON.stringify(serializeBillingResult(result, { raw: options.raw }), null, 2);
4
+ }
5
+ //# sourceMappingURL=billing.json-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"billing.json-format.js","sourceRoot":"","sources":["../../../src/modules/billing/billing.json-format.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAO7D,MAAM,UAAU,yBAAyB,CAAC,MAA8B,EAAE,UAA8B,EAAE;IACxG,OAAO,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACvF,CAAC"}