@ontemper/edi 1.1.2-beta.1 → 1.1.2

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -93,8 +93,14 @@ class TemperEdiClient {
93
93
  message: 'Unauthorized access to EDI service. Reach out to support.',
94
94
  code: 'edi_unauthorized_error',
95
95
  });
96
+ // Gateway normalises EdiFabric's camelCase to PascalCase before forwarding
96
97
  const responseData = error.response?.data;
97
- const details = responseData?.Details;
98
+ const details = typeof responseData === 'object' &&
99
+ responseData !== null &&
100
+ 'Details' in responseData &&
101
+ Array.isArray(responseData.Details)
102
+ ? responseData.Details
103
+ : undefined;
98
104
  const message = error.response?.status === 400 && details?.length
99
105
  ? `EDI validation failed: ${details.join('; ')}`
100
106
  : responseData && typeof responseData === 'object'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ontemper/edi",
3
3
  "description": "An EDI client with structured logging.",
4
- "version": "1.1.2-beta.1",
4
+ "version": "1.1.2",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "axios": "1.13.6",
33
- "unnbound-logger-sdk": "^3.0.36"
33
+ "unnbound-logger-sdk": "workspace:*"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/jest": "^29.5.12",