@shushed/helpers 0.0.198-v2-20251110205114 → 0.0.198-v2-20251111082635

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.
@@ -269,22 +269,22 @@ function onResponse(config, options, requiredFlag) {
269
269
  return;
270
270
  }
271
271
  let responsePayload;
272
- if (outputBody?.headersToSet && outputBody?.body) {
273
- responsePayload = outputBody.body;
272
+ if (outputBody?.headersToSet && outputBody?.responses) {
273
+ responsePayload = outputBody.responses;
274
274
  }
275
275
  else {
276
276
  responsePayload = outputBody;
277
277
  }
278
278
  if (responsePayload && Array.isArray(responsePayload) && responsePayload.length === numberOfInputMessages) {
279
279
  return {
280
- status: (responsePayload.every(x => x instanceof Error) ? 500 : (outputStatus ? outputStatus : 200)),
280
+ status: headersToSet['retry-after'] ? 429 : (outputStatus ? outputStatus : ((responsePayload && responsePayload instanceof Error) ? 500 : 200)),
281
281
  value: responsePayload.map(x => {
282
- if (x.status && x.body) {
282
+ if (x && typeof x === 'object' && x.statusCode && x.body) {
283
283
  return x;
284
284
  }
285
285
  return {
286
- status: x instanceof Error ? (headersToSet['retry-after'] ? 429 : 500) : 200,
287
- body: x instanceof Error ? x.message : (flags.includes(requiredFlag || 'product-data') ? x : '<Redacted>. No product-data permissions>')
286
+ statusCode: x instanceof Error ? (headersToSet['retry-after'] ? 429 : 500) : 200,
287
+ body: x instanceof Error ? x.message : x,
288
288
  };
289
289
  })
290
290
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shushed/helpers",
3
- "version": "0.0.198-v2-20251110205114",
3
+ "version": "0.0.198-v2-20251111082635",
4
4
  "author": "",
5
5
  "license": "UNLICENSED",
6
6
  "description": "",