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 { Action, ParticularAction, IState, VisitState } from "./Action"; import { String, Text } from "oak-domain/lib/types/DataType"; import { Weight, Channel } from "oak-general-business/lib/types/Message"; export type Router = { pathname: string; props?: Record; state?: Record; isTabBar?: boolean; }; type MessageRestriction = { systemIds?: string[]; channels?: Array; disableRouter?: { [key: Channel]: boolean; }; }; type Channels = Channel[]; export type OpSchema = EntityShape & { entity: String<32>; entityId: String<64>; userId: ForeignKey<"user">; type: String<64>; weight: Weight; restriction?: MessageRestriction | null; title: String<256>; content: Text; data?: Object | null; router?: Router | null; platformId?: ForeignKey<"platform"> | null; channels?: Channels | null; iState?: IState | null; visitState: VisitState; } & { [A in ExpressionKey]?: any; }; export type OpAttr = keyof OpSchema; export type OpFilter = { id: Q_StringValue; $$createAt$$: Q_DateValue; $$seq$$: Q_NumberValue; $$updateAt$$: Q_DateValue; entity: Q_StringValue; entityId: Q_StringValue; userId: Q_StringValue; type: Q_StringValue; weight: Q_EnumValue; restriction: JsonFilter; title: Q_StringValue; content: Q_StringValue; data: Object; router: JsonFilter; platformId: Q_StringValue; channels: JsonFilter; iState: Q_EnumValue; visitState: Q_EnumValue; } & ExprOp; export type OpProjection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; entity?: number; entityId?: number; userId?: number; type?: number; weight?: number; restriction?: number | JsonProjection; title?: number; content?: number; data?: number | Object; router?: number | JsonProjection; platformId?: number; channels?: number | JsonProjection; iState?: number; visitState?: number; } & Partial>; export type OpSortAttr = Partial<{ id: number; $$createAt$$: number; $$seq$$: number; $$updateAt$$: number; entity: number; entityId: number; userId: number; type: number; weight: number; restriction: number; title: number; content: number; router: number; platformId: number; channels: number; iState: number; visitState: number; [k: string]: any; } | ExprOp>; export type OpAction = OakMakeAction; export type OpUpdateAction = "update" | ParticularAction | string; export {};