Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bearer/openapi-generator

Package Overview
Dependencies
Maintainers
4
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bearer/openapi-generator - npm Package Compare versions

Comparing version 0.106.0-canary.1 to 0.106.0-canary.5

22

lib/index.js

@@ -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';

6

package.json
{
"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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc