vls-openapi-generator 1.10.1 → 1.12.0

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.
@@ -47,6 +47,13 @@ const HANDLERS_DIR = path.join(process.cwd(), 'dist', 'src', 'handlers');
47
47
  const SCHEMAS_DIR = path.join(process.cwd(), 'dist', 'src', 'schemas');
48
48
  const OUTPUT_FILE = path.join(process.cwd(), 'openapi.json');
49
49
  const generateOpenAPI = async () => {
50
+ await (0, util_1.promisify)(child_process_1.exec)('rm -rf ./dist');
51
+ await (0, util_1.promisify)(child_process_1.exec)('npx tsc');
52
+ const handlerFiles = await fs_1.promises.readdir(HANDLERS_DIR).catch(() => []);
53
+ if (handlerFiles.length === 0) {
54
+ console.log('No handler found in handlers folder.');
55
+ return;
56
+ }
50
57
  console.info('Generating Open API documentation...');
51
58
  const args = process.argv;
52
59
  const params = {};
@@ -65,9 +72,6 @@ const generateOpenAPI = async () => {
65
72
  i += 2;
66
73
  }
67
74
  }
68
- await (0, util_1.promisify)(child_process_1.exec)('rm -rf ./dist');
69
- await (0, util_1.promisify)(child_process_1.exec)('npx tsc');
70
- const handlerFiles = await fs_1.promises.readdir(HANDLERS_DIR);
71
75
  const existingOpenAPIFile = JSON.parse(await fs_1.promises.readFile(OPENAPI_FILE, 'utf-8'));
72
76
  existingOpenAPIFile.paths = {};
73
77
  for (const handler of handlerFiles) {
@@ -26,13 +26,13 @@ export declare class PostmanService {
26
26
  };
27
27
  }>;
28
28
  createCollection: (partnerName: string) => Promise<string>;
29
- deleteFolder: (collectionID: string, folderID: string) => Promise<import("axios").AxiosResponse<any, any>>;
30
- createFolder: (collectionID: string, folderName: string) => Promise<import("axios").AxiosResponse<any, any>>;
31
- updateCollection: (collectionID: string, collection: object) => Promise<import("axios").AxiosResponse<any, any>>;
29
+ deleteFolder: (collectionID: string, folderID: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
30
+ createFolder: (collectionID: string, folderName: string) => Promise<import("axios").AxiosResponse<any, any, {}>>;
31
+ updateCollection: (collectionID: string, collection: object) => Promise<import("axios").AxiosResponse<any, any, {}>>;
32
32
  updateVariablesCollection: (collectionID: string, variables: {
33
33
  key: string;
34
34
  value: string;
35
- }[]) => Promise<import("axios").AxiosResponse<any, any>>;
35
+ }[]) => Promise<import("axios").AxiosResponse<any, any, {}>>;
36
36
  getAllEnvironments: () => Promise<{
37
37
  environments: {
38
38
  id: string;
@@ -42,9 +42,9 @@ export declare class PostmanService {
42
42
  createEnvironment: (name: string, values: {
43
43
  key: string;
44
44
  value: string;
45
- }[]) => Promise<import("axios").AxiosResponse<any, any>>;
45
+ }[]) => Promise<import("axios").AxiosResponse<any, any, {}>>;
46
46
  updateEnvironment: (id: string, name: string, values: {
47
47
  key: string;
48
48
  value: string;
49
- }[]) => Promise<import("axios").AxiosResponse<any, any>>;
49
+ }[]) => Promise<import("axios").AxiosResponse<any, any, {}>>;
50
50
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vls-openapi-generator",
3
- "version": "1.10.1",
3
+ "version": "1.12.0",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "dependencies": {
18
18
  "@anatine/zod-openapi": "^2.2.7",
19
19
  "@aws-sdk/client-cloudformation": "^3.817.0",
20
- "axios": "^1.7.9",
20
+ "axios": "^1.12.0",
21
21
  "module-alias": "^2.2.3",
22
22
  "openapi-to-postmanv2": "^4.25.0"
23
23
  },
@@ -19,6 +19,17 @@ const SCHEMAS_DIR = path.join(process.cwd(), 'dist', 'src', 'schemas');
19
19
  const OUTPUT_FILE = path.join(process.cwd(), 'openapi.json');
20
20
 
21
21
  export const generateOpenAPI = async (): Promise<void> => {
22
+ await promisify(exec)('rm -rf ./dist');
23
+ await promisify(exec)('npx tsc');
24
+
25
+ const handlerFiles = await fs.readdir(HANDLERS_DIR).catch(() => []);
26
+
27
+ if (handlerFiles.length === 0) {
28
+ console.log('No handler found in handlers folder.');
29
+
30
+ return;
31
+ }
32
+
22
33
  console.info('Generating Open API documentation...');
23
34
 
24
35
  const args = process.argv;
@@ -41,10 +52,6 @@ export const generateOpenAPI = async (): Promise<void> => {
41
52
  }
42
53
  }
43
54
 
44
- await promisify(exec)('rm -rf ./dist');
45
- await promisify(exec)('npx tsc');
46
-
47
- const handlerFiles = await fs.readdir(HANDLERS_DIR);
48
55
  const existingOpenAPIFile = JSON.parse(await fs.readFile(OPENAPI_FILE, 'utf-8')) as OpenAPI;
49
56
 
50
57
  existingOpenAPIFile.paths = {};