@dronedeploy/rocos-js-sdk 3.0.1-alpha.5 → 3.0.1-alpha.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/cjs/RocosSDK.d.ts +2 -1
  2. package/cjs/RocosSDK.js +38 -26
  3. package/cjs/api/streams/caller/CallerStream.js +2 -1
  4. package/cjs/api/streams/command/CommandStream.js +2 -1
  5. package/cjs/api/streams/control/ControlStream.js +2 -1
  6. package/cjs/api/streams/fileAccessor/FileAccessorStream.js +2 -1
  7. package/cjs/api/streams/search/SearchStream.js +2 -1
  8. package/cjs/api/streams/telemetry/TelemetryStream.js +2 -1
  9. package/cjs/api/streams/webRTCSignalling/WebRTCSignallingStream.js +2 -1
  10. package/cjs/constants/api.d.ts +1 -0
  11. package/cjs/constants/api.js +2 -1
  12. package/cjs/helpers/getSha256Hex.d.ts +1 -0
  13. package/cjs/helpers/getSha256Hex.js +9 -0
  14. package/cjs/helpers/getSha256Hex.spec.d.ts +1 -0
  15. package/cjs/helpers/getSha256Hex.spec.js +19 -0
  16. package/cjs/helpers/getSha256HexNode.d.ts +1 -0
  17. package/cjs/helpers/getSha256HexNode.js +13 -0
  18. package/cjs/helpers/getSha256HexNode.spec.d.ts +1 -0
  19. package/cjs/helpers/getSha256HexNode.spec.js +10 -0
  20. package/cjs/models/IRocosSDKConfig.d.ts +8 -4
  21. package/cjs/models/workflow/Workflow.d.ts +69 -11
  22. package/cjs/node/RocosSDKNode.d.ts +1 -2
  23. package/cjs/node/RocosSDKNode.js +54 -65
  24. package/cjs/services/AssetStorageService.js +1 -1
  25. package/cjs/services/BaseStreamService.js +2 -0
  26. package/cjs/services/WorkflowService.d.ts +11 -16
  27. package/cjs/services/WorkflowService.js +32 -15
  28. package/cjs/services/WorkflowServiceNode.d.ts +4 -0
  29. package/cjs/services/WorkflowServiceNode.js +12 -0
  30. package/esm/RocosSDK.d.ts +2 -1
  31. package/esm/RocosSDK.js +38 -26
  32. package/esm/api/streams/caller/CallerStream.js +2 -1
  33. package/esm/api/streams/command/CommandStream.js +2 -1
  34. package/esm/api/streams/control/ControlStream.js +2 -1
  35. package/esm/api/streams/fileAccessor/FileAccessorStream.js +2 -1
  36. package/esm/api/streams/search/SearchStream.js +2 -1
  37. package/esm/api/streams/telemetry/TelemetryStream.js +2 -1
  38. package/esm/api/streams/webRTCSignalling/WebRTCSignallingStream.js +2 -1
  39. package/esm/constants/api.d.ts +1 -0
  40. package/esm/constants/api.js +1 -0
  41. package/esm/helpers/getSha256Hex.d.ts +1 -0
  42. package/esm/helpers/getSha256Hex.js +5 -0
  43. package/esm/helpers/getSha256Hex.spec.d.ts +1 -0
  44. package/esm/helpers/getSha256Hex.spec.js +14 -0
  45. package/esm/helpers/getSha256HexNode.d.ts +1 -0
  46. package/esm/helpers/getSha256HexNode.js +6 -0
  47. package/esm/helpers/getSha256HexNode.spec.d.ts +1 -0
  48. package/esm/helpers/getSha256HexNode.spec.js +8 -0
  49. package/esm/models/IRocosSDKConfig.d.ts +8 -4
  50. package/esm/models/workflow/Workflow.d.ts +69 -11
  51. package/esm/node/RocosSDKNode.d.ts +1 -2
  52. package/esm/node/RocosSDKNode.js +26 -37
  53. package/esm/services/AssetStorageService.js +3 -3
  54. package/esm/services/BaseStreamService.js +2 -0
  55. package/esm/services/WorkflowService.d.ts +11 -16
  56. package/esm/services/WorkflowService.js +33 -16
  57. package/esm/services/WorkflowServiceNode.d.ts +4 -0
  58. package/esm/services/WorkflowServiceNode.js +8 -0
  59. package/package.json +1 -1
package/cjs/RocosSDK.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AssetStorageService, AuthService, CallerService, CommandService, ConfigGroupService, ControlService, DashboardService, EvaluatorService, EventService, FileAccessorService, FunctionService, IntegrationService, MapService, ProfileService, ProjectService, RTPWebRTCService, RobotService, ScheduleService, SearchService, SpotProvisioningService, StreamService, TelemetryService, TimeSyncerService, UserService, WebRTCSignallingService, WorkflowService } from './services';
2
- import { IBaseService, IDebugLevel, IRocosSDKConfig, ServiceEnum } from './models';
2
+ import { AuthorisedConfig, IBaseService, IDebugLevel, IRocosSDKConfig, ServiceEnum } from './models';
3
3
  import { IRocosSDK } from './IRocosSDK';
4
4
  import { Logger } from 'loglevel';
5
5
  export declare class RocosSDK implements IRocosSDK {
@@ -145,4 +145,5 @@ export declare class RocosSDK implements IRocosSDK {
145
145
  */
146
146
  enableDebugMode(on: boolean): void;
147
147
  setDebugLevel(level: IDebugLevel): void;
148
+ protected overrideConfig(service: ServiceEnum): AuthorisedConfig;
148
149
  }
package/cjs/RocosSDK.js CHANGED
@@ -27,84 +27,85 @@ class RocosSDK {
27
27
  getService(name) {
28
28
  if (!this.services?.[name]) {
29
29
  this.logger.info(`Service ${name} does not exist, creating it now.`);
30
+ const config = this.overrideConfig(name);
30
31
  switch (name) {
31
32
  case models_1.ServiceEnum.AUTH:
32
- this.services[name] = new services_1.AuthService(this.config);
33
+ this.services[name] = new services_1.AuthService(config);
33
34
  break;
34
35
  case models_1.ServiceEnum.TELEMETRY:
35
- this.services[name] = new services_1.TelemetryService(this.config);
36
+ this.services[name] = new services_1.TelemetryService(config);
36
37
  break;
37
38
  case models_1.ServiceEnum.ROBOT:
38
- this.services[name] = new services_1.RobotService(this.config);
39
+ this.services[name] = new services_1.RobotService(config);
39
40
  break;
40
41
  case models_1.ServiceEnum.EVENT:
41
- this.services[name] = new services_1.EventService(this.config);
42
+ this.services[name] = new services_1.EventService(config);
42
43
  break;
43
44
  case models_1.ServiceEnum.PROJECT:
44
- this.services[name] = new services_1.ProjectService(this.config);
45
+ this.services[name] = new services_1.ProjectService(config);
45
46
  break;
46
47
  case models_1.ServiceEnum.CALLER:
47
- this.services[name] = new services_1.CallerService(this.config);
48
+ this.services[name] = new services_1.CallerService(config);
48
49
  break;
49
50
  case models_1.ServiceEnum.COMMAND:
50
- this.services[name] = new services_1.CommandService(this.config);
51
+ this.services[name] = new services_1.CommandService(config);
51
52
  break;
52
53
  case models_1.ServiceEnum.CONTROL:
53
- this.services[name] = new services_1.ControlService(this.config);
54
+ this.services[name] = new services_1.ControlService(config);
54
55
  break;
55
56
  case models_1.ServiceEnum.SEARCH:
56
- this.services[name] = new services_1.SearchService(this.config);
57
+ this.services[name] = new services_1.SearchService(config);
57
58
  break;
58
59
  case models_1.ServiceEnum.CONFIG_GROUP:
59
- this.services[name] = new services_1.ConfigGroupService(this.config);
60
+ this.services[name] = new services_1.ConfigGroupService(config);
60
61
  break;
61
62
  case models_1.ServiceEnum.DASHBOARD:
62
- this.services[name] = new services_1.DashboardService(this.config);
63
+ this.services[name] = new services_1.DashboardService(config);
63
64
  break;
64
65
  case models_1.ServiceEnum.FUNCTION:
65
- this.services[name] = new services_1.FunctionService(this.config);
66
+ this.services[name] = new services_1.FunctionService(config);
66
67
  break;
67
68
  case models_1.ServiceEnum.STREAM:
68
- this.services[name] = new services_1.StreamService(this.config);
69
+ this.services[name] = new services_1.StreamService(config);
69
70
  break;
70
71
  case models_1.ServiceEnum.USER:
71
- this.services[name] = new services_1.UserService(this.config);
72
+ this.services[name] = new services_1.UserService(config);
72
73
  break;
73
74
  case models_1.ServiceEnum.TIME_SYNCER:
74
- this.services[name] = new services_1.TimeSyncerService(this.config);
75
+ this.services[name] = new services_1.TimeSyncerService(config);
75
76
  break;
76
77
  case models_1.ServiceEnum.WORKFLOW:
77
- this.services[name] = new services_1.WorkflowService(this.config);
78
+ this.services[name] = new services_1.WorkflowService(config);
78
79
  break;
79
80
  case models_1.ServiceEnum.ASSET_STORAGE:
80
- this.services[name] = new services_1.AssetStorageService(this.config);
81
+ this.services[name] = new services_1.AssetStorageService(config);
81
82
  break;
82
83
  case models_1.ServiceEnum.PROFILE:
83
- this.services[name] = new services_1.ProfileService(this.config);
84
+ this.services[name] = new services_1.ProfileService(config);
84
85
  break;
85
86
  case models_1.ServiceEnum.RTP_WEBRTC:
86
- this.services[name] = new services_1.RTPWebRTCService(this.config);
87
+ this.services[name] = new services_1.RTPWebRTCService(config);
87
88
  break;
88
89
  case models_1.ServiceEnum.WEBRTC_SIGNALLING:
89
- this.services[name] = new services_1.WebRTCSignallingService(this.config);
90
+ this.services[name] = new services_1.WebRTCSignallingService(config);
90
91
  break;
91
92
  case models_1.ServiceEnum.FILE_ACCESSOR:
92
- this.services[name] = new services_1.FileAccessorService(this.config);
93
+ this.services[name] = new services_1.FileAccessorService(config);
93
94
  break;
94
95
  case models_1.ServiceEnum.SCHEDULE:
95
- this.services[name] = new services_1.ScheduleService(this.config);
96
+ this.services[name] = new services_1.ScheduleService(config);
96
97
  break;
97
98
  case models_1.ServiceEnum.SPOT_PROVISIONER:
98
- this.services[name] = new services_1.SpotProvisioningService(this.config);
99
+ this.services[name] = new services_1.SpotProvisioningService(config);
99
100
  break;
100
101
  case models_1.ServiceEnum.INTEGRATION:
101
- this.services[name] = new services_1.IntegrationService(this.config);
102
+ this.services[name] = new services_1.IntegrationService(config);
102
103
  break;
103
104
  case models_1.ServiceEnum.MAP:
104
- this.services[name] = new services_1.MapService(this.config);
105
+ this.services[name] = new services_1.MapService(config);
105
106
  break;
106
107
  case models_1.ServiceEnum.EVALUATOR:
107
- this.services[name] = new services_1.EvaluatorService(this.config);
108
+ this.services[name] = new services_1.EvaluatorService(config);
108
109
  break;
109
110
  }
110
111
  }
@@ -312,5 +313,16 @@ class RocosSDK {
312
313
  setDebugLevel(level) {
313
314
  RocosLogger_1.RocosLogger.setLevel(level);
314
315
  }
316
+ overrideConfig(service) {
317
+ const override = this.config.overrides?.[service];
318
+ if (!override)
319
+ return this.config;
320
+ // strip out the overrides from the config
321
+ const { overrides: _, ...config } = this.config;
322
+ return {
323
+ ...config,
324
+ ...this.config.overrides?.[service],
325
+ };
326
+ }
315
327
  }
316
328
  exports.RocosSDK = RocosSDK;
@@ -13,8 +13,9 @@ class CallerStream extends CallerStreamAbstract_1.CallerStreamAbstract {
13
13
  super(config);
14
14
  this.logger = RocosLogger_1.RocosLogger.getInstance(`CallerStream(${this.identifier})`);
15
15
  const protocol = config.insecure ? 'http' : 'https';
16
+ const port = config.port ? `:${config.port}` : '';
16
17
  const transport = new grpcweb_transport_1.GrpcWebFetchTransport({
17
- baseUrl: `${protocol}://${this.url}`,
18
+ baseUrl: `${protocol}://${this.url}${port}`,
18
19
  });
19
20
  this.client = new serviette_v1_pb_client_1.WebServiceCallerClient(transport);
20
21
  }
@@ -12,8 +12,9 @@ class CommandStream extends CommandStreamAbstract_1.CommandStreamAbstract {
12
12
  super(config);
13
13
  this.logger = RocosLogger_1.RocosLogger.getInstance(`CommandStream(${this.identifier})`);
14
14
  const protocol = config.insecure ? 'http' : 'https';
15
+ const port = config.port ? `:${config.port}` : '';
15
16
  const transport = new grpcweb_transport_1.GrpcWebFetchTransport({
16
- baseUrl: `${protocol}://${this.url}`,
17
+ baseUrl: `${protocol}://${this.url}${port}`,
17
18
  });
18
19
  this.client = new rambo_v1_pb_client_1.CommandClient(transport);
19
20
  }
@@ -13,8 +13,9 @@ class ControlStream extends ControlStreamAbstract_1.ControlStreamAbstract {
13
13
  super(config);
14
14
  this.logger = RocosLogger_1.RocosLogger.getInstance(`ControlStream(${this.identifier})`);
15
15
  const protocol = config.insecure ? 'http' : 'https';
16
+ const port = config.port ? `:${config.port}` : '';
16
17
  const transport = new grpcweb_transport_1.GrpcWebFetchTransport({
17
- baseUrl: `${protocol}://${this.url}`,
18
+ baseUrl: `${protocol}://${this.url}${port}`,
18
19
  });
19
20
  this.client = new conker_pb_client_1.RobotControlClient(transport);
20
21
  }
@@ -12,8 +12,9 @@ class FileAccessorStream extends FileAccessorStreamAbstract_1.FileAccessorStream
12
12
  super(config);
13
13
  this.logger = RocosLogger_1.RocosLogger.getInstance(`FileAccessorStream(${this.identifier})`);
14
14
  const protocol = config.insecure ? 'http' : 'https';
15
+ const port = config.port ? `:${config.port}` : '';
15
16
  const transport = new grpcweb_transport_1.GrpcWebFetchTransport({
16
- baseUrl: `${protocol}://${this.url}`,
17
+ baseUrl: `${protocol}://${this.url}${port}`,
17
18
  });
18
19
  this.client = new filagree_pb_client_1.FilagreeClient(transport);
19
20
  }
@@ -13,8 +13,9 @@ class SearchStream extends SearchStreamAbstract_1.SearchStreamAbstract {
13
13
  super(config);
14
14
  this.logger = RocosLogger_1.RocosLogger.getInstance(`SearchStream(${this.identifier})`);
15
15
  const protocol = config.insecure ? 'http' : 'https';
16
+ const port = config.port ? `:${config.port}` : '';
16
17
  const transport = new grpcweb_transport_1.GrpcWebFetchTransport({
17
- baseUrl: `${protocol}://${this.url}`,
18
+ baseUrl: `${protocol}://${this.url}${port}`,
18
19
  });
19
20
  this.client = new slowlane_pb_client_1.streamClient(transport);
20
21
  }
@@ -12,8 +12,9 @@ class TelemetryStream extends TelemetryStreamAbstract_1.TelemetryStreamAbstract
12
12
  super(config);
13
13
  this.logger = RocosLogger_1.RocosLogger.getInstance(`TelemetryStreamWeb(${this.identifier})`);
14
14
  const protocol = config.insecure ? 'http' : 'https';
15
+ const port = config.port ? `:${config.port}` : '';
15
16
  const transport = new grpcweb_transport_1.GrpcWebFetchTransport({
16
- baseUrl: `${protocol}://${this.url}`,
17
+ baseUrl: `${protocol}://${this.url}${port}`,
17
18
  });
18
19
  this.client = new teletubby_pb_client_1.TelemetryGatewayClient(transport);
19
20
  }
@@ -13,8 +13,9 @@ class WebRTCSignallingStream extends WebRTCSignallingStreamAbstract_1.WebRTCSign
13
13
  super(config);
14
14
  this.logger = RocosLogger_1.RocosLogger.getInstance(`WebRTCSignallingStream(${this.identifier})`);
15
15
  const protocol = config.insecure ? 'http' : 'https';
16
+ const port = config.port ? `:${config.port}` : '';
16
17
  const transport = new grpcweb_transport_1.GrpcWebFetchTransport({
17
- baseUrl: `${protocol}://${this.url}`,
18
+ baseUrl: `${protocol}://${this.url}${port}`,
18
19
  });
19
20
  this.webRTCOperatorclient = new pigeon_pb_client_1.operatorClient(transport);
20
21
  }
@@ -130,4 +130,5 @@ export declare const API_OBSERVATIONS_URL = "https://{url}/projects/{projectId}/
130
130
  export declare const API_OBSERVATION_KEYS_URL = "https://{url}/projects/{projectId}/observations/keys";
131
131
  export declare const API_PROJECT_WORKFLOW_URL = "https://{url}/projects/{projectId}/automate/flows";
132
132
  export declare const API_PROJECT_WORKFLOW_ID_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}";
133
+ export declare const API_PROJECT_WORKFLOW_ASSET_URL = "https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets";
133
134
  export declare const API_PROJECT_DEPLOYED_WORKFLOW_URL = "https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments";
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.API_PROJECT_ROBOT_REGISTER_URL = exports.API_PROJECT_ROBOT_DEFINITION_URL = exports.API_PROJECT_ROBOT_ATTRIBUTES_URL = exports.API_PROJECT_ROBOT_ID_URL = exports.API_PROJECT_ROBOT_URL = exports.API_PROJECT_MAPPED_ASSETS_PATH_URL = exports.API_PROJECT_MISSION_ASSET_PATH_URL = exports.API_PROJECT_MISSION_ASSETS_PATH_URL = exports.API_PROJECT_FLOW_ASSET_PATH_URL = exports.API_PROJECT_ROBOT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATIONS_PATH_URL = exports.API_PROJECT_ASSET_INTEGRATION_PROVIDERS_PATH_URL = exports.API_PROJECT_ASSET_PROFILES_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_ROBOTS_SYNC_DEFINITION_PATH_URL = exports.API_PROJECT_ASSET_PATH_URL = exports.API_PROJECT_ASSET_URL = exports.API_PROJECT_USERS_URL = exports.API_PROJECT_ID_URL = exports.API_PROJECT_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_ID_URL = exports.API_ACCOUNT_PROJECT_APPLICATION_URL = exports.API_ACCOUNT_PROJECT_USER_ID_URL = exports.API_ACCOUNT_PROJECT_USER_URL = exports.API_ACCOUNT_PROJECT_ID_URL = exports.API_ACCOUNT_PROJECT_URL = exports.API_SERVER_TIME_URL = exports.API_ACCOUNT_INTEGRATION_TYPE_URL = exports.API_ACCOUNT_INTEGRATION_URL = exports.API_ACCOUNT_SETTINGS_URL = exports.API_AUTH_USER_ACCOUNT_USER_ID_URL = exports.API_AUTH_USER_ACCOUNT_USER_URL = exports.API_ACCOUNT_ACTIVATE_URL = exports.API_ACCOUNT_ID_URL = exports.API_ACCOUNT_URL = exports.API_USER_PAT_TOKEN_URL = exports.API_USER_PAT_URL = exports.API_USER_VERIFY_EMAIL_URL = exports.API_USER_INVITATION_CHECK_URL = exports.API_USER_INVITATION_ACCEPT_URL = exports.API_USER_INVITATION_URL = exports.API_USER_PASSWORD_FORGOT_URL = exports.API_USER_PASSWORD_RESET_URL = exports.API_OTP_AUTH_URL = exports.API_OTP_URL = exports.API_USER_TOKEN_URL = exports.API_USER_AUTH_URL = exports.API_USER_URL = exports.API_ADMIN_USER_INVITATION_URL = exports.API_APPLICATION_AUTH_URL = void 0;
4
4
  exports.API_PROJECT_STREAM_CALLSIGN_URL = exports.API_PROJECT_STREAM_DATA_URL = exports.API_PROJECT_STREAM_ID_URL = exports.API_PROJECT_STREAM_URL = exports.API_PROJECT_EXPORT_URL = exports.API_PROJECT_FUNCTION_POD_URL = exports.API_PROJECT_FUNCTION_RUN_URL = exports.API_PROJECT_FUNCTION_ID_URL = exports.API_PROJECT_FUNCTION_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_OVERRIDE_URL = exports.API_PROJECT_GROUP_TYPE_OWNER_ID_URL = exports.API_PROJECT_GROUP_TYPE_VERSION_URL = exports.API_PROJECT_GROUP_TYPE_CONFIG_URL = exports.API_PROJECT_GROUP_TYPE_PUBLISH_URL = exports.API_PROJECT_GROUP_TYPE_ID_URL = exports.API_PROJECT_GROUP_TYPE_URL = exports.API_PROJECT_DEFINITION_GAMEPAD_URL = exports.API_PROJECT_DEFINITION_TRIGGER_URL = exports.API_PROJECT_DEFINITION_BUTTON_URL = exports.API_PROJECT_DEFINITION_ACTION_URL = exports.API_PROJECT_DEFINITION_EVENT_URL = exports.API_PROJECT_DEFINITION_COMMAND2_URL = exports.API_PROJECT_DEFINITION_COMMAND_URL = exports.API_PROJECT_DEFINITION_AGENT_URL = exports.API_PROJECT_DEFINITION_SETTING_URL = exports.API_PROJECT_DEFINITION_BLOB_URL = exports.API_PROJECT_DEFINITION_DASHBOARD_URL = exports.API_PROJECT_DEFINITION_COPY_URL = exports.API_PROJECT_DEFINITION_STREAM_URL = exports.API_PROJECT_DEFINITION_ID_URL = exports.API_PROJECT_DEFINITION_URL = exports.API_PROJECT_VROBOT_DEPLOY_URL = exports.API_PROJECT_VROBOT_DETAILS_URL = exports.API_PROJECT_COLLECTION_DOCS_URL = exports.API_PROJECT_COLLECTION_ID_URL = exports.API_PROJECT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_DASHBOARD_WIDGET_URL = exports.API_PROJECT_DASHBOARD_ID_URL = exports.API_PROJECT_DASHBOARD_URL = exports.API_PROJECT_OPERATION_ID_URL = exports.API_PROJECT_OPERATION_URL = exports.API_PROJECT_ROBOT_GAMEPAD_URL = exports.API_PROJECT_ROBOT_TRIGGER_URL = exports.API_PROJECT_ROBOT_BUTTON_URL = exports.API_PROJECT_ROBOT_COMMAND2_URL = exports.API_PROJECT_ROBOT_COMMAND_URL = exports.API_PROJECT_ROBOT_AGENT_URL = exports.API_PROJECT_ROBOT_SETTING_URL = exports.API_PROJECT_ROBOT_EVENT_HISTORY_URL = exports.API_PROJECT_ROBOT_EVENT_URL = void 0;
5
- exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_OBSERVATION_KEYS_URL = exports.API_OBSERVATIONS_URL = exports.API_MAPS_PANORAMA_OBSERVATIONS_URL = exports.API_MAPS_GEOJSON_URL = exports.API_MAPS_DEPLOY_URL = exports.API_MAPS_COPY_URL = exports.API_MAP_ID_URL = exports.API_MAPS_MERGE_URL = exports.API_MAPS_DEPLOYED_URL = exports.API_MAPS_URL = exports.API_DD_INTEGRATION_ISSUES_URL = exports.API_DD_INTEGRATION_OVERLAYS_URL = exports.API_DD_INTEGRATION_PLAN_BY_ID_URL = exports.API_DD_INTEGRATION_PLANS_URL = exports.API_SPOTTY_URL = exports.API_PROJECT_SCHEDULES_URL = exports.API_SOURCE_ID_URL = exports.API_SOURCE_URL = exports.API_SOURCE_SCHEMA_URL = exports.API_TEMPLATE_EXPORTER_URL = exports.API_TEMPLATE_PROVISION_ID_URL = exports.API_TEMPLATE_PROVISION_URL = exports.API_TEMPLATE_DEPLOY_URL = exports.API_PROJECT_PROFILE_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_PROFILE_DASHBOARD_ID_URL = exports.API_PROJECT_PROFILE_DASHBOARD_URL = exports.API_PROJECT_CALLSIGN_STREAM_URL = exports.API_PROJECT_ROBOT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_ROBOT_DASHBOARD_ID_URL = exports.API_PROJECT_ROBOT_DASHBOARD_URL = void 0;
5
+ exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = exports.API_PROJECT_WORKFLOW_ASSET_URL = exports.API_PROJECT_WORKFLOW_ID_URL = exports.API_PROJECT_WORKFLOW_URL = exports.API_OBSERVATION_KEYS_URL = exports.API_OBSERVATIONS_URL = exports.API_MAPS_PANORAMA_OBSERVATIONS_URL = exports.API_MAPS_GEOJSON_URL = exports.API_MAPS_DEPLOY_URL = exports.API_MAPS_COPY_URL = exports.API_MAP_ID_URL = exports.API_MAPS_MERGE_URL = exports.API_MAPS_DEPLOYED_URL = exports.API_MAPS_URL = exports.API_DD_INTEGRATION_ISSUES_URL = exports.API_DD_INTEGRATION_OVERLAYS_URL = exports.API_DD_INTEGRATION_PLAN_BY_ID_URL = exports.API_DD_INTEGRATION_PLANS_URL = exports.API_SPOTTY_URL = exports.API_PROJECT_SCHEDULES_URL = exports.API_SOURCE_ID_URL = exports.API_SOURCE_URL = exports.API_SOURCE_SCHEMA_URL = exports.API_TEMPLATE_EXPORTER_URL = exports.API_TEMPLATE_PROVISION_ID_URL = exports.API_TEMPLATE_PROVISION_URL = exports.API_TEMPLATE_DEPLOY_URL = exports.API_PROJECT_PROFILE_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_PROFILE_DASHBOARD_ID_URL = exports.API_PROJECT_PROFILE_DASHBOARD_URL = exports.API_PROJECT_CALLSIGN_STREAM_URL = exports.API_PROJECT_ROBOT_DASHBOARD_CUSTOM_WIDGET_URL = exports.API_PROJECT_ROBOT_DASHBOARD_ID_URL = exports.API_PROJECT_ROBOT_DASHBOARD_URL = void 0;
6
6
  exports.API_APPLICATION_AUTH_URL = 'https://{url}/applications/auth';
7
7
  exports.API_ADMIN_USER_INVITATION_URL = 'https://{url}/admin/users/invitations';
8
8
  exports.API_USER_URL = 'https://{url}/users';
@@ -135,4 +135,5 @@ exports.API_OBSERVATIONS_URL = 'https://{url}/projects/{projectId}/observations'
135
135
  exports.API_OBSERVATION_KEYS_URL = 'https://{url}/projects/{projectId}/observations/keys';
136
136
  exports.API_PROJECT_WORKFLOW_URL = 'https://{url}/projects/{projectId}/automate/flows';
137
137
  exports.API_PROJECT_WORKFLOW_ID_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}';
138
+ exports.API_PROJECT_WORKFLOW_ASSET_URL = 'https://{url}/projects/{projectId}/automate/flows/{workflowId}/assets';
138
139
  exports.API_PROJECT_DEPLOYED_WORKFLOW_URL = 'https://{url}/projects/{projectId}/robots/{callsign}/automate/flows/deployments';
@@ -0,0 +1 @@
1
+ export declare const getSha256Hex: (arrayBuffer: ArrayBuffer) => Promise<string>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSha256Hex = void 0;
4
+ const getSha256Hex = async (arrayBuffer) => {
5
+ const hashBuffer = await crypto.subtle.digest('SHA-256', arrayBuffer);
6
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
7
+ return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
8
+ };
9
+ exports.getSha256Hex = getSha256Hex;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const crypto_1 = __importDefault(require("crypto"));
7
+ const getSha256Hex_1 = require("./getSha256Hex");
8
+ Object.defineProperty(globalThis, 'crypto', {
9
+ value: {
10
+ subtle: crypto_1.default.webcrypto.subtle,
11
+ },
12
+ });
13
+ describe('getSha256Hex', () => {
14
+ it('should return the correct SHA-256 hash', async () => {
15
+ const buffer = new TextEncoder().encode('Hello, World!');
16
+ const hash = await (0, getSha256Hex_1.getSha256Hex)(buffer);
17
+ expect(hash).toBe('dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f');
18
+ });
19
+ });
@@ -0,0 +1 @@
1
+ export declare const getSha256HexNode: (arrayBuffer: ArrayBuffer) => Promise<string>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getSha256HexNode = void 0;
7
+ const crypto_1 = __importDefault(require("crypto"));
8
+ const getSha256HexNode = async (arrayBuffer) => {
9
+ const hashBuffer = await crypto_1.default.subtle.digest('SHA-256', arrayBuffer);
10
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
11
+ return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
12
+ };
13
+ exports.getSha256HexNode = getSha256HexNode;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const getSha256HexNode_1 = require("./getSha256HexNode");
4
+ describe('getSha256HexNode', () => {
5
+ it('should return the correct SHA-256 hash', async () => {
6
+ const buffer = new TextEncoder().encode('Hello, World!');
7
+ const hash = await (0, getSha256HexNode_1.getSha256HexNode)(buffer);
8
+ expect(hash).toBe('dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f');
9
+ });
10
+ });
@@ -1,6 +1,9 @@
1
1
  import { IStreamOptions } from './IStreamOptions';
2
- export type IRocosSDKConfig = IRocosSDKConfigApp | IRocosSDKConfigToken;
3
- interface IRocosSDKConfigBase {
2
+ import { ServiceEnum } from './ServiceEnum';
3
+ export type IRocosSDKConfig = AuthorisedConfig & {
4
+ overrides?: Partial<Record<ServiceEnum, Partial<AuthorisedConfig>>>;
5
+ };
6
+ interface ConfigBase {
4
7
  url: string;
5
8
  token?: string;
6
9
  refreshToken?: string;
@@ -8,12 +11,13 @@ interface IRocosSDKConfigBase {
8
11
  port?: number;
9
12
  insecure?: boolean;
10
13
  }
11
- export interface IRocosSDKConfigApp extends IRocosSDKConfigBase {
14
+ export interface IRocosSDKConfigApp extends ConfigBase {
12
15
  appId: string;
13
16
  appKey: string;
14
17
  }
15
- export interface IRocosSDKConfigToken extends IRocosSDKConfigBase {
18
+ export interface IRocosSDKConfigToken extends ConfigBase {
16
19
  token: string;
17
20
  refreshToken?: string;
18
21
  }
22
+ export type AuthorisedConfig = IRocosSDKConfigApp | IRocosSDKConfigToken;
19
23
  export {};
@@ -1,12 +1,12 @@
1
- export type ResourceType = 'Manifest' | 'AgentGraph' | 'Javascript' | 'NodeDefinition';
1
+ export type ResourceType = 'Manifest' | 'AgentGraph' | 'Javascript' | 'NodeDefinition' | 'Other';
2
2
  export interface Resource {
3
3
  type: ResourceType;
4
4
  data: string;
5
- contentLink: string;
6
5
  hash: string;
7
6
  link: string;
8
- path: string;
9
- size: number;
7
+ contentLink?: string;
8
+ size?: number;
9
+ path?: string;
10
10
  }
11
11
  export interface Resources {
12
12
  [key: string]: Resource;
@@ -16,21 +16,79 @@ export interface Author {
16
16
  name: string;
17
17
  email: string;
18
18
  }
19
+ interface ResponseBase {
20
+ id: string;
21
+ createdBy: string;
22
+ updatedBy: string;
23
+ dateCreated: number;
24
+ dateUpdated: number;
25
+ }
19
26
  export interface WorkflowBase {
20
27
  flowId: string;
21
28
  name: string;
22
- description: string;
29
+ description?: string;
23
30
  resources?: Resources;
24
31
  type?: string;
25
32
  }
26
- export interface Workflow extends WorkflowBase {
27
- id: string;
33
+ export interface Workflow extends WorkflowBase, ResponseBase {
28
34
  projectId: string;
29
- createdBy: string;
30
- updatedBy: string;
31
35
  author: Author;
32
- dateCreated: number;
33
- dateUpdated: number;
34
36
  latestVersion: string;
35
37
  type: string;
36
38
  }
39
+ export interface DeployedFlow {
40
+ flowId: string;
41
+ flow?: Workflow;
42
+ deployed?: boolean;
43
+ }
44
+ export interface WorkflowList extends Omit<WorkflowBase, 'resources'>, ResponseBase {
45
+ type?: 'cloud';
46
+ author: {
47
+ id: string;
48
+ name: string;
49
+ email: string;
50
+ } | Record<string, never>;
51
+ }
52
+ export interface WorkflowRevision {
53
+ id: string;
54
+ version: number;
55
+ authorName: string;
56
+ createdBy: string;
57
+ dateCreated: number;
58
+ description: string;
59
+ selected?: boolean;
60
+ }
61
+ export interface ManifestResource {
62
+ path: string;
63
+ provider: string;
64
+ runtime: string;
65
+ options: string[];
66
+ }
67
+ export interface ManifestArgument {
68
+ default?: string;
69
+ description?: string;
70
+ type: string;
71
+ }
72
+ export interface Manifest {
73
+ main: [string, string];
74
+ signals?: {
75
+ main: {
76
+ args: string[];
77
+ entry: [string, string];
78
+ };
79
+ };
80
+ arguments?: unknown | Record<string, ManifestArgument>;
81
+ resources: ManifestResource[];
82
+ mode?: 'cloud';
83
+ }
84
+ export interface CreateAssetResponse {
85
+ id: string;
86
+ name: string;
87
+ path: string;
88
+ dateCreated: number;
89
+ hash: string;
90
+ postContentLink: string;
91
+ type: 'file';
92
+ workflow: string;
93
+ }
94
+ export {};
@@ -1,12 +1,11 @@
1
1
  import { EvaluatorService, ScheduleService } from '../services';
2
+ import { IBaseService, ServiceEnum } from '../models';
2
3
  import { CallerServiceNode } from '../services/CallerServiceNode';
3
4
  import { CommandServiceNode } from '../services/CommandServiceNode';
4
5
  import { ControlServiceNode } from '../services/ControlServiceNode';
5
6
  import { FileAccessorServiceNode } from '../services/FileAccessorServiceNode';
6
- import { IBaseService } from '../models/IBaseService';
7
7
  import { RocosSDK } from '../RocosSDK';
8
8
  import { SearchServiceNode } from '../services/SearchServiceNode';
9
- import { ServiceEnum } from '../models/ServiceEnum';
10
9
  import { TelemetryServiceNode } from '../services/TelemetryServiceNode';
11
10
  export declare class RocosSDKNode extends RocosSDK {
12
11
  getService<T extends IBaseService>(name: ServiceEnum): T;