diff --git a/openapi.json b/openapi.json index ffd1aea..f32c0a4 100644 --- a/openapi.json +++ b/openapi.json @@ -302,6 +302,28 @@ "url" ] }, + "SocketIssueSeverity": { + "type": "string", + "enum": [ + "low", + "middle", + "high", + "critical" + ], + "default": "low" + }, + "SocketCategory": { + "type": "string", + "enum": [ + "supplyChainRisk", + "quality", + "maintenance", + "vulnerability", + "license", + "miscellaneous" + ], + "default": "miscellaneous" + }, "SocketIssue": { "anyOf": [ { @@ -564,6 +586,136 @@ } } }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "mediumCVE" + ] + }, + "value": { + "allOf": [ + { + "$ref": "#/components/schemas/SocketIssueBasics" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "props": { + "type": "object", + "additionalProperties": false, + "properties": { + "cveId": { + "type": "string", + "default": "" + }, + "cwes": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + } + }, + "required": [ + "description", + "id", + "name" + ] + } + }, + "cvss": { + "type": "object", + "additionalProperties": false, + "properties": { + "score": { + "type": "number", + "default": 0 + }, + "vectorString": { + "type": "string", + "default": "" + } + }, + "required": [ + "score", + "vectorString" + ] + }, + "description": { + "type": "string", + "default": "" + }, + "firstPatchedVersionIdentifier": { + "type": "string", + "default": "" + }, + "ghsaId": { + "type": "string", + "default": "" + }, + "severity": { + "type": "string", + "default": "critical" + }, + "title": { + "type": "string", + "default": "" + }, + "url": { + "type": "string", + "default": "" + }, + "vulnerableVersionRange": { + "type": "string", + "default": "" + } + }, + "required": [ + "cveId", + "cvss", + "cwes", + "description", + "firstPatchedVersionIdentifier", + "ghsaId", + "severity", + "title", + "url", + "vulnerableVersionRange" + ] + }, + "usage": { + "$ref": "#/components/schemas/SocketUsageRef" + } + }, + "required": [ + "description", + "props" + ] + } + ] + } + } + }, { "type": "object", "additionalProperties": false, @@ -4163,7 +4315,7 @@ "type": { "type": "string", "enum": [ - "didYouMean" + "miscLicenseIssues" ] }, "value": { @@ -4183,28 +4335,18 @@ "type": "object", "additionalProperties": false, "properties": { - "alternatePackage": { + "description": { "type": "string", "default": "" }, - "editDistance": { - "type": "integer", - "default": 0 - }, - "downloads": { - "type": "integer", - "default": 0 - }, - "downloadsRatio": { - "type": "number", - "default": 1 + "location": { + "type": "string", + "default": "" } }, "required": [ - "alternatePackage", - "downloads", - "downloadsRatio", - "editDistance" + "description", + "location" ] }, "usage": { @@ -4227,7 +4369,7 @@ "type": { "type": "string", "enum": [ - "malware" + "unidentifiedLicense" ] }, "value": { @@ -4247,18 +4389,13 @@ "type": "object", "additionalProperties": false, "properties": { - "id": { - "type": "integer", - "default": 0 - }, - "note": { + "location": { "type": "string", "default": "" } }, "required": [ - "id", - "note" + "location" ] }, "usage": { @@ -4281,7 +4418,7 @@ "type": { "type": "string", "enum": [ - "telemetry" + "noLicenseFound" ] }, "value": { @@ -4300,20 +4437,7 @@ "props": { "type": "object", "additionalProperties": false, - "properties": { - "id": { - "type": "integer", - "default": 0 - }, - "note": { - "type": "string", - "default": "" - } - }, - "required": [ - "id", - "note" - ] + "properties": {} }, "usage": { "$ref": "#/components/schemas/SocketUsageRef" @@ -4335,7 +4459,7 @@ "type": { "type": "string", "enum": [ - "troll" + "explicitlyUnlicensedItem" ] }, "value": { @@ -4355,18 +4479,13 @@ "type": "object", "additionalProperties": false, "properties": { - "id": { - "type": "integer", - "default": 0 - }, - "note": { + "location": { "type": "string", "default": "" } }, "required": [ - "id", - "note" + "location" ] }, "usage": { @@ -4389,7 +4508,7 @@ "type": { "type": "string", "enum": [ - "gptSecurity" + "copyleftLicense" ] }, "value": { @@ -4409,23 +4528,13 @@ "type": "object", "additionalProperties": false, "properties": { - "notes": { + "licenseId": { "type": "string", "default": "" - }, - "confidence": { - "type": "number", - "default": 0 - }, - "severity": { - "type": "number", - "default": 0 } }, "required": [ - "confidence", - "notes", - "severity" + "licenseId" ] }, "usage": { @@ -4448,7 +4557,7 @@ "type": { "type": "string", "enum": [ - "gptAnomaly" + "nonpermissiveLicense" ] }, "value": { @@ -4468,33 +4577,13 @@ "type": "object", "additionalProperties": false, "properties": { - "notes": { + "licenseId": { "type": "string", "default": "" - }, - "confidence": { - "type": "number", - "default": 0 - }, - "severity": { - "type": "number", - "default": 0 - }, - "risk": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ], - "default": "medium" } }, "required": [ - "confidence", - "notes", - "risk", - "severity" + "licenseId" ] }, "usage": { @@ -4517,7 +4606,7 @@ "type": { "type": "string", "enum": [ - "gptMalware" + "didYouMean" ] }, "value": { @@ -4537,23 +4626,28 @@ "type": "object", "additionalProperties": false, "properties": { - "notes": { + "alternatePackage": { "type": "string", "default": "" }, - "confidence": { - "type": "number", + "editDistance": { + "type": "integer", "default": 0 }, - "severity": { - "type": "number", + "downloads": { + "type": "integer", "default": 0 + }, + "downloadsRatio": { + "type": "number", + "default": 1 } }, "required": [ - "confidence", - "notes", - "severity" + "alternatePackage", + "downloads", + "downloadsRatio", + "editDistance" ] }, "usage": { @@ -4576,7 +4670,7 @@ "type": { "type": "string", "enum": [ - "potentialVulnerability" + "malware" ] }, "value": { @@ -4596,23 +4690,18 @@ "type": "object", "additionalProperties": false, "properties": { + "id": { + "type": "integer", + "default": 0 + }, "note": { "type": "string", "default": "" - }, - "risk": { - "type": "string", - "enum": [ - "low", - "medium", - "high" - ], - "default": "medium" } }, "required": [ - "note", - "risk" + "id", + "note" ] }, "usage": { @@ -4627,172 +4716,6 @@ ] } } - } - ] - }, - "SocketMetricSchema": { - "type": "object", - "additionalProperties": false, - "properties": { - "score": { - "type": "number", - "default": 0 - }, - "components": { - "type": "object", - "additionalProperties": { - "$ref": "#/components/schemas/SocketMetricComponent" - }, - "properties": {} - }, - "limit": { - "type": "number", - "default": 0 - }, - "limitingMetric": { - "type": "string", - "default": "" - } - }, - "required": [ - "components", - "score" - ] - }, - "SocketIssueBasics": { - "type": "object", - "additionalProperties": false, - "properties": { - "severity": { - "$ref": "#/components/schemas/SocketIssueSeverity" - }, - "category": { - "$ref": "#/components/schemas/SocketCategory" - }, - "locations": { - "$ref": "#/components/schemas/SocketRefList" - }, - "label": { - "type": "string", - "default": "" - } - }, - "required": [ - "category", - "label", - "locations", - "severity" - ] - }, - "SocketUsageRef": { - "type": "object", - "additionalProperties": false, - "properties": { - "file": { - "$ref": "#/components/schemas/SocketRefFile" - }, - "dependencies": { - "$ref": "#/components/schemas/SocketRefList" - } - }, - "required": [ - "dependencies", - "file" - ] - }, - "SocketMetricComponent": { - "type": "object", - "additionalProperties": false, - "properties": { - "score": { - "type": "number", - "default": 0 - }, - "maxScore": { - "type": "number", - "default": 0 - }, - "limit": { - "type": "number", - "default": 0 - }, - "value": { - "type": "object", - "default": null - } - }, - "required": [ - "limit", - "maxScore", - "score", - "value" - ] - }, - "SocketIssueSeverity": { - "type": "string", - "enum": [ - "low", - "middle", - "high", - "critical" - ], - "default": "low" - }, - "SocketCategory": { - "type": "string", - "enum": [ - "supplyChainRisk", - "quality", - "maintenance", - "vulnerability", - "license", - "miscellaneous" - ], - "default": "miscellaneous" - }, - "SocketRefList": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SocketRef" - } - }, - "SocketRefFile": { - "type": "object", - "additionalProperties": false, - "properties": { - "path": { - "type": "string", - "default": "" - }, - "range": { - "$ref": "#/components/schemas/SocketRefTextRange" - }, - "bytes": { - "$ref": "#/components/schemas/SocketRefByteRange" - } - }, - "required": [ - "path" - ] - }, - "SocketRef": { - "anyOf": [ - { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "enum": [ - "unknown" - ] - }, - "value": { - "type": "object", - "additionalProperties": false, - "properties": {} - } - } }, { "type": "object", @@ -4801,26 +4724,50 @@ "type": { "type": "string", "enum": [ - "npm" + "telemetry" ] }, "value": { - "$ref": "#/components/schemas/SocketRefNPM" - } - } - }, - { - "type": "object", - "additionalProperties": false, - "properties": { - "type": { - "type": "string", - "enum": [ - "git" + "allOf": [ + { + "$ref": "#/components/schemas/SocketIssueBasics" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "props": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer", + "default": 0 + }, + "note": { + "type": "string", + "default": "" + } + }, + "required": [ + "id", + "note" + ] + }, + "usage": { + "$ref": "#/components/schemas/SocketUsageRef" + } + }, + "required": [ + "description", + "props" + ] + } ] - }, - "value": { - "$ref": "#/components/schemas/SocketRefGit" } } }, @@ -4831,12 +4778,51 @@ "type": { "type": "string", "enum": [ - "web" + "troll" ] }, "value": { - "$ref": "#/components/schemas/SocketRefWeb" - } + "allOf": [ + { + "$ref": "#/components/schemas/SocketIssueBasics" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "props": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer", + "default": 0 + }, + "note": { + "type": "string", + "default": "" + } + }, + "required": [ + "id", + "note" + ] + }, + "usage": { + "$ref": "#/components/schemas/SocketUsageRef" + } + }, + "required": [ + "description", + "props" + ] + } + ] + } } }, { @@ -4846,11 +4832,55 @@ "type": { "type": "string", "enum": [ - "pypi" + "gptSecurity" ] }, "value": { - "$ref": "#/components/schemas/SocketRefPyPI" + "allOf": [ + { + "$ref": "#/components/schemas/SocketIssueBasics" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "props": { + "type": "object", + "additionalProperties": false, + "properties": { + "notes": { + "type": "string", + "default": "" + }, + "confidence": { + "type": "number", + "default": 0 + }, + "severity": { + "type": "number", + "default": 0 + } + }, + "required": [ + "confidence", + "notes", + "severity" + ] + }, + "usage": { + "$ref": "#/components/schemas/SocketUsageRef" + } + }, + "required": [ + "description", + "props" + ] + } + ] } } }, @@ -4861,216 +4891,1637 @@ "type": { "type": "string", "enum": [ - "go" + "gptAnomaly" ] }, "value": { - "$ref": "#/components/schemas/SocketRefGo" + "allOf": [ + { + "$ref": "#/components/schemas/SocketIssueBasics" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "props": { + "type": "object", + "additionalProperties": false, + "properties": { + "notes": { + "type": "string", + "default": "" + }, + "confidence": { + "type": "number", + "default": 0 + }, + "severity": { + "type": "number", + "default": 0 + }, + "risk": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ], + "default": "medium" + } + }, + "required": [ + "confidence", + "notes", + "risk", + "severity" + ] + }, + "usage": { + "$ref": "#/components/schemas/SocketUsageRef" + } + }, + "required": [ + "description", + "props" + ] + } + ] } } - } - ] - }, - "SocketRefTextRange": { - "type": "object", - "additionalProperties": false, - "properties": { - "startLine": { - "type": "integer", - "default": 0 - }, - "startColumn": { - "type": "integer", - "default": 0 - }, - "endLine": { - "type": "integer", - "default": 0 }, - "endColumn": { - "type": "integer", - "default": 0 - } - }, - "required": [ - "endColumn", - "endLine", - "startColumn", - "startLine" - ] - }, - "SocketRefByteRange": { - "type": "object", - "additionalProperties": false, - "properties": { - "start": { - "type": "integer", - "default": 0 + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "gptMalware" + ] + }, + "value": { + "allOf": [ + { + "$ref": "#/components/schemas/SocketIssueBasics" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "props": { + "type": "object", + "additionalProperties": false, + "properties": { + "notes": { + "type": "string", + "default": "" + }, + "confidence": { + "type": "number", + "default": 0 + }, + "severity": { + "type": "number", + "default": 0 + } + }, + "required": [ + "confidence", + "notes", + "severity" + ] + }, + "usage": { + "$ref": "#/components/schemas/SocketUsageRef" + } + }, + "required": [ + "description", + "props" + ] + } + ] + } + } }, - "end": { - "type": "integer", - "default": 0 - } - }, - "required": [ - "end", - "start" - ] - }, - "SocketRefNPM": { - "type": "object", - "additionalProperties": false, - "properties": { - "package": { - "type": "string", - "default": "" + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "potentialVulnerability" + ] + }, + "value": { + "allOf": [ + { + "$ref": "#/components/schemas/SocketIssueBasics" + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "description": { + "type": "string", + "default": "" + }, + "props": { + "type": "object", + "additionalProperties": false, + "properties": { + "note": { + "type": "string", + "default": "" + }, + "risk": { + "type": "string", + "enum": [ + "low", + "medium", + "high" + ], + "default": "medium" + } + }, + "required": [ + "note", + "risk" + ] + }, + "usage": { + "$ref": "#/components/schemas/SocketUsageRef" + } + }, + "required": [ + "description", + "props" + ] + } + ] + } + } + } + ] + }, + "SocketMetricSchema": { + "type": "object", + "additionalProperties": false, + "properties": { + "score": { + "type": "number", + "default": 0 }, - "version": { + "components": { + "type": "object", + "additionalProperties": { + "$ref": "#/components/schemas/SocketMetricComponent" + }, + "properties": {} + }, + "limit": { + "type": "number", + "default": 0 + }, + "limitingMetric": { "type": "string", "default": "" - }, - "file": { - "$ref": "#/components/schemas/SocketRefFile" } }, "required": [ - "package" + "components", + "score" ] }, - "SocketRefGit": { + "SocketIssueBasics": { "type": "object", "additionalProperties": false, "properties": { - "url": { - "type": "string", - "default": "" + "severity": { + "$ref": "#/components/schemas/SocketIssueSeverity" }, - "commit": { - "type": "string", - "default": "" + "category": { + "$ref": "#/components/schemas/SocketCategory" }, - "tag": { + "locations": { + "$ref": "#/components/schemas/SocketRefList" + }, + "label": { "type": "string", "default": "" - }, + } + }, + "required": [ + "category", + "label", + "locations", + "severity" + ] + }, + "SocketUsageRef": { + "type": "object", + "additionalProperties": false, + "properties": { "file": { "$ref": "#/components/schemas/SocketRefFile" + }, + "dependencies": { + "$ref": "#/components/schemas/SocketRefList" } }, "required": [ - "url" + "dependencies", + "file" ] }, - "SocketRefWeb": { + "SocketMetricComponent": { "type": "object", "additionalProperties": false, "properties": { - "url": { - "type": "string", - "default": "" + "score": { + "type": "number", + "default": 0 }, - "file": { - "$ref": "#/components/schemas/SocketRefFile" + "maxScore": { + "type": "number", + "default": 0 + }, + "limit": { + "type": "number", + "default": 0 + }, + "value": { + "type": "object", + "default": null } }, "required": [ - "url" + "limit", + "maxScore", + "score", + "value" ] }, - "SocketRefPyPI": { + "SocketRefList": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SocketRef" + } + }, + "SocketRefFile": { "type": "object", "additionalProperties": false, "properties": { - "package": { + "path": { "type": "string", "default": "" }, - "version": { - "type": "string", - "default": "" + "range": { + "$ref": "#/components/schemas/SocketRefTextRange" + }, + "bytes": { + "$ref": "#/components/schemas/SocketRefByteRange" + } + }, + "required": [ + "path" + ] + }, + "SocketRef": { + "anyOf": [ + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "unknown" + ] + }, + "value": { + "type": "object", + "additionalProperties": false, + "properties": {} + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "npm" + ] + }, + "value": { + "$ref": "#/components/schemas/SocketRefNPM" + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "git" + ] + }, + "value": { + "$ref": "#/components/schemas/SocketRefGit" + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "web" + ] + }, + "value": { + "$ref": "#/components/schemas/SocketRefWeb" + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "pypi" + ] + }, + "value": { + "$ref": "#/components/schemas/SocketRefPyPI" + } + } + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "type": { + "type": "string", + "enum": [ + "go" + ] + }, + "value": { + "$ref": "#/components/schemas/SocketRefGo" + } + } + } + ] + }, + "SocketRefTextRange": { + "type": "object", + "additionalProperties": false, + "properties": { + "startLine": { + "type": "integer", + "default": 0 + }, + "startColumn": { + "type": "integer", + "default": 0 + }, + "endLine": { + "type": "integer", + "default": 0 + }, + "endColumn": { + "type": "integer", + "default": 0 + } + }, + "required": [ + "endColumn", + "endLine", + "startColumn", + "startLine" + ] + }, + "SocketRefByteRange": { + "type": "object", + "additionalProperties": false, + "properties": { + "start": { + "type": "integer", + "default": 0 + }, + "end": { + "type": "integer", + "default": 0 + } + }, + "required": [ + "end", + "start" + ] + }, + "SocketRefNPM": { + "type": "object", + "additionalProperties": false, + "properties": { + "package": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + }, + "file": { + "$ref": "#/components/schemas/SocketRefFile" + } + }, + "required": [ + "package" + ] + }, + "SocketRefGit": { + "type": "object", + "additionalProperties": false, + "properties": { + "url": { + "type": "string", + "default": "" + }, + "commit": { + "type": "string", + "default": "" + }, + "tag": { + "type": "string", + "default": "" + }, + "file": { + "$ref": "#/components/schemas/SocketRefFile" + } + }, + "required": [ + "url" + ] + }, + "SocketRefWeb": { + "type": "object", + "additionalProperties": false, + "properties": { + "url": { + "type": "string", + "default": "" + }, + "file": { + "$ref": "#/components/schemas/SocketRefFile" + } + }, + "required": [ + "url" + ] + }, + "SocketRefPyPI": { + "type": "object", + "additionalProperties": false, + "properties": { + "package": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + }, + "artifact": { + "type": "string", + "default": "" + }, + "file": { + "$ref": "#/components/schemas/SocketRefFile" + } + }, + "required": [ + "package" + ] + }, + "SocketRefGo": { + "type": "object", + "additionalProperties": false, + "properties": { + "package": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + }, + "file": { + "$ref": "#/components/schemas/SocketRefFile" + } + }, + "required": [ + "package" + ] + } + }, + "securitySchemes": { + "basicAuth": { + "type": "http", + "scheme": "basic" + } + } + }, + "paths": { + "/npm/{package}/{version}/issues": { + "get": { + "tags": [ + "NPM" + ], + "summary": "Get issues by package", + "operationId": "getIssuesByNPMPackage", + "parameters": [ + { + "name": "package", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [] + } + ], + "description": "Get all the issues related with a particular npm package version.\nThis endpoint returns the issue type, location, and additional details related to each issue in the `props` attribute.\n\nYou can [see here](https://socket.dev/npm/issue) the full list of issues.\n\nThis endpoint consumes 1 unit of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SocketIssueList" + } + } + }, + "description": "Socket issue lists" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/npm/{package}/{version}/score": { + "get": { + "tags": [ + "NPM" + ], + "summary": "Get score by package", + "operationId": "getScoreByNPMPackage", + "parameters": [ + { + "name": "package", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "version", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [] + } + ], + "description": "Get all the scores and metrics by category that are used to evaluate the package version.\n\nThis endpoint consumes 1 unit of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SocketPackageScore" + } + } + }, + "description": "Socket package scores" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/report/delete/{id}": { + "delete": { + "tags": [ + "Project report" + ], + "summary": "Delete a report", + "operationId": "deleteReport", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [ + "report:write" + ] + } + ], + "description": "Delete a specific project report.\n\nThis endpoint consumes 10 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "default": "ok" + } + }, + "required": [ + "status" + ] + } + } + }, + "description": "Success" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/report/list": { + "get": { + "tags": [ + "Project report" + ], + "summary": "Get list of reports", + "operationId": "getReportList", + "security": [ + { + "basicAuth": [ + "report:list" + ] + } + ], + "description": "Get all your project reports.\n\nThis endpoint consumes 10 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "url": { + "type": "string", + "default": "" + }, + "repo": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + }, + "pull_requests": { + "type": "object", + "default": null + }, + "commit": { + "type": "string", + "default": "" + }, + "owner": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + } + }, + "required": [ + "branch", + "commit", + "created_at", + "id", + "owner", + "pull_requests", + "repo", + "url" + ] + } + } + } + }, + "description": "List of project reports" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/report/upload": { + "put": { + "tags": [ + "Project report" + ], + "summary": "Create a report", + "operationId": "createReport", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "default": { + "type": "Buffer", + "data": [] + }, + "format": "binary" + }, + "properties": { + "issueRules": { + "type": "object", + "additionalProperties": { + "type": "boolean", + "default": false + }, + "properties": {} + } + } + } + } + }, + "required": false + }, + "security": [ + { + "basicAuth": [ + "report:write" + ] + } + ], + "description": "Upload a lockfile to get your project analyzed by Socket.\nYou can upload multiple lockfiles in the same request, but each filename must be unique.\n\nThe name of the file must be in the supported list.\n\nFor example, these are valid filenames: `package.json`, `folder/package.json` and `deep/nested/folder/package.json`.\n\nThis endpoint consumes 100 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "url": { + "type": "string", + "default": "" + } + }, + "required": [ + "id", + "url" + ] + } + } + }, + "description": "ID and URL of the project report" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/report/view/{id}": { + "get": { + "tags": [ + "Project report" + ], + "summary": "View a report", + "operationId": "getReport", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [ + "report:read" + ] + } + ], + "description": "Get all the issues, packages, and scores related to an specific project report.\n\nThis endpoint consumes 10 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SocketReport" + } + } + }, + "description": "Socket report" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/report/supported": { + "get": { + "tags": [ + "Project report" + ], + "summary": "Get supported files for report", + "operationId": "getReportSupportedFiles", + "security": [ + {} + ], + "description": "Get a list of supported files for project report generation.\nFiles are categorized first by environment (e.g. NPM or PyPI), then by name.\n\nFiles whose names match the patterns returned by this endpoint can be uploaded for report generation.\nExamples of supported filenames include `package.json`, `package-lock.json`, and `yarn.lock`.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": false, + "properties": { + "pattern": { + "type": "string", + "default": "" + } + }, + "required": [ + "pattern" + ] + }, + "properties": {} + }, + "properties": {} + } + } + }, + "description": "Glob patterns used to match supported files" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/openapi": { + "get": { + "tags": [ + "Openapi" + ], + "summary": "Returns the OpenAPI definition", + "operationId": "getOpenAPI", + "security": [ + {} + ], + "description": "Retrieve the API specification in an Openapi JSON format.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": {} + }, + "description": "OpenAPI specification" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/quota": { + "get": { + "tags": [ + "Quota" + ], + "summary": "Get quota", + "operationId": "getQuota", + "security": [ + { + "basicAuth": [] + } + ], + "description": "Get your current API quota. You can use this endpoint to prevent doing requests that might spend all your quota.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "quota": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + "required": [ + "quota" + ] + } + } + }, + "description": "Quota amount" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/organizations": { + "get": { + "tags": [ + "Organizations" + ], + "summary": "List organizations", + "operationId": "getOrganizations", + "security": [ + { + "basicAuth": [] + } + ], + "description": "Get information on the current organizations associated with the API key.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "organizations": { + "type": "object", + "additionalProperties": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "image": { + "type": "string", + "default": "" + }, + "plan": { + "type": "string", + "default": "" + }, + "slug": { + "type": "string", + "default": "" + } + }, + "required": [ + "id", + "image", + "name", + "plan", + "slug" + ] + }, + "properties": {} + } + }, + "required": [ + "organizations" + ] + } + } + }, + "description": "Organizations information" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/settings": { + "post": { + "tags": [ + "Settings" + ], + "summary": "Calculate settings", + "operationId": "postSettings", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "organization": { + "type": "string", + "default": "" + } + } + } + } + } + }, + "required": false + }, + "security": [ + { + "basicAuth": [] + } + ], + "description": "Get your current settings the requested organizations and default settings to allow deferrals.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "defaults": { + "type": "object", + "additionalProperties": false, + "properties": { + "issueRules": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "action": { + "type": "string", + "enum": [ + "error", + "ignore", + "warn" + ] + } + } + } + } + }, + "required": [ + "issueRules" + ] + }, + "entries": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "start": { + "type": "string", + "default": "", + "nullable": true + }, + "settings": { + "type": "object", + "additionalProperties": { + "type": "object", + "properties": { + "deferTo": { + "type": "string", + "nullable": true + }, + "issueRules": { + "type": "object", + "nullable": false, + "additionalProperties": { + "type": "object", + "nullable": false, + "properties": { + "action": { + "type": "string", + "enum": [ + "defer", + "error", + "ignore", + "warn" + ] + } + }, + "required": [ + "action" + ] + } + } + }, + "required": [ + "deferTo", + "issueRules" + ] + } + } + }, + "required": [ + "settings", + "start" + ] + } + } + }, + "required": [ + "defaults", + "entries" + ] + } + } + }, + "description": "Organization settings" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/repo/list": { + "get": { + "tags": [ + "Repositories" + ], + "summary": "Get list of repos and their latest project report", + "operationId": "getRepoList", + "security": [ + { + "basicAuth": [ + "repo:list" + ] + } + ], + "description": "Get all repositories in an org including their latest project report.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "results": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "github_install_id": { + "type": "string", + "default": "" + }, + "github_repo_id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "github_full_name": { + "type": "string", + "default": "" + }, + "organization_id": { + "type": "string", + "default": "" + }, + "latest_project_report": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + } + }, + "required": [ + "created_at", + "id" + ] + } + } + } + } + }, + "required": [ + "results" + ] + } + } + }, + "description": "List of repos and their latest project report for the organization associated with the token used" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + } + }, + "/dependencies/search": { + "post": { + "tags": [ + "Dependencies" + ], + "summary": "Search dependencies", + "operationId": "searchDependencies", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 1000 + }, + "offset": { + "type": "integer", + "default": 0, + "minimum": 0 + } + }, + "required": [ + "limit", + "offset" + ] + } + } + }, + "required": false + }, + "security": [ + { + "basicAuth": [] + } + ], + "description": "Search for any dependency that is being used in your organization.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "end": { + "type": "boolean", + "default": false + }, + "limit": { + "type": "integer", + "default": 1000 + }, + "offset": { + "type": "integer", + "default": 0 + }, + "rows": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "branch": { + "type": "string", + "default": "" + }, + "direct": { + "type": "boolean", + "default": false + }, + "id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "namespace": { + "type": "string", + "default": "" + }, + "repository": { + "type": "string", + "default": "" + }, + "type": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + } + }, + "required": [ + "branch", + "direct", + "id", + "name", + "namespace", + "repository", + "type", + "version" + ] + } + } + }, + "required": [ + "end", + "limit", + "offset", + "rows" + ] + } + } + }, + "description": "List of repos and their latest project report for the organization associated with the token used" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" }, - "artifact": { - "type": "string", - "default": "" + "401": { + "$ref": "#/components/responses/SocketUnauthorized" }, - "file": { - "$ref": "#/components/schemas/SocketRefFile" - } - }, - "required": [ - "package" - ] - }, - "SocketRefGo": { - "type": "object", - "additionalProperties": false, - "properties": { - "package": { - "type": "string", - "default": "" + "403": { + "$ref": "#/components/responses/SocketForbidden" }, - "version": { - "type": "string", - "default": "" + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" }, - "file": { - "$ref": "#/components/schemas/SocketRefFile" + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" } }, - "required": [ - "package" - ] + "x-readme": {} } }, - "securitySchemes": { - "basicAuth": { - "type": "http", - "scheme": "basic" - } - } - }, - "paths": { - "/npm/{package}/{version}/issues": { - "get": { + "/dependencies/upload": { + "post": { "tags": [ - "NPM" + "Upload", + "Dependencies" ], - "summary": "Get issues by package", - "operationId": "getIssuesByNPMPackage", - "parameters": [ - { - "name": "package", - "in": "path", - "required": true, - "schema": { - "type": "string" + "summary": "Create a snapshot of all dependencies from manifest information", + "operationId": "createDependenciesSnapshot", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "default": { + "type": "Buffer", + "data": [] + }, + "format": "binary" + }, + "properties": { + "repository": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + } + } + } } }, - { - "name": "version", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - } - ], + "required": false + }, "security": [ { - "basicAuth": [] + "basicAuth": [ + "report:write" + ] } ], - "description": "Get all the issues related with a particular npm package version.\nThis endpoint returns the issue type, location, and additional details related to each issue in the `props` attribute.\n\nYou can [see here](https://socket.dev/npm/issue) the full list of issues.\n\nThis endpoint consumes 1 unit of your quota.", + "description": "Upload a set of manifest or lockfiles to get your dependency tree analyzed by Socket.\nYou can upload multiple lockfiles in the same request, but each filename must be unique.\n\nThe name of the file must be in the supported list.\n\nFor example, these are valid filenames: \"requirements.txt\", \"package.json\", \"folder/package.json\", and \"deep/nested/folder/package.json\".\n\nThis endpoint consumes 100 units of your quota.", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SocketIssueList" + "type": "object", + "additionalProperties": false, + "properties": {} } } }, - "description": "Socket issue lists" + "description": "ID of the dependencies snapshot" }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -5081,34 +6532,26 @@ "403": { "$ref": "#/components/responses/SocketForbidden" }, - "404": { - "$ref": "#/components/responses/SocketNotFoundResponse" - }, "429": { "$ref": "#/components/responses/SocketTooManyRequestsResponse" + }, + "500": { + "$ref": "#/components/responses/SocketInternalServerError" } }, "x-readme": {} } }, - "/npm/{package}/{version}/score": { + "/orgs/{org_slug}/repos": { "get": { "tags": [ - "NPM" + "Repositories" ], - "summary": "Get score by package", - "operationId": "getScoreByNPMPackage", + "summary": "List repositories (unstable)", + "operationId": "getOrgRepoList", "parameters": [ { - "name": "package", - "in": "path", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "version", + "name": "org_slug", "in": "path", "required": true, "schema": { @@ -5118,20 +6561,86 @@ ], "security": [ { - "basicAuth": [] + "basicAuth": [ + "repo:list" + ] } ], - "description": "Get all the scores and metrics by category that are used to evaluate the package version.\n\nThis endpoint consumes 1 unit of your quota.", + "description": "Lists repositories for the specified organization.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SocketPackageScore" + "type": "object", + "additionalProperties": false, + "properties": { + "results": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "slug": { + "type": "string", + "default": "" + }, + "head_full_scan_id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "homepage": { + "type": "string", + "default": "" + }, + "visibility": { + "type": "string", + "default": "" + }, + "archived": { + "type": "boolean", + "default": false + }, + "default_branch": { + "type": "string", + "default": "" + } + } + } + }, + "nextPage": { + "type": "integer", + "default": 0 + } + }, + "required": [ + "nextPage", + "results" + ] } } }, - "description": "Socket package scores" + "description": "Lists repositories for the specified organization. The authenticated user must be a member of the organization." }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -5150,18 +6659,16 @@ } }, "x-readme": {} - } - }, - "/report/delete/{id}": { - "delete": { + }, + "post": { "tags": [ - "Project report" + "Repositories" ], - "summary": "Delete a report", - "operationId": "deleteReport", + "summary": "Create repository (unstable)", + "operationId": "createOrgRepo", "parameters": [ { - "name": "id", + "name": "org_slug", "in": "path", "required": true, "schema": { @@ -5169,34 +6676,108 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "homepage": { + "type": "string", + "default": "" + }, + "visibility": { + "type": "string", + "default": "" + }, + "archived": { + "type": "boolean", + "default": false + }, + "default_branch": { + "type": "string", + "default": "" + } + } + } + } + }, + "required": false + }, "security": [ { "basicAuth": [ - "report:write" + "repo:create" ] } ], - "description": "Delete a specific project report.\n\nThis endpoint consumes 10 units of your quota.", + "description": "Create a repository.\n\nRepos collect Full scans and Diff scans and are typically associated with a git repo.\n\nThis endpoint consumes 0 units of your quota.", "responses": { - "200": { + "201": { "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "properties": { - "status": { + "id": { "type": "string", - "default": "ok" + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "slug": { + "type": "string", + "default": "" + }, + "head_full_scan_id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "homepage": { + "type": "string", + "default": "" + }, + "visibility": { + "type": "string", + "default": "" + }, + "archived": { + "type": "boolean", + "default": false + }, + "default_branch": { + "type": "string", + "default": "" } - }, - "required": [ - "status" - ] + } } } }, - "description": "Success" + "description": "Lists repositories for the specified organization. The authenticated user must be a member of the organization." }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -5217,79 +6798,96 @@ "x-readme": {} } }, - "/report/list": { + "/orgs/{org_slug}/repos/{repo_slug}": { "get": { "tags": [ - "Project report" + "Repositories)" + ], + "summary": "Get repository (unstable)", + "operationId": "getOrgRepo", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Get list of reports", - "operationId": "getReportList", "security": [ { "basicAuth": [ - "report:list" + "repo:list" ] } ], - "description": "Get all your project reports.\n\nThis endpoint consumes 10 units of your quota.", + "description": "Retrieve a repository associated with an organization.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { "application/json": { "schema": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "string", - "default": "" - }, - "url": { - "type": "string", - "default": "" - }, - "repo": { - "type": "string", - "default": "" - }, - "branch": { - "type": "string", - "default": "" - }, - "pull_requests": { - "type": "object", - "default": null - }, - "commit": { - "type": "string", - "default": "" - }, - "owner": { - "type": "string", - "default": "" - }, - "created_at": { - "type": "string", - "default": "" - } + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" }, - "required": [ - "branch", - "commit", - "created_at", - "id", - "owner", - "pull_requests", - "repo", - "url" - ] + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "slug": { + "type": "string", + "default": "" + }, + "head_full_scan_id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "homepage": { + "type": "string", + "default": "" + }, + "visibility": { + "type": "string", + "default": "" + }, + "archived": { + "type": "boolean", + "default": false + }, + "default_branch": { + "type": "string", + "default": "" + } } } } }, - "description": "List of project reports" + "description": "Lists repositories for the specified organization. The authenticated user must be a member of the organization." }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -5308,36 +6906,61 @@ } }, "x-readme": {} - } - }, - "/report/upload": { - "put": { + }, + "post": { "tags": [ - "Project report" + "Repositories" + ], + "summary": "Update repository (unstable)", + "operationId": "updateOrgRepo", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Create a report", - "operationId": "createReport", "requestBody": { "content": { - "multipart/form-data": { + "application/json": { "schema": { "type": "object", - "additionalProperties": { - "type": "string", - "default": { - "type": "Buffer", - "data": [] - }, - "format": "binary" - }, + "additionalProperties": false, "properties": { - "issueRules": { - "type": "object", - "additionalProperties": { - "type": "boolean", - "default": false - }, - "properties": {} + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "homepage": { + "type": "string", + "default": "" + }, + "visibility": { + "type": "string", + "default": "" + }, + "archived": { + "type": "boolean", + "default": false + }, + "default_branch": { + "type": "string", + "default": "" } } } @@ -5348,11 +6971,11 @@ "security": [ { "basicAuth": [ - "report:write" + "repo:update" ] } ], - "description": "Upload a lockfile to get your project analyzed by Socket.\nYou can upload multiple lockfiles in the same request, but each filename must be unique.\n\nThe name of the file must be in the supported list.\n\nFor example, these are valid filenames: `package.json`, `folder/package.json` and `deep/nested/folder/package.json`.\n\nThis endpoint consumes 100 units of your quota.", + "description": "Update details of an existing repository.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { @@ -5365,19 +6988,51 @@ "type": "string", "default": "" }, - "url": { + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "slug": { + "type": "string", + "default": "" + }, + "head_full_scan_id": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "description": { + "type": "string", + "default": "" + }, + "homepage": { + "type": "string", + "default": "" + }, + "visibility": { + "type": "string", + "default": "" + }, + "archived": { + "type": "boolean", + "default": false + }, + "default_branch": { "type": "string", "default": "" } - }, - "required": [ - "id", - "url" - ] + } } } }, - "description": "ID and URL of the project report" + "description": "Update a repositories details" }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -5388,23 +7043,32 @@ "403": { "$ref": "#/components/responses/SocketForbidden" }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, "429": { "$ref": "#/components/responses/SocketTooManyRequestsResponse" } }, "x-readme": {} - } - }, - "/report/view/{id}": { - "get": { + }, + "delete": { "tags": [ - "Project report" + "Repositories" ], - "summary": "View a report", - "operationId": "getReport", + "summary": "Delete repository (unstable)", + "operationId": "deleteOrgRepo", "parameters": [ { - "name": "id", + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo_slug", "in": "path", "required": true, "schema": { @@ -5415,21 +7079,31 @@ "security": [ { "basicAuth": [ - "report:read" + "repo:delete" ] } ], - "description": "Get all the issues, packages, and scores related to an specific project report.\n\nThis endpoint consumes 10 units of your quota.", + "description": "Delete a single repository and all of its associated Full scans and Diff scans.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SocketReport" + "type": "object", + "additionalProperties": false, + "properties": { + "status": { + "type": "string", + "default": "ok" + } + }, + "required": [ + "status" + ] } } }, - "description": "Socket report" + "description": "Success" }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -5450,139 +7124,31 @@ "x-readme": {} } }, - "/report/supported": { - "get": { - "tags": [ - "Project report" - ], - "summary": "Get supported files for report", - "operationId": "getReportSupportedFiles", - "security": [ - {} - ], - "description": "Get a list of supported files for project report generation.\nFiles are categorized first by environment (e.g. NPM or PyPI), then by name.\n\nFiles whose names match the patterns returned by this endpoint can be uploaded for report generation.\nExamples of supported filenames include `package.json`, `package-lock.json`, and `yarn.lock`.\n\nThis endpoint consumes 0 units of your quota.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": { - "type": "object", - "additionalProperties": false, - "properties": { - "pattern": { - "type": "string", - "default": "" - } - }, - "required": [ - "pattern" - ] - }, - "properties": {} - }, - "properties": {} - } - } - }, - "description": "Glob patterns used to match supported files" - }, - "400": { - "$ref": "#/components/responses/SocketBadRequest" - }, - "429": { - "$ref": "#/components/responses/SocketTooManyRequestsResponse" - } - }, - "x-readme": {} - } - }, - "/openapi": { - "get": { - "tags": [ - "Openapi" - ], - "summary": "Returns the OpenAPI definition", - "operationId": "getOpenAPI", - "security": [ - {} - ], - "description": "Retrieve the API specification in an Openapi JSON format.\n\nThis endpoint consumes 0 units of your quota.", - "responses": { - "200": { - "content": { - "application/json": {} - }, - "description": "OpenAPI specification" - }, - "429": { - "$ref": "#/components/responses/SocketTooManyRequestsResponse" - } - }, - "x-readme": {} - } - }, - "/quota": { + "/orgs/{org_slug}/full-scans": { "get": { "tags": [ - "Quota" + "Full scans" ], - "summary": "Get quota", - "operationId": "getQuota", - "security": [ + "summary": "List full scans (unstable)", + "operationId": "getOrgFullScanList", + "parameters": [ { - "basicAuth": [] - } - ], - "description": "Get your current API quota. You can use this endpoint to prevent doing requests that might spend all your quota.\n\nThis endpoint consumes 0 units of your quota.", - "responses": { - "200": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "properties": { - "quota": { - "type": "integer", - "default": 0, - "minimum": 0 - } - }, - "required": [ - "quota" - ] - } - } - }, - "description": "Quota amount" - }, - "401": { - "$ref": "#/components/responses/SocketUnauthorized" - }, - "429": { - "$ref": "#/components/responses/SocketTooManyRequestsResponse" + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } } - }, - "x-readme": {} - } - }, - "/organizations": { - "get": { - "tags": [ - "Organizations" ], - "summary": "List organizations", - "operationId": "getOrganizations", "security": [ { - "basicAuth": [] + "basicAuth": [ + "full-scans:list" + ] } ], - "description": "Get information on the current organizations associated with the API key.\n\nThis endpoint consumes 0 units of your quota.", + "description": "Returns a paginated list of all full scans in an org, excluding SBOM artifacts.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { @@ -5591,9 +7157,9 @@ "type": "object", "additionalProperties": false, "properties": { - "organizations": { - "type": "object", - "additionalProperties": { + "results": { + "type": "array", + "items": { "type": "object", "additionalProperties": false, "properties": { @@ -5601,178 +7167,486 @@ "type": "string", "default": "" }, - "name": { + "created_at": { "type": "string", "default": "" }, - "image": { + "updated_at": { "type": "string", "default": "" }, - "plan": { + "organization_id": { + "type": "string", + "default": "" + }, + "repository_id": { + "type": "string", + "default": "" + }, + "committers": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "repo": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + }, + "commit_message": { + "type": "string", + "default": "" + }, + "commit_hash": { + "type": "string", + "default": "" + }, + "pull_request": { + "type": "integer", + "default": 0 + }, + "html_report_url": { "type": "string", "default": "" } - }, - "required": [ - "id", - "image", - "name", - "plan" - ] - }, - "properties": {} + } + } + }, + "nextPage": { + "type": "integer", + "default": 0 } }, "required": [ - "organizations" + "nextPage", + "results" ] } } }, - "description": "Organizations information" + "description": "Lists repositories for the specified organization. The authenticated user must be a member of the organization." + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" }, "401": { "$ref": "#/components/responses/SocketUnauthorized" }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, "429": { "$ref": "#/components/responses/SocketTooManyRequestsResponse" } }, "x-readme": {} - } - }, - "/settings": { + }, "post": { "tags": [ - "Settings" + "Full scans" + ], + "summary": "Create full scan (unstable)", + "operationId": "CreateOrgFullScan", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Calculate settings", - "operationId": "postSettings", "requestBody": { "content": { - "application/json": { + "multipart/form-data": { "schema": { - "type": "array", - "items": { + "type": "object", + "additionalProperties": { + "type": "string", + "default": { + "type": "Buffer", + "data": [] + }, + "format": "binary" + }, + "properties": {} + } + } + }, + "required": false + }, + "security": [ + { + "basicAuth": [ + "full-scans:create" + ] + } + ], + "description": "Create a full scan from a set of package manifest files. Returns a full scan including all SBOM artifacts.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { "type": "object", "additionalProperties": false, "properties": { - "organization": { + "id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "organization_id": { + "type": "string", + "default": "" + }, + "repository_id": { + "type": "string", + "default": "" + }, + "committers": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "repo": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + }, + "commit_message": { + "type": "string", + "default": "" + }, + "commit_hash": { + "type": "string", + "default": "" + }, + "pull_request": { + "type": "integer", + "default": 0 + }, + "html_report_url": { "type": "string", "default": "" } } } } - } + }, + "description": "Upload manifest files to create a full scan in an org's repo" }, - "required": false + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } }, + "x-readme": {} + } + }, + "/orgs/{org_slug}/full-scans/{full_scan_id}": { + "get": { + "tags": [ + "Full scans" + ], + "summary": "Stream full scan (unstable)", + "operationId": "getOrgFullScan", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "full_scan_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "security": [ { - "basicAuth": [] + "basicAuth": [ + "full-scans:list" + ] } ], - "description": "Get your current settings the requested organizations and default settings to allow deferrals.\n\nThis endpoint consumes 0 units of your quota.", + "description": "Stream all SBOM artifacts for a full scan.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { - "application/json": { + "application/x-ndjson": { "schema": { "type": "object", "additionalProperties": false, "properties": { - "defaults": { + "type": { + "type": "string", + "enum": [ + "unknown", + "npm", + "pypi", + "golang" + ], + "default": "unknown" + }, + "namespace": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + }, + "subpath": { + "type": "string", + "default": "" + }, + "release": { + "type": "string", + "default": "" + }, + "id": { + "type": "string", + "default": "" + }, + "direct": { + "type": "boolean", + "default": false + }, + "manifestFiles": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "file": { + "type": "string", + "default": "" + }, + "start": { + "type": "integer", + "default": 0 + }, + "end": { + "type": "integer", + "default": 0 + } + }, + "required": [ + "file" + ] + } + }, + "topLevelAncestors": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "dependencies": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "artifact": { "type": "object", "additionalProperties": false, "properties": { - "issueRules": { - "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "action": { - "type": "string", - "enum": [ - "error", - "ignore", - "warn" - ] - } - } - } + "type": { + "type": "string", + "enum": [ + "unknown", + "npm", + "pypi", + "golang" + ], + "default": "unknown" + }, + "namespace": { + "type": "string", + "default": "" + }, + "name": { + "type": "string", + "default": "" + }, + "version": { + "type": "string", + "default": "" + }, + "subpath": { + "type": "string", + "default": "" + }, + "release": { + "type": "string", + "default": "" + }, + "id": { + "type": "string", + "default": "" } }, "required": [ - "issueRules" + "id", + "type" + ] + }, + "license": { + "type": "string", + "default": "" + }, + "author": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "size": { + "type": "number", + "default": 0 + }, + "score": { + "type": "object", + "additionalProperties": false, + "properties": { + "supplyChain": { + "type": "number", + "default": 0 + }, + "quality": { + "type": "number", + "default": 0 + }, + "maintenance": { + "type": "number", + "default": 0 + }, + "vulnerability": { + "type": "number", + "default": 0 + }, + "license": { + "type": "number", + "default": 0 + }, + "overall": { + "type": "number", + "default": 0 + } + }, + "required": [ + "license", + "maintenance", + "overall", + "quality", + "supplyChain", + "vulnerability" ] }, - "entries": { + "alerts": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { - "start": { + "key": { "type": "string", - "default": "", - "nullable": true + "default": "" }, - "settings": { + "type": { + "type": "string", + "default": "" + }, + "severity": { + "$ref": "#/components/schemas/SocketIssueSeverity" + }, + "category": { + "$ref": "#/components/schemas/SocketCategory" + }, + "file": { + "type": "string", + "default": "" + }, + "start": { + "type": "integer", + "default": 0 + }, + "end": { + "type": "integer", + "default": 0 + }, + "props": { "type": "object", - "additionalProperties": { - "type": "object", - "properties": { - "deferTo": { - "type": "string", - "nullable": true - }, - "issueRules": { - "type": "object", - "nullable": false, - "additionalProperties": { - "type": "object", - "nullable": false, - "properties": { - "action": { - "type": "string", - "enum": [ - "defer", - "error", - "ignore", - "warn" - ] - } - }, - "required": [ - "action" - ] - } - } - }, - "required": [ - "deferTo", - "issueRules" - ] - } + "default": null } }, "required": [ - "settings", - "start" + "category", + "key", + "severity", + "type" ] } } }, "required": [ - "defaults", - "entries" + "id", + "type" ] } } }, - "description": "Organization settings" + "description": "Socket issue lists and scores for all packages" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" }, "401": { "$ref": "#/components/responses/SocketUnauthorized" @@ -5780,28 +7654,47 @@ "403": { "$ref": "#/components/responses/SocketForbidden" }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, "429": { "$ref": "#/components/responses/SocketTooManyRequestsResponse" } }, "x-readme": {} - } - }, - "/repo/list": { - "get": { + }, + "delete": { "tags": [ - "Repositories" + "Full scans" + ], + "summary": "Delete full scan (unstable)", + "operationId": "deleteOrgFullScan", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "full_scan_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Get list of repos and their latest project report", - "operationId": "getRepoList", "security": [ { "basicAuth": [ - "repo:list" + "full-scans:delete" ] } ], - "description": "Get all repositories in an org including their latest project report.\n\nThis endpoint consumes 0 units of your quota.", + "description": "Delete an existing full scan.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { @@ -5810,73 +7703,18 @@ "type": "object", "additionalProperties": false, "properties": { - "results": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "string", - "default": "" - }, - "created_at": { - "type": "string", - "default": "" - }, - "updated_at": { - "type": "string", - "default": "" - }, - "github_install_id": { - "type": "string", - "default": "" - }, - "github_repo_id": { - "type": "string", - "default": "" - }, - "name": { - "type": "string", - "default": "" - }, - "github_full_name": { - "type": "string", - "default": "" - }, - "organization_id": { - "type": "string", - "default": "" - }, - "latest_project_report": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "string", - "default": "" - }, - "created_at": { - "type": "string", - "default": "" - } - }, - "required": [ - "created_at", - "id" - ] - } - } - } + "status": { + "type": "string", + "default": "ok" } }, "required": [ - "results" + "status" ] } } }, - "description": "List of repos and their latest project report for the organization associated with the token used" + "description": "Success" }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -5897,124 +7735,257 @@ "x-readme": {} } }, - "/dependencies/search": { - "post": { + "/orgs/{org_slug}/full-scans/{full_scan_id}/metadata": { + "get": { "tags": [ - "Dependencies" + "Full scans" ], - "summary": "Search dependencies", - "operationId": "searchDependencies", - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "properties": { - "limit": { - "type": "integer", - "default": 50, - "minimum": 1, - "maximum": 1000 - }, - "offset": { - "type": "integer", - "default": 0, - "minimum": 0 + "summary": "Get full scan metadata (unstable)", + "operationId": "getOrgFullScanMetadata", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "full_scan_id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [ + "full-scans:list" + ] + } + ], + "description": "Get metadata for a single full scan\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "organization_id": { + "type": "string", + "default": "" + }, + "repository_id": { + "type": "string", + "default": "" + }, + "committers": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "repo": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + }, + "commit_message": { + "type": "string", + "default": "" + }, + "commit_hash": { + "type": "string", + "default": "" + }, + "pull_request": { + "type": "integer", + "default": 0 + }, + "html_report_url": { + "type": "string", + "default": "" + } } - }, - "required": [ - "limit", - "offset" - ] + } } - } + }, + "description": "The data from the full scan" }, - "required": false + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } }, + "x-readme": {} + } + }, + "/analytics/org/{filter}": { + "get": { + "tags": [ + "" + ], + "summary": "Fetch the organization's analytics", + "operationId": "getOrgAnalytics", + "parameters": [ + { + "name": "filter", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "security": [ { - "basicAuth": [] + "basicAuth": [ + "report:write" + ] } ], - "description": "Search for any dependency that is being used in your organization.\n\nThis endpoint consumes 0 units of your quota.", + "description": "This endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": false, - "properties": { - "end": { - "type": "boolean", - "default": false - }, - "limit": { - "type": "integer", - "default": 1000 - }, - "offset": { - "type": "integer", - "default": 0 - }, - "rows": { - "type": "array", - "items": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer", + "default": 0 + }, + "created_at": { + "type": "string", + "default": "" + }, + "repository_id": { + "type": "string", + "default": "" + }, + "organization_id": { + "type": "integer", + "default": 0 + }, + "repository_name": { + "type": "string", + "default": "" + }, + "total_critical_alerts": { + "type": "integer", + "default": 0 + }, + "total_high_alerts": { + "type": "integer", + "default": 0 + }, + "total_medium_alerts": { + "type": "integer", + "default": 0 + }, + "total_low_alerts": { + "type": "integer", + "default": 0 + }, + "total_critical_added": { + "type": "integer", + "default": 0 + }, + "total_high_added": { + "type": "integer", + "default": 0 + }, + "total_medium_added": { + "type": "integer", + "default": 0 + }, + "total_low_added": { + "type": "integer", + "default": 0 + }, + "total_critical_prevented": { + "type": "integer", + "default": 0 + }, + "total_high_prevented": { + "type": "integer", + "default": 0 + }, + "total_medium_prevented": { + "type": "integer", + "default": 0 + }, + "total_low_prevented": { + "type": "integer", + "default": 0 + }, + "top_five_alert_types": { "type": "object", "additionalProperties": false, - "properties": { - "branch": { - "type": "string", - "default": "" - }, - "id": { - "type": "string", - "default": "" - }, - "name": { - "type": "string", - "default": "" - }, - "namespace": { - "type": "string", - "default": "" - }, - "repository": { - "type": "string", - "default": "" - }, - "type": { - "type": "string", - "default": "" - }, - "version": { - "type": "string", - "default": "" - } - }, - "required": [ - "branch", - "id", - "name", - "namespace", - "repository", - "type", - "version" - ] + "properties": {} } - } - }, - "required": [ - "end", - "limit", - "offset", - "rows" - ] + }, + "required": [ + "created_at", + "id", + "organization_id", + "repository_id", + "repository_name", + "top_five_alert_types", + "total_critical_added", + "total_critical_alerts", + "total_critical_prevented", + "total_high_added", + "total_high_alerts", + "total_high_prevented", + "total_low_added", + "total_low_alerts", + "total_low_prevented", + "total_medium_added", + "total_medium_alerts", + "total_medium_prevented" + ] + } } } }, - "description": "List of repos and their latest project report for the organization associated with the token used" + "description": "Socket analytics - organization-level data" }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -6025,9 +7996,6 @@ "403": { "$ref": "#/components/responses/SocketForbidden" }, - "404": { - "$ref": "#/components/responses/SocketNotFoundResponse" - }, "429": { "$ref": "#/components/responses/SocketTooManyRequestsResponse" } @@ -6035,42 +8003,31 @@ "x-readme": {} } }, - "/dependencies/upload": { - "post": { + "/analytics/repo/{name}/{filter}": { + "get": { "tags": [ - "Upload", - "Dependencies" + "" ], - "summary": "Create a snapshot of all dependencies from manifest information", - "operationId": "createDependenciesSnapshot", - "requestBody": { - "content": { - "multipart/form-data": { - "schema": { - "type": "object", - "additionalProperties": { - "type": "string", - "default": { - "type": "Buffer", - "data": [] - }, - "format": "binary" - }, - "properties": { - "repository": { - "type": "string", - "default": "" - }, - "branch": { - "type": "string", - "default": "" - } - } - } + "summary": "Fetch repository analytics", + "operationId": "getRepoAnalytics", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" } }, - "required": false - }, + { + "name": "filter", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], "security": [ { "basicAuth": [ @@ -6078,27 +8035,116 @@ ] } ], - "description": "Upload a set of manifest or lockfiles to get your dependency tree analyzed by Socket.\nYou can upload multiple lockfiles in the same request, but each filename must be unique.\n\nThe name of the file must be in the supported list.\n\nFor example, these are valid filenames: \"requirements.txt\", \"package.json\", \"folder/package.json\", and \"deep/nested/folder/package.json\".\n\nThis endpoint consumes 100 units of your quota.", + "description": "This endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { "application/json": { "schema": { - "type": "object", - "additionalProperties": false, - "properties": { - "id": { - "type": "string", - "default": "" - } - }, - "required": [ - "id" - ] + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "integer", + "default": 0 + }, + "repository_id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "organization_id": { + "type": "integer", + "default": 0 + }, + "repository_name": { + "type": "string", + "default": "" + }, + "total_critical_alerts": { + "type": "integer", + "default": 0 + }, + "total_high_alerts": { + "type": "integer", + "default": 0 + }, + "total_medium_alerts": { + "type": "integer", + "default": 0 + }, + "total_low_alerts": { + "type": "integer", + "default": 0 + }, + "total_critical_added": { + "type": "integer", + "default": 0 + }, + "total_high_added": { + "type": "integer", + "default": 0 + }, + "total_medium_added": { + "type": "integer", + "default": 0 + }, + "total_low_added": { + "type": "integer", + "default": 0 + }, + "total_critical_prevented": { + "type": "integer", + "default": 0 + }, + "total_high_prevented": { + "type": "integer", + "default": 0 + }, + "total_medium_prevented": { + "type": "integer", + "default": 0 + }, + "total_low_prevented": { + "type": "integer", + "default": 0 + }, + "top_five_alert_types": { + "type": "object", + "additionalProperties": false, + "properties": {} + } + }, + "required": [ + "created_at", + "id", + "organization_id", + "repository_id", + "repository_name", + "top_five_alert_types", + "total_critical_added", + "total_critical_alerts", + "total_critical_prevented", + "total_high_added", + "total_high_alerts", + "total_high_prevented", + "total_low_added", + "total_low_alerts", + "total_low_prevented", + "total_medium_added", + "total_medium_alerts", + "total_medium_prevented" + ] + } } } }, - "description": "ID of the dependencies snapshot" + "description": "Socket analytics - repo-level data" }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -6109,11 +8155,11 @@ "403": { "$ref": "#/components/responses/SocketForbidden" }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, "429": { "$ref": "#/components/responses/SocketTooManyRequestsResponse" - }, - "500": { - "$ref": "#/components/responses/SocketInternalServerError" } }, "x-readme": {} diff --git a/types/api.d.ts b/types/api.d.ts index 22d318f..dacae3d 100644 --- a/types/api.d.ts +++ b/types/api.d.ts @@ -148,6 +148,102 @@ export interface paths { */ post: operations["createDependenciesSnapshot"]; }; + "/orgs/{org_slug}/repos": { + /** + * List repositories (unstable) + * @description Lists repositories for the specified organization. + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgRepoList"]; + /** + * Create repository (unstable) + * @description Create a repository. + * + * Repos collect Full scans and Diff scans and are typically associated with a git repo. + * + * This endpoint consumes 0 units of your quota. + */ + post: operations["createOrgRepo"]; + }; + "/orgs/{org_slug}/repos/{repo_slug}": { + /** + * Get repository (unstable) + * @description Retrieve a repository associated with an organization. + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgRepo"]; + /** + * Update repository (unstable) + * @description Update details of an existing repository. + * + * This endpoint consumes 0 units of your quota. + */ + post: operations["updateOrgRepo"]; + /** + * Delete repository (unstable) + * @description Delete a single repository and all of its associated Full scans and Diff scans. + * + * This endpoint consumes 0 units of your quota. + */ + delete: operations["deleteOrgRepo"]; + }; + "/orgs/{org_slug}/full-scans": { + /** + * List full scans (unstable) + * @description Returns a paginated list of all full scans in an org, excluding SBOM artifacts. + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgFullScanList"]; + /** + * Create full scan (unstable) + * @description Create a full scan from a set of package manifest files. Returns a full scan including all SBOM artifacts. + * + * This endpoint consumes 0 units of your quota. + */ + post: operations["CreateOrgFullScan"]; + }; + "/orgs/{org_slug}/full-scans/{full_scan_id}": { + /** + * Stream full scan (unstable) + * @description Stream all SBOM artifacts for a full scan. + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgFullScan"]; + /** + * Delete full scan (unstable) + * @description Delete an existing full scan. + * + * This endpoint consumes 0 units of your quota. + */ + delete: operations["deleteOrgFullScan"]; + }; + "/orgs/{org_slug}/full-scans/{full_scan_id}/metadata": { + /** + * Get full scan metadata (unstable) + * @description Get metadata for a single full scan + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgFullScanMetadata"]; + }; + "/analytics/org/{filter}": { + /** + * Fetch the organization's analytics + * @description This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgAnalytics"]; + }; + "/analytics/repo/{name}/{filter}": { + /** + * Fetch repository analytics + * @description This endpoint consumes 0 units of your quota. + */ + get: operations["getRepoAnalytics"]; + }; } export type webhooks = Record; @@ -186,6 +282,16 @@ export interface components { /** @default */ url: string; }; + /** + * @default low + * @enum {string} + */ + SocketIssueSeverity: "low" | "middle" | "high" | "critical"; + /** + * @default miscellaneous + * @enum {string} + */ + SocketCategory: "supplyChainRisk" | "quality" | "maintenance" | "vulnerability" | "license" | "miscellaneous"; SocketIssue: ({ /** @enum {string} */ type?: "criticalCVE"; @@ -266,6 +372,46 @@ export interface components { }; usage?: components["schemas"]["SocketUsageRef"]; }; + }) | ({ + /** @enum {string} */ + type?: "mediumCVE"; + value?: components["schemas"]["SocketIssueBasics"] & { + /** @default */ + description: string; + props: { + /** @default */ + cveId: string; + cwes: { + /** @default */ + description: string; + /** @default */ + id: string; + /** @default */ + name: string; + }[]; + cvss: { + /** @default 0 */ + score: number; + /** @default */ + vectorString: string; + }; + /** @default */ + description: string; + /** @default */ + firstPatchedVersionIdentifier: string; + /** @default */ + ghsaId: string; + /** @default critical */ + severity: string; + /** @default */ + title: string; + /** @default */ + url: string; + /** @default */ + vulnerableVersionRange: string; + }; + usage?: components["schemas"]["SocketUsageRef"]; + }; }) | ({ /** @enum {string} */ type?: "mildCVE"; @@ -1142,6 +1288,77 @@ export interface components { }; usage?: components["schemas"]["SocketUsageRef"]; }; + }) | ({ + /** @enum {string} */ + type?: "miscLicenseIssues"; + value?: components["schemas"]["SocketIssueBasics"] & { + /** @default */ + description: string; + props: { + /** @default */ + description: string; + /** @default */ + location: string; + }; + usage?: components["schemas"]["SocketUsageRef"]; + }; + }) | ({ + /** @enum {string} */ + type?: "unidentifiedLicense"; + value?: components["schemas"]["SocketIssueBasics"] & { + /** @default */ + description: string; + props: { + /** @default */ + location: string; + }; + usage?: components["schemas"]["SocketUsageRef"]; + }; + }) | ({ + /** @enum {string} */ + type?: "noLicenseFound"; + value?: components["schemas"]["SocketIssueBasics"] & { + /** @default */ + description: string; + props: Record; + usage?: components["schemas"]["SocketUsageRef"]; + }; + }) | ({ + /** @enum {string} */ + type?: "explicitlyUnlicensedItem"; + value?: components["schemas"]["SocketIssueBasics"] & { + /** @default */ + description: string; + props: { + /** @default */ + location: string; + }; + usage?: components["schemas"]["SocketUsageRef"]; + }; + }) | ({ + /** @enum {string} */ + type?: "copyleftLicense"; + value?: components["schemas"]["SocketIssueBasics"] & { + /** @default */ + description: string; + props: { + /** @default */ + licenseId: string; + }; + usage?: components["schemas"]["SocketUsageRef"]; + }; + }) | ({ + /** @enum {string} */ + type?: "nonpermissiveLicense"; + value?: components["schemas"]["SocketIssueBasics"] & { + /** @default */ + description: string; + props: { + /** @default */ + licenseId: string; + }; + usage?: components["schemas"]["SocketUsageRef"]; + }; }) | ({ /** @enum {string} */ type?: "didYouMean"; @@ -1305,16 +1522,6 @@ export interface components { /** @default null */ value: Record; }; - /** - * @default low - * @enum {string} - */ - SocketIssueSeverity: "low" | "middle" | "high" | "critical"; - /** - * @default miscellaneous - * @enum {string} - */ - SocketCategory: "supplyChainRisk" | "quality" | "maintenance" | "vulnerability" | "license" | "miscellaneous"; SocketRefList: components["schemas"]["SocketRef"][]; SocketRefFile: { /** @default */ @@ -1768,6 +1975,8 @@ export interface operations { image: string; /** @default */ plan: string; + /** @default */ + slug: string; }; }; }; @@ -1905,6 +2114,8 @@ export interface operations { rows: { /** @default */ branch: string; + /** @default false */ + direct: boolean; /** @default */ id: string; /** @default */ @@ -1954,18 +2165,708 @@ export interface operations { responses: { /** @description ID of the dependencies snapshot */ 200: { + content: { + "application/json": Record; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + 500: components["responses"]["SocketInternalServerError"]; + }; + }; + /** + * List repositories (unstable) + * @description Lists repositories for the specified organization. + * + * This endpoint consumes 0 units of your quota. + */ + getOrgRepoList: { + parameters: { + path: { + org_slug: string; + }; + }; + responses: { + /** @description Lists repositories for the specified organization. The authenticated user must be a member of the organization. */ + 200: { + content: { + "application/json": { + results: { + /** @default */ + id?: string; + /** @default */ + created_at?: string; + /** @default */ + updated_at?: string; + /** @default */ + slug?: string; + /** @default */ + head_full_scan_id?: string; + /** @default */ + name?: string; + /** @default */ + description?: string; + /** @default */ + homepage?: string; + /** @default */ + visibility?: string; + /** @default false */ + archived?: boolean; + /** @default */ + default_branch?: string; + }[]; + /** @default 0 */ + nextPage: number; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Create repository (unstable) + * @description Create a repository. + * + * Repos collect Full scans and Diff scans and are typically associated with a git repo. + * + * This endpoint consumes 0 units of your quota. + */ + createOrgRepo: { + parameters: { + path: { + org_slug: string; + }; + }; + requestBody?: { + content: { + "application/json": { + /** @default */ + name?: string; + /** @default */ + description?: string; + /** @default */ + homepage?: string; + /** @default */ + visibility?: string; + /** @default false */ + archived?: boolean; + /** @default */ + default_branch?: string; + }; + }; + }; + responses: { + /** @description Lists repositories for the specified organization. The authenticated user must be a member of the organization. */ + 201: { content: { "application/json": { /** @default */ - id: string; + id?: string; + /** @default */ + created_at?: string; + /** @default */ + updated_at?: string; + /** @default */ + slug?: string; + /** @default */ + head_full_scan_id?: string; + /** @default */ + name?: string; + /** @default */ + description?: string; + /** @default */ + homepage?: string; + /** @default */ + visibility?: string; + /** @default false */ + archived?: boolean; + /** @default */ + default_branch?: string; }; }; }; 400: components["responses"]["SocketBadRequest"]; 401: components["responses"]["SocketUnauthorized"]; 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Get repository (unstable) + * @description Retrieve a repository associated with an organization. + * + * This endpoint consumes 0 units of your quota. + */ + getOrgRepo: { + parameters: { + path: { + org_slug: string; + repo_slug: string; + }; + }; + responses: { + /** @description Lists repositories for the specified organization. The authenticated user must be a member of the organization. */ + 200: { + content: { + "application/json": { + /** @default */ + id?: string; + /** @default */ + created_at?: string; + /** @default */ + updated_at?: string; + /** @default */ + slug?: string; + /** @default */ + head_full_scan_id?: string; + /** @default */ + name?: string; + /** @default */ + description?: string; + /** @default */ + homepage?: string; + /** @default */ + visibility?: string; + /** @default false */ + archived?: boolean; + /** @default */ + default_branch?: string; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Update repository (unstable) + * @description Update details of an existing repository. + * + * This endpoint consumes 0 units of your quota. + */ + updateOrgRepo: { + parameters: { + path: { + org_slug: string; + repo_slug: string; + }; + }; + requestBody?: { + content: { + "application/json": { + /** @default */ + name?: string; + /** @default */ + description?: string; + /** @default */ + homepage?: string; + /** @default */ + visibility?: string; + /** @default false */ + archived?: boolean; + /** @default */ + default_branch?: string; + }; + }; + }; + responses: { + /** @description Update a repositories details */ + 200: { + content: { + "application/json": { + /** @default */ + id?: string; + /** @default */ + created_at?: string; + /** @default */ + updated_at?: string; + /** @default */ + slug?: string; + /** @default */ + head_full_scan_id?: string; + /** @default */ + name?: string; + /** @default */ + description?: string; + /** @default */ + homepage?: string; + /** @default */ + visibility?: string; + /** @default false */ + archived?: boolean; + /** @default */ + default_branch?: string; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Delete repository (unstable) + * @description Delete a single repository and all of its associated Full scans and Diff scans. + * + * This endpoint consumes 0 units of your quota. + */ + deleteOrgRepo: { + parameters: { + path: { + org_slug: string; + repo_slug: string; + }; + }; + responses: { + /** @description Success */ + 200: { + content: { + "application/json": { + /** @default ok */ + status: string; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * List full scans (unstable) + * @description Returns a paginated list of all full scans in an org, excluding SBOM artifacts. + * + * This endpoint consumes 0 units of your quota. + */ + getOrgFullScanList: { + parameters: { + path: { + org_slug: string; + }; + }; + responses: { + /** @description Lists repositories for the specified organization. The authenticated user must be a member of the organization. */ + 200: { + content: { + "application/json": { + results: { + /** @default */ + id?: string; + /** @default */ + created_at?: string; + /** @default */ + updated_at?: string; + /** @default */ + organization_id?: string; + /** @default */ + repository_id?: string; + committers?: string[]; + /** @default */ + repo?: string; + /** @default */ + branch?: string; + /** @default */ + commit_message?: string; + /** @default */ + commit_hash?: string; + /** @default 0 */ + pull_request?: number; + /** @default */ + html_report_url?: string; + }[]; + /** @default 0 */ + nextPage: number; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Create full scan (unstable) + * @description Create a full scan from a set of package manifest files. Returns a full scan including all SBOM artifacts. + * + * This endpoint consumes 0 units of your quota. + */ + CreateOrgFullScan: { + parameters: { + path: { + org_slug: string; + }; + }; + requestBody?: { + content: { + "multipart/form-data": { + [key: string]: never; + }; + }; + }; + responses: { + /** @description Upload manifest files to create a full scan in an org's repo */ + 201: { + content: { + "application/json": { + /** @default */ + id?: string; + /** @default */ + created_at?: string; + /** @default */ + updated_at?: string; + /** @default */ + organization_id?: string; + /** @default */ + repository_id?: string; + committers?: string[]; + /** @default */ + repo?: string; + /** @default */ + branch?: string; + /** @default */ + commit_message?: string; + /** @default */ + commit_hash?: string; + /** @default 0 */ + pull_request?: number; + /** @default */ + html_report_url?: string; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Stream full scan (unstable) + * @description Stream all SBOM artifacts for a full scan. + * + * This endpoint consumes 0 units of your quota. + */ + getOrgFullScan: { + parameters: { + path: { + org_slug: string; + full_scan_id: string; + }; + }; + responses: { + /** @description Socket issue lists and scores for all packages */ + 200: { + content: { + "application/x-ndjson": { + /** + * @default unknown + * @enum {string} + */ + type: "unknown" | "npm" | "pypi" | "golang"; + /** @default */ + namespace?: string; + /** @default */ + name?: string; + /** @default */ + version?: string; + /** @default */ + subpath?: string; + /** @default */ + release?: string; + /** @default */ + id: string; + /** @default false */ + direct?: boolean; + manifestFiles?: { + /** @default */ + file: string; + /** @default 0 */ + start?: number; + /** @default 0 */ + end?: number; + }[]; + topLevelAncestors?: string[]; + dependencies?: string[]; + artifact?: { + /** + * @default unknown + * @enum {string} + */ + type: "unknown" | "npm" | "pypi" | "golang"; + /** @default */ + namespace?: string; + /** @default */ + name?: string; + /** @default */ + version?: string; + /** @default */ + subpath?: string; + /** @default */ + release?: string; + /** @default */ + id: string; + }; + /** @default */ + license?: string; + author?: string[]; + /** @default 0 */ + size?: number; + score?: { + /** @default 0 */ + supplyChain: number; + /** @default 0 */ + quality: number; + /** @default 0 */ + maintenance: number; + /** @default 0 */ + vulnerability: number; + /** @default 0 */ + license: number; + /** @default 0 */ + overall: number; + }; + alerts?: { + /** @default */ + key: string; + /** @default */ + type: string; + severity: components["schemas"]["SocketIssueSeverity"]; + category: components["schemas"]["SocketCategory"]; + /** @default */ + file?: string; + /** @default 0 */ + start?: number; + /** @default 0 */ + end?: number; + /** @default null */ + props?: Record; + }[]; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Delete full scan (unstable) + * @description Delete an existing full scan. + * + * This endpoint consumes 0 units of your quota. + */ + deleteOrgFullScan: { + parameters: { + path: { + org_slug: string; + full_scan_id: string; + }; + }; + responses: { + /** @description Success */ + 200: { + content: { + "application/json": { + /** @default ok */ + status: string; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Get full scan metadata (unstable) + * @description Get metadata for a single full scan + * + * This endpoint consumes 0 units of your quota. + */ + getOrgFullScanMetadata: { + parameters: { + path: { + org_slug: string; + full_scan_id: string; + }; + }; + responses: { + /** @description The data from the full scan */ + 200: { + content: { + "application/json": { + /** @default */ + id?: string; + /** @default */ + created_at?: string; + /** @default */ + updated_at?: string; + /** @default */ + organization_id?: string; + /** @default */ + repository_id?: string; + committers?: string[]; + /** @default */ + repo?: string; + /** @default */ + branch?: string; + /** @default */ + commit_message?: string; + /** @default */ + commit_hash?: string; + /** @default 0 */ + pull_request?: number; + /** @default */ + html_report_url?: string; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Fetch the organization's analytics + * @description This endpoint consumes 0 units of your quota. + */ + getOrgAnalytics: { + parameters: { + path: { + filter: string; + }; + }; + responses: { + /** @description Socket analytics - organization-level data */ + 200: { + content: { + "application/json": { + /** @default 0 */ + id: number; + /** @default */ + created_at: string; + /** @default */ + repository_id: string; + /** @default 0 */ + organization_id: number; + /** @default */ + repository_name: string; + /** @default 0 */ + total_critical_alerts: number; + /** @default 0 */ + total_high_alerts: number; + /** @default 0 */ + total_medium_alerts: number; + /** @default 0 */ + total_low_alerts: number; + /** @default 0 */ + total_critical_added: number; + /** @default 0 */ + total_high_added: number; + /** @default 0 */ + total_medium_added: number; + /** @default 0 */ + total_low_added: number; + /** @default 0 */ + total_critical_prevented: number; + /** @default 0 */ + total_high_prevented: number; + /** @default 0 */ + total_medium_prevented: number; + /** @default 0 */ + total_low_prevented: number; + top_five_alert_types: Record; + }[]; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Fetch repository analytics + * @description This endpoint consumes 0 units of your quota. + */ + getRepoAnalytics: { + parameters: { + path: { + name: string; + filter: string; + }; + }; + responses: { + /** @description Socket analytics - repo-level data */ + 200: { + content: { + "application/json": { + /** @default 0 */ + id: number; + /** @default */ + repository_id: string; + /** @default */ + created_at: string; + /** @default 0 */ + organization_id: number; + /** @default */ + repository_name: string; + /** @default 0 */ + total_critical_alerts: number; + /** @default 0 */ + total_high_alerts: number; + /** @default 0 */ + total_medium_alerts: number; + /** @default 0 */ + total_low_alerts: number; + /** @default 0 */ + total_critical_added: number; + /** @default 0 */ + total_high_added: number; + /** @default 0 */ + total_medium_added: number; + /** @default 0 */ + total_low_added: number; + /** @default 0 */ + total_critical_prevented: number; + /** @default 0 */ + total_high_prevented: number; + /** @default 0 */ + total_medium_prevented: number; + /** @default 0 */ + total_low_prevented: number; + top_five_alert_types: Record; + }[]; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; 429: components["responses"]["SocketTooManyRequestsResponse"]; - 500: components["responses"]["SocketInternalServerError"]; }; }; }