@proteinjs/db-file 1.7.2 → 1.7.4
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/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/src/FileReachabilityResolver.d.ts +27 -0
- package/dist/src/FileReachabilityResolver.d.ts.map +1 -0
- package/dist/src/FileReachabilityResolver.js +9 -0
- package/dist/src/FileReachabilityResolver.js.map +1 -0
- package/dist/src/FileStorage.d.ts +11 -3
- package/dist/src/FileStorage.d.ts.map +1 -1
- package/dist/src/FileStorage.js +36 -8
- package/dist/src/FileStorage.js.map +1 -1
- package/dist/src/routes/getFile.d.ts +4 -1
- package/dist/src/routes/getFile.d.ts.map +1 -1
- package/dist/src/routes/getFile.js +4 -1
- package/dist/src/routes/getFile.js.map +1 -1
- package/dist/test/FileSharedReachability.test.d.ts +2 -0
- package/dist/test/FileSharedReachability.test.d.ts.map +1 -0
- package/dist/test/FileSharedReachability.test.js +358 -0
- package/dist/test/FileSharedReachability.test.js.map +1 -0
- package/dist/test/FileTestEnvironment.d.ts.map +1 -1
- package/dist/test/FileTestEnvironment.js +4 -0
- package/dist/test/FileTestEnvironment.js.map +1 -1
- package/generated/index.ts +1 -1
- package/index.ts +1 -0
- package/package.json +4 -4
- package/src/FileReachabilityResolver.ts +29 -0
- package/src/FileStorage.ts +25 -4
- package/src/routes/getFile.ts +5 -2
- package/test/FileSharedReachability.test.ts +229 -0
- package/test/FileTestEnvironment.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.7.4](https://github.com/proteinjs/db/compare/@proteinjs/db-file@1.7.3...@proteinjs/db-file@1.7.4) (2026-08-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* file access derives from content access — shared-content reachability leg on the file read ([0f9a480](https://github.com/proteinjs/db/commit/0f9a48047971ba4381692420bb69e834ffa1d8e7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [1.7.3](https://github.com/proteinjs/db/compare/@proteinjs/db-file@1.7.2...@proteinjs/db-file@1.7.3) (2026-08-28)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @proteinjs/db-file
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [1.7.2](https://github.com/proteinjs/db/compare/@proteinjs/db-file@1.7.1...@proteinjs/db-file@1.7.2) (2026-08-27)
|
|
7
26
|
|
|
8
27
|
**Note:** Version bump only for package @proteinjs/db-file
|
package/dist/generated/index.js
CHANGED
|
@@ -21,7 +21,7 @@ require("@proteinjs/server-api");
|
|
|
21
21
|
require("@proteinjs/service");
|
|
22
22
|
require("@proteinjs/user");
|
|
23
23
|
/** Generate Source Graph */
|
|
24
|
-
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/db-file/DefaultFileStorageDriverFactory\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"DefaultFileStorageDriverFactory\",\"filePath\":\"src/FileStorage.ts\",\"qualifiedName\":\"@proteinjs/db-file/DefaultFileStorageDriverFactory\",\"properties\":[],\"methods\":[{\"name\":\"getDriver\",\"returnType\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageDriver\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageDriver\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/db-file/FileStorage\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorage\",\"filePath\":\"src/FileStorage.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileStorage\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"driver\",\"type\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageDriver\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageDriver\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"serviceMetadata\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getDriver\",\"returnType\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageDriver\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageDriver\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"createFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileMetaData\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"fileData\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<string>\",\"filePath\":null,\"qualifiedName\":\"/Promise<string>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getSignedUrl\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<string | undefined>\",\"filePath\":null,\"qualifiedName\":\"/Promise<string | undefined>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"options\",\"type\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"{ ttlMs?: number }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/{ ttlMs?: number }\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"data\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"file\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"deleteFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageService\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageService\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/db-file/FileStorageService\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageService\",\"filePath\":\"src/services/FileStorageService.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileStorageService\",\"properties\":[],\"methods\":[{\"name\":\"createFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileMetaData\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"fileData\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<string>\",\"filePath\":null,\"qualifiedName\":\"/Promise<string>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"data\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"file\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"deleteFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/service\",\"name\":\"Service\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/service/Service\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/db-file/FileStorageTableWatcher\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageTableWatcher\",\"filePath\":\"src/FileStorageTableWatcher.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileStorageTableWatcher\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"logger\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\"}],\"methods\":[{\"name\":\"name\",\"returnType\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"table\",\"returnType\":{\"packageName\":\"\",\"name\":\"Table<File>\",\"filePath\":null,\"qualifiedName\":\"/Table<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"beforeDelete\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"recordsToDelete\",\"type\":{\"packageName\":\"\",\"name\":\"T[]\",\"filePath\":null,\"qualifiedName\":\"/T[]\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"initialQb\",\"type\":{\"packageName\":\"\",\"name\":\"QueryBuilder<T>\",\"filePath\":null,\"qualifiedName\":\"/QueryBuilder<T>\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"deleteQb\",\"type\":{\"packageName\":\"\",\"name\":\"QueryBuilder<T>\",\"filePath\":null,\"qualifiedName\":\"/QueryBuilder<T>\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/db\",\"name\":\"TableWatcher\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db/TableWatcher\",\"properties\":[],\"methods\":[],\"typeParameters\":[\"@proteinjs/db-file/File\"],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/db/TableWatcher\"},{\"v\":\"@proteinjs/db-file/getFile\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"getFile\",\"filePath\":\"src/routes/getFile.ts\",\"qualifiedName\":\"@proteinjs/db-file/getFile\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/server-api/Route\"},{\"v\":\"@proteinjs/service/Service\"},{\"v\":\"@proteinjs/db-file/FileData\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileData\",\"filePath\":\"src/tables/FileDataTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileData\",\"properties\":[{\"name\":\"file\",\"type\":{\"packageName\":\"\",\"name\":\"Reference<File>\",\"filePath\":null,\"qualifiedName\":\"/Reference<File>\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"order\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"data\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/user\",\"name\":\"ScopedRecord\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/user/ScopedRecord\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/user/ScopedRecord\"},{\"v\":\"@proteinjs/db-file/FileDataTable\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileDataTable\",\"filePath\":\"src/tables/FileDataTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileDataTable\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"name\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"auth\",\"type\":{\"packageName\":\"\",\"name\":\"Table<FileData>['auth']\",\"filePath\":null,\"qualifiedName\":\"/Table<FileData>['auth']\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"columns\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db\",\"name\":\"Table\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db/Table\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[\"@proteinjs/db-file/FileData\"],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db/Table\"},{\"v\":\"@proteinjs/db-file/File\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"File\",\"filePath\":\"src/tables/FileTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/File\",\"properties\":[{\"name\":\"name\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"type\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"size\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"preview\",\"type\":{\"packageName\":\"\",\"name\":\"Reference<File>\",\"filePath\":null,\"qualifiedName\":\"/Reference<File>\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"width\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"height\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"durationMs\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"sourceUrl\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"sourcePageUrl\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"retrievedAt\",\"type\":{\"packageName\":\"\",\"name\":\"Date\",\"filePath\":null,\"qualifiedName\":\"/Date\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"contentHash\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/user\",\"name\":\"ScopedRecord\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/user/ScopedRecord\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/db-file/FileTable\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileTable\",\"filePath\":\"src/tables/FileTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileTable\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"name\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"auth\",\"type\":{\"packageName\":\"\",\"name\":\"Table<File>['auth']\",\"filePath\":null,\"qualifiedName\":\"/Table<File>['auth']\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"columns\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"indexes\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db\",\"name\":\"Table\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db/Table\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[\"@proteinjs/db-file/File\"],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}}],\"edges\":[{\"v\":\"@proteinjs/db-file/DefaultFileStorageDriverFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileStorage\",\"w\":\"@proteinjs/db-file/FileStorageService\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/db-file/FileStorageTableWatcher\",\"w\":\"@proteinjs/db/TableWatcher\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/db-file/getFile\",\"w\":\"@proteinjs/server-api/Route\",\"value\":\"has type\"},{\"v\":\"@proteinjs/db-file/FileStorageService\",\"w\":\"@proteinjs/service/Service\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileData\",\"w\":\"@proteinjs/user/ScopedRecord\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileDataTable\",\"w\":\"@proteinjs/db/Table\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/db-file/File\",\"w\":\"@proteinjs/user/ScopedRecord\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileTable\",\"w\":\"@proteinjs/db/Table\",\"value\":\"extends class\"}]}";
|
|
24
|
+
var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"@proteinjs/db-file/FileReachabilityResolver\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileReachabilityResolver\",\"filePath\":\"src/FileReachabilityResolver.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileReachabilityResolver\",\"properties\":[],\"methods\":[{\"name\":\"canReadViaReference\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<boolean>\",\"filePath\":null,\"qualifiedName\":\"/Promise<boolean>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/reflection/Loadable\"},{\"v\":\"@proteinjs/db-file/DefaultFileStorageDriverFactory\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"DefaultFileStorageDriverFactory\",\"filePath\":\"src/FileStorage.ts\",\"qualifiedName\":\"@proteinjs/db-file/DefaultFileStorageDriverFactory\",\"properties\":[],\"methods\":[{\"name\":\"getDriver\",\"returnType\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageDriver\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageDriver\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/reflection\",\"name\":\"Loadable\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/reflection/Loadable\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/db-file/FileStorage\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorage\",\"filePath\":\"src/FileStorage.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileStorage\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"driver\",\"type\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageDriver\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageDriver\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"private\"},{\"name\":\"serviceMetadata\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getDriver\",\"returnType\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageDriver\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageDriver\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":true,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"createFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileMetaData\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"fileData\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<string>\",\"filePath\":null,\"qualifiedName\":\"/Promise<string>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getSignedUrl\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<string | undefined>\",\"filePath\":null,\"qualifiedName\":\"/Promise<string | undefined>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"options\",\"type\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"{ ttlMs?: number }\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/{ ttlMs?: number }\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"data\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"file\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"deleteFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageService\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-file/FileStorageService\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/db-file/FileStorageService\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageService\",\"filePath\":\"src/services/FileStorageService.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileStorageService\",\"properties\":[],\"methods\":[{\"name\":\"createFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileMetaData\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"fileData\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<File>\",\"filePath\":null,\"qualifiedName\":\"/Promise<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<string>\",\"filePath\":null,\"qualifiedName\":\"/Promise<string>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFileData\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"data\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"updateFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"file\",\"type\":{\"packageName\":\"\",\"name\":\"Omit<File, keyof ScopedRecord>\",\"filePath\":null,\"qualifiedName\":\"/Omit<File, keyof ScopedRecord>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"deleteFile\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":true,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"fileId\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/service\",\"name\":\"Service\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/service/Service\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/db-file/FileStorageTableWatcher\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileStorageTableWatcher\",\"filePath\":\"src/FileStorageTableWatcher.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileStorageTableWatcher\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"logger\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\"}],\"methods\":[{\"name\":\"name\",\"returnType\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"table\",\"returnType\":{\"packageName\":\"\",\"name\":\"Table<File>\",\"filePath\":null,\"qualifiedName\":\"/Table<File>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[]},{\"name\":\"beforeDelete\",\"returnType\":{\"packageName\":\"\",\"name\":\"Promise<void>\",\"filePath\":null,\"qualifiedName\":\"/Promise<void>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":true,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"recordsToDelete\",\"type\":{\"packageName\":\"\",\"name\":\"T[]\",\"filePath\":null,\"qualifiedName\":\"/T[]\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"initialQb\",\"type\":{\"packageName\":\"\",\"name\":\"QueryBuilder<T>\",\"filePath\":null,\"qualifiedName\":\"/QueryBuilder<T>\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"deleteQb\",\"type\":{\"packageName\":\"\",\"name\":\"QueryBuilder<T>\",\"filePath\":null,\"qualifiedName\":\"/QueryBuilder<T>\",\"typeParameters\":null,\"directParents\":null}}]}],\"typeParameters\":[],\"directParentInterfaces\":[{\"packageName\":\"@proteinjs/db\",\"name\":\"TableWatcher\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db/TableWatcher\",\"properties\":[],\"methods\":[],\"typeParameters\":[\"@proteinjs/db-file/File\"],\"directParents\":[]}],\"directParentClasses\":[],\"sourceType\":2}},{\"v\":\"@proteinjs/db/TableWatcher\"},{\"v\":\"@proteinjs/db-file/getFile\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"getFile\",\"filePath\":\"src/routes/getFile.ts\",\"qualifiedName\":\"@proteinjs/db-file/getFile\",\"type\":{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/server-api\",\"name\":\"Route\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/server-api/Route\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/server-api/Route\"},{\"v\":\"@proteinjs/service/Service\"},{\"v\":\"@proteinjs/db-file/FileData\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileData\",\"filePath\":\"src/tables/FileDataTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileData\",\"properties\":[{\"name\":\"file\",\"type\":{\"packageName\":\"\",\"name\":\"Reference<File>\",\"filePath\":null,\"qualifiedName\":\"/Reference<File>\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"order\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"data\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/user\",\"name\":\"ScopedRecord\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/user/ScopedRecord\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/user/ScopedRecord\"},{\"v\":\"@proteinjs/db-file/FileDataTable\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileDataTable\",\"filePath\":\"src/tables/FileDataTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileDataTable\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"name\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"auth\",\"type\":{\"packageName\":\"\",\"name\":\"Table<FileData>['auth']\",\"filePath\":null,\"qualifiedName\":\"/Table<FileData>['auth']\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"columns\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db\",\"name\":\"Table\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db/Table\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[\"@proteinjs/db-file/FileData\"],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db/Table\"},{\"v\":\"@proteinjs/db-file/File\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"File\",\"filePath\":\"src/tables/FileTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/File\",\"properties\":[{\"name\":\"name\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"type\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"size\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"preview\",\"type\":{\"packageName\":\"\",\"name\":\"Reference<File>\",\"filePath\":null,\"qualifiedName\":\"/Reference<File>\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"width\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"height\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"durationMs\",\"type\":{\"packageName\":\"\",\"name\":\"number\",\"filePath\":null,\"qualifiedName\":\"/number\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"sourceUrl\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"sourcePageUrl\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"retrievedAt\",\"type\":{\"packageName\":\"\",\"name\":\"Date\",\"filePath\":null,\"qualifiedName\":\"/Date\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"contentHash\",\"type\":{\"packageName\":\"\",\"name\":\"string\",\"filePath\":null,\"qualifiedName\":\"/string\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":true,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/user\",\"name\":\"ScopedRecord\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/user/ScopedRecord\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParents\":[]}],\"sourceType\":3}},{\"v\":\"@proteinjs/db-file/FileTable\",\"value\":{\"packageName\":\"@proteinjs/db-file\",\"name\":\"FileTable\",\"filePath\":\"src/tables/FileTable.ts\",\"qualifiedName\":\"@proteinjs/db-file/FileTable\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"name\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"auth\",\"type\":{\"packageName\":\"\",\"name\":\"Table<File>['auth']\",\"filePath\":null,\"qualifiedName\":\"/Table<File>['auth']\",\"typeParameters\":null,\"directParents\":null},\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"columns\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"},{\"name\":\"indexes\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db\",\"name\":\"Table\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db/Table\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[\"@proteinjs/db-file/File\"],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}}],\"edges\":[{\"v\":\"@proteinjs/db-file/FileReachabilityResolver\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/DefaultFileStorageDriverFactory\",\"w\":\"@proteinjs/reflection/Loadable\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileStorage\",\"w\":\"@proteinjs/db-file/FileStorageService\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/db-file/FileStorageTableWatcher\",\"w\":\"@proteinjs/db/TableWatcher\",\"value\":\"implements interface\"},{\"v\":\"@proteinjs/db-file/getFile\",\"w\":\"@proteinjs/server-api/Route\",\"value\":\"has type\"},{\"v\":\"@proteinjs/db-file/FileStorageService\",\"w\":\"@proteinjs/service/Service\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileData\",\"w\":\"@proteinjs/user/ScopedRecord\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileDataTable\",\"w\":\"@proteinjs/db/Table\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/db-file/File\",\"w\":\"@proteinjs/user/ScopedRecord\",\"value\":\"extends interface\"},{\"v\":\"@proteinjs/db-file/FileTable\",\"w\":\"@proteinjs/db/Table\",\"value\":\"extends class\"}]}";
|
|
25
25
|
/** Generate Source Links */
|
|
26
26
|
var FileStorage_1 = require("../src/FileStorage");
|
|
27
27
|
var FileStorageTableWatcher_1 = require("../src/FileStorageTableWatcher");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,yBAAuB;AACvB,6BAA2B;AAC3B,iCAA+B;AAC/B,8BAA4B;AAC5B,2BAAyB;AAGzB,4BAA4B;AAE5B,IAAM,WAAW,GAAG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,yBAAuB;AACvB,6BAA2B;AAC3B,iCAA+B;AAC/B,8BAA4B;AAC5B,2BAAyB;AAGzB,4BAA4B;AAE5B,IAAM,WAAW,GAAG,q/sBAAq/sB,CAAC;AAG1gtB,4BAA4B;AAE5B,kDAAiD;AACjD,0EAAyE;AACzE,iDAAgD;AAChD,6DAA4D;AAC5D,qDAAoD;AAEpD,IAAM,WAAW,GAAG;IACnB,gCAAgC,EAAE,yBAAW;IAC7C,4CAA4C,EAAE,iDAAuB;IACrE,4BAA4B,EAAE,iBAAO;IACrC,kCAAkC,EAAE,6BAAa;IACjD,8BAA8B,EAAE,qBAAS;CACzC,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './src/tables/FileTable';
|
|
|
4
4
|
export * from './src/tables/FileDataTable';
|
|
5
5
|
export * from './src/services/FileStorageService';
|
|
6
6
|
export * from './src/routes/getFileRoute';
|
|
7
|
+
export * from './src/FileReachabilityResolver';
|
|
7
8
|
export * from './src/FileStorageDriver';
|
|
8
9
|
export * from './src/DbFileStorageDriver';
|
|
9
10
|
export * from './src/FileStorageTableWatcher';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,cAAc,mBAAmB,CAAC;AAElC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,mCAAmC,CAAC;AAElD,cAAc,2BAA2B,CAAC;AAE1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAEA,cAAc,mBAAmB,CAAC;AAElC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,4BAA4B,CAAC;AAE3C,cAAc,mCAAmC,CAAC;AAElD,cAAc,2BAA2B,CAAC;AAE1C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -20,6 +20,7 @@ __exportStar(require("./src/tables/FileTable"), exports);
|
|
|
20
20
|
__exportStar(require("./src/tables/FileDataTable"), exports);
|
|
21
21
|
__exportStar(require("./src/services/FileStorageService"), exports);
|
|
22
22
|
__exportStar(require("./src/routes/getFileRoute"), exports);
|
|
23
|
+
__exportStar(require("./src/FileReachabilityResolver"), exports);
|
|
23
24
|
__exportStar(require("./src/FileStorageDriver"), exports);
|
|
24
25
|
__exportStar(require("./src/DbFileStorageDriver"), exports);
|
|
25
26
|
__exportStar(require("./src/FileStorageTableWatcher"), exports);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,oDAAkC;AAElC,sDAAoC;AACpC,yDAAuC;AACvC,6DAA2C;AAE3C,oEAAkD;AAElD,4DAA0C;AAE1C,0DAAwC;AACxC,4DAA0C;AAC1C,gEAA8C"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,oDAAkC;AAElC,sDAAoC;AACpC,yDAAuC;AACvC,6DAA2C;AAE3C,oEAAkD;AAElD,4DAA0C;AAE1C,iEAA+C;AAC/C,0DAAwC;AACxC,4DAA0C;AAC1C,gEAA8C"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Loadable } from '@proteinjs/reflection';
|
|
2
|
+
/**
|
|
3
|
+
* The shared-content file leg (SHARING_EXPANSION §1): the caller may read a file when they may
|
|
4
|
+
* read a row that references it. File rows are ScopedRecord — owner-private — but files get
|
|
5
|
+
* EMBEDDED in shareable content (a shared thought's media nodes), where the content's own access
|
|
6
|
+
* model says a share recipient may read them; a purely scoped row read as the access check
|
|
7
|
+
* refuses every recipient (the shared-thought media defect, SHARING_EXPANSION §0).
|
|
8
|
+
*
|
|
9
|
+
* Content packages register resolvers that answer reachability through their own GRANT-FILTERED
|
|
10
|
+
* reads — the same derivation the content itself is read through — so file access derives from
|
|
11
|
+
* content access, revocation included, and file scope is never widened. Dependency direction is
|
|
12
|
+
* the SharedThoughtResolver pattern: the interface lives here in db-file; implementations live
|
|
13
|
+
* in the content packages above (thought, later chat) and are discovered via SourceRepository.
|
|
14
|
+
*
|
|
15
|
+
* Consulted by `FileStorage.getFile` only after the caller's scoped read MISSES (the owner never
|
|
16
|
+
* pays for it), and it widens READS only: writes and deletes stay owner-scoped.
|
|
17
|
+
*/
|
|
18
|
+
export interface FileReachabilityResolver extends Loadable {
|
|
19
|
+
/**
|
|
20
|
+
* True when the CURRENT session user can read a row that references this file. Implementations
|
|
21
|
+
* MUST resolve through their grant-filtered reads (e.g. the shared db) so a revoked grant
|
|
22
|
+
* closes file access the same moment it closes content access.
|
|
23
|
+
*/
|
|
24
|
+
canReadViaReference(fileId: string): Promise<boolean>;
|
|
25
|
+
}
|
|
26
|
+
export declare const getFileReachabilityResolvers: () => FileReachabilityResolver[];
|
|
27
|
+
//# sourceMappingURL=FileReachabilityResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileReachabilityResolver.d.ts","sourceRoot":"","sources":["../../src/FileReachabilityResolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,wBAAyB,SAAQ,QAAQ;IACxD;;;;OAIG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACvD;AAED,eAAO,MAAM,4BAA4B,kCACgE,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFileReachabilityResolvers = void 0;
|
|
4
|
+
var reflection_1 = require("@proteinjs/reflection");
|
|
5
|
+
var getFileReachabilityResolvers = function () {
|
|
6
|
+
return reflection_1.SourceRepository.get().objects('@proteinjs/db-file/FileReachabilityResolver');
|
|
7
|
+
};
|
|
8
|
+
exports.getFileReachabilityResolvers = getFileReachabilityResolvers;
|
|
9
|
+
//# sourceMappingURL=FileReachabilityResolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileReachabilityResolver.js","sourceRoot":"","sources":["../../src/FileReachabilityResolver.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AA2B5D,IAAM,4BAA4B,GAAG;IAC1C,OAAA,6BAAgB,CAAC,GAAG,EAAE,CAAC,OAAO,CAA2B,6CAA6C,CAAC;AAAvG,CAAuG,CAAC;AAD7F,QAAA,4BAA4B,gCACiE"}
|
|
@@ -41,9 +41,16 @@ export declare class FileStorage implements FileStorageService {
|
|
|
41
41
|
*/
|
|
42
42
|
createFile(fileMetaData: Omit<File, keyof ScopedRecord>, fileData: string): Promise<File>;
|
|
43
43
|
/**
|
|
44
|
-
* Retrieves the metadata of a given file
|
|
44
|
+
* Retrieves the metadata of a given file — THE file-read access decision every serving path
|
|
45
|
+
* derives from (`/file/:id`, signed-URL minting, the browser service).
|
|
46
|
+
*
|
|
47
|
+
* Two legs: the caller's own file resolves by the SCOPED read; when that misses, the
|
|
48
|
+
* shared-content leg asks the registered {@link FileReachabilityResolver}s whether the caller
|
|
49
|
+
* can read a row that REFERENCES the file (a shared thought's media node) — content access
|
|
50
|
+
* confers file access, through the content's own grant-filtered read, never by widening file
|
|
51
|
+
* scope. No resolver vouching means the miss stands. Reads only: writes/deletes stay scoped.
|
|
45
52
|
* @param fileId - The `id` of the file.
|
|
46
|
-
* @returns The file metadata.
|
|
53
|
+
* @returns The file metadata, or `undefined` when the caller can neither own nor reach it.
|
|
47
54
|
*/
|
|
48
55
|
getFile(fileId: string): Promise<File>;
|
|
49
56
|
/**
|
|
@@ -55,7 +62,8 @@ export declare class FileStorage implements FileStorageService {
|
|
|
55
62
|
/**
|
|
56
63
|
* Mint a short-lived, read-only URL for the file's bytes (server-only; not part of the
|
|
57
64
|
* browser-facing `FileStorageService`). A signed URL is a bearer capability, so minting
|
|
58
|
-
* verifies the caller can read the file row (
|
|
65
|
+
* verifies the caller can read the file row (the two-legged {@link getFile} read — own scope
|
|
66
|
+
* or shared-content reachability) before signing.
|
|
59
67
|
* @param fileId - The `id` of the file.
|
|
60
68
|
* @param options.ttlMs - How long the URL stays valid; the driver applies its default when omitted.
|
|
61
69
|
* @returns The signed URL, or `undefined` when the driver has no external URL space
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileStorage.d.ts","sourceRoot":"","sources":["../../src/FileStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"FileStorage.d.ts","sourceRoot":"","sources":["../../src/FileStorage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAoC,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAyB,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EAAE,QAAQ,EAAoB,MAAM,uBAAuB,CAAC;AAInE;;;KAGK;AACL,eAAO,MAAM,cAAc,mBACiE,CAAC;AAE7F;;GAEG;AACH,MAAM,WAAW,+BAAgC,SAAQ,QAAQ;IAC/D,SAAS,IAAI,iBAAiB,CAAC;CAChC;AAED;;;;GAIG;AACH,qBAAa,WAAY,YAAW,kBAAkB;IACpD,OAAO,CAAC,MAAM,CAAC,MAAM,CAAoB;IAElC,eAAe;;;;MAIpB;IAEF;;;;;OAKG;IACH,MAAM,CAAC,SAAS,IAAI,iBAAiB;IAkBrC;;;;;OAKG;IACG,UAAU,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,YAAY,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/F;;;;;;;;;;;OAWG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkB5C;;;;OAIG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAIlD;;;;;;;;;;OAUG;IACG,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAc7F;;;;OAIG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIjE;;;OAGG;IACG,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAUrE;;;;;;OAMG;IACG,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIhD"}
|
package/dist/src/FileStorage.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.FileStorage = exports.getFileStorage = void 0;
|
|
|
40
40
|
var user_1 = require("@proteinjs/user");
|
|
41
41
|
var tables_1 = require("./tables/tables");
|
|
42
42
|
var FileStorageService_1 = require("./services/FileStorageService");
|
|
43
|
+
var FileReachabilityResolver_1 = require("./FileReachabilityResolver");
|
|
43
44
|
var reflection_1 = require("@proteinjs/reflection");
|
|
44
45
|
var logger_1 = require("@proteinjs/logger");
|
|
45
46
|
var DbFileStorageDriver_1 = require("./DbFileStorageDriver");
|
|
@@ -110,21 +111,47 @@ var FileStorage = /** @class */ (function () {
|
|
|
110
111
|
});
|
|
111
112
|
};
|
|
112
113
|
/**
|
|
113
|
-
* Retrieves the metadata of a given file
|
|
114
|
+
* Retrieves the metadata of a given file — THE file-read access decision every serving path
|
|
115
|
+
* derives from (`/file/:id`, signed-URL minting, the browser service).
|
|
116
|
+
*
|
|
117
|
+
* Two legs: the caller's own file resolves by the SCOPED read; when that misses, the
|
|
118
|
+
* shared-content leg asks the registered {@link FileReachabilityResolver}s whether the caller
|
|
119
|
+
* can read a row that REFERENCES the file (a shared thought's media node) — content access
|
|
120
|
+
* confers file access, through the content's own grant-filtered read, never by widening file
|
|
121
|
+
* scope. No resolver vouching means the miss stands. Reads only: writes/deletes stay scoped.
|
|
114
122
|
* @param fileId - The `id` of the file.
|
|
115
|
-
* @returns The file metadata.
|
|
123
|
+
* @returns The file metadata, or `undefined` when the caller can neither own nor reach it.
|
|
116
124
|
*/
|
|
117
125
|
FileStorage.prototype.getFile = function (fileId) {
|
|
118
126
|
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
-
var db, file;
|
|
120
|
-
return __generator(this, function (
|
|
121
|
-
switch (
|
|
127
|
+
var db, file, _i, _a, resolver;
|
|
128
|
+
return __generator(this, function (_b) {
|
|
129
|
+
switch (_b.label) {
|
|
122
130
|
case 0:
|
|
123
131
|
db = (0, user_1.getScopedDb)();
|
|
124
132
|
return [4 /*yield*/, db.get(tables_1.tables.File, { id: fileId })];
|
|
125
133
|
case 1:
|
|
126
|
-
file =
|
|
127
|
-
|
|
134
|
+
file = _b.sent();
|
|
135
|
+
if (file) {
|
|
136
|
+
return [2 /*return*/, file];
|
|
137
|
+
}
|
|
138
|
+
_i = 0, _a = (0, FileReachabilityResolver_1.getFileReachabilityResolvers)();
|
|
139
|
+
_b.label = 2;
|
|
140
|
+
case 2:
|
|
141
|
+
if (!(_i < _a.length)) return [3 /*break*/, 6];
|
|
142
|
+
resolver = _a[_i];
|
|
143
|
+
return [4 /*yield*/, resolver.canReadViaReference(fileId)];
|
|
144
|
+
case 3:
|
|
145
|
+
if (!_b.sent()) return [3 /*break*/, 5];
|
|
146
|
+
return [4 /*yield*/, (0, user_1.getScopedDbAsSystem)().get(tables_1.tables.File, { id: fileId })];
|
|
147
|
+
case 4:
|
|
148
|
+
// Reachability established through the caller's grant-filtered content read — the row
|
|
149
|
+
// itself lives in the owner's scope, so it is served via system read.
|
|
150
|
+
return [2 /*return*/, _b.sent()];
|
|
151
|
+
case 5:
|
|
152
|
+
_i++;
|
|
153
|
+
return [3 /*break*/, 2];
|
|
154
|
+
case 6: return [2 /*return*/, file];
|
|
128
155
|
}
|
|
129
156
|
});
|
|
130
157
|
});
|
|
@@ -147,7 +174,8 @@ var FileStorage = /** @class */ (function () {
|
|
|
147
174
|
/**
|
|
148
175
|
* Mint a short-lived, read-only URL for the file's bytes (server-only; not part of the
|
|
149
176
|
* browser-facing `FileStorageService`). A signed URL is a bearer capability, so minting
|
|
150
|
-
* verifies the caller can read the file row (
|
|
177
|
+
* verifies the caller can read the file row (the two-legged {@link getFile} read — own scope
|
|
178
|
+
* or shared-content reachability) before signing.
|
|
151
179
|
* @param fileId - The `id` of the file.
|
|
152
180
|
* @param options.ttlMs - How long the URL stays valid; the driver applies its default when omitted.
|
|
153
181
|
* @returns The signed URL, or `undefined` when the driver has no external URL space
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileStorage.js","sourceRoot":"","sources":["../../src/FileStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"FileStorage.js","sourceRoot":"","sources":["../../src/FileStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wCAAiF;AAEjF,0CAAyC;AACzC,oEAA0F;AAE1F,uEAA0E;AAC1E,oDAAmE;AACnE,4CAA2C;AAC3C,6DAA4D;AAE5D;;;KAGK;AACE,IAAM,cAAc,GAAG;IAC5B,OAAA,OAAO,IAAI,KAAK,WAA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BAAO,SAA0C,EAAC;;;;KACnD;IAED;;;;OAIG;IACG,oCAAc,GAApB,UAAqB,MAAc,EAAE,IAAY;;;;4BAC/C,qBAAM,WAAW,CAAC,SAAS,EAAE,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,CAAC,EAAA;;wBAA1D,SAA0D,CAAC;;;;;KAC5D;IAED;;;OAGG;IACG,gCAAU,GAAhB,UAAiB,IAAoC;;;;;;wBAC7C,EAAE,GAAG,IAAA,kBAAW,GAAE,CAAC;wBACzB,qBAAM,EAAE,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,IAAI,CAAC,EAAA;;wBAAlC,SAAkC,CAAC;wBAE7B,MAAM,GAAG,WAAW,CAAC,SAAS,EAAE,CAAC;6BACnC,MAAM,CAAC,UAAU,EAAjB,wBAAiB;wBACnB,qBAAM,MAAM,CAAC,UAAU,CAAC,IAAY,CAAC,EAAA;;wBAArC,SAAqC,CAAC;;;;;;KAEzC;IAED;;;;;;OAMG;IACG,gCAAU,GAAhB,UAAiB,MAAc;;;;;;wBACvB,EAAE,GAAG,IAAA,kBAAW,GAAE,CAAC;wBACzB,qBAAM,EAAE,CAAC,MAAM,CAAC,eAAM,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAA;;wBAA5C,SAA4C,CAAC;;;;;KAC9C;IACH,kBAAC;AAAD,CAAC,AAhJD,IAgJC;AAhJY,kCAAW"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Route } from '@proteinjs/server-api';
|
|
2
2
|
/**
|
|
3
|
-
* Serves a file's bytes. Auth first
|
|
3
|
+
* Serves a file's bytes. Auth first: logged-in, then the `FileStorage.getFile` row read as the
|
|
4
|
+
* access decision — the caller's SCOPED read, else the shared-content reachability leg
|
|
5
|
+
* (`FileReachabilityResolver`: the caller may read a file when they may read a row that
|
|
6
|
+
* references it, e.g. a shared thought's media node). Then one of two serving paths:
|
|
4
7
|
*
|
|
5
8
|
* - **302 redirect** to a short-lived signed URL when the driver's store has an external URL
|
|
6
9
|
* space (GCS). The app URL stays the one stable reference every `<img>`/`<video>`/chip uses;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAK9C
|
|
1
|
+
{"version":3,"file":"getFile.d.ts","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAK9C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,EAAE,KAiDrB,CAAC"}
|
|
@@ -41,7 +41,10 @@ var FileStorage_1 = require("../FileStorage");
|
|
|
41
41
|
var user_1 = require("@proteinjs/user");
|
|
42
42
|
var byteRange_1 = require("./byteRange");
|
|
43
43
|
/**
|
|
44
|
-
* Serves a file's bytes. Auth first
|
|
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:
|
|
45
48
|
*
|
|
46
49
|
* - **302 redirect** to a short-lived signed URL when the driver's store has an external URL
|
|
47
50
|
* space (GCS). The app URL stays the one stable reference every `<img>`/`<video>`/chip uses;
|
|
@@ -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
|
|
1
|
+
{"version":3,"file":"getFile.js","sourceRoot":"","sources":["../../../src/routes/getFile.ts"],"names":[],"mappings":";;;;;;;;;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