@veritree/services 2.45.0 → 2.47.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.45.0",
3
+ "version": "2.47.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -92,11 +92,9 @@ class PlantingSitesApi extends Api {
92
92
  };
93
93
 
94
94
  const remove = async (evidenceType, evidenceId) => {
95
- url = `${url}/${evidenceType}/${evidenceId}${this.getUrlParams(
96
- params
97
- )}`;
95
+ url = `${url}/${evidenceType}/${evidenceId}${this.getUrlParams(params)}`;
98
96
 
99
- return await this.post(url, null, "delete");
97
+ return await this.post(url, null, 'delete');
100
98
  };
101
99
 
102
100
  return {
@@ -108,7 +106,22 @@ class PlantingSitesApi extends Api {
108
106
 
109
107
  stats(subsiteId) {
110
108
  const all = async (args) => {
111
- const url = `${this.getUrl()}/${subsiteId}/stats${this.getUrlParams(args)}`;
109
+ const url = `${this.getUrl()}/${subsiteId}/stats${this.getUrlParams(
110
+ args
111
+ )}`;
112
+ return await this.get(url);
113
+ };
114
+
115
+ return {
116
+ all,
117
+ };
118
+ }
119
+
120
+ pstats(subsiteId) {
121
+ const all = async (args) => {
122
+ const url = `${this.getUrl()}/${subsiteId}/pstats${this.getUrlParams(
123
+ args
124
+ )}`;
112
125
  return await this.get(url);
113
126
  };
114
127
 
@@ -52,6 +52,21 @@ class RegionsApi extends Api {
52
52
  all,
53
53
  };
54
54
  }
55
+
56
+ milestone(){
57
+ const update = async (regionId, milestoneId) => {
58
+ const url = `${this.getUrl()}/${regionId}/milestones/${milestoneId}`;
59
+ return await this.post(url, null, null);
60
+ };
61
+ const all = async (args) => {
62
+ const url = `${this.getUrl()}/milestones${this.getUrlParams(args)}`;
63
+ return await this.get(url)
64
+ }
65
+ return {
66
+ update,
67
+ all,
68
+ };
69
+ }
55
70
  }
56
71
 
57
72