@arrowsphere/api-client 3.190.0-rc-bdj-1 → 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,16 +106,11 @@ 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];
112
113
  };
113
- export declare enum CustomerAnonymizeContactsPayloadFields {
114
- COLUMN_CONTACTS = "contacts"
115
- }
116
- export declare type CustomerAnonymizeContactsPayload = {
117
- [CustomerAnonymizeContactsPayloadFields.COLUMN_CONTACTS]: number[];
118
- };
119
114
  export declare class CustomersClient extends AbstractRestfulClient {
120
115
  /**
121
116
  * The base path of the API
@@ -140,5 +135,4 @@ export declare class CustomersClient extends AbstractRestfulClient {
140
135
  cancelCustomerMigration(customerReference: string, program: string): Promise<void | APIResponseError>;
141
136
  postCustomerProvision(customerReference: string, payload: PostCustomerMigrationPayload): Promise<void>;
142
137
  getCustomerProvision(customerReference: string, program: string): Promise<GetResult<CustomerProvision>>;
143
- anonymizeContacts(customerReference: string, payload: CustomerAnonymizeContactsPayload, parameters?: Parameters): Promise<void>;
144
138
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CustomersClient = exports.CustomerAnonymizeContactsPayloadFields = exports.PostCustomerInvitationFields = exports.CustomerContactPayloadFields = exports.CustomerMigrationPayloadFields = exports.CustomerMigrationAttributeFields = void 0;
3
+ exports.CustomersClient = exports.PostCustomerInvitationFields = exports.CustomerContactPayloadFields = exports.CustomerMigrationPayloadFields = exports.CustomerMigrationAttributeFields = void 0;
4
4
  const abstractRestfulClient_1 = require("../abstractRestfulClient");
5
5
  const getResult_1 = require("../getResult");
6
6
  const dataCustomers_1 = require("./entities/dataCustomers");
@@ -38,10 +38,6 @@ var PostCustomerInvitationFields;
38
38
  PostCustomerInvitationFields["COLUMN_CONTACT_ID"] = "contactId";
39
39
  PostCustomerInvitationFields["COLUMN_POLICY"] = "policy";
40
40
  })(PostCustomerInvitationFields = exports.PostCustomerInvitationFields || (exports.PostCustomerInvitationFields = {}));
41
- var CustomerAnonymizeContactsPayloadFields;
42
- (function (CustomerAnonymizeContactsPayloadFields) {
43
- CustomerAnonymizeContactsPayloadFields["COLUMN_CONTACTS"] = "contacts";
44
- })(CustomerAnonymizeContactsPayloadFields = exports.CustomerAnonymizeContactsPayloadFields || (exports.CustomerAnonymizeContactsPayloadFields = {}));
45
41
  class CustomersClient extends abstractRestfulClient_1.AbstractRestfulClient {
46
42
  constructor() {
47
43
  super(...arguments);
@@ -127,10 +123,6 @@ class CustomersClient extends abstractRestfulClient_1.AbstractRestfulClient {
127
123
  this.path = `/${customerReference}/provision`;
128
124
  return new getResult_1.GetResult(customerProvision_1.CustomerProvision, await this.get({ program }));
129
125
  }
130
- async anonymizeContacts(customerReference, payload, parameters = {}) {
131
- this.path = `/${customerReference}/contact/anonymize`;
132
- await this.patch(payload, parameters);
133
- }
134
126
  }
135
127
  exports.CustomersClient = CustomersClient;
136
128
  //# sourceMappingURL=customersClient.js.map
@@ -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
  }
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-1",
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",