declare module 'teambition-types' { /** * 可以用于获取 schema 类型上一些对象类型字段的键名,如: * 用 `NestedKeys` 匹配 * `[ '_id', 'name', 'avatarUrl' ]` 这样的数组值。对于 optional * 或者可能为 `null` 的字段,如 TaskSchema 上的 `executor`, * 会排除 optional 或 `null` 的影响,给出当有值时该对象应该 * 有的字段。 */ type NestedKeys = Array[K]>>; } declare module 'teambition-types' { type ActivenessId = string & { kind: 'ActivenessId'; }; type ActivityId = string & { kind: 'ActivityId'; }; type AdvancedCustomFieldId = string & { kind: 'AdvancedCustomFieldId'; }; type ApplicationId = string & { kind: 'ApplicationId'; }; type AssignmentLinkId = string & { kind: 'AssignmentLink'; }; type CollectionId = string & { kind: 'CollectionId'; }; type CommonGroupId = string & { kind: 'CommonGroupId'; }; type CustomApplicationId = string & { kind: 'CustomApplication'; }; type CustomFieldCategoryId = string & { kind: 'CustomFieldCategoryId'; }; type CustomFieldChoiceId = string & { kind: 'CustomFieldChoiceId'; }; type CustomFieldEntityId = string & { kind: 'CustomFieldEntityId'; }; type CustomFieldId = string & { kind: 'CustomFieldId'; }; type CustomFieldLinkId = string & { kind: 'CustomFieldLinkId'; }; type CustomFieldValueId = string & { kind: 'CustomFieldValueId'; }; type CustomRoleId = string & { kind: 'CustomRoleId'; }; type DashboardCardId = string & { kind: 'DashboardCardId'; }; type EntryCategoryId = string & { kind: 'EntryCategoryId'; }; type EntryId = string & { kind: 'EntryId'; }; type EventId = string & { kind: 'EventId'; }; type FeedbackId = string & { kind: 'FeedbackId'; }; type FileId = string & { kind: 'FileId'; }; type GroupId = string & { kind: 'GroupId'; }; type HomeActivityId = string & { kind: 'HomeActivityId'; }; type KanbanConfigId = string & { kind: 'KanbanConfigId'; }; type MemberId = string & { kind: 'MemberId'; }; type MemberIdentityId = string & { kind: 'MemberIdentityId'; }; type MessageId = string & { kind: 'MessageId'; }; type ObjectLinkId = string & { kind: 'ObjectLinkId'; }; type OrganizationId = string & { kind: 'OrganizationId'; }; type PostId = string & { kind: 'PostId'; }; type PreferenceId = string & { kind: 'PreferenceId'; }; type PriorityGroupId = string & { kind: 'PriorityGroupId'; }; type PriorityOptionId = string & { kind: 'PriorityOptionId'; }; type ProjectBoardId = string & { kind: 'ProjectBoardId'; }; type ProjectId = string & { kind: 'ProjectId'; }; type ProjectPortalMode = 'grid' | 'list' | 'table'; type ProjectOrder = 'updated' | 'name' | 'recentVisit'; type ProjectReminderId = string & { kind: 'ProjectReminderId'; }; type ProjectStatusActivityId = string & { kind: 'ProjectStatusActivityId'; }; type ProjectTagId = string & { kind: 'ProjectTagId'; }; type ProjectTemplateId = string & { kind: 'ProjectTemplateId'; }; type RoomId = string & { kind: 'RoomId'; }; type ScenarioFieldConfigId = string & { kind: 'ScenarioFieldConfigId'; }; type ScenarioFieldId = string & { kind: 'ScenarioFieldId'; }; type SmartGroupId = string & { kind: 'SmartGroupId'; }; type SprintId = string & { kind: 'SprintId'; }; type StageId = string & { kind: 'StageId'; }; type SubscribeId = string & { kind: 'SubscribeId'; }; type SubtaskId = string & { kind: 'SubtaskId'; }; type TagCategoryId = string & { kind: 'TagCategoryId'; }; type TagId = string & { kind: 'TagId'; }; type TapChartId = string & { kind: 'TapChartId'; }; type TapDashboardId = string & { kind: 'TapDashboardId'; }; type TaskDependencyId = string & { kind: 'TaskDependencyId'; }; type TaskflowId = string & { kind: 'TaskflowId'; }; type TaskflowStatusId = string & { kind: 'TaskflowStatusId'; }; type TaskId = string & { kind: 'TaskId'; }; type TasklistId = string & { kind: 'TasklistId'; }; type TaskPrivilegeId = string & { kind: 'TaskPrivilegeId'; }; type TaskReminderId = string & { kind: 'TaskReminderId'; }; type TeamId = string & { kind: 'TeamId'; }; type TestcaseId = string & { kind: 'TestcaseId'; }; type TesthubId = string & { kind: 'TesthubId'; }; type TestplanId = string & { kind: 'TestplanId'; }; type TestcaseStepId = string & { kind: 'TestcaseStepId'; }; type TraceId = string & { kind: 'TraceId'; }; type UserId = string & { kind: 'UserId'; }; type VersionId = string & { kind: 'VersionId'; }; type WorkId = string & { kind: 'WorkId'; }; type TaskPosId = string & { kind: 'TaskPosId'; }; type WorkCalendarId = string & { kind: 'WorkCalendarId'; }; } declare module 'teambition-types' { type DefaultRoleId = -1 | 0 | 1 | 2; type DetailObjectId = TaskId | PostId | EventId | FileId | TestcaseId | EntryId | TraceId; type RoleId = DefaultRoleId | CustomRoleId; } declare module 'teambition-types' { type Actor = 'executor' | 'creator'; type ApprovalStatus = -1 | 1 | 2; type AssignmentType = 'teambition' | 'aone'; type BasicScenarioFieldType = TaskBasicScenarioFieldType | EventBasicScenarioFieldType; type CustomFieldBoundType = 'member' | 'project' | 'application'; type CustomFieldType = 'date' | 'dropDown' | 'multipleChoice' | 'number' | 'text' | 'lookup' | 'commongroup' | 'work' | 'cascading' | 'lookup2'; type CustomFieldSubtype = 'story' | 'bug'; type CustomRoleType = 'project' | 'organization'; type CustomScenarioFieldType = 'customfield'; type DefaultColors = 'gray' | 'red' | 'yellow' | 'green' | 'blue' | 'purple' | 'cyan'; type DetailObjectType = 'entry' | 'event' | 'post' | 'task' | 'work' | 'testcase' | 'trace'; type DetailObjectTypes = 'entries' | 'events' | 'posts' | 'tasks' | 'works' | 'testcases' | 'traces'; type DivisionType = TaskDivisionType; type EntryStatus = 'confirmed' | 'approved'; type EntryType = 1 | -1; type EventOfficialScenarioFieldType = 'content' | 'location' | 'tag'; type EventScenarioFieldIcon = 'event' | 'lecture' | 'training' | 'workshop' | 'forum' | 'seminar' | 'personal'; type JoinProjectRole = 'default' | 'owner'; type ProjectStatusDegree = 'normal' | 'risky' | 'urgent'; type ProjectTagVisibleOption = 'organization' | 'involves'; type ProjectTemplateVisibleOption = 'organization' | 'involves'; type DeprecatedReminderType = 'customize' | 'dueDate' | 'startDate' | 'unset'; type DeprecatedReminderRuleType = 'startDate' | 'dueDate' | 'customize' | 'beforeStartDate' | 'beforeDueDate' | 'afterStartDate' | 'afterDueDate'; type DeprecatedReminderUnit = 'minute' | 'hour' | 'day'; type ScenarioFieldConfigIcon = TaskScenarioFieldIcon | EventScenarioFieldIcon | TestcaseScenarioFieldIcon; type ScenarioFieldConfigObjectType = 'task' | 'event' | 'testcase'; type ScenarioFieldType = CustomScenarioFieldType | TaskOfficialScenarioFieldType | EventOfficialScenarioFieldType | TestcaseOfficialScenarioFieldType; type ScenarioProTemplateConfigType = 'story' | 'bug' | 'subtask' | 'milestone'; type SmartGroupPredefinedIcon = 'taskToday' | 'taskUndone' | 'taskDone' | 'taskNotAssigned' | 'taskMyExecuted'; type SmartGroupType = 'custom' | 'story' | 'sprint' | 'bug' | 'story.custom' | 'bug.custom' | 'sprint.custom'; type SmartGroupViewType = 'table' | 'time' | 'kanban' | 'list'; type SmartGroupViewVisibilityType = 'user' | 'project'; type SmartGroupViewTaskLayer = 'all' | 'onlyTopLevel' | 'exceptTopLevel'; type TaskSortMethod = 'duedate' | 'priority' | 'created_asc' | 'created_desc' | 'startdate' | 'startdate_desc' | 'custom' | 'updated_asc' | 'updated_desc'; type SwimAxisLane = 'sprint' | 'subtask' | 'executor' | 'stage' | 'priority' | 'isDone' | 'taskType' | 'rating' | 'storyPoint'; type BoardAxisType = 'iterationSprint' | 'priority' | 'stage' | 'taskflowStatus' | 'taskflow' | 'scenarioConfig' | 'scenarioConfigStatus' | 'dueDate' | 'updated'; type TagType = 'organization' | 'project'; type TaskBasicScenarioFieldType = 'executor' | 'startDate' | 'dueDate'; type EventBasicScenarioFieldType = 'startDate' | 'dueDate'; type TaskDependencyKind = 'start_start' | 'start_finish' | 'finish_start' | 'finish_finish'; type TaskDivisionType = 'scenariofields' | 'trace' | 'subtasks' | 'links'; type TaskOfficialScenarioFieldType = 'note' | 'priority' | 'tag' | 'worktimes' | 'storyPoint' | 'taskProgress' | 'rating' | 'sprint'; type TaskPriority = -10 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | null; type TaskScenarioFieldIcon = 'task' | 'requirement' | 'bug' | 'hr' | 'resource' | 'order' | 'salesLead' | 'subtask' | 'call' | 'visit' | 'forum' | 'milestone'; type TeamMemberStatus = 'in' | 'quited' | 'disabled'; type TestcaseOfficialScenarioFieldType = 'precondition' | 'priority' | 'steps' | 'caseType' | 'tag'; type TestcaseScenarioFieldIcon = 'testcase'; type TestcasePriority = -1 | 0 | 1 | 2 | 3 | 4 | 5; type TestcaseStepType = { _id: TestcaseStepId; desc: string; expected: string; }; type TestcaseType = 'function' | 'performance' | 'config' | 'deployment' | 'security' | 'api' | 'other'; type UserLevel = -2 | -1 | 0 | 1 | 2; type VisibleOption = 'members' | 'involves'; type TapChartName = 'custom' | 'executordistributiontasks' | 'prioritydistributiontasks' | 'groupdonetasks' | 'donetasks' | 'periodcompletetasks' | 'executortasks' | 'executordonetasks' | 'executorduetasks' | 'sprintdistributionbugs' | 'executordistributionbugs' | 'creatordistributionbugs' | 'prioritydistributionbugs' | 'taskstatusistributionbugs' | 'executortaskstatusbugs' | 'overview_report' | 'scrum_sprint_taskflow' | 'general_project_burndown' | 'general_project_trend' | 'worktime_task' | 'delivery_cycle' | 'scrum_sprint_burndown' | 'scrum_sprint_burnup' | 'scrum_sprint_analysis' | 'scrum_team_speed' | 'scrum_bug_age_report' | 'scrum_bug_trend' | 'scrum_bug_accumulative_trend' | 'all_testcase_status_distribution' | 'all_testcase_trend' | 'total' | 'done_detail' | 'undone_detail' | 'overdue_detail' | 'unassigned_detail' | 'ontimedone_detail' | 'duetoday_detail' | 'overduedone_detail' | 'noduetime_detail' | 'personal_summary' | 'personal_trend' | 'personal_insight_metric' | 'personal_radar_chart' | 'personal_impact_on_produce_task' | 'personal_task_time_analysis' | 'personal_cooperation_analysis' | 'personal_insight_metric_trend' | 'team_insight' | 'team_summary' | 'team_trend' | 'team_task_list' | 'team_member_week_done_top' | 'team_member_overdue_top' | 'team_space_week_done_top' | 'team_space_overdue_top' | 'team_task_used_percent'; } declare module 'teambition-types' { interface AdvancedCustomField { _id: AdvancedCustomFieldId; icon: string; hasCreateUrl: boolean; name: string; objectType: string; type: CustomFieldType; } interface CustomFieldSnapshotItem { _id: string; description: string; thumbUrl: string; title: string; url: string; meta?: {}; } interface CustomFieldRelevantSetting { editable?: boolean; quotable?: boolean; removable?: boolean; } interface CustomFieldWorkSnapshotItem { _id: FileId; fileType: string; fileName: string; fileSize: number; thumbnail: string; thumbnailUrl: string; fileCategory: string; } interface CustomFieldValue { snapshot?: { name: string; type: CustomFieldType; }; _customfieldId: CustomFieldId; type: CustomFieldType; value: Array | Array; values: string[]; } /** * @deprecated */ interface DeprecatedOnTimeReminderRule { type: Extract; date: null; } /** * @deprecated */ interface DeprecatedAbsoluteReminderRule { type: Extract; date: string; } /** * @deprecated */ interface DeprecatedRelativeReminderRule { type: Extract; date: null; relative: { unit: DeprecatedReminderUnit; value: number; }; } /** * @deprecated 提醒规则,兼容字段,不推荐使用 */ type DeprecatedReminderRule = DeprecatedOnTimeReminderRule | DeprecatedAbsoluteReminderRule | DeprecatedRelativeReminderRule; interface DeprecatedReminder { date: string; type: DeprecatedReminderType; members: UserId[]; rules: DeprecatedReminderRule[]; _creatorId: UserId; } interface LikeSchema { isLike: boolean; likesCount: number; likesGroup: ExecutorOrCreator[]; } interface TbUrlSchema { statusCode: number; isExist: boolean; code: string; origin?: string; } interface ProjectInviteSchema { projectId: ProjectId; invitorId: string; signCode: string; } interface CustomRoleSchema { _id: CustomRoleId; name: string; _creatorId: UserId; _organizationId: OrganizationId; _projectId?: ProjectId; updated: string; created: string; isDefault: boolean; level: number; permissions: string[]; type: T; } type Role = CustomRoleSchema<'project' | 'organization'>; interface PermissionBinding { level: UserLevel; orgLevel: UserLevel; permissions: string[]; type: 'project'; _projectId: ProjectId; isJoined: boolean; joinProjectRole: JoinProjectRole; externalRoleIds: CustomRoleId[]; memberRoleId: CustomRoleId | null; memberRoleIds: RoleId[]; memberRoles: Role[]; } interface UserSnippet { _id: UserId; name: string; avatarUrl: string; } interface ExecutorOrCreator extends UserSnippet { isRobot?: boolean; } interface InviteLinkSchema { inviteLink: string; mobileInviteLink: string; signCode: string; created: string; expiration: string; } interface CreatedInProjectSchema { work: number; post: number; event: number; task: number; } interface RecommendMemberSchema extends UserSnippet { email: string; latestActived: string; isActive: boolean; website: string; title: string; location: string; } interface ProjectStatisticSchema { task: { total: number; done: number; today: number; }; recent: number[]; days: number[][]; } interface ReportSummarySchema { accomplishedDelayTasksCount: number; accomplishedOntimeTasksCount: number; accomplishedWeekSubTaskCount: number; accomplishedWeekTaskCount: number; inprogressDelayTasksCount: number; inprogressOntimeTasksCount: number; inprogressSubTasksCount: number; notStartedTasksCount: number; totalTasksCount: number; unassignedTasksCount: number; accomplishedTasksCount: number; accomplishedWeekTasksCount: number; accomplishedOntimeWeekTasksCount: number; accomplishedWeekSubTasksCount: number; accomplishedOntimeWeekSubTasksCount: number; accomplishedSubTasksCount: number; accomplishedOntimeSubTasksCount: number; } interface ReportAnalysisSchema { values: { unfinishedTaskCount: number; date: string; }[]; } interface FavoriteResponse { _id: string; _creatorId: UserId; _refId: DetailObjectId; refType: string; isFavorite: boolean; isUpdated: boolean; isVisible: boolean; data: any; created: string; updated: string; } interface UndoFavoriteResponse { _refId: DetailObjectId; refType: DetailObjectType; isFavorite: boolean; } interface TasksMeCount { executedTasksDoneCount: number; executedTasksUndoneCount: number; createdTasksDoneCount: number; createdTasksUndoneCount: number; involvedTasksDoneCount: number; involvedTasksUndoneCount: number; createdSubtasksDoneCount: number; createdSubtasksUndoneCount: number; executedSubtasksDoneCount: number; executedSubtasksUndoneCount: number; } type TapBaseRefType = keyof TapGenericFilterRequest; type TapBaseDataType = 'type/MongoId' | 'type/Date' | 'type/DateCollection' | 'type/Number' | 'type/String' | 'type/Boolean'; type TapSupportedRelative = 'all' | 'past7days' | 'pastmonth' | 'past3months' | 'past30days'; type TapSupportedDateSeries = '0to3' | '3to6' | '6to10' | '10to14' | '14plus'; type TapSupportedWeekSeries = '1w' | '1to2w' | '2to4w' | '4wplus'; type TapFilterComponent = 'member' | 'singleSprint' | 'Mixed'; type TapSelectSection = 'storypoint' | 'worktime' | 'taskcount' | 'taskpercent'; type TapDateSeries = 'day' | 'week' | 'month' | 'year'; type TapChartType = 'pie' | 'bar' | 'line' | 'area' | 'scatter'; type TapDimensionBaseDataType = 'string' | 'datetime' | 'dropDown' | 'text' | 'boolean' | 'int' | 'commongroup'; type TapChartOperator = '~' | '=' | '<' | '>=' | 'in'; type TapCustomFieldChoiceItem = { _id: string; value: string; }; type TapDimensionType = { dataType: TapDimensionBaseDataType; column: TapBaseRefType; format: null | TapDateSeries; name: string; choices: null | TapCustomFieldChoiceItem[]; }; interface TapDashboardSection { section: TapSelectSection; name: string; } interface TapChartProject { id: ProjectId; logo: string; name: string; } interface TapCrossUser { id: UserId; avatarUrl: string; name: string; } type TapFilterTarget = { component: TapFilterComponent; column: R; dataType: D; refData: U; name: string; choices?: null | TapCustomFieldChoiceItem[]; op?: TapChartOperator; }; interface TapDataSettings { timeCycle?: TapDateSeries; taskType?: ScenarioFieldConfigId; startOfTaskFlowId?: TaskflowStatusId; endOfTaskFlowId?: TaskflowStatusId; } interface TapGenericFilterRequest { projects?: ProjectId[]; projectId?: ProjectId[]; executorId?: UserId[]; executorGroup?: TeamId[]; stageId?: StageId[]; organizationId?: OrganizationId[]; creatorId?: UserId[]; creatorGroup?: TeamId[]; tasklistId?: TasklistId[]; createBegin?: string; createEnd?: string; createRelative?: string; dueBegin?: string; dueEnd?: string; dueRelative?: string; accBegin?: string; accEnd?: string; accRelative?: string; startBegin?: string; startEnd?: string; startRelative?: string; rangeBegin?: string; rangeEnd?: string; rangeRelative?: string; isDone?: boolean; isArchived?: boolean; priority?: TaskPriority; isOverdue?: boolean; limit?: number; isSubtask?: boolean; pageCount?: number; pageNum?: number; sprintId?: SprintId[]; weekend?: number[]; holiday?: string[]; groupField?: string; taskflowId?: TaskflowId[]; taskflowstatusId?: TaskflowStatusId[]; dateSeries?: TapSupportedDateSeries[]; testplanId?: TestplanId; accomplished?: string; created?: string; startDate?: string; involveMembers?: UserId[]; scenariofieldconfigId?: ScenarioFieldConfigId[]; tagIds?: TagId[]; isDue?: boolean; proTemplateConfigType?: ScenarioProTemplateConfigType[]; isDuedateExist?: boolean; weekSeries?: TapSupportedWeekSeries[]; date?: string; commongroup?: string; } type TapFilterItem = TapFilterTarget<'projectId', 'type/MongoId', ProjectId[]> | TapFilterTarget<'executorId', 'type/MongoId', UserId[]> | TapFilterTarget<'executorGroup', 'type/MongoId', TeamId[]> | TapFilterTarget<'stageId', 'type/MongoId', StageId[]> | TapFilterTarget<'organizationId', 'type/MongoId', OrganizationId[]> | TapFilterTarget<'creatorId', 'type/MongoId', UserId[]> | TapFilterTarget<'creatorGroup', 'type/MongoId', TeamId[]> | TapFilterTarget<'tasklistId', 'type/MongoId', TasklistId[]> | TapFilterTarget<'createBegin', 'type/Date', string> | TapFilterTarget<'createEnd', 'type/Date', string> | TapFilterTarget<'createRelative', 'type/String', TapSupportedRelative> | TapFilterTarget<'dueBegin', 'type/Date', string> | TapFilterTarget<'dueEnd', 'type/Date', string> | TapFilterTarget<'dueRelative', 'type/String', TapSupportedRelative> | TapFilterTarget<'accBegin', 'type/Date', string> | TapFilterTarget<'accEnd', 'type/Date', string> | TapFilterTarget<'accRelative', 'type/String', TapSupportedRelative> | TapFilterTarget<'startBegin', 'type/Date', string> | TapFilterTarget<'startEnd', 'type/Date', string> | TapFilterTarget<'startRelative', 'type/String', TapSupportedRelative> | TapFilterTarget<'rangeBegin', 'type/Date', string> | TapFilterTarget<'rangeEnd', 'type/Date', string> | TapFilterTarget<'rangeRelative', 'type/String', TapSupportedRelative> | TapFilterTarget<'isDone', 'type/Boolean', boolean> | TapFilterTarget<'isArchived', 'type/Boolean', boolean> | TapFilterTarget<'priority', 'type/Number', TaskPriority> | TapFilterTarget<'isOverdue', 'type/Boolean', boolean> | TapFilterTarget<'limit', 'type/Number', number> | TapFilterTarget<'isSubtask', 'type/Boolean', boolean> | TapFilterTarget<'pageCount', 'type/Number', number> | TapFilterTarget<'pageNum', 'type/Number', number> | TapFilterTarget<'sprintId', 'type/MongoId', SprintId[]> | TapFilterTarget<'weekend', 'type/Number', number[]> | TapFilterTarget<'holiday', 'type/DateCollection', string[]> | TapFilterTarget<'groupField', 'type/String', string> | TapFilterTarget<'taskflowId', 'type/MongoId', TaskflowId[]> | TapFilterTarget<'taskflowstatusId', 'type/MongoId', TaskflowStatusId[]> | TapFilterTarget<'dateSeries', 'type/String', TapSupportedDateSeries[]> | TapFilterTarget<'testplanId', 'type/MongoId', TestplanId[]> | TapFilterTarget<'accomplished', 'datetime', string> | TapFilterTarget<'startDate', 'datetime', string> | TapFilterTarget<'created', 'datetime', string> | TapFilterTarget<'involveMembers', 'string', UserId[]> | TapFilterTarget<'scenariofieldconfigId', 'int', ScenarioFieldConfigId[]> | TapFilterTarget<'tagIds', 'string', TagId[]> | TapFilterTarget<'isDue', 'boolean', boolean> | TapFilterTarget<'proTemplateConfigType', 'string', ScenarioProTemplateConfigType> | TapFilterTarget<'isDuedateExist', 'boolean', boolean> | TapFilterTarget<'weekSeries', 'type/String', TapSupportedWeekSeries[]> | TapFilterTarget<'date', 'type/Date', string> | TapFilterTarget<'commongroup', 'commongroup', CommonGroupId>; type TapGenericFilterResponse = TapFilterItem[]; interface ApprovalSchema { status: ApprovalStatus; nodes: string[]; taskId: TaskId; created: string; updated: string; orderId: string; approvalFlowName: string; creator: ExecutorOrCreator; url: string; } interface UrgeSchema { _id: string; _boundToObjectId: DetailObjectId; boundToObjectType: DetailObjectType; /** * 是否已读 */ readStatus: boolean; /** * 首次 催办 时间 */ created: string; /** * 最后 催办 时间 */ updated: string; } }