@kosdev-code/kos-ui-sdk 0.1.0-next.865 → 0.1.0-next.868

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.
@@ -6271,6 +6271,13 @@ async function clientRequest(endpoint, method, options, params2, body) {
6271
6271
  }
6272
6272
  return executeFetchWithRetry(fullUrl, fetchOptions, retryConfig);
6273
6273
  }
6274
+ function responseContext(response) {
6275
+ const headers = {};
6276
+ response.headers.forEach((value, key) => {
6277
+ headers[key] = value;
6278
+ });
6279
+ return { status: response.status, headers };
6280
+ }
6274
6281
  async function executeFetch(fullUrl, fetchOptions) {
6275
6282
  try {
6276
6283
  const response = await exports.kosFetch(fullUrl, fetchOptions);
@@ -6279,7 +6286,7 @@ async function executeFetch(fullUrl, fetchOptions) {
6279
6286
  return [`${response.statusText || ERROR_UNKNOWN}`, null, errorContext];
6280
6287
  }
6281
6288
  const payload = await response.json();
6282
- return [null, payload.data ?? payload];
6289
+ return [null, payload.data ?? payload, responseContext(response)];
6283
6290
  } catch (error) {
6284
6291
  if (isTransportNotReadyError(error)) {
6285
6292
  log$b.error(`Transport not ready, request not sent: ${fullUrl}`);
@@ -6306,7 +6313,7 @@ async function executeFetchWithRetry(fullUrl, fetchOptions, config2) {
6306
6313
  const response = await exports.kosFetch(fullUrl, fetchOptions);
6307
6314
  if (response.status >= 200 && response.status < 400) {
6308
6315
  const payload = await response.json();
6309
- return [null, payload.data ?? payload];
6316
+ return [null, payload.data ?? payload, responseContext(response)];
6310
6317
  }
6311
6318
  const errorContext = await captureErrorResponseContext(response);
6312
6319
  lastResult = [
@@ -13529,4 +13536,4 @@ exports.uuid = uuid;
13529
13536
  exports.waitForAppToStart = waitForAppToStart;
13530
13537
  exports.waitForAppsToStart = waitForAppsToStart;
13531
13538
  exports.whenReady = whenReady;
13532
- //# sourceMappingURL=index-D8aw-T5w.cjs.map
13539
+ //# sourceMappingURL=index-DsRhHHtS.cjs.map