@dronedeploy/rocos-js-sdk 3.0.1-alpha.9 → 3.0.2

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 (373) hide show
  1. package/README.md +59 -29
  2. package/cjs/IRocosSDK.d.ts +4 -3
  3. package/cjs/RocosSDK.d.ts +19 -7
  4. package/cjs/RocosSDK.js +31 -10
  5. package/cjs/api/streams/caller/CallerStream.js +5 -2
  6. package/cjs/api/streams/caller/CallerStreamNode.js +2 -1
  7. package/cjs/api/streams/command/CommandStream.js +5 -2
  8. package/cjs/api/streams/command/CommandStreamNode.js +2 -1
  9. package/cjs/api/streams/control/ControlStream.js +5 -2
  10. package/cjs/api/streams/control/ControlStreamAbstract.d.ts +1 -1
  11. package/cjs/api/streams/control/ControlStreamNode.js +2 -1
  12. package/cjs/api/streams/fileAccessor/FileAccessorStream.js +4 -1
  13. package/cjs/api/streams/fileAccessor/FileAccessorStreamNode.js +3 -1
  14. package/cjs/api/streams/search/SearchStream.js +5 -2
  15. package/cjs/api/streams/search/SearchStreamNode.js +2 -1
  16. package/cjs/api/streams/telemetry/TelemetryStream.js +4 -1
  17. package/cjs/api/streams/telemetry/TelemetryStreamAbstract.d.ts +1 -1
  18. package/cjs/api/streams/telemetry/TelemetryStreamNode.js +2 -1
  19. package/cjs/api/streams/webRTCSignalling/WebRTCSignallingStream.js +5 -2
  20. package/cjs/constants/api.d.ts +31 -15
  21. package/cjs/constants/api.js +35 -18
  22. package/cjs/helpers/cleanObject.js +4 -1
  23. package/cjs/helpers/getUniqueConfigKey.d.ts +6 -2
  24. package/cjs/helpers/getUniqueConfigKey.js +7 -2
  25. package/cjs/helpers/index.d.ts +1 -0
  26. package/cjs/helpers/index.js +1 -0
  27. package/cjs/helpers/kscript/Context.d.ts +34 -0
  28. package/cjs/helpers/kscript/Context.js +52 -0
  29. package/cjs/helpers/kscript/index.d.ts +1 -0
  30. package/cjs/helpers/kscript/index.js +27 -0
  31. package/cjs/helpers/kscript/kscript.d.ts +6 -0
  32. package/cjs/helpers/kscript/kscript.js +115 -0
  33. package/cjs/helpers/kscript/nodes/Identifier.d.ts +12 -0
  34. package/cjs/helpers/kscript/nodes/Identifier.js +20 -0
  35. package/cjs/helpers/kscript/nodes/Literal.d.ts +11 -0
  36. package/cjs/helpers/kscript/nodes/Literal.js +22 -0
  37. package/cjs/helpers/kscript/nodes/Node.d.ts +9 -0
  38. package/cjs/helpers/kscript/nodes/Node.js +15 -0
  39. package/cjs/helpers/kscript/nodes/Program.d.ts +11 -0
  40. package/cjs/helpers/kscript/nodes/Program.js +24 -0
  41. package/cjs/helpers/kscript/nodes/TemplateLiteral.d.ts +23 -0
  42. package/cjs/helpers/kscript/nodes/TemplateLiteral.js +35 -0
  43. package/cjs/helpers/kscript/nodes/expressions/ArrayExpression.d.ts +7 -0
  44. package/cjs/helpers/kscript/nodes/expressions/ArrayExpression.js +31 -0
  45. package/cjs/helpers/kscript/nodes/expressions/ArrowFunctionExpression.d.ts +14 -0
  46. package/cjs/helpers/kscript/nodes/expressions/ArrowFunctionExpression.js +40 -0
  47. package/cjs/helpers/kscript/nodes/expressions/BinaryExpression.d.ts +16 -0
  48. package/cjs/helpers/kscript/nodes/expressions/BinaryExpression.js +104 -0
  49. package/cjs/helpers/kscript/nodes/expressions/CallExpression.d.ts +8 -0
  50. package/cjs/helpers/kscript/nodes/expressions/CallExpression.js +38 -0
  51. package/cjs/helpers/kscript/nodes/expressions/ChainExpression.d.ts +16 -0
  52. package/cjs/helpers/kscript/nodes/expressions/ChainExpression.js +25 -0
  53. package/cjs/helpers/kscript/nodes/expressions/ConditionalExpression.d.ts +14 -0
  54. package/cjs/helpers/kscript/nodes/expressions/ConditionalExpression.js +30 -0
  55. package/cjs/helpers/kscript/nodes/expressions/ExpressionStatement.d.ts +7 -0
  56. package/cjs/helpers/kscript/nodes/expressions/ExpressionStatement.js +18 -0
  57. package/cjs/helpers/kscript/nodes/expressions/LogicalExpression.d.ts +10 -0
  58. package/cjs/helpers/kscript/nodes/expressions/LogicalExpression.js +47 -0
  59. package/cjs/helpers/kscript/nodes/expressions/MemberExpression.d.ts +44 -0
  60. package/cjs/helpers/kscript/nodes/expressions/MemberExpression.js +98 -0
  61. package/cjs/helpers/kscript/nodes/expressions/ObjectExpression.d.ts +11 -0
  62. package/cjs/helpers/kscript/nodes/expressions/ObjectExpression.js +59 -0
  63. package/cjs/helpers/kscript/nodes/expressions/UnaryExpression.d.ts +12 -0
  64. package/cjs/helpers/kscript/nodes/expressions/UnaryExpression.js +44 -0
  65. package/cjs/helpers/kscript/nodes/expressions/index.d.ts +11 -0
  66. package/cjs/helpers/kscript/nodes/expressions/index.js +28 -0
  67. package/cjs/helpers/kscript/nodes/index.d.ts +4 -0
  68. package/cjs/helpers/kscript/nodes/index.js +10 -0
  69. package/cjs/helpers/kscript/nodes/nodeTypes.d.ts +33 -0
  70. package/cjs/helpers/kscript/nodes/nodeTypes.js +29 -0
  71. package/cjs/helpers/kscript/utils.d.ts +4 -0
  72. package/cjs/helpers/kscript/utils.js +15 -0
  73. package/cjs/helpers/websandbox/connection.d.ts +2 -1
  74. package/cjs/helpers/websandbox/connection.js +6 -5
  75. package/cjs/helpers/websandbox/frame/frame.js +4 -1
  76. package/cjs/helpers/websandbox/frame/frame.source.js +1 -1
  77. package/cjs/helpers/websandbox/frame/worker/manager.d.ts +8 -4
  78. package/cjs/helpers/websandbox/frame/worker/manager.js +32 -14
  79. package/cjs/helpers/websandbox/frame/worker/worker.source.js +1 -1
  80. package/cjs/helpers/websandbox/sandbox.d.ts +1 -1
  81. package/cjs/helpers/websandbox/sandbox.js +7 -7
  82. package/cjs/models/IConnectedCallsign.d.ts +10 -0
  83. package/cjs/models/IConnectedCallsign.js +8 -0
  84. package/cjs/models/RocosError.d.ts +3 -0
  85. package/cjs/models/RocosError.js +3 -0
  86. package/cjs/models/ServiceEnum.d.ts +20 -17
  87. package/cjs/models/ServiceEnum.js +20 -17
  88. package/cjs/models/TelemetryStatus.d.ts +12 -0
  89. package/cjs/models/TelemetryStatus.js +17 -0
  90. package/cjs/models/Token.d.ts +2 -2
  91. package/cjs/models/Token.js +5 -5
  92. package/cjs/models/asset-storage/{AssetModelItem.d.ts → AssetItem.d.ts} +2 -0
  93. package/cjs/models/device-credentials/DeviceCredentials.d.ts +61 -0
  94. package/cjs/models/device-credentials/DeviceCredentials.js +2 -0
  95. package/cjs/models/graph/Position.d.ts +6 -0
  96. package/cjs/models/graph/Position.js +2 -0
  97. package/cjs/models/graph/Quaternion.d.ts +6 -0
  98. package/cjs/models/graph/Quaternion.js +2 -0
  99. package/cjs/models/graph/Vector3.d.ts +5 -0
  100. package/cjs/models/graph/Vector3.js +2 -0
  101. package/cjs/models/graph/index.d.ts +3 -0
  102. package/cjs/models/graph/index.js +19 -0
  103. package/cjs/models/index.d.ts +9 -2
  104. package/cjs/models/index.js +9 -2
  105. package/cjs/models/integrations/Location.d.ts +24 -0
  106. package/cjs/models/integrations/Location.js +2 -0
  107. package/cjs/models/integrations/PaginatedResults.d.ts +4 -0
  108. package/cjs/models/integrations/PaginatedResults.js +2 -0
  109. package/cjs/models/maps/Panorama.d.ts +12 -21
  110. package/cjs/models/projects/ExternalProject.d.ts +10 -0
  111. package/cjs/models/projects/ExternalProject.js +2 -0
  112. package/cjs/models/projects/NewProjectRequest.d.ts +8 -0
  113. package/cjs/models/projects/NewProjectRequest.js +2 -0
  114. package/cjs/models/target/Target.d.ts +30 -0
  115. package/cjs/models/target/Target.js +15 -0
  116. package/cjs/node/RocosSDKNode.d.ts +1 -5
  117. package/cjs/node/RocosSDKNode.js +9 -9
  118. package/cjs/services/AssetStorageService.d.ts +9 -1
  119. package/cjs/services/AssetStorageService.js +12 -1
  120. package/cjs/services/AuthService.d.ts +12 -1
  121. package/cjs/services/AuthService.js +25 -1
  122. package/cjs/services/DeviceCredentialsService.d.ts +15 -0
  123. package/cjs/services/DeviceCredentialsService.js +56 -0
  124. package/cjs/services/EnvironmentService.d.ts +34 -0
  125. package/cjs/services/EnvironmentService.js +56 -0
  126. package/cjs/services/EvaluatorService.js +1 -1
  127. package/cjs/services/IntegrationService.d.ts +7 -1
  128. package/cjs/services/IntegrationService.js +8 -0
  129. package/cjs/services/MapService.d.ts +18 -8
  130. package/cjs/services/MapService.js +37 -19
  131. package/cjs/services/ProfileService.d.ts +24 -0
  132. package/cjs/services/ProfileService.js +34 -0
  133. package/cjs/services/ProjectService.d.ts +7 -2
  134. package/cjs/services/ProjectService.js +7 -3
  135. package/cjs/services/RTPWebRTCService.d.ts +6 -1
  136. package/cjs/services/RTPWebRTCService.js +10 -2
  137. package/cjs/services/RobotService.d.ts +3 -1
  138. package/cjs/services/RobotService.js +6 -0
  139. package/cjs/services/SpotProvisioningService.d.ts +1 -1
  140. package/cjs/services/SpotProvisioningServiceNode.d.ts +1 -1
  141. package/cjs/services/TargetService.d.ts +17 -0
  142. package/cjs/services/TargetService.js +66 -0
  143. package/cjs/services/TelemetryService.d.ts +10 -1
  144. package/cjs/services/TelemetryService.js +27 -5
  145. package/cjs/services/WorkflowService.d.ts +18 -8
  146. package/cjs/services/WorkflowService.js +37 -11
  147. package/cjs/services/index.d.ts +11 -9
  148. package/cjs/services/index.js +11 -9
  149. package/cjs/store/RocosStore.d.ts +1 -2
  150. package/esm/IRocosSDK.d.ts +4 -3
  151. package/esm/RocosSDK.d.ts +19 -7
  152. package/esm/RocosSDK.js +32 -11
  153. package/esm/api/streams/caller/CallerStream.js +5 -2
  154. package/esm/api/streams/caller/CallerStreamNode.js +2 -1
  155. package/esm/api/streams/command/CommandStream.js +5 -2
  156. package/esm/api/streams/command/CommandStreamNode.js +2 -1
  157. package/esm/api/streams/control/ControlStream.js +5 -2
  158. package/esm/api/streams/control/ControlStreamAbstract.d.ts +1 -1
  159. package/esm/api/streams/control/ControlStreamNode.js +2 -1
  160. package/esm/api/streams/fileAccessor/FileAccessorStream.js +4 -1
  161. package/esm/api/streams/fileAccessor/FileAccessorStreamNode.js +3 -1
  162. package/esm/api/streams/search/SearchStream.js +5 -2
  163. package/esm/api/streams/search/SearchStreamNode.js +2 -1
  164. package/esm/api/streams/telemetry/TelemetryStream.js +4 -1
  165. package/esm/api/streams/telemetry/TelemetryStreamAbstract.d.ts +1 -1
  166. package/esm/api/streams/telemetry/TelemetryStreamNode.js +2 -1
  167. package/esm/api/streams/webRTCSignalling/WebRTCSignallingStream.js +5 -2
  168. package/esm/constants/api.d.ts +31 -15
  169. package/esm/constants/api.js +31 -15
  170. package/esm/helpers/cleanObject.js +4 -1
  171. package/esm/helpers/getUniqueConfigKey.d.ts +6 -2
  172. package/esm/helpers/getUniqueConfigKey.js +7 -2
  173. package/esm/helpers/index.d.ts +1 -0
  174. package/esm/helpers/index.js +1 -0
  175. package/esm/helpers/kscript/Context.d.ts +34 -0
  176. package/esm/helpers/kscript/Context.js +49 -0
  177. package/esm/helpers/kscript/index.d.ts +1 -0
  178. package/esm/helpers/kscript/index.js +1 -0
  179. package/esm/helpers/kscript/kscript.d.ts +6 -0
  180. package/esm/helpers/kscript/kscript.js +107 -0
  181. package/esm/helpers/kscript/nodes/Identifier.d.ts +12 -0
  182. package/esm/helpers/kscript/nodes/Identifier.js +14 -0
  183. package/esm/helpers/kscript/nodes/Literal.d.ts +11 -0
  184. package/esm/helpers/kscript/nodes/Literal.js +16 -0
  185. package/esm/helpers/kscript/nodes/Node.d.ts +9 -0
  186. package/esm/helpers/kscript/nodes/Node.js +12 -0
  187. package/esm/helpers/kscript/nodes/Program.d.ts +11 -0
  188. package/esm/helpers/kscript/nodes/Program.js +18 -0
  189. package/esm/helpers/kscript/nodes/TemplateLiteral.d.ts +23 -0
  190. package/esm/helpers/kscript/nodes/TemplateLiteral.js +29 -0
  191. package/esm/helpers/kscript/nodes/expressions/ArrayExpression.d.ts +7 -0
  192. package/esm/helpers/kscript/nodes/expressions/ArrayExpression.js +25 -0
  193. package/esm/helpers/kscript/nodes/expressions/ArrowFunctionExpression.d.ts +14 -0
  194. package/esm/helpers/kscript/nodes/expressions/ArrowFunctionExpression.js +34 -0
  195. package/esm/helpers/kscript/nodes/expressions/BinaryExpression.d.ts +16 -0
  196. package/esm/helpers/kscript/nodes/expressions/BinaryExpression.js +98 -0
  197. package/esm/helpers/kscript/nodes/expressions/CallExpression.d.ts +8 -0
  198. package/esm/helpers/kscript/nodes/expressions/CallExpression.js +32 -0
  199. package/esm/helpers/kscript/nodes/expressions/ChainExpression.d.ts +16 -0
  200. package/esm/helpers/kscript/nodes/expressions/ChainExpression.js +19 -0
  201. package/esm/helpers/kscript/nodes/expressions/ConditionalExpression.d.ts +14 -0
  202. package/esm/helpers/kscript/nodes/expressions/ConditionalExpression.js +24 -0
  203. package/esm/helpers/kscript/nodes/expressions/ExpressionStatement.d.ts +7 -0
  204. package/esm/helpers/kscript/nodes/expressions/ExpressionStatement.js +12 -0
  205. package/esm/helpers/kscript/nodes/expressions/LogicalExpression.d.ts +10 -0
  206. package/esm/helpers/kscript/nodes/expressions/LogicalExpression.js +41 -0
  207. package/esm/helpers/kscript/nodes/expressions/MemberExpression.d.ts +44 -0
  208. package/esm/helpers/kscript/nodes/expressions/MemberExpression.js +92 -0
  209. package/esm/helpers/kscript/nodes/expressions/ObjectExpression.d.ts +11 -0
  210. package/esm/helpers/kscript/nodes/expressions/ObjectExpression.js +53 -0
  211. package/esm/helpers/kscript/nodes/expressions/UnaryExpression.d.ts +12 -0
  212. package/esm/helpers/kscript/nodes/expressions/UnaryExpression.js +38 -0
  213. package/esm/helpers/kscript/nodes/expressions/index.d.ts +11 -0
  214. package/esm/helpers/kscript/nodes/expressions/index.js +11 -0
  215. package/esm/helpers/kscript/nodes/index.d.ts +4 -0
  216. package/esm/helpers/kscript/nodes/index.js +3 -0
  217. package/esm/helpers/kscript/nodes/nodeTypes.d.ts +33 -0
  218. package/esm/helpers/kscript/nodes/nodeTypes.js +24 -0
  219. package/esm/helpers/kscript/utils.d.ts +4 -0
  220. package/esm/helpers/kscript/utils.js +11 -0
  221. package/esm/helpers/websandbox/connection.d.ts +2 -1
  222. package/esm/helpers/websandbox/connection.js +6 -5
  223. package/esm/helpers/websandbox/frame/frame.js +4 -1
  224. package/esm/helpers/websandbox/frame/frame.source.js +1 -1
  225. package/esm/helpers/websandbox/frame/worker/manager.d.ts +8 -4
  226. package/esm/helpers/websandbox/frame/worker/manager.js +32 -14
  227. package/esm/helpers/websandbox/frame/worker/worker.source.js +1 -1
  228. package/esm/helpers/websandbox/sandbox.d.ts +1 -1
  229. package/esm/helpers/websandbox/sandbox.js +7 -7
  230. package/esm/models/IConnectedCallsign.d.ts +10 -0
  231. package/esm/models/IConnectedCallsign.js +5 -0
  232. package/esm/models/RocosError.d.ts +3 -0
  233. package/esm/models/RocosError.js +3 -0
  234. package/esm/models/ServiceEnum.d.ts +20 -17
  235. package/esm/models/ServiceEnum.js +20 -17
  236. package/esm/models/TelemetryStatus.d.ts +12 -0
  237. package/esm/models/TelemetryStatus.js +14 -0
  238. package/esm/models/Token.d.ts +2 -2
  239. package/esm/models/Token.js +5 -5
  240. package/esm/models/asset-storage/{AssetModelItem.d.ts → AssetItem.d.ts} +2 -0
  241. package/esm/models/device-credentials/DeviceCredentials.d.ts +61 -0
  242. package/esm/models/graph/Position.d.ts +6 -0
  243. package/esm/models/graph/Quaternion.d.ts +6 -0
  244. package/esm/models/graph/Vector3.d.ts +5 -0
  245. package/esm/models/graph/index.d.ts +3 -0
  246. package/esm/models/graph/index.js +3 -0
  247. package/esm/models/index.d.ts +9 -2
  248. package/esm/models/index.js +9 -2
  249. package/esm/models/integrations/Location.d.ts +24 -0
  250. package/esm/models/integrations/PaginatedResults.d.ts +4 -0
  251. package/esm/models/maps/Panorama.d.ts +12 -21
  252. package/esm/models/projects/ExternalProject.d.ts +10 -0
  253. package/esm/models/projects/NewProjectRequest.d.ts +8 -0
  254. package/esm/models/target/Target.d.ts +30 -0
  255. package/esm/models/target/Target.js +9 -0
  256. package/esm/node/RocosSDKNode.d.ts +1 -5
  257. package/esm/node/RocosSDKNode.js +10 -10
  258. package/esm/services/AssetStorageService.d.ts +9 -1
  259. package/esm/services/AssetStorageService.js +13 -2
  260. package/esm/services/AuthService.d.ts +12 -1
  261. package/esm/services/AuthService.js +25 -1
  262. package/esm/services/BaseServiceAbstract.js +1 -1
  263. package/esm/services/DeviceCredentialsService.d.ts +15 -0
  264. package/esm/services/DeviceCredentialsService.js +52 -0
  265. package/esm/services/EnvironmentService.d.ts +34 -0
  266. package/esm/services/EnvironmentService.js +52 -0
  267. package/esm/services/EvaluatorService.js +1 -1
  268. package/esm/services/IntegrationService.d.ts +7 -1
  269. package/esm/services/IntegrationService.js +10 -2
  270. package/esm/services/MapService.d.ts +18 -8
  271. package/esm/services/MapService.js +38 -20
  272. package/esm/services/ProfileService.d.ts +24 -0
  273. package/esm/services/ProfileService.js +35 -1
  274. package/esm/services/ProjectService.d.ts +7 -2
  275. package/esm/services/ProjectService.js +9 -5
  276. package/esm/services/RTPWebRTCService.d.ts +6 -1
  277. package/esm/services/RTPWebRTCService.js +10 -2
  278. package/esm/services/RobotService.d.ts +3 -1
  279. package/esm/services/RobotService.js +8 -2
  280. package/esm/services/SpotProvisioningService.d.ts +1 -1
  281. package/esm/services/SpotProvisioningServiceNode.d.ts +1 -1
  282. package/esm/services/TargetService.d.ts +17 -0
  283. package/esm/services/TargetService.js +62 -0
  284. package/esm/services/TelemetryService.d.ts +10 -1
  285. package/esm/services/TelemetryService.js +28 -6
  286. package/esm/services/WorkflowService.d.ts +18 -8
  287. package/esm/services/WorkflowService.js +38 -12
  288. package/esm/services/index.d.ts +11 -9
  289. package/esm/services/index.js +11 -9
  290. package/esm/store/RocosStore.d.ts +1 -2
  291. package/package.json +2 -2
  292. package/cjs/helpers/cleanObject.spec.js +0 -55
  293. package/cjs/helpers/flattenObject.spec.js +0 -31
  294. package/cjs/helpers/flattenOneOf.spec.js +0 -159
  295. package/cjs/helpers/formatServiceUrl.spec.js +0 -18
  296. package/cjs/helpers/getSha256Hex.spec.js +0 -19
  297. package/cjs/helpers/getSha256HexNode.spec.js +0 -10
  298. package/cjs/helpers/getURLSearchParams.spec.js +0 -21
  299. package/cjs/helpers/nanosecondToMillisecond.spec.js +0 -22
  300. package/cjs/helpers/splitRobotTopic.spec.js +0 -53
  301. package/cjs/helpers/standardDeviation.spec.d.ts +0 -1
  302. package/cjs/helpers/standardDeviation.spec.js +0 -13
  303. package/cjs/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
  304. package/cjs/helpers/websandbox/frame/worker/manager.spec.js +0 -132
  305. package/cjs/models/CallsignStatus.d.ts +0 -6
  306. package/cjs/models/CallsignStatus.js +0 -10
  307. package/cjs/models/ExternalProject.d.ts +0 -6
  308. package/cjs/models/ExternalProject.js +0 -6
  309. package/cjs/models/Token.spec.d.ts +0 -1
  310. package/cjs/models/Token.spec.js +0 -110
  311. package/cjs/services/AuthService.spec.d.ts +0 -1
  312. package/cjs/services/AuthService.spec.js +0 -165
  313. package/cjs/services/CallerService.spec.d.ts +0 -1
  314. package/cjs/services/CallerService.spec.js +0 -229
  315. package/cjs/services/FunctionService.d.ts +0 -68
  316. package/cjs/services/FunctionService.js +0 -103
  317. package/cjs/services/PlatformTimeService.spec.d.ts +0 -1
  318. package/cjs/services/PlatformTimeService.spec.js +0 -182
  319. package/cjs/services/RTPWebRTCService.spec.d.ts +0 -4
  320. package/cjs/services/RTPWebRTCService.spec.js +0 -171
  321. package/cjs/services/TelemetryService.spec.d.ts +0 -1
  322. package/cjs/services/TelemetryService.spec.js +0 -39
  323. package/esm/helpers/cleanObject.spec.d.ts +0 -1
  324. package/esm/helpers/cleanObject.spec.js +0 -53
  325. package/esm/helpers/flattenObject.spec.d.ts +0 -1
  326. package/esm/helpers/flattenObject.spec.js +0 -29
  327. package/esm/helpers/flattenOneOf.spec.d.ts +0 -1
  328. package/esm/helpers/flattenOneOf.spec.js +0 -157
  329. package/esm/helpers/formatServiceUrl.spec.d.ts +0 -1
  330. package/esm/helpers/formatServiceUrl.spec.js +0 -16
  331. package/esm/helpers/getSha256Hex.spec.d.ts +0 -1
  332. package/esm/helpers/getSha256Hex.spec.js +0 -14
  333. package/esm/helpers/getSha256HexNode.spec.d.ts +0 -1
  334. package/esm/helpers/getSha256HexNode.spec.js +0 -8
  335. package/esm/helpers/getURLSearchParams.spec.d.ts +0 -1
  336. package/esm/helpers/getURLSearchParams.spec.js +0 -19
  337. package/esm/helpers/nanosecondToMillisecond.spec.d.ts +0 -1
  338. package/esm/helpers/nanosecondToMillisecond.spec.js +0 -20
  339. package/esm/helpers/splitRobotTopic.spec.d.ts +0 -1
  340. package/esm/helpers/splitRobotTopic.spec.js +0 -51
  341. package/esm/helpers/standardDeviation.spec.d.ts +0 -1
  342. package/esm/helpers/standardDeviation.spec.js +0 -11
  343. package/esm/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
  344. package/esm/helpers/websandbox/frame/worker/manager.spec.js +0 -127
  345. package/esm/models/CallsignStatus.d.ts +0 -6
  346. package/esm/models/CallsignStatus.js +0 -7
  347. package/esm/models/ExternalProject.d.ts +0 -6
  348. package/esm/models/ExternalProject.js +0 -2
  349. package/esm/models/Token.spec.d.ts +0 -1
  350. package/esm/models/Token.spec.js +0 -108
  351. package/esm/models/asset-storage/AssetModelItem.js +0 -1
  352. package/esm/services/AuthService.spec.d.ts +0 -1
  353. package/esm/services/AuthService.spec.js +0 -163
  354. package/esm/services/CallerService.spec.d.ts +0 -1
  355. package/esm/services/CallerService.spec.js +0 -227
  356. package/esm/services/FunctionService.d.ts +0 -68
  357. package/esm/services/FunctionService.js +0 -99
  358. package/esm/services/PlatformTimeService.spec.d.ts +0 -1
  359. package/esm/services/PlatformTimeService.spec.js +0 -180
  360. package/esm/services/RTPWebRTCService.spec.d.ts +0 -4
  361. package/esm/services/RTPWebRTCService.spec.js +0 -169
  362. package/esm/services/TelemetryService.spec.d.ts +0 -1
  363. package/esm/services/TelemetryService.spec.js +0 -37
  364. /package/cjs/models/asset-storage/{AssetModelItem.js → AssetItem.js} +0 -0
  365. /package/{cjs/helpers/cleanObject.spec.d.ts → esm/models/asset-storage/AssetItem.js} +0 -0
  366. /package/{cjs/helpers/flattenObject.spec.d.ts → esm/models/device-credentials/DeviceCredentials.js} +0 -0
  367. /package/{cjs/helpers/flattenOneOf.spec.d.ts → esm/models/graph/Position.js} +0 -0
  368. /package/{cjs/helpers/formatServiceUrl.spec.d.ts → esm/models/graph/Quaternion.js} +0 -0
  369. /package/{cjs/helpers/getSha256Hex.spec.d.ts → esm/models/graph/Vector3.js} +0 -0
  370. /package/{cjs/helpers/getSha256HexNode.spec.d.ts → esm/models/integrations/Location.js} +0 -0
  371. /package/{cjs/helpers/getURLSearchParams.spec.d.ts → esm/models/integrations/PaginatedResults.js} +0 -0
  372. /package/{cjs/helpers/nanosecondToMillisecond.spec.d.ts → esm/models/projects/ExternalProject.js} +0 -0
  373. /package/{cjs/helpers/splitRobotTopic.spec.d.ts → esm/models/projects/NewProjectRequest.js} +0 -0
@@ -48,7 +48,10 @@ export class FileAccessorStream extends FileAccessorStreamAbstract {
48
48
  throw new Error('Error in serverReqOp call');
49
49
  }
50
50
  getMetadata(projectId, callsign) {
51
- const result = { authorization: this.token };
51
+ const result = {};
52
+ if (this.token) {
53
+ result.authorization = this.token;
54
+ }
52
55
  if (projectId) {
53
56
  result['r-p'] = projectId;
54
57
  }
@@ -54,7 +54,9 @@ export class FileAccessorStreamNode extends FileAccessorStreamAbstract {
54
54
  }
55
55
  getMetadata(projectId, callsign) {
56
56
  const meta = new grpc.Metadata();
57
- meta.add('authorization', this.token);
57
+ if (this.token) {
58
+ meta.add('authorization', this.token);
59
+ }
58
60
  if (projectId) {
59
61
  meta.add('r-p', projectId);
60
62
  }
@@ -89,9 +89,12 @@ export class SearchStream extends SearchStreamAbstract {
89
89
  return response;
90
90
  }
91
91
  getMetadata(projectId) {
92
- return {
93
- 'authorization': this.token,
92
+ const meta = {
94
93
  'r-p': projectId,
95
94
  };
95
+ if (this.token) {
96
+ meta.authorization = this.token;
97
+ }
98
+ return meta;
96
99
  }
97
100
  }
@@ -111,8 +111,9 @@ export class SearchStreamNode extends SearchStreamAbstract {
111
111
  }
112
112
  getMetadata(projectId) {
113
113
  const meta = new grpc.Metadata();
114
- meta.add('authorization', this.token);
115
114
  meta.add('r-p', projectId);
115
+ if (this.token)
116
+ meta.add('authorization', this.token);
116
117
  return meta;
117
118
  }
118
119
  }
@@ -62,7 +62,10 @@ export class TelemetryStream extends TelemetryStreamAbstract {
62
62
  }
63
63
  }
64
64
  getMetadata(projectId) {
65
- const result = { authorization: this.token };
65
+ const result = {};
66
+ if (this.token) {
67
+ result.authorization = this.token;
68
+ }
66
69
  if (projectId) {
67
70
  result['r-p'] = projectId;
68
71
  }
@@ -11,7 +11,7 @@ export declare abstract class TelemetryStreamAbstract implements ITelemetryStrea
11
11
  protected projectId: string;
12
12
  private callsignsLookup;
13
13
  private sources;
14
- protected token: string;
14
+ protected token?: string;
15
15
  private scope;
16
16
  protected url: string;
17
17
  private timerIntervalInSec;
@@ -103,10 +103,11 @@ export class TelemetryStreamNode extends TelemetryStreamAbstract {
103
103
  }
104
104
  getMetaData() {
105
105
  const meta = new grpc.Metadata();
106
- meta.add('authorization', this.token);
107
106
  meta.add('r-p', this.projectId);
108
107
  meta.add('r-tid', uuid4());
109
108
  meta.add('r-cs', 'rocos-js-sdk-agent');
109
+ if (this.token)
110
+ meta.add('authorization', this.token);
110
111
  return meta;
111
112
  }
112
113
  requestTelemetry(req) {
@@ -77,9 +77,12 @@ export class WebRTCSignallingStream extends WebRTCSignallingStreamAbstract {
77
77
  return this.webRTCOperatorclient.addIceCandidate(request, { meta: metadata }).response;
78
78
  }
79
79
  getMetadata(projectId) {
80
- return {
81
- 'authorization': this.token,
80
+ const meta = {
82
81
  'r-p': projectId,
83
82
  };
83
+ if (this.token) {
84
+ meta.authorization = this.token;
85
+ }
86
+ return meta;
84
87
  }
85
88
  }
@@ -28,6 +28,7 @@ export declare const API_ACCOUNT_PROJECT_USER_URL = "https://{url}/accounts/{acc
28
28
  export declare const API_ACCOUNT_PROJECT_USER_ID_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/users/{userId}";
29
29
  export declare const API_ACCOUNT_PROJECT_APPLICATION_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/applications";
30
30
  export declare const API_ACCOUNT_PROJECT_APPLICATION_ID_URL = "https://{url}/accounts/{accountId}/projects/{projectId}/applications/{applicationId}";
31
+ export declare const API_ACCOUNT_EXTERNAL_PROJECTS_URL = "https://{url}/accounts/{accountId}/external-projects";
31
32
  export declare const API_PROJECT_URL = "https://{url}/projects";
32
33
  export declare const API_PROJECT_ID_URL = "https://{url}/projects/{projectId}";
33
34
  export declare const API_PROJECT_USERS_URL = "https://{url}/projects/{projectId}/users";
@@ -43,6 +44,7 @@ export declare const API_PROJECT_FLOW_ASSET_PATH_URL = "https://{url}/projects/{
43
44
  export declare const API_PROJECT_MISSION_ASSETS_PATH_URL = "https://{url}/projects/{projectId}/missionassets";
44
45
  export declare const API_PROJECT_MISSION_ASSET_PATH_URL = "https://{url}/projects/{projectId}/missionassets/{assetId}";
45
46
  export declare const API_PROJECT_MAPPED_ASSETS_PATH_URL = "https://{url}/projects/{projectId}/mappedassets";
47
+ export declare const API_PROJECT_MAPPED_ASSET_PATH_URL = "https://{url}/projects/{projectId}/mappedassets/{assetId}";
46
48
  export declare const API_PROJECT_ROBOT_URL = "https://{url}/projects/{projectId}/robots";
47
49
  export declare const API_PROJECT_ROBOT_ID_URL = "https://{url}/projects/{projectId}/robots/{callsign}";
48
50
  export declare const API_PROJECT_ROBOT_ATTRIBUTES_URL = "https://{url}/projects/{projectId}/robots/{callsign}/attributes";
@@ -57,6 +59,8 @@ export declare const API_PROJECT_ROBOT_COMMAND2_URL = "https://{url}/projects/{p
57
59
  export declare const API_PROJECT_ROBOT_BUTTON_URL = "https://{url}/projects/{projectId}/robots/{callsign}/buttons";
58
60
  export declare const API_PROJECT_ROBOT_TRIGGER_URL = "https://{url}/projects/{projectId}/robots/{callsign}/triggers";
59
61
  export declare const API_PROJECT_ROBOT_GAMEPAD_URL = "https://{url}/projects/{projectId}/robots/{callsign}/gamepads";
62
+ export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = "https://{url}/robot-configs/connections/projects/{projectId}";
63
+ export declare const API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = "https://{url}/robot-configs/connections/projects/{projectId}/callsigns/{callsign}";
60
64
  export declare const API_PROJECT_OPERATION_URL = "https://{url}/projects/{projectId}/operations";
61
65
  export declare const API_PROJECT_OPERATION_ID_URL = "https://{url}/projects/{projectId}/operations/{operationId}";
62
66
  export declare const API_PROJECT_DASHBOARD_URL = "https://{url}/projects/{projectId}/dashboards";
@@ -82,6 +86,9 @@ export declare const API_PROJECT_DEFINITION_ACTION_URL = "https://{url}/projects
82
86
  export declare const API_PROJECT_DEFINITION_BUTTON_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/buttons";
83
87
  export declare const API_PROJECT_DEFINITION_TRIGGER_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/triggers";
84
88
  export declare const API_PROJECT_DEFINITION_GAMEPAD_URL = "https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads";
89
+ export declare const API_PROJECT_DEFINITION_EXPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export";
90
+ export declare const API_PROJECT_DEFINITION_IMPORT = "https://{url}/import-export/projects/{projectId}/robot-definitions/import";
91
+ export declare const API_PROJECT_ENVIRONMENT_URL = "https://{url}/graphs/projects/{projectId}/environments";
85
92
  export declare const API_PROJECT_GROUP_TYPE_URL = "https://{url}/projects/{projectId}/config-groups/{type}";
86
93
  export declare const API_PROJECT_GROUP_TYPE_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}";
87
94
  export declare const API_PROJECT_GROUP_TYPE_PUBLISH_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish";
@@ -89,10 +96,6 @@ export declare const API_PROJECT_GROUP_TYPE_CONFIG_URL = "https://{url}/projects
89
96
  export declare const API_PROJECT_GROUP_TYPE_VERSION_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{version}";
90
97
  export declare const API_PROJECT_GROUP_TYPE_OWNER_ID_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/owner/{ownerId}";
91
98
  export declare const API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = "https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{ownerId}/override";
92
- export declare const API_PROJECT_FUNCTION_URL = "https://{url}/projects/{projectId}/functions";
93
- export declare const API_PROJECT_FUNCTION_ID_URL = "https://{url}/projects/{projectId}/functions/{functionId}";
94
- export declare const API_PROJECT_FUNCTION_RUN_URL = "https://{url}/projects/{projectId}/functions/{functionId}/run";
95
- export declare const API_PROJECT_FUNCTION_POD_URL = "https://{url}/projects/{projectId}/functions/{functionId}/pods";
96
99
  export declare const API_PROJECT_EXPORT_URL = "https://{url}/projects/{projectId}/export-jobs";
97
100
  export declare const API_PROJECT_STREAM_URL = "https://{url}/projects/{projectId}/streams";
98
101
  export declare const API_PROJECT_STREAM_ID_URL = "https://{url}/projects/{projectId}/streams/{streamId}";
@@ -118,18 +121,31 @@ export declare const API_DD_INTEGRATION_PLANS_URL = "https://{url}/projects/{pro
118
121
  export declare const API_DD_INTEGRATION_PLAN_BY_ID_URL = "https://{url}/projects/{projectId}/dd/plan/{planId}";
119
122
  export declare const API_DD_INTEGRATION_OVERLAYS_URL = "https://{url}/projects/{projectId}/dd/overlays";
120
123
  export declare const API_DD_INTEGRATION_ISSUES_URL = "https://{url}/projects/{projectId}/dd/issues";
121
- export declare const API_MAPS_URL = "https://{url}/projects/{projectId}/maps";
122
- export declare const API_MAPS_DEPLOYED_URL = "https://{url}/projects/{projectId}/maps/deployed?callsign={callsign}";
123
- export declare const API_MAPS_MERGE_URL = "https://{url}/projects/{projectId}/maps/merge";
124
- export declare const API_MAP_ID_URL = "https://{url}/projects/{projectId}/maps/{mapId}";
125
- export declare const API_MAPS_COPY_URL = "https://{url}/projects/{projectId}/maps/{mapId}/copy";
126
- export declare const API_MAPS_DEPLOY_URL = "https://{url}/projects/{projectId}/maps/{mapId}/deploy";
127
- export declare const API_MAPS_GEOJSON_URL = "https://{url}/projects/{projectId}/maps/{mapId}/geojson";
128
- export declare const API_MAPS_PANORAMA_OBSERVATIONS_URL = "https://{url}/projects/{projectId}/panoramas/{panoramaId}/observations";
129
- export declare const API_OBSERVATIONS_URL = "https://{url}/projects/{projectId}/observations";
130
- export declare const API_OBSERVATION_KEYS_URL = "https://{url}/projects/{projectId}/observations/keys";
124
+ export declare const API_DD_INTEGRATION_LOCATIONS_URL = "https://{url}/projects/{projectId}/dd/locations";
125
+ export declare const API_GRAPHS_MAPS_URL = "https://{url}/graphs/projects/{projectId}/maps";
126
+ export declare const API_GRAPHS_MAPS_DEPLOYED_URL = "https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}";
127
+ export declare const API_GRAPHS_MAPS_MERGE_URL = "https://{url}/graphs/projects/{projectId}/maps/merge";
128
+ export declare const API_GRAPHS_MAP_ID_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}";
129
+ export declare const API_GRAPHS_MAPS_COPY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy";
130
+ export declare const API_GRAPHS_MAPS_DEPLOY_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy";
131
+ export declare const API_GRAPHS_MAPS_GEOJSON_URL = "https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson";
132
+ export declare const API_GRAPHS_PANORAMA = "https://{url}/graphs/projects/{projectId}/panoramas/{panoramaId}";
133
+ export declare const API_GRAPHS_PANORAMA_OBSERVATIONS_URL = "https://{url}/graphs/projects/{projectId}/panoramas/{panoramaId}/observations";
134
+ export declare const API_GRAPHS_OBSERVATIONS_URL = "https://{url}/graphs/projects/{projectId}/observations";
135
+ export declare const API_GRAPHS_OBSERVATION_KEYS_URL = "https://{url}/graphs/projects/{projectId}/observations/keys";
136
+ export declare const API_GRAPHS_TARGET_UPLOAD_URL = "https://{url}/graphs/projects/{projectId}/targets/upload";
137
+ export declare const API_GRAPHS_TARGETS_URL = "https://{url}/graphs/projects/{projectId}/targets";
138
+ export declare const API_GRAPHS_ASSETS_UPLOAD_URL = "https://{url}/graphs/projects/{projectId}/assets/upload";
139
+ export declare const API_GRAPHS_ASSETS_URL = "https://{url}/graphs/projects/{projectId}/assets";
131
140
  export declare const API_PROJECT_WORKFLOW_URL = "https://{url}/projects/{projectId}/automate/flows";
132
141
  export declare const API_PROJECT_WORKFLOW_ID_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}";
133
142
  export declare const API_PROJECT_WORKFLOW_ASSET_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets";
134
- export declare const API_PROJECT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
143
+ export declare const API_PROJECT_ROBOT_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments";
144
+ export declare const API_PROJECT_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments";
145
+ export declare const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
146
+ export declare const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}";
147
+ export declare const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}";
148
+ export declare const API_PROJECT_WORKFLOW_AFFECTED_URL = "https://{url}/projects/{projectId}/automate/flows/{flowId}/robots";
135
149
  export declare const API_LINKED_PROJECT_URL = "https://{url}/linked-projects/{linkedProjectId}";
150
+ export declare const API_DEVICE_CREDENTIALS_URL = "https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials";
151
+ export declare const API_DEVICE_CREDENTIALS_AUTH_URL = "https://{url}/device-credentials/auth";
@@ -28,6 +28,7 @@ export const API_ACCOUNT_PROJECT_USER_URL = 'https://{url}/accounts/{accountId}/
28
28
  export const API_ACCOUNT_PROJECT_USER_ID_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/users/{userId}';
29
29
  export const API_ACCOUNT_PROJECT_APPLICATION_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/applications';
30
30
  export const API_ACCOUNT_PROJECT_APPLICATION_ID_URL = 'https://{url}/accounts/{accountId}/projects/{projectId}/applications/{applicationId}';
31
+ export const API_ACCOUNT_EXTERNAL_PROJECTS_URL = 'https://{url}/accounts/{accountId}/external-projects';
31
32
  export const API_PROJECT_URL = 'https://{url}/projects';
32
33
  export const API_PROJECT_ID_URL = 'https://{url}/projects/{projectId}';
33
34
  export const API_PROJECT_USERS_URL = 'https://{url}/projects/{projectId}/users';
@@ -43,6 +44,7 @@ export const API_PROJECT_FLOW_ASSET_PATH_URL = 'https://{url}/projects/{projectI
43
44
  export const API_PROJECT_MISSION_ASSETS_PATH_URL = 'https://{url}/projects/{projectId}/missionassets';
44
45
  export const API_PROJECT_MISSION_ASSET_PATH_URL = 'https://{url}/projects/{projectId}/missionassets/{assetId}';
45
46
  export const API_PROJECT_MAPPED_ASSETS_PATH_URL = 'https://{url}/projects/{projectId}/mappedassets';
47
+ export const API_PROJECT_MAPPED_ASSET_PATH_URL = 'https://{url}/projects/{projectId}/mappedassets/{assetId}';
46
48
  export const API_PROJECT_ROBOT_URL = 'https://{url}/projects/{projectId}/robots';
47
49
  export const API_PROJECT_ROBOT_ID_URL = 'https://{url}/projects/{projectId}/robots/{callsign}';
48
50
  export const API_PROJECT_ROBOT_ATTRIBUTES_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/attributes';
@@ -57,6 +59,8 @@ export const API_PROJECT_ROBOT_COMMAND2_URL = 'https://{url}/projects/{projectId
57
59
  export const API_PROJECT_ROBOT_BUTTON_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/buttons';
58
60
  export const API_PROJECT_ROBOT_TRIGGER_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/triggers';
59
61
  export const API_PROJECT_ROBOT_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/gamepads';
62
+ export const API_PROJECT_ROBOT_CONFIGS_CONNECTIONS_URL = 'https://{url}/robot-configs/connections/projects/{projectId}';
63
+ export const API_PROJECT_ROBOT_CONFIGS_CONNECTION_URL = 'https://{url}/robot-configs/connections/projects/{projectId}/callsigns/{callsign}';
60
64
  export const API_PROJECT_OPERATION_URL = 'https://{url}/projects/{projectId}/operations';
61
65
  export const API_PROJECT_OPERATION_ID_URL = 'https://{url}/projects/{projectId}/operations/{operationId}';
62
66
  export const API_PROJECT_DASHBOARD_URL = 'https://{url}/projects/{projectId}/dashboards';
@@ -82,6 +86,9 @@ export const API_PROJECT_DEFINITION_ACTION_URL = 'https://{url}/projects/{projec
82
86
  export const API_PROJECT_DEFINITION_BUTTON_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/buttons';
83
87
  export const API_PROJECT_DEFINITION_TRIGGER_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/triggers';
84
88
  export const API_PROJECT_DEFINITION_GAMEPAD_URL = 'https://{url}/projects/{projectId}/robot-definitions/{definitionId}/gamepads';
89
+ export const API_PROJECT_DEFINITION_EXPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/{definitionId}/export';
90
+ export const API_PROJECT_DEFINITION_IMPORT = 'https://{url}/import-export/projects/{projectId}/robot-definitions/import';
91
+ export const API_PROJECT_ENVIRONMENT_URL = 'https://{url}/graphs/projects/{projectId}/environments';
85
92
  export const API_PROJECT_GROUP_TYPE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}';
86
93
  export const API_PROJECT_GROUP_TYPE_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}';
87
94
  export const API_PROJECT_GROUP_TYPE_PUBLISH_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/publish';
@@ -89,10 +96,6 @@ export const API_PROJECT_GROUP_TYPE_CONFIG_URL = 'https://{url}/projects/{projec
89
96
  export const API_PROJECT_GROUP_TYPE_VERSION_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{version}';
90
97
  export const API_PROJECT_GROUP_TYPE_OWNER_ID_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/owner/{ownerId}';
91
98
  export const API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = 'https://{url}/projects/{projectId}/config-groups/{type}/{configGroupId}/{ownerId}/override';
92
- export const API_PROJECT_FUNCTION_URL = 'https://{url}/projects/{projectId}/functions';
93
- export const API_PROJECT_FUNCTION_ID_URL = 'https://{url}/projects/{projectId}/functions/{functionId}';
94
- export const API_PROJECT_FUNCTION_RUN_URL = 'https://{url}/projects/{projectId}/functions/{functionId}/run';
95
- export const API_PROJECT_FUNCTION_POD_URL = 'https://{url}/projects/{projectId}/functions/{functionId}/pods';
96
99
  export const API_PROJECT_EXPORT_URL = 'https://{url}/projects/{projectId}/export-jobs';
97
100
  export const API_PROJECT_STREAM_URL = 'https://{url}/projects/{projectId}/streams';
98
101
  export const API_PROJECT_STREAM_ID_URL = 'https://{url}/projects/{projectId}/streams/{streamId}';
@@ -118,18 +121,31 @@ export const API_DD_INTEGRATION_PLANS_URL = 'https://{url}/projects/{projectId}/
118
121
  export const API_DD_INTEGRATION_PLAN_BY_ID_URL = 'https://{url}/projects/{projectId}/dd/plan/{planId}';
119
122
  export const API_DD_INTEGRATION_OVERLAYS_URL = 'https://{url}/projects/{projectId}/dd/overlays';
120
123
  export const API_DD_INTEGRATION_ISSUES_URL = 'https://{url}/projects/{projectId}/dd/issues';
121
- export const API_MAPS_URL = 'https://{url}/projects/{projectId}/maps';
122
- export const API_MAPS_DEPLOYED_URL = 'https://{url}/projects/{projectId}/maps/deployed?callsign={callsign}';
123
- export const API_MAPS_MERGE_URL = 'https://{url}/projects/{projectId}/maps/merge';
124
- export const API_MAP_ID_URL = 'https://{url}/projects/{projectId}/maps/{mapId}';
125
- export const API_MAPS_COPY_URL = 'https://{url}/projects/{projectId}/maps/{mapId}/copy';
126
- export const API_MAPS_DEPLOY_URL = 'https://{url}/projects/{projectId}/maps/{mapId}/deploy';
127
- export const API_MAPS_GEOJSON_URL = 'https://{url}/projects/{projectId}/maps/{mapId}/geojson';
128
- export const API_MAPS_PANORAMA_OBSERVATIONS_URL = 'https://{url}/projects/{projectId}/panoramas/{panoramaId}/observations';
129
- export const API_OBSERVATIONS_URL = 'https://{url}/projects/{projectId}/observations';
130
- export const API_OBSERVATION_KEYS_URL = 'https://{url}/projects/{projectId}/observations/keys';
124
+ export const API_DD_INTEGRATION_LOCATIONS_URL = 'https://{url}/projects/{projectId}/dd/locations';
125
+ export const API_GRAPHS_MAPS_URL = 'https://{url}/graphs/projects/{projectId}/maps';
126
+ export const API_GRAPHS_MAPS_DEPLOYED_URL = 'https://{url}/graphs/projects/{projectId}/maps/deployed?callsign={callsign}';
127
+ export const API_GRAPHS_MAPS_MERGE_URL = 'https://{url}/graphs/projects/{projectId}/maps/merge';
128
+ export const API_GRAPHS_MAP_ID_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}';
129
+ export const API_GRAPHS_MAPS_COPY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/copy';
130
+ export const API_GRAPHS_MAPS_DEPLOY_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/deploy';
131
+ export const API_GRAPHS_MAPS_GEOJSON_URL = 'https://{url}/graphs/projects/{projectId}/maps/{mapId}/geojson';
132
+ export const API_GRAPHS_PANORAMA = 'https://{url}/graphs/projects/{projectId}/panoramas/{panoramaId}';
133
+ export const API_GRAPHS_PANORAMA_OBSERVATIONS_URL = 'https://{url}/graphs/projects/{projectId}/panoramas/{panoramaId}/observations';
134
+ export const API_GRAPHS_OBSERVATIONS_URL = 'https://{url}/graphs/projects/{projectId}/observations';
135
+ export const API_GRAPHS_OBSERVATION_KEYS_URL = 'https://{url}/graphs/projects/{projectId}/observations/keys';
136
+ export const API_GRAPHS_TARGET_UPLOAD_URL = 'https://{url}/graphs/projects/{projectId}/targets/upload';
137
+ export const API_GRAPHS_TARGETS_URL = 'https://{url}/graphs/projects/{projectId}/targets';
138
+ export const API_GRAPHS_ASSETS_UPLOAD_URL = 'https://{url}/graphs/projects/{projectId}/assets/upload';
139
+ export const API_GRAPHS_ASSETS_URL = 'https://{url}/graphs/projects/{projectId}/assets';
131
140
  export const API_PROJECT_WORKFLOW_URL = 'https://{url}/projects/{projectId}/automate/flows';
132
141
  export const API_PROJECT_WORKFLOW_ID_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}';
133
142
  export const API_PROJECT_WORKFLOW_ASSET_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets';
134
- export const API_PROJECT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
143
+ export const API_PROJECT_ROBOT_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/robots/{callsign}/automate/flows/deployments';
144
+ export const API_PROJECT_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments';
145
+ export const API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
146
+ export const API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robot-definitions/{profileId}/automate/flows/deployments/{workflowId}';
147
+ export const API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments/{workflowId}';
148
+ export const API_PROJECT_WORKFLOW_AFFECTED_URL = 'https://{url}/projects/{projectId}/automate/flows/{flowId}/robots';
135
149
  export const API_LINKED_PROJECT_URL = 'https://{url}/linked-projects/{linkedProjectId}';
150
+ export const API_DEVICE_CREDENTIALS_URL = 'https://{url}/projects/{projectId}/callsigns/{callsign}/device-credentials';
151
+ export const API_DEVICE_CREDENTIALS_AUTH_URL = 'https://{url}/device-credentials/auth';
@@ -2,7 +2,10 @@ export const cleanObject = (object) => {
2
2
  return {
3
3
  ...(function _flatten(o) {
4
4
  return [...Object.entries(o)].reduce((obj, [key, val]) => {
5
- if (typeof val === 'object') {
5
+ if (val === null) {
6
+ obj[key] = val;
7
+ }
8
+ else if (typeof val === 'object') {
6
9
  obj[key] = _flatten(val);
7
10
  }
8
11
  else if (typeof val === 'function') {
@@ -1,7 +1,11 @@
1
- import { IRocosSDKConfig } from '../models/IRocosSDKConfig';
1
+ import { IRocosSDKConfig } from '../models';
2
+ type ConfigWithParent = IRocosSDKConfig & {
3
+ _parentConfig?: ConfigWithParent;
4
+ };
2
5
  /**
3
6
  * Flattens and orders the sdk config props to make a unique key
4
7
  *
5
8
  * @param config - SDK config {@link IRocosSDKConfig}
6
9
  */
7
- export declare const getUniqueConfigKey: (config: IRocosSDKConfig) => string;
10
+ export declare const getUniqueConfigKey: (config: ConfigWithParent) => string;
11
+ export {};
@@ -4,10 +4,15 @@
4
4
  * @param config - SDK config {@link IRocosSDKConfig}
5
5
  */
6
6
  export const getUniqueConfigKey = (config) => {
7
- return Object.keys(config)
7
+ let rootConfig = config;
8
+ if (rootConfig._parentConfig) {
9
+ // assume there is only one level of nesting
10
+ rootConfig = rootConfig._parentConfig;
11
+ }
12
+ return Object.keys(rootConfig)
8
13
  .sort()
9
14
  .map((item) => {
10
- return item !== 'token' ? `${item}:${config[item]}` : false;
15
+ return item !== 'token' ? `${item}:${rootConfig[item]}` : false;
11
16
  })
12
17
  .filter(Boolean)
13
18
  .join();
@@ -3,3 +3,4 @@ export * from './standardDeviation';
3
3
  export * from './generateUUID';
4
4
  export * from './getURLSearchParams';
5
5
  export * from './websandbox';
6
+ export * from './kscript';
@@ -3,3 +3,4 @@ export * from './standardDeviation';
3
3
  export * from './generateUUID';
4
4
  export * from './getURLSearchParams';
5
5
  export * from './websandbox';
6
+ export * from './kscript';
@@ -0,0 +1,34 @@
1
+ import { AnyNode } from 'acorn';
2
+ import type { NodeType } from './nodes';
3
+ /**
4
+ * A map of node types to a set of property names that are allowed to be accessed
5
+ * on the prototype of the object.
6
+ *
7
+ * If the set is null, all properties are allowed.
8
+ */
9
+ export type PrototypeWhitelist = Map<unknown, Set<string> | null>;
10
+ export type Scope = Map<string, unknown> | Record<string, unknown>;
11
+ export interface ContextOptions {
12
+ nodeBlacklist?: Set<NodeType>;
13
+ prototypeWhitelist?: PrototypeWhitelist;
14
+ functionCallsAllowed?: boolean;
15
+ }
16
+ export default class Context {
17
+ readonly scope: Map<string, unknown>;
18
+ readonly isFunctionCallAllowed: boolean;
19
+ private readonly options;
20
+ constructor(scope?: Scope, options?: ContextOptions);
21
+ isNodeAllowed(nodeType: AnyNode['type']): boolean;
22
+ newChildContext(scope: Scope): Context;
23
+ /** Returns true if the property is allowed to be accessed on the prototype.
24
+ *
25
+ * - If the prototype is not in the whitelist, the property is allowed only if it is an own property.
26
+ * - If the prototype is in the whitelist, the property is allowed if it is in the set or the set is null.
27
+ *
28
+ * @param prototype The prototype which contains the property being accessed.
29
+ * @param property The name of the property being accessed.
30
+ * @param ownProperty Whether the property is owned by the object it is being accessed on.
31
+ */
32
+ isPrototypeAllowed(prototype: unknown, property: string, ownProperty: boolean): boolean;
33
+ private static buildMap;
34
+ }
@@ -0,0 +1,49 @@
1
+ export default class Context {
2
+ constructor(scope, options) {
3
+ this.scope = scope ? Context.buildMap(scope) : new Map();
4
+ this.options = {
5
+ nodeBlacklist: options?.nodeBlacklist ?? new Set(),
6
+ prototypeWhitelist: options?.prototypeWhitelist ?? new Map(),
7
+ functionCallsAllowed: options?.functionCallsAllowed ?? true,
8
+ };
9
+ this.isFunctionCallAllowed = this.options.functionCallsAllowed;
10
+ }
11
+ isNodeAllowed(nodeType) {
12
+ return !this.options.nodeBlacklist.has(nodeType);
13
+ }
14
+ newChildContext(scope) {
15
+ let newEntries;
16
+ if (scope instanceof Map) {
17
+ newEntries = [...scope.entries()];
18
+ }
19
+ else {
20
+ newEntries = Object.entries(scope);
21
+ }
22
+ const newScope = new Map([...this.scope.entries(), ...newEntries]);
23
+ return new Context(newScope, this.options);
24
+ }
25
+ /** Returns true if the property is allowed to be accessed on the prototype.
26
+ *
27
+ * - If the prototype is not in the whitelist, the property is allowed only if it is an own property.
28
+ * - If the prototype is in the whitelist, the property is allowed if it is in the set or the set is null.
29
+ *
30
+ * @param prototype The prototype which contains the property being accessed.
31
+ * @param property The name of the property being accessed.
32
+ * @param ownProperty Whether the property is owned by the object it is being accessed on.
33
+ */
34
+ isPrototypeAllowed(prototype, property, ownProperty) {
35
+ const whitelist = this.options.prototypeWhitelist.get(prototype);
36
+ // If the object owns the property, and it's not in the whitelist, it's allowed.
37
+ // This prevents direct calls to non-whitelisted properties on allowed prototypes
38
+ // e.g. Object.prototype.hasOwnProperty.call(obj, 'toString')
39
+ if (whitelist === undefined)
40
+ return ownProperty;
41
+ // all properties allowed if no set is provided
42
+ if (whitelist === null)
43
+ return true;
44
+ return whitelist.has(property);
45
+ }
46
+ static buildMap(obj) {
47
+ return obj instanceof Map ? obj : new Map(Object.entries(obj));
48
+ }
49
+ }
@@ -0,0 +1 @@
1
+ export * as kscript from './kscript';
@@ -0,0 +1 @@
1
+ export * as kscript from './kscript';
@@ -0,0 +1,6 @@
1
+ import { ContextOptions, PrototypeWhitelist, Scope } from './Context';
2
+ import { Node } from './nodes';
3
+ export declare function execute(code: string, scope?: Scope, options?: ContextOptions): unknown;
4
+ export declare function compile(code: string, scope?: Scope, options?: ContextOptions): Node;
5
+ export declare const SAFE_GLOBALS: Map<string, unknown>;
6
+ export declare const SAFE_PROTOTYPES: PrototypeWhitelist;
@@ -0,0 +1,107 @@
1
+ import Context from './Context';
2
+ import { parse } from 'acorn';
3
+ import { construct } from './utils';
4
+ export function execute(code, scope, options) {
5
+ return compile(code, scope, options).run();
6
+ }
7
+ export function compile(code, scope, options) {
8
+ let program;
9
+ try {
10
+ // we add the brackets to ensure that object literals are parsed correctly
11
+ program = parse(`(${code})`, { ecmaVersion: 2020, sourceType: 'script' });
12
+ }
13
+ catch (error) {
14
+ if (error instanceof SyntaxError) {
15
+ // fallback to non-wrapped code for edge cases where the brackets cause issues
16
+ program = parse(`${code}`, { ecmaVersion: 2020, sourceType: 'script' });
17
+ }
18
+ else {
19
+ throw error;
20
+ }
21
+ }
22
+ const context = new Context(scope ?? SAFE_GLOBALS, {
23
+ prototypeWhitelist: SAFE_PROTOTYPES,
24
+ ...options,
25
+ });
26
+ return construct(program, context);
27
+ }
28
+ export const SAFE_GLOBALS = new Map(Object.entries({
29
+ console: {
30
+ debug: console.debug,
31
+ error: console.error,
32
+ info: console.info,
33
+ log: console.log,
34
+ warn: console.warn,
35
+ },
36
+ isFinite,
37
+ isNaN,
38
+ Number,
39
+ Object,
40
+ Array,
41
+ Symbol,
42
+ Error,
43
+ JSON,
44
+ Math,
45
+ Date,
46
+ RegExp,
47
+ }));
48
+ export const SAFE_PROTOTYPES = new Map([
49
+ [Number.prototype, new Set(['toString', 'toFixed', 'toExponential', 'toPrecision'])],
50
+ [
51
+ String.prototype,
52
+ new Set([
53
+ 'toString',
54
+ 'charAt',
55
+ 'charCodeAt',
56
+ 'concat',
57
+ 'indexOf',
58
+ 'lastIndexOf',
59
+ 'localeCompare',
60
+ 'match',
61
+ 'replace',
62
+ 'search',
63
+ 'slice',
64
+ 'split',
65
+ 'substring',
66
+ 'toLowerCase',
67
+ 'toUpperCase',
68
+ 'trim',
69
+ 'valueOf',
70
+ ]),
71
+ ],
72
+ [
73
+ Array.prototype,
74
+ new Set([
75
+ 'filter',
76
+ 'map',
77
+ 'find',
78
+ 'findIndex',
79
+ 'forEach',
80
+ 'every',
81
+ 'some',
82
+ 'reduce',
83
+ 'reduceRight',
84
+ 'sort',
85
+ 'slice',
86
+ 'splice',
87
+ 'concat',
88
+ 'indexOf',
89
+ 'lastIndexOf',
90
+ 'includes',
91
+ 'join',
92
+ 'reverse',
93
+ 'shift',
94
+ 'unshift',
95
+ 'pop',
96
+ 'push',
97
+ 'copyWithin',
98
+ 'fill',
99
+ 'entries',
100
+ 'keys',
101
+ 'values',
102
+ 'flat',
103
+ 'flatMap',
104
+ ]),
105
+ ],
106
+ [Object.prototype, new Set(['toString'])],
107
+ ]);
@@ -0,0 +1,12 @@
1
+ import { AnyNode, Identifier } from 'acorn';
2
+ import type Context from '../Context';
3
+ import Node from './Node';
4
+ /** An Identifier is a reference to a variable.
5
+ *
6
+ * Variables must be declared in the current scope.
7
+ * If the variable is not found, undefined is returned.
8
+ */
9
+ export default class IdentifierNode extends Node<Identifier> {
10
+ constructor(node: AnyNode, context: Context);
11
+ run(): unknown;
12
+ }
@@ -0,0 +1,14 @@
1
+ import Node from './Node';
2
+ /** An Identifier is a reference to a variable.
3
+ *
4
+ * Variables must be declared in the current scope.
5
+ * If the variable is not found, undefined is returned.
6
+ */
7
+ export default class IdentifierNode extends Node {
8
+ constructor(node, context) {
9
+ super(node, context, 'Identifier');
10
+ }
11
+ run() {
12
+ return this.scope.get(this.node.name);
13
+ }
14
+ }
@@ -0,0 +1,11 @@
1
+ import { AnyNode, Literal } from 'acorn';
2
+ import Context from '../Context';
3
+ import Node from './Node';
4
+ /** Represents a literal value
5
+ *
6
+ * e.g. `1`, `'hello'`, `true`
7
+ */
8
+ export default class LiteralNode extends Node<Literal> {
9
+ constructor(node: AnyNode, context: Context);
10
+ run(): unknown;
11
+ }
@@ -0,0 +1,16 @@
1
+ import Node from './Node';
2
+ /** Represents a literal value
3
+ *
4
+ * e.g. `1`, `'hello'`, `true`
5
+ */
6
+ export default class LiteralNode extends Node {
7
+ constructor(node, context) {
8
+ super(node, context, 'Literal');
9
+ }
10
+ run() {
11
+ if (this.node.bigint) {
12
+ throw new Error('BigInts are not supported');
13
+ }
14
+ return this.node.value;
15
+ }
16
+ }