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

Fix comments import; standardizes npm scripts #1

Merged
merged 4 commits into from
May 9, 2019
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"license": "MIT",
"private": false,
"scripts": {
"clean": "find -maxdepth 1 \\( -name \"*.js\" -or -name \"*.d.ts\" \\) -type f -not -name rollup.config.js -delete",
"clean": "rimraf './!(rollup.config).js' './*.d.ts'",
"prebuild": "npm run clean",
"build": "concurrently \"rollup -c\" \"tsc --emitDeclarationOnly\"",
"prepack": "npm run build"
"prepare": "npm run build"
},
"browser": "./browser.js",
"devDependencies": {
Expand All @@ -34,6 +34,7 @@
"lodash": "^4.17.11",
"promise-limit": "^2.7.0",
"querystring": "^0.2.0",
"rimraf": "^2.6.3",
"rollup": "^1.11.3",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.3.4",
Expand Down
20 changes: 12 additions & 8 deletions src/web-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,18 @@ type FormPrepare = (data: Form | FormData | undefined | null) => FormData | unde
* se comunicar com a BIPBOP com facilidade usando o esquema fetch
* https://developer.mozilla.org/pt-BR/docs/Web/API/Fetch_API/Using_Fetch
*
* ```ts
* import WebService from 'bipbop-webservice'
* const maxClients: number = 10;
* const fetchOptions: RequestInit = {}; // https://developer.mozilla.org/pt-BR/docs/Web/API/Fetch_API/Using_Fetch
* const webService: WebService = new WebService('bipbop-apikey', maxClients, fetchOptions);
* const response: Response = await webService.request("SELECT FROM 'INFO'.'INFO'");
* const responseBody: string = await response.text();
* console.log(responseBody);
* @example
* ```typescript
*import WebService from 'bipbop-webservice/web-service';
*
*const maxClients = 10;
*const fetchOptions: RequestInit = {}; // https://developer.mozilla.org/pt-BR/docs/Web/API/Fetch_API/Using_Fetch
*const apiKey = '<secret>'; // Chave de API da BIPBOP (https://www.bipbop.com.br)
*
*new WebService(apiKey, maxClients, fetchOptions)
* .request("SELECT FROM 'INFO'.'INFO'")
* .then(r => r.text())
* .then(r => console.log(r));
* ```
*/
export default class WebService {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2729,7 +2729,7 @@ ret@~0.1.10:
version "0.1.15"
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"

rimraf@2.6.3:
rimraf@2.6.3, rimraf@^2.6.3:
version "2.6.3"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab"
integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==
Expand Down