@krlwlfrt/omeco
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -0,1 +1,5 @@ | ||
# [0.4.0](https://gitlab.com/krlwlfrt/omeco/compare/v0.3.0...v0.4.0) (2021-02-22) | ||
# [0.3.0](https://gitlab.com/krlwlfrt/omeco/compare/v0.2.0...v0.3.0) (2020-05-15) | ||
@@ -2,0 +6,0 @@ |
@@ -1,13 +0,3 @@ | ||
/// <reference types="node" /> | ||
import { readFile, writeFile } from 'fs'; | ||
import { convertableToString } from 'xml2js'; | ||
/** | ||
* Async version of readFile | ||
*/ | ||
export declare const asyncReadFile: typeof readFile.__promisify__; | ||
/** | ||
* Async version of writeFile | ||
*/ | ||
export declare const asyncWriteFile: typeof writeFile.__promisify__; | ||
/** | ||
* Async version of parseString | ||
@@ -14,0 +4,0 @@ * |
@@ -26,15 +26,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.asyncParseString = exports.asyncWriteFile = exports.asyncReadFile = void 0; | ||
const fs_1 = require("fs"); | ||
const util_1 = require("util"); | ||
exports.asyncParseString = void 0; | ||
const xml2js_1 = require("xml2js"); | ||
/** | ||
* Async version of readFile | ||
*/ | ||
exports.asyncReadFile = util_1.promisify(fs_1.readFile); | ||
/** | ||
* Async version of writeFile | ||
*/ | ||
exports.asyncWriteFile = util_1.promisify(fs_1.writeFile); | ||
/** | ||
* Async version of parseString | ||
@@ -59,2 +49,2 @@ * | ||
exports.asyncParseString = asyncParseString; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXN5bmMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvYXN5bmMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7Ozs7Ozs7Ozs7OztBQUVILDJCQUF1QztBQUN2QywrQkFBK0I7QUFDL0IsbUNBQXdEO0FBRXhEOztHQUVHO0FB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QUcsWUFBWSxLQUFLLEVBQUU7b0JBQ3hCLE1BQU0sQ0FBQyxHQUFHLENBQUMsQ0FBQztpQkFDYjtxQkFBTTtvQkFDTCxPQUFPLENBQUMsTUFBTSxDQUFDLENBQUM7aUJBQ2pCO1lBQ0gsQ0FBQyxDQUFDLENBQUM7UUFDTCxDQUFDLENBQUMsQ0FBQztJQUNMLENBQUM7Q0FBQTtBQVZELDRDQVVDIn0= |
@@ -30,2 +30,3 @@ #!/usr/bin/env node | ||
const fs_1 = require("fs"); | ||
const promises_1 = require("fs/promises"); | ||
const path_1 = require("path"); | ||
@@ -74,3 +75,3 @@ const async_1 = require("./async"); | ||
// read metadata file | ||
const buffer = yield async_1.asyncReadFile(metadataXml); | ||
const buffer = yield promises_1.readFile(metadataXml); | ||
// extract data | ||
@@ -81,4 +82,4 @@ const extractedData = yield extract_1.extractData(buffer.toString()); | ||
const convertedMetadata = yield async_1.asyncParseString(buffer.toString()); | ||
yield async_1.asyncWriteFile(`${targetFileName}.json`, JSON.stringify(convertedMetadata, null, common_1.INDENTATION)); | ||
yield async_1.asyncWriteFile(`${targetFileName}.extracted.json`, JSON.stringify(extractedData, null, common_1.INDENTATION)); | ||
yield promises_1.writeFile(`${targetFileName}.json`, JSON.stringify(convertedMetadata, null, common_1.INDENTATION)); | ||
yield promises_1.writeFile(`${targetFileName}.extracted.json`, JSON.stringify(extractedData, null, common_1.INDENTATION)); | ||
} | ||
@@ -98,5 +99,5 @@ // sort entities and properties by name | ||
// generate and compile TypeScript interfaces | ||
yield async_1.asyncWriteFile(`${targetFileName}.d.ts`, tsg_1.generateTypeScript(extractedData, common_1.generateName, compile_typescript_1.generatePropertyType)); | ||
yield promises_1.writeFile(`${targetFileName}.d.ts`, tsg_1.generateTypeScript(extractedData, common_1.generateName, compile_typescript_1.generatePropertyType)); | ||
// generate and compile PlantUML description | ||
yield async_1.asyncWriteFile(`${targetFileName}.puml`, compile_plantuml_1.compilePlantUml(extractedDataCopy)); | ||
yield promises_1.writeFile(`${targetFileName}.puml`, compile_plantuml_1.compilePlantUml(extractedDataCopy)); | ||
// generate PNG from PlantUML | ||
@@ -110,2 +111,2 @@ compile_plantuml_1.writePlantUmlPng(`${targetFileName}.puml`, `${targetFileName}.png`); | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NsaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7Ozs7Ozs7Ozs7Ozs7R0FhRzs7Ozs7Ozs7Ozs7QUFFSCx1Q0FBaUQ7QUFDakQseUNBQWtDO0FBQ2xDLDJCQUE0QztBQUM1QywrQkFBc0Q7QUFDdEQsbUNBQXdFO0FBQ3hFLHFDQUFtRDtBQUNuRCx5REFBcUU7QUFDckUsNkRBQTBEO0FBQzFELHVDQUFzQztBQUV0Qyw4QkFBOEI7QUFDOUIsTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLEtBQUssQ0FDeEIsaUJBQVksQ0FBQyxXQUFJLENBQUMsU0FBUyxFQUFFLElBQUksRUFBRSxjQUFjLENBQUMsQ0FBQztLQUNoRCxRQUFRLEVBQUUsQ0FDZCxDQUFDO0FBRUYsTUFBTSxTQUFTLEdBQUcsSUFBSSxtQkFBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDO0FBRXZDLFNBQVM7S0FDTixPQUFPLENBQUMsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQUFDLHFCQUFxQjtLQUM5QyxrQkFBa0IsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLDJCQUEyQjtBQUV6RCxTQUFTO0tBQ04sT0FBTyxDQUFDLG1DQUFtQyxDQUFDO0tBQzVDLFdBQVcsQ0FBQywwQkFBMEIsQ0FBQztLQUN2QyxNQUFNLENBQUMsYUFBYSxFQUFFLDhEQUE4RCxDQUFDO0tBQ3JGLE1BQU0sQ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BQztJQUU5RSw2QkFBNkI7SUFDN0IsbUNBQWdCLENBQUMsR0FBRyxjQUFjLE9BQU8sRUFBRSxHQUFHLGNBQWMsTUFBTSxDQUFDLENBQUM7QUFDdEUsQ0FBQyxDQUFBLENBQUMsQ0FBQztBQUVMLFNBQVM7S0FDTixLQUFLLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUFDO0FBRXZCLElBQUksU0FBUyxDQUFDLElBQUksQ0FBQyxNQUFNLEdBQUcsQ0FBQyxFQUFFO0lBQzdCLFNBQVMsQ0FBQyxJQUFJLEVBQUUsQ0FBQztDQUNsQiJ9 |
{ | ||
"name": "@krlwlfrt/omeco", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "OData metadata converter", | ||
@@ -16,30 +16,30 @@ "repository": { | ||
"dependencies": { | ||
"@krlwlfrt/tsg": "0.5.1", | ||
"@types/node": "10.17.21", | ||
"@types/xml2js": "0.4.5", | ||
"commander": "5.1.0", | ||
"@krlwlfrt/tsg": "0.6.1", | ||
"@types/xml2js": "0.4.8", | ||
"commander": "7.1.0", | ||
"xml2js": "0.4.23" | ||
}, | ||
"devDependencies": { | ||
"@openstapps/configuration": "0.24.0", | ||
"@types/chai": "4.2.11", | ||
"@types/chai-as-promised": "7.1.2", | ||
"@types/mocha": "7.0.2", | ||
"chai": "4.2.0", | ||
"@openstapps/configuration": "0.26.0", | ||
"@testdeck/mocha": "0.1.2", | ||
"@types/chai": "4.2.15", | ||
"@types/chai-as-promised": "7.1.3", | ||
"@types/mocha": "8.2.1", | ||
"@types/node": "14.14.31", | ||
"chai": "4.3.0", | ||
"chai-as-promised": "7.1.1", | ||
"conventional-changelog-cli": "2.0.34", | ||
"mocha": "7.1.2", | ||
"mocha-typescript": "1.1.17", | ||
"conventional-changelog-cli": "2.1.1", | ||
"mocha": "8.3.0", | ||
"node-plantuml": "0.9.0", | ||
"nyc": "15.0.1", | ||
"nyc": "15.1.0", | ||
"prepend-file-cli": "1.0.6", | ||
"rimraf": "3.0.2", | ||
"ts-node": "8.10.1", | ||
"ts-node": "9.1.1", | ||
"tslint": "6.1.2", | ||
"tslint-eslint-rules": "5.4.0", | ||
"typedoc": "0.17.6", | ||
"typescript": "3.9.2" | ||
"typedoc": "0.20.27", | ||
"typescript": "4.1.5" | ||
}, | ||
"peerDependencies": { | ||
"node-plantuml": "^0.8.0" | ||
"node-plantuml": "0.9.0" | ||
}, | ||
@@ -52,3 +52,3 @@ "scripts": { | ||
"prepublishOnly": "npm ci && npm run build", | ||
"test": "nyc mocha --require ts-node/register --ui mocha-typescript 'test/**/*.spec.ts'", | ||
"test": "nyc mocha --require ts-node/register 'test/**/*.spec.ts'", | ||
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'", | ||
@@ -102,3 +102,6 @@ "check-configuration": "openstapps-configuration", | ||
"forPackaging": false | ||
}, | ||
"engines": { | ||
"node": ">=14" | ||
} | ||
} |
@@ -16,16 +16,5 @@ /* | ||
import {readFile, writeFile} from 'fs'; | ||
import {promisify} from 'util'; | ||
import {convertableToString, parseString} from 'xml2js'; | ||
/** | ||
* Async version of readFile | ||
*/ | ||
export const asyncReadFile = promisify(readFile); | ||
/** | ||
* Async version of writeFile | ||
*/ | ||
export const asyncWriteFile = promisify(writeFile); | ||
/** | ||
* Async version of parseString | ||
@@ -32,0 +21,0 @@ * |
@@ -19,4 +19,5 @@ /* | ||
import {existsSync, readFileSync} from 'fs'; | ||
import {readFile, writeFile} from 'fs/promises'; | ||
import {basename, dirname, join, resolve} from 'path'; | ||
import {asyncParseString, asyncReadFile, asyncWriteFile} from './async'; | ||
import {asyncParseString} from './async'; | ||
import {generateName, INDENTATION} from './common'; | ||
@@ -73,3 +74,3 @@ import {compilePlantUml, writePlantUmlPng} from './compile-plantuml'; | ||
// read metadata file | ||
const buffer = await asyncReadFile(metadataXml); | ||
const buffer = await readFile(metadataXml); | ||
@@ -82,4 +83,4 @@ // extract data | ||
const convertedMetadata = await asyncParseString(buffer.toString()); | ||
await asyncWriteFile(`${targetFileName}.json`, JSON.stringify(convertedMetadata, null, INDENTATION)); | ||
await asyncWriteFile(`${targetFileName}.extracted.json`, JSON.stringify(extractedData, null, INDENTATION)); | ||
await writeFile(`${targetFileName}.json`, JSON.stringify(convertedMetadata, null, INDENTATION)); | ||
await writeFile(`${targetFileName}.extracted.json`, JSON.stringify(extractedData, null, INDENTATION)); | ||
} | ||
@@ -103,3 +104,3 @@ | ||
// generate and compile TypeScript interfaces | ||
await asyncWriteFile(`${targetFileName}.d.ts`, generateTypeScript( | ||
await writeFile(`${targetFileName}.d.ts`, generateTypeScript( | ||
extractedData, | ||
@@ -111,3 +112,3 @@ generateName, | ||
// generate and compile PlantUML description | ||
await asyncWriteFile(`${targetFileName}.puml`, compilePlantUml(extractedDataCopy)); | ||
await writeFile(`${targetFileName}.puml`, compilePlantUml(extractedDataCopy)); | ||
@@ -114,0 +115,0 @@ // generate PNG from PlantUML |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
234190
19
5431
+ Added@krlwlfrt/tsg@0.6.1(transitive)
+ Added@types/node@14.14.28(transitive)
+ Added@types/xml2js@0.4.8(transitive)
+ Addedcommander@7.1.0(transitive)
+ Addednode-plantuml@0.9.0(transitive)
- Removed@types/node@10.17.21
- Removed@krlwlfrt/tsg@0.5.1(transitive)
- Removed@types/node@10.17.21(transitive)
- Removed@types/xml2js@0.4.5(transitive)
- Removedcommander@5.1.0(transitive)
- Removednode-plantuml@0.8.1(transitive)
Updated@krlwlfrt/tsg@0.6.1
Updated@types/xml2js@0.4.8
Updatedcommander@7.1.0