@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,179 @@
|
|
|
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 {abstractMethodFail} from '../assert';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A unit of date-time, such as Days or Hours.
|
|
11
|
+
*
|
|
12
|
+
* Measurement of time is built on units, such as years, months, days, hours, minutes and seconds.
|
|
13
|
+
* Implementations of this interface represent those units.
|
|
14
|
+
*
|
|
15
|
+
* An instance of this interface represents the unit itself, rather than an amount of the unit.
|
|
16
|
+
* See {@link Period} for a class that represents an amount in terms of the common units.
|
|
17
|
+
*
|
|
18
|
+
* The most commonly used units are defined in {@link ChronoUnit}.
|
|
19
|
+
* Further units are supplied in {@link IsoFields}.
|
|
20
|
+
* Units can also be written by application code by implementing this interface.
|
|
21
|
+
*
|
|
22
|
+
* The unit works using double dispatch. Client code calls methods on a date-time like
|
|
23
|
+
* {@link LocalDateTime} which check if the unit is a {@link ChronoUnit}.
|
|
24
|
+
* If it is, then the date-time must handle it.
|
|
25
|
+
* Otherwise, the method call is re-dispatched to the matching method in this interface.
|
|
26
|
+
*
|
|
27
|
+
* @interface
|
|
28
|
+
*/
|
|
29
|
+
export class TemporalUnit {
|
|
30
|
+
/**
|
|
31
|
+
* Gets the duration of this unit, which may be an estimate.
|
|
32
|
+
*
|
|
33
|
+
* All units return a duration measured in standard nanoseconds from this method.
|
|
34
|
+
* The duration will be positive and non-zero.
|
|
35
|
+
* For example, an hour has a duration of `60 * 60 * 1,000,000,000 ns`.
|
|
36
|
+
*
|
|
37
|
+
* Some units may return an accurate duration while others return an estimate.
|
|
38
|
+
* For example, days have an estimated duration due to the possibility of
|
|
39
|
+
* daylight saving time changes.
|
|
40
|
+
* To determine if the duration is an estimate, use {@link isDurationEstimated}.
|
|
41
|
+
*
|
|
42
|
+
* @return {Duration} the duration of this unit, which may be an estimate.
|
|
43
|
+
*/
|
|
44
|
+
duration() {
|
|
45
|
+
abstractMethodFail('duration');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Checks if the duration of the unit is an estimate.
|
|
50
|
+
*
|
|
51
|
+
* All units have a duration, however the duration is not always accurate.
|
|
52
|
+
* For example, days have an estimated duration due to the possibility of
|
|
53
|
+
* daylight saving time changes.
|
|
54
|
+
* This method returns true if the duration is an estimate and false if it is
|
|
55
|
+
* accurate. Note that accurate/estimated ignores leap seconds.
|
|
56
|
+
*
|
|
57
|
+
* @return {boolean} `true` if the duration is estimated, `false` if accurate.
|
|
58
|
+
*/
|
|
59
|
+
isDurationEstimated() {
|
|
60
|
+
abstractMethodFail('isDurationEstimated');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Checks if this unit is date-based.
|
|
65
|
+
*
|
|
66
|
+
* @return {boolean} `true` if date unit, `false` if a time unit.
|
|
67
|
+
*/
|
|
68
|
+
isDateBased() {
|
|
69
|
+
abstractMethodFail('isDateBased');
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Checks if this unit is time-based.
|
|
74
|
+
*
|
|
75
|
+
* @return {boolean} `true` if time unit, `false` if a date unit.
|
|
76
|
+
*/
|
|
77
|
+
isTimeBased() {
|
|
78
|
+
abstractMethodFail('isTimeBased');
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//-----------------------------------------------------------------------
|
|
82
|
+
/**
|
|
83
|
+
* Checks if this unit is supported by the specified temporal object.
|
|
84
|
+
*
|
|
85
|
+
* This checks that the implementing date-time can add/subtract this unit.
|
|
86
|
+
* This can be used to avoid throwing an exception.
|
|
87
|
+
*
|
|
88
|
+
* @param {!Temporal} temporal the temporal object to check.
|
|
89
|
+
* @return {boolean} `true` if the unit is supported.
|
|
90
|
+
*/
|
|
91
|
+
// eslint-disable-next-line no-unused-vars
|
|
92
|
+
isSupportedBy(temporal) {
|
|
93
|
+
abstractMethodFail('isSupportedBy');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Returns a copy of the specified temporal object with the specified period added.
|
|
98
|
+
*
|
|
99
|
+
* The period added is a multiple of this unit. For example, this method
|
|
100
|
+
* could be used to add "3 days" to a date by calling this method on the
|
|
101
|
+
* instance representing "days", passing the date and the period "3".
|
|
102
|
+
* The period to be added may be negative, which is equivalent to subtraction.
|
|
103
|
+
*
|
|
104
|
+
* There are two equivalent ways of using this method.
|
|
105
|
+
* The first is to invoke this method directly.
|
|
106
|
+
* The second is to use {@link Temporal#plus}:
|
|
107
|
+
* <pre>
|
|
108
|
+
* // these two lines are equivalent, but the second approach is recommended
|
|
109
|
+
* temporal = thisUnit.doPlus(temporal);
|
|
110
|
+
* temporal = temporal.plus(thisUnit);
|
|
111
|
+
* </pre>
|
|
112
|
+
* It is recommended to use the second approach, {@link plus},
|
|
113
|
+
* as it is a lot clearer to read in code.
|
|
114
|
+
*
|
|
115
|
+
* Implementations should perform any queries or calculations using the units
|
|
116
|
+
* available in {@link ChronoUnit} or the fields available in {@link ChronoField}.
|
|
117
|
+
* If the field is not supported a {@link DateTimeException} must be thrown.
|
|
118
|
+
*
|
|
119
|
+
* Implementations must not alter the specified temporal object.
|
|
120
|
+
* Instead, an adjusted copy of the original must be returned.
|
|
121
|
+
* This provides equivalent, safe behavior for immutable and mutable implementations.
|
|
122
|
+
*
|
|
123
|
+
* @param {!Temporal} dateTime the temporal object to adjust.
|
|
124
|
+
* @param {number} periodToAdd the period of this unit to add, positive or negative.
|
|
125
|
+
* @return {Temporal} the adjusted temporal object.
|
|
126
|
+
* @throws DateTimeException if the period cannot be added.
|
|
127
|
+
*/
|
|
128
|
+
// eslint-disable-next-line no-unused-vars
|
|
129
|
+
addTo(dateTime, periodToAdd) {
|
|
130
|
+
abstractMethodFail('addTo');
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//-----------------------------------------------------------------------
|
|
134
|
+
/**
|
|
135
|
+
* Calculates the period in terms of this unit between two temporal objects of the same type.
|
|
136
|
+
*
|
|
137
|
+
* This calculates the period between two temporals in terms of this unit.
|
|
138
|
+
* The start and end points are supplied as temporal objects and must be of the same type.
|
|
139
|
+
* The result will be negative if the end is before the start.
|
|
140
|
+
* For example, the period in hours between two temporal objects can be calculated
|
|
141
|
+
* using {@link HOURS.between}.
|
|
142
|
+
*
|
|
143
|
+
* The calculation returns a whole number, representing the number of complete units between the two temporals.
|
|
144
|
+
* For example, the period in hours between the times 11:30 and 13:29 will only be
|
|
145
|
+
* one hour as it is one minute short of two hours.
|
|
146
|
+
*
|
|
147
|
+
* There are two equivalent ways of using this method.
|
|
148
|
+
* The first is to invoke this method directly.
|
|
149
|
+
* The second is to use {@link Temporal#until}:
|
|
150
|
+
* <pre>
|
|
151
|
+
* // these two lines are equivalent
|
|
152
|
+
* between = thisUnit.between(start, end);
|
|
153
|
+
* between = start.until(end, thisUnit);
|
|
154
|
+
* </pre>
|
|
155
|
+
* The choice should be made based on which makes the code more readable.
|
|
156
|
+
*
|
|
157
|
+
* For example, this method allows the number of days between two dates to be calculated:
|
|
158
|
+
* <pre>
|
|
159
|
+
* long daysBetween = DAYS.between(start, end);
|
|
160
|
+
* // or alternatively
|
|
161
|
+
* long daysBetween = start.until(end, DAYS);
|
|
162
|
+
* </pre>
|
|
163
|
+
* Implementations should perform any queries or calculations using the units available in
|
|
164
|
+
* {@link ChronoUnit} or the fields available in {@link ChronoField}.
|
|
165
|
+
* If the unit is not supported a {@link DateTimeException} must be thrown.
|
|
166
|
+
* Implementations must not alter the specified temporal objects.
|
|
167
|
+
*
|
|
168
|
+
* @param {!Temporal} temporal1 the base temporal object.
|
|
169
|
+
* @param {!Temporal} temporal2 the other temporal object.
|
|
170
|
+
* @return {number} the period between temporal1 and temporal2 in terms of this unit;
|
|
171
|
+
* positive if temporal2 is later than temporal1, negative if earlier.
|
|
172
|
+
* @throws DateTimeException if the period cannot be calculated.
|
|
173
|
+
* @throws ArithmeticException if numeric overflow occurs.
|
|
174
|
+
*/
|
|
175
|
+
// eslint-disable-next-line no-unused-vars
|
|
176
|
+
between(temporal1, temporal2) {
|
|
177
|
+
abstractMethodFail('between');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
@@ -0,0 +1,257 @@
|
|
|
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 {assert} from '../assert';
|
|
8
|
+
import {DateTimeException, IllegalArgumentException} from '../errors';
|
|
9
|
+
import {MathUtil} from '../MathUtil';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The range of valid values for a date-time field.
|
|
13
|
+
*
|
|
14
|
+
* All TemporalField instances have a valid range of values.
|
|
15
|
+
* For example, the ISO day-of-month runs from 1 to somewhere between 28 and 31.
|
|
16
|
+
* This class captures that valid range.
|
|
17
|
+
*
|
|
18
|
+
* It is important to be aware of the limitations of this class.
|
|
19
|
+
* Only the minimum and maximum values are provided.
|
|
20
|
+
* It is possible for there to be invalid values within the outer range.
|
|
21
|
+
* For example, a weird field may have valid values of 1, 2, 4, 6, 7, thus
|
|
22
|
+
* have a range of '1 - 7', despite that fact that values 3 and 5 are invalid.
|
|
23
|
+
*
|
|
24
|
+
* Instances of this class are not tied to a specific field.
|
|
25
|
+
*/
|
|
26
|
+
export class ValueRange {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @param {!number} minSmallest
|
|
31
|
+
* @param {!number} minLargest
|
|
32
|
+
* @param {!number} maxSmallest
|
|
33
|
+
* @param {!number} maxLargest
|
|
34
|
+
* @private
|
|
35
|
+
*/
|
|
36
|
+
constructor(minSmallest, minLargest, maxSmallest, maxLargest) {
|
|
37
|
+
assert(!(minSmallest > minLargest), 'Smallest minimum value \'' + minSmallest +
|
|
38
|
+
'\' must be less than largest minimum value \'' + minLargest + '\'', IllegalArgumentException);
|
|
39
|
+
assert(!(maxSmallest > maxLargest), 'Smallest maximum value \'' + maxSmallest +
|
|
40
|
+
'\' must be less than largest maximum value \'' + maxLargest + '\'', IllegalArgumentException);
|
|
41
|
+
assert(!(minLargest > maxLargest), 'Minimum value \'' + minLargest +
|
|
42
|
+
'\' must be less than maximum value \'' + maxLargest + '\'', IllegalArgumentException);
|
|
43
|
+
|
|
44
|
+
this._minSmallest = minSmallest;
|
|
45
|
+
this._minLargest = minLargest;
|
|
46
|
+
this._maxLargest = maxLargest;
|
|
47
|
+
this._maxSmallest = maxSmallest;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Is the value range fixed and fully known.
|
|
52
|
+
*
|
|
53
|
+
* For example, the ISO day-of-month runs from 1 to between 28 and 31.
|
|
54
|
+
* Since there is uncertainty about the maximum value, the range is not fixed.
|
|
55
|
+
* However, for the month of January, the range is always 1 to 31, thus it is fixed.
|
|
56
|
+
*
|
|
57
|
+
* @return {boolean} true if the set of values is fixed
|
|
58
|
+
*/
|
|
59
|
+
isFixed() {
|
|
60
|
+
return this._minSmallest === this._minLargest && this._maxSmallest === this._maxLargest;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @returns {number}
|
|
66
|
+
*/
|
|
67
|
+
minimum(){
|
|
68
|
+
return this._minSmallest;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
*
|
|
73
|
+
* @returns {number}
|
|
74
|
+
*/
|
|
75
|
+
largestMinimum(){
|
|
76
|
+
return this._minLargest;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
*
|
|
81
|
+
* @returns {number}
|
|
82
|
+
*/
|
|
83
|
+
maximum(){
|
|
84
|
+
return this._maxLargest;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @returns {number}
|
|
90
|
+
*/
|
|
91
|
+
smallestMaximum(){
|
|
92
|
+
return this._maxSmallest;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
*
|
|
97
|
+
* @returns {boolean}
|
|
98
|
+
*/
|
|
99
|
+
isValidValue(value) {
|
|
100
|
+
return (this.minimum() <= value && value <= this.maximum());
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
*
|
|
105
|
+
* @param {number} value
|
|
106
|
+
* @param {TemporalField} field
|
|
107
|
+
*/
|
|
108
|
+
checkValidValue(value, field) {
|
|
109
|
+
let msg;
|
|
110
|
+
if (!this.isValidValue(value)) {
|
|
111
|
+
if (field != null) {
|
|
112
|
+
msg = ('Invalid value for ' + field + ' (valid values ' + (this.toString()) + '): ') + value;
|
|
113
|
+
} else {
|
|
114
|
+
msg = ('Invalid value (valid values ' + (this.toString()) + '): ') + value;
|
|
115
|
+
}
|
|
116
|
+
return assert(false, msg, DateTimeException);
|
|
117
|
+
}
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Checks that the specified value is valid and fits in an `int`.
|
|
123
|
+
*
|
|
124
|
+
* This validates that the value is within the valid range of values and that
|
|
125
|
+
* all valid values are within the bounds of an `int`.
|
|
126
|
+
* The field is only used to improve the error message.
|
|
127
|
+
*
|
|
128
|
+
* @param {number} value - the value to check
|
|
129
|
+
* @param {TemporalField} field - the field being checked, may be null
|
|
130
|
+
* @return {number} the value that was passed in
|
|
131
|
+
* @see #isValidIntValue(long)
|
|
132
|
+
*/
|
|
133
|
+
checkValidIntValue(value, field) {
|
|
134
|
+
if (this.isValidIntValue(value) === false) {
|
|
135
|
+
throw new DateTimeException('Invalid int value for ' + field + ': ' + value);
|
|
136
|
+
}
|
|
137
|
+
return value;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Checks if the value is within the valid range and that all values
|
|
142
|
+
* in the range fit in an `int`.
|
|
143
|
+
*
|
|
144
|
+
* This method combines {@link isIntValue} and {@link isValidValue}.
|
|
145
|
+
*
|
|
146
|
+
* @param {number} value - the value to check
|
|
147
|
+
* @return true if the value is valid and fits in an `int`
|
|
148
|
+
*/
|
|
149
|
+
isValidIntValue(value) {
|
|
150
|
+
return this.isIntValue() && this.isValidValue(value);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Checks if all values in the range fit in an `int`.
|
|
155
|
+
*
|
|
156
|
+
* This checks that all valid values are within the bounds of an `int`.
|
|
157
|
+
*
|
|
158
|
+
* For example, the ISO month-of-year has values from 1 to 12, which fits in an `int`.
|
|
159
|
+
* By comparison, ISO nano-of-day runs from 1 to 86,400,000,000,000 which does not fit in an `int`.
|
|
160
|
+
*
|
|
161
|
+
* This implementation uses {@link getMinimum} and {@link getMaximum}.
|
|
162
|
+
*
|
|
163
|
+
* @return boolean if a valid value always fits in an `int`
|
|
164
|
+
*/
|
|
165
|
+
isIntValue() { // should be isSafeIntegerValue
|
|
166
|
+
return this.minimum() >= MathUtil.MIN_SAFE_INTEGER && this.maximum() <= MathUtil.MAX_SAFE_INTEGER;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Checks if this range is equal to another range.
|
|
171
|
+
*
|
|
172
|
+
* The comparison is based on the four values, minimum, largest minimum,
|
|
173
|
+
* smallest maximum and maximum.
|
|
174
|
+
* Only objects of type {@link ValueRange} are compared, other types return false.
|
|
175
|
+
*
|
|
176
|
+
* @param {*} other - the object to check, null returns false
|
|
177
|
+
* @return {boolean} true if this is equal to the other range
|
|
178
|
+
*/
|
|
179
|
+
equals(other) {
|
|
180
|
+
if (other === this) {
|
|
181
|
+
return true;
|
|
182
|
+
}
|
|
183
|
+
if (other instanceof ValueRange) {
|
|
184
|
+
return this._minSmallest === other._minSmallest && this._minLargest === other._minLargest &&
|
|
185
|
+
this._maxSmallest === other._maxSmallest && this._maxLargest === other._maxLargest;
|
|
186
|
+
}
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* A hash code for this range.
|
|
192
|
+
*
|
|
193
|
+
* @return {number} a suitable hash code
|
|
194
|
+
*/
|
|
195
|
+
hashCode() {
|
|
196
|
+
return MathUtil.hashCode(this._minSmallest, this._minLargest, this._maxSmallest, this._maxLargest);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/*
|
|
200
|
+
* Outputs this range as a String.
|
|
201
|
+
*
|
|
202
|
+
* The format will be '{min}/{largestMin} - {smallestMax}/{max}',
|
|
203
|
+
* where the largestMin or smallestMax sections may be omitted, together
|
|
204
|
+
* with associated slash, if they are the same as the min or max.
|
|
205
|
+
*
|
|
206
|
+
* @return {string} a string representation of this range, not null
|
|
207
|
+
*/
|
|
208
|
+
toString() {
|
|
209
|
+
let str = this.minimum() + (this.minimum() !== this.largestMinimum() ? '/' + (this.largestMinimum()) : '');
|
|
210
|
+
str += ' - ';
|
|
211
|
+
str += this.smallestMaximum() + (this.smallestMaximum() !== this.maximum() ? '/' + (this.maximum()) : '');
|
|
212
|
+
return str;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/*
|
|
216
|
+
* called with 2 params: Obtains a fixed value range.
|
|
217
|
+
*
|
|
218
|
+
* This factory obtains a range where the minimum and maximum values are fixed.
|
|
219
|
+
* For example, the ISO month-of-year always runs from 1 to 12.
|
|
220
|
+
*
|
|
221
|
+
* @param min the minimum value
|
|
222
|
+
* @param max the maximum value
|
|
223
|
+
* @return the ValueRange for min, max, not null
|
|
224
|
+
|
|
225
|
+
* called with 3 params: Obtains a variable value range.
|
|
226
|
+
*
|
|
227
|
+
* This factory obtains a range where the minimum value is fixed and the maximum value may vary.
|
|
228
|
+
* For example, the ISO day-of-month always starts at 1, but ends between 28 and 31.
|
|
229
|
+
*
|
|
230
|
+
* @param min the minimum value
|
|
231
|
+
* @param maxSmallest the smallest maximum value
|
|
232
|
+
* @param maxLargest the largest maximum value
|
|
233
|
+
* @return the ValueRange for min, smallest max, largest max, not null
|
|
234
|
+
|
|
235
|
+
* called with 4 params: Obtains a fully variable value range.
|
|
236
|
+
*
|
|
237
|
+
* This factory obtains a range where both the minimum and maximum value may vary.
|
|
238
|
+
*
|
|
239
|
+
* @param minSmallest the smallest minimum value
|
|
240
|
+
* @param minLargest the largest minimum value
|
|
241
|
+
* @param maxSmallest the smallest maximum value
|
|
242
|
+
* @param maxLargest the largest maximum value
|
|
243
|
+
*
|
|
244
|
+
* @return {ValueRange} the ValueRange for smallest min, largest min, smallest max, largest max, not null
|
|
245
|
+
*/
|
|
246
|
+
static of() {
|
|
247
|
+
if (arguments.length === 2) {
|
|
248
|
+
return new ValueRange(arguments[0], arguments[0], arguments[1], arguments[1]);
|
|
249
|
+
} else if (arguments.length === 3) {
|
|
250
|
+
return new ValueRange(arguments[0], arguments[0], arguments[1], arguments[2]);
|
|
251
|
+
} else if (arguments.length === 4) {
|
|
252
|
+
return new ValueRange(arguments[0], arguments[1], arguments[2], arguments[3]);
|
|
253
|
+
} else {
|
|
254
|
+
return assert(false, 'Invalid number of arguments ' + arguments.length, IllegalArgumentException);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
export function bindUse(jsJoda) {
|
|
3
|
+
const used = [];
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* use
|
|
7
|
+
*
|
|
8
|
+
* Provides a way to extend the internals of js-joda
|
|
9
|
+
*
|
|
10
|
+
* @param {function} fn - function to extend js-joda public api
|
|
11
|
+
* @returns {this} for chaining
|
|
12
|
+
*/
|
|
13
|
+
return function use(fn) {
|
|
14
|
+
if (!~used.indexOf(fn)) {
|
|
15
|
+
fn(jsJoda);
|
|
16
|
+
used.push(fn);
|
|
17
|
+
}
|
|
18
|
+
return jsJoda;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 {SystemDefaultZoneRules} from './SystemDefaultZoneRules';
|
|
7
|
+
import {ZoneId} from '../ZoneId';
|
|
8
|
+
|
|
9
|
+
export class SystemDefaultZoneId extends ZoneId {
|
|
10
|
+
|
|
11
|
+
constructor(){
|
|
12
|
+
super();
|
|
13
|
+
this._rules = new SystemDefaultZoneRules();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
rules(){
|
|
17
|
+
return this._rules;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
equals(other){
|
|
21
|
+
if(this === other){
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
id(){
|
|
28
|
+
return 'SYSTEM';
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
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 {ZoneRules} from './ZoneRules';
|
|
7
|
+
import {ZoneOffset} from '../ZoneOffset';
|
|
8
|
+
import {DateTimeException} from '../errors';
|
|
9
|
+
|
|
10
|
+
export class SystemDefaultZoneRules extends ZoneRules {
|
|
11
|
+
|
|
12
|
+
isFixedOffset(){
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param {Instant} instant
|
|
19
|
+
* @returns {ZoneOffset}
|
|
20
|
+
*/
|
|
21
|
+
offsetOfInstant(instant){
|
|
22
|
+
const offsetInMinutes = new Date(instant.toEpochMilli()).getTimezoneOffset();
|
|
23
|
+
return ZoneOffset.ofTotalMinutes(offsetInMinutes * -1);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
*
|
|
28
|
+
* @param {number} epochMilli
|
|
29
|
+
* @returns {ZoneOffset}
|
|
30
|
+
*/
|
|
31
|
+
offsetOfEpochMilli(epochMilli){
|
|
32
|
+
const offsetInMinutes = new Date(epochMilli).getTimezoneOffset();
|
|
33
|
+
return ZoneOffset.ofTotalMinutes(offsetInMinutes * -1);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* This implementation is NOT returning the best value in a gap or overlap situation
|
|
38
|
+
* as specified at {@link ZoneRules.offsetOfLocalDateTime}.
|
|
39
|
+
*
|
|
40
|
+
* The calculated offset depends Date.prototype.getTimezoneOffset and its not specified
|
|
41
|
+
* at the ECMA-262 specification how to handle daylight savings gaps/ overlaps.
|
|
42
|
+
*
|
|
43
|
+
* The Chrome Browser version 49 is returning the next transition offset in a gap/overlap situation,
|
|
44
|
+
* other browsers/ engines might do it in the same way.
|
|
45
|
+
*
|
|
46
|
+
* @param {LocalDateTime} localDateTime
|
|
47
|
+
* @returns {ZoneOffset}
|
|
48
|
+
*/
|
|
49
|
+
offsetOfLocalDateTime(localDateTime){
|
|
50
|
+
const epochMilli = localDateTime.toEpochSecond(ZoneOffset.UTC) * 1000;
|
|
51
|
+
const offsetInMinutesBeforePossibleTransition = new Date(epochMilli).getTimezoneOffset();
|
|
52
|
+
const epochMilliSystemZone = epochMilli + offsetInMinutesBeforePossibleTransition * 60000;
|
|
53
|
+
const offsetInMinutesAfterPossibleTransition = new Date(epochMilliSystemZone).getTimezoneOffset();
|
|
54
|
+
return ZoneOffset.ofTotalMinutes(offsetInMinutesAfterPossibleTransition * -1);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @param localDateTime
|
|
60
|
+
* @return {ZoneOffset[]}
|
|
61
|
+
*/
|
|
62
|
+
validOffsets(localDateTime){
|
|
63
|
+
return [this.offsetOfLocalDateTime(localDateTime)];
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @return null, not supported
|
|
68
|
+
*/
|
|
69
|
+
transition(){
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @param instant
|
|
76
|
+
* @return {ZoneOffset}
|
|
77
|
+
*/
|
|
78
|
+
standardOffset(instant){
|
|
79
|
+
return this.offsetOfInstant(instant);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* @throws DateTimeException not supported
|
|
84
|
+
*/
|
|
85
|
+
daylightSavings(){
|
|
86
|
+
this._throwNotSupported();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @throws DateTimeException not supported
|
|
91
|
+
*/
|
|
92
|
+
isDaylightSavings(){
|
|
93
|
+
this._throwNotSupported();
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
*
|
|
98
|
+
* @param {LocalDateTime} dateTime
|
|
99
|
+
* @param {ZoneOffset} offset
|
|
100
|
+
* @return {boolean}
|
|
101
|
+
*/
|
|
102
|
+
isValidOffset(dateTime, offset) {
|
|
103
|
+
return this.offsetOfLocalDateTime(dateTime).equals(offset);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @throws DateTimeException not supported
|
|
108
|
+
*/
|
|
109
|
+
nextTransition(){
|
|
110
|
+
this._throwNotSupported();
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* @throws DateTimeException not supported
|
|
115
|
+
*/
|
|
116
|
+
previousTransition(){
|
|
117
|
+
this._throwNotSupported();
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* @throws DateTimeException not supported
|
|
122
|
+
*/
|
|
123
|
+
transitions(){
|
|
124
|
+
this._throwNotSupported();
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* @throws DateTimeException not supported
|
|
129
|
+
*/
|
|
130
|
+
transitionRules(){
|
|
131
|
+
this._throwNotSupported();
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @throws DateTimeException not supported
|
|
136
|
+
*/
|
|
137
|
+
_throwNotSupported(){
|
|
138
|
+
throw new DateTimeException('not supported operation');
|
|
139
|
+
}
|
|
140
|
+
//-----------------------------------------------------------------------
|
|
141
|
+
/**
|
|
142
|
+
*
|
|
143
|
+
* @param {*} other
|
|
144
|
+
* @returns {boolean}
|
|
145
|
+
*/
|
|
146
|
+
equals(other) {
|
|
147
|
+
if (this === other || other instanceof SystemDefaultZoneRules) {
|
|
148
|
+
return true;
|
|
149
|
+
} else {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
*
|
|
156
|
+
* @returns {string}
|
|
157
|
+
*/
|
|
158
|
+
toString() {
|
|
159
|
+
return 'SYSTEM';
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
}
|