@creator.co/wapi 1.7.7 → 1.7.8-alpha

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator.co/wapi",
3
- "version": "1.7.7",
3
+ "version": "1.7.8-alpha",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -36,25 +36,35 @@ export interface Route<InputType = never, OutputType = never, PathParamsType = S
36
36
  handler: TransactionExecution<Transaction<InputType, OutputType | ResponseErrorType, never, PathParamsType, QueryParamsType>, OutputType | ResponseErrorType>;
37
37
  /**
38
38
  * An optional input schema for validating the structure of the input data.
39
- * Description placeholder
40
39
  *
41
40
  * @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
42
41
  */
43
42
  inputSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>;
44
43
  /**
45
44
  * An optional input schema for validating the structure of the path params.
46
- * Description placeholder
47
45
  *
48
46
  * @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
49
47
  */
50
48
  pathSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>;
51
49
  /**
52
50
  * An optional input schema for validating the structure of the query params.
53
- * Description placeholder
54
51
  *
55
52
  * @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
56
53
  */
57
54
  querySchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>;
55
+ /**
56
+ * An optional openApi object with extra metadata for docs generation.
57
+ */
58
+ openApi?: {
59
+ summary: string;
60
+ description: string;
61
+ tags?: string[];
62
+ outputSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodType<any>;
63
+ successCode?: number;
64
+ security?: {
65
+ [key: string]: string[] | never[];
66
+ }[];
67
+ };
58
68
  }
59
69
  export type AnyRoute = Route<any | never, any | never, any | never, any | never>;
60
70
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../src/Server/Router.ts"],"names":[],"mappings":"AAKA,OAAO,eAAe,MAAM,0BAA0B,CAAA;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAQpC,OAAO,KAAK,MAAM,kBAAkB,CAAA;AA4HpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IAUzB;;;;OAIG;IACH,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;IACrF,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAA;IAChC,CAAC;IAED;;;OAGG;IACK,WAAW;QACjB,OAAO,KAAK,CAAC,qBAAqB,EAAE,CAAA;IACtC,CAAC;CACF"}
1
+ {"version":3,"file":"Router.js","sourceRoot":"","sources":["../../../src/Server/Router.ts"],"names":[],"mappings":"AAKA,OAAO,eAAe,MAAM,0BAA0B,CAAA;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAAA;AAQpC,OAAO,KAAK,MAAM,kBAAkB,CAAA;AA0IpC;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,MAAM;IAUzB;;;;OAIG;IACH,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;IACrF,CAAC;IAED;;;OAGG;IACI,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAA;IAChC,CAAC;IAED;;;OAGG;IACK,WAAW;QACjB,OAAO,KAAK,CAAC,qBAAqB,EAAE,CAAA;IACtC,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@creator.co/wapi",
3
- "version": "1.7.7",
3
+ "version": "1.7.8-alpha",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -59,7 +59,6 @@ export interface Route<
59
59
  >
60
60
  /**
61
61
  * An optional input schema for validating the structure of the input data.
62
- * Description placeholder
63
62
  *
64
63
  * @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
65
64
  */
@@ -67,7 +66,6 @@ export interface Route<
67
66
 
68
67
  /**
69
68
  * An optional input schema for validating the structure of the path params.
70
- * Description placeholder
71
69
  *
72
70
  * @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
73
71
  */
@@ -75,11 +73,27 @@ export interface Route<
75
73
 
76
74
  /**
77
75
  * An optional input schema for validating the structure of the query params.
78
- * Description placeholder
79
76
  *
80
77
  * @type {?z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>}
81
78
  */
82
79
  querySchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any>
80
+
81
+ /**
82
+ * An optional openApi object with extra metadata for docs generation.
83
+ */
84
+ openApi?: {
85
+ // Descriptive
86
+ summary: string
87
+ description: string
88
+ tags?: string[]
89
+ // Response
90
+ outputSchema?: z.ZodObject<any> | z.ZodUnion<any> | z.ZodIntersection<any, any> | z.ZodType<any>
91
+ successCode?: number /* defaults to 200 */
92
+ // Sec
93
+ security?: {
94
+ [key: string]: string[] | never[]
95
+ }[]
96
+ }
83
97
  }
84
98
 
85
99
  export type AnyRoute = Route<any | never, any | never, any | never, any | never>