@apimatic/cli 1.1.0-alpha.2 → 1.1.0-alpha.20
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 +249 -99
- package/bin/run.js +5 -0
- package/lib/actions/action-result.d.ts +8 -0
- package/lib/actions/action-result.js +25 -0
- package/lib/actions/action-result.js.map +1 -0
- package/lib/actions/auth/login.d.ts +12 -0
- package/lib/actions/auth/login.js +63 -0
- package/lib/actions/auth/login.js.map +1 -0
- package/lib/actions/portal/copilot.d.ts +11 -0
- package/lib/actions/portal/copilot.js +49 -0
- package/lib/actions/portal/copilot.js.map +1 -0
- package/lib/actions/portal/generate.d.ts +13 -0
- package/lib/actions/portal/generate.js +61 -0
- package/lib/actions/portal/generate.js.map +1 -0
- package/lib/actions/portal/recipe/new-recipe.d.ts +24 -0
- package/lib/actions/portal/recipe/new-recipe.js +250 -0
- package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
- package/lib/actions/portal/serve.d.ts +14 -0
- package/lib/actions/portal/serve.js +24 -0
- package/lib/actions/portal/serve.js.map +1 -0
- package/lib/actions/portal/toc/new-toc.d.ts +20 -0
- package/lib/actions/portal/toc/new-toc.js +133 -0
- package/lib/actions/portal/toc/new-toc.js.map +1 -0
- package/lib/actions/sdk/generate.d.ts +14 -0
- package/lib/actions/sdk/generate.js +72 -0
- package/lib/actions/sdk/generate.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 +16 -0
- package/lib/application/portal/recipe/recipe-generator.js +147 -0
- package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
- package/lib/application/portal/serve/portal-watcher.d.ts +11 -0
- package/lib/application/portal/serve/portal-watcher.js +64 -0
- package/lib/application/portal/serve/portal-watcher.js.map +1 -0
- package/lib/application/portal/serve/serve-handler.d.ts +16 -0
- package/lib/application/portal/serve/serve-handler.js +91 -0
- package/lib/application/portal/serve/serve-handler.js.map +1 -0
- package/lib/application/portal/serve/watcher-handler.d.ts +10 -0
- package/lib/application/portal/serve/watcher-handler.js +51 -0
- package/lib/application/portal/serve/watcher-handler.js.map +1 -0
- package/lib/application/portal/toc/sdl-parser.d.ts +19 -0
- package/lib/application/portal/toc/sdl-parser.js +90 -0
- package/lib/application/portal/toc/sdl-parser.js.map +1 -0
- package/lib/application/portal/toc/toc-content-parser.d.ts +5 -0
- 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/toc/toc-structure-generator.d.ts +6 -0
- 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 +8 -3
- package/lib/client-utils/auth-manager.js +23 -10
- package/lib/client-utils/auth-manager.js.map +1 -0
- package/lib/client-utils/sdk-client.d.ts +0 -1
- package/lib/client-utils/sdk-client.js +25 -55
- package/lib/client-utils/sdk-client.js.map +1 -0
- package/lib/commands/api/transform.d.ts +7 -7
- package/lib/commands/api/transform.js +43 -51
- package/lib/commands/api/transform.js.map +1 -0
- package/lib/commands/api/validate.d.ts +4 -4
- package/lib/commands/api/validate.js +26 -33
- package/lib/commands/api/validate.js.map +1 -0
- package/lib/commands/auth/login.d.ts +3 -2
- package/lib/commands/auth/login.js +22 -53
- package/lib/commands/auth/login.js.map +1 -0
- package/lib/commands/auth/logout.d.ts +1 -1
- package/lib/commands/auth/logout.js +8 -13
- package/lib/commands/auth/logout.js.map +1 -0
- package/lib/commands/auth/status.d.ts +1 -1
- package/lib/commands/auth/status.js +9 -13
- package/lib/commands/auth/status.js.map +1 -0
- package/lib/commands/portal/copilot.d.ts +12 -0
- package/lib/commands/portal/copilot.js +32 -0
- package/lib/commands/portal/copilot.js.map +1 -0
- package/lib/commands/portal/generate.d.ts +10 -8
- package/lib/commands/portal/generate.js +28 -107
- package/lib/commands/portal/generate.js.map +1 -0
- package/lib/commands/portal/quickstart.d.ts +10 -0
- package/lib/commands/portal/quickstart.js +105 -0
- package/lib/commands/portal/quickstart.js.map +1 -0
- package/lib/commands/portal/recipe/new.d.ts +10 -0
- package/lib/commands/portal/recipe/new.js +38 -0
- package/lib/commands/portal/recipe/new.js.map +1 -0
- package/lib/commands/portal/serve.d.ts +16 -0
- package/lib/commands/portal/serve.js +80 -0
- 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 +52 -0
- package/lib/commands/portal/toc/new.js.map +1 -0
- package/lib/commands/sdk/generate.d.ts +9 -8
- package/lib/commands/sdk/generate.js +39 -128
- package/lib/commands/sdk/generate.js.map +1 -0
- package/lib/config/axios-config.d.ts +2 -0
- package/lib/config/axios-config.js +10 -0
- package/lib/config/axios-config.js.map +1 -0
- package/lib/config/env.d.ts +26 -1
- package/lib/config/env.js +27 -4
- package/lib/config/env.js.map +1 -0
- package/lib/controllers/api/transform.d.ts +1 -1
- package/lib/controllers/api/transform.js +23 -22
- package/lib/controllers/api/transform.js.map +1 -0
- package/lib/controllers/api/validate.d.ts +3 -3
- package/lib/controllers/api/validate.js +19 -12
- package/lib/controllers/api/validate.js.map +1 -0
- package/lib/controllers/portal/quickstart.d.ts +15 -0
- package/lib/controllers/portal/quickstart.js +217 -0
- package/lib/controllers/portal/quickstart.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -4
- package/lib/index.js.map +1 -0
- package/lib/infrastructure/api-utils.d.ts +9 -0
- package/lib/infrastructure/api-utils.js +33 -0
- package/lib/infrastructure/api-utils.js.map +1 -0
- package/lib/infrastructure/env-info.d.ts +8 -0
- package/lib/infrastructure/env-info.js +37 -0
- package/lib/infrastructure/env-info.js.map +1 -0
- package/lib/infrastructure/file-service.d.ts +18 -0
- package/lib/infrastructure/file-service.js +76 -0
- package/lib/infrastructure/file-service.js.map +1 -0
- package/lib/infrastructure/services/api-service.d.ts +10 -0
- package/lib/infrastructure/services/api-service.js +54 -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 +33 -0
- package/lib/infrastructure/services/auth-service.js.map +1 -0
- package/lib/infrastructure/services/portal-service.d.ts +20 -0
- package/lib/infrastructure/services/portal-service.js +163 -0
- package/lib/infrastructure/services/portal-service.js.map +1 -0
- package/lib/infrastructure/services/telemetry-service.d.ts +8 -0
- package/lib/infrastructure/services/telemetry-service.js +40 -0
- package/lib/infrastructure/services/telemetry-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/auth/login.d.ts +5 -0
- package/lib/prompts/auth/login.js +13 -0
- package/lib/prompts/auth/login.js.map +1 -0
- package/lib/prompts/portal/common/base-prompts.d.ts +7 -0
- package/lib/prompts/portal/common/base-prompts.js +19 -0
- package/lib/prompts/portal/common/base-prompts.js.map +1 -0
- package/lib/prompts/portal/copilot.d.ts +8 -0
- package/lib/prompts/portal/copilot.js +54 -0
- package/lib/prompts/portal/copilot.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +11 -0
- package/lib/prompts/portal/generate.js +42 -0
- package/lib/prompts/portal/generate.js.map +1 -0
- package/lib/prompts/portal/quickstart.d.ts +30 -0
- package/lib/prompts/portal/quickstart.js +240 -0
- package/lib/prompts/portal/quickstart.js.map +1 -0
- package/lib/prompts/portal/recipe/new-recipe.d.ts +24 -0
- package/lib/prompts/portal/recipe/new-recipe.js +203 -0
- package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
- package/lib/prompts/portal/serve.d.ts +4 -0
- package/lib/prompts/portal/serve.js +14 -0
- package/lib/prompts/portal/serve.js.map +1 -0
- package/lib/prompts/portal/toc/new-toc.d.ts +11 -0
- package/lib/prompts/portal/toc/new-toc.js +39 -0
- package/lib/prompts/portal/toc/new-toc.js.map +1 -0
- package/lib/prompts/sdk/generate.d.ts +11 -0
- package/lib/prompts/sdk/generate.js +42 -0
- package/lib/prompts/sdk/generate.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 +19 -4
- package/lib/types/api/transform.js +19 -4
- package/lib/types/api/transform.js.map +1 -0
- package/lib/types/api/validate.d.ts +3 -3
- package/lib/types/api/validate.js +2 -2
- package/lib/types/api/validate.js.map +1 -0
- package/lib/types/build/build.d.ts +14 -0
- package/lib/types/build/build.js +4 -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 +30 -0
- package/lib/types/build-context.js.map +1 -0
- package/lib/types/common/result.d.ts +17 -0
- package/lib/types/common/result.js +32 -0
- package/lib/types/common/result.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/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/directoryPath.d.ts +7 -0
- package/lib/types/file/directoryPath.js +16 -0
- package/lib/types/file/directoryPath.js.map +1 -0
- package/lib/types/file/fileName.d.ts +5 -0
- package/lib/types/file/fileName.js +9 -0
- package/lib/types/file/fileName.js.map +1 -0
- package/lib/types/file/filePath.d.ts +8 -0
- package/lib/types/file/filePath.js +11 -0
- package/lib/types/file/filePath.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/generate.d.ts +13 -9
- package/lib/types/portal/generate.js +3 -2
- package/lib/types/portal/generate.js.map +1 -0
- package/lib/types/portal/quickstart.d.ts +17 -0
- package/lib/types/portal/quickstart.js +2 -0
- package/lib/types/portal/quickstart.js.map +1 -0
- package/lib/types/portal/serve.d.ts +12 -0
- package/lib/types/portal/serve.js +2 -0
- package/lib/types/portal/serve.js.map +1 -0
- package/lib/types/portal-context.d.ts +11 -0
- package/lib/types/portal-context.js +28 -0
- package/lib/types/portal-context.js.map +1 -0
- package/lib/types/recipe/recipe.d.ts +37 -0
- package/lib/types/recipe/recipe.js +6 -0
- package/lib/types/recipe/recipe.js.map +1 -0
- package/lib/types/sdk/generate.d.ts +11 -10
- package/lib/types/sdk/generate.js +11 -12
- package/lib/types/sdk/generate.js.map +1 -0
- package/lib/types/sdk-context.d.ts +13 -0
- package/lib/types/sdk-context.js +28 -0
- package/lib/types/sdk-context.js.map +1 -0
- package/lib/types/sdl/sdl.d.ts +12 -0
- package/lib/types/sdl/sdl.js +2 -0
- package/lib/types/sdl/sdl.js.map +1 -0
- package/lib/types/spec-context.d.ts +7 -0
- package/lib/types/spec-context.js +12 -0
- package/lib/types/spec-context.js.map +1 -0
- package/lib/types/toc/toc.d.ts +31 -0
- package/lib/types/toc/toc.js +9 -0
- package/lib/types/toc/toc.js.map +1 -0
- package/lib/types/utils.d.ts +3 -3
- package/lib/types/utils.js +2 -2
- package/lib/types/utils.js.map +1 -0
- package/lib/utils/utils.d.ts +16 -7
- package/lib/utils/utils.js +142 -86
- package/lib/utils/utils.js.map +1 -0
- package/lib/validators/common/directoryValidator.d.ts +5 -0
- package/lib/validators/common/directoryValidator.js +22 -0
- package/lib/validators/common/directoryValidator.js.map +1 -0
- package/lib/validators/portal/serve-validator.d.ts +6 -0
- package/lib/validators/portal/serve-validator.js +15 -0
- package/lib/validators/portal/serve-validator.js.map +1 -0
- package/package.json +96 -40
- package/bin/run +0 -5
- package/lib/controllers/portal/generate.d.ts +0 -2
- package/lib/controllers/portal/generate.js +0 -49
- package/lib/controllers/sdk/generate.d.ts +0 -4
- package/lib/controllers/sdk/generate.js +0 -64
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { log, outro } from "@clack/prompts";
|
|
2
|
+
import { BasePrompts } from "./common/base-prompts.js";
|
|
3
|
+
export class PortalServePrompts extends BasePrompts {
|
|
4
|
+
displayOutroMessage(buildDirectory, portalDirectory, port, hotReloadDisabled) {
|
|
5
|
+
log.message(`The generated portal can be found at ${portalDirectory}`);
|
|
6
|
+
log.message(`Server started at http://localhost:${port}`);
|
|
7
|
+
if (!hotReloadDisabled) {
|
|
8
|
+
log.message(`🔍 Hot reload enabled. Watching the following build folder for any changes:`);
|
|
9
|
+
log.message(`${buildDirectory}`);
|
|
10
|
+
}
|
|
11
|
+
outro(`Press CTRL+C to stop the server.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/prompts/portal/serve.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEvD,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IAC1C,mBAAmB,CACxB,cAAsB,EACtB,eAAuB,EACvB,IAAY,EACZ,iBAA0B;QAE1B,GAAG,CAAC,OAAO,CAAC,wCAAwC,eAAe,EAAE,CAAC,CAAC;QACvE,GAAG,CAAC,OAAO,CAAC,sCAAsC,IAAI,EAAE,CAAC,CAAC;QAC1D,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,GAAG,CAAC,OAAO,CAAC,6EAA6E,CAAC,CAAC;YAC3F,GAAG,CAAC,OAAO,CAAC,GAAG,cAAc,EAAE,CAAC,CAAC;QACnC,CAAC;QACD,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAC5C,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FilePath } from "../../../types/file/filePath.js";
|
|
2
|
+
export declare class PortalNewTocPrompts {
|
|
3
|
+
private readonly spin;
|
|
4
|
+
overwriteExistingTocPrompt(tocPath: FilePath): Promise<boolean>;
|
|
5
|
+
startProgressIndicatorWithMessage(message: string): void;
|
|
6
|
+
stopProgressIndicatorWithMessage(message: string): void;
|
|
7
|
+
displayOutroMessage(tocPath: FilePath): void;
|
|
8
|
+
logError(error: string): void;
|
|
9
|
+
displayWarning(message: string): void;
|
|
10
|
+
displayInfo(message: string): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cancel, outro, confirm, spinner, isCancel, log } from "@clack/prompts";
|
|
2
|
+
export class PortalNewTocPrompts {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.spin = spinner();
|
|
5
|
+
}
|
|
6
|
+
async overwriteExistingTocPrompt(tocPath) {
|
|
7
|
+
const overwrite = await confirm({
|
|
8
|
+
message: `⚠️ The destination file '${tocPath}' already exists, do you want to overwrite it?`,
|
|
9
|
+
initialValue: false
|
|
10
|
+
});
|
|
11
|
+
if (isCancel(overwrite)) {
|
|
12
|
+
cancel("Operation cancelled.");
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
if (!overwrite) {
|
|
16
|
+
log.error("Please enter a different destination path or delete the existing toc.yml file and try again.");
|
|
17
|
+
}
|
|
18
|
+
return overwrite;
|
|
19
|
+
}
|
|
20
|
+
startProgressIndicatorWithMessage(message) {
|
|
21
|
+
this.spin.start(message);
|
|
22
|
+
}
|
|
23
|
+
stopProgressIndicatorWithMessage(message) {
|
|
24
|
+
this.spin.stop(message);
|
|
25
|
+
}
|
|
26
|
+
displayOutroMessage(tocPath) {
|
|
27
|
+
outro(`toc.yml file successfully created at: ${tocPath}`);
|
|
28
|
+
}
|
|
29
|
+
logError(error) {
|
|
30
|
+
outro(error);
|
|
31
|
+
}
|
|
32
|
+
displayWarning(message) {
|
|
33
|
+
log.warning(message);
|
|
34
|
+
}
|
|
35
|
+
displayInfo(message) {
|
|
36
|
+
log.step(message);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=new-toc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-toc.js","sourceRoot":"","sources":["../../../../src/prompts/portal/toc/new-toc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAGhF,MAAM,OAAO,mBAAmB;IAAhC;QACmB,SAAI,GAAG,OAAO,EAAE,CAAC;IA2CpC,CAAC;IAzCC,KAAK,CAAC,0BAA0B,CAAC,OAAiB;QAChD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC;YAC9B,OAAO,EAAE,4BAA4B,OAAO,gDAAgD;YAC5F,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACxB,MAAM,CAAC,sBAAsB,CAAC,CAAC;YAC/B,OAAO,KAAK,CAAC;QACf,CAAC;QAED,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,GAAG,CAAC,KAAK,CAAC,8FAA8F,CAAC,CAAC;QAC5G,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,iCAAiC,CAAC,OAAe;QAC/C,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC3B,CAAC;IAED,gCAAgC,CAAC,OAAe;QAC9C,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,mBAAmB,CAAC,OAAiB;QACnC,KAAK,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC;IAC5D,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;IAED,cAAc,CAAC,OAAe;QAC5B,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;IAED,WAAW,CAAC,OAAe;QACzB,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
|
+
export declare class SdkGeneratePrompts {
|
|
3
|
+
private readonly spin;
|
|
4
|
+
overwriteSdk(directory: DirectoryPath): Promise<boolean>;
|
|
5
|
+
displaySdkGenerationMessage(): void;
|
|
6
|
+
displaySdkGenerationSuccessMessage(): void;
|
|
7
|
+
displaySdkGenerationErrorMessage(): void;
|
|
8
|
+
displayOutroMessage(generatedSdkPath: DirectoryPath): void;
|
|
9
|
+
logError(error: string): void;
|
|
10
|
+
private cleanUpStandardInput;
|
|
11
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { outro, spinner, isCancel, confirm, log } from "@clack/prompts";
|
|
2
|
+
import { getMessageInRedColor, getMessageInMagentaColor, getMessageInCyanColor } from "../../utils/utils.js";
|
|
3
|
+
export class SdkGeneratePrompts {
|
|
4
|
+
constructor() {
|
|
5
|
+
this.spin = spinner();
|
|
6
|
+
}
|
|
7
|
+
async overwriteSdk(directory) {
|
|
8
|
+
const overwrite = await confirm({
|
|
9
|
+
message: `The destination '${directory}' is not empty, do you want to overwrite?`,
|
|
10
|
+
initialValue: false
|
|
11
|
+
});
|
|
12
|
+
if (isCancel(overwrite)) {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
return overwrite;
|
|
16
|
+
}
|
|
17
|
+
displaySdkGenerationMessage() {
|
|
18
|
+
this.spin.start(getMessageInMagentaColor("Generating SDK"));
|
|
19
|
+
}
|
|
20
|
+
displaySdkGenerationSuccessMessage() {
|
|
21
|
+
this.spin.stop(getMessageInCyanColor("SDK generated successfully."));
|
|
22
|
+
this.cleanUpStandardInput();
|
|
23
|
+
}
|
|
24
|
+
displaySdkGenerationErrorMessage() {
|
|
25
|
+
this.spin.stop(getMessageInRedColor(`SDK Generation failed.`), 1);
|
|
26
|
+
this.cleanUpStandardInput();
|
|
27
|
+
}
|
|
28
|
+
displayOutroMessage(generatedSdkPath) {
|
|
29
|
+
outro(`The generated SDK can be found at ${generatedSdkPath}`);
|
|
30
|
+
}
|
|
31
|
+
logError(error) {
|
|
32
|
+
log.error(error);
|
|
33
|
+
}
|
|
34
|
+
//This clears the standard input to allow interrupts like CTRL+C to work properly.
|
|
35
|
+
cleanUpStandardInput() {
|
|
36
|
+
if (process.stdin.isTTY) {
|
|
37
|
+
process.stdin.setRawMode(false);
|
|
38
|
+
process.stdin.pause();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/prompts/sdk/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAG7G,MAAM,OAAO,kBAAkB;IAA/B;QACmB,SAAI,GAAG,OAAO,EAAE,CAAC;IA4CpC,CAAC;IA1CQ,KAAK,CAAC,YAAY,CAAC,SAAwB;QAChD,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC;YAC9B,OAAO,EAAE,oBAAoB,SAAS,2CAA2C;YACjF,YAAY,EAAE,KAAK;SACpB,CAAC,CAAC;QAEH,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;YACxB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,2BAA2B;QACzB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC9D,CAAC;IAED,kCAAkC;QAChC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,6BAA6B,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,gCAAgC;QAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,mBAAmB,CAAC,gBAA+B;QACjD,KAAK,CAAC,qCAAqC,gBAAgB,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,QAAQ,CAAC,KAAa;QACpB,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACnB,CAAC;IAED,kFAAkF;IAC1E,oBAAoB;QAC1B,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAChC,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACxB,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/types/api/account.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { TransformationController } from "@apimatic/sdk";
|
|
3
|
-
export
|
|
2
|
+
export type TransformationIdParams = {
|
|
4
3
|
file: string;
|
|
5
4
|
url: string;
|
|
6
5
|
format: string;
|
|
7
6
|
};
|
|
8
|
-
export
|
|
7
|
+
export type DownloadTransformationParams = {
|
|
9
8
|
id: string;
|
|
10
9
|
destinationFilePath: string;
|
|
11
10
|
transformationController: TransformationController;
|
|
12
11
|
};
|
|
13
|
-
export
|
|
12
|
+
export type TransformationData = {
|
|
14
13
|
result: NodeJS.ReadableStream | Blob;
|
|
15
14
|
};
|
|
16
15
|
export declare const DestinationFormats: {
|
|
@@ -28,3 +27,19 @@ export declare const DestinationFormats: {
|
|
|
28
27
|
Postman20: string;
|
|
29
28
|
GraphQlSchema: string;
|
|
30
29
|
};
|
|
30
|
+
export declare enum TransformationFormats {
|
|
31
|
+
APIMATIC = "Apimatic",
|
|
32
|
+
WADL2009 = "Wadl2009",
|
|
33
|
+
WSDL = "Wsdl",
|
|
34
|
+
SWAGGER10 = "Swagger10",
|
|
35
|
+
SWAGGER20 = "Swagger20",
|
|
36
|
+
SWAGGERYAML = "Swaggeryaml",
|
|
37
|
+
OAS3 = "Oas3",
|
|
38
|
+
OPENAPI3YAML = "Openapi3Yaml",
|
|
39
|
+
APIBLUEPRINT = "Apiblueprint",
|
|
40
|
+
RAML = "Raml",
|
|
41
|
+
RAML10 = "Raml10",
|
|
42
|
+
POSTMAN10 = "Postman10",
|
|
43
|
+
POSTMAN20 = "Postman20",
|
|
44
|
+
GRAPHQLSCHEMA = "Graphqlschema"
|
|
45
|
+
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DestinationFormats = void 0;
|
|
4
|
-
exports.DestinationFormats = {
|
|
1
|
+
export const DestinationFormats = {
|
|
5
2
|
OpenApi3Json: "json",
|
|
6
3
|
OpenApi3Yaml: "yaml",
|
|
7
4
|
APIMATIC: "json",
|
|
@@ -16,3 +13,21 @@ exports.DestinationFormats = {
|
|
|
16
13
|
Postman20: "json",
|
|
17
14
|
GraphQlSchema: "json"
|
|
18
15
|
};
|
|
16
|
+
export var TransformationFormats;
|
|
17
|
+
(function (TransformationFormats) {
|
|
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":"AAkBA,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"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type GetValidationParams = {
|
|
2
2
|
file: string;
|
|
3
3
|
url: string;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type APIValidateError = {
|
|
6
6
|
modelState: {
|
|
7
7
|
"exception Error": string[];
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
|
-
export
|
|
10
|
+
export type AuthorizationError = {
|
|
11
11
|
body: string;
|
|
12
12
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/types/api/validate.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface BuildConfig {
|
|
2
|
+
generatePortal?: PortalConfig;
|
|
3
|
+
apiCopilotConfig?: CopilotConfig;
|
|
4
|
+
[key: string]: unknown;
|
|
5
|
+
}
|
|
6
|
+
export interface PortalConfig {
|
|
7
|
+
contentFolder?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CopilotConfig {
|
|
10
|
+
isEnabled: boolean;
|
|
11
|
+
key: string;
|
|
12
|
+
welcomeMessage: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function updateCopilotConfig(buildConfig: BuildConfig, copilotConfig: CopilotConfig): BuildConfig;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/types/build/build.ts"],"names":[],"mappings":"AAgBA,MAAM,UAAU,mBAAmB,CACjC,WAAwB,EACxB,aAA4B;IAE5B,uCACK,WAAW,KACd,gBAAgB,oBACX,aAAa,KAElB;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DirectoryPath } from "./file/directoryPath.js";
|
|
2
|
+
import { FilePath } from "./file/filePath.js";
|
|
3
|
+
import { BuildConfig } from "./build/build.js";
|
|
4
|
+
export declare class BuildContext {
|
|
5
|
+
private readonly fileService;
|
|
6
|
+
private readonly buildDirectory;
|
|
7
|
+
constructor(buildDirectory: DirectoryPath);
|
|
8
|
+
get BuildFile(): FilePath;
|
|
9
|
+
validate(): Promise<boolean>;
|
|
10
|
+
exists(): Promise<boolean>;
|
|
11
|
+
getBuildFileContents(): Promise<BuildConfig>;
|
|
12
|
+
updateBuildFileContents(buildJson: BuildConfig): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { FileService } from "../infrastructure/file-service.js";
|
|
2
|
+
import { FilePath } from "./file/filePath.js";
|
|
3
|
+
import { FileName } from "./file/fileName.js";
|
|
4
|
+
export class BuildContext {
|
|
5
|
+
constructor(buildDirectory) {
|
|
6
|
+
this.fileService = new FileService();
|
|
7
|
+
this.buildDirectory = buildDirectory;
|
|
8
|
+
}
|
|
9
|
+
get BuildFile() {
|
|
10
|
+
// TODO: add checks for build file path
|
|
11
|
+
return new FilePath(this.buildDirectory, new FileName("APIMATIC-BUILD.json"));
|
|
12
|
+
}
|
|
13
|
+
async validate() {
|
|
14
|
+
// TODO: add more checks here
|
|
15
|
+
if (!(await this.fileService.directoryExists(this.buildDirectory)))
|
|
16
|
+
return false;
|
|
17
|
+
return await this.fileService.fileExists(this.BuildFile);
|
|
18
|
+
}
|
|
19
|
+
async exists() {
|
|
20
|
+
return !(await this.fileService.directoryEmpty(this.buildDirectory));
|
|
21
|
+
}
|
|
22
|
+
async getBuildFileContents() {
|
|
23
|
+
const buildFileContent = await this.fileService.getContents(this.BuildFile);
|
|
24
|
+
return JSON.parse(buildFileContent);
|
|
25
|
+
}
|
|
26
|
+
async updateBuildFileContents(buildJson) {
|
|
27
|
+
await this.fileService.writeContents(this.BuildFile, JSON.stringify(buildJson, null, 2));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=build-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-context.js","sourceRoot":"","sources":["../../src/types/build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAG9C,MAAM,OAAO,YAAY;IAIvB,YAAY,cAA6B;QAHxB,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAI/C,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;IAED,IAAW,SAAS;QAClB,uCAAuC;QACvC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,QAAQ,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAChF,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,6BAA6B;QAC7B,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YAAE,OAAO,KAAK,CAAC;QAEjF,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IACvE,CAAC;IAEM,KAAK,CAAC,oBAAoB;QAC/B,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAgB,CAAC;IACrD,CAAC;IAEM,KAAK,CAAC,uBAAuB,CAAC,SAAsB;QACzD,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3F,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare class Result<T, TError> {
|
|
2
|
+
private readonly Status;
|
|
3
|
+
readonly value?: T | undefined;
|
|
4
|
+
readonly error?: TError | undefined;
|
|
5
|
+
private constructor();
|
|
6
|
+
static success<T, TError>(value: T): Result<T, TError>;
|
|
7
|
+
static failure<T, TError>(error: TError): Result<T, TError>;
|
|
8
|
+
static cancelled<T, TError>(value: T): Result<T, TError>;
|
|
9
|
+
isFailed(): boolean;
|
|
10
|
+
isCancelled(): boolean;
|
|
11
|
+
isSuccess(): boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare enum ResultStatus {
|
|
14
|
+
Success = 0,
|
|
15
|
+
Failed = 1,
|
|
16
|
+
Cancelled = 2
|
|
17
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export class Result {
|
|
2
|
+
constructor(Status, value, error) {
|
|
3
|
+
this.Status = Status;
|
|
4
|
+
this.value = value;
|
|
5
|
+
this.error = error;
|
|
6
|
+
}
|
|
7
|
+
static success(value) {
|
|
8
|
+
return new Result(ResultStatus.Success, value, undefined);
|
|
9
|
+
}
|
|
10
|
+
static failure(error) {
|
|
11
|
+
return new Result(ResultStatus.Failed, undefined, error);
|
|
12
|
+
}
|
|
13
|
+
static cancelled(value) {
|
|
14
|
+
return new Result(ResultStatus.Cancelled, value, undefined);
|
|
15
|
+
}
|
|
16
|
+
isFailed() {
|
|
17
|
+
return this.Status == ResultStatus.Failed;
|
|
18
|
+
}
|
|
19
|
+
isCancelled() {
|
|
20
|
+
return this.Status == ResultStatus.Cancelled;
|
|
21
|
+
}
|
|
22
|
+
isSuccess() {
|
|
23
|
+
return this.Status == ResultStatus.Success;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export var ResultStatus;
|
|
27
|
+
(function (ResultStatus) {
|
|
28
|
+
ResultStatus[ResultStatus["Success"] = 0] = "Success";
|
|
29
|
+
ResultStatus[ResultStatus["Failed"] = 1] = "Failed";
|
|
30
|
+
ResultStatus[ResultStatus["Cancelled"] = 2] = "Cancelled";
|
|
31
|
+
})(ResultStatus || (ResultStatus = {}));
|
|
32
|
+
//# sourceMappingURL=result.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/types/common/result.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,MAAM;IACjB,YACmB,MAAoB,EACrB,KAAS,EACT,KAAc;QAFb,WAAM,GAAN,MAAM,CAAc;QACrB,UAAK,GAAL,KAAK,CAAI;QACT,UAAK,GAAL,KAAK,CAAS;IAC7B,CAAC;IAEG,MAAM,CAAC,OAAO,CAAY,KAAQ;QACvC,OAAO,IAAI,MAAM,CAAY,YAAY,CAAC,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACvE,CAAC;IAEM,MAAM,CAAC,OAAO,CAAY,KAAa;QAC5C,OAAO,IAAI,MAAM,CAAY,YAAY,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAEM,MAAM,CAAC,SAAS,CAAY,KAAQ;QACzC,OAAO,IAAI,MAAM,CAAY,YAAY,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;IACzE,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC;IAC5C,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,SAAS,CAAC;IAC/C,CAAC;IAEM,SAAS;QACd,OAAO,IAAI,CAAC,MAAM,IAAI,YAAY,CAAC,OAAO,CAAC;IAC7C,CAAC;CACF;AAED,MAAM,CAAN,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,qDAAO,CAAA;IACP,mDAAM,CAAA;IACN,yDAAS,CAAA;AACX,CAAC,EAJW,YAAY,KAAZ,YAAY,QAIvB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare abstract class DomainEvent {
|
|
2
|
+
protected abstract readonly eventName: string;
|
|
3
|
+
private readonly message;
|
|
4
|
+
private readonly commandName;
|
|
5
|
+
private readonly flags;
|
|
6
|
+
constructor(message: string, commandName: string, flags: Record<string, unknown>);
|
|
7
|
+
private extractFlagKeys;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export class DomainEvent {
|
|
2
|
+
constructor(message, commandName, flags) {
|
|
3
|
+
this.message = message;
|
|
4
|
+
this.commandName = commandName;
|
|
5
|
+
this.flags = this.extractFlagKeys(flags);
|
|
6
|
+
}
|
|
7
|
+
extractFlagKeys(flags) {
|
|
8
|
+
return Object.keys(flags);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=domain-event.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain-event.js","sourceRoot":"","sources":["../../../src/types/events/domain-event.ts"],"names":[],"mappings":"AAAA,MAAM,OAAgB,WAAW;IAM/B,YAAY,OAAe,EAAE,WAAmB,EAAE,KAA8B;QAC9E,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEO,eAAe,CAAC,KAA8B;QACpD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DomainEvent } from "../../types/events/domain-event.js";
|
|
2
|
+
export class RecipeCreationFailedEvent extends DomainEvent {
|
|
3
|
+
constructor(message, commandName, flags) {
|
|
4
|
+
super(message, commandName, flags);
|
|
5
|
+
this.eventName = RecipeCreationFailedEvent.name;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=recipe-creation-failed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipe-creation-failed.js","sourceRoot":"","sources":["../../../src/types/events/recipe-creation-failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,MAAM,OAAO,yBAA0B,SAAQ,WAAW;IAGxD,YAAY,OAAe,EAAE,WAAmB,EAAE,KAA8B;QAC9E,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAHlB,cAAS,GAAG,yBAAyB,CAAC,IAAI,CAAC;IAI9D,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DomainEvent } from "../../types/events/domain-event.js";
|
|
2
|
+
export class TocCreationFailedEvent extends DomainEvent {
|
|
3
|
+
constructor(message, commandName, flags) {
|
|
4
|
+
super(message, commandName, flags);
|
|
5
|
+
this.eventName = TocCreationFailedEvent.name;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=toc-creation-failed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toc-creation-failed.js","sourceRoot":"","sources":["../../../src/types/events/toc-creation-failed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEjE,MAAM,OAAO,sBAAuB,SAAQ,WAAW;IAGrD,YAAY,OAAe,EAAE,WAAmB,EAAE,KAA8B;QAC9E,KAAK,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAHlB,cAAS,GAAG,sBAAsB,CAAC,IAAI,CAAC;IAI3D,CAAC;CACF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as path from "path";
|
|
2
|
+
export class DirectoryPath {
|
|
3
|
+
constructor(directoryPath, ...subPaths) {
|
|
4
|
+
this.directoryPath = path.resolve(directoryPath, ...subPaths);
|
|
5
|
+
}
|
|
6
|
+
toString() {
|
|
7
|
+
return this.directoryPath;
|
|
8
|
+
}
|
|
9
|
+
join(subPath) {
|
|
10
|
+
return new DirectoryPath(path.join(this.directoryPath, subPath));
|
|
11
|
+
}
|
|
12
|
+
isEqual(other) {
|
|
13
|
+
return this.directoryPath === other.directoryPath;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=directoryPath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directoryPath.js","sourceRoot":"","sources":["../../../src/types/file/directoryPath.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,MAAM,OAAO,aAAa;IAGxB,YAAY,aAAqB,EAAE,GAAG,QAAkB;QACtD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,GAAG,QAAQ,CAAC,CAAC;IAChE,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAEM,IAAI,CAAC,OAAe;QACzB,OAAO,IAAI,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IACnE,CAAC;IAEM,OAAO,CAAC,KAAoB;QACjC,OAAO,IAAI,CAAC,aAAa,KAAK,KAAK,CAAC,aAAa,CAAC;IACpD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileName.js","sourceRoot":"","sources":["../../../src/types/file/fileName.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,QAAQ;IAGnB,YAAY,IAAY;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FileName } from "./fileName.js";
|
|
2
|
+
import { DirectoryPath } from "./directoryPath.js";
|
|
3
|
+
export declare class FilePath {
|
|
4
|
+
private readonly fileName;
|
|
5
|
+
private readonly directoryPath;
|
|
6
|
+
constructor(path: DirectoryPath, name: FileName);
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
export class FilePath {
|
|
3
|
+
constructor(path, name) {
|
|
4
|
+
this.fileName = name;
|
|
5
|
+
this.directoryPath = path;
|
|
6
|
+
}
|
|
7
|
+
toString() {
|
|
8
|
+
return path.join(this.directoryPath.toString(), this.fileName.toString());
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=filePath.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filePath.js","sourceRoot":"","sources":["../../../src/types/file/filePath.ts"],"names":[],"mappings":"AAEA,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,OAAO,QAAQ;IAInB,YAAY,IAAmB,EAAE,IAAc;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;IAC7E,CAAC;CACF"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class FlagsProvider {
|
|
2
|
+
private static readonly inputFlagName;
|
|
3
|
+
static input: {
|
|
4
|
+
[FlagsProvider.inputFlagName]: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
5
|
+
};
|
|
6
|
+
static destination(artifact: string, artifactName: string): {
|
|
7
|
+
destination: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
static authKey: {
|
|
10
|
+
"auth-key": import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
static force: {
|
|
13
|
+
force: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Flags } from "@oclif/core";
|
|
2
|
+
export class FlagsProvider {
|
|
3
|
+
static destination(artifact, artifactName) {
|
|
4
|
+
return {
|
|
5
|
+
destination: Flags.string({
|
|
6
|
+
char: "d",
|
|
7
|
+
description: `[default: <${FlagsProvider.inputFlagName}>/${artifact}] path where the ${artifactName} will be generated.`
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
FlagsProvider.inputFlagName = "input";
|
|
13
|
+
// Common folder flag group
|
|
14
|
+
FlagsProvider.input = {
|
|
15
|
+
[FlagsProvider.inputFlagName]: Flags.string({
|
|
16
|
+
char: "i",
|
|
17
|
+
description: "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files."
|
|
18
|
+
})
|
|
19
|
+
};
|
|
20
|
+
// Auth key group
|
|
21
|
+
FlagsProvider.authKey = {
|
|
22
|
+
"auth-key": Flags.string({
|
|
23
|
+
char: "k",
|
|
24
|
+
description: "override current authentication state with an authentication key."
|
|
25
|
+
})
|
|
26
|
+
};
|
|
27
|
+
FlagsProvider.force = {
|
|
28
|
+
force: Flags.boolean({
|
|
29
|
+
char: "f",
|
|
30
|
+
default: false,
|
|
31
|
+
description: "overwrite changes without asking for user consent."
|
|
32
|
+
})
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=flags-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags-provider.js","sourceRoot":"","sources":["../../src/types/flags-provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAEpC,MAAM,OAAO,aAAa;IAWjB,MAAM,CAAC,WAAW,CAAC,QAAgB,EAAE,YAAoB;QAC9D,OAAO;YACL,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;gBACxB,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,cAAc,aAAa,CAAC,aAAa,KAAK,QAAQ,oBAAoB,YAAY,qBAAqB;aACzH,CAAC;SACH,CAAC;IACJ,CAAC;;AAjBuB,2BAAa,GAAW,OAAgB,CAAC;AACjE,2BAA2B;AACb,mBAAK,GAAG;IACpB,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC;QAC1C,IAAI,EAAE,GAAG;QACT,WAAW,EACT,uIAAuI;KAC1I,CAAC;CACH,CAAC;AAWF,iBAAiB;AACH,qBAAO,GAAG;IACtB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC;QACvB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mEAAmE;KACjF,CAAC;CACH,CAAC;AAEY,mBAAK,GAAG;IACpB,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,oDAAoD;KAClE,CAAC;CACH,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
export interface GeneratePortalParams {
|
|
2
|
+
readonly sourceBuildInputZipFilePath: string;
|
|
3
|
+
readonly generatedPortalArtifactsFolderPath: string;
|
|
4
|
+
readonly generatedPortalArtifactsZipFilePath: string;
|
|
5
|
+
readonly overrideAuthKey: string | null;
|
|
6
|
+
readonly generateZipFile: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface ErrorResponse {
|
|
9
|
+
readonly title: string;
|
|
10
|
+
readonly detail?: string;
|
|
11
|
+
readonly errors: Record<string, string[]>;
|
|
12
|
+
readonly message?: string;
|
|
13
|
+
}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
;
|
|
2
|
+
export {};
|
|
3
|
+
//# sourceMappingURL=generate.js.map
|