diff --git a/package-lock.json b/package-lock.json index df55632..35178a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.24.0", "@seamapi/nextlove-sdk-generator": "^1.19.6", - "@seamapi/types": "1.673.0", + "@seamapi/types": "1.677.0", "del": "^7.1.0", "prettier": "^3.0.0" } @@ -456,9 +456,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.673.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.673.0.tgz", - "integrity": "sha512-OnqrVBIr1qgw1s7ZA9jQNbt/tV21fUmFx6aOZ2bjI6byUE0vJm7xDDLB4MTCAAUZRefXXi8xyhq2K5zs+8oXgQ==", + "version": "1.677.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.677.0.tgz", + "integrity": "sha512-TbYg+vUgphu8jNNgksjWOHvc1HXEx3vHyx7eTzDaECvjp+RlCsdES0EFgGJ535CsVUxlxfhg+fMlqiQPupPYDw==", "dev": true, "license": "MIT", "engines": { diff --git a/package.json b/package.json index 30e016a..8f6010b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@prettier/plugin-php": "^0.24.0", "@seamapi/nextlove-sdk-generator": "^1.19.6", - "@seamapi/types": "1.673.0", + "@seamapi/types": "1.677.0", "del": "^7.1.0", "prettier": "^3.0.0" } diff --git a/src/SeamClient.php b/src/SeamClient.php index a4ba526..f66256b 100644 --- a/src/SeamClient.php +++ b/src/SeamClient.php @@ -2668,13 +2668,27 @@ public function get(string $action_attempt_id): ActionAttempt return ActionAttempt::from_json($res->action_attempt); } - public function list(array $action_attempt_ids): array - { + public function list( + ?array $action_attempt_ids = null, + ?string $device_id = null, + mixed $limit = null, + ?string $page_cursor = null, + ?callable $on_response = null, + ): array { $request_payload = []; if ($action_attempt_ids !== null) { $request_payload["action_attempt_ids"] = $action_attempt_ids; } + if ($device_id !== null) { + $request_payload["device_id"] = $device_id; + } + if ($limit !== null) { + $request_payload["limit"] = $limit; + } + if ($page_cursor !== null) { + $request_payload["page_cursor"] = $page_cursor; + } $res = $this->seam->request( "POST", @@ -2682,6 +2696,10 @@ public function list(array $action_attempt_ids): array json: (object) $request_payload, ); + if ($on_response !== null) { + $on_response($res); + } + return array_map( fn($r) => ActionAttempt::from_json($r), $res->action_attempts, @@ -3955,8 +3973,10 @@ public function get( public function list( ?string $access_code_id = null, ?array $access_code_ids = null, + ?string $acs_entrance_id = null, ?string $acs_system_id = null, ?array $acs_system_ids = null, + ?string $acs_user_id = null, ?array $between = null, ?string $connect_webview_id = null, ?string $connected_account_id = null, @@ -3969,6 +3989,7 @@ public function list( ?float $limit = null, ?string $since = null, ?float $unstable_offset = null, + ?string $user_identity_id = null, ): array { $request_payload = []; @@ -3978,12 +3999,18 @@ public function list( if ($access_code_ids !== null) { $request_payload["access_code_ids"] = $access_code_ids; } + if ($acs_entrance_id !== null) { + $request_payload["acs_entrance_id"] = $acs_entrance_id; + } if ($acs_system_id !== null) { $request_payload["acs_system_id"] = $acs_system_id; } if ($acs_system_ids !== null) { $request_payload["acs_system_ids"] = $acs_system_ids; } + if ($acs_user_id !== null) { + $request_payload["acs_user_id"] = $acs_user_id; + } if ($between !== null) { $request_payload["between"] = $between; } @@ -4020,6 +4047,9 @@ public function list( if ($unstable_offset !== null) { $request_payload["unstable_offset"] = $unstable_offset; } + if ($user_identity_id !== null) { + $request_payload["user_identity_id"] = $user_identity_id; + } $res = $this->seam->request( "POST",