@veritree/services 2.50.0 → 2.51.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
@@ -11,6 +11,7 @@ import { Initiatives } from './src/endpoints/initiatives';
11
11
  import { Methodologies } from './src/endpoints/methodologies';
12
12
  import { Notes } from './src/endpoints/notes';
13
13
  import { Orgs } from './src/endpoints/orgs';
14
+ import { Pins } from './src/endpoints/pins';
14
15
  import { Regions } from './src/endpoints/regions';
15
16
  import { Resellers } from './src/endpoints/resellers';
16
17
  import { SDGs } from './src/endpoints/sdgs';
@@ -54,6 +55,7 @@ export {
54
55
  Methodologies,
55
56
  Notes,
56
57
  Orgs,
58
+ Pins,
57
59
  Regions,
58
60
  Resellers,
59
61
  SDGs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veritree/services",
3
- "version": "2.50.0",
3
+ "version": "2.51.0",
4
4
  "description": "A collection of javascript functions/services to talk to veritree API",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -55,14 +55,17 @@ class OrganizationsApi extends Api {
55
55
  return { all };
56
56
  }
57
57
 
58
- pins(orgId){
58
+ pins(orgId) {
59
59
  const single = async (pinId, params) => {
60
60
  const url = `${this.getUrl()}/${orgId}/pins/${pinId}${this.getUrlParams(
61
61
  params
62
- )}`;
63
- return await this.get(url)
62
+ )}`;
63
+ return await this.get(url);
64
+ };
65
+
66
+ return {
67
+ single,
64
68
  };
65
- return {single}
66
69
  }
67
70
 
68
71
  metrics(orgId) {
@@ -0,0 +1,21 @@
1
+ import Api from '../helpers/api';
2
+
3
+ class PinsApi extends Api {
4
+ constructor(resource) {
5
+ super(resource);
6
+ this.resource = 'pins';
7
+ }
8
+
9
+ evidence(pinId) {
10
+ const all = async (args) => {
11
+ const url = `${this.getUrl()}/${pinId}/evidence/${this.getUrlParams(
12
+ args
13
+ )}`;
14
+ return await this.get(url);
15
+ };
16
+
17
+ return { all };
18
+ }
19
+ }
20
+
21
+ export const Pins = new PinsApi();