@directus/storage-driver-supabase 3.0.12 → 3.0.14
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/dist/index.js +7 -4
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { basename, join } from "node:path";
|
|
2
|
+
import { Readable } from "node:stream";
|
|
1
3
|
import { DEFAULT_CHUNK_SIZE } from "@directus/constants";
|
|
2
4
|
import { normalizePath } from "@directus/utils";
|
|
3
5
|
import { StorageClient } from "@supabase/storage-js";
|
|
4
|
-
import { join } from "node:path";
|
|
5
|
-
import { Readable } from "node:stream";
|
|
6
6
|
import * as tus from "tus-js-client";
|
|
7
7
|
import { fetch } from "undici";
|
|
8
8
|
|
|
@@ -57,8 +57,11 @@ var DriverSupabase = class {
|
|
|
57
57
|
return Readable.fromWeb(response.body);
|
|
58
58
|
}
|
|
59
59
|
async stat(filepath) {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
let rootPath = join(this.config.root, dirname(filepath));
|
|
61
|
+
if (rootPath === ".") rootPath = "";
|
|
62
|
+
const rootFolder = normalizePath(rootPath);
|
|
63
|
+
const { data, error } = await this.bucket.list(rootFolder, {
|
|
64
|
+
search: basename(filepath),
|
|
62
65
|
limit: 1
|
|
63
66
|
});
|
|
64
67
|
if (error || data.length === 0) throw new Error("File not found");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@directus/storage-driver-supabase",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.14",
|
|
4
4
|
"description": "Supabase file storage abstraction for `@directus/storage`",
|
|
5
5
|
"homepage": "https://directus.io",
|
|
6
6
|
"repository": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"undici": "7.16.0",
|
|
27
27
|
"@directus/constants": "14.0.0",
|
|
28
28
|
"@directus/storage": "12.0.3",
|
|
29
|
-
"@directus/utils": "13.
|
|
29
|
+
"@directus/utils": "13.1.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@directus/tsconfig": "3.0.0",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"tsdown": "0.15.11",
|
|
36
36
|
"typescript": "5.9.3",
|
|
37
37
|
"vitest": "3.2.4",
|
|
38
|
-
"@directus/types": "
|
|
38
|
+
"@directus/types": "14.0.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsdown src/index.ts --dts",
|