@foxnose/sdk 0.6.0 → 0.6.1
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 +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -219,6 +219,7 @@ function getHeader(headers, name) {
|
|
|
219
219
|
}
|
|
220
220
|
return void 0;
|
|
221
221
|
}
|
|
222
|
+
var CONTENT_VALIDATION_CODES = /* @__PURE__ */ new Set(["content_validation_failed", "data_validation_error"]);
|
|
222
223
|
function buildAPIError(options) {
|
|
223
224
|
const { statusCode, errorCode, detail, responseHeaders, responseBody } = options;
|
|
224
225
|
const body = isPlainObject(responseBody) ? responseBody : void 0;
|
|
@@ -264,7 +265,7 @@ function buildAPIError(options) {
|
|
|
264
265
|
if (statusCode === 409 && errorCode === "external_id_conflict") {
|
|
265
266
|
return new ExternalIdConflictError(options);
|
|
266
267
|
}
|
|
267
|
-
if (statusCode === 422 && errorCode
|
|
268
|
+
if (statusCode === 422 && CONTENT_VALIDATION_CODES.has(errorCode)) {
|
|
268
269
|
const d = isPlainObject(detail) ? detail : {};
|
|
269
270
|
const errors = Array.isArray(d.errors) ? d.errors : typeof d.json_path === "string" ? [d] : [];
|
|
270
271
|
return new ContentValidationFailedError({
|
|
@@ -362,7 +363,7 @@ var DEFAULT_RETRY_CONFIG = {
|
|
|
362
363
|
statusCodes: [408, 425, 429, 500, 502, 503, 504],
|
|
363
364
|
methods: ["GET", "HEAD", "OPTIONS", "PUT", "DELETE"]
|
|
364
365
|
};
|
|
365
|
-
var SDK_VERSION = "0.6.
|
|
366
|
+
var SDK_VERSION = "0.6.1";
|
|
366
367
|
var DEFAULT_USER_AGENT = `foxnose-sdk-js/${SDK_VERSION}`;
|
|
367
368
|
function createConfig(options) {
|
|
368
369
|
if (!options.baseUrl) {
|