arky-js
Version:
**Arky.js** is a powerful, annotation-based framework for building serverless applications on **AWS Lambda and API Gateway**. Inspired by Angular and NestJS, Arky.js simplifies serverless development by providing decorators for defining modules, controlle
41 lines (40 loc) • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PlatformFactory = void 0;
const platform_type_enum_1 = require("../constants/enums/platform-type.enum");
const aws_bundler_1 = require("./aws/aws-bundler");
const cdk_generator_1 = require("./aws/cdk-generator");
const lambda_code_generator_1 = require("./aws/lambda-code-generator");
class PlatformFactory {
constructor(platformType) {
this.platformType = platformType;
}
static getInstance(platformType) {
return new PlatformFactory(platformType);
}
getCodeGenerator() {
switch (this.platformType) {
case platform_type_enum_1.PlatformType.AWS:
return new lambda_code_generator_1.LambdaCodeGenerator();
default:
throw new Error(`Unsupported platform type: ${this.platformType}`);
}
}
getBundler() {
switch (this.platformType) {
case platform_type_enum_1.PlatformType.AWS:
return new aws_bundler_1.AwsBundler();
default:
throw new Error(`Unsupported platform type: ${this.platformType}`);
}
}
getIacGenerator() {
switch (this.platformType) {
case platform_type_enum_1.PlatformType.AWS:
return new cdk_generator_1.CdkGenerator();
default:
throw new Error(`Unsupported platform type: ${this.platformType}`);
}
}
}
exports.PlatformFactory = PlatformFactory;