/** * TypeScript types for Asana API requests and responses * Based on Asana REST API v1.0 */ /** * Base Asana resource structure */ export interface AsanaResource { gid: string; resourceType: string; } /** * Asana API response wrapper */ export interface AsanaResponse { data: T; } /** * Asana API error response */ export interface AsanaError { message: string; help?: string; phrase?: string; } export interface AsanaErrorResponse { errors: AsanaError[]; } /** * Pagination options */ export interface PaginationOptions { limit?: number; offset?: string; } /** * Opt fields options for specifying which fields to return */ export interface OptFields { optFields?: string[]; optPretty?: boolean; } /** * Workspace types */ export interface Workspace extends AsanaResource { name: string; isOrganization: boolean; } export interface GetWorkspaceOptions extends OptFields { workspaceGid: string; } export interface ListWorkspacesOptions extends OptFields, PaginationOptions { } /** * User types */ export interface User extends AsanaResource { name?: string; email?: string; photo?: { image_21x21?: string; image_27x27?: string; image_36x36?: string; image_60x60?: string; image_128x128?: string; }; workspaces?: Workspace[]; } export interface GetUserOptions extends OptFields { userGid: string; } export type GetMeOptions = OptFields; export interface ListUsersOptions extends OptFields, PaginationOptions { workspace?: string; team?: string; } /** * Project types */ export interface Project extends AsanaResource { name: string; archived?: boolean; color?: string; createdAt?: string; currentStatus?: { author: User; color: string; createdAt: string; text: string; title: string; }; defaultView?: string; dueDate?: string | null; dueOn?: string | null; followers?: User[]; icon?: string; isTemplate?: boolean; layout?: string; modifiedAt?: string; notes?: string; public?: boolean; startOn?: string | null; team?: { gid: string; name: string; }; workspace?: Workspace; } export interface CreateProjectRequest { data: { name: string; archived?: boolean; color?: string; defaultView?: string; dueDate?: string | null; dueOn?: string | null; followers?: string[]; notes?: string; public?: boolean; startOn?: string | null; team?: string; workspace?: string; }; } export interface UpdateProjectRequest { data: { name?: string; archived?: boolean; color?: string; defaultView?: string; dueDate?: string | null; dueOn?: string | null; followers?: string[]; notes?: string; public?: boolean; startOn?: string | null; }; } export interface GetProjectOptions extends OptFields { projectGid: string; } export interface ListProjectsOptions extends OptFields, PaginationOptions { workspace?: string; team?: string; archived?: boolean; } export interface AddProjectMembersRequest { data: { members: string[]; }; } export interface RemoveProjectMembersRequest { data: { members: string[]; }; } /** * Task types */ export interface Task extends AsanaResource { name: string; assignee?: User | null; assigneeSection?: { gid: string; name: string; }; completed?: boolean; completedAt?: string | null; completedBy?: User | null; createdAt?: string; customFields?: Array<{ gid: string; name: string; displayValue?: string; enumValue?: { gid: string; name: string; }; numberValue?: number; textValue?: string; type: string; }>; dependencies?: Array<{ gid: string; resourceType: string; }>; dependents?: Array<{ gid: string; resourceType: string; }>; dueAt?: string | null; dueOn?: string | null; followers?: User[]; hearted?: boolean; hearts?: Array<{ gid: string; user: User; }>; htmlNotes?: string; isRenderedAsSeparator?: boolean; liked?: boolean; likes?: Array<{ gid: string; user: User; }>; memberships?: Array<{ project: Project; section: { gid: string; name: string; } | null; }>; modifiedAt?: string; notes?: string; numHearts?: number; numLikes?: number; numSubtasks?: number; parent?: Task | null; permalinkUrl?: string; projects?: Project[]; resourceSubtype?: string; startOn?: string | null; tags?: Tag[]; workspace?: Workspace; } export interface CreateTaskRequest { data: { name: string; assignee?: string | null; assigneeSection?: string; completed?: boolean; customFields?: Record; dependencies?: string[]; dependents?: string[]; dueAt?: string | null; dueOn?: string | null; followers?: string[]; hearted?: boolean; htmlNotes?: string; liked?: boolean; memberships?: Array<{ project: string; section?: string | null; }>; notes?: string; parent?: string | null; projects?: string[]; resourceSubtype?: string; startOn?: string | null; tags?: string[]; workspace: string; }; } export interface UpdateTaskRequest { data: { name?: string; assignee?: string | null; assigneeSection?: string; completed?: boolean; customFields?: Record; dependencies?: string[]; dependents?: string[]; dueAt?: string | null; dueOn?: string | null; followers?: string[]; hearted?: boolean; htmlNotes?: string; liked?: boolean; memberships?: Array<{ project: string; section?: string | null; }>; notes?: string; parent?: string | null; projects?: string[]; resourceSubtype?: string; startOn?: string | null; tags?: string[]; }; } export interface GetTaskOptions extends OptFields { taskGid: string; } export interface ListTasksOptions extends OptFields, PaginationOptions { assignee?: string; project?: string; section?: string; workspace?: string; completed?: boolean; modifiedSince?: string; } export interface SearchTasksOptions extends OptFields, PaginationOptions { workspace: string; assignee?: string; project?: string; completed?: boolean; modifiedSince?: string; text?: string; } export interface AddProjectToTaskRequest { data: { project: string; insertAfter?: string; insertBefore?: string; section?: string; }; } export interface RemoveProjectFromTaskRequest { data: { project: string; }; } export interface AddFollowersToTaskRequest { data: { followers: string[]; }; } export interface RemoveFollowersFromTaskRequest { data: { followers: string[]; }; } export interface AddTagToTaskRequest { data: { tag: string; }; } export interface RemoveTagFromTaskRequest { data: { tag: string; }; } /** * Story (Comment) types */ export interface Story extends AsanaResource { createdAt?: string; createdBy?: User; hearted?: boolean; hearts?: Array<{ gid: string; user: User; }>; htmlText?: string; isPinned?: boolean; resourceSubtype?: string; text?: string; target?: Task | Project; type?: string; } export interface CreateStoryRequest { data: { text: string; htmlText?: string; isPinned?: boolean; stickerName?: string; }; } export interface GetStoryOptions extends OptFields { storyGid: string; } export interface ListStoriesOptions extends OptFields, PaginationOptions { taskGid?: string; projectGid?: string; } /** * Tag types */ export interface Tag extends AsanaResource { name: string; color?: string; createdAt?: string; followers?: User[]; notes?: string; permalinkUrl?: string; workspace?: Workspace; } export interface CreateTagRequest { data: { name: string; color?: string; followers?: string[]; notes?: string; workspace: string; }; } export interface UpdateTagRequest { data: { name?: string; color?: string; followers?: string[]; notes?: string; }; } export interface GetTagOptions extends OptFields { tagGid: string; } export interface ListTagsOptions extends OptFields, PaginationOptions { workspace?: string; team?: string; } /** * Section types */ export interface Section extends AsanaResource { name: string; createdAt?: string; project?: Project; } export interface CreateSectionRequest { data: { name: string; insertAfter?: string; insertBefore?: string; }; } export interface UpdateSectionRequest { data: { name?: string; insertAfter?: string; insertBefore?: string; }; } export interface GetSectionOptions extends OptFields { sectionGid: string; } export interface ListSectionsOptions extends OptFields, PaginationOptions { projectGid: string; } export interface AddTaskToSectionRequest { data: { task: string; insertAfter?: string; insertBefore?: string; }; } /** * Attachment types */ export interface Attachment extends AsanaResource { name: string; createdAt?: string; downloadUrl?: string; host?: string; mimeType?: string; parent?: Task; permanentUrl?: string; size?: number; viewUrl?: string; } export interface CreateAttachmentRequest { data: { file: string; name?: string; parent: string; connectToApp?: boolean; }; } export interface GetAttachmentOptions extends OptFields { attachmentGid: string; } export interface ListAttachmentsOptions extends OptFields, PaginationOptions { parent: string; } /** * Custom Field types */ export interface CustomField extends AsanaResource { name: string; description?: string; enumOptions?: Array<{ gid: string; name: string; color?: string; enabled?: boolean; }>; enumValue?: { gid: string; name: string; color?: string; enabled?: boolean; }; format?: string; hasNotificationsEnabled?: boolean; isGlobalToWorkspace?: boolean; numberValue?: number; precision?: number; resourceSubtype?: string; textValue?: string; type?: string; workspace?: Workspace; } export interface CreateCustomFieldRequest { data: { name: string; description?: string; enumOptions?: Array<{ name: string; color?: string; enabled?: boolean; insertBefore?: string; insertAfter?: string; }>; format: string; hasNotificationsEnabled?: boolean; isGlobalToWorkspace?: boolean; precision?: number; resourceSubtype?: string; workspace: string; }; } export interface UpdateCustomFieldRequest { data: { name?: string; description?: string; enumOptions?: Array<{ gid?: string; name?: string; color?: string; enabled?: boolean; insertBefore?: string; insertAfter?: string; }>; hasNotificationsEnabled?: boolean; precision?: number; }; } export interface GetCustomFieldOptions extends OptFields { customFieldGid: string; } export interface ListCustomFieldsOptions extends OptFields, PaginationOptions { workspace?: string; owner?: string; } export interface CreateEnumOptionRequest { data: { name: string; color?: string; enabled?: boolean; insertAfter?: string; insertBefore?: string; }; } export interface UpdateEnumOptionRequest { data: { name?: string; color?: string; enabled?: boolean; insertAfter?: string; insertBefore?: string; }; } /** * Team types */ export interface Team extends AsanaResource { name: string; description?: string; htmlDescription?: string; organization?: Workspace; permalinkUrl?: string; visibility?: string; } export interface GetTeamOptions extends OptFields { teamGid: string; } export interface ListTeamsOptions extends OptFields, PaginationOptions { organization?: string; workspace?: string; } /** * Webhook types */ export interface Webhook extends AsanaResource { active?: boolean; createdAt?: string; lastFailureAt?: string | null; lastFailureContent?: string; lastSuccessAt?: string | null; resource?: { gid: string; name: string; resourceType: string; }; target?: string; } export interface CreateWebhookRequest { data: { resource: string; target: string; filters?: Array<{ resourceType: string; action: string; }>; }; } export interface UpdateWebhookRequest { data: { active?: boolean; }; } export interface GetWebhookOptions extends OptFields { webhookGid: string; } export interface ListWebhooksOptions extends OptFields, PaginationOptions { workspace?: string; resource?: string; owner?: string; } /** * Event types */ export interface Event { action?: string; createdAt?: string; parent?: { gid: string; resourceType: string; }; resource?: { gid: string; resourceType: string; }; type?: string; user?: User; } export interface GetEventsOptions extends PaginationOptions { sync: string; resource: string; } //# sourceMappingURL=types.d.ts.map