@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.
Files changed (38) hide show
  1. package/README.md +64 -49
  2. package/bin/run +3 -3
  3. package/lib/client-utils/sdk-client.d.ts +1 -1
  4. package/lib/client-utils/sdk-client.js +3 -3
  5. package/lib/commands/api/index.js +4 -5
  6. package/lib/commands/api/transform.d.ts +1 -2
  7. package/lib/commands/api/transform.js +23 -81
  8. package/lib/commands/api/validate.d.ts +0 -2
  9. package/lib/commands/api/validate.js +16 -37
  10. package/lib/commands/auth/index.js +5 -5
  11. package/lib/commands/auth/login.js +4 -2
  12. package/lib/commands/auth/logout.js +1 -1
  13. package/lib/commands/auth/status.js +1 -1
  14. package/lib/commands/portal/generate.d.ts +1 -11
  15. package/lib/commands/portal/generate.js +23 -60
  16. package/lib/commands/portal/index.js +3 -3
  17. package/lib/commands/sdk/generate.d.ts +1 -0
  18. package/lib/commands/sdk/generate.js +35 -83
  19. package/lib/commands/sdk/index.js +2 -2
  20. package/lib/controllers/api/transform.d.ts +7 -0
  21. package/lib/controllers/api/transform.js +59 -0
  22. package/lib/controllers/api/validate.d.ts +5 -0
  23. package/lib/controllers/api/validate.js +32 -0
  24. package/lib/controllers/portal/generate.d.ts +2 -0
  25. package/lib/controllers/portal/generate.js +49 -0
  26. package/lib/controllers/sdk/generate.d.ts +4 -0
  27. package/lib/controllers/sdk/generate.js +64 -0
  28. package/lib/types/api/transform.d.ts +33 -0
  29. package/lib/types/api/transform.js +17 -0
  30. package/lib/types/api/validate.d.ts +12 -0
  31. package/lib/types/api/validate.js +2 -0
  32. package/lib/types/portal/generate.d.ts +9 -0
  33. package/lib/types/portal/generate.js +2 -0
  34. package/lib/types/sdk/generate.d.ts +22 -0
  35. package/lib/types/sdk/generate.js +12 -0
  36. package/oclif.manifest.json +1 -1
  37. package/package.json +2 -2
  38. 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,12 @@
1
+ export declare type GetValidationParams = {
2
+ file: string;
3
+ url: string;
4
+ };
5
+ export declare type APIValidateError = {
6
+ modelState: {
7
+ "exception Error": string[];
8
+ };
9
+ };
10
+ export declare type AuthorizationError = {
11
+ body: string;
12
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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 = {}));
@@ -1 +1 @@
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":[]}}}
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.1",
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/apimatic-sdk-for-js": "git+https://github.com/apimatic/apimatic-sdk-for-js.git",
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))