@veritree/services 2.5.8 → 2.6.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.5.8",
3
+ "version": "2.6.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -9,7 +9,9 @@ class SponsorsApi extends Api {
9
9
  async map() {
10
10
  this.setOrg();
11
11
 
12
- if(!this.orgId) throw new Error('No org id provided');
12
+ if (!this.orgId) {
13
+ throw new Error('No org id provided');
14
+ }
13
15
 
14
16
  const url = `${this.getUrl()}/${this.orgId}/map-data`;
15
17
  return await this.get(url);
@@ -18,7 +20,9 @@ class SponsorsApi extends Api {
18
20
  async profile() {
19
21
  this.setOrg();
20
22
 
21
- if(!this.orgId) throw new Error('No org id provided');
23
+ if (!this.orgId) {
24
+ throw new Error('No org id provided');
25
+ }
22
26
 
23
27
  const url = `${this.getUrl()}/${this.orgId}/profile`;
24
28
  return await this.get(url);
@@ -32,8 +36,19 @@ class SponsorsApi extends Api {
32
36
  async totalPlantingStats(args) {
33
37
  const url = `${this.getUrl()}/total-planting-stats${this.getUrlParams(args)}`;
34
38
  return await this.get(url);
35
- }
39
+ }
40
+
41
+ async cmsToken(args) {
42
+ const urlParams = this.getUrlParams(args);
43
+ const url = `${this.getUrl()}/${this.orgId}/cms/token${urlParams}`;
44
+ return await this.get(url);
45
+ }
36
46
 
47
+ async cmsImageUploadUrl(args) {
48
+ const urlParams = this.getUrlParams(args);
49
+ const url = `${this.getUrl()}/${this.orgId}/cms/image-upload-url${urlParams}`;
50
+ return await this.get(url);
51
+ }
37
52
  }
38
53
 
39
54
  export const Sponsors = new SponsorsApi();