@necessarylion/adonis-autoswagger 0.0.13 → 0.0.15

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/example.d.ts CHANGED
@@ -60,61 +60,5 @@ export declare abstract class ExampleInterfaces {
60
60
  * Pagination interface
61
61
  * @returns
62
62
  */
63
- static paginationInterface(): {
64
- PaginationMeta: {
65
- type: string;
66
- properties: {
67
- total: {
68
- type: string;
69
- example: number;
70
- nullable: boolean;
71
- };
72
- page: {
73
- type: string;
74
- example: number;
75
- nullable: boolean;
76
- };
77
- perPage: {
78
- type: string;
79
- example: number;
80
- nullable: boolean;
81
- };
82
- currentPage: {
83
- type: string;
84
- example: number;
85
- nullable: boolean;
86
- };
87
- lastPage: {
88
- type: string;
89
- example: number;
90
- nullable: boolean;
91
- };
92
- firstPage: {
93
- type: string;
94
- example: number;
95
- nullable: boolean;
96
- };
97
- lastPageUrl: {
98
- type: string;
99
- example: string;
100
- nullable: boolean;
101
- };
102
- firstPageUrl: {
103
- type: string;
104
- example: string;
105
- nullable: boolean;
106
- };
107
- nextPageUrl: {
108
- type: string;
109
- example: string;
110
- nullable: boolean;
111
- };
112
- previousPageUrl: {
113
- type: string;
114
- example: string;
115
- nullable: boolean;
116
- };
117
- };
118
- };
119
- };
63
+ static paginationInterface(snakeCase?: boolean): Record<string, any>;
120
64
  }
package/dist/example.js CHANGED
@@ -362,7 +362,38 @@ class ExampleInterfaces {
362
362
  * Pagination interface
363
363
  * @returns
364
364
  */
365
- static paginationInterface() {
365
+ static paginationInterface(snakeCase = false) {
366
+ if (snakeCase) {
367
+ return {
368
+ PaginationMeta: {
369
+ type: "object",
370
+ properties: {
371
+ total: { type: "number", example: 100, nullable: false },
372
+ page: { type: "number", example: 2, nullable: false },
373
+ per_page: { type: "number", example: 10, nullable: false },
374
+ current_page: { type: "number", example: 3, nullable: false },
375
+ last_page: { type: "number", example: 10, nullable: false },
376
+ first_page: { type: "number", example: 1, nullable: false },
377
+ last_page_url: {
378
+ type: "string",
379
+ example: "/?page=10",
380
+ nullable: false,
381
+ },
382
+ first_page_url: {
383
+ type: "string",
384
+ example: "/?page=1",
385
+ nullable: false,
386
+ },
387
+ next_page_url: { type: "string", example: "/?page=6", nullable: false },
388
+ previous_page_url: {
389
+ type: "string",
390
+ example: "/?page=5",
391
+ nullable: false,
392
+ },
393
+ },
394
+ },
395
+ };
396
+ }
366
397
  return {
367
398
  PaginationMeta: {
368
399
  type: "object",
package/dist/schema.js CHANGED
@@ -90,7 +90,7 @@ class SchemaService {
90
90
  }
91
91
  catch (e) {
92
92
  console.log("**You are probably using 'node ace serve --hmr', which is not supported yet. Use 'node ace serve --watch' instead.**");
93
- console.error(e.message);
93
+ console.error(e);
94
94
  }
95
95
  return validators;
96
96
  }
@@ -187,7 +187,7 @@ class SchemaService {
187
187
  */
188
188
  async getInterfaces() {
189
189
  let interfaces = {
190
- ...example_1.ExampleInterfaces.paginationInterface(),
190
+ ...example_1.ExampleInterfaces.paginationInterface(this.options.snakeCase),
191
191
  };
192
192
  let p = path_1.default.join(this.options.appPath, "Interfaces");
193
193
  let p6 = path_1.default.join(this.options.appPath, "interfaces");
package/dist/types.d.ts CHANGED
@@ -20,6 +20,7 @@ export interface options {
20
20
  productionEnv?: string;
21
21
  authMiddlewares?: string[];
22
22
  defaultSecurityScheme?: string;
23
+ pagniationData?: Record<string, any>;
23
24
  }
24
25
  export interface common {
25
26
  headers: any;
package/dist/ui.js CHANGED
@@ -115,9 +115,8 @@ class UIService {
115
115
  <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
116
116
  <script>
117
117
  Scalar.createApiReference('#app', {
118
- persistAuth: ${options?.persistAuthorization},
118
+ persistAuth: true,
119
119
  url: '${url}',
120
- proxyUrl: '${proxyUrl}',
121
120
  expandAllResponses: true,
122
121
  authentication: {
123
122
  preferredSecurityScheme: '${options?.defaultSecurityScheme}',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@necessarylion/adonis-autoswagger",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "Auto-Generate swagger docs for AdonisJS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",