@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,236 @@
|
|
|
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
|
+
import {DateTimeException} from './errors';
|
|
9
|
+
|
|
10
|
+
import {StringUtil} from './StringUtil';
|
|
11
|
+
|
|
12
|
+
import {Instant} from './Instant';
|
|
13
|
+
|
|
14
|
+
export class ZoneId {
|
|
15
|
+
/**
|
|
16
|
+
* Gets the system default time-zone.
|
|
17
|
+
*
|
|
18
|
+
* @return {ZoneId} the zone ID, not null
|
|
19
|
+
*/
|
|
20
|
+
static systemDefault() {
|
|
21
|
+
// Find implementation at {@link ZoneIdFactory}
|
|
22
|
+
throw new DateTimeException('not supported operation');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Gets the set of available zone IDs.
|
|
27
|
+
*
|
|
28
|
+
* This set includes the string form of all available region-based IDs.
|
|
29
|
+
* Offset-based zone IDs are not included in the returned set.
|
|
30
|
+
* The ID can be passed to {@link of} to create a {@link ZoneId}.
|
|
31
|
+
*
|
|
32
|
+
* The set of zone IDs can increase over time, although in a typical application
|
|
33
|
+
* the set of IDs is fixed. Each call to this method is thread-safe.
|
|
34
|
+
*
|
|
35
|
+
* @return {string[]} a modifiable copy of the set of zone IDs, not null
|
|
36
|
+
*/
|
|
37
|
+
static getAvailableZoneIds() {
|
|
38
|
+
// Find implementation at {@link ZoneIdFactory}
|
|
39
|
+
throw new DateTimeException('not supported operation');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Obtains an instance of {@link ZoneId} from an ID ensuring that the
|
|
44
|
+
* ID is valid and available for use.
|
|
45
|
+
*
|
|
46
|
+
* This method parses the ID producing a {@link ZoneId} or {@link ZoneOffset}.
|
|
47
|
+
* A {@link ZoneOffset} is returned if the ID is 'Z', or starts with '+' or '-'.
|
|
48
|
+
* The result will always be a valid ID for which {@link ZoneRules} can be obtained.
|
|
49
|
+
*
|
|
50
|
+
* Parsing matches the zone ID step by step as follows.
|
|
51
|
+
*
|
|
52
|
+
* * If the zone ID equals 'Z', the result is {@link ZoneOffset.UTC}.
|
|
53
|
+
* * If the zone ID consists of a single letter, the zone ID is invalid
|
|
54
|
+
* and {@link DateTimeException} is thrown.
|
|
55
|
+
* * If the zone ID starts with '+' or '-', the ID is parsed as a
|
|
56
|
+
* {@link ZoneOffset} using {@link ZoneOffset#of}.
|
|
57
|
+
* * If the zone ID equals 'GMT', 'UTC' or 'UT' then the result is a {@link ZoneId}
|
|
58
|
+
* with the same ID and rules equivalent to {@link ZoneOffset.UTC}.
|
|
59
|
+
* * If the zone ID starts with 'UTC+', 'UTC-', 'GMT+', 'GMT-', 'UT+' or 'UT-'
|
|
60
|
+
* then the ID is a prefixed offset-based ID. The ID is split in two, with
|
|
61
|
+
* a two or three letter prefix and a suffix starting with the sign.
|
|
62
|
+
* The suffix is parsed as a {@link ZoneOffset}.
|
|
63
|
+
* The result will be a {@link ZoneId} with the specified UTC/GMT/UT prefix
|
|
64
|
+
* and the normalized offset ID as per {@link ZoneOffset#getId}.
|
|
65
|
+
* The rules of the returned {@link ZoneId} will be equivalent to the
|
|
66
|
+
* parsed {@link ZoneOffset}.
|
|
67
|
+
* * All other IDs are parsed as region-based zone IDs. Region IDs must
|
|
68
|
+
* match the regular expression `[A-Za-z][A-Za-z0-9~/._+-]+`,
|
|
69
|
+
* otherwise a {@link DateTimeException} is thrown. If the zone ID is not
|
|
70
|
+
* in the configured set of IDs, {@link ZoneRulesException} is thrown.
|
|
71
|
+
* The detailed format of the region ID depends on the group supplying the data.
|
|
72
|
+
* The default set of data is supplied by the IANA Time Zone Database (TZDB).
|
|
73
|
+
* This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.
|
|
74
|
+
* This is compatible with most IDs from {@link java.util.TimeZone}.
|
|
75
|
+
*
|
|
76
|
+
* @param {string} zoneId the time-zone ID, not null
|
|
77
|
+
* @return {ZoneId} the zone ID, not null
|
|
78
|
+
* @throws DateTimeException if the zone ID has an invalid format
|
|
79
|
+
* @throws ZoneRulesException if the zone ID is a region ID that cannot be found
|
|
80
|
+
*/
|
|
81
|
+
static of(zoneId) {
|
|
82
|
+
// Find implementation at {@link ZoneIdFactory}
|
|
83
|
+
throw new DateTimeException('not supported operation' + zoneId);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Obtains an instance of {@link ZoneId} wrapping an offset.
|
|
88
|
+
*
|
|
89
|
+
* If the prefix is 'GMT', 'UTC', or 'UT' a {@link ZoneId}
|
|
90
|
+
* with the prefix and the non-zero offset is returned.
|
|
91
|
+
* If the prefix is empty `''` the {@link ZoneOffset} is returned.
|
|
92
|
+
*
|
|
93
|
+
* @param {string} prefix the time-zone ID, not null
|
|
94
|
+
* @param {ZoneOffset} offset the offset, not null
|
|
95
|
+
* @return {ZoneId} the zone ID, not null
|
|
96
|
+
* @throws IllegalArgumentException if the prefix is not one of
|
|
97
|
+
* 'GMT', 'UTC', or 'UT', or ''
|
|
98
|
+
*/
|
|
99
|
+
static ofOffset(prefix, offset) {
|
|
100
|
+
// Find implementation at {@link ZoneIdFactory}
|
|
101
|
+
throw new DateTimeException('not supported operation' + prefix + offset);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Obtains an instance of {@link ZoneId} from a temporal object.
|
|
107
|
+
*
|
|
108
|
+
* A {@link TemporalAccessor} represents some form of date and time information.
|
|
109
|
+
* This factory converts the arbitrary temporal object to an instance of {@link ZoneId}.
|
|
110
|
+
*
|
|
111
|
+
* The conversion will try to obtain the zone in a way that favours region-based
|
|
112
|
+
* zones over offset-based zones using {@link TemporalQueries#zone}.
|
|
113
|
+
*
|
|
114
|
+
* This method matches the signature of the functional interface {@link TemporalQuery}
|
|
115
|
+
* allowing it to be used in queries via method reference, {@link ZoneId::from}.
|
|
116
|
+
*
|
|
117
|
+
* @param {!TemporalAccessor} temporal - the temporal object to convert, not null
|
|
118
|
+
* @return {ZoneId} the zone ID, not null
|
|
119
|
+
* @throws DateTimeException if unable to convert to a {@link ZoneId}
|
|
120
|
+
*/
|
|
121
|
+
static from(temporal) {
|
|
122
|
+
// Find implementation at {@link ZoneIdFactory}
|
|
123
|
+
throw new DateTimeException('not supported operation' + temporal);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
//-----------------------------------------------------------------------
|
|
127
|
+
/**
|
|
128
|
+
* Gets the unique time-zone ID.
|
|
129
|
+
*
|
|
130
|
+
* This ID uniquely defines this object.
|
|
131
|
+
* The format of an offset based ID is defined by {@link ZoneOffset#getId}.
|
|
132
|
+
*
|
|
133
|
+
* @return {String} the time-zone unique ID, not null
|
|
134
|
+
*/
|
|
135
|
+
id(){
|
|
136
|
+
abstractMethodFail('ZoneId.id');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
//-----------------------------------------------------------------------
|
|
140
|
+
/**
|
|
141
|
+
* Gets the time-zone rules for this ID allowing calculations to be performed.
|
|
142
|
+
*
|
|
143
|
+
* The rules provide the functionality associated with a time-zone,
|
|
144
|
+
* such as finding the offset for a given instant or local date-time.
|
|
145
|
+
*
|
|
146
|
+
* A time-zone can be invalid if it is deserialized in a Java Runtime which
|
|
147
|
+
* does not have the same rules loaded as the Java Runtime that stored it.
|
|
148
|
+
* In this case, calling this method will throw a {@link ZoneRulesException}.
|
|
149
|
+
*
|
|
150
|
+
* The rules are supplied by {@link ZoneRulesProvider}. An advanced provider may
|
|
151
|
+
* support dynamic updates to the rules without restarting the Java Runtime.
|
|
152
|
+
* If so, then the result of this method may change over time.
|
|
153
|
+
* Each individual call will be still remain thread-safe.
|
|
154
|
+
*
|
|
155
|
+
* {@link ZoneOffset} will always return a set of rules where the offset never changes.
|
|
156
|
+
*
|
|
157
|
+
* @return {!ZoneRules} the rules, not null
|
|
158
|
+
* @throws ZoneRulesException if no rules are available for this ID
|
|
159
|
+
*/
|
|
160
|
+
rules(){
|
|
161
|
+
abstractMethodFail('ZoneId.rules');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Normalizes the time-zone ID, returning a {@link ZoneOffset} where possible.
|
|
166
|
+
*
|
|
167
|
+
* The returns a normalized {@link ZoneId} that can be used in place of this ID.
|
|
168
|
+
* The result will have {@link ZoneRules} equivalent to those returned by this object,
|
|
169
|
+
* however the ID returned by {@link getId} may be different.
|
|
170
|
+
*
|
|
171
|
+
* The normalization checks if the rules of this {@link ZoneId} have a fixed offset.
|
|
172
|
+
* If they do, then the {@link ZoneOffset} equal to that offset is returned.
|
|
173
|
+
* Otherwise `this` is returned.
|
|
174
|
+
*
|
|
175
|
+
* @return {ZoneId} the time-zone unique ID, not null
|
|
176
|
+
*/
|
|
177
|
+
normalized() {
|
|
178
|
+
const rules = this.rules();
|
|
179
|
+
if (rules.isFixedOffset()) {
|
|
180
|
+
return rules.offset(Instant.EPOCH);
|
|
181
|
+
}
|
|
182
|
+
//try {
|
|
183
|
+
//} catch (ZoneRulesException ex) {
|
|
184
|
+
// // ignore invalid objects
|
|
185
|
+
//}
|
|
186
|
+
return this;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
//-----------------------------------------------------------------------
|
|
190
|
+
/**
|
|
191
|
+
* Checks if this time-zone ID is equal to another time-zone ID.
|
|
192
|
+
*
|
|
193
|
+
* The comparison is based on the ID.
|
|
194
|
+
*
|
|
195
|
+
* @param {*} other the object to check, null returns false
|
|
196
|
+
* @return {boolean} true if this is equal to the other time-zone ID
|
|
197
|
+
*/
|
|
198
|
+
equals(other) {
|
|
199
|
+
if (this === other) {
|
|
200
|
+
return true;
|
|
201
|
+
}
|
|
202
|
+
if (other instanceof ZoneId) {
|
|
203
|
+
return this.id() === other.id();
|
|
204
|
+
}
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* A hash code for this time-zone ID.
|
|
210
|
+
*
|
|
211
|
+
* @return {number} a suitable hash code
|
|
212
|
+
*/
|
|
213
|
+
hashCode() {
|
|
214
|
+
return StringUtil.hashCode(this.id());
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
//-----------------------------------------------------------------------
|
|
218
|
+
/**
|
|
219
|
+
* Outputs this zone as a string, using the ID.
|
|
220
|
+
*
|
|
221
|
+
* @return {string} a string representation of this time-zone ID, not null
|
|
222
|
+
*/
|
|
223
|
+
toString() {
|
|
224
|
+
return this.id();
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* toJSON() use by JSON.stringify
|
|
229
|
+
* delegates to toString()
|
|
230
|
+
*
|
|
231
|
+
* @return {string}
|
|
232
|
+
*/
|
|
233
|
+
toJSON() {
|
|
234
|
+
return this.toString();
|
|
235
|
+
}
|
|
236
|
+
}
|
|
@@ -0,0 +1,201 @@
|
|
|
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 {DateTimeException, IllegalArgumentException} from './errors';
|
|
9
|
+
import {StringUtil} from './StringUtil';
|
|
10
|
+
|
|
11
|
+
import {ZoneOffset} from './ZoneOffset';
|
|
12
|
+
import {ZoneRegion} from './ZoneRegion';
|
|
13
|
+
import {ZoneId} from './ZoneId';
|
|
14
|
+
|
|
15
|
+
import {TemporalQueries} from './temporal/TemporalQueries';
|
|
16
|
+
import {SystemDefaultZoneId} from './zone/SystemDefaultZoneId';
|
|
17
|
+
import {ZoneRulesProvider} from './zone/ZoneRulesProvider';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @see {@link ZoneId}
|
|
21
|
+
*
|
|
22
|
+
* Helper class to avoid dependency cycles.
|
|
23
|
+
* Static methods of the class ZoneIdFactory are added automatically to class ZoneId.
|
|
24
|
+
* @private
|
|
25
|
+
*/
|
|
26
|
+
export class ZoneIdFactory {
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Gets the system default time-zone.
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* @return {ZoneId} the zone ID, not null
|
|
33
|
+
*/
|
|
34
|
+
static systemDefault() {
|
|
35
|
+
return SYSTEM_DEFAULT_ZONE_ID_INSTANCE;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Gets the set of available zone IDs.
|
|
40
|
+
*
|
|
41
|
+
* This set includes the string form of all available region-based IDs.
|
|
42
|
+
* Offset-based zone IDs are not included in the returned set.
|
|
43
|
+
* The ID can be passed to {@link of} to create a {@link ZoneId}.
|
|
44
|
+
*
|
|
45
|
+
* The set of zone IDs can increase over time, although in a typical application
|
|
46
|
+
* the set of IDs is fixed. Each call to this method is thread-safe.
|
|
47
|
+
*
|
|
48
|
+
* @return {string[]} a modifiable copy of the set of zone IDs, not null
|
|
49
|
+
*/
|
|
50
|
+
static getAvailableZoneIds() {
|
|
51
|
+
return ZoneRulesProvider.getAvailableZoneIds();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Obtains an instance of {@link ZoneId} from an ID ensuring that the
|
|
56
|
+
* ID is valid and available for use.
|
|
57
|
+
*
|
|
58
|
+
* This method parses the ID producing a {@link ZoneId} or {@link ZoneOffset}.
|
|
59
|
+
* A {@link ZoneOffset} is returned if the ID is 'Z', or starts with '+' or '-'.
|
|
60
|
+
* The result will always be a valid ID for which {@link ZoneRules} can be obtained.
|
|
61
|
+
*
|
|
62
|
+
* Parsing matches the zone ID step by step as follows.
|
|
63
|
+
*
|
|
64
|
+
* * If the zone ID equals 'Z', the result is {@link ZoneOffset.UTC}.
|
|
65
|
+
* * If the zone ID consists of a single letter, the zone ID is invalid
|
|
66
|
+
* and {@link DateTimeException} is thrown.
|
|
67
|
+
* * If the zone ID starts with '+' or '-', the ID is parsed as a
|
|
68
|
+
* {@link ZoneOffset} using {@link ZoneOffset#of}.
|
|
69
|
+
* * If the zone ID equals 'GMT', 'UTC' or 'UT' then the result is a {@link ZoneId}
|
|
70
|
+
* with the same ID and rules equivalent to {@link ZoneOffset.UTC}.
|
|
71
|
+
* * If the zone ID starts with 'UTC+', 'UTC-', 'GMT+', 'GMT-', 'UT+' or 'UT-'
|
|
72
|
+
* then the ID is a prefixed offset-based ID. The ID is split in two, with
|
|
73
|
+
* a two or three letter prefix and a suffix starting with the sign.
|
|
74
|
+
* The suffix is parsed as a {@link ZoneOffset}.
|
|
75
|
+
* The result will be a {@link ZoneId} with the specified UTC/GMT/UT prefix
|
|
76
|
+
* and the normalized offset ID as per {@link ZoneOffset#getId}.
|
|
77
|
+
* The rules of the returned {@link ZoneId} will be equivalent to the
|
|
78
|
+
* parsed {@link ZoneOffset}.
|
|
79
|
+
* * All other IDs are parsed as region-based zone IDs. Region IDs must
|
|
80
|
+
* match the regular expression `[A-Za-z][A-Za-z0-9~/._+-]+`,
|
|
81
|
+
* otherwise a {@link DateTimeException} is thrown. If the zone ID is not
|
|
82
|
+
* in the configured set of IDs, {@link ZoneRulesException} is thrown.
|
|
83
|
+
* The detailed format of the region ID depends on the group supplying the data.
|
|
84
|
+
* The default set of data is supplied by the IANA Time Zone Database (TZDB).
|
|
85
|
+
* This has region IDs of the form '{area}/{city}', such as 'Europe/Paris' or 'America/New_York'.
|
|
86
|
+
* This is compatible with most IDs from {@link java.util.TimeZone}.
|
|
87
|
+
*
|
|
88
|
+
* @param {string} zoneId the time-zone ID, not null
|
|
89
|
+
* @return {ZoneId} the zone ID, not null
|
|
90
|
+
* @throws DateTimeException if the zone ID has an invalid format
|
|
91
|
+
* @throws ZoneRulesException if the zone ID is a region ID that cannot be found
|
|
92
|
+
*/
|
|
93
|
+
static of(zoneId) {
|
|
94
|
+
requireNonNull(zoneId, 'zoneId');
|
|
95
|
+
if (zoneId === 'Z') {
|
|
96
|
+
return ZoneOffset.UTC;
|
|
97
|
+
}
|
|
98
|
+
if (zoneId.length === 1) {
|
|
99
|
+
throw new DateTimeException('Invalid zone: ' + zoneId);
|
|
100
|
+
}
|
|
101
|
+
if (StringUtil.startsWith(zoneId, '+') || StringUtil.startsWith(zoneId, '-')) {
|
|
102
|
+
return ZoneOffset.of(zoneId);
|
|
103
|
+
}
|
|
104
|
+
if (zoneId === 'UTC' || zoneId === 'GMT' || zoneId === 'GMT0' || zoneId === 'UT') {
|
|
105
|
+
return new ZoneRegion(zoneId, ZoneOffset.UTC.rules());
|
|
106
|
+
}
|
|
107
|
+
if (StringUtil.startsWith(zoneId, 'UTC+') || StringUtil.startsWith(zoneId, 'GMT+') ||
|
|
108
|
+
StringUtil.startsWith(zoneId, 'UTC-') || StringUtil.startsWith(zoneId, 'GMT-')) {
|
|
109
|
+
const offset = ZoneOffset.of(zoneId.substring(3));
|
|
110
|
+
if (offset.totalSeconds() === 0) {
|
|
111
|
+
return new ZoneRegion(zoneId.substring(0, 3), offset.rules());
|
|
112
|
+
}
|
|
113
|
+
return new ZoneRegion(zoneId.substring(0, 3) + offset.id(), offset.rules());
|
|
114
|
+
}
|
|
115
|
+
if (StringUtil.startsWith(zoneId, 'UT+') || StringUtil.startsWith(zoneId, 'UT-')) {
|
|
116
|
+
const offset = ZoneOffset.of(zoneId.substring(2));
|
|
117
|
+
if (offset.totalSeconds() === 0) {
|
|
118
|
+
return new ZoneRegion('UT', offset.rules());
|
|
119
|
+
}
|
|
120
|
+
return new ZoneRegion('UT' + offset.id(), offset.rules());
|
|
121
|
+
}
|
|
122
|
+
// javascript special case
|
|
123
|
+
if(zoneId === 'SYSTEM'){
|
|
124
|
+
return ZoneId.systemDefault();
|
|
125
|
+
}
|
|
126
|
+
return ZoneRegion.ofId(zoneId);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Obtains an instance of {@link ZoneId} wrapping an offset.
|
|
131
|
+
*
|
|
132
|
+
* If the prefix is 'GMT', 'UTC', or 'UT' a {@link ZoneId}
|
|
133
|
+
* with the prefix and the non-zero offset is returned.
|
|
134
|
+
* If the prefix is empty `''` the {@link ZoneOffset} is returned.
|
|
135
|
+
*
|
|
136
|
+
* @param {string} prefix the time-zone ID, not null
|
|
137
|
+
* @param {ZoneOffset} offset the offset, not null
|
|
138
|
+
* @return {ZoneId} the zone ID, not null
|
|
139
|
+
* @throws IllegalArgumentException if the prefix is not one of
|
|
140
|
+
* 'GMT', 'UTC', or 'UT', or ''
|
|
141
|
+
*/
|
|
142
|
+
static ofOffset(prefix, offset) {
|
|
143
|
+
requireNonNull(prefix, 'prefix');
|
|
144
|
+
requireNonNull(offset, 'offset');
|
|
145
|
+
if (prefix.length === 0) {
|
|
146
|
+
return offset;
|
|
147
|
+
}
|
|
148
|
+
if (prefix === 'GMT' || prefix === 'UTC' || prefix === 'UT') {
|
|
149
|
+
if (offset.totalSeconds() === 0) {
|
|
150
|
+
return new ZoneRegion(prefix, offset.rules());
|
|
151
|
+
}
|
|
152
|
+
return new ZoneRegion(prefix + offset.id(), offset.rules());
|
|
153
|
+
}
|
|
154
|
+
throw new IllegalArgumentException('Invalid prefix, must be GMT, UTC or UT: ' + prefix);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Obtains an instance of {@link ZoneId} from a temporal object.
|
|
160
|
+
*
|
|
161
|
+
* A {@link TemporalAccessor} represents some form of date and time information.
|
|
162
|
+
* This factory converts the arbitrary temporal object to an instance of {@link ZoneId}.
|
|
163
|
+
*
|
|
164
|
+
* The conversion will try to obtain the zone in a way that favours region-based
|
|
165
|
+
* zones over offset-based zones using {@link TemporalQueries#zone}.
|
|
166
|
+
*
|
|
167
|
+
* This method matches the signature of the functional interface {@link TemporalQuery}
|
|
168
|
+
* allowing it to be used in queries via method reference, {@link ZoneId::from}.
|
|
169
|
+
*
|
|
170
|
+
* @param {!TemporalAccessor} temporal - the temporal object to convert, not null
|
|
171
|
+
* @return {ZoneId} the zone ID, not null
|
|
172
|
+
* @throws DateTimeException if unable to convert to a {@link ZoneId}
|
|
173
|
+
*/
|
|
174
|
+
static from(temporal) {
|
|
175
|
+
requireNonNull(temporal, 'temporal');
|
|
176
|
+
const obj = temporal.query(TemporalQueries.zone());
|
|
177
|
+
if (obj == null) {
|
|
178
|
+
throw new DateTimeException('Unable to obtain ZoneId from TemporalAccessor: ' +
|
|
179
|
+
temporal + ', type ' + (temporal.constructor != null ? temporal.constructor.name : ''));
|
|
180
|
+
}
|
|
181
|
+
return obj;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
let SYSTEM_DEFAULT_ZONE_ID_INSTANCE = null;
|
|
186
|
+
|
|
187
|
+
export function _init(){
|
|
188
|
+
SYSTEM_DEFAULT_ZONE_ID_INSTANCE = new SystemDefaultZoneId();
|
|
189
|
+
|
|
190
|
+
// a bit magic to stay a bit more to the threeten bp impl.
|
|
191
|
+
ZoneId.systemDefault = ZoneIdFactory.systemDefault;
|
|
192
|
+
ZoneId.getAvailableZoneIds = ZoneIdFactory.getAvailableZoneIds;
|
|
193
|
+
ZoneId.of = ZoneIdFactory.of;
|
|
194
|
+
ZoneId.ofOffset = ZoneIdFactory.ofOffset;
|
|
195
|
+
ZoneId.from = ZoneIdFactory.from;
|
|
196
|
+
ZoneOffset.from = ZoneIdFactory.from;
|
|
197
|
+
|
|
198
|
+
// short cut
|
|
199
|
+
ZoneId.SYSTEM = SYSTEM_DEFAULT_ZONE_ID_INSTANCE;
|
|
200
|
+
ZoneId.UTC = ZoneOffset.ofTotalSeconds(0);
|
|
201
|
+
}
|