@teamkeel/functions-runtime 0.412.0-next.7 → 0.412.0-next.8
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.cjs +12 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -58,14 +58,14 @@ var import_kysely5 = require("kysely");
|
|
|
58
58
|
|
|
59
59
|
// src/database.ts
|
|
60
60
|
var import_kysely3 = require("kysely");
|
|
61
|
-
var
|
|
62
|
-
var
|
|
61
|
+
var neon = __toESM(require("@neondatabase/serverless"), 1);
|
|
62
|
+
var import_node_async_hooks2 = require("async_hooks");
|
|
63
63
|
|
|
64
64
|
// src/auditing.js
|
|
65
|
-
var
|
|
65
|
+
var import_node_async_hooks = require("async_hooks");
|
|
66
66
|
var import_traceparent = __toESM(require("traceparent"), 1);
|
|
67
67
|
var import_kysely = require("kysely");
|
|
68
|
-
var auditContextStorage = new
|
|
68
|
+
var auditContextStorage = new import_node_async_hooks.AsyncLocalStorage();
|
|
69
69
|
async function withAuditContext(request, cb) {
|
|
70
70
|
let audit = {};
|
|
71
71
|
if (request.meta?.identity) {
|
|
@@ -403,6 +403,8 @@ __name(spanNameForModelAPI, "spanNameForModelAPI");
|
|
|
403
403
|
// src/database.ts
|
|
404
404
|
var import_ws = __toESM(require("ws"), 1);
|
|
405
405
|
var import_node_fs = require("fs");
|
|
406
|
+
var dbInstance = new import_node_async_hooks2.AsyncLocalStorage();
|
|
407
|
+
var vitestDb = null;
|
|
406
408
|
async function withDatabase(db, requiresTransaction, cb) {
|
|
407
409
|
if (requiresTransaction) {
|
|
408
410
|
return db.transaction().execute(async (transaction) => {
|
|
@@ -418,8 +420,6 @@ async function withDatabase(db, requiresTransaction, cb) {
|
|
|
418
420
|
});
|
|
419
421
|
}
|
|
420
422
|
__name(withDatabase, "withDatabase");
|
|
421
|
-
var dbInstance = new import_async_hooks2.AsyncLocalStorage();
|
|
422
|
-
var vitestDb = null;
|
|
423
423
|
function useDatabase() {
|
|
424
424
|
let fromStore = dbInstance.getStore();
|
|
425
425
|
if (fromStore) {
|
|
@@ -471,7 +471,7 @@ var InstrumentedPool = class extends import_pg.Pool {
|
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
};
|
|
474
|
-
var InstrumentedNeonServerlessPool = class extends
|
|
474
|
+
var InstrumentedNeonServerlessPool = class extends neon.Pool {
|
|
475
475
|
static {
|
|
476
476
|
__name(this, "InstrumentedNeonServerlessPool");
|
|
477
477
|
}
|
|
@@ -548,16 +548,15 @@ function getDialect(connString) {
|
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
case "neon": {
|
|
551
|
-
|
|
552
|
-
neonserverless.types.setTypeParser(
|
|
551
|
+
neon.types.setTypeParser(
|
|
553
552
|
import_pg.types.builtins.NUMERIC,
|
|
554
553
|
(val) => parseFloat(val)
|
|
555
554
|
);
|
|
556
|
-
|
|
555
|
+
neon.types.setTypeParser(
|
|
557
556
|
import_pg.types.builtins.INTERVAL,
|
|
558
557
|
(val) => new Duration(val)
|
|
559
558
|
);
|
|
560
|
-
|
|
559
|
+
neon.neonConfig.webSocketConstructor = import_ws.default;
|
|
561
560
|
const pool = new InstrumentedNeonServerlessPool({
|
|
562
561
|
// If connString is not passed fall back to reading from env var
|
|
563
562
|
connectionString: connString || process.env.KEEL_DB_CONN
|
|
@@ -1814,7 +1813,7 @@ var RequestHeaders = class {
|
|
|
1814
1813
|
var import_json_rpc_22 = require("json-rpc-2.0");
|
|
1815
1814
|
|
|
1816
1815
|
// src/permissions.ts
|
|
1817
|
-
var
|
|
1816
|
+
var import_async_hooks = require("async_hooks");
|
|
1818
1817
|
var PERMISSION_STATE = {
|
|
1819
1818
|
UNKNOWN: "unknown",
|
|
1820
1819
|
PERMITTED: "permitted",
|
|
@@ -1854,7 +1853,7 @@ var Permissions = class {
|
|
|
1854
1853
|
}
|
|
1855
1854
|
}
|
|
1856
1855
|
};
|
|
1857
|
-
var permissionsApiInstance = new
|
|
1856
|
+
var permissionsApiInstance = new import_async_hooks.AsyncLocalStorage();
|
|
1858
1857
|
var withPermissions = /* @__PURE__ */ __name(async (initialValue, cb) => {
|
|
1859
1858
|
const permissions = new Permissions();
|
|
1860
1859
|
return await permissionsApiInstance.run({ permitted: initialValue }, () => {
|