From 026bdfcb52d0d581c4375ce092b28e0657b873c4 Mon Sep 17 00:00:00 2001 From: Xc Date: Wed, 6 Sep 2023 22:33:43 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=AE=9A=E4=B9=89=E4=BA=86uploader?= =?UTF-8?q?=E7=9A=84=E5=BD=A2=E7=8A=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/components/amap/location/index.d.ts | 2 +- lib/components/amap/map/index.d.ts | 2 +- lib/components/article/cell/web.d.ts | 2 +- lib/components/article/detail/web.d.ts | 2 +- lib/components/article/preview/web.d.ts | 2 +- lib/components/article/treeList/web.pc.d.ts | 2 +- lib/components/article/upsert/web.d.ts | 2 +- .../articleMenu/treeCell/web.pc.d.ts | 2 +- .../articleMenu/treeList/web.pc.d.ts | 2 +- .../articleMenu/treeManager/web.pc.d.ts | 2 +- .../changePassword/byMobile/web.d.ts | 2 +- .../changePassword/byPassword/web.d.ts | 2 +- lib/components/changePassword/web.d.ts | 2 +- lib/components/common/download/index.d.ts | 2 +- lib/components/common/empty/empty.d.ts | 2 +- lib/components/common/empty/simple.d.ts | 2 +- lib/components/common/errorPage/web.d.ts | 2 +- lib/components/common/grid/index.d.ts | 2 +- lib/components/common/pageHeader/index.d.ts | 2 +- lib/components/common/qrCode/index.d.ts | 2 +- lib/components/common/result/fail/index.d.ts | 2 +- .../common/result/success/index.d.ts | 2 +- .../common/weChatLoginGrant/index.d.ts | 2 +- .../common/weChatLoginQrCode/index.d.ts | 2 +- lib/components/config/application/web.pc.d.ts | 2 +- .../config/application/web/index.d.ts | 2 +- .../config/application/wechatMp/index.d.ts | 2 +- .../application/wechatPublic/index.d.ts | 2 +- lib/components/config/style/index.d.ts | 2 +- .../config/upsert/account/index.d.ts | 2 +- lib/components/config/upsert/cos/index.d.ts | 2 +- lib/components/config/upsert/live/index.d.ts | 2 +- lib/components/config/upsert/map/index.d.ts | 2 +- lib/components/config/upsert/sms/index.d.ts | 2 +- lib/components/config/upsert/web.pc.d.ts | 2 +- lib/components/extraFile/avatar/web.d.ts | 2 +- lib/components/extraFile/display/web.d.ts | 2 +- lib/components/extraFile/forUrl/web.d.ts | 2 +- lib/components/extraFile/gallery/web.d.ts | 2 +- lib/components/func/actionPanel/web.d.ts | 2 +- lib/components/func/debugPanel/web.d.ts | 2 +- lib/components/icon/web.d.ts | 2 +- lib/components/message/cell/web.d.ts | 2 +- lib/components/message/detail/web.d.ts | 2 +- lib/components/message/detail/web.pc.d.ts | 2 +- lib/components/message/list/web.d.ts | 2 +- lib/components/message/list/web.pc.d.ts | 2 +- lib/components/message/web.d.ts | 2 +- .../messageTypeTemplateId/list/web.pc.d.ts | 2 +- lib/components/my/avatar/web.d.ts | 2 +- lib/components/my/info/web.d.ts | 2 +- lib/components/my/info/web.pc.d.ts | 2 +- lib/components/my/message/web.d.ts | 2 +- lib/components/my/message/web.pc.d.ts | 2 +- lib/components/parasite/detail/web.d.ts | 2 +- lib/components/parasite/excess/web.d.ts | 2 +- lib/components/parasite/list/web.d.ts | 2 +- lib/components/parasite/upsert/web.d.ts | 2 +- lib/components/subwayLine/list/web.d.ts | 2 +- lib/components/theme/setting/RadioColor.d.ts | 2 +- lib/components/theme/setting/RadioRect.d.ts | 2 +- lib/components/theme/setting/index.d.ts | 2 +- lib/components/user/login/web.d.ts | 2 +- lib/components/userRelation/list/web.d.ts | 2 +- lib/components/userRelation/list/web.pc.d.ts | 2 +- lib/components/userRelation/onEntity/web.d.ts | 2 +- .../userRelation/upsert/byMobile/web.d.ts | 2 +- .../userRelation/upsert/byMobile/web.pc.d.ts | 2 +- .../userRelation/upsert/byUser/web.d.ts | 2 +- .../userRelation/upsert/byUser/web.pc.d.ts | 2 +- .../upsert/byUserEntityGrant/web.d.ts | 2 +- .../upsert/byUserEntityGrant/web.pc.d.ts | 2 +- .../upsert/onUser/userRelation/web.d.ts | 2 +- .../upsert/onUser/userRelation/web.pc.d.ts | 2 +- .../userRelation/upsert/onUser/web.d.ts | 2 +- .../userRelation/upsert/onUser/web.pc.d.ts | 2 +- .../userRelation/upsert/web.pc.d.ts | 2 +- lib/components/wechatLogin/qrCode/web.d.ts | 2 +- .../wechatUser/bindingList/web.d.ts | 2 +- lib/components/wechatUser/unbindBtn/web.d.ts | 2 +- lib/entities/ExtraFile.d.ts | 1 + lib/entities/ExtraFile.js | 1 + lib/index.d.ts | 1 + lib/index.js | 4 +- lib/oak-app-domain/ExtraFile/Schema.d.ts | 4 ++ lib/oak-app-domain/ExtraFile/Storage.js | 3 ++ .../ExtraFile/locales/zh_CN.json | 2 +- lib/pages/address/list/web.d.ts | 2 +- lib/pages/address/upsert/web.d.ts | 2 +- .../application/config/upsert/web.pc.d.ts | 2 +- lib/pages/application/detail/web.d.ts | 2 +- lib/pages/application/list/web.pc.d.ts | 2 +- lib/pages/application/upsert/web.pc.d.ts | 2 +- lib/pages/changePassword/web.d.ts | 2 +- lib/pages/changePassword/web.pc.d.ts | 2 +- lib/pages/domain/detail/web.d.ts | 2 +- lib/pages/domain/list/web.pc.d.ts | 2 +- lib/pages/domain/upsert/web.pc.d.ts | 2 +- lib/pages/icon/web.d.ts | 2 +- lib/pages/message/detail/web.d.ts | 2 +- lib/pages/message/detail/web.pc.d.ts | 2 +- lib/pages/message/drawerList/web.d.ts | 2 +- lib/pages/message/list/web.d.ts | 2 +- lib/pages/message/list/web.pc.d.ts | 2 +- lib/pages/mobile/login/web.d.ts | 2 +- lib/pages/mobile/login/web.pc.d.ts | 2 +- lib/pages/mobile/me/web.d.ts | 2 +- lib/pages/mobile/me/web.pc.d.ts | 2 +- lib/pages/paper/detail/web.d.ts | 2 +- lib/pages/paper/list/web.d.ts | 2 +- lib/pages/paper/preview/web.d.ts | 2 +- lib/pages/paper/upsert/web.d.ts | 2 +- lib/pages/personal/web.d.ts | 2 +- lib/pages/personal/web.pc.d.ts | 2 +- lib/pages/pickers/area/web.d.ts | 2 +- lib/pages/platform/config/upsert/web.pc.d.ts | 2 +- lib/pages/platform/detail/web.d.ts | 2 +- lib/pages/platform/list/web.pc.d.ts | 2 +- lib/pages/platform/upsert/web.pc.d.ts | 2 +- lib/pages/setting/web.d.ts | 2 +- lib/pages/setting/web.pc.d.ts | 2 +- .../subscription/config/upsert/web.pc.d.ts | 2 +- lib/pages/subscription/detail/web.d.ts | 2 +- lib/pages/subscription/list/web.pc.d.ts | 2 +- lib/pages/subscription/upsert/web.pc.d.ts | 2 +- lib/pages/subwayLine/list/web.d.ts | 2 +- lib/pages/subwayLine/upsertStation/web.d.ts | 2 +- lib/pages/subwayLine/upsertSubway/web.d.ts | 2 +- lib/pages/system/config/upsert/web.pc.d.ts | 2 +- lib/pages/system/detail/web.d.ts | 2 +- lib/pages/system/list/web.pc.d.ts | 2 +- lib/pages/system/upsert/web.pc.d.ts | 2 +- lib/pages/token/me/web.d.ts | 2 +- lib/pages/user/info/web.d.ts | 2 +- lib/pages/user/info/web.pc.d.ts | 2 +- lib/pages/user/manage/detail/web.d.ts | 2 +- lib/pages/user/manage/upsert/web.d.ts | 2 +- lib/pages/user/manage/web.d.ts | 2 +- lib/pages/user/manage/web.pc.d.ts | 2 +- lib/pages/user/search/web.d.ts | 2 +- lib/pages/userEntityGrant/confirm/web.d.ts | 2 +- lib/pages/userEntityGrant/detail/web.d.ts | 2 +- lib/pages/userEntityGrant/detail/web.pc.d.ts | 2 +- lib/pages/userEntityGrant/grant/web.d.ts | 2 +- lib/pages/userEntityGrant/list/web.d.ts | 2 +- lib/pages/wechatLogin/confirm/web.d.ts | 2 +- lib/pages/wechatPublic/tag/list/web.pc.d.ts | 2 +- lib/pages/wechatPublic/tag/upsert/web.d.ts | 2 +- lib/pages/wechatQrCode/scan/web.d.ts | 2 +- lib/pages/wechatUser/login/web.d.ts | 2 +- lib/triggers/extraFile.d.ts | 5 ++ lib/triggers/extraFile.js | 52 +++++++++++++++++++ lib/triggers/index.d.ts | 2 +- lib/triggers/index.js | 3 +- lib/types/Uploader.d.ts | 21 ++++++++ lib/types/Uploader.js | 2 + lib/utils/uploader/index.d.ts | 12 +++++ lib/utils/uploader/index.js | 20 +++++++ lib/utils/uploader/qiniu.d.ts | 10 ++++ lib/utils/uploader/qiniu.js | 25 +++++++++ src/entities/ExtraFile.ts | 2 + src/index.ts | 1 + src/oak-app-domain/ExtraFile/Schema.ts | 4 ++ src/oak-app-domain/ExtraFile/Storage.ts | 3 ++ .../ExtraFile/locales/zh_CN.json | 2 +- src/triggers/extraFile.ts | 37 +++++++++++++ src/triggers/index.ts | 2 + src/types/Uploader.ts | 24 +++++++++ src/utils/uploader/index.ts | 24 +++++++++ src/utils/uploader/qiniu.ts | 18 +++++++ 170 files changed, 423 insertions(+), 148 deletions(-) create mode 100644 lib/triggers/extraFile.d.ts create mode 100644 lib/triggers/extraFile.js create mode 100644 lib/types/Uploader.d.ts create mode 100644 lib/types/Uploader.js create mode 100644 lib/utils/uploader/index.d.ts create mode 100644 lib/utils/uploader/index.js create mode 100644 lib/utils/uploader/qiniu.d.ts create mode 100644 lib/utils/uploader/qiniu.js create mode 100644 src/triggers/extraFile.ts create mode 100644 src/types/Uploader.ts create mode 100644 src/utils/uploader/index.ts create mode 100644 src/utils/uploader/qiniu.ts diff --git a/lib/components/amap/location/index.d.ts b/lib/components/amap/location/index.d.ts index c449bb837..433c215f6 100644 --- a/lib/components/amap/location/index.d.ts +++ b/lib/components/amap/location/index.d.ts @@ -37,5 +37,5 @@ export declare type Poi = { email?: string; businessArea?: string; }; -declare const Location: (props: LocationProps) => import("react/jsx-runtime").JSX.Element; +declare const Location: (props: LocationProps) => JSX.Element; export default Location; diff --git a/lib/components/amap/map/index.d.ts b/lib/components/amap/map/index.d.ts index b95ddd7d2..9e454bc08 100644 --- a/lib/components/amap/map/index.d.ts +++ b/lib/components/amap/map/index.d.ts @@ -29,5 +29,5 @@ export interface AMapProps extends APILoaderProps { securityJsCode?: string; serviceHost?: string; } -declare const memo: (props: AMapProps) => import("react/jsx-runtime").JSX.Element; +declare const memo: (props: AMapProps) => JSX.Element; export default memo; diff --git a/lib/components/article/cell/web.d.ts b/lib/components/article/cell/web.d.ts index fae9cd1d7..3a4446aca 100644 --- a/lib/components/article/cell/web.d.ts +++ b/lib/components/article/cell/web.d.ts @@ -7,4 +7,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/article/detail/web.d.ts b/lib/components/article/detail/web.d.ts index a69ec6234..01b65b185 100644 --- a/lib/components/article/detail/web.d.ts +++ b/lib/components/article/detail/web.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/article/preview/web.d.ts b/lib/components/article/preview/web.d.ts index a69ec6234..01b65b185 100644 --- a/lib/components/article/preview/web.d.ts +++ b/lib/components/article/preview/web.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/article/treeList/web.pc.d.ts b/lib/components/article/treeList/web.pc.d.ts index 393505f51..19817c918 100644 --- a/lib/components/article/treeList/web.pc.d.ts +++ b/lib/components/article/treeList/web.pc.d.ts @@ -19,4 +19,4 @@ export default function Render(props: WebComponentProps void; }, { createOne: () => Promise; -}>): import("react/jsx-runtime").JSX.Element | null; +}>): JSX.Element | null; diff --git a/lib/components/article/upsert/web.d.ts b/lib/components/article/upsert/web.d.ts index e88308d2e..9bff015ce 100644 --- a/lib/components/article/upsert/web.d.ts +++ b/lib/components/article/upsert/web.d.ts @@ -26,4 +26,4 @@ export default function Render(props: WebComponentProps; clearContentTip: () => void; gotoPreview: (content?: string, title?: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/articleMenu/treeCell/web.pc.d.ts b/lib/components/articleMenu/treeCell/web.pc.d.ts index 7d1653337..a6723e84c 100644 --- a/lib/components/articleMenu/treeCell/web.pc.d.ts +++ b/lib/components/articleMenu/treeCell/web.pc.d.ts @@ -34,4 +34,4 @@ export default function Render(props: WebComponentProps Promise; createSubArticleMenu: (name: string) => Promise; gotoDoc: (articleMenuId: string) => void; -}>): import("react/jsx-runtime").JSX.Element | null; +}>): JSX.Element | null; diff --git a/lib/components/articleMenu/treeList/web.pc.d.ts b/lib/components/articleMenu/treeList/web.pc.d.ts index 3544b2e18..1b718e162 100644 --- a/lib/components/articleMenu/treeList/web.pc.d.ts +++ b/lib/components/articleMenu/treeList/web.pc.d.ts @@ -33,4 +33,4 @@ export default function Render(props: WebComponentProps Promise; getDefaultArticle: (rows: EntityDict['articleMenu']['OpSchema'][]) => void; getSearchArticle: () => Promise; -}>): import("react/jsx-runtime").JSX.Element | null; +}>): JSX.Element | null; diff --git a/lib/components/articleMenu/treeManager/web.pc.d.ts b/lib/components/articleMenu/treeManager/web.pc.d.ts index f4e014de1..75c1615e4 100644 --- a/lib/components/articleMenu/treeManager/web.pc.d.ts +++ b/lib/components/articleMenu/treeManager/web.pc.d.ts @@ -14,4 +14,4 @@ export default function Render(props: WebComponentProps void; getArticleMenuIdByArticle: (articleId: string, type: string) => void; gotoSearchArticleAndArticleMenu: (articleMenuId: string, articleId: string) => void; -}>): import("react/jsx-runtime").JSX.Element | null; +}>): JSX.Element | null; diff --git a/lib/components/changePassword/byMobile/web.d.ts b/lib/components/changePassword/byMobile/web.d.ts index 4db80166f..30ac7e1f5 100644 --- a/lib/components/changePassword/byMobile/web.d.ts +++ b/lib/components/changePassword/byMobile/web.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; sendCaptcha: (mobile: string) => Promise; onConfirmByMobile: (mobile: string, captcha: string, newPassword: string) => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/changePassword/byPassword/web.d.ts b/lib/components/changePassword/byPassword/web.d.ts index 05cee5d4f..7d7d891f6 100644 --- a/lib/components/changePassword/byPassword/web.d.ts +++ b/lib/components/changePassword/byPassword/web.d.ts @@ -5,4 +5,4 @@ export default function Render(props: WebComponentProps Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/changePassword/web.d.ts b/lib/components/changePassword/web.d.ts index f57472239..866b26fa8 100644 --- a/lib/components/changePassword/web.d.ts +++ b/lib/components/changePassword/web.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/common/download/index.d.ts b/lib/components/common/download/index.d.ts index 1523cc9b8..26a2c908d 100644 --- a/lib/components/common/download/index.d.ts +++ b/lib/components/common/download/index.d.ts @@ -7,7 +7,7 @@ declare type IDownloadProps = { style?: React.CSSProperties; filename?: string; }; -declare function Download(props: IDownloadProps): import("react/jsx-runtime").JSX.Element; +declare function Download(props: IDownloadProps): JSX.Element; declare namespace Download { var onDownload: (arrayBuffer: ArrayBuffer, filename: string) => void; var base64ToBlob: (base64String: string) => Blob; diff --git a/lib/components/common/empty/empty.d.ts b/lib/components/common/empty/empty.d.ts index a2511328e..5ad33b8bc 100644 --- a/lib/components/common/empty/empty.d.ts +++ b/lib/components/common/empty/empty.d.ts @@ -1,3 +1,3 @@ import './index.less'; -declare const Empty: () => import("react/jsx-runtime").JSX.Element; +declare const Empty: () => JSX.Element; export default Empty; diff --git a/lib/components/common/empty/simple.d.ts b/lib/components/common/empty/simple.d.ts index a2511328e..5ad33b8bc 100644 --- a/lib/components/common/empty/simple.d.ts +++ b/lib/components/common/empty/simple.d.ts @@ -1,3 +1,3 @@ import './index.less'; -declare const Empty: () => import("react/jsx-runtime").JSX.Element; +declare const Empty: () => JSX.Element; export default Empty; diff --git a/lib/components/common/errorPage/web.d.ts b/lib/components/common/errorPage/web.d.ts index ebd3ddf61..7248dae40 100644 --- a/lib/components/common/errorPage/web.d.ts +++ b/lib/components/common/errorPage/web.d.ts @@ -15,5 +15,5 @@ interface IErrorPageProps { children?: React.ReactNode; icon?: React.ReactNode; } -declare function ErrorPage(props: IErrorPageProps): import("react/jsx-runtime").JSX.Element; +declare function ErrorPage(props: IErrorPageProps): JSX.Element; export default ErrorPage; diff --git a/lib/components/common/grid/index.d.ts b/lib/components/common/grid/index.d.ts index d88319bef..b0a44f1a2 100644 --- a/lib/components/common/grid/index.d.ts +++ b/lib/components/common/grid/index.d.ts @@ -15,5 +15,5 @@ declare type GridProps = { list: Array; onChange?: (index: number, event?: React.MouseEvent) => void; }; -declare const _default: React.MemoExoticComponent<(props: GridProps) => import("react/jsx-runtime").JSX.Element>; +declare const _default: React.MemoExoticComponent<(props: GridProps) => JSX.Element>; export default _default; diff --git a/lib/components/common/pageHeader/index.d.ts b/lib/components/common/pageHeader/index.d.ts index 9c10ae4ed..6e311de0b 100644 --- a/lib/components/common/pageHeader/index.d.ts +++ b/lib/components/common/pageHeader/index.d.ts @@ -17,5 +17,5 @@ declare type PageHeaderProps = { children?: React.ReactNode; showHeader?: boolean; }; -declare const _default: React.MemoExoticComponent<(props: PageHeaderProps) => import("react/jsx-runtime").JSX.Element>; +declare const _default: React.MemoExoticComponent<(props: PageHeaderProps) => JSX.Element>; export default _default; diff --git a/lib/components/common/qrCode/index.d.ts b/lib/components/common/qrCode/index.d.ts index 0d392c9cc..f7466976a 100644 --- a/lib/components/common/qrCode/index.d.ts +++ b/lib/components/common/qrCode/index.d.ts @@ -14,5 +14,5 @@ declare type IQrCodeProps = { successed?: boolean; type?: EntityDict['wechatLogin']['Schema']['type']; }; -declare function QrCode(props: IQrCodeProps): import("react/jsx-runtime").JSX.Element; +declare function QrCode(props: IQrCodeProps): JSX.Element; export default QrCode; diff --git a/lib/components/common/result/fail/index.d.ts b/lib/components/common/result/fail/index.d.ts index a6297a1a2..c6fa58026 100644 --- a/lib/components/common/result/fail/index.d.ts +++ b/lib/components/common/result/fail/index.d.ts @@ -5,5 +5,5 @@ declare type Props = { description?: string; children?: React.ReactNode; }; -declare const _default: React.MemoExoticComponent<(props: Props) => import("react/jsx-runtime").JSX.Element>; +declare const _default: React.MemoExoticComponent<(props: Props) => JSX.Element>; export default _default; diff --git a/lib/components/common/result/success/index.d.ts b/lib/components/common/result/success/index.d.ts index a6297a1a2..c6fa58026 100644 --- a/lib/components/common/result/success/index.d.ts +++ b/lib/components/common/result/success/index.d.ts @@ -5,5 +5,5 @@ declare type Props = { description?: string; children?: React.ReactNode; }; -declare const _default: React.MemoExoticComponent<(props: Props) => import("react/jsx-runtime").JSX.Element>; +declare const _default: React.MemoExoticComponent<(props: Props) => JSX.Element>; export default _default; diff --git a/lib/components/common/weChatLoginGrant/index.d.ts b/lib/components/common/weChatLoginGrant/index.d.ts index 9e05b87a9..8caff8afb 100644 --- a/lib/components/common/weChatLoginGrant/index.d.ts +++ b/lib/components/common/weChatLoginGrant/index.d.ts @@ -14,5 +14,5 @@ interface GrantProps { rootStyle?: React.CSSProperties; rootClassName?: string; } -declare function Grant(props: GrantProps): import("react/jsx-runtime").JSX.Element; +declare function Grant(props: GrantProps): JSX.Element; export default Grant; diff --git a/lib/components/common/weChatLoginQrCode/index.d.ts b/lib/components/common/weChatLoginQrCode/index.d.ts index bd125f53e..5c91a9d27 100644 --- a/lib/components/common/weChatLoginQrCode/index.d.ts +++ b/lib/components/common/weChatLoginQrCode/index.d.ts @@ -14,5 +14,5 @@ interface QrCodeProps { rootStyle?: React.CSSProperties; rootClassName?: string; } -declare function QrCode(props: QrCodeProps): import("react/jsx-runtime").JSX.Element; +declare function QrCode(props: QrCodeProps): JSX.Element; export default QrCode; diff --git a/lib/components/config/application/web.pc.d.ts b/lib/components/config/application/web.pc.d.ts index eccda843f..00b4cbb30 100644 --- a/lib/components/config/application/web.pc.d.ts +++ b/lib/components/config/application/web.pc.d.ts @@ -15,5 +15,5 @@ export default function render(props: WebComponentProps void; removeItem: (path: string, index: number) => void; cleanKey: (path: string, key: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; export {}; diff --git a/lib/components/config/application/web/index.d.ts b/lib/components/config/application/web/index.d.ts index c4aece1ab..f6dab4516 100644 --- a/lib/components/config/application/web/index.d.ts +++ b/lib/components/config/application/web/index.d.ts @@ -4,4 +4,4 @@ export default function Web(props: { setValue: (path: string, value: any) => void; removeItem: (path: string, index: number) => void; cleanKey: (path: string, key: string) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/application/wechatMp/index.d.ts b/lib/components/config/application/wechatMp/index.d.ts index 163e97d8b..ddba55f50 100644 --- a/lib/components/config/application/wechatMp/index.d.ts +++ b/lib/components/config/application/wechatMp/index.d.ts @@ -4,4 +4,4 @@ export default function WechatMp(props: { setValue: (path: string, value: any) => void; removeItem: (path: string, index: number) => void; cleanKey: (path: string, key: string) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/application/wechatPublic/index.d.ts b/lib/components/config/application/wechatPublic/index.d.ts index cac9e549c..fef4156cc 100644 --- a/lib/components/config/application/wechatPublic/index.d.ts +++ b/lib/components/config/application/wechatPublic/index.d.ts @@ -5,4 +5,4 @@ export default function WechatPublic(props: { setValue: (path: string, value: any) => void; removeItem: (path: string, index: number) => void; cleanKey: (path: string, key: string) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/style/index.d.ts b/lib/components/config/style/index.d.ts index db7ae7ced..2469d4262 100644 --- a/lib/components/config/style/index.d.ts +++ b/lib/components/config/style/index.d.ts @@ -3,5 +3,5 @@ declare type StyleProps = { value?: StyleType | null; onChange: (value: StyleType) => void; }; -export default function Render(props: StyleProps): import("react/jsx-runtime").JSX.Element; +export default function Render(props: StyleProps): JSX.Element; export {}; diff --git a/lib/components/config/upsert/account/index.d.ts b/lib/components/config/upsert/account/index.d.ts index 7e62ed49f..d12966ca5 100644 --- a/lib/components/config/upsert/account/index.d.ts +++ b/lib/components/config/upsert/account/index.d.ts @@ -3,4 +3,4 @@ export default function Account(props: { account: Required['Account']; setValue: (path: string, value: any) => void; removeItem: (path: string, index: number) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/upsert/cos/index.d.ts b/lib/components/config/upsert/cos/index.d.ts index e5a04827d..e597fb133 100644 --- a/lib/components/config/upsert/cos/index.d.ts +++ b/lib/components/config/upsert/cos/index.d.ts @@ -2,4 +2,4 @@ import { Config } from '../../../../types/Config'; export default function Cos(props: { cos: Required['Cos']; setValue: (path: string, value: any) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/upsert/live/index.d.ts b/lib/components/config/upsert/live/index.d.ts index aa52c1d83..e6e06424f 100644 --- a/lib/components/config/upsert/live/index.d.ts +++ b/lib/components/config/upsert/live/index.d.ts @@ -2,4 +2,4 @@ import { Config } from '../../../../types/Config'; export default function Cos(props: { live: Required['Live']; setValue: (path: string, value: any) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/upsert/map/index.d.ts b/lib/components/config/upsert/map/index.d.ts index a6d4f007f..84db02c1b 100644 --- a/lib/components/config/upsert/map/index.d.ts +++ b/lib/components/config/upsert/map/index.d.ts @@ -2,4 +2,4 @@ import { Config } from '../../../../types/Config'; export default function Cos(props: { map: Required['Map']; setValue: (path: string, value: any) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/upsert/sms/index.d.ts b/lib/components/config/upsert/sms/index.d.ts index 69f8bdf55..56f0dd17c 100644 --- a/lib/components/config/upsert/sms/index.d.ts +++ b/lib/components/config/upsert/sms/index.d.ts @@ -4,4 +4,4 @@ export default function Sms(props: { setValue: (path: string, value: any) => void; removeItem: (path: string, index: number) => void; cleanKey: (path: string, key: string) => void; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/config/upsert/web.pc.d.ts b/lib/components/config/upsert/web.pc.d.ts index 62aacb982..e44901f31 100644 --- a/lib/components/config/upsert/web.pc.d.ts +++ b/lib/components/config/upsert/web.pc.d.ts @@ -12,4 +12,4 @@ export default function Render(props: WebComponentProps void; removeItem: (path: string, index: number) => void; cleanKey: (path: string, key: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/extraFile/avatar/web.d.ts b/lib/components/extraFile/avatar/web.d.ts index 3c90adebc..c4da6f9c4 100644 --- a/lib/components/extraFile/avatar/web.d.ts +++ b/lib/components/extraFile/avatar/web.d.ts @@ -6,4 +6,4 @@ export default function render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/extraFile/display/web.d.ts b/lib/components/extraFile/display/web.d.ts index 3313c4c64..cfaabf286 100644 --- a/lib/components/extraFile/display/web.d.ts +++ b/lib/components/extraFile/display/web.d.ts @@ -1 +1 @@ -export default function render(): import("react/jsx-runtime").JSX.Element; +export default function render(): JSX.Element; diff --git a/lib/components/extraFile/forUrl/web.d.ts b/lib/components/extraFile/forUrl/web.d.ts index b11a202d5..9bead9e06 100644 --- a/lib/components/extraFile/forUrl/web.d.ts +++ b/lib/components/extraFile/forUrl/web.d.ts @@ -19,5 +19,5 @@ export default function render(props: WebComponentProps void; onModal1Confirm: (value: number) => void; setSelectedId: (id: number) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; export {}; diff --git a/lib/components/extraFile/gallery/web.d.ts b/lib/components/extraFile/gallery/web.d.ts index 2df5204a6..5db0da8ff 100644 --- a/lib/components/extraFile/gallery/web.d.ts +++ b/lib/components/extraFile/gallery/web.d.ts @@ -33,5 +33,5 @@ export default function render(props: WebComponentProps string; getFileName: (extraFile: EntityDict['extraFile']['OpSchema']) => string; eFFormatBytes: (value: number) => string; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; export {}; diff --git a/lib/components/func/actionPanel/web.d.ts b/lib/components/func/actionPanel/web.d.ts index 9c850af28..715d4231d 100644 --- a/lib/components/func/actionPanel/web.d.ts +++ b/lib/components/func/actionPanel/web.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps; }, { onClick: (action: string) => void; -}>): import("react/jsx-runtime").JSX.Element | null; +}>): JSX.Element | null; diff --git a/lib/components/func/debugPanel/web.d.ts b/lib/components/func/debugPanel/web.d.ts index d28454d7e..9f422c05b 100644 --- a/lib/components/func/debugPanel/web.d.ts +++ b/lib/components/func/debugPanel/web.d.ts @@ -10,4 +10,4 @@ export default function render(props: WebComponentProps void; downloadEnv: () => void; resetEnv: (data: Record) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/icon/web.d.ts b/lib/components/icon/web.d.ts index 0d5c0042f..acd0ce16d 100644 --- a/lib/components/icon/web.d.ts +++ b/lib/components/icon/web.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/message/cell/web.d.ts b/lib/components/message/cell/web.d.ts index a62a16030..33ae776e1 100644 --- a/lib/components/message/cell/web.d.ts +++ b/lib/components/message/cell/web.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/message/detail/web.d.ts b/lib/components/message/detail/web.d.ts index cf689b387..743c25998 100644 --- a/lib/components/message/detail/web.d.ts +++ b/lib/components/message/detail/web.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/message/detail/web.pc.d.ts b/lib/components/message/detail/web.pc.d.ts index cf689b387..743c25998 100644 --- a/lib/components/message/detail/web.pc.d.ts +++ b/lib/components/message/detail/web.pc.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/message/list/web.d.ts b/lib/components/message/list/web.d.ts index 85c8cd912..21d9824fe 100644 --- a/lib/components/message/list/web.d.ts +++ b/lib/components/message/list/web.d.ts @@ -4,4 +4,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/message/list/web.pc.d.ts b/lib/components/message/list/web.pc.d.ts index 0203f64bf..2fe599863 100644 --- a/lib/components/message/list/web.pc.d.ts +++ b/lib/components/message/list/web.pc.d.ts @@ -4,4 +4,4 @@ export default function Render(props: WebComponentProps[]; }, { goDetailById: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/message/web.d.ts b/lib/components/message/web.d.ts index d61e49004..389838094 100644 --- a/lib/components/message/web.d.ts +++ b/lib/components/message/web.d.ts @@ -3,4 +3,4 @@ export default function render(props: { data: { data: MessageProps; }; -}): import("react/jsx-runtime").JSX.Element; +}): JSX.Element; diff --git a/lib/components/messageTypeTemplateId/list/web.pc.d.ts b/lib/components/messageTypeTemplateId/list/web.pc.d.ts index 179e75e79..7c8007313 100644 --- a/lib/components/messageTypeTemplateId/list/web.pc.d.ts +++ b/lib/components/messageTypeTemplateId/list/web.pc.d.ts @@ -5,4 +5,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/my/avatar/web.d.ts b/lib/components/my/avatar/web.d.ts index 49901b788..400dddfc3 100644 --- a/lib/components/my/avatar/web.d.ts +++ b/lib/components/my/avatar/web.d.ts @@ -9,4 +9,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/my/info/web.d.ts b/lib/components/my/info/web.d.ts index 2dc080f0f..ba6b0a802 100644 --- a/lib/components/my/info/web.d.ts +++ b/lib/components/my/info/web.d.ts @@ -13,4 +13,4 @@ export default function Render(props: WebComponentProps void; updateAttribute: (attr: string, value: any) => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/my/info/web.pc.d.ts b/lib/components/my/info/web.pc.d.ts index 73eeab450..80fcfe6a1 100644 --- a/lib/components/my/info/web.pc.d.ts +++ b/lib/components/my/info/web.pc.d.ts @@ -13,4 +13,4 @@ export default function Render(props: WebComponentProps void; updateAttribute: (attr: string, value: any) => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/my/message/web.d.ts b/lib/components/my/message/web.d.ts index 0a09bb113..e9d5ea208 100644 --- a/lib/components/my/message/web.d.ts +++ b/lib/components/my/message/web.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/my/message/web.pc.d.ts b/lib/components/my/message/web.pc.d.ts index 09ecd6d00..50cf3f0f5 100644 --- a/lib/components/my/message/web.pc.d.ts +++ b/lib/components/my/message/web.pc.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/parasite/detail/web.d.ts b/lib/components/parasite/detail/web.d.ts index 058f6a823..85e0f7556 100644 --- a/lib/components/parasite/detail/web.d.ts +++ b/lib/components/parasite/detail/web.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/parasite/excess/web.d.ts b/lib/components/parasite/excess/web.d.ts index 0728f2008..5e9055c31 100644 --- a/lib/components/parasite/excess/web.d.ts +++ b/lib/components/parasite/excess/web.d.ts @@ -4,4 +4,4 @@ export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/parasite/list/web.d.ts b/lib/components/parasite/list/web.d.ts index 32b912e3e..cd4afd228 100644 --- a/lib/components/parasite/list/web.d.ts +++ b/lib/components/parasite/list/web.d.ts @@ -7,4 +7,4 @@ export default function render(props: WebComponentProps void; getQrCode: () => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/parasite/upsert/web.d.ts b/lib/components/parasite/upsert/web.d.ts index 458806c16..29adf4442 100644 --- a/lib/components/parasite/upsert/web.d.ts +++ b/lib/components/parasite/upsert/web.d.ts @@ -19,4 +19,4 @@ export default function Render(props: WebComponentProps void; onSelect: (value: string) => void; setSearchValue: (value: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/subwayLine/list/web.d.ts b/lib/components/subwayLine/list/web.d.ts index 44c153754..09acc725d 100644 --- a/lib/components/subwayLine/list/web.d.ts +++ b/lib/components/subwayLine/list/web.d.ts @@ -16,4 +16,4 @@ export default function render(props: WebComponentProps void; cancel: () => void; confirm: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/theme/setting/RadioColor.d.ts b/lib/components/theme/setting/RadioColor.d.ts index 9abf7c407..73f280ac3 100644 --- a/lib/components/theme/setting/RadioColor.d.ts +++ b/lib/components/theme/setting/RadioColor.d.ts @@ -3,5 +3,5 @@ interface IProps { defaultValue?: number | string; onChange: (color: string) => void; } -declare const _default: React.MemoExoticComponent<(props: IProps) => import("react/jsx-runtime").JSX.Element>; +declare const _default: React.MemoExoticComponent<(props: IProps) => JSX.Element>; export default _default; diff --git a/lib/components/theme/setting/RadioRect.d.ts b/lib/components/theme/setting/RadioRect.d.ts index 688664958..f363ad49a 100644 --- a/lib/components/theme/setting/RadioRect.d.ts +++ b/lib/components/theme/setting/RadioRect.d.ts @@ -9,5 +9,5 @@ interface IProps { onChange: (value?: any) => void; options: IOption[]; } -declare const _default: React.MemoExoticComponent<(props: IProps) => import("react/jsx-runtime").JSX.Element>; +declare const _default: React.MemoExoticComponent<(props: IProps) => JSX.Element>; export default _default; diff --git a/lib/components/theme/setting/index.d.ts b/lib/components/theme/setting/index.d.ts index ceea5e606..8540c7ec7 100644 --- a/lib/components/theme/setting/index.d.ts +++ b/lib/components/theme/setting/index.d.ts @@ -1 +1 @@ -export default function Render(this: any): import("react/jsx-runtime").JSX.Element; +export default function Render(this: any): JSX.Element; diff --git a/lib/components/user/login/web.d.ts b/lib/components/user/login/web.d.ts index 82f03a08b..97980c3a8 100644 --- a/lib/components/user/login/web.d.ts +++ b/lib/components/user/login/web.d.ts @@ -19,4 +19,4 @@ export default function Render(props: WebComponentProps Promise; loginByMobile: (mobile: string, password?: string, captcha?: string) => Promise; setLoginMode: (value: number) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/list/web.d.ts b/lib/components/userRelation/list/web.d.ts index 2ae7577da..8be54f38c 100644 --- a/lib/components/userRelation/list/web.d.ts +++ b/lib/components/userRelation/list/web.d.ts @@ -17,4 +17,4 @@ export default function Render(props: WebComponentProps void; confirmDelete: (id: string) => Promise; goUpdate: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/list/web.pc.d.ts b/lib/components/userRelation/list/web.pc.d.ts index e7fee118d..211d1d7e3 100644 --- a/lib/components/userRelation/list/web.pc.d.ts +++ b/lib/components/userRelation/list/web.pc.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps void; goUpdate: (id: string) => void; confirmDelete: (id: string) => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/onEntity/web.d.ts b/lib/components/userRelation/onEntity/web.d.ts index f4a1e98f8..11df1296a 100644 --- a/lib/components/userRelation/onEntity/web.d.ts +++ b/lib/components/userRelation/onEntity/web.d.ts @@ -1 +1 @@ -export default function render(this: any): import("react/jsx-runtime").JSX.Element; +export default function render(this: any): JSX.Element; diff --git a/lib/components/userRelation/upsert/byMobile/web.d.ts b/lib/components/userRelation/upsert/byMobile/web.d.ts index b2788ddcb..cb0b70c8b 100644 --- a/lib/components/userRelation/upsert/byMobile/web.d.ts +++ b/lib/components/userRelation/upsert/byMobile/web.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps Promise; onConfirm: () => Promise; onReset: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/byMobile/web.pc.d.ts b/lib/components/userRelation/upsert/byMobile/web.pc.d.ts index eb88c0233..59e8673cd 100644 --- a/lib/components/userRelation/upsert/byMobile/web.pc.d.ts +++ b/lib/components/userRelation/upsert/byMobile/web.pc.d.ts @@ -13,4 +13,4 @@ export default function Render(props: WebComponentProps Promise; onConfirm: () => Promise; onReset: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/byUser/web.d.ts b/lib/components/userRelation/upsert/byUser/web.d.ts index b60014ab5..2bdc7e15c 100644 --- a/lib/components/userRelation/upsert/byUser/web.d.ts +++ b/lib/components/userRelation/upsert/byUser/web.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps Promise; onReset: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/byUser/web.pc.d.ts b/lib/components/userRelation/upsert/byUser/web.pc.d.ts index b60014ab5..2bdc7e15c 100644 --- a/lib/components/userRelation/upsert/byUser/web.pc.d.ts +++ b/lib/components/userRelation/upsert/byUser/web.pc.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps Promise; onReset: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/byUserEntityGrant/web.d.ts b/lib/components/userRelation/upsert/byUserEntityGrant/web.d.ts index ef5350143..e3bd1f0cd 100644 --- a/lib/components/userRelation/upsert/byUserEntityGrant/web.d.ts +++ b/lib/components/userRelation/upsert/byUserEntityGrant/web.d.ts @@ -14,5 +14,5 @@ export default function render(props: WebComponentProps void; setPeriod: (p: number) => void; setUnit: (u: Unit) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; export {}; diff --git a/lib/components/userRelation/upsert/byUserEntityGrant/web.pc.d.ts b/lib/components/userRelation/upsert/byUserEntityGrant/web.pc.d.ts index d41e77c7c..e28a125c9 100644 --- a/lib/components/userRelation/upsert/byUserEntityGrant/web.pc.d.ts +++ b/lib/components/userRelation/upsert/byUserEntityGrant/web.pc.d.ts @@ -18,5 +18,5 @@ export default function render(props: WebComponentProps void; setPeriod: (p: number) => void; setUnit: (u: Unit) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; export {}; diff --git a/lib/components/userRelation/upsert/onUser/userRelation/web.d.ts b/lib/components/userRelation/upsert/onUser/userRelation/web.d.ts index e7fa0a695..677e28c07 100644 --- a/lib/components/userRelation/upsert/onUser/userRelation/web.d.ts +++ b/lib/components/userRelation/upsert/onUser/userRelation/web.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/onUser/userRelation/web.pc.d.ts b/lib/components/userRelation/upsert/onUser/userRelation/web.pc.d.ts index e7fa0a695..677e28c07 100644 --- a/lib/components/userRelation/upsert/onUser/userRelation/web.pc.d.ts +++ b/lib/components/userRelation/upsert/onUser/userRelation/web.pc.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/onUser/web.d.ts b/lib/components/userRelation/upsert/onUser/web.d.ts index 48b947378..2b0e5b799 100644 --- a/lib/components/userRelation/upsert/onUser/web.d.ts +++ b/lib/components/userRelation/upsert/onUser/web.d.ts @@ -15,4 +15,4 @@ export default function Render(props: WebComponentProps Promise; onConfirm: () => Promise; onReset: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/onUser/web.pc.d.ts b/lib/components/userRelation/upsert/onUser/web.pc.d.ts index 9570f51d2..fbcea650f 100644 --- a/lib/components/userRelation/upsert/onUser/web.pc.d.ts +++ b/lib/components/userRelation/upsert/onUser/web.pc.d.ts @@ -16,4 +16,4 @@ export default function Render(props: WebComponentProps Promise; onConfirm: () => Promise; onReset: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/components/userRelation/upsert/web.pc.d.ts b/lib/components/userRelation/upsert/web.pc.d.ts index 1c0d32030..7a94d476e 100644 --- a/lib/components/userRelation/upsert/web.pc.d.ts +++ b/lib/components/userRelation/upsert/web.pc.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/wechatLogin/qrCode/web.d.ts b/lib/components/wechatLogin/qrCode/web.d.ts index 714f028b6..64aba2ccd 100644 --- a/lib/components/wechatLogin/qrCode/web.d.ts +++ b/lib/components/wechatLogin/qrCode/web.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/wechatUser/bindingList/web.d.ts b/lib/components/wechatUser/bindingList/web.d.ts index bd3139280..165ea90e8 100644 --- a/lib/components/wechatUser/bindingList/web.d.ts +++ b/lib/components/wechatUser/bindingList/web.d.ts @@ -2,4 +2,4 @@ import { EntityDict } from '../../../oak-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/components/wechatUser/unbindBtn/web.d.ts b/lib/components/wechatUser/unbindBtn/web.d.ts index a0028a439..73749bca0 100644 --- a/lib/components/wechatUser/unbindBtn/web.d.ts +++ b/lib/components/wechatUser/unbindBtn/web.d.ts @@ -4,4 +4,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/entities/ExtraFile.d.ts b/lib/entities/ExtraFile.d.ts index 4db5cac9e..78411c53e 100644 --- a/lib/entities/ExtraFile.d.ts +++ b/lib/entities/ExtraFile.d.ts @@ -17,4 +17,5 @@ export interface Schema extends EntityShape { sort?: Float<22, 10>; fileType?: String<128>; isBridge?: Boolean; + uploadMeta?: Object; } diff --git a/lib/entities/ExtraFile.js b/lib/entities/ExtraFile.js index af94c168b..b3fe865b4 100644 --- a/lib/entities/ExtraFile.js +++ b/lib/entities/ExtraFile.js @@ -22,6 +22,7 @@ var entityDesc = { sort: '排序', fileType: '文件类型', isBridge: '是否桥接访问', + uploadMeta: '上传需要的metadata', }, v: { origin: { diff --git a/lib/index.d.ts b/lib/index.d.ts index 446539918..e87dfc434 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -13,3 +13,4 @@ export { BackendRuntimeContext } from './context/BackendRuntimeContext'; export { FrontendRuntimeContext, SerializedData, } from './context/FrontendRuntimeContext'; export { RuntimeContext } from './context/RuntimeContext'; export { registerWechatPublicTags } from './config/constants'; +export { registerUploader } from './utils/uploader'; diff --git a/lib/index.js b/lib/index.js index f8afd4375..bd4191ac7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.registerWechatPublicTags = exports.FrontendRuntimeContext = exports.BackendRuntimeContext = exports.getStreamObj = exports.getPlayBackUrl = exports.getLivestream = exports.decomposeFileUrl = exports.composeFileUrl = exports.registerWeChatPublicEventCallback = exports.registerMessageNotificationConverters = void 0; +exports.registerUploader = exports.registerWechatPublicTags = exports.FrontendRuntimeContext = exports.BackendRuntimeContext = exports.getStreamObj = exports.getPlayBackUrl = exports.getLivestream = exports.decomposeFileUrl = exports.composeFileUrl = exports.registerWeChatPublicEventCallback = exports.registerMessageNotificationConverters = void 0; var tslib_1 = require("tslib"); // export * from './exceptionHandlers'; var message_1 = require("./triggers/message"); @@ -24,3 +24,5 @@ var FrontendRuntimeContext_1 = require("./context/FrontendRuntimeContext"); Object.defineProperty(exports, "FrontendRuntimeContext", { enumerable: true, get: function () { return FrontendRuntimeContext_1.FrontendRuntimeContext; } }); var constants_1 = require("./config/constants"); Object.defineProperty(exports, "registerWechatPublicTags", { enumerable: true, get: function () { return constants_1.registerWechatPublicTags; } }); +var uploader_1 = require("./utils/uploader"); +Object.defineProperty(exports, "registerUploader", { enumerable: true, get: function () { return uploader_1.registerUploader; } }); diff --git a/lib/oak-app-domain/ExtraFile/Schema.d.ts b/lib/oak-app-domain/ExtraFile/Schema.d.ts index e95c7fc4d..dd26138bb 100644 --- a/lib/oak-app-domain/ExtraFile/Schema.d.ts +++ b/lib/oak-app-domain/ExtraFile/Schema.d.ts @@ -25,6 +25,7 @@ export declare type OpSchema = EntityShape & { sort?: Float<22, 10> | null; fileType?: String<128> | null; isBridge?: Boolean | null; + uploadMeta?: Object | null; }; export declare type OpAttr = keyof OpSchema; export declare type Schema = EntityShape & { @@ -44,6 +45,7 @@ export declare type Schema = EntityShape & { sort?: Float<22, 10> | null; fileType?: String<128> | null; isBridge?: Boolean | null; + uploadMeta?: Object | null; article?: Article.Schema; articleMenu?: ArticleMenu.Schema; user?: User.Schema; @@ -71,6 +73,7 @@ declare type AttrFilter = { sort: Q_NumberValue; fileType: Q_StringValue; isBridge: Q_BooleanValue; + uploadMeta: Object; article: Article.Filter; articleMenu: ArticleMenu.Filter; user: User.Filter; @@ -99,6 +102,7 @@ export declare type Projection = { sort?: number; fileType?: number; isBridge?: number; + uploadMeta?: number | Object; article?: Article.Projection; articleMenu?: ArticleMenu.Projection; user?: User.Projection; diff --git a/lib/oak-app-domain/ExtraFile/Storage.js b/lib/oak-app-domain/ExtraFile/Storage.js index d125d6a98..a8505fe78 100644 --- a/lib/oak-app-domain/ExtraFile/Storage.js +++ b/lib/oak-app-domain/ExtraFile/Storage.js @@ -96,6 +96,9 @@ exports.desc = { }, isBridge: { type: "boolean" + }, + uploadMeta: { + type: "object" } }, actionType: "crud", diff --git a/lib/oak-app-domain/ExtraFile/locales/zh_CN.json b/lib/oak-app-domain/ExtraFile/locales/zh_CN.json index aa0e399b8..da89d1771 100644 --- a/lib/oak-app-domain/ExtraFile/locales/zh_CN.json +++ b/lib/oak-app-domain/ExtraFile/locales/zh_CN.json @@ -1 +1 @@ -{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问" }, "v": { "origin": { "qiniu": "七牛云", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" } } } +{ "name": "文件", "attr": { "origin": "源", "type": "类型", "bucket": "桶", "objectId": "对象编号", "tag1": "标签一", "tag2": "标签二", "filename": "文件名", "md5": "md5", "entity": "关联对象", "entityId": "关联对象id", "extra1": "额外信息", "extension": "后缀名", "size": "文件大小", "sort": "排序", "fileType": "文件类型", "isBridge": "是否桥接访问", "uploadMeta": "上传需要的metadata" }, "v": { "origin": { "qiniu": "七牛云", "unknown": "未知" }, "type": { "image": "图像", "video": "视频", "audio": "音频", "file": "文件" } } } diff --git a/lib/pages/address/list/web.d.ts b/lib/pages/address/list/web.d.ts index 424043c2d..92a8d8a09 100644 --- a/lib/pages/address/list/web.d.ts +++ b/lib/pages/address/list/web.d.ts @@ -5,4 +5,4 @@ export default function Render(props: WebComponentProps void; goNewAddress: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/address/upsert/web.d.ts b/lib/pages/address/upsert/web.d.ts index 9abfc6a1b..9b3cc87e8 100644 --- a/lib/pages/address/upsert/web.d.ts +++ b/lib/pages/address/upsert/web.d.ts @@ -9,4 +9,4 @@ export default function Render(props: WebComponentProps void; confirm: () => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/application/config/upsert/web.pc.d.ts b/lib/pages/application/config/upsert/web.pc.d.ts index 4957b0e75..3e7db684d 100644 --- a/lib/pages/application/config/upsert/web.pc.d.ts +++ b/lib/pages/application/config/upsert/web.pc.d.ts @@ -8,5 +8,5 @@ export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; export {}; diff --git a/lib/pages/application/detail/web.d.ts b/lib/pages/application/detail/web.d.ts index 3b8937823..6a7dc8798 100644 --- a/lib/pages/application/detail/web.d.ts +++ b/lib/pages/application/detail/web.d.ts @@ -14,5 +14,5 @@ export default function Render(props: WebComponentProps void; goWechatPublicTagList: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; export {}; diff --git a/lib/pages/application/list/web.pc.d.ts b/lib/pages/application/list/web.pc.d.ts index dd8d276c9..72f46bdab 100644 --- a/lib/pages/application/list/web.pc.d.ts +++ b/lib/pages/application/list/web.pc.d.ts @@ -12,4 +12,4 @@ export default function Render(props: WebComponentProps void; goUpdate: (id: string) => void; removeApplication: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/application/upsert/web.pc.d.ts b/lib/pages/application/upsert/web.pc.d.ts index b14191e33..3517250fc 100644 --- a/lib/pages/application/upsert/web.pc.d.ts +++ b/lib/pages/application/upsert/web.pc.d.ts @@ -15,4 +15,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/changePassword/web.d.ts b/lib/pages/changePassword/web.d.ts index 8e3e05e80..dc5614a18 100644 --- a/lib/pages/changePassword/web.d.ts +++ b/lib/pages/changePassword/web.d.ts @@ -4,4 +4,4 @@ export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/changePassword/web.pc.d.ts b/lib/pages/changePassword/web.pc.d.ts index 8e3e05e80..dc5614a18 100644 --- a/lib/pages/changePassword/web.pc.d.ts +++ b/lib/pages/changePassword/web.pc.d.ts @@ -4,4 +4,4 @@ export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/domain/detail/web.d.ts b/lib/pages/domain/detail/web.d.ts index 2c142b932..07d4941c8 100644 --- a/lib/pages/domain/detail/web.d.ts +++ b/lib/pages/domain/detail/web.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/domain/list/web.pc.d.ts b/lib/pages/domain/list/web.pc.d.ts index ff07b5a3c..04c1a7f52 100644 --- a/lib/pages/domain/list/web.pc.d.ts +++ b/lib/pages/domain/list/web.pc.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; goCreate: () => void; goUpdate: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/domain/upsert/web.pc.d.ts b/lib/pages/domain/upsert/web.pc.d.ts index 8b50d33f8..79b51472f 100644 --- a/lib/pages/domain/upsert/web.pc.d.ts +++ b/lib/pages/domain/upsert/web.pc.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/icon/web.d.ts b/lib/pages/icon/web.d.ts index d6b0fa37c..0860535ce 100644 --- a/lib/pages/icon/web.d.ts +++ b/lib/pages/icon/web.d.ts @@ -1,3 +1,3 @@ import { EntityDict } from '../../oak-app-domain'; import { WebComponentProps } from 'oak-frontend-base'; -export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +export default function Render(props: WebComponentProps): JSX.Element; diff --git a/lib/pages/message/detail/web.d.ts b/lib/pages/message/detail/web.d.ts index cf689b387..743c25998 100644 --- a/lib/pages/message/detail/web.d.ts +++ b/lib/pages/message/detail/web.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/message/detail/web.pc.d.ts b/lib/pages/message/detail/web.pc.d.ts index cf689b387..743c25998 100644 --- a/lib/pages/message/detail/web.pc.d.ts +++ b/lib/pages/message/detail/web.pc.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/message/drawerList/web.d.ts b/lib/pages/message/drawerList/web.d.ts index 56a08305a..c9ae8c16f 100644 --- a/lib/pages/message/drawerList/web.d.ts +++ b/lib/pages/message/drawerList/web.d.ts @@ -7,4 +7,4 @@ export default function Render(props: WebComponentProps void; goMessageList: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/message/list/web.d.ts b/lib/pages/message/list/web.d.ts index 85c8cd912..21d9824fe 100644 --- a/lib/pages/message/list/web.d.ts +++ b/lib/pages/message/list/web.d.ts @@ -4,4 +4,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/message/list/web.pc.d.ts b/lib/pages/message/list/web.pc.d.ts index 0203f64bf..2fe599863 100644 --- a/lib/pages/message/list/web.pc.d.ts +++ b/lib/pages/message/list/web.pc.d.ts @@ -4,4 +4,4 @@ export default function Render(props: WebComponentProps[]; }, { goDetailById: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/mobile/login/web.d.ts b/lib/pages/mobile/login/web.d.ts index f20ffeaf0..5616355e4 100644 --- a/lib/pages/mobile/login/web.d.ts +++ b/lib/pages/mobile/login/web.d.ts @@ -17,4 +17,4 @@ export default function render(props: WebComponentProps void; sendCaptcha: () => Promise; loginByMobile: () => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/mobile/login/web.pc.d.ts b/lib/pages/mobile/login/web.pc.d.ts index bb1add491..5eea0030a 100644 --- a/lib/pages/mobile/login/web.pc.d.ts +++ b/lib/pages/mobile/login/web.pc.d.ts @@ -16,4 +16,4 @@ export default function render(props: WebComponentProps void; sendCaptcha: () => Promise; loginByMobile: () => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/mobile/me/web.d.ts b/lib/pages/mobile/me/web.d.ts index 7b100c324..86fabb7f2 100644 --- a/lib/pages/mobile/me/web.d.ts +++ b/lib/pages/mobile/me/web.d.ts @@ -6,4 +6,4 @@ export default function render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/mobile/me/web.pc.d.ts b/lib/pages/mobile/me/web.pc.d.ts index f91e4f872..fecbdeb68 100644 --- a/lib/pages/mobile/me/web.pc.d.ts +++ b/lib/pages/mobile/me/web.pc.d.ts @@ -7,4 +7,4 @@ export default function render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/paper/detail/web.d.ts b/lib/pages/paper/detail/web.d.ts index c57152a54..af5108db1 100644 --- a/lib/pages/paper/detail/web.d.ts +++ b/lib/pages/paper/detail/web.d.ts @@ -6,4 +6,4 @@ export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/paper/list/web.d.ts b/lib/pages/paper/list/web.d.ts index 2104ddb5a..8efdc15a5 100644 --- a/lib/pages/paper/list/web.d.ts +++ b/lib/pages/paper/list/web.d.ts @@ -13,4 +13,4 @@ export default function render(props: WebComponentProps Promise; searchConfirm: () => Promise; onRemove: (id: string) => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/paper/preview/web.d.ts b/lib/pages/paper/preview/web.d.ts index 4ef12cc2f..b64855c39 100644 --- a/lib/pages/paper/preview/web.d.ts +++ b/lib/pages/paper/preview/web.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/paper/upsert/web.d.ts b/lib/pages/paper/upsert/web.d.ts index 00a358ebf..5ec7ded18 100644 --- a/lib/pages/paper/upsert/web.d.ts +++ b/lib/pages/paper/upsert/web.d.ts @@ -21,4 +21,4 @@ export default function Render(props: WebComponentProps; clearContentTip: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/personal/web.d.ts b/lib/pages/personal/web.d.ts index 594681efd..baca2f3aa 100644 --- a/lib/pages/personal/web.d.ts +++ b/lib/pages/personal/web.d.ts @@ -1 +1 @@ -export default function Render(): import("react/jsx-runtime").JSX.Element; +export default function Render(): JSX.Element; diff --git a/lib/pages/personal/web.pc.d.ts b/lib/pages/personal/web.pc.d.ts index 594681efd..baca2f3aa 100644 --- a/lib/pages/personal/web.pc.d.ts +++ b/lib/pages/personal/web.pc.d.ts @@ -1 +1 @@ -export default function Render(): import("react/jsx-runtime").JSX.Element; +export default function Render(): JSX.Element; diff --git a/lib/pages/pickers/area/web.d.ts b/lib/pages/pickers/area/web.d.ts index b2ca6d492..f9bb133dd 100644 --- a/lib/pages/pickers/area/web.d.ts +++ b/lib/pages/pickers/area/web.d.ts @@ -4,4 +4,4 @@ export default function render(props: WebComponentProps Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/platform/config/upsert/web.pc.d.ts b/lib/pages/platform/config/upsert/web.pc.d.ts index a1d26878b..11bb7ef98 100644 --- a/lib/pages/platform/config/upsert/web.pc.d.ts +++ b/lib/pages/platform/config/upsert/web.pc.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/platform/detail/web.d.ts b/lib/pages/platform/detail/web.d.ts index 98c8fcaf3..abe71382c 100644 --- a/lib/pages/platform/detail/web.d.ts +++ b/lib/pages/platform/detail/web.d.ts @@ -9,4 +9,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/platform/list/web.pc.d.ts b/lib/pages/platform/list/web.pc.d.ts index 0d529c99b..7cad87793 100644 --- a/lib/pages/platform/list/web.pc.d.ts +++ b/lib/pages/platform/list/web.pc.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps void; goSetConfig: (id: string) => void; goUpdate: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/platform/upsert/web.pc.d.ts b/lib/pages/platform/upsert/web.pc.d.ts index fbbc68bc1..72957a6d2 100644 --- a/lib/pages/platform/upsert/web.pc.d.ts +++ b/lib/pages/platform/upsert/web.pc.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/setting/web.d.ts b/lib/pages/setting/web.d.ts index a26be4c02..a897c3cb6 100644 --- a/lib/pages/setting/web.d.ts +++ b/lib/pages/setting/web.d.ts @@ -9,4 +9,4 @@ export default function render(props: WebComponentProps void; setVisible: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/setting/web.pc.d.ts b/lib/pages/setting/web.pc.d.ts index 594681efd..baca2f3aa 100644 --- a/lib/pages/setting/web.pc.d.ts +++ b/lib/pages/setting/web.pc.d.ts @@ -1 +1 @@ -export default function Render(): import("react/jsx-runtime").JSX.Element; +export default function Render(): JSX.Element; diff --git a/lib/pages/subscription/config/upsert/web.pc.d.ts b/lib/pages/subscription/config/upsert/web.pc.d.ts index 88820328e..35b74b5a0 100644 --- a/lib/pages/subscription/config/upsert/web.pc.d.ts +++ b/lib/pages/subscription/config/upsert/web.pc.d.ts @@ -7,5 +7,5 @@ export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; export {}; diff --git a/lib/pages/subscription/detail/web.d.ts b/lib/pages/subscription/detail/web.d.ts index 14829cc28..58c618262 100644 --- a/lib/pages/subscription/detail/web.d.ts +++ b/lib/pages/subscription/detail/web.d.ts @@ -12,5 +12,5 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; export {}; diff --git a/lib/pages/subscription/list/web.pc.d.ts b/lib/pages/subscription/list/web.pc.d.ts index c14ad48db..17f695294 100644 --- a/lib/pages/subscription/list/web.pc.d.ts +++ b/lib/pages/subscription/list/web.pc.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps void; goUpdate: (id: string) => void; remove: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/subscription/upsert/web.pc.d.ts b/lib/pages/subscription/upsert/web.pc.d.ts index d16ba7d3a..55a362e5e 100644 --- a/lib/pages/subscription/upsert/web.pc.d.ts +++ b/lib/pages/subscription/upsert/web.pc.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/subwayLine/list/web.d.ts b/lib/pages/subwayLine/list/web.d.ts index 175126fdc..27d54a300 100644 --- a/lib/pages/subwayLine/list/web.d.ts +++ b/lib/pages/subwayLine/list/web.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps void; setFilterByAreaId: (areaId: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/subwayLine/upsertStation/web.d.ts b/lib/pages/subwayLine/upsertStation/web.d.ts index 9a5aa0156..5f6316d8f 100644 --- a/lib/pages/subwayLine/upsertStation/web.d.ts +++ b/lib/pages/subwayLine/upsertStation/web.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps void; openStation: boolean; subwayId: string; -}, {}>): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/subwayLine/upsertSubway/web.d.ts b/lib/pages/subwayLine/upsertSubway/web.d.ts index 8a08e34d0..ab23b3894 100644 --- a/lib/pages/subwayLine/upsertSubway/web.d.ts +++ b/lib/pages/subwayLine/upsertSubway/web.d.ts @@ -5,4 +5,4 @@ export default function Render(props: WebComponentProps void; openSubway: boolean; -}, {}>): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/system/config/upsert/web.pc.d.ts b/lib/pages/system/config/upsert/web.pc.d.ts index acffdee90..bcb8e572c 100644 --- a/lib/pages/system/config/upsert/web.pc.d.ts +++ b/lib/pages/system/config/upsert/web.pc.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/system/detail/web.d.ts b/lib/pages/system/detail/web.d.ts index 5dfab7bca..38dd1ce37 100644 --- a/lib/pages/system/detail/web.d.ts +++ b/lib/pages/system/detail/web.d.ts @@ -14,4 +14,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/system/list/web.pc.d.ts b/lib/pages/system/list/web.pc.d.ts index c40bb6b38..c0ba36154 100644 --- a/lib/pages/system/list/web.pc.d.ts +++ b/lib/pages/system/list/web.pc.d.ts @@ -11,4 +11,4 @@ export default function Render(props: WebComponentProps void; goSetConfig: (id: string) => void; goUpdate: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/system/upsert/web.pc.d.ts b/lib/pages/system/upsert/web.pc.d.ts index 953584620..8d2352f32 100644 --- a/lib/pages/system/upsert/web.pc.d.ts +++ b/lib/pages/system/upsert/web.pc.d.ts @@ -10,4 +10,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/token/me/web.d.ts b/lib/pages/token/me/web.d.ts index f8c59b723..8c24eab24 100644 --- a/lib/pages/token/me/web.d.ts +++ b/lib/pages/token/me/web.d.ts @@ -15,4 +15,4 @@ export default function Render(props: WebComponentProps Promise; goMyMobile: () => Promise; goUserManage: () => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/user/info/web.d.ts b/lib/pages/user/info/web.d.ts index 0dae98ec8..6025678c8 100644 --- a/lib/pages/user/info/web.d.ts +++ b/lib/pages/user/info/web.d.ts @@ -28,5 +28,5 @@ declare type MethodsProps = { onConfirm: (attr: string) => Promise; refreshWechatPublicUserInfo: () => void; }; -export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +export default function render(props: WebComponentProps): JSX.Element; export {}; diff --git a/lib/pages/user/info/web.pc.d.ts b/lib/pages/user/info/web.pc.d.ts index 37be3e590..6db3ed15b 100644 --- a/lib/pages/user/info/web.pc.d.ts +++ b/lib/pages/user/info/web.pc.d.ts @@ -22,4 +22,4 @@ export default function Render(props: WebComponentProps void; goChangePassword: () => void; unbunding: (captcha?: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/user/manage/detail/web.d.ts b/lib/pages/user/manage/detail/web.d.ts index 241e6ffed..90c922c27 100644 --- a/lib/pages/user/manage/detail/web.d.ts +++ b/lib/pages/user/manage/detail/web.d.ts @@ -22,4 +22,4 @@ export default function render(props: WebComponentProps Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/user/manage/upsert/web.d.ts b/lib/pages/user/manage/upsert/web.d.ts index b5e9f5775..d68616a4c 100644 --- a/lib/pages/user/manage/upsert/web.d.ts +++ b/lib/pages/user/manage/upsert/web.d.ts @@ -15,4 +15,4 @@ export default function Render(props: WebComponentProps; -}, {}>): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/user/manage/web.d.ts b/lib/pages/user/manage/web.d.ts index e9127bdbb..ef68161e7 100644 --- a/lib/pages/user/manage/web.d.ts +++ b/lib/pages/user/manage/web.d.ts @@ -9,4 +9,4 @@ export default function render(props: WebComponentProps Promise; goNewUser: () => Promise; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/user/manage/web.pc.d.ts b/lib/pages/user/manage/web.pc.d.ts index f4a1e98f8..11df1296a 100644 --- a/lib/pages/user/manage/web.pc.d.ts +++ b/lib/pages/user/manage/web.pc.d.ts @@ -1 +1 @@ -export default function render(this: any): import("react/jsx-runtime").JSX.Element; +export default function render(this: any): JSX.Element; diff --git a/lib/pages/user/search/web.d.ts b/lib/pages/user/search/web.d.ts index 3313c4c64..cfaabf286 100644 --- a/lib/pages/user/search/web.d.ts +++ b/lib/pages/user/search/web.d.ts @@ -1 +1 @@ -export default function render(): import("react/jsx-runtime").JSX.Element; +export default function render(): JSX.Element; diff --git a/lib/pages/userEntityGrant/confirm/web.d.ts b/lib/pages/userEntityGrant/confirm/web.d.ts index 8e357bd03..8d21ab0e6 100644 --- a/lib/pages/userEntityGrant/confirm/web.d.ts +++ b/lib/pages/userEntityGrant/confirm/web.d.ts @@ -22,4 +22,4 @@ export default function Render(props: WebComponentProps void; redirectPage: () => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/userEntityGrant/detail/web.d.ts b/lib/pages/userEntityGrant/detail/web.d.ts index 058f6a823..85e0f7556 100644 --- a/lib/pages/userEntityGrant/detail/web.d.ts +++ b/lib/pages/userEntityGrant/detail/web.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/userEntityGrant/detail/web.pc.d.ts b/lib/pages/userEntityGrant/detail/web.pc.d.ts index 058f6a823..85e0f7556 100644 --- a/lib/pages/userEntityGrant/detail/web.pc.d.ts +++ b/lib/pages/userEntityGrant/detail/web.pc.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/userEntityGrant/grant/web.d.ts b/lib/pages/userEntityGrant/grant/web.d.ts index 5f3ce5371..d013193b0 100644 --- a/lib/pages/userEntityGrant/grant/web.d.ts +++ b/lib/pages/userEntityGrant/grant/web.d.ts @@ -15,4 +15,4 @@ export default function render(props: WebComponentProps void; setNumber: (value: string) => void; setPeriod: (value: number | null) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/userEntityGrant/list/web.d.ts b/lib/pages/userEntityGrant/list/web.d.ts index 4c85a0d3c..731c3e1f5 100644 --- a/lib/pages/userEntityGrant/list/web.d.ts +++ b/lib/pages/userEntityGrant/list/web.d.ts @@ -2,4 +2,4 @@ import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../oak-app-domain'; export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/wechatLogin/confirm/web.d.ts b/lib/pages/wechatLogin/confirm/web.d.ts index 9da1f64f5..cf97ae016 100644 --- a/lib/pages/wechatLogin/confirm/web.d.ts +++ b/lib/pages/wechatLogin/confirm/web.d.ts @@ -14,4 +14,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/wechatPublic/tag/list/web.pc.d.ts b/lib/pages/wechatPublic/tag/list/web.pc.d.ts index c7442b170..2943b15f4 100644 --- a/lib/pages/wechatPublic/tag/list/web.pc.d.ts +++ b/lib/pages/wechatPublic/tag/list/web.pc.d.ts @@ -8,4 +8,4 @@ export default function Render(props: WebComponentProps void; goUpdate: (id: string) => void; goDelete: (id: string) => void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/wechatPublic/tag/upsert/web.d.ts b/lib/pages/wechatPublic/tag/upsert/web.d.ts index 497eb4825..ea8ebaaf2 100644 --- a/lib/pages/wechatPublic/tag/upsert/web.d.ts +++ b/lib/pages/wechatPublic/tag/upsert/web.d.ts @@ -6,4 +6,4 @@ export default function Render(props: WebComponentProps void; -}>): import("react/jsx-runtime").JSX.Element; +}>): JSX.Element; diff --git a/lib/pages/wechatQrCode/scan/web.d.ts b/lib/pages/wechatQrCode/scan/web.d.ts index 06b00c6a4..46a945cb3 100644 --- a/lib/pages/wechatQrCode/scan/web.d.ts +++ b/lib/pages/wechatQrCode/scan/web.d.ts @@ -4,4 +4,4 @@ export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/pages/wechatUser/login/web.d.ts b/lib/pages/wechatUser/login/web.d.ts index 426085b42..55440ed77 100644 --- a/lib/pages/wechatUser/login/web.d.ts +++ b/lib/pages/wechatUser/login/web.d.ts @@ -3,4 +3,4 @@ import { WebComponentProps } from 'oak-frontend-base'; export default function render(props: WebComponentProps): import("react/jsx-runtime").JSX.Element; +}, {}>): JSX.Element; diff --git a/lib/triggers/extraFile.d.ts b/lib/triggers/extraFile.d.ts new file mode 100644 index 000000000..8e0c1db32 --- /dev/null +++ b/lib/triggers/extraFile.d.ts @@ -0,0 +1,5 @@ +import { Trigger } from 'oak-domain/lib/types/Trigger'; +import { EntityDict } from '../oak-app-domain/EntityDict'; +import { BackendRuntimeContext } from '../context/BackendRuntimeContext'; +declare const triggers: Trigger>[]; +export default triggers; diff --git a/lib/triggers/extraFile.js b/lib/triggers/extraFile.js new file mode 100644 index 000000000..c09a2e3cf --- /dev/null +++ b/lib/triggers/extraFile.js @@ -0,0 +1,52 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var uploader_1 = tslib_1.__importDefault(require("../utils/uploader")); +var oak_domain_1 = require("oak-domain"); +var triggers = [ + { + name: '生成extraFile需要的上传meta', + when: 'before', + entity: 'extraFile', + action: 'create', + fn: function (_a, context) { + var operation = _a.operation; + return tslib_1.__awaiter(void 0, void 0, void 0, function () { + var data, formMeta; + return tslib_1.__generator(this, function (_b) { + switch (_b.label) { + case 0: + data = operation.data; + formMeta = function (data) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { + var origin, uploader; + return tslib_1.__generator(this, function (_a) { + switch (_a.label) { + case 0: + origin = data.origin; + uploader = uploader_1.default[origin]; + if (!uploader) { + throw new oak_domain_1.OakException("origin\u4E3A".concat(origin, "\u7684extraFile\u6CA1\u6709\u5B9A\u4E49\u4E0A\u4F20\u7C7B\uFF0C\u8BF7\u8C03\u7528registerUploader\u6CE8\u5165")); + } + return [4 /*yield*/, uploader.formUploadMeta(data, context)]; + case 1: + _a.sent(); + return [2 /*return*/]; + } + }); + }); }; + if (!(data instanceof Array)) return [3 /*break*/, 2]; + return [4 /*yield*/, Promise.all(data.map(function (ele) { return formMeta(ele); }))]; + case 1: + _b.sent(); + return [2 /*return*/, data.length]; + case 2: return [4 /*yield*/, formMeta(data)]; + case 3: + _b.sent(); + return [2 /*return*/, 1]; + } + }); + }); + } + }, +]; +exports.default = triggers; diff --git a/lib/triggers/index.d.ts b/lib/triggers/index.d.ts index 9055a9fc4..1527f9a5a 100644 --- a/lib/triggers/index.d.ts +++ b/lib/triggers/index.d.ts @@ -1,2 +1,2 @@ -declare const _default: (import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger>)[]; +declare const _default: (import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger>)[]; export default _default; diff --git a/lib/triggers/index.js b/lib/triggers/index.js index c5889f0c8..24495bb67 100644 --- a/lib/triggers/index.js +++ b/lib/triggers/index.js @@ -12,4 +12,5 @@ var application_1 = tslib_1.__importDefault(require("./application")); var articleMenu_1 = tslib_1.__importDefault(require("./articleMenu")); var article_1 = tslib_1.__importDefault(require("./article")); var parasite_1 = tslib_1.__importDefault(require("./parasite")); -exports.default = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(application_1.default), false), tslib_1.__read(address_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false), tslib_1.__read(message_1.default), false), tslib_1.__read(notification_1.default), false), tslib_1.__read(wechatLogin_1.default), false), tslib_1.__read(articleMenu_1.default), false), tslib_1.__read(article_1.default), false), tslib_1.__read(parasite_1.default), false); +var extraFile_1 = tslib_1.__importDefault(require("./extraFile")); +exports.default = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(application_1.default), false), tslib_1.__read(address_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false), tslib_1.__read(message_1.default), false), tslib_1.__read(notification_1.default), false), tslib_1.__read(wechatLogin_1.default), false), tslib_1.__read(articleMenu_1.default), false), tslib_1.__read(article_1.default), false), tslib_1.__read(parasite_1.default), false), tslib_1.__read(extraFile_1.default), false); diff --git a/lib/types/Uploader.d.ts b/lib/types/Uploader.d.ts new file mode 100644 index 000000000..f692ddd58 --- /dev/null +++ b/lib/types/Uploader.d.ts @@ -0,0 +1,21 @@ +import { EntityDict } from '../oak-app-domain'; +import { EntityDict as BaseEntityDict } from 'oak-domain'; +import { BackendRuntimeContext } from '../context/BackendRuntimeContext'; +export default interface Uploader> { + name: string; + /** + * 注入在后台extrafile生成之前 + * @param extraFile,要生成的extraFile数据 + * @param context 后台上下文 + * @returns + */ + formUploadMeta: (extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; + /** + * 前台在生成extraFile返回之后调用此函数,进行对文件的真正上传 + * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则由前台调用confirmUploadFn去通知后台(实现者尽量不要调用) + * 上传失败,调用uploadFailureFn进行数据的处理 + * @param extraFile + * @returns + */ + upload: (extraFile: EntityDict['extraFile']['OpSchema'], confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise) => Promise; +} diff --git a/lib/types/Uploader.js b/lib/types/Uploader.js new file mode 100644 index 000000000..c8ad2e549 --- /dev/null +++ b/lib/types/Uploader.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/lib/utils/uploader/index.d.ts b/lib/utils/uploader/index.d.ts new file mode 100644 index 000000000..84bc2a76b --- /dev/null +++ b/lib/utils/uploader/index.d.ts @@ -0,0 +1,12 @@ +import { EntityDict } from '../../oak-app-domain'; +import { EntityDict as BaseEntityDict } from 'oak-domain'; +import { BackendRuntimeContext } from '../../context/BackendRuntimeContext'; +import Uploader from "../../types/Uploader"; +declare type ED = EntityDict & BaseEntityDict; +declare const UploaderDict: Record>>; +export default UploaderDict; +/** + * 注入一个其它OSS上实现的uploader类 + * @param clazz + */ +export declare function registerUploader>(clazz: new () => Uploader): void; diff --git a/lib/utils/uploader/index.js b/lib/utils/uploader/index.js new file mode 100644 index 000000000..d42cedba0 --- /dev/null +++ b/lib/utils/uploader/index.js @@ -0,0 +1,20 @@ +"use strict"; +var _a; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.registerUploader = void 0; +var tslib_1 = require("tslib"); +var qiniu_1 = tslib_1.__importDefault(require("./qiniu")); +var qiniu = new qiniu_1.default(); +var UploaderDict = (_a = {}, + _a[qiniu.name] = qiniu, + _a); +exports.default = UploaderDict; +/** + * 注入一个其它OSS上实现的uploader类 + * @param clazz + */ +function registerUploader(clazz) { + var instance = new clazz(); + UploaderDict[instance.name] = instance; +} +exports.registerUploader = registerUploader; diff --git a/lib/utils/uploader/qiniu.d.ts b/lib/utils/uploader/qiniu.d.ts new file mode 100644 index 000000000..3559e72df --- /dev/null +++ b/lib/utils/uploader/qiniu.d.ts @@ -0,0 +1,10 @@ +import { EntityDict } from '../../oak-app-domain'; +import { EntityDict as BaseEntityDict } from 'oak-domain'; +import { BackendRuntimeContext } from '../../context/BackendRuntimeContext'; +import Uploader from "../../types/Uploader"; +import { OpSchema } from '../../oak-app-domain/ExtraFile/Schema'; +export default class Qiniu> implements Uploader { + name: string; + formUploadMeta(extraFile: OpSchema, context: Cxt): Promise; + upload(extraFile: OpSchema, confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise): Promise; +} diff --git a/lib/utils/uploader/qiniu.js b/lib/utils/uploader/qiniu.js new file mode 100644 index 000000000..f9b28a157 --- /dev/null +++ b/lib/utils/uploader/qiniu.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +var tslib_1 = require("tslib"); +var Qiniu = /** @class */ (function () { + function Qiniu() { + this.name = 'qiniu'; + } + Qiniu.prototype.formUploadMeta = function (extraFile, context) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + throw new Error('method not implemented'); + }); + }); + }; + Qiniu.prototype.upload = function (extraFile, confirmUploadFn, uploadFailureFn) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + throw new Error('method not implemented'); + }); + }); + }; + return Qiniu; +}()); +exports.default = Qiniu; +; diff --git a/src/entities/ExtraFile.ts b/src/entities/ExtraFile.ts index 4adccc3bf..dd80ace86 100644 --- a/src/entities/ExtraFile.ts +++ b/src/entities/ExtraFile.ts @@ -19,6 +19,7 @@ export interface Schema extends EntityShape { sort?: Float<22,10>; fileType?: String<128>; isBridge?: Boolean; + uploadMeta?: Object; }; const entityDesc: EntityDesc | null; fileType?: String<128> | null; isBridge?: Boolean | null; + uploadMeta?: Object | null; }; export type OpAttr = keyof OpSchema; export type Schema = EntityShape & { @@ -45,6 +46,7 @@ export type Schema = EntityShape & { sort?: Float<22, 10> | null; fileType?: String<128> | null; isBridge?: Boolean | null; + uploadMeta?: Object | null; article?: Article.Schema; articleMenu?: ArticleMenu.Schema; user?: User.Schema; @@ -72,6 +74,7 @@ type AttrFilter = { sort: Q_NumberValue; fileType: Q_StringValue; isBridge: Q_BooleanValue; + uploadMeta: Object; article: Article.Filter; articleMenu: ArticleMenu.Filter; user: User.Filter; @@ -100,6 +103,7 @@ export type Projection = { sort?: number; fileType?: number; isBridge?: number; + uploadMeta?: number | Object; article?: Article.Projection; articleMenu?: ArticleMenu.Projection; user?: User.Projection; diff --git a/src/oak-app-domain/ExtraFile/Storage.ts b/src/oak-app-domain/ExtraFile/Storage.ts index 10b08eb58..05ffb1f19 100644 --- a/src/oak-app-domain/ExtraFile/Storage.ts +++ b/src/oak-app-domain/ExtraFile/Storage.ts @@ -95,6 +95,9 @@ export const desc: StorageDesc = { }, isBridge: { type: "boolean" + }, + uploadMeta: { + type: "object" } }, actionType: "crud", diff --git a/src/oak-app-domain/ExtraFile/locales/zh_CN.json b/src/oak-app-domain/ExtraFile/locales/zh_CN.json index 2b5dc840f..96673d221 100644 --- a/src/oak-app-domain/ExtraFile/locales/zh_CN.json +++ b/src/oak-app-domain/ExtraFile/locales/zh_CN.json @@ -1 +1 @@ -{"name":"文件","attr":{"origin":"源","type":"类型","bucket":"桶","objectId":"对象编号","tag1":"标签一","tag2":"标签二","filename":"文件名","md5":"md5","entity":"关联对象","entityId":"关联对象id","extra1":"额外信息","extension":"后缀名","size":"文件大小","sort":"排序","fileType":"文件类型","isBridge":"是否桥接访问"},"v":{"origin":{"qiniu":"七牛云","unknown":"未知"},"type":{"image":"图像","video":"视频","audio":"音频","file":"文件"}}} \ No newline at end of file +{"name":"文件","attr":{"origin":"源","type":"类型","bucket":"桶","objectId":"对象编号","tag1":"标签一","tag2":"标签二","filename":"文件名","md5":"md5","entity":"关联对象","entityId":"关联对象id","extra1":"额外信息","extension":"后缀名","size":"文件大小","sort":"排序","fileType":"文件类型","isBridge":"是否桥接访问","uploadMeta":"上传需要的metadata"},"v":{"origin":{"qiniu":"七牛云","unknown":"未知"},"type":{"image":"图像","video":"视频","audio":"音频","file":"文件"}}} \ No newline at end of file diff --git a/src/triggers/extraFile.ts b/src/triggers/extraFile.ts new file mode 100644 index 000000000..4239ee8e7 --- /dev/null +++ b/src/triggers/extraFile.ts @@ -0,0 +1,37 @@ +import { CreateTrigger, Trigger } from 'oak-domain/lib/types/Trigger'; +import { EntityDict } from '../oak-app-domain/EntityDict'; +import { BackendRuntimeContext } from '../context/BackendRuntimeContext'; + +import UploaderDict from '../utils/uploader'; +import { OakException } from 'oak-domain'; + +const triggers: Trigger>[] = [ + { + name: '生成extraFile需要的上传meta', + when: 'before', + entity: 'extraFile', + action: 'create', + fn: async({ operation }, context) => { + const { data } = operation; + + const formMeta = async(data: EntityDict['extraFile']['OpSchema']) => { + const { origin } = data; + const uploader = UploaderDict[origin]; + if (!uploader) { + throw new OakException(`origin为${origin}的extraFile没有定义上传类,请调用registerUploader注入`); + } + await uploader.formUploadMeta(data, context); + } + if (data instanceof Array) { + await Promise.all( + data.map(ele => formMeta(ele as EntityDict['extraFile']['OpSchema'])) + ); + return data.length; + } + await formMeta(data as EntityDict['extraFile']['OpSchema']); + return 1; + } + } as CreateTrigger>, +]; + +export default triggers; diff --git a/src/triggers/index.ts b/src/triggers/index.ts index 3c024012f..039216577 100644 --- a/src/triggers/index.ts +++ b/src/triggers/index.ts @@ -9,6 +9,7 @@ import applicationTriggers from './application'; import articleMenuTriggers from './articleMenu'; import article from './article'; import parasiteTriggers from './parasite'; +import extraFileTriggers from './extraFile'; export default [ ...applicationTriggers, @@ -22,4 +23,5 @@ export default [ ...articleMenuTriggers, ...article, ...parasiteTriggers, + ...extraFileTriggers, ]; diff --git a/src/types/Uploader.ts b/src/types/Uploader.ts new file mode 100644 index 000000000..94539e02a --- /dev/null +++ b/src/types/Uploader.ts @@ -0,0 +1,24 @@ +import { EntityDict } from '../oak-app-domain'; +import { EntityDict as BaseEntityDict } from 'oak-domain' +import { BackendRuntimeContext } from '../context/BackendRuntimeContext'; + +export default interface Uploader>{ + name: string; + + /** + * 注入在后台extrafile生成之前 + * @param extraFile,要生成的extraFile数据 + * @param context 后台上下文 + * @returns + */ + formUploadMeta: (extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; + + /** + * 前台在生成extraFile返回之后调用此函数,进行对文件的真正上传 + * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则由前台调用confirmUploadFn去通知后台(实现者尽量不要调用) + * 上传失败,调用uploadFailureFn进行数据的处理 + * @param extraFile + * @returns + */ + upload: (extraFile: EntityDict['extraFile']['OpSchema'], confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise) => Promise; +} \ No newline at end of file diff --git a/src/utils/uploader/index.ts b/src/utils/uploader/index.ts new file mode 100644 index 000000000..c59351029 --- /dev/null +++ b/src/utils/uploader/index.ts @@ -0,0 +1,24 @@ +import { EntityDict } from '../../oak-app-domain'; +import { EntityDict as BaseEntityDict } from 'oak-domain' +import { BackendRuntimeContext } from '../../context/BackendRuntimeContext'; + +import Uploader from "../../types/Uploader"; +import Qiniu from "./qiniu"; + +type ED = EntityDict & BaseEntityDict; +const qiniu = new Qiniu>(); + +const UploaderDict: Record>> = { + [qiniu.name]: qiniu, +}; + +export default UploaderDict; + +/** + * 注入一个其它OSS上实现的uploader类 + * @param clazz + */ +export function registerUploader>(clazz: new () => Uploader) { + const instance = new clazz(); + UploaderDict[instance.name] = instance as Uploader>; +} diff --git a/src/utils/uploader/qiniu.ts b/src/utils/uploader/qiniu.ts new file mode 100644 index 000000000..614267582 --- /dev/null +++ b/src/utils/uploader/qiniu.ts @@ -0,0 +1,18 @@ +import { EntityDict } from '../../oak-app-domain'; +import { EntityDict as BaseEntityDict } from 'oak-domain' +import { BackendRuntimeContext } from '../../context/BackendRuntimeContext'; + +import Uploader from "../../types/Uploader"; +import { OpSchema } from '../../oak-app-domain/ExtraFile/Schema'; + +export default class Qiniu> implements Uploader { + name = 'qiniu'; + + async formUploadMeta(extraFile: OpSchema, context: Cxt) { + throw new Error('method not implemented'); + } + + async upload(extraFile: OpSchema, confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise) { + throw new Error('method not implemented'); + } +}; From 0b0c69ff48d401f590afe30169d8039d85aee18b Mon Sep 17 00:00:00 2001 From: Xc Date: Wed, 6 Sep 2023 23:01:37 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=86uploader?= =?UTF-8?q?=E7=9A=84=E6=8E=A5=E5=8F=A3=EF=BC=8C=E6=9A=82=E6=97=B6=E5=B0=81?= =?UTF-8?q?=E9=97=AD=E4=BA=86extrafile=E7=94=9F=E6=88=90uploadMeta?= =?UTF-8?q?=E7=9A=84trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/triggers/index.ts | 3 ++- src/types/Uploader.ts | 27 +++++++++++++++++++++++---- src/utils/uploader/qiniu.ts | 12 +++++++++++- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/triggers/index.ts b/src/triggers/index.ts index 039216577..c798f63eb 100644 --- a/src/triggers/index.ts +++ b/src/triggers/index.ts @@ -23,5 +23,6 @@ export default [ ...articleMenuTriggers, ...article, ...parasiteTriggers, - ...extraFileTriggers, + // todo 等实现了再放开 + // ...extraFileTriggers, ]; diff --git a/src/types/Uploader.ts b/src/types/Uploader.ts index 94539e02a..dd5c758d6 100644 --- a/src/types/Uploader.ts +++ b/src/types/Uploader.ts @@ -14,11 +14,30 @@ export default interface Uploader Promise; /** - * 前台在生成extraFile返回之后调用此函数,进行对文件的真正上传 - * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则由前台调用confirmUploadFn去通知后台(实现者尽量不要调用) - * 上传失败,调用uploadFailureFn进行数据的处理 + * 前台在生成extraFile返回之后调用此函数,获得上传OSS的相应参数 + * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则将autoInform置为false,前台主动在上传成功之后去更新 * @param extraFile * @returns */ - upload: (extraFile: EntityDict['extraFile']['OpSchema'], confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise) => Promise; + getUploadInfo: (extraFile: EntityDict['extraFile']['OpSchema']) => { + name: string; // 文件的part name + uploadUrl: string; // 上传的url + formData: Record; // 上传的其它part参数 + autoInform: boolean; // 上传成功是否会自动通知server(若不会则需要前台显式通知) + }; + + /** + * 后台对upload是否成功不确定的文件,向OSS发起主动确认 + * @param extraFile + * @returns 是否已经上传OSS成功 + */ + checkWhetherSuccess: (extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; + + /** + * 后台向OSS发起删除命令 + * @param extraFile + * @param context + * @returns + */ + removeFile:(extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; } \ No newline at end of file diff --git a/src/utils/uploader/qiniu.ts b/src/utils/uploader/qiniu.ts index 614267582..ff0d51684 100644 --- a/src/utils/uploader/qiniu.ts +++ b/src/utils/uploader/qiniu.ts @@ -12,7 +12,17 @@ export default class Qiniu Promise, uploadFailureFn: (reason: string) => Promise) { + getUploadInfo(extraFile: OpSchema) { + throw new Error('method not implemented'); + return {} as any; + } + + async checkWhetherSuccess(extraFile: OpSchema, context: Cxt) { + throw new Error('method not implemented'); + return false; + } + + async removeFile(extraFile: OpSchema, context: Cxt) { throw new Error('method not implemented'); } }; From a026f591a7def93b30e6882980ca4456f541cdf7 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Wed, 6 Sep 2023 23:15:34 +0800 Subject: [PATCH 3/4] =?UTF-8?q?build=20lib/es=20=E5=90=88=E6=88=90?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index d7246bdb1..f158a88f4 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "scripts": { "make:locale": "ts-node ./scripts/buildLocale.ts", "make:domain": "ts-node ./scripts/make.ts", - "clean": "rimraf lib/*", + "clean": "rimraf lib/* && rimraf es/*", "copy-js": "copyfiles -u 1 src/**/*.js lib/ & copyfiles -u 1 src/**/*.js es/", "copy-svg": "copyfiles -u 1 src/**/*.svg lib/ & copyfiles -u 1 src/**/*.png lib/ & copyfiles -u 1 src/**/*.svg es/ & copyfiles -u 1 src/**/*.png es/", "copy-less": "copyfiles -u 1 src/**/*.less lib/ & copyfiles -u 1 src/**/*.wxss lib/ & copyfiles -u 1 src/**/*.css lib/ & copyfiles -u 1 src/**/*.less es/ & copyfiles -u 1 src/**/*.wxss es/ & copyfiles -u 1 src/**/*.css es/", @@ -92,8 +92,7 @@ "copy-xml": "copyfiles -u 1 src/**/*.xml lib/ & copyfiles -u 1 src/**/*.xml es/", "copy-wxml": "copyfiles -u 1 src/**/*.wxml lib/ & copyfiles -u 1 src/**/*.wxml es/", "prebuild": "npm run make:locale", - "build": "tsc -p tsconfig.json && npm run copy-js && npm run copy-less && npm run copy-wxs && npm run copy-svg && npm run copy-xml && npm run copy-wxml", - "build-es": "tsc -p tsconfig.es.json && npm run copy-js && npm run copy-less && npm run copy-wxs && npm run copy-svg && npm run copy-xml && npm run copy-wxml", + "build": "tsc -p tsconfig.json && tsc -p tsconfig.es.json && npm run copy-js && npm run copy-less && npm run copy-wxs && npm run copy-svg && npm run copy-xml && npm run copy-wxml", "gen:areaDebug": "ts-node ./scripts/generateAreaDebug.ts", "gen:subway": "ts-node ./scripts/local/getAmapSubway.ts", "clean:dir": "ts-node ./scripts/cleanDtsAndJs", From 2dc0b411849b98829f7372eec1441170d3ee1c29 Mon Sep 17 00:00:00 2001 From: wkj <278599135@qq.com> Date: Wed, 6 Sep 2023 23:18:22 +0800 Subject: [PATCH 4/4] build --- es/triggers/index.d.ts | 2 +- es/triggers/index.js | 4 ++-- es/types/Uploader.d.ts | 25 +++++++++++++++++++++---- es/utils/uploader/qiniu.d.ts | 4 +++- es/utils/uploader/qiniu.js | 10 +++++++++- lib/triggers/index.d.ts | 2 +- lib/triggers/index.js | 3 +-- lib/types/Uploader.d.ts | 25 +++++++++++++++++++++---- lib/utils/uploader/qiniu.d.ts | 4 +++- lib/utils/uploader/qiniu.js | 13 ++++++++++++- 10 files changed, 74 insertions(+), 18 deletions(-) diff --git a/es/triggers/index.d.ts b/es/triggers/index.d.ts index 1527f9a5a..9055a9fc4 100644 --- a/es/triggers/index.d.ts +++ b/es/triggers/index.d.ts @@ -1,2 +1,2 @@ -declare const _default: (import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger>)[]; +declare const _default: (import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger>)[]; export default _default; diff --git a/es/triggers/index.js b/es/triggers/index.js index 1b4dc8cfb..8c747d6f1 100644 --- a/es/triggers/index.js +++ b/es/triggers/index.js @@ -9,7 +9,6 @@ import applicationTriggers from './application'; import articleMenuTriggers from './articleMenu'; import article from './article'; import parasiteTriggers from './parasite'; -import extraFileTriggers from './extraFile'; export default [ ...applicationTriggers, ...addressTriggers, @@ -22,5 +21,6 @@ export default [ ...articleMenuTriggers, ...article, ...parasiteTriggers, - ...extraFileTriggers, + // todo 等实现了再放开 + // ...extraFileTriggers, ]; diff --git a/es/types/Uploader.d.ts b/es/types/Uploader.d.ts index f692ddd58..699ecc96b 100644 --- a/es/types/Uploader.d.ts +++ b/es/types/Uploader.d.ts @@ -11,11 +11,28 @@ export default interface Uploader Promise; /** - * 前台在生成extraFile返回之后调用此函数,进行对文件的真正上传 - * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则由前台调用confirmUploadFn去通知后台(实现者尽量不要调用) - * 上传失败,调用uploadFailureFn进行数据的处理 + * 前台在生成extraFile返回之后调用此函数,获得上传OSS的相应参数 + * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则将autoInform置为false,前台主动在上传成功之后去更新 * @param extraFile * @returns */ - upload: (extraFile: EntityDict['extraFile']['OpSchema'], confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise) => Promise; + getUploadInfo: (extraFile: EntityDict['extraFile']['OpSchema']) => { + name: string; + uploadUrl: string; + formData: Record; + autoInform: boolean; + }; + /** + * 后台对upload是否成功不确定的文件,向OSS发起主动确认 + * @param extraFile + * @returns 是否已经上传OSS成功 + */ + checkWhetherSuccess: (extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; + /** + * 后台向OSS发起删除命令 + * @param extraFile + * @param context + * @returns + */ + removeFile: (extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; } diff --git a/es/utils/uploader/qiniu.d.ts b/es/utils/uploader/qiniu.d.ts index 3559e72df..f78c6e943 100644 --- a/es/utils/uploader/qiniu.d.ts +++ b/es/utils/uploader/qiniu.d.ts @@ -6,5 +6,7 @@ import { OpSchema } from '../../oak-app-domain/ExtraFile/Schema'; export default class Qiniu> implements Uploader { name: string; formUploadMeta(extraFile: OpSchema, context: Cxt): Promise; - upload(extraFile: OpSchema, confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise): Promise; + getUploadInfo(extraFile: OpSchema): any; + checkWhetherSuccess(extraFile: OpSchema, context: Cxt): Promise; + removeFile(extraFile: OpSchema, context: Cxt): Promise; } diff --git a/es/utils/uploader/qiniu.js b/es/utils/uploader/qiniu.js index 64939bae1..13e2ebca3 100644 --- a/es/utils/uploader/qiniu.js +++ b/es/utils/uploader/qiniu.js @@ -3,7 +3,15 @@ export default class Qiniu { async formUploadMeta(extraFile, context) { throw new Error('method not implemented'); } - async upload(extraFile, confirmUploadFn, uploadFailureFn) { + getUploadInfo(extraFile) { + throw new Error('method not implemented'); + return {}; + } + async checkWhetherSuccess(extraFile, context) { + throw new Error('method not implemented'); + return false; + } + async removeFile(extraFile, context) { throw new Error('method not implemented'); } } diff --git a/lib/triggers/index.d.ts b/lib/triggers/index.d.ts index 1527f9a5a..9055a9fc4 100644 --- a/lib/triggers/index.d.ts +++ b/lib/triggers/index.d.ts @@ -1,2 +1,2 @@ -declare const _default: (import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger>)[]; +declare const _default: (import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger | import("oak-domain").Trigger | import("oak-domain").Trigger> | import("oak-domain").Trigger> | import("oak-domain").Trigger>)[]; export default _default; diff --git a/lib/triggers/index.js b/lib/triggers/index.js index 24495bb67..c5889f0c8 100644 --- a/lib/triggers/index.js +++ b/lib/triggers/index.js @@ -12,5 +12,4 @@ var application_1 = tslib_1.__importDefault(require("./application")); var articleMenu_1 = tslib_1.__importDefault(require("./articleMenu")); var article_1 = tslib_1.__importDefault(require("./article")); var parasite_1 = tslib_1.__importDefault(require("./parasite")); -var extraFile_1 = tslib_1.__importDefault(require("./extraFile")); -exports.default = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(application_1.default), false), tslib_1.__read(address_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false), tslib_1.__read(message_1.default), false), tslib_1.__read(notification_1.default), false), tslib_1.__read(wechatLogin_1.default), false), tslib_1.__read(articleMenu_1.default), false), tslib_1.__read(article_1.default), false), tslib_1.__read(parasite_1.default), false), tslib_1.__read(extraFile_1.default), false); +exports.default = tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray(tslib_1.__spreadArray([], tslib_1.__read(application_1.default), false), tslib_1.__read(address_1.default), false), tslib_1.__read(user_1.default), false), tslib_1.__read(userEntityGrant_1.default), false), tslib_1.__read(wechatQrCode_1.default), false), tslib_1.__read(message_1.default), false), tslib_1.__read(notification_1.default), false), tslib_1.__read(wechatLogin_1.default), false), tslib_1.__read(articleMenu_1.default), false), tslib_1.__read(article_1.default), false), tslib_1.__read(parasite_1.default), false); diff --git a/lib/types/Uploader.d.ts b/lib/types/Uploader.d.ts index f692ddd58..699ecc96b 100644 --- a/lib/types/Uploader.d.ts +++ b/lib/types/Uploader.d.ts @@ -11,11 +11,28 @@ export default interface Uploader Promise; /** - * 前台在生成extraFile返回之后调用此函数,进行对文件的真正上传 - * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则由前台调用confirmUploadFn去通知后台(实现者尽量不要调用) - * 上传失败,调用uploadFailureFn进行数据的处理 + * 前台在生成extraFile返回之后调用此函数,获得上传OSS的相应参数 + * 上传成功后,OSS服务器尽量使用通过后台回调服务器的方式去确认上传,若OSS不提供此能力则将autoInform置为false,前台主动在上传成功之后去更新 * @param extraFile * @returns */ - upload: (extraFile: EntityDict['extraFile']['OpSchema'], confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise) => Promise; + getUploadInfo: (extraFile: EntityDict['extraFile']['OpSchema']) => { + name: string; + uploadUrl: string; + formData: Record; + autoInform: boolean; + }; + /** + * 后台对upload是否成功不确定的文件,向OSS发起主动确认 + * @param extraFile + * @returns 是否已经上传OSS成功 + */ + checkWhetherSuccess: (extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; + /** + * 后台向OSS发起删除命令 + * @param extraFile + * @param context + * @returns + */ + removeFile: (extraFile: EntityDict['extraFile']['OpSchema'], context: Cxt) => Promise; } diff --git a/lib/utils/uploader/qiniu.d.ts b/lib/utils/uploader/qiniu.d.ts index 3559e72df..f78c6e943 100644 --- a/lib/utils/uploader/qiniu.d.ts +++ b/lib/utils/uploader/qiniu.d.ts @@ -6,5 +6,7 @@ import { OpSchema } from '../../oak-app-domain/ExtraFile/Schema'; export default class Qiniu> implements Uploader { name: string; formUploadMeta(extraFile: OpSchema, context: Cxt): Promise; - upload(extraFile: OpSchema, confirmUploadFn: () => Promise, uploadFailureFn: (reason: string) => Promise): Promise; + getUploadInfo(extraFile: OpSchema): any; + checkWhetherSuccess(extraFile: OpSchema, context: Cxt): Promise; + removeFile(extraFile: OpSchema, context: Cxt): Promise; } diff --git a/lib/utils/uploader/qiniu.js b/lib/utils/uploader/qiniu.js index f9b28a157..5a39d1c64 100644 --- a/lib/utils/uploader/qiniu.js +++ b/lib/utils/uploader/qiniu.js @@ -12,7 +12,18 @@ var Qiniu = /** @class */ (function () { }); }); }; - Qiniu.prototype.upload = function (extraFile, confirmUploadFn, uploadFailureFn) { + Qiniu.prototype.getUploadInfo = function (extraFile) { + throw new Error('method not implemented'); + return {}; + }; + Qiniu.prototype.checkWhetherSuccess = function (extraFile, context) { + return tslib_1.__awaiter(this, void 0, void 0, function () { + return tslib_1.__generator(this, function (_a) { + throw new Error('method not implemented'); + }); + }); + }; + Qiniu.prototype.removeFile = function (extraFile, context) { return tslib_1.__awaiter(this, void 0, void 0, function () { return tslib_1.__generator(this, function (_a) { throw new Error('method not implemented');