Skip to content

Commit

Permalink
Merge branch 'master' into retrieve-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
101arrowz committed Jul 11, 2023
2 parents 2dae1ad + 4464a20 commit a73be92
Show file tree
Hide file tree
Showing 9 changed files with 2,433 additions and 1,551 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/provenance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish Package to npmjs

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: read
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org'
cache: npm
- run: npm install -g npm@latest
- run: npm install
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Publishing a new version

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.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const { SocketSdk } = require('@socketsecurity/sdk')
* `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
* `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.
* `getReportList()`
* `getReportSupportedFiles()`
* `getReport(id)`
* `id`: A `string` representing the id of a created report

Expand Down
6 changes: 3 additions & 3 deletions build/generate-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Promise.resolve().then(async () => {
const { default: openapiTS } = await import('openapi-typescript')

const localPath = path.resolve(__dirname, '../openapi.json')
const output = await openapiTS(localPath, {
formatter (node) {
if (node.format === 'binary') {
const output = await openapiTS(localPath, {
transform (schemaObject) {
if ('format' in schemaObject && schemaObject.format === 'binary') {
return 'never'
}
}
Expand Down
13 changes: 13 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,19 @@ class SocketSdk {
}
}

/**
* @returns {Promise<SocketSdkResultType<'getReportSupportedFiles'>>}
*/
async getReportSupportedFiles () {
try {
const client = await this.#getClient()
const data = await client.get('report/supported').json()
return { success: true, status: 200, data }
} catch (err) {
return /** @type {SocketSdkErrorType<'getReportSupportedFiles'>} */ (this.#handleApiError(err))
}
}

/** @returns {Promise<SocketSdkResultType<'getQuota'>>} */
async getQuota () {
try {
Expand Down
Loading

0 comments on commit a73be92

Please sign in to comment.