diff --git a/src/common/provider.ts b/src/common/provider.ts index 366cb0a3..67af4b25 100644 --- a/src/common/provider.ts +++ b/src/common/provider.ts @@ -1,6 +1,6 @@ -export enum PROVIDER { - HUAWEI = 'HUAWEI', - ALIBABA = 'ALIBABA', +export enum Provider { + HUAWEI = 'huawei', + ALIYUN = 'aliyun', // TENCENT = 'TENCENT', // AWS = 'AZURE', // AZURE = 'AZURE', diff --git a/src/parser/index.ts b/src/parser/index.ts index bfc24e4e..9e9cd658 100644 --- a/src/parser/index.ts +++ b/src/parser/index.ts @@ -1,11 +1,12 @@ import { existsSync, readFileSync } from 'node:fs'; -import { ActionContext, Provider, ServerlessIac, ServerlessIacRaw } from '../types'; +import { ActionContext, ServerlessIac, ServerlessIacRaw } from '../types'; import { parseFunction } from './functionParser'; import { parseEvent } from './eventParser'; import { parseDatabase } from './databaseParser'; import { parseTag } from './tagParser'; import { parse } from 'yaml'; import { validateYaml } from '../validator'; +import { Provider } from '../common'; const validateExistence = (path: string) => { if (!existsSync(path)) { diff --git a/src/stack/deploy.ts b/src/stack/deploy.ts index 70d554e1..93f8d3c0 100644 --- a/src/stack/deploy.ts +++ b/src/stack/deploy.ts @@ -1,7 +1,7 @@ import * as ros from '@alicloud/ros-cdk-core'; -import { ActionContext, Provider, ServerlessIac } from '../types'; -import { logger, rosStackDeploy } from '../common'; +import { ActionContext, ServerlessIac } from '../types'; +import { logger, Provider, rosStackDeploy } from '../common'; import { RosStack } from './rosStack'; import { RfsStack } from './rfsStack'; diff --git a/src/types/index.ts b/src/types/index.ts index 1e84014c..504c7e7d 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -3,6 +3,7 @@ import { Tags } from './domains/tag'; import { EventDomain, EventRaw } from './domains/event'; import { DatabaseDomain, DatabaseRaw } from './domains/database'; import { FunctionDomain, FunctionRaw } from './domains/function'; +import { Provider } from '../common'; export * from './domains/database'; export * from './domains/event'; @@ -11,11 +12,6 @@ export * from './domains/tag'; export * from './domains/vars'; export * from './domains/context'; -export const enum Provider { - ALIYUN = 'aliyun', - HUAWEI = 'huawei', -} - export type ServerlessIacRaw = { version: string; provider: Provider;