-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
85f8e37
commit 015082d
Showing
48 changed files
with
821 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,4 +37,4 @@ lerna-debug.log* | |
**/s.origin.yaml | ||
**/.env | ||
package-lock.json | ||
dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
node_modules | ||
.s | ||
tsconfig.json | ||
tsconfig.base.json | ||
LICENSE | ||
package-lock.json | ||
.prettierrc.js | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export default class ComponentLogger { | ||
static CONTENT: string; | ||
static setContent(content: any): void; | ||
static log(m: any, color?: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'whiteBright' | 'gray'): void; | ||
static info(m: any): void; | ||
static debug(m: any): void; | ||
static error(m: any): void; | ||
static warning(m: any): void; | ||
static success(m: any): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as core from '@serverless-devs/core'; | ||
import { IInputs } from './interface'; | ||
export default class FcDeployComponent { | ||
logger: core.ILogger; | ||
private serverlessProfile; | ||
private fcService; | ||
private fcFunction; | ||
private fcTriggers; | ||
private fcCustomDomains; | ||
private region; | ||
private credentials; | ||
private curPath; | ||
private args; | ||
private access; | ||
deploy(inputs: IInputs): Promise<any>; | ||
help(): Promise<void>; | ||
remove(inputs: IInputs): Promise<any>; | ||
deployAutoNas(inputs: IInputs): Promise<any>; | ||
report(componentName: string, command: string, accountID?: string, access?: string): Promise<void>; | ||
private handlerBase; | ||
private setStatefulConfig; | ||
private checkIfResourceExistOnline; | ||
private handlerInputs; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ServiceConfig } from './lib/fc/service'; | ||
import { FunctionConfig } from './lib/fc/function'; | ||
import { TriggerConfig } from './lib/fc/trigger'; | ||
import { CustomDomainConfig } from './lib/fc/custom-domain'; | ||
import { ServerlessProfile } from './lib/profile'; | ||
export interface IInputs extends ServerlessProfile { | ||
props: IProperties; | ||
args: string; | ||
path: { | ||
configPath: string; | ||
}; | ||
command: string; | ||
} | ||
export interface IProperties { | ||
region: string; | ||
service: ServiceConfig; | ||
function: FunctionConfig; | ||
triggers: TriggerConfig[]; | ||
customDomains: CustomDomainConfig[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { IInputsBase } from '../profile'; | ||
export declare abstract class Component extends IInputsBase { | ||
abstract genComponentProp(): any; | ||
genComponentInputs(componentName?: string): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
export declare class DomainComponent extends Component { | ||
readonly serviceName: string; | ||
readonly functionName: string; | ||
constructor(serverlessProfile: ServerlessProfile, serviceName: string, functionName: string, region: string, credentials: ICredentials, curPath?: string, args?: string); | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ServiceConfig } from '../fc/service'; | ||
import { FunctionConfig } from '../fc/function'; | ||
import { TriggerConfig } from '../fc/trigger'; | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
export declare class FcBaseSdkComponent extends Component { | ||
readonly serviceConf: ServiceConfig; | ||
readonly functionConf?: FunctionConfig; | ||
readonly triggers?: TriggerConfig[]; | ||
constructor(serverlessProfile: ServerlessProfile, serviceConf: ServiceConfig, region: string, credentials: ICredentials, curPath?: string, args?: string, functionConf?: FunctionConfig, triggers?: TriggerConfig[]); | ||
genServiceProp(): { | ||
[key: string]: any; | ||
}; | ||
genFunctionProp(): { | ||
[key: string]: any; | ||
}; | ||
genTriggerProp(): Array<{ | ||
[key: string]: any; | ||
}>; | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ServiceConfig } from '../fc/service'; | ||
import { FunctionConfig } from '../fc/function'; | ||
import { TriggerConfig } from '../fc/trigger'; | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
export declare class FcBaseComponent extends Component { | ||
readonly serviceConf: ServiceConfig; | ||
readonly functionConf?: FunctionConfig; | ||
readonly triggers?: TriggerConfig[]; | ||
constructor(serverlessProfile: ServerlessProfile, serviceConf: ServiceConfig, region: string, credentials: ICredentials, curPath?: string, args?: string, functionConf?: FunctionConfig, triggers?: TriggerConfig[]); | ||
genServiceProp(): { | ||
[key: string]: any; | ||
}; | ||
genFunctionProp(): { | ||
[key: string]: any; | ||
}; | ||
genTriggerProp(): Array<{ | ||
[key: string]: any; | ||
}>; | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
import { CustomDomainConfig } from '../fc/custom-domain'; | ||
export declare class FcDomainComponent extends Component { | ||
readonly customDomainConfig: CustomDomainConfig; | ||
constructor(serverlessProfile: ServerlessProfile, customDomainConfig: CustomDomainConfig, region: string, credentials: ICredentials, curPath?: string, args?: string); | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Component } from './component'; | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
export default class FcInfoComponent extends Component { | ||
private readonly serviceName; | ||
private readonly functionName?; | ||
private readonly triggerNames?; | ||
constructor(serviceName: string, serverlessProfile: ServerlessProfile, region: string, credentials: ICredentials, curPath?: string, args?: string, functionName?: string, triggerNames?: string[]); | ||
genComponentProp(): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
export default class FcSync extends Component { | ||
private readonly serviceName; | ||
private readonly functionName?; | ||
private readonly triggerName?; | ||
private readonly targetDir?; | ||
constructor(serviceName: string, serverlessProfile: ServerlessProfile, region: string, credentials: ICredentials, curPath?: string, args?: string, functionName?: string, triggerName?: string, targetDir?: string); | ||
genComponentProp(): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
import { VpcConfig } from '../resource/vpc'; | ||
export declare class NasComponent extends Component { | ||
readonly nasName: string; | ||
readonly nasUid: number; | ||
readonly nasGid: number; | ||
readonly nasDir: string; | ||
readonly vpcConfig: VpcConfig; | ||
readonly role: string; | ||
readonly zoneId: string; | ||
readonly storageType: string; | ||
readonly assistServiceName: string; | ||
readonly mountPointDomain: string; | ||
readonly vswitchId: string; | ||
constructor(serverlessProfile: ServerlessProfile, { nasName, nasUid, nasGid, nasDir, vpcConfig, role, zoneId, storageType, assistServiceName, mountPointDomain, vswitchId }: { | ||
nasName: any; | ||
nasUid: any; | ||
nasGid: any; | ||
nasDir: any; | ||
vpcConfig: any; | ||
role: any; | ||
zoneId: any; | ||
storageType: any; | ||
assistServiceName: any; | ||
mountPointDomain: any; | ||
vswitchId: any; | ||
}, region: string, credentials: ICredentials, curPath?: string, args?: string); | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
export declare class RamComponent extends Component { | ||
readonly roleName: string; | ||
readonly resourceName?: string; | ||
readonly assumeRolePolicy?: any; | ||
readonly attachedPolicies?: any[]; | ||
readonly description?: string; | ||
constructor(serverlessProfile: ServerlessProfile, { roleName, resourceName, assumeRolePolicy, attachedPolicies, description }: { | ||
roleName: any; | ||
resourceName: any; | ||
assumeRolePolicy: any; | ||
attachedPolicies: any; | ||
description: any; | ||
}, region: string, credentials: ICredentials, curPath?: string, args?: string); | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
export declare class SlsComponent extends Component { | ||
readonly logproject: string; | ||
readonly logstore: string; | ||
readonly description?: string; | ||
constructor(serverlessProfile: ServerlessProfile, logproject: string, logstore: string, region: string, credentials: ICredentials, curPath?: string, args?: string, description?: string); | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export default class StdoutFormatter { | ||
static stdoutFormatter: any; | ||
static initStdout(): Promise<void>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { ServerlessProfile, ICredentials } from '../profile'; | ||
import { Component } from './component'; | ||
export declare class VpcComponent extends Component { | ||
readonly cidrBlock: string; | ||
readonly vpcName: string; | ||
readonly vpcDescription?: string; | ||
readonly vSwitchName: string; | ||
readonly vSwitchDescription?: string; | ||
readonly securityGroupName: string; | ||
readonly securityGroupDescription?: string; | ||
readonly zoneId: string; | ||
constructor(serverlessProfile: ServerlessProfile, { cidrBlock, vpcName, vpcDescription, vSwitchName, vSwitchDescription, securityGroupName, securityGroupDescription, zoneId }: { | ||
cidrBlock: any; | ||
vpcName: any; | ||
vpcDescription: any; | ||
vSwitchName: any; | ||
vSwitchDescription: any; | ||
securityGroupName: any; | ||
securityGroupDescription: any; | ||
zoneId: any; | ||
}, region: string, credentials: ICredentials, curPath?: string, args?: string); | ||
genComponentProp(): { | ||
[key: string]: any; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function isAutoConfig(config: any): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare function addEnv(envVars: any): any; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export declare function handleKnownErrors(ex: any): void; | ||
export declare function throwProcessedPopPermissionError(ex: any, action: any): void; | ||
export declare function generatePolicyName(action: string, ...resourceArr: any[]): string; | ||
export declare function printPermissionTip(policyName: any, action: any, resource: any): void; | ||
export declare function throwProcessedFCPermissionError(ex: any, region: any, ...resourceArr: any[]): void; | ||
export declare function isSlsNotExistException(e: any): boolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { IInputsBase, ICredentials, ServerlessProfile } from '../profile'; | ||
import { TriggerConfig } from './trigger'; | ||
export interface CustomDomainConfig { | ||
domainName: string; | ||
protocol: 'HTTP' | 'HTTP,HTTPS'; | ||
routeConfigs: RouteConfig[]; | ||
certConfig?: CertConfig; | ||
} | ||
interface RouteConfig { | ||
path: string; | ||
serviceName?: string; | ||
functionName?: string; | ||
qualifier?: string; | ||
methods?: string[]; | ||
} | ||
interface CertConfig { | ||
certName: string; | ||
certificate: string; | ||
privateKey: string; | ||
} | ||
export declare class FcCustomDomain extends IInputsBase { | ||
customDomainConf: CustomDomainConfig; | ||
readonly serviceName: string; | ||
readonly functionName: string; | ||
readonly hasHttpTrigger: boolean; | ||
readonly httpMethods?: string[]; | ||
readonly stateId: string; | ||
isDomainNameAuto: boolean; | ||
constructor(customDomainConf: CustomDomainConfig, serviceName: string, functionName: string, triggerConfs: TriggerConfig[], serverlessProfile: ServerlessProfile, region: string, credentials: ICredentials, curPath?: string, args?: string); | ||
initLocal(): Promise<void>; | ||
validateConfig(): void; | ||
initLocalConfig(): Promise<void>; | ||
setStatedCustomDomainConf(resolvedCustomDomainConf: CustomDomainConfig): Promise<void>; | ||
delStatedCustomDomainConf(): Promise<void>; | ||
getStatedCustomDomainConf(): Promise<string>; | ||
makeCustomDomain(): Promise<CustomDomainConfig>; | ||
} | ||
export {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { ServerlessProfile, ICredentials, IInputsBase } from '../profile'; | ||
export default abstract class FcDeploy<T> extends IInputsBase { | ||
localConfig: T; | ||
remoteConfig: T; | ||
statefulConfig: any; | ||
statefulAutoConfig: any; | ||
existOnline: boolean; | ||
useRemote: boolean; | ||
constructor(localConfig: T, serverlessProfile: ServerlessProfile, region: string, credentials: ICredentials, curPath?: string, args?: string); | ||
setKVInState(stateID: string, key: string, value: any): Promise<void>; | ||
unsetState(): Promise<void>; | ||
getState(): Promise<any>; | ||
initStateful(): Promise<void>; | ||
initStatefulAutoConfig(): Promise<void>; | ||
GetRemoteInfo(type: string, serviceName: string, functionName?: string, triggerName?: string): Promise<{ | ||
remoteConfig: T; | ||
resourceName: string; | ||
}>; | ||
initRemote(resourceType: string, serviceName: string, functionName?: string, triggerName?: string): Promise<void>; | ||
setStatefulConfig(): Promise<void>; | ||
setUseRemote(name: string, resourceType: string, useLocalFlag?: boolean, type?: string): Promise<void>; | ||
upgradeStatefulConfig(): void; | ||
abstract genStateID(): string; | ||
} |
Oops, something went wrong.