@veritree/services 2.24.1 → 2.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -35,6 +35,7 @@ import { ssoToken } from './src/endpoints/sso-token';
35
35
  import { PlantingSites } from './src/endpoints/planting-sites';
36
36
  import { Organizations } from './src/endpoints/organizations';
37
37
  import { Tasks } from './src/endpoints/tasks';
38
+ import { Geometries } from './src/endpoints/geometries';
38
39
 
39
40
  export {
40
41
  BulkUploads,
@@ -73,5 +74,6 @@ export {
73
74
  ssoToken,
74
75
  PlantingSites,
75
76
  Organizations,
76
- Tasks
77
+ Tasks,
78
+ Geometries
77
79
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.24.1",
3
+ "version": "2.25.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -0,0 +1,5 @@
1
+ import Api from "../helpers/api";
2
+
3
+ const resource = "geometries";
4
+
5
+ export const Geometries = new Api(resource);
@@ -28,8 +28,14 @@ class PlantingSitesApi extends Api {
28
28
  return await this.post(url, data);
29
29
  };
30
30
 
31
+ const remove = async (imageId, params) => {
32
+ url = `${this.getUrl()}/${subsiteId}/media/images/${imageId}${this.getUrlParams(params)}`
33
+ return await this.post(url, null, "delete");
34
+ };
35
+
31
36
  return {
32
- attach
37
+ attach,
38
+ delete: remove,
33
39
  }
34
40
  }
35
41
 
@@ -42,8 +48,14 @@ class PlantingSitesApi extends Api {
42
48
  return await this.post(url, data);
43
49
  };
44
50
 
51
+ const remove = async (attachmentId, params) => {
52
+ url = `${this.getUrl()}/${subsiteId}/media/attachments/${attachmentId}${this.getUrlParams(params)}`
53
+ return await this.post(url, null, "delete");
54
+ };
55
+
45
56
  return {
46
- attach
57
+ attach,
58
+ delete: remove,
47
59
  }
48
60
  }
49
61