Skip to content

Commit

Permalink
feat: version 0.0.45
Browse files Browse the repository at this point in the history
  • Loading branch information
SquatsTonight committed Aug 30, 2021
1 parent 85f8e37 commit 015082d
Show file tree
Hide file tree
Showing 48 changed files with 821 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ lerna-debug.log*
**/s.origin.yaml
**/.env
package-lock.json
dist

2 changes: 0 additions & 2 deletions .signore
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
Expand Down
10 changes: 10 additions & 0 deletions dist/common/logger.d.ts
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;
}
24 changes: 24 additions & 0 deletions dist/index.d.ts
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;
}
1 change: 1 addition & 0 deletions dist/index.js

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions dist/interface.d.ts
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[];
}
5 changes: 5 additions & 0 deletions dist/lib/component/component.d.ts
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;
}
10 changes: 10 additions & 0 deletions dist/lib/component/domain.d.ts
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;
};
}
23 changes: 23 additions & 0 deletions dist/lib/component/fc-base-sdk.d.ts
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;
};
}
23 changes: 23 additions & 0 deletions dist/lib/component/fc-base.d.ts
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;
};
}
10 changes: 10 additions & 0 deletions dist/lib/component/fc-domain.d.ts
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;
};
}
9 changes: 9 additions & 0 deletions dist/lib/component/fc-info.d.ts
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;
}
10 changes: 10 additions & 0 deletions dist/lib/component/fc-sync.d.ts
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;
}
32 changes: 32 additions & 0 deletions dist/lib/component/nas.d.ts
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;
};
}
19 changes: 19 additions & 0 deletions dist/lib/component/ram.d.ts
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;
};
}
11 changes: 11 additions & 0 deletions dist/lib/component/sls.d.ts
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;
};
}
4 changes: 4 additions & 0 deletions dist/lib/component/stdout-formatter.d.ts
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>;
}
25 changes: 25 additions & 0 deletions dist/lib/component/vpc.d.ts
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;
};
}
1 change: 1 addition & 0 deletions dist/lib/definition.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function isAutoConfig(config: any): boolean;
1 change: 1 addition & 0 deletions dist/lib/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export declare function addEnv(envVars: any): any;
6 changes: 6 additions & 0 deletions dist/lib/error.d.ts
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;
38 changes: 38 additions & 0 deletions dist/lib/fc/custom-domain.d.ts
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 {};
24 changes: 24 additions & 0 deletions dist/lib/fc/fc-deploy.d.ts
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;
}
Loading

0 comments on commit 015082d

Please sign in to comment.