From 20cc101f88f7c9ed2a05447205d58a2c209117e6 Mon Sep 17 00:00:00 2001 From: Xc Date: Wed, 12 Nov 2025 12:57:08 +0800 Subject: [PATCH] =?UTF-8?q?userRelationUpsert=E9=A1=B5=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E5=88=86=E4=BA=AB=E9=80=BB=E8=BE=91=E4=B8=8D=E6=88=90=E7=AB=8B?= =?UTF-8?q?=EF=BC=8C=E9=80=9A=E8=BF=87=E5=9B=9E=E8=B0=83=E7=BB=99=E4=B8=8A?= =?UTF-8?q?=E5=B1=82=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- es/aspects/oauth.js | 2 +- es/aspects/template.d.ts | 2 +- es/aspects/token.js | 4 +- es/components/address/list/index.d.ts | 1 + es/components/address/upsert/index.d.ts | 1 + .../amap/location/PositionPicker.d.ts | 1 + es/components/amap/location/index.d.ts | 1 + es/components/amap/map/index.d.ts | 1 + es/components/application/cos/web.pc.d.ts | 2 +- es/components/application/detail/index.d.ts | 1 + .../application/detailForPlatform/index.d.ts | 1 + es/components/application/upsert/index.d.ts | 1 + es/components/article/cell/index.d.ts | 1 + es/components/article/editor/index.d.ts | 2 +- es/components/article/list/index.d.ts | 3 +- es/components/article/treeList/index.d.ts | 2 +- es/components/article/upsert/index.d.ts | 2 +- .../articleMenu/container/index.d.ts | 7 +-- es/components/articleMenu/list/index.d.ts | 5 +- es/components/articleMenu/treeCell/index.d.ts | 4 +- es/components/articleMenu/treeList/index.d.ts | 4 +- .../articleMenu/treeManager/index.d.ts | 4 +- .../changePassword/byMobile/index.d.ts | 1 + .../changePassword/byPassword/index.d.ts | 1 + es/components/common/download/index.d.ts | 5 +- es/components/common/errorPage/index.d.ts | 4 +- es/components/common/qrCode/index.d.ts | 16 +++--- es/components/common/tabBar/index.d.ts | 10 ++-- .../config/style/platform/index.d.ts | 2 +- es/components/config/upsert/index.d.ts | 2 +- es/components/domain/detail/index.d.ts | 1 + es/components/domain/upsert/index.d.ts | 1 + es/components/editor/index.d.ts | 2 +- es/components/extraFile/avatar/index.d.ts | 2 +- es/components/extraFile/commit/index.d.ts | 32 +++++++++--- es/components/extraFile/crop/index.d.ts | 6 +-- es/components/extraFile/gallery/index.d.ts | 2 +- es/components/extraFile/upload/index.d.ts | 7 +-- es/components/extraFile/upload/web.d.ts | 34 ++++++------- .../login/oauth/authorize/web.pc.d.ts | 4 +- es/components/message/cell/index.d.ts | 1 + es/components/message/detail/index.d.ts | 1 + es/components/message/list/index.d.ts | 1 + .../messageTypeSmsTemplate/list/index.d.ts | 2 +- es/components/mobile/login/index.d.ts | 2 +- es/components/mobile/manageList/index.d.ts | 1 + es/components/my/avatar/index.d.ts | 2 +- es/components/my/message/index.d.ts | 1 + .../management/oauthApps/upsert/web.pc.d.ts | 4 +- .../oauth/management/oauthApps/web.pc.d.ts | 4 +- .../oauthProvider/upsert/web.pc.d.ts | 4 +- .../management/oauthProvider/web.pc.d.ts | 4 +- es/components/oauth/records/web.pc.d.ts | 4 +- es/components/parasite/excess/index.d.ts | 1 + es/components/parasite/upsert/index.d.ts | 2 +- es/components/platform/detail/index.d.ts | 1 + es/components/platform/upsert/index.d.ts | 1 + es/components/session/forMessage/index.d.ts | 2 +- es/components/session/header/index.d.ts | 1 + es/components/session/list/index.d.ts | 4 +- es/components/sessionMessage/list/index.d.ts | 2 +- .../subscription/config/upsert/index.d.ts | 1 + es/components/subscription/detail/index.d.ts | 1 + es/components/subwayLine/picker/index.d.ts | 2 +- es/components/system/detail/index.d.ts | 1 + es/components/system/upsert/index.d.ts | 1 + es/components/token/me/emptyBody/index.d.ts | 1 + es/components/token/me/index.d.ts | 3 +- .../user/authenticate/idCard/index.d.ts | 2 +- es/components/user/authenticate/index.d.ts | 2 +- es/components/user/login/index.js | 8 +-- es/components/user/password/verify/index.d.ts | 2 +- es/components/user/password/verify/web.d.ts | 1 + .../user/password/verify/web.pc.d.ts | 1 + .../userEntityGrant/claim/index.d.ts | 12 ++--- es/components/userEntityGrant/claim/index.xml | 2 +- .../userEntityGrant/claim/ubPicker/index.d.ts | 4 +- .../userEntityGrant/upsert/index.d.ts | 8 +-- .../userRelation/upsert/byMobile/index.d.ts | 8 +-- .../userRelation/upsert/byUser/index.d.ts | 4 +- .../upsert/byUserEntityGrant/index.d.ts | 9 ++-- .../upsert/byUserEntityGrant/index.js | 15 ++++-- es/components/userRelation/upsert/index.d.ts | 6 +-- es/components/userRelation/upsert/index.js | 1 + es/components/userRelation/upsert/index.xml | 1 + .../userRelation/upsert/onUser/index.d.ts | 2 +- .../upsert/onUser/userRelation/index.d.ts | 2 +- es/components/userRelation/upsert/web.d.ts | 1 + es/components/userRelation/upsert/web.js | 4 +- es/components/userRelation/upsert/web.pc.d.ts | 1 + es/components/userRelation/upsert/web.pc.js | 4 +- es/components/wechatLogin/confirm/index.d.ts | 1 + es/components/wechatLogin/qrCode/index.d.ts | 2 +- es/components/wechatMenu/menuInfo/index.d.ts | 2 +- .../wechatUser/bindingList/index.d.ts | 1 + es/components/wechatUser/login/index.d.ts | 1 + es/components/wechatUser/unbindBtn/index.d.ts | 1 + .../Application/_baseSchema.d.ts | 1 + es/triggers/index.d.ts | 2 +- es/utils/email/index.d.ts | 2 +- es/utils/oauth/index.d.ts | 4 +- lib/aspects/oauth.js | 11 ++-- lib/aspects/template.d.ts | 2 +- lib/aspects/token.js | 51 ++++++++++--------- .../Application/_baseSchema.d.ts | 1 + lib/triggers/index.d.ts | 2 +- lib/utils/email/index.d.ts | 2 +- lib/utils/oauth/index.d.ts | 4 +- .../userEntityGrant/claim/index.xml | 2 +- .../upsert/byUserEntityGrant/index.ts | 7 ++- src/components/userRelation/upsert/index.ts | 1 + src/components/userRelation/upsert/index.xml | 1 + src/components/userRelation/upsert/web.pc.tsx | 3 ++ src/components/userRelation/upsert/web.tsx | 3 ++ 114 files changed, 265 insertions(+), 181 deletions(-) diff --git a/es/aspects/oauth.js b/es/aspects/oauth.js index 32d2d76d4..215ea1f0c 100644 --- a/es/aspects/oauth.js +++ b/es/aspects/oauth.js @@ -329,7 +329,7 @@ export async function authorize(params, context) { applicationId: context.getApplicationId(), userId: context.getCurrentUserId(), scope: scope === undefined ? [] : [scope], - expiresAt: Date.now() + 10 * 60 * 1000, // 10分钟后过期 + expiresAt: Date.now() + 10 * 60 * 1000, // PKCE 支持 codeChallenge: code_challenge, codeChallengeMethod: code_challenge_method || 'plain', diff --git a/es/aspects/template.d.ts b/es/aspects/template.d.ts index 290b776b2..3e1d30898 100644 --- a/es/aspects/template.d.ts +++ b/es/aspects/template.d.ts @@ -19,6 +19,6 @@ export declare function syncMessageTemplate(params: { example: string; keywordEnumValueList: { keywordCode: string; - enumValueList: Array; + enumValueList: string[]; }[]; }[]>; diff --git a/es/aspects/token.js b/es/aspects/token.js index 2972a85dd..9ccc91f25 100644 --- a/es/aspects/token.js +++ b/es/aspects/token.js @@ -2546,8 +2546,8 @@ export async function refreshToken(params, context) { // 只有server模式去刷新token // 'development' | 'production' | 'staging' const intervals = { - development: 7200 * 1000, // 2小时 - staging: 600 * 1000, // 十分钟 + development: 7200 * 1000, + staging: 600 * 1000, production: 600 * 1000, // 十分钟 }; let applicationId = token.applicationId; diff --git a/es/components/address/list/index.d.ts b/es/components/address/list/index.d.ts index ff8c6a49c..eb7c9c471 100644 --- a/es/components/address/list/index.d.ts +++ b/es/components/address/list/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/address/upsert/index.d.ts b/es/components/address/upsert/index.d.ts index 04a2aeb0b..543b66d91 100644 --- a/es/components/address/upsert/index.d.ts +++ b/es/components/address/upsert/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/amap/location/PositionPicker.d.ts b/es/components/amap/location/PositionPicker.d.ts index 079e9fc08..95455897b 100644 --- a/es/components/amap/location/PositionPicker.d.ts +++ b/es/components/amap/location/PositionPicker.d.ts @@ -1,3 +1,4 @@ +/// import React from 'react'; export type PositionProps = { loadUI: boolean; diff --git a/es/components/amap/location/index.d.ts b/es/components/amap/location/index.d.ts index 5c543de6b..67f2a992f 100644 --- a/es/components/amap/location/index.d.ts +++ b/es/components/amap/location/index.d.ts @@ -1,3 +1,4 @@ +/// import React from 'react'; import { ModalProps } from 'antd'; import { GeolocationProps } from '@uiw/react-amap'; diff --git a/es/components/amap/map/index.d.ts b/es/components/amap/map/index.d.ts index ed3e63766..288bdd24a 100644 --- a/es/components/amap/map/index.d.ts +++ b/es/components/amap/map/index.d.ts @@ -1,3 +1,4 @@ +/// import React from 'react'; import { MapProps, APILoaderConfig } from '@uiw/react-amap'; import './index.less'; diff --git a/es/components/application/cos/web.pc.d.ts b/es/components/application/cos/web.pc.d.ts index 4dfb1dbf1..d5290a98f 100644 --- a/es/components/application/cos/web.pc.d.ts +++ b/es/components/application/cos/web.pc.d.ts @@ -2,7 +2,7 @@ import React from 'react'; import { WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../oak-app-domain'; declare const Cos: (props: WebComponentProps declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/application/detailForPlatform/index.d.ts b/es/components/application/detailForPlatform/index.d.ts index 6b6e8e37f..f1528b757 100644 --- a/es/components/application/detailForPlatform/index.d.ts +++ b/es/components/application/detailForPlatform/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/application/upsert/index.d.ts b/es/components/application/upsert/index.d.ts index 2ca3cf7d3..f0ad771b5 100644 --- a/es/components/application/upsert/index.d.ts +++ b/es/components/application/upsert/index.d.ts @@ -1,3 +1,4 @@ +/// import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/article/cell/index.d.ts b/es/components/article/cell/index.d.ts index cbb0af164..7e54e8a64 100644 --- a/es/components/article/cell/index.d.ts +++ b/es/components/article/cell/index.d.ts @@ -1,2 +1,3 @@ +/// 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 3f111fef0..f9bf5091f 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: null | EntityDict["extraFile"]["Schema"]["origin"]; + origin: import("../../../types/Config").CosOrigin | null; 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 c63d888b1..8550d91d3 100644 --- a/es/components/article/list/index.d.ts +++ b/es/components/article/list/index.d.ts @@ -1,9 +1,10 @@ +/// 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 531bb39b4..6f4290f52 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: "edit" | "doc" | "preview"; + show: "preview" | "doc" | "edit"; 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 72e4a84c3..f9bf5091f 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: EntityDict["extraFile"]["Schema"]["origin"] | null; + origin: import("../../../types/Config").CosOrigin | null; scrollId: string; height: number | "auto"; activeColor: string | undefined; diff --git a/es/components/articleMenu/container/index.d.ts b/es/components/articleMenu/container/index.d.ts index eda38eb91..4045e76de 100644 --- a/es/components/articleMenu/container/index.d.ts +++ b/es/components/articleMenu/container/index.d.ts @@ -1,12 +1,13 @@ +/// import { EntityDict } from "../../../oak-app-domain"; import { GenerateUrlFn } from "../../../types/Article"; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/articleMenu/list/index.d.ts b/es/components/articleMenu/list/index.d.ts index 7ba5ef00b..a1f227ab2 100644 --- a/es/components/articleMenu/list/index.d.ts +++ b/es/components/articleMenu/list/index.d.ts @@ -1,13 +1,14 @@ +/// import { GenerateUrlFn } from "../../../types/Article"; import { EntityDict } from "../../../oak-app-domain"; declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; onArticleClick: (atricleId: string) => void; - empty: React.ReactNode | undefined; + empty: import("react").ReactNode; changeAddArticle: (show: boolean) => void; generateUrl: GenerateUrlFn; }>) => React.ReactElement; diff --git a/es/components/articleMenu/treeCell/index.d.ts b/es/components/articleMenu/treeCell/index.d.ts index 62f135048..cf2f68008 100644 --- a/es/components/articleMenu/treeCell/index.d.ts +++ b/es/components/articleMenu/treeCell/index.d.ts @@ -3,7 +3,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< onRemove: () => void; onUpdateName: (name: string) => Promise; onChildEditArticleChange: (data: string) => void; - show: "edit" | "doc" | "preview"; + show: "preview" | "doc" | "edit"; getBreadcrumbItemsByParent: (breadcrumbItems: string[]) => void; breadItems: string[]; drawerOpen: boolean; @@ -25,6 +25,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< setCurrentArticle: (id: string) => void; onMenuViewById: (articleMenuId: string) => void; setCopyArticleUrl: (id: string) => string; - origin: null | EntityDict["extraFile"]["Schema"]["origin"]; + origin: import("../../../types/Config").CosOrigin | null; }>) => React.ReactElement; export default _default; diff --git a/es/components/articleMenu/treeList/index.d.ts b/es/components/articleMenu/treeList/index.d.ts index 9cb126f75..c2bb66915 100644 --- a/es/components/articleMenu/treeList/index.d.ts +++ b/es/components/articleMenu/treeList/index.d.ts @@ -4,7 +4,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entityId: string; parentId: string | undefined; onGrandChildEditArticleChange: (data: string) => void; - show: "edit" | "doc" | "preview"; + show: "preview" | "doc" | "edit"; articleMenuId: string; articleId: string; getBreadcrumbItems: (breadcrumbItems: string[]) => void; @@ -31,6 +31,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< setCurrentArticle: (id: string) => void; onMenuViewById: (articleMenuId: string) => void; setCopyArticleUrl: (id: string) => string; - origin: null | EntityDict["extraFile"]["Schema"]["origin"]; + origin: import("../../../types/Config").CosOrigin | null; }>) => React.ReactElement; export default _default; diff --git a/es/components/articleMenu/treeManager/index.d.ts b/es/components/articleMenu/treeManager/index.d.ts index 087c217ff..5cfce96f5 100644 --- a/es/components/articleMenu/treeManager/index.d.ts +++ b/es/components/articleMenu/treeManager/index.d.ts @@ -2,7 +2,7 @@ import { EntityDict } from "../../../oak-app-domain/EntityDict"; declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; onArticleEdit: (articleId: string) => void; setCopyArticleUrl: (articleId: string) => string; - origin: EntityDict["extraFile"]["Schema"]["origin"] | null; + origin: import("../../../types/Config").CosOrigin | null; scrollId: string; activeColor: string | undefined; }>) => React.ReactElement; diff --git a/es/components/changePassword/byMobile/index.d.ts b/es/components/changePassword/byMobile/index.d.ts index 9b24ef2db..9e6eb4aca 100644 --- a/es/components/changePassword/byMobile/index.d.ts +++ b/es/components/changePassword/byMobile/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/changePassword/byPassword/index.d.ts b/es/components/changePassword/byPassword/index.d.ts index 9b24ef2db..9e6eb4aca 100644 --- a/es/components/changePassword/byPassword/index.d.ts +++ b/es/components/changePassword/byPassword/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/common/download/index.d.ts b/es/components/common/download/index.d.ts index 35b6ec953..13d24ef6c 100644 --- a/es/components/common/download/index.d.ts +++ b/es/components/common/download/index.d.ts @@ -1,3 +1,4 @@ +/// import * as React from 'react'; type IDownloadProps = { children?: React.ReactNode; @@ -8,9 +9,9 @@ type IDownloadProps = { }; declare function Download(props: IDownloadProps): React.JSX.Element; declare namespace Download { - var onDownload: (data: ArrayBuffer | ReadableStream, filename: string) => Promise; + var onDownload: (data: ArrayBuffer | ReadableStream, filename: string) => Promise; var base64ToBlob: (base64String: string) => Blob; var arrayBufferToBase64: (buffer: Buffer) => string; - var base64ToArrayBuffer: (base64String: string) => ArrayBuffer; + var base64ToArrayBuffer: (base64String: string) => ArrayBufferLike; } export default Download; diff --git a/es/components/common/errorPage/index.d.ts b/es/components/common/errorPage/index.d.ts index 4f66d7816..19593d8e7 100644 --- a/es/components/common/errorPage/index.d.ts +++ b/es/components/common/errorPage/index.d.ts @@ -4,8 +4,8 @@ import { ReactComponentProps } from 'oak-frontend-base'; import { ECode } from '../../../types/ErrorPage'; declare const _default: (props: ReactComponentProps) => React.ReactElement; diff --git a/es/components/common/qrCode/index.d.ts b/es/components/common/qrCode/index.d.ts index b6dc556f5..772ca4b3a 100644 --- a/es/components/common/qrCode/index.d.ts +++ b/es/components/common/qrCode/index.d.ts @@ -2,21 +2,21 @@ import { EntityDict } from '../../../oak-app-domain'; import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity'; import { ReactComponentProps } from 'oak-frontend-base'; declare const _default: (props: ReactComponentProps void; - onRefresh?: () => void; - size?: number; + onDownload?: ((qrCodeImage: string, filename?: string) => void) | undefined; + onRefresh?: (() => void) | undefined; + size?: number | undefined; url: string; - loading?: boolean; - disableDownload?: boolean; + loading?: boolean | undefined; + disableDownload?: boolean | undefined; disabled: boolean; color: string; bgColor: string; maskColor: string; maskTextColor: string; maskText: string; - mode: "simple" | "default"; + mode: 'simple' | 'default'; }>) => React.ReactElement; export default _default; diff --git a/es/components/common/tabBar/index.d.ts b/es/components/common/tabBar/index.d.ts index 11ce7e31d..97fd2535a 100644 --- a/es/components/common/tabBar/index.d.ts +++ b/es/components/common/tabBar/index.d.ts @@ -6,11 +6,11 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< redDot: boolean; text: string; pagePath: string; - iconName?: string; - selectedIconName?: string; - iconPath?: string; - selectedIconPath?: string; - iconSize?: string; + iconName?: string | undefined; + selectedIconName?: string | undefined; + iconPath?: string | undefined; + selectedIconPath?: string | undefined; + iconSize?: string | undefined; }[]; color: string; selectedColor: string; diff --git a/es/components/config/style/platform/index.d.ts b/es/components/config/style/platform/index.d.ts index 9224d2cdc..2f2afe1c1 100644 --- a/es/components/config/style/platform/index.d.ts +++ b/es/components/config/style/platform/index.d.ts @@ -1,7 +1,7 @@ import { Style } from '../../../../types/Style'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; diff --git a/es/components/config/upsert/index.d.ts b/es/components/config/upsert/index.d.ts index a4b61c5c2..9bf014f88 100644 --- a/es/components/config/upsert/index.d.ts +++ b/es/components/config/upsert/index.d.ts @@ -1,7 +1,7 @@ import { Config } from '../../../types/Config'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; diff --git a/es/components/domain/detail/index.d.ts b/es/components/domain/detail/index.d.ts index cfd5bb519..a7112bd2e 100644 --- a/es/components/domain/detail/index.d.ts +++ b/es/components/domain/detail/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/domain/upsert/index.d.ts b/es/components/domain/upsert/index.d.ts index cfd5bb519..a7112bd2e 100644 --- a/es/components/domain/upsert/index.d.ts +++ b/es/components/domain/upsert/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/editor/index.d.ts b/es/components/editor/index.d.ts index 2738bc808..b00654764 100644 --- a/es/components/editor/index.d.ts +++ b/es/components/editor/index.d.ts @@ -12,6 +12,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entityId: string; tag1: string; tag2: string; - origin: EntityDict["extraFile"]["Schema"]["origin"] | null; + origin: import("../../types/Config").CosOrigin | null; }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/avatar/index.d.ts b/es/components/extraFile/avatar/index.d.ts index 81779da02..e84a8ae1b 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: EntityDict["extraFile"]["Schema"]["origin"] | null; + origin: import("../../../types/Config").CosOrigin | null; }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/commit/index.d.ts b/es/components/extraFile/commit/index.d.ts index 9fc209ec1..a3f711a38 100644 --- a/es/components/extraFile/commit/index.d.ts +++ b/es/components/extraFile/commit/index.d.ts @@ -1,3 +1,4 @@ +/// 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'; @@ -8,14 +9,31 @@ type AfterCommit = (() => void) | undefined; type BeforeCommit = (() => boolean | undefined | Promise) | undefined; declare const _default: (props: ReactComponentProps) => unknown) | undefined; + type?: "reset" | "submit" | "button" | undefined; + shape?: "default" | "rounded" | "rectangular" | undefined; + children?: import("react").ReactNode; + } & Pick & import("react").ButtonHTMLAttributes, "id" | "onMouseUp" | "onMouseDown" | "onTouchStart" | "onTouchEnd"> & { + className?: string | undefined; + style?: (import("react").CSSProperties & Partial>) | undefined; + tabIndex?: number | undefined; + } & import("react").AriaAttributes) | undefined; afterCommit?: AfterCommit; beforeCommit?: BeforeCommit; - messageProps?: MessageProps | boolean; + messageProps?: boolean | MessageProps | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/crop/index.d.ts b/es/components/extraFile/crop/index.d.ts index 31c97a1e0..76b906ef0 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/upload/index.d.ts b/es/components/extraFile/upload/index.d.ts index ce11a16ad..1b27e40fc 100644 --- a/es/components/extraFile/upload/index.d.ts +++ b/es/components/extraFile/upload/index.d.ts @@ -1,3 +1,4 @@ +/// import { EntityDict } from '../../../oak-app-domain'; import { FileState } from '../../../features/extraFile'; import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity'; @@ -20,7 +21,7 @@ declare const _default: Promise; }>) => React.ReactElement; export default _default; diff --git a/es/components/extraFile/upload/web.d.ts b/es/components/extraFile/upload/web.d.ts index 557f90d9b..6fbe667ff 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; - 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; + accept?: string | undefined; + maxNumber?: number | undefined; + multiple?: boolean | undefined; + draggable?: boolean | undefined; + theme?: Theme | undefined; + beforeUpload?: ((file: File) => 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; }, { onRemove: (file: UploadFile) => void; addFileByWeb: (file: UploadFile) => void; diff --git a/es/components/login/oauth/authorize/web.pc.d.ts b/es/components/login/oauth/authorize/web.pc.d.ts index 54bc0cc57..368ac8fe5 100644 --- a/es/components/login/oauth/authorize/web.pc.d.ts +++ b/es/components/login/oauth/authorize/web.pc.d.ts @@ -5,13 +5,13 @@ declare const Authorize: (props: WebComponentProps declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/message/detail/index.d.ts b/es/components/message/detail/index.d.ts index 8e5aeae49..b6a428c8d 100644 --- a/es/components/message/detail/index.d.ts +++ b/es/components/message/detail/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/message/list/index.d.ts b/es/components/message/list/index.d.ts index 59c862ae1..7d50f35ad 100644 --- a/es/components/message/list/index.d.ts +++ b/es/components/message/list/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/messageTypeSmsTemplate/list/index.d.ts b/es/components/messageTypeSmsTemplate/list/index.d.ts index 344a6070e..cd5b93954 100644 --- a/es/components/messageTypeSmsTemplate/list/index.d.ts +++ b/es/components/messageTypeSmsTemplate/list/index.d.ts @@ -1,6 +1,6 @@ import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/mobile/login/index.d.ts b/es/components/mobile/login/index.d.ts index bc8043074..c5b493c7e 100644 --- a/es/components/mobile/login/index.d.ts +++ b/es/components/mobile/login/index.d.ts @@ -2,6 +2,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< onlyCaptcha: boolean; onlyPassword: boolean; eventLoggedIn: string; - callback: ((() => void) | undefined); + callback: (() => void) | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/mobile/manageList/index.d.ts b/es/components/mobile/manageList/index.d.ts index 9f53f5a71..1423e77bb 100644 --- a/es/components/mobile/manageList/index.d.ts +++ b/es/components/mobile/manageList/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/my/avatar/index.d.ts b/es/components/my/avatar/index.d.ts index 6b4976c3a..cecab0c89 100644 --- a/es/components/my/avatar/index.d.ts +++ b/es/components/my/avatar/index.d.ts @@ -1,6 +1,6 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; diff --git a/es/components/my/message/index.d.ts b/es/components/my/message/index.d.ts index fc416ef2a..4007eded7 100644 --- a/es/components/my/message/index.d.ts +++ b/es/components/my/message/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/oauth/management/oauthApps/upsert/web.pc.d.ts b/es/components/oauth/management/oauthApps/upsert/web.pc.d.ts index 8fa6c426c..9805d9a90 100644 --- a/es/components/oauth/management/oauthApps/upsert/web.pc.d.ts +++ b/es/components/oauth/management/oauthApps/upsert/web.pc.d.ts @@ -1,8 +1,8 @@ import React from 'react'; import { RowWithActions, WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../../oak-app-domain'; -declare const Upsert: (props: WebComponentProps; +declare const Upsert: (props: WebComponentProps; clientSecret: string; isCreation: boolean; }, { diff --git a/es/components/oauth/management/oauthApps/web.pc.d.ts b/es/components/oauth/management/oauthApps/web.pc.d.ts index 476053768..734c71852 100644 --- a/es/components/oauth/management/oauthApps/web.pc.d.ts +++ b/es/components/oauth/management/oauthApps/web.pc.d.ts @@ -1,8 +1,8 @@ import React from 'react'; import { RowWithActions, WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../oak-app-domain'; -declare const OauthProvider: (props: WebComponentProps[]; +declare const OauthProvider: (props: WebComponentProps[]; systemId: string; }>) => React.JSX.Element; export default OauthProvider; diff --git a/es/components/oauth/management/oauthProvider/upsert/web.pc.d.ts b/es/components/oauth/management/oauthProvider/upsert/web.pc.d.ts index 545aa6dd6..85a05e095 100644 --- a/es/components/oauth/management/oauthProvider/upsert/web.pc.d.ts +++ b/es/components/oauth/management/oauthProvider/upsert/web.pc.d.ts @@ -1,7 +1,7 @@ import React from 'react'; import { RowWithActions, WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../../oak-app-domain'; -declare const Upsert: (props: WebComponentProps; +declare const Upsert: (props: WebComponentProps; }>) => React.JSX.Element; export default Upsert; diff --git a/es/components/oauth/management/oauthProvider/web.pc.d.ts b/es/components/oauth/management/oauthProvider/web.pc.d.ts index d95afb547..72c18d5ae 100644 --- a/es/components/oauth/management/oauthProvider/web.pc.d.ts +++ b/es/components/oauth/management/oauthProvider/web.pc.d.ts @@ -1,8 +1,8 @@ import React from 'react'; import { RowWithActions, WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../../oak-app-domain'; -declare const OauthProvider: (props: WebComponentProps[]; +declare const OauthProvider: (props: WebComponentProps[]; systemId: string; }>) => React.JSX.Element; export default OauthProvider; diff --git a/es/components/oauth/records/web.pc.d.ts b/es/components/oauth/records/web.pc.d.ts index 2e1766f5c..50fc56a14 100644 --- a/es/components/oauth/records/web.pc.d.ts +++ b/es/components/oauth/records/web.pc.d.ts @@ -2,8 +2,8 @@ import React from 'react'; import { RowWithActions, WebComponentProps } from 'oak-frontend-base'; import { EntityDict } from '../../../oak-app-domain'; declare const Records: (props: WebComponentProps[]; + list: RowWithActions[]; }, { - revoke: (item: RowWithActions) => void; + revoke: (item: RowWithActions) => void; }>) => React.JSX.Element; export default Records; diff --git a/es/components/parasite/excess/index.d.ts b/es/components/parasite/excess/index.d.ts index 4b5cde729..aeab4e2c1 100644 --- a/es/components/parasite/excess/index.d.ts +++ b/es/components/parasite/excess/index.d.ts @@ -1,3 +1,4 @@ +/// import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/parasite/upsert/index.d.ts b/es/components/parasite/upsert/index.d.ts index 3bbe5ff2a..cb8a698e0 100644 --- a/es/components/parasite/upsert/index.d.ts +++ b/es/components/parasite/upsert/index.d.ts @@ -5,7 +5,7 @@ declare const _default: declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/platform/upsert/index.d.ts b/es/components/platform/upsert/index.d.ts index 92179f82c..2f4ee4714 100644 --- a/es/components/platform/upsert/index.d.ts +++ b/es/components/platform/upsert/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/session/forMessage/index.d.ts b/es/components/session/forMessage/index.d.ts index 162fded2e..3040df8a6 100644 --- a/es/components/session/forMessage/index.d.ts +++ b/es/components/session/forMessage/index.d.ts @@ -1,7 +1,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps Array; + entityDisplay: (data: any) => any[]; entityProjection: any; }>) => React.ReactElement; export default _default; diff --git a/es/components/session/header/index.d.ts b/es/components/session/header/index.d.ts index fc416ef2a..4007eded7 100644 --- a/es/components/session/header/index.d.ts +++ b/es/components/session/header/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/session/list/index.d.ts b/es/components/session/list/index.d.ts index 419f5cf42..bf432d40c 100644 --- a/es/components/session/list/index.d.ts +++ b/es/components/session/list/index.d.ts @@ -4,10 +4,10 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: string; entityFilter: any; entityFilterSubStr: string; - entityDisplay: (data: EntityDict["session"]["Schema"][] | RowWithActions[]) => Array; + entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions[]) => any[]; entityProjection: any; sessionId: string; dialog: boolean; - onItemClick: ((sessionId: string) => {}) | undefined | null; + onItemClick: ((sessionId: string) => {}) | null | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/sessionMessage/list/index.d.ts b/es/components/sessionMessage/list/index.d.ts index 41e8e86d4..ab50d269f 100644 --- a/es/components/sessionMessage/list/index.d.ts +++ b/es/components/sessionMessage/list/index.d.ts @@ -6,7 +6,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< dialog: boolean; entity: string; entityId: string; - entityDisplay: (data: EntityDict["session"]["Schema"][] | RowWithActions[]) => Array; + entityDisplay: (data: EntityDict['session']['Schema'][] | RowWithActions[]) => any[]; entityProjection: any; }>) => React.ReactElement; export default _default; diff --git a/es/components/subscription/config/upsert/index.d.ts b/es/components/subscription/config/upsert/index.d.ts index ae1dbd523..e5f2d178d 100644 --- a/es/components/subscription/config/upsert/index.d.ts +++ b/es/components/subscription/config/upsert/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/subscription/detail/index.d.ts b/es/components/subscription/detail/index.d.ts index 5a7970c9c..66d28049e 100644 --- a/es/components/subscription/detail/index.d.ts +++ b/es/components/subscription/detail/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/subwayLine/picker/index.d.ts b/es/components/subwayLine/picker/index.d.ts index 7907e4ed6..12eb7190d 100644 --- a/es/components/subwayLine/picker/index.d.ts +++ b/es/components/subwayLine/picker/index.d.ts @@ -1,5 +1,5 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void) | undefined; onConfirm: ((stationIds: string[]) => void) | undefined; selectIds: string[] | undefined; diff --git a/es/components/system/detail/index.d.ts b/es/components/system/detail/index.d.ts index aaf164c34..8bf853bbb 100644 --- a/es/components/system/detail/index.d.ts +++ b/es/components/system/detail/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/system/upsert/index.d.ts b/es/components/system/upsert/index.d.ts index aaf164c34..8bf853bbb 100644 --- a/es/components/system/upsert/index.d.ts +++ b/es/components/system/upsert/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/token/me/emptyBody/index.d.ts b/es/components/token/me/emptyBody/index.d.ts index ce03a624e..094ac520b 100644 --- a/es/components/token/me/emptyBody/index.d.ts +++ b/es/components/token/me/emptyBody/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/token/me/index.d.ts b/es/components/token/me/index.d.ts index c3b729bd6..85b087bea 100644 --- a/es/components/token/me/index.d.ts +++ b/es/components/token/me/index.d.ts @@ -1,8 +1,9 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; myInfoUrl: string; manageUserUrl: string; loginUrl: string; - Body: React.ReactNode | undefined; + Body: import("react").ReactNode; }>) => React.ReactElement; export default _default; diff --git a/es/components/user/authenticate/idCard/index.d.ts b/es/components/user/authenticate/idCard/index.d.ts index ad2c0daa9..4fa77e554 100644 --- a/es/components/user/authenticate/idCard/index.d.ts +++ b/es/components/user/authenticate/idCard/index.d.ts @@ -1,6 +1,6 @@ import { EntityDict } from '../../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps void) | undefined; needUploadPhotos: boolean; diff --git a/es/components/user/login/index.js b/es/components/user/login/index.js index 5291dca4a..fe72809c6 100644 --- a/es/components/user/login/index.js +++ b/es/components/user/login/index.js @@ -17,16 +17,16 @@ export default OakComponent({ allowPassword: false, allowWechatMp: false, setLoginModeMp(value) { this.setLoginMode(value); }, - smsDigit: 4, //短信验证码位数 - emailDigit: 4, //邮箱验证码位数 + smsDigit: 4, + emailDigit: 4, pwdMode: 'all', //密码明文密文存储模式 }, properties: { onlyCaptcha: false, onlyPassword: false, disabled: '', - redirectUri: '', // 微信登录后的redirectUri,要指向wechatUser/login去处理 - url: '', // 登录系统之后要返回的页面 + redirectUri: '', + url: '', callback: undefined, // 登录成功回调,排除微信登录方式 }, formData({ features, props }) { diff --git a/es/components/user/password/verify/index.d.ts b/es/components/user/password/verify/index.d.ts index 721288d6b..c5fb2e667 100644 --- a/es/components/user/password/verify/index.d.ts +++ b/es/components/user/password/verify/index.d.ts @@ -1,4 +1,4 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps void); + onVerified: (() => void) | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/user/password/verify/web.d.ts b/es/components/user/password/verify/web.d.ts index 8c7e08cdd..cb271e15f 100644 --- a/es/components/user/password/verify/web.d.ts +++ b/es/components/user/password/verify/web.d.ts @@ -1,3 +1,4 @@ +/// import { WebComponentProps } from "oak-frontend-base"; import { EntityDict } from "../../../../oak-app-domain"; export default function Render(props: WebComponentProps import { WebComponentProps } from "oak-frontend-base"; import { EntityDict } from "../../../../oak-app-domain"; export default function Render(props: WebComponentProps void; onPickRows: (ids: string[]) => void; - pickedRowIds?: string[]; - pickedRelationIds?: string[]; + pickedRowIds?: string[] | undefined; + pickedRelationIds?: string[] | undefined; oakPath: string; }) => React.ReactElement) | undefined; hideInfo: boolean; hideTip: boolean; - afterClaim: ((ueg: EntityDict["userEntityGrant"]["OpSchema"]) => void) | undefined; + afterClaim: ((ueg: EntityDict['userEntityGrant']['OpSchema']) => void) | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/userEntityGrant/claim/index.xml b/es/components/userEntityGrant/claim/index.xml index 76b3adf44..4e9074dc4 100644 --- a/es/components/userEntityGrant/claim/index.xml +++ b/es/components/userEntityGrant/claim/index.xml @@ -40,7 +40,7 @@ onPickRelations="{{onPickRelationsMp}}" pickedRelationIds="{{pickedRelationIds}}" pickedRowIds="{{pickedRowIds}}" - oakPath="{{oakFullpath}}-$uegClaim-content" + oakPath="$$uegClaim-picker" /> diff --git a/es/components/userEntityGrant/claim/ubPicker/index.d.ts b/es/components/userEntityGrant/claim/ubPicker/index.d.ts index d7583bcca..baeab2b34 100644 --- a/es/components/userEntityGrant/claim/ubPicker/index.d.ts +++ b/es/components/userEntityGrant/claim/ubPicker/index.d.ts @@ -4,8 +4,8 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< entity: keyof EntityDict; entityFilter: any; relationIds: string[]; - rule: EntityDict["userEntityGrant"]["OpSchema"]["rule"]; - ruleOnRow: EntityDict["userEntityGrant"]["OpSchema"]["ruleOnRow"]; + rule: "all" | "single" | "free"; + ruleOnRow: "all" | "single" | "free"; onPickRelations: (ids: string[]) => void; onPickRows: (ids: string[]) => void; pickedRowIds: string[] | undefined; diff --git a/es/components/userEntityGrant/upsert/index.d.ts b/es/components/userEntityGrant/upsert/index.d.ts index 5ab1ea9b4..e2f62ec19 100644 --- a/es/components/userEntityGrant/upsert/index.d.ts +++ b/es/components/userEntityGrant/upsert/index.d.ts @@ -6,12 +6,12 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< relationEntity: string; relationEntityFilter: any; relationIds: string[]; - type: EntityDict["userEntityGrant"]["Schema"]["type"]; - redirectToAfterConfirm: EntityDict["userEntityGrant"]["Schema"]["redirectTo"]; + type: "grant" | "transfer"; + redirectToAfterConfirm: import("../../../oak-app-domain/UserEntityGrant/_baseSchema").RedirectToProps | null | undefined; claimUrl: string; qrCodeType: QrCodeType; multiple: boolean; - rule: EntityDict["userEntityGrant"]["OpSchema"]["rule"]; - ruleOnRow: EntityDict["userEntityGrant"]["OpSchema"]["ruleOnRow"]; + rule: "all" | "single" | "free"; + ruleOnRow: "all" | "single" | "free"; }>) => React.ReactElement; export default _default; diff --git a/es/components/userRelation/upsert/byMobile/index.d.ts b/es/components/userRelation/upsert/byMobile/index.d.ts index 83fdd447c..7ed47c734 100644 --- a/es/components/userRelation/upsert/byMobile/index.d.ts +++ b/es/components/userRelation/upsert/byMobile/index.d.ts @@ -4,9 +4,9 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity'; declare const _default: (props: ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/userRelation/upsert/byUser/index.d.ts b/es/components/userRelation/upsert/byUser/index.d.ts index 4940119bf..57ff8d988 100644 --- a/es/components/userRelation/upsert/byUser/index.d.ts +++ b/es/components/userRelation/upsert/byUser/index.d.ts @@ -4,7 +4,7 @@ import { EntityDict as BaseEntityDict } from 'oak-domain/lib/types/Entity'; declare const _default: (props: ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/userRelation/upsert/byUserEntityGrant/index.d.ts b/es/components/userRelation/upsert/byUserEntityGrant/index.d.ts index f5b4288cf..5c6e1bdab 100644 --- a/es/components/userRelation/upsert/byUserEntityGrant/index.d.ts +++ b/es/components/userRelation/upsert/byUserEntityGrant/index.d.ts @@ -7,11 +7,12 @@ declare const _default: void) | undefined; }>) => React.ReactElement; export default _default; diff --git a/es/components/userRelation/upsert/byUserEntityGrant/index.js b/es/components/userRelation/upsert/byUserEntityGrant/index.js index 00a0420dc..741e058af 100644 --- a/es/components/userRelation/upsert/byUserEntityGrant/index.js +++ b/es/components/userRelation/upsert/byUserEntityGrant/index.js @@ -31,6 +31,7 @@ export default OakComponent({ qrCodeType: '', multiple: false, rule: 'single', + onUserEntityGrantCreated: (id) => undefined, }, data: { period: 15, @@ -65,19 +66,21 @@ export default OakComponent({ }, }, methods: { - onShareAppMessage(e) { + /* 实测在component里没用,通过onUserEntityGrantCreated返回上层,由上层在page里定义 + onShareAppMessage(e: any) { const app = this.features.application.getApplication(); - const { config, system } = app; - const { config: systemConfig } = system; + const { config, system } = app!; + const { config: systemConfig } = system!; const { userEntityGrantId } = this.state; const { claimUrl } = this.props; - const imageUrl = (systemConfig && systemConfig?.App?.mpShareImageUrl) || ''; + const imageUrl = + (systemConfig && systemConfig?.App?.mpShareImageUrl) || ''; return { title: '', path: `/pages${claimUrl}/index?oakId=${userEntityGrantId}`, imageUrl, }; - }, + }, */ setInit() { const userId = this.features.token.getUserId(); const { entity, entityId, type, redirectToAfterConfirm, qrCodeType, claimUrl, multiple, rule, } = this.props; @@ -204,6 +207,8 @@ export default OakComponent({ this.setState({ userEntityGrantId: id, }); + const { onUserEntityGrantCreated } = this.props; + onUserEntityGrantCreated && onUserEntityGrantCreated(id); // 小程序显示可分享菜单 if (process.env.OAK_PLATFORM === 'wechatMp') { wx.showShareMenu({}); diff --git a/es/components/userRelation/upsert/index.d.ts b/es/components/userRelation/upsert/index.d.ts index bfce90975..924306f4c 100644 --- a/es/components/userRelation/upsert/index.d.ts +++ b/es/components/userRelation/upsert/index.d.ts @@ -7,8 +7,8 @@ declare const _default: ; - mode: "byMobile" | "byUserEntityGrant" | "byEmail"; + passwordRequired?: boolean | undefined; + disabledMethods: Array<'email' | 'mobile' | 'userEntityGrant'>; + mode: 'byMobile' | 'byUserEntityGrant' | 'byEmail'; }>) => React.ReactElement; export default _default; diff --git a/es/components/userRelation/upsert/index.js b/es/components/userRelation/upsert/index.js index c19f9924f..94e68ce9a 100644 --- a/es/components/userRelation/upsert/index.js +++ b/es/components/userRelation/upsert/index.js @@ -58,6 +58,7 @@ export default OakComponent({ passwordRequired: false, disabledMethods: [], mode: undefined, + onUserEntityGrantCreated: (id) => undefined, }, lifetimes: { async ready() { diff --git a/es/components/userRelation/upsert/index.xml b/es/components/userRelation/upsert/index.xml index f6d507841..33a29d09c 100644 --- a/es/components/userRelation/upsert/index.xml +++ b/es/components/userRelation/upsert/index.xml @@ -29,6 +29,7 @@ rule="{{rule}}" oakPath="$userRelation-upsert-by-userEntityGrant" redirectToAfterConfirm="{{redirectToAfterConfirm}}" + onUserEntityGrantCreated="{{onUserEntityGrantCreated}}" /> diff --git a/es/components/userRelation/upsert/onUser/index.d.ts b/es/components/userRelation/upsert/onUser/index.d.ts index 1f0ec1ff8..cafe99e04 100644 --- a/es/components/userRelation/upsert/onUser/index.d.ts +++ b/es/components/userRelation/upsert/onUser/index.d.ts @@ -2,7 +2,7 @@ import { EntityDict } from '../../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps void; passwordRequired: boolean; diff --git a/es/components/userRelation/upsert/onUser/userRelation/index.d.ts b/es/components/userRelation/upsert/onUser/userRelation/index.d.ts index 3ce27eed3..5db0a88be 100644 --- a/es/components/userRelation/upsert/onUser/userRelation/index.d.ts +++ b/es/components/userRelation/upsert/onUser/userRelation/index.d.ts @@ -2,6 +2,6 @@ import { EntityDict } from '../../../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/userRelation/upsert/web.d.ts b/es/components/userRelation/upsert/web.d.ts index 36f84fc6c..1bcf01ebf 100644 --- a/es/components/userRelation/upsert/web.d.ts +++ b/es/components/userRelation/upsert/web.d.ts @@ -12,4 +12,5 @@ export default function Render(props: WebComponentProps; + onUserEntityGrantCreated?: (id: string) => undefined; }, {}>): React.JSX.Element; diff --git a/es/components/userRelation/upsert/web.js b/es/components/userRelation/upsert/web.js index 052ae7a2e..6d90582ce 100644 --- a/es/components/userRelation/upsert/web.js +++ b/es/components/userRelation/upsert/web.js @@ -4,7 +4,7 @@ import Style from './mobile.module.less'; import ByMobile from './byMobile/index'; import ByUserEntityGrant from './byUserEntityGrant'; export default function Render(props) { - const { entity, entityId, relations, redirectToAfterConfirm, qrCodeType, claimUrl, rule, passwordRequired, enabled, } = props.data; + const { entity, entityId, relations, redirectToAfterConfirm, qrCodeType, claimUrl, rule, passwordRequired, enabled, onUserEntityGrantCreated, } = props.data; const { t } = props.methods; if (enabled.length === 0) { return (
@@ -20,7 +20,7 @@ export default function Render(props) { return (); } case 'userEntityGrant': { - return (); + return (); } } }); diff --git a/es/components/userRelation/upsert/web.pc.d.ts b/es/components/userRelation/upsert/web.pc.d.ts index c6cf99b45..39b4cbb7c 100644 --- a/es/components/userRelation/upsert/web.pc.d.ts +++ b/es/components/userRelation/upsert/web.pc.d.ts @@ -12,4 +12,5 @@ export default function Render(props: WebComponentProps; + onUserEntityGrantCreated?: (id: string) => undefined; }, {}>): React.JSX.Element; diff --git a/es/components/userRelation/upsert/web.pc.js b/es/components/userRelation/upsert/web.pc.js index f22cc3fd8..3bf061084 100644 --- a/es/components/userRelation/upsert/web.pc.js +++ b/es/components/userRelation/upsert/web.pc.js @@ -4,7 +4,7 @@ import Style from './web.module.less'; import ByMobile from './byMobile/index'; import ByUserEntityGrant from './byUserEntityGrant'; export default function Render(props) { - const { entity, entityId, relations, enabled, redirectToAfterConfirm, qrCodeType, claimUrl, rule, passwordRequired, } = props.data; + const { entity, entityId, relations, enabled, redirectToAfterConfirm, qrCodeType, claimUrl, rule, passwordRequired, onUserEntityGrantCreated, } = props.data; const { t } = props.methods; if (enabled.length === 0) { return (
@@ -20,7 +20,7 @@ export default function Render(props) { return (); } case 'userEntityGrant': { - return (); + return (); } } }); diff --git a/es/components/wechatLogin/confirm/index.d.ts b/es/components/wechatLogin/confirm/index.d.ts index ddbd0e992..7e6f4d539 100644 --- a/es/components/wechatLogin/confirm/index.d.ts +++ b/es/components/wechatLogin/confirm/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/wechatLogin/qrCode/index.d.ts b/es/components/wechatLogin/qrCode/index.d.ts index 6f4ca60a8..db7fcdc9b 100644 --- a/es/components/wechatLogin/qrCode/index.d.ts +++ b/es/components/wechatLogin/qrCode/index.d.ts @@ -1,6 +1,6 @@ import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; diff --git a/es/components/wechatMenu/menuInfo/index.d.ts b/es/components/wechatMenu/menuInfo/index.d.ts index a13918aba..f7b3a780b 100644 --- a/es/components/wechatMenu/menuInfo/index.d.ts +++ b/es/components/wechatMenu/menuInfo/index.d.ts @@ -3,7 +3,7 @@ declare const _default: (props: import("oak-frontend-base").ReactComponentProps< config: any; menuIndex: number; changeConfig: (config: any) => void; - publish: (iState: "wait" | "fail") => void; + publish: (iState: 'wait' | 'fail') => void; getErrorIndex: (errorIndex: number[]) => void; createMenu: () => void; selectedBtn: number; diff --git a/es/components/wechatUser/bindingList/index.d.ts b/es/components/wechatUser/bindingList/index.d.ts index aaff0d728..ab29006fe 100644 --- a/es/components/wechatUser/bindingList/index.d.ts +++ b/es/components/wechatUser/bindingList/index.d.ts @@ -1,3 +1,4 @@ +/// import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/wechatUser/login/index.d.ts b/es/components/wechatUser/login/index.d.ts index fc416ef2a..4007eded7 100644 --- a/es/components/wechatUser/login/index.d.ts +++ b/es/components/wechatUser/login/index.d.ts @@ -1,2 +1,3 @@ +/// declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/components/wechatUser/unbindBtn/index.d.ts b/es/components/wechatUser/unbindBtn/index.d.ts index 3315ada56..611b25119 100644 --- a/es/components/wechatUser/unbindBtn/index.d.ts +++ b/es/components/wechatUser/unbindBtn/index.d.ts @@ -1,3 +1,4 @@ +/// import { EntityDict } from '../../../oak-app-domain'; declare const _default: (props: import("oak-frontend-base").ReactComponentProps) => React.ReactElement; export default _default; diff --git a/es/oak-app-domain/Application/_baseSchema.d.ts b/es/oak-app-domain/Application/_baseSchema.d.ts index af5f6ccfc..22850524b 100644 --- a/es/oak-app-domain/Application/_baseSchema.d.ts +++ b/es/oak-app-domain/Application/_baseSchema.d.ts @@ -12,6 +12,7 @@ export type WechatMpConfig = { appSecret: string; originalId?: string; qrCodePrefix?: string; + getPhone?: boolean; server?: { url?: string; token: string; diff --git a/es/triggers/index.d.ts b/es/triggers/index.d.ts index 3316bb20f..dd93fc5b9 100644 --- a/es/triggers/index.d.ts +++ b/es/triggers/index.d.ts @@ -1,2 +1,2 @@ -declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; +declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; export default _default; diff --git a/es/utils/email/index.d.ts b/es/utils/email/index.d.ts index 6f2b842fa..da272a8d0 100644 --- a/es/utils/email/index.d.ts +++ b/es/utils/email/index.d.ts @@ -10,7 +10,7 @@ export declare function getEmail(origin: string): Email(options: EmailOptions, context: BRC): Promise<{ success: boolean; - error?: string; + error?: string | undefined; } | { success: boolean; error: unknown; diff --git a/es/utils/oauth/index.d.ts b/es/utils/oauth/index.d.ts index 06495e00f..73e36c391 100644 --- a/es/utils/oauth/index.d.ts +++ b/es/utils/oauth/index.d.ts @@ -10,8 +10,8 @@ type UserID = { avatarUrl: string | null; }; export type UserInfoHandler = (data: UserInfo) => UserID | Promise; -export declare const registerUserinfoHandler: (type: EntityDict["oauthProvider"]["Schema"]["type"], handler: UserInfoHandler) => void; -export declare const processUserInfo: (type: EntityDict["oauthProvider"]["Schema"]["type"], data: UserInfo) => UserID | Promise; +export declare const registerUserinfoHandler: (type: EntityDict['oauthProvider']['Schema']['type'], handler: UserInfoHandler) => void; +export declare const processUserInfo: (type: EntityDict['oauthProvider']['Schema']['type'], data: UserInfo) => UserID | Promise; export declare function checkOauthTokenAvaliable(context: BackendRuntimeContext, token: string | undefined): Promise<{ error: string | null; statusCode?: number; diff --git a/lib/aspects/oauth.js b/lib/aspects/oauth.js index 14d328545..9cd8c18d3 100644 --- a/lib/aspects/oauth.js +++ b/lib/aspects/oauth.js @@ -1,9 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.loginByOauth = loginByOauth; -exports.getOAuthClientInfo = getOAuthClientInfo; -exports.createOAuthState = createOAuthState; -exports.authorize = authorize; +exports.authorize = exports.createOAuthState = exports.getOAuthClientInfo = exports.loginByOauth = void 0; const tslib_1 = require("tslib"); const assert_1 = tslib_1.__importDefault(require("assert")); const types_1 = require("oak-domain/lib/types"); @@ -187,6 +184,7 @@ async function loginByOauth(params, context) { return tokenValue; } } +exports.loginByOauth = loginByOauth; async function getOAuthClientInfo(params, context) { const { client_id, currentUserId } = params; const closeRootMode = context.openRootMode(); @@ -249,6 +247,7 @@ async function getOAuthClientInfo(params, context) { alreadyAuth: !!hasAuth, }; } +exports.getOAuthClientInfo = getOAuthClientInfo; async function createOAuthState(params, context) { const { providerId, userId, type } = params; const closeRootMode = context.openRootMode(); @@ -270,6 +269,7 @@ async function createOAuthState(params, context) { closeRootMode(); return state; } +exports.createOAuthState = createOAuthState; async function authorize(params, context) { const { response_type, client_id, redirect_uri, scope, state, action, code_challenge, code_challenge_method } = params; if (response_type !== 'code') { @@ -336,7 +336,7 @@ async function authorize(params, context) { applicationId: context.getApplicationId(), userId: context.getCurrentUserId(), scope: scope === undefined ? [] : [scope], - expiresAt: Date.now() + 10 * 60 * 1000, // 10分钟后过期 + expiresAt: Date.now() + 10 * 60 * 1000, // PKCE 支持 codeChallenge: code_challenge, codeChallengeMethod: code_challenge_method || 'plain', @@ -366,6 +366,7 @@ async function authorize(params, context) { closeRootMode(); throw new Error('unknown action'); } +exports.authorize = authorize; const fetchOAuthUserInfo = async (code, providerConfig) => { // 1. 使用 code 换取 access_token const tokenResponse = await fetch(providerConfig.tokenEndpoint, { diff --git a/lib/aspects/template.d.ts b/lib/aspects/template.d.ts index 290b776b2..3e1d30898 100644 --- a/lib/aspects/template.d.ts +++ b/lib/aspects/template.d.ts @@ -19,6 +19,6 @@ export declare function syncMessageTemplate(params: { example: string; keywordEnumValueList: { keywordCode: string; - enumValueList: Array; + enumValueList: string[]; }[]; }[]>; diff --git a/lib/aspects/token.js b/lib/aspects/token.js index ce49ced99..120cfba2b 100644 --- a/lib/aspects/token.js +++ b/lib/aspects/token.js @@ -1,28 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.setUpTokenAndUser = setUpTokenAndUser; -exports.loadTokenInfo = loadTokenInfo; -exports.loginByMobile = loginByMobile; -exports.verifyPassword = verifyPassword; -exports.loginByAccount = loginByAccount; -exports.loginByEmail = loginByEmail; -exports.bindByMobile = bindByMobile; -exports.bindByEmail = bindByEmail; -exports.setUserAvatarFromWechat = setUserAvatarFromWechat; -exports.refreshWechatPublicUserInfo = refreshWechatPublicUserInfo; -exports.loginByWechat = loginByWechat; -exports.loginWechatNative = loginWechatNative; -exports.loginWechat = loginWechat; -exports.loginWechatMp = loginWechatMp; -exports.syncUserInfoWechatMp = syncUserInfoWechatMp; -exports.sendCaptchaByMobile = sendCaptchaByMobile; -exports.sendCaptchaByEmail = sendCaptchaByEmail; -exports.switchTo = switchTo; -exports.getWechatMpUserPhoneNumber = getWechatMpUserPhoneNumber; -exports.logout = logout; -exports.wakeupParasite = wakeupParasite; -exports.refreshToken = refreshToken; -exports.loginWebByMpToken = loginWebByMpToken; +exports.loginWebByMpToken = exports.refreshToken = exports.wakeupParasite = exports.logout = exports.getWechatMpUserPhoneNumber = exports.switchTo = exports.sendCaptchaByEmail = exports.sendCaptchaByMobile = exports.syncUserInfoWechatMp = exports.loginWechatMp = exports.loginWechat = exports.loginWechatNative = exports.loginByWechat = exports.refreshWechatPublicUserInfo = exports.setUserAvatarFromWechat = exports.bindByEmail = exports.bindByMobile = exports.loginByEmail = exports.loginByAccount = exports.verifyPassword = exports.loginByMobile = exports.loadTokenInfo = exports.setUpTokenAndUser = void 0; const tslib_1 = require("tslib"); const uuid_1 = require("oak-domain/lib/utils/uuid"); const WechatSDK_1 = tslib_1.__importDefault(require("oak-external-sdk/lib/WechatSDK")); @@ -402,6 +380,7 @@ createData, user) { } } } +exports.setUpTokenAndUser = setUpTokenAndUser; async function setupMobile(mobile, env, context) { const result2 = await context.select('mobile', { data: { @@ -465,6 +444,7 @@ async function loadTokenInfo(tokenValue, context) { }, }, {}); } +exports.loadTokenInfo = loadTokenInfo; async function loginByMobile(params, context) { const { mobile, captcha, env, disableRegister } = params; const loginLogic = async (isRoot) => { @@ -560,6 +540,7 @@ async function loginByMobile(params, context) { closeRootMode(); return tokenValue; } +exports.loginByMobile = loginByMobile; async function verifyPassword(params, context) { const { password } = params; const systemId = context.getSystemId(); @@ -624,6 +605,7 @@ async function verifyPassword(params, context) { } }, {}); } +exports.verifyPassword = verifyPassword; async function loginByAccount(params, context) { const { account, password, env } = params; let needUpdatePassword = false; @@ -976,6 +958,7 @@ async function loginByAccount(params, context) { closeRootMode(); return tokenValue; } +exports.loginByAccount = loginByAccount; async function loginByEmail(params, context) { const { email, captcha, env, disableRegister } = params; const loginLogic = async () => { @@ -1046,6 +1029,7 @@ async function loginByEmail(params, context) { closeRootMode(); return tokenValue; } +exports.loginByEmail = loginByEmail; async function bindByMobile(params, context) { const { mobile, captcha, env, } = params; const userId = context.getCurrentUserId(); @@ -1157,6 +1141,7 @@ async function bindByMobile(params, context) { await bindLogic(); closeRootMode(); } +exports.bindByMobile = bindByMobile; async function bindByEmail(params, context) { const { email, captcha, env, } = params; const userId = context.getCurrentUserId(); @@ -1269,6 +1254,7 @@ async function bindByEmail(params, context) { await bindLogic(); closeRootMode(); } +exports.bindByEmail = bindByEmail; async function setupLoginName(name, env, context) { const result2 = await context.select('loginName', { data: { @@ -1509,6 +1495,7 @@ async function setUserAvatarFromWechat(params, context) { }, {}); } } +exports.setUserAvatarFromWechat = setUserAvatarFromWechat; async function tryRefreshWechatPublicUserInfo(wechatUserId, context) { const [wechatUser] = await context.select('wechatUser', { data: { @@ -1597,6 +1584,7 @@ async function refreshWechatPublicUserInfo({}, context) { (0, assert_1.assert)(token.entityId); return await tryRefreshWechatPublicUserInfo(token.entityId, context); } +exports.refreshWechatPublicUserInfo = refreshWechatPublicUserInfo; // 用户在微信端授权登录后,在web端触发该方法 async function loginByWechat(params, context) { const { wechatLoginId, env } = params; @@ -1626,6 +1614,7 @@ async function loginByWechat(params, context) { closeRootMode(); return tokenValue; } +exports.loginByWechat = loginByWechat; async function loginFromWechatEnv(code, env, context, wechatLoginId) { const application = context.getApplication(); const { type, config, systemId } = application; @@ -1969,6 +1958,7 @@ async function loginWechatNative({ code, env, }, context) { closeRootMode(); return tokenValue; } +exports.loginWechatNative = loginWechatNative; /** * 公众号授权登录 * @param param0 @@ -1999,6 +1989,7 @@ async function loginWechat({ code, env, wechatLoginId, }, context) { closeRootMode(); return tokenValue; } +exports.loginWechat = loginWechat; /** * 小程序授权登录 * @param param0 @@ -2012,6 +2003,7 @@ async function loginWechatMp({ code, env, }, context) { closeRootMode(); return tokenValue; } +exports.loginWechatMp = loginWechatMp; /** * 同步从wx.getUserProfile拿到的用户信息 * @param param0 @@ -2065,6 +2057,7 @@ async function syncUserInfoWechatMp({ nickname, avatarUrl, encryptedData, iv, si // 实测发现解密出来的和userInfo完全一致…… await setUserInfoFromWechat(user, { nickname, avatar: avatarUrl }, context); } +exports.syncUserInfoWechatMp = syncUserInfoWechatMp; async function sendCaptchaByMobile({ mobile, env, type: captchaType, }, context) { const { type } = env; let visitorId = mobile; @@ -2229,6 +2222,7 @@ async function sendCaptchaByMobile({ mobile, env, type: captchaType, }, context) return '验证码发送失败'; } } +exports.sendCaptchaByMobile = sendCaptchaByMobile; async function sendCaptchaByEmail({ email, env, type: captchaType, }, context) { const { type } = env; let visitorId = email; @@ -2376,6 +2370,7 @@ async function sendCaptchaByEmail({ email, env, type: captchaType, }, context) { return '验证码发送失败'; } } +exports.sendCaptchaByEmail = sendCaptchaByEmail; async function switchTo({ userId }, context) { const reallyRoot = context.isReallyRoot(); if (!reallyRoot) { @@ -2397,6 +2392,7 @@ async function switchTo({ userId }, context) { }, }, {}); } +exports.switchTo = switchTo; async function getWechatMpUserPhoneNumber({ code, env }, context) { const application = context.getApplication(); const { type, config, systemId } = application; @@ -2412,6 +2408,7 @@ async function getWechatMpUserPhoneNumber({ code, env }, context) { closeRootMode(); return reuslt; } +exports.getWechatMpUserPhoneNumber = getWechatMpUserPhoneNumber; async function logout(params, context) { const { tokenValue } = params; if (tokenValue) { @@ -2434,6 +2431,7 @@ async function logout(params, context) { closeRootMode(); } } +exports.logout = logout; /** * 创建一个当前parasite上的token * @param params @@ -2500,6 +2498,7 @@ async function wakeupParasite(params, context) { closeRootMode(); return tokenValue; } +exports.wakeupParasite = wakeupParasite; /** * todo 检查登录环境一致性,同一个token不能跨越不同设备 * @param env1 @@ -2572,8 +2571,8 @@ async function refreshToken(params, context) { // 只有server模式去刷新token // 'development' | 'production' | 'staging' const intervals = { - development: 7200 * 1000, // 2小时 - staging: 600 * 1000, // 十分钟 + development: 7200 * 1000, + staging: 600 * 1000, production: 600 * 1000, // 十分钟 }; let applicationId = token.applicationId; @@ -2646,6 +2645,7 @@ async function refreshToken(params, context) { closeRootMode(); return tokenValue; } +exports.refreshToken = refreshToken; /** * 使用微信小程序中的token登录web * @param tokenValue @@ -2713,3 +2713,4 @@ async function loginWebByMpToken(params, context) { closeRootMode(); return tokenValue; } +exports.loginWebByMpToken = loginWebByMpToken; diff --git a/lib/oak-app-domain/Application/_baseSchema.d.ts b/lib/oak-app-domain/Application/_baseSchema.d.ts index af5f6ccfc..22850524b 100644 --- a/lib/oak-app-domain/Application/_baseSchema.d.ts +++ b/lib/oak-app-domain/Application/_baseSchema.d.ts @@ -12,6 +12,7 @@ export type WechatMpConfig = { appSecret: string; originalId?: string; qrCodePrefix?: string; + getPhone?: boolean; server?: { url?: string; token: string; diff --git a/lib/triggers/index.d.ts b/lib/triggers/index.d.ts index 3316bb20f..dd93fc5b9 100644 --- a/lib/triggers/index.d.ts +++ b/lib/triggers/index.d.ts @@ -1,2 +1,2 @@ -declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; +declare const _default: (import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger> | import("oak-domain/lib/types").Trigger>)[]; export default _default; diff --git a/lib/utils/email/index.d.ts b/lib/utils/email/index.d.ts index 6f2b842fa..da272a8d0 100644 --- a/lib/utils/email/index.d.ts +++ b/lib/utils/email/index.d.ts @@ -10,7 +10,7 @@ export declare function getEmail(origin: string): Email(options: EmailOptions, context: BRC): Promise<{ success: boolean; - error?: string; + error?: string | undefined; } | { success: boolean; error: unknown; diff --git a/lib/utils/oauth/index.d.ts b/lib/utils/oauth/index.d.ts index 06495e00f..73e36c391 100644 --- a/lib/utils/oauth/index.d.ts +++ b/lib/utils/oauth/index.d.ts @@ -10,8 +10,8 @@ type UserID = { avatarUrl: string | null; }; export type UserInfoHandler = (data: UserInfo) => UserID | Promise; -export declare const registerUserinfoHandler: (type: EntityDict["oauthProvider"]["Schema"]["type"], handler: UserInfoHandler) => void; -export declare const processUserInfo: (type: EntityDict["oauthProvider"]["Schema"]["type"], data: UserInfo) => UserID | Promise; +export declare const registerUserinfoHandler: (type: EntityDict['oauthProvider']['Schema']['type'], handler: UserInfoHandler) => void; +export declare const processUserInfo: (type: EntityDict['oauthProvider']['Schema']['type'], data: UserInfo) => UserID | Promise; export declare function checkOauthTokenAvaliable(context: BackendRuntimeContext, token: string | undefined): Promise<{ error: string | null; statusCode?: number; diff --git a/src/components/userEntityGrant/claim/index.xml b/src/components/userEntityGrant/claim/index.xml index 76b3adf44..4e9074dc4 100644 --- a/src/components/userEntityGrant/claim/index.xml +++ b/src/components/userEntityGrant/claim/index.xml @@ -40,7 +40,7 @@ onPickRelations="{{onPickRelationsMp}}" pickedRelationIds="{{pickedRelationIds}}" pickedRowIds="{{pickedRowIds}}" - oakPath="{{oakFullpath}}-$uegClaim-content" + oakPath="$$uegClaim-picker" /> diff --git a/src/components/userRelation/upsert/byUserEntityGrant/index.ts b/src/components/userRelation/upsert/byUserEntityGrant/index.ts index 16bc71b1e..a47da9fc5 100644 --- a/src/components/userRelation/upsert/byUserEntityGrant/index.ts +++ b/src/components/userRelation/upsert/byUserEntityGrant/index.ts @@ -39,6 +39,7 @@ export default OakComponent({ qrCodeType: '' as QrCodeType, multiple: false, rule: 'single' as EntityDict['userEntityGrant']['OpSchema']['rule'], + onUserEntityGrantCreated: (id: string) => undefined as void, }, data: { period: 15, @@ -73,6 +74,7 @@ export default OakComponent({ }, }, methods: { + /* 实测在component里没用,通过onUserEntityGrantCreated返回上层,由上层在page里定义 onShareAppMessage(e: any) { const app = this.features.application.getApplication(); const { config, system } = app!; @@ -86,7 +88,7 @@ export default OakComponent({ path: `/pages${claimUrl}/index?oakId=${userEntityGrantId}`, imageUrl, }; - }, + }, */ setInit() { const userId = this.features.token.getUserId(); const { @@ -226,6 +228,8 @@ export default OakComponent({ this.setState({ userEntityGrantId: id, }); + const { onUserEntityGrantCreated } = this.props; + onUserEntityGrantCreated && onUserEntityGrantCreated(id!); // 小程序显示可分享菜单 if (process.env.OAK_PLATFORM === 'wechatMp') { wx.showShareMenu({}); @@ -248,6 +252,7 @@ export default OakComponent({ multiple: boolean; rule: EntityDict['userEntityGrant']['Schema']['rule']; ruleOnRow: EntityDict['userEntityGrant']['OpSchema']['ruleOnRow']; + onUserEntityGrantCreated?: (id: string) => void; } > ) => React.ReactElement; diff --git a/src/components/userRelation/upsert/index.ts b/src/components/userRelation/upsert/index.ts index 516ed5637..1a2b14d60 100644 --- a/src/components/userRelation/upsert/index.ts +++ b/src/components/userRelation/upsert/index.ts @@ -66,6 +66,7 @@ export default OakComponent({ passwordRequired: false, disabledMethods: [] as Array<'email' | 'mobile' | 'userEntityGrant'>, mode: undefined as 'byMobile' | 'byUserEntityGrant' | 'byEmail' | undefined, + onUserEntityGrantCreated: (id: string) => undefined as void, }, lifetimes: { async ready() { diff --git a/src/components/userRelation/upsert/index.xml b/src/components/userRelation/upsert/index.xml index f6d507841..33a29d09c 100644 --- a/src/components/userRelation/upsert/index.xml +++ b/src/components/userRelation/upsert/index.xml @@ -29,6 +29,7 @@ rule="{{rule}}" oakPath="$userRelation-upsert-by-userEntityGrant" redirectToAfterConfirm="{{redirectToAfterConfirm}}" + onUserEntityGrantCreated="{{onUserEntityGrantCreated}}" /> diff --git a/src/components/userRelation/upsert/web.pc.tsx b/src/components/userRelation/upsert/web.pc.tsx index 73b607110..d603075c4 100644 --- a/src/components/userRelation/upsert/web.pc.tsx +++ b/src/components/userRelation/upsert/web.pc.tsx @@ -22,6 +22,7 @@ export default function Render( rule: EntityDict['userEntityGrant']['OpSchema']['rule']; passwordRequired: boolean; enabled: Array<'email' | 'mobile' | 'userEntityGrant'>; + onUserEntityGrantCreated?: (id: string) => undefined, }, {} > @@ -36,6 +37,7 @@ export default function Render( claimUrl, rule, passwordRequired, + onUserEntityGrantCreated, } = props.data; const { t } = props.methods; @@ -77,6 +79,7 @@ export default function Render( oakPath="$userRelation-upsert-by-userEntityGrant" oakAutoUnmount={true} redirectToAfterConfirm={redirectToAfterConfirm} + onUserEntityGrantCreated={onUserEntityGrantCreated} /> ); } diff --git a/src/components/userRelation/upsert/web.tsx b/src/components/userRelation/upsert/web.tsx index c740d0194..f4d4913d5 100644 --- a/src/components/userRelation/upsert/web.tsx +++ b/src/components/userRelation/upsert/web.tsx @@ -22,6 +22,7 @@ export default function Render( rule: EntityDict['userEntityGrant']['OpSchema']['rule']; passwordRequired: boolean; enabled: Array<'email' | 'mobile' | 'userEntityGrant'>; + onUserEntityGrantCreated?: (id: string) => undefined, }, {} > @@ -36,6 +37,7 @@ export default function Render( rule, passwordRequired, enabled, + onUserEntityGrantCreated, } = props.data; const { t } = props.methods; @@ -77,6 +79,7 @@ export default function Render( oakPath="$userRelation-upsert-by-userEntityGrant" oakAutoUnmount={true} redirectToAfterConfirm={redirectToAfterConfirm} + onUserEntityGrantCreated={onUserEntityGrantCreated} /> ); }