@veritree/services 2.24.0 → 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 +3 -1
- package/package.json +1 -1
- package/src/endpoints/geometries.js +5 -0
- package/src/endpoints/planting-sites.js +41 -0
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
|
@@ -18,6 +18,47 @@ class PlantingSitesApi extends Api {
|
|
|
18
18
|
all
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
+
|
|
22
|
+
images(subsiteId) {
|
|
23
|
+
let url = `${this.getUrl()}/${subsiteId}/media/images`
|
|
24
|
+
|
|
25
|
+
const attach = async (data, params) => {
|
|
26
|
+
url = `${url}${this.getUrlParams(params)}`;
|
|
27
|
+
|
|
28
|
+
return await this.post(url, data);
|
|
29
|
+
};
|
|
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
|
+
|
|
36
|
+
return {
|
|
37
|
+
attach,
|
|
38
|
+
delete: remove,
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
attachments(subsiteId) {
|
|
43
|
+
let url = `${this.getUrl()}/${subsiteId}/media/attachments`
|
|
44
|
+
|
|
45
|
+
const attach = async (data, params) => {
|
|
46
|
+
url = `${url}${this.getUrlParams(params)}`;
|
|
47
|
+
|
|
48
|
+
return await this.post(url, data);
|
|
49
|
+
};
|
|
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
|
+
|
|
56
|
+
return {
|
|
57
|
+
attach,
|
|
58
|
+
delete: remove,
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
21
62
|
}
|
|
22
63
|
|
|
23
64
|
export const PlantingSites = new PlantingSitesApi();
|