@dronedeploy/rocos-js-sdk 3.0.1-alpha.8 → 3.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (378) 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/asset-storage/SyncIntegrations.d.ts +1 -1
  94. package/cjs/models/device-credentials/DeviceCredentials.d.ts +61 -0
  95. package/cjs/models/device-credentials/DeviceCredentials.js +2 -0
  96. package/cjs/models/graph/Position.d.ts +6 -0
  97. package/cjs/models/graph/Position.js +2 -0
  98. package/cjs/models/graph/Quaternion.d.ts +6 -0
  99. package/cjs/models/graph/Quaternion.js +2 -0
  100. package/cjs/models/graph/Vector3.d.ts +5 -0
  101. package/cjs/models/graph/Vector3.js +2 -0
  102. package/cjs/models/graph/index.d.ts +3 -0
  103. package/cjs/models/graph/index.js +19 -0
  104. package/cjs/models/index.d.ts +9 -2
  105. package/cjs/models/index.js +9 -2
  106. package/cjs/models/integrations/Location.d.ts +24 -0
  107. package/cjs/models/integrations/Location.js +2 -0
  108. package/cjs/models/integrations/PaginatedResults.d.ts +4 -0
  109. package/cjs/models/integrations/PaginatedResults.js +2 -0
  110. package/cjs/models/maps/Panorama.d.ts +12 -21
  111. package/cjs/models/projects/ExternalProject.d.ts +10 -0
  112. package/cjs/models/projects/ExternalProject.js +2 -0
  113. package/cjs/models/projects/NewProjectRequest.d.ts +8 -0
  114. package/cjs/models/projects/NewProjectRequest.js +2 -0
  115. package/cjs/models/target/Target.d.ts +30 -0
  116. package/cjs/models/target/Target.js +15 -0
  117. package/cjs/node/RocosSDKNode.d.ts +1 -5
  118. package/cjs/node/RocosSDKNode.js +9 -9
  119. package/cjs/services/AssetStorageService.d.ts +19 -19
  120. package/cjs/services/AssetStorageService.js +20 -9
  121. package/cjs/services/AuthService.d.ts +12 -1
  122. package/cjs/services/AuthService.js +25 -1
  123. package/cjs/services/BaseServiceAbstract.d.ts +1 -1
  124. package/cjs/services/BaseServiceAbstract.js +2 -2
  125. package/cjs/services/DeviceCredentialsService.d.ts +15 -0
  126. package/cjs/services/DeviceCredentialsService.js +56 -0
  127. package/cjs/services/EnvironmentService.d.ts +28 -0
  128. package/cjs/services/EnvironmentService.js +48 -0
  129. package/cjs/services/EvaluatorService.js +1 -1
  130. package/cjs/services/IntegrationService.d.ts +7 -1
  131. package/cjs/services/IntegrationService.js +8 -0
  132. package/cjs/services/MapService.d.ts +18 -8
  133. package/cjs/services/MapService.js +37 -19
  134. package/cjs/services/ProfileService.d.ts +24 -0
  135. package/cjs/services/ProfileService.js +34 -0
  136. package/cjs/services/ProjectService.d.ts +7 -2
  137. package/cjs/services/ProjectService.js +7 -3
  138. package/cjs/services/RTPWebRTCService.d.ts +6 -1
  139. package/cjs/services/RTPWebRTCService.js +10 -2
  140. package/cjs/services/RobotService.d.ts +3 -1
  141. package/cjs/services/RobotService.js +6 -0
  142. package/cjs/services/SpotProvisioningService.d.ts +1 -1
  143. package/cjs/services/SpotProvisioningServiceNode.d.ts +1 -1
  144. package/cjs/services/TargetService.d.ts +16 -0
  145. package/cjs/services/TargetService.js +58 -0
  146. package/cjs/services/TelemetryService.d.ts +10 -1
  147. package/cjs/services/TelemetryService.js +27 -5
  148. package/cjs/services/WorkflowService.d.ts +18 -8
  149. package/cjs/services/WorkflowService.js +37 -11
  150. package/cjs/services/index.d.ts +11 -9
  151. package/cjs/services/index.js +11 -9
  152. package/cjs/store/RocosStore.d.ts +1 -2
  153. package/esm/IRocosSDK.d.ts +4 -3
  154. package/esm/RocosSDK.d.ts +19 -7
  155. package/esm/RocosSDK.js +32 -11
  156. package/esm/api/streams/caller/CallerStream.js +5 -2
  157. package/esm/api/streams/caller/CallerStreamNode.js +2 -1
  158. package/esm/api/streams/command/CommandStream.js +5 -2
  159. package/esm/api/streams/command/CommandStreamNode.js +2 -1
  160. package/esm/api/streams/control/ControlStream.js +5 -2
  161. package/esm/api/streams/control/ControlStreamAbstract.d.ts +1 -1
  162. package/esm/api/streams/control/ControlStreamNode.js +2 -1
  163. package/esm/api/streams/fileAccessor/FileAccessorStream.js +4 -1
  164. package/esm/api/streams/fileAccessor/FileAccessorStreamNode.js +3 -1
  165. package/esm/api/streams/search/SearchStream.js +5 -2
  166. package/esm/api/streams/search/SearchStreamNode.js +2 -1
  167. package/esm/api/streams/telemetry/TelemetryStream.js +4 -1
  168. package/esm/api/streams/telemetry/TelemetryStreamAbstract.d.ts +1 -1
  169. package/esm/api/streams/telemetry/TelemetryStreamNode.js +2 -1
  170. package/esm/api/streams/webRTCSignalling/WebRTCSignallingStream.js +5 -2
  171. package/esm/constants/api.d.ts +31 -15
  172. package/esm/constants/api.js +31 -15
  173. package/esm/helpers/cleanObject.js +4 -1
  174. package/esm/helpers/getUniqueConfigKey.d.ts +6 -2
  175. package/esm/helpers/getUniqueConfigKey.js +7 -2
  176. package/esm/helpers/index.d.ts +1 -0
  177. package/esm/helpers/index.js +1 -0
  178. package/esm/helpers/kscript/Context.d.ts +34 -0
  179. package/esm/helpers/kscript/Context.js +49 -0
  180. package/esm/helpers/kscript/index.d.ts +1 -0
  181. package/esm/helpers/kscript/index.js +1 -0
  182. package/esm/helpers/kscript/kscript.d.ts +6 -0
  183. package/esm/helpers/kscript/kscript.js +107 -0
  184. package/esm/helpers/kscript/nodes/Identifier.d.ts +12 -0
  185. package/esm/helpers/kscript/nodes/Identifier.js +14 -0
  186. package/esm/helpers/kscript/nodes/Literal.d.ts +11 -0
  187. package/esm/helpers/kscript/nodes/Literal.js +16 -0
  188. package/esm/helpers/kscript/nodes/Node.d.ts +9 -0
  189. package/esm/helpers/kscript/nodes/Node.js +12 -0
  190. package/esm/helpers/kscript/nodes/Program.d.ts +11 -0
  191. package/esm/helpers/kscript/nodes/Program.js +18 -0
  192. package/esm/helpers/kscript/nodes/TemplateLiteral.d.ts +23 -0
  193. package/esm/helpers/kscript/nodes/TemplateLiteral.js +29 -0
  194. package/esm/helpers/kscript/nodes/expressions/ArrayExpression.d.ts +7 -0
  195. package/esm/helpers/kscript/nodes/expressions/ArrayExpression.js +25 -0
  196. package/esm/helpers/kscript/nodes/expressions/ArrowFunctionExpression.d.ts +14 -0
  197. package/esm/helpers/kscript/nodes/expressions/ArrowFunctionExpression.js +34 -0
  198. package/esm/helpers/kscript/nodes/expressions/BinaryExpression.d.ts +16 -0
  199. package/esm/helpers/kscript/nodes/expressions/BinaryExpression.js +98 -0
  200. package/esm/helpers/kscript/nodes/expressions/CallExpression.d.ts +8 -0
  201. package/esm/helpers/kscript/nodes/expressions/CallExpression.js +32 -0
  202. package/esm/helpers/kscript/nodes/expressions/ChainExpression.d.ts +16 -0
  203. package/esm/helpers/kscript/nodes/expressions/ChainExpression.js +19 -0
  204. package/esm/helpers/kscript/nodes/expressions/ConditionalExpression.d.ts +14 -0
  205. package/esm/helpers/kscript/nodes/expressions/ConditionalExpression.js +24 -0
  206. package/esm/helpers/kscript/nodes/expressions/ExpressionStatement.d.ts +7 -0
  207. package/esm/helpers/kscript/nodes/expressions/ExpressionStatement.js +12 -0
  208. package/esm/helpers/kscript/nodes/expressions/LogicalExpression.d.ts +10 -0
  209. package/esm/helpers/kscript/nodes/expressions/LogicalExpression.js +41 -0
  210. package/esm/helpers/kscript/nodes/expressions/MemberExpression.d.ts +44 -0
  211. package/esm/helpers/kscript/nodes/expressions/MemberExpression.js +92 -0
  212. package/esm/helpers/kscript/nodes/expressions/ObjectExpression.d.ts +11 -0
  213. package/esm/helpers/kscript/nodes/expressions/ObjectExpression.js +53 -0
  214. package/esm/helpers/kscript/nodes/expressions/UnaryExpression.d.ts +12 -0
  215. package/esm/helpers/kscript/nodes/expressions/UnaryExpression.js +38 -0
  216. package/esm/helpers/kscript/nodes/expressions/index.d.ts +11 -0
  217. package/esm/helpers/kscript/nodes/expressions/index.js +11 -0
  218. package/esm/helpers/kscript/nodes/index.d.ts +4 -0
  219. package/esm/helpers/kscript/nodes/index.js +3 -0
  220. package/esm/helpers/kscript/nodes/nodeTypes.d.ts +33 -0
  221. package/esm/helpers/kscript/nodes/nodeTypes.js +24 -0
  222. package/esm/helpers/kscript/utils.d.ts +4 -0
  223. package/esm/helpers/kscript/utils.js +11 -0
  224. package/esm/helpers/websandbox/connection.d.ts +2 -1
  225. package/esm/helpers/websandbox/connection.js +6 -5
  226. package/esm/helpers/websandbox/frame/frame.js +4 -1
  227. package/esm/helpers/websandbox/frame/frame.source.js +1 -1
  228. package/esm/helpers/websandbox/frame/worker/manager.d.ts +8 -4
  229. package/esm/helpers/websandbox/frame/worker/manager.js +32 -14
  230. package/esm/helpers/websandbox/frame/worker/worker.source.js +1 -1
  231. package/esm/helpers/websandbox/sandbox.d.ts +1 -1
  232. package/esm/helpers/websandbox/sandbox.js +7 -7
  233. package/esm/models/IConnectedCallsign.d.ts +10 -0
  234. package/esm/models/IConnectedCallsign.js +5 -0
  235. package/esm/models/RocosError.d.ts +3 -0
  236. package/esm/models/RocosError.js +3 -0
  237. package/esm/models/ServiceEnum.d.ts +20 -17
  238. package/esm/models/ServiceEnum.js +20 -17
  239. package/esm/models/TelemetryStatus.d.ts +12 -0
  240. package/esm/models/TelemetryStatus.js +14 -0
  241. package/esm/models/Token.d.ts +2 -2
  242. package/esm/models/Token.js +5 -5
  243. package/esm/models/asset-storage/{AssetModelItem.d.ts → AssetItem.d.ts} +2 -0
  244. package/esm/models/asset-storage/SyncIntegrations.d.ts +1 -1
  245. package/esm/models/device-credentials/DeviceCredentials.d.ts +61 -0
  246. package/esm/models/graph/Position.d.ts +6 -0
  247. package/esm/models/graph/Quaternion.d.ts +6 -0
  248. package/esm/models/graph/Vector3.d.ts +5 -0
  249. package/esm/models/graph/index.d.ts +3 -0
  250. package/esm/models/graph/index.js +3 -0
  251. package/esm/models/index.d.ts +9 -2
  252. package/esm/models/index.js +9 -2
  253. package/esm/models/integrations/Location.d.ts +24 -0
  254. package/esm/models/integrations/PaginatedResults.d.ts +4 -0
  255. package/esm/models/maps/Panorama.d.ts +12 -21
  256. package/esm/models/projects/ExternalProject.d.ts +10 -0
  257. package/esm/models/projects/NewProjectRequest.d.ts +8 -0
  258. package/esm/models/target/Target.d.ts +30 -0
  259. package/esm/models/target/Target.js +9 -0
  260. package/esm/node/RocosSDKNode.d.ts +1 -5
  261. package/esm/node/RocosSDKNode.js +10 -10
  262. package/esm/services/AssetStorageService.d.ts +19 -19
  263. package/esm/services/AssetStorageService.js +20 -9
  264. package/esm/services/AuthService.d.ts +12 -1
  265. package/esm/services/AuthService.js +25 -1
  266. package/esm/services/BaseServiceAbstract.d.ts +1 -1
  267. package/esm/services/BaseServiceAbstract.js +3 -3
  268. package/esm/services/DeviceCredentialsService.d.ts +15 -0
  269. package/esm/services/DeviceCredentialsService.js +52 -0
  270. package/esm/services/EnvironmentService.d.ts +28 -0
  271. package/esm/services/EnvironmentService.js +44 -0
  272. package/esm/services/EvaluatorService.js +1 -1
  273. package/esm/services/IntegrationService.d.ts +7 -1
  274. package/esm/services/IntegrationService.js +10 -2
  275. package/esm/services/MapService.d.ts +18 -8
  276. package/esm/services/MapService.js +38 -20
  277. package/esm/services/ProfileService.d.ts +24 -0
  278. package/esm/services/ProfileService.js +35 -1
  279. package/esm/services/ProjectService.d.ts +7 -2
  280. package/esm/services/ProjectService.js +9 -5
  281. package/esm/services/RTPWebRTCService.d.ts +6 -1
  282. package/esm/services/RTPWebRTCService.js +10 -2
  283. package/esm/services/RobotService.d.ts +3 -1
  284. package/esm/services/RobotService.js +8 -2
  285. package/esm/services/SpotProvisioningService.d.ts +1 -1
  286. package/esm/services/SpotProvisioningServiceNode.d.ts +1 -1
  287. package/esm/services/TargetService.d.ts +16 -0
  288. package/esm/services/TargetService.js +54 -0
  289. package/esm/services/TelemetryService.d.ts +10 -1
  290. package/esm/services/TelemetryService.js +28 -6
  291. package/esm/services/WorkflowService.d.ts +18 -8
  292. package/esm/services/WorkflowService.js +38 -12
  293. package/esm/services/index.d.ts +11 -9
  294. package/esm/services/index.js +11 -9
  295. package/esm/store/RocosStore.d.ts +1 -2
  296. package/package.json +2 -2
  297. package/cjs/helpers/cleanObject.spec.js +0 -55
  298. package/cjs/helpers/flattenObject.spec.js +0 -31
  299. package/cjs/helpers/flattenOneOf.spec.js +0 -159
  300. package/cjs/helpers/formatServiceUrl.spec.js +0 -18
  301. package/cjs/helpers/getSha256Hex.spec.js +0 -19
  302. package/cjs/helpers/getSha256HexNode.spec.js +0 -10
  303. package/cjs/helpers/getURLSearchParams.spec.js +0 -21
  304. package/cjs/helpers/nanosecondToMillisecond.spec.js +0 -22
  305. package/cjs/helpers/splitRobotTopic.spec.js +0 -53
  306. package/cjs/helpers/standardDeviation.spec.d.ts +0 -1
  307. package/cjs/helpers/standardDeviation.spec.js +0 -13
  308. package/cjs/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
  309. package/cjs/helpers/websandbox/frame/worker/manager.spec.js +0 -132
  310. package/cjs/models/CallsignStatus.d.ts +0 -6
  311. package/cjs/models/CallsignStatus.js +0 -10
  312. package/cjs/models/ExternalProject.d.ts +0 -6
  313. package/cjs/models/ExternalProject.js +0 -6
  314. package/cjs/models/Token.spec.d.ts +0 -1
  315. package/cjs/models/Token.spec.js +0 -110
  316. package/cjs/services/AuthService.spec.d.ts +0 -1
  317. package/cjs/services/AuthService.spec.js +0 -165
  318. package/cjs/services/CallerService.spec.d.ts +0 -1
  319. package/cjs/services/CallerService.spec.js +0 -229
  320. package/cjs/services/FunctionService.d.ts +0 -68
  321. package/cjs/services/FunctionService.js +0 -103
  322. package/cjs/services/PlatformTimeService.spec.d.ts +0 -1
  323. package/cjs/services/PlatformTimeService.spec.js +0 -182
  324. package/cjs/services/RTPWebRTCService.spec.d.ts +0 -4
  325. package/cjs/services/RTPWebRTCService.spec.js +0 -171
  326. package/cjs/services/TelemetryService.spec.d.ts +0 -1
  327. package/cjs/services/TelemetryService.spec.js +0 -39
  328. package/esm/helpers/cleanObject.spec.d.ts +0 -1
  329. package/esm/helpers/cleanObject.spec.js +0 -53
  330. package/esm/helpers/flattenObject.spec.d.ts +0 -1
  331. package/esm/helpers/flattenObject.spec.js +0 -29
  332. package/esm/helpers/flattenOneOf.spec.d.ts +0 -1
  333. package/esm/helpers/flattenOneOf.spec.js +0 -157
  334. package/esm/helpers/formatServiceUrl.spec.d.ts +0 -1
  335. package/esm/helpers/formatServiceUrl.spec.js +0 -16
  336. package/esm/helpers/getSha256Hex.spec.d.ts +0 -1
  337. package/esm/helpers/getSha256Hex.spec.js +0 -14
  338. package/esm/helpers/getSha256HexNode.spec.d.ts +0 -1
  339. package/esm/helpers/getSha256HexNode.spec.js +0 -8
  340. package/esm/helpers/getURLSearchParams.spec.d.ts +0 -1
  341. package/esm/helpers/getURLSearchParams.spec.js +0 -19
  342. package/esm/helpers/nanosecondToMillisecond.spec.d.ts +0 -1
  343. package/esm/helpers/nanosecondToMillisecond.spec.js +0 -20
  344. package/esm/helpers/splitRobotTopic.spec.d.ts +0 -1
  345. package/esm/helpers/splitRobotTopic.spec.js +0 -51
  346. package/esm/helpers/standardDeviation.spec.d.ts +0 -1
  347. package/esm/helpers/standardDeviation.spec.js +0 -11
  348. package/esm/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
  349. package/esm/helpers/websandbox/frame/worker/manager.spec.js +0 -127
  350. package/esm/models/CallsignStatus.d.ts +0 -6
  351. package/esm/models/CallsignStatus.js +0 -7
  352. package/esm/models/ExternalProject.d.ts +0 -6
  353. package/esm/models/ExternalProject.js +0 -2
  354. package/esm/models/Token.spec.d.ts +0 -1
  355. package/esm/models/Token.spec.js +0 -108
  356. package/esm/models/asset-storage/AssetModelItem.js +0 -1
  357. package/esm/services/AuthService.spec.d.ts +0 -1
  358. package/esm/services/AuthService.spec.js +0 -163
  359. package/esm/services/CallerService.spec.d.ts +0 -1
  360. package/esm/services/CallerService.spec.js +0 -227
  361. package/esm/services/FunctionService.d.ts +0 -68
  362. package/esm/services/FunctionService.js +0 -99
  363. package/esm/services/PlatformTimeService.spec.d.ts +0 -1
  364. package/esm/services/PlatformTimeService.spec.js +0 -180
  365. package/esm/services/RTPWebRTCService.spec.d.ts +0 -4
  366. package/esm/services/RTPWebRTCService.spec.js +0 -169
  367. package/esm/services/TelemetryService.spec.d.ts +0 -1
  368. package/esm/services/TelemetryService.spec.js +0 -37
  369. /package/cjs/models/asset-storage/{AssetModelItem.js → AssetItem.js} +0 -0
  370. /package/{cjs/helpers/cleanObject.spec.d.ts → esm/models/asset-storage/AssetItem.js} +0 -0
  371. /package/{cjs/helpers/flattenObject.spec.d.ts → esm/models/device-credentials/DeviceCredentials.js} +0 -0
  372. /package/{cjs/helpers/flattenOneOf.spec.d.ts → esm/models/graph/Position.js} +0 -0
  373. /package/{cjs/helpers/formatServiceUrl.spec.d.ts → esm/models/graph/Quaternion.js} +0 -0
  374. /package/{cjs/helpers/getSha256Hex.spec.d.ts → esm/models/graph/Vector3.js} +0 -0
  375. /package/{cjs/helpers/getSha256HexNode.spec.d.ts → esm/models/integrations/Location.js} +0 -0
  376. /package/{cjs/helpers/getURLSearchParams.spec.d.ts → esm/models/integrations/PaginatedResults.js} +0 -0
  377. /package/{cjs/helpers/nanosecondToMillisecond.spec.d.ts → esm/models/projects/ExternalProject.js} +0 -0
  378. /package/{cjs/helpers/splitRobotTopic.spec.d.ts → esm/models/projects/NewProjectRequest.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { API_PROJECT_DEPLOYED_WORKFLOW_URL, API_PROJECT_WORKFLOW_ASSET_URL, API_PROJECT_WORKFLOW_ID_URL, API_PROJECT_WORKFLOW_URL, } from '../constants/api';
1
+ import { API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, API_PROJECT_PROFILE_DEPLOYMENTS_URL, API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, API_PROJECT_ROBOT_DEPLOYMENTS_URL, API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL, API_PROJECT_WORKFLOW_AFFECTED_URL, API_PROJECT_WORKFLOW_ASSET_URL, API_PROJECT_WORKFLOW_ID_URL, API_PROJECT_WORKFLOW_URL, } from '../constants/api';
2
2
  import { RocosError, errorCodes } from '../models/RocosError';
3
3
  import { BaseServiceAbstract } from './BaseServiceAbstract';
4
4
  import { RocosLogger } from '../logger/RocosLogger';
@@ -51,6 +51,16 @@ export class WorkflowService extends BaseServiceAbstract {
51
51
  async update(projectId, workflowId, model) {
52
52
  return this.callPut(formatServiceUrl(API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), model, `Failed to update workflow for ${projectId}, workflowId ${workflowId}.`);
53
53
  }
54
+ /**
55
+ * Delete a workflow
56
+ *
57
+ * @param projectId - Project Id
58
+ * @param workflowId - Workflow Id
59
+ */
60
+ async delete(projectId, workflowId) {
61
+ return this.callDelete(formatServiceUrl(API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), `Failed to delete workflow for ${projectId}, workflowId ${workflowId}.`);
62
+ }
63
+ // Assets
54
64
  /**
55
65
  * Upload workflow asset
56
66
  *
@@ -82,22 +92,38 @@ export class WorkflowService extends BaseServiceAbstract {
82
92
  if (uploadResponse.status !== 200)
83
93
  throw new Error(`Failed to upload file: ${uploadResponse.statusText}`);
84
94
  }
85
- /**
86
- * Delete a workflow
87
- *
88
- * @param projectId - Project Id
89
- * @param workflowId - Workflow Id
90
- */
91
- async delete(projectId, workflowId) {
92
- return this.callDelete(formatServiceUrl(API_PROJECT_WORKFLOW_ID_URL, { url: this.config.url, projectId, workflowId }, this.config.insecure), `Failed to delete workflow for ${projectId}, workflowId ${workflowId}.`);
93
- }
95
+ // Deployments
94
96
  /**
95
97
  * Get deployed workflows on robot
96
98
  *
97
99
  * @param projectId - Project Id
98
100
  * @param callsign - Robot callsign
99
101
  */
100
- async getDeployedWorkflows(projectId, callsign) {
101
- return this.callGet(formatServiceUrl(API_PROJECT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), `Failed to update workflows for ${projectId}, callsign ${callsign}.`);
102
+ async getDeployedWorkflows(projectId, profileId, callsign) {
103
+ if (callsign) {
104
+ return this.callGet(formatServiceUrl(API_PROJECT_ROBOT_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId, callsign }, this.config.insecure), `Failed to get workflows for project ${projectId}, profile ${profileId}, callsign ${callsign}.`);
105
+ }
106
+ return this.callGet(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId }, this.config.insecure), `Failed to get workflows for project ${projectId}, profile ${profileId}.`);
107
+ }
108
+ async addRobotDeployment(projectId, callsign, workflowId) {
109
+ return this.callPost(formatServiceUrl(API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign, workflowId }, this.config.insecure), undefined, `Failed to add workflow for ${projectId}, callsign ${callsign}.`);
110
+ }
111
+ async addProfileDeployment(projectId, profileId, workflowId) {
112
+ return this.callPost(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, profileId, workflowId }, this.config.insecure), undefined, `Failed to add workflow for ${projectId}, profile ${profileId}.`);
113
+ }
114
+ async removeRobotDeployment(projectId, callsign, workflowId) {
115
+ return this.callDelete(formatServiceUrl(API_PROJECT_ROBOT_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, callsign, workflowId }, this.config.insecure), `Failed to remove workflow for ${projectId}, callsign ${callsign}.`);
116
+ }
117
+ async removeProfileDeployment(projectId, profileId, workflowId) {
118
+ return this.callDelete(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYED_WORKFLOW_URL, { url: this.config.url, projectId, profileId, workflowId }, this.config.insecure), `Failed to remove workflow for ${projectId}, profile ${profileId}.`);
119
+ }
120
+ async updateRobotDeployments(projectId, callsign, workflows) {
121
+ return this.callPost(formatServiceUrl(API_PROJECT_ROBOT_NO_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, callsign }, this.config.insecure), { deployed: workflows }, `Failed to update workflows for ${projectId}, callsign ${callsign}.`);
122
+ }
123
+ async updateProfileDeployments(projectId, profileId, workflows) {
124
+ return this.callPost(formatServiceUrl(API_PROJECT_PROFILE_DEPLOYMENTS_URL, { url: this.config.url, projectId, profileId }, this.config.insecure), { deployed: workflows }, `Failed to update workflows for ${projectId}, profile ${profileId}.`);
125
+ }
126
+ async getAffectedRobots(projectId, workflowId) {
127
+ return this.callGet(formatServiceUrl(API_PROJECT_WORKFLOW_AFFECTED_URL, { url: this.config.url, projectId, workflowId, flowId: workflowId }, this.config.insecure), `Failed to get affected robots for ${projectId}, workflowId ${workflowId}.`);
102
128
  }
103
129
  }
@@ -5,24 +5,26 @@ export * from './CommandService';
5
5
  export * from './ConfigGroupService';
6
6
  export * from './ControlService';
7
7
  export * from './DashboardService';
8
+ export * from './DeviceCredentialsService';
9
+ export * from './EnvironmentService';
10
+ export * from './EvaluatorService';
8
11
  export * from './EventService';
9
12
  export * from './FileAccessorService';
10
- export * from './FunctionService';
11
13
  export * from './IntegrationService';
14
+ export * from './MapService';
15
+ export * from './PlatformTimeService';
12
16
  export * from './ProfileService';
13
17
  export * from './ProjectService';
18
+ export * from './RTPWebRTCService';
14
19
  export * from './RobotService';
20
+ export * from './ScheduleService';
15
21
  export * from './SearchService';
22
+ export * from './SpotProvisioningService';
23
+ export * from './SpotProvisioningServiceNode';
16
24
  export * from './StreamService';
25
+ export * from './TargetService';
17
26
  export * from './TelemetryService';
27
+ export * from './TimeSyncerService';
18
28
  export * from './UserService';
19
29
  export * from './WebRTCSignallingService';
20
30
  export * from './WorkflowService';
21
- export * from './ScheduleService';
22
- export * from './TimeSyncerService';
23
- export * from './PlatformTimeService';
24
- export * from './SpotProvisioningService';
25
- export * from './SpotProvisioningServiceNode';
26
- export * from './MapService';
27
- export * from './EvaluatorService';
28
- export * from './RTPWebRTCService';
@@ -5,24 +5,26 @@ export * from './CommandService';
5
5
  export * from './ConfigGroupService';
6
6
  export * from './ControlService';
7
7
  export * from './DashboardService';
8
+ export * from './DeviceCredentialsService';
9
+ export * from './EnvironmentService';
10
+ export * from './EvaluatorService';
8
11
  export * from './EventService';
9
12
  export * from './FileAccessorService';
10
- export * from './FunctionService';
11
13
  export * from './IntegrationService';
14
+ export * from './MapService';
15
+ export * from './PlatformTimeService';
12
16
  export * from './ProfileService';
13
17
  export * from './ProjectService';
18
+ export * from './RTPWebRTCService';
14
19
  export * from './RobotService';
20
+ export * from './ScheduleService';
15
21
  export * from './SearchService';
22
+ export * from './SpotProvisioningService';
23
+ export * from './SpotProvisioningServiceNode';
16
24
  export * from './StreamService';
25
+ export * from './TargetService';
17
26
  export * from './TelemetryService';
27
+ export * from './TimeSyncerService';
18
28
  export * from './UserService';
19
29
  export * from './WebRTCSignallingService';
20
30
  export * from './WorkflowService';
21
- export * from './ScheduleService';
22
- export * from './TimeSyncerService';
23
- export * from './PlatformTimeService';
24
- export * from './SpotProvisioningService';
25
- export * from './SpotProvisioningServiceNode';
26
- export * from './MapService';
27
- export * from './EvaluatorService';
28
- export * from './RTPWebRTCService';
@@ -1,6 +1,5 @@
1
- import { IRocosChangeMessage } from '../models/message/IRocosChangeMessage';
1
+ import { IRocosChangeMessage, IRocosSDKConfig } from '../models';
2
2
  import { IRocosSDK } from '../IRocosSDK';
3
- import { IRocosSDKConfig } from '../models/IRocosSDKConfig';
4
3
  import { Subject } from 'rxjs';
5
4
  export declare class RocosStore {
6
5
  private static changeSubject$?;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.0.1-alpha.8",
3
+ "version": "3.0.1",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -23,11 +23,11 @@
23
23
  "devDependencies": {},
24
24
  "dependencies": {
25
25
  "@grpc/grpc-js": "^1.7.1",
26
- "@improbable-eng/grpc-web": "^0.14.0",
27
26
  "@protobuf-ts/grpcweb-transport": "^2.9.1",
28
27
  "@protobuf-ts/plugin": "^2.9.1",
29
28
  "@protobuf-ts/runtime": "^2.9.1",
30
29
  "@types/json-schema": "^7.0.14",
30
+ "acorn": "^8.11.3",
31
31
  "buffer": "^6.0.3",
32
32
  "loglevel": "^1.7.1",
33
33
  "loglevel-plugin-prefix": "^0.8.4",
@@ -1,55 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const cleanObject_1 = require("./cleanObject");
4
- describe('cleanObject', () => {
5
- const testObject = {
6
- test1: 'test1',
7
- test2: 'test2',
8
- test3: () => 'test3',
9
- test4: {
10
- test1: 'test1.1',
11
- test5: 'test5',
12
- test6: {
13
- test7: 'test7',
14
- test1: 'test1.2',
15
- test2: 'test2.1',
16
- test8: () => 'test8',
17
- },
18
- test8: () => 'test8',
19
- },
20
- test9: ['test9.1', 'test9.2', () => 'test8'],
21
- test10: [
22
- {
23
- test7: 'test7',
24
- test1: 'test1.2',
25
- test2: 'test2.1',
26
- test8: () => 'test8',
27
- },
28
- {
29
- test8: () => 'test8',
30
- },
31
- ],
32
- };
33
- it('should clean object to values only', () => {
34
- const newObject = (0, cleanObject_1.cleanObject)(testObject);
35
- expect(newObject?.test3).toBeUndefined();
36
- expect(newObject?.test4?.test8).toBeUndefined();
37
- expect(newObject?.test4?.test6?.test8).toBeUndefined();
38
- expect(newObject?.test4?.test5).toEqual('test5');
39
- expect(newObject?.test5).toBeUndefined();
40
- expect(newObject?.test4?.test6?.test1).toEqual('test1.2');
41
- expect(newObject?.test4?.test6?.test2).toEqual('test2.1');
42
- expect(newObject?.test1).toEqual('test1');
43
- expect(newObject?.test2).toEqual('test2');
44
- expect(newObject?.test9).toEqual(expect.arrayContaining(['test9.1', 'test9.2']));
45
- expect(newObject?.test9).toEqual(expect.not.arrayContaining([() => 'test8']));
46
- expect(newObject?.test10).toEqual(expect.arrayContaining([
47
- {
48
- test7: 'test7',
49
- test1: 'test1.2',
50
- test2: 'test2.1',
51
- },
52
- {},
53
- ]));
54
- });
55
- });
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const flattenObject_1 = require("./flattenObject");
4
- describe('flattenObject', () => {
5
- const testObject = {
6
- test1: 'test1',
7
- test2: 'test2',
8
- test3: () => 'test3',
9
- test4: {
10
- test1: 'test1.1',
11
- test5: 'test5',
12
- test6: {
13
- test7: 'test7',
14
- test1: 'test1.2',
15
- test2: 'test2.1',
16
- test8: () => 'test8',
17
- },
18
- test8: () => 'test8',
19
- },
20
- };
21
- it('should flatten object to a single level', () => {
22
- const newObject = (0, flattenObject_1.flattenObject)(testObject);
23
- expect(newObject?.test3).toBeUndefined();
24
- expect(newObject?.test4?.test8).toBeUndefined();
25
- expect(newObject?.test4?.test6?.test8).toBeUndefined();
26
- expect(newObject?.test4?.test5).toBeUndefined();
27
- expect(newObject?.test5).toEqual('test5');
28
- expect(newObject?.test1).toEqual('test1.2');
29
- expect(newObject?.test2).toEqual('test2.1');
30
- });
31
- });
@@ -1,159 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const flattenOneOf_1 = require("./flattenOneOf");
4
- describe('flattenOneOf', () => {
5
- describe('hasOneOfField', () => {
6
- it('should return false for non-object', () => {
7
- expect((0, flattenOneOf_1.hasOneOfField)(null)).toBe(false);
8
- expect((0, flattenOneOf_1.hasOneOfField)(undefined)).toBe(false);
9
- expect((0, flattenOneOf_1.hasOneOfField)(1)).toBe(false);
10
- expect((0, flattenOneOf_1.hasOneOfField)('')).toBe(false);
11
- expect((0, flattenOneOf_1.hasOneOfField)(true)).toBe(false);
12
- });
13
- it('should return false for null content', () => {
14
- expect((0, flattenOneOf_1.hasOneOfField)({ content: null })).toBe(false);
15
- });
16
- it('should return false for non-object content', () => {
17
- expect((0, flattenOneOf_1.hasOneOfField)({ content: 1 })).toBe(false);
18
- expect((0, flattenOneOf_1.hasOneOfField)({ content: '' })).toBe(false);
19
- expect((0, flattenOneOf_1.hasOneOfField)({ content: true })).toBe(false);
20
- });
21
- it('should return false for non-string oneofKind', () => {
22
- expect((0, flattenOneOf_1.hasOneOfField)({ content: { oneofKind: 1 } })).toBe(false);
23
- expect((0, flattenOneOf_1.hasOneOfField)({ content: { oneofKind: null } })).toBe(false);
24
- expect((0, flattenOneOf_1.hasOneOfField)({ content: { oneofKind: true } })).toBe(false);
25
- expect((0, flattenOneOf_1.hasOneOfField)({ content: { oneofKind: {} } })).toBe(false);
26
- });
27
- it('should return true for valid oneOfField', () => {
28
- expect((0, flattenOneOf_1.hasOneOfField)({ content: { oneofKind: 'test' } })).toBe(true);
29
- });
30
- });
31
- describe('flattenOneOf', () => {
32
- it('should flatten a simple oneof type', () => {
33
- const a = {
34
- a: 'a',
35
- content: {
36
- oneofKind: 'b',
37
- b: true,
38
- },
39
- };
40
- expect((0, flattenOneOf_1.flattenOneOf)(a)).toEqual({
41
- a: 'a',
42
- b: true,
43
- });
44
- });
45
- it('should flatten a nested oneof type, one level only', () => {
46
- const a = {
47
- b: {
48
- content: {
49
- oneofKind: 'c',
50
- c: true,
51
- },
52
- },
53
- content: {
54
- oneofKind: 'd',
55
- d: {
56
- content: {
57
- oneofKind: 'e',
58
- e: 5,
59
- },
60
- },
61
- },
62
- };
63
- expect((0, flattenOneOf_1.flattenOneOf)(a)).toEqual({
64
- b: {
65
- content: {
66
- oneofKind: 'c',
67
- c: true,
68
- },
69
- },
70
- d: {
71
- content: {
72
- oneofKind: 'e',
73
- e: 5,
74
- },
75
- },
76
- });
77
- });
78
- it('should flatten to undefined if the referenced property does not exist', () => {
79
- const a = {
80
- content: {
81
- oneofKind: 'b',
82
- c: true,
83
- },
84
- };
85
- expect((0, flattenOneOf_1.flattenOneOf)(a)).toEqual({
86
- b: undefined,
87
- });
88
- });
89
- it('should return the original object if it does not have a oneof field', () => {
90
- const a = {
91
- a: 'a',
92
- b: 'b',
93
- };
94
- expect((0, flattenOneOf_1.flattenOneOf)(a)).toEqual(a);
95
- });
96
- });
97
- describe('flattenOneOf - deep', () => {
98
- it('should flatten a simple oneof type', () => {
99
- const a = {
100
- a: 'a',
101
- content: {
102
- oneofKind: 'b',
103
- b: {
104
- d: 4,
105
- },
106
- },
107
- };
108
- expect((0, flattenOneOf_1.flattenOneOf)(a, true)).toEqual({
109
- a: 'a',
110
- b: { d: 4 },
111
- });
112
- });
113
- it('should flatten a nested oneof type, all levels', () => {
114
- const a = {
115
- b: {
116
- content: {
117
- oneofKind: 'c',
118
- c: true,
119
- },
120
- },
121
- content: {
122
- oneofKind: 'd',
123
- d: {
124
- content: {
125
- oneofKind: 'e',
126
- e: 5,
127
- },
128
- },
129
- },
130
- };
131
- expect((0, flattenOneOf_1.flattenOneOf)(a, true)).toEqual({
132
- b: {
133
- c: true,
134
- },
135
- d: {
136
- e: 5,
137
- },
138
- });
139
- });
140
- it('should flatten to undefined if the referenced property does not exist', () => {
141
- const a = {
142
- content: {
143
- oneofKind: 'b',
144
- c: true,
145
- },
146
- };
147
- expect((0, flattenOneOf_1.flattenOneOf)(a, true)).toEqual({
148
- b: undefined,
149
- });
150
- });
151
- it('should return the original object if it does not have a oneof field', () => {
152
- const a = {
153
- a: 'a',
154
- b: 'b',
155
- };
156
- expect((0, flattenOneOf_1.flattenOneOf)(a, true)).toEqual(a);
157
- });
158
- });
159
- });
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const formatServiceUrl_1 = require("./formatServiceUrl");
4
- describe('formatServiceUrl', () => {
5
- const url = 'https://{url}/admin/users/{test}/invitations';
6
- it('should format url', () => {
7
- let newUrl = (0, formatServiceUrl_1.formatServiceUrl)(url, { url: 'test.com', test: 'me' });
8
- expect(newUrl).toEqual('https://test.com/admin/users/me/invitations');
9
- newUrl = (0, formatServiceUrl_1.formatServiceUrl)(url, { url: 'test2.com', test: 'me2' });
10
- expect(newUrl).toEqual('https://test2.com/admin/users/me2/invitations');
11
- });
12
- it('should format insecure url', () => {
13
- let newUrl = (0, formatServiceUrl_1.formatServiceUrl)(url, { url: 'test.com', test: 'me' }, true);
14
- expect(newUrl).toEqual('http://test.com/admin/users/me/invitations');
15
- newUrl = (0, formatServiceUrl_1.formatServiceUrl)(url, { url: 'test2.com', test: 'me2' }, true);
16
- expect(newUrl).toEqual('http://test2.com/admin/users/me2/invitations');
17
- });
18
- });
@@ -1,19 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const crypto_1 = __importDefault(require("crypto"));
7
- const getSha256Hex_1 = require("./getSha256Hex");
8
- Object.defineProperty(globalThis, 'crypto', {
9
- value: {
10
- subtle: crypto_1.default.webcrypto.subtle,
11
- },
12
- });
13
- describe('getSha256Hex', () => {
14
- it('should return the correct SHA-256 hash', async () => {
15
- const buffer = new TextEncoder().encode('Hello, World!');
16
- const hash = await (0, getSha256Hex_1.getSha256Hex)(buffer);
17
- expect(hash).toBe('dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f');
18
- });
19
- });
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getSha256HexNode_1 = require("./getSha256HexNode");
4
- describe('getSha256HexNode', () => {
5
- it('should return the correct SHA-256 hash', async () => {
6
- const buffer = new TextEncoder().encode('Hello, World!');
7
- const hash = await (0, getSha256HexNode_1.getSha256HexNode)(buffer);
8
- expect(hash).toBe('dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f');
9
- });
10
- });
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const getURLSearchParams_1 = require("./getURLSearchParams");
4
- describe('getURLSearchParams', () => {
5
- it('Should return the original param if URLSearchParams', () => {
6
- const param = new URLSearchParams();
7
- const searchParam = (0, getURLSearchParams_1.getURLSearchParams)(param);
8
- expect(searchParam).toBe(param);
9
- });
10
- it('Should a new URLSearchParams ', () => {
11
- const param = {
12
- foo: 'bar',
13
- bar: true,
14
- foobar: 123,
15
- };
16
- const searchParam = (0, getURLSearchParams_1.getURLSearchParams)(param);
17
- expect(searchParam.get('foo')).toBe('bar');
18
- expect(searchParam.get('bar')).toBe('true');
19
- expect(searchParam.get('foobar')).toBe('123');
20
- });
21
- });
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const nanosecondToMillisecond_1 = require("./nanosecondToMillisecond");
4
- describe('nanosecondToMillisecond', () => {
5
- it.each `
6
- input | expected
7
- ${'0.0001'} | ${0.0000000001}
8
- ${'1'} | ${0.000001}
9
- ${'1000000'} | ${1}
10
- ${'10000000'} | ${10}
11
- ${'-100000006'} | ${-100.000006}
12
- ${'1000000000000000000'} | ${1000000000000}
13
- ${'1234567891011100001'} | ${1234567891011.100001}
14
- ${'1234567891011100000'} | ${1234567891011.1}
15
- ${0.0001} | ${0.0000000001}
16
- ${1} | ${0.000001}
17
- ${1000000} | ${1}
18
- ${1000000000000001} | ${1000000000.000001}
19
- `('should convert $input to $expected', ({ input, expected }) => {
20
- expect((0, nanosecondToMillisecond_1.nanosecondToMillisecond)(input)).toBe(expected);
21
- });
22
- });
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const splitRobotTopic_1 = require("./splitRobotTopic");
4
- describe('splitRobotTopic', () => {
5
- it('should split a path with a single topic', () => {
6
- expect((0, splitRobotTopic_1.splitRobotTopic)('/component/topic')).toEqual({
7
- component: 'component',
8
- topic: 'topic',
9
- });
10
- });
11
- it('should split a path with multiple topics', () => {
12
- expect((0, splitRobotTopic_1.splitRobotTopic)('/component/topic/with/multiple/topics')).toEqual({
13
- component: 'component',
14
- topic: 'topic/with/multiple/topics',
15
- });
16
- });
17
- it('should split a path with no topics', () => {
18
- expect((0, splitRobotTopic_1.splitRobotTopic)('/component')).toEqual({
19
- component: 'component',
20
- topic: '',
21
- });
22
- });
23
- it('should split a path with no forward slash', () => {
24
- expect((0, splitRobotTopic_1.splitRobotTopic)('component/topic')).toEqual({
25
- component: 'component',
26
- topic: 'topic',
27
- });
28
- });
29
- it('should split a path with no forward slash and no topics', () => {
30
- expect((0, splitRobotTopic_1.splitRobotTopic)('component')).toEqual({
31
- component: 'component',
32
- topic: '',
33
- });
34
- });
35
- it('should split a path with no forward slash and multiple topics', () => {
36
- expect((0, splitRobotTopic_1.splitRobotTopic)('component/topic/with/multiple/topics')).toEqual({
37
- component: 'component',
38
- topic: 'topic/with/multiple/topics',
39
- });
40
- });
41
- it('should handle a path with multiple forward slashes', () => {
42
- expect((0, splitRobotTopic_1.splitRobotTopic)('///component/topic/with/multiple/topics')).toEqual({
43
- component: 'component',
44
- topic: 'topic/with/multiple/topics',
45
- });
46
- });
47
- it('should handle a path with multiple forward slashes and no topics', () => {
48
- expect((0, splitRobotTopic_1.splitRobotTopic)('///component')).toEqual({
49
- component: 'component',
50
- topic: '',
51
- });
52
- });
53
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const standardDeviation_1 = require("./standardDeviation");
4
- describe('standardDeviation', () => {
5
- it('should calculate standard deviation correctly', () => {
6
- let numbers = [10, 12, 23, 23, 16, 23, 21, 16];
7
- let stdDev = (0, standardDeviation_1.standardDeviation)(numbers);
8
- expect(Math.abs(stdDev - 4.8989794855664)).toBeLessThan(0.000001);
9
- numbers = [100, 12, 23, 23, 116, 23, 21, 162];
10
- stdDev = (0, standardDeviation_1.standardDeviation)(numbers);
11
- expect(Math.abs(stdDev - 53.702886328394)).toBeLessThan(0.000001);
12
- });
13
- });
@@ -1,4 +0,0 @@
1
- /**
2
- * @jest-environment jsdom
3
- */
4
- export {};