polyv-live-api-sdk 1.0.0
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/auth/index.d.ts +9 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/signature.d.ts +67 -0
- package/dist/auth/signature.d.ts.map +1 -0
- package/dist/client.d.ts +209 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/constants/error-codes.d.ts +134 -0
- package/dist/constants/error-codes.d.ts.map +1 -0
- package/dist/constants/index.d.ts +8 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/errors/index.d.ts +11 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/polyv-api-error.d.ts +71 -0
- package/dist/errors/polyv-api-error.d.ts.map +1 -0
- package/dist/errors/polyv-error.d.ts +31 -0
- package/dist/errors/polyv-error.d.ts.map +1 -0
- package/dist/errors/polyv-validation-error.d.ts +72 -0
- package/dist/errors/polyv-validation-error.d.ts.map +1 -0
- package/dist/errors/type-guards.d.ts +19 -0
- package/dist/errors/type-guards.d.ts.map +1 -0
- package/dist/errors/types.d.ts +13 -0
- package/dist/errors/types.d.ts.map +1 -0
- package/dist/index.cjs +15295 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +19501 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15258 -0
- package/dist/index.js.map +1 -0
- package/dist/services/account.service.d.ts +402 -0
- package/dist/services/account.service.d.ts.map +1 -0
- package/dist/services/channel.service.d.ts +2033 -0
- package/dist/services/channel.service.d.ts.map +1 -0
- package/dist/services/chat.service.d.ts +592 -0
- package/dist/services/chat.service.d.ts.map +1 -0
- package/dist/services/finance.service.d.ts +160 -0
- package/dist/services/finance.service.d.ts.map +1 -0
- package/dist/services/group.service.d.ts +191 -0
- package/dist/services/group.service.d.ts.map +1 -0
- package/dist/services/index.d.ts +27 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/live-interaction.service.d.ts +474 -0
- package/dist/services/live-interaction.service.d.ts.map +1 -0
- package/dist/services/other.service.d.ts +687 -0
- package/dist/services/other.service.d.ts.map +1 -0
- package/dist/services/platform.service.d.ts +190 -0
- package/dist/services/platform.service.d.ts.map +1 -0
- package/dist/services/player.service.d.ts +195 -0
- package/dist/services/player.service.d.ts.map +1 -0
- package/dist/services/v4/ai.service.d.ts +205 -0
- package/dist/services/v4/ai.service.d.ts.map +1 -0
- package/dist/services/v4/channel.service.d.ts +854 -0
- package/dist/services/v4/channel.service.d.ts.map +1 -0
- package/dist/services/v4/chat.service.d.ts +199 -0
- package/dist/services/v4/chat.service.d.ts.map +1 -0
- package/dist/services/v4/global.service.d.ts +86 -0
- package/dist/services/v4/global.service.d.ts.map +1 -0
- package/dist/services/v4/group.service.d.ts +132 -0
- package/dist/services/v4/group.service.d.ts.map +1 -0
- package/dist/services/v4/material.service.d.ts +85 -0
- package/dist/services/v4/material.service.d.ts.map +1 -0
- package/dist/services/v4/platform.service.d.ts +148 -0
- package/dist/services/v4/platform.service.d.ts.map +1 -0
- package/dist/services/v4/robot.service.d.ts +144 -0
- package/dist/services/v4/robot.service.d.ts.map +1 -0
- package/dist/services/v4/statistics.service.d.ts +61 -0
- package/dist/services/v4/statistics.service.d.ts.map +1 -0
- package/dist/services/v4/user.service.d.ts +1014 -0
- package/dist/services/v4/user.service.d.ts.map +1 -0
- package/dist/services/v4/webapp.service.d.ts +131 -0
- package/dist/services/v4/webapp.service.d.ts.map +1 -0
- package/dist/services/web.service.d.ts +758 -0
- package/dist/services/web.service.d.ts.map +1 -0
- package/dist/types/account.d.ts +287 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/auth.d.ts +31 -0
- package/dist/types/auth.d.ts.map +1 -0
- package/dist/types/callback.d.ts +156 -0
- package/dist/types/callback.d.ts.map +1 -0
- package/dist/types/channel.d.ts +2263 -0
- package/dist/types/channel.d.ts.map +1 -0
- package/dist/types/chat-banned.d.ts +366 -0
- package/dist/types/chat-banned.d.ts.map +1 -0
- package/dist/types/chat-censor-role.d.ts +190 -0
- package/dist/types/chat-censor-role.d.ts.map +1 -0
- package/dist/types/chat.d.ts +142 -0
- package/dist/types/chat.d.ts.map +1 -0
- package/dist/types/client.d.ts +43 -0
- package/dist/types/client.d.ts.map +1 -0
- package/dist/types/common.d.ts +52 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/finance.d.ts +252 -0
- package/dist/types/finance.d.ts.map +1 -0
- package/dist/types/group.d.ts +129 -0
- package/dist/types/group.d.ts.map +1 -0
- package/dist/types/index.d.ts +50 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/live-interaction.d.ts +301 -0
- package/dist/types/live-interaction.d.ts.map +1 -0
- package/dist/types/pagination.d.ts +37 -0
- package/dist/types/pagination.d.ts.map +1 -0
- package/dist/types/platform.d.ts +178 -0
- package/dist/types/platform.d.ts.map +1 -0
- package/dist/types/player.d.ts +177 -0
- package/dist/types/player.d.ts.map +1 -0
- package/dist/types/request.d.ts +45 -0
- package/dist/types/request.d.ts.map +1 -0
- package/dist/types/response.d.ts +58 -0
- package/dist/types/response.d.ts.map +1 -0
- package/dist/types/signature.d.ts +50 -0
- package/dist/types/signature.d.ts.map +1 -0
- package/dist/types/upload.d.ts +32 -0
- package/dist/types/upload.d.ts.map +1 -0
- package/dist/types/v4-ai.d.ts +379 -0
- package/dist/types/v4-ai.d.ts.map +1 -0
- package/dist/types/v4-channel.d.ts +2400 -0
- package/dist/types/v4-channel.d.ts.map +1 -0
- package/dist/types/v4-chat.d.ts +190 -0
- package/dist/types/v4-chat.d.ts.map +1 -0
- package/dist/types/v4-global.d.ts +150 -0
- package/dist/types/v4-global.d.ts.map +1 -0
- package/dist/types/v4-group.d.ts +212 -0
- package/dist/types/v4-group.d.ts.map +1 -0
- package/dist/types/v4-material.d.ts +141 -0
- package/dist/types/v4-material.d.ts.map +1 -0
- package/dist/types/v4-platform.d.ts +223 -0
- package/dist/types/v4-platform.d.ts.map +1 -0
- package/dist/types/v4-robot.d.ts +149 -0
- package/dist/types/v4-robot.d.ts.map +1 -0
- package/dist/types/v4-statistics.d.ts +87 -0
- package/dist/types/v4-statistics.d.ts.map +1 -0
- package/dist/types/v4-user.d.ts +1021 -0
- package/dist/types/v4-user.d.ts.map +1 -0
- package/dist/types/v4-webapp.d.ts +161 -0
- package/dist/types/v4-webapp.d.ts.map +1 -0
- package/dist/types/version.d.ts +21 -0
- package/dist/types/version.d.ts.map +1 -0
- package/dist/types/web.d.ts +868 -0
- package/dist/types/web.d.ts.map +1 -0
- package/dist/utils/env.d.ts +54 -0
- package/dist/utils/env.d.ts.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/pagination.d.ts +62 -0
- package/dist/utils/pagination.d.ts.map +1 -0
- package/dist/utils/signature.d.ts +67 -0
- package/dist/utils/signature.d.ts.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Platform Service
|
|
3
|
+
*
|
|
4
|
+
* Service for managing PolyV platform-related operations.
|
|
5
|
+
* Provides methods for anchor management and content groups.
|
|
6
|
+
*
|
|
7
|
+
* @module services/platform
|
|
8
|
+
*/
|
|
9
|
+
import type { PolyVClient } from '../client.js';
|
|
10
|
+
import type { CreateAnchorParams, AnchorDetail, ListAnchorsParams, ListAnchorsResponse, ListAnchorRelationsParams, AnchorRelationItem, UpdateAnchorParams, UpdateAnchorStatusParams, ContentGroupItem } from '../types/platform.js';
|
|
11
|
+
import type { PaginationResponse } from '../types/pagination.js';
|
|
12
|
+
/**
|
|
13
|
+
* PlatformService
|
|
14
|
+
*
|
|
15
|
+
* Provides methods to interact with PolyV Platform APIs.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const client = new PolyVClient({ appId: 'xxx', appSecret: 'yyy' });
|
|
20
|
+
* const anchorId = await client.platform.createAnchor({
|
|
21
|
+
* nickname: '主播1',
|
|
22
|
+
* sex: 'W',
|
|
23
|
+
* avatar: 'https://example.com/avatar.png',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare class PlatformService {
|
|
28
|
+
private client;
|
|
29
|
+
/**
|
|
30
|
+
* Create a new PlatformService instance
|
|
31
|
+
*
|
|
32
|
+
* @param client - The PolyVClient instance to use for API calls
|
|
33
|
+
*/
|
|
34
|
+
constructor(client: PolyVClient);
|
|
35
|
+
/**
|
|
36
|
+
* Create an anchor
|
|
37
|
+
* Create a new anchor profile
|
|
38
|
+
*
|
|
39
|
+
* @param params - Create anchor parameters
|
|
40
|
+
* @returns Anchor ID
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const anchorId = await client.platform.createAnchor({
|
|
45
|
+
* nickname: '主播1',
|
|
46
|
+
* sex: 'W',
|
|
47
|
+
* avatar: 'https://example.com/avatar.png',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
createAnchor(params: CreateAnchorParams): Promise<number>;
|
|
52
|
+
/**
|
|
53
|
+
* Get anchor details
|
|
54
|
+
* Query anchor profile by ID
|
|
55
|
+
*
|
|
56
|
+
* @param anchorId - Anchor ID
|
|
57
|
+
* @returns Anchor details
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```typescript
|
|
61
|
+
* const anchor = await client.platform.getAnchor(1);
|
|
62
|
+
* console.log(anchor.nickname, anchor.status);
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
getAnchor(anchorId: number): Promise<AnchorDetail>;
|
|
66
|
+
/**
|
|
67
|
+
* List anchors
|
|
68
|
+
* Query paginated list of anchors with filters
|
|
69
|
+
*
|
|
70
|
+
* @param params - List parameters (optional)
|
|
71
|
+
* @returns Paginated list of anchors
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* // List all anchors
|
|
76
|
+
* const anchors = await client.platform.listAnchors();
|
|
77
|
+
*
|
|
78
|
+
* // List with filters
|
|
79
|
+
* const filtered = await client.platform.listAnchors({
|
|
80
|
+
* status: 1,
|
|
81
|
+
* sex: 'W',
|
|
82
|
+
* nickname: '主播',
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
listAnchors(params?: ListAnchorsParams): Promise<ListAnchorsResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* List anchor relations (associated channels)
|
|
89
|
+
* Query channels associated with an anchor
|
|
90
|
+
*
|
|
91
|
+
* @param params - Query parameters
|
|
92
|
+
* @returns Paginated list of associated channels
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```typescript
|
|
96
|
+
* const relations = await client.platform.listAnchorRelations({ anchorId: 1 });
|
|
97
|
+
* console.log(relations.contents);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
listAnchorRelations(params: ListAnchorRelationsParams): Promise<PaginationResponse<AnchorRelationItem>>;
|
|
101
|
+
/**
|
|
102
|
+
* List anchor unrelations (unassociated channels)
|
|
103
|
+
* Query channels not associated with an anchor
|
|
104
|
+
*
|
|
105
|
+
* @param params - Query parameters
|
|
106
|
+
* @returns Paginated list of unassociated channels
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const unrelations = await client.platform.listAnchorUnrelations({ anchorId: 1 });
|
|
111
|
+
* console.log(unrelations.contents);
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
listAnchorUnrelations(params: ListAnchorRelationsParams): Promise<PaginationResponse<AnchorRelationItem>>;
|
|
115
|
+
/**
|
|
116
|
+
* Update anchor
|
|
117
|
+
* Modify anchor profile
|
|
118
|
+
*
|
|
119
|
+
* @param params - Update parameters
|
|
120
|
+
* @returns void
|
|
121
|
+
*
|
|
122
|
+
* @example
|
|
123
|
+
* ```typescript
|
|
124
|
+
* await client.platform.updateAnchor({
|
|
125
|
+
* anchorId: 1,
|
|
126
|
+
* nickname: '新昵称',
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
updateAnchor(params: UpdateAnchorParams): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Update anchor status
|
|
133
|
+
* Enable or disable an anchor
|
|
134
|
+
*
|
|
135
|
+
* @param params - Update status parameters
|
|
136
|
+
* @returns void
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* ```typescript
|
|
140
|
+
* // Enable anchor
|
|
141
|
+
* await client.platform.updateAnchorStatus({ anchorId: 1, status: 1 });
|
|
142
|
+
* // Disable anchor
|
|
143
|
+
* await client.platform.updateAnchorStatus({ anchorId: 1, status: 0 });
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
updateAnchorStatus(params: UpdateAnchorStatusParams): Promise<void>;
|
|
147
|
+
/**
|
|
148
|
+
* List content groups
|
|
149
|
+
* Query platform content library groups
|
|
150
|
+
*
|
|
151
|
+
* @param type - Content type: 'script' (内容库) or 'robot' (成员库)
|
|
152
|
+
* @returns Array of content groups
|
|
153
|
+
*
|
|
154
|
+
* @example
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const scriptGroups = await client.platform.listContentGroups('script');
|
|
157
|
+
* const robotGroups = await client.platform.listContentGroups('robot');
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
listContentGroups(type: 'script' | 'robot'): Promise<ContentGroupItem[]>;
|
|
161
|
+
/**
|
|
162
|
+
* Validate anchor ID
|
|
163
|
+
*/
|
|
164
|
+
private validateAnchorId;
|
|
165
|
+
/**
|
|
166
|
+
* Validate sex type
|
|
167
|
+
*/
|
|
168
|
+
private validateSex;
|
|
169
|
+
/**
|
|
170
|
+
* Validate nickname
|
|
171
|
+
*/
|
|
172
|
+
private validateNickname;
|
|
173
|
+
/**
|
|
174
|
+
* Validate avatar URL
|
|
175
|
+
*/
|
|
176
|
+
private validateAvatar;
|
|
177
|
+
/**
|
|
178
|
+
* Validate description
|
|
179
|
+
*/
|
|
180
|
+
private validateDescription;
|
|
181
|
+
/**
|
|
182
|
+
* Validate channel IDs array
|
|
183
|
+
*/
|
|
184
|
+
private validateChannelIds;
|
|
185
|
+
/**
|
|
186
|
+
* Validate pagination parameters
|
|
187
|
+
*/
|
|
188
|
+
private validatePagination;
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=platform.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform.service.d.ts","sourceRoot":"","sources":["../../src/services/platform.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAEjB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAGjE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAc;IAE5B;;;;OAIG;gBACS,MAAM,EAAE,WAAW;IAQ/B;;;;;;;;;;;;;;;OAeG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC;IAwC/D;;;;;;;;;;;;OAYG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAUxD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,WAAW,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAuD3E;;;;;;;;;;;;OAYG;IACG,mBAAmB,CACvB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;IAqBlD;;;;;;;;;;;;OAYG;IACG,qBAAqB,CACzB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;IAqBlD;;;;;;;;;;;;;;OAcG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkD7D;;;;;;;;;;;;;;OAcG;IACG,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBzE;;;;;;;;;;;;OAYG;IACG,iBAAiB,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAiB9E;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,WAAW;IAMnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IASxB;;OAEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAS1B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAQ3B"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Player Service
|
|
3
|
+
*
|
|
4
|
+
* Service for managing PolyV player-related operations.
|
|
5
|
+
* Provides methods for anti-record settings, adverts, logo, and watch feedback.
|
|
6
|
+
*
|
|
7
|
+
* @module services/player
|
|
8
|
+
*/
|
|
9
|
+
import type { PolyVClient } from '../client.js';
|
|
10
|
+
import type { AntiRecordSettingsParams, AntiRecordSettingsResponse, MarqueeUrlParams, HeadAdvertParams, StopAdvertParams, LogoParams, WatchFeedbackListParams, WatchFeedbackListResponse } from '../types/player.js';
|
|
11
|
+
/**
|
|
12
|
+
* PlayerService
|
|
13
|
+
*
|
|
14
|
+
* Provides methods to interact with PolyV Player APIs (Anti-record, Adverts, Logo, Watch Feedback).
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const client = new PolyVClient({ appId: 'xxx', appSecret: 'yyy' });
|
|
19
|
+
* const settings = await client.player.getAntiRecordSettings(123456);
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class PlayerService {
|
|
23
|
+
private client;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new PlayerService instance
|
|
26
|
+
*
|
|
27
|
+
* @param client - The PolyVClient instance to use for API calls
|
|
28
|
+
*/
|
|
29
|
+
constructor(client: PolyVClient);
|
|
30
|
+
/**
|
|
31
|
+
* Set anti-record settings
|
|
32
|
+
* Configure anti-record (marquee/watermark) settings for a channel
|
|
33
|
+
*
|
|
34
|
+
* @param channelId - Channel ID
|
|
35
|
+
* @param params - Anti-record settings parameters
|
|
36
|
+
* @returns "SUCCESS" on success
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* await client.player.setAntiRecordSettings(123456, {
|
|
41
|
+
* antiRecordType: 'marquee',
|
|
42
|
+
* modelType: 'fixed',
|
|
43
|
+
* content: '用户ID:12345',
|
|
44
|
+
* fontSize: 14,
|
|
45
|
+
* });
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
setAntiRecordSettings(channelId: number, params: AntiRecordSettingsParams): Promise<string>;
|
|
49
|
+
/**
|
|
50
|
+
* Get anti-record settings
|
|
51
|
+
* Query anti-record settings for a channel or account default template
|
|
52
|
+
*
|
|
53
|
+
* @param channelId - Channel ID (optional, returns account default template if not provided)
|
|
54
|
+
* @returns Anti-record settings
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const settings = await client.player.getAntiRecordSettings(123456);
|
|
59
|
+
* // Or get account default template
|
|
60
|
+
* const defaultSettings = await client.player.getAntiRecordSettings();
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
getAntiRecordSettings(channelId?: number): Promise<AntiRecordSettingsResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Set marquee URL
|
|
66
|
+
* Configure marquee jump URL settings for a channel
|
|
67
|
+
*
|
|
68
|
+
* @param channelId - Channel ID
|
|
69
|
+
* @param params - Marquee URL parameters
|
|
70
|
+
* @returns "设置成功" on success
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* await client.player.setMarqueeUrl(123456, {
|
|
75
|
+
* marqueeRestrict: 'Y',
|
|
76
|
+
* url: 'https://example.com/user/{userId}',
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
setMarqueeUrl(channelId: number, params: MarqueeUrlParams): Promise<string>;
|
|
81
|
+
/**
|
|
82
|
+
* Update head advert
|
|
83
|
+
* Configure head advert settings for a channel
|
|
84
|
+
*
|
|
85
|
+
* @param channelId - Channel ID
|
|
86
|
+
* @param params - Head advert parameters
|
|
87
|
+
* @returns true on success
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* ```typescript
|
|
91
|
+
* await client.player.updateHeadAdvert(123456, {
|
|
92
|
+
* headAdvertType: 'IMAGE',
|
|
93
|
+
* headAdvertImage: 'https://example.com/ad.jpg',
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
updateHeadAdvert(channelId: number, params: HeadAdvertParams): Promise<boolean>;
|
|
98
|
+
/**
|
|
99
|
+
* Update stop advert
|
|
100
|
+
* Configure stop (pause) advert settings for a channel
|
|
101
|
+
*
|
|
102
|
+
* @param channelId - Channel ID
|
|
103
|
+
* @param params - Stop advert parameters
|
|
104
|
+
* @returns true on success
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```typescript
|
|
108
|
+
* await client.player.updateStopAdvert(123456, {
|
|
109
|
+
* enabled: 'Y',
|
|
110
|
+
* stopAdvertImage: 'https://example.com/pause-ad.jpg',
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
updateStopAdvert(channelId: number, params: StopAdvertParams): Promise<boolean>;
|
|
115
|
+
/**
|
|
116
|
+
* Update logo
|
|
117
|
+
* Configure logo settings for a channel
|
|
118
|
+
*
|
|
119
|
+
* @param channelId - Channel ID
|
|
120
|
+
* @param params - Logo parameters
|
|
121
|
+
* @returns true on success
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* await client.player.updateLogo(123456, {
|
|
126
|
+
* logoImage: 'https://example.com/logo.png',
|
|
127
|
+
* logoOpacity: 0.8,
|
|
128
|
+
* logoPosition: 'tr',
|
|
129
|
+
* });
|
|
130
|
+
* ```
|
|
131
|
+
*/
|
|
132
|
+
updateLogo(channelId: number, params: LogoParams): Promise<boolean>;
|
|
133
|
+
/**
|
|
134
|
+
* Get watch feedback list
|
|
135
|
+
* Query paginated list of watch feedback for a channel or all channels
|
|
136
|
+
*
|
|
137
|
+
* @param params - Query parameters
|
|
138
|
+
* @returns Paginated list of watch feedback
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* const feedback = await client.player.getWatchFeedbackList({
|
|
143
|
+
* channelId: 123456,
|
|
144
|
+
* pageNumber: 1,
|
|
145
|
+
* pageSize: 10,
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
getWatchFeedbackList(params?: WatchFeedbackListParams): Promise<WatchFeedbackListResponse>;
|
|
150
|
+
/**
|
|
151
|
+
* Validate channel ID
|
|
152
|
+
*/
|
|
153
|
+
private validateChannelId;
|
|
154
|
+
/**
|
|
155
|
+
* Validate Y/N value
|
|
156
|
+
*/
|
|
157
|
+
private validateYNValue;
|
|
158
|
+
/**
|
|
159
|
+
* Validate anti-record type
|
|
160
|
+
*/
|
|
161
|
+
private validateAntiRecordType;
|
|
162
|
+
/**
|
|
163
|
+
* Validate model type
|
|
164
|
+
*/
|
|
165
|
+
private validateModelType;
|
|
166
|
+
/**
|
|
167
|
+
* Validate font size based on anti-record type
|
|
168
|
+
*/
|
|
169
|
+
private validateFontSize;
|
|
170
|
+
/**
|
|
171
|
+
* Validate opacity (0-100)
|
|
172
|
+
*/
|
|
173
|
+
private validateOpacity;
|
|
174
|
+
/**
|
|
175
|
+
* Validate show mode
|
|
176
|
+
*/
|
|
177
|
+
private validateShowMode;
|
|
178
|
+
/**
|
|
179
|
+
* Validate head advert type
|
|
180
|
+
*/
|
|
181
|
+
private validateHeadAdvertType;
|
|
182
|
+
/**
|
|
183
|
+
* Validate logo opacity (0, 1]
|
|
184
|
+
*/
|
|
185
|
+
private validateLogoOpacity;
|
|
186
|
+
/**
|
|
187
|
+
* Validate logo position
|
|
188
|
+
*/
|
|
189
|
+
private validateLogoPosition;
|
|
190
|
+
/**
|
|
191
|
+
* Validate pagination parameters
|
|
192
|
+
*/
|
|
193
|
+
private validatePagination;
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=player.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player.service.d.ts","sourceRoot":"","sources":["../../src/services/player.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EACV,wBAAwB,EACxB,0BAA0B,EAC1B,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,oBAAoB,CAAC;AAG5B;;;;;;;;;;GAUG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAc;IAE5B;;;;OAIG;gBACS,MAAM,EAAE,WAAW;IAQ/B;;;;;;;;;;;;;;;;;OAiBG;IACG,qBAAqB,CACzB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,MAAM,CAAC;IAyElB;;;;;;;;;;;;;OAaG;IACG,qBAAqB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAiBpF;;;;;;;;;;;;;;;OAeG;IACG,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IA+BjF;;;;;;;;;;;;;;;OAeG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAiDrF;;;;;;;;;;;;;;;OAeG;IACG,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC;IAgCrF;;;;;;;;;;;;;;;;OAgBG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IA4CzE;;;;;;;;;;;;;;;OAeG;IACG,oBAAoB,CACxB,MAAM,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,yBAAyB,CAAC;IA8BrC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IASzB;;OAEG;IACH,OAAO,CAAC,eAAe;IAMvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAOzB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;OAEG;IACH,OAAO,CAAC,eAAe;IAMvB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAOxB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAO9B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAM3B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAO5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;CAa3B"}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* V4 AI Service
|
|
3
|
+
*
|
|
4
|
+
* Service for managing PolyV V4 AI and Digital Human operations.
|
|
5
|
+
* Provides methods for digital humans, video production, and TTS voices.
|
|
6
|
+
*
|
|
7
|
+
* @module services/v4/ai
|
|
8
|
+
*/
|
|
9
|
+
import type { PolyVClient } from '../../client.js';
|
|
10
|
+
import type { ListDigitalHumansParams, ListDigitalHumansResponse, ListOrganizationsParams, DigitalHumanOrganization, SetOrganizationsParams, ListVideoProducesParams, ListVideoProducesResponse, GetVideoProduceParams, VideoProduceTask, BatchCreateVideoProducesParams, BatchCreateVideoProducesResponse, DeleteVideoProduceParams, ListVideoProducePptsParams, ListVideoProducePptsResponse, GetVideoProducePptParams, VideoProducePpt, UploadVideoProducePptParams, UploadVideoProducePptResponse, TtsVoice } from '../../types/v4-ai.js';
|
|
11
|
+
/**
|
|
12
|
+
* V4AiService
|
|
13
|
+
*
|
|
14
|
+
* Provides methods to interact with PolyV V4 AI APIs.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const client = new PolyVClient({ appId: 'xxx', appSecret: 'yyy' });
|
|
19
|
+
* const digitalHumans = await client.v4Ai.listDigitalHumans({ pageNumber: 1, pageSize: 10 });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export declare class V4AiService {
|
|
23
|
+
private client;
|
|
24
|
+
/**
|
|
25
|
+
* Create a new V4AiService instance
|
|
26
|
+
*
|
|
27
|
+
* @param client - The PolyVClient instance to use for API calls
|
|
28
|
+
*/
|
|
29
|
+
constructor(client: PolyVClient);
|
|
30
|
+
/**
|
|
31
|
+
* Query digital human list with pagination
|
|
32
|
+
*
|
|
33
|
+
* @param params - Query parameters
|
|
34
|
+
* @returns Paginated digital human list
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const result = await client.v4Ai.listDigitalHumans({
|
|
39
|
+
* pageNumber: 1,
|
|
40
|
+
* pageSize: 10,
|
|
41
|
+
* });
|
|
42
|
+
* console.log(result.contents);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
listDigitalHumans(params: ListDigitalHumansParams): Promise<ListDigitalHumansResponse>;
|
|
46
|
+
/**
|
|
47
|
+
* Query digital human organizations
|
|
48
|
+
*
|
|
49
|
+
* @param params - Query parameters
|
|
50
|
+
* @returns Digital human organization mappings
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* const result = await client.v4Ai.listOrganizations({
|
|
55
|
+
* aiDigitalHumanIds: '1001,1002',
|
|
56
|
+
* });
|
|
57
|
+
* console.log(result);
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
listOrganizations(params: ListOrganizationsParams): Promise<DigitalHumanOrganization[]>;
|
|
61
|
+
/**
|
|
62
|
+
* Associate digital humans with organizations
|
|
63
|
+
*
|
|
64
|
+
* @param params - Association parameters
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* ```typescript
|
|
68
|
+
* await client.v4Ai.setOrganizations({
|
|
69
|
+
* items: [
|
|
70
|
+
* {
|
|
71
|
+
* aiDigitalHumanId: 1001,
|
|
72
|
+
* organizationIds: [1, 2, 3],
|
|
73
|
+
* includeChildren: true,
|
|
74
|
+
* },
|
|
75
|
+
* ],
|
|
76
|
+
* });
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
setOrganizations(params: SetOrganizationsParams): Promise<void>;
|
|
80
|
+
/**
|
|
81
|
+
* Query video produce task list with pagination
|
|
82
|
+
*
|
|
83
|
+
* @param params - Query parameters
|
|
84
|
+
* @returns Paginated video produce task list
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```typescript
|
|
88
|
+
* const result = await client.v4Ai.listVideoProduces({
|
|
89
|
+
* pageNumber: 1,
|
|
90
|
+
* pageSize: 10,
|
|
91
|
+
* status: VideoProduceStatus.SUCCESS,
|
|
92
|
+
* });
|
|
93
|
+
* console.log(result.contents);
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
listVideoProduces(params: ListVideoProducesParams): Promise<ListVideoProducesResponse>;
|
|
97
|
+
/**
|
|
98
|
+
* Query single video produce task
|
|
99
|
+
*
|
|
100
|
+
* @param params - Query parameters
|
|
101
|
+
* @returns Video produce task detail
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```typescript
|
|
105
|
+
* const task = await client.v4Ai.getVideoProduce({ id: 2001 });
|
|
106
|
+
* console.log(task.videoName);
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
getVideoProduce(params: GetVideoProduceParams): Promise<VideoProduceTask>;
|
|
110
|
+
/**
|
|
111
|
+
* Create video produce tasks in batch
|
|
112
|
+
*
|
|
113
|
+
* @param params - Batch creation parameters
|
|
114
|
+
* @returns Batch creation result
|
|
115
|
+
*
|
|
116
|
+
* @example
|
|
117
|
+
* ```typescript
|
|
118
|
+
* const result = await client.v4Ai.batchCreateVideoProduces({
|
|
119
|
+
* tasks: [
|
|
120
|
+
* {
|
|
121
|
+
* videoName: 'Video 1',
|
|
122
|
+
* hasDigitalHuman: false,
|
|
123
|
+
* ttsVoiceInfo: { ttsVoiceId: 1, rate: 1.0 },
|
|
124
|
+
* subtitleInfo: { enableSubtitle: true },
|
|
125
|
+
* },
|
|
126
|
+
* ],
|
|
127
|
+
* });
|
|
128
|
+
* console.log(result.createdCount);
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
batchCreateVideoProduces(params: BatchCreateVideoProducesParams): Promise<BatchCreateVideoProducesResponse>;
|
|
132
|
+
/**
|
|
133
|
+
* Delete video produce task
|
|
134
|
+
*
|
|
135
|
+
* @param params - Delete parameters
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* await client.v4Ai.deleteVideoProduce({ id: 2001 });
|
|
140
|
+
* ```
|
|
141
|
+
*/
|
|
142
|
+
deleteVideoProduce(params: DeleteVideoProduceParams): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Query PPT list for video creation
|
|
145
|
+
*
|
|
146
|
+
* @param params - Query parameters
|
|
147
|
+
* @returns Paginated PPT list
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```typescript
|
|
151
|
+
* const result = await client.v4Ai.listVideoProducePpts({
|
|
152
|
+
* pageNumber: 1,
|
|
153
|
+
* pageSize: 10,
|
|
154
|
+
* });
|
|
155
|
+
* console.log(result.contents);
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
listVideoProducePpts(params: ListVideoProducePptsParams): Promise<ListVideoProducePptsResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* Query single PPT for video creation
|
|
161
|
+
*
|
|
162
|
+
* @param params - Query parameters
|
|
163
|
+
* @returns PPT detail
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```typescript
|
|
167
|
+
* const ppt = await client.v4Ai.getVideoProducePpt({ fileId: 'file_001' });
|
|
168
|
+
* console.log(ppt.fileName);
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
getVideoProducePpt(params: GetVideoProducePptParams): Promise<VideoProducePpt>;
|
|
172
|
+
/**
|
|
173
|
+
* Upload PPT file for video creation
|
|
174
|
+
*
|
|
175
|
+
* @param params - Upload parameters
|
|
176
|
+
* @returns Upload result
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```typescript
|
|
180
|
+
* const result = await client.v4Ai.uploadVideoProducePpt({
|
|
181
|
+
* url: 'https://example.com/presentation.pptx',
|
|
182
|
+
* docName: 'My Presentation',
|
|
183
|
+
* });
|
|
184
|
+
* console.log(result.fileId);
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
uploadVideoProducePpt(params: UploadVideoProducePptParams): Promise<UploadVideoProducePptResponse>;
|
|
188
|
+
/**
|
|
189
|
+
* Query available TTS voices
|
|
190
|
+
*
|
|
191
|
+
* @returns TTS voice list
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```typescript
|
|
195
|
+
* const voices = await client.v4Ai.listTtsVoices();
|
|
196
|
+
* console.log(voices);
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
listTtsVoices(): Promise<TtsVoice[]>;
|
|
200
|
+
/**
|
|
201
|
+
* Validate pagination parameters
|
|
202
|
+
*/
|
|
203
|
+
private validatePaginationParams;
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=ai.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.service.d.ts","sourceRoot":"","sources":["../../../src/services/v4/ai.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EACV,uBAAuB,EACvB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,uBAAuB,EACvB,yBAAyB,EACzB,qBAAqB,EACrB,gBAAgB,EAChB,8BAA8B,EAC9B,gCAAgC,EAChC,wBAAwB,EACxB,0BAA0B,EAC1B,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,EACf,2BAA2B,EAC3B,6BAA6B,EAC7B,QAAQ,EACT,MAAM,sBAAsB,CAAC;AAG9B;;;;;;;;;;GAUG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,MAAM,CAAc;IAE5B;;;;OAIG;gBACS,MAAM,EAAE,WAAW;IAQ/B;;;;;;;;;;;;;;OAcG;IACG,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAU5F;;;;;;;;;;;;;OAaG;IACG,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,wBAAwB,EAAE,CAAC;IAY7F;;;;;;;;;;;;;;;;;OAiBG;IACG,gBAAgB,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAerE;;;;;;;;;;;;;;;OAeG;IACG,iBAAiB,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAU5F;;;;;;;;;;;OAWG;IACG,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAY/E;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,wBAAwB,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,gCAAgC,CAAC;IA2BjH;;;;;;;;;OASG;IACG,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWzE;;;;;;;;;;;;;;OAcG;IACG,oBAAoB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAUrG;;;;;;;;;;;OAWG;IACG,kBAAkB,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,eAAe,CAAC;IAYpF;;;;;;;;;;;;;;OAcG;IACG,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,6BAA6B,CAAC;IAoBxG;;;;;;;;;;OAUG;IACG,aAAa,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAW1C;;OAEG;IACH,OAAO,CAAC,wBAAwB;CAQjC"}
|