mergefromdev
This commit is contained in:
commit
f7c71d9398
|
|
@ -1,7 +1,6 @@
|
|||
import { WebEnv, WechatMpEnv } from 'oak-domain/lib/types/Environment';
|
||||
import { AppType } from '../oak-app-domain/Application/Schema';
|
||||
import { EntityDict } from '../oak-app-domain';
|
||||
import { QiniuUploadInfo } from 'oak-frontend-base';
|
||||
import { Config } from '../types/Config';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
export declare type GeneralAspectDict<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>> = {
|
||||
|
|
@ -41,9 +40,6 @@ export declare type GeneralAspectDict<ED extends EntityDict, Cxt extends Backend
|
|||
id: string;
|
||||
env: WebEnv | WechatMpEnv;
|
||||
}, context: Cxt) => Promise<string>;
|
||||
getUploadInfo: (params: {
|
||||
extraFile: EntityDict['extraFile']['CreateSingle']['data'];
|
||||
}, context: Cxt) => Promise<QiniuUploadInfo>;
|
||||
sendCaptcha: (params: {
|
||||
mobile: string;
|
||||
env: WechatMpEnv | WebEnv;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
import { applicationProjection } from '../types/projection';
|
||||
import { applicationProjection } from '../types/Projection';
|
||||
import { WechatSDK, } from 'oak-external-sdk';
|
||||
export async function getApplication(params, context) {
|
||||
const { type, domain } = params;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
import { EntityDict } from '../oak-app-domain';
|
||||
import { QiniuUploadInfo } from 'oak-frontend-base';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
export declare function getUploadInfo<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
extraFile: EntityDict['extraFile']['CreateSingle']['data'];
|
||||
}, context: Cxt): Promise<QiniuUploadInfo>;
|
||||
export declare function upload<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(params: {
|
||||
extraFile: EntityDict['extraFile']['CreateSingle']['data'];
|
||||
}, context: Cxt): Promise<QiniuUploadInfo>;
|
||||
export declare function getInfoByUrl(params: {
|
||||
url: string;
|
||||
}): Promise<{
|
||||
|
|
|
|||
|
|
@ -1,26 +1,4 @@
|
|||
import { getConfig } from '../utils/getContextConfig';
|
||||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
import { WechatSDK } from 'oak-external-sdk';
|
||||
export async function getUploadInfo(params, context) {
|
||||
const { origin, extra1, filename, objectId, extension, entity, bucket } = params.extraFile;
|
||||
// 构造文件上传所需的key
|
||||
const key = `${entity ? entity + '/' : ''}${objectId}${extension ? '.' + extension : ''}`;
|
||||
assert(origin && origin !== 'unknown');
|
||||
const { instance, config, } = await getConfig(context, 'Cos', origin);
|
||||
assert(origin === 'qiniu');
|
||||
const { uploadHost, domain, bucket: bucket2 } = config;
|
||||
return instance.getUploadInfo(uploadHost, domain, bucket || bucket2, key);
|
||||
}
|
||||
export async function upload(params, context) {
|
||||
const { origin, extra1, filename, objectId, extension, entity, bucket } = params.extraFile;
|
||||
// 构造文件上传所需的key
|
||||
const key = `${entity ? entity + '/' : ''}${objectId}${extension ? '.' + extension : ''}`;
|
||||
assert(origin && origin !== 'unknown');
|
||||
const { instance, config, } = await getConfig(context, 'Cos', origin);
|
||||
assert(origin === 'qiniu');
|
||||
const { uploadHost, domain, bucket: bucket2 } = config;
|
||||
return instance.getUploadInfo(uploadHost, domain, bucket || bucket2, key);
|
||||
}
|
||||
// 请求链接获取标题,发布时间,图片等信息
|
||||
export async function getInfoByUrl(params) {
|
||||
const { url } = params;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { loginByMobile, loginWechat, loginWechatMp, syncUserInfoWechatMp, sendCaptcha, switchTo, refreshWechatPublicUserInfo, getWechatMpUserPhoneNumber, logout, loginByWechat, wakeupParasite } from './token';
|
||||
import { getUploadInfo, getInfoByUrl } from './extraFile';
|
||||
import { getInfoByUrl } from './extraFile';
|
||||
import { getApplication, signatureJsSDK } from './application';
|
||||
import { updateConfig, updateApplicationConfig } from './config';
|
||||
import { mergeUser, getChangePasswordChannels, updateUserPassword } from './user';
|
||||
|
|
@ -16,7 +16,6 @@ declare const aspectDict: {
|
|||
loginWechatMp: typeof loginWechatMp;
|
||||
wakeupParasite: typeof wakeupParasite;
|
||||
syncUserInfoWechatMp: typeof syncUserInfoWechatMp;
|
||||
getUploadInfo: typeof getUploadInfo;
|
||||
sendCaptcha: typeof sendCaptcha;
|
||||
getApplication: typeof getApplication;
|
||||
updateConfig: typeof updateConfig;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { loginByMobile, loginWechat, loginWechatMp, syncUserInfoWechatMp, sendCaptcha, switchTo, refreshWechatPublicUserInfo, getWechatMpUserPhoneNumber, logout, loginByWechat, wakeupParasite, } from './token';
|
||||
import { getUploadInfo, getInfoByUrl } from './extraFile';
|
||||
import { getInfoByUrl } from './extraFile';
|
||||
import { getApplication, signatureJsSDK } from './application';
|
||||
import { updateConfig, updateApplicationConfig } from './config';
|
||||
import { mergeUser, getChangePasswordChannels, updateUserPassword } from './user';
|
||||
|
|
@ -16,7 +16,6 @@ const aspectDict = {
|
|||
loginWechatMp,
|
||||
wakeupParasite,
|
||||
syncUserInfoWechatMp,
|
||||
getUploadInfo,
|
||||
sendCaptcha,
|
||||
getApplication,
|
||||
updateConfig,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import { OakRowInconsistencyException, OakUnloggedInException, OakUserException,
|
|||
import { composeFileUrl, decomposeFileUrl } from '../utils/extraFile';
|
||||
import { OakChangeLoginWayException, OakDistinguishUserException, OakUserDisabledException, } from '../types/Exception';
|
||||
import { encryptPasswordSha1 } from '../utils/password';
|
||||
import { tokenProjection } from '../types/projection';
|
||||
import { tokenProjection } from '../types/Projection';
|
||||
import { sendSms } from '../utils/sms';
|
||||
import { mergeUser } from './user';
|
||||
import { pick } from 'oak-domain/lib/utils/lodash';
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { generateNewId, generateNewIdAsync } from "oak-domain/lib/utils/uuid";
|
||||
import { OakRowInconsistencyException, OakExternalException } from 'oak-domain/lib/types';
|
||||
import { generateNewIdAsync } from "oak-domain/lib/utils/uuid";
|
||||
import { OakRowInconsistencyException, OakUserException, } from 'oak-domain/lib/types';
|
||||
export async function confirmUserEntityGrant(params, context) {
|
||||
const { id, env } = params;
|
||||
const { userId } = context.getToken();
|
||||
|
|
@ -24,7 +24,7 @@ export async function confirmUserEntityGrant(params, context) {
|
|||
const { number, confirmed } = userEntityGrant;
|
||||
if (confirmed >= number) {
|
||||
closeRootMode();
|
||||
throw new OakExternalException(`超出分享上限人数${number}人`);
|
||||
throw new OakUserException(`超出分享上限人数${number}人`);
|
||||
}
|
||||
Object.assign(userEntityGrant, {
|
||||
confirmed: confirmed + 1,
|
||||
|
|
@ -62,10 +62,10 @@ export async function confirmUserEntityGrant(params, context) {
|
|||
else {
|
||||
try {
|
||||
await context.operate('userRelation', {
|
||||
id: generateNewId(),
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'create',
|
||||
data: {
|
||||
id: generateNewId(),
|
||||
id: await generateNewIdAsync(),
|
||||
userId,
|
||||
relationId,
|
||||
entity,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
||||
import { Form, Input, Tabs } from 'antd';
|
||||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { Space, Form, Input, Button, Tabs, ColorPicker } from 'antd';
|
||||
import { ClearOutlined } from '@ant-design/icons';
|
||||
import { set, get } from 'oak-domain/lib/utils/lodash';
|
||||
const Colors = ['primary', 'success', 'error', 'warning', 'info'];
|
||||
function Color(props) {
|
||||
|
|
@ -7,10 +8,13 @@ function Color(props) {
|
|||
;
|
||||
return (_jsx(Form, { children: Colors.map((ele) => (_jsx(Form.Item, { label: ele,
|
||||
// required
|
||||
// name="folder"
|
||||
tooltip: `设置系统【${ele}】颜色`, children: _jsx(_Fragment, { children: _jsx(Input, { onChange: (e) => {
|
||||
setValue(ele, e.target.value);
|
||||
}, value: get(value, ele) }) }) }, ele))) }));
|
||||
tooltip: `设置系统【${ele}】颜色`, children: _jsxs(Space.Compact, { block: true, children: [_jsx(ColorPicker, { onChangeComplete: (color) => {
|
||||
setValue(ele, color.toHexString());
|
||||
}, children: _jsx(Input, { value: get(value, ele), readOnly: true, onChange: (e) => {
|
||||
setValue(ele, e.target.value);
|
||||
} }) }), _jsx(Button, { icon: _jsx(ClearOutlined, {}), onClick: (e) => {
|
||||
setValue(ele, '');
|
||||
} })] }) }, ele))) }));
|
||||
}
|
||||
export default function Render(props) {
|
||||
const { value: styleValue, onChange } = props;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export default OakComponent({
|
|||
data: {
|
||||
// 根据 size 不同,计算的图片显示大小不同
|
||||
itemSizePercentage: '',
|
||||
fileList: {}
|
||||
},
|
||||
wechatMp: {
|
||||
externalClasses: ['oak-class', 'oak-item-class'],
|
||||
|
|
@ -92,6 +93,10 @@ export default OakComponent({
|
|||
},
|
||||
methods: {
|
||||
getUrl(extraFile) {
|
||||
const { fileList } = this.state;
|
||||
if (fileList[extraFile?.id]) {
|
||||
return this.features.extraFile.getUrl(Object.assign({}, extraFile, { extra1: fileList[extraFile?.id] }));
|
||||
}
|
||||
return this.features.extraFile.getUrl(extraFile);
|
||||
},
|
||||
getFileName(extraFile) {
|
||||
|
|
@ -229,6 +234,7 @@ export default OakComponent({
|
|||
const filename = name.substring(0, name.lastIndexOf('.'));
|
||||
assert(entity, '必须传入entity');
|
||||
assert(origin === 'qiniu', '目前只支持七牛上传'); // 目前只支持七牛上传
|
||||
const id = generateNewId();
|
||||
const updateData = {
|
||||
extra1,
|
||||
origin,
|
||||
|
|
@ -241,7 +247,7 @@ export default OakComponent({
|
|||
size,
|
||||
extension,
|
||||
fileType,
|
||||
id: generateNewId(),
|
||||
id,
|
||||
entityId,
|
||||
sort
|
||||
};
|
||||
|
|
@ -254,7 +260,6 @@ export default OakComponent({
|
|||
this.addItem(Object.assign({}, updateData, {
|
||||
extra1: null,
|
||||
}), undefined, async () => {
|
||||
console.log(updateData);
|
||||
await this.features.extraFile.upload(updateData, extra1);
|
||||
});
|
||||
await this.execute();
|
||||
|
|
@ -274,14 +279,12 @@ export default OakComponent({
|
|||
else {
|
||||
this.addItem(Object.assign({}, updateData, {
|
||||
extra1: null,
|
||||
}), async () => {
|
||||
if (updateData.bucket) {
|
||||
// 说明本函数已经执行过了
|
||||
return;
|
||||
}
|
||||
}, async () => {
|
||||
}), undefined, async () => {
|
||||
await this.features.extraFile.upload(updateData, extra1);
|
||||
});
|
||||
this.setState({
|
||||
fileList: Object.assign(this.state.fileList, { [id]: extra1 })
|
||||
});
|
||||
}
|
||||
},
|
||||
async onItemTapped(event) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
|
||||
.container {
|
||||
padding: 10px;
|
||||
}
|
||||
|
|
@ -8,6 +8,5 @@ export default function Render(props: WebComponentProps<EntityDict, 'user', fals
|
|||
label: string;
|
||||
action: string;
|
||||
}>;
|
||||
}, {
|
||||
onClick: (action: string) => void;
|
||||
onActionClick: (action: string) => void;
|
||||
}>): JSX.Element | null;
|
||||
|
|
|
|||
|
|
@ -1,12 +1,11 @@
|
|||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { Button } from 'antd-mobile';
|
||||
import Styles from './web.module.less';
|
||||
import { Button, Space } from 'antd-mobile';
|
||||
import Style from './mobile.module.less';
|
||||
export default function Render(props) {
|
||||
const { actionss } = props.data;
|
||||
const { onClick } = props.methods;
|
||||
const { actionss, onActionClick } = props.data;
|
||||
// icon方案还未最终确定
|
||||
if (actionss) {
|
||||
return (_jsx("div", { className: Styles.container, children: actionss.map(ele => (_jsx("div", { className: "action", children: _jsx(Button, { color: 'primary', fill: 'outline', onClick: () => onClick(ele.action), children: ele.label }) }))) }));
|
||||
return (_jsx(Space, { wrap: true, className: Style.container, children: actionss.map((ele) => (_jsx(Button, { color: "primary", fill: "outline", onClick: () => onActionClick(ele.action), children: ele.label }))) }));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,5 @@
|
|||
.action {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
flex-wrap: wrap;
|
||||
padding: 10;
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
import { WebComponentProps } from "oak-frontend-base";
|
||||
import { EntityDict } from "../../../oak-app-domain";
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'user', false, {
|
||||
actionss: Array<{
|
||||
icon: {
|
||||
name: string;
|
||||
};
|
||||
label: string;
|
||||
action: string;
|
||||
}>;
|
||||
onActionClick: (action: string) => void;
|
||||
}>): JSX.Element | null;
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { Button, Space } from 'antd';
|
||||
export default function Render(props) {
|
||||
const { actionss, onActionClick } = props.data;
|
||||
// icon方案还未最终确定
|
||||
if (actionss) {
|
||||
return (_jsx(Space, { children: actionss.map((ele) => (_jsx(Button, { color: "primary", type: "default", onClick: () => onActionClick(ele.action), children: ele.label }))) }));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
@ -1,19 +1,10 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { Tag, Badge } from 'antd';
|
||||
import { Badge } from 'antd';
|
||||
import dayjs from 'dayjs';
|
||||
import Style from './web.module.less';
|
||||
const MessageType = {
|
||||
adminNotification: '系统通知',
|
||||
conversationMessage: '客服消息',
|
||||
};
|
||||
// success、 processing、error、default、warning
|
||||
const MessageTypeToColor = {
|
||||
adminNotification: 'processing',
|
||||
conversationMessage: 'warning',
|
||||
};
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { id, router, title, type, $$createAt$$, visitState, oakLegalActions = [], onItemClicked, } = data;
|
||||
const { id, router, title, type, $$createAt$$, visitState, oakLegalActions, onItemClicked, } = data;
|
||||
const { navigateTo, execute } = methods;
|
||||
return (_jsxs("div", { className: Style.list, onClick: onItemClicked
|
||||
? () => {
|
||||
|
|
@ -22,8 +13,8 @@ export default function Render(props) {
|
|||
router,
|
||||
});
|
||||
}
|
||||
: undefined, children: [_jsxs("div", { className: Style.list__notify, children: [visitState === 'unvisited' && (_jsx(Badge, { style: { marginRight: 5 }, status: "processing" })), _jsx("div", { className: Style.notify_deadline, children: title }), oakLegalActions.includes('visit') && (_jsx("div", { className: Style.notify_mask, onClick: (event) => {
|
||||
: undefined, children: [_jsxs("div", { className: Style.list__notify, children: [visitState === 'unvisited' && (_jsx(Badge, { style: { marginRight: 5 }, status: "processing" })), _jsx("div", { className: Style.notify_deadline, children: title }), oakLegalActions?.includes('visit') && (_jsx("div", { className: Style.notify_mask, onClick: (event) => {
|
||||
execute('visit', false);
|
||||
event.stopPropagation();
|
||||
}, children: "\u6807\u8BB0\u5DF2\u8BFB" }))] }), _jsxs("div", { className: Style.list__info, children: [_jsx("div", { className: Style.tags, children: _jsx(Tag, { color: MessageTypeToColor[type], children: MessageType[type] }) }), _jsx("div", { className: Style.create_time, children: dayjs($$createAt$$).format('YYYY-MM-DD HH:mm:ss') })] })] }));
|
||||
}, children: "\u6807\u8BB0\u5DF2\u8BFB" }))] }), _jsx("div", { className: Style.list__info, children: _jsx("div", { className: Style.create_time, children: dayjs($$createAt$$).format('YYYY-MM-DD HH:mm:ss') }) })] }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"navigationBarTitleText": "消息"
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import Style from './web.module.less';
|
||||
import MessageCell from '../../../components/message/cell';
|
||||
import Empty from '../../../components/common/empty';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { messages, open, onClose, oakFullpath } = data;
|
||||
const { goDetailById, goMessageList } = methods;
|
||||
return (_jsx("div", { className: Style.container, children: messages?.length > 0 ? (_jsx("div", { children: messages?.map((message, index) => (_jsx(MessageCell, { oakId: message.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${message.id}`
|
||||
: '', onItemClicked: (item) => {
|
||||
const { id } = item;
|
||||
onClose && onClose();
|
||||
goDetailById(id);
|
||||
} }, message.id))) })) : (_jsx("div", { className: Style.noData, children: _jsx(Empty, { description: "\u6682\u65E0\u6D88\u606F", image: Empty.PRESENTED_IMAGE_SIMPLE }) })) }));
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@ import { useState } from 'react';
|
|||
import { Button, Badge, Drawer, Space } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import { BellOutlined } from '@ant-design/icons';
|
||||
import MessageDrawerList from '../../../pages/message/drawerList';
|
||||
import MessageList from '../../../components/message/simpleList';
|
||||
import Style from './web.module.less';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
|
|
@ -23,7 +23,7 @@ export default function Render(props) {
|
|||
goMessageList();
|
||||
}, children: "\u67E5\u770B\u66F4\u591A" }) }), bodyStyle: {
|
||||
padding: 0,
|
||||
}, destroyOnClose: true, children: _jsx(MessageDrawerList, { onClose: () => {
|
||||
}, destroyOnClose: true, children: _jsx(MessageList, { onClose: () => {
|
||||
setOpen(false);
|
||||
}, oakAutoUnmount: true, oakPath: "$my/message-/message/drawerList" }) })] }));
|
||||
}, oakAutoUnmount: true, oakPath: "$my/message-/message/simpleList" }) })] }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { useState, useEffect } from 'react';
|
||||
import { ETheme } from '../../../types/themeState';
|
||||
import { ETheme } from '../../../types/Theme';
|
||||
import useFeatures from '../../../hooks/useFeatures';
|
||||
import RadioColor from './RadioColor';
|
||||
import RadioRect from './RadioRect';
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { OakUnloggedInException, } from 'oak-domain/lib/types/Exception';
|
|||
import { ROOT_TOKEN_ID, ROOT_USER_ID } from '../constants';
|
||||
import { AsyncContext } from 'oak-domain/lib/store/AsyncRowStore';
|
||||
import { generateNewIdAsync } from 'oak-domain/lib/utils/uuid';
|
||||
import { applicationProjection } from '../types/projection';
|
||||
import { applicationProjection } from '../types/Projection';
|
||||
import { getMpUnlimitWxaCode } from '../aspects/wechatQrCode';
|
||||
/**
|
||||
* general数据结构要求的后台上下文
|
||||
|
|
|
|||
|
|
@ -109,7 +109,19 @@ const i18ns = [
|
|||
position: "src/pages/user/manage/detail",
|
||||
data: {
|
||||
"mobile": "手机号",
|
||||
"unset": "未设置"
|
||||
"unset": "未设置",
|
||||
"avatar": "头像"
|
||||
}
|
||||
},
|
||||
{
|
||||
id: "ce120594bf9738e2092b3c7bf4da71e9",
|
||||
namespace: "oak-general-business-p-wechatUser-login",
|
||||
language: "zh-CN",
|
||||
module: "oak-general-business",
|
||||
position: "src/pages/wechatUser/login",
|
||||
data: {
|
||||
"missingCodeParameter": "缺少code参数",
|
||||
"weChatLoginFailed": "微信登录失败"
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,7 +6,9 @@ export const users = [
|
|||
name: 'root',
|
||||
isRoot: true,
|
||||
id: ROOT_USER_ID,
|
||||
}
|
||||
userState: 'shadow',
|
||||
idState: 'unverified',
|
||||
},
|
||||
];
|
||||
export const mobiles = [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { String, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { Schema as System } from './System';
|
||||
import { Schema as Session } from './Session';
|
||||
import { Style } from '../types/Style';
|
||||
export declare type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic';
|
||||
export declare type AppType = 'web' | 'wechatMp' | 'wechatPublic';
|
||||
|
|
@ -57,4 +58,5 @@ export interface Schema extends EntityShape {
|
|||
system: System;
|
||||
config: WebConfig | WechatMpConfig | WechatPublicConfig;
|
||||
style?: Style;
|
||||
sessions?: Session[];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,15 +10,16 @@ const entityDesc = {
|
|||
name: '名称',
|
||||
config: '设置',
|
||||
style: '样式',
|
||||
sessions: '会话',
|
||||
},
|
||||
v: {
|
||||
type: {
|
||||
web: '网站',
|
||||
wechatPublic: '微信公众号',
|
||||
wechatMp: '微信小程序',
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { String, Int, Text, Float, Boolean } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
export interface Schema extends EntityShape {
|
||||
origin: 'qiniu' | 'unknown';
|
||||
origin: 'qiniu' | 'wechat' | 'unknown';
|
||||
type: 'image' | 'video' | 'audio' | 'file';
|
||||
bucket: String<16>;
|
||||
objectId: String<64>;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ const entityDesc = {
|
|||
v: {
|
||||
origin: {
|
||||
qiniu: '七牛云',
|
||||
wechat: '微信',
|
||||
unknown: '未知',
|
||||
},
|
||||
type: {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { String, Text } from 'oak-domain/lib/types/DataType';
|
|||
import { Schema as User } from './User';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { Channel, Weight } from '../types/Message';
|
||||
import { Schema as Platform } from './Platform';
|
||||
declare type Router = {
|
||||
pathname: string;
|
||||
props?: Record<string, any>;
|
||||
|
|
@ -23,5 +24,6 @@ export interface Schema extends EntityShape {
|
|||
content: Text;
|
||||
data?: Object;
|
||||
router?: Router;
|
||||
platform?: Platform;
|
||||
}
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ const entityDesc = {
|
|||
visitState: '访问状态',
|
||||
router: '目标路由',
|
||||
data: '透传数据',
|
||||
platform: '平台',
|
||||
},
|
||||
action: {
|
||||
succeed: '成功',
|
||||
|
|
@ -51,6 +52,6 @@ const entityDesc = {
|
|||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -7,6 +7,6 @@ const entityDesc = {
|
|||
type: '类型',
|
||||
},
|
||||
},
|
||||
}
|
||||
},
|
||||
};
|
||||
export {};
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
import { String } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
export interface Schema extends EntityShape {
|
||||
entity: String<32>;
|
||||
entityId: String<64>;
|
||||
}
|
||||
export declare type Relation = 'owner';
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
;
|
||||
const entityDesc = {
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '会话',
|
||||
attr: {
|
||||
entity: '关联对象',
|
||||
entityId: '关联对象id',
|
||||
},
|
||||
r: {
|
||||
owner: '所有者',
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import { String, Datetime, Boolean, Text } from 'oak-domain/lib/types/DataType';
|
||||
import { EntityShape } from 'oak-domain/lib/types/Entity';
|
||||
import { Schema as Session } from './Session';
|
||||
import { Schema as User } from './User';
|
||||
import { Schema as WechatUser } from './WechatUser';
|
||||
import { Schema as Application } from './Application';
|
||||
import { Schema as ExtraFile } from './ExtraFile';
|
||||
declare type Type = 'text' | 'image' | 'audio' | 'video' | 'news';
|
||||
export interface Schema extends EntityShape {
|
||||
application: Application;
|
||||
session: Session;
|
||||
user?: User;
|
||||
wechatUser?: WechatUser;
|
||||
createTime?: Datetime;
|
||||
type: Type;
|
||||
text?: Text;
|
||||
files?: ExtraFile[];
|
||||
news?: String<128>;
|
||||
aaoe?: Boolean;
|
||||
}
|
||||
export {};
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
;
|
||||
const entityDesc = {
|
||||
locales: {
|
||||
zh_CN: {
|
||||
name: '消息',
|
||||
attr: {
|
||||
application: '应用',
|
||||
session: '会话',
|
||||
user: '用户',
|
||||
wechatUser: '微信用户',
|
||||
createTime: '发送时间',
|
||||
type: '消息类型',
|
||||
text: '文字内容',
|
||||
files: '文件',
|
||||
news: '文章',
|
||||
aaoe: '作为实体的发起者',
|
||||
},
|
||||
v: {
|
||||
type: {
|
||||
text: '文字',
|
||||
image: '图片',
|
||||
audio: '音频',
|
||||
video: '视频',
|
||||
news: '图文',
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
export {};
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
"use strict";
|
||||
// import { ExceptionHandlerDict } from "oak-frontend-base/es/types/ExceptionHandler";
|
||||
// import { OakUnloggedInException } from "oak-domain/lib/types/Exception";
|
||||
// import { EntityDict } from './oak-app-domain';
|
||||
// import { GeneralFeatures } from './features/index';
|
||||
// import { OakTokenExpiredException } from "./types/Exception";
|
||||
// import { BRC, FRC, FrcAspectDict } from './types/RuntimeCxt';
|
||||
// export const handlerDict: ExceptionHandlerDict<
|
||||
// EntityDict,
|
||||
// BRC,
|
||||
// FRC,
|
||||
// FrcAspectDict,
|
||||
// GeneralFeatures<EntityDict, BRC, FRC, FrcAspectDict>> = {
|
||||
// [OakUnloggedInException.name]: async (features) => {
|
||||
// await features.token.logout();
|
||||
// features.navigator.navigateTo(
|
||||
// {
|
||||
// url: '/mobile/login',
|
||||
// },
|
||||
// undefined,
|
||||
// true
|
||||
// );
|
||||
// },
|
||||
// [OakTokenExpiredException.name]: async (features) => {
|
||||
// await features.token.logout();
|
||||
// features.navigator.navigateTo(
|
||||
// {
|
||||
// url: '/mobile/login',
|
||||
// },
|
||||
// undefined,
|
||||
// true
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
|
@ -2,7 +2,7 @@ import { LOCAL_STORAGE_KEYS } from '../config/constants';
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
import { assert } from 'oak-domain/lib/utils/assert';
|
||||
import { merge } from 'oak-domain/lib/utils/lodash';
|
||||
import { applicationProjection } from '../types/projection';
|
||||
import { applicationProjection } from '../types/Projection';
|
||||
export class Application extends Feature {
|
||||
type;
|
||||
domain; //域名
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@ export declare class ExtraFile<ED extends EntityDict, Cxt extends BackendRuntime
|
|||
url: string;
|
||||
bucket: ED["extraFile"]["Schema"]["bucket"] | undefined;
|
||||
}>;
|
||||
upload(extraFile: EntityDict['extraFile']['CreateSingle']['data'], file: string | File): Promise<Partial<ED["extraFile"]["Schema"]>>;
|
||||
upload(extraFile: EntityDict['extraFile']['CreateSingle']['data'], file: string | File): Promise<Partial<ED["extraFile"]["Schema"]> & {
|
||||
uploadState: string;
|
||||
}>;
|
||||
getUrl(extraFile?: EntityDict['extraFile']['OpSchema'] | EntityDict['extraFile']['Schema'] | null, style?: string): string;
|
||||
/**
|
||||
* 使用该方法,要在使用完url时,通过URL.revokeObjectURL释放缓存
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export class ExtraFile extends Feature {
|
|||
application?.system?.platform?.config;
|
||||
const { bucket } = result;
|
||||
return {
|
||||
url: composeFileUrl(Object.assign({}, extraFile, { extra1: null }), config),
|
||||
url: this.getUrl(Object.assign({}, extraFile, { extra1: null })),
|
||||
bucket,
|
||||
};
|
||||
}
|
||||
|
|
@ -69,7 +69,6 @@ export class ExtraFile extends Feature {
|
|||
id,
|
||||
},
|
||||
});
|
||||
console.log(id, extraFileData);
|
||||
const up = new Upload();
|
||||
try {
|
||||
const uploadInfo = UploaderDict[origin].upload(extraFileData, up.uploadFile, file);
|
||||
|
|
@ -83,7 +82,7 @@ export class ExtraFile extends Feature {
|
|||
},
|
||||
id: generateNewId(),
|
||||
});
|
||||
return extraFileData;
|
||||
return Object.assign(extraFileData, { uploadState: 'success' });
|
||||
}
|
||||
catch (err) {
|
||||
await this.cache.operate('extraFile', {
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { LocalStorage } from 'oak-frontend-base/es/features/localStorage';
|
|||
import AspectDict from '../aspects/AspectDict';
|
||||
import { BackendRuntimeContext } from '../context/BackendRuntimeContext';
|
||||
import { FrontendRuntimeContext } from '../context/FrontendRuntimeContext';
|
||||
import { ETheme, IThemeState } from '../types/themeState';
|
||||
import { ETheme, IThemeState } from '../types/Theme';
|
||||
export default class Theme<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>, FrontCxt extends FrontendRuntimeContext<ED, Cxt, AD>, AD extends AspectDict<ED, Cxt> & CommonAspectDict<ED, Cxt>> extends Feature {
|
||||
private cache;
|
||||
private themeState;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { LOCAL_STORAGE_KEYS } from '../config/constants';
|
||||
import { Feature } from 'oak-frontend-base';
|
||||
import { ETheme } from '../types/themeState';
|
||||
import { ETheme } from '../types/Theme';
|
||||
const defaultTheme = ETheme.light;
|
||||
const initialThemeState = {
|
||||
setting: false,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { Feature } from 'oak-frontend-base';
|
||||
import { OakRowInconsistencyException, OakUnloggedInException, OakUserUnpermittedException, } from 'oak-domain/lib/types/Exception';
|
||||
import { tokenProjection } from '../types/projection';
|
||||
import { tokenProjection } from '../types/Projection';
|
||||
import { OakUserInfoLoadingException } from '../types/Exception';
|
||||
import { LOCAL_STORAGE_KEYS } from '../config/constants';
|
||||
export class Token extends Feature {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
// export * from './exceptionHandlers';
|
||||
import { registerMessageNotificationConverters } from './triggers/message';
|
||||
import { registerWeChatPublicEventCallback } from './endpoints';
|
||||
export { registerMessageNotificationConverters, registerWeChatPublicEventCallback, };
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import { AsyncRowStore } from 'oak-domain/lib/store/AsyncRowStore';
|
|||
import { BackendRuntimeContext } from './context/BackendRuntimeContext';
|
||||
import { FrontendRuntimeContext } from './context/FrontendRuntimeContext';
|
||||
import { GAD, GFD } from './types/Page';
|
||||
import GeneralAspectDict from './aspects/AspectDict';
|
||||
import type GeneralAspectDict from './aspects/AspectDict';
|
||||
import { AppType } from './oak-app-domain/Application/Schema';
|
||||
import { InitializeOptions } from 'oak-frontend-base';
|
||||
export declare function initialize<ED extends EntityDict & BaseEntityDict, Cxt extends BackendRuntimeContext<ED>, AD extends Record<string, Aspect<ED, Cxt>>, FrontCxt extends FrontendRuntimeContext<ED, Cxt, AD & GAD<ED, Cxt>>>(type: AppType, domain: string, storageSchema: StorageSchema<ED>, frontendContextBuilder: () => (store: CacheStore<ED, FrontCxt>) => FrontCxt, backendContextBuilder: (contextStr?: string) => (store: AsyncRowStore<ED, Cxt>) => Promise<Cxt>, aspectDict: AD, triggers: Array<Trigger<ED, keyof ED, Cxt>>, checkers: Array<Checker<ED, keyof ED, FrontCxt | Cxt>>, watchers: Array<Watcher<ED, keyof ED, Cxt>>, timers: Array<Timer<ED, Cxt>>, startRoutines: Array<Routine<ED, Cxt>>, initialData: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { ActionDefDict as generalActionDefDict } from './oak-app-domain';
|
||||
import { intersection } from 'oak-domain/lib/utils/lodash';
|
||||
import { initialize as initDev } from 'oak-frontend-base/es/initialize-dev';
|
||||
import { intersection } from 'oak-domain/lib/utils/lodash';
|
||||
import generalWatchers from './watchers';
|
||||
import generalCheckers from './checkers';
|
||||
import generalTriggers from './triggers';
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { initialize as initProd } from 'oak-frontend-base/es/initialize-prod';
|
||||
import { ActionDefDict as generalActionDefDict } from './oak-app-domain';
|
||||
import { intersection } from 'oak-domain/lib/utils/lodash';
|
||||
import { initialize as initProd } from 'oak-frontend-base/es/initialize-prod';
|
||||
import generalCheckers from './checkers';
|
||||
import { initialize as initGeneralFeatures } from './features';
|
||||
import { rewriteSelection, rewriteOperation } from './utils/selectionRewriter';
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ import { Style } from "../../types/Style";
|
|||
import * as System from "../System/Schema";
|
||||
import * as MessageTypeTemplateId from "../MessageTypeTemplateId/Schema";
|
||||
import * as Notification from "../Notification/Schema";
|
||||
import * as SessionMessage from "../SessionMessage/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
import * as WechatPublicTag from "../WechatPublicTag/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as Session from "../Session/Schema";
|
||||
export declare type Passport = 'email' | 'mobile' | 'wechat' | 'wechatPublic';
|
||||
export declare type AppType = 'web' | 'wechatMp' | 'wechatPublic';
|
||||
export declare type WechatMpConfig = {
|
||||
|
|
@ -82,6 +84,8 @@ export declare type Schema = EntityShape & {
|
|||
messageTypeTemplateId$application$$aggr?: AggregationResult<MessageTypeTemplateId.Schema>;
|
||||
notification$application?: Array<Notification.Schema>;
|
||||
notification$application$$aggr?: AggregationResult<Notification.Schema>;
|
||||
sessionMessage$application?: Array<SessionMessage.Schema>;
|
||||
sessionMessage$application$$aggr?: AggregationResult<SessionMessage.Schema>;
|
||||
token$application?: Array<Token.Schema>;
|
||||
token$application$$aggr?: AggregationResult<Token.Schema>;
|
||||
wechatPublicTag$application?: Array<WechatPublicTag.Schema>;
|
||||
|
|
@ -90,6 +94,8 @@ export declare type Schema = EntityShape & {
|
|||
wechatQrCode$application$$aggr?: AggregationResult<WechatQrCode.Schema>;
|
||||
wechatUser$application?: Array<WechatUser.Schema>;
|
||||
wechatUser$application$$aggr?: AggregationResult<WechatUser.Schema>;
|
||||
session$entity?: Array<Session.Schema>;
|
||||
session$entity$$aggr?: AggregationResult<Session.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
|
|
@ -107,10 +113,12 @@ declare type AttrFilter = {
|
|||
style: JsonFilter<Style>;
|
||||
messageTypeTemplateId$application: MessageTypeTemplateId.Filter & SubQueryPredicateMetadata;
|
||||
notification$application: Notification.Filter & SubQueryPredicateMetadata;
|
||||
sessionMessage$application: SessionMessage.Filter & SubQueryPredicateMetadata;
|
||||
token$application: Token.Filter & SubQueryPredicateMetadata;
|
||||
wechatPublicTag$application: WechatPublicTag.Filter & SubQueryPredicateMetadata;
|
||||
wechatQrCode$application: WechatQrCode.Filter & SubQueryPredicateMetadata;
|
||||
wechatUser$application: WechatUser.Filter & SubQueryPredicateMetadata;
|
||||
session$entity: Session.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare type Projection = {
|
||||
|
|
@ -139,6 +147,12 @@ export declare type Projection = {
|
|||
notification$application$$aggr?: Notification.Aggregation & {
|
||||
$entity: "notification";
|
||||
};
|
||||
sessionMessage$application?: SessionMessage.Selection & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
sessionMessage$application$$aggr?: SessionMessage.Aggregation & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
token$application?: Token.Selection & {
|
||||
$entity: "token";
|
||||
};
|
||||
|
|
@ -163,6 +177,12 @@ export declare type Projection = {
|
|||
wechatUser$application$$aggr?: WechatUser.Aggregation & {
|
||||
$entity: "wechatUser";
|
||||
};
|
||||
session$entity?: Session.Selection & {
|
||||
$entity: "session";
|
||||
};
|
||||
session$entity$$aggr?: Session.Aggregation & {
|
||||
$entity: "session";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
declare type ApplicationIdProjection = OneOf<{
|
||||
id: number;
|
||||
|
|
@ -212,10 +232,12 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "systemI
|
|||
})) & {
|
||||
messageTypeTemplateId$application?: OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">>>;
|
||||
notification$application?: OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">> | OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">>>;
|
||||
sessionMessage$application?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
session$entity?: OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">> | OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
|
|
@ -236,10 +258,12 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "systemI
|
|||
[k: string]: any;
|
||||
messageTypeTemplateId$application?: OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.RemoveOperation["action"], Omit<MessageTypeTemplateId.RemoveOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<MessageTypeTemplateId.CreateOperationData, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.UpdateOperation["action"], Omit<MessageTypeTemplateId.UpdateOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">> | OakOperation<MessageTypeTemplateId.RemoveOperation["action"], Omit<MessageTypeTemplateId.RemoveOperationData, "application" | "applicationId">, Omit<MessageTypeTemplateId.Filter, "application" | "applicationId">>>;
|
||||
notification$application?: OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<Notification.RemoveOperation["action"], Omit<Notification.RemoveOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Notification.CreateOperationData, "application" | "applicationId">> | OakOperation<Notification.UpdateOperation["action"], Omit<Notification.UpdateOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">> | OakOperation<Notification.RemoveOperation["action"], Omit<Notification.RemoveOperationData, "application" | "applicationId">, Omit<Notification.Filter, "application" | "applicationId">>>;
|
||||
sessionMessage$application?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "application" | "applicationId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "application" | "applicationId">, Omit<SessionMessage.Filter, "application" | "applicationId">>>;
|
||||
token$application?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "application" | "applicationId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "application" | "applicationId">, Omit<Token.Filter, "application" | "applicationId">>>;
|
||||
wechatPublicTag$application?: OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatPublicTag.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatPublicTag.UpdateOperation["action"], Omit<WechatPublicTag.UpdateOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">> | OakOperation<WechatPublicTag.RemoveOperation["action"], Omit<WechatPublicTag.RemoveOperationData, "application" | "applicationId">, Omit<WechatPublicTag.Filter, "application" | "applicationId">>>;
|
||||
wechatQrCode$application?: OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatQrCode.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatQrCode.UpdateOperation["action"], Omit<WechatQrCode.UpdateOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">> | OakOperation<WechatQrCode.RemoveOperation["action"], Omit<WechatQrCode.RemoveOperationData, "application" | "applicationId">, Omit<WechatQrCode.Filter, "application" | "applicationId">>>;
|
||||
wechatUser$application?: OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">[]> | Array<OakOperation<"create", Omit<WechatUser.CreateOperationData, "application" | "applicationId">> | OakOperation<WechatUser.UpdateOperation["action"], Omit<WechatUser.UpdateOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">> | OakOperation<WechatUser.RemoveOperation["action"], Omit<WechatUser.RemoveOperationData, "application" | "applicationId">, Omit<WechatUser.Filter, "application" | "applicationId">>>;
|
||||
session$entity?: OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<Session.RemoveOperation["action"], Omit<Session.RemoveOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Session.CreateOperationData, "entity" | "entityId">> | OakOperation<Session.UpdateOperation["action"], Omit<Session.UpdateOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">> | OakOperation<Session.RemoveOperation["action"], Omit<Session.RemoveOperationData, "entity" | "entityId">, Omit<Session.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{ "name": "应用", "attr": { "description": "描述", "type": "类型", "system": "系统", "name": "名称", "config": "设置", "style": "样式" }, "v": { "type": { "web": "网站", "wechatPublic": "微信公众号", "wechatMp": "微信小程序" } } }
|
||||
{ "name": "应用", "attr": { "description": "描述", "type": "类型", "system": "系统", "name": "名称", "config": "设置", "style": "样式", "sessions": "会话" }, "v": { "type": { "web": "网站", "wechatPublic": "微信公众号", "wechatMp": "微信小程序" } } }
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ import { EntityDef as Mobile } from "./Mobile/Schema";
|
|||
import { EntityDef as Notification } from "./Notification/Schema";
|
||||
import { EntityDef as Parasite } from "./Parasite/Schema";
|
||||
import { EntityDef as Platform } from "./Platform/Schema";
|
||||
import { EntityDef as Session } from "./Session/Schema";
|
||||
import { EntityDef as SessionMessage } from "./SessionMessage/Schema";
|
||||
import { EntityDef as Station } from "./Station/Schema";
|
||||
import { EntityDef as Subscription } from "./Subscription/Schema";
|
||||
import { EntityDef as Subway } from "./Subway/Schema";
|
||||
|
|
@ -71,6 +73,8 @@ export declare type EntityDict = {
|
|||
notification: Notification;
|
||||
parasite: Parasite;
|
||||
platform: Platform;
|
||||
session: Session;
|
||||
sessionMessage: SessionMessage;
|
||||
station: Station;
|
||||
subscription: Subscription;
|
||||
subway: Subway;
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@ import { String, Int, Text, Float, Boolean } from "oak-domain/lib/types/DataType
|
|||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import * as Article from "../Article/Schema";
|
||||
import * as ArticleMenu from "../ArticleMenu/Schema";
|
||||
import * as SessionMessage from "../SessionMessage/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
origin: 'qiniu' | 'unknown';
|
||||
origin: 'qiniu' | 'wechat' | 'unknown';
|
||||
type: 'image' | 'video' | 'audio' | 'file';
|
||||
bucket: String<16>;
|
||||
objectId: String<64>;
|
||||
|
|
@ -17,7 +18,7 @@ export declare type OpSchema = EntityShape & {
|
|||
tag2?: String<32> | null;
|
||||
filename: String<256>;
|
||||
md5?: Text | null;
|
||||
entity: "article" | "articleMenu" | "user" | string;
|
||||
entity: "article" | "articleMenu" | "sessionMessage" | "user" | string;
|
||||
entityId: String<64>;
|
||||
extra1?: Text | null;
|
||||
extension?: String<16> | null;
|
||||
|
|
@ -30,7 +31,7 @@ export declare type OpSchema = EntityShape & {
|
|||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
origin: 'qiniu' | 'unknown';
|
||||
origin: 'qiniu' | 'wechat' | 'unknown';
|
||||
type: 'image' | 'video' | 'audio' | 'file';
|
||||
bucket: String<16>;
|
||||
objectId: String<64>;
|
||||
|
|
@ -38,7 +39,7 @@ export declare type Schema = EntityShape & {
|
|||
tag2?: String<32> | null;
|
||||
filename: String<256>;
|
||||
md5?: Text | null;
|
||||
entity: "article" | "articleMenu" | "user" | string;
|
||||
entity: "article" | "articleMenu" | "sessionMessage" | "user" | string;
|
||||
entityId: String<64>;
|
||||
extra1?: Text | null;
|
||||
extension?: String<16> | null;
|
||||
|
|
@ -50,6 +51,7 @@ export declare type Schema = EntityShape & {
|
|||
uploadMeta?: Object | null;
|
||||
article?: Article.Schema;
|
||||
articleMenu?: ArticleMenu.Schema;
|
||||
sessionMessage?: SessionMessage.Schema;
|
||||
user?: User.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
|
|
@ -59,7 +61,7 @@ declare type AttrFilter = {
|
|||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
origin: Q_EnumValue<'qiniu' | 'unknown'>;
|
||||
origin: Q_EnumValue<'qiniu' | 'wechat' | 'unknown'>;
|
||||
type: Q_EnumValue<'image' | 'video' | 'audio' | 'file'>;
|
||||
bucket: Q_StringValue;
|
||||
objectId: Q_StringValue;
|
||||
|
|
@ -67,7 +69,7 @@ declare type AttrFilter = {
|
|||
tag2: Q_StringValue;
|
||||
filename: Q_StringValue;
|
||||
md5: Q_StringValue;
|
||||
entity: Q_EnumValue<"article" | "articleMenu" | "user" | string>;
|
||||
entity: Q_EnumValue<"article" | "articleMenu" | "sessionMessage" | "user" | string>;
|
||||
entityId: Q_StringValue;
|
||||
extra1: Q_StringValue;
|
||||
extension: Q_StringValue;
|
||||
|
|
@ -79,6 +81,7 @@ declare type AttrFilter = {
|
|||
uploadMeta: Object;
|
||||
article: Article.Filter;
|
||||
articleMenu: ArticleMenu.Filter;
|
||||
sessionMessage: SessionMessage.Filter;
|
||||
user: User.Filter;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
|
|
@ -109,6 +112,7 @@ export declare type Projection = {
|
|||
uploadMeta?: number | Object;
|
||||
article?: Article.Projection;
|
||||
articleMenu?: ArticleMenu.Projection;
|
||||
sessionMessage?: SessionMessage.Projection;
|
||||
user?: User.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
declare type ExtraFileIdProjection = OneOf<{
|
||||
|
|
@ -120,6 +124,9 @@ declare type ArticleIdProjection = OneOf<{
|
|||
declare type ArticleMenuIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
declare type SessionMessageIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
declare type UserIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
|
|
@ -169,6 +176,8 @@ export declare type SortAttr = {
|
|||
article: Article.SortAttr;
|
||||
} | {
|
||||
articleMenu: ArticleMenu.SortAttr;
|
||||
} | {
|
||||
sessionMessage: SessionMessage.SortAttr;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
|
|
@ -204,6 +213,17 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
} | {
|
||||
entity: "articleMenu";
|
||||
entityId: ForeignKey<"ArticleMenu">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
sessionMessage: SessionMessage.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "sessionMessage";
|
||||
entityId: ForeignKey<"SessionMessage">;
|
||||
sessionMessage: SessionMessage.UpdateOperation;
|
||||
} | {
|
||||
entity: "sessionMessage";
|
||||
entityId: ForeignKey<"SessionMessage">;
|
||||
} | {
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
|
|
@ -231,13 +251,17 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity"
|
|||
articleMenu?: ArticleMenu.CreateSingleOperation | ArticleMenu.UpdateOperation | ArticleMenu.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
sessionMessage?: SessionMessage.CreateSingleOperation | SessionMessage.UpdateOperation | SessionMessage.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
user?: User.CreateSingleOperation | User.UpdateOperation | User.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("article" | "articleMenu" | "user" | string) | null;
|
||||
entityId?: ForeignKey<"Article" | "ArticleMenu" | "User"> | null;
|
||||
entity?: ("article" | "articleMenu" | "sessionMessage" | "user" | string) | null;
|
||||
entityId?: ForeignKey<"Article" | "ArticleMenu" | "SessionMessage" | "User"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
|
|
@ -246,6 +270,8 @@ export declare type RemoveOperationData = {} & ({
|
|||
article?: Article.UpdateOperation | Article.RemoveOperation;
|
||||
} | {
|
||||
articleMenu?: ArticleMenu.UpdateOperation | ArticleMenu.RemoveOperation;
|
||||
} | {
|
||||
sessionMessage?: SessionMessage.UpdateOperation | SessionMessage.RemoveOperation;
|
||||
} | {
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
} | {
|
||||
|
|
@ -255,6 +281,7 @@ export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData
|
|||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ArticleIdSubQuery = Selection<ArticleIdProjection>;
|
||||
export declare type ArticleMenuIdSubQuery = Selection<ArticleMenuIdProjection>;
|
||||
export declare type SessionMessageIdSubQuery = Selection<SessionMessageIdProjection>;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type ExtraFileIdSubQuery = Selection<ExtraFileIdProjection>;
|
||||
export declare type EntityDef = {
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export const desc = {
|
|||
origin: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["qiniu", "unknown"]
|
||||
enumeration: ["qiniu", "wechat", "unknown"]
|
||||
},
|
||||
type: {
|
||||
notNull: true,
|
||||
|
|
@ -53,7 +53,7 @@ export const desc = {
|
|||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["article", "articleMenu", "user"]
|
||||
ref: ["article", "articleMenu", "sessionMessage", "user"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问", "uploadState": "上传状态", "uploadMeta": "上传需要的metadata" }, "v": { "origin": { "qiniu": "七牛云", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" }, "uploadState": { "success": "上传成功", "failed": "上传失败", "uploading": "上传中" } } }
|
||||
{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问", "uploadState": "上传状态", "uploadMeta": "上传需要的metadata" }, "v": { "origin": { "qiniu": "七牛云", "wechat": "微信", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" }, "uploadState": { "success": "上传成功", "failed": "上传失败", "uploading": "上传中" } } }
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { String, Text } from "oak-domain/lib/types/DataType";
|
|||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Channel, Weight } from "../../types/Message";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Platform from "../Platform/Schema";
|
||||
import * as MessageSystem from "../MessageSystem/Schema";
|
||||
declare type Router = {
|
||||
pathname: string;
|
||||
|
|
@ -29,6 +30,7 @@ export declare type OpSchema = EntityShape & {
|
|||
content: Text;
|
||||
data?: Object | null;
|
||||
router?: Router | null;
|
||||
platformId?: ForeignKey<"platform"> | null;
|
||||
iState?: IState | null;
|
||||
visitState?: VisitState | null;
|
||||
};
|
||||
|
|
@ -44,9 +46,11 @@ export declare type Schema = EntityShape & {
|
|||
content: Text;
|
||||
data?: Object | null;
|
||||
router?: Router | null;
|
||||
platformId?: ForeignKey<"platform"> | null;
|
||||
iState?: IState | null;
|
||||
visitState?: VisitState | null;
|
||||
user: User.Schema;
|
||||
platform?: Platform.Schema | null;
|
||||
messageSystem$message?: Array<MessageSystem.Schema>;
|
||||
messageSystem$message$$aggr?: AggregationResult<MessageSystem.Schema>;
|
||||
} & {
|
||||
|
|
@ -68,6 +72,8 @@ declare type AttrFilter = {
|
|||
content: Q_StringValue;
|
||||
data: Object;
|
||||
router: JsonFilter<Router>;
|
||||
platformId: Q_StringValue;
|
||||
platform: Platform.Filter;
|
||||
iState: Q_EnumValue<IState>;
|
||||
visitState: Q_EnumValue<VisitState>;
|
||||
messageSystem$message: MessageSystem.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -91,6 +97,8 @@ export declare type Projection = {
|
|||
content?: number;
|
||||
data?: number | Object;
|
||||
router?: number | JsonProjection<Router>;
|
||||
platformId?: number;
|
||||
platform?: Platform.Projection;
|
||||
iState?: number;
|
||||
visitState?: number;
|
||||
messageSystem$message?: MessageSystem.Selection & {
|
||||
|
|
@ -106,6 +114,9 @@ declare type MessageIdProjection = OneOf<{
|
|||
declare type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
declare type PlatformIdProjection = OneOf<{
|
||||
platformId: number;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -134,6 +145,10 @@ export declare type SortAttr = {
|
|||
content: number;
|
||||
} | {
|
||||
router: number;
|
||||
} | {
|
||||
platformId: number;
|
||||
} | {
|
||||
platform: Platform.SortAttr;
|
||||
} | {
|
||||
iState: number;
|
||||
} | {
|
||||
|
|
@ -149,7 +164,7 @@ export declare type Sorter = SortNode[];
|
|||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "userId">> & (({
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId" | "userId" | "platformId">> & (({
|
||||
userId?: never;
|
||||
user: User.CreateSingleOperation;
|
||||
} | {
|
||||
|
|
@ -157,6 +172,14 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
}) & ({
|
||||
platformId?: never;
|
||||
platform?: Platform.CreateSingleOperation;
|
||||
} | {
|
||||
platformId: ForeignKey<"platform">;
|
||||
platform?: Platform.UpdateOperation;
|
||||
} | {
|
||||
platformId?: ForeignKey<"platform">;
|
||||
})) & ({
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
|
|
@ -167,7 +190,7 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId">> & (({
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId" | "platformId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
|
|
@ -179,6 +202,18 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId"
|
|||
} | {
|
||||
user?: never;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
}) & ({
|
||||
platform: Platform.CreateSingleOperation;
|
||||
platformId?: never;
|
||||
} | {
|
||||
platform: Platform.UpdateOperation;
|
||||
platformId?: never;
|
||||
} | {
|
||||
platform: Platform.RemoveOperation;
|
||||
platformId?: never;
|
||||
} | {
|
||||
platform?: never;
|
||||
platformId?: ForeignKey<"platform"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
messageSystem$message?: OakOperation<MessageSystem.UpdateOperation["action"], Omit<MessageSystem.UpdateOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">> | OakOperation<MessageSystem.RemoveOperation["action"], Omit<MessageSystem.RemoveOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">> | OakOperation<"create", Omit<MessageSystem.CreateOperationData, "message" | "messageId">[]> | Array<OakOperation<"create", Omit<MessageSystem.CreateOperationData, "message" | "messageId">> | OakOperation<MessageSystem.UpdateOperation["action"], Omit<MessageSystem.UpdateOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">> | OakOperation<MessageSystem.RemoveOperation["action"], Omit<MessageSystem.RemoveOperationData, "message" | "messageId">, Omit<MessageSystem.Filter, "message" | "messageId">>>;
|
||||
|
|
@ -186,10 +221,13 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId"
|
|||
export declare type UpdateOperation = OakOperation<"update" | ParticularAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}) & ({
|
||||
platform?: Platform.UpdateOperation | Platform.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type PlatformIdSubQuery = Selection<PlatformIdProjection>;
|
||||
export declare type MessageIdSubQuery = Selection<MessageIdProjection>;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -52,6 +52,10 @@ export const desc = {
|
|||
router: {
|
||||
type: "object"
|
||||
},
|
||||
platformId: {
|
||||
type: "ref",
|
||||
ref: "platform"
|
||||
},
|
||||
iState: {
|
||||
type: "enum",
|
||||
enumeration: ["sending", "success", "failure"]
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
{ "name": "消息", "attr": { "entity": "关联对象", "entityId": "关联对象ID", "restriction": "限制", "title": "标题", "content": "内容", "user": "关联用户", "type": "消息类型", "weight": "优先级", "iState": "发送状态", "visitState": "访问状态", "router": "目标路由", "data": "透传数据" }, "action": { "succeed": "成功", "fail": "失败", "visit": "阅读" }, "v": { "iState": { "sending": "发送中", "success": "发送成功", "failure": "发送失败" }, "visitState": { "unvisited": "未读", "visited": "已读" }, "weight": { "high": "高", "medium": "中", "low": "低" } } }
|
||||
{ "name": "消息", "attr": { "entity": "关联对象", "entityId": "关联对象ID", "restriction": "限制", "title": "标题", "content": "内容", "user": "关联用户", "type": "消息类型", "weight": "优先级", "iState": "发送状态", "visitState": "访问状态", "router": "目标路由", "data": "透传数据", "platform": "平台" }, "action": { "succeed": "成功", "fail": "失败", "visit": "阅读" }, "v": { "iState": { "sending": "发送中", "success": "发送成功", "failure": "发送失败" }, "visitState": { "unvisited": "未读", "visited": "已读" }, "weight": { "high": "高", "medium": "中", "low": "低" } } }
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { String, Text } from "oak-domain/lib/types/DataType";
|
|||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import { Config } from "../../types/Config";
|
||||
import { Style } from "../../types/Style";
|
||||
import * as Message from "../Message/Schema";
|
||||
import * as System from "../System/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
name: String<32>;
|
||||
|
|
@ -24,6 +25,8 @@ export declare type Schema = EntityShape & {
|
|||
style?: Style | null;
|
||||
entity?: String<32> | null;
|
||||
entityId?: String<64> | null;
|
||||
message$platform?: Array<Message.Schema>;
|
||||
message$platform$$aggr?: AggregationResult<Message.Schema>;
|
||||
system$platform?: Array<System.Schema>;
|
||||
system$platform$$aggr?: AggregationResult<System.Schema>;
|
||||
} & {
|
||||
|
|
@ -40,6 +43,7 @@ declare type AttrFilter = {
|
|||
style: JsonFilter<Style>;
|
||||
entity: Q_StringValue;
|
||||
entityId: Q_StringValue;
|
||||
message$platform: Message.Filter & SubQueryPredicateMetadata;
|
||||
system$platform: System.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
|
|
@ -56,6 +60,12 @@ export declare type Projection = {
|
|||
style?: number | JsonProjection<Style>;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
message$platform?: Message.Selection & {
|
||||
$entity: "message";
|
||||
};
|
||||
message$platform$$aggr?: Message.Aggregation & {
|
||||
$entity: "message";
|
||||
};
|
||||
system$platform?: System.Selection & {
|
||||
$entity: "system";
|
||||
};
|
||||
|
|
@ -102,6 +112,7 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
message$platform?: OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "platform" | "platformId">, Omit<Message.Filter, "platform" | "platformId">> | OakOperation<"create", Omit<Message.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<Message.CreateOperationData, "platform" | "platformId">> | OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "platform" | "platformId">, Omit<Message.Filter, "platform" | "platformId">>>;
|
||||
system$platform?: OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">> | OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">>>;
|
||||
};
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
|
|
@ -109,6 +120,7 @@ export declare type CreateMultipleOperation = OakOperation<"create", Array<Creat
|
|||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
[k: string]: any;
|
||||
message$platform?: OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "platform" | "platformId">, Omit<Message.Filter, "platform" | "platformId">> | OakOperation<Message.RemoveOperation["action"], Omit<Message.RemoveOperationData, "platform" | "platformId">, Omit<Message.Filter, "platform" | "platformId">> | OakOperation<"create", Omit<Message.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<Message.CreateOperationData, "platform" | "platformId">> | OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "platform" | "platformId">, Omit<Message.Filter, "platform" | "platformId">> | OakOperation<Message.RemoveOperation["action"], Omit<Message.RemoveOperationData, "platform" | "platformId">, Omit<Message.Filter, "platform" | "platformId">>>;
|
||||
system$platform?: OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<System.RemoveOperation["action"], Omit<System.RemoveOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">[]> | Array<OakOperation<"create", Omit<System.CreateOperationData, "platform" | "platformId">> | OakOperation<System.UpdateOperation["action"], Omit<System.UpdateOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">> | OakOperation<System.RemoveOperation["action"], Omit<System.RemoveOperationData, "platform" | "platformId">, Omit<System.Filter, "platform" | "platformId">>>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
|
|
|
|||
|
|
@ -2,30 +2,47 @@ export const ActionCascadePathGraph = [
|
|||
["changePasswordTemp", "user", "changePasswordTemp", false],
|
||||
["email", "user", "email", false],
|
||||
["extraFile", "user", "extraFile", false],
|
||||
["extraFile", "sessionMessage.session", "session", true],
|
||||
["extraFile", "sessionMessage.user", "sessionMessage", false],
|
||||
["extraFile", "sessionMessage.wechatUser.user", "wechatUser", false],
|
||||
["message", "user", "message", false],
|
||||
["messageSystem", "message.user", "message", false],
|
||||
["mobile", "user", "mobile", false],
|
||||
["notification", "messageSystem.message.user", "message", false],
|
||||
["parasite", "user", "parasite", false],
|
||||
["session", "", "session", true],
|
||||
["sessionMessage", "session", "session", true],
|
||||
["sessionMessage", "user", "sessionMessage", false],
|
||||
["sessionMessage", "wechatUser.user", "wechatUser", false],
|
||||
["token", "email.user", "email", false],
|
||||
["token", "mobile.user", "mobile", false],
|
||||
["token", "parasite.user", "parasite", false],
|
||||
["token", "user", "token", false],
|
||||
["token", "player", "token", false],
|
||||
["token", "wechatUser.user", "wechatUser", false],
|
||||
["userEntityGrant", "session", "session", true],
|
||||
["userEntityGrant", "granter", "userEntityGrant", false],
|
||||
["userEntityGrant", "grantee", "userEntityGrant", false],
|
||||
["userSystem", "user", "userSystem", false],
|
||||
["userWechatPublicTag", "user", "userWechatPublicTag", false],
|
||||
["wechatLogin", "user", "wechatLogin", false],
|
||||
["wechatQrCode", "userEntityGrant.session", "session", true],
|
||||
["wechatQrCode", "userEntityGrant.granter", "userEntityGrant", false],
|
||||
["wechatQrCode", "userEntityGrant.grantee", "userEntityGrant", false],
|
||||
["wechatQrCode", "wechatLogin.user", "wechatLogin", false],
|
||||
["wechatQrCode", "user", "wechatQrCode", false],
|
||||
["wechatUser", "user", "wechatUser", false]
|
||||
];
|
||||
export const RelationCascadePathGraph = [];
|
||||
export const relations = [];
|
||||
export const RelationCascadePathGraph = [
|
||||
["session", "", "session", true]
|
||||
];
|
||||
export const relations = [
|
||||
{
|
||||
id: "session-owner",
|
||||
entity: "session",
|
||||
name: "owner"
|
||||
}
|
||||
];
|
||||
export const deducedRelationMap = {};
|
||||
export const selectFreeEntities = [];
|
||||
export const updateFreeEntities = [];
|
||||
|
|
|
|||
|
|
@ -1,25 +1,28 @@
|
|||
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import * as Session from "../Session/Schema";
|
||||
import * as ActionAuth from "../ActionAuth/Schema";
|
||||
import * as RelationAuth from "../RelationAuth/Schema";
|
||||
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
||||
import * as UserRelation from "../UserRelation/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entity: "session" | string;
|
||||
entityId?: String<64> | null;
|
||||
name?: String<32> | null;
|
||||
display?: String<32> | null;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entity: "session" | string;
|
||||
entityId?: String<64> | null;
|
||||
name?: String<32> | null;
|
||||
display?: String<32> | null;
|
||||
session?: Session.Schema;
|
||||
actionAuth$relation?: Array<ActionAuth.Schema>;
|
||||
actionAuth$relation$$aggr?: AggregationResult<ActionAuth.Schema>;
|
||||
relationAuth$sourceRelation?: Array<RelationAuth.Schema>;
|
||||
|
|
@ -38,10 +41,11 @@ declare type AttrFilter = {
|
|||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
entity: Q_StringValue;
|
||||
entity: Q_EnumValue<"session" | string>;
|
||||
entityId: Q_StringValue;
|
||||
name: Q_StringValue;
|
||||
display: Q_StringValue;
|
||||
session: Session.Filter;
|
||||
actionAuth$relation: ActionAuth.Filter & SubQueryPredicateMetadata;
|
||||
relationAuth$sourceRelation: RelationAuth.Filter & SubQueryPredicateMetadata;
|
||||
relationAuth$destRelation: RelationAuth.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -60,6 +64,7 @@ export declare type Projection = {
|
|||
entityId?: number;
|
||||
name?: number;
|
||||
display?: number;
|
||||
session?: Session.Projection;
|
||||
actionAuth$relation?: ActionAuth.Selection & {
|
||||
$entity: "actionAuth";
|
||||
};
|
||||
|
|
@ -94,6 +99,9 @@ export declare type Projection = {
|
|||
declare type RelationIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type SessionIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -110,6 +118,8 @@ export declare type SortAttr = {
|
|||
name: number;
|
||||
} | {
|
||||
display: number;
|
||||
} | {
|
||||
session: Session.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -122,6 +132,17 @@ export declare type SelectOperation<P extends Object = Projection> = OakSelectio
|
|||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
session: Session.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "session";
|
||||
entityId: ForeignKey<"Session">;
|
||||
session: Session.UpdateOperation;
|
||||
} | {
|
||||
entity: "session";
|
||||
entityId?: ForeignKey<"Session">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
|
|
@ -135,7 +156,14 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
session?: Session.CreateSingleOperation | Session.UpdateOperation | Session.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("session" | string) | null;
|
||||
entityId?: ForeignKey<"Session"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
actionAuth$relation?: OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">> | OakOperation<ActionAuth.RemoveOperation["action"], Omit<ActionAuth.RemoveOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<ActionAuth.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<ActionAuth.CreateOperationData, "relation" | "relationId">> | OakOperation<ActionAuth.UpdateOperation["action"], Omit<ActionAuth.UpdateOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">> | OakOperation<ActionAuth.RemoveOperation["action"], Omit<ActionAuth.RemoveOperationData, "relation" | "relationId">, Omit<ActionAuth.Filter, "relation" | "relationId">>>;
|
||||
relationAuth$sourceRelation?: OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">> | OakOperation<"create", Omit<RelationAuth.CreateOperationData, "sourceRelation" | "sourceRelationId">[]> | Array<OakOperation<"create", Omit<RelationAuth.CreateOperationData, "sourceRelation" | "sourceRelationId">> | OakOperation<RelationAuth.UpdateOperation["action"], Omit<RelationAuth.UpdateOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">> | OakOperation<RelationAuth.RemoveOperation["action"], Omit<RelationAuth.RemoveOperationData, "sourceRelation" | "sourceRelationId">, Omit<RelationAuth.Filter, "sourceRelation" | "sourceRelationId">>>;
|
||||
|
|
@ -144,9 +172,14 @@ export declare type UpdateOperationData = FormUpdateData<OpSchema> & {
|
|||
userRelation$relation?: OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">> | OakOperation<"create", Omit<UserRelation.CreateOperationData, "relation" | "relationId">[]> | Array<OakOperation<"create", Omit<UserRelation.CreateOperationData, "relation" | "relationId">> | OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "relation" | "relationId">, Omit<UserRelation.Filter, "relation" | "relationId">>>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {};
|
||||
export declare type RemoveOperationData = {} & ({
|
||||
session?: Session.UpdateOperation | Session.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type SessionIdSubQuery = Selection<SessionIdProjection>;
|
||||
export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ export const desc = {
|
|||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
ref: ["session"]
|
||||
},
|
||||
entityId: {
|
||||
type: "varchar",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,174 @@
|
|||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction, RelationAction } from "oak-domain/lib/actions/action";
|
||||
import { String } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import * as Application from "../Application/Schema";
|
||||
import * as SessionMessage from "../SessionMessage/Schema";
|
||||
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
||||
import * as Relation from "../Relation/Schema";
|
||||
import * as UserRelation from "../UserRelation/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
entity: "application" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
entity: "application" | string;
|
||||
entityId: String<64>;
|
||||
application?: Application.Schema;
|
||||
sessionMessage$session?: Array<SessionMessage.Schema>;
|
||||
sessionMessage$session$$aggr?: AggregationResult<SessionMessage.Schema>;
|
||||
userEntityGrant$entity?: Array<UserEntityGrant.Schema>;
|
||||
userEntityGrant$entity$$aggr?: AggregationResult<UserEntityGrant.Schema>;
|
||||
relation$entity?: Array<Relation.Schema>;
|
||||
relation$entity$$aggr?: AggregationResult<Relation.Schema>;
|
||||
userRelation$entity?: Array<UserRelation.Schema>;
|
||||
userRelation$entity$$aggr?: AggregationResult<UserRelation.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
declare type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
entity: Q_EnumValue<"application" | string>;
|
||||
entityId: Q_StringValue;
|
||||
application: Application.Filter;
|
||||
sessionMessage$session: SessionMessage.Filter & SubQueryPredicateMetadata;
|
||||
userEntityGrant$entity: UserEntityGrant.Filter & SubQueryPredicateMetadata;
|
||||
relation$entity: Relation.Filter & SubQueryPredicateMetadata;
|
||||
userRelation$entity: UserRelation.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
application?: Application.Projection;
|
||||
sessionMessage$session?: SessionMessage.Selection & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
sessionMessage$session$$aggr?: SessionMessage.Aggregation & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
userEntityGrant$entity?: UserEntityGrant.Selection & {
|
||||
$entity: "userEntityGrant";
|
||||
};
|
||||
userEntityGrant$entity$$aggr?: UserEntityGrant.Aggregation & {
|
||||
$entity: "userEntityGrant";
|
||||
};
|
||||
relation$entity?: Relation.Selection & {
|
||||
$entity: "relation";
|
||||
};
|
||||
relation$entity$$aggr?: Relation.Aggregation & {
|
||||
$entity: "relation";
|
||||
};
|
||||
userRelation$entity?: UserRelation.Selection & {
|
||||
$entity: "userRelation";
|
||||
};
|
||||
userRelation$entity$$aggr?: UserRelation.Aggregation & {
|
||||
$entity: "userRelation";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
declare type SessionIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type ApplicationIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
application: Application.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
application: Application.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "application";
|
||||
entityId: ForeignKey<"Application">;
|
||||
application: Application.UpdateOperation;
|
||||
} | {
|
||||
entity: "application";
|
||||
entityId: ForeignKey<"Application">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
}) & {
|
||||
sessionMessage$session?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "session" | "sessionId">, Omit<SessionMessage.Filter, "session" | "sessionId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "session" | "sessionId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "session" | "sessionId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "session" | "sessionId">, Omit<SessionMessage.Filter, "session" | "sessionId">>>;
|
||||
userEntityGrant$entity?: OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "entity" | "entityId">, Omit<UserEntityGrant.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "entity" | "entityId">> | OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "entity" | "entityId">, Omit<UserEntityGrant.Filter, "entity" | "entityId">>>;
|
||||
relation$entity?: OakOperation<Relation.UpdateOperation["action"], Omit<Relation.UpdateOperationData, "entity" | "entityId">, Omit<Relation.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Relation.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Relation.CreateOperationData, "entity" | "entityId">> | OakOperation<Relation.UpdateOperation["action"], Omit<Relation.UpdateOperationData, "entity" | "entityId">, Omit<Relation.Filter, "entity" | "entityId">>>;
|
||||
userRelation$entity?: OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "entity" | "entityId">, Omit<UserRelation.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<UserRelation.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<UserRelation.CreateOperationData, "entity" | "entityId">> | OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "entity" | "entityId">, Omit<UserRelation.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId">> & ({
|
||||
application?: Application.CreateSingleOperation | Application.UpdateOperation | Application.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("application" | string) | null;
|
||||
entityId?: ForeignKey<"Application"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
sessionMessage$session?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "session" | "sessionId">, Omit<SessionMessage.Filter, "session" | "sessionId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "session" | "sessionId">, Omit<SessionMessage.Filter, "session" | "sessionId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "session" | "sessionId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "session" | "sessionId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "session" | "sessionId">, Omit<SessionMessage.Filter, "session" | "sessionId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "session" | "sessionId">, Omit<SessionMessage.Filter, "session" | "sessionId">>>;
|
||||
userEntityGrant$entity?: OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "entity" | "entityId">, Omit<UserEntityGrant.Filter, "entity" | "entityId">> | OakOperation<UserEntityGrant.RemoveOperation["action"], Omit<UserEntityGrant.RemoveOperationData, "entity" | "entityId">, Omit<UserEntityGrant.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "entity" | "entityId">> | OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "entity" | "entityId">, Omit<UserEntityGrant.Filter, "entity" | "entityId">> | OakOperation<UserEntityGrant.RemoveOperation["action"], Omit<UserEntityGrant.RemoveOperationData, "entity" | "entityId">, Omit<UserEntityGrant.Filter, "entity" | "entityId">>>;
|
||||
relation$entity?: OakOperation<Relation.UpdateOperation["action"], Omit<Relation.UpdateOperationData, "entity" | "entityId">, Omit<Relation.Filter, "entity" | "entityId">> | OakOperation<Relation.RemoveOperation["action"], Omit<Relation.RemoveOperationData, "entity" | "entityId">, Omit<Relation.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Relation.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Relation.CreateOperationData, "entity" | "entityId">> | OakOperation<Relation.UpdateOperation["action"], Omit<Relation.UpdateOperationData, "entity" | "entityId">, Omit<Relation.Filter, "entity" | "entityId">> | OakOperation<Relation.RemoveOperation["action"], Omit<Relation.RemoveOperationData, "entity" | "entityId">, Omit<Relation.Filter, "entity" | "entityId">>>;
|
||||
userRelation$entity?: OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "entity" | "entityId">, Omit<UserRelation.Filter, "entity" | "entityId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "entity" | "entityId">, Omit<UserRelation.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<UserRelation.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<UserRelation.CreateOperationData, "entity" | "entityId">> | OakOperation<UserRelation.UpdateOperation["action"], Omit<UserRelation.UpdateOperationData, "entity" | "entityId">, Omit<UserRelation.Filter, "entity" | "entityId">> | OakOperation<UserRelation.RemoveOperation["action"], Omit<UserRelation.RemoveOperationData, "entity" | "entityId">, Omit<UserRelation.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | RelationAction | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & ({
|
||||
application?: Application.UpdateOperation | Application.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
||||
export declare type SessionIdSubQuery = Selection<SessionIdProjection>;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction | RelationAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc = {
|
||||
attributes: {
|
||||
entity: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
},
|
||||
ref: ["application"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 64
|
||||
}
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions,
|
||||
relation: ['owner']
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "会话", "attr": { "entity": "关联对象", "entityId": "关联对象id" }, "r": { "owner": "所有者" } }
|
||||
|
|
@ -0,0 +1,273 @@
|
|||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_BooleanValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey, SubQueryPredicateMetadata } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction, AggregationResult } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
import { String, Datetime, Boolean, Text } from "oak-domain/lib/types/DataType";
|
||||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import * as Application from "../Application/Schema";
|
||||
import * as Session from "../Session/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
import * as WechatUser from "../WechatUser/Schema";
|
||||
import * as ExtraFile from "../ExtraFile/Schema";
|
||||
declare type Type = 'text' | 'image' | 'audio' | 'video' | 'news';
|
||||
export declare type OpSchema = EntityShape & {
|
||||
applicationId: ForeignKey<"application">;
|
||||
sessionId: ForeignKey<"session">;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
wechatUserId?: ForeignKey<"wechatUser"> | null;
|
||||
createTime?: Datetime | null;
|
||||
type: Type;
|
||||
text?: Text | null;
|
||||
news?: String<128> | null;
|
||||
aaoe?: Boolean | null;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
applicationId: ForeignKey<"application">;
|
||||
sessionId: ForeignKey<"session">;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
wechatUserId?: ForeignKey<"wechatUser"> | null;
|
||||
createTime?: Datetime | null;
|
||||
type: Type;
|
||||
text?: Text | null;
|
||||
news?: String<128> | null;
|
||||
aaoe?: Boolean | null;
|
||||
application: Application.Schema;
|
||||
session: Session.Schema;
|
||||
user?: User.Schema | null;
|
||||
wechatUser?: WechatUser.Schema | null;
|
||||
extraFile$entity?: Array<ExtraFile.Schema>;
|
||||
extraFile$entity$$aggr?: AggregationResult<ExtraFile.Schema>;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
declare type AttrFilter = {
|
||||
id: Q_StringValue;
|
||||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
applicationId: Q_StringValue;
|
||||
application: Application.Filter;
|
||||
sessionId: Q_StringValue;
|
||||
session: Session.Filter;
|
||||
userId: Q_StringValue;
|
||||
user: User.Filter;
|
||||
wechatUserId: Q_StringValue;
|
||||
wechatUser: WechatUser.Filter;
|
||||
createTime: Q_DateValue;
|
||||
type: Q_EnumValue<Type>;
|
||||
text: Q_StringValue;
|
||||
news: Q_StringValue;
|
||||
aaoe: Q_BooleanValue;
|
||||
extraFile$entity: ExtraFile.Filter & SubQueryPredicateMetadata;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare type Projection = {
|
||||
"#id"?: NodeId;
|
||||
[k: string]: any;
|
||||
id?: number;
|
||||
$$createAt$$?: number;
|
||||
$$updateAt$$?: number;
|
||||
$$seq$$?: number;
|
||||
applicationId?: number;
|
||||
application?: Application.Projection;
|
||||
sessionId?: number;
|
||||
session?: Session.Projection;
|
||||
userId?: number;
|
||||
user?: User.Projection;
|
||||
wechatUserId?: number;
|
||||
wechatUser?: WechatUser.Projection;
|
||||
createTime?: number;
|
||||
type?: number;
|
||||
text?: number;
|
||||
news?: number;
|
||||
aaoe?: number;
|
||||
extraFile$entity?: ExtraFile.Selection & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
extraFile$entity$$aggr?: ExtraFile.Aggregation & {
|
||||
$entity: "extraFile";
|
||||
};
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
declare type SessionMessageIdProjection = OneOf<{
|
||||
id: number;
|
||||
}>;
|
||||
declare type ApplicationIdProjection = OneOf<{
|
||||
applicationId: number;
|
||||
}>;
|
||||
declare type SessionIdProjection = OneOf<{
|
||||
sessionId: number;
|
||||
}>;
|
||||
declare type UserIdProjection = OneOf<{
|
||||
userId: number;
|
||||
}>;
|
||||
declare type WechatUserIdProjection = OneOf<{
|
||||
wechatUserId: number;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
$$createAt$$: number;
|
||||
} | {
|
||||
$$seq$$: number;
|
||||
} | {
|
||||
$$updateAt$$: number;
|
||||
} | {
|
||||
applicationId: number;
|
||||
} | {
|
||||
application: Application.SortAttr;
|
||||
} | {
|
||||
sessionId: number;
|
||||
} | {
|
||||
session: Session.SortAttr;
|
||||
} | {
|
||||
userId: number;
|
||||
} | {
|
||||
user: User.SortAttr;
|
||||
} | {
|
||||
wechatUserId: number;
|
||||
} | {
|
||||
wechatUser: WechatUser.SortAttr;
|
||||
} | {
|
||||
createTime: number;
|
||||
} | {
|
||||
type: number;
|
||||
} | {
|
||||
text: number;
|
||||
} | {
|
||||
news: number;
|
||||
} | {
|
||||
aaoe: number;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
export declare type SortNode = {
|
||||
$attr: SortAttr;
|
||||
$direction?: "asc" | "desc";
|
||||
};
|
||||
export declare type Sorter = SortNode[];
|
||||
export declare type SelectOperation<P extends Object = Projection> = OakSelection<"select", P, Filter, Sorter>;
|
||||
export declare type Selection<P extends Object = Projection> = SelectOperation<P>;
|
||||
export declare type Aggregation = DeduceAggregation<Projection, Filter, Sorter>;
|
||||
export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "applicationId" | "sessionId" | "userId" | "wechatUserId">> & (({
|
||||
applicationId?: never;
|
||||
application: Application.CreateSingleOperation;
|
||||
} | {
|
||||
applicationId: ForeignKey<"application">;
|
||||
application?: Application.UpdateOperation;
|
||||
} | {
|
||||
applicationId: ForeignKey<"application">;
|
||||
}) & ({
|
||||
sessionId?: never;
|
||||
session: Session.CreateSingleOperation;
|
||||
} | {
|
||||
sessionId: ForeignKey<"session">;
|
||||
session?: Session.UpdateOperation;
|
||||
} | {
|
||||
sessionId: ForeignKey<"session">;
|
||||
}) & ({
|
||||
userId?: never;
|
||||
user?: User.CreateSingleOperation;
|
||||
} | {
|
||||
userId: ForeignKey<"user">;
|
||||
user?: User.UpdateOperation;
|
||||
} | {
|
||||
userId?: ForeignKey<"user">;
|
||||
}) & ({
|
||||
wechatUserId?: never;
|
||||
wechatUser?: WechatUser.CreateSingleOperation;
|
||||
} | {
|
||||
wechatUserId: ForeignKey<"wechatUser">;
|
||||
wechatUser?: WechatUser.UpdateOperation;
|
||||
} | {
|
||||
wechatUserId?: ForeignKey<"wechatUser">;
|
||||
})) & {
|
||||
extraFile$entity?: OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">> | OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "applicationId" | "sessionId" | "userId" | "wechatUserId">> & (({
|
||||
application: Application.CreateSingleOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.UpdateOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application: Application.RemoveOperation;
|
||||
applicationId?: never;
|
||||
} | {
|
||||
application?: never;
|
||||
applicationId?: ForeignKey<"application"> | null;
|
||||
}) & ({
|
||||
session: Session.CreateSingleOperation;
|
||||
sessionId?: never;
|
||||
} | {
|
||||
session: Session.UpdateOperation;
|
||||
sessionId?: never;
|
||||
} | {
|
||||
session: Session.RemoveOperation;
|
||||
sessionId?: never;
|
||||
} | {
|
||||
session?: never;
|
||||
sessionId?: ForeignKey<"session"> | null;
|
||||
}) & ({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.UpdateOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user: User.RemoveOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
user?: never;
|
||||
userId?: ForeignKey<"user"> | null;
|
||||
}) & ({
|
||||
wechatUser: WechatUser.CreateSingleOperation;
|
||||
wechatUserId?: never;
|
||||
} | {
|
||||
wechatUser: WechatUser.UpdateOperation;
|
||||
wechatUserId?: never;
|
||||
} | {
|
||||
wechatUser: WechatUser.RemoveOperation;
|
||||
wechatUserId?: never;
|
||||
} | {
|
||||
wechatUser?: never;
|
||||
wechatUserId?: ForeignKey<"wechatUser"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
extraFile$entity?: OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<ExtraFile.RemoveOperation["action"], Omit<ExtraFile.RemoveOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ExtraFile.CreateOperationData, "entity" | "entityId">> | OakOperation<ExtraFile.UpdateOperation["action"], Omit<ExtraFile.UpdateOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">> | OakOperation<ExtraFile.RemoveOperation["action"], Omit<ExtraFile.RemoveOperationData, "entity" | "entityId">, Omit<ExtraFile.Filter, "entity" | "entityId">>>;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
export declare type RemoveOperationData = {} & (({
|
||||
application?: Application.UpdateOperation | Application.RemoveOperation;
|
||||
}) & ({
|
||||
session?: Session.UpdateOperation | Session.RemoveOperation;
|
||||
}) & ({
|
||||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}) & ({
|
||||
wechatUser?: WechatUser.UpdateOperation | WechatUser.RemoveOperation;
|
||||
}));
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type ApplicationIdSubQuery = Selection<ApplicationIdProjection>;
|
||||
export declare type SessionIdSubQuery = Selection<SessionIdProjection>;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type WechatUserIdSubQuery = Selection<WechatUserIdProjection>;
|
||||
export declare type SessionMessageIdSubQuery = Selection<SessionMessageIdProjection>;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
OpSchema: OpSchema;
|
||||
Action: OakMakeAction<GenericAction> | string;
|
||||
Selection: Selection;
|
||||
Aggregation: Aggregation;
|
||||
Operation: Operation;
|
||||
Create: CreateOperation;
|
||||
Update: UpdateOperation;
|
||||
Remove: RemoveOperation;
|
||||
CreateSingle: CreateSingleOperation;
|
||||
CreateMulti: CreateMultipleOperation;
|
||||
};
|
||||
export {};
|
||||
|
|
@ -0,0 +1 @@
|
|||
export {};
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
import { StorageDesc } from "oak-domain/lib/types/Storage";
|
||||
import { OpSchema } from "./Schema";
|
||||
export declare const desc: StorageDesc<OpSchema>;
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import { genericActions as actions } from "oak-domain/lib/actions/action";
|
||||
export const desc = {
|
||||
attributes: {
|
||||
applicationId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "application"
|
||||
},
|
||||
sessionId: {
|
||||
notNull: true,
|
||||
type: "ref",
|
||||
ref: "session"
|
||||
},
|
||||
userId: {
|
||||
type: "ref",
|
||||
ref: "user"
|
||||
},
|
||||
wechatUserId: {
|
||||
type: "ref",
|
||||
ref: "wechatUser"
|
||||
},
|
||||
createTime: {
|
||||
type: "datetime"
|
||||
},
|
||||
type: {
|
||||
notNull: true,
|
||||
type: "enum",
|
||||
enumeration: ["text", "image", "audio", "video", "news"]
|
||||
},
|
||||
text: {
|
||||
type: "text"
|
||||
},
|
||||
news: {
|
||||
type: "varchar",
|
||||
params: {
|
||||
length: 128
|
||||
}
|
||||
},
|
||||
aaoe: {
|
||||
type: "boolean"
|
||||
}
|
||||
},
|
||||
actionType: "crud",
|
||||
actions
|
||||
};
|
||||
|
|
@ -0,0 +1 @@
|
|||
{ "name": "消息", "attr": { "application": "应用", "session": "会话", "user": "用户", "wechatUser": "微信用户", "createTime": "发送时间", "type": "消息类型", "text": "文字内容", "files": "文件", "news": "文章", "aaoe": "作为实体的发起者" }, "v": { "type": { "text": "文字", "image": "图片", "audio": "音频", "video": "视频", "news": "图文" } } }
|
||||
|
|
@ -28,6 +28,8 @@ import { desc as mobileDesc } from "./Mobile/Storage";
|
|||
import { desc as notificationDesc } from "./Notification/Storage";
|
||||
import { desc as parasiteDesc } from "./Parasite/Storage";
|
||||
import { desc as platformDesc } from "./Platform/Storage";
|
||||
import { desc as sessionDesc } from "./Session/Storage";
|
||||
import { desc as sessionMessageDesc } from "./SessionMessage/Storage";
|
||||
import { desc as stationDesc } from "./Station/Storage";
|
||||
import { desc as subscriptionDesc } from "./Subscription/Storage";
|
||||
import { desc as subwayDesc } from "./Subway/Storage";
|
||||
|
|
@ -71,6 +73,8 @@ export const storageSchema = {
|
|||
notification: notificationDesc,
|
||||
parasite: parasiteDesc,
|
||||
platform: platformDesc,
|
||||
session: sessionDesc,
|
||||
sessionMessage: sessionMessageDesc,
|
||||
station: stationDesc,
|
||||
subscription: subscriptionDesc,
|
||||
subway: subwayDesc,
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import * as Email from "../Email/Schema";
|
|||
import * as Message from "../Message/Schema";
|
||||
import * as Mobile from "../Mobile/Schema";
|
||||
import * as Parasite from "../Parasite/Schema";
|
||||
import * as SessionMessage from "../SessionMessage/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
import * as UserEntityGrant from "../UserEntityGrant/Schema";
|
||||
import * as UserSystem from "../UserSystem/Schema";
|
||||
|
|
@ -68,6 +69,8 @@ export declare type Schema = EntityShape & {
|
|||
mobile$user$$aggr?: AggregationResult<Mobile.Schema>;
|
||||
parasite$user?: Array<Parasite.Schema>;
|
||||
parasite$user$$aggr?: AggregationResult<Parasite.Schema>;
|
||||
sessionMessage$user?: Array<SessionMessage.Schema>;
|
||||
sessionMessage$user$$aggr?: AggregationResult<SessionMessage.Schema>;
|
||||
token$user?: Array<Token.Schema>;
|
||||
token$user$$aggr?: AggregationResult<Token.Schema>;
|
||||
token$player?: Array<Token.Schema>;
|
||||
|
|
@ -121,6 +124,7 @@ declare type AttrFilter = {
|
|||
message$user: Message.Filter & SubQueryPredicateMetadata;
|
||||
mobile$user: Mobile.Filter & SubQueryPredicateMetadata;
|
||||
parasite$user: Parasite.Filter & SubQueryPredicateMetadata;
|
||||
sessionMessage$user: SessionMessage.Filter & SubQueryPredicateMetadata;
|
||||
token$user: Token.Filter & SubQueryPredicateMetadata;
|
||||
token$player: Token.Filter & SubQueryPredicateMetadata;
|
||||
userEntityGrant$granter: UserEntityGrant.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -203,6 +207,12 @@ export declare type Projection = {
|
|||
parasite$user$$aggr?: Parasite.Aggregation & {
|
||||
$entity: "parasite";
|
||||
};
|
||||
sessionMessage$user?: SessionMessage.Selection & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
sessionMessage$user$$aggr?: SessionMessage.Aggregation & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
token$user?: Token.Selection & {
|
||||
$entity: "token";
|
||||
};
|
||||
|
|
@ -342,6 +352,7 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "refId">
|
|||
message$user?: OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "user" | "userId">, Omit<Message.Filter, "user" | "userId">> | OakOperation<"create", Omit<Message.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Message.CreateOperationData, "user" | "userId">> | OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "user" | "userId">, Omit<Message.Filter, "user" | "userId">>>;
|
||||
mobile$user?: OakOperation<Mobile.UpdateOperation["action"], Omit<Mobile.UpdateOperationData, "user" | "userId">, Omit<Mobile.Filter, "user" | "userId">> | OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">> | OakOperation<Mobile.UpdateOperation["action"], Omit<Mobile.UpdateOperationData, "user" | "userId">, Omit<Mobile.Filter, "user" | "userId">>>;
|
||||
parasite$user?: OakOperation<Parasite.UpdateOperation["action"], Omit<Parasite.UpdateOperationData, "user" | "userId">, Omit<Parasite.Filter, "user" | "userId">> | OakOperation<"create", Omit<Parasite.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Parasite.CreateOperationData, "user" | "userId">> | OakOperation<Parasite.UpdateOperation["action"], Omit<Parasite.UpdateOperationData, "user" | "userId">, Omit<Parasite.Filter, "user" | "userId">>>;
|
||||
sessionMessage$user?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "user" | "userId">, Omit<SessionMessage.Filter, "user" | "userId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "user" | "userId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "user" | "userId">, Omit<SessionMessage.Filter, "user" | "userId">>>;
|
||||
token$user?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "user" | "userId">, Omit<Token.Filter, "user" | "userId">> | OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "user" | "userId">, Omit<Token.Filter, "user" | "userId">>>;
|
||||
token$player?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "player" | "playerId">, Omit<Token.Filter, "player" | "playerId">> | OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "player" | "playerId">, Omit<Token.Filter, "player" | "playerId">>>;
|
||||
userEntityGrant$granter?: OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "granter" | "granterId">, Omit<UserEntityGrant.Filter, "granter" | "granterId">> | OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId">[]> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId">> | OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "granter" | "granterId">, Omit<UserEntityGrant.Filter, "granter" | "granterId">>>;
|
||||
|
|
@ -380,6 +391,7 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "refId">
|
|||
message$user?: OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "user" | "userId">, Omit<Message.Filter, "user" | "userId">> | OakOperation<Message.RemoveOperation["action"], Omit<Message.RemoveOperationData, "user" | "userId">, Omit<Message.Filter, "user" | "userId">> | OakOperation<"create", Omit<Message.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Message.CreateOperationData, "user" | "userId">> | OakOperation<Message.UpdateOperation["action"], Omit<Message.UpdateOperationData, "user" | "userId">, Omit<Message.Filter, "user" | "userId">> | OakOperation<Message.RemoveOperation["action"], Omit<Message.RemoveOperationData, "user" | "userId">, Omit<Message.Filter, "user" | "userId">>>;
|
||||
mobile$user?: OakOperation<Mobile.UpdateOperation["action"], Omit<Mobile.UpdateOperationData, "user" | "userId">, Omit<Mobile.Filter, "user" | "userId">> | OakOperation<Mobile.RemoveOperation["action"], Omit<Mobile.RemoveOperationData, "user" | "userId">, Omit<Mobile.Filter, "user" | "userId">> | OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Mobile.CreateOperationData, "user" | "userId">> | OakOperation<Mobile.UpdateOperation["action"], Omit<Mobile.UpdateOperationData, "user" | "userId">, Omit<Mobile.Filter, "user" | "userId">> | OakOperation<Mobile.RemoveOperation["action"], Omit<Mobile.RemoveOperationData, "user" | "userId">, Omit<Mobile.Filter, "user" | "userId">>>;
|
||||
parasite$user?: OakOperation<Parasite.UpdateOperation["action"], Omit<Parasite.UpdateOperationData, "user" | "userId">, Omit<Parasite.Filter, "user" | "userId">> | OakOperation<Parasite.RemoveOperation["action"], Omit<Parasite.RemoveOperationData, "user" | "userId">, Omit<Parasite.Filter, "user" | "userId">> | OakOperation<"create", Omit<Parasite.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Parasite.CreateOperationData, "user" | "userId">> | OakOperation<Parasite.UpdateOperation["action"], Omit<Parasite.UpdateOperationData, "user" | "userId">, Omit<Parasite.Filter, "user" | "userId">> | OakOperation<Parasite.RemoveOperation["action"], Omit<Parasite.RemoveOperationData, "user" | "userId">, Omit<Parasite.Filter, "user" | "userId">>>;
|
||||
sessionMessage$user?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "user" | "userId">, Omit<SessionMessage.Filter, "user" | "userId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "user" | "userId">, Omit<SessionMessage.Filter, "user" | "userId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "user" | "userId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "user" | "userId">, Omit<SessionMessage.Filter, "user" | "userId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "user" | "userId">, Omit<SessionMessage.Filter, "user" | "userId">>>;
|
||||
token$user?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "user" | "userId">, Omit<Token.Filter, "user" | "userId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "user" | "userId">, Omit<Token.Filter, "user" | "userId">> | OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "user" | "userId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "user" | "userId">, Omit<Token.Filter, "user" | "userId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "user" | "userId">, Omit<Token.Filter, "user" | "userId">>>;
|
||||
token$player?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "player" | "playerId">, Omit<Token.Filter, "player" | "playerId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "player" | "playerId">, Omit<Token.Filter, "player" | "playerId">> | OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "player" | "playerId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "player" | "playerId">, Omit<Token.Filter, "player" | "playerId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "player" | "playerId">, Omit<Token.Filter, "player" | "playerId">>>;
|
||||
userEntityGrant$granter?: OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "granter" | "granterId">, Omit<UserEntityGrant.Filter, "granter" | "granterId">> | OakOperation<UserEntityGrant.RemoveOperation["action"], Omit<UserEntityGrant.RemoveOperationData, "granter" | "granterId">, Omit<UserEntityGrant.Filter, "granter" | "granterId">> | OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId">[]> | Array<OakOperation<"create", Omit<UserEntityGrant.CreateOperationData, "granter" | "granterId">> | OakOperation<UserEntityGrant.UpdateOperation["action"], Omit<UserEntityGrant.UpdateOperationData, "granter" | "granterId">, Omit<UserEntityGrant.Filter, "granter" | "granterId">> | OakOperation<UserEntityGrant.RemoveOperation["action"], Omit<UserEntityGrant.RemoveOperationData, "granter" | "granterId">, Omit<UserEntityGrant.Filter, "granter" | "granterId">>>;
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import { EntityShape } from "oak-domain/lib/types/Entity";
|
|||
import { QrCodeType } from "../../types/Config";
|
||||
import * as Relation from "../Relation/Schema";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Session from "../Session/Schema";
|
||||
import * as ModiEntity from "../ModiEntity/Schema";
|
||||
import * as OperEntity from "../OperEntity/Schema";
|
||||
import * as WechatQrCode from "../WechatQrCode/Schema";
|
||||
|
|
@ -18,7 +19,7 @@ export declare type RedirectToProps = {
|
|||
isTabBar?: boolean;
|
||||
};
|
||||
export declare type OpSchema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entity: "session" | string;
|
||||
entityId: String<64>;
|
||||
relationId: ForeignKey<"relation">;
|
||||
type: 'grant' | 'transfer';
|
||||
|
|
@ -34,7 +35,7 @@ export declare type OpSchema = EntityShape & {
|
|||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
entity: String<32>;
|
||||
entity: "session" | string;
|
||||
entityId: String<64>;
|
||||
relationId: ForeignKey<"relation">;
|
||||
type: 'grant' | 'transfer';
|
||||
|
|
@ -50,6 +51,7 @@ export declare type Schema = EntityShape & {
|
|||
relation: Relation.Schema;
|
||||
granter: User.Schema;
|
||||
grantee?: User.Schema | null;
|
||||
session?: Session.Schema;
|
||||
modiEntity$entity?: Array<ModiEntity.Schema>;
|
||||
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
||||
operEntity$entity?: Array<OperEntity.Schema>;
|
||||
|
|
@ -64,7 +66,7 @@ declare type AttrFilter = {
|
|||
$$createAt$$: Q_DateValue;
|
||||
$$seq$$: Q_StringValue;
|
||||
$$updateAt$$: Q_DateValue;
|
||||
entity: Q_StringValue;
|
||||
entity: Q_EnumValue<"session" | string>;
|
||||
entityId: Q_StringValue;
|
||||
relationId: Q_StringValue;
|
||||
relation: Relation.Filter;
|
||||
|
|
@ -80,6 +82,7 @@ declare type AttrFilter = {
|
|||
expiresAt: Q_DateValue;
|
||||
expired: Q_BooleanValue;
|
||||
redirectTo: JsonFilter<RedirectToProps>;
|
||||
session: Session.Filter;
|
||||
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
|
||||
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
|
||||
wechatQrCode$entity: WechatQrCode.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -108,6 +111,7 @@ export declare type Projection = {
|
|||
expiresAt?: number;
|
||||
expired?: number;
|
||||
redirectTo?: number | JsonProjection<RedirectToProps>;
|
||||
session?: Session.Projection;
|
||||
modiEntity$entity?: ModiEntity.Selection & {
|
||||
$entity: "modiEntity";
|
||||
};
|
||||
|
|
@ -137,6 +141,9 @@ declare type UserIdProjection = OneOf<{
|
|||
granterId: number;
|
||||
granteeId: number;
|
||||
}>;
|
||||
declare type SessionIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -177,6 +184,8 @@ export declare type SortAttr = {
|
|||
expired: number;
|
||||
} | {
|
||||
redirectTo: number;
|
||||
} | {
|
||||
session: Session.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -213,6 +222,17 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
} | {
|
||||
granteeId?: ForeignKey<"grantee">;
|
||||
})) & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
session: Session.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "session";
|
||||
entityId: ForeignKey<"Session">;
|
||||
session: Session.UpdateOperation;
|
||||
} | {
|
||||
entity: "session";
|
||||
entityId: ForeignKey<"Session">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
|
|
@ -224,7 +244,7 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relationId" | "granterId" | "granteeId">> & (({
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "relationId" | "granterId" | "granteeId">> & (({
|
||||
relation: Relation.CreateSingleOperation;
|
||||
relationId?: never;
|
||||
} | {
|
||||
|
|
@ -260,7 +280,14 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "relatio
|
|||
} | {
|
||||
grantee?: never;
|
||||
granteeId?: ForeignKey<"grantee"> | null;
|
||||
})) & {
|
||||
})) & ({
|
||||
session?: Session.CreateSingleOperation | Session.UpdateOperation | Session.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("session" | string) | null;
|
||||
entityId?: ForeignKey<"Session"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
||||
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
||||
|
|
@ -273,11 +300,16 @@ export declare type RemoveOperationData = {} & (({
|
|||
granter?: User.UpdateOperation | User.RemoveOperation;
|
||||
}) & ({
|
||||
grantee?: User.UpdateOperation | User.RemoveOperation;
|
||||
}));
|
||||
})) & ({
|
||||
session?: Session.UpdateOperation | Session.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type SessionIdSubQuery = Selection<SessionIdProjection>;
|
||||
export declare type UserEntityGrantIdSubQuery = Selection<UserEntityGrantIdProjection>;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ export const desc = {
|
|||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
ref: ["session"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { ForeignKey } from "oak-domain/lib/types/DataType";
|
||||
import { Q_DateValue, Q_StringValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { Q_DateValue, Q_StringValue, Q_EnumValue, NodeId, MakeFilter, ExprOp, ExpressionKey } from "oak-domain/lib/types/Demand";
|
||||
import { OneOf } from "oak-domain/lib/types/Polyfill";
|
||||
import { FormCreateData, FormUpdateData, DeduceAggregation, Operation as OakOperation, Selection as OakSelection, MakeAction as OakMakeAction } from "oak-domain/lib/types/Entity";
|
||||
import { GenericAction } from "oak-domain/lib/actions/action";
|
||||
|
|
@ -7,20 +7,22 @@ import { String } from "oak-domain/lib/types/DataType";
|
|||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Relation from "../Relation/Schema";
|
||||
import * as Session from "../Session/Schema";
|
||||
export declare type OpSchema = EntityShape & {
|
||||
userId: ForeignKey<"user">;
|
||||
relationId: ForeignKey<"relation">;
|
||||
entity: String<32>;
|
||||
entity: "session" | string;
|
||||
entityId: String<64>;
|
||||
};
|
||||
export declare type OpAttr = keyof OpSchema;
|
||||
export declare type Schema = EntityShape & {
|
||||
userId: ForeignKey<"user">;
|
||||
relationId: ForeignKey<"relation">;
|
||||
entity: String<32>;
|
||||
entity: "session" | string;
|
||||
entityId: String<64>;
|
||||
user: User.Schema;
|
||||
relation: Relation.Schema;
|
||||
session?: Session.Schema;
|
||||
} & {
|
||||
[A in ExpressionKey]?: any;
|
||||
};
|
||||
|
|
@ -33,8 +35,9 @@ declare type AttrFilter = {
|
|||
user: User.Filter;
|
||||
relationId: Q_StringValue;
|
||||
relation: Relation.Filter;
|
||||
entity: Q_StringValue;
|
||||
entity: Q_EnumValue<"session" | string>;
|
||||
entityId: Q_StringValue;
|
||||
session: Session.Filter;
|
||||
};
|
||||
export declare type Filter = MakeFilter<AttrFilter & ExprOp<OpAttr | string>>;
|
||||
export declare type Projection = {
|
||||
|
|
@ -50,6 +53,7 @@ export declare type Projection = {
|
|||
relation?: Relation.Projection;
|
||||
entity?: number;
|
||||
entityId?: number;
|
||||
session?: Session.Projection;
|
||||
} & Partial<ExprOp<OpAttr | string>>;
|
||||
declare type UserRelationIdProjection = OneOf<{
|
||||
id: number;
|
||||
|
|
@ -60,6 +64,9 @@ declare type UserIdProjection = OneOf<{
|
|||
declare type RelationIdProjection = OneOf<{
|
||||
relationId: number;
|
||||
}>;
|
||||
declare type SessionIdProjection = OneOf<{
|
||||
entityId: number;
|
||||
}>;
|
||||
export declare type SortAttr = {
|
||||
id: number;
|
||||
} | {
|
||||
|
|
@ -80,6 +87,8 @@ export declare type SortAttr = {
|
|||
entity: number;
|
||||
} | {
|
||||
entityId: number;
|
||||
} | {
|
||||
session: Session.SortAttr;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
} | OneOf<ExprOp<OpAttr | string>>;
|
||||
|
|
@ -108,6 +117,17 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
} | {
|
||||
relationId: ForeignKey<"relation">;
|
||||
})) & ({
|
||||
entity?: never;
|
||||
entityId?: never;
|
||||
session: Session.CreateSingleOperation;
|
||||
} | {
|
||||
entity: "session";
|
||||
entityId: ForeignKey<"Session">;
|
||||
session: Session.UpdateOperation;
|
||||
} | {
|
||||
entity: "session";
|
||||
entityId: ForeignKey<"Session">;
|
||||
} | {
|
||||
entity?: string;
|
||||
entityId?: string;
|
||||
[K: string]: any;
|
||||
|
|
@ -115,7 +135,7 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "entity"
|
|||
export declare type CreateSingleOperation = OakOperation<"create", CreateOperationData>;
|
||||
export declare type CreateMultipleOperation = OakOperation<"create", Array<CreateOperationData>>;
|
||||
export declare type CreateOperation = CreateSingleOperation | CreateMultipleOperation;
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId" | "relationId">> & (({
|
||||
export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "entity" | "entityId" | "userId" | "relationId">> & (({
|
||||
user: User.CreateSingleOperation;
|
||||
userId?: never;
|
||||
} | {
|
||||
|
|
@ -139,7 +159,14 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId"
|
|||
} | {
|
||||
relation?: never;
|
||||
relationId?: ForeignKey<"relation"> | null;
|
||||
})) & {
|
||||
})) & ({
|
||||
session?: Session.CreateSingleOperation | Session.UpdateOperation | Session.RemoveOperation;
|
||||
entityId?: never;
|
||||
entity?: never;
|
||||
} | {
|
||||
entity?: ("session" | string) | null;
|
||||
entityId?: ForeignKey<"Session"> | null;
|
||||
}) & {
|
||||
[k: string]: any;
|
||||
};
|
||||
export declare type UpdateOperation = OakOperation<"update" | string, UpdateOperationData, Filter, Sorter>;
|
||||
|
|
@ -147,11 +174,16 @@ export declare type RemoveOperationData = {} & (({
|
|||
user?: User.UpdateOperation | User.RemoveOperation;
|
||||
}) & ({
|
||||
relation?: Relation.UpdateOperation | Relation.RemoveOperation;
|
||||
}));
|
||||
})) & ({
|
||||
session?: Session.UpdateOperation | Session.RemoveOperation;
|
||||
} | {
|
||||
[k: string]: any;
|
||||
});
|
||||
export declare type RemoveOperation = OakOperation<"remove", RemoveOperationData, Filter, Sorter>;
|
||||
export declare type Operation = CreateOperation | UpdateOperation | RemoveOperation;
|
||||
export declare type UserIdSubQuery = Selection<UserIdProjection>;
|
||||
export declare type RelationIdSubQuery = Selection<RelationIdProjection>;
|
||||
export declare type SessionIdSubQuery = Selection<SessionIdProjection>;
|
||||
export declare type UserRelationIdSubQuery = Selection<UserRelationIdProjection>;
|
||||
export declare type EntityDef = {
|
||||
Schema: Schema;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,8 @@ export const desc = {
|
|||
type: "varchar",
|
||||
params: {
|
||||
length: 32
|
||||
}
|
||||
},
|
||||
ref: ["session"]
|
||||
},
|
||||
entityId: {
|
||||
notNull: true,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { String, Datetime, Image, Boolean } from "oak-domain/lib/types/DataType"
|
|||
import { EntityShape } from "oak-domain/lib/types/Entity";
|
||||
import * as User from "../User/Schema";
|
||||
import * as Application from "../Application/Schema";
|
||||
import * as SessionMessage from "../SessionMessage/Schema";
|
||||
import * as ModiEntity from "../ModiEntity/Schema";
|
||||
import * as OperEntity from "../OperEntity/Schema";
|
||||
import * as Token from "../Token/Schema";
|
||||
|
|
@ -48,6 +49,8 @@ export declare type Schema = EntityShape & {
|
|||
avatar?: Image | null;
|
||||
user?: User.Schema | null;
|
||||
application: Application.Schema;
|
||||
sessionMessage$wechatUser?: Array<SessionMessage.Schema>;
|
||||
sessionMessage$wechatUser$$aggr?: AggregationResult<SessionMessage.Schema>;
|
||||
modiEntity$entity?: Array<ModiEntity.Schema>;
|
||||
modiEntity$entity$$aggr?: AggregationResult<ModiEntity.Schema>;
|
||||
operEntity$entity?: Array<OperEntity.Schema>;
|
||||
|
|
@ -80,6 +83,7 @@ declare type AttrFilter = {
|
|||
application: Application.Filter;
|
||||
nickname: Q_StringValue;
|
||||
avatar: Q_StringValue;
|
||||
sessionMessage$wechatUser: SessionMessage.Filter & SubQueryPredicateMetadata;
|
||||
modiEntity$entity: ModiEntity.Filter & SubQueryPredicateMetadata;
|
||||
operEntity$entity: OperEntity.Filter & SubQueryPredicateMetadata;
|
||||
token$entity: Token.Filter & SubQueryPredicateMetadata;
|
||||
|
|
@ -110,6 +114,12 @@ export declare type Projection = {
|
|||
application?: Application.Projection;
|
||||
nickname?: number;
|
||||
avatar?: number;
|
||||
sessionMessage$wechatUser?: SessionMessage.Selection & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
sessionMessage$wechatUser$$aggr?: SessionMessage.Aggregation & {
|
||||
$entity: "sessionMessage";
|
||||
};
|
||||
modiEntity$entity?: ModiEntity.Selection & {
|
||||
$entity: "modiEntity";
|
||||
};
|
||||
|
|
@ -210,6 +220,7 @@ export declare type CreateOperationData = FormCreateData<Omit<OpSchema, "userId"
|
|||
} | {
|
||||
applicationId: ForeignKey<"application">;
|
||||
})) & {
|
||||
sessionMessage$wechatUser?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "wechatUser" | "wechatUserId">, Omit<SessionMessage.Filter, "wechatUser" | "wechatUserId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "wechatUser" | "wechatUserId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "wechatUser" | "wechatUserId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "wechatUser" | "wechatUserId">, Omit<SessionMessage.Filter, "wechatUser" | "wechatUserId">>>;
|
||||
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
||||
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
|
|
@ -243,6 +254,7 @@ export declare type UpdateOperationData = FormUpdateData<Omit<OpSchema, "userId"
|
|||
applicationId?: ForeignKey<"application"> | null;
|
||||
})) & {
|
||||
[k: string]: any;
|
||||
sessionMessage$wechatUser?: OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "wechatUser" | "wechatUserId">, Omit<SessionMessage.Filter, "wechatUser" | "wechatUserId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "wechatUser" | "wechatUserId">, Omit<SessionMessage.Filter, "wechatUser" | "wechatUserId">> | OakOperation<"create", Omit<SessionMessage.CreateOperationData, "wechatUser" | "wechatUserId">[]> | Array<OakOperation<"create", Omit<SessionMessage.CreateOperationData, "wechatUser" | "wechatUserId">> | OakOperation<SessionMessage.UpdateOperation["action"], Omit<SessionMessage.UpdateOperationData, "wechatUser" | "wechatUserId">, Omit<SessionMessage.Filter, "wechatUser" | "wechatUserId">> | OakOperation<SessionMessage.RemoveOperation["action"], Omit<SessionMessage.RemoveOperationData, "wechatUser" | "wechatUserId">, Omit<SessionMessage.Filter, "wechatUser" | "wechatUserId">>>;
|
||||
modiEntity$entity?: OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<ModiEntity.CreateOperationData, "entity" | "entityId">>>;
|
||||
operEntity$entity?: OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<OperEntity.CreateOperationData, "entity" | "entityId">>>;
|
||||
token$entity?: OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">[]> | Array<OakOperation<"create", Omit<Token.CreateOperationData, "entity" | "entityId">> | OakOperation<Token.UpdateOperation["action"], Omit<Token.UpdateOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">> | OakOperation<Token.RemoveOperation["action"], Omit<Token.RemoveOperationData, "entity" | "entityId">, Omit<Token.Filter, "entity" | "entityId">>>;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ import * as Mobile from "./Mobile/Schema";
|
|||
import * as Notification from "./Notification/Schema";
|
||||
import * as Parasite from "./Parasite/Schema";
|
||||
import * as Platform from "./Platform/Schema";
|
||||
import * as Session from "./Session/Schema";
|
||||
import * as SessionMessage from "./SessionMessage/Schema";
|
||||
import * as Station from "./Station/Schema";
|
||||
import * as Subscription from "./Subscription/Schema";
|
||||
import * as Subway from "./Subway/Schema";
|
||||
|
|
@ -109,6 +111,8 @@ export declare type UserIdSubQuery = {
|
|||
entity: "mobile";
|
||||
}) | (Parasite.UserIdSubQuery & {
|
||||
entity: "parasite";
|
||||
}) | (SessionMessage.UserIdSubQuery & {
|
||||
entity: "sessionMessage";
|
||||
}) | (Token.UserIdSubQuery & {
|
||||
entity: "token";
|
||||
}) | (UserEntityGrant.UserIdSubQuery & {
|
||||
|
|
@ -159,6 +163,8 @@ export declare type ApplicationIdSubQuery = {
|
|||
entity: "messageTypeTemplateId";
|
||||
}) | (Notification.ApplicationIdSubQuery & {
|
||||
entity: "notification";
|
||||
}) | (SessionMessage.ApplicationIdSubQuery & {
|
||||
entity: "sessionMessage";
|
||||
}) | (Token.ApplicationIdSubQuery & {
|
||||
entity: "token";
|
||||
}) | (WechatPublicTag.ApplicationIdSubQuery & {
|
||||
|
|
@ -167,6 +173,8 @@ export declare type ApplicationIdSubQuery = {
|
|||
entity: "wechatQrCode";
|
||||
}) | (WechatUser.ApplicationIdSubQuery & {
|
||||
entity: "wechatUser";
|
||||
}) | (Session.ApplicationIdSubQuery & {
|
||||
entity: "session";
|
||||
}) | (Application.ApplicationIdSubQuery & {
|
||||
entity: "application";
|
||||
}) | any;
|
||||
|
|
@ -278,12 +286,34 @@ export declare type ParasiteIdSubQuery = {
|
|||
}) | any;
|
||||
};
|
||||
export declare type PlatformIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (System.PlatformIdSubQuery & {
|
||||
[K in "$in" | "$nin"]?: (Message.PlatformIdSubQuery & {
|
||||
entity: "message";
|
||||
}) | (System.PlatformIdSubQuery & {
|
||||
entity: "system";
|
||||
}) | (Platform.PlatformIdSubQuery & {
|
||||
entity: "platform";
|
||||
}) | any;
|
||||
};
|
||||
export declare type SessionIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (SessionMessage.SessionIdSubQuery & {
|
||||
entity: "sessionMessage";
|
||||
}) | (UserEntityGrant.SessionIdSubQuery & {
|
||||
entity: "userEntityGrant";
|
||||
}) | (Relation.SessionIdSubQuery & {
|
||||
entity: "relation";
|
||||
}) | (UserRelation.SessionIdSubQuery & {
|
||||
entity: "userRelation";
|
||||
}) | (Session.SessionIdSubQuery & {
|
||||
entity: "session";
|
||||
}) | any;
|
||||
};
|
||||
export declare type SessionMessageIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ExtraFile.SessionMessageIdSubQuery & {
|
||||
entity: "extraFile";
|
||||
}) | (SessionMessage.SessionMessageIdSubQuery & {
|
||||
entity: "sessionMessage";
|
||||
}) | any;
|
||||
};
|
||||
export declare type StationIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (SubwayStation.StationIdSubQuery & {
|
||||
entity: "subwayStation";
|
||||
|
|
@ -376,7 +406,9 @@ export declare type WechatQrCodeIdSubQuery = {
|
|||
}) | any;
|
||||
};
|
||||
export declare type WechatUserIdSubQuery = {
|
||||
[K in "$in" | "$nin"]?: (ModiEntity.WechatUserIdSubQuery & {
|
||||
[K in "$in" | "$nin"]?: (SessionMessage.WechatUserIdSubQuery & {
|
||||
entity: "sessionMessage";
|
||||
}) | (ModiEntity.WechatUserIdSubQuery & {
|
||||
entity: "modiEntity";
|
||||
}) | (OperEntity.WechatUserIdSubQuery & {
|
||||
entity: "operEntity";
|
||||
|
|
|
|||
|
|
@ -25,5 +25,5 @@ export default function Render(props) {
|
|||
children: (_jsx(MessageTypeTemplateIdList, { oakAutoUnmount: true, applicationId: oakId, oakPath: `$application-detail-mttId-${oakId}` })),
|
||||
});
|
||||
}
|
||||
return (_jsx(PageHeader, { showBack: true, title: "\u5E94\u7528\u6982\u89C8", children: _jsx("div", { className: Style.container, children: _jsx(Card, { title: name, bordered: false, actions: Actions, children: _jsx(Tabs, { items: items }) }) }) }));
|
||||
return (_jsx(PageHeader, { showBack: true, title: "\u5E94\u7528\u6982\u89C8", children: _jsx("div", { className: Style.container, children: _jsx(Card, { title: name, bordered: false, extra: Actions, children: _jsx(Tabs, { items: items }) }) }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export default OakComponent({
|
||||
isList: true,
|
||||
entity: 'application',
|
||||
actions: ['update', 'remove'],
|
||||
actions: ['update', 'remove', 'create'],
|
||||
projection: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'application', true, {
|
||||
searchValue: string;
|
||||
list: RowWithActions<EntityDict, 'application'>[];
|
||||
pagination: any;
|
||||
showBack: boolean;
|
||||
variant?: 'inline' | 'alone' | 'dialog';
|
||||
}, {
|
||||
goDetail: (id: string) => void;
|
||||
goCreate: () => void;
|
||||
|
|
|
|||
|
|
@ -1,28 +1,26 @@
|
|||
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { Table, Button, Space, Typography } from 'antd';
|
||||
import PageHeader from '../../../components/common/pageHeader';
|
||||
import ActionBtnPanel from 'oak-frontend-base/es/components/actionBtnPanel';
|
||||
import Style from './web.module.less';
|
||||
export default function Render(props) {
|
||||
const { oakPagination, list = [], oakLoading, showBack, variant, oakFullpath, } = props.data;
|
||||
const { oakPagination, list = [], oakLoading, oakFullpath, oakLegalActions, } = props.data;
|
||||
const { pageSize, total, currentPage } = oakPagination || {};
|
||||
const { t, setPageSize, setCurrentPage, goCreate, goDetail, goSetConfig, goUpdate, removeApplication, } = props.methods;
|
||||
return (_jsxs(Container, { variant: variant, children: [_jsx(Space, { children: _jsx(Button, { type: "primary", onClick: () => {
|
||||
return (_jsxs(_Fragment, { children: [oakLegalActions?.includes('create') && (_jsx(Space, { style: { marginBottom: 16 }, children: _jsx(Button, { type: "primary", onClick: () => {
|
||||
goCreate();
|
||||
}, children: "\u6DFB\u52A0\u5E94\u7528" }) }), _jsx(Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
|
||||
// {
|
||||
// dataIndex: 'id',
|
||||
// title: '序号',
|
||||
// render: (value, record, index) => {
|
||||
// return index + 1;
|
||||
// },
|
||||
// },
|
||||
}, children: "\u6DFB\u52A0\u5E94\u7528" }) })), _jsx(Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
|
||||
{
|
||||
dataIndex: 'id',
|
||||
title: '#',
|
||||
render: (value, record, index) => {
|
||||
return index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'name',
|
||||
title: '应用名称',
|
||||
width: 300,
|
||||
render: (value, record, index) => {
|
||||
return (_jsx(Typography.Link, { onClick: () => {
|
||||
return (_jsx(Typography.Link, { disabled: !record?.['#oakLegalActions']?.includes('update'), onClick: () => {
|
||||
goDetail(record.id);
|
||||
}, children: value }));
|
||||
},
|
||||
|
|
@ -45,7 +43,7 @@ export default function Render(props) {
|
|||
title: '应用配置',
|
||||
align: 'center',
|
||||
render: (value, record, index) => {
|
||||
return (_jsx(_Fragment, { children: _jsx(Button, { type: "link", onClick: () => {
|
||||
return (_jsx(_Fragment, { children: _jsx(Button, { type: "link", disabled: !record?.['#oakLegalActions']?.includes('update'), onClick: () => {
|
||||
goSetConfig(record.id);
|
||||
}, children: "\u914D\u7F6E" }) }));
|
||||
},
|
||||
|
|
@ -94,10 +92,3 @@ export default function Render(props) {
|
|||
},
|
||||
} })] }));
|
||||
}
|
||||
function Container(props) {
|
||||
const { children, variant = 'alone', showBack } = props;
|
||||
if (['inline', 'dialog'].includes(variant)) {
|
||||
return _jsx(_Fragment, { children: children });
|
||||
}
|
||||
return (_jsx(PageHeader, { showBack: showBack, title: "\u5E94\u7528\u7BA1\u7406", children: _jsx("div", { className: Style.container, children: children }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export default OakComponent({
|
||||
isList: true,
|
||||
entity: 'domain',
|
||||
actions: ['update'],
|
||||
actions: ['update', 'create'],
|
||||
projection: {
|
||||
id: 1,
|
||||
systemId: 1,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'domain', true, {
|
||||
searchValue: string;
|
||||
list: RowWithActions<EntityDict, 'domain'>[];
|
||||
pagination: any;
|
||||
showBack: boolean;
|
||||
variant?: 'inline' | 'alone' | 'dialog';
|
||||
}, {
|
||||
goDetail: (id: string) => void;
|
||||
goCreate: () => void;
|
||||
|
|
|
|||
|
|
@ -1,27 +1,25 @@
|
|||
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
||||
import { Table, Button, Space, Typography } from 'antd';
|
||||
import PageHeader from '../../../components/common/pageHeader';
|
||||
import ActionBtnPanel from 'oak-frontend-base/es/components/actionBtnPanel';
|
||||
import Style from './web.module.less';
|
||||
export default function Render(props) {
|
||||
const { oakPagination, list = [], oakLoading, showBack, variant, oakFullpath, } = props.data;
|
||||
const { oakPagination, list = [], oakLoading, oakFullpath, oakLegalActions, } = props.data;
|
||||
const { pageSize, total, currentPage } = oakPagination || {};
|
||||
const { t, setPageSize, setCurrentPage, goCreate, goDetail, goUpdate, } = props.methods;
|
||||
return (_jsxs(Container, { showBack: showBack, variant: variant, children: [_jsx(Space, { children: _jsx(Button, { type: "primary", onClick: () => {
|
||||
return (_jsxs(_Fragment, { children: [oakLegalActions?.includes('create') && (_jsx(Space, { style: { marginBottom: 16 }, children: _jsx(Button, { type: "primary", onClick: () => {
|
||||
goCreate();
|
||||
}, children: "\u6DFB\u52A0\u57DF\u540D" }) }), _jsx(Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
|
||||
// {
|
||||
// dataIndex: 'id',
|
||||
// title: '序号',
|
||||
// render: (value, record, index) => {
|
||||
// return index + 1;
|
||||
// },
|
||||
// },
|
||||
}, children: "\u6DFB\u52A0\u57DF\u540D" }) })), _jsx(Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
|
||||
{
|
||||
dataIndex: 'id',
|
||||
title: '#',
|
||||
render: (value, record, index) => {
|
||||
return index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'url',
|
||||
title: '域名',
|
||||
render: (value, record, index) => {
|
||||
return (_jsx(Typography.Link, { onClick: () => {
|
||||
return (_jsx(Typography.Link, { disabled: !record?.['#oakLegalActions']?.includes('update'), onClick: () => {
|
||||
goDetail(record.id);
|
||||
}, children: value }));
|
||||
},
|
||||
|
|
@ -74,10 +72,3 @@ export default function Render(props) {
|
|||
},
|
||||
} })] }));
|
||||
}
|
||||
function Container(props) {
|
||||
const { children, variant = 'alone', showBack } = props;
|
||||
if (['inline', 'dialog'].includes(variant)) {
|
||||
return _jsx(_Fragment, { children: children });
|
||||
}
|
||||
return (_jsx(PageHeader, { showBack: showBack, title: "\u7CFB\u7EDF\u7BA1\u7406", children: _jsx("div", { className: Style.container, children: children }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +0,0 @@
|
|||
{
|
||||
"navigationBarTitleText": "消息",
|
||||
"enablePullDownRefresh": false
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import Style from './web.module.less';
|
||||
import MessageCell from '../../../components/message/cell';
|
||||
import Empty from '../../../components/common/empty';
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { messages, open, onClose, oakFullpath } = data;
|
||||
const { goDetailById, goMessageList } = methods;
|
||||
// return (
|
||||
// <Drawer
|
||||
// title="消息"
|
||||
// placement="right"
|
||||
// onClose={onClose}
|
||||
// open={open}
|
||||
// extra={
|
||||
// <Space>
|
||||
// <Button
|
||||
// size="small"
|
||||
// type="text"
|
||||
// onClick={() => {
|
||||
// onClose && onClose();
|
||||
// goMessageList();
|
||||
// }}
|
||||
// >
|
||||
// 查看更多
|
||||
// </Button>
|
||||
// </Space>
|
||||
// }
|
||||
// bodyStyle={{
|
||||
// padding: 0,
|
||||
// }}
|
||||
// destroyOnClose={true}
|
||||
// >
|
||||
// <div className={Style.container}>
|
||||
// {messages?.length > 0 ? (
|
||||
// <div>
|
||||
// {messages?.map((message, index: number) => (
|
||||
// <MessageCell
|
||||
// oakId={message.id}
|
||||
// key={message.id}
|
||||
// oakPath={
|
||||
// oakFullpath
|
||||
// ? `${oakFullpath}.${message.id}`
|
||||
// : ''
|
||||
// }
|
||||
// onItemClicked={(item: {
|
||||
// id: string;
|
||||
// }) => {
|
||||
// const { id } = item;
|
||||
// onClose && onClose();
|
||||
// goDetailById(id);
|
||||
// }}
|
||||
// />
|
||||
// ))}
|
||||
// </div>
|
||||
// ) : (
|
||||
// <div className={Style.noData}>
|
||||
// <Empty
|
||||
// description="暂无消息"
|
||||
// image={Empty.PRESENTED_IMAGE_SIMPLE}
|
||||
// ></Empty>
|
||||
// </div>
|
||||
// )}
|
||||
// </div>
|
||||
// </Drawer>
|
||||
// );
|
||||
return (_jsx("div", { className: Style.container, children: messages?.length > 0 ? (_jsx("div", { children: messages?.map((message, index) => (_jsx(MessageCell, { oakId: message.id, oakPath: oakFullpath
|
||||
? `${oakFullpath}.${message.id}`
|
||||
: '', onItemClicked: (item) => {
|
||||
const { id } = item;
|
||||
onClose && onClose();
|
||||
goDetailById(id);
|
||||
} }, message.id))) })) : (_jsx("div", { className: Style.noData, children: _jsx(Empty, { description: "\u6682\u65E0\u6D88\u606F", image: Empty.PRESENTED_IMAGE_SIMPLE }) })) }));
|
||||
}
|
||||
|
|
@ -4,10 +4,6 @@ import dayjs from 'dayjs';
|
|||
import Style from './web.module.less';
|
||||
import PageHeader from '../../../components/common/pageHeader';
|
||||
import ActionBtnPanel from 'oak-frontend-base/es/components/actionBtnPanel';
|
||||
const MessageType = {
|
||||
adminNotification: '系统通知',
|
||||
conversationMessage: '客服消息',
|
||||
};
|
||||
export default function Render(props) {
|
||||
const { data, methods } = props;
|
||||
const { t, setPageSize, setCurrentPage, goDetailById } = methods;
|
||||
|
|
@ -16,13 +12,13 @@ export default function Render(props) {
|
|||
return (_jsx(PageHeader, { title: "\u6D88\u606F\u901A\u77E5", children: _jsx("div", { className: Style.container, children: _jsx(Table, { loading: oakLoading, dataSource: messages || [], rowKey: "id",
|
||||
// scroll={{ x: 1200 }}
|
||||
columns: [
|
||||
// {
|
||||
// dataIndex: 'serial-number',
|
||||
// title: '序号',
|
||||
// render: (value, record, index) => {
|
||||
// return index + 1;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
dataIndex: 'serial-number',
|
||||
title: '#',
|
||||
render: (value, record, index) => {
|
||||
return index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'title',
|
||||
title: '消息内容',
|
||||
|
|
@ -41,7 +37,7 @@ export default function Render(props) {
|
|||
dataIndex: 'type',
|
||||
title: '类型',
|
||||
render: (value, record, index) => {
|
||||
return MessageType[value];
|
||||
return '';
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ export default OakComponent({
|
|||
},
|
||||
goAddMobile() {
|
||||
const eventLoggedIn = `mobile:me:login:${Date.now()}`;
|
||||
this.sub(eventLoggedIn, () => {
|
||||
this.subEvent(eventLoggedIn, () => {
|
||||
this.navigateBack();
|
||||
});
|
||||
this.navigateTo({
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export default function Render(props) {
|
|||
{
|
||||
label: '系统管理',
|
||||
key: 'system_list',
|
||||
children: (_jsx(SystemList, { platformId: oakId, variant: "inline", oakPath: "$platform/detail/-system/list", oakAutoUnmount: true })),
|
||||
children: (_jsx(SystemList, { platformId: oakId, oakPath: "$platform/detail/-system/list", oakAutoUnmount: true })),
|
||||
},
|
||||
] }) }) }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export default OakComponent({
|
||||
isList: true,
|
||||
entity: 'platform',
|
||||
actions: ['update'],
|
||||
actions: ['update', 'create'],
|
||||
projection: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'platform', true, {
|
||||
searchValue: string;
|
||||
list: RowWithActions<EntityDict, 'platform'>[];
|
||||
pagination: any;
|
||||
showBack: boolean;
|
||||
variant?: 'inline' | 'alone' | 'dialog';
|
||||
}, {
|
||||
goDetail: (id: string) => void;
|
||||
goCreate: () => void;
|
||||
|
|
|
|||
|
|
@ -5,25 +5,25 @@ import ActionBtnPanel from 'oak-frontend-base/es/components/actionBtnPanel';
|
|||
import Style from './web.module.less';
|
||||
import dayjs from 'dayjs';
|
||||
export default function Render(props) {
|
||||
const { oakPagination, list = [], oakLoading, showBack, variant, oakFullpath, } = props.data;
|
||||
const { oakPagination, list = [], oakLoading, oakFullpath, oakLegalActions } = props.data;
|
||||
const { pageSize, total, currentPage } = oakPagination || {};
|
||||
const { t, setPageSize, setCurrentPage, goCreate, goDetail, goSetConfig, goUpdate, } = props.methods;
|
||||
return (_jsx(PageHeader, { title: "\u5E73\u53F0\u7BA1\u7406", children: _jsxs("div", { className: Style.container, children: [_jsx(Space, { style: { marginBottom: 16 }, children: _jsx(Button, { type: "primary", onClick: () => {
|
||||
return (_jsx(PageHeader, { title: "\u5E73\u53F0\u7BA1\u7406", children: _jsxs("div", { className: Style.container, children: [oakLegalActions?.includes('create') && (_jsx(Space, { style: { marginBottom: 16 }, children: _jsx(Button, { type: "primary", onClick: () => {
|
||||
goCreate();
|
||||
}, children: "\u6DFB\u52A0\u5E73\u53F0" }) }), _jsx(Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
|
||||
// {
|
||||
// dataIndex: 'id',
|
||||
// title: '序号',
|
||||
// render: (value, record, index) => {
|
||||
// return index + 1;
|
||||
// },
|
||||
// },
|
||||
}, children: "\u6DFB\u52A0\u5E73\u53F0" }) })), _jsx(Table, { loading: oakLoading, dataSource: list, rowKey: "id", columns: [
|
||||
{
|
||||
dataIndex: 'id',
|
||||
title: '#',
|
||||
render: (value, record, index) => {
|
||||
return index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
dataIndex: 'name',
|
||||
title: '平台名称',
|
||||
width: 300,
|
||||
render: (value, record, index) => {
|
||||
return (_jsx(Typography.Link, { onClick: () => {
|
||||
return (_jsx(Typography.Link, { disabled: !record?.['#oakLegalActions']?.includes('update'), onClick: () => {
|
||||
goDetail(record.id);
|
||||
}, children: value }));
|
||||
},
|
||||
|
|
@ -47,7 +47,7 @@ export default function Render(props) {
|
|||
title: '配置',
|
||||
align: 'center',
|
||||
render: (value, record, index) => {
|
||||
return (_jsx(_Fragment, { children: _jsx(Button, { type: "link", onClick: () => {
|
||||
return (_jsx(_Fragment, { children: _jsx(Button, { type: "link", disabled: !record?.['#oakLegalActions']?.includes('update'), onClick: () => {
|
||||
goSetConfig(record.id);
|
||||
}, children: "\u914D\u7F6E" }) }));
|
||||
},
|
||||
|
|
|
|||
|
|
@ -19,12 +19,12 @@ export default function Render(props) {
|
|||
{
|
||||
label: '应用管理',
|
||||
key: 'application_list',
|
||||
children: (_jsx(ApplicationList, { systemId: oakId, variant: "inline", oakPath: "$system/detail-application/list", oakAutoUnmount: true })),
|
||||
children: (_jsx(ApplicationList, { systemId: oakId, oakPath: "$system/detail-application/list", oakAutoUnmount: true })),
|
||||
},
|
||||
{
|
||||
label: '域名管理',
|
||||
key: 'domain_list',
|
||||
children: (_jsx(DomainList, { systemId: oakId, variant: "inline", oakPath: "$system/detail-domain/list", oakAutoUnmount: true })),
|
||||
children: (_jsx(DomainList, { systemId: oakId, oakPath: "$system/detail-domain/list", oakAutoUnmount: true })),
|
||||
},
|
||||
] }) }) }) }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
export default OakComponent({
|
||||
isList: true,
|
||||
entity: 'system',
|
||||
actions: ['update'],
|
||||
actions: ['update', 'create'],
|
||||
projection: {
|
||||
id: 1,
|
||||
name: 1,
|
||||
|
|
|
|||
|
|
@ -1,11 +1,7 @@
|
|||
import { EntityDict } from '../../../oak-app-domain';
|
||||
import { WebComponentProps, RowWithActions } from 'oak-frontend-base';
|
||||
export default function Render(props: WebComponentProps<EntityDict, 'system', true, {
|
||||
searchValue: string;
|
||||
list: RowWithActions<EntityDict, 'system'>[];
|
||||
pagination: any;
|
||||
showBack: boolean;
|
||||
variant?: 'inline' | 'alone' | 'dialog';
|
||||
}, {
|
||||
goDetail: (id: string) => void;
|
||||
goCreate: () => void;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue