@dronedeploy/rocos-js-sdk 3.0.1-alpha.8 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -29
- package/cjs/IRocosSDK.d.ts +4 -3
- package/cjs/RocosSDK.d.ts +19 -7
- package/cjs/RocosSDK.js +31 -10
- package/cjs/api/streams/caller/CallerStream.js +5 -2
- package/cjs/api/streams/caller/CallerStreamNode.js +2 -1
- package/cjs/api/streams/command/CommandStream.js +5 -2
- package/cjs/api/streams/command/CommandStreamNode.js +2 -1
- package/cjs/api/streams/control/ControlStream.js +5 -2
- package/cjs/api/streams/control/ControlStreamAbstract.d.ts +1 -1
- package/cjs/api/streams/control/ControlStreamNode.js +2 -1
- package/cjs/api/streams/fileAccessor/FileAccessorStream.js +4 -1
- package/cjs/api/streams/fileAccessor/FileAccessorStreamNode.js +3 -1
- package/cjs/api/streams/search/SearchStream.js +5 -2
- package/cjs/api/streams/search/SearchStreamNode.js +2 -1
- package/cjs/api/streams/telemetry/TelemetryStream.js +4 -1
- package/cjs/api/streams/telemetry/TelemetryStreamAbstract.d.ts +1 -1
- package/cjs/api/streams/telemetry/TelemetryStreamNode.js +2 -1
- package/cjs/api/streams/webRTCSignalling/WebRTCSignallingStream.js +5 -2
- package/cjs/constants/api.d.ts +31 -15
- package/cjs/constants/api.js +35 -18
- package/cjs/helpers/cleanObject.js +4 -1
- package/cjs/helpers/getUniqueConfigKey.d.ts +6 -2
- package/cjs/helpers/getUniqueConfigKey.js +7 -2
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +1 -0
- package/cjs/helpers/kscript/Context.d.ts +34 -0
- package/cjs/helpers/kscript/Context.js +52 -0
- package/cjs/helpers/kscript/index.d.ts +1 -0
- package/cjs/helpers/kscript/index.js +27 -0
- package/cjs/helpers/kscript/kscript.d.ts +6 -0
- package/cjs/helpers/kscript/kscript.js +115 -0
- package/cjs/helpers/kscript/nodes/Identifier.d.ts +12 -0
- package/cjs/helpers/kscript/nodes/Identifier.js +20 -0
- package/cjs/helpers/kscript/nodes/Literal.d.ts +11 -0
- package/cjs/helpers/kscript/nodes/Literal.js +22 -0
- package/cjs/helpers/kscript/nodes/Node.d.ts +9 -0
- package/cjs/helpers/kscript/nodes/Node.js +15 -0
- package/cjs/helpers/kscript/nodes/Program.d.ts +11 -0
- package/cjs/helpers/kscript/nodes/Program.js +24 -0
- package/cjs/helpers/kscript/nodes/TemplateLiteral.d.ts +23 -0
- package/cjs/helpers/kscript/nodes/TemplateLiteral.js +35 -0
- package/cjs/helpers/kscript/nodes/expressions/ArrayExpression.d.ts +7 -0
- package/cjs/helpers/kscript/nodes/expressions/ArrayExpression.js +31 -0
- package/cjs/helpers/kscript/nodes/expressions/ArrowFunctionExpression.d.ts +14 -0
- package/cjs/helpers/kscript/nodes/expressions/ArrowFunctionExpression.js +40 -0
- package/cjs/helpers/kscript/nodes/expressions/BinaryExpression.d.ts +16 -0
- package/cjs/helpers/kscript/nodes/expressions/BinaryExpression.js +104 -0
- package/cjs/helpers/kscript/nodes/expressions/CallExpression.d.ts +8 -0
- package/cjs/helpers/kscript/nodes/expressions/CallExpression.js +38 -0
- package/cjs/helpers/kscript/nodes/expressions/ChainExpression.d.ts +16 -0
- package/cjs/helpers/kscript/nodes/expressions/ChainExpression.js +25 -0
- package/cjs/helpers/kscript/nodes/expressions/ConditionalExpression.d.ts +14 -0
- package/cjs/helpers/kscript/nodes/expressions/ConditionalExpression.js +30 -0
- package/cjs/helpers/kscript/nodes/expressions/ExpressionStatement.d.ts +7 -0
- package/cjs/helpers/kscript/nodes/expressions/ExpressionStatement.js +18 -0
- package/cjs/helpers/kscript/nodes/expressions/LogicalExpression.d.ts +10 -0
- package/cjs/helpers/kscript/nodes/expressions/LogicalExpression.js +47 -0
- package/cjs/helpers/kscript/nodes/expressions/MemberExpression.d.ts +44 -0
- package/cjs/helpers/kscript/nodes/expressions/MemberExpression.js +98 -0
- package/cjs/helpers/kscript/nodes/expressions/ObjectExpression.d.ts +11 -0
- package/cjs/helpers/kscript/nodes/expressions/ObjectExpression.js +59 -0
- package/cjs/helpers/kscript/nodes/expressions/UnaryExpression.d.ts +12 -0
- package/cjs/helpers/kscript/nodes/expressions/UnaryExpression.js +44 -0
- package/cjs/helpers/kscript/nodes/expressions/index.d.ts +11 -0
- package/cjs/helpers/kscript/nodes/expressions/index.js +28 -0
- package/cjs/helpers/kscript/nodes/index.d.ts +4 -0
- package/cjs/helpers/kscript/nodes/index.js +10 -0
- package/cjs/helpers/kscript/nodes/nodeTypes.d.ts +33 -0
- package/cjs/helpers/kscript/nodes/nodeTypes.js +29 -0
- package/cjs/helpers/kscript/utils.d.ts +4 -0
- package/cjs/helpers/kscript/utils.js +15 -0
- package/cjs/helpers/websandbox/connection.d.ts +2 -1
- package/cjs/helpers/websandbox/connection.js +6 -5
- package/cjs/helpers/websandbox/frame/frame.js +4 -1
- package/cjs/helpers/websandbox/frame/frame.source.js +1 -1
- package/cjs/helpers/websandbox/frame/worker/manager.d.ts +8 -4
- package/cjs/helpers/websandbox/frame/worker/manager.js +32 -14
- package/cjs/helpers/websandbox/frame/worker/worker.source.js +1 -1
- package/cjs/helpers/websandbox/sandbox.d.ts +1 -1
- package/cjs/helpers/websandbox/sandbox.js +7 -7
- package/cjs/models/IConnectedCallsign.d.ts +10 -0
- package/cjs/models/IConnectedCallsign.js +8 -0
- package/cjs/models/RocosError.d.ts +3 -0
- package/cjs/models/RocosError.js +3 -0
- package/cjs/models/ServiceEnum.d.ts +20 -17
- package/cjs/models/ServiceEnum.js +20 -17
- package/cjs/models/TelemetryStatus.d.ts +12 -0
- package/cjs/models/TelemetryStatus.js +17 -0
- package/cjs/models/Token.d.ts +2 -2
- package/cjs/models/Token.js +5 -5
- package/cjs/models/asset-storage/{AssetModelItem.d.ts → AssetItem.d.ts} +2 -0
- package/cjs/models/asset-storage/SyncIntegrations.d.ts +1 -1
- package/cjs/models/device-credentials/DeviceCredentials.d.ts +61 -0
- package/cjs/models/device-credentials/DeviceCredentials.js +2 -0
- package/cjs/models/graph/Position.d.ts +6 -0
- package/cjs/models/graph/Position.js +2 -0
- package/cjs/models/graph/Quaternion.d.ts +6 -0
- package/cjs/models/graph/Quaternion.js +2 -0
- package/cjs/models/graph/Vector3.d.ts +5 -0
- package/cjs/models/graph/Vector3.js +2 -0
- package/cjs/models/graph/index.d.ts +3 -0
- package/cjs/models/graph/index.js +19 -0
- package/cjs/models/index.d.ts +9 -2
- package/cjs/models/index.js +9 -2
- package/cjs/models/integrations/Location.d.ts +24 -0
- package/cjs/models/integrations/Location.js +2 -0
- package/cjs/models/integrations/PaginatedResults.d.ts +4 -0
- package/cjs/models/integrations/PaginatedResults.js +2 -0
- package/cjs/models/maps/Panorama.d.ts +12 -21
- package/cjs/models/projects/ExternalProject.d.ts +10 -0
- package/cjs/models/projects/ExternalProject.js +2 -0
- package/cjs/models/projects/NewProjectRequest.d.ts +8 -0
- package/cjs/models/projects/NewProjectRequest.js +2 -0
- package/cjs/models/target/Target.d.ts +30 -0
- package/cjs/models/target/Target.js +15 -0
- package/cjs/node/RocosSDKNode.d.ts +1 -5
- package/cjs/node/RocosSDKNode.js +9 -9
- package/cjs/services/AssetStorageService.d.ts +19 -19
- package/cjs/services/AssetStorageService.js +20 -9
- package/cjs/services/AuthService.d.ts +12 -1
- package/cjs/services/AuthService.js +25 -1
- package/cjs/services/BaseServiceAbstract.d.ts +1 -1
- package/cjs/services/BaseServiceAbstract.js +2 -2
- package/cjs/services/DeviceCredentialsService.d.ts +15 -0
- package/cjs/services/DeviceCredentialsService.js +56 -0
- package/cjs/services/EnvironmentService.d.ts +28 -0
- package/cjs/services/EnvironmentService.js +48 -0
- package/cjs/services/EvaluatorService.js +1 -1
- package/cjs/services/IntegrationService.d.ts +7 -1
- package/cjs/services/IntegrationService.js +8 -0
- package/cjs/services/MapService.d.ts +18 -8
- package/cjs/services/MapService.js +37 -19
- package/cjs/services/ProfileService.d.ts +24 -0
- package/cjs/services/ProfileService.js +34 -0
- package/cjs/services/ProjectService.d.ts +7 -2
- package/cjs/services/ProjectService.js +7 -3
- package/cjs/services/RTPWebRTCService.d.ts +6 -1
- package/cjs/services/RTPWebRTCService.js +10 -2
- package/cjs/services/RobotService.d.ts +3 -1
- package/cjs/services/RobotService.js +6 -0
- package/cjs/services/SpotProvisioningService.d.ts +1 -1
- package/cjs/services/SpotProvisioningServiceNode.d.ts +1 -1
- package/cjs/services/TargetService.d.ts +16 -0
- package/cjs/services/TargetService.js +58 -0
- package/cjs/services/TelemetryService.d.ts +10 -1
- package/cjs/services/TelemetryService.js +27 -5
- package/cjs/services/WorkflowService.d.ts +18 -8
- package/cjs/services/WorkflowService.js +37 -11
- package/cjs/services/index.d.ts +11 -9
- package/cjs/services/index.js +11 -9
- package/cjs/store/RocosStore.d.ts +1 -2
- package/esm/IRocosSDK.d.ts +4 -3
- package/esm/RocosSDK.d.ts +19 -7
- package/esm/RocosSDK.js +32 -11
- package/esm/api/streams/caller/CallerStream.js +5 -2
- package/esm/api/streams/caller/CallerStreamNode.js +2 -1
- package/esm/api/streams/command/CommandStream.js +5 -2
- package/esm/api/streams/command/CommandStreamNode.js +2 -1
- package/esm/api/streams/control/ControlStream.js +5 -2
- package/esm/api/streams/control/ControlStreamAbstract.d.ts +1 -1
- package/esm/api/streams/control/ControlStreamNode.js +2 -1
- package/esm/api/streams/fileAccessor/FileAccessorStream.js +4 -1
- package/esm/api/streams/fileAccessor/FileAccessorStreamNode.js +3 -1
- package/esm/api/streams/search/SearchStream.js +5 -2
- package/esm/api/streams/search/SearchStreamNode.js +2 -1
- package/esm/api/streams/telemetry/TelemetryStream.js +4 -1
- package/esm/api/streams/telemetry/TelemetryStreamAbstract.d.ts +1 -1
- package/esm/api/streams/telemetry/TelemetryStreamNode.js +2 -1
- package/esm/api/streams/webRTCSignalling/WebRTCSignallingStream.js +5 -2
- package/esm/constants/api.d.ts +31 -15
- package/esm/constants/api.js +31 -15
- package/esm/helpers/cleanObject.js +4 -1
- package/esm/helpers/getUniqueConfigKey.d.ts +6 -2
- package/esm/helpers/getUniqueConfigKey.js +7 -2
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/kscript/Context.d.ts +34 -0
- package/esm/helpers/kscript/Context.js +49 -0
- package/esm/helpers/kscript/index.d.ts +1 -0
- package/esm/helpers/kscript/index.js +1 -0
- package/esm/helpers/kscript/kscript.d.ts +6 -0
- package/esm/helpers/kscript/kscript.js +107 -0
- package/esm/helpers/kscript/nodes/Identifier.d.ts +12 -0
- package/esm/helpers/kscript/nodes/Identifier.js +14 -0
- package/esm/helpers/kscript/nodes/Literal.d.ts +11 -0
- package/esm/helpers/kscript/nodes/Literal.js +16 -0
- package/esm/helpers/kscript/nodes/Node.d.ts +9 -0
- package/esm/helpers/kscript/nodes/Node.js +12 -0
- package/esm/helpers/kscript/nodes/Program.d.ts +11 -0
- package/esm/helpers/kscript/nodes/Program.js +18 -0
- package/esm/helpers/kscript/nodes/TemplateLiteral.d.ts +23 -0
- package/esm/helpers/kscript/nodes/TemplateLiteral.js +29 -0
- package/esm/helpers/kscript/nodes/expressions/ArrayExpression.d.ts +7 -0
- package/esm/helpers/kscript/nodes/expressions/ArrayExpression.js +25 -0
- package/esm/helpers/kscript/nodes/expressions/ArrowFunctionExpression.d.ts +14 -0
- package/esm/helpers/kscript/nodes/expressions/ArrowFunctionExpression.js +34 -0
- package/esm/helpers/kscript/nodes/expressions/BinaryExpression.d.ts +16 -0
- package/esm/helpers/kscript/nodes/expressions/BinaryExpression.js +98 -0
- package/esm/helpers/kscript/nodes/expressions/CallExpression.d.ts +8 -0
- package/esm/helpers/kscript/nodes/expressions/CallExpression.js +32 -0
- package/esm/helpers/kscript/nodes/expressions/ChainExpression.d.ts +16 -0
- package/esm/helpers/kscript/nodes/expressions/ChainExpression.js +19 -0
- package/esm/helpers/kscript/nodes/expressions/ConditionalExpression.d.ts +14 -0
- package/esm/helpers/kscript/nodes/expressions/ConditionalExpression.js +24 -0
- package/esm/helpers/kscript/nodes/expressions/ExpressionStatement.d.ts +7 -0
- package/esm/helpers/kscript/nodes/expressions/ExpressionStatement.js +12 -0
- package/esm/helpers/kscript/nodes/expressions/LogicalExpression.d.ts +10 -0
- package/esm/helpers/kscript/nodes/expressions/LogicalExpression.js +41 -0
- package/esm/helpers/kscript/nodes/expressions/MemberExpression.d.ts +44 -0
- package/esm/helpers/kscript/nodes/expressions/MemberExpression.js +92 -0
- package/esm/helpers/kscript/nodes/expressions/ObjectExpression.d.ts +11 -0
- package/esm/helpers/kscript/nodes/expressions/ObjectExpression.js +53 -0
- package/esm/helpers/kscript/nodes/expressions/UnaryExpression.d.ts +12 -0
- package/esm/helpers/kscript/nodes/expressions/UnaryExpression.js +38 -0
- package/esm/helpers/kscript/nodes/expressions/index.d.ts +11 -0
- package/esm/helpers/kscript/nodes/expressions/index.js +11 -0
- package/esm/helpers/kscript/nodes/index.d.ts +4 -0
- package/esm/helpers/kscript/nodes/index.js +3 -0
- package/esm/helpers/kscript/nodes/nodeTypes.d.ts +33 -0
- package/esm/helpers/kscript/nodes/nodeTypes.js +24 -0
- package/esm/helpers/kscript/utils.d.ts +4 -0
- package/esm/helpers/kscript/utils.js +11 -0
- package/esm/helpers/websandbox/connection.d.ts +2 -1
- package/esm/helpers/websandbox/connection.js +6 -5
- package/esm/helpers/websandbox/frame/frame.js +4 -1
- package/esm/helpers/websandbox/frame/frame.source.js +1 -1
- package/esm/helpers/websandbox/frame/worker/manager.d.ts +8 -4
- package/esm/helpers/websandbox/frame/worker/manager.js +32 -14
- package/esm/helpers/websandbox/frame/worker/worker.source.js +1 -1
- package/esm/helpers/websandbox/sandbox.d.ts +1 -1
- package/esm/helpers/websandbox/sandbox.js +7 -7
- package/esm/models/IConnectedCallsign.d.ts +10 -0
- package/esm/models/IConnectedCallsign.js +5 -0
- package/esm/models/RocosError.d.ts +3 -0
- package/esm/models/RocosError.js +3 -0
- package/esm/models/ServiceEnum.d.ts +20 -17
- package/esm/models/ServiceEnum.js +20 -17
- package/esm/models/TelemetryStatus.d.ts +12 -0
- package/esm/models/TelemetryStatus.js +14 -0
- package/esm/models/Token.d.ts +2 -2
- package/esm/models/Token.js +5 -5
- package/esm/models/asset-storage/{AssetModelItem.d.ts → AssetItem.d.ts} +2 -0
- package/esm/models/asset-storage/SyncIntegrations.d.ts +1 -1
- package/esm/models/device-credentials/DeviceCredentials.d.ts +61 -0
- package/esm/models/graph/Position.d.ts +6 -0
- package/esm/models/graph/Quaternion.d.ts +6 -0
- package/esm/models/graph/Vector3.d.ts +5 -0
- package/esm/models/graph/index.d.ts +3 -0
- package/esm/models/graph/index.js +3 -0
- package/esm/models/index.d.ts +9 -2
- package/esm/models/index.js +9 -2
- package/esm/models/integrations/Location.d.ts +24 -0
- package/esm/models/integrations/PaginatedResults.d.ts +4 -0
- package/esm/models/maps/Panorama.d.ts +12 -21
- package/esm/models/projects/ExternalProject.d.ts +10 -0
- package/esm/models/projects/NewProjectRequest.d.ts +8 -0
- package/esm/models/target/Target.d.ts +30 -0
- package/esm/models/target/Target.js +9 -0
- package/esm/node/RocosSDKNode.d.ts +1 -5
- package/esm/node/RocosSDKNode.js +10 -10
- package/esm/services/AssetStorageService.d.ts +19 -19
- package/esm/services/AssetStorageService.js +20 -9
- package/esm/services/AuthService.d.ts +12 -1
- package/esm/services/AuthService.js +25 -1
- package/esm/services/BaseServiceAbstract.d.ts +1 -1
- package/esm/services/BaseServiceAbstract.js +3 -3
- package/esm/services/DeviceCredentialsService.d.ts +15 -0
- package/esm/services/DeviceCredentialsService.js +52 -0
- package/esm/services/EnvironmentService.d.ts +28 -0
- package/esm/services/EnvironmentService.js +44 -0
- package/esm/services/EvaluatorService.js +1 -1
- package/esm/services/IntegrationService.d.ts +7 -1
- package/esm/services/IntegrationService.js +10 -2
- package/esm/services/MapService.d.ts +18 -8
- package/esm/services/MapService.js +38 -20
- package/esm/services/ProfileService.d.ts +24 -0
- package/esm/services/ProfileService.js +35 -1
- package/esm/services/ProjectService.d.ts +7 -2
- package/esm/services/ProjectService.js +9 -5
- package/esm/services/RTPWebRTCService.d.ts +6 -1
- package/esm/services/RTPWebRTCService.js +10 -2
- package/esm/services/RobotService.d.ts +3 -1
- package/esm/services/RobotService.js +8 -2
- package/esm/services/SpotProvisioningService.d.ts +1 -1
- package/esm/services/SpotProvisioningServiceNode.d.ts +1 -1
- package/esm/services/TargetService.d.ts +16 -0
- package/esm/services/TargetService.js +54 -0
- package/esm/services/TelemetryService.d.ts +10 -1
- package/esm/services/TelemetryService.js +28 -6
- package/esm/services/WorkflowService.d.ts +18 -8
- package/esm/services/WorkflowService.js +38 -12
- package/esm/services/index.d.ts +11 -9
- package/esm/services/index.js +11 -9
- package/esm/store/RocosStore.d.ts +1 -2
- package/package.json +2 -2
- package/cjs/helpers/cleanObject.spec.js +0 -55
- package/cjs/helpers/flattenObject.spec.js +0 -31
- package/cjs/helpers/flattenOneOf.spec.js +0 -159
- package/cjs/helpers/formatServiceUrl.spec.js +0 -18
- package/cjs/helpers/getSha256Hex.spec.js +0 -19
- package/cjs/helpers/getSha256HexNode.spec.js +0 -10
- package/cjs/helpers/getURLSearchParams.spec.js +0 -21
- package/cjs/helpers/nanosecondToMillisecond.spec.js +0 -22
- package/cjs/helpers/splitRobotTopic.spec.js +0 -53
- package/cjs/helpers/standardDeviation.spec.d.ts +0 -1
- package/cjs/helpers/standardDeviation.spec.js +0 -13
- package/cjs/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
- package/cjs/helpers/websandbox/frame/worker/manager.spec.js +0 -132
- package/cjs/models/CallsignStatus.d.ts +0 -6
- package/cjs/models/CallsignStatus.js +0 -10
- package/cjs/models/ExternalProject.d.ts +0 -6
- package/cjs/models/ExternalProject.js +0 -6
- package/cjs/models/Token.spec.d.ts +0 -1
- package/cjs/models/Token.spec.js +0 -110
- package/cjs/services/AuthService.spec.d.ts +0 -1
- package/cjs/services/AuthService.spec.js +0 -165
- package/cjs/services/CallerService.spec.d.ts +0 -1
- package/cjs/services/CallerService.spec.js +0 -229
- package/cjs/services/FunctionService.d.ts +0 -68
- package/cjs/services/FunctionService.js +0 -103
- package/cjs/services/PlatformTimeService.spec.d.ts +0 -1
- package/cjs/services/PlatformTimeService.spec.js +0 -182
- package/cjs/services/RTPWebRTCService.spec.d.ts +0 -4
- package/cjs/services/RTPWebRTCService.spec.js +0 -171
- package/cjs/services/TelemetryService.spec.d.ts +0 -1
- package/cjs/services/TelemetryService.spec.js +0 -39
- package/esm/helpers/cleanObject.spec.d.ts +0 -1
- package/esm/helpers/cleanObject.spec.js +0 -53
- package/esm/helpers/flattenObject.spec.d.ts +0 -1
- package/esm/helpers/flattenObject.spec.js +0 -29
- package/esm/helpers/flattenOneOf.spec.d.ts +0 -1
- package/esm/helpers/flattenOneOf.spec.js +0 -157
- package/esm/helpers/formatServiceUrl.spec.d.ts +0 -1
- package/esm/helpers/formatServiceUrl.spec.js +0 -16
- package/esm/helpers/getSha256Hex.spec.d.ts +0 -1
- package/esm/helpers/getSha256Hex.spec.js +0 -14
- package/esm/helpers/getSha256HexNode.spec.d.ts +0 -1
- package/esm/helpers/getSha256HexNode.spec.js +0 -8
- package/esm/helpers/getURLSearchParams.spec.d.ts +0 -1
- package/esm/helpers/getURLSearchParams.spec.js +0 -19
- package/esm/helpers/nanosecondToMillisecond.spec.d.ts +0 -1
- package/esm/helpers/nanosecondToMillisecond.spec.js +0 -20
- package/esm/helpers/splitRobotTopic.spec.d.ts +0 -1
- package/esm/helpers/splitRobotTopic.spec.js +0 -51
- package/esm/helpers/standardDeviation.spec.d.ts +0 -1
- package/esm/helpers/standardDeviation.spec.js +0 -11
- package/esm/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
- package/esm/helpers/websandbox/frame/worker/manager.spec.js +0 -127
- package/esm/models/CallsignStatus.d.ts +0 -6
- package/esm/models/CallsignStatus.js +0 -7
- package/esm/models/ExternalProject.d.ts +0 -6
- package/esm/models/ExternalProject.js +0 -2
- package/esm/models/Token.spec.d.ts +0 -1
- package/esm/models/Token.spec.js +0 -108
- package/esm/models/asset-storage/AssetModelItem.js +0 -1
- package/esm/services/AuthService.spec.d.ts +0 -1
- package/esm/services/AuthService.spec.js +0 -163
- package/esm/services/CallerService.spec.d.ts +0 -1
- package/esm/services/CallerService.spec.js +0 -227
- package/esm/services/FunctionService.d.ts +0 -68
- package/esm/services/FunctionService.js +0 -99
- package/esm/services/PlatformTimeService.spec.d.ts +0 -1
- package/esm/services/PlatformTimeService.spec.js +0 -180
- package/esm/services/RTPWebRTCService.spec.d.ts +0 -4
- package/esm/services/RTPWebRTCService.spec.js +0 -169
- package/esm/services/TelemetryService.spec.d.ts +0 -1
- package/esm/services/TelemetryService.spec.js +0 -37
- /package/cjs/models/asset-storage/{AssetModelItem.js → AssetItem.js} +0 -0
- /package/{cjs/helpers/cleanObject.spec.d.ts → esm/models/asset-storage/AssetItem.js} +0 -0
- /package/{cjs/helpers/flattenObject.spec.d.ts → esm/models/device-credentials/DeviceCredentials.js} +0 -0
- /package/{cjs/helpers/flattenOneOf.spec.d.ts → esm/models/graph/Position.js} +0 -0
- /package/{cjs/helpers/formatServiceUrl.spec.d.ts → esm/models/graph/Quaternion.js} +0 -0
- /package/{cjs/helpers/getSha256Hex.spec.d.ts → esm/models/graph/Vector3.js} +0 -0
- /package/{cjs/helpers/getSha256HexNode.spec.d.ts → esm/models/integrations/Location.js} +0 -0
- /package/{cjs/helpers/getURLSearchParams.spec.d.ts → esm/models/integrations/PaginatedResults.js} +0 -0
- /package/{cjs/helpers/nanosecondToMillisecond.spec.d.ts → esm/models/projects/ExternalProject.js} +0 -0
- /package/{cjs/helpers/splitRobotTopic.spec.d.ts → esm/models/projects/NewProjectRequest.js} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AssetStorageService = void 0;
|
|
4
4
|
const api_1 = require("../constants/api");
|
|
5
|
-
const
|
|
5
|
+
const models_1 = require("../models");
|
|
6
6
|
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
|
7
7
|
const RocosLogger_1 = require("../logger/RocosLogger");
|
|
8
8
|
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
|
@@ -12,7 +12,7 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
12
12
|
this.logger = RocosLogger_1.RocosLogger.getInstance(`AssetStorageService(${this.config.url})`);
|
|
13
13
|
}
|
|
14
14
|
getError(e) {
|
|
15
|
-
return new
|
|
15
|
+
return new models_1.RocosError(e, models_1.errorCodes.ASSET_STORAGE_SERVICE_ERROR);
|
|
16
16
|
}
|
|
17
17
|
getStatus() {
|
|
18
18
|
return true;
|
|
@@ -24,7 +24,6 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
24
24
|
* @param filePath - Path to asset file
|
|
25
25
|
* @param file - File payload
|
|
26
26
|
*/
|
|
27
|
-
// TODO: map the response object
|
|
28
27
|
async create(projectId, filePath, file) {
|
|
29
28
|
const formData = new FormData();
|
|
30
29
|
formData.append('file', file);
|
|
@@ -37,7 +36,6 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
37
36
|
* @param filePath - Path to asset file
|
|
38
37
|
* @param file - File payload
|
|
39
38
|
*/
|
|
40
|
-
// TODO: map the response object
|
|
41
39
|
async update(projectId, filePath, file) {
|
|
42
40
|
const formData = new FormData();
|
|
43
41
|
formData.append('file', file);
|
|
@@ -59,7 +57,6 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
59
57
|
* @param projectId - Project Id
|
|
60
58
|
* @param filePath - Path to asset file
|
|
61
59
|
*/
|
|
62
|
-
// TODO: map the response object
|
|
63
60
|
async list(projectId, filePath) {
|
|
64
61
|
let url = '';
|
|
65
62
|
if (filePath) {
|
|
@@ -76,7 +73,6 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
76
73
|
* @param projectId - Project Id
|
|
77
74
|
* @param filePath - Path to asset file
|
|
78
75
|
*/
|
|
79
|
-
// TODO: map the response object
|
|
80
76
|
async getAsset(projectId, filePath) {
|
|
81
77
|
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ASSET_PATH_URL, { url: this.config.url, projectId, filePath }, this.config.insecure), `Failed to get asset for ${projectId}, filePath ${filePath}.`, undefined, {
|
|
82
78
|
responseType: 'blob',
|
|
@@ -131,26 +127,41 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
131
127
|
* @param projectId
|
|
132
128
|
* @param start Start date for the query (optional)
|
|
133
129
|
* @param end End date for the query (optional)
|
|
130
|
+
* @param includeObservations If observations should be included in the response (optional)
|
|
134
131
|
*/
|
|
135
|
-
async listMappedAssets(projectId, start, end) {
|
|
132
|
+
async listMappedAssets(projectId, start, end, includeObservations) {
|
|
136
133
|
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_MAPPED_ASSETS_PATH_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to list mapped assets for ${projectId}.`, {
|
|
137
134
|
start: start?.toISOString() ?? '',
|
|
138
135
|
end: end?.toISOString() ?? '',
|
|
136
|
+
includeObservations: includeObservations ? 'true' : 'false',
|
|
139
137
|
});
|
|
140
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Get mapped asset
|
|
141
|
+
*
|
|
142
|
+
* @param projectId
|
|
143
|
+
* @param assetId
|
|
144
|
+
*/
|
|
145
|
+
async getMappedAsset(projectId, assetId) {
|
|
146
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId, assetId }, this.config.insecure), `Failed to get mapped asset for ${projectId} and id: ${assetId}.`);
|
|
147
|
+
}
|
|
141
148
|
/**
|
|
142
149
|
* Set Robot Sync Definitions
|
|
143
150
|
* @param projectId
|
|
144
151
|
* @param callsign
|
|
145
152
|
* @param definition
|
|
153
|
+
* @param syncNow - Sync configured paths immediately
|
|
146
154
|
*/
|
|
147
|
-
setRobotSyncDefinitions(projectId, callsign, definition) {
|
|
155
|
+
setRobotSyncDefinitions(projectId, callsign, definition, syncNow = false) {
|
|
156
|
+
const url = (0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL, { url: this.config.url, projectId, callsign }, this.config.insecure);
|
|
148
157
|
const httpOptions = {
|
|
149
158
|
headers: {
|
|
150
159
|
'content-type': 'application/json',
|
|
151
160
|
},
|
|
152
161
|
};
|
|
153
|
-
return this.callPost(
|
|
162
|
+
return this.callPost(url, definition, `Failed to update asset for ${projectId}, callsign ${callsign}.`, httpOptions, {
|
|
163
|
+
syncNow,
|
|
164
|
+
});
|
|
154
165
|
}
|
|
155
166
|
/**
|
|
156
167
|
* Get Robot Sync Definitions
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
1
2
|
import { IBaseService, IRocosSDKConfig, RocosError, Token } from '../models';
|
|
2
3
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
3
4
|
export declare class AuthService extends BaseServiceAbstract implements IBaseService {
|
|
4
5
|
protected config: IRocosSDKConfig;
|
|
5
6
|
private token?;
|
|
6
7
|
private tokenRefreshTimeoutId?;
|
|
8
|
+
private tokenSubject$;
|
|
7
9
|
constructor(config: IRocosSDKConfig);
|
|
10
|
+
/** Observable for token updates
|
|
11
|
+
*
|
|
12
|
+
* This is useful for getting notified when the token changes.
|
|
13
|
+
* i.e. when the token is refreshed from the token refresh checker.
|
|
14
|
+
*
|
|
15
|
+
* It will emit the current token when you subscribe and then emit new tokens when they are set.
|
|
16
|
+
*/
|
|
17
|
+
get token$(): Observable<Token>;
|
|
8
18
|
getStatus(): boolean;
|
|
9
19
|
teardown(): void;
|
|
10
20
|
protected getError(e: RocosError): RocosError;
|
|
@@ -62,9 +72,10 @@ export declare class AuthService extends BaseServiceAbstract implements IBaseSer
|
|
|
62
72
|
* If you want to refresh the token regardless of the expiry time, use `refreshToken`.
|
|
63
73
|
*
|
|
64
74
|
* @param minutes the number of minutes before the token expires to refresh the token
|
|
75
|
+
* @returns true if the token was refreshed
|
|
65
76
|
* @see refreshToken
|
|
66
77
|
*/
|
|
67
|
-
refreshTokenIfExpired(minutes: number): Promise<
|
|
78
|
+
refreshTokenIfExpired(minutes: number): Promise<boolean>;
|
|
68
79
|
/** Start a 5-minute loop to check if the token needs to be refreshed
|
|
69
80
|
*
|
|
70
81
|
* This is useful when you are using GRPC services (i.e. telemetry) which does not automatically refresh the token.
|
|
@@ -2,21 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AuthService = void 0;
|
|
4
4
|
const api_1 = require("../constants/api");
|
|
5
|
+
const rxjs_1 = require("rxjs");
|
|
5
6
|
const models_1 = require("../models");
|
|
6
7
|
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
|
7
8
|
const RocosLogger_1 = require("../logger/RocosLogger");
|
|
8
9
|
const RocosStore_1 = require("../store/RocosStore");
|
|
10
|
+
const operators_1 = require("rxjs/operators");
|
|
9
11
|
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
|
10
12
|
const auth_1 = require("../constants/auth");
|
|
11
13
|
class AuthService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
12
14
|
constructor(config) {
|
|
13
15
|
super(config);
|
|
14
16
|
this.config = config;
|
|
17
|
+
this.tokenSubject$ = new rxjs_1.BehaviorSubject(null);
|
|
15
18
|
this.config = config;
|
|
16
19
|
this.logger = RocosLogger_1.RocosLogger.getInstance(`AuthService(${this.config.url})`);
|
|
17
20
|
if (this.config.token) {
|
|
18
21
|
this.setToken(this.config.token);
|
|
19
22
|
}
|
|
23
|
+
this.token$.subscribe((token) => {
|
|
24
|
+
RocosStore_1.RocosStore.getChangeSubject().next({ type: 'token', url: this.config.url, data: token.value });
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
/** Observable for token updates
|
|
28
|
+
*
|
|
29
|
+
* This is useful for getting notified when the token changes.
|
|
30
|
+
* i.e. when the token is refreshed from the token refresh checker.
|
|
31
|
+
*
|
|
32
|
+
* It will emit the current token when you subscribe and then emit new tokens when they are set.
|
|
33
|
+
*/
|
|
34
|
+
get token$() {
|
|
35
|
+
return this.tokenSubject$.asObservable().pipe((0, operators_1.filter)(Boolean));
|
|
20
36
|
}
|
|
21
37
|
getStatus() {
|
|
22
38
|
return true;
|
|
@@ -42,7 +58,12 @@ class AuthService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
42
58
|
}
|
|
43
59
|
this.config.token = this.token.value;
|
|
44
60
|
// output a message for token change
|
|
45
|
-
|
|
61
|
+
if (this.isTokenValid(this.token)) {
|
|
62
|
+
this.tokenSubject$.next(this.token);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
void this.getToken();
|
|
66
|
+
}
|
|
46
67
|
}
|
|
47
68
|
/**
|
|
48
69
|
* Clear token
|
|
@@ -166,6 +187,7 @@ class AuthService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
166
187
|
* If you want to refresh the token regardless of the expiry time, use `refreshToken`.
|
|
167
188
|
*
|
|
168
189
|
* @param minutes the number of minutes before the token expires to refresh the token
|
|
190
|
+
* @returns true if the token was refreshed
|
|
169
191
|
* @see refreshToken
|
|
170
192
|
*/
|
|
171
193
|
async refreshTokenIfExpired(minutes) {
|
|
@@ -173,7 +195,9 @@ class AuthService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
173
195
|
this.logger.info('Token expires in 15 minutes. Refreshing.');
|
|
174
196
|
const newToken = await this.refreshToken();
|
|
175
197
|
this.setToken(newToken);
|
|
198
|
+
return true;
|
|
176
199
|
}
|
|
200
|
+
return false;
|
|
177
201
|
}
|
|
178
202
|
/** Start a 5-minute loop to check if the token needs to be refreshed
|
|
179
203
|
*
|
|
@@ -21,7 +21,7 @@ export declare abstract class BaseServiceAbstract {
|
|
|
21
21
|
protected logger: Logger;
|
|
22
22
|
protected constructor(config: IRocosSDKConfig);
|
|
23
23
|
protected abstract getError(e: Error): RocosError;
|
|
24
|
-
protected callPost<Response = unknown, Payload = unknown>(url: string, payload: Payload, errorMessage: string, config?: RequestConfig): Promise<Response>;
|
|
24
|
+
protected callPost<Response = unknown, Payload = unknown>(url: string, payload: Payload, errorMessage: string, config?: RequestConfig, params?: QueryParams): Promise<Response>;
|
|
25
25
|
protected callPut<Response = unknown, Payload = unknown>(url: string, payload: Payload, errorMessage: string, config?: RequestConfig): Promise<Response>;
|
|
26
26
|
protected callDelete<Response = unknown, Payload = unknown>(url: string, errorMessage: string, payload?: Payload): Promise<Response>;
|
|
27
27
|
protected callGet<Response = unknown>(url: string, errorMessage: string, params?: QueryParams, config?: RequestConfig): Promise<Response>;
|
|
@@ -8,8 +8,8 @@ class BaseServiceAbstract {
|
|
|
8
8
|
constructor(config) {
|
|
9
9
|
this.config = config;
|
|
10
10
|
}
|
|
11
|
-
async callPost(url, payload, errorMessage, config) {
|
|
12
|
-
return this.call(url, 'POST', { errorMessage, payload, config });
|
|
11
|
+
async callPost(url, payload, errorMessage, config, params) {
|
|
12
|
+
return this.call(url, 'POST', { errorMessage, payload, config, params });
|
|
13
13
|
}
|
|
14
14
|
async callPut(url, payload, errorMessage, config) {
|
|
15
15
|
return this.call(url, 'PUT', { errorMessage, payload, config });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DeviceCredentialAuth, DeviceCredentialAuthResult, DeviceCredentialCreate, DeviceCredentials } from '../models/device-credentials/DeviceCredentials';
|
|
2
|
+
import { IBaseService, IRocosSDKConfig, RocosError } from '../models';
|
|
3
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
|
+
/**
|
|
5
|
+
* Manage external devices authenticating with the platform
|
|
6
|
+
*/
|
|
7
|
+
export declare class DeviceCredentialsService extends BaseServiceAbstract implements IBaseService {
|
|
8
|
+
constructor(config: IRocosSDKConfig);
|
|
9
|
+
getStatus(): boolean;
|
|
10
|
+
protected getError(e: Error): RocosError;
|
|
11
|
+
list(projectId: string, callsign: string): Promise<DeviceCredentials>;
|
|
12
|
+
create(projectId: string, callsign: string, credentials: DeviceCredentialCreate, disableValidation?: boolean): Promise<DeviceCredentialCreate>;
|
|
13
|
+
delete(projectId: string, callsign: string, component: string, system: string): Promise<void>;
|
|
14
|
+
auth(credentials: DeviceCredentialAuth): Promise<DeviceCredentialAuthResult>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceCredentialsService = void 0;
|
|
4
|
+
const api_1 = require("../constants/api");
|
|
5
|
+
const models_1 = require("../models");
|
|
6
|
+
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
|
7
|
+
const RocosLogger_1 = require("../logger/RocosLogger");
|
|
8
|
+
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
|
9
|
+
/**
|
|
10
|
+
* Manage external devices authenticating with the platform
|
|
11
|
+
*/
|
|
12
|
+
class DeviceCredentialsService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super(config);
|
|
15
|
+
this.logger = RocosLogger_1.RocosLogger.getInstance(`DeviceCredentials(${this.config.url})`);
|
|
16
|
+
}
|
|
17
|
+
getStatus() {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
getError(e) {
|
|
21
|
+
return new models_1.RocosError(e, models_1.errorCodes.DEVICE_CREDENTIALS_SERVICE_ERROR);
|
|
22
|
+
}
|
|
23
|
+
list(projectId, callsign) {
|
|
24
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
|
25
|
+
url: this.config.url,
|
|
26
|
+
projectId,
|
|
27
|
+
callsign,
|
|
28
|
+
}, this.config.insecure), 'Failed to get device credentials.');
|
|
29
|
+
}
|
|
30
|
+
create(projectId, callsign, credentials, disableValidation = false) {
|
|
31
|
+
let queryParams;
|
|
32
|
+
if (disableValidation) {
|
|
33
|
+
queryParams = {
|
|
34
|
+
validate: false,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
|
38
|
+
url: this.config.url,
|
|
39
|
+
projectId,
|
|
40
|
+
callsign,
|
|
41
|
+
}, this.config.insecure), credentials, 'Failed to create device credentials.', undefined, queryParams);
|
|
42
|
+
}
|
|
43
|
+
delete(projectId, callsign, component, system) {
|
|
44
|
+
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_URL, {
|
|
45
|
+
url: this.config.url,
|
|
46
|
+
projectId,
|
|
47
|
+
callsign,
|
|
48
|
+
}, this.config.insecure), 'Failed to delete device credentials.', { component, system });
|
|
49
|
+
}
|
|
50
|
+
auth(credentials) {
|
|
51
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DEVICE_CREDENTIALS_AUTH_URL, {
|
|
52
|
+
url: this.config.url,
|
|
53
|
+
}, this.config.insecure), credentials, 'Failed to delete device credentials.');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.DeviceCredentialsService = DeviceCredentialsService;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IBaseService, IRocosSDKConfig, RocosError } from '../models';
|
|
2
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
3
|
+
/**
|
|
4
|
+
* Service responsible for saving and retrieving the project environment from Giraffe.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EnvironmentService extends BaseServiceAbstract implements IBaseService {
|
|
7
|
+
constructor(config: IRocosSDKConfig);
|
|
8
|
+
protected getError(e: Error): RocosError;
|
|
9
|
+
getStatus(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Get Environment
|
|
12
|
+
*
|
|
13
|
+
* @param projectId - Project Id
|
|
14
|
+
*/
|
|
15
|
+
get(projectId: string): Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Update Environment
|
|
18
|
+
*
|
|
19
|
+
* @param projectId - Project Id
|
|
20
|
+
*/
|
|
21
|
+
update(projectId: string, scene: unknown): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Delete Environment
|
|
24
|
+
*
|
|
25
|
+
* @param projectId - Project Id
|
|
26
|
+
*/
|
|
27
|
+
delete(projectId: string): Promise<void>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EnvironmentService = void 0;
|
|
4
|
+
const models_1 = require("../models");
|
|
5
|
+
const api_1 = require("../constants/api");
|
|
6
|
+
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
|
7
|
+
const RocosLogger_1 = require("../logger/RocosLogger");
|
|
8
|
+
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
|
9
|
+
/**
|
|
10
|
+
* Service responsible for saving and retrieving the project environment from Giraffe.
|
|
11
|
+
*/
|
|
12
|
+
class EnvironmentService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
super(config);
|
|
15
|
+
this.logger = RocosLogger_1.RocosLogger.getInstance(`EnvironmentService(${this.config.url})`);
|
|
16
|
+
}
|
|
17
|
+
getError(e) {
|
|
18
|
+
return new models_1.RocosError(e, models_1.errorCodes.ENVIRONMENT_SERVICE_ERROR);
|
|
19
|
+
}
|
|
20
|
+
getStatus() {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get Environment
|
|
25
|
+
*
|
|
26
|
+
* @param projectId - Project Id
|
|
27
|
+
*/
|
|
28
|
+
async get(projectId) {
|
|
29
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to get environment for ${projectId}.`);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Update Environment
|
|
33
|
+
*
|
|
34
|
+
* @param projectId - Project Id
|
|
35
|
+
*/
|
|
36
|
+
async update(projectId, scene) {
|
|
37
|
+
return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), scene, `Failed to update environment for ${projectId}.`);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Delete Environment
|
|
41
|
+
*
|
|
42
|
+
* @param projectId - Project Id
|
|
43
|
+
*/
|
|
44
|
+
async delete(projectId) {
|
|
45
|
+
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to update environment for ${projectId}.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.EnvironmentService = EnvironmentService;
|
|
@@ -22,7 +22,7 @@ class EvaluatorService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
22
22
|
}
|
|
23
23
|
async teardown() {
|
|
24
24
|
const sandbox = await this.sandbox;
|
|
25
|
-
sandbox.destroy();
|
|
25
|
+
sandbox.destroy('evaluator service torn down');
|
|
26
26
|
}
|
|
27
27
|
async execute(code, context, options) {
|
|
28
28
|
const sandbox = await this.sandbox;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBaseService, IRocosSDKConfig, Overlay, Plan, RocosError } from '../models';
|
|
1
|
+
import { IBaseService, IRocosSDKConfig, Location, Overlay, PaginatedResults, Plan, RocosError } from '../models';
|
|
2
2
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
3
3
|
/**
|
|
4
4
|
* Integrations to retrieve data from the linked project in DroneDeploy
|
|
@@ -45,4 +45,10 @@ export declare class IntegrationService extends BaseServiceAbstract implements I
|
|
|
45
45
|
lat: number;
|
|
46
46
|
lng: number;
|
|
47
47
|
}): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Gets locations for the provided project ID
|
|
50
|
+
* @param projectId Project ID
|
|
51
|
+
* @returns Plans list (limited to 50)
|
|
52
|
+
*/
|
|
53
|
+
getLocations(projectId: string, pageStart?: string): Promise<PaginatedResults<Location>>;
|
|
48
54
|
}
|
|
@@ -72,5 +72,13 @@ class IntegrationService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
72
72
|
lng: location.lng,
|
|
73
73
|
}, 'Failed to create issue.');
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Gets locations for the provided project ID
|
|
77
|
+
* @param projectId Project ID
|
|
78
|
+
* @returns Plans list (limited to 50)
|
|
79
|
+
*/
|
|
80
|
+
async getLocations(projectId, pageStart) {
|
|
81
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_DD_INTEGRATION_LOCATIONS_URL, { url: this.config.url, projectId }, this.config.insecure), 'Failed to get locations.', pageStart ? { page_start: pageStart } : undefined);
|
|
82
|
+
}
|
|
75
83
|
}
|
|
76
84
|
exports.IntegrationService = IntegrationService;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { IBaseService, IRocosSDKConfig, Map, RocosError } from '../models';
|
|
1
|
+
import { Asset, IBaseService, IRocosSDKConfig, Map, RocosError } from '../models';
|
|
2
|
+
import { CreateObservation, Observation } from '../models/maps/Panorama';
|
|
2
3
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
3
|
-
import { Observation } from '../models/maps/Panorama';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Maps service for managing robot maps in the cloud and on robots
|
|
6
6
|
*/
|
|
7
7
|
export declare class MapService extends BaseServiceAbstract implements IBaseService {
|
|
8
|
+
getObservations: (projectId: string, key?: string, frameID?: string) => Promise<Asset[]>;
|
|
9
|
+
getObservationsKeys: (projectId: string) => Promise<string[]>;
|
|
8
10
|
constructor(config: IRocosSDKConfig);
|
|
9
11
|
getStatus(): boolean;
|
|
10
12
|
protected getError(e: Error): RocosError;
|
|
@@ -122,7 +124,7 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
|
|
|
122
124
|
* @param observations An array of Observation objects to create.
|
|
123
125
|
* @returns A Promise that resolves when the observations have been created.
|
|
124
126
|
*/
|
|
125
|
-
createObservations(projectId: string, panoramaId: string, observations:
|
|
127
|
+
createObservations(projectId: string, panoramaId: string, observations: CreateObservation[]): Promise<void>;
|
|
126
128
|
/**
|
|
127
129
|
* Gets observations for a project.
|
|
128
130
|
*
|
|
@@ -131,12 +133,20 @@ export declare class MapService extends BaseServiceAbstract implements IBaseServ
|
|
|
131
133
|
* @param frameID (optional) Transforms on a seed frame
|
|
132
134
|
* @returns A list of observations
|
|
133
135
|
*/
|
|
134
|
-
|
|
136
|
+
getAssets(projectId: string, key?: string, frameID?: string): Promise<Asset[]>;
|
|
135
137
|
/**
|
|
136
|
-
* Lists available keys for all
|
|
138
|
+
* Lists available keys for all assets in a project.
|
|
137
139
|
*
|
|
138
140
|
* @param projectId The ID of the project the observations belongs to.
|
|
139
|
-
* @returns A list of
|
|
141
|
+
* @returns A list of assets
|
|
142
|
+
*/
|
|
143
|
+
getAssetsKeys(projectId: string): Promise<string[]>;
|
|
144
|
+
/**
|
|
145
|
+
* Deletes a panorama by panoramaID.
|
|
146
|
+
*
|
|
147
|
+
* @param projectId The ID of the project the panorama belongs to.
|
|
148
|
+
* @param panoramaId The ID of the panorama to delete.
|
|
149
|
+
* @returns A Promise.
|
|
140
150
|
*/
|
|
141
|
-
|
|
151
|
+
deletePanorama(projectId: string, panoramaId: string): Promise<void>;
|
|
142
152
|
}
|
|
@@ -7,11 +7,19 @@ const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
|
|
7
7
|
const RocosLogger_1 = require("../logger/RocosLogger");
|
|
8
8
|
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Maps service for managing robot maps in the cloud and on robots
|
|
11
11
|
*/
|
|
12
12
|
class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
13
13
|
constructor(config) {
|
|
14
14
|
super(config);
|
|
15
|
+
/*
|
|
16
|
+
* @deprecated use getAssets instead
|
|
17
|
+
*/
|
|
18
|
+
this.getObservations = this.getAssets;
|
|
19
|
+
/*
|
|
20
|
+
* @deprecated use getAssetKeys instead
|
|
21
|
+
*/
|
|
22
|
+
this.getObservationsKeys = this.getAssetsKeys;
|
|
15
23
|
this.logger = RocosLogger_1.RocosLogger.getInstance(`MapService(${this.config.url})`);
|
|
16
24
|
}
|
|
17
25
|
getStatus() {
|
|
@@ -21,7 +29,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
21
29
|
return new models_1.RocosError(e, models_1.errorCodes.MAPS_SERVICE_ERROR);
|
|
22
30
|
}
|
|
23
31
|
async list(projectId, callsign) {
|
|
24
|
-
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
32
|
+
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_URL, {
|
|
25
33
|
url: this.config.url,
|
|
26
34
|
projectId,
|
|
27
35
|
}, this.config.insecure), 'Failed to get maps.', callsign ? { callsign } : undefined);
|
|
@@ -34,7 +42,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
34
42
|
*/
|
|
35
43
|
async listDeployedMaps(projectId, callsign) {
|
|
36
44
|
const safeCallsign = encodeURIComponent(callsign);
|
|
37
|
-
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
45
|
+
const resp = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_DEPLOYED_URL, {
|
|
38
46
|
url: this.config.url,
|
|
39
47
|
projectId,
|
|
40
48
|
callsign: safeCallsign,
|
|
@@ -58,7 +66,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
58
66
|
description: options.description,
|
|
59
67
|
callsign: options.callsign,
|
|
60
68
|
};
|
|
61
|
-
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
69
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_MERGE_URL, {
|
|
62
70
|
url: this.config.url,
|
|
63
71
|
projectId,
|
|
64
72
|
}, this.config.insecure), payload, 'Failed to merge maps.');
|
|
@@ -69,7 +77,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
69
77
|
* @param mapId Map ID
|
|
70
78
|
*/
|
|
71
79
|
async get(projectId, mapId) {
|
|
72
|
-
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
80
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_ID_URL, {
|
|
73
81
|
url: this.config.url,
|
|
74
82
|
projectId,
|
|
75
83
|
mapId,
|
|
@@ -82,7 +90,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
82
90
|
* @param options New metadata
|
|
83
91
|
*/
|
|
84
92
|
async update(projectId, mapId, options) {
|
|
85
|
-
return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
93
|
+
return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_ID_URL, {
|
|
86
94
|
url: this.config.url,
|
|
87
95
|
projectId,
|
|
88
96
|
mapId,
|
|
@@ -97,14 +105,14 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
97
105
|
* @param hash Map hash
|
|
98
106
|
*/
|
|
99
107
|
async sendToCloud(projectId, mapId, callsign, hash) {
|
|
100
|
-
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
108
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_ID_URL, {
|
|
101
109
|
url: this.config.url,
|
|
102
110
|
projectId,
|
|
103
111
|
mapId,
|
|
104
112
|
}, this.config.insecure), { callsign, hash }, 'Failed to start map upload.');
|
|
105
113
|
}
|
|
106
114
|
async delete(projectId, mapId, callsign, hash) {
|
|
107
|
-
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
115
|
+
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAP_ID_URL, {
|
|
108
116
|
url: this.config.url,
|
|
109
117
|
projectId,
|
|
110
118
|
mapId,
|
|
@@ -118,7 +126,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
118
126
|
* @param options Options to create the new map
|
|
119
127
|
*/
|
|
120
128
|
async copy(projectId, mapId, options) {
|
|
121
|
-
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
129
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_COPY_URL, {
|
|
122
130
|
url: this.config.url,
|
|
123
131
|
projectId,
|
|
124
132
|
mapId,
|
|
@@ -131,7 +139,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
131
139
|
* @param callsign Robot callsign
|
|
132
140
|
*/
|
|
133
141
|
async deploy(projectId, mapId, callsign) {
|
|
134
|
-
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
142
|
+
return this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_DEPLOY_URL, {
|
|
135
143
|
url: this.config.url,
|
|
136
144
|
projectId,
|
|
137
145
|
mapId,
|
|
@@ -149,7 +157,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
149
157
|
projectId,
|
|
150
158
|
mapId,
|
|
151
159
|
};
|
|
152
|
-
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
160
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_MAPS_GEOJSON_URL, params, this.config.insecure), 'Failed to get map GeoJSON.', frameId ? { frameID: frameId } : undefined);
|
|
153
161
|
}
|
|
154
162
|
/**
|
|
155
163
|
* Returns a Promise that resolves to an array of Observation objects for the given panorama ID.
|
|
@@ -159,7 +167,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
159
167
|
* @returns A Promise that resolves to an array of Observation objects.
|
|
160
168
|
*/
|
|
161
169
|
listObservations(projectId, panoramaId) {
|
|
162
|
-
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
170
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_PANORAMA_OBSERVATIONS_URL, { url: this.config.url, projectId, panoramaId }, this.config.insecure), 'Failed to list observations.');
|
|
163
171
|
}
|
|
164
172
|
/**
|
|
165
173
|
* Creates new observations on a panorama.
|
|
@@ -170,7 +178,7 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
170
178
|
* @returns A Promise that resolves when the observations have been created.
|
|
171
179
|
*/
|
|
172
180
|
createObservations(projectId, panoramaId, observations) {
|
|
173
|
-
return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
181
|
+
return this.callPut((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_PANORAMA_OBSERVATIONS_URL, { url: this.config.url, projectId, panoramaId }, this.config.insecure), observations, 'Failed to update observations.');
|
|
174
182
|
}
|
|
175
183
|
/**
|
|
176
184
|
* Gets observations for a project.
|
|
@@ -180,17 +188,27 @@ class MapService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
|
|
180
188
|
* @param frameID (optional) Transforms on a seed frame
|
|
181
189
|
* @returns A list of observations
|
|
182
190
|
*/
|
|
183
|
-
|
|
184
|
-
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.
|
|
191
|
+
getAssets(projectId, key = '', frameID = '') {
|
|
192
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_OBSERVATIONS_URL, { url: this.config.url, projectId }, this.config.insecure), 'Failed to get assets.', { key, frameID });
|
|
185
193
|
}
|
|
186
194
|
/**
|
|
187
|
-
* Lists available keys for all
|
|
195
|
+
* Lists available keys for all assets in a project.
|
|
188
196
|
*
|
|
189
197
|
* @param projectId The ID of the project the observations belongs to.
|
|
190
|
-
* @returns A list of
|
|
198
|
+
* @returns A list of assets
|
|
199
|
+
*/
|
|
200
|
+
getAssetsKeys(projectId) {
|
|
201
|
+
return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_OBSERVATION_KEYS_URL, { url: this.config.url, projectId }, this.config.insecure), 'Failed to get asset keys.');
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Deletes a panorama by panoramaID.
|
|
205
|
+
*
|
|
206
|
+
* @param projectId The ID of the project the panorama belongs to.
|
|
207
|
+
* @param panoramaId The ID of the panorama to delete.
|
|
208
|
+
* @returns A Promise.
|
|
191
209
|
*/
|
|
192
|
-
|
|
193
|
-
return this.
|
|
210
|
+
deletePanorama(projectId, panoramaId) {
|
|
211
|
+
return this.callDelete((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_GRAPHS_PANORAMA, { url: this.config.url, projectId, panoramaId }, this.config.insecure), 'Failed to delete panorama.');
|
|
194
212
|
}
|
|
195
213
|
}
|
|
196
214
|
exports.MapService = MapService;
|
|
@@ -232,6 +232,30 @@ export declare class ProfileService extends BaseServiceAbstract implements IBase
|
|
|
232
232
|
* @description - Renamed from robotDefGetGamepads
|
|
233
233
|
*/
|
|
234
234
|
getGamepads(projectId: string, definitionId: string): Promise<any>;
|
|
235
|
+
/** Export robot definition into JSON format
|
|
236
|
+
*
|
|
237
|
+
* Can be used to import robot definition into another project
|
|
238
|
+
*
|
|
239
|
+
* @param projectId - Project Id
|
|
240
|
+
* @param definitionId - Robot definition Id
|
|
241
|
+
*
|
|
242
|
+
* @see import
|
|
243
|
+
*/
|
|
244
|
+
export(projectId: string, definitionId: string): Promise<Record<string, unknown>>;
|
|
245
|
+
/** Import robot definition from JSON format
|
|
246
|
+
*
|
|
247
|
+
* Accepts a previously exported robot definition
|
|
248
|
+
*
|
|
249
|
+
* @param projectId - Project Id
|
|
250
|
+
* @param profileData - Robot definition data
|
|
251
|
+
* @param newName - Optional new name for the robot definition. If not provided, the name from the imported definition will be used.
|
|
252
|
+
* @param newDescription - Optional new description for the robot definition. If not provided, the description from the imported definition will be used.
|
|
253
|
+
*
|
|
254
|
+
* @see export
|
|
255
|
+
*/
|
|
256
|
+
import(projectId: string, profileData: Blob | File, newName?: string, newDescription?: string): Promise<{
|
|
257
|
+
profileId: string;
|
|
258
|
+
}>;
|
|
235
259
|
/**
|
|
236
260
|
* Update gamepads for a robot definition
|
|
237
261
|
*
|