From 1088fda2e08f7b4f9bbf08c162b6e8f8f8c974bb Mon Sep 17 00:00:00 2001 From: Arda TANRIKULU Date: Mon, 29 Aug 2022 14:04:07 +0300 Subject: [PATCH] Improve tests --- jest.config.js | 8 + packages/loaders/openapi/package.json | 1 + .../getJSONSchemaOptionsFromOpenAPIOptions.ts | 100 ++- .../__snapshots__/example_api.test.ts.snap | 669 +++++++++++++++++- .../loaders/openapi/tests/example_api.test.ts | 27 +- .../openapi/tests/example_api2.test.ts | 5 +- .../openapi/tests/example_api4.test.ts | 3 +- .../openapi/tests/example_api5.test.ts | 9 +- .../openapi/tests/example_api6.test.ts | 7 +- .../openapi/tests/example_api7.test.ts | 13 +- .../tests/example_api_combined.test.ts | 6 +- .../loaders/openapi/tests/file-upload.test.ts | 34 +- .../tests/multiple-responses-swagger.test.ts | 4 +- .../openapi/tests/nested_objects.test.ts | 7 +- yarn.lock | 15 +- 15 files changed, 809 insertions(+), 99 deletions(-) diff --git a/jest.config.js b/jest.config.js index 8ed5cf7541251..7f9bb7c3080e9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,6 +6,8 @@ const ROOT_DIR = __dirname; const TSCONFIG = resolve(ROOT_DIR, 'tsconfig.json'); const tsconfig = require(TSCONFIG); +const ESM_PACKAGES = ['get-port']; + process.env.LC_ALL = 'en_US'; module.exports = { @@ -24,4 +26,10 @@ module.exports = { collectCoverage: false, cacheDirectory: resolve(ROOT_DIR, `${CI ? '' : 'node_modules/'}.cache/jest`), extensionsToTreatAsEsm: ['.ts'], + transform: { + '^.+\\.mjs?$': 'babel-jest', + '^.+\\.ts?$': 'babel-jest', + '^.+\\.js$': 'babel-jest', + }, + transformIgnorePatterns: [`node_modules/(?!(${ESM_PACKAGES.join('|')})/)`], }; diff --git a/packages/loaders/openapi/package.json b/packages/loaders/openapi/package.json index c86120739d4a9..6d983f6668046 100644 --- a/packages/loaders/openapi/package.json +++ b/packages/loaders/openapi/package.json @@ -47,6 +47,7 @@ "body-parser": "1.20.0", "cookie-parser": "1.4.6", "express": "4.18.1", + "get-port": "6.1.2", "json-bigint-patch": "0.0.8", "multer": "1.4.5-lts.1" }, diff --git a/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts b/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts index ef9bdfe58c418..dc7cde3a64c95 100644 --- a/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts +++ b/packages/loaders/openapi/src/getJSONSchemaOptionsFromOpenAPIOptions.ts @@ -95,47 +95,25 @@ export async function getJSONSchemaOptionsFromOpenAPIOptions( oasOrSwagger = (await dereferenceObject(oasOrSwagger)) as any; const operations: JSONSchemaOperationConfig[] = []; + let baseOperationArgTypeMap: Record; - function handleCallback(callbackKey: string, callbackObj: OpenAPIV3.CallbackObject) { - for (const callbackUrlRefKey in callbackObj) { - if (callbackUrlRefKey.startsWith('$')) { - continue; - } - const pubsubTopic = callbackUrlRefKey.split('$request.query').join('args').split('$request.body#/').join('args.'); - const callbackOperationConfig: JSONSchemaPubSubOperationConfig = { - type: OperationTypeNode.SUBSCRIPTION, - field: '', - pubsubTopic, - }; - const callbackUrlObj = callbackObj[callbackUrlRefKey]; - for (const method in callbackUrlObj) { - const callbackOperation: OpenAPIV3.OperationObject = callbackUrlObj[method]; - callbackOperationConfig.field = callbackOperation.operationId; - callbackOperationConfig.description = callbackOperation.description || callbackOperation.summary; - const requestBodyContents = (callbackOperation.requestBody as OpenAPIV3.RequestBodyObject)?.content; - if (requestBodyContents) { - callbackOperationConfig.responseSchema = requestBodyContents[Object.keys(requestBodyContents)[0]] - .schema as any; - } - const responses = callbackOperation.responses; - if (responses) { - const response = responses[Object.keys(responses)[0]]; - if (response) { - const responseContents = (response as OpenAPIV3.ResponseObject).content; - if (responseContents) { - callbackOperationConfig.requestSchema = responseContents[Object.keys(responseContents)[0]].schema as any; - } + if (!baseUrl) { + if ('servers' in oasOrSwagger) { + const serverObj = oasOrSwagger.servers[0]; + baseUrl = serverObj.url.split('{').join('{args.'); + if (serverObj.variables) { + for (const variableName in serverObj.variables) { + const variable = serverObj.variables[variableName]; + if (!(variable as JSONSchemaObject).type) { + (variable as JSONSchemaObject).type = 'string'; + } + baseOperationArgTypeMap = baseOperationArgTypeMap || {}; + baseOperationArgTypeMap[variableName] = variable as JSONSchemaObject; + if (variable.default) { + baseUrl = baseUrl.replace(`{args.${variableName}}`, `{args.${variableName}:${variable.default}}`); } } } - callbackOperationConfig.field = callbackOperationConfig.field || sanitizeNameForGraphQL(callbackKey); - operations.push(callbackOperationConfig); - } - } - - if (!baseUrl) { - if ('servers' in oasOrSwagger) { - baseUrl = oasOrSwagger.servers[0].url; } if ('schemes' in oasOrSwagger && oasOrSwagger.schemes.length > 0 && oasOrSwagger.host) { @@ -169,6 +147,13 @@ export async function getJSONSchemaOptionsFromOpenAPIOptions( schemaHeaders, operationHeaders, responseByStatusCode: {}, + ...(baseOperationArgTypeMap + ? { + argTypeMap: { + ...baseOperationArgTypeMap, + }, + } + : {}), } as OperationConfig; operations.push(operationConfig); methodObjFieldMap.set(methodObj, operationConfig); @@ -472,7 +457,46 @@ export async function getJSONSchemaOptionsFromOpenAPIOptions( if ('callbacks' in methodObj) { for (const callbackKey in methodObj.callbacks) { - handleCallback(callbackKey, methodObj.callbacks[callbackKey] as OpenAPIV3.CallbackObject); + const callbackObj = methodObj.callbacks[callbackKey] as OpenAPIV3.CallbackObject; + for (const callbackUrlRefKey in callbackObj) { + if (callbackUrlRefKey.startsWith('$')) { + continue; + } + const pubsubTopic = callbackUrlRefKey + .split('$request.query') + .join('args') + .split('$request.body#/') + .join('args.'); + const callbackOperationConfig: JSONSchemaPubSubOperationConfig = { + type: OperationTypeNode.SUBSCRIPTION, + field: '', + pubsubTopic, + }; + const callbackUrlObj = callbackObj[callbackUrlRefKey]; + for (const method in callbackUrlObj) { + const callbackOperation: OpenAPIV3.OperationObject = callbackUrlObj[method]; + callbackOperationConfig.field = callbackOperation.operationId; + callbackOperationConfig.description = callbackOperation.description || callbackOperation.summary; + const requestBodyContents = (callbackOperation.requestBody as OpenAPIV3.RequestBodyObject)?.content; + if (requestBodyContents) { + callbackOperationConfig.responseSchema = requestBodyContents[Object.keys(requestBodyContents)[0]] + .schema as any; + } + const responses = callbackOperation.responses; + if (responses) { + const response = responses[Object.keys(responses)[0]]; + if (response) { + const responseContents = (response as OpenAPIV3.ResponseObject).content; + if (responseContents) { + callbackOperationConfig.requestSchema = responseContents[Object.keys(responseContents)[0]] + .schema as any; + } + } + } + } + callbackOperationConfig.field = callbackOperationConfig.field || sanitizeNameForGraphQL(callbackKey); + operations.push(callbackOperationConfig); + } } } diff --git a/packages/loaders/openapi/tests/__snapshots__/example_api.test.ts.snap b/packages/loaders/openapi/tests/__snapshots__/example_api.test.ts.snap index c6fd923adf7d5..d5e9a58cb70e2 100644 --- a/packages/loaders/openapi/tests/__snapshots__/example_api.test.ts.snap +++ b/packages/loaders/openapi/tests/__snapshots__/example_api.test.ts.snap @@ -2,18 +2,26 @@ exports[`example_api should generate the bundle correctly 1`] = ` Object { - "baseUrl": "http://localhost:3002/api", + "baseUrl": "http://localhost:{args.port:3001}/{args.basePath:api}", "name": "example_api", "operationHeaders": Object {}, "operations": Array [ Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "limit": Object { "description": "Limit of the number of users to return.", "name": "limit", "nullable": false, "type": "integer", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Return a list of users.", "field": "getUsers", @@ -83,6 +91,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Create a new user in the system.", "field": "postUser", "headers": Object { @@ -191,6 +209,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -276,6 +302,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -328,6 +362,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -401,12 +443,20 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "companyId": Object { "description": undefined, "name": "companyId", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Returns all company assets", "field": "getAllAssets", @@ -443,6 +493,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Returns information about all employee cars", "field": "getAllCars", "headers": Object { @@ -492,12 +552,20 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "id": Object { "description": undefined, "name": "id", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Returns the profile of a company with the given ID.", "field": "getCompanyById", @@ -557,6 +625,10 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "cookie_size": Object { "description": undefined, "enum": Array [ @@ -581,6 +653,10 @@ Object { "title": "queryInput_getCookie_cookie_type", "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Used to test cookies.", "field": "getCookie", @@ -605,6 +681,10 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "lat": Object { "description": undefined, "name": "lat", @@ -615,6 +695,10 @@ Object { "name": "long", "type": "number", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Used to find the nearest coffee machine based on the user's coordinates. Used to test the content field in parameter objects.", "field": "getNearestCoffeeMachine", @@ -654,6 +738,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "query": Object { "description": undefined, "name": "query", @@ -718,6 +810,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Used to test generation of object types with matching schema.", "field": "getNumberOfCleanDesks", "headers": Object { @@ -737,6 +839,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Used to test generation of object types with matching schema.", "field": "getNumberOfDirtyDesks", "headers": Object { @@ -756,6 +868,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Used to test empty responses", "field": "getBonuses", "method": "GET", @@ -775,6 +897,10 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "parameters": Object { "description": undefined, "name": "parameters", @@ -790,6 +916,10 @@ Object { "title": "queryInput_returnAllOffices_parameters", "type": "object", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Used to test query parameters with form style and explode", "field": "returnAllOffices", @@ -851,12 +981,20 @@ Object { "name": "accept", "type": "string", }, + "basePath": Object { + "default": "api", + "type": "string", + }, "id": Object { "description": "Office ID", "name": "id", "nullable": false, "type": "integer", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Return an office.", "field": "getOffice", @@ -910,6 +1048,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Return a list of papers. Endpoint to test 2XX status code.", "field": "getPapers", "headers": Object { @@ -946,6 +1094,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Create a new paper in the system. Endpoint to test non-application/json request and response bodies.", "field": "postPaper", "headers": Object { @@ -969,6 +1127,16 @@ Object { "type": "mutation", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Endpoint to test unsanitized parameters and data.", "field": "post_product_with_id", "headers": Object { @@ -1027,6 +1195,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "product_id": Object { "description": undefined, "name": "product-id", @@ -1098,12 +1274,20 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "id": Object { "description": undefined, "name": "id", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, "product_tag": Object { "default": "sport", "description": undefined, @@ -1149,12 +1333,20 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "patent_id": Object { "description": undefined, "name": "patent-id", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "An endpoint to test authentication.", "field": "get_patent_with_id", @@ -1201,6 +1393,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "An endpoint to test authenticated POST requests.", "field": "post_project_with_id", "headers": Object { @@ -1276,6 +1478,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "project_id": Object { "description": undefined, "name": "project-id", @@ -1340,6 +1550,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "query": Object { "description": undefined, "name": "query", @@ -1405,12 +1623,20 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "path": Object { "description": undefined, "name": "path", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, "query": Object { "description": undefined, "name": "query", @@ -1487,6 +1713,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "snack_size": Object { "description": undefined, "enum": Array [ @@ -1534,6 +1768,10 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "globalquery": Object { "description": undefined, "name": "globalquery", @@ -1546,6 +1784,10 @@ Object { "nullable": false, "type": "integer", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Endpoint to test sending of options.", "field": "get_Status", @@ -1573,12 +1815,20 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "globalquery": Object { "description": undefined, "name": "globalquery", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "description": "Endpoint to test placeholder objects to wrap response objects.", "field": "post_status", @@ -1612,6 +1862,16 @@ Object { "type": "mutation", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Used to test OAuth token being present in header.", "field": "getSecure", "headers": Object { @@ -1633,6 +1893,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Returns the (contents of a) trashcan from a specific office", "field": "getAllTrashCans", "headers": Object { @@ -1670,6 +1940,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -1710,6 +1988,14 @@ Object { }, Object { "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -1754,6 +2040,16 @@ Object { "type": "mutation", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "It could be anything!", "field": "mystery", "headers": Object { @@ -1781,6 +2077,16 @@ Object { "type": "query", }, Object { + "argTypeMap": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, "description": "Returns an arbitrary JSON object", "field": "random", "headers": Object { @@ -1956,6 +2262,15 @@ Object { "getAllAssets": Object { "$ref": "#/definitions/queryInput_getAllAssets", }, + "getAllCars": Object { + "$ref": "#/definitions/queryInput_getAllCars", + }, + "getAllTrashCans": Object { + "$ref": "#/definitions/queryInput_getAllTrashCans", + }, + "getBonuses": Object { + "$ref": "#/definitions/queryInput_getBonuses", + }, "getCompanyById": Object { "$ref": "#/definitions/queryInput_getCompanyById", }, @@ -1968,18 +2283,30 @@ Object { "getNearestCoffeeMachine": Object { "$ref": "#/definitions/queryInput_getNearestCoffeeMachine", }, + "getNumberOfCleanDesks": Object { + "$ref": "#/definitions/queryInput_getNumberOfCleanDesks", + }, + "getNumberOfDirtyDesks": Object { + "$ref": "#/definitions/queryInput_getNumberOfDirtyDesks", + }, "getOffice": Object { "$ref": "#/definitions/queryInput_getOffice", }, "getOfficeTrashCan": Object { "$ref": "#/definitions/queryInput_getOfficeTrashCan", }, + "getPapers": Object { + "$ref": "#/definitions/queryInput_getPapers", + }, "getProductReviews": Object { "$ref": "#/definitions/queryInput_getProductReviews", }, "getScanner": Object { "$ref": "#/definitions/queryInput_getScanner", }, + "getSecure": Object { + "$ref": "#/definitions/queryInput_getSecure", + }, "getSnack": Object { "$ref": "#/definitions/queryInput_getSnack", }, @@ -2007,6 +2334,12 @@ Object { "get_project_with_id": Object { "$ref": "#/definitions/queryInput_get_project_with_id", }, + "mystery": Object { + "$ref": "#/definitions/queryInput_mystery", + }, + "random": Object { + "$ref": "#/definitions/queryInput_random", + }, "returnAllOffices": Object { "$ref": "#/definitions/queryInput_returnAllOffices", }, @@ -2405,9 +2738,17 @@ Object { }, "mutationInput_postOfficeTrashCan": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "input": Object { "$ref": "#/definitions/mutationInput_postOfficeTrashCan_input", }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -2424,15 +2765,27 @@ Object { }, "mutationInput_postPaper": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "input": Object { "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "mutationInput_postPaper", "type": "object", }, "mutationInput_postScanner": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "input": Object { "type": "string", }, @@ -2442,6 +2795,10 @@ Object { "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, "query": Object { "description": undefined, "name": "query", @@ -2453,33 +2810,61 @@ Object { }, "mutationInput_postUser": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "input": Object { "$ref": "#/definitions/user", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "mutationInput_postUser", "type": "object", }, "mutationInput_post_product_with_id": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "input": Object { "$ref": "#/definitions/product-with-id", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "mutationInput_post_product_with_id", "type": "object", }, "mutationInput_post_project_with_id": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "input": Object { "$ref": "#/definitions/project-with-id", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "mutationInput_post_project_with_id", "type": "object", }, "mutationInput_post_status": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "globalquery": Object { "description": undefined, "name": "globalquery", @@ -2489,6 +2874,10 @@ Object { "input": Object { "$ref": "#/definitions/post_status_request", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "mutationInput_post_status", "type": "object", @@ -2624,36 +3013,102 @@ Object { }, "queryInput_getAllAssets": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "companyId": Object { "description": undefined, "name": "companyId", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_getAllAssets", "type": "object", }, + "queryInput_getAllCars": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_getAllCars", + "type": "object", + }, + "queryInput_getAllTrashCans": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_getAllTrashCans", + "type": "object", + }, + "queryInput_getBonuses": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_getBonuses", + "type": "object", + }, "queryInput_getCompanyById": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "id": Object { "description": undefined, "name": "id", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_getCompanyById", "type": "object", }, "queryInput_getCookie": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "cookie_size": Object { "$ref": "#/definitions/queryInput_getCookie_cookie_size", }, "cookie_type": Object { "$ref": "#/definitions/queryInput_getCookie_cookie_type", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_getCookie", "type": "object", @@ -2684,6 +3139,14 @@ Object { }, "queryInput_getCopier": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "query": Object { "description": undefined, "name": "query", @@ -2695,6 +3158,10 @@ Object { }, "queryInput_getNearestCoffeeMachine": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "lat": Object { "description": undefined, "name": "lat", @@ -2705,24 +3172,72 @@ Object { "name": "long", "type": "number", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_getNearestCoffeeMachine", "type": "object", }, + "queryInput_getNumberOfCleanDesks": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_getNumberOfCleanDesks", + "type": "object", + }, + "queryInput_getNumberOfDirtyDesks": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_getNumberOfDirtyDesks", + "type": "object", + }, "queryInput_getOffice": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "id": Object { "description": "Office ID", "name": "id", "nullable": false, "type": "integer", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_getOffice", "type": "object", }, "queryInput_getOfficeTrashCan": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -2733,14 +3248,36 @@ Object { "title": "queryInput_getOfficeTrashCan", "type": "object", }, + "queryInput_getPapers": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_getPapers", + "type": "object", + }, "queryInput_getProductReviews": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "id": Object { "description": undefined, "name": "id", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, "product_tag": Object { "default": "sport", "description": undefined, @@ -2754,6 +3291,14 @@ Object { }, "queryInput_getScanner": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "query": Object { "description": undefined, "name": "query", @@ -2763,8 +3308,30 @@ Object { "title": "queryInput_getScanner", "type": "object", }, + "queryInput_getSecure": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_getSecure", + "type": "object", + }, "queryInput_getSnack": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "snack_size": Object { "$ref": "#/definitions/queryInput_getSnack_snack_size", }, @@ -2799,6 +3366,14 @@ Object { }, "queryInput_getUserByUsername": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -2811,6 +3386,14 @@ Object { }, "queryInput_getUserCar": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -2823,6 +3406,14 @@ Object { }, "queryInput_getUserFriends": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "username": Object { "description": "Identifier of a user.", "name": "username", @@ -2835,18 +3426,30 @@ Object { }, "queryInput_getUsers": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "limit": Object { "description": "Limit of the number of users to return.", "name": "limit", "nullable": false, "type": "integer", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_getUsers", "type": "object", }, "queryInput_get_Status": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "globalquery": Object { "description": undefined, "name": "globalquery", @@ -2859,24 +3462,44 @@ Object { "nullable": false, "type": "integer", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_get_Status", "type": "object", }, "queryInput_get_patent_with_id": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "patent_id": Object { "description": undefined, "name": "patent-id", "nullable": false, "type": "string", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_get_patent_with_id", "type": "object", }, "queryInput_get_product_with_id": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "product_id": Object { "description": undefined, "name": "product-id", @@ -2895,6 +3518,14 @@ Object { }, "queryInput_get_project_with_id": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, "project_id": Object { "description": undefined, "name": "project-id", @@ -2905,11 +3536,47 @@ Object { "title": "queryInput_get_project_with_id", "type": "object", }, + "queryInput_mystery": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_mystery", + "type": "object", + }, + "queryInput_random": Object { + "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, + "port": Object { + "default": "3001", + "type": "string", + }, + }, + "title": "queryInput_random", + "type": "object", + }, "queryInput_returnAllOffices": Object { "properties": Object { + "basePath": Object { + "default": "api", + "type": "string", + }, "parameters": Object { "$ref": "#/definitions/queryInput_returnAllOffices_parameters", }, + "port": Object { + "default": "3001", + "type": "string", + }, }, "title": "queryInput_returnAllOffices", "type": "object", diff --git a/packages/loaders/openapi/tests/example_api.test.ts b/packages/loaders/openapi/tests/example_api.test.ts index 3945d1b64f665..aa4445f84d576 100644 --- a/packages/loaders/openapi/tests/example_api.test.ts +++ b/packages/loaders/openapi/tests/example_api.test.ts @@ -6,15 +6,15 @@ import { startServer, stopServer } from './example_api_server'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { createBundle, OpenAPILoaderOptions } from '../src'; +import getPort from 'get-port'; let createdSchema: GraphQLSchema; -const PORT = 3002; -const baseUrl = `http://localhost:${PORT}/api`; - -jest.setTimeout(15000); +let baseUrl: string; describe('example_api', () => { beforeAll(async () => { + const PORT = await getPort(); + baseUrl = `http://localhost:${PORT}/api`; createdSchema = await loadGraphQLSchemaFromOpenAPI('example_api', { fetch, baseUrl, @@ -33,7 +33,6 @@ describe('example_api', () => { expect( await createBundle('example_api', { fetch, - baseUrl, source: './fixtures/example_oas.json', cwd: __dirname, }) @@ -609,7 +608,7 @@ describe('example_api', () => { body: '123', }, everythingLink: { - body: 'http://localhost:3002/api/scanner_GET_200_hello_application/json_keep-alive', + body: baseUrl + '/scanner_GET_200_hello_application/json_keep-alive', }, }, }, @@ -675,9 +674,13 @@ describe('example_api', () => { constantLink: { body: '123', everythingLink: { - body: 'http://localhost:3002/api/copier_GET_200_123_application/json_keep-alive', + body: baseUrl + '/copier_GET_200_123_application/json_keep-alive', everythingLink: { - body: 'http://localhost:3002/api/copier_GET_200_http://localhost:3002/api/copier_GET_200_123_application/json_keep-alive_application/json_keep-alive', + body: + baseUrl + + '/copier_GET_200_' + + baseUrl + + '/copier_GET_200_123_application/json_keep-alive_application/json_keep-alive', }, }, }, @@ -686,7 +689,7 @@ describe('example_api', () => { body: '123', }, everythingLink: { - body: 'http://localhost:3002/api/scanner_GET_200_val_application/json_keep-alive', + body: baseUrl + '/scanner_GET_200_val_application/json_keep-alive', }, }, }, @@ -715,7 +718,9 @@ describe('example_api', () => { postScanner: { body: 'req.body: body, req.query.query: query, req.path.path: path', everythingLink2: { - body: 'http://localhost:3002/api/scanner/path_POST_200_body_query_path_application/json_req.body: body, req.query.query: query, req.path.path: path_query_path_keep-alive', + body: + baseUrl + + '/scanner/path_POST_200_body_query_path_application/json_req.body: body, req.query.query: query, req.path.path: path_query_path_keep-alive', }, }, }, @@ -1551,7 +1556,7 @@ describe('example_api', () => { delete extensions.responseHeaders; expect(extensions).toEqual({ method: 'GET', - url: 'http://localhost:3002/api/users/abcdef', + url: `${baseUrl}/users/abcdef`, statusCode: 404, statusText: 'Not Found', responseBody: { diff --git a/packages/loaders/openapi/tests/example_api2.test.ts b/packages/loaders/openapi/tests/example_api2.test.ts index 3f7fa3fbf685e..4f04bdb626559 100644 --- a/packages/loaders/openapi/tests/example_api2.test.ts +++ b/packages/loaders/openapi/tests/example_api2.test.ts @@ -4,10 +4,9 @@ import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAP import { startServer, stopServer } from './example_api2_server'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; +import getPort from 'get-port'; let createdSchema: GraphQLSchema; -const PORT = 3004; -const baseUrl = `http://localhost:${PORT}/api`; /** * This test suite is used to verify the behavior of the naming convention @@ -20,6 +19,8 @@ describe('OpenAPI loader: Naming convention', () => { * Set up the schema first and run example API server */ beforeAll(async () => { + const PORT = await getPort(); + const baseUrl = `http://localhost:${PORT}/api`; createdSchema = await loadGraphQLSchemaFromOpenAPI('test', { fetch, baseUrl, diff --git a/packages/loaders/openapi/tests/example_api4.test.ts b/packages/loaders/openapi/tests/example_api4.test.ts index 32b14749b7108..2700f8d5084d1 100644 --- a/packages/loaders/openapi/tests/example_api4.test.ts +++ b/packages/loaders/openapi/tests/example_api4.test.ts @@ -5,8 +5,6 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; let createdSchema: GraphQLSchema; -jest.setTimeout(15000); - // This test suite is used to verify the behavior of anyOf and oneOf handling describe('OpenAPI loader: Handle anyOf and oneOf', () => { /** @@ -14,6 +12,7 @@ describe('OpenAPI loader: Handle anyOf and oneOf', () => { */ beforeAll(async () => { createdSchema = await loadGraphQLSchemaFromOpenAPI('test', { + baseUrl: 'http://localhost:8080/api', fetch, source: './fixtures/example_oas4.json', cwd: __dirname, diff --git a/packages/loaders/openapi/tests/example_api5.test.ts b/packages/loaders/openapi/tests/example_api5.test.ts index d2ca985509b49..eb37baf7a1f1a 100644 --- a/packages/loaders/openapi/tests/example_api5.test.ts +++ b/packages/loaders/openapi/tests/example_api5.test.ts @@ -4,19 +4,18 @@ import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAP import { startServer, stopServer } from './example_api5_server'; import { fetch } from '@whatwg-node/fetch'; import { printSchemaWithDirectives } from '@graphql-tools/utils'; +import getPort from 'get-port'; let createdSchema: GraphQLSchema; -const PORT = 3007; -// Update PORT for this test case: -const baseUrl = `http://localhost:${PORT}/api`; - -jest.setTimeout(15000); describe('OpenAPI Loader: Testing the naming convention', () => { /** * Set up the schema first and run example API server */ beforeAll(async () => { + const PORT = await getPort(); + // Update PORT for this test case: + const baseUrl = `http://localhost:${PORT}/api`; createdSchema = await loadGraphQLSchemaFromOpenAPI('example_api', { fetch, baseUrl, diff --git a/packages/loaders/openapi/tests/example_api6.test.ts b/packages/loaders/openapi/tests/example_api6.test.ts index a7ddacf3f301c..160f0230fdad3 100644 --- a/packages/loaders/openapi/tests/example_api6.test.ts +++ b/packages/loaders/openapi/tests/example_api6.test.ts @@ -5,17 +5,18 @@ import { parse, validate, GraphQLSchema, execute } from 'graphql'; import { startServer, stopServer } from './example_api6_server'; import { OpenAPILoaderOptions } from '../src'; import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; +import getPort from 'get-port'; let createdSchema: GraphQLSchema; -const PORT = 3008; -// Update PORT for this test case: -const baseUrl = `http://localhost:${PORT}/api`; +let baseUrl: string; describe('example_api6', () => { /** * Set up the schema first and run example API server */ beforeAll(async () => { + const PORT = await getPort(); + baseUrl = `http://localhost:${PORT}/api`; createdSchema = await loadGraphQLSchemaFromOpenAPI('example_api6', { fetch, baseUrl, diff --git a/packages/loaders/openapi/tests/example_api7.test.ts b/packages/loaders/openapi/tests/example_api7.test.ts index a7d7c5b2aaea8..93f913824e748 100644 --- a/packages/loaders/openapi/tests/example_api7.test.ts +++ b/packages/loaders/openapi/tests/example_api7.test.ts @@ -5,19 +5,24 @@ import { GraphQLSchema } from 'graphql'; import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; import { startServer, stopServer, pubsub } from './example_api7_server'; +import getPort from 'get-port'; let createdSchema: GraphQLSchema; -const GRAPHQL_PORT = 3009; -const API_PORT = 3008; + +let GRAPHQL_PORT: number; +let API_PORT: number; let yogaServer: YogaNodeServerInstance; describe('OpenAPI Loader: example_api7', () => { // Set up the schema first and run example API servers beforeAll(async () => { + GRAPHQL_PORT = await getPort(); + API_PORT = await getPort(); + createdSchema = await loadGraphQLSchemaFromOpenAPI('example_api7', { fetch, - baseUrl: `http://localhost:${API_PORT}/api`, + baseUrl: `http://127.0.0.1:${API_PORT}/api`, source: './fixtures/example_oas7.json', cwd: __dirname, pubsub, @@ -62,7 +67,7 @@ describe('OpenAPI Loader: example_api7', () => { } } `; - const baseUrl = `http://localhost:${GRAPHQL_PORT}/graphql`; + const baseUrl = `http://127.0.0.1:${GRAPHQL_PORT}/graphql`; const url = new URL(baseUrl); url.searchParams.append('query', subscriptionOperation); diff --git a/packages/loaders/openapi/tests/example_api_combined.test.ts b/packages/loaders/openapi/tests/example_api_combined.test.ts index d3362f4e7cf9e..1101071f1b105 100644 --- a/packages/loaders/openapi/tests/example_api_combined.test.ts +++ b/packages/loaders/openapi/tests/example_api_combined.test.ts @@ -3,13 +3,13 @@ import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAP import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { fetch } from '@whatwg-node/fetch'; import { startServer, stopServer } from './example_api_server'; - -const PORT = 3010; -const baseUrl = `http://localhost:${PORT}/api`; +import getPort from 'get-port'; describe('Example API Combined', () => { let createdSchema: GraphQLSchema; beforeAll(async () => { + const PORT = await getPort(); + const baseUrl = `http://localhost:${PORT}/api`; await startServer(PORT); createdSchema = await loadGraphQLSchemaFromOpenAPI('example_api_combined', { source: './fixtures/example_oas_combined.json', diff --git a/packages/loaders/openapi/tests/file-upload.test.ts b/packages/loaders/openapi/tests/file-upload.test.ts index be297e12a01dd..33e0c028799c8 100644 --- a/packages/loaders/openapi/tests/file-upload.test.ts +++ b/packages/loaders/openapi/tests/file-upload.test.ts @@ -1,29 +1,33 @@ -import { createServer } from '@graphql-yoga/node'; +import { createServer, YogaNodeServerInstance } from '@graphql-yoga/node'; import { fetch, File, FormData } from '@whatwg-node/fetch'; import { graphql, GraphQLSchema } from 'graphql'; import { startServer as startAPIServer, stopServer as stopAPIServer } from './file_upload_api_server'; import loadGraphQLSchemaFromOpenAPI from '../src'; - -const PORT = 4090; +import getPort from 'get-port'; let createdSchema: GraphQLSchema; +let yoga: YogaNodeServerInstance; beforeAll(async () => { - const [schema] = await Promise.all([ - loadGraphQLSchemaFromOpenAPI('file_upload', { - source: './fixtures/file_upload.json', - cwd: __dirname, - baseUrl: `http://127.0.0.1:${PORT}/api`, - fetch, - }), - startAPIServer(PORT), - ]); - - createdSchema = schema; + const API_PORT = await getPort(); + createdSchema = await loadGraphQLSchemaFromOpenAPI('file_upload', { + source: './fixtures/file_upload.json', + cwd: __dirname, + baseUrl: `http://127.0.0.1:${API_PORT}/api`, + fetch, + }); + const GRAPHQL_PORT = await getPort(); + yoga = createServer({ + schema: createdSchema, + port: GRAPHQL_PORT, + maskedErrors: false, + logging: false, + }); + await Promise.all([yoga.start(), startAPIServer(API_PORT)]); }); afterAll(async () => { - await stopAPIServer(); + await Promise.all([stopAPIServer(), yoga.stop()]); }); test('Registers the File scalar type', async () => { diff --git a/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts b/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts index 4f4e00f206659..c0906b1aa905e 100644 --- a/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts +++ b/packages/loaders/openapi/tests/multiple-responses-swagger.test.ts @@ -1,11 +1,11 @@ import { printSchema } from 'graphql'; -import { join } from 'path'; import loadGraphQLSchemaFromOpenAPI from '../src'; describe('Multiple Responses Swagger', () => { it('should create correct response types with 204 empty response', async () => { const schema = await loadGraphQLSchemaFromOpenAPI('test', { - source: join(__dirname, 'fixtures', 'multiple-responses-swagger.yml'), + source: './fixtures/multiple-responses-swagger.yml', + cwd: __dirname, }); expect(printSchema(schema)).toMatchInlineSnapshot(` "directive @oneOf on INPUT_OBJECT | FIELD_DEFINITION diff --git a/packages/loaders/openapi/tests/nested_objects.test.ts b/packages/loaders/openapi/tests/nested_objects.test.ts index 25b89ca2ddda3..02833f70bd7af 100644 --- a/packages/loaders/openapi/tests/nested_objects.test.ts +++ b/packages/loaders/openapi/tests/nested_objects.test.ts @@ -1,20 +1,21 @@ import { printSchemaWithDirectives } from '@graphql-tools/utils'; import { fetch } from '@whatwg-node/fetch'; +import getPort from 'get-port'; import { GraphQLSchema, parse, validate, execute } from 'graphql'; import { loadGraphQLSchemaFromOpenAPI } from '../src/loadGraphQLSchemaFromOpenAPI'; import { startServer, stopServer } from './nested_objects_server'; let createdSchema: GraphQLSchema; -const PORT = 3009; -// Update PORT for this test case: -const baseUrl = `http://localhost:${PORT}`; describe('OpanAPI: nested objects', () => { /** * Set up the schema first and run example API server */ beforeAll(async () => { + const PORT = await getPort(); + // Update PORT for this test case: + const baseUrl = `http://localhost:${PORT}`; createdSchema = await loadGraphQLSchemaFromOpenAPI('example_api', { fetch, baseUrl, diff --git a/yarn.lock b/yarn.lock index 98dbdc90fa5c0..051bb8c0542cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4951,11 +4951,6 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.50.tgz#1e0caa9364d3fccd2931c3ed96fdbeaa5d4cca83" integrity sha512-C6N5s2ZFtuZRj54k2/zyRhNDjJwwcViAM3Nbm8zjBpbqAdZ00mr0CFxvSKeO8Y/e03WVFLpQMdHYVfUd6SB+Hw== -"@types/eventsource@1.1.9": - version "1.1.9" - resolved "https://registry.yarnpkg.com/@types/eventsource/-/eventsource-1.1.9.tgz#ec35903741773c12b78a1859c82d2778b5eafcf9" - integrity sha512-F3K4oyM12o8W9jxuJmW+1sc8kdw0Hj0t+26urwkcolPJTgkfppEfIdftdcXmUU2QPBIwcrYO6diqgIqgCDf1FA== - "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18", "@types/express-serve-static-core@^4.17.21": version "4.17.30" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.30.tgz#0f2f99617fa8f9696170c46152ccf7500b34ac04" @@ -10086,11 +10081,6 @@ events@^3.2.0: resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -eventsource@2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/eventsource/-/eventsource-2.0.2.tgz#76dfcc02930fb2ff339520b6d290da573a9e8508" - integrity sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA== - execa@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" @@ -10816,6 +10806,11 @@ get-package-type@^0.1.0: resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-port@6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/get-port/-/get-port-6.1.2.tgz#c1228abb67ba0e17fb346da33b15187833b9c08a" + integrity sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw== + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"