lightrail-client
Advanced tools
Comparing version 4.1.0 to 4.1.1
@@ -122,3 +122,3 @@ export declare type TransactionParty = LightrailTransactionParty | StripeTransactionParty | InternalTransactionParty; | ||
maxAmount?: number; | ||
id?: string; | ||
internalId?: string; | ||
balance?: number; | ||
@@ -130,4 +130,3 @@ beforeLightrail?: boolean; | ||
code?: string; | ||
contactId?: string; | ||
valueId?: string; | ||
} |
import { PaginationHeaders } from "./PaginatedResponse"; | ||
import { Links } from "parse-link-header"; | ||
export interface LightrailResponse<T> { | ||
@@ -9,3 +8,11 @@ body: T; | ||
} | ||
export interface Link { | ||
url: string; | ||
rel: string; | ||
[queryParam: string]: string; | ||
} | ||
export interface Links { | ||
[rel: string]: Link; | ||
} | ||
export interface PaginatedLightrailResponse<T> extends LightrailResponse<T>, PaginationHeaders { | ||
} |
@@ -10,3 +10,2 @@ import { LightrailResponse } from "../LightrailResponse"; | ||
simulate?: boolean; | ||
pending?: boolean; | ||
metadata?: object; | ||
@@ -13,0 +12,0 @@ } |
@@ -11,3 +11,2 @@ import { Transaction, TransactionDestination, TransferSource } from "../../model"; | ||
allowRemainder?: boolean; | ||
pending?: boolean; | ||
metadata?: object; | ||
@@ -14,0 +13,0 @@ } |
import { LightrailResponse } from "../LightrailResponse"; | ||
import { Value } from "../../model/Value"; | ||
import { Value } from "../../model"; | ||
export interface ChangeValuesCodeParams { | ||
code: string; | ||
code?: string; | ||
generateCode?: { | ||
length: number; | ||
charset?: string; | ||
prefix?: string; | ||
suffix?: string; | ||
}; | ||
isGenericCode?: boolean; | ||
} | ||
export interface ChangeValuesCodeResponse extends LightrailResponse<Value> { | ||
} |
{ | ||
"name": "lightrail-client", | ||
"version": "4.1.0", | ||
"version": "4.1.1", | ||
"description": "A Javascript and Typescript client for Lightrail", | ||
@@ -38,7 +38,8 @@ "main": "dist/index.js", | ||
"@types/chai-as-promised": "^7.1.0", | ||
"@types/dotenv-safe": "^5.0.2", | ||
"@types/dotenv-safe": "^5.0.3", | ||
"@types/jsonwebtoken": "^8.3.0", | ||
"@types/mocha": "^5.2.5", | ||
"@types/node": "^10.12.17", | ||
"@types/superagent": "^3.8.5", | ||
"@types/node": "^10.12.24", | ||
"@types/parse-link-header": "^1.0.0", | ||
"@types/superagent": "^3.8.6", | ||
"chai": "^4.2.0", | ||
@@ -48,15 +49,14 @@ "chai-as-promised": "^7.1.1", | ||
"dotenv-safe": "^6.1.0", | ||
"mitm": "^1.5.0", | ||
"mitm": "^1.7.0", | ||
"mocha": "^5.2.0", | ||
"rimraf": "^2.6.2", | ||
"ts-node": "^7.0.1", | ||
"tslint": "^5.12.0", | ||
"typescript": "^3.2.2", | ||
"rimraf": "^2.6.3", | ||
"ts-node": "^8.0.2", | ||
"tslint": "^5.12.1", | ||
"typescript": "^3.3.3", | ||
"uuid": "^3.3.2" | ||
}, | ||
"dependencies": { | ||
"@types/parse-link-header": "^1.0.0", | ||
"jsonwebtoken": "^8.4.0", | ||
"parse-link-header": "^1.0.1", | ||
"superagent": "^3.8.1" | ||
"superagent": "^4.1.0" | ||
}, | ||
@@ -66,2 +66,2 @@ "optionalDependencies": { | ||
} | ||
} | ||
} |
@@ -5,3 +5,2 @@ # Lightrail Client for JavaScript and TypeScript | ||
## Features | ||
@@ -21,3 +20,3 @@ | ||
##### Transactions | ||
Checkout, Debit, Credit, Transfer, Get, List | ||
Checkout, Debit, Credit, Transfer, Reverse, Capture Pending, Void Pending, Get, List | ||
@@ -27,15 +26,6 @@ ##### Currencies | ||
Note that the Lightrail API supports many other features and we are still working on covering them in this library. For a complete list of Lightrail API features check out the [Lightrail API documentation](https://www.lightrail.com/docs/). | ||
## Usage | ||
# Usage | ||
### Compiling for node with webpack | ||
This library uses superagent to facilitate network requests. To have webpack use the node-version of superagent your webpack config must include `target: 'node'`. | ||
If when running your code you see the error `TypeError: undefined is not a function` then most likely you must include the following in the plugins section of your webpack config: `plugins: [new webpack.DefinePlugin({"global.GENTLY": false})]`. See https://github.com/felixge/node-formidable/issues/337 for an explanation. | ||
### Configuration | ||
@@ -49,23 +39,26 @@ | ||
Lightrail.configure({ | ||
apiKey: <LIGHTRAIL API KEY> | ||
apiKey: '<LIGHTRAIL API KEY>' | ||
}) | ||
``` | ||
## Testing | ||
### Compiling for node with webpack | ||
**IMPORTANT: note that several environment variables are required for the tests to run.** After cloning the repo, `npm install` dependencies and set the following (either in a `.env` file in the root directory or however you prefer to set environment variables): | ||
This library uses superagent to facilitate network requests. To have webpack use the node-version of superagent your webpack config must include `target: 'node'`. | ||
- `LIGHTRAIL_API_PATH`: set to `https://api.lightrail.com/v2` | ||
- `LIGHTRAIL_API_KEY`: find this in to the Lightrail web app -- go to your [account settings](https://www.lightrail.com/app/#/account/profile), then click 'Integrations' and 'Generate Key.' **Note** that for running tests, you should use a test mode key. | ||
If when running your code you see the error `TypeError: undefined is not a function` then most likely you must include the following in the plugins section of your webpack config: `plugins: [new webpack.DefinePlugin({"global.GENTLY": false})]`. See https://github.com/felixge/node-formidable/issues/337 for an explanation. | ||
## Development | ||
### Testing | ||
Testing requires a Lightrail account. Copy `.env.example` to `.env` and set your account's test API key which is available in the Lightrail web app. | ||
Then you can run `npm test`. | ||
### Contributing | ||
## Contributing | ||
Bug reports and pull requests are welcome on GitHub at <https://github.com/Giftbit/lightrail-client-javascript>. | ||
## License | ||
This library is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
1927
83599
19
61
+ Addeddebug@4.3.7(transitive)
+ Addedmime@2.6.0(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
+ Addedsuperagent@4.1.0(transitive)
- Removed@types/parse-link-header@^1.0.0
- Removed@types/parse-link-header@1.0.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removeddebug@3.2.7(transitive)
- Removedextend@3.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedmime@1.6.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedsuperagent@3.8.3(transitive)
Updatedsuperagent@^4.1.0