redfireforge-cli 0.8.6 → 0.8.8

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.
@@ -19384,6 +19384,44 @@ var init_dist_js2 = __esm({
19384
19384
  }
19385
19385
  });
19386
19386
 
19387
+ // src/shared/utils/tauriStore.ts
19388
+ async function ensureReady() {
19389
+ if (ready) return;
19390
+ const fs = await Promise.resolve().then(() => (init_dist_js2(), dist_js_exports2));
19391
+ const { appDataDir: appDataDir2 } = await Promise.resolve().then(() => (init_path(), path_exports));
19392
+ fsModule = fs;
19393
+ appDirPath = await appDataDir2();
19394
+ try {
19395
+ await fs.mkdir(appDirPath, { recursive: true });
19396
+ } catch {
19397
+ }
19398
+ ready = true;
19399
+ }
19400
+ function keyToFile(key) {
19401
+ const sep2 = appDirPath.endsWith("/") ? "" : "/";
19402
+ return `${appDirPath}${sep2}${key}.json`;
19403
+ }
19404
+ async function getItem(key) {
19405
+ await ensureReady();
19406
+ try {
19407
+ return await fsModule.readTextFile(keyToFile(key));
19408
+ } catch {
19409
+ return null;
19410
+ }
19411
+ }
19412
+ async function setItem(key, value) {
19413
+ await ensureReady();
19414
+ await fsModule.writeTextFile(keyToFile(key), value);
19415
+ }
19416
+ var fsModule, appDirPath, ready;
19417
+ var init_tauriStore = __esm({
19418
+ "src/shared/utils/tauriStore.ts"() {
19419
+ fsModule = null;
19420
+ appDirPath = null;
19421
+ ready = false;
19422
+ }
19423
+ });
19424
+
19387
19425
  // node_modules/lz-string/libs/lz-string.js
19388
19426
  var require_lz_string = __commonJS({
19389
19427
  "node_modules/lz-string/libs/lz-string.js"(exports, module) {
@@ -38555,19 +38593,43 @@ function toGrpcApiClientErrorFromUnaryResult(result) {
38555
38593
  }
38556
38594
 
38557
38595
  // 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;
38596
+ function resolveGrpcExpressProxyUrl(path) {
38597
+ return isTauri() ? resolveCompanionServerUrl(path) : path;
38598
+ }
38599
+ function headersFromInit(init) {
38600
+ const headers = { Accept: "application/json" };
38601
+ if (init.headers && typeof init.headers === "object" && !Array.isArray(init.headers) && !(init.headers instanceof Headers)) {
38602
+ Object.assign(headers, init.headers);
38603
+ }
38604
+ return headers;
38605
+ }
38606
+ function parseExpressProxyJsonBody(op, body, status) {
38562
38607
  try {
38563
- parsed = JSON.parse(body);
38608
+ return JSON.parse(body);
38564
38609
  } catch {
38565
- throw new GrpcApiClientError(op, `gRPC ${op} transport returned non-JSON response (HTTP ${response.status})`, {
38610
+ throw new GrpcApiClientError(op, `gRPC ${op} transport returned non-JSON response (HTTP ${status})`, {
38566
38611
  code: "GRPC_INVALID_ENVELOPE",
38567
38612
  retryable: false
38568
38613
  });
38569
38614
  }
38570
- return parsed;
38615
+ }
38616
+ async function expressGrpcProxyJsonFetch(path, init, op = "stream_start") {
38617
+ if (isTauri()) {
38618
+ const method = init.method ?? "GET";
38619
+ const headers = headersFromInit(init);
38620
+ const bodyText = typeof init.body === "string" ? init.body : void 0;
38621
+ const response2 = await httpFetch(path, method, headers, bodyText, init.signal ?? void 0);
38622
+ if (response2.error) {
38623
+ throw new GrpcApiClientError(op, response2.error, {
38624
+ code: "GRPC_NETWORK_ERROR",
38625
+ retryable: true
38626
+ });
38627
+ }
38628
+ return parseExpressProxyJsonBody(op, response2.body, response2.status);
38629
+ }
38630
+ const response = await fetch(path, init);
38631
+ const body = await response.text();
38632
+ return parseExpressProxyJsonBody(op, body, response.status);
38571
38633
  }
38572
38634
  function throwIfNotOk2(op, envelope) {
38573
38635
  if (!envelope.ok) {
@@ -40104,7 +40166,9 @@ function openGrpcStreamEventsViaSse(streamId, tabId, options) {
40104
40166
  const query = buildGrpcStreamQuery(tabId, {
40105
40167
  lastSequence: options.resolveLastSequence?.() ?? options.lastSequence
40106
40168
  });
40107
- const url = `/api/grpc/stream/${encodeURIComponent(streamId)}/events?${query}`;
40169
+ const url = resolveGrpcExpressProxyUrl(
40170
+ `/api/grpc/stream/${encodeURIComponent(streamId)}/events?${query}`
40171
+ );
40108
40172
  try {
40109
40173
  const response = await fetch(url, {
40110
40174
  method: "GET",
@@ -42239,38 +42303,8 @@ function captureGrpcLoadTestExecuteSnapshot(input) {
42239
42303
  // src/shared/utils/scenarioMigration.ts
42240
42304
  import { v4 as uuidv43 } from "uuid";
42241
42305
 
42242
- // src/shared/utils/tauriStore.ts
42243
- var fsModule = null;
42244
- var appDirPath = null;
42245
- var ready = false;
42246
- async function ensureReady() {
42247
- if (ready) return;
42248
- const fs = await Promise.resolve().then(() => (init_dist_js2(), dist_js_exports2));
42249
- const { appDataDir: appDataDir2 } = await Promise.resolve().then(() => (init_path(), path_exports));
42250
- fsModule = fs;
42251
- appDirPath = await appDataDir2();
42252
- try {
42253
- await fs.mkdir(appDirPath, { recursive: true });
42254
- } catch {
42255
- }
42256
- ready = true;
42257
- }
42258
- function keyToFile(key) {
42259
- const sep2 = appDirPath.endsWith("/") ? "" : "/";
42260
- return `${appDirPath}${sep2}${key}.json`;
42261
- }
42262
- async function getItem(key) {
42263
- await ensureReady();
42264
- try {
42265
- return await fsModule.readTextFile(keyToFile(key));
42266
- } catch {
42267
- return null;
42268
- }
42269
- }
42270
- async function setItem(key, value) {
42271
- await ensureReady();
42272
- await fsModule.writeTextFile(keyToFile(key), value);
42273
- }
42306
+ // src/shared/utils/storage.ts
42307
+ init_tauriStore();
42274
42308
 
42275
42309
  // src/shared/utils/idbOpen.ts
42276
42310
  var DB_NAME = "redfireforge";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redfireforge-cli",
3
- "version": "0.8.6",
3
+ "version": "0.8.8",
4
4
  "description": "RedfireForge CLI — API Performance Testing from the Command Line",
5
5
  "keywords": [
6
6
  "api",