@veritree/services 1.5.0-0 → 1.5.0-3

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 CHANGED
@@ -19,6 +19,7 @@ import { SubsiteTypes } from './src/endpoints/subsite-types';
19
19
  import { Tags } from './src/endpoints/tags';
20
20
  import { TreeOrders } from './src/endpoints/trees-orders';
21
21
  import { User } from './src/endpoints/user';
22
+ import { Users } from './src/endpoints/users';
22
23
 
23
24
  export {
24
25
  BulkUploads,
@@ -41,5 +42,6 @@ export {
41
42
  SubsiteTypes,
42
43
  Tags,
43
44
  TreeOrders,
44
- User
45
+ User,
46
+ Users
45
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "1.5.0-0",
3
+ "version": "1.5.0-3",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,5 +1,16 @@
1
1
  import Api from "../helpers/api";
2
2
 
3
- const resource = "field-updates";
3
+ class FieldUpdatesApi extends Api {
4
+ constructor(resource) {
5
+ super(resource);
6
+ this.resource = "field-updates";
7
+ }
4
8
 
5
- export const FieldUpdates = new Api(resource);
9
+ async images(fieldUpdateId, args) {
10
+ const url = `${this.getUrl()}/${fieldUpdateId}/images${this.getUrlParams(args)}`;
11
+
12
+ return await this.get(url);
13
+ }
14
+ }
15
+
16
+ export const FieldUpdates = new FieldUpdatesApi();
@@ -6,6 +6,11 @@ class OrgsApi extends Api {
6
6
  this.resource = "orgs";
7
7
  }
8
8
 
9
+ async roles(orgId, params) {
10
+ const url = `${this.getUrl()}/${orgId}/roles${this.getUrlParams(params)}`;
11
+ return await this.get(url);
12
+ }
13
+
9
14
  async stats() {
10
15
  const url = `${this._geStatstUrl()}`;
11
16
  return await this.get(url);
@@ -0,0 +1,5 @@
1
+ import Api from '../helpers/api';
2
+
3
+ const resource = 'users';
4
+
5
+ export const Users = new Api(resource);