@kvaser/canking-api 7.1.0-beta.231

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.
Files changed (554) hide show
  1. package/EULA.pdf +0 -0
  2. package/README.md +87 -0
  3. package/REDISTRIBUTABLES.txt +5 -0
  4. package/dist/ElectronAPIFake.js +1 -0
  5. package/dist/ElectronAPIFake.mjs +266 -0
  6. package/dist/controls/CanChannelSelectControl.d.ts +35 -0
  7. package/dist/controls/CanIdentifierControl.d.ts +176 -0
  8. package/dist/controls/CanKingDataProvider.d.ts +116 -0
  9. package/dist/controls/CheckboxControl.d.ts +30 -0
  10. package/dist/controls/ContextMenu.d.ts +44 -0
  11. package/dist/controls/DropdownButton.d.ts +73 -0
  12. package/dist/controls/DropdownPanel.d.ts +41 -0
  13. package/dist/controls/FillBox.d.ts +8 -0
  14. package/dist/controls/FormControlRow.d.ts +30 -0
  15. package/dist/controls/InlineEditor.d.ts +26 -0
  16. package/dist/controls/LocalizedStrings.d.ts +21 -0
  17. package/dist/controls/NumberRangeControl.d.ts +80 -0
  18. package/dist/controls/OneLineButton.d.ts +9 -0
  19. package/dist/controls/RadioControl.d.ts +25 -0
  20. package/dist/controls/RadioGroupControl.d.ts +31 -0
  21. package/dist/controls/SectionControl.d.ts +40 -0
  22. package/dist/controls/SelectControl.d.ts +55 -0
  23. package/dist/controls/SizedBox.d.ts +11 -0
  24. package/dist/controls/TableControl.d.ts +61 -0
  25. package/dist/controls/TabsPanel.d.ts +5 -0
  26. package/dist/controls/TextControl.d.ts +56 -0
  27. package/dist/controls/ToolbarControl.d.ts +143 -0
  28. package/dist/controls/ValidateableTextControl.d.ts +82 -0
  29. package/dist/controls/index.d.ts +103 -0
  30. package/dist/controls.js +1 -0
  31. package/dist/controls.mjs +1714 -0
  32. package/dist/grpc/index.d.ts +7 -0
  33. package/dist/grpc.js +1 -0
  34. package/dist/grpc.mjs +917 -0
  35. package/dist/hooks/index.d.ts +112 -0
  36. package/dist/hooks.js +1 -0
  37. package/dist/hooks.mjs +28 -0
  38. package/dist/icons/index.d.ts +121 -0
  39. package/dist/icons.js +1 -0
  40. package/dist/icons.mjs +1237 -0
  41. package/dist/index.d.ts +6 -0
  42. package/dist/index.js +1 -0
  43. package/dist/index.mjs +596 -0
  44. package/dist/ipc/index.d.ts +160 -0
  45. package/dist/ipc.js +1 -0
  46. package/dist/ipc.mjs +123 -0
  47. package/dist/measurement_settings.js +1 -0
  48. package/dist/measurement_settings.mjs +4132 -0
  49. package/dist/models/DataBuffer.d.ts +100 -0
  50. package/dist/models/ElectronAPIFake.d.ts +13 -0
  51. package/dist/models/Point.d.ts +30 -0
  52. package/dist/models/index.d.ts +95 -0
  53. package/dist/models.js +1 -0
  54. package/dist/models.mjs +448 -0
  55. package/dist/protos/app_params.d.ts +208 -0
  56. package/dist/protos/app_service.d.ts +354 -0
  57. package/dist/protos/common_params.d.ts +33 -0
  58. package/dist/protos/device_params.d.ts +271 -0
  59. package/dist/protos/device_service.d.ts +154 -0
  60. package/dist/protos/frame_params.d.ts +189 -0
  61. package/dist/protos/google/protobuf/empty.d.ts +35 -0
  62. package/dist/protos/measurement_params.d.ts +308 -0
  63. package/dist/protos/measurement_service.d.ts +1333 -0
  64. package/dist/protos/measurement_settings.d.ts +453 -0
  65. package/dist/protos/signal_params.d.ts +72 -0
  66. package/dist/protos/status_params.d.ts +118 -0
  67. package/dist/status_params.js +1 -0
  68. package/dist/status_params.mjs +5045 -0
  69. package/doc/.nojekyll +1 -0
  70. package/doc/assets/highlight.css +120 -0
  71. package/doc/assets/icons.js +18 -0
  72. package/doc/assets/icons.svg +1 -0
  73. package/doc/assets/main.js +60 -0
  74. package/doc/assets/material-style.css +247 -0
  75. package/doc/assets/navigation.js +1 -0
  76. package/doc/assets/search.js +1 -0
  77. package/doc/assets/style.css +1493 -0
  78. package/doc/classes/controls.LocalizedStrings.html +177 -0
  79. package/doc/classes/models.DataBuffer.html +205 -0
  80. package/doc/classes/models.DataBufferView.html +193 -0
  81. package/doc/classes/models.Point.html +187 -0
  82. package/doc/enums/models.AccessMode.html +188 -0
  83. package/doc/enums/models.AppEvent.html +179 -0
  84. package/doc/enums/models.CanChannelCap.html +217 -0
  85. package/doc/enums/models.CanFrameFlag.html +200 -0
  86. package/doc/enums/models.CanMode.html +180 -0
  87. package/doc/enums/models.DecimalChar.html +178 -0
  88. package/doc/enums/models.DeviceEvent.html +179 -0
  89. package/doc/enums/models.FileConflictAction.html +180 -0
  90. package/doc/enums/models.LinFrameFlag.html +185 -0
  91. package/doc/enums/models.LogFileFormat.html +221 -0
  92. package/doc/enums/models.LogLevel.html +195 -0
  93. package/doc/enums/models.LogReplayState.html +179 -0
  94. package/doc/enums/models.MeasurementEvent.html +185 -0
  95. package/doc/enums/models.MessageLoggerState.html +180 -0
  96. package/doc/enums/models.Protocols.html +182 -0
  97. package/doc/enums/models.Separator.html +178 -0
  98. package/doc/enums/models.SignalEncoding.html +178 -0
  99. package/doc/enums/models.SignalType.html +185 -0
  100. package/doc/enums/models.SignalValueTriggerOperator.html +186 -0
  101. package/doc/enums/models.StatusLevel.html +180 -0
  102. package/doc/enums/models.TimeReference.html +178 -0
  103. package/doc/enums/models.TriggerOperator.html +179 -0
  104. package/doc/functions/controls.CanChannelSelectControl.html +177 -0
  105. package/doc/functions/controls.CanIdentifierControl.html +177 -0
  106. package/doc/functions/controls.CanIdentifierFrameControl.html +177 -0
  107. package/doc/functions/controls.CanIdentifierGeneratorControl.html +177 -0
  108. package/doc/functions/controls.CanIdentifierGeneratorSettingsControl.html +178 -0
  109. package/doc/functions/controls.CanKingDataProvider.html +182 -0
  110. package/doc/functions/controls.CheckboxControl.html +177 -0
  111. package/doc/functions/controls.ContextMenu.html +177 -0
  112. package/doc/functions/controls.DropdownButton.html +177 -0
  113. package/doc/functions/controls.DropdownButtonTextItems.html +177 -0
  114. package/doc/functions/controls.DropdownPanel.html +177 -0
  115. package/doc/functions/controls.FillBox.html +206 -0
  116. package/doc/functions/controls.FormControlRow.html +177 -0
  117. package/doc/functions/controls.InlineEditor.html +177 -0
  118. package/doc/functions/controls.NumberRangeControl.html +177 -0
  119. package/doc/functions/controls.OneLineButton.html +205 -0
  120. package/doc/functions/controls.RadioControl.html +177 -0
  121. package/doc/functions/controls.RadioGroupControl.html +177 -0
  122. package/doc/functions/controls.SectionControl.html +177 -0
  123. package/doc/functions/controls.SelectControl.html +177 -0
  124. package/doc/functions/controls.SizedBox.html +206 -0
  125. package/doc/functions/controls.TableControl.html +177 -0
  126. package/doc/functions/controls.TabsPanel.html +205 -0
  127. package/doc/functions/controls.TextControl.html +177 -0
  128. package/doc/functions/controls.ToolbarControl.html +177 -0
  129. package/doc/functions/controls.ValidateableTextControl.html +177 -0
  130. package/doc/functions/hooks.useDevices.html +176 -0
  131. package/doc/functions/hooks.useIsOnline.html +176 -0
  132. package/doc/functions/hooks.useLanguage.html +176 -0
  133. package/doc/functions/hooks.useLocalizedStrings.html +176 -0
  134. package/doc/functions/hooks.useLogMessages.html +176 -0
  135. package/doc/functions/hooks.useMaxDataBytes.html +175 -0
  136. package/doc/functions/hooks.useMeasurementSetup.html +176 -0
  137. package/doc/functions/hooks.useMeasurementStatus.html +176 -0
  138. package/doc/functions/hooks.useMessageLogFileFormats.html +175 -0
  139. package/doc/functions/hooks.useNewMeasurementData.html +178 -0
  140. package/doc/functions/hooks.useNodeStatus.html +176 -0
  141. package/doc/functions/hooks.useNumericRadix.html +176 -0
  142. package/doc/functions/hooks.useOnlineStatus.html +176 -0
  143. package/doc/functions/hooks.useOverallStatusLevel.html +176 -0
  144. package/doc/functions/hooks.useProjectData.html +178 -0
  145. package/doc/functions/hooks.useRecentProjectFiles.html +175 -0
  146. package/doc/functions/hooks.useRunningPeriodicTransmissions.html +176 -0
  147. package/doc/functions/hooks.useSessionData.html +178 -0
  148. package/doc/functions/hooks.useUserSettings.html +176 -0
  149. package/doc/functions/hooks.useWorkspacePaneWithId.html +175 -0
  150. package/doc/functions/icons.AddIcon.html +175 -0
  151. package/doc/functions/icons.ArrowDownIcon.html +175 -0
  152. package/doc/functions/icons.ArrowLeftIcon.html +175 -0
  153. package/doc/functions/icons.ArrowRightIcon.html +175 -0
  154. package/doc/functions/icons.ArrowUpIcon.html +175 -0
  155. package/doc/functions/icons.BusIsOffIcon.html +175 -0
  156. package/doc/functions/icons.BusIsOnIcon.html +175 -0
  157. package/doc/functions/icons.CloseIcon.html +175 -0
  158. package/doc/functions/icons.CopyIcon.html +175 -0
  159. package/doc/functions/icons.DarkModeIcon.html +175 -0
  160. package/doc/functions/icons.DeleteIcon.html +175 -0
  161. package/doc/functions/icons.DisableIcon.html +175 -0
  162. package/doc/functions/icons.EditIcon.html +175 -0
  163. package/doc/functions/icons.FilterIcon.html +175 -0
  164. package/doc/functions/icons.FixedPositionIcon.html +175 -0
  165. package/doc/functions/icons.LeaveFullScreenIcon.html +175 -0
  166. package/doc/functions/icons.LightModeIcon.html +175 -0
  167. package/doc/functions/icons.LineArrowDownIcon.html +175 -0
  168. package/doc/functions/icons.LineArrowUpIcon.html +175 -0
  169. package/doc/functions/icons.MaximizeWindowIcon.html +175 -0
  170. package/doc/functions/icons.MeasurementSetupIcon.html +175 -0
  171. package/doc/functions/icons.MoreHorizIcon.html +175 -0
  172. package/doc/functions/icons.MoreVertIcon.html +175 -0
  173. package/doc/functions/icons.NewIcon.html +175 -0
  174. package/doc/functions/icons.OpenExternallyIcon.html +175 -0
  175. package/doc/functions/icons.OpenIcon.html +175 -0
  176. package/doc/functions/icons.PauseIcon.html +175 -0
  177. package/doc/functions/icons.PlayIcon.html +175 -0
  178. package/doc/functions/icons.PlaySolidIcon.html +175 -0
  179. package/doc/functions/icons.SaveIcon.html +175 -0
  180. package/doc/functions/icons.SelectAllIcon.html +175 -0
  181. package/doc/functions/icons.ServiceIconActive.html +175 -0
  182. package/doc/functions/icons.ServiceIconInactive.html +175 -0
  183. package/doc/functions/icons.SettingsIcon.html +175 -0
  184. package/doc/functions/icons.StopIcon.html +175 -0
  185. package/doc/functions/icons.StopSolidIcon.html +175 -0
  186. package/doc/functions/icons.ToolsPanelHiddenIcon.html +175 -0
  187. package/doc/functions/icons.ToolsPanelVisibleIcon.html +175 -0
  188. package/doc/functions/icons.UnmaximizeWindowIcon.html +175 -0
  189. package/doc/functions/icons.WorkspacesIcon.html +175 -0
  190. package/doc/functions/ipc.addDataProcessor.html +178 -0
  191. package/doc/functions/ipc.addSource.html +176 -0
  192. package/doc/functions/ipc.addTarget.html +176 -0
  193. package/doc/functions/ipc.connectNodes.html +177 -0
  194. package/doc/functions/ipc.deleteDataProcessor.html +176 -0
  195. package/doc/functions/ipc.deleteSource.html +176 -0
  196. package/doc/functions/ipc.deleteTarget.html +176 -0
  197. package/doc/functions/ipc.disableNode.html +176 -0
  198. package/doc/functions/ipc.disconnectNodes.html +177 -0
  199. package/doc/functions/ipc.enableNode.html +176 -0
  200. package/doc/functions/ipc.getFrameDefinitions.html +178 -0
  201. package/doc/functions/ipc.getLogger.html +177 -0
  202. package/doc/functions/ipc.getMessageLogFileFormats.html +176 -0
  203. package/doc/functions/ipc.sendCanMessage.html +179 -0
  204. package/doc/functions/ipc.sendMessage.html +177 -0
  205. package/doc/functions/ipc.showMessageBox.html +177 -0
  206. package/doc/functions/ipc.showQuestionBox.html +183 -0
  207. package/doc/functions/ipc.startLogReplay.html +176 -0
  208. package/doc/functions/ipc.startMeasurement.html +175 -0
  209. package/doc/functions/ipc.startPeriodicTransmission.html +177 -0
  210. package/doc/functions/ipc.stopLogReplay.html +176 -0
  211. package/doc/functions/ipc.stopMeasurement.html +175 -0
  212. package/doc/functions/ipc.stopPeriodicTransmission.html +176 -0
  213. package/doc/functions/ipc.updateDataProcessor.html +176 -0
  214. package/doc/functions/ipc.updateSource.html +176 -0
  215. package/doc/functions/ipc.updateTarget.html +176 -0
  216. package/doc/functions/models.accessModeFromJSON.html +174 -0
  217. package/doc/functions/models.accessModeToJSON.html +174 -0
  218. package/doc/functions/models.appEventFromJSON.html +174 -0
  219. package/doc/functions/models.appEventToJSON.html +174 -0
  220. package/doc/functions/models.canChannelCapFromJSON.html +174 -0
  221. package/doc/functions/models.canChannelCapToJSON.html +174 -0
  222. package/doc/functions/models.canFrameFlagFromJSON.html +174 -0
  223. package/doc/functions/models.canFrameFlagToJSON.html +174 -0
  224. package/doc/functions/models.canModeFromJSON.html +174 -0
  225. package/doc/functions/models.canModeToJSON.html +174 -0
  226. package/doc/functions/models.createElectronApiFake.html +177 -0
  227. package/doc/functions/models.decimalCharFromJSON.html +174 -0
  228. package/doc/functions/models.decimalCharToJSON.html +174 -0
  229. package/doc/functions/models.decimalToFixed.html +174 -0
  230. package/doc/functions/models.decimalToHex.html +174 -0
  231. package/doc/functions/models.deviceEventFromJSON.html +174 -0
  232. package/doc/functions/models.deviceEventToJSON.html +174 -0
  233. package/doc/functions/models.fileConflictActionFromJSON.html +174 -0
  234. package/doc/functions/models.fileConflictActionToJSON.html +174 -0
  235. package/doc/functions/models.linFrameFlagFromJSON.html +174 -0
  236. package/doc/functions/models.linFrameFlagToJSON.html +174 -0
  237. package/doc/functions/models.logFileFormatFromJSON.html +174 -0
  238. package/doc/functions/models.logFileFormatToJSON.html +174 -0
  239. package/doc/functions/models.logLevelFromJSON.html +174 -0
  240. package/doc/functions/models.logLevelToJSON.html +174 -0
  241. package/doc/functions/models.logReplayStateFromJSON.html +174 -0
  242. package/doc/functions/models.logReplayStateToJSON.html +174 -0
  243. package/doc/functions/models.longToNumber.html +174 -0
  244. package/doc/functions/models.measurementEventFromJSON.html +174 -0
  245. package/doc/functions/models.measurementEventToJSON.html +174 -0
  246. package/doc/functions/models.messageLoggerStateFromJSON.html +174 -0
  247. package/doc/functions/models.messageLoggerStateToJSON.html +174 -0
  248. package/doc/functions/models.protocolsFromJSON.html +174 -0
  249. package/doc/functions/models.protocolsToJSON.html +174 -0
  250. package/doc/functions/models.separatorFromJSON.html +174 -0
  251. package/doc/functions/models.separatorToJSON.html +174 -0
  252. package/doc/functions/models.signalEncodingFromJSON.html +174 -0
  253. package/doc/functions/models.signalEncodingToJSON.html +174 -0
  254. package/doc/functions/models.signalTypeFromJSON.html +174 -0
  255. package/doc/functions/models.signalTypeToJSON.html +174 -0
  256. package/doc/functions/models.signalValueTriggerOperatorFromJSON.html +174 -0
  257. package/doc/functions/models.signalValueTriggerOperatorToJSON.html +174 -0
  258. package/doc/functions/models.statusLevelFromJSON.html +174 -0
  259. package/doc/functions/models.statusLevelToJSON.html +174 -0
  260. package/doc/functions/models.timeReferenceFromJSON.html +174 -0
  261. package/doc/functions/models.timeReferenceToJSON.html +174 -0
  262. package/doc/functions/models.triggerOperatorFromJSON.html +174 -0
  263. package/doc/functions/models.triggerOperatorToJSON.html +174 -0
  264. package/doc/hierarchy.html +174 -0
  265. package/doc/index.html +244 -0
  266. package/doc/interfaces/controls.ButtonGroupProps.html +183 -0
  267. package/doc/interfaces/controls.ButtonProps.html +195 -0
  268. package/doc/interfaces/controls.CanChannelSelectControlProps.html +194 -0
  269. package/doc/interfaces/controls.CanIdentifierControlProps.html +195 -0
  270. package/doc/interfaces/controls.CanIdentifierFrameControlProps.html +190 -0
  271. package/doc/interfaces/controls.CanIdentifierGeneratorControlProps.html +208 -0
  272. package/doc/interfaces/controls.CanIdentifierGeneratorSettingsControlProps.html +194 -0
  273. package/doc/interfaces/controls.CheckboxControlProps.html +190 -0
  274. package/doc/interfaces/controls.ContextMenuProps.html +182 -0
  275. package/doc/interfaces/controls.DropdownButtonChildrenProps.html +177 -0
  276. package/doc/interfaces/controls.DropdownButtonProps.html +193 -0
  277. package/doc/interfaces/controls.DropdownButtonTextItemsProps.html +183 -0
  278. package/doc/interfaces/controls.DropdownPanelProps.html +193 -0
  279. package/doc/interfaces/controls.FormControlRowProps.html +181 -0
  280. package/doc/interfaces/controls.ILocalizedStrings.html +176 -0
  281. package/doc/interfaces/controls.InlineEditorProps.html +186 -0
  282. package/doc/interfaces/controls.LabelProps.html +179 -0
  283. package/doc/interfaces/controls.NumberRangeControlProps.html +225 -0
  284. package/doc/interfaces/controls.RadioControlProps.html +187 -0
  285. package/doc/interfaces/controls.RadioGroupControlProps.html +182 -0
  286. package/doc/interfaces/controls.SectionControlProps.html +190 -0
  287. package/doc/interfaces/controls.SelectControlProps.html +205 -0
  288. package/doc/interfaces/controls.TableColumn.html +185 -0
  289. package/doc/interfaces/controls.TableControlProps.html +197 -0
  290. package/doc/interfaces/controls.TextControlProps.html +214 -0
  291. package/doc/interfaces/controls.ToggleButtonGroupProps.html +190 -0
  292. package/doc/interfaces/controls.ToggleButtonProps.html +187 -0
  293. package/doc/interfaces/controls.ToolbarControlProps.html +191 -0
  294. package/doc/interfaces/controls.ValidateableTextControlProps.html +233 -0
  295. package/doc/interfaces/controls.toolbarItem.html +185 -0
  296. package/doc/interfaces/ipc.ILogger.html +181 -0
  297. package/doc/interfaces/models.AboutInformation.html +181 -0
  298. package/doc/interfaces/models.ActivateLicenseRequest.html +181 -0
  299. package/doc/interfaces/models.AddAllConnectedCanChannelsRequest.html +177 -0
  300. package/doc/interfaces/models.AddAllConnectedLinChannelsRequest.html +177 -0
  301. package/doc/interfaces/models.AddOrUpdateDataProcessorRequest.html +185 -0
  302. package/doc/interfaces/models.AddOrUpdateSourceRequest.html +181 -0
  303. package/doc/interfaces/models.AddOrUpdateTargetRequest.html +181 -0
  304. package/doc/interfaces/models.ApiPreferences.html +183 -0
  305. package/doc/interfaces/models.AppEventArgs.html +179 -0
  306. package/doc/interfaces/models.BaseNodeProperties.html +181 -0
  307. package/doc/interfaces/models.BusStatus.html +190 -0
  308. package/doc/interfaces/models.CanBusParamLimits.html +180 -0
  309. package/doc/interfaces/models.CanBusParams.html +197 -0
  310. package/doc/interfaces/models.CanBusSpeed.html +187 -0
  311. package/doc/interfaces/models.CanBusSpeedInfo.html +193 -0
  312. package/doc/interfaces/models.CanChannelCapacity.html +180 -0
  313. package/doc/interfaces/models.CanChannelConfiguration.html +185 -0
  314. package/doc/interfaces/models.CanFDBusSpeedCombination.html +177 -0
  315. package/doc/interfaces/models.CanFDBusSpeedInfo.html +191 -0
  316. package/doc/interfaces/models.CanFrameFlags.html +177 -0
  317. package/doc/interfaces/models.CanMessageFilterSettings.html +178 -0
  318. package/doc/interfaces/models.Channel.html +180 -0
  319. package/doc/interfaces/models.ChannelSettings.html +193 -0
  320. package/doc/interfaces/models.ClearLinMessageRequest.html +180 -0
  321. package/doc/interfaces/models.ConnectNodesRequest.html +178 -0
  322. package/doc/interfaces/models.DataProcessingStatus.html +179 -0
  323. package/doc/interfaces/models.DataProcessorNodeProperties.html +181 -0
  324. package/doc/interfaces/models.DatabasesSettings.html +176 -0
  325. package/doc/interfaces/models.Device.html +182 -0
  326. package/doc/interfaces/models.DeviceEventArgs.html +177 -0
  327. package/doc/interfaces/models.Devices.html +175 -0
  328. package/doc/interfaces/models.DisconnectNodesRequest.html +178 -0
  329. package/doc/interfaces/models.Empty.html +182 -0
  330. package/doc/interfaces/models.ErrorStatus.html +177 -0
  331. package/doc/interfaces/models.Frame.html +203 -0
  332. package/doc/interfaces/models.FrameDefinition.html +185 -0
  333. package/doc/interfaces/models.FrameDefinitions.html +175 -0
  334. package/doc/interfaces/models.FramePropertyValue.html +177 -0
  335. package/doc/interfaces/models.FrameReceivedTrigger.html +179 -0
  336. package/doc/interfaces/models.Frame_PropertiesEntry.html +176 -0
  337. package/doc/interfaces/models.Frames.html +175 -0
  338. package/doc/interfaces/models.GetCanChannelBusSpeedsRequest.html +177 -0
  339. package/doc/interfaces/models.GetCanChannelBusSpeedsResponse.html +179 -0
  340. package/doc/interfaces/models.GetCanFdBusSpeedsRequest.html +179 -0
  341. package/doc/interfaces/models.GetCanFdBusSpeedsResponse.html +177 -0
  342. package/doc/interfaces/models.GetChannelsFromLogFileRequest.html +178 -0
  343. package/doc/interfaces/models.GetChannelsFromLogFileResponse.html +177 -0
  344. package/doc/interfaces/models.GetClassicCanBusSpeedsRequest.html +178 -0
  345. package/doc/interfaces/models.GetClassicCanBusSpeedsResponse.html +177 -0
  346. package/doc/interfaces/models.GetDataProcessorResponse.html +176 -0
  347. package/doc/interfaces/models.GetDevicesRequest.html +177 -0
  348. package/doc/interfaces/models.GetDevicesResponse.html +176 -0
  349. package/doc/interfaces/models.GetFrameDefinitionsFromDatabaseFilesRequest.html +178 -0
  350. package/doc/interfaces/models.GetLicensesResponse.html +177 -0
  351. package/doc/interfaces/models.GetLogFileFormatsRequest.html +180 -0
  352. package/doc/interfaces/models.GetLogFileFormatsResponse.html +183 -0
  353. package/doc/interfaces/models.GetLogLevelResponse.html +177 -0
  354. package/doc/interfaces/models.GetScheduleTablesFromDatabaseFilesRequest.html +178 -0
  355. package/doc/interfaces/models.GetScheduleTablesFromDatabaseFilesResponse.html +177 -0
  356. package/doc/interfaces/models.GetServiceExtensionInfoRequest.html +181 -0
  357. package/doc/interfaces/models.GetServiceExtensionInfoResponse.html +187 -0
  358. package/doc/interfaces/models.GetSignalDataFromMessageDataRequest.html +180 -0
  359. package/doc/interfaces/models.GetSignalDataFromMessageDataResponse.html +177 -0
  360. package/doc/interfaces/models.GetSourceResponse.html +176 -0
  361. package/doc/interfaces/models.GetTargetResponse.html +176 -0
  362. package/doc/interfaces/models.ILogFileFormat.html +179 -0
  363. package/doc/interfaces/models.IProject.html +179 -0
  364. package/doc/interfaces/models.IUserSettings.html +187 -0
  365. package/doc/interfaces/models.IWorkspaceComponentPaneData.html +177 -0
  366. package/doc/interfaces/models.IWorkspaceContainerPaneData.html +178 -0
  367. package/doc/interfaces/models.IWorkspaceData.html +178 -0
  368. package/doc/interfaces/models.IWorkspacePaneData.html +178 -0
  369. package/doc/interfaces/models.IdentifierRequest.html +178 -0
  370. package/doc/interfaces/models.IdentifiersRequest.html +178 -0
  371. package/doc/interfaces/models.InstallServiceExtensionRequest.html +181 -0
  372. package/doc/interfaces/models.InterpreterSettings.html +177 -0
  373. package/doc/interfaces/models.J1939InterpreterSettings.html +175 -0
  374. package/doc/interfaces/models.LicenseInformation.html +191 -0
  375. package/doc/interfaces/models.Licenses.html +177 -0
  376. package/doc/interfaces/models.LinChannelConfiguration.html +185 -0
  377. package/doc/interfaces/models.LinFrameFlags.html +177 -0
  378. package/doc/interfaces/models.LogMessage.html +185 -0
  379. package/doc/interfaces/models.LogMessages.html +177 -0
  380. package/doc/interfaces/models.LogReplaySettings.html +199 -0
  381. package/doc/interfaces/models.LogReplaySettings_ChannelIdentifiersEntry.html +176 -0
  382. package/doc/interfaces/models.LogReplayStatus.html +176 -0
  383. package/doc/interfaces/models.MeasurementEventArgs.html +179 -0
  384. package/doc/interfaces/models.MeasurementSetup.html +179 -0
  385. package/doc/interfaces/models.MessageLoggerSettings.html +213 -0
  386. package/doc/interfaces/models.MessageLoggerStatus.html +176 -0
  387. package/doc/interfaces/models.NodeStatus.html +191 -0
  388. package/doc/interfaces/models.NodeStatuses.html +176 -0
  389. package/doc/interfaces/models.OnlineStatus.html +176 -0
  390. package/doc/interfaces/models.PeriodicTransmissionSettings.html +209 -0
  391. package/doc/interfaces/models.RequestLinMessageRequest.html +180 -0
  392. package/doc/interfaces/models.ScheduleTable.html +181 -0
  393. package/doc/interfaces/models.ScheduleTableEntry.html +179 -0
  394. package/doc/interfaces/models.SendLinWakeupFrameRequest.html +182 -0
  395. package/doc/interfaces/models.SendMessageRequest.html +178 -0
  396. package/doc/interfaces/models.ServiceExtensionSettings.html +177 -0
  397. package/doc/interfaces/models.SetLogLevelRequest.html +179 -0
  398. package/doc/interfaces/models.SetMeasurementSetupRequest.html +177 -0
  399. package/doc/interfaces/models.SetSignalDataToMessageDataRequest.html +182 -0
  400. package/doc/interfaces/models.SetSignalDataToMessageDataResponse.html +180 -0
  401. package/doc/interfaces/models.SignalDefinition.html +188 -0
  402. package/doc/interfaces/models.SignalDefinition_EnumValuesEntry.html +176 -0
  403. package/doc/interfaces/models.SignalDefinitions.html +175 -0
  404. package/doc/interfaces/models.SignalValue.html +180 -0
  405. package/doc/interfaces/models.SignalValueTrigger.html +189 -0
  406. package/doc/interfaces/models.SourceNodeProperties.html +180 -0
  407. package/doc/interfaces/models.StartPeriodicTransmissionRequest.html +178 -0
  408. package/doc/interfaces/models.StartPeriodicTransmissionResponse.html +176 -0
  409. package/doc/interfaces/models.TargetNodeProperties.html +178 -0
  410. package/doc/interfaces/models.TriggerSettings.html +181 -0
  411. package/doc/interfaces/models.UninstallServiceExtensionRequest.html +179 -0
  412. package/doc/interfaces/models.UpdateLinMessageRequest.html +181 -0
  413. package/doc/interfaces/models.WriteFrame.html +183 -0
  414. package/doc/modules/controls.html +242 -0
  415. package/doc/modules/hooks.html +201 -0
  416. package/doc/modules/icons.html +216 -0
  417. package/doc/modules/ipc.html +202 -0
  418. package/doc/modules/models.html +478 -0
  419. package/doc/modules.html +179 -0
  420. package/doc/types/controls.ContextMenuOption.html +179 -0
  421. package/doc/types/controls.SelectOption.html +177 -0
  422. package/doc/types/controls.StringsMap.html +175 -0
  423. package/doc/types/controls.canIdentifierType.html +175 -0
  424. package/doc/types/models.IReadOnlyDataBuffer.html +174 -0
  425. package/doc/types/models.themes.html +174 -0
  426. package/doc/variables/models.AboutInformation-1.html +174 -0
  427. package/doc/variables/models.ActivateLicenseRequest-1.html +174 -0
  428. package/doc/variables/models.AddAllConnectedCanChannelsRequest-1.html +174 -0
  429. package/doc/variables/models.AddAllConnectedLinChannelsRequest-1.html +174 -0
  430. package/doc/variables/models.AddOrUpdateDataProcessorRequest-1.html +174 -0
  431. package/doc/variables/models.AddOrUpdateSourceRequest-1.html +174 -0
  432. package/doc/variables/models.AddOrUpdateTargetRequest-1.html +174 -0
  433. package/doc/variables/models.ApiPreferences-1.html +174 -0
  434. package/doc/variables/models.AppEventArgs-1.html +174 -0
  435. package/doc/variables/models.BaseNodeProperties-1.html +174 -0
  436. package/doc/variables/models.BusStatus-1.html +174 -0
  437. package/doc/variables/models.CanBusParamLimits-1.html +174 -0
  438. package/doc/variables/models.CanBusParams-1.html +174 -0
  439. package/doc/variables/models.CanBusSpeed-1.html +174 -0
  440. package/doc/variables/models.CanBusSpeedInfo-1.html +174 -0
  441. package/doc/variables/models.CanChannelCapacity-1.html +174 -0
  442. package/doc/variables/models.CanChannelConfiguration-1.html +174 -0
  443. package/doc/variables/models.CanFDBusSpeedCombination-1.html +174 -0
  444. package/doc/variables/models.CanFDBusSpeedInfo-1.html +174 -0
  445. package/doc/variables/models.CanFrameFlags-1.html +174 -0
  446. package/doc/variables/models.CanMessageFilterSettings-1.html +174 -0
  447. package/doc/variables/models.Channel-1.html +174 -0
  448. package/doc/variables/models.ChannelSettings-1.html +174 -0
  449. package/doc/variables/models.ClearLinMessageRequest-1.html +174 -0
  450. package/doc/variables/models.ConnectNodesRequest-1.html +174 -0
  451. package/doc/variables/models.DataProcessingStatus-1.html +174 -0
  452. package/doc/variables/models.DataProcessorNodeProperties-1.html +174 -0
  453. package/doc/variables/models.DatabasesSettings-1.html +174 -0
  454. package/doc/variables/models.Device-1.html +174 -0
  455. package/doc/variables/models.DeviceEventArgs-1.html +174 -0
  456. package/doc/variables/models.Devices-1.html +174 -0
  457. package/doc/variables/models.DisconnectNodesRequest-1.html +174 -0
  458. package/doc/variables/models.Empty-1.html +174 -0
  459. package/doc/variables/models.ErrorStatus-1.html +174 -0
  460. package/doc/variables/models.Frame-1.html +174 -0
  461. package/doc/variables/models.FrameDefinition-1.html +174 -0
  462. package/doc/variables/models.FrameDefinitions-1.html +174 -0
  463. package/doc/variables/models.FramePropertyValue-1.html +174 -0
  464. package/doc/variables/models.FrameReceivedTrigger-1.html +174 -0
  465. package/doc/variables/models.Frame_PropertiesEntry-1.html +174 -0
  466. package/doc/variables/models.Frames-1.html +174 -0
  467. package/doc/variables/models.GetCanChannelBusSpeedsRequest-1.html +174 -0
  468. package/doc/variables/models.GetCanChannelBusSpeedsResponse-1.html +174 -0
  469. package/doc/variables/models.GetCanFdBusSpeedsRequest-1.html +174 -0
  470. package/doc/variables/models.GetCanFdBusSpeedsResponse-1.html +174 -0
  471. package/doc/variables/models.GetChannelsFromLogFileRequest-1.html +174 -0
  472. package/doc/variables/models.GetChannelsFromLogFileResponse-1.html +174 -0
  473. package/doc/variables/models.GetClassicCanBusSpeedsRequest-1.html +174 -0
  474. package/doc/variables/models.GetClassicCanBusSpeedsResponse-1.html +174 -0
  475. package/doc/variables/models.GetDataProcessorResponse-1.html +174 -0
  476. package/doc/variables/models.GetDevicesRequest-1.html +174 -0
  477. package/doc/variables/models.GetDevicesResponse-1.html +174 -0
  478. package/doc/variables/models.GetFrameDefinitionsFromDatabaseFilesRequest-1.html +174 -0
  479. package/doc/variables/models.GetLicensesResponse-1.html +174 -0
  480. package/doc/variables/models.GetLogFileFormatsRequest-1.html +174 -0
  481. package/doc/variables/models.GetLogFileFormatsResponse-1.html +174 -0
  482. package/doc/variables/models.GetLogLevelResponse-1.html +174 -0
  483. package/doc/variables/models.GetScheduleTablesFromDatabaseFilesRequest-1.html +174 -0
  484. package/doc/variables/models.GetScheduleTablesFromDatabaseFilesResponse-1.html +174 -0
  485. package/doc/variables/models.GetServiceExtensionInfoRequest-1.html +174 -0
  486. package/doc/variables/models.GetServiceExtensionInfoResponse-1.html +174 -0
  487. package/doc/variables/models.GetSignalDataFromMessageDataRequest-1.html +174 -0
  488. package/doc/variables/models.GetSignalDataFromMessageDataResponse-1.html +174 -0
  489. package/doc/variables/models.GetSourceResponse-1.html +174 -0
  490. package/doc/variables/models.GetTargetResponse-1.html +174 -0
  491. package/doc/variables/models.IdentifierRequest-1.html +174 -0
  492. package/doc/variables/models.IdentifiersRequest-1.html +174 -0
  493. package/doc/variables/models.InstallServiceExtensionRequest-1.html +174 -0
  494. package/doc/variables/models.InterpreterSettings-1.html +174 -0
  495. package/doc/variables/models.J1939InterpreterSettings-1.html +174 -0
  496. package/doc/variables/models.LicenseInformation-1.html +174 -0
  497. package/doc/variables/models.Licenses-1.html +174 -0
  498. package/doc/variables/models.LinChannelConfiguration-1.html +174 -0
  499. package/doc/variables/models.LinFrameFlags-1.html +174 -0
  500. package/doc/variables/models.LogMessage-1.html +174 -0
  501. package/doc/variables/models.LogMessages-1.html +174 -0
  502. package/doc/variables/models.LogReplaySettings-1.html +174 -0
  503. package/doc/variables/models.LogReplaySettings_ChannelIdentifiersEntry-1.html +174 -0
  504. package/doc/variables/models.LogReplayStatus-1.html +174 -0
  505. package/doc/variables/models.MeasurementEventArgs-1.html +174 -0
  506. package/doc/variables/models.MeasurementSetup-1.html +174 -0
  507. package/doc/variables/models.MessageLoggerSettings-1.html +174 -0
  508. package/doc/variables/models.MessageLoggerStatus-1.html +174 -0
  509. package/doc/variables/models.NodeStatus-1.html +174 -0
  510. package/doc/variables/models.NodeStatuses-1.html +174 -0
  511. package/doc/variables/models.OnlineStatus-1.html +174 -0
  512. package/doc/variables/models.PeriodicTransmissionSettings-1.html +174 -0
  513. package/doc/variables/models.RequestLinMessageRequest-1.html +174 -0
  514. package/doc/variables/models.ScheduleTable-1.html +174 -0
  515. package/doc/variables/models.ScheduleTableEntry-1.html +174 -0
  516. package/doc/variables/models.SendLinWakeupFrameRequest-1.html +174 -0
  517. package/doc/variables/models.SendMessageRequest-1.html +174 -0
  518. package/doc/variables/models.ServiceExtensionSettings-1.html +174 -0
  519. package/doc/variables/models.SetLogLevelRequest-1.html +174 -0
  520. package/doc/variables/models.SetMeasurementSetupRequest-1.html +174 -0
  521. package/doc/variables/models.SetSignalDataToMessageDataRequest-1.html +174 -0
  522. package/doc/variables/models.SetSignalDataToMessageDataResponse-1.html +174 -0
  523. package/doc/variables/models.SignalDefinition-1.html +174 -0
  524. package/doc/variables/models.SignalDefinition_EnumValuesEntry-1.html +174 -0
  525. package/doc/variables/models.SignalDefinitions-1.html +174 -0
  526. package/doc/variables/models.SignalValue-1.html +174 -0
  527. package/doc/variables/models.SignalValueTrigger-1.html +174 -0
  528. package/doc/variables/models.SourceNodeProperties-1.html +174 -0
  529. package/doc/variables/models.StartPeriodicTransmissionRequest-1.html +174 -0
  530. package/doc/variables/models.StartPeriodicTransmissionResponse-1.html +174 -0
  531. package/doc/variables/models.TargetNodeProperties-1.html +174 -0
  532. package/doc/variables/models.TriggerSettings-1.html +174 -0
  533. package/doc/variables/models.UninstallServiceExtensionRequest-1.html +174 -0
  534. package/doc/variables/models.UpdateLinMessageRequest-1.html +174 -0
  535. package/doc/variables/models.WriteFrame-1.html +174 -0
  536. package/doc/variables/models.defaultUserSettings.html +175 -0
  537. package/package.json +129 -0
  538. package/scripts/createCanKingExtension.js +403 -0
  539. package/scripts/index.js +39 -0
  540. package/scripts/template/_.eslintrc.cjs +38 -0
  541. package/scripts/template/_.gitignore +24 -0
  542. package/scripts/template/_.npmrc +2 -0
  543. package/scripts/template/_.prettierrc +8 -0
  544. package/scripts/template/_.vscode/_launch.json +28 -0
  545. package/scripts/template/_index.html +15 -0
  546. package/scripts/template/_tsconfig.app.json +27 -0
  547. package/scripts/template/_tsconfig.json +11 -0
  548. package/scripts/template/_tsconfig.node.json +13 -0
  549. package/scripts/template/_vite.config.ts +7 -0
  550. package/scripts/template/src/App.tsx +12 -0
  551. package/scripts/template/src/WorkspaceView/index.tsx +47 -0
  552. package/scripts/template/src/main.css +9 -0
  553. package/scripts/template/src/main.tsx +19 -0
  554. package/scripts/template/src/vite-env.d.ts +1 -0
@@ -0,0 +1,403 @@
1
+ 'use strict';
2
+
3
+ const https = require('https');
4
+ const chalk = require('chalk');
5
+ const commander = require('@commander-js/extra-typings');
6
+ const execSync = require('child_process').execSync;
7
+ const fs = require('fs-extra');
8
+ const os = require('os');
9
+ const path = require('path');
10
+ const semver = require('semver');
11
+ const spawn = require('cross-spawn');
12
+ const validateProjectName = require('validate-npm-package-name');
13
+
14
+ const packageJson = require('../package.json');
15
+
16
+ const kvaserRegistry = 'http://artifact.kvaser.se/artifactory/api/npm/libs-npm';
17
+
18
+ function init() {
19
+ let projectName;
20
+
21
+ const program = new commander.Command(`npx ${packageJson.name}`)
22
+ .description('Script for creating a new CanKing extension project')
23
+ .version(packageJson.version)
24
+ .argument(
25
+ '<project-name>',
26
+ 'The project name. A new project folder with this name will be created in the current folder.',
27
+ )
28
+ .action(name => (projectName = name))
29
+ .usage(`${chalk.green('<project-name>')} [options]`)
30
+ .option('--view-name <string>', 'workspace view name', '')
31
+ .option('--desc <string>', 'project description', 'A CanKing GUI extension.')
32
+ .option('--author <string>', 'project author', '')
33
+ .option('--verbose', 'print additional logs')
34
+ .option('--force', 'use installed script even if a newer version exists')
35
+ .option('--show-doc', 'opens the documentation')
36
+ .allowUnknownOption()
37
+ .showHelpAfterError()
38
+ .parse(process.argv);
39
+
40
+ const options = program.opts();
41
+
42
+ if (options.viewName === '') {
43
+ options.viewName = projectName
44
+ .split('-')
45
+ .map(n => n.charAt(0).toUpperCase() + n.slice(1))
46
+ .join('');
47
+ }
48
+
49
+ // Set correct register for @kvaser scope
50
+ try {
51
+ execSync(`npm config set @kvaser:registry ${kvaserRegistry}`);
52
+ } catch {}
53
+
54
+ // We first check the registry directly via the API, and if that fails, we try
55
+ // the slower `npm view [package] version` command.
56
+ //
57
+ // This is important for users in environments where direct access to npm is
58
+ // blocked by a firewall, and packages are provided exclusively via a private
59
+ // registry.
60
+ checkForLatestVersion()
61
+ .catch(() => {
62
+ try {
63
+ return execSync('npm view @kvaser/create-canking-extension version').toString().trim();
64
+ } catch (e) {
65
+ return null;
66
+ }
67
+ })
68
+ .then(latest => {
69
+ if (!options.force && latest && semver.lt(packageJson.version, latest)) {
70
+ console.log();
71
+ console.error(
72
+ chalk.yellow(
73
+ `You are running \`create-canking-extension\` ${packageJson.version}, which is behind the latest release (${latest}).\n\n` +
74
+ 'We recommend always using the latest version of create-canking-extension if possible.\n\n' +
75
+ 'Use --force option to override if you want to use the old version.',
76
+ ),
77
+ );
78
+ console.log();
79
+ } else {
80
+ try {
81
+ createExtension(projectName, options.viewName, options.desc, options.author, options.verbose);
82
+ } catch (e) {
83
+ console.error(chalk.red(e));
84
+ }
85
+ }
86
+ });
87
+ }
88
+
89
+ function createExtension(name, viewName, description, author, verbose) {
90
+ const root = path.resolve(name);
91
+ const extensionName = path.basename(root);
92
+
93
+ checkExtensionName(extensionName);
94
+ fs.ensureDirSync(name);
95
+ if (!isSafeToCreateProjectIn(root, name)) {
96
+ process.exit(1);
97
+ }
98
+ console.log();
99
+
100
+ console.log(`Creating a new CanKing extension in ${chalk.green(root)}.`);
101
+ console.log();
102
+
103
+ const packageJson = {
104
+ name: extensionName,
105
+ version: '1.0.0',
106
+ description: description,
107
+ author: author,
108
+ canking: {
109
+ workspaceViewName: viewName,
110
+ types: ['WorkspaceView'],
111
+ },
112
+ private: true,
113
+ license: 'UNLICENSED',
114
+ type: 'module',
115
+ files: ['dist'],
116
+ scripts: {
117
+ start: 'npm-run-all --parallel dev canking',
118
+ startpreview: 'npm-run-all --parallel preview canking',
119
+ dev: 'vite --port 4000',
120
+ canking:
121
+ 'cross-env "C:/Program Files/Kvaser CanKing/Kvaser CanKing.exe" --ck-debug-pkg "./package.json" --ck-debug-port 4000',
122
+ build: 'tsc -b && vite build',
123
+ lint: 'eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0',
124
+ prettier: 'prettier --config .prettierrc **/*.ts* --write',
125
+ preview: 'vite preview --port 4000',
126
+ prepack: 'npm run build',
127
+ prebuild: 'rimraf dist',
128
+ },
129
+ };
130
+ fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify(packageJson, null, 2) + os.EOL);
131
+
132
+ process.chdir(root);
133
+
134
+ // Copy templates
135
+ fs.copySync(path.join(__dirname, 'template', '_.vscode', '_launch.json'), path.join(root, '.vscode', 'launch.json'));
136
+ fs.copySync(
137
+ path.join(__dirname, 'template', 'src', 'WorkspaceView', 'index.tsx'),
138
+ path.join(root, 'src', 'WorkspaceView', 'index.tsx'),
139
+ );
140
+ fs.copySync(path.join(__dirname, 'template', 'src', 'App.tsx'), path.join(root, 'src', 'App.tsx'));
141
+ fs.copySync(path.join(__dirname, 'template', 'src', 'main.css'), path.join(root, 'src', 'main.css'));
142
+ fs.copySync(path.join(__dirname, 'template', 'src', 'main.tsx'), path.join(root, 'src', 'main.tsx'));
143
+ fs.copySync(path.join(__dirname, 'template', 'src', 'vite-env.d.ts'), path.join(root, 'src', 'vite-env.d.ts'));
144
+ fs.copySync(path.join(__dirname, 'template', '_.eslintrc.cjs'), path.join(root, '.eslintrc.cjs'));
145
+ fs.copySync(path.join(__dirname, 'template', '_.gitignore'), path.join(root, '.gitignore'));
146
+ fs.copySync(path.join(__dirname, 'template', '_.npmrc'), path.join(root, '.npmrc'));
147
+ fs.copySync(path.join(__dirname, 'template', '_.prettierrc'), path.join(root, '.prettierrc'));
148
+ fs.copySync(path.join(__dirname, 'template', '_index.html'), path.join(root, 'index.html'));
149
+ fs.copySync(path.join(__dirname, 'template', '_tsconfig.app.json'), path.join(root, 'tsconfig.app.json'));
150
+ fs.copySync(path.join(__dirname, 'template', '_tsconfig.json'), path.join(root, 'tsconfig.json'));
151
+ fs.copySync(path.join(__dirname, 'template', '_tsconfig.node.json'), path.join(root, 'tsconfig.node.json'));
152
+ fs.copySync(path.join(__dirname, 'template', '_vite.config.ts'), path.join(root, 'vite.config.ts'));
153
+
154
+ installDependencies(verbose)
155
+ .then(() => {
156
+ console.log();
157
+ console.log(`A project for extension ${extensionName} has been created successfully.`);
158
+ console.log();
159
+ })
160
+ .catch(reason => {
161
+ console.log();
162
+ console.log('Aborting installation.');
163
+ console.log(chalk.red('Unexpected error. Please report it as a bug:'));
164
+ console.log(reason);
165
+ console.log();
166
+
167
+ // On 'exit' we will delete these files from target directory.
168
+ const knownGeneratedFiles = [
169
+ 'package.json',
170
+ 'node_modules',
171
+ '.vscode',
172
+ 'src',
173
+ '.eslintrc.cjs',
174
+ '.gitignore',
175
+ '.npmrc',
176
+ '.prettierrc',
177
+ 'index.html',
178
+ 'tsconfig.app.json',
179
+ 'tsconfig.json',
180
+ 'tsconfig.node.json',
181
+ 'vite.config.ts',
182
+ ];
183
+ const currentFiles = fs.readdirSync(path.join(root));
184
+ currentFiles.forEach(file => {
185
+ knownGeneratedFiles.forEach(fileToMatch => {
186
+ // This removes all knownGeneratedFiles.
187
+ if (file === fileToMatch) {
188
+ console.log(`Deleting generated file... ${chalk.cyan(file)}`);
189
+ fs.removeSync(path.join(root, file));
190
+ }
191
+ });
192
+ });
193
+ const remainingFiles = fs.readdirSync(path.join(root));
194
+ if (!remainingFiles.length) {
195
+ // Delete target folder if empty
196
+ console.log(`Deleting ${chalk.cyan(`${extensionName}/`)} from ${chalk.cyan(path.resolve(root, '..'))}`);
197
+ process.chdir(path.resolve(root, '..'));
198
+ fs.removeSync(path.join(root));
199
+ }
200
+ console.log('Done.');
201
+ process.exit(1);
202
+ });
203
+ }
204
+
205
+ function installDev(dependencies, verbose) {
206
+ return new Promise((resolve, reject) => {
207
+ const command = 'npm';
208
+ const args = ['install', '--no-audit', '--no-fund', '--save-dev'].concat(dependencies);
209
+
210
+ if (verbose) {
211
+ args.push('--verbose');
212
+ }
213
+
214
+ const child = spawn(command, args, { stdio: 'inherit' });
215
+ child.on('close', code => {
216
+ if (code !== 0) {
217
+ reject({
218
+ command: `${command} ${args.join(' ')}`,
219
+ });
220
+ return;
221
+ }
222
+ resolve();
223
+ });
224
+ });
225
+ }
226
+
227
+ function install(dependencies, verbose) {
228
+ return new Promise((resolve, reject) => {
229
+ const command = 'npm';
230
+ const args = ['install', '--no-audit', '--no-fund', '--save'].concat(dependencies);
231
+
232
+ if (verbose) {
233
+ args.push('--verbose');
234
+ }
235
+
236
+ const child = spawn(command, args, { stdio: 'inherit' });
237
+ child.on('close', code => {
238
+ if (code !== 0) {
239
+ reject({
240
+ command: `${command} ${args.join(' ')}`,
241
+ });
242
+ return;
243
+ }
244
+ resolve();
245
+ });
246
+ });
247
+ }
248
+
249
+ function installDependencies(verbose) {
250
+ return Promise.resolve(
251
+ install(
252
+ [
253
+ '@emotion/react@^11.13.3',
254
+ '@emotion/styled@^11.13.0',
255
+ '@fontsource/roboto@^5.1.0',
256
+ '@kvaser/canking-api',
257
+ '@mui/material@^6.1.3',
258
+ 'fast-deep-equal@^3.1.3',
259
+ 'google-protobuf@^3.21.4',
260
+ 'long@^5.2.3',
261
+ 'react@^18.3.1',
262
+ 'react-dom@^18.3.1',
263
+ 'react-router-dom',
264
+ 'uuid@^10.0.0',
265
+ ],
266
+ verbose,
267
+ ),
268
+ ).then(() =>
269
+ installDev(
270
+ [
271
+ '@types/google-protobuf@^3.15.12',
272
+ '@types/node@^22.7.5',
273
+ '@types/react@^18.3.11',
274
+ '@types/react-dom@^18.3.1',
275
+ '@types/react-router-dom',
276
+ '@types/uuid@^10.0.0',
277
+ '@typescript-eslint/eslint-plugin@^8.9.0',
278
+ '@typescript-eslint/parser@^8.9.0',
279
+ '@vitejs/plugin-react-swc@^3.7.1',
280
+ 'cross-env@^7.0.3',
281
+ 'eslint@^9.12.0',
282
+ 'eslint-config-prettier@^9.1.0',
283
+ 'eslint-plugin-prettier@^5.2.1',
284
+ 'eslint-plugin-react@^7.37.1',
285
+ 'eslint-plugin-react-hooks@^5.0.0',
286
+ 'npm-run-all',
287
+ 'prettier@^3.3.3',
288
+ 'rimraf@^6.0.1',
289
+ 'typescript@^5.6.3',
290
+ 'vite@^5.4.9',
291
+ ],
292
+ verbose,
293
+ ),
294
+ );
295
+ }
296
+
297
+ function checkExtensionName(extensionName) {
298
+ const validationResult = validateProjectName(extensionName);
299
+ if (!validationResult.validForNewPackages) {
300
+ console.error(
301
+ chalk.red(
302
+ `Cannot create a project named ${chalk.green(`"${extensionName}"`)} because of npm naming restrictions:\n`,
303
+ ),
304
+ );
305
+ [...(validationResult.errors || []), ...(validationResult.warnings || [])].forEach(error => {
306
+ console.error(chalk.red(` * ${error}`));
307
+ });
308
+ console.error(chalk.red('\nPlease choose a different project name.'));
309
+ process.exit(1);
310
+ }
311
+ }
312
+
313
+ /**
314
+ * Checks if the destination folder is okay to use.
315
+ * @param root The project root folder
316
+ * @param name The project name
317
+ * @returns true if not conflicts exists
318
+ */
319
+ function isSafeToCreateProjectIn(root, name) {
320
+ const validFiles = [
321
+ '.DS_Store',
322
+ '.git',
323
+ '.gitattributes',
324
+ '.gitignore',
325
+ '.gitlab-ci.yml',
326
+ '.hg',
327
+ '.hgcheck',
328
+ '.hgignore',
329
+ '.idea',
330
+ '.npmignore',
331
+ '.travis.yml',
332
+ 'docs',
333
+ 'LICENSE',
334
+ 'README.md',
335
+ 'mkdocs.yml',
336
+ 'Thumbs.db',
337
+ ];
338
+ // These files should be allowed to remain on a failed install, but then
339
+ // silently removed during the next create.
340
+ const errorLogFilePatterns = ['npm-debug.log'];
341
+ const isErrorLog = file => {
342
+ return errorLogFilePatterns.some(pattern => file.startsWith(pattern));
343
+ };
344
+
345
+ const conflicts = fs
346
+ .readdirSync(root)
347
+ .filter(file => !validFiles.includes(file))
348
+ // Don't treat log files from previous installation as conflicts
349
+ .filter(file => !isErrorLog(file));
350
+
351
+ if (conflicts.length > 0) {
352
+ console.log(`The directory ${chalk.green(name)} contains files that could conflict:`);
353
+ console.log();
354
+ for (const file of conflicts) {
355
+ try {
356
+ const stats = fs.lstatSync(path.join(root, file));
357
+ if (stats.isDirectory()) {
358
+ console.log(` ${chalk.blue(`${file}/`)}`);
359
+ } else {
360
+ console.log(` ${file}`);
361
+ }
362
+ } catch (e) {
363
+ console.log(` ${file}`);
364
+ }
365
+ }
366
+ console.log();
367
+ console.log('Either try using a new directory name, or remove the files listed above.');
368
+
369
+ return false;
370
+ }
371
+
372
+ // Remove any log files from a previous installation.
373
+ fs.readdirSync(root).forEach(file => {
374
+ if (isErrorLog(file)) {
375
+ fs.removeSync(path.join(root, file));
376
+ }
377
+ });
378
+ return true;
379
+ }
380
+
381
+ function checkForLatestVersion() {
382
+ return new Promise((resolve, reject) => {
383
+ https
384
+ .get(`${kvaserRegistry}/-/package/%40kvaser/create-canking-extension/dist-tags`, res => {
385
+ if (res.statusCode === 200) {
386
+ let body = '';
387
+ res.on('data', data => (body += data));
388
+ res.on('end', () => {
389
+ resolve(JSON.parse(body).latest);
390
+ });
391
+ } else {
392
+ reject();
393
+ }
394
+ })
395
+ .on('error', () => {
396
+ reject();
397
+ });
398
+ });
399
+ }
400
+
401
+ module.exports = {
402
+ init,
403
+ };
@@ -0,0 +1,39 @@
1
+ #!/usr/bin/env node
2
+
3
+ 'use strict';
4
+
5
+ const lowestMajorNodeVersion = 18;
6
+ const currentNodeVersion = process.versions.node;
7
+ const semver = currentNodeVersion.split('.');
8
+ const major = semver[0];
9
+
10
+ const chalk = require('chalk');
11
+
12
+ if (major < lowestMajorNodeVersion) {
13
+ console.error(
14
+ chalk.red(
15
+ 'You are running Node ' +
16
+ currentNodeVersion +
17
+ '.\n' +
18
+ `Create CanKing Extension requires Node ${lowestMajorNodeVersion} or higher. \n` +
19
+ 'Please update your version of Node.',
20
+ ),
21
+ );
22
+ process.exit(1);
23
+ }
24
+
25
+ if (process.argv.length === 3 && process.argv[2] === '--show-doc') {
26
+ try {
27
+ (async () => {
28
+ const open = (await import('open')).default;
29
+ const path = require('path');
30
+ const filePath = path.join(__dirname, '../doc/index.html');
31
+ open(filePath);
32
+ })();
33
+ } catch (error) {
34
+ console.error(chalk.red(error));
35
+ }
36
+ } else {
37
+ const { init } = require('./createCanKingExtension');
38
+ init();
39
+ }
@@ -0,0 +1,38 @@
1
+ module.exports = {
2
+ root: true,
3
+ env: { browser: true, es2020: true },
4
+ extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended', 'plugin:react/recommended'],
5
+ ignorePatterns: ['dist', '.eslintrc.cjs'],
6
+ parser: '@typescript-eslint/parser',
7
+ plugins: ['react', 'react-hooks', '@typescript-eslint', 'prettier'],
8
+ rules: {
9
+ 'import/no-extraneous-dependencies': 'off',
10
+ 'react/react-in-jsx-scope': 'off',
11
+ 'react/jsx-filename-extension': 'off',
12
+ 'import/extensions': 'off',
13
+ 'import/no-unresolved': 'off',
14
+ 'import/no-import-module-exports': 'off',
15
+ 'no-shadow': 'off',
16
+ '@typescript-eslint/no-shadow': 'error',
17
+ 'no-unused-vars': 'off',
18
+ '@typescript-eslint/no-unused-vars': 'error',
19
+ 'lines-between-class-members': ['error', 'always', { exceptAfterSingleLine: true }],
20
+ quotes: [2, 'single', { avoidEscape: true }],
21
+ 'react/prop-types': 'off',
22
+ 'react-hooks/rules-of-hooks': 'error',
23
+ 'react-hooks/exhaustive-deps': 'warn',
24
+ 'prettier/prettier': ['error', { endOfLine: 'auto' }],
25
+ },
26
+ settings: {
27
+ react: {
28
+ version: 'detect',
29
+ },
30
+ },
31
+ parserOptions: {
32
+ ecmaVersion: 'latest',
33
+ sourceType: 'module',
34
+ ecmaFeatures: {
35
+ jsx: true,
36
+ },
37
+ },
38
+ };
@@ -0,0 +1,24 @@
1
+ # Logs
2
+ logs
3
+ *.log
4
+ npm-debug.log*
5
+ yarn-debug.log*
6
+ yarn-error.log*
7
+ pnpm-debug.log*
8
+ lerna-debug.log*
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ *.local
14
+
15
+ # Editor directories and files
16
+ .vscode/*
17
+ !.vscode/extensions.json
18
+ .idea
19
+ .DS_Store
20
+ *.suo
21
+ *.ntvs*
22
+ *.njsproj
23
+ *.sln
24
+ *.sw?
@@ -0,0 +1,2 @@
1
+ registry=https://registry.npmjs.com
2
+ @kvaser:registry=http://artifact.kvaser.se/artifactory/api/npm/libs-npm
@@ -0,0 +1,8 @@
1
+ {
2
+ "semi": true,
3
+ "singleQuote": true,
4
+ "printWidth": 120,
5
+ "tabWidth": 2,
6
+ "trailingComma": "all",
7
+ "arrowParens": "avoid"
8
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "name": "Dev Server",
9
+ "type": "node",
10
+ "request": "launch",
11
+ "runtimeExecutable": "npm",
12
+ "runtimeArgs": ["run", "dev"]
13
+ },
14
+ {
15
+ "name": "CanKing",
16
+ "type": "node",
17
+ "request": "launch",
18
+ "runtimeExecutable": "npm",
19
+ "runtimeArgs": ["run", "canking"]
20
+ }
21
+ ],
22
+ "compounds": [
23
+ {
24
+ "name": "Debug",
25
+ "configurations": ["Dev Server", "CanKing"]
26
+ }
27
+ ]
28
+ }
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>CanKing Extension Template</title>
8
+ </head>
9
+
10
+ <body>
11
+ <div id="root"></div>
12
+ <script type="module" src="/src/main.tsx"></script>
13
+ </body>
14
+
15
+ </html>
@@ -0,0 +1,27 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "target": "ES2020",
6
+ "useDefineForClassFields": true,
7
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
+ "module": "ESNext",
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "moduleDetection": "force",
17
+ "noEmit": true,
18
+ "jsx": "react-jsx",
19
+
20
+ /* Linting */
21
+ "strict": true,
22
+ "noUnusedLocals": true,
23
+ "noUnusedParameters": true,
24
+ "noFallthroughCasesInSwitch": true
25
+ },
26
+ "include": ["src"]
27
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.app.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.node.json"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
+ "skipLibCheck": true,
6
+ "module": "ESNext",
7
+ "moduleResolution": "bundler",
8
+ "allowSyntheticDefaultImports": true,
9
+ "strict": true,
10
+ "noEmit": true
11
+ },
12
+ "include": ["vite.config.ts"]
13
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react-swc';
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ });
@@ -0,0 +1,12 @@
1
+ import { CanKingDataProvider } from '@kvaser/canking-api/controls';
2
+ import WorkspaceView from './WorkspaceView';
3
+
4
+ function App() {
5
+ return (
6
+ <CanKingDataProvider>
7
+ <WorkspaceView />
8
+ </CanKingDataProvider>
9
+ );
10
+ }
11
+
12
+ export default App;
@@ -0,0 +1,47 @@
1
+ import { useSearchParams } from 'react-router-dom';
2
+ import { useProjectData } from '@kvaser/canking-api/hooks';
3
+ import { CanChannelSelectControl } from '@kvaser/canking-api/controls';
4
+ import { Box } from '@mui/material';
5
+
6
+ // If any data should be stored in the project file then add it to this interface
7
+ interface IProjectViewData {
8
+ // This is an example showing how to store the selected channel id to the project file
9
+ channelId: string;
10
+ }
11
+
12
+ // Define any default values for the project data that will be used when the component is created
13
+ const defaultProjectViewData: IProjectViewData = {
14
+ channelId: '',
15
+ };
16
+
17
+ // This component is the component that will be loaded into the Workspace view
18
+ function WorkspaceView() {
19
+ // Get this view's unique id from search params
20
+ const [searchParams] = useSearchParams();
21
+ const idString = searchParams.get('id');
22
+ const id = idString !== null ? Number.parseInt(idString, 10) : -1;
23
+
24
+ // Use the useProjectData hook to serialize/deserialize your view data to the project
25
+ const { projectData, setProjectData } = useProjectData<IProjectViewData>(id, defaultProjectViewData);
26
+
27
+ // A callback that will get the new selected channel id and save it to the project data
28
+ const onChannelIdentifierChange = (channelId: string) => {
29
+ const data = { ...projectData };
30
+ data.channelId = channelId;
31
+ setProjectData(data);
32
+ };
33
+
34
+ return (
35
+ <Box aria-label="can-channel-select-extension-view">
36
+ <div>Add your elements here!</div>
37
+ <div>This is an example how to use the CanChannelSelectControl:</div>
38
+ <CanChannelSelectControl
39
+ channelIdentifier={projectData.channelId}
40
+ onChannelIdentifierChange={onChannelIdentifierChange}
41
+ hideSectionControl
42
+ />
43
+ </Box>
44
+ );
45
+ }
46
+
47
+ export default WorkspaceView;