@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,68 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
3
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import {_init as ZoneOffsetInit} from './ZoneOffset';
|
|
7
|
+
import {_init as DayOfWeekInit} from './DayOfWeek';
|
|
8
|
+
import {_init as DurationInit} from './Duration';
|
|
9
|
+
import {_init as InstantInit} from './Instant';
|
|
10
|
+
import {_init as LocalDateInit} from './LocalDate';
|
|
11
|
+
import {_init as LocalTimeInit} from './LocalTime';
|
|
12
|
+
import {_init as LocalDateTimeInit} from './LocalDateTime';
|
|
13
|
+
import {_init as MonthInit} from './Month';
|
|
14
|
+
import {_init as MonthDayInit} from './MonthDay';
|
|
15
|
+
import {_init as OffsetDateTimeInit} from './OffsetDateTime';
|
|
16
|
+
import {_init as OffsetTimeInit} from './OffsetTime';
|
|
17
|
+
import {_init as PeriodInit} from './Period';
|
|
18
|
+
import {_init as YearInit} from './Year';
|
|
19
|
+
import {_init as YearConstantsInit} from './YearConstants';
|
|
20
|
+
import {_init as YearMonthInit} from './YearMonth';
|
|
21
|
+
import {_init as ZonedDateTimeInit} from './ZonedDateTime';
|
|
22
|
+
import {_init as IsoChronologyInit} from './chrono/IsoChronology';
|
|
23
|
+
import {_init as DateTimeFormatterInit} from './format/DateTimeFormatter';
|
|
24
|
+
import {_init as ChronoFieldInit} from './temporal/ChronoField';
|
|
25
|
+
import {_init as ChronoUnitInit} from './temporal/ChronoUnit';
|
|
26
|
+
import {_init as IsoFieldsInit} from './temporal/IsoFields';
|
|
27
|
+
import {_init as DateTimeFormatterBuilderInit} from './format/DateTimeFormatterBuilder';
|
|
28
|
+
|
|
29
|
+
import {_init as TemporalQueriesInit} from './temporal/TemporalQueriesFactory';
|
|
30
|
+
import {_init as ZoneIdInit} from './ZoneIdFactory';
|
|
31
|
+
|
|
32
|
+
let isInit = false;
|
|
33
|
+
|
|
34
|
+
function init() {
|
|
35
|
+
|
|
36
|
+
if (isInit) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
isInit = true;
|
|
41
|
+
|
|
42
|
+
YearConstantsInit();
|
|
43
|
+
DurationInit();
|
|
44
|
+
ChronoUnitInit();
|
|
45
|
+
ChronoFieldInit();
|
|
46
|
+
LocalTimeInit();
|
|
47
|
+
IsoFieldsInit();
|
|
48
|
+
TemporalQueriesInit();
|
|
49
|
+
DayOfWeekInit();
|
|
50
|
+
InstantInit();
|
|
51
|
+
LocalDateInit();
|
|
52
|
+
LocalDateTimeInit();
|
|
53
|
+
YearInit();
|
|
54
|
+
MonthInit();
|
|
55
|
+
YearMonthInit();
|
|
56
|
+
MonthDayInit();
|
|
57
|
+
PeriodInit();
|
|
58
|
+
ZoneOffsetInit();
|
|
59
|
+
ZonedDateTimeInit();
|
|
60
|
+
ZoneIdInit();
|
|
61
|
+
IsoChronologyInit();
|
|
62
|
+
DateTimeFormatterInit();
|
|
63
|
+
DateTimeFormatterBuilderInit();
|
|
64
|
+
OffsetDateTimeInit();
|
|
65
|
+
OffsetTimeInit();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
init();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright (c) 2016, Philipp Thürwächter & Pattrick Hüper
|
|
3
|
+
* @license BSD-3-Clause (see LICENSE in the root directory of this source tree)
|
|
4
|
+
*/
|
|
5
|
+
import {NullPointerException, IllegalArgumentException} from './errors';
|
|
6
|
+
|
|
7
|
+
export function assert(assertion, msg, error) {
|
|
8
|
+
if(!assertion){
|
|
9
|
+
if (error) {
|
|
10
|
+
throw new error(msg);
|
|
11
|
+
} else {
|
|
12
|
+
throw new Error(msg);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function requireNonNull(value, parameterName) {
|
|
18
|
+
if (value == null) {
|
|
19
|
+
throw new NullPointerException(parameterName + ' must not be null');
|
|
20
|
+
}
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function requireInstance(value, _class, parameterName) {
|
|
25
|
+
if (!(value instanceof _class)) {
|
|
26
|
+
throw new IllegalArgumentException(parameterName + ' must be an instance of ' + (_class.name ? _class.name : _class) + (value && value.constructor && value.constructor.name ? ', but is ' + value.constructor.name : ''));
|
|
27
|
+
}
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function abstractMethodFail(methodName){
|
|
32
|
+
throw new TypeError('abstract method "' + methodName + '" is not implemented');
|
|
33
|
+
}
|
|
@@ -0,0 +1,230 @@
|
|
|
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 {requireNonNull, requireInstance} from '../assert';
|
|
8
|
+
|
|
9
|
+
import {ChronoField} from '../temporal/ChronoField';
|
|
10
|
+
import {ChronoUnit} from '../temporal/ChronoUnit';
|
|
11
|
+
import {DateTimeFormatter} from '../format/DateTimeFormatter';
|
|
12
|
+
import {TemporalQueries} from '../temporal/TemporalQueries';
|
|
13
|
+
import {DefaultInterfaceTemporal} from '../temporal/DefaultInterfaceTemporal';
|
|
14
|
+
|
|
15
|
+
import {LocalDate} from '../LocalDate';
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A date without time-of-day or time-zone in an arbitrary chronology, intended
|
|
19
|
+
* for advanced globalization use cases.
|
|
20
|
+
*
|
|
21
|
+
* **Most applications should declare method signatures, fields and variables
|
|
22
|
+
* as {@link LocalDate}, not this interface.**
|
|
23
|
+
*
|
|
24
|
+
* A {@link ChronoLocalDate} is the abstract representation of a date where the
|
|
25
|
+
* {@link Chronology}, or calendar system, is pluggable.
|
|
26
|
+
* The date is defined in terms of fields expressed by {@link TemporalField},
|
|
27
|
+
* where most common implementations are defined in {@link ChronoField}.
|
|
28
|
+
* The chronology defines how the calendar system operates and the meaning of
|
|
29
|
+
* the standard fields.
|
|
30
|
+
*
|
|
31
|
+
* #### When to use this interface
|
|
32
|
+
*
|
|
33
|
+
* The design of the API encourages the use of {@link LocalDate} rather than this
|
|
34
|
+
* interface, even in the case where the application needs to deal with multiple
|
|
35
|
+
* calendar systems. The rationale for this is explored in the following documentation.
|
|
36
|
+
*
|
|
37
|
+
* The primary use case where this interface should be used is where the generic
|
|
38
|
+
* type parameter `C` is fully defined as a specific chronology.
|
|
39
|
+
* In that case, the assumptions of that chronology are known at development
|
|
40
|
+
* time and specified in the code.
|
|
41
|
+
*
|
|
42
|
+
* When the chronology is defined in the generic type parameter as ? or otherwise
|
|
43
|
+
* unknown at development time, the rest of the discussion below applies.
|
|
44
|
+
*
|
|
45
|
+
* To emphasize the point, declaring a method signature, field or variable as this
|
|
46
|
+
* interface type can initially seem like the sensible way to globalize an application,
|
|
47
|
+
* however it is usually the wrong approach.
|
|
48
|
+
* As such, it should be considered an application-wide architectural decision to choose
|
|
49
|
+
* to use this interface as opposed to {@link LocalDate}.
|
|
50
|
+
*
|
|
51
|
+
* #### Architectural issues to consider
|
|
52
|
+
*
|
|
53
|
+
* These are some of the points that must be considered before using this interface
|
|
54
|
+
* throughout an application.
|
|
55
|
+
*
|
|
56
|
+
* 1) Applications using this interface, as opposed to using just {@link LocalDate},
|
|
57
|
+
* face a significantly higher probability of bugs. This is because the calendar system
|
|
58
|
+
* in use is not known at development time. A key cause of bugs is where the developer
|
|
59
|
+
* applies assumptions from their day-to-day knowledge of the ISO calendar system
|
|
60
|
+
* to code that is intended to deal with any arbitrary calendar system.
|
|
61
|
+
* The section below outlines how those assumptions can cause problems
|
|
62
|
+
* The primary mechanism for reducing this increased risk of bugs is a strong code review process.
|
|
63
|
+
* This should also be considered a extra cost in maintenance for the lifetime of the code.
|
|
64
|
+
*
|
|
65
|
+
* 2) This interface does not enforce immutability of implementations.
|
|
66
|
+
* While the implementation notes indicate that all implementations must be immutable
|
|
67
|
+
* there is nothing in the code or type system to enforce this. Any method declared
|
|
68
|
+
* to accept a {@link ChronoLocalDate} could therefore be passed a poorly or
|
|
69
|
+
* maliciously written mutable implementation.
|
|
70
|
+
*
|
|
71
|
+
* 3) Applications using this interface must consider the impact of eras.
|
|
72
|
+
* {@link LocalDate} shields users from the concept of eras, by ensuring that `getYear()`
|
|
73
|
+
* returns the proleptic year. That decision ensures that developers can think of
|
|
74
|
+
* {@link LocalDate} instances as consisting of three fields - year, month-of-year and day-of-month.
|
|
75
|
+
* By contrast, users of this interface must think of dates as consisting of four fields -
|
|
76
|
+
* era, year-of-era, month-of-year and day-of-month. The extra era field is frequently
|
|
77
|
+
* forgotten, yet it is of vital importance to dates in an arbitrary calendar system.
|
|
78
|
+
* For example, in the Japanese calendar system, the era represents the reign of an Emperor.
|
|
79
|
+
* Whenever one reign ends and another starts, the year-of-era is reset to one.
|
|
80
|
+
*
|
|
81
|
+
* 4) The only agreed international standard for passing a date between two systems
|
|
82
|
+
* is the ISO-8601 standard which requires the ISO calendar system. Using this interface
|
|
83
|
+
* throughout the application will inevitably lead to the requirement to pass the date
|
|
84
|
+
* across a network or component boundary, requiring an application specific protocol or format.
|
|
85
|
+
*
|
|
86
|
+
* 5) Long term persistence, such as a database, will almost always only accept dates in the
|
|
87
|
+
* ISO-8601 calendar system (or the related Julian-Gregorian). Passing around dates in other
|
|
88
|
+
* calendar systems increases the complications of interacting with persistence.
|
|
89
|
+
*
|
|
90
|
+
* 6) Most of the time, passing a {@link ChronoLocalDate} throughout an application
|
|
91
|
+
* is unnecessary, as discussed in the last section below.
|
|
92
|
+
*
|
|
93
|
+
* #### False assumptions causing bugs in multi-calendar system code
|
|
94
|
+
*
|
|
95
|
+
* As indicated above, there are many issues to consider when try to use and manipulate a
|
|
96
|
+
* date in an arbitrary calendar system. These are some of the key issues.
|
|
97
|
+
*
|
|
98
|
+
* Code that queries the day-of-month and assumes that the value will never be more than
|
|
99
|
+
* 31 is invalid. Some calendar systems have more than 31 days in some months.
|
|
100
|
+
*
|
|
101
|
+
* Code that adds 12 months to a date and assumes that a year has been added is invalid.
|
|
102
|
+
* Some calendar systems have a different number of months, such as 13 in the Coptic or Ethiopic.
|
|
103
|
+
*
|
|
104
|
+
* Code that adds one month to a date and assumes that the month-of-year value will increase
|
|
105
|
+
* by one or wrap to the next year is invalid. Some calendar systems have a variable number
|
|
106
|
+
* of months in a year, such as the Hebrew.
|
|
107
|
+
*
|
|
108
|
+
* Code that adds one month, then adds a second one month and assumes that the day-of-month
|
|
109
|
+
* will remain close to its original value is invalid. Some calendar systems have a large difference
|
|
110
|
+
* between the length of the longest month and the length of the shortest month.
|
|
111
|
+
* For example, the Coptic or Ethiopic have 12 months of 30 days and 1 month of 5 days.
|
|
112
|
+
*
|
|
113
|
+
* Code that adds seven days and assumes that a week has been added is invalid.
|
|
114
|
+
* Some calendar systems have weeks of other than seven days, such as the French Revolutionary.
|
|
115
|
+
*
|
|
116
|
+
* Code that assumes that because the year of `date1` is greater than the year of `date2`
|
|
117
|
+
* then `date1` is after `date2` is invalid. This is invalid for all calendar systems
|
|
118
|
+
* when referring to the year-of-era, and especially untrue of the Japanese calendar system
|
|
119
|
+
* where the year-of-era restarts with the reign of every new Emperor.
|
|
120
|
+
*
|
|
121
|
+
* Code that treats month-of-year one and day-of-month one as the start of the year is invalid.
|
|
122
|
+
* Not all calendar systems start the year when the month value is one.
|
|
123
|
+
*
|
|
124
|
+
* In general, manipulating a date, and even querying a date, is wide open to bugs when the
|
|
125
|
+
* calendar system is unknown at development time. This is why it is essential that code using
|
|
126
|
+
* this interface is subjected to additional code reviews. It is also why an architectural
|
|
127
|
+
* decision to avoid this interface type is usually the correct one.
|
|
128
|
+
*
|
|
129
|
+
* #### Using LocalDate instead
|
|
130
|
+
*
|
|
131
|
+
* The primary alternative to using this interface throughout your application is as follows.
|
|
132
|
+
*
|
|
133
|
+
* * Declare all method signatures referring to dates in terms of {@link LocalDate}.
|
|
134
|
+
* * Either store the chronology (calendar system) in the user profile or lookup the chronology
|
|
135
|
+
* from the user locale.
|
|
136
|
+
* * Convert the ISO {@link LocalDate} to and from the user's preferred calendar system during
|
|
137
|
+
* printing and parsing.
|
|
138
|
+
*
|
|
139
|
+
* This approach treats the problem of globalized calendar systems as a localization issue
|
|
140
|
+
* and confines it to the UI layer. This approach is in keeping with other localization
|
|
141
|
+
* issues in the java platform.
|
|
142
|
+
*
|
|
143
|
+
* As discussed above, performing calculations on a date where the rules of the calendar system
|
|
144
|
+
* are pluggable requires skill and is not recommended.
|
|
145
|
+
* Fortunately, the need to perform calculations on a date in an arbitrary calendar system
|
|
146
|
+
* is extremely rare. For example, it is highly unlikely that the business rules of a library
|
|
147
|
+
* book rental scheme will allow rentals to be for one month, where meaning of the month
|
|
148
|
+
* is dependent on the user's preferred calendar system.
|
|
149
|
+
*
|
|
150
|
+
* A key use case for calculations on a date in an arbitrary calendar system is producing
|
|
151
|
+
* a month-by-month calendar for display and user interaction. Again, this is a UI issue,
|
|
152
|
+
* and use of this interface solely within a few methods of the UI layer may be justified.
|
|
153
|
+
*
|
|
154
|
+
* In any other part of the system, where a date must be manipulated in a calendar system
|
|
155
|
+
* other than ISO, the use case will generally specify the calendar system to use.
|
|
156
|
+
* For example, an application may need to calculate the next Islamic or Hebrew holiday
|
|
157
|
+
* which may require manipulating the date.
|
|
158
|
+
* This kind of use case can be handled as follows:
|
|
159
|
+
*
|
|
160
|
+
* * start from the ISO {@link LocalDate} being passed to the method
|
|
161
|
+
* * convert the date to the alternate calendar system, which for this use case is known
|
|
162
|
+
* rather than arbitrary
|
|
163
|
+
* * perform the calculation
|
|
164
|
+
* * convert back to {@link LocalDate}
|
|
165
|
+
*
|
|
166
|
+
* Developers writing low-level frameworks or libraries should also avoid this interface.
|
|
167
|
+
* Instead, one of the two general purpose access interfaces should be used.
|
|
168
|
+
* Use {@link TemporalAccessor} if read-only access is required, or use {@link Temporal}
|
|
169
|
+
* if read-write access is required.
|
|
170
|
+
*
|
|
171
|
+
* ### Specification for implementors
|
|
172
|
+
*
|
|
173
|
+
* This interface must be implemented with care to ensure other classes operate correctly.
|
|
174
|
+
* All implementations that can be instantiated must be final, immutable and thread-safe.
|
|
175
|
+
* Subclasses should be Serializable wherever possible.
|
|
176
|
+
*
|
|
177
|
+
* Additional calendar systems may be added to the system.
|
|
178
|
+
* See {@link Chronology} for more details.
|
|
179
|
+
*
|
|
180
|
+
* In JDK 8, this is an interface with default methods.
|
|
181
|
+
* Since there are no default methods in JDK 7, an abstract class is used.
|
|
182
|
+
*/
|
|
183
|
+
export class ChronoLocalDate extends DefaultInterfaceTemporal {
|
|
184
|
+
|
|
185
|
+
isSupported(fieldOrUnit) {
|
|
186
|
+
if (fieldOrUnit instanceof ChronoField) {
|
|
187
|
+
return fieldOrUnit.isDateBased();
|
|
188
|
+
} else if (fieldOrUnit instanceof ChronoUnit) {
|
|
189
|
+
return fieldOrUnit.isDateBased();
|
|
190
|
+
}
|
|
191
|
+
return fieldOrUnit != null && fieldOrUnit.isSupportedBy(this);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
query(query) {
|
|
195
|
+
if (query === TemporalQueries.chronology()) {
|
|
196
|
+
return this.chronology();
|
|
197
|
+
} else if (query === TemporalQueries.precision()) {
|
|
198
|
+
return ChronoUnit.DAYS;
|
|
199
|
+
} else if (query === TemporalQueries.localDate()) {
|
|
200
|
+
return LocalDate.ofEpochDay(this.toEpochDay());
|
|
201
|
+
} else if (query === TemporalQueries.localTime() || query === TemporalQueries.zone() ||
|
|
202
|
+
query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
return super.query(query);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
adjustInto(temporal) {
|
|
209
|
+
return temporal.with(ChronoField.EPOCH_DAY, this.toEpochDay());
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Formats this date using the specified formatter.
|
|
213
|
+
*
|
|
214
|
+
* This date will be passed to the formatter to produce a string.
|
|
215
|
+
*
|
|
216
|
+
* The default implementation must behave as follows:
|
|
217
|
+
* <pre>
|
|
218
|
+
* return formatter.format(this);
|
|
219
|
+
* </pre>
|
|
220
|
+
*
|
|
221
|
+
* @param {DateTimeFormatter} formatter the formatter to use, not null
|
|
222
|
+
* @return {String} the formatted date string, not null
|
|
223
|
+
* @throws DateTimeException if an error occurs during printing
|
|
224
|
+
*/
|
|
225
|
+
format(formatter) {
|
|
226
|
+
requireNonNull(formatter, 'formatter');
|
|
227
|
+
requireInstance(formatter, DateTimeFormatter, 'formatter');
|
|
228
|
+
return formatter.format(this);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
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 {requireNonNull, requireInstance} from '../assert';
|
|
8
|
+
import {MathUtil} from '../MathUtil';
|
|
9
|
+
|
|
10
|
+
import {LocalDate} from '../LocalDate';
|
|
11
|
+
import {Instant} from '../Instant';
|
|
12
|
+
import {ZoneOffset} from '../ZoneOffset';
|
|
13
|
+
import {ChronoUnit} from '../temporal/ChronoUnit';
|
|
14
|
+
import {ChronoField} from '../temporal/ChronoField';
|
|
15
|
+
import {DefaultInterfaceTemporal} from '../temporal/DefaultInterfaceTemporal';
|
|
16
|
+
import {TemporalQueries} from '../temporal/TemporalQueries';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* A date-time without a time-zone in an arbitrary chronology, intended
|
|
20
|
+
* for advanced globalization use cases.
|
|
21
|
+
*
|
|
22
|
+
* **Most applications should declare method signatures, fields and variables
|
|
23
|
+
* as {@link LocalDateTime}, not this interface.**
|
|
24
|
+
*
|
|
25
|
+
* A {@link ChronoLocalDateTime} is the abstract representation of a local date-time
|
|
26
|
+
* where the {@link Chronology}, or calendar system, is pluggable.
|
|
27
|
+
* The date-time is defined in terms of fields expressed by {@link TemporalField},
|
|
28
|
+
* where most common implementations are defined in {@link ChronoField}.
|
|
29
|
+
* The chronology defines how the calendar system operates and the meaning of
|
|
30
|
+
* the standard fields.
|
|
31
|
+
*
|
|
32
|
+
* #### When to use this interface
|
|
33
|
+
*
|
|
34
|
+
* The design of the API encourages the use of {@link LocalDateTime} rather than this
|
|
35
|
+
* interface, even in the case where the application needs to deal with multiple
|
|
36
|
+
* calendar systems. The rationale for this is explored in detail in {@link ChronoLocalDate}.
|
|
37
|
+
*
|
|
38
|
+
* Ensure that the discussion in {@link ChronoLocalDate} has been read and understood
|
|
39
|
+
* before using this interface.
|
|
40
|
+
*
|
|
41
|
+
* ### Specification for implementors
|
|
42
|
+
*
|
|
43
|
+
* This interface must be implemented with care to ensure other classes operate correctly.
|
|
44
|
+
* All implementations that can be instantiated must be final, immutable and thread-safe.
|
|
45
|
+
* Subclasses should be Serializable wherever possible.
|
|
46
|
+
*
|
|
47
|
+
* In JDK 8, this is an interface with default methods.
|
|
48
|
+
* Since there are no default methods in JDK 7, an abstract class is used.
|
|
49
|
+
*
|
|
50
|
+
* @param D the date type
|
|
51
|
+
*/
|
|
52
|
+
export class ChronoLocalDateTime extends DefaultInterfaceTemporal {
|
|
53
|
+
/* <D extends ChronoLocalDate>
|
|
54
|
+
extends DefaultInterfaceTemporal
|
|
55
|
+
implements Temporal, TemporalAdjuster, Comparable<ChronoLocalDateTime<?>> */
|
|
56
|
+
|
|
57
|
+
//-----------------------------------------------------------------------
|
|
58
|
+
/**
|
|
59
|
+
* Gets the chronology of this date-time.
|
|
60
|
+
*
|
|
61
|
+
* The {@link Chronology} represents the calendar system in use.
|
|
62
|
+
* The era and other fields in {@link ChronoField} are defined by the chronology.
|
|
63
|
+
*
|
|
64
|
+
* @return the chronology, not null
|
|
65
|
+
*/
|
|
66
|
+
chronology() {
|
|
67
|
+
return this.toLocalDate().chronology();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @param {TemporalQuery} query
|
|
73
|
+
* @returns {*}
|
|
74
|
+
*/
|
|
75
|
+
query(query) {
|
|
76
|
+
if (query === TemporalQueries.chronology()) {
|
|
77
|
+
return this.chronology();
|
|
78
|
+
} else if (query === TemporalQueries.precision()) {
|
|
79
|
+
return ChronoUnit.NANOS;
|
|
80
|
+
} else if (query === TemporalQueries.localDate()) {
|
|
81
|
+
return LocalDate.ofEpochDay(this.toLocalDate().toEpochDay());
|
|
82
|
+
} else if (query === TemporalQueries.localTime()) {
|
|
83
|
+
return this.toLocalTime();
|
|
84
|
+
} else if (query === TemporalQueries.zone() || query === TemporalQueries.zoneId() || query === TemporalQueries.offset()) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return super.query(query);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
adjustInto(temporal) {
|
|
91
|
+
return temporal
|
|
92
|
+
.with(ChronoField.EPOCH_DAY, this.toLocalDate().toEpochDay())
|
|
93
|
+
.with(ChronoField.NANO_OF_DAY, this.toLocalTime().toNanoOfDay());
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//-----------------------------------------------------------------------
|
|
97
|
+
/**
|
|
98
|
+
* Converts this date-time to an {@link Instant}.
|
|
99
|
+
*
|
|
100
|
+
* This combines this local date-time and the specified offset to form
|
|
101
|
+
* an {@link Instant}.
|
|
102
|
+
*
|
|
103
|
+
* @param {ZoneOffset} offset the offset to use for the conversion, not null
|
|
104
|
+
* @return {Instant} an {@link Instant} representing the same instant, not null
|
|
105
|
+
*/
|
|
106
|
+
toInstant(offset) {
|
|
107
|
+
requireInstance(offset, ZoneOffset, 'zoneId');
|
|
108
|
+
return Instant.ofEpochSecond(this.toEpochSecond(offset), this.toLocalTime().nano());
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Converts this date-time to the number of seconds from the epoch
|
|
113
|
+
* of 1970-01-01T00:00:00Z.
|
|
114
|
+
*
|
|
115
|
+
* This combines this local date-time and the specified offset to calculate the
|
|
116
|
+
* epoch-second value, which is the number of elapsed seconds from 1970-01-01T00:00:00Z.
|
|
117
|
+
* Instants on the time-line after the epoch are positive, earlier are negative.
|
|
118
|
+
*
|
|
119
|
+
* @param {ZoneOffset} offset the offset to use for the conversion, not null
|
|
120
|
+
* @return {number} the number of seconds from the epoch of 1970-01-01T00:00:00Z
|
|
121
|
+
*/
|
|
122
|
+
toEpochSecond(offset) {
|
|
123
|
+
requireNonNull(offset, 'offset');
|
|
124
|
+
const epochDay = this.toLocalDate().toEpochDay();
|
|
125
|
+
let secs = epochDay * 86400 + this.toLocalTime().toSecondOfDay();
|
|
126
|
+
secs -= offset.totalSeconds();
|
|
127
|
+
return MathUtil.safeToInt(secs);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
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 {requireNonNull} from '../assert';
|
|
8
|
+
import {Instant} from '../Instant';
|
|
9
|
+
import {LocalDate} from '../LocalDate';
|
|
10
|
+
import {MathUtil} from '../MathUtil';
|
|
11
|
+
|
|
12
|
+
import {ChronoUnit} from '../temporal/ChronoUnit';
|
|
13
|
+
import {DefaultInterfaceTemporal} from '../temporal/DefaultInterfaceTemporal';
|
|
14
|
+
import {TemporalQueries} from '../temporal/TemporalQueries';
|
|
15
|
+
|
|
16
|
+
export class ChronoZonedDateTime extends DefaultInterfaceTemporal {
|
|
17
|
+
query(query) {
|
|
18
|
+
if (query === TemporalQueries.zoneId() || query === TemporalQueries.zone()) {
|
|
19
|
+
return this.zone();
|
|
20
|
+
} else if (query === TemporalQueries.chronology()) {
|
|
21
|
+
return this.toLocalDate().chronology();
|
|
22
|
+
} else if (query === TemporalQueries.precision()) {
|
|
23
|
+
return ChronoUnit.NANOS;
|
|
24
|
+
} else if (query === TemporalQueries.offset()) {
|
|
25
|
+
return this.offset();
|
|
26
|
+
} else if (query === TemporalQueries.localDate()) {
|
|
27
|
+
return LocalDate.ofEpochDay(this.toLocalDate().toEpochDay());
|
|
28
|
+
} else if (query === TemporalQueries.localTime()) {
|
|
29
|
+
return this.toLocalTime();
|
|
30
|
+
}
|
|
31
|
+
return super.query(query);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Outputs this date-time as a string using the formatter.
|
|
36
|
+
*
|
|
37
|
+
* @param {DateTimeFormatter} formatter - the formatter to use, not null
|
|
38
|
+
* @return {string} the formatted date-time string, not null
|
|
39
|
+
* @throws DateTimeException if an error occurs during printing
|
|
40
|
+
*/
|
|
41
|
+
format(formatter) {
|
|
42
|
+
requireNonNull(formatter, 'formatter');
|
|
43
|
+
return formatter.format(this);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Converts this date-time to an {@link Instant}.
|
|
48
|
+
*
|
|
49
|
+
* This returns an {@link Instant} representing the same point on the
|
|
50
|
+
* time-line as this date-time. The calculation combines the
|
|
51
|
+
* local date-time (see {@link toLocalDateTime}) and
|
|
52
|
+
* offset (see {@link getOffset}).
|
|
53
|
+
*
|
|
54
|
+
* @return {Instant} an {@link Instant} representing the same instant, not null
|
|
55
|
+
*/
|
|
56
|
+
toInstant() {
|
|
57
|
+
return Instant.ofEpochSecond(this.toEpochSecond(), this.toLocalTime().nano());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Converts this date-time to the number of seconds from the epoch
|
|
62
|
+
* of 1970-01-01T00:00:00Z.
|
|
63
|
+
*
|
|
64
|
+
* This uses the local date-time (see {@link toLocalDateTime}) and
|
|
65
|
+
* offset (see {@link getOffset}) to calculate the epoch-second value,
|
|
66
|
+
* which is the number of elapsed seconds from 1970-01-01T00:00:00Z.
|
|
67
|
+
* Instants on the time-line after the epoch are positive, earlier are negative.
|
|
68
|
+
*
|
|
69
|
+
* @return {number} the number of seconds from the epoch of 1970-01-01T00:00:00Z
|
|
70
|
+
*/
|
|
71
|
+
toEpochSecond() {
|
|
72
|
+
const epochDay = this.toLocalDate().toEpochDay();
|
|
73
|
+
let secs = epochDay * 86400 + this.toLocalTime().toSecondOfDay();
|
|
74
|
+
secs -= this.offset().totalSeconds();
|
|
75
|
+
return secs;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Compares this date-time to another date-time, including the chronology.
|
|
80
|
+
*
|
|
81
|
+
* The comparison is based first on the instant, then on the local date-time,
|
|
82
|
+
* then on the zone ID, then on the chronology.
|
|
83
|
+
* It is "consistent with equals", as defined by {@link Comparable}.
|
|
84
|
+
*
|
|
85
|
+
* If all the date-time objects being compared are in the same chronology, then the
|
|
86
|
+
* additional chronology stage is not required.
|
|
87
|
+
*
|
|
88
|
+
* @param {ChronoZonedDateTime} other - the other date-time to compare to, not null
|
|
89
|
+
* @return {number} the comparator value, negative if less, positive if greater
|
|
90
|
+
*/
|
|
91
|
+
compareTo(other) {
|
|
92
|
+
requireNonNull(other, 'other');
|
|
93
|
+
let cmp = MathUtil.compareNumbers(this.toEpochSecond(), other.toEpochSecond());
|
|
94
|
+
if (cmp === 0) {
|
|
95
|
+
cmp = this.toLocalTime().nano() - other.toLocalTime().nano();
|
|
96
|
+
if (cmp === 0) {
|
|
97
|
+
cmp = this.toLocalDateTime().compareTo(other.toLocalDateTime());
|
|
98
|
+
if (cmp === 0) {
|
|
99
|
+
cmp = strcmp(this.zone().id(), other.zone().id());
|
|
100
|
+
// we only support iso for now
|
|
101
|
+
//if (cmp === 0) {
|
|
102
|
+
// cmp = toLocalDate().getChronology().compareTo(other.toLocalDate().getChronology());
|
|
103
|
+
//}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return cmp;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
//-----------------------------------------------------------------------
|
|
111
|
+
/**
|
|
112
|
+
* Checks if the instant of this date-time is after that of the specified date-time.
|
|
113
|
+
*
|
|
114
|
+
* This method differs from the comparison in {@link compareTo} in that it
|
|
115
|
+
* only compares the instant of the date-time. This is equivalent to using
|
|
116
|
+
* `dateTime1.toInstant().isAfter(dateTime2.toInstant())`.
|
|
117
|
+
*
|
|
118
|
+
* @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null
|
|
119
|
+
* @return {boolean} true if this is after the specified date-time
|
|
120
|
+
*/
|
|
121
|
+
isAfter(other) {
|
|
122
|
+
requireNonNull(other, 'other');
|
|
123
|
+
const thisEpochSec = this.toEpochSecond();
|
|
124
|
+
const otherEpochSec = other.toEpochSecond();
|
|
125
|
+
return thisEpochSec > otherEpochSec ||
|
|
126
|
+
(thisEpochSec === otherEpochSec && this.toLocalTime().nano() > other.toLocalTime().nano());
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Checks if the instant of this date-time is before that of the specified date-time.
|
|
131
|
+
*
|
|
132
|
+
* This method differs from the comparison in {@link compareTo} in that it
|
|
133
|
+
* only compares the instant of the date-time. This is equivalent to using
|
|
134
|
+
* `dateTime1.toInstant().isBefore(dateTime2.toInstant())`.
|
|
135
|
+
*
|
|
136
|
+
* @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null
|
|
137
|
+
* @return {boolean} true if this point is before the specified date-time
|
|
138
|
+
*/
|
|
139
|
+
isBefore(other) {
|
|
140
|
+
requireNonNull(other, 'other');
|
|
141
|
+
const thisEpochSec = this.toEpochSecond();
|
|
142
|
+
const otherEpochSec = other.toEpochSecond();
|
|
143
|
+
return thisEpochSec < otherEpochSec ||
|
|
144
|
+
(thisEpochSec === otherEpochSec && this.toLocalTime().nano() < other.toLocalTime().nano());
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Checks if the instant of this date-time is equal to that of the specified date-time.
|
|
149
|
+
*
|
|
150
|
+
* This method differs from the comparison in {@link compareTo} and {@link equals}
|
|
151
|
+
* in that it only compares the instant of the date-time. This is equivalent to using
|
|
152
|
+
* `dateTime1.toInstant().equals(dateTime2.toInstant())`.
|
|
153
|
+
*
|
|
154
|
+
* @param {!ChronoZonedDateTime} other - the other date-time to compare to, not null
|
|
155
|
+
* @return {boolean} true if the instant equals the instant of the specified date-time
|
|
156
|
+
*/
|
|
157
|
+
isEqual(other) {
|
|
158
|
+
requireNonNull(other, 'other');
|
|
159
|
+
return this.toEpochSecond() === other.toEpochSecond() &&
|
|
160
|
+
this.toLocalTime().nano() === other.toLocalTime().nano();
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
//-----------------------------------------------------------------------
|
|
164
|
+
/**
|
|
165
|
+
* Checks if this date-time is equal to another date-time.
|
|
166
|
+
*
|
|
167
|
+
* The comparison is based on the offset date-time and the zone.
|
|
168
|
+
* To compare for the same instant on the time-line, use {@link compareTo}.
|
|
169
|
+
* Only objects of type {@link ChronoZoneDateTime} are compared, other types return false.
|
|
170
|
+
*
|
|
171
|
+
* @param {*} other the object to check, null returns false
|
|
172
|
+
* @return {boolean} true if this is equal to the other date-time
|
|
173
|
+
*/
|
|
174
|
+
equals(other) {
|
|
175
|
+
if (this === other) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
if (other instanceof ChronoZonedDateTime) {
|
|
179
|
+
return this.compareTo(other) === 0;
|
|
180
|
+
}
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function strcmp(a, b){
|
|
187
|
+
if (a < b) {
|
|
188
|
+
return -1;
|
|
189
|
+
}
|
|
190
|
+
if (a > b) {
|
|
191
|
+
return 1;
|
|
192
|
+
}
|
|
193
|
+
return 0;
|
|
194
|
+
}
|