Skip to content

Commit b03d862

Browse files
Merge pull request #200 from SocketDev/cg/addDependencies
Add dependencies endpoint
2 parents f0297e9 + 8174b1a commit b03d862

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
@@ -515,6 +515,20 @@ class SocketSdk {
515515
}
516516
}
517517

518+
/**
519+
* @param {{[key: string]: number }} params
520+
* @returns {Promise<SocketSdkResultType<'searchDependencies'>>}
521+
*/
522+
async searchDependencies (params) {
523+
try {
524+
const client = await this.#getClient()
525+
const data = await client.post('dependencies/search', { json: params }).json()
526+
return { success: true, status: 200, data }
527+
} catch (err) {
528+
return /** @type {SocketSdkErrorType<'searchDependencies'>} */ (this.#handleApiError(err))
529+
}
530+
}
531+
518532
/**
519533
* @param {Array<{ organization?: string }>} selectors
520534
* @returns {Promise<SocketSdkResultType<'postSettings'>>}

0 commit comments

Comments
 (0)