conductor-node 10.0.0 → 10.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -24,7 +24,7 @@
24
24
  "node": ">=16"
25
25
  },
26
26
  "dependencies": {
27
- "axios": "^1.4.0"
27
+ "axios": "^0.21.4 || ^1.4.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "axios-mock-adapter": "^1.21.4",
@@ -3,5 +3,9 @@ export interface RequestConfigWithStartTime extends AxiosRequestConfig {
3
3
  startTime: number;
4
4
  }
5
5
  export declare function addLoggingInterceptors(httpClient: AxiosInstance, verbose: boolean): void;
6
+ export declare function createRequestLogObject(config: AxiosRequestConfig): {
7
+ endpoint: string;
8
+ body?: Record<string, unknown>;
9
+ };
6
10
  export declare function getDurationStringFromConfig(config: RequestConfigWithStartTime): string;
7
11
  export declare function stringifyForLogs(object: unknown): string;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.stringifyForLogs = exports.getDurationStringFromConfig = exports.addLoggingInterceptors = void 0;
6
+ exports.stringifyForLogs = exports.getDurationStringFromConfig = exports.createRequestLogObject = exports.addLoggingInterceptors = void 0;
7
7
  const node_util_1 = __importDefault(require("node:util"));
8
8
  function addLoggingInterceptors(httpClient, verbose) {
9
9
  httpClient.interceptors.request.use((config) => {
@@ -31,12 +31,25 @@ function addLoggingInterceptors(httpClient, verbose) {
31
31
  }
32
32
  exports.addLoggingInterceptors = addLoggingInterceptors;
33
33
  function createRequestLogObject(config) {
34
- return {
35
- method: config.method?.toUpperCase(),
36
- endpoint: config.url,
37
- body: config.data,
38
- };
34
+ let endpoint = config.method?.toUpperCase();
35
+ if (config.url !== undefined) {
36
+ if (endpoint === undefined) {
37
+ endpoint = config.url;
38
+ }
39
+ else {
40
+ endpoint += ` ${config.url}`;
41
+ }
42
+ }
43
+ const requestInfo = {};
44
+ if (endpoint !== undefined) {
45
+ requestInfo.endpoint = endpoint;
46
+ }
47
+ if (config.data !== undefined) {
48
+ requestInfo.body = config.data;
49
+ }
50
+ return requestInfo;
39
51
  }
52
+ exports.createRequestLogObject = createRequestLogObject;
40
53
  function createResponseLogObject(response) {
41
54
  return {
42
55
  duration: getDurationStringFromConfig(response.config),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-node",
3
- "version": "10.0.0",
3
+ "version": "10.0.1",
4
4
  "description": "Easily integrate the entire QuickBooks Desktop API using fully-typed async TypeScript",
5
5
  "license": "MIT",
6
6
  "type": "commonjs",
@@ -24,7 +24,7 @@
24
24
  "node": ">=16"
25
25
  },
26
26
  "dependencies": {
27
- "axios": "^1.4.0"
27
+ "axios": "^0.21.4 || ^1.4.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "axios-mock-adapter": "^1.21.4",