@zhin.js/adapter-wechat-mp 1.1.19 → 1.1.21
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/CHANGELOG.md +34 -0
- package/lib/protocol.d.ts +2 -1
- package/package.json +16 -16
- package/schema.json +106 -1
- package/src/protocol.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# @zhin.js/adapter-wechat-mp
|
|
2
2
|
|
|
3
|
+
## 1.1.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- af8f803: Use the current Endpoint's platform profile for Agent account identity, with per-field configured fallbacks and scoped, identity-approved profile tools. Keep SOUL first-person and independent of account names. Profile ports preserve the source Client, cancellation, truthful update outcomes and private image authority.
|
|
8
|
+
|
|
9
|
+
Adapter Feature API 2.1 and Tool Feature API 1.1 describe the additive profile requirements; new Core, official adapters and generated plugins declare the corresponding floors. Existing compatible API-2.0/API-1.0 plugins remain accepted by the newer providers. npm releases remain patch.
|
|
10
|
+
|
|
11
|
+
Private IM assets now bind to the full canonical conversation and principal. Existing IM asset records that contain only the earlier lossy hash remain on disk until their original expiry, but cannot be safely rebound; recapture them. No automatic file deletion, platform profile mutation or workspace SOUL rewrite occurs during upgrade.
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [b88e988]
|
|
14
|
+
- Updated dependencies [f78eb84]
|
|
15
|
+
- Updated dependencies [c15cef9]
|
|
16
|
+
- Updated dependencies [b0c02a2]
|
|
17
|
+
- Updated dependencies [af8f803]
|
|
18
|
+
- Updated dependencies [26fda97]
|
|
19
|
+
- Updated dependencies [976886c]
|
|
20
|
+
- Updated dependencies [032dc96]
|
|
21
|
+
- @zhin.js/adapter@1.1.27
|
|
22
|
+
- @zhin.js/client@1.1.23
|
|
23
|
+
- @zhin.js/im-contract@1.1.10
|
|
24
|
+
- @zhin.js/core@1.1.55
|
|
25
|
+
- @zhin.js/page@1.1.13
|
|
26
|
+
- @zhin.js/host-http@1.1.13
|
|
27
|
+
- @zhin.js/feature-kit@1.1.11
|
|
28
|
+
- @zhin.js/skill@1.1.12
|
|
29
|
+
|
|
30
|
+
## 1.1.20
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- Updated dependencies [5e878ba]
|
|
35
|
+
- @zhin.js/page@1.1.12
|
|
36
|
+
|
|
3
37
|
## 1.1.19
|
|
4
38
|
|
|
5
39
|
### Patch Changes
|
package/lib/protocol.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { EndpointProfileConfiguration } from 'zhin.js/adapter';
|
|
1
2
|
import { type Locale } from 'zhin.js/i18n';
|
|
2
3
|
import type { IncomingMessage } from 'node:http';
|
|
3
4
|
import type { ConversationRef } from '@zhin.js/im-contract';
|
|
4
5
|
/** One endpoint config after AdapterIndex expands `plugins.<instanceKey>.endpoints`. */
|
|
5
|
-
export interface WeChatMpEndpointConfig {
|
|
6
|
+
export interface WeChatMpEndpointConfig extends EndpointProfileConfiguration {
|
|
6
7
|
readonly id: string;
|
|
7
8
|
readonly appId: string;
|
|
8
9
|
readonly appSecret: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zhin.js/adapter-wechat-mp",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Zhin.js WeChat Official Account adapter for Plugin Runtime (HTTP webhook)",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -8,23 +8,23 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"axios": "^1.20.0",
|
|
10
10
|
"xml2js": "^0.6.2",
|
|
11
|
-
"@zhin.js/adapter": "1.1.
|
|
12
|
-
"@zhin.js/client": "1.1.
|
|
11
|
+
"@zhin.js/adapter": "1.1.27",
|
|
12
|
+
"@zhin.js/client": "1.1.23",
|
|
13
13
|
"@zhin.js/console-contract": "1.1.3",
|
|
14
|
-
"@zhin.js/core": "1.1.
|
|
15
|
-
"@zhin.js/feature-kit": "1.1.
|
|
16
|
-
"@zhin.js/host-http": "1.1.
|
|
17
|
-
"@zhin.js/im-contract": "1.1.
|
|
14
|
+
"@zhin.js/core": "1.1.55",
|
|
15
|
+
"@zhin.js/feature-kit": "1.1.11",
|
|
16
|
+
"@zhin.js/host-http": "1.1.13",
|
|
17
|
+
"@zhin.js/im-contract": "1.1.10",
|
|
18
18
|
"@zhin.js/logger": "1.1.2",
|
|
19
|
-
"@zhin.js/page": "1.1.
|
|
20
|
-
"@zhin.js/skill": "1.1.
|
|
19
|
+
"@zhin.js/page": "1.1.13",
|
|
20
|
+
"@zhin.js/skill": "1.1.12"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@zhin.js/adapter": "^1.1.
|
|
24
|
-
"@zhin.js/command": "^1.1.
|
|
25
|
-
"@zhin.js/core": "^1.1.
|
|
26
|
-
"@zhin.js/host-http": "^1.1.
|
|
27
|
-
"zhin.js": "^1.1.
|
|
23
|
+
"@zhin.js/adapter": "^1.1.27",
|
|
24
|
+
"@zhin.js/command": "^1.1.13",
|
|
25
|
+
"@zhin.js/core": "^1.1.55",
|
|
26
|
+
"@zhin.js/host-http": "^1.1.13",
|
|
27
|
+
"zhin.js": "^1.1.20"
|
|
28
28
|
},
|
|
29
29
|
"peerDependenciesMeta": {
|
|
30
30
|
"@zhin.js/command": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@types/xml2js": "^0.4.14",
|
|
40
40
|
"typescript": "^6.0.3",
|
|
41
41
|
"vitest": "^4.1.10",
|
|
42
|
-
"zhin.js": "1.1.
|
|
42
|
+
"zhin.js": "1.1.20"
|
|
43
43
|
},
|
|
44
44
|
"keywords": [
|
|
45
45
|
"zhin",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"features": [
|
|
99
99
|
{
|
|
100
100
|
"package": "@zhin.js/adapter",
|
|
101
|
-
"api": "^2.
|
|
101
|
+
"api": "^2.1.0"
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
"package": "@zhin.js/command",
|
package/schema.json
CHANGED
|
@@ -142,6 +142,27 @@
|
|
|
142
142
|
"id": {
|
|
143
143
|
"type": "string",
|
|
144
144
|
"description": "WeChat MP bot name"
|
|
145
|
+
},
|
|
146
|
+
"nickname": {
|
|
147
|
+
"type": [
|
|
148
|
+
"string",
|
|
149
|
+
"null"
|
|
150
|
+
],
|
|
151
|
+
"description": "账号昵称兜底",
|
|
152
|
+
"x-i18n": {
|
|
153
|
+
"en": {
|
|
154
|
+
"description": "Fallback account nickname"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"profile": {
|
|
159
|
+
"$ref": "#/$defs/selfProfileFallback",
|
|
160
|
+
"description": "账号资料兜底",
|
|
161
|
+
"x-i18n": {
|
|
162
|
+
"en": {
|
|
163
|
+
"description": "Fallback account profile"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
145
166
|
}
|
|
146
167
|
},
|
|
147
168
|
"required": [
|
|
@@ -166,9 +187,93 @@
|
|
|
166
187
|
"description": "Command prefix. The default empty string allows unprefixed commands; '/' requires a leading slash. Each endpoints[i] can override it."
|
|
167
188
|
}
|
|
168
189
|
}
|
|
190
|
+
},
|
|
191
|
+
"nickname": {
|
|
192
|
+
"type": [
|
|
193
|
+
"string",
|
|
194
|
+
"null"
|
|
195
|
+
],
|
|
196
|
+
"description": "账号昵称兜底",
|
|
197
|
+
"x-i18n": {
|
|
198
|
+
"en": {
|
|
199
|
+
"description": "Fallback account nickname"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"profile": {
|
|
204
|
+
"$ref": "#/$defs/selfProfileFallback",
|
|
205
|
+
"description": "账号资料兜底",
|
|
206
|
+
"x-i18n": {
|
|
207
|
+
"en": {
|
|
208
|
+
"description": "Fallback account profile"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
169
211
|
}
|
|
170
212
|
},
|
|
171
213
|
"required": [
|
|
172
214
|
"endpoints"
|
|
173
|
-
]
|
|
215
|
+
],
|
|
216
|
+
"$defs": {
|
|
217
|
+
"selfProfileFallback": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"additionalProperties": false,
|
|
220
|
+
"properties": {
|
|
221
|
+
"gender": {
|
|
222
|
+
"type": [
|
|
223
|
+
"string",
|
|
224
|
+
"null"
|
|
225
|
+
],
|
|
226
|
+
"enum": [
|
|
227
|
+
"male",
|
|
228
|
+
"female",
|
|
229
|
+
"other",
|
|
230
|
+
"unknown",
|
|
231
|
+
null
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
"age": {
|
|
235
|
+
"type": [
|
|
236
|
+
"integer",
|
|
237
|
+
"null"
|
|
238
|
+
],
|
|
239
|
+
"minimum": 0
|
|
240
|
+
},
|
|
241
|
+
"birthday": {
|
|
242
|
+
"type": [
|
|
243
|
+
"string",
|
|
244
|
+
"null"
|
|
245
|
+
],
|
|
246
|
+
"pattern": "^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$"
|
|
247
|
+
},
|
|
248
|
+
"signature": {
|
|
249
|
+
"type": [
|
|
250
|
+
"string",
|
|
251
|
+
"null"
|
|
252
|
+
]
|
|
253
|
+
},
|
|
254
|
+
"avatar": {
|
|
255
|
+
"type": [
|
|
256
|
+
"string",
|
|
257
|
+
"null"
|
|
258
|
+
],
|
|
259
|
+
"pattern": "^(https?://[^\\s/?#]+(?:[/?#].*)?|)$"
|
|
260
|
+
},
|
|
261
|
+
"interests": {
|
|
262
|
+
"type": [
|
|
263
|
+
"array",
|
|
264
|
+
"null"
|
|
265
|
+
],
|
|
266
|
+
"items": {
|
|
267
|
+
"type": "string"
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
"bio": {
|
|
271
|
+
"type": [
|
|
272
|
+
"string",
|
|
273
|
+
"null"
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
174
279
|
}
|
package/src/protocol.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EndpointProfileConfiguration } from 'zhin.js/adapter';
|
|
1
2
|
import { createMessages, type Locale } from 'zhin.js/i18n';
|
|
2
3
|
/**
|
|
3
4
|
* WeChat Official Account (MP) protocol helpers — no legacy Adapter/Endpoint.
|
|
@@ -10,7 +11,7 @@ import * as xml2js from 'xml2js';
|
|
|
10
11
|
import type { ConversationRef } from '@zhin.js/im-contract';
|
|
11
12
|
|
|
12
13
|
/** One endpoint config after AdapterIndex expands `plugins.<instanceKey>.endpoints`. */
|
|
13
|
-
export interface WeChatMpEndpointConfig {
|
|
14
|
+
export interface WeChatMpEndpointConfig extends EndpointProfileConfiguration {
|
|
14
15
|
readonly id: string;
|
|
15
16
|
readonly appId: string;
|
|
16
17
|
readonly appSecret: string;
|