@veritree/services 2.67.0 → 2.68.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.67.0",
3
+ "version": "2.68.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -6,6 +6,25 @@ class PlantingSitesApi extends Api {
6
6
  this.resource = 'planting-sites';
7
7
  }
8
8
 
9
+ public() {
10
+ const all = async (params) => {
11
+ const url = `${this.getUrl()}/public${this.getUrlParams(
12
+ params
13
+ )}`;
14
+ return await this.get(url);
15
+ };
16
+
17
+ const single = async (plantingSiteId) => {
18
+ const url = `${this.getUrl()}/public/${plantingSiteId}`;
19
+ return await this.get(url);
20
+ };
21
+
22
+ return {
23
+ all,
24
+ single,
25
+ };
26
+ }
27
+
9
28
  users(plantingSiteId) {
10
29
  let url = `${this.getUrl()}/${plantingSiteId}/users`;
11
30
 
@@ -129,6 +148,19 @@ class PlantingSitesApi extends Api {
129
148
  all,
130
149
  };
131
150
  }
151
+
152
+ locations() {
153
+ const all = async (params) => {
154
+ const url = `${this.getUrl()}/locations-by-org${this.getUrlParams(
155
+ params
156
+ )}`;
157
+ return await this.get(url);
158
+ };
159
+
160
+ return {
161
+ all
162
+ }
163
+ }
132
164
  }
133
165
 
134
166
  export const PlantingSites = new PlantingSitesApi();