vls-openapi-generator 2.0.0 → 2.1.3
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/.eslintcache +1 -1
- package/dist/generate-openapi.d.ts +1 -1
- package/dist/generate-openapi.js +1 -1
- package/dist/upload-openapi.d.ts +1 -1
- package/dist/upload-openapi.js +4 -4
- package/package.json +8 -9
- package/release.config.js +2 -1
- package/src/generate-openapi.ts +1 -1
- package/src/upload-openapi.ts +7 -5
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/__w/
|
|
1
|
+
[{"/__w/volans-packages/volans-packages/.commitlintrc.js":"1","/__w/volans-packages/volans-packages/dist/generate-openapi.js":"2","/__w/volans-packages/volans-packages/dist/index.js":"3","/__w/volans-packages/volans-packages/dist/lambda-type.js":"4","/__w/volans-packages/volans-packages/dist/openapi-type.js":"5","/__w/volans-packages/volans-packages/dist/postman-service.js":"6","/__w/volans-packages/volans-packages/dist/upload-openapi.js":"7","/__w/volans-packages/volans-packages/eslint.config.mjs":"8","/__w/volans-packages/volans-packages/release.config.js":"9","/__w/volans-packages/volans-packages/src/generate-openapi.ts":"10","/__w/volans-packages/volans-packages/src/index.ts":"11","/__w/volans-packages/volans-packages/src/lambda-type.ts":"12","/__w/volans-packages/volans-packages/src/openapi-type.ts":"13","/__w/volans-packages/volans-packages/src/postman-service.ts":"14","/__w/volans-packages/volans-packages/src/upload-openapi.ts":"15"},{"size":103,"mtime":1787578071366,"results":"16","hashOfConfig":"17"},{"size":9429,"mtime":1787578087366,"results":"18","hashOfConfig":"17"},{"size":530,"mtime":1787578087426,"results":"19","hashOfConfig":"17"},{"size":77,"mtime":1787578087326,"results":"20","hashOfConfig":"17"},{"size":77,"mtime":1787578087336,"results":"21","hashOfConfig":"17"},{"size":3073,"mtime":1787578087376,"results":"22","hashOfConfig":"17"},{"size":5434,"mtime":1787578087426,"results":"23","hashOfConfig":"17"},{"size":1247,"mtime":1787578071366,"results":"24","hashOfConfig":"17"},{"size":465,"mtime":1787578071366,"results":"25","hashOfConfig":"17"},{"size":9625,"mtime":1787578071366,"results":"26","hashOfConfig":"27"},{"size":441,"mtime":1787578071366,"results":"28","hashOfConfig":"27"},{"size":90,"mtime":1787578071366,"results":"29","hashOfConfig":"27"},{"size":1630,"mtime":1787578071366,"results":"30","hashOfConfig":"27"},{"size":3666,"mtime":1787578071366,"results":"31","hashOfConfig":"27"},{"size":4086,"mtime":1787578071366,"results":"32","hashOfConfig":"27"},{"filePath":"33","messages":"34","suppressedMessages":"35","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1gdz97e",{"filePath":"36","messages":"37","suppressedMessages":"38","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"39","messages":"40","suppressedMessages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"42","messages":"43","suppressedMessages":"44","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"45","messages":"46","suppressedMessages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"48","messages":"49","suppressedMessages":"50","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"51","messages":"52","suppressedMessages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"54","messages":"55","suppressedMessages":"56","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"57","messages":"58","suppressedMessages":"59","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"60","messages":"61","suppressedMessages":"62","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1ib11n3",{"filePath":"63","messages":"64","suppressedMessages":"65","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"66","messages":"67","suppressedMessages":"68","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"69","messages":"70","suppressedMessages":"71","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"72","messages":"73","suppressedMessages":"74","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"75","messages":"76","suppressedMessages":"77","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/__w/volans-packages/volans-packages/.commitlintrc.js",[],[],"/__w/volans-packages/volans-packages/dist/generate-openapi.js",[],[],"/__w/volans-packages/volans-packages/dist/index.js",[],[],"/__w/volans-packages/volans-packages/dist/lambda-type.js",[],[],"/__w/volans-packages/volans-packages/dist/openapi-type.js",[],[],"/__w/volans-packages/volans-packages/dist/postman-service.js",[],[],"/__w/volans-packages/volans-packages/dist/upload-openapi.js",[],[],"/__w/volans-packages/volans-packages/eslint.config.mjs",[],[],"/__w/volans-packages/volans-packages/release.config.js",[],[],"/__w/volans-packages/volans-packages/src/generate-openapi.ts",[],[],"/__w/volans-packages/volans-packages/src/index.ts",[],[],"/__w/volans-packages/volans-packages/src/lambda-type.ts",[],[],"/__w/volans-packages/volans-packages/src/openapi-type.ts",[],[],"/__w/volans-packages/volans-packages/src/postman-service.ts",[],[],"/__w/volans-packages/volans-packages/src/upload-openapi.ts",[],[]]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import 'module-alias/register
|
|
1
|
+
import 'module-alias/register';
|
|
2
2
|
export declare const generateOpenAPI: () => Promise<void>;
|
package/dist/generate-openapi.js
CHANGED
|
@@ -37,7 +37,7 @@ exports.generateOpenAPI = void 0;
|
|
|
37
37
|
const zod_openapi_1 = require("zod-openapi");
|
|
38
38
|
const node_child_process_1 = require("node:child_process");
|
|
39
39
|
const node_fs_1 = require("node:fs");
|
|
40
|
-
require("module-alias/register
|
|
40
|
+
require("module-alias/register");
|
|
41
41
|
const path = __importStar(require("node:path"));
|
|
42
42
|
const node_util_1 = require("node:util");
|
|
43
43
|
const zod_1 = require("zod");
|
package/dist/upload-openapi.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import 'module-alias/register
|
|
1
|
+
import 'module-alias/register';
|
|
2
2
|
export declare const uploadOpenAPI: () => Promise<void>;
|
package/dist/upload-openapi.js
CHANGED
|
@@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.uploadOpenAPI = void 0;
|
|
37
37
|
const fs_1 = require("fs");
|
|
38
|
-
require("module-alias/register
|
|
38
|
+
require("module-alias/register");
|
|
39
39
|
const openapi_to_postmanv2_1 = require("openapi-to-postmanv2");
|
|
40
40
|
const path = __importStar(require("path"));
|
|
41
41
|
const util_1 = require("util");
|
|
@@ -76,7 +76,7 @@ const uploadOpenAPI = async () => {
|
|
|
76
76
|
}
|
|
77
77
|
const postmanService = new postman_service_1.PostmanService(postmanToken, '489fad1b-5992-4ffe-8427-1f82f3ca0661');
|
|
78
78
|
const { collections } = await postmanService.getCollections();
|
|
79
|
-
let collectionID
|
|
79
|
+
let collectionID;
|
|
80
80
|
const stackCollection = collections.find((x) => x.name === partnerName);
|
|
81
81
|
if (!stackCollection) {
|
|
82
82
|
collectionID = await postmanService.createCollection(partnerName);
|
|
@@ -99,8 +99,8 @@ const uploadOpenAPI = async () => {
|
|
|
99
99
|
}, {
|
|
100
100
|
folderStrategy: 'Tags'
|
|
101
101
|
});
|
|
102
|
-
if (!converted.
|
|
103
|
-
throw new Error(
|
|
102
|
+
if (!converted?.result || !converted.output?.length) {
|
|
103
|
+
throw new Error(`Failed to convert Open API to Postman collection${converted?.reason ? `: ${converted.reason}` : ''}`);
|
|
104
104
|
}
|
|
105
105
|
const convertedData = converted.output[0].data;
|
|
106
106
|
for (const item of collection.collection.item) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vls-openapi-generator",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -16,26 +16,25 @@
|
|
|
16
16
|
"description": "VLS Open API Generator",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"module-alias": "^2.2.3",
|
|
19
|
-
"openapi-to-postmanv2": "^
|
|
19
|
+
"openapi-to-postmanv2": "^6.3.3",
|
|
20
20
|
"zod": "^4.2.1",
|
|
21
21
|
"zod-openapi": "^5.4.5"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@commitlint/config-conventional": "^19.5.0",
|
|
25
|
-
"@eslint/js": "^
|
|
25
|
+
"@eslint/js": "^10.0.1",
|
|
26
26
|
"@semantic-release/git": "^10.0.1",
|
|
27
|
-
"@semantic-release/npm": "^
|
|
27
|
+
"@semantic-release/npm": "^13.1.5",
|
|
28
28
|
"@types/node": "^20.14.8",
|
|
29
|
-
"@types/openapi-to-postmanv2": "^3.2.4",
|
|
30
29
|
"axios": "^1.8.3",
|
|
31
30
|
"commitlint": "^19.5.0",
|
|
32
|
-
"eslint": "^
|
|
31
|
+
"eslint": "^10.3.0",
|
|
33
32
|
"husky": "^9.1.6",
|
|
34
33
|
"prettier": "^2.7.1",
|
|
35
|
-
"semantic-release": "^
|
|
34
|
+
"semantic-release": "^25.0.3",
|
|
36
35
|
"typescript": "^5.6.3",
|
|
37
|
-
"typescript-eslint": "^8.
|
|
38
|
-
"vls-sam-template-generator": "^2.
|
|
36
|
+
"typescript-eslint": "^8.59.2",
|
|
37
|
+
"vls-sam-template-generator": "^2.23.1"
|
|
39
38
|
},
|
|
40
39
|
"bin": {
|
|
41
40
|
"vls-openapi-generator": "dist/index.js"
|
package/release.config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
branches: ['openapi-generator'],
|
|
3
|
+
tagFormat: 'vls-openapi-generator-v${version}',
|
|
3
4
|
plugins: [
|
|
4
5
|
'@semantic-release/commit-analyzer',
|
|
5
6
|
'@semantic-release/release-notes-generator',
|
|
@@ -12,4 +13,4 @@ module.exports = {
|
|
|
12
13
|
}
|
|
13
14
|
]
|
|
14
15
|
]
|
|
15
|
-
};
|
|
16
|
+
};
|
package/src/generate-openapi.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createSchema, ZodOpenApiSchemaObject } from 'zod-openapi';
|
|
2
2
|
import { exec } from 'node:child_process';
|
|
3
3
|
import { promises as fs } from 'node:fs';
|
|
4
|
-
import 'module-alias/register
|
|
4
|
+
import 'module-alias/register';
|
|
5
5
|
import * as path from 'node:path';
|
|
6
6
|
import { promisify } from 'node:util';
|
|
7
7
|
import { z } from 'zod';
|
package/src/upload-openapi.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { promises as fs } from 'fs';
|
|
2
|
-
import 'module-alias/register
|
|
2
|
+
import 'module-alias/register';
|
|
3
3
|
import { convert } from 'openapi-to-postmanv2';
|
|
4
4
|
import * as path from 'path';
|
|
5
5
|
import { promisify } from 'util';
|
|
@@ -54,7 +54,7 @@ export const uploadOpenAPI = async (): Promise<void> => {
|
|
|
54
54
|
|
|
55
55
|
const { collections } = await postmanService.getCollections();
|
|
56
56
|
|
|
57
|
-
let collectionID
|
|
57
|
+
let collectionID: string;
|
|
58
58
|
|
|
59
59
|
const stackCollection = collections.find((x) => x.name === partnerName);
|
|
60
60
|
|
|
@@ -92,11 +92,13 @@ export const uploadOpenAPI = async (): Promise<void> => {
|
|
|
92
92
|
}
|
|
93
93
|
);
|
|
94
94
|
|
|
95
|
-
if (!converted.
|
|
96
|
-
throw new Error(
|
|
95
|
+
if (!converted?.result || !converted.output?.length) {
|
|
96
|
+
throw new Error(
|
|
97
|
+
`Failed to convert Open API to Postman collection${converted?.reason ? `: ${converted.reason}` : ''}`
|
|
98
|
+
);
|
|
97
99
|
}
|
|
98
100
|
|
|
99
|
-
const convertedData = converted.output[0].data;
|
|
101
|
+
const convertedData = converted.output[0].data as { item?: object[] };
|
|
100
102
|
|
|
101
103
|
for (const item of collection.collection.item) {
|
|
102
104
|
if (item.name === environment) {
|