@getlimelight/sdk 0.4.2 → 0.4.4

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.d.mts CHANGED
@@ -470,6 +470,9 @@ interface ParsedStackTrace {
470
470
  raw: string;
471
471
  }
472
472
 
473
+ /**
474
+ * Configuration for making a request.
475
+ */
473
476
  interface RequestBridgeConfig {
474
477
  url: string;
475
478
  method?: HttpMethod | string;
@@ -483,6 +486,9 @@ interface RequestBridgeConfig {
483
486
  query?: string;
484
487
  };
485
488
  }
489
+ /**
490
+ * Configuration for mocking a response.
491
+ */
486
492
  interface ResponseBridgeConfig {
487
493
  status: number;
488
494
  statusText?: string;
package/dist/index.d.ts CHANGED
@@ -470,6 +470,9 @@ interface ParsedStackTrace {
470
470
  raw: string;
471
471
  }
472
472
 
473
+ /**
474
+ * Configuration for making a request.
475
+ */
473
476
  interface RequestBridgeConfig {
474
477
  url: string;
475
478
  method?: HttpMethod | string;
@@ -483,6 +486,9 @@ interface RequestBridgeConfig {
483
486
  query?: string;
484
487
  };
485
488
  }
489
+ /**
490
+ * Configuration for mocking a response.
491
+ */
486
492
  interface ResponseBridgeConfig {
487
493
  status: number;
488
494
  statusText?: string;
package/dist/index.js CHANGED
@@ -238,9 +238,9 @@ var parseGraphQL = (body) => {
238
238
  // src/helpers/graphql/normalizeOperationType.ts
239
239
  var normalizeOperationType = (type) => {
240
240
  if (!type) return null;
241
- if (type === "query") return "query";
242
- if (type === "mutation") return "mutation";
243
- if (type === "subscription") return "subscription";
241
+ if (type === "query") return "QUERY" /* QUERY */;
242
+ if (type === "mutation") return "MUTATION" /* MUTATION */;
243
+ if (type === "subscription") return "SUBSCRIPTION" /* SUB */;
244
244
  return type;
245
245
  };
246
246
 
@@ -267,7 +267,7 @@ var SENSITIVE_HEADERS = [
267
267
  var LIMELIGHT_WEB_WSS_URL = "wss://api.getlimelight.io";
268
268
  var LIMELIGHT_DESKTOP_WSS_URL = "ws://localhost:8484";
269
269
  var WS_PATH = "/limelight";
270
- var SDK_VERSION = true ? "0.4.2" : "test-version";
270
+ var SDK_VERSION = true ? "0.4.4" : "test-version";
271
271
  var RENDER_THRESHOLDS = {
272
272
  HOT_VELOCITY: 5,
273
273
  HIGH_RENDER_COUNT: 50,
@@ -1965,10 +1965,18 @@ var RequestBridge = class {
1965
1965
  const requestId = generateRequestId();
1966
1966
  const startTime = Date.now();
1967
1967
  this.pendingRequests.set(requestId, { startTime, config });
1968
+ let bodyToSerialize = config.body;
1969
+ if (config.graphql && !config.body) {
1970
+ bodyToSerialize = JSON.stringify({
1971
+ operationName: config.graphql.operationName,
1972
+ variables: config.graphql.variables,
1973
+ query: config.graphql.query
1974
+ });
1975
+ }
1968
1976
  const method = config.method?.toUpperCase() || "POST";
1969
1977
  const headers = config.headers || {};
1970
1978
  const requestBody = serializeBody(
1971
- typeof config.body === "string" ? config.body : JSON.stringify(config.body),
1979
+ typeof bodyToSerialize === "string" ? bodyToSerialize : JSON.stringify(bodyToSerialize),
1972
1980
  this.config?.disableBodyCapture
1973
1981
  );
1974
1982
  let requestEvent = {