Skip to content

Commit 8ab0f68

Browse files
authored
Add verifier to projects (#50)
* Add verifier to projects * Update dependency
1 parent 7c59662 commit 8ab0f68

File tree

9 files changed

+1203
-4431
lines changed

9 files changed

+1203
-4431
lines changed

.mocharc.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
require: '@babel/register'
2-
recursive: true
32
timeout: '10000'
3+
recursive: true
4+
spec:
5+
- 'test/**/*.test.js'

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.15.1] - 2021-11-04
9+
10+
### Added
11+
12+
- Adds verifier to project responses
13+
814
## [1.15.0] - 2021-10-04
915

1016
### Added

package-lock.json

+1,175-4,413
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
{
22
"name": "@patch-technology/patch",
3-
"version": "1.15.0",
3+
"version": "1.15.1",
44
"description": "Node.js wrapper for the Patch API",
55
"license": "MIT",
66
"repository": {
77
"type": "git",
88
"url": "https://github.com/patch-technology/patch-node.git"
99
},
1010
"main": "dist/index.js",
11-
"scripts": {
12-
"build": "babel src -d dist",
13-
"prepare": "npm run build",
14-
"test": "mocha"
15-
},
1611
"browser": {
1712
"fs": false
1813
},
@@ -30,8 +25,8 @@
3025
"superagent": "^5.3.1"
3126
},
3227
"devDependencies": {
33-
"@babel/cli": "^7.0.0",
34-
"@babel/core": "^7.0.0",
28+
"@babel/cli": "^7.16.0",
29+
"@babel/core": "^7.16.0",
3530
"@babel/plugin-proposal-class-properties": "^7.0.0",
3631
"@babel/plugin-proposal-decorators": "^7.0.0",
3732
"@babel/plugin-proposal-do-expressions": "^7.0.0",
@@ -48,12 +43,12 @@
4843
"@babel/plugin-proposal-throw-expressions": "^7.0.0",
4944
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
5045
"@babel/plugin-syntax-import-meta": "^7.0.0",
51-
"@babel/preset-env": "^7.0.0",
52-
"@babel/register": "^7.0.0",
53-
"chai": "^4.2.0",
46+
"@babel/preset-env": "^7.16.0",
47+
"@babel/register": "^7.16.0",
48+
"chai": "^4.3.0",
5449
"husky": "^4.2.5",
5550
"lint-staged": "^10.5.4",
56-
"mocha": "^8.1.0",
51+
"mocha": "^9.1.0",
5752
"sinon": "^7.2.0",
5853
"prettier": "^2.0.5"
5954
},

src/ApiClient.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ApiClient {
1616
};
1717

1818
this.defaultHeaders = {
19-
'User-Agent': 'patch-node/1.15.0'
19+
'User-Agent': 'patch-node/1.15.1'
2020
};
2121

2222
/**

src/model/Project.js

+6
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ class Project {
132132
);
133133
}
134134

135+
if (data.hasOwnProperty('verifier')) {
136+
obj['verifier'] = ApiClient.convertToType(data['verifier'], 'String');
137+
}
138+
135139
if (data.hasOwnProperty('standard')) {
136140
obj['standard'] = ApiClient.convertToType(data['standard'], Standard);
137141
}
@@ -182,6 +186,8 @@ Project.prototype['average_price_per_tonne_cents_usd'] = undefined;
182186

183187
Project.prototype['remaining_mass_g'] = undefined;
184188

189+
Project.prototype['verifier'] = undefined;
190+
185191
Project.prototype['standard'] = undefined;
186192

187193
Project.prototype['sdgs'] = undefined;

test/integration/orders.test.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ describe('Orders Integration', function () {
2828

2929
it('supports placing orders in a `draft` state', async function () {
3030
const estimateResponse = await patch.estimates.createMassEstimate({
31-
mass_g: 100
31+
mass_g: 100,
32+
create_order: true
3233
});
3334
const orderId = estimateResponse.data.order.id;
3435
expect(estimateResponse.data.order.state).to.equal('draft');
@@ -41,7 +42,8 @@ describe('Orders Integration', function () {
4142

4243
it('supports cancelling orders in a `draft` state', async function () {
4344
const estimateResponse = await patch.estimates.createMassEstimate({
44-
mass_g: 100
45+
mass_g: 100,
46+
create_order: true
4547
});
4648
const orderId = estimateResponse.data.order.id;
4749
expect(estimateResponse.data.order.state).to.equal('draft');

test/integration/projects.test.js

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ describe('Project Integration', function () {
1818
expect(projectResponse.data).to.be.have.property('tagline');
1919

2020
expect(projectResponse.data.mechanism).to.be.a('string');
21-
expect(projectResponse.data.state).to.be.a('string');
2221
expect(projectResponse.data.latitude).to.be.a('number');
2322
expect(projectResponse.data.longitude).to.be.a('number');
2423

test/integration/projects/technology_types.test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Patch from '../../../dist/index';
33
const patch = Patch(process.env.SANDBOX_API_KEY);
44

55
describe('Projects TechnologyTypes Integration', function () {
6-
it.only('supports fetching the available technology_types', async function () {
6+
it('supports fetching the available technology_types', async function () {
77
const { data } = await patch.technologytypes.retrieveTechnologyTypes();
88
expect(data.length).to.be.above(0);
99
expect(data[0].name).to.be.a('string');

0 commit comments

Comments
 (0)