Skip to content

Commit f10c981

Browse files
committed
Update sdk and types
1 parent fc406cb commit f10c981

12 files changed

+35
-26
lines changed

package-lock.json

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"@socketregistry/packageurl-js": "1.0.4",
8181
"@socketsecurity/config": "2.1.3",
8282
"@socketsecurity/registry": "1.0.132",
83-
"@socketsecurity/sdk": "1.4.7",
83+
"@socketsecurity/sdk": "1.4.10",
8484
"blessed": "0.1.81",
8585
"blessed-contrib": "4.11.0",
8686
"browserslist": "4.24.4",

src/commands/audit-log/get-audit-log.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { stripIndents } from 'common-tags'
22

33
import { logger } from '@socketsecurity/registry/lib/logger'
44
import { Separator, select } from '@socketsecurity/registry/lib/prompts'
5-
import { SocketSdkReturnType } from '@socketsecurity/sdk'
65

76
import constants from '../../constants'
87
import { handleApiCall, handleUnsuccessfulApiResponse } from '../../utils/api'
@@ -11,6 +10,7 @@ import { mdTable } from '../../utils/markdown'
1110
import { getDefaultToken, setupSdk } from '../../utils/sdk'
1211

1312
import type { Choice } from '@socketsecurity/registry/lib/prompts'
13+
import type { SocketSdkReturnType } from '@socketsecurity/sdk'
1414

1515
type AuditChoice = Choice<string>
1616

@@ -198,12 +198,14 @@ async function getAuditLogWithToken({
198198
const socketSdk = await setupSdk(apiToken)
199199
const result = await handleApiCall(
200200
socketSdk.getAuditLogEvents(orgSlug, {
201-
outputJson: outputKind === 'json', // I'm not sure this is used at all
202-
outputMarkdown: outputKind === 'markdown', // I'm not sure this is used at all
201+
// I'm not sure this is used at all.
202+
outputJson: String(outputKind === 'json'),
203+
// I'm not sure this is used at all.
204+
outputMarkdown: String(outputKind === 'markdown'),
203205
orgSlug,
204206
type: logType,
205-
page,
206-
per_page: perPage
207+
page: String(page),
208+
per_page: String(perPage)
207209
}),
208210
`Looking up audit log for ${orgSlug}\n`
209211
)

src/commands/diff-scan/get-diff-scan.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ import util from 'node:util'
44
import colors from 'yoctocolors-cjs'
55

66
import { logger } from '@socketsecurity/registry/lib/logger'
7-
import { SocketSdkReturnType } from '@socketsecurity/sdk'
87

98
import constants from '../../constants'
109
import { handleAPIError, handleApiCall, queryAPI } from '../../utils/api'
1110
import { AuthError } from '../../utils/errors'
1211
import { getDefaultToken } from '../../utils/sdk'
1312

13+
import type { SocketSdkReturnType } from '@socketsecurity/sdk'
14+
1415
export async function getDiffScan({
1516
after,
1617
before,

src/commands/report/view-report.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { components } from '@socketsecurity/sdk/types/api'
2-
31
import { fetchReportData } from './fetch-report-data'
42
import { formatReportDataOutput } from './format-report-data'
53
import { getFullScan } from '../scan/get-full-scan'
64

5+
import type { components } from '@socketsecurity/sdk/types/api'
6+
77
export async function viewReport(
88
reportId: string,
99
{

src/commands/repos/list-repos.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ async function listReposWithToken({
6969
socketSdk.getOrgRepoList(orgSlug, {
7070
sort,
7171
direction,
72-
per_page,
73-
page
72+
per_page: String(per_page),
73+
page: String(page)
7474
}),
7575
'listing repositories'
7676
)

src/commands/scan/create-full-scan.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ export async function createFullScan({
186186
repo: repoName,
187187
branch: branchName,
188188
commit_message: commitMessage,
189-
make_default_branch: defaultBranch,
190-
set_as_pending_head: pendingHead,
191-
tmp
189+
make_default_branch: String(defaultBranch),
190+
set_as_pending_head: String(pendingHead),
191+
tmp: String(tmp)
192192
},
193193
packagePaths,
194194
cwd

src/commands/scan/fetch-report-data.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import colors from 'yoctocolors-cjs'
22

33
import { logger } from '@socketsecurity/registry/lib/logger'
4-
import { SocketSdkResultType, SocketSdkReturnType } from '@socketsecurity/sdk'
5-
import { components } from '@socketsecurity/sdk/types/api'
64

75
import constants from '../../constants'
86
import { handleAPIError, handleApiCall, queryAPI } from '../../utils/api'
97
import { AuthError } from '../../utils/errors'
108
import { getDefaultToken, setupSdk } from '../../utils/sdk'
119

10+
import type {
11+
SocketSdkResultType,
12+
SocketSdkReturnType
13+
} from '@socketsecurity/sdk'
14+
import type { components } from '@socketsecurity/sdk/types/api'
15+
1216
/**
1317
* This fetches all the relevant pieces of data to generate a report, given a
1418
* full scan ID.

src/commands/scan/get-full-scan.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import colors from 'yoctocolors-cjs'
22

33
import { logger } from '@socketsecurity/registry/lib/logger'
4-
import { components } from '@socketsecurity/sdk/types/api'
54

65
import constants from '../../constants'
76
import { handleAPIError, queryAPI } from '../../utils/api'
87
import { AuthError } from '../../utils/errors'
98
import { getDefaultToken } from '../../utils/sdk'
109

10+
import type { components } from '@socketsecurity/sdk/types/api'
11+
1112
export async function getFullScan(
1213
orgSlug: string,
1314
fullScanId: string

src/commands/scan/list-full-scans.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ async function listFullScansWithToken({
7474
socketSdk.getOrgFullScanList(orgSlug, {
7575
sort,
7676
direction,
77-
per_page,
78-
page,
77+
per_page: String(per_page),
78+
page: String(page),
7979
from: from_time
8080
}),
8181
'Listing scans'

src/commands/scan/suggest-repo-slug.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export async function suggestRepoSlug(
2323
// There's no guarantee that the cwd is part of this page. If it's not
2424
// then do an additional request and specific search for it instead.
2525
// This way we can offer the tip of "do you want to create [cwd]?".
26-
perPage: 10,
27-
page: 0
26+
perPage: '10',
27+
page: '0'
2828
}),
2929
'looking up known repos'
3030
)

src/commands/scan/view-full-scan.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import fs from 'node:fs/promises'
22

33
import { logger } from '@socketsecurity/registry/lib/logger'
4-
import { components } from '@socketsecurity/sdk/types/api'
54

65
import { getFullScan } from './get-full-scan'
76
import { mdTable } from '../../utils/markdown'
87

8+
import type { components } from '@socketsecurity/sdk/types/api'
9+
910
export async function viewFullScan(
1011
orgSlug: string,
1112
fullScanId: string,

0 commit comments

Comments
 (0)