@dronedeploy/rocos-js-sdk 3.0.1-alpha.3 → 3.0.1-alpha.31
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/IRocosSDK.d.ts +34 -0
- package/cjs/IRocosSDK.js +6 -0
- package/cjs/RocosSDK.d.ts +157 -0
- package/cjs/RocosSDK.js +340 -0
- package/cjs/api/StreamRegister.js +73 -0
- package/cjs/api/atoms/StreamHeartbeat.js +115 -0
- package/cjs/api/streams/caller/CallerStream.js +85 -0
- package/cjs/api/streams/caller/CallerStreamAbstract.js +91 -0
- package/cjs/api/streams/caller/CallerStreamNode.js +143 -0
- package/cjs/api/streams/command/CommandStream.js +74 -0
- package/cjs/api/streams/command/CommandStreamAbstract.js +67 -0
- package/cjs/api/streams/command/CommandStreamNode.js +97 -0
- package/cjs/api/streams/control/ControlStream.js +83 -0
- package/cjs/api/streams/control/ControlStreamAbstract.d.ts +25 -0
- package/cjs/api/streams/control/ControlStreamAbstract.js +115 -0
- package/cjs/api/streams/control/ControlStreamNode.js +101 -0
- package/cjs/api/streams/fileAccessor/FileAccessorStream.js +67 -0
- package/cjs/api/streams/fileAccessor/FileAccessorStreamAbstract.js +66 -0
- package/cjs/api/streams/fileAccessor/FileAccessorStreamNode.js +95 -0
- package/cjs/api/streams/search/SearchStream.js +104 -0
- package/cjs/api/streams/search/SearchStreamAbstract.js +76 -0
- package/cjs/api/streams/search/SearchStreamNode.js +146 -0
- package/cjs/api/streams/telemetry/TelemetryStream.js +105 -0
- package/cjs/api/streams/telemetry/TelemetryStreamAbstract.d.ts +59 -0
- package/cjs/api/streams/telemetry/TelemetryStreamAbstract.js +406 -0
- package/cjs/api/streams/telemetry/TelemetryStreamNode.js +203 -0
- package/cjs/api/streams/webRTCSignalling/WebRTCSignallingStream.js +92 -0
- package/cjs/api/streams/webRTCSignalling/WebRTCSignallingStreamAbstract.js +69 -0
- package/cjs/constants/api.d.ts +142 -0
- package/cjs/constants/api.js +147 -0
- package/cjs/constants/auth.js +5 -0
- package/cjs/constants/grpc.js +8 -0
- package/cjs/constants/identifier.js +9 -0
- package/cjs/constants/timezones.js +430 -0
- package/cjs/grpc/conker_pb.client.js +59 -0
- package/cjs/grpc/conker_pb.grpc-client.js +85 -0
- package/cjs/grpc/conker_pb.js +107 -0
- package/cjs/grpc/filagree_pb.client.js +52 -0
- package/cjs/grpc/filagree_pb.grpc-client.js +78 -0
- package/cjs/grpc/filagree_pb.js +332 -0
- package/cjs/grpc/google/protobuf/descriptor_pb.js +2381 -0
- package/cjs/grpc/google/protobuf/empty_pb.js +50 -0
- package/cjs/grpc/pigeon_pb.client.js +77 -0
- package/cjs/grpc/pigeon_pb.grpc-client.js +96 -0
- package/cjs/grpc/pigeon_pb.js +147 -0
- package/cjs/grpc/rambo.uri.v1_pb.js +51 -0
- package/cjs/grpc/rambo.v1_pb.client.js +53 -0
- package/cjs/grpc/rambo.v1_pb.grpc-client.js +72 -0
- package/cjs/grpc/rambo.v1_pb.js +275 -0
- package/cjs/grpc/serviette.uri.v1_pb.js +65 -0
- package/cjs/grpc/serviette.v1_pb.client.js +183 -0
- package/cjs/grpc/serviette.v1_pb.grpc-client.js +194 -0
- package/cjs/grpc/serviette.v1_pb.js +556 -0
- package/cjs/grpc/slowlane_pb.client.js +45 -0
- package/cjs/grpc/slowlane_pb.grpc-client.js +71 -0
- package/cjs/grpc/slowlane_pb.js +188 -0
- package/cjs/grpc/teletubby_pb.client.js +109 -0
- package/cjs/grpc/teletubby_pb.grpc-client.js +128 -0
- package/cjs/grpc/teletubby_pb.js +1267 -0
- package/cjs/helpers/arrayRemove.js +7 -0
- package/cjs/helpers/arrayUnique.js +7 -0
- package/cjs/helpers/average.js +10 -0
- package/cjs/helpers/callerMessageHelpers.d.ts +14 -0
- package/cjs/helpers/callerMessageHelpers.js +91 -0
- package/cjs/helpers/cleanObject.js +25 -0
- package/cjs/helpers/enviroment.js +17 -0
- package/cjs/helpers/flattenCallsignsLookup.js +10 -0
- package/cjs/helpers/flattenObject.js +17 -0
- package/cjs/helpers/flattenOneOf.js +34 -0
- package/cjs/helpers/formatServiceUrl.js +11 -0
- package/cjs/helpers/generateUUID.js +8 -0
- package/cjs/helpers/getSha256Hex.d.ts +1 -0
- package/cjs/helpers/getSha256Hex.js +9 -0
- package/cjs/helpers/getSha256HexNode.d.ts +1 -0
- package/cjs/helpers/getSha256HexNode.js +13 -0
- package/cjs/helpers/getSubscriptionsDifference.js +39 -0
- package/cjs/helpers/getURLSearchParams.js +13 -0
- package/cjs/helpers/getUniqueConfigKey.d.ts +11 -0
- package/cjs/helpers/getUniqueConfigKey.js +23 -0
- package/cjs/helpers/getUniqueId.js +15 -0
- package/cjs/helpers/getUnixTimeMs.js +8 -0
- package/cjs/helpers/index.d.ts +6 -0
- package/cjs/helpers/index.js +22 -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/nanosecondToMillisecond.js +16 -0
- package/cjs/helpers/randomString.js +7 -0
- package/cjs/helpers/splitRobotTopic.d.ts +9 -0
- package/cjs/helpers/splitRobotTopic.js +16 -0
- package/cjs/helpers/standardDeviation.js +16 -0
- package/cjs/helpers/stringToUint8Array.js +14 -0
- package/cjs/helpers/uint8ArrayToString.js +14 -0
- package/cjs/helpers/websandbox/connection.d.ts +68 -0
- package/cjs/helpers/websandbox/connection.js +137 -0
- package/cjs/helpers/websandbox/frame/frame.js +30 -0
- package/cjs/helpers/websandbox/frame/frame.source.js +10 -0
- package/cjs/helpers/websandbox/frame/index.js +7 -0
- package/cjs/helpers/websandbox/frame/worker/index.js +7 -0
- package/cjs/helpers/websandbox/frame/worker/manager.d.ts +15 -0
- package/cjs/helpers/websandbox/frame/worker/manager.js +88 -0
- package/cjs/helpers/websandbox/frame/worker/types.js +2 -0
- package/cjs/helpers/websandbox/frame/worker/worker.js +75 -0
- package/cjs/helpers/websandbox/frame/worker/worker.source.js +6 -0
- package/cjs/helpers/websandbox/index.js +8 -0
- package/cjs/helpers/websandbox/sandbox.d.ts +57 -0
- package/cjs/helpers/websandbox/sandbox.js +182 -0
- package/cjs/helpers/websandbox/types.js +2 -0
- package/cjs/index.js +23 -0
- package/cjs/logger/RocosLogger.js +67 -0
- package/cjs/models/ExportDataQuery.js +17 -0
- package/cjs/models/HttpError.d.ts +5 -0
- package/cjs/models/HttpError.js +12 -0
- package/cjs/models/IBaseService.js +2 -0
- package/cjs/models/IConfigGroup.js +2 -0
- package/cjs/models/IConnectedCallsign.d.ts +10 -0
- package/cjs/models/IConnectedCallsign.js +8 -0
- package/cjs/models/IDebugLevel.js +2 -0
- package/cjs/models/IExportDataQuery.js +2 -0
- package/cjs/models/IFunctionConfig.js +2 -0
- package/cjs/models/IInvitation.js +2 -0
- package/cjs/models/IInvitationExists.js +2 -0
- package/cjs/models/IOperation.js +2 -0
- package/cjs/models/IPersonalAccessToken.js +2 -0
- package/cjs/models/IProject.d.ts +6 -0
- package/cjs/models/IProject.js +2 -0
- package/cjs/models/IProjectApplication.js +2 -0
- package/cjs/models/IProjectInfo.d.ts +14 -0
- package/cjs/models/IProjectInfo.js +2 -0
- package/cjs/models/IRobot.js +2 -0
- package/cjs/models/IRobotConfig.js +2 -0
- package/cjs/models/IRobotPlugin.js +2 -0
- package/cjs/models/IRobotSettings.js +2 -0
- package/cjs/models/IRobotTemplate.js +2 -0
- package/cjs/models/IRocosSDKConfig.d.ts +23 -0
- package/cjs/models/IRocosSDKConfig.js +2 -0
- package/cjs/models/ISource.js +2 -0
- package/cjs/models/IStream.js +2 -0
- package/cjs/models/IStreamConfig.js +2 -0
- package/cjs/models/IStreamOptions.js +2 -0
- package/cjs/models/IStreamSource.js +2 -0
- package/cjs/models/ISubscriberStatus.js +2 -0
- package/cjs/models/ITelemetryStreamConfig.js +2 -0
- package/cjs/models/IToken.js +2 -0
- package/cjs/models/IWidget.js +2 -0
- package/cjs/models/IWidgetLineGroup.js +2 -0
- package/cjs/models/ResponseLevelEnum.js +14 -0
- package/cjs/models/Robot.js +12 -0
- package/cjs/models/RobotConfig.js +9 -0
- package/cjs/models/RobotPlugin.js +9 -0
- package/cjs/models/RobotTemplate.js +29 -0
- package/cjs/models/RocosError.d.ts +34 -0
- package/cjs/models/RocosError.js +47 -0
- package/cjs/models/ServiceEnum.d.ts +30 -0
- package/cjs/models/ServiceEnum.js +34 -0
- package/cjs/models/Stream.js +15 -0
- package/cjs/models/StreamOptions.js +37 -0
- package/cjs/models/StreamSource.js +15 -0
- package/cjs/models/SubscriberStatusEnum.js +10 -0
- package/cjs/models/TelemetryStatus.d.ts +12 -0
- package/cjs/models/TelemetryStatus.js +17 -0
- package/cjs/models/Token.d.ts +40 -0
- package/cjs/models/Token.js +82 -0
- package/cjs/models/Widget.js +16 -0
- package/cjs/models/WidgetLineGroup.js +9 -0
- package/cjs/models/asset-storage/AssetItem.d.ts +16 -0
- package/cjs/models/asset-storage/AssetItem.js +2 -0
- package/cjs/models/asset-storage/SyncIntegrations.d.ts +31 -0
- package/cjs/models/asset-storage/SyncIntegrations.js +2 -0
- package/cjs/models/caller/IRocosCallerMessageChunk.d.ts +15 -0
- package/cjs/models/caller/IRocosCallerMessageChunk.js +2 -0
- package/cjs/models/caller/IRocosCallerMessageChunks.js +2 -0
- package/cjs/models/caller/IRocosCallerMessageHeartbeat.js +2 -0
- package/cjs/models/caller/IRocosCallerMessageResponse.js +2 -0
- package/cjs/models/caller/IRocosCallerMessageResponseAck.js +16 -0
- package/cjs/models/caller/IRocosCallerMessageResponseResult.js +15 -0
- package/cjs/models/caller/IRocosCallerMessageResponseReturn.js +2 -0
- package/cjs/models/caller/IRocosCallerMessageResponseUid.js +10 -0
- package/cjs/models/caller/IRocosCallerMessageResponses.js +2 -0
- package/cjs/models/caller/RocosCallerResultStatus.js +15 -0
- package/cjs/models/caller/RocosResponseLevel.js +10 -0
- package/cjs/models/caller/index.d.ts +11 -0
- package/cjs/models/caller/index.js +27 -0
- package/cjs/models/callsigns/CallsignsEnums.js +20 -0
- package/cjs/models/callsigns/CallsignsLookup.js +32 -0
- package/cjs/models/callsigns/CallsignsQuery.js +18 -0
- package/cjs/models/callsigns/CallsignsQueryPredicate.js +19 -0
- package/cjs/models/command/IRocosCommandMessageHeartbeat.js +2 -0
- package/cjs/models/command/IRocosCommandMessageResponse.js +30 -0
- package/cjs/models/command/RocosCommandResultStatus.js +15 -0
- package/cjs/models/command/index.js +20 -0
- package/cjs/models/device-credentials/DeviceCredentials.d.ts +61 -0
- package/cjs/models/device-credentials/DeviceCredentials.js +2 -0
- package/cjs/models/file/FileEnums.js +36 -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 +86 -0
- package/cjs/models/index.js +102 -0
- package/cjs/models/integrations/Location.d.ts +24 -0
- package/cjs/models/integrations/Location.js +2 -0
- package/cjs/models/integrations/Overlay.js +2 -0
- package/cjs/models/integrations/PaginatedResults.d.ts +4 -0
- package/cjs/models/integrations/PaginatedResults.js +2 -0
- package/cjs/models/integrations/Plan.js +2 -0
- package/cjs/models/maps/Map.js +2 -0
- package/cjs/models/maps/Panorama.d.ts +20 -0
- package/cjs/models/maps/Panorama.js +2 -0
- package/cjs/models/message/IRocosCallerMessage.js +2 -0
- package/cjs/models/message/IRocosChangeMessage.js +2 -0
- package/cjs/models/message/IRocosCommandMessage.js +2 -0
- package/cjs/models/message/IRocosControlMessage.js +2 -0
- package/cjs/models/message/IRocosOpResultMessage.js +2 -0
- package/cjs/models/message/IRocosSearchMessage.js +2 -0
- package/cjs/models/message/IRocosSearchRowMessage.js +2 -0
- package/cjs/models/message/IRocosSearchStatusMessage.js +2 -0
- package/cjs/models/message/IRocosTelemetryMessage.d.ts +23 -0
- package/cjs/models/message/IRocosTelemetryMessage.js +2 -0
- package/cjs/models/message/IStreamStatusMessage.js +2 -0
- package/cjs/models/message/RocosCallerMessage.js +36 -0
- package/cjs/models/message/RocosCommandMessage.js +17 -0
- package/cjs/models/message/RocosControlMessage.js +18 -0
- package/cjs/models/message/RocosOpResultMessage.js +22 -0
- package/cjs/models/message/RocosSearchMessage.js +28 -0
- package/cjs/models/message/RocosSearchRowMessage.js +20 -0
- package/cjs/models/message/RocosTelemetryMessage.js +67 -0
- package/cjs/models/message/index.js +33 -0
- package/cjs/models/params/ICallerParams.d.ts +26 -0
- package/cjs/models/params/ICallerParams.js +2 -0
- package/cjs/models/params/ICommandParams.js +2 -0
- package/cjs/models/params/IControlParams.js +2 -0
- package/cjs/models/params/IFileAccessorParams.js +2 -0
- package/cjs/models/params/ISearchParams.js +2 -0
- package/cjs/models/params/ITelemetryParams.js +2 -0
- package/cjs/models/params/IWebRTCSignallingParams.js +2 -0
- 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/projects/ProjectUser.js +2 -0
- package/cjs/models/schedule/IScheduleAction.js +9 -0
- package/cjs/models/schedule/IScheduleInfo.js +2 -0
- package/cjs/models/schedule/IScheduleJob.js +2 -0
- package/cjs/models/search/SearchQueryFilter.js +9 -0
- package/cjs/models/search/SearchStreamQuery.js +10 -0
- package/cjs/models/stream/IBaseStream.js +2 -0
- package/cjs/models/stream/ICallerStream.js +2 -0
- package/cjs/models/stream/ICommandStream.js +2 -0
- package/cjs/models/stream/IControlStream.js +2 -0
- package/cjs/models/stream/IFileAccessorStream.js +2 -0
- package/cjs/models/stream/ISearchStream.js +2 -0
- package/cjs/models/stream/ITelemetryStream.js +2 -0
- package/cjs/models/stream/IWebRTCSignallingStream.js +2 -0
- package/cjs/models/target/Target.d.ts +43 -0
- package/cjs/models/target/Target.js +2 -0
- package/cjs/models/types.js +2 -0
- package/cjs/models/workflow/Workflow.d.ts +94 -0
- package/cjs/models/workflow/Workflow.js +2 -0
- package/cjs/node/RocosSDKNode.d.ts +47 -0
- package/cjs/node/RocosSDKNode.js +147 -0
- package/cjs/node/index.js +23 -0
- package/cjs/services/AssetStorageService.d.ts +144 -0
- package/cjs/services/AssetStorageService.js +236 -0
- package/cjs/services/AuthService.d.ts +104 -0
- package/cjs/services/AuthService.js +263 -0
- package/cjs/services/BaseServiceAbstract.d.ts +36 -0
- package/cjs/services/BaseServiceAbstract.js +94 -0
- package/cjs/services/BaseStreamService.js +53 -0
- package/cjs/services/CallerService.d.ts +42 -0
- package/cjs/services/CallerService.js +121 -0
- package/cjs/services/CallerServiceNode.js +11 -0
- package/cjs/services/CommandService.js +42 -0
- package/cjs/services/CommandServiceNode.js +11 -0
- package/cjs/services/ConfigGroupService.js +157 -0
- package/cjs/services/ControlService.js +61 -0
- package/cjs/services/ControlServiceNode.js +11 -0
- package/cjs/services/DashboardService.js +146 -0
- package/cjs/services/DeviceCredentialsService.d.ts +15 -0
- package/cjs/services/DeviceCredentialsService.js +56 -0
- package/cjs/services/EvaluatorService.js +32 -0
- package/cjs/services/EventService.js +89 -0
- package/cjs/services/FileAccessorService.js +41 -0
- package/cjs/services/FileAccessorServiceNode.js +11 -0
- package/cjs/services/IntegrationService.d.ts +54 -0
- package/cjs/services/IntegrationService.js +84 -0
- package/cjs/services/MapService.d.ts +142 -0
- package/cjs/services/MapService.js +196 -0
- package/cjs/services/PlatformTimeService.js +160 -0
- package/cjs/services/ProfileService.d.ts +268 -0
- package/cjs/services/ProfileService.js +400 -0
- package/cjs/services/ProjectService.d.ts +111 -0
- package/cjs/services/ProjectService.js +171 -0
- package/cjs/services/RTPWebRTCService.d.ts +102 -0
- package/cjs/services/RTPWebRTCService.js +234 -0
- package/cjs/services/RobotService.d.ts +280 -0
- package/cjs/services/RobotService.js +470 -0
- package/cjs/services/ScheduleService.js +40 -0
- package/cjs/services/SearchService.js +62 -0
- package/cjs/services/SearchServiceNode.js +11 -0
- package/cjs/services/SpotProvisioningService.js +47 -0
- package/cjs/services/SpotProvisioningServiceNode.js +47 -0
- package/cjs/services/StreamService.js +146 -0
- package/cjs/services/TargetService.d.ts +13 -0
- package/cjs/services/TargetService.js +46 -0
- package/cjs/services/TelemetryService.d.ts +50 -0
- package/cjs/services/TelemetryService.js +180 -0
- package/cjs/services/TelemetryServiceNode.js +11 -0
- package/cjs/services/TimeSyncerService.js +27 -0
- package/cjs/services/UserService.js +319 -0
- package/cjs/services/WebRTCSignallingService.js +82 -0
- package/cjs/services/WorkflowService.d.ts +62 -0
- package/cjs/services/WorkflowService.js +107 -0
- package/cjs/services/WorkflowServiceNode.d.ts +4 -0
- package/cjs/services/WorkflowServiceNode.js +12 -0
- package/cjs/services/index.d.ts +29 -0
- package/cjs/services/index.js +45 -0
- package/cjs/store/RocosStore.d.ts +30 -0
- package/cjs/store/RocosStore.js +51 -0
- package/esm/IRocosSDK.d.ts +34 -0
- package/esm/RocosSDK.d.ts +157 -0
- package/esm/RocosSDK.js +336 -0
- package/esm/api/StreamRegister.d.ts +13 -0
- package/esm/api/atoms/StreamHeartbeat.d.ts +27 -0
- package/esm/api/streams/caller/CallerStream.d.ts +13 -0
- package/esm/api/streams/caller/CallerStream.js +81 -0
- package/esm/api/streams/caller/CallerStreamAbstract.d.ts +23 -0
- package/esm/api/streams/caller/CallerStreamNode.d.ts +13 -0
- package/esm/api/streams/caller/CallerStreamNode.js +116 -0
- package/esm/api/streams/command/CommandStream.d.ts +10 -0
- package/esm/api/streams/command/CommandStream.js +70 -0
- package/esm/api/streams/command/CommandStreamAbstract.d.ts +20 -0
- package/esm/api/streams/command/CommandStreamNode.d.ts +10 -0
- package/esm/api/streams/command/CommandStreamNode.js +70 -0
- package/esm/api/streams/control/ControlStream.d.ts +12 -0
- package/esm/api/streams/control/ControlStream.js +79 -0
- package/esm/api/streams/control/ControlStreamAbstract.d.ts +25 -0
- package/esm/api/streams/control/ControlStreamNode.d.ts +12 -0
- package/esm/api/streams/control/ControlStreamNode.js +74 -0
- package/esm/api/streams/fileAccessor/FileAccessorStream.d.ts +8 -0
- package/esm/api/streams/fileAccessor/FileAccessorStream.js +63 -0
- package/esm/api/streams/fileAccessor/FileAccessorStreamAbstract.d.ts +21 -0
- package/esm/api/streams/fileAccessor/FileAccessorStreamNode.d.ts +8 -0
- package/esm/api/streams/fileAccessor/FileAccessorStreamNode.js +68 -0
- package/esm/api/streams/search/SearchStream.d.ts +13 -0
- package/esm/api/streams/search/SearchStream.js +100 -0
- package/esm/api/streams/search/SearchStreamAbstract.d.ts +25 -0
- package/esm/api/streams/search/SearchStreamNode.d.ts +13 -0
- package/esm/api/streams/search/SearchStreamNode.js +119 -0
- package/esm/api/streams/telemetry/TelemetryStream.d.ts +17 -0
- package/esm/api/streams/telemetry/TelemetryStream.js +101 -0
- package/esm/api/streams/telemetry/TelemetryStreamAbstract.d.ts +59 -0
- package/esm/api/streams/telemetry/TelemetryStreamNode.d.ts +21 -0
- package/esm/api/streams/telemetry/TelemetryStreamNode.js +176 -0
- package/esm/api/streams/webRTCSignalling/WebRTCSignallingStream.d.ts +39 -0
- package/esm/api/streams/webRTCSignalling/WebRTCSignallingStream.js +88 -0
- package/esm/api/streams/webRTCSignalling/WebRTCSignallingStreamAbstract.d.ts +29 -0
- package/esm/constants/api.d.ts +142 -0
- package/esm/constants/api.js +142 -0
- package/esm/constants/auth.d.ts +2 -0
- package/esm/constants/grpc.d.ts +5 -0
- package/esm/constants/identifier.d.ts +6 -0
- package/esm/constants/timezones.d.ts +2 -0
- package/esm/grpc/conker_pb.client.d.ts +78 -0
- package/esm/grpc/conker_pb.d.ts +141 -0
- package/esm/grpc/conker_pb.grpc-client.d.ts +81 -0
- package/esm/grpc/filagree_pb.client.d.ts +68 -0
- package/esm/grpc/filagree_pb.d.ts +404 -0
- package/esm/grpc/filagree_pb.grpc-client.d.ts +69 -0
- package/esm/grpc/google/protobuf/descriptor_pb.d.ts +1798 -0
- package/esm/grpc/google/protobuf/empty_pb.d.ts +23 -0
- package/esm/grpc/pigeon_pb.client.d.ts +96 -0
- package/esm/grpc/pigeon_pb.d.ts +207 -0
- package/esm/grpc/pigeon_pb.grpc-client.d.ts +98 -0
- package/esm/grpc/rambo.uri.v1_pb.d.ts +73 -0
- package/esm/grpc/rambo.v1_pb.client.d.ts +66 -0
- package/esm/grpc/rambo.v1_pb.d.ts +392 -0
- package/esm/grpc/rambo.v1_pb.grpc-client.d.ts +56 -0
- package/esm/grpc/serviette.uri.v1_pb.d.ts +89 -0
- package/esm/grpc/serviette.v1_pb.client.d.ts +225 -0
- package/esm/grpc/serviette.v1_pb.d.ts +827 -0
- package/esm/grpc/serviette.v1_pb.grpc-client.d.ts +215 -0
- package/esm/grpc/slowlane_pb.client.d.ts +61 -0
- package/esm/grpc/slowlane_pb.d.ts +303 -0
- package/esm/grpc/slowlane_pb.grpc-client.d.ts +64 -0
- package/esm/grpc/teletubby_pb.client.d.ts +145 -0
- package/esm/grpc/teletubby_pb.d.ts +634 -0
- package/esm/grpc/teletubby_pb.grpc-client.d.ts +152 -0
- package/esm/helpers/arrayRemove.d.ts +1 -0
- package/esm/helpers/arrayUnique.d.ts +1 -0
- package/esm/helpers/average.d.ts +1 -0
- package/esm/helpers/callerMessageHelpers.d.ts +14 -0
- package/esm/helpers/callerMessageHelpers.js +86 -0
- package/esm/helpers/cleanObject.d.ts +1 -0
- package/esm/helpers/cleanObject.js +21 -0
- package/esm/helpers/enviroment.d.ts +8 -0
- package/esm/helpers/flattenCallsignsLookup.d.ts +2 -0
- package/esm/helpers/flattenObject.d.ts +1 -0
- package/esm/helpers/flattenOneOf.d.ts +67 -0
- package/esm/helpers/formatServiceUrl.d.ts +1 -0
- package/esm/helpers/generateUUID.d.ts +1 -0
- package/esm/helpers/getSha256Hex.d.ts +1 -0
- package/esm/helpers/getSha256Hex.js +5 -0
- package/esm/helpers/getSha256HexNode.d.ts +1 -0
- package/esm/helpers/getSha256HexNode.js +6 -0
- package/esm/helpers/getSubscriptionsDifference.d.ts +10 -0
- package/esm/helpers/getURLSearchParams.d.ts +2 -0
- package/esm/helpers/getUniqueConfigKey.d.ts +11 -0
- package/esm/helpers/getUniqueConfigKey.js +19 -0
- package/esm/helpers/getUniqueId.d.ts +9 -0
- package/esm/helpers/getUnixTimeMs.d.ts +1 -0
- package/esm/helpers/index.d.ts +6 -0
- package/esm/helpers/index.js +6 -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/nanosecondToMillisecond.d.ts +1 -0
- package/esm/helpers/randomString.d.ts +1 -0
- package/esm/helpers/splitRobotTopic.d.ts +9 -0
- package/esm/helpers/splitRobotTopic.js +12 -0
- package/esm/helpers/standardDeviation.d.ts +1 -0
- package/esm/helpers/stringToUint8Array.d.ts +1 -0
- package/esm/helpers/uint8ArrayToString.d.ts +1 -0
- package/esm/helpers/websandbox/connection.d.ts +68 -0
- package/esm/helpers/websandbox/connection.js +134 -0
- package/esm/helpers/websandbox/frame/frame.d.ts +12 -0
- package/esm/helpers/websandbox/frame/frame.js +25 -0
- package/esm/helpers/websandbox/frame/frame.source.d.ts +2 -0
- package/esm/helpers/websandbox/frame/frame.source.js +5 -0
- package/esm/helpers/websandbox/frame/index.js +2 -0
- package/esm/helpers/websandbox/frame/worker/index.js +2 -0
- package/esm/helpers/websandbox/frame/worker/manager.d.ts +15 -0
- package/esm/helpers/websandbox/frame/worker/manager.js +85 -0
- package/esm/helpers/websandbox/frame/worker/types.d.ts +11 -0
- package/esm/helpers/websandbox/frame/worker/worker.source.d.ts +2 -0
- package/esm/helpers/websandbox/frame/worker/worker.source.js +4 -0
- package/esm/helpers/websandbox/index.js +2 -0
- package/esm/helpers/websandbox/sandbox.d.ts +57 -0
- package/esm/helpers/websandbox/sandbox.js +175 -0
- package/esm/helpers/websandbox/types.d.ts +13 -0
- package/esm/index.js +7 -0
- package/esm/logger/RocosLogger.d.ts +7 -0
- package/esm/models/ExportDataQuery.d.ts +8 -0
- package/esm/models/HttpError.d.ts +5 -0
- package/esm/models/HttpError.js +8 -0
- package/esm/models/IBaseService.d.ts +4 -0
- package/esm/models/IConfigGroup.d.ts +5 -0
- package/esm/models/IConnectedCallsign.d.ts +10 -0
- package/esm/models/IConnectedCallsign.js +5 -0
- package/esm/models/IDebugLevel.d.ts +2 -0
- package/esm/models/IExportDataQuery.d.ts +9 -0
- package/esm/models/IFunctionConfig.d.ts +8 -0
- package/esm/models/IInvitation.d.ts +6 -0
- package/esm/models/IInvitationExists.d.ts +4 -0
- package/esm/models/IOperation.d.ts +6 -0
- package/esm/models/IPersonalAccessToken.d.ts +16 -0
- package/esm/models/IProject.d.ts +6 -0
- package/esm/models/IProjectApplication.d.ts +6 -0
- package/esm/models/IProjectInfo.d.ts +14 -0
- package/esm/models/IRobot.d.ts +18 -0
- package/esm/models/IRobotConfig.d.ts +8 -0
- package/esm/models/IRobotPlugin.d.ts +3 -0
- package/esm/models/IRobotSettings.d.ts +28 -0
- package/esm/models/IRobotTemplate.d.ts +10 -0
- package/esm/models/IRocosSDKConfig.d.ts +23 -0
- package/esm/models/ISource.d.ts +8 -0
- package/esm/models/IStream.d.ts +9 -0
- package/esm/models/IStreamConfig.d.ts +9 -0
- package/esm/models/IStreamOptions.d.ts +7 -0
- package/esm/models/IStreamSource.d.ts +8 -0
- package/esm/models/ISubscriberStatus.d.ts +5 -0
- package/esm/models/ITelemetryStreamConfig.d.ts +7 -0
- package/esm/models/IToken.d.ts +9 -0
- package/esm/models/IWidget.d.ts +25 -0
- package/esm/models/IWidgetLineGroup.d.ts +8 -0
- package/esm/models/ResponseLevelEnum.d.ts +10 -0
- package/esm/models/Robot.d.ts +20 -0
- package/esm/models/RobotConfig.d.ts +10 -0
- package/esm/models/RobotPlugin.d.ts +5 -0
- package/esm/models/RobotTemplate.d.ts +12 -0
- package/esm/models/RocosError.d.ts +34 -0
- package/esm/models/RocosError.js +43 -0
- package/esm/models/ServiceEnum.d.ts +30 -0
- package/esm/models/ServiceEnum.js +31 -0
- package/esm/models/Stream.d.ts +10 -0
- package/esm/models/StreamOptions.d.ts +9 -0
- package/esm/models/StreamSource.d.ts +10 -0
- package/esm/models/SubscriberStatusEnum.d.ts +6 -0
- package/esm/models/TelemetryStatus.d.ts +12 -0
- package/esm/models/TelemetryStatus.js +14 -0
- package/esm/models/Token.d.ts +40 -0
- package/esm/models/Token.js +78 -0
- package/esm/models/Widget.d.ts +27 -0
- package/esm/models/WidgetLineGroup.d.ts +10 -0
- package/esm/models/asset-storage/AssetItem.d.ts +16 -0
- package/esm/models/asset-storage/SyncIntegrations.d.ts +31 -0
- package/esm/models/caller/IRocosCallerMessageChunk.d.ts +15 -0
- package/esm/models/caller/IRocosCallerMessageChunks.d.ts +4 -0
- package/esm/models/caller/IRocosCallerMessageHeartbeat.d.ts +3 -0
- package/esm/models/caller/IRocosCallerMessageResponse.d.ts +10 -0
- package/esm/models/caller/IRocosCallerMessageResponseAck.d.ts +16 -0
- package/esm/models/caller/IRocosCallerMessageResponseResult.d.ts +15 -0
- package/esm/models/caller/IRocosCallerMessageResponseReturn.d.ts +8 -0
- package/esm/models/caller/IRocosCallerMessageResponseUid.d.ts +10 -0
- package/esm/models/caller/IRocosCallerMessageResponses.d.ts +4 -0
- package/esm/models/caller/RocosCallerResultStatus.d.ts +11 -0
- package/esm/models/caller/RocosResponseLevel.d.ts +6 -0
- package/esm/models/caller/index.d.ts +11 -0
- package/esm/models/caller/index.js +11 -0
- package/esm/models/callsigns/CallsignsEnums.d.ts +13 -0
- package/esm/models/callsigns/CallsignsLookup.d.ts +8 -0
- package/esm/models/callsigns/CallsignsQuery.d.ts +9 -0
- package/esm/models/callsigns/CallsignsQueryPredicate.d.ts +9 -0
- package/esm/models/command/IRocosCommandMessageHeartbeat.d.ts +1 -0
- package/esm/models/command/IRocosCommandMessageResponse.d.ts +55 -0
- package/esm/models/command/RocosCommandResultStatus.d.ts +11 -0
- package/esm/models/command/index.js +4 -0
- package/esm/models/device-credentials/DeviceCredentials.d.ts +61 -0
- package/esm/models/file/FileEnums.d.ts +30 -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 +86 -0
- package/esm/models/index.js +86 -0
- package/esm/models/integrations/Location.d.ts +24 -0
- package/esm/models/integrations/Overlay.d.ts +49 -0
- package/esm/models/integrations/PaginatedResults.d.ts +4 -0
- package/esm/models/integrations/Plan.d.ts +324 -0
- package/esm/models/maps/Map.d.ts +11 -0
- package/esm/models/maps/Panorama.d.ts +20 -0
- package/esm/models/message/IRocosCallerMessage.d.ts +8 -0
- package/esm/models/message/IRocosChangeMessage.d.ts +6 -0
- package/esm/models/message/IRocosCommandMessage.d.ts +6 -0
- package/esm/models/message/IRocosControlMessage.d.ts +7 -0
- package/esm/models/message/IRocosOpResultMessage.d.ts +6 -0
- package/esm/models/message/IRocosSearchMessage.d.ts +5 -0
- package/esm/models/message/IRocosSearchRowMessage.d.ts +9 -0
- package/esm/models/message/IRocosSearchStatusMessage.d.ts +4 -0
- package/esm/models/message/IRocosTelemetryMessage.d.ts +23 -0
- package/esm/models/message/IStreamStatusMessage.d.ts +5 -0
- package/esm/models/message/RocosCallerMessage.d.ts +10 -0
- package/esm/models/message/RocosCommandMessage.d.ts +9 -0
- package/esm/models/message/RocosControlMessage.d.ts +11 -0
- package/esm/models/message/RocosOpResultMessage.d.ts +10 -0
- package/esm/models/message/RocosSearchMessage.d.ts +9 -0
- package/esm/models/message/RocosSearchRowMessage.d.ts +13 -0
- package/esm/models/message/RocosTelemetryMessage.d.ts +10 -0
- package/esm/models/message/index.js +17 -0
- package/esm/models/params/ICallerParams.d.ts +26 -0
- package/esm/models/params/ICommandParams.d.ts +9 -0
- package/esm/models/params/IControlParams.d.ts +8 -0
- package/esm/models/params/IFileAccessorParams.d.ts +11 -0
- package/esm/models/params/ISearchParams.d.ts +10 -0
- package/esm/models/params/ITelemetryParams.d.ts +18 -0
- package/esm/models/params/IWebRTCSignallingParams.d.ts +21 -0
- package/esm/models/projects/ExternalProject.d.ts +10 -0
- package/esm/models/projects/NewProjectRequest.d.ts +8 -0
- package/esm/models/projects/ProjectUser.d.ts +6 -0
- package/esm/models/schedule/IScheduleAction.d.ts +13 -0
- package/esm/models/schedule/IScheduleInfo.d.ts +11 -0
- package/esm/models/schedule/IScheduleJob.d.ts +12 -0
- package/esm/models/search/SearchQueryFilter.d.ts +5 -0
- package/esm/models/search/SearchStreamQuery.d.ts +15 -0
- package/esm/models/stream/IBaseStream.d.ts +8 -0
- package/esm/models/stream/ICallerStream.d.ts +8 -0
- package/esm/models/stream/ICommandStream.d.ts +7 -0
- package/esm/models/stream/IControlStream.d.ts +9 -0
- package/esm/models/stream/IFileAccessorStream.d.ts +9 -0
- package/esm/models/stream/ISearchStream.d.ts +11 -0
- package/esm/models/stream/ITelemetryStream.d.ts +10 -0
- package/esm/models/stream/IWebRTCSignallingStream.d.ts +76 -0
- package/esm/models/target/Target.d.ts +43 -0
- package/esm/models/types.d.ts +5 -0
- package/esm/models/types.js +1 -0
- package/esm/models/workflow/Workflow.d.ts +94 -0
- package/esm/models/workflow/Workflow.js +1 -0
- package/esm/node/RocosSDKNode.d.ts +47 -0
- package/esm/node/RocosSDKNode.js +143 -0
- package/esm/node/index.js +7 -0
- package/esm/services/AssetStorageService.d.ts +144 -0
- package/esm/services/AssetStorageService.js +232 -0
- package/esm/services/AuthService.d.ts +104 -0
- package/esm/services/AuthService.js +259 -0
- package/esm/services/BaseServiceAbstract.d.ts +36 -0
- package/esm/services/BaseServiceAbstract.js +90 -0
- package/esm/services/BaseStreamService.d.ts +18 -0
- package/esm/services/BaseStreamService.js +49 -0
- package/esm/services/CallerService.d.ts +42 -0
- package/esm/services/CallerService.js +117 -0
- package/esm/services/CallerServiceNode.d.ts +6 -0
- package/esm/services/CommandService.d.ts +9 -0
- package/esm/services/CommandServiceNode.d.ts +6 -0
- package/esm/services/ConfigGroupService.d.ts +89 -0
- package/esm/services/ControlService.d.ts +11 -0
- package/esm/services/ControlServiceNode.d.ts +6 -0
- package/esm/services/DashboardService.d.ts +97 -0
- package/esm/services/DeviceCredentialsService.d.ts +15 -0
- package/esm/services/DeviceCredentialsService.js +52 -0
- package/esm/services/EvaluatorService.d.ts +11 -0
- package/esm/services/EvaluatorService.js +28 -0
- package/esm/services/EventService.d.ts +53 -0
- package/esm/services/FileAccessorService.d.ts +11 -0
- package/esm/services/FileAccessorServiceNode.d.ts +6 -0
- package/esm/services/IntegrationService.d.ts +54 -0
- package/esm/services/IntegrationService.js +80 -0
- package/esm/services/MapService.d.ts +142 -0
- package/esm/services/MapService.js +192 -0
- package/esm/services/PlatformTimeService.d.ts +35 -0
- package/esm/services/ProfileService.d.ts +268 -0
- package/esm/services/ProfileService.js +396 -0
- package/esm/services/ProjectService.d.ts +111 -0
- package/esm/services/ProjectService.js +167 -0
- package/esm/services/RTPWebRTCService.d.ts +102 -0
- package/esm/services/RTPWebRTCService.js +229 -0
- package/esm/services/RobotService.d.ts +280 -0
- package/esm/services/RobotService.js +466 -0
- package/esm/services/ScheduleService.d.ts +22 -0
- package/esm/services/SearchService.d.ts +12 -0
- package/esm/services/SearchServiceNode.d.ts +6 -0
- package/esm/services/SpotProvisioningService.d.ts +14 -0
- package/esm/services/SpotProvisioningServiceNode.d.ts +15 -0
- package/esm/services/StreamService.d.ts +98 -0
- package/esm/services/TargetService.d.ts +13 -0
- package/esm/services/TargetService.js +42 -0
- package/esm/services/TelemetryService.d.ts +50 -0
- package/esm/services/TelemetryService.js +176 -0
- package/esm/services/TelemetryServiceNode.d.ts +6 -0
- package/esm/services/TimeSyncerService.d.ts +13 -0
- package/esm/services/UserService.d.ts +200 -0
- package/esm/services/WebRTCSignallingService.d.ts +22 -0
- package/esm/services/WorkflowService.d.ts +62 -0
- package/esm/services/WorkflowService.js +103 -0
- package/esm/services/WorkflowServiceNode.d.ts +4 -0
- package/esm/services/WorkflowServiceNode.js +8 -0
- package/esm/services/index.d.ts +29 -0
- package/esm/services/index.js +29 -0
- package/esm/store/RocosStore.d.ts +30 -0
- package/package.json +20 -8
- package/IRocosSDK.d.ts +0 -32
- package/RocosSDK.d.ts +0 -143
- package/RocosSDK.js +0 -302
- package/api/streams/caller/CallerStream.js +0 -77
- package/api/streams/caller/CallerStreamNode.js +0 -115
- package/api/streams/command/CommandStream.js +0 -66
- package/api/streams/command/CommandStreamNode.js +0 -69
- package/api/streams/control/ControlStream.js +0 -75
- package/api/streams/control/ControlStreamAbstract.d.ts +0 -25
- package/api/streams/control/ControlStreamNode.js +0 -73
- package/api/streams/fileAccessor/FileAccessorStream.js +0 -59
- package/api/streams/fileAccessor/FileAccessorStreamNode.js +0 -66
- package/api/streams/search/SearchStream.js +0 -96
- package/api/streams/search/SearchStreamNode.js +0 -118
- package/api/streams/telemetry/TelemetryStream.js +0 -97
- package/api/streams/telemetry/TelemetryStreamAbstract.d.ts +0 -59
- package/api/streams/telemetry/TelemetryStreamNode.js +0 -175
- package/api/streams/webRTCSignalling/WebRTCSignallingStream.js +0 -84
- package/constants/api.d.ts +0 -126
- package/constants/api.js +0 -126
- package/helpers/cleanObject.js +0 -18
- package/helpers/cleanObject.spec.js +0 -53
- package/helpers/flattenObject.spec.js +0 -29
- package/helpers/flattenOneOf.spec.js +0 -157
- package/helpers/formatServiceUrl.spec.js +0 -16
- package/helpers/getURLSearchParams.spec.js +0 -19
- package/helpers/getUniqueConfigKey.d.ts +0 -7
- package/helpers/getUniqueConfigKey.js +0 -14
- package/helpers/index.d.ts +0 -5
- package/helpers/index.js +0 -5
- package/helpers/nanosecondToMillisecond.spec.js +0 -20
- package/helpers/standardDeviation.spec.js +0 -11
- package/helpers/websandbox/connection.d.ts +0 -67
- package/helpers/websandbox/connection.js +0 -133
- package/helpers/websandbox/frame/frame.js +0 -22
- package/helpers/websandbox/frame/frame.source.js +0 -5
- package/helpers/websandbox/frame/worker/manager.d.ts +0 -11
- package/helpers/websandbox/frame/worker/manager.js +0 -67
- package/helpers/websandbox/frame/worker/manager.spec.d.ts +0 -4
- package/helpers/websandbox/frame/worker/manager.spec.js +0 -127
- package/helpers/websandbox/frame/worker/worker.source.js +0 -4
- package/helpers/websandbox/sandbox.d.ts +0 -57
- package/helpers/websandbox/sandbox.js +0 -175
- package/models/CallsignStatus.d.ts +0 -6
- package/models/CallsignStatus.js +0 -7
- package/models/ExternalProject.d.ts +0 -6
- package/models/ExternalProject.js +0 -2
- package/models/IProject.d.ts +0 -4
- package/models/IRocosSDKConfig.d.ts +0 -19
- package/models/RocosError.d.ts +0 -31
- package/models/RocosError.js +0 -40
- package/models/ServiceEnum.d.ts +0 -27
- package/models/ServiceEnum.js +0 -28
- package/models/Token.d.ts +0 -40
- package/models/Token.js +0 -78
- package/models/Token.spec.js +0 -108
- package/models/asset-storage/AssetModelItem.d.ts +0 -29
- package/models/caller/IRocosCallerMessageChunk.d.ts +0 -10
- package/models/caller/index.d.ts +0 -10
- package/models/caller/index.js +0 -10
- package/models/index.d.ts +0 -76
- package/models/index.js +0 -76
- package/models/message/IRocosTelemetryMessage.d.ts +0 -23
- package/models/params/ICallerParams.d.ts +0 -16
- package/models/workflow/Workflow.d.ts +0 -36
- package/node/RocosSDKNode.d.ts +0 -47
- package/node/RocosSDKNode.js +0 -150
- package/services/AssetStorageService.d.ts +0 -106
- package/services/AssetStorageService.js +0 -169
- package/services/AuthService.d.ts +0 -93
- package/services/AuthService.js +0 -235
- package/services/AuthService.spec.js +0 -163
- package/services/BaseServiceAbstract.d.ts +0 -36
- package/services/BaseServiceAbstract.js +0 -97
- package/services/BaseStreamService.js +0 -47
- package/services/CallerService.d.ts +0 -10
- package/services/CallerService.js +0 -53
- package/services/EvaluatorService.js +0 -28
- package/services/FunctionService.d.ts +0 -68
- package/services/FunctionService.js +0 -99
- package/services/IntegrationService.d.ts +0 -48
- package/services/IntegrationService.js +0 -72
- package/services/MapService.d.ts +0 -108
- package/services/MapService.js +0 -151
- package/services/PlatformTimeService.spec.js +0 -180
- package/services/ProfileService.d.ts +0 -244
- package/services/ProfileService.js +0 -362
- package/services/ProjectService.d.ts +0 -110
- package/services/ProjectService.js +0 -160
- package/services/RobotService.d.ts +0 -278
- package/services/RobotService.js +0 -460
- package/services/TelemetryService.d.ts +0 -40
- package/services/TelemetryService.js +0 -142
- package/services/TelemetryService.spec.js +0 -37
- package/services/WorkflowService.d.ts +0 -67
- package/services/WorkflowService.js +0 -86
- package/services/index.d.ts +0 -27
- package/services/index.js +0 -27
- package/store/RocosStore.d.ts +0 -31
- /package/{api → cjs/api}/StreamRegister.d.ts +0 -0
- /package/{api → cjs/api}/atoms/StreamHeartbeat.d.ts +0 -0
- /package/{api → cjs/api}/streams/caller/CallerStream.d.ts +0 -0
- /package/{api → cjs/api}/streams/caller/CallerStreamAbstract.d.ts +0 -0
- /package/{api → cjs/api}/streams/caller/CallerStreamNode.d.ts +0 -0
- /package/{api → cjs/api}/streams/command/CommandStream.d.ts +0 -0
- /package/{api → cjs/api}/streams/command/CommandStreamAbstract.d.ts +0 -0
- /package/{api → cjs/api}/streams/command/CommandStreamNode.d.ts +0 -0
- /package/{api → cjs/api}/streams/control/ControlStream.d.ts +0 -0
- /package/{api → cjs/api}/streams/control/ControlStreamNode.d.ts +0 -0
- /package/{api → cjs/api}/streams/fileAccessor/FileAccessorStream.d.ts +0 -0
- /package/{api → cjs/api}/streams/fileAccessor/FileAccessorStreamAbstract.d.ts +0 -0
- /package/{api → cjs/api}/streams/fileAccessor/FileAccessorStreamNode.d.ts +0 -0
- /package/{api → cjs/api}/streams/search/SearchStream.d.ts +0 -0
- /package/{api → cjs/api}/streams/search/SearchStreamAbstract.d.ts +0 -0
- /package/{api → cjs/api}/streams/search/SearchStreamNode.d.ts +0 -0
- /package/{api → cjs/api}/streams/telemetry/TelemetryStream.d.ts +0 -0
- /package/{api → cjs/api}/streams/telemetry/TelemetryStreamNode.d.ts +0 -0
- /package/{api → cjs/api}/streams/webRTCSignalling/WebRTCSignallingStream.d.ts +0 -0
- /package/{api → cjs/api}/streams/webRTCSignalling/WebRTCSignallingStreamAbstract.d.ts +0 -0
- /package/{constants → cjs/constants}/auth.d.ts +0 -0
- /package/{constants → cjs/constants}/grpc.d.ts +0 -0
- /package/{constants → cjs/constants}/identifier.d.ts +0 -0
- /package/{constants → cjs/constants}/timezones.d.ts +0 -0
- /package/{grpc → cjs/grpc}/conker_pb.client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/conker_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/conker_pb.grpc-client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/filagree_pb.client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/filagree_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/filagree_pb.grpc-client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/google/protobuf/descriptor_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/google/protobuf/empty_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/pigeon_pb.client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/pigeon_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/pigeon_pb.grpc-client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/rambo.uri.v1_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/rambo.v1_pb.client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/rambo.v1_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/rambo.v1_pb.grpc-client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/serviette.uri.v1_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/serviette.v1_pb.client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/serviette.v1_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/serviette.v1_pb.grpc-client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/slowlane_pb.client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/slowlane_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/slowlane_pb.grpc-client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/teletubby_pb.client.d.ts +0 -0
- /package/{grpc → cjs/grpc}/teletubby_pb.d.ts +0 -0
- /package/{grpc → cjs/grpc}/teletubby_pb.grpc-client.d.ts +0 -0
- /package/{helpers → cjs/helpers}/arrayRemove.d.ts +0 -0
- /package/{helpers → cjs/helpers}/arrayUnique.d.ts +0 -0
- /package/{helpers → cjs/helpers}/average.d.ts +0 -0
- /package/{helpers → cjs/helpers}/cleanObject.d.ts +0 -0
- /package/{helpers → cjs/helpers}/enviroment.d.ts +0 -0
- /package/{helpers → cjs/helpers}/flattenCallsignsLookup.d.ts +0 -0
- /package/{helpers → cjs/helpers}/flattenObject.d.ts +0 -0
- /package/{helpers → cjs/helpers}/flattenOneOf.d.ts +0 -0
- /package/{helpers → cjs/helpers}/formatServiceUrl.d.ts +0 -0
- /package/{helpers → cjs/helpers}/generateUUID.d.ts +0 -0
- /package/{helpers → cjs/helpers}/getSubscriptionsDifference.d.ts +0 -0
- /package/{helpers → cjs/helpers}/getURLSearchParams.d.ts +0 -0
- /package/{helpers → cjs/helpers}/getUniqueId.d.ts +0 -0
- /package/{helpers → cjs/helpers}/getUnixTimeMs.d.ts +0 -0
- /package/{helpers → cjs/helpers}/nanosecondToMillisecond.d.ts +0 -0
- /package/{helpers → cjs/helpers}/randomString.d.ts +0 -0
- /package/{helpers → cjs/helpers}/standardDeviation.d.ts +0 -0
- /package/{helpers → cjs/helpers}/stringToUint8Array.d.ts +0 -0
- /package/{helpers → cjs/helpers}/uint8ArrayToString.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/frame/frame.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/frame/frame.source.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/frame/index.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/frame/worker/index.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/frame/worker/types.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/frame/worker/worker.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/frame/worker/worker.source.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/index.d.ts +0 -0
- /package/{helpers → cjs/helpers}/websandbox/types.d.ts +0 -0
- /package/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/{logger → cjs/logger}/RocosLogger.d.ts +0 -0
- /package/{models → cjs/models}/ExportDataQuery.d.ts +0 -0
- /package/{models → cjs/models}/IBaseService.d.ts +0 -0
- /package/{models → cjs/models}/IConfigGroup.d.ts +0 -0
- /package/{models → cjs/models}/IDebugLevel.d.ts +0 -0
- /package/{models → cjs/models}/IExportDataQuery.d.ts +0 -0
- /package/{models → cjs/models}/IFunctionConfig.d.ts +0 -0
- /package/{models → cjs/models}/IInvitation.d.ts +0 -0
- /package/{models → cjs/models}/IInvitationExists.d.ts +0 -0
- /package/{models → cjs/models}/IOperation.d.ts +0 -0
- /package/{models → cjs/models}/IPersonalAccessToken.d.ts +0 -0
- /package/{models → cjs/models}/IProjectApplication.d.ts +0 -0
- /package/{models → cjs/models}/IRobot.d.ts +0 -0
- /package/{models → cjs/models}/IRobotConfig.d.ts +0 -0
- /package/{models → cjs/models}/IRobotPlugin.d.ts +0 -0
- /package/{models → cjs/models}/IRobotSettings.d.ts +0 -0
- /package/{models → cjs/models}/IRobotTemplate.d.ts +0 -0
- /package/{models → cjs/models}/ISource.d.ts +0 -0
- /package/{models → cjs/models}/IStream.d.ts +0 -0
- /package/{models → cjs/models}/IStreamConfig.d.ts +0 -0
- /package/{models → cjs/models}/IStreamOptions.d.ts +0 -0
- /package/{models → cjs/models}/IStreamSource.d.ts +0 -0
- /package/{models → cjs/models}/ISubscriberStatus.d.ts +0 -0
- /package/{models → cjs/models}/ITelemetryStreamConfig.d.ts +0 -0
- /package/{models → cjs/models}/IToken.d.ts +0 -0
- /package/{models → cjs/models}/IWidget.d.ts +0 -0
- /package/{models → cjs/models}/IWidgetLineGroup.d.ts +0 -0
- /package/{models → cjs/models}/ResponseLevelEnum.d.ts +0 -0
- /package/{models → cjs/models}/Robot.d.ts +0 -0
- /package/{models → cjs/models}/RobotConfig.d.ts +0 -0
- /package/{models → cjs/models}/RobotPlugin.d.ts +0 -0
- /package/{models → cjs/models}/RobotTemplate.d.ts +0 -0
- /package/{models → cjs/models}/Stream.d.ts +0 -0
- /package/{models → cjs/models}/StreamOptions.d.ts +0 -0
- /package/{models → cjs/models}/StreamSource.d.ts +0 -0
- /package/{models → cjs/models}/SubscriberStatusEnum.d.ts +0 -0
- /package/{models → cjs/models}/Widget.d.ts +0 -0
- /package/{models → cjs/models}/WidgetLineGroup.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageChunks.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageHeartbeat.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageResponse.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageResponseAck.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageResponseResult.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageResponseReturn.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageResponseUid.d.ts +0 -0
- /package/{models → cjs/models}/caller/IRocosCallerMessageResponses.d.ts +0 -0
- /package/{models → cjs/models}/caller/RocosCallerResultStatus.d.ts +0 -0
- /package/{models → cjs/models}/caller/RocosResponseLevel.d.ts +0 -0
- /package/{models → cjs/models}/callsigns/CallsignsEnums.d.ts +0 -0
- /package/{models → cjs/models}/callsigns/CallsignsLookup.d.ts +0 -0
- /package/{models → cjs/models}/callsigns/CallsignsQuery.d.ts +0 -0
- /package/{models → cjs/models}/callsigns/CallsignsQueryPredicate.d.ts +0 -0
- /package/{models → cjs/models}/command/IRocosCommandMessageHeartbeat.d.ts +0 -0
- /package/{models → cjs/models}/command/IRocosCommandMessageResponse.d.ts +0 -0
- /package/{models → cjs/models}/command/RocosCommandResultStatus.d.ts +0 -0
- /package/{models → cjs/models}/command/index.d.ts +0 -0
- /package/{models → cjs/models}/file/FileEnums.d.ts +0 -0
- /package/{models → cjs/models}/integrations/Overlay.d.ts +0 -0
- /package/{models → cjs/models}/integrations/Plan.d.ts +0 -0
- /package/{models → cjs/models}/maps/Map.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosCallerMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosChangeMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosCommandMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosControlMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosOpResultMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosSearchMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosSearchRowMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IRocosSearchStatusMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/IStreamStatusMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/RocosCallerMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/RocosCommandMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/RocosControlMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/RocosOpResultMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/RocosSearchMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/RocosSearchRowMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/RocosTelemetryMessage.d.ts +0 -0
- /package/{models → cjs/models}/message/index.d.ts +0 -0
- /package/{models → cjs/models}/params/ICommandParams.d.ts +0 -0
- /package/{models → cjs/models}/params/IControlParams.d.ts +0 -0
- /package/{models → cjs/models}/params/IFileAccessorParams.d.ts +0 -0
- /package/{models → cjs/models}/params/ISearchParams.d.ts +0 -0
- /package/{models → cjs/models}/params/ITelemetryParams.d.ts +0 -0
- /package/{models → cjs/models}/params/IWebRTCSignallingParams.d.ts +0 -0
- /package/{models → cjs/models}/projects/ProjectUser.d.ts +0 -0
- /package/{models → cjs/models}/schedule/IScheduleAction.d.ts +0 -0
- /package/{models → cjs/models}/schedule/IScheduleInfo.d.ts +0 -0
- /package/{models → cjs/models}/schedule/IScheduleJob.d.ts +0 -0
- /package/{models → cjs/models}/search/SearchQueryFilter.d.ts +0 -0
- /package/{models → cjs/models}/search/SearchStreamQuery.d.ts +0 -0
- /package/{models → cjs/models}/stream/IBaseStream.d.ts +0 -0
- /package/{models → cjs/models}/stream/ICallerStream.d.ts +0 -0
- /package/{models → cjs/models}/stream/ICommandStream.d.ts +0 -0
- /package/{models → cjs/models}/stream/IControlStream.d.ts +0 -0
- /package/{models → cjs/models}/stream/IFileAccessorStream.d.ts +0 -0
- /package/{models → cjs/models}/stream/ISearchStream.d.ts +0 -0
- /package/{models → cjs/models}/stream/ITelemetryStream.d.ts +0 -0
- /package/{models → cjs/models}/stream/IWebRTCSignallingStream.d.ts +0 -0
- /package/{models → cjs/models}/types.d.ts +0 -0
- /package/{node → cjs/node}/index.d.ts +0 -0
- /package/{services → cjs/services}/BaseStreamService.d.ts +0 -0
- /package/{services → cjs/services}/CallerServiceNode.d.ts +0 -0
- /package/{services → cjs/services}/CommandService.d.ts +0 -0
- /package/{services → cjs/services}/CommandServiceNode.d.ts +0 -0
- /package/{services → cjs/services}/ConfigGroupService.d.ts +0 -0
- /package/{services → cjs/services}/ControlService.d.ts +0 -0
- /package/{services → cjs/services}/ControlServiceNode.d.ts +0 -0
- /package/{services → cjs/services}/DashboardService.d.ts +0 -0
- /package/{services → cjs/services}/EvaluatorService.d.ts +0 -0
- /package/{services → cjs/services}/EventService.d.ts +0 -0
- /package/{services → cjs/services}/FileAccessorService.d.ts +0 -0
- /package/{services → cjs/services}/FileAccessorServiceNode.d.ts +0 -0
- /package/{services → cjs/services}/PlatformTimeService.d.ts +0 -0
- /package/{services → cjs/services}/ScheduleService.d.ts +0 -0
- /package/{services → cjs/services}/SearchService.d.ts +0 -0
- /package/{services → cjs/services}/SearchServiceNode.d.ts +0 -0
- /package/{services → cjs/services}/SpotProvisioningService.d.ts +0 -0
- /package/{services → cjs/services}/SpotProvisioningServiceNode.d.ts +0 -0
- /package/{services → cjs/services}/StreamService.d.ts +0 -0
- /package/{services → cjs/services}/TelemetryServiceNode.d.ts +0 -0
- /package/{services → cjs/services}/TimeSyncerService.d.ts +0 -0
- /package/{services → cjs/services}/UserService.d.ts +0 -0
- /package/{services → cjs/services}/WebRTCSignallingService.d.ts +0 -0
- /package/{IRocosSDK.js → esm/IRocosSDK.js} +0 -0
- /package/{api → esm/api}/StreamRegister.js +0 -0
- /package/{api → esm/api}/atoms/StreamHeartbeat.js +0 -0
- /package/{api → esm/api}/streams/caller/CallerStreamAbstract.js +0 -0
- /package/{api → esm/api}/streams/command/CommandStreamAbstract.js +0 -0
- /package/{api → esm/api}/streams/control/ControlStreamAbstract.js +0 -0
- /package/{api → esm/api}/streams/fileAccessor/FileAccessorStreamAbstract.js +0 -0
- /package/{api → esm/api}/streams/search/SearchStreamAbstract.js +0 -0
- /package/{api → esm/api}/streams/telemetry/TelemetryStreamAbstract.js +0 -0
- /package/{api → esm/api}/streams/webRTCSignalling/WebRTCSignallingStreamAbstract.js +0 -0
- /package/{constants → esm/constants}/auth.js +0 -0
- /package/{constants → esm/constants}/grpc.js +0 -0
- /package/{constants → esm/constants}/identifier.js +0 -0
- /package/{constants → esm/constants}/timezones.js +0 -0
- /package/{grpc → esm/grpc}/conker_pb.client.js +0 -0
- /package/{grpc → esm/grpc}/conker_pb.grpc-client.js +0 -0
- /package/{grpc → esm/grpc}/conker_pb.js +0 -0
- /package/{grpc → esm/grpc}/filagree_pb.client.js +0 -0
- /package/{grpc → esm/grpc}/filagree_pb.grpc-client.js +0 -0
- /package/{grpc → esm/grpc}/filagree_pb.js +0 -0
- /package/{grpc → esm/grpc}/google/protobuf/descriptor_pb.js +0 -0
- /package/{grpc → esm/grpc}/google/protobuf/empty_pb.js +0 -0
- /package/{grpc → esm/grpc}/pigeon_pb.client.js +0 -0
- /package/{grpc → esm/grpc}/pigeon_pb.grpc-client.js +0 -0
- /package/{grpc → esm/grpc}/pigeon_pb.js +0 -0
- /package/{grpc → esm/grpc}/rambo.uri.v1_pb.js +0 -0
- /package/{grpc → esm/grpc}/rambo.v1_pb.client.js +0 -0
- /package/{grpc → esm/grpc}/rambo.v1_pb.grpc-client.js +0 -0
- /package/{grpc → esm/grpc}/rambo.v1_pb.js +0 -0
- /package/{grpc → esm/grpc}/serviette.uri.v1_pb.js +0 -0
- /package/{grpc → esm/grpc}/serviette.v1_pb.client.js +0 -0
- /package/{grpc → esm/grpc}/serviette.v1_pb.grpc-client.js +0 -0
- /package/{grpc → esm/grpc}/serviette.v1_pb.js +0 -0
- /package/{grpc → esm/grpc}/slowlane_pb.client.js +0 -0
- /package/{grpc → esm/grpc}/slowlane_pb.grpc-client.js +0 -0
- /package/{grpc → esm/grpc}/slowlane_pb.js +0 -0
- /package/{grpc → esm/grpc}/teletubby_pb.client.js +0 -0
- /package/{grpc → esm/grpc}/teletubby_pb.grpc-client.js +0 -0
- /package/{grpc → esm/grpc}/teletubby_pb.js +0 -0
- /package/{helpers → esm/helpers}/arrayRemove.js +0 -0
- /package/{helpers → esm/helpers}/arrayUnique.js +0 -0
- /package/{helpers → esm/helpers}/average.js +0 -0
- /package/{helpers → esm/helpers}/enviroment.js +0 -0
- /package/{helpers → esm/helpers}/flattenCallsignsLookup.js +0 -0
- /package/{helpers → esm/helpers}/flattenObject.js +0 -0
- /package/{helpers → esm/helpers}/flattenOneOf.js +0 -0
- /package/{helpers → esm/helpers}/formatServiceUrl.js +0 -0
- /package/{helpers → esm/helpers}/generateUUID.js +0 -0
- /package/{helpers → esm/helpers}/getSubscriptionsDifference.js +0 -0
- /package/{helpers → esm/helpers}/getURLSearchParams.js +0 -0
- /package/{helpers → esm/helpers}/getUniqueId.js +0 -0
- /package/{helpers → esm/helpers}/getUnixTimeMs.js +0 -0
- /package/{helpers → esm/helpers}/nanosecondToMillisecond.js +0 -0
- /package/{helpers → esm/helpers}/randomString.js +0 -0
- /package/{helpers → esm/helpers}/standardDeviation.js +0 -0
- /package/{helpers → esm/helpers}/stringToUint8Array.js +0 -0
- /package/{helpers → esm/helpers}/uint8ArrayToString.js +0 -0
- /package/{helpers/websandbox/frame/index.js → esm/helpers/websandbox/frame/index.d.ts} +0 -0
- /package/{helpers/websandbox/frame/worker/index.js → esm/helpers/websandbox/frame/worker/index.d.ts} +0 -0
- /package/{helpers → esm/helpers}/websandbox/frame/worker/types.js +0 -0
- /package/{helpers/cleanObject.spec.d.ts → esm/helpers/websandbox/frame/worker/worker.d.ts} +0 -0
- /package/{helpers → esm/helpers}/websandbox/frame/worker/worker.js +0 -0
- /package/{helpers/websandbox/index.js → esm/helpers/websandbox/index.d.ts} +0 -0
- /package/{helpers → esm/helpers}/websandbox/types.js +0 -0
- /package/{index.js → esm/index.d.ts} +0 -0
- /package/{logger → esm/logger}/RocosLogger.js +0 -0
- /package/{models → esm/models}/ExportDataQuery.js +0 -0
- /package/{models → esm/models}/IBaseService.js +0 -0
- /package/{models → esm/models}/IConfigGroup.js +0 -0
- /package/{models → esm/models}/IDebugLevel.js +0 -0
- /package/{models → esm/models}/IExportDataQuery.js +0 -0
- /package/{models → esm/models}/IFunctionConfig.js +0 -0
- /package/{models → esm/models}/IInvitation.js +0 -0
- /package/{models → esm/models}/IInvitationExists.js +0 -0
- /package/{models → esm/models}/IOperation.js +0 -0
- /package/{models → esm/models}/IPersonalAccessToken.js +0 -0
- /package/{models → esm/models}/IProject.js +0 -0
- /package/{models → esm/models}/IProjectApplication.js +0 -0
- /package/{helpers/flattenObject.spec.d.ts → esm/models/IProjectInfo.js} +0 -0
- /package/{models → esm/models}/IRobot.js +0 -0
- /package/{models → esm/models}/IRobotConfig.js +0 -0
- /package/{models → esm/models}/IRobotPlugin.js +0 -0
- /package/{models → esm/models}/IRobotSettings.js +0 -0
- /package/{models → esm/models}/IRobotTemplate.js +0 -0
- /package/{models → esm/models}/IRocosSDKConfig.js +0 -0
- /package/{models → esm/models}/ISource.js +0 -0
- /package/{models → esm/models}/IStream.js +0 -0
- /package/{models → esm/models}/IStreamConfig.js +0 -0
- /package/{models → esm/models}/IStreamOptions.js +0 -0
- /package/{models → esm/models}/IStreamSource.js +0 -0
- /package/{models → esm/models}/ISubscriberStatus.js +0 -0
- /package/{models → esm/models}/ITelemetryStreamConfig.js +0 -0
- /package/{models → esm/models}/IToken.js +0 -0
- /package/{models → esm/models}/IWidget.js +0 -0
- /package/{models → esm/models}/IWidgetLineGroup.js +0 -0
- /package/{models → esm/models}/ResponseLevelEnum.js +0 -0
- /package/{models → esm/models}/Robot.js +0 -0
- /package/{models → esm/models}/RobotConfig.js +0 -0
- /package/{models → esm/models}/RobotPlugin.js +0 -0
- /package/{models → esm/models}/RobotTemplate.js +0 -0
- /package/{models → esm/models}/Stream.js +0 -0
- /package/{models → esm/models}/StreamOptions.js +0 -0
- /package/{models → esm/models}/StreamSource.js +0 -0
- /package/{models → esm/models}/SubscriberStatusEnum.js +0 -0
- /package/{models → esm/models}/Widget.js +0 -0
- /package/{models → esm/models}/WidgetLineGroup.js +0 -0
- /package/{helpers/flattenOneOf.spec.d.ts → esm/models/asset-storage/AssetItem.js} +0 -0
- /package/{helpers/formatServiceUrl.spec.d.ts → esm/models/asset-storage/SyncIntegrations.js} +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageChunk.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageChunks.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageHeartbeat.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageResponse.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageResponseAck.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageResponseResult.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageResponseReturn.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageResponseUid.js +0 -0
- /package/{models → esm/models}/caller/IRocosCallerMessageResponses.js +0 -0
- /package/{models → esm/models}/caller/RocosCallerResultStatus.js +0 -0
- /package/{models → esm/models}/caller/RocosResponseLevel.js +0 -0
- /package/{models → esm/models}/callsigns/CallsignsEnums.js +0 -0
- /package/{models → esm/models}/callsigns/CallsignsLookup.js +0 -0
- /package/{models → esm/models}/callsigns/CallsignsQuery.js +0 -0
- /package/{models → esm/models}/callsigns/CallsignsQueryPredicate.js +0 -0
- /package/{models → esm/models}/command/IRocosCommandMessageHeartbeat.js +0 -0
- /package/{models → esm/models}/command/IRocosCommandMessageResponse.js +0 -0
- /package/{models → esm/models}/command/RocosCommandResultStatus.js +0 -0
- /package/{models/command/index.js → esm/models/command/index.d.ts} +0 -0
- /package/{helpers/getURLSearchParams.spec.d.ts → esm/models/device-credentials/DeviceCredentials.js} +0 -0
- /package/{models → esm/models}/file/FileEnums.js +0 -0
- /package/{helpers/nanosecondToMillisecond.spec.d.ts → esm/models/graph/Position.js} +0 -0
- /package/{helpers/standardDeviation.spec.d.ts → esm/models/graph/Quaternion.js} +0 -0
- /package/{models/Token.spec.d.ts → esm/models/graph/Vector3.js} +0 -0
- /package/{models/asset-storage/AssetModelItem.js → esm/models/integrations/Location.js} +0 -0
- /package/{models → esm/models}/integrations/Overlay.js +0 -0
- /package/{models/integrations/Plan.js → esm/models/integrations/PaginatedResults.js} +0 -0
- /package/{models/maps/Map.js → esm/models/integrations/Plan.js} +0 -0
- /package/{models/message/IRocosCallerMessage.js → esm/models/maps/Map.js} +0 -0
- /package/{models/message/IRocosChangeMessage.js → esm/models/maps/Panorama.js} +0 -0
- /package/{models/message/IRocosCommandMessage.js → esm/models/message/IRocosCallerMessage.js} +0 -0
- /package/{models/message/IRocosControlMessage.js → esm/models/message/IRocosChangeMessage.js} +0 -0
- /package/{models/message/IRocosOpResultMessage.js → esm/models/message/IRocosCommandMessage.js} +0 -0
- /package/{models/message/IRocosSearchMessage.js → esm/models/message/IRocosControlMessage.js} +0 -0
- /package/{models/message/IRocosSearchRowMessage.js → esm/models/message/IRocosOpResultMessage.js} +0 -0
- /package/{models/message/IRocosSearchStatusMessage.js → esm/models/message/IRocosSearchMessage.js} +0 -0
- /package/{models/message/IRocosTelemetryMessage.js → esm/models/message/IRocosSearchRowMessage.js} +0 -0
- /package/{models/message/IStreamStatusMessage.js → esm/models/message/IRocosSearchStatusMessage.js} +0 -0
- /package/{models/params/ICallerParams.js → esm/models/message/IRocosTelemetryMessage.js} +0 -0
- /package/{models/params/ICommandParams.js → esm/models/message/IStreamStatusMessage.js} +0 -0
- /package/{models → esm/models}/message/RocosCallerMessage.js +0 -0
- /package/{models → esm/models}/message/RocosCommandMessage.js +0 -0
- /package/{models → esm/models}/message/RocosControlMessage.js +0 -0
- /package/{models → esm/models}/message/RocosOpResultMessage.js +0 -0
- /package/{models → esm/models}/message/RocosSearchMessage.js +0 -0
- /package/{models → esm/models}/message/RocosSearchRowMessage.js +0 -0
- /package/{models → esm/models}/message/RocosTelemetryMessage.js +0 -0
- /package/{models/message/index.js → esm/models/message/index.d.ts} +0 -0
- /package/{models/params/IControlParams.js → esm/models/params/ICallerParams.js} +0 -0
- /package/{models/params/IFileAccessorParams.js → esm/models/params/ICommandParams.js} +0 -0
- /package/{models/params/ISearchParams.js → esm/models/params/IControlParams.js} +0 -0
- /package/{models/params/ITelemetryParams.js → esm/models/params/IFileAccessorParams.js} +0 -0
- /package/{models/params/IWebRTCSignallingParams.js → esm/models/params/ISearchParams.js} +0 -0
- /package/{models/projects/ProjectUser.js → esm/models/params/ITelemetryParams.js} +0 -0
- /package/{models/schedule/IScheduleInfo.js → esm/models/params/IWebRTCSignallingParams.js} +0 -0
- /package/{models/schedule/IScheduleJob.js → esm/models/projects/ExternalProject.js} +0 -0
- /package/{models/stream/IBaseStream.js → esm/models/projects/NewProjectRequest.js} +0 -0
- /package/{models/stream/ICallerStream.js → esm/models/projects/ProjectUser.js} +0 -0
- /package/{models → esm/models}/schedule/IScheduleAction.js +0 -0
- /package/{models/stream/ICommandStream.js → esm/models/schedule/IScheduleInfo.js} +0 -0
- /package/{models/stream/IControlStream.js → esm/models/schedule/IScheduleJob.js} +0 -0
- /package/{models → esm/models}/search/SearchQueryFilter.js +0 -0
- /package/{models → esm/models}/search/SearchStreamQuery.js +0 -0
- /package/{models/stream/IFileAccessorStream.js → esm/models/stream/IBaseStream.js} +0 -0
- /package/{models/stream/ISearchStream.js → esm/models/stream/ICallerStream.js} +0 -0
- /package/{models/stream/ITelemetryStream.js → esm/models/stream/ICommandStream.js} +0 -0
- /package/{models/stream/IWebRTCSignallingStream.js → esm/models/stream/IControlStream.js} +0 -0
- /package/{models/types.js → esm/models/stream/IFileAccessorStream.js} +0 -0
- /package/{models/workflow/Workflow.js → esm/models/stream/ISearchStream.js} +0 -0
- /package/{services/AuthService.spec.d.ts → esm/models/stream/ITelemetryStream.js} +0 -0
- /package/{services/PlatformTimeService.spec.d.ts → esm/models/stream/IWebRTCSignallingStream.js} +0 -0
- /package/{services/TelemetryService.spec.d.ts → esm/models/target/Target.js} +0 -0
- /package/{node/index.js → esm/node/index.d.ts} +0 -0
- /package/{services → esm/services}/CallerServiceNode.js +0 -0
- /package/{services → esm/services}/CommandService.js +0 -0
- /package/{services → esm/services}/CommandServiceNode.js +0 -0
- /package/{services → esm/services}/ConfigGroupService.js +0 -0
- /package/{services → esm/services}/ControlService.js +0 -0
- /package/{services → esm/services}/ControlServiceNode.js +0 -0
- /package/{services → esm/services}/DashboardService.js +0 -0
- /package/{services → esm/services}/EventService.js +0 -0
- /package/{services → esm/services}/FileAccessorService.js +0 -0
- /package/{services → esm/services}/FileAccessorServiceNode.js +0 -0
- /package/{services → esm/services}/PlatformTimeService.js +0 -0
- /package/{services → esm/services}/ScheduleService.js +0 -0
- /package/{services → esm/services}/SearchService.js +0 -0
- /package/{services → esm/services}/SearchServiceNode.js +0 -0
- /package/{services → esm/services}/SpotProvisioningService.js +0 -0
- /package/{services → esm/services}/SpotProvisioningServiceNode.js +0 -0
- /package/{services → esm/services}/StreamService.js +0 -0
- /package/{services → esm/services}/TelemetryServiceNode.js +0 -0
- /package/{services → esm/services}/TimeSyncerService.js +0 -0
- /package/{services → esm/services}/UserService.js +0 -0
- /package/{services → esm/services}/WebRTCSignallingService.js +0 -0
- /package/{store → esm/store}/RocosStore.js +0 -0
@@ -0,0 +1,263 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.AuthService = void 0;
|
4
|
+
const api_1 = require("../constants/api");
|
5
|
+
const rxjs_1 = require("rxjs");
|
6
|
+
const models_1 = require("../models");
|
7
|
+
const BaseServiceAbstract_1 = require("./BaseServiceAbstract");
|
8
|
+
const RocosLogger_1 = require("../logger/RocosLogger");
|
9
|
+
const RocosStore_1 = require("../store/RocosStore");
|
10
|
+
const operators_1 = require("rxjs/operators");
|
11
|
+
const formatServiceUrl_1 = require("../helpers/formatServiceUrl");
|
12
|
+
const auth_1 = require("../constants/auth");
|
13
|
+
class AuthService extends BaseServiceAbstract_1.BaseServiceAbstract {
|
14
|
+
constructor(config) {
|
15
|
+
super(config);
|
16
|
+
this.config = config;
|
17
|
+
this.tokenSubject$ = new rxjs_1.BehaviorSubject(null);
|
18
|
+
this.config = config;
|
19
|
+
this.logger = RocosLogger_1.RocosLogger.getInstance(`AuthService(${this.config.url})`);
|
20
|
+
if (this.config.token) {
|
21
|
+
this.setToken(this.config.token);
|
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));
|
36
|
+
}
|
37
|
+
getStatus() {
|
38
|
+
return true;
|
39
|
+
}
|
40
|
+
teardown() {
|
41
|
+
if (this.isTokenRefreshCheckerRunning()) {
|
42
|
+
this.logger.debug('Stopping token refresh checker');
|
43
|
+
this.stopTokenRefreshChecker();
|
44
|
+
}
|
45
|
+
}
|
46
|
+
getError(e) {
|
47
|
+
return new models_1.RocosError(e, models_1.errorCodes.AUTH_ERROR, e?.statusCode);
|
48
|
+
}
|
49
|
+
setToken(value, expiresIn) {
|
50
|
+
if (expiresIn !== undefined) {
|
51
|
+
this.logger.warn('setToken(value, expiresIn) is deprecated. Use setToken(value) instead');
|
52
|
+
}
|
53
|
+
if (typeof value === 'string') {
|
54
|
+
this.token = new models_1.Token(value);
|
55
|
+
}
|
56
|
+
else {
|
57
|
+
this.token = value;
|
58
|
+
}
|
59
|
+
this.config.token = this.token.value;
|
60
|
+
// output a message for token change
|
61
|
+
if (this.isTokenValid(this.token)) {
|
62
|
+
this.tokenSubject$.next(this.token);
|
63
|
+
}
|
64
|
+
else {
|
65
|
+
void this.getToken();
|
66
|
+
}
|
67
|
+
}
|
68
|
+
/**
|
69
|
+
* Clear token
|
70
|
+
*/
|
71
|
+
clearToken() {
|
72
|
+
this.token = undefined;
|
73
|
+
this.config.token = undefined;
|
74
|
+
}
|
75
|
+
/**
|
76
|
+
* Get the authentication token for application Id and application Key.
|
77
|
+
*/
|
78
|
+
async getAppToken() {
|
79
|
+
if (!('appId' in this.config) || !this.config.appId || !('appKey' in this.config) || !this.config.appKey) {
|
80
|
+
throw new models_1.RocosError('Can not get app token, missing appId and appKey', models_1.errorCodes.AUTH_ERROR);
|
81
|
+
}
|
82
|
+
const res = await this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_APPLICATION_AUTH_URL, { url: this.config.url }, this.config.insecure), {
|
83
|
+
applicationId: this.config.appId,
|
84
|
+
secret: this.config.appKey,
|
85
|
+
}, 'Failed to get users auth token.', { public: true });
|
86
|
+
return new models_1.Token(res.token);
|
87
|
+
}
|
88
|
+
/**
|
89
|
+
* Get new auth token for a user
|
90
|
+
* @desc This only works for user auth tokens, not appId auth tokens
|
91
|
+
*/
|
92
|
+
async getNewUserToken() {
|
93
|
+
if (!('token' in this.config) || !this.config.token) {
|
94
|
+
throw new models_1.RocosError('Can not get new app token, missing token', models_1.errorCodes.AUTH_ERROR);
|
95
|
+
}
|
96
|
+
const token = new models_1.Token(this.config.token, this.config.refreshToken);
|
97
|
+
if (token?.isExpired()) {
|
98
|
+
throw new models_1.RocosError('Token expired', models_1.errorCodes.AUTH_ERROR);
|
99
|
+
}
|
100
|
+
if (!this.isTokenIssuedByApp(token)) {
|
101
|
+
this.logger.info('Token is not issued by app. Getting new token from DD token.');
|
102
|
+
return this.getNewUserTokenFromExternalToken();
|
103
|
+
}
|
104
|
+
return this.refreshToken(token);
|
105
|
+
}
|
106
|
+
/**
|
107
|
+
* Get new auth token for a user.
|
108
|
+
*
|
109
|
+
* Uses the OTP flow to exchange an external token for a user token.
|
110
|
+
*
|
111
|
+
* @desc This only works for user auth tokens, not appId auth tokens
|
112
|
+
*/
|
113
|
+
async getNewUserTokenFromExternalToken() {
|
114
|
+
if (!('token' in this.config) || !this.config.token) {
|
115
|
+
throw new models_1.RocosError('Can not get new token, missing token', models_1.errorCodes.AUTH_ERROR);
|
116
|
+
}
|
117
|
+
const ddToken = new models_1.Token(this.config.token);
|
118
|
+
const { otp } = await this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_OTP_URL, { url: this.config.url }, this.config.insecure), undefined, 'Failed to get one time password.', { public: true, headers: { Authorization: ddToken.bearer } });
|
119
|
+
const { token, refreshToken } = await this.callPost((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_OTP_AUTH_URL, { url: this.config.url }, this.config.insecure), { otp }, 'Failed to get users auth token.', { public: true });
|
120
|
+
return new models_1.Token(token, refreshToken);
|
121
|
+
}
|
122
|
+
/**
|
123
|
+
* Get the authentication token
|
124
|
+
*
|
125
|
+
* This will return the current token if it is not expired, otherwise it will get a new token based on your config.
|
126
|
+
*/
|
127
|
+
async getToken() {
|
128
|
+
if (this.token && this.isTokenValid(this.token)) {
|
129
|
+
if (this.token.isExpiredIn(15, 'minutes')) {
|
130
|
+
this.logger.info('Token expires within 15 minutes. Refreshing.');
|
131
|
+
const newToken = await this.refreshToken();
|
132
|
+
this.setToken(newToken);
|
133
|
+
return newToken;
|
134
|
+
}
|
135
|
+
return this.token;
|
136
|
+
}
|
137
|
+
let token;
|
138
|
+
try {
|
139
|
+
if ('appId' in this.config && 'appKey' in this.config) {
|
140
|
+
token = await this.getAppToken();
|
141
|
+
}
|
142
|
+
else if ('token' in this.config) {
|
143
|
+
token = await this.getNewUserToken();
|
144
|
+
}
|
145
|
+
}
|
146
|
+
catch (e) {
|
147
|
+
const message = 'Failed to get auth token.';
|
148
|
+
this.logger.error(message, e);
|
149
|
+
if (e instanceof Error) {
|
150
|
+
e.message = message;
|
151
|
+
throw new models_1.RocosError(e, models_1.errorCodes.AUTH_ERROR);
|
152
|
+
}
|
153
|
+
else {
|
154
|
+
throw new models_1.RocosError(message, models_1.errorCodes.AUTH_ERROR);
|
155
|
+
}
|
156
|
+
}
|
157
|
+
if (!token) {
|
158
|
+
const message = 'Failed to get auth token. Config invalid.';
|
159
|
+
this.logger.error(message);
|
160
|
+
throw new models_1.RocosError(message, models_1.errorCodes.AUTH_ERROR);
|
161
|
+
}
|
162
|
+
this.setToken(token);
|
163
|
+
return token;
|
164
|
+
}
|
165
|
+
/**
|
166
|
+
* Refresh the authentication token
|
167
|
+
*
|
168
|
+
* This only works for user auth tokens, not appId auth tokens.
|
169
|
+
*
|
170
|
+
* The new token is not automatically set as the current token. Use `setToken` to set the new token.
|
171
|
+
*
|
172
|
+
* @see setToken
|
173
|
+
* @param token the token to refresh. If not provided, the current token will be used.
|
174
|
+
*/
|
175
|
+
async refreshToken(token) {
|
176
|
+
const tokenToRefresh = token ?? this.token;
|
177
|
+
if (!tokenToRefresh) {
|
178
|
+
throw new models_1.RocosError('No token to refresh', models_1.errorCodes.AUTH_ERROR);
|
179
|
+
}
|
180
|
+
const res = await this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_USER_TOKEN_URL, { url: this.config.url }, this.config.insecure), 'Failed to get users auth token.', undefined, { public: true, headers: { Authorization: tokenToRefresh.bearer } });
|
181
|
+
return new models_1.Token(res.token, res.refreshToken);
|
182
|
+
}
|
183
|
+
/** Refresh the token if it is expired or will expire in the next `minutes` minutes
|
184
|
+
*
|
185
|
+
* This only works for user auth tokens, not appId auth tokens.
|
186
|
+
*
|
187
|
+
* If you want to refresh the token regardless of the expiry time, use `refreshToken`.
|
188
|
+
*
|
189
|
+
* @param minutes the number of minutes before the token expires to refresh the token
|
190
|
+
* @returns true if the token was refreshed
|
191
|
+
* @see refreshToken
|
192
|
+
*/
|
193
|
+
async refreshTokenIfExpired(minutes) {
|
194
|
+
if (this.token?.isExpiredIn(minutes, 'minutes')) {
|
195
|
+
this.logger.info('Token expires in 15 minutes. Refreshing.');
|
196
|
+
const newToken = await this.refreshToken();
|
197
|
+
this.setToken(newToken);
|
198
|
+
return true;
|
199
|
+
}
|
200
|
+
return false;
|
201
|
+
}
|
202
|
+
/** Start a 5-minute loop to check if the token needs to be refreshed
|
203
|
+
*
|
204
|
+
* This is useful when you are using GRPC services (i.e. telemetry) which does not automatically refresh the token.
|
205
|
+
* It is not required when using REST services as the token is refreshed automatically.
|
206
|
+
*
|
207
|
+
* The loop will stop when `stopTokenRefreshChecker` is called.
|
208
|
+
*
|
209
|
+
* @see stopTokenRefreshChecker
|
210
|
+
*/
|
211
|
+
startTokenRefreshChecker() {
|
212
|
+
const maxInterval = 1000 * 60 * 10; // 10 minutes
|
213
|
+
const minInterval = 1000 * 60; // 1 minute
|
214
|
+
const threshold = 1000 * 60 * 15; // 15 minutes
|
215
|
+
if (this.isTokenRefreshCheckerRunning())
|
216
|
+
return;
|
217
|
+
if (!this.token)
|
218
|
+
throw new models_1.RocosError('No token to refresh', models_1.errorCodes.AUTH_ERROR);
|
219
|
+
if (!this.isTokenValid(this.token))
|
220
|
+
throw new models_1.RocosError('Token is not valid', models_1.errorCodes.AUTH_ERROR);
|
221
|
+
const loop = () => {
|
222
|
+
this.logger.debug('Checking scheduled token refresh');
|
223
|
+
this.refreshTokenIfExpired(15)
|
224
|
+
.catch((e) => {
|
225
|
+
this.logger.error('Failed to refresh token', e);
|
226
|
+
})
|
227
|
+
.finally(() => {
|
228
|
+
if (!this.token?.expires)
|
229
|
+
return;
|
230
|
+
// schedule next check
|
231
|
+
const timeTillThreshold = this.token.expires.getTime() - Date.now() - threshold;
|
232
|
+
const interval = Math.max(minInterval, Math.min(maxInterval, timeTillThreshold));
|
233
|
+
this.tokenRefreshTimeoutId = setTimeout(() => loop(), interval);
|
234
|
+
});
|
235
|
+
};
|
236
|
+
loop();
|
237
|
+
}
|
238
|
+
/**
|
239
|
+
* Stop the token refresh checker
|
240
|
+
* @see startTokenRefreshChecker
|
241
|
+
*/
|
242
|
+
stopTokenRefreshChecker() {
|
243
|
+
clearTimeout(this.tokenRefreshTimeoutId);
|
244
|
+
this.tokenRefreshTimeoutId = undefined;
|
245
|
+
}
|
246
|
+
/** Check if the token refresh checker is running
|
247
|
+
*
|
248
|
+
* @see startTokenRefreshChecker
|
249
|
+
* @see stopTokenRefreshChecker
|
250
|
+
* @returns true if the token refresh checker is running
|
251
|
+
*/
|
252
|
+
isTokenRefreshCheckerRunning() {
|
253
|
+
return this.tokenRefreshTimeoutId !== undefined;
|
254
|
+
}
|
255
|
+
/** Checks if the token is valid for use with the API */
|
256
|
+
isTokenValid(token) {
|
257
|
+
return !token.isExpired() && this.isTokenIssuedByApp(token);
|
258
|
+
}
|
259
|
+
isTokenIssuedByApp(token) {
|
260
|
+
return token.issuer === auth_1.issuer;
|
261
|
+
}
|
262
|
+
}
|
263
|
+
exports.AuthService = AuthService;
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { IRocosSDKConfig, RocosError } from '../models';
|
2
|
+
import { QueryParams } from '../helpers';
|
3
|
+
import { Logger } from 'loglevel';
|
4
|
+
type ResponseType = 'json' | 'blob' | 'stream' | 'text' | 'raw';
|
5
|
+
interface RequestConfig {
|
6
|
+
/**
|
7
|
+
* Additional headers to send with the request.
|
8
|
+
*/
|
9
|
+
headers?: Record<string, string>;
|
10
|
+
/**
|
11
|
+
* If true, the request will be sent without authentication.
|
12
|
+
*/
|
13
|
+
public?: boolean;
|
14
|
+
/**
|
15
|
+
* The response type to use for the request.
|
16
|
+
*/
|
17
|
+
responseType?: ResponseType;
|
18
|
+
}
|
19
|
+
export declare abstract class BaseServiceAbstract {
|
20
|
+
protected config: IRocosSDKConfig;
|
21
|
+
protected logger: Logger;
|
22
|
+
protected constructor(config: IRocosSDKConfig);
|
23
|
+
protected abstract getError(e: Error): RocosError;
|
24
|
+
protected callPost<Response = unknown, Payload = unknown>(url: string, payload: Payload, errorMessage: string, config?: RequestConfig, params?: QueryParams): Promise<Response>;
|
25
|
+
protected callPut<Response = unknown, Payload = unknown>(url: string, payload: Payload, errorMessage: string, config?: RequestConfig): Promise<Response>;
|
26
|
+
protected callDelete<Response = unknown, Payload = unknown>(url: string, errorMessage: string, payload?: Payload): Promise<Response>;
|
27
|
+
protected callGet<Response = unknown>(url: string, errorMessage: string, params?: QueryParams, config?: RequestConfig): Promise<Response>;
|
28
|
+
protected call<Response = unknown, Payload = unknown>(url: string, method: 'GET' | 'POST' | 'PUT' | 'DELETE', options: {
|
29
|
+
errorMessage: string;
|
30
|
+
config?: RequestConfig;
|
31
|
+
payload?: Payload;
|
32
|
+
params?: QueryParams;
|
33
|
+
}): Promise<Response>;
|
34
|
+
private fetchOrThrow;
|
35
|
+
}
|
36
|
+
export {};
|
@@ -0,0 +1,94 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BaseServiceAbstract = void 0;
|
4
|
+
const models_1 = require("../models");
|
5
|
+
const helpers_1 = require("../helpers");
|
6
|
+
const RocosStore_1 = require("../store/RocosStore");
|
7
|
+
class BaseServiceAbstract {
|
8
|
+
constructor(config) {
|
9
|
+
this.config = config;
|
10
|
+
}
|
11
|
+
async callPost(url, payload, errorMessage, config, params) {
|
12
|
+
return this.call(url, 'POST', { errorMessage, payload, config, params });
|
13
|
+
}
|
14
|
+
async callPut(url, payload, errorMessage, config) {
|
15
|
+
return this.call(url, 'PUT', { errorMessage, payload, config });
|
16
|
+
}
|
17
|
+
async callDelete(url, errorMessage, payload) {
|
18
|
+
return this.call(url, 'DELETE', { errorMessage, payload });
|
19
|
+
}
|
20
|
+
async callGet(url, errorMessage, params, config) {
|
21
|
+
return this.call(url, 'GET', { errorMessage, params, config });
|
22
|
+
}
|
23
|
+
async call(url, method, options) {
|
24
|
+
const { errorMessage, config, payload, params } = options;
|
25
|
+
try {
|
26
|
+
const formattedUrl = params ? `${url}?${(0, helpers_1.getURLSearchParams)(params)}` : url;
|
27
|
+
const defaultHeaders = {};
|
28
|
+
if (!config?.public) {
|
29
|
+
const token = await RocosStore_1.RocosStore.getSDKInstance(this.config).getAuthService().getToken();
|
30
|
+
defaultHeaders.Authorization = token.bearer;
|
31
|
+
}
|
32
|
+
const requestConfig = {
|
33
|
+
method,
|
34
|
+
headers: {
|
35
|
+
...defaultHeaders,
|
36
|
+
...config?.headers,
|
37
|
+
},
|
38
|
+
};
|
39
|
+
// must check if FormData exists for node support
|
40
|
+
if (typeof FormData !== 'undefined' && payload instanceof FormData) {
|
41
|
+
requestConfig.body = payload;
|
42
|
+
}
|
43
|
+
else if (payload) {
|
44
|
+
requestConfig.body = JSON.stringify(payload);
|
45
|
+
requestConfig.headers = { ...requestConfig.headers, 'Content-Type': 'application/json' };
|
46
|
+
}
|
47
|
+
return this.fetchOrThrow(formattedUrl, requestConfig, config?.responseType);
|
48
|
+
}
|
49
|
+
catch (e) {
|
50
|
+
const message = errorMessage;
|
51
|
+
this.logger.error(message, e);
|
52
|
+
let httpError = new models_1.RocosError(message);
|
53
|
+
if (e instanceof models_1.HttpError) {
|
54
|
+
httpError = this.getError(e);
|
55
|
+
httpError.statusCode = e?.response?.status;
|
56
|
+
}
|
57
|
+
RocosStore_1.RocosStore.getChangeSubject().next({ type: 'http-error', url: this.config.url, data: httpError });
|
58
|
+
throw httpError;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
async fetchOrThrow(url, config, responseType) {
|
62
|
+
this.logger.debug('Fetching', { url, config });
|
63
|
+
const res = await fetch(url, config);
|
64
|
+
if (!res.ok) {
|
65
|
+
const payload = await res.text();
|
66
|
+
this.logger.warn('Failed HTTP Response', { status: res.statusText, payload, response: res });
|
67
|
+
throw new models_1.HttpError(res, payload);
|
68
|
+
}
|
69
|
+
switch (responseType) {
|
70
|
+
case 'raw':
|
71
|
+
return res;
|
72
|
+
case 'stream':
|
73
|
+
return res.body;
|
74
|
+
case 'blob':
|
75
|
+
return res.blob();
|
76
|
+
case 'text':
|
77
|
+
return res.text();
|
78
|
+
case 'json':
|
79
|
+
default: {
|
80
|
+
const textRes = await res.text();
|
81
|
+
if (!textRes?.trim())
|
82
|
+
return undefined;
|
83
|
+
try {
|
84
|
+
return JSON.parse(textRes);
|
85
|
+
}
|
86
|
+
catch (e) {
|
87
|
+
this.logger.error('Failed to parse JSON from response', { textRes });
|
88
|
+
return textRes;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
exports.BaseServiceAbstract = BaseServiceAbstract;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BaseStreamService = void 0;
|
4
|
+
const models_1 = require("../models");
|
5
|
+
const RocosLogger_1 = require("../logger/RocosLogger");
|
6
|
+
const RocosStore_1 = require("../store/RocosStore");
|
7
|
+
const StreamRegister_1 = require("../api/StreamRegister");
|
8
|
+
const rxjs_1 = require("rxjs");
|
9
|
+
class BaseStreamService {
|
10
|
+
constructor(name, config) {
|
11
|
+
this.status = false;
|
12
|
+
this.status$ = new rxjs_1.Subject();
|
13
|
+
this.config = config;
|
14
|
+
this.logger = RocosLogger_1.RocosLogger.getInstance(`${name}(${this.config.url})`);
|
15
|
+
}
|
16
|
+
getStatus() {
|
17
|
+
return this.status;
|
18
|
+
}
|
19
|
+
async initStream(stream) {
|
20
|
+
if (this.config.insecure)
|
21
|
+
return; // no need to init auth for insecure connections
|
22
|
+
const authService = RocosStore_1.RocosStore.getSDKInstance(this.config).getAuthService();
|
23
|
+
if (!this.config.token || !authService.isTokenValid(new models_1.Token(this.config.token))) {
|
24
|
+
try {
|
25
|
+
const token = await authService.getToken();
|
26
|
+
stream.setToken(token.value);
|
27
|
+
}
|
28
|
+
catch (e) {
|
29
|
+
this.logger.error('Can not retrieve auth token', e);
|
30
|
+
throw new Error('Can not retrieve auth token');
|
31
|
+
}
|
32
|
+
}
|
33
|
+
authService.startTokenRefreshChecker();
|
34
|
+
}
|
35
|
+
async createStreamFromConfig(identifier, config) {
|
36
|
+
const identifierWithScope = StreamRegister_1.StreamRegister.getIdentifier(identifier, config.scope);
|
37
|
+
const streamRegister = StreamRegister_1.StreamRegister.getInstance();
|
38
|
+
let stream = streamRegister.getStream(identifierWithScope);
|
39
|
+
let isNew = false;
|
40
|
+
if (!stream) {
|
41
|
+
isNew = true;
|
42
|
+
stream = this.getStream(config);
|
43
|
+
stream.statusStream$.subscribe((msg) => {
|
44
|
+
this.status = msg === models_1.SubscriberStatusEnum.STOPPED || msg === models_1.SubscriberStatusEnum.ALIVE;
|
45
|
+
this.status$.next(msg);
|
46
|
+
});
|
47
|
+
await streamRegister.addStream(stream);
|
48
|
+
await this.initStream(stream);
|
49
|
+
}
|
50
|
+
return { stream, isNew };
|
51
|
+
}
|
52
|
+
}
|
53
|
+
exports.BaseStreamService = BaseStreamService;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import { ICallerCallParams, ICallerInvokeParams, ICallerParams, ICallerStream, IRocosCallerMessage, IRocosCallerMessageResponseAck, IRocosCallerMessageResponseResult, IRocosCallerMessageResponseReturn, IRocosSDKConfig, IStreamConfig } from '../models';
|
2
|
+
import { Observable } from 'rxjs';
|
3
|
+
import { BaseStreamService } from './BaseStreamService';
|
4
|
+
export declare class CallerService extends BaseStreamService<ICallerStream> {
|
5
|
+
constructor(config: IRocosSDKConfig);
|
6
|
+
invokeRequest(params: ICallerInvokeParams): Observable<IRocosCallerMessage>;
|
7
|
+
cancelRequest(params: ICallerParams): Observable<IRocosCallerMessage>;
|
8
|
+
/** Call a service and return the response(s).
|
9
|
+
*
|
10
|
+
* It will complete once a result message is received with a `COMPLETE_SUCCESS` status,
|
11
|
+
* or throw an error if the status is not `COMPLETE_SUCCESS`.
|
12
|
+
*
|
13
|
+
* This is a high level method that wraps the lower level `invokeRequest` method.
|
14
|
+
*
|
15
|
+
* @see invokeRequest
|
16
|
+
* @see call
|
17
|
+
*/
|
18
|
+
callRaw(params: ICallerCallParams): {
|
19
|
+
return$: Observable<IRocosCallerMessageResponseReturn>;
|
20
|
+
result$: Observable<IRocosCallerMessageResponseResult>;
|
21
|
+
ack$: Observable<IRocosCallerMessageResponseAck>;
|
22
|
+
};
|
23
|
+
/** Call a service and return the response(s) as UTF-8 encoded JSON.
|
24
|
+
*
|
25
|
+
* It will complete once a result message is received with a `COMPLETE_SUCCESS` status,
|
26
|
+
* or throw an error if the status is not `COMPLETE_SUCCESS`.
|
27
|
+
*
|
28
|
+
* This is a high level method that wraps the lower level `invokeRequest` method.
|
29
|
+
*
|
30
|
+
* Equivalent to calling `callRaw` and then parsing the return payload as UTF-8 encoded JSON.
|
31
|
+
*
|
32
|
+
* @see callRaw
|
33
|
+
* @see invokeRequest
|
34
|
+
*/
|
35
|
+
call<T = unknown>(params: ICallerCallParams): {
|
36
|
+
return$: Observable<T>;
|
37
|
+
result$: Observable<IRocosCallerMessageResponseResult>;
|
38
|
+
ack$: Observable<IRocosCallerMessageResponseAck>;
|
39
|
+
};
|
40
|
+
protected createStream(): Promise<ICallerStream>;
|
41
|
+
protected getStream(config: IStreamConfig): ICallerStream;
|
42
|
+
}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CallerService = void 0;
|
4
|
+
const splitRobotTopic_1 = require("../helpers/splitRobotTopic");
|
5
|
+
const models_1 = require("../models");
|
6
|
+
const rxjs_1 = require("rxjs");
|
7
|
+
const operators_1 = require("rxjs/operators");
|
8
|
+
const callerMessageHelpers_1 = require("../helpers/callerMessageHelpers");
|
9
|
+
const BaseStreamService_1 = require("./BaseStreamService");
|
10
|
+
const CallerStream_1 = require("../api/streams/caller/CallerStream");
|
11
|
+
const identifier_1 = require("../constants/identifier");
|
12
|
+
const uuid_1 = require("uuid");
|
13
|
+
class CallerService extends BaseStreamService_1.BaseStreamService {
|
14
|
+
constructor(config) {
|
15
|
+
super('CallerService', config);
|
16
|
+
}
|
17
|
+
invokeRequest(params) {
|
18
|
+
const subject = new rxjs_1.Subject();
|
19
|
+
let subscription;
|
20
|
+
this.createStream()
|
21
|
+
.then((stream) => {
|
22
|
+
subscription = stream.invokeRequest(params).subscribe(subject);
|
23
|
+
})
|
24
|
+
.catch((e) => {
|
25
|
+
this.logger.info('invokeRequest error', e);
|
26
|
+
subject.error(e);
|
27
|
+
});
|
28
|
+
return subject.asObservable().pipe((0, operators_1.finalize)(() => {
|
29
|
+
subscription?.unsubscribe();
|
30
|
+
}));
|
31
|
+
}
|
32
|
+
cancelRequest(params) {
|
33
|
+
const subject = new rxjs_1.Subject();
|
34
|
+
let subscription;
|
35
|
+
this.createStream()
|
36
|
+
.then((stream) => {
|
37
|
+
subscription = stream.cancelRequest(params).subscribe(subject);
|
38
|
+
})
|
39
|
+
.catch((e) => {
|
40
|
+
this.logger.info('invokeRequest error', e);
|
41
|
+
subject.error(e);
|
42
|
+
});
|
43
|
+
return subject.asObservable().pipe((0, operators_1.finalize)(() => {
|
44
|
+
subscription?.unsubscribe();
|
45
|
+
}));
|
46
|
+
}
|
47
|
+
/** Call a service and return the response(s).
|
48
|
+
*
|
49
|
+
* It will complete once a result message is received with a `COMPLETE_SUCCESS` status,
|
50
|
+
* or throw an error if the status is not `COMPLETE_SUCCESS`.
|
51
|
+
*
|
52
|
+
* This is a high level method that wraps the lower level `invokeRequest` method.
|
53
|
+
*
|
54
|
+
* @see invokeRequest
|
55
|
+
* @see call
|
56
|
+
*/
|
57
|
+
callRaw(params) {
|
58
|
+
const { component, topic } = (0, splitRobotTopic_1.splitRobotTopic)(params.source);
|
59
|
+
const payloadString = JSON.stringify(params.payload ?? {});
|
60
|
+
const source$ = this.invokeRequest({
|
61
|
+
uid: params.options?.uid ?? (0, uuid_1.v4)(),
|
62
|
+
projectId: params.projectId,
|
63
|
+
callsign: params.callsign,
|
64
|
+
subSystem: '',
|
65
|
+
component,
|
66
|
+
topic,
|
67
|
+
responseLevelNumber: models_1.RocosResponseLevel.ALL,
|
68
|
+
payload: payloadString,
|
69
|
+
query: params.options?.query,
|
70
|
+
}).pipe((0, rxjs_1.mergeMap)(callerMessageHelpers_1.getResponses), (0, callerMessageHelpers_1.handleChunkedMessages)());
|
71
|
+
const result$ = source$.pipe((0, operators_1.filter)((x) => x.result !== undefined), (0, rxjs_1.map)((x) => x.result), (0, rxjs_1.take)(1));
|
72
|
+
const resultNotifier$ = result$.pipe((0, rxjs_1.map)((x) => {
|
73
|
+
if (x.status !== models_1.ResultStatus.COMPLETE_SUCCESS)
|
74
|
+
throw x;
|
75
|
+
return x;
|
76
|
+
}));
|
77
|
+
const return$ = source$.pipe((0, operators_1.filter)((x) => x.return !== undefined), (0, rxjs_1.map)((x) => x.return), (0, rxjs_1.takeUntil)(resultNotifier$));
|
78
|
+
const ack$ = source$.pipe((0, operators_1.filter)((x) => x.ack !== undefined), (0, rxjs_1.map)((x) => x.ack), (0, rxjs_1.takeUntil)(resultNotifier$));
|
79
|
+
return {
|
80
|
+
return$,
|
81
|
+
result$,
|
82
|
+
ack$,
|
83
|
+
};
|
84
|
+
}
|
85
|
+
/** Call a service and return the response(s) as UTF-8 encoded JSON.
|
86
|
+
*
|
87
|
+
* It will complete once a result message is received with a `COMPLETE_SUCCESS` status,
|
88
|
+
* or throw an error if the status is not `COMPLETE_SUCCESS`.
|
89
|
+
*
|
90
|
+
* This is a high level method that wraps the lower level `invokeRequest` method.
|
91
|
+
*
|
92
|
+
* Equivalent to calling `callRaw` and then parsing the return payload as UTF-8 encoded JSON.
|
93
|
+
*
|
94
|
+
* @see callRaw
|
95
|
+
* @see invokeRequest
|
96
|
+
*/
|
97
|
+
call(params) {
|
98
|
+
const stream = this.callRaw(params);
|
99
|
+
return {
|
100
|
+
...stream,
|
101
|
+
return$: stream.return$.pipe((0, rxjs_1.map)((x) => {
|
102
|
+
const decoded = new TextDecoder().decode(x.payload);
|
103
|
+
return JSON.parse(decoded);
|
104
|
+
})),
|
105
|
+
};
|
106
|
+
}
|
107
|
+
async createStream() {
|
108
|
+
return (await this.createStreamFromConfig(identifier_1.IDENTIFIER_NAME_CALLER, {
|
109
|
+
url: this.config.url,
|
110
|
+
token: this.config.token,
|
111
|
+
scope: 'default',
|
112
|
+
options: this.config.options,
|
113
|
+
port: this.config.port,
|
114
|
+
insecure: this.config.insecure,
|
115
|
+
})).stream;
|
116
|
+
}
|
117
|
+
getStream(config) {
|
118
|
+
return new CallerStream_1.CallerStream(config);
|
119
|
+
}
|
120
|
+
}
|
121
|
+
exports.CallerService = CallerService;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CallerServiceNode = void 0;
|
4
|
+
const CallerService_1 = require("./CallerService");
|
5
|
+
const CallerStreamNode_1 = require("../api/streams/caller/CallerStreamNode");
|
6
|
+
class CallerServiceNode extends CallerService_1.CallerService {
|
7
|
+
getStream(config) {
|
8
|
+
return new CallerStreamNode_1.CallerStreamNode(config);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
exports.CallerServiceNode = CallerServiceNode;
|
@@ -0,0 +1,42 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CommandService = void 0;
|
4
|
+
const rxjs_1 = require("rxjs");
|
5
|
+
const BaseStreamService_1 = require("./BaseStreamService");
|
6
|
+
const CommandStream_1 = require("../api/streams/command/CommandStream");
|
7
|
+
const identifier_1 = require("../constants/identifier");
|
8
|
+
const operators_1 = require("rxjs/operators");
|
9
|
+
class CommandService extends BaseStreamService_1.BaseStreamService {
|
10
|
+
constructor(config) {
|
11
|
+
super('CommandService', config);
|
12
|
+
}
|
13
|
+
invokeRequest(params) {
|
14
|
+
const subject = new rxjs_1.Subject();
|
15
|
+
let subscription;
|
16
|
+
this.createStream()
|
17
|
+
.then((stream) => {
|
18
|
+
subscription = stream.invokeRequest(params).subscribe(subject);
|
19
|
+
})
|
20
|
+
.catch((e) => {
|
21
|
+
this.logger.info('invokeRequest error', e);
|
22
|
+
subject.error(e);
|
23
|
+
});
|
24
|
+
return subject.asObservable().pipe((0, operators_1.finalize)(() => {
|
25
|
+
subscription?.unsubscribe();
|
26
|
+
}));
|
27
|
+
}
|
28
|
+
async createStream() {
|
29
|
+
return (await this.createStreamFromConfig(identifier_1.IDENTIFIER_NAME_COMMAND, {
|
30
|
+
url: this.config.url,
|
31
|
+
token: this.config.token,
|
32
|
+
scope: 'default',
|
33
|
+
options: this.config.options,
|
34
|
+
port: this.config.port,
|
35
|
+
insecure: this.config.insecure,
|
36
|
+
})).stream;
|
37
|
+
}
|
38
|
+
getStream(config) {
|
39
|
+
return new CommandStream_1.CommandStream(config);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
exports.CommandService = CommandService;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.CommandServiceNode = void 0;
|
4
|
+
const CommandService_1 = require("./CommandService");
|
5
|
+
const CommandStreamNode_1 = require("../api/streams/command/CommandStreamNode");
|
6
|
+
class CommandServiceNode extends CommandService_1.CommandService {
|
7
|
+
getStream(config) {
|
8
|
+
return new CommandStreamNode_1.CommandStreamNode(config);
|
9
|
+
}
|
10
|
+
}
|
11
|
+
exports.CommandServiceNode = CommandServiceNode;
|