@teamkeel/functions-runtime 0.394.0 → 0.394.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/package.json +3 -3
- package/src/File.js +28 -28
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teamkeel/functions-runtime",
|
|
3
|
-
"version": "0.394.
|
|
3
|
+
"version": "0.394.2",
|
|
4
4
|
"description": "Internal package used by @teamkeel/sdk",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"vitest": "^0.34.6"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@aws-sdk/client-s3": "^3.
|
|
23
|
-
"@aws-sdk/credential-providers": "^3.
|
|
22
|
+
"@aws-sdk/client-s3": "^3.637.0",
|
|
23
|
+
"@aws-sdk/credential-providers": "^3.637.0",
|
|
24
24
|
"@neondatabase/serverless": "^0.9.4",
|
|
25
25
|
"@opentelemetry/api": "^1.7.0",
|
|
26
26
|
"@opentelemetry/exporter-trace-otlp-proto": "^0.46.0",
|
package/src/File.js
CHANGED
|
@@ -205,35 +205,35 @@ async function storeFile(contents, key, filename, contentType, expires) {
|
|
|
205
205
|
console.error("Error uploading file:", error);
|
|
206
206
|
throw error;
|
|
207
207
|
}
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
const db = useDatabase();
|
|
208
|
+
} else {
|
|
209
|
+
// default to db storage
|
|
210
|
+
const db = useDatabase();
|
|
212
211
|
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
212
|
+
try {
|
|
213
|
+
let query = db
|
|
214
|
+
.insertInto("keel_storage")
|
|
215
|
+
.values({
|
|
216
|
+
id: key,
|
|
217
|
+
filename: filename,
|
|
218
|
+
content_type: contentType,
|
|
219
|
+
data: contents,
|
|
220
|
+
})
|
|
221
|
+
.onConflict((oc) =>
|
|
222
|
+
oc
|
|
223
|
+
.column("id")
|
|
224
|
+
.doUpdateSet(() => ({
|
|
225
|
+
filename: filename,
|
|
226
|
+
content_type: contentType,
|
|
227
|
+
data: contents,
|
|
228
|
+
}))
|
|
229
|
+
.where("keel_storage.id", "=", key)
|
|
230
|
+
)
|
|
231
|
+
.returningAll();
|
|
232
|
+
|
|
233
|
+
await query.execute();
|
|
234
|
+
} catch (e) {
|
|
235
|
+
throw new DatabaseError(e);
|
|
236
|
+
}
|
|
237
237
|
}
|
|
238
238
|
}
|
|
239
239
|
|