@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
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Quaternion } from '../graph/Quaternion';
|
|
2
|
+
import { Vector3 } from '../graph/Vector3';
|
|
3
|
+
export interface TargetBase {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
data?: Record<string, string>;
|
|
7
|
+
translation?: Vector3;
|
|
8
|
+
rotation?: Quaternion;
|
|
9
|
+
media?: TargetMedia[];
|
|
10
|
+
position?: TargetWgs84 | Vector3;
|
|
11
|
+
frame?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface TargetMedia {
|
|
14
|
+
id: string;
|
|
15
|
+
data: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
export interface TargetWgs84 {
|
|
18
|
+
lat: number;
|
|
19
|
+
lon: number;
|
|
20
|
+
alt?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const isTargetWgs84: (position: TargetWgs84 | Vector3) => position is TargetWgs84;
|
|
23
|
+
export interface Target extends TargetBase {
|
|
24
|
+
type: 'TARGET';
|
|
25
|
+
}
|
|
26
|
+
export declare const isTarget: (target: Target | Asset) => target is Target;
|
|
27
|
+
export interface Asset extends TargetBase {
|
|
28
|
+
type: 'ASSET';
|
|
29
|
+
}
|
|
30
|
+
export declare const isAsset: (target: Target | Asset) => target is Asset;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export const isTargetWgs84 = (position) => {
|
|
2
|
+
return Boolean(position) && 'lat' in position && 'lon' in position;
|
|
3
|
+
};
|
|
4
|
+
export const isTarget = (target) => {
|
|
5
|
+
return target.type === 'TARGET';
|
|
6
|
+
};
|
|
7
|
+
export const isAsset = (target) => {
|
|
8
|
+
return target.type === 'ASSET';
|
|
9
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EvaluatorService
|
|
1
|
+
import { EvaluatorService } from '../services';
|
|
2
2
|
import { IBaseService, ServiceEnum } from '../models';
|
|
3
3
|
import { CallerServiceNode } from '../services/CallerServiceNode';
|
|
4
4
|
import { CommandServiceNode } from '../services/CommandServiceNode';
|
|
@@ -13,10 +13,6 @@ export declare class RocosSDKNode extends RocosSDK {
|
|
|
13
13
|
* Gets the telemetry service.
|
|
14
14
|
*/
|
|
15
15
|
getTelemetryService(): TelemetryServiceNode;
|
|
16
|
-
/**
|
|
17
|
-
* Gets the scheduler service.
|
|
18
|
-
*/
|
|
19
|
-
getSchedulerService(): ScheduleService;
|
|
20
16
|
/**
|
|
21
17
|
* Gets the service call service.
|
|
22
18
|
*/
|
package/esm/node/RocosSDKNode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssetStorageService, AuthService, ConfigGroupService, DashboardService,
|
|
1
|
+
import { AssetStorageService, AuthService, ConfigGroupService, DashboardService, DeviceCredentialsService, EnvironmentService, EventService, IntegrationService, MapService, ProfileService, ProjectService, RobotService, ScheduleService, SpotProvisioningServiceNode, StreamService, TargetService, UserService, } from '../services';
|
|
2
2
|
import { ServiceEnum } from '../models';
|
|
3
3
|
import { CallerServiceNode } from '../services/CallerServiceNode';
|
|
4
4
|
import { CommandServiceNode } from '../services/CommandServiceNode';
|
|
@@ -24,6 +24,9 @@ export class RocosSDKNode extends RocosSDK {
|
|
|
24
24
|
case ServiceEnum.ROBOT:
|
|
25
25
|
this.services[name] = new RobotService(config);
|
|
26
26
|
break;
|
|
27
|
+
case ServiceEnum.ENVIRONMENT:
|
|
28
|
+
this.services[name] = new EnvironmentService(config);
|
|
29
|
+
break;
|
|
27
30
|
case ServiceEnum.EVENT:
|
|
28
31
|
this.services[name] = new EventService(config);
|
|
29
32
|
break;
|
|
@@ -48,9 +51,6 @@ export class RocosSDKNode extends RocosSDK {
|
|
|
48
51
|
case ServiceEnum.DASHBOARD:
|
|
49
52
|
this.services[name] = new DashboardService(config);
|
|
50
53
|
break;
|
|
51
|
-
case ServiceEnum.FUNCTION:
|
|
52
|
-
this.services[name] = new FunctionService(config);
|
|
53
|
-
break;
|
|
54
54
|
case ServiceEnum.STREAM:
|
|
55
55
|
this.services[name] = new StreamService(config);
|
|
56
56
|
break;
|
|
@@ -81,6 +81,12 @@ export class RocosSDKNode extends RocosSDK {
|
|
|
81
81
|
case ServiceEnum.MAP:
|
|
82
82
|
this.services[name] = new MapService(config);
|
|
83
83
|
break;
|
|
84
|
+
case ServiceEnum.DEVICE_CREDENTIALS:
|
|
85
|
+
this.services[name] = new DeviceCredentialsService(config);
|
|
86
|
+
break;
|
|
87
|
+
case ServiceEnum.TARGET:
|
|
88
|
+
this.services[name] = new TargetService(config);
|
|
89
|
+
break;
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
this.logger.debug(`Found service ${name}.`);
|
|
@@ -92,12 +98,6 @@ export class RocosSDKNode extends RocosSDK {
|
|
|
92
98
|
getTelemetryService() {
|
|
93
99
|
return this.getService(ServiceEnum.TELEMETRY);
|
|
94
100
|
}
|
|
95
|
-
/**
|
|
96
|
-
* Gets the scheduler service.
|
|
97
|
-
*/
|
|
98
|
-
getSchedulerService() {
|
|
99
|
-
return this.getService(ServiceEnum.SCHEDULE);
|
|
100
|
-
}
|
|
101
101
|
/**
|
|
102
102
|
* Gets the service call service.
|
|
103
103
|
*/
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import { AssetItemModel, AssetItemWithObservationsModel,
|
|
2
|
-
import { RocosError } from '../models/RocosError';
|
|
1
|
+
import { AssetItemModel, AssetItemWithObservationsModel, AssetSyncDefinitionsModel, AssetSyncIntegrationModel, AssetSyncIntegrationProviderModel, CreateAssetSyncIntegrationModel, IBaseService, IRocosSDKConfig, RocosError } from '../models';
|
|
3
2
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
|
-
import { IBaseService } from '../models/IBaseService';
|
|
5
|
-
import { IRocosSDKConfig } from '../models/IRocosSDKConfig';
|
|
6
|
-
import { CreateAssetSyncIntegrationModel } from '../models/asset-storage/SyncIntegrations';
|
|
7
3
|
export declare class AssetStorageService extends BaseServiceAbstract implements IBaseService {
|
|
8
4
|
constructor(config: IRocosSDKConfig);
|
|
9
5
|
protected getError(e: Error): RocosError;
|
|
@@ -15,7 +11,7 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
|
|
|
15
11
|
* @param filePath - Path to asset file
|
|
16
12
|
* @param file - File payload
|
|
17
13
|
*/
|
|
18
|
-
create(projectId: string, filePath: string, file: File): Promise<
|
|
14
|
+
create(projectId: string, filePath: string, file: File): Promise<AssetItemModel>;
|
|
19
15
|
/**
|
|
20
16
|
* Update a project asset
|
|
21
17
|
*
|
|
@@ -23,28 +19,23 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
|
|
|
23
19
|
* @param filePath - Path to asset file
|
|
24
20
|
* @param file - File payload
|
|
25
21
|
*/
|
|
26
|
-
update(projectId: string, filePath: string, file: File): Promise<
|
|
22
|
+
update(projectId: string, filePath: string, file: File): Promise<AssetItemModel>;
|
|
27
23
|
/**
|
|
28
24
|
* Delete a project asset
|
|
29
25
|
*
|
|
30
26
|
* @param projectId - Project Id
|
|
31
27
|
* @param filePath - Path to asset file
|
|
32
28
|
*/
|
|
33
|
-
delete(projectId: string, filePath: string): Promise<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
* @param projectId - Project Id
|
|
38
|
-
* @param filePath - Path to asset file
|
|
39
|
-
*/
|
|
40
|
-
list(projectId: string, filePath?: string): Promise<any>;
|
|
29
|
+
delete(projectId: string, filePath: string): Promise<unknown>;
|
|
30
|
+
list(projectId: string): Promise<AssetItemModel[]>;
|
|
31
|
+
list(projectId: string, filePath: string): Promise<unknown>;
|
|
41
32
|
/**
|
|
42
33
|
* Get a project asset
|
|
43
34
|
*
|
|
44
35
|
* @param projectId - Project Id
|
|
45
36
|
* @param filePath - Path to asset file
|
|
46
37
|
*/
|
|
47
|
-
getAsset(projectId: string, filePath: string): Promise<
|
|
38
|
+
getAsset(projectId: string, filePath: string): Promise<Blob>;
|
|
48
39
|
/**
|
|
49
40
|
* List assets for a robot
|
|
50
41
|
*
|
|
@@ -84,15 +75,24 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
|
|
|
84
75
|
* @param projectId
|
|
85
76
|
* @param start Start date for the query (optional)
|
|
86
77
|
* @param end End date for the query (optional)
|
|
78
|
+
* @param includeObservations If observations should be included in the response (optional)
|
|
79
|
+
*/
|
|
80
|
+
listMappedAssets(projectId: string, start?: Date, end?: Date, includeObservations?: boolean): Promise<AssetItemWithObservationsModel[]>;
|
|
81
|
+
/**
|
|
82
|
+
* Get mapped asset
|
|
83
|
+
*
|
|
84
|
+
* @param projectId
|
|
85
|
+
* @param assetId
|
|
87
86
|
*/
|
|
88
|
-
|
|
87
|
+
getMappedAsset(projectId: string, assetId: string): Promise<AssetItemWithObservationsModel>;
|
|
89
88
|
/**
|
|
90
89
|
* Set Robot Sync Definitions
|
|
91
90
|
* @param projectId
|
|
92
91
|
* @param callsign
|
|
93
92
|
* @param definition
|
|
93
|
+
* @param syncNow - Sync configured paths immediately
|
|
94
94
|
*/
|
|
95
|
-
setRobotSyncDefinitions(projectId: string, callsign: string, definition:
|
|
95
|
+
setRobotSyncDefinitions(projectId: string, callsign: string, definition: AssetSyncDefinitionsModel, syncNow?: boolean): Promise<AssetSyncDefinitionsModel>;
|
|
96
96
|
/**
|
|
97
97
|
* Get Robot Sync Definitions
|
|
98
98
|
* @param projectId
|
|
@@ -105,7 +105,7 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
|
|
|
105
105
|
* @param profileId
|
|
106
106
|
* @param definition
|
|
107
107
|
*/
|
|
108
|
-
setProfileSyncDefinitions(projectId: string, profileId: string, definition:
|
|
108
|
+
setProfileSyncDefinitions(projectId: string, profileId: string, definition: AssetSyncDefinitionsModel): Promise<AssetSyncDefinitionsModel>;
|
|
109
109
|
/**
|
|
110
110
|
* Get Profile Sync Definitions
|
|
111
111
|
* @param projectId
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { API_PROJECT_ASSET_INTEGRATIONS_PATH_URL, API_PROJECT_ASSET_INTEGRATION_PATH_URL, API_PROJECT_ASSET_INTEGRATION_PROVIDERS_PATH_URL, API_PROJECT_ASSET_PATH_URL, API_PROJECT_ASSET_PROFILES_SYNC_DEFINITION_PATH_URL, API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL, API_PROJECT_ASSET_URL, API_PROJECT_FLOW_ASSET_PATH_URL, API_PROJECT_MAPPED_ASSETS_PATH_URL, API_PROJECT_MISSION_ASSETS_PATH_URL, API_PROJECT_MISSION_ASSET_PATH_URL, API_PROJECT_ROBOT_ASSET_PATH_URL, } from '../constants/api';
|
|
2
|
-
import { RocosError, errorCodes } from '../models
|
|
1
|
+
import { API_PROJECT_ASSET_INTEGRATIONS_PATH_URL, API_PROJECT_ASSET_INTEGRATION_PATH_URL, API_PROJECT_ASSET_INTEGRATION_PROVIDERS_PATH_URL, API_PROJECT_ASSET_PATH_URL, API_PROJECT_ASSET_PROFILES_SYNC_DEFINITION_PATH_URL, API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL, API_PROJECT_ASSET_URL, API_PROJECT_FLOW_ASSET_PATH_URL, API_PROJECT_MAPPED_ASSETS_PATH_URL, API_PROJECT_MAPPED_ASSET_PATH_URL, API_PROJECT_MISSION_ASSETS_PATH_URL, API_PROJECT_MISSION_ASSET_PATH_URL, API_PROJECT_ROBOT_ASSET_PATH_URL, } from '../constants/api';
|
|
2
|
+
import { RocosError, errorCodes, } from '../models';
|
|
3
3
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
4
|
import { RocosLogger } from '../logger/RocosLogger';
|
|
5
5
|
import { formatServiceUrl } from '../helpers/formatServiceUrl';
|
|
@@ -21,7 +21,6 @@ export class AssetStorageService extends BaseServiceAbstract {
|
|
|
21
21
|
* @param filePath - Path to asset file
|
|
22
22
|
* @param file - File payload
|
|
23
23
|
*/
|
|
24
|
-
// TODO: map the response object
|
|
25
24
|
async create(projectId, filePath, file) {
|
|
26
25
|
const formData = new FormData();
|
|
27
26
|
formData.append('file', file);
|
|
@@ -34,7 +33,6 @@ export class AssetStorageService extends BaseServiceAbstract {
|
|
|
34
33
|
* @param filePath - Path to asset file
|
|
35
34
|
* @param file - File payload
|
|
36
35
|
*/
|
|
37
|
-
// TODO: map the response object
|
|
38
36
|
async update(projectId, filePath, file) {
|
|
39
37
|
const formData = new FormData();
|
|
40
38
|
formData.append('file', file);
|
|
@@ -56,7 +54,6 @@ export class AssetStorageService extends BaseServiceAbstract {
|
|
|
56
54
|
* @param projectId - Project Id
|
|
57
55
|
* @param filePath - Path to asset file
|
|
58
56
|
*/
|
|
59
|
-
// TODO: map the response object
|
|
60
57
|
async list(projectId, filePath) {
|
|
61
58
|
let url = '';
|
|
62
59
|
if (filePath) {
|
|
@@ -73,7 +70,6 @@ export class AssetStorageService extends BaseServiceAbstract {
|
|
|
73
70
|
* @param projectId - Project Id
|
|
74
71
|
* @param filePath - Path to asset file
|
|
75
72
|
*/
|
|
76
|
-
// TODO: map the response object
|
|
77
73
|
async getAsset(projectId, filePath) {
|
|
78
74
|
return this.callGet(formatServiceUrl(API_PROJECT_ASSET_PATH_URL, { url: this.config.url, projectId, filePath }, this.config.insecure), `Failed to get asset for ${projectId}, filePath ${filePath}.`, undefined, {
|
|
79
75
|
responseType: 'blob',
|
|
@@ -128,26 +124,41 @@ export class AssetStorageService extends BaseServiceAbstract {
|
|
|
128
124
|
* @param projectId
|
|
129
125
|
* @param start Start date for the query (optional)
|
|
130
126
|
* @param end End date for the query (optional)
|
|
127
|
+
* @param includeObservations If observations should be included in the response (optional)
|
|
131
128
|
*/
|
|
132
|
-
async listMappedAssets(projectId, start, end) {
|
|
129
|
+
async listMappedAssets(projectId, start, end, includeObservations) {
|
|
133
130
|
return this.callGet(formatServiceUrl(API_PROJECT_MAPPED_ASSETS_PATH_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to list mapped assets for ${projectId}.`, {
|
|
134
131
|
start: start?.toISOString() ?? '',
|
|
135
132
|
end: end?.toISOString() ?? '',
|
|
133
|
+
includeObservations: includeObservations ? 'true' : 'false',
|
|
136
134
|
});
|
|
137
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Get mapped asset
|
|
138
|
+
*
|
|
139
|
+
* @param projectId
|
|
140
|
+
* @param assetId
|
|
141
|
+
*/
|
|
142
|
+
async getMappedAsset(projectId, assetId) {
|
|
143
|
+
return this.callGet(formatServiceUrl(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}.`);
|
|
144
|
+
}
|
|
138
145
|
/**
|
|
139
146
|
* Set Robot Sync Definitions
|
|
140
147
|
* @param projectId
|
|
141
148
|
* @param callsign
|
|
142
149
|
* @param definition
|
|
150
|
+
* @param syncNow - Sync configured paths immediately
|
|
143
151
|
*/
|
|
144
|
-
setRobotSyncDefinitions(projectId, callsign, definition) {
|
|
152
|
+
setRobotSyncDefinitions(projectId, callsign, definition, syncNow = false) {
|
|
153
|
+
const url = formatServiceUrl(API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL, { url: this.config.url, projectId, callsign }, this.config.insecure);
|
|
145
154
|
const httpOptions = {
|
|
146
155
|
headers: {
|
|
147
156
|
'content-type': 'application/json',
|
|
148
157
|
},
|
|
149
158
|
};
|
|
150
|
-
return this.callPost(
|
|
159
|
+
return this.callPost(url, definition, `Failed to update asset for ${projectId}, callsign ${callsign}.`, httpOptions, {
|
|
160
|
+
syncNow,
|
|
161
|
+
});
|
|
151
162
|
}
|
|
152
163
|
/**
|
|
153
164
|
* 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.
|
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
import { API_APPLICATION_AUTH_URL, API_OTP_AUTH_URL, API_OTP_URL, API_USER_TOKEN_URL } from '../constants/api';
|
|
2
|
+
import { BehaviorSubject } from 'rxjs';
|
|
2
3
|
import { RocosError, Token, errorCodes } from '../models';
|
|
3
4
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
5
|
import { RocosLogger } from '../logger/RocosLogger';
|
|
5
6
|
import { RocosStore } from '../store/RocosStore';
|
|
7
|
+
import { filter } from 'rxjs/operators';
|
|
6
8
|
import { formatServiceUrl } from '../helpers/formatServiceUrl';
|
|
7
9
|
import { issuer } from '../constants/auth';
|
|
8
10
|
export class AuthService extends BaseServiceAbstract {
|
|
9
11
|
constructor(config) {
|
|
10
12
|
super(config);
|
|
11
13
|
this.config = config;
|
|
14
|
+
this.tokenSubject$ = new BehaviorSubject(null);
|
|
12
15
|
this.config = config;
|
|
13
16
|
this.logger = RocosLogger.getInstance(`AuthService(${this.config.url})`);
|
|
14
17
|
if (this.config.token) {
|
|
15
18
|
this.setToken(this.config.token);
|
|
16
19
|
}
|
|
20
|
+
this.token$.subscribe((token) => {
|
|
21
|
+
RocosStore.getChangeSubject().next({ type: 'token', url: this.config.url, data: token.value });
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** Observable for token updates
|
|
25
|
+
*
|
|
26
|
+
* This is useful for getting notified when the token changes.
|
|
27
|
+
* i.e. when the token is refreshed from the token refresh checker.
|
|
28
|
+
*
|
|
29
|
+
* It will emit the current token when you subscribe and then emit new tokens when they are set.
|
|
30
|
+
*/
|
|
31
|
+
get token$() {
|
|
32
|
+
return this.tokenSubject$.asObservable().pipe(filter(Boolean));
|
|
17
33
|
}
|
|
18
34
|
getStatus() {
|
|
19
35
|
return true;
|
|
@@ -39,7 +55,12 @@ export class AuthService extends BaseServiceAbstract {
|
|
|
39
55
|
}
|
|
40
56
|
this.config.token = this.token.value;
|
|
41
57
|
// output a message for token change
|
|
42
|
-
|
|
58
|
+
if (this.isTokenValid(this.token)) {
|
|
59
|
+
this.tokenSubject$.next(this.token);
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
void this.getToken();
|
|
63
|
+
}
|
|
43
64
|
}
|
|
44
65
|
/**
|
|
45
66
|
* Clear token
|
|
@@ -163,6 +184,7 @@ export class AuthService extends BaseServiceAbstract {
|
|
|
163
184
|
* If you want to refresh the token regardless of the expiry time, use `refreshToken`.
|
|
164
185
|
*
|
|
165
186
|
* @param minutes the number of minutes before the token expires to refresh the token
|
|
187
|
+
* @returns true if the token was refreshed
|
|
166
188
|
* @see refreshToken
|
|
167
189
|
*/
|
|
168
190
|
async refreshTokenIfExpired(minutes) {
|
|
@@ -170,7 +192,9 @@ export class AuthService extends BaseServiceAbstract {
|
|
|
170
192
|
this.logger.info('Token expires in 15 minutes. Refreshing.');
|
|
171
193
|
const newToken = await this.refreshToken();
|
|
172
194
|
this.setToken(newToken);
|
|
195
|
+
return true;
|
|
173
196
|
}
|
|
197
|
+
return false;
|
|
174
198
|
}
|
|
175
199
|
/** Start a 5-minute loop to check if the token needs to be refreshed
|
|
176
200
|
*
|
|
@@ -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>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HttpError, RocosError } from '../models';
|
|
2
2
|
import { getURLSearchParams } from '../helpers';
|
|
3
3
|
import { RocosStore } from '../store/RocosStore';
|
|
4
4
|
export class BaseServiceAbstract {
|
|
5
5
|
constructor(config) {
|
|
6
6
|
this.config = config;
|
|
7
7
|
}
|
|
8
|
-
async callPost(url, payload, errorMessage, config) {
|
|
9
|
-
return this.call(url, 'POST', { errorMessage, payload, config });
|
|
8
|
+
async callPost(url, payload, errorMessage, config, params) {
|
|
9
|
+
return this.call(url, 'POST', { errorMessage, payload, config, params });
|
|
10
10
|
}
|
|
11
11
|
async callPut(url, payload, errorMessage, config) {
|
|
12
12
|
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,52 @@
|
|
|
1
|
+
import { API_DEVICE_CREDENTIALS_AUTH_URL, API_DEVICE_CREDENTIALS_URL } from '../constants/api';
|
|
2
|
+
import { RocosError, errorCodes } from '../models';
|
|
3
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
|
+
import { RocosLogger } from '../logger/RocosLogger';
|
|
5
|
+
import { formatServiceUrl } from '../helpers/formatServiceUrl';
|
|
6
|
+
/**
|
|
7
|
+
* Manage external devices authenticating with the platform
|
|
8
|
+
*/
|
|
9
|
+
export class DeviceCredentialsService extends BaseServiceAbstract {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
super(config);
|
|
12
|
+
this.logger = RocosLogger.getInstance(`DeviceCredentials(${this.config.url})`);
|
|
13
|
+
}
|
|
14
|
+
getStatus() {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
getError(e) {
|
|
18
|
+
return new RocosError(e, errorCodes.DEVICE_CREDENTIALS_SERVICE_ERROR);
|
|
19
|
+
}
|
|
20
|
+
list(projectId, callsign) {
|
|
21
|
+
return this.callGet(formatServiceUrl(API_DEVICE_CREDENTIALS_URL, {
|
|
22
|
+
url: this.config.url,
|
|
23
|
+
projectId,
|
|
24
|
+
callsign,
|
|
25
|
+
}, this.config.insecure), 'Failed to get device credentials.');
|
|
26
|
+
}
|
|
27
|
+
create(projectId, callsign, credentials, disableValidation = false) {
|
|
28
|
+
let queryParams;
|
|
29
|
+
if (disableValidation) {
|
|
30
|
+
queryParams = {
|
|
31
|
+
validate: false,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return this.callPost(formatServiceUrl(API_DEVICE_CREDENTIALS_URL, {
|
|
35
|
+
url: this.config.url,
|
|
36
|
+
projectId,
|
|
37
|
+
callsign,
|
|
38
|
+
}, this.config.insecure), credentials, 'Failed to create device credentials.', undefined, queryParams);
|
|
39
|
+
}
|
|
40
|
+
delete(projectId, callsign, component, system) {
|
|
41
|
+
return this.callDelete(formatServiceUrl(API_DEVICE_CREDENTIALS_URL, {
|
|
42
|
+
url: this.config.url,
|
|
43
|
+
projectId,
|
|
44
|
+
callsign,
|
|
45
|
+
}, this.config.insecure), 'Failed to delete device credentials.', { component, system });
|
|
46
|
+
}
|
|
47
|
+
auth(credentials) {
|
|
48
|
+
return this.callPost(formatServiceUrl(API_DEVICE_CREDENTIALS_AUTH_URL, {
|
|
49
|
+
url: this.config.url,
|
|
50
|
+
}, this.config.insecure), credentials, 'Failed to delete device credentials.');
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -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,44 @@
|
|
|
1
|
+
import { RocosError, errorCodes } from '../models';
|
|
2
|
+
import { API_PROJECT_ENVIRONMENT_URL } from '../constants/api';
|
|
3
|
+
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
|
+
import { RocosLogger } from '../logger/RocosLogger';
|
|
5
|
+
import { formatServiceUrl } from '../helpers/formatServiceUrl';
|
|
6
|
+
/**
|
|
7
|
+
* Service responsible for saving and retrieving the project environment from Giraffe.
|
|
8
|
+
*/
|
|
9
|
+
export class EnvironmentService extends BaseServiceAbstract {
|
|
10
|
+
constructor(config) {
|
|
11
|
+
super(config);
|
|
12
|
+
this.logger = RocosLogger.getInstance(`EnvironmentService(${this.config.url})`);
|
|
13
|
+
}
|
|
14
|
+
getError(e) {
|
|
15
|
+
return new RocosError(e, errorCodes.ENVIRONMENT_SERVICE_ERROR);
|
|
16
|
+
}
|
|
17
|
+
getStatus() {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Get Environment
|
|
22
|
+
*
|
|
23
|
+
* @param projectId - Project Id
|
|
24
|
+
*/
|
|
25
|
+
async get(projectId) {
|
|
26
|
+
return this.callGet(formatServiceUrl(API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to get environment for ${projectId}.`);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Update Environment
|
|
30
|
+
*
|
|
31
|
+
* @param projectId - Project Id
|
|
32
|
+
*/
|
|
33
|
+
async update(projectId, scene) {
|
|
34
|
+
return this.callPut(formatServiceUrl(API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), scene, `Failed to update environment for ${projectId}.`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Delete Environment
|
|
38
|
+
*
|
|
39
|
+
* @param projectId - Project Id
|
|
40
|
+
*/
|
|
41
|
+
async delete(projectId) {
|
|
42
|
+
return this.callDelete(formatServiceUrl(API_PROJECT_ENVIRONMENT_URL, { url: this.config.url, projectId }, this.config.insecure), `Failed to update environment for ${projectId}.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -19,7 +19,7 @@ export class EvaluatorService extends BaseServiceAbstract {
|
|
|
19
19
|
}
|
|
20
20
|
async teardown() {
|
|
21
21
|
const sandbox = await this.sandbox;
|
|
22
|
-
sandbox.destroy();
|
|
22
|
+
sandbox.destroy('evaluator service torn down');
|
|
23
23
|
}
|
|
24
24
|
async execute(code, context, options) {
|
|
25
25
|
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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { API_DD_INTEGRATION_ISSUES_URL, API_DD_INTEGRATION_OVERLAYS_URL, API_DD_INTEGRATION_PLANS_URL, API_DD_INTEGRATION_PLAN_BY_ID_URL, } from '../constants/api';
|
|
2
|
-
import { RocosError, errorCodes } from '../models';
|
|
1
|
+
import { API_DD_INTEGRATION_ISSUES_URL, API_DD_INTEGRATION_LOCATIONS_URL, API_DD_INTEGRATION_OVERLAYS_URL, API_DD_INTEGRATION_PLANS_URL, API_DD_INTEGRATION_PLAN_BY_ID_URL, } from '../constants/api';
|
|
2
|
+
import { RocosError, errorCodes, } from '../models';
|
|
3
3
|
import { BaseServiceAbstract } from './BaseServiceAbstract';
|
|
4
4
|
import { RocosLogger } from '../logger/RocosLogger';
|
|
5
5
|
import { formatServiceUrl } from '../helpers/formatServiceUrl';
|
|
@@ -69,4 +69,12 @@ export class IntegrationService extends BaseServiceAbstract {
|
|
|
69
69
|
lng: location.lng,
|
|
70
70
|
}, 'Failed to create issue.');
|
|
71
71
|
}
|
|
72
|
+
/**
|
|
73
|
+
* Gets locations for the provided project ID
|
|
74
|
+
* @param projectId Project ID
|
|
75
|
+
* @returns Plans list (limited to 50)
|
|
76
|
+
*/
|
|
77
|
+
async getLocations(projectId, pageStart) {
|
|
78
|
+
return this.callGet(formatServiceUrl(API_DD_INTEGRATION_LOCATIONS_URL, { url: this.config.url, projectId }, this.config.insecure), 'Failed to get locations.', pageStart ? { page_start: pageStart } : undefined);
|
|
79
|
+
}
|
|
72
80
|
}
|
|
@@ -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
|
}
|