@apimatic/cli 1.1.0-alpha.21 → 1.1.0-alpha.22
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 +112 -90
- package/lib/actions/action-result.d.ts +8 -3
- package/lib/actions/action-result.js +34 -15
- package/lib/actions/action-result.js.map +1 -1
- 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 +6 -5
- package/lib/actions/auth/login.js +25 -33
- package/lib/actions/auth/login.js.map +1 -1
- 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 +5 -3
- package/lib/actions/portal/copilot.js +47 -37
- package/lib/actions/portal/copilot.js.map +1 -1
- package/lib/actions/portal/generate.d.ts +4 -5
- package/lib/actions/portal/generate.js +30 -37
- package/lib/actions/portal/generate.js.map +1 -1
- package/lib/actions/portal/quickstart.d.ts +16 -0
- package/lib/actions/portal/quickstart.js +145 -0
- package/lib/actions/portal/quickstart.js.map +1 -0
- package/lib/actions/portal/recipe/new-recipe.d.ts +11 -20
- package/lib/actions/portal/recipe/new-recipe.js +147 -221
- package/lib/actions/portal/recipe/new-recipe.js.map +1 -1
- package/lib/actions/portal/serve.d.ts +12 -10
- package/lib/actions/portal/serve.js +112 -17
- package/lib/actions/portal/serve.js.map +1 -1
- package/lib/actions/portal/toc/new-toc.d.ts +16 -15
- package/lib/actions/portal/toc/new-toc.js +80 -116
- package/lib/actions/portal/toc/new-toc.js.map +1 -1
- package/lib/actions/sdk/generate.d.ts +5 -6
- package/lib/actions/sdk/generate.js +22 -47
- package/lib/actions/sdk/generate.js.map +1 -1
- package/lib/application/portal/recipe/portal-recipe.d.ts +2 -2
- package/lib/application/portal/recipe/portal-recipe.js +9 -9
- package/lib/application/portal/recipe/portal-recipe.js.map +1 -1
- package/lib/application/portal/recipe/recipe-generator.d.ts +7 -2
- package/lib/application/portal/recipe/recipe-generator.js +21 -22
- package/lib/application/portal/recipe/recipe-generator.js.map +1 -1
- package/lib/client-utils/auth-manager.d.ts +1 -1
- package/lib/client-utils/auth-manager.js +3 -4
- package/lib/client-utils/auth-manager.js.map +1 -1
- package/lib/commands/api/transform.d.ts +6 -3
- package/lib/commands/api/transform.js +43 -94
- package/lib/commands/api/transform.js.map +1 -1
- package/lib/commands/api/validate.d.ts +6 -3
- package/lib/commands/api/validate.js +27 -66
- package/lib/commands/api/validate.js.map +1 -1
- package/lib/commands/auth/login.d.ts +2 -1
- package/lib/commands/auth/login.js +15 -9
- package/lib/commands/auth/login.js.map +1 -1
- package/lib/commands/auth/logout.d.ts +3 -1
- package/lib/commands/auth/logout.js +12 -13
- package/lib/commands/auth/logout.js.map +1 -1
- package/lib/commands/auth/status.d.ts +1 -0
- package/lib/commands/auth/status.js +13 -11
- package/lib/commands/auth/status.js.map +1 -1
- package/lib/commands/portal/copilot.d.ts +2 -2
- package/lib/commands/portal/copilot.js +22 -20
- package/lib/commands/portal/copilot.js.map +1 -1
- package/lib/commands/portal/generate.d.ts +3 -4
- package/lib/commands/portal/generate.js +19 -14
- package/lib/commands/portal/generate.js.map +1 -1
- package/lib/commands/portal/quickstart.d.ts +3 -4
- package/lib/commands/portal/quickstart.js +24 -101
- package/lib/commands/portal/quickstart.js.map +1 -1
- package/lib/commands/portal/recipe/new.d.ts +3 -1
- package/lib/commands/portal/recipe/new.js +31 -23
- package/lib/commands/portal/recipe/new.js.map +1 -1
- package/lib/commands/portal/serve.d.ts +5 -5
- package/lib/commands/portal/serve.js +31 -57
- package/lib/commands/portal/serve.js.map +1 -1
- package/lib/commands/portal/toc/new.d.ts +2 -2
- package/lib/commands/portal/toc/new.js +35 -26
- package/lib/commands/portal/toc/new.js.map +1 -1
- package/lib/commands/sdk/generate.d.ts +5 -4
- package/lib/commands/sdk/generate.js +26 -17
- package/lib/commands/sdk/generate.js.map +1 -1
- package/lib/hooks/not-found.js +1 -1
- package/lib/hooks/not-found.js.map +1 -1
- package/lib/infrastructure/api-utils.js +3 -2
- package/lib/infrastructure/api-utils.js.map +1 -1
- package/lib/{application/portal/serve/watcher-handler.d.ts → infrastructure/debounce-service.d.ts} +3 -3
- package/lib/{application/portal/serve/watcher-handler.js → infrastructure/debounce-service.js} +5 -4
- package/lib/infrastructure/debounce-service.js.map +1 -0
- package/lib/infrastructure/env-info.d.ts +1 -1
- package/lib/infrastructure/env-info.js +2 -2
- package/lib/infrastructure/env-info.js.map +1 -1
- package/lib/infrastructure/file-service.d.ts +7 -2
- package/lib/infrastructure/file-service.js +46 -5
- package/lib/infrastructure/file-service.js.map +1 -1
- package/lib/infrastructure/launcher-service.d.ts +2 -0
- package/lib/infrastructure/launcher-service.js +4 -0
- package/lib/infrastructure/launcher-service.js.map +1 -1
- 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/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 +2 -2
- package/lib/infrastructure/services/api-service.js +6 -6
- package/lib/infrastructure/services/api-service.js.map +1 -1
- package/lib/infrastructure/services/auth-service.d.ts +1 -1
- package/lib/infrastructure/services/auth-service.js +7 -5
- package/lib/infrastructure/services/auth-service.js.map +1 -1
- 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 +11 -13
- package/lib/infrastructure/services/portal-service.js +73 -102
- package/lib/infrastructure/services/portal-service.js.map +1 -1
- package/lib/infrastructure/services/telemetry-service.d.ts +3 -2
- package/lib/infrastructure/services/telemetry-service.js +4 -6
- package/lib/infrastructure/services/telemetry-service.js.map +1 -1
- 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/prompts/api/transform.d.ts +11 -0
- package/lib/prompts/api/transform.js +30 -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 +41 -0
- package/lib/prompts/api/validate.js.map +1 -0
- package/lib/prompts/auth/login.d.ts +6 -1
- package/lib/prompts/auth/login.js +12 -3
- package/lib/prompts/auth/login.js.map +1 -1
- 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 +21 -0
- package/lib/prompts/auth/status.js.map +1 -0
- package/lib/prompts/format.d.ts +33 -0
- package/lib/prompts/format.js +99 -0
- package/lib/prompts/format.js.map +1 -0
- package/lib/prompts/portal/copilot.d.ts +8 -4
- package/lib/prompts/portal/copilot.js +35 -24
- package/lib/prompts/portal/copilot.js.map +1 -1
- package/lib/prompts/portal/generate.d.ts +9 -7
- package/lib/prompts/portal/generate.js +22 -23
- package/lib/prompts/portal/generate.js.map +1 -1
- package/lib/prompts/portal/quickstart.d.ts +30 -29
- package/lib/prompts/portal/quickstart.js +99 -193
- package/lib/prompts/portal/quickstart.js.map +1 -1
- package/lib/prompts/portal/recipe/new-recipe.d.ts +23 -18
- package/lib/prompts/portal/recipe/new-recipe.js +70 -108
- package/lib/prompts/portal/recipe/new-recipe.js.map +1 -1
- package/lib/prompts/portal/serve.d.ts +10 -3
- package/lib/prompts/portal/serve.js +30 -11
- package/lib/prompts/portal/serve.js.map +1 -1
- package/lib/prompts/portal/toc/new-toc.d.ts +12 -8
- package/lib/prompts/portal/toc/new-toc.js +20 -22
- package/lib/prompts/portal/toc/new-toc.js.map +1 -1
- package/lib/prompts/sdk/generate.d.ts +7 -7
- package/lib/prompts/sdk/generate.js +17 -23
- package/lib/prompts/sdk/generate.js.map +1 -1
- package/lib/types/api/account.d.ts +1 -1
- package/lib/types/api/transform.d.ts +14 -25
- package/lib/types/api/transform.js +16 -16
- package/lib/types/api/transform.js.map +1 -1
- package/lib/types/build/build.d.ts +9 -1
- package/lib/types/build/build.js +5 -2
- package/lib/types/build/build.js.map +1 -1
- package/lib/types/build-context.d.ts +5 -1
- package/lib/types/build-context.js +21 -4
- package/lib/types/build-context.js.map +1 -1
- 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 +1 -1
- package/lib/types/events/domain-event.js.map +1 -1
- package/lib/types/events/quickstart-completed.js +1 -1
- package/lib/types/events/quickstart-initiated.js +1 -1
- package/lib/types/events/recipe-creation-failed.d.ts +1 -1
- package/lib/types/events/recipe-creation-failed.js +1 -1
- package/lib/types/events/recipe-creation-failed.js.map +1 -1
- package/lib/types/events/toc-creation-failed.d.ts +1 -1
- package/lib/types/events/toc-creation-failed.js +1 -1
- package/lib/types/events/toc-creation-failed.js.map +1 -1
- package/lib/types/file/directory.d.ts +17 -0
- package/lib/types/file/directory.js +86 -0
- package/lib/types/file/directory.js.map +1 -0
- package/lib/types/file/directoryPath.d.ts +3 -1
- package/lib/types/file/directoryPath.js +8 -2
- package/lib/types/file/directoryPath.js.map +1 -1
- package/lib/types/file/fileName.d.ts +2 -0
- package/lib/types/file/fileName.js +12 -0
- package/lib/types/file/fileName.js.map +1 -1
- package/lib/types/file/filePath.d.ts +2 -0
- package/lib/types/file/filePath.js +21 -0
- package/lib/types/file/filePath.js.map +1 -1
- 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/portal-context.d.ts +3 -1
- package/lib/types/portal-context.js +10 -0
- package/lib/types/portal-context.js.map +1 -1
- package/lib/types/recipe/recipe.d.ts +2 -17
- package/lib/types/recipe-context.d.ts +8 -0
- package/lib/types/recipe-context.js +21 -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 +2 -15
- package/lib/types/sdk/generate.js +24 -10
- package/lib/types/sdk/generate.js.map +1 -1
- package/lib/types/sdk-context.d.ts +6 -5
- package/lib/types/sdk-context.js +12 -8
- package/lib/types/sdk-context.js.map +1 -1
- package/lib/types/sdl/sdl.d.ts +9 -0
- package/lib/types/sdl/sdl.js +46 -1
- package/lib/types/sdl/sdl.js.map +1 -1
- package/lib/types/spec-context.d.ts +3 -0
- package/lib/types/spec-context.js +7 -2
- package/lib/types/spec-context.js.map +1 -1
- 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-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/utils/string-utils.d.ts +1 -0
- package/lib/utils/string-utils.js +10 -0
- package/lib/utils/string-utils.js.map +1 -0
- package/lib/utils/utils.d.ts +2 -27
- package/lib/utils/utils.js +6 -145
- package/lib/utils/utils.js.map +1 -1
- package/package.json +4 -4
- package/lib/application/portal/serve/portal-watcher.d.ts +0 -11
- package/lib/application/portal/serve/portal-watcher.js +0 -64
- package/lib/application/portal/serve/portal-watcher.js.map +0 -1
- package/lib/application/portal/serve/serve-handler.d.ts +0 -16
- package/lib/application/portal/serve/serve-handler.js +0 -91
- package/lib/application/portal/serve/serve-handler.js.map +0 -1
- package/lib/application/portal/serve/watcher-handler.js.map +0 -1
- package/lib/application/portal/toc/sdl-parser.d.ts +0 -19
- package/lib/application/portal/toc/sdl-parser.js +0 -90
- package/lib/application/portal/toc/sdl-parser.js.map +0 -1
- package/lib/client-utils/sdk-client.d.ts +0 -18
- package/lib/client-utils/sdk-client.js +0 -41
- package/lib/client-utils/sdk-client.js.map +0 -1
- package/lib/config/env.d.ts +0 -26
- package/lib/config/env.js +0 -27
- package/lib/config/env.js.map +0 -1
- package/lib/controllers/api/transform.d.ts +0 -5
- package/lib/controllers/api/transform.js +0 -50
- package/lib/controllers/api/transform.js.map +0 -1
- package/lib/controllers/api/validate.d.ts +0 -3
- package/lib/controllers/api/validate.js +0 -29
- package/lib/controllers/api/validate.js.map +0 -1
- package/lib/controllers/portal/quickstart.d.ts +0 -13
- package/lib/controllers/portal/quickstart.js +0 -214
- package/lib/controllers/portal/quickstart.js.map +0 -1
- package/lib/infrastructure/api-client-utils.d.ts +0 -6
- package/lib/infrastructure/api-client-utils.js +0 -34
- package/lib/infrastructure/api-client-utils.js.map +0 -1
- package/lib/prompts/portal/common/base-prompts.d.ts +0 -7
- package/lib/prompts/portal/common/base-prompts.js +0 -19
- package/lib/prompts/portal/common/base-prompts.js.map +0 -1
- package/lib/types/api/validate.d.ts +0 -12
- package/lib/types/api/validate.js +0 -2
- package/lib/types/api/validate.js.map +0 -1
- package/lib/types/common/result.d.ts +0 -17
- package/lib/types/common/result.js +0 -32
- package/lib/types/common/result.js.map +0 -1
- package/lib/types/portal/generate.d.ts +0 -13
- package/lib/types/portal/generate.js +0 -3
- package/lib/types/portal/generate.js.map +0 -1
- package/lib/types/portal/quickstart.d.ts +0 -17
- package/lib/types/portal/quickstart.js +0 -2
- package/lib/types/portal/quickstart.js.map +0 -1
- package/lib/types/portal/serve.d.ts +0 -12
- package/lib/types/portal/serve.js +0 -2
- package/lib/types/portal/serve.js.map +0 -1
- package/lib/validators/common/directoryValidator.d.ts +0 -5
- package/lib/validators/common/directoryValidator.js +0 -22
- package/lib/validators/common/directoryValidator.js.map +0 -1
- package/lib/validators/portal/serve-validator.d.ts +0 -6
- package/lib/validators/portal/serve-validator.js +0 -15
- package/lib/validators/portal/serve-validator.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/actions/api/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qDAAqD,CAAC;AAGxF,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,OAAO,cAAc;IAMzB,YAAY,SAAwB,EAAE,eAAgC,EAAE,UAAyB,IAAI;QALpF,YAAO,GAAuB,IAAI,kBAAkB,EAAE,CAAC;QAWxD,YAAO,GAAG,KAAK,EAC7B,YAA2B,EAC3B,wBAAwB,GAAG,IAAI,EACR,EAAE;YACzB,OAAO,MAAM,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,EAAE;gBAC/C,MAAM,eAAe,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAC;gBAC3D,MAAM,iBAAiB,GAAG,MAAM,eAAe,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;gBACxE,IAAI,iBAAiB,CAAC,KAAK,EAAE,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ata } from "../../types/common/command-metadata.js";
|
|
3
|
+
import { ActionResult } from "../action-result.js";
|
|
3
4
|
export declare class LoginAction {
|
|
4
5
|
private readonly configDir;
|
|
6
|
+
private readonly commandMetadata;
|
|
5
7
|
private readonly authService;
|
|
6
8
|
private readonly apiService;
|
|
7
9
|
private readonly prompts;
|
|
8
|
-
constructor(configDir: DirectoryPath);
|
|
9
|
-
execute(apiKey?: string | undefined): Promise<
|
|
10
|
-
private
|
|
11
|
-
private verifyKeyAndSave;
|
|
10
|
+
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata);
|
|
11
|
+
execute(apiKey?: string | undefined): Promise<ActionResult>;
|
|
12
|
+
private pollDeviceToken;
|
|
12
13
|
}
|
|
@@ -1,30 +1,39 @@
|
|
|
1
1
|
import { AuthService } from "../../infrastructure/services/auth-service.js";
|
|
2
2
|
import { ApiService } from "../../infrastructure/services/api-service.js";
|
|
3
|
-
import { err, ok } from "neverthrow";
|
|
4
3
|
import { v4 as uuid } from "uuid";
|
|
5
4
|
import open from "open";
|
|
6
5
|
import { setAuthInfo } from "../../client-utils/auth-manager.js";
|
|
7
6
|
import { LoginPrompts } from "../../prompts/auth/login.js";
|
|
8
|
-
import {
|
|
7
|
+
import { ActionResult } from "../action-result.js";
|
|
8
|
+
import { err, ok } from "neverthrow";
|
|
9
9
|
export class LoginAction {
|
|
10
|
-
constructor(configDir) {
|
|
10
|
+
constructor(configDir, commandMetadata) {
|
|
11
11
|
this.configDir = configDir;
|
|
12
|
+
this.commandMetadata = commandMetadata;
|
|
12
13
|
this.authService = new AuthService();
|
|
13
14
|
this.apiService = new ApiService();
|
|
14
15
|
this.prompts = new LoginPrompts();
|
|
15
16
|
}
|
|
16
17
|
async execute(apiKey = undefined) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
})).andThen((r) => r);
|
|
18
|
+
const apiKeyResult = await this.pollDeviceToken(apiKey, this.commandMetadata.shell);
|
|
19
|
+
if (apiKeyResult.isErr()) {
|
|
20
|
+
this.prompts.loginTimeout();
|
|
21
|
+
return ActionResult.failed();
|
|
22
22
|
}
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
// TODO: Use status endpoint here
|
|
24
|
+
// Problem, we don't have email info here, just the key and required for setAuthInfo
|
|
25
|
+
const accountInfoResult = await this.prompts.accountInfoSpinner(this.apiService.getAccountInfo(this.configDir, this.commandMetadata.shell, apiKeyResult.value));
|
|
26
|
+
if (accountInfoResult.isErr()) {
|
|
27
|
+
this.prompts.invalidKeyProvided(accountInfoResult.error);
|
|
28
|
+
return ActionResult.failed();
|
|
25
29
|
}
|
|
30
|
+
await setAuthInfo(accountInfoResult.value.Email, apiKeyResult.value, false, this.configDir);
|
|
31
|
+
this.prompts.loginSuccessful(accountInfoResult.value.Email);
|
|
32
|
+
return ActionResult.success();
|
|
26
33
|
}
|
|
27
|
-
async
|
|
34
|
+
async pollDeviceToken(apiKey, shell) {
|
|
35
|
+
if (apiKey)
|
|
36
|
+
return ok(apiKey);
|
|
28
37
|
const state = uuid();
|
|
29
38
|
this.prompts.openBrowser();
|
|
30
39
|
await open(this.authService.getDeviceLoginUrl(state));
|
|
@@ -33,31 +42,14 @@ export class LoginAction {
|
|
|
33
42
|
const delayMs = 3 * 1000;
|
|
34
43
|
while (true) {
|
|
35
44
|
if (Date.now() - startTime > timeoutDuration) {
|
|
36
|
-
return err("
|
|
45
|
+
return err("TIMEOUT");
|
|
46
|
+
}
|
|
47
|
+
const result = await this.authService.getDeviceLoginToken(state, shell);
|
|
48
|
+
if (result.isOk()) {
|
|
49
|
+
return ok(result.value.apiKey);
|
|
37
50
|
}
|
|
38
|
-
const result = await this.authService.getDeviceLoginToken(state);
|
|
39
|
-
const token = result.match((res) => res.apiKey, () => {
|
|
40
|
-
/* ignore errors */
|
|
41
|
-
});
|
|
42
|
-
if (token)
|
|
43
|
-
return ok(token);
|
|
44
|
-
// eslint-disable-next-line no-undef
|
|
45
51
|
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
46
52
|
}
|
|
47
53
|
}
|
|
48
|
-
async verifyKeyAndSave(apiKey) {
|
|
49
|
-
const result = await this.apiService.getAccountInfo(this.configDir, apiKey);
|
|
50
|
-
return result.asyncMap(async (info) => {
|
|
51
|
-
await setAuthInfo(info.Email, apiKey, false, this.configDir);
|
|
52
|
-
return info.Email;
|
|
53
|
-
}).mapErr(e => {
|
|
54
|
-
switch (e) {
|
|
55
|
-
case "UNAUTHORIZED" /* ServiceError.UnAuthorized */:
|
|
56
|
-
return "The provided auth key is invalid";
|
|
57
|
-
default:
|
|
58
|
-
return getErrorMessage(e);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
54
|
}
|
|
63
55
|
//# sourceMappingURL=login.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/actions/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../../src/actions/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,OAAO,EAAE,EAAE,IAAI,IAAI,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,EAAE,EAAU,MAAM,YAAY,CAAC;AAI7C,MAAM,OAAO,WAAW;IAKtB,YAA6B,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,CAAC,eAAe,CAAC,MAA0B,EAAE,KAAa;QACrE,IAAI,MAAM;YAAE,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,IAAI,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;QAC3B,MAAM,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;QAEtD,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,4BAA4B;QACnE,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,MAAM,OAAO,GAAG,CAAC,GAAG,IAAI,CAAC;QAEzB,OAAO,IAAI,EAAE,CAAC;YACZ,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,GAAG,eAAe,EAAE,CAAC;gBAC7C,OAAO,GAAG,CAAC,SAAS,CAAC,CAAC;YACxB,CAAC;YACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACxE,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;gBAClB,OAAO,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACjC,CAAC;YACD,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
|
+
import { ActionResult } from "../action-result.js";
|
|
3
|
+
export declare class LogoutAction {
|
|
4
|
+
private readonly configDir;
|
|
5
|
+
private readonly prompts;
|
|
6
|
+
constructor(configDir: DirectoryPath);
|
|
7
|
+
execute(): Promise<ActionResult>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ActionResult } from "../action-result.js";
|
|
2
|
+
import { removeAuthInfo } from "../../client-utils/auth-manager.js";
|
|
3
|
+
import { LogoutPrompts } from "../../prompts/auth/logout.js";
|
|
4
|
+
export class LogoutAction {
|
|
5
|
+
constructor(configDir) {
|
|
6
|
+
this.configDir = configDir;
|
|
7
|
+
this.prompts = new LogoutPrompts();
|
|
8
|
+
}
|
|
9
|
+
async execute() {
|
|
10
|
+
await removeAuthInfo(this.configDir);
|
|
11
|
+
this.prompts.removeAuthInfo();
|
|
12
|
+
return ActionResult.success();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=logout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../src/actions/auth/logout.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,OAAO,YAAY;IAGvB,YAA6B,SAAwB;QAAxB,cAAS,GAAT,SAAS,CAAe;QAFpC,YAAO,GAAG,IAAI,aAAa,EAAE,CAAC;IAES,CAAC;IAElD,KAAK,CAAC,OAAO;QAClB,MAAM,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACrC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC;QAC9B,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ActionResult } from "../action-result.js";
|
|
2
|
+
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
3
|
+
import { CommandMetadata } from "../../types/common/command-metadata.js";
|
|
4
|
+
export declare class StatusAction {
|
|
5
|
+
private readonly configDir;
|
|
6
|
+
private readonly commandMetadata;
|
|
7
|
+
private readonly prompts;
|
|
8
|
+
private readonly apiService;
|
|
9
|
+
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata);
|
|
10
|
+
execute(authKey: string | null): Promise<ActionResult>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ActionResult } from "../action-result.js";
|
|
2
|
+
import { getAuthInfo } from "../../client-utils/auth-manager.js";
|
|
3
|
+
import { StatusPrompts } from "../../prompts/auth/status.js";
|
|
4
|
+
import { ApiService } from "../../infrastructure/services/api-service.js";
|
|
5
|
+
export class StatusAction {
|
|
6
|
+
constructor(configDir, commandMetadata) {
|
|
7
|
+
this.configDir = configDir;
|
|
8
|
+
this.commandMetadata = commandMetadata;
|
|
9
|
+
this.prompts = new StatusPrompts();
|
|
10
|
+
this.apiService = new ApiService();
|
|
11
|
+
}
|
|
12
|
+
async execute(authKey) {
|
|
13
|
+
const accountInfo = await getAuthInfo(this.configDir.toString());
|
|
14
|
+
if (accountInfo === null) {
|
|
15
|
+
return ActionResult.failed();
|
|
16
|
+
}
|
|
17
|
+
const result = await this.prompts.accountInfoSpinner(this.apiService.getAccountInfo(this.configDir, this.commandMetadata.shell, authKey));
|
|
18
|
+
if (result.isErr()) {
|
|
19
|
+
this.prompts.invalidKeyProvided(result.error);
|
|
20
|
+
return ActionResult.failed();
|
|
21
|
+
}
|
|
22
|
+
this.prompts.showAccountInfo(result.value);
|
|
23
|
+
return ActionResult.success();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/actions/auth/status.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAE1E,MAAM,OAAO,YAAY;IAIvB,YAA6B,SAAwB,EAAmB,eAAgC;QAA3E,cAAS,GAAT,SAAS,CAAe;QAAmB,oBAAe,GAAf,eAAe,CAAiB;QAHvF,YAAO,GAAG,IAAI,aAAa,EAAE,CAAC;QAC9B,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAE4D,CAAC;IAErG,KAAK,CAAC,OAAO,CAAC,OAAsB;QACzC,MAAM,WAAW,GAAG,MAAM,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjE,IAAI,WAAW,KAAK,IAAI,EAAE,CAAC;YACzB,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QACD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAClD,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,CACpF,CAAC;QACF,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;YACnB,IAAI,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC9C,OAAO,YAAY,CAAC,MAAM,EAAE,CAAC;QAC/B,CAAC;QACD,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
2
|
import { ActionResult } from "../action-result.js";
|
|
3
|
+
import { CommandMetadata } from "../../types/common/command-metadata.js";
|
|
3
4
|
export declare class CopilotAction {
|
|
4
5
|
private readonly apiService;
|
|
5
6
|
private readonly fileService;
|
|
6
7
|
private readonly launcherService;
|
|
7
8
|
private readonly prompts;
|
|
8
9
|
private readonly configDir;
|
|
10
|
+
private readonly commandMetadata;
|
|
9
11
|
private readonly authKey;
|
|
10
|
-
constructor(configDir: DirectoryPath, authKey?: string | null);
|
|
11
|
-
execute(buildDirectory: DirectoryPath, force: boolean, enable: boolean)
|
|
12
|
+
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
13
|
+
readonly execute: (buildDirectory: DirectoryPath, force: boolean, enable: boolean) => Promise<ActionResult>;
|
|
12
14
|
private selectCopilotKey;
|
|
13
|
-
private
|
|
15
|
+
private prepareWelcomeMessage;
|
|
14
16
|
}
|
|
@@ -7,59 +7,69 @@ import { FilePath } from "../../types/file/filePath.js";
|
|
|
7
7
|
import { FileName } from "../../types/file/fileName.js";
|
|
8
8
|
import { FileService } from "../../infrastructure/file-service.js";
|
|
9
9
|
import { LauncherService } from "../../infrastructure/launcher-service.js";
|
|
10
|
+
import { err, ok } from "neverthrow";
|
|
10
11
|
export class CopilotAction {
|
|
11
|
-
constructor(configDir, authKey = null) {
|
|
12
|
+
constructor(configDir, commandMetadata, authKey = null) {
|
|
12
13
|
this.apiService = new ApiService();
|
|
13
14
|
this.fileService = new FileService();
|
|
14
15
|
this.launcherService = new LauncherService();
|
|
15
16
|
this.prompts = new PortalCopilotPrompts();
|
|
17
|
+
this.execute = async (buildDirectory, force, enable) => {
|
|
18
|
+
const buildContext = new BuildContext(buildDirectory);
|
|
19
|
+
if (!(await buildContext.validate())) {
|
|
20
|
+
this.prompts.srcDirectoryEmpty(buildDirectory);
|
|
21
|
+
return ActionResult.failed();
|
|
22
|
+
}
|
|
23
|
+
const buildJson = await buildContext.getBuildFileContents();
|
|
24
|
+
if (!force && buildJson.apiCopilotConfig != null && !(await this.prompts.confirmOverwrite())) {
|
|
25
|
+
this.prompts.cancelled();
|
|
26
|
+
return ActionResult.cancelled();
|
|
27
|
+
}
|
|
28
|
+
const response = await this.prompts.spinnerAccountInfo(this.apiService.getAccountInfo(this.configDir, this.commandMetadata.shell, this.authKey));
|
|
29
|
+
if (response.isErr()) {
|
|
30
|
+
this.prompts.serviceError(response.error);
|
|
31
|
+
return ActionResult.failed();
|
|
32
|
+
}
|
|
33
|
+
const apiCopilotKeyResult = await this.selectCopilotKey(response.value, force);
|
|
34
|
+
if (apiCopilotKeyResult.isErr()) {
|
|
35
|
+
if (apiCopilotKeyResult.error === "cancelled")
|
|
36
|
+
return ActionResult.cancelled();
|
|
37
|
+
return ActionResult.failed();
|
|
38
|
+
}
|
|
39
|
+
const welcomeMessage = await this.prepareWelcomeMessage();
|
|
40
|
+
buildJson.apiCopilotConfig = {
|
|
41
|
+
isEnabled: enable,
|
|
42
|
+
key: apiCopilotKeyResult.value,
|
|
43
|
+
welcomeMessage: welcomeMessage
|
|
44
|
+
};
|
|
45
|
+
await buildContext.updateBuildFileContents(buildJson);
|
|
46
|
+
this.prompts.copilotConfigured(enable, apiCopilotKeyResult.value);
|
|
47
|
+
return ActionResult.success();
|
|
48
|
+
};
|
|
16
49
|
this.configDir = configDir;
|
|
50
|
+
this.commandMetadata = commandMetadata;
|
|
17
51
|
this.authKey = authKey;
|
|
18
52
|
}
|
|
19
|
-
async execute(buildDirectory, force, enable) {
|
|
20
|
-
const buildContext = new BuildContext(buildDirectory);
|
|
21
|
-
if (!(await buildContext.validate())) {
|
|
22
|
-
return ActionResult.error(`Unable to locate a valid "src" directory. Navigate to the directory containing your APIMatic Portal source or set up a new project by running apimatic portal:quickstart.`);
|
|
23
|
-
}
|
|
24
|
-
const buildJson = await buildContext.getBuildFileContents();
|
|
25
|
-
if (!force && buildJson.apiCopilotConfig != null && !(await this.prompts.confirmOverwrite()))
|
|
26
|
-
return ActionResult.error("Exiting without making any change.");
|
|
27
|
-
const response = await this.prompts.spinnerAccountInfo(() => this.apiService.getAccountInfo(this.configDir, this.authKey));
|
|
28
|
-
if (response.isErr()) {
|
|
29
|
-
return ActionResult.error(response._unsafeUnwrapErr());
|
|
30
|
-
}
|
|
31
|
-
const apiCopilotKey = await this.selectCopilotKey(response._unsafeUnwrap(), force);
|
|
32
|
-
if (apiCopilotKey instanceof Error) {
|
|
33
|
-
return ActionResult.error(apiCopilotKey.message);
|
|
34
|
-
}
|
|
35
|
-
const welcomeMessage = await this.getWelcomeMessage();
|
|
36
|
-
buildJson.apiCopilotConfig = {
|
|
37
|
-
isEnabled: enable,
|
|
38
|
-
key: apiCopilotKey,
|
|
39
|
-
welcomeMessage: welcomeMessage
|
|
40
|
-
};
|
|
41
|
-
await buildContext.updateBuildFileContents(buildJson);
|
|
42
|
-
this.prompts.copilotConfigured(enable, apiCopilotKey);
|
|
43
|
-
return ActionResult.success();
|
|
44
|
-
}
|
|
45
53
|
async selectCopilotKey(subscription, force) {
|
|
46
|
-
if (subscription === undefined ||
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return new Error("No copilot key found for the current subscription. Please contact support at support@apimatic.io.");
|
|
54
|
+
if (subscription.ApiCopilotKeys === undefined || subscription.ApiCopilotKeys.length === 0) {
|
|
55
|
+
this.prompts.noCopilotKeyFound();
|
|
56
|
+
return err("failed");
|
|
50
57
|
}
|
|
51
58
|
if (subscription.ApiCopilotKeys.length === 1) {
|
|
52
59
|
if (force || (await this.prompts.confirmSingleKeyUsage(subscription.ApiCopilotKeys[0])))
|
|
53
|
-
return subscription.ApiCopilotKeys[0];
|
|
54
|
-
|
|
60
|
+
return ok(subscription.ApiCopilotKeys[0]);
|
|
61
|
+
this.prompts.noCopilotKeySelected();
|
|
62
|
+
return err("cancelled");
|
|
55
63
|
}
|
|
56
64
|
const key = await this.prompts.selectCopilotKey(subscription.ApiCopilotKeys);
|
|
57
|
-
if (key === null)
|
|
58
|
-
|
|
65
|
+
if (key === null) {
|
|
66
|
+
this.prompts.noCopilotKeySelected();
|
|
67
|
+
return err("cancelled");
|
|
68
|
+
}
|
|
59
69
|
await this.prompts.displayApiCopilotKeyUsageWarning();
|
|
60
|
-
return key;
|
|
70
|
+
return ok(key);
|
|
61
71
|
}
|
|
62
|
-
async
|
|
72
|
+
async prepareWelcomeMessage() {
|
|
63
73
|
return await withDirPath(async (tempDir) => {
|
|
64
74
|
const tempFile = new FilePath(tempDir, new FileName("welcome-message.md"));
|
|
65
75
|
const defaultContent = "Hi there! I'm your API Integration Assistant, here to help you learn and integrate with this API.\n" +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/actions/portal/copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,MAAM,OAAO,aAAa;
|
|
1
|
+
{"version":3,"file":"copilot.js","sourceRoot":"","sources":["../../../src/actions/portal/copilot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8CAA8C,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE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C/D,IAAI,CAAC,OAAO,CAAC,wBAAwB,EAAE,CAAC;YACxC,MAAM,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YAClD,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACpE,OAAO,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { DirectoryPath } from "../../types/file/directoryPath.js";
|
|
2
2
|
import { ActionResult } from "../action-result.js";
|
|
3
|
+
import { CommandMetadata } from "../../types/common/command-metadata.js";
|
|
3
4
|
export declare class GenerateAction {
|
|
4
5
|
private readonly prompts;
|
|
5
|
-
private readonly zipArchiver;
|
|
6
|
-
private readonly fileService;
|
|
7
6
|
private readonly launcherService;
|
|
8
7
|
private readonly portalService;
|
|
9
8
|
private readonly configDir;
|
|
9
|
+
private readonly commandMetadata;
|
|
10
10
|
private readonly authKey;
|
|
11
|
-
constructor(configDir: DirectoryPath, authKey?: string | null);
|
|
12
|
-
readonly execute: (buildDirectory: DirectoryPath, portalDirectory: DirectoryPath,
|
|
13
|
-
private parseError;
|
|
11
|
+
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata, authKey?: string | null);
|
|
12
|
+
readonly execute: (buildDirectory: DirectoryPath, portalDirectory: DirectoryPath, force: boolean, zipPortal: boolean, displayMessages?: boolean) => Promise<ActionResult>;
|
|
14
13
|
}
|
|
@@ -1,66 +1,59 @@
|
|
|
1
1
|
import { PortalGeneratePrompts } from "../../prompts/portal/generate.js";
|
|
2
|
-
import { ZipService } from "../../infrastructure/zip-service.js";
|
|
3
|
-
import { FileService } from "../../infrastructure/file-service.js";
|
|
4
2
|
import { PortalService } from "../../infrastructure/services/portal-service.js";
|
|
5
|
-
import { FilePath } from "../../types/file/filePath.js";
|
|
6
|
-
import { FileName } from "../../types/file/fileName.js";
|
|
7
3
|
import { ActionResult } from "../action-result.js";
|
|
8
4
|
import { BuildContext } from "../../types/build-context.js";
|
|
9
5
|
import { PortalContext } from "../../types/portal-context.js";
|
|
10
6
|
import { withDirPath } from "../../infrastructure/tmp-extensions.js";
|
|
11
7
|
import { LauncherService } from "../../infrastructure/launcher-service.js";
|
|
8
|
+
import { TempContext } from "../../types/temp-context.js";
|
|
12
9
|
export class GenerateAction {
|
|
13
|
-
constructor(configDir, authKey = null) {
|
|
10
|
+
constructor(configDir, commandMetadata, authKey = null) {
|
|
14
11
|
this.prompts = new PortalGeneratePrompts();
|
|
15
|
-
this.zipArchiver = new ZipService();
|
|
16
|
-
this.fileService = new FileService();
|
|
17
12
|
this.launcherService = new LauncherService();
|
|
18
13
|
this.portalService = new PortalService();
|
|
19
|
-
this.execute = async (buildDirectory, portalDirectory,
|
|
14
|
+
this.execute = async (buildDirectory, portalDirectory, force, zipPortal, displayMessages = true) => {
|
|
20
15
|
if (buildDirectory.isEqual(portalDirectory)) {
|
|
21
|
-
|
|
16
|
+
this.prompts.directoryCannotBeSame(portalDirectory);
|
|
17
|
+
return ActionResult.failed();
|
|
22
18
|
}
|
|
23
19
|
const buildContext = new BuildContext(buildDirectory);
|
|
24
20
|
if (!(await buildContext.validate())) {
|
|
25
|
-
|
|
21
|
+
this.prompts.srcDirectoryEmpty(buildDirectory);
|
|
22
|
+
return ActionResult.failed();
|
|
26
23
|
}
|
|
27
24
|
const portalContext = new PortalContext(portalDirectory);
|
|
28
25
|
if (!force && (await portalContext.exists()) && !(await this.prompts.overwritePortal(portalDirectory))) {
|
|
29
|
-
|
|
26
|
+
this.prompts.portalDirectoryNotEmpty();
|
|
27
|
+
return ActionResult.cancelled();
|
|
30
28
|
}
|
|
31
29
|
return await withDirPath(async (tempDirectory) => {
|
|
32
|
-
|
|
33
|
-
const buildZipPath =
|
|
34
|
-
await this.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
const tempContext = new TempContext(tempDirectory);
|
|
31
|
+
const buildZipPath = await tempContext.zip(buildDirectory);
|
|
32
|
+
const response = await this.prompts.generatePortal(this.portalService.generatePortal(buildZipPath, this.configDir, this.commandMetadata, this.authKey));
|
|
33
|
+
if (response.isErr()) {
|
|
34
|
+
const error = response.error;
|
|
35
|
+
if (typeof error === "string") {
|
|
36
|
+
this.prompts.portalGenerationError(error);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
const errorZipPath = await tempContext.save(error);
|
|
40
|
+
const reportPath = await portalContext.saveError(errorZipPath);
|
|
41
|
+
await this.launcherService.openFile(reportPath);
|
|
42
|
+
this.prompts.portalGenerationErrorWithReport(reportPath);
|
|
43
|
+
}
|
|
44
|
+
return ActionResult.failed();
|
|
45
|
+
}
|
|
46
|
+
const tempPortalZipPath = await tempContext.save(response.value);
|
|
47
|
+
await portalContext.save(tempPortalZipPath, zipPortal);
|
|
48
|
+
if (displayMessages) {
|
|
49
|
+
this.prompts.portalGenerated(portalDirectory);
|
|
39
50
|
}
|
|
40
|
-
const tempPortalFilePath = new FilePath(tempDirectory, new FileName("portal.zip"));
|
|
41
|
-
await this.fileService.writeFile(tempPortalFilePath, response.value);
|
|
42
|
-
await portalContext.save(tempPortalFilePath, zipPortal);
|
|
43
|
-
this.prompts.displayPortalGenerationSuccessMessage();
|
|
44
51
|
return ActionResult.success();
|
|
45
52
|
});
|
|
46
53
|
};
|
|
47
54
|
this.configDir = configDir;
|
|
55
|
+
this.commandMetadata = commandMetadata;
|
|
48
56
|
this.authKey = authKey;
|
|
49
57
|
}
|
|
50
|
-
async parseError(error, portalDirectory, tempDirectory) {
|
|
51
|
-
if (typeof error === "string") {
|
|
52
|
-
return error;
|
|
53
|
-
}
|
|
54
|
-
const tempErrorFilePath = new FilePath(tempDirectory, new FileName("error.zip"));
|
|
55
|
-
await this.fileService.writeFile(tempErrorFilePath, error);
|
|
56
|
-
await this.fileService.cleanDirectory(portalDirectory);
|
|
57
|
-
await this.zipArchiver.unArchive(tempErrorFilePath, portalDirectory);
|
|
58
|
-
const errorReportPath = portalDirectory.join("apimatic-debug");
|
|
59
|
-
const htmlFilePath = new FilePath(errorReportPath, new FileName("apimatic-report.html"));
|
|
60
|
-
await this.launcherService.openFile(htmlFilePath); // Open the error report in the default browser
|
|
61
|
-
return ("An error occurred during portal generation due to an issue with the input. " +
|
|
62
|
-
"An error report has been written at the destination path: " +
|
|
63
|
-
errorReportPath);
|
|
64
|
-
}
|
|
65
58
|
}
|
|
66
59
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/actions/portal/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/actions/portal/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAG1D,MAAM,OAAO,cAAc;IAQzB,YAAY,SAAwB,EAAE,eAAgC,EAAE,UAAyB,IAAI;QAPpF,YAAO,GAA0B,IAAI,qBAAqB,EAAE,CAAC;QAC7D,oBAAe,GAAoB,IAAI,eAAe,EAAE,CAAC;QACzD,kBAAa,GAAkB,IAAI,aAAa,E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ionResult } from "../action-result.js";
|
|
3
|
+
import { CommandMetadata } from "../../types/common/command-metadata.js";
|
|
4
|
+
export declare class PortalQuickstartAction {
|
|
5
|
+
private readonly prompts;
|
|
6
|
+
private readonly zipService;
|
|
7
|
+
private readonly fileService;
|
|
8
|
+
private readonly configDir;
|
|
9
|
+
private readonly commandMetadata;
|
|
10
|
+
private readonly fileDownloadService;
|
|
11
|
+
private readonly buildFileUrl;
|
|
12
|
+
private readonly defaultSpecUrl;
|
|
13
|
+
private readonly repositoryFolderName;
|
|
14
|
+
constructor(configDir: DirectoryPath, commandMetadata: CommandMetadata);
|
|
15
|
+
readonly execute: () => Promise<ActionResult>;
|
|
16
|
+
}
|