@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,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
3
|
+
* @copyright (c) 2007-present, Stephen Colebourne & Michael Nascimento Santos
|
|
4
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {MathUtil} from '../MathUtil';
|
|
8
|
+
|
|
9
|
+
import {Duration} from '../Duration';
|
|
10
|
+
import {YearConstants} from '../YearConstants';
|
|
11
|
+
import {TemporalUnit} from './TemporalUnit';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A standard set of date periods units.
|
|
15
|
+
*
|
|
16
|
+
* This set of units provide unit-based access to manipulate a date, time or date-time.
|
|
17
|
+
* The standard set of units can be extended by implementing {@link TemporalUnit}.
|
|
18
|
+
*
|
|
19
|
+
* These units are intended to be applicable in multiple calendar systems.
|
|
20
|
+
* For example, most non-ISO calendar systems define units of years, months and days,
|
|
21
|
+
* just with slightly different rules.
|
|
22
|
+
* The documentation of each unit explains how it operates.
|
|
23
|
+
*
|
|
24
|
+
* ### Static properties:
|
|
25
|
+
*
|
|
26
|
+
* - `ChronoUnit.CENTURIES`: Unit that represents the concept of a century. For the ISO calendar
|
|
27
|
+
* system, it is equal to 100 years.
|
|
28
|
+
*
|
|
29
|
+
* - `ChronoUnit.DAYS`: Unit that represents the concept of a day. For the ISO calendar system, it
|
|
30
|
+
* is the standard day from midnight to midnight. The estimated duration of a day is 24 Hours.
|
|
31
|
+
*
|
|
32
|
+
* - `ChronoUnit.DECADES`: Unit that represents the concept of a decade. For the ISO calendar system,
|
|
33
|
+
* it is equal to 10 years.
|
|
34
|
+
*
|
|
35
|
+
* - `ChronoUnit.ERAS`: Unit that represents the concept of an era. The ISO calendar system doesn't
|
|
36
|
+
* have eras thus it is impossible to add an era to a date or date-time. The estimated duration of the
|
|
37
|
+
* era is artificially defined as 1,000,000,000 Years.
|
|
38
|
+
*
|
|
39
|
+
* - `ChronoUnit.FOREVER`: Artificial unit that represents the concept of forever. This is primarily
|
|
40
|
+
* used with {@link TemporalField} to represent unbounded fields such as the year or era. The
|
|
41
|
+
* estimated duration of the era is artificially defined as the largest duration supported by
|
|
42
|
+
* {@link Duration}.
|
|
43
|
+
*
|
|
44
|
+
* - `ChronoUnit.HALF_DAYS`: Unit that represents the concept of half a day, as used in AM/PM. For
|
|
45
|
+
* the ISO calendar system, it is equal to 12 hours.
|
|
46
|
+
*
|
|
47
|
+
* - `ChronoUnit.HOURS`: Unit that represents the concept of an hour. For the ISO calendar system,
|
|
48
|
+
* it is equal to 60 minutes.
|
|
49
|
+
*
|
|
50
|
+
* - `ChronoUnit.MICROS`: Unit that represents the concept of a microsecond. For the ISO calendar
|
|
51
|
+
* system, it is equal to the 1,000,000th part of the second unit.
|
|
52
|
+
*
|
|
53
|
+
* - `ChronoUnit.MILLENNIA`: Unit that represents the concept of a millennium. For the ISO calendar
|
|
54
|
+
* system, it is equal to 1,000 years.
|
|
55
|
+
*
|
|
56
|
+
* - `ChronoUnit.MILLIS`: Unit that represents the concept of a millisecond. For the ISO calendar
|
|
57
|
+
* system, it is equal to the 1000th part of the second unit.
|
|
58
|
+
*
|
|
59
|
+
* - `ChronoUnit.MINUTES`: Unit that represents the concept of a minute. For the ISO calendar system,
|
|
60
|
+
* it is equal to 60 seconds.
|
|
61
|
+
*
|
|
62
|
+
* - `ChronoUnit.MONTHS`: Unit that represents the concept of a month. For the ISO calendar system,
|
|
63
|
+
* the length of the month varies by month-of-year. The estimated duration of a month is one twelfth
|
|
64
|
+
* of 365.2425 Days.
|
|
65
|
+
*
|
|
66
|
+
* - `ChronoUnit.NANOS`: Unit that represents the concept of a nanosecond, the smallest supported unit
|
|
67
|
+
* of time. For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.
|
|
68
|
+
*
|
|
69
|
+
* - `ChronoUnit.SECONDS`: Unit that represents the concept of a second. For the ISO calendar system,
|
|
70
|
+
* it is equal to the second in the SI system of units, except around a leap-second.
|
|
71
|
+
*
|
|
72
|
+
* - `ChronoUnit.WEEKS`: Unit that represents the concept of a week. For the ISO calendar system,
|
|
73
|
+
* it is equal to 7 Days.
|
|
74
|
+
*
|
|
75
|
+
* - `ChronoUnit.YEARS`: Unit that represents the concept of a year. For the ISO calendar system, it
|
|
76
|
+
* is equal to 12 months. The estimated duration of a year is 365.2425 Days.
|
|
77
|
+
*/
|
|
78
|
+
export class ChronoUnit extends TemporalUnit {
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* @param {String} name
|
|
83
|
+
* @param {Duration} estimatedDuration
|
|
84
|
+
* @private
|
|
85
|
+
*/
|
|
86
|
+
constructor (name, estimatedDuration) {
|
|
87
|
+
super();
|
|
88
|
+
this._name = name;
|
|
89
|
+
this._duration = estimatedDuration;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
//-----------------------------------------------------------------------
|
|
93
|
+
/**
|
|
94
|
+
* @return {Duration} the duration of this unit, which may be an estimate.
|
|
95
|
+
*/
|
|
96
|
+
duration() {
|
|
97
|
+
return this._duration;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* @return {boolean} `true` if the duration is estimated, `false` if accurate.
|
|
102
|
+
*/
|
|
103
|
+
isDurationEstimated() {
|
|
104
|
+
return this.isDateBased() || this === ChronoUnit.FOREVER;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
//-----------------------------------------------------------------------
|
|
108
|
+
/**
|
|
109
|
+
* @return {boolean} `true` if date unit, `false` if a time unit.
|
|
110
|
+
*/
|
|
111
|
+
isDateBased() {
|
|
112
|
+
return this.compareTo(ChronoUnit.DAYS) >= 0 && this !== ChronoUnit.FOREVER;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Checks if this unit is a time unit.
|
|
117
|
+
*
|
|
118
|
+
* @return {boolean} `true` if time unit, `false` if a date unit.
|
|
119
|
+
*/
|
|
120
|
+
isTimeBased() {
|
|
121
|
+
return this.compareTo(ChronoUnit.DAYS) < 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
//-----------------------------------------------------------------------
|
|
125
|
+
/**
|
|
126
|
+
* @param {!Temporal} temporal the temporal object to check.
|
|
127
|
+
* @return {boolean} `true` if the unit is supported.
|
|
128
|
+
*/
|
|
129
|
+
isSupportedBy(temporal) {
|
|
130
|
+
if (this === ChronoUnit.FOREVER) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
/* TODO: classes not implemented yet */
|
|
134
|
+
/*
|
|
135
|
+
if (temporal instanceof ChronoLocalDate) {
|
|
136
|
+
return isDateBased();
|
|
137
|
+
}
|
|
138
|
+
if (temporal instanceof ChronoLocalDateTime || temporal instanceof ChronoZonedDateTime) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
*/
|
|
142
|
+
try {
|
|
143
|
+
temporal.plus(1, this);
|
|
144
|
+
return true;
|
|
145
|
+
} catch (e) {
|
|
146
|
+
try {
|
|
147
|
+
temporal.plus(-1, this);
|
|
148
|
+
return true;
|
|
149
|
+
} catch (e2) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* @param {!Temporal} dateTime the temporal object to adjust.
|
|
157
|
+
* @param {number} periodToAdd the period of this unit to add, positive or negative.
|
|
158
|
+
* @return {Temporal} the adjusted temporal object.
|
|
159
|
+
* @throws DateTimeException if the period cannot be added.
|
|
160
|
+
*/
|
|
161
|
+
addTo(temporal, amount) {
|
|
162
|
+
return temporal.plus(amount, this);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
//-----------------------------------------------------------------------
|
|
166
|
+
/**
|
|
167
|
+
* @param {!Temporal} temporal1 the base temporal object.
|
|
168
|
+
* @param {!Temporal} temporal2 the other temporal object.
|
|
169
|
+
* @return {number} the period between temporal1 and temporal2 in terms of this unit;
|
|
170
|
+
* positive if temporal2 is later than temporal1, negative if earlier.
|
|
171
|
+
* @throws DateTimeException if the period cannot be calculated.
|
|
172
|
+
* @throws ArithmeticException if numeric overflow occurs.
|
|
173
|
+
*/
|
|
174
|
+
between(temporal1, temporal2) {
|
|
175
|
+
return temporal1.until(temporal2, this);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
//-----------------------------------------------------------------------
|
|
179
|
+
toString() {
|
|
180
|
+
return this._name;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Compares this ChronoUnit to the specified {@link TemporalUnit}.
|
|
185
|
+
*
|
|
186
|
+
* The comparison is based on the total length of the durations.
|
|
187
|
+
*
|
|
188
|
+
* @param {!TemporalUnit} other the other unit to compare to.
|
|
189
|
+
* @return the comparator value, negative if less, positive if greater.
|
|
190
|
+
*/
|
|
191
|
+
compareTo(other) {
|
|
192
|
+
return this.duration().compareTo(other.duration());
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function _init() {
|
|
198
|
+
/**
|
|
199
|
+
* Unit that represents the concept of a nanosecond, the smallest supported unit of time.
|
|
200
|
+
* For the ISO calendar system, it is equal to the 1,000,000,000th part of the second unit.
|
|
201
|
+
*/
|
|
202
|
+
ChronoUnit.NANOS = new ChronoUnit('Nanos', Duration.ofNanos(1));
|
|
203
|
+
/**
|
|
204
|
+
* Unit that represents the concept of a microsecond.
|
|
205
|
+
* For the ISO calendar system, it is equal to the 1,000,000th part of the second unit.
|
|
206
|
+
*/
|
|
207
|
+
ChronoUnit.MICROS = new ChronoUnit('Micros', Duration.ofNanos(1000));
|
|
208
|
+
/**
|
|
209
|
+
* Unit that represents the concept of a millisecond.
|
|
210
|
+
* For the ISO calendar system, it is equal to the 1000th part of the second unit.
|
|
211
|
+
*/
|
|
212
|
+
ChronoUnit.MILLIS = new ChronoUnit('Millis', Duration.ofNanos(1000000));
|
|
213
|
+
/**
|
|
214
|
+
* Unit that represents the concept of a second.
|
|
215
|
+
* For the ISO calendar system, it is equal to the second in the SI system
|
|
216
|
+
* of units, except around a leap-second.
|
|
217
|
+
*/
|
|
218
|
+
ChronoUnit.SECONDS = new ChronoUnit('Seconds', Duration.ofSeconds(1));
|
|
219
|
+
/**
|
|
220
|
+
* Unit that represents the concept of a minute.
|
|
221
|
+
* For the ISO calendar system, it is equal to 60 seconds.
|
|
222
|
+
*/
|
|
223
|
+
ChronoUnit.MINUTES = new ChronoUnit('Minutes', Duration.ofSeconds(60));
|
|
224
|
+
/**
|
|
225
|
+
* Unit that represents the concept of an hour.
|
|
226
|
+
* For the ISO calendar system, it is equal to 60 minutes.
|
|
227
|
+
*/
|
|
228
|
+
ChronoUnit.HOURS = new ChronoUnit('Hours', Duration.ofSeconds(3600));
|
|
229
|
+
/**
|
|
230
|
+
* Unit that represents the concept of half a day, as used in AM/PM.
|
|
231
|
+
* For the ISO calendar system, it is equal to 12 hours.
|
|
232
|
+
*/
|
|
233
|
+
ChronoUnit.HALF_DAYS = new ChronoUnit('HalfDays', Duration.ofSeconds(43200));
|
|
234
|
+
/**
|
|
235
|
+
* Unit that represents the concept of a day.
|
|
236
|
+
* For the ISO calendar system, it is the standard day from midnight to midnight.
|
|
237
|
+
* The estimated duration of a day is 24 hours.
|
|
238
|
+
*
|
|
239
|
+
* When used with other calendar systems it must correspond to the day defined by
|
|
240
|
+
* the rising and setting of the Sun on Earth. It is not required that days begin
|
|
241
|
+
* at midnight - when converting between calendar systems, the date should be
|
|
242
|
+
* equivalent at midday.
|
|
243
|
+
*/
|
|
244
|
+
ChronoUnit.DAYS = new ChronoUnit('Days', Duration.ofSeconds(86400));
|
|
245
|
+
/**
|
|
246
|
+
* Unit that represents the concept of a week.
|
|
247
|
+
* For the ISO calendar system, it is equal to 7 days.
|
|
248
|
+
*
|
|
249
|
+
* When used with other calendar systems it must correspond to an integral number of days.
|
|
250
|
+
*/
|
|
251
|
+
ChronoUnit.WEEKS = new ChronoUnit('Weeks', Duration.ofSeconds(7 * 86400));
|
|
252
|
+
/**
|
|
253
|
+
* Unit that represents the concept of a month.
|
|
254
|
+
* For the ISO calendar system, the length of the month varies by month-of-year.
|
|
255
|
+
* The estimated duration of a month is one twelfth of 365.2425 days.
|
|
256
|
+
*
|
|
257
|
+
* When used with other calendar systems it must correspond to an integral number of days.
|
|
258
|
+
*/
|
|
259
|
+
ChronoUnit.MONTHS = new ChronoUnit('Months', Duration.ofSeconds(31556952 / 12));
|
|
260
|
+
/**
|
|
261
|
+
* Unit that represents the concept of a year.
|
|
262
|
+
* For the ISO calendar system, it is equal to 12 months.
|
|
263
|
+
* The estimated duration of a year is 365.2425 days.
|
|
264
|
+
*
|
|
265
|
+
* When used with other calendar systems it must correspond to an integral number of days
|
|
266
|
+
* or months roughly equal to a year defined by the passage of the Earth around the Sun.
|
|
267
|
+
*/
|
|
268
|
+
ChronoUnit.YEARS = new ChronoUnit('Years', Duration.ofSeconds(31556952));
|
|
269
|
+
/**
|
|
270
|
+
* Unit that represents the concept of a decade.
|
|
271
|
+
* For the ISO calendar system, it is equal to 10 years.
|
|
272
|
+
*
|
|
273
|
+
* When used with other calendar systems it must correspond to an integral number of days
|
|
274
|
+
* and is normally an integral number of years.
|
|
275
|
+
*/
|
|
276
|
+
ChronoUnit.DECADES = new ChronoUnit('Decades', Duration.ofSeconds(31556952 * 10));
|
|
277
|
+
/**
|
|
278
|
+
* Unit that represents the concept of a century.
|
|
279
|
+
* For the ISO calendar system, it is equal to 100 years.
|
|
280
|
+
*
|
|
281
|
+
* When used with other calendar systems it must correspond to an integral number of days
|
|
282
|
+
* and is normally an integral number of years.
|
|
283
|
+
*/
|
|
284
|
+
ChronoUnit.CENTURIES = new ChronoUnit('Centuries', Duration.ofSeconds(31556952 * 100));
|
|
285
|
+
/**
|
|
286
|
+
* Unit that represents the concept of a millennium.
|
|
287
|
+
* For the ISO calendar system, it is equal to 1000 years.
|
|
288
|
+
*
|
|
289
|
+
* When used with other calendar systems it must correspond to an integral number of days
|
|
290
|
+
* and is normally an integral number of years.
|
|
291
|
+
*/
|
|
292
|
+
ChronoUnit.MILLENNIA = new ChronoUnit('Millennia', Duration.ofSeconds(31556952 * 1000));
|
|
293
|
+
/**
|
|
294
|
+
* Unit that represents the concept of an era.
|
|
295
|
+
* The ISO calendar system doesn't have eras thus it is impossible to add
|
|
296
|
+
* an era to a date or date-time.
|
|
297
|
+
* The estimated duration of the era is artificially defined as {Year.MAX_VALUE} + 1.
|
|
298
|
+
*
|
|
299
|
+
* When used with other calendar systems there are no restrictions on the unit.
|
|
300
|
+
*/
|
|
301
|
+
ChronoUnit.ERAS = new ChronoUnit('Eras', Duration.ofSeconds(31556952 * (YearConstants.MAX_VALUE + 1)));
|
|
302
|
+
/**
|
|
303
|
+
* Artificial unit that represents the concept of forever.
|
|
304
|
+
* This is primarily used with {@link TemporalField} to represent unbounded fields
|
|
305
|
+
* such as the year or era.
|
|
306
|
+
* The estimated duration of the era is artificially defined as the largest duration
|
|
307
|
+
* supported by {@link Duration}.
|
|
308
|
+
*/
|
|
309
|
+
ChronoUnit.FOREVER = new ChronoUnit('Forever', Duration.ofSeconds(MathUtil.MAX_SAFE_INTEGER, 999999999));
|
|
310
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import {MAX_SAFE_INTEGER, MIN_SAFE_INTEGER} from '../MathUtil';
|
|
2
|
+
import {requireInstance, requireNonNull} from '../assert';
|
|
3
|
+
import {TemporalAdjuster} from './TemporalAdjuster';
|
|
4
|
+
import {TemporalAmount} from './TemporalAmount';
|
|
5
|
+
import {TemporalUnit} from './TemporalUnit';
|
|
6
|
+
import {Temporal} from './Temporal';
|
|
7
|
+
|
|
8
|
+
export class DefaultInterfaceTemporal extends Temporal {
|
|
9
|
+
/**
|
|
10
|
+
* Returns an adjusted object of the same type as this object with the adjustment made.
|
|
11
|
+
* This adjusts this date-time according to the rules of the specified adjuster. A simple adjuster might simply set the one of the fields, such as the year field. A more complex adjuster might set the date to the last day of the month. A selection of common adjustments is provided in {@link TemporalAdjusters}. These include finding the "last day of the month" and "next Wednesday". The adjuster is responsible for handling special cases, such as the varying lengths of month and leap years.
|
|
12
|
+
*
|
|
13
|
+
* Some example code indicating how and why this method is used:
|
|
14
|
+
*
|
|
15
|
+
* <pre>
|
|
16
|
+
* date = date.with(Month.JULY); // most key classes implement TemporalAdjuster
|
|
17
|
+
* date = date.with(lastDayOfMonth()); // static import from TemporalAdjusters
|
|
18
|
+
* date = date.with(next(WEDNESDAY)); // static import from TemporalAdjusters and DayOfWeek
|
|
19
|
+
* </pre>
|
|
20
|
+
*
|
|
21
|
+
* ### Specification for implementors
|
|
22
|
+
* Implementations must not alter either this object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.
|
|
23
|
+
*
|
|
24
|
+
* @param {TemporalAdjuster} adjuster - the adjuster to use, not null
|
|
25
|
+
* @return {Temporal} an object of the same type with the specified adjustment made, not null
|
|
26
|
+
* @throws DateTimeException - if unable to make the adjustment
|
|
27
|
+
* @throws ArithmeticException - if numeric overflow occurs
|
|
28
|
+
*/
|
|
29
|
+
withAdjuster(adjuster) {
|
|
30
|
+
requireNonNull(adjuster, 'adjuster');
|
|
31
|
+
requireInstance(adjuster, TemporalAdjuster, 'adjuster');
|
|
32
|
+
return adjuster.adjustInto(this);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns an object of the same type as this object with an amount added.
|
|
37
|
+
* This adjusts this temporal, adding according to the rules of the specified amount. The amount is typically a {@link Period} but may be any other type implementing the {@link TemporalAmount} interface, such as {@link Duration}.
|
|
38
|
+
*
|
|
39
|
+
* Some example code indicating how and why this method is used:
|
|
40
|
+
*
|
|
41
|
+
* <pre>
|
|
42
|
+
* date = date.plus(period); // add a Period instance
|
|
43
|
+
* date = date.plus(duration); // add a Duration instance
|
|
44
|
+
* date = date.plus(workingDays(6)); // example user-written workingDays method
|
|
45
|
+
* </pre>
|
|
46
|
+
*
|
|
47
|
+
* Note that calling plus followed by minus is not guaranteed to return the same date-time.
|
|
48
|
+
*
|
|
49
|
+
* ### Specification for implementors
|
|
50
|
+
* Implementations must not alter either this object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.
|
|
51
|
+
*
|
|
52
|
+
* @param {TemporalAmount} amount - the amount to add, not null
|
|
53
|
+
* @return {Temporal} an object of the same type with the specified adjustment made, not null
|
|
54
|
+
* @throws DateTimeException - if the addition cannot be made
|
|
55
|
+
* @throws ArithmeticException - if numeric overflow occurs
|
|
56
|
+
*/
|
|
57
|
+
plusAmount(amount) {
|
|
58
|
+
requireNonNull(amount, 'amount');
|
|
59
|
+
requireInstance(amount, TemporalAmount, 'amount');
|
|
60
|
+
return amount.addTo(this);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Returns an object of the same type as this object with an amount subtracted.
|
|
65
|
+
* This adjusts this temporal, subtracting according to the rules of the specified amount. The
|
|
66
|
+
* amount is typically a {@link Period} but may be any other type implementing the {@link TemporalAmount} interface, such as Duration.
|
|
67
|
+
*
|
|
68
|
+
* Some example code indicating how and why this method is used:
|
|
69
|
+
*
|
|
70
|
+
* <pre>
|
|
71
|
+
* date = date.minus(period); // subtract a Period instance
|
|
72
|
+
* date = date.minus(duration); // subtract a Duration instance
|
|
73
|
+
* date = date.minus(workingDays(6)); // example user-written workingDays method
|
|
74
|
+
* </pre>
|
|
75
|
+
*
|
|
76
|
+
* Note that calling plus followed by minus is not guaranteed to return the same date-time.
|
|
77
|
+
*
|
|
78
|
+
* ### Specification for implementors
|
|
79
|
+
* Implementations must not alter either this object. Instead, an adjusted copy of the original
|
|
80
|
+
* must be returned. This provides equivalent, safe behavior for immutable and mutable
|
|
81
|
+
* implementations.
|
|
82
|
+
*
|
|
83
|
+
* @param {TemporalAmount} amount - the amount to subtract, not null
|
|
84
|
+
* @return {Temporal} an object of the same type with the specified adjustment made, not null
|
|
85
|
+
* @throws DateTimeException - if the subtraction cannot be made
|
|
86
|
+
* @throws ArithmeticException - if numeric overflow occurs
|
|
87
|
+
*/
|
|
88
|
+
minusAmount(amount) {
|
|
89
|
+
requireNonNull(amount, 'amount');
|
|
90
|
+
requireInstance(amount, TemporalAmount, 'amount');
|
|
91
|
+
return amount.subtractFrom(this);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Returns an object of the same type as this object with the specified period subtracted.
|
|
96
|
+
* This method returns a new object based on this one with the specified period subtracted. For example, on a {@link LocalDate}, this could be used to subtract a number of years, months or days. The returned object will have the same observable type as this object.
|
|
97
|
+
*
|
|
98
|
+
* In some cases, changing a field is not fully defined. For example, if the target object is a date representing the 31st March, then subtracting one month would be unclear. In cases like this, the field is responsible for resolving the result. Typically it will choose the previous valid date, which would be the last valid day of February in this example.
|
|
99
|
+
*
|
|
100
|
+
* If the implementation represents a date-time that has boundaries, such {@link as} LocalTime, then the permitted units must include the boundary unit, but no multiples of the boundary unit. For example, {@link LocalTime} must accept `DAYS` but not `WEEKS` or `MONTHS`.
|
|
101
|
+
*
|
|
102
|
+
* ### Specification for implementors
|
|
103
|
+
* Implementations must behave in a manor equivalent to the default method behavior.
|
|
104
|
+
* Implementations must not alter either this object or the specified temporal object. Instead, an adjusted copy of the original must be returned. This provides equivalent, safe behavior for immutable and mutable implementations.
|
|
105
|
+
*
|
|
106
|
+
* @param {number} amountToSubtract - the amount of the specified unit to subtract, may be negative
|
|
107
|
+
* @param {TemporalUnit} unit - the unit of the period to subtract, not null
|
|
108
|
+
* @return {Temporal} an object of the same type with the specified period subtracted, not null
|
|
109
|
+
* @throws DateTimeException - if the unit cannot be subtracted
|
|
110
|
+
* @throws ArithmeticException - if numeric overflow occurs
|
|
111
|
+
*/
|
|
112
|
+
minusAmountUnit(amountToSubtract, unit) {
|
|
113
|
+
requireNonNull(amountToSubtract, 'amountToSubtract');
|
|
114
|
+
requireNonNull(unit, 'unit');
|
|
115
|
+
requireInstance(unit, TemporalUnit, 'unit');
|
|
116
|
+
return (amountToSubtract === MIN_SAFE_INTEGER ? this.plusAmountUnit(MAX_SAFE_INTEGER, unit).plusAmountUnit(1, unit) : this.plusAmount(-amountToSubtract, unit));
|
|
117
|
+
}
|
|
118
|
+
}
|