@veritree/services 2.31.0 → 2.31.1-1

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.31.0",
3
+ "version": "2.31.1-1",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,9 +1,20 @@
1
- import Api from '../helpers/api';
1
+ import Api from "../helpers/api";
2
2
 
3
3
  class PlantingSitesApi extends Api {
4
4
  constructor(resource) {
5
5
  super(resource);
6
- this.resource = 'planting-sites';
6
+ this.resource = "planting-sites";
7
+ }
8
+
9
+ public() {
10
+ const single = async (plantingSiteId) => {
11
+ const url = `${this.getUrl()}/public/${plantingSiteId}`;
12
+ return await this.get(url);
13
+ };
14
+
15
+ return {
16
+ single,
17
+ };
7
18
  }
8
19
 
9
20
  users(plantingSiteId) {
@@ -32,7 +43,7 @@ class PlantingSitesApi extends Api {
32
43
  url = `${this.getUrl()}/${subsiteId}/media/images/${imageId}${this.getUrlParams(
33
44
  params
34
45
  )}`;
35
- return await this.post(url, null, 'delete');
46
+ return await this.post(url, null, "delete");
36
47
  };
37
48
 
38
49
  return {
@@ -54,7 +65,7 @@ class PlantingSitesApi extends Api {
54
65
  url = `${this.getUrl()}/${subsiteId}/media/attachments/${attachmentId}${this.getUrlParams(
55
66
  params
56
67
  )}`;
57
- return await this.post(url, null, 'delete');
68
+ return await this.post(url, null, "delete");
58
69
  };
59
70
 
60
71
  return {
@@ -6,9 +6,9 @@ class TreeCodesApi extends Api {
6
6
  this.resource = "tree-codes";
7
7
  }
8
8
 
9
- holders(args) {
9
+ holders() {
10
10
  const claim = async (treeCodeHolder) => {
11
- const url = `${this.getUrl()}/holders/claim/${treeCodeHolder}${this.getUrlParams(args)}`;
11
+ const url = `${this.getUrl()}/holders/claim/${treeCodeHolder}`;
12
12
  return await this.get(url);
13
13
  };
14
14
 
@@ -16,6 +16,17 @@ class TreeCodesApi extends Api {
16
16
  claim,
17
17
  };
18
18
  }
19
+
20
+ stats() {
21
+ const all = async () => {
22
+ const url = `${this.getUrl()}/stats`;
23
+ return await this.get(url);
24
+ }
25
+
26
+ return {
27
+ all
28
+ }
29
+ }
19
30
  }
20
31
 
21
32
  export const TreeCodes = new TreeCodesApi();