very-express 0.5.15 → 0.5.16
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/index.js +4 -4
- package/package.json +1 -1
- package/vex.config.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1012,7 +1012,7 @@ export const {{documentName}}Model: Model<{{documentName}}Document> = model<{{do
|
|
|
1012
1012
|
`+n.slice(f,_),f=_+1),h=g;return v+=`
|
|
1013
1013
|
`,n.length-f>s&&h>f?v+=n.slice(f,h)+`
|
|
1014
1014
|
`+n.slice(h+1):v+=n.slice(f),v.slice(1)}function y$r(n){for(var s="",c=0,p,f=0;f<n.length;c>=65536?f+=2:f++)c=gX(n,f),p=$g[c],!p&&DX(c)?(s+=n[f],c>=65536&&(s+=n[f+1])):s+=p||c$r(c);return s}function v$r(n,s,c){var p="",f=n.tag,_,h,g;for(_=0,h=c.length;_<h;_+=1)g=c[_],n.replacer&&(g=n.replacer.call(c,String(_),g)),(JS(n,s,g,!1,!1)||typeof g=="undefined"&&JS(n,s,null,!1,!1))&&(p!==""&&(p+=","+(n.condenseFlow?"":" ")),p+=n.dump);n.tag=f,n.dump="["+p+"]"}function XFe(n,s,c,p){var f="",_=n.tag,h,g,v;for(h=0,g=c.length;h<g;h+=1)v=c[h],n.replacer&&(v=n.replacer.call(c,String(h),v)),(JS(n,s+1,v,!0,!0,!1,!0)||typeof v=="undefined"&&JS(n,s+1,null,!0,!0,!1,!0))&&((!p||f!=="")&&(f+=lhe(n,s)),n.dump&&vX===n.dump.charCodeAt(0)?f+="-":f+="- ",f+=n.dump);n.tag=_,n.dump=f||"[]"}function x$r(n,s,c){var p="",f=n.tag,_=Object.keys(c),h,g,v,x,C;for(h=0,g=_.length;h<g;h+=1)C="",p!==""&&(C+=", "),n.condenseFlow&&(C+='"'),v=_[h],x=c[v],n.replacer&&(x=n.replacer.call(c,v,x)),JS(n,s,v,!1,!1)&&(n.dump.length>1024&&(C+="? "),C+=n.dump+(n.condenseFlow?'"':"")+":"+(n.condenseFlow?"":" "),JS(n,s,x,!1,!1)&&(C+=n.dump,p+=C));n.tag=f,n.dump="{"+p+"}"}function D$r(n,s,c,p){var f="",_=n.tag,h=Object.keys(c),g,v,x,C,w,N;if(n.sortKeys===!0)h.sort();else if(typeof n.sortKeys=="function")h.sort(n.sortKeys);else if(n.sortKeys)throw new Hy("sortKeys must be a boolean or a function");for(g=0,v=h.length;g<v;g+=1)N="",(!p||f!=="")&&(N+=lhe(n,s)),x=h[g],C=c[x],n.replacer&&(C=n.replacer.call(c,x,C)),JS(n,s+1,x,!0,!0,!0)&&(w=n.tag!==null&&n.tag!=="?"||n.dump&&n.dump.length>1024,w&&(n.dump&&vX===n.dump.charCodeAt(0)?N+="?":N+="? "),N+=n.dump,w&&(N+=lhe(n,s)),JS(n,s+1,C,!0,w)&&(n.dump&&vX===n.dump.charCodeAt(0)?N+=":":N+=": ",N+=n.dump,f+=N));n.tag=_,n.dump=f||"{}"}function QFe(n,s,c){var p,f,_,h,g,v;for(f=c?n.explicitTypes:n.implicitTypes,_=0,h=f.length;_<h;_+=1)if(g=f[_],(g.instanceOf||g.predicate)&&(!g.instanceOf||typeof s=="object"&&s instanceof g.instanceOf)&&(!g.predicate||g.predicate(s))){if(c?g.multi&&g.representName?n.tag=g.representName(s):n.tag=g.tag:n.tag="?",g.represent){if(v=n.styleMap[g.tag]||g.defaultStyle,k9e.call(g.represent)==="[object Function]")p=g.represent(s,v);else if(F9e.call(g.represent,v))p=g.represent[v](s,v);else throw new Hy("!<"+g.tag+'> tag resolver accepts not "'+v+'" style');n.dump=p}return!0}return!1}function JS(n,s,c,p,f,_,h){n.tag=null,n.dump=c,QFe(n,c,!1)||QFe(n,c,!0);var g=k9e.call(n.dump),v=p,x;p&&(p=n.flowLevel<0||n.flowLevel>s);var C=g==="[object Object]"||g==="[object Array]",w,N;if(C&&(w=n.duplicates.indexOf(c),N=w!==-1),(n.tag!==null&&n.tag!=="?"||N||n.indent!==2&&s>0)&&(f=!1),N&&n.usedDuplicates[w])n.dump="*ref_"+w;else{if(C&&N&&!n.usedDuplicates[w]&&(n.usedDuplicates[w]=!0),g==="[object Object]")p&&Object.keys(n.dump).length!==0?(D$r(n,s,n.dump,f),N&&(n.dump="&ref_"+w+n.dump)):(x$r(n,s,n.dump),N&&(n.dump="&ref_"+w+" "+n.dump));else if(g==="[object Array]")p&&n.dump.length!==0?(n.noArrayIndent&&!h&&s>0?XFe(n,s-1,n.dump,f):XFe(n,s,n.dump,f),N&&(n.dump="&ref_"+w+n.dump)):(v$r(n,s,n.dump),N&&(n.dump="&ref_"+w+" "+n.dump));else if(g==="[object String]")n.tag!=="?"&&m$r(n,n.dump,s,_,v);else{if(g==="[object Undefined]")return!1;if(n.skipInvalid)return!1;throw new Hy("unacceptable kind of an object to dump "+g)}n.tag!==null&&n.tag!=="?"&&(x=encodeURI(n.tag[0]==="!"?n.tag.slice(1):n.tag).replace(/!/g,"%21"),n.tag[0]==="!"?x="!"+x:x.slice(0,18)==="tag:yaml.org,2002:"?x="!!"+x.slice(18):x="!<"+x+">",n.dump=x+" "+n.dump)}return!0}function b$r(n,s){var c=[],p=[],f,_;for(fhe(n,c,p),f=0,_=p.length;f<_;f+=1)s.duplicates.push(c[p[f]]);s.usedDuplicates=new Array(_)}function fhe(n,s,c){var p,f,_;if(n!==null&&typeof n=="object")if(f=s.indexOf(n),f!==-1)c.indexOf(f)===-1&&c.push(f);else if(s.push(n),Array.isArray(n))for(f=0,_=n.length;f<_;f+=1)fhe(n[f],s,c);else for(p=Object.keys(n),f=0,_=p.length;f<_;f+=1)fhe(n[p[f]],s,c)}function E$r(n,s){s=s||{};var c=new p$r(s);c.noRefs||b$r(n,c);var p=n;return c.replacer&&(p=c.replacer.call({"":p},"",p)),JS(c,0,p,!0,!0)?c.dump+`
|
|
1015
|
-
`:""}var C$r=E$r,A$r={dump:C$r};function yhe(n,s){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}var S$r=$2,w$r=t9e,T$r=a9e,k$r=l9e,F$r=p9e,P$r=_he,O$r=T9e.load,N$r=T9e.loadAll,I$r=A$r.dump,B$r=Hy,L$r={binary:m9e,float:c9e,map:i9e,null:s9e,pairs:y9e,set:v9e,timestamp:_9e,bool:o9e,int:u9e,merge:h9e,omap:g9e,seq:n9e,str:r9e},R$r=yhe("safeLoad","load"),j$r=yhe("safeLoadAll","loadAll"),M$r=yhe("safeDump","dump"),q$r={Type:S$r,Schema:w$r,FAILSAFE_SCHEMA:T$r,JSON_SCHEMA:k$r,CORE_SCHEMA:F$r,DEFAULT_SCHEMA:P$r,load:O$r,loadAll:N$r,dump:I$r,YAMLException:B$r,types:L$r,safeLoad:R$r,safeLoadAll:j$r,safeDump:M$r},kae=q$r;var B3=S_(require("fs")),Pae=S_(require("path"));function $$r(n,...s){console.log("\x1B[34m%s\x1B[0m","[PROCESSING]",n,s.length>0?s:"")}function U$r(n,...s){console.log("\x1B[32m%s\x1B[0m","[WRITING]",n,s.length>0?s:"")}function K$r(n,...s){console.log("\x1B[36m%s\x1B[0m","[INFO]",n,s.length>0?s:"")}function V$r(n,...s){console.log("\x1B[33m%s\x1B[0m","[WARN]",n,s.length>0?s:"")}function H$r(n,...s){console.log("\x1B[41m%s\x1B[0m","[ERROR]",n,s.length>0?s:""),process.exit(1)}var Yl={process:$$r,writing:U$r,info:K$r,warn:V$r,error:H$r};var k$={name:"very-express",version:"0.5.
|
|
1015
|
+
`:""}var C$r=E$r,A$r={dump:C$r};function yhe(n,s){return function(){throw new Error("Function yaml."+n+" is removed in js-yaml 4. Use yaml."+s+" instead, which is now safe by default.")}}var S$r=$2,w$r=t9e,T$r=a9e,k$r=l9e,F$r=p9e,P$r=_he,O$r=T9e.load,N$r=T9e.loadAll,I$r=A$r.dump,B$r=Hy,L$r={binary:m9e,float:c9e,map:i9e,null:s9e,pairs:y9e,set:v9e,timestamp:_9e,bool:o9e,int:u9e,merge:h9e,omap:g9e,seq:n9e,str:r9e},R$r=yhe("safeLoad","load"),j$r=yhe("safeLoadAll","loadAll"),M$r=yhe("safeDump","dump"),q$r={Type:S$r,Schema:w$r,FAILSAFE_SCHEMA:T$r,JSON_SCHEMA:k$r,CORE_SCHEMA:F$r,DEFAULT_SCHEMA:P$r,load:O$r,loadAll:N$r,dump:I$r,YAMLException:B$r,types:L$r,safeLoad:R$r,safeLoadAll:j$r,safeDump:M$r},kae=q$r;var B3=S_(require("fs")),Pae=S_(require("path"));function $$r(n,...s){console.log("\x1B[34m%s\x1B[0m","[PROCESSING]",n,s.length>0?s:"")}function U$r(n,...s){console.log("\x1B[32m%s\x1B[0m","[WRITING]",n,s.length>0?s:"")}function K$r(n,...s){console.log("\x1B[36m%s\x1B[0m","[INFO]",n,s.length>0?s:"")}function V$r(n,...s){console.log("\x1B[33m%s\x1B[0m","[WARN]",n,s.length>0?s:"")}function H$r(n,...s){console.log("\x1B[41m%s\x1B[0m","[ERROR]",n,s.length>0?s:""),process.exit(1)}var Yl={process:$$r,writing:U$r,info:K$r,warn:V$r,error:H$r};var k$={name:"very-express",version:"0.5.16",description:"based on json schema and openapi, generate Express RestApi server with mongoDb ",author:"Justin26l",license:"MIT",main:"index.js",bin:{vex:"./dist/index.js"},scripts:{start:"node ./dist/index.js",dev:"npm run compile && npm run start",build:"npm run lint && npm run compile",lint:"eslint ./src --ext .ts --fix",compile:"node ./scripts/build.js && node ./scripts/copyTsTemplates.js"},keywords:["jsonSchema","express","RestApi","mongoDb","mongoose","json2mongoose"],repository:{type:"git",url:"git+https://github.com/Justin26l/VeryExpress.git"},devDependencies:{"@types/js-yaml":"^4.0.9","@types/minimist":"^1.2.5","@types/ms":"^2.1.0","@types/node":"^20.10.5","@types/passport":"^1.0.16","@typescript-eslint/eslint-plugin":"^6.18.1","@typescript-eslint/parser":"^6.18.1","diff-match-patch":"^1.0.5",dotenv:"^16.3.1",esbuild:"0.23.0",eslint:"^8.57.1","js-yaml":"^4.1.0","json-schema-to-openapi-schema":"^0.4.0","json-schema-to-typescript":"^13.1.1",json2mongoose:"^0.4.8",minimist:"^1.2.8",mongoose:"^8.7.1","ts-node":"^10.9.2",typescript:"^5.3.3"}};function vhe(n){return`/**
|
|
1016
1016
|
* Generated by veryExpress@${n}
|
|
1017
1017
|
* https://github.com/Justin26l/VeryExpress
|
|
1018
1018
|
*/
|
|
@@ -1020,10 +1020,10 @@ export const {{documentName}}Model: Model<{{documentName}}Document> = model<{{do
|
|
|
1020
1020
|
* Generated by veryExpress
|
|
1021
1021
|
* https://github.com/Justin26l/VeryExpress
|
|
1022
1022
|
*/
|
|
1023
|
-
`}function z$r(){return`// Generated by veryExpress@${k$.version}`}function W$r(){return"// Generated by veryExpress"}function Fae(n){return Object.keys(n.auth.oauthProviders).filter(s=>n.auth.oauthProviders[s]===!0)}function bX(n){return Fae(n).length>0}var xhe={rootDir:".",srcDir:"./src",sysDir:"./src/system",jsonSchemaDir:"./jsonSchema",openapiDir:"./openapi",generator:{commitBeforeGenerate:!1},app:{enableSwagger:!0,useUserSchema:!0,useStatefulRedisAuth:!1,useObjectID:!0,allowApiCreateUpdate_id:!1},useRBAC:{roles:["user"],default:"user",schemaIncluded:["user"]},auth:{localAuth:!0,useHttpOnlyCookieToken:!1,oauthProviders:{google:!1,microsoft:!1,apple:!1,github:!1}},_:{writtedDir:[]}},q9e={defaultCompilerOptions:xhe,getDefaultHeaderComment:vhe,getStaticHeaderComment:G$r,getSimpleHeaderComment:z$r,getSimpleStaticHeaderComment:W$r,OAuthProviders:Fae,
|
|
1023
|
+
`}function z$r(){return`// Generated by veryExpress@${k$.version}`}function W$r(){return"// Generated by veryExpress"}function Fae(n){return Object.keys(n.auth.oauthProviders).filter(s=>n.auth.oauthProviders[s]===!0)}function bX(n){return n.auth.localAuth||Fae(n).length>0}var xhe={rootDir:".",srcDir:"./src",sysDir:"./src/system",jsonSchemaDir:"./jsonSchema",openapiDir:"./openapi",generator:{commitBeforeGenerate:!1},app:{enableSwagger:!0,useUserSchema:!0,useStatefulRedisAuth:!1,useObjectID:!0,allowApiCreateUpdate_id:!1},useRBAC:{roles:["user"],default:"user",schemaIncluded:["user"]},auth:{localAuth:!0,useHttpOnlyCookieToken:!1,oauthProviders:{google:!1,microsoft:!1,apple:!1,github:!1}},_:{writtedDir:[]}},q9e={defaultCompilerOptions:xhe,getDefaultHeaderComment:vhe,getStaticHeaderComment:G$r,getSimpleHeaderComment:z$r,getSimpleStaticHeaderComment:W$r,OAuthProviders:Fae,isAuthEnabled:bX};var U9e=xhe,Y$r=vhe(k$.version);function $9e(n){return n.replace(/\r\n/g,`
|
|
1024
1024
|
`).replace(/[ \t]+$/gm,"").trim()}var X$r=(n,s)=>Pae.default.relative(n,s).replace(/\\/g,"/");function Q$r(n,s){let c=B3.default.existsSync(n);if(!c&&s)return s();if(c)try{let p=JSON.parse(B3.default.readFileSync(n,"utf8"));return p||Yl.error(`FILE JSON : Read Error ${n}`)}catch(p){return Yl.error(`FILE : ${n}
|
|
1025
1025
|
`,p.message)}else return Yl.error(`FILE : ${n} not found`)}function K9e(n,s,c){let p=B3.default.existsSync(s)?B3.default.readFileSync(s,"utf8"):"",f=/\/\*\*\s*\r?\n \* Generated by veryExpress@[^\r\n]+\r?\n \* https:\/\/github\.com\/Justin26l\/VeryExpress\s*\r?\n \*\/\s*/g,_=$9e(p.replace(f,"")),h=/^.*({{headerComment}}|\/\/ {{headerComment}}).*$(\r?\n)?/gm,g=$9e(c.replace(h,""));return _===g?!1:(Yl.writing(`${n} : "${s}"`),c=c.replace(/\/\/ {{headerComment}}|{{headerComment}}/g,Y$r||"// generated files by very-express"),B3.default.writeFileSync(s,c),!0)}function V9e(n,s,c,p){B3.default.existsSync(s)||B3.default.mkdirSync(s);let f=B3.default.readdirSync(n);for(let _=0;_<f.length;_++){let h=f[_],g=h=="index.ts"?h:h.replace(".ts",".gen.ts"),v=Pae.default.posix.join(n,h),x=Pae.default.posix.join(s,g);if(B3.default.lstatSync(v).isDirectory())V9e(v,x,c,p);else if(!p&&B3.default.existsSync(x))Yl.info(`FILE : AVOID OVERWRITE, skip "${x}"`);else{let C=B3.default.readFileSync(v,"utf8");K9e(`FILE : ${x}`,x,C)}}}function Z$r(n){U9e=n}function eUr(){return U9e}var H9e={relativePath:X$r,copyDir:V9e,loadJson:Q$r,writeFile:K9e,setCompilerOptions:Z$r,getCompilerOptions:eUr};function tUr(n){let s=/'FUNC{{(.*?)}}'/g,c;for(c=s.exec(n);c!=null;)n=n.replace(c[0],c[1]),c=s.exec(n);return n}var J9e={format:tUr};var Ehe=S_(require("fs"));var G9e=["get","getList","post","put","patch","delete","options","head","trace"],Oae=["get","post","put","patch","delete","options","head","trace"];function rUr(n){if(!Ehe.default.existsSync(n))return Yl.error(`loadJsonSchema : File Not Found ${n}`);try{return JSON.parse(Ehe.default.readFileSync(n,"utf8"))}catch(s){return Yl.error(`Error Load JsonSchema :
|
|
1026
|
-
`,s.message||s,n)}}function z9e(n,s){let c=JSON.parse(JSON.stringify(n)),p=Array.isArray(s),f=p?s:[],_=p?{}:s;for(let h in c)h.startsWith("x-")||p&&f.includes(h)||!p&&typeof _[h]!="undefined"&&_[h]==typeof c[h]?delete c[h]:typeof c[h]=="object"&&(c[h]=z9e(c[h],s));return c}function nUr(n,s){if(n=="getList")return"get";if(Oae.includes(n))return n;Yl.error(`httpMethod : invalid method "${n}" in "${s}".`),process.exit(1)}var W9e={cleanXcustomValue:z9e,httpMethod:nUr,loadJsonSchema:rUr};function iUr(n){if(!n)throw new Error("vex.config is undefined");if(!n.srcDir)throw new Error("vex.config.srcDir is undefined");if(!n.sysDir)throw new Error("vex.config.sysDir is undefined");if(!n.openapiDir)throw new Error("vex.config.openapiDir is undefined");if(!n.jsonSchemaDir)throw new Error("vex.config.jsonSchemaDir is undefined")}var Y9e={checkConfigValid:iUr};var Yc={common:H9e,generator:q9e,template:J9e,jsonSchema:W9e,logger:Yl,configChecker:Y9e};function Q9e(n,s){return wp(this,null,function*(){let c={openapi:"3.0.0",info:{title:"veryExpress generated api server",description:"OpenApi Spec generated by veryExpress",version:"1.0.0"},paths:{},components:{securitySchemes:{},schemas:{}}};Yc.generator.isOAuthEnabled(s)&&(c.components.securitySchemes={BearerAuth:{type:"http",scheme:"bearer",bearerFormat:"JWT"},AuthIndex:{type:"apiKey",in:"header",name:"X-Auth-Index"}}),Che.default.readdirSync(s.jsonSchemaDir).forEach(g=>{if(!g.endsWith(".json"))return;let v=X9e.default.posix.join(s.jsonSchemaDir,g);Yl.process(`OpenApi : ${v}`);let x=Che.default.readFileSync(`${s.jsonSchemaDir}/${g}`),C=JSON.parse(x.toString());c=aUr(c,C,{jsonSchemaFilePath:v},s),c=sUr(c,C,{jsonSchemaFilePath:v},s)});let f=(0,F$.default)(c,{version:3}),_=kae.dump(f),h=s.openapiDir+n;Yc.common.writeFile("OpenApi",h,_)})}function aUr(n,s,c,p){let f=s["x-documentConfig"],_=f.documentName.toLowerCase(),h=f.documentName,g=[{BearerAuth:[]},{AuthIndex:[]}],v=s.properties,x={["/api/"+_]:{"x-documentName":h},["/api/"+_+"/{id}"]:{"x-documentName":h}};return f.methods.forEach(C=>{let w=["get","put","patch","delete"].includes(C),N=["post","put","patch"].includes(C),F="/api/"+_+(w?"/{id}":""),P=Yc.jsonSchema.httpMethod(C,c),M=[],Z,ie={200:{description:"OK",content:{"application/json":{schema:{$ref:`#/components/schemas/${P}${h}Response`}}}}};if(w&&v._id){let $={name:"id",in:"path",description:v._id.description,required:!0,schema:{type:v._id.type,format:v._id.format,"x-format":v._id["x-format"],minLength:v._id.minLength,maxLength:v._id.maxLength,minimum:v._id.minimum,maximum:v._id.maximum,enum:v._id.enum}};M.push($)}P=="post"?(ie[201]=Object.assign({},ie[200]),ie[201].description="Crerated",delete ie[200]):P=="delete"&&delete ie[200].content,N&&(Z={description:`${P} ${f.documentName}`,required:!1,content:{"application/json":{schema:{$ref:`#/components/schemas/${P}${h}Body`}}}}),x[F][P]={operationId:C+h,tags:[_],security:Yc.generator.isOAuthEnabled(p)?g:void 0,parameters:M,requestBody:Z,responses:Object.assign({400:{description:"Bad Request"},401:{description:"Unauthorized"},403:{description:"Forbidden"},404:{description:"Not Found"},405:{description:"Method Not Allowed"},413:{description:"Payload Too Large"},429:{description:"Too Many Requests"},500:{description:"Internal Server Error"},502:{description:"Bad Gateway"},503:{description:"Service Unavailable"}},ie)}}),n.paths=Object.assign(n.paths,x),n}function sUr(n,s,c,p){let f={},_=s["x-documentConfig"],h=_.documentName.toLowerCase(),g=_.documentName,v={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(s.properties,["index","unique","required"]),{version:3})},x={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(s.properties,{index:"boolean",unique:"boolean",required:"boolean"}),{version:3}),required:s.required},C={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(x.properties,{_id:"object"}),{version:3}),required:s.required},w={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(C.properties,["required"]),{version:3})};return _.methods.forEach(N=>{let F=Yc.jsonSchema.httpMethod(N,c);switch(N){case"delete":break;case"get":f[F+g+"Response"]=v;break;case"getList":{let P=[];Object.keys(s.properties).forEach(M=>{let Z=s.properties[M];if(Z.type!="object")switch(Z.type=="array"&&(Z.type="string"),P.push({name:M,in:"query",required:!1,schema:{type:Z.type,format:Z.format,"x-format":Z["x-format"],minLength:Z.minLength,maxLength:Z.maxLength,minimum:Z.minimum,maximum:Z.maximum,enum:Z.enum}}),Z["x-format"]){case"minMax":P.push({name:"min_"+M,in:"query",required:!1,schema:{type:Z.type,format:Z.format,"x-format":Z["x-format"],minLength:Z.minLength,maxLength:Z.maxLength,minimum:Z.minimum,maximum:Z.maximum,enum:Z.enum}}),P.push({name:"max_"+M,in:"query",required:!1,schema:{type:Z.type,format:Z.format,"x-format":Z["x-format"],minLength:Z.minLength,maxLength:Z.maxLength,minimum:Z.minimum,maximum:Z.maximum,enum:Z.enum}});break;default:break}}),n.paths["/api/"+h][F].parameters=P,f[F+g+"Response"]=v,f[F+g+"ResponseList"]={type:"array",items:v};break}case"patch":f[F+g+"Body"]=w,f[F+g+"Response"]=v;break;case"post":f[F+g+"Body"]=p.app.allowApiCreateUpdate_id?x:C,f[F+g+"Response"]=v;break;case"put":f[F+g+"Body"]=p.app.allowApiCreateUpdate_id?x:C,f[F+g+"Response"]=v;break;default:break}}),n.components.schemas=Object.assign(n.components.schemas,f),n}function Z9e(n,s){var f;let c=((f=n.split("/").pop())==null?void 0:f.split(".")[0])||"Unknown_File_Name",p=Yc.jsonSchema.loadJsonSchema(n);return p["x-documentConfig"]||Yl.error(`Json Schema Formatting: "${n}" x-documentConfig not found.`),p["x-documentConfig"].documentName||(Yl.warn(`Json Schema Formatting: "${n}" x-documentConfig.documentName added.`),p["x-documentConfig"].documentName=c),p["x-documentConfig"].methods||(Yl.warn(`Json Schema Formatting: "${n}" x-documentConfig.methods not found, supported methods added.`),p["x-documentConfig"].methods=Object.assign([],G9e)),p["x-documentConfig"].documentName!=c&&Yl.error(`Json Schema Formatting: "${n}" x-documentConfig.documentName is not consistant with file name.`),typeof p.properties!="object"&&Yl.error(`properties is invalid in ${n}`),s.app.useObjectID&&uUr(p,n),p.required=Ahe(p,n),Yc.common.writeFile("Json Schema Formatting",n,JSON.stringify(p,null,4)),p}function Ahe(n,s){let c,p=[],f=_=>!!(_.type=="array"&&_.items&&_.items.type=="object");if(f(n))c=n.items.properties,p=typeof n.items.required=="object"?n.items.required:[];else if(n.type=="object")c=n.properties,p=typeof n.required=="object"?n.required:[];else return;return c==null?Yl.error(`formatJsonSchema > formatRequired : invalid "schema.properties" in ${s}`,n):Object.keys(c).forEach(_=>{let h=c==null?void 0:c[_],g=!p.includes(_);h&&h.type!=="object"&&h.required===!0&&g?p.push(_):h&&h.items&&f(h)?h.items.required=Ahe(h.items,s):h&&h.type=="object"&&(h.required=Ahe(h,s),h.required&&h.required.length>0&&g&&p.push(_))}),p}function uUr(n,s){n.properties&&!n.properties._id&&(n.properties._id={type:"string",description:"Unique Identifier",example:"60c8c9d2b2b4f2c3e8d6f3e1"},Yl.info(`formatJsonSchema : "_id" field added to ${s}`))}var ePe=S_(require("fs"));function tPe(n){var c;if(!n.compilerOptions.useRBAC)return;let s=["create","read","update","delete"];(c=n.compilerOptions.useRBAC)==null||c.roles.forEach(p=>{Yl.process(`Role Setting File : ${p}`);let f=`${n.roleSetupDir}/${p}.json`,_={};ePe.default.existsSync(f)&&Object.assign(_,Yc.common.loadJson(f)),n.collectionList.forEach(h=>{_[h]||(_[h]=s)}),Yc.common.writeFile(`Role Setting File : ${f}`,f,JSON.stringify(_,null,4))})}function rPe(n){var s;n.compilerOptions.useRBAC&&((s=n.compilerOptions.useRBAC)==null||s.schemaIncluded.forEach(c=>{var _,h;Yl.process(`Schema Role Formatting : ${c}.json`);let p=`${n.compilerOptions.jsonSchemaDir}/${c}.json`,f=Yc.common.loadJson(p);for(let g in f.properties){let v=f.properties[g];if(v["x-vexData"]==="role"){v.type="array",v.default=[(_=n.compilerOptions.useRBAC)==null?void 0:_.default],v.items||(v.items={type:""}),v.items.type="string",v.items.enum=(h=n.compilerOptions.useRBAC)==null?void 0:h.roles;break}}Yc.common.writeFile("Schema Role Formatting",p,JSON.stringify(f,null,4))}))}function nPe(n){return wp(this,null,function*(){if(!n.compilerOptions.app.useUserSchema)return;Yl.process("UserSchmea");let s=`${n.compilerOptions.jsonSchemaDir}/User.json`,c=Yc.common.loadJson(__dirname+"/templates/jsonSchema/User.json"),p=Yc.common.loadJson(s,()=>c);Object.keys(c.properties).forEach(f=>{var _,h;p.properties[f]||(p.properties[f]=c.properties[f]),((_=p.properties[f])==null?void 0:_["x-vexData"])=="role"&&(p.properties[f].items.enum=((h=n.compilerOptions.useRBAC)==null?void 0:h.roles)||["user"])}),Yc.common.writeFile("UserSchmea",s,JSON.stringify(p,null,4))})}var whe=S_(require("path"));var She=S_(require("fs"));var iPe={main:"index.js",scripts:{build:"tsc -p . && node scripts/build.js",start:"node dist/server.js",dev:"nodemon --watch src --exec ts-node src/server.ts","docker-build":"docker build -t very-express .","docker-start":"docker run -p 3000:3000 very-express"},dependencies:{cookie:"^0.6.0","cookie-parser":"^1.4.6",dotenv:"^16.4.4",express:"^4.18.2","express-validator":"^7.0.1",helmet:"^7.1.0","js-yaml":"^4.1.0",jsonwebtoken:"^9.0.2","mongo-ts-querystring":"^1.0.4",mongodb:"^5.6.0",mongoose:"^7.4.0",passport:"^0.7.0","passport-google-oauth20":"^2.0.0","passport-github":"^1.1.0","passport-jwt":"^4.0.1","swagger-ui-express":"^5.0.0"},devDependencies:{"@types/cookie-parser":"^1.4.7","@types/jsonwebtoken":"^9.0.7","@types/crypto-js":"^4.1.2","@types/dotenv":"^8.2.0","@types/express":"^4.17.17","@types/express-validator":"^3.0.0","@types/js-yaml":"^4.0.9","@types/mongodb":"^4.0.7","@types/ms":"^2.1.0","@types/node":"^20.4.2","@types/passport":"^1.0.16","@types/passport-google-oauth20":"^2.0.14","@types/passport-github":"^1.1.12","@types/sequelize":"^4.28.15","@types/swagger-ui-express":"^4.1.6","@types/ws":"^8.5.5",nodemon:"^2.0.22","strip-json-comments":"^5.0.1","ts-node":"^10.9.1",typescript:"^5.1.6"}};function pUr(n,s){return wp(this,null,function*(){Yl.process(`Project Settings : ${n}`);let c="";She.default.existsSync(n)?c=She.default.readFileSync(n).toString():c=JSON.stringify(iPe);let p=JSON.parse(c);p.scripts.build||(Yl.process(`package.json : Update script : build > ${p.scripts.build}`),p.scripts.build="tsc -p . && node scripts/build.js"),p.scripts.dev||(Yl.process(`package.json : Update script : dev > ${p.scripts.dev}`),p.scripts.dev=`nodemon --watch src --exec ts-node ${s.srcDir}/server.ts`),p.scripts.start||(Yl.process(`package.json : Update script : start > ${p.scripts.start}`),p.scripts.start="node ./dist/server.js"),Yc.common.writeFile(`Project Settings : ${n}`,n,JSON.stringify(p,null,4))})}var aPe={compile:pUr};var sPe=S_(require("fs")),oPe=S_(require("path"));function fUr(n){return wp(this,null,function*(){let s=sPe.default.readFileSync(__dirname+"/templates/root/scripts/build.js","utf8"),c=Yc.common.relativePath(n.rootDir,n.openapiDir);s=s.replace("{{openapiDir}}",c),Yc.common.writeFile("Build Scripts",oPe.default.join(n.rootDir,"scripts/build.js"),s)})}var uPe={compile:fUr};var Nae=S_(require("fs"));function dUr(n){return wp(this,null,function*(){Yl.process(`Project Settings : ${n}`);let s="",c=Nae.default.readFileSync(__dirname+"/templates/_projectSettings/env","utf8");if(console.log(`Processing .env file at ${n}`),!Nae.default.existsSync(n))s=c;else{s=Nae.default.readFileSync(n,"utf-8");let p=[],f=[],_=[];s.split(`
|
|
1026
|
+
`,s.message||s,n)}}function z9e(n,s){let c=JSON.parse(JSON.stringify(n)),p=Array.isArray(s),f=p?s:[],_=p?{}:s;for(let h in c)h.startsWith("x-")||p&&f.includes(h)||!p&&typeof _[h]!="undefined"&&_[h]==typeof c[h]?delete c[h]:typeof c[h]=="object"&&(c[h]=z9e(c[h],s));return c}function nUr(n,s){if(n=="getList")return"get";if(Oae.includes(n))return n;Yl.error(`httpMethod : invalid method "${n}" in "${s}".`),process.exit(1)}var W9e={cleanXcustomValue:z9e,httpMethod:nUr,loadJsonSchema:rUr};function iUr(n){if(!n)throw new Error("vex.config is undefined");if(!n.srcDir)throw new Error("vex.config.srcDir is undefined");if(!n.sysDir)throw new Error("vex.config.sysDir is undefined");if(!n.openapiDir)throw new Error("vex.config.openapiDir is undefined");if(!n.jsonSchemaDir)throw new Error("vex.config.jsonSchemaDir is undefined")}var Y9e={checkConfigValid:iUr};var Yc={common:H9e,generator:q9e,template:J9e,jsonSchema:W9e,logger:Yl,configChecker:Y9e};function Q9e(n,s){return wp(this,null,function*(){let c={openapi:"3.0.0",info:{title:"veryExpress generated api server",description:"OpenApi Spec generated by veryExpress",version:"1.0.0"},paths:{},components:{securitySchemes:{},schemas:{}}};Yc.generator.isAuthEnabled(s)&&(c.components.securitySchemes={BearerAuth:{type:"http",scheme:"bearer",bearerFormat:"JWT"},AuthIndex:{type:"apiKey",in:"header",name:"X-Auth-Index"}}),Che.default.readdirSync(s.jsonSchemaDir).forEach(g=>{if(!g.endsWith(".json"))return;let v=X9e.default.posix.join(s.jsonSchemaDir,g);Yl.process(`OpenApi : ${v}`);let x=Che.default.readFileSync(`${s.jsonSchemaDir}/${g}`),C=JSON.parse(x.toString());c=aUr(c,C,{jsonSchemaFilePath:v},s),c=sUr(c,C,{jsonSchemaFilePath:v},s)});let f=(0,F$.default)(c,{version:3}),_=kae.dump(f),h=s.openapiDir+n;Yc.common.writeFile("OpenApi",h,_)})}function aUr(n,s,c,p){let f=s["x-documentConfig"],_=f.documentName.toLowerCase(),h=f.documentName,g=[{BearerAuth:[]},{AuthIndex:[]}],v=s.properties,x={["/api/"+_]:{"x-documentName":h},["/api/"+_+"/{id}"]:{"x-documentName":h}};return f.methods.forEach(C=>{let w=["get","put","patch","delete"].includes(C),N=["post","put","patch"].includes(C),F="/api/"+_+(w?"/{id}":""),P=Yc.jsonSchema.httpMethod(C,c),M=[],Z,ie={200:{description:"OK",content:{"application/json":{schema:{$ref:`#/components/schemas/${P}${h}Response`}}}}};if(w&&v._id){let $={name:"id",in:"path",description:v._id.description,required:!0,schema:{type:v._id.type,format:v._id.format,"x-format":v._id["x-format"],minLength:v._id.minLength,maxLength:v._id.maxLength,minimum:v._id.minimum,maximum:v._id.maximum,enum:v._id.enum}};M.push($)}P=="post"?(ie[201]=Object.assign({},ie[200]),ie[201].description="Crerated",delete ie[200]):P=="delete"&&delete ie[200].content,N&&(Z={description:`${P} ${f.documentName}`,required:!1,content:{"application/json":{schema:{$ref:`#/components/schemas/${P}${h}Body`}}}}),x[F][P]={operationId:C+h,tags:[_],security:Yc.generator.isAuthEnabled(p)?g:void 0,parameters:M,requestBody:Z,responses:Object.assign({400:{description:"Bad Request"},401:{description:"Unauthorized"},403:{description:"Forbidden"},404:{description:"Not Found"},405:{description:"Method Not Allowed"},413:{description:"Payload Too Large"},429:{description:"Too Many Requests"},500:{description:"Internal Server Error"},502:{description:"Bad Gateway"},503:{description:"Service Unavailable"}},ie)}}),n.paths=Object.assign(n.paths,x),n}function sUr(n,s,c,p){let f={},_=s["x-documentConfig"],h=_.documentName.toLowerCase(),g=_.documentName,v={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(s.properties,["index","unique","required"]),{version:3})},x={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(s.properties,{index:"boolean",unique:"boolean",required:"boolean"}),{version:3}),required:s.required},C={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(x.properties,{_id:"object"}),{version:3}),required:s.required},w={type:"object",properties:(0,F$.default)(Yc.jsonSchema.cleanXcustomValue(C.properties,["required"]),{version:3})};return _.methods.forEach(N=>{let F=Yc.jsonSchema.httpMethod(N,c);switch(N){case"delete":break;case"get":f[F+g+"Response"]=v;break;case"getList":{let P=[];Object.keys(s.properties).forEach(M=>{let Z=s.properties[M];if(Z.type!="object")switch(Z.type=="array"&&(Z.type="string"),P.push({name:M,in:"query",required:!1,schema:{type:Z.type,format:Z.format,"x-format":Z["x-format"],minLength:Z.minLength,maxLength:Z.maxLength,minimum:Z.minimum,maximum:Z.maximum,enum:Z.enum}}),Z["x-format"]){case"minMax":P.push({name:"min_"+M,in:"query",required:!1,schema:{type:Z.type,format:Z.format,"x-format":Z["x-format"],minLength:Z.minLength,maxLength:Z.maxLength,minimum:Z.minimum,maximum:Z.maximum,enum:Z.enum}}),P.push({name:"max_"+M,in:"query",required:!1,schema:{type:Z.type,format:Z.format,"x-format":Z["x-format"],minLength:Z.minLength,maxLength:Z.maxLength,minimum:Z.minimum,maximum:Z.maximum,enum:Z.enum}});break;default:break}}),n.paths["/api/"+h][F].parameters=P,f[F+g+"Response"]=v,f[F+g+"ResponseList"]={type:"array",items:v};break}case"patch":f[F+g+"Body"]=w,f[F+g+"Response"]=v;break;case"post":f[F+g+"Body"]=p.app.allowApiCreateUpdate_id?x:C,f[F+g+"Response"]=v;break;case"put":f[F+g+"Body"]=p.app.allowApiCreateUpdate_id?x:C,f[F+g+"Response"]=v;break;default:break}}),n.components.schemas=Object.assign(n.components.schemas,f),n}function Z9e(n,s){var f;let c=((f=n.split("/").pop())==null?void 0:f.split(".")[0])||"Unknown_File_Name",p=Yc.jsonSchema.loadJsonSchema(n);return p["x-documentConfig"]||Yl.error(`Json Schema Formatting: "${n}" x-documentConfig not found.`),p["x-documentConfig"].documentName||(Yl.warn(`Json Schema Formatting: "${n}" x-documentConfig.documentName added.`),p["x-documentConfig"].documentName=c),p["x-documentConfig"].methods||(Yl.warn(`Json Schema Formatting: "${n}" x-documentConfig.methods not found, supported methods added.`),p["x-documentConfig"].methods=Object.assign([],G9e)),p["x-documentConfig"].documentName!=c&&Yl.error(`Json Schema Formatting: "${n}" x-documentConfig.documentName is not consistant with file name.`),typeof p.properties!="object"&&Yl.error(`properties is invalid in ${n}`),s.app.useObjectID&&uUr(p,n),p.required=Ahe(p,n),Yc.common.writeFile("Json Schema Formatting",n,JSON.stringify(p,null,4)),p}function Ahe(n,s){let c,p=[],f=_=>!!(_.type=="array"&&_.items&&_.items.type=="object");if(f(n))c=n.items.properties,p=typeof n.items.required=="object"?n.items.required:[];else if(n.type=="object")c=n.properties,p=typeof n.required=="object"?n.required:[];else return;return c==null?Yl.error(`formatJsonSchema > formatRequired : invalid "schema.properties" in ${s}`,n):Object.keys(c).forEach(_=>{let h=c==null?void 0:c[_],g=!p.includes(_);h&&h.type!=="object"&&h.required===!0&&g?p.push(_):h&&h.items&&f(h)?h.items.required=Ahe(h.items,s):h&&h.type=="object"&&(h.required=Ahe(h,s),h.required&&h.required.length>0&&g&&p.push(_))}),p}function uUr(n,s){n.properties&&!n.properties._id&&(n.properties._id={type:"string",description:"Unique Identifier",example:"60c8c9d2b2b4f2c3e8d6f3e1"},Yl.info(`formatJsonSchema : "_id" field added to ${s}`))}var ePe=S_(require("fs"));function tPe(n){var c;if(!n.compilerOptions.useRBAC)return;let s=["create","read","update","delete"];(c=n.compilerOptions.useRBAC)==null||c.roles.forEach(p=>{Yl.process(`Role Setting File : ${p}`);let f=`${n.roleSetupDir}/${p}.json`,_={};ePe.default.existsSync(f)&&Object.assign(_,Yc.common.loadJson(f)),n.collectionList.forEach(h=>{_[h]||(_[h]=s)}),Yc.common.writeFile(`Role Setting File : ${f}`,f,JSON.stringify(_,null,4))})}function rPe(n){var s;n.compilerOptions.useRBAC&&((s=n.compilerOptions.useRBAC)==null||s.schemaIncluded.forEach(c=>{var _,h;Yl.process(`Schema Role Formatting : ${c}.json`);let p=`${n.compilerOptions.jsonSchemaDir}/${c}.json`,f=Yc.common.loadJson(p);for(let g in f.properties){let v=f.properties[g];if(v["x-vexData"]==="role"){v.type="array",v.default=[(_=n.compilerOptions.useRBAC)==null?void 0:_.default],v.items||(v.items={type:""}),v.items.type="string",v.items.enum=(h=n.compilerOptions.useRBAC)==null?void 0:h.roles;break}}Yc.common.writeFile("Schema Role Formatting",p,JSON.stringify(f,null,4))}))}function nPe(n){return wp(this,null,function*(){if(!n.compilerOptions.app.useUserSchema)return;Yl.process("UserSchmea");let s=`${n.compilerOptions.jsonSchemaDir}/User.json`,c=Yc.common.loadJson(__dirname+"/templates/jsonSchema/User.json"),p=Yc.common.loadJson(s,()=>c);Object.keys(c.properties).forEach(f=>{var _,h;p.properties[f]||(p.properties[f]=c.properties[f]),((_=p.properties[f])==null?void 0:_["x-vexData"])=="role"&&(p.properties[f].items.enum=((h=n.compilerOptions.useRBAC)==null?void 0:h.roles)||["user"])}),Yc.common.writeFile("UserSchmea",s,JSON.stringify(p,null,4))})}var whe=S_(require("path"));var She=S_(require("fs"));var iPe={main:"index.js",scripts:{build:"tsc -p . && node scripts/build.js",start:"node dist/server.js",dev:"nodemon --watch src --exec ts-node src/server.ts","docker-build":"docker build -t very-express .","docker-start":"docker run -p 3000:3000 very-express"},dependencies:{cookie:"^0.6.0","cookie-parser":"^1.4.6",dotenv:"^16.4.4",express:"^4.18.2","express-validator":"^7.0.1",helmet:"^7.1.0","js-yaml":"^4.1.0",jsonwebtoken:"^9.0.2","mongo-ts-querystring":"^1.0.4",mongodb:"^5.6.0",mongoose:"^7.4.0",passport:"^0.7.0","passport-google-oauth20":"^2.0.0","passport-github":"^1.1.0","passport-jwt":"^4.0.1","swagger-ui-express":"^5.0.0"},devDependencies:{"@types/cookie-parser":"^1.4.7","@types/jsonwebtoken":"^9.0.7","@types/crypto-js":"^4.1.2","@types/dotenv":"^8.2.0","@types/express":"^4.17.17","@types/express-validator":"^3.0.0","@types/js-yaml":"^4.0.9","@types/mongodb":"^4.0.7","@types/ms":"^2.1.0","@types/node":"^20.4.2","@types/passport":"^1.0.16","@types/passport-google-oauth20":"^2.0.14","@types/passport-github":"^1.1.12","@types/sequelize":"^4.28.15","@types/swagger-ui-express":"^4.1.6","@types/ws":"^8.5.5",nodemon:"^2.0.22","strip-json-comments":"^5.0.1","ts-node":"^10.9.1",typescript:"^5.1.6"}};function pUr(n,s){return wp(this,null,function*(){Yl.process(`Project Settings : ${n}`);let c="";She.default.existsSync(n)?c=She.default.readFileSync(n).toString():c=JSON.stringify(iPe);let p=JSON.parse(c);p.scripts.build||(Yl.process(`package.json : Update script : build > ${p.scripts.build}`),p.scripts.build="tsc -p . && node scripts/build.js"),p.scripts.dev||(Yl.process(`package.json : Update script : dev > ${p.scripts.dev}`),p.scripts.dev=`nodemon --watch src --exec ts-node ${s.srcDir}/server.ts`),p.scripts.start||(Yl.process(`package.json : Update script : start > ${p.scripts.start}`),p.scripts.start="node ./dist/server.js"),Yc.common.writeFile(`Project Settings : ${n}`,n,JSON.stringify(p,null,4))})}var aPe={compile:pUr};var sPe=S_(require("fs")),oPe=S_(require("path"));function fUr(n){return wp(this,null,function*(){let s=sPe.default.readFileSync(__dirname+"/templates/root/scripts/build.js","utf8"),c=Yc.common.relativePath(n.rootDir,n.openapiDir);s=s.replace("{{openapiDir}}",c),Yc.common.writeFile("Build Scripts",oPe.default.join(n.rootDir,"scripts/build.js"),s)})}var uPe={compile:fUr};var Nae=S_(require("fs"));function dUr(n){return wp(this,null,function*(){Yl.process(`Project Settings : ${n}`);let s="",c=Nae.default.readFileSync(__dirname+"/templates/_projectSettings/env","utf8");if(console.log(`Processing .env file at ${n}`),!Nae.default.existsSync(n))s=c;else{s=Nae.default.readFileSync(n,"utf-8");let p=[],f=[],_=[];s.split(`
|
|
1027
1027
|
`).forEach(h=>{if(!/=/g.test(h))return;let g=h.split("=",2)[0];g&&p.push(g)}),c.split(`
|
|
1028
1028
|
`).forEach(h=>{if(!/=/g.test(h))return;let g=h.split("=",2)[0];g&&f.push(g)}),f.forEach(h=>{p.includes(h)||_.push(h)}),_.length>0&&(s+=`
|
|
1029
1029
|
|
|
@@ -1559,7 +1559,7 @@ export default class SwaggerRouter{
|
|
|
1559
1559
|
return this.router;
|
|
1560
1560
|
}
|
|
1561
1561
|
|
|
1562
|
-
}`}function xPe(n){return wp(this,null,function*(){Yl.process("Route");let s=`${n.routesDir}/ApiRouter.gen.ts`,c=`${n.routesDir}/AuthRouter.gen.ts`,p=`${n.routesDir}/SwaggerRouter.gen.ts`;Yc.generator.
|
|
1562
|
+
}`}function xPe(n){return wp(this,null,function*(){Yl.process("Route");let s=`${n.routesDir}/ApiRouter.gen.ts`,c=`${n.routesDir}/AuthRouter.gen.ts`,p=`${n.routesDir}/SwaggerRouter.gen.ts`;Yc.generator.isAuthEnabled(n.compilerOptions)&&Yc.common.writeFile("Route Auth",c,yPe(n.compilerOptions)),n.compilerOptions.app.enableSwagger&&Yc.common.writeFile("Route Swagger",p,vPe()),Yc.common.writeFile("Route API",s,Nhe({routes:n.routesArr,openapiFile:n.openapiFile,compilerOptions:n.compilerOptions}))})}var DPe=S_(require("path"));var CUr="import cookieParser from 'cookie-parser';",AUr="import SwaggerRouter from './system/_routes/SwaggerRouter.gen';",SUr="import AuthRouter from './system/_routes/AuthRouter.gen';",wUr="const SwaggerRoute = new SwaggerRouter();",TUr="const AuthRoute = new AuthRouter();",kUr="const ApiRoute = new ApiRouter();",FUr="app.use(cookieParser());",PUr='app.use("/auth", AuthRoute.getRouter());',OUr='app.use("/swagger", SwaggerRoute.getRouter());',NUr='app.use("/api", ApiRoute.getRouter());';function Bhe(n){let s=n.template||`{{headerComment}}
|
|
1563
1563
|
import express from 'express';
|
|
1564
1564
|
import dotenv from 'dotenv';
|
|
1565
1565
|
import crypto from 'crypto';
|
package/package.json
CHANGED