@tuturuuu/internal-api 0.0.1 → 0.1.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.
Files changed (108) hide show
  1. package/dist/ai-memory.d.ts +76 -0
  2. package/dist/ai-memory.d.ts.map +1 -0
  3. package/dist/ai-memory.js +59 -0
  4. package/dist/ai.d.ts +67 -3
  5. package/dist/ai.d.ts.map +1 -1
  6. package/dist/ai.js +121 -0
  7. package/dist/auth.d.ts +121 -1
  8. package/dist/auth.d.ts.map +1 -1
  9. package/dist/auth.js +111 -0
  10. package/dist/calendar.d.ts +17 -1
  11. package/dist/calendar.d.ts.map +1 -1
  12. package/dist/calendar.js +9 -0
  13. package/dist/chat-conversations.d.ts +81 -0
  14. package/dist/chat-conversations.d.ts.map +1 -0
  15. package/dist/chat-conversations.js +384 -0
  16. package/dist/chat-internal.d.ts +11 -0
  17. package/dist/chat-internal.d.ts.map +1 -0
  18. package/dist/chat-internal.js +39 -0
  19. package/dist/chat-legacy.d.ts +23 -0
  20. package/dist/chat-legacy.d.ts.map +1 -0
  21. package/dist/chat-legacy.js +68 -0
  22. package/dist/chat-types.d.ts +262 -0
  23. package/dist/chat-types.d.ts.map +1 -0
  24. package/dist/chat-types.js +2 -0
  25. package/dist/chat.d.ts +3 -45
  26. package/dist/chat.d.ts.map +1 -1
  27. package/dist/chat.js +17 -65
  28. package/dist/client.d.ts +5 -0
  29. package/dist/client.d.ts.map +1 -1
  30. package/dist/client.js +50 -5
  31. package/dist/education.d.ts +288 -2
  32. package/dist/education.d.ts.map +1 -1
  33. package/dist/education.js +176 -0
  34. package/dist/external-project-team.d.ts +51 -0
  35. package/dist/external-project-team.d.ts.map +1 -0
  36. package/dist/external-project-team.js +137 -0
  37. package/dist/external-projects.d.ts +98 -10
  38. package/dist/external-projects.d.ts.map +1 -1
  39. package/dist/external-projects.js +92 -33
  40. package/dist/finance.d.ts +491 -3
  41. package/dist/finance.d.ts.map +1 -1
  42. package/dist/finance.js +611 -1
  43. package/dist/hive.d.ts +739 -0
  44. package/dist/hive.d.ts.map +1 -0
  45. package/dist/hive.js +333 -0
  46. package/dist/index.d.ts +31 -17
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/index.js +350 -8
  49. package/dist/infrastructure.d.ts +955 -1
  50. package/dist/infrastructure.d.ts.map +1 -1
  51. package/dist/infrastructure.js +595 -0
  52. package/dist/inventory.d.ts +355 -0
  53. package/dist/inventory.d.ts.map +1 -0
  54. package/dist/inventory.js +268 -0
  55. package/dist/mail.d.ts +125 -0
  56. package/dist/mail.d.ts.map +1 -1
  57. package/dist/mail.js +112 -1
  58. package/dist/meet.d.ts +54 -0
  59. package/dist/meet.d.ts.map +1 -0
  60. package/dist/meet.js +37 -0
  61. package/dist/mind.d.ts +55 -0
  62. package/dist/mind.d.ts.map +1 -0
  63. package/dist/mind.js +84 -0
  64. package/dist/posts.d.ts +33 -0
  65. package/dist/posts.d.ts.map +1 -1
  66. package/dist/posts.js +42 -0
  67. package/dist/promotions.d.ts +54 -0
  68. package/dist/promotions.d.ts.map +1 -1
  69. package/dist/promotions.js +52 -0
  70. package/dist/settings.d.ts +28 -1
  71. package/dist/settings.d.ts.map +1 -1
  72. package/dist/settings.js +68 -0
  73. package/dist/storage.d.ts +32 -21
  74. package/dist/storage.d.ts.map +1 -1
  75. package/dist/storage.js +52 -32
  76. package/dist/tasks.d.ts +224 -4
  77. package/dist/tasks.d.ts.map +1 -1
  78. package/dist/tasks.js +204 -0
  79. package/dist/teach.d.ts +130 -0
  80. package/dist/teach.d.ts.map +1 -0
  81. package/dist/teach.js +110 -0
  82. package/dist/topic-announcements.d.ts +235 -0
  83. package/dist/topic-announcements.d.ts.map +1 -0
  84. package/dist/topic-announcements.js +182 -0
  85. package/dist/tulearn.d.ts +223 -0
  86. package/dist/tulearn.d.ts.map +1 -0
  87. package/dist/tulearn.js +97 -0
  88. package/dist/tutoring.d.ts +152 -0
  89. package/dist/tutoring.d.ts.map +1 -0
  90. package/dist/tutoring.js +58 -0
  91. package/dist/user-group-activity.d.ts +54 -0
  92. package/dist/user-group-activity.d.ts.map +1 -0
  93. package/dist/user-group-activity.js +11 -0
  94. package/dist/user-groups.d.ts +35 -0
  95. package/dist/user-groups.d.ts.map +1 -0
  96. package/dist/user-groups.js +84 -0
  97. package/dist/users.d.ts +83 -1
  98. package/dist/users.d.ts.map +1 -1
  99. package/dist/users.js +137 -0
  100. package/dist/workspace-configs.d.ts +2 -0
  101. package/dist/workspace-configs.d.ts.map +1 -1
  102. package/dist/workspace-configs.js +3 -1
  103. package/dist/workspace-user-audit.d.ts +1 -0
  104. package/dist/workspace-user-audit.d.ts.map +1 -1
  105. package/dist/workspaces.d.ts +57 -0
  106. package/dist/workspaces.d.ts.map +1 -1
  107. package/dist/workspaces.js +58 -1
  108. package/package.json +59 -6
package/dist/tasks.js CHANGED
@@ -1,14 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.partitionTaskProjectLinks = partitionTaskProjectLinks;
3
4
  exports.listWorkspaceTaskProjects = listWorkspaceTaskProjects;
5
+ exports.listWorkspaceTaskProjectDetails = listWorkspaceTaskProjectDetails;
4
6
  exports.listWorkspaceLabels = listWorkspaceLabels;
5
7
  exports.createWorkspaceLabel = createWorkspaceLabel;
8
+ exports.updateWorkspaceLabel = updateWorkspaceLabel;
9
+ exports.deleteWorkspaceLabel = deleteWorkspaceLabel;
6
10
  exports.listWorkspaceTaskBoards = listWorkspaceTaskBoards;
7
11
  exports.getWorkspaceBoardsData = getWorkspaceBoardsData;
12
+ exports.listWorkspaceBoards = listWorkspaceBoards;
8
13
  exports.listWorkspaceBoardsWithLists = listWorkspaceBoardsWithLists;
9
14
  exports.createWorkspaceTaskBoard = createWorkspaceTaskBoard;
10
15
  exports.getWorkspaceTaskBoard = getWorkspaceTaskBoard;
16
+ exports.listWorkspaceTaskBoardShares = listWorkspaceTaskBoardShares;
17
+ exports.createWorkspaceTaskBoardShare = createWorkspaceTaskBoardShare;
18
+ exports.updateWorkspaceTaskBoardShare = updateWorkspaceTaskBoardShare;
19
+ exports.deleteWorkspaceTaskBoardShare = deleteWorkspaceTaskBoardShare;
11
20
  exports.updateWorkspaceTaskBoard = updateWorkspaceTaskBoard;
21
+ exports.updateWorkspaceTaskBoardEstimation = updateWorkspaceTaskBoardEstimation;
12
22
  exports.deleteWorkspaceTaskBoard = deleteWorkspaceTaskBoard;
13
23
  exports.listWorkspaceTaskProjectsByIds = listWorkspaceTaskProjectsByIds;
14
24
  exports.addWorkspaceTaskLabel = addWorkspaceTaskLabel;
@@ -18,8 +28,11 @@ exports.listWorkspaceTasks = listWorkspaceTasks;
18
28
  exports.listTaskBoardStatusTemplates = listTaskBoardStatusTemplates;
19
29
  exports.getWorkspaceTask = getWorkspaceTask;
20
30
  exports.getCurrentUserTask = getCurrentUserTask;
31
+ exports.upsertCurrentUserTaskPersonalPlacement = upsertCurrentUserTaskPersonalPlacement;
32
+ exports.removeCurrentUserTaskPersonalPlacement = removeCurrentUserTaskPersonalPlacement;
21
33
  exports.cleanupWorkspaceTaskMentions = cleanupWorkspaceTaskMentions;
22
34
  exports.createWorkspaceTask = createWorkspaceTask;
35
+ exports.createWorkspaceTaskJournal = createWorkspaceTaskJournal;
23
36
  exports.createWorkspaceTaskList = createWorkspaceTaskList;
24
37
  exports.listWorkspaceTaskLists = listWorkspaceTaskLists;
25
38
  exports.updateWorkspaceTaskList = updateWorkspaceTaskList;
@@ -31,11 +44,46 @@ exports.bulkWorkspaceTasks = bulkWorkspaceTasks;
31
44
  exports.createWorkspaceTaskRelationship = createWorkspaceTaskRelationship;
32
45
  exports.deleteWorkspaceTaskRelationship = deleteWorkspaceTaskRelationship;
33
46
  exports.createWorkspaceTaskProject = createWorkspaceTaskProject;
47
+ exports.updateWorkspaceTaskProject = updateWorkspaceTaskProject;
48
+ exports.deleteWorkspaceTaskProject = deleteWorkspaceTaskProject;
49
+ exports.linkWorkspaceTaskProjectTask = linkWorkspaceTaskProjectTask;
50
+ exports.unlinkWorkspaceTaskProjectTask = unlinkWorkspaceTaskProjectTask;
34
51
  exports.createWorkspaceTaskWithRelationship = createWorkspaceTaskWithRelationship;
35
52
  exports.resolveTaskProjectWorkspaceId = resolveTaskProjectWorkspaceId;
36
53
  exports.getWorkspaceTaskProject = getWorkspaceTaskProject;
37
54
  exports.getWorkspaceTaskProjectTasks = getWorkspaceTaskProjectTasks;
38
55
  const client_1 = require("./client");
56
+ function joinQueryList(values) {
57
+ return values && values.length > 0 ? values.join(',') : undefined;
58
+ }
59
+ function mapTaskProjectLinkedItem(task) {
60
+ return {
61
+ id: task.id,
62
+ name: task.name?.trim() || 'Untitled task',
63
+ completed: task.completed ?? null,
64
+ completed_at: task.completed_at ?? null,
65
+ closed_at: task.closed_at ?? null,
66
+ priority: task.priority ?? null,
67
+ listName: task.task_lists?.name ?? null,
68
+ listStatus: task.task_lists?.status ?? null,
69
+ };
70
+ }
71
+ function partitionTaskProjectLinks(links) {
72
+ const activeItems = (links ?? []).flatMap((link) => {
73
+ const task = link.task;
74
+ if (!task || task.deleted_at)
75
+ return [];
76
+ return [mapTaskProjectLinkedItem(task)];
77
+ });
78
+ const linkedDocuments = activeItems.filter((item) => item.listStatus === 'documents');
79
+ const linkedTasks = activeItems.filter((item) => item.listStatus !== 'documents');
80
+ return {
81
+ linkedTasks,
82
+ linkedDocuments,
83
+ tasksCount: linkedTasks.length,
84
+ completedTasksCount: linkedTasks.filter((task) => task.completed_at !== null || task.closed_at !== null).length,
85
+ };
86
+ }
39
87
  async function listWorkspaceTaskProjects(workspaceId, options) {
40
88
  const client = (0, client_1.getInternalApiClient)(options);
41
89
  const projects = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects`, {
@@ -57,6 +105,12 @@ async function listWorkspaceTaskProjects(workspaceId, options) {
57
105
  ];
58
106
  });
59
107
  }
108
+ async function listWorkspaceTaskProjectDetails(workspaceId, options) {
109
+ const client = (0, client_1.getInternalApiClient)(options);
110
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects`, {
111
+ cache: 'no-store',
112
+ });
113
+ }
60
114
  async function listWorkspaceLabels(workspaceId, options) {
61
115
  const client = (0, client_1.getInternalApiClient)(options);
62
116
  const labels = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/labels`, {
@@ -75,6 +129,24 @@ async function createWorkspaceLabel(workspaceId, payload, options) {
75
129
  cache: 'no-store',
76
130
  });
77
131
  }
132
+ async function updateWorkspaceLabel(workspaceId, labelId, payload, options) {
133
+ const client = (0, client_1.getInternalApiClient)(options);
134
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/labels/${(0, client_1.encodePathSegment)(labelId)}`, {
135
+ method: 'PATCH',
136
+ headers: {
137
+ 'Content-Type': 'application/json',
138
+ },
139
+ body: JSON.stringify(payload),
140
+ cache: 'no-store',
141
+ });
142
+ }
143
+ async function deleteWorkspaceLabel(workspaceId, labelId, options) {
144
+ const client = (0, client_1.getInternalApiClient)(options);
145
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/labels/${(0, client_1.encodePathSegment)(labelId)}`, {
146
+ method: 'DELETE',
147
+ cache: 'no-store',
148
+ });
149
+ }
78
150
  async function listWorkspaceTaskBoards(workspaceId, options, clientOptions) {
79
151
  const client = (0, client_1.getInternalApiClient)(clientOptions);
80
152
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards`, {
@@ -82,6 +154,7 @@ async function listWorkspaceTaskBoards(workspaceId, options, clientOptions) {
82
154
  q: options?.q,
83
155
  page: options?.page,
84
156
  pageSize: options?.pageSize,
157
+ status: options?.status,
85
158
  },
86
159
  cache: 'no-store',
87
160
  });
@@ -97,6 +170,12 @@ async function getWorkspaceBoardsData(workspaceId, options, clientOptions) {
97
170
  cache: 'no-store',
98
171
  });
99
172
  }
173
+ async function listWorkspaceBoards(workspaceId, options) {
174
+ const client = (0, client_1.getInternalApiClient)(options);
175
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/boards`, {
176
+ cache: 'no-store',
177
+ });
178
+ }
100
179
  async function listWorkspaceBoardsWithLists(workspaceId, options) {
101
180
  const client = (0, client_1.getInternalApiClient)(options);
102
181
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/boards-with-lists`, {
@@ -120,6 +199,42 @@ async function getWorkspaceTaskBoard(workspaceId, boardId, options) {
120
199
  cache: 'no-store',
121
200
  });
122
201
  }
202
+ async function listWorkspaceTaskBoardShares(workspaceId, boardId, options) {
203
+ const client = (0, client_1.getInternalApiClient)(options);
204
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/shares`, {
205
+ cache: 'no-store',
206
+ });
207
+ }
208
+ async function createWorkspaceTaskBoardShare(workspaceId, boardId, payload, options) {
209
+ const client = (0, client_1.getInternalApiClient)(options);
210
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/shares`, {
211
+ method: 'POST',
212
+ headers: {
213
+ 'Content-Type': 'application/json',
214
+ },
215
+ body: JSON.stringify(payload),
216
+ cache: 'no-store',
217
+ });
218
+ }
219
+ async function updateWorkspaceTaskBoardShare(workspaceId, boardId, payload, options) {
220
+ const client = (0, client_1.getInternalApiClient)(options);
221
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/shares`, {
222
+ method: 'PATCH',
223
+ headers: {
224
+ 'Content-Type': 'application/json',
225
+ },
226
+ body: JSON.stringify(payload),
227
+ cache: 'no-store',
228
+ });
229
+ }
230
+ async function deleteWorkspaceTaskBoardShare(workspaceId, boardId, shareId, options) {
231
+ const client = (0, client_1.getInternalApiClient)(options);
232
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/shares`, {
233
+ method: 'DELETE',
234
+ query: { shareId },
235
+ cache: 'no-store',
236
+ });
237
+ }
123
238
  async function updateWorkspaceTaskBoard(workspaceId, boardId, payload, options) {
124
239
  const client = (0, client_1.getInternalApiClient)(options);
125
240
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}`, {
@@ -131,6 +246,17 @@ async function updateWorkspaceTaskBoard(workspaceId, boardId, payload, options)
131
246
  cache: 'no-store',
132
247
  });
133
248
  }
249
+ async function updateWorkspaceTaskBoardEstimation(workspaceId, boardId, payload, options) {
250
+ const client = (0, client_1.getInternalApiClient)(options);
251
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/boards/${(0, client_1.encodePathSegment)(boardId)}/estimation`, {
252
+ method: 'PATCH',
253
+ headers: {
254
+ 'Content-Type': 'application/json',
255
+ },
256
+ body: JSON.stringify(payload),
257
+ cache: 'no-store',
258
+ });
259
+ }
134
260
  async function deleteWorkspaceTaskBoard(workspaceId, boardId, options) {
135
261
  const client = (0, client_1.getInternalApiClient)(options);
136
262
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}`, {
@@ -197,11 +323,24 @@ async function listWorkspaceTasks(workspaceId, options, clientOptions) {
197
323
  query: {
198
324
  boardId: options?.boardId,
199
325
  listId: options?.listId,
326
+ listStatuses: joinQueryList(options?.listStatuses),
327
+ sourceScope: options?.sourceScope,
328
+ sourceWorkspaceIds: joinQueryList(options?.sourceWorkspaceIds),
329
+ sourceBoardIds: joinQueryList(options?.sourceBoardIds),
200
330
  q: options?.q,
201
331
  identifier: options?.identifier,
202
332
  limit: options?.limit,
203
333
  offset: options?.offset,
334
+ assignedToMe: options?.assignedToMe,
335
+ completed: options?.completed,
336
+ closed: options?.closed,
337
+ hasDueDate: options?.hasDueDate,
338
+ externalIncludeDocuments: options?.externalIncludeDocuments,
339
+ externalIncludeDoneClosed: options?.externalIncludeDoneClosed,
340
+ externalSortBy: options?.externalSortBy,
341
+ forTimeTracking: options?.forTimeTracking,
204
342
  includeRelationshipSummary: options?.includeRelationshipSummary,
343
+ includeArchivedBoards: options?.includeArchivedBoards,
205
344
  includeDeleted: options?.includeDeleted === 'only'
206
345
  ? 'only'
207
346
  : options?.includeDeleted === true
@@ -230,6 +369,24 @@ async function getCurrentUserTask(taskId, options) {
230
369
  cache: 'no-store',
231
370
  });
232
371
  }
372
+ async function upsertCurrentUserTaskPersonalPlacement(taskId, payload, options) {
373
+ const client = (0, client_1.getInternalApiClient)(options);
374
+ return client.json(`/api/v1/users/me/tasks/${(0, client_1.encodePathSegment)(taskId)}/personal-placement`, {
375
+ method: 'PUT',
376
+ headers: {
377
+ 'Content-Type': 'application/json',
378
+ },
379
+ body: JSON.stringify(payload),
380
+ cache: 'no-store',
381
+ });
382
+ }
383
+ async function removeCurrentUserTaskPersonalPlacement(taskId, options) {
384
+ const client = (0, client_1.getInternalApiClient)(options);
385
+ return client.json(`/api/v1/users/me/tasks/${(0, client_1.encodePathSegment)(taskId)}/personal-placement`, {
386
+ method: 'DELETE',
387
+ cache: 'no-store',
388
+ });
389
+ }
233
390
  async function cleanupWorkspaceTaskMentions(workspaceId, taskId, options) {
234
391
  const client = (0, client_1.getInternalApiClient)(options);
235
392
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/mentions/cleanup`, {
@@ -248,6 +405,17 @@ async function createWorkspaceTask(workspaceId, payload, options) {
248
405
  cache: 'no-store',
249
406
  });
250
407
  }
408
+ async function createWorkspaceTaskJournal(workspaceId, payload, options) {
409
+ const client = (0, client_1.getInternalApiClient)(options);
410
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/journal`, {
411
+ method: 'POST',
412
+ headers: {
413
+ 'Content-Type': 'application/json',
414
+ },
415
+ body: JSON.stringify(payload),
416
+ cache: 'no-store',
417
+ });
418
+ }
251
419
  async function createWorkspaceTaskList(workspaceId, boardId, payload, options) {
252
420
  const client = (0, client_1.getInternalApiClient)(options);
253
421
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/lists`, {
@@ -356,6 +524,42 @@ async function createWorkspaceTaskProject(workspaceId, payload, options) {
356
524
  cache: 'no-store',
357
525
  });
358
526
  }
527
+ async function updateWorkspaceTaskProject(workspaceId, projectId, payload, options) {
528
+ const client = (0, client_1.getInternalApiClient)(options);
529
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects/${(0, client_1.encodePathSegment)(projectId)}`, {
530
+ method: 'PUT',
531
+ headers: {
532
+ 'Content-Type': 'application/json',
533
+ },
534
+ body: JSON.stringify(payload),
535
+ cache: 'no-store',
536
+ });
537
+ }
538
+ async function deleteWorkspaceTaskProject(workspaceId, projectId, options) {
539
+ const client = (0, client_1.getInternalApiClient)(options);
540
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects/${(0, client_1.encodePathSegment)(projectId)}`, {
541
+ method: 'DELETE',
542
+ cache: 'no-store',
543
+ });
544
+ }
545
+ async function linkWorkspaceTaskProjectTask(workspaceId, projectId, taskId, options) {
546
+ const client = (0, client_1.getInternalApiClient)(options);
547
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects/${(0, client_1.encodePathSegment)(projectId)}/tasks`, {
548
+ method: 'POST',
549
+ headers: {
550
+ 'Content-Type': 'application/json',
551
+ },
552
+ body: JSON.stringify({ taskId }),
553
+ cache: 'no-store',
554
+ });
555
+ }
556
+ async function unlinkWorkspaceTaskProjectTask(workspaceId, projectId, taskId, options) {
557
+ const client = (0, client_1.getInternalApiClient)(options);
558
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects/${(0, client_1.encodePathSegment)(projectId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}`, {
559
+ method: 'DELETE',
560
+ cache: 'no-store',
561
+ });
562
+ }
359
563
  async function createWorkspaceTaskWithRelationship(workspaceId, payload, options) {
360
564
  const client = (0, client_1.getInternalApiClient)(options);
361
565
  return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/with-relationship`, {
@@ -0,0 +1,130 @@
1
+ import { type InternalApiClientOptions } from './client';
2
+ import type { TulearnBootstrapResponse } from './tulearn';
3
+ export type TeachBootstrapResponse = TulearnBootstrapResponse;
4
+ export interface TeachWorkspaceUser {
5
+ archived?: boolean | null;
6
+ avatar_url?: string | null;
7
+ display_name?: string | null;
8
+ email?: string | null;
9
+ full_name?: string | null;
10
+ id: string;
11
+ }
12
+ export interface TeachCourseMember extends TeachWorkspaceUser {
13
+ role: 'STUDENT' | 'TEACHER' | string | null;
14
+ }
15
+ export type TeachAttendanceStatus = 'PRESENT' | 'ABSENT' | 'LATE' | 'NONE';
16
+ export interface TeachAttendanceEntry {
17
+ date: string;
18
+ notes?: string | null;
19
+ status: TeachAttendanceStatus;
20
+ user_id: string;
21
+ }
22
+ export interface TeachAttendanceDaySummary {
23
+ absent: number;
24
+ date: string;
25
+ late: number;
26
+ notes: number;
27
+ present: number;
28
+ totalMarked: number;
29
+ }
30
+ export interface TeachPost {
31
+ content: string | null;
32
+ created_at: string;
33
+ id: string;
34
+ notes: string | null;
35
+ post_approval_status?: string | null;
36
+ title: string | null;
37
+ }
38
+ export interface TeachReport {
39
+ content: string;
40
+ created_at: string;
41
+ feedback: string;
42
+ id: string;
43
+ report_approval_status?: string | null;
44
+ score: number | null;
45
+ scores: number[] | null;
46
+ title: string;
47
+ updated_at: string;
48
+ user?: TeachWorkspaceUser | null;
49
+ user_id: string;
50
+ }
51
+ export interface TeachIndicator {
52
+ created_at: string | null;
53
+ factor: number;
54
+ id: string;
55
+ is_weighted: boolean;
56
+ name: string;
57
+ unit: string;
58
+ }
59
+ export interface TeachIndicatorValue {
60
+ indicator_id: string;
61
+ user_id: string;
62
+ value: number | null;
63
+ }
64
+ export declare function getTeachBootstrap(options?: InternalApiClientOptions): Promise<TulearnBootstrapResponse>;
65
+ export declare function listWorkspaceUsers(workspaceId: string, params?: {
66
+ from?: number;
67
+ limit?: number;
68
+ q?: string;
69
+ }, options?: InternalApiClientOptions): Promise<{
70
+ count: number;
71
+ data: TeachWorkspaceUser[];
72
+ }>;
73
+ export declare function listWorkspaceCourseMembers(workspaceId: string, courseId: string, options?: InternalApiClientOptions): Promise<{
74
+ data: TeachCourseMember[];
75
+ }>;
76
+ export declare function addWorkspaceCourseMembers(workspaceId: string, courseId: string, payload: {
77
+ memberIds: string[];
78
+ role?: 'STUDENT' | 'TEACHER';
79
+ }, options?: InternalApiClientOptions): Promise<{
80
+ message: string;
81
+ }>;
82
+ export declare function removeWorkspaceCourseMember(workspaceId: string, courseId: string, userId: string, options?: InternalApiClientOptions): Promise<{
83
+ message: string;
84
+ }>;
85
+ export declare function listWorkspaceCourseAttendance(workspaceId: string, courseId: string, date: string, options?: InternalApiClientOptions): Promise<{
86
+ data: TeachAttendanceEntry[];
87
+ }>;
88
+ export declare function listWorkspaceCourseAttendanceMonth(workspaceId: string, courseId: string, month: string, options?: InternalApiClientOptions): Promise<{
89
+ days: TeachAttendanceDaySummary[];
90
+ }>;
91
+ export declare function updateWorkspaceCourseAttendance(workspaceId: string, courseId: string, entries: TeachAttendanceEntry[], options?: InternalApiClientOptions): Promise<{
92
+ message: string;
93
+ }>;
94
+ export declare function listWorkspaceCoursePosts(workspaceId: string, courseId: string, options?: InternalApiClientOptions): Promise<{
95
+ data: TeachPost[];
96
+ }>;
97
+ export declare function createWorkspaceCoursePost(workspaceId: string, courseId: string, payload: {
98
+ content?: string | null;
99
+ notes?: string | null;
100
+ title?: string | null;
101
+ }, options?: InternalApiClientOptions): Promise<{
102
+ id: string;
103
+ }>;
104
+ export declare function listWorkspaceCourseReports(workspaceId: string, courseId: string, options?: InternalApiClientOptions): Promise<{
105
+ data: TeachReport[];
106
+ }>;
107
+ export declare function createWorkspaceCourseReport(workspaceId: string, courseId: string, payload: {
108
+ content: string;
109
+ feedback: string;
110
+ score?: number | null;
111
+ scores?: number[] | null;
112
+ title: string;
113
+ user_id: string;
114
+ }, options?: InternalApiClientOptions): Promise<{
115
+ id: string;
116
+ }>;
117
+ export declare function listWorkspaceCourseIndicators(workspaceId: string, courseId: string, options?: InternalApiClientOptions): Promise<{
118
+ indicators: TeachIndicator[];
119
+ values: TeachIndicatorValue[];
120
+ }>;
121
+ export declare function createWorkspaceCourseIndicator(workspaceId: string, courseId: string, payload: {
122
+ factor?: number;
123
+ is_weighted?: boolean;
124
+ name: string;
125
+ unit?: string;
126
+ }, options?: InternalApiClientOptions): Promise<TeachIndicator>;
127
+ export declare function updateWorkspaceCourseIndicators(workspaceId: string, courseId: string, values: TeachIndicatorValue[], options?: InternalApiClientOptions): Promise<{
128
+ message: string;
129
+ }>;
130
+ //# sourceMappingURL=teach.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"teach.d.ts","sourceRoot":"","sources":["../src/teach.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE1D,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAE9D,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,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M,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,EACD,OAAO,CAAC,EAAE,wBAAwB;QAGT,MAAM;GAShC;AAED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wBAAwB;gBAIpB,cAAc,EAAE;YACpB,mBAAmB,EAAE;GAKhC;AAED,wBAAgB,8BAA8B,CAC5C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,EACD,OAAO,CAAC,EAAE,wBAAwB,2BAYnC;AAED,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,mBAAmB,EAAE,EAC7B,OAAO,CAAC,EAAE,wBAAwB;aAGJ,MAAM;GASrC"}
package/dist/teach.js ADDED
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getTeachBootstrap = getTeachBootstrap;
4
+ exports.listWorkspaceUsers = listWorkspaceUsers;
5
+ exports.listWorkspaceCourseMembers = listWorkspaceCourseMembers;
6
+ exports.addWorkspaceCourseMembers = addWorkspaceCourseMembers;
7
+ exports.removeWorkspaceCourseMember = removeWorkspaceCourseMember;
8
+ exports.listWorkspaceCourseAttendance = listWorkspaceCourseAttendance;
9
+ exports.listWorkspaceCourseAttendanceMonth = listWorkspaceCourseAttendanceMonth;
10
+ exports.updateWorkspaceCourseAttendance = updateWorkspaceCourseAttendance;
11
+ exports.listWorkspaceCoursePosts = listWorkspaceCoursePosts;
12
+ exports.createWorkspaceCoursePost = createWorkspaceCoursePost;
13
+ exports.listWorkspaceCourseReports = listWorkspaceCourseReports;
14
+ exports.createWorkspaceCourseReport = createWorkspaceCourseReport;
15
+ exports.listWorkspaceCourseIndicators = listWorkspaceCourseIndicators;
16
+ exports.createWorkspaceCourseIndicator = createWorkspaceCourseIndicator;
17
+ exports.updateWorkspaceCourseIndicators = updateWorkspaceCourseIndicators;
18
+ const client_1 = require("./client");
19
+ function getTeachBootstrap(options) {
20
+ const client = (0, client_1.getInternalApiClient)(options);
21
+ return client.json('/api/v1/tulearn/bootstrap', {
22
+ cache: 'no-store',
23
+ });
24
+ }
25
+ function listWorkspaceUsers(workspaceId, params = {}, options) {
26
+ const client = (0, client_1.getInternalApiClient)(options);
27
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/users`, { cache: 'no-store', query: params });
28
+ }
29
+ function listWorkspaceCourseMembers(workspaceId, courseId, options) {
30
+ const client = (0, client_1.getInternalApiClient)(options);
31
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/members`, { cache: 'no-store' });
32
+ }
33
+ function addWorkspaceCourseMembers(workspaceId, courseId, payload, options) {
34
+ const client = (0, client_1.getInternalApiClient)(options);
35
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/members`, {
36
+ body: JSON.stringify(payload),
37
+ cache: 'no-store',
38
+ headers: { 'Content-Type': 'application/json' },
39
+ method: 'POST',
40
+ });
41
+ }
42
+ function removeWorkspaceCourseMember(workspaceId, courseId, userId, options) {
43
+ const client = (0, client_1.getInternalApiClient)(options);
44
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/members/${(0, client_1.encodePathSegment)(userId)}`, { cache: 'no-store', method: 'DELETE' });
45
+ }
46
+ function listWorkspaceCourseAttendance(workspaceId, courseId, date, options) {
47
+ const client = (0, client_1.getInternalApiClient)(options);
48
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/attendance`, { cache: 'no-store', query: { date } });
49
+ }
50
+ function listWorkspaceCourseAttendanceMonth(workspaceId, courseId, month, options) {
51
+ const client = (0, client_1.getInternalApiClient)(options);
52
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/attendance`, { cache: 'no-store', query: { month } });
53
+ }
54
+ function updateWorkspaceCourseAttendance(workspaceId, courseId, entries, options) {
55
+ const client = (0, client_1.getInternalApiClient)(options);
56
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/attendance`, {
57
+ body: JSON.stringify(entries),
58
+ cache: 'no-store',
59
+ headers: { 'Content-Type': 'application/json' },
60
+ method: 'POST',
61
+ });
62
+ }
63
+ function listWorkspaceCoursePosts(workspaceId, courseId, options) {
64
+ const client = (0, client_1.getInternalApiClient)(options);
65
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/posts`, { cache: 'no-store' });
66
+ }
67
+ function createWorkspaceCoursePost(workspaceId, courseId, payload, options) {
68
+ const client = (0, client_1.getInternalApiClient)(options);
69
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/posts`, {
70
+ body: JSON.stringify(payload),
71
+ cache: 'no-store',
72
+ headers: { 'Content-Type': 'application/json' },
73
+ method: 'POST',
74
+ });
75
+ }
76
+ function listWorkspaceCourseReports(workspaceId, courseId, options) {
77
+ const client = (0, client_1.getInternalApiClient)(options);
78
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/reports`, { cache: 'no-store' });
79
+ }
80
+ function createWorkspaceCourseReport(workspaceId, courseId, payload, options) {
81
+ const client = (0, client_1.getInternalApiClient)(options);
82
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/reports`, {
83
+ body: JSON.stringify(payload),
84
+ cache: 'no-store',
85
+ headers: { 'Content-Type': 'application/json' },
86
+ method: 'POST',
87
+ });
88
+ }
89
+ function listWorkspaceCourseIndicators(workspaceId, courseId, options) {
90
+ const client = (0, client_1.getInternalApiClient)(options);
91
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/indicators`, { cache: 'no-store' });
92
+ }
93
+ function createWorkspaceCourseIndicator(workspaceId, courseId, payload, options) {
94
+ const client = (0, client_1.getInternalApiClient)(options);
95
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/indicators`, {
96
+ body: JSON.stringify(payload),
97
+ cache: 'no-store',
98
+ headers: { 'Content-Type': 'application/json' },
99
+ method: 'POST',
100
+ });
101
+ }
102
+ function updateWorkspaceCourseIndicators(workspaceId, courseId, values, options) {
103
+ const client = (0, client_1.getInternalApiClient)(options);
104
+ return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/teach/courses/${(0, client_1.encodePathSegment)(courseId)}/indicators`, {
105
+ body: JSON.stringify(values),
106
+ cache: 'no-store',
107
+ headers: { 'Content-Type': 'application/json' },
108
+ method: 'PATCH',
109
+ });
110
+ }