@tuturuuu/internal-api 0.0.1
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/dist/ai.d.ts +43 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +57 -0
- package/dist/auth.d.ts +46 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +47 -0
- package/dist/calendar.d.ts +99 -0
- package/dist/calendar.d.ts.map +1 -0
- package/dist/calendar.js +94 -0
- package/dist/chat.d.ts +46 -0
- package/dist/chat.d.ts.map +1 -0
- package/dist/chat.js +67 -0
- package/dist/client.d.ts +35 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +216 -0
- package/dist/education.d.ts +167 -0
- package/dist/education.d.ts.map +1 -0
- package/dist/education.js +288 -0
- package/dist/external-projects.d.ts +425 -0
- package/dist/external-projects.d.ts.map +1 -0
- package/dist/external-projects.js +466 -0
- package/dist/finance.d.ts +109 -0
- package/dist/finance.d.ts.map +1 -0
- package/dist/finance.js +143 -0
- package/dist/habit-trackers.d.ts +25 -0
- package/dist/habit-trackers.d.ts.map +1 -0
- package/dist/habit-trackers.js +108 -0
- package/dist/index.d.ts +34 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +280 -0
- package/dist/infrastructure.d.ts +354 -0
- package/dist/infrastructure.d.ts.map +1 -0
- package/dist/infrastructure.js +100 -0
- package/dist/inquiries.d.ts +12 -0
- package/dist/inquiries.d.ts.map +1 -0
- package/dist/inquiries.js +28 -0
- package/dist/mail.d.ts +19 -0
- package/dist/mail.d.ts.map +1 -0
- package/dist/mail.js +12 -0
- package/dist/nova.d.ts +5 -0
- package/dist/nova.d.ts.map +1 -0
- package/dist/nova.js +10 -0
- package/dist/posts.d.ts +9 -0
- package/dist/posts.d.ts.map +1 -0
- package/dist/posts.js +15 -0
- package/dist/promotions.d.ts +11 -0
- package/dist/promotions.d.ts.map +1 -0
- package/dist/promotions.js +15 -0
- package/dist/reports.d.ts +42 -0
- package/dist/reports.d.ts.map +1 -0
- package/dist/reports.js +48 -0
- package/dist/roles.d.ts +45 -0
- package/dist/roles.d.ts.map +1 -0
- package/dist/roles.js +96 -0
- package/dist/settings.d.ts +48 -0
- package/dist/settings.d.ts.map +1 -0
- package/dist/settings.js +66 -0
- package/dist/storage.d.ts +187 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +371 -0
- package/dist/tasks-scheduling.d.ts +14 -0
- package/dist/tasks-scheduling.d.ts.map +1 -0
- package/dist/tasks-scheduling.js +14 -0
- package/dist/tasks.d.ts +311 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +396 -0
- package/dist/templates.d.ts +48 -0
- package/dist/templates.d.ts.map +1 -0
- package/dist/templates.js +19 -0
- package/dist/time-tracking.d.ts +88 -0
- package/dist/time-tracking.d.ts.map +1 -0
- package/dist/time-tracking.js +101 -0
- package/dist/users-feedbacks.d.ts +66 -0
- package/dist/users-feedbacks.d.ts.map +1 -0
- package/dist/users-feedbacks.js +46 -0
- package/dist/users.d.ts +89 -0
- package/dist/users.d.ts.map +1 -0
- package/dist/users.js +139 -0
- package/dist/workspace-configs.d.ts +24 -0
- package/dist/workspace-configs.d.ts.map +1 -0
- package/dist/workspace-configs.js +76 -0
- package/dist/workspace-user-audit.d.ts +66 -0
- package/dist/workspace-user-audit.d.ts.map +1 -0
- package/dist/workspace-user-audit.js +23 -0
- package/dist/workspaces.d.ts +59 -0
- package/dist/workspaces.d.ts.map +1 -0
- package/dist/workspaces.js +131 -0
- package/package.json +141 -0
package/dist/tasks.js
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listWorkspaceTaskProjects = listWorkspaceTaskProjects;
|
|
4
|
+
exports.listWorkspaceLabels = listWorkspaceLabels;
|
|
5
|
+
exports.createWorkspaceLabel = createWorkspaceLabel;
|
|
6
|
+
exports.listWorkspaceTaskBoards = listWorkspaceTaskBoards;
|
|
7
|
+
exports.getWorkspaceBoardsData = getWorkspaceBoardsData;
|
|
8
|
+
exports.listWorkspaceBoardsWithLists = listWorkspaceBoardsWithLists;
|
|
9
|
+
exports.createWorkspaceTaskBoard = createWorkspaceTaskBoard;
|
|
10
|
+
exports.getWorkspaceTaskBoard = getWorkspaceTaskBoard;
|
|
11
|
+
exports.updateWorkspaceTaskBoard = updateWorkspaceTaskBoard;
|
|
12
|
+
exports.deleteWorkspaceTaskBoard = deleteWorkspaceTaskBoard;
|
|
13
|
+
exports.listWorkspaceTaskProjectsByIds = listWorkspaceTaskProjectsByIds;
|
|
14
|
+
exports.addWorkspaceTaskLabel = addWorkspaceTaskLabel;
|
|
15
|
+
exports.removeWorkspaceTaskLabel = removeWorkspaceTaskLabel;
|
|
16
|
+
exports.getWorkspaceTaskRelationships = getWorkspaceTaskRelationships;
|
|
17
|
+
exports.listWorkspaceTasks = listWorkspaceTasks;
|
|
18
|
+
exports.listTaskBoardStatusTemplates = listTaskBoardStatusTemplates;
|
|
19
|
+
exports.getWorkspaceTask = getWorkspaceTask;
|
|
20
|
+
exports.getCurrentUserTask = getCurrentUserTask;
|
|
21
|
+
exports.cleanupWorkspaceTaskMentions = cleanupWorkspaceTaskMentions;
|
|
22
|
+
exports.createWorkspaceTask = createWorkspaceTask;
|
|
23
|
+
exports.createWorkspaceTaskList = createWorkspaceTaskList;
|
|
24
|
+
exports.listWorkspaceTaskLists = listWorkspaceTaskLists;
|
|
25
|
+
exports.updateWorkspaceTaskList = updateWorkspaceTaskList;
|
|
26
|
+
exports.updateWorkspaceTask = updateWorkspaceTask;
|
|
27
|
+
exports.deleteWorkspaceTask = deleteWorkspaceTask;
|
|
28
|
+
exports.triggerWorkspaceTaskEmbedding = triggerWorkspaceTaskEmbedding;
|
|
29
|
+
exports.moveWorkspaceTask = moveWorkspaceTask;
|
|
30
|
+
exports.bulkWorkspaceTasks = bulkWorkspaceTasks;
|
|
31
|
+
exports.createWorkspaceTaskRelationship = createWorkspaceTaskRelationship;
|
|
32
|
+
exports.deleteWorkspaceTaskRelationship = deleteWorkspaceTaskRelationship;
|
|
33
|
+
exports.createWorkspaceTaskProject = createWorkspaceTaskProject;
|
|
34
|
+
exports.createWorkspaceTaskWithRelationship = createWorkspaceTaskWithRelationship;
|
|
35
|
+
exports.resolveTaskProjectWorkspaceId = resolveTaskProjectWorkspaceId;
|
|
36
|
+
exports.getWorkspaceTaskProject = getWorkspaceTaskProject;
|
|
37
|
+
exports.getWorkspaceTaskProjectTasks = getWorkspaceTaskProjectTasks;
|
|
38
|
+
const client_1 = require("./client");
|
|
39
|
+
async function listWorkspaceTaskProjects(workspaceId, options) {
|
|
40
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
41
|
+
const projects = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects`, {
|
|
42
|
+
query: {
|
|
43
|
+
compact: true,
|
|
44
|
+
},
|
|
45
|
+
cache: 'no-store',
|
|
46
|
+
});
|
|
47
|
+
return (projects ?? []).flatMap((project) => {
|
|
48
|
+
if (!project?.id || !project?.name) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
return [
|
|
52
|
+
{
|
|
53
|
+
id: project.id,
|
|
54
|
+
name: project.name,
|
|
55
|
+
status: project.status ?? null,
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async function listWorkspaceLabels(workspaceId, options) {
|
|
61
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
62
|
+
const labels = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/labels`, {
|
|
63
|
+
cache: 'no-store',
|
|
64
|
+
});
|
|
65
|
+
return (labels ?? []).sort((a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
|
66
|
+
}
|
|
67
|
+
async function createWorkspaceLabel(workspaceId, payload, options) {
|
|
68
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
69
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/labels`, {
|
|
70
|
+
method: 'POST',
|
|
71
|
+
headers: {
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
},
|
|
74
|
+
body: JSON.stringify(payload),
|
|
75
|
+
cache: 'no-store',
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async function listWorkspaceTaskBoards(workspaceId, options, clientOptions) {
|
|
79
|
+
const client = (0, client_1.getInternalApiClient)(clientOptions);
|
|
80
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards`, {
|
|
81
|
+
query: {
|
|
82
|
+
q: options?.q,
|
|
83
|
+
page: options?.page,
|
|
84
|
+
pageSize: options?.pageSize,
|
|
85
|
+
},
|
|
86
|
+
cache: 'no-store',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
async function getWorkspaceBoardsData(workspaceId, options, clientOptions) {
|
|
90
|
+
const client = (0, client_1.getInternalApiClient)(clientOptions);
|
|
91
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/boards-data`, {
|
|
92
|
+
query: {
|
|
93
|
+
q: options?.q,
|
|
94
|
+
page: options?.page,
|
|
95
|
+
pageSize: options?.pageSize,
|
|
96
|
+
},
|
|
97
|
+
cache: 'no-store',
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
async function listWorkspaceBoardsWithLists(workspaceId, options) {
|
|
101
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
102
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/boards-with-lists`, {
|
|
103
|
+
cache: 'no-store',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
async function createWorkspaceTaskBoard(workspaceId, payload, options) {
|
|
107
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
108
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards`, {
|
|
109
|
+
method: 'POST',
|
|
110
|
+
headers: {
|
|
111
|
+
'Content-Type': 'application/json',
|
|
112
|
+
},
|
|
113
|
+
body: JSON.stringify(payload),
|
|
114
|
+
cache: 'no-store',
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
async function getWorkspaceTaskBoard(workspaceId, boardId, options) {
|
|
118
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
119
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}`, {
|
|
120
|
+
cache: 'no-store',
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
async function updateWorkspaceTaskBoard(workspaceId, boardId, payload, options) {
|
|
124
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
125
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}`, {
|
|
126
|
+
method: 'PUT',
|
|
127
|
+
headers: {
|
|
128
|
+
'Content-Type': 'application/json',
|
|
129
|
+
},
|
|
130
|
+
body: JSON.stringify(payload),
|
|
131
|
+
cache: 'no-store',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
async function deleteWorkspaceTaskBoard(workspaceId, boardId, options) {
|
|
135
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
136
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}`, {
|
|
137
|
+
method: 'DELETE',
|
|
138
|
+
cache: 'no-store',
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
async function listWorkspaceTaskProjectsByIds(workspaceId, projectIds, options) {
|
|
142
|
+
if (projectIds.length === 0) {
|
|
143
|
+
return [];
|
|
144
|
+
}
|
|
145
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
146
|
+
const projects = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects`, {
|
|
147
|
+
query: {
|
|
148
|
+
compact: true,
|
|
149
|
+
ids: projectIds.join(','),
|
|
150
|
+
},
|
|
151
|
+
cache: 'no-store',
|
|
152
|
+
});
|
|
153
|
+
return (projects ?? []).flatMap((project) => {
|
|
154
|
+
if (!project?.id || !project?.name) {
|
|
155
|
+
return [];
|
|
156
|
+
}
|
|
157
|
+
return [
|
|
158
|
+
{
|
|
159
|
+
id: project.id,
|
|
160
|
+
name: project.name,
|
|
161
|
+
status: project.status ?? null,
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
async function addWorkspaceTaskLabel(workspaceId, taskId, labelId, options) {
|
|
167
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
168
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/labels`, {
|
|
169
|
+
method: 'POST',
|
|
170
|
+
headers: {
|
|
171
|
+
'Content-Type': 'application/json',
|
|
172
|
+
},
|
|
173
|
+
body: JSON.stringify({ labelId }),
|
|
174
|
+
cache: 'no-store',
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
async function removeWorkspaceTaskLabel(workspaceId, taskId, labelId, options) {
|
|
178
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
179
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/labels`, {
|
|
180
|
+
method: 'DELETE',
|
|
181
|
+
headers: {
|
|
182
|
+
'Content-Type': 'application/json',
|
|
183
|
+
},
|
|
184
|
+
body: JSON.stringify({ labelId }),
|
|
185
|
+
cache: 'no-store',
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
async function getWorkspaceTaskRelationships(workspaceId, taskId, options) {
|
|
189
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
190
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/relationships`, {
|
|
191
|
+
cache: 'no-store',
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
async function listWorkspaceTasks(workspaceId, options, clientOptions) {
|
|
195
|
+
const client = (0, client_1.getInternalApiClient)(clientOptions);
|
|
196
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks`, {
|
|
197
|
+
query: {
|
|
198
|
+
boardId: options?.boardId,
|
|
199
|
+
listId: options?.listId,
|
|
200
|
+
q: options?.q,
|
|
201
|
+
identifier: options?.identifier,
|
|
202
|
+
limit: options?.limit,
|
|
203
|
+
offset: options?.offset,
|
|
204
|
+
includeRelationshipSummary: options?.includeRelationshipSummary,
|
|
205
|
+
includeDeleted: options?.includeDeleted === 'only'
|
|
206
|
+
? 'only'
|
|
207
|
+
: options?.includeDeleted === true
|
|
208
|
+
? 'all'
|
|
209
|
+
: undefined,
|
|
210
|
+
includeCount: options?.includeCount,
|
|
211
|
+
},
|
|
212
|
+
cache: 'no-store',
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
async function listTaskBoardStatusTemplates(options) {
|
|
216
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
217
|
+
return client.json('/api/v1/task-board-status-templates', {
|
|
218
|
+
cache: 'no-store',
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
async function getWorkspaceTask(workspaceId, taskId, options) {
|
|
222
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
223
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}`, {
|
|
224
|
+
cache: 'no-store',
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
async function getCurrentUserTask(taskId, options) {
|
|
228
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
229
|
+
return client.json(`/api/v1/users/me/tasks/${(0, client_1.encodePathSegment)(taskId)}`, {
|
|
230
|
+
cache: 'no-store',
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
async function cleanupWorkspaceTaskMentions(workspaceId, taskId, options) {
|
|
234
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
235
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/mentions/cleanup`, {
|
|
236
|
+
method: 'POST',
|
|
237
|
+
cache: 'no-store',
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
async function createWorkspaceTask(workspaceId, payload, options) {
|
|
241
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
242
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks`, {
|
|
243
|
+
method: 'POST',
|
|
244
|
+
headers: {
|
|
245
|
+
'Content-Type': 'application/json',
|
|
246
|
+
},
|
|
247
|
+
body: JSON.stringify(payload),
|
|
248
|
+
cache: 'no-store',
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
async function createWorkspaceTaskList(workspaceId, boardId, payload, options) {
|
|
252
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
253
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/lists`, {
|
|
254
|
+
method: 'POST',
|
|
255
|
+
headers: {
|
|
256
|
+
'Content-Type': 'application/json',
|
|
257
|
+
},
|
|
258
|
+
body: JSON.stringify(payload),
|
|
259
|
+
cache: 'no-store',
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
async function listWorkspaceTaskLists(workspaceId, boardId, options) {
|
|
263
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
264
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/lists`, {
|
|
265
|
+
cache: 'no-store',
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
async function updateWorkspaceTaskList(workspaceId, boardId, listId, payload, options) {
|
|
269
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
270
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-boards/${(0, client_1.encodePathSegment)(boardId)}/lists/${(0, client_1.encodePathSegment)(listId)}`, {
|
|
271
|
+
method: 'PATCH',
|
|
272
|
+
headers: {
|
|
273
|
+
'Content-Type': 'application/json',
|
|
274
|
+
},
|
|
275
|
+
body: JSON.stringify(payload),
|
|
276
|
+
cache: 'no-store',
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
async function updateWorkspaceTask(workspaceId, taskId, payload, options) {
|
|
280
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
281
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}`, {
|
|
282
|
+
method: 'PUT',
|
|
283
|
+
headers: {
|
|
284
|
+
'Content-Type': 'application/json',
|
|
285
|
+
},
|
|
286
|
+
body: JSON.stringify(payload),
|
|
287
|
+
cache: 'no-store',
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
async function deleteWorkspaceTask(workspaceId, taskId, options) {
|
|
291
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
292
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}`, {
|
|
293
|
+
method: 'DELETE',
|
|
294
|
+
cache: 'no-store',
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
async function triggerWorkspaceTaskEmbedding(workspaceId, taskId, options) {
|
|
298
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
299
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/embedding`, {
|
|
300
|
+
method: 'POST',
|
|
301
|
+
cache: 'no-store',
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
async function moveWorkspaceTask(workspaceId, taskId, payload, options) {
|
|
305
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
306
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/move`, {
|
|
307
|
+
method: 'POST',
|
|
308
|
+
headers: {
|
|
309
|
+
'Content-Type': 'application/json',
|
|
310
|
+
},
|
|
311
|
+
body: JSON.stringify(payload),
|
|
312
|
+
cache: 'no-store',
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
async function bulkWorkspaceTasks(workspaceId, payload, options) {
|
|
316
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
317
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/bulk`, {
|
|
318
|
+
method: 'POST',
|
|
319
|
+
headers: {
|
|
320
|
+
'Content-Type': 'application/json',
|
|
321
|
+
},
|
|
322
|
+
body: JSON.stringify(payload),
|
|
323
|
+
cache: 'no-store',
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
async function createWorkspaceTaskRelationship(workspaceId, taskId, payload, options) {
|
|
327
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
328
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/relationships`, {
|
|
329
|
+
method: 'POST',
|
|
330
|
+
headers: {
|
|
331
|
+
'Content-Type': 'application/json',
|
|
332
|
+
},
|
|
333
|
+
body: JSON.stringify(payload),
|
|
334
|
+
cache: 'no-store',
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
async function deleteWorkspaceTaskRelationship(workspaceId, taskId, payload, options) {
|
|
338
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
339
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/${(0, client_1.encodePathSegment)(taskId)}/relationships`, {
|
|
340
|
+
method: 'DELETE',
|
|
341
|
+
headers: {
|
|
342
|
+
'Content-Type': 'application/json',
|
|
343
|
+
},
|
|
344
|
+
body: JSON.stringify(payload),
|
|
345
|
+
cache: 'no-store',
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
async function createWorkspaceTaskProject(workspaceId, payload, options) {
|
|
349
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
350
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects`, {
|
|
351
|
+
method: 'POST',
|
|
352
|
+
headers: {
|
|
353
|
+
'Content-Type': 'application/json',
|
|
354
|
+
},
|
|
355
|
+
body: JSON.stringify(payload),
|
|
356
|
+
cache: 'no-store',
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
async function createWorkspaceTaskWithRelationship(workspaceId, payload, options) {
|
|
360
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
361
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/tasks/with-relationship`, {
|
|
362
|
+
method: 'POST',
|
|
363
|
+
headers: {
|
|
364
|
+
'Content-Type': 'application/json',
|
|
365
|
+
},
|
|
366
|
+
body: JSON.stringify(payload),
|
|
367
|
+
cache: 'no-store',
|
|
368
|
+
});
|
|
369
|
+
}
|
|
370
|
+
async function resolveTaskProjectWorkspaceId(input, options) {
|
|
371
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
372
|
+
const payload = await client.json('/api/v1/task-projects/resolve-workspace', {
|
|
373
|
+
method: 'POST',
|
|
374
|
+
headers: {
|
|
375
|
+
'Content-Type': 'application/json',
|
|
376
|
+
},
|
|
377
|
+
body: JSON.stringify({
|
|
378
|
+
boardId: input.boardId ?? undefined,
|
|
379
|
+
projectIds: input.projectIds ?? [],
|
|
380
|
+
}),
|
|
381
|
+
cache: 'no-store',
|
|
382
|
+
});
|
|
383
|
+
return payload.workspaceId ?? null;
|
|
384
|
+
}
|
|
385
|
+
async function getWorkspaceTaskProject(workspaceId, projectId, options) {
|
|
386
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
387
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects/${(0, client_1.encodePathSegment)(projectId)}`, {
|
|
388
|
+
cache: 'no-store',
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
async function getWorkspaceTaskProjectTasks(workspaceId, projectId, options) {
|
|
392
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
393
|
+
return client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/task-projects/${(0, client_1.encodePathSegment)(projectId)}/tasks`, {
|
|
394
|
+
cache: 'no-store',
|
|
395
|
+
});
|
|
396
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type InternalApiClientOptions } from './client';
|
|
2
|
+
export interface InternalApiTemplateTask {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string | null;
|
|
5
|
+
priority: 'low' | 'normal' | 'high' | 'critical' | null;
|
|
6
|
+
completed: boolean;
|
|
7
|
+
start_date?: string | null;
|
|
8
|
+
end_date?: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface InternalApiTemplateList {
|
|
11
|
+
name: string;
|
|
12
|
+
status: string;
|
|
13
|
+
tasks: InternalApiTemplateTask[];
|
|
14
|
+
}
|
|
15
|
+
export interface InternalApiTemplateContent {
|
|
16
|
+
lists?: InternalApiTemplateList[];
|
|
17
|
+
labels?: Array<{
|
|
18
|
+
name: string;
|
|
19
|
+
color: string;
|
|
20
|
+
}>;
|
|
21
|
+
settings?: {
|
|
22
|
+
estimation_type?: string | null;
|
|
23
|
+
allow_zero_estimates?: boolean | null;
|
|
24
|
+
extended_estimation?: boolean | null;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface InternalApiWorkspaceTemplate {
|
|
28
|
+
id: string;
|
|
29
|
+
wsId: string;
|
|
30
|
+
createdBy: string | null;
|
|
31
|
+
sourceBoardId: string | null;
|
|
32
|
+
name: string;
|
|
33
|
+
description: string | null;
|
|
34
|
+
visibility: 'private' | 'workspace' | 'public';
|
|
35
|
+
content: InternalApiTemplateContent;
|
|
36
|
+
createdAt: string;
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
isOwner: boolean;
|
|
39
|
+
stats: {
|
|
40
|
+
lists: number;
|
|
41
|
+
tasks: number;
|
|
42
|
+
labels: number;
|
|
43
|
+
};
|
|
44
|
+
backgroundPath?: string | null;
|
|
45
|
+
}
|
|
46
|
+
export declare function getWorkspaceTemplate(workspaceId: string, templateId: string, options?: InternalApiClientOptions): Promise<InternalApiWorkspaceTemplate>;
|
|
47
|
+
export declare function getWorkspaceTemplateBackgroundUrl(workspaceId: string, templateId: string, options?: InternalApiClientOptions): Promise<string | null>;
|
|
48
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,wBAAwB,EAC9B,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;IACxD,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC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CAAC,EAAE,wBAAwB,0BAWnC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getWorkspaceTemplate = getWorkspaceTemplate;
|
|
4
|
+
exports.getWorkspaceTemplateBackgroundUrl = getWorkspaceTemplateBackgroundUrl;
|
|
5
|
+
const client_1 = require("./client");
|
|
6
|
+
async function getWorkspaceTemplate(workspaceId, templateId, options) {
|
|
7
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
8
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/templates/${(0, client_1.encodePathSegment)(templateId)}`, {
|
|
9
|
+
cache: 'no-store',
|
|
10
|
+
});
|
|
11
|
+
return payload.template;
|
|
12
|
+
}
|
|
13
|
+
async function getWorkspaceTemplateBackgroundUrl(workspaceId, templateId, options) {
|
|
14
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
15
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/templates/${(0, client_1.encodePathSegment)(templateId)}/background-url`, {
|
|
16
|
+
cache: 'no-store',
|
|
17
|
+
});
|
|
18
|
+
return payload.signedUrl ?? null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { InternalApiWorkspaceMember, Tables } from '@tuturuuu/types';
|
|
2
|
+
import { type InternalApiClientOptions } from './client';
|
|
3
|
+
export type WorkspaceBreakType = Tables<'workspace_break_types'>;
|
|
4
|
+
export interface CreateWorkspaceBreakTypeInput {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string | null;
|
|
7
|
+
color: string;
|
|
8
|
+
icon: string;
|
|
9
|
+
isDefault?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface UpdateWorkspaceBreakTypeInput {
|
|
12
|
+
name?: string;
|
|
13
|
+
description?: string | null;
|
|
14
|
+
color?: string;
|
|
15
|
+
icon?: string | null;
|
|
16
|
+
isDefault?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface TimeTrackingRequestImageUrl {
|
|
19
|
+
path: string;
|
|
20
|
+
signedUrl: string | null;
|
|
21
|
+
}
|
|
22
|
+
export interface TimeTrackingBreakSummaryData {
|
|
23
|
+
break_duration_seconds: number;
|
|
24
|
+
}
|
|
25
|
+
export interface TimeTrackingBreakRecord {
|
|
26
|
+
id: string;
|
|
27
|
+
session_id: string;
|
|
28
|
+
break_type_id?: string | null;
|
|
29
|
+
break_type_name?: string | null;
|
|
30
|
+
break_start: string;
|
|
31
|
+
break_end?: string | null;
|
|
32
|
+
break_duration_seconds?: number | null;
|
|
33
|
+
}
|
|
34
|
+
export interface TimeTrackingWorkspaceTask {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
description?: string | null;
|
|
38
|
+
priority?: string | null;
|
|
39
|
+
start_date?: string | null;
|
|
40
|
+
end_date?: string | null;
|
|
41
|
+
created_at?: string | null;
|
|
42
|
+
board_name?: string | null;
|
|
43
|
+
list_name?: string | null;
|
|
44
|
+
ticket_prefix?: string | null;
|
|
45
|
+
assignees?: Array<{
|
|
46
|
+
user?: Pick<InternalApiWorkspaceMember, 'id' | 'display_name' | 'avatar_url' | 'email'> | null;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
export declare function getTimeTrackingRequestImageUrls(workspaceId: string, requestId: string, imagePaths: string[], options?: InternalApiClientOptions): Promise<TimeTrackingRequestImageUrl[]>;
|
|
50
|
+
export declare function listWorkspaceBreakTypes(workspaceId: string, options?: InternalApiClientOptions): Promise<{
|
|
51
|
+
color: string | null;
|
|
52
|
+
created_at: string | null;
|
|
53
|
+
description: string | null;
|
|
54
|
+
icon: string | null;
|
|
55
|
+
id: string;
|
|
56
|
+
is_default: boolean | null;
|
|
57
|
+
name: string;
|
|
58
|
+
updated_at: string | null;
|
|
59
|
+
ws_id: string;
|
|
60
|
+
}[]>;
|
|
61
|
+
export declare function createWorkspaceBreakType(workspaceId: string, input: CreateWorkspaceBreakTypeInput, options?: InternalApiClientOptions): Promise<{
|
|
62
|
+
color: string | null;
|
|
63
|
+
created_at: string | null;
|
|
64
|
+
description: string | null;
|
|
65
|
+
icon: string | null;
|
|
66
|
+
id: string;
|
|
67
|
+
is_default: boolean | null;
|
|
68
|
+
name: string;
|
|
69
|
+
updated_at: string | null;
|
|
70
|
+
ws_id: string;
|
|
71
|
+
}>;
|
|
72
|
+
export declare function updateWorkspaceBreakType(workspaceId: string, breakTypeId: string, input: UpdateWorkspaceBreakTypeInput, options?: InternalApiClientOptions): Promise<{
|
|
73
|
+
color: string | null;
|
|
74
|
+
created_at: string | null;
|
|
75
|
+
description: string | null;
|
|
76
|
+
icon: string | null;
|
|
77
|
+
id: string;
|
|
78
|
+
is_default: boolean | null;
|
|
79
|
+
name: string;
|
|
80
|
+
updated_at: string | null;
|
|
81
|
+
ws_id: string;
|
|
82
|
+
}>;
|
|
83
|
+
export declare function deleteWorkspaceBreakType(workspaceId: string, breakTypeId: string, options?: InternalApiClientOptions): Promise<void>;
|
|
84
|
+
export declare function listWorkspaceTimeTrackingTasks(workspaceId: string, options?: InternalApiClientOptions): Promise<TimeTrackingWorkspaceTask[]>;
|
|
85
|
+
export declare function listSessionBreaks(workspaceId: string, sessionId: string, options?: InternalApiClientOptions): Promise<TimeTrackingBreakRecord[]>;
|
|
86
|
+
export declare function listSessionBreakSummaries(workspaceId: string, sessionIds: string[], options?: InternalApiClientOptions): Promise<Record<string, TimeTrackingBreakSummaryData[]>>;
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=time-tracking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time-tracking.d.ts","sourceRoot":"","sources":["../src/time-tracking.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAGL,KAAK,wBAAwB,E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AC,EAAE,wBAAwB,sCAYnC;AAED,wBAAsB,yBAAyB,CAC7C,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,MAAM,EAAE,EACpB,OAAO,CAAC,EAAE,wBAAwB,2DAqBnC"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTimeTrackingRequestImageUrls = getTimeTrackingRequestImageUrls;
|
|
4
|
+
exports.listWorkspaceBreakTypes = listWorkspaceBreakTypes;
|
|
5
|
+
exports.createWorkspaceBreakType = createWorkspaceBreakType;
|
|
6
|
+
exports.updateWorkspaceBreakType = updateWorkspaceBreakType;
|
|
7
|
+
exports.deleteWorkspaceBreakType = deleteWorkspaceBreakType;
|
|
8
|
+
exports.listWorkspaceTimeTrackingTasks = listWorkspaceTimeTrackingTasks;
|
|
9
|
+
exports.listSessionBreaks = listSessionBreaks;
|
|
10
|
+
exports.listSessionBreakSummaries = listSessionBreakSummaries;
|
|
11
|
+
const client_1 = require("./client");
|
|
12
|
+
async function getTimeTrackingRequestImageUrls(workspaceId, requestId, imagePaths, options) {
|
|
13
|
+
if (imagePaths.length === 0) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
17
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/requests/${(0, client_1.encodePathSegment)(requestId)}/image-urls`, {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
cache: 'no-store',
|
|
20
|
+
headers: {
|
|
21
|
+
'Content-Type': 'application/json',
|
|
22
|
+
},
|
|
23
|
+
body: JSON.stringify({ imagePaths }),
|
|
24
|
+
});
|
|
25
|
+
return payload.urls ?? [];
|
|
26
|
+
}
|
|
27
|
+
async function listWorkspaceBreakTypes(workspaceId, options) {
|
|
28
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
29
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/break-types`, {
|
|
30
|
+
method: 'GET',
|
|
31
|
+
cache: 'no-store',
|
|
32
|
+
});
|
|
33
|
+
return payload.breakTypes ?? [];
|
|
34
|
+
}
|
|
35
|
+
async function createWorkspaceBreakType(workspaceId, input, options) {
|
|
36
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
37
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/break-types`, {
|
|
38
|
+
method: 'POST',
|
|
39
|
+
cache: 'no-store',
|
|
40
|
+
headers: {
|
|
41
|
+
'Content-Type': 'application/json',
|
|
42
|
+
},
|
|
43
|
+
body: JSON.stringify(input),
|
|
44
|
+
});
|
|
45
|
+
if (!payload.breakType) {
|
|
46
|
+
throw new Error(`missing breakType in createWorkspaceBreakType response (workspaceId=${workspaceId})`);
|
|
47
|
+
}
|
|
48
|
+
return payload.breakType;
|
|
49
|
+
}
|
|
50
|
+
async function updateWorkspaceBreakType(workspaceId, breakTypeId, input, options) {
|
|
51
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
52
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/break-types/${(0, client_1.encodePathSegment)(breakTypeId)}`, {
|
|
53
|
+
method: 'PATCH',
|
|
54
|
+
cache: 'no-store',
|
|
55
|
+
headers: {
|
|
56
|
+
'Content-Type': 'application/json',
|
|
57
|
+
},
|
|
58
|
+
body: JSON.stringify(input),
|
|
59
|
+
});
|
|
60
|
+
if (!payload.breakType) {
|
|
61
|
+
throw new Error(`missing breakType in updateWorkspaceBreakType response (workspaceId=${workspaceId}, breakTypeId=${breakTypeId})`);
|
|
62
|
+
}
|
|
63
|
+
return payload.breakType;
|
|
64
|
+
}
|
|
65
|
+
async function deleteWorkspaceBreakType(workspaceId, breakTypeId, options) {
|
|
66
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
67
|
+
await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/break-types/${(0, client_1.encodePathSegment)(breakTypeId)}`, {
|
|
68
|
+
method: 'DELETE',
|
|
69
|
+
cache: 'no-store',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
async function listWorkspaceTimeTrackingTasks(workspaceId, options) {
|
|
73
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
74
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/tasks`, {
|
|
75
|
+
method: 'GET',
|
|
76
|
+
cache: 'no-store',
|
|
77
|
+
});
|
|
78
|
+
return payload.tasks ?? [];
|
|
79
|
+
}
|
|
80
|
+
async function listSessionBreaks(workspaceId, sessionId, options) {
|
|
81
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
82
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/breaks`, {
|
|
83
|
+
query: { sessionId },
|
|
84
|
+
cache: 'no-store',
|
|
85
|
+
});
|
|
86
|
+
return payload.breaks ?? [];
|
|
87
|
+
}
|
|
88
|
+
async function listSessionBreakSummaries(workspaceId, sessionIds, options) {
|
|
89
|
+
if (sessionIds.length === 0) {
|
|
90
|
+
return {};
|
|
91
|
+
}
|
|
92
|
+
const client = (0, client_1.getInternalApiClient)(options);
|
|
93
|
+
const payload = await client.json(`/api/v1/workspaces/${(0, client_1.encodePathSegment)(workspaceId)}/time-tracking/breaks`, {
|
|
94
|
+
query: {
|
|
95
|
+
sessionIds: sessionIds.join(','),
|
|
96
|
+
summaryOnly: true,
|
|
97
|
+
},
|
|
98
|
+
cache: 'no-store',
|
|
99
|
+
});
|
|
100
|
+
return payload.breaksBySession ?? {};
|
|
101
|
+
}
|