@nattyjs/common 0.0.1-beta.54 → 0.0.1-beta.55

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.cjs CHANGED
@@ -100,7 +100,7 @@ const typeContainer = new class {
100
100
  this.controllerInfo = /* @__PURE__ */ new Map();
101
101
  this.files = /* @__PURE__ */ new Map();
102
102
  this.routes = {};
103
- this.modelSchemas = /* @__PURE__ */ new Map();
103
+ this.modelSchemas = new Array();
104
104
  }
105
105
  setControllerJsonSchema(classInfo) {
106
106
  const className = this.files.get(classInfo.filePath);
@@ -123,7 +123,10 @@ const typeContainer = new class {
123
123
  return controllerName.substr(0, controllerName.length - 10).toLowerCase();
124
124
  }
125
125
  setClassMetaInfo(typeMeta) {
126
- this.modelSchemas.set(typeMeta.name, typeMeta);
126
+ this.modelSchemas.push(typeMeta);
127
+ }
128
+ getClassMetaInfo() {
129
+ return this.modelSchemas;
127
130
  }
128
131
  getRoutes() {
129
132
  const routes = {};
@@ -149,6 +152,7 @@ const typeContainer = new class {
149
152
  templateInfo[httpMethod][route] = { name: method.name, parameters, returnType: method.returnType };
150
153
  }
151
154
  routes[templateInfo.route] = templateInfo;
155
+ routes[templateInfo.route].jsDoc = classInfo.jsDoc;
152
156
  }
153
157
  return routes;
154
158
  }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { RequestRouteInfo, IHttpResult, Cookie, IModelBindingContext, ProblemDetail, IExceptionContext, HttpResponseInit, NattyTestModule, ModelBinding, BuildOptions, TypesInfo, ClassTypeInfo, TypeMeta } from '@nattyjs/types';
1
+ import { RequestRouteInfo, IHttpResult, Cookie, IModelBindingContext, ProblemDetail, IExceptionContext, HttpResponseInit, NattyTestModule, ModelBinding, GenerateOpenApiOptions, BuildOptions, TypesInfo, ClassTypeInfo, TypeMeta } from '@nattyjs/types';
2
2
  import { ChildProcess } from 'child_process';
3
3
 
4
4
  interface ClassType<T> extends Function {
@@ -143,6 +143,10 @@ interface NattyCliConfig {
143
143
  env?: Partial<EnvConfig>;
144
144
  runner?: ClassType<AbstractRunner>;
145
145
  port?: number;
146
+ openapi?: GenerateOpenApiOptions;
147
+ swagger?: {
148
+ ui: boolean;
149
+ };
146
150
  }
147
151
 
148
152
  declare const commonContainer: {
@@ -175,6 +179,7 @@ declare const typeContainer: {
175
179
  setControllerJsonSchema(classInfo: ClassTypeInfo): void;
176
180
  getControllersJsonSchema(): ClassTypeInfo[];
177
181
  setClassMetaInfo(typeMeta: TypeMeta): void;
182
+ getClassMetaInfo(): TypeMeta[];
178
183
  getRoutes(): any;
179
184
  getControllerJsonSchema(name: string): ClassTypeInfo;
180
185
  removeControllerInfo(path: string): void;
package/dist/index.mjs CHANGED
@@ -83,7 +83,7 @@ const typeContainer = new class {
83
83
  this.controllerInfo = /* @__PURE__ */ new Map();
84
84
  this.files = /* @__PURE__ */ new Map();
85
85
  this.routes = {};
86
- this.modelSchemas = /* @__PURE__ */ new Map();
86
+ this.modelSchemas = new Array();
87
87
  }
88
88
  setControllerJsonSchema(classInfo) {
89
89
  const className = this.files.get(classInfo.filePath);
@@ -106,7 +106,10 @@ const typeContainer = new class {
106
106
  return controllerName.substr(0, controllerName.length - 10).toLowerCase();
107
107
  }
108
108
  setClassMetaInfo(typeMeta) {
109
- this.modelSchemas.set(typeMeta.name, typeMeta);
109
+ this.modelSchemas.push(typeMeta);
110
+ }
111
+ getClassMetaInfo() {
112
+ return this.modelSchemas;
110
113
  }
111
114
  getRoutes() {
112
115
  const routes = {};
@@ -132,6 +135,7 @@ const typeContainer = new class {
132
135
  templateInfo[httpMethod][route] = { name: method.name, parameters, returnType: method.returnType };
133
136
  }
134
137
  routes[templateInfo.route] = templateInfo;
138
+ routes[templateInfo.route].jsDoc = classInfo.jsDoc;
135
139
  }
136
140
  return routes;
137
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nattyjs/common",
3
- "version": "0.0.1-beta.54",
3
+ "version": "0.0.1-beta.55",
4
4
  "description": "Now I’m the model of a modern major general / The venerated Virginian veteran whose men are all / Lining up, to put me up on a pedestal / Writin’ letters to relatives / Embellishin’ my elegance and eloquence / But the elephant is in the room / The truth is in ya face when ya hear the British cannons go / BOOM",
5
5
  "keywords": [],
6
6
  "author": "ajayojha <ojhaajay@outlook.com>",
@@ -21,7 +21,7 @@
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/node": "20.3.1",
24
- "@nattyjs/types": "0.0.1-beta.54",
24
+ "@nattyjs/types": "0.0.1-beta.55",
25
25
  "unbuild": "1.2.1"
26
26
  }
27
27
  }