@pikku/kysely 0.13.39 → 0.13.40
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildMeshHeaders } from '@pikku/core/mesh';
|
|
2
2
|
import { getAllFunctionNames } from '@pikku/core/function';
|
|
3
3
|
import { requirePikkuSchema } from './schema/index.js';
|
|
4
4
|
import { upsert } from './kysely-upsert.js';
|
|
@@ -66,7 +66,7 @@ export class KyselyDeploymentService {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
async invoke(funcName, data, session, traceId) {
|
|
69
|
-
const headers = await
|
|
69
|
+
const headers = await buildMeshHeaders(this.jwt, this.secrets, funcName, session, traceId);
|
|
70
70
|
const ttlMs = this.heartbeatTtl;
|
|
71
71
|
const cutoff = new Date(Date.now() - ttlMs);
|
|
72
72
|
const result = await this.db
|
|
@@ -82,7 +82,7 @@ export class KyselyDeploymentService {
|
|
|
82
82
|
throw new Error(`No deployment found for function '${funcName}'`);
|
|
83
83
|
}
|
|
84
84
|
const endpoint = result[0].endpoint;
|
|
85
|
-
const url = `${endpoint}/
|
|
85
|
+
const url = `${endpoint}/mesh/rpc/${encodeURIComponent(funcName)}`;
|
|
86
86
|
const response = await fetch(url, {
|
|
87
87
|
method: 'POST',
|
|
88
88
|
headers: {
|
|
@@ -92,7 +92,7 @@ export class KyselyDeploymentService {
|
|
|
92
92
|
body: JSON.stringify({ data }),
|
|
93
93
|
});
|
|
94
94
|
if (!response.ok) {
|
|
95
|
-
throw new Error(`
|
|
95
|
+
throw new Error(`Mesh RPC call to '${funcName}' failed: ${response.status}`);
|
|
96
96
|
}
|
|
97
97
|
return response.json();
|
|
98
98
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pikku/kysely",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.40",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/pikkujs/pikku.git",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@pikku/core": "^0.12.
|
|
31
|
+
"@pikku/core": "^0.12.146"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"kysely": "^0.29.6"
|