@proteinjs/db-file 1.8.4 → 1.9.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.
Files changed (102) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/generated/index.d.ts.map +1 -1
  3. package/dist/generated/index.js +3 -1
  4. package/dist/generated/index.js.map +1 -1
  5. package/dist/index.d.ts +4 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +4 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/src/DbFileStorageDriver.d.ts +7 -0
  10. package/dist/src/DbFileStorageDriver.d.ts.map +1 -1
  11. package/dist/src/DbFileStorageDriver.js +69 -41
  12. package/dist/src/DbFileStorageDriver.js.map +1 -1
  13. package/dist/src/FileCopyForOthers.d.ts +52 -0
  14. package/dist/src/FileCopyForOthers.d.ts.map +1 -0
  15. package/dist/src/FileCopyForOthers.js +62 -0
  16. package/dist/src/FileCopyForOthers.js.map +1 -0
  17. package/dist/src/FileStorage.d.ts +158 -11
  18. package/dist/src/FileStorage.d.ts.map +1 -1
  19. package/dist/src/FileStorage.js +562 -41
  20. package/dist/src/FileStorage.js.map +1 -1
  21. package/dist/src/FileStorageDriver.d.ts +11 -0
  22. package/dist/src/FileStorageDriver.d.ts.map +1 -1
  23. package/dist/src/FileStorageError.d.ts +62 -0
  24. package/dist/src/FileStorageError.d.ts.map +1 -0
  25. package/dist/src/FileStorageError.js +118 -0
  26. package/dist/src/FileStorageError.js.map +1 -0
  27. package/dist/src/FileVariantMaker.d.ts +66 -0
  28. package/dist/src/FileVariantMaker.d.ts.map +1 -0
  29. package/dist/src/FileVariantMaker.js +62 -0
  30. package/dist/src/FileVariantMaker.js.map +1 -0
  31. package/dist/src/routes/FileResponder.d.ts +41 -0
  32. package/dist/src/routes/FileResponder.d.ts.map +1 -0
  33. package/dist/src/routes/FileResponder.js +135 -0
  34. package/dist/src/routes/FileResponder.js.map +1 -0
  35. package/dist/src/routes/getFile.d.ts +5 -13
  36. package/dist/src/routes/getFile.d.ts.map +1 -1
  37. package/dist/src/routes/getFile.js +20 -56
  38. package/dist/src/routes/getFile.js.map +1 -1
  39. package/dist/src/routes/getFileVariant.d.ts +20 -0
  40. package/dist/src/routes/getFileVariant.d.ts.map +1 -0
  41. package/dist/src/routes/getFileVariant.js +112 -0
  42. package/dist/src/routes/getFileVariant.js.map +1 -0
  43. package/dist/src/routes/getFileVariantRoute.d.ts +7 -0
  44. package/dist/src/routes/getFileVariantRoute.d.ts.map +1 -0
  45. package/dist/src/routes/getFileVariantRoute.js +9 -0
  46. package/dist/src/routes/getFileVariantRoute.js.map +1 -0
  47. package/dist/src/tables/FileTable.d.ts +70 -2
  48. package/dist/src/tables/FileTable.d.ts.map +1 -1
  49. package/dist/src/tables/FileTable.js +30 -0
  50. package/dist/src/tables/FileTable.js.map +1 -1
  51. package/dist/test/DbFileStorageDriverMissingBytes.test.d.ts +2 -0
  52. package/dist/test/DbFileStorageDriverMissingBytes.test.d.ts.map +1 -0
  53. package/dist/test/DbFileStorageDriverMissingBytes.test.js +184 -0
  54. package/dist/test/DbFileStorageDriverMissingBytes.test.js.map +1 -0
  55. package/dist/test/FileByteAccess.test.js +6 -3
  56. package/dist/test/FileByteAccess.test.js.map +1 -1
  57. package/dist/test/FileCopyForOthers.test.d.ts +2 -0
  58. package/dist/test/FileCopyForOthers.test.d.ts.map +1 -0
  59. package/dist/test/FileCopyForOthers.test.js +1143 -0
  60. package/dist/test/FileCopyForOthers.test.js.map +1 -0
  61. package/dist/test/FileDerivedProvenance.test.d.ts +2 -0
  62. package/dist/test/FileDerivedProvenance.test.d.ts.map +1 -0
  63. package/dist/test/FileDerivedProvenance.test.js +420 -0
  64. package/dist/test/FileDerivedProvenance.test.js.map +1 -0
  65. package/dist/test/FileMediaMetadata.test.js +60 -5
  66. package/dist/test/FileMediaMetadata.test.js.map +1 -1
  67. package/dist/test/FileStorageError.test.d.ts +2 -0
  68. package/dist/test/FileStorageError.test.d.ts.map +1 -0
  69. package/dist/test/FileStorageError.test.js +68 -0
  70. package/dist/test/FileStorageError.test.js.map +1 -0
  71. package/dist/test/FileTestEnvironment.d.ts.map +1 -1
  72. package/dist/test/FileTestEnvironment.js +3 -0
  73. package/dist/test/FileTestEnvironment.js.map +1 -1
  74. package/dist/test/FileVariants.test.d.ts +2 -0
  75. package/dist/test/FileVariants.test.d.ts.map +1 -0
  76. package/dist/test/FileVariants.test.js +1008 -0
  77. package/dist/test/FileVariants.test.js.map +1 -0
  78. package/dist/test/GetFileRoute.test.js +29 -0
  79. package/dist/test/GetFileRoute.test.js.map +1 -1
  80. package/generated/index.ts +3 -1
  81. package/index.ts +4 -0
  82. package/package.json +5 -5
  83. package/src/DbFileStorageDriver.ts +32 -21
  84. package/src/FileCopyForOthers.ts +71 -0
  85. package/src/FileStorage.ts +377 -19
  86. package/src/FileStorageDriver.ts +12 -0
  87. package/src/FileStorageError.ts +123 -0
  88. package/src/FileVariantMaker.ts +89 -0
  89. package/src/routes/FileResponder.ts +85 -0
  90. package/src/routes/getFile.ts +9 -44
  91. package/src/routes/getFileVariant.ts +53 -0
  92. package/src/routes/getFileVariantRoute.ts +7 -0
  93. package/src/tables/FileTable.ts +82 -1
  94. package/test/DbFileStorageDriverMissingBytes.test.ts +85 -0
  95. package/test/FileByteAccess.test.ts +7 -1
  96. package/test/FileCopyForOthers.test.ts +702 -0
  97. package/test/FileDerivedProvenance.test.ts +248 -0
  98. package/test/FileMediaMetadata.test.ts +44 -0
  99. package/test/FileStorageError.test.ts +79 -0
  100. package/test/FileTestEnvironment.ts +3 -0
  101. package/test/FileVariants.test.ts +604 -0
  102. package/test/GetFileRoute.test.ts +19 -0
@@ -39,83 +39,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.getFile = void 0;
40
40
  var FileStorage_1 = require("../FileStorage");
41
41
  var user_1 = require("@proteinjs/user");
42
- var byteRange_1 = require("./byteRange");
42
+ var FileResponder_1 = require("./FileResponder");
43
43
  /**
44
44
  * Serves a file's bytes. Auth first: logged-in, then the `FileStorage.getFile` row read as the
45
- * access decision — the caller's SCOPED read, else the shared-content reachability leg
46
- * (`FileReachabilityResolver`: the caller may read a file when they may read a row that
47
- * references it, e.g. a shared thought's media node). Then one of two serving paths:
48
- *
49
- * - **302 redirect** to a short-lived signed URL when the driver's store has an external URL
50
- * space (GCS). The app URL stays the one stable reference every `<img>`/`<video>`/chip uses;
51
- * the client follows the redirect and reads the store directly — native Range/206 for video
52
- * seeking, real caching, bytes never transit the app server. The redirect itself is cached
53
- * briefly (client-private, well under the signed TTL) so repeated loads reuse one URL.
54
- * - **Proxy** for drivers with no external URL space (`DbFileStorageDriver`): the interface's
55
- * base64 is decoded so every mime — binary or text — serves its true bytes, and HTTP Range
56
- * is honored (206/416 via {@link resolveByteRange}) so a `<video>` can SEEK against a
57
- * proxy-served blob — streaming parity with the signed-URL path instead of download-then-watch.
45
+ * access decision — the caller's SCOPED read, else a variant's original, else the shared-content
46
+ * reachability leg (`FileReachabilityResolver`: the caller may read a file when they may read a
47
+ * row that references it, e.g. a shared thought's media node). Then {@link FileResponder} — the
48
+ * one serving path (a 302 to a signed URL, or the proxy with Range) every file route answers
49
+ * through.
58
50
  */
59
51
  exports.getFile = {
60
52
  path: '/file/:id',
61
53
  method: 'get',
62
54
  onRequest: function (request, response) { return __awaiter(void 0, void 0, void 0, function () {
63
- var fileId, fileStorage, file, signedUrl, fileDataBase64, bytes, safeFilename, range, error_1;
64
- var _a;
65
- return __generator(this, function (_b) {
66
- switch (_b.label) {
55
+ var fileId, file, error_1;
56
+ return __generator(this, function (_a) {
57
+ switch (_a.label) {
67
58
  case 0:
68
59
  if (!user_1.UserAuth.isLoggedIn()) {
69
60
  response.status(401).send('User not logged in');
70
61
  return [2 /*return*/];
71
62
  }
72
63
  fileId = request.params.id;
73
- fileStorage = (0, FileStorage_1.getFileStorage)();
74
- _b.label = 1;
64
+ _a.label = 1;
75
65
  case 1:
76
- _b.trys.push([1, 5, , 6]);
77
- return [4 /*yield*/, fileStorage.getFile(fileId)];
66
+ _a.trys.push([1, 4, , 5]);
67
+ return [4 /*yield*/, (0, FileStorage_1.getFileStorage)().getFile(fileId)];
78
68
  case 2:
79
- file = _b.sent();
69
+ file = _a.sent();
80
70
  if (!file) {
81
71
  response.status(404).send('File not found');
82
72
  return [2 /*return*/];
83
73
  }
84
- return [4 /*yield*/, fileStorage.getSignedUrl(fileId)];
74
+ return [4 /*yield*/, FileResponder_1.FileResponder.serve(file, request, response)];
85
75
  case 3:
86
- signedUrl = _b.sent();
87
- if (signedUrl) {
88
- response.setHeader('Cache-Control', 'private, max-age=300');
89
- response.redirect(302, signedUrl);
90
- return [2 /*return*/];
91
- }
92
- return [4 /*yield*/, fileStorage.getFileData(fileId)];
76
+ _a.sent();
77
+ return [3 /*break*/, 5];
93
78
  case 4:
94
- fileDataBase64 = _b.sent();
95
- bytes = Buffer.from(fileDataBase64, 'base64');
96
- safeFilename = encodeURIComponent(file.name);
97
- response.setHeader('Content-Disposition', "inline; filename=\"".concat(safeFilename, "\""));
98
- response.setHeader('Content-Type', file.type);
99
- response.setHeader('Accept-Ranges', 'bytes');
100
- range = (0, byteRange_1.resolveByteRange)((_a = request.headers) === null || _a === void 0 ? void 0 : _a.range, bytes.length);
101
- if (range === 'unsatisfiable') {
102
- response.setHeader('Content-Range', "bytes */".concat(bytes.length));
103
- response.status(416).send('Range Not Satisfiable');
104
- return [2 /*return*/];
105
- }
106
- if (range) {
107
- response.setHeader('Content-Range', "bytes ".concat(range.start, "-").concat(range.end, "/").concat(bytes.length));
108
- response.status(206).send(bytes.subarray(range.start, range.end + 1));
109
- return [2 /*return*/];
110
- }
111
- response.send(bytes);
112
- return [3 /*break*/, 6];
113
- case 5:
114
- error_1 = _b.sent();
115
- console.error("Error fetching file (".concat(fileId, "):"), error_1);
116
- response.status(500).send('Internal Server Error');
117
- return [3 /*break*/, 6];
118
- case 6: return [2 /*return*/];
79
+ error_1 = _a.sent();
80
+ FileResponder_1.FileResponder.fail(fileId, error_1, response);
81
+ return [3 /*break*/, 5];
82
+ case 5: return [2 /*return*/];
119
83
  }
120
84
  });
121
85
  }); },
@@ -1 +1 @@
1
- {"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAgD;AAChD,wCAA2C;AAC3C,yCAA+C;AAE/C;;;;;;;;;;;;;;;GAeG;AACU,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAO,OAAO,EAAE,QAAQ;;;;;;oBACjC,IAAI,CAAC,eAAQ,CAAC,UAAU,EAAE,EAAE;wBAC1B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;wBAChD,sBAAO;qBACR;oBAEK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC3B,WAAW,GAAG,IAAA,4BAAc,GAAE,CAAC;;;;oBAGtB,qBAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;oBAAxC,IAAI,GAAG,SAAiC;oBAC9C,IAAI,CAAC,IAAI,EAAE;wBACT,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;wBAC5C,sBAAO;qBACR;oBAEiB,qBAAM,WAAW,CAAC,YAAY,CAAC,MAAM,CAAC,EAAA;;oBAAlD,SAAS,GAAG,SAAsC;oBACxD,IAAI,SAAS,EAAE;wBACb,QAAQ,CAAC,SAAS,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAAC;wBAC5D,QAAQ,CAAC,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;wBAClC,sBAAO;qBACR;oBAEsB,qBAAM,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,EAAA;;oBAAtD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C,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;;;;;SAEtD;CACF,CAAC"}
1
+ {"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8CAAgD;AAChD,wCAA2C;AAC3C,iDAAgD;AAEhD;;;;;;;GAOG;AACU,QAAA,OAAO,GAAU;IAC5B,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAO,OAAO,EAAE,QAAQ;;;;;oBACjC,IAAI,CAAC,eAAQ,CAAC,UAAU,EAAE,EAAE;wBAC1B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;wBAChD,sBAAO;qBACR;oBAEK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;;;;oBAGlB,qBAAM,IAAA,4BAAc,GAAE,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;oBAA7C,IAAI,GAAG,SAAsC;oBACnD,IAAI,CAAC,IAAI,EAAE;wBACT,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;wBAC5C,sBAAO;qBACR;oBACD,qBAAM,6BAAa,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAA;;oBAAlD,SAAkD,CAAC;;;;oBAEnD,6BAAa,CAAC,IAAI,CAAC,MAAM,EAAE,OAAK,EAAE,QAAQ,CAAC,CAAC;;;;;SAE/C;CACF,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Route } from '@proteinjs/server-api';
2
+ /**
3
+ * Serves a file's VARIANT of a kind (`preview`, `stage`) — the one URL a surface that draws a
4
+ * variant asks by (a plain `<img src>`, an off-DOM warm-up), whether or not the file has it yet:
5
+ *
6
+ * - the variant the row names is served as any File is ({@link FileResponder} — a 302 to ITS
7
+ * signed URL or the proxy, ITS headers; a non-owner is served ITS copy for others);
8
+ * - a file WITHOUT the variant derives it on this first request, once, through the registered
9
+ * `FileVariantMaker` (`FileStorage.getVariant` — a file stored before the kind existed, or by a
10
+ * producer that did not derive it; the row's word is decided in one transaction, so a second
11
+ * request never re-derives);
12
+ * - a file the maker does not apply to (a clip, a picture already small), or no maker at all, is
13
+ * served AS ITSELF — the consumer always gets a picture from this URL and never branches.
14
+ *
15
+ * Auth as `/file/:id`: logged-in, then the original's `getFile` read is the access decision (a
16
+ * variant is readable by whoever can read its original). A kind the library does not know is a
17
+ * 404, as a file that is not there.
18
+ */
19
+ export declare const getFileVariant: Route;
20
+ //# sourceMappingURL=getFileVariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFileVariant.d.ts","sourceRoot":"","sources":["../../../src/routes/getFileVariant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAM9C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,EAAE,KA6B5B,CAAC"}
@@ -0,0 +1,112 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.getFileVariant = void 0;
40
+ var user_1 = require("@proteinjs/user");
41
+ var FileStorage_1 = require("../FileStorage");
42
+ var FileVariantMaker_1 = require("../FileVariantMaker");
43
+ var FileResponder_1 = require("./FileResponder");
44
+ /**
45
+ * Serves a file's VARIANT of a kind (`preview`, `stage`) — the one URL a surface that draws a
46
+ * variant asks by (a plain `<img src>`, an off-DOM warm-up), whether or not the file has it yet:
47
+ *
48
+ * - the variant the row names is served as any File is ({@link FileResponder} — a 302 to ITS
49
+ * signed URL or the proxy, ITS headers; a non-owner is served ITS copy for others);
50
+ * - a file WITHOUT the variant derives it on this first request, once, through the registered
51
+ * `FileVariantMaker` (`FileStorage.getVariant` — a file stored before the kind existed, or by a
52
+ * producer that did not derive it; the row's word is decided in one transaction, so a second
53
+ * request never re-derives);
54
+ * - a file the maker does not apply to (a clip, a picture already small), or no maker at all, is
55
+ * served AS ITSELF — the consumer always gets a picture from this URL and never branches.
56
+ *
57
+ * Auth as `/file/:id`: logged-in, then the original's `getFile` read is the access decision (a
58
+ * variant is readable by whoever can read its original). A kind the library does not know is a
59
+ * 404, as a file that is not there.
60
+ */
61
+ exports.getFileVariant = {
62
+ path: '/file/:id/variant/:kind',
63
+ method: 'get',
64
+ onRequest: function (request, response) { return __awaiter(void 0, void 0, void 0, function () {
65
+ var fileId, kind, fileStorage, served, _a, error_1;
66
+ var _b;
67
+ return __generator(this, function (_c) {
68
+ switch (_c.label) {
69
+ case 0:
70
+ if (!user_1.UserAuth.isLoggedIn()) {
71
+ response.status(401).send('User not logged in');
72
+ return [2 /*return*/];
73
+ }
74
+ fileId = request.params.id;
75
+ kind = request.params.kind;
76
+ if (!FileVariantMaker_1.FILE_VARIANT_KINDS.includes(kind)) {
77
+ response.status(404).send('File not found');
78
+ return [2 /*return*/];
79
+ }
80
+ _c.label = 1;
81
+ case 1:
82
+ _c.trys.push([1, 7, , 8]);
83
+ fileStorage = new FileStorage_1.FileStorage();
84
+ return [4 /*yield*/, fileStorage.getVariant(fileId, kind)];
85
+ case 2:
86
+ if (!((_b = (_c.sent())) !== null && _b !== void 0)) return [3 /*break*/, 3];
87
+ _a = _b;
88
+ return [3 /*break*/, 5];
89
+ case 3: return [4 /*yield*/, fileStorage.getFile(fileId)];
90
+ case 4:
91
+ _a = (_c.sent());
92
+ _c.label = 5;
93
+ case 5:
94
+ served = _a;
95
+ if (!served) {
96
+ response.status(404).send('File not found');
97
+ return [2 /*return*/];
98
+ }
99
+ return [4 /*yield*/, FileResponder_1.FileResponder.serve(served, request, response)];
100
+ case 6:
101
+ _c.sent();
102
+ return [3 /*break*/, 8];
103
+ case 7:
104
+ error_1 = _c.sent();
105
+ FileResponder_1.FileResponder.fail(fileId, error_1, response);
106
+ return [3 /*break*/, 8];
107
+ case 8: return [2 /*return*/];
108
+ }
109
+ });
110
+ }); },
111
+ };
112
+ //# sourceMappingURL=getFileVariant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFileVariant.js","sourceRoot":"","sources":["../../../src/routes/getFileVariant.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,wCAA2C;AAC3C,8CAA6C;AAC7C,wDAA0E;AAC1E,iDAAgD;AAEhD;;;;;;;;;;;;;;;;GAgBG;AACU,QAAA,cAAc,GAAU;IACnC,IAAI,EAAE,yBAAyB;IAC/B,MAAM,EAAE,KAAK;IACb,SAAS,EAAE,UAAO,OAAO,EAAE,QAAQ;;;;;;oBACjC,IAAI,CAAC,eAAQ,CAAC,UAAU,EAAE,EAAE;wBAC1B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;wBAChD,sBAAO;qBACR;oBAEK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC3B,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,IAAuB,CAAC;oBACpD,IAAI,CAAC,qCAAkB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;wBACtC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;wBAC5C,sBAAO;qBACR;;;;oBAEO,WAAW,GAAG,IAAI,yBAAW,EAAE,CAAC;oBAGtB,qBAAM,WAAW,CAAC,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,EAAA;;gCAA3C,CAAC,SAA0C,CAAC;;;wBAAK,qBAAM,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,EAAA;;oBAAlC,KAAA,CAAC,SAAiC,CAAC,CAAA;;;oBAA5F,MAAM,KAAsF;oBAClG,IAAI,CAAC,MAAM,EAAE;wBACX,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;wBAC5C,sBAAO;qBACR;oBACD,qBAAM,6BAAa,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAA;;oBAApD,SAAoD,CAAC;;;;oBAErD,6BAAa,CAAC,IAAI,CAAC,MAAM,EAAE,OAAK,EAAE,QAAQ,CAAC,CAAC;;;;;SAE/C;CACF,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { FileVariantKind } from '../FileVariantMaker';
2
+ /** The URL a surface asks a file's variant of a kind by — served by `GET /file/:id/variant/:kind` (the variant, or the file itself when none applies). */
3
+ export declare const getFileVariantRoute: {
4
+ path: (fileId: string, kind: FileVariantKind) => string;
5
+ method: string;
6
+ };
7
+ //# sourceMappingURL=getFileVariantRoute.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFileVariantRoute.d.ts","sourceRoot":"","sources":["../../../src/routes/getFileVariantRoute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D,0JAA0J;AAC1J,eAAO,MAAM,mBAAmB;mBACf,MAAM,QAAQ,eAAe;;CAE7C,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFileVariantRoute = void 0;
4
+ /** The URL a surface asks a file's variant of a kind by — served by `GET /file/:id/variant/:kind` (the variant, or the file itself when none applies). */
5
+ exports.getFileVariantRoute = {
6
+ path: function (fileId, kind) { return "/file/".concat(fileId, "/variant/").concat(kind); },
7
+ method: 'get',
8
+ };
9
+ //# sourceMappingURL=getFileVariantRoute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getFileVariantRoute.js","sourceRoot":"","sources":["../../../src/routes/getFileVariantRoute.ts"],"names":[],"mappings":";;;AAEA,0JAA0J;AAC7I,QAAA,mBAAmB,GAAG;IACjC,IAAI,EAAE,UAAC,MAAc,EAAE,IAAqB,IAAK,OAAA,gBAAS,MAAM,sBAAY,IAAI,CAAE,EAAjC,CAAiC;IAClF,MAAM,EAAE,KAAK;CACd,CAAC"}
@@ -8,8 +8,43 @@ export interface File extends ScopedRecord {
8
8
  * Optional preview — another `File` (stored the same way, in GCS) used as a preview/thumbnail of
9
9
  * this file's content, e.g. a recording GIF's preview frame. A reference, not an inline blob, so
10
10
  * the bytes stay out of the DB row (consistent with the storage model); deleted with this file.
11
+ *
12
+ * A VARIANT — one of the derived Files of this file the {@link FileVariantMaker} seam makes
13
+ * (`preview`, `stage`): the same lifecycle for each — named here, made once (at ingest with the
14
+ * bytes in hand, or lazily on the first request through `FileStorage.getVariant`), dropped when
15
+ * this file's bytes change (`FileStorage.updateFileData`), deleted with this file (cascade),
16
+ * readable by whoever can read this file (`variantOf`), and carrying this file's provenance
17
+ * ({@link FileTable.provenanceColumns}) — a rendition's provenance is its original's.
11
18
  */
12
- preview?: Reference<File>;
19
+ preview?: Reference<File> | null;
20
+ /**
21
+ * The stage variant — a second derived `File` sized for the surface that shows the picture large
22
+ * but not full-screen (a 1600 px longest-edge rendition where the preview is a 512 px thumbnail):
23
+ * the same mechanism as `preview` in every respect (see there). Absent on files made before the
24
+ * seam or of a kind the maker does not apply to (a video, an animated picture); the first request
25
+ * derives it once. A viewer that wants every pixel keeps drawing the original.
26
+ */
27
+ stage?: Reference<File> | null;
28
+ /**
29
+ * For a variant (`preview`/`stage`) made by the seam: the File it was derived from. The
30
+ * variant's reachability is its original's — a reader who can read the original (their own
31
+ * scope, or a row the shared-content leg vouches for) can read the variant by its own id, even
32
+ * when no content row names the variant (a variant derived after the content was placed). Never
33
+ * set on a `copyForOthers` copy, whose own id is reachable by nobody but the owner. No cascade
34
+ * in either direction: the original's own reference (`preview`/`stage`) deletes the variant.
35
+ */
36
+ variantOf?: Reference<File> | null;
37
+ /**
38
+ * The copy of this file served to anyone who is not its owner — another `File` (the same
39
+ * store, the owner's scope), made ONCE by the registered {@link FileCopyForOthers} the first
40
+ * time a non-owner reads the bytes, named here so every later read serves it without remaking
41
+ * it. `null`/absent means no copy has been made yet: the next non-owner read makes one when the
42
+ * maker applies to this file, and serves the original when it does not. Dropped when the
43
+ * original's bytes change (`FileStorage.updateFileData`) and deleted with this file (cascade).
44
+ * The owner is never served it — their own scoped read serves the original. Carries this
45
+ * file's provenance ({@link FileTable.provenanceColumns}), as every derived File does.
46
+ */
47
+ copyForOthers?: Reference<File> | null;
13
48
  /**
14
49
  * Media metadata — generic file facts (an image/video's pixel dimensions, a video/audio
15
50
  * duration) every consumer needs to render without loading bytes, e.g. reserving a media box's
@@ -46,8 +81,36 @@ export interface File extends ScopedRecord {
46
81
  * an integrity fact. Absent for files written before the column existed.
47
82
  */
48
83
  contentHash?: string;
84
+ /**
85
+ * Producer attribution — HOW these bytes came to exist (e.g. a user upload, a browser
86
+ * capture, model generation, a rendered mockup). Same layer ruling as `width`/`height`:
87
+ * provenance is a generic file fact consumers need without a join — e.g. evidence surfaces
88
+ * that must refuse non-capture media as proof. Set by ingest paths that know their producer;
89
+ * absent for everything else. Values are the producing domain's vocabulary, not enumerated
90
+ * here.
91
+ */
92
+ origin?: string;
93
+ /**
94
+ * The id of the model that made the bytes, when a model did — `origin` names the KIND of
95
+ * producer, this names the one. Absent for every other producer. Read by a consumer that
96
+ * labels a made file with what made it, without a join.
97
+ */
98
+ originModel?: string;
49
99
  }
50
100
  export declare class FileTable extends Table<File> {
101
+ /**
102
+ * The columns that are a file's PROVENANCE — where its bytes came from and under what terms: the
103
+ * producer (`origin`, `originModel`), the web source (`sourceUrl`, `sourcePageUrl`,
104
+ * `retrievedAt`) and the rights record (`license`, `licenseUrl`, `attribution`). ONE list, the
105
+ * table's own: every derived File the library makes of a file — a variant (`preview`, `stage`)
106
+ * and the copy for others — carries these from the row it was made from (`FileStorage` writes
107
+ * them at insert), so a consumer reads a rendition's provenance off the row it draws, without a
108
+ * join, and a row with none derives rows with none. A column that describes THE ROW'S OWN bytes
109
+ * (`size`, `contentHash`, the media dimensions) is not provenance and is never copied — the
110
+ * maker answers those. A new provenance column is added HERE with its column; nothing else
111
+ * names the list.
112
+ */
113
+ static readonly provenanceColumns: ReadonlyArray<keyof File>;
51
114
  name: string;
52
115
  auth: Table<File>['auth'];
53
116
  columns: {
@@ -59,7 +122,10 @@ export declare class FileTable extends Table<File> {
59
122
  name: import("@proteinjs/db").Column<string, any>;
60
123
  type: import("@proteinjs/db").Column<string, any>;
61
124
  size: import("@proteinjs/db").Column<number, any>;
62
- preview: import("@proteinjs/db").Column<Reference<File> | undefined, any>;
125
+ preview: import("@proteinjs/db").Column<Reference<File> | null | undefined, any>;
126
+ stage: import("@proteinjs/db").Column<Reference<File> | null | undefined, any>;
127
+ variantOf: import("@proteinjs/db").Column<Reference<File> | null | undefined, any>;
128
+ copyForOthers: import("@proteinjs/db").Column<Reference<File> | null | undefined, any>;
63
129
  width: import("@proteinjs/db").Column<number | undefined, any>;
64
130
  height: import("@proteinjs/db").Column<number | undefined, any>;
65
131
  durationMs: import("@proteinjs/db").Column<number | undefined, any>;
@@ -70,6 +136,8 @@ export declare class FileTable extends Table<File> {
70
136
  licenseUrl: import("@proteinjs/db").Column<string | undefined, any>;
71
137
  attribution: import("@proteinjs/db").Column<string | undefined, any>;
72
138
  contentHash: import("@proteinjs/db").Column<string | undefined, any>;
139
+ origin: import("@proteinjs/db").Column<string | undefined, any>;
140
+ originModel: import("@proteinjs/db").Column<string | undefined, any>;
73
141
  } & {};
74
142
  indexes: {
75
143
  columns: (keyof File)[];
@@ -1 +1 @@
1
- {"version":3,"file":"FileTable.d.ts","sourceRoot":"","sources":["../../../src/tables/FileTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAgD,SAAS,EAAc,MAAM,eAAe,CA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IntegerColumn('size'),
39
39
  // Self-reference (the preview is itself a File). cascadeDelete: removing a file removes its preview.
40
40
  preview: new db_1.ReferenceColumn('preview', FILE_TABLE_NAME, true),
41
+ // Self-reference (the stage variant is itself a File). cascadeDelete: removing a file removes its stage variant.
42
+ stage: new db_1.ReferenceColumn('stage', FILE_TABLE_NAME, true),
43
+ // Self-reference (a variant names its original). No cascade: the original's own reference deletes the variant.
44
+ variantOf: new db_1.ReferenceColumn('variant_of', FILE_TABLE_NAME, false),
45
+ // Self-reference (the copy is itself a File). cascadeDelete: removing a file removes the copy others were served.
46
+ copyForOthers: new db_1.ReferenceColumn('copy_for_others', FILE_TABLE_NAME, true),
41
47
  width: new db_1.IntegerColumn('width'),
42
48
  height: new db_1.IntegerColumn('height'),
43
49
  durationMs: new db_1.IntegerColumn('duration_ms'),
@@ -51,6 +57,8 @@ var FileTable = /** @class */ (function (_super) {
51
57
  licenseUrl: new db_1.StringColumn('license_url', {}, 'MAX'),
52
58
  attribution: new db_1.StringColumn('attribution', {}, 'MAX'),
53
59
  contentHash: new db_1.StringColumn('content_hash', {}, 64),
60
+ origin: new db_1.StringColumn('origin', undefined, 50),
61
+ originModel: new db_1.StringColumn('origin_model', undefined, 200),
54
62
  });
55
63
  // Dedup lookup path: find the caller's existing copy of these bytes (content_hash is only
56
64
  // ever queried per-user — createScopedIndex prefixes the scope column).
@@ -59,6 +67,28 @@ var FileTable = /** @class */ (function (_super) {
59
67
  // No cascadeDeleteReferences for FileData: byte cleanup (FileData rows included) is owned by
60
68
  // FileStorageDriver.deleteFile, invoked for every file-row delete by FileStorageTableWatcher.
61
69
  }
70
+ /**
71
+ * The columns that are a file's PROVENANCE — where its bytes came from and under what terms: the
72
+ * producer (`origin`, `originModel`), the web source (`sourceUrl`, `sourcePageUrl`,
73
+ * `retrievedAt`) and the rights record (`license`, `licenseUrl`, `attribution`). ONE list, the
74
+ * table's own: every derived File the library makes of a file — a variant (`preview`, `stage`)
75
+ * and the copy for others — carries these from the row it was made from (`FileStorage` writes
76
+ * them at insert), so a consumer reads a rendition's provenance off the row it draws, without a
77
+ * join, and a row with none derives rows with none. A column that describes THE ROW'S OWN bytes
78
+ * (`size`, `contentHash`, the media dimensions) is not provenance and is never copied — the
79
+ * maker answers those. A new provenance column is added HERE with its column; nothing else
80
+ * names the list.
81
+ */
82
+ FileTable.provenanceColumns = [
83
+ 'origin',
84
+ 'originModel',
85
+ 'sourceUrl',
86
+ 'sourcePageUrl',
87
+ 'retrievedAt',
88
+ 'license',
89
+ 'licenseUrl',
90
+ 'attribution',
91
+ ];
62
92
  return FileTable;
63
93
  }(db_1.Table));
64
94
  exports.FileTable = FileTable;
@@ -1 +1 @@
1
- {"version":3,"file":"FileTable.js","sourceRoot":"","sources":["../../../src/tables/FileTable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAA2G;AAC3G,wCAA2F;AAE3F,IAAM,eAAe,GAAG,MAAM,CAAC;AAkD/B;IAA+B,6BAAW;IAA1C;QAAA,qEAmCC;QAlCQ,UAAI,GAAG,eAAe,CAAC;QACvB,UAAI,GAAwB;YACjC,EAAE,EAAE;gBACF,GAAG,EAAE,eAAe;aACrB;YACD,OAAO,EAAE;gBACP,GAAG,EAAE,eAAe;aACrB;SACF,CAAC;QACK,aAAO,GAAG,IAAA,8BAAuB,EAAO;YAC7C,IAAI,EAAE,IAAI,iBAAY,CAAC,MAAM,CAAC;YAC9B,IAAI,EAAE,IAAI,iBAAY,CAAC,MAAM,CAAC;YAC9B,IAAI,EAAE,IAAI,kBAAa,CAAC,MAAM,CAAC;YAC/B,qGAAqG;YACrG,OAAO,EAAE,IAAI,oBAAe,CAAO,SAAS,EAAE,eAAe,EAAE,IAAI,CAAC;YACpE,KAAK,EAAE,IAAI,kBAAa,CAAC,OAAO,CAAC;YACjC,MAAM,EAAE,IAAI,kBAAa,CAAC,QAAQ,CAAC;YACnC,UAAU,EAAE,IAAI,kBAAa,CAAC,aAAa,CAAC;YAC5C,yFAAyF;YAC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AAS,EAAE,EAAE,CAAC;YACjD,WAAW,EAAE,IAAI,iBAAY,CAAC,cAAc,EAAE,SAAS,EAAE,GAAG,CAAC;SAC9D,CAAC,CAAC;QACH,0FAA0F;QAC1F,wEAAwE;QACjE,aAAO,GAAG,CAAC,IAAA,wBAAiB,EAAO,EAAE,OAAO,EAAE,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC,CAAC;;QACxG,6FAA6F;QAC7F,8FAA8F;IAChG,CAAC;IAjEC;;;;;;;;;;;OAWG;IACa,2BAAiB,GAA8B;QAC7D,QAAQ;QACR,aAAa;QACb,WAAW;QACX,eAAe;QACf,aAAa;QACb,SAAS;QACT,YAAY;QACZ,aAAa;KACd,AATgC,CAS/B;IA4CJ,gBAAC;CAAA,AAlED,CAA+B,UAAK,GAkEnC;AAlEY,8BAAS"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DbFileStorageDriverMissingBytes.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DbFileStorageDriverMissingBytes.test.d.ts","sourceRoot":"","sources":["../../test/DbFileStorageDriverMissingBytes.test.ts"],"names":[],"mappings":""}