179 lines
4.3 KiB
TypeScript
179 lines
4.3 KiB
TypeScript
import { QiniuZone, CTYunZone, ALiYunZone, TencentYunZone, AmapKeyType } from 'oak-external-sdk';
|
|
export type Protocol = 'http:' | 'https:';
|
|
export type QiniuCloudConfig = {
|
|
accessKey: string;
|
|
secretKey: string;
|
|
};
|
|
export type QiniuLiveConfig = {
|
|
accessKey: string;
|
|
liveHost: string;
|
|
publishDomain: string;
|
|
playDomain: string;
|
|
playBackDomain: string;
|
|
hub: string;
|
|
publishKey: string;
|
|
playKey: string;
|
|
};
|
|
export type QiniuCosConfig = {
|
|
accessKey: string;
|
|
buckets: {
|
|
zone: QiniuZone;
|
|
name: string;
|
|
domain: string;
|
|
protocol: Protocol | Protocol[];
|
|
}[];
|
|
defaultBucket: string;
|
|
};
|
|
export type CTYunCosConfig = {
|
|
accessKey: string;
|
|
buckets: {
|
|
zone: CTYunZone;
|
|
name: string;
|
|
domain: string;
|
|
protocol: Protocol | Protocol[];
|
|
}[];
|
|
defaultBucket: string;
|
|
};
|
|
export type ALiYunCosConfig = {
|
|
accessKey: string;
|
|
buckets: {
|
|
zone: ALiYunZone;
|
|
name: string;
|
|
domain: string;
|
|
protocol: Protocol | Protocol[];
|
|
}[];
|
|
defaultBucket: string;
|
|
};
|
|
export type TencentYunCosConfig = {
|
|
accessKey: string;
|
|
buckets: {
|
|
zone: TencentYunZone;
|
|
name: string;
|
|
domain: string;
|
|
protocol: Protocol | Protocol[];
|
|
}[];
|
|
defaultBucket: string;
|
|
};
|
|
export type LocalCosConfig = {
|
|
accessKey: string;
|
|
buckets: {
|
|
name: string;
|
|
domain: string;
|
|
protocol: Protocol | Protocol[];
|
|
nginxPath?: string;
|
|
savePath: string;
|
|
uploadUrl: string;
|
|
getUrl: string;
|
|
downloadUrl?: string;
|
|
}[];
|
|
defaultBucket: string;
|
|
};
|
|
export type AMapConfig = {
|
|
key: string;
|
|
type: AmapKeyType;
|
|
};
|
|
export type MapWorldConfig = {
|
|
webApiKey: string;
|
|
};
|
|
export type LocalCloudConfig = {
|
|
accessKey: string;
|
|
secretKey: string;
|
|
};
|
|
export type AliCloudConfig = {
|
|
accessKeyId: string;
|
|
accessKeySecret: string;
|
|
regionId?: string;
|
|
apiVersion?: string;
|
|
endpoint?: string;
|
|
smsEndpoint?: string;
|
|
};
|
|
export type TencentCloudConfig = {
|
|
secretId: string;
|
|
secretKey: string;
|
|
region?: string;
|
|
endpoint?: string;
|
|
smsEndpoint?: string;
|
|
};
|
|
export type CTYunCloudConfig = {
|
|
accessKey: string;
|
|
securityKey: string;
|
|
smsEndpoint?: string;
|
|
};
|
|
export type AmapCloudConfig = {
|
|
webApiKey: string;
|
|
};
|
|
export type AliSmsConfig = {
|
|
accessKeyId: string;
|
|
accessKeySecret: string;
|
|
defaultSignName: string;
|
|
apiVersion: string;
|
|
endpoint: string;
|
|
};
|
|
export type CTYunSmsConfig = {
|
|
accessKey: string;
|
|
securityKey: string;
|
|
defaultSignName: string;
|
|
endpoint: string;
|
|
};
|
|
export type TencentSmsConfig = {
|
|
secretId: string;
|
|
secretKey: string;
|
|
smsSdkAppId: string;
|
|
region: string;
|
|
defaultSignName: string;
|
|
endpoint: string;
|
|
};
|
|
export type QrCodeType = 'wechatMpDomainUrl' | 'wechatMpWxaCode' | 'wechatPublic' | 'wechatPublicForMp' | 'webForWechatPublic';
|
|
export type Config = {
|
|
Account?: {
|
|
ali?: AliCloudConfig[];
|
|
tencent?: TencentCloudConfig[];
|
|
qiniu?: QiniuCloudConfig[];
|
|
ctyun?: CTYunCloudConfig[];
|
|
amap?: AmapCloudConfig[];
|
|
local?: LocalCloudConfig[];
|
|
};
|
|
Cos?: {
|
|
qiniu?: QiniuCosConfig;
|
|
ctyun?: CTYunCosConfig;
|
|
aliyun?: ALiYunCosConfig;
|
|
tencent?: TencentYunCosConfig;
|
|
local?: LocalCosConfig;
|
|
};
|
|
Live?: {
|
|
qiniu?: QiniuLiveConfig;
|
|
};
|
|
Map?: {
|
|
amaps?: Array<AMapConfig>;
|
|
mapWorld?: MapWorldConfig;
|
|
};
|
|
Sms?: {
|
|
mockSend?: boolean;
|
|
defaultOrigin?: 'ali' | 'tencent' | 'ctyun';
|
|
ali?: AliSmsConfig[];
|
|
tencent?: TencentSmsConfig[];
|
|
ctyun?: CTYunSmsConfig[];
|
|
};
|
|
App: {
|
|
qrCodeType?: QrCodeType;
|
|
qrCodeApplicationId?: string;
|
|
qrCodePublicForMpId?: string;
|
|
mpShareImageUrl?: string;
|
|
mergeUserDirectly?: boolean;
|
|
tokenRefreshTime?: number;
|
|
tokenExpireTime?: number;
|
|
needUploadIDCardPhoto?: boolean;
|
|
needManualVerification?: boolean;
|
|
};
|
|
Emails?: {
|
|
host: string;
|
|
port: number;
|
|
account: string;
|
|
password: string;
|
|
passwordExpiredAt?: number;
|
|
name?: string;
|
|
}[];
|
|
};
|
|
export type Origin = 'ali' | 'tencent' | 'qiniu' | 'amap' | 'ctyun' | 'local';
|
|
export type Service = 'Map' | 'Cos' | 'Live' | 'Sms' | 'Emails';
|