@btst/stack 2.9.2 → 2.9.3
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.
|
@@ -28,7 +28,11 @@ const mediaSchema = db.createDbPlugin("media", {
|
|
|
28
28
|
},
|
|
29
29
|
folderId: {
|
|
30
30
|
type: "string",
|
|
31
|
-
required: false
|
|
31
|
+
required: false,
|
|
32
|
+
references: {
|
|
33
|
+
model: "mediaFolder",
|
|
34
|
+
field: "id"
|
|
35
|
+
}
|
|
32
36
|
},
|
|
33
37
|
alt: {
|
|
34
38
|
type: "string",
|
|
@@ -49,7 +53,11 @@ const mediaSchema = db.createDbPlugin("media", {
|
|
|
49
53
|
},
|
|
50
54
|
parentId: {
|
|
51
55
|
type: "string",
|
|
52
|
-
required: false
|
|
56
|
+
required: false,
|
|
57
|
+
references: {
|
|
58
|
+
model: "mediaFolder",
|
|
59
|
+
field: "id"
|
|
60
|
+
}
|
|
53
61
|
},
|
|
54
62
|
createdAt: {
|
|
55
63
|
type: "date",
|
|
@@ -26,7 +26,11 @@ const mediaSchema = createDbPlugin("media", {
|
|
|
26
26
|
},
|
|
27
27
|
folderId: {
|
|
28
28
|
type: "string",
|
|
29
|
-
required: false
|
|
29
|
+
required: false,
|
|
30
|
+
references: {
|
|
31
|
+
model: "mediaFolder",
|
|
32
|
+
field: "id"
|
|
33
|
+
}
|
|
30
34
|
},
|
|
31
35
|
alt: {
|
|
32
36
|
type: "string",
|
|
@@ -47,7 +51,11 @@ const mediaSchema = createDbPlugin("media", {
|
|
|
47
51
|
},
|
|
48
52
|
parentId: {
|
|
49
53
|
type: "string",
|
|
50
|
-
required: false
|
|
54
|
+
required: false,
|
|
55
|
+
references: {
|
|
56
|
+
model: "mediaFolder",
|
|
57
|
+
field: "id"
|
|
58
|
+
}
|
|
51
59
|
},
|
|
52
60
|
createdAt: {
|
|
53
61
|
type: "date",
|
package/package.json
CHANGED
|
@@ -84,14 +84,14 @@ function createVercelBlobStorageAdapter(
|
|
|
84
84
|
return {
|
|
85
85
|
type: "vercel-blob",
|
|
86
86
|
urlHostnameSuffix: ".public.blob.vercel-storage.com",
|
|
87
|
-
handleRequest: vi.fn(async (request, callbacks) => {
|
|
88
|
-
const
|
|
87
|
+
handleRequest: vi.fn(async (request, body, callbacks) => {
|
|
88
|
+
const parsedBody = (body ?? ((await request.json()) as unknown)) as {
|
|
89
89
|
pathname?: string;
|
|
90
90
|
clientPayload?: string | null;
|
|
91
91
|
};
|
|
92
92
|
const tokenOptions = await callbacks.onBeforeGenerateToken?.(
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
parsedBody.pathname ?? "photo.jpg",
|
|
94
|
+
parsedBody.clientPayload ?? null,
|
|
95
95
|
);
|
|
96
96
|
return { ok: true, tokenOptions };
|
|
97
97
|
}),
|
package/src/plugins/media/db.ts
CHANGED
|
@@ -31,6 +31,10 @@ export const mediaSchema = createDbPlugin("media", {
|
|
|
31
31
|
folderId: {
|
|
32
32
|
type: "string",
|
|
33
33
|
required: false,
|
|
34
|
+
references: {
|
|
35
|
+
model: "mediaFolder",
|
|
36
|
+
field: "id",
|
|
37
|
+
},
|
|
34
38
|
},
|
|
35
39
|
alt: {
|
|
36
40
|
type: "string",
|
|
@@ -52,6 +56,10 @@ export const mediaSchema = createDbPlugin("media", {
|
|
|
52
56
|
parentId: {
|
|
53
57
|
type: "string",
|
|
54
58
|
required: false,
|
|
59
|
+
references: {
|
|
60
|
+
model: "mediaFolder",
|
|
61
|
+
field: "id",
|
|
62
|
+
},
|
|
55
63
|
},
|
|
56
64
|
createdAt: {
|
|
57
65
|
type: "date",
|