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

@apimatic/cli

Package Overview
Dependencies
Maintainers
3
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apimatic/cli - npm Package Compare versions

Comparing version 1.0.1-alpha.1 to 1.0.1-alpha.2

lib/controllers/api/transform.d.ts

7

CHANGELOG.md

@@ -0,1 +1,8 @@

## [1.0.1-alpha.2](https://github.com/apimatic/apimatic-cli/compare/v1.0.1-alpha.1...v1.0.1-alpha.2) (2021-11-30)
### Bug Fixes
* **refactor:** refactor code ([d7cb486](https://github.com/apimatic/apimatic-cli/commit/d7cb4863bcfd44f297f0525e0c7eae7ecef12695))
## [1.0.1-alpha.1](https://github.com/apimatic/apimatic-cli/compare/v1.0.0...v1.0.1-alpha.1) (2021-11-26)

@@ -2,0 +9,0 @@

2

lib/commands/api/transform.d.ts

@@ -1,2 +0,1 @@

import { ApiValidationSummary } from "@apimatic/apimatic-sdk-for-js";
import { flags, Command } from "@oclif/command";

@@ -13,4 +12,3 @@ export default class Transform extends Command {

};
printValidationMessages: (apiValidationSummary: ApiValidationSummary | undefined) => void;
run(): Promise<void>;
}

@@ -10,76 +10,9 @@ "use strict";

const utils_1 = require("../../utils/utils");
const DestinationFormats = {
OpenApi3Json: "json",
OpenApi3Yaml: "yaml",
APIMATIC: "json",
WADL2009: "xml",
WSDL: "xml",
Swagger10: "json",
Swagger20: "json",
SwaggerYaml: "yaml",
RAML: "yaml",
RAML10: "yaml",
Postman10: "json",
Postman20: "json"
};
async function getTransformationId({ file, url, format }, transformationController) {
cli_ux_1.default.action.start("Transforming API specification");
let generation;
if (file) {
const fileDescriptor = new apimatic_sdk_for_js_1.FileWrapper(fs.createReadStream(file));
generation = await transformationController.transformViaFile(fileDescriptor, format);
}
else if (url) {
const body = {
url: url,
exportFormat: format
};
generation = await transformationController.transformViaURL(body);
}
else {
throw new Error("Please provide a specification file");
}
cli_ux_1.default.action.stop();
return generation.result;
}
async function downloadTransformationFile({ id, destinationFilePath, transformationController }) {
cli_ux_1.default.action.start("Downloading Transformed file");
const { result } = await transformationController.downloadTransformedFile(id);
if (result.readable) {
await utils_1.writeFileUsingReadableStream(result, destinationFilePath);
}
else {
throw new Error("Couldn't save transformation file");
}
cli_ux_1.default.action.stop();
return destinationFilePath;
}
// Get valid platform from user's input, convert simple platform to valid Platforms enum value
function getValidFormat(format) {
if (Object.keys(apimatic_sdk_for_js_1.ExportFormats).find((exportFormat) => exportFormat === format)) {
return apimatic_sdk_for_js_1.ExportFormats[format];
}
else {
const formats = Object.keys(apimatic_sdk_for_js_1.ExportFormats).join("|");
throw new Error(`Please provide a valid platform i.e. ${formats}`);
}
}
const transform_1 = require("../../types/api/transform");
const transform_2 = require("../../controllers/api/transform");
class Transform extends command_1.Command {
constructor() {
super(...arguments);
this.printValidationMessages = (apiValidationSummary) => {
const warnings = (apiValidationSummary === null || apiValidationSummary === void 0 ? void 0 : apiValidationSummary.warnings) || [];
const errors = (apiValidationSummary === null || apiValidationSummary === void 0 ? void 0 : apiValidationSummary.errors.join("\n")) || "";
warnings.forEach((warning) => {
this.warn(utils_1.replaceHTML(warning));
});
if (apiValidationSummary && apiValidationSummary.errors.length > 0) {
this.error(utils_1.replaceHTML(errors));
}
};
}
async run() {
const { flags } = this.parse(Transform);
const fileName = flags.file ? utils_1.getFileNameFromPath(flags.file) : utils_1.getFileNameFromPath(flags.url);
const destinationFormat = DestinationFormats[flags.format];
const destinationFormat = transform_1.DestinationFormats[flags.format];
const destinationFilePath = path.join(flags.destination, `${fileName}_${flags.format}.${destinationFormat}`.toLowerCase());

@@ -99,5 +32,5 @@ if (fs.existsSync(destinationFilePath)) {

const transformationController = new apimatic_sdk_for_js_1.TransformationController(client);
const { id, apiValidationSummary } = await getTransformationId(flags, transformationController);
this.printValidationMessages(apiValidationSummary);
const savedTransformationFile = await downloadTransformationFile({
const { id, apiValidationSummary } = await transform_2.getTransformationId(flags, transformationController);
transform_2.printValidationMessages(apiValidationSummary, this.warn, this.error);
const savedTransformationFile = await transform_2.downloadTransformationFile({
id,

@@ -149,3 +82,3 @@ destinationFilePath,

format: command_1.flags.string({
parse: (format) => getValidFormat(format.toUpperCase()),
parse: (format) => transform_2.getValidFormat(format.toUpperCase()),
required: true,

@@ -152,0 +85,0 @@ description: `specification format to transform API specification into

@@ -1,2 +0,1 @@

import { ApiValidationSummary } from "@apimatic/apimatic-sdk-for-js";
import { flags, Command } from "@oclif/command";

@@ -11,4 +10,3 @@ export default class Validate extends Command {

};
printValidationMessages: ({ warnings, errors }: ApiValidationSummary) => void;
run(): Promise<void>;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs-extra");
const cli_ux_1 = require("cli-ux");
const apimatic_sdk_for_js_1 = require("@apimatic/apimatic-sdk-for-js");

@@ -9,31 +8,5 @@ const command_1 = require("@oclif/command");

const utils_1 = require("../../utils/utils");
async function getValidation({ file, url }, apiValidationController) {
let validation;
cli_ux_1.default.action.start("Validating specification file");
if (file) {
const fileDescriptor = new apimatic_sdk_for_js_1.FileWrapper(fs.createReadStream(file));
validation = await apiValidationController.validateAPIViaFile(fileDescriptor);
}
else if (url) {
validation = await apiValidationController.validateAPIViaURL(url);
}
else {
throw new Error("Please provide a specification file");
}
cli_ux_1.default.action.stop();
return validation.result;
}
const transform_1 = require("../../controllers/api/transform");
const validate_1 = require("../../controllers/api/validate");
class Validate extends command_1.Command {
constructor() {
super(...arguments);
this.printValidationMessages = ({ warnings, errors }) => {
warnings.forEach((warning) => {
this.warn(`${utils_1.replaceHTML(warning)}`);
});
if (errors.length > 0) {
const singleLineError = errors.join("\n");
this.error(utils_1.replaceHTML(singleLineError));
}
};
}
async run() {

@@ -48,4 +21,4 @@ const { flags } = this.parse(Validate);

const apiValidationController = new apimatic_sdk_for_js_1.APIValidationExternalApisController(client);
const validationSummary = await getValidation(flags, apiValidationController);
this.printValidationMessages(validationSummary);
const validationSummary = await validate_1.getValidation(flags, apiValidationController);
transform_1.printValidationMessages(validationSummary, this.warn, this.error);
validationSummary.success

@@ -52,0 +25,0 @@ ? this.log("Specification file provided is valid")

@@ -1,10 +0,2 @@

import { DocsPortalManagementController } from "@apimatic/apimatic-sdk-for-js";
import { Command, flags } from "@oclif/command";
declare type GeneratePortalParams = {
zippedBuildFilePath: string;
generatedPortalFolderPath: string;
docsPortalController: DocsPortalManagementController;
overrideAuthKey: string | null;
zip: boolean;
};
export default class PortalGenerate extends Command {

@@ -19,6 +11,3 @@ static description: string;

static examples: string[];
downloadPortalAxios: (zippedBuildFilePath: string, overrideAuthKey: string | null) => Promise<any>;
downloadDocsPortal: ({ zippedBuildFilePath, generatedPortalFolderPath, overrideAuthKey, zip }: GeneratePortalParams) => Promise<string>;
run(): Promise<undefined>;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const fs = require("fs-extra");
const FormData = require("form-data");
const path = require("path");
const cli_ux_1 = require("cli-ux");
const command_1 = require("@oclif/command");
const apimatic_sdk_for_js_1 = require("@apimatic/apimatic-sdk-for-js");
const command_1 = require("@oclif/command");
const sdk_client_1 = require("../../client-utils/sdk-client");
const env_1 = require("../../config/env");
const generate_1 = require("../../controllers/portal/generate");
const utils_1 = require("../../utils/utils");
const auth_manager_1 = require("../../client-utils/auth-manager");
const axios_1 = require("axios");
class PortalGenerate extends command_1.Command {
constructor() {
super(...arguments);
// TODO: Remove after SDK is patched
this.downloadPortalAxios = async (zippedBuildFilePath, overrideAuthKey) => {
const formData = new FormData();
const authInfo = await auth_manager_1.getAuthInfo(this.config.configDir);
formData.append("file", fs.createReadStream(zippedBuildFilePath));
const config = {
headers: Object.assign({ Authorization: authInfo ? `X-Auth-Key ${overrideAuthKey || authInfo.authKey.trim()}` : "", "Content-Type": "multipart/form-data" }, formData.getHeaders()),
responseType: "arraybuffer"
};
const { data } = await axios_1.default.post(`${env_1.baseURL}/portal`, formData, config);
return data;
};
// Download Docs Portal
this.downloadDocsPortal = async ({ zippedBuildFilePath, generatedPortalFolderPath, overrideAuthKey, zip }) => {
const zippedPortalPath = path.join(generatedPortalFolderPath, "generated_portal.zip");
const portalPath = path.join(generatedPortalFolderPath, "generated_portal");
cli_ux_1.default.action.start("Downloading portal");
// Check if the build file exists for the user or not
if (!(await fs.pathExists(zippedBuildFilePath))) {
throw new Error("Build file doesn't exist");
}
// TODO: ***CRITICAL*** Remove this call once the SDK is patched
const data = await this.downloadPortalAxios(zippedBuildFilePath, overrideAuthKey);
await utils_1.deleteFile(zippedBuildFilePath);
await fs.writeFile(zippedPortalPath, data);
// TODO: Uncomment this code block when the SDK is patched
// const file: FileWrapper = new FileWrapper(fs.createReadStream(zippedBuildFilePath));
// const { result }: ApiResponse<NodeJS.ReadableStream | Blob> =
// await docsPortalController.generateOnPremPortalViaBuildInput(file);
// if ((data as NodeJS.ReadableStream).readable) {
// await writeFileUsingReadableStream(data as NodeJS.ReadableStream, zippedPortalPath);
if (!zip) {
await utils_1.unzipFile(fs.createReadStream(zippedPortalPath), portalPath);
await utils_1.deleteFile(zippedPortalPath);
}
cli_ux_1.default.action.stop();
return portalPath;
// } else {
// throw new Error("Couldn't download the portal");
// }
};
}
async run() {

@@ -82,4 +35,4 @@ const { flags } = this.parse(PortalGenerate);

};
const generatedPortalPath = await this.downloadDocsPortal(generatePortalParams);
this.log(`Your portal has been generated at ${generatedPortalPath}${flags.zip ? ".zip" : ""}`);
const generatedPortalPath = await generate_1.downloadDocsPortal(generatePortalParams, this.config.configDir);
this.log(`Your portal has been generated at ${generatedPortalPath}`);
}

@@ -86,0 +39,0 @@ catch (error) {

@@ -10,66 +10,3 @@ "use strict";

const utils_1 = require("../../utils/utils");
var SimplePlatforms;
(function (SimplePlatforms) {
SimplePlatforms["CSHARP"] = "CS_NET_STANDARD_LIB";
SimplePlatforms["JAVA"] = "JAVA_ECLIPSE_JRE_LIB";
SimplePlatforms["PHP"] = "PHP_GENERIC_LIB";
SimplePlatforms["PYTHON"] = "PYTHON_GENERIC_LIB";
SimplePlatforms["RUBY"] = "RUBY_GENERIC_LIB";
SimplePlatforms["TYPESCRIPT"] = "TS_GENERIC_LIB";
})(SimplePlatforms || (SimplePlatforms = {}));
async function getSDKGenerationId({ file, url, platform }, sdkGenerationController) {
cli_ux_1.default.action.start("Generating SDK");
let generation;
const sdkPlatform = getSDKPlatform(platform);
if (file) {
const fileDescriptor = new apimatic_sdk_for_js_1.FileWrapper(fs.createReadStream(file));
generation = await sdkGenerationController.generateSDKViaFile(fileDescriptor, sdkPlatform);
}
else if (url) {
// If url to spec file is provided
const body = {
url: url,
template: sdkPlatform
};
generation = await sdkGenerationController.generateSDKViaURL(body);
}
else {
throw new Error("Please provide a specification file");
}
cli_ux_1.default.action.stop();
return generation.result.id;
}
// Get valid platform from user's input, convert simple platform to valid Platforms enum value
function getSDKPlatform(platform) {
if (Object.keys(SimplePlatforms).includes(platform)) {
return SimplePlatforms[platform];
}
else if (Object.values(apimatic_sdk_for_js_1.Platforms).includes(platform)) {
return platform;
}
else {
const platforms = Object.keys(SimplePlatforms).concat(Object.values(apimatic_sdk_for_js_1.Platforms)).join("|");
throw new Error(`Please provide a valid platform i.e. ${platforms}`);
}
}
// Download Platform
async function downloadGeneratedSDK({ codeGenId, zippedSDKPath, sdkFolderPath, zip }, sdkGenerationController) {
cli_ux_1.default.action.start("Downloading SDK");
const { result } = await sdkGenerationController.downloadSDK(codeGenId);
if (result.readable) {
if (!zip) {
await utils_1.unzipFile(result, sdkFolderPath);
cli_ux_1.default.action.stop();
return sdkFolderPath;
}
else {
await utils_1.writeFileUsingReadableStream(result, zippedSDKPath);
cli_ux_1.default.action.stop();
return zippedSDKPath;
}
}
else {
throw new Error("Couldn't download the SDK");
}
}
const generate_1 = require("../../controllers/sdk/generate");
class SdkGenerate extends command_1.Command {

@@ -99,3 +36,3 @@ async run() {

// Get generation id for the specification and platform
const codeGenId = await getSDKGenerationId(flags, sdkGenerationController);
const codeGenId = await generate_1.getSDKGenerationId(flags, sdkGenerationController);
// If user wanted to download the SDK as well

@@ -108,3 +45,3 @@ const sdkDownloadParams = {

};
const sdkPath = await downloadGeneratedSDK(sdkDownloadParams, sdkGenerationController);
const sdkPath = await generate_1.downloadGeneratedSDK(sdkDownloadParams, sdkGenerationController);
this.log(`Success! Your SDK is located at ${sdkPath}`);

@@ -111,0 +48,0 @@ }

@@ -1,1 +0,1 @@

{"version":"1.0.1-alpha.1","commands":{"api":{"id":"api","description":"lists all commands related to the APIMatic API.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api --help"],"flags":{},"args":[]},"api:transform":{"id":"api:transform","description":"Transforms your API specification to any supported format of your choice from amongst[10+ different formats](https://www.apimatic.io/transformer/#supported-formats).","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:transform --format=\"OpenApi3Json\" --file=\"./specs/sample.json\" --destination=\"D:/\"\nSuccess! Your transformed file is located at D:/Transformed_OpenApi3Json.json\n"],"flags":{"format":{"name":"format","type":"option","description":"specification format to transform API specification into\n(OpenApi3Json|OpenApi3Yaml|APIMATIC|WADL2009|WADL2006|WSDL|\nSwagger10|Swagger20|SwaggerYaml|RAML|RAML10|Postman10|Postman20)","required":true},"file":{"name":"file","type":"option","description":"path to the API specification file to transform","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification file to transform","default":""},"destination":{"name":"destination","type":"option","description":"path to transformed file","default":"/home/runner/work/apimatic-cli/apimatic-cli/cli/src/commands/api"},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key"}},"args":[]},"api:validate":{"id":"api:validate","description":"Validates the provided API specification file for any syntactical and semantic errors","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:validate --file=\"./specs/sample.json\"\nSpecification file provided is valid\n"],"flags":{"file":{"name":"file","type":"option","description":"path to the API specification file to validate","default":""},"url":{"name":"url","type":"option","description":"URL to the specification file to validate","default":""},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key"}},"args":[]},"auth":{"id":"auth","description":"invokes subcommands related to authentication.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth --help"],"flags":{},"args":[]},"auth:login":{"id":"auth:login","description":"login to your APIMatic account","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:login\nPlease enter your registered email: apimatic-user@gmail.com\nPlease enter your password: *********\n\nYou have successfully logged into APIMatic\n"],"flags":{"auth-key":{"name":"auth-key","type":"option","description":"Set authentication key for all commands","default":""}},"args":[]},"auth:logout":{"id":"auth:logout","description":"logout of APIMatic","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:logout\nLogged out\n"],"flags":{},"args":[]},"auth:status":{"id":"auth:status","description":"checks current logged-in account","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:status\nCurrently logged in as apimatic-client@gmail.com\n"],"flags":{},"args":[]},"portal:generate":{"id":"portal:generate","description":"Generate static docs portal on premise","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic portal:generate --folder=\"./portal/\" --destination=\"D:/\"\nYour portal has been generated at D:/\n"],"flags":{"folder":{"name":"folder","type":"option","description":"folder to generate the portal with","default":""},"destination":{"name":"destination","type":"option","description":"path to the downloaded portal","default":"./"},"zip":{"name":"zip","type":"boolean","description":"zip the portal","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key","default":""}},"args":[]},"portal":{"id":"portal","description":"invokes subcommands related to the API Portal.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$apimatic portal --help"],"flags":{},"args":[]},"sdk:generate":{"id":"sdk:generate","description":"Generate SDK for your APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic sdk:generate --platform=\"CSHARP\" --file=\"./specs/sample.json\"\nSDK generated successfully\n"],"flags":{"platform":{"name":"platform","type":"option","description":"language platform for sdk\nSimple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT\nLegacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LIB|\n JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|\n TS_GENERIC_LIB","required":true},"file":{"name":"file","type":"option","description":"path to the API specification to generate SDK","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification to generate SDK","default":""},"destination":{"name":"destination","type":"option","description":"path to downloaded SDK (used with download flag)","default":"./"},"zip":{"name":"zip","type":"boolean","description":"zip the SDK (used with download flag)","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key","default":""}},"args":[]},"sdk":{"id":"sdk","description":"invokes subcommands related to your SDKs.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$apimatic sdk --help"],"flags":{},"args":[]}}}
{"version":"1.0.1-alpha.2","commands":{"api":{"id":"api","description":"lists all commands related to the APIMatic API.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api --help"],"flags":{},"args":[]},"api:transform":{"id":"api:transform","description":"Transforms your API specification to any supported format of your choice from amongst[10+ different formats](https://www.apimatic.io/transformer/#supported-formats).","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:transform --format=\"OpenApi3Json\" --file=\"./specs/sample.json\" --destination=\"D:/\"\nSuccess! Your transformed file is located at D:/Transformed_OpenApi3Json.json\n"],"flags":{"format":{"name":"format","type":"option","description":"specification format to transform API specification into\n(OpenApi3Json|OpenApi3Yaml|APIMATIC|WADL2009|WADL2006|WSDL|\nSwagger10|Swagger20|SwaggerYaml|RAML|RAML10|Postman10|Postman20)","required":true},"file":{"name":"file","type":"option","description":"path to the API specification file to transform","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification file to transform","default":""},"destination":{"name":"destination","type":"option","description":"path to transformed file","default":"/home/runner/work/apimatic-cli/apimatic-cli/cli/src/commands/api"},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key"}},"args":[]},"api:validate":{"id":"api:validate","description":"Validates the provided API specification file for any syntactical and semantic errors","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:validate --file=\"./specs/sample.json\"\nSpecification file provided is valid\n"],"flags":{"file":{"name":"file","type":"option","description":"path to the API specification file to validate","default":""},"url":{"name":"url","type":"option","description":"URL to the specification file to validate","default":""},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key"}},"args":[]},"auth":{"id":"auth","description":"invokes subcommands related to authentication.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth --help"],"flags":{},"args":[]},"auth:login":{"id":"auth:login","description":"login to your APIMatic account","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:login\nPlease enter your registered email: apimatic-user@gmail.com\nPlease enter your password: *********\n\nYou have successfully logged into APIMatic\n"],"flags":{"auth-key":{"name":"auth-key","type":"option","description":"Set authentication key for all commands","default":""}},"args":[]},"auth:logout":{"id":"auth:logout","description":"logout of APIMatic","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:logout\nLogged out\n"],"flags":{},"args":[]},"auth:status":{"id":"auth:status","description":"checks current logged-in account","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:status\nCurrently logged in as apimatic-client@gmail.com\n"],"flags":{},"args":[]},"portal:generate":{"id":"portal:generate","description":"Generate static docs portal on premise","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic portal:generate --folder=\"./portal/\" --destination=\"D:/\"\nYour portal has been generated at D:/\n"],"flags":{"folder":{"name":"folder","type":"option","description":"folder to generate the portal with","default":""},"destination":{"name":"destination","type":"option","description":"path to the downloaded portal","default":"./"},"zip":{"name":"zip","type":"boolean","description":"zip the portal","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key","default":""}},"args":[]},"portal":{"id":"portal","description":"invokes subcommands related to the API Portal.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$apimatic portal --help"],"flags":{},"args":[]},"sdk:generate":{"id":"sdk:generate","description":"Generate SDK for your APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic sdk:generate --platform=\"CSHARP\" --file=\"./specs/sample.json\"\nSDK generated successfully\n"],"flags":{"platform":{"name":"platform","type":"option","description":"language platform for sdk\nSimple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT\nLegacy: CS_NET_STANDARD_LIB|CS_PORTABLE_NET_LIB|CS_UNIVERSAL_WINDOWS_PLATFORM_LIB|\n JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|\n TS_GENERIC_LIB","required":true},"file":{"name":"file","type":"option","description":"path to the API specification to generate SDK","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification to generate SDK","default":""},"destination":{"name":"destination","type":"option","description":"path to downloaded SDK (used with download flag)","default":"./"},"zip":{"name":"zip","type":"boolean","description":"zip the SDK (used with download flag)","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current auth-key","default":""}},"args":[]},"sdk":{"id":"sdk","description":"invokes subcommands related to your SDKs.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$apimatic sdk --help"],"flags":{},"args":[]}}}
{
"name": "@apimatic/cli",
"description": "The official CLI for APIMatic.",
"version": "1.0.1-alpha.1",
"version": "1.0.1-alpha.2",
"author": "APIMatic",

@@ -6,0 +6,0 @@ "bin": {

@@ -22,3 +22,3 @@ @apimatic/cli

$ apimatic (-v|--version|version)
@apimatic/cli/1.0.1-alpha.1 linux-x64 node-v14.18.1
@apimatic/cli/1.0.1-alpha.2 linux-x64 node-v14.18.1
$ apimatic --help [COMMAND]

@@ -59,3 +59,3 @@ USAGE

_See code: [src/commands/api/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/api/index.ts)_
_See code: [src/commands/api/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/api/index.ts)_

@@ -89,3 +89,3 @@ ## `apimatic api:transform`

_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/api/transform.ts)_
_See code: [src/commands/api/transform.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/api/transform.ts)_

@@ -110,3 +110,3 @@ ## `apimatic api:validate`

_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/api/validate.ts)_
_See code: [src/commands/api/validate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/api/validate.ts)_

@@ -125,3 +125,3 @@ ## `apimatic auth`

_See code: [src/commands/auth/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/auth/index.ts)_
_See code: [src/commands/auth/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/auth/index.ts)_

@@ -147,3 +147,3 @@ ## `apimatic auth:login`

_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/auth/login.ts)_
_See code: [src/commands/auth/login.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/auth/login.ts)_

@@ -163,3 +163,3 @@ ## `apimatic auth:logout`

_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/auth/logout.ts)_
_See code: [src/commands/auth/logout.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/auth/logout.ts)_

@@ -179,3 +179,3 @@ ## `apimatic auth:status`

_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/auth/status.ts)_
_See code: [src/commands/auth/status.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/auth/status.ts)_

@@ -220,3 +220,3 @@ ## `apimatic autocomplete [SHELL]`

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.7/src/commands/help.ts)_
_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.9/src/commands/help.ts)_

@@ -235,3 +235,3 @@ ## `apimatic portal`

_See code: [src/commands/portal/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/portal/index.ts)_
_See code: [src/commands/portal/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/portal/index.ts)_

@@ -257,3 +257,3 @@ ## `apimatic portal:generate`

_See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/portal/generate.ts)_
_See code: [src/commands/portal/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/portal/generate.ts)_

@@ -272,3 +272,3 @@ ## `apimatic sdk`

_See code: [src/commands/sdk/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/sdk/index.ts)_
_See code: [src/commands/sdk/index.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/sdk/index.ts)_

@@ -303,3 +303,3 @@ ## `apimatic sdk:generate`

_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.1/src/commands/sdk/generate.ts)_
_See code: [src/commands/sdk/generate.ts](https://github.com/apimatic/apimatic-cli/blob/v1.0.1-alpha.2/src/commands/sdk/generate.ts)_
<!-- commandsstop -->

Sorry, the diff of this file is not supported yet

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