import { String, Int, Boolean, Text, Datetime, ForeignKey, JsonProjection } from "oak-domain/lib/types/DataType"; import { Q_DateValue, Q_BooleanValue, Q_NumberValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, JsonFilter } from "oak-domain/lib/types/Demand"; import { OneOf } from "oak-domain/lib/types/Polyfill"; import * as SubQuery from "../_SubQuery"; import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, EntityShape, AggregationResult } from "oak-domain/lib/types/Entity"; import { Action, ParticularAction } from "./Action"; import { QrCodeType } from "../../types/Config"; import * as Relation from "../Relation/Schema"; import * as User from "../User/Schema"; import * as ModiEntity from "../ModiEntity/Schema"; import * as OperEntity from "../OperEntity/Schema"; import * as WechatQrCode from "../WechatQrCode/Schema"; export declare type RedirectToProps = { pathname: string; props?: Record; state?: Record; isTabBar?: boolean; }; export declare type OpSchema = EntityShape & { entity: String<32>; entityId: String<64>; relationId: ForeignKey<"relation">; type: 'grant' | 'transfer'; number: Int<2>; confirmed: Int<2>; remark?: Text | null; granterId: ForeignKey<"user">; granteeId?: ForeignKey<"user"> | null; qrCodeType: QrCodeType; expiresAt?: Datetime | null; expired?: Boolean | null; redirectTo?: RedirectToProps | null; }; export declare type OpAttr = keyof OpSchema; export declare type Schema = EntityShape & { entity: String<32>; entityId: String<64>; relationId: ForeignKey<"relation">; type: 'grant' | 'transfer'; number: Int<2>; confirmed: Int<2>; remark?: Text | null; granterId: ForeignKey<"user">; granteeId?: ForeignKey<"user"> | null; qrCodeType: QrCodeType; expiresAt?: Datetime | null; expired?: Boolean | null; redirectTo?: RedirectToProps | null; relation: Relation.Schema; granter: User.Schema; grantee?: User.Schema | null; modiEntity$entity?: Array; modiEntity$entity$$aggr?: AggregationResult; operEntity$entity?: Array; operEntity$entity$$aggr?: AggregationResult; wechatQrCode$entity?: Array; wechatQrCode$entity$$aggr?: AggregationResult; } & { [A in ExpressionKey]?: any; }; declare type AttrFilter = { id: Q_StringValue | SubQuery.UserEntityGrantIdSubQuery; $$createAt$$: Q_DateValue; $$seq$$: Q_StringValue; $$updateAt$$: Q_DateValue; entity: Q_StringValue; entityId: Q_StringValue; relationId: Q_StringValue | SubQuery.RelationIdSubQuery; relation: Relation.Filter; type: Q_EnumValue<'grant' | 'transfer'>; number: Q_NumberValue; confirmed: Q_NumberValue; remark: Q_StringValue; granterId: Q_StringValue | SubQuery.UserIdSubQuery; granter: User.Filter; granteeId: Q_StringValue | SubQuery.UserIdSubQuery; grantee: User.Filter; qrCodeType: Q_EnumValue; expiresAt: Q_DateValue; expired: Q_BooleanValue; redirectTo: JsonFilter; }; export declare type Filter = MakeFilter>; export declare type Projection = { "#id"?: NodeId; [k: string]: any; id?: number; $$createAt$$?: number; $$updateAt$$?: number; $$seq$$?: number; entity?: number; entityId?: number; relationId?: number; relation?: Relation.Projection; type?: number; number?: number; confirmed?: number; remark?: number; granterId?: number; granter?: User.Projection; granteeId?: number; grantee?: User.Projection; qrCodeType?: number; expiresAt?: number; expired?: number; redirectTo?: number | JsonProjection; modiEntity$entity?: ModiEntity.Selection & { $entity: "modiEntity"; }; modiEntity$entity$$aggr?: ModiEntity.Aggregation & { $entity: "modiEntity"; }; operEntity$entity?: OperEntity.Selection & { $entity: "operEntity"; }; operEntity$entity$$aggr?: OperEntity.Aggregation & { $entity: "operEntity"; }; wechatQrCode$entity?: WechatQrCode.Selection & { $entity: "wechatQrCode"; }; wechatQrCode$entity$$aggr?: WechatQrCode.Aggregation & { $entity: "wechatQrCode"; }; } & Partial>; declare type UserEntityGrantIdProjection = OneOf<{ id: number; }>; declare type RelationIdProjection = OneOf<{ relationId: number; }>; declare type UserIdProjection = OneOf<{ granterId: number; granteeId: number; }>; export declare type SortAttr = { id: number; } | { $$createAt$$: number; } | { $$seq$$: number; } | { $$updateAt$$: number; } | { entity: number; } | { entityId: number; } | { relationId: number; } | { relation: Relation.SortAttr; } | { type: number; } | { number: number; } | { confirmed: number; } | { remark: number; } | { granterId: number; } | { granter: User.SortAttr; } | { granteeId: number; } | { grantee: User.SortAttr; } | { qrCodeType: number; } | { expiresAt: number; } | { expired: number; } | { redirectTo: number; } | { [k: string]: any; } | OneOf>; export declare type SortNode = { $attr: SortAttr; $direction?: "asc" | "desc"; }; export declare type Sorter = SortNode[]; export declare type SelectOperation

= OakSelection<"select", P, Filter, Sorter>; export declare type Selection

= Omit, "action">; export declare type Aggregation = DeduceAggregation; export declare type CreateOperationData = FormCreateData> & (({ relationId?: never; relation: Relation.CreateSingleOperation; } | { relationId: String<64>; relation?: Relation.UpdateOperation; } | { relationId: String<64>; }) & ({ granterId?: never; granter: User.CreateSingleOperation; } | { granterId: String<64>; granter?: User.UpdateOperation; } | { granterId: String<64>; }) & ({ granteeId?: never; grantee?: User.CreateSingleOperation; } | { granteeId: String<64>; grantee?: User.UpdateOperation; } | { granteeId?: String<64>; })) & ({ entity?: string; entityId?: string; [K: string]: any; }) & { modiEntity$entity?: OakOperation<"create", Omit[]> | Array>>; operEntity$entity?: OakOperation<"create", Omit[]> | Array>>; wechatQrCode$entity?: OakOperation, WechatQrCode.Filter> | OakOperation<"create", Omit[]> | Array> | OakOperation, WechatQrCode.Filter>>; }; export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>; export declare type CreateMultipleOperation = OakOperation<"create", Array>; export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation; export declare type UpdateOperationData = FormUpdateData> & (({ relation: Relation.CreateSingleOperation; relationId?: never; } | { relation: Relation.UpdateOperation; relationId?: never; } | { relation: Relation.RemoveOperation; relationId?: never; } | { relation?: never; relationId?: String<64> | null; }) & ({ granter: User.CreateSingleOperation; granterId?: never; } | { granter: User.UpdateOperation; granterId?: never; } | { granter: User.RemoveOperation; granterId?: never; } | { granter?: never; granterId?: String<64> | null; }) & ({ grantee: User.CreateSingleOperation; granteeId?: never; } | { grantee: User.UpdateOperation; granteeId?: never; } | { grantee: User.RemoveOperation; granteeId?: never; } | { grantee?: never; granteeId?: String<64> | null; })) & { [k: string]: any; modiEntity$entity?: OakOperation<"create", Omit[]> | Array>>; operEntity$entity?: OakOperation<"create", Omit[]> | Array>>; wechatQrCode$entity?: WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation | OakOperation<"create", Omit[]> | Array> | WechatQrCode.UpdateOperation | WechatQrCode.RemoveOperation>; }; export declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>; export declare type RemoveOperationData = {} & (({ relation?: Relation.UpdateOperation | Relation.RemoveOperation; }) & ({ granter?: User.UpdateOperation | User.RemoveOperation; }) & ({ grantee?: User.UpdateOperation | User.RemoveOperation; })); export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>; export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation; export declare type RelationIdSubQuery = Selection; export declare type UserIdSubQuery = Selection; export declare type UserEntityGrantIdSubQuery = Selection; export declare type EntityDef = { Schema: Schema; OpSchema: OpSchema; Action: OakMakeAction | string; Selection: Selection; Aggregation: Aggregation; Operation: Operation; Create: CreateOperation; Update: UpdateOperation; Remove: RemoveOperation; CreateSingle: CreateSingleOperation; CreateMulti: CreateMultipleOperation; ParticularAction: ParticularAction; }; export {};