netkitty 0.0.1
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/.eslintrc.json +53 -0
- package/.idea/codeStyles/Project.xml +18 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/inspectionProfiles/Project_Default.xml +10 -0
- package/.idea/modules.xml +8 -0
- package/.idea/netkitty.iml +13 -0
- package/.idea/vcs.xml +6 -0
- package/LICENSE +21 -0
- package/README.md +2 -0
- package/binding.gyp +5 -0
- package/build/NetKitty.d.ts +31 -0
- package/build/NetKitty.d.ts.map +1 -0
- package/build/NetKitty.js +33 -0
- package/build/errors/ActionNotFoundError.d.ts +5 -0
- package/build/errors/ActionNotFoundError.d.ts.map +1 -0
- package/build/errors/ActionNotFoundError.js +12 -0
- package/build/errors/CodecSchemaValidateError.d.ts +5 -0
- package/build/errors/CodecSchemaValidateError.d.ts.map +1 -0
- package/build/errors/CodecSchemaValidateError.js +12 -0
- package/build/errors/DeviceNotFoundError.d.ts +5 -0
- package/build/errors/DeviceNotFoundError.d.ts.map +1 -0
- package/build/errors/DeviceNotFoundError.js +12 -0
- package/build/errors/NoAvailableCodecError.d.ts +5 -0
- package/build/errors/NoAvailableCodecError.d.ts.map +1 -0
- package/build/errors/NoAvailableCodecError.js +12 -0
- package/build/errors/NpcapLoadError.d.ts +5 -0
- package/build/errors/NpcapLoadError.d.ts.map +1 -0
- package/build/errors/NpcapLoadError.js +12 -0
- package/build/errors/SocketDownError.d.ts +5 -0
- package/build/errors/SocketDownError.d.ts.map +1 -0
- package/build/errors/SocketDownError.js +12 -0
- package/build/errors/UnknownPipeMessageTypeError.d.ts +5 -0
- package/build/errors/UnknownPipeMessageTypeError.d.ts.map +1 -0
- package/build/errors/UnknownPipeMessageTypeError.js +12 -0
- package/build/errors/common/ErrorCode.d.ts +31 -0
- package/build/errors/common/ErrorCode.d.ts.map +1 -0
- package/build/errors/common/ErrorCode.js +33 -0
- package/build/lib/GeneratePipeAddress.d.ts +7 -0
- package/build/lib/GeneratePipeAddress.d.ts.map +1 -0
- package/build/lib/GeneratePipeAddress.js +23 -0
- package/build/lib/GetBinding.d.ts +2 -0
- package/build/lib/GetBinding.d.ts.map +1 -0
- package/build/lib/GetBinding.js +6 -0
- package/build/lib/GetCaptureTemporaryDirectory.d.ts +7 -0
- package/build/lib/GetCaptureTemporaryDirectory.d.ts.map +1 -0
- package/build/lib/GetCaptureTemporaryDirectory.js +15 -0
- package/build/lib/GetDeviceCaptureTemporaryFilename.d.ts +8 -0
- package/build/lib/GetDeviceCaptureTemporaryFilename.d.ts.map +1 -0
- package/build/lib/GetDeviceCaptureTemporaryFilename.js +18 -0
- package/build/lib/codec/Codec.d.ts +33 -0
- package/build/lib/codec/Codec.d.ts.map +1 -0
- package/build/lib/codec/Codec.js +166 -0
- package/build/lib/codec/abstracts/BaseHeader.d.ts +204 -0
- package/build/lib/codec/abstracts/BaseHeader.d.ts.map +1 -0
- package/build/lib/codec/abstracts/BaseHeader.js +339 -0
- package/build/lib/codec/headers/ARP.d.ts +9 -0
- package/build/lib/codec/headers/ARP.d.ts.map +1 -0
- package/build/lib/codec/headers/ARP.js +223 -0
- package/build/lib/codec/headers/EthernetII.d.ts +9 -0
- package/build/lib/codec/headers/EthernetII.d.ts.map +1 -0
- package/build/lib/codec/headers/EthernetII.js +80 -0
- package/build/lib/codec/headers/Goose.d.ts +12 -0
- package/build/lib/codec/headers/Goose.d.ts.map +1 -0
- package/build/lib/codec/headers/Goose.js +701 -0
- package/build/lib/codec/headers/IEC61850SampledValues.d.ts +12 -0
- package/build/lib/codec/headers/IEC61850SampledValues.d.ts.map +1 -0
- package/build/lib/codec/headers/IEC61850SampledValues.js +369 -0
- package/build/lib/codec/headers/IPv4.d.ts +15 -0
- package/build/lib/codec/headers/IPv4.d.ts.map +1 -0
- package/build/lib/codec/headers/IPv4.js +338 -0
- package/build/lib/codec/headers/RawData.d.ts +9 -0
- package/build/lib/codec/headers/RawData.d.ts.map +1 -0
- package/build/lib/codec/headers/RawData.js +34 -0
- package/build/lib/codec/headers/TCP.d.ts +15 -0
- package/build/lib/codec/headers/TCP.d.ts.map +1 -0
- package/build/lib/codec/headers/TCP.js +897 -0
- package/build/lib/codec/headers/UDP.d.ts +15 -0
- package/build/lib/codec/headers/UDP.d.ts.map +1 -0
- package/build/lib/codec/headers/UDP.js +191 -0
- package/build/lib/codec/headers/VLAN_802dot1Q.d.ts +9 -0
- package/build/lib/codec/headers/VLAN_802dot1Q.d.ts.map +1 -0
- package/build/lib/codec/headers/VLAN_802dot1Q.js +77 -0
- package/build/lib/codec/lib/BufferToHex.d.ts +2 -0
- package/build/lib/codec/lib/BufferToHex.d.ts.map +1 -0
- package/build/lib/codec/lib/BufferToHex.js +6 -0
- package/build/lib/codec/lib/BufferToIP.d.ts +13 -0
- package/build/lib/codec/lib/BufferToIP.d.ts.map +1 -0
- package/build/lib/codec/lib/BufferToIP.js +21 -0
- package/build/lib/codec/lib/BufferToNumber.d.ts +10 -0
- package/build/lib/codec/lib/BufferToNumber.d.ts.map +1 -0
- package/build/lib/codec/lib/BufferToNumber.js +22 -0
- package/build/lib/codec/lib/FixHexString.d.ts +7 -0
- package/build/lib/codec/lib/FixHexString.d.ts.map +1 -0
- package/build/lib/codec/lib/FixHexString.js +11 -0
- package/build/lib/codec/lib/FlexibleObject.d.ts +28 -0
- package/build/lib/codec/lib/FlexibleObject.d.ts.map +1 -0
- package/build/lib/codec/lib/FlexibleObject.js +102 -0
- package/build/lib/codec/lib/HexToNumber.d.ts +10 -0
- package/build/lib/codec/lib/HexToNumber.d.ts.map +1 -0
- package/build/lib/codec/lib/HexToNumber.js +39 -0
- package/build/lib/codec/lib/IPToBuffer.d.ts +13 -0
- package/build/lib/codec/lib/IPToBuffer.d.ts.map +1 -0
- package/build/lib/codec/lib/IPToBuffer.js +28 -0
- package/build/lib/codec/lib/NumberToBERBuffer.d.ts +9 -0
- package/build/lib/codec/lib/NumberToBERBuffer.d.ts.map +1 -0
- package/build/lib/codec/lib/NumberToBERBuffer.js +20 -0
- package/build/lib/codec/lib/NumberToBERHex.d.ts +9 -0
- package/build/lib/codec/lib/NumberToBERHex.d.ts.map +1 -0
- package/build/lib/codec/lib/NumberToBERHex.js +23 -0
- package/build/lib/codec/lib/NumberToBuffer.d.ts +10 -0
- package/build/lib/codec/lib/NumberToBuffer.d.ts.map +1 -0
- package/build/lib/codec/lib/NumberToBuffer.js +22 -0
- package/build/lib/codec/lib/NumberToHex.d.ts +10 -0
- package/build/lib/codec/lib/NumberToHex.d.ts.map +1 -0
- package/build/lib/codec/lib/NumberToHex.js +26 -0
- package/build/lib/codec/lib/ProcessPacketPostHandlers.d.ts +14 -0
- package/build/lib/codec/lib/ProcessPacketPostHandlers.d.ts.map +1 -0
- package/build/lib/codec/lib/ProcessPacketPostHandlers.js +53 -0
- package/build/lib/codec/lib/SortPostHandlers.d.ts +8 -0
- package/build/lib/codec/lib/SortPostHandlers.d.ts.map +1 -0
- package/build/lib/codec/lib/SortPostHandlers.js +11 -0
- package/build/lib/codec/lib/StringContentEncodingEnum.d.ts +8 -0
- package/build/lib/codec/lib/StringContentEncodingEnum.d.ts.map +1 -0
- package/build/lib/codec/lib/StringContentEncodingEnum.js +11 -0
- package/build/lib/codec/types/CodecData.d.ts +7 -0
- package/build/lib/codec/types/CodecData.d.ts.map +1 -0
- package/build/lib/codec/types/CodecData.js +2 -0
- package/build/lib/codec/types/CodecDecodeResult.d.ts +9 -0
- package/build/lib/codec/types/CodecDecodeResult.d.ts.map +1 -0
- package/build/lib/codec/types/CodecDecodeResult.js +2 -0
- package/build/lib/codec/types/CodecEncodeInput.d.ts +5 -0
- package/build/lib/codec/types/CodecEncodeInput.d.ts.map +1 -0
- package/build/lib/codec/types/CodecEncodeInput.js +2 -0
- package/build/lib/codec/types/CodecEncodeResult.d.ts +6 -0
- package/build/lib/codec/types/CodecEncodeResult.d.ts.map +1 -0
- package/build/lib/codec/types/CodecEncodeResult.js +2 -0
- package/build/lib/codec/types/CodecErrorInfo.d.ts +6 -0
- package/build/lib/codec/types/CodecErrorInfo.d.ts.map +1 -0
- package/build/lib/codec/types/CodecErrorInfo.js +2 -0
- package/build/lib/codec/types/CodecModule.d.ts +3 -0
- package/build/lib/codec/types/CodecModule.d.ts.map +1 -0
- package/build/lib/codec/types/CodecModule.js +2 -0
- package/build/lib/codec/types/CodecModuleConstructor.d.ts +3 -0
- package/build/lib/codec/types/CodecModuleConstructor.d.ts.map +1 -0
- package/build/lib/codec/types/CodecModuleConstructor.js +2 -0
- package/build/lib/codec/types/CodecSchema.d.ts +7 -0
- package/build/lib/codec/types/CodecSchema.d.ts.map +1 -0
- package/build/lib/codec/types/CodecSchema.js +2 -0
- package/build/lib/codec/types/HeaderTreeNode.d.ts +5 -0
- package/build/lib/codec/types/HeaderTreeNode.d.ts.map +1 -0
- package/build/lib/codec/types/HeaderTreeNode.js +2 -0
- package/build/lib/codec/types/PostHandlerItem.d.ts +5 -0
- package/build/lib/codec/types/PostHandlerItem.d.ts.map +1 -0
- package/build/lib/codec/types/PostHandlerItem.js +2 -0
- package/build/lib/nodepcap/Capture.d.ts +75 -0
- package/build/lib/nodepcap/Capture.d.ts.map +1 -0
- package/build/lib/nodepcap/Capture.js +309 -0
- package/build/lib/nodepcap/GetNetworkInterfaces.d.ts +7 -0
- package/build/lib/nodepcap/GetNetworkInterfaces.d.ts.map +1 -0
- package/build/lib/nodepcap/GetNetworkInterfaces.js +22 -0
- package/build/lib/nodepcap/interfaces/IBindingCapture.d.ts +16 -0
- package/build/lib/nodepcap/interfaces/IBindingCapture.d.ts.map +1 -0
- package/build/lib/nodepcap/interfaces/IBindingCapture.js +2 -0
- package/build/lib/nodepcap/interfaces/IBindingCaptureOptions.d.ts +5 -0
- package/build/lib/nodepcap/interfaces/IBindingCaptureOptions.d.ts.map +1 -0
- package/build/lib/nodepcap/interfaces/IBindingCaptureOptions.js +2 -0
- package/build/lib/nodepcap/interfaces/ICaptureOptions.d.ts +19 -0
- package/build/lib/nodepcap/interfaces/ICaptureOptions.d.ts.map +1 -0
- package/build/lib/nodepcap/interfaces/ICaptureOptions.js +2 -0
- package/build/lib/nodepcap/interfaces/INetworkInterface.d.ts +5 -0
- package/build/lib/nodepcap/interfaces/INetworkInterface.d.ts.map +1 -0
- package/build/lib/nodepcap/interfaces/INetworkInterface.js +2 -0
- package/build/lib/nodepcap/lib/BindingCapture.d.ts +15 -0
- package/build/lib/nodepcap/lib/BindingCapture.d.ts.map +1 -0
- package/build/lib/nodepcap/lib/BindingCapture.js +35 -0
- package/build/lib/nodepcap/lib/GetNodePcapBinding.d.ts +2 -0
- package/build/lib/nodepcap/lib/GetNodePcapBinding.d.ts.map +1 -0
- package/build/lib/nodepcap/lib/GetNodePcapBinding.js +55 -0
- package/build/lib/nodepcap/lib/GetNodePcapBindingCapture.d.ts +3 -0
- package/build/lib/nodepcap/lib/GetNodePcapBindingCapture.d.ts.map +1 -0
- package/build/lib/nodepcap/lib/GetNodePcapBindingCapture.js +18 -0
- package/build/lib/nodepcap/workers/CaptureWorker.d.ts +2 -0
- package/build/lib/nodepcap/workers/CaptureWorker.d.ts.map +1 -0
- package/build/lib/nodepcap/workers/CaptureWorker.js +25 -0
- package/build/lib/pcap/PCAPGenerator.d.ts +34 -0
- package/build/lib/pcap/PCAPGenerator.d.ts.map +1 -0
- package/build/lib/pcap/PCAPGenerator.js +95 -0
- package/build/lib/pcap/PcapParser.d.ts +27 -0
- package/build/lib/pcap/PcapParser.d.ts.map +1 -0
- package/build/lib/pcap/PcapParser.js +149 -0
- package/build/lib/pcap/PcapReader.d.ts +87 -0
- package/build/lib/pcap/PcapReader.d.ts.map +1 -0
- package/build/lib/pcap/PcapReader.js +207 -0
- package/build/lib/pcap/PcapWriter.d.ts +29 -0
- package/build/lib/pcap/PcapWriter.d.ts.map +1 -0
- package/build/lib/pcap/PcapWriter.js +80 -0
- package/build/lib/pcap/interfaces/IPcapPacketInfo.d.ts +13 -0
- package/build/lib/pcap/interfaces/IPcapPacketInfo.d.ts.map +1 -0
- package/build/lib/pcap/interfaces/IPcapPacketInfo.js +2 -0
- package/build/lib/pipe/PipeClient.d.ts +35 -0
- package/build/lib/pipe/PipeClient.d.ts.map +1 -0
- package/build/lib/pipe/PipeClient.js +71 -0
- package/build/lib/pipe/PipeClientSocket.d.ts +39 -0
- package/build/lib/pipe/PipeClientSocket.d.ts.map +1 -0
- package/build/lib/pipe/PipeClientSocket.js +82 -0
- package/build/lib/pipe/PipeMessage.d.ts +27 -0
- package/build/lib/pipe/PipeMessage.d.ts.map +1 -0
- package/build/lib/pipe/PipeMessage.js +61 -0
- package/build/lib/pipe/PipeMessageHandler.d.ts +16 -0
- package/build/lib/pipe/PipeMessageHandler.d.ts.map +1 -0
- package/build/lib/pipe/PipeMessageHandler.js +95 -0
- package/build/lib/pipe/PipeServer.d.ts +25 -0
- package/build/lib/pipe/PipeServer.d.ts.map +1 -0
- package/build/lib/pipe/PipeServer.js +59 -0
- package/build/lib/schema/ProtocolFieldJSONSchema.d.ts +35 -0
- package/build/lib/schema/ProtocolFieldJSONSchema.d.ts.map +1 -0
- package/build/lib/schema/ProtocolFieldJSONSchema.js +2 -0
- package/build/lib/schema/ProtocolFieldJSONSchemaDefinition.d.ts +3 -0
- package/build/lib/schema/ProtocolFieldJSONSchemaDefinition.d.ts.map +1 -0
- package/build/lib/schema/ProtocolFieldJSONSchemaDefinition.js +2 -0
- package/build/lib/schema/ProtocolJSONSchema.d.ts +32 -0
- package/build/lib/schema/ProtocolJSONSchema.d.ts.map +1 -0
- package/build/lib/schema/ProtocolJSONSchema.js +2 -0
- package/build/tests/Test.spec.d.ts +2 -0
- package/build/tests/Test.spec.d.ts.map +1 -0
- package/build/tests/Test.spec.js +25 -0
- package/build/tests/units/CaptureTest.spec.d.ts +2 -0
- package/build/tests/units/CaptureTest.spec.d.ts.map +1 -0
- package/build/tests/units/CaptureTest.spec.js +31 -0
- package/build/tests/units/Codec.spec.d.ts +2 -0
- package/build/tests/units/Codec.spec.d.ts.map +1 -0
- package/build/tests/units/Codec.spec.js +70 -0
- package/cpp/nodepcap/deps/include/Packet32.h +429 -0
- package/cpp/nodepcap/deps/include/pcap/bluetooth.h +56 -0
- package/cpp/nodepcap/deps/include/pcap/bpf.h +292 -0
- package/cpp/nodepcap/deps/include/pcap/can_socketcan.h +56 -0
- package/cpp/nodepcap/deps/include/pcap/compiler-tests.h +163 -0
- package/cpp/nodepcap/deps/include/pcap/dlt.h +1514 -0
- package/cpp/nodepcap/deps/include/pcap/funcattrs.h +325 -0
- package/cpp/nodepcap/deps/include/pcap/ipnet.h +43 -0
- package/cpp/nodepcap/deps/include/pcap/namedb.h +84 -0
- package/cpp/nodepcap/deps/include/pcap/nflog.h +94 -0
- package/cpp/nodepcap/deps/include/pcap/pcap-inttypes.h +101 -0
- package/cpp/nodepcap/deps/include/pcap/pcap.h +1219 -0
- package/cpp/nodepcap/deps/include/pcap/sll.h +149 -0
- package/cpp/nodepcap/deps/include/pcap/socket.h +84 -0
- package/cpp/nodepcap/deps/include/pcap/usb.h +143 -0
- package/cpp/nodepcap/deps/include/pcap/vlan.h +46 -0
- package/cpp/nodepcap/deps/include/pcap-bpf.h +45 -0
- package/cpp/nodepcap/deps/include/pcap-namedb.h +40 -0
- package/cpp/nodepcap/deps/include/pcap.h +43 -0
- package/cpp/nodepcap/deps/lib/ARM64/Packet.lib +0 -0
- package/cpp/nodepcap/deps/lib/Packet.lib +0 -0
- package/cpp/nodepcap/deps/lib/wpcap.lib +0 -0
- package/cpp/nodepcap/deps/lib/x64/Packet.lib +0 -0
- package/cpp/nodepcap/deps/lib/x64/wpcap.lib +0 -0
- package/cpp/nodepcap/nodepcap.gypi +104 -0
- package/cpp/nodepcap/src/binding.cc +14 -0
- package/cpp/nodepcap/src/capture.cc +400 -0
- package/cpp/nodepcap/src/capture.h +53 -0
- package/cpp/nodepcap/src/utils.cc +218 -0
- package/cpp/nodepcap/src/utils.h +13 -0
- package/package.json +65 -0
- package/src/NetKitty.ts +31 -0
- package/src/errors/ActionNotFoundError.ts +6 -0
- package/src/errors/CodecSchemaValidateError.ts +6 -0
- package/src/errors/DeviceNotFoundError.ts +6 -0
- package/src/errors/NoAvailableCodecError.ts +6 -0
- package/src/errors/NpcapLoadError.ts +6 -0
- package/src/errors/SocketDownError.ts +6 -0
- package/src/errors/UnknownPipeMessageTypeError.ts +6 -0
- package/src/errors/common/ErrorCode.ts +30 -0
- package/src/lib/GeneratePipeAddress.ts +17 -0
- package/src/lib/GetBinding.ts +3 -0
- package/src/lib/GetCaptureTemporaryDirectory.ts +12 -0
- package/src/lib/GetDeviceCaptureTemporaryFilename.ts +13 -0
- package/src/lib/codec/Codec.ts +181 -0
- package/src/lib/codec/abstracts/BaseHeader.ts +413 -0
- package/src/lib/codec/headers/ARP.ts +218 -0
- package/src/lib/codec/headers/EthernetII.ts +77 -0
- package/src/lib/codec/headers/Goose.ts +658 -0
- package/src/lib/codec/headers/IEC61850SampledValues.ts +359 -0
- package/src/lib/codec/headers/IPv4.ts +329 -0
- package/src/lib/codec/headers/RawData.ts +34 -0
- package/src/lib/codec/headers/TCP.ts +931 -0
- package/src/lib/codec/headers/UDP.ts +180 -0
- package/src/lib/codec/headers/VLAN_802dot1Q.ts +74 -0
- package/src/lib/codec/lib/BufferToHex.ts +3 -0
- package/src/lib/codec/lib/BufferToIP.ts +19 -0
- package/src/lib/codec/lib/BufferToNumber.ts +31 -0
- package/src/lib/codec/lib/FixHexString.ts +8 -0
- package/src/lib/codec/lib/FlexibleObject.ts +100 -0
- package/src/lib/codec/lib/HexToNumber.ts +25 -0
- package/src/lib/codec/lib/IPToBuffer.ts +25 -0
- package/src/lib/codec/lib/NumberToBERBuffer.ts +19 -0
- package/src/lib/codec/lib/NumberToBERHex.ts +13 -0
- package/src/lib/codec/lib/NumberToBuffer.ts +21 -0
- package/src/lib/codec/lib/NumberToHex.ts +15 -0
- package/src/lib/codec/lib/ProcessPacketPostHandlers.ts +53 -0
- package/src/lib/codec/lib/SortPostHandlers.ts +10 -0
- package/src/lib/codec/lib/StringContentEncodingEnum.ts +7 -0
- package/src/lib/codec/types/CodecData.ts +7 -0
- package/src/lib/codec/types/CodecDecodeResult.ts +9 -0
- package/src/lib/codec/types/CodecEncodeInput.ts +5 -0
- package/src/lib/codec/types/CodecEncodeResult.ts +6 -0
- package/src/lib/codec/types/CodecErrorInfo.ts +5 -0
- package/src/lib/codec/types/CodecModule.ts +3 -0
- package/src/lib/codec/types/CodecModuleConstructor.ts +3 -0
- package/src/lib/codec/types/CodecSchema.ts +7 -0
- package/src/lib/codec/types/HeaderTreeNode.ts +5 -0
- package/src/lib/codec/types/PostHandlerItem.ts +4 -0
- package/src/lib/nodepcap/Capture.ts +291 -0
- package/src/lib/nodepcap/GetNetworkInterfaces.ts +18 -0
- package/src/lib/nodepcap/interfaces/IBindingCapture.ts +27 -0
- package/src/lib/nodepcap/interfaces/IBindingCaptureOptions.ts +4 -0
- package/src/lib/nodepcap/interfaces/ICaptureOptions.ts +19 -0
- package/src/lib/nodepcap/interfaces/INetworkInterface.ts +4 -0
- package/src/lib/nodepcap/lib/BindingCapture.ts +46 -0
- package/src/lib/nodepcap/lib/GetNodePcapBinding.ts +17 -0
- package/src/lib/nodepcap/lib/GetNodePcapBindingCapture.ts +15 -0
- package/src/lib/nodepcap/workers/CaptureWorker.ts +30 -0
- package/src/lib/pcap/PCAPGenerator.ts +118 -0
- package/src/lib/pcap/PcapParser.ts +170 -0
- package/src/lib/pcap/PcapReader.ts +239 -0
- package/src/lib/pcap/PcapWriter.ts +93 -0
- package/src/lib/pcap/interfaces/IPcapPacketInfo.ts +12 -0
- package/src/lib/pipe/PipeClient.ts +91 -0
- package/src/lib/pipe/PipeClientSocket.ts +99 -0
- package/src/lib/pipe/PipeMessage.ts +74 -0
- package/src/lib/pipe/PipeMessageHandler.ts +91 -0
- package/src/lib/pipe/PipeServer.ts +74 -0
- package/src/lib/schema/ProtocolFieldJSONSchema.ts +45 -0
- package/src/lib/schema/ProtocolFieldJSONSchemaDefinition.ts +3 -0
- package/src/lib/schema/ProtocolJSONSchema.ts +37 -0
- package/src/tests/Test.spec.ts +22 -0
- package/src/tests/units/CaptureTest.spec.ts +30 -0
- package/src/tests/units/Codec.spec.ts +85 -0
- package/tsconfig.json +41 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IPcapPacketInfo {
|
|
2
|
+
index: number;
|
|
3
|
+
offset: number;
|
|
4
|
+
length: number;
|
|
5
|
+
recordHeaderOffset: number;
|
|
6
|
+
recordHeaderLength: number;
|
|
7
|
+
packetOffset: number;
|
|
8
|
+
packetLength: number;
|
|
9
|
+
seconds: number;
|
|
10
|
+
microseconds: number;
|
|
11
|
+
packet: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=IPcapPacketInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IPcapPacketInfo.d.ts","sourceRoot":"","sources":["../../../../src/lib/pcap/interfaces/IPcapPacketInfo.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB,EAAC,MAAM,CAAA;IACzB,kBAAkB,EAAC,MAAM,CAAA;IACzB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import EventEmitter from 'events';
|
|
2
|
+
import { MessageClient } from 'socket-ipc';
|
|
3
|
+
import { PipeMessageHandler } from './PipeMessageHandler';
|
|
4
|
+
export interface IPipeClientOptions {
|
|
5
|
+
id: string;
|
|
6
|
+
socketPath: string;
|
|
7
|
+
actions: Record<string, (...args: any[]) => Promise<any>>;
|
|
8
|
+
}
|
|
9
|
+
export declare class PipeClient extends EventEmitter {
|
|
10
|
+
#private;
|
|
11
|
+
protected readonly id: string;
|
|
12
|
+
protected readonly socketPath: string;
|
|
13
|
+
protected readonly client: MessageClient;
|
|
14
|
+
protected readonly pipeMessageHandler: PipeMessageHandler;
|
|
15
|
+
readonly actions: Record<string, (...args: any[]) => Promise<any>>;
|
|
16
|
+
get connected(): boolean;
|
|
17
|
+
constructor(options: IPipeClientOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Invoke server side action
|
|
20
|
+
* @param act
|
|
21
|
+
* @param args
|
|
22
|
+
*/
|
|
23
|
+
invoke(act: string, ...args: any[]): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* Notify event to pipe server
|
|
26
|
+
* @param event
|
|
27
|
+
* @param args
|
|
28
|
+
*/
|
|
29
|
+
notify(event: string, ...args: any[]): void;
|
|
30
|
+
on(eventName: 'ready', listener: () => void): this;
|
|
31
|
+
on(eventName: string, listener: (...args: any) => void): this;
|
|
32
|
+
once(eventName: 'ready', listener: () => void): this;
|
|
33
|
+
once(eventName: string, listener: (...args: any) => void): this;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=PipeClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipeClient.d.ts","sourceRoot":"","sources":["../../../src/lib/pipe/PipeClient.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAA;AAExC,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAGvD,MAAM,WAAW,kBAAkB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;CAC5D;AAED,qBAAa,UAAW,SAAQ,YAAY;;IAIxC,SAAS,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IAE7B,SAAS,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAErC,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAExC,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAA;IAEzD,SAAgB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAK;IAE9E,IAAW,SAAS,IAAI,OAAO,CAE9B;gBAEW,OAAO,EAAE,kBAAkB;IAevC;;;;OAIG;IACU,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAc9D;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAO3C,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAClD,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAM7D,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IACpD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAMzE"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PipeClient = void 0;
|
|
7
|
+
const events_1 = __importDefault(require("events"));
|
|
8
|
+
const socket_ipc_1 = require("socket-ipc");
|
|
9
|
+
const PipeMessage_1 = require("./PipeMessage");
|
|
10
|
+
const PipeMessageHandler_1 = require("./PipeMessageHandler");
|
|
11
|
+
const SocketDownError_1 = require("../../errors/SocketDownError");
|
|
12
|
+
class PipeClient extends events_1.default {
|
|
13
|
+
#connected;
|
|
14
|
+
get connected() {
|
|
15
|
+
return this.#connected;
|
|
16
|
+
}
|
|
17
|
+
constructor(options) {
|
|
18
|
+
super();
|
|
19
|
+
this.actions = {};
|
|
20
|
+
this.id = options.id;
|
|
21
|
+
this.socketPath = options.socketPath;
|
|
22
|
+
this.actions = options.actions;
|
|
23
|
+
this.#connected = true;
|
|
24
|
+
this.client = new socket_ipc_1.MessageClient({ path: this.socketPath });
|
|
25
|
+
this.pipeMessageHandler = new PipeMessageHandler_1.PipeMessageHandler(this, this.client);
|
|
26
|
+
this.client.on('close', () => this.#connected = false);
|
|
27
|
+
this.client.start().then(() => {
|
|
28
|
+
this.client.send(Buffer.from(this.id).toString('base64'));
|
|
29
|
+
this.emit('ready');
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Invoke server side action
|
|
34
|
+
* @param act
|
|
35
|
+
* @param args
|
|
36
|
+
*/
|
|
37
|
+
async invoke(act, ...args) {
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
39
|
+
const pipeMessage = new PipeMessage_1.PipeMessage();
|
|
40
|
+
pipeMessage.type = PipeMessage_1.PipeMessageType.REQUEST;
|
|
41
|
+
pipeMessage.payload = [act, ...args];
|
|
42
|
+
this.once(pipeMessage.messageId, (resultOrError) => resultOrError instanceof Error ? reject(resultOrError) : resolve(resultOrError));
|
|
43
|
+
if (!this.connected) {
|
|
44
|
+
this.removeAllListeners(pipeMessage.messageId);
|
|
45
|
+
return reject(new SocketDownError_1.SocketDownError('Socket is down'));
|
|
46
|
+
}
|
|
47
|
+
this.client.send(pipeMessage.serialize());
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Notify event to pipe server
|
|
52
|
+
* @param event
|
|
53
|
+
* @param args
|
|
54
|
+
*/
|
|
55
|
+
notify(event, ...args) {
|
|
56
|
+
const pipeMessage = new PipeMessage_1.PipeMessage();
|
|
57
|
+
pipeMessage.type = PipeMessage_1.PipeMessageType.EVENT;
|
|
58
|
+
pipeMessage.payload = [event, ...args];
|
|
59
|
+
if (this.connected)
|
|
60
|
+
this.client.send(pipeMessage.serialize());
|
|
61
|
+
}
|
|
62
|
+
on(eventName, listener) {
|
|
63
|
+
super.on(eventName, listener);
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
once(eventName, listener) {
|
|
67
|
+
super.once(eventName, listener);
|
|
68
|
+
return this;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.PipeClient = PipeClient;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import EventEmitter from 'events';
|
|
2
|
+
import { MessageConnection } from 'socket-ipc';
|
|
3
|
+
import { PipeMessageHandler } from './PipeMessageHandler';
|
|
4
|
+
export interface IPipeClientSocketOptions {
|
|
5
|
+
id: string;
|
|
6
|
+
connection: MessageConnection;
|
|
7
|
+
actions: Record<string, (...args: any[]) => Promise<any>>;
|
|
8
|
+
}
|
|
9
|
+
export declare class PipeClientSocket extends EventEmitter {
|
|
10
|
+
#private;
|
|
11
|
+
protected readonly pipeMessageHandler: PipeMessageHandler;
|
|
12
|
+
readonly actions: Record<string, (...args: any[]) => Promise<any>>;
|
|
13
|
+
/**
|
|
14
|
+
* ClientId
|
|
15
|
+
*/
|
|
16
|
+
get id(): string;
|
|
17
|
+
/**
|
|
18
|
+
* Is client socket connected
|
|
19
|
+
*/
|
|
20
|
+
get connected(): boolean;
|
|
21
|
+
constructor(options: IPipeClientSocketOptions);
|
|
22
|
+
/**
|
|
23
|
+
* Invoke client side action
|
|
24
|
+
* @param act
|
|
25
|
+
* @param args
|
|
26
|
+
*/
|
|
27
|
+
invoke(act: string, ...args: any[]): Promise<any>;
|
|
28
|
+
/**
|
|
29
|
+
* Notify event to pipe client
|
|
30
|
+
* @param event
|
|
31
|
+
* @param args
|
|
32
|
+
*/
|
|
33
|
+
notify(event: string, ...args: any[]): void;
|
|
34
|
+
on(eventName: 'disconnect', listener: () => void): this;
|
|
35
|
+
on(eventName: string, listener: (...args: any) => void): this;
|
|
36
|
+
once(eventName: 'disconnect', listener: () => void): this;
|
|
37
|
+
once(eventName: string, listener: (...args: any) => void): this;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=PipeClientSocket.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipeClientSocket.d.ts","sourceRoot":"","sources":["../../../src/lib/pipe/PipeClientSocket.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAC,iBAAiB,EAAC,MAAM,YAAY,CAAA;AAE5C,OAAO,EAAC,kBAAkB,EAAC,MAAM,sBAAsB,CAAA;AAGvD,MAAM,WAAW,wBAAwB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,UAAU,EAAE,iBAAiB,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;CAC5D;AAED,qBAAa,gBAAiB,SAAQ,YAAY;;IAQ9C,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE,kBAAkB,CAAA;IAEzD,SAAgB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAK;IAE9E;;OAEG;IACH,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,IAAW,SAAS,IAAI,OAAO,CAE9B;gBAEW,OAAO,EAAE,wBAAwB;IAgB7C;;;;OAIG;IACU,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAc9D;;;;OAIG;IACI,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAO3C,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IACvD,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAM7D,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IACzD,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAKzE"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PipeClientSocket = void 0;
|
|
7
|
+
const events_1 = __importDefault(require("events"));
|
|
8
|
+
const PipeMessage_1 = require("./PipeMessage");
|
|
9
|
+
const PipeMessageHandler_1 = require("./PipeMessageHandler");
|
|
10
|
+
const SocketDownError_1 = require("../../errors/SocketDownError");
|
|
11
|
+
class PipeClientSocket extends events_1.default {
|
|
12
|
+
#id;
|
|
13
|
+
#connection;
|
|
14
|
+
#connected;
|
|
15
|
+
/**
|
|
16
|
+
* ClientId
|
|
17
|
+
*/
|
|
18
|
+
get id() {
|
|
19
|
+
return this.#id;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Is client socket connected
|
|
23
|
+
*/
|
|
24
|
+
get connected() {
|
|
25
|
+
return this.#connected;
|
|
26
|
+
}
|
|
27
|
+
constructor(options) {
|
|
28
|
+
super();
|
|
29
|
+
this.actions = {};
|
|
30
|
+
this.#id = options.id;
|
|
31
|
+
this.#connection = options.connection;
|
|
32
|
+
this.actions = options.actions ? options.actions : {};
|
|
33
|
+
this.#connected = true;
|
|
34
|
+
this.#connection
|
|
35
|
+
.on('error', (err) => this.emit('error', err))
|
|
36
|
+
.once('close', () => {
|
|
37
|
+
this.#connected = false;
|
|
38
|
+
this.emit('disconnect');
|
|
39
|
+
this.removeAllListeners();
|
|
40
|
+
});
|
|
41
|
+
this.pipeMessageHandler = new PipeMessageHandler_1.PipeMessageHandler(this, this.#connection);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Invoke client side action
|
|
45
|
+
* @param act
|
|
46
|
+
* @param args
|
|
47
|
+
*/
|
|
48
|
+
async invoke(act, ...args) {
|
|
49
|
+
return new Promise((resolve, reject) => {
|
|
50
|
+
const pipeMessage = new PipeMessage_1.PipeMessage();
|
|
51
|
+
pipeMessage.type = PipeMessage_1.PipeMessageType.REQUEST;
|
|
52
|
+
pipeMessage.payload = [act, ...args];
|
|
53
|
+
this.once(pipeMessage.messageId, (resultOrError) => resultOrError instanceof Error ? reject(resultOrError) : resolve(resultOrError));
|
|
54
|
+
if (!this.connected) {
|
|
55
|
+
this.removeAllListeners(pipeMessage.messageId);
|
|
56
|
+
return reject(new SocketDownError_1.SocketDownError('Socket is down'));
|
|
57
|
+
}
|
|
58
|
+
this.#connection.send(pipeMessage.serialize());
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Notify event to pipe client
|
|
63
|
+
* @param event
|
|
64
|
+
* @param args
|
|
65
|
+
*/
|
|
66
|
+
notify(event, ...args) {
|
|
67
|
+
const pipeMessage = new PipeMessage_1.PipeMessage();
|
|
68
|
+
pipeMessage.type = PipeMessage_1.PipeMessageType.EVENT;
|
|
69
|
+
pipeMessage.payload = [event, ...args];
|
|
70
|
+
if (this.connected)
|
|
71
|
+
this.#connection.send(pipeMessage.serialize());
|
|
72
|
+
}
|
|
73
|
+
on(eventName, listener) {
|
|
74
|
+
super.on(eventName, listener);
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
once(eventName, listener) {
|
|
78
|
+
super.once(eventName, listener);
|
|
79
|
+
return this;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.PipeClientSocket = PipeClientSocket;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum PipeMessageType {
|
|
2
|
+
EVENT = 0,
|
|
3
|
+
REQUEST = 1,
|
|
4
|
+
RESPONSE_OK = 2,
|
|
5
|
+
RESPONSE_ERR = 3
|
|
6
|
+
}
|
|
7
|
+
export interface IPipeMessage {
|
|
8
|
+
messageId: string;
|
|
9
|
+
type: PipeMessageType;
|
|
10
|
+
payload: any;
|
|
11
|
+
}
|
|
12
|
+
export declare class PipeMessage {
|
|
13
|
+
#private;
|
|
14
|
+
protected set structured(structured: IPipeMessage);
|
|
15
|
+
protected get structured(): IPipeMessage;
|
|
16
|
+
get messageId(): string;
|
|
17
|
+
set type(type: PipeMessageType);
|
|
18
|
+
get type(): PipeMessageType;
|
|
19
|
+
set payload(payload: any);
|
|
20
|
+
get payload(): any;
|
|
21
|
+
constructor(serialized?: string);
|
|
22
|
+
/**
|
|
23
|
+
* Serialized pipe message
|
|
24
|
+
*/
|
|
25
|
+
serialize(): string;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=PipeMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipeMessage.d.ts","sourceRoot":"","sources":["../../../src/lib/pipe/PipeMessage.ts"],"names":[],"mappings":"AAEA,oBAAY,eAAe;IACvB,KAAK,IAAA;IACL,OAAO,IAAA;IACP,WAAW,IAAA;IACX,YAAY,IAAA;CACf;AAED,MAAM,WAAW,YAAY;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,eAAe,CAAA;IACrB,OAAO,EAAE,GAAG,CAAA;CACf;AAED,qBAAa,WAAW;;IAMpB,SAAS,KAAK,UAAU,CAAC,UAAU,EAAE,YAAY,EAGhD;IAED,SAAS,KAAK,UAAU,IAAI,YAAY,CAEvC;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,IAAI,CAAC,IAAI,EAAE,eAAe,EAIpC;IAED,IAAW,IAAI,IAAI,eAAe,CAEjC;IAED,IAAW,OAAO,CAAC,OAAO,EAAE,GAAG,EAI9B;IAED,IAAW,OAAO,IAAI,GAAG,CAExB;gBAEW,UAAU,CAAC,EAAE,MAAM;IAa/B;;OAEG;IACI,SAAS,IAAI,MAAM;CAG7B"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PipeMessage = exports.PipeMessageType = void 0;
|
|
4
|
+
const node_crypto_1 = require("node:crypto");
|
|
5
|
+
var PipeMessageType;
|
|
6
|
+
(function (PipeMessageType) {
|
|
7
|
+
PipeMessageType[PipeMessageType["EVENT"] = 0] = "EVENT";
|
|
8
|
+
PipeMessageType[PipeMessageType["REQUEST"] = 1] = "REQUEST";
|
|
9
|
+
PipeMessageType[PipeMessageType["RESPONSE_OK"] = 2] = "RESPONSE_OK";
|
|
10
|
+
PipeMessageType[PipeMessageType["RESPONSE_ERR"] = 3] = "RESPONSE_ERR";
|
|
11
|
+
})(PipeMessageType || (exports.PipeMessageType = PipeMessageType = {}));
|
|
12
|
+
class PipeMessage {
|
|
13
|
+
#serialized;
|
|
14
|
+
#structured;
|
|
15
|
+
set structured(structured) {
|
|
16
|
+
this.#structured = structured;
|
|
17
|
+
this.#serialized = JSON.stringify(this.#structured);
|
|
18
|
+
}
|
|
19
|
+
get structured() {
|
|
20
|
+
return this.#structured;
|
|
21
|
+
}
|
|
22
|
+
get messageId() {
|
|
23
|
+
return this.structured.messageId;
|
|
24
|
+
}
|
|
25
|
+
set type(type) {
|
|
26
|
+
const structured = this.structured;
|
|
27
|
+
structured.type = type;
|
|
28
|
+
this.structured = structured;
|
|
29
|
+
}
|
|
30
|
+
get type() {
|
|
31
|
+
return this.structured.type;
|
|
32
|
+
}
|
|
33
|
+
set payload(payload) {
|
|
34
|
+
const structured = this.structured;
|
|
35
|
+
structured.payload = payload;
|
|
36
|
+
this.structured = structured;
|
|
37
|
+
}
|
|
38
|
+
get payload() {
|
|
39
|
+
return this.structured.payload;
|
|
40
|
+
}
|
|
41
|
+
constructor(serialized) {
|
|
42
|
+
if (serialized) {
|
|
43
|
+
this.#serialized = serialized;
|
|
44
|
+
this.#structured = JSON.parse(serialized);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.structured = {
|
|
48
|
+
messageId: `PIPE_MSG_${Date.now().toString(16)}${(0, node_crypto_1.randomInt)(10000000, 99999999)}`,
|
|
49
|
+
type: PipeMessageType.EVENT,
|
|
50
|
+
payload: null
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Serialized pipe message
|
|
56
|
+
*/
|
|
57
|
+
serialize() {
|
|
58
|
+
return this.#serialized;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.PipeMessage = PipeMessage;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { MessageClient, MessageConnection, MessageEvent } from 'socket-ipc';
|
|
2
|
+
import EventEmitter from 'events';
|
|
3
|
+
import { PipeClient } from './PipeClient';
|
|
4
|
+
import { PipeClientSocket } from './PipeClientSocket';
|
|
5
|
+
export declare class PipeMessageHandler extends EventEmitter {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(owner: PipeClient | PipeClientSocket, socket: MessageConnection);
|
|
8
|
+
constructor(owner: PipeClient | PipeClientSocket, socket: MessageClient);
|
|
9
|
+
/**
|
|
10
|
+
* On pipe message handler
|
|
11
|
+
* @param message
|
|
12
|
+
* @protected
|
|
13
|
+
*/
|
|
14
|
+
protected onMessageHandler(message: MessageEvent): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=PipeMessageHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipeMessageHandler.d.ts","sourceRoot":"","sources":["../../../src/lib/pipe/PipeMessageHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAC,MAAM,YAAY,CAAA;AAEzE,OAAO,YAAY,MAAM,QAAQ,CAAA;AACjC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAA;AACvC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAInD,qBAAa,kBAAmB,SAAQ,YAAY;;gBAMpC,KAAK,EAAE,UAAU,GAAG,gBAAgB,EAAE,MAAM,EAAE,iBAAiB;gBAC/D,KAAK,EAAE,UAAU,GAAG,gBAAgB,EAAE,MAAM,EAAE,aAAa;IAYvE;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;CA0D1D"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PipeMessageHandler = void 0;
|
|
7
|
+
const socket_ipc_1 = require("socket-ipc");
|
|
8
|
+
const PipeMessage_1 = require("./PipeMessage");
|
|
9
|
+
const events_1 = __importDefault(require("events"));
|
|
10
|
+
const UnknownPipeMessageTypeError_1 = require("../../errors/UnknownPipeMessageTypeError");
|
|
11
|
+
const ActionNotFoundError_1 = require("../../errors/ActionNotFoundError");
|
|
12
|
+
class PipeMessageHandler extends events_1.default {
|
|
13
|
+
#owner;
|
|
14
|
+
#socket;
|
|
15
|
+
constructor(owner, socket) {
|
|
16
|
+
super();
|
|
17
|
+
this.#owner = owner;
|
|
18
|
+
this.#socket = socket;
|
|
19
|
+
if (this.#socket instanceof socket_ipc_1.MessageConnection) {
|
|
20
|
+
this.#socket.on('message', (message) => this.onMessageHandler(message));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.#socket.on('message', (message) => this.onMessageHandler(message));
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* On pipe message handler
|
|
28
|
+
* @param message
|
|
29
|
+
* @protected
|
|
30
|
+
*/
|
|
31
|
+
onMessageHandler(message) {
|
|
32
|
+
const pipeMessage = new PipeMessage_1.PipeMessage(message.data);
|
|
33
|
+
switch (pipeMessage.type) {
|
|
34
|
+
case PipeMessage_1.PipeMessageType.EVENT:
|
|
35
|
+
{
|
|
36
|
+
const args = pipeMessage.payload;
|
|
37
|
+
const eventName = args.shift();
|
|
38
|
+
this.#owner.emit(eventName, ...args);
|
|
39
|
+
}
|
|
40
|
+
break;
|
|
41
|
+
case PipeMessage_1.PipeMessageType.REQUEST:
|
|
42
|
+
{
|
|
43
|
+
const args = pipeMessage.payload;
|
|
44
|
+
const actionName = args.shift();
|
|
45
|
+
const action = this.#owner.actions[actionName];
|
|
46
|
+
if (action) {
|
|
47
|
+
action.call(this.#owner, ...args)
|
|
48
|
+
.then(response => {
|
|
49
|
+
pipeMessage.type = PipeMessage_1.PipeMessageType.RESPONSE_OK;
|
|
50
|
+
pipeMessage.payload = response;
|
|
51
|
+
this.#socket.send(pipeMessage.serialize());
|
|
52
|
+
})
|
|
53
|
+
.catch((error) => {
|
|
54
|
+
pipeMessage.type = PipeMessage_1.PipeMessageType.RESPONSE_ERR;
|
|
55
|
+
pipeMessage.payload = {
|
|
56
|
+
message: error.message,
|
|
57
|
+
errno: error.errno,
|
|
58
|
+
code: error.code
|
|
59
|
+
};
|
|
60
|
+
this.#socket.send(pipeMessage.serialize());
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
pipeMessage.type = PipeMessage_1.PipeMessageType.RESPONSE_ERR;
|
|
65
|
+
const actionNotFoundError = new ActionNotFoundError_1.ActionNotFoundError(`Action ${actionName} not found`);
|
|
66
|
+
pipeMessage.payload = {
|
|
67
|
+
message: actionNotFoundError.message,
|
|
68
|
+
errno: actionNotFoundError.errno,
|
|
69
|
+
code: actionNotFoundError.code
|
|
70
|
+
};
|
|
71
|
+
this.#socket.send(pipeMessage.serialize());
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case PipeMessage_1.PipeMessageType.RESPONSE_OK:
|
|
76
|
+
{
|
|
77
|
+
this.#owner.emit(pipeMessage.messageId, pipeMessage.payload);
|
|
78
|
+
}
|
|
79
|
+
break;
|
|
80
|
+
case PipeMessage_1.PipeMessageType.RESPONSE_ERR:
|
|
81
|
+
{
|
|
82
|
+
const responseError = new Error();
|
|
83
|
+
responseError.message = pipeMessage.payload.message;
|
|
84
|
+
responseError.errno = pipeMessage.payload.errno;
|
|
85
|
+
responseError.code = pipeMessage.payload.code;
|
|
86
|
+
this.#owner.emit(pipeMessage.messageId, responseError);
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
default: {
|
|
90
|
+
this.#owner.emit('error', new UnknownPipeMessageTypeError_1.UnknownPipeMessageTypeError(`Unknown pipe message type ${pipeMessage.type}`));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.PipeMessageHandler = PipeMessageHandler;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import EventEmitter from 'events';
|
|
2
|
+
import { PipeClientSocket } from './PipeClientSocket';
|
|
3
|
+
export interface IPipeServerOptions {
|
|
4
|
+
actions?: Record<string, (...args: any[]) => Promise<any>>;
|
|
5
|
+
}
|
|
6
|
+
export declare class PipeServer extends EventEmitter {
|
|
7
|
+
#private;
|
|
8
|
+
protected readonly actions: Record<string, (...args: any[]) => Promise<any>>;
|
|
9
|
+
readonly socketPath: string;
|
|
10
|
+
get clients(): Map<string, PipeClientSocket>;
|
|
11
|
+
constructor(options?: IPipeServerOptions);
|
|
12
|
+
/**
|
|
13
|
+
* Dispose pipe server
|
|
14
|
+
*/
|
|
15
|
+
dispose(): void;
|
|
16
|
+
on(eventName: 'ready', listener: () => void): this;
|
|
17
|
+
on(eventName: 'connect', listener: (clientSocket: PipeClientSocket) => void): this;
|
|
18
|
+
on(eventName: 'disconnect', listener: (clientSocket: PipeClientSocket) => void): this;
|
|
19
|
+
on(eventName: string, listener: (...args: any) => void): this;
|
|
20
|
+
once(eventName: 'ready', listener: () => void): this;
|
|
21
|
+
once(eventName: 'connect', listener: (clientSocket: PipeClientSocket) => void): this;
|
|
22
|
+
once(eventName: 'disconnect', listener: (clientSocket: PipeClientSocket) => void): this;
|
|
23
|
+
once(eventName: string, listener: (...args: any) => void): this;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=PipeServer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PipeServer.d.ts","sourceRoot":"","sources":["../../../src/lib/pipe/PipeServer.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,QAAQ,CAAA;AAEjC,OAAO,EAAC,gBAAgB,EAAC,MAAM,oBAAoB,CAAA;AAEnD,MAAM,WAAW,kBAAkB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;CAC7D;AAED,qBAAa,UAAW,SAAQ,YAAY;;IAMxC,SAAS,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,CAAK;IAEjF,SAAgB,UAAU,EAAE,MAAM,CAAA;IAElC,IAAW,OAAO,IAAI,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAElD;gBAEW,OAAO,CAAC,EAAE,kBAAkB;IAyBxC;;OAEG;IACI,OAAO,IAAI,IAAI;IAKf,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAClD,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,KAAK,IAAI,GAAG,IAAI;IAClF,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,KAAK,IAAI,GAAG,IAAI;IACrF,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;IAM7D,IAAI,CAAC,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IACpD,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,KAAK,IAAI,GAAG,IAAI;IACpF,IAAI,CAAC,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,CAAC,YAAY,EAAE,gBAAgB,KAAK,IAAI,GAAG,IAAI;IACvF,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,IAAI,GAAG,IAAI;CAKzE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PipeServer = void 0;
|
|
7
|
+
const GeneratePipeAddress_1 = require("../GeneratePipeAddress");
|
|
8
|
+
const events_1 = __importDefault(require("events"));
|
|
9
|
+
const socket_ipc_1 = require("socket-ipc");
|
|
10
|
+
const PipeClientSocket_1 = require("./PipeClientSocket");
|
|
11
|
+
class PipeServer extends events_1.default {
|
|
12
|
+
#server;
|
|
13
|
+
#clientSocketMap;
|
|
14
|
+
get clients() {
|
|
15
|
+
return this.#clientSocketMap;
|
|
16
|
+
}
|
|
17
|
+
constructor(options) {
|
|
18
|
+
super();
|
|
19
|
+
this.#clientSocketMap = new Map();
|
|
20
|
+
this.actions = {};
|
|
21
|
+
this.actions = options?.actions ? options.actions : {};
|
|
22
|
+
this.socketPath = (0, GeneratePipeAddress_1.GeneratePipeAddress)();
|
|
23
|
+
this.#server = new socket_ipc_1.MessageServer({ path: this.socketPath });
|
|
24
|
+
this.#server.on('connection', (connection) => {
|
|
25
|
+
connection.once('message', (message) => {
|
|
26
|
+
const base64Id = message.data.toString();
|
|
27
|
+
const clientId = Buffer.from(base64Id, 'base64').toString();
|
|
28
|
+
const clientSocket = new PipeClientSocket_1.PipeClientSocket({
|
|
29
|
+
id: clientId,
|
|
30
|
+
connection: connection,
|
|
31
|
+
actions: this.actions
|
|
32
|
+
});
|
|
33
|
+
this.#clientSocketMap.set(clientId, clientSocket);
|
|
34
|
+
clientSocket.once('disconnect', () => {
|
|
35
|
+
this.#clientSocketMap.delete(clientSocket.id);
|
|
36
|
+
this.emit('disconnect', clientSocket);
|
|
37
|
+
});
|
|
38
|
+
this.emit('connect', clientSocket);
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
this.#server.start().then(() => this.emit('ready'));
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Dispose pipe server
|
|
45
|
+
*/
|
|
46
|
+
dispose() {
|
|
47
|
+
this.#server.stop();
|
|
48
|
+
this.#clientSocketMap.clear();
|
|
49
|
+
}
|
|
50
|
+
on(eventName, listener) {
|
|
51
|
+
super.on(eventName, listener);
|
|
52
|
+
return this;
|
|
53
|
+
}
|
|
54
|
+
once(eventName, listener) {
|
|
55
|
+
super.once(eventName, listener);
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.PipeServer = PipeServer;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { JSONSchema7 } from 'json-schema';
|
|
2
|
+
import { ProtocolFieldJSONSchemaDefinition } from './ProtocolFieldJSONSchemaDefinition';
|
|
3
|
+
export interface ProtocolFieldJSONSchema extends JSONSchema7 {
|
|
4
|
+
encode?: () => void | Promise<void>;
|
|
5
|
+
decode?: () => void | Promise<void>;
|
|
6
|
+
label?: string;
|
|
7
|
+
$defs?: {
|
|
8
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition;
|
|
9
|
+
} | undefined;
|
|
10
|
+
items?: ProtocolFieldJSONSchemaDefinition | ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
11
|
+
additionalItems?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
12
|
+
contains?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
13
|
+
properties?: {
|
|
14
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition;
|
|
15
|
+
} | undefined;
|
|
16
|
+
patternProperties?: {
|
|
17
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition;
|
|
18
|
+
} | undefined;
|
|
19
|
+
additionalProperties?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
20
|
+
dependencies?: {
|
|
21
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition | string[];
|
|
22
|
+
} | undefined;
|
|
23
|
+
propertyNames?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
24
|
+
if?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
25
|
+
then?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
26
|
+
else?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
27
|
+
allOf?: ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
28
|
+
anyOf?: ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
29
|
+
oneOf?: ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
30
|
+
not?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
31
|
+
definitions?: {
|
|
32
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition;
|
|
33
|
+
} | undefined;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ProtocolFieldJSONSchema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtocolFieldJSONSchema.d.ts","sourceRoot":"","sources":["../../../src/lib/schema/ProtocolFieldJSONSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAA;AACvC,OAAO,EAAC,iCAAiC,EAAC,MAAM,qCAAqC,CAAA;AAErF,MAAM,WAAW,uBAAwB,SAAQ,WAAW;IAExD,MAAM,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC,MAAM,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEnC,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd,KAAK,CAAC,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,iCAAiC,CAAC;KACpD,GAAG,SAAS,CAAC;IAEd,KAAK,CAAC,EAAE,iCAAiC,GAAG,iCAAiC,EAAE,GAAG,SAAS,CAAC;IAE5F,eAAe,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IAChE,QAAQ,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IAEzD,UAAU,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,iCAAiC,CAAC;KACpD,GAAG,SAAS,CAAC;IACd,iBAAiB,CAAC,EAAE;QAChB,CAAC,GAAG,EAAE,MAAM,GAAG,iCAAiC,CAAC;KACpD,GAAG,SAAS,CAAC;IACd,oBAAoB,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IACrE,YAAY,CAAC,EAAE;QACX,CAAC,GAAG,EAAE,MAAM,GAAG,iCAAiC,GAAG,MAAM,EAAE,CAAC;KAC/D,GAAG,SAAS,CAAC;IACd,aAAa,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IAE9D,EAAE,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IACnD,IAAI,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IACrD,IAAI,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IAErD,KAAK,CAAC,EAAE,iCAAiC,EAAE,GAAG,SAAS,CAAC;IACxD,KAAK,CAAC,EAAE,iCAAiC,EAAE,GAAG,SAAS,CAAC;IACxD,KAAK,CAAC,EAAE,iCAAiC,EAAE,GAAG,SAAS,CAAC;IACxD,GAAG,CAAC,EAAE,iCAAiC,GAAG,SAAS,CAAC;IAEpD,WAAW,CAAC,EAAE;QACV,CAAC,GAAG,EAAE,MAAM,GAAG,iCAAiC,CAAC;KACpD,GAAG,SAAS,CAAC;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtocolFieldJSONSchemaDefinition.d.ts","sourceRoot":"","sources":["../../../src/lib/schema/ProtocolFieldJSONSchemaDefinition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,uBAAuB,EAAC,MAAM,2BAA2B,CAAA;AAEjE,MAAM,MAAM,iCAAiC,GAAG,uBAAuB,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { JSONSchema7, JSONSchema7Definition } from 'json-schema';
|
|
2
|
+
import { ProtocolFieldJSONSchemaDefinition } from './ProtocolFieldJSONSchemaDefinition';
|
|
3
|
+
export interface ProtocolJSONSchema extends JSONSchema7 {
|
|
4
|
+
$defs?: {
|
|
5
|
+
[key: string]: JSONSchema7Definition;
|
|
6
|
+
} | undefined;
|
|
7
|
+
items?: ProtocolFieldJSONSchemaDefinition | ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
8
|
+
additionalItems?: JSONSchema7Definition | undefined;
|
|
9
|
+
contains?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
10
|
+
properties?: {
|
|
11
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition;
|
|
12
|
+
} | undefined;
|
|
13
|
+
patternProperties?: {
|
|
14
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition;
|
|
15
|
+
} | undefined;
|
|
16
|
+
additionalProperties?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
17
|
+
dependencies?: {
|
|
18
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition | string[];
|
|
19
|
+
} | undefined;
|
|
20
|
+
propertyNames?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
21
|
+
if?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
22
|
+
then?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
23
|
+
else?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
24
|
+
allOf?: ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
25
|
+
anyOf?: ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
26
|
+
oneOf?: ProtocolFieldJSONSchemaDefinition[] | undefined;
|
|
27
|
+
not?: ProtocolFieldJSONSchemaDefinition | undefined;
|
|
28
|
+
definitions?: {
|
|
29
|
+
[key: string]: ProtocolFieldJSONSchemaDefinition;
|
|
30
|
+
} | undefined;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=ProtocolJSONSchema.d.ts.map
|