feat: notification upsert api

This commit is contained in:
moonrailgun 2023-09-27 20:27:46 +08:00
parent b9b5ee5ae1
commit 52255690cb
8 changed files with 321 additions and 153 deletions

View File

@ -21,7 +21,7 @@
"@trpc/react-query": "^10.38.4", "@trpc/react-query": "^10.38.4",
"@trpc/server": "^10.38.4", "@trpc/server": "^10.38.4",
"@types/uuid": "^9.0.3", "@types/uuid": "^9.0.3",
"antd": "^5.8.5", "antd": "^5.9.3",
"axios": "^1.5.0", "axios": "^1.5.0",
"bcryptjs": "^2.4.3", "bcryptjs": "^2.4.3",
"clsx": "^2.0.0", "clsx": "^2.0.0",

View File

@ -3,7 +3,7 @@ lockfileVersion: '6.0'
dependencies: dependencies:
'@ant-design/charts': '@ant-design/charts':
specifier: ^1.4.2 specifier: ^1.4.2
version: 1.4.2(@ant-design/icons@5.2.5)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13) version: 1.4.2(@ant-design/icons@5.2.5)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13)
'@ant-design/icons': '@ant-design/icons':
specifier: ^5.2.5 specifier: ^5.2.5
version: 5.2.5(react-dom@18.2.0)(react@18.2.0) version: 5.2.5(react-dom@18.2.0)(react@18.2.0)
@ -26,8 +26,8 @@ dependencies:
specifier: ^9.0.3 specifier: ^9.0.3
version: 9.0.3 version: 9.0.3
antd: antd:
specifier: ^5.8.5 specifier: ^5.9.3
version: 5.8.5(react-dom@18.2.0)(react@18.2.0) version: 5.9.3(react-dom@18.2.0)(react@18.2.0)
axios: axios:
specifier: ^1.5.0 specifier: ^1.5.0
version: 1.5.0 version: 1.5.0
@ -224,7 +224,7 @@ packages:
'@jridgewell/trace-mapping': 0.3.19 '@jridgewell/trace-mapping': 0.3.19
dev: true dev: true
/@ant-design/charts@1.4.2(@ant-design/icons@5.2.5)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13): /@ant-design/charts@1.4.2(@ant-design/icons@5.2.5)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13):
resolution: {integrity: sha512-BcVx6AAnwxSdzAVUZReSuvUVtnT5AkJivq3wmcYj17scll26HHficg35yimGskAj3Gu1upYjBQBz6Tk7GEMJsQ==} resolution: {integrity: sha512-BcVx6AAnwxSdzAVUZReSuvUVtnT5AkJivq3wmcYj17scll26HHficg35yimGskAj3Gu1upYjBQBz6Tk7GEMJsQ==}
peerDependencies: peerDependencies:
'@ant-design/icons': ^4.6.0 '@ant-design/icons': ^4.6.0
@ -233,12 +233,12 @@ packages:
react: '>=16.8.4' react: '>=16.8.4'
react-dom: '>=16.8.4' react-dom: '>=16.8.4'
dependencies: dependencies:
'@ant-design/flowchart': 1.2.2(@ant-design/icons@5.2.5)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13) '@ant-design/flowchart': 1.2.2(@ant-design/icons@5.2.5)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13)
'@ant-design/graphs': 1.4.0(react-dom@18.2.0)(react@18.2.0) '@ant-design/graphs': 1.4.0(react-dom@18.2.0)(react@18.2.0)
'@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0) '@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0)
'@ant-design/maps': 1.0.7(react-dom@18.2.0)(react@18.2.0) '@ant-design/maps': 1.0.7(react-dom@18.2.0)(react@18.2.0)
'@ant-design/plots': 1.2.5(react-dom@18.2.0)(react@18.2.0) '@ant-design/plots': 1.2.5(react-dom@18.2.0)(react@18.2.0)
antd: 5.8.5(react-dom@18.2.0)(react@18.2.0) antd: 5.9.3(react-dom@18.2.0)(react@18.2.0)
lodash: 4.17.21 lodash: 4.17.21
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
@ -276,7 +276,7 @@ packages:
stylis: 4.3.0 stylis: 4.3.0
dev: false dev: false
/@ant-design/flowchart@1.2.2(@ant-design/icons@5.2.5)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13): /@ant-design/flowchart@1.2.2(@ant-design/icons@5.2.5)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13):
resolution: {integrity: sha512-bzHZ81qqHjWIrXcCMInDB6eMTzbswaVCOAdUTCQJ+B45aybkVsU9LMCKquyOwRM7U7PWNfPC9S/lAlx2i2BvBQ==} resolution: {integrity: sha512-bzHZ81qqHjWIrXcCMInDB6eMTzbswaVCOAdUTCQJ+B45aybkVsU9LMCKquyOwRM7U7PWNfPC9S/lAlx2i2BvBQ==}
peerDependencies: peerDependencies:
'@ant-design/icons': ^4.6.0 '@ant-design/icons': ^4.6.0
@ -288,10 +288,10 @@ packages:
'@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0) '@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0)
'@antv/layout': 0.1.31 '@antv/layout': 0.1.31
'@antv/x6': 1.34.14 '@antv/x6': 1.34.14
'@antv/x6-react-components': 1.1.20(antd@5.8.5)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-components': 1.1.20(antd@5.9.3)(react-dom@18.2.0)(react@18.2.0)
'@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0)
'@antv/xflow': 1.0.55(@ant-design/icons@5.2.5)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13) '@antv/xflow': 1.0.55(@ant-design/icons@5.2.5)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13)
antd: 5.8.5(react-dom@18.2.0)(react@18.2.0) antd: 5.9.3(react-dom@18.2.0)(react@18.2.0)
lodash: 4.17.21 lodash: 4.17.21
react: 18.2.0 react: 18.2.0
react-color: 2.17.3(react@18.2.0) react-color: 2.17.3(react@18.2.0)
@ -952,14 +952,14 @@ packages:
tslib: 2.6.2 tslib: 2.6.2
dev: false dev: false
/@antv/x6-react-components@1.1.20(antd@5.8.5)(react-dom@18.2.0)(react@18.2.0): /@antv/x6-react-components@1.1.20(antd@5.9.3)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-HpQqjPCUo+jfcbfW2sr9oxuXMCxWnXxWvE8jXKJzvrlMNZ3kgfxNqMCRxwGi2QTCxLB3g/KYi5/n8kze8ui1/Q==} resolution: {integrity: sha512-HpQqjPCUo+jfcbfW2sr9oxuXMCxWnXxWvE8jXKJzvrlMNZ3kgfxNqMCRxwGi2QTCxLB3g/KYi5/n8kze8ui1/Q==}
peerDependencies: peerDependencies:
antd: '>=4.4.2 || >=5.0.0-beta.0' antd: '>=4.4.2 || >=5.0.0-beta.0'
react: '>=16.8.6 || >=17.0.0' react: '>=16.8.6 || >=17.0.0'
react-dom: '>=16.8.6 || >=17.0.0' react-dom: '>=16.8.6 || >=17.0.0'
dependencies: dependencies:
antd: 5.8.5(react-dom@18.2.0)(react@18.2.0) antd: 5.9.3(react-dom@18.2.0)(react@18.2.0)
clamp: 1.0.1 clamp: 1.0.1
classnames: 2.3.2 classnames: 2.3.2
rc-dropdown: 3.6.2(react-dom@18.2.0)(react@18.2.0) rc-dropdown: 3.6.2(react-dom@18.2.0)(react@18.2.0)
@ -994,7 +994,7 @@ packages:
utility-types: 3.10.0 utility-types: 3.10.0
dev: false dev: false
/@antv/xflow-core@1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.8.5)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0): /@antv/xflow-core@1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.9.3)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-FhjTstp/ZdO6mj8ERARJ6M9PWgikXvOpWwMTLCjc+i8vS4O3t4XL/fIu16MqJNuNdqfETcjJluHd06c32MTB/w==} resolution: {integrity: sha512-FhjTstp/ZdO6mj8ERARJ6M9PWgikXvOpWwMTLCjc+i8vS4O3t4XL/fIu16MqJNuNdqfETcjJluHd06c32MTB/w==}
peerDependencies: peerDependencies:
'@ant-design/icons': ^4.6.0 '@ant-design/icons': ^4.6.0
@ -1008,10 +1008,10 @@ packages:
dependencies: dependencies:
'@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0) '@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0)
'@antv/x6': 1.34.14 '@antv/x6': 1.34.14
'@antv/x6-react-components': 1.1.20(antd@5.8.5)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-components': 1.1.20(antd@5.9.3)(react-dom@18.2.0)(react@18.2.0)
'@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0)
'@antv/xflow-hook': 1.0.55 '@antv/xflow-hook': 1.0.55
antd: 5.8.5(react-dom@18.2.0)(react@18.2.0) antd: 5.9.3(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
immer: 9.0.21 immer: 9.0.21
lodash: 4.17.21 lodash: 4.17.21
@ -1023,7 +1023,7 @@ packages:
rxjs: 6.6.7 rxjs: 6.6.7
dev: false dev: false
/@antv/xflow-extension@1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13): /@antv/xflow-extension@1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13):
resolution: {integrity: sha512-iHRfO/ae4/9xvC5xVFmA9eIFg813DQa06hTgTdxLlt0Aojnfa5VnsGrIrPQoDDQovCXG8SavMDlnLZUpa491GQ==} resolution: {integrity: sha512-iHRfO/ae4/9xvC5xVFmA9eIFg813DQa06hTgTdxLlt0Aojnfa5VnsGrIrPQoDDQovCXG8SavMDlnLZUpa491GQ==}
peerDependencies: peerDependencies:
'@ant-design/icons': ^4.6.0 '@ant-design/icons': ^4.6.0
@ -1038,11 +1038,11 @@ packages:
dependencies: dependencies:
'@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0) '@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0)
'@antv/x6': 1.34.14 '@antv/x6': 1.34.14
'@antv/x6-react-components': 1.1.20(antd@5.8.5)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-components': 1.1.20(antd@5.9.3)(react-dom@18.2.0)(react@18.2.0)
'@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0)
'@antv/xflow-core': 1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.8.5)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0) '@antv/xflow-core': 1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.9.3)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)
'@antv/xflow-hook': 1.0.55 '@antv/xflow-hook': 1.0.55
antd: 5.8.5(react-dom@18.2.0)(react@18.2.0) antd: 5.9.3(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
mana-syringe: 0.2.2 mana-syringe: 0.2.2
moment: 2.29.4 moment: 2.29.4
@ -1061,7 +1061,7 @@ packages:
toposort: 2.0.2 toposort: 2.0.2
dev: false dev: false
/@antv/xflow@1.0.55(@ant-design/icons@5.2.5)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13): /@antv/xflow@1.0.55(@ant-design/icons@5.2.5)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13):
resolution: {integrity: sha512-1LRFZsDZDVuRwEYD0xFt7SGCbHducgXQ4GgPOzmaCMA5FMbQfZVpXhsOG4o/a9X+gKfYdpOELCLqpz7iykyArQ==} resolution: {integrity: sha512-1LRFZsDZDVuRwEYD0xFt7SGCbHducgXQ4GgPOzmaCMA5FMbQfZVpXhsOG4o/a9X+gKfYdpOELCLqpz7iykyArQ==}
peerDependencies: peerDependencies:
'@ant-design/icons': ^4.6.0 '@ant-design/icons': ^4.6.0
@ -1073,12 +1073,12 @@ packages:
'@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0) '@ant-design/icons': 5.2.5(react-dom@18.2.0)(react@18.2.0)
'@antv/layout': 0.1.31 '@antv/layout': 0.1.31
'@antv/x6': 1.34.14 '@antv/x6': 1.34.14
'@antv/x6-react-components': 1.1.20(antd@5.8.5)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-components': 1.1.20(antd@5.9.3)(react-dom@18.2.0)(react@18.2.0)
'@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0) '@antv/x6-react-shape': 1.6.4(@antv/x6@1.34.14)(react-dom@18.2.0)(react@18.2.0)
'@antv/xflow-core': 1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.8.5)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0) '@antv/xflow-core': 1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.9.3)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)
'@antv/xflow-extension': 1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.8.5)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13) '@antv/xflow-extension': 1.0.55(@ant-design/icons@5.2.5)(@antv/x6-react-components@1.1.20)(@antv/x6-react-shape@1.6.4)(@antv/x6@1.34.14)(antd@5.9.3)(classnames@2.3.2)(lodash@4.17.21)(react-dom@18.2.0)(react@18.2.0)(reflect-metadata@0.1.13)
'@antv/xflow-hook': 1.0.55 '@antv/xflow-hook': 1.0.55
antd: 5.8.5(react-dom@18.2.0)(react@18.2.0) antd: 5.9.3(react-dom@18.2.0)(react@18.2.0)
lodash: 4.17.21 lodash: 4.17.21
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
@ -1750,8 +1750,8 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/@rc-component/tour@1.8.1(react-dom@18.2.0)(react@18.2.0): /@rc-component/tour@1.10.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-CsrQnfKgNArxx2j1RNHVLZgVA+rLrEj06lIsl4KSynMqADsqz8eKvVkr0F3p9PA10948M6WEEZt5a/FGAbGR2A==} resolution: {integrity: sha512-voV0BKaTJbewB9LLgAHQ7tAGG7rgDkKQkZo82xw2gIk542hY+o7zwoqdN16oHhIKk7eG/xi+mdXrONT62Dt57A==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
@ -1759,15 +1759,15 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0)
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/@rc-component/trigger@1.15.6(react-dom@18.2.0)(react@18.2.0): /@rc-component/trigger@1.17.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-Tl19KaGsShf4yzqxumsXVT4c7j0l20Dxe5hgP5S0HmxyhCg3oKen28ntGavRCIPW7cl7wgsGotntqcIokgDHzg==} resolution: {integrity: sha512-KN+lKHCi7L4kjuA9DU2PnwZxtIyes6R1wsexp0/Rnjr/ITELsPuC9kpzDK1+7AZMarDXUAHUdDGS2zUNEx2P0g==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
@ -1777,7 +1777,7 @@ packages:
'@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-align: 4.0.15(react-dom@18.2.0)(react@18.2.0) rc-align: 4.0.15(react-dom@18.2.0)(react@18.2.0)
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
@ -2209,8 +2209,8 @@ packages:
color-convert: 1.9.3 color-convert: 1.9.3
dev: true dev: true
/antd@5.8.5(react-dom@18.2.0)(react@18.2.0): /antd@5.9.3(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-CaCl0BquElbSmilzKunyf22hVhgErKjzh2twQ+ZuFUSZfTOibi6/bwXp93lnT/VGgnc3Z3f2OizybzXWR7/tQg==} resolution: {integrity: sha512-a7gY6hfsjoDLOENHKzjXZgmAxi1hDdsuIvYm6YMTctb08EhTEXCZoeFOekwz9S0vrTcdSpUMblRWsiwuYRdPYg==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -2223,42 +2223,42 @@ packages:
'@ctrl/tinycolor': 3.6.1 '@ctrl/tinycolor': 3.6.1
'@rc-component/color-picker': 1.4.1(react-dom@18.2.0)(react@18.2.0) '@rc-component/color-picker': 1.4.1(react-dom@18.2.0)(react@18.2.0)
'@rc-component/mutate-observer': 1.1.0(react-dom@18.2.0)(react@18.2.0) '@rc-component/mutate-observer': 1.1.0(react-dom@18.2.0)(react@18.2.0)
'@rc-component/tour': 1.8.1(react-dom@18.2.0)(react@18.2.0) '@rc-component/tour': 1.10.0(react-dom@18.2.0)(react@18.2.0)
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
copy-to-clipboard: 3.3.3 copy-to-clipboard: 3.3.3
dayjs: 1.11.9 dayjs: 1.11.9
qrcode.react: 3.1.0(react@18.2.0) qrcode.react: 3.1.0(react@18.2.0)
rc-cascader: 3.14.1(react-dom@18.2.0)(react@18.2.0) rc-cascader: 3.17.0(react-dom@18.2.0)(react@18.2.0)
rc-checkbox: 3.1.0(react-dom@18.2.0)(react@18.2.0) rc-checkbox: 3.1.0(react-dom@18.2.0)(react@18.2.0)
rc-collapse: 3.7.1(react-dom@18.2.0)(react@18.2.0) rc-collapse: 3.7.1(react-dom@18.2.0)(react@18.2.0)
rc-dialog: 9.1.0(react-dom@18.2.0)(react@18.2.0) rc-dialog: 9.2.0(react-dom@18.2.0)(react@18.2.0)
rc-drawer: 6.2.0(react-dom@18.2.0)(react@18.2.0) rc-drawer: 6.4.1(react-dom@18.2.0)(react@18.2.0)
rc-dropdown: 4.1.0(react-dom@18.2.0)(react@18.2.0) rc-dropdown: 4.1.0(react-dom@18.2.0)(react@18.2.0)
rc-field-form: 1.36.2(react-dom@18.2.0)(react@18.2.0) rc-field-form: 1.38.2(react-dom@18.2.0)(react@18.2.0)
rc-image: 7.1.3(react-dom@18.2.0)(react@18.2.0) rc-image: 7.2.0(react-dom@18.2.0)(react@18.2.0)
rc-input: 1.1.1(react-dom@18.2.0)(react@18.2.0) rc-input: 1.2.1(react-dom@18.2.0)(react@18.2.0)
rc-input-number: 8.0.4(react-dom@18.2.0)(react@18.2.0) rc-input-number: 8.1.0(react-dom@18.2.0)(react@18.2.0)
rc-mentions: 2.5.0(react-dom@18.2.0)(react@18.2.0) rc-mentions: 2.8.0(react-dom@18.2.0)(react@18.2.0)
rc-menu: 9.10.0(react-dom@18.2.0)(react@18.2.0) rc-menu: 9.12.0(react-dom@18.2.0)(react@18.2.0)
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-notification: 5.0.5(react-dom@18.2.0)(react@18.2.0) rc-notification: 5.1.1(react-dom@18.2.0)(react@18.2.0)
rc-pagination: 3.6.1(react-dom@18.2.0)(react@18.2.0) rc-pagination: 3.6.1(react-dom@18.2.0)(react@18.2.0)
rc-picker: 3.13.1(dayjs@1.11.9)(react-dom@18.2.0)(react@18.2.0) rc-picker: 3.14.4(dayjs@1.11.9)(react-dom@18.2.0)(react@18.2.0)
rc-progress: 3.4.2(react-dom@18.2.0)(react@18.2.0) rc-progress: 3.5.1(react-dom@18.2.0)(react@18.2.0)
rc-rate: 2.12.0(react-dom@18.2.0)(react@18.2.0) rc-rate: 2.12.0(react-dom@18.2.0)(react@18.2.0)
rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0)
rc-segmented: 2.2.2(react-dom@18.2.0)(react@18.2.0) rc-segmented: 2.2.2(react-dom@18.2.0)(react@18.2.0)
rc-select: 14.7.4(react-dom@18.2.0)(react@18.2.0) rc-select: 14.9.0(react-dom@18.2.0)(react@18.2.0)
rc-slider: 10.1.1(react-dom@18.2.0)(react@18.2.0) rc-slider: 10.2.1(react-dom@18.2.0)(react@18.2.0)
rc-steps: 6.0.1(react-dom@18.2.0)(react@18.2.0) rc-steps: 6.0.1(react-dom@18.2.0)(react@18.2.0)
rc-switch: 4.1.0(react-dom@18.2.0)(react@18.2.0) rc-switch: 4.1.0(react-dom@18.2.0)(react@18.2.0)
rc-table: 7.32.3(react-dom@18.2.0)(react@18.2.0) rc-table: 7.34.4(react-dom@18.2.0)(react@18.2.0)
rc-tabs: 12.9.0(react-dom@18.2.0)(react@18.2.0) rc-tabs: 12.12.1(react-dom@18.2.0)(react@18.2.0)
rc-textarea: 1.3.4(react-dom@18.2.0)(react@18.2.0) rc-textarea: 1.4.0(react-dom@18.2.0)(react@18.2.0)
rc-tooltip: 6.0.1(react-dom@18.2.0)(react@18.2.0) rc-tooltip: 6.0.1(react-dom@18.2.0)(react@18.2.0)
rc-tree: 5.7.10(react-dom@18.2.0)(react@18.2.0) rc-tree: 5.7.12(react-dom@18.2.0)(react@18.2.0)
rc-tree-select: 5.11.2(react-dom@18.2.0)(react@18.2.0) rc-tree-select: 5.13.0(react-dom@18.2.0)(react@18.2.0)
rc-upload: 4.3.4(react-dom@18.2.0)(react@18.2.0) rc-upload: 4.3.4(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
@ -4538,8 +4538,8 @@ packages:
resize-observer-polyfill: 1.5.1 resize-observer-polyfill: 1.5.1
dev: false dev: false
/rc-cascader@3.14.1(react-dom@18.2.0)(react@18.2.0): /rc-cascader@3.17.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-fCsgjLIQqYZMhFj9UT+x2ZW4uobx7OP5yivcn6Xto5fuxHaldphsryzCeUVmreQOHEo0RP+032Ip9RDzrKVKJA==} resolution: {integrity: sha512-8O5Eq/NteRuBaaUIb+ZsTEkNKM3BwWKizsFlSpukCVa2ELqrdMyslbe/OdxtuFlyJIqGyWF5rS2Q+fd0Rpvmgw==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -4547,8 +4547,8 @@ packages:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
array-tree-filter: 2.1.0 array-tree-filter: 2.1.0
classnames: 2.3.2 classnames: 2.3.2
rc-select: 14.7.4(react-dom@18.2.0)(react@18.2.0) rc-select: 14.9.0(react-dom@18.2.0)(react@18.2.0)
rc-tree: 5.7.10(react-dom@18.2.0)(react@18.2.0) rc-tree: 5.7.12(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
@ -4575,14 +4575,14 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-dialog@9.1.0(react-dom@18.2.0)(react@18.2.0): /rc-dialog@9.2.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-5ry+JABAWEbaKyYsmITtrJbZbJys8CtMyzV8Xn4LYuXMeUx5XVHNyJRoqLFE4AzBuXXzOWeaC49cg+XkxK6kHA==} resolution: {integrity: sha512-dL2tklMou/QfK77+0CTH3FTnKCvIiYv9Df7PfFfg8YVXhYAGmuIkV4ooQYHAIR4juL3Ywcm5oQflF2vDDuGlUg==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -4590,14 +4590,14 @@ packages:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-drawer@6.2.0(react-dom@18.2.0)(react@18.2.0): /rc-drawer@6.4.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-spPkZ3WvP0U0vy5dyzSwlUJ/+vLFtjP/cTwSwejhQRoDBaexSZHsBhELoCZcEggI7LQ7typmtG30lAue2HEhvA==} resolution: {integrity: sha512-QIbNMjiZy322o9uEpJHsSZ5rS/zuxqam3lYVPDzjztoqsoDzTNNxWN77QVpOfQ0UC9/87+qu25zocJ+O9bK2Tg==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -4605,7 +4605,7 @@ packages:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
@ -4632,7 +4632,7 @@ packages:
react-dom: '>=16.11.0' react-dom: '>=16.11.0'
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
@ -4653,8 +4653,22 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-image@7.1.3(react-dom@18.2.0)(react@18.2.0): /rc-field-form@1.38.2(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-foMl1rcit1F0+vgxE5kf0c8TygQcHhILsOohQUL+JMUbzOo3OBFRcehJudYbqbCTArzCecS8nA1irUU9vvgQbg==} resolution: {integrity: sha512-O83Oi1qPyEv31Sg+Jwvsj6pXc8uQI2BtIAkURr5lvEYHVggXJhdU/nynK8wY1gbw0qR48k731sN5ON4egRCROA==}
engines: {node: '>=8.x'}
peerDependencies:
react: '>=16.9.0'
react-dom: '>=16.9.0'
dependencies:
'@babel/runtime': 7.22.11
async-validator: 4.2.5
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/rc-image@7.2.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-5Ug2hCVl6VcT0osR5XaZQ4zclTMEWPnbn3b4/TS/MR1QjRpEACLNFUzBGwr5mbAVhzvLWX5YZf4vO10xUA5IUA==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -4662,15 +4676,15 @@ packages:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0) '@rc-component/portal': 1.1.2(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-dialog: 9.1.0(react-dom@18.2.0)(react@18.2.0) rc-dialog: 9.2.0(react-dom@18.2.0)(react@18.2.0)
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-input-number@8.0.4(react-dom@18.2.0)(react@18.2.0): /rc-input-number@8.1.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-TP+G5b7mZtbwXJ/YEZXF/OgbEZ6iqD4+RSuxZJ8VGKGXDcdt0FKIvpFoNQr/knspdFC4OxA0OfsWfFWfN4XSyA==} resolution: {integrity: sha512-bdHgduOxuN0lrhzgPmoKbhRD4GLIzVcddVz972/JHPHr7oLwPX5xDb9w4bXhuMzyT2VzQy7nggRCfH3yAl09oA==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -4678,14 +4692,14 @@ packages:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/mini-decimal': 1.1.0 '@rc-component/mini-decimal': 1.1.0
classnames: 2.3.2 classnames: 2.3.2
rc-input: 1.1.1(react-dom@18.2.0)(react@18.2.0) rc-input: 1.2.1(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-input@1.1.1(react-dom@18.2.0)(react@18.2.0): /rc-input@1.2.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-NTR1Z4em681L8/ewb2KR80RykSmN8I2mzqzJDCoUmTrV1BB9Hk5d7ha4TnfgdEPPL148N+603sW2LExSXk1IbA==} resolution: {integrity: sha512-nQRmBvEFoGi+SNRDavccZ8ueyhFgmxkWqIt4aDyuNJgUZF12HJKIwDhAafUM7N+g7PyuW9FH3pf3zPHzdiCWbA==}
peerDependencies: peerDependencies:
react: '>=16.0.0' react: '>=16.0.0'
react-dom: '>=16.0.0' react-dom: '>=16.0.0'
@ -4697,41 +4711,41 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-mentions@2.5.0(react-dom@18.2.0)(react@18.2.0): /rc-mentions@2.8.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-rERXsbUTNVrb5T/iDC0ki/SRGWJnOVraDy6O25Us3FSpuUZ3uq2TPZB4fRk0Hss5kyiEPzz2sprhkI4b+F4jUw==} resolution: {integrity: sha512-LBMkO6bSGhEvS1CvMK978qGN82tI+mzk7l/uTiQJH+UDiwpvq+pxK4DxU5b6Q1T5LW6bn2pSua9RaZKZrDoBOw==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-input: 1.1.1(react-dom@18.2.0)(react@18.2.0) rc-input: 1.2.1(react-dom@18.2.0)(react@18.2.0)
rc-menu: 9.10.0(react-dom@18.2.0)(react@18.2.0) rc-menu: 9.12.0(react-dom@18.2.0)(react@18.2.0)
rc-textarea: 1.3.4(react-dom@18.2.0)(react@18.2.0) rc-textarea: 1.4.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-menu@9.10.0(react-dom@18.2.0)(react@18.2.0): /rc-menu@9.12.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-g27kpXaAoJh/fkPZF65/d4V+w4DhDeqomBdPcGnkFAcJnEM4o21TnVccrBUoDedLKzC7wJRw1Q7VTqEsfEufmw==} resolution: {integrity: sha512-Apr/fRf5EcqWJ4nphHV6dTGZcLPaPzwY44q9hAtLJysY4rkC9Eg+ekj3uFx6opPWVruV2sJNWq/Po+HHtO48CA==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-motion@2.8.0(react-dom@18.2.0)(react@18.2.0): /rc-motion@2.9.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-9gWWzlPvx/IJANj+t+ArqLCQ43rCWYLpOUe6+WJSAGb+b+fqBcfx81qPhg6b+ewa6g3mGNDhkTpBrVrCC4gcXA==} resolution: {integrity: sha512-XIU2+xLkdIr1/h6ohPZXyPBMvOmuyFZQ/T0xnawz+Rh+gh4FINcnZmMT5UTIj6hgI0VLDjTaPeRd+smJeSPqiQ==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -4743,8 +4757,8 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-notification@5.0.5(react-dom@18.2.0)(react@18.2.0): /rc-notification@5.1.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-uEz2jggourwv/rR0obe7RHEa63UchqX4k+e+Qt2c3LaY7U9Tc+L6ANhzgCKYSA/afm0ebjmNZHoB5Cv47xEOcA==} resolution: {integrity: sha512-BPnded/WmWFE57ubqhVCgRSuedfQQNeSOYqdwppyr2B/Wt909gYFKyWAkFJVXuppAjsOGop05a93UaxjmUFdkg==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
@ -4752,7 +4766,7 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
@ -4785,8 +4799,8 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-picker@3.13.1(dayjs@1.11.9)(react-dom@18.2.0)(react@18.2.0): /rc-picker@3.14.4(dayjs@1.11.9)(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-211SrinX5IXZ9FMMDUMyPLuGOdfftUtd8zj4lqudpFxlMdtgV5+hXUJMBKb26xmDsleOm5iySK6KIHgiaI+U4w==} resolution: {integrity: sha512-5jGhDglT7i2Qv3CfO4LyMp7unhQ1t/IFNO2T+8Iv1k1FYD0hW0ejqCl+rZNFP6vSLzOW9oVcHVy5SEllhYgR+Q==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
date-fns: '>= 2.x' date-fns: '>= 2.x'
@ -4806,7 +4820,7 @@ packages:
optional: true optional: true
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
dayjs: 1.11.9 dayjs: 1.11.9
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
@ -4814,8 +4828,8 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-progress@3.4.2(react-dom@18.2.0)(react@18.2.0): /rc-progress@3.5.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-iAGhwWU+tsayP+Jkl9T4+6rHeQTG9kDz8JAHZk4XtQOcYN5fj9H34NXNEdRdZx94VUDHMqCb1yOIvi8eJRh67w==} resolution: {integrity: sha512-V6Amx6SbLRwPin/oD+k1vbPrO8+9Qf8zW1T8A7o83HdNafEVvAxPV5YsgtKFP+Ud5HghLj33zKOcEHrcrUGkfw==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
@ -4863,23 +4877,23 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-select@14.7.4(react-dom@18.2.0)(react@18.2.0): /rc-select@14.9.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-qRUpvMVXFy6rdHe+qzHXAqyQAfhErC/oY8dcRtoRjoz0lz2Nx3J+lLL5AnEbjnwlS+/kQTJUZ/65WyCwWwcLwQ==} resolution: {integrity: sha512-vbIhK1MBA12MRdxXbiylSCTPKsWV8WmeN7OyATk9I0LsuIVwe/kBAUNH02am1ryjoylbK+AH309a6X1AflGRSw==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
react: '*' react: '*'
react-dom: '*' react-dom: '*'
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0) rc-overflow: 1.3.2(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
rc-virtual-list: 3.10.5(react-dom@18.2.0)(react@18.2.0) rc-virtual-list: 3.10.5(react-dom@18.2.0)(react@18.2.0)
@ -4887,8 +4901,8 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-slider@10.1.1(react-dom@18.2.0)(react@18.2.0): /rc-slider@10.2.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-gn8oXazZISEhnmRinI89Z/JD/joAaM35jp+gDtIVSTD/JJMCCBqThqLk1SVJmvtfeiEF/kKaFY0+qt4SDHFUDw==} resolution: {integrity: sha512-l355C/65iV4UFp7mXq5xBTNX2/tF2g74VWiTVlTpNp+6vjE/xaHHNiQq5Af+Uu28uUiqCuH/QXs5HfADL9KJ/A==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
@ -4928,8 +4942,8 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-table@7.32.3(react-dom@18.2.0)(react@18.2.0): /rc-table@7.34.4(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-MqjrI/ibuGg7NEyFsux0dM5GK+3er1gTiZofAkifr2bHf/Sa1nUqXXFmSrYXSOjwpx0xyBnJ3GrHFCIqC/eOzw==} resolution: {integrity: sha512-os+i88Y2AO/6dNkOgJkKSHgXYaZZGnuOEEe+nyaq5IRgvAQNhLysUjXt2objtBeFDEZR8TqXrajwBNRUwunmdw==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
@ -4940,12 +4954,13 @@ packages:
classnames: 2.3.2 classnames: 2.3.2
rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
rc-virtual-list: 3.11.2(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-tabs@12.9.0(react-dom@18.2.0)(react@18.2.0): /rc-tabs@12.12.1(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-2HnVowgMVrq0DfQtyu4mCd9E6pXlWNdM6VaDvOOHMsLYqPmpY+7zBqUC6YrrQ9xYXHciTS0e7TtjOHIvpVCHLQ==} resolution: {integrity: sha512-e10VBjEkECdPl4XZSs9to81SE+mgclBTM7J8/LMsFqmJoi05Tci91bRnmeeDtrcOCx2PuZdJv57XUlC4d8PEIw==}
engines: {node: '>=8.x'} engines: {node: '>=8.x'}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
@ -4954,23 +4969,23 @@ packages:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-dropdown: 4.1.0(react-dom@18.2.0)(react@18.2.0) rc-dropdown: 4.1.0(react-dom@18.2.0)(react@18.2.0)
rc-menu: 9.10.0(react-dom@18.2.0)(react@18.2.0) rc-menu: 9.12.0(react-dom@18.2.0)(react@18.2.0)
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-textarea@1.3.4(react-dom@18.2.0)(react@18.2.0): /rc-textarea@1.4.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-wn0YjTpvcVolcfXa0HtzL+jgV2QcwtfB29RwNAKj8hMgZOju1V24M3TfEDjABeQEAQbUGbjMbISREOX/YSVKhg==} resolution: {integrity: sha512-CiqK+uyoJlnfufbC0kwfHJpfElhQacuDSNyNQ/xGnA/QMaJLDbgmqRT8QmX0T0KD/ws/hy6qqRaGJSsrRR5uiQ==}
peerDependencies: peerDependencies:
react: '>=16.9.0' react: '>=16.9.0'
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-input: 1.1.1(react-dom@18.2.0)(react@18.2.0) rc-input: 1.2.1(react-dom@18.2.0)(react@18.2.0)
rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0) rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
@ -4984,29 +4999,29 @@ packages:
react-dom: '>=16.9.0' react-dom: '>=16.9.0'
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
'@rc-component/trigger': 1.15.6(react-dom@18.2.0)(react@18.2.0) '@rc-component/trigger': 1.17.0(react-dom@18.2.0)(react@18.2.0)
classnames: 2.3.2 classnames: 2.3.2
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-tree-select@5.11.2(react-dom@18.2.0)(react@18.2.0): /rc-tree-select@5.13.0(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-ujRFO3pcjSg8R4ndXX2oiNcCu+RgO9ZPcd23CZy18Khm+nRsfWWS3Su7qB0iuoJgzAJ5LK7b6Dio0t7IQDGs9g==} resolution: {integrity: sha512-g01JU9EdE7j/9KfDKtmvFqJ7ZDNIYDzkpmAXllbTBFoRNhWJBjW1x/dCZLVG+IdZeIz8SKJkgZzCf1CUZrzV/Q==}
peerDependencies: peerDependencies:
react: '*' react: '*'
react-dom: '*' react-dom: '*'
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-select: 14.7.4(react-dom@18.2.0)(react@18.2.0) rc-select: 14.9.0(react-dom@18.2.0)(react@18.2.0)
rc-tree: 5.7.10(react-dom@18.2.0)(react@18.2.0) rc-tree: 5.7.12(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-tree@5.7.10(react-dom@18.2.0)(react@18.2.0): /rc-tree@5.7.12(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-n4UkMQY3bzvJUNnbw6e3YI7sy2kE9c9vAYbSt94qAhcPKtMOThONNr1LIaFB/M5XeFYYrWVbvRVoT8k38eFuSQ==} resolution: {integrity: sha512-LXA5nY2hG5koIAlHW5sgXgLpOMz+bFRbnZZ+cCg0tQs4Wv1AmY7EDi1SK7iFXhslYockbqUerQan82jljoaItg==}
engines: {node: '>=10.x'} engines: {node: '>=10.x'}
peerDependencies: peerDependencies:
react: '*' react: '*'
@ -5014,7 +5029,7 @@ packages:
dependencies: dependencies:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
rc-virtual-list: 3.10.5(react-dom@18.2.0)(react@18.2.0) rc-virtual-list: 3.10.5(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
@ -5031,7 +5046,7 @@ packages:
'@babel/runtime': 7.22.11 '@babel/runtime': 7.22.11
classnames: 2.3.2 classnames: 2.3.2
rc-align: 4.0.15(react-dom@18.2.0)(react@18.2.0) rc-align: 4.0.15(react-dom@18.2.0)(react@18.2.0)
rc-motion: 2.8.0(react-dom@18.2.0)(react@18.2.0) rc-motion: 2.9.0(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0) rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0 react: 18.2.0
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
@ -5087,6 +5102,21 @@ packages:
react-dom: 18.2.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0)
dev: false dev: false
/rc-virtual-list@3.11.2(react-dom@18.2.0)(react@18.2.0):
resolution: {integrity: sha512-MTFLL2LOHr3+/+r+WjTIs6j8XmJE6EqdOsJvCH8SWig7qyik3aljCEImUtw5tdWR0tQhXUfbv7P7nZaLY91XPg==}
engines: {node: '>=8.x'}
peerDependencies:
react: '*'
react-dom: '*'
dependencies:
'@babel/runtime': 7.22.11
classnames: 2.3.2
rc-resize-observer: 1.3.1(react-dom@18.2.0)(react@18.2.0)
rc-util: 5.37.0(react-dom@18.2.0)(react@18.2.0)
react: 18.2.0
react-dom: 18.2.0(react@18.2.0)
dev: false
/react-color@2.17.1(react@18.2.0): /react-color@2.17.1(react@18.2.0):
resolution: {integrity: sha512-S+I6TkUKJaqfALLkAIfiCZ/MANQyy7dKkf7g9ZU5GTUy2rf8c2Rx62otyvADAviWR+6HRkzdf2vL1Qvz9goCLQ==} resolution: {integrity: sha512-S+I6TkUKJaqfALLkAIfiCZ/MANQyy7dKkf7g9ZU5GTUy2rf8c2Rx62otyvADAviWR+6HRkzdf2vL1Qvz9goCLQ==}
peerDependencies: peerDependencies:

View File

@ -7,12 +7,12 @@ import {
ModalProps, ModalProps,
Select, Select,
} from 'antd'; } from 'antd';
import React, { useMemo, useState } from 'react'; import React, { useMemo } from 'react';
import { request } from '../../../api/request';
import { useEvent } from '../../../hooks/useEvent'; import { useEvent } from '../../../hooks/useEvent';
import { notificationStrategies } from './strategies'; import { notificationStrategies } from './strategies';
export interface NotificationFormValues { export interface NotificationFormValues {
id?: string;
name: string; name: string;
type: string; type: string;
payload: Record<string, any>; payload: Record<string, any>;
@ -48,9 +48,10 @@ export const NotificationInfoModal: React.FC<NotificationInfoModalProps> =
const handleSave = useEvent(async () => { const handleSave = useEvent(async () => {
await form.validateFields(); await form.validateFields();
const values = form.getFieldsValue(); const values = form.getFieldsValue();
const { name, type, ...payload } = values; const { id, name, type, payload } = values;
props.onSubmit({ props.onSubmit({
id,
name, name,
type, type,
payload, payload,
@ -60,7 +61,7 @@ export const NotificationInfoModal: React.FC<NotificationInfoModalProps> =
const handleTest = useEvent(async () => { const handleTest = useEvent(async () => {
await form.validateFields(); await form.validateFields();
const values = form.getFieldsValue(); const values = form.getFieldsValue();
const { name, type, ...payload } = values; const { name, type, payload } = values;
console.log('TODO', { name, type, payload }); console.log('TODO', { name, type, payload });
}); });
@ -84,10 +85,12 @@ export const NotificationInfoModal: React.FC<NotificationInfoModalProps> =
> >
<div className="overflow-y-auto max-h-[80vh]"> <div className="overflow-y-auto max-h-[80vh]">
<Form <Form
preserve={false}
form={form} form={form}
layout="vertical" layout="vertical"
initialValues={props.initialValues ?? defaultValues} initialValues={props.initialValues ?? defaultValues}
> >
<Form.Item hidden name="id" />
<Form.Item label="Notification Type" name="type"> <Form.Item label="Notification Type" name="type">
<Select> <Select>
{notificationStrategies.map((s) => ( {notificationStrategies.map((s) => (
@ -102,7 +105,7 @@ export const NotificationInfoModal: React.FC<NotificationInfoModalProps> =
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item name="payload">{formEl}</Form.Item> {formEl}
</Form> </Form>
</div> </div>
</Modal> </Modal>

View File

@ -4,41 +4,65 @@ import React from 'react';
export const NotificationSMTP: React.FC = React.memo(() => { export const NotificationSMTP: React.FC = React.memo(() => {
return ( return (
<> <>
<Form.Item label="Host" name="hostname" rules={[{ required: true }]}> <Form.Item
label="Host"
name={['payload', 'hostname']}
rules={[{ required: true }]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="Port" label="Port"
name="port" name={['payload', 'port']}
rules={[{ required: true }, { type: 'number', min: 0, max: 65535 }]} rules={[{ required: true }, { type: 'number', min: 0, max: 65535 }]}
> >
<InputNumber max={65535} min={1} /> <InputNumber max={65535} min={1} />
</Form.Item> </Form.Item>
<Form.Item label="Security" name="security" initialValue={false}> <Form.Item
label="Security"
name={['payload', 'security']}
initialValue={false}
>
<Select> <Select>
<Select.Option value={false}>None / STARTTLS (25, 587)</Select.Option> <Select.Option value={false}>None / STARTTLS (25, 587)</Select.Option>
<Select.Option value={true}>TLS (465)</Select.Option> <Select.Option value={true}>TLS (465)</Select.Option>
</Select> </Select>
</Form.Item> </Form.Item>
<Form.Item name="ignoreTLS"> <Form.Item name={['payload', 'ignoreTLS']}>
<Checkbox>Ignore TLS Error</Checkbox> <Checkbox>Ignore TLS Error</Checkbox>
</Form.Item> </Form.Item>
<Form.Item label="Username" name="username" rules={[{ required: true }]}> <Form.Item
label="Username"
name={['payload', 'username']}
rules={[{ required: true }]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label="Password" name="password" rules={[{ required: true }]}> <Form.Item
label="Password"
name={['payload', 'password']}
rules={[{ required: true }]}
>
<Input.Password /> <Input.Password />
</Form.Item> </Form.Item>
<Form.Item label="From Email" name="from" rules={[{ required: true }]}> <Form.Item
label="From Email"
name={['payload', 'from']}
rules={[{ required: true }]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label="To Email" name="to" rules={[{ required: true }]}> <Form.Item
label="To Email"
name={['payload', 'to']}
rules={[{ required: true }]}
>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label="CC" name="cc"> <Form.Item label="CC" name={['payload', 'cc']}>
<Input /> <Input />
</Form.Item> </Form.Item>
<Form.Item label="BCC" name="bcc"> <Form.Item label="BCC" name={['payload', 'bcc']}>
<Input /> <Input />
</Form.Item> </Form.Item>
</> </>

View File

@ -1,21 +1,52 @@
import { PlusOutlined } from '@ant-design/icons'; import { EditOutlined, PlusOutlined } from '@ant-design/icons';
import { Button, List } from 'antd'; import { Button, List } from 'antd';
import React, { useState } from 'react'; import React, { useState } from 'react';
import { trpc } from '../../api/trpc';
import { import {
NotificationFormValues, NotificationFormValues,
NotificationInfoModal, NotificationInfoModal,
} from '../../components/modals/NotificationInfo'; } from '../../components/modals/NotificationInfo';
import { NoWorkspaceTip } from '../../components/NoWorkspaceTip';
import { PageHeader } from '../../components/PageHeader'; import { PageHeader } from '../../components/PageHeader';
import { useEvent } from '../../hooks/useEvent'; import { useEvent } from '../../hooks/useEvent';
import { useCurrentWorkspaceId } from '../../store/user';
export const NotificationList: React.FC = React.memo(() => { export const NotificationList: React.FC = React.memo(() => {
const [open, setOpen] = useState(false); const [open, setOpen] = useState(false);
const currentWorkspaceId = useCurrentWorkspaceId();
const { data: list = [], refetch } = trpc.notification.getAll.useQuery({
workspaceId: currentWorkspaceId!,
});
const [editingFormData, setEditingFormData] = useState<
NotificationFormValues | undefined
>(undefined);
const handleSubmit = useEvent((values: NotificationFormValues) => { const mutation = trpc.notification.upsert.useMutation();
console.log('ok', values);
const handleOpenModal = useEvent((initValues?: NotificationFormValues) => {
console.log('initValues', initValues);
setEditingFormData(initValues);
setOpen(true);
});
const handleCloseModal = useEvent(() => {
setEditingFormData(undefined);
setOpen(false); setOpen(false);
}); });
const handleSubmit = useEvent(async (values: NotificationFormValues) => {
await mutation.mutateAsync({
workspaceId: currentWorkspaceId!,
...values,
});
handleCloseModal();
refetch();
});
if (!currentWorkspaceId) {
return <NoWorkspaceTip />;
}
return ( return (
<div> <div>
<PageHeader <PageHeader
@ -26,7 +57,7 @@ export const NotificationList: React.FC = React.memo(() => {
type="primary" type="primary"
icon={<PlusOutlined />} icon={<PlusOutlined />}
size="large" size="large"
onClick={() => setOpen(true)} onClick={() => handleOpenModal()}
> >
New New
</Button> </Button>
@ -36,13 +67,25 @@ export const NotificationList: React.FC = React.memo(() => {
<List <List
bordered={true} bordered={true}
dataSource={[ dataSource={list}
{ id: '1', name: 'Email Notify' },
{ id: '1', name: 'Email Notify' },
{ id: '1', name: 'Email Notify' },
]}
renderItem={(item) => ( renderItem={(item) => (
<List.Item actions={[<Button>edit</Button>]}> <List.Item
actions={[
<Button
icon={<EditOutlined />}
onClick={() => {
handleOpenModal({
id: item.id,
name: item.name,
type: item.type,
payload: item.payload as Record<string, any>,
});
}}
>
Edit
</Button>,
]}
>
<List.Item.Meta title={item.name} /> <List.Item.Meta title={item.name} />
</List.Item> </List.Item>
)} )}
@ -50,8 +93,9 @@ export const NotificationList: React.FC = React.memo(() => {
<NotificationInfoModal <NotificationInfoModal
open={open} open={open}
initialValues={editingFormData}
onSubmit={handleSubmit} onSubmit={handleSubmit}
onCancel={() => setOpen(false)} onCancel={() => handleCloseModal()}
/> />
</div> </div>
); );

View File

@ -1,11 +1,13 @@
import * as trpcExpress from '@trpc/server/adapters/express'; import * as trpcExpress from '@trpc/server/adapters/express';
import { createContext, publicProcedure, router } from './trpc'; import { createContext, publicProcedure, router } from './trpc';
import { z } from 'zod'; import { z } from 'zod';
import { notificationRouter } from './routers/notification';
const appRouter = router({ const appRouter = router({
debug: publicProcedure.input(z.string()).query((opts) => { debug: publicProcedure.input(z.string()).query((opts) => {
return { id: opts.input, name: 'Bilbo' }; return { id: opts.input, name: 'Bilbo' };
}), }),
notification: notificationRouter,
}); });
export type AppRouter = typeof appRouter; export type AppRouter = typeof appRouter;
@ -13,4 +15,7 @@ export type AppRouter = typeof appRouter;
export const trpcExpressMiddleware = trpcExpress.createExpressMiddleware({ export const trpcExpressMiddleware = trpcExpress.createExpressMiddleware({
router: appRouter, router: appRouter,
createContext, createContext,
onError: ({ path, error }) => {
console.error('Error:', path, error);
},
}); });

View File

@ -0,0 +1,52 @@
import { router, workspaceOwnerProcedure, workspaceProcedure } from '../trpc';
import { z } from 'zod';
import { prisma } from '../../model/_client';
export const notificationRouter = router({
getAll: workspaceProcedure.query(({ input }) => {
const workspaceId = input.workspaceId;
return prisma.notification.findMany({
where: {
workspaceId,
},
});
}),
upsert: workspaceOwnerProcedure
.input(
z.object({
id: z.string().optional(),
name: z.string(),
type: z.string(),
payload: z.any(),
})
)
.mutation(async ({ input }) => {
const { workspaceId, id, name, type, payload } = input;
if (id) {
// update
return await prisma.notification.update({
data: {
name,
type,
payload,
},
where: {
workspaceId,
id,
},
});
} else {
// create
return await prisma.notification.create({
data: {
workspaceId,
name,
type,
payload,
},
});
}
}),
});

View File

@ -1,5 +1,7 @@
import { initTRPC, inferAsyncReturnType, TRPCError } from '@trpc/server'; import { initTRPC, inferAsyncReturnType, TRPCError } from '@trpc/server';
import * as trpcExpress from '@trpc/server/adapters/express'; import * as trpcExpress from '@trpc/server/adapters/express';
import _ from 'lodash';
import { z } from 'zod';
import { jwtVerify } from '../middleware/auth'; import { jwtVerify } from '../middleware/auth';
import { getWorkspaceUser } from '../model/workspace'; import { getWorkspaceUser } from '../model/workspace';
import { ROLES, SYSTEM_ROLES } from '../utils/const'; import { ROLES, SYSTEM_ROLES } from '../utils/const';
@ -37,12 +39,20 @@ const isSystemAdmin = middleware(async (opts) => {
}); });
export const systemAdminProcedure = t.procedure.use(isSystemAdmin); export const systemAdminProcedure = t.procedure.use(isSystemAdmin);
export const workspaceProcedure = t.procedure.use( export const workspaceProcedure = t.procedure
createWorkspacePermissionMiddleware() .input(
); z.object({
export const ownerProcedure = t.procedure.use( workspaceId: z.string().uuid(),
createWorkspacePermissionMiddleware([ROLES.owner]) })
); )
.use(createWorkspacePermissionMiddleware());
export const workspaceOwnerProcedure = t.procedure
.input(
z.object({
workspaceId: z.string().uuid(),
})
)
.use(createWorkspacePermissionMiddleware([ROLES.owner]));
/** /**
* Create a trpc middleware which help user check workspace permission * Create a trpc middleware which help user check workspace permission