-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from fingerprintjs/refactor/inter-543-3
Upgrade Node SDK
- Loading branch information
Showing
38 changed files
with
7,423 additions
and
9,800 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,3 @@ | ||
{ | ||
"env": { | ||
"es6": true, | ||
"node": true | ||
}, | ||
"extends": ["plugin:@typescript-eslint/eslint-recommended"], | ||
"globals": { | ||
"Atomics": "readonly", | ||
"SharedArrayBuffer": "readonly" | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 11, | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint", "prettier"], | ||
"rules": { | ||
"linebreak-style": ["error", "unix"], | ||
"prefer-const": "error", | ||
"prettier/prettier": "error", | ||
"@typescript-eslint/no-unused-vars": [ | ||
"error" | ||
], | ||
"curly": [2, "all"] | ||
} | ||
} | ||
"extends": ["@fingerprintjs/eslint-config-dx-team"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"@fingerprintjs/prettier-config-dx-team" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -104,7 +104,7 @@ | |
[ | ||
"@semantic-release/exec", | ||
{ | ||
"prepareCmd": "yarn build" | ||
"prepareCmd": "pnpm build" | ||
} | ||
], | ||
[ | ||
|
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths. | ||
# See https://help.github.com/articles/about-code-owners/ | ||
|
||
* @ilfa @makma | ||
* @ilfa @makma @Orkuncakilkaya |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; | ||
module.exports = { extends: ['@fingerprintjs/commit-lint-dx-team'] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,36 @@ | ||
/** | ||
* @type {import('@fingerprintjs/fingerprintjs-pro-server-api')} | ||
**/ | ||
const { | ||
FingerprintJsServerApiClient, | ||
Region, | ||
} = require('@fingerprintjs/fingerprintjs-pro-server-api'); | ||
require('dotenv').config(); | ||
const { FingerprintJsServerApiClient, Region } = require('@fingerprintjs/fingerprintjs-pro-server-api') | ||
require('dotenv').config() | ||
|
||
const apiKey = process.env.API_KEY || 'API key not defined'; | ||
const visitorId = process.env.VISITOR_ID || 'Visitor ID not defined'; | ||
const requestId = process.env.REQUEST_ID || 'Request ID not defined'; | ||
const envRegion = process.env.REGION; | ||
const apiKey = process.env.API_KEY || 'API key not defined' | ||
const visitorId = process.env.VISITOR_ID || 'Visitor ID not defined' | ||
const requestId = process.env.REQUEST_ID || 'Request ID not defined' | ||
const envRegion = process.env.REGION | ||
|
||
let region = Region.Global; | ||
let region = Region.Global | ||
if (envRegion === 'eu') { | ||
region = Region.EU; | ||
region = Region.EU | ||
} else if (envRegion === 'ap') { | ||
region = Region.AP; | ||
region = Region.AP | ||
} | ||
|
||
const client = new FingerprintJsServerApiClient({ region, apiKey: apiKey }); | ||
const client = new FingerprintJsServerApiClient({ region, apiKey: apiKey }) | ||
|
||
async function main() { | ||
try { | ||
const [visitorHistory, event] = await Promise.all([ | ||
client.getVisitorHistory(visitorId, { limit: 1 }), | ||
client.getEvent(requestId), | ||
]); | ||
]) | ||
|
||
console.log(JSON.stringify(visitorHistory, null, 2)); | ||
console.log(JSON.stringify(event, null, 2)); | ||
console.log(JSON.stringify(visitorHistory, null, 2)) | ||
console.log(JSON.stringify(event, null, 2)) | ||
} catch (e) { | ||
console.error(e); | ||
process.exit(1); | ||
console.error(e) | ||
process.exit(1) | ||
} | ||
} | ||
|
||
main(); | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */ | ||
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testRegex: './tests/.*.ts$', | ||
collectCoverageFrom: ['./src/**.{ts,tsx}'], | ||
testRegex: '/tests/.+spec.ts?$', | ||
collectCoverageFrom: ['./src/**/**.{ts,tsx}'], | ||
coverageReporters: ['lcov', 'json-summary', ['text', { file: 'coverage.txt', path: './' }]], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.