@open-dy/ai_coding_sdk 1.0.12 → 1.0.13
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/README.md +3 -9
- package/dist/ai_platform_llm/core.d.ts +1 -2
- package/dist/ai_platform_llm/core.js +0 -36
- package/dist/ai_platform_llm/index.d.ts +3 -4
- package/dist/ai_platform_llm/index.js +3 -7
- package/dist/ai_platform_llm/types.d.ts +0 -20
- package/dist/openapi/account/firm.d.ts +31 -0
- package/dist/openapi/account/firm.js +23 -0
- package/dist/openapi/account/homepage-data.d.ts +85 -0
- package/dist/openapi/account/homepage-data.js +109 -0
- package/dist/openapi/account/index.d.ts +16 -8
- package/dist/openapi/account/index.js +21 -8
- package/dist/openapi/account/mobile-hash.d.ts +20 -0
- package/dist/openapi/account/mobile-hash.js +22 -0
- package/dist/openapi/account/public-info.d.ts +32 -0
- package/dist/openapi/account/public-info.js +22 -0
- package/dist/openapi/business/index.d.ts +2 -1
- package/dist/openapi/business/index.js +7 -0
- package/dist/openapi/business/task.d.ts +116 -0
- package/dist/openapi/business/task.js +71 -0
- package/dist/openapi/comment/index.d.ts +2 -0
- package/dist/openapi/comment/index.js +7 -1
- package/dist/openapi/comment/manage.d.ts +118 -0
- package/dist/openapi/comment/manage.js +88 -0
- package/dist/openapi/content/index.d.ts +2 -0
- package/dist/openapi/content/index.js +5 -1
- package/dist/openapi/content/video-data.d.ts +94 -0
- package/dist/openapi/content/video-data.js +56 -0
- package/dist/openapi/im/group.d.ts +119 -0
- package/dist/openapi/im/group.js +91 -0
- package/dist/openapi/im/index.d.ts +2 -1
- package/dist/openapi/im/index.js +8 -0
- package/dist/openapi/index.d.ts +21 -11
- package/dist/openapi/index.js +64 -23
- package/dist/openapi/live/index.d.ts +2 -1
- package/dist/openapi/live/index.js +5 -0
- package/dist/openapi/live/room.d.ts +60 -0
- package/dist/openapi/live/room.js +42 -0
- package/dist/openapi/music/collection.d.ts +42 -0
- package/dist/openapi/music/collection.js +20 -0
- package/dist/openapi/music/index.d.ts +2 -0
- package/dist/openapi/music/index.js +6 -0
- package/dist/openapi/relation/fans.d.ts +72 -0
- package/dist/openapi/relation/fans.js +71 -0
- package/dist/openapi/relation/index.d.ts +4 -1
- package/dist/openapi/relation/index.js +10 -0
- package/dist/openapi/relation/social.d.ts +56 -0
- package/dist/openapi/relation/social.js +40 -0
- package/package.json +42 -2
- package/dist/ai_platform_llm/permission.d.ts +0 -15
- package/dist/ai_platform_llm/permission.js +0 -44
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFansSource = getFansSource;
|
|
4
|
+
exports.getFansProfile = getFansProfile;
|
|
5
|
+
exports.getUserFansProfile = getUserFansProfile;
|
|
6
|
+
exports.getFansFavourite = getFansFavourite;
|
|
7
|
+
const core_1 = require("../core");
|
|
8
|
+
/**
|
|
9
|
+
* 获取粉丝来源数据
|
|
10
|
+
*
|
|
11
|
+
* - Path: `/data/extern/fans/source/`
|
|
12
|
+
* - Capability: `dy.open.fans_statistics`
|
|
13
|
+
* - Scope: `data.external.fans_source`
|
|
14
|
+
* - 需要用户授权: 是
|
|
15
|
+
*/
|
|
16
|
+
async function getFansSource(params, options) {
|
|
17
|
+
return (0, core_1.callOpenAPI)({
|
|
18
|
+
path: '/data/extern/fans/source/',
|
|
19
|
+
method: 'GET',
|
|
20
|
+
queryParams: params,
|
|
21
|
+
domain: 'open.douyin.com',
|
|
22
|
+
}, options);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 获取粉丝画像数据
|
|
26
|
+
*
|
|
27
|
+
* - Path: `/fans/data/`
|
|
28
|
+
* - Capability: `dy.open.fans_statistics`
|
|
29
|
+
* - Scope: `fans.data`
|
|
30
|
+
* - 需要用户授权: 是
|
|
31
|
+
*/
|
|
32
|
+
async function getFansProfile(params, options) {
|
|
33
|
+
return (0, core_1.callOpenAPI)({
|
|
34
|
+
path: '/fans/data/',
|
|
35
|
+
method: 'GET',
|
|
36
|
+
queryParams: params,
|
|
37
|
+
domain: 'open.douyin.com',
|
|
38
|
+
}, options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 查询用户的粉丝数据(性别 / 年龄 / 地域分布)
|
|
42
|
+
*
|
|
43
|
+
* - Path: `/api/douyin/v1/user/fans_data/`
|
|
44
|
+
* - Capability: `dy.open.fans_statistics`
|
|
45
|
+
* - Scope: `fans.data.bind`
|
|
46
|
+
* - 需要用户授权: 是
|
|
47
|
+
*/
|
|
48
|
+
async function getUserFansProfile(params, options) {
|
|
49
|
+
return (0, core_1.callOpenAPI)({
|
|
50
|
+
path: '/api/douyin/v1/user/fans_data/',
|
|
51
|
+
method: 'GET',
|
|
52
|
+
queryParams: params,
|
|
53
|
+
domain: 'open.douyin.com',
|
|
54
|
+
}, options);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* 获取用户粉丝热评
|
|
58
|
+
*
|
|
59
|
+
* - Path: `/data/extern/fans/comment/`
|
|
60
|
+
* - Capability: `dy.open.fans_statistics`
|
|
61
|
+
* - Scope: `data.external.fans_favourite`
|
|
62
|
+
* - 需要用户授权: 是
|
|
63
|
+
*/
|
|
64
|
+
async function getFansFavourite(params, options) {
|
|
65
|
+
return (0, core_1.callOpenAPI)({
|
|
66
|
+
path: '/data/extern/fans/comment/',
|
|
67
|
+
method: 'GET',
|
|
68
|
+
queryParams: params,
|
|
69
|
+
domain: 'open.douyin.com',
|
|
70
|
+
}, options);
|
|
71
|
+
}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { checkFans, getFriendList } from './social';
|
|
2
|
+
export type { FansCheckParams, FansCheckResponse, FriendListParams, FriendUser, FriendListResponse, } from './social';
|
|
3
|
+
export { getFansSource, getFansProfile, getUserFansProfile, getFansFavourite, } from './fans';
|
|
4
|
+
export type { FansDataParams, DistributionItem, FansSourceResponse, FansProfileResponse, FansFavouriteItem, FansFavouriteResponse, } from './fans';
|
|
@@ -1,2 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFansFavourite = exports.getUserFansProfile = exports.getFansProfile = exports.getFansSource = exports.getFriendList = exports.checkFans = void 0;
|
|
4
|
+
// urelation相关 OpenAPI
|
|
5
|
+
var social_1 = require("./social");
|
|
6
|
+
Object.defineProperty(exports, "checkFans", { enumerable: true, get: function () { return social_1.checkFans; } });
|
|
7
|
+
Object.defineProperty(exports, "getFriendList", { enumerable: true, get: function () { return social_1.getFriendList; } });
|
|
8
|
+
var fans_1 = require("./fans");
|
|
9
|
+
Object.defineProperty(exports, "getFansSource", { enumerable: true, get: function () { return fans_1.getFansSource; } });
|
|
10
|
+
Object.defineProperty(exports, "getFansProfile", { enumerable: true, get: function () { return fans_1.getFansProfile; } });
|
|
11
|
+
Object.defineProperty(exports, "getUserFansProfile", { enumerable: true, get: function () { return fans_1.getUserFansProfile; } });
|
|
12
|
+
Object.defineProperty(exports, "getFansFavourite", { enumerable: true, get: function () { return fans_1.getFansFavourite; } });
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { CallOptions, OpenAPIResponse } from '../core';
|
|
2
|
+
export interface FansCheckParams {
|
|
3
|
+
/** 被关注用户 A 的 open_id */
|
|
4
|
+
open_id: string;
|
|
5
|
+
/** 关注者用户 B 的 open_id */
|
|
6
|
+
follower_open_id: string;
|
|
7
|
+
}
|
|
8
|
+
export interface FansCheckResponse {
|
|
9
|
+
/** 用户 B 是否关注了用户 A */
|
|
10
|
+
is_follow?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 判断用户是否关注了某用户
|
|
14
|
+
*
|
|
15
|
+
* - Path: `/fans/check/`
|
|
16
|
+
* - Capability: `dy.open.fans_statistics`
|
|
17
|
+
* - Scope: `fans.check`
|
|
18
|
+
* - 需要用户授权: 是
|
|
19
|
+
*
|
|
20
|
+
* @remarks 通过用户 B 的 open_id(follower_open_id)与用户 A 的 open_id 的关系,
|
|
21
|
+
* 判断用户 B 是否关注了用户 A。
|
|
22
|
+
*/
|
|
23
|
+
export declare function checkFans(params: FansCheckParams, options?: CallOptions): Promise<OpenAPIResponse<FansCheckResponse>>;
|
|
24
|
+
export interface FriendListParams {
|
|
25
|
+
/** 用户 open_id,通过 /oauth/access_token/ 获取 */
|
|
26
|
+
open_id: string;
|
|
27
|
+
/** 分页偏移量 */
|
|
28
|
+
offset?: number;
|
|
29
|
+
/** 每页数量 */
|
|
30
|
+
count?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface FriendUser {
|
|
33
|
+
/** 好友 open_id */
|
|
34
|
+
open_id?: string;
|
|
35
|
+
/** 好友昵称 */
|
|
36
|
+
nickname?: string;
|
|
37
|
+
/** 好友头像 */
|
|
38
|
+
avatar?: string;
|
|
39
|
+
}
|
|
40
|
+
export interface FriendListResponse {
|
|
41
|
+
/** 互关好友列表 */
|
|
42
|
+
list?: FriendUser[];
|
|
43
|
+
/** 下一页偏移量 */
|
|
44
|
+
offset?: number;
|
|
45
|
+
/** 是否还有更多 */
|
|
46
|
+
has_more?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* 获取用户互相关注(互关)列表
|
|
50
|
+
*
|
|
51
|
+
* - Path: `/friend/list/`
|
|
52
|
+
* - Capability: `dy.open.friend.list`
|
|
53
|
+
* - Scope: `friend.list`
|
|
54
|
+
* - 需要用户授权: 是
|
|
55
|
+
*/
|
|
56
|
+
export declare function getFriendList(params: FriendListParams, options?: CallOptions): Promise<OpenAPIResponse<FriendListResponse>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkFans = checkFans;
|
|
4
|
+
exports.getFriendList = getFriendList;
|
|
5
|
+
const core_1 = require("../core");
|
|
6
|
+
/**
|
|
7
|
+
* 判断用户是否关注了某用户
|
|
8
|
+
*
|
|
9
|
+
* - Path: `/fans/check/`
|
|
10
|
+
* - Capability: `dy.open.fans_statistics`
|
|
11
|
+
* - Scope: `fans.check`
|
|
12
|
+
* - 需要用户授权: 是
|
|
13
|
+
*
|
|
14
|
+
* @remarks 通过用户 B 的 open_id(follower_open_id)与用户 A 的 open_id 的关系,
|
|
15
|
+
* 判断用户 B 是否关注了用户 A。
|
|
16
|
+
*/
|
|
17
|
+
async function checkFans(params, options) {
|
|
18
|
+
return (0, core_1.callOpenAPI)({
|
|
19
|
+
path: '/fans/check/',
|
|
20
|
+
method: 'GET',
|
|
21
|
+
queryParams: params,
|
|
22
|
+
domain: 'open.douyin.com',
|
|
23
|
+
}, options);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 获取用户互相关注(互关)列表
|
|
27
|
+
*
|
|
28
|
+
* - Path: `/friend/list/`
|
|
29
|
+
* - Capability: `dy.open.friend.list`
|
|
30
|
+
* - Scope: `friend.list`
|
|
31
|
+
* - 需要用户授权: 是
|
|
32
|
+
*/
|
|
33
|
+
async function getFriendList(params, options) {
|
|
34
|
+
return (0, core_1.callOpenAPI)({
|
|
35
|
+
path: '/friend/list/',
|
|
36
|
+
method: 'GET',
|
|
37
|
+
queryParams: params,
|
|
38
|
+
domain: 'open.douyin.com',
|
|
39
|
+
}, options);
|
|
40
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-dy/ai_coding_sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "AI Coding SDK — 抖音开放平台 OpenAPI 客户端与工具集",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -86,6 +86,46 @@
|
|
|
86
86
|
"types": "./dist/openapi/platform/*.d.ts",
|
|
87
87
|
"default": "./dist/openapi/platform/*.js"
|
|
88
88
|
},
|
|
89
|
+
"./openapi/live": {
|
|
90
|
+
"types": "./dist/openapi/live/index.d.ts",
|
|
91
|
+
"default": "./dist/openapi/live/index.js"
|
|
92
|
+
},
|
|
93
|
+
"./openapi/live/*": {
|
|
94
|
+
"types": "./dist/openapi/live/*.d.ts",
|
|
95
|
+
"default": "./dist/openapi/live/*.js"
|
|
96
|
+
},
|
|
97
|
+
"./openapi/relation": {
|
|
98
|
+
"types": "./dist/openapi/relation/index.d.ts",
|
|
99
|
+
"default": "./dist/openapi/relation/index.js"
|
|
100
|
+
},
|
|
101
|
+
"./openapi/relation/*": {
|
|
102
|
+
"types": "./dist/openapi/relation/*.d.ts",
|
|
103
|
+
"default": "./dist/openapi/relation/*.js"
|
|
104
|
+
},
|
|
105
|
+
"./openapi/im": {
|
|
106
|
+
"types": "./dist/openapi/im/index.d.ts",
|
|
107
|
+
"default": "./dist/openapi/im/index.js"
|
|
108
|
+
},
|
|
109
|
+
"./openapi/im/*": {
|
|
110
|
+
"types": "./dist/openapi/im/*.d.ts",
|
|
111
|
+
"default": "./dist/openapi/im/*.js"
|
|
112
|
+
},
|
|
113
|
+
"./openapi/business": {
|
|
114
|
+
"types": "./dist/openapi/business/index.d.ts",
|
|
115
|
+
"default": "./dist/openapi/business/index.js"
|
|
116
|
+
},
|
|
117
|
+
"./openapi/business/*": {
|
|
118
|
+
"types": "./dist/openapi/business/*.d.ts",
|
|
119
|
+
"default": "./dist/openapi/business/*.js"
|
|
120
|
+
},
|
|
121
|
+
"./openapi/music": {
|
|
122
|
+
"types": "./dist/openapi/music/index.d.ts",
|
|
123
|
+
"default": "./dist/openapi/music/index.js"
|
|
124
|
+
},
|
|
125
|
+
"./openapi/music/*": {
|
|
126
|
+
"types": "./dist/openapi/music/*.d.ts",
|
|
127
|
+
"default": "./dist/openapi/music/*.js"
|
|
128
|
+
},
|
|
89
129
|
"./auth": {
|
|
90
130
|
"types": "./dist/auth/index.d.ts",
|
|
91
131
|
"default": "./dist/auth/index.js"
|
|
@@ -103,4 +143,4 @@
|
|
|
103
143
|
"default": "./dist/ai_platform_llm/*.js"
|
|
104
144
|
}
|
|
105
145
|
}
|
|
106
|
-
}
|
|
146
|
+
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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>;
|
|
@@ -1,44 +0,0 @@
|
|
|
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
|
-
}
|