@openturtle/cli 0.3.4 → 0.3.6
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.
|
@@ -42,7 +42,14 @@ export function createCollaborationCommands(client = new ApiClient()) {
|
|
|
42
42
|
? client.get(`/api/projects/${encodeURIComponent(projectId)}/members`).catch(() => null)
|
|
43
43
|
: Promise.resolve(null),
|
|
44
44
|
]);
|
|
45
|
-
return {
|
|
45
|
+
return {
|
|
46
|
+
team,
|
|
47
|
+
profile,
|
|
48
|
+
roster_profile: rosterProfile,
|
|
49
|
+
project_id: projectId || null,
|
|
50
|
+
members,
|
|
51
|
+
project_members: projectMembers,
|
|
52
|
+
};
|
|
46
53
|
},
|
|
47
54
|
async getWorkSummary(options) {
|
|
48
55
|
const limit = Number(options.limit) || 20;
|
|
@@ -21,7 +21,7 @@ export function createResourceCommands(client = new ApiClient()) {
|
|
|
21
21
|
return client.patch(`/api/todos/${encodeURIComponent(todoId)}/status`, { status });
|
|
22
22
|
},
|
|
23
23
|
async updateTodoProgress(todoId, message) {
|
|
24
|
-
return client.
|
|
24
|
+
return client.put(`/api/todos/${encodeURIComponent(todoId)}/progress-description`, {
|
|
25
25
|
progress_description: message,
|
|
26
26
|
});
|
|
27
27
|
},
|
package/dist/core/api-client.js
CHANGED
|
@@ -143,12 +143,41 @@ async function refreshedAsset(asset) {
|
|
|
143
143
|
return { ...asset, syncState: 'missing' };
|
|
144
144
|
const changed = stat.size !== asset.sizeBytes || stat.mtimeMs !== asset.modifiedAt;
|
|
145
145
|
const contentHash = changed ? await fileHash(asset.path) : asset.contentHash;
|
|
146
|
-
|
|
146
|
+
let refreshed = {
|
|
147
147
|
...asset,
|
|
148
148
|
sizeBytes: stat.size,
|
|
149
149
|
modifiedAt: stat.mtimeMs,
|
|
150
150
|
contentHash,
|
|
151
151
|
};
|
|
152
|
+
if (asset.entry) {
|
|
153
|
+
const attachments = await Promise.all(asset.entry.attachments.map(async (attachment) => {
|
|
154
|
+
try {
|
|
155
|
+
const attachmentStat = await fs.promises.stat(attachment.path);
|
|
156
|
+
if (!attachmentStat.isFile())
|
|
157
|
+
return null;
|
|
158
|
+
const attachmentChanged = attachmentStat.size !== attachment.sizeBytes || attachmentStat.mtimeMs !== attachment.modifiedAt;
|
|
159
|
+
return {
|
|
160
|
+
...attachment,
|
|
161
|
+
sizeBytes: attachmentStat.size,
|
|
162
|
+
modifiedAt: attachmentStat.mtimeMs,
|
|
163
|
+
contentHash: attachmentChanged ? await fileHash(attachment.path) : attachment.contentHash,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
}));
|
|
170
|
+
if (attachments.some((attachment) => attachment === null)) {
|
|
171
|
+
return { ...refreshed, syncState: 'missing' };
|
|
172
|
+
}
|
|
173
|
+
refreshed = {
|
|
174
|
+
...refreshed,
|
|
175
|
+
entry: {
|
|
176
|
+
...asset.entry,
|
|
177
|
+
attachments: attachments,
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
}
|
|
152
181
|
const syncState = asset.entry
|
|
153
182
|
? asset.cloudMemoryId && asset.cloudEntryHash === entryHash(refreshed)
|
|
154
183
|
? 'synced'
|