@apimatic/cli 1.0.1-alpha.1 → 1.0.1-alpha.5
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/README.md +64 -49
- package/bin/run +3 -3
- package/lib/client-utils/sdk-client.d.ts +1 -1
- package/lib/client-utils/sdk-client.js +3 -3
- package/lib/commands/api/index.js +4 -5
- package/lib/commands/api/transform.d.ts +1 -2
- package/lib/commands/api/transform.js +23 -81
- package/lib/commands/api/validate.d.ts +0 -2
- package/lib/commands/api/validate.js +16 -37
- package/lib/commands/auth/index.js +5 -5
- package/lib/commands/auth/login.js +4 -2
- package/lib/commands/auth/logout.js +1 -1
- package/lib/commands/auth/status.js +1 -1
- package/lib/commands/portal/generate.d.ts +1 -11
- package/lib/commands/portal/generate.js +23 -60
- package/lib/commands/portal/index.js +3 -3
- package/lib/commands/sdk/generate.d.ts +1 -0
- package/lib/commands/sdk/generate.js +35 -83
- package/lib/commands/sdk/index.js +2 -2
- package/lib/controllers/api/transform.d.ts +7 -0
- package/lib/controllers/api/transform.js +59 -0
- package/lib/controllers/api/validate.d.ts +5 -0
- package/lib/controllers/api/validate.js +32 -0
- package/lib/controllers/portal/generate.d.ts +2 -0
- package/lib/controllers/portal/generate.js +49 -0
- package/lib/controllers/sdk/generate.d.ts +4 -0
- package/lib/controllers/sdk/generate.js +64 -0
- package/lib/types/api/transform.d.ts +33 -0
- package/lib/types/api/transform.js +17 -0
- package/lib/types/api/validate.d.ts +12 -0
- package/lib/types/api/validate.js +2 -0
- package/lib/types/portal/generate.d.ts +9 -0
- package/lib/types/portal/generate.js +2 -0
- package/lib/types/sdk/generate.d.ts +22 -0
- package/lib/types/sdk/generate.js +12 -0
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -6
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { TransformationController } from "@apimatic/sdk";
|
|
3
|
+
export declare type AuthenticationError = {
|
|
4
|
+
statusCode: number;
|
|
5
|
+
body: string;
|
|
6
|
+
};
|
|
7
|
+
export declare type TransformationIdParams = {
|
|
8
|
+
file: string;
|
|
9
|
+
url: string;
|
|
10
|
+
format: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type DownloadTransformationParams = {
|
|
13
|
+
id: string;
|
|
14
|
+
destinationFilePath: string;
|
|
15
|
+
transformationController: TransformationController;
|
|
16
|
+
};
|
|
17
|
+
export declare type TransformationData = {
|
|
18
|
+
result: NodeJS.ReadableStream | Blob;
|
|
19
|
+
};
|
|
20
|
+
export declare const DestinationFormats: {
|
|
21
|
+
OpenApi3Json: string;
|
|
22
|
+
OpenApi3Yaml: string;
|
|
23
|
+
APIMATIC: string;
|
|
24
|
+
WADL2009: string;
|
|
25
|
+
WSDL: string;
|
|
26
|
+
Swagger10: string;
|
|
27
|
+
Swagger20: string;
|
|
28
|
+
SwaggerYaml: string;
|
|
29
|
+
RAML: string;
|
|
30
|
+
RAML10: string;
|
|
31
|
+
Postman10: string;
|
|
32
|
+
Postman20: string;
|
|
33
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DestinationFormats = void 0;
|
|
4
|
+
exports.DestinationFormats = {
|
|
5
|
+
OpenApi3Json: "json",
|
|
6
|
+
OpenApi3Yaml: "yaml",
|
|
7
|
+
APIMATIC: "json",
|
|
8
|
+
WADL2009: "xml",
|
|
9
|
+
WSDL: "xml",
|
|
10
|
+
Swagger10: "json",
|
|
11
|
+
Swagger20: "json",
|
|
12
|
+
SwaggerYaml: "yaml",
|
|
13
|
+
RAML: "yaml",
|
|
14
|
+
RAML10: "yaml",
|
|
15
|
+
Postman10: "json",
|
|
16
|
+
Postman20: "json"
|
|
17
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DocsPortalManagementController } from "@apimatic/sdk";
|
|
2
|
+
export declare type GeneratePortalParams = {
|
|
3
|
+
zippedBuildFilePath: string;
|
|
4
|
+
portalFolderPath: string;
|
|
5
|
+
zippedPortalPath: string;
|
|
6
|
+
docsPortalController: DocsPortalManagementController;
|
|
7
|
+
overrideAuthKey: string | null;
|
|
8
|
+
zip: boolean;
|
|
9
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare type GenerationIdParams = {
|
|
2
|
+
file: string;
|
|
3
|
+
url: string;
|
|
4
|
+
platform: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type DownloadSDKParams = {
|
|
7
|
+
codeGenId: string;
|
|
8
|
+
zip: boolean;
|
|
9
|
+
zippedSDKPath: string;
|
|
10
|
+
sdkFolderPath: string;
|
|
11
|
+
};
|
|
12
|
+
export declare type SDKGenerateUnprocessableError = {
|
|
13
|
+
message: string;
|
|
14
|
+
};
|
|
15
|
+
export declare enum SimplePlatforms {
|
|
16
|
+
CSHARP = "CS_NET_STANDARD_LIB",
|
|
17
|
+
JAVA = "JAVA_ECLIPSE_JRE_LIB",
|
|
18
|
+
PHP = "PHP_GENERIC_LIB",
|
|
19
|
+
PYTHON = "PYTHON_GENERIC_LIB",
|
|
20
|
+
RUBY = "RUBY_GENERIC_LIB",
|
|
21
|
+
TYPESCRIPT = "TS_GENERIC_LIB"
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimplePlatforms = void 0;
|
|
4
|
+
var SimplePlatforms;
|
|
5
|
+
(function (SimplePlatforms) {
|
|
6
|
+
SimplePlatforms["CSHARP"] = "CS_NET_STANDARD_LIB";
|
|
7
|
+
SimplePlatforms["JAVA"] = "JAVA_ECLIPSE_JRE_LIB";
|
|
8
|
+
SimplePlatforms["PHP"] = "PHP_GENERIC_LIB";
|
|
9
|
+
SimplePlatforms["PYTHON"] = "PYTHON_GENERIC_LIB";
|
|
10
|
+
SimplePlatforms["RUBY"] = "RUBY_GENERIC_LIB";
|
|
11
|
+
SimplePlatforms["TYPESCRIPT"] = "TS_GENERIC_LIB";
|
|
12
|
+
})(SimplePlatforms = exports.SimplePlatforms || (exports.SimplePlatforms = {}));
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"1.0.1-alpha.
|
|
1
|
+
{"version":"1.0.1-alpha.5","commands":{"api":{"id":"api","description":"Manage APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api --help"],"flags":{},"args":[]},"api:transform":{"id":"api:transform","description":"Transform API specifications from one format to another. Supports [10+ different formats](https://www.apimatic.io/transformer/#supported-formats) including OpenApi/Swagger, RAML, WSDL and Postman Collections.","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","$ apimatic api:transform --format=RAML --url=\"https://petstore.swagger.io/v2/swagger.json\" --destination=\"D:/\"\nSuccess! Your transformed file is located at D:/swagger_raml.yaml\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. Can be used in place of the --file option if the API specification is publicly available.","default":""},"destination":{"name":"destination","type":"option","description":"directory to download transformed file to","default":"./"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if same file exist in the destination","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key"}},"args":[]},"api:validate":{"id":"api:validate","description":"Validate the syntactic and semantic correctness of an API specification","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic api:validate --file=\"./specs/sample.json\"\nSpecification file provided is valid\n","$ apimatic api:validate --url=https://petstore.swagger.io/v2/swagger.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. Can be used in place of the --file option if the API specification is publicly available.","default":""},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key"}},"args":[]},"auth":{"id":"auth","description":"Manage this CLI's authentication state.","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth --help"],"flags":{},"args":[]},"auth:login":{"id":"auth:login","description":"Login using your APIMatic credentials or an API Key","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","$ apimatic auth:login --auth-key=xxxxxx\nAuthentication key successfully set"],"flags":{"auth-key":{"name":"auth-key","type":"option","description":"Set authentication key for all commands","default":""}},"args":[]},"auth:logout":{"id":"auth:logout","description":"Clear local login credentials","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$ apimatic auth:logout\nLogged out\n"],"flags":{},"args":[]},"auth:status":{"id":"auth:status","description":"View current authentication state","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 and download a static API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://portal-api-docs.apimatic.io/#/http/generating-api-portal/build-file)","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":"path to the input directory containing API specifications and config files","default":""},"destination":{"name":"destination","type":"option","description":"path to the downloaded portal","default":"./"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if a portal exists in the destination","allowNo":false},"zip":{"name":"zip","type":"boolean","description":"download the generated portal as a .zip archive","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key","default":""}},"args":[]},"portal":{"id":"portal","description":"Manage API documentation portals","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\"\nGenerating SDK... done\nDownloading SDK... done\nSuccess! Your SDK is located at swagger_sdk_csharp","$ apimatic sdk:generate --platform=\"CSHARP\" --url=https://petstore.swagger.io/v2/swagger.json\nGenerating SDK... done\nDownloading SDK... done\nSuccess! Your SDK is located at swagger_sdk_csharp\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 SDKs for","default":""},"url":{"name":"url","type":"option","description":"URL to the API specification to generate SDKs for. Can be used in place of the --file option if the API specification is publicly available.","default":""},"destination":{"name":"destination","type":"option","description":"directory to download the generated SDK to","default":"./"},"force":{"name":"force","type":"boolean","char":"f","description":"overwrite if an SDK already exists in the destination","allowNo":false},"zip":{"name":"zip","type":"boolean","description":"download the generated SDK as a .zip archive","allowNo":false},"auth-key":{"name":"auth-key","type":"option","description":"override current authentication state with an authentication key","default":""}},"args":[]},"sdk":{"id":"sdk","description":"Generate and manage SDKs for APIs","pluginName":"@apimatic/cli","pluginType":"core","aliases":[],"examples":["$apimatic sdk --help"],"flags":{},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apimatic/cli",
|
|
3
3
|
"description": "The official CLI for APIMatic.",
|
|
4
|
-
"version": "1.0.1-alpha.
|
|
4
|
+
"version": "1.0.1-alpha.5",
|
|
5
5
|
"author": "APIMatic",
|
|
6
6
|
"bin": {
|
|
7
7
|
"apimatic": "./bin/run"
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"lint:fix": "eslint --fix \"src/**/*.{js,ts}\" --quiet"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@apimatic/
|
|
48
|
+
"@apimatic/sdk": "^0.0.1-alpha.1",
|
|
49
49
|
"@oclif/command": "^1.8.0",
|
|
50
50
|
"@oclif/config": "^1.17.0",
|
|
51
51
|
"@oclif/plugin-autocomplete": "^0.3.0",
|
package/CHANGELOG.md
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
## [1.0.1-alpha.1](https://github.com/apimatic/apimatic-cli/compare/v1.0.0...v1.0.1-alpha.1) (2021-11-26)
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
### Bug Fixes
|
|
5
|
-
|
|
6
|
-
* **release:** add lock file to gitignore restore check_build workflow ([2eb959a](https://github.com/apimatic/apimatic-cli/commit/2eb959afc2a7ee2317959fc8525930acde2989dc))
|