Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into pr/yanivfranco/862
Browse files Browse the repository at this point in the history
  • Loading branch information
baruchiro committed Jul 7, 2024
2 parents 1aad15b + 3b9301a commit cda66f1
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
41 changes: 21 additions & 20 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module.exports = {
root: true,
'rules': {
rules: {
'import/prefer-default-export': 0,
'no-multiple-empty-lines':0,
'no-multiple-empty-lines': 0,
'no-nested-ternary': 0,
'class-methods-use-this': 0,
'arrow-body-style': 0,
Expand All @@ -16,14 +16,15 @@ module.exports = {
],
'operator-linebreak': ['error', 'after'],
'max-len': ['error', 120, 2, {
'ignoreUrls': true,
'ignoreComments': true,
'ignoreRegExpLiterals': true,
'ignoreStrings': true,
'ignoreTemplateLiterals': true,
'ignorePattern': '^(async )?function ',
ignoreUrls: true,
ignoreComments: true,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignorePattern: '^(async )?function ',
}],
'linebreak-style': process.platform === 'win32' ? 0 : 2,
'quote-props': ['error', 'consistent-as-needed'],
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/ban-ts-ignore': 0,
Expand All @@ -40,7 +41,7 @@ module.exports = {
'@typescript-eslint/consistent-type-imports': ['error', {
fixStyle: 'inline-type-imports',
}],
'@typescript-eslint/member-delimiter-style': [ 'error', {
'@typescript-eslint/member-delimiter-style': ['error', {
multiline: {
delimiter: 'semi',
requireLast: true,
Expand All @@ -51,25 +52,25 @@ module.exports = {
},
}],
},
'globals': {
'document': true,
'window': true,
'fetch': true,
'Headers': true,
globals: {
document: true,
window: true,
fetch: true,
Headers: true,
},
'env': {
'jest': true,
env: {
jest: true,
},
parserOptions: {
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
},
extends: ['airbnb-typescript/base',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/errors',
],

};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ import { CompanyTypes, createScraper } from 'israeli-bank-scrapers';
})();
```

Check the options declaration [here](./src/scrapers/base-scraper.ts) for available options.
Check the options declaration [here](./src/scrapers/interface.ts#L29) for available options.

Regarding credentials, you should provide the relevant credentials for the chosen company. See [this file](./src/definitions.ts) with list of credentials per company.

Expand Down
2 changes: 1 addition & 1 deletion src/helpers/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const JSON_CONTENT_TYPE = 'application/json';

function getJsonHeaders() {
return {
Accept: JSON_CONTENT_TYPE,
'Accept': JSON_CONTENT_TYPE,
'Content-Type': JSON_CONTENT_TYPE,
};
}
Expand Down
4 changes: 2 additions & 2 deletions src/scrapers/behatsdaa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ class BehatsdaaScraper extends BaseScraperWithBrowser<ScraperSpecificCredentials
debug('Fetching data');

const res = await fetchPostWithinPage<PurchaseHistoryResponse>(this.page, PURCHASE_HISTORY_URL, body, {
authorization: `Bearer ${token}`,
'authorization': `Bearer ${token}`,
'Content-Type': 'application/json',
organizationid: '20',
'organizationid': '20',
});

debug('Data fetched');
Expand Down
3 changes: 2 additions & 1 deletion src/scrapers/mizrahi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ function createDataFromRequest(request: HTTPRequest, optionsStartDate: Date) {

function createHeadersFromRequest(request: HTTPRequest) {
return {
mizrahixsrftoken: request.headers().mizrahixsrftoken,
'mizrahixsrftoken': request.headers().mizrahixsrftoken,
'Content-Type': request.headers()['content-type'],
};
}
Expand Down Expand Up @@ -216,6 +216,7 @@ class MizrahiScraper extends BaseScraperWithBrowser<ScraperSpecificCredentials>
}

private async fetchAccount() {
await this.page.waitForSelector(`a[href*="${OSH_PAGE}"]`);
await this.page.$eval(`a[href*="${OSH_PAGE}"]`, (el) => (el as HTMLElement).click());
await waitUntilElementFound(this.page, `a[href*="${TRANSACTIONS_PAGE}"]`);
await this.page.$eval(`a[href*="${TRANSACTIONS_PAGE}"]`, (el) => (el as HTMLElement).click());
Expand Down

0 comments on commit cda66f1

Please sign in to comment.