The Coline App SDK: apps, tools, file types and surfaces that run inside Coline workspaces, and public websites with Coline Sites. TypeScript, with an in-memory test workspace. MIT.
| id: string; |
| 5 | taskboardId: string; |
| 6 | title: string; |
| 7 | description: string; |
| 8 | statusId: string; |
| 9 | priority: "none" | "low" | "medium" | "high" | "urgent"; |
| 10 | dueDate: string | null; |
| 11 | assigneeUserIds: string[]; |
| 12 | } |
| 13 | export interface ColineTaskInput { |
| 14 | title: string; |
| 15 | description?: string; |
| 16 | statusId?: string; |
| 17 | priority?: ColineTask["priority"]; |
| 18 | dueDate?: string | null; |
| 19 | assigneeUserIds?: string[]; |
| 20 | } |
| 21 | export interface ColineCalendarEvent { |
| 22 | id: string; |
| 23 | title: string; |
| 24 | description: string | null; |
| 25 | location: string | null; |
| 26 | startsAt: string; |
| 27 | endsAt: string; |
| 28 | timeZone: string; |
| 29 | isAllDay: boolean; |
| 30 | } |
| 31 | export interface ColineCalendarEventInput { |
| 32 | title: string; |
| 33 | description?: string; |
| 34 | location?: string; |
| 35 | calendarId?: string; |
| 36 | startsAt: string; |
| 37 | endsAt: string; |
| 38 | timeZone: string; |
| 39 | isAllDay?: boolean; |
| 40 | attendeeUserIds?: string[]; |
| 41 | } |
| 42 | export interface ColineConversation { |
| 43 | type: "channel" | "dm" | "event" | "task"; |
| 44 | id: string; |
| 45 | } |
| 46 | export interface ColineMessage { |
| 47 | id: string; |
| 48 | text: string; |
| 49 | createdAt: string; |
| 50 | authorUserId: string | null; |
| 51 | } |
| 52 | /** These capabilities operate on existing Coline objects under the invoking user's ACLs. */ |
| 53 | export interface ColineWorkspaceCapabilities { |
| 54 | tasks: { |
| 55 | list(input: { |
| 56 | taskboardId: string; |
| 57 | query?: string; |
| 58 | limit?: number; |
| 59 | cursor?: string; |
| 60 | }): Promise<{ tasks: ColineTask[]; nextCursor: string | null }>; |
| 61 | get(taskboardId: string, taskId: string): Promise<ColineTask>; |
| 62 | create(taskboardId: string, input: ColineTaskInput): Promise<ColineTask>; |
| 63 | update( |
| 64 | taskboardId: string, |
| 65 | taskId: string, |
| 66 | input: Partial<ColineTaskInput>, |
| 67 | ): Promise<ColineTask>; |
| 68 | delete(taskboardId: string, taskId: string): Promise<void>; |
| 69 | board( |
| 70 | taskboardId: string, |
| 71 | ): Promise<{ id: string; statuses: Array<{ id: string; name: string }> }>; |
| 72 | }; |
| 73 | calendar: { |
| 74 | list(input: { start: string; end: string }): Promise<{ events: ColineCalendarEvent[] }>; |
| 75 | get(eventId: string): Promise<ColineCalendarEvent>; |
| 76 | create(input: ColineCalendarEventInput): Promise<ColineCalendarEvent>; |
| 77 | update(eventId: string, input: Partial<ColineCalendarEventInput>): Promise<ColineCalendarEvent>; |
| 78 | delete(eventId: string): Promise<void>; |
| 79 | }; |
| 80 | /** Task/event conversations are also the canonical shared comment threads. */ |
| 81 | messages: { |
| 82 | list(input: { |
| 83 | conversation: ColineConversation; |
| 84 | limit?: number; |
| 85 | cursor?: string; |
| 86 | }): Promise<{ messages: ColineMessage[]; nextCursor: string | null }>; |
| 87 | send(input: { |
| 88 | conversation: ColineConversation; |
| 89 | text: string; |
| 90 | replyToMessageId?: string; |
| 91 | }): Promise<ColineMessage>; |
| 92 | }; |
| 93 | references: { |
| 94 | resolve( |
| 95 | reference: ColineReference, |
| 96 | ): Promise<{ reference: ColineReference; title: string; href: string | null }>; |
| 97 | }; |
| 98 | } |
| 99 |
| 100 | /** Shared transport mapping, used by both HTTP and the iframe bridge. */ |
| 101 | export function createWorkspaceCapabilities( |
| 102 | call: <T>(operation: string, args: unknown[]) => Promise<T>, |
| 103 | ): ColineWorkspaceCapabilities { |
| 104 | return { |
| 105 | tasks: { |
| 106 | list: (input) => call("tasks.list", [input]), |
| 107 | board: (id) => call("tasks.board", [id]), |
| 108 | get: (board, id) => call("tasks.get", [board, id]), |
| 109 | create: (board, input) => call("tasks.create", [board, input]), |
| 110 | update: (board, id, input) => call("tasks.update", [board, id, input]), |
| 111 | delete: (board, id) => call("tasks.delete", [board, id]), |
| 112 | }, |
| 113 | calendar: { |
| 114 | list: (input) => call("calendar.list", [input]), |
| 115 | get: (id) => call("calendar.get", [id]), |
| 116 | create: (input) => call("calendar.create", [input]), |
| 117 | update: (id, input) => call("calendar.update", [id, input]), |
| 118 | delete: (id) => call("calendar.delete", [id]), |
| 119 | }, |
| 120 | messages: { |
| 121 | list: (input) => call("messages.list", [input]), |
| 122 | send: (input) => call("messages.send", [input]), |
| 123 | }, |
| 124 | references: { resolve: (reference) => call("references.resolve", [reference]) }, |
| 125 | }; |
| 126 | } |
| 127 |