Skip to content

Commit 70e088d

Browse files
authored
Merge pull request #118 from SocketDev/automated/open-api
Sync with OpenAPI definition
2 parents 5427d50 + ddb3451 commit 70e088d

File tree

2 files changed

+263
-0
lines changed

2 files changed

+263
-0
lines changed

openapi.json

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,35 @@
166166
}
167167
}
168168
}
169+
},
170+
"SocketInternalServerError": {
171+
"content": {
172+
"application/json": {
173+
"schema": {
174+
"type": "object",
175+
"additionalProperties": false,
176+
"properties": {
177+
"error": {
178+
"type": "object",
179+
"additionalProperties": false,
180+
"properties": {
181+
"message": {
182+
"type": "string",
183+
"default": ""
184+
}
185+
},
186+
"required": [
187+
"message"
188+
]
189+
}
190+
},
191+
"required": [
192+
"error"
193+
]
194+
}
195+
}
196+
},
197+
"description": "Internal server error"
169198
}
170199
},
171200
"schemas": {
@@ -5523,6 +5552,142 @@
55235552
},
55245553
"x-readme": {}
55255554
}
5555+
},
5556+
"/dependencies/search": {
5557+
"post": {
5558+
"tags": [
5559+
"Dependencies"
5560+
],
5561+
"operationId": "searchDependencies",
5562+
"requestBody": {
5563+
"content": {
5564+
"application/json": {
5565+
"schema": {
5566+
"type": "object",
5567+
"additionalProperties": false,
5568+
"properties": {}
5569+
}
5570+
}
5571+
},
5572+
"required": false
5573+
},
5574+
"security": [
5575+
{
5576+
"basicAuth": []
5577+
}
5578+
],
5579+
"description": ".\n\nThis endpoint consumes 0 units of your quota.",
5580+
"responses": {
5581+
"200": {
5582+
"content": {
5583+
"application/json": {
5584+
"schema": {}
5585+
}
5586+
},
5587+
"description": "List of repos and their latest project report for the organization associated with the token used"
5588+
},
5589+
"400": {
5590+
"$ref": "#/components/responses/SocketBadRequest"
5591+
},
5592+
"401": {
5593+
"$ref": "#/components/responses/SocketUnauthorized"
5594+
},
5595+
"403": {
5596+
"$ref": "#/components/responses/SocketForbidden"
5597+
},
5598+
"404": {
5599+
"$ref": "#/components/responses/SocketNotFoundResponse"
5600+
},
5601+
"429": {
5602+
"$ref": "#/components/responses/SocketTooManyRequestsResponse"
5603+
}
5604+
},
5605+
"x-readme": {}
5606+
}
5607+
},
5608+
"/dependencies/upload": {
5609+
"post": {
5610+
"tags": [
5611+
"Upload",
5612+
"Dependencies"
5613+
],
5614+
"summary": "Create a snapshot of all dependencies from manifest information",
5615+
"operationId": "createDependenciesSnapshot",
5616+
"requestBody": {
5617+
"content": {
5618+
"multipart/form-data": {
5619+
"schema": {
5620+
"type": "object",
5621+
"additionalProperties": {
5622+
"type": "string",
5623+
"default": {
5624+
"type": "Buffer",
5625+
"data": []
5626+
},
5627+
"format": "binary"
5628+
},
5629+
"properties": {
5630+
"repository": {
5631+
"type": "string",
5632+
"default": ""
5633+
},
5634+
"branch": {
5635+
"type": "string",
5636+
"default": ""
5637+
}
5638+
}
5639+
}
5640+
}
5641+
},
5642+
"required": false
5643+
},
5644+
"security": [
5645+
{
5646+
"basicAuth": [
5647+
"report:write"
5648+
]
5649+
}
5650+
],
5651+
"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.",
5652+
"responses": {
5653+
"200": {
5654+
"content": {
5655+
"application/json": {
5656+
"schema": {
5657+
"type": "object",
5658+
"additionalProperties": false,
5659+
"properties": {
5660+
"id": {
5661+
"type": "string",
5662+
"default": ""
5663+
}
5664+
},
5665+
"required": [
5666+
"id"
5667+
]
5668+
}
5669+
}
5670+
},
5671+
"description": "ID of the dependencies snapshot"
5672+
},
5673+
"400": {
5674+
"$ref": "#/components/responses/SocketBadRequest"
5675+
},
5676+
"401": {
5677+
"$ref": "#/components/responses/SocketUnauthorized"
5678+
},
5679+
"403": {
5680+
"$ref": "#/components/responses/SocketForbidden"
5681+
},
5682+
"429": {
5683+
"$ref": "#/components/responses/SocketTooManyRequestsResponse"
5684+
},
5685+
"500": {
5686+
"$ref": "#/components/responses/SocketInternalServerError"
5687+
}
5688+
},
5689+
"x-readme": {}
5690+
}
55265691
}
55275692
}
55285693
}

types/api.d.ts

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,28 @@ export interface paths {
125125
*/
126126
get: operations["getRepoList"];
127127
};
128+
"/dependencies/search": {
129+
/**
130+
* @description .
131+
*
132+
* This endpoint consumes 0 units of your quota.
133+
*/
134+
post: operations["searchDependencies"];
135+
};
136+
"/dependencies/upload": {
137+
/**
138+
* Create a snapshot of all dependencies from manifest information
139+
* @description Upload a set of manifest or lockfiles to get your dependency tree analyzed by Socket.
140+
* You can upload multiple lockfiles in the same request, but each filename must be unique.
141+
*
142+
* The name of the file must be in the supported list.
143+
*
144+
* For example, these are valid filenames: "requirements.txt", "package.json", "folder/package.json", and "deep/nested/folder/package.json".
145+
*
146+
* This endpoint consumes 100 units of your quota.
147+
*/
148+
post: operations["createDependenciesSnapshot"];
149+
};
128150
}
129151

130152
export type webhooks = Record<string, never>;
@@ -1341,6 +1363,17 @@ export interface components {
13411363
};
13421364
};
13431365
};
1366+
/** @description Internal server error */
1367+
SocketInternalServerError: {
1368+
content: {
1369+
"application/json": {
1370+
error: {
1371+
/** @default */
1372+
message: string;
1373+
};
1374+
};
1375+
};
1376+
};
13441377
};
13451378
parameters: never;
13461379
requestBodies: {
@@ -1726,5 +1759,70 @@ export interface operations {
17261759
429: components["responses"]["SocketTooManyRequestsResponse"];
17271760
};
17281761
};
1762+
/**
1763+
* @description .
1764+
*
1765+
* This endpoint consumes 0 units of your quota.
1766+
*/
1767+
searchDependencies: {
1768+
requestBody?: {
1769+
content: {
1770+
"application/json": Record<string, never>;
1771+
};
1772+
};
1773+
responses: {
1774+
/** @description List of repos and their latest project report for the organization associated with the token used */
1775+
200: {
1776+
content: {
1777+
"application/json": unknown;
1778+
};
1779+
};
1780+
400: components["responses"]["SocketBadRequest"];
1781+
401: components["responses"]["SocketUnauthorized"];
1782+
403: components["responses"]["SocketForbidden"];
1783+
404: components["responses"]["SocketNotFoundResponse"];
1784+
429: components["responses"]["SocketTooManyRequestsResponse"];
1785+
};
1786+
};
1787+
/**
1788+
* Create a snapshot of all dependencies from manifest information
1789+
* @description Upload a set of manifest or lockfiles to get your dependency tree analyzed by Socket.
1790+
* You can upload multiple lockfiles in the same request, but each filename must be unique.
1791+
*
1792+
* The name of the file must be in the supported list.
1793+
*
1794+
* For example, these are valid filenames: "requirements.txt", "package.json", "folder/package.json", and "deep/nested/folder/package.json".
1795+
*
1796+
* This endpoint consumes 100 units of your quota.
1797+
*/
1798+
createDependenciesSnapshot: {
1799+
requestBody?: {
1800+
content: {
1801+
"multipart/form-data": {
1802+
/** @default */
1803+
repository?: string;
1804+
/** @default */
1805+
branch?: string;
1806+
[key: string]: undefined;
1807+
};
1808+
};
1809+
};
1810+
responses: {
1811+
/** @description ID of the dependencies snapshot */
1812+
200: {
1813+
content: {
1814+
"application/json": {
1815+
/** @default */
1816+
id: string;
1817+
};
1818+
};
1819+
};
1820+
400: components["responses"]["SocketBadRequest"];
1821+
401: components["responses"]["SocketUnauthorized"];
1822+
403: components["responses"]["SocketForbidden"];
1823+
429: components["responses"]["SocketTooManyRequestsResponse"];
1824+
500: components["responses"]["SocketInternalServerError"];
1825+
};
1826+
};
17291827
}
17301828

0 commit comments

Comments
 (0)