* Checks if a given UUID is present in the API response. * @param {string} targetUuid The UUID to search for. * @returns {Promise } A Promise that resolves to true if the UUID is present in the API response, false otherwise.
(targetUuid)
| 310 | * @returns {Promise<boolean>} A Promise that resolves to true if the UUID is present in the API response, false otherwise. |
| 311 | */ |
| 312 | async function checkUuidInApiResponse(targetUuid) { |
| 313 | // Check if any of the environment variables are empty |
| 314 | if (!nodeId || !apiToken || !apiHost) { |
| 315 | return false; |
| 316 | } |
| 317 | |
| 318 | try { |
| 319 | const apiResponse = await getApiResponse(); |
| 320 | if (!apiResponse) { |
| 321 | return false; |
| 322 | } |
| 323 | const isUuidInResponse = apiResponse.users.some(user => user.uuid === targetUuid); |
| 324 | return isUuidInResponse; |
| 325 | } catch (error) { |
| 326 | console.error('Error:', error); |
| 327 | return false; |
| 328 | } |
| 329 | } |
| 330 | |
| 331 | // Usage example: |
| 332 | // const targetUuid = "65590e04-a94c-4c59-a1f2-571bce925aad"; |
nothing calls this directly
no test coverage detected