Compare commits

...

2 Commits

Author SHA1 Message Date
6cc5313d2a chore(release): publish
- @egg/lark-msg-tool@1.10.0
2024-10-15 03:04:49 +00:00
3a783260b1 feat(lark-msg): genCard支持直接传入卡片定义
All checks were successful
/ release (push) Successful in 23s
2024-10-15 03:04:26 +00:00
4 changed files with 11 additions and 5 deletions

2
package-lock.json generated
View File

@ -12122,7 +12122,7 @@
},
"packages/lark-msg-tool": {
"name": "@egg/lark-msg-tool",
"version": "1.9.0",
"version": "1.10.0",
"license": "ISC",
"dependencies": {
"@egg/logger": "^1.4.4",

View File

@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
# [1.10.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.9.0...@egg/lark-msg-tool@1.10.0) (2024-10-15)
### Features
- **lark-msg:** genCard支持直接传入卡片定义 ([3a78326](http://yingbo.im:3000/zhaoyingbo/egg_tools/commits/3a783260b183d34f61464351da278cff94a9ec60))
# [1.9.0](http://yingbo.im:3000/zhaoyingbo/egg_tools/compare/@egg/lark-msg-tool@1.8.0...@egg/lark-msg-tool@1.9.0) (2024-10-15)
### Features

View File

@ -1,6 +1,6 @@
{
"name": "@egg/lark-msg-tool",
"version": "1.9.0",
"version": "1.10.0",
"description": "Lark Msg Tools for Egg projects",
"type": "module",
"main": "src/index.ts",

View File

@ -1,5 +1,5 @@
import logger from "@egg/logger"
import _ from "lodash"
import _, { isObject } from "lodash"
import { Logger } from "winston"
import { baseErrorCard, basePendingCard, baseSuccessCard } from "./component"
@ -67,8 +67,8 @@ class LarkCard<
)
}
genCard(cardKey: keyof TCardMap, variables: { [key: string]: any }) {
const card = this.cardMap[cardKey]
genCard(cardKey: keyof TCardMap | object, variables: { [key: string]: any }) {
const card = isObject(cardKey) ? cardKey : this.cardMap[cardKey]
if (!card) {
this.logger.error(`Card ${String(cardKey)} not found`)
throw new Error(`Card ${String(cardKey)} not found`)