redfireforge-cli 0.8.5 → 0.8.7

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.
@@ -38555,19 +38555,43 @@ function toGrpcApiClientErrorFromUnaryResult(result) {
38555
38555
  }
38556
38556
 
38557
38557
  // src/shared/grpc/grpcExpressProxyJsonTransport.ts
38558
- async function expressGrpcProxyJsonFetch(path, init, op = "stream_start") {
38559
- const response = await fetch(path, init);
38560
- const body = await response.text();
38561
- let parsed;
38558
+ function resolveGrpcExpressProxyUrl(path) {
38559
+ return isTauri() ? resolveCompanionServerUrl(path) : path;
38560
+ }
38561
+ function headersFromInit(init) {
38562
+ const headers = { Accept: "application/json" };
38563
+ if (init.headers && typeof init.headers === "object" && !Array.isArray(init.headers) && !(init.headers instanceof Headers)) {
38564
+ Object.assign(headers, init.headers);
38565
+ }
38566
+ return headers;
38567
+ }
38568
+ function parseExpressProxyJsonBody(op, body, status) {
38562
38569
  try {
38563
- parsed = JSON.parse(body);
38570
+ return JSON.parse(body);
38564
38571
  } catch {
38565
- throw new GrpcApiClientError(op, `gRPC ${op} transport returned non-JSON response (HTTP ${response.status})`, {
38572
+ throw new GrpcApiClientError(op, `gRPC ${op} transport returned non-JSON response (HTTP ${status})`, {
38566
38573
  code: "GRPC_INVALID_ENVELOPE",
38567
38574
  retryable: false
38568
38575
  });
38569
38576
  }
38570
- return parsed;
38577
+ }
38578
+ async function expressGrpcProxyJsonFetch(path, init, op = "stream_start") {
38579
+ if (isTauri()) {
38580
+ const method = init.method ?? "GET";
38581
+ const headers = headersFromInit(init);
38582
+ const bodyText = typeof init.body === "string" ? init.body : void 0;
38583
+ const response2 = await httpFetch(path, method, headers, bodyText, init.signal ?? void 0);
38584
+ if (response2.error) {
38585
+ throw new GrpcApiClientError(op, response2.error, {
38586
+ code: "GRPC_NETWORK_ERROR",
38587
+ retryable: true
38588
+ });
38589
+ }
38590
+ return parseExpressProxyJsonBody(op, response2.body, response2.status);
38591
+ }
38592
+ const response = await fetch(path, init);
38593
+ const body = await response.text();
38594
+ return parseExpressProxyJsonBody(op, body, response.status);
38571
38595
  }
38572
38596
  function throwIfNotOk2(op, envelope) {
38573
38597
  if (!envelope.ok) {
@@ -40104,7 +40128,9 @@ function openGrpcStreamEventsViaSse(streamId, tabId, options) {
40104
40128
  const query = buildGrpcStreamQuery(tabId, {
40105
40129
  lastSequence: options.resolveLastSequence?.() ?? options.lastSequence
40106
40130
  });
40107
- const url = `/api/grpc/stream/${encodeURIComponent(streamId)}/events?${query}`;
40131
+ const url = resolveGrpcExpressProxyUrl(
40132
+ `/api/grpc/stream/${encodeURIComponent(streamId)}/events?${query}`
40133
+ );
40108
40134
  try {
40109
40135
  const response = await fetch(url, {
40110
40136
  method: "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redfireforge-cli",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
4
4
  "description": "RedfireForge CLI — API Performance Testing from the Command Line",
5
5
  "keywords": [
6
6
  "api",