@veritree/services 2.60.0 → 2.62.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 CHANGED
@@ -42,6 +42,7 @@ import { Tasks } from './src/endpoints/tasks';
42
42
  import { Geometries } from './src/endpoints/geometries';
43
43
  import { Password } from './src/endpoints/password';
44
44
  import { TreeCodes } from './src/endpoints/tree-codes';
45
+ import { Inventory } from './src/endpoints/inventory';
45
46
 
46
47
  export {
47
48
  BulkUploads,
@@ -87,5 +88,6 @@ export {
87
88
  Tasks,
88
89
  Geometries,
89
90
  Password,
90
- TreeCodes
91
+ TreeCodes,
92
+ Inventory
91
93
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.60.0",
3
+ "version": "2.62.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -0,0 +1,19 @@
1
+ import Api from "../helpers/api";
2
+
3
+ class InventoryApi extends Api {
4
+ constructor(resource) {
5
+ super(resource);
6
+ this.resource = "inventory";
7
+ }
8
+
9
+ // org type can be organizations, resellers, sponsors
10
+ async all(orgType, orgId) {
11
+ const url = `${this.baseUrl}/${orgType}/${orgId}/${
12
+ this.resource
13
+ }`
14
+
15
+ return await this.get(url);
16
+ }
17
+ }
18
+
19
+ export const Inventory = new InventoryApi();
@@ -53,7 +53,7 @@ function addVersionParam(url) {
53
53
  }
54
54
 
55
55
  // Use environment variable if available, otherwise use default version
56
- const version = process.env.API_VERITREE_VERSION || "5.0.0";
56
+ const version = "11.0.0";
57
57
 
58
58
  // Append version parameter to URL
59
59
  const urlVersionParam = url.includes("?")