@veritree/services 2.1.0 → 2.2.1
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 +4 -1
- package/src/endpoints/orgs.js +5 -0
- package/src/helpers/api.js +2 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veritree/services",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "A collection of javascript functions/services to talk to veritree API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -9,5 +9,8 @@
|
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"np": "^7.6.2"
|
|
12
15
|
}
|
|
13
16
|
}
|
package/src/endpoints/orgs.js
CHANGED
|
@@ -18,6 +18,11 @@ class OrgsApi extends Api {
|
|
|
18
18
|
return await this.get(url);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
+
async emails(orgId, data) {
|
|
22
|
+
const url = `${this.getUrl()}/${orgId}/emails${this.getUrlParams()}`;
|
|
23
|
+
return await this.post(url, data);
|
|
24
|
+
}
|
|
25
|
+
|
|
21
26
|
async stats() {
|
|
22
27
|
const url = `${this._geStatstUrl()}`;
|
|
23
28
|
return await this.get(url);
|
package/src/helpers/api.js
CHANGED
|
@@ -134,9 +134,7 @@ export default class Api {
|
|
|
134
134
|
* @returns {promise}
|
|
135
135
|
*/
|
|
136
136
|
async post(url, data, as, args) {
|
|
137
|
-
// console.log(args);
|
|
138
137
|
if (!url) url = `${this.getUrl()}${this.getUrlParams(args)}`;
|
|
139
|
-
console.log(url);
|
|
140
138
|
return await this.unWrap(url, "post", data, as);
|
|
141
139
|
}
|
|
142
140
|
|
|
@@ -174,8 +172,8 @@ export default class Api {
|
|
|
174
172
|
// and for that, we can't use the org id and type in
|
|
175
173
|
// the session.
|
|
176
174
|
if(isOrgAs) {
|
|
177
|
-
orgIdParam = `
|
|
178
|
-
orgTypeParam =
|
|
175
|
+
orgIdParam = `org_id=${args.org_id_as}`;
|
|
176
|
+
orgTypeParam = `&org_type=${args.org_type_as}`;
|
|
179
177
|
}
|
|
180
178
|
|
|
181
179
|
if (!isOrgLess && !isOrgAs) {
|