@veritree/services 1.0.0-11 → 1.0.0-14
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,5 +1,15 @@
|
|
|
1
1
|
import Api from "../helpers/api";
|
|
2
|
+
import Sequestrations from '../helpers/sequestrations';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
class ForestTypesApi extends Api {
|
|
5
|
+
constructor(resource) {
|
|
6
|
+
super(resource);
|
|
7
|
+
this.resource = "forest-types";
|
|
8
|
+
}
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
sequestrations(id, args) {
|
|
11
|
+
return new Sequestrations(this, id, args);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const ForestTypes = new ForestTypesApi();
|
package/src/endpoints/notes.js
CHANGED
|
@@ -7,7 +7,9 @@ class NotesApi extends Api {
|
|
|
7
7
|
this.resource = "notes";
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
relation
|
|
10
|
+
relation(prefix, id, args) {
|
|
11
|
+
return Relations(this, prefix, id, args);
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export const Notes = new NotesApi();
|
package/src/endpoints/tags.js
CHANGED
|
@@ -7,7 +7,9 @@ class TagsApi extends Api {
|
|
|
7
7
|
this.resource = "tags";
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
relation
|
|
10
|
+
relation(prefix, id, args) {
|
|
11
|
+
return Relations(this, prefix, id, args);
|
|
12
|
+
}
|
|
11
13
|
}
|
|
12
14
|
|
|
13
15
|
export const Tags = new TagsApi();
|
package/src/helpers/relations.js
CHANGED
|
@@ -3,12 +3,12 @@ const Relations = (api, prefix, id, args) => {
|
|
|
3
3
|
|
|
4
4
|
const all = async () => {
|
|
5
5
|
url = `${url}${api.getUrlParams(args)}`;
|
|
6
|
-
return await api.
|
|
6
|
+
return await api.get(url);
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const single = async(tagId) => {
|
|
10
10
|
url = `${url}/${tagId}${api.getUrlParams(args)}`;
|
|
11
|
-
return await api.
|
|
11
|
+
return await api.get(url);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const attach = async(tagId, data) => {
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const Sequestrations = (api, forestTypeId, args) => {
|
|
2
|
+
let url = `${api.baseUrl}/${api.resource}/${forestTypeId}/sequestrations`;
|
|
3
|
+
|
|
4
|
+
const all = async () => {
|
|
5
|
+
url = `${url}${api.getUrlParams(args)}`;
|
|
6
|
+
return await api.get(url);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const create = async(data) => {
|
|
10
|
+
url = `${url}${api.getUrlParams(args)}`;
|
|
11
|
+
return await api.post(url, data);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return {
|
|
15
|
+
all,
|
|
16
|
+
create
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export default Sequestrations;
|