diff --git a/openapi.json b/openapi.json index ffd1aea..45d43e1 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": [ { @@ -4728,28 +4750,6 @@ "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": { @@ -5968,6 +5968,10 @@ "type": "string", "default": "" }, + "direct": { + "type": "boolean", + "default": false + }, "id": { "type": "string", "default": "" @@ -5995,6 +5999,7 @@ }, "required": [ "branch", + "direct", "id", "name", "namespace", @@ -6079,6 +6084,63 @@ } ], "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": { + "type": "object", + "additionalProperties": false, + "properties": {} + } + } + }, + "description": "ID of the dependencies snapshot" + }, + "400": { + "$ref": "#/components/responses/SocketBadRequest" + }, + "401": { + "$ref": "#/components/responses/SocketUnauthorized" + }, + "403": { + "$ref": "#/components/responses/SocketForbidden" + }, + "429": { + "$ref": "#/components/responses/SocketTooManyRequestsResponse" + }, + "500": { + "$ref": "#/components/responses/SocketInternalServerError" + } + }, + "x-readme": {} + } + }, + "/orgs/{org_slug}/repos": { + "get": { + "tags": [ + "Repositories (Unstable)" + ], + "summary": "Get list of repos for an org id", + "operationId": "getOrgRepoList", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [ + "repo:list" + ] + } + ], + "description": "Lists repositories for the specified organization. The authenticated user must be a member of the organization.\n\nThis endpoint consumes 0 units of your quota.", "responses": { "200": { "content": { @@ -6087,18 +6149,68 @@ "type": "object", "additionalProperties": false, "properties": { - "id": { - "type": "string", - "default": "" + "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": "" + }, + "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": [ - "id" + "nextPage", + "results" ] } } }, - "description": "ID of the dependencies snapshot" + "description": "Lists repositories for the specified organization. The authenticated user must be a member of the organization." }, "400": { "$ref": "#/components/responses/SocketBadRequest" @@ -6109,11 +6221,1627 @@ "403": { "$ref": "#/components/responses/SocketForbidden" }, + "404": { + "$ref": "#/components/responses/SocketNotFoundResponse" + }, "429": { "$ref": "#/components/responses/SocketTooManyRequestsResponse" + } + }, + "x-readme": {} + }, + "post": { + "tags": [ + "Repositories (Unstable)" + ], + "summary": "Create a repo in an org", + "operationId": "createOrgRepo", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "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": "" + } + } + } + } }, - "500": { - "$ref": "#/components/responses/SocketInternalServerError" + "required": false + }, + "security": [ + { + "basicAuth": [ + "repo:create" + ] + } + ], + "description": "Create a repo in an org.\n\nRepos collect full scans and diff scans, and can optionally represent a git repo.\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "type": "string", + "default": "" + }, + "slug": { + "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": "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": {} + } + }, + "/orgs/{org_slug}/repos/{repo_slug}": { + "get": { + "tags": [ + "Repositories (Unstable)" + ], + "summary": "Get a repo inside of an org", + "operationId": "getOrgRepo", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [ + "repo:list" + ] + } + ], + "description": "Retrieve a single repo inside of an org\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": "" + }, + "slug": { + "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": "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": {} + }, + "post": { + "tags": [ + "Repositories (Unstable)" + ], + "summary": "Update a repo in an org", + "operationId": "updateOrgRepo", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "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": [ + "repo:update" + ] + } + ], + "description": "Update a repo in an org\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": "" + }, + "slug": { + "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": "Update a repositories details" + }, + "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": {} + }, + "delete": { + "tags": [ + "Repositories (Unstable)" + ], + "summary": "Delete a repo inside of an org, and all of its data", + "operationId": "deleteOrgRepo", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "repo_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [ + "repo:delete" + ] + } + ], + "description": "Delete a single repo inside of an org, including all of its contained data.\n\nThis endpoint consumes 0 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": {} + } + }, + "/orgs/{org_slug}/full-scans": { + "get": { + "tags": [ + "Full-Scans (Unstable)" + ], + "summary": "Get list of all full scans in an org", + "operationId": "getOrgFullScanList", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "security": [ + { + "basicAuth": [ + "full-scans:list" + ] + } + ], + "description": "Paginated list of all full scans in an org\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": "" + }, + "repo": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + }, + "commit_message": { + "type": "string", + "default": "" + }, + "commit_hash": { + "type": "string", + "default": "" + }, + "pull_request": { + "type": "integer", + "default": 0 + }, + "committer": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "sbom_artifacts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "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": { + "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": [ + "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" + ] + }, + "alerts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "key": { + "type": "string", + "default": "" + }, + "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", + "default": null + } + }, + "required": [ + "category", + "key", + "severity", + "type" + ] + } + } + }, + "required": [ + "id", + "type" + ] + } + }, + "sbom_exceeded_artifact_limit": { + "type": "boolean", + "default": false + }, + "sbom_error": { + "type": "object", + "default": null + } + } + } + }, + "nextPage": { + "type": "integer", + "default": 0 + } + }, + "required": [ + "nextPage", + "results" + ] + } + } + }, + "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": {} + }, + "post": { + "tags": [ + "Full-Scans (Unstable)" + ], + "summary": "Create a full scan in a repo in an org", + "operationId": "CreateOrgFullScan", + "parameters": [ + { + "name": "org_slug", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "additionalProperties": { + "type": "string", + "default": { + "type": "Buffer", + "data": [] + }, + "format": "binary" + }, + "properties": { + "repo": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + }, + "commit_message": { + "type": "string", + "default": "" + }, + "commit_hash": { + "type": "string", + "default": "" + }, + "pull_request": { + "type": "integer", + "default": 0 + }, + "committer": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "make_default_branch": { + "type": "boolean", + "default": false + }, + "set_as_pending_head": { + "type": "boolean", + "default": false + }, + "issueRules": { + "type": "object", + "additionalProperties": { + "type": "boolean", + "default": false + }, + "properties": {} + } + } + } + } + }, + "required": false + }, + "security": [ + { + "basicAuth": [ + "full-scans:create" + ] + } + ], + "description": "Paginated list of all full scans in an org\n\nThis endpoint consumes 0 units of your quota.", + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "properties": { + "id": { + "type": "string", + "default": "" + }, + "created_at": { + "type": "string", + "default": "" + }, + "updated_at": { + "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 + }, + "committer": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "sbom_artifacts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "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": { + "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": [ + "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" + ] + }, + "alerts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "key": { + "type": "string", + "default": "" + }, + "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", + "default": null + } + }, + "required": [ + "category", + "key", + "severity", + "type" + ] + } + } + }, + "required": [ + "id", + "type" + ] + } + }, + "sbom_exceeded_artifact_limit": { + "type": "boolean", + "default": false + }, + "sbom_error": { + "type": "object", + "default": null + } + } + } + } + }, + "description": "Upload manifest files to create a full scan in an org's repo" + }, + "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 (Unstable)" + ], + "summary": "Get a full scan in an org by full scan id", + "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": [ + "full-scans:list" + ] + } + ], + "description": "TODO\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": "" + }, + "repo": { + "type": "string", + "default": "" + }, + "branch": { + "type": "string", + "default": "" + }, + "commit_message": { + "type": "string", + "default": "" + }, + "commit_hash": { + "type": "string", + "default": "" + }, + "pull_request": { + "type": "integer", + "default": 0 + }, + "committer": { + "type": "array", + "items": { + "type": "string", + "default": "" + } + }, + "sbom_artifacts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "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": { + "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": [ + "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" + ] + }, + "alerts": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "key": { + "type": "string", + "default": "" + }, + "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", + "default": null + } + }, + "required": [ + "category", + "key", + "severity", + "type" + ] + } + } + }, + "required": [ + "id", + "type" + ] + } + }, + "sbom_exceeded_artifact_limit": { + "type": "boolean", + "default": false + }, + "sbom_error": { + "type": "object", + "default": null + } + } + } + } + }, + "description": "The data from the full scan" + }, + "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": {} + }, + "delete": { + "tags": [ + "Full-Scans (Unstable)" + ], + "summary": "Delete a full scan in an org", + "operationId": "deleteOrgFullScan", + "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:delete" + ] + } + ], + "description": "Delete a full scan in an org\n\nThis endpoint consumes 0 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": {} diff --git a/types/api.d.ts b/types/api.d.ts index 22d318f..7941b16 100644 --- a/types/api.d.ts +++ b/types/api.d.ts @@ -148,6 +148,79 @@ export interface paths { */ post: operations["createDependenciesSnapshot"]; }; + "/orgs/{org_slug}/repos": { + /** + * Get list of repos for an org id + * @description Lists repositories for the specified organization. The authenticated user must be a member of the organization. + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgRepoList"]; + /** + * Create a repo in an org + * @description Create a repo in an org. + * + * Repos collect full scans and diff scans, and can optionally represent a git repo. + * + * This endpoint consumes 0 units of your quota. + */ + post: operations["createOrgRepo"]; + }; + "/orgs/{org_slug}/repos/{repo_slug}": { + /** + * Get a repo inside of an org + * @description Retrieve a single repo inside of an org + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgRepo"]; + /** + * Update a repo in an org + * @description Update a repo in an org + * + * This endpoint consumes 0 units of your quota. + */ + post: operations["updateOrgRepo"]; + /** + * Delete a repo inside of an org, and all of its data + * @description Delete a single repo inside of an org, including all of its contained data. + * + * This endpoint consumes 0 units of your quota. + */ + delete: operations["deleteOrgRepo"]; + }; + "/orgs/{org_slug}/full-scans": { + /** + * Get list of all full scans in an org + * @description Paginated list of all full scans in an org + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgFullScanList"]; + /** + * Create a full scan in a repo in an org + * @description Paginated list of all full scans in an org + * + * This endpoint consumes 0 units of your quota. + */ + post: operations["CreateOrgFullScan"]; + }; + "/orgs/{org_slug}/full-scans/{full_scan_id}": { + /** + * Get a full scan in an org by full scan id + * @description TODO + * + * This endpoint consumes 0 units of your quota. + */ + get: operations["getOrgFullScan"]; + /** + * Delete a full scan in an org + * @description Delete a full scan in an org + * + * This endpoint consumes 0 units of your quota. + */ + delete: operations["deleteOrgFullScan"]; + }; } export type webhooks = Record; @@ -186,6 +259,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"; @@ -1305,16 +1388,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 */ @@ -1905,6 +1978,8 @@ export interface operations { rows: { /** @default */ branch: string; + /** @default false */ + direct: boolean; /** @default */ id: string; /** @default */ @@ -1953,19 +2028,737 @@ 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"]; + }; + }; + /** + * Get list of repos for an org id + * @description Lists repositories for the specified organization. The authenticated user must be a member of the 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 */ + 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 a repo in an org + * @description Create a repo in an org. + * + * Repos collect full scans and diff scans, and can optionally represent 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 */ + 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 a repo inside of an org + * @description Retrieve a single repo inside of an org + * + * 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 */ + 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 a repo in an org + * @description Update a repo in an org + * + * 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 */ + 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 a repo inside of an org, and all of its data + * @description Delete a single repo inside of an org, including all of its contained data. + * + * 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"]; + }; + }; + /** + * Get list of all full scans in an org + * @description Paginated list of all full scans in an org + * + * 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 */ + repo?: string; + /** @default */ + branch?: string; + /** @default */ + commit_message?: string; + /** @default */ + commit_hash?: string; + /** @default 0 */ + pull_request?: number; + committer?: string[]; + sbom_artifacts?: ({ + /** + * @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; + }[]; + })[]; + /** @default false */ + sbom_exceeded_artifact_limit?: boolean; + /** @default null */ + sbom_error?: Record; + })[]; + /** @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 a full scan in a repo in an org + * @description Paginated list of all full scans in an org + * + * This endpoint consumes 0 units of your quota. + */ + CreateOrgFullScan: { + parameters: { + path: { + org_slug: string; + }; + }; + requestBody?: { + content: { + "multipart/form-data": { + /** @default */ + repo?: string; + /** @default */ + branch?: string; + /** @default */ + commit_message?: string; + /** @default */ + commit_hash?: string; + /** @default 0 */ + pull_request?: number; + committer?: string[]; + /** @default false */ + make_default_branch?: boolean; + /** @default false */ + set_as_pending_head?: boolean; + issueRules?: { + [key: string]: boolean; + }; + [key: string]: undefined; + }; + }; + }; + 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 */ + repo?: string; + /** @default */ + branch?: string; + /** @default */ + commit_message?: string; + /** @default */ + commit_hash?: string; + /** @default 0 */ + pull_request?: number; + committer?: string[]; + sbom_artifacts?: ({ + /** + * @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; + }[]; + })[]; + /** @default false */ + sbom_exceeded_artifact_limit?: boolean; + /** @default null */ + sbom_error?: Record; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Get a full scan in an org by full scan id + * @description TODO + * + * This endpoint consumes 0 units of your quota. + */ + getOrgFullScan: { + 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 */ + repo?: string; + /** @default */ + branch?: string; + /** @default */ + commit_message?: string; + /** @default */ + commit_hash?: string; + /** @default 0 */ + pull_request?: number; + committer?: string[]; + sbom_artifacts?: ({ + /** + * @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; + }[]; + })[]; + /** @default false */ + sbom_exceeded_artifact_limit?: boolean; + /** @default null */ + sbom_error?: Record; + }; + }; + }; + 400: components["responses"]["SocketBadRequest"]; + 401: components["responses"]["SocketUnauthorized"]; + 403: components["responses"]["SocketForbidden"]; + 404: components["responses"]["SocketNotFoundResponse"]; + 429: components["responses"]["SocketTooManyRequestsResponse"]; + }; + }; + /** + * Delete a full scan in an org + * @description Delete a full scan in an org + * + * 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"]; - 500: components["responses"]["SocketInternalServerError"]; }; }; }