@socketsecurity/sdk 3.3.0 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -2
- package/README.md +2 -15
- package/data/api-method-quota-and-permissions.json +20 -0
- package/dist/constants.d.ts +1 -1
- package/dist/http-client.d.ts +3 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +310 -142
- package/dist/socket-sdk-class.d.ts +130 -25
- package/dist/types-strict.d.ts +47 -2
- package/dist/types.d.ts +6 -5
- package/package.json +6 -7
- package/types/api.d.ts +1250 -105
|
@@ -112,7 +112,7 @@ export declare class SocketSdk {
|
|
|
112
112
|
*
|
|
113
113
|
* @see https://docs.socket.dev/reference/createorgfullscan
|
|
114
114
|
* @apiEndpoint POST /orgs/{org_slug}/full-scans
|
|
115
|
-
* @quota
|
|
115
|
+
* @quota 0 units
|
|
116
116
|
* @scopes full-scans:create
|
|
117
117
|
* @throws {Error} When server returns 5xx status codes
|
|
118
118
|
*/
|
|
@@ -121,9 +121,42 @@ export declare class SocketSdk {
|
|
|
121
121
|
* Create a diff scan from two full scan IDs.
|
|
122
122
|
* Compares two existing full scans to identify changes.
|
|
123
123
|
*
|
|
124
|
+
* @param orgSlug - Organization identifier
|
|
125
|
+
* @param options - Diff scan creation options
|
|
126
|
+
* @param options.after - ID of the after/head full scan (newer)
|
|
127
|
+
* @param options.before - ID of the before/base full scan (older)
|
|
128
|
+
* @param options.description - Description of the diff scan
|
|
129
|
+
* @param options.external_href - External URL to associate with the diff scan
|
|
130
|
+
* @param options.merge - Set true for merged commits, false for open PR diffs
|
|
131
|
+
* @returns Diff scan details
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```typescript
|
|
135
|
+
* const result = await sdk.createOrgDiffScanFromIds('my-org', {
|
|
136
|
+
* before: 'scan-id-1',
|
|
137
|
+
* after: 'scan-id-2',
|
|
138
|
+
* description: 'Compare versions',
|
|
139
|
+
* merge: false
|
|
140
|
+
* })
|
|
141
|
+
*
|
|
142
|
+
* if (result.success) {
|
|
143
|
+
* console.log('Diff scan created:', result.data.diff_scan.id)
|
|
144
|
+
* }
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @see https://docs.socket.dev/reference/createorgdiffscanfromids
|
|
148
|
+
* @apiEndpoint POST /orgs/{org_slug}/diff-scans/from-ids
|
|
149
|
+
* @quota 0 units
|
|
150
|
+
* @scopes diff-scans:create, full-scans:list
|
|
124
151
|
* @throws {Error} When server returns 5xx status codes
|
|
125
152
|
*/
|
|
126
|
-
createOrgDiffScanFromIds(orgSlug: string,
|
|
153
|
+
createOrgDiffScanFromIds(orgSlug: string, options: {
|
|
154
|
+
after: string;
|
|
155
|
+
before: string;
|
|
156
|
+
description?: string | undefined;
|
|
157
|
+
external_href?: string | undefined;
|
|
158
|
+
merge?: boolean | undefined;
|
|
159
|
+
}): Promise<SocketSdkResult<'createOrgDiffScanFromIds'>>;
|
|
127
160
|
/**
|
|
128
161
|
* Create a full scan from an archive file (.tar, .tar.gz/.tgz, or .zip).
|
|
129
162
|
* Uploads and scans a compressed archive of project files.
|
|
@@ -177,15 +210,22 @@ export declare class SocketSdk {
|
|
|
177
210
|
* Registers a repository for monitoring and security scanning.
|
|
178
211
|
*
|
|
179
212
|
* @param orgSlug - Organization identifier
|
|
180
|
-
* @param
|
|
213
|
+
* @param repoSlug - Repository name/slug
|
|
214
|
+
* @param params - Additional repository configuration
|
|
215
|
+
* @param params.archived - Whether the repository is archived
|
|
216
|
+
* @param params.default_branch - Default branch of the repository
|
|
217
|
+
* @param params.description - Description of the repository
|
|
218
|
+
* @param params.homepage - Homepage URL of the repository
|
|
219
|
+
* @param params.visibility - Visibility setting ('public' or 'private')
|
|
220
|
+
* @param params.workspace - Workspace of the repository
|
|
181
221
|
* @returns Created repository details
|
|
182
222
|
*
|
|
183
223
|
* @example
|
|
184
224
|
* ```typescript
|
|
185
|
-
* const result = await sdk.createRepository('my-org', {
|
|
186
|
-
* name: 'my-repo',
|
|
225
|
+
* const result = await sdk.createRepository('my-org', 'my-repo', {
|
|
187
226
|
* description: 'My project repository',
|
|
188
|
-
* homepage: 'https://example.com'
|
|
227
|
+
* homepage: 'https://example.com',
|
|
228
|
+
* visibility: 'private'
|
|
189
229
|
* })
|
|
190
230
|
*
|
|
191
231
|
* if (result.success) {
|
|
@@ -195,11 +235,18 @@ export declare class SocketSdk {
|
|
|
195
235
|
*
|
|
196
236
|
* @see https://docs.socket.dev/reference/createorgrepo
|
|
197
237
|
* @apiEndpoint POST /orgs/{org_slug}/repos
|
|
198
|
-
* @quota
|
|
238
|
+
* @quota 0 units
|
|
199
239
|
* @scopes repo:write
|
|
200
240
|
* @throws {Error} When server returns 5xx status codes
|
|
201
241
|
*/
|
|
202
|
-
createRepository(orgSlug: string,
|
|
242
|
+
createRepository(orgSlug: string, repoSlug: string, params?: {
|
|
243
|
+
archived?: boolean | undefined;
|
|
244
|
+
default_branch?: null | string | undefined;
|
|
245
|
+
description?: null | string | undefined;
|
|
246
|
+
homepage?: null | string | undefined;
|
|
247
|
+
visibility?: 'private' | 'public' | undefined;
|
|
248
|
+
workspace?: string | undefined;
|
|
249
|
+
} | undefined): Promise<RepositoryResult | StrictErrorResult>;
|
|
203
250
|
/**
|
|
204
251
|
* Create a new repository label for an organization.
|
|
205
252
|
*
|
|
@@ -221,7 +268,7 @@ export declare class SocketSdk {
|
|
|
221
268
|
*
|
|
222
269
|
* @see https://docs.socket.dev/reference/createorgrepolabel
|
|
223
270
|
* @apiEndpoint POST /orgs/{org_slug}/repos/labels
|
|
224
|
-
* @quota
|
|
271
|
+
* @quota 0 units
|
|
225
272
|
* @scopes repo-label:create
|
|
226
273
|
* @throws {Error} When server returns 5xx status codes
|
|
227
274
|
*/
|
|
@@ -246,7 +293,7 @@ export declare class SocketSdk {
|
|
|
246
293
|
*
|
|
247
294
|
* @see https://docs.socket.dev/reference/deleteorgfullscan
|
|
248
295
|
* @apiEndpoint DELETE /orgs/{org_slug}/full-scans/{full_scan_id}
|
|
249
|
-
* @quota
|
|
296
|
+
* @quota 0 units
|
|
250
297
|
* @scopes full-scans:delete
|
|
251
298
|
* @throws {Error} When server returns 5xx status codes
|
|
252
299
|
*/
|
|
@@ -290,7 +337,7 @@ export declare class SocketSdk {
|
|
|
290
337
|
*
|
|
291
338
|
* @see https://docs.socket.dev/reference/deleteorgrepo
|
|
292
339
|
* @apiEndpoint DELETE /orgs/{org_slug}/repos/{repo_slug}
|
|
293
|
-
* @quota
|
|
340
|
+
* @quota 0 units
|
|
294
341
|
* @scopes repo:write
|
|
295
342
|
* @throws {Error} When server returns 5xx status codes
|
|
296
343
|
*/
|
|
@@ -315,7 +362,7 @@ export declare class SocketSdk {
|
|
|
315
362
|
*
|
|
316
363
|
* @see https://docs.socket.dev/reference/deleteorgrepolabel
|
|
317
364
|
* @apiEndpoint DELETE /orgs/{org_slug}/repos/labels/{label_id}
|
|
318
|
-
* @quota
|
|
365
|
+
* @quota 0 units
|
|
319
366
|
* @scopes repo-label:delete
|
|
320
367
|
* @throws {Error} When server returns 5xx status codes
|
|
321
368
|
*/
|
|
@@ -402,7 +449,7 @@ export declare class SocketSdk {
|
|
|
402
449
|
*
|
|
403
450
|
* @see https://docs.socket.dev/reference/exportopenvex
|
|
404
451
|
* @apiEndpoint GET /orgs/{org_slug}/export/openvex/{id}
|
|
405
|
-
* @quota
|
|
452
|
+
* @quota 0 units
|
|
406
453
|
* @scopes report:read
|
|
407
454
|
* @throws {Error} When server returns 5xx status codes
|
|
408
455
|
*/
|
|
@@ -447,6 +494,35 @@ export declare class SocketSdk {
|
|
|
447
494
|
* @throws {Error} When server returns 5xx status codes
|
|
448
495
|
*/
|
|
449
496
|
getDiffScanById(orgSlug: string, diffScanId: string): Promise<SocketSdkResult<'getDiffScanById'>>;
|
|
497
|
+
/**
|
|
498
|
+
* Get GitHub-flavored markdown comments for a diff scan.
|
|
499
|
+
* Returns dependency overview and alert comments suitable for pull requests.
|
|
500
|
+
*
|
|
501
|
+
* @param orgSlug - Organization identifier
|
|
502
|
+
* @param diffScanId - Diff scan identifier
|
|
503
|
+
* @param options - Optional query parameters
|
|
504
|
+
* @param options.github_installation_id - GitHub installation ID for settings
|
|
505
|
+
* @returns Diff scan metadata with formatted markdown comments
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* ```typescript
|
|
509
|
+
* const result = await sdk.getDiffScanGfm('my-org', 'diff-scan-id')
|
|
510
|
+
*
|
|
511
|
+
* if (result.success) {
|
|
512
|
+
* console.log(result.data.dependency_overview_comment)
|
|
513
|
+
* console.log(result.data.dependency_alert_comment)
|
|
514
|
+
* }
|
|
515
|
+
* ```
|
|
516
|
+
*
|
|
517
|
+
* @see https://docs.socket.dev/reference/getdiffscangfm
|
|
518
|
+
* @apiEndpoint GET /orgs/{org_slug}/diff-scans/{diff_scan_id}/gfm
|
|
519
|
+
* @quota 0 units
|
|
520
|
+
* @scopes diff-scans:list
|
|
521
|
+
* @throws {Error} When server returns 5xx status codes
|
|
522
|
+
*/
|
|
523
|
+
getDiffScanGfm(orgSlug: string, diffScanId: string, options?: {
|
|
524
|
+
github_installation_id?: string | undefined;
|
|
525
|
+
} | undefined): Promise<SocketSdkResult<'GetDiffScanGfm'>>;
|
|
450
526
|
/**
|
|
451
527
|
* Retrieve the enabled entitlements for an organization.
|
|
452
528
|
*
|
|
@@ -483,7 +559,7 @@ export declare class SocketSdk {
|
|
|
483
559
|
*
|
|
484
560
|
* @see https://docs.socket.dev/reference/getorgfullscan
|
|
485
561
|
* @apiEndpoint GET /orgs/{org_slug}/full-scans/{full_scan_id}
|
|
486
|
-
* @quota
|
|
562
|
+
* @quota 0 units
|
|
487
563
|
* @scopes full-scans:list
|
|
488
564
|
* @throws {Error} When server returns 5xx status codes
|
|
489
565
|
*/
|
|
@@ -510,7 +586,7 @@ export declare class SocketSdk {
|
|
|
510
586
|
*
|
|
511
587
|
* @see https://docs.socket.dev/reference/getorgfullscanmetadata
|
|
512
588
|
* @apiEndpoint GET /orgs/{org_slug}/full-scans/{full_scan_id}/metadata
|
|
513
|
-
* @quota
|
|
589
|
+
* @quota 0 units
|
|
514
590
|
* @scopes full-scans:list
|
|
515
591
|
* @throws {Error} When server returns 5xx status codes
|
|
516
592
|
*/
|
|
@@ -733,7 +809,7 @@ export declare class SocketSdk {
|
|
|
733
809
|
*
|
|
734
810
|
* @see https://docs.socket.dev/reference/getorgrepo
|
|
735
811
|
* @apiEndpoint GET /orgs/{org_slug}/repos/{repo_slug}
|
|
736
|
-
* @quota
|
|
812
|
+
* @quota 0 units
|
|
737
813
|
* @scopes repo:read
|
|
738
814
|
* @throws {Error} When server returns 5xx status codes
|
|
739
815
|
*/
|
|
@@ -760,7 +836,7 @@ export declare class SocketSdk {
|
|
|
760
836
|
*
|
|
761
837
|
* @see https://docs.socket.dev/reference/getorgrepolabel
|
|
762
838
|
* @apiEndpoint GET /orgs/{org_slug}/repos/labels/{label_id}
|
|
763
|
-
* @quota
|
|
839
|
+
* @quota 0 units
|
|
764
840
|
* @scopes repo-label:list
|
|
765
841
|
* @throws {Error} When server returns 5xx status codes
|
|
766
842
|
*/
|
|
@@ -772,10 +848,39 @@ export declare class SocketSdk {
|
|
|
772
848
|
* @throws {Error} When server returns 5xx status codes
|
|
773
849
|
*/
|
|
774
850
|
getScoreByNpmPackage(pkgName: string, version: string): Promise<SocketSdkResult<'getScoreByNPMPackage'>>;
|
|
851
|
+
/**
|
|
852
|
+
* Get list of supported file types for full scan generation.
|
|
853
|
+
* Returns glob patterns for supported manifest files, lockfiles, and configuration formats.
|
|
854
|
+
*
|
|
855
|
+
* Files whose names match the patterns returned by this endpoint can be uploaded
|
|
856
|
+
* for report generation. Examples include `package.json`, `package-lock.json`, and `yarn.lock`.
|
|
857
|
+
*
|
|
858
|
+
* @param orgSlug - Organization identifier
|
|
859
|
+
* @returns Nested object with environment and file type patterns
|
|
860
|
+
*
|
|
861
|
+
* @example
|
|
862
|
+
* ```typescript
|
|
863
|
+
* const result = await sdk.getSupportedFiles('my-org')
|
|
864
|
+
*
|
|
865
|
+
* if (result.success) {
|
|
866
|
+
* console.log('NPM patterns:', result.data.NPM)
|
|
867
|
+
* console.log('PyPI patterns:', result.data.PyPI)
|
|
868
|
+
* }
|
|
869
|
+
* ```
|
|
870
|
+
*
|
|
871
|
+
* @see https://docs.socket.dev/reference/getsupportedfiles
|
|
872
|
+
* @apiEndpoint GET /orgs/{org_slug}/supported-files
|
|
873
|
+
* @quota 0 units
|
|
874
|
+
* @scopes No scopes required, but authentication is required
|
|
875
|
+
* @throws {Error} When server returns 5xx status codes
|
|
876
|
+
*/
|
|
877
|
+
getSupportedFiles(orgSlug: string): Promise<SocketSdkResult<'getSupportedFiles'>>;
|
|
775
878
|
/**
|
|
776
879
|
* Get list of file types and formats supported for scanning.
|
|
777
880
|
* Returns supported manifest files, lockfiles, and configuration formats.
|
|
778
881
|
*
|
|
882
|
+
* @deprecated Use getSupportedFiles() instead. This endpoint has been deprecated
|
|
883
|
+
* since 2023-01-15 and now uses the /report/supported endpoint.
|
|
779
884
|
* @throws {Error} When server returns 5xx status codes
|
|
780
885
|
*/
|
|
781
886
|
getSupportedScanFiles(): Promise<SocketSdkResult<'getReportSupportedFiles'>>;
|
|
@@ -806,7 +911,7 @@ export declare class SocketSdk {
|
|
|
806
911
|
*
|
|
807
912
|
* @see https://docs.socket.dev/reference/getorgfullscanlist
|
|
808
913
|
* @apiEndpoint GET /orgs/{org_slug}/full-scans
|
|
809
|
-
* @quota
|
|
914
|
+
* @quota 0 units
|
|
810
915
|
* @scopes full-scans:list
|
|
811
916
|
* @throws {Error} When server returns 5xx status codes
|
|
812
917
|
*/
|
|
@@ -831,7 +936,7 @@ export declare class SocketSdk {
|
|
|
831
936
|
*
|
|
832
937
|
* @see https://docs.socket.dev/reference/getorganizations
|
|
833
938
|
* @apiEndpoint GET /organizations
|
|
834
|
-
* @quota
|
|
939
|
+
* @quota 0 units
|
|
835
940
|
* @throws {Error} When server returns 5xx status codes
|
|
836
941
|
*/
|
|
837
942
|
listOrganizations(): Promise<OrganizationsResult | StrictErrorResult>;
|
|
@@ -868,7 +973,7 @@ export declare class SocketSdk {
|
|
|
868
973
|
*
|
|
869
974
|
* @see https://docs.socket.dev/reference/getorgrepolist
|
|
870
975
|
* @apiEndpoint GET /orgs/{org_slug}/repos
|
|
871
|
-
* @quota
|
|
976
|
+
* @quota 0 units
|
|
872
977
|
* @scopes repo:list
|
|
873
978
|
* @throws {Error} When server returns 5xx status codes
|
|
874
979
|
*/
|
|
@@ -896,7 +1001,7 @@ export declare class SocketSdk {
|
|
|
896
1001
|
*
|
|
897
1002
|
* @see https://docs.socket.dev/reference/getorgrepolabellist
|
|
898
1003
|
* @apiEndpoint GET /orgs/{org_slug}/repos/labels
|
|
899
|
-
* @quota
|
|
1004
|
+
* @quota 0 units
|
|
900
1005
|
* @scopes repo-label:list
|
|
901
1006
|
* @throws {Error} When server returns 5xx status codes
|
|
902
1007
|
*/
|
|
@@ -978,7 +1083,7 @@ export declare class SocketSdk {
|
|
|
978
1083
|
*
|
|
979
1084
|
* @see https://docs.socket.dev/reference/rescanorgfullscan
|
|
980
1085
|
* @apiEndpoint POST /orgs/{org_slug}/full-scans/{full_scan_id}/rescan
|
|
981
|
-
* @quota
|
|
1086
|
+
* @quota 0 units
|
|
982
1087
|
* @scopes full-scans:create
|
|
983
1088
|
* @throws {Error} When server returns 5xx status codes
|
|
984
1089
|
*/
|
|
@@ -1029,7 +1134,7 @@ export declare class SocketSdk {
|
|
|
1029
1134
|
*
|
|
1030
1135
|
* @see https://docs.socket.dev/reference/getorgfullscan
|
|
1031
1136
|
* @apiEndpoint GET /orgs/{org_slug}/full-scans/{full_scan_id}
|
|
1032
|
-
* @quota
|
|
1137
|
+
* @quota 0 units
|
|
1033
1138
|
* @scopes full-scans:list
|
|
1034
1139
|
* @throws {Error} When server returns 5xx status codes
|
|
1035
1140
|
*/
|
|
@@ -1122,7 +1227,7 @@ export declare class SocketSdk {
|
|
|
1122
1227
|
*
|
|
1123
1228
|
* @see https://docs.socket.dev/reference/updateorgrepo
|
|
1124
1229
|
* @apiEndpoint POST /orgs/{org_slug}/repos/{repo_slug}
|
|
1125
|
-
* @quota
|
|
1230
|
+
* @quota 0 units
|
|
1126
1231
|
* @scopes repo:write
|
|
1127
1232
|
* @throws {Error} When server returns 5xx status codes
|
|
1128
1233
|
*/
|
|
@@ -1149,7 +1254,7 @@ export declare class SocketSdk {
|
|
|
1149
1254
|
*
|
|
1150
1255
|
* @see https://docs.socket.dev/reference/updateorgrepolabel
|
|
1151
1256
|
* @apiEndpoint PUT /orgs/{org_slug}/repos/labels/{label_id}
|
|
1152
|
-
* @quota
|
|
1257
|
+
* @quota 0 units
|
|
1153
1258
|
* @scopes repo-label:update
|
|
1154
1259
|
* @throws {Error} When server returns 5xx status codes
|
|
1155
1260
|
*/
|
package/dist/types-strict.d.ts
CHANGED
|
@@ -50,6 +50,7 @@ export type FullScanItem = {
|
|
|
50
50
|
repository_id: string;
|
|
51
51
|
repository_slug: string;
|
|
52
52
|
scan_state?: 'pending' | 'precrawl' | 'resolve' | 'scan' | null | undefined;
|
|
53
|
+
scan_type?: string | null | undefined;
|
|
53
54
|
updated_at: string;
|
|
54
55
|
workspace?: string | undefined;
|
|
55
56
|
};
|
|
@@ -79,6 +80,7 @@ export type ListFullScansOptions = {
|
|
|
79
80
|
per_page?: number | undefined;
|
|
80
81
|
pull_request?: string | undefined;
|
|
81
82
|
repo?: string | undefined;
|
|
83
|
+
scan_type?: string | undefined;
|
|
82
84
|
sort?: 'name' | 'created_at' | undefined;
|
|
83
85
|
startAfterCursor?: string | undefined;
|
|
84
86
|
use_cursor?: boolean | undefined;
|
|
@@ -109,7 +111,50 @@ export type OrganizationItem = {
|
|
|
109
111
|
*/
|
|
110
112
|
export type RepositoriesListData = {
|
|
111
113
|
nextPage?: number | null | undefined;
|
|
112
|
-
results:
|
|
114
|
+
results: RepositoryListItem[];
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Strict type for repository list item.
|
|
118
|
+
*/
|
|
119
|
+
export type RepositoryListItem = {
|
|
120
|
+
archived: boolean;
|
|
121
|
+
created_at: string;
|
|
122
|
+
default_branch: string | null;
|
|
123
|
+
description: string | null;
|
|
124
|
+
head_full_scan_id: string | null;
|
|
125
|
+
homepage: string | null;
|
|
126
|
+
id: string;
|
|
127
|
+
integration_meta?: {
|
|
128
|
+
/** @enum {string} */
|
|
129
|
+
type?: 'github';
|
|
130
|
+
value?: {
|
|
131
|
+
/**
|
|
132
|
+
* @description The GitHub installation_id of the active associated Socket GitHub App
|
|
133
|
+
* @default
|
|
134
|
+
*/
|
|
135
|
+
installation_id: string;
|
|
136
|
+
/**
|
|
137
|
+
* @description The GitHub login name that the active Socket GitHub App installation is installed to
|
|
138
|
+
* @default
|
|
139
|
+
*/
|
|
140
|
+
installation_login: string;
|
|
141
|
+
/**
|
|
142
|
+
* @description The name of the associated GitHub repo.
|
|
143
|
+
* @default
|
|
144
|
+
*/
|
|
145
|
+
repo_name: string | null;
|
|
146
|
+
/**
|
|
147
|
+
* @description The id of the associated GitHub repo.
|
|
148
|
+
* @default
|
|
149
|
+
*/
|
|
150
|
+
repo_id: string | null;
|
|
151
|
+
};
|
|
152
|
+
} | null | undefined;
|
|
153
|
+
name: string;
|
|
154
|
+
slug: string;
|
|
155
|
+
updated_at: string;
|
|
156
|
+
visibility: 'public' | 'private';
|
|
157
|
+
workspace: string;
|
|
113
158
|
};
|
|
114
159
|
/**
|
|
115
160
|
* Strict type for repository item.
|
|
@@ -149,7 +194,7 @@ export type RepositoryItem = {
|
|
|
149
194
|
};
|
|
150
195
|
} | null;
|
|
151
196
|
name: string;
|
|
152
|
-
slig
|
|
197
|
+
slig: string;
|
|
153
198
|
slug: string;
|
|
154
199
|
updated_at: string;
|
|
155
200
|
visibility: 'public' | 'private';
|
package/dist/types.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export type SocketSdkErrorResult<T extends SocketSdkOperations> = {
|
|
|
140
140
|
error: string;
|
|
141
141
|
status: number;
|
|
142
142
|
success: false;
|
|
143
|
+
url?: string | undefined;
|
|
143
144
|
_operation?: T | undefined;
|
|
144
145
|
};
|
|
145
146
|
export type SocketSdkResult<T extends SocketSdkOperations> = SocketSdkSuccessResult<T> | SocketSdkErrorResult<T>;
|
|
@@ -168,6 +169,7 @@ export type SocketSdkGenericResult<T> = {
|
|
|
168
169
|
error: string;
|
|
169
170
|
status: number;
|
|
170
171
|
success: false;
|
|
172
|
+
url?: string | undefined;
|
|
171
173
|
};
|
|
172
174
|
/**
|
|
173
175
|
* Result from file validation callback.
|
|
@@ -268,14 +270,13 @@ export interface SocketSdkOptions {
|
|
|
268
270
|
onResponse?: ((info: ResponseInfo) => void) | undefined;
|
|
269
271
|
} | undefined;
|
|
270
272
|
/**
|
|
271
|
-
* Number of retry attempts on failure (default:
|
|
272
|
-
*
|
|
273
|
-
* Recommended: 3 for production, 0 for testing.
|
|
273
|
+
* Number of retry attempts on failure (default: 3).
|
|
274
|
+
* Uses exponential backoff between retries.
|
|
274
275
|
*/
|
|
275
276
|
retries?: number | undefined;
|
|
276
277
|
/**
|
|
277
|
-
* Initial delay in milliseconds between retries (default:
|
|
278
|
-
* Uses exponential backoff:
|
|
278
|
+
* Initial delay in milliseconds between retries (default: 1000).
|
|
279
|
+
* Uses exponential backoff: 1000ms, 2000ms, 4000ms, etc.
|
|
279
280
|
*/
|
|
280
281
|
retryDelay?: number | undefined;
|
|
281
282
|
/** Request timeout in milliseconds */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/sdk",
|
|
3
|
-
"version": "3.3.
|
|
4
|
-
"packageManager": "pnpm@10.
|
|
3
|
+
"version": "3.3.1",
|
|
4
|
+
"packageManager": "pnpm@10.30.3",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "SDK for the Socket API client",
|
|
7
7
|
"author": {
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@socketregistry/packageurl-js": "1.3.5",
|
|
60
|
-
"@socketsecurity/lib": "5.
|
|
60
|
+
"@socketsecurity/lib": "5.7.0",
|
|
61
61
|
"form-data": "4.0.5"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
@@ -66,14 +66,14 @@
|
|
|
66
66
|
"@babel/traverse": "7.26.4",
|
|
67
67
|
"@babel/types": "7.26.3",
|
|
68
68
|
"@biomejs/biome": "2.2.4",
|
|
69
|
-
"@dotenvx/dotenvx": "^1.
|
|
69
|
+
"@dotenvx/dotenvx": "^1.52.0",
|
|
70
70
|
"@eslint/compat": "1.3.2",
|
|
71
71
|
"@eslint/js": "9.35.0",
|
|
72
|
+
"@sveltejs/acorn-typescript": "1.0.8",
|
|
72
73
|
"@types/babel__traverse": "7.28.0",
|
|
73
74
|
"@types/node": "24.9.2",
|
|
74
75
|
"@typescript/native-preview": "7.0.0-dev.20250926.1",
|
|
75
76
|
"@vitest/coverage-v8": "4.0.3",
|
|
76
|
-
"@sveltejs/acorn-typescript": "1.0.8",
|
|
77
77
|
"acorn": "8.15.0",
|
|
78
78
|
"del": "8.0.1",
|
|
79
79
|
"dev-null-cli": "2.0.0",
|
|
@@ -96,8 +96,7 @@
|
|
|
96
96
|
"taze": "19.9.2",
|
|
97
97
|
"type-coverage": "2.29.7",
|
|
98
98
|
"typescript-eslint": "8.44.1",
|
|
99
|
-
"vitest": "4.0.3"
|
|
100
|
-
"yoctocolors-cjs": "2.1.3"
|
|
99
|
+
"vitest": "4.0.3"
|
|
101
100
|
},
|
|
102
101
|
"pnpm": {
|
|
103
102
|
"ignoredBuiltDependencies": [
|