meeglesdk 0.2.1 → 0.2.2

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 CHANGED
@@ -1,10 +1,23 @@
1
1
  # Changelog
2
2
 
3
- ## 0.2.1 - 2026-05-11
3
+ ## 0.2.2 - 2026-07-11
4
+
5
+ ### Added
6
+
7
+ - Added OpenAPI request-field drift checks to the release gate, with scanned endpoint configuration kept in `scripts/openapi-field-targets.json`.
8
+ - Added a local OpenAPI docs snapshot gate so release and CI fail when `Meego-API-docs` markdown changes without a reviewed snapshot refresh.
9
+ - Expanded OpenAPI request-field drift coverage from 20 to 38 request bodies, including search, attachment deletion, transition, review, deliverable, field option, operation record, and compound-field update APIs.
10
+ - Expanded OpenAPI field drift coverage to higher-risk write APIs, including batch update, comments, subtasks, work hours, and custom fields.
11
+ - Added manifest self-checks and reusable structure-field drift checks against `Meego-API-docs/数据结构汇总.md`, so release gating now validates both endpoint request bodies and selected shared data structures.
12
+ - Split response-only SDK fields out of `FieldValuePair`, `RoleOwner`, and `Schedule`, and made endpoint-specific expand options independent of the shared `ExpandParams` structure.
13
+ - Expanded reusable structure drift coverage to field config/value, search filters, relation details, transition-required info, workflow status, and delivery-related structures.
14
+ - Added a response model boundary check to keep main work item, workflow, resource, and WBS draft response models on response-specific field, role, and schedule types.
15
+ - Added an optional real resource fixture integration check for successful `ResourceWorkItemDetail` response models without creating unremovable resource instances by default.
4
16
 
5
17
  ### Fixed
6
18
 
7
19
  - Aligned documented `work_item_id` request and response fields with the Meego MCP `int64` type, while preserving string-compatible URL path parameters where the Path table still documents `work_item_id` as `string`.
20
+ - Aligned real integration behavior for generic file upload and universal search: `uploadFile` now returns the platform URL array, and universal search parses the platform `data` payload with pagination.
8
21
 
9
22
  ## 0.2.0 - 2026-05-10
10
23
 
package/README.md CHANGED
@@ -174,6 +174,29 @@ const options = await client.workItem.getFieldOptions({
174
174
  });
175
175
  ```
176
176
 
177
+ ## Work Item Workflow Query
178
+
179
+ ```ts
180
+ const workflow = await client.workItem.workflow.query(
181
+ 'project_key',
182
+ 'story',
183
+ 123456,
184
+ {
185
+ fields: ['priority', 'description'],
186
+ flow_type: 0,
187
+ expand: {
188
+ need_user_detail: true,
189
+ need_sub_task_parent: true,
190
+ need_rich_text_mark_down: true,
191
+ need_sub_workitem_detail: true,
192
+ },
193
+ },
194
+ { auth: { type: 'plugin', userKey: 'user_key' } }
195
+ );
196
+
197
+ console.log(workflow.workflow_nodes);
198
+ ```
199
+
177
200
  ## Compound Field Values
178
201
 
179
202
  ```ts
@@ -186,6 +209,26 @@ await client.workItem.updateCompoundFieldValue({
186
209
  });
187
210
  ```
188
211
 
212
+ ## Create Instance from Resource
213
+
214
+ ```ts
215
+ const created = await client.config.resource.createInstanceFromResource(
216
+ 'project_key',
217
+ 872360000,
218
+ {
219
+ work_item_type_key: 'story',
220
+ name: '校验必填创建实例',
221
+ required_mode: 1,
222
+ field_value_pairs: [
223
+ { field_key: 'description', field_value: '测试描述' },
224
+ ],
225
+ },
226
+ { auth: { type: 'plugin', userKey: 'user_key' } }
227
+ );
228
+
229
+ console.log(created.work_item_id);
230
+ ```
231
+
189
232
  ## WBS View (Query + Body)
190
233
 
191
234
  ```ts
@@ -356,6 +399,54 @@ const next = await client.workItem.search.universalSearch(
356
399
  );
357
400
  ```
358
401
 
402
+ ## Generic File Upload
403
+
404
+ ```ts
405
+ const urls = await client.workItem.attachment.uploadFile(
406
+ 'project_key',
407
+ { file: new Blob(['hello'], { type: 'text/plain' }), fileName: 'hello.txt' },
408
+ { auth: { type: 'plugin', userKey: 'user_key' } }
409
+ );
410
+
411
+ const firstUrl = urls[0];
412
+ ```
413
+
414
+ ## Release and OpenAPI Checks
415
+
416
+ ```bash
417
+ # Build dist, verify npm pack contents, and compile package-name import examples.
418
+ bun run release:artifacts
419
+
420
+ # Compare selected OpenAPI request body fields with the TS SDK request types.
421
+ bun run openapi:field-diff
422
+
423
+ # Emit the same scan as JSON for CI/report consumers.
424
+ bun run openapi:field-report
425
+
426
+ # Refresh the local OpenAPI docs snapshot after intentionally updating Meego-API-docs.
427
+ bun run openapi:snapshot:update
428
+
429
+ # Verify the local OpenAPI docs mirror has not changed without a reviewed snapshot update.
430
+ bun run openapi:snapshot:check
431
+
432
+ # Validate the scan manifest before running the diff.
433
+ bun run openapi:field-targets:check
434
+
435
+ # Same diff scan, but exits non-zero when differences are found.
436
+ bun run openapi:field-check
437
+
438
+ # Verify response models keep response-only fields out of shared request structures.
439
+ bun run response-model-check
440
+ ```
441
+
442
+ The OpenAPI docs snapshot pins the local `Meego-API-docs` markdown mirror by path, byte size, line count, and SHA-256 digest. Non-markdown files such as `.DS_Store` are ignored. When the mirror is intentionally refreshed, review SDK impact first, then run `bun run openapi:snapshot:update` and commit the snapshot diff.
443
+
444
+ The OpenAPI field scan reads the local `Meego-API-docs` mirror and reports the exact document path used for each target. It checks two source classes: endpoint request bodies from their API pages, and reusable SDK structures from `Meego-API-docs/数据结构汇总.md`. It currently covers 38 selected request bodies across work item, workflow, search, resource, review, attachment deletion, comment, subtask, work hour, batch update, compound-field update, field option, operation record, deliverable, and custom field APIs, plus shared structures such as expand params, field configs, field value pairs, role owners, schedules, search filters, relation details, transition-required info, work hour records, node schedule constraint rules, team options, number config, and user detail.
445
+
446
+ Add or remove scanned targets in `scripts/openapi-field-targets.json`; the checker reads that manifest instead of keeping endpoint config in code. `bun run openapi:field-targets:check` validates the manifest shape, referenced docs, structure headings, and SDK type declarations. `bun run release:check` runs `openapi:snapshot:check` and `openapi:field-check`, so npm publish and CI fail when the local OpenAPI mirror changes without a reviewed snapshot update or SDK fields drift from that mirror.
447
+
448
+ Shared request structures stay aligned to `数据结构汇总.md`. Response-only additions use explicit response types such as `FieldValuePairResponse`, `RoleOwnerResponse`, and `ScheduleResponse`; endpoint-specific expand options use endpoint-specific types such as `QueryWorkItemExpand` and `WorkflowQueryExpand`. `response-model-check` keeps the main work item, workflow, resource, and WBS draft response models on those response-specific types.
449
+
359
450
  ## Services Overview
360
451
 
361
452
  Top-level services:
@@ -384,6 +475,8 @@ bun test
384
475
 
385
476
  Network access is required.
386
477
 
478
+ The resource detail success-path check is fixture-based because the public OpenAPI mirror does not expose a resource-instance delete endpoint. Set `TEST_RESOURCE_WORK_ITEM_TYPE_KEY` and `TEST_RESOURCE_WORK_ITEM_ID` to validate a real resource detail response without creating new resource instances.
479
+
387
480
  ## Unit Tests (Edge Cases)
388
481
 
389
482
  Unit tests mock network calls and focus on request parsing, retries, and token caching.
package/RELEASE.md CHANGED
@@ -5,8 +5,8 @@ This document is the npm release checklist for `meeglesdk`.
5
5
  ## Current Release
6
6
 
7
7
  - Package: `meeglesdk`
8
- - Version: `0.2.1`
9
- - Registry latest checked before release: `0.2.0`
8
+ - Version: `0.2.2`
9
+ - Registry latest checked before release: `0.2.1`
10
10
  - Runtime requirement: Node.js 18+
11
11
  - Development runtime: Bun 1.3+
12
12
 
@@ -37,11 +37,15 @@ This document is the npm release checklist for `meeglesdk`.
37
37
 
38
38
  ```bash
39
39
  npm view meeglesdk version dist-tags --json
40
- npm view meeglesdk@0.2.1 dist.tarball
40
+ npm view meeglesdk@0.2.2 dist.tarball
41
41
  ```
42
42
 
43
43
  ## Notes
44
44
 
45
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`.
46
+ - `release:check` and `prepublishOnly` run the OpenAPI field check before tests/build, so SDK request fields and selected reusable structures must match the local OpenAPI mirror before publishing.
47
+ - `release:check` first verifies `scripts/openapi-docs-snapshot.json`, so local `Meego-API-docs` mirror changes must be reviewed and committed with a refreshed snapshot before publishing.
48
+ - `openapi:field-check` first validates `scripts/openapi-field-targets.json`, including referenced docs, `数据结构汇总.md` headings, and SDK type declarations.
49
+ - `release:check` also runs `response-model-check`, so response-only fields stay on explicit response types instead of leaking back into shared request structures.
50
+ - The TypeScript SDK GitHub Actions workflow runs the same `release:check` gate for SDK or OpenAPI doc changes.
47
51
  - The npm package includes `dist/`, `CHANGELOG.md`, `RELEASE.md`, and npm's always-included package metadata and README.
package/dist/index.d.ts CHANGED
@@ -58,15 +58,15 @@ export { withAuth, withUserKey, withUserToken, withPluginToken } from './helpers
58
58
  export { parseDocImages, extractImagesFromMultiTexts, inferImageMimeType, type RichTextImage, } from './helpers/richtext.js';
59
59
  export { calculateEventSignature, verifyEventSignature, calculateEventSignatureSync, verifyEventSignatureSync, getEventCategory, getEventName, isListenEvent, isInterceptEvent, createInterceptResponse, } from './helpers/event.js';
60
60
  export type { QueryWorkItemOptions } from './service/workitem/workItem.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';
61
+ export type { Logger, ApiResponse, AuthApiResponse, ErrorDetail, PaginationParams, SearchAfterPagination, SearchAfterPaginatedResult, PagedWorkItemIds, FieldUpdateMode, FieldValuePair, FieldValuePairResponse, TargetState, FieldConf, DefaultValue, OptionConf, RoleAssign, SimpleField, Option, FieldValue, RoleOwner, RoleOwnerResponse, Schedule, ScheduleResponse, TimeInterval, ExpandParams, UserDetail, Connection, MultiText, MultiTextDetail, RichText, } from './types/common.js';
62
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';
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, ResourceQueryExpand, ResourceQueryRequest, ResourceTemplateInfo, ResourceRoleOwner, ResourceWorkItemDetail, ResourceQueryResponse, ResourceCreateRequest, ResourceCreateResponse, ResourceUpdateRequest, ResourceCreateInstanceRequest, ResourceCreateInstanceResponseData, ResourceSearchDataSource, ResourceSearchPaginationRequest, ResourceSearchPagination, ResourceOperateRequest, ResourceSearchParamsRequest, ResourceSearchParamsResponse, } from './types/config.js';
64
64
  export type { TenantInfo, GetTenantInfoRequest, TenantEntitlement, GetTenantEntitlementRequest, TenantInstallProjectsResponse, TenantProductInfo, TenantProductPrice, TenantRichText, } from './types/tenant.js';
65
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
66
  export type { MeasureChartDataItem, MeasureChartData, MeasureChartsByViewRequest, MeasureChartsByViewPageOptions, MeasureChartSummary, MeasureChartsPagination, MeasureChartsByViewData, } from './types/measure.js';
67
67
  export type { ListProjectsRequest, GetProjectDetailRequest, ProjectDetail, ProjectDetailMap, BusinessLine, WorkItemTypeInfo, TeamInfo, RelationRulesRequest, ProjectRelationRule, RelationRule, RelationWorkItemListRequest, RelationInstance, BindRelationRequest, UnbindRelationRequest, } from './types/space.js';
68
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';
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, AddSubWorkitemsRequest, UpdateNodeRequest, BatchUpdateRequest, BatchUpdateResponse, DeliverableBatchQueryRequest, BotJoinChatRequest, UploadAttachmentRequest, UploadFileRequest, UploadFileResponse, 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
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';
71
71
  export type { GetPluginTokenRequest, GetPluginTokenResponseData, GetUserTokenRequest, GetUserTokenResponseData, RefreshUserTokenRequest, RefreshUserTokenResponseData, UserTokenInput, TokenInfo, TokenType, } from './types/auth.js';
72
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';
@@ -53,6 +53,19 @@ export declare class ConfigResourceService extends BaseService {
53
53
  * @param workItemId 资源工作项 ID
54
54
  * @param request 创建请求
55
55
  * @param options 请求选项
56
+ *
57
+ * @example
58
+ * ```typescript
59
+ * const created = await client.config.resource.createInstanceFromResource('my-project', 872360000, {
60
+ * work_item_type_key: 'story',
61
+ * name: '校验必填创建实例',
62
+ * required_mode: 1,
63
+ * field_value_pairs: [
64
+ * { field_key: 'description', field_value: '测试描述' },
65
+ * ],
66
+ * });
67
+ * console.log(created.work_item_id);
68
+ * ```
56
69
  */
57
70
  createInstanceFromResource(projectKey: string, workItemId: ResourceId, request: ResourceCreateInstanceRequest, options?: ServiceRequestOptions<ResourceCreateInstanceResponseData>): Promise<ResourceCreateInstanceResponseData>;
58
71
  }
@@ -64,6 +64,19 @@ export class ConfigResourceService extends BaseService {
64
64
  * @param workItemId 资源工作项 ID
65
65
  * @param request 创建请求
66
66
  * @param options 请求选项
67
+ *
68
+ * @example
69
+ * ```typescript
70
+ * const created = await client.config.resource.createInstanceFromResource('my-project', 872360000, {
71
+ * work_item_type_key: 'story',
72
+ * name: '校验必填创建实例',
73
+ * required_mode: 1,
74
+ * field_value_pairs: [
75
+ * { field_key: 'description', field_value: '测试描述' },
76
+ * ],
77
+ * });
78
+ * console.log(created.work_item_id);
79
+ * ```
67
80
  */
68
81
  async createInstanceFromResource(projectKey, workItemId, request, options) {
69
82
  return this.post(API_PATHS.CREATE_INSTANCE_FROM_RESOURCE, request, {
@@ -5,7 +5,7 @@
5
5
  * 提供附件的上传、下载、删除功能
6
6
  */
7
7
  import { BaseService, type ServiceRequestOptions, type UploadRequestOptions, type DownloadOptions } from '../../core/base-service.js';
8
- import type { UploadAttachmentRequest, UploadFileRequest, DownloadAttachmentRequest, DeleteAttachmentRequest } from '../../types/workitem.js';
8
+ import type { UploadAttachmentRequest, UploadFileRequest, UploadFileResponse, DownloadAttachmentRequest, DeleteAttachmentRequest } from '../../types/workitem.js';
9
9
  /** API 路径 */
10
10
  export declare const API_PATHS: {
11
11
  /** 上传文件或富文本图片(通用) */
@@ -26,23 +26,23 @@ export declare class AttachmentService extends BaseService {
26
26
  /**
27
27
  * 上传文件(通用)
28
28
  *
29
- * 用于富文本中上传图片等场景,返回上传后的资源路径
29
+ * 用于富文本中上传图片等场景,返回上传后的资源路径列表
30
30
  * 最大支持 100M
31
31
  *
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 url = await client.workItem.attachment.uploadFile('my-project', {
39
+ * const urls = await client.workItem.attachment.uploadFile('my-project', {
40
40
  * file: new Blob([...]),
41
41
  * });
42
- * console.log(url); // https://project.feishu.cn/goapi/v1/tos/file/...
42
+ * console.log(urls[0]); // https://project.feishu.cn/goapi/v5/platform/file/stream/download/...
43
43
  * ```
44
44
  */
45
- uploadFile(projectKey: string, request: UploadFileRequest, options?: UploadRequestOptions<string>): Promise<string>;
45
+ uploadFile(projectKey: string, request: UploadFileRequest, options?: UploadRequestOptions<UploadFileResponse>): Promise<UploadFileResponse>;
46
46
  /**
47
47
  * 添加附件到工作项
48
48
  *
@@ -32,20 +32,20 @@ export class AttachmentService extends BaseService {
32
32
  /**
33
33
  * 上传文件(通用)
34
34
  *
35
- * 用于富文本中上传图片等场景,返回上传后的资源路径
35
+ * 用于富文本中上传图片等场景,返回上传后的资源路径列表
36
36
  * 最大支持 100M
37
37
  *
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 url = await client.workItem.attachment.uploadFile('my-project', {
45
+ * const urls = await client.workItem.attachment.uploadFile('my-project', {
46
46
  * file: new Blob([...]),
47
47
  * });
48
- * console.log(url); // https://project.feishu.cn/goapi/v1/tos/file/...
48
+ * console.log(urls[0]); // https://project.feishu.cn/goapi/v5/platform/file/stream/download/...
49
49
  * ```
50
50
  */
51
51
  async uploadFile(projectKey, request, options) {
@@ -273,7 +273,7 @@ export class SearchService extends BaseService {
273
273
  * ```
274
274
  */
275
275
  async universalSearch(request, options) {
276
- const result = await this.postCursorPaginated(API_PATHS.UNIVERSAL_SEARCH, request, options, 'datas');
276
+ const result = await this.postCursorPaginated(API_PATHS.UNIVERSAL_SEARCH, request, options, 'data');
277
277
  return {
278
278
  datas: result.data,
279
279
  pagination: result.pagination,
@@ -59,14 +59,19 @@ export declare class WorkflowService extends BaseService {
59
59
  * );
60
60
  * console.log('状态流节点:', stateFlowWorkflow.state_flow_nodes);
61
61
  *
62
- * // 指定返回字段并获取用户详情
62
+ * // 指定返回字段并获取扩展信息
63
63
  * const workflowWithDetails = await client.workItem.workflow.query(
64
64
  * 'my-project',
65
65
  * 'story',
66
66
  * 123456,
67
67
  * {
68
68
  * fields: ['priority', 'description'],
69
- * expand: { need_user_detail: true }
69
+ * expand: {
70
+ * need_user_detail: true,
71
+ * need_sub_task_parent: true,
72
+ * need_rich_text_mark_down: true,
73
+ * need_sub_workitem_detail: true,
74
+ * }
70
75
  * }
71
76
  * );
72
77
  * ```
@@ -58,14 +58,19 @@ export class WorkflowService extends BaseService {
58
58
  * );
59
59
  * console.log('状态流节点:', stateFlowWorkflow.state_flow_nodes);
60
60
  *
61
- * // 指定返回字段并获取用户详情
61
+ * // 指定返回字段并获取扩展信息
62
62
  * const workflowWithDetails = await client.workItem.workflow.query(
63
63
  * 'my-project',
64
64
  * 'story',
65
65
  * 123456,
66
66
  * {
67
67
  * fields: ['priority', 'description'],
68
- * expand: { need_user_detail: true }
68
+ * expand: {
69
+ * need_user_detail: true,
70
+ * need_sub_task_parent: true,
71
+ * need_rich_text_mark_down: true,
72
+ * need_sub_workitem_detail: true,
73
+ * }
69
74
  * }
70
75
  * );
71
76
  * ```
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 通用类型定义
3
- * 100% 参考 Meego API 文档: Meego-API-docs/common/数据结构汇总.md
3
+ * 参考 Meego API 文档和 Meego-API-docs/数据结构汇总.md
4
4
  */
5
5
  /**
6
6
  * 认证接口响应格式
@@ -125,6 +125,12 @@ export interface FieldValuePair {
125
125
  target_state?: TargetState;
126
126
  /** 字段更新模式(0: 全局替换, 1: 增量更新) */
127
127
  update_mode?: FieldUpdateMode;
128
+ }
129
+ /**
130
+ * 字段值对响应
131
+ * 参考: 字段与属性解析格式
132
+ */
133
+ export interface FieldValuePairResponse extends FieldValuePair {
128
134
  /** 字段描述 */
129
135
  help_description?: string;
130
136
  }
@@ -250,6 +256,11 @@ export interface RoleOwner {
250
256
  role: string;
251
257
  name?: string;
252
258
  owners: string[];
259
+ }
260
+ /**
261
+ * 角色负责人响应
262
+ */
263
+ export interface RoleOwnerResponse extends RoleOwner {
253
264
  /** 该角色在当前实例上是否存在(状态流工作项返回) */
254
265
  exist?: boolean;
255
266
  }
@@ -274,6 +285,11 @@ export interface Schedule {
274
285
  is_auto?: boolean;
275
286
  /** 实际工时,精确到小数点后一位 */
276
287
  actual_work_time?: number;
288
+ }
289
+ /**
290
+ * 排期响应
291
+ */
292
+ export interface ScheduleResponse extends Schedule {
277
293
  /** 计划工期(仅在差异化排期数组中返回) */
278
294
  planned_construction_period?: number;
279
295
  }
@@ -298,8 +314,6 @@ export interface ExpandParams {
298
314
  relation_fields_detail?: boolean;
299
315
  /** 是否需要返回用户信息 */
300
316
  need_user_detail?: boolean;
301
- /** 是否需要子任务父级信息 */
302
- need_sub_task_parent?: boolean;
303
317
  /** 是否融合需要交付物 */
304
318
  need_union_deliverable?: boolean;
305
319
  /** 是否需要返回WBS链路实例 */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * 通用类型定义
3
- * 100% 参考 Meego API 文档: Meego-API-docs/common/数据结构汇总.md
3
+ * 参考 Meego API 文档和 Meego-API-docs/数据结构汇总.md
4
4
  */
5
5
  /**
6
6
  * 默认 Logger 实现(使用 console)
@@ -2,10 +2,11 @@
2
2
  * 配置相关类型定义
3
3
  * 100% 参考 Meego API 文档
4
4
  */
5
- import type { FieldValue, FieldValuePair, FieldConf, SimpleField, MultiText, UserDetail, Connection } from './common.js';
6
- import type { RelationFieldDetail, SearchGroup } from './workitem.js';
5
+ import type { FieldValue, FieldValuePair, FieldValuePairResponse, FieldConf, SimpleField, MultiText, UserDetail, Connection, ExpandParams } from './common.js';
6
+ import type { RelationFieldDetail, SearchGroup, WorkItemCreateRequiredMode } from './workitem.js';
7
7
  export type ResourceId = number | string;
8
8
  export type ResourceUserDetail = Partial<UserDetail>;
9
+ export type ResourceQueryExpand = Pick<ExpandParams, 'need_multi_text' | 'relation_fields_detail'>;
9
10
  export type FlowMode = 'stateflow' | 'workflow';
10
11
  export interface RoleInfo {
11
12
  id: string;
@@ -273,10 +274,7 @@ export interface ResourceQueryRequest {
273
274
  work_item_ids: ResourceId[];
274
275
  fields?: string[];
275
276
  work_item_type_key: string;
276
- expand?: {
277
- need_multi_text?: boolean;
278
- relation_fields_detail?: boolean;
279
- };
277
+ expand?: ResourceQueryExpand;
280
278
  }
281
279
  export interface ResourceTemplateInfo {
282
280
  id?: ResourceId;
@@ -301,7 +299,7 @@ export interface ResourceWorkItemDetail {
301
299
  created_at?: number;
302
300
  updated_at?: number;
303
301
  role_owners?: ResourceRoleOwner[];
304
- fields?: FieldValuePair[];
302
+ fields?: FieldValuePairResponse[];
305
303
  simple_name?: string;
306
304
  template_id?: ResourceId;
307
305
  template?: ResourceTemplateInfo;
@@ -333,6 +331,12 @@ export interface ResourceCreateInstanceRequest {
333
331
  name?: string;
334
332
  field_value_pairs?: FieldValuePair[];
335
333
  template_id?: number;
334
+ /**
335
+ * 创建工作项必填模式
336
+ * - 0: 不校验必填项(默认)
337
+ * - 1: 校验新建页必填项,未填字段返回创建失败并提示哪些字段未填
338
+ */
339
+ required_mode?: WorkItemCreateRequiredMode;
336
340
  }
337
341
  export interface ResourceCreateInstanceResponseData {
338
342
  work_item_id: ResourceId;
@@ -2,7 +2,7 @@
2
2
  * 工作项相关类型定义
3
3
  * 100% 参考 Meego API 文档
4
4
  */
5
- import type { FieldValuePair, RoleOwner, Schedule, UserDetail, Connection, MultiText, SearchAfterPagination } from './common.js';
5
+ import type { FieldValuePair, FieldValuePairResponse, RoleOwner, RoleOwnerResponse, Schedule, ScheduleResponse, UserDetail, Connection, MultiText, SearchAfterPagination, ExpandParams } from './common.js';
6
6
  export type { UserDetail, Connection, MultiText };
7
7
  /** 工作流模式 */
8
8
  export type WorkItemPattern = 'Node' | 'State';
@@ -76,13 +76,13 @@ export interface WorkflowNode {
76
76
  /** 节点状态 1:未开始 2:进行中 3:已完成 */
77
77
  status: NodeStatus;
78
78
  /** 节点表单字段 */
79
- fields?: FieldValuePair[];
79
+ fields?: FieldValuePairResponse[];
80
80
  /** 负责人 user_key 数组 */
81
81
  owners?: string[];
82
82
  /** 节点总排期 */
83
- node_schedule?: Schedule;
83
+ node_schedule?: ScheduleResponse;
84
84
  /** 差异化排期数组 */
85
- schedules?: Schedule[];
85
+ schedules?: ScheduleResponse[];
86
86
  /** 子任务列表 */
87
87
  sub_tasks?: SubTask[];
88
88
  /** 实际开始时间 */
@@ -90,7 +90,7 @@ export interface WorkflowNode {
90
90
  /** 实际结束时间 */
91
91
  actual_finish_time?: string;
92
92
  /** 角色负责人 */
93
- role_assignee?: RoleOwner[];
93
+ role_assignee?: RoleOwnerResponse[];
94
94
  /** 是否里程碑节点 */
95
95
  milestone?: boolean;
96
96
  /** 负责人设置方式 */
@@ -98,7 +98,7 @@ export interface WorkflowNode {
98
98
  /** 是否差异化排期 */
99
99
  different_schedule?: boolean;
100
100
  /** 节点自定义字段 */
101
- node_custom_fields?: FieldValuePair[];
101
+ node_custom_fields?: FieldValuePairResponse[];
102
102
  }
103
103
  /**
104
104
  * 状态流节点
@@ -111,9 +111,9 @@ export interface StateFlowNode {
111
111
  /** 状态 */
112
112
  status: NodeStatus;
113
113
  /** 字段 */
114
- fields?: FieldValuePair[];
114
+ fields?: FieldValuePairResponse[];
115
115
  /** 角色负责人 */
116
- role_owners?: RoleOwner[];
116
+ role_owners?: RoleOwnerResponse[];
117
117
  /** 状态开始时间 */
118
118
  actual_begin_time?: string;
119
119
  /** 状态结束时间 */
@@ -195,7 +195,7 @@ export interface WorkItem {
195
195
  /** 状态时间记录(节点流) */
196
196
  state_times?: StateTime[];
197
197
  /** 字段列表 */
198
- fields?: FieldValuePair[];
198
+ fields?: FieldValuePairResponse[];
199
199
  /** 用户详情(扩展查询) */
200
200
  user_details?: UserDetail[];
201
201
  /** 富文本信息(扩展查询) */
@@ -217,15 +217,15 @@ export type WorkItemInfo = Record<string, unknown> & {
217
217
  * 查询扩展选项
218
218
  */
219
219
  export interface QueryWorkItemExpand {
220
- /** 是否需要用户详细信息 */
220
+ /** 是否需要返回用户信息 */
221
221
  need_user_detail?: boolean;
222
- /** 是否需要工作流信息 */
222
+ /** 是否需要返回工作流信息 */
223
223
  need_workflow?: boolean;
224
- /** 是否需要富文本信息 */
224
+ /** 是否需要返回富文本信息 */
225
225
  need_multi_text?: boolean;
226
- /** 是否需要关联字段详情 */
226
+ /** 是否需要返回工作项关联详细信息 */
227
227
  relation_fields_detail?: boolean;
228
- /** 是否需要复合字段组标识 */
228
+ /** 是否需要返回复合字段补充组标识 */
229
229
  need_group_uuid_for_compound?: boolean;
230
230
  /** 是否需要子任务父级信息 */
231
231
  need_sub_task_parent?: boolean;
@@ -551,6 +551,8 @@ export interface UploadFileRequest {
551
551
  /** 文件 MIME 类型(可选,未传时会结合 Blob.type 与文件名推断) */
552
552
  mimeType?: string;
553
553
  }
554
+ /** 上传通用文件响应:平台返回一个或多个文件 URL */
555
+ export type UploadFileResponse = string[];
554
556
  /**
555
557
  * 下载附件请求参数
556
558
  */
@@ -636,14 +638,10 @@ export interface CompleteRollbackSubtaskRequest {
636
638
  assignee?: string[];
637
639
  /** 子任务角色负责人列表(角色联动模式使用) */
638
640
  role_assignee?: RoleOwner[];
639
- /** 单个估分排期信息 */
640
- schedule?: Schedule;
641
641
  /** 估分排期信息 */
642
642
  schedules?: Schedule[];
643
643
  /** 交付物字段列表 */
644
644
  deliverable?: FieldValuePair[];
645
- /** 目标更新的字段列表 */
646
- update_fields?: FieldValuePair[];
647
645
  /** 备注信息 */
648
646
  note?: string;
649
647
  }
@@ -691,7 +689,7 @@ export interface SubTask {
691
689
  /** 子任务名称 */
692
690
  name: string;
693
691
  /** 排期数组 */
694
- schedules?: Schedule[];
692
+ schedules?: ScheduleResponse[];
695
693
  /** 排序字段 */
696
694
  order?: number;
697
695
  /** 是否已完成 */
@@ -703,11 +701,11 @@ export interface SubTask {
703
701
  /** 子任务负责人 userKey 列表(非角色联动模式) */
704
702
  assignee?: string[];
705
703
  /** 子任务角色负责人列表(角色联动模式) */
706
- role_assignee?: RoleOwner[];
704
+ role_assignee?: RoleOwnerResponse[];
707
705
  /** 交付物 */
708
- deliverable?: FieldValuePair[];
706
+ deliverable?: FieldValuePairResponse[];
709
707
  /** 自定义字段 */
710
- fields?: FieldValuePair[];
708
+ fields?: FieldValuePairResponse[];
711
709
  /** 备注(同 note) */
712
710
  details?: string;
713
711
  /** 实际开始时间,ISO 8601 格式 */
@@ -1262,16 +1260,14 @@ export type FlowType = 0 | 1;
1262
1260
  * 工作流查询扩展选项
1263
1261
  */
1264
1262
  export interface WorkflowQueryExpand {
1265
- /** 是否需要返回用户详细信息(默认 false) */
1263
+ /** 是否需要返回用户信息 */
1266
1264
  need_user_detail?: boolean;
1267
- /** 是否需要 workflow 的信息(仅节点流工作项支持,状态流返回空结构) */
1268
- need_workflow?: boolean;
1269
- /** 是否需要富文本信息 */
1270
- need_multi_text?: boolean;
1271
- /** 是否需要返回工作项关联详细信息 */
1272
- relation_fields_detail?: boolean;
1273
- /** 是否要补充复合字段组标识 */
1274
- need_group_uuid_for_compound?: boolean;
1265
+ /** 是否需要子任务父级信息 */
1266
+ need_sub_task_parent?: boolean;
1267
+ /** 是否需要返回富文本 Markdown */
1268
+ need_rich_text_mark_down?: boolean;
1269
+ /** 是否需要返回节点子项关联详情 */
1270
+ need_sub_workitem_detail?: boolean;
1275
1271
  }
1276
1272
  /**
1277
1273
  * 获取工作流详情请求
@@ -1341,6 +1337,15 @@ export interface ScheduleConstraintRule {
1341
1337
  /** 按工作项类型区分的 WBS 子实例联动配置 */
1342
1338
  wbs_sub_instance_type?: Record<string, boolean>;
1343
1339
  }
1340
+ /**
1341
+ * 节点新增关联子工作项
1342
+ */
1343
+ export interface AddSubWorkitemsRequest {
1344
+ /** 节点子项关系 UUID,对应节点子项配置中的关系 */
1345
+ relation_id: string;
1346
+ /** 要新增关联的已有工作项实例 ID 列表,单次最多 10 个 */
1347
+ workitems: number[];
1348
+ }
1344
1349
  /**
1345
1350
  * 更新节点请求(节点流工作项)
1346
1351
  * 接口: PUT /open_api/:project_key/workflow/:work_item_type_key/:work_item_id/node/:node_id
@@ -1360,6 +1365,8 @@ export interface UpdateNodeRequest {
1360
1365
  schedule_constraint_rule?: ScheduleConstraintRule;
1361
1366
  /** 节点自定义字段 */
1362
1367
  node_custom_fields?: FieldValuePair[];
1368
+ /** 节点新增关联子工作项 */
1369
+ add_sub_workitems?: AddSubWorkitemsRequest;
1363
1370
  }
1364
1371
  /** 流转必填信息查询模式 */
1365
1372
  export type TransitionRequiredMode = 'unfinished';
@@ -1476,16 +1483,10 @@ export interface WbsViewQueryParams {
1476
1483
  /**
1477
1484
  * WBS 视图扩展查询参数
1478
1485
  */
1479
- export interface WbsViewExpand {
1480
- /** 是否需要融合交付物信息 */
1481
- need_union_deliverable?: boolean;
1486
+ export type WbsViewExpand = Pick<ExpandParams, 'need_union_deliverable' | 'need_wbs_relation_chain_path' | 'need_wbs_relation_chain_entity'> & {
1482
1487
  /** 是否需要计划表自定义列聚合字段 */
1483
1488
  need_schedule_table_agg?: boolean;
1484
- /** 是否需要 WBS 链路层级信息 */
1485
- need_wbs_relation_chain_path?: boolean;
1486
- /** 是否需要 WBS 链路实例信息 */
1487
- need_wbs_relation_chain_entity?: boolean;
1488
- }
1489
+ };
1489
1490
  /**
1490
1491
  * WBS 视图请求体
1491
1492
  */
@@ -1531,7 +1532,7 @@ export interface WbsViewRelatedSubWorkItem {
1531
1532
  /** 空间 key */
1532
1533
  project_key?: string;
1533
1534
  /** 字段聚合值 */
1534
- field_values?: FieldValuePair[];
1535
+ field_values?: FieldValuePairResponse[];
1535
1536
  /** 融合交付物 */
1536
1537
  union_deliverable?: Array<Record<string, unknown>>;
1537
1538
  /** 模板 key */
@@ -1758,14 +1759,14 @@ export interface WbsDraftNodeRoleOwners {
1758
1759
  path?: string;
1759
1760
  work_item_id?: number;
1760
1761
  name?: string;
1761
- role_owners?: RoleOwner[];
1762
+ role_owners?: RoleOwnerResponse[];
1762
1763
  work_item_type_key?: string;
1763
1764
  }
1764
1765
  /**
1765
1766
  * WBS 草稿字段交付物
1766
1767
  */
1767
1768
  export interface WbsDraftFieldDeliverableItem {
1768
- field_info?: FieldValuePair;
1769
+ field_info?: FieldValuePairResponse;
1769
1770
  placeholder?: string;
1770
1771
  remark?: string;
1771
1772
  status?: number;
@@ -1801,11 +1802,11 @@ export interface WbsDraftWorkItem {
1801
1802
  wbs_status_map?: Record<string, string>;
1802
1803
  sub_work_item?: WbsDraftWorkItem[];
1803
1804
  name?: string;
1804
- deliverable?: FieldValuePair[];
1805
- schedule?: Schedule;
1806
- schedules?: Schedule[];
1805
+ deliverable?: FieldValuePairResponse[];
1806
+ schedule?: ScheduleResponse;
1807
+ schedules?: ScheduleResponse[];
1807
1808
  points?: number;
1808
- role_owners?: RoleOwner[];
1809
+ role_owners?: RoleOwnerResponse[];
1809
1810
  work_item_type_key?: string;
1810
1811
  milestone?: boolean;
1811
1812
  connections?: Connection[];
@@ -1825,7 +1826,7 @@ export interface WbsDraftWorkItem {
1825
1826
  dependencies?: WbsDraftDependencyInfo[];
1826
1827
  relative_schedule_v2?: WbsDraftScheduleReferenceValue[];
1827
1828
  is_schedule_agg_item?: boolean;
1828
- field_values?: FieldValuePair[];
1829
+ field_values?: FieldValuePairResponse[];
1829
1830
  }
1830
1831
  /**
1831
1832
  * WBS 草稿
@@ -1838,7 +1839,7 @@ export interface WbsDraft {
1838
1839
  connections?: Connection[];
1839
1840
  draft_id?: string;
1840
1841
  delete_uuids?: string[];
1841
- role_owners?: Record<string, RoleOwner[]>;
1842
+ role_owners?: Record<string, RoleOwnerResponse[]>;
1842
1843
  user_details?: UserDetail[];
1843
1844
  work_item_id?: number;
1844
1845
  }
@@ -2502,11 +2503,9 @@ export interface QueryWbsViewRowDetailResponse {
2502
2503
  /**
2503
2504
  * 发布态计划表扩展查询参数
2504
2505
  */
2505
- export interface QueryWbsInstanceExpand {
2506
- need_wbs_relation_chain_entity?: boolean;
2507
- need_wbs_relation_chain_path?: boolean;
2506
+ export type QueryWbsInstanceExpand = Pick<ExpandParams, 'need_wbs_relation_chain_entity' | 'need_wbs_relation_chain_path'> & {
2508
2507
  need_parent_work_item?: boolean;
2509
- }
2508
+ };
2510
2509
  /**
2511
2510
  * 发布态计划表扩展信息查询请求
2512
2511
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meeglesdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "飞书项目 Open API TypeScript SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -24,7 +24,15 @@
24
24
  "test": "bun test",
25
25
  "test:auth": "bun test tests/integration/auth.test.ts",
26
26
  "perf": "bun run tests/perf/benchmark.ts",
27
- "release:check": "bun run typecheck && bun test tests/unit && bun run build",
27
+ "release:artifacts": "bun run build && node scripts/check-release-artifacts.mjs",
28
+ "openapi:field-diff": "node scripts/check-openapi-field-diff.mjs",
29
+ "openapi:field-report": "node scripts/check-openapi-field-diff.mjs --json",
30
+ "openapi:snapshot:update": "node scripts/check-openapi-docs-snapshot.mjs --update",
31
+ "openapi:snapshot:check": "node scripts/check-openapi-docs-snapshot.mjs",
32
+ "openapi:field-targets:check": "node scripts/check-openapi-field-targets.mjs",
33
+ "openapi:field-check": "bun run openapi:field-targets:check && node scripts/check-openapi-field-diff.mjs --fail-on-diff",
34
+ "response-model-check": "node scripts/check-response-model-boundaries.mjs",
35
+ "release:check": "bun run typecheck && bun run openapi:snapshot:check && bun run openapi:field-check && bun run response-model-check && bun test tests/unit && bun run build && node scripts/check-release-artifacts.mjs",
28
36
  "prepublishOnly": "bun run release:check"
29
37
  },
30
38
  "keywords": [