@pikku/kysely 0.13.38 → 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.
- package/dist/bin/pikku-kysely-pure.js +0 -0
- package/dist/src/kysely-deployment-service.js +4 -4
- package/package.json +15 -9
- package/CHANGELOG.md +0 -2367
- package/knowledge/decisions/a-console-role-cannot-take-a-system-roles-name.md +0 -25
- package/knowledge/decisions/a-credential-with-no-user-is-one-row-per-name.md +0 -22
- package/knowledge/decisions/a-lease-is-taken-by-one-guarded-update.md +0 -30
- package/knowledge/decisions/a-virtual-users-schedule-starts-disabled.md +0 -23
- package/knowledge/decisions/classification-driven-encryption-happens-in-a-plugin.md +0 -71
- package/knowledge/decisions/grants-reference-declared-scopes-and-users-by-foreign-key.md +0 -29
- package/knowledge/decisions/index.md +0 -21
- package/knowledge/decisions/keks-are-scoped-by-purpose-as-well-as-version.md +0 -45
- package/knowledge/decisions/leases-are-judged-by-the-database-clock.md +0 -42
- package/knowledge/decisions/the-plugin-is-given-a-resolver-never-a-key.md +0 -45
- package/knowledge/decisions/the-secrets-audit-table-is-declared-even-when-auditing-is-off.md +0 -22
- package/knowledge/decisions/workflows-own-the-lease-table-too.md +0 -22
- package/knowledge/index.md +0 -19
- package/knowledge/questions/do-the-kysely-stores-check-who-calls-them.md +0 -27
- package/knowledge/questions/does-a-trigger-source-row-hold-only-provider-identifiers.md +0 -26
- package/knowledge/questions/index.md +0 -17
- package/knowledge/questions/should-pikku-user-sessions-expire-on-their-own.md +0 -21
- package/knowledge/questions/should-secret-and-credential-reads-be-audited-by-default.md +0 -32
- package/run-tests.sh +0 -61
|
File without changes
|
|
@@ -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",
|
|
@@ -19,28 +19,34 @@
|
|
|
19
19
|
"scripts": {
|
|
20
20
|
"tsc": "tsc",
|
|
21
21
|
"ncu": "npx npm-check-updates",
|
|
22
|
-
"build": "tsc -b",
|
|
22
|
+
"build": "bun run clean && tsc -b",
|
|
23
23
|
"test": "bash run-tests.sh",
|
|
24
24
|
"test:watch": "bash run-tests.sh --watch",
|
|
25
25
|
"test:coverage": "bash run-tests.sh --coverage",
|
|
26
26
|
"release": "npm run build && npm test",
|
|
27
|
-
"prepublishOnly": "bun run build"
|
|
27
|
+
"prepublishOnly": "bun run build",
|
|
28
|
+
"clean": "rm -rf dist tsconfig.tsbuildinfo"
|
|
28
29
|
},
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"@pikku/core": "^0.12.
|
|
31
|
+
"@pikku/core": "^0.12.146"
|
|
31
32
|
},
|
|
32
33
|
"dependencies": {
|
|
33
|
-
"kysely": "^0.29.
|
|
34
|
+
"kysely": "^0.29.6"
|
|
34
35
|
},
|
|
35
36
|
"devDependencies": {
|
|
36
|
-
"@electric-sql/pglite": "^0.5.
|
|
37
|
+
"@electric-sql/pglite": "^0.5.10",
|
|
37
38
|
"@types/better-sqlite3": "^9.6.0",
|
|
38
39
|
"better-sqlite3": "^13.0.3",
|
|
39
40
|
"kysely-codegen": "^0.20.0",
|
|
40
|
-
"kysely-postgres-js": "^
|
|
41
|
+
"kysely-postgres-js": "^5.0.1",
|
|
41
42
|
"postgres": "^3.4.9"
|
|
42
43
|
},
|
|
43
44
|
"exports": {
|
|
44
|
-
".": "./dist/src/index.js"
|
|
45
|
-
|
|
45
|
+
".": "./dist/src/index.js",
|
|
46
|
+
"./package.json": "./package.json"
|
|
47
|
+
},
|
|
48
|
+
"files": [
|
|
49
|
+
"dist",
|
|
50
|
+
"!dist/**/*.tsbuildinfo"
|
|
51
|
+
]
|
|
46
52
|
}
|