meeglesdk 0.1.8 → 0.2.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/CHANGELOG.md +21 -0
- package/README.md +164 -7
- package/RELEASE.md +48 -0
- package/dist/client.d.ts +9 -0
- package/dist/client.js +10 -0
- package/dist/core/base-service.d.ts +2 -0
- package/dist/core/base-service.js +12 -0
- package/dist/core/request/handler.js +3 -2
- package/dist/core/request/types.d.ts +2 -0
- package/dist/helpers/event.d.ts +1 -1
- package/dist/helpers/event.js +14 -0
- package/dist/index.d.ts +14 -10
- package/dist/index.js +3 -0
- package/dist/service/aifield/index.d.ts +26 -0
- package/dist/service/aifield/index.js +27 -0
- package/dist/service/config/resource.d.ts +3 -3
- package/dist/service/config/resource.js +5 -1
- package/dist/service/config/role.d.ts +2 -1
- package/dist/service/config/role.js +2 -1
- package/dist/service/measure/index.d.ts +8 -0
- package/dist/service/measure/index.js +10 -0
- package/dist/service/measure/query.d.ts +31 -1
- package/dist/service/measure/query.js +31 -16
- package/dist/service/view/query.d.ts +10 -1
- package/dist/service/view/query.js +15 -0
- package/dist/service/workitem/attachment.d.ts +12 -12
- package/dist/service/workitem/attachment.js +8 -8
- package/dist/service/workitem/comment.d.ts +11 -11
- package/dist/service/workitem/comment.js +7 -7
- package/dist/service/workitem/search.d.ts +3 -7
- package/dist/service/workitem/search.js +8 -8
- package/dist/service/workitem/wbsDraft/index.d.ts +191 -0
- package/dist/service/workitem/wbsDraft/index.js +264 -0
- package/dist/service/workitem/wbsDraft.d.ts +191 -0
- package/dist/service/workitem/wbsDraft.js +394 -0
- package/dist/service/workitem/wbsProjectKeyResolver.d.ts +34 -0
- package/dist/service/workitem/wbsProjectKeyResolver.js +133 -0
- package/dist/service/workitem/wbsView/index.d.ts +46 -0
- package/dist/service/workitem/wbsView/index.js +51 -0
- package/dist/service/workitem/wbsView.d.ts +48 -0
- package/dist/service/workitem/wbsView.js +86 -0
- package/dist/service/workitem/workItem.d.ts +30 -7
- package/dist/service/workitem/workItem.js +43 -10
- package/dist/service/workitem/workflow.d.ts +2 -2
- package/dist/service/workitem/workflow.js +1 -0
- package/dist/service/workitem/workhour.d.ts +3 -3
- package/dist/types/aifield.d.ts +12 -0
- package/dist/types/aifield.js +4 -0
- package/dist/types/ainode.d.ts +70 -40
- package/dist/types/ainode.js +0 -3
- package/dist/types/common.d.ts +7 -1
- package/dist/types/config.d.ts +85 -22
- package/dist/types/event.d.ts +176 -9
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.js +2 -0
- package/dist/types/measure.d.ts +7 -0
- package/dist/types/tenant.d.ts +17 -4
- package/dist/types/user.d.ts +5 -1
- package/dist/types/view.d.ts +6 -0
- package/dist/types/workitem.d.ts +1413 -159
- package/package.json +8 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.2.0 - 2026-05-10
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Added public Node SDK services and exports for AI Node and AI Field APIs, including request/response types and event payload types.
|
|
8
|
+
- Added WBS Draft and WBS View service coverage for draft creation, patching, publishing, reset, structure, row detail, row config, and expand info flows.
|
|
9
|
+
- Added documented work item sub-services for comments, attachments, work hours, reviews, batch updates, subtask operations, and universal search.
|
|
10
|
+
- Added measure chart query helpers for chart summaries by view.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Aligned SDK types with the latest Meego MCP documentation for comment rich text, attachment upload/download/delete, work hour identifiers, tenant entitlement fields, event source enums, user group member updates, work item search, subtask payloads, and resource search pagination.
|
|
15
|
+
- Kept large OpenAPI identifiers string-friendly so callers can pass documented string IDs without precision loss.
|
|
16
|
+
|
|
17
|
+
### Release
|
|
18
|
+
|
|
19
|
+
- Prepared `meeglesdk@0.2.0` for npm publication.
|
|
20
|
+
- Added `release:check` and `prepublishOnly` so npm publishing runs typecheck, unit tests, and build first.
|
|
21
|
+
|
package/README.md
CHANGED
|
@@ -4,6 +4,9 @@ TypeScript SDK for Feishu Project (Meego) Open API.
|
|
|
4
4
|
|
|
5
5
|
Runtime: Node.js 18+ (server-side only; browser usage is not supported).
|
|
6
6
|
|
|
7
|
+
Release notes: [CHANGELOG.md](./CHANGELOG.md)
|
|
8
|
+
Release protocol: [RELEASE.md](./RELEASE.md)
|
|
9
|
+
|
|
7
10
|
## Install
|
|
8
11
|
|
|
9
12
|
```bash
|
|
@@ -149,6 +152,40 @@ await client.workItem.query(
|
|
|
149
152
|
- Network errors, timeouts, and retryable API error codes are retried (default: `10429`, `50006`).
|
|
150
153
|
- Per-request overrides are supported via `options.retry`, `options.skipRetry`, and `options.timeout`.
|
|
151
154
|
|
|
155
|
+
## AI Field
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
await client.aiField.update({
|
|
159
|
+
ai_task_id: '7629005114472926736',
|
|
160
|
+
field_value: 'Generated field value',
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
AI field webhooks use event types `8101` and `8102`.
|
|
165
|
+
|
|
166
|
+
## Work Item Field Options
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
const options = await client.workItem.getFieldOptions({
|
|
170
|
+
project_key: 'project_key',
|
|
171
|
+
work_item_type_key: 'story',
|
|
172
|
+
work_item_id: 123456,
|
|
173
|
+
field_key: 'priority',
|
|
174
|
+
});
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Compound Field Values
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
await client.workItem.updateCompoundFieldValue({
|
|
181
|
+
project_key: 'project_key',
|
|
182
|
+
work_item_id: 123456,
|
|
183
|
+
field_key: 'field_compound',
|
|
184
|
+
action: 'add',
|
|
185
|
+
fields: [[{ field_key: 'sub_field', field_value: 'value' }]],
|
|
186
|
+
});
|
|
187
|
+
```
|
|
188
|
+
|
|
152
189
|
## WBS View (Query + Body)
|
|
153
190
|
|
|
154
191
|
```ts
|
|
@@ -170,16 +207,133 @@ const wbs = await client.workItem.workflow.getWbsView(
|
|
|
170
207
|
);
|
|
171
208
|
```
|
|
172
209
|
|
|
210
|
+
## WBS Draft
|
|
211
|
+
|
|
212
|
+
`WBS Draft` is a standalone sub-service under `workItem.wbsDraft`.
|
|
213
|
+
Do not call draft APIs from `workItem.workflow`.
|
|
214
|
+
|
|
215
|
+
```ts
|
|
216
|
+
const draft = await client.workItem.wbsDraft.createDraft({
|
|
217
|
+
project_key: 'project_key',
|
|
218
|
+
work_item_id: 123456,
|
|
219
|
+
work_item_type_key: 'story',
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
await client.workItem.wbsDraft.patchDraft({
|
|
223
|
+
project_key: 'project_key',
|
|
224
|
+
work_item_id: 123456,
|
|
225
|
+
draft_id: draft.draft_meta.draft_id,
|
|
226
|
+
operation: {
|
|
227
|
+
operation_type: 'UpdateName',
|
|
228
|
+
operation_value: {
|
|
229
|
+
update_name: {
|
|
230
|
+
uuid: 'node_xxx',
|
|
231
|
+
name: '更新后名称',
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
const confs = await client.workItem.wbsDraft.getSubWorkItemConf({
|
|
238
|
+
project_key: 'project_key',
|
|
239
|
+
work_item_id: 123456,
|
|
240
|
+
draft_id: draft.draft_meta.draft_id,
|
|
241
|
+
node_uuid: 'node_xxx',
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
const createProgress = await client.workItem.wbsDraft.getCreateDraftProgress({
|
|
245
|
+
project_key: 'project_key',
|
|
246
|
+
work_item_id: 123456,
|
|
247
|
+
draft_id: draft.draft_meta.draft_id,
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
const patchProgress = await client.workItem.wbsDraft.getPatchDraftProgress({
|
|
251
|
+
project_key: 'project_key',
|
|
252
|
+
transaction_id: 'tx_xxx',
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
const publishResult = await client.workItem.wbsDraft.publishDraft({
|
|
256
|
+
project_key: 'project_key',
|
|
257
|
+
work_item_id: 123456,
|
|
258
|
+
draft_id: draft.draft_meta.draft_id,
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const publishProgress = await client.workItem.wbsDraft.getPublishDraftProgress({
|
|
262
|
+
project_key: 'project_key',
|
|
263
|
+
work_item_id: 123456,
|
|
264
|
+
draft_id: draft.draft_meta.draft_id,
|
|
265
|
+
publish_order_id: publishResult.publish_order_id,
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
const resetResult = await client.workItem.wbsDraft.resetDraft({
|
|
269
|
+
project_key: 'project_key',
|
|
270
|
+
work_item_id: 123456,
|
|
271
|
+
draft_id: draft.draft_meta.draft_id,
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
const resetProgress = await client.workItem.wbsDraft.getResetDraftProgress({
|
|
275
|
+
project_key: 'project_key',
|
|
276
|
+
work_item_id: 123456,
|
|
277
|
+
draft_id: draft.draft_meta.draft_id,
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
const structure = await client.workItem.wbsDraft.queryStructure({
|
|
281
|
+
project_key: 'project_key',
|
|
282
|
+
work_item_id: 123456,
|
|
283
|
+
draft_id: draft.draft_meta.draft_id,
|
|
284
|
+
});
|
|
285
|
+
|
|
286
|
+
const rowDetails = await client.workItem.wbsDraft.queryRowDetails({
|
|
287
|
+
project_key: 'project_key',
|
|
288
|
+
work_item_id: 123456,
|
|
289
|
+
draft_id: draft.draft_meta.draft_id,
|
|
290
|
+
uuids: ['row_xxx'],
|
|
291
|
+
row_field_marks: ['meta.*', 'base.*'],
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
const rowConfig = await client.workItem.wbsDraft.queryRowConfig({
|
|
295
|
+
project_key: 'project_key',
|
|
296
|
+
work_item_id: 123456,
|
|
297
|
+
draft_id: draft.draft_meta.draft_id,
|
|
298
|
+
uuid: 'row_xxx',
|
|
299
|
+
});
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
## WBS View
|
|
303
|
+
|
|
304
|
+
`WBS View` is a standalone sub-service under `workItem.wbsView`.
|
|
305
|
+
|
|
306
|
+
```ts
|
|
307
|
+
const structure = await client.workItem.wbsView.queryStructure({
|
|
308
|
+
project_key: 'project_key',
|
|
309
|
+
work_item_id: 123456,
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
const rowDetails = await client.workItem.wbsView.queryRowDetails({
|
|
313
|
+
project_key: 'project_key',
|
|
314
|
+
work_item_id: 123456,
|
|
315
|
+
uuids: ['row_xxx'],
|
|
316
|
+
row_field_marks: ['meta.*', 'base.schedule'],
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
const expandInfo = await client.workItem.wbsView.queryExpandInfo({
|
|
320
|
+
project_key: 'project_key',
|
|
321
|
+
work_item_id: 123456,
|
|
322
|
+
work_item_type_key: 'story',
|
|
323
|
+
expand: {
|
|
324
|
+
need_parent_work_item: true,
|
|
325
|
+
need_wbs_relation_chain_entity: true,
|
|
326
|
+
need_wbs_relation_chain_path: true,
|
|
327
|
+
},
|
|
328
|
+
});
|
|
329
|
+
```
|
|
330
|
+
|
|
173
331
|
## Universal Search (Field Select)
|
|
174
332
|
|
|
175
333
|
```ts
|
|
176
334
|
const request = {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
project_key: 'project_key',
|
|
180
|
-
work_item_type_keys: 'story',
|
|
181
|
-
},
|
|
182
|
-
],
|
|
335
|
+
project_key: 'project_key',
|
|
336
|
+
work_item_type_key: 'story',
|
|
183
337
|
search_group: {
|
|
184
338
|
conjunction: 'AND',
|
|
185
339
|
search_params: [{ param_key: 'created_at', value: Date.now() - 86400000, operator: '>' }],
|
|
@@ -213,9 +367,12 @@ Top-level services:
|
|
|
213
367
|
- `view`
|
|
214
368
|
- `measure`
|
|
215
369
|
- `tenant`
|
|
370
|
+
- `event`
|
|
371
|
+
- `aiNode`
|
|
372
|
+
- `aiField`
|
|
216
373
|
|
|
217
374
|
`workItem` sub-services:
|
|
218
|
-
- `search`, `batch`, `comment`, `subtask`, `attachment`, `chat`, `workflow`
|
|
375
|
+
- `search`, `batch`, `comment`, `subtask`, `attachment`, `chat`, `workflow`, `wbsDraft`, `wbsView`, `workHour`, `review`
|
|
219
376
|
|
|
220
377
|
## Tests
|
|
221
378
|
|
package/RELEASE.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Release Protocol
|
|
2
|
+
|
|
3
|
+
This document is the npm release checklist for `meeglesdk`.
|
|
4
|
+
|
|
5
|
+
## Current Release
|
|
6
|
+
|
|
7
|
+
- Package: `meeglesdk`
|
|
8
|
+
- Version: `0.2.0`
|
|
9
|
+
- Registry latest checked before release: `0.1.8`
|
|
10
|
+
- Runtime requirement: Node.js 18+
|
|
11
|
+
- Development runtime: Bun 1.3+
|
|
12
|
+
|
|
13
|
+
## Checklist
|
|
14
|
+
|
|
15
|
+
1. Confirm the registry state:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm view meeglesdk version dist-tags --json
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
2. Keep `package.json` and `package-lock.json` on the same version.
|
|
22
|
+
|
|
23
|
+
3. Run the release gate from `project-oapi-sdk-typescript/`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bun run release:check
|
|
27
|
+
npm pack --dry-run
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
4. Publish with an npm account that has package permission:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm publish --access public
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
5. Verify the registry after publish:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npm view meeglesdk version dist-tags --json
|
|
40
|
+
npm view meeglesdk@0.2.0 dist.tarball
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Notes
|
|
44
|
+
|
|
45
|
+
- If `npm whoami` returns `E401`, run `npm login` or configure an npm token before publishing.
|
|
46
|
+
- `prepublishOnly` runs the release gate automatically during `npm publish`.
|
|
47
|
+
- The npm package includes `dist/`, `CHANGELOG.md`, `RELEASE.md`, and npm's always-included package metadata and README.
|
|
48
|
+
|
package/dist/client.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { MeasureService } from './service/measure/index.js';
|
|
|
18
18
|
import { TenantService } from './service/tenant/tenant.js';
|
|
19
19
|
import { EventService } from './service/event/index.js';
|
|
20
20
|
import { AINodeService } from './service/ainode/index.js';
|
|
21
|
+
import { AIFieldService } from './service/aifield/index.js';
|
|
21
22
|
/**
|
|
22
23
|
* MeegoClient 配置选项
|
|
23
24
|
*/
|
|
@@ -100,6 +101,8 @@ export declare class MeegoClient {
|
|
|
100
101
|
* - subtask: 子任务管理
|
|
101
102
|
* - attachment: 附件管理
|
|
102
103
|
* - chat: 群聊管理
|
|
104
|
+
* - wbsDraft: 计划表草稿
|
|
105
|
+
* - wbsView: 计划表发布态
|
|
103
106
|
*/
|
|
104
107
|
readonly workItem: WorkItemService;
|
|
105
108
|
/**
|
|
@@ -165,6 +168,12 @@ export declare class MeegoClient {
|
|
|
165
168
|
* - confirm: 完成 AI 节点
|
|
166
169
|
*/
|
|
167
170
|
readonly aiNode: AINodeService;
|
|
171
|
+
/**
|
|
172
|
+
* AI 字段服务
|
|
173
|
+
*
|
|
174
|
+
* - update: 回写 AI 字段生成结果
|
|
175
|
+
*/
|
|
176
|
+
readonly aiField: AIFieldService;
|
|
168
177
|
/** Token 管理器 (内部使用) */
|
|
169
178
|
private readonly tokenManager;
|
|
170
179
|
/** 请求处理器 (内部使用) */
|
package/dist/client.js
CHANGED
|
@@ -15,6 +15,7 @@ import { MeasureService } from './service/measure/index.js';
|
|
|
15
15
|
import { TenantService } from './service/tenant/tenant.js';
|
|
16
16
|
import { EventService } from './service/event/index.js';
|
|
17
17
|
import { AINodeService } from './service/ainode/index.js';
|
|
18
|
+
import { AIFieldService } from './service/aifield/index.js';
|
|
18
19
|
/** 默认 API 基础 URL */
|
|
19
20
|
const DEFAULT_BASE_URL = 'https://project.feishu.cn';
|
|
20
21
|
/** 默认超时 30 秒 */
|
|
@@ -57,6 +58,8 @@ export class MeegoClient {
|
|
|
57
58
|
* - subtask: 子任务管理
|
|
58
59
|
* - attachment: 附件管理
|
|
59
60
|
* - chat: 群聊管理
|
|
61
|
+
* - wbsDraft: 计划表草稿
|
|
62
|
+
* - wbsView: 计划表发布态
|
|
60
63
|
*/
|
|
61
64
|
workItem;
|
|
62
65
|
/**
|
|
@@ -122,6 +125,12 @@ export class MeegoClient {
|
|
|
122
125
|
* - confirm: 完成 AI 节点
|
|
123
126
|
*/
|
|
124
127
|
aiNode;
|
|
128
|
+
/**
|
|
129
|
+
* AI 字段服务
|
|
130
|
+
*
|
|
131
|
+
* - update: 回写 AI 字段生成结果
|
|
132
|
+
*/
|
|
133
|
+
aiField;
|
|
125
134
|
/** Token 管理器 (内部使用) */
|
|
126
135
|
tokenManager;
|
|
127
136
|
/** 请求处理器 (内部使用) */
|
|
@@ -172,6 +181,7 @@ export class MeegoClient {
|
|
|
172
181
|
this.tenant = new TenantService(this.requestHandler);
|
|
173
182
|
this.event = new EventService(this.requestHandler);
|
|
174
183
|
this.aiNode = new AINodeService(this.requestHandler);
|
|
184
|
+
this.aiField = new AIFieldService(this.requestHandler);
|
|
175
185
|
this.logger.info('MeegoClient initialized', {
|
|
176
186
|
baseURL: this.options.baseURL,
|
|
177
187
|
pluginId: this.options.pluginId,
|
|
@@ -51,6 +51,7 @@ export class BaseService {
|
|
|
51
51
|
pathParams: options?.pathParams,
|
|
52
52
|
query: options?.query,
|
|
53
53
|
auth: options?.auth,
|
|
54
|
+
headers: options?.headers,
|
|
54
55
|
idempotencyKey: options?.idempotencyKey,
|
|
55
56
|
timeout: options?.timeout,
|
|
56
57
|
skipRetry: options?.skipRetry,
|
|
@@ -69,6 +70,7 @@ export class BaseService {
|
|
|
69
70
|
pathParams: options?.pathParams,
|
|
70
71
|
query: options?.query,
|
|
71
72
|
auth: options?.auth,
|
|
73
|
+
headers: options?.headers,
|
|
72
74
|
timeout: options?.timeout,
|
|
73
75
|
skipRetry: options?.skipRetry,
|
|
74
76
|
retry: options?.retry,
|
|
@@ -87,6 +89,7 @@ export class BaseService {
|
|
|
87
89
|
pathParams: options?.pathParams,
|
|
88
90
|
query: options?.query,
|
|
89
91
|
auth: options?.auth,
|
|
92
|
+
headers: options?.headers,
|
|
90
93
|
idempotencyKey: options?.idempotencyKey,
|
|
91
94
|
timeout: options?.timeout,
|
|
92
95
|
skipRetry: options?.skipRetry,
|
|
@@ -106,6 +109,7 @@ export class BaseService {
|
|
|
106
109
|
pathParams: options?.pathParams,
|
|
107
110
|
query: options?.query,
|
|
108
111
|
auth: options?.auth,
|
|
112
|
+
headers: options?.headers,
|
|
109
113
|
idempotencyKey: options?.idempotencyKey,
|
|
110
114
|
timeout: options?.timeout,
|
|
111
115
|
skipRetry: options?.skipRetry,
|
|
@@ -124,6 +128,7 @@ export class BaseService {
|
|
|
124
128
|
pathParams: options?.pathParams,
|
|
125
129
|
query: options?.query,
|
|
126
130
|
auth: options?.auth,
|
|
131
|
+
headers: options?.headers,
|
|
127
132
|
timeout: options?.timeout,
|
|
128
133
|
skipRetry: options?.skipRetry,
|
|
129
134
|
retry: options?.retry,
|
|
@@ -142,6 +147,7 @@ export class BaseService {
|
|
|
142
147
|
pathParams: options?.pathParams,
|
|
143
148
|
query: options?.query,
|
|
144
149
|
auth: options?.auth,
|
|
150
|
+
headers: options?.headers,
|
|
145
151
|
idempotencyKey: options?.idempotencyKey,
|
|
146
152
|
timeout: options?.timeout,
|
|
147
153
|
skipRetry: options?.skipRetry,
|
|
@@ -159,6 +165,7 @@ export class BaseService {
|
|
|
159
165
|
pathParams: options?.pathParams,
|
|
160
166
|
query: options?.query,
|
|
161
167
|
auth: options?.auth,
|
|
168
|
+
headers: options?.headers,
|
|
162
169
|
timeout: options?.timeout,
|
|
163
170
|
skipRetry: options?.skipRetry,
|
|
164
171
|
retry: options?.retry,
|
|
@@ -176,6 +183,7 @@ export class BaseService {
|
|
|
176
183
|
pathParams: options?.pathParams,
|
|
177
184
|
query: options?.query,
|
|
178
185
|
auth: options?.auth,
|
|
186
|
+
headers: options?.headers,
|
|
179
187
|
idempotencyKey: options?.idempotencyKey,
|
|
180
188
|
timeout: options?.timeout,
|
|
181
189
|
skipRetry: options?.skipRetry,
|
|
@@ -194,6 +202,7 @@ export class BaseService {
|
|
|
194
202
|
pathParams: options?.pathParams,
|
|
195
203
|
query: options?.query,
|
|
196
204
|
auth: options?.auth,
|
|
205
|
+
headers: options?.headers,
|
|
197
206
|
timeout: options?.timeout,
|
|
198
207
|
skipRetry: options?.skipRetry,
|
|
199
208
|
retry: options?.retry,
|
|
@@ -211,6 +220,7 @@ export class BaseService {
|
|
|
211
220
|
pathParams: options?.pathParams,
|
|
212
221
|
query: options?.query,
|
|
213
222
|
auth: options?.auth,
|
|
223
|
+
headers: options?.headers,
|
|
214
224
|
idempotencyKey: options?.idempotencyKey,
|
|
215
225
|
timeout: options?.timeout,
|
|
216
226
|
skipRetry: options?.skipRetry,
|
|
@@ -228,6 +238,7 @@ export class BaseService {
|
|
|
228
238
|
pathParams: options?.pathParams,
|
|
229
239
|
query: options?.query,
|
|
230
240
|
auth: options?.auth,
|
|
241
|
+
headers: options?.headers,
|
|
231
242
|
idempotencyKey: options?.idempotencyKey,
|
|
232
243
|
timeout: options?.timeout,
|
|
233
244
|
skipRetry: options?.skipRetry,
|
|
@@ -244,6 +255,7 @@ export class BaseService {
|
|
|
244
255
|
pathParams: options.pathParams,
|
|
245
256
|
file: options.file,
|
|
246
257
|
fileName: options.fileName,
|
|
258
|
+
mimeType: options.mimeType,
|
|
247
259
|
fieldName: options.fieldName,
|
|
248
260
|
formFields: options.formFields,
|
|
249
261
|
auth: options.auth,
|
|
@@ -167,10 +167,11 @@ export class RequestHandler {
|
|
|
167
167
|
* 构建请求上下文
|
|
168
168
|
*/
|
|
169
169
|
async prepareRequest(config) {
|
|
170
|
-
const { method, path, pathParams, query, body, auth, idempotencyKey, signal } = config;
|
|
170
|
+
const { method, path, pathParams, query, body, auth, headers: customHeaders, idempotencyKey, signal, } = config;
|
|
171
171
|
const resolvedPath = resolvePath(path, pathParams);
|
|
172
172
|
const url = buildUrl(this.baseURL, resolvedPath, query);
|
|
173
|
-
const
|
|
173
|
+
const authHeaders = await this.authBuilder.buildHeaders(auth, idempotencyKey);
|
|
174
|
+
const headers = { ...authHeaders, ...customHeaders };
|
|
174
175
|
const rateLimitContext = this.rateLimitManager
|
|
175
176
|
? { token: headers['X-Plugin-Token'], method, path: resolvedPath }
|
|
176
177
|
: undefined;
|
package/dist/helpers/event.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare function verifyEventSignatureSync(params: VerifySignatureParams):
|
|
|
76
76
|
* @param eventType - 事件类型编码
|
|
77
77
|
* @returns 事件分类名称
|
|
78
78
|
*/
|
|
79
|
-
export declare function getEventCategory(eventType: EventType): 'workitem' | 'node' | 'status' | 'subtask' | 'space' | 'plugin' | 'unknown';
|
|
79
|
+
export declare function getEventCategory(eventType: EventType): 'workitem' | 'node' | 'status' | 'subtask' | 'space' | 'plugin' | 'ai_node' | 'ai_field' | 'unknown';
|
|
80
80
|
/**
|
|
81
81
|
* 获取事件类型名称
|
|
82
82
|
*
|
package/dist/helpers/event.js
CHANGED
|
@@ -109,6 +109,10 @@ export function getEventCategory(eventType) {
|
|
|
109
109
|
return 'space';
|
|
110
110
|
if (eventType >= 6001 && eventType <= 6004)
|
|
111
111
|
return 'plugin';
|
|
112
|
+
if (eventType >= 8001 && eventType <= 8006)
|
|
113
|
+
return 'ai_node';
|
|
114
|
+
if (eventType >= 8101 && eventType <= 8102)
|
|
115
|
+
return 'ai_field';
|
|
112
116
|
return 'unknown';
|
|
113
117
|
}
|
|
114
118
|
/**
|
|
@@ -162,6 +166,16 @@ export function getEventName(eventType) {
|
|
|
162
166
|
6002: '插件卸载',
|
|
163
167
|
6003: '插件更新',
|
|
164
168
|
6004: '插件购买',
|
|
169
|
+
// AI 节点事件
|
|
170
|
+
8001: 'AI 节点状态变更',
|
|
171
|
+
8002: 'AI 节点属性变更',
|
|
172
|
+
8003: 'AI 节点完成',
|
|
173
|
+
8004: 'AI 节点回滚',
|
|
174
|
+
8005: 'AI 节点删除',
|
|
175
|
+
8006: 'AI 节点冻结',
|
|
176
|
+
// AI 字段事件
|
|
177
|
+
8101: 'AI 字段计算',
|
|
178
|
+
8102: 'AI 字段预览',
|
|
165
179
|
};
|
|
166
180
|
return eventNames[eventType] || `未知事件(${eventType})`;
|
|
167
181
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -47,28 +47,32 @@ export { SubtaskService } from './service/workitem/subtask.js';
|
|
|
47
47
|
export { AttachmentService } from './service/workitem/attachment.js';
|
|
48
48
|
export { ChatService } from './service/workitem/chat.js';
|
|
49
49
|
export { WorkflowService } from './service/workitem/workflow.js';
|
|
50
|
+
export { WbsDraftService } from './service/workitem/wbsDraft.js';
|
|
51
|
+
export { WbsViewService } from './service/workitem/wbsView.js';
|
|
50
52
|
export { WorkHourService } from './service/workitem/workhour.js';
|
|
51
53
|
export { ReviewService } from './service/workitem/review.js';
|
|
52
54
|
export { EventService, InterceptConfigService } from './service/event/index.js';
|
|
53
55
|
export { AINodeService } from './service/ainode/index.js';
|
|
56
|
+
export { AIFieldService } from './service/aifield/index.js';
|
|
54
57
|
export { withAuth, withUserKey, withUserToken, withPluginToken } from './helpers/auth.js';
|
|
55
58
|
export { parseDocImages, extractImagesFromMultiTexts, inferImageMimeType, type RichTextImage, } from './helpers/richtext.js';
|
|
56
59
|
export { calculateEventSignature, verifyEventSignature, calculateEventSignatureSync, verifyEventSignatureSync, getEventCategory, getEventName, isListenEvent, isInterceptEvent, createInterceptResponse, } from './helpers/event.js';
|
|
57
60
|
export type { QueryWorkItemOptions } from './service/workitem/workItem.js';
|
|
58
|
-
export type { Logger, ApiResponse, AuthApiResponse, ErrorDetail, PaginationParams, SearchAfterPagination, SearchAfterPaginatedResult, PagedWorkItemIds, FieldValuePair, TargetState, FieldConf, DefaultValue, OptionConf, RoleAssign, SimpleField, Option, FieldValue, RoleOwner, Schedule, TimeInterval, ExpandParams, UserDetail, Connection, MultiText, MultiTextDetail, RichText, } from './types/common.js';
|
|
59
|
-
export type { UserStatus, UserNameMap, UserInfo, GetUserDetailRequest, SearchUsersRequest, UserGroupType, CreateUserGroupRequest, CreateUserGroupResponse, UpdateUserGroupMembersRequest, QueryUserGroupMembersRequest, UserGroupInfo, UserGroupMembersPage, } from './types/user.js';
|
|
60
|
-
export type { FlowMode, RoleInfo, ResourceLibSetting, WorkItemTypeBasicConfig, UpdateWorkItemTypeConfigRequest, FieldAllRequest, TeamDataScope, TeamOption, CreateCustomFieldRequest, UpdateCustomFieldRequest, RelationDetail, WorkItemRelation, CreateWorkItemRelationRequest, CreateWorkItemRelationResponse, UpdateWorkItemRelationRequest, DeleteWorkItemRelationRequest, RoleAppearMode, MemberAssignMode, FlowRoleInfo, FlowRoleRequest, CreateFlowRoleRequest, UpdateFlowRoleRequest, DeleteFlowRoleRequest, TaskConf, WorkflowConf, StateFlowConf, TemplateConf, TemplateDetail, TemplateCreateRequest, TemplateCreateResponse, TemplateUpdateRequest, TemplateOperateRequest, ResourceQueryRequest, ResourceWorkItemDetail, ResourceQueryResponse, ResourceCreateRequest, ResourceCreateResponse, ResourceUpdateRequest, ResourceCreateInstanceRequest, ResourceCreateInstanceResponseData, ResourceSearchDataSource, ResourceSearchPaginationRequest, ResourceSearchPagination, ResourceOperateRequest, ResourceSearchParamsRequest, ResourceSearchParamsResponse, } from './types/config.js';
|
|
61
|
+
export type { Logger, ApiResponse, AuthApiResponse, ErrorDetail, PaginationParams, SearchAfterPagination, SearchAfterPaginatedResult, PagedWorkItemIds, FieldUpdateMode, FieldValuePair, TargetState, FieldConf, DefaultValue, OptionConf, RoleAssign, SimpleField, Option, FieldValue, RoleOwner, Schedule, TimeInterval, ExpandParams, UserDetail, Connection, MultiText, MultiTextDetail, RichText, } from './types/common.js';
|
|
62
|
+
export type { UserStatus, UserNameMap, UserInfo, GetUserDetailRequest, SearchUsersRequest, UserGroupType, MutableUserGroupType, CreateUserGroupRequest, CreateUserGroupResponse, UpdateUserGroupMembersRequest, QueryUserGroupMembersRequest, UserGroupInfo, UserGroupMembersPage, } from './types/user.js';
|
|
63
|
+
export type { FlowMode, RoleInfo, ResourceLibSetting, WorkItemTypeBasicConfig, UpdateWorkItemTypeConfigRequest, FieldAllRequest, TeamDataScope, TeamOption, NumberSymbolSetting, NumberConfig, CreateCustomFieldRequest, UpdateCustomFieldRequest, RelationDetail, WorkItemRelation, CreateWorkItemRelationRequest, CreateWorkItemRelationResponse, UpdateWorkItemRelationRequest, DeleteWorkItemRelationRequest, RoleAppearMode, MemberAssignMode, FlowRoleWritableMemberAssignMode, RoleLockScope, FlowRoleInfo, FlowRoleRequest, FlowRoleUpdateRequest, CreateFlowRoleRequest, UpdateFlowRoleRequest, DeleteFlowRoleRequest, TemplateAction, TemplateDisabled, WorkflowOwnerUsageMode, WorkflowVisibilityUsageMode, WorkflowPassMode, WorkflowTaskPassMode, WorkflowTaskRequiredMode, StateFlowStateType, TaskConf, WorkflowSubWorkItem, WorkflowSubTask, WorkflowConf, StateFlowConf, TemplateConf, TemplateDetail, TemplateCreateRequest, TemplateCreateResponse, TemplateUpdateRequest, TemplateOperateRequest, ResourceId, ResourceUserDetail, ResourceQueryRequest, ResourceTemplateInfo, ResourceRoleOwner, ResourceWorkItemDetail, ResourceQueryResponse, ResourceCreateRequest, ResourceCreateResponse, ResourceUpdateRequest, ResourceCreateInstanceRequest, ResourceCreateInstanceResponseData, ResourceSearchDataSource, ResourceSearchPaginationRequest, ResourceSearchPagination, ResourceOperateRequest, ResourceSearchParamsRequest, ResourceSearchParamsResponse, } from './types/config.js';
|
|
61
64
|
export type { TenantInfo, GetTenantInfoRequest, TenantEntitlement, GetTenantEntitlementRequest, TenantInstallProjectsResponse, TenantProductInfo, TenantProductPrice, TenantRichText, } from './types/tenant.js';
|
|
62
|
-
export type { ViewType, ViewSystemFlag, ViewAuthStatus, ViewCooperationMode, ViewQuickFilter, ViewCreatedAtRange, ViewConfListRequest, ViewConfInfo, FixViewInfo, FixViewQueryParams, PanoramicViewQueryParams, CreateFixViewRequest, UpdateFixViewRequest, CreateConditionViewRequest, UpdateConditionViewRequest, CreateConditionViewResponse, } from './types/view.js';
|
|
63
|
-
export type { MeasureChartDataItem, MeasureChartData, MeasureChartsByViewRequest, MeasureChartSummary, MeasureChartsPagination, MeasureChartsByViewData, } from './types/measure.js';
|
|
65
|
+
export type { ViewType, ViewSystemFlag, ViewAuthStatus, ViewCooperationMode, ViewQuickFilter, ViewCreatedAtRange, ViewConfListRequest, SearchViewByTitleRequest, ViewConfInfo, FixViewInfo, FixViewQueryParams, PanoramicViewQueryParams, CreateFixViewRequest, UpdateFixViewRequest, CreateConditionViewRequest, UpdateConditionViewRequest, CreateConditionViewResponse, } from './types/view.js';
|
|
66
|
+
export type { MeasureChartDataItem, MeasureChartData, MeasureChartsByViewRequest, MeasureChartsByViewPageOptions, MeasureChartSummary, MeasureChartsPagination, MeasureChartsByViewData, } from './types/measure.js';
|
|
64
67
|
export type { ListProjectsRequest, GetProjectDetailRequest, ProjectDetail, ProjectDetailMap, BusinessLine, WorkItemTypeInfo, TeamInfo, RelationRulesRequest, ProjectRelationRule, RelationRule, RelationWorkItemListRequest, RelationInstance, BindRelationRequest, UnbindRelationRequest, } from './types/space.js';
|
|
65
|
-
export type { SearchGroup, SearchParam, SearchOperator, SearchUser, SearchConjunction, PreOperator,
|
|
66
|
-
export type { WorkItemPattern, WorkItemStatus, WorkItemStatusHistory, StateTime, CurrentNode, WorkflowNode, WorkflowInfo, WorkItem, WorkItemInfo, QueryWorkItemExpand, QueryWorkItemRequest, CreateWorkItemRequest, UpdateWorkItemRequest, GetWorkItemMetaResponse, GetOperationRecordsRequest, GetOperationRecordsResponse,
|
|
67
|
-
export type { WorkHourResourceType, CreateWorkingHourRecord, CreateWorkHourRecordRequest, UpdateWorkingHourRecord, UpdateWorkHourRecordRequest, DeleteWorkHourRecordRequest, ListWorkHourRecordsRequest, WorkHourRecord, ReviewConclusionOptionItem, ReviewOwnerOpinionInfo, ReviewOpinionInfo, ReviewOwnerConclusionInfo, ReviewConclusionInfo, ReviewFinishedInfoItem, ReviewBatchQueryRequest, ReviewBatchQueryResponse, ReviewConclusionOptionRequest, ReviewConclusionOption, UpdateReviewRequest, WorkItemWithImages, } from './types/workitem.js';
|
|
68
|
+
export type { SearchGroup, SearchParam, SearchOperator, SearchUser, SearchConjunction, PreOperator, UniversalSearchPaginationRequest, UniversalSearchPagination, FilterWorkItemsRequest, FilterWorkItemsAcrossProjectRequest, SearchWorkItemsByParamsRequest, SearchByRelationRequest, CompositiveSearchRequest, UniversalSearchRequest, UniversalSearchResponse, } from './types/workitem.js';
|
|
69
|
+
export type { WorkItemPattern, NodeStatus, OwnerUsageMode, WorkItemStatus, WorkItemStatusHistory, StateTime, CurrentNode, WorkflowNode, StateFlowNode, WorkflowInfo, WorkItem, WorkItemInfo, QueryWorkItemExpand, QueryWorkItemRequest, WorkItemCreateRequiredMode, WorkItemCreateRoleMode, CreateWorkItemRequest, UpdateWorkItemRequest, FreezeWorkItemRequest, GetWorkItemMetaResponse, GetOperationRecordsRequest, GetOperationRecordsResponse, GetFieldOptionsRequest, GetFieldOptionsResponse, UpdateCompoundFieldValueRequest, WbsViewQueryParams, WbsViewExpand, WbsViewRequest, WbsViewRelatedSubWorkItem, WbsViewResponse, QueryWbsDraftRequest, CreateWbsDraftRequest, CreateWbsDraftResponse, ResetWbsDraftRequest, ResetWbsDraftResponse, PublishWbsDraftRequest, PublishWbsDraftResponse, CompleteCreateAuditDraftRequest, UpdateWbsDraftFrozenRowsRequest, PublishWbsDraftByCommitRequest, SwitchBackWbsDraftRequest, CreateWbsDraftProgressRequest, CreateWbsDraftProgressResponse, PatchWbsDraftProgressRequest, PatchWbsDraftProgressResponse, PublishWbsDraftProgressRequest, PublishWbsDraftProgressResponse, ResetWbsDraftProgressRequest, ResetWbsDraftProgressResponse, WbsDraftCurrentRow, WbsDraftStructure, WbsRowFieldMark, QueryWbsDraftStructureRequest, QueryWbsDraftStructureResponse, WbsDraftRowDetail, WbsDraftRowDetailMeta, WbsDraftRowDetailBase, WbsRowDetailType, WbsOwnerAssignType, WbsOwnerCandidateScopeType, WbsScheduleDependencyType, WbsDependencyType, WbsDependencySourceType, WbsProcessStatus, WbsSubInstanceDismantleMode, WbsRelationChainItemType, QueryWbsDraftRowDetailRequest, QueryWbsDraftRowDetailResponse, WbsDraftTaskConf, WbsDraftTaskConfWorkItemTypeInfo, QueryWbsDraftRowConfigRequest, QueryWbsDraftRowConfigResponse, QueryWbsViewStructureRequest, QueryWbsViewStructureResponse, QueryWbsViewRowDetailRequest, QueryWbsViewRowDetailResponse, QueryWbsInstanceExpand, QueryWbsInstanceExpandInfoRequest, QueryWbsInstanceExpandInfoResponse, GetWbsDraftSubWorkItemConfRequest, WbsDraft, WbsDraftWorkItem, WbsDraftOwnerConf, WbsDraftNodeRoleOwners, WbsDraftUnionDeliverable, WbsDraftFieldDeliverableItem, WbsDraftInstanceDeliverableItem, WbsDraftDependencyInfo, WbsDraftScheduleReferenceValue, WbsDraftOrderInfo, WbsDraftSeqOrderInfo, WbsDraftSubWorkItemConf, WbsDraftSubWorkItemConfRelation, PatchWbsDraftRequest, PatchWbsDraftResponse, WbsDraftSuccessResponse, WbsDraftOperation, WbsDraftPatchOperationValue, WbsDraftAssigneeType, WbsDraftValueRef, WbsDraftScheduleDateRange, WbsDraftAssigneeSchedule, WbsDraftAssigneeActualTime, WbsDraftWholeSchedule, WbsDraftActualTime, WbsDraftRoleOwnersValue, WbsDraftFieldDeliverableValue, WbsDraftInstanceDeliverableValue, TransitionRequiredInfoRequest, TransitionRequiredInfo, FlowType, WorkflowQueryExpand, WorkflowQueryRequest, StateChangeRequest, NodeOperateRequest, ScheduleConstraintRule, UpdateNodeRequest, BatchUpdateRequest, BatchUpdateResponse, DeliverableBatchQueryRequest, BotJoinChatRequest, UploadAttachmentRequest, UploadFileRequest, DownloadAttachmentRequest, DeleteAttachmentFieldSelector, DeleteAttachmentRequest, CreateSubtaskRequest, UpdateSubtaskRequest, CompleteRollbackSubtaskRequest, SubtaskStatus, SubTask, NodeTask, GetSubtasksQuery, SearchSubtasksRequest, Comment, CommentRichText, RichTextAttrs, RichTextLineAttrs, RichTextTableCell, RichTextTableInfo, RichTextElement, CommentContentRequest, CreateCommentRequest, UpdateCommentRequest, ListCommentsQuery, } from './types/workitem.js';
|
|
70
|
+
export type { WorkHourResourceType, CreateWorkingHourRecord, CreateWorkHourRecordRequest, UpdateWorkingHourRecord, UpdateWorkHourRecordRequest, DeleteWorkHourRecordRequest, ListWorkHourRecordsRequest, WorkHourRecord, ReviewConclusionOptionItem, ReviewOwnerOpinionInfo, ReviewOpinionInfo, ReviewOwnerConclusionInfo, ReviewSummaryMode, ReviewConclusionInfo, ReviewFinishedInfoItem, ReviewBatchQueryRequest, ReviewBatchQueryResponse, ReviewConclusionOptionRequest, ReviewConclusionOption, ReviewOperationType, UpdateReviewRequest, WorkItemWithImages, } from './types/workitem.js';
|
|
68
71
|
export type { GetPluginTokenRequest, GetPluginTokenResponseData, GetUserTokenRequest, GetUserTokenResponseData, RefreshUserTokenRequest, RefreshUserTokenResponseData, UserTokenInput, TokenInfo, TokenType, } from './types/auth.js';
|
|
69
|
-
export type { AINodeStatus, AINodeField, AINodePropValue, AINodeProp, AINodeAppIdentity, AINodeInfo, AINodeSubTask, AINodeSubWorkItem, AINodeQueryRequest, AINodeEditRequest, AINodeEditField, AINodeConfirmRequest, AINodeQueryResponse, } from './types/ainode.js';
|
|
72
|
+
export type { AINodeStatus, AINodeNodeState, AINodeFieldValue, AINodeField, AINodeCustomPropertyType, AINodeCustomProperty, AINodePropValue, AINodeProp, AINodeAppIdentity, AINodeInfo, AINodeSubTask, AINodeSubWorkItem, AINodeLocator, AINodeQueryRequestBase, AINodeQueryRequest, AINodeEditRequestBase, AINodeEditRequest, AINodeEditField, AINodeConfirmRequestBase, AINodeConfirmRequest, AINodeQueryResponse, } from './types/ainode.js';
|
|
70
73
|
export { AINodeRunningState } from './types/ainode.js';
|
|
71
|
-
export type { EventSource, EventType, WorkItemEventType, NodeEventType, StatusEventType, SubtaskEventType, SpaceEventType, PluginEventType, EventUserInfo, EventWorkItemInfo, EventFieldChange, EventNodeInfo, EventSubtaskInfo, ListenEventBase, ListenEventDataBase, WorkItemEventData, WorkItemListenEvent, NodeEventData, NodeListenEvent, StatusEventData, StatusListenEvent, SubtaskEventData, SubtaskListenEvent, SpaceMemberEventData, SpaceListenEvent, PluginInstallChannel, PluginBuyType, PluginInstallEventData, PluginUninstallEventData, PluginUpdateEventData, PluginPurchaseEventData, PluginEventData, PluginListenEvent, ListenEventData, ListenEvent, InterceptEventBase, InterceptEventDataBase, InterceptEvent, InterceptResponseMessage, InterceptResponseOptions, InterceptResponse, NodeInterceptConfig, StateInterceptConfig, WorkItemInterceptConfig, ProjectInterceptConfig, CreateInterceptConfigRequest, InterceptConfigListResponse, VerifySignatureParams, } from './types/event.js';
|
|
74
|
+
export type { EventSource, EventType, WorkItemEventType, NodeEventType, StatusEventType, SubtaskEventType, SpaceEventType, PluginEventType, AINodeEventType, AIFieldEventType, EventUserInfo, EventWorkItemInfo, EventFieldChange, EventNodeInfo, EventSubtaskInfo, ListenEventBase, ListenEventDataBase, WorkItemEventData, WorkItemListenEvent, NodeEventData, NodeListenEvent, StatusEventData, StatusListenEvent, SubtaskEventData, SubtaskListenEvent, SpaceMemberEventData, SpaceListenEvent, PluginInstallChannel, PluginBuyType, PluginInstallEventData, PluginUninstallEventData, PluginUpdateEventData, PluginPurchaseEventData, PluginEventData, PluginListenEvent, AINodeEntityInfo, AINodeChangeInfo, AINodeEventNodeInfo, AINodeOperationInfo, AINodeEventData, AINodeListenEvent, AIFieldCustomPropertyType, AIFieldCustomProperty, AIFieldReferenceValue, AIFieldReferenceChange, AIFieldEntity, AIFieldEventData, AIFieldListenEvent, ListenEventData, ListenEvent, InterceptEventBase, InterceptEventDataBase, InterceptEvent, InterceptResponseMessage, InterceptResponseOptions, InterceptResponse, NodeInterceptConfig, StateInterceptConfig, WorkItemInterceptConfig, ProjectInterceptConfig, CreateInterceptConfigRequest, InterceptConfigListResponse, VerifySignatureParams, } from './types/event.js';
|
|
75
|
+
export type { AIFieldValue, AIFieldUpdateRequest, } from './types/aifield.js';
|
|
72
76
|
export type { RequestConfig, RetryConfig, HttpMethod, AuthContext, AuthMode, DownloadProgress, ResponseValidator, } from './core/request/index.js';
|
|
73
77
|
export type { ServiceRequestOptions, UploadRequestOptions, DownloadOptions } from './core/base-service.js';
|
|
74
78
|
export type { TokenManagerOptions } from './core/token-manager.js';
|
package/dist/index.js
CHANGED
|
@@ -49,10 +49,13 @@ export { SubtaskService } from './service/workitem/subtask.js';
|
|
|
49
49
|
export { AttachmentService } from './service/workitem/attachment.js';
|
|
50
50
|
export { ChatService } from './service/workitem/chat.js';
|
|
51
51
|
export { WorkflowService } from './service/workitem/workflow.js';
|
|
52
|
+
export { WbsDraftService } from './service/workitem/wbsDraft.js';
|
|
53
|
+
export { WbsViewService } from './service/workitem/wbsView.js';
|
|
52
54
|
export { WorkHourService } from './service/workitem/workhour.js';
|
|
53
55
|
export { ReviewService } from './service/workitem/review.js';
|
|
54
56
|
export { EventService, InterceptConfigService } from './service/event/index.js';
|
|
55
57
|
export { AINodeService } from './service/ainode/index.js';
|
|
58
|
+
export { AIFieldService } from './service/aifield/index.js';
|
|
56
59
|
// Auth helper options
|
|
57
60
|
export { withAuth, withUserKey, withUserToken, withPluginToken } from './helpers/auth.js';
|
|
58
61
|
// Rich text helper functions
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI 字段服务
|
|
3
|
+
*/
|
|
4
|
+
import { BaseService, type ServiceRequestOptions } from '../../core/base-service.js';
|
|
5
|
+
import type { AIFieldUpdateRequest } from '../../types/aifield.js';
|
|
6
|
+
/** API 路径 */
|
|
7
|
+
export declare const API_PATHS: {
|
|
8
|
+
/** 更新 AI 字段 */
|
|
9
|
+
UPDATE: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* AI 字段服务
|
|
13
|
+
*
|
|
14
|
+
* 提供 AI 字段生成结果回写能力。
|
|
15
|
+
*/
|
|
16
|
+
export declare class AIFieldService extends BaseService {
|
|
17
|
+
/**
|
|
18
|
+
* 更新 AI 字段
|
|
19
|
+
*
|
|
20
|
+
* @param request 请求参数
|
|
21
|
+
* @param request.ai_task_id AI 任务 ID
|
|
22
|
+
* @param request.field_value 回写到 AI 字段的值
|
|
23
|
+
* @param options 请求选项
|
|
24
|
+
*/
|
|
25
|
+
update(request: AIFieldUpdateRequest, options?: ServiceRequestOptions<void>): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI 字段服务
|
|
3
|
+
*/
|
|
4
|
+
import { BaseService } from '../../core/base-service.js';
|
|
5
|
+
/** API 路径 */
|
|
6
|
+
export const API_PATHS = {
|
|
7
|
+
/** 更新 AI 字段 */
|
|
8
|
+
UPDATE: '/open_api/ai_application_field/update',
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* AI 字段服务
|
|
12
|
+
*
|
|
13
|
+
* 提供 AI 字段生成结果回写能力。
|
|
14
|
+
*/
|
|
15
|
+
export class AIFieldService extends BaseService {
|
|
16
|
+
/**
|
|
17
|
+
* 更新 AI 字段
|
|
18
|
+
*
|
|
19
|
+
* @param request 请求参数
|
|
20
|
+
* @param request.ai_task_id AI 任务 ID
|
|
21
|
+
* @param request.field_value 回写到 AI 字段的值
|
|
22
|
+
* @param options 请求选项
|
|
23
|
+
*/
|
|
24
|
+
async update(request, options) {
|
|
25
|
+
await this.put(API_PATHS.UPDATE, request, options);
|
|
26
|
+
}
|
|
27
|
+
}
|