@veritree/services 2.8.0 → 2.10.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/index.js +4 -2
- package/package.json +1 -1
- package/src/endpoints/sponsors.js +26 -9
- package/src/endpoints/standards.js +27 -0
package/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { Notes } from './src/endpoints/notes';
|
|
|
12
12
|
import { Regions } from './src/endpoints/regions';
|
|
13
13
|
import { SDGs } from './src/endpoints/sdgs';
|
|
14
14
|
import { Sponsors } from './src/endpoints/sponsors';
|
|
15
|
+
import { Standards } from './src/endpoints/standards';
|
|
15
16
|
import { Stats } from './src/endpoints/stats';
|
|
16
17
|
import { Subdomains } from './src/endpoints/subdomains';
|
|
17
18
|
import { Subsites } from './src/endpoints/subsites';
|
|
@@ -37,6 +38,7 @@ export {
|
|
|
37
38
|
Regions,
|
|
38
39
|
SDGs,
|
|
39
40
|
Sponsors,
|
|
41
|
+
Standards,
|
|
40
42
|
Stats,
|
|
41
43
|
Subdomains,
|
|
42
44
|
Subsites,
|
|
@@ -45,5 +47,5 @@ export {
|
|
|
45
47
|
TreeOrders,
|
|
46
48
|
User,
|
|
47
49
|
Users,
|
|
48
|
-
Roles
|
|
49
|
-
}
|
|
50
|
+
Roles,
|
|
51
|
+
};
|
package/package.json
CHANGED
|
@@ -34,20 +34,37 @@ class SponsorsApi extends Api {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
async totalPlantingStats(args) {
|
|
37
|
-
const url = `${this.getUrl()}/total-planting-stats${this.getUrlParams(
|
|
37
|
+
const url = `${this.getUrl()}/total-planting-stats${this.getUrlParams(
|
|
38
|
+
args
|
|
39
|
+
)}`;
|
|
38
40
|
return await this.get(url);
|
|
39
41
|
}
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
cms(args) {
|
|
42
44
|
const urlParams = this.getUrlParams(args);
|
|
43
|
-
const url = `${this.getUrl()}/${this.orgId}/cms/token${urlParams}`;
|
|
44
|
-
return await this.get(url);
|
|
45
|
-
}
|
|
46
45
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
const token = async () => {
|
|
47
|
+
const url = `${this.getUrl()}/${this.orgId}/cms/token${urlParams}`;
|
|
48
|
+
return await this.get(url);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const imageUploadUrl = async () => {
|
|
52
|
+
const url = `${this.getUrl()}/${
|
|
53
|
+
this.orgId
|
|
54
|
+
}/cms/image-upload-url${urlParams}`;
|
|
55
|
+
return await this.get(url);
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const credentials = async (orgId, data) => {
|
|
59
|
+
const url = `${this.getUrl()}/${orgId}/cms/credentials`;
|
|
60
|
+
return await this.post(url, data);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
return {
|
|
64
|
+
token,
|
|
65
|
+
imageUploadUrl,
|
|
66
|
+
credentials,
|
|
67
|
+
};
|
|
51
68
|
}
|
|
52
69
|
}
|
|
53
70
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import Api from '../helpers/api';
|
|
2
|
+
|
|
3
|
+
class StandardsApi extends Api {
|
|
4
|
+
themes() {
|
|
5
|
+
const all = async () => {
|
|
6
|
+
const url = `${this.getUrl()}standards/themes`;
|
|
7
|
+
return await this.get(url);
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
return {
|
|
11
|
+
all,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
goals() {
|
|
16
|
+
const single = async (goalId) => {
|
|
17
|
+
const url = `${this.getUrl()}standards/goals/${goalId}`;
|
|
18
|
+
return await this.get(url);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
single,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const Standards = new StandardsApi();
|