diff --git a/.github/workflows/funcitonal_tests.yml b/.github/workflows/funcitonal_tests.yml index 95de5475..5d61951d 100644 --- a/.github/workflows/funcitonal_tests.yml +++ b/.github/workflows/funcitonal_tests.yml @@ -39,7 +39,8 @@ jobs: runs-on: ubuntu-latest strategy: - max-parallel: 1 + max-parallel: 3 + fail-fast: false matrix: node-version: [ 10, 12, 14, 16, 17, 18, 19 ] diff --git a/.gitignore b/.gitignore index e4351645..1a82777f 100644 --- a/.gitignore +++ b/.gitignore @@ -116,6 +116,9 @@ dist # Idea files .idea +# VSCode +.vscode + # yarn v2 .yarn/cache .yarn/unplugged diff --git a/example/index.js b/example/index.js index ff4ceaeb..a8f37656 100644 --- a/example/index.js +++ b/example/index.js @@ -1,3 +1,6 @@ +/** + * @type {import('@fingerprintjs/fingerprintjs-pro-server-api')} + **/ const { FingerprintJsServerApiClient, Region, diff --git a/resources/fingerprint-server-api.yaml b/resources/fingerprint-server-api.yaml index 7ece24c4..f6965269 100644 --- a/resources/fingerprint-server-api.yaml +++ b/resources/fingerprint-server-api.yaml @@ -47,13 +47,15 @@ paths: operationId: getEvent summary: Get event by requestId description: > - This endpoint allows you to retrieve an individual analysis event with - all the information from each activated product (Identification, Bot - Detection, and others). + This endpoint allows you to get a detailed analysis of an individual + request. - Products that are not activated for your application or not relevant to - the event's detected platform (web, iOS, Android) are not included in - the response. + **Only for Enterprise customers:** Please note that the response + includes mobile signals (e.g. `rootApps`) even if the request orignated + from a non-mobile platform. + + It is highly recommended that you **ignore** the mobile signals for such + requests. Use `requestId` as the URL path parameter. This API method is scoped to @@ -184,6 +186,44 @@ paths: data: result: false anomalyScore: 0 + clonedApp: + data: + result: false + factoryReset: + data: + time: '1970-01-01T00:00:00Z' + timestamp: 0 + jailbroken: + data: + result: false + frida: + data: + result: false + privacySettings: + data: + result: false + virtualMachine: + data: + result: false + rawDeviceAttributes: + data: + architecture: + value: 127 + audio: + value: 35.73832903057337 + canvas: + value: + Winding: true + Geometry: 4dce9d6017c3e0c052a77252f29f2b1c + Text: dd2474a56ff78c1de3e7a07070ba3b7d + colorDepth: + value: 30 + colorGamut: + value: srgb + contrast: + value: 0 + cookiesEnabled: + value: true allErrorsResponse: summary: All failed signals value: @@ -3630,6 +3670,37 @@ paths: tampering: result: false anomalyScore: 0 + clonedApp: + result: false + factoryReset: + time: '1970-01-01T00:00:00Z' + timestamp: 0 + jailbroken: + result: false + frida: + result: false + privacySettings: + result: false + virtualMachine: + result: false + rawDeviceAttributes: + architecture: + value: 127 + audio: + value: 35.73832903057337 + canvas: + value: + Winding: true + Geometry: 4dce9d6017c3e0c052a77252f29f2b1c + Text: dd2474a56ff78c1de3e7a07070ba3b7d + colorDepth: + value: 30 + colorGamut: + value: srgb + contrast: + value: 0 + cookiesEnabled: + value: true responses: default: description: The server doesn't validate the answer. @@ -3847,10 +3918,8 @@ components: description: > Android specific root management apps detection. There are 2 values: • `true` - Root Management Apps detected (e.g. Magisk) • - `false` - No Root Management Apps detected - - Available only for events from Android client. The field will - not be present for a browser or iOS event. + `false` - No Root Management Apps detected or the client isn't + Android. example: false emulator: title: WebhookSignalResponseEmulator @@ -3861,10 +3930,63 @@ components: description: > Android specific emulator detection. There are 2 values: • `true` - Emulated environment detected (e.g. launch inside of - AVD) • `false` - No signs of emulated environment detected - - Available only for events from Android client. The field will - not be present for a browser or iOS event. + AVD) • `false` - No signs of emulated environment detected or + the client isn't Android. + example: false + clonedApp: + title: WebhookSignalResponseClonedApp + type: object + properties: + result: + type: boolean + description: > + Android specific cloned application detection. There are 2 + values: • `true` - Presence of app cloners work detected (e.g. + fully cloned application found or launch of it inside of a not + main working profile detected). • `false` - No signs of cloned + application detected or the client is not Android. + example: false + factoryReset: + title: WebhookSignalResponseFactoryReset + type: object + properties: + time: + title: Time + description: > + Time in UTC for the Android client when recent factory reset was + done. If there is no sign of factory reset or the client isn't + Android, the field will be epoch time. + type: string + format: date-time + example: '2022-06-09T22:58:36Z' + timestamp: + description: >- + Same value as it's in the `time` field but represented in + timestamp format. + type: integer + format: int64 + example: 1654815517198 + jailbroken: + title: WebhookSignalResponseJailbroken + type: object + properties: + result: + type: boolean + description: > + iOS specific jailbreak detection. There are 2 values: • `true` - + Jailbreak detected • `false` - No signs of jailbreak or the + client is not iOS. + example: false + frida: + title: WebhookSignalResponseFrida + type: object + properties: + result: + type: boolean + description: > + iOS specific [Frida](https://frida.re/docs/ios/) detection. + There are 2 values: • `true` - Frida detected • `false` - No + signs of Frida or the client is not iOS. example: false ipBlocklist: $ref: '#/components/schemas/IpBlockListResult' @@ -3878,6 +4000,27 @@ components: `true` if the request IP address is a known tor exit node, `false` otherwise. example: false + privacySettings: + title: WebhookSignalResponsePrivacySettings + type: object + properties: + result: + type: boolean + description: > + `true` if the request is from a privacy aware browser (e.g. Tor) + or from a browser in which fingerprinting is blocked. Otherwise + `false`. + example: false + virtualMachine: + title: WebhookSignalResponseVirtualMachine + type: object + properties: + result: + type: boolean + description: > + `true` if the request came from a browser running inside a + virtual machine (e.g. VMWare), `false` otherwise. + example: false vpn: $ref: '#/components/schemas/VpnResult' proxy: @@ -3892,6 +4035,8 @@ components: example: false tampering: $ref: '#/components/schemas/TamperingResult' + rawDeviceAttributes: + $ref: '#/components/schemas/RawDeviceAttributesResult' requestId: description: Unique identifier of the user's identification request. type: string @@ -4297,10 +4442,8 @@ components: description: > Android specific root management apps detection. There are 2 values: • `true` - Root Management Apps detected (e.g. - Magisk) • `false` - No Root Management Apps detected - - Available only for events from Android client. The field - will not be present for a browser or iOS event. + Magisk) • `false` - No Root Management Apps detected or the + client is not Android. example: false error: $ref: '#/components/schemas/ProductError' @@ -4317,10 +4460,83 @@ components: Android specific emulator detection. There are 2 values: • `true` - Emulated environment detected (e.g. launch inside of AVD) • `false` - No signs of emulated environment - detected - - Available only for events from Android client. The field - will not be present for a browser or iOS event. + detected or the client is not Android. + example: false + error: + $ref: '#/components/schemas/ProductError' + clonedApp: + title: SignalResponseClonedApp + type: object + properties: + data: + type: object + properties: + result: + type: boolean + description: > + Android specific cloned application detection. There are 2 + values: • `true` - Presence of app cloners work detected + (e.g. fully cloned application found or launch of it inside + of a not main working profile detected). • `false` - No + signs of cloned application detected or the client is not + Android. + example: false + error: + $ref: '#/components/schemas/ProductError' + factoryReset: + title: SignalResponseFactoryReset + type: object + properties: + data: + type: object + properties: + time: + title: Time + description: > + Time in UTC for the Android client when recent factory reset + was done. If there is no sign of factory reset or the + client isn't Android, the field will be epoch time. + type: string + format: date-time + example: '2022-06-09T22:58:36Z' + timestamp: + description: >- + Same value as it's in the `time` field but represented in + timestamp format. + type: integer + format: int64 + example: 1654815517198 + error: + $ref: '#/components/schemas/ProductError' + jailbroken: + title: SignalResponseJailbroken + type: object + properties: + data: + type: object + properties: + result: + type: boolean + description: > + iOS specific jailbreak detection. There are 2 values: • + `true` - Jailbreak detected • `false` - No signs of + jailbreak or the client is not iOS. + example: false + error: + $ref: '#/components/schemas/ProductError' + frida: + title: SignalResponseFrida + type: object + properties: + data: + type: object + properties: + result: + type: boolean + description: > + iOS specific [Frida](https://frida.re/docs/ios/) detection. + There are 2 values: • `true` - Frida detected • `false` - No + signs of Frida or the client is not iOS. example: false error: $ref: '#/components/schemas/ProductError' @@ -4347,6 +4563,37 @@ components: example: false error: $ref: '#/components/schemas/ProductError' + privacySettings: + title: SignalResponsePrivacySettings + type: object + properties: + data: + type: object + properties: + result: + type: boolean + description: > + `true` if the request is from a privacy aware browser (e.g. + Tor) or from a browser in which fingerprinting is blocked. + Otherwise `false`. + example: false + error: + $ref: '#/components/schemas/ProductError' + virtualMachine: + title: SignalResponseVirtualMachine + type: object + properties: + data: + type: object + properties: + result: + type: boolean + description: > + `true` if the request came from a browser running inside a + virtual machine (e.g. VMWare), `false` otherwise. + example: false + error: + $ref: '#/components/schemas/ProductError' vpn: title: SignalResponseVpn type: object @@ -4378,6 +4625,12 @@ components: $ref: '#/components/schemas/TamperingResult' error: $ref: '#/components/schemas/ProductError' + rawDeviceAttributes: + title: SignalResponseRawDeviceAttributes + type: object + properties: + data: + $ref: '#/components/schemas/RawDeviceAttributesResult' EventResponse: description: >- Contains results from all activated products - Fingerprint Pro, Bot @@ -4556,6 +4809,38 @@ components: example: 0 minimum: 0 maximum: 1 + RawDeviceAttributesResult: + type: object + description: > + It includes 35+ raw browser identification attributes to provide + Fingerprint users with even more information than our standard visitor + ID provides. This enables Fingerprint users to not have to run our + open-source product in conjunction with Fingerprint Pro Plus and + Enterprise to get those additional attributes. + + Warning: The raw signals data can change at any moment as we improve the + product. We cannot guarantee the internal shape of raw device attributes + to be stable, so typical semantic versioning rules do not apply here. + Use this data with caution without assuming a specific structure beyond + the generic type provided here. + additionalProperties: + type: object + properties: + error: + properties: + name: + title: error.name + type: string + message: + title: error.message + type: string + required: + - name + - message + title: error + type: object + value: + title: value ProductError: type: object properties: diff --git a/src/generatedApiTypes.ts b/src/generatedApiTypes.ts index 04a22aaf..2ded058c 100644 --- a/src/generatedApiTypes.ts +++ b/src/generatedApiTypes.ts @@ -6,8 +6,9 @@ export interface paths { '/events/{request_id}': { /** - * This endpoint allows you to retrieve an individual analysis event with all the information from each activated product (Identification, Bot Detection, and others). - * Products that are not activated for your application or not relevant to the event's detected platform (web, iOS, Android) are not included in the response. + * This endpoint allows you to get a detailed analysis of an individual request. + * **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request orignated from a non-mobile platform. + * It is highly recommended that you **ignore** the mobile signals for such requests. * * Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. */ @@ -164,8 +165,7 @@ export interface components { /** WebhookSignalResponseRootApps */ rootApps?: { /** - * @description Android specific root management apps detection. There are 2 values: • `true` - Root Management Apps detected (e.g. Magisk) • `false` - No Root Management Apps detected - * Available only for events from Android client. The field will not be present for a browser or iOS event. + * @description Android specific root management apps detection. There are 2 values: • `true` - Root Management Apps detected (e.g. Magisk) • `false` - No Root Management Apps detected or the client isn't Android. * * @example false */ @@ -174,8 +174,51 @@ export interface components { /** WebhookSignalResponseEmulator */ emulator?: { /** - * @description Android specific emulator detection. There are 2 values: • `true` - Emulated environment detected (e.g. launch inside of AVD) • `false` - No signs of emulated environment detected - * Available only for events from Android client. The field will not be present for a browser or iOS event. + * @description Android specific emulator detection. There are 2 values: • `true` - Emulated environment detected (e.g. launch inside of AVD) • `false` - No signs of emulated environment detected or the client isn't Android. + * + * @example false + */ + result?: boolean; + }; + /** WebhookSignalResponseClonedApp */ + clonedApp?: { + /** + * @description Android specific cloned application detection. There are 2 values: • `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). • `false` - No signs of cloned application detected or the client is not Android. + * + * @example false + */ + result?: boolean; + }; + /** WebhookSignalResponseFactoryReset */ + factoryReset?: { + /** + * Time + * Format: date-time + * @description Time in UTC for the Android client when recent factory reset was done. If there is no sign of factory reset or the client isn't Android, the field will be epoch time. + * + * @example 2022-06-09T22:58:36Z + */ + time?: string; + /** + * Format: int64 + * @description Same value as it's in the `time` field but represented in timestamp format. + * @example 1654815517198 + */ + timestamp?: number; + }; + /** WebhookSignalResponseJailbroken */ + jailbroken?: { + /** + * @description iOS specific jailbreak detection. There are 2 values: • `true` - Jailbreak detected • `false` - No signs of jailbreak or the client is not iOS. + * + * @example false + */ + result?: boolean; + }; + /** WebhookSignalResponseFrida */ + frida?: { + /** + * @description iOS specific [Frida](https://frida.re/docs/ios/) detection. There are 2 values: • `true` - Frida detected • `false` - No signs of Frida or the client is not iOS. * * @example false */ @@ -191,6 +234,24 @@ export interface components { */ result?: boolean; }; + /** WebhookSignalResponsePrivacySettings */ + privacySettings?: { + /** + * @description `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. + * + * @example false + */ + result?: boolean; + }; + /** WebhookSignalResponseVirtualMachine */ + virtualMachine?: { + /** + * @description `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. + * + * @example false + */ + result?: boolean; + }; vpn?: components['schemas']['VpnResult']; /** WebhookSignalResponseProxy */ proxy?: { @@ -202,6 +263,7 @@ export interface components { result?: boolean; }; tampering?: components['schemas']['TamperingResult']; + rawDeviceAttributes?: components['schemas']['RawDeviceAttributesResult']; /** * @description Unique identifier of the user's identification request. * @example 1654815516083.OX6kx8 @@ -463,8 +525,7 @@ export interface components { rootApps?: { data?: { /** - * @description Android specific root management apps detection. There are 2 values: • `true` - Root Management Apps detected (e.g. Magisk) • `false` - No Root Management Apps detected - * Available only for events from Android client. The field will not be present for a browser or iOS event. + * @description Android specific root management apps detection. There are 2 values: • `true` - Root Management Apps detected (e.g. Magisk) • `false` - No Root Management Apps detected or the client is not Android. * * @example false */ @@ -476,8 +537,63 @@ export interface components { emulator?: { data?: { /** - * @description Android specific emulator detection. There are 2 values: • `true` - Emulated environment detected (e.g. launch inside of AVD) • `false` - No signs of emulated environment detected - * Available only for events from Android client. The field will not be present for a browser or iOS event. + * @description Android specific emulator detection. There are 2 values: • `true` - Emulated environment detected (e.g. launch inside of AVD) • `false` - No signs of emulated environment detected or the client is not Android. + * + * @example false + */ + result?: boolean; + }; + error?: components['schemas']['ProductError']; + }; + /** SignalResponseClonedApp */ + clonedApp?: { + data?: { + /** + * @description Android specific cloned application detection. There are 2 values: • `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). • `false` - No signs of cloned application detected or the client is not Android. + * + * @example false + */ + result?: boolean; + }; + error?: components['schemas']['ProductError']; + }; + /** SignalResponseFactoryReset */ + factoryReset?: { + data?: { + /** + * Time + * Format: date-time + * @description Time in UTC for the Android client when recent factory reset was done. If there is no sign of factory reset or the client isn't Android, the field will be epoch time. + * + * @example 2022-06-09T22:58:36Z + */ + time?: string; + /** + * Format: int64 + * @description Same value as it's in the `time` field but represented in timestamp format. + * @example 1654815517198 + */ + timestamp?: number; + }; + error?: components['schemas']['ProductError']; + }; + /** SignalResponseJailbroken */ + jailbroken?: { + data?: { + /** + * @description iOS specific jailbreak detection. There are 2 values: • `true` - Jailbreak detected • `false` - No signs of jailbreak or the client is not iOS. + * + * @example false + */ + result?: boolean; + }; + error?: components['schemas']['ProductError']; + }; + /** SignalResponseFrida */ + frida?: { + data?: { + /** + * @description iOS specific [Frida](https://frida.re/docs/ios/) detection. There are 2 values: • `true` - Frida detected • `false` - No signs of Frida or the client is not iOS. * * @example false */ @@ -502,6 +618,30 @@ export interface components { }; error?: components['schemas']['ProductError']; }; + /** SignalResponsePrivacySettings */ + privacySettings?: { + data?: { + /** + * @description `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. + * + * @example false + */ + result?: boolean; + }; + error?: components['schemas']['ProductError']; + }; + /** SignalResponseVirtualMachine */ + virtualMachine?: { + data?: { + /** + * @description `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. + * + * @example false + */ + result?: boolean; + }; + error?: components['schemas']['ProductError']; + }; /** SignalResponseVpn */ vpn?: { data?: components['schemas']['VpnResult']; @@ -524,6 +664,10 @@ export interface components { data?: components['schemas']['TamperingResult']; error?: components['schemas']['ProductError']; }; + /** SignalResponseRawDeviceAttributes */ + rawDeviceAttributes?: { + data?: components['schemas']['RawDeviceAttributesResult']; + }; }; /** @description Contains results from all activated products - Fingerprint Pro, Bot Detection, and others. */ EventResponse: { @@ -654,6 +798,23 @@ export interface components { */ anomalyScore?: number; }; + /** + * @description It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. + * Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. + */ + RawDeviceAttributesResult: { + [key: string]: { + /** error */ + error?: { + /** error.name */ + name: string; + /** error.message */ + message: string; + }; + /** value */ + value?: unknown; + }; + }; ProductError: { /** * @description Error code: @@ -672,8 +833,9 @@ export interface components { export interface operations { /** - * This endpoint allows you to retrieve an individual analysis event with all the information from each activated product (Identification, Bot Detection, and others). - * Products that are not activated for your application or not relevant to the event's detected platform (web, iOS, Android) are not included in the response. + * This endpoint allows you to get a detailed analysis of an individual request. + * **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request orignated from a non-mobile platform. + * It is highly recommended that you **ignore** the mobile signals for such requests. * * Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. */ diff --git a/tests/mocked-responses-tests/__snapshots__/castVisitorWebhookTest.spec.ts.snap b/tests/mocked-responses-tests/__snapshots__/castVisitorWebhookTest.spec.ts.snap index f487d515..31ef44d4 100644 --- a/tests/mocked-responses-tests/__snapshots__/castVisitorWebhookTest.spec.ts.snap +++ b/tests/mocked-responses-tests/__snapshots__/castVisitorWebhookTest.spec.ts.snap @@ -16,16 +16,26 @@ Object { "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86", }, "clientReferrer": "https://google.com?search=banking+services", + "clonedApp": Object { + "result": false, + }, "confidence": Object { "score": 0.97, }, "emulator": Object { "result": false, }, + "factoryReset": Object { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0, + }, "firstSeenAt": Object { "global": "2022-03-16T11:26:45.362Z", "subscription": "2022-03-16T11:31:01.101Z", }, + "frida": Object { + "result": false, + }, "incognito": false, "ip": "216.3.128.12", "ipBlocklist": Object { @@ -88,14 +98,47 @@ Object { ], "timezone": "America/Chicago", }, + "jailbroken": Object { + "result": false, + }, "lastSeenAt": Object { "global": "2022-03-16T11:28:34.023Z", "subscription": null, }, "linkedId": "any-string", + "privacySettings": Object { + "result": false, + }, "proxy": Object { "result": false, }, + "rawDeviceAttributes": Object { + "architecture": Object { + "value": 127, + }, + "audio": Object { + "value": 35.73832903057337, + }, + "canvas": Object { + "value": Object { + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d", + "Winding": true, + }, + }, + "colorDepth": Object { + "value": 30, + }, + "colorGamut": Object { + "value": "srgb", + }, + "contrast": Object { + "value": 0, + }, + "cookiesEnabled": Object { + "value": true, + }, + }, "requestId": "Px6VxbRC6WBkA39yeNH3", "rootApps": Object { "result": false, @@ -115,6 +158,9 @@ Object { }, "url": "https://banking.example.com/signup", "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86", + "virtualMachine": Object { + "result": false, + }, "visitorFound": true, "visitorId": "3HNey93AkBW6CRbxV6xP", "vpn": Object { diff --git a/tests/mocked-responses-tests/__snapshots__/getEventTests.spec.ts.snap b/tests/mocked-responses-tests/__snapshots__/getEventTests.spec.ts.snap index 92071960..946363ad 100644 --- a/tests/mocked-responses-tests/__snapshots__/getEventTests.spec.ts.snap +++ b/tests/mocked-responses-tests/__snapshots__/getEventTests.spec.ts.snap @@ -105,12 +105,30 @@ Object { "message": "internal server error", }, }, + "clonedApp": Object { + "error": Object { + "code": "Failed", + "message": "internal server error", + }, + }, "emulator": Object { "error": Object { "code": "Failed", "message": "internal server error", }, }, + "factoryReset": Object { + "error": Object { + "code": "Failed", + "message": "internal server error", + }, + }, + "frida": Object { + "error": Object { + "code": "Failed", + "message": "internal server error", + }, + }, "identification": Object { "error": Object { "code": "Failed", @@ -135,12 +153,40 @@ Object { "message": "internal server error", }, }, + "jailbroken": Object { + "error": Object { + "code": "Failed", + "message": "internal server error", + }, + }, + "privacySettings": Object { + "error": Object { + "code": "Failed", + "message": "internal server error", + }, + }, "proxy": Object { "error": Object { "code": "Failed", "message": "internal server error", }, }, + "rawDeviceAttributes": Object { + "data": Object { + "audio": Object { + "error": Object { + "message": "internal server error", + "name": "Error", + }, + }, + "canvas": Object { + "error": Object { + "message": "internal server error", + "name": "Error", + }, + }, + }, + }, "rootApps": Object { "error": Object { "code": "Failed", @@ -159,6 +205,12 @@ Object { "message": "internal server error", }, }, + "virtualMachine": Object { + "error": Object { + "code": "Failed", + "message": "internal server error", + }, + }, "vpn": Object { "error": Object { "code": "Failed", @@ -175,19 +227,34 @@ Object { "botd": Object { "data": Object { "bot": Object { - "result": "bad", - "type": "selenium", + "result": "notDetected", }, "ip": "61.127.217.15", "time": "2019-05-21T16:40:13Z", "url": "https://www.example.com/login", }, }, + "clonedApp": Object { + "data": Object { + "result": false, + }, + }, "emulator": Object { "data": Object { "result": false, }, }, + "factoryReset": Object { + "data": Object { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0, + }, + }, + "frida": Object { + "data": Object { + "result": false, + }, + }, "identification": Object { "data": Object { "browserDetails": Object { @@ -290,11 +357,50 @@ Object { }, }, }, + "jailbroken": Object { + "data": Object { + "result": false, + }, + }, + "privacySettings": Object { + "data": Object { + "result": false, + }, + }, "proxy": Object { "data": Object { "result": false, }, }, + "rawDeviceAttributes": Object { + "data": Object { + "architecture": Object { + "value": 127, + }, + "audio": Object { + "value": 35.73832903057337, + }, + "canvas": Object { + "value": Object { + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d", + "Winding": true, + }, + }, + "colorDepth": Object { + "value": 30, + }, + "colorGamut": Object { + "value": "srgb", + }, + "contrast": Object { + "value": 0, + }, + "cookiesEnabled": Object { + "value": true, + }, + }, + }, "rootApps": Object { "data": Object { "result": false, @@ -311,6 +417,11 @@ Object { "result": false, }, }, + "virtualMachine": Object { + "data": Object { + "result": false, + }, + }, "vpn": Object { "data": Object { "methods": Object { diff --git a/tests/mocked-responses-tests/getEventTests.spec.ts b/tests/mocked-responses-tests/getEventTests.spec.ts index ec4c1efd..8db88268 100644 --- a/tests/mocked-responses-tests/getEventTests.spec.ts +++ b/tests/mocked-responses-tests/getEventTests.spec.ts @@ -30,7 +30,6 @@ describe('[Mocked response] Get Event', () => { ); const response = await client.getEvent(existingRequestId); - expect(response).toMatchSnapshot(); }); diff --git a/tests/mocked-responses-tests/mocked-responses-data/external/get_event.json b/tests/mocked-responses-tests/mocked-responses-data/external/get_event.json index 924545c3..339d38bd 100644 --- a/tests/mocked-responses-tests/mocked-responses-data/external/get_event.json +++ b/tests/mocked-responses-tests/mocked-responses-data/external/get_event.json @@ -60,8 +60,7 @@ "botd": { "data": { "bot": { - "result": "bad", - "type": "selenium" + "result": "notDetected" }, "url": "https://www.example.com/login", "ip": "61.127.217.15", @@ -147,6 +146,66 @@ "result": false, "anomalyScore": 0 } + }, + "clonedApp": { + "data": { + "result": false + } + }, + "factoryReset": { + "data": { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0 + } + }, + "jailbroken": { + "data": { + "result": false + } + }, + "frida": { + "data": { + "result": false + } + }, + "privacySettings": { + "data": { + "result": false + } + }, + "virtualMachine": { + "data": { + "result": false + } + }, + "rawDeviceAttributes": { + "data": { + "architecture": { + "value": 127 + }, + "audio": { + "value": 35.73832903057337 + }, + "canvas": { + "value": { + "Winding": true, + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" + } + }, + "colorDepth": { + "value": 30 + }, + "colorGamut": { + "value": "srgb" + }, + "contrast": { + "value": 0 + }, + "cookiesEnabled": { + "value": true + } + } } } } diff --git a/tests/mocked-responses-tests/mocked-responses-data/external/get_event_all_errors.json b/tests/mocked-responses-tests/mocked-responses-data/external/get_event_all_errors.json index 89663915..00b16976 100644 --- a/tests/mocked-responses-tests/mocked-responses-data/external/get_event_all_errors.json +++ b/tests/mocked-responses-tests/mocked-responses-data/external/get_event_all_errors.json @@ -30,6 +30,30 @@ "message": "internal server error" } }, + "clonedApp": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "factoryReset": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "jailbroken": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "frida": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, "emulator": { "error": { "code": "Failed", @@ -60,11 +84,39 @@ "message": "internal server error" } }, + "privacySettings": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "virtualMachine": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, "tampering": { "error": { "code": "Failed", "message": "internal server error" } + }, + "rawDeviceAttributes": { + "data": { + "audio": { + "error": { + "name": "Error", + "message": "internal server error" + } + }, + "canvas": { + "error": { + "name": "Error", + "message": "internal server error" + } + } + } } } } diff --git a/tests/mocked-responses-tests/mocked-responses-data/external/webhook.json b/tests/mocked-responses-tests/mocked-responses-data/external/webhook.json index e5103a11..d70ffd67 100644 --- a/tests/mocked-responses-tests/mocked-responses-data/external/webhook.json +++ b/tests/mocked-responses-tests/mocked-responses-data/external/webhook.json @@ -120,5 +120,51 @@ "tampering": { "result": false, "anomalyScore": 0 + }, + "clonedApp": { + "result": false + }, + "factoryReset": { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0 + }, + "jailbroken": { + "result": false + }, + "frida": { + "result": false + }, + "privacySettings": { + "result": false + }, + "virtualMachine": { + "result": false + }, + "rawDeviceAttributes": { + "architecture": { + "value": 127 + }, + "audio": { + "value": 35.73832903057337 + }, + "canvas": { + "value": { + "Winding": true, + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" + } + }, + "colorDepth": { + "value": 30 + }, + "colorGamut": { + "value": "srgb" + }, + "contrast": { + "value": 0 + }, + "cookiesEnabled": { + "value": true + } } }