tencentcloud-sdk-nodejs-tms 4.0.1050 → 4.1.38

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.
@@ -1,482 +0,0 @@
1
- /*
2
- * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing,
11
- * software distributed under the License is distributed on an
12
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
13
- * KIND, either express or implied. See the License for the
14
- * specific language governing permissions and limitations
15
- * under the License.
16
- */
17
-
18
- /**
19
- * 文本过滤条件
20
- */
21
- export interface Filters {
22
- /**
23
- * 查询字段:
24
- 策略BizType
25
- 子账号SubUin
26
- 日期区间DateRange
27
- */
28
- Name: string
29
- /**
30
- * 查询值
31
- */
32
- Values: Array<string>
33
- }
34
-
35
- /**
36
- * 识别结果统计
37
- */
38
- export interface Overview {
39
- /**
40
- * 总调用量
41
- */
42
- TotalCount: number
43
- /**
44
- * 总调用时长
45
- */
46
- TotalHour: number
47
- /**
48
- * 通过量
49
- */
50
- PassCount: number
51
- /**
52
- * 通过时长
53
- */
54
- PassHour: number
55
- /**
56
- * 违规量
57
- */
58
- EvilCount: number
59
- /**
60
- * 违规时长
61
- */
62
- EvilHour: number
63
- /**
64
- * 疑似违规量
65
- */
66
- SuspectCount: number
67
- /**
68
- * 疑似违规时长
69
- */
70
- SuspectHour: number
71
- }
72
-
73
- /**
74
- * 账号风险检测结果
75
- */
76
- export interface RiskDetails {
77
- /**
78
- * 风险类别,RiskAccount,RiskIP, RiskIMEI
79
- */
80
- Label: string
81
- /**
82
- * 风险等级,1:疑似,2:恶意
83
- */
84
- Level: number
85
- }
86
-
87
- /**
88
- * DescribeTextStat请求参数结构体
89
- */
90
- export interface DescribeTextStatRequest {
91
- /**
92
- * 审核类型 1: 机器审核; 2: 人工审核
93
- */
94
- AuditType: number
95
- /**
96
- * 查询条件
97
- */
98
- Filters: Array<Filters>
99
- }
100
-
101
- /**
102
- * TextModeration请求参数结构体
103
- */
104
- export interface TextModerationRequest {
105
- /**
106
- * 文本内容Base64编码。限制原文长度不能超过10000个unicode字符
107
- */
108
- Content: string
109
- /**
110
- * 该字段用于标识业务场景。您可以在内容安全控制台创建对应的ID,配置不同的内容审核策略,通过接口调用,默认不填为0,后端使用默认策略
111
- */
112
- BizType?: string
113
- /**
114
- * 数据ID,英文字母、下划线、-组成,不超过64个字符
115
- */
116
- DataId?: string
117
- /**
118
- * 账号相关信息字段,填入后可识别违规风险账号
119
- */
120
- User?: User
121
- /**
122
- * 设备相关信息字段,填入后可识别违规风险设备
123
- */
124
- Device?: Device
125
- }
126
-
127
- /**
128
- * AccountTipoffAccess请求参数结构体
129
- */
130
- export interface AccountTipoffAccessRequest {
131
- /**
132
- * 被举报账号,长度低于 128 个字符
133
- */
134
- ReportedAccount: string
135
- /**
136
- * 被举报账号类型(1-手机号 2-QQ号 3-微信号 4-QQ群号 5-微信openid 6-QQopenid 0-其它)
137
- */
138
- ReportedAccountType: number
139
- /**
140
- * 被举报账号所属恶意类型(1-诈骗,2-骚扰,3-广告,4-违法违规,5-赌博传销,0-其他)
141
- */
142
- EvilType: number
143
- /**
144
- * 举报者账号,长度低于 128 个字符
145
- */
146
- SenderAccount?: string
147
- /**
148
- * 举报者账号类型(1-手机号 2-QQ号 3-微信号 4-QQ群号 5-微信openid 6-QQopenid 0-其它)
149
- */
150
- SenderAccountType?: number
151
- /**
152
- * 举报者IP地址
153
- */
154
- SenderIP?: string
155
- /**
156
- * 包含被举报账号的恶意内容(比如文本、图片链接,长度低于1024个字符)
157
- */
158
- EvilContent?: string
159
- }
160
-
161
- /**
162
- * 自定义库列表
163
- */
164
- export interface TextLib {
165
- /**
166
- * 库id
167
- */
168
- LibId: number
169
- /**
170
- * 库名
171
- */
172
- LibName: string
173
- }
174
-
175
- /**
176
- * 识别量统计
177
- */
178
- export interface TrendCount {
179
- /**
180
- * 总调用量
181
- 注意:此字段可能返回 null,表示取不到有效值。
182
- */
183
- TotalCount: number
184
- /**
185
- * 总调用时长
186
- 注意:此字段可能返回 null,表示取不到有效值。
187
- */
188
- TotalHour: number
189
- /**
190
- * 通过量
191
- 注意:此字段可能返回 null,表示取不到有效值。
192
- */
193
- PassCount: number
194
- /**
195
- * 通过时长
196
- 注意:此字段可能返回 null,表示取不到有效值。
197
- */
198
- PassHour: number
199
- /**
200
- * 违规量
201
- 注意:此字段可能返回 null,表示取不到有效值。
202
- */
203
- EvilCount: number
204
- /**
205
- * 违规时长
206
- 注意:此字段可能返回 null,表示取不到有效值。
207
- */
208
- EvilHour: number
209
- /**
210
- * 疑似违规量
211
- 注意:此字段可能返回 null,表示取不到有效值。
212
- */
213
- SuspectCount: number
214
- /**
215
- * 疑似违规时长
216
- 注意:此字段可能返回 null,表示取不到有效值。
217
- */
218
- SuspectHour: number
219
- /**
220
- * 日期
221
- 注意:此字段可能返回 null,表示取不到有效值。
222
- */
223
- Date: string
224
- }
225
-
226
- /**
227
- * DescribeTextLib返回参数结构体
228
- */
229
- export interface DescribeTextLibResponse {
230
- /**
231
- * 文本库id和name列表
232
- */
233
- TextLib: Array<TextLib>
234
- /**
235
- * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
236
- */
237
- RequestId?: string
238
- }
239
-
240
- /**
241
- * 文本返回的详细结果
242
- */
243
- export interface DetailResults {
244
- /**
245
- * 恶意标签,Normal:正常,Porn:色情,Abuse:谩骂,Ad:广告,Custom:自定义词库。
246
- 以及令人反感、不安全或不适宜的内容类型。
247
- */
248
- Label: string
249
- /**
250
- * 建议您拿到判断结果后的执行操作。
251
- 建议值,Block:建议屏蔽,Review:建议复审,Pass:建议通过
252
- 注意:此字段可能返回 null,表示取不到有效值。
253
- */
254
- Suggestion: string
255
- /**
256
- * 该标签下命中的关键词
257
- 注意:此字段可能返回 null,表示取不到有效值。
258
- */
259
- Keywords: Array<string>
260
- /**
261
- * 该标签模型命中的分值
262
- 注意:此字段可能返回 null,表示取不到有效值。
263
- */
264
- Score: number
265
- /**
266
- * 仅当Label为Custom自定义关键词时有效,表示自定义关键词库类型,1:黑白库,2:自定义库
267
- 注意:此字段可能返回 null,表示取不到有效值。
268
- */
269
- LibType: number
270
- /**
271
- * 仅当Label为Custom自定义关键词时有效,表示自定义库id
272
- 注意:此字段可能返回 null,表示取不到有效值。
273
- */
274
- LibId: string
275
- /**
276
- * 仅当Labe为Custom自定义关键词时有效,表示自定义库名称
277
- 注意:此字段可能返回 null,表示取不到有效值。
278
- */
279
- LibName: string
280
- }
281
-
282
- /**
283
- * 违规数据分布
284
- */
285
- export interface EvilCount {
286
- /**
287
- * ----非必选,该参数功能暂未对外开放
288
- */
289
- EvilType: string
290
- /**
291
- * 分布类型总量
292
- */
293
- Count: number
294
- }
295
-
296
- /**
297
- * 设备信息
298
- */
299
- export interface Device {
300
- /**
301
- * 用户IP
302
- */
303
- IP?: string
304
- /**
305
- * Mac地址
306
- */
307
- Mac?: string
308
- /**
309
- * 设备指纹Token
310
- */
311
- TokenId?: string
312
- /**
313
- * 设备指纹ID
314
- */
315
- DeviceId?: string
316
- /**
317
- * 设备序列号
318
- */
319
- IMEI?: string
320
- /**
321
- * IOS设备,Identifier For Advertising(广告标识符)
322
- */
323
- IDFA?: string
324
- /**
325
- * IOS设备,IDFV - Identifier For Vendor(应用开发商标识符)
326
- */
327
- IDFV?: string
328
- }
329
-
330
- /**
331
- * 举报接口响应数据
332
- */
333
- export interface TipoffResponse {
334
- /**
335
- * 举报结果, "0-举报数据提交成功 99-举报数据提交失败"
336
- */
337
- ResultCode: number
338
- /**
339
- * 结果描述
340
- */
341
- ResultMsg: string
342
- }
343
-
344
- /**
345
- * AccountTipoffAccess返回参数结构体
346
- */
347
- export interface AccountTipoffAccessResponse {
348
- /**
349
- * 举报接口响应数据
350
- 注意:此字段可能返回 null,表示取不到有效值。
351
- */
352
- Data?: TipoffResponse
353
- /**
354
- * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
355
- */
356
- RequestId?: string
357
- }
358
-
359
- /**
360
- * DescribeTextLib请求参数结构体
361
- */
362
- export interface DescribeTextLibRequest {
363
- /**
364
- * 内容类型 text: 1; image: 2; audio: 3; video: 4
365
- */
366
- StrategyType: number
367
- }
368
-
369
- /**
370
- * DescribeTextStat返回参数结构体
371
- */
372
- export interface DescribeTextStatResponse {
373
- /**
374
- * 识别结果统计
375
- */
376
- Overview?: Overview
377
- /**
378
- * 识别量统计
379
- */
380
- TrendCount?: Array<TrendCount>
381
- /**
382
- * 违规数据分布
383
- 注意:此字段可能返回 null,表示取不到有效值。
384
- */
385
- EvilCount?: Array<EvilCount>
386
- /**
387
- * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
388
- */
389
- RequestId?: string
390
- }
391
-
392
- /**
393
- * TextModeration返回参数结构体
394
- */
395
- export interface TextModerationResponse {
396
- /**
397
- * 您在入参时所填入的Biztype参数
398
- */
399
- BizType: string
400
- /**
401
- * 数据是否属于恶意类型,0:正常 1:可疑
402
- */
403
- EvilFlag: number
404
- /**
405
- * 恶意标签,Normal:正常,Porn:色情,Abuse:谩骂,Ad:广告,Custom:自定义词库,以及令人反感、不安全或不适宜的内容类型
406
- */
407
- Label: string
408
- /**
409
- * 建议您拿到判断结果后的执行操作
410
- 建议值,Block:建议屏蔽,Review:建议复审,Pass:建议通过
411
- */
412
- Suggestion: string
413
- /**
414
- * 文本命中的关键词信息,用于提示您文本违规的具体原因,可能会返回多个命中的关键词。(如:加我微信)
415
- 如返回值为空,Score不为空,即识别结果(Label)是来自于语义模型判断的返回值
416
- 注意:此字段可能返回 null,表示取不到有效值。
417
- */
418
- Keywords: Array<string>
419
- /**
420
- * 机器判断当前分类的置信度,取值范围:0.00~100.00。分数越高,表示越有可能属于当前分类。
421
- (如:色情 99.99,则该样本属于色情的置信度非常高。)
422
- */
423
- Score: number
424
- /**
425
- * 接口识别样本后返回的详细结果
426
- 注意:此字段可能返回 null,表示取不到有效值。
427
- */
428
- DetailResults: Array<DetailResults>
429
- /**
430
- * 接口识别样本中存在违规账号风险的检测结果
431
- 注意:此字段可能返回 null,表示取不到有效值。
432
- */
433
- RiskDetails: Array<RiskDetails>
434
- /**
435
- * 扩展字段,用于特定信息返回,不同客户/Biztype下返回信息不同
436
- 注意:此字段可能返回 null,表示取不到有效值。
437
- */
438
- Extra: string
439
- /**
440
- * 请求参数中的DataId
441
- 注意:此字段可能返回 null,表示取不到有效值。
442
- */
443
- DataId: string
444
- /**
445
- * 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
446
- */
447
- RequestId?: string
448
- }
449
-
450
- /**
451
- * 用户相关信息
452
- */
453
- export interface User {
454
- /**
455
- * 用户账号ID,如填写,会根据账号历史恶意情况,判定消息有害结果,特别是有利于可疑恶意情况下的辅助判断。账号可以填写微信uin、QQ号、微信openid、QQopenid、字符串等。该字段和账号类别确定唯一账号。
456
- */
457
- UserId?: string
458
- /**
459
- * 用户昵称
460
- */
461
- Nickname?: string
462
- /**
463
- * 账号类别,"1-微信uin 2-QQ号 3-微信群uin 4-qq群号 5-微信openid 6-QQopenid 7-其它string"
464
- */
465
- AccountType?: number
466
- /**
467
- * 性别 默认0 未知 1 男性 2 女性
468
- */
469
- Gender?: number
470
- /**
471
- * 年龄 默认0 未知
472
- */
473
- Age?: number
474
- /**
475
- * 用户等级,默认0 未知 1 低 2 中 3 高
476
- */
477
- Level?: number
478
- /**
479
- * 手机号
480
- */
481
- Phone?: string
482
- }
@@ -1,6 +0,0 @@
1
- import * as Models from "./tms_models"
2
- import { Client } from "./tms_client"
3
- export const v20201229 = {
4
- Client: Client,
5
- Models: Models,
6
- }
@@ -1,67 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-unused-vars */
2
- /*
3
- * Copyright (c) 2018 THL A29 Limited, a Tencent company. All Rights Reserved.
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing,
12
- * software distributed under the License is distributed on an
13
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- * KIND, either express or implied. See the License for the
15
- * specific language governing permissions and limitations
16
- * under the License.
17
- */
18
- import * as TencentCloudCommon from "tencentcloud-sdk-nodejs-common"
19
- import {
20
- SentimentAnalysis,
21
- Positions,
22
- RiskDetails,
23
- TextModerationRequest,
24
- DetailResults,
25
- HitInfo,
26
- Tag,
27
- User,
28
- Device,
29
- SentimentDetail,
30
- TextModerationResponse,
31
- } from "./tms_models"
32
-
33
- /**
34
- * tms client
35
- * @class
36
- */
37
- export class Client extends TencentCloudCommon.AbstractClient {
38
- constructor(clientConfig: TencentCloudCommon.ClientConfig) {
39
- super("tms.tencentcloudapi.com", "2020-12-29", clientConfig)
40
- }
41
-
42
- /**
43
- * 本接口(Text Moderation)用于提交文本内容进行智能审核任务。使用前请您使用腾讯云主账号登录控制台 [开通文本内容安全服务](https://console.cloud.tencent.com/cms) 并调整好对应的业务配置。
44
-
45
- ### 接口使用说明
46
- - 前往“[内容安全控制台-文本内容安全](https://console.cloud.tencent.com/cms)”开启使用文本内容安全服务,首次开通服务的用户可免费领用试用套餐包,包含**3000条**文本识别额度,有效期为15天。
47
- - 该接口为收费接口,计费方式敬请参见 [腾讯云文本内容安全定价](https://cloud.tencent.com/product/tms/pricing)。
48
-
49
- ### 接口功能说明:
50
- - 支持对文本文件进行检测,通过深度学习技术,识别可能令人反感、不安全或不适宜的违规文本内容;
51
- - 支持识别多种违规场景,包括:低俗、谩骂、色情、广告等场景;
52
- - 支持根据不同的业务场景配置自定义的审核策略,可在控制台文本内容安全-策略管理中配置;
53
- - 支持用户自定义配置词库黑白名单,打击自定义识别类型的违规文本(目前仅支持黑名单配置);
54
- - 支持在审核文本内容时同时关联账号或设备信息,可识别违规风险账号或设备。
55
-
56
- ### 接口调用说明:
57
- - 文本内容大小支持:文本原文长度不能超过unicode编码长度10000个字符;
58
- - 文本审核语言支持:目前支持中文、英文、阿拉伯数字的检测;
59
- - 默认接口请求频率限制:**1000次/秒**,超过该频率限制则接口会报错。
60
- */
61
- async TextModeration(
62
- req: TextModerationRequest,
63
- cb?: (error: string, rep: TextModerationResponse) => void
64
- ): Promise<TextModerationResponse> {
65
- return this.request("TextModeration", req, cb)
66
- }
67
- }