@satorijs/adapter-dingtalk 2.0.6 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +2 -2
- package/lib/message.d.ts +1 -1
- package/package.json +3 -3
- package/src/http.ts +3 -3
package/lib/index.js
CHANGED
|
@@ -114,7 +114,7 @@ var _HttpServer = class _HttpServer extends import_satori2.Adapter {
|
|
|
114
114
|
async connect(bot) {
|
|
115
115
|
await bot.refreshToken();
|
|
116
116
|
await bot.getLogin();
|
|
117
|
-
bot.ctx.
|
|
117
|
+
bot.ctx.server.post("/dingtalk", async (ctx) => {
|
|
118
118
|
const timestamp = ctx.get("timestamp");
|
|
119
119
|
const sign = ctx.get("sign");
|
|
120
120
|
if (!timestamp || !sign)
|
|
@@ -136,7 +136,7 @@ var _HttpServer = class _HttpServer extends import_satori2.Adapter {
|
|
|
136
136
|
}
|
|
137
137
|
};
|
|
138
138
|
__name(_HttpServer, "HttpServer");
|
|
139
|
-
__publicField(_HttpServer, "inject", ["
|
|
139
|
+
__publicField(_HttpServer, "inject", ["server"]);
|
|
140
140
|
var HttpServer = _HttpServer;
|
|
141
141
|
|
|
142
142
|
// satori/adapters/dingtalk/src/message.ts
|
package/lib/message.d.ts
CHANGED
|
@@ -13,5 +13,5 @@ export declare class DingtalkMessageEncoder<C extends Context = Context> extends
|
|
|
13
13
|
sendMessage<T extends keyof SendMessageData>(msgType: T, msgParam: SendMessageData[T]): Promise<void>;
|
|
14
14
|
uploadMedia(attrs: Dict): Promise<any>;
|
|
15
15
|
private listType;
|
|
16
|
-
visit(element: h): Promise<
|
|
16
|
+
visit(element: h): Promise<any>;
|
|
17
17
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@satorijs/adapter-dingtalk",
|
|
3
3
|
"description": "DingTalk (钉钉) Adapter for Satorijs",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -30,9 +30,9 @@
|
|
|
30
30
|
"chat"
|
|
31
31
|
],
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@
|
|
33
|
+
"@cordisjs/server": "^0.1.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
36
|
-
"@satorijs/satori": "^3.
|
|
36
|
+
"@satorijs/satori": "^3.3.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/src/http.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Adapter, Context, Logger } from '@satorijs/satori'
|
|
2
|
-
import {} from '@
|
|
2
|
+
import {} from '@cordisjs/server'
|
|
3
3
|
import { DingtalkBot } from './bot'
|
|
4
4
|
import crypto from 'node:crypto'
|
|
5
5
|
import { Message } from './types'
|
|
6
6
|
import { decodeMessage } from './utils'
|
|
7
7
|
|
|
8
8
|
export class HttpServer<C extends Context = Context> extends Adapter<C, DingtalkBot<C>> {
|
|
9
|
-
static inject = ['
|
|
9
|
+
static inject = ['server']
|
|
10
10
|
|
|
11
11
|
private logger: Logger
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ export class HttpServer<C extends Context = Context> extends Adapter<C, Dingtalk
|
|
|
20
20
|
await bot.getLogin()
|
|
21
21
|
|
|
22
22
|
// https://open.dingtalk.com/document/orgapp/receive-message
|
|
23
|
-
bot.ctx.
|
|
23
|
+
bot.ctx.server.post('/dingtalk', async (ctx) => {
|
|
24
24
|
const timestamp = ctx.get('timestamp')
|
|
25
25
|
const sign = ctx.get('sign')
|
|
26
26
|
|