@digicatapult/dtdl-parser 0.0.13 → 0.0.14
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/.depcheckrc +6 -0
- package/.github/CODEOWNERS +4 -0
- package/.github/workflows/release.yml +198 -0
- package/.github/workflows/test.yml +92 -0
- package/.gitignore +4 -0
- package/.prettierrc +9 -0
- package/.swcrc +32 -0
- package/build/error.d.ts +2 -0
- package/build/error.js +9 -0
- package/build/error.js.map +1 -0
- package/build/index.d.ts +8 -0
- package/build/index.js +59 -0
- package/build/index.js.map +1 -0
- package/build/interop/_framework/DTDLParserJSInterop.pdb +0 -0
- package/build/interop/_framework/DTDLParserJSInterop.wasm +0 -0
- package/build/interop/_framework/blazor.boot.json +3 -3
- package/build/interop.d.ts +5 -0
- package/dtdl/error/error.json +11 -0
- package/dtdl/simple/simple.json +9 -0
- package/eslint.config.mjs +52 -0
- package/package.json +14 -6
- package/src/__tests__/index.test.ts +119 -0
- package/src/error.ts +25 -0
- package/src/index.ts +134 -0
- package/src/interop/DTDLParserJSInterop.csproj +26 -0
- package/src/interop/LICENSE +21 -0
- package/src/interop/ModelParserInterop.cs +19 -0
- package/src/interop/README.md +1 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/DTDLParser.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/DTDLParserJSInterop.deps.json +921 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/DTDLParserJSInterop.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/DTDLParserJSInterop.pdb +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/DTDLParserJSInterop.runtimeconfig.json +40 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/Microsoft.CSharp.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/Microsoft.VisualBasic.Core.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/Microsoft.VisualBasic.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/Microsoft.Win32.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/Microsoft.Win32.Registry.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.AppContext.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Buffers.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Collections.Concurrent.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Collections.Immutable.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Collections.NonGeneric.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Collections.Specialized.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Collections.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ComponentModel.Annotations.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ComponentModel.DataAnnotations.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ComponentModel.EventBasedAsync.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ComponentModel.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ComponentModel.TypeConverter.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ComponentModel.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Configuration.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Console.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Core.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Data.Common.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Data.DataSetExtensions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Data.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.Contracts.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.Debug.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.DiagnosticSource.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.FileVersionInfo.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.Process.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.StackTrace.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.TextWriterTraceListener.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.Tools.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.TraceSource.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Diagnostics.Tracing.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Drawing.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Drawing.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Dynamic.Runtime.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Formats.Asn1.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Formats.Tar.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Globalization.Calendars.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Globalization.Extensions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Globalization.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.Compression.Brotli.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.Compression.FileSystem.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.Compression.ZipFile.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.Compression.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.FileSystem.AccessControl.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.FileSystem.DriveInfo.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.FileSystem.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.FileSystem.Watcher.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.FileSystem.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.IsolatedStorage.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.MemoryMappedFiles.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.Pipes.AccessControl.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.Pipes.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.UnmanagedMemoryStream.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.IO.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Linq.Expressions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Linq.Parallel.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Linq.Queryable.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Linq.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Memory.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Http.Json.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Http.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.HttpListener.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Mail.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.NameResolution.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.NetworkInformation.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Ping.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Quic.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Requests.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Security.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.ServicePoint.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.Sockets.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.WebClient.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.WebHeaderCollection.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.WebProxy.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.WebSockets.Client.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.WebSockets.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Net.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Numerics.Vectors.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Numerics.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ObjectModel.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Private.CoreLib.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Private.DataContractSerialization.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Private.Uri.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Private.Xml.Linq.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Private.Xml.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.DispatchProxy.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.Emit.ILGeneration.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.Emit.Lightweight.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.Emit.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.Extensions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.Metadata.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.TypeExtensions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Reflection.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Resources.Reader.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Resources.ResourceManager.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Resources.Writer.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.CompilerServices.Unsafe.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.CompilerServices.VisualC.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Extensions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Handles.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.InteropServices.JavaScript.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.InteropServices.RuntimeInformation.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.InteropServices.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Intrinsics.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Loader.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Numerics.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Serialization.Formatters.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Serialization.Json.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Serialization.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Serialization.Xml.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.Serialization.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Runtime.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.AccessControl.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Claims.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.Algorithms.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.Cng.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.Csp.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.Encoding.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.OpenSsl.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.Primitives.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.X509Certificates.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Cryptography.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Principal.Windows.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.Principal.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.SecureString.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Security.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ServiceModel.Web.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ServiceProcess.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Text.Encoding.CodePages.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Text.Encoding.Extensions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Text.Encoding.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Text.Encodings.Web.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Text.Json.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Text.RegularExpressions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Channels.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Overlapped.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Tasks.Dataflow.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Tasks.Extensions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Tasks.Parallel.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Tasks.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Thread.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.ThreadPool.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.Timer.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Threading.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Transactions.Local.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Transactions.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.ValueTuple.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Web.HttpUtility.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Web.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Windows.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.Linq.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.ReaderWriter.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.Serialization.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.XDocument.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.XPath.XDocument.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.XPath.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.XmlDocument.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.XmlSerializer.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.Xml.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/System.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/WindowsBase.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/corebindings.c +104 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet-legacy.d.ts +295 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.d.ts +472 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.es6.extpost.js +2 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.es6.lib.js +163 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.es6.pre.js +5 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.js +4 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.js.map +1 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.native.js +17 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.native.js.symbols +8582 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.native.wasm +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.runtime.js +4 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/dotnet.runtime.js.map +1 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/driver.c +1391 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/emcc-default.rsp +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/emcc-link.rsp +16 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/emcc-props.json +14 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/gc-common.h +73 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/icudt.dat +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/icudt_CJK.dat +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/icudt_EFIGS.dat +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/icudt_hybrid.dat +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/icudt_no_CJK.dat +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libSystem.Globalization.Native.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libSystem.IO.Compression.Native.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libSystem.Native.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libicudata.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libicui18n.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libicuuc.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-debugger-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-debugger-stub-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-diagnostics_tracing-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-diagnostics_tracing-stub-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-hot_reload-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-hot_reload-stub-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-marshal-ilgen-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-component-marshal-ilgen-stub-static.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-ee-interp.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-icall-table.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-profiler-aot.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-profiler-browser.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-wasm-eh-js.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-wasm-eh-wasm.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-wasm-nosimd.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmono-wasm-simd.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/libmonosgen-2.0.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/mscorlib.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/netstandard.dll +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/package.json +44 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/pal_random.lib.js +45 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/pinvoke.c +62 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/pinvoke.h +50 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/runtimeconfig.bin +1 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/wasm-bundled-timezones.a +0 -0
- package/src/interop/bin/Release/net8.0/browser-wasm/wasm-config.h +13 -0
- package/src/interop/modelParser.js +11 -0
- package/src/interop/obj/DTDLParserJSInterop.csproj.nuget.dgspec.json +83 -0
- package/src/interop/obj/DTDLParserJSInterop.csproj.nuget.g.props +21 -0
- package/src/interop/obj/DTDLParserJSInterop.csproj.nuget.g.targets +6 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs +4 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLPars.F465EEA8.Up2Date +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.AssemblyInfo.cs +22 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.AssemblyInfoInputs.cache +1 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.GeneratedMSBuildEditorConfig.editorconfig +17 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.assets.cache +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.csproj.AssemblyReference.cache +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.csproj.CoreCompileInputs.cache +1 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.csproj.FileListAbsolute.txt +237 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.dll +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.genruntimeconfig.cache +1 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.pdb +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/DTDLParserJSInterop.sourcelink.json +1 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/ref/DTDLParserJSInterop.dll +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/refint/DTDLParserJSInterop.dll +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/corebindings.o +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/dotnet.native.js +17 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/dotnet.native.wasm +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/driver.o +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/emcc-compile.rsp +12 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/emcc-link.rsp +38 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/icall-table.h +1653 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/m2n_cache.txt +3 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/pinvoke-table.h +329 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/pinvoke.o +0 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/runtime-icall-table.h +449 -0
- package/src/interop/obj/Release/net8.0/browser-wasm/wasm/for-build/wasm_m2n_invoke.g.h +522 -0
- package/src/interop/obj/project.assets.json +384 -0
- package/src/interop/obj/project.nuget.cache +13 -0
- package/src/interop/runtimeconfig.template.json +11 -0
- package/src/interop.ts +9 -0
- package/test/mocharc.json +6 -0
- package/tsconfig.json +31 -0
- package/types/DtdlErr.d.ts +26 -0
- package/types/DtdlOm.d.ts +372 -0
- package/build/package.json +0 -62
- package/build/src/error.js +0 -2
- package/build/src/error.js.map +0 -1
- package/build/src/index.js +0 -6
- package/build/src/index.js.map +0 -1
- package/build/src/interop.js +0 -2
- package/build/src/interop.js.map +0 -1
- /package/{build/src → src}/__tests__/fixtures/empty.json +0 -0
- /package/{build/src → src}/__tests__/fixtures/nested/nested.json +0 -0
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
export type DtdlObjectModel = { [entityId: string]: EntityType }
|
|
2
|
+
|
|
3
|
+
export interface ArrayInfo extends ComplexSchemaInfo {
|
|
4
|
+
EntityKind: 'Array'
|
|
5
|
+
elementSchema: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type ArrayType = ArrayInfo
|
|
9
|
+
|
|
10
|
+
export interface BooleanInfo extends PrimitiveSchemaInfo {
|
|
11
|
+
EntityKind: 'Boolean'
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type BooleanType = BooleanInfo
|
|
15
|
+
|
|
16
|
+
export interface CommandInfo extends ContentInfo {
|
|
17
|
+
EntityKind: 'Command'
|
|
18
|
+
commandType?: string
|
|
19
|
+
request?: string
|
|
20
|
+
response?: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type CommandType = CommandInfo
|
|
24
|
+
|
|
25
|
+
export interface CommandPayloadInfo extends SchemaFieldInfo {
|
|
26
|
+
EntityKind: 'CommandPayload' | 'CommandRequest' | 'CommandResponse'
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type CommandPayloadType = CommandPayloadInfo | CommandRequestType | CommandResponseType
|
|
30
|
+
|
|
31
|
+
export interface CommandRequestInfo extends CommandPayloadInfo {
|
|
32
|
+
EntityKind: 'CommandRequest'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type CommandRequestType = CommandRequestInfo
|
|
36
|
+
|
|
37
|
+
export interface CommandResponseInfo extends CommandPayloadInfo {
|
|
38
|
+
EntityKind: 'CommandResponse'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type CommandResponseType = CommandResponseInfo
|
|
42
|
+
|
|
43
|
+
export interface CommandTypeInfo extends EntityInfo {
|
|
44
|
+
EntityKind: 'CommandType'
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type CommandTypeType = CommandTypeInfo
|
|
48
|
+
|
|
49
|
+
export interface ComplexSchemaInfo extends SchemaInfo {
|
|
50
|
+
EntityKind: 'Array' | 'Enum' | 'Map' | 'Object'
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type ComplexSchemaType = ComplexSchemaInfo | ArrayType | EnumType | MapType | ObjectType
|
|
54
|
+
|
|
55
|
+
export interface ComponentInfo extends ContentInfo {
|
|
56
|
+
EntityKind: 'Component'
|
|
57
|
+
schema: string
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export type ComponentType = ComponentInfo
|
|
61
|
+
|
|
62
|
+
export interface ContentInfo extends NamedEntityInfo {
|
|
63
|
+
EntityKind: 'Command' | 'Component' | 'Property' | 'Relationship' | 'Telemetry'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type ContentType = ContentInfo | CommandType | ComponentType | PropertyType | RelationshipType | TelemetryType
|
|
67
|
+
|
|
68
|
+
export interface DateInfo extends TemporalSchemaInfo {
|
|
69
|
+
EntityKind: 'Date'
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export type DateType = DateInfo
|
|
73
|
+
|
|
74
|
+
export interface DateTimeInfo extends TemporalSchemaInfo {
|
|
75
|
+
EntityKind: 'DateTime'
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export type DateTimeType = DateTimeInfo
|
|
79
|
+
|
|
80
|
+
export interface DoubleInfo extends NumericSchemaInfo {
|
|
81
|
+
EntityKind: 'Double'
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type DoubleType = DoubleInfo
|
|
85
|
+
|
|
86
|
+
export interface DurationInfo extends TemporalSchemaInfo {
|
|
87
|
+
EntityKind: 'Duration'
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export type DurationType = DurationInfo
|
|
91
|
+
|
|
92
|
+
export interface EntityInfo {
|
|
93
|
+
EntityKind:
|
|
94
|
+
| 'Array'
|
|
95
|
+
| 'Boolean'
|
|
96
|
+
| 'Command'
|
|
97
|
+
| 'CommandPayload'
|
|
98
|
+
| 'CommandType'
|
|
99
|
+
| 'Component'
|
|
100
|
+
| 'Date'
|
|
101
|
+
| 'DateTime'
|
|
102
|
+
| 'Double'
|
|
103
|
+
| 'Duration'
|
|
104
|
+
| 'Enum'
|
|
105
|
+
| 'EnumValue'
|
|
106
|
+
| 'Field'
|
|
107
|
+
| 'Float'
|
|
108
|
+
| 'Integer'
|
|
109
|
+
| 'Interface'
|
|
110
|
+
| 'Long'
|
|
111
|
+
| 'Map'
|
|
112
|
+
| 'MapKey'
|
|
113
|
+
| 'MapValue'
|
|
114
|
+
| 'Object'
|
|
115
|
+
| 'Property'
|
|
116
|
+
| 'Relationship'
|
|
117
|
+
| 'String'
|
|
118
|
+
| 'Telemetry'
|
|
119
|
+
| 'Time'
|
|
120
|
+
| 'CommandRequest'
|
|
121
|
+
| 'CommandResponse'
|
|
122
|
+
| 'Unit'
|
|
123
|
+
| 'UnitAttribute'
|
|
124
|
+
| 'LatentType'
|
|
125
|
+
| 'NamedLatentType'
|
|
126
|
+
SupplementalTypes: string[]
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
|
+
SupplementalProperties: { [property: string]: any }
|
|
129
|
+
UndefinedTypes: string[]
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
131
|
+
UndefinedProperties: { [property: string]: any }
|
|
132
|
+
ClassId: string
|
|
133
|
+
comment?: string
|
|
134
|
+
description: { [languageCode: string]: string }
|
|
135
|
+
displayName: { [languageCode: string]: string }
|
|
136
|
+
languageMajorVersion: number
|
|
137
|
+
Id: string
|
|
138
|
+
ChildOf?: string
|
|
139
|
+
DefinedIn?: string
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export type EntityType =
|
|
143
|
+
| EntityInfo
|
|
144
|
+
| CommandTypeType
|
|
145
|
+
| InterfaceType
|
|
146
|
+
| LatentTypeType
|
|
147
|
+
| NamedEntityType
|
|
148
|
+
| SchemaType
|
|
149
|
+
| UnitType
|
|
150
|
+
|
|
151
|
+
export interface EnumInfo extends ComplexSchemaInfo {
|
|
152
|
+
EntityKind: 'Enum'
|
|
153
|
+
enumValues: string[]
|
|
154
|
+
valueSchema: string
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export type EnumType = EnumInfo
|
|
158
|
+
|
|
159
|
+
export interface EnumValueInfo extends NamedEntityInfo {
|
|
160
|
+
EntityKind: 'EnumValue'
|
|
161
|
+
enumValue: string | number | boolean
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export type EnumValueType = EnumValueInfo
|
|
165
|
+
|
|
166
|
+
export interface FieldInfo extends SchemaFieldInfo {
|
|
167
|
+
EntityKind: 'Field'
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export type FieldType = FieldInfo
|
|
171
|
+
|
|
172
|
+
export interface FloatInfo extends NumericSchemaInfo {
|
|
173
|
+
EntityKind: 'Float'
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export type FloatType = FloatInfo
|
|
177
|
+
|
|
178
|
+
export interface IntegerInfo extends NumericSchemaInfo {
|
|
179
|
+
EntityKind: 'Integer'
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export type IntegerType = IntegerInfo
|
|
183
|
+
|
|
184
|
+
export interface InterfaceInfo extends EntityInfo {
|
|
185
|
+
EntityKind: 'Interface'
|
|
186
|
+
contents: { [name: string]: string }
|
|
187
|
+
commands: { [name: string]: string }
|
|
188
|
+
components: { [name: string]: string }
|
|
189
|
+
properties: { [name: string]: string }
|
|
190
|
+
relationships: { [name: string]: string }
|
|
191
|
+
telemetries: { [name: string]: string }
|
|
192
|
+
extends: string[]
|
|
193
|
+
extendedBy: string[]
|
|
194
|
+
schemas: string[]
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export type InterfaceType = InterfaceInfo
|
|
198
|
+
|
|
199
|
+
export interface LatentTypeInfo extends EntityInfo {
|
|
200
|
+
EntityKind: 'LatentType'
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export type LatentTypeType = LatentTypeInfo
|
|
204
|
+
|
|
205
|
+
export interface LongInfo extends NumericSchemaInfo {
|
|
206
|
+
EntityKind: 'Long'
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export type LongType = LongInfo
|
|
210
|
+
|
|
211
|
+
export interface MapInfo extends ComplexSchemaInfo {
|
|
212
|
+
EntityKind: 'Map'
|
|
213
|
+
mapKey: string
|
|
214
|
+
mapValue: string
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export type MapType = MapInfo
|
|
218
|
+
|
|
219
|
+
export interface MapKeyInfo extends NamedEntityInfo {
|
|
220
|
+
EntityKind: 'MapKey'
|
|
221
|
+
schema: string
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
export type MapKeyType = MapKeyInfo
|
|
225
|
+
|
|
226
|
+
export interface MapValueInfo extends SchemaFieldInfo {
|
|
227
|
+
EntityKind: 'MapValue'
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export type MapValueType = MapValueInfo
|
|
231
|
+
|
|
232
|
+
export interface NamedEntityInfo extends EntityInfo {
|
|
233
|
+
EntityKind:
|
|
234
|
+
| 'Command'
|
|
235
|
+
| 'CommandPayload'
|
|
236
|
+
| 'Component'
|
|
237
|
+
| 'EnumValue'
|
|
238
|
+
| 'Field'
|
|
239
|
+
| 'MapKey'
|
|
240
|
+
| 'MapValue'
|
|
241
|
+
| 'Property'
|
|
242
|
+
| 'Relationship'
|
|
243
|
+
| 'Telemetry'
|
|
244
|
+
| 'CommandRequest'
|
|
245
|
+
| 'CommandResponse'
|
|
246
|
+
| 'UnitAttribute'
|
|
247
|
+
| 'NamedLatentType'
|
|
248
|
+
name: string
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
export type NamedEntityType =
|
|
252
|
+
| NamedEntityInfo
|
|
253
|
+
| ContentType
|
|
254
|
+
| EnumValueType
|
|
255
|
+
| MapKeyType
|
|
256
|
+
| NamedLatentTypeType
|
|
257
|
+
| SchemaFieldType
|
|
258
|
+
| UnitAttributeType
|
|
259
|
+
|
|
260
|
+
export interface NamedLatentTypeInfo extends NamedEntityInfo {
|
|
261
|
+
EntityKind: 'NamedLatentType'
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export type NamedLatentTypeType = NamedLatentTypeInfo
|
|
265
|
+
|
|
266
|
+
export interface NumericSchemaInfo extends PrimitiveSchemaInfo {
|
|
267
|
+
EntityKind: 'Double' | 'Float' | 'Integer' | 'Long'
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
export type NumericSchemaType = NumericSchemaInfo | DoubleType | FloatType | IntegerType | LongType
|
|
271
|
+
|
|
272
|
+
export interface ObjectInfo extends ComplexSchemaInfo {
|
|
273
|
+
EntityKind: 'Object'
|
|
274
|
+
fields: string[]
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
export type ObjectType = ObjectInfo
|
|
278
|
+
|
|
279
|
+
export interface PrimitiveSchemaInfo extends SchemaInfo {
|
|
280
|
+
EntityKind: 'Boolean' | 'Date' | 'DateTime' | 'Double' | 'Duration' | 'Float' | 'Integer' | 'Long' | 'String' | 'Time'
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
export type PrimitiveSchemaType =
|
|
284
|
+
| PrimitiveSchemaInfo
|
|
285
|
+
| BooleanType
|
|
286
|
+
| NumericSchemaType
|
|
287
|
+
| StringType
|
|
288
|
+
| TemporalSchemaType
|
|
289
|
+
|
|
290
|
+
export interface PropertyInfo extends ContentInfo {
|
|
291
|
+
EntityKind: 'Property'
|
|
292
|
+
schema: string
|
|
293
|
+
writable: boolean
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
export type PropertyType = PropertyInfo
|
|
297
|
+
|
|
298
|
+
export interface RelationshipInfo extends ContentInfo {
|
|
299
|
+
EntityKind: 'Relationship'
|
|
300
|
+
maxMultiplicity?: number
|
|
301
|
+
minMultiplicity?: number
|
|
302
|
+
properties: string[]
|
|
303
|
+
target?: string
|
|
304
|
+
writable: boolean
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export type RelationshipType = RelationshipInfo
|
|
308
|
+
|
|
309
|
+
export interface SchemaInfo extends EntityInfo {
|
|
310
|
+
EntityKind:
|
|
311
|
+
| 'Array'
|
|
312
|
+
| 'Boolean'
|
|
313
|
+
| 'Date'
|
|
314
|
+
| 'DateTime'
|
|
315
|
+
| 'Double'
|
|
316
|
+
| 'Duration'
|
|
317
|
+
| 'Enum'
|
|
318
|
+
| 'Float'
|
|
319
|
+
| 'Integer'
|
|
320
|
+
| 'Long'
|
|
321
|
+
| 'Map'
|
|
322
|
+
| 'Object'
|
|
323
|
+
| 'String'
|
|
324
|
+
| 'Time'
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
export type SchemaType = SchemaInfo | ComplexSchemaType | PrimitiveSchemaType
|
|
328
|
+
|
|
329
|
+
export interface SchemaFieldInfo extends NamedEntityInfo {
|
|
330
|
+
EntityKind: 'CommandPayload' | 'Field' | 'MapValue' | 'CommandRequest' | 'CommandResponse'
|
|
331
|
+
schema: string
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export type SchemaFieldType = SchemaFieldInfo | CommandPayloadType | FieldType | MapValueType
|
|
335
|
+
|
|
336
|
+
export interface StringInfo extends PrimitiveSchemaInfo {
|
|
337
|
+
EntityKind: 'String'
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export type StringType = StringInfo
|
|
341
|
+
|
|
342
|
+
export interface TelemetryInfo extends ContentInfo {
|
|
343
|
+
EntityKind: 'Telemetry'
|
|
344
|
+
schema: string
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
export type TelemetryType = TelemetryInfo
|
|
348
|
+
|
|
349
|
+
export interface TemporalSchemaInfo extends PrimitiveSchemaInfo {
|
|
350
|
+
EntityKind: 'Date' | 'DateTime' | 'Duration' | 'Time'
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
export type TemporalSchemaType = TemporalSchemaInfo | DateType | DateTimeType | DurationType | TimeType
|
|
354
|
+
|
|
355
|
+
export interface TimeInfo extends TemporalSchemaInfo {
|
|
356
|
+
EntityKind: 'Time'
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
export type TimeType = TimeInfo
|
|
360
|
+
|
|
361
|
+
export interface UnitInfo extends EntityInfo {
|
|
362
|
+
EntityKind: 'Unit'
|
|
363
|
+
symbol?: string
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export type UnitType = UnitInfo
|
|
367
|
+
|
|
368
|
+
export interface UnitAttributeInfo extends NamedEntityInfo {
|
|
369
|
+
EntityKind: 'UnitAttribute'
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export type UnitAttributeType = UnitAttributeInfo
|
package/build/package.json
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@digicatapult/dtdl-parser",
|
|
3
|
-
"version": "0.0.13",
|
|
4
|
-
"description": "JS tool to parse DTDL defined Ontologies",
|
|
5
|
-
"main": "build/src/index.js",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "NODE_ENV=test ./node_modules/.bin/mocha --config ./test/mocharc.json ./src/**/*.test.ts",
|
|
9
|
-
"build": "swc ./src ./package.json -d ./build --copy-files && npm run interop:build",
|
|
10
|
-
"interop:debug": "dotnet build interop",
|
|
11
|
-
"interop:build": "dotnet build interop --configuration Release",
|
|
12
|
-
"clean": "rimraf -rf ./build",
|
|
13
|
-
"lint": "eslint .",
|
|
14
|
-
"depcheck": "depcheck"
|
|
15
|
-
},
|
|
16
|
-
"repository": {
|
|
17
|
-
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/digicatapult/dtdl-parser.git"
|
|
19
|
-
},
|
|
20
|
-
"files": [
|
|
21
|
-
"build"
|
|
22
|
-
],
|
|
23
|
-
"keywords": [
|
|
24
|
-
"dtdl",
|
|
25
|
-
"digital",
|
|
26
|
-
"twins",
|
|
27
|
-
"parsing",
|
|
28
|
-
"tool"
|
|
29
|
-
],
|
|
30
|
-
"author": "Digital Catapult",
|
|
31
|
-
"license": "Apache-2.0",
|
|
32
|
-
"bugs": {
|
|
33
|
-
"url": "https://github.com/digicatapult/dtdl-parser/issues"
|
|
34
|
-
},
|
|
35
|
-
"homepage": "https://github.com/digicatapult/dtdl-parser#readme",
|
|
36
|
-
"devDependencies": {
|
|
37
|
-
"@eslint/eslintrc": "^3.1.0",
|
|
38
|
-
"@eslint/js": "^9.12.0",
|
|
39
|
-
"@swc-node/register": "^1.10.9",
|
|
40
|
-
"@swc/cli": "^0.4.1-nightly.20240914",
|
|
41
|
-
"@swc/core": "^1.7.35",
|
|
42
|
-
"@types/chai": "^5.0.0",
|
|
43
|
-
"@types/mocha": "^10.0.9",
|
|
44
|
-
"@types/node": "^22.7.5",
|
|
45
|
-
"@typescript-eslint/eslint-plugin": "^8.8.1",
|
|
46
|
-
"@typescript-eslint/parser": "^8.8.1",
|
|
47
|
-
"chai": "^5.1.1",
|
|
48
|
-
"depcheck": "^1.4.7",
|
|
49
|
-
"eslint": "^9.12.0",
|
|
50
|
-
"eslint-config-prettier": "^9.1.0",
|
|
51
|
-
"eslint-plugin-prettier": "^5.2.1",
|
|
52
|
-
"globals": "^15.11.0",
|
|
53
|
-
"mocha": "^10.7.3",
|
|
54
|
-
"prettier": "^3.3.3",
|
|
55
|
-
"prettier-plugin-organize-imports": "^4.1.0",
|
|
56
|
-
"rimraf": "^6.0.1",
|
|
57
|
-
"typescript": "^5.6.3"
|
|
58
|
-
},
|
|
59
|
-
"engines": {
|
|
60
|
-
"node": ">= 20"
|
|
61
|
-
}
|
|
62
|
-
}
|
package/build/src/error.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
let{error:e}=console,n=e=>"Parsing"===e.ExceptionKind,o=e=>"Resolution"===e.ExceptionKind;export const isResolutionException=e=>e instanceof Error&&o(JSON.parse(e.message));export const errorHandler=r=>{if(!(r instanceof Error))return e(`Unexpected error: ${r}`);let t=JSON.parse(r.message);n(t)||o(t)||e("Unknown exception type"),e(t)};
|
|
2
|
-
//# sourceMappingURL=error.js.map
|
package/build/src/error.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/error.ts"],"sourcesContent":["import { ModelingException, ParsingException, ResolutionException } from '../interop/DtdlErr.js'\n\nconst { error } = console\n\nconst isParsingEx = (exception: ModelingException): exception is ParsingException => {\n return exception.ExceptionKind === 'Parsing'\n}\n\nconst isResolutionEx = (exception: ModelingException): exception is ResolutionException => {\n return exception.ExceptionKind === 'Resolution'\n}\n\nexport const isResolutionException = (err: unknown) => {\n if (!(err instanceof Error)) return false\n return isResolutionEx(JSON.parse(err.message))\n}\n\nexport const errorHandler = (err: unknown) => {\n if (!(err instanceof Error)) return error(`Unexpected error: ${err}`)\n\n const exception = JSON.parse(err.message) as ModelingException\n\n if (!(isParsingEx(exception) || isResolutionEx(exception))) error('Unknown exception type')\n error(exception)\n}\n"],"names":["error","console","isParsingEx","exception","ExceptionKind","isResolutionEx","isResolutionException","err","Error","JSON","parse","message","errorHandler"],"mappings":"AAEA,GAAM,CAAEA,MAAAA,CAAK,CAAE,CAAGC,QAEZC,EAAc,AAACC,GACZA,AAA4B,YAA5BA,EAAUC,aAAa,CAG1BC,EAAiB,AAACF,GACfA,AAA4B,eAA5BA,EAAUC,aAAa,AAGhC,QAAO,MAAME,sBAAwB,AAACC,GACpC,AAAMA,aAAeC,OACdH,EAAeI,KAAKC,KAAK,CAACH,EAAII,OAAO,EAC7C,AAED,QAAO,MAAMC,aAAe,AAACL,IAC3B,GAAI,CAAEA,CAAAA,aAAeC,KAAI,EAAI,OAAOR,EAAM,CAAC,kBAAkB,EAAEO,EAAI,CAAC,EAEpE,IAAMJ,EAAYM,KAAKC,KAAK,CAACH,EAAII,OAAO,EAElCT,EAAYC,IAAcE,EAAeF,IAAaH,EAAM,0BAClEA,EAAMG,EACR,CAAC"}
|
package/build/src/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import e from"fs";import r from"path";import{errorHandler as t,isResolutionException as l}from"./error.js";import{getInterop as n}from"./interop.js";let{log:s,error:i}=console;export const searchForJsonFiles=t=>e.existsSync(t)?e.readdirSync(t).map(e=>r.join(t,e)).reduce((t,l)=>e.statSync(l).isDirectory()?t.concat(searchForJsonFiles(l)):".json"===r.extname(l)?t.concat(l):t,[]):(i(`'${t}' not a valid filepath`),[]);let o=r=>{try{let t=e.readFileSync(r,"utf-8");return JSON.parse(t)}catch(e){return i(`Invalid JSON at '${r}'`),i(e),null}},a=e=>{let r=[];for(let t of e){let e=o(t);if(null===e)return null;r.push(e)}return r},u=(r,n,o)=>{try{let t=e.readFileSync(r,"utf-8");return n.parse(t),s(`Successfully validated '${r}'`),!0}catch(e){if(!o&&l(e))return s(`Successfully validated '${r}'`),!0;return i(`Error parsing '${r}'`),t(e),!1}},c=(e,r)=>{try{let t=JSON.parse(r.parse(JSON.stringify(e)));return s("Successfully parsed"),t}catch(e){return i("Error parsing"),t(e),null}};export const validateDirectories=(e,r,t)=>{s(`${r.parserVersion()}
|
|
2
|
-
`),s(`Validating DTDL at: '${e}'`);let l=searchForJsonFiles(e);if(l.length<1)return!1;for(let e of(s(`Found ${l.length} files:`),s(l),l))if(!u(e,r,t))return!1;return s(`All files validated!
|
|
3
|
-
`),!0};export const parseDirectories=(e,r)=>{s(`${r.parserVersion()}
|
|
4
|
-
`),s(`Parsing DTDL at: '${e}'`);let t=searchForJsonFiles(e);if(t.length<1)return null;s(`Found ${t.length} files:`),s(t);let l=a(t);if(null===l)return null;let n=c(l,r);if(null===n)return null;s(`All files parsed!
|
|
5
|
-
`),s("Entities:"),s(Object.keys(n));let i=Object.values(n).filter(e=>"Interface"===e.EntityKind);return s(`Number of interfaces: ${i.length}`),n};export{t as errorHandler,n as getInterop,l as isResolutionException};
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
package/build/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts"],"sourcesContent":["import fs from 'fs'\nimport path from 'path'\nimport { DtdlObjectModel, InterfaceInfo } from '../interop/DtdlOm.js'\nimport { errorHandler, isResolutionException } from './error.js'\nimport { Parser, getInterop } from './interop.js'\n\nconst { log, error } = console\n\nexport const searchForJsonFiles = (directory: string): string[] => {\n if (!fs.existsSync(directory)) {\n error(`'${directory}' not a valid filepath`)\n return []\n }\n\n return fs\n .readdirSync(directory)\n .map((file) => path.join(directory, file))\n .reduce((jsonFiles, fullPath) => {\n if (fs.statSync(fullPath).isDirectory()) {\n return jsonFiles.concat(searchForJsonFiles(fullPath)) //recursive\n } else if (path.extname(fullPath) === '.json') {\n return jsonFiles.concat(fullPath)\n }\n return jsonFiles\n }, [] as string[])\n}\n\nconst readJsonFile = (filepath: string): unknown | null => {\n try {\n const file = fs.readFileSync(filepath, 'utf-8')\n const json = JSON.parse(file)\n return json\n } catch (err) {\n error(`Invalid JSON at '${filepath}'`)\n error(err)\n return null\n }\n}\n\nconst combineJson = (filepaths: string[]) => {\n const combinedJson: unknown[] = []\n\n for (const filepath of filepaths) {\n const json = readJsonFile(filepath)\n if (json === null) {\n return null // exit on any error\n }\n combinedJson.push(json)\n }\n\n return combinedJson\n}\n\nconst validateFile = (filepath: string, parserModule: Parser, incResolutionException: boolean): boolean => {\n try {\n const file = fs.readFileSync(filepath, 'utf-8')\n parserModule.parse(file)\n log(`Successfully validated '${filepath}'`)\n return true\n } catch (err) {\n if (!incResolutionException && isResolutionException(err)) {\n // ignore resolution exception\n log(`Successfully validated '${filepath}'`)\n return true\n }\n error(`Error parsing '${filepath}'`)\n errorHandler(err)\n return false\n }\n}\n\nconst parseDtdl = (json: unknown[], parserModule: Parser): DtdlObjectModel | null => {\n try {\n const model = JSON.parse(parserModule.parse(JSON.stringify(json))) as DtdlObjectModel\n log(`Successfully parsed`)\n return model\n } catch (err) {\n error(`Error parsing`)\n errorHandler(err)\n return null\n }\n}\n\nexport const validateDirectories = (directory: string, parser: Parser, incResolutionException: boolean): boolean => {\n log(`${parser.parserVersion()}\\n`)\n log(`Validating DTDL at: '${directory}'`)\n\n const filepaths = searchForJsonFiles(directory)\n if (filepaths.length < 1) return false\n\n log(`Found ${filepaths.length} files:`)\n log(filepaths)\n\n for (const filepath of filepaths) {\n const isValid = validateFile(filepath, parser, incResolutionException)\n if (!isValid) return false // stop validating if error\n }\n\n log(`All files validated!\\n`)\n return true\n}\n\nexport const parseDirectories = (directory: string, parser: Parser): DtdlObjectModel | null => {\n log(`${parser.parserVersion()}\\n`)\n log(`Parsing DTDL at: '${directory}'`)\n\n const filepaths = searchForJsonFiles(directory)\n if (filepaths.length < 1) return null\n\n log(`Found ${filepaths.length} files:`)\n log(filepaths)\n\n const fullJson = combineJson(filepaths)\n if (fullJson === null) return null\n\n const fullModel = parseDtdl(fullJson, parser)\n if (fullModel === null) return null\n\n log(`All files parsed!\\n`)\n log(`Entities:`)\n log(Object.keys(fullModel))\n\n // Example type guard\n const interfaces: InterfaceInfo[] = Object.values(fullModel).filter(\n (value): value is InterfaceInfo => value.EntityKind === 'Interface'\n )\n log(`Number of interfaces: ${interfaces.length}`)\n\n return fullModel\n}\nexport { errorHandler, getInterop, isResolutionException }\n"],"names":["fs","path","errorHandler","isResolutionException","getInterop","log","error","console","searchForJsonFiles","directory","existsSync","readdirSync","map","file","join","reduce","jsonFiles","fullPath","statSync","isDirectory","concat","extname","readJsonFile","filepath","readFileSync","JSON","parse","err","combineJson","filepaths","combinedJson","json","push","validateFile","parserModule","incResolutionException","parseDtdl","model","stringify","validateDirectories","parser","parserVersion","length","parseDirectories","fullJson","fullModel","Object","keys","interfaces","values","filter","value","EntityKind"],"mappings":"AAAA,OAAOA,MAAQ,IAAI,AACnB,QAAOC,MAAU,MAAM,AAEvB,QAASC,gBAAAA,CAAY,CAAEC,yBAAAA,CAAqB,KAAQ,YAAY,AAChE,QAAiBC,cAAAA,CAAU,KAAQ,cAAc,CAEjD,GAAM,CAAEC,IAAAA,CAAG,CAAEC,MAAAA,CAAK,CAAE,CAAGC,OAEvB,QAAO,MAAMC,mBAAqB,AAACC,GACjC,AAAKT,EAAGU,UAAU,CAACD,GAKZT,EACJW,WAAW,CAACF,GACZG,GAAG,CAAC,AAACC,GAASZ,EAAKa,IAAI,CAACL,EAAWI,IACnCE,MAAM,CAAC,CAACC,EAAWC,IAClB,AAAIjB,EAAGkB,QAAQ,CAACD,GAAUE,WAAW,GAC5BH,EAAUI,MAAM,CAACZ,mBAAmBS,IAClChB,AAA2B,UAA3BA,EAAKoB,OAAO,CAACJ,GACfD,EAAUI,MAAM,CAACH,GAEnBD,EACN,EAAE,GAdLV,EAAM,CAAC,CAAC,EAAEG,EAAU,sBAAsB,CAAC,EACpC,EAAE,CAcZ,CAED,IAAMa,EAAe,AAACC,IACpB,GAAI,CACF,IAAMV,EAAOb,EAAGwB,YAAY,CAACD,EAAU,SAEvC,OADaE,KAAKC,KAAK,CAACb,EAE1B,CAAE,MAAOc,EAAK,CAGZ,OAFArB,EAAM,CAAC,iBAAiB,EAAEiB,EAAS,CAAC,CAAC,EACrCjB,EAAMqB,GACC,IACT,CACF,EAEMC,EAAc,AAACC,IACnB,IAAMC,EAA0B,EAAE,CAElC,IAAK,IAAMP,KAAYM,EAAW,CAChC,IAAME,EAAOT,EAAaC,GAC1B,GAAIQ,AAAS,OAATA,EACF,OAAO,KAETD,EAAaE,IAAI,CAACD,EACpB,CAEA,OAAOD,CACT,EAEMG,EAAe,CAACV,EAAkBW,EAAsBC,KAC5D,GAAI,CACF,IAAMtB,EAAOb,EAAGwB,YAAY,CAACD,EAAU,SAGvC,OAFAW,EAAaR,KAAK,CAACb,GACnBR,EAAI,CAAC,wBAAwB,EAAEkB,EAAS,CAAC,CAAC,EACnC,CAAA,CACT,CAAE,MAAOI,EAAK,CACZ,GAAI,CAACQ,GAA0BhC,EAAsBwB,GAGnD,OADAtB,EAAI,CAAC,wBAAwB,EAAEkB,EAAS,CAAC,CAAC,EACnC,CAAA,EAIT,OAFAjB,EAAM,CAAC,eAAe,EAAEiB,EAAS,CAAC,CAAC,EACnCrB,EAAayB,GACN,CAAA,CACT,CACF,EAEMS,EAAY,CAACL,EAAiBG,KAClC,GAAI,CACF,IAAMG,EAAQZ,KAAKC,KAAK,CAACQ,EAAaR,KAAK,CAACD,KAAKa,SAAS,CAACP,KAE3D,OADA1B,EAAI,uBACGgC,CACT,CAAE,MAAOV,EAAK,CAGZ,OAFArB,EAAM,iBACNJ,EAAayB,GACN,IACT,CACF,CAEA,QAAO,MAAMY,oBAAsB,CAAC9B,EAAmB+B,EAAgBL,KACrE9B,EAAI,CAAC,EAAEmC,EAAOC,aAAa;AAAK,CAAC,EACjCpC,EAAI,CAAC,qBAAqB,EAAEI,EAAU,CAAC,CAAC,EAExC,IAAMoB,EAAYrB,mBAAmBC,GACrC,GAAIoB,EAAUa,MAAM,CAAG,EAAG,MAAO,CAAA,EAKjC,IAAK,IAAMnB,KAHXlB,EAAI,CAAC,MAAM,EAAEwB,EAAUa,MAAM,CAAC,OAAO,CAAC,EACtCrC,EAAIwB,GAEmBA,GAErB,GAAI,CADYI,EAAaV,EAAUiB,EAAQL,GACjC,MAAO,CAAA,EAIvB,OADA9B,EAAI,CAAC;AAAsB,CAAC,EACrB,CAAA,CACT,CAAC,AAED,QAAO,MAAMsC,iBAAmB,CAAClC,EAAmB+B,KAClDnC,EAAI,CAAC,EAAEmC,EAAOC,aAAa;AAAK,CAAC,EACjCpC,EAAI,CAAC,kBAAkB,EAAEI,EAAU,CAAC,CAAC,EAErC,IAAMoB,EAAYrB,mBAAmBC,GACrC,GAAIoB,EAAUa,MAAM,CAAG,EAAG,OAAO,KAEjCrC,EAAI,CAAC,MAAM,EAAEwB,EAAUa,MAAM,CAAC,OAAO,CAAC,EACtCrC,EAAIwB,GAEJ,IAAMe,EAAWhB,EAAYC,GAC7B,GAAIe,AAAa,OAAbA,EAAmB,OAAO,KAE9B,IAAMC,EAAYT,EAAUQ,EAAUJ,GACtC,GAAIK,AAAc,OAAdA,EAAoB,OAAO,KAE/BxC,EAAI,CAAC;AAAmB,CAAC,EACzBA,EAAI,aACJA,EAAIyC,OAAOC,IAAI,CAACF,IAGhB,IAAMG,EAA8BF,OAAOG,MAAM,CAACJ,GAAWK,MAAM,CACjE,AAACC,GAAkCA,AAAqB,cAArBA,EAAMC,UAAU,EAIrD,OAFA/C,EAAI,CAAC,sBAAsB,EAAE2C,EAAWN,MAAM,CAAC,CAAC,EAEzCG,CACT,CAAC,QACQ3C,KAAAA,YAAY,CAAEE,KAAAA,UAAU,CAAED,KAAAA,qBAAqB"}
|
package/build/src/interop.js
DELETED
package/build/src/interop.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/interop.ts"],"sourcesContent":["export const getInterop = async (): Promise<Parser> => {\n const module = await import('../interop/modelParser.js')\n return module as Parser\n}\n\nexport interface Parser {\n parse: (file: string) => string\n parserVersion: () => string\n}\n"],"names":["getInterop"],"mappings":"AAAA,OAAO,MAAMA,WAAa,SACT,MAAM,MAAM,CAAC,4BAE7B"}
|
|
File without changes
|
|
File without changes
|