@open-dy/ai_coding_sdk 1.0.19 → 1.0.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/dist/ai_platform_llm/client.js +1 -1
- package/dist/ai_platform_llm/core.d.ts +2 -0
- package/dist/ai_platform_llm/core.js +19 -4
- package/dist/ai_platform_llm/index.d.ts +2 -1
- package/dist/ai_platform_llm/index.js +2 -1
- package/dist/ai_platform_llm/permission.d.ts +15 -0
- package/dist/ai_platform_llm/permission.js +44 -0
- package/dist/ai_platform_llm/types.d.ts +12 -0
- package/dist/openapi/comment/comment.d.ts +67 -0
- package/dist/openapi/comment/comment.js +13 -0
- package/dist/openapi/comment/index.d.ts +2 -2
- package/dist/openapi/comment/index.js +2 -1
- package/dist/openapi/index.d.ts +2 -2
- package/dist/openapi/index.js +2 -1
- package/package.json +1 -1
- package/dist/openapi/traffic/web-search.d.ts +0 -36
- package/dist/openapi/traffic/web-search.js +0 -35
|
@@ -14,7 +14,7 @@ function sleep(ms) {
|
|
|
14
14
|
class AIPlatformLLMClient {
|
|
15
15
|
constructor(options = {}) {
|
|
16
16
|
this.appEnv = (0, core_1.getAIPlatformAppEnv)();
|
|
17
|
-
this.accessToken = options.accessToken;
|
|
17
|
+
this.accessToken = options.accessToken ?? options.delegateToken;
|
|
18
18
|
this.timeoutMs = options.timeoutMs ?? core_1.AI_PLATFORM_DEFAULT_REQUEST_TIMEOUT_MS;
|
|
19
19
|
this.imageTimeoutMs = options.imageTimeoutMs ?? core_1.AI_PLATFORM_DEFAULT_IMAGE_TIMEOUT_MS;
|
|
20
20
|
this.streamTimeoutMs = options.streamTimeoutMs ?? core_1.AI_PLATFORM_DEFAULT_STREAM_TIMEOUT_MS;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { AIPlatformCallOptions, AIPlatformEvent, AIPlatformLLMClientOptions, AIPlatformOpenAPIResponse } from './types';
|
|
2
2
|
export type AIPlatformAppEnv = 'DEV' | 'PROD';
|
|
3
|
+
export type AIPlatformRuntimeEnv = 'INNER_SANDBOX' | 'CLOUD_DEV' | 'CLOUD_PROD';
|
|
4
|
+
export declare function getAIPlatformRuntimeEnv(): AIPlatformRuntimeEnv;
|
|
3
5
|
export declare function getAIPlatformAppEnv(): AIPlatformAppEnv;
|
|
4
6
|
export declare function getAIPlatformGatewayOrigin(appEnv?: AIPlatformAppEnv): string;
|
|
5
7
|
export declare function createAIPlatformClientOptions(options?: AIPlatformCallOptions): AIPlatformLLMClientOptions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AI_PLATFORM_DEFAULT_STREAM_TIMEOUT_MS = exports.AI_PLATFORM_DEFAULT_IMAGE_TIMEOUT_MS = exports.AI_PLATFORM_DEFAULT_REQUEST_TIMEOUT_MS = void 0;
|
|
4
|
+
exports.getAIPlatformRuntimeEnv = getAIPlatformRuntimeEnv;
|
|
4
5
|
exports.getAIPlatformAppEnv = getAIPlatformAppEnv;
|
|
5
6
|
exports.getAIPlatformGatewayOrigin = getAIPlatformGatewayOrigin;
|
|
6
7
|
exports.createAIPlatformClientOptions = createAIPlatformClientOptions;
|
|
@@ -14,11 +15,25 @@ const CLOUD_CALL_DOMAIN_MAP = {
|
|
|
14
15
|
const DEFAULT_REQUEST_TIMEOUT_MS = 60000;
|
|
15
16
|
const DEFAULT_IMAGE_TIMEOUT_MS = 120000;
|
|
16
17
|
const DEFAULT_STREAM_TIMEOUT_MS = 120000;
|
|
17
|
-
function
|
|
18
|
-
|
|
18
|
+
function getCloudEnv() {
|
|
19
|
+
const cloudEnv = process.env.CLOUD_ENV?.trim();
|
|
20
|
+
return cloudEnv ? cloudEnv : undefined;
|
|
21
|
+
}
|
|
22
|
+
function isInnerSandboxEnvironment() {
|
|
23
|
+
return process.env.APP_ENV === 'DEV' && !getCloudEnv();
|
|
24
|
+
}
|
|
25
|
+
function getAIPlatformRuntimeEnv() {
|
|
26
|
+
const cloudEnv = getCloudEnv();
|
|
27
|
+
if (isInnerSandboxEnvironment()) {
|
|
28
|
+
return 'INNER_SANDBOX';
|
|
29
|
+
}
|
|
30
|
+
if (cloudEnv === 'DEV') {
|
|
31
|
+
return 'CLOUD_DEV';
|
|
32
|
+
}
|
|
33
|
+
return 'CLOUD_PROD';
|
|
19
34
|
}
|
|
20
35
|
function getAIPlatformAppEnv() {
|
|
21
|
-
return
|
|
36
|
+
return isInnerSandboxEnvironment() ? 'DEV' : 'PROD';
|
|
22
37
|
}
|
|
23
38
|
function getAIPlatformGatewayOrigin(appEnv = getAIPlatformAppEnv()) {
|
|
24
39
|
if (appEnv === 'DEV') {
|
|
@@ -33,7 +48,7 @@ function createAIPlatformClientOptions(options) {
|
|
|
33
48
|
...(options?.logid ? { 'x-tt-logid': options.logid } : {}),
|
|
34
49
|
};
|
|
35
50
|
return {
|
|
36
|
-
accessToken: options?.accessToken,
|
|
51
|
+
accessToken: options?.accessToken ?? options?.delegateToken,
|
|
37
52
|
timeoutMs: options?.timeoutMs,
|
|
38
53
|
defaultHeaders,
|
|
39
54
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { AIPlatformLLMClient, generate, generateImage, generateVideo, queryVideoTask, streamGenerate, waitVideoTask } from './client';
|
|
2
|
-
export { AI_PLATFORM_DEFAULT_IMAGE_TIMEOUT_MS, AI_PLATFORM_DEFAULT_REQUEST_TIMEOUT_MS, AI_PLATFORM_DEFAULT_STREAM_TIMEOUT_MS, createAIPlatformClientOptions, getAIPlatformAppEnv, getAIPlatformGatewayOrigin, parseSSEStream, postAIPlatformJSON, streamAIPlatform } from './core';
|
|
2
|
+
export { AI_PLATFORM_DEFAULT_IMAGE_TIMEOUT_MS, AI_PLATFORM_DEFAULT_REQUEST_TIMEOUT_MS, AI_PLATFORM_DEFAULT_STREAM_TIMEOUT_MS, createAIPlatformClientOptions, getAIPlatformAppEnv, getAIPlatformGatewayOrigin, getAIPlatformRuntimeEnv, parseSSEStream, postAIPlatformJSON, streamAIPlatform } from './core';
|
|
3
|
+
export type { AIPlatformRuntimeEnv } from './core';
|
|
3
4
|
export type { AIPlatformCallOptions, AIPlatformEvent, AIPlatformLLMClientOptions, AIPlatformMessageEventPayload, AIPlatformOpenAPIResponse, AIPlatformUsage, ContentPart, GenerateImageRequest, GenerateImageResponseData, GenerateMessage, GenerateModelParams, GenerateRequest, GenerateResponseData, GenerateVideoRequest, GenerateVideoResponseData, Message, ModelParams, QueryVideoTaskRequest, QueryVideoTaskResponseData, Role, StreamGenerateRequest, ToolCall } from './types';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.streamAIPlatform = exports.postAIPlatformJSON = exports.parseSSEStream = exports.getAIPlatformGatewayOrigin = exports.getAIPlatformAppEnv = exports.createAIPlatformClientOptions = exports.AI_PLATFORM_DEFAULT_STREAM_TIMEOUT_MS = exports.AI_PLATFORM_DEFAULT_REQUEST_TIMEOUT_MS = exports.AI_PLATFORM_DEFAULT_IMAGE_TIMEOUT_MS = exports.waitVideoTask = exports.streamGenerate = exports.queryVideoTask = exports.generateVideo = exports.generateImage = exports.generate = exports.AIPlatformLLMClient = void 0;
|
|
3
|
+
exports.streamAIPlatform = exports.postAIPlatformJSON = exports.parseSSEStream = exports.getAIPlatformRuntimeEnv = exports.getAIPlatformGatewayOrigin = exports.getAIPlatformAppEnv = exports.createAIPlatformClientOptions = exports.AI_PLATFORM_DEFAULT_STREAM_TIMEOUT_MS = exports.AI_PLATFORM_DEFAULT_REQUEST_TIMEOUT_MS = exports.AI_PLATFORM_DEFAULT_IMAGE_TIMEOUT_MS = exports.waitVideoTask = exports.streamGenerate = exports.queryVideoTask = exports.generateVideo = exports.generateImage = exports.generate = exports.AIPlatformLLMClient = void 0;
|
|
4
4
|
var client_1 = require("./client");
|
|
5
5
|
Object.defineProperty(exports, "AIPlatformLLMClient", { enumerable: true, get: function () { return client_1.AIPlatformLLMClient; } });
|
|
6
6
|
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return client_1.generate; } });
|
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "AI_PLATFORM_DEFAULT_STREAM_TIMEOUT_MS", { enumer
|
|
|
16
16
|
Object.defineProperty(exports, "createAIPlatformClientOptions", { enumerable: true, get: function () { return core_1.createAIPlatformClientOptions; } });
|
|
17
17
|
Object.defineProperty(exports, "getAIPlatformAppEnv", { enumerable: true, get: function () { return core_1.getAIPlatformAppEnv; } });
|
|
18
18
|
Object.defineProperty(exports, "getAIPlatformGatewayOrigin", { enumerable: true, get: function () { return core_1.getAIPlatformGatewayOrigin; } });
|
|
19
|
+
Object.defineProperty(exports, "getAIPlatformRuntimeEnv", { enumerable: true, get: function () { return core_1.getAIPlatformRuntimeEnv; } });
|
|
19
20
|
Object.defineProperty(exports, "parseSSEStream", { enumerable: true, get: function () { return core_1.parseSSEStream; } });
|
|
20
21
|
Object.defineProperty(exports, "postAIPlatformJSON", { enumerable: true, get: function () { return core_1.postAIPlatformJSON; } });
|
|
21
22
|
Object.defineProperty(exports, "streamAIPlatform", { enumerable: true, get: function () { return core_1.streamAIPlatform; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AIPlatformCallOptions, CheckMiniProgramModelPermissionRequest, CheckMiniProgramModelPermissionResponse } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* 判断小程序是否有目标模型权限。
|
|
4
|
+
* 这里保留原始响应,避免在未知响应结构上做过度假设。
|
|
5
|
+
*/
|
|
6
|
+
export declare function checkMiniProgramModelPermission(req: CheckMiniProgramModelPermissionRequest, options?: AIPlatformCallOptions): Promise<CheckMiniProgramModelPermissionResponse>;
|
|
7
|
+
/**
|
|
8
|
+
* 基于常见布尔字段做轻量归一化。
|
|
9
|
+
* 如果接口未返回这些字段,则返回 null,让上层自行读取原始响应。
|
|
10
|
+
*/
|
|
11
|
+
export declare function getMiniProgramModelPermissionStatus(response: CheckMiniProgramModelPermissionResponse): boolean | null;
|
|
12
|
+
/**
|
|
13
|
+
* 权限明确为 false 时抛错;响应里没有标准布尔字段时,只返回原始响应。
|
|
14
|
+
*/
|
|
15
|
+
export declare function assertMiniProgramModelPermission(req: CheckMiniProgramModelPermissionRequest, options?: AIPlatformCallOptions): Promise<CheckMiniProgramModelPermissionResponse>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkMiniProgramModelPermission = checkMiniProgramModelPermission;
|
|
4
|
+
exports.getMiniProgramModelPermissionStatus = getMiniProgramModelPermissionStatus;
|
|
5
|
+
exports.assertMiniProgramModelPermission = assertMiniProgramModelPermission;
|
|
6
|
+
const core_1 = require("./core");
|
|
7
|
+
/**
|
|
8
|
+
* 判断小程序是否有目标模型权限。
|
|
9
|
+
* 这里保留原始响应,避免在未知响应结构上做过度假设。
|
|
10
|
+
*/
|
|
11
|
+
async function checkMiniProgramModelPermission(req, options) {
|
|
12
|
+
return (0, core_1.postMiniProgramModelPermission)(req, options);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 基于常见布尔字段做轻量归一化。
|
|
16
|
+
* 如果接口未返回这些字段,则返回 null,让上层自行读取原始响应。
|
|
17
|
+
*/
|
|
18
|
+
function getMiniProgramModelPermissionStatus(response) {
|
|
19
|
+
const candidates = [
|
|
20
|
+
response.data?.allowed,
|
|
21
|
+
response.data?.allow,
|
|
22
|
+
response.data?.has_permission,
|
|
23
|
+
response.data?.can_use,
|
|
24
|
+
];
|
|
25
|
+
for (const candidate of candidates) {
|
|
26
|
+
if (typeof candidate === 'boolean') {
|
|
27
|
+
return candidate;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 权限明确为 false 时抛错;响应里没有标准布尔字段时,只返回原始响应。
|
|
34
|
+
*/
|
|
35
|
+
async function assertMiniProgramModelPermission(req, options) {
|
|
36
|
+
const response = await checkMiniProgramModelPermission(req, options);
|
|
37
|
+
const granted = getMiniProgramModelPermissionStatus(response);
|
|
38
|
+
if (granted === false) {
|
|
39
|
+
throw new Error(response.message ||
|
|
40
|
+
response.err_msg ||
|
|
41
|
+
'mini_program_model_permission_denied');
|
|
42
|
+
}
|
|
43
|
+
return response;
|
|
44
|
+
}
|
|
@@ -280,6 +280,12 @@ export interface QueryVideoTaskResponseData {
|
|
|
280
280
|
}
|
|
281
281
|
export interface AIPlatformLLMClientOptions {
|
|
282
282
|
accessToken?: string;
|
|
283
|
+
/**
|
|
284
|
+
* `accessToken` 的兼容别名。
|
|
285
|
+
*
|
|
286
|
+
* @deprecated 请改用 `accessToken`。
|
|
287
|
+
*/
|
|
288
|
+
delegateToken?: string;
|
|
283
289
|
timeoutMs?: number;
|
|
284
290
|
imageTimeoutMs?: number;
|
|
285
291
|
streamTimeoutMs?: number;
|
|
@@ -288,6 +294,12 @@ export interface AIPlatformLLMClientOptions {
|
|
|
288
294
|
}
|
|
289
295
|
export interface AIPlatformCallOptions {
|
|
290
296
|
accessToken?: string;
|
|
297
|
+
/**
|
|
298
|
+
* `accessToken` 的兼容别名。
|
|
299
|
+
*
|
|
300
|
+
* @deprecated 请改用 `accessToken`。
|
|
301
|
+
*/
|
|
302
|
+
delegateToken?: string;
|
|
291
303
|
logid?: string;
|
|
292
304
|
timeoutMs?: number;
|
|
293
305
|
defaultHeaders?: Record<string, string>;
|
|
@@ -1,4 +1,71 @@
|
|
|
1
1
|
import type { CallOptions, OpenAPIResponse } from '../core';
|
|
2
|
+
/**
|
|
3
|
+
* 视频评论列表 - 请求参数
|
|
4
|
+
*/
|
|
5
|
+
export interface VideoCommentListParams {
|
|
6
|
+
/** 分页游标 */
|
|
7
|
+
cursor?: number;
|
|
8
|
+
/** 视频 ID */
|
|
9
|
+
item_id: string;
|
|
10
|
+
/** 评论 ID(用于获取指定评论的回复) */
|
|
11
|
+
comment_id?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 视频评论中的用户信息
|
|
15
|
+
*/
|
|
16
|
+
export interface VideoCommentUser {
|
|
17
|
+
/** 用户昵称 */
|
|
18
|
+
nickname: string;
|
|
19
|
+
/** 用户头像 URL */
|
|
20
|
+
avatar: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 视频评论列表中的单条评论
|
|
24
|
+
*/
|
|
25
|
+
export interface VideoCommentItem {
|
|
26
|
+
/** 评论 ID */
|
|
27
|
+
comment_id: string;
|
|
28
|
+
/** 评论内容 */
|
|
29
|
+
text: string;
|
|
30
|
+
/** 视频 ID */
|
|
31
|
+
item_id: string;
|
|
32
|
+
/** 评论用户信息 */
|
|
33
|
+
user: VideoCommentUser;
|
|
34
|
+
/** 创建时间(时间戳,秒) */
|
|
35
|
+
create_time: number;
|
|
36
|
+
/** 点赞数 */
|
|
37
|
+
digg_count: number;
|
|
38
|
+
/** 评论状态 */
|
|
39
|
+
status: number;
|
|
40
|
+
/** 是否为热门评论 */
|
|
41
|
+
is_hot: boolean;
|
|
42
|
+
/** 标签类型 */
|
|
43
|
+
label_type: number;
|
|
44
|
+
/** 作者是否已赞 */
|
|
45
|
+
is_author_digged: boolean;
|
|
46
|
+
/** 回复评论总数 */
|
|
47
|
+
reply_comment_total: number;
|
|
48
|
+
/** 回复 ID */
|
|
49
|
+
reply_id: string;
|
|
50
|
+
/** 标签文本 */
|
|
51
|
+
label_text: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 视频评论列表 - 响应
|
|
55
|
+
*/
|
|
56
|
+
export interface VideoCommentListResponse {
|
|
57
|
+
/** 评论列表 */
|
|
58
|
+
comments: VideoCommentItem[];
|
|
59
|
+
/** 分页游标 */
|
|
60
|
+
cursor: number;
|
|
61
|
+
/** 是否有更多数据 */
|
|
62
|
+
has_more: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* 获取视频评论列表(dy.open.dy.aweme.video_comment)
|
|
66
|
+
* 基于视频 ID,获取视频下的公开评论内容。
|
|
67
|
+
*/
|
|
68
|
+
export declare function getVideoCommentList(params: VideoCommentListParams, options?: CallOptions): Promise<OpenAPIResponse<VideoCommentListResponse>>;
|
|
2
69
|
export interface CommentSearchParams {
|
|
3
70
|
/** 搜索关键词 */
|
|
4
71
|
keyword: string;
|
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getVideoCommentList = getVideoCommentList;
|
|
3
4
|
exports.searchComment = searchComment;
|
|
4
5
|
const core_1 = require("../core");
|
|
6
|
+
/**
|
|
7
|
+
* 获取视频评论列表(dy.open.dy.aweme.video_comment)
|
|
8
|
+
* 基于视频 ID,获取视频下的公开评论内容。
|
|
9
|
+
*/
|
|
10
|
+
async function getVideoCommentList(params, options) {
|
|
11
|
+
return (0, core_1.callOpenAPI)({
|
|
12
|
+
path: '/dy_open_api/video/comment/',
|
|
13
|
+
method: 'POST',
|
|
14
|
+
body: params,
|
|
15
|
+
domain: 'open.douyin.com',
|
|
16
|
+
}, options);
|
|
17
|
+
}
|
|
5
18
|
/**
|
|
6
19
|
* 评论搜索
|
|
7
20
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { searchComment } from './comment';
|
|
2
|
-
export type { CommentSearchItem, CommentSearchParams, CommentSearchResponse } from './comment';
|
|
1
|
+
export { getVideoCommentList, searchComment } from './comment';
|
|
2
|
+
export type { CommentSearchItem, CommentSearchParams, CommentSearchResponse, VideoCommentItem, VideoCommentListParams, VideoCommentListResponse, VideoCommentUser } from './comment';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.searchComment = void 0;
|
|
3
|
+
exports.searchComment = exports.getVideoCommentList = void 0;
|
|
4
4
|
// 评论相关 OpenAPI
|
|
5
5
|
var comment_1 = require("./comment");
|
|
6
|
+
Object.defineProperty(exports, "getVideoCommentList", { enumerable: true, get: function () { return comment_1.getVideoCommentList; } });
|
|
6
7
|
Object.defineProperty(exports, "searchComment", { enumerable: true, get: function () { return comment_1.searchComment; } });
|
package/dist/openapi/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export { getAffiliateId, getAIUserDataInfo, getAIUserItemList, getAIUserProfile,
|
|
|
2
2
|
export type { AIUserBase, AIUserDataInfoParams, AIUserDataInfoResponse, AIUserInfo, AIUserItem, AIUserItemListParams, AIUserItemListResponse, AIUserProfileParams, AIUserProfileResponse, AgeRange, ConstellationResponse, GetRelatedIdRequest, GetRelatedIdResponse, HomepageDailyResult, HomepageDataParams, HomepageDateType, HomepageItemParams, HomepageResultResponse, RealNameInfoData, RealNameInfoParams, UserCertLabelInfo, UserCertLabelsInfoParams, UserCertLabelsInfoResponse, UserCertLabelStyle, UserHashMobileParams, UserHashMobileResponse, UserPublicInfo, UserPublicInfoParams, UserPublicInfoResponse } from './account';
|
|
3
3
|
export { createActivity, modifyActivity, queryActivityInfo, queryActivityUserCompletionStatus } from './business';
|
|
4
4
|
export type { ActivityTaskInfo, ActivityUserTaskStatus, CreateActivityRequest, CreateActivityResponse, ModifyActivityRequest, ModifyActivityResponse, QueryActivityInfoRequest, QueryActivityInfoResponse, QueryActivityUserCompletionStatusRequest, QueryActivityUserCompletionStatusResponse } from './business';
|
|
5
|
-
export { searchComment } from './comment';
|
|
6
|
-
export type { CommentSearchItem, CommentSearchParams, CommentSearchResponse } from './comment';
|
|
5
|
+
export { getVideoCommentList, searchComment } from './comment';
|
|
6
|
+
export type { CommentSearchItem, CommentSearchParams, CommentSearchResponse, VideoCommentItem, VideoCommentListParams, VideoCommentListResponse, VideoCommentUser } from './comment';
|
|
7
7
|
export { getFeed, getFollowFeed, getFollowHotWord, getHighQualityText, getRecommend, getVideoPack } from './content';
|
|
8
8
|
export type { FeedItem, FeedResponse, FollowFeedItem, FollowFeedResponse, HighQualityTextParams, HighQualityTextResponse, HotWordItem, HotWordResponse, HotWordUrl, RecommendItem, RecommendRequest, RecommendResponse, VideoPackItem, VideoPackParams, VideoPackResponse } from './content';
|
|
9
9
|
export { callOpenAPI } from './core';
|
package/dist/openapi/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.searchVision = exports.searchVideo = exports.searchUser = exports.searchPoi = exports.searchMusic = exports.searchLive = exports.searchGeneral = exports.searchExperience = exports.getUserFansProfile = exports.getFriendList = exports.getFansSource = exports.getFansProfile = exports.getFansFavourite = exports.checkFans = exports.topicSearch = exports.getUserFollowing = exports.getUserBasicData = exports.getMusicCollectionList = exports.queryRoomData = exports.getRoomRealTimeData = exports.getHotList = exports.callOpenAPI = exports.getVideoPack = exports.getRecommend = exports.getHighQualityText = exports.getFollowHotWord = exports.getFollowFeed = exports.getFeed = exports.searchComment = exports.queryActivityUserCompletionStatus = exports.queryActivityInfo = exports.modifyActivity = exports.createActivity = exports.getUserShareData = exports.getUserPublicInfo = exports.getUserProfileData = exports.getUserLikeData = exports.getUserItemData = exports.getUserHashMobile = exports.getUserFansData = exports.getUserConstellation = exports.getUserCommentData = exports.getUserCertLabelsInfo = exports.getRelatedId = exports.getRealNameInfo = exports.getAIUserProfile = exports.getAIUserItemList = exports.getAIUserDataInfo = exports.getAffiliateId = void 0;
|
|
3
|
+
exports.searchVision = exports.searchVideo = exports.searchUser = exports.searchPoi = exports.searchMusic = exports.searchLive = exports.searchGeneral = exports.searchExperience = exports.getUserFansProfile = exports.getFriendList = exports.getFansSource = exports.getFansProfile = exports.getFansFavourite = exports.checkFans = exports.topicSearch = exports.getUserFollowing = exports.getUserBasicData = exports.getMusicCollectionList = exports.queryRoomData = exports.getRoomRealTimeData = exports.getHotList = exports.callOpenAPI = exports.getVideoPack = exports.getRecommend = exports.getHighQualityText = exports.getFollowHotWord = exports.getFollowFeed = exports.getFeed = exports.searchComment = exports.getVideoCommentList = exports.queryActivityUserCompletionStatus = exports.queryActivityInfo = exports.modifyActivity = exports.createActivity = exports.getUserShareData = exports.getUserPublicInfo = exports.getUserProfileData = exports.getUserLikeData = exports.getUserItemData = exports.getUserHashMobile = exports.getUserFansData = exports.getUserConstellation = exports.getUserCommentData = exports.getUserCertLabelsInfo = exports.getRelatedId = exports.getRealNameInfo = exports.getAIUserProfile = exports.getAIUserItemList = exports.getAIUserDataInfo = exports.getAffiliateId = void 0;
|
|
4
4
|
var account_1 = require("./account");
|
|
5
5
|
Object.defineProperty(exports, "getAffiliateId", { enumerable: true, get: function () { return account_1.getAffiliateId; } });
|
|
6
6
|
Object.defineProperty(exports, "getAIUserDataInfo", { enumerable: true, get: function () { return account_1.getAIUserDataInfo; } });
|
|
@@ -24,6 +24,7 @@ Object.defineProperty(exports, "modifyActivity", { enumerable: true, get: functi
|
|
|
24
24
|
Object.defineProperty(exports, "queryActivityInfo", { enumerable: true, get: function () { return business_1.queryActivityInfo; } });
|
|
25
25
|
Object.defineProperty(exports, "queryActivityUserCompletionStatus", { enumerable: true, get: function () { return business_1.queryActivityUserCompletionStatus; } });
|
|
26
26
|
var comment_1 = require("./comment");
|
|
27
|
+
Object.defineProperty(exports, "getVideoCommentList", { enumerable: true, get: function () { return comment_1.getVideoCommentList; } });
|
|
27
28
|
Object.defineProperty(exports, "searchComment", { enumerable: true, get: function () { return comment_1.searchComment; } });
|
|
28
29
|
var content_1 = require("./content");
|
|
29
30
|
Object.defineProperty(exports, "getFeed", { enumerable: true, get: function () { return content_1.getFeed; } });
|
package/package.json
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { CallOptions, OpenAPIResponse } from '../core';
|
|
2
|
-
export interface UploadSitemapRequest {
|
|
3
|
-
/** 小程序 app_id */
|
|
4
|
-
app_id: string;
|
|
5
|
-
/** 页面路径列表 */
|
|
6
|
-
page_paths: string[];
|
|
7
|
-
}
|
|
8
|
-
export interface DeleteIndexRequest {
|
|
9
|
-
/** 小程序 app_id */
|
|
10
|
-
app_id: string;
|
|
11
|
-
/** 在控制台显示的文件名称 */
|
|
12
|
-
name: string;
|
|
13
|
-
/** 待删除路径集合 */
|
|
14
|
-
path_list: string[];
|
|
15
|
-
}
|
|
16
|
-
export interface WebSearchOperationResponse {
|
|
17
|
-
err_no: number;
|
|
18
|
-
err_msg: string;
|
|
19
|
-
log_id: string;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* 提交小程序页面路径
|
|
23
|
-
* - Path: `/api/apps/v1/search/upload_sitemap/`
|
|
24
|
-
* - Capability: `ma.web.search`
|
|
25
|
-
* - Scope: `ma.search`
|
|
26
|
-
* - 需要用户授权: `否`
|
|
27
|
-
*/
|
|
28
|
-
export declare function uploadSitemap(params: UploadSitemapRequest, options?: CallOptions): Promise<OpenAPIResponse<WebSearchOperationResponse>>;
|
|
29
|
-
/**
|
|
30
|
-
* 删除索引
|
|
31
|
-
* - Path: `/api/apps/v1/search/delete_index/`
|
|
32
|
-
* - Capability: `ma.web.search`
|
|
33
|
-
* - Scope: `ma.search`
|
|
34
|
-
* - 需要用户授权: `否`
|
|
35
|
-
*/
|
|
36
|
-
export declare function deleteIndex(params: DeleteIndexRequest, options?: CallOptions): Promise<OpenAPIResponse<WebSearchOperationResponse>>;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadSitemap = uploadSitemap;
|
|
4
|
-
exports.deleteIndex = deleteIndex;
|
|
5
|
-
const core_1 = require("../core");
|
|
6
|
-
/**
|
|
7
|
-
* 提交小程序页面路径
|
|
8
|
-
* - Path: `/api/apps/v1/search/upload_sitemap/`
|
|
9
|
-
* - Capability: `ma.web.search`
|
|
10
|
-
* - Scope: `ma.search`
|
|
11
|
-
* - 需要用户授权: `否`
|
|
12
|
-
*/
|
|
13
|
-
async function uploadSitemap(params, options) {
|
|
14
|
-
return (0, core_1.callOpenAPI)({
|
|
15
|
-
path: '/api/apps/v1/search/upload_sitemap/',
|
|
16
|
-
method: 'POST',
|
|
17
|
-
body: params,
|
|
18
|
-
domain: 'open.douyin.com',
|
|
19
|
-
}, options);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* 删除索引
|
|
23
|
-
* - Path: `/api/apps/v1/search/delete_index/`
|
|
24
|
-
* - Capability: `ma.web.search`
|
|
25
|
-
* - Scope: `ma.search`
|
|
26
|
-
* - 需要用户授权: `否`
|
|
27
|
-
*/
|
|
28
|
-
async function deleteIndex(params, options) {
|
|
29
|
-
return (0, core_1.callOpenAPI)({
|
|
30
|
-
path: '/api/apps/v1/search/delete_index/',
|
|
31
|
-
method: 'POST',
|
|
32
|
-
body: params,
|
|
33
|
-
domain: 'open.douyin.com',
|
|
34
|
-
}, options);
|
|
35
|
-
}
|