@bearer/openapi-generator
Advanced tools
Comparing version 0.106.0-canary.1 to 0.106.0-canary.5
@@ -32,9 +32,4 @@ "use strict"; | ||
const returnTypeNode = method.type; | ||
let dataIndex = 0; // index of ReturnedData in TFetchPromise<ReturnedData, ReturnedError> | ||
let errorIndex = 1; // index of ReturnedError in TFetchPromise<ReturnedData, ReturnedError> | ||
const typeName = checker.typeToString(checker.getTypeFromTypeNode(returnTypeNode)); | ||
if (typeName.startsWith('Promise<TSaveStatePayload')) { | ||
dataIndex = 1; // index of ReturnedData in TSavePromise<State, ReturnedData, ReturnedError> | ||
errorIndex = 2; // index of ReturnedData in TSavePromise<State, ReturnedData, ReturnedError> | ||
} | ||
const dataIndex = 0; // index of ReturnedData in TFetchPromise<ReturnedData, ReturnedError> | ||
const errorIndex = 1; // index of ReturnedError in TFetchPromise<ReturnedData, ReturnedError> | ||
if (returnTypeNode && typescript_1.default.isTypeReferenceNode(returnTypeNode)) { | ||
@@ -52,9 +47,2 @@ const typeData = checker.getTypeFromTypeNode(returnTypeNode.typeArguments[dataIndex]); | ||
} | ||
function resolveParameterTypeIndex(t, checker, i, j) { | ||
let index = i; | ||
if (checker.typeToString(t).startsWith('TSaveActionEvent')) { | ||
index = j; | ||
} | ||
return index; | ||
} | ||
/** | ||
@@ -67,4 +55,3 @@ * Find the Parameter type in func and convert it to json-schema | ||
if (typ.aliasTypeArguments) { | ||
const index = resolveParameterTypeIndex(typ, checker, 0, 1); | ||
return convert_type_1.convertType(typ.aliasTypeArguments[index], checker); | ||
return convert_type_1.convertType(typ.aliasTypeArguments[0], checker); | ||
} | ||
@@ -83,4 +70,3 @@ } | ||
if (typ.aliasTypeArguments) { | ||
const index = resolveParameterTypeIndex(typ, checker, 1, 2); | ||
const authType = checker.typeToString(typ.aliasTypeArguments[index]); | ||
const authType = checker.typeToString(typ.aliasTypeArguments[1]); | ||
if (/apiKey/.test(authType)) | ||
@@ -87,0 +73,0 @@ return 'APIKEY'; |
{ | ||
"name": "@bearer/openapi-generator", | ||
"version": "0.106.0-canary.1+cd647e95", | ||
"version": "0.106.0-canary.5+731e302f", | ||
"description": "Function openapi spec generator", | ||
@@ -32,6 +32,6 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@bearer/functions": "^0.106.0-canary.1+cd647e95", | ||
"@bearer/functions": "^0.106.0-canary.5+731e302f", | ||
"lodash.merge": "^4.6.1" | ||
}, | ||
"gitHead": "cd647e9502fd1704b34b47acf0ba22b2a32cd189" | ||
"gitHead": "731e302f0a03aacbb11eb8f6a20acd829f6cbcf3" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
20480
417