@dronedeploy/rocos-js-sdk 3.0.1-alpha.23 → 3.0.1-alpha.25

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,7 +5,10 @@ const cleanObject = (object) => {
5
5
  return {
6
6
  ...(function _flatten(o) {
7
7
  return [...Object.entries(o)].reduce((obj, [key, val]) => {
8
- if (typeof val === 'object') {
8
+ if (val === null) {
9
+ obj[key] = val;
10
+ }
11
+ else if (typeof val === 'object') {
9
12
  obj[key] = _flatten(val);
10
13
  }
11
14
  else if (typeof val === 'function') {
@@ -82,9 +82,9 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
82
82
  * Get mapped asset
83
83
  *
84
84
  * @param projectId
85
- * @param id
85
+ * @param assetId
86
86
  */
87
- getMappedAsset(projectId: string, id: string): Promise<AssetItemWithObservationsModel>;
87
+ getMappedAsset(projectId: string, assetId: string): Promise<AssetItemWithObservationsModel>;
88
88
  /**
89
89
  * Set Robot Sync Definitions
90
90
  * @param projectId
@@ -140,10 +140,10 @@ class AssetStorageService extends BaseServiceAbstract_1.BaseServiceAbstract {
140
140
  * Get mapped asset
141
141
  *
142
142
  * @param projectId
143
- * @param id
143
+ * @param assetId
144
144
  */
145
- async getMappedAsset(projectId, id) {
146
- return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId, id }, this.config.insecure), `Failed to get mapped asset for ${projectId} and id: ${id}.`);
145
+ async getMappedAsset(projectId, assetId) {
146
+ return this.callGet((0, formatServiceUrl_1.formatServiceUrl)(api_1.API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId, assetId }, this.config.insecure), `Failed to get mapped asset for ${projectId} and id: ${assetId}.`);
147
147
  }
148
148
  /**
149
149
  * Set Robot Sync Definitions
@@ -2,7 +2,10 @@ export const cleanObject = (object) => {
2
2
  return {
3
3
  ...(function _flatten(o) {
4
4
  return [...Object.entries(o)].reduce((obj, [key, val]) => {
5
- if (typeof val === 'object') {
5
+ if (val === null) {
6
+ obj[key] = val;
7
+ }
8
+ else if (typeof val === 'object') {
6
9
  obj[key] = _flatten(val);
7
10
  }
8
11
  else if (typeof val === 'function') {
@@ -82,9 +82,9 @@ export declare class AssetStorageService extends BaseServiceAbstract implements
82
82
  * Get mapped asset
83
83
  *
84
84
  * @param projectId
85
- * @param id
85
+ * @param assetId
86
86
  */
87
- getMappedAsset(projectId: string, id: string): Promise<AssetItemWithObservationsModel>;
87
+ getMappedAsset(projectId: string, assetId: string): Promise<AssetItemWithObservationsModel>;
88
88
  /**
89
89
  * Set Robot Sync Definitions
90
90
  * @param projectId
@@ -137,10 +137,10 @@ export class AssetStorageService extends BaseServiceAbstract {
137
137
  * Get mapped asset
138
138
  *
139
139
  * @param projectId
140
- * @param id
140
+ * @param assetId
141
141
  */
142
- async getMappedAsset(projectId, id) {
143
- return this.callGet(formatServiceUrl(API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId, id }, this.config.insecure), `Failed to get mapped asset for ${projectId} and id: ${id}.`);
142
+ async getMappedAsset(projectId, assetId) {
143
+ return this.callGet(formatServiceUrl(API_PROJECT_MAPPED_ASSET_PATH_URL, { url: this.config.url, projectId, assetId }, this.config.insecure), `Failed to get mapped asset for ${projectId} and id: ${assetId}.`);
144
144
  }
145
145
  /**
146
146
  * Set Robot Sync Definitions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dronedeploy/rocos-js-sdk",
3
- "version": "3.0.1-alpha.23",
3
+ "version": "3.0.1-alpha.25",
4
4
  "description": "Javascript SDK for rocos",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",