@veritree/services 2.38.0 → 2.39.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.38.0",
3
+ "version": "2.39.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,16 +1,16 @@
1
- import Api from '../helpers/api';
1
+ import Api from "../helpers/api";
2
2
 
3
3
  class SponsorsApi extends Api {
4
4
  constructor(resource) {
5
5
  super(resource);
6
- this.resource = 'sponsors';
6
+ this.resource = "sponsors";
7
7
  }
8
8
 
9
9
  async map() {
10
10
  this.setOrg();
11
11
 
12
12
  if (!this.orgId) {
13
- throw new Error('No org id provided');
13
+ throw new Error("No org id provided");
14
14
  }
15
15
 
16
16
  const url = `${this.getUrl()}/${this.orgId}/map-data`;
@@ -21,7 +21,7 @@ class SponsorsApi extends Api {
21
21
  this.setOrg();
22
22
 
23
23
  if (!this.orgId) {
24
- throw new Error('No org id provided');
24
+ throw new Error("No org id provided");
25
25
  }
26
26
 
27
27
  const url = `${this.getUrl()}/${this.orgId}/profile`;
@@ -49,7 +49,9 @@ class SponsorsApi extends Api {
49
49
  };
50
50
 
51
51
  const imageUploadUrl = async () => {
52
- const url = `${this.getUrl()}/${this.orgId}/cms/image-upload-url${urlParams}`;
52
+ const url = `${this.getUrl()}/${
53
+ this.orgId
54
+ }/cms/image-upload-url${urlParams}`;
53
55
  return await this.get(url);
54
56
  };
55
57
 
@@ -67,19 +69,35 @@ class SponsorsApi extends Api {
67
69
 
68
70
  tools(args) {
69
71
  const get = async (sponsorId) => {
70
- const url = `${this.getUrl()}/${sponsorId}/tools${this.getUrlParams(args)}`;
72
+ const url = `${this.getUrl()}/${sponsorId}/tools${this.getUrlParams(
73
+ args
74
+ )}`;
71
75
  return await this.get(url);
72
- }
76
+ };
73
77
 
74
78
  const create = async (sponsorId, data) => {
75
79
  const url = `${this.getUrl()}/${sponsorId}/tools`;
76
80
  return await this.post(url, data);
77
- }
81
+ };
78
82
 
79
83
  return {
80
84
  get,
81
- create
82
- }
85
+ create,
86
+ };
87
+ }
88
+
89
+ treeOrderSummary(args) {
90
+ const all = async (sponsorId) => {
91
+ const url = `${this.getUrl()}/${sponsorId}/tree-order-summary${this.getUrlParams(
92
+ args
93
+ )}`;
94
+
95
+ return await this.get(url);
96
+ };
97
+
98
+ return {
99
+ all,
100
+ };
83
101
  }
84
102
  }
85
103