@camstack/server 1.2.90 → 1.2.92

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.
@@ -8770,6 +8770,24 @@ function createCapRouter_terminalSession(getProvider, createRemoteProxy) {
8770
8770
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
8771
8771
  return p.resize(methodInput);
8772
8772
  }),
8773
+ pullOutput: trpc_middleware_js_1.adminProcedure
8774
+ .input(types_109.terminalSessionCapability.methods.pullOutput.input.loose())
8775
+ .output(types_109.terminalSessionCapability.methods.pullOutput.output)
8776
+ .mutation(async ({ input, ctx }) => {
8777
+ const { nodeId, ...methodInput } = input;
8778
+ const p = resolveProvider('terminal-session', nodeId, () => getProvider(ctx), createRemoteProxy);
8779
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
8780
+ return p.pullOutput(methodInput);
8781
+ }),
8782
+ writeInput: trpc_middleware_js_1.adminProcedure
8783
+ .input(types_109.terminalSessionCapability.methods.writeInput.input.loose())
8784
+ .output(types_109.terminalSessionCapability.methods.writeInput.output)
8785
+ .mutation(async ({ input, ctx }) => {
8786
+ const { nodeId, ...methodInput } = input;
8787
+ const p = resolveProvider('terminal-session', nodeId, () => getProvider(ctx), createRemoteProxy);
8788
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument
8789
+ return p.writeInput(methodInput);
8790
+ }),
8773
8791
  close: trpc_middleware_js_1.adminProcedure
8774
8792
  .input(types_109.terminalSessionCapability.methods.close.input.loose())
8775
8793
  .output(types_109.terminalSessionCapability.methods.close.output)
package/dist/main.js CHANGED
@@ -867,12 +867,18 @@ async function bootstrap() {
867
867
  const upstreamPath = `/${subPath}${queryString}`;
868
868
  // Take over the socket — `proxyToUpstream` drives the raw response.
869
869
  reply.hijack();
870
+ const replayBody = request.body === undefined
871
+ ? undefined
872
+ : Buffer.isBuffer(request.body)
873
+ ? request.body
874
+ : Buffer.from(typeof request.body === 'string' ? request.body : JSON.stringify(request.body));
870
875
  (0, system_3.proxyToUpstream)({
871
876
  baseUrl: dpMatch.endpoint.baseUrl,
872
877
  secret: dpMatch.endpoint.secret,
873
878
  upstreamPath,
874
879
  clientReq: request.raw,
875
880
  clientRes: reply.raw,
881
+ ...(replayBody !== undefined ? { replayBody } : {}),
876
882
  });
877
883
  return;
878
884
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.90",
3
+ "version": "1.2.92",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",