@apimatic/cli 1.1.0-alpha.8 → 1.1.0-beta.1
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 +436 -374
- package/bin/run.js +5 -0
- package/lib/actions/action-result.d.ts +13 -0
- package/lib/actions/action-result.js +44 -0
- package/lib/actions/action-result.js.map +1 -0
- package/lib/actions/api/transform.d.ts +15 -0
- package/lib/actions/api/transform.js +48 -0
- package/lib/actions/api/transform.js.map +1 -0
- package/lib/actions/api/validate.d.ts +12 -0
- package/lib/actions/api/validate.js +41 -0
- package/lib/actions/api/validate.js.map +1 -0
- package/lib/actions/auth/login.d.ts +13 -0
- package/lib/actions/auth/login.js +55 -0
- package/lib/actions/auth/login.js.map +1 -0
- package/lib/actions/auth/logout.d.ts +8 -0
- package/lib/actions/auth/logout.js +15 -0
- package/lib/actions/auth/logout.js.map +1 -0
- package/lib/actions/auth/status.d.ts +11 -0
- package/lib/actions/auth/status.js +26 -0
- package/lib/actions/auth/status.js.map +1 -0
- package/lib/actions/portal/copilot.d.ts +16 -0
- package/lib/actions/portal/copilot.js +89 -0
- package/lib/actions/portal/copilot.js.map +1 -0
- package/lib/actions/portal/generate.d.ts +11 -5
- package/lib/actions/portal/generate.js +60 -55
- package/lib/actions/portal/generate.js.map +1 -0
- package/lib/actions/portal/quickstart.d.ts +16 -0
- package/lib/actions/portal/quickstart.js +146 -0
- package/lib/actions/portal/quickstart.js.map +1 -0
- package/lib/actions/portal/recipe/new-recipe.d.ts +15 -0
- package/lib/actions/portal/recipe/new-recipe.js +177 -0
- package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +15 -0
- package/lib/actions/portal/serve.js +118 -0
- package/lib/actions/portal/serve.js.map +1 -0
- package/lib/actions/portal/toc/new-toc.d.ts +21 -0
- package/lib/actions/portal/toc/new-toc.js +97 -0
- package/lib/actions/portal/toc/new-toc.js.map +1 -0
- package/lib/actions/quickstart.d.ts +10 -0
- package/lib/actions/quickstart.js +30 -0
- package/lib/actions/quickstart.js.map +1 -0
- package/lib/actions/sdk/generate.d.ts +13 -0
- package/lib/actions/sdk/generate.js +47 -0
- package/lib/actions/sdk/generate.js.map +1 -0
- package/lib/actions/sdk/quickstart.d.ts +14 -0
- package/lib/actions/sdk/quickstart.js +149 -0
- package/lib/actions/sdk/quickstart.js.map +1 -0
- package/lib/application/portal/recipe/portal-recipe.d.ts +8 -0
- package/lib/application/portal/recipe/portal-recipe.js +33 -0
- package/lib/application/portal/recipe/portal-recipe.js.map +1 -0
- package/lib/application/portal/recipe/recipe-generator.d.ts +21 -0
- package/lib/application/portal/recipe/recipe-generator.js +145 -0
- package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
- package/lib/application/portal/{new/toc → toc}/toc-content-parser.d.ts +1 -1
- package/lib/application/portal/toc/toc-content-parser.js +44 -0
- package/lib/application/portal/toc/toc-content-parser.js.map +1 -0
- package/lib/application/portal/{new/toc → toc}/toc-structure-generator.d.ts +1 -1
- package/lib/application/portal/toc/toc-structure-generator.js +84 -0
- package/lib/application/portal/toc/toc-structure-generator.js.map +1 -0
- package/lib/client-utils/auth-manager.d.ts +7 -2
- package/lib/client-utils/auth-manager.js +26 -14
- package/lib/client-utils/auth-manager.js.map +1 -0
- package/lib/commands/api/transform.d.ts +10 -7
- package/lib/commands/api/transform.js +51 -111
- package/lib/commands/api/transform.js.map +1 -0
- package/lib/commands/api/validate.d.ts +7 -4
- package/lib/commands/api/validate.js +31 -74
- package/lib/commands/api/validate.js.map +1 -0
- package/lib/commands/auth/login.d.ts +3 -1
- package/lib/commands/auth/login.js +26 -68
- package/lib/commands/auth/login.js.map +1 -0
- package/lib/commands/auth/logout.d.ts +3 -1
- package/lib/commands/auth/logout.js +14 -21
- package/lib/commands/auth/logout.js.map +1 -0
- package/lib/commands/auth/status.d.ts +1 -0
- package/lib/commands/auth/status.js +18 -21
- package/lib/commands/auth/status.js.map +1 -0
- package/lib/commands/portal/copilot.d.ts +13 -0
- package/lib/commands/portal/copilot.js +34 -0
- package/lib/commands/portal/copilot.js.map +1 -0
- package/lib/commands/portal/generate.d.ts +7 -11
- package/lib/commands/portal/generate.js +26 -89
- package/lib/commands/portal/generate.js.map +1 -0
- package/lib/commands/portal/recipe/new.d.ts +12 -0
- package/lib/commands/portal/recipe/new.js +45 -0
- package/lib/commands/portal/recipe/new.js.map +1 -0
- package/lib/commands/portal/serve.d.ts +8 -8
- package/lib/commands/portal/serve.js +41 -125
- package/lib/commands/portal/serve.js.map +1 -0
- package/lib/commands/portal/toc/new.d.ts +14 -0
- package/lib/commands/portal/toc/new.js +60 -0
- package/lib/commands/portal/toc/new.js.map +1 -0
- package/lib/commands/quickstart.d.ts +9 -0
- package/lib/commands/quickstart.js +37 -0
- package/lib/commands/quickstart.js.map +1 -0
- package/lib/commands/sdk/generate.d.ts +10 -8
- package/lib/commands/sdk/generate.js +46 -131
- package/lib/commands/sdk/generate.js.map +1 -0
- package/lib/config/axios-config.js +4 -6
- package/lib/config/axios-config.js.map +1 -0
- package/lib/hooks/not-found.d.ts +3 -0
- package/lib/hooks/not-found.js +52 -0
- package/lib/hooks/not-found.js.map +1 -0
- package/lib/hooks/utils.d.ts +5 -0
- package/lib/hooks/utils.js +51 -0
- package/lib/hooks/utils.js.map +1 -0
- package/lib/index.js +2 -5
- package/lib/index.js.map +1 -0
- package/lib/infrastructure/debounce-service.d.ts +10 -0
- package/lib/infrastructure/debounce-service.js +52 -0
- package/lib/infrastructure/debounce-service.js.map +1 -0
- package/lib/infrastructure/env-info.d.ts +12 -0
- package/lib/infrastructure/env-info.js +58 -0
- package/lib/infrastructure/env-info.js.map +1 -0
- package/lib/infrastructure/file-service.d.ts +24 -0
- package/lib/infrastructure/file-service.js +120 -0
- package/lib/infrastructure/file-service.js.map +1 -0
- package/lib/infrastructure/launcher-service.d.ts +9 -0
- package/lib/infrastructure/launcher-service.js +72 -0
- package/lib/infrastructure/launcher-service.js.map +1 -0
- package/lib/infrastructure/network-service.d.ts +3 -0
- package/lib/infrastructure/network-service.js +7 -0
- package/lib/infrastructure/network-service.js.map +1 -0
- package/lib/infrastructure/service-error.d.ts +16 -0
- package/lib/infrastructure/service-error.js +49 -0
- package/lib/infrastructure/service-error.js.map +1 -0
- package/lib/infrastructure/services/api-client-factory.d.ts +6 -0
- package/lib/infrastructure/services/api-client-factory.js +20 -0
- package/lib/infrastructure/services/api-client-factory.js.map +1 -0
- package/lib/infrastructure/services/api-service.d.ts +12 -0
- package/lib/infrastructure/services/api-service.js +79 -0
- package/lib/infrastructure/services/api-service.js.map +1 -0
- package/lib/infrastructure/services/auth-service.d.ts +11 -0
- package/lib/infrastructure/services/auth-service.js +37 -0
- package/lib/infrastructure/services/auth-service.js.map +1 -0
- package/lib/infrastructure/services/file-download-service.d.ts +15 -0
- package/lib/infrastructure/services/file-download-service.js +104 -0
- package/lib/infrastructure/services/file-download-service.js.map +1 -0
- package/lib/infrastructure/services/portal-service.d.ts +17 -12
- package/lib/infrastructure/services/portal-service.js +134 -99
- package/lib/infrastructure/services/portal-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.d.ts +9 -0
- package/lib/infrastructure/services/telemetry-service.js +38 -0
- package/lib/infrastructure/services/telemetry-service.js.map +1 -0
- package/lib/infrastructure/services/transformation-service.d.ts +23 -0
- package/lib/infrastructure/services/transformation-service.js +56 -0
- package/lib/infrastructure/services/transformation-service.js.map +1 -0
- package/lib/infrastructure/services/validation-service.d.ts +17 -0
- package/lib/infrastructure/services/validation-service.js +49 -0
- package/lib/infrastructure/services/validation-service.js.map +1 -0
- package/lib/infrastructure/tmp-extensions.d.ts +2 -0
- package/lib/infrastructure/tmp-extensions.js +6 -0
- package/lib/infrastructure/tmp-extensions.js.map +1 -0
- package/lib/infrastructure/zip-service.d.ts +6 -0
- package/lib/infrastructure/zip-service.js +39 -0
- package/lib/infrastructure/zip-service.js.map +1 -0
- package/lib/prompts/api/transform.d.ts +11 -0
- package/lib/prompts/api/transform.js +29 -0
- package/lib/prompts/api/transform.js.map +1 -0
- package/lib/prompts/api/validate.d.ts +12 -0
- package/lib/prompts/api/validate.js +40 -0
- package/lib/prompts/api/validate.js.map +1 -0
- package/lib/prompts/auth/login.d.ts +10 -0
- package/lib/prompts/auth/login.js +22 -0
- package/lib/prompts/auth/login.js.map +1 -0
- package/lib/prompts/auth/logout.d.ts +3 -0
- package/lib/prompts/auth/logout.js +7 -0
- package/lib/prompts/auth/logout.js.map +1 -0
- package/lib/prompts/auth/status.d.ts +8 -0
- package/lib/prompts/auth/status.js +22 -0
- package/lib/prompts/auth/status.js.map +1 -0
- package/lib/prompts/format.d.ts +31 -0
- package/lib/prompts/format.js +89 -0
- package/lib/prompts/format.js.map +1 -0
- package/lib/prompts/portal/copilot.d.ts +18 -0
- package/lib/prompts/portal/copilot.js +82 -0
- package/lib/prompts/portal/copilot.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +13 -8
- package/lib/prompts/portal/generate.js +36 -53
- package/lib/prompts/portal/generate.js.map +1 -0
- package/lib/prompts/portal/quickstart.d.ts +28 -29
- package/lib/prompts/portal/quickstart.js +102 -185
- package/lib/prompts/portal/quickstart.js.map +1 -0
- package/lib/prompts/portal/recipe/new-recipe.d.ts +29 -0
- package/lib/prompts/portal/recipe/new-recipe.js +165 -0
- package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +9 -5
- package/lib/prompts/portal/serve.js +29 -19
- package/lib/prompts/portal/serve.js.map +1 -0
- package/lib/prompts/portal/toc/new-toc.d.ts +15 -0
- package/lib/prompts/portal/toc/new-toc.js +38 -0
- package/lib/prompts/portal/toc/new-toc.js.map +1 -0
- package/lib/prompts/prompt.d.ts +3 -0
- package/lib/prompts/prompt.js +37 -0
- package/lib/prompts/prompt.js.map +1 -0
- package/lib/prompts/quickstart.d.ts +6 -0
- package/lib/prompts/quickstart.js +25 -0
- package/lib/prompts/quickstart.js.map +1 -0
- package/lib/prompts/sdk/generate.d.ts +11 -0
- package/lib/prompts/sdk/generate.js +37 -0
- package/lib/prompts/sdk/generate.js.map +1 -0
- package/lib/prompts/sdk/quickstart.d.ts +32 -0
- package/lib/prompts/sdk/quickstart.js +140 -0
- package/lib/prompts/sdk/quickstart.js.map +1 -0
- package/lib/types/api/account.d.ts +10 -0
- package/lib/types/api/account.js +2 -0
- package/lib/types/api/account.js.map +1 -0
- package/lib/types/api/transform.d.ts +14 -25
- package/lib/types/api/transform.js +20 -23
- package/lib/types/api/transform.js.map +1 -0
- package/lib/types/build/build.d.ts +22 -0
- package/lib/types/build/build.js +7 -0
- package/lib/types/build/build.js.map +1 -0
- package/lib/types/build-context.d.ts +13 -0
- package/lib/types/build-context.js +33 -0
- package/lib/types/build-context.js.map +1 -0
- package/lib/types/common/command-metadata.d.ts +4 -0
- package/lib/types/common/command-metadata.js +2 -0
- package/lib/types/common/command-metadata.js.map +1 -0
- package/lib/types/events/domain-event.d.ts +8 -0
- package/lib/types/events/domain-event.js +11 -0
- package/lib/types/events/domain-event.js.map +1 -0
- package/lib/types/events/quickstart-completed.d.ts +7 -0
- package/lib/types/events/quickstart-completed.js +10 -0
- package/lib/types/events/quickstart-completed.js.map +1 -0
- package/lib/types/events/quickstart-initiated.d.ts +7 -0
- package/lib/types/events/quickstart-initiated.js +10 -0
- package/lib/types/events/quickstart-initiated.js.map +1 -0
- package/lib/types/events/recipe-creation-failed.d.ts +5 -0
- package/lib/types/events/recipe-creation-failed.js +8 -0
- package/lib/types/events/recipe-creation-failed.js.map +1 -0
- package/lib/types/events/toc-creation-failed.d.ts +5 -0
- package/lib/types/events/toc-creation-failed.js +8 -0
- package/lib/types/events/toc-creation-failed.js.map +1 -0
- package/lib/types/file/directory.d.ts +17 -0
- package/lib/types/file/directory.js +87 -0
- package/lib/types/file/directory.js.map +1 -0
- package/lib/types/file/directoryPath.d.ts +10 -0
- package/lib/types/file/directoryPath.js +26 -0
- package/lib/types/file/directoryPath.js.map +1 -0
- package/lib/types/file/fileName.d.ts +7 -0
- package/lib/types/file/fileName.js +21 -0
- package/lib/types/file/fileName.js.map +1 -0
- package/lib/types/file/filePath.d.ts +10 -0
- package/lib/types/file/filePath.js +32 -0
- package/lib/types/file/filePath.js.map +1 -0
- package/lib/types/file/resource-input.d.ts +5 -0
- package/lib/types/file/resource-input.js +42 -0
- package/lib/types/file/resource-input.js.map +1 -0
- package/lib/types/file/urlPath.d.ts +6 -0
- package/lib/types/file/urlPath.js +22 -0
- package/lib/types/file/urlPath.js.map +1 -0
- package/lib/types/flags-provider.d.ts +15 -0
- package/lib/types/flags-provider.js +34 -0
- package/lib/types/flags-provider.js.map +1 -0
- package/lib/types/portal-context.d.ts +13 -0
- package/lib/types/portal-context.js +38 -0
- package/lib/types/portal-context.js.map +1 -0
- package/lib/types/recipe/recipe.d.ts +22 -0
- package/lib/types/recipe/recipe.js +6 -0
- package/lib/types/recipe/recipe.js.map +1 -0
- package/lib/types/recipe-context.d.ts +9 -0
- package/lib/types/recipe-context.js +26 -0
- package/lib/types/recipe-context.js.map +1 -0
- package/lib/types/resource-context.d.ts +12 -0
- package/lib/types/resource-context.js +30 -0
- package/lib/types/resource-context.js.map +1 -0
- package/lib/types/sdk/generate.d.ts +9 -22
- package/lib/types/sdk/generate.js +25 -14
- package/lib/types/sdk/generate.js.map +1 -0
- package/lib/types/sdk-context.d.ts +14 -0
- package/lib/types/sdk-context.js +32 -0
- package/lib/types/sdk-context.js.map +1 -0
- package/lib/types/sdl/sdl.d.ts +10 -0
- package/lib/types/sdl/sdl.js +47 -3
- package/lib/types/sdl/sdl.js.map +1 -0
- package/lib/types/spec-context.d.ts +12 -0
- package/lib/types/spec-context.js +29 -0
- package/lib/types/spec-context.js.map +1 -0
- package/lib/types/temp-context.d.ts +11 -0
- package/lib/types/temp-context.js +27 -0
- package/lib/types/temp-context.js.map +1 -0
- package/lib/types/toc/toc.js +2 -10
- package/lib/types/toc/toc.js.map +1 -0
- package/lib/types/toc-context.d.ts +12 -0
- package/lib/types/toc-context.js +26 -0
- package/lib/types/toc-context.js.map +1 -0
- package/lib/types/transform-context.d.ts +13 -0
- package/lib/types/transform-context.js +30 -0
- package/lib/types/transform-context.js.map +1 -0
- package/lib/types/utils.d.ts +0 -9
- package/lib/types/utils.js +2 -3
- package/lib/types/utils.js.map +1 -0
- package/lib/utils/string-utils.d.ts +2 -0
- package/lib/utils/string-utils.js +37 -0
- package/lib/utils/string-utils.js.map +1 -0
- package/lib/utils/utils.d.ts +2 -44
- package/lib/utils/utils.js +14 -366
- package/lib/utils/utils.js.map +1 -0
- package/package.json +50 -31
- package/bin/run +0 -9
- package/lib/actions/portal/new/toc.d.ts +0 -17
- package/lib/actions/portal/new/toc.js +0 -134
- package/lib/application/portal/new/toc/sdl-parser.d.ts +0 -13
- package/lib/application/portal/new/toc/sdl-parser.js +0 -53
- package/lib/application/portal/new/toc/toc-content-parser.js +0 -46
- package/lib/application/portal/new/toc/toc-structure-generator.js +0 -88
- package/lib/client-utils/sdk-client.d.ts +0 -23
- package/lib/client-utils/sdk-client.js +0 -124
- package/lib/commands/portal/new/toc.d.ts +0 -15
- package/lib/commands/portal/new/toc.js +0 -65
- package/lib/commands/portal/quickstart.d.ts +0 -10
- package/lib/commands/portal/quickstart.js +0 -79
- package/lib/config/env.d.ts +0 -27
- package/lib/config/env.js +0 -31
- package/lib/controllers/api/transform.d.ts +0 -5
- package/lib/controllers/api/transform.js +0 -56
- package/lib/controllers/api/validate.d.ts +0 -3
- package/lib/controllers/api/validate.js +0 -33
- package/lib/controllers/portal/generate.d.ts +0 -3
- package/lib/controllers/portal/generate.js +0 -110
- package/lib/controllers/portal/quickstart.d.ts +0 -14
- package/lib/controllers/portal/quickstart.js +0 -258
- package/lib/controllers/portal/serve.d.ts +0 -3
- package/lib/controllers/portal/serve.js +0 -138
- package/lib/controllers/sdk/generate.d.ts +0 -4
- package/lib/controllers/sdk/generate.js +0 -66
- package/lib/prompts/portal/new/toc.d.ts +0 -10
- package/lib/prompts/portal/new/toc.js +0 -46
- package/lib/services/portal/server.d.ts +0 -14
- package/lib/services/portal/server.js +0 -101
- package/lib/types/api/validate.d.ts +0 -12
- package/lib/types/api/validate.js +0 -3
- package/lib/types/common/result.d.ts +0 -17
- package/lib/types/common/result.js +0 -36
- package/lib/types/portal/generate.d.ts +0 -26
- package/lib/types/portal/generate.js +0 -4
- package/lib/types/portal/quickstart.d.ts +0 -17
- package/lib/types/portal/quickstart.js +0 -3
- package/lib/validators/common/directoryValidator.d.ts +0 -9
- package/lib/validators/common/directoryValidator.js +0 -53
- package/lib/validators/common/portValidator.d.ts +0 -5
- package/lib/validators/common/portValidator.js +0 -20
- package/lib/validators/portal/serveValidator.d.ts +0 -6
- package/lib/validators/portal/serveValidator.js +0 -21
|
@@ -1,77 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const sdk_client_1 = require("../../client-utils/sdk-client");
|
|
7
|
-
class Login extends core_1.Command {
|
|
1
|
+
import { Command, Flags } from "@oclif/core";
|
|
2
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
3
|
+
import { LoginAction } from "../../actions/auth/login.js";
|
|
4
|
+
import { format, intro, outro } from "../../prompts/format.js";
|
|
5
|
+
class Login extends Command {
|
|
8
6
|
async run() {
|
|
9
|
-
const { flags } = await this.parse(Login);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const client = sdk_client_1.SDKClient.getInstance();
|
|
13
|
-
// If user is setting auth key
|
|
14
|
-
if (flags["auth-key"]) {
|
|
15
|
-
const response = client.setAuthKey(flags["auth-key"], configDir);
|
|
16
|
-
return this.log(response);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
// If user logs in with email and password
|
|
20
|
-
const email = await (0, prompts_1.text)({
|
|
21
|
-
message: "Enter your registered email:",
|
|
22
|
-
validate: (input) => {
|
|
23
|
-
if (!input) {
|
|
24
|
-
return (0, utils_1.getMessageInRedColor)("Email is required.");
|
|
25
|
-
}
|
|
26
|
-
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
27
|
-
if (!emailRegex.test(input)) {
|
|
28
|
-
return (0, utils_1.getMessageInRedColor)("Please enter a valid email address.");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const pass = await (0, prompts_1.password)({
|
|
33
|
-
message: "Please enter your password:",
|
|
34
|
-
validate: (input) => {
|
|
35
|
-
if (!input) {
|
|
36
|
-
return (0, utils_1.getMessageInRedColor)("Password is required.");
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const response = await client.login(email, pass, configDir);
|
|
41
|
-
(0, prompts_1.outro)(response);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
catch (error) {
|
|
45
|
-
if (error && error.response) {
|
|
46
|
-
const apiError = error;
|
|
47
|
-
const apiResponse = apiError.response;
|
|
48
|
-
if (apiResponse) {
|
|
49
|
-
const responseData = apiResponse.data;
|
|
50
|
-
if (apiResponse.status === 403 && responseData) {
|
|
51
|
-
return this.error((0, utils_1.replaceHTML)(JSON.stringify(responseData)));
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
return this.error(apiError.message);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
this.error(error.message);
|
|
7
|
+
const { flags: { "auth-key": authKey } } = await this.parse(Login);
|
|
8
|
+
if (authKey === "") {
|
|
9
|
+
this.error("Flag --auth-key must not be empty when provided.");
|
|
59
10
|
}
|
|
11
|
+
const commandMetadata = {
|
|
12
|
+
commandName: Login.id,
|
|
13
|
+
shell: this.config.shell
|
|
14
|
+
};
|
|
15
|
+
intro("Login");
|
|
16
|
+
const loginAction = new LoginAction(new DirectoryPath(this.config.configDir), commandMetadata);
|
|
17
|
+
const result = await loginAction.execute(authKey);
|
|
18
|
+
outro(result);
|
|
60
19
|
}
|
|
61
20
|
}
|
|
21
|
+
Login.summary = "Login to your APIMatic account";
|
|
62
22
|
Login.description = "Login using your APIMatic credentials or an API Key";
|
|
23
|
+
Login.cmdTxt = format.cmd('apimatic', 'auth', 'login');
|
|
63
24
|
Login.examples = [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
Please enter your password: *********
|
|
67
|
-
|
|
68
|
-
You have successfully logged into APIMatic
|
|
69
|
-
`,
|
|
70
|
-
`$ apimatic auth:login --auth-key=xxxxxx
|
|
71
|
-
Authentication key successfully set`
|
|
25
|
+
Login.cmdTxt,
|
|
26
|
+
`${Login.cmdTxt} ${format.flag('auth-key', '{api-key}')}`
|
|
72
27
|
];
|
|
73
28
|
Login.flags = {
|
|
74
|
-
"auth-key":
|
|
29
|
+
"auth-key": Flags.string({
|
|
30
|
+
char: "k",
|
|
31
|
+
description: "Sets authentication key for all commands."
|
|
32
|
+
})
|
|
75
33
|
};
|
|
76
|
-
|
|
77
|
-
//# sourceMappingURL=
|
|
34
|
+
export default Login;
|
|
35
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/commands/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE1D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAqB,KAAM,SAAQ,OAAO;IAkBxC,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,EAC/B,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAE5B,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;YACnB,IAAI,CAAC,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACjE,CAAC;QAED,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,KAAK,CAAC,EAAE;YACrB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,MAAM,WAAW,GAAG,IAAI,WAAW,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC;QAC/F,MAAM,MAAM,GAAG,MAAM,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QAClD,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;;AAnCM,aAAO,GAAG,gCAAgC,CAAC;AAE3C,iBAAW,GAAG,qDAAqD,CAAC;AAE5D,YAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAG,MAAM,EAAE,OAAO,CAAC,CAAC;AAC1D,cAAQ,GAAG;IAChB,KAAK,CAAC,MAAM;IACZ,GAAG,KAAK,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,EAAE;CAAC,CAAC;AAEtD,WAAK,GAAG;IACb,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,2CAA2C;KACzD,CAAC;CACH,CAAC;eAfiB,KAAK"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
|
-
export default class
|
|
2
|
+
export default class Logout extends Command {
|
|
3
|
+
static summary: string;
|
|
3
4
|
static description: string;
|
|
5
|
+
private static cmdTxt;
|
|
4
6
|
static examples: string[];
|
|
5
7
|
run(): Promise<void>;
|
|
6
8
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
import { format, intro, outro } from "../../prompts/format.js";
|
|
3
|
+
import { LogoutAction } from "../../actions/auth/logout.js";
|
|
4
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
5
|
+
class Logout extends Command {
|
|
6
6
|
async run() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.log(response);
|
|
11
|
-
}
|
|
12
|
-
catch (error) {
|
|
13
|
-
this.error(error);
|
|
14
|
-
}
|
|
7
|
+
intro("Logout");
|
|
8
|
+
const actionResult = await new LogoutAction(new DirectoryPath(this.config.configDir)).execute();
|
|
9
|
+
outro(actionResult);
|
|
15
10
|
}
|
|
16
11
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.default = Login;
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nb3V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbW1hbmRzL2F1dGgvbG9nb3V0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsc0NBQXNDO0FBRXRDLDhEQUEwRDtBQUUxRCxNQUFxQixLQUFNLFNBQVEsY0FBTztJQVN4QyxLQUFLLENBQUMsR0FBRztRQUNQLElBQUksQ0FBQztZQUNILE1BQU0sTUFBTSxHQUFHLHNCQUFTLENBQUMsV0FBVyxFQUFFLENBQUM7WUFDdkMsTUFBTSxRQUFRLEdBQUcsTUFBTSxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLENBQUM7WUFFNUQsSUFBSSxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUNyQixDQUFDO1FBQUMsT0FBTyxLQUFLLEVBQUUsQ0FBQztZQUNmLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBZSxDQUFDLENBQUM7UUFDOUIsQ0FBQztJQUNILENBQUM7O0FBakJNLGlCQUFXLEdBQUcsK0JBQStCLENBQUM7QUFFOUMsY0FBUSxHQUFHO0lBQ2hCOztDQUVIO0NBQ0UsQ0FBQztrQkFQaUIsS0FBSyJ9
|
|
12
|
+
Logout.summary = "Clears the local login credentials.";
|
|
13
|
+
Logout.description = "Clears the local login credentials. This will also clear any cached credentials from the CLI.";
|
|
14
|
+
Logout.cmdTxt = format.cmd('apimatic', 'auth', 'logout');
|
|
15
|
+
Logout.examples = [Logout.cmdTxt];
|
|
16
|
+
export default Logout;
|
|
17
|
+
//# sourceMappingURL=logout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAElE,MAAqB,MAAO,SAAQ,OAAO;IAQzC,KAAK,CAAC,GAAG;QAEP,KAAK,CAAC,QAAQ,CAAC,CAAC;QAChB,MAAM,YAAY,GAAG,MAAM,IAAI,YAAY,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAChG,KAAK,CAAC,YAAY,CAAC,CAAA;IACrB,CAAC;;AAZM,cAAO,GAAG,qCAAqC,CAAC;AAEhD,kBAAW,GAAG,+FAA+F,CAAC;AAEtG,aAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAG,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC3D,eAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;eANf,MAAM"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class Status extends
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
import { format, intro, outro } from "../../prompts/format.js";
|
|
3
|
+
import { StatusAction } from "../../actions/auth/status.js";
|
|
4
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
5
|
+
class Status extends Command {
|
|
6
6
|
async run() {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
7
|
+
const commandMetadata = {
|
|
8
|
+
commandName: Status.id,
|
|
9
|
+
shell: this.config.shell
|
|
10
|
+
};
|
|
11
|
+
intro('Status');
|
|
12
|
+
const statusAction = new StatusAction(new DirectoryPath(this.config.configDir), commandMetadata);
|
|
13
|
+
const actionResult = await statusAction.execute(null);
|
|
14
|
+
outro(actionResult);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
Status.description = "View
|
|
18
|
-
Status.
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
];
|
|
23
|
-
exports.default = Status;
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RhdHVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvbW1hbmRzL2F1dGgvc3RhdHVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsc0NBQXNDO0FBRXRDLDhEQUEwRDtBQUUxRCxNQUFxQixNQUFPLFNBQVEsY0FBTztJQVN6QyxLQUFLLENBQUMsR0FBRztRQUNQLElBQUksQ0FBQztZQUNILE1BQU0sTUFBTSxHQUFHLHNCQUFTLENBQUMsV0FBVyxFQUFFLENBQUM7WUFDdkMsTUFBTSxRQUFRLEdBQUcsTUFBTSxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLENBQUM7WUFFNUQsSUFBSSxDQUFDLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQztRQUNyQixDQUFDO1FBQUMsT0FBTyxLQUFLLEVBQUUsQ0FBQztZQUNmLElBQUksQ0FBQyxLQUFLLENBQUMsS0FBZSxDQUFDLENBQUM7UUFDOUIsQ0FBQztJQUNILENBQUM7O0FBakJNLGtCQUFXLEdBQUcsbUNBQW1DLENBQUM7QUFFbEQsZUFBUSxHQUFHO0lBQ2hCOztDQUVIO0NBQ0UsQ0FBQztrQkFQaUIsTUFBTSJ9
|
|
17
|
+
Status.description = "View the currently logged in user.";
|
|
18
|
+
Status.cmdTxt = format.cmd('apimatic', 'auth', 'status');
|
|
19
|
+
Status.examples = [Status.cmdTxt];
|
|
20
|
+
export default Status;
|
|
21
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/commands/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAIlE,MAAqB,MAAO,SAAQ,OAAO;IAMzC,KAAK,CAAC,GAAG;QAEP,MAAM,eAAe,GAAoB;YACvC,WAAW,EAAE,MAAM,CAAC,EAAE;YACtB,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,QAAQ,CAAC,CAAA;QACf,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,eAAe,CAAC,CAAC;QACjG,MAAM,YAAY,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACtD,KAAK,CAAC,YAAY,CAAC,CAAA;IACrB,CAAC;;AAhBM,kBAAW,GAAG,oCAAoC,CAAC;AAE3C,aAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAG,MAAM,EAAE,QAAQ,CAAC,CAAC;AAC3D,eAAQ,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;eAJf,MAAM"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class PortalCopilot extends Command {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
disable: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
};
|
|
10
|
+
static cmdTxt: string;
|
|
11
|
+
static examples: string[];
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { Command, Flags } from "@oclif/core";
|
|
3
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
4
|
+
import { FlagsProvider } from "../../types/flags-provider.js";
|
|
5
|
+
import { CopilotAction } from "../../actions/portal/copilot.js";
|
|
6
|
+
import { format, intro, outro } from "../../prompts/format.js";
|
|
7
|
+
class PortalCopilot extends Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { flags: { input, "auth-key": authKey, disable, force } } = await this.parse(_a);
|
|
10
|
+
const commandMetadata = {
|
|
11
|
+
commandName: _a.id,
|
|
12
|
+
shell: this.config.shell
|
|
13
|
+
};
|
|
14
|
+
intro("Configure API Copilot");
|
|
15
|
+
const buildDirectory = DirectoryPath.createInput(input).join("src");
|
|
16
|
+
const copilotConfigAction = new CopilotAction(new DirectoryPath(this.config.configDir), commandMetadata, authKey);
|
|
17
|
+
const result = await copilotConfigAction.execute(buildDirectory, force, !disable);
|
|
18
|
+
outro(result);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
_a = PortalCopilot;
|
|
22
|
+
PortalCopilot.summary = "Configure API Copilot for your API Documentation portal";
|
|
23
|
+
PortalCopilot.description = `Displays available API Copilots associated with your account and allows you to select which one to integrate with your portal. Each APIMatic account includes one Copilot by default. The selected Copilot will be added to your ${format.var("APIMATIC-BUILD.json")} file`;
|
|
24
|
+
PortalCopilot.flags = Object.assign(Object.assign(Object.assign(Object.assign({}, FlagsProvider.input), { disable: Flags.boolean({
|
|
25
|
+
default: false,
|
|
26
|
+
description: "marks the API Copilot as disabled in the configuration"
|
|
27
|
+
}) }), FlagsProvider.force), FlagsProvider.authKey);
|
|
28
|
+
PortalCopilot.cmdTxt = format.cmd("apimatic", "portal", "copilot");
|
|
29
|
+
PortalCopilot.examples = [
|
|
30
|
+
`${_a.cmdTxt} ${format.flag("input", './')}`,
|
|
31
|
+
`${_a.cmdTxt} ${format.flag("input", './')} ${format.flag("disable")}`
|
|
32
|
+
];
|
|
33
|
+
export default PortalCopilot;
|
|
34
|
+
//# sourceMappingURL=copilot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/commands/portal/copilot.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MA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Pd,CAQV;AAEK,oBAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,AAA9C,CAA+C;AACrD,sBAAQ,GAAG;IAChB,GAAG,EAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;IAC9C,GAAG,EAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE;CACzE,AAHc,CAGb;eApBiB,aAAa"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
|
-
export
|
|
2
|
+
export declare class PortalGenerate extends Command {
|
|
3
|
+
static summary: string;
|
|
3
4
|
static description: string;
|
|
4
5
|
static flags: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
force: import("@oclif/core/
|
|
8
|
-
|
|
9
|
-
"auth-key": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
zip: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
10
|
};
|
|
11
|
+
static cmdTxt: string;
|
|
11
12
|
static examples: string[];
|
|
12
|
-
private readonly prompts;
|
|
13
|
-
constructor(argv: string[], config: any);
|
|
14
13
|
run(): Promise<void>;
|
|
15
|
-
private getPortalPaths;
|
|
16
|
-
private validatePaths;
|
|
17
|
-
private checkExistingPortal;
|
|
18
14
|
}
|
|
@@ -1,98 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var _a;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const generate_2 = require("../../actions/portal/generate");
|
|
10
|
-
const result_1 = require("../../types/common/result");
|
|
11
|
-
const DEFAULT_FOLDER = "./";
|
|
12
|
-
const DEFAULT_DESTINATION = path.resolve("./");
|
|
13
|
-
const GENERATED_PORTAL_ARTIFACTS_FOLDER = "generated_portal";
|
|
14
|
-
const GENERATED_PORTAL_ARTIFACTS_ZIP = ".generated_portal.zip";
|
|
15
|
-
class PortalGenerate extends core_1.Command {
|
|
16
|
-
constructor(argv, config) {
|
|
17
|
-
super(argv, config);
|
|
18
|
-
this.prompts = new generate_1.PortalGeneratePrompts();
|
|
19
|
-
}
|
|
2
|
+
import { Command, Flags } from "@oclif/core";
|
|
3
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
4
|
+
import { GenerateAction } from "../../actions/portal/generate.js";
|
|
5
|
+
import { FlagsProvider } from "../../types/flags-provider.js";
|
|
6
|
+
import { format, intro, outro } from "../../prompts/format.js";
|
|
7
|
+
export class PortalGenerate extends Command {
|
|
20
8
|
async run() {
|
|
21
|
-
const { flags } = await this.parse(_a);
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const validationResult = await this.validatePaths(paths);
|
|
29
|
-
if (validationResult.isFailed()) {
|
|
30
|
-
this.error(validationResult.error);
|
|
31
|
-
}
|
|
32
|
-
await portalGenerateAction.generatePortal(paths, flags, this.config.configDir);
|
|
33
|
-
}
|
|
34
|
-
async getPortalPaths(flags) {
|
|
35
|
-
return {
|
|
36
|
-
sourceFolderPath: flags.folder,
|
|
37
|
-
destinationFolderPath: flags.destination,
|
|
38
|
-
generatedPortalArtifactsFolderPath: path.join(flags.destination, GENERATED_PORTAL_ARTIFACTS_FOLDER),
|
|
39
|
-
generatedPortalArtifactsZipFilePath: path.join(flags.destination, GENERATED_PORTAL_ARTIFACTS_ZIP)
|
|
9
|
+
const { flags: { input, destination, force, zip: zipPortal, "auth-key": authKey } } = await this.parse(_a);
|
|
10
|
+
const workingDirectory = DirectoryPath.createInput(input);
|
|
11
|
+
const buildDirectory = input ? new DirectoryPath(input, "src") : workingDirectory.join("src");
|
|
12
|
+
const portalDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join("portal");
|
|
13
|
+
const commandMetadata = {
|
|
14
|
+
commandName: _a.id,
|
|
15
|
+
shell: this.config.shell
|
|
40
16
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
if (!(await fs.pathExists(path.dirname(paths.generatedPortalArtifactsFolderPath)))) {
|
|
47
|
-
return result_1.Result.failure((0, utils_1.getMessageInRedColor)(`Destination path ${path.dirname(paths.generatedPortalArtifactsFolderPath)} does not exist.`));
|
|
48
|
-
}
|
|
49
|
-
return result_1.Result.success("Paths validated successfully.");
|
|
50
|
-
}
|
|
51
|
-
async checkExistingPortal(paths, flags) {
|
|
52
|
-
if (fs.existsSync(paths.generatedPortalArtifactsFolderPath) && !flags.force && !flags.zip) {
|
|
53
|
-
if (!(await this.prompts.overwriteExistingPortalArtifactsPrompt())) {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
else if (fs.existsSync(paths.generatedPortalArtifactsZipFilePath) && !flags.force && flags.zip) {
|
|
58
|
-
if (!(await this.prompts.existingDestinationPortalZipPrompt())) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return true;
|
|
17
|
+
intro("Generate Portal");
|
|
18
|
+
const action = new GenerateAction(new DirectoryPath(this.config.configDir), commandMetadata, authKey);
|
|
19
|
+
const result = await action.execute(buildDirectory, portalDirectory, force, zipPortal);
|
|
20
|
+
outro(result);
|
|
63
21
|
}
|
|
64
22
|
}
|
|
65
23
|
_a = PortalGenerate;
|
|
66
|
-
PortalGenerate.
|
|
67
|
-
PortalGenerate.
|
|
68
|
-
|
|
69
|
-
parse: async (input) => path.resolve(input),
|
|
70
|
-
default: DEFAULT_FOLDER,
|
|
71
|
-
description: "path to the input directory containing API specifications and config files"
|
|
72
|
-
}),
|
|
73
|
-
destination: core_1.Flags.string({
|
|
74
|
-
parse: async (input) => path.resolve(input),
|
|
75
|
-
default: DEFAULT_DESTINATION,
|
|
76
|
-
description: "path to the downloaded portal"
|
|
77
|
-
}),
|
|
78
|
-
force: core_1.Flags.boolean({
|
|
79
|
-
char: "f",
|
|
80
|
-
default: false,
|
|
81
|
-
description: "overwrite if a portal exists in the destination"
|
|
82
|
-
}),
|
|
83
|
-
zip: core_1.Flags.boolean({
|
|
24
|
+
PortalGenerate.summary = "Generate an API Documentation portal";
|
|
25
|
+
PortalGenerate.description = "Generate an API Documentation portal. Requires an input directory containing API specifications, a config file and optionally, markdown guides. For details, refer to the [documentation](https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/build-file-reference)";
|
|
26
|
+
PortalGenerate.flags = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, FlagsProvider.input), FlagsProvider.destination("portal", "portal")), FlagsProvider.force), { zip: Flags.boolean({
|
|
84
27
|
default: false,
|
|
85
|
-
description: "
|
|
86
|
-
}),
|
|
87
|
-
|
|
88
|
-
default: "",
|
|
89
|
-
description: "override current authentication state with an authentication key"
|
|
90
|
-
})
|
|
91
|
-
};
|
|
28
|
+
description: "Download the generated portal as a .zip archive"
|
|
29
|
+
}) }), FlagsProvider.authKey);
|
|
30
|
+
PortalGenerate.cmdTxt = format.cmd("apimatic", "portal", "generate");
|
|
92
31
|
PortalGenerate.examples = [
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
`
|
|
32
|
+
_a.cmdTxt,
|
|
33
|
+
`${_a.cmdTxt} ${format.flag("input", '"./"')} ${format.flag("destination", '"./portal"')}`
|
|
96
34
|
];
|
|
97
|
-
|
|
98
|
-
//# sourceMappingURL=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AAE,IAAI,CAAC,MAAM,CAAC,KAAK;SACzB,CAAC;QAEF,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACzB,MAAM,MAAM,GAAG,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QACtG,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,eAAe,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACvF,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;;;AAvCM,sBAAO,GAAG,sCAAsC,AAAzC,CAA0C;AAEjD,0BAAW,GAChB,mSAAmS,AADnR,CACoR;AAE/R,oBAAK,6EACP,aAAa,CAAC,KAAK,GACnB,aAAa,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAC7C,aAAa,CAAC,KAAK,KACtB,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;QACjB,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,iDAAiD;KAC/D,CAAC,KACC,aAAa,CAAC,OAAO,CARd,CASV;AAEK,qBAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,AAA/C,CAAgD;AACtD,uBAAQ,GAAG;IAChB,EAAI,CAAC,MAAM;IACX,GAAG,EAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,YAAY,CAAC,EAAE;CAC7F,AAHc,CAGb"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from "@oclif/core";
|
|
2
|
+
export default class PortalRecipeNew extends Command {
|
|
3
|
+
static summary: string;
|
|
4
|
+
static description: string;
|
|
5
|
+
static flags: {
|
|
6
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
static readonly cmdTxt: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
var _a;
|
|
2
|
+
import { Command, Flags } from "@oclif/core";
|
|
3
|
+
import { PortalRecipeAction } from "../../../actions/portal/recipe/new-recipe.js";
|
|
4
|
+
import { TelemetryService } from "../../../infrastructure/services/telemetry-service.js";
|
|
5
|
+
import { RecipeCreationFailedEvent } from "../../../types/events/recipe-creation-failed.js";
|
|
6
|
+
import { DirectoryPath } from "../../../types/file/directoryPath.js";
|
|
7
|
+
import { FlagsProvider } from "../../../types/flags-provider.js";
|
|
8
|
+
import { format, intro, outro } from "../../../prompts/format.js";
|
|
9
|
+
class PortalRecipeNew extends Command {
|
|
10
|
+
async run() {
|
|
11
|
+
const { flags: { name, input, force } } = await this.parse(_a);
|
|
12
|
+
const workingDirectory = DirectoryPath.createInput(input);
|
|
13
|
+
const buildDirectory = input ? new DirectoryPath(input, "src") : workingDirectory.join("src");
|
|
14
|
+
const commandMetadata = {
|
|
15
|
+
commandName: _a.id,
|
|
16
|
+
shell: this.config.shell
|
|
17
|
+
};
|
|
18
|
+
intro("New Recipe");
|
|
19
|
+
const action = new PortalRecipeAction(new DirectoryPath(this.config.configDir), commandMetadata);
|
|
20
|
+
const result = await action.execute(buildDirectory, name);
|
|
21
|
+
outro(result);
|
|
22
|
+
result.mapAll(() => { }, async () => {
|
|
23
|
+
const telemetryService = new TelemetryService(new DirectoryPath(this.config.configDir));
|
|
24
|
+
await telemetryService.trackEvent(new RecipeCreationFailedEvent("error", _a.id, {
|
|
25
|
+
name,
|
|
26
|
+
input,
|
|
27
|
+
force
|
|
28
|
+
}), commandMetadata.shell);
|
|
29
|
+
}, () => { });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
_a = PortalRecipeNew;
|
|
33
|
+
PortalRecipeNew.summary = "Add an API Recipe to your API documentation portal.";
|
|
34
|
+
PortalRecipeNew.description = `This command adds a new API Recipe file to your documentation portal.
|
|
35
|
+
|
|
36
|
+
To learn more about API Recipes, visit:
|
|
37
|
+
${format.link("https://docs.apimatic.io/platform-api/#/http/guides/generating-on-prem-api-portal/api-recipes")}`;
|
|
38
|
+
PortalRecipeNew.flags = Object.assign(Object.assign({ name: Flags.string({ description: "name for the recipe" }) }, FlagsProvider.input), FlagsProvider.force);
|
|
39
|
+
PortalRecipeNew.cmdTxt = format.cmd("apimatic", "portal", "recipe", "new");
|
|
40
|
+
PortalRecipeNew.examples = [
|
|
41
|
+
`${_a.cmdTxt}`,
|
|
42
|
+
`${_a.cmdTxt} ${format.flag("name", '"My API Recipe"')} ${format.flag("input", '"./"')}`
|
|
43
|
+
];
|
|
44
|
+
export default PortalRecipeNew;
|
|
45
|
+
//# sourceMappingURL=new.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new.js","sourceRoot":"","sources":["../../../../src/commands/portal/recipe/new.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAClF,OAAO,EAAE,gBAAgB,EAAE,MAAM,uDAAuD,CAAC;AACzF,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAElE,MAAqB,eAAgB,SAAQ,OAAO;IAsBlD,KAAK,CAAC,GAAG;QACP,MAAM,EACJ,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,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F,CAChG,EAAE,AALiB,CAKhB;AAEK,qBAAK,iCACV,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC,IACvD,aAAa,CAAC,KAAK,GACnB,aAAa,CAAC,KAAK,CAHZ,CAIV;AAEc,sBAAM,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,AAApD,CAAqD;AAC3D,wBAAQ,GAAG;IACzB,GAAG,EAAI,CAAC,MAAM,EAAE;IAChB,GAAG,EAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,iBAAiB,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;CAC3F,AAHuB,CAGtB;eApBiB,eAAe"}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Command } from "@oclif/core";
|
|
2
2
|
export default class PortalServe extends Command {
|
|
3
|
+
static summary: string;
|
|
3
4
|
static description: string;
|
|
4
5
|
static flags: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
ignore: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
"auth-key": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
6
|
+
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
+
open: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
"no-reload": import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
port: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
11
|
};
|
|
12
|
+
static cmdTxt: string;
|
|
13
13
|
static examples: string[];
|
|
14
14
|
run(): Promise<void>;
|
|
15
|
-
private
|
|
15
|
+
private getConfigDir;
|
|
16
16
|
}
|