@apimatic/cli 1.1.0-alpha.9 → 1.1.0-beta.2
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 +17 -13
- package/lib/actions/portal/toc/new-toc.js +85 -122
- 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/toc/toc-content-parser.d.ts +1 -1
- package/lib/application/portal/toc/toc-content-parser.js +9 -11
- package/lib/application/portal/toc/toc-content-parser.js.map +1 -0
- package/lib/application/portal/toc/toc-structure-generator.d.ts +1 -1
- package/lib/application/portal/toc/toc-structure-generator.js +4 -8
- 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 +5 -6
- package/lib/commands/portal/toc/new.js +45 -50
- 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 +13 -8
- package/lib/prompts/portal/toc/new-toc.js +28 -36
- 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/application/portal/toc/sdl-parser.d.ts +0 -13
- package/lib/application/portal/toc/sdl-parser.js +0 -53
- package/lib/client-utils/sdk-client.d.ts +0 -23
- package/lib/client-utils/sdk-client.js +0 -124
- 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/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,25 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { log } from "@clack/prompts";
|
|
2
|
+
import { format as f } from "../format.js";
|
|
3
|
+
import { once } from "events";
|
|
4
|
+
import { noteWrapped } from "../prompt.js";
|
|
5
|
+
export class PortalServePrompts {
|
|
6
|
+
usingFallbackPort(currentPort, availablePort) {
|
|
7
|
+
const message = `Port ${f.var(currentPort.toString())} is already in use. Available port ${f.var(availablePort.toString())} will be used.`;
|
|
8
|
+
log.step(message);
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
portalServed(urlPath) {
|
|
11
|
+
const message = `The portal is running at ${f.link(urlPath.toString())}`;
|
|
12
|
+
log.message(message);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
promptForExit() {
|
|
15
|
+
const message = "Press CTRL+C to stop the server.";
|
|
16
|
+
log.message(message);
|
|
15
17
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
changesDetected() {
|
|
19
|
+
const message = "Changes detected...";
|
|
20
|
+
log.info(message);
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
watcherError() {
|
|
23
|
+
const message = `An unexpected error occurred while watching your build folder for changes. Please try again later. If the issue persists, contact our team at ${f.var("support@apimatic.io")}`;
|
|
24
|
+
log.error(message);
|
|
25
|
+
}
|
|
26
|
+
async blockExecution() {
|
|
27
|
+
await Promise.race([once(process, "SIGINT"), once(process, "SIGTERM")]);
|
|
28
|
+
}
|
|
29
|
+
hotReloadEnabled(srcDirectory) {
|
|
30
|
+
noteWrapped(`Hot reload is enabled.
|
|
31
|
+
|
|
32
|
+
Watching the directory ${f.path(srcDirectory)} for any changes`, `Note`);
|
|
22
33
|
}
|
|
23
34
|
}
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VydmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHJvbXB0cy9wb3J0YWwvc2VydmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsNENBQXFEO0FBQ3JELDZDQUF5RDtBQUV6RCxNQUFhLGtCQUFrQjtJQUEvQjtRQUNtQixTQUFJLEdBQUcsSUFBQSxpQkFBTyxHQUFFLENBQUM7SUFrQnBDLENBQUM7SUFoQkMsOEJBQThCO1FBQzVCLElBQUksQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLG1CQUFtQixDQUFDLENBQUM7SUFDdkMsQ0FBQztJQUVELG1DQUFtQztRQUNqQyxJQUFJLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFBLDRCQUFvQixFQUFDLGlEQUFpRCxDQUFDLENBQUMsQ0FBQztJQUMxRixDQUFDO0lBRUQsNkJBQTZCLENBQUMsU0FBaUI7UUFDN0MsSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsb0NBQW9DLFNBQVMsRUFBRSxDQUFDLENBQUM7SUFDbEUsQ0FBQztJQUVELG1CQUFtQixDQUFDLElBQVk7UUFDOUIsYUFBRyxDQUFDLE9BQU8sQ0FBQyxzQ0FBc0MsSUFBSSxFQUFFLENBQUMsQ0FBQztRQUMxRCxJQUFBLGVBQUssRUFBQyxrQ0FBa0MsQ0FBQyxDQUFDO0lBQzVDLENBQUM7Q0FDRjtBQW5CRCxnREFtQkMifQ==
|
|
35
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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E,QAAQ,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;IAEM,gBAAgB,CAAC,YAA2B;QACjD,WAAW,CACT;;yBAEmB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,EACzD,MAAM,CACP,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
+
import { FilePath } from "../../../types/file/filePath.js";
|
|
2
|
+
import { Result } from "neverthrow";
|
|
3
|
+
import { DirectoryPath } from "../../../types/file/directoryPath.js";
|
|
4
|
+
import { ServiceError } from "../../../infrastructure/service-error.js";
|
|
5
|
+
import { Sdl } from "../../../types/sdl/sdl.js";
|
|
1
6
|
export declare class PortalNewTocPrompts {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
overwriteToc(tocPath: FilePath): Promise<boolean>;
|
|
8
|
+
fallingBackToDefault(): void;
|
|
9
|
+
tocFileAlreadyExists(): void;
|
|
10
|
+
logError(message: string): void;
|
|
11
|
+
contentDirectoryNotFound(contentFolderPath: DirectoryPath): void;
|
|
12
|
+
invalidBuildDirectory(directory: DirectoryPath): void;
|
|
13
|
+
extractEndpointGroupsAndModels(fn: Promise<Result<Sdl, ServiceError>>): Promise<Result<Sdl, ServiceError>>;
|
|
14
|
+
tocCreated(tocPath: FilePath): void;
|
|
10
15
|
}
|
|
@@ -1,46 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
async overwriteExistingTocPrompt() {
|
|
10
|
-
const useExistingFile = await (0, prompts_1.select)({
|
|
11
|
-
message: `A toc file already exists at the specified destination path, do you want to overwrite it?`,
|
|
12
|
-
options: [
|
|
13
|
-
{ value: "yes", label: "Yes" },
|
|
14
|
-
{ value: "no", label: "No" }
|
|
15
|
-
]
|
|
1
|
+
import { confirm, isCancel, log } from "@clack/prompts";
|
|
2
|
+
import { format as f } from "../../format.js";
|
|
3
|
+
import { withSpinner } from "../../prompt.js";
|
|
4
|
+
export class PortalNewTocPrompts {
|
|
5
|
+
async overwriteToc(tocPath) {
|
|
6
|
+
const overwrite = await confirm({
|
|
7
|
+
message: `The destination file ${f.path(tocPath)} already exists, do you want to overwrite it?`,
|
|
8
|
+
initialValue: false
|
|
16
9
|
});
|
|
17
|
-
if (
|
|
18
|
-
|
|
19
|
-
return process.exit(1);
|
|
10
|
+
if (isCancel(overwrite)) {
|
|
11
|
+
return false;
|
|
20
12
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
return overwrite;
|
|
14
|
+
}
|
|
15
|
+
fallingBackToDefault() {
|
|
16
|
+
log.warn(`Falling back to the default TOC structure.`);
|
|
25
17
|
}
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
tocFileAlreadyExists() {
|
|
19
|
+
log.error(`Please enter a different destination path or delete the existing toc.yml file and try again.`);
|
|
28
20
|
}
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
logError(message) {
|
|
22
|
+
log.error(message);
|
|
31
23
|
}
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
contentDirectoryNotFound(contentFolderPath) {
|
|
25
|
+
log.error(`Content folder not found at: ${contentFolderPath}`);
|
|
34
26
|
}
|
|
35
|
-
|
|
36
|
-
(
|
|
27
|
+
invalidBuildDirectory(directory) {
|
|
28
|
+
const message = `The ${f.var("src")} directory is either empty or invalid: ${f.path(directory)}`;
|
|
29
|
+
log.error(message);
|
|
37
30
|
}
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
extractEndpointGroupsAndModels(fn) {
|
|
32
|
+
return withSpinner("Extracting endpoint groups and models", "Endpoint groups and models extracted", "Endpoint groups and models extraction failed", fn);
|
|
40
33
|
}
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
tocCreated(tocPath) {
|
|
35
|
+
log.info(`The TOC file successfully created at: ${f.path(tocPath)}`);
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmV3LXRvYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9wcm9tcHRzL3BvcnRhbC90b2MvbmV3LXRvYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSw0Q0FBK0U7QUFFL0UsTUFBYSxtQkFBbUI7SUFBaEM7UUFDbUIsU0FBSSxHQUFHLElBQUEsaUJBQU8sR0FBRSxDQUFDO0lBOENwQyxDQUFDO0lBNUNDLEtBQUssQ0FBQywwQkFBMEI7UUFDOUIsTUFBTSxlQUFlLEdBQUcsTUFBTSxJQUFBLGdCQUFNLEVBQUM7WUFDbkMsT0FBTyxFQUFFLDJGQUEyRjtZQUNwRyxPQUFPLEVBQUU7Z0JBQ1AsRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFFLEtBQUssRUFBRSxLQUFLLEVBQUU7Z0JBQzlCLEVBQUUsS0FBSyxFQUFFLElBQUksRUFBRSxLQUFLLEVBQUUsSUFBSSxFQUFFO2FBQzdCO1NBQ0YsQ0FBQyxDQUFDO1FBRUgsSUFBSSxJQUFBLGtCQUFRLEVBQUMsZUFBZSxDQUFDLEVBQUUsQ0FBQztZQUM5QixJQUFBLGdCQUFNLEVBQUMsc0JBQXNCLENBQUMsQ0FBQztZQUMvQixPQUFPLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7UUFDekIsQ0FBQztRQUVELElBQUksZUFBZSxLQUFLLElBQUksRUFBRSxDQUFDO1lBQzdCLElBQUEsZUFBSyxFQUFDLDBGQUEwRixDQUFDLENBQUM7UUFDcEcsQ0FBQztRQUV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
|
|
4
|
+
import { stripAnsi } from "../utils/string-utils.js";
|
|
5
|
+
export async function withSpinner(intro, success, failure, fn) {
|
|
6
|
+
const s = spinner({
|
|
7
|
+
cancelMessage: "cancelled",
|
|
8
|
+
errorMessage: "failed",
|
|
9
|
+
frames: ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
|
|
10
|
+
});
|
|
11
|
+
s.start(intro);
|
|
12
|
+
const result = await fn;
|
|
13
|
+
result.match(() => s.stop(success, 0), () => s.stop(failure, 1));
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
export const noteWrapped = (message, title) => {
|
|
17
|
+
const output = process.stdout;
|
|
18
|
+
const columns = getColumns(output) || 80;
|
|
19
|
+
const messages = message.split("\n");
|
|
20
|
+
const messageHasOverFlow = messages.some((msg) => {
|
|
21
|
+
const clean = stripAnsi(msg);
|
|
22
|
+
return clean.length + 6 > columns;
|
|
23
|
+
});
|
|
24
|
+
if (messageHasOverFlow) {
|
|
25
|
+
const startLine = S_BAR_H.repeat(columns - title.length - 4);
|
|
26
|
+
log.step(`${title} ${pc.gray(startLine)}`);
|
|
27
|
+
log.message(message);
|
|
28
|
+
output.write(pc.gray(S_CONNECT_LEFT + S_BAR_H.repeat(columns - 1)) + "\n");
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const opts = {
|
|
32
|
+
format: (line) => line
|
|
33
|
+
};
|
|
34
|
+
note(message, title, opts);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/prompts/prompt.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAe,OAAO,EAAE,cAAc,EAAE,O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M,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC7D,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;QAC3C,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACrB,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC7E,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,GAAgB;YACxB,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI;SACvB,CAAC;QACF,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isCancel, log, select } from "@clack/prompts";
|
|
2
|
+
export class QuickstartPrompts {
|
|
3
|
+
welcomeMessage() {
|
|
4
|
+
log.info(`Welcome to the APIMatic quickstart wizard.`);
|
|
5
|
+
log.message(`This wizard will guide you through creating your first SDK or API Documentation Portal in just four easy steps.
|
|
6
|
+
Let's get started!`);
|
|
7
|
+
}
|
|
8
|
+
async selectQuickstartFlow() {
|
|
9
|
+
const option = await select({
|
|
10
|
+
message: "What would you like to create?",
|
|
11
|
+
options: [
|
|
12
|
+
{ value: "portal", label: "API Documentation Portal", hint: "Generate API docs + SDKs" },
|
|
13
|
+
{ value: "sdk", label: "SDK" }
|
|
14
|
+
]
|
|
15
|
+
});
|
|
16
|
+
if (isCancel(option)) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return option;
|
|
20
|
+
}
|
|
21
|
+
noQuickstartFlowSelected() {
|
|
22
|
+
log.error("No option was selected.");
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=quickstart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../src/prompts/quickstart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIvD,MAAM,OAAO,iBAAiB;IACrB,cAAc;QACnB,GAAG,CAAC,IAAI,CAAC,4CAA4C,CAAC,CAAC;QACvD,GAAG,CAAC,OAAO,CAAC;mBACG,CAAC,CAAC;IACnB,CAAC;IAEM,KAAK,CAAC,oBAAoB;QAC/B,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC;YAC1B,OAAO,EAAE,gCAAgC;YACzC,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,0BAA0B,EAAE,IAAI,EAAE,0BAA0B,EAAE;gBACxF,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;aAC/B;SACF,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACrB,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEM,wBAAwB;QAC7B,GAAG,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
|
+
import { Result } from "neverthrow";
|
|
3
|
+
export declare class SdkGeneratePrompts {
|
|
4
|
+
overwriteSdk(directory: DirectoryPath): Promise<boolean>;
|
|
5
|
+
sameSpecAndSdkDir(directory: DirectoryPath): void;
|
|
6
|
+
invalidSpecDirectory(directory: DirectoryPath): void;
|
|
7
|
+
destinationDirNotEmpty(): void;
|
|
8
|
+
generateSDK(fn: Promise<Result<NodeJS.ReadableStream, string>>): Promise<Result<NodeJS.ReadableStream, string>>;
|
|
9
|
+
logGenerationError(error: string): void;
|
|
10
|
+
sdkGenerated(sdk: DirectoryPath): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isCancel, confirm, log } from "@clack/prompts";
|
|
2
|
+
import { format as f, } from "../format.js";
|
|
3
|
+
import { withSpinner } from "../prompt.js";
|
|
4
|
+
export class SdkGeneratePrompts {
|
|
5
|
+
async overwriteSdk(directory) {
|
|
6
|
+
const overwrite = await confirm({
|
|
7
|
+
message: `The destination ${f.path(directory)} is not empty, do you want to overwrite?`,
|
|
8
|
+
initialValue: false
|
|
9
|
+
});
|
|
10
|
+
if (isCancel(overwrite)) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return overwrite;
|
|
14
|
+
}
|
|
15
|
+
sameSpecAndSdkDir(directory) {
|
|
16
|
+
const message = `The ${f.var("src")} and ${f.var("portal")} directories must be different. Current value: ${f.path(directory)}`;
|
|
17
|
+
this.logGenerationError(message);
|
|
18
|
+
}
|
|
19
|
+
invalidSpecDirectory(directory) {
|
|
20
|
+
const message = `The ${f.var("src")} directory is either empty or invalid: ${f.path(directory)}`;
|
|
21
|
+
this.logGenerationError(message);
|
|
22
|
+
}
|
|
23
|
+
destinationDirNotEmpty() {
|
|
24
|
+
const message = `Please enter a different destination folder or remove the existing files and try again.`;
|
|
25
|
+
this.logGenerationError(message);
|
|
26
|
+
}
|
|
27
|
+
generateSDK(fn) {
|
|
28
|
+
return withSpinner("Generating SDK", "SDK generated successfully.", "SDK Generation failed.", fn);
|
|
29
|
+
}
|
|
30
|
+
logGenerationError(error) {
|
|
31
|
+
log.error(error);
|
|
32
|
+
}
|
|
33
|
+
sdkGenerated(sdk) {
|
|
34
|
+
log.info(`Generated SDK can be found at ${f.path(sdk)}.`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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AC,gBAAgB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,EAAE,CAAC,CAAC;IACpG,CAAC;IAEM,kBAAkB,CAAC,KAAa;QACrC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAEM,YAAY,CAAC,GAAkB;QACpC,GAAG,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5D,CAAC;CACF"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Result } from "neverthrow";
|
|
2
|
+
import { UrlPath } from "../../types/file/urlPath.js";
|
|
3
|
+
import { ResourceInput } from "../../types/file/resource-input.js";
|
|
4
|
+
import { FileDownloadResponse } from "../../infrastructure/services/file-download-service.js";
|
|
5
|
+
import { ServiceError } from "../../infrastructure/service-error.js";
|
|
6
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
7
|
+
import { Directory } from "../../types/file/directory.js";
|
|
8
|
+
import { Language } from "../../types/sdk/generate.js";
|
|
9
|
+
export declare class SdkQuickstartPrompts {
|
|
10
|
+
importSpecStep(): void;
|
|
11
|
+
specPathPrompt(defaultSpecUrl: UrlPath): Promise<ResourceInput | undefined>;
|
|
12
|
+
specFileDoesNotExist(): void;
|
|
13
|
+
noSpecSpecified(): void;
|
|
14
|
+
downloadSpecFile(fn: Promise<Result<FileDownloadResponse, ServiceError>>): Promise<Result<FileDownloadResponse, ServiceError>>;
|
|
15
|
+
serviceError(serviceError: ServiceError): void;
|
|
16
|
+
validateSpecStep(): void;
|
|
17
|
+
specValidationFailed(): void;
|
|
18
|
+
useDefaultSpecPrompt(): Promise<boolean>;
|
|
19
|
+
fixYourSpec(): void;
|
|
20
|
+
selectLanguageStep(): void;
|
|
21
|
+
selectLanguagePrompt(): Promise<Language | undefined>;
|
|
22
|
+
noLanguageSelected(): void;
|
|
23
|
+
selectInputDirectoryStep(): void;
|
|
24
|
+
inputDirectoryPathPrompt(): Promise<DirectoryPath | undefined>;
|
|
25
|
+
noInputDirectoryProvided(): void;
|
|
26
|
+
inputDirectoryPathDoesNotExist(inputDirectory: DirectoryPath): void;
|
|
27
|
+
inputDirectoryNotEmpty(inputDirectory: DirectoryPath): void;
|
|
28
|
+
downloadMetadataFile(fn: Promise<Result<FileDownloadResponse, ServiceError>>): Promise<Result<FileDownloadResponse, ServiceError>>;
|
|
29
|
+
printDirectoryStructure(inputDirectory: DirectoryPath, directory: Directory): void;
|
|
30
|
+
sdkOpenedInEditor(): void;
|
|
31
|
+
nextSteps(language: Language, specDirectory: DirectoryPath): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { isCancel, log, select, text } from "@clack/prompts";
|
|
2
|
+
import { format as f, getTree } from "../format.js";
|
|
3
|
+
import { noteWrapped, withSpinner } from "../prompt.js";
|
|
4
|
+
import { createResourceInputFromInput } from "../../types/file/resource-input.js";
|
|
5
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
6
|
+
import { removeQuotes } from "../../utils/string-utils.js";
|
|
7
|
+
import { Language } from "../../types/sdk/generate.js";
|
|
8
|
+
const vscodeExtensionUrl = "https://marketplace.visualstudio.com/items?itemName=apimatic-developers.apimatic-for-vscode";
|
|
9
|
+
const sdkCustomizationUrl = "https://docs.apimatic.io/generate-sdks/codegen-settings/codegen-settings-overview/";
|
|
10
|
+
const defaultSrcDirectoryPath = process.cwd();
|
|
11
|
+
export class SdkQuickstartPrompts {
|
|
12
|
+
importSpecStep() {
|
|
13
|
+
log.info(`Step 1 of 4: Import your OpenAPI Definition`);
|
|
14
|
+
}
|
|
15
|
+
async specPathPrompt(defaultSpecUrl) {
|
|
16
|
+
const spec = await text({
|
|
17
|
+
message: `Provide a local path or a public URL for your OpenAPI Definition file:`,
|
|
18
|
+
placeholder: "Provide absolute URL/local path or press Enter to use a sample OpenAPI Definition file from APIMatic.",
|
|
19
|
+
defaultValue: defaultSpecUrl.toString(),
|
|
20
|
+
validate: (value) => {
|
|
21
|
+
if (value && !createResourceInputFromInput(value)) {
|
|
22
|
+
return "Please enter a valid file path or URL.";
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
if (isCancel(spec)) {
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
return createResourceInputFromInput(spec);
|
|
30
|
+
}
|
|
31
|
+
specFileDoesNotExist() {
|
|
32
|
+
log.error("The specified file does not exist or is not a valid file. Please enter a valid file path.");
|
|
33
|
+
}
|
|
34
|
+
noSpecSpecified() {
|
|
35
|
+
log.error("No API Definition was provided.");
|
|
36
|
+
}
|
|
37
|
+
downloadSpecFile(fn) {
|
|
38
|
+
return withSpinner("Downloading API Definition", `API Definition downloaded`, "Unable to download API Definition", fn);
|
|
39
|
+
}
|
|
40
|
+
serviceError(serviceError) {
|
|
41
|
+
log.error(serviceError.errorMessage);
|
|
42
|
+
}
|
|
43
|
+
validateSpecStep() {
|
|
44
|
+
log.info(`Step 2 of 4: Validate and Lint your OpenAPI Definition`);
|
|
45
|
+
}
|
|
46
|
+
specValidationFailed() {
|
|
47
|
+
log.error(`Oops, it looks like there are some errors in your API Definition`);
|
|
48
|
+
}
|
|
49
|
+
async useDefaultSpecPrompt() {
|
|
50
|
+
const useDefaultSpec = await select({
|
|
51
|
+
message: `How would you like to proceed?`,
|
|
52
|
+
options: [
|
|
53
|
+
{
|
|
54
|
+
value: "no",
|
|
55
|
+
label: `1. Fix the issues using APIMatic's interactive VS Code Extension: ${vscodeExtensionUrl}`
|
|
56
|
+
},
|
|
57
|
+
{ value: "yes", label: `2. Use an example API Definition instead (recommended)` }
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
if (isCancel(useDefaultSpec)) {
|
|
61
|
+
return false;
|
|
62
|
+
}
|
|
63
|
+
return useDefaultSpec === "yes";
|
|
64
|
+
}
|
|
65
|
+
fixYourSpec() {
|
|
66
|
+
const message = `Good luck fixing your API Definition! Feel free to run this command again once you're done.`;
|
|
67
|
+
log.info(message);
|
|
68
|
+
}
|
|
69
|
+
selectLanguageStep() {
|
|
70
|
+
log.info(`Step 3 of 4: Select programming language`);
|
|
71
|
+
}
|
|
72
|
+
async selectLanguagePrompt() {
|
|
73
|
+
const language = await select({
|
|
74
|
+
message: "Choose the programming language for your SDK:",
|
|
75
|
+
options: [
|
|
76
|
+
{ label: "Typescript", value: Language.TYPESCRIPT },
|
|
77
|
+
{ label: "Ruby", value: Language.RUBY },
|
|
78
|
+
{ label: "Python", value: Language.PYTHON },
|
|
79
|
+
{ label: "Java", value: Language.JAVA },
|
|
80
|
+
{ label: "C#", value: Language.CSHARP },
|
|
81
|
+
{ label: "PHP", value: Language.PHP },
|
|
82
|
+
{ label: "Go", value: Language.GO }
|
|
83
|
+
]
|
|
84
|
+
});
|
|
85
|
+
if (isCancel(language)) {
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
return language;
|
|
89
|
+
}
|
|
90
|
+
noLanguageSelected() {
|
|
91
|
+
log.error("No programming language was selected.");
|
|
92
|
+
}
|
|
93
|
+
selectInputDirectoryStep() {
|
|
94
|
+
log.info(`Step 4 of 4: Setup directory for SDK Generation`);
|
|
95
|
+
}
|
|
96
|
+
async inputDirectoryPathPrompt() {
|
|
97
|
+
var _a;
|
|
98
|
+
const inputDirectory = await text({
|
|
99
|
+
message: "Enter the directory path where you would like to setup the SDK (Requires an empty directory):",
|
|
100
|
+
placeholder: "Provide absolute path to the directory or press Enter to use the current directory.",
|
|
101
|
+
defaultValue: "./"
|
|
102
|
+
});
|
|
103
|
+
if (isCancel(inputDirectory)) {
|
|
104
|
+
return undefined;
|
|
105
|
+
}
|
|
106
|
+
const cleanedPath = removeQuotes((_a = inputDirectory === null || inputDirectory === void 0 ? void 0 : inputDirectory.trim()) !== null && _a !== void 0 ? _a : "");
|
|
107
|
+
return new DirectoryPath(cleanedPath);
|
|
108
|
+
}
|
|
109
|
+
noInputDirectoryProvided() {
|
|
110
|
+
log.error("No directory was specified.");
|
|
111
|
+
}
|
|
112
|
+
inputDirectoryPathDoesNotExist(inputDirectory) {
|
|
113
|
+
log.error(`The specified directory path ${f.path(inputDirectory)} does not exist.`);
|
|
114
|
+
}
|
|
115
|
+
inputDirectoryNotEmpty(inputDirectory) {
|
|
116
|
+
log.error(`The target directory ${f.path(inputDirectory)} is not empty. Please provide a path to an empty directory or clear its contents.`);
|
|
117
|
+
}
|
|
118
|
+
downloadMetadataFile(fn) {
|
|
119
|
+
return withSpinner("Setting up source directory", `Source directory set up successfully`, "Unable to set up source directory", fn);
|
|
120
|
+
}
|
|
121
|
+
printDirectoryStructure(inputDirectory, directory) {
|
|
122
|
+
const heading = `${f.var("src")} directory containing source files created at ${f.path(inputDirectory)}\n`;
|
|
123
|
+
const message = getTree(directory.toTreeNode());
|
|
124
|
+
log.info(heading + message);
|
|
125
|
+
}
|
|
126
|
+
sdkOpenedInEditor() {
|
|
127
|
+
log.info("Opened the SDK directory in VS Code. To get started with your SDK, review the README file.");
|
|
128
|
+
}
|
|
129
|
+
nextSteps(language, specDirectory) {
|
|
130
|
+
const specDirectoryFlag = !specDirectory.isEqual(DirectoryPath.default) ? `${f.flag("spec", specDirectory.toString())} ` : "";
|
|
131
|
+
const message = `Run the command
|
|
132
|
+
'${f.cmdAlt("apimatic", "sdk", "generate")} ${specDirectoryFlag}${f.flag("language", language)}'
|
|
133
|
+
to regenerate your SDK.
|
|
134
|
+
|
|
135
|
+
To learn more about customizing your SDK, visit:
|
|
136
|
+
${f.link(sdkCustomizationUrl)}`;
|
|
137
|
+
noteWrapped(message, "Next Steps");
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=quickstart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../../src/prompts/sdk/quickstart.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE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C,EAAE,CAAC;QAC5B,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IACrC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/types/api/account.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { TransformationController } from "@apimatic/sdk";
|
|
2
|
-
export type TransformationIdParams = {
|
|
3
|
-
file: string;
|
|
4
|
-
url: string;
|
|
5
|
-
format: string;
|
|
6
|
-
};
|
|
7
|
-
export type DownloadTransformationParams = {
|
|
8
|
-
id: string;
|
|
9
|
-
destinationFilePath: string;
|
|
10
|
-
transformationController: TransformationController;
|
|
11
|
-
};
|
|
12
1
|
export type TransformationData = {
|
|
13
2
|
result: NodeJS.ReadableStream | Blob;
|
|
14
3
|
};
|
|
@@ -28,18 +17,18 @@ export declare const DestinationFormats: {
|
|
|
28
17
|
GraphQlSchema: string;
|
|
29
18
|
};
|
|
30
19
|
export declare enum TransformationFormats {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
20
|
+
apimatic = "Apimatic",
|
|
21
|
+
wadl2009 = "Wadl2009",
|
|
22
|
+
wsdl = "Wsdl",
|
|
23
|
+
swagger10 = "Swagger10",
|
|
24
|
+
swagger20 = "Swagger20",
|
|
25
|
+
swaggeryaml = "Swaggeryaml",
|
|
26
|
+
oas3 = "Oas3",
|
|
27
|
+
openapi3yaml = "Openapi3Yaml",
|
|
28
|
+
apiblueprint = "Apiblueprint",
|
|
29
|
+
raml = "Raml",
|
|
30
|
+
raml10 = "Raml10",
|
|
31
|
+
postman10 = "Postman10",
|
|
32
|
+
postman20 = "Postman20",
|
|
33
|
+
graphqlschema = "Graphqlschema"
|
|
45
34
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransformationFormats = exports.DestinationFormats = void 0;
|
|
4
|
-
exports.DestinationFormats = {
|
|
1
|
+
export const DestinationFormats = {
|
|
5
2
|
OpenApi3Json: "json",
|
|
6
3
|
OpenApi3Yaml: "yaml",
|
|
7
4
|
APIMATIC: "json",
|
|
@@ -10,27 +7,27 @@ exports.DestinationFormats = {
|
|
|
10
7
|
Swagger10: "json",
|
|
11
8
|
Swagger20: "json",
|
|
12
9
|
SwaggerYaml: "yaml",
|
|
13
|
-
RAML: "
|
|
14
|
-
RAML10: "
|
|
10
|
+
RAML: "raml",
|
|
11
|
+
RAML10: "raml",
|
|
15
12
|
Postman10: "json",
|
|
16
13
|
Postman20: "json",
|
|
17
14
|
GraphQlSchema: "json"
|
|
18
15
|
};
|
|
19
|
-
var TransformationFormats;
|
|
16
|
+
export var TransformationFormats;
|
|
20
17
|
(function (TransformationFormats) {
|
|
21
|
-
TransformationFormats["
|
|
22
|
-
TransformationFormats["
|
|
23
|
-
TransformationFormats["
|
|
24
|
-
TransformationFormats["
|
|
25
|
-
TransformationFormats["
|
|
26
|
-
TransformationFormats["
|
|
27
|
-
TransformationFormats["
|
|
28
|
-
TransformationFormats["
|
|
29
|
-
TransformationFormats["
|
|
30
|
-
TransformationFormats["
|
|
31
|
-
TransformationFormats["
|
|
32
|
-
TransformationFormats["
|
|
33
|
-
TransformationFormats["
|
|
34
|
-
TransformationFormats["
|
|
35
|
-
})(TransformationFormats || (
|
|
36
|
-
//# sourceMappingURL=
|
|
18
|
+
TransformationFormats["apimatic"] = "Apimatic";
|
|
19
|
+
TransformationFormats["wadl2009"] = "Wadl2009";
|
|
20
|
+
TransformationFormats["wsdl"] = "Wsdl";
|
|
21
|
+
TransformationFormats["swagger10"] = "Swagger10";
|
|
22
|
+
TransformationFormats["swagger20"] = "Swagger20";
|
|
23
|
+
TransformationFormats["swaggeryaml"] = "Swaggeryaml";
|
|
24
|
+
TransformationFormats["oas3"] = "Oas3";
|
|
25
|
+
TransformationFormats["openapi3yaml"] = "Openapi3Yaml";
|
|
26
|
+
TransformationFormats["apiblueprint"] = "Apiblueprint";
|
|
27
|
+
TransformationFormats["raml"] = "Raml";
|
|
28
|
+
TransformationFormats["raml10"] = "Raml10";
|
|
29
|
+
TransformationFormats["postman10"] = "Postman10";
|
|
30
|
+
TransformationFormats["postman20"] = "Postman20";
|
|
31
|
+
TransformationFormats["graphqlschema"] = "Graphqlschema";
|
|
32
|
+
})(TransformationFormats || (TransformationFormats = {}));
|
|
33
|
+
//# sourceMappingURL=transform.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/types/api/transform.ts"],"names":[],"mappings":"AAKA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,KAAK;IACX,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,aAAa,EAAE,MAAM;CACtB,CAAC;AAEF,MAAM,CAAN,IAAY,qBAeX;AAfD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,8CAAqB,CAAA;IACrB,sCAAa,CAAA;IACb,gDAAuB,CAAA;IACvB,gDAAuB,CAAA;IACvB,oDAA2B,CAAA;IAC3B,sCAAa,CAAA;IACb,sDAA6B,CAAA;IAC7B,sDAA6B,CAAA;IAC7B,sCAAa,CAAA;IACb,0CAAiB,CAAA;IACjB,gDAAuB,CAAA;IACvB,gDAAuB,CAAA;IACvB,wDAA+B,CAAA;AACjC,CAAC,EAfW,qBAAqB,KAArB,qBAAqB,QAehC"}
|