@proteinjs/db-file 1.10.0 → 1.10.2
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/CHANGELOG.md +19 -0
- package/dist/generated/index.js +1 -1
- package/dist/generated/index.js.map +1 -1
- package/dist/src/FileStorage.d.ts +19 -14
- package/dist/src/FileStorage.d.ts.map +1 -1
- package/dist/src/FileStorage.js +25 -20
- package/dist/src/FileStorage.js.map +1 -1
- package/dist/src/FileVariantMaker.d.ts +4 -2
- package/dist/src/FileVariantMaker.d.ts.map +1 -1
- package/dist/src/FileVariantMaker.js.map +1 -1
- package/dist/src/tables/FileTable.d.ts +23 -3
- package/dist/src/tables/FileTable.d.ts.map +1 -1
- package/dist/src/tables/FileTable.js +15 -0
- package/dist/src/tables/FileTable.js.map +1 -1
- package/dist/test/FileDerivedTransparent.test.d.ts +2 -0
- package/dist/test/FileDerivedTransparent.test.d.ts.map +1 -0
- package/dist/test/FileDerivedTransparent.test.js +378 -0
- package/dist/test/FileDerivedTransparent.test.js.map +1 -0
- package/generated/index.ts +1 -1
- package/package.json +4 -4
- package/src/FileStorage.ts +25 -20
- package/src/FileVariantMaker.ts +4 -2
- package/src/tables/FileTable.ts +24 -3
- package/test/FileDerivedTransparent.test.ts +205 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileVariantMaker.d.ts","sourceRoot":"","sources":["../../src/FileVariantMaker.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,CAAC;AAElD,eAAO,MAAM,kBAAkB,EAAE,SAAS,eAAe,EAAyB,CAAC;AAEnF
|
|
1
|
+
{"version":3,"file":"FileVariantMaker.d.ts","sourceRoot":"","sources":["../../src/FileVariantMaker.ts"],"names":[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I,kBAAkB;IAItD,OAAO,CAAC,MAAM,CAAC,KAAK;CAOrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileVariantMaker.js","sourceRoot":"","sources":["../../src/FileVariantMaker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oDAAmE;AAUtD,QAAA,kBAAkB,GAA+B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"FileVariantMaker.js","sourceRoot":"","sources":["../../src/FileVariantMaker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oDAAmE;AAUtD,QAAA,kBAAkB,GAA+B,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAwC5E,IAAM,mBAAmB,GAAG;IACjC,OAAA,6BAAgB,CAAC,GAAG,EAAE,CAAC,MAAM,CAAmB,qCAAqC,CAAC;AAAtF,CAAsF,CAAC;AAD5E,QAAA,mBAAmB,uBACyD;AAEzF;;;;;;;GAOG;AACH;IAAwC,sCAAK;IAQ3C,4BAAY,MAAc,EAAE,IAAqB,EAAE,KAAc;QAAjE,iBAQC;QAPC,IAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC/C,kBAAM,aAAM,IAAI,4CAAkC,MAAM,SAAG,MAAM,CAAC,CAAC,CAAC,YAAK,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,CAAE,CAAC;QACzF,KAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC,IAAI,CAAC;QACpC,MAAM,CAAC,cAAc,CAAC,KAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAC1D,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;IACvB,CAAC;IAEM,qBAAE,GAAT,UAAU,KAAc;QACtB,OAAO,CAAC,KAA+C,aAA/C,KAAK,uBAAL,KAAK,CAA4C,IAAI,MAAK,kBAAkB,CAAC,IAAI,CAAC;IAC5F,CAAC;IAEc,wBAAK,GAApB,UAAqB,KAAc;QACjC,IAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAChG,IAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,gBAAgB;YACtD,CAAC,CAAC,UAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,kBAAkB,CAAC,gBAAgB,CAAC,WAAG;YAC1D,CAAC,CAAC,IAAI,CAAC;IACX,CAAC;IA3BuB,uBAAI,GAAG,oBAAoB,CAAC;IACpD,gEAAgE;IACxC,mCAAgB,GAAG,GAAG,CAAC;IA0BjD,yBAAC;CAAA,AA7BD,CAAwC,KAAK,GA6B5C;AA7BY,gDAAkB"}
|
|
@@ -14,7 +14,9 @@ export interface File extends ScopedRecord {
|
|
|
14
14
|
* bytes in hand, or lazily on the first request through `FileStorage.getVariant`), dropped when
|
|
15
15
|
* this file's bytes change (`FileStorage.updateFileData`), deleted with this file (cascade),
|
|
16
16
|
* readable by whoever can read this file (`variantOf`), and carrying this file's provenance
|
|
17
|
-
* ({@link FileTable.provenanceColumns})
|
|
17
|
+
* ({@link FileTable.provenanceColumns}) and what its pixels are ({@link FileTable.renditionColumns})
|
|
18
|
+
* — a rendition's provenance is its original's, and a rendition of a see-through picture is
|
|
19
|
+
* see-through.
|
|
18
20
|
*/
|
|
19
21
|
preview?: Reference<File> | null;
|
|
20
22
|
/**
|
|
@@ -42,7 +44,8 @@ export interface File extends ScopedRecord {
|
|
|
42
44
|
* maker applies to this file, and serves the original when it does not. Dropped when the
|
|
43
45
|
* original's bytes change (`FileStorage.updateFileData`) and deleted with this file (cascade).
|
|
44
46
|
* The owner is never served it — their own scoped read serves the original. Carries this
|
|
45
|
-
* file's provenance ({@link FileTable.provenanceColumns})
|
|
47
|
+
* file's provenance ({@link FileTable.provenanceColumns}) and what its pixels are
|
|
48
|
+
* ({@link FileTable.renditionColumns}), as every derived File does.
|
|
46
49
|
*/
|
|
47
50
|
copyForOthers?: Reference<File> | null;
|
|
48
51
|
/**
|
|
@@ -60,7 +63,9 @@ export interface File extends ScopedRecord {
|
|
|
60
63
|
* mark made on a transparent background is true; a photograph, a JPEG, an opaque PNG false.
|
|
61
64
|
* A viewer reads it to seat the picture on the surface its thumbnail sat on instead of a black
|
|
62
65
|
* stage (a see-through mark on black is not the mark the person saw). Absent for video, for
|
|
63
|
-
* non-media files and for pictures stored before the column existed — read as opaque.
|
|
66
|
+
* non-media files and for pictures stored before the column existed — read as opaque. Every
|
|
67
|
+
* rendition of the picture — a variant, the copy for others — carries it from the picture
|
|
68
|
+
* ({@link FileTable.renditionColumns}): a thumbnail of a see-through mark is see-through.
|
|
64
69
|
*/
|
|
65
70
|
transparent?: boolean;
|
|
66
71
|
/**
|
|
@@ -120,6 +125,21 @@ export declare class FileTable extends Table<File> {
|
|
|
120
125
|
* names the list.
|
|
121
126
|
*/
|
|
122
127
|
static readonly provenanceColumns: ReadonlyArray<keyof File>;
|
|
128
|
+
/**
|
|
129
|
+
* The columns that are a fact of the PICTURE every rendition of it shares — whether its pixels
|
|
130
|
+
* are see-through (`transparent`). A derived File is a rendition of the picture's pixels: the
|
|
131
|
+
* maker resizes a variant (`preview`, `stage`) and never flattens it, and the copy for others is
|
|
132
|
+
* the same pixels with the metadata off — so a thumbnail of a mark made on a transparent
|
|
133
|
+
* background is see-through and a photograph's is opaque, exactly as the picture is. ONE list,
|
|
134
|
+
* the table's own, beside {@link provenanceColumns}: `FileStorage` writes these on every derived
|
|
135
|
+
* File from the row it was made from, with the provenance, so a consumer seats a rendition on
|
|
136
|
+
* the surface its picture sat on by reading the row it draws, without a join; a row with no
|
|
137
|
+
* answer derives rows with none. What is the RENDITION'S OWN (its type, its size, its
|
|
138
|
+
* dimensions, its hash) is the maker's answer and is never copied. A column read off the
|
|
139
|
+
* picture's bytes that every rendition keeps is added HERE with its column; nothing else names
|
|
140
|
+
* the list.
|
|
141
|
+
*/
|
|
142
|
+
static readonly renditionColumns: ReadonlyArray<keyof File>;
|
|
123
143
|
name: string;
|
|
124
144
|
auth: Table<File>['auth'];
|
|
125
145
|
columns: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileTable.d.ts","sourceRoot":"","sources":["../../../src/tables/FileTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAKL,SAAS,EAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAA8C,MAAM,iBAAiB,CAAC;AAI3F,MAAM,WAAW,IAAK,SAAQ,YAAY;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb
|
|
1
|
+
{"version":3,"file":"FileTable.d.ts","sourceRoot":"","sources":["../../../src/tables/FileTable.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EAKL,SAAS,EAEV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,YAAY,EAA8C,MAAM,iBAAiB,CAAC;AAI3F,MAAM,WAAW,IAAK,SAAQ,YAAY;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACjC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC/B;;;;;;;OAOG;IACH,SAAS,CAA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
|
|
91
91
|
'attribution',
|
|
92
92
|
];
|
|
93
|
+
/**
|
|
94
|
+
* The columns that are a fact of the PICTURE every rendition of it shares — whether its pixels
|
|
95
|
+
* are see-through (`transparent`). A derived File is a rendition of the picture's pixels: the
|
|
96
|
+
* maker resizes a variant (`preview`, `stage`) and never flattens it, and the copy for others is
|
|
97
|
+
* the same pixels with the metadata off — so a thumbnail of a mark made on a transparent
|
|
98
|
+
* background is see-through and a photograph's is opaque, exactly as the picture is. ONE list,
|
|
99
|
+
* the table's own, beside {@link provenanceColumns}: `FileStorage` writes these on every derived
|
|
100
|
+
* File from the row it was made from, with the provenance, so a consumer seats a rendition on
|
|
101
|
+
* the surface its picture sat on by reading the row it draws, without a join; a row with no
|
|
102
|
+
* answer derives rows with none. What is the RENDITION'S OWN (its type, its size, its
|
|
103
|
+
* dimensions, its hash) is the maker's answer and is never copied. A column read off the
|
|
104
|
+
* picture's bytes that every rendition keeps is added HERE with its column; nothing else names
|
|
105
|
+
* the list.
|
|
106
|
+
*/
|
|
107
|
+
FileTable.renditionColumns = ['transparent'];
|
|
93
108
|
return FileTable;
|
|
94
109
|
}(db_1.Table));
|
|
95
110
|
exports.FileTable = FileTable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileTable.js","sourceRoot":"","sources":["../../../src/tables/FileTable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAQuB;AACvB,wCAA2F;AAE3F,IAAM,eAAe,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"FileTable.js","sourceRoot":"","sources":["../../../src/tables/FileTable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oCAQuB;AACvB,wCAA2F;AAE3F,IAAM,eAAe,GAAG,MAAM,CAAC;AAkH/B;IAA+B,6BAAW;IAA1C;QAAA,qEAmFC;QA3CQ,UAAI,GAAG,eAAe,CAAC;QACvB,UAAI,GAAwB;YACjC,EAAE,EAAE;gBACF,GAAG,EAAE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,iBAAY,CAAC,aAAa,EAAE,EAAE,EAAE,KAAK,CAAC;YACvD,WAAW,EAAE,IAAI,iBAAY,CAAC,cAAc,EAAE,EAAE,EAAE,EAAE,CAAC;YACrD,MAAM,EAAE,IAAI,iBAAY,CAAC,QAAQ,EAAE,SAAS,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;IAlFC;;;;;;;;;;;OAWG;IACa,2BAAiB,GAA8B;QAC7D,QAAQ;QACR,aAAa;QACb,WAAW;QACX,eAAe;QACf,aAAa;QACb,SAAS;QACT,YAAY;QACZ,aAAa;KACd,AATgC,CAS/B;IAEF;;;;;;;;;;;;;OAaG;IACa,0BAAgB,GAA8B,CAAC,aAAa,CAAC,AAA7C,CAA8C;IA6ChF,gBAAC;CAAA,AAnFD,CAA+B,UAAK,GAmFnC;AAnFY,8BAAS"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileDerivedTransparent.test.d.ts","sourceRoot":"","sources":["../../test/FileDerivedTransparent.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
var db_1 = require("@proteinjs/db");
|
|
51
|
+
var reflection_1 = require("@proteinjs/reflection");
|
|
52
|
+
var user_1 = require("@proteinjs/user");
|
|
53
|
+
var tables_1 = require("../src/tables/tables");
|
|
54
|
+
var FileStorage_1 = require("../src/FileStorage");
|
|
55
|
+
var FileTestEnvironment_1 = require("./FileTestEnvironment");
|
|
56
|
+
/**
|
|
57
|
+
* A derived File of a picture — a variant the seam makes (the preview at ingest, the stage on the
|
|
58
|
+
* read path's first request) and the copy for others — is a RENDITION of the picture's pixels, so
|
|
59
|
+
* it carries what the picture's pixels are: whether they are see-through (`transparent`). A
|
|
60
|
+
* thumbnail of a mark made on a transparent background is see-through (the maker resizes, it does
|
|
61
|
+
* not flatten); a photograph's thumbnail is opaque, as the photograph is; a picture nothing probed
|
|
62
|
+
* derives renditions with no answer — nothing is invented. The library that makes the row writes
|
|
63
|
+
* it, beside the provenance it carries the same way (`FileTable.renditionColumns` beside
|
|
64
|
+
* `FileTable.provenanceColumns`), so a consumer seats a rendition on the surface its picture sat
|
|
65
|
+
* on by reading the row it draws, without a join to the original. The maker's own answer (the
|
|
66
|
+
* bytes, their type, their dimensions) stays the rendition's own.
|
|
67
|
+
*/
|
|
68
|
+
var originalBytes = Buffer.concat([Buffer.from('ORIGINAL:'), Buffer.from(Array.from({ length: 64 }, function (_, i) { return i; }))]);
|
|
69
|
+
/** What the copy-for-others maker takes off a copy (the location marker of the real one). */
|
|
70
|
+
var COPY_MARK = Buffer.from('-FOR-OTHERS');
|
|
71
|
+
/** In-memory proxy-shape driver (no signed URLs) — the DbFileStorageDriver serving shape. */
|
|
72
|
+
var ProxyDriver = /** @class */ (function () {
|
|
73
|
+
function ProxyDriver() {
|
|
74
|
+
this.store = new Map();
|
|
75
|
+
}
|
|
76
|
+
ProxyDriver.prototype.createFile = function (file, fileData) {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
78
|
+
return __generator(this, function (_a) {
|
|
79
|
+
this.store.set(file.id, Buffer.from(fileData, 'base64'));
|
|
80
|
+
return [2 /*return*/];
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
ProxyDriver.prototype.getFileData = function (fileId) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
+
var data;
|
|
87
|
+
return __generator(this, function (_a) {
|
|
88
|
+
data = this.store.get(fileId);
|
|
89
|
+
if (data === undefined) {
|
|
90
|
+
throw new Error("No such object: ".concat(fileId));
|
|
91
|
+
}
|
|
92
|
+
return [2 /*return*/, data.toString('base64')];
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
ProxyDriver.prototype.updateFileData = function (fileId, data) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
this.store.set(fileId, Buffer.from(data, 'base64'));
|
|
100
|
+
return [2 /*return*/];
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
ProxyDriver.prototype.deleteFile = function (fileId) {
|
|
105
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
106
|
+
return __generator(this, function (_a) {
|
|
107
|
+
this.store.delete(fileId);
|
|
108
|
+
return [2 /*return*/];
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
return ProxyDriver;
|
|
113
|
+
}());
|
|
114
|
+
var testEnv = new FileTestEnvironment_1.FileTestEnvironment();
|
|
115
|
+
var objectCache = function () { return reflection_1.SourceRepository.get().objectCache; };
|
|
116
|
+
var owner;
|
|
117
|
+
var recipient;
|
|
118
|
+
var reachableFileIds = new Set();
|
|
119
|
+
/** The stub variant maker: a picture's `preview` and `stage` — bytes marked with the kind, a type, dimensions; it answers nothing about the pixels' alpha. */
|
|
120
|
+
var registerVariantMaker = function () {
|
|
121
|
+
objectCache()['@proteinjs/db-file/FileVariantMaker'] = [
|
|
122
|
+
{
|
|
123
|
+
appliesTo: function (file) { return file.type.startsWith('image/'); },
|
|
124
|
+
make: function (file, bytes, kind) { return __awaiter(void 0, void 0, void 0, function () {
|
|
125
|
+
return __generator(this, function (_a) {
|
|
126
|
+
return [2 /*return*/, ({
|
|
127
|
+
bytes: Buffer.concat([Buffer.from("".concat(kind.toUpperCase(), ":")), bytes.subarray(0, 8), COPY_MARK]),
|
|
128
|
+
type: 'image/webp',
|
|
129
|
+
width: kind === 'stage' ? 1600 : 512,
|
|
130
|
+
height: kind === 'stage' ? 800 : 256,
|
|
131
|
+
})];
|
|
132
|
+
});
|
|
133
|
+
}); },
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
};
|
|
137
|
+
/** The stub copy maker: a picture's copy is its bytes with the mark taken off. */
|
|
138
|
+
var registerCopyMaker = function () {
|
|
139
|
+
objectCache()['@proteinjs/db-file/FileCopyForOthers'] = [
|
|
140
|
+
{
|
|
141
|
+
appliesTo: function (file) { return file.type.startsWith('image/'); },
|
|
142
|
+
make: function (file, bytes) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
143
|
+
return [2 /*return*/, bytes.subarray(0, bytes.length - COPY_MARK.length)];
|
|
144
|
+
}); }); },
|
|
145
|
+
},
|
|
146
|
+
];
|
|
147
|
+
};
|
|
148
|
+
beforeAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
149
|
+
return __generator(this, function (_a) {
|
|
150
|
+
switch (_a.label) {
|
|
151
|
+
case 0: return [4 /*yield*/, testEnv.beforeAll()];
|
|
152
|
+
case 1:
|
|
153
|
+
_a.sent();
|
|
154
|
+
objectCache()['@proteinjs/user-auth/AuthenticatedUserRepo'] = [new user_1.UserRepo()];
|
|
155
|
+
user_1.UserAuth.userRepo = undefined;
|
|
156
|
+
objectCache()['@proteinjs/db-file/FileReachabilityResolver'] = [
|
|
157
|
+
// The content leg vouches for the recipient alone (a share they accepted).
|
|
158
|
+
{
|
|
159
|
+
canReadViaReference: function (fileId) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
160
|
+
return [2 /*return*/, reachableFileIds.has(fileId) && new user_1.UserRepo().getUser().id === recipient.id];
|
|
161
|
+
}); }); },
|
|
162
|
+
},
|
|
163
|
+
];
|
|
164
|
+
return [4 /*yield*/, testEnv.createUser({ name: 'File owner', email: 'transparent-owner@test.local' })];
|
|
165
|
+
case 2:
|
|
166
|
+
owner = _a.sent();
|
|
167
|
+
return [4 /*yield*/, testEnv.createUser({ name: 'Share recipient', email: 'transparent-recipient@test.local' })];
|
|
168
|
+
case 3:
|
|
169
|
+
recipient = _a.sent();
|
|
170
|
+
testEnv.actAs(owner);
|
|
171
|
+
return [2 /*return*/];
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}); });
|
|
175
|
+
afterAll(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
176
|
+
return __generator(this, function (_a) {
|
|
177
|
+
switch (_a.label) {
|
|
178
|
+
case 0:
|
|
179
|
+
delete objectCache()['@proteinjs/db-file/FileReachabilityResolver'];
|
|
180
|
+
delete objectCache()['@proteinjs/db-file/FileVariantMaker'];
|
|
181
|
+
delete objectCache()['@proteinjs/db-file/FileCopyForOthers'];
|
|
182
|
+
user_1.UserAuth.userRepo = undefined;
|
|
183
|
+
return [4 /*yield*/, testEnv.afterAll()];
|
|
184
|
+
case 1:
|
|
185
|
+
_a.sent();
|
|
186
|
+
return [2 /*return*/];
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
}); });
|
|
190
|
+
var driver = new ProxyDriver();
|
|
191
|
+
beforeEach(function () {
|
|
192
|
+
reachableFileIds.clear();
|
|
193
|
+
registerVariantMaker();
|
|
194
|
+
registerCopyMaker();
|
|
195
|
+
testEnv.setDriver(driver);
|
|
196
|
+
testEnv.actAs(owner);
|
|
197
|
+
});
|
|
198
|
+
var pictureBytes = Buffer.concat([originalBytes, COPY_MARK]);
|
|
199
|
+
/** A picture of the owner's — with the answer ingest read off its pixels, or without one — stored with no variant. */
|
|
200
|
+
var createOwnerPicture = function (name, pixels) {
|
|
201
|
+
if (pixels === void 0) { pixels = {}; }
|
|
202
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
203
|
+
return __generator(this, function (_a) {
|
|
204
|
+
switch (_a.label) {
|
|
205
|
+
case 0: return [4 /*yield*/, new FileStorage_1.FileStorage().createFile(__assign({ name: name, type: 'image/png', size: pictureBytes.length, width: 1024, height: 1024 }, pixels), pictureBytes.toString('base64'))];
|
|
206
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
var rowAsSystem = function (fileId) { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
212
|
+
switch (_a.label) {
|
|
213
|
+
case 0: return [4 /*yield*/, (0, db_1.getDbAsSystem)().get(tables_1.tables.File, { id: fileId })];
|
|
214
|
+
case 1: return [2 /*return*/, (_a.sent())];
|
|
215
|
+
}
|
|
216
|
+
}); }); };
|
|
217
|
+
/** The answer a row carries — `null` for a row that carries none. */
|
|
218
|
+
var transparentOf = function (row) { var _a; return (_a = row.transparent) !== null && _a !== void 0 ? _a : null; };
|
|
219
|
+
/** The copy for others of a file, made by a recipient's read of its bytes. */
|
|
220
|
+
var copyForOthersOf = function (file) { return __awaiter(void 0, void 0, void 0, function () {
|
|
221
|
+
var copyId;
|
|
222
|
+
var _a;
|
|
223
|
+
return __generator(this, function (_b) {
|
|
224
|
+
switch (_b.label) {
|
|
225
|
+
case 0:
|
|
226
|
+
reachableFileIds.add(file.id);
|
|
227
|
+
testEnv.actAs(recipient);
|
|
228
|
+
return [4 /*yield*/, new FileStorage_1.FileStorage().getFileData(file.id)];
|
|
229
|
+
case 1:
|
|
230
|
+
_b.sent();
|
|
231
|
+
testEnv.actAs(owner);
|
|
232
|
+
return [4 /*yield*/, rowAsSystem(file.id)];
|
|
233
|
+
case 2:
|
|
234
|
+
copyId = (_a = (_b.sent()).copyForOthers) === null || _a === void 0 ? void 0 : _a._id;
|
|
235
|
+
expect(copyId).toBeTruthy();
|
|
236
|
+
return [4 /*yield*/, rowAsSystem(copyId)];
|
|
237
|
+
case 3: return [2 /*return*/, _b.sent()];
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
}); };
|
|
241
|
+
describe('a rendition of a picture carries whether its pixels are see-through', function () {
|
|
242
|
+
it('the ingest door: the preview and the stage deriveVariants makes of a see-through mark read `transparent` true off their own rows; the maker’s own answer stays its own', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
243
|
+
var mark, variants, _i, _a, kind, variant;
|
|
244
|
+
return __generator(this, function (_b) {
|
|
245
|
+
switch (_b.label) {
|
|
246
|
+
case 0: return [4 /*yield*/, createOwnerPicture('mark.png', { transparent: true })];
|
|
247
|
+
case 1:
|
|
248
|
+
mark = _b.sent();
|
|
249
|
+
return [4 /*yield*/, new FileStorage_1.FileStorage().deriveVariants(mark, pictureBytes)];
|
|
250
|
+
case 2:
|
|
251
|
+
variants = (_b.sent()).variants;
|
|
252
|
+
expect(Object.keys(variants).sort()).toEqual(['preview', 'stage']);
|
|
253
|
+
_i = 0, _a = ['preview', 'stage'];
|
|
254
|
+
_b.label = 3;
|
|
255
|
+
case 3:
|
|
256
|
+
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
257
|
+
kind = _a[_i];
|
|
258
|
+
return [4 /*yield*/, rowAsSystem(variants[kind].id)];
|
|
259
|
+
case 4:
|
|
260
|
+
variant = _b.sent();
|
|
261
|
+
expect(transparentOf(variant)).toBe(true);
|
|
262
|
+
expect([variant.type, variant.width, variant.height]).toEqual([
|
|
263
|
+
'image/webp',
|
|
264
|
+
kind === 'stage' ? 1600 : 512,
|
|
265
|
+
kind === 'stage' ? 800 : 256,
|
|
266
|
+
]);
|
|
267
|
+
_b.label = 5;
|
|
268
|
+
case 5:
|
|
269
|
+
_i++;
|
|
270
|
+
return [3 /*break*/, 3];
|
|
271
|
+
case 6: return [2 /*return*/];
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
}); });
|
|
275
|
+
it('the read path’s door: the stage getVariant derives on the first request reads true', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
276
|
+
var mark, _a, stage, _b, _c;
|
|
277
|
+
var _d, _e, _f;
|
|
278
|
+
return __generator(this, function (_g) {
|
|
279
|
+
switch (_g.label) {
|
|
280
|
+
case 0: return [4 /*yield*/, createOwnerPicture('existing-mark.png', { transparent: true })];
|
|
281
|
+
case 1:
|
|
282
|
+
mark = _g.sent();
|
|
283
|
+
_a = expect;
|
|
284
|
+
return [4 /*yield*/, rowAsSystem(mark.id)];
|
|
285
|
+
case 2:
|
|
286
|
+
_a.apply(void 0, [(_e = (_d = (_g.sent()).stage) === null || _d === void 0 ? void 0 : _d._id) !== null && _e !== void 0 ? _e : null]).toBeNull();
|
|
287
|
+
return [4 /*yield*/, new FileStorage_1.FileStorage().getVariant(mark.id, 'stage')];
|
|
288
|
+
case 3:
|
|
289
|
+
stage = (_g.sent());
|
|
290
|
+
expect((_f = stage.variantOf) === null || _f === void 0 ? void 0 : _f._id).toEqual(mark.id);
|
|
291
|
+
_b = expect;
|
|
292
|
+
_c = transparentOf;
|
|
293
|
+
return [4 /*yield*/, rowAsSystem(stage.id)];
|
|
294
|
+
case 4:
|
|
295
|
+
_b.apply(void 0, [_c.apply(void 0, [_g.sent()])]).toBe(true);
|
|
296
|
+
return [2 /*return*/];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
}); });
|
|
300
|
+
it('the copy for others reads true — the same pixels, the metadata off', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
301
|
+
var mark, copy;
|
|
302
|
+
return __generator(this, function (_a) {
|
|
303
|
+
switch (_a.label) {
|
|
304
|
+
case 0: return [4 /*yield*/, createOwnerPicture('shared-mark.png', { transparent: true })];
|
|
305
|
+
case 1:
|
|
306
|
+
mark = _a.sent();
|
|
307
|
+
return [4 /*yield*/, copyForOthersOf(mark)];
|
|
308
|
+
case 2:
|
|
309
|
+
copy = _a.sent();
|
|
310
|
+
expect(copy.scope).toEqual(owner.id);
|
|
311
|
+
expect(transparentOf(copy)).toBe(true);
|
|
312
|
+
return [2 /*return*/];
|
|
313
|
+
}
|
|
314
|
+
});
|
|
315
|
+
}); });
|
|
316
|
+
it('an opaque picture’s renditions read false — the answer travels as it is, never dropped to unset', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
317
|
+
var photo, variants, copy, _a, _b, _c, _d;
|
|
318
|
+
return __generator(this, function (_e) {
|
|
319
|
+
switch (_e.label) {
|
|
320
|
+
case 0: return [4 /*yield*/, createOwnerPicture('photo.png', { transparent: false })];
|
|
321
|
+
case 1:
|
|
322
|
+
photo = _e.sent();
|
|
323
|
+
return [4 /*yield*/, new FileStorage_1.FileStorage().deriveVariants(photo, pictureBytes)];
|
|
324
|
+
case 2:
|
|
325
|
+
variants = (_e.sent()).variants;
|
|
326
|
+
return [4 /*yield*/, copyForOthersOf(photo)];
|
|
327
|
+
case 3:
|
|
328
|
+
copy = _e.sent();
|
|
329
|
+
_a = expect;
|
|
330
|
+
_b = transparentOf;
|
|
331
|
+
return [4 /*yield*/, rowAsSystem(variants.preview.id)];
|
|
332
|
+
case 4:
|
|
333
|
+
_a.apply(void 0, [_b.apply(void 0, [_e.sent()])]).toBe(false);
|
|
334
|
+
_c = expect;
|
|
335
|
+
_d = transparentOf;
|
|
336
|
+
return [4 /*yield*/, rowAsSystem(variants.stage.id)];
|
|
337
|
+
case 5:
|
|
338
|
+
_c.apply(void 0, [_d.apply(void 0, [_e.sent()])]).toBe(false);
|
|
339
|
+
expect(transparentOf(copy)).toBe(false);
|
|
340
|
+
return [2 /*return*/];
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
}); });
|
|
344
|
+
it('a picture nothing probed derives renditions with no answer — nothing is invented, at any door', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
345
|
+
var unprobed, _a, _b, variants, copy, _c, _d, _e, _f;
|
|
346
|
+
return __generator(this, function (_g) {
|
|
347
|
+
switch (_g.label) {
|
|
348
|
+
case 0: return [4 /*yield*/, createOwnerPicture('unprobed.png')];
|
|
349
|
+
case 1:
|
|
350
|
+
unprobed = _g.sent();
|
|
351
|
+
_a = expect;
|
|
352
|
+
_b = transparentOf;
|
|
353
|
+
return [4 /*yield*/, rowAsSystem(unprobed.id)];
|
|
354
|
+
case 2:
|
|
355
|
+
_a.apply(void 0, [_b.apply(void 0, [_g.sent()])]).toBeNull();
|
|
356
|
+
return [4 /*yield*/, new FileStorage_1.FileStorage().deriveVariants(unprobed, pictureBytes)];
|
|
357
|
+
case 3:
|
|
358
|
+
variants = (_g.sent()).variants;
|
|
359
|
+
return [4 /*yield*/, copyForOthersOf(unprobed)];
|
|
360
|
+
case 4:
|
|
361
|
+
copy = _g.sent();
|
|
362
|
+
_c = expect;
|
|
363
|
+
_d = transparentOf;
|
|
364
|
+
return [4 /*yield*/, rowAsSystem(variants.preview.id)];
|
|
365
|
+
case 5:
|
|
366
|
+
_c.apply(void 0, [_d.apply(void 0, [_g.sent()])]).toBeNull();
|
|
367
|
+
_e = expect;
|
|
368
|
+
_f = transparentOf;
|
|
369
|
+
return [4 /*yield*/, rowAsSystem(variants.stage.id)];
|
|
370
|
+
case 6:
|
|
371
|
+
_e.apply(void 0, [_f.apply(void 0, [_g.sent()])]).toBeNull();
|
|
372
|
+
expect(transparentOf(copy)).toBeNull();
|
|
373
|
+
return [2 /*return*/];
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
}); });
|
|
377
|
+
});
|
|
378
|
+
//# sourceMappingURL=FileDerivedTransparent.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileDerivedTransparent.test.js","sourceRoot":"","sources":["../../test/FileDerivedTransparent.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCAA8C;AAC9C,oDAAyD;AACzD,wCAA2D;AAE3D,+CAA8C;AAC9C,kDAAiD;AAGjD,6DAA4D;AAE5D;;;;;;;;;;;GAWG;AAEH,IAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,UAAC,CAAC,EAAE,CAAC,IAAK,OAAA,CAAC,EAAD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACtH,6FAA6F;AAC7F,IAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAE7C,6FAA6F;AAC7F;IAAA;QACW,UAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IAqB7C,CAAC;IAnBO,gCAAU,GAAhB,UAAiB,IAAU,EAAE,QAAgB;;;gBAC3C,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;;;;KAC1D;IAEK,iCAAW,GAAjB,UAAkB,MAAc;;;;gB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