@zhin.js/core 1.1.41 → 1.1.43
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/built/interactive-segments/action.js +1 -1
- package/lib/built/roles.d.ts +6 -1
- package/lib/built/roles.js +11 -20
- package/lib/built/segment-contract/assert.js +1 -1
- package/lib/built/segment-contract/json-schema.js +1 -1
- package/lib/built/segment-contract/validate.d.ts +301 -158
- package/lib/built/user-interaction.js +9 -3
- package/lib/feature/middleware-public-api.d.ts +5 -0
- package/lib/feature/middleware-public-api.js +5 -0
- package/lib/feature/middleware.d.ts +20 -2
- package/lib/feature/middleware.js +6 -2
- package/lib/jsx/intrinsic-elements.d.ts +83 -0
- package/lib/jsx/intrinsic-elements.js +1 -0
- package/lib/jsx/message-renderer.d.ts +13 -0
- package/lib/jsx/message-renderer.js +128 -0
- package/lib/jsx/message-tags.d.ts +126 -0
- package/lib/jsx/message-tags.js +47 -0
- package/lib/jsx-dev-runtime.d.ts +2 -1
- package/lib/jsx-dev-runtime.js +1 -1
- package/lib/jsx-runtime.d.ts +2 -1
- package/lib/jsx-runtime.js +1 -1
- package/lib/jsx.d.ts +5 -0
- package/lib/jsx.js +2 -0
- package/lib/plugin-runtime/im/contracts.d.ts +14 -0
- package/lib/plugin-runtime/im/contracts.js +3 -1
- package/lib/plugin-runtime/im/conversation-runtime.d.ts +13 -1
- package/lib/plugin-runtime/im/conversation-runtime.js +47 -1
- package/lib/plugin-runtime/im/endpoint-runtime.d.ts +8 -3
- package/lib/plugin-runtime/im/endpoint-runtime.js +46 -3
- package/lib/plugin-runtime/im/im-runtime.d.ts +12 -1
- package/lib/plugin-runtime/im/im-runtime.js +19 -1
- package/lib/plugin-runtime/im/inbound-dedup.d.ts +51 -0
- package/lib/plugin-runtime/im/inbound-dedup.js +184 -0
- package/lib/plugin-runtime/im/inbound-origin.d.ts +101 -0
- package/lib/plugin-runtime/im/inbound-origin.js +76 -0
- package/lib/plugin-runtime/im/inbound-runtime.d.ts +16 -2
- package/lib/plugin-runtime/im/inbound-runtime.js +238 -14
- package/lib/plugin-runtime/im/index.d.ts +3 -1
- package/lib/plugin-runtime/im/index.js +1 -0
- package/lib/plugin-runtime/im/interaction-runtime.d.ts +17 -3
- package/lib/plugin-runtime/im/interaction-runtime.js +31 -3
- package/lib/plugin-runtime/im/interactive-router.d.ts +19 -2
- package/lib/plugin-runtime/im/interactive-router.js +80 -23
- package/lib/plugin-runtime/im/jsx-button-registry.d.ts +17 -0
- package/lib/plugin-runtime/im/jsx-button-registry.js +97 -0
- package/lib/plugin-runtime/im/message-dispatcher.js +10 -0
- package/lib/plugin-runtime/im/message-events.d.ts +7 -0
- package/lib/plugin-runtime/im/outbound-delivery-runtime.d.ts +5 -1
- package/lib/plugin-runtime/im/outbound-delivery-runtime.js +49 -44
- package/lib/plugin-runtime/im/outbound-ledger.d.ts +24 -0
- package/lib/plugin-runtime/im/outbound-ledger.js +114 -0
- package/lib/plugin-runtime/im/outbound-projection.d.ts +15 -0
- package/lib/plugin-runtime/im/outbound-projection.js +55 -0
- package/lib/plugin-runtime/im/outbound-renderer.d.ts +6 -1
- package/lib/plugin-runtime/im/outbound-renderer.js +51 -12
- package/lib/plugin-runtime/im/outbound-segments.d.ts +4 -1
- package/lib/plugin-runtime/im/outbound-segments.js +37 -7
- package/package.json +16 -16
|
@@ -44,7 +44,7 @@ export function resolveTextFallbackPayload(raw, map) {
|
|
|
44
44
|
const trimmed = raw.trim();
|
|
45
45
|
if (map[trimmed])
|
|
46
46
|
return map[trimmed];
|
|
47
|
-
const match = trimmed.match(/^(?:ttt\s+)?(\d)$/i);
|
|
47
|
+
const match = trimmed.match(/^(?:ttt\s+)?(\d+)$/i);
|
|
48
48
|
if (match && map[match[1]])
|
|
49
49
|
return map[match[1]];
|
|
50
50
|
return undefined;
|
package/lib/built/roles.d.ts
CHANGED
|
@@ -10,5 +10,10 @@ export declare function roleSatisfies(callerRoles: Iterable<SenderRole>, require
|
|
|
10
10
|
export declare function normalizeSenderRoles(roles: Iterable<SenderRole>): SenderRole[];
|
|
11
11
|
export declare function hasSenderRole(roles: Iterable<SenderRole>, role: SenderRole): boolean;
|
|
12
12
|
export declare function formatSenderRolesForLabel(roles: readonly SenderRole[]): string;
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* 转义用户正文里所有自造的 `[sender:` / `[origin:` 标签(任意位置、大小写不敏感,
|
|
15
|
+
* 容忍 `[ sender :`、零宽字符、全角冒号)。命中时把开头的 ASCII `[` 换成全角 `[`,
|
|
16
|
+
* 其余原样保留:模型仍能看出这是用户文本,但它不再是权威标签。
|
|
17
|
+
* 幂等(已转义文本再次调用不变),不再剥离开头,也不 trim 原文空白。
|
|
18
|
+
*/
|
|
14
19
|
export declare function stripUserSpoofedSenderPrefix(rawContent: string): string;
|
package/lib/built/roles.js
CHANGED
|
@@ -38,25 +38,16 @@ export function hasSenderRole(roles, role) {
|
|
|
38
38
|
export function formatSenderRolesForLabel(roles) {
|
|
39
39
|
return roles.filter((r) => r !== 'user').join(',') || 'user';
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
// 空白与零宽字符(不含 U+200D:会破坏 emoji ZWJ 序列)。
|
|
42
|
+
const SPOOF_GAP = '[\\s\\u200B\\u200C\\u2060\\uFEFF]';
|
|
43
|
+
const spoofWord = (word) => word.split('').join(`${SPOOF_GAP}*`);
|
|
44
|
+
const SPOOFED_LABEL_RE = new RegExp(`\\[(?=${SPOOF_GAP}*(?:${spoofWord('sender')}|${spoofWord('origin')})${SPOOF_GAP}*[::])`, 'gi');
|
|
45
|
+
/**
|
|
46
|
+
* 转义用户正文里所有自造的 `[sender:` / `[origin:` 标签(任意位置、大小写不敏感,
|
|
47
|
+
* 容忍 `[ sender :`、零宽字符、全角冒号)。命中时把开头的 ASCII `[` 换成全角 `[`,
|
|
48
|
+
* 其余原样保留:模型仍能看出这是用户文本,但它不再是权威标签。
|
|
49
|
+
* 幂等(已转义文本再次调用不变),不再剥离开头,也不 trim 原文空白。
|
|
50
|
+
*/
|
|
42
51
|
export function stripUserSpoofedSenderPrefix(rawContent) {
|
|
43
|
-
|
|
44
|
-
const prefixRe = /^\[sender:(?:id=[^\]]*|[^\]]*)\]\s*/i;
|
|
45
|
-
const rolesRe = /^\[sender:id=[^\s\]]+(?:\s+name=[^\]]+)?\s+roles=[^\]]+\]\s*/i;
|
|
46
|
-
let changed = true;
|
|
47
|
-
while (changed) {
|
|
48
|
-
changed = false;
|
|
49
|
-
const m1 = text.match(prefixRe);
|
|
50
|
-
if (m1) {
|
|
51
|
-
text = text.slice(m1[0].length);
|
|
52
|
-
changed = true;
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const m2 = text.match(rolesRe);
|
|
56
|
-
if (m2) {
|
|
57
|
-
text = text.slice(m2[0].length);
|
|
58
|
-
changed = true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return text;
|
|
52
|
+
return rawContent.replace(SPOOFED_LABEL_RE, '\uFF3B');
|
|
62
53
|
}
|
|
@@ -8,7 +8,7 @@ const STRICT_CANONICAL_TYPES = new Set([
|
|
|
8
8
|
// their gradual contracts isolated here; third-party extensions must be
|
|
9
9
|
// namespaced so a future canonical type cannot silently collide with them.
|
|
10
10
|
const CORE_EXTENSION_TYPES = new Set([
|
|
11
|
-
'action', 'html', 'keyboard', 'link', 'markdown', 'qrcode', 'record', 'tts', 'voice',
|
|
11
|
+
'action', 'card', 'html', 'keyboard', 'link', 'markdown', 'qrcode', 'record', 'tts', 'voice',
|
|
12
12
|
]);
|
|
13
13
|
const extensionTypePattern = /^[a-z][a-z0-9-]*(?::[a-z][a-z0-9-]*)+$/u;
|
|
14
14
|
function isPlainObject(value) {
|
|
@@ -66,7 +66,7 @@ const looseBranch = {
|
|
|
66
66
|
properties: {
|
|
67
67
|
type: {
|
|
68
68
|
type: 'string',
|
|
69
|
-
enum: ['voice', 'record', 'link', 'markdown', 'html'],
|
|
69
|
+
enum: ['voice', 'record', 'link', 'markdown', 'html', 'card'],
|
|
70
70
|
},
|
|
71
71
|
data: { type: 'object' },
|
|
72
72
|
platform: platformJsonSchema,
|
|
@@ -1,267 +1,410 @@
|
|
|
1
1
|
import { Schema } from '@zhin.js/schema';
|
|
2
2
|
import type { Segment } from './types.js';
|
|
3
3
|
export { isMediaRef } from '@zhin.js/im-contract';
|
|
4
|
-
export declare const mediaRefSchema: Schema<{
|
|
4
|
+
export declare const mediaRefSchema: Schema<Schema.InputRecord<{
|
|
5
|
+
kind: Schema;
|
|
6
|
+
value: Schema<string, string> & Schema.Present & Schema.Required;
|
|
7
|
+
mime_type: Schema<string, string>;
|
|
8
|
+
file_name: Schema<string, string>;
|
|
9
|
+
size: Schema<number, number>;
|
|
10
|
+
}>, {
|
|
11
|
+
value: string;
|
|
12
|
+
} & {
|
|
5
13
|
kind?: any;
|
|
6
|
-
value?: string | undefined;
|
|
7
|
-
mime_type?: string | undefined;
|
|
8
|
-
file_name?: string | undefined;
|
|
9
|
-
size?: number | undefined;
|
|
10
|
-
}, {
|
|
11
|
-
kind?: any;
|
|
12
|
-
value?: string | undefined;
|
|
13
14
|
mime_type?: string | undefined;
|
|
14
15
|
file_name?: string | undefined;
|
|
15
16
|
size?: number | undefined;
|
|
16
17
|
}>;
|
|
17
|
-
export declare const textSegmentSchema: Schema<{
|
|
18
|
-
type
|
|
19
|
-
data
|
|
20
|
-
text
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
export declare const textSegmentSchema: Schema<Schema.InputRecord<{
|
|
19
|
+
type: Schema<"text", "text"> & Schema.Present;
|
|
20
|
+
data: Schema<Schema.InputRecord<{
|
|
21
|
+
text: Schema<string, string> & Schema.Present & Schema.Required;
|
|
22
|
+
}>, {
|
|
23
|
+
text: string;
|
|
24
|
+
} & {}> & Schema.Present & Schema.Required;
|
|
25
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
26
|
+
}>, {
|
|
27
|
+
type: "text";
|
|
28
|
+
data: {
|
|
29
|
+
text: string;
|
|
30
|
+
} & {};
|
|
31
|
+
} & {
|
|
28
32
|
platform?: Record<string, any> | undefined;
|
|
29
33
|
}>;
|
|
30
|
-
export declare const mentionSegmentSchema: Schema<{
|
|
31
|
-
type
|
|
32
|
-
data
|
|
33
|
-
target
|
|
34
|
+
export declare const mentionSegmentSchema: Schema<Schema.InputRecord<{
|
|
35
|
+
type: Schema<"mention", "mention"> & Schema.Present;
|
|
36
|
+
data: Schema<Schema.InputRecord<{
|
|
37
|
+
target: Schema<string, string> & Schema.Present & Schema.Required;
|
|
38
|
+
name: Schema<string, string>;
|
|
39
|
+
}>, {
|
|
40
|
+
target: string;
|
|
41
|
+
} & {
|
|
34
42
|
name?: string | undefined;
|
|
35
|
-
}
|
|
36
|
-
platform
|
|
37
|
-
}
|
|
38
|
-
type
|
|
39
|
-
data
|
|
40
|
-
target
|
|
43
|
+
}> & Schema.Present & Schema.Required;
|
|
44
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
45
|
+
}>, {
|
|
46
|
+
type: "mention";
|
|
47
|
+
data: {
|
|
48
|
+
target: string;
|
|
49
|
+
} & {
|
|
41
50
|
name?: string | undefined;
|
|
42
|
-
}
|
|
51
|
+
};
|
|
52
|
+
} & {
|
|
43
53
|
platform?: Record<string, any> | undefined;
|
|
44
54
|
}>;
|
|
45
|
-
export declare const imageSegmentSchema: Schema<{
|
|
46
|
-
type
|
|
47
|
-
data
|
|
48
|
-
media
|
|
55
|
+
export declare const imageSegmentSchema: Schema<Schema.InputRecord<{
|
|
56
|
+
type: Schema<"image", "image"> & Schema.Present;
|
|
57
|
+
data: Schema<Schema.InputRecord<{
|
|
58
|
+
media: Schema<Schema.InputRecord<{
|
|
59
|
+
kind: Schema;
|
|
60
|
+
value: Schema<string, string> & Schema.Present & Schema.Required;
|
|
61
|
+
mime_type: Schema<string, string>;
|
|
62
|
+
file_name: Schema<string, string>;
|
|
63
|
+
size: Schema<number, number>;
|
|
64
|
+
}>, {
|
|
65
|
+
value: string;
|
|
66
|
+
} & {
|
|
67
|
+
kind?: any;
|
|
68
|
+
mime_type?: string | undefined;
|
|
69
|
+
file_name?: string | undefined;
|
|
70
|
+
size?: number | undefined;
|
|
71
|
+
}> & Schema.Present & Schema.Required;
|
|
72
|
+
alt: Schema<string, string>;
|
|
73
|
+
}>, {
|
|
74
|
+
media: {
|
|
75
|
+
value: string;
|
|
76
|
+
} & {
|
|
49
77
|
kind?: any;
|
|
50
|
-
value?: string | undefined;
|
|
51
78
|
mime_type?: string | undefined;
|
|
52
79
|
file_name?: string | undefined;
|
|
53
80
|
size?: number | undefined;
|
|
54
|
-
}
|
|
81
|
+
};
|
|
82
|
+
} & {
|
|
55
83
|
alt?: string | undefined;
|
|
56
|
-
}
|
|
57
|
-
platform
|
|
58
|
-
}
|
|
59
|
-
type
|
|
60
|
-
data
|
|
61
|
-
media
|
|
84
|
+
}> & Schema.Present & Schema.Required;
|
|
85
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
86
|
+
}>, {
|
|
87
|
+
type: "image";
|
|
88
|
+
data: {
|
|
89
|
+
media: {
|
|
90
|
+
value: string;
|
|
91
|
+
} & {
|
|
62
92
|
kind?: any;
|
|
63
|
-
value?: string | undefined;
|
|
64
93
|
mime_type?: string | undefined;
|
|
65
94
|
file_name?: string | undefined;
|
|
66
95
|
size?: number | undefined;
|
|
67
|
-
}
|
|
96
|
+
};
|
|
97
|
+
} & {
|
|
68
98
|
alt?: string | undefined;
|
|
69
|
-
}
|
|
99
|
+
};
|
|
100
|
+
} & {
|
|
70
101
|
platform?: Record<string, any> | undefined;
|
|
71
102
|
}>;
|
|
72
|
-
export declare const audioSegmentSchema: Schema<{
|
|
73
|
-
type
|
|
74
|
-
data
|
|
75
|
-
media
|
|
103
|
+
export declare const audioSegmentSchema: Schema<Schema.InputRecord<{
|
|
104
|
+
type: Schema<"audio", "audio"> & Schema.Present;
|
|
105
|
+
data: Schema<Schema.InputRecord<{
|
|
106
|
+
media: Schema<Schema.InputRecord<{
|
|
107
|
+
kind: Schema;
|
|
108
|
+
value: Schema<string, string> & Schema.Present & Schema.Required;
|
|
109
|
+
mime_type: Schema<string, string>;
|
|
110
|
+
file_name: Schema<string, string>;
|
|
111
|
+
size: Schema<number, number>;
|
|
112
|
+
}>, {
|
|
113
|
+
value: string;
|
|
114
|
+
} & {
|
|
115
|
+
kind?: any;
|
|
116
|
+
mime_type?: string | undefined;
|
|
117
|
+
file_name?: string | undefined;
|
|
118
|
+
size?: number | undefined;
|
|
119
|
+
}> & Schema.Present & Schema.Required;
|
|
120
|
+
duration: Schema<number, number>;
|
|
121
|
+
}>, {
|
|
122
|
+
media: {
|
|
123
|
+
value: string;
|
|
124
|
+
} & {
|
|
76
125
|
kind?: any;
|
|
77
|
-
value?: string | undefined;
|
|
78
126
|
mime_type?: string | undefined;
|
|
79
127
|
file_name?: string | undefined;
|
|
80
128
|
size?: number | undefined;
|
|
81
|
-
}
|
|
129
|
+
};
|
|
130
|
+
} & {
|
|
82
131
|
duration?: number | undefined;
|
|
83
|
-
}
|
|
84
|
-
platform
|
|
85
|
-
}
|
|
86
|
-
type
|
|
87
|
-
data
|
|
88
|
-
media
|
|
132
|
+
}> & Schema.Present & Schema.Required;
|
|
133
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
134
|
+
}>, {
|
|
135
|
+
type: "audio";
|
|
136
|
+
data: {
|
|
137
|
+
media: {
|
|
138
|
+
value: string;
|
|
139
|
+
} & {
|
|
89
140
|
kind?: any;
|
|
90
|
-
value?: string | undefined;
|
|
91
141
|
mime_type?: string | undefined;
|
|
92
142
|
file_name?: string | undefined;
|
|
93
143
|
size?: number | undefined;
|
|
94
|
-
}
|
|
144
|
+
};
|
|
145
|
+
} & {
|
|
95
146
|
duration?: number | undefined;
|
|
96
|
-
}
|
|
147
|
+
};
|
|
148
|
+
} & {
|
|
97
149
|
platform?: Record<string, any> | undefined;
|
|
98
150
|
}>;
|
|
99
|
-
export declare const videoSegmentSchema: Schema<{
|
|
100
|
-
type
|
|
101
|
-
data
|
|
102
|
-
media
|
|
151
|
+
export declare const videoSegmentSchema: Schema<Schema.InputRecord<{
|
|
152
|
+
type: Schema<"video", "video"> & Schema.Present;
|
|
153
|
+
data: Schema<Schema.InputRecord<{
|
|
154
|
+
media: Schema<Schema.InputRecord<{
|
|
155
|
+
kind: Schema;
|
|
156
|
+
value: Schema<string, string> & Schema.Present & Schema.Required;
|
|
157
|
+
mime_type: Schema<string, string>;
|
|
158
|
+
file_name: Schema<string, string>;
|
|
159
|
+
size: Schema<number, number>;
|
|
160
|
+
}>, {
|
|
161
|
+
value: string;
|
|
162
|
+
} & {
|
|
163
|
+
kind?: any;
|
|
164
|
+
mime_type?: string | undefined;
|
|
165
|
+
file_name?: string | undefined;
|
|
166
|
+
size?: number | undefined;
|
|
167
|
+
}> & Schema.Present & Schema.Required;
|
|
168
|
+
duration: Schema<number, number>;
|
|
169
|
+
alt: Schema<string, string>;
|
|
170
|
+
}>, {
|
|
171
|
+
media: {
|
|
172
|
+
value: string;
|
|
173
|
+
} & {
|
|
103
174
|
kind?: any;
|
|
104
|
-
value?: string | undefined;
|
|
105
175
|
mime_type?: string | undefined;
|
|
106
176
|
file_name?: string | undefined;
|
|
107
177
|
size?: number | undefined;
|
|
108
|
-
}
|
|
178
|
+
};
|
|
179
|
+
} & {
|
|
109
180
|
duration?: number | undefined;
|
|
110
181
|
alt?: string | undefined;
|
|
111
|
-
}
|
|
112
|
-
platform
|
|
113
|
-
}
|
|
114
|
-
type
|
|
115
|
-
data
|
|
116
|
-
media
|
|
182
|
+
}> & Schema.Present & Schema.Required;
|
|
183
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
184
|
+
}>, {
|
|
185
|
+
type: "video";
|
|
186
|
+
data: {
|
|
187
|
+
media: {
|
|
188
|
+
value: string;
|
|
189
|
+
} & {
|
|
117
190
|
kind?: any;
|
|
118
|
-
value?: string | undefined;
|
|
119
191
|
mime_type?: string | undefined;
|
|
120
192
|
file_name?: string | undefined;
|
|
121
193
|
size?: number | undefined;
|
|
122
|
-
}
|
|
194
|
+
};
|
|
195
|
+
} & {
|
|
123
196
|
duration?: number | undefined;
|
|
124
197
|
alt?: string | undefined;
|
|
125
|
-
}
|
|
198
|
+
};
|
|
199
|
+
} & {
|
|
126
200
|
platform?: Record<string, any> | undefined;
|
|
127
201
|
}>;
|
|
128
|
-
export declare const fileSegmentSchema: Schema<{
|
|
129
|
-
type
|
|
130
|
-
data
|
|
131
|
-
media
|
|
202
|
+
export declare const fileSegmentSchema: Schema<Schema.InputRecord<{
|
|
203
|
+
type: Schema<"file", "file"> & Schema.Present;
|
|
204
|
+
data: Schema<Schema.InputRecord<{
|
|
205
|
+
media: Schema<Schema.InputRecord<{
|
|
206
|
+
kind: Schema;
|
|
207
|
+
value: Schema<string, string> & Schema.Present & Schema.Required;
|
|
208
|
+
mime_type: Schema<string, string>;
|
|
209
|
+
file_name: Schema<string, string>;
|
|
210
|
+
size: Schema<number, number>;
|
|
211
|
+
}>, {
|
|
212
|
+
value: string;
|
|
213
|
+
} & {
|
|
214
|
+
kind?: any;
|
|
215
|
+
mime_type?: string | undefined;
|
|
216
|
+
file_name?: string | undefined;
|
|
217
|
+
size?: number | undefined;
|
|
218
|
+
}> & Schema.Present & Schema.Required;
|
|
219
|
+
name: Schema<string, string>;
|
|
220
|
+
}>, {
|
|
221
|
+
media: {
|
|
222
|
+
value: string;
|
|
223
|
+
} & {
|
|
132
224
|
kind?: any;
|
|
133
|
-
value?: string | undefined;
|
|
134
225
|
mime_type?: string | undefined;
|
|
135
226
|
file_name?: string | undefined;
|
|
136
227
|
size?: number | undefined;
|
|
137
|
-
}
|
|
228
|
+
};
|
|
229
|
+
} & {
|
|
138
230
|
name?: string | undefined;
|
|
139
|
-
}
|
|
140
|
-
platform
|
|
141
|
-
}
|
|
142
|
-
type
|
|
143
|
-
data
|
|
144
|
-
media
|
|
231
|
+
}> & Schema.Present & Schema.Required;
|
|
232
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
233
|
+
}>, {
|
|
234
|
+
type: "file";
|
|
235
|
+
data: {
|
|
236
|
+
media: {
|
|
237
|
+
value: string;
|
|
238
|
+
} & {
|
|
145
239
|
kind?: any;
|
|
146
|
-
value?: string | undefined;
|
|
147
240
|
mime_type?: string | undefined;
|
|
148
241
|
file_name?: string | undefined;
|
|
149
242
|
size?: number | undefined;
|
|
150
|
-
}
|
|
243
|
+
};
|
|
244
|
+
} & {
|
|
151
245
|
name?: string | undefined;
|
|
152
|
-
}
|
|
246
|
+
};
|
|
247
|
+
} & {
|
|
153
248
|
platform?: Record<string, any> | undefined;
|
|
154
249
|
}>;
|
|
155
|
-
export declare const replySegmentSchema: Schema<{
|
|
156
|
-
type
|
|
157
|
-
data
|
|
158
|
-
message_id
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
250
|
+
export declare const replySegmentSchema: Schema<Schema.InputRecord<{
|
|
251
|
+
type: Schema<"reply", "reply"> & Schema.Present;
|
|
252
|
+
data: Schema<Schema.InputRecord<{
|
|
253
|
+
message_id: Schema<string, string> & Schema.Present & Schema.Required;
|
|
254
|
+
}>, {
|
|
255
|
+
message_id: string;
|
|
256
|
+
} & {}> & Schema.Present & Schema.Required;
|
|
257
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
258
|
+
}>, {
|
|
259
|
+
type: "reply";
|
|
260
|
+
data: {
|
|
261
|
+
message_id: string;
|
|
262
|
+
} & {};
|
|
263
|
+
} & {
|
|
166
264
|
platform?: Record<string, any> | undefined;
|
|
167
265
|
}>;
|
|
168
|
-
export declare const forwardSegmentSchema: Schema<{
|
|
169
|
-
type
|
|
170
|
-
data
|
|
171
|
-
forward_id
|
|
266
|
+
export declare const forwardSegmentSchema: Schema<Schema.InputRecord<{
|
|
267
|
+
type: Schema<"forward", "forward"> & Schema.Present;
|
|
268
|
+
data: Schema<Schema.InputRecord<{
|
|
269
|
+
forward_id: Schema<string, string> & Schema.Present & Schema.Required;
|
|
270
|
+
title: Schema<string, string>;
|
|
271
|
+
messages: Schema<any[][], any[][]>;
|
|
272
|
+
}>, {
|
|
273
|
+
forward_id: string;
|
|
274
|
+
} & {
|
|
172
275
|
title?: string | undefined;
|
|
173
276
|
messages?: any[][] | undefined;
|
|
174
|
-
}
|
|
175
|
-
platform
|
|
176
|
-
}
|
|
177
|
-
type
|
|
178
|
-
data
|
|
179
|
-
forward_id
|
|
277
|
+
}> & Schema.Present & Schema.Required;
|
|
278
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
279
|
+
}>, {
|
|
280
|
+
type: "forward";
|
|
281
|
+
data: {
|
|
282
|
+
forward_id: string;
|
|
283
|
+
} & {
|
|
180
284
|
title?: string | undefined;
|
|
181
285
|
messages?: any[][] | undefined;
|
|
182
|
-
}
|
|
286
|
+
};
|
|
287
|
+
} & {
|
|
183
288
|
platform?: Record<string, any> | undefined;
|
|
184
289
|
}>;
|
|
185
|
-
export declare const faceSegmentSchema: Schema<{
|
|
186
|
-
type
|
|
187
|
-
data
|
|
290
|
+
export declare const faceSegmentSchema: Schema<Schema.InputRecord<{
|
|
291
|
+
type: Schema<"face", "face"> & Schema.Present;
|
|
292
|
+
data: Schema<Schema.InputRecord<{
|
|
293
|
+
id: Schema;
|
|
294
|
+
name: Schema<string, string>;
|
|
295
|
+
}>, {} & {
|
|
188
296
|
id?: any;
|
|
189
297
|
name?: string | undefined;
|
|
190
|
-
}
|
|
191
|
-
platform
|
|
192
|
-
}
|
|
193
|
-
type
|
|
194
|
-
data
|
|
298
|
+
}> & Schema.Present & Schema.Required;
|
|
299
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
300
|
+
}>, {
|
|
301
|
+
type: "face";
|
|
302
|
+
data: {} & {
|
|
195
303
|
id?: any;
|
|
196
304
|
name?: string | undefined;
|
|
197
|
-
}
|
|
305
|
+
};
|
|
306
|
+
} & {
|
|
198
307
|
platform?: Record<string, any> | undefined;
|
|
199
308
|
}>;
|
|
200
|
-
export declare const diceSegmentSchema: Schema<{
|
|
201
|
-
type
|
|
202
|
-
data
|
|
309
|
+
export declare const diceSegmentSchema: Schema<Schema.InputRecord<{
|
|
310
|
+
type: Schema<"dice", "dice"> & Schema.Present;
|
|
311
|
+
data: Schema<Schema.InputRecord<{
|
|
312
|
+
result: Schema<number, number>;
|
|
313
|
+
}>, {} & {
|
|
203
314
|
result?: number | undefined;
|
|
204
|
-
}
|
|
205
|
-
platform
|
|
206
|
-
}
|
|
207
|
-
type
|
|
208
|
-
data
|
|
315
|
+
}> & Schema.Present & Schema.Required;
|
|
316
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
317
|
+
}>, {
|
|
318
|
+
type: "dice";
|
|
319
|
+
data: {} & {
|
|
209
320
|
result?: number | undefined;
|
|
210
|
-
}
|
|
321
|
+
};
|
|
322
|
+
} & {
|
|
211
323
|
platform?: Record<string, any> | undefined;
|
|
212
324
|
}>;
|
|
213
|
-
export declare const rpsSegmentSchema: Schema<{
|
|
214
|
-
type
|
|
215
|
-
data
|
|
325
|
+
export declare const rpsSegmentSchema: Schema<Schema.InputRecord<{
|
|
326
|
+
type: Schema<"rps", "rps"> & Schema.Present;
|
|
327
|
+
data: Schema<Schema.InputRecord<{
|
|
328
|
+
result: Schema<number, number>;
|
|
329
|
+
}>, {} & {
|
|
216
330
|
result?: number | undefined;
|
|
217
|
-
}
|
|
218
|
-
platform
|
|
219
|
-
}
|
|
220
|
-
type
|
|
221
|
-
data
|
|
331
|
+
}> & Schema.Present & Schema.Required;
|
|
332
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
333
|
+
}>, {
|
|
334
|
+
type: "rps";
|
|
335
|
+
data: {} & {
|
|
222
336
|
result?: number | undefined;
|
|
223
|
-
}
|
|
337
|
+
};
|
|
338
|
+
} & {
|
|
224
339
|
platform?: Record<string, any> | undefined;
|
|
225
340
|
}>;
|
|
226
|
-
export declare const shareSegmentSchema: Schema<{
|
|
227
|
-
type
|
|
228
|
-
data
|
|
229
|
-
url
|
|
230
|
-
title
|
|
341
|
+
export declare const shareSegmentSchema: Schema<Schema.InputRecord<{
|
|
342
|
+
type: Schema<"share", "share"> & Schema.Present;
|
|
343
|
+
data: Schema<Schema.InputRecord<{
|
|
344
|
+
url: Schema<string, string> & Schema.Present & Schema.Required;
|
|
345
|
+
title: Schema<string, string> & Schema.Present & Schema.Required;
|
|
346
|
+
description: Schema<string, string>;
|
|
347
|
+
image: Schema<string, string>;
|
|
348
|
+
audio: Schema<string, string>;
|
|
349
|
+
content: Schema<string, string>;
|
|
350
|
+
artist: Schema<string, string>;
|
|
351
|
+
duration: Schema<number, number>;
|
|
352
|
+
config: Schema<Schema.InputRecord<{
|
|
353
|
+
appid: Schema<number, number> & Schema.Present & Schema.Required;
|
|
354
|
+
package: Schema<string, string>;
|
|
355
|
+
sign: Schema<string, string>;
|
|
356
|
+
icon: Schema<string, string>;
|
|
357
|
+
version: Schema<string, string>;
|
|
358
|
+
}>, {
|
|
359
|
+
appid: number;
|
|
360
|
+
} & {
|
|
361
|
+
package?: string | undefined;
|
|
362
|
+
sign?: string | undefined;
|
|
363
|
+
icon?: string | undefined;
|
|
364
|
+
version?: string | undefined;
|
|
365
|
+
}>;
|
|
366
|
+
}>, {
|
|
367
|
+
url: string;
|
|
368
|
+
title: string;
|
|
369
|
+
} & {
|
|
231
370
|
description?: string | undefined;
|
|
232
371
|
image?: string | undefined;
|
|
233
372
|
audio?: string | undefined;
|
|
234
373
|
content?: string | undefined;
|
|
235
374
|
artist?: string | undefined;
|
|
236
375
|
duration?: number | undefined;
|
|
237
|
-
config?: {
|
|
238
|
-
appid
|
|
376
|
+
config?: ({
|
|
377
|
+
appid: number;
|
|
378
|
+
} & {
|
|
239
379
|
package?: string | undefined;
|
|
240
380
|
sign?: string | undefined;
|
|
241
381
|
icon?: string | undefined;
|
|
242
382
|
version?: string | undefined;
|
|
243
|
-
} | undefined;
|
|
244
|
-
}
|
|
245
|
-
platform
|
|
246
|
-
}
|
|
247
|
-
type
|
|
248
|
-
data
|
|
249
|
-
url
|
|
250
|
-
title
|
|
383
|
+
}) | undefined;
|
|
384
|
+
}> & Schema.Present & Schema.Required;
|
|
385
|
+
platform: Schema<Record<string, any>, Record<string, any>>;
|
|
386
|
+
}>, {
|
|
387
|
+
type: "share";
|
|
388
|
+
data: {
|
|
389
|
+
url: string;
|
|
390
|
+
title: string;
|
|
391
|
+
} & {
|
|
251
392
|
description?: string | undefined;
|
|
252
393
|
image?: string | undefined;
|
|
253
394
|
audio?: string | undefined;
|
|
254
395
|
content?: string | undefined;
|
|
255
396
|
artist?: string | undefined;
|
|
256
397
|
duration?: number | undefined;
|
|
257
|
-
config?: {
|
|
258
|
-
appid
|
|
398
|
+
config?: ({
|
|
399
|
+
appid: number;
|
|
400
|
+
} & {
|
|
259
401
|
package?: string | undefined;
|
|
260
402
|
sign?: string | undefined;
|
|
261
403
|
icon?: string | undefined;
|
|
262
404
|
version?: string | undefined;
|
|
263
|
-
} | undefined;
|
|
264
|
-
}
|
|
405
|
+
}) | undefined;
|
|
406
|
+
};
|
|
407
|
+
} & {
|
|
265
408
|
platform?: Record<string, any> | undefined;
|
|
266
409
|
}>;
|
|
267
410
|
export declare const canonicalSegmentSchema: Schema<any, any>;
|