Repository navigation
Conversation
INTER-2457 option C. Event stays a single model; EventEdge is additive for POST /edge.
|
🟢 Coverage increased by 89.26% Code Coverage ReportCoverage Report
Files Coverage
|
There was a problem hiding this comment.
Pull request overview
This PR is a SPIKE regeneration of the PHP SDK from an updated OpenAPI schema that keeps Event as a single flattened model while adding an additive /edge Automation Intelligence endpoint and associated models/documentation.
Changes:
- Added
/edgeAPI operation (analyzeRequestForAutomationIntelligence) and new models (EdgeRequest,EventEdge,EdgeRequestHeadersInner). - Updated
Eventdocumentation/ordering and extended schema/docs to account forsource-distinguished device vs edge events. - Updated generated docs, OpenAPI resource YAML, sync script default schema URL, and webhook mock payload.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
src/Api/FingerprintApi.php |
Adds /edge operation and updates searchEvents signature/query parameter handling. |
src/Model/EdgeRequest.php |
Introduces request model for /edge payload. |
src/Model/EdgeRequestHeadersInner.php |
Adds header entry model used by EdgeRequest. |
src/Model/EventEdge.php |
Adds response model for /edge results. |
src/Model/Event.php |
Updates Event model docs and reorders/adds edge-related properties in the flattened model. |
res/fingerprint-server-api.yaml |
Updates bundled OpenAPI YAML (new /edge, updated Event description and parameters). |
scripts/sync.sh |
Changes default schema to fingerprint-server-api-v4-flat.yaml. |
README.md |
Adds new endpoint and model links to the README lists. |
docs/Api/FingerprintApi.md |
Documents new /edge method and updates existing endpoint docs. |
docs/Model/EdgeRequest.md |
Documents new EdgeRequest model. |
docs/Model/EdgeRequestHeadersInner.md |
Documents new EdgeRequestHeadersInner model. |
docs/Model/EventEdge.md |
Documents new EventEdge model. |
docs/Model/Event.md |
Updates Event model documentation text and property ordering. |
test/Model/EventEdgeTest.php |
Adds autogenerated model test stub (currently incomplete). |
test/Model/EdgeRequestTest.php |
Adds autogenerated model test stub (currently incomplete). |
test/Model/EdgeRequestHeadersInnerTest.php |
Adds autogenerated model test stub (currently incomplete). |
test/mocks/webhook/webhook_event.json |
Adds source to webhook event fixture. |
.openapi-generator/FILES |
Registers newly generated files in the generator manifest. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| public function searchEvents(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?bool $active_call = null, ?array $source = null): EventSearch | ||
| { | ||
| list($response) = $this->searchEventsWithHttpInfo($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $source, $active_call); | ||
| list($response) = $this->searchEventsWithHttpInfo($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $active_call, $source); | ||
|
|
| public function analyzeRequestForAutomationIntelligence(EdgeRequest $edge_request): EventEdge | ||
| { | ||
| list($response) = $this->analyzeRequestForAutomationIntelligenceWithHttpInfo($edge_request); | ||
|
|
||
| return $response; |
| if (null === $this->container['headers']) { | ||
| $invalidProperties[] = "'headers' can't be null"; | ||
| } | ||
| if (count($this->container['headers']) < 1) { | ||
| $invalidProperties[] = "invalid value for 'headers', number of items must be greater than or equal to 1."; | ||
| } | ||
|
|
||
| if (null === $this->container['method']) { | ||
| $invalidProperties[] = "'method' can't be null"; | ||
| } | ||
| if (null === $this->container['url']) { | ||
| $invalidProperties[] = "'url' can't be null"; | ||
| } |
| $edge_request = new \Fingerprint\ServerSdk\Model\EdgeRequest(); // \Fingerprint\ServerSdk\Model\EdgeRequest | ||
|
|
| /** | ||
| * Test "EdgeRequest". | ||
| */ | ||
| public function testEdgeRequest() | ||
| { | ||
| // TODO: implement | ||
| self::markTestIncomplete('Not implemented'); | ||
| } |
| /** | ||
| * Test "EdgeRequestHeadersInner". | ||
| */ | ||
| public function testEdgeRequestHeadersInner() | ||
| { | ||
| // TODO: implement | ||
| self::markTestIncomplete('Not implemented'); | ||
| } |
| /** | ||
| * Test "EventEdge". | ||
| */ | ||
| public function testEventEdge() | ||
| { | ||
| // TODO: implement | ||
| self::markTestIncomplete('Not implemented'); | ||
| } |
|
@copilot review |
pnpm exec changesetto create a changeset. |
|
This was a prototype done as part of a spike. Closing now, still usable as a reference during the production implementation. |
SPIKE. Do not merge. Option C: Event stays a single model. Generated from openapi#465. Not the earlier all-SDK union spike (#271).
Eventstill hasgetIdentification()/getSource().DISCRIMINATORstays null.analyzeRequestForAutomationIntelligence(EdgeRequest): EventEdge.scripts/sync.shdefaults tofingerprint-server-api-v4-flat.yaml(404 until the OpenAPI package publishes that file).Known: searchEvents argument order
Last two optional parameters swapped:
source, active_call→active_call, source. Named arguments are fine. Positional callers of those two would mix them up. This is query-parameter order in the schema, not Event flattening.Known: Event property order
Huge
Event.phpdiff is setter order. Assoc-array construction is unchanged.