Skip to content

Commit a73be92

Browse files
committed
Merge branch 'master' into retrieve-settings
2 parents 2dae1ad + 4464a20 commit a73be92

File tree

9 files changed

+2433
-1551
lines changed

9 files changed

+2433
-1551
lines changed

.github/workflows/provenance.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish Package to npmjs
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: '18'
20+
registry-url: 'https://registry.npmjs.org'
21+
cache: npm
22+
- run: npm install -g npm@latest
23+
- run: npm install
24+
- run: npm publish --provenance --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CONTRIBUTING.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Publishing a new version
2+
3+
This repository uses `npm` provided provenance using GitHub Actions, please update the version in `package.json` using an appropriate tag and create a release using GitHub, the `.github/workflows/provenance.yml` action should publish it to `npm` from there.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const { SocketSdk } = require('@socketsecurity/sdk')
5353
* `pathsRelativeTo`: A `string` path that the absolute paths `filePaths` are relative to. This to calculate where in your project the `package.json`/`package-lock.json` files lives
5454
* `issueRules`: An object that follows the format of the [`socket.yml`](https://docs.socket.dev/docs/socket-yml) issue rules. Keys being issue names, values being a boolean that activates or deactivates it. Is applied on top of default config and organization config.
5555
* `getReportList()`
56+
* `getReportSupportedFiles()`
5657
* `getReport(id)`
5758
* `id`: A `string` representing the id of a created report
5859

build/generate-types.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ Promise.resolve().then(async () => {
66
const { default: openapiTS } = await import('openapi-typescript')
77

88
const localPath = path.resolve(__dirname, '../openapi.json')
9-
const output = await openapiTS(localPath, {
10-
formatter (node) {
11-
if (node.format === 'binary') {
9+
const output = await openapiTS(localPath, {
10+
transform (schemaObject) {
11+
if ('format' in schemaObject && schemaObject.format === 'binary') {
1212
return 'never'
1313
}
1414
}

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,19 @@ class SocketSdk {
190190
}
191191
}
192192

193+
/**
194+
* @returns {Promise<SocketSdkResultType<'getReportSupportedFiles'>>}
195+
*/
196+
async getReportSupportedFiles () {
197+
try {
198+
const client = await this.#getClient()
199+
const data = await client.get('report/supported').json()
200+
return { success: true, status: 200, data }
201+
} catch (err) {
202+
return /** @type {SocketSdkErrorType<'getReportSupportedFiles'>} */ (this.#handleApiError(err))
203+
}
204+
}
205+
193206
/** @returns {Promise<SocketSdkResultType<'getQuota'>>} */
194207
async getQuota () {
195208
try {

0 commit comments

Comments
 (0)