@socketsecurity/sdk
Advanced tools
Comparing version 1.3.0 to 1.4.5
@@ -68,4 +68,5 @@ export type SocketSdkOperations = keyof import('./types/api').operations; | ||
}>): Promise<SocketSdkResultType<'postSettings'>>; | ||
getOrgSecurityPolicy(orgSlug: string): Promise<SocketSdkResultType<'getOrgSecurityPolicy'>>; | ||
#private; | ||
} | ||
//# sourceMappingURL=index.d.ts.map |
16
index.js
@@ -591,2 +591,18 @@ 'use strict' | ||
/** | ||
* @param {string} orgSlug | ||
* @returns {Promise<SocketSdkResultType<'getOrgSecurityPolicy'>>} | ||
*/ | ||
async getOrgSecurityPolicy (orgSlug) { | ||
const orgSlugParam = encodeURIComponent(orgSlug) | ||
try { | ||
const client = await this.#getClient() | ||
const data = await client.get(`orgs/${orgSlugParam}/settings/security-policy`).json() | ||
return { success: true, status: 200, data } | ||
} catch (err) { | ||
return /** @type {SocketSdkErrorType<'getOrgSecurityPolicy'>} */ (this.#handleApiError(err)) | ||
} | ||
} | ||
/** | ||
* @param {unknown} err | ||
@@ -593,0 +609,0 @@ * @returns {{ success: false, status: number, error: Record<string,unknown> }} |
{ | ||
"name": "@socketsecurity/sdk", | ||
"version": "1.3.0", | ||
"version": "1.4.5", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "SDK for the Socket API client", |
@@ -66,2 +66,4 @@ # @socketsecurity/sdk | ||
* `selectors`: An array of settings selectors, e.g. `[{ organization: 'id' }]` | ||
* `getOrgSecurityPolicy(orgSlug)` | ||
* `orgSlug`: the slug of the organization | ||
@@ -68,0 +70,0 @@ ## Additional exports |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
299978
8442
108