@pikku/mongodb 0.12.24 → 0.12.26

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 { buildRemoteHeaders } from '@pikku/core/remote';
1
+ import { buildMeshHeaders } from '@pikku/core/mesh';
2
2
  import { getAllFunctionNames } from '@pikku/core/function';
3
3
  export class MongoDBDeploymentService {
4
4
  db;
@@ -57,20 +57,20 @@ export class MongoDBDeploymentService {
57
57
  }
58
58
  }
59
59
  async invoke(funcName, data, session, traceId) {
60
- const headers = await buildRemoteHeaders(this.jwt, this.secrets, funcName, session, traceId);
60
+ const headers = await buildMeshHeaders(this.jwt, this.secrets, funcName, session, traceId);
61
61
  const cutoff = new Date(Date.now() - this.heartbeatTtl);
62
62
  const result = await this.deployments.findOne({ functions: funcName, lastHeartbeat: { $gt: cutoff } }, { sort: { lastHeartbeat: -1 } });
63
63
  if (!result) {
64
64
  throw new Error(`No deployment found for function '${funcName}'`);
65
65
  }
66
- const url = `${result.endpoint}/remote/rpc/${encodeURIComponent(funcName)}`;
66
+ const url = `${result.endpoint}/mesh/rpc/${encodeURIComponent(funcName)}`;
67
67
  const response = await fetch(url, {
68
68
  method: 'POST',
69
69
  headers: { 'Content-Type': 'application/json', ...headers },
70
70
  body: JSON.stringify({ data }),
71
71
  });
72
72
  if (!response.ok) {
73
- throw new Error(`Remote RPC call to '${funcName}' failed: ${response.status}`);
73
+ throw new Error(`Mesh RPC call to '${funcName}' failed: ${response.status}`);
74
74
  }
75
75
  return response.json();
76
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/mongodb",
3
- "version": "0.12.24",
3
+ "version": "0.12.26",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -24,7 +24,7 @@
24
24
  "clean": "rm -rf dist tsconfig.tsbuildinfo"
25
25
  },
26
26
  "peerDependencies": {
27
- "@pikku/core": "^0.12.144"
27
+ "@pikku/core": "^0.12.148"
28
28
  },
29
29
  "dependencies": {
30
30
  "mongodb": "^7.7.0"