Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
drudge committed Apr 27, 2023
1 parent b9953f1 commit e02ef49
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
13 changes: 6 additions & 7 deletions nodes/NetSuite/NetSuite.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ import {

import { makeRequest } from '@fye/netsuite-rest-api';

import * as pLimit from 'p-limit';
import { response } from 'express';
import pLimit from 'p-limit';

const debug = debuglog('n8n-nodes-netsuite');

Expand All @@ -35,7 +34,7 @@ const handleNetsuiteResponse = (fns: IExecuteFunctions, response: INetSuiteRespo
let body: JsonObject = {};
const {
title: webTitle = undefined,
code: restletCode = undefined,
// code: restletCode = undefined,
'o:errorCode': webCode,
'o:errorDetails': webDetails,
message: restletMessage = undefined,
Expand All @@ -46,7 +45,7 @@ const handleNetsuiteResponse = (fns: IExecuteFunctions, response: INetSuiteRespo
message = webDetails[0].detail || message;
}
if (fns.continueOnFail() !== true) {
const code = webCode || restletCode;
// const code = webCode || restletCode;
const error = new NodeApiError(fns.getNode(), response.body);
error.message = message;
throw error;
Expand Down Expand Up @@ -138,7 +137,7 @@ export class NetSuite implements INodeType {
nodeContext.count = limit;
nodeContext.offset = offset;
// debug('requestData', requestData);
while ((returnAll || returnData.length < limit) && hasMore === true) {
while ((returnAll || returnData.length < limit) && hasMore === true) {
const response = await makeRequest(getConfig(credentials), requestData);
const body: JsonObject = handleNetsuiteResponse(fns, response);
const { hasMore: doContinue, items, links, offset, count, totalResults } = (body.json as INetSuitePagedBody);
Expand Down Expand Up @@ -199,7 +198,7 @@ export class NetSuite implements INodeType {
nodeContext.count = limit;
nodeContext.offset = offset;
debug('requestData', requestData);
while ((returnAll || returnData.length < limit) && hasMore === true) {
while ((returnAll || returnData.length < limit) && hasMore === true) {
const response = await makeRequest(config, requestData);
const body: JsonObject = handleNetsuiteResponse(fns, response);
const { hasMore: doContinue, items, links, count, totalResults, offset } = (body.json as INetSuitePagedBody);
Expand Down Expand Up @@ -328,7 +327,7 @@ export class NetSuite implements INodeType {
}

if (nodeOptions.fullResponse) {
return {
return {
json: {
statusCode: response.statusCode,
headers: response.headers,
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "n8n-nodes-netsuite",
"version": "0.7.4",
"version": "0.7.5",
"description": "n8n node for NetSuite using the REST API",
"license": "MIT",
"homepage": "https://github.com/drudge/n8n-nodes-netsuite",
Expand Down Expand Up @@ -46,11 +46,12 @@
"devDependencies": {
"@types/express": "^4.17.6",
"@types/jest": "^26.0.13",
"@types/luxon": "^3.3.0",
"@types/node": "^14.17.27",
"@types/request-promise-native": "~1.0.15",
"@typescript-eslint/eslint-plugin": "^5.29.0",
"@typescript-eslint/eslint-plugin-tslint": "^5.29.0",
"@typescript-eslint/parser": "^5.29.0",
"@typescript-eslint/parser": "~5.45",
"eslint": "^8.18.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.3.3",
Expand All @@ -61,7 +62,7 @@
"n8n-workflow": "*",
"nodelinter": "^0.1.9",
"ts-jest": "^26.3.0",
"typescript": "~4.3.5"
"typescript": "~4.8.4"
},
"dependencies": {
"@fye/netsuite-rest-api": "^2.0.0",
Expand Down
32 changes: 14 additions & 18 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,29 @@
{
"compilerOptions": {
"lib": [
"es2017",
"es2019.array"
],
"types": [
"node",
"jest"
],
"strict": true,
"module": "commonjs",
"noImplicitAny": true,
"moduleResolution": "node",
"target": "es2019",
"lib": ["es2019", "es2020"],
"removeComments": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"strictNullChecks": true,
"strict": true,
"preserveConstEnums": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"declaration": true,
"sourceMap": true,
"skipLibCheck": true,
"outDir": "./dist/",
"target": "es2017",
"sourceMap": true
},
"include": [
"credentials/**/*",
"src/**/*",
"nodes/**/*",
"nodes/**/*.json",
"test/**/*"
"package.json",
],
"exclude": [
"**/*.spec.ts"
]
}
}

0 comments on commit e02ef49

Please sign in to comment.