@studious-lms/server 1.1.19 → 1.1.21
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/BASE64_REMOVAL_SUMMARY.md +153 -0
- package/dist/lib/fileUpload.d.ts +45 -12
- package/dist/lib/fileUpload.d.ts.map +1 -1
- package/dist/lib/fileUpload.js +181 -72
- package/dist/lib/googleCloudStorage.d.ts +7 -8
- package/dist/lib/googleCloudStorage.d.ts.map +1 -1
- package/dist/lib/googleCloudStorage.js +21 -33
- package/dist/lib/thumbnailGenerator.d.ts +0 -1
- package/dist/lib/thumbnailGenerator.d.ts.map +1 -1
- package/dist/lib/thumbnailGenerator.js +3 -17
- package/dist/routers/_app.d.ts +476 -10
- package/dist/routers/_app.d.ts.map +1 -1
- package/dist/routers/assignment.d.ts +221 -4
- package/dist/routers/assignment.d.ts.map +1 -1
- package/dist/routers/assignment.js +244 -16
- package/dist/routers/auth.js +1 -1
- package/dist/routers/file.d.ts +18 -0
- package/dist/routers/file.d.ts.map +1 -1
- package/dist/routers/folder.d.ts +0 -1
- package/dist/routers/folder.d.ts.map +1 -1
- package/dist/routers/folder.js +12 -9
- package/dist/routers/labChat.d.ts.map +1 -1
- package/dist/routers/labChat.js +4 -2
- package/package.json +1 -1
- package/prisma/migrations/20251020151505_add_upload_tracking_fields/migration.sql +57 -0
- package/prisma/schema.prisma +19 -0
- package/src/lib/fileUpload.ts +229 -83
- package/src/lib/googleCloudStorage.ts +21 -40
- package/src/lib/thumbnailGenerator.ts +3 -18
- package/src/routers/assignment.ts +292 -16
- package/src/routers/auth.ts +1 -1
- package/src/routers/folder.ts +13 -9
- package/src/routers/labChat.ts +4 -2
- package/src/routers/user.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thumbnailGenerator.d.ts","sourceRoot":"","sources":["../../src/lib/thumbnailGenerator.ts"],"names":[],"mappings":"AAiDA;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlG;AA4CD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BlG;AAED;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"thumbnailGenerator.d.ts","sourceRoot":"","sources":["../../src/lib/thumbnailGenerator.ts"],"names":[],"mappings":"AAiDA;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA4BlG;AA4CD;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA0BlG;AAED;;;;;;GAMG"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import sharp from 'sharp';
|
|
2
|
-
import {
|
|
3
|
-
import { uploadFile, getSignedUrl } from './googleCloudStorage.js';
|
|
2
|
+
import { getSignedUrl } from './googleCloudStorage.js';
|
|
4
3
|
// Thumbnail size configuration
|
|
5
4
|
const THUMBNAIL_WIDTH = 200;
|
|
6
5
|
const THUMBNAIL_HEIGHT = 200;
|
|
@@ -155,18 +154,5 @@ export async function generateThumbnail(fileName, fileType) {
|
|
|
155
154
|
* @param userId The user ID who owns the file
|
|
156
155
|
* @returns The ID of the created thumbnail File
|
|
157
156
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
const base64Data = `data:image/jpeg;base64,${thumbnailBuffer.toString('base64')}`;
|
|
161
|
-
const thumbnailFileName = await uploadFile(base64Data, `thumbnails/${originalFileName}_thumb`, 'image/jpeg');
|
|
162
|
-
// Create a new File entry for the thumbnail
|
|
163
|
-
const newThumbnail = await prisma.file.create({
|
|
164
|
-
data: {
|
|
165
|
-
name: `${originalFileName}_thumb.jpg`,
|
|
166
|
-
path: thumbnailFileName,
|
|
167
|
-
type: 'image/jpeg',
|
|
168
|
-
userId: userId,
|
|
169
|
-
},
|
|
170
|
-
});
|
|
171
|
-
return newThumbnail.id;
|
|
172
|
-
}
|
|
157
|
+
// DEPRECATED: This function is no longer used - thumbnails are generated during direct uploads
|
|
158
|
+
// Thumbnail generation is now handled in the direct upload flow
|