MCPcopy Index your code
hub / github.com/Ptechgithub/pp-worker / checkUuidInApiResponse

Function checkUuidInApiResponse

_worker.js:312–329  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

310 * @returns {Promise<boolean>} A Promise that resolves to true if the UUID is present in the API response, false otherwise.
311 */
312async 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";

Callers

nothing calls this directly

Calls 1

getApiResponseFunction · 0.85

Tested by

no test coverage detected