Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apidoc2ts

Package Overview
Dependencies
Maintainers
10
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apidoc2ts - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

4

dist/cli/index.js

@@ -19,3 +19,3 @@ "use strict";

return __awaiter(this, void 0, void 0, function* () {
const { args, flags: passedFlags } = this.parse(Convert);
const { args, flags: passedFlags } = this.parse(undefined, Convert);
return this.parseInput(passedFlags)

@@ -140,2 +140,2 @@ .then(({ builderOptions, runParameters }) => __awaiter(this, void 0, void 0, function* () {

module.exports = Convert;
//# sourceMappingURL=index.js.map
//# sourceMappingURL=index.js.map

@@ -9,3 +9,3 @@ "use strict";

jest.mock("./generator/InterfaceGenerator");
jest.mock("./parser/ApiDocEndpointParser");
jest.mock("./parser/ApiDocFieldsParser");
jest.mock("./converter/ApiDocToInterfaceConverter");

@@ -54,2 +54,2 @@ jest.mock("./ApiDoc2Interface");

});
//# sourceMappingURL=ApiDoc2InterfaceBuilder.test.js.map
//# sourceMappingURL=ApiDoc2InterfaceBuilder.test.js.map

@@ -68,3 +68,3 @@ "use strict";

};
jest.mock("../parser/ApiDocEndpointParser");
jest.mock("../parser/ApiDocFieldsParser");
jest.mock("../generator/InterfaceGenerator");

@@ -112,3 +112,3 @@ const apiDocDataFull = [requestVersion1, requestVersion2, requestVersion3];

}));
it("should call parseEndpoint with apiDoc data", () => __awaiter(this, void 0, void 0, function* () {
it("should call parse with apiDoc data", () => __awaiter(this, void 0, void 0, function* () {
yield converter.convert([requestVersion1]);

@@ -136,3 +136,3 @@ expect(parseEndpointSpy).toBeCalledWith(requestVersion1);

}));
it("should call parseEndpoint and createInterface for every endpoint", () => __awaiter(this, void 0, void 0, function* () {
it("should call parse and createInterface for every endpoint", () => __awaiter(this, void 0, void 0, function* () {
yield converter.convert(apiDocDataFull);

@@ -172,2 +172,2 @@ expect(parseEndpointSpy).toBeCalledTimes(apiDocDataFull.length);

});
//# sourceMappingURL=ApiDocToInterfaceConverter.test.js.map
//# sourceMappingURL=ApiDocToInterfaceConverter.test.js.map

@@ -101,2 +101,2 @@ "use strict";

exports.ApiDocEndpointParser = ApiDocEndpointParser;
//# sourceMappingURL=ApiDocEndpointParser.js.map
//# sourceMappingURL=ApiDocFieldsParser.js.map

@@ -236,2 +236,2 @@ "use strict";

});
//# sourceMappingURL=ApiDocEndpointParser.test.js.map
//# sourceMappingURL=ApiDocFieldsParser.test.js.map
{
"name": "apidoc2ts",
"version": "0.1.0",
"version": "0.2.0",
"description": "Typescript interface generator based on ApiDoc",

@@ -44,5 +44,6 @@ "bin": {

"@oclif/plugin-help": "^2.2.0",
"chalk": "^2.4.2",
"lodash": "^4.17.14",
"make-dir": "^3.0.0",
"quicktype-core": "^6.0.44",
"lodash": "^4.17.14",
"chalk": "^2.4.2",
"tslib": "^1.10.0"

@@ -49,0 +50,0 @@ },

@@ -34,3 +34,3 @@ # apiDoc to Interfaces

* `-s --source` - path to the `api_data.json` file from apiDoc
* `-o --output` - path to the output folder
* `-o --output` - path to the output folder (default `./`)
* `-n --name` - name for the file with generated interfaces

@@ -47,2 +47,4 @@

* `-t --custom-types` - list of custom types that should not be replaced with strings
* `-w --whitelist` - list of endpoints names which should be processed, the rest of endpoints will be ignored
* `-e --parse-examples` - if example requests/responses should be parsed if no parameters are specified

@@ -49,0 +51,0 @@ Prefixes/postfixes for top-level interfaces names:

@@ -52,2 +52,14 @@ import {Command, flags} from "@oclif/command";

}),
whitelist: flags.string({
char: "w",
multiple: true,
description: "Specify list of endpoints names which should be processed",
exclusive: ["config"],
}),
["parse-examples"]: flags.boolean({
char: "e",
default: false,
description: "Parse endpoint examples if it has no parameters",
exclusive: ["config"],
}),
["custom-types"]: flags.string({

@@ -54,0 +66,0 @@ char: "t",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc