@localisprimary/esi 2.0.12 → 2.0.14

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/client.d.ts CHANGED
@@ -1008,25 +1008,25 @@ export declare class EsiClient {
1008
1008
 
1009
1009
  * @see https://developers.eveonline.com/api-explorer#/operations/PostUiAutopilotWaypoint
1010
1010
  */
1011
- postUiAutopilotWaypoint(params?: Types.PostUiAutopilotWaypointParams): Promise<Types.EsiResponse<undefined, Types.PostUiAutopilotWaypointResponseHeaders>>;
1011
+ postUiAutopilotWaypoint(params: Types.PostUiAutopilotWaypointParams): Promise<Types.EsiResponse<undefined, Types.PostUiAutopilotWaypointResponseHeaders>>;
1012
1012
  /**
1013
1013
  * Open the contract window inside the client
1014
1014
 
1015
1015
  * @see https://developers.eveonline.com/api-explorer#/operations/PostUiOpenwindowContract
1016
1016
  */
1017
- postUiOpenwindowContract(params?: Types.PostUiOpenwindowContractParams): Promise<Types.EsiResponse<undefined, Types.PostUiOpenwindowContractResponseHeaders>>;
1017
+ postUiOpenwindowContract(params: Types.PostUiOpenwindowContractParams): Promise<Types.EsiResponse<undefined, Types.PostUiOpenwindowContractResponseHeaders>>;
1018
1018
  /**
1019
1019
  * Open the information window for a character, corporation or alliance inside the client
1020
1020
 
1021
1021
  * @see https://developers.eveonline.com/api-explorer#/operations/PostUiOpenwindowInformation
1022
1022
  */
1023
- postUiOpenwindowInformation(params?: Types.PostUiOpenwindowInformationParams): Promise<Types.EsiResponse<undefined, Types.PostUiOpenwindowInformationResponseHeaders>>;
1023
+ postUiOpenwindowInformation(params: Types.PostUiOpenwindowInformationParams): Promise<Types.EsiResponse<undefined, Types.PostUiOpenwindowInformationResponseHeaders>>;
1024
1024
  /**
1025
1025
  * Open the market details window for a specific typeID inside the client
1026
1026
 
1027
1027
  * @see https://developers.eveonline.com/api-explorer#/operations/PostUiOpenwindowMarketdetails
1028
1028
  */
1029
- postUiOpenwindowMarketdetails(params?: Types.PostUiOpenwindowMarketdetailsParams): Promise<Types.EsiResponse<undefined, Types.PostUiOpenwindowMarketdetailsResponseHeaders>>;
1029
+ postUiOpenwindowMarketdetails(params: Types.PostUiOpenwindowMarketdetailsParams): Promise<Types.EsiResponse<undefined, Types.PostUiOpenwindowMarketdetailsResponseHeaders>>;
1030
1030
  /**
1031
1031
  * Open the New Mail window, according to settings from the request if applicable
1032
1032
 
package/dist/client.js CHANGED
@@ -1,4 +1,4 @@
1
- const COMPATIBILITY_DATE = '2026-02-10';
1
+ const COMPATIBILITY_DATE = '2026-04-03';
2
2
  export class EsiClient {
3
3
  constructor(options) {
4
4
  this.baseUrl = 'https://esi.evetech.net';
@@ -39,23 +39,26 @@ export class EsiClient {
39
39
  const response = await fetch(url.toString(), {
40
40
  method,
41
41
  headers: this.useRequestHeaders ? headers : undefined,
42
- body: body ? JSON.stringify(body) : undefined,
42
+ body: body === undefined ? undefined : JSON.stringify(body),
43
43
  });
44
+ const responseText = await response.text();
44
45
  if (!response.ok) {
45
46
  let error = 'Request failed';
46
- try {
47
- const errorData = await response.json();
48
- error = errorData.error || error;
47
+ if (responseText) {
48
+ try {
49
+ const errorData = JSON.parse(responseText);
50
+ error = errorData.error || error;
51
+ }
52
+ catch { }
49
53
  }
50
- catch { }
51
54
  throw {
52
55
  error,
53
56
  status: response.status,
54
57
  };
55
58
  }
56
- const data = await response.json();
59
+ const data = responseText ? JSON.parse(responseText) : undefined;
57
60
  return {
58
- data,
61
+ data: data,
59
62
  status: response.status,
60
63
  headers: Object.fromEntries(response.headers.entries()),
61
64
  };
@@ -1646,13 +1649,11 @@ export class EsiClient {
1646
1649
  */
1647
1650
  async postUiAutopilotWaypoint(params) {
1648
1651
  const path = `/ui/autopilot/waypoint`;
1649
- const queryParams = params
1650
- ? {
1651
- add_to_beginning: params.add_to_beginning,
1652
- clear_other_waypoints: params.clear_other_waypoints,
1653
- destination_id: params.destination_id,
1654
- }
1655
- : undefined;
1652
+ const queryParams = {
1653
+ add_to_beginning: params.add_to_beginning,
1654
+ clear_other_waypoints: params.clear_other_waypoints,
1655
+ destination_id: params.destination_id,
1656
+ };
1656
1657
  return this.request('POST', path, queryParams, undefined);
1657
1658
  }
1658
1659
  /**
@@ -1662,7 +1663,7 @@ export class EsiClient {
1662
1663
  */
1663
1664
  async postUiOpenwindowContract(params) {
1664
1665
  const path = `/ui/openwindow/contract`;
1665
- const queryParams = params ? { contract_id: params.contract_id } : undefined;
1666
+ const queryParams = { contract_id: params.contract_id };
1666
1667
  return this.request('POST', path, queryParams, undefined);
1667
1668
  }
1668
1669
  /**
@@ -1672,7 +1673,7 @@ export class EsiClient {
1672
1673
  */
1673
1674
  async postUiOpenwindowInformation(params) {
1674
1675
  const path = `/ui/openwindow/information`;
1675
- const queryParams = params ? { target_id: params.target_id } : undefined;
1676
+ const queryParams = { target_id: params.target_id };
1676
1677
  return this.request('POST', path, queryParams, undefined);
1677
1678
  }
1678
1679
  /**
@@ -1682,7 +1683,7 @@ export class EsiClient {
1682
1683
  */
1683
1684
  async postUiOpenwindowMarketdetails(params) {
1684
1685
  const path = `/ui/openwindow/marketdetails`;
1685
- const queryParams = params ? { type_id: params.type_id } : undefined;
1686
+ const queryParams = { type_id: params.type_id };
1686
1687
  return this.request('POST', path, queryParams, undefined);
1687
1688
  }
1688
1689
  /**