@attocash/cli 0.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 (400) hide show
  1. package/LICENSE +28 -0
  2. package/README.md +707 -0
  3. package/dist/application/app.d.ts +138 -0
  4. package/dist/application/app.js +654 -0
  5. package/dist/application/operations.d.ts +9 -0
  6. package/dist/application/operations.js +96 -0
  7. package/dist/cli/cli.d.ts +1 -0
  8. package/dist/cli/cli.js +460 -0
  9. package/dist/cli/help.d.ts +4 -0
  10. package/dist/cli/help.js +49 -0
  11. package/dist/cli/main.d.ts +2 -0
  12. package/dist/cli/main.js +13 -0
  13. package/dist/cli/onboarding.d.ts +14 -0
  14. package/dist/cli/onboarding.js +144 -0
  15. package/dist/cli/output.d.ts +2 -0
  16. package/dist/cli/output.js +231 -0
  17. package/dist/cli/terminal.d.ts +6 -0
  18. package/dist/cli/terminal.js +92 -0
  19. package/dist/cli/update-check.d.ts +1 -0
  20. package/dist/cli/update-check.js +12 -0
  21. package/dist/cli/updates.d.ts +2 -0
  22. package/dist/cli/updates.js +98 -0
  23. package/dist/core.d.ts +14 -0
  24. package/dist/core.js +14 -0
  25. package/dist/doctor/credential-probe.d.ts +7 -0
  26. package/dist/doctor/credential-probe.js +49 -0
  27. package/dist/doctor/doctor.d.ts +4 -0
  28. package/dist/doctor/doctor.js +213 -0
  29. package/dist/doctor/keyring.d.ts +7 -0
  30. package/dist/doctor/keyring.js +150 -0
  31. package/dist/doctor/profile.d.ts +19 -0
  32. package/dist/doctor/profile.js +73 -0
  33. package/dist/doctor/types.d.ts +40 -0
  34. package/dist/doctor/types.js +1 -0
  35. package/dist/domain/amount.d.ts +6 -0
  36. package/dist/domain/amount.js +27 -0
  37. package/dist/domain/errors.d.ts +10 -0
  38. package/dist/domain/errors.js +16 -0
  39. package/dist/labels/directory.d.ts +87 -0
  40. package/dist/labels/directory.js +140 -0
  41. package/dist/labels/personal.d.ts +17 -0
  42. package/dist/labels/personal.js +56 -0
  43. package/dist/labels/presentation.d.ts +154 -0
  44. package/dist/labels/presentation.js +90 -0
  45. package/dist/network/reader.d.ts +31 -0
  46. package/dist/network/reader.js +370 -0
  47. package/dist/network/retry.d.ts +7 -0
  48. package/dist/network/retry.js +53 -0
  49. package/dist/network/work.d.ts +3 -0
  50. package/dist/network/work.js +66 -0
  51. package/dist/pricing/market.d.ts +29 -0
  52. package/dist/pricing/market.js +150 -0
  53. package/dist/pricing/terms.d.ts +6 -0
  54. package/dist/pricing/terms.js +12 -0
  55. package/dist/spending/destination.d.ts +16 -0
  56. package/dist/spending/destination.js +42 -0
  57. package/dist/spending/journal.d.ts +28 -0
  58. package/dist/spending/journal.js +69 -0
  59. package/dist/spending/ledger.d.ts +118 -0
  60. package/dist/spending/ledger.js +444 -0
  61. package/dist/spending/payments.d.ts +67 -0
  62. package/dist/spending/payments.js +424 -0
  63. package/dist/spending/pool.d.ts +13 -0
  64. package/dist/spending/pool.js +38 -0
  65. package/dist/spending/reconcile.d.ts +18 -0
  66. package/dist/spending/reconcile.js +64 -0
  67. package/dist/storage/profiles.d.ts +13 -0
  68. package/dist/storage/profiles.js +86 -0
  69. package/dist/storage/secrets.d.ts +16 -0
  70. package/dist/storage/secrets.js +104 -0
  71. package/dist/storage/state.d.ts +32 -0
  72. package/dist/storage/state.js +255 -0
  73. package/dist/wallet/auto-receive.d.ts +57 -0
  74. package/dist/wallet/auto-receive.js +140 -0
  75. package/dist/wallet/defaults.d.ts +3 -0
  76. package/dist/wallet/defaults.js +26 -0
  77. package/dist/wallet/signing.d.ts +17 -0
  78. package/dist/wallet/signing.js +128 -0
  79. package/dist/wallet/types.d.ts +65 -0
  80. package/dist/wallet/types.js +1 -0
  81. package/dist/wallet/work.d.ts +29 -0
  82. package/dist/wallet/work.js +154 -0
  83. package/dist/watches/manager.d.ts +75 -0
  84. package/dist/watches/manager.js +197 -0
  85. package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs +6678 -0
  86. package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
  87. package/node_modules/@attocash/commons-core/LICENSE +28 -0
  88. package/node_modules/@attocash/commons-core/README.md +118 -0
  89. package/node_modules/@attocash/commons-core/commons-commons-core.d.mts +1036 -0
  90. package/node_modules/@attocash/commons-core/commons-commons-core.mjs +7701 -0
  91. package/node_modules/@attocash/commons-core/commons-commons-core.mjs.map +1 -0
  92. package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs +17681 -0
  93. package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs.map +1 -0
  94. package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
  95. package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -0
  96. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs +209 -0
  97. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -0
  98. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs +2284 -0
  99. package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
  100. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs +6042 -0
  101. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
  102. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  103. package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  104. package/node_modules/@attocash/commons-core/package.json +27 -0
  105. package/node_modules/@attocash/commons-node/LICENSE +28 -0
  106. package/node_modules/@attocash/commons-node/README.md +92 -0
  107. package/node_modules/@attocash/commons-node/commons-commons-node.d.mts +255 -0
  108. package/node_modules/@attocash/commons-node/commons-commons-node.mjs +2977 -0
  109. package/node_modules/@attocash/commons-node/commons-commons-node.mjs.map +1 -0
  110. package/node_modules/@attocash/commons-node/kotlin-logging.mjs +432 -0
  111. package/node_modules/@attocash/commons-node/kotlin-logging.mjs.map +1 -0
  112. package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  113. package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  114. package/node_modules/@attocash/commons-node/package.json +29 -0
  115. package/node_modules/@attocash/commons-node-remote/LICENSE +28 -0
  116. package/node_modules/@attocash/commons-node-remote/README.md +61 -0
  117. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.d.mts +122 -0
  118. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs +1810 -0
  119. package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs.map +1 -0
  120. package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs +432 -0
  121. package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs.map +1 -0
  122. package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs +8 -0
  123. package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs.map +1 -0
  124. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  125. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
  126. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  127. package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  128. package/node_modules/@attocash/commons-node-remote/package.json +31 -0
  129. package/node_modules/@attocash/commons-transport/LICENSE +28 -0
  130. package/node_modules/@attocash/commons-transport/README.md +5 -0
  131. package/node_modules/@attocash/commons-transport/commons-commons-transport.d.mts +64 -0
  132. package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs +249 -0
  133. package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs.map +1 -0
  134. package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs +263 -0
  135. package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs.map +1 -0
  136. package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs +8 -0
  137. package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs.map +1 -0
  138. package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs +11604 -0
  139. package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs.map +1 -0
  140. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  141. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
  142. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  143. package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  144. package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs +499 -0
  145. package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs.map +1 -0
  146. package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs +6456 -0
  147. package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs.map +1 -0
  148. package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs +83 -0
  149. package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs.map +1 -0
  150. package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs +1714 -0
  151. package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs.map +1 -0
  152. package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs +3197 -0
  153. package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs.map +1 -0
  154. package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs +2290 -0
  155. package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs.map +1 -0
  156. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs +46 -0
  157. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -0
  158. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs +482 -0
  159. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs.map +1 -0
  160. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs +165 -0
  161. package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs.map +1 -0
  162. package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs +4 -0
  163. package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs.map +1 -0
  164. package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs +3222 -0
  165. package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs.map +1 -0
  166. package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs +4 -0
  167. package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs.map +1 -0
  168. package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs +1485 -0
  169. package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs.map +1 -0
  170. package/node_modules/@attocash/commons-transport/package.json +29 -0
  171. package/node_modules/@attocash/commons-worker/LICENSE +28 -0
  172. package/node_modules/@attocash/commons-worker/README.md +48 -0
  173. package/node_modules/@attocash/commons-worker/commons-commons-worker.d.mts +73 -0
  174. package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs +702 -0
  175. package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs.map +1 -0
  176. package/node_modules/@attocash/commons-worker/kotlin-logging.mjs +432 -0
  177. package/node_modules/@attocash/commons-worker/kotlin-logging.mjs.map +1 -0
  178. package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  179. package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  180. package/node_modules/@attocash/commons-worker/package.json +29 -0
  181. package/node_modules/@attocash/commons-worker-remote/LICENSE +28 -0
  182. package/node_modules/@attocash/commons-worker-remote/README.md +60 -0
  183. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.d.mts +93 -0
  184. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs +289 -0
  185. package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs.map +1 -0
  186. package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs +432 -0
  187. package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs.map +1 -0
  188. package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs +8 -0
  189. package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs.map +1 -0
  190. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
  191. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
  192. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
  193. package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
  194. package/node_modules/@attocash/commons-worker-remote/package.json +31 -0
  195. package/node_modules/@js-joda/core/CHANGELOG.md +363 -0
  196. package/node_modules/@js-joda/core/CheatSheet.md +947 -0
  197. package/node_modules/@js-joda/core/LICENSE +34 -0
  198. package/node_modules/@js-joda/core/README.md +155 -0
  199. package/node_modules/@js-joda/core/bower.json +21 -0
  200. package/node_modules/@js-joda/core/dist/js-joda.d.ts +2452 -0
  201. package/node_modules/@js-joda/core/dist/js-joda.esm.js +13564 -0
  202. package/node_modules/@js-joda/core/dist/js-joda.flow.js +949 -0
  203. package/node_modules/@js-joda/core/dist/js-joda.js +13630 -0
  204. package/node_modules/@js-joda/core/dist/js-joda.js.map +1 -0
  205. package/node_modules/@js-joda/core/dist/js-joda.min.js +5 -0
  206. package/node_modules/@js-joda/core/package.json +76 -0
  207. package/node_modules/@js-joda/core/src/Clock.js +330 -0
  208. package/node_modules/@js-joda/core/src/DayOfWeek.js +451 -0
  209. package/node_modules/@js-joda/core/src/Duration.js +1205 -0
  210. package/node_modules/@js-joda/core/src/Enum.js +30 -0
  211. package/node_modules/@js-joda/core/src/Instant.js +1012 -0
  212. package/node_modules/@js-joda/core/src/LocalDate.js +1703 -0
  213. package/node_modules/@js-joda/core/src/LocalDateTime.js +1686 -0
  214. package/node_modules/@js-joda/core/src/LocalTime.js +1415 -0
  215. package/node_modules/@js-joda/core/src/MathUtil.js +236 -0
  216. package/node_modules/@js-joda/core/src/Month.js +600 -0
  217. package/node_modules/@js-joda/core/src/MonthDay.js +730 -0
  218. package/node_modules/@js-joda/core/src/OffsetDateTime.js +757 -0
  219. package/node_modules/@js-joda/core/src/OffsetTime.js +621 -0
  220. package/node_modules/@js-joda/core/src/Period.js +933 -0
  221. package/node_modules/@js-joda/core/src/StringUtil.js +43 -0
  222. package/node_modules/@js-joda/core/src/Year.js +1015 -0
  223. package/node_modules/@js-joda/core/src/YearConstants.js +21 -0
  224. package/node_modules/@js-joda/core/src/YearMonth.js +1096 -0
  225. package/node_modules/@js-joda/core/src/ZoneId.js +236 -0
  226. package/node_modules/@js-joda/core/src/ZoneIdFactory.js +201 -0
  227. package/node_modules/@js-joda/core/src/ZoneOffset.js +486 -0
  228. package/node_modules/@js-joda/core/src/ZoneRegion.js +72 -0
  229. package/node_modules/@js-joda/core/src/ZonedDateTime.js +2007 -0
  230. package/node_modules/@js-joda/core/src/_init.js +68 -0
  231. package/node_modules/@js-joda/core/src/assert.js +33 -0
  232. package/node_modules/@js-joda/core/src/chrono/ChronoLocalDate.js +230 -0
  233. package/node_modules/@js-joda/core/src/chrono/ChronoLocalDateTime.js +130 -0
  234. package/node_modules/@js-joda/core/src/chrono/ChronoZonedDateTime.js +194 -0
  235. package/node_modules/@js-joda/core/src/chrono/IsoChronology.js +235 -0
  236. package/node_modules/@js-joda/core/src/convert.js +83 -0
  237. package/node_modules/@js-joda/core/src/errors.js +54 -0
  238. package/node_modules/@js-joda/core/src/format/DateTimeBuilder.js +535 -0
  239. package/node_modules/@js-joda/core/src/format/DateTimeFormatter.js +728 -0
  240. package/node_modules/@js-joda/core/src/format/DateTimeFormatterBuilder.js +1545 -0
  241. package/node_modules/@js-joda/core/src/format/DateTimeParseContext.js +297 -0
  242. package/node_modules/@js-joda/core/src/format/DateTimePrintContext.js +138 -0
  243. package/node_modules/@js-joda/core/src/format/DecimalStyle.js +113 -0
  244. package/node_modules/@js-joda/core/src/format/EnumMap.js +70 -0
  245. package/node_modules/@js-joda/core/src/format/ParsePosition.js +31 -0
  246. package/node_modules/@js-joda/core/src/format/ResolverStyle.js +93 -0
  247. package/node_modules/@js-joda/core/src/format/SignStyle.js +38 -0
  248. package/node_modules/@js-joda/core/src/format/StringBuilder.js +47 -0
  249. package/node_modules/@js-joda/core/src/format/TextStyle.js +114 -0
  250. package/node_modules/@js-joda/core/src/format/parser/CharLiteralPrinterParser.js +46 -0
  251. package/node_modules/@js-joda/core/src/format/parser/CompositePrinterParser.js +89 -0
  252. package/node_modules/@js-joda/core/src/format/parser/FractionPrinterParser.js +162 -0
  253. package/node_modules/@js-joda/core/src/format/parser/NumberPrinterParser.js +367 -0
  254. package/node_modules/@js-joda/core/src/format/parser/OffsetIdPrinterParser.js +177 -0
  255. package/node_modules/@js-joda/core/src/format/parser/PadPrinterParserDecorator.js +81 -0
  256. package/node_modules/@js-joda/core/src/format/parser/SettingsParser.js +44 -0
  257. package/node_modules/@js-joda/core/src/format/parser/StringLiteralPrinterParser.js +39 -0
  258. package/node_modules/@js-joda/core/src/format/parser/ZoneIdPrinterParser.js +218 -0
  259. package/node_modules/@js-joda/core/src/js-joda.js +210 -0
  260. package/node_modules/@js-joda/core/src/license-preamble.js +3 -0
  261. package/node_modules/@js-joda/core/src/temporal/ChronoField.js +470 -0
  262. package/node_modules/@js-joda/core/src/temporal/ChronoUnit.js +310 -0
  263. package/node_modules/@js-joda/core/src/temporal/DefaultInterfaceTemporal.js +118 -0
  264. package/node_modules/@js-joda/core/src/temporal/IsoFields.js +859 -0
  265. package/node_modules/@js-joda/core/src/temporal/NativeJsTemporal.js +105 -0
  266. package/node_modules/@js-joda/core/src/temporal/Temporal.js +346 -0
  267. package/node_modules/@js-joda/core/src/temporal/TemporalAccessor.js +125 -0
  268. package/node_modules/@js-joda/core/src/temporal/TemporalAdjuster.js +92 -0
  269. package/node_modules/@js-joda/core/src/temporal/TemporalAdjusters.js +464 -0
  270. package/node_modules/@js-joda/core/src/temporal/TemporalAmount.js +166 -0
  271. package/node_modules/@js-joda/core/src/temporal/TemporalField.js +248 -0
  272. package/node_modules/@js-joda/core/src/temporal/TemporalQueries.js +223 -0
  273. package/node_modules/@js-joda/core/src/temporal/TemporalQueriesFactory.js +77 -0
  274. package/node_modules/@js-joda/core/src/temporal/TemporalQuery.js +107 -0
  275. package/node_modules/@js-joda/core/src/temporal/TemporalUnit.js +179 -0
  276. package/node_modules/@js-joda/core/src/temporal/ValueRange.js +257 -0
  277. package/node_modules/@js-joda/core/src/use.js +20 -0
  278. package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneId.js +31 -0
  279. package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneRules.js +162 -0
  280. package/node_modules/@js-joda/core/src/zone/ZoneOffsetTransition.js +289 -0
  281. package/node_modules/@js-joda/core/src/zone/ZoneRules.js +464 -0
  282. package/node_modules/@js-joda/core/src/zone/ZoneRulesProvider.js +36 -0
  283. package/node_modules/@noble/hashes/LICENSE +21 -0
  284. package/node_modules/@noble/hashes/README.md +563 -0
  285. package/node_modules/@noble/hashes/_blake.d.ts +21 -0
  286. package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
  287. package/node_modules/@noble/hashes/_blake.js +52 -0
  288. package/node_modules/@noble/hashes/_blake.js.map +1 -0
  289. package/node_modules/@noble/hashes/_md.d.ts +99 -0
  290. package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
  291. package/node_modules/@noble/hashes/_md.js +202 -0
  292. package/node_modules/@noble/hashes/_md.js.map +1 -0
  293. package/node_modules/@noble/hashes/_u64.d.ts +63 -0
  294. package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
  295. package/node_modules/@noble/hashes/_u64.js +84 -0
  296. package/node_modules/@noble/hashes/_u64.js.map +1 -0
  297. package/node_modules/@noble/hashes/argon2.d.ts +112 -0
  298. package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
  299. package/node_modules/@noble/hashes/argon2.js +517 -0
  300. package/node_modules/@noble/hashes/argon2.js.map +1 -0
  301. package/node_modules/@noble/hashes/blake1.d.ts +156 -0
  302. package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
  303. package/node_modules/@noble/hashes/blake1.js +560 -0
  304. package/node_modules/@noble/hashes/blake1.js.map +1 -0
  305. package/node_modules/@noble/hashes/blake2.d.ts +184 -0
  306. package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
  307. package/node_modules/@noble/hashes/blake2.js +501 -0
  308. package/node_modules/@noble/hashes/blake2.js.map +1 -0
  309. package/node_modules/@noble/hashes/blake3.d.ts +68 -0
  310. package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
  311. package/node_modules/@noble/hashes/blake3.js +284 -0
  312. package/node_modules/@noble/hashes/blake3.js.map +1 -0
  313. package/node_modules/@noble/hashes/eskdf.d.ts +92 -0
  314. package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
  315. package/node_modules/@noble/hashes/eskdf.js +218 -0
  316. package/node_modules/@noble/hashes/eskdf.js.map +1 -0
  317. package/node_modules/@noble/hashes/hkdf.d.ts +64 -0
  318. package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
  319. package/node_modules/@noble/hashes/hkdf.js +120 -0
  320. package/node_modules/@noble/hashes/hkdf.js.map +1 -0
  321. package/node_modules/@noble/hashes/hmac.d.ts +47 -0
  322. package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
  323. package/node_modules/@noble/hashes/hmac.js +93 -0
  324. package/node_modules/@noble/hashes/hmac.js.map +1 -0
  325. package/node_modules/@noble/hashes/index.d.ts +2 -0
  326. package/node_modules/@noble/hashes/index.d.ts.map +1 -0
  327. package/node_modules/@noble/hashes/index.js +35 -0
  328. package/node_modules/@noble/hashes/index.js.map +1 -0
  329. package/node_modules/@noble/hashes/legacy.d.ts +102 -0
  330. package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
  331. package/node_modules/@noble/hashes/legacy.js +327 -0
  332. package/node_modules/@noble/hashes/legacy.js.map +1 -0
  333. package/node_modules/@noble/hashes/package.json +97 -0
  334. package/node_modules/@noble/hashes/pbkdf2.d.ts +56 -0
  335. package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
  336. package/node_modules/@noble/hashes/pbkdf2.js +135 -0
  337. package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
  338. package/node_modules/@noble/hashes/scrypt.d.ts +65 -0
  339. package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
  340. package/node_modules/@noble/hashes/scrypt.js +257 -0
  341. package/node_modules/@noble/hashes/scrypt.js.map +1 -0
  342. package/node_modules/@noble/hashes/sha2.d.ts +249 -0
  343. package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
  344. package/node_modules/@noble/hashes/sha2.js +458 -0
  345. package/node_modules/@noble/hashes/sha2.js.map +1 -0
  346. package/node_modules/@noble/hashes/sha3-addons.d.ts +461 -0
  347. package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
  348. package/node_modules/@noble/hashes/sha3-addons.js +783 -0
  349. package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
  350. package/node_modules/@noble/hashes/sha3.d.ts +199 -0
  351. package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
  352. package/node_modules/@noble/hashes/sha3.js +431 -0
  353. package/node_modules/@noble/hashes/sha3.js.map +1 -0
  354. package/node_modules/@noble/hashes/src/_blake.ts +57 -0
  355. package/node_modules/@noble/hashes/src/_md.ts +222 -0
  356. package/node_modules/@noble/hashes/src/_u64.ts +117 -0
  357. package/node_modules/@noble/hashes/src/argon2.ts +667 -0
  358. package/node_modules/@noble/hashes/src/blake1.ts +614 -0
  359. package/node_modules/@noble/hashes/src/blake2.ts +582 -0
  360. package/node_modules/@noble/hashes/src/blake3.ts +317 -0
  361. package/node_modules/@noble/hashes/src/eskdf.ts +259 -0
  362. package/node_modules/@noble/hashes/src/hkdf.ts +133 -0
  363. package/node_modules/@noble/hashes/src/hmac.ts +126 -0
  364. package/node_modules/@noble/hashes/src/index.ts +33 -0
  365. package/node_modules/@noble/hashes/src/legacy.ts +339 -0
  366. package/node_modules/@noble/hashes/src/pbkdf2.ts +175 -0
  367. package/node_modules/@noble/hashes/src/scrypt.ts +315 -0
  368. package/node_modules/@noble/hashes/src/sha2.ts +530 -0
  369. package/node_modules/@noble/hashes/src/sha3-addons.ts +983 -0
  370. package/node_modules/@noble/hashes/src/sha3.ts +485 -0
  371. package/node_modules/@noble/hashes/src/utils.ts +848 -0
  372. package/node_modules/@noble/hashes/src/webcrypto.ts +239 -0
  373. package/node_modules/@noble/hashes/utils.d.ts +519 -0
  374. package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
  375. package/node_modules/@noble/hashes/utils.js +578 -0
  376. package/node_modules/@noble/hashes/utils.js.map +1 -0
  377. package/node_modules/@noble/hashes/webcrypto.d.ts +120 -0
  378. package/node_modules/@noble/hashes/webcrypto.d.ts.map +1 -0
  379. package/node_modules/@noble/hashes/webcrypto.js +165 -0
  380. package/node_modules/@noble/hashes/webcrypto.js.map +1 -0
  381. package/node_modules/ws/LICENSE +20 -0
  382. package/node_modules/ws/README.md +548 -0
  383. package/node_modules/ws/browser.js +8 -0
  384. package/node_modules/ws/index.js +22 -0
  385. package/node_modules/ws/lib/buffer-util.js +131 -0
  386. package/node_modules/ws/lib/constants.js +19 -0
  387. package/node_modules/ws/lib/event-target.js +292 -0
  388. package/node_modules/ws/lib/extension.js +203 -0
  389. package/node_modules/ws/lib/limiter.js +55 -0
  390. package/node_modules/ws/lib/permessage-deflate.js +530 -0
  391. package/node_modules/ws/lib/receiver.js +743 -0
  392. package/node_modules/ws/lib/sender.js +607 -0
  393. package/node_modules/ws/lib/stream.js +161 -0
  394. package/node_modules/ws/lib/subprotocol.js +62 -0
  395. package/node_modules/ws/lib/validation.js +152 -0
  396. package/node_modules/ws/lib/websocket-server.js +562 -0
  397. package/node_modules/ws/lib/websocket.js +1407 -0
  398. package/node_modules/ws/package.json +74 -0
  399. package/node_modules/ws/wrapper.mjs +21 -0
  400. package/package.json +53 -0
@@ -0,0 +1,730 @@
1
+ /*
2
+ * @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
3
+ * @license BSD-3-Clause (see LICENSE.md in the root directory of this source tree)
4
+ */
5
+
6
+ import {requireNonNull, requireInstance} from './assert';
7
+ import {DateTimeException, UnsupportedTemporalTypeException} from './errors';
8
+ import {MathUtil} from './MathUtil';
9
+
10
+ import {ChronoField} from './temporal/ChronoField';
11
+ import {Clock} from './Clock';
12
+ import {DateTimeFormatter} from './format/DateTimeFormatter';
13
+ import {DateTimeFormatterBuilder} from './format/DateTimeFormatterBuilder';
14
+ import {IsoChronology} from './chrono/IsoChronology';
15
+ import {LocalDate} from './LocalDate';
16
+ import {Month} from './Month';
17
+ import {TemporalAccessor} from './temporal/TemporalAccessor';
18
+ import {TemporalQuery, createTemporalQuery} from './temporal/TemporalQuery';
19
+ import {TemporalQueries} from './temporal/TemporalQueries';
20
+ import {ValueRange} from './temporal/ValueRange';
21
+ import {Year} from './Year';
22
+ import {ZoneId} from './ZoneId';
23
+
24
+ /**
25
+ * A month-day in the ISO-8601 calendar system, such as `--12-03`.
26
+ *
27
+ * {@link MonthDay} is an immutable date-time object that represents the combination
28
+ * of a year and month. Any field that can be derived from a month and day, such as
29
+ * quarter-of-year, can be obtained.
30
+ *
31
+ * This class does not store or represent a year, time or time-zone.
32
+ * For example, the value "December 3rd" can be stored in a {@link MonthDay}.
33
+ *
34
+ * Since a {@link MonthDay} does not possess a year, the leap day of
35
+ * February 29th is considered valid.
36
+ *
37
+ * This class implements {@link TemporalAccessor} rather than {@link Temporal}.
38
+ * This is because it is not possible to define whether February 29th is valid or not
39
+ * without external information, preventing the implementation of plus/minus.
40
+ * Related to this, {@link MonthDay} only provides access to query and set the fields
41
+ * {@link MONTH_OF_YEAR} and {@link DAY_OF_MONTH}.
42
+ *
43
+ * The ISO-8601 calendar system is the modern civil calendar system used today
44
+ * in most of the world. It is equivalent to the proleptic Gregorian calendar
45
+ * system, in which today's rules for leap years are applied for all time.
46
+ * For most applications written today, the ISO-8601 rules are entirely suitable.
47
+ * However, any application that makes use of historical dates, and requires them
48
+ * to be accurate will find the ISO-8601 approach unsuitable.
49
+ *
50
+ * ### Specification for implementors
51
+ *
52
+ * This class is immutable and thread-safe.
53
+ */
54
+ export class MonthDay extends TemporalAccessor {
55
+ /**
56
+ * function overloading for {@link MonthDay.now}
57
+ *
58
+ * if called with 0 argument {@link MonthDay.now0} is executed,
59
+ *
60
+ * if called with 1 argument and first argument is an instance of ZoneId, then {@link MonthDay.nowZoneId} is executed,
61
+ *
62
+ * otherwise {@link MonthDay.nowClock} is executed
63
+ *
64
+ * @param {?(ZoneId|Clock)} zoneIdOrClock
65
+ * @returns {MonthDay}
66
+ */
67
+ static now(zoneIdOrClock) {
68
+ if (arguments.length === 0) {
69
+ return MonthDay.now0();
70
+ } else if (arguments.length === 1 && zoneIdOrClock instanceof ZoneId) {
71
+ return MonthDay.nowZoneId(zoneIdOrClock);
72
+ } else {
73
+ return MonthDay.nowClock(zoneIdOrClock);
74
+ }
75
+ }
76
+ /**
77
+ * Obtains the current month-day from the system clock in the default time-zone.
78
+ *
79
+ * This will query the system clock (see {@link Clock#systemDefaultZone}) in the default
80
+ * time-zone to obtain the current month-day.
81
+ *
82
+ * Using this method will prevent the ability to use an alternate clock for testing
83
+ * because the clock is hard-coded.
84
+ *
85
+ * @return {MonthDay} the current month-day using the system clock and default time-zone, not null
86
+ */
87
+ static now0() {
88
+ return this.nowClock(Clock.systemDefaultZone());
89
+ }
90
+
91
+ /**
92
+ * Obtains the current month-day from the system clock in the specified time-zone.
93
+ *
94
+ * This will query the system clock (see {@link Clock#system}) to obtain the current month-day.
95
+ * Specifying the time-zone avoids dependence on the default time-zone.
96
+ *
97
+ * Using this method will prevent the ability to use an alternate clock for testing
98
+ * because the clock is hard-coded.
99
+ *
100
+ * @param {ZoneId} zone the zone ID to use, not null
101
+ * @return {MonthDay} the current month-day using the system clock, not null
102
+ */
103
+ static nowZoneId(zone) {
104
+ requireNonNull(zone, 'zone');
105
+ return this.nowClock(Clock.system(zone));
106
+ }
107
+
108
+ /**
109
+ * Obtains the current month-day from the specified clock.
110
+ *
111
+ * This will query the specified clock to obtain the current month-day.
112
+ * Using this method allows the use of an alternate clock for testing.
113
+ * The alternate clock may be introduced using dependency injection (see {@link Clock}).
114
+ *
115
+ * @param {Clock} clock the clock to use, not null
116
+ * @return {MonthDay} the current month-day, not null
117
+ */
118
+ static nowClock(clock) {
119
+ requireNonNull(clock, 'clock');
120
+ const now = LocalDate.now(clock); // called once
121
+ return MonthDay.of(now.month(), now.dayOfMonth());
122
+ }
123
+ //-----------------------------------------------------------------------
124
+ /**
125
+ * function overloading for {@link MonthDay.of}
126
+ *
127
+ * if called with 2 argument and first argument is an instance of Month, then {@link MonthDay.ofMonthNumber} is executed,
128
+ *
129
+ * otherwise {@link MonthDay.ofNumberNumber} is executed
130
+ *
131
+ * @param {!(Month|number)} monthOrNumber
132
+ * @param {?number} number
133
+ * @returns {MonthDay}
134
+ */
135
+ static of(monthOrNumber, number) {
136
+ if (arguments.length === 2 && monthOrNumber instanceof Month) {
137
+ return MonthDay.ofMonthNumber(monthOrNumber, number);
138
+ } else {
139
+ return MonthDay.ofNumberNumber(monthOrNumber, number);
140
+ }
141
+ }
142
+ /**
143
+ * Obtains an instance of {@link MonthDay}.
144
+ *
145
+ * The day-of-month must be valid for the month within a leap year.
146
+ * Hence, for February, day 29 is valid.
147
+ *
148
+ * For example, passing in April and day 31 will throw an exception, as
149
+ * there can never be April 31st in any year. By contrast, passing in
150
+ * February 29th is permitted, as that month-day can sometimes be valid.
151
+ *
152
+ * @param {Month} month the month-of-year to represent, not null
153
+ * @param {number} dayOfMonth the day-of-month to represent, from 1 to 31
154
+ * @return {MonthDay} the month-day, not null
155
+ * @throws DateTimeException if the value of any field is out of range
156
+ * @throws DateTimeException if the day-of-month is invalid for the month
157
+ */
158
+ static ofMonthNumber(month, dayOfMonth) {
159
+ requireNonNull(month, 'month');
160
+ ChronoField.DAY_OF_MONTH.checkValidValue(dayOfMonth);
161
+ if (dayOfMonth > month.maxLength()) {
162
+ throw new DateTimeException('Illegal value for DayOfMonth field, value ' + dayOfMonth +
163
+ ' is not valid for month ' + month.toString());
164
+ }
165
+ return new MonthDay(month.value(), dayOfMonth);
166
+ }
167
+
168
+ /**
169
+ * Obtains an instance of {@link MonthDay}.
170
+ *
171
+ * The day-of-month must be valid for the month within a leap year.
172
+ * Hence, for month 2 (February), day 29 is valid.
173
+ *
174
+ * For example, passing in month 4 (April) and day 31 will throw an exception, as
175
+ * there can never be April 31st in any year. By contrast, passing in
176
+ * February 29th is permitted, as that month-day can sometimes be valid.
177
+ *
178
+ * @param {number} month the month-of-year to represent, from 1 (January) to 12 (December)
179
+ * @param {number} dayOfMonth the day-of-month to represent, from 1 to 31
180
+ * @return {MonthDay} the month-day, not null
181
+ * @throws DateTimeException if the value of any field is out of range
182
+ * @throws DateTimeException if the day-of-month is invalid for the month
183
+ */
184
+ static ofNumberNumber(month, dayOfMonth) {
185
+ requireNonNull(month, 'month');
186
+ requireNonNull(dayOfMonth, 'dayOfMonth');
187
+ return MonthDay.of(Month.of(month), dayOfMonth);
188
+ }
189
+ //-----------------------------------------------------------------------
190
+ /**
191
+ * Obtains an instance of {@link MonthDay} from a temporal object.
192
+ *
193
+ * A {@link TemporalAccessor} represents some form of date and time information.
194
+ * This factory converts the arbitrary temporal object to an instance of {@link MonthDay}.
195
+ *
196
+ * The conversion extracts the MONTH_OF_YEAR (see {@link ChronoField#MONTH_OF_YEAR}) and
197
+ * DAY_OF_MONTH (see {@link ChronoField#DAY_OF_MONTH}) fields.
198
+ * The extraction is only permitted if the date-time has an ISO chronology.
199
+ *
200
+ * This method matches the signature of the functional interface {@link TemporalQuery}
201
+ * allowing it to be used in queries via method reference, {@link MonthDay::from}.
202
+ *
203
+ * @param {TemporalAccessor} temporal the temporal object to convert, not null
204
+ * @return {MonthDay} the month-day, not null
205
+ * @throws DateTimeException if unable to convert to a {@link MonthDay}
206
+ */
207
+ static from(temporal) {
208
+ requireNonNull(temporal, 'temporal');
209
+ requireInstance(temporal, TemporalAccessor, 'temporal');
210
+ if (temporal instanceof MonthDay) {
211
+ return temporal;
212
+ }
213
+ try {
214
+ /* TODO: only IsoChronology for now
215
+ if (IsoChronology.INSTANCE.equals(Chronology.from(temporal)) == false) {
216
+ temporal = LocalDate.from(temporal);
217
+ }*/
218
+ return MonthDay.of(temporal.get(ChronoField.MONTH_OF_YEAR), temporal.get(ChronoField.DAY_OF_MONTH));
219
+ } catch (ex) {
220
+ throw new DateTimeException('Unable to obtain MonthDay from TemporalAccessor: ' +
221
+ temporal + ', type ' + (temporal && temporal.constructor != null ? temporal.constructor.name : ''));
222
+ }
223
+ }
224
+ //-----------------------------------------------------------------------
225
+ /**
226
+ * function overloading for {@link MonthDay.parse}
227
+ *
228
+ * if called with 1 argument, then {@link MonthDay.parseString} is executed,
229
+ *
230
+ * otherwise {@link MonthDay.parseStringFormatter} is executed
231
+ *
232
+ * @param {!(String)} text
233
+ * @param {?DateTimeFormatter} formatter
234
+ * @returns {MonthDay}
235
+ */
236
+ static parse(text, formatter) {
237
+ if (arguments.length === 1) {
238
+ return MonthDay.parseString(text);
239
+ } else {
240
+ return MonthDay.parseStringFormatter(text, formatter);
241
+ }
242
+ }
243
+
244
+ /**
245
+ * Obtains an instance of {@link MonthDay} from a text string such as `--12-03`.
246
+ *
247
+ * The string must represent a valid month-day.
248
+ * The format is `--MM-dd`.
249
+ *
250
+ * @param {String} text the text to parse such as "--12-03", not null
251
+ * @return {MonthDay} the parsed month-day, not null
252
+ * @throws DateTimeParseException if the text cannot be parsed
253
+ */
254
+ static parseString(text) {
255
+ return MonthDay.parseStringFormatter(text, PARSER);
256
+ }
257
+
258
+ /**
259
+ * Obtains an instance of {@link MonthDay} from a text string using a specific formatter.
260
+ *
261
+ * The text is parsed using the formatter, returning a month-day.
262
+ *
263
+ * @param {String} text the text to parse, not null
264
+ * @param {DateTimeFormatter} formatter the formatter to use, not null
265
+ * @return {MonthDay} the parsed month-day, not null
266
+ * @throws DateTimeParseException if the text cannot be parsed
267
+ */
268
+ static parseStringFormatter(text, formatter) {
269
+ requireNonNull(text, 'text');
270
+ requireNonNull(formatter, 'formatter');
271
+ requireInstance(formatter, DateTimeFormatter, 'formatter');
272
+ return formatter.parse(text, MonthDay.FROM);
273
+ }
274
+
275
+ //-----------------------------------------------------------------------
276
+ /**
277
+ * Constructor, previously validated.
278
+ *
279
+ * @param {number} month the month-of-year to represent, validated from 1 to 12
280
+ * @param {number} dayOfMonth the day-of-month to represent, validated from 1 to 29-31
281
+ * @private
282
+ */
283
+ constructor(month, dayOfMonth) {
284
+ super();
285
+ this._month = MathUtil.safeToInt(month);
286
+ this._day = MathUtil.safeToInt(dayOfMonth);
287
+ }
288
+
289
+ //-----------------------------------------------------------------------
290
+ /**
291
+ * Gets the month-of-year field from 1 to 12.
292
+ *
293
+ * This method returns the month as an `int` from 1 to 12.
294
+ * Application code is frequently clearer if the enum {@link Month}
295
+ * is used by calling {@link getMonth}.
296
+ *
297
+ * @return {number} the month-of-year, from 1 to 12
298
+ * @see #month()
299
+ */
300
+ monthValue() {
301
+ return this._month;
302
+ }
303
+
304
+ /**
305
+ * Gets the month-of-year field using the {@link Month} enum.
306
+ *
307
+ * This method returns the enum {@link Month} for the month.
308
+ * This avoids confusion as to what `int` values mean.
309
+ * If you need access to the primitive `int` value then the enum
310
+ * provides the int value (see {@link Month#getValue}).
311
+ *
312
+ * @return {Month} the month-of-year, not null
313
+ * @see #getMonthValue()
314
+ */
315
+ month() {
316
+ return Month.of(this._month);
317
+ }
318
+
319
+ /**
320
+ * Gets the day-of-month field.
321
+ *
322
+ * This method returns the primitive `int` value for the day-of-month.
323
+ *
324
+ * @return {number} the day-of-month, from 1 to 31
325
+ */
326
+ dayOfMonth() {
327
+ return this._day;
328
+ }
329
+
330
+ //-----------------------------------------------------------------------
331
+ /**
332
+ * Checks if the specified field is supported.
333
+ *
334
+ * This checks if this month-day can be queried for the specified field.
335
+ * If false, then calling the range (see {@link range}) and
336
+ * get (see {@link get}) methods will throw an exception.
337
+ *
338
+ * If the field is a {@link ChronoField} then the query is implemented here.
339
+ * The supported fields (see {@link isSupported}) will return valid
340
+ * values based on this date-time.
341
+ * The supported fields are:
342
+ *
343
+ * * {@link MONTH_OF_YEAR}
344
+ * * {@link YEAR}
345
+ *
346
+ * All other {@link ChronoField} instances will return false.
347
+ *
348
+ * If the field is not a {@link ChronoField}, then the result of this method
349
+ * is obtained by invoking {@link TemporalField.isSupportedBy}
350
+ * passing `this` as the argument.
351
+ * Whether the field is supported is determined by the field.
352
+ *
353
+ * @param {TemporalField} field the field to check, null returns false
354
+ * @return {boolean} true if the field is supported on this month-day, false if not
355
+ */
356
+ isSupported(field) {
357
+ if (field instanceof ChronoField) {
358
+ return field === ChronoField.MONTH_OF_YEAR || field === ChronoField.DAY_OF_MONTH;
359
+ }
360
+ return field != null && field.isSupportedBy(this);
361
+ }
362
+
363
+ /**
364
+ * Gets the range of valid values for the specified field.
365
+ *
366
+ * The range object expresses the minimum and maximum valid values for a field.
367
+ * This month-day is used to enhance the accuracy of the returned range.
368
+ * If it is not possible to return the range, because the field is not supported
369
+ * or for some other reason, an exception is thrown.
370
+ *
371
+ * If the field is a {@link ChronoField} then the query is implemented here.
372
+ * The supported fields (see {@link isSupported}) will return
373
+ * appropriate range instances.
374
+ * All other {@link ChronoField} instances will throw a {@link DateTimeException}.
375
+ *
376
+ * If the field is not a {@link ChronoField}, then the result of this method
377
+ * is obtained by invoking {@link TemporalField.rangeRefinedBy}
378
+ * passing `this` as the argument.
379
+ * Whether the range can be obtained is determined by the field.
380
+ *
381
+ * @param {TemporalField} field the field to query the range for, not null
382
+ * @return {ValueRange} the range of valid values for the field, not null
383
+ * @throws DateTimeException if the range for the field cannot be obtained
384
+ */
385
+ range(field) {
386
+ if (field === ChronoField.MONTH_OF_YEAR) {
387
+ return field.range();
388
+ } else if (field === ChronoField.DAY_OF_MONTH) {
389
+ return ValueRange.of(1, this.month().minLength(), this.month().maxLength());
390
+ }
391
+ return super.range(field);
392
+ }
393
+
394
+ /**
395
+ * Gets the value of the specified field from this month-day as an `int`.
396
+ *
397
+ * This queries this month-day for the value for the specified field.
398
+ * The returned value will always be within the valid range of values for the field.
399
+ * If it is not possible to return the value, because the field is not supported
400
+ * or for some other reason, an exception is thrown.
401
+ *
402
+ * If the field is a {@link ChronoField} then the query is implemented here.
403
+ * The supported fields (see {@link isSupported}) will return valid
404
+ * values based on this month-day.
405
+ * All other {@link ChronoField} instances will throw a {@link DateTimeException}.
406
+ *
407
+ * If the field is not a {@link ChronoField}, then the result of this method
408
+ * is obtained by invoking {@link TemporalField.getFrom}
409
+ * passing `this` as the argument. Whether the value can be obtained,
410
+ * and what the value represents, is determined by the field.
411
+ *
412
+ * @param {TemporalField} field the field to get, not null
413
+ * @return {number} the value for the field
414
+ * @throws DateTimeException if a value for the field cannot be obtained
415
+ * @throws ArithmeticException if numeric overflow occurs
416
+ */
417
+ get(field) {
418
+ return this.range(field).checkValidIntValue(this.getLong(field), field);
419
+ }
420
+
421
+ /**
422
+ * Gets the value of the specified field from this month-day as a `long`.
423
+ *
424
+ * This queries this month-day for the value for the specified field.
425
+ * If it is not possible to return the value, because the field is not supported
426
+ * or for some other reason, an exception is thrown.
427
+ *
428
+ * If the field is a {@link ChronoField} then the query is implemented here.
429
+ * The supported fields (see {@link isSupported}) will return valid
430
+ * values based on this month-day.
431
+ * All other {@link ChronoField} instances will throw a {@link DateTimeException}.
432
+ *
433
+ * If the field is not a {@link ChronoField}, then the result of this method
434
+ * is obtained by invoking {@link TemporalField.getFrom}
435
+ * passing `this` as the argument. Whether the value can be obtained,
436
+ * and what the value represents, is determined by the field.
437
+ *
438
+ * @param {TemporalField} field the field to get, not null
439
+ * @return {number} the value for the field
440
+ * @throws DateTimeException if a value for the field cannot be obtained
441
+ * @throws ArithmeticException if numeric overflow occurs
442
+ */
443
+ getLong(field) {
444
+ requireNonNull(field, 'field');
445
+ if (field instanceof ChronoField) {
446
+ switch (field) {
447
+ // alignedDOW and alignedWOM not supported because they cannot be set in with()
448
+ case ChronoField.DAY_OF_MONTH: return this._day;
449
+ case ChronoField.MONTH_OF_YEAR: return this._month;
450
+ }
451
+ throw new UnsupportedTemporalTypeException('Unsupported field: ' + field);
452
+ }
453
+ return field.getFrom(this);
454
+ }
455
+ //-----------------------------------------------------------------------
456
+ /**
457
+ * Checks if the year is valid for this month-day.
458
+ *
459
+ * This method checks whether this month and day and the input year form
460
+ * a valid date. This can only return false for February 29th.
461
+ *
462
+ * @param {number} year the year to validate, an out of range value returns false
463
+ * @return {boolean} true if the year is valid for this month-day
464
+ * @see Year#isValidMonthDay(MonthDay)
465
+ */
466
+ isValidYear(year) {
467
+ return (this._day === 29 && this._month === 2 && Year.isLeap(year) === false) === false;
468
+ }
469
+
470
+ //-----------------------------------------------------------------------
471
+ /**
472
+ * Returns a copy of this {@link MonthDay} with the month-of-year altered.
473
+ *
474
+ * This returns a month-day with the specified month.
475
+ * If the day-of-month is invalid for the specified month, the day will
476
+ * be adjusted to the last valid day-of-month.
477
+ *
478
+ * This instance is immutable and unaffected by this method call.
479
+ *
480
+ * @param {number} month the month-of-year to set in the returned month-day, from 1 (January) to 12 (December)
481
+ * @return {MonthDay} based on this month-day with the requested month, not null
482
+ * @throws DateTimeException if the month-of-year value is invalid
483
+ */
484
+ withMonth(month) {
485
+ return this.with(Month.of(month));
486
+ }
487
+
488
+ /**
489
+ * Returns a copy of this {@link MonthDay} with the month-of-year altered.
490
+ *
491
+ * This returns a month-day with the specified month.
492
+ * If the day-of-month is invalid for the specified month, the day will
493
+ * be adjusted to the last valid day-of-month.
494
+ *
495
+ * This instance is immutable and unaffected by this method call.
496
+ *
497
+ * @param {Month} month the month-of-year to set in the returned month-day, not null
498
+ * @return {MonthDay} based on this month-day with the requested month, not null
499
+ */
500
+ with(month) {
501
+ requireNonNull(month, 'month');
502
+ if (month.value() === this._month) {
503
+ return this;
504
+ }
505
+ const day = Math.min(this._day, month.maxLength());
506
+ return new MonthDay(month.value(), day);
507
+ }
508
+
509
+ /**
510
+ * Returns a copy of this {@link MonthDay} with the day-of-month altered.
511
+ *
512
+ * This returns a month-day with the specified day-of-month.
513
+ * If the day-of-month is invalid for the month, an exception is thrown.
514
+ *
515
+ * This instance is immutable and unaffected by this method call.
516
+ *
517
+ * @param {number} dayOfMonth the day-of-month to set in the return month-day, from 1 to 31
518
+ * @return {MonthDay} based on this month-day with the requested day, not null
519
+ * @throws DateTimeException if the day-of-month value is invalid
520
+ * @throws DateTimeException if the day-of-month is invalid for the month
521
+ */
522
+ withDayOfMonth(dayOfMonth) {
523
+ if (dayOfMonth === this._day) {
524
+ return this;
525
+ }
526
+ return MonthDay.of(this._month, dayOfMonth);
527
+ }
528
+
529
+ //-----------------------------------------------------------------------
530
+ /**
531
+ * Queries this month-day using the specified query.
532
+ *
533
+ * This queries this month-day using the specified query strategy object.
534
+ * The {@link TemporalQuery} object defines the logic to be used to
535
+ * obtain the result. Read the documentation of the query to understand
536
+ * what the result of this method will be.
537
+ *
538
+ * The result of this method is obtained by invoking the
539
+ * {@link TemporalQuery#queryFrom} method on the
540
+ * specified query passing `this` as the argument.
541
+ *
542
+ * @param {TemporalQuery} query the query to invoke, not null
543
+ * @return {*} the query result, null may be returned (defined by the query)
544
+ * @throws DateTimeException if unable to query (defined by the query)
545
+ * @throws ArithmeticException if numeric overflow occurs (defined by the query)
546
+ */
547
+ query(query) {
548
+ requireNonNull(query, 'query');
549
+ requireInstance(query, TemporalQuery, 'query');
550
+ if (query === TemporalQueries.chronology()) {
551
+ return IsoChronology.INSTANCE;
552
+ }
553
+ return super.query(query);
554
+ }
555
+
556
+ /**
557
+ * Adjusts the specified temporal object to have this month-day.
558
+ *
559
+ * This returns a temporal object of the same observable type as the input
560
+ * with the month and day-of-month changed to be the same as this.
561
+ *
562
+ * The adjustment is equivalent to using {@link Temporal#with}
563
+ * twice, passing {@link ChronoField#MONTH_OF_YEAR} and
564
+ * {@link ChronoField#DAY_OF_MONTH} as the fields.
565
+ * If the specified temporal object does not use the ISO calendar system then
566
+ * a {@link DateTimeException} is thrown.
567
+ *
568
+ * In most cases, it is clearer to reverse the calling pattern by using
569
+ * {@link Temporal#with}:
570
+ * <pre>
571
+ * // these two lines are equivalent, but the second approach is recommended
572
+ * temporal = thisMonthDay.adjustInto(temporal);
573
+ * temporal = temporal.with(thisMonthDay);
574
+ * </pre>
575
+ *
576
+ * This instance is immutable and unaffected by this method call.
577
+ *
578
+ * @param {Temporal} temporal the target object to be adjusted, not null
579
+ * @return {Temporal} the adjusted object, not null
580
+ * @throws DateTimeException if unable to make the adjustment
581
+ * @throws ArithmeticException if numeric overflow occurs
582
+ */
583
+ adjustInto(temporal) {
584
+ requireNonNull(temporal, 'temporal');
585
+ /* TODO: only IsoChronology for now
586
+ if (Chronology.from(temporal).equals(IsoChronology.INSTANCE) == false) {
587
+ throw new DateTimeException("Adjustment only supported on ISO date-time");
588
+ }*/
589
+ temporal = temporal.with(ChronoField.MONTH_OF_YEAR, this._month);
590
+ return temporal.with(ChronoField.DAY_OF_MONTH, Math.min(temporal.range(ChronoField.DAY_OF_MONTH).maximum(), this._day));
591
+ }
592
+
593
+ //-----------------------------------------------------------------------
594
+ /**
595
+ * Combines this month-day with a year to create a {@link LocalDate}.
596
+ *
597
+ * This returns a {@link LocalDate} formed from this month-day and the specified year.
598
+ *
599
+ * A month-day of February 29th will be adjusted to February 28th in the resulting
600
+ * date if the year is not a leap year.
601
+ *
602
+ * This instance is immutable and unaffected by this method call.
603
+ *
604
+ * @param {number} year the year to use, from MIN_YEAR to MAX_YEAR
605
+ * @return {LocalDate} the local date formed from this month-day and the specified year, not null
606
+ * @throws DateTimeException if the year is outside the valid range of years
607
+ */
608
+ atYear(year) {
609
+ return LocalDate.of(year, this._month, this.isValidYear(year) ? this._day : 28);
610
+ }
611
+ //-----------------------------------------------------------------------
612
+ /**
613
+ * Compares this month-day to another month-day.
614
+ *
615
+ * The comparison is based first on value of the month, then on the value of the day.
616
+ * It is "consistent with equals", as defined by {@link Comparable}.
617
+ *
618
+ * @param {MonthDay} other the other month-day to compare to, not null
619
+ * @return {number} the comparator value, negative if less, positive if greater
620
+ */
621
+ compareTo(other) {
622
+ requireNonNull(other, 'other');
623
+ requireInstance(other, MonthDay, 'other');
624
+ let cmp = (this._month - other.monthValue());
625
+ if (cmp === 0) {
626
+ cmp = (this._day - other.dayOfMonth());
627
+ }
628
+ return cmp;
629
+ }
630
+
631
+ /**
632
+ * Is this month-day after the specified month-day.
633
+ *
634
+ * @param {MonthDay} other the other month-day to compare to, not null
635
+ * @return {boolean} true if this is after the specified month-day
636
+ */
637
+ isAfter(other) {
638
+ requireNonNull(other, 'other');
639
+ requireInstance(other, MonthDay, 'other');
640
+ return this.compareTo(other) > 0;
641
+ }
642
+
643
+ /**
644
+ * Is this month-day before the specified month-day.
645
+ *
646
+ * @param {MonthDay} other the other month-day to compare to, not null
647
+ * @return {boolean} true if this point is before the specified month-day
648
+ */
649
+ isBefore(other) {
650
+ requireNonNull(other, 'other');
651
+ requireInstance(other, MonthDay, 'other');
652
+ return this.compareTo(other) < 0;
653
+ }
654
+
655
+
656
+ //-----------------------------------------------------------------------
657
+ /**
658
+ * Checks if this month-day is equal to another month-day.
659
+ *
660
+ * The comparison is based on the time-line position of the month-day within a year.
661
+ *
662
+ * @param {*} obj the object to check, null returns false
663
+ * @return {boolean} true if this is equal to the other month-day
664
+ */
665
+ equals(obj) {
666
+ if (this === obj) {
667
+ return true;
668
+ }
669
+ if (obj instanceof MonthDay) {
670
+ const other = obj;
671
+ return this.monthValue() === other.monthValue() && this.dayOfMonth() === other.dayOfMonth();
672
+ }
673
+ return false;
674
+ }
675
+ //-----------------------------------------------------------------------
676
+ /**
677
+ * Outputs this month-day as a string, such as `--12-03`.
678
+ *
679
+ * The output will be in the format `--MM-dd`:
680
+ *
681
+ * @return {String} a string representation of this month-day, not null
682
+ */
683
+ toString() {
684
+ return '--'
685
+ + (this._month < 10 ? '0' : '') + this._month
686
+ + (this._day < 10 ? '-0' : '-') + this._day;
687
+ }
688
+
689
+ /**
690
+ * toJSON() use by JSON.stringify
691
+ * delegates to toString()
692
+ *
693
+ * @return {string}
694
+ */
695
+ toJSON() {
696
+ return this.toString();
697
+ }
698
+
699
+ /**
700
+ * Outputs this month-day as a string using the formatter.
701
+ *
702
+ * This month-day will be passed to the formatter
703
+ * print method (see {@link DateTimeFormatter#format}).
704
+ *
705
+ * @param {DateTimeFormatter} formatter the formatter to use, not null
706
+ * @return {String} the formatted month-day string, not null
707
+ * @throws DateTimeException if an error occurs during printing
708
+ */
709
+ format(formatter) {
710
+ requireNonNull(formatter, 'formatter');
711
+ requireInstance(formatter, DateTimeFormatter, 'formatter');
712
+ return formatter.format(this);
713
+ }
714
+
715
+ }
716
+
717
+ let PARSER;
718
+
719
+ export function _init() {
720
+ PARSER = new DateTimeFormatterBuilder()
721
+ .appendLiteral('--')
722
+ .appendValue(ChronoField.MONTH_OF_YEAR, 2)
723
+ .appendLiteral('-')
724
+ .appendValue(ChronoField.DAY_OF_MONTH, 2)
725
+ .toFormatter();
726
+
727
+ MonthDay.FROM = createTemporalQuery('MonthDay.FROM', (temporal) => {
728
+ return MonthDay.from(temporal);
729
+ });
730
+ }