@apimatic/cli 1.0.1-alpha.1 → 1.0.1-alpha.10

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 (42) hide show
  1. package/README.md +63 -97
  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/transform.d.ts +1 -2
  6. package/lib/commands/api/transform.js +34 -86
  7. package/lib/commands/api/validate.d.ts +0 -2
  8. package/lib/commands/api/validate.js +16 -37
  9. package/lib/commands/auth/login.js +4 -2
  10. package/lib/commands/auth/logout.js +1 -1
  11. package/lib/commands/auth/status.js +1 -1
  12. package/lib/commands/portal/generate.d.ts +1 -11
  13. package/lib/commands/portal/generate.js +26 -65
  14. package/lib/commands/sdk/generate.d.ts +1 -0
  15. package/lib/commands/sdk/generate.js +37 -86
  16. package/lib/controllers/api/transform.d.ts +7 -0
  17. package/lib/controllers/api/transform.js +59 -0
  18. package/lib/controllers/api/validate.d.ts +5 -0
  19. package/lib/controllers/api/validate.js +32 -0
  20. package/lib/controllers/portal/generate.d.ts +2 -0
  21. package/lib/controllers/portal/generate.js +49 -0
  22. package/lib/controllers/sdk/generate.d.ts +4 -0
  23. package/lib/controllers/sdk/generate.js +64 -0
  24. package/lib/types/api/transform.d.ts +34 -0
  25. package/lib/types/api/transform.js +18 -0
  26. package/lib/types/api/validate.d.ts +12 -0
  27. package/lib/types/api/validate.js +2 -0
  28. package/lib/types/portal/generate.d.ts +9 -0
  29. package/lib/types/portal/generate.js +2 -0
  30. package/lib/types/sdk/generate.d.ts +22 -0
  31. package/lib/types/sdk/generate.js +12 -0
  32. package/oclif.manifest.json +1 -1
  33. package/package.json +2 -2
  34. package/CHANGELOG.md +0 -6
  35. package/lib/commands/api/index.d.ts +0 -6
  36. package/lib/commands/api/index.js +0 -22
  37. package/lib/commands/auth/index.d.ts +0 -6
  38. package/lib/commands/auth/index.js +0 -25
  39. package/lib/commands/portal/index.d.ts +0 -6
  40. package/lib/commands/portal/index.js +0 -20
  41. package/lib/commands/sdk/index.d.ts +0 -6
  42. package/lib/commands/sdk/index.js +0 -21
@@ -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.10","commands":{"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\nAPIMATIC|WADL2009|WSDL|SWAGGER10|SWAGGER20|SWAGGERYAML|OAS3|OPENAPI3YAML|APIBLUEPRINT|RAML|RAML10|POSTMAN10|POSTMAN20|GRAPHQLSCHEMA","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":"/home/runner/work/apimatic-cli/apimatic-cli/cli"},"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: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":"/home/runner/work/apimatic-cli/apimatic-cli/cli"},"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":[]},"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","\n$ 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":"/home/runner/work/apimatic-cli/apimatic-cli/cli"},"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":[]}}}
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.10",
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))
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class Api extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run(): Promise<void>;
6
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class Api extends command_1.Command {
5
- async run() {
6
- this.log(`lists all commands related to the APIMatic API.
7
-
8
- USAGE
9
- $ apimatic api
10
-
11
- EXAMPLE
12
- $ apimatic api --help
13
-
14
- COMMANDS
15
- api:transform Transforms your API specification to any supported format of your choice from amongst[10+ different
16
- formats](https://www.apimatic.io/transformer/#supported-formats).
17
- api:validate Validates the provided API specification file for any syntactical and semantic errors`);
18
- }
19
- }
20
- exports.default = Api;
21
- Api.description = "lists all commands related to the APIMatic API.";
22
- Api.examples = ["$ apimatic api --help"];
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class Auth extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run: () => Promise<void>;
6
- }
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class Auth extends command_1.Command {
5
- constructor() {
6
- super(...arguments);
7
- this.run = async () => {
8
- this.log(`invokes subcommands related to authentication.
9
-
10
- USAGE
11
- $ apimatic auth
12
-
13
- EXAMPLE
14
- $ apimatic auth --help
15
-
16
- COMMANDS
17
- auth:login login to your APIMatic account
18
- auth:logout logout of APIMatic
19
- auth:status checks current logged-in account`);
20
- };
21
- }
22
- }
23
- exports.default = Auth;
24
- Auth.description = "invokes subcommands related to authentication.";
25
- Auth.examples = ["$ apimatic auth --help"];
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class SDK extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run(): Promise<void>;
6
- }
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class SDK extends command_1.Command {
5
- async run() {
6
- this.log(`invokes subcommands related to the API Portal.
7
-
8
- USAGE
9
- $ apimatic portal
10
-
11
- EXAMPLE
12
- $apimatic portal --help
13
-
14
- COMMANDS
15
- portal:generate Generate static docs portal on premise`);
16
- }
17
- }
18
- exports.default = SDK;
19
- SDK.description = "invokes subcommands related to the API Portal.";
20
- SDK.examples = ["$apimatic portal --help"];
@@ -1,6 +0,0 @@
1
- import { Command } from "@oclif/command";
2
- export default class SDK extends Command {
3
- static description: string;
4
- static examples: string[];
5
- run(): Promise<void>;
6
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const command_1 = require("@oclif/command");
4
- class SDK extends command_1.Command {
5
- // eslint-disable-next-line @typescript-eslint/no-empty-function
6
- async run() {
7
- this.log(`invokes subcommands related to your SDKs.
8
-
9
- USAGE
10
- $ apimatic sdk
11
-
12
- EXAMPLE
13
- $apimatic sdk --help
14
-
15
- COMMANDS
16
- sdk:generate Generate SDK for your APIs`);
17
- }
18
- }
19
- exports.default = SDK;
20
- SDK.description = "invokes subcommands related to your SDKs.";
21
- SDK.examples = ["$apimatic sdk --help"];