@veritree/services 2.70.0 → 2.71.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.70.0",
3
+ "version": "2.71.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -1,9 +1,9 @@
1
- import Api from "../helpers/api";
1
+ import Api from '../helpers/api';
2
2
 
3
3
  class ResellersApi extends Api {
4
4
  constructor(resource) {
5
5
  super(resource);
6
- this.resource = "resellers";
6
+ this.resource = 'resellers';
7
7
  }
8
8
 
9
9
  statsSold() {
@@ -13,7 +13,7 @@ class ResellersApi extends Api {
13
13
  try {
14
14
  response = await this.get(url);
15
15
  } catch (e) {
16
- console.log("error ", e);
16
+ console.log('error ', e);
17
17
  }
18
18
  return response;
19
19
  };
@@ -89,6 +89,28 @@ class ResellersApi extends Api {
89
89
  all,
90
90
  };
91
91
  }
92
+
93
+ /**
94
+ * Fetches all planting parter organizations for the specified reseller.
95
+ *
96
+ * @param {string} resellerId - The unique identifier of the reseller.
97
+ * @param {Object} params - Additional parameters for customizing the request.
98
+ * @returns {Promise} A promise that resolves to the organizations data.
99
+ * @memberof Resellers
100
+ */
101
+ organizations(resellerId) {
102
+ const all = async (params) => {
103
+ const url = `${this.getUrl()}/${resellerId}/organizations${this.getUrlParams(
104
+ params
105
+ )}`;
106
+
107
+ return await this.get(url);
108
+ };
109
+
110
+ return {
111
+ all,
112
+ };
113
+ }
92
114
  }
93
115
 
94
116
  export const Resellers = new ResellersApi();