@dronedeploy/rocos-js-sdk 3.0.1-alpha.19 → 3.0.1-alpha.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. package/cjs/IRocosSDK.d.ts +2 -2
  2. package/cjs/RocosSDK.d.ts +6 -1
  3. package/cjs/RocosSDK.js +10 -0
  4. package/cjs/constants/api.d.ts +1 -0
  5. package/cjs/constants/api.js +2 -1
  6. package/cjs/helpers/websandbox/connection.d.ts +2 -1
  7. package/cjs/helpers/websandbox/connection.js +6 -5
  8. package/cjs/helpers/websandbox/frame/frame.js +4 -1
  9. package/cjs/helpers/websandbox/frame/frame.source.js +1 -1
  10. package/cjs/helpers/websandbox/frame/worker/manager.d.ts +8 -4
  11. package/cjs/helpers/websandbox/frame/worker/manager.js +32 -14
  12. package/cjs/helpers/websandbox/frame/worker/worker.source.js +1 -1
  13. package/cjs/helpers/websandbox/sandbox.d.ts +1 -1
  14. package/cjs/helpers/websandbox/sandbox.js +7 -7
  15. package/cjs/models/RocosError.d.ts +1 -0
  16. package/cjs/models/RocosError.js +1 -0
  17. package/cjs/models/ServiceEnum.d.ts +19 -18
  18. package/cjs/models/ServiceEnum.js +19 -18
  19. package/cjs/models/graph/Position.d.ts +6 -0
  20. package/cjs/models/graph/Position.js +2 -0
  21. package/cjs/models/graph/Quaternion.d.ts +6 -0
  22. package/cjs/models/graph/Quaternion.js +2 -0
  23. package/cjs/models/graph/Vector3.d.ts +5 -0
  24. package/cjs/models/graph/Vector3.js +2 -0
  25. package/cjs/models/graph/index.d.ts +3 -0
  26. package/cjs/models/graph/index.js +19 -0
  27. package/cjs/models/index.d.ts +1 -0
  28. package/cjs/models/index.js +1 -0
  29. package/cjs/models/maps/Panorama.d.ts +1 -17
  30. package/cjs/models/target/Target.d.ts +27 -0
  31. package/cjs/models/target/Target.js +2 -0
  32. package/cjs/node/RocosSDKNode.d.ts +1 -6
  33. package/cjs/node/RocosSDKNode.js +3 -9
  34. package/cjs/services/EvaluatorService.js +1 -1
  35. package/cjs/services/TargetService.d.ts +11 -0
  36. package/cjs/services/TargetService.js +31 -0
  37. package/cjs/services/index.d.ts +9 -8
  38. package/cjs/services/index.js +9 -8
  39. package/esm/IRocosSDK.d.ts +2 -2
  40. package/esm/RocosSDK.d.ts +6 -1
  41. package/esm/RocosSDK.js +11 -1
  42. package/esm/constants/api.d.ts +1 -0
  43. package/esm/constants/api.js +1 -0
  44. package/esm/helpers/websandbox/connection.d.ts +2 -1
  45. package/esm/helpers/websandbox/connection.js +6 -5
  46. package/esm/helpers/websandbox/frame/frame.js +4 -1
  47. package/esm/helpers/websandbox/frame/frame.source.js +1 -1
  48. package/esm/helpers/websandbox/frame/worker/manager.d.ts +8 -4
  49. package/esm/helpers/websandbox/frame/worker/manager.js +32 -14
  50. package/esm/helpers/websandbox/frame/worker/worker.source.js +1 -1
  51. package/esm/helpers/websandbox/sandbox.d.ts +1 -1
  52. package/esm/helpers/websandbox/sandbox.js +7 -7
  53. package/esm/models/RocosError.d.ts +1 -0
  54. package/esm/models/RocosError.js +1 -0
  55. package/esm/models/ServiceEnum.d.ts +19 -18
  56. package/esm/models/ServiceEnum.js +19 -18
  57. package/esm/models/graph/Position.d.ts +6 -0
  58. package/esm/models/graph/Position.js +1 -0
  59. package/esm/models/graph/Quaternion.d.ts +6 -0
  60. package/esm/models/graph/Quaternion.js +1 -0
  61. package/esm/models/graph/Vector3.d.ts +5 -0
  62. package/esm/models/graph/Vector3.js +1 -0
  63. package/esm/models/graph/index.d.ts +3 -0
  64. package/esm/models/graph/index.js +3 -0
  65. package/esm/models/index.d.ts +1 -0
  66. package/esm/models/index.js +1 -0
  67. package/esm/models/maps/Panorama.d.ts +1 -17
  68. package/esm/models/target/Target.d.ts +27 -0
  69. package/esm/models/target/Target.js +1 -0
  70. package/esm/node/RocosSDKNode.d.ts +1 -6
  71. package/esm/node/RocosSDKNode.js +4 -10
  72. package/esm/services/BaseServiceAbstract.js +1 -1
  73. package/esm/services/EvaluatorService.js +1 -1
  74. package/esm/services/TargetService.d.ts +11 -0
  75. package/esm/services/TargetService.js +27 -0
  76. package/esm/services/index.d.ts +9 -8
  77. package/esm/services/index.js +9 -8
  78. package/package.json +1 -1
@@ -0,0 +1,6 @@
1
+ export interface Position {
2
+ pitch: number;
3
+ yaw: number;
4
+ x?: number;
5
+ y?: number;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export interface Quaternion {
2
+ x: number;
3
+ y: number;
4
+ z: number;
5
+ w: number;
6
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export interface Vector3 {
2
+ x: number;
3
+ y: number;
4
+ z: number;
5
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from './Position';
2
+ export * from './Quaternion';
3
+ export * from './Vector3';
@@ -0,0 +1,3 @@
1
+ export * from './Position';
2
+ export * from './Quaternion';
3
+ export * from './Vector3';
@@ -33,6 +33,7 @@ export * from './integrations/Plan';
33
33
  export * from './maps/Map';
34
34
  export * from './maps/Panorama';
35
35
  export * from './projects/ProjectUser';
36
+ export * from './target/Target';
36
37
  export * from './ExportDataQuery';
37
38
  export * from './HttpError';
38
39
  export * from './IBaseService';
@@ -33,6 +33,7 @@ export * from './integrations/Plan';
33
33
  export * from './maps/Map';
34
34
  export * from './maps/Panorama';
35
35
  export * from './projects/ProjectUser';
36
+ export * from './target/Target';
36
37
  export * from './ExportDataQuery';
37
38
  export * from './HttpError';
38
39
  export * from './IBaseService';
@@ -1,20 +1,4 @@
1
- export interface Position {
2
- pitch: number;
3
- yaw: number;
4
- x?: number;
5
- y?: number;
6
- }
7
- export interface Quaternion {
8
- x: number;
9
- y: number;
10
- z: number;
11
- w: number;
12
- }
13
- export interface Vector3 {
14
- x: number;
15
- y: number;
16
- z: number;
17
- }
1
+ import { Position, Quaternion, Vector3 } from '../graph';
18
2
  export interface Observation {
19
3
  panoramaID: string;
20
4
  id?: string;
@@ -0,0 +1,27 @@
1
+ import { Quaternion } from '../graph/Quaternion';
2
+ import { Vector3 } from '../graph/Vector3';
3
+ /**
4
+ * Observation target model (such as an asset, a point of interest, a puddle, etc.)
5
+ */
6
+ export interface Target {
7
+ /**
8
+ * Unique identifier of the target
9
+ */
10
+ id: string;
11
+ /**
12
+ * Name of the target
13
+ */
14
+ name: string;
15
+ /**
16
+ * Metadata associated with the target (key-value pairs) such as name, type, asset-id, etc.
17
+ */
18
+ data: Record<string, string>;
19
+ /**
20
+ * Position of the target in the 3D space
21
+ */
22
+ translation: Vector3;
23
+ /**
24
+ * Rotation of the target in the 3D space
25
+ */
26
+ rotation: Quaternion;
27
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,4 @@
1
- import { DeviceCredentialsService, EvaluatorService, ScheduleService } from '../services';
1
+ import { EvaluatorService } from '../services';
2
2
  import { IBaseService, ServiceEnum } from '../models';
3
3
  import { CallerServiceNode } from '../services/CallerServiceNode';
4
4
  import { CommandServiceNode } from '../services/CommandServiceNode';
@@ -13,10 +13,6 @@ export declare class RocosSDKNode extends RocosSDK {
13
13
  * Gets the telemetry service.
14
14
  */
15
15
  getTelemetryService(): TelemetryServiceNode;
16
- /**
17
- * Gets the scheduler service.
18
- */
19
- getSchedulerService(): ScheduleService;
20
16
  /**
21
17
  * Gets the service call service.
22
18
  */
@@ -48,5 +44,4 @@ export declare class RocosSDKNode extends RocosSDK {
48
44
  * @deprecated Not supported in Node.js
49
45
  */
50
46
  getRTPWebRTCService(): never;
51
- getDeviceCredentialsService(): DeviceCredentialsService;
52
47
  }
@@ -1,4 +1,4 @@
1
- import { AssetStorageService, AuthService, ConfigGroupService, DashboardService, DeviceCredentialsService, EventService, IntegrationService, MapService, ProfileService, ProjectService, RobotService, ScheduleService, SpotProvisioningServiceNode, StreamService, UserService, } from '../services';
1
+ import { AssetStorageService, AuthService, ConfigGroupService, DashboardService, DeviceCredentialsService, EventService, IntegrationService, MapService, ProfileService, ProjectService, RobotService, ScheduleService, SpotProvisioningServiceNode, StreamService, TargetService, UserService, } from '../services';
2
2
  import { ServiceEnum } from '../models';
3
3
  import { CallerServiceNode } from '../services/CallerServiceNode';
4
4
  import { CommandServiceNode } from '../services/CommandServiceNode';
@@ -81,6 +81,9 @@ export class RocosSDKNode extends RocosSDK {
81
81
  case ServiceEnum.DEVICE_CREDENTIALS:
82
82
  this.services[name] = new DeviceCredentialsService(config);
83
83
  break;
84
+ case ServiceEnum.TARGET:
85
+ this.services[name] = new TargetService(config);
86
+ break;
84
87
  }
85
88
  }
86
89
  this.logger.debug(`Found service ${name}.`);
@@ -92,12 +95,6 @@ export class RocosSDKNode extends RocosSDK {
92
95
  getTelemetryService() {
93
96
  return this.getService(ServiceEnum.TELEMETRY);
94
97
  }
95
- /**
96
- * Gets the scheduler service.
97
- */
98
- getSchedulerService() {
99
- return this.getService(ServiceEnum.SCHEDULE);
100
- }
101
98
  /**
102
99
  * Gets the service call service.
103
100
  */
@@ -143,7 +140,4 @@ export class RocosSDKNode extends RocosSDK {
143
140
  getRTPWebRTCService() {
144
141
  throw new Error('WebRTC service is not supported in NodeJS');
145
142
  }
146
- getDeviceCredentialsService() {
147
- return this.getService(ServiceEnum.DEVICE_CREDENTIALS);
148
- }
149
143
  }
@@ -1,4 +1,4 @@
1
- import { RocosError, HttpError } from '../models';
1
+ import { HttpError, RocosError } from '../models';
2
2
  import { getURLSearchParams } from '../helpers';
3
3
  import { RocosStore } from '../store/RocosStore';
4
4
  export class BaseServiceAbstract {
@@ -19,7 +19,7 @@ export class EvaluatorService extends BaseServiceAbstract {
19
19
  }
20
20
  async teardown() {
21
21
  const sandbox = await this.sandbox;
22
- sandbox.destroy();
22
+ sandbox.destroy('evaluator service torn down');
23
23
  }
24
24
  async execute(code, context, options) {
25
25
  const sandbox = await this.sandbox;
@@ -0,0 +1,11 @@
1
+ import { IBaseService, IRocosSDKConfig, RocosError, Target } from '../models';
2
+ import { BaseServiceAbstract } from './BaseServiceAbstract';
3
+ /**
4
+ * Service for managing targets (such as assets, PoI's, or FLOCS) on DroneDeploy
5
+ */
6
+ export declare class TargetService extends BaseServiceAbstract implements IBaseService {
7
+ constructor(config: IRocosSDKConfig);
8
+ getStatus(): boolean;
9
+ protected getError(e: Error): RocosError;
10
+ list(projectId: string, frameID?: string): Promise<Target[]>;
11
+ }
@@ -0,0 +1,27 @@
1
+ import { RocosError, errorCodes } from '../models';
2
+ import { API_TARGETS_URL } from '../constants/api';
3
+ import { BaseServiceAbstract } from './BaseServiceAbstract';
4
+ import { RocosLogger } from '../logger/RocosLogger';
5
+ import { formatServiceUrl } from '../helpers/formatServiceUrl';
6
+ /**
7
+ * Service for managing targets (such as assets, PoI's, or FLOCS) on DroneDeploy
8
+ */
9
+ export class TargetService extends BaseServiceAbstract {
10
+ constructor(config) {
11
+ super(config);
12
+ this.logger = RocosLogger.getInstance(`TargetService(${this.config.url})`);
13
+ }
14
+ getStatus() {
15
+ return true;
16
+ }
17
+ getError(e) {
18
+ return new RocosError(e, errorCodes.TARGET_SERVICE_ERROR);
19
+ }
20
+ async list(projectId, frameID = 'seed') {
21
+ const resp = await this.callGet(formatServiceUrl(API_TARGETS_URL, {
22
+ url: this.config.url,
23
+ projectId,
24
+ }, this.config.insecure), 'Failed to list targets', { frameID });
25
+ return resp;
26
+ }
27
+ }
@@ -6,23 +6,24 @@ export * from './ConfigGroupService';
6
6
  export * from './ControlService';
7
7
  export * from './DashboardService';
8
8
  export * from './DeviceCredentialsService';
9
+ export * from './EvaluatorService';
9
10
  export * from './EventService';
10
11
  export * from './FileAccessorService';
11
12
  export * from './IntegrationService';
13
+ export * from './MapService';
14
+ export * from './PlatformTimeService';
12
15
  export * from './ProfileService';
13
16
  export * from './ProjectService';
17
+ export * from './RTPWebRTCService';
14
18
  export * from './RobotService';
19
+ export * from './ScheduleService';
15
20
  export * from './SearchService';
21
+ export * from './SpotProvisioningService';
22
+ export * from './SpotProvisioningServiceNode';
16
23
  export * from './StreamService';
24
+ export * from './TargetService';
17
25
  export * from './TelemetryService';
26
+ export * from './TimeSyncerService';
18
27
  export * from './UserService';
19
28
  export * from './WebRTCSignallingService';
20
29
  export * from './WorkflowService';
21
- export * from './ScheduleService';
22
- export * from './TimeSyncerService';
23
- export * from './PlatformTimeService';
24
- export * from './SpotProvisioningService';
25
- export * from './SpotProvisioningServiceNode';
26
- export * from './MapService';
27
- export * from './EvaluatorService';
28
- export * from './RTPWebRTCService';
@@ -6,23 +6,24 @@ export * from './ConfigGroupService';
6
6
  export * from './ControlService';
7
7
  export * from './DashboardService';
8
8
  export * from './DeviceCredentialsService';
9
+ export * from './EvaluatorService';
9
10
  export * from './EventService';
10
11
  export * from './FileAccessorService';
11
12
  export * from './IntegrationService';
13
+ export * from './MapService';
14
+ export * from './PlatformTimeService';
12
15
  export * from './ProfileService';
13
16
  export * from './ProjectService';
17
+ export * from './RTPWebRTCService';
14
18
  export * from './RobotService';
19
+ export * from './ScheduleService';
15
20
  export * from './SearchService';
21
+ export * from './SpotProvisioningService';
22
+ export * from './SpotProvisioningServiceNode';
16
23
  export * from './StreamService';
24
+ export * from './TargetService';
17
25
  export * from './TelemetryService';
26
+ export * from './TimeSyncerService';
18
27
  export * from './UserService';
19
28
  export * from './WebRTCSignallingService';
20
29
  export * from './WorkflowService';
21
- export * from './ScheduleService';
22
- export * from './TimeSyncerService';
23
- export * from './PlatformTimeService';
24
- export * from './SpotProvisioningService';
25
- export * from './SpotProvisioningServiceNode';
26
- export * from './MapService';
27
- export * from './EvaluatorService';
28
- export * from './RTPWebRTCService';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.0.1-alpha.19",
3
+ "version": "3.0.1-alpha.20",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",