@apimatic/cli 1.1.0-alpha.13 → 1.1.0-alpha.15
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 +96 -95
- 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 +46 -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 +54 -47
- package/lib/actions/portal/generate.js.map +1 -1
- package/lib/actions/portal/recipe/new-recipe.d.ts +3 -3
- package/lib/actions/portal/recipe/new-recipe.js +18 -31
- package/lib/actions/portal/recipe/new-recipe.js.map +1 -1
- package/lib/actions/portal/serve.d.ts +17 -0
- package/lib/actions/portal/serve.js +36 -0
- package/lib/actions/portal/serve.js.map +1 -0
- package/lib/actions/portal/toc/new-toc.d.ts +4 -1
- package/lib/actions/portal/toc/new-toc.js +37 -34
- package/lib/actions/portal/toc/new-toc.js.map +1 -1
- package/lib/actions/sdk/generate.d.ts +13 -0
- package/lib/actions/sdk/generate.js +49 -0
- package/lib/actions/sdk/generate.js.map +1 -0
- package/lib/application/portal/serve/portal-watcher.d.ts +11 -0
- package/lib/application/portal/serve/portal-watcher.js +67 -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 +2 -1
- package/lib/application/portal/toc/sdl-parser.js +4 -4
- package/lib/application/portal/toc/sdl-parser.js.map +1 -1
- package/lib/client-utils/auth-manager.d.ts +7 -2
- package/lib/client-utils/auth-manager.js +24 -7
- package/lib/client-utils/auth-manager.js.map +1 -1
- package/lib/client-utils/sdk-client.d.ts +0 -1
- package/lib/client-utils/sdk-client.js +7 -38
- package/lib/client-utils/sdk-client.js.map +1 -1
- package/lib/commands/api/transform.d.ts +2 -2
- package/lib/commands/api/transform.js +10 -19
- package/lib/commands/api/transform.js.map +1 -1
- package/lib/commands/api/validate.d.ts +1 -1
- package/lib/commands/api/validate.js +5 -13
- package/lib/commands/api/validate.js.map +1 -1
- package/lib/commands/auth/login.d.ts +2 -1
- package/lib/commands/auth/login.js +19 -65
- package/lib/commands/auth/login.js.map +1 -1
- package/lib/commands/auth/logout.js +2 -6
- package/lib/commands/auth/logout.js.map +1 -1
- package/lib/commands/auth/status.js +3 -6
- package/lib/commands/auth/status.js.map +1 -1
- package/lib/commands/portal/copilot.d.ts +12 -0
- package/lib/commands/portal/copilot.js +35 -0
- package/lib/commands/portal/copilot.js.map +1 -0
- package/lib/commands/portal/generate.d.ts +7 -10
- package/lib/commands/portal/generate.js +18 -83
- package/lib/commands/portal/generate.js.map +1 -1
- package/lib/commands/portal/quickstart.d.ts +2 -2
- package/lib/commands/portal/quickstart.js +58 -29
- package/lib/commands/portal/quickstart.js.map +1 -1
- package/lib/commands/portal/recipe/new.d.ts +1 -3
- package/lib/commands/portal/recipe/new.js +21 -27
- package/lib/commands/portal/recipe/new.js.map +1 -1
- package/lib/commands/portal/serve.d.ts +7 -6
- package/lib/commands/portal/serve.js +62 -112
- package/lib/commands/portal/serve.js.map +1 -1
- package/lib/commands/portal/toc/new.d.ts +4 -5
- package/lib/commands/portal/toc/new.js +26 -37
- package/lib/commands/portal/toc/new.js.map +1 -1
- package/lib/commands/sdk/generate.d.ts +8 -6
- package/lib/commands/sdk/generate.js +53 -124
- package/lib/commands/sdk/generate.js.map +1 -1
- package/lib/controllers/portal/quickstart.d.ts +0 -2
- package/lib/controllers/portal/quickstart.js +2 -60
- package/lib/controllers/portal/quickstart.js.map +1 -1
- 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 +15 -0
- package/lib/infrastructure/file-service.js +61 -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 +52 -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 +7 -4
- package/lib/infrastructure/services/portal-service.js +70 -49
- package/lib/infrastructure/services/portal-service.js.map +1 -1
- 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 +25 -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 +6 -0
- package/lib/prompts/portal/copilot.js +35 -0
- package/lib/prompts/portal/copilot.js.map +1 -0
- package/lib/prompts/portal/generate.d.ts +3 -2
- package/lib/prompts/portal/generate.js +21 -36
- package/lib/prompts/portal/generate.js.map +1 -1
- package/lib/prompts/portal/quickstart.d.ts +8 -9
- package/lib/prompts/portal/quickstart.js +44 -32
- package/lib/prompts/portal/quickstart.js.map +1 -1
- package/lib/prompts/portal/recipe/new-recipe.d.ts +1 -0
- package/lib/prompts/portal/recipe/new-recipe.js +18 -8
- package/lib/prompts/portal/recipe/new-recipe.js.map +1 -1
- package/lib/prompts/portal/serve.d.ts +4 -6
- package/lib/prompts/portal/serve.js +24 -15
- package/lib/prompts/portal/serve.js.map +1 -1
- package/lib/prompts/portal/toc/new-toc.d.ts +3 -2
- package/lib/prompts/portal/toc/new-toc.js +11 -14
- package/lib/prompts/portal/toc/new-toc.js.map +1 -1
- 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/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/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 +0 -13
- package/lib/types/portal/quickstart.d.ts +1 -1
- package/lib/types/portal/serve.d.ts +13 -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/sdk/generate.d.ts +8 -8
- package/lib/types/sdk/generate.js +10 -10
- package/lib/types/sdk/generate.js.map +1 -1
- 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/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/utils/utils.d.ts +1 -4
- package/lib/utils/utils.js +18 -32
- package/lib/utils/utils.js.map +1 -1
- package/lib/validators/common/directoryValidator.d.ts +3 -7
- package/lib/validators/common/directoryValidator.js +10 -37
- package/lib/validators/common/directoryValidator.js.map +1 -1
- 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 +6 -3
- package/lib/controllers/portal/generate.d.ts +0 -3
- package/lib/controllers/portal/generate.js +0 -106
- package/lib/controllers/portal/generate.js.map +0 -1
- package/lib/controllers/portal/serve.d.ts +0 -3
- package/lib/controllers/portal/serve.js +0 -136
- package/lib/controllers/portal/serve.js.map +0 -1
- package/lib/controllers/sdk/generate.d.ts +0 -4
- package/lib/controllers/sdk/generate.js +0 -61
- package/lib/controllers/sdk/generate.js.map +0 -1
- package/lib/services/portal/server.d.ts +0 -14
- package/lib/services/portal/server.js +0 -97
- package/lib/services/portal/server.js.map +0 -1
- package/lib/validators/common/portValidator.d.ts +0 -5
- package/lib/validators/common/portValidator.js +0 -16
- package/lib/validators/common/portValidator.js.map +0 -1
- package/lib/validators/portal/serveValidator.d.ts +0 -6
- package/lib/validators/portal/serveValidator.js +0 -17
- package/lib/validators/portal/serveValidator.js.map +0 -1
|
@@ -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,gCAAgC,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC9B,CAAC;IAED,gCAAgC;QAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,wBAAwB,CAAC,CAAC,CAAC;QAC/D,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":""}
|
|
@@ -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,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"}
|
|
@@ -5,22 +5,9 @@ export interface GeneratePortalParams {
|
|
|
5
5
|
readonly overrideAuthKey: string | null;
|
|
6
6
|
readonly generateZipFile: boolean;
|
|
7
7
|
}
|
|
8
|
-
export interface PortalPaths {
|
|
9
|
-
readonly sourceFolderPath: string;
|
|
10
|
-
readonly destinationFolderPath: string;
|
|
11
|
-
readonly generatedPortalArtifactsFolderPath: string;
|
|
12
|
-
readonly generatedPortalArtifactsZipFilePath: string;
|
|
13
|
-
}
|
|
14
8
|
export interface ErrorResponse {
|
|
15
9
|
readonly title: string;
|
|
16
10
|
readonly detail?: string;
|
|
17
11
|
readonly errors: Record<string, string[]>;
|
|
18
12
|
readonly message?: string;
|
|
19
13
|
}
|
|
20
|
-
export interface GenerateFlags {
|
|
21
|
-
readonly folder: string;
|
|
22
|
-
readonly destination: string;
|
|
23
|
-
readonly force: boolean;
|
|
24
|
-
readonly zip: boolean;
|
|
25
|
-
readonly "auth-key": string;
|
|
26
|
-
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ServeFlags {
|
|
2
|
+
readonly port: number;
|
|
3
|
+
readonly folder: string;
|
|
4
|
+
readonly destination: string;
|
|
5
|
+
readonly ignore: string;
|
|
6
|
+
readonly open: boolean;
|
|
7
|
+
readonly "auth-key": string | undefined;
|
|
8
|
+
readonly "no-reload": boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface ServePaths {
|
|
11
|
+
readonly sourceDirectoryPath: string;
|
|
12
|
+
readonly destinationDirectoryPath: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/types/portal/serve.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DirectoryPath } from "./file/directoryPath.js";
|
|
2
|
+
import { FilePath } from "./file/filePath.js";
|
|
3
|
+
export declare class PortalContext {
|
|
4
|
+
private readonly portalDirectory;
|
|
5
|
+
private readonly fileService;
|
|
6
|
+
private readonly zipService;
|
|
7
|
+
constructor(portalDirectory: DirectoryPath);
|
|
8
|
+
get ZipPath(): FilePath;
|
|
9
|
+
exists(): Promise<boolean>;
|
|
10
|
+
save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FileService } from "../infrastructure/file-service.js";
|
|
2
|
+
import { FilePath } from "./file/filePath.js";
|
|
3
|
+
import { FileName } from "./file/fileName.js";
|
|
4
|
+
import { ZipService } from "../infrastructure/zip-service.js";
|
|
5
|
+
export class PortalContext {
|
|
6
|
+
constructor(portalDirectory) {
|
|
7
|
+
this.portalDirectory = portalDirectory;
|
|
8
|
+
this.fileService = new FileService();
|
|
9
|
+
this.zipService = new ZipService();
|
|
10
|
+
}
|
|
11
|
+
get ZipPath() {
|
|
12
|
+
// TODO: add checks for build file path
|
|
13
|
+
return new FilePath(this.portalDirectory, new FileName("portal.zip"));
|
|
14
|
+
}
|
|
15
|
+
async exists() {
|
|
16
|
+
return !await this.fileService.directoryEmpty(this.portalDirectory);
|
|
17
|
+
}
|
|
18
|
+
async save(tempPortalFilePath, zipPortal) {
|
|
19
|
+
await this.fileService.cleanDirectory(this.portalDirectory);
|
|
20
|
+
if (zipPortal) {
|
|
21
|
+
await this.fileService.copy(tempPortalFilePath, this.ZipPath);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
await this.zipService.unArchive(tempPortalFilePath, this.portalDirectory);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=portal-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"portal-context.js","sourceRoot":"","sources":["../../src/types/portal-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;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,OAAO,aAAa;IAKxB,YAA6B,eAA8B;QAA9B,oBAAe,GAAf,eAAe,CAAe;QAH1C,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAG/C,CAAC;IAED,IAAW,OAAO;QAChB,uCAAuC;QACvC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,kBAA4B,EAAE,SAAkB;QAChE,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5D,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;CACF"}
|
|
@@ -12,12 +12,12 @@ export type DownloadSDKParams = {
|
|
|
12
12
|
export type SDKGenerateUnprocessableError = {
|
|
13
13
|
message: string;
|
|
14
14
|
};
|
|
15
|
-
export declare enum
|
|
16
|
-
CSHARP = "
|
|
17
|
-
JAVA = "
|
|
18
|
-
PHP = "
|
|
19
|
-
PYTHON = "
|
|
20
|
-
RUBY = "
|
|
21
|
-
TYPESCRIPT = "
|
|
22
|
-
GO = "
|
|
15
|
+
export declare enum LanguagePlatform {
|
|
16
|
+
CSHARP = "csharp",
|
|
17
|
+
JAVA = "java",
|
|
18
|
+
PHP = "php",
|
|
19
|
+
PYTHON = "python",
|
|
20
|
+
RUBY = "ruby",
|
|
21
|
+
TYPESCRIPT = "typescript",
|
|
22
|
+
GO = "go"
|
|
23
23
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})(
|
|
1
|
+
export var LanguagePlatform;
|
|
2
|
+
(function (LanguagePlatform) {
|
|
3
|
+
LanguagePlatform["CSHARP"] = "csharp";
|
|
4
|
+
LanguagePlatform["JAVA"] = "java";
|
|
5
|
+
LanguagePlatform["PHP"] = "php";
|
|
6
|
+
LanguagePlatform["PYTHON"] = "python";
|
|
7
|
+
LanguagePlatform["RUBY"] = "ruby";
|
|
8
|
+
LanguagePlatform["TYPESCRIPT"] = "typescript";
|
|
9
|
+
LanguagePlatform["GO"] = "go";
|
|
10
|
+
})(LanguagePlatform || (LanguagePlatform = {}));
|
|
11
11
|
//# sourceMappingURL=generate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/sdk/generate.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/sdk/generate.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,6CAAyB,CAAA;IACzB,6BAAS,CAAA;AACX,CAAC,EARW,gBAAgB,KAAhB,gBAAgB,QAQ3B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DirectoryPath } from "./file/directoryPath.js";
|
|
2
|
+
import { FilePath } from "./file/filePath.js";
|
|
3
|
+
import { Platforms } from "@apimatic/sdk";
|
|
4
|
+
export declare class SdkContext {
|
|
5
|
+
private readonly sdkDirectory;
|
|
6
|
+
private readonly platform;
|
|
7
|
+
private readonly fileService;
|
|
8
|
+
private readonly zipService;
|
|
9
|
+
constructor(sdkDirectory: DirectoryPath, platform: Platforms);
|
|
10
|
+
get ZipPath(): FilePath;
|
|
11
|
+
exists(): Promise<boolean>;
|
|
12
|
+
save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FileService } from "../infrastructure/file-service.js";
|
|
2
|
+
import { FilePath } from "./file/filePath.js";
|
|
3
|
+
import { FileName } from "./file/fileName.js";
|
|
4
|
+
import { ZipService } from "../infrastructure/zip-service.js";
|
|
5
|
+
export class SdkContext {
|
|
6
|
+
constructor(sdkDirectory, platform) {
|
|
7
|
+
this.sdkDirectory = sdkDirectory;
|
|
8
|
+
this.platform = platform;
|
|
9
|
+
this.fileService = new FileService();
|
|
10
|
+
this.zipService = new ZipService();
|
|
11
|
+
}
|
|
12
|
+
get ZipPath() {
|
|
13
|
+
return new FilePath(this.sdkDirectory, new FileName(`${this.platform}.zip`));
|
|
14
|
+
}
|
|
15
|
+
async exists() {
|
|
16
|
+
return !await this.fileService.directoryEmpty(this.sdkDirectory);
|
|
17
|
+
}
|
|
18
|
+
async save(tempPortalFilePath, zipPortal) {
|
|
19
|
+
await this.fileService.cleanDirectory(this.sdkDirectory);
|
|
20
|
+
if (zipPortal) {
|
|
21
|
+
await this.fileService.copy(tempPortalFilePath, this.ZipPath);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
await this.zipService.unArchive(tempPortalFilePath, this.sdkDirectory);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=sdk-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-context.js","sourceRoot":"","sources":["../../src/types/sdk-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;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG9D,MAAM,OAAO,UAAU;IAKrB,YAA6B,YAA2B,EACrC,QAAmB;QADT,iBAAY,GAAZ,YAAY,CAAe;QACrC,aAAQ,GAAR,QAAQ,CAAW;QAJrB,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAI/C,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAC;IAC/E,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACnE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,kBAA4B,EAAE,SAAkB;QAChE,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { FileService } from "../infrastructure/file-service.js";
|
|
2
|
+
export class SpecContext {
|
|
3
|
+
constructor(specDirectory) {
|
|
4
|
+
this.fileService = new FileService();
|
|
5
|
+
this.specDirectory = specDirectory;
|
|
6
|
+
}
|
|
7
|
+
async validate() {
|
|
8
|
+
// TODO: add more checks here
|
|
9
|
+
return await this.fileService.directoryExists(this.specDirectory);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=spec-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-context.js","sourceRoot":"","sources":["../../src/types/spec-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGhE,MAAM,OAAO,WAAW;IAItB,YAAY,aAA4B;QAHvB,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAI/C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,6BAA6B;QAC7B,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACnE,CAAC;CACF"}
|
package/lib/utils/utils.d.ts
CHANGED
|
@@ -22,7 +22,6 @@ export declare const zipDirectoryToStream: (sourcePath: string) => Promise<NodeJ
|
|
|
22
22
|
export declare const zipDirectory: (sourcePath: string, destinationPath: string) => Promise<string>;
|
|
23
23
|
export declare const replaceHTML: (string: string) => string;
|
|
24
24
|
export declare const isJSONParsable: (json: string) => boolean;
|
|
25
|
-
export declare const getGeneratedFilesPaths: (sourceDirectoryPath: string, generatedPortalArtifactsDirectoryPath: string) => string[];
|
|
26
25
|
export declare const getFileNameFromPath: (filePath: string) => string;
|
|
27
26
|
export declare const printValidationMessages: ({ warnings, errors, messages }: ValidationMessages, { log, warn, error }: loggers) => void;
|
|
28
27
|
/**
|
|
@@ -32,11 +31,9 @@ export declare const printValidationMessages: ({ warnings, errors, messages }: V
|
|
|
32
31
|
* @param destinationDir Path to the destination directory where files will be extracted.
|
|
33
32
|
*/
|
|
34
33
|
export declare function extractZipFile(zipFilePath: string, destinationDir: string): Promise<void>;
|
|
35
|
-
export declare function
|
|
36
|
-
export declare function cleanUpGeneratedPortalFiles(sourceDir: string): Promise<void>;
|
|
34
|
+
export declare function zipPortalSource(sourceDirectoryPath: string, generatedZipFilePath: string, ignoredPaths?: string[]): Promise<string>;
|
|
37
35
|
export declare function isPortInUse(port: number): Promise<boolean>;
|
|
38
36
|
export declare function parseStreamBodyToJson(body: NodeJS.ReadableStream): Promise<any>;
|
|
39
|
-
export declare const getNonHiddenItemsFromDirectory: (directoryPath: string) => string[];
|
|
40
37
|
export declare const getMessageInOrangeColor: (message: string) => string;
|
|
41
38
|
export declare const getMessageInBlueColor: (message: string) => string;
|
|
42
39
|
export declare const getMessageInCyanColor: (message: string) => string;
|