@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.
- package/LICENSE +28 -0
- package/README.md +707 -0
- package/dist/application/app.d.ts +138 -0
- package/dist/application/app.js +654 -0
- package/dist/application/operations.d.ts +9 -0
- package/dist/application/operations.js +96 -0
- package/dist/cli/cli.d.ts +1 -0
- package/dist/cli/cli.js +460 -0
- package/dist/cli/help.d.ts +4 -0
- package/dist/cli/help.js +49 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +13 -0
- package/dist/cli/onboarding.d.ts +14 -0
- package/dist/cli/onboarding.js +144 -0
- package/dist/cli/output.d.ts +2 -0
- package/dist/cli/output.js +231 -0
- package/dist/cli/terminal.d.ts +6 -0
- package/dist/cli/terminal.js +92 -0
- package/dist/cli/update-check.d.ts +1 -0
- package/dist/cli/update-check.js +12 -0
- package/dist/cli/updates.d.ts +2 -0
- package/dist/cli/updates.js +98 -0
- package/dist/core.d.ts +14 -0
- package/dist/core.js +14 -0
- package/dist/doctor/credential-probe.d.ts +7 -0
- package/dist/doctor/credential-probe.js +49 -0
- package/dist/doctor/doctor.d.ts +4 -0
- package/dist/doctor/doctor.js +213 -0
- package/dist/doctor/keyring.d.ts +7 -0
- package/dist/doctor/keyring.js +150 -0
- package/dist/doctor/profile.d.ts +19 -0
- package/dist/doctor/profile.js +73 -0
- package/dist/doctor/types.d.ts +40 -0
- package/dist/doctor/types.js +1 -0
- package/dist/domain/amount.d.ts +6 -0
- package/dist/domain/amount.js +27 -0
- package/dist/domain/errors.d.ts +10 -0
- package/dist/domain/errors.js +16 -0
- package/dist/labels/directory.d.ts +87 -0
- package/dist/labels/directory.js +140 -0
- package/dist/labels/personal.d.ts +17 -0
- package/dist/labels/personal.js +56 -0
- package/dist/labels/presentation.d.ts +154 -0
- package/dist/labels/presentation.js +90 -0
- package/dist/network/reader.d.ts +31 -0
- package/dist/network/reader.js +370 -0
- package/dist/network/retry.d.ts +7 -0
- package/dist/network/retry.js +53 -0
- package/dist/network/work.d.ts +3 -0
- package/dist/network/work.js +66 -0
- package/dist/pricing/market.d.ts +29 -0
- package/dist/pricing/market.js +150 -0
- package/dist/pricing/terms.d.ts +6 -0
- package/dist/pricing/terms.js +12 -0
- package/dist/spending/destination.d.ts +16 -0
- package/dist/spending/destination.js +42 -0
- package/dist/spending/journal.d.ts +28 -0
- package/dist/spending/journal.js +69 -0
- package/dist/spending/ledger.d.ts +118 -0
- package/dist/spending/ledger.js +444 -0
- package/dist/spending/payments.d.ts +67 -0
- package/dist/spending/payments.js +424 -0
- package/dist/spending/pool.d.ts +13 -0
- package/dist/spending/pool.js +38 -0
- package/dist/spending/reconcile.d.ts +18 -0
- package/dist/spending/reconcile.js +64 -0
- package/dist/storage/profiles.d.ts +13 -0
- package/dist/storage/profiles.js +86 -0
- package/dist/storage/secrets.d.ts +16 -0
- package/dist/storage/secrets.js +104 -0
- package/dist/storage/state.d.ts +32 -0
- package/dist/storage/state.js +255 -0
- package/dist/wallet/auto-receive.d.ts +57 -0
- package/dist/wallet/auto-receive.js +140 -0
- package/dist/wallet/defaults.d.ts +3 -0
- package/dist/wallet/defaults.js +26 -0
- package/dist/wallet/signing.d.ts +17 -0
- package/dist/wallet/signing.js +128 -0
- package/dist/wallet/types.d.ts +65 -0
- package/dist/wallet/types.js +1 -0
- package/dist/wallet/work.d.ts +29 -0
- package/dist/wallet/work.js +154 -0
- package/dist/watches/manager.d.ts +75 -0
- package/dist/watches/manager.js +197 -0
- package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs +6678 -0
- package/node_modules/@attocash/commons-core/Kotlin-DateTime-library-kotlinx-datetime.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/LICENSE +28 -0
- package/node_modules/@attocash/commons-core/README.md +118 -0
- package/node_modules/@attocash/commons-core/commons-commons-core.d.mts +1036 -0
- package/node_modules/@attocash/commons-core/commons-commons-core.mjs +7701 -0
- package/node_modules/@attocash/commons-core/commons-commons-core.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs +17681 -0
- package/node_modules/@attocash/commons-core/kotlin-kotlin-stdlib.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs +4 -0
- package/node_modules/@attocash/commons-core/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs +209 -0
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-bytestring.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs +2284 -0
- package/node_modules/@attocash/commons-core/kotlinx-io-kotlinx-io-core.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs +6042 -0
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-core.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
- package/node_modules/@attocash/commons-core/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/node_modules/@attocash/commons-core/package.json +27 -0
- package/node_modules/@attocash/commons-node/LICENSE +28 -0
- package/node_modules/@attocash/commons-node/README.md +92 -0
- package/node_modules/@attocash/commons-node/commons-commons-node.d.mts +255 -0
- package/node_modules/@attocash/commons-node/commons-commons-node.mjs +2977 -0
- package/node_modules/@attocash/commons-node/commons-commons-node.mjs.map +1 -0
- package/node_modules/@attocash/commons-node/kotlin-logging.mjs +432 -0
- package/node_modules/@attocash/commons-node/kotlin-logging.mjs.map +1 -0
- package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
- package/node_modules/@attocash/commons-node/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/node_modules/@attocash/commons-node/package.json +29 -0
- package/node_modules/@attocash/commons-node-remote/LICENSE +28 -0
- package/node_modules/@attocash/commons-node-remote/README.md +61 -0
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.d.mts +122 -0
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs +1810 -0
- package/node_modules/@attocash/commons-node-remote/commons-commons-node-remote.mjs.map +1 -0
- package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs +432 -0
- package/node_modules/@attocash/commons-node-remote/kotlin-logging.mjs.map +1 -0
- package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs +8 -0
- package/node_modules/@attocash/commons-node-remote/kotlinx-browser.mjs.map +1 -0
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
- package/node_modules/@attocash/commons-node-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/node_modules/@attocash/commons-node-remote/package.json +31 -0
- package/node_modules/@attocash/commons-transport/LICENSE +28 -0
- package/node_modules/@attocash/commons-transport/README.md +5 -0
- package/node_modules/@attocash/commons-transport/commons-commons-transport.d.mts +64 -0
- package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs +249 -0
- package/node_modules/@attocash/commons-transport/commons-commons-transport.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs +263 -0
- package/node_modules/@attocash/commons-transport/kotlinx-atomicfu.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs +8 -0
- package/node_modules/@attocash/commons-transport/kotlinx-browser.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs +11604 -0
- package/node_modules/@attocash/commons-transport/kotlinx-coroutines-core.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
- package/node_modules/@attocash/commons-transport/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs +499 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-content-negotiation.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs +6456 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-client-core.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs +83 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-events.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs +1714 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-http-cio.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs +3197 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-http.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs +2290 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-io.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs +46 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx-json.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs +482 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization-kotlinx.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs +165 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-serialization.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs +4 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-sse.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs +3222 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-utils.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs +4 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-websocket-serialization.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs +1485 -0
- package/node_modules/@attocash/commons-transport/ktor-ktor-websockets.mjs.map +1 -0
- package/node_modules/@attocash/commons-transport/package.json +29 -0
- package/node_modules/@attocash/commons-worker/LICENSE +28 -0
- package/node_modules/@attocash/commons-worker/README.md +48 -0
- package/node_modules/@attocash/commons-worker/commons-commons-worker.d.mts +73 -0
- package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs +702 -0
- package/node_modules/@attocash/commons-worker/commons-commons-worker.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker/kotlin-logging.mjs +432 -0
- package/node_modules/@attocash/commons-worker/kotlin-logging.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
- package/node_modules/@attocash/commons-worker/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker/package.json +29 -0
- package/node_modules/@attocash/commons-worker-remote/LICENSE +28 -0
- package/node_modules/@attocash/commons-worker-remote/README.md +60 -0
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.d.mts +93 -0
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs +289 -0
- package/node_modules/@attocash/commons-worker-remote/commons-commons-worker-remote.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs +432 -0
- package/node_modules/@attocash/commons-worker-remote/kotlin-logging.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs +8 -0
- package/node_modules/@attocash/commons-worker-remote/kotlinx-browser.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs +4 -0
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json-io.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs +5294 -0
- package/node_modules/@attocash/commons-worker-remote/kotlinx-serialization-kotlinx-serialization-json.mjs.map +1 -0
- package/node_modules/@attocash/commons-worker-remote/package.json +31 -0
- package/node_modules/@js-joda/core/CHANGELOG.md +363 -0
- package/node_modules/@js-joda/core/CheatSheet.md +947 -0
- package/node_modules/@js-joda/core/LICENSE +34 -0
- package/node_modules/@js-joda/core/README.md +155 -0
- package/node_modules/@js-joda/core/bower.json +21 -0
- package/node_modules/@js-joda/core/dist/js-joda.d.ts +2452 -0
- package/node_modules/@js-joda/core/dist/js-joda.esm.js +13564 -0
- package/node_modules/@js-joda/core/dist/js-joda.flow.js +949 -0
- package/node_modules/@js-joda/core/dist/js-joda.js +13630 -0
- package/node_modules/@js-joda/core/dist/js-joda.js.map +1 -0
- package/node_modules/@js-joda/core/dist/js-joda.min.js +5 -0
- package/node_modules/@js-joda/core/package.json +76 -0
- package/node_modules/@js-joda/core/src/Clock.js +330 -0
- package/node_modules/@js-joda/core/src/DayOfWeek.js +451 -0
- package/node_modules/@js-joda/core/src/Duration.js +1205 -0
- package/node_modules/@js-joda/core/src/Enum.js +30 -0
- package/node_modules/@js-joda/core/src/Instant.js +1012 -0
- package/node_modules/@js-joda/core/src/LocalDate.js +1703 -0
- package/node_modules/@js-joda/core/src/LocalDateTime.js +1686 -0
- package/node_modules/@js-joda/core/src/LocalTime.js +1415 -0
- package/node_modules/@js-joda/core/src/MathUtil.js +236 -0
- package/node_modules/@js-joda/core/src/Month.js +600 -0
- package/node_modules/@js-joda/core/src/MonthDay.js +730 -0
- package/node_modules/@js-joda/core/src/OffsetDateTime.js +757 -0
- package/node_modules/@js-joda/core/src/OffsetTime.js +621 -0
- package/node_modules/@js-joda/core/src/Period.js +933 -0
- package/node_modules/@js-joda/core/src/StringUtil.js +43 -0
- package/node_modules/@js-joda/core/src/Year.js +1015 -0
- package/node_modules/@js-joda/core/src/YearConstants.js +21 -0
- package/node_modules/@js-joda/core/src/YearMonth.js +1096 -0
- package/node_modules/@js-joda/core/src/ZoneId.js +236 -0
- package/node_modules/@js-joda/core/src/ZoneIdFactory.js +201 -0
- package/node_modules/@js-joda/core/src/ZoneOffset.js +486 -0
- package/node_modules/@js-joda/core/src/ZoneRegion.js +72 -0
- package/node_modules/@js-joda/core/src/ZonedDateTime.js +2007 -0
- package/node_modules/@js-joda/core/src/_init.js +68 -0
- package/node_modules/@js-joda/core/src/assert.js +33 -0
- package/node_modules/@js-joda/core/src/chrono/ChronoLocalDate.js +230 -0
- package/node_modules/@js-joda/core/src/chrono/ChronoLocalDateTime.js +130 -0
- package/node_modules/@js-joda/core/src/chrono/ChronoZonedDateTime.js +194 -0
- package/node_modules/@js-joda/core/src/chrono/IsoChronology.js +235 -0
- package/node_modules/@js-joda/core/src/convert.js +83 -0
- package/node_modules/@js-joda/core/src/errors.js +54 -0
- package/node_modules/@js-joda/core/src/format/DateTimeBuilder.js +535 -0
- package/node_modules/@js-joda/core/src/format/DateTimeFormatter.js +728 -0
- package/node_modules/@js-joda/core/src/format/DateTimeFormatterBuilder.js +1545 -0
- package/node_modules/@js-joda/core/src/format/DateTimeParseContext.js +297 -0
- package/node_modules/@js-joda/core/src/format/DateTimePrintContext.js +138 -0
- package/node_modules/@js-joda/core/src/format/DecimalStyle.js +113 -0
- package/node_modules/@js-joda/core/src/format/EnumMap.js +70 -0
- package/node_modules/@js-joda/core/src/format/ParsePosition.js +31 -0
- package/node_modules/@js-joda/core/src/format/ResolverStyle.js +93 -0
- package/node_modules/@js-joda/core/src/format/SignStyle.js +38 -0
- package/node_modules/@js-joda/core/src/format/StringBuilder.js +47 -0
- package/node_modules/@js-joda/core/src/format/TextStyle.js +114 -0
- package/node_modules/@js-joda/core/src/format/parser/CharLiteralPrinterParser.js +46 -0
- package/node_modules/@js-joda/core/src/format/parser/CompositePrinterParser.js +89 -0
- package/node_modules/@js-joda/core/src/format/parser/FractionPrinterParser.js +162 -0
- package/node_modules/@js-joda/core/src/format/parser/NumberPrinterParser.js +367 -0
- package/node_modules/@js-joda/core/src/format/parser/OffsetIdPrinterParser.js +177 -0
- package/node_modules/@js-joda/core/src/format/parser/PadPrinterParserDecorator.js +81 -0
- package/node_modules/@js-joda/core/src/format/parser/SettingsParser.js +44 -0
- package/node_modules/@js-joda/core/src/format/parser/StringLiteralPrinterParser.js +39 -0
- package/node_modules/@js-joda/core/src/format/parser/ZoneIdPrinterParser.js +218 -0
- package/node_modules/@js-joda/core/src/js-joda.js +210 -0
- package/node_modules/@js-joda/core/src/license-preamble.js +3 -0
- package/node_modules/@js-joda/core/src/temporal/ChronoField.js +470 -0
- package/node_modules/@js-joda/core/src/temporal/ChronoUnit.js +310 -0
- package/node_modules/@js-joda/core/src/temporal/DefaultInterfaceTemporal.js +118 -0
- package/node_modules/@js-joda/core/src/temporal/IsoFields.js +859 -0
- package/node_modules/@js-joda/core/src/temporal/NativeJsTemporal.js +105 -0
- package/node_modules/@js-joda/core/src/temporal/Temporal.js +346 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAccessor.js +125 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAdjuster.js +92 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAdjusters.js +464 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalAmount.js +166 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalField.js +248 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalQueries.js +223 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalQueriesFactory.js +77 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalQuery.js +107 -0
- package/node_modules/@js-joda/core/src/temporal/TemporalUnit.js +179 -0
- package/node_modules/@js-joda/core/src/temporal/ValueRange.js +257 -0
- package/node_modules/@js-joda/core/src/use.js +20 -0
- package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneId.js +31 -0
- package/node_modules/@js-joda/core/src/zone/SystemDefaultZoneRules.js +162 -0
- package/node_modules/@js-joda/core/src/zone/ZoneOffsetTransition.js +289 -0
- package/node_modules/@js-joda/core/src/zone/ZoneRules.js +464 -0
- package/node_modules/@js-joda/core/src/zone/ZoneRulesProvider.js +36 -0
- package/node_modules/@noble/hashes/LICENSE +21 -0
- package/node_modules/@noble/hashes/README.md +563 -0
- package/node_modules/@noble/hashes/_blake.d.ts +21 -0
- package/node_modules/@noble/hashes/_blake.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_blake.js +52 -0
- package/node_modules/@noble/hashes/_blake.js.map +1 -0
- package/node_modules/@noble/hashes/_md.d.ts +99 -0
- package/node_modules/@noble/hashes/_md.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_md.js +202 -0
- package/node_modules/@noble/hashes/_md.js.map +1 -0
- package/node_modules/@noble/hashes/_u64.d.ts +63 -0
- package/node_modules/@noble/hashes/_u64.d.ts.map +1 -0
- package/node_modules/@noble/hashes/_u64.js +84 -0
- package/node_modules/@noble/hashes/_u64.js.map +1 -0
- package/node_modules/@noble/hashes/argon2.d.ts +112 -0
- package/node_modules/@noble/hashes/argon2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/argon2.js +517 -0
- package/node_modules/@noble/hashes/argon2.js.map +1 -0
- package/node_modules/@noble/hashes/blake1.d.ts +156 -0
- package/node_modules/@noble/hashes/blake1.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake1.js +560 -0
- package/node_modules/@noble/hashes/blake1.js.map +1 -0
- package/node_modules/@noble/hashes/blake2.d.ts +184 -0
- package/node_modules/@noble/hashes/blake2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake2.js +501 -0
- package/node_modules/@noble/hashes/blake2.js.map +1 -0
- package/node_modules/@noble/hashes/blake3.d.ts +68 -0
- package/node_modules/@noble/hashes/blake3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/blake3.js +284 -0
- package/node_modules/@noble/hashes/blake3.js.map +1 -0
- package/node_modules/@noble/hashes/eskdf.d.ts +92 -0
- package/node_modules/@noble/hashes/eskdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/eskdf.js +218 -0
- package/node_modules/@noble/hashes/eskdf.js.map +1 -0
- package/node_modules/@noble/hashes/hkdf.d.ts +64 -0
- package/node_modules/@noble/hashes/hkdf.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hkdf.js +120 -0
- package/node_modules/@noble/hashes/hkdf.js.map +1 -0
- package/node_modules/@noble/hashes/hmac.d.ts +47 -0
- package/node_modules/@noble/hashes/hmac.d.ts.map +1 -0
- package/node_modules/@noble/hashes/hmac.js +93 -0
- package/node_modules/@noble/hashes/hmac.js.map +1 -0
- package/node_modules/@noble/hashes/index.d.ts +2 -0
- package/node_modules/@noble/hashes/index.d.ts.map +1 -0
- package/node_modules/@noble/hashes/index.js +35 -0
- package/node_modules/@noble/hashes/index.js.map +1 -0
- package/node_modules/@noble/hashes/legacy.d.ts +102 -0
- package/node_modules/@noble/hashes/legacy.d.ts.map +1 -0
- package/node_modules/@noble/hashes/legacy.js +327 -0
- package/node_modules/@noble/hashes/legacy.js.map +1 -0
- package/node_modules/@noble/hashes/package.json +97 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts +56 -0
- package/node_modules/@noble/hashes/pbkdf2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/pbkdf2.js +135 -0
- package/node_modules/@noble/hashes/pbkdf2.js.map +1 -0
- package/node_modules/@noble/hashes/scrypt.d.ts +65 -0
- package/node_modules/@noble/hashes/scrypt.d.ts.map +1 -0
- package/node_modules/@noble/hashes/scrypt.js +257 -0
- package/node_modules/@noble/hashes/scrypt.js.map +1 -0
- package/node_modules/@noble/hashes/sha2.d.ts +249 -0
- package/node_modules/@noble/hashes/sha2.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha2.js +458 -0
- package/node_modules/@noble/hashes/sha2.js.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts +461 -0
- package/node_modules/@noble/hashes/sha3-addons.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3-addons.js +783 -0
- package/node_modules/@noble/hashes/sha3-addons.js.map +1 -0
- package/node_modules/@noble/hashes/sha3.d.ts +199 -0
- package/node_modules/@noble/hashes/sha3.d.ts.map +1 -0
- package/node_modules/@noble/hashes/sha3.js +431 -0
- package/node_modules/@noble/hashes/sha3.js.map +1 -0
- package/node_modules/@noble/hashes/src/_blake.ts +57 -0
- package/node_modules/@noble/hashes/src/_md.ts +222 -0
- package/node_modules/@noble/hashes/src/_u64.ts +117 -0
- package/node_modules/@noble/hashes/src/argon2.ts +667 -0
- package/node_modules/@noble/hashes/src/blake1.ts +614 -0
- package/node_modules/@noble/hashes/src/blake2.ts +582 -0
- package/node_modules/@noble/hashes/src/blake3.ts +317 -0
- package/node_modules/@noble/hashes/src/eskdf.ts +259 -0
- package/node_modules/@noble/hashes/src/hkdf.ts +133 -0
- package/node_modules/@noble/hashes/src/hmac.ts +126 -0
- package/node_modules/@noble/hashes/src/index.ts +33 -0
- package/node_modules/@noble/hashes/src/legacy.ts +339 -0
- package/node_modules/@noble/hashes/src/pbkdf2.ts +175 -0
- package/node_modules/@noble/hashes/src/scrypt.ts +315 -0
- package/node_modules/@noble/hashes/src/sha2.ts +530 -0
- package/node_modules/@noble/hashes/src/sha3-addons.ts +983 -0
- package/node_modules/@noble/hashes/src/sha3.ts +485 -0
- package/node_modules/@noble/hashes/src/utils.ts +848 -0
- package/node_modules/@noble/hashes/src/webcrypto.ts +239 -0
- package/node_modules/@noble/hashes/utils.d.ts +519 -0
- package/node_modules/@noble/hashes/utils.d.ts.map +1 -0
- package/node_modules/@noble/hashes/utils.js +578 -0
- package/node_modules/@noble/hashes/utils.js.map +1 -0
- package/node_modules/@noble/hashes/webcrypto.d.ts +120 -0
- package/node_modules/@noble/hashes/webcrypto.d.ts.map +1 -0
- package/node_modules/@noble/hashes/webcrypto.js +165 -0
- package/node_modules/@noble/hashes/webcrypto.js.map +1 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +530 -0
- package/node_modules/ws/lib/receiver.js +743 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- 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
|
+
}
|