@nattyjs/types 0.0.1-beta.7 → 0.0.1-beta.70

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +166 -34
  2. package/package.json +3 -2
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ interface TypeInfo {
7
7
  name: string;
8
8
  documentation?: string;
9
9
  type?: string;
10
+ tokenKey?: string;
10
11
  }
11
12
 
12
13
  interface ParameterInfo {
@@ -26,6 +27,7 @@ interface ClassTypeInfo extends TypeInfo {
26
27
  methods?: MethodInfo[];
27
28
  properties?: TypeInfo[];
28
29
  route?: DecoratorInfo;
30
+ jsDoc?: any;
29
31
  }
30
32
 
31
33
  interface BuildOptions {
@@ -33,6 +35,9 @@ interface BuildOptions {
33
35
  rootDir: string;
34
36
  port: number;
35
37
  commandName: string;
38
+ outDir?: string;
39
+ startupFilePath?: string;
40
+ clearScreen?: boolean;
36
41
  }
37
42
 
38
43
  type HttpRequestBodyInfo = {
@@ -41,6 +46,7 @@ type HttpRequestBodyInfo = {
41
46
  number?: number | number[];
42
47
  boolean?: boolean | boolean[];
43
48
  FormData?: FormData;
49
+ buffer?: any;
44
50
  ArrayBuffer?: ArrayBuffer;
45
51
  Blob?: Blob;
46
52
  json?: {
@@ -89,6 +95,7 @@ interface HttpResponseInit {
89
95
  headers?: HeadersInit;
90
96
  cookies?: Cookie[];
91
97
  enableContentNegotiation?: boolean;
98
+ isBuffer?: boolean;
92
99
  }
93
100
 
94
101
  interface NattyTestModule {
@@ -113,47 +120,32 @@ type ExceptionTypeInfo = string | number | boolean | {
113
120
 
114
121
  interface RouteConfig {
115
122
  controller: Function;
116
- parameters: Array<{
117
- name: string;
118
- type: string;
119
- }>;
123
+ parameters: TypeInfo[];
120
124
  get: {
121
125
  [key: string]: {
122
126
  name: string;
123
- parameters: Array<{
124
- name: string;
125
- type: string;
126
- }>;
127
+ parameters: TypeInfo[];
127
128
  returnType: string;
128
129
  };
129
130
  };
130
131
  post: {
131
132
  [key: string]: {
132
133
  name: string;
133
- parameters: Array<{
134
- name: string;
135
- type: string;
136
- }>;
134
+ parameters: TypeInfo[];
137
135
  returnType: string;
138
136
  };
139
137
  };
140
138
  put: {
141
139
  [key: string]: {
142
140
  name: string;
143
- parameters: Array<{
144
- name: string;
145
- type: string;
146
- }>;
141
+ parameters: TypeInfo[];
147
142
  returnType: string;
148
143
  };
149
144
  };
150
145
  delete: {
151
146
  [key: string]: {
152
147
  name: string;
153
- parameters: Array<{
154
- name: string;
155
- type: string;
156
- }>;
148
+ parameters: TypeInfo[];
157
149
  returnType: string;
158
150
  };
159
151
  };
@@ -249,10 +241,7 @@ interface RequestRouteInfo {
249
241
  path: string;
250
242
  methodInfo: MethodInfo;
251
243
  controller: any;
252
- parameters: Array<{
253
- name: string;
254
- type: string;
255
- }>;
244
+ parameters: TypeInfo[];
256
245
  configuredRoutePath: string;
257
246
  queryParams: {
258
247
  [key: string]: any;
@@ -262,16 +251,159 @@ interface RequestRouteInfo {
262
251
  };
263
252
  }
264
253
 
265
- interface PackageJsonConfig {
266
- addExports: string[];
267
- }
254
+ type ValidatorMeta = {
255
+ kind: "required";
256
+ options?: any;
257
+ } | {
258
+ kind: "minLength";
259
+ value: number;
260
+ } | {
261
+ kind: "maxLength";
262
+ value: number;
263
+ } | {
264
+ kind: "min";
265
+ value: number;
266
+ } | {
267
+ kind: "max";
268
+ value: number;
269
+ } | {
270
+ kind: "regex";
271
+ pattern: string;
272
+ flags?: string;
273
+ } | {
274
+ kind: "email";
275
+ } | {
276
+ kind: "url";
277
+ } | {
278
+ kind: "ip";
279
+ } | {
280
+ kind: "enum";
281
+ values: (string | number)[];
282
+ } | {
283
+ kind: "custom";
284
+ name: string;
285
+ args?: any[];
286
+ };
268
287
 
269
- interface LibraryConfig {
270
- packageJson: PackageJsonConfig;
271
- }
288
+ type PropertyMeta = {
289
+ name: string;
290
+ type: "string" | "number" | "boolean" | "object" | "array";
291
+ ref?: string;
292
+ itemsType?: "string" | "number" | "boolean" | "object";
293
+ itemsRef?: string;
294
+ optional?: boolean;
295
+ enumValues?: (string | number)[];
296
+ validators?: ValidatorMeta[];
297
+ defaultValue?: any;
298
+ defaultValueText?: string;
299
+ };
272
300
 
273
- interface NattyCliConfig {
274
- library: Partial<LibraryConfig>;
275
- }
301
+ type TypeMeta = {
302
+ kind: "object";
303
+ name: string;
304
+ properties: PropertyMeta[];
305
+ } | {
306
+ kind: "enum";
307
+ name: string;
308
+ baseType: "string" | "number";
309
+ enumValues: (string | number)[];
310
+ };
311
+
312
+ type JsDocExample = {
313
+ kind: "request" | "response";
314
+ value: string;
315
+ };
316
+
317
+ type JsDocHeader = {
318
+ name: string;
319
+ required: boolean;
320
+ type?: string;
321
+ description?: string;
322
+ };
323
+
324
+ type JsDocParam = {
325
+ name: string;
326
+ type?: string;
327
+ description?: string;
328
+ };
329
+
330
+ type JsDocResponse = {
331
+ status: number;
332
+ description?: string;
333
+ type?: string;
334
+ };
335
+
336
+ type JsDocThrow = {
337
+ status?: number;
338
+ description?: string;
339
+ };
340
+
341
+ type JsDocInfo = {
342
+ summary?: string;
343
+ description?: string;
344
+ tags?: string[];
345
+ params?: JsDocParam[];
346
+ returns?: string;
347
+ headers?: JsDocHeader[];
348
+ security?: string[];
349
+ responses?: JsDocResponse[];
350
+ throws?: JsDocThrow[];
351
+ examples?: JsDocExample[];
352
+ deprecated?: string | true;
353
+ custom?: Record<string, string[]>;
354
+ };
355
+
356
+ type RouteParamMeta = {
357
+ name: string;
358
+ in: "path" | "query";
359
+ required: boolean;
360
+ tsType?: string;
361
+ };
362
+
363
+ type RouteMeta = {
364
+ method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
365
+ path: string;
366
+ controller: string;
367
+ action: string;
368
+ params?: RouteParamMeta[];
369
+ requestBody?: {
370
+ name: string;
371
+ tsType: string;
372
+ required?: boolean;
373
+ };
374
+ responseType?: string;
375
+ doc?: JsDocInfo;
376
+ auth?: {
377
+ isAnonymous?: boolean;
378
+ schemes?: string[];
379
+ };
380
+ };
381
+
382
+ type ClassDocBundle = {
383
+ className: string;
384
+ classDoc: JsDocInfo;
385
+ methods: Array<{
386
+ name: string;
387
+ doc: JsDocInfo;
388
+ }>;
389
+ properties: Array<{
390
+ name: string;
391
+ doc: JsDocInfo;
392
+ }>;
393
+ };
394
+
395
+ type GenerateOpenApiOptions = {
396
+ title: string;
397
+ version: string;
398
+ serverUrl?: string;
399
+ apiPrefix?: string;
400
+ includeApiPrefix?: boolean;
401
+ globalHeaders?: Array<{
402
+ name: string;
403
+ required?: boolean;
404
+ description?: string;
405
+ }>;
406
+ strict?: boolean;
407
+ };
276
408
 
277
- export { BuildOptions, ClassTypeInfo, Cookie, DbFieldConfig, DecoratorInfo, DecoratorParams, ExceptionTypeInfo, HttpRequestBodyInfo, HttpRequestBodyInit, HttpRequestInit, HttpResponseInit, IExceptionContext, IHttpResult, IModelBindingContext, MethodInfo, ModelBinding, ModelConfig, NattyCliConfig, NattyTestModule, ParameterInfo, ProblemDetail, PropConfig, PropertyDecoratorConfig, RequestRouteInfo, RouteConfig, TypeInfo, TypesInfo };
409
+ export { BuildOptions, ClassDocBundle, ClassTypeInfo, Cookie, DbFieldConfig, DecoratorInfo, DecoratorParams, ExceptionTypeInfo, GenerateOpenApiOptions, HttpRequestBodyInfo, HttpRequestBodyInit, HttpRequestInit, HttpResponseInit, IExceptionContext, IHttpResult, IModelBindingContext, JsDocHeader, JsDocInfo, JsDocParam, JsDocResponse, JsDocThrow, MethodInfo, ModelBinding, ModelConfig, NattyTestModule, ParameterInfo, ProblemDetail, PropConfig, PropertyDecoratorConfig, PropertyMeta, RequestRouteInfo, RouteConfig, RouteMeta, TypeInfo, TypeMeta, TypesInfo, ValidatorMeta };
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@nattyjs/types",
3
- "version": "0.0.1-beta.7",
3
+ "version": "0.0.1-beta.70",
4
4
  "keywords": [],
5
5
  "author": "ajayojha <ojhaajay@outlook.com>",
6
6
  "license": "ISC",
7
7
  "description": "",
8
- "main": "./dist/index.d.ts",
8
+ "module": "./dist/index.mjs",
9
+ "main": "./dist/index.cjs",
9
10
  "types": "./dist/index.d.ts",
10
11
  "files": [
11
12
  "dist"