opensteer 0.8.17 → 0.8.18

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/index.cjs CHANGED
@@ -2392,6 +2392,16 @@ var opensteerNetworkQueryOutputSchema = objectSchema(
2392
2392
  required: ["records"]
2393
2393
  }
2394
2394
  );
2395
+ var opensteerNetworkDetailInputSchema = objectSchema(
2396
+ {
2397
+ recordId: stringSchema({ minLength: 1 }),
2398
+ probe: { type: "boolean" }
2399
+ },
2400
+ {
2401
+ title: "OpensteerNetworkDetailInput",
2402
+ required: ["recordId"]
2403
+ }
2404
+ );
2395
2405
  var opensteerParsedCookieSchema = objectSchema(
2396
2406
  {
2397
2407
  name: stringSchema({ minLength: 1 }),
@@ -6281,15 +6291,6 @@ var opensteerPageSnapshotOutputSchema = objectSchema(
6281
6291
  required: ["url", "title", "mode", "html", "counters"]
6282
6292
  }
6283
6293
  );
6284
- var opensteerNetworkDetailInputSchema = objectSchema(
6285
- {
6286
- recordId: stringSchema({ minLength: 1 })
6287
- },
6288
- {
6289
- title: "OpensteerNetworkDetailInput",
6290
- required: ["recordId"]
6291
- }
6292
- );
6293
6294
  var opensteerComputerMouseButtonSchema = enumSchema(
6294
6295
  ["left", "middle", "right"],
6295
6296
  {
@@ -27426,23 +27427,28 @@ function pickStorageDomainSnapshot(snapshot, domain) {
27426
27427
  return snapshot.domains.find((entry) => entry.domain === domain);
27427
27428
  }
27428
27429
  function buildFetchInput(url, options) {
27430
+ const { body, ...rest } = options;
27429
27431
  return {
27430
27432
  url,
27431
- ...options.method !== void 0 && { method: options.method },
27432
- ...options.headers !== void 0 && { headers: options.headers },
27433
- ...options.query !== void 0 && { query: options.query },
27434
- ...options.transport !== void 0 && { transport: options.transport },
27435
- ...options.cookies !== void 0 && { cookies: options.cookies },
27436
- ...options.followRedirects !== void 0 && { followRedirects: options.followRedirects },
27437
- ...options.body !== void 0 && { body: toRuntimeBody(options.body) }
27433
+ ...rest,
27434
+ ...body === void 0 ? {} : { body: normalizeFetchBody(body, rest.headers) }
27438
27435
  };
27439
27436
  }
27440
- function toRuntimeBody(body) {
27441
- try {
27442
- return { json: JSON.parse(body) };
27443
- } catch {
27444
- return { text: body };
27437
+ function normalizeFetchBody(body, headers) {
27438
+ if (typeof body !== "string") {
27439
+ return body;
27440
+ }
27441
+ const contentType = findHeaderValue2(headers, "content-type");
27442
+ return contentType === void 0 ? { text: body } : { text: body, contentType };
27443
+ }
27444
+ function findHeaderValue2(headers, headerName) {
27445
+ if (headers === void 0) {
27446
+ return void 0;
27445
27447
  }
27448
+ const match = Object.entries(headers).find(
27449
+ ([name]) => name.toLowerCase() === headerName.toLowerCase()
27450
+ );
27451
+ return match === void 0 ? void 0 : String(match[1]);
27446
27452
  }
27447
27453
  function toResponse(response) {
27448
27454
  return new Response(decodeBody(response), {