@nattyjs/common 0.0.1-beta.54 → 0.0.1-beta.56
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 +7 -3
- package/dist/index.d.ts +8 -2
- package/dist/index.mjs +7 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -49,7 +49,7 @@ const commonContainer = new class {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
const secureConfig = { sensitiveProps: ["password", "mobileNo", "email"] };
|
|
52
|
-
this.nattyConfig = { ...{ api: { rootPath: "api" }, autoGeneratePort: true, modelBinding, globalConfig: {}, secure: secureConfig }, ...config };
|
|
52
|
+
this.nattyConfig = { ...{ api: { rootPath: "api" }, ...{ static: { dir: "public", enabled: true } }, autoGeneratePort: true, modelBinding, globalConfig: {}, secure: secureConfig }, ...config };
|
|
53
53
|
}
|
|
54
54
|
setupBuildOptions(options) {
|
|
55
55
|
this.buildOptions = options;
|
|
@@ -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 =
|
|
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.
|
|
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 {
|
|
@@ -109,10 +109,11 @@ interface NattyConfig {
|
|
|
109
109
|
lifeCycle?: LifeCycleEvents;
|
|
110
110
|
webSchedules?: Array<WebScheduleConfig>;
|
|
111
111
|
static?: {
|
|
112
|
-
dir
|
|
112
|
+
dir?: string;
|
|
113
113
|
indexFile?: string;
|
|
114
114
|
spaFallback?: boolean;
|
|
115
115
|
maxAge?: string | number;
|
|
116
|
+
enabled?: boolean;
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
119
|
|
|
@@ -143,6 +144,10 @@ interface NattyCliConfig {
|
|
|
143
144
|
env?: Partial<EnvConfig>;
|
|
144
145
|
runner?: ClassType<AbstractRunner>;
|
|
145
146
|
port?: number;
|
|
147
|
+
openapi?: GenerateOpenApiOptions;
|
|
148
|
+
swagger?: {
|
|
149
|
+
ui: boolean;
|
|
150
|
+
};
|
|
146
151
|
}
|
|
147
152
|
|
|
148
153
|
declare const commonContainer: {
|
|
@@ -175,6 +180,7 @@ declare const typeContainer: {
|
|
|
175
180
|
setControllerJsonSchema(classInfo: ClassTypeInfo): void;
|
|
176
181
|
getControllersJsonSchema(): ClassTypeInfo[];
|
|
177
182
|
setClassMetaInfo(typeMeta: TypeMeta): void;
|
|
183
|
+
getClassMetaInfo(): TypeMeta[];
|
|
178
184
|
getRoutes(): any;
|
|
179
185
|
getControllerJsonSchema(name: string): ClassTypeInfo;
|
|
180
186
|
removeControllerInfo(path: string): void;
|
package/dist/index.mjs
CHANGED
|
@@ -32,7 +32,7 @@ const commonContainer = new class {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
const secureConfig = { sensitiveProps: ["password", "mobileNo", "email"] };
|
|
35
|
-
this.nattyConfig = { ...{ api: { rootPath: "api" }, autoGeneratePort: true, modelBinding, globalConfig: {}, secure: secureConfig }, ...config };
|
|
35
|
+
this.nattyConfig = { ...{ api: { rootPath: "api" }, ...{ static: { dir: "public", enabled: true } }, autoGeneratePort: true, modelBinding, globalConfig: {}, secure: secureConfig }, ...config };
|
|
36
36
|
}
|
|
37
37
|
setupBuildOptions(options) {
|
|
38
38
|
this.buildOptions = options;
|
|
@@ -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 =
|
|
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.
|
|
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.
|
|
3
|
+
"version": "0.0.1-beta.56",
|
|
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.
|
|
24
|
+
"@nattyjs/types": "0.0.1-beta.56",
|
|
25
25
|
"unbuild": "1.2.1"
|
|
26
26
|
}
|
|
27
27
|
}
|