@arrowsphere/api-client 3.190.0-rc-bdj-2 → 3.190.0

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/CHANGELOG.md CHANGED
@@ -3,6 +3,11 @@
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4
4
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
5
5
 
6
+ ## [3.190.0] - 2025.04.28
7
+
8
+ ### Updated
9
+ - [Error] update error messages to be more descriptive
10
+
6
11
  ## [3.189.0] - 2025.04.23
7
12
 
8
13
  ### Added
@@ -143,10 +143,14 @@ class AbstractRestfulClient extends AbstractHttpClient_1.AbstractHttpClient {
143
143
  }
144
144
  const statusCode = response.status;
145
145
  if (statusCode === 404) {
146
- throw new exception_1.NotFoundException(`Resource not found on URL ${this.getUrl()}`, response.data.error, statusCode);
146
+ throw new exception_1.NotFoundException(response.data.messages, response.data.error, statusCode, {
147
+ origin: `Resource not found on URL ${this.getUrl()}${this.basePath}${this.path}`,
148
+ });
147
149
  }
148
150
  if (statusCode >= 400 && statusCode <= 599) {
149
- throw new exception_1.PublicApiClientException(`Error: status code: ${statusCode}. URL: ${this.getUrl()}`, response.data.error, statusCode);
151
+ throw new exception_1.PublicApiClientException(response.data.messages, response.data.error, statusCode, {
152
+ origin: `Error: status code: ${statusCode}. URL: ${this.getUrl()}${this.basePath}${this.path}`,
153
+ });
150
154
  }
151
155
  return response.data;
152
156
  }
@@ -106,6 +106,7 @@ export declare type APIResponseCustomerMigration = {
106
106
  export interface APIResponseError {
107
107
  status: number;
108
108
  error: string;
109
+ messages: string;
109
110
  }
110
111
  export declare type PatchCustomerContactPayload = {
111
112
  [Property in keyof PostCustomerContactPayload]?: PostCustomerContactPayload[Property];
@@ -1,5 +1,6 @@
1
1
  export declare class NotFoundException extends Error {
2
2
  httpCode: number;
3
3
  httpError: string;
4
- constructor(message: string, httpError?: string, httpCode?: number);
4
+ config?: Record<string, unknown>;
5
+ constructor(message: string, httpError?: string, httpCode?: number, config?: Record<string, unknown>);
5
6
  }
@@ -2,10 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotFoundException = void 0;
4
4
  class NotFoundException extends Error {
5
- constructor(message, httpError = '', httpCode = 0) {
5
+ constructor(message, httpError = '', httpCode = 0, config = {}) {
6
6
  super(message);
7
7
  this.httpCode = httpCode;
8
8
  this.httpError = httpError;
9
+ this.config = config;
9
10
  }
10
11
  }
11
12
  exports.NotFoundException = NotFoundException;
@@ -1,6 +1,6 @@
1
1
  export declare class PublicApiClientException extends Error {
2
2
  httpCode: number;
3
3
  httpError: string;
4
- config?: unknown;
5
- constructor(message: string, httpError?: string, httpCode?: number, config?: {});
4
+ config?: Record<string, unknown>;
5
+ constructor(message: string, httpError?: string, httpCode?: number, config?: Record<string, unknown>);
6
6
  }
@@ -1,6 +1,5 @@
1
1
  import { EndCustomerType } from './company';
2
2
  import { OrganizationUnitsType } from './organizationUnit';
3
- import { UserType } from './user';
4
3
  export declare type ContactsType = {
5
4
  id?: number;
6
5
  active?: boolean;
@@ -19,7 +18,6 @@ export declare type ContactsType = {
19
18
  username?: string;
20
19
  type?: ContactTypeType;
21
20
  role?: ContactRole;
22
- user?: UserType;
23
21
  };
24
22
  declare type ContactRole = {
25
23
  id?: number;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "type": "git",
5
5
  "url": "https://github.com/ArrowSphere/nodejs-api-client.git"
6
6
  },
7
- "version": "3.190.0-rc-bdj-2",
7
+ "version": "3.190.0",
8
8
  "description": "Node.js client for ArrowSphere's public API",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",