158 lines
4.4 KiB
TypeScript
158 lines
4.4 KiB
TypeScript
import { ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType";
|
|
import { Q_DateValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, ExprOp, ExpressionKey, JsonFilter } from "oak-domain/lib/types/Demand";
|
|
import { MakeAction as OakMakeAction, EntityShape } from "oak-domain/lib/types/Entity";
|
|
import { GenericAction } from "oak-domain/lib/actions/action";
|
|
import { String, Text } from "oak-domain/lib/types/DataType";
|
|
import { Style } from "oak-general-business/lib/types/Style";
|
|
export type CosOrigin = "qiniu" | "wechat" | "ctyun" | "aliyun" | "tencent" | "local" | "unknown" | "s3";
|
|
export type AppType = "web" | "wechatMp" | "wechatPublic" | "native";
|
|
export type WechatMpConfig = {
|
|
type: "wechatMp";
|
|
appId: string;
|
|
appSecret: string;
|
|
originalId?: string;
|
|
qrCodePrefix?: string;
|
|
getPhone?: boolean;
|
|
server?: {
|
|
url?: string;
|
|
token: string;
|
|
encodingAESKey: string;
|
|
mode: "clear" | "compatible" | "safe";
|
|
dataFormat: "json" | "xml";
|
|
};
|
|
cos?: {
|
|
defaultOrigin: CosOrigin;
|
|
};
|
|
};
|
|
export type WebConfig = {
|
|
type: "web";
|
|
wechat?: {
|
|
appId: string;
|
|
appSecret: string;
|
|
domain?: string;
|
|
enable?: boolean;
|
|
};
|
|
wechatPay?: {
|
|
appId: string;
|
|
appSecret: string;
|
|
};
|
|
location: {
|
|
protocol: "http:" | "https:";
|
|
hostname: string;
|
|
port: string;
|
|
};
|
|
cos?: {
|
|
defaultOrigin: CosOrigin;
|
|
};
|
|
};
|
|
export type WechatPublicConfig = {
|
|
type: "wechatPublic";
|
|
isService: boolean;
|
|
appId: string;
|
|
appSecret: string;
|
|
originalId?: string;
|
|
server?: {
|
|
url?: string;
|
|
token: string;
|
|
encodingAESKey: string;
|
|
mode: "clear" | "compatible" | "safe";
|
|
};
|
|
wechatMp?: {
|
|
appId: string;
|
|
originalId: string;
|
|
};
|
|
location: {
|
|
protocol: "http:" | "https:";
|
|
hostname: string;
|
|
port: string;
|
|
};
|
|
cos?: {
|
|
defaultOrigin: CosOrigin;
|
|
};
|
|
};
|
|
export type NativeConfig = {
|
|
type: "native";
|
|
wechatNative?: {
|
|
appId: string;
|
|
appSecret: string;
|
|
domain?: string;
|
|
};
|
|
location: {
|
|
protocol: "http:" | "https:";
|
|
hostname: string;
|
|
port: string;
|
|
};
|
|
cos?: {
|
|
defaultOrigin: CosOrigin;
|
|
};
|
|
};
|
|
type Versions = string[];
|
|
export type OpSchema = EntityShape & {
|
|
name: String<32>;
|
|
description?: Text | null;
|
|
type: AppType;
|
|
systemId: ForeignKey<"system">;
|
|
config: WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig;
|
|
style?: Style | null;
|
|
dangerousVersions: Versions;
|
|
warningVersions: Versions;
|
|
soaVersion: String<32>;
|
|
domainId?: ForeignKey<"domain"> | null;
|
|
} & {
|
|
[A in ExpressionKey]?: any;
|
|
};
|
|
export type OpAttr = keyof OpSchema;
|
|
export type OpFilter = {
|
|
id: Q_StringValue;
|
|
$$createAt$$: Q_DateValue;
|
|
$$seq$$: Q_NumberValue;
|
|
$$updateAt$$: Q_DateValue;
|
|
name: Q_StringValue;
|
|
description: Q_StringValue;
|
|
type: Q_EnumValue<AppType>;
|
|
systemId: Q_StringValue;
|
|
config: JsonFilter<WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig>;
|
|
style: JsonFilter<Style>;
|
|
dangerousVersions: JsonFilter<Versions>;
|
|
warningVersions: JsonFilter<Versions>;
|
|
soaVersion: Q_StringValue;
|
|
domainId: Q_StringValue;
|
|
} & ExprOp<OpAttr | string>;
|
|
export type OpProjection = {
|
|
"#id"?: NodeId;
|
|
[k: string]: any;
|
|
id?: number;
|
|
$$createAt$$?: number;
|
|
$$updateAt$$?: number;
|
|
$$seq$$?: number;
|
|
name?: number;
|
|
description?: number;
|
|
type?: number;
|
|
systemId?: number;
|
|
config?: number | JsonProjection<WebConfig | WechatMpConfig | WechatPublicConfig | NativeConfig>;
|
|
style?: number | JsonProjection<Style>;
|
|
dangerousVersions?: number | JsonProjection<Versions>;
|
|
warningVersions?: number | JsonProjection<Versions>;
|
|
soaVersion?: number;
|
|
domainId?: number;
|
|
} & Partial<ExprOp<OpAttr | string>>;
|
|
export type OpSortAttr = Partial<{
|
|
id: number;
|
|
$$createAt$$: number;
|
|
$$seq$$: number;
|
|
$$updateAt$$: number;
|
|
name: number;
|
|
description: number;
|
|
type: number;
|
|
systemId: number;
|
|
style: number;
|
|
dangerousVersions: number;
|
|
warningVersions: number;
|
|
soaVersion: number;
|
|
domainId: number;
|
|
[k: string]: any;
|
|
} | ExprOp<OpAttr | string>>;
|
|
export type OpAction = OakMakeAction<GenericAction | string>;
|
|
export type OpUpdateAction = "update" | string;
|
|
export {};
|