@veritree/services 2.27.0 → 2.27.2

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.27.0",
3
+ "version": "2.27.2",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -6,14 +6,41 @@ class EvidenceApi extends Api {
6
6
  this.resource = "evidence";
7
7
  }
8
8
 
9
- async image(imageId, params) {
9
+ image(imageId, params) {
10
+
10
11
  let url = `${this.getUrl()}/image/${imageId}${this.getUrlParams(params)}`
11
- return await this.get(url);
12
+
13
+ const single = async () => {
14
+ return await this.get(url);
15
+ };
16
+
17
+ const remove = async () => {
18
+ return await this.post(url, null, 'delete');
19
+ };
20
+
21
+
22
+ return {
23
+ single,
24
+ delete: remove,
25
+ };
12
26
  }
13
27
 
14
- async attachment(attachementId, params) {
15
- let url = `${this.getUrl()}/attachment/${attachementId}${this.getUrlParams(params)}`
16
- return await this.get(url);
28
+ attachment(attachmentId, params) {
29
+ let url = `${this.getUrl()}/attachment/${attachmentId}${this.getUrlParams(params)}`
30
+
31
+ const single = async () => {
32
+ return await this.get(url);
33
+ };
34
+
35
+ const remove = async () => {
36
+ return await this.post(url, null, 'delete');
37
+ };
38
+
39
+
40
+ return {
41
+ single,
42
+ delete: remove,
43
+ };
17
44
  }
18
45
  }
19
46
 
@@ -9,28 +9,28 @@
9
9
  const Team = (api, id) => {
10
10
  let url = `${api.baseUrl}/${api.resource}/${id}/users`;
11
11
 
12
- const all = async (args) => {
13
- url = `${url}${api.getUrlParams(args)}`;
12
+ const all = async (params) => {
13
+ url = `${url}${api.getUrlParams(params)}`;
14
14
  return await api.get(url);
15
15
  };
16
16
 
17
- const single = async (userId, args) => {
18
- url = `${url}/${userId}${api.getUrlParams(args)}`;
17
+ const single = async (userId, params) => {
18
+ url = `${url}/${userId}${api.getUrlParams(params)}`;
19
19
  return await api.get(url);
20
20
  };
21
21
 
22
- const create = async (data) => {
23
- url = `${url}${api.getUrlParams()}`;
22
+ const create = async (data, params) => {
23
+ url = `${url}${api.getUrlParams(params)}`;
24
24
  return await api.post(url, data);
25
25
  }
26
26
 
27
- const update = async (userId, data) => {
28
- url = `${url}/${userId}${api.getUrlParams()}`;
27
+ const update = async (userId, data, params) => {
28
+ url = `${url}/${userId}${api.getUrlParams(params)}`;
29
29
  return await api.post(url, data, 'patch');
30
30
  }
31
31
 
32
- const remove = async (userId, args) => {
33
- url = `${url}/${userId}${api.getUrlParams(args)}`;
32
+ const remove = async (userId, params) => {
33
+ url = `${url}/${userId}${api.getUrlParams(params)}`;
34
34
  return await api.post(url, null, "delete");
35
35
  }
36
36