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
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 100% 参考 Meego API 文档
|
|
4
4
|
*/
|
|
5
5
|
import { BaseService, type ServiceRequestOptions } from '../../core/base-service.js';
|
|
6
|
-
import type { ResourceQueryRequest, ResourceWorkItemDetail, ResourceCreateRequest, ResourceCreateResponse, ResourceUpdateRequest, ResourceCreateInstanceRequest, ResourceCreateInstanceResponseData, ResourceSearchParamsRequest, ResourceSearchParamsResponse } from '../../types/config.js';
|
|
6
|
+
import type { ResourceQueryRequest, ResourceWorkItemDetail, ResourceCreateRequest, ResourceCreateResponse, ResourceUpdateRequest, ResourceCreateInstanceRequest, ResourceCreateInstanceResponseData, ResourceSearchParamsRequest, ResourceSearchParamsResponse, ResourceId } from '../../types/config.js';
|
|
7
7
|
/** API 路径常量 */
|
|
8
8
|
export declare const API_PATHS: {
|
|
9
9
|
CREATE_RESOURCE_WORK_ITEM: string;
|
|
@@ -45,7 +45,7 @@ export declare class ConfigResourceService extends BaseService {
|
|
|
45
45
|
* @param options 请求选项
|
|
46
46
|
* @returns 查询结果
|
|
47
47
|
*/
|
|
48
|
-
searchByParams(request: ResourceSearchParamsRequest, options?: ServiceRequestOptions<
|
|
48
|
+
searchByParams(request: ResourceSearchParamsRequest, options?: ServiceRequestOptions<ResourceWorkItemDetail>): Promise<ResourceSearchParamsResponse>;
|
|
49
49
|
/**
|
|
50
50
|
* 通过资源创建实例
|
|
51
51
|
*
|
|
@@ -54,5 +54,5 @@ export declare class ConfigResourceService extends BaseService {
|
|
|
54
54
|
* @param request 创建请求
|
|
55
55
|
* @param options 请求选项
|
|
56
56
|
*/
|
|
57
|
-
createInstanceFromResource(projectKey: string, workItemId:
|
|
57
|
+
createInstanceFromResource(projectKey: string, workItemId: ResourceId, request: ResourceCreateInstanceRequest, options?: ServiceRequestOptions<ResourceCreateInstanceResponseData>): Promise<ResourceCreateInstanceResponseData>;
|
|
58
58
|
}
|
|
@@ -51,7 +51,11 @@ export class ConfigResourceService extends BaseService {
|
|
|
51
51
|
* @returns 查询结果
|
|
52
52
|
*/
|
|
53
53
|
async searchByParams(request, options) {
|
|
54
|
-
|
|
54
|
+
const result = await this.postCursorPaginated(API_PATHS.SEARCH_RESOURCE_PARAMS, request, options, 'data');
|
|
55
|
+
return {
|
|
56
|
+
data: result.data,
|
|
57
|
+
pagination: result.pagination,
|
|
58
|
+
};
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
61
|
* 通过资源创建实例
|
|
@@ -31,8 +31,9 @@ export declare class ConfigRoleService extends BaseService {
|
|
|
31
31
|
* @param workItemTypeKey 工作项类型 key
|
|
32
32
|
* @param request 创建请求
|
|
33
33
|
* @param options 请求选项
|
|
34
|
+
* @returns 角色 ID
|
|
34
35
|
*/
|
|
35
|
-
create(projectKey: string, workItemTypeKey: string, request: CreateFlowRoleRequest, options?: ServiceRequestOptions<
|
|
36
|
+
create(projectKey: string, workItemTypeKey: string, request: CreateFlowRoleRequest, options?: ServiceRequestOptions<string>): Promise<string>;
|
|
36
37
|
/**
|
|
37
38
|
* 更新流程角色
|
|
38
39
|
*
|
|
@@ -39,9 +39,10 @@ export class ConfigRoleService extends BaseService {
|
|
|
39
39
|
* @param workItemTypeKey 工作项类型 key
|
|
40
40
|
* @param request 创建请求
|
|
41
41
|
* @param options 请求选项
|
|
42
|
+
* @returns 角色 ID
|
|
42
43
|
*/
|
|
43
44
|
async create(projectKey, workItemTypeKey, request, options) {
|
|
44
|
-
|
|
45
|
+
return this.post(API_PATHS.CREATE_ROLE, request, {
|
|
45
46
|
...options,
|
|
46
47
|
pathParams: {
|
|
47
48
|
project_key: projectKey,
|
|
@@ -21,5 +21,13 @@ export declare class MeasureService extends BaseService {
|
|
|
21
21
|
* @param options 请求选项(建议设置 timeout >= 60000)
|
|
22
22
|
*/
|
|
23
23
|
getChartData(projectKey: string, chartId: string, options?: ServiceRequestOptions<MeasureChartData>): Promise<MeasureChartData>;
|
|
24
|
+
/**
|
|
25
|
+
* 获取度量图表详情
|
|
26
|
+
*
|
|
27
|
+
* @param projectKey 空间 ID 或域名
|
|
28
|
+
* @param chartId 图表 ID
|
|
29
|
+
* @param options 请求选项(建议设置 timeout >= 60000)
|
|
30
|
+
*/
|
|
31
|
+
getChartDetail(projectKey: string, chartId: string, options?: ServiceRequestOptions<MeasureChartData>): Promise<MeasureChartData>;
|
|
24
32
|
}
|
|
25
33
|
export { API_PATHS } from './query.js';
|
|
@@ -31,5 +31,15 @@ export class MeasureService extends BaseService {
|
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* 获取度量图表详情
|
|
36
|
+
*
|
|
37
|
+
* @param projectKey 空间 ID 或域名
|
|
38
|
+
* @param chartId 图表 ID
|
|
39
|
+
* @param options 请求选项(建议设置 timeout >= 60000)
|
|
40
|
+
*/
|
|
41
|
+
async getChartDetail(projectKey, chartId, options) {
|
|
42
|
+
return this.getChartData(projectKey, chartId, options);
|
|
43
|
+
}
|
|
34
44
|
}
|
|
35
45
|
export { API_PATHS } from './query.js';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 100% 参考 Meego API 文档
|
|
4
4
|
*/
|
|
5
5
|
import { BaseService, type ServiceRequestOptions } from '../../core/base-service.js';
|
|
6
|
-
import type { MeasureChartsByViewRequest, MeasureChartsByViewData, MeasureChartSummary } from '../../types/measure.js';
|
|
6
|
+
import type { MeasureChartsByViewRequest, MeasureChartsByViewPageOptions, MeasureChartsByViewData, MeasureChartSummary } from '../../types/measure.js';
|
|
7
7
|
/** API 路径 */
|
|
8
8
|
export declare const API_PATHS: {
|
|
9
9
|
/** 获取度量图表明细数据 */
|
|
@@ -29,6 +29,16 @@ export declare class MeasureChartsByViewBuilder {
|
|
|
29
29
|
* 度量查询服务
|
|
30
30
|
*/
|
|
31
31
|
export declare class MeasureQueryService extends BaseService {
|
|
32
|
+
/**
|
|
33
|
+
* 归一化视图图表查询参数
|
|
34
|
+
*
|
|
35
|
+
* @param requestOrProjectKey 查询请求或空间 ID
|
|
36
|
+
* @param viewIdOrOptions 视图 ID 或请求选项
|
|
37
|
+
* @param pageOptions 分页参数
|
|
38
|
+
* @param options 请求选项
|
|
39
|
+
* @returns 查询请求与请求选项
|
|
40
|
+
*/
|
|
41
|
+
private normalizeChartsByViewArgs;
|
|
32
42
|
/**
|
|
33
43
|
* 查询视图下图表列表
|
|
34
44
|
*
|
|
@@ -37,6 +47,16 @@ export declare class MeasureQueryService extends BaseService {
|
|
|
37
47
|
* @returns 图表列表与分页信息
|
|
38
48
|
*/
|
|
39
49
|
listChartsByView(request: MeasureChartsByViewRequest, options?: ServiceRequestOptions<MeasureChartsByViewData | null>): Promise<MeasureChartsByViewData>;
|
|
50
|
+
/**
|
|
51
|
+
* 查询视图下图表列表
|
|
52
|
+
*
|
|
53
|
+
* @param projectKey 空间 ID 或域名
|
|
54
|
+
* @param viewId 视图 ID
|
|
55
|
+
* @param pageOptions 分页参数
|
|
56
|
+
* @param options 请求选项
|
|
57
|
+
* @returns 图表列表与分页信息
|
|
58
|
+
*/
|
|
59
|
+
listChartsByView(projectKey: string, viewId: string, pageOptions?: MeasureChartsByViewPageOptions, options?: ServiceRequestOptions<MeasureChartsByViewData | null>): Promise<MeasureChartsByViewData>;
|
|
40
60
|
/**
|
|
41
61
|
* 获取图表摘要列表
|
|
42
62
|
*
|
|
@@ -45,6 +65,16 @@ export declare class MeasureQueryService extends BaseService {
|
|
|
45
65
|
* @returns 图表摘要列表
|
|
46
66
|
*/
|
|
47
67
|
getChartSummariesByView(request: MeasureChartsByViewRequest, options?: ServiceRequestOptions<MeasureChartsByViewData | null>): Promise<MeasureChartSummary[]>;
|
|
68
|
+
/**
|
|
69
|
+
* 获取图表摘要列表
|
|
70
|
+
*
|
|
71
|
+
* @param projectKey 空间 ID 或域名
|
|
72
|
+
* @param viewId 视图 ID
|
|
73
|
+
* @param pageOptions 分页参数
|
|
74
|
+
* @param options 请求选项
|
|
75
|
+
* @returns 图表摘要列表
|
|
76
|
+
*/
|
|
77
|
+
getChartSummariesByView(projectKey: string, viewId: string, pageOptions?: MeasureChartsByViewPageOptions, options?: ServiceRequestOptions<MeasureChartsByViewData | null>): Promise<MeasureChartSummary[]>;
|
|
48
78
|
/**
|
|
49
79
|
* 构建视图图表查询
|
|
50
80
|
*
|
|
@@ -43,34 +43,49 @@ export class MeasureChartsByViewBuilder {
|
|
|
43
43
|
*/
|
|
44
44
|
export class MeasureQueryService extends BaseService {
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* 归一化视图图表查询参数
|
|
47
47
|
*
|
|
48
|
-
* @param
|
|
48
|
+
* @param requestOrProjectKey 查询请求或空间 ID
|
|
49
|
+
* @param viewIdOrOptions 视图 ID 或请求选项
|
|
50
|
+
* @param pageOptions 分页参数
|
|
49
51
|
* @param options 请求选项
|
|
50
|
-
* @returns
|
|
52
|
+
* @returns 查询请求与请求选项
|
|
51
53
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
normalizeChartsByViewArgs(requestOrProjectKey, viewIdOrOptions, pageOptions, options) {
|
|
55
|
+
if (typeof requestOrProjectKey !== 'string') {
|
|
56
|
+
return {
|
|
57
|
+
request: requestOrProjectKey,
|
|
58
|
+
options: viewIdOrOptions,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
request: {
|
|
63
|
+
project_key: requestOrProjectKey,
|
|
64
|
+
view_id: viewIdOrOptions,
|
|
65
|
+
page_num: pageOptions?.pageNum,
|
|
66
|
+
page_size: pageOptions?.pageSize,
|
|
67
|
+
},
|
|
68
|
+
options,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async listChartsByView(requestOrProjectKey, viewIdOrOptions, pageOptions, options) {
|
|
72
|
+
const normalized = this.normalizeChartsByViewArgs(requestOrProjectKey, viewIdOrOptions, pageOptions, options);
|
|
73
|
+
const result = await this.post(API_PATHS.CHARTS_BY_VIEW, normalized.request, normalized.options);
|
|
54
74
|
const chartList = Array.isArray(result?.chart_list) ? result.chart_list : [];
|
|
55
75
|
const chartPage = result?.chart_page ?? {
|
|
56
76
|
total: chartList.length,
|
|
57
|
-
page_num: request.page_num ?? 1,
|
|
58
|
-
page_size: request.page_size ?? 50,
|
|
77
|
+
page_num: normalized.request.page_num ?? 1,
|
|
78
|
+
page_size: normalized.request.page_size ?? 50,
|
|
59
79
|
};
|
|
60
80
|
return {
|
|
61
81
|
chart_list: chartList,
|
|
62
82
|
chart_page: chartPage,
|
|
63
83
|
};
|
|
64
84
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
* @param options 请求选项
|
|
70
|
-
* @returns 图表摘要列表
|
|
71
|
-
*/
|
|
72
|
-
async getChartSummariesByView(request, options) {
|
|
73
|
-
const result = await this.listChartsByView(request, options);
|
|
85
|
+
async getChartSummariesByView(requestOrProjectKey, viewIdOrOptions, pageOptions, options) {
|
|
86
|
+
const result = typeof requestOrProjectKey === 'string'
|
|
87
|
+
? await this.listChartsByView(requestOrProjectKey, viewIdOrOptions, pageOptions, options)
|
|
88
|
+
: await this.listChartsByView(requestOrProjectKey, viewIdOrOptions);
|
|
74
89
|
return result.chart_list ?? [];
|
|
75
90
|
}
|
|
76
91
|
/**
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { BaseService, type ServiceRequestOptions } from '../../core/base-service.js';
|
|
6
6
|
import type { PaginatedResult, PaginatedObjectResult } from '../../types/common.js';
|
|
7
7
|
import type { WorkItem } from '../../types/workitem.js';
|
|
8
|
-
import type { ViewConfListRequest, ViewConfInfo, FixViewInfo, FixViewQueryParams, PanoramicViewQueryParams } from '../../types/view.js';
|
|
8
|
+
import type { ViewConfListRequest, ViewConfInfo, FixViewInfo, FixViewQueryParams, PanoramicViewQueryParams, SearchViewByTitleRequest } from '../../types/view.js';
|
|
9
9
|
/** API 路径 */
|
|
10
10
|
export declare const API_PATHS: {
|
|
11
11
|
/** 获取视图列表及配置信息 */
|
|
@@ -28,6 +28,15 @@ export declare class ViewQueryService extends BaseService {
|
|
|
28
28
|
* @returns 分页的视图配置列表
|
|
29
29
|
*/
|
|
30
30
|
listConfigs(projectKey: string, request: ViewConfListRequest, options?: ServiceRequestOptions<ViewConfInfo>): Promise<PaginatedResult<ViewConfInfo>>;
|
|
31
|
+
/**
|
|
32
|
+
* 按标题模糊查询视图
|
|
33
|
+
*
|
|
34
|
+
* @param projectKey 空间 ID 或域名
|
|
35
|
+
* @param request 查询请求
|
|
36
|
+
* @param options 请求选项
|
|
37
|
+
* @returns 分页的视图配置列表
|
|
38
|
+
*/
|
|
39
|
+
searchByTitle(projectKey: string, request: SearchViewByTitleRequest, options?: ServiceRequestOptions<ViewConfInfo>): Promise<PaginatedResult<ViewConfInfo>>;
|
|
31
40
|
/**
|
|
32
41
|
* 获取固定视图下工作项列表
|
|
33
42
|
*
|
|
@@ -33,6 +33,21 @@ export class ViewQueryService extends BaseService {
|
|
|
33
33
|
},
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* 按标题模糊查询视图
|
|
38
|
+
*
|
|
39
|
+
* @param projectKey 空间 ID 或域名
|
|
40
|
+
* @param request 查询请求
|
|
41
|
+
* @param options 请求选项
|
|
42
|
+
* @returns 分页的视图配置列表
|
|
43
|
+
*/
|
|
44
|
+
async searchByTitle(projectKey, request, options) {
|
|
45
|
+
const { title, ...rest } = request;
|
|
46
|
+
return this.listConfigs(projectKey, {
|
|
47
|
+
...rest,
|
|
48
|
+
view_name: title,
|
|
49
|
+
}, options);
|
|
50
|
+
}
|
|
36
51
|
/**
|
|
37
52
|
* 获取固定视图下工作项列表
|
|
38
53
|
*
|
|
@@ -32,17 +32,17 @@ export declare class AttachmentService extends BaseService {
|
|
|
32
32
|
* @param projectKey 空间 ID 或域名
|
|
33
33
|
* @param request 上传请求
|
|
34
34
|
* @param options 请求选项
|
|
35
|
-
* @returns 附件链接 URL
|
|
35
|
+
* @returns 附件链接 URL
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* ```typescript
|
|
39
|
-
* const
|
|
39
|
+
* const url = await client.workItem.attachment.uploadFile('my-project', {
|
|
40
40
|
* file: new Blob([...]),
|
|
41
41
|
* });
|
|
42
|
-
* console.log(
|
|
42
|
+
* console.log(url); // https://project.feishu.cn/goapi/v1/tos/file/...
|
|
43
43
|
* ```
|
|
44
44
|
*/
|
|
45
|
-
uploadFile(projectKey: string, request: UploadFileRequest, options?: UploadRequestOptions<string
|
|
45
|
+
uploadFile(projectKey: string, request: UploadFileRequest, options?: UploadRequestOptions<string>): Promise<string>;
|
|
46
46
|
/**
|
|
47
47
|
* 添加附件到工作项
|
|
48
48
|
*
|
|
@@ -59,20 +59,20 @@ export declare class AttachmentService extends BaseService {
|
|
|
59
59
|
* @example
|
|
60
60
|
* ```typescript
|
|
61
61
|
* // 普通附件上传
|
|
62
|
-
* await client.workItem.attachment.uploadAttachment('my-project', 'story',
|
|
62
|
+
* await client.workItem.attachment.uploadAttachment('my-project', 'story', '643711xxxx', {
|
|
63
63
|
* file: new Blob([...]),
|
|
64
64
|
* field_key: 'field_xxx',
|
|
65
65
|
* });
|
|
66
66
|
*
|
|
67
67
|
* // 复合字段中上传附件
|
|
68
|
-
* await client.workItem.attachment.uploadAttachment('my-project', 'story',
|
|
68
|
+
* await client.workItem.attachment.uploadAttachment('my-project', 'story', '643711xxxx', {
|
|
69
69
|
* file: new Blob([...]),
|
|
70
70
|
* field_key: 'compound_field_xxx',
|
|
71
71
|
* index: '0',
|
|
72
72
|
* });
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
|
-
uploadAttachment(projectKey: string, workItemTypeKey: string, workItemId: number, request: UploadAttachmentRequest, options?: UploadRequestOptions<void>): Promise<void>;
|
|
75
|
+
uploadAttachment(projectKey: string, workItemTypeKey: string, workItemId: number | string, request: UploadAttachmentRequest, options?: UploadRequestOptions<void>): Promise<void>;
|
|
76
76
|
/**
|
|
77
77
|
* 下载附件
|
|
78
78
|
*
|
|
@@ -88,7 +88,7 @@ export declare class AttachmentService extends BaseService {
|
|
|
88
88
|
* @example
|
|
89
89
|
* ```typescript
|
|
90
90
|
* // 下载附件
|
|
91
|
-
* const data = await client.workItem.attachment.downloadAttachment('my-project', 'story',
|
|
91
|
+
* const data = await client.workItem.attachment.downloadAttachment('my-project', 'story', '643711xxxx', {
|
|
92
92
|
* uuid: 'a0e0104f-94bc-4999-bf07-239fd2f7xxxx',
|
|
93
93
|
* });
|
|
94
94
|
*
|
|
@@ -100,7 +100,7 @@ export declare class AttachmentService extends BaseService {
|
|
|
100
100
|
* const blob = new Blob([data]);
|
|
101
101
|
* ```
|
|
102
102
|
*/
|
|
103
|
-
downloadAttachment(projectKey: string, workItemTypeKey: string, workItemId: number, request: DownloadAttachmentRequest, options?: DownloadOptions): Promise<ArrayBuffer>;
|
|
103
|
+
downloadAttachment(projectKey: string, workItemTypeKey: string, workItemId: number | string, request: DownloadAttachmentRequest, options?: DownloadOptions): Promise<ArrayBuffer>;
|
|
104
104
|
/**
|
|
105
105
|
* 下载附件(流式)
|
|
106
106
|
*
|
|
@@ -111,7 +111,7 @@ export declare class AttachmentService extends BaseService {
|
|
|
111
111
|
* const stream = await client.workItem.attachment.downloadAttachmentStream(
|
|
112
112
|
* 'my-project',
|
|
113
113
|
* 'story',
|
|
114
|
-
*
|
|
114
|
+
* '643711xxxx',
|
|
115
115
|
* { uuid: 'a0e0104f-94bc-4999-bf07-239fd2f7xxxx' },
|
|
116
116
|
* {
|
|
117
117
|
* onProgress: (p) => console.log(p.progress),
|
|
@@ -119,7 +119,7 @@ export declare class AttachmentService extends BaseService {
|
|
|
119
119
|
* );
|
|
120
120
|
* ```
|
|
121
121
|
*/
|
|
122
|
-
downloadAttachmentStream(projectKey: string, workItemTypeKey: string, workItemId: number, request: DownloadAttachmentRequest, options?: DownloadOptions): Promise<ReadableStream<Uint8Array>>;
|
|
122
|
+
downloadAttachmentStream(projectKey: string, workItemTypeKey: string, workItemId: number | string, request: DownloadAttachmentRequest, options?: DownloadOptions): Promise<ReadableStream<Uint8Array>>;
|
|
123
123
|
/**
|
|
124
124
|
* 删除附件
|
|
125
125
|
*
|
|
@@ -132,7 +132,7 @@ export declare class AttachmentService extends BaseService {
|
|
|
132
132
|
* ```typescript
|
|
133
133
|
* await client.workItem.attachment.deleteAttachment({
|
|
134
134
|
* project_key: 'my-project',
|
|
135
|
-
* work_item_id:
|
|
135
|
+
* work_item_id: '643711xxxx',
|
|
136
136
|
* field_key: 'field_xxx',
|
|
137
137
|
* uuids: ['uuid1', 'uuid2'],
|
|
138
138
|
* });
|
|
@@ -38,14 +38,14 @@ export class AttachmentService extends BaseService {
|
|
|
38
38
|
* @param projectKey 空间 ID 或域名
|
|
39
39
|
* @param request 上传请求
|
|
40
40
|
* @param options 请求选项
|
|
41
|
-
* @returns 附件链接 URL
|
|
41
|
+
* @returns 附件链接 URL
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
44
44
|
* ```typescript
|
|
45
|
-
* const
|
|
45
|
+
* const url = await client.workItem.attachment.uploadFile('my-project', {
|
|
46
46
|
* file: new Blob([...]),
|
|
47
47
|
* });
|
|
48
|
-
* console.log(
|
|
48
|
+
* console.log(url); // https://project.feishu.cn/goapi/v1/tos/file/...
|
|
49
49
|
* ```
|
|
50
50
|
*/
|
|
51
51
|
async uploadFile(projectKey, request, options) {
|
|
@@ -82,13 +82,13 @@ export class AttachmentService extends BaseService {
|
|
|
82
82
|
* @example
|
|
83
83
|
* ```typescript
|
|
84
84
|
* // 普通附件上传
|
|
85
|
-
* await client.workItem.attachment.uploadAttachment('my-project', 'story',
|
|
85
|
+
* await client.workItem.attachment.uploadAttachment('my-project', 'story', '643711xxxx', {
|
|
86
86
|
* file: new Blob([...]),
|
|
87
87
|
* field_key: 'field_xxx',
|
|
88
88
|
* });
|
|
89
89
|
*
|
|
90
90
|
* // 复合字段中上传附件
|
|
91
|
-
* await client.workItem.attachment.uploadAttachment('my-project', 'story',
|
|
91
|
+
* await client.workItem.attachment.uploadAttachment('my-project', 'story', '643711xxxx', {
|
|
92
92
|
* file: new Blob([...]),
|
|
93
93
|
* field_key: 'compound_field_xxx',
|
|
94
94
|
* index: '0',
|
|
@@ -142,7 +142,7 @@ export class AttachmentService extends BaseService {
|
|
|
142
142
|
* @example
|
|
143
143
|
* ```typescript
|
|
144
144
|
* // 下载附件
|
|
145
|
-
* const data = await client.workItem.attachment.downloadAttachment('my-project', 'story',
|
|
145
|
+
* const data = await client.workItem.attachment.downloadAttachment('my-project', 'story', '643711xxxx', {
|
|
146
146
|
* uuid: 'a0e0104f-94bc-4999-bf07-239fd2f7xxxx',
|
|
147
147
|
* });
|
|
148
148
|
*
|
|
@@ -182,7 +182,7 @@ export class AttachmentService extends BaseService {
|
|
|
182
182
|
* const stream = await client.workItem.attachment.downloadAttachmentStream(
|
|
183
183
|
* 'my-project',
|
|
184
184
|
* 'story',
|
|
185
|
-
*
|
|
185
|
+
* '643711xxxx',
|
|
186
186
|
* { uuid: 'a0e0104f-94bc-4999-bf07-239fd2f7xxxx' },
|
|
187
187
|
* {
|
|
188
188
|
* onProgress: (p) => console.log(p.progress),
|
|
@@ -220,7 +220,7 @@ export class AttachmentService extends BaseService {
|
|
|
220
220
|
* ```typescript
|
|
221
221
|
* await client.workItem.attachment.deleteAttachment({
|
|
222
222
|
* project_key: 'my-project',
|
|
223
|
-
* work_item_id:
|
|
223
|
+
* work_item_id: '643711xxxx',
|
|
224
224
|
* field_key: 'field_xxx',
|
|
225
225
|
* uuids: ['uuid1', 'uuid2'],
|
|
226
226
|
* });
|
|
@@ -39,13 +39,13 @@ export declare class CommentService extends BaseService {
|
|
|
39
39
|
* @example
|
|
40
40
|
* ```typescript
|
|
41
41
|
* // 添加纯文本评论
|
|
42
|
-
* const commentId = await client.workItem.comment.create('my-project', 'story',
|
|
42
|
+
* const commentId = await client.workItem.comment.create('my-project', 'story', '623714xxxx', {
|
|
43
43
|
* content: '这是一条测试评论',
|
|
44
44
|
* });
|
|
45
45
|
* console.log(commentId); // "7587846609728458752"
|
|
46
46
|
*
|
|
47
47
|
* // 添加富文本评论
|
|
48
|
-
* const commentId = await client.workItem.comment.create('my-project', 'story',
|
|
48
|
+
* const commentId = await client.workItem.comment.create('my-project', 'story', '623714xxxx', {
|
|
49
49
|
* rich_text: [
|
|
50
50
|
* {
|
|
51
51
|
* type: 'paragraph',
|
|
@@ -57,7 +57,7 @@ export declare class CommentService extends BaseService {
|
|
|
57
57
|
* });
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
create(projectKey: string, workItemTypeKey: string, workItemId: number, request: CreateCommentRequest, options?: ServiceRequestOptions<string>): Promise<string>;
|
|
60
|
+
create(projectKey: string, workItemTypeKey: string, workItemId: number | string, request: CreateCommentRequest, options?: ServiceRequestOptions<string>): Promise<string>;
|
|
61
61
|
/**
|
|
62
62
|
* 查询评论列表
|
|
63
63
|
*
|
|
@@ -73,18 +73,18 @@ export declare class CommentService extends BaseService {
|
|
|
73
73
|
* @example
|
|
74
74
|
* ```typescript
|
|
75
75
|
* // 获取所有评论
|
|
76
|
-
* const result = await client.workItem.comment.list('my-project', 'story',
|
|
76
|
+
* const result = await client.workItem.comment.list('my-project', 'story', '621541xxxx');
|
|
77
77
|
* console.log(result.pagination.total); // 评论总数
|
|
78
78
|
* console.log(result.data); // 评论列表
|
|
79
79
|
*
|
|
80
80
|
* // 分页获取评论
|
|
81
|
-
* const result = await client.workItem.comment.list('my-project', 'story',
|
|
81
|
+
* const result = await client.workItem.comment.list('my-project', 'story', '621541xxxx', {
|
|
82
82
|
* page_size: 20,
|
|
83
83
|
* page_num: 1,
|
|
84
84
|
* });
|
|
85
85
|
* ```
|
|
86
86
|
*/
|
|
87
|
-
list(projectKey: string, workItemTypeKey: string, workItemId: number, query?: ListCommentsQuery, options?: ServiceRequestOptions<Comment>): Promise<PaginatedResult<Comment>>;
|
|
87
|
+
list(projectKey: string, workItemTypeKey: string, workItemId: number | string, query?: ListCommentsQuery, options?: ServiceRequestOptions<Comment>): Promise<PaginatedResult<Comment>>;
|
|
88
88
|
/**
|
|
89
89
|
* 更新评论
|
|
90
90
|
*
|
|
@@ -100,12 +100,12 @@ export declare class CommentService extends BaseService {
|
|
|
100
100
|
* @example
|
|
101
101
|
* ```typescript
|
|
102
102
|
* // 更新为纯文本评论
|
|
103
|
-
* await client.workItem.comment.update('my-project', 'story',
|
|
103
|
+
* await client.workItem.comment.update('my-project', 'story', '621541xxxx', '7587846609728458752', {
|
|
104
104
|
* content: '更新后的评论内容',
|
|
105
105
|
* });
|
|
106
106
|
*
|
|
107
107
|
* // 更新为富文本评论
|
|
108
|
-
* await client.workItem.comment.update('my-project', 'story',
|
|
108
|
+
* await client.workItem.comment.update('my-project', 'story', '621541xxxx', commentId, {
|
|
109
109
|
* rich_text: [
|
|
110
110
|
* {
|
|
111
111
|
* type: 'paragraph',
|
|
@@ -117,7 +117,7 @@ export declare class CommentService extends BaseService {
|
|
|
117
117
|
* });
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
|
-
update(projectKey: string, workItemTypeKey: string, workItemId: number, commentId: string, request: UpdateCommentRequest, options?: ServiceRequestOptions<void>): Promise<void>;
|
|
120
|
+
update(projectKey: string, workItemTypeKey: string, workItemId: number | string, commentId: string, request: UpdateCommentRequest, options?: ServiceRequestOptions<void>): Promise<void>;
|
|
121
121
|
/**
|
|
122
122
|
* 删除评论
|
|
123
123
|
*
|
|
@@ -131,8 +131,8 @@ export declare class CommentService extends BaseService {
|
|
|
131
131
|
*
|
|
132
132
|
* @example
|
|
133
133
|
* ```typescript
|
|
134
|
-
* await client.workItem.comment.remove('my-project', 'story',
|
|
134
|
+
* await client.workItem.comment.remove('my-project', 'story', '621541xxxx', '7587846609728458752');
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
|
-
remove(projectKey: string, workItemTypeKey: string, workItemId: number, commentId: string, options?: ServiceRequestOptions<void>): Promise<void>;
|
|
137
|
+
remove(projectKey: string, workItemTypeKey: string, workItemId: number | string, commentId: string, options?: ServiceRequestOptions<void>): Promise<void>;
|
|
138
138
|
}
|
|
@@ -37,13 +37,13 @@ export class CommentService extends BaseService {
|
|
|
37
37
|
* @example
|
|
38
38
|
* ```typescript
|
|
39
39
|
* // 添加纯文本评论
|
|
40
|
-
* const commentId = await client.workItem.comment.create('my-project', 'story',
|
|
40
|
+
* const commentId = await client.workItem.comment.create('my-project', 'story', '623714xxxx', {
|
|
41
41
|
* content: '这是一条测试评论',
|
|
42
42
|
* });
|
|
43
43
|
* console.log(commentId); // "7587846609728458752"
|
|
44
44
|
*
|
|
45
45
|
* // 添加富文本评论
|
|
46
|
-
* const commentId = await client.workItem.comment.create('my-project', 'story',
|
|
46
|
+
* const commentId = await client.workItem.comment.create('my-project', 'story', '623714xxxx', {
|
|
47
47
|
* rich_text: [
|
|
48
48
|
* {
|
|
49
49
|
* type: 'paragraph',
|
|
@@ -81,12 +81,12 @@ export class CommentService extends BaseService {
|
|
|
81
81
|
* @example
|
|
82
82
|
* ```typescript
|
|
83
83
|
* // 获取所有评论
|
|
84
|
-
* const result = await client.workItem.comment.list('my-project', 'story',
|
|
84
|
+
* const result = await client.workItem.comment.list('my-project', 'story', '621541xxxx');
|
|
85
85
|
* console.log(result.pagination.total); // 评论总数
|
|
86
86
|
* console.log(result.data); // 评论列表
|
|
87
87
|
*
|
|
88
88
|
* // 分页获取评论
|
|
89
|
-
* const result = await client.workItem.comment.list('my-project', 'story',
|
|
89
|
+
* const result = await client.workItem.comment.list('my-project', 'story', '621541xxxx', {
|
|
90
90
|
* page_size: 20,
|
|
91
91
|
* page_num: 1,
|
|
92
92
|
* });
|
|
@@ -119,12 +119,12 @@ export class CommentService extends BaseService {
|
|
|
119
119
|
* @example
|
|
120
120
|
* ```typescript
|
|
121
121
|
* // 更新为纯文本评论
|
|
122
|
-
* await client.workItem.comment.update('my-project', 'story',
|
|
122
|
+
* await client.workItem.comment.update('my-project', 'story', '621541xxxx', '7587846609728458752', {
|
|
123
123
|
* content: '更新后的评论内容',
|
|
124
124
|
* });
|
|
125
125
|
*
|
|
126
126
|
* // 更新为富文本评论
|
|
127
|
-
* await client.workItem.comment.update('my-project', 'story',
|
|
127
|
+
* await client.workItem.comment.update('my-project', 'story', '621541xxxx', commentId, {
|
|
128
128
|
* rich_text: [
|
|
129
129
|
* {
|
|
130
130
|
* type: 'paragraph',
|
|
@@ -161,7 +161,7 @@ export class CommentService extends BaseService {
|
|
|
161
161
|
*
|
|
162
162
|
* @example
|
|
163
163
|
* ```typescript
|
|
164
|
-
* await client.workItem.comment.remove('my-project', 'story',
|
|
164
|
+
* await client.workItem.comment.remove('my-project', 'story', '621541xxxx', '7587846609728458752');
|
|
165
165
|
* ```
|
|
166
166
|
*/
|
|
167
167
|
async remove(projectKey, workItemTypeKey, workItemId, commentId, options) {
|
|
@@ -149,7 +149,7 @@ export declare class SearchService extends BaseService {
|
|
|
149
149
|
* @param workItemId 工作项 ID
|
|
150
150
|
* @param request 搜索请求
|
|
151
151
|
* @param options 请求选项
|
|
152
|
-
* @returns
|
|
152
|
+
* @returns 分页的关联工作项列表(查询结果超过 5000 条会报错)
|
|
153
153
|
*
|
|
154
154
|
* @example
|
|
155
155
|
* ```typescript
|
|
@@ -224,12 +224,8 @@ export declare class SearchService extends BaseService {
|
|
|
224
224
|
* @example
|
|
225
225
|
* ```typescript
|
|
226
226
|
* const result = await client.workItem.search.universalSearch({
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
* project_key: 'project_key',
|
|
230
|
-
* work_item_type_keys: 'story',
|
|
231
|
-
* },
|
|
232
|
-
* ],
|
|
227
|
+
* project_key: 'project_key',
|
|
228
|
+
* work_item_type_key: 'story',
|
|
233
229
|
* search_group: {
|
|
234
230
|
* conjunction: 'AND',
|
|
235
231
|
* search_params: [
|
|
@@ -166,7 +166,7 @@ export class SearchService extends BaseService {
|
|
|
166
166
|
* @param workItemId 工作项 ID
|
|
167
167
|
* @param request 搜索请求
|
|
168
168
|
* @param options 请求选项
|
|
169
|
-
* @returns
|
|
169
|
+
* @returns 分页的关联工作项列表(查询结果超过 5000 条会报错)
|
|
170
170
|
*
|
|
171
171
|
* @example
|
|
172
172
|
* ```typescript
|
|
@@ -253,12 +253,8 @@ export class SearchService extends BaseService {
|
|
|
253
253
|
* @example
|
|
254
254
|
* ```typescript
|
|
255
255
|
* const result = await client.workItem.search.universalSearch({
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
* project_key: 'project_key',
|
|
259
|
-
* work_item_type_keys: 'story',
|
|
260
|
-
* },
|
|
261
|
-
* ],
|
|
256
|
+
* project_key: 'project_key',
|
|
257
|
+
* work_item_type_key: 'story',
|
|
262
258
|
* search_group: {
|
|
263
259
|
* conjunction: 'AND',
|
|
264
260
|
* search_params: [
|
|
@@ -277,6 +273,10 @@ export class SearchService extends BaseService {
|
|
|
277
273
|
* ```
|
|
278
274
|
*/
|
|
279
275
|
async universalSearch(request, options) {
|
|
280
|
-
|
|
276
|
+
const result = await this.postCursorPaginated(API_PATHS.UNIVERSAL_SEARCH, request, options, 'datas');
|
|
277
|
+
return {
|
|
278
|
+
datas: result.data,
|
|
279
|
+
pagination: result.pagination,
|
|
280
|
+
};
|
|
281
281
|
}
|
|
282
282
|
}
|