From ca25ef7f07acbf47a7e5a55092bd336050cd0967 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Thu, 1 Aug 2024 16:43:40 +0200 Subject: [PATCH] feat: add `developer_tools` signal --- README.md | 2 + docs/DeveloperToolsResult.md | 9 ++ docs/ProductsResponse.md | 1 + docs/SignalResponseDeveloperTools.md | 10 +++ docs/WebhookVisit.md | 1 + fingerprint_pro_server_api_sdk/__init__.py | 2 + .../models/__init__.py | 2 + .../models/developer_tools_result.py | 66 ++++++++++++++ .../models/products_response.py | 31 ++++++- .../models/signal_response_developer_tools.py | 89 +++++++++++++++++++ .../models/webhook_visit.py | 27 +++++- res/fingerprint-server-api.yaml | 25 ++++++ test/mocks/get_event_200.json | 7 +- test/mocks/get_event_200_all_errors.json | 6 ++ test/mocks/webhook.json | 3 + 15 files changed, 276 insertions(+), 5 deletions(-) create mode 100644 docs/DeveloperToolsResult.md create mode 100644 docs/SignalResponseDeveloperTools.md create mode 100644 fingerprint_pro_server_api_sdk/models/developer_tools_result.py create mode 100644 fingerprint_pro_server_api_sdk/models/signal_response_developer_tools.py diff --git a/README.md b/README.md index 0f64a06c..2dd792c2 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,7 @@ Class | Method | HTTP request | Description - [DataCenter](docs/DataCenter.md) - [DeprecatedIPLocation](docs/DeprecatedIPLocation.md) - [DeprecatedIPLocationCity](docs/DeprecatedIPLocationCity.md) + - [DeveloperToolsResult](docs/DeveloperToolsResult.md) - [EmulatorResult](docs/EmulatorResult.md) - [ErrorCommon403Response](docs/ErrorCommon403Response.md) - [ErrorCommon429Response](docs/ErrorCommon429Response.md) @@ -272,6 +273,7 @@ Class | Method | HTTP request | Description - [RootAppsResult](docs/RootAppsResult.md) - [SeenAt](docs/SeenAt.md) - [SignalResponseClonedApp](docs/SignalResponseClonedApp.md) + - [SignalResponseDeveloperTools](docs/SignalResponseDeveloperTools.md) - [SignalResponseEmulator](docs/SignalResponseEmulator.md) - [SignalResponseFactoryReset](docs/SignalResponseFactoryReset.md) - [SignalResponseFrida](docs/SignalResponseFrida.md) diff --git a/docs/DeveloperToolsResult.md b/docs/DeveloperToolsResult.md new file mode 100644 index 00000000..b747f8b1 --- /dev/null +++ b/docs/DeveloperToolsResult.md @@ -0,0 +1,9 @@ +# DeveloperToolsResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ProductsResponse.md b/docs/ProductsResponse.md index e8abb006..df2a8fba 100644 --- a/docs/ProductsResponse.md +++ b/docs/ProductsResponse.md @@ -28,6 +28,7 @@ Name | Type | Description | Notes **raw_device_attributes** | [**SignalResponseRawDeviceAttributes**](SignalResponseRawDeviceAttributes.md) | | [optional] **remote_control** | [**SignalResponseRemoteControl**](SignalResponseRemoteControl.md) | | [optional] **velocity** | [**SignalResponseVelocity**](SignalResponseVelocity.md) | | [optional] +**developer_tools** | [**SignalResponseDeveloperTools**](SignalResponseDeveloperTools.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SignalResponseDeveloperTools.md b/docs/SignalResponseDeveloperTools.md new file mode 100644 index 00000000..b67eaef8 --- /dev/null +++ b/docs/SignalResponseDeveloperTools.md @@ -0,0 +1,10 @@ +# SignalResponseDeveloperTools + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**DeveloperToolsResult**](DeveloperToolsResult.md) | | [optional] +**error** | [**ProductError**](ProductError.md) | | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/WebhookVisit.md b/docs/WebhookVisit.md index f4a3d87c..f4da26f2 100644 --- a/docs/WebhookVisit.md +++ b/docs/WebhookVisit.md @@ -28,6 +28,7 @@ Name | Type | Description | Notes **suspect_score** | [**SuspectScoreResult**](SuspectScoreResult.md) | | [optional] **remote_control** | [**RemoteControlResult**](RemoteControlResult.md) | | [optional] **velocity** | [**VelocityResult**](VelocityResult.md) | | [optional] +**developer_tools** | [**DeveloperToolsResult**](DeveloperToolsResult.md) | | [optional] **request_id** | **str** | Unique identifier of the user's identification request. | **browser_details** | [**BrowserDetails**](BrowserDetails.md) | | **ip** | **str** | | diff --git a/fingerprint_pro_server_api_sdk/__init__.py b/fingerprint_pro_server_api_sdk/__init__.py index 8a308737..60c5c07b 100644 --- a/fingerprint_pro_server_api_sdk/__init__.py +++ b/fingerprint_pro_server_api_sdk/__init__.py @@ -30,6 +30,7 @@ from fingerprint_pro_server_api_sdk.models.data_center import DataCenter from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation from fingerprint_pro_server_api_sdk.models.deprecated_ip_location_city import DeprecatedIPLocationCity +from fingerprint_pro_server_api_sdk.models.developer_tools_result import DeveloperToolsResult from fingerprint_pro_server_api_sdk.models.emulator_result import EmulatorResult from fingerprint_pro_server_api_sdk.models.error_common403_response import ErrorCommon403Response from fingerprint_pro_server_api_sdk.models.error_common429_response import ErrorCommon429Response @@ -76,6 +77,7 @@ from fingerprint_pro_server_api_sdk.models.root_apps_result import RootAppsResult from fingerprint_pro_server_api_sdk.models.seen_at import SeenAt from fingerprint_pro_server_api_sdk.models.signal_response_cloned_app import SignalResponseClonedApp +from fingerprint_pro_server_api_sdk.models.signal_response_developer_tools import SignalResponseDeveloperTools from fingerprint_pro_server_api_sdk.models.signal_response_emulator import SignalResponseEmulator from fingerprint_pro_server_api_sdk.models.signal_response_factory_reset import SignalResponseFactoryReset from fingerprint_pro_server_api_sdk.models.signal_response_frida import SignalResponseFrida diff --git a/fingerprint_pro_server_api_sdk/models/__init__.py b/fingerprint_pro_server_api_sdk/models/__init__.py index 40b92f1a..87cd306e 100644 --- a/fingerprint_pro_server_api_sdk/models/__init__.py +++ b/fingerprint_pro_server_api_sdk/models/__init__.py @@ -22,6 +22,7 @@ from fingerprint_pro_server_api_sdk.models.data_center import DataCenter from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation from fingerprint_pro_server_api_sdk.models.deprecated_ip_location_city import DeprecatedIPLocationCity +from fingerprint_pro_server_api_sdk.models.developer_tools_result import DeveloperToolsResult from fingerprint_pro_server_api_sdk.models.emulator_result import EmulatorResult from fingerprint_pro_server_api_sdk.models.error_common403_response import ErrorCommon403Response from fingerprint_pro_server_api_sdk.models.error_common429_response import ErrorCommon429Response @@ -68,6 +69,7 @@ from fingerprint_pro_server_api_sdk.models.root_apps_result import RootAppsResult from fingerprint_pro_server_api_sdk.models.seen_at import SeenAt from fingerprint_pro_server_api_sdk.models.signal_response_cloned_app import SignalResponseClonedApp +from fingerprint_pro_server_api_sdk.models.signal_response_developer_tools import SignalResponseDeveloperTools from fingerprint_pro_server_api_sdk.models.signal_response_emulator import SignalResponseEmulator from fingerprint_pro_server_api_sdk.models.signal_response_factory_reset import SignalResponseFactoryReset from fingerprint_pro_server_api_sdk.models.signal_response_frida import SignalResponseFrida diff --git a/fingerprint_pro_server_api_sdk/models/developer_tools_result.py b/fingerprint_pro_server_api_sdk/models/developer_tools_result.py new file mode 100644 index 00000000..426b77b1 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/developer_tools_result.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import re # noqa: F401 +from typing import Dict, List # noqa: F401 +from fingerprint_pro_server_api_sdk.base_model import BaseModel + + +class DeveloperToolsResult(BaseModel): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'result': 'bool' + } + + attribute_map = { + 'result': 'result' + } + + def __init__(self, result=None): # noqa: E501 + """DeveloperToolsResult - a model defined in Swagger""" # noqa: E501 + self._result = None + self.discriminator = None + self.result = result + + @property + def result(self) -> bool: + """Gets the result of this DeveloperToolsResult. # noqa: E501 + + `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. # noqa: E501 + + :return: The result of this DeveloperToolsResult. # noqa: E501 + """ + return self._result + + @result.setter + def result(self, result: bool): + """Sets the result of this DeveloperToolsResult. + + `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. # noqa: E501 + + :param result: The result of this DeveloperToolsResult. # noqa: E501 + """ + if result is None: + raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 + + self._result = result + diff --git a/fingerprint_pro_server_api_sdk/models/products_response.py b/fingerprint_pro_server_api_sdk/models/products_response.py index 780f8738..15a16cf5 100644 --- a/fingerprint_pro_server_api_sdk/models/products_response.py +++ b/fingerprint_pro_server_api_sdk/models/products_response.py @@ -36,6 +36,7 @@ from fingerprint_pro_server_api_sdk.models.signal_response_raw_device_attributes import SignalResponseRawDeviceAttributes from fingerprint_pro_server_api_sdk.models.signal_response_remote_control import SignalResponseRemoteControl from fingerprint_pro_server_api_sdk.models.signal_response_velocity import SignalResponseVelocity +from fingerprint_pro_server_api_sdk.models.signal_response_developer_tools import SignalResponseDeveloperTools class ProductsResponse(BaseModel): @@ -76,7 +77,8 @@ class ProductsResponse(BaseModel): 'suspect_score': 'SignalResponseSuspectScore', 'raw_device_attributes': 'SignalResponseRawDeviceAttributes', 'remote_control': 'SignalResponseRemoteControl', - 'velocity': 'SignalResponseVelocity' + 'velocity': 'SignalResponseVelocity', + 'developer_tools': 'SignalResponseDeveloperTools' } attribute_map = { @@ -102,10 +104,11 @@ class ProductsResponse(BaseModel): 'suspect_score': 'suspectScore', 'raw_device_attributes': 'rawDeviceAttributes', 'remote_control': 'remoteControl', - 'velocity': 'velocity' + 'velocity': 'velocity', + 'developer_tools': 'developerTools' } - def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, high_activity=None, location_spoofing=None, suspect_score=None, raw_device_attributes=None, remote_control=None, velocity=None): # noqa: E501 + def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, high_activity=None, location_spoofing=None, suspect_score=None, raw_device_attributes=None, remote_control=None, velocity=None, developer_tools=None): # noqa: E501 """ProductsResponse - a model defined in Swagger""" # noqa: E501 self._identification = None self._botd = None @@ -130,6 +133,7 @@ def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, self._raw_device_attributes = None self._remote_control = None self._velocity = None + self._developer_tools = None self.discriminator = None if identification is not None: self.identification = identification @@ -177,6 +181,8 @@ def __init__(self, identification=None, botd=None, ip_info=None, incognito=None, self.remote_control = remote_control if velocity is not None: self.velocity = velocity + if developer_tools is not None: + self.developer_tools = developer_tools @property def identification(self) -> ProductsResponseIdentification: @@ -615,3 +621,22 @@ def velocity(self, velocity: SignalResponseVelocity): self._velocity = velocity + @property + def developer_tools(self) -> SignalResponseDeveloperTools: + """Gets the developer_tools of this ProductsResponse. # noqa: E501 + + + :return: The developer_tools of this ProductsResponse. # noqa: E501 + """ + return self._developer_tools + + @developer_tools.setter + def developer_tools(self, developer_tools: SignalResponseDeveloperTools): + """Sets the developer_tools of this ProductsResponse. + + + :param developer_tools: The developer_tools of this ProductsResponse. # noqa: E501 + """ + + self._developer_tools = developer_tools + diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_developer_tools.py b/fingerprint_pro_server_api_sdk/models/signal_response_developer_tools.py new file mode 100644 index 00000000..f7cd5aa7 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/signal_response_developer_tools.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Fingerprint Pro Server API + + Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. # noqa: E501 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import re # noqa: F401 +from typing import Dict, List # noqa: F401 +from fingerprint_pro_server_api_sdk.base_model import BaseModel +from fingerprint_pro_server_api_sdk.models.developer_tools_result import DeveloperToolsResult +from fingerprint_pro_server_api_sdk.models.product_error import ProductError + + +class SignalResponseDeveloperTools(BaseModel): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + 'data': 'DeveloperToolsResult', + 'error': 'ProductError' + } + + attribute_map = { + 'data': 'data', + 'error': 'error' + } + + def __init__(self, data=None, error=None): # noqa: E501 + """SignalResponseDeveloperTools - a model defined in Swagger""" # noqa: E501 + self._data = None + self._error = None + self.discriminator = None + if data is not None: + self.data = data + if error is not None: + self.error = error + + @property + def data(self) -> DeveloperToolsResult: + """Gets the data of this SignalResponseDeveloperTools. # noqa: E501 + + + :return: The data of this SignalResponseDeveloperTools. # noqa: E501 + """ + return self._data + + @data.setter + def data(self, data: DeveloperToolsResult): + """Sets the data of this SignalResponseDeveloperTools. + + + :param data: The data of this SignalResponseDeveloperTools. # noqa: E501 + """ + + self._data = data + + @property + def error(self) -> ProductError: + """Gets the error of this SignalResponseDeveloperTools. # noqa: E501 + + + :return: The error of this SignalResponseDeveloperTools. # noqa: E501 + """ + return self._error + + @error.setter + def error(self, error: ProductError): + """Sets the error of this SignalResponseDeveloperTools. + + + :param error: The error of this SignalResponseDeveloperTools. # noqa: E501 + """ + + self._error = error + diff --git a/fingerprint_pro_server_api_sdk/models/webhook_visit.py b/fingerprint_pro_server_api_sdk/models/webhook_visit.py index cb6fdd2f..34774587 100644 --- a/fingerprint_pro_server_api_sdk/models/webhook_visit.py +++ b/fingerprint_pro_server_api_sdk/models/webhook_visit.py @@ -34,6 +34,7 @@ from fingerprint_pro_server_api_sdk.models.suspect_score_result import SuspectScoreResult from fingerprint_pro_server_api_sdk.models.remote_control_result import RemoteControlResult from fingerprint_pro_server_api_sdk.models.velocity_result import VelocityResult +from fingerprint_pro_server_api_sdk.models.developer_tools_result import DeveloperToolsResult from fingerprint_pro_server_api_sdk.models.browser_details import BrowserDetails from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation from datetime import datetime @@ -80,6 +81,7 @@ class WebhookVisit(BaseModel): 'suspect_score': 'SuspectScoreResult', 'remote_control': 'RemoteControlResult', 'velocity': 'VelocityResult', + 'developer_tools': 'DeveloperToolsResult', 'request_id': 'str', 'browser_details': 'BrowserDetails', 'ip': 'str', @@ -121,6 +123,7 @@ class WebhookVisit(BaseModel): 'suspect_score': 'suspectScore', 'remote_control': 'remoteControl', 'velocity': 'velocity', + 'developer_tools': 'developerTools', 'request_id': 'requestId', 'browser_details': 'browserDetails', 'ip': 'ip', @@ -136,7 +139,7 @@ class WebhookVisit(BaseModel): 'last_seen_at': 'lastSeenAt' } - def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, raw_device_attributes=None, high_activity=None, location_spoofing=None, suspect_score=None, remote_control=None, velocity=None, request_id=None, browser_details=None, ip=None, ip_location=None, timestamp=None, time=None, url=None, tag=None, linked_id=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None): # noqa: E501 + def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=None, ip_info=None, incognito=None, root_apps=None, emulator=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, ip_blocklist=None, tor=None, privacy_settings=None, virtual_machine=None, vpn=None, proxy=None, tampering=None, raw_device_attributes=None, high_activity=None, location_spoofing=None, suspect_score=None, remote_control=None, velocity=None, developer_tools=None, request_id=None, browser_details=None, ip=None, ip_location=None, timestamp=None, time=None, url=None, tag=None, linked_id=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None): # noqa: E501 """WebhookVisit - a model defined in Swagger""" # noqa: E501 self._visitor_id = None self._client_referrer = None @@ -163,6 +166,7 @@ def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=N self._suspect_score = None self._remote_control = None self._velocity = None + self._developer_tools = None self._request_id = None self._browser_details = None self._ip = None @@ -225,6 +229,8 @@ def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=N self.remote_control = remote_control if velocity is not None: self.velocity = velocity + if developer_tools is not None: + self.developer_tools = developer_tools self.request_id = request_id self.browser_details = browser_details self.ip = ip @@ -723,6 +729,25 @@ def velocity(self, velocity: VelocityResult): self._velocity = velocity + @property + def developer_tools(self) -> DeveloperToolsResult: + """Gets the developer_tools of this WebhookVisit. # noqa: E501 + + + :return: The developer_tools of this WebhookVisit. # noqa: E501 + """ + return self._developer_tools + + @developer_tools.setter + def developer_tools(self, developer_tools: DeveloperToolsResult): + """Sets the developer_tools of this WebhookVisit. + + + :param developer_tools: The developer_tools of this WebhookVisit. # noqa: E501 + """ + + self._developer_tools = developer_tools + @property def request_id(self) -> str: """Gets the request_id of this WebhookVisit. # noqa: E501 diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index fee91c43..fef81197 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -532,6 +532,8 @@ paths: 5m: 1 1h: 5 24h: 5 + developerTools: + result: false responses: default: description: The server doesn't validate the answer. @@ -890,6 +892,8 @@ components: $ref: '#/components/schemas/RemoteControlResult' velocity: $ref: '#/components/schemas/VelocityResult' + developerTools: + $ref: '#/components/schemas/DeveloperToolsResult' requestId: description: Unique identifier of the user's identification request. type: string @@ -1628,6 +1632,15 @@ components: $ref: '#/components/schemas/VelocityResult' error: $ref: '#/components/schemas/ProductError' + developerTools: + title: SignalResponseDeveloperTools + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/DeveloperToolsResult' + error: + $ref: '#/components/schemas/ProductError' EventResponse: description: >- Contains results from all activated products - Fingerprint Pro, Bot @@ -2166,6 +2179,18 @@ components: example: false required: - result + DeveloperToolsResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + `true` if the browser is Chrome with DevTools open or Firefox with + Developer Tools open, `false` otherwise. + example: false + required: + - result EventUpdateRequest: type: object properties: diff --git a/test/mocks/get_event_200.json b/test/mocks/get_event_200.json index 0769ddb1..6361db17 100644 --- a/test/mocks/get_event_200.json +++ b/test/mocks/get_event_200.json @@ -303,6 +303,11 @@ } } } + }, + "developerTools": { + "data": { + "result": false + } } } -} \ No newline at end of file +} diff --git a/test/mocks/get_event_200_all_errors.json b/test/mocks/get_event_200_all_errors.json index 1308990d..2fe90ccb 100644 --- a/test/mocks/get_event_200_all_errors.json +++ b/test/mocks/get_event_200_all_errors.json @@ -147,6 +147,12 @@ "code": "Failed", "message": "internal server error" } + }, + "developerTools": { + "error": { + "code": "Failed", + "message": "internal server error" + } } } } diff --git a/test/mocks/webhook.json b/test/mocks/webhook.json index 781e9c78..15332a06 100644 --- a/test/mocks/webhook.json +++ b/test/mocks/webhook.json @@ -215,5 +215,8 @@ "24h": 5 } } + }, + "developerTools": { + "result": false } }