diff --git a/es/components/article/cell/index.d.ts b/es/components/article/cell/index.d.ts index 7e54e8a64..cbb0af164 100644 --- a/es/components/article/cell/index.d.ts +++ b/es/components/article/cell/index.d.ts @@ -1,3 +1,2 @@ -/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/article/editor/index.d.ts b/es/components/article/editor/index.d.ts index f9bf5091f..3f111fef0 100644 --- a/es/components/article/editor/index.d.ts +++ b/es/components/article/editor/index.d.ts @@ -5,7 +5,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< tocPosition: "none" | "left" | "right"; highlightBgColor: string; onArticlePreview: (content?: string, title?: string) => void; - origin: import("../../../types/Config").CosOrigin | null; + origin: null | EntityDict["extraFile"]["Schema"]["origin"]; scrollId: string; height: number | "auto"; activeColor: string | undefined; diff --git a/es/components/article/list/index.d.ts b/es/components/article/list/index.d.ts index 8550d91d3..c63d888b1 100644 --- a/es/components/article/list/index.d.ts +++ b/es/components/article/list/index.d.ts @@ -1,10 +1,9 @@ -/// import { GenerateUrlFn } from "../../../types/Article"; declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; }>) => React.ReactElement; export default _default; diff --git a/es/components/article/treeList/index.d.ts b/es/components/article/treeList/index.d.ts index b82c03103..531bb39b4 100644 --- a/es/components/article/treeList/index.d.ts +++ b/es/components/article/treeList/index.d.ts @@ -1,7 +1,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; - show: "preview" | "edit" | "doc"; + show: "edit" | "doc" | "preview"; getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void; breadcrumbItems: string[]; drawerOpen: boolean; diff --git a/es/components/article/upsert/index.d.ts b/es/components/article/upsert/index.d.ts index f9bf5091f..72e4a84c3 100644 --- a/es/components/article/upsert/index.d.ts +++ b/es/components/article/upsert/index.d.ts @@ -5,7 +5,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< tocPosition: "none" | "left" | "right"; highlightBgColor: string; onArticlePreview: (content?: string, title?: string) => void; - origin: import("../../../types/Config").CosOrigin | null; + origin: EntityDict["extraFile"]["Schema"]["origin"] | null; scrollId: string; height: number | "auto"; activeColor: string | undefined; diff --git a/es/components/extraFile/avatar/index.d.ts b/es/components/extraFile/avatar/index.d.ts index e84a8ae1b..81779da02 100644 --- a/es/components/extraFile/avatar/index.d.ts +++ b/es/components/extraFile/avatar/index.d.ts @@ -4,6 +4,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: keyof EntityDict; entityId: string; autoUpload: boolean; - origin: import("../../../types/Config").CosOrigin | null; + origin: EntityDict["extraFile"]["Schema"]["origin"] | null; }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/avatar/index.js b/es/components/extraFile/avatar/index.js index 9b3f5184d..f11880c82 100644 --- a/es/components/extraFile/avatar/index.js +++ b/es/components/extraFile/avatar/index.js @@ -18,6 +18,10 @@ export default OakComponent({ entity: 1, entityId: 1, sort: 1, + fileType: 1, + isBridge: 1, + uploadState: 1, + size: 1, applicationId: 1, }, features: ['extraFile'], diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index f8db05024..9fc209ec1 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../oak-app-domain'; import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity'; import { ReactComponentProps } from 'oak-frontend-base/lib/types/Page'; @@ -9,31 +8,14 @@ type AfterCommit = (() => void) | undefined; type BeforeCommit = (() => boolean | undefined | Promise) | undefined; declare const _default: (props: ReactComponentProps) => unknown) | undefined; - type?: "button" | "reset" | "submit" | undefined; - shape?: "default" | "rounded" | "rectangular" | undefined; - children?: import("react").ReactNode; - } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseDown" | "onMouseUp" | "onTouchEnd" | "onTouchStart"> & { - className?: string | undefined; - style?: (import("react").CSSProperties & Partial>) | undefined; - tabIndex?: number | undefined; - } & import("react").AriaAttributes) | undefined; + action?: string; + size?: ButtonProps["size"] | AmButtonProps["size"]; + block?: boolean; + type?: ButtonProps["type"] | AmButtonProps["type"]; + executeText?: string; + buttonProps?: ButtonProps & AmButtonProps; afterCommit?: AfterCommit; beforeCommit?: BeforeCommit; - messageProps?: boolean | MessageProps | undefined; + messageProps?: MessageProps | boolean; }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/crop/index.d.ts b/es/components/extraFile/crop/index.d.ts index 76b906ef0..31c97a1e0 100644 --- a/es/components/extraFile/crop/index.d.ts +++ b/es/components/extraFile/crop/index.d.ts @@ -20,7 +20,7 @@ declare const _default: ) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/gallery/index.js b/es/components/extraFile/gallery/index.js index 7e3d08e92..261c45a63 100644 --- a/es/components/extraFile/gallery/index.js +++ b/es/components/extraFile/gallery/index.js @@ -11,6 +11,7 @@ export default OakComponent({ objectId: 1, filename: 1, extra1: 1, + extra2: 1, extension: 1, type: 1, entity: 1, @@ -19,6 +20,8 @@ export default OakComponent({ sort: 1, isBridge: 1, uploadState: 1, + size: 1, + applicationId: 1, }, features: ['extraFile'], formData({ data, features }) { @@ -67,10 +70,10 @@ export default OakComponent({ }, ], properties: { - mode: 'aspectFit', - size: 3, - disablePreview: false, - disableDownload: false, + mode: 'aspectFit', // 图片显示模式 + size: 3, // 每行可显示的个数 小程序独有 + disablePreview: false, // 图片是否可预览 + disableDownload: false, // 下载按钮隐藏 tag1: '', tag2: '', entity: '', diff --git a/es/components/extraFile/upload/index.d.ts b/es/components/extraFile/upload/index.d.ts index 1b27e40fc..ce11a16ad 100644 --- a/es/components/extraFile/upload/index.d.ts +++ b/es/components/extraFile/upload/index.d.ts @@ -1,4 +1,3 @@ -/// import { EntityDict } from '../../../oak-app-domain'; import { FileState } from '../../../features/extraFile'; import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity'; @@ -21,7 +20,7 @@ declare const _default: Promise; }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/upload/index.js b/es/components/extraFile/upload/index.js index f4159dfb3..01a1f6004 100644 --- a/es/components/extraFile/upload/index.js +++ b/es/components/extraFile/upload/index.js @@ -13,6 +13,7 @@ export default OakComponent({ objectId: 1, filename: 1, extra1: 1, + extra2: 1, extension: 1, type: 1, entity: 1, @@ -50,19 +51,19 @@ export default OakComponent({ bucket: '', autoUpload: false, maxNumber: 20, - extension: [], - selectCount: 1, - sourceType: ['album', 'camera'], - mediaType: ['image'], - mode: 'aspectFit', - size: 3, - showUploadList: true, - showUploadProgress: false, - accept: 'image/*', - disablePreview: false, - disableDelete: false, - disableAdd: false, - disableDownload: false, + extension: [], //小程序独有 chooseMessageFile + selectCount: 1, // 每次打开图片时,可选中的数量 小程序独有 + sourceType: ['album', 'camera'], // 小程序独有 chooseMedia + mediaType: ['image'], // 小程序独有 chooseMedia + mode: 'aspectFit', // 图片显示模式 + size: 3, // 每行可显示的个数 小程序独有 + showUploadList: true, //web独有 + showUploadProgress: false, // web独有 + accept: 'image/*', // web独有 + disablePreview: false, // 图片是否可预览 + disableDelete: false, // 图片是否可删除 + disableAdd: false, // 上传按钮隐藏 + disableDownload: false, // 下载按钮隐藏 type: 'image', origin: null, tag1: '', @@ -147,7 +148,7 @@ export default OakComponent({ type, tag1, tag2, - objectId: generateNewId(), + objectId: generateNewId(), // 这个域用来标识唯一性 entity, filename, size, diff --git a/es/components/extraFile/upload/web.d.ts b/es/components/extraFile/upload/web.d.ts index 6fbe667ff..557f90d9b 100644 --- a/es/components/extraFile/upload/web.d.ts +++ b/es/components/extraFile/upload/web.d.ts @@ -8,23 +8,23 @@ export interface UploadHandle { } declare const _default: React.ForwardRefExoticComponent Promise | boolean) | undefined; - style?: React.CSSProperties | undefined; - className?: string | undefined; - directory?: boolean | undefined; - onPreview?: ((file: UploadFile) => void) | undefined; - onDownload?: ((file: UploadFile) => void) | undefined; - showUploadList?: boolean | undefined; - children?: JSX.Element | undefined; - disableInsert?: boolean | undefined; - disableDownload?: boolean | undefined; - disableDelete?: boolean | undefined; - disablePreview?: boolean | undefined; + accept?: string; + maxNumber?: number; + multiple?: boolean; + draggable?: boolean; + theme?: Theme; + beforeUpload?: (file: File) => Promise | boolean; + style?: React.CSSProperties; + className?: string; + directory?: boolean; + onPreview?: (file: UploadFile) => void; + onDownload?: (file: UploadFile) => void; + showUploadList?: boolean; + children?: JSX.Element; + disableInsert?: boolean; + disableDownload?: boolean; + disableDelete?: boolean; + disablePreview?: boolean; }, { onRemove: (file: UploadFile) => void; addFileByWeb: (file: UploadFile) => void; diff --git a/es/endpoints/wechat.d.ts b/es/endpoints/wechat.d.ts index 567c48b94..e30a77f89 100644 --- a/es/endpoints/wechat.d.ts +++ b/es/endpoints/wechat.d.ts @@ -2,6 +2,6 @@ import { Endpoint } from 'oak-domain/lib/types/Endpoint'; import { EntityDict } from '../oak-app-domain'; import { BRC } from '../types/RuntimeCxt'; import { WechatPublicEventData } from 'oak-external-sdk/lib/types/Wechat'; -export declare function registerWeChatPublicEventCallback(appId: string, callback: (data: WechatPublicEventData, context: BRC) => void): void; +export declare function registerWeChatPublicEventCallback(appId: string, callback: (data: WechatPublicEventData, context: BRC) => Promise): void; declare const endpoints: Record>>; export default endpoints; diff --git a/es/endpoints/wechat.js b/es/endpoints/wechat.js index b40214db9..c3135920a 100644 --- a/es/endpoints/wechat.js +++ b/es/endpoints/wechat.js @@ -484,7 +484,7 @@ async function onWeChatPublicEvent(data, context) { let evt; // 如果有应用注入的事件回调则处理之,不依赖其返回 if (CALLBACK[appId]) { - CALLBACK[appId](data, context); + await CALLBACK[appId](data, context); } // 接收事件推送 if (MsgType === 'event') { diff --git a/es/triggers/extraFile.js b/es/triggers/extraFile.js index a8c58add3..317321401 100644 --- a/es/triggers/extraFile.js +++ b/es/triggers/extraFile.js @@ -84,6 +84,9 @@ const triggers = [ objectId: 1, bucket: 1, extension: 1, + entity: 1, + entityId: 1, + extra2: 1, applicationId: 1, application: applicationProjection }, diff --git a/lib/endpoints/wechat.d.ts b/lib/endpoints/wechat.d.ts index 567c48b94..e30a77f89 100644 --- a/lib/endpoints/wechat.d.ts +++ b/lib/endpoints/wechat.d.ts @@ -2,6 +2,6 @@ import { Endpoint } from 'oak-domain/lib/types/Endpoint'; import { EntityDict } from '../oak-app-domain'; import { BRC } from '../types/RuntimeCxt'; import { WechatPublicEventData } from 'oak-external-sdk/lib/types/Wechat'; -export declare function registerWeChatPublicEventCallback(appId: string, callback: (data: WechatPublicEventData, context: BRC) => void): void; +export declare function registerWeChatPublicEventCallback(appId: string, callback: (data: WechatPublicEventData, context: BRC) => Promise): void; declare const endpoints: Record>>; export default endpoints; diff --git a/lib/endpoints/wechat.js b/lib/endpoints/wechat.js index 2c1a7db52..9f8c25c2e 100644 --- a/lib/endpoints/wechat.js +++ b/lib/endpoints/wechat.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.registerWeChatPublicEventCallback = void 0; +exports.registerWeChatPublicEventCallback = registerWeChatPublicEventCallback; const tslib_1 = require("tslib"); const assert_1 = require("oak-domain/lib/utils/assert"); const url_1 = tslib_1.__importDefault(require("url")); @@ -30,7 +30,6 @@ function registerWeChatPublicEventCallback(appId, callback) { (0, assert_1.assert)(!CALLBACK.hasOwnProperty(appId)); CALLBACK[appId] = callback; } -exports.registerWeChatPublicEventCallback = registerWeChatPublicEventCallback; /** * 用户取关事件,注意要容wechatUser不存在的情况 * @param openId @@ -489,7 +488,7 @@ async function onWeChatPublicEvent(data, context) { let evt; // 如果有应用注入的事件回调则处理之,不依赖其返回 if (CALLBACK[appId]) { - CALLBACK[appId](data, context); + await CALLBACK[appId](data, context); } // 接收事件推送 if (MsgType === 'event') { diff --git a/lib/triggers/extraFile.js b/lib/triggers/extraFile.js index 1d576fadb..e1e400dad 100644 --- a/lib/triggers/extraFile.js +++ b/lib/triggers/extraFile.js @@ -87,6 +87,9 @@ const triggers = [ objectId: 1, bucket: 1, extension: 1, + entity: 1, + entityId: 1, + extra2: 1, applicationId: 1, application: Projection_1.applicationProjection }, diff --git a/src/endpoints/wechat.ts b/src/endpoints/wechat.ts index 560e85362..4cf1011a3 100644 --- a/src/endpoints/wechat.ts +++ b/src/endpoints/wechat.ts @@ -40,12 +40,12 @@ function assertFromWeChat(query: VerifyQuery, config: WechatPublicConfig | Wecha const CALLBACK: Record< string, - (data: WechatPublicEventData, context: BRC) => void + (data: WechatPublicEventData, context: BRC) => Promise > = {}; export function registerWeChatPublicEventCallback( appId: string, - callback: (data: WechatPublicEventData, context: BRC) => void + callback: (data: WechatPublicEventData, context: BRC) => Promise ) { assert(!CALLBACK.hasOwnProperty(appId)); @@ -631,7 +631,7 @@ async function onWeChatPublicEvent(data: WechatPublicEventData, context: BRC