@veritree/services 2.34.0 → 2.35.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 +83 -83
- package/package.json +16 -16
- package/src/endpoints/bulk-uploads.js +4 -4
- package/src/endpoints/countries.js +5 -5
- package/src/endpoints/crumbs.js +20 -20
- package/src/endpoints/evidence.js +47 -47
- package/src/endpoints/external-reports.js +9 -9
- package/src/endpoints/field-reports.js +37 -37
- package/src/endpoints/field-udpate-verifications.js +5 -5
- package/src/endpoints/field-updates.js +16 -16
- package/src/endpoints/forest-type-species.js +4 -4
- package/src/endpoints/forest-types-profiles.js +4 -4
- package/src/endpoints/forest-types.js +14 -14
- package/src/endpoints/form-submissions.js +4 -4
- package/src/endpoints/geometries.js +4 -4
- package/src/endpoints/images-aggregated.js +4 -4
- package/src/endpoints/images.js +21 -21
- package/src/endpoints/methodologies.js +36 -36
- package/src/endpoints/notes.js +14 -14
- package/src/endpoints/organizations.js +59 -59
- package/src/endpoints/orgs.js +65 -65
- package/src/endpoints/password.js +58 -58
- package/src/endpoints/planting-sites.js +121 -110
- package/src/endpoints/regions.js +41 -41
- package/src/endpoints/resellers.js +37 -37
- package/src/endpoints/roles.js +4 -4
- package/src/endpoints/sdgs.js +4 -4
- package/src/endpoints/sponsors.js +86 -86
- package/src/endpoints/sso-token.js +5 -5
- package/src/endpoints/standards.js +140 -140
- package/src/endpoints/stats.js +17 -17
- package/src/endpoints/subdomains.js +4 -4
- package/src/endpoints/subsite-types.js +5 -5
- package/src/endpoints/subsites.js +88 -88
- package/src/endpoints/tags.js +14 -14
- package/src/endpoints/tasks.js +47 -47
- package/src/endpoints/tree-order-statuses.js +4 -4
- package/src/endpoints/trees-orders.js +23 -23
- package/src/endpoints/user.js +27 -27
- package/src/endpoints/users.js +14 -14
- package/src/endpoints/utilities.js +35 -35
- package/src/endpoints/verifications.js +21 -21
- package/src/helpers/api.js +293 -293
- package/src/helpers/cookies.js +36 -36
- package/src/helpers/relations.js +32 -32
- package/src/helpers/sequestrations.js +19 -19
- package/src/helpers/session.js +3 -3
- package/src/helpers/team.js +45 -45
- package/src/utils/args.js +46 -46
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import Api from '../helpers/api';
|
|
2
|
-
import { createParamsStringFromArgs } from '../utils/args';
|
|
3
|
-
|
|
4
|
-
class StandardsApi extends Api {
|
|
5
|
-
constructor(resource) {
|
|
6
|
-
super(resource);
|
|
7
|
-
this.resource = 'standards';
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
themes() {
|
|
11
|
-
const all = async (args) => {
|
|
12
|
-
const url = `${this.getUrl()}/themes?${createParamsStringFromArgs(args)}`;
|
|
13
|
-
return await this.get(url);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const create = async (data, args) => {
|
|
17
|
-
const url = `${this.getUrl()}/themes?${createParamsStringFromArgs(args)}`;
|
|
18
|
-
return await this.post(url, data);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const update = async (themeId, data, args) => {
|
|
22
|
-
const url = `${this.getUrl()}/themes/${themeId}?${createParamsStringFromArgs(
|
|
23
|
-
args
|
|
24
|
-
)}`;
|
|
25
|
-
return await this.post(url, data, 'patch');
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const remove = async (args) => {
|
|
29
|
-
const url = `${this.getUrl()}/themes/${themeId}?${createParamsStringFromArgs(
|
|
30
|
-
args
|
|
31
|
-
)}`;
|
|
32
|
-
return await this.post(url, data, 'delete');
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
const goals = (themeId) => {
|
|
36
|
-
const create = async (data, args) => {
|
|
37
|
-
const url = `${this.getUrl()}/themes/${themeId}/goals?${createParamsStringFromArgs(
|
|
38
|
-
args
|
|
39
|
-
)}`;
|
|
40
|
-
return await this.post(url, data);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const indicators = (goalId) => {
|
|
44
|
-
const create = async (data, args) => {
|
|
45
|
-
const url = `${this.getUrl()}/themes/${themeId}/goals/${goalId}/indicators?${createParamsStringFromArgs(
|
|
46
|
-
args
|
|
47
|
-
)}`;
|
|
48
|
-
return await this.post(url, data);
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
create,
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
create,
|
|
58
|
-
indicators,
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const UNSDGs = (themeId) => {
|
|
63
|
-
const create = async (data) => {
|
|
64
|
-
console.log('this.getUrl:', this.getUrl())
|
|
65
|
-
const url = `${this.getUrl()}/themes/${themeId}/attach-sdg`;
|
|
66
|
-
return await this.post(url, data);
|
|
67
|
-
};
|
|
68
|
-
return {
|
|
69
|
-
create
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return {
|
|
74
|
-
all,
|
|
75
|
-
create,
|
|
76
|
-
update,
|
|
77
|
-
delete: remove,
|
|
78
|
-
goals,
|
|
79
|
-
UNSDGs
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
goals(goalId) {
|
|
84
|
-
const single = async () => {
|
|
85
|
-
const url = `${this.getUrl()}/goals/${goalId}`;
|
|
86
|
-
return await this.get(url);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
const update = async (data) => {
|
|
90
|
-
const url = `${this.getUrl()}/goals/${goalId}`;
|
|
91
|
-
return await this.post(url, data, 'patch');
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const remove = async () => {
|
|
95
|
-
const url = `${this.getUrl()}/goals/${goalId}`;
|
|
96
|
-
return await this.post(url, null, 'delete');
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return {
|
|
100
|
-
single,
|
|
101
|
-
update,
|
|
102
|
-
delete: remove,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
indicators(indicatorId) {
|
|
107
|
-
const single = async () => {
|
|
108
|
-
const url = `${this.getUrl()}/indicators/${indicatorId}`;
|
|
109
|
-
return await this.get(url);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const update = async (data) => {
|
|
113
|
-
const url = `${this.getUrl()}/indicators/${indicatorId}`;
|
|
114
|
-
return await this.post(url, data, 'patch');
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const remove = async () => {
|
|
118
|
-
const url = `${this.getUrl()}/indicators/${indicatorId}`;
|
|
119
|
-
return await this.post(url, null, 'delete');
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
return {
|
|
123
|
-
single,
|
|
124
|
-
update,
|
|
125
|
-
delete: remove,
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
UNSDGs(themeId){
|
|
129
|
-
const attach = async (data) => {
|
|
130
|
-
const url = `${this.getUrl()}/themes/${themeId}/attach-sdg`;
|
|
131
|
-
return await this.update(url,{"sdg_id":data})
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
return {
|
|
135
|
-
attach
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
export const Standards = new StandardsApi();
|
|
1
|
+
import Api from '../helpers/api';
|
|
2
|
+
import { createParamsStringFromArgs } from '../utils/args';
|
|
3
|
+
|
|
4
|
+
class StandardsApi extends Api {
|
|
5
|
+
constructor(resource) {
|
|
6
|
+
super(resource);
|
|
7
|
+
this.resource = 'standards';
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
themes() {
|
|
11
|
+
const all = async (args) => {
|
|
12
|
+
const url = `${this.getUrl()}/themes?${createParamsStringFromArgs(args)}`;
|
|
13
|
+
return await this.get(url);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const create = async (data, args) => {
|
|
17
|
+
const url = `${this.getUrl()}/themes?${createParamsStringFromArgs(args)}`;
|
|
18
|
+
return await this.post(url, data);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const update = async (themeId, data, args) => {
|
|
22
|
+
const url = `${this.getUrl()}/themes/${themeId}?${createParamsStringFromArgs(
|
|
23
|
+
args
|
|
24
|
+
)}`;
|
|
25
|
+
return await this.post(url, data, 'patch');
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const remove = async (args) => {
|
|
29
|
+
const url = `${this.getUrl()}/themes/${themeId}?${createParamsStringFromArgs(
|
|
30
|
+
args
|
|
31
|
+
)}`;
|
|
32
|
+
return await this.post(url, data, 'delete');
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const goals = (themeId) => {
|
|
36
|
+
const create = async (data, args) => {
|
|
37
|
+
const url = `${this.getUrl()}/themes/${themeId}/goals?${createParamsStringFromArgs(
|
|
38
|
+
args
|
|
39
|
+
)}`;
|
|
40
|
+
return await this.post(url, data);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const indicators = (goalId) => {
|
|
44
|
+
const create = async (data, args) => {
|
|
45
|
+
const url = `${this.getUrl()}/themes/${themeId}/goals/${goalId}/indicators?${createParamsStringFromArgs(
|
|
46
|
+
args
|
|
47
|
+
)}`;
|
|
48
|
+
return await this.post(url, data);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
create,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
create,
|
|
58
|
+
indicators,
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const UNSDGs = (themeId) => {
|
|
63
|
+
const create = async (data) => {
|
|
64
|
+
console.log('this.getUrl:', this.getUrl())
|
|
65
|
+
const url = `${this.getUrl()}/themes/${themeId}/attach-sdg`;
|
|
66
|
+
return await this.post(url, data);
|
|
67
|
+
};
|
|
68
|
+
return {
|
|
69
|
+
create
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
all,
|
|
75
|
+
create,
|
|
76
|
+
update,
|
|
77
|
+
delete: remove,
|
|
78
|
+
goals,
|
|
79
|
+
UNSDGs
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
goals(goalId) {
|
|
84
|
+
const single = async () => {
|
|
85
|
+
const url = `${this.getUrl()}/goals/${goalId}`;
|
|
86
|
+
return await this.get(url);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const update = async (data) => {
|
|
90
|
+
const url = `${this.getUrl()}/goals/${goalId}`;
|
|
91
|
+
return await this.post(url, data, 'patch');
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const remove = async () => {
|
|
95
|
+
const url = `${this.getUrl()}/goals/${goalId}`;
|
|
96
|
+
return await this.post(url, null, 'delete');
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
return {
|
|
100
|
+
single,
|
|
101
|
+
update,
|
|
102
|
+
delete: remove,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
indicators(indicatorId) {
|
|
107
|
+
const single = async () => {
|
|
108
|
+
const url = `${this.getUrl()}/indicators/${indicatorId}`;
|
|
109
|
+
return await this.get(url);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const update = async (data) => {
|
|
113
|
+
const url = `${this.getUrl()}/indicators/${indicatorId}`;
|
|
114
|
+
return await this.post(url, data, 'patch');
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const remove = async () => {
|
|
118
|
+
const url = `${this.getUrl()}/indicators/${indicatorId}`;
|
|
119
|
+
return await this.post(url, null, 'delete');
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
single,
|
|
124
|
+
update,
|
|
125
|
+
delete: remove,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
UNSDGs(themeId){
|
|
129
|
+
const attach = async (data) => {
|
|
130
|
+
const url = `${this.getUrl()}/themes/${themeId}/attach-sdg`;
|
|
131
|
+
return await this.update(url,{"sdg_id":data})
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
attach
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const Standards = new StandardsApi();
|
package/src/endpoints/stats.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import Api from '../helpers/api';
|
|
2
|
-
|
|
3
|
-
class StatsApi extends Api {
|
|
4
|
-
constructor(resource) {
|
|
5
|
-
super(resource);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
async crumb(id) {
|
|
9
|
-
this.resource = 'pstats';
|
|
10
|
-
const url = `${this.getUrl()}/${id}${this.getUrlParams()}`;
|
|
11
|
-
|
|
12
|
-
return await this.get(url);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export const Stats = new StatsApi();
|
|
17
|
-
|
|
1
|
+
import Api from '../helpers/api';
|
|
2
|
+
|
|
3
|
+
class StatsApi extends Api {
|
|
4
|
+
constructor(resource) {
|
|
5
|
+
super(resource);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
async crumb(id) {
|
|
9
|
+
this.resource = 'pstats';
|
|
10
|
+
const url = `${this.getUrl()}/${id}${this.getUrlParams()}`;
|
|
11
|
+
|
|
12
|
+
return await this.get(url);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const Stats = new StatsApi();
|
|
17
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Api from '../helpers/api';
|
|
2
|
-
|
|
3
|
-
const resource = 'subdomains';
|
|
4
|
-
|
|
1
|
+
import Api from '../helpers/api';
|
|
2
|
+
|
|
3
|
+
const resource = 'subdomains';
|
|
4
|
+
|
|
5
5
|
export const Subdomains = new Api(resource);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Api from "../helpers/api";
|
|
2
|
-
|
|
3
|
-
const resource = "subsite-types";
|
|
4
|
-
|
|
5
|
-
export const SubsiteTypes = new Api(resource);
|
|
1
|
+
import Api from "../helpers/api";
|
|
2
|
+
|
|
3
|
+
const resource = "subsite-types";
|
|
4
|
+
|
|
5
|
+
export const SubsiteTypes = new Api(resource);
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import Api from "../helpers/api";
|
|
2
|
-
import { createParamsStringFromArgs } from "../utils/args";
|
|
3
|
-
|
|
4
|
-
class SubsitesApi extends Api {
|
|
5
|
-
constructor(resource) {
|
|
6
|
-
super(resource);
|
|
7
|
-
this.resource = "subsites";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
locationsByOrg() {
|
|
11
|
-
const get = async (args) => {
|
|
12
|
-
const url = `${this.getUrl()}/locations-by-org${this.getUrlParams(args)}`;
|
|
13
|
-
return await this.get(url);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
return {
|
|
17
|
-
get,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
indicators() {
|
|
22
|
-
const all = async (subsite, args) => {
|
|
23
|
-
const url = `${this.getUrl()}/${subsite}/indicators?${createParamsStringFromArgs(
|
|
24
|
-
args
|
|
25
|
-
)}`;
|
|
26
|
-
return await this.get(url);
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const create = async (subsite, formData) => {
|
|
30
|
-
const url = `${this.getUrl()}/${subsite}/indicators`;
|
|
31
|
-
return await this.post(url, formData);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const remove = async (subsite, indicator) => {
|
|
35
|
-
const url = `${this.getUrl()}/${subsite}/indicators/${indicator}`;
|
|
36
|
-
return await this.post(url, null, "delete");
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return {
|
|
40
|
-
all,
|
|
41
|
-
create,
|
|
42
|
-
delete: remove,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
stats(subsiteId, args) {
|
|
47
|
-
const all = async () => {
|
|
48
|
-
const url = `${this.getUrl()}/${subsiteId}/stats${this.getUrlParams(args)}`;
|
|
49
|
-
return await this.get(url);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
all,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
evidence(subsiteId, params) {
|
|
58
|
-
let url = `${this.getUrl()}/${subsiteId}/evidence`;
|
|
59
|
-
|
|
60
|
-
const all = async () => {
|
|
61
|
-
url = `${url}${this.getUrlParams(params)}`;
|
|
62
|
-
|
|
63
|
-
return await this.get(url);
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
const attach = async (formData) => {
|
|
67
|
-
url = `${url}${this.getUrlParams(params)}`;
|
|
68
|
-
|
|
69
|
-
return await this.post(url, formData);
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
const remove = async (evidenceType, evidenceId) => {
|
|
73
|
-
url = `${url}/${evidenceType}/${evidenceId}${this.getUrlParams(
|
|
74
|
-
params
|
|
75
|
-
)}`;
|
|
76
|
-
|
|
77
|
-
return await this.post(url, null, "delete");
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
all,
|
|
82
|
-
attach,
|
|
83
|
-
delete: remove,
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export const Subsites = new SubsitesApi();
|
|
1
|
+
import Api from "../helpers/api";
|
|
2
|
+
import { createParamsStringFromArgs } from "../utils/args";
|
|
3
|
+
|
|
4
|
+
class SubsitesApi extends Api {
|
|
5
|
+
constructor(resource) {
|
|
6
|
+
super(resource);
|
|
7
|
+
this.resource = "subsites";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
locationsByOrg() {
|
|
11
|
+
const get = async (args) => {
|
|
12
|
+
const url = `${this.getUrl()}/locations-by-org${this.getUrlParams(args)}`;
|
|
13
|
+
return await this.get(url);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return {
|
|
17
|
+
get,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
indicators() {
|
|
22
|
+
const all = async (subsite, args) => {
|
|
23
|
+
const url = `${this.getUrl()}/${subsite}/indicators?${createParamsStringFromArgs(
|
|
24
|
+
args
|
|
25
|
+
)}`;
|
|
26
|
+
return await this.get(url);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const create = async (subsite, formData) => {
|
|
30
|
+
const url = `${this.getUrl()}/${subsite}/indicators`;
|
|
31
|
+
return await this.post(url, formData);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const remove = async (subsite, indicator) => {
|
|
35
|
+
const url = `${this.getUrl()}/${subsite}/indicators/${indicator}`;
|
|
36
|
+
return await this.post(url, null, "delete");
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
all,
|
|
41
|
+
create,
|
|
42
|
+
delete: remove,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
stats(subsiteId, args) {
|
|
47
|
+
const all = async () => {
|
|
48
|
+
const url = `${this.getUrl()}/${subsiteId}/stats${this.getUrlParams(args)}`;
|
|
49
|
+
return await this.get(url);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
all,
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
evidence(subsiteId, params) {
|
|
58
|
+
let url = `${this.getUrl()}/${subsiteId}/evidence`;
|
|
59
|
+
|
|
60
|
+
const all = async () => {
|
|
61
|
+
url = `${url}${this.getUrlParams(params)}`;
|
|
62
|
+
|
|
63
|
+
return await this.get(url);
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const attach = async (formData) => {
|
|
67
|
+
url = `${url}${this.getUrlParams(params)}`;
|
|
68
|
+
|
|
69
|
+
return await this.post(url, formData);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const remove = async (evidenceType, evidenceId) => {
|
|
73
|
+
url = `${url}/${evidenceType}/${evidenceId}${this.getUrlParams(
|
|
74
|
+
params
|
|
75
|
+
)}`;
|
|
76
|
+
|
|
77
|
+
return await this.post(url, null, "delete");
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return {
|
|
81
|
+
all,
|
|
82
|
+
attach,
|
|
83
|
+
delete: remove,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export const Subsites = new SubsitesApi();
|
package/src/endpoints/tags.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import Api from "../helpers/api";
|
|
2
|
-
import Relations from "../helpers/relations";
|
|
3
|
-
|
|
4
|
-
class TagsApi extends Api {
|
|
5
|
-
constructor(resource) {
|
|
6
|
-
super(resource);
|
|
7
|
-
this.resource = "tags";
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
relation(prefix, id) {
|
|
11
|
-
return Relations(this, prefix, id);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
1
|
+
import Api from "../helpers/api";
|
|
2
|
+
import Relations from "../helpers/relations";
|
|
3
|
+
|
|
4
|
+
class TagsApi extends Api {
|
|
5
|
+
constructor(resource) {
|
|
6
|
+
super(resource);
|
|
7
|
+
this.resource = "tags";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
relation(prefix, id) {
|
|
11
|
+
return Relations(this, prefix, id);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
15
|
export const Tags = new TagsApi();
|
package/src/endpoints/tasks.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import Api from "../helpers/api";
|
|
2
|
-
|
|
3
|
-
class TasksApi extends Api {
|
|
4
|
-
constructor(resource) {
|
|
5
|
-
super(resource);
|
|
6
|
-
this.resource = "tasks";
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
geometries(taskPublicId) {
|
|
10
|
-
let url = `${this.getUrl()}/${taskPublicId}/geometries`;
|
|
11
|
-
|
|
12
|
-
const all = async (params) => {
|
|
13
|
-
url = `${url}${this.getUrlParams(params)}`;
|
|
14
|
-
return await this.get(url);
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const attach = async (data) => {
|
|
18
|
-
url = `${url}${this.getUrlParams()}`;
|
|
19
|
-
return await this.post(url, data);
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
return {
|
|
23
|
-
all,
|
|
24
|
-
attach,
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
users(taskPublicId) {
|
|
29
|
-
let url = `${this.getUrl()}/${taskPublicId}`;
|
|
30
|
-
|
|
31
|
-
const attach = async (data) => {
|
|
32
|
-
url = `${url}/users-attach${this.getUrlParams()}`;
|
|
33
|
-
return await this.post(url, data);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const detach = async (data) => {
|
|
37
|
-
url = `${url}/users-detach${this.getUrlParams()}`;
|
|
38
|
-
return await this.post(url, data);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return {
|
|
42
|
-
attach,
|
|
43
|
-
detach
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
1
|
+
import Api from "../helpers/api";
|
|
2
|
+
|
|
3
|
+
class TasksApi extends Api {
|
|
4
|
+
constructor(resource) {
|
|
5
|
+
super(resource);
|
|
6
|
+
this.resource = "tasks";
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
geometries(taskPublicId) {
|
|
10
|
+
let url = `${this.getUrl()}/${taskPublicId}/geometries`;
|
|
11
|
+
|
|
12
|
+
const all = async (params) => {
|
|
13
|
+
url = `${url}${this.getUrlParams(params)}`;
|
|
14
|
+
return await this.get(url);
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const attach = async (data) => {
|
|
18
|
+
url = `${url}${this.getUrlParams()}`;
|
|
19
|
+
return await this.post(url, data);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return {
|
|
23
|
+
all,
|
|
24
|
+
attach,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
users(taskPublicId) {
|
|
29
|
+
let url = `${this.getUrl()}/${taskPublicId}`;
|
|
30
|
+
|
|
31
|
+
const attach = async (data) => {
|
|
32
|
+
url = `${url}/users-attach${this.getUrlParams()}`;
|
|
33
|
+
return await this.post(url, data);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const detach = async (data) => {
|
|
37
|
+
url = `${url}/users-detach${this.getUrlParams()}`;
|
|
38
|
+
return await this.post(url, data);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
attach,
|
|
43
|
+
detach
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
48
|
export const Tasks = new TasksApi();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import Api from "../helpers/api";
|
|
2
|
-
|
|
3
|
-
const resource = "tree-order-statuses";
|
|
4
|
-
|
|
1
|
+
import Api from "../helpers/api";
|
|
2
|
+
|
|
3
|
+
const resource = "tree-order-statuses";
|
|
4
|
+
|
|
5
5
|
export const TreeOrderStatuses = new Api(resource);
|