Skip to content

Commit

Permalink
Merge pull request #94 from fingerprintjs/feature/inter-577
Browse files Browse the repository at this point in the history
Sync Node SDK with Big Schema Update
  • Loading branch information
Orkuncakilkaya committed Mar 22, 2024
2 parents 4b5a306 + 8b784be commit b25f85e
Show file tree
Hide file tree
Showing 11 changed files with 1,108 additions and 4,125 deletions.
4,352 changes: 602 additions & 3,750 deletions resources/fingerprint-server-api.yaml

Large diffs are not rendered by default.

593 changes: 322 additions & 271 deletions src/generatedApiTypes.ts

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions sync.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/bin/bash

curl -o ./resources/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api.yaml
curl -o ./resources/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api-compact.yaml

examplesList=(
'visits_limit_1.json'
'webhook.json'
'get_event.json'
'get_event_all_errors.json'
'get_event_extra_fields.json'
'get_event_200.json'
'get_event_200_all_errors.json'
'get_event_200_extra_fields.json'
'get_event_403_error.json'
'get_event_404_error.json'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ Object {
"rootApps": Object {
"result": false,
},
"suspectScore": Object {
"result": 0,
},
"tag": Object {
"requestType": "signup",
"yourCustomId": 45321,
Expand All @@ -184,6 +187,7 @@ Object {
"publicVPN": false,
"timezoneMismatch": false,
},
"originCountry": "unknown",
"originTimezone": "Europe/Berlin",
"result": false,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ Object {
"result": "notDetected",
},
"ip": "61.127.217.15",
"requestId": "1708102555327.NLOjmg",
"time": "2019-05-21T16:40:13Z",
"url": "https://www.example.com/login",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36",
},
},
"identification": Object {
Expand Down Expand Up @@ -70,6 +72,7 @@ Object {
},
"linkedId": "somelinkedId",
"requestId": "0KSh65EnVoB85JBmloQK",
"tag": Object {},
"time": "2019-05-21T16:40:13Z",
"timestamp": 1582299576512,
"url": "https://www.example.com/login",
Expand Down Expand Up @@ -129,6 +132,12 @@ Object {
"message": "internal server error",
},
},
"highActivity": Object {
"error": Object {
"code": "Failed",
"message": "internal server error",
},
},
"identification": Object {
"error": Object {
"code": "Failed",
Expand Down Expand Up @@ -159,6 +168,12 @@ Object {
"message": "internal server error",
},
},
"locationSpoofing": Object {
"error": Object {
"code": "Failed",
"message": "internal server error",
},
},
"privacySettings": Object {
"error": Object {
"code": "Failed",
Expand Down Expand Up @@ -193,6 +208,12 @@ Object {
"message": "internal server error",
},
},
"suspectScore": Object {
"error": Object {
"code": "Failed",
"message": "internal server error",
},
},
"tampering": Object {
"error": Object {
"code": "Failed",
Expand Down Expand Up @@ -230,8 +251,10 @@ Object {
"result": "notDetected",
},
"ip": "61.127.217.15",
"requestId": "1708102555327.NLOjmg",
"time": "2019-05-21T16:40:13Z",
"url": "https://www.example.com/login",
"url": "https://www.example.com/login?hope{this{works}[!",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36",
},
},
"clonedApp": Object {
Expand Down Expand Up @@ -305,15 +328,16 @@ Object {
"timezone": "Europe/Dusseldorf",
},
"lastSeenAt": Object {
"global": "2022-03-16T11:28:34.023Z",
"global": null,
"subscription": null,
},
"linkedId": "somelinkedId",
"requestId": "0KSh65EnVoB85JBmloQK",
"requestId": "1708102555327.NLOjmg",
"tag": Object {},
"time": "2019-05-21T16:40:13Z",
"timestamp": 1582299576512,
"url": "https://www.example.com/login",
"visitorFound": true,
"url": "https://www.example.com/login?hope{this{works[!",
"visitorFound": false,
"visitorId": "Ibk1527CUFmcnjLwIs4A9",
},
},
Expand Down Expand Up @@ -369,6 +393,42 @@ Object {
"timezone": "Europe/Prague",
},
},
"v6": Object {
"address": "2001:db8:3333:4444:5555:6666:7777:8888",
"asn": Object {
"asn": "6805",
"name": "Telefonica Germany",
"network": "2a02:3100::/24",
},
"datacenter": Object {
"name": "",
"result": false,
},
"geolocation": Object {
"accuracyRadius": 5,
"city": Object {
"name": "Berlin",
},
"continent": Object {
"code": "EU",
"name": "Europe",
},
"country": Object {
"code": "DE",
"name": "Germany",
},
"latitude": 49.982,
"longitude": 36.2566,
"postalCode": "10112",
"subdivisions": Array [
Object {
"isoCode": "BE",
"name": "Land Berlin",
},
],
"timezone": "Europe/Berlin",
},
},
},
},
"jailbroken": Object {
Expand Down Expand Up @@ -410,14 +470,23 @@ Object {
"value": 30,
},
"colorGamut": Object {
"value": "srgb",
"value": "p3",
},
"contrast": Object {
"value": 0,
},
"cookiesEnabled": Object {
"value": true,
},
"cpuClass": Object {},
"fonts": Object {
"value": Array [
"Arial Unicode MS",
"Gill Sans",
"Helvetica Neue",
"Menlo",
],
},
},
},
"rootApps": Object {
Expand All @@ -427,7 +496,7 @@ Object {
},
"tampering": Object {
"data": Object {
"anomalyScore": 0,
"anomalyScore": 0.1955,
"result": false,
},
},
Expand All @@ -448,6 +517,7 @@ Object {
"publicVPN": false,
"timezoneMismatch": false,
},
"originCountry": "unknown",
"originTimezone": "Europe/Berlin",
"result": false,
},
Expand Down
6 changes: 3 additions & 3 deletions tests/mocked-responses-tests/getEventTests.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import fetch from 'node-fetch';
import { Region } from '../../src/types';
import { FingerprintJsServerApiClient } from '../../src/serverApiClient';
import getEventResponse from './mocked-responses-data/external/get_event.json';
import getEventWithExtraFieldsResponse from './mocked-responses-data/external/get_event_extra_fields.json';
import getEventAllErrorsResponse from './mocked-responses-data/external/get_event_all_errors.json';
import getEventResponse from './mocked-responses-data/external/get_event_200.json';
import getEventWithExtraFieldsResponse from './mocked-responses-data/external/get_event_200_extra_fields.json';
import getEventAllErrorsResponse from './mocked-responses-data/external/get_event_200_all_errors.json';

const { Response } = jest.requireActual('node-fetch');
jest.mock('node-fetch');
Expand Down
Loading

0 comments on commit b25f85e

Please sign in to comment.