Skip to content

Commit 7d63ce5

Browse files
committed
add dependencies endpoint
1 parent 51f3ddd commit 7d63ce5

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,20 @@ class SocketSdk {
509509
}
510510
}
511511

512+
/**
513+
* @param {{[key: string]: number }} params
514+
* @returns {Promise<SocketSdkResultType<'batchPackageFetch'>>}
515+
*/
516+
async searchDependencies (params) {
517+
try {
518+
const client = await this.#getClient()
519+
const data = await client.post('dependencies/search', { json: params }).json()
520+
return { success: true, status: 200, data }
521+
} catch (err) {
522+
return /** @type {SocketSdkErrorType<'batchPackageFetch'>} */ (this.#handleApiError(err))
523+
}
524+
}
525+
512526
/**
513527
* @param {Array<{ organization?: string }>} selectors
514528
* @returns {Promise<SocketSdkResultType<'postSettings'>>}

0 commit comments

Comments
 (0)