@fossa-app/bridge 0.1.6 → 0.1.8
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/dist/Models/ApiModels.d.ts +199 -0
- package/dist/Models/ApiModels.js +350 -0
- package/dist/Models/ApiModels.js.map +1 -0
- package/dist/Services/Clients/BranchClient.d.ts +16 -0
- package/dist/Services/Clients/BranchClient.js +54 -0
- package/dist/Services/Clients/BranchClient.js.map +1 -0
- package/dist/Services/Clients/CompanyClient.d.ts +13 -0
- package/dist/Services/Clients/CompanyClient.js +38 -0
- package/dist/Services/Clients/CompanyClient.js.map +1 -0
- package/dist/Services/Clients/CompanyLicenseClient.d.ts +10 -0
- package/dist/Services/Clients/CompanyLicenseClient.js +30 -0
- package/dist/Services/Clients/CompanyLicenseClient.js.map +1 -0
- package/dist/Services/Clients/CompanySettingsClient.d.ts +13 -0
- package/dist/Services/Clients/CompanySettingsClient.js +38 -0
- package/dist/Services/Clients/CompanySettingsClient.js.map +1 -0
- package/dist/Services/Clients/DepartmentClient.d.ts +16 -0
- package/dist/Services/Clients/DepartmentClient.js +54 -0
- package/dist/Services/Clients/DepartmentClient.js.map +1 -0
- package/dist/Services/Clients/EmployeeClient.d.ts +18 -0
- package/dist/Services/Clients/EmployeeClient.js +63 -0
- package/dist/Services/Clients/EmployeeClient.js.map +1 -0
- package/dist/Services/Clients/IdentityClient.d.ts +9 -0
- package/dist/Services/Clients/IdentityClient.js +26 -0
- package/dist/Services/Clients/IdentityClient.js.map +1 -0
- package/dist/Services/Clients/SystemLicenseClient.d.ts +9 -0
- package/dist/Services/Clients/SystemLicenseClient.js +26 -0
- package/dist/Services/Clients/SystemLicenseClient.js.map +1 -0
- package/dist/Services/Endpoints.d.ts +10 -0
- package/dist/Services/Endpoints.js +14 -0
- package/dist/Services/Endpoints.js.map +1 -0
- package/dist/Services/IHttpTransport.d.ts +6 -0
- package/dist/Services/IHttpTransport.js +3 -0
- package/dist/Services/IHttpTransport.js.map +1 -0
- package/dist/Services/UrlHelpers.d.ts +25 -0
- package/dist/Services/UrlHelpers.js +103 -0
- package/dist/Services/UrlHelpers.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Array.d.ts +125 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Array.js +1371 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Array.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Async.d.ts +27 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Async.js +172 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Async.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/AsyncBuilder.d.ts +59 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/AsyncBuilder.js +194 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/AsyncBuilder.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/BigInt.d.ts +129 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/BigInt.js +428 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/BigInt.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/BitConverter.d.ts +27 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/BitConverter.js +165 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/BitConverter.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Boolean.d.ts +3 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Boolean.js +27 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Boolean.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Char.d.ts +66 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Char.js +271 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Char.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Choice.d.ts +121 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Choice.js +231 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Choice.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/CollectionUtil.d.ts +8 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/CollectionUtil.js +192 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/CollectionUtil.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/ConditionalWeakTable.d.ts +9 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/ConditionalWeakTable.js +26 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/ConditionalWeakTable.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Date.d.ts +70 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Date.js +812 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Date.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/DateOffset.d.ts +65 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/DateOffset.js +345 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/DateOffset.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/DateOnly.d.ts +18 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/DateOnly.js +143 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/DateOnly.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Decimal.d.ts +63 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Decimal.js +322 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Decimal.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Double.d.ts +11 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Double.js +60 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Double.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Encoding.d.ts +12 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Encoding.js +178 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Encoding.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Event.d.ts +31 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Event.js +109 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Event.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Collections.d.ts +7 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Collections.js +53 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Collections.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Core.CompilerServices.d.ts +12 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Core.CompilerServices.js +38 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Core.CompilerServices.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Core.d.ts +30 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Core.js +185 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/FSharp.Core.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Global.d.ts +45 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Global.js +33 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Global.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Guid.d.ts +10 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Guid.js +152 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Guid.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Int32.d.ts +29 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Int32.js +148 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Int32.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/List.d.ts +143 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/List.js +1404 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/List.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Long.d.ts +3 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Long.js +52 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Long.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MailboxProcessor.d.ts +25 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MailboxProcessor.js +104 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MailboxProcessor.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Map.d.ts +178 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Map.js +1525 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Map.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MapUtil.d.ts +12 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MapUtil.js +141 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MapUtil.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MutableMap.d.ts +52 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MutableMap.js +355 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MutableMap.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MutableSet.d.ts +39 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MutableSet.js +246 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/MutableSet.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Native.d.ts +3 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Native.js +18 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Native.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Numeric.d.ts +20 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Numeric.js +87 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Numeric.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Observable.d.ts +32 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Observable.js +128 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Observable.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Option.d.ts +29 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Option.js +127 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Option.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Random.d.ts +38 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Random.js +186 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Random.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Range.d.ts +12 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Range.js +56 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Range.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Reflection.d.ts +119 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Reflection.js +529 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Reflection.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/RegExp.d.ts +10 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/RegExp.js +144 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/RegExp.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Result.d.ts +38 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Result.js +191 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Result.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Seq.d.ts +164 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Seq.js +1501 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Seq.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Seq2.d.ts +18 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Seq2.js +129 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Seq2.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Set.d.ts +190 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Set.js +1931 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Set.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/String.d.ts +59 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/String.js +677 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/String.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.Collections.Generic.d.ts +85 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.Collections.Generic.js +390 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.Collections.Generic.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.Text.d.ts +40 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.Text.js +204 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.Text.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.d.ts +121 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.js +367 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/System.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/TimeOnly.d.ts +15 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/TimeOnly.js +138 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/TimeOnly.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/TimeSpan.d.ts +35 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/TimeSpan.js +210 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/TimeSpan.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Timer.d.ts +19 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Timer.js +72 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Timer.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Types.d.ts +51 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Types.js +205 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Types.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Unicode.13.0.0.d.ts +2 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Unicode.13.0.0.js +8 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Unicode.13.0.0.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Uri.d.ts +32 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Uri.js +170 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Uri.js.map +1 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Util.d.ts +243 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Util.js +903 -0
- package/dist/fable_modules/fable-library-ts.5.0.0-rc.1/Util.js.map +1 -0
- package/package.json +5 -2
- package/.build.ps1 +0 -308
- package/.gitattributes +0 -43
- package/.github/dependabot.yml +0 -38
- package/.github/release-drafter.yml +0 -52
- package/.github/workflows/cicd.yml +0 -87
- package/.github/workflows/lint.yml +0 -34
- package/.github/workflows/release-drafter.yml +0 -27
- package/Bridge.slnx +0 -8
- package/Directory.Build.props +0 -25
- package/Images/Icon.png +0 -0
- package/build.ps1 +0 -11
- package/dotnet-tools.json +0 -27
- package/format.ps1 +0 -11
- package/gig.ps1 +0 -17
- package/global.json +0 -6
- package/lint.ps1 +0 -20
- package/pack.ps1 +0 -11
- package/publish.ps1 +0 -11
- package/restore.ps1 +0 -11
- package/src/Bridge/Bridge.fsproj +0 -26
- package/src/Bridge/Models/ApiModels.fs +0 -142
- package/src/Bridge/Services/Clients/BranchClient.fs +0 -46
- package/src/Bridge/Services/Clients/CompanyClient.fs +0 -24
- package/src/Bridge/Services/Clients/CompanyLicenseClient.fs +0 -17
- package/src/Bridge/Services/Clients/CompanySettingsClient.fs +0 -24
- package/src/Bridge/Services/Clients/DepartmentClient.fs +0 -48
- package/src/Bridge/Services/Clients/EmployeeClient.fs +0 -71
- package/src/Bridge/Services/Clients/IdentityClient.fs +0 -11
- package/src/Bridge/Services/Clients/SystemLicenseClient.fs +0 -11
- package/src/Bridge/Services/Endpoints.fs +0 -13
- package/src/Bridge/Services/IHttpTransport.fs +0 -10
- package/src/Bridge/Services/UrlHelpers.fs +0 -18
- package/src/Bridge/bin/Release/net10.0/Fossa.Bridge.deps.json +0 -98
- package/src/Bridge/bin/Release/net10.0/Fossa.Bridge.xml +0 -6
- package/src/Bridge/obj/Bridge.fsproj.nuget.dgspec.json +0 -357
- package/src/Bridge/obj/Bridge.fsproj.nuget.g.props +0 -29
- package/src/Bridge/obj/Bridge.fsproj.nuget.g.targets +0 -2
- package/src/Bridge/obj/Release/Fossa.Bridge.0.1.6.nuspec +0 -31
- package/src/Bridge/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +0 -3
- package/src/Bridge/obj/Release/net10.0/Bridge.AssemblyInfo.fs +0 -20
- package/src/Bridge/obj/Release/net10.0/Bridge.fsproj.FileListAbsolute.txt +0 -14
- package/src/Bridge/obj/Release/net10.0/Bridge.sourcelink.json +0 -1
- package/src/Bridge/obj/Release/net10.0/Fossa.Bridge.xml +0 -6
- package/src/Bridge/obj/Release/net10.0/ILLink.Substitutions.xml +0 -15
- package/src/Bridge/obj/project.assets.json +0 -501
- package/src/Directory.Build.props +0 -23
- package/test.ps1 +0 -11
- package/tests/Bridge.Tests/Bridge.Tests.fsproj +0 -19
- package/tests/Bridge.Tests/Main.fs +0 -7
- package/tests/Bridge.Tests/UrlHelpersTests.fs +0 -33
- package/tests/Bridge.Tests/bin/Release/net10.0/.msCoverageSourceRootsMapping_Fossa.Bridge.Tests +0 -0
- package/tests/Bridge.Tests/bin/Release/net10.0/Fossa.Bridge.Tests +0 -0
- package/tests/Bridge.Tests/bin/Release/net10.0/Fossa.Bridge.Tests.deps.json +0 -819
- package/tests/Bridge.Tests/bin/Release/net10.0/Fossa.Bridge.Tests.runtimeconfig.json +0 -14
- package/tests/Bridge.Tests/bin/Release/net10.0/Fossa.Bridge.xml +0 -6
- package/tests/Bridge.Tests/obj/Bridge.Tests.fsproj.nuget.dgspec.json +0 -712
- package/tests/Bridge.Tests/obj/Bridge.Tests.fsproj.nuget.g.props +0 -30
- package/tests/Bridge.Tests/obj/Bridge.Tests.fsproj.nuget.g.targets +0 -11
- package/tests/Bridge.Tests/obj/Release/net10.0/.NETCoreApp,Version=v10.0.AssemblyAttributes.fs +0 -3
- package/tests/Bridge.Tests/obj/Release/net10.0/Bridge.T.A317E392.Up2Date +0 -0
- package/tests/Bridge.Tests/obj/Release/net10.0/Bridge.Tests.AssemblyInfo.fs +0 -19
- package/tests/Bridge.Tests/obj/Release/net10.0/Bridge.Tests.fsproj.FileListAbsolute.txt +0 -190
- package/tests/Bridge.Tests/obj/Release/net10.0/Bridge.Tests.sourcelink.json +0 -1
- package/tests/Bridge.Tests/obj/Release/net10.0/ILLink.Substitutions.xml +0 -15
- package/tests/Bridge.Tests/obj/Release/net10.0/apphost +0 -0
- package/tests/Bridge.Tests/obj/project.assets.json +0 -2144
- package/trigger.ps1 +0 -32
- package/tsconfig.json +0 -18
- package/version.ps1 +0 -11
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* DateTimeOffset functions.
|
|
4
|
+
*
|
|
5
|
+
* Note: Date instances are always DateObjects in local
|
|
6
|
+
* timezone (because JS dates are all kinds of messed up).
|
|
7
|
+
* A local date returns UTC epoch when `.getTime()` is called.
|
|
8
|
+
*
|
|
9
|
+
* Basically; invariant: date.getTime() always return UTC time.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.compareTo = exports.compare = void 0;
|
|
13
|
+
exports.getKind = getKind;
|
|
14
|
+
exports.unixEpochMillisecondsToTicks = unixEpochMillisecondsToTicks;
|
|
15
|
+
exports.ticksToUnixEpochMilliseconds = ticksToUnixEpochMilliseconds;
|
|
16
|
+
exports.dateOffsetToString = dateOffsetToString;
|
|
17
|
+
exports.toString = toString;
|
|
18
|
+
exports.DateTime = DateTime;
|
|
19
|
+
exports.fromTicks = fromTicks;
|
|
20
|
+
exports.fromDateTime = fromDateTime;
|
|
21
|
+
exports.fromDateTimeOffset = fromDateTimeOffset;
|
|
22
|
+
exports.getTicks = getTicks;
|
|
23
|
+
exports.minValue = minValue;
|
|
24
|
+
exports.maxValue = maxValue;
|
|
25
|
+
exports.parseRaw = parseRaw;
|
|
26
|
+
exports.parse = parse;
|
|
27
|
+
exports.tryParse = tryParse;
|
|
28
|
+
exports.create = create;
|
|
29
|
+
exports.now = now;
|
|
30
|
+
exports.utcNow = utcNow;
|
|
31
|
+
exports.today = today;
|
|
32
|
+
exports.isLeapYear = isLeapYear;
|
|
33
|
+
exports.daysInMonth = daysInMonth;
|
|
34
|
+
exports.toUniversalTime = toUniversalTime;
|
|
35
|
+
exports.toLocalTime = toLocalTime;
|
|
36
|
+
exports.specifyKind = specifyKind;
|
|
37
|
+
exports.timeOfDay = timeOfDay;
|
|
38
|
+
exports.date = date;
|
|
39
|
+
exports.day = day;
|
|
40
|
+
exports.hour = hour;
|
|
41
|
+
exports.millisecond = millisecond;
|
|
42
|
+
exports.minute = minute;
|
|
43
|
+
exports.month = month;
|
|
44
|
+
exports.second = second;
|
|
45
|
+
exports.year = year;
|
|
46
|
+
exports.dayOfWeek = dayOfWeek;
|
|
47
|
+
exports.dayOfYear = dayOfYear;
|
|
48
|
+
exports.add = add;
|
|
49
|
+
exports.addDays = addDays;
|
|
50
|
+
exports.addHours = addHours;
|
|
51
|
+
exports.addMinutes = addMinutes;
|
|
52
|
+
exports.addSeconds = addSeconds;
|
|
53
|
+
exports.addMilliseconds = addMilliseconds;
|
|
54
|
+
exports.addTicks = addTicks;
|
|
55
|
+
exports.addYears = addYears;
|
|
56
|
+
exports.addMonths = addMonths;
|
|
57
|
+
exports.subtract = subtract;
|
|
58
|
+
exports.toLongDateString = toLongDateString;
|
|
59
|
+
exports.toShortDateString = toShortDateString;
|
|
60
|
+
exports.toLongTimeString = toLongTimeString;
|
|
61
|
+
exports.toShortTimeString = toShortTimeString;
|
|
62
|
+
exports.equals = equals;
|
|
63
|
+
exports.op_Addition = op_Addition;
|
|
64
|
+
exports.op_Subtraction = op_Subtraction;
|
|
65
|
+
exports.isDaylightSavingTime = isDaylightSavingTime;
|
|
66
|
+
const BigInt_ts_1 = require("./BigInt.js");
|
|
67
|
+
const Util_ts_1 = require("./Util.js");
|
|
68
|
+
const shortDays = [
|
|
69
|
+
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
|
|
70
|
+
];
|
|
71
|
+
const longDays = [
|
|
72
|
+
"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
|
|
73
|
+
];
|
|
74
|
+
const shortMonths = [
|
|
75
|
+
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
|
76
|
+
];
|
|
77
|
+
const longMonths = [
|
|
78
|
+
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
|
|
79
|
+
];
|
|
80
|
+
function parseRepeatToken(format, pos, patternChar) {
|
|
81
|
+
let tokenLength = 0;
|
|
82
|
+
let internalPos = pos;
|
|
83
|
+
while (internalPos < format.length && format[internalPos] === patternChar) {
|
|
84
|
+
internalPos++;
|
|
85
|
+
tokenLength++;
|
|
86
|
+
}
|
|
87
|
+
return tokenLength;
|
|
88
|
+
}
|
|
89
|
+
function parseNextChar(format, pos) {
|
|
90
|
+
if (pos >= format.length - 1) {
|
|
91
|
+
return -1;
|
|
92
|
+
}
|
|
93
|
+
return format.charCodeAt(pos + 1);
|
|
94
|
+
}
|
|
95
|
+
function parseQuotedString(format, pos) {
|
|
96
|
+
let beginPos = pos;
|
|
97
|
+
// Get the character used to quote the string
|
|
98
|
+
const quoteChar = format[pos];
|
|
99
|
+
let result = "";
|
|
100
|
+
let foundQuote = false;
|
|
101
|
+
while (pos < format.length) {
|
|
102
|
+
pos++;
|
|
103
|
+
const currentChar = format[pos];
|
|
104
|
+
if (currentChar === quoteChar) {
|
|
105
|
+
foundQuote = true;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
else if (currentChar === "\\") {
|
|
109
|
+
if (pos < format.length) {
|
|
110
|
+
pos++;
|
|
111
|
+
result += format[pos];
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
// This means that '\' is the last character in the string.
|
|
115
|
+
throw new Util_ts_1.Exception("Invalid string format");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
result += currentChar;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (!foundQuote) {
|
|
123
|
+
// We could not find the matching quote
|
|
124
|
+
throw new Util_ts_1.Exception(`Invalid string format could not find matching quote for ${quoteChar}`);
|
|
125
|
+
}
|
|
126
|
+
return [result, pos - beginPos + 1];
|
|
127
|
+
}
|
|
128
|
+
function dateToStringWithCustomFormat(date, format, utc) {
|
|
129
|
+
let cursorPos = 0;
|
|
130
|
+
let tokenLength = 0;
|
|
131
|
+
let result = "";
|
|
132
|
+
const localizedDate = utc ? DateTime(date.getTime(), Util_ts_1.DateTimeKind.Utc) : date;
|
|
133
|
+
while (cursorPos < format.length) {
|
|
134
|
+
const token = format[cursorPos];
|
|
135
|
+
switch (token) {
|
|
136
|
+
case "d":
|
|
137
|
+
tokenLength = parseRepeatToken(format, cursorPos, "d");
|
|
138
|
+
cursorPos += tokenLength;
|
|
139
|
+
switch (tokenLength) {
|
|
140
|
+
case 1:
|
|
141
|
+
result += day(localizedDate);
|
|
142
|
+
break;
|
|
143
|
+
case 2:
|
|
144
|
+
result += (0, Util_ts_1.padWithZeros)(day(localizedDate), 2);
|
|
145
|
+
break;
|
|
146
|
+
case 3:
|
|
147
|
+
result += shortDays[dayOfWeek(localizedDate)];
|
|
148
|
+
break;
|
|
149
|
+
case 4:
|
|
150
|
+
default:
|
|
151
|
+
result += longDays[dayOfWeek(localizedDate)];
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
break;
|
|
155
|
+
case "f":
|
|
156
|
+
tokenLength = parseRepeatToken(format, cursorPos, "f");
|
|
157
|
+
cursorPos += tokenLength;
|
|
158
|
+
if (tokenLength <= 3) {
|
|
159
|
+
const precision = 10 ** (3 - tokenLength);
|
|
160
|
+
result += (0, Util_ts_1.padWithZeros)(Math.floor(millisecond(localizedDate) / precision), tokenLength);
|
|
161
|
+
}
|
|
162
|
+
else if (tokenLength <= 7) {
|
|
163
|
+
// JavaScript Date only support precision to the millisecond
|
|
164
|
+
// so we fill the rest of the precision with 0 as if the date didn't have
|
|
165
|
+
// milliseconds provided to it.
|
|
166
|
+
// This is to have the same behavior as .NET when doing:
|
|
167
|
+
// DateTime(1, 2, 3, 4, 5, 6, DateTimeKind.Utc).ToString("fffff") => 00000
|
|
168
|
+
result += ("" + millisecond(localizedDate)).padEnd(tokenLength, "0");
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
throw "Input string was not in a correct format.";
|
|
172
|
+
}
|
|
173
|
+
break;
|
|
174
|
+
case "F":
|
|
175
|
+
tokenLength = parseRepeatToken(format, cursorPos, "F");
|
|
176
|
+
cursorPos += tokenLength;
|
|
177
|
+
if (tokenLength <= 3) {
|
|
178
|
+
const precision = 10 ** (3 - tokenLength);
|
|
179
|
+
const value = Math.floor(millisecond(localizedDate) / precision);
|
|
180
|
+
if (value != 0) {
|
|
181
|
+
result += (0, Util_ts_1.padWithZeros)(value, tokenLength);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else if (tokenLength <= 7) {
|
|
185
|
+
// JavaScript Date only support precision to the millisecond
|
|
186
|
+
// so we can't go beyond that.
|
|
187
|
+
// We also need to pad start with 0 if the value is not 0
|
|
188
|
+
const value = millisecond(localizedDate);
|
|
189
|
+
if (value != 0) {
|
|
190
|
+
result += (0, Util_ts_1.padWithZeros)(value, 3);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
throw "Input string was not in a correct format.";
|
|
195
|
+
}
|
|
196
|
+
break;
|
|
197
|
+
case "g":
|
|
198
|
+
tokenLength = parseRepeatToken(format, cursorPos, "g");
|
|
199
|
+
cursorPos += tokenLength;
|
|
200
|
+
result += "A.D.";
|
|
201
|
+
break;
|
|
202
|
+
case "h":
|
|
203
|
+
tokenLength = parseRepeatToken(format, cursorPos, "h");
|
|
204
|
+
cursorPos += tokenLength;
|
|
205
|
+
switch (tokenLength) {
|
|
206
|
+
case 1:
|
|
207
|
+
const h1Value = hour(localizedDate) % 12;
|
|
208
|
+
result += h1Value ? h1Value : 12;
|
|
209
|
+
break;
|
|
210
|
+
case 2:
|
|
211
|
+
default:
|
|
212
|
+
const h2Value = hour(localizedDate) % 12;
|
|
213
|
+
result += (0, Util_ts_1.padWithZeros)(h2Value ? h2Value : 12, 2);
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
break;
|
|
217
|
+
case "H":
|
|
218
|
+
tokenLength = parseRepeatToken(format, cursorPos, "H");
|
|
219
|
+
cursorPos += tokenLength;
|
|
220
|
+
switch (tokenLength) {
|
|
221
|
+
case 1:
|
|
222
|
+
result += hour(localizedDate);
|
|
223
|
+
break;
|
|
224
|
+
case 2:
|
|
225
|
+
default:
|
|
226
|
+
result += (0, Util_ts_1.padWithZeros)(hour(localizedDate), 2);
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
break;
|
|
230
|
+
case "K":
|
|
231
|
+
tokenLength = parseRepeatToken(format, cursorPos, "K");
|
|
232
|
+
cursorPos += tokenLength;
|
|
233
|
+
switch (tokenLength) {
|
|
234
|
+
case 1:
|
|
235
|
+
switch (getKind(localizedDate)) {
|
|
236
|
+
case Util_ts_1.DateTimeKind.Utc:
|
|
237
|
+
result += "Z";
|
|
238
|
+
break;
|
|
239
|
+
case Util_ts_1.DateTimeKind.Local:
|
|
240
|
+
result += dateOffsetToString(localizedDate.getTimezoneOffset() * -60000);
|
|
241
|
+
break;
|
|
242
|
+
case Util_ts_1.DateTimeKind.Unspecified:
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
break;
|
|
246
|
+
default:
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
break;
|
|
250
|
+
case "m":
|
|
251
|
+
tokenLength = parseRepeatToken(format, cursorPos, "m");
|
|
252
|
+
cursorPos += tokenLength;
|
|
253
|
+
switch (tokenLength) {
|
|
254
|
+
case 1:
|
|
255
|
+
result += minute(localizedDate);
|
|
256
|
+
break;
|
|
257
|
+
case 2:
|
|
258
|
+
default:
|
|
259
|
+
result += (0, Util_ts_1.padWithZeros)(minute(localizedDate), 2);
|
|
260
|
+
break;
|
|
261
|
+
}
|
|
262
|
+
break;
|
|
263
|
+
case "M":
|
|
264
|
+
tokenLength = parseRepeatToken(format, cursorPos, "M");
|
|
265
|
+
cursorPos += tokenLength;
|
|
266
|
+
switch (tokenLength) {
|
|
267
|
+
case 1:
|
|
268
|
+
result += month(localizedDate);
|
|
269
|
+
break;
|
|
270
|
+
case 2:
|
|
271
|
+
result += (0, Util_ts_1.padWithZeros)(month(localizedDate), 2);
|
|
272
|
+
break;
|
|
273
|
+
case 3:
|
|
274
|
+
result += shortMonths[month(localizedDate) - 1];
|
|
275
|
+
break;
|
|
276
|
+
case 4:
|
|
277
|
+
default:
|
|
278
|
+
result += longMonths[month(localizedDate) - 1];
|
|
279
|
+
break;
|
|
280
|
+
}
|
|
281
|
+
break;
|
|
282
|
+
case "s":
|
|
283
|
+
tokenLength = parseRepeatToken(format, cursorPos, "s");
|
|
284
|
+
cursorPos += tokenLength;
|
|
285
|
+
switch (tokenLength) {
|
|
286
|
+
case 1:
|
|
287
|
+
result += second(localizedDate);
|
|
288
|
+
break;
|
|
289
|
+
case 2:
|
|
290
|
+
default:
|
|
291
|
+
result += (0, Util_ts_1.padWithZeros)(second(localizedDate), 2);
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
break;
|
|
295
|
+
case "t":
|
|
296
|
+
tokenLength = parseRepeatToken(format, cursorPos, "t");
|
|
297
|
+
cursorPos += tokenLength;
|
|
298
|
+
switch (tokenLength) {
|
|
299
|
+
case 1:
|
|
300
|
+
result += localizedDate.getHours() < 12 ? "A" : "P";
|
|
301
|
+
break;
|
|
302
|
+
case 2:
|
|
303
|
+
default:
|
|
304
|
+
result += localizedDate.getHours() < 12 ? "AM" : "PM";
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
break;
|
|
308
|
+
case "y":
|
|
309
|
+
tokenLength = parseRepeatToken(format, cursorPos, "y");
|
|
310
|
+
cursorPos += tokenLength;
|
|
311
|
+
switch (tokenLength) {
|
|
312
|
+
case 1:
|
|
313
|
+
result += localizedDate.getFullYear() % 100;
|
|
314
|
+
break;
|
|
315
|
+
case 2:
|
|
316
|
+
result += (0, Util_ts_1.padWithZeros)(localizedDate.getFullYear() % 100, 2);
|
|
317
|
+
break;
|
|
318
|
+
default:
|
|
319
|
+
result += (0, Util_ts_1.padWithZeros)(localizedDate.getFullYear(), tokenLength);
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
break;
|
|
323
|
+
case "z":
|
|
324
|
+
tokenLength = parseRepeatToken(format, cursorPos, "z");
|
|
325
|
+
cursorPos += tokenLength;
|
|
326
|
+
let utcOffsetText = "";
|
|
327
|
+
switch (getKind(localizedDate)) {
|
|
328
|
+
case Util_ts_1.DateTimeKind.Utc:
|
|
329
|
+
utcOffsetText = "+00:00";
|
|
330
|
+
break;
|
|
331
|
+
case Util_ts_1.DateTimeKind.Local:
|
|
332
|
+
utcOffsetText = dateOffsetToString(localizedDate.getTimezoneOffset() * -60000);
|
|
333
|
+
break;
|
|
334
|
+
case Util_ts_1.DateTimeKind.Unspecified:
|
|
335
|
+
utcOffsetText = dateOffsetToString(toLocalTime(localizedDate).getTimezoneOffset() * -60000);
|
|
336
|
+
break;
|
|
337
|
+
}
|
|
338
|
+
const sign = utcOffsetText[0] === "-" ? "-" : "+";
|
|
339
|
+
const hours = parseInt(utcOffsetText.substring(1, 3), 10);
|
|
340
|
+
const minutes = parseInt(utcOffsetText.substring(4, 6), 10);
|
|
341
|
+
switch (tokenLength) {
|
|
342
|
+
case 1:
|
|
343
|
+
result += `${sign}${hours}`;
|
|
344
|
+
break;
|
|
345
|
+
case 2:
|
|
346
|
+
result += `${sign}${(0, Util_ts_1.padWithZeros)(hours, 2)}`;
|
|
347
|
+
break;
|
|
348
|
+
default:
|
|
349
|
+
result += `${sign}${(0, Util_ts_1.padWithZeros)(hours, 2)}:${(0, Util_ts_1.padWithZeros)(minutes, 2)}`;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
break;
|
|
353
|
+
case ":":
|
|
354
|
+
result += ":";
|
|
355
|
+
cursorPos++;
|
|
356
|
+
break;
|
|
357
|
+
case "/":
|
|
358
|
+
result += "/";
|
|
359
|
+
cursorPos++;
|
|
360
|
+
break;
|
|
361
|
+
case "'":
|
|
362
|
+
case '"':
|
|
363
|
+
const [quotedString, quotedStringLenght] = parseQuotedString(format, cursorPos);
|
|
364
|
+
result += quotedString;
|
|
365
|
+
cursorPos += quotedStringLenght;
|
|
366
|
+
break;
|
|
367
|
+
case "%":
|
|
368
|
+
const nextChar = parseNextChar(format, cursorPos);
|
|
369
|
+
if (nextChar >= 0 && nextChar !== "%".charCodeAt(0)) {
|
|
370
|
+
cursorPos += 2;
|
|
371
|
+
result += dateToStringWithCustomFormat(localizedDate, String.fromCharCode(nextChar), utc);
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
throw new Util_ts_1.Exception("Invalid format string");
|
|
375
|
+
}
|
|
376
|
+
break;
|
|
377
|
+
case "\\":
|
|
378
|
+
const nextChar2 = parseNextChar(format, cursorPos);
|
|
379
|
+
if (nextChar2 >= 0) {
|
|
380
|
+
cursorPos += 2;
|
|
381
|
+
result += String.fromCharCode(nextChar2);
|
|
382
|
+
}
|
|
383
|
+
else {
|
|
384
|
+
throw new Util_ts_1.Exception("Invalid format string");
|
|
385
|
+
}
|
|
386
|
+
break;
|
|
387
|
+
default:
|
|
388
|
+
cursorPos++;
|
|
389
|
+
result += token;
|
|
390
|
+
break;
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
return result;
|
|
394
|
+
}
|
|
395
|
+
function getKind(value) {
|
|
396
|
+
return value.kind ?? Util_ts_1.DateTimeKind.Unspecified;
|
|
397
|
+
}
|
|
398
|
+
function unixEpochMillisecondsToTicks(ms, offset) {
|
|
399
|
+
return (0, BigInt_ts_1.toInt64)(((BigInt(ms) + 62135596800000n) + BigInt(offset)) * 10000n);
|
|
400
|
+
}
|
|
401
|
+
function ticksToUnixEpochMilliseconds(ticks) {
|
|
402
|
+
return Number(((BigInt(ticks) / 10000n) - 62135596800000n));
|
|
403
|
+
}
|
|
404
|
+
function dateOffsetToString(offset) {
|
|
405
|
+
const isMinus = offset < 0;
|
|
406
|
+
offset = Math.abs(offset);
|
|
407
|
+
const hours = ~~(offset / 3600000);
|
|
408
|
+
const minutes = (offset % 3600000) / 60000;
|
|
409
|
+
return (isMinus ? "-" : "+") +
|
|
410
|
+
(0, Util_ts_1.padWithZeros)(hours, 2) + ":" +
|
|
411
|
+
(0, Util_ts_1.padWithZeros)(minutes, 2);
|
|
412
|
+
}
|
|
413
|
+
function dateToISOString(d, utc) {
|
|
414
|
+
if (utc) {
|
|
415
|
+
return d.toISOString();
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
// JS Date is always local
|
|
419
|
+
const printOffset = d.kind == null ? true : d.kind === Util_ts_1.DateTimeKind.Local;
|
|
420
|
+
return (0, Util_ts_1.padWithZeros)(d.getFullYear(), 4) + "-" +
|
|
421
|
+
(0, Util_ts_1.padWithZeros)(d.getMonth() + 1, 2) + "-" +
|
|
422
|
+
(0, Util_ts_1.padWithZeros)(d.getDate(), 2) + "T" +
|
|
423
|
+
(0, Util_ts_1.padWithZeros)(d.getHours(), 2) + ":" +
|
|
424
|
+
(0, Util_ts_1.padWithZeros)(d.getMinutes(), 2) + ":" +
|
|
425
|
+
(0, Util_ts_1.padWithZeros)(d.getSeconds(), 2) + "." +
|
|
426
|
+
(0, Util_ts_1.padWithZeros)(d.getMilliseconds(), 3) +
|
|
427
|
+
(printOffset ? dateOffsetToString(d.getTimezoneOffset() * -60000) : "");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function dateToISOStringWithOffset(dateWithOffset, offset) {
|
|
431
|
+
const str = dateWithOffset.toISOString();
|
|
432
|
+
return str.substring(0, str.length - 1) + dateOffsetToString(offset);
|
|
433
|
+
}
|
|
434
|
+
function dateToStringWithOffset(date, format) {
|
|
435
|
+
const d = new Date(date.getTime() + (date.offset ?? 0));
|
|
436
|
+
if (typeof format !== "string") {
|
|
437
|
+
return d.toISOString().replace(/\.\d+/, "").replace(/[A-Z]|\.\d+/g, " ") + dateOffsetToString((date.offset ?? 0));
|
|
438
|
+
}
|
|
439
|
+
else if (format.length === 1) {
|
|
440
|
+
switch (format) {
|
|
441
|
+
case "D": return dateToString_D(d);
|
|
442
|
+
case "d": return dateToString_d(d);
|
|
443
|
+
case "T": return dateToString_T(toUniversalTime(d));
|
|
444
|
+
case "t": return dateToString_t(toUniversalTime(d));
|
|
445
|
+
case "O":
|
|
446
|
+
case "o": return dateToISOStringWithOffset(d, (date.offset ?? 0));
|
|
447
|
+
default: throw new Util_ts_1.Exception("Unrecognized Date print format");
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
return dateToStringWithCustomFormat(d, format, true);
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
function dateToString_D(date) {
|
|
455
|
+
return longDays[dayOfWeek(date)]
|
|
456
|
+
+ ", " + (0, Util_ts_1.padWithZeros)(day(date), 2)
|
|
457
|
+
+ " " + longMonths[month(date) - 1]
|
|
458
|
+
+ " " + year(date);
|
|
459
|
+
}
|
|
460
|
+
function dateToString_d(date) {
|
|
461
|
+
return (0, Util_ts_1.padWithZeros)(month(date), 2)
|
|
462
|
+
+ "/" + (0, Util_ts_1.padWithZeros)(day(date), 2)
|
|
463
|
+
+ "/" + year(date);
|
|
464
|
+
}
|
|
465
|
+
function dateToString_T(date) {
|
|
466
|
+
return (0, Util_ts_1.padWithZeros)(hour(date), 2)
|
|
467
|
+
+ ":" + (0, Util_ts_1.padWithZeros)(minute(date), 2)
|
|
468
|
+
+ ":" + (0, Util_ts_1.padWithZeros)(second(date), 2);
|
|
469
|
+
}
|
|
470
|
+
function dateToString_t(date) {
|
|
471
|
+
return (0, Util_ts_1.padWithZeros)(hour(date), 2)
|
|
472
|
+
+ ":" + (0, Util_ts_1.padWithZeros)(minute(date), 2);
|
|
473
|
+
}
|
|
474
|
+
function dateToStringWithKind(date, format) {
|
|
475
|
+
const utc = date.kind === Util_ts_1.DateTimeKind.Utc;
|
|
476
|
+
if (typeof format !== "string") {
|
|
477
|
+
return utc ? date.toUTCString() : date.toLocaleString();
|
|
478
|
+
}
|
|
479
|
+
else if (format.length === 1) {
|
|
480
|
+
switch (format) {
|
|
481
|
+
case "D": return dateToString_D(date);
|
|
482
|
+
case "d": return dateToString_d(date);
|
|
483
|
+
case "T": return dateToString_T(date);
|
|
484
|
+
case "t": return dateToString_t(date);
|
|
485
|
+
case "O":
|
|
486
|
+
case "o":
|
|
487
|
+
return dateToISOString(date, utc);
|
|
488
|
+
default:
|
|
489
|
+
throw new Util_ts_1.Exception("Unrecognized Date print format");
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
else {
|
|
493
|
+
return dateToStringWithCustomFormat(date, format, utc);
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
function toString(date, format, _provider) {
|
|
497
|
+
return date.offset != null
|
|
498
|
+
? dateToStringWithOffset(date, format)
|
|
499
|
+
: dateToStringWithKind(date, format);
|
|
500
|
+
}
|
|
501
|
+
function DateTime(value, kind) {
|
|
502
|
+
const d = new Date(value);
|
|
503
|
+
d.kind = (kind == null ? Util_ts_1.DateTimeKind.Unspecified : kind);
|
|
504
|
+
return d;
|
|
505
|
+
}
|
|
506
|
+
function fromTicks(ticks, kind) {
|
|
507
|
+
kind = kind != null ? kind : Util_ts_1.DateTimeKind.Local; // better default than Unspecified
|
|
508
|
+
let date = DateTime(ticksToUnixEpochMilliseconds(ticks), kind);
|
|
509
|
+
// Ticks are local to offset (in this case, either UTC or Local/Unknown).
|
|
510
|
+
// If kind is anything but UTC, that means that the tick number was not
|
|
511
|
+
// in utc, thus getTime() cannot return UTC, and needs to be shifted.
|
|
512
|
+
if (kind !== Util_ts_1.DateTimeKind.Utc) {
|
|
513
|
+
date = DateTime(date.getTime() - (0, Util_ts_1.dateOffset)(date), kind);
|
|
514
|
+
}
|
|
515
|
+
return date;
|
|
516
|
+
}
|
|
517
|
+
function fromDateTime(dateOnly, timeOnly, kind) {
|
|
518
|
+
const d = DateTime(dateOnly.getTime() + timeOnly, kind);
|
|
519
|
+
return DateTime(d.getTime() - (0, Util_ts_1.dateOffset)(d), kind);
|
|
520
|
+
}
|
|
521
|
+
function fromDateTimeOffset(date, kind) {
|
|
522
|
+
switch (kind) {
|
|
523
|
+
case Util_ts_1.DateTimeKind.Utc: return DateTime(date.getTime(), Util_ts_1.DateTimeKind.Utc);
|
|
524
|
+
case Util_ts_1.DateTimeKind.Local: return DateTime(date.getTime(), Util_ts_1.DateTimeKind.Local);
|
|
525
|
+
default:
|
|
526
|
+
const d = DateTime(date.getTime() + (date.offset ?? 0), kind);
|
|
527
|
+
return DateTime(d.getTime() - (0, Util_ts_1.dateOffset)(d), kind);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
function getTicks(date) {
|
|
531
|
+
return unixEpochMillisecondsToTicks(date.getTime(), (0, Util_ts_1.dateOffset)(date));
|
|
532
|
+
}
|
|
533
|
+
function minValue() {
|
|
534
|
+
// This is "0001-01-01T00:00:00.000Z", actual JS min value is -8640000000000000
|
|
535
|
+
return DateTime(-62135596800000, Util_ts_1.DateTimeKind.Utc);
|
|
536
|
+
}
|
|
537
|
+
function maxValue() {
|
|
538
|
+
// This is "9999-12-31T23:59:59.999Z", actual JS max value is 8640000000000000
|
|
539
|
+
return DateTime(253402300799999, Util_ts_1.DateTimeKind.Utc);
|
|
540
|
+
}
|
|
541
|
+
function parseRaw(input) {
|
|
542
|
+
function fail() {
|
|
543
|
+
throw new Util_ts_1.Exception(`The string is not a valid Date: ${input}`);
|
|
544
|
+
}
|
|
545
|
+
if (input == null || input.trim() === "") {
|
|
546
|
+
fail();
|
|
547
|
+
}
|
|
548
|
+
// ISO dates without TZ are parsed as UTC. Adding time without TZ keeps them local.
|
|
549
|
+
if (input.length === 10 && input[4] === "-" && input[7] === "-") {
|
|
550
|
+
input += "T00:00:00";
|
|
551
|
+
}
|
|
552
|
+
let date = new Date(input);
|
|
553
|
+
let offset = null;
|
|
554
|
+
if (isNaN(date.getTime())) {
|
|
555
|
+
// Try to check strings JS Date cannot parse (see #1045, #1422)
|
|
556
|
+
const m = /^\s*(\d+[^\w\s:]\d+[^\w\s:]\d+)?\s*(\d+:\d+(?::\d+(?:\.\d+)?)?)?\s*([AaPp][Mm])?\s*(Z|[+-]([01]?\d):?([0-5]?\d)?)?\s*$/.exec(input);
|
|
557
|
+
if (m != null) {
|
|
558
|
+
let baseDate;
|
|
559
|
+
let timeInSeconds = 0;
|
|
560
|
+
if (m[2] != null) {
|
|
561
|
+
const timeParts = m[2].split(":");
|
|
562
|
+
const hourPart = parseInt(timeParts[0], 10);
|
|
563
|
+
timeInSeconds =
|
|
564
|
+
hourPart * 3600 +
|
|
565
|
+
parseInt(timeParts[1] || "0", 10) * 60 +
|
|
566
|
+
parseFloat(timeParts[2] || "0");
|
|
567
|
+
if (m[3] != null && m[3].toUpperCase() === "PM" && hourPart < 12) {
|
|
568
|
+
timeInSeconds += 720;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
if (m[4] != null) { // There's an offset, parse as UTC
|
|
572
|
+
if (m[1] != null) {
|
|
573
|
+
baseDate = new Date(m[1] + " UTC");
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
const d = new Date();
|
|
577
|
+
baseDate = new Date(d.getUTCFullYear() + "/" + (d.getUTCMonth() + 1) + "/" + d.getUTCDate());
|
|
578
|
+
}
|
|
579
|
+
if (m[4] === "Z") {
|
|
580
|
+
offset = "Z";
|
|
581
|
+
}
|
|
582
|
+
else {
|
|
583
|
+
let offsetInMinutes = parseInt(m[5], 10) * 60 + parseInt(m[6] || "0", 10);
|
|
584
|
+
if (m[4][0] === "-") {
|
|
585
|
+
offsetInMinutes *= -1;
|
|
586
|
+
}
|
|
587
|
+
offset = offsetInMinutes;
|
|
588
|
+
timeInSeconds -= offsetInMinutes * 60;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
if (m[1] != null) {
|
|
593
|
+
baseDate = new Date(m[1]);
|
|
594
|
+
}
|
|
595
|
+
else {
|
|
596
|
+
const d = new Date();
|
|
597
|
+
baseDate = new Date(d.getFullYear() + "/" + (d.getMonth() + 1) + "/" + d.getDate());
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
date = new Date(baseDate.getTime() + timeInSeconds * 1000);
|
|
601
|
+
// correct for daylight savings time
|
|
602
|
+
date = new Date(date.getTime() + (date.getTimezoneOffset() - baseDate.getTimezoneOffset()) * 60000);
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
fail();
|
|
606
|
+
}
|
|
607
|
+
// Check again the date is valid after transformations, see #2229
|
|
608
|
+
if (isNaN(date.getTime())) {
|
|
609
|
+
fail();
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
return [date, offset];
|
|
613
|
+
}
|
|
614
|
+
function parse(str, detectUTC = false) {
|
|
615
|
+
const [date, offset] = parseRaw(str);
|
|
616
|
+
// .NET always parses DateTime as Local if there's offset info (even "Z")
|
|
617
|
+
// Newtonsoft.Json uses UTC if the offset is "Z"
|
|
618
|
+
const kind = offset != null
|
|
619
|
+
? (detectUTC && offset === "Z" ? Util_ts_1.DateTimeKind.Utc : Util_ts_1.DateTimeKind.Local)
|
|
620
|
+
: Util_ts_1.DateTimeKind.Unspecified;
|
|
621
|
+
return DateTime(date.getTime(), kind);
|
|
622
|
+
}
|
|
623
|
+
function tryParse(v, defValue) {
|
|
624
|
+
try {
|
|
625
|
+
defValue.contents = parse(v);
|
|
626
|
+
return true;
|
|
627
|
+
}
|
|
628
|
+
catch (_err) {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
function create(year, month, day, h = 0, m = 0, s = 0, ms = 0, kind) {
|
|
633
|
+
const date = kind === Util_ts_1.DateTimeKind.Utc
|
|
634
|
+
? new Date(Date.UTC(year, month - 1, day, h, m, s, ms))
|
|
635
|
+
: new Date(year, month - 1, day, h, m, s, ms);
|
|
636
|
+
if (year <= 99) {
|
|
637
|
+
if (kind === Util_ts_1.DateTimeKind.Utc) {
|
|
638
|
+
date.setUTCFullYear(year, month - 1, day);
|
|
639
|
+
}
|
|
640
|
+
else {
|
|
641
|
+
date.setFullYear(year, month - 1, day);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const dateValue = date.getTime();
|
|
645
|
+
if (isNaN(dateValue)) {
|
|
646
|
+
throw new Util_ts_1.Exception("The parameters describe an unrepresentable Date.");
|
|
647
|
+
}
|
|
648
|
+
return DateTime(dateValue, kind);
|
|
649
|
+
}
|
|
650
|
+
function now() {
|
|
651
|
+
return DateTime(Date.now(), Util_ts_1.DateTimeKind.Local);
|
|
652
|
+
}
|
|
653
|
+
function utcNow() {
|
|
654
|
+
return DateTime(Date.now(), Util_ts_1.DateTimeKind.Utc);
|
|
655
|
+
}
|
|
656
|
+
function today() {
|
|
657
|
+
return date(now());
|
|
658
|
+
}
|
|
659
|
+
function isLeapYear(year) {
|
|
660
|
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
661
|
+
}
|
|
662
|
+
function daysInMonth(year, month) {
|
|
663
|
+
return month === 2
|
|
664
|
+
? (isLeapYear(year) ? 29 : 28)
|
|
665
|
+
: (month >= 8 ? (month % 2 === 0 ? 31 : 30) : (month % 2 === 0 ? 30 : 31));
|
|
666
|
+
}
|
|
667
|
+
function toUniversalTime(date) {
|
|
668
|
+
return date.kind === Util_ts_1.DateTimeKind.Utc ? date : DateTime(date.getTime(), Util_ts_1.DateTimeKind.Utc);
|
|
669
|
+
}
|
|
670
|
+
function toLocalTime(date) {
|
|
671
|
+
return date.kind === Util_ts_1.DateTimeKind.Local ? date : DateTime(date.getTime(), Util_ts_1.DateTimeKind.Local);
|
|
672
|
+
}
|
|
673
|
+
function specifyKind(d, kind) {
|
|
674
|
+
return create(year(d), month(d), day(d), hour(d), minute(d), second(d), millisecond(d), kind);
|
|
675
|
+
}
|
|
676
|
+
function timeOfDay(d) {
|
|
677
|
+
return hour(d) * 3600000
|
|
678
|
+
+ minute(d) * 60000
|
|
679
|
+
+ second(d) * 1000
|
|
680
|
+
+ millisecond(d);
|
|
681
|
+
}
|
|
682
|
+
function date(d) {
|
|
683
|
+
return create(year(d), month(d), day(d), 0, 0, 0, 0, d.kind);
|
|
684
|
+
}
|
|
685
|
+
function day(d) {
|
|
686
|
+
return d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCDate() : d.getDate();
|
|
687
|
+
}
|
|
688
|
+
function hour(d) {
|
|
689
|
+
return d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCHours() : d.getHours();
|
|
690
|
+
}
|
|
691
|
+
function millisecond(d) {
|
|
692
|
+
return d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCMilliseconds() : d.getMilliseconds();
|
|
693
|
+
}
|
|
694
|
+
function minute(d) {
|
|
695
|
+
return d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCMinutes() : d.getMinutes();
|
|
696
|
+
}
|
|
697
|
+
function month(d) {
|
|
698
|
+
return (d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCMonth() : d.getMonth()) + 1;
|
|
699
|
+
}
|
|
700
|
+
function second(d) {
|
|
701
|
+
return d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCSeconds() : d.getSeconds();
|
|
702
|
+
}
|
|
703
|
+
function year(d) {
|
|
704
|
+
return d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCFullYear() : d.getFullYear();
|
|
705
|
+
}
|
|
706
|
+
function dayOfWeek(d) {
|
|
707
|
+
return d.kind === Util_ts_1.DateTimeKind.Utc ? d.getUTCDay() : d.getDay();
|
|
708
|
+
}
|
|
709
|
+
function dayOfYear(d) {
|
|
710
|
+
const _year = year(d);
|
|
711
|
+
const _month = month(d);
|
|
712
|
+
let _day = day(d);
|
|
713
|
+
for (let i = 1; i < _month; i++) {
|
|
714
|
+
_day += daysInMonth(_year, i);
|
|
715
|
+
}
|
|
716
|
+
return _day;
|
|
717
|
+
}
|
|
718
|
+
function add(d, ts) {
|
|
719
|
+
const newDate = DateTime(d.getTime() + ts, d.kind);
|
|
720
|
+
if (d.kind !== Util_ts_1.DateTimeKind.Utc) {
|
|
721
|
+
const oldTzOffset = d.getTimezoneOffset();
|
|
722
|
+
const newTzOffset = newDate.getTimezoneOffset();
|
|
723
|
+
return oldTzOffset !== newTzOffset
|
|
724
|
+
? DateTime(newDate.getTime() + (newTzOffset - oldTzOffset) * 60000, d.kind)
|
|
725
|
+
: newDate;
|
|
726
|
+
}
|
|
727
|
+
else {
|
|
728
|
+
return newDate;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
function addDays(d, v) {
|
|
732
|
+
return add(d, v * 86400000);
|
|
733
|
+
}
|
|
734
|
+
function addHours(d, v) {
|
|
735
|
+
return add(d, v * 3600000);
|
|
736
|
+
}
|
|
737
|
+
function addMinutes(d, v) {
|
|
738
|
+
return add(d, v * 60000);
|
|
739
|
+
}
|
|
740
|
+
function addSeconds(d, v) {
|
|
741
|
+
return add(d, v * 1000);
|
|
742
|
+
}
|
|
743
|
+
function addMilliseconds(d, v) {
|
|
744
|
+
return add(d, v);
|
|
745
|
+
}
|
|
746
|
+
function addTicks(d, v) {
|
|
747
|
+
return add(d, (0, BigInt_ts_1.toFloat64)(v / 10000n));
|
|
748
|
+
}
|
|
749
|
+
function addYears(d, v) {
|
|
750
|
+
const newMonth = month(d);
|
|
751
|
+
const newYear = year(d) + v;
|
|
752
|
+
const _daysInMonth = daysInMonth(newYear, newMonth);
|
|
753
|
+
const newDay = Math.min(_daysInMonth, day(d));
|
|
754
|
+
return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);
|
|
755
|
+
}
|
|
756
|
+
function addMonths(d, v) {
|
|
757
|
+
let newMonth = month(d) + v;
|
|
758
|
+
let newMonth_ = 0;
|
|
759
|
+
let yearOffset = 0;
|
|
760
|
+
if (newMonth > 12) {
|
|
761
|
+
newMonth_ = newMonth % 12;
|
|
762
|
+
yearOffset = Math.floor(newMonth / 12);
|
|
763
|
+
newMonth = newMonth_;
|
|
764
|
+
}
|
|
765
|
+
else if (newMonth < 1) {
|
|
766
|
+
newMonth_ = 12 + newMonth % 12;
|
|
767
|
+
yearOffset = Math.floor(newMonth / 12) + (newMonth_ === 12 ? -1 : 0);
|
|
768
|
+
newMonth = newMonth_;
|
|
769
|
+
}
|
|
770
|
+
const newYear = year(d) + yearOffset;
|
|
771
|
+
const _daysInMonth = daysInMonth(newYear, newMonth);
|
|
772
|
+
const newDay = Math.min(_daysInMonth, day(d));
|
|
773
|
+
return create(newYear, newMonth, newDay, hour(d), minute(d), second(d), millisecond(d), d.kind);
|
|
774
|
+
}
|
|
775
|
+
function subtract(d, that) {
|
|
776
|
+
return typeof that === "number"
|
|
777
|
+
? add(d, -that)
|
|
778
|
+
: d.getTime() - that.getTime();
|
|
779
|
+
}
|
|
780
|
+
function toLongDateString(d) {
|
|
781
|
+
return d.toDateString();
|
|
782
|
+
}
|
|
783
|
+
function toShortDateString(d) {
|
|
784
|
+
return d.toLocaleDateString();
|
|
785
|
+
}
|
|
786
|
+
function toLongTimeString(d) {
|
|
787
|
+
return d.toLocaleTimeString();
|
|
788
|
+
}
|
|
789
|
+
function toShortTimeString(d) {
|
|
790
|
+
return d.toLocaleTimeString().replace(/:\d\d(?!:)/, "");
|
|
791
|
+
}
|
|
792
|
+
function equals(d1, d2) {
|
|
793
|
+
return d1.getTime() === d2.getTime();
|
|
794
|
+
}
|
|
795
|
+
exports.compare = Util_ts_1.compareDates;
|
|
796
|
+
exports.compareTo = Util_ts_1.compareDates;
|
|
797
|
+
function op_Addition(x, y) {
|
|
798
|
+
return add(x, y);
|
|
799
|
+
}
|
|
800
|
+
function op_Subtraction(x, y) {
|
|
801
|
+
return subtract(x, y);
|
|
802
|
+
}
|
|
803
|
+
function isDaylightSavingTime(x) {
|
|
804
|
+
const jan = new Date(x.getFullYear(), 0, 1);
|
|
805
|
+
const jul = new Date(x.getFullYear(), 6, 1);
|
|
806
|
+
return isDST(jan.getTimezoneOffset(), jul.getTimezoneOffset(), x.getTimezoneOffset());
|
|
807
|
+
}
|
|
808
|
+
function isDST(janOffset, julOffset, tOffset) {
|
|
809
|
+
return Math.min(janOffset, julOffset) === tOffset;
|
|
810
|
+
}
|
|
811
|
+
exports.default = DateTime;
|
|
812
|
+
//# sourceMappingURL=Date.js.map
|