Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce type checking during CI build #135

Merged
merged 3 commits into from
Jul 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npx tsc --noEmit --lib es2015 types/index.d.ts
- run: npm run build --if-present
- run: npm test
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
All notable changes to omise-node project will be documented in this file.
Use [Semantic Versioning](http://semver.org/).

## 0.8.2 - 2020-07-23
- Add missing typescript definitions.

## 0.8.1 - 2020-07-20
- Add `Charge.expire` API.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "omise",
"version": "0.8.1",
"version": "0.8.2",
"description": "Omise Node.js bindings",
"main": "index.js",
"types": "types/index.d.ts",
Expand Down
17 changes: 16 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@ declare namespace Omise {
country: string;
zero_interest_installments: boolean;
}

interface IRequest {
chain_enabled?: boolean;
chain_return_uri?: string;
metadata_export_keys?: object;
webhook_uri?: string;
zero_interest_installments?: boolean;
}
}

export namespace Balance {
Expand Down Expand Up @@ -119,7 +127,7 @@ declare namespace Omise {
capture(chargeID: string, callback?: ResponseCallback<ICharge>): Bluebird<ICharge>;
reverse(chargeID: string, callback?: ResponseCallback<ICharge>): Bluebird<ICharge>;
expire(chargeID: string, callback?: ResponseCallback<ICharge>): Bluebird<ICharge>;
createRefund(chargeID: string, callback?: ResponseCallback<IRefundResponse>): Bluebird<IRefundResponse>;
createRefund(chargeID: string, req: IRefundRequest, callback?: ResponseCallback<IRefundResponse>): Bluebird<IRefundResponse>;
listRefunds(chargeID: string, callback?: ResponseCallback<IListRefundResponse>): Bluebird<IListRefundResponse>;
retrieveRefund(chargeID: string, refundID: string, callback?: ResponseCallback<IRefundResponse>): Bluebird<IRefundResponse>;
}
Expand Down Expand Up @@ -166,13 +174,20 @@ declare namespace Omise {
data: ICharge[];
}

interface IRefundRequest {
amount: number;
metadata?: { [key: string]: any };
void?: boolean
}

interface IRefundResponse extends IBaseResponse {
amount: number;
currency: string;
charge: string;
transaction: string;
created: string;
voided: boolean;
metadata?: { [key: string]: any };
}
}

Expand Down