moonflower 1.3.6 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/openapi/analyzerModule/nodeParsers.cjs +1 -1
- package/dist/openapi/analyzerModule/nodeParsers.cjs.map +1 -1
- package/dist/openapi/analyzerModule/nodeParsers.d.ts.map +1 -1
- package/dist/openapi/analyzerModule/nodeParsers.mjs +192 -154
- package/dist/openapi/analyzerModule/nodeParsers.mjs.map +1 -1
- package/dist/openapi/analyzerModule/test/TestCase.d.ts +9 -0
- package/dist/openapi/analyzerModule/test/TestCase.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/openapi/analyzerModule/nodeParsers.ts +49 -2
- package/src/openapi/analyzerModule/test/TestCase.ts +9 -0
- package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.data.ts +63 -0
- package/src/openapi/analyzerModule/test/openApiAnalyzer.spec.ts +79 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ts-morph"),x=require("../../utils/logger.cjs"),R=require("../manager/OpenApiManager.cjs"),b=new WeakMap,f=t=>{const i=b.get(t);if(i)return i;if(t.getKind()===e.SyntaxKind.Identifier){const r=t.asKind(e.SyntaxKind.Identifier).getImplementations()[0]?.getNode();if(r){const a=r.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const y=f(a);return b.set(t,y),y}const d=t.asKind(e.SyntaxKind.Identifier).getDefinitions()[0]?.getNode();if(d){const a=d.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const y=f(a);return b.set(t,y),y}throw new Error("No implementation nor definition available")}return b.set(t,t),t},m=t=>{const i=t.getChildrenOfKind(e.SyntaxKind.Identifier);return i.length===2?f(i[1]):t.getChildren().reverse().find(d=>d.getKind()!==e.SyntaxKind.GreaterThanToken&&d.getKind()!==e.SyntaxKind.CommaToken&&d.getKind()!==e.SyntaxKind.SemicolonToken)},P=t=>{const i=t.getFirstChildByKind(e.SyntaxKind.SyntaxList);return i.isKind(e.SyntaxKind.SyntaxList)?K(i.getFirstChild()):K(i)},K=t=>{const i=t.getSymbol()?.getName();if(i&&R.OpenApiManager.getInstance().hasExposedModel(i))return[{role:"ref",shape:i,optional:!1}];const r=f(t);if(r.asKind(e.SyntaxKind.UndefinedKeyword))return"undefined";const n=r.asKind(e.SyntaxKind.LiteralType);if(n){if(n.getFirstChildByKind(e.SyntaxKind.TrueKeyword))return"true";if(n.getFirstChildByKind(e.SyntaxKind.FalseKeyword))return"false"}if(r.asKind(e.SyntaxKind.BooleanKeyword)||r.asKind(e.SyntaxKind.TrueKeyword)||r.asKind(e.SyntaxKind.FalseKeyword))return"boolean";if(r.asKind(e.SyntaxKind.StringKeyword)||r.asKind(e.SyntaxKind.StringLiteral))return"string";if(r.asKind(e.SyntaxKind.NumberKeyword)||r.asKind(e.SyntaxKind.NumericLiteral))return"number";if(r.asKind(e.SyntaxKind.BigIntKeyword)||r.asKind(e.SyntaxKind.BigIntLiteral))return"bigint";const s=r.asKind(e.SyntaxKind.TypeLiteral);if(s)return s.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertySignature).map(O=>{const V=O.getFirstChildByKind(e.SyntaxKind.Identifier),v=m(O),D=V.getNextSiblingIfKind(e.SyntaxKind.QuestionToken);return{role:"property",identifier:V.getText(),shape:K(v),optional:v.getType().isNullable()||!!D}});const l=r.asKind(e.SyntaxKind.TypeReference);if(l)return K(l.getFirstChild());if(r.asKind(e.SyntaxKind.PropertyAccessExpression)){const A=f(r.getLastChild());return c(A.asKind(e.SyntaxKind.CallExpression).getReturnType(),A)}const u=r.asKind(e.SyntaxKind.UnionType);if(u)return c(u.getType(),r);const C=r.asKind(e.SyntaxKind.TypeQuery);if(C)return K(C.getLastChild());const L=r.asKind(e.SyntaxKind.QualifiedName);if(L)return K(L.getLastChild());const N=r.asKind(e.SyntaxKind.CallExpression);if(N)return c(N.getReturnType(),N);const F=r.asKind(e.SyntaxKind.AwaitExpression);if(F)return K(F.getChildAtIndex(1));const k=r.asKind(e.SyntaxKind.AsExpression);if(k)return K(k.getChildAtIndex(2));const _=r.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${_}] Unknown node type: ${r.getKindName()}`),"unknown_1"},j=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(n=>{const a=n.getFirstChild(),y=(()=>{if(a.isKind(e.SyntaxKind.Identifier))return a.getText();if(a.isKind(e.SyntaxKind.StringLiteral))return a.getLiteralText();const s=n.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${s}] Unknown identifier name: ${a.getText()}`),"unknown_30"})(),p=n.getLastChild(),o=f(p);return{role:"property",identifier:y,shape:h(o),optional:E(o),description:S(o,"description"),errorMessage:S(o,"errorMessage")}})||[],T=t=>{const i=t.asKind(e.SyntaxKind.CallExpression);return i?(i.getReturnType().getSymbol()?.getName()??"").startsWith("Zod"):!1},B=t=>{const i=t.asKind(e.SyntaxKind.CallExpression),d=i.getReturnType().getSymbol()?.getName()??"";if(d==="ZodNumber")return"number";if(d==="ZodString")return"string";if(d==="ZodBoolean")return"boolean";if(d==="ZodBigInt")return"bigint";if(d==="ZodObject"){const y=i.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChild()?.asKind(e.SyntaxKind.ObjectLiteralExpression);if(!y)return"unknown_zod_object";const p=y.getFirstChildByKind(e.SyntaxKind.SyntaxList);return p?p.getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(s=>{const l=s.getFirstChildByKind(e.SyntaxKind.Identifier).getText(),g=s.getLastChild();return{role:"property",identifier:l,shape:T(g)?B(g):h(g),optional:!1}}):[]}if(d==="ZodArray"){const a=i.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChild();return a?[{role:"array",shape:T(a)?B(a):h(a),optional:!1}]:"unknown_zod_array"}const n=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${n}] Unknown zod type: ${d}`),"unknown_zod"},h=t=>{if(T(t))return B(t);const i=t.getParent().getFirstChildByKind(e.SyntaxKind.AsExpression);if(i){const s=i.getLastChildByKind(e.SyntaxKind.TypeReference);return P(s)}const r=t.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(r)return P(r);if(t.getParent().getChildrenOfKind(e.SyntaxKind.SyntaxList).length>=2){const s=t.getParent().getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild();return K(s)}const d=t.getParent().getFirstChildByKind(e.SyntaxKind.CallExpression);if(d){const s=f(d.getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild()),l=s.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(l)return c(l.getType(),l,[]);const g=s.getParent().getFirstChildByKind(e.SyntaxKind.ObjectLiteralExpression);if(g)return h(g);if(s.getKind()===e.SyntaxKind.CallExpression||s.getKind()===e.SyntaxKind.IntersectionType)return h(s);const u=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${u}] Unknown call expression argument: ${s.getKindName()}`),"unknown_3"}const a=t.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).find(s=>s.getFirstChildByKind(e.SyntaxKind.Identifier)?.getText()==="parse");if(a){const s=m(a).asKind(e.SyntaxKind.ArrowFunction).getReturnType();return c(s,a)}const y=t.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChildByKind(e.SyntaxKind.ImportType);if(y){const s=y.getLastChildByKind(e.SyntaxKind.GreaterThanToken).getChildIndex(),l=y.getChildAtIndex(s-1);return K(l.getFirstChild())}const p=t.isKind(e.SyntaxKind.IntersectionType)?t:t.getParent()?.isKind(e.SyntaxKind.VariableDeclaration)?t.getParent()?.getFirstChildByKind(e.SyntaxKind.IntersectionType):null;if(p){const s=p.getFirstChildByKind(e.SyntaxKind.TypeReference);if(s)return P(s)}const o=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${o}] Unknown import type node`),"unknown_2"},E=t=>{if(T(t))return!1;const i=t.asKind(e.SyntaxKind.CallExpression);if(i){const n=i.getFirstChildByKind(e.SyntaxKind.Identifier);if(n?.getText()==="OptionalParam")return!0;if(n?.getText()==="RequiredParam")return!1;const a=i.getFirstChildByKind(e.SyntaxKind.SyntaxList),y=f(a.getFirstChild());return E(y)}return t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).some(n=>n.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()==="optional"?m(n).getKind()===e.SyntaxKind.TrueKeyword:!1)},S=(t,i)=>{if(T(t))return"";const r=f(t),d=r.asKind(e.SyntaxKind.CallExpression);if(d){const l=d.getLastChildByKind(e.SyntaxKind.SyntaxList);return S(l,i)}const n=r.asKind(e.SyntaxKind.SyntaxList);if(n)return n.getChildren().map(g=>S(g,i)).find(g=>!!g&&g!=="unknown_25")||"";const a=r.asKind(e.SyntaxKind.ObjectLiteralExpression);if(a){const g=I(a).find(u=>u.identifier===i);return g?Array.isArray(g.value)?"array":g.value||"":""}const y=r.asKind(e.SyntaxKind.IntersectionType);if(y)return y.getTypeNodes().flatMap(l=>S(l,i)).filter(l=>!!l&&l!=="unknown_25")[0]||"unknown_27";const p=r.asKind(e.SyntaxKind.TypeLiteral);if(p)return S(p.getFirstChildByKind(e.SyntaxKind.SyntaxList),i);const o=r.asKind(e.SyntaxKind.PropertySignature);if(o&&r.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()===i)return m(o).getFirstDescendantByKind(e.SyntaxKind.StringLiteral).getLiteralText();const s=r.getSourceFile().getFilePath().split("/").pop();return x.Logger.dev(`[${s}] Unknown property string value node ${r.getKindName()}`),"unknown_25"},U=t=>{const i=t.getSymbol();if(!t.isObject()||!i)return!1;const r=t.getTypeArguments();return i.getName()==="Promise"&&r.length===1},c=(t,i,r=[])=>{const d=t.getAliasSymbol()?.getName();if(d&&R.OpenApiManager.getInstance().hasExposedModel(d))return[{role:"ref",shape:d,optional:!1}];const n=U(t)?t.getTypeArguments()[0]:t;if(r.some(o=>o===n))return"circular";const a=r.concat(n);if(n.getText()==="void")return"void";if(n.isAny())return"any";if(n.isUnknown())return"unknown";if(n.isNull())return"null";if(n.isUndefined())return"undefined";if(n.isBoolean()||n.isBooleanLiteral())return"boolean";if(n.isStringLiteral())return[{role:"literal_string",shape:String(n.getLiteralValue()),optional:!1}];if(n.isNumberLiteral())return[{role:"literal_number",shape:String(n.getLiteralValue()),optional:!1}];if(n.isString()||n.isTemplateLiteral())return"string";if(n.isNumber())return"number";if(n.getText()==="bigint")return"bigint";if(n.isTuple())return[{role:"tuple",shape:n.getTupleElements().map(o=>({role:"tuple_entry",shape:c(o,i,a),optional:!1})),optional:!1}];if(n.isArray())return[{role:"array",shape:c(n.getArrayElementType(),i,a),optional:!1}];const y=n.getSymbol()?.getName();if(n.isObject()&&(y==="Buffer"||y==="Uint8Array"))return[{role:"buffer",shape:"buffer",optional:!1}];if(n.isObject()&&n.getProperties().length===0){const o=n.getAliasTypeArguments()[1]??n.getStringIndexType();if(o)return[{role:"record",shape:c(o,i,a),optional:!1}]}if(n.isObject())return n.getText()==="Date"?"Date":n.getProperties().map(o=>{const s=o.getValueDeclaration()||o.getDeclarations()[0];if(!s)return{role:"property",identifier:o.getName(),shape:c(o.getTypeAtLocation(i),i,a),optional:!1};if(!(s.asKind(e.SyntaxKind.PropertySignature)||s.asKind(e.SyntaxKind.PropertyAssignment)||s.asKind(e.SyntaxKind.ShorthandPropertyAssignment)))return{role:"property",identifier:o.getName(),shape:c(o.getTypeAtLocation(i),i,a),optional:!1};const g=o.getTypeAtLocation(i).isNullable(),u=c(o.getTypeAtLocation(i),i,a);return{role:"property",identifier:o.getName(),shape:u,optional:g}}).filter(o=>o.shape!=="undefined");if(n.isUnion()){const s=n.getUnionTypes().map(u=>({role:"union_entry",shape:c(u,i,a),optional:!1})).filter((u,C,L)=>!L.find((N,F)=>N.shape===u.shape&&F>C)),l=s.some(u=>u.shape==="undefined"),g=s.filter(u=>u.shape!=="undefined");return g.length===1?g[0].shape:[{role:"union",shape:g,optional:l}]}if(n.isIntersection())return n.getIntersectionTypes().map(l=>c(l,i,a)).filter(l=>typeof l!="string").reduce((l,g)=>[...l,...g],[]);const p=i.getSourceFile().getFilePath().split("/").pop();return x.Logger.warn(`[${p}] Unknown type shape node ${t.getText()}`),"unknown_5"},w=t=>{if(t.isKind(e.SyntaxKind.Identifier))return w(f(t));if(t.isKind(e.SyntaxKind.StringLiteral))return t.getLiteralValue();if(t.isKind(e.SyntaxKind.ArrayLiteralExpression))return t.forEachChildAsArray().map(r=>w(r));if(t.isKind(e.SyntaxKind.PropertyAccessExpression))return w(m(t));if(t.isKind(e.SyntaxKind.ObjectLiteralExpression))return I(t);const i=t.getSourceFile().getFilePath().split("/").pop();return x.Logger.dev(`[${i}] Unknown literal value node ${t.getKindName()}`),"unknown_6"},$=t=>{const i=t.getFirstDescendantByKind(e.SyntaxKind.CallExpression);if(!i)return null;const r=i.getArguments()[0];if(!r)return null;const d=r.getType();return d.isStringLiteral()?d.getLiteralValue():null},I=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(n=>{const y=n.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText(),p=n.getLastChild(),o=f(p),s=w(o);return{identifier:y,value:s}})||[];exports.findNodeImplementation=f;exports.findPropertyAssignmentValueNode=m;exports.getProperTypeShape=c;exports.getRecursiveNodeShape=K;exports.getShapeOfValidatorLiteral=j;exports.getTypeReferenceShape=P;exports.getValidatorPropertyOptionality=E;exports.getValidatorPropertyShape=h;exports.getValidatorPropertyStringValue=S;exports.getValuesOfObjectLiteral=I;exports.resolveEndpointPath=$;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("ts-morph"),S=require("../../utils/logger.cjs"),R=require("../manager/OpenApiManager.cjs"),b=new WeakMap,K=t=>{const i=b.get(t);if(i)return i;if(t.getKind()===e.SyntaxKind.Identifier){const r=t.asKind(e.SyntaxKind.Identifier).getImplementations()[0]?.getNode();if(r){const a=r.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const l=K(a);return b.set(t,l),l}const d=t.asKind(e.SyntaxKind.Identifier).getDefinitions()[0]?.getNode();if(d){const a=d.getParent().getLastChild();if(a===t)throw new Error("Recursive implementation found");const l=K(a);return b.set(t,l),l}throw new Error("No implementation nor definition available")}return b.set(t,t),t},N=t=>{const i=t.getChildrenOfKind(e.SyntaxKind.Identifier);return i.length===2?K(i[1]):t.getChildren().reverse().find(d=>d.getKind()!==e.SyntaxKind.GreaterThanToken&&d.getKind()!==e.SyntaxKind.CommaToken&&d.getKind()!==e.SyntaxKind.SemicolonToken)},P=t=>{const i=t.getFirstChildByKind(e.SyntaxKind.SyntaxList);return i.isKind(e.SyntaxKind.SyntaxList)?x(i.getFirstChild()):x(i)},x=t=>{const i=t.getSymbol()?.getName();if(i&&R.OpenApiManager.getInstance().hasExposedModel(i))return[{role:"ref",shape:i,optional:!1}];const r=K(t);if(r.asKind(e.SyntaxKind.UndefinedKeyword))return"undefined";const n=r.asKind(e.SyntaxKind.LiteralType);if(n){if(n.getFirstChildByKind(e.SyntaxKind.TrueKeyword))return"true";if(n.getFirstChildByKind(e.SyntaxKind.FalseKeyword))return"false"}if(r.asKind(e.SyntaxKind.BooleanKeyword)||r.asKind(e.SyntaxKind.TrueKeyword)||r.asKind(e.SyntaxKind.FalseKeyword))return"boolean";if(r.asKind(e.SyntaxKind.StringKeyword)||r.asKind(e.SyntaxKind.StringLiteral))return"string";if(r.asKind(e.SyntaxKind.NumberKeyword)||r.asKind(e.SyntaxKind.NumericLiteral))return"number";if(r.asKind(e.SyntaxKind.BigIntKeyword)||r.asKind(e.SyntaxKind.BigIntLiteral))return"bigint";const s=r.asKind(e.SyntaxKind.TypeLiteral);if(s)return s.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertySignature).map(O=>{const v=O.getFirstChildByKind(e.SyntaxKind.Identifier),V=N(O),_=v.getNextSiblingIfKind(e.SyntaxKind.QuestionToken);return{role:"property",identifier:v.getText(),shape:x(V),optional:V.getType().isNullable()||!!_}});const o=r.asKind(e.SyntaxKind.TypeReference);if(o)return x(o.getFirstChild());if(r.asKind(e.SyntaxKind.PropertyAccessExpression)){const B=K(r.getLastChild());return p(B.asKind(e.SyntaxKind.CallExpression).getReturnType(),B)}const f=r.asKind(e.SyntaxKind.UnionType);if(f)return p(f.getType(),r);const c=r.asKind(e.SyntaxKind.TypeQuery);if(c)return x(c.getLastChild());const A=r.asKind(e.SyntaxKind.QualifiedName);if(A)return x(A.getLastChild());const T=r.asKind(e.SyntaxKind.CallExpression);if(T)return p(T.getReturnType(),T);const L=r.asKind(e.SyntaxKind.AwaitExpression);if(L)return x(L.getChildAtIndex(1));const F=r.asKind(e.SyntaxKind.AsExpression);if(F)return x(F.getChildAtIndex(2));const U=r.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${U}] Unknown node type: ${r.getKindName()}`),"unknown_1"},j=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(n=>{const a=n.getFirstChild(),l=(()=>{if(a.isKind(e.SyntaxKind.Identifier))return a.getText();if(a.isKind(e.SyntaxKind.StringLiteral))return a.getLiteralText();const s=n.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${s}] Unknown identifier name: ${a.getText()}`),"unknown_30"})(),g=n.getLastChild(),u=K(g);return{role:"property",identifier:l,shape:m(u),optional:I(u),description:h(u,"description"),errorMessage:h(u,"errorMessage")}})||[],C=t=>{const i=t.asKind(e.SyntaxKind.CallExpression);return i?(i.getReturnType().getSymbol()?.getName()??"").startsWith("Zod"):!1},E=t=>{const i=t.asKind(e.SyntaxKind.CallExpression),d=i.getReturnType().getSymbol()?.getName()??"";if(d==="ZodNumber")return"number";if(d==="ZodString")return"string";if(d==="ZodBoolean")return"boolean";if(d==="ZodBigInt")return"bigint";if(d==="ZodObject"){const l=i.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChild()?.asKind(e.SyntaxKind.ObjectLiteralExpression);if(!l)return"unknown_zod_object";const g=l.getFirstChildByKind(e.SyntaxKind.SyntaxList);return g?g.getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(s=>{const o=s.getFirstChildByKind(e.SyntaxKind.Identifier).getText(),y=s.getLastChild();return{role:"property",identifier:o,shape:C(y)?E(y):m(y),optional:!1}}):[]}if(d==="ZodArray"){const a=i.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChild();return a?[{role:"array",shape:C(a)?E(a):m(a),optional:!1}]:"unknown_zod_array"}const n=t.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${n}] Unknown zod type: ${d}`),"unknown_zod"},m=t=>{if(C(t))return E(t);const i=t.getParent().getFirstChildByKind(e.SyntaxKind.AsExpression);if(i){const s=i.getLastChildByKind(e.SyntaxKind.TypeReference);return P(s)}const r=t.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(r)return P(r);if(t.getParent().getChildrenOfKind(e.SyntaxKind.SyntaxList).length>=2){const s=t.getParent().getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild();return x(s)}const d=t.getParent().getFirstChildByKind(e.SyntaxKind.CallExpression);if(d){const s=K(d.getFirstChildByKind(e.SyntaxKind.SyntaxList).getFirstChild()),o=s.getParent().getFirstChildByKind(e.SyntaxKind.TypeReference);if(o)return p(o.getType(),o,[]);const y=s.getParent().getFirstChildByKind(e.SyntaxKind.ObjectLiteralExpression);if(y)return m(y);if(s.getKind()===e.SyntaxKind.CallExpression||s.getKind()===e.SyntaxKind.IntersectionType)return m(s);const f=t.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${f}] Unknown call expression argument: ${s.getKindName()}`),"unknown_3"}const a=t.getFirstChildByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).find(s=>s.getFirstChildByKind(e.SyntaxKind.Identifier)?.getText()==="parse");if(a){const s=N(a).asKind(e.SyntaxKind.ArrowFunction).getReturnType();return p(s,a)}const l=t.getFirstChildByKind(e.SyntaxKind.SyntaxList)?.getFirstChildByKind(e.SyntaxKind.ImportType);if(l){const s=l.getLastChildByKind(e.SyntaxKind.GreaterThanToken).getChildIndex(),o=l.getChildAtIndex(s-1);return x(o.getFirstChild())}const g=t.isKind(e.SyntaxKind.IntersectionType)?t:t.getParent()?.isKind(e.SyntaxKind.VariableDeclaration)?t.getParent()?.getFirstChildByKind(e.SyntaxKind.IntersectionType):null;if(g){const s=g.getFirstChildByKind(e.SyntaxKind.TypeReference);if(s)return P(s)}const u=t.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${u}] Unknown import type node`),"unknown_2"},I=t=>{if(C(t))return!1;const i=t.asKind(e.SyntaxKind.CallExpression);if(i){const n=i.getFirstChildByKind(e.SyntaxKind.Identifier);if(n?.getText()==="OptionalParam")return!0;if(n?.getText()==="RequiredParam")return!1;const a=i.getFirstChildByKind(e.SyntaxKind.SyntaxList),l=K(a.getFirstChild());return I(l)}return t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).some(n=>n.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()==="optional"?N(n).getKind()===e.SyntaxKind.TrueKeyword:!1)},h=(t,i)=>{if(C(t))return"";const r=K(t),d=r.asKind(e.SyntaxKind.CallExpression);if(d){const o=d.getLastChildByKind(e.SyntaxKind.SyntaxList);return h(o,i)}const n=r.asKind(e.SyntaxKind.SyntaxList);if(n)return n.getChildren().map(y=>h(y,i)).find(y=>!!y&&y!=="unknown_25")||"";const a=r.asKind(e.SyntaxKind.ObjectLiteralExpression);if(a){const y=k(a).find(f=>f.identifier===i);return y?Array.isArray(y.value)?"array":y.value||"":""}const l=r.asKind(e.SyntaxKind.IntersectionType);if(l)return l.getTypeNodes().flatMap(o=>h(o,i)).filter(o=>!!o&&o!=="unknown_25")[0]||"unknown_27";const g=r.asKind(e.SyntaxKind.TypeLiteral);if(g)return h(g.getFirstChildByKind(e.SyntaxKind.SyntaxList),i);const u=r.asKind(e.SyntaxKind.PropertySignature);if(u&&r.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText()===i)return N(u).getFirstDescendantByKind(e.SyntaxKind.StringLiteral).getLiteralText();const s=r.getSourceFile().getFilePath().split("/").pop();return S.Logger.dev(`[${s}] Unknown property string value node ${r.getKindName()}`),"unknown_25"},D=t=>{const i=t.getSymbol();if(!t.isObject()||!i)return!1;const r=t.getTypeArguments();return i.getName()==="Promise"&&r.length===1},p=(t,i,r=[])=>{const d=t.getAliasSymbol()?.getName();if(d&&R.OpenApiManager.getInstance().hasExposedModel(d))return[{role:"ref",shape:d,optional:!1}];const n=D(t)?t.getTypeArguments()[0]:t;if(r.some(s=>s===n))return"circular";const a=r.concat(n);if(n.getText()==="void")return"void";if(n.isAny())return"any";if(n.isUnknown())return"unknown";if(n.isNull())return"null";if(n.isUndefined())return"undefined";if(n.isBoolean()||n.isBooleanLiteral())return"boolean";if(n.isStringLiteral())return[{role:"literal_string",shape:String(n.getLiteralValue()),optional:!1}];if(n.isNumberLiteral())return[{role:"literal_number",shape:String(n.getLiteralValue()),optional:!1}];if(n.isString()||n.isTemplateLiteral())return"string";if(n.isNumber())return"number";if(n.getText()==="bigint")return"bigint";if(n.isTuple())return[{role:"tuple",shape:n.getTupleElements().map(s=>({role:"tuple_entry",shape:p(s,i,a),optional:!1})),optional:!1}];if(n.isArray())return[{role:"array",shape:p(n.getArrayElementType(),i,a),optional:!1}];const l=n.getSymbol()?.getName(),g=new Set(["Buffer","Uint8Array","Int8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array","ArrayBuffer","SharedArrayBuffer","ReadableStream"]);if(n.isObject()&&l&&g.has(l))return[{role:"buffer",shape:"buffer",optional:!1}];if(n.isObject()&&l==="RegExp")return"string";if(n.isObject()&&l==="Map"){const o=n.getTypeArguments()[1];return[{role:"record",shape:o?p(o,i,a):"unknown",optional:!1}]}if(n.isObject()&&l==="Set"){const o=n.getTypeArguments()[0];return[{role:"array",shape:o?p(o,i,a):"unknown",optional:!1}]}if(n.isObject()&&n.getProperties().length===0){const s=n.getAliasTypeArguments()[1]??n.getStringIndexType();if(s)return[{role:"record",shape:p(s,i,a),optional:!1}]}if(n.isObject())return l==="Date"||n.getText()==="Date"?"Date":n.getProperties().map(s=>{const o=s.getValueDeclaration()||s.getDeclarations()[0];if(!o)return{role:"property",identifier:s.getName(),shape:p(s.getTypeAtLocation(i),i,a),optional:!1};if(!(o.asKind(e.SyntaxKind.PropertySignature)||o.asKind(e.SyntaxKind.PropertyAssignment)||o.asKind(e.SyntaxKind.ShorthandPropertyAssignment)))return{role:"property",identifier:s.getName(),shape:p(s.getTypeAtLocation(i),i,a),optional:!1};const f=s.getTypeAtLocation(i).isNullable(),c=p(s.getTypeAtLocation(i),i,a);return{role:"property",identifier:s.getName(),shape:c,optional:f}}).filter(s=>s.shape!=="undefined");if(n.isUnion()){const o=n.getUnionTypes().map(c=>({role:"union_entry",shape:p(c,i,a),optional:!1})).filter((c,A,T)=>!T.find((L,F)=>L.shape===c.shape&&F>A)),y=o.some(c=>c.shape==="undefined"),f=o.filter(c=>c.shape!=="undefined");return f.length===1?f[0].shape:[{role:"union",shape:f,optional:y}]}if(n.isIntersection())return n.getIntersectionTypes().map(y=>p(y,i,a)).filter(y=>typeof y!="string").reduce((y,f)=>[...y,...f],[]);const u=i.getSourceFile().getFilePath().split("/").pop();return S.Logger.warn(`[${u}] Unknown type shape node ${t.getText()}`),"unknown_5"},w=t=>{if(t.isKind(e.SyntaxKind.Identifier))return w(K(t));if(t.isKind(e.SyntaxKind.StringLiteral))return t.getLiteralValue();if(t.isKind(e.SyntaxKind.ArrayLiteralExpression))return t.forEachChildAsArray().map(r=>w(r));if(t.isKind(e.SyntaxKind.PropertyAccessExpression))return w(N(t));if(t.isKind(e.SyntaxKind.ObjectLiteralExpression))return k(t);const i=t.getSourceFile().getFilePath().split("/").pop();return S.Logger.dev(`[${i}] Unknown literal value node ${t.getKindName()}`),"unknown_6"},M=t=>{const i=t.getFirstDescendantByKind(e.SyntaxKind.CallExpression);if(!i)return null;const r=i.getArguments()[0];if(!r)return null;const d=r.getType();return d.isStringLiteral()?d.getLiteralValue():null},k=t=>t.getFirstDescendantByKind(e.SyntaxKind.SyntaxList).getChildrenOfKind(e.SyntaxKind.PropertyAssignment).map(n=>{const l=n.getFirstDescendantByKind(e.SyntaxKind.Identifier).getText(),g=n.getLastChild(),u=K(g),s=w(u);return{identifier:l,value:s}})||[];exports.findNodeImplementation=K;exports.findPropertyAssignmentValueNode=N;exports.getProperTypeShape=p;exports.getRecursiveNodeShape=x;exports.getShapeOfValidatorLiteral=j;exports.getTypeReferenceShape=P;exports.getValidatorPropertyOptionality=I;exports.getValidatorPropertyShape=m;exports.getValidatorPropertyStringValue=h;exports.getValuesOfObjectLiteral=k;exports.resolveEndpointPath=M;
|
|
2
2
|
//# sourceMappingURL=nodeParsers.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodeParsers.cjs","sources":["../../../src/openapi/analyzerModule/nodeParsers.ts"],"sourcesContent":["import {\n\tNode,\n\tPropertyAccessExpression,\n\tPropertyAssignment,\n\tPropertySignature,\n\tShorthandPropertyAssignment,\n\tSyntaxKind,\n\tts,\n\tType,\n\tTypeReferenceNode,\n} from 'ts-morph'\n\nimport { Logger } from '../../utils/logger'\nimport { OpenApiManager } from '../manager/OpenApiManager'\nimport { ShapeOfProperty, ShapeOfType, ShapeOfUnionEntry } from './types'\n\nconst implementationCache = new WeakMap<Node, Node>()\n\nexport const findNodeImplementation = (node: Node): Node => {\n\tconst cached = implementationCache.get(node)\n\tif (cached) {\n\t\treturn cached\n\t}\n\n\tif (node.getKind() === SyntaxKind.Identifier) {\n\t\tconst implementationNode = node.asKind(SyntaxKind.Identifier)!.getImplementations()[0]?.getNode()\n\t\tif (implementationNode) {\n\t\t\tconst implementationParentNode = implementationNode.getParent()!\n\t\t\tconst assignmentValueNode = implementationParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\n\t\tconst definitionNode = node.asKind(SyntaxKind.Identifier)!.getDefinitions()[0]?.getNode()\n\t\tif (definitionNode) {\n\t\t\tconst definitionParentNode = definitionNode.getParent()!\n\t\t\tconst assignmentValueNode = definitionParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\t\tthrow new Error('No implementation nor definition available')\n\t}\n\n\timplementationCache.set(node, node)\n\treturn node\n}\n\nexport const findPropertyAssignmentValueNode = (\n\tnode:\n\t\t| PropertyAssignment\n\t\t| TypeReferenceNode\n\t\t| PropertySignature\n\t\t| PropertyAccessExpression\n\t\t| ShorthandPropertyAssignment,\n): Node => {\n\tconst identifierChildren = node.getChildrenOfKind(SyntaxKind.Identifier)\n\tif (identifierChildren.length === 2) {\n\t\treturn findNodeImplementation(identifierChildren[1])\n\t}\n\tconst lastMatchingChild = node.getChildren().reverse()\n\treturn lastMatchingChild.find(\n\t\t(child) =>\n\t\t\tchild.getKind() !== SyntaxKind.GreaterThanToken &&\n\t\t\tchild.getKind() !== SyntaxKind.CommaToken &&\n\t\t\tchild.getKind() !== SyntaxKind.SemicolonToken,\n\t)!\n}\n\nexport const getTypeReferenceShape = (node: TypeReferenceNode): ShapeOfType['shape'] => {\n\tconst firstChild = node.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tif (firstChild.isKind(SyntaxKind.SyntaxList)) {\n\t\treturn getRecursiveNodeShape(firstChild.getFirstChild()!)\n\t} else {\n\t\treturn getRecursiveNodeShape(firstChild)\n\t}\n}\n\nexport const getRecursiveNodeShape = (nodeOrReference: Node): ShapeOfType['shape'] => {\n\tconst typeName = nodeOrReference.getSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\t// Undefined\n\tconst undefinedNode = node.asKind(SyntaxKind.UndefinedKeyword)\n\tif (undefinedNode) {\n\t\treturn 'undefined'\n\t}\n\n\t// Literal type\n\tconst literalNode = node.asKind(SyntaxKind.LiteralType)\n\tif (literalNode) {\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.TrueKeyword)) {\n\t\t\treturn 'true'\n\t\t}\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.FalseKeyword)) {\n\t\t\treturn 'false'\n\t\t}\n\t}\n\n\t// Boolean literal\n\tconst booleanLiteralNode =\n\t\tnode.asKind(SyntaxKind.BooleanKeyword) ||\n\t\tnode.asKind(SyntaxKind.TrueKeyword) ||\n\t\tnode.asKind(SyntaxKind.FalseKeyword)\n\tif (booleanLiteralNode) {\n\t\treturn 'boolean'\n\t}\n\n\t// String literal\n\tconst stringLiteralNode = node.asKind(SyntaxKind.StringKeyword) || node.asKind(SyntaxKind.StringLiteral)\n\tif (stringLiteralNode) {\n\t\treturn 'string'\n\t}\n\n\t// Number literal\n\tconst numberLiteralNode = node.asKind(SyntaxKind.NumberKeyword) || node.asKind(SyntaxKind.NumericLiteral)\n\tif (numberLiteralNode) {\n\t\treturn 'number'\n\t}\n\n\t// BigInt literal\n\tconst bigIntNode = node.asKind(SyntaxKind.BigIntKeyword) || node.asKind(SyntaxKind.BigIntLiteral)\n\tif (bigIntNode) {\n\t\treturn 'bigint'\n\t}\n\n\t// Type literal\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\tconst properties = typeLiteralNode\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getChildrenOfKind(SyntaxKind.PropertySignature)\n\n\t\tconst propertyShapes = properties.map((propNode) => {\n\t\t\tconst identifier = propNode.getFirstChildByKind(SyntaxKind.Identifier)!\n\t\t\tconst valueNode = findPropertyAssignmentValueNode(propNode)\n\t\t\tconst questionMarkToken = identifier.getNextSiblingIfKind(SyntaxKind.QuestionToken)\n\t\t\treturn {\n\t\t\t\trole: 'property' as const,\n\t\t\t\tidentifier: identifier.getText(),\n\t\t\t\tshape: getRecursiveNodeShape(valueNode),\n\t\t\t\toptional: valueNode.getType().isNullable() || !!questionMarkToken,\n\t\t\t}\n\t\t})\n\t\treturn propertyShapes\n\t}\n\n\t// Type reference\n\tconst typeReferenceNode = node.asKind(SyntaxKind.TypeReference)\n\tif (typeReferenceNode) {\n\t\treturn getRecursiveNodeShape(typeReferenceNode.getFirstChild()!)\n\t}\n\n\t// Property access expression\n\tconst propertyAccessNode = node.asKind(SyntaxKind.PropertyAccessExpression)\n\tif (propertyAccessNode) {\n\t\tconst lastChild = findNodeImplementation(node.getLastChild()!)\n\t\treturn getProperTypeShape(lastChild.asKind(SyntaxKind.CallExpression)!.getReturnType(), lastChild)\n\t}\n\n\t// Union type\n\tconst unionTypeNode = node.asKind(SyntaxKind.UnionType)\n\tif (unionTypeNode) {\n\t\treturn getProperTypeShape(unionTypeNode.getType(), node)\n\t}\n\n\t// Typeof query\n\tconst typeQueryNode = node.asKind(SyntaxKind.TypeQuery)\n\tif (typeQueryNode) {\n\t\treturn getRecursiveNodeShape(typeQueryNode.getLastChild()!)\n\t}\n\n\t// Qualified name\n\tconst qualifiedNameNode = node.asKind(SyntaxKind.QualifiedName)\n\tif (qualifiedNameNode) {\n\t\treturn getRecursiveNodeShape(qualifiedNameNode.getLastChild()!)\n\t}\n\n\t// Call expression\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\treturn getProperTypeShape(callExpressionNode.getReturnType(), callExpressionNode)\n\t}\n\n\t// Await expression\n\tconst awaitExpressionNode = node.asKind(SyntaxKind.AwaitExpression)\n\tif (awaitExpressionNode) {\n\t\treturn getRecursiveNodeShape(awaitExpressionNode.getChildAtIndex(1)!)\n\t}\n\n\t// 'As' Expression\n\tconst asExpressionNode = node.asKind(SyntaxKind.AsExpression)\n\tif (asExpressionNode) {\n\t\treturn getRecursiveNodeShape(asExpressionNode.getChildAtIndex(2)!)\n\t}\n\n\t// TODO\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown node type: ${node.getKindName()}`)\n\treturn 'unknown_1'\n}\n\nexport const getShapeOfValidatorLiteral = (\n\tobjectLiteralNode: Node<ts.ObjectLiteralExpression>,\n): (ShapeOfProperty & { description: string; errorMessage: string })[] => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstChild()!\n\t\tconst identifierName = (() => {\n\t\t\tif (identifierNode.isKind(SyntaxKind.Identifier)) {\n\t\t\t\treturn identifierNode.getText()\n\t\t\t}\n\t\t\tif (identifierNode.isKind(SyntaxKind.StringLiteral)) {\n\t\t\t\treturn identifierNode.getLiteralText()\n\t\t\t}\n\t\t\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\t\t\tLogger.warn(`[${fileName}] Unknown identifier name: ${identifierNode.getText()}`)\n\t\t\treturn 'unknown_30'\n\t\t})()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst innerLiteralNode = findNodeImplementation(assignmentValueNode)\n\n\t\treturn {\n\t\t\trole: 'property' as const,\n\t\t\tidentifier: identifierName,\n\t\t\tshape: getValidatorPropertyShape(innerLiteralNode),\n\t\t\toptional: getValidatorPropertyOptionality(innerLiteralNode),\n\t\t\tdescription: getValidatorPropertyStringValue(innerLiteralNode, 'description'),\n\t\t\terrorMessage: getValidatorPropertyStringValue(innerLiteralNode, 'errorMessage'),\n\t\t}\n\t})\n\n\treturn properties || []\n}\n\nconst isZodCallExpression = (node: Node): boolean => {\n\tconst callExpression = node.asKind(SyntaxKind.CallExpression)\n\tif (!callExpression) {\n\t\treturn false\n\t}\n\tconst returnType = callExpression.getReturnType()\n\tconst typeName = returnType.getSymbol()?.getName() ?? ''\n\treturn typeName.startsWith('Zod')\n}\n\nconst getZodCallShape = (node: Node): ShapeOfType['shape'] => {\n\tconst callExpression = node.asKind(SyntaxKind.CallExpression)!\n\tconst returnType = callExpression.getReturnType()\n\tconst typeName = returnType.getSymbol()?.getName() ?? ''\n\n\tif (typeName === 'ZodNumber') {\n\t\treturn 'number'\n\t}\n\tif (typeName === 'ZodString') {\n\t\treturn 'string'\n\t}\n\tif (typeName === 'ZodBoolean') {\n\t\treturn 'boolean'\n\t}\n\tif (typeName === 'ZodBigInt') {\n\t\treturn 'bigint'\n\t}\n\n\tif (typeName === 'ZodObject') {\n\t\tconst argNode = callExpression.getFirstChildByKind(SyntaxKind.SyntaxList)?.getFirstChild()\n\t\tconst objectLiteral = argNode?.asKind(SyntaxKind.ObjectLiteralExpression)\n\t\tif (!objectLiteral) {\n\t\t\treturn 'unknown_zod_object'\n\t\t}\n\t\tconst syntaxList = objectLiteral.getFirstChildByKind(SyntaxKind.SyntaxList)\n\t\tif (!syntaxList) {\n\t\t\treturn []\n\t\t}\n\t\tconst properties = syntaxList.getChildrenOfKind(SyntaxKind.PropertyAssignment)\n\t\treturn properties.map((prop) => {\n\t\t\tconst identifier = prop.getFirstChildByKind(SyntaxKind.Identifier)!.getText()\n\t\t\tconst valueNode = prop.getLastChild()!\n\t\t\treturn {\n\t\t\t\trole: 'property' as const,\n\t\t\t\tidentifier,\n\t\t\t\tshape: isZodCallExpression(valueNode)\n\t\t\t\t\t? getZodCallShape(valueNode)\n\t\t\t\t\t: getValidatorPropertyShape(valueNode),\n\t\t\t\toptional: false,\n\t\t\t}\n\t\t})\n\t}\n\n\tif (typeName === 'ZodArray') {\n\t\tconst argNode = callExpression.getFirstChildByKind(SyntaxKind.SyntaxList)?.getFirstChild()\n\t\tif (!argNode) {\n\t\t\treturn 'unknown_zod_array'\n\t\t}\n\t\tconst elementShape = isZodCallExpression(argNode)\n\t\t\t? getZodCallShape(argNode)\n\t\t\t: getValidatorPropertyShape(argNode)\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: elementShape,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown zod type: ${typeName}`)\n\treturn 'unknown_zod'\n}\n\nexport const getValidatorPropertyShape = (innerLiteralNode: Node): ShapeOfType['shape'] => {\n\t// Zod validator (e.g. z.number(), z.string(), z.object({...}), z.array(...))\n\tif (isZodCallExpression(innerLiteralNode)) {\n\t\treturn getZodCallShape(innerLiteralNode)\n\t}\n\n\t// Inline definition with `as Validator<...>` clause\n\tconst inlineValidatorAsExpression = innerLiteralNode\n\t\t.getParent()!\n\t\t.getFirstChildByKind(SyntaxKind.AsExpression)\n\tif (inlineValidatorAsExpression) {\n\t\tconst typeReference = inlineValidatorAsExpression.getLastChildByKind(SyntaxKind.TypeReference)!\n\t\treturn getTypeReferenceShape(typeReference)\n\t}\n\n\t// Variable with `: Validator<...>` clause\n\tconst childTypeReferenceNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.TypeReference)\n\tif (childTypeReferenceNode) {\n\t\treturn getTypeReferenceShape(childTypeReferenceNode)\n\t}\n\n\t// `RequiredParam<...>` inline call expression\n\tif (innerLiteralNode.getParent()!.getChildrenOfKind(SyntaxKind.SyntaxList).length >= 2) {\n\t\tconst typeNode = innerLiteralNode\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getFirstChild()!\n\t\treturn getRecursiveNodeShape(typeNode)\n\t}\n\n\t// `RequestParam | RequiredParam | OptionalParam` call expression\n\tconst childCallExpressionNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.CallExpression)\n\tif (childCallExpressionNode) {\n\t\tconst callExpressionArgument = findNodeImplementation(\n\t\t\tchildCallExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!.getFirstChild()!,\n\t\t)\n\n\t\t// Param is a type reference\n\t\tconst typeReferenceNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.TypeReference)!\n\t\tif (typeReferenceNode) {\n\t\t\treturn getProperTypeShape(typeReferenceNode.getType(), typeReferenceNode, [])\n\t\t}\n\n\t\tconst thingyNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.ObjectLiteralExpression)!\n\t\tif (thingyNode) {\n\t\t\treturn getValidatorPropertyShape(thingyNode)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.CallExpression) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.IntersectionType) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\t\tLogger.warn(`[${fileName}] Unknown call expression argument: ${callExpressionArgument.getKindName()}`)\n\t\treturn 'unknown_3'\n\t}\n\n\t// Attempting to infer type from `parse` function\n\tconst innerNodePropertyAssignments = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t.getChildrenOfKind(SyntaxKind.PropertyAssignment)\n\tconst parsePropertyAssignment = innerNodePropertyAssignments.find((prop) => {\n\t\treturn prop.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'parse'\n\t})\n\tif (parsePropertyAssignment) {\n\t\tconst returnType = findPropertyAssignmentValueNode(parsePropertyAssignment)\n\t\t\t.asKind(SyntaxKind.ArrowFunction)!\n\t\t\t.getReturnType()\n\t\treturn getProperTypeShape(returnType, parsePropertyAssignment)\n\t}\n\n\t// Import statement\n\tconst importTypeNode = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)\n\t\t?.getFirstChildByKind(SyntaxKind.ImportType)\n\tif (importTypeNode) {\n\t\tconst indexOfGreaterThanToken = importTypeNode\n\t\t\t.getLastChildByKind(SyntaxKind.GreaterThanToken)!\n\t\t\t.getChildIndex()\n\t\tconst targetSyntaxList = importTypeNode.getChildAtIndex(indexOfGreaterThanToken - 1)\n\t\treturn getRecursiveNodeShape(targetSyntaxList.getFirstChild()!)\n\t}\n\n\t// Intersection type with Validator\n\tconst intersectionType = innerLiteralNode.isKind(SyntaxKind.IntersectionType)\n\t\t? innerLiteralNode\n\t\t: innerLiteralNode.getParent()?.isKind(SyntaxKind.VariableDeclaration)\n\t\t\t? innerLiteralNode.getParent()?.getFirstChildByKind(SyntaxKind.IntersectionType)\n\t\t\t: null\n\n\tif (intersectionType) {\n\t\tconst validatorType = intersectionType.getFirstChildByKind(SyntaxKind.TypeReference)\n\t\tif (validatorType) {\n\t\t\treturn getTypeReferenceShape(validatorType)\n\t\t}\n\t}\n\n\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown import type node`)\n\n\treturn 'unknown_2'\n}\n\nexport const getValidatorPropertyOptionality = (node: Node): boolean => {\n\tif (isZodCallExpression(node)) {\n\t\treturn false\n\t}\n\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst identifierNode = callExpressionNode.getFirstChildByKind(SyntaxKind.Identifier)\n\t\tif (identifierNode?.getText() === 'OptionalParam') {\n\t\t\treturn true\n\t\t} else if (identifierNode?.getText() === 'RequiredParam') {\n\t\t\treturn false\n\t\t}\n\n\t\tconst syntaxListNode = callExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\tconst literalExpression = findNodeImplementation(syntaxListNode.getFirstChild()!)\n\t\treturn getValidatorPropertyOptionality(literalExpression)\n\t}\n\n\tconst syntaxListNode = node.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\treturn assignmentNodes.some((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tif (identifierName === 'optional') {\n\t\t\tconst value = findPropertyAssignmentValueNode(node)\n\t\t\treturn value.getKind() === SyntaxKind.TrueKeyword\n\t\t}\n\t\treturn false\n\t})\n}\n\nexport const getValidatorPropertyStringValue = (\n\tnodeOrReference: Node,\n\tname: 'description' | 'errorMessage',\n): string => {\n\tif (isZodCallExpression(nodeOrReference)) {\n\t\treturn ''\n\t}\n\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst targetChild = callExpressionNode.getLastChildByKind(SyntaxKind.SyntaxList)!\n\t\treturn getValidatorPropertyStringValue(targetChild, name)\n\t}\n\n\tconst syntaxListNode = node.asKind(SyntaxKind.SyntaxList)\n\tif (syntaxListNode) {\n\t\tconst children = syntaxListNode.getChildren().map((c) => getValidatorPropertyStringValue(c, name))\n\t\treturn children.find((value) => !!value && value !== 'unknown_25') || ''\n\t}\n\n\tconst objectLiteralNode = node.asKind(SyntaxKind.ObjectLiteralExpression)\n\tif (objectLiteralNode) {\n\t\tconst values = getValuesOfObjectLiteral(objectLiteralNode)\n\t\tconst targetValue = values.find((value) => value.identifier === name)\n\t\tif (!targetValue) {\n\t\t\treturn ''\n\t\t}\n\t\tif (Array.isArray(targetValue.value)) {\n\t\t\treturn 'array'\n\t\t}\n\t\treturn targetValue.value || ''\n\t}\n\n\tconst intersectionTypeNode = node.asKind(SyntaxKind.IntersectionType)\n\tif (intersectionTypeNode) {\n\t\treturn (\n\t\t\tintersectionTypeNode\n\t\t\t\t.getTypeNodes()\n\t\t\t\t.flatMap((t) => getValidatorPropertyStringValue(t, name))\n\t\t\t\t.filter((v) => !!v && v !== 'unknown_25')[0] || 'unknown_27'\n\t\t)\n\t}\n\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\treturn getValidatorPropertyStringValue(typeLiteralNode.getFirstChildByKind(SyntaxKind.SyntaxList)!, name)\n\t}\n\n\tconst propertySignatureNode = node.asKind(SyntaxKind.PropertySignature)\n\tif (propertySignatureNode) {\n\t\tconst identifier = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tif (identifier.getText() === name) {\n\t\t\tconst targetNode = findPropertyAssignmentValueNode(propertySignatureNode).getFirstDescendantByKind(\n\t\t\t\tSyntaxKind.StringLiteral,\n\t\t\t)!\n\t\t\treturn targetNode.getLiteralText()\n\t\t}\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown property string value node ${node.getKindName()}`)\n\treturn 'unknown_25'\n}\n\nconst isPromise = (type: Type) => {\n\tconst symbol = type.getSymbol()\n\tif (!type.isObject() || !symbol) {\n\t\treturn false\n\t}\n\tconst args = type.getTypeArguments()\n\treturn symbol.getName() === 'Promise' && args.length === 1\n}\n\nexport const getProperTypeShape = (\n\ttypeOrPromise: Type,\n\tatLocation: Node,\n\tstack: Type[] = [],\n): ShapeOfType['shape'] => {\n\tconst typeName = typeOrPromise.getAliasSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst type = isPromise(typeOrPromise) ? typeOrPromise.getTypeArguments()[0] : typeOrPromise\n\n\tif (stack.some((previousType) => previousType === type)) {\n\t\treturn 'circular'\n\t}\n\n\tconst nextStack = stack.concat(type)\n\n\tif (type.getText() === 'void') {\n\t\treturn 'void'\n\t}\n\n\tif (type.isAny()) {\n\t\treturn 'any'\n\t}\n\n\tif (type.isUnknown()) {\n\t\treturn 'unknown'\n\t}\n\n\tif (type.isNull()) {\n\t\treturn 'null'\n\t}\n\n\tif (type.isUndefined()) {\n\t\treturn 'undefined'\n\t}\n\n\tif (type.isBoolean() || type.isBooleanLiteral()) {\n\t\treturn 'boolean'\n\t}\n\n\tif (type.isStringLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_string' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isNumberLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_number' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isString() || type.isTemplateLiteral()) {\n\t\treturn 'string'\n\t}\n\n\tif (type.isNumber()) {\n\t\treturn 'number'\n\t}\n\n\tif (type.getText() === 'bigint') {\n\t\treturn 'bigint'\n\t}\n\n\tif (type.isTuple()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'tuple' as const,\n\t\t\t\tshape: type.getTupleElements().map((t) => ({\n\t\t\t\t\trole: 'tuple_entry' as const,\n\t\t\t\t\tshape: getProperTypeShape(t, atLocation, nextStack),\n\t\t\t\t\toptional: false,\n\t\t\t\t})),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isArray()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: getProperTypeShape(type.getArrayElementType()!, atLocation, nextStack),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst typeSymbolName = type.getSymbol()?.getName()\n\tif (type.isObject() && (typeSymbolName === 'Buffer' || typeSymbolName === 'Uint8Array')) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'buffer' as const,\n\t\t\t\tshape: 'buffer',\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && type.getProperties().length === 0) {\n\t\tconst targetType = type.getAliasTypeArguments()[1] ?? type.getStringIndexType()\n\t\tif (targetType) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\trole: 'record' as const,\n\t\t\t\t\tshape: getProperTypeShape(targetType, atLocation, nextStack),\n\t\t\t\t\toptional: false,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t}\n\n\tif (type.isObject()) {\n\t\tif (type.getText() === 'Date') {\n\t\t\treturn 'Date'\n\t\t}\n\t\treturn type\n\t\t\t.getProperties()\n\t\t\t.map((prop) => {\n\t\t\t\tconst valueDeclaration = prop.getValueDeclaration() || prop.getDeclarations()[0]!\n\t\t\t\tif (!valueDeclaration) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst valueDeclarationNode =\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertySignature) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertyAssignment) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.ShorthandPropertyAssignment)\n\n\t\t\t\tif (!valueDeclarationNode) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst isOptional = prop.getTypeAtLocation(atLocation).isNullable()\n\n\t\t\t\tconst shape = getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack)\n\t\t\t\treturn {\n\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\tshape: shape,\n\t\t\t\t\toptional: isOptional,\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((val) => val.shape !== 'undefined')\n\t}\n\n\tif (type.isUnion()) {\n\t\tconst unfilteredShapes: ShapeOfUnionEntry[] = type.getUnionTypes().map((type) => ({\n\t\t\trole: 'union_entry',\n\t\t\tshape: getProperTypeShape(type, atLocation, nextStack),\n\t\t\toptional: false,\n\t\t}))\n\n\t\tconst dedupedShapes = unfilteredShapes.filter(\n\t\t\t(type, index, arr) => !arr.find((dup, dupIndex) => dup.shape === type.shape && dupIndex > index),\n\t\t)\n\t\tconst isNullable = dedupedShapes.some((shape) => shape.shape === 'undefined')\n\t\tconst shapes = dedupedShapes.filter((shape) => shape.shape !== 'undefined')\n\t\tif (shapes.length === 1) {\n\t\t\treturn shapes[0].shape\n\t\t}\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'union',\n\t\t\t\tshape: shapes,\n\t\t\t\toptional: isNullable,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isIntersection()) {\n\t\tconst children = type.getIntersectionTypes()\n\t\tconst shapesOfChildren = children\n\t\t\t.map((child) => getProperTypeShape(child, atLocation, nextStack))\n\t\t\t.filter((shape) => typeof shape !== 'string') as ShapeOfProperty[][]\n\t\treturn shapesOfChildren.reduce<ShapeOfType[]>((total, current) => [...total, ...current], [])\n\t}\n\n\tconst fileName = atLocation.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown type shape node ${typeOrPromise.getText()}`)\n\treturn 'unknown_5'\n}\n\nconst getLiteralValueOfNode = (node: Node): string | string[] | unknown[] => {\n\tif (node.isKind(SyntaxKind.Identifier)) {\n\t\treturn getLiteralValueOfNode(findNodeImplementation(node))\n\t} else if (node.isKind(SyntaxKind.StringLiteral)) {\n\t\treturn node.getLiteralValue()\n\t} else if (node.isKind(SyntaxKind.ArrayLiteralExpression)) {\n\t\treturn node.forEachChildAsArray().map((child) => getLiteralValueOfNode(child)) as string[]\n\t} else if (node.isKind(SyntaxKind.PropertyAccessExpression)) {\n\t\treturn getLiteralValueOfNode(findPropertyAssignmentValueNode(node))\n\t} else if (node.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\treturn getValuesOfObjectLiteral(node)\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown literal value node ${node.getKindName()}`)\n\n\treturn 'unknown_6'\n}\n\nexport const resolveEndpointPath = (node: Node): string | null => {\n\tconst callExpression = node.getFirstDescendantByKind(SyntaxKind.CallExpression)\n\tif (!callExpression) return null\n\n\tconst firstArg = callExpression.getArguments()[0]\n\tif (!firstArg) return null\n\n\tconst argType = firstArg.getType()\n\tif (argType.isStringLiteral()) {\n\t\treturn argType.getLiteralValue() as string\n\t}\n\n\treturn null\n}\n\nexport const getValuesOfObjectLiteral = (objectLiteralNode: Node<ts.ObjectLiteralExpression>) => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst targetNode = findNodeImplementation(assignmentValueNode)\n\t\tconst value = getLiteralValueOfNode(targetNode)\n\n\t\treturn {\n\t\t\tidentifier: identifierName,\n\t\t\tvalue,\n\t\t}\n\t})\n\n\treturn properties || []\n}\n"],"names":["implementationCache","findNodeImplementation","node","cached","SyntaxKind","implementationNode","assignmentValueNode","result","definitionNode","findPropertyAssignmentValueNode","identifierChildren","child","getTypeReferenceShape","firstChild","getRecursiveNodeShape","nodeOrReference","typeName","OpenApiManager","literalNode","typeLiteralNode","propNode","identifier","valueNode","questionMarkToken","typeReferenceNode","lastChild","getProperTypeShape","unionTypeNode","typeQueryNode","qualifiedNameNode","callExpressionNode","awaitExpressionNode","asExpressionNode","fileName","Logger","getShapeOfValidatorLiteral","objectLiteralNode","identifierNode","identifierName","innerLiteralNode","getValidatorPropertyShape","getValidatorPropertyOptionality","getValidatorPropertyStringValue","isZodCallExpression","callExpression","getZodCallShape","objectLiteral","syntaxList","prop","argNode","inlineValidatorAsExpression","typeReference","childTypeReferenceNode","typeNode","childCallExpressionNode","callExpressionArgument","thingyNode","parsePropertyAssignment","returnType","importTypeNode","indexOfGreaterThanToken","targetSyntaxList","intersectionType","validatorType","syntaxListNode","literalExpression","name","targetChild","c","value","targetValue","getValuesOfObjectLiteral","intersectionTypeNode","t","v","propertySignatureNode","isPromise","type","symbol","args","typeOrPromise","atLocation","stack","previousType","nextStack","typeSymbolName","targetType","valueDeclaration","isOptional","shape","val","dedupedShapes","index","arr","dup","dupIndex","isNullable","shapes","total","current","getLiteralValueOfNode","resolveEndpointPath","firstArg","argType","targetNode"],"mappings":"2LAgBMA,MAA0B,QAEnBC,EAA0BC,GAAqB,CACrD,MAAAC,EAASH,EAAoB,IAAIE,CAAI,EAC3C,GAAIC,EACI,OAAAA,EAGR,GAAID,EAAK,YAAcE,EAAAA,WAAW,WAAY,CACvC,MAAAC,EAAqBH,EAAK,OAAOE,EAAW,WAAA,UAA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,EAA4BnC,GACjBA,EAAkB,yBAAyBhC,EAAAA,WAAW,UAAU,EAChD,kBAAkBA,EAAAA,WAAW,kBAAkB,EAEnD,IAAKF,GAAS,CAE1C,MAAAoC,EADiBpC,EAAK,yBAAyBE,EAAAA,WAAW,UAAU,EACpC,QAAQ,EAExCE,EAAsBJ,EAAK,aAAa,EACxCsG,EAAavG,EAAuBK,CAAmB,EACvD+D,EAAQ+B,EAAsBI,CAAU,EAEvC,MAAA,CACN,WAAYlE,EACZ,MAAA+B,CACD,CAAA,CACA,GAEoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"nodeParsers.cjs","sources":["../../../src/openapi/analyzerModule/nodeParsers.ts"],"sourcesContent":["import {\n\tNode,\n\tPropertyAccessExpression,\n\tPropertyAssignment,\n\tPropertySignature,\n\tShorthandPropertyAssignment,\n\tSyntaxKind,\n\tts,\n\tType,\n\tTypeReferenceNode,\n} from 'ts-morph'\n\nimport { Logger } from '../../utils/logger'\nimport { OpenApiManager } from '../manager/OpenApiManager'\nimport { ShapeOfProperty, ShapeOfType, ShapeOfUnionEntry } from './types'\n\nconst implementationCache = new WeakMap<Node, Node>()\n\nexport const findNodeImplementation = (node: Node): Node => {\n\tconst cached = implementationCache.get(node)\n\tif (cached) {\n\t\treturn cached\n\t}\n\n\tif (node.getKind() === SyntaxKind.Identifier) {\n\t\tconst implementationNode = node.asKind(SyntaxKind.Identifier)!.getImplementations()[0]?.getNode()\n\t\tif (implementationNode) {\n\t\t\tconst implementationParentNode = implementationNode.getParent()!\n\t\t\tconst assignmentValueNode = implementationParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\n\t\tconst definitionNode = node.asKind(SyntaxKind.Identifier)!.getDefinitions()[0]?.getNode()\n\t\tif (definitionNode) {\n\t\t\tconst definitionParentNode = definitionNode.getParent()!\n\t\t\tconst assignmentValueNode = definitionParentNode.getLastChild()!\n\t\t\tif (assignmentValueNode === node) {\n\t\t\t\tthrow new Error('Recursive implementation found')\n\t\t\t}\n\t\t\tconst result = findNodeImplementation(assignmentValueNode)\n\t\t\timplementationCache.set(node, result)\n\t\t\treturn result\n\t\t}\n\t\tthrow new Error('No implementation nor definition available')\n\t}\n\n\timplementationCache.set(node, node)\n\treturn node\n}\n\nexport const findPropertyAssignmentValueNode = (\n\tnode:\n\t\t| PropertyAssignment\n\t\t| TypeReferenceNode\n\t\t| PropertySignature\n\t\t| PropertyAccessExpression\n\t\t| ShorthandPropertyAssignment,\n): Node => {\n\tconst identifierChildren = node.getChildrenOfKind(SyntaxKind.Identifier)\n\tif (identifierChildren.length === 2) {\n\t\treturn findNodeImplementation(identifierChildren[1])\n\t}\n\tconst lastMatchingChild = node.getChildren().reverse()\n\treturn lastMatchingChild.find(\n\t\t(child) =>\n\t\t\tchild.getKind() !== SyntaxKind.GreaterThanToken &&\n\t\t\tchild.getKind() !== SyntaxKind.CommaToken &&\n\t\t\tchild.getKind() !== SyntaxKind.SemicolonToken,\n\t)!\n}\n\nexport const getTypeReferenceShape = (node: TypeReferenceNode): ShapeOfType['shape'] => {\n\tconst firstChild = node.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\tif (firstChild.isKind(SyntaxKind.SyntaxList)) {\n\t\treturn getRecursiveNodeShape(firstChild.getFirstChild()!)\n\t} else {\n\t\treturn getRecursiveNodeShape(firstChild)\n\t}\n}\n\nexport const getRecursiveNodeShape = (nodeOrReference: Node): ShapeOfType['shape'] => {\n\tconst typeName = nodeOrReference.getSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\t// Undefined\n\tconst undefinedNode = node.asKind(SyntaxKind.UndefinedKeyword)\n\tif (undefinedNode) {\n\t\treturn 'undefined'\n\t}\n\n\t// Literal type\n\tconst literalNode = node.asKind(SyntaxKind.LiteralType)\n\tif (literalNode) {\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.TrueKeyword)) {\n\t\t\treturn 'true'\n\t\t}\n\t\tif (literalNode.getFirstChildByKind(SyntaxKind.FalseKeyword)) {\n\t\t\treturn 'false'\n\t\t}\n\t}\n\n\t// Boolean literal\n\tconst booleanLiteralNode =\n\t\tnode.asKind(SyntaxKind.BooleanKeyword) ||\n\t\tnode.asKind(SyntaxKind.TrueKeyword) ||\n\t\tnode.asKind(SyntaxKind.FalseKeyword)\n\tif (booleanLiteralNode) {\n\t\treturn 'boolean'\n\t}\n\n\t// String literal\n\tconst stringLiteralNode = node.asKind(SyntaxKind.StringKeyword) || node.asKind(SyntaxKind.StringLiteral)\n\tif (stringLiteralNode) {\n\t\treturn 'string'\n\t}\n\n\t// Number literal\n\tconst numberLiteralNode = node.asKind(SyntaxKind.NumberKeyword) || node.asKind(SyntaxKind.NumericLiteral)\n\tif (numberLiteralNode) {\n\t\treturn 'number'\n\t}\n\n\t// BigInt literal\n\tconst bigIntNode = node.asKind(SyntaxKind.BigIntKeyword) || node.asKind(SyntaxKind.BigIntLiteral)\n\tif (bigIntNode) {\n\t\treturn 'bigint'\n\t}\n\n\t// Type literal\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\tconst properties = typeLiteralNode\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getChildrenOfKind(SyntaxKind.PropertySignature)\n\n\t\tconst propertyShapes = properties.map((propNode) => {\n\t\t\tconst identifier = propNode.getFirstChildByKind(SyntaxKind.Identifier)!\n\t\t\tconst valueNode = findPropertyAssignmentValueNode(propNode)\n\t\t\tconst questionMarkToken = identifier.getNextSiblingIfKind(SyntaxKind.QuestionToken)\n\t\t\treturn {\n\t\t\t\trole: 'property' as const,\n\t\t\t\tidentifier: identifier.getText(),\n\t\t\t\tshape: getRecursiveNodeShape(valueNode),\n\t\t\t\toptional: valueNode.getType().isNullable() || !!questionMarkToken,\n\t\t\t}\n\t\t})\n\t\treturn propertyShapes\n\t}\n\n\t// Type reference\n\tconst typeReferenceNode = node.asKind(SyntaxKind.TypeReference)\n\tif (typeReferenceNode) {\n\t\treturn getRecursiveNodeShape(typeReferenceNode.getFirstChild()!)\n\t}\n\n\t// Property access expression\n\tconst propertyAccessNode = node.asKind(SyntaxKind.PropertyAccessExpression)\n\tif (propertyAccessNode) {\n\t\tconst lastChild = findNodeImplementation(node.getLastChild()!)\n\t\treturn getProperTypeShape(lastChild.asKind(SyntaxKind.CallExpression)!.getReturnType(), lastChild)\n\t}\n\n\t// Union type\n\tconst unionTypeNode = node.asKind(SyntaxKind.UnionType)\n\tif (unionTypeNode) {\n\t\treturn getProperTypeShape(unionTypeNode.getType(), node)\n\t}\n\n\t// Typeof query\n\tconst typeQueryNode = node.asKind(SyntaxKind.TypeQuery)\n\tif (typeQueryNode) {\n\t\treturn getRecursiveNodeShape(typeQueryNode.getLastChild()!)\n\t}\n\n\t// Qualified name\n\tconst qualifiedNameNode = node.asKind(SyntaxKind.QualifiedName)\n\tif (qualifiedNameNode) {\n\t\treturn getRecursiveNodeShape(qualifiedNameNode.getLastChild()!)\n\t}\n\n\t// Call expression\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\treturn getProperTypeShape(callExpressionNode.getReturnType(), callExpressionNode)\n\t}\n\n\t// Await expression\n\tconst awaitExpressionNode = node.asKind(SyntaxKind.AwaitExpression)\n\tif (awaitExpressionNode) {\n\t\treturn getRecursiveNodeShape(awaitExpressionNode.getChildAtIndex(1)!)\n\t}\n\n\t// 'As' Expression\n\tconst asExpressionNode = node.asKind(SyntaxKind.AsExpression)\n\tif (asExpressionNode) {\n\t\treturn getRecursiveNodeShape(asExpressionNode.getChildAtIndex(2)!)\n\t}\n\n\t// TODO\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown node type: ${node.getKindName()}`)\n\treturn 'unknown_1'\n}\n\nexport const getShapeOfValidatorLiteral = (\n\tobjectLiteralNode: Node<ts.ObjectLiteralExpression>,\n): (ShapeOfProperty & { description: string; errorMessage: string })[] => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstChild()!\n\t\tconst identifierName = (() => {\n\t\t\tif (identifierNode.isKind(SyntaxKind.Identifier)) {\n\t\t\t\treturn identifierNode.getText()\n\t\t\t}\n\t\t\tif (identifierNode.isKind(SyntaxKind.StringLiteral)) {\n\t\t\t\treturn identifierNode.getLiteralText()\n\t\t\t}\n\t\t\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\t\t\tLogger.warn(`[${fileName}] Unknown identifier name: ${identifierNode.getText()}`)\n\t\t\treturn 'unknown_30'\n\t\t})()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst innerLiteralNode = findNodeImplementation(assignmentValueNode)\n\n\t\treturn {\n\t\t\trole: 'property' as const,\n\t\t\tidentifier: identifierName,\n\t\t\tshape: getValidatorPropertyShape(innerLiteralNode),\n\t\t\toptional: getValidatorPropertyOptionality(innerLiteralNode),\n\t\t\tdescription: getValidatorPropertyStringValue(innerLiteralNode, 'description'),\n\t\t\terrorMessage: getValidatorPropertyStringValue(innerLiteralNode, 'errorMessage'),\n\t\t}\n\t})\n\n\treturn properties || []\n}\n\nconst isZodCallExpression = (node: Node): boolean => {\n\tconst callExpression = node.asKind(SyntaxKind.CallExpression)\n\tif (!callExpression) {\n\t\treturn false\n\t}\n\tconst returnType = callExpression.getReturnType()\n\tconst typeName = returnType.getSymbol()?.getName() ?? ''\n\treturn typeName.startsWith('Zod')\n}\n\nconst getZodCallShape = (node: Node): ShapeOfType['shape'] => {\n\tconst callExpression = node.asKind(SyntaxKind.CallExpression)!\n\tconst returnType = callExpression.getReturnType()\n\tconst typeName = returnType.getSymbol()?.getName() ?? ''\n\n\tif (typeName === 'ZodNumber') {\n\t\treturn 'number'\n\t}\n\tif (typeName === 'ZodString') {\n\t\treturn 'string'\n\t}\n\tif (typeName === 'ZodBoolean') {\n\t\treturn 'boolean'\n\t}\n\tif (typeName === 'ZodBigInt') {\n\t\treturn 'bigint'\n\t}\n\n\tif (typeName === 'ZodObject') {\n\t\tconst argNode = callExpression.getFirstChildByKind(SyntaxKind.SyntaxList)?.getFirstChild()\n\t\tconst objectLiteral = argNode?.asKind(SyntaxKind.ObjectLiteralExpression)\n\t\tif (!objectLiteral) {\n\t\t\treturn 'unknown_zod_object'\n\t\t}\n\t\tconst syntaxList = objectLiteral.getFirstChildByKind(SyntaxKind.SyntaxList)\n\t\tif (!syntaxList) {\n\t\t\treturn []\n\t\t}\n\t\tconst properties = syntaxList.getChildrenOfKind(SyntaxKind.PropertyAssignment)\n\t\treturn properties.map((prop) => {\n\t\t\tconst identifier = prop.getFirstChildByKind(SyntaxKind.Identifier)!.getText()\n\t\t\tconst valueNode = prop.getLastChild()!\n\t\t\treturn {\n\t\t\t\trole: 'property' as const,\n\t\t\t\tidentifier,\n\t\t\t\tshape: isZodCallExpression(valueNode)\n\t\t\t\t\t? getZodCallShape(valueNode)\n\t\t\t\t\t: getValidatorPropertyShape(valueNode),\n\t\t\t\toptional: false,\n\t\t\t}\n\t\t})\n\t}\n\n\tif (typeName === 'ZodArray') {\n\t\tconst argNode = callExpression.getFirstChildByKind(SyntaxKind.SyntaxList)?.getFirstChild()\n\t\tif (!argNode) {\n\t\t\treturn 'unknown_zod_array'\n\t\t}\n\t\tconst elementShape = isZodCallExpression(argNode)\n\t\t\t? getZodCallShape(argNode)\n\t\t\t: getValidatorPropertyShape(argNode)\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: elementShape,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown zod type: ${typeName}`)\n\treturn 'unknown_zod'\n}\n\nexport const getValidatorPropertyShape = (innerLiteralNode: Node): ShapeOfType['shape'] => {\n\t// Zod validator (e.g. z.number(), z.string(), z.object({...}), z.array(...))\n\tif (isZodCallExpression(innerLiteralNode)) {\n\t\treturn getZodCallShape(innerLiteralNode)\n\t}\n\n\t// Inline definition with `as Validator<...>` clause\n\tconst inlineValidatorAsExpression = innerLiteralNode\n\t\t.getParent()!\n\t\t.getFirstChildByKind(SyntaxKind.AsExpression)\n\tif (inlineValidatorAsExpression) {\n\t\tconst typeReference = inlineValidatorAsExpression.getLastChildByKind(SyntaxKind.TypeReference)!\n\t\treturn getTypeReferenceShape(typeReference)\n\t}\n\n\t// Variable with `: Validator<...>` clause\n\tconst childTypeReferenceNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.TypeReference)\n\tif (childTypeReferenceNode) {\n\t\treturn getTypeReferenceShape(childTypeReferenceNode)\n\t}\n\n\t// `RequiredParam<...>` inline call expression\n\tif (innerLiteralNode.getParent()!.getChildrenOfKind(SyntaxKind.SyntaxList).length >= 2) {\n\t\tconst typeNode = innerLiteralNode\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t\t.getFirstChild()!\n\t\treturn getRecursiveNodeShape(typeNode)\n\t}\n\n\t// `RequestParam | RequiredParam | OptionalParam` call expression\n\tconst childCallExpressionNode = innerLiteralNode.getParent()!.getFirstChildByKind(SyntaxKind.CallExpression)\n\tif (childCallExpressionNode) {\n\t\tconst callExpressionArgument = findNodeImplementation(\n\t\t\tchildCallExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!.getFirstChild()!,\n\t\t)\n\n\t\t// Param is a type reference\n\t\tconst typeReferenceNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.TypeReference)!\n\t\tif (typeReferenceNode) {\n\t\t\treturn getProperTypeShape(typeReferenceNode.getType(), typeReferenceNode, [])\n\t\t}\n\n\t\tconst thingyNode = callExpressionArgument\n\t\t\t.getParent()!\n\t\t\t.getFirstChildByKind(SyntaxKind.ObjectLiteralExpression)!\n\t\tif (thingyNode) {\n\t\t\treturn getValidatorPropertyShape(thingyNode)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.CallExpression) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tif (callExpressionArgument.getKind() === SyntaxKind.IntersectionType) {\n\t\t\treturn getValidatorPropertyShape(callExpressionArgument)\n\t\t}\n\n\t\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\t\tLogger.warn(`[${fileName}] Unknown call expression argument: ${callExpressionArgument.getKindName()}`)\n\t\treturn 'unknown_3'\n\t}\n\n\t// Attempting to infer type from `parse` function\n\tconst innerNodePropertyAssignments = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\t.getChildrenOfKind(SyntaxKind.PropertyAssignment)\n\tconst parsePropertyAssignment = innerNodePropertyAssignments.find((prop) => {\n\t\treturn prop.getFirstChildByKind(SyntaxKind.Identifier)?.getText() === 'parse'\n\t})\n\tif (parsePropertyAssignment) {\n\t\tconst returnType = findPropertyAssignmentValueNode(parsePropertyAssignment)\n\t\t\t.asKind(SyntaxKind.ArrowFunction)!\n\t\t\t.getReturnType()\n\t\treturn getProperTypeShape(returnType, parsePropertyAssignment)\n\t}\n\n\t// Import statement\n\tconst importTypeNode = innerLiteralNode\n\t\t.getFirstChildByKind(SyntaxKind.SyntaxList)\n\t\t?.getFirstChildByKind(SyntaxKind.ImportType)\n\tif (importTypeNode) {\n\t\tconst indexOfGreaterThanToken = importTypeNode\n\t\t\t.getLastChildByKind(SyntaxKind.GreaterThanToken)!\n\t\t\t.getChildIndex()\n\t\tconst targetSyntaxList = importTypeNode.getChildAtIndex(indexOfGreaterThanToken - 1)\n\t\treturn getRecursiveNodeShape(targetSyntaxList.getFirstChild()!)\n\t}\n\n\t// Intersection type with Validator\n\tconst intersectionType = innerLiteralNode.isKind(SyntaxKind.IntersectionType)\n\t\t? innerLiteralNode\n\t\t: innerLiteralNode.getParent()?.isKind(SyntaxKind.VariableDeclaration)\n\t\t\t? innerLiteralNode.getParent()?.getFirstChildByKind(SyntaxKind.IntersectionType)\n\t\t\t: null\n\n\tif (intersectionType) {\n\t\tconst validatorType = intersectionType.getFirstChildByKind(SyntaxKind.TypeReference)\n\t\tif (validatorType) {\n\t\t\treturn getTypeReferenceShape(validatorType)\n\t\t}\n\t}\n\n\tconst fileName = innerLiteralNode.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown import type node`)\n\n\treturn 'unknown_2'\n}\n\nexport const getValidatorPropertyOptionality = (node: Node): boolean => {\n\tif (isZodCallExpression(node)) {\n\t\treturn false\n\t}\n\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst identifierNode = callExpressionNode.getFirstChildByKind(SyntaxKind.Identifier)\n\t\tif (identifierNode?.getText() === 'OptionalParam') {\n\t\t\treturn true\n\t\t} else if (identifierNode?.getText() === 'RequiredParam') {\n\t\t\treturn false\n\t\t}\n\n\t\tconst syntaxListNode = callExpressionNode.getFirstChildByKind(SyntaxKind.SyntaxList)!\n\t\tconst literalExpression = findNodeImplementation(syntaxListNode.getFirstChild()!)\n\t\treturn getValidatorPropertyOptionality(literalExpression)\n\t}\n\n\tconst syntaxListNode = node.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\treturn assignmentNodes.some((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tif (identifierName === 'optional') {\n\t\t\tconst value = findPropertyAssignmentValueNode(node)\n\t\t\treturn value.getKind() === SyntaxKind.TrueKeyword\n\t\t}\n\t\treturn false\n\t})\n}\n\nexport const getValidatorPropertyStringValue = (\n\tnodeOrReference: Node,\n\tname: 'description' | 'errorMessage',\n): string => {\n\tif (isZodCallExpression(nodeOrReference)) {\n\t\treturn ''\n\t}\n\n\tconst node = findNodeImplementation(nodeOrReference)\n\n\tconst callExpressionNode = node.asKind(SyntaxKind.CallExpression)\n\tif (callExpressionNode) {\n\t\tconst targetChild = callExpressionNode.getLastChildByKind(SyntaxKind.SyntaxList)!\n\t\treturn getValidatorPropertyStringValue(targetChild, name)\n\t}\n\n\tconst syntaxListNode = node.asKind(SyntaxKind.SyntaxList)\n\tif (syntaxListNode) {\n\t\tconst children = syntaxListNode.getChildren().map((c) => getValidatorPropertyStringValue(c, name))\n\t\treturn children.find((value) => !!value && value !== 'unknown_25') || ''\n\t}\n\n\tconst objectLiteralNode = node.asKind(SyntaxKind.ObjectLiteralExpression)\n\tif (objectLiteralNode) {\n\t\tconst values = getValuesOfObjectLiteral(objectLiteralNode)\n\t\tconst targetValue = values.find((value) => value.identifier === name)\n\t\tif (!targetValue) {\n\t\t\treturn ''\n\t\t}\n\t\tif (Array.isArray(targetValue.value)) {\n\t\t\treturn 'array'\n\t\t}\n\t\treturn targetValue.value || ''\n\t}\n\n\tconst intersectionTypeNode = node.asKind(SyntaxKind.IntersectionType)\n\tif (intersectionTypeNode) {\n\t\treturn (\n\t\t\tintersectionTypeNode\n\t\t\t\t.getTypeNodes()\n\t\t\t\t.flatMap((t) => getValidatorPropertyStringValue(t, name))\n\t\t\t\t.filter((v) => !!v && v !== 'unknown_25')[0] || 'unknown_27'\n\t\t)\n\t}\n\n\tconst typeLiteralNode = node.asKind(SyntaxKind.TypeLiteral)\n\tif (typeLiteralNode) {\n\t\treturn getValidatorPropertyStringValue(typeLiteralNode.getFirstChildByKind(SyntaxKind.SyntaxList)!, name)\n\t}\n\n\tconst propertySignatureNode = node.asKind(SyntaxKind.PropertySignature)\n\tif (propertySignatureNode) {\n\t\tconst identifier = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tif (identifier.getText() === name) {\n\t\t\tconst targetNode = findPropertyAssignmentValueNode(propertySignatureNode).getFirstDescendantByKind(\n\t\t\t\tSyntaxKind.StringLiteral,\n\t\t\t)!\n\t\t\treturn targetNode.getLiteralText()\n\t\t}\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown property string value node ${node.getKindName()}`)\n\treturn 'unknown_25'\n}\n\nconst isPromise = (type: Type) => {\n\tconst symbol = type.getSymbol()\n\tif (!type.isObject() || !symbol) {\n\t\treturn false\n\t}\n\tconst args = type.getTypeArguments()\n\treturn symbol.getName() === 'Promise' && args.length === 1\n}\n\nexport const getProperTypeShape = (\n\ttypeOrPromise: Type,\n\tatLocation: Node,\n\tstack: Type[] = [],\n): ShapeOfType['shape'] => {\n\tconst typeName = typeOrPromise.getAliasSymbol()?.getName()\n\tif (typeName && OpenApiManager.getInstance().hasExposedModel(typeName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'ref',\n\t\t\t\tshape: typeName,\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst type = isPromise(typeOrPromise) ? typeOrPromise.getTypeArguments()[0] : typeOrPromise\n\n\tif (stack.some((previousType) => previousType === type)) {\n\t\treturn 'circular'\n\t}\n\n\tconst nextStack = stack.concat(type)\n\n\tif (type.getText() === 'void') {\n\t\treturn 'void'\n\t}\n\n\tif (type.isAny()) {\n\t\treturn 'any'\n\t}\n\n\tif (type.isUnknown()) {\n\t\treturn 'unknown'\n\t}\n\n\tif (type.isNull()) {\n\t\treturn 'null'\n\t}\n\n\tif (type.isUndefined()) {\n\t\treturn 'undefined'\n\t}\n\n\tif (type.isBoolean() || type.isBooleanLiteral()) {\n\t\treturn 'boolean'\n\t}\n\n\tif (type.isStringLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_string' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isNumberLiteral()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'literal_number' as const,\n\t\t\t\tshape: String(type.getLiteralValue()!),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isString() || type.isTemplateLiteral()) {\n\t\treturn 'string'\n\t}\n\n\tif (type.isNumber()) {\n\t\treturn 'number'\n\t}\n\n\tif (type.getText() === 'bigint') {\n\t\treturn 'bigint'\n\t}\n\n\tif (type.isTuple()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'tuple' as const,\n\t\t\t\tshape: type.getTupleElements().map((t) => ({\n\t\t\t\t\trole: 'tuple_entry' as const,\n\t\t\t\t\tshape: getProperTypeShape(t, atLocation, nextStack),\n\t\t\t\t\toptional: false,\n\t\t\t\t})),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isArray()) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: getProperTypeShape(type.getArrayElementType()!, atLocation, nextStack),\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tconst typeSymbolName = type.getSymbol()?.getName()\n\n\tconst bufferLikeTypes = new Set([\n\t\t'Buffer',\n\t\t'Uint8Array',\n\t\t'Int8Array',\n\t\t'Uint8ClampedArray',\n\t\t'Int16Array',\n\t\t'Uint16Array',\n\t\t'Int32Array',\n\t\t'Uint32Array',\n\t\t'Float32Array',\n\t\t'Float64Array',\n\t\t'BigInt64Array',\n\t\t'BigUint64Array',\n\t\t'ArrayBuffer',\n\t\t'SharedArrayBuffer',\n\t\t'ReadableStream',\n\t])\n\n\tif (type.isObject() && typeSymbolName && bufferLikeTypes.has(typeSymbolName)) {\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'buffer' as const,\n\t\t\t\tshape: 'buffer',\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && typeSymbolName === 'RegExp') {\n\t\treturn 'string'\n\t}\n\n\tif (type.isObject() && typeSymbolName === 'Map') {\n\t\tconst typeArgs = type.getTypeArguments()\n\t\tconst valueType = typeArgs[1]\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'record' as const,\n\t\t\t\tshape: valueType ? getProperTypeShape(valueType, atLocation, nextStack) : 'unknown',\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && typeSymbolName === 'Set') {\n\t\tconst typeArgs = type.getTypeArguments()\n\t\tconst elementType = typeArgs[0]\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'array' as const,\n\t\t\t\tshape: elementType ? getProperTypeShape(elementType, atLocation, nextStack) : 'unknown',\n\t\t\t\toptional: false,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isObject() && type.getProperties().length === 0) {\n\t\tconst targetType = type.getAliasTypeArguments()[1] ?? type.getStringIndexType()\n\t\tif (targetType) {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\trole: 'record' as const,\n\t\t\t\t\tshape: getProperTypeShape(targetType, atLocation, nextStack),\n\t\t\t\t\toptional: false,\n\t\t\t\t},\n\t\t\t]\n\t\t}\n\t}\n\n\tif (type.isObject()) {\n\t\tif (typeSymbolName === 'Date' || type.getText() === 'Date') {\n\t\t\treturn 'Date'\n\t\t}\n\t\treturn type\n\t\t\t.getProperties()\n\t\t\t.map((prop) => {\n\t\t\t\tconst valueDeclaration = prop.getValueDeclaration() || prop.getDeclarations()[0]!\n\t\t\t\tif (!valueDeclaration) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tconst valueDeclarationNode =\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertySignature) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.PropertyAssignment) ||\n\t\t\t\t\tvalueDeclaration.asKind(SyntaxKind.ShorthandPropertyAssignment)\n\n\t\t\t\tif (!valueDeclarationNode) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\t\tshape: getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack),\n\t\t\t\t\t\toptional: false,\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst isOptional = prop.getTypeAtLocation(atLocation).isNullable()\n\n\t\t\t\tconst shape = getProperTypeShape(prop.getTypeAtLocation(atLocation), atLocation, nextStack)\n\t\t\t\treturn {\n\t\t\t\t\trole: 'property' as const,\n\t\t\t\t\tidentifier: prop.getName(),\n\t\t\t\t\tshape: shape,\n\t\t\t\t\toptional: isOptional,\n\t\t\t\t}\n\t\t\t})\n\t\t\t.filter((val) => val.shape !== 'undefined')\n\t}\n\n\tif (type.isUnion()) {\n\t\tconst unfilteredShapes: ShapeOfUnionEntry[] = type.getUnionTypes().map((type) => ({\n\t\t\trole: 'union_entry',\n\t\t\tshape: getProperTypeShape(type, atLocation, nextStack),\n\t\t\toptional: false,\n\t\t}))\n\n\t\tconst dedupedShapes = unfilteredShapes.filter(\n\t\t\t(type, index, arr) => !arr.find((dup, dupIndex) => dup.shape === type.shape && dupIndex > index),\n\t\t)\n\t\tconst isNullable = dedupedShapes.some((shape) => shape.shape === 'undefined')\n\t\tconst shapes = dedupedShapes.filter((shape) => shape.shape !== 'undefined')\n\t\tif (shapes.length === 1) {\n\t\t\treturn shapes[0].shape\n\t\t}\n\t\treturn [\n\t\t\t{\n\t\t\t\trole: 'union',\n\t\t\t\tshape: shapes,\n\t\t\t\toptional: isNullable,\n\t\t\t},\n\t\t]\n\t}\n\n\tif (type.isIntersection()) {\n\t\tconst children = type.getIntersectionTypes()\n\t\tconst shapesOfChildren = children\n\t\t\t.map((child) => getProperTypeShape(child, atLocation, nextStack))\n\t\t\t.filter((shape) => typeof shape !== 'string') as ShapeOfProperty[][]\n\t\treturn shapesOfChildren.reduce<ShapeOfType[]>((total, current) => [...total, ...current], [])\n\t}\n\n\tconst fileName = atLocation.getSourceFile().getFilePath().split('/').pop()\n\tLogger.warn(`[${fileName}] Unknown type shape node ${typeOrPromise.getText()}`)\n\treturn 'unknown_5'\n}\n\nconst getLiteralValueOfNode = (node: Node): string | string[] | unknown[] => {\n\tif (node.isKind(SyntaxKind.Identifier)) {\n\t\treturn getLiteralValueOfNode(findNodeImplementation(node))\n\t} else if (node.isKind(SyntaxKind.StringLiteral)) {\n\t\treturn node.getLiteralValue()\n\t} else if (node.isKind(SyntaxKind.ArrayLiteralExpression)) {\n\t\treturn node.forEachChildAsArray().map((child) => getLiteralValueOfNode(child)) as string[]\n\t} else if (node.isKind(SyntaxKind.PropertyAccessExpression)) {\n\t\treturn getLiteralValueOfNode(findPropertyAssignmentValueNode(node))\n\t} else if (node.isKind(SyntaxKind.ObjectLiteralExpression)) {\n\t\treturn getValuesOfObjectLiteral(node)\n\t}\n\n\tconst fileName = node.getSourceFile().getFilePath().split('/').pop()\n\tLogger.dev(`[${fileName}] Unknown literal value node ${node.getKindName()}`)\n\n\treturn 'unknown_6'\n}\n\nexport const resolveEndpointPath = (node: Node): string | null => {\n\tconst callExpression = node.getFirstDescendantByKind(SyntaxKind.CallExpression)\n\tif (!callExpression) return null\n\n\tconst firstArg = callExpression.getArguments()[0]\n\tif (!firstArg) return null\n\n\tconst argType = firstArg.getType()\n\tif (argType.isStringLiteral()) {\n\t\treturn argType.getLiteralValue() as string\n\t}\n\n\treturn null\n}\n\nexport const getValuesOfObjectLiteral = (objectLiteralNode: Node<ts.ObjectLiteralExpression>) => {\n\tconst syntaxListNode = objectLiteralNode.getFirstDescendantByKind(SyntaxKind.SyntaxList)!\n\tconst assignmentNodes = syntaxListNode.getChildrenOfKind(SyntaxKind.PropertyAssignment)!\n\n\tconst properties = assignmentNodes.map((node) => {\n\t\tconst identifierNode = node.getFirstDescendantByKind(SyntaxKind.Identifier)!\n\t\tconst identifierName = identifierNode.getText()\n\n\t\tconst assignmentValueNode = node.getLastChild()!\n\t\tconst targetNode = findNodeImplementation(assignmentValueNode)\n\t\tconst value = getLiteralValueOfNode(targetNode)\n\n\t\treturn {\n\t\t\tidentifier: identifierName,\n\t\t\tvalue,\n\t\t}\n\t})\n\n\treturn properties || []\n}\n"],"names":["implementationCache","findNodeImplementation","node","cached","SyntaxKind","implementationNode","assignmentValueNode","result","definitionNode","findPropertyAssignmentValueNode","identifierChildren","child","getTypeReferenceShape","firstChild","getRecursiveNodeShape","nodeOrReference","typeName","OpenApiManager","literalNode","typeLiteralNode","propNode","identifier","valueNode","questionMarkToken","typeReferenceNode","lastChild","getProperTypeShape","unionTypeNode","typeQueryNode","qualifiedNameNode","callExpressionNode","awaitExpressionNode","asExpressionNode","fileName","Logger","getShapeOfValidatorLiteral","objectLiteralNode","identifierNode","identifierName","innerLiteralNode","getValidatorPropertyShape","getValidatorPropertyOptionality","getValidatorPropertyStringValue","isZodCallExpression","callExpression","getZodCallShape","objectLiteral","syntaxList","prop","argNode","inlineValidatorAsExpression","typeReference","childTypeReferenceNode","typeNode","childCallExpressionNode","callExpressionArgument","thingyNode","parsePropertyAssignment","returnType","importTypeNode","indexOfGreaterThanToken","targetSyntaxList","intersectionType","validatorType","syntaxListNode","literalExpression","name","targetChild","c","value","targetValue","getValuesOfObjectLiteral","intersectionTypeNode","t","v","propertySignatureNode","isPromise","type","symbol","args","typeOrPromise","atLocation","stack","previousType","nextStack","typeSymbolName","bufferLikeTypes","valueType","elementType","targetType","valueDeclaration","isOptional","shape","val","dedupedShapes","index","arr","dup","dupIndex","isNullable","shapes","total","current","getLiteralValueOfNode","resolveEndpointPath","firstArg","argType","targetNode"],"mappings":"2LAgBMA,MAA0B,QAEnBC,EAA0BC,GAAqB,CACrD,MAAAC,EAASH,EAAoB,IAAIE,CAAI,EAC3C,GAAIC,EACI,OAAAA,EAGR,GAAID,EAAK,YAAcE,EAAAA,WAAW,WAAY,CACvC,MAAAC,EAAqBH,EAAK,OAAOE,EAAW,WAAA,UAAU,EAAG,mBAAmB,EAAE,CAAC,GAAG,QAAQ,EAChG,GAAIC,EAAoB,CAEjB,MAAAC,EAD2BD,EAAmB,UAAU,EACT,aAAa,EAClE,GAAIC,IAAwBJ,EACrB,MAAA,IAAI,MAAM,gCAAgC,EAE3C,MAAAK,EAASN,EAAuBK,CAAmB,EACrC,OAAAN,EAAA,IAAIE,EAAMK,CAAM,EAC7BA,CAAA,CAGF,MAAAC,EAAiBN,EAAK,OAAOE,EAAW,WAAA,UAAU,EAAG,eAAe,EAAE,CAAC,GAAG,QAAQ,EACxF,GAAII,EAAgB,CAEb,MAAAF,EADuBE,EAAe,UAAU,EACL,aAAa,EAC9D,GAAIF,IAAwBJ,EACrB,MAAA,IAAI,MAAM,gCAAgC,EAE3C,MAAAK,EAASN,EAAuBK,CAAmB,EACrC,OAAAN,EAAA,IAAIE,EAAMK,CAAM,EAC7BA,CAAA,CAEF,MAAA,IAAI,MAAM,4CAA4C,CAAA,CAGzC,OAAAP,EAAA,IAAIE,EAAMA,CAAI,EAC3BA,CACR,EAEaO,EACZP,GAMU,CACV,MAAMQ,EAAqBR,EAAK,kBAAkBE,EAAAA,WAAW,UAAU,EACnE,OAAAM,EAAmB,SAAW,EAC1BT,EAAuBS,EAAmB,CAAC,CAAC,EAE1BR,EAAK,YAAY,EAAE,QAAQ,EAC5B,KACvBS,GACAA,EAAM,QAAA,IAAc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