n8n-nodes-autotask 0.6.9 → 0.7.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/README.md +1 -1
- package/dist/nodes/Autotask/constants/api.d.ts +0 -3
- package/dist/nodes/Autotask/constants/api.js +0 -3
- package/dist/nodes/Autotask/constants/api.js.map +1 -1
- package/dist/nodes/Autotask/helpers/errorHandler.d.ts +9 -0
- package/dist/nodes/Autotask/helpers/errorHandler.js +100 -167
- package/dist/nodes/Autotask/helpers/errorHandler.js.map +1 -1
- package/dist/nodes/Autotask/helpers/http/rateLimit.d.ts +2 -2
- package/dist/nodes/Autotask/helpers/http/rateLimit.js +20 -15
- package/dist/nodes/Autotask/helpers/http/rateLimit.js.map +1 -1
- package/dist/nodes/Autotask/helpers/http/request.js +141 -120
- package/dist/nodes/Autotask/helpers/http/request.js.map +1 -1
- package/dist/nodes/Autotask/helpers/webhook/resources.js +1 -1
- package/dist/nodes/Autotask/helpers/webhook/resources.js.map +1 -1
- package/dist/nodes/Autotask/types/base/errors.d.ts +21 -0
- package/dist/nodes/Autotask/types/base/errors.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -13
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# n8n-nodes-autotask
|
|
2
2
|
|
|
3
|
-

|
|
4
4
|

|
|
5
5
|
|
|
6
6
|
> **IMPORTANT**: After updating this node to a new version, a restart of your n8n instance is highly recommended to ensure all changes are properly applied.
|
|
@@ -12,9 +12,6 @@ export declare const API_CONSTANTS: {
|
|
|
12
12
|
readonly MAX_UDF_PER_QUERY: 1;
|
|
13
13
|
readonly MAX_GET_LENGTH: 2048;
|
|
14
14
|
readonly MAX_REQUESTS_PER_HOUR: 10000;
|
|
15
|
-
readonly MAX_RETRIES: 3;
|
|
16
|
-
readonly BASE_BACKOFF_DELAY: 1000;
|
|
17
|
-
readonly MAX_BACKOFF_DELAY: 30000;
|
|
18
15
|
};
|
|
19
16
|
export declare const PAGINATION: {
|
|
20
17
|
readonly MAX_PAGE_SIZE: 500;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../nodes/Autotask/constants/api.ts"],"names":[],"mappings":";;;AAKa,QAAA,WAAW,GAAG;IAE1B,OAAO,EAAE,MAAM;CACN,CAAC;AAGE,QAAA,aAAa,GAAG;IAE5B,cAAc,EAAE,GAAG;IAEnB,aAAa,EAAE,GAAG;IAElB,gBAAgB,EAAE,IAAI;IAEtB,gBAAgB,EAAE,GAAG;IAErB,sBAAsB,EAAE,IAAI;IAE5B,uBAAuB,EAAE,EAAE;IAE3B,iBAAiB,EAAE,GAAG;IAEtB,iBAAiB,EAAE,CAAC;IAEpB,cAAc,EAAE,IAAI;IAEpB,qBAAqB,EAAE,KAAK;
|
|
1
|
+
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../nodes/Autotask/constants/api.ts"],"names":[],"mappings":";;;AAKa,QAAA,WAAW,GAAG;IAE1B,OAAO,EAAE,MAAM;CACN,CAAC;AAGE,QAAA,aAAa,GAAG;IAE5B,cAAc,EAAE,GAAG;IAEnB,aAAa,EAAE,GAAG;IAElB,gBAAgB,EAAE,IAAI;IAEtB,gBAAgB,EAAE,GAAG;IAErB,sBAAsB,EAAE,IAAI;IAE5B,uBAAuB,EAAE,EAAE;IAE3B,iBAAiB,EAAE,GAAG;IAEtB,iBAAiB,EAAE,CAAC;IAEpB,cAAc,EAAE,IAAI;IAEpB,qBAAqB,EAAE,KAAK;CACnB,CAAC;AAGE,QAAA,UAAU,GAAG;IAEzB,aAAa,EAAE,GAAG;IAElB,aAAa,EAAE,CAAC;IAEhB,iBAAiB,EAAE,EAAE;IAErB,SAAS,EAAE,EAAE;CACJ,CAAC;AAGE,QAAA,gBAAgB,GAAG;IAE/B,EAAE,EAAE,IAAI;IAER,KAAK,EAAE,OAAO;IAEd,EAAE,EAAE,IAAI;IAER,GAAG,EAAE,KAAK;IAEV,EAAE,EAAE,IAAI;IAER,GAAG,EAAE,KAAK;IAEV,UAAU,EAAE,YAAY;IAExB,QAAQ,EAAE,UAAU;IAEpB,QAAQ,EAAE,UAAU;IAEpB,KAAK,EAAE,OAAO;IAEd,QAAQ,EAAE,UAAU;IAEpB,EAAE,EAAE,IAAI;IAER,KAAK,EAAE,OAAO;CACL,CAAC;AAGE,QAAA,gBAAgB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAG3D,QAAA,eAAe,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,CAAU,CAAC;AAGvD,QAAA,eAAe,GAAG;IAC9B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACL,CAAC;AAGE,QAAA,cAAc,GAAG;IAC7B,kBAAkB,EAAE,mBAAmB;IACvC,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,QAAQ;IAChB,UAAU,EAAE,mBAAmB;CACtB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { IExecuteFunctions, ILoadOptionsFunctions, IHookFunctions } from 'n8n-workflow';
|
|
2
|
+
import type { IApiErrorWithResponse } from '../types/base/api';
|
|
3
|
+
import type { IAutotaskError } from '../types/base/errors';
|
|
2
4
|
export declare enum AutotaskErrorType {
|
|
3
5
|
Authentication = "AuthenticationError_401",
|
|
4
6
|
Authorization = "AuthorizationError_403",
|
|
@@ -15,6 +17,13 @@ export declare enum AutotaskErrorType {
|
|
|
15
17
|
ParseError = "ParseError",
|
|
16
18
|
Unknown = "UnknownError"
|
|
17
19
|
}
|
|
20
|
+
export declare function createStandardErrorObject(error: Error | IApiErrorWithResponse, context: {
|
|
21
|
+
url: string;
|
|
22
|
+
method: string;
|
|
23
|
+
status?: number;
|
|
24
|
+
operation?: string;
|
|
25
|
+
entityType?: string;
|
|
26
|
+
}): IAutotaskError;
|
|
18
27
|
export declare function handleErrors<T>(context: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions | undefined, operation: () => Promise<T>, metadata?: {
|
|
19
28
|
operation?: string;
|
|
20
29
|
entityType?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AutotaskErrorType = void 0;
|
|
4
|
+
exports.createStandardErrorObject = createStandardErrorObject;
|
|
4
5
|
exports.handleErrors = handleErrors;
|
|
5
6
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
7
|
var AutotaskErrorType;
|
|
@@ -23,196 +24,128 @@ var AutotaskErrorType;
|
|
|
23
24
|
function formatErrorDetails(errors) {
|
|
24
25
|
if (!(errors === null || errors === void 0 ? void 0 : errors.length))
|
|
25
26
|
return '';
|
|
26
|
-
return errors.map(e =>
|
|
27
|
+
return errors.map(e => {
|
|
28
|
+
let message = e.message || 'Unknown error';
|
|
29
|
+
if (e.field) {
|
|
30
|
+
message = `Field '${e.field}': ${message}`;
|
|
31
|
+
}
|
|
32
|
+
if (e.code) {
|
|
33
|
+
message = `[${e.code}] ${message}`;
|
|
34
|
+
}
|
|
35
|
+
return message;
|
|
36
|
+
}).join(' | ');
|
|
37
|
+
}
|
|
38
|
+
function getErrorTypeByContext(status, message, errors) {
|
|
39
|
+
if (message) {
|
|
40
|
+
if (message.includes('[NotFoundError]') ||
|
|
41
|
+
message.toLowerCase().includes('not found') ||
|
|
42
|
+
(message.includes('item') && message.includes('null'))) {
|
|
43
|
+
return AutotaskErrorType.NotFound;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (!status)
|
|
47
|
+
return AutotaskErrorType.Unknown;
|
|
48
|
+
const statusErrorMap = {
|
|
49
|
+
400: AutotaskErrorType.BadRequest,
|
|
50
|
+
401: AutotaskErrorType.Authentication,
|
|
51
|
+
403: AutotaskErrorType.Authorization,
|
|
52
|
+
404: AutotaskErrorType.NotFound,
|
|
53
|
+
409: AutotaskErrorType.Conflict,
|
|
54
|
+
422: AutotaskErrorType.Validation,
|
|
55
|
+
429: AutotaskErrorType.TooManyRequests,
|
|
56
|
+
500: AutotaskErrorType.InternalServer,
|
|
57
|
+
503: AutotaskErrorType.ServiceUnavailable,
|
|
58
|
+
504: AutotaskErrorType.GatewayTimeout,
|
|
59
|
+
};
|
|
60
|
+
if (statusErrorMap[status])
|
|
61
|
+
return statusErrorMap[status];
|
|
62
|
+
if (status >= 400 && status < 500)
|
|
63
|
+
return AutotaskErrorType.BadRequest;
|
|
64
|
+
if (status >= 500)
|
|
65
|
+
return AutotaskErrorType.InternalServer;
|
|
66
|
+
return AutotaskErrorType.Unknown;
|
|
27
67
|
}
|
|
28
68
|
function getErrorContext(error, operation, entityType) {
|
|
29
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
30
69
|
if (!error) {
|
|
31
70
|
return {
|
|
32
71
|
type: AutotaskErrorType.Unknown,
|
|
33
72
|
details: 'An unknown error occurred (no error provided)',
|
|
34
73
|
};
|
|
35
74
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
75
|
+
let details = '';
|
|
76
|
+
let statusCode;
|
|
77
|
+
let specificErrors = [];
|
|
78
|
+
if ('response' in error && error.response) {
|
|
79
|
+
statusCode = error.response.status;
|
|
80
|
+
if (error.response.data && Array.isArray(error.response.data.errors) && error.response.data.errors.length > 0) {
|
|
81
|
+
specificErrors = error.response.data.errors;
|
|
82
|
+
details = formatErrorDetails(specificErrors);
|
|
44
83
|
}
|
|
45
84
|
}
|
|
46
|
-
if (
|
|
47
|
-
|
|
48
|
-
if (((_b = error.response) === null || _b === void 0 ? void 0 : _b.data) && 'errors' in error.response.data) {
|
|
49
|
-
const errorData = error.response.data;
|
|
50
|
-
if (Array.isArray(errorData.errors) && errorData.errors.length > 0) {
|
|
51
|
-
const errorDetails = errorData.errors.map((e) => {
|
|
52
|
-
let message = e.message || 'Unknown error';
|
|
53
|
-
if (e.field) {
|
|
54
|
-
message = `Field '${e.field}': ${message}`;
|
|
55
|
-
}
|
|
56
|
-
if (e.code) {
|
|
57
|
-
message = `[${e.code}] ${message}`;
|
|
58
|
-
}
|
|
59
|
-
return message;
|
|
60
|
-
}).join(' | ');
|
|
61
|
-
const errorContext = {
|
|
62
|
-
type: getErrorTypeByStatus(status),
|
|
63
|
-
statusCode: status,
|
|
64
|
-
details: errorDetails || formatErrorDetails(errorData.errors) || 'API error occurred',
|
|
65
|
-
};
|
|
66
|
-
return errorContext;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
switch (status) {
|
|
70
|
-
case 400:
|
|
71
|
-
return {
|
|
72
|
-
type: AutotaskErrorType.BadRequest,
|
|
73
|
-
statusCode: status,
|
|
74
|
-
details: formatErrorDetails((_d = (_c = error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.errors) || 'Invalid request format or parameters',
|
|
75
|
-
};
|
|
76
|
-
case 401:
|
|
77
|
-
return {
|
|
78
|
-
type: AutotaskErrorType.Authentication,
|
|
79
|
-
statusCode: status,
|
|
80
|
-
details: 'Authentication failed: Invalid credentials',
|
|
81
|
-
};
|
|
82
|
-
case 403:
|
|
83
|
-
return {
|
|
84
|
-
type: AutotaskErrorType.Authorization,
|
|
85
|
-
statusCode: status,
|
|
86
|
-
details: 'Authorization failed: Insufficient permissions',
|
|
87
|
-
};
|
|
88
|
-
case 404:
|
|
89
|
-
return {
|
|
90
|
-
type: AutotaskErrorType.NotFound,
|
|
91
|
-
statusCode: status,
|
|
92
|
-
details: `Resource not found${entityType ? `: ${entityType}` : ''}`,
|
|
93
|
-
};
|
|
94
|
-
case 409:
|
|
95
|
-
return {
|
|
96
|
-
type: AutotaskErrorType.Conflict,
|
|
97
|
-
statusCode: status,
|
|
98
|
-
details: 'Resource state conflict',
|
|
99
|
-
};
|
|
100
|
-
case 422:
|
|
101
|
-
return {
|
|
102
|
-
type: AutotaskErrorType.Validation,
|
|
103
|
-
statusCode: status,
|
|
104
|
-
details: formatErrorDetails((_f = (_e = error.response) === null || _e === void 0 ? void 0 : _e.data) === null || _f === void 0 ? void 0 : _f.errors) || 'Validation error',
|
|
105
|
-
};
|
|
106
|
-
case 429:
|
|
107
|
-
return {
|
|
108
|
-
type: AutotaskErrorType.TooManyRequests,
|
|
109
|
-
statusCode: status,
|
|
110
|
-
details: 'Rate limit exceeded',
|
|
111
|
-
};
|
|
112
|
-
case 500:
|
|
113
|
-
return {
|
|
114
|
-
type: AutotaskErrorType.InternalServer,
|
|
115
|
-
statusCode: status,
|
|
116
|
-
details: 'Internal server error',
|
|
117
|
-
};
|
|
118
|
-
case 503:
|
|
119
|
-
return {
|
|
120
|
-
type: AutotaskErrorType.ServiceUnavailable,
|
|
121
|
-
statusCode: status,
|
|
122
|
-
details: 'Service temporarily unavailable',
|
|
123
|
-
};
|
|
124
|
-
case 504:
|
|
125
|
-
return {
|
|
126
|
-
type: AutotaskErrorType.GatewayTimeout,
|
|
127
|
-
statusCode: status,
|
|
128
|
-
details: 'Gateway timeout',
|
|
129
|
-
};
|
|
130
|
-
default:
|
|
131
|
-
if (status && status >= 400 && status < 500) {
|
|
132
|
-
return {
|
|
133
|
-
type: AutotaskErrorType.BadRequest,
|
|
134
|
-
statusCode: status,
|
|
135
|
-
details: formatErrorDetails((_h = (_g = error.response) === null || _g === void 0 ? void 0 : _g.data) === null || _h === void 0 ? void 0 : _h.errors) || `Client error: ${status}`,
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
if (status && status >= 500) {
|
|
139
|
-
return {
|
|
140
|
-
type: AutotaskErrorType.InternalServer,
|
|
141
|
-
statusCode: status,
|
|
142
|
-
details: `Server error: ${status}`,
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
}
|
|
85
|
+
if (!details && error.message) {
|
|
86
|
+
details = error.message;
|
|
146
87
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
details: error.message || 'Failed to parse API response',
|
|
164
|
-
};
|
|
88
|
+
const type = getErrorTypeByContext(statusCode, error.message, specificErrors);
|
|
89
|
+
return {
|
|
90
|
+
type,
|
|
91
|
+
operation,
|
|
92
|
+
entityType,
|
|
93
|
+
statusCode,
|
|
94
|
+
details: details || 'An error occurred',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
function createStandardErrorObject(error, context) {
|
|
98
|
+
var _a, _b, _c;
|
|
99
|
+
const { url, method, status, operation, entityType } = context;
|
|
100
|
+
let details = [];
|
|
101
|
+
if ('response' in error && ((_b = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.errors)) {
|
|
102
|
+
if (Array.isArray(error.response.data.errors)) {
|
|
103
|
+
details = error.response.data.errors;
|
|
165
104
|
}
|
|
166
105
|
}
|
|
106
|
+
const errorContext = getErrorContext(error, operation, entityType);
|
|
107
|
+
const rawResponse = 'response' in error && ((_c = error.response) === null || _c === void 0 ? void 0 : _c.data)
|
|
108
|
+
? JSON.stringify(error.response.data)
|
|
109
|
+
: undefined;
|
|
167
110
|
return {
|
|
168
|
-
|
|
169
|
-
|
|
111
|
+
statusCode: status,
|
|
112
|
+
message: errorContext.details || error.message || 'Unknown error',
|
|
113
|
+
details,
|
|
114
|
+
context: {
|
|
115
|
+
url,
|
|
116
|
+
method,
|
|
117
|
+
operation,
|
|
118
|
+
entityType,
|
|
119
|
+
errorDetails: details,
|
|
120
|
+
rawResponse
|
|
121
|
+
}
|
|
170
122
|
};
|
|
171
123
|
}
|
|
172
|
-
function getErrorTypeByStatus(status) {
|
|
173
|
-
if (!status)
|
|
174
|
-
return AutotaskErrorType.Unknown;
|
|
175
|
-
if (status === 401)
|
|
176
|
-
return AutotaskErrorType.Authentication;
|
|
177
|
-
if (status === 403)
|
|
178
|
-
return AutotaskErrorType.Authorization;
|
|
179
|
-
if (status === 404)
|
|
180
|
-
return AutotaskErrorType.NotFound;
|
|
181
|
-
if (status === 400)
|
|
182
|
-
return AutotaskErrorType.BadRequest;
|
|
183
|
-
if (status === 422)
|
|
184
|
-
return AutotaskErrorType.Validation;
|
|
185
|
-
if (status === 409)
|
|
186
|
-
return AutotaskErrorType.Conflict;
|
|
187
|
-
if (status === 429)
|
|
188
|
-
return AutotaskErrorType.TooManyRequests;
|
|
189
|
-
if (status === 500)
|
|
190
|
-
return AutotaskErrorType.InternalServer;
|
|
191
|
-
if (status === 503)
|
|
192
|
-
return AutotaskErrorType.ServiceUnavailable;
|
|
193
|
-
if (status === 504)
|
|
194
|
-
return AutotaskErrorType.GatewayTimeout;
|
|
195
|
-
if (status >= 400 && status < 500)
|
|
196
|
-
return AutotaskErrorType.BadRequest;
|
|
197
|
-
if (status >= 500)
|
|
198
|
-
return AutotaskErrorType.InternalServer;
|
|
199
|
-
return AutotaskErrorType.Unknown;
|
|
200
|
-
}
|
|
201
124
|
async function handleErrors(context, operation, metadata) {
|
|
125
|
+
var _a, _b, _c;
|
|
202
126
|
const { operation: opName, entityType } = metadata || {};
|
|
203
127
|
try {
|
|
204
128
|
return await operation();
|
|
205
129
|
}
|
|
206
130
|
catch (error) {
|
|
207
|
-
const
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
|
|
131
|
+
const errorContext = getErrorContext(error, opName, entityType);
|
|
132
|
+
const errorMessage = error.description ||
|
|
133
|
+
error.message ||
|
|
134
|
+
errorContext.details ||
|
|
135
|
+
'An unknown error occurred';
|
|
136
|
+
const apiErrors = ((_b = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.errors) ||
|
|
137
|
+
((_c = error.error) === null || _c === void 0 ? void 0 : _c.errors) ||
|
|
138
|
+
[];
|
|
139
|
+
const formattedApiErrors = Array.isArray(apiErrors) && apiErrors.length > 0
|
|
140
|
+
? apiErrors.map((e) => typeof e === 'string' ? e : e.message).filter(Boolean).join(' | ')
|
|
141
|
+
: '';
|
|
142
|
+
const detailedMessage = errorMessage !== 'An unknown error occurred'
|
|
143
|
+
? errorMessage
|
|
144
|
+
: formattedApiErrors || errorContext.details || 'An unknown error occurred';
|
|
145
|
+
if (context) {
|
|
146
|
+
throw new n8n_workflow_1.NodeOperationError(context.getNode(), detailedMessage, { itemIndex: 0 });
|
|
211
147
|
}
|
|
212
|
-
throw new
|
|
213
|
-
description: errorContext.details,
|
|
214
|
-
message: `[${errorContext.type}] ${opName ? `Operation: ${opName}, ` : ''}${entityType ? `Entity: ${entityType}, ` : ''}${errorContext.details}`,
|
|
215
|
-
});
|
|
148
|
+
throw new Error(`${detailedMessage} [${errorContext.type}]`);
|
|
216
149
|
}
|
|
217
150
|
}
|
|
218
151
|
//# sourceMappingURL=errorHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../../../nodes/Autotask/helpers/errorHandler.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"errorHandler.js","sourceRoot":"","sources":["../../../../nodes/Autotask/helpers/errorHandler.ts"],"names":[],"mappings":";;;AAgKA,8DAsCC;AAKD,oCAwDC;AAlQD,+CAAkD;AAOlD,IAAY,iBAwBX;AAxBD,WAAY,iBAAiB;IAE5B,+DAA0C,CAAA;IAC1C,6DAAwC,CAAA;IAGxC,uDAAkC,CAAA;IAClC,uDAAkC,CAAA;IAClC,mDAA8B,CAAA;IAC9B,mDAA8B,CAAA;IAC9B,iEAA4C,CAAA;IAG5C,+DAA0C,CAAA;IAC1C,uEAAkD,CAAA;IAClD,+DAA0C,CAAA;IAG1C,6CAAwB,CAAA;IACxB,6CAAwB,CAAA;IACxB,8CAAyB,CAAA;IAGzB,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AC,CAAC,YAAY;YACd,CAAC,CAAC,kBAAkB,IAAI,YAAY,CAAC,OAAO,IAAI,2BAA2B,CAAC;QAG7E,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,iCAAkB,CAC3B,OAAO,CAAC,OAAO,EAAE,EACjB,eAAe,EACf,EAAE,SAAS,EAAE,CAAC,EAAE,CAChB,CAAC;QACH,CAAC;QAGD,MAAM,IAAI,KAAK,CAAC,GAAG,eAAe,KAAK,YAAY,CAAC,IAAI,GAAG,CAAC,CAAC;IAC9D,CAAC;AACF,CAAC"}
|
|
@@ -30,7 +30,7 @@ declare class RequestRateTracker {
|
|
|
30
30
|
currentTimeframeRequestCount: number;
|
|
31
31
|
} | null>): void;
|
|
32
32
|
}
|
|
33
|
-
export declare function
|
|
34
|
-
export declare function handleRateLimit(
|
|
33
|
+
export declare function calculateThrottleDuration(usagePercent: number): number;
|
|
34
|
+
export declare function handleRateLimit(): Promise<void>;
|
|
35
35
|
export declare const rateTracker: RequestRateTracker;
|
|
36
36
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.rateTracker = void 0;
|
|
4
|
-
exports.
|
|
4
|
+
exports.calculateThrottleDuration = calculateThrottleDuration;
|
|
5
5
|
exports.handleRateLimit = handleRateLimit;
|
|
6
6
|
class RequestRateTracker {
|
|
7
7
|
constructor() {
|
|
@@ -125,11 +125,11 @@ class RequestRateTracker {
|
|
|
125
125
|
this.requestCount = result.currentTimeframeRequestCount;
|
|
126
126
|
this.lastSyncTime = Date.now();
|
|
127
127
|
this.counterResetTime = Date.now() + this.hourInMs;
|
|
128
|
-
this.debugLog(`Threshold sync complete:
|
|
129
|
-
- API count: ${oldActualCount} → ${this.actualUsageCount}
|
|
130
|
-
- Local count: ${oldCount} → ${this.requestCount}
|
|
131
|
-
- Limit: ${oldThreshold} → ${this.thresholdLimit}
|
|
132
|
-
- Next reset: ${new Date(this.counterResetTime).toISOString()}
|
|
128
|
+
this.debugLog(`Threshold sync complete:
|
|
129
|
+
- API count: ${oldActualCount} → ${this.actualUsageCount}
|
|
130
|
+
- Local count: ${oldCount} → ${this.requestCount}
|
|
131
|
+
- Limit: ${oldThreshold} → ${this.thresholdLimit}
|
|
132
|
+
- Next reset: ${new Date(this.counterResetTime).toISOString()}
|
|
133
133
|
- Next sync: ${new Date(this.lastSyncTime + this.syncIntervalMs).toISOString()}`);
|
|
134
134
|
}
|
|
135
135
|
else {
|
|
@@ -146,20 +146,25 @@ class RequestRateTracker {
|
|
|
146
146
|
this.fetchThresholdInfo = fetcher;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
149
|
+
function calculateThrottleDuration(usagePercent) {
|
|
150
|
+
if (usagePercent >= 90) {
|
|
151
|
+
return 5000;
|
|
152
|
+
}
|
|
153
|
+
else if (usagePercent >= 75) {
|
|
154
|
+
return 2000;
|
|
155
|
+
}
|
|
156
|
+
else if (usagePercent >= 50) {
|
|
157
|
+
return 1000;
|
|
158
|
+
}
|
|
159
|
+
return 0;
|
|
154
160
|
}
|
|
155
|
-
async function handleRateLimit(
|
|
161
|
+
async function handleRateLimit() {
|
|
156
162
|
const rateTracker = RequestRateTracker.getInstance();
|
|
157
163
|
const usagePercent = rateTracker.trackRequest();
|
|
158
164
|
if (rateTracker.shouldThrottle()) {
|
|
159
165
|
const baseDelay = rateTracker.getThrottleDuration();
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
await new Promise(resolve => setTimeout(resolve, backoffDelay));
|
|
166
|
+
console.debug(`[RateLimit] Adding throttle delay of ${baseDelay}ms (at limit)`);
|
|
167
|
+
await new Promise(resolve => setTimeout(resolve, baseDelay));
|
|
163
168
|
}
|
|
164
169
|
const throttleDelay = rateTracker.getThrottleDuration();
|
|
165
170
|
if (throttleDelay > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rateLimit.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/helpers/http/rateLimit.ts"],"names":[],"mappings":";;;AAyOA,
|
|
1
|
+
{"version":3,"file":"rateLimit.js","sourceRoot":"","sources":["../../../../../nodes/Autotask/helpers/http/rateLimit.ts"],"names":[],"mappings":";;;AAyOA,8DASC;AAKD,0CAiBC;AArQD,MAAM,kBAAkB;IAepB;QAbQ,iBAAY,GAAG,CAAC,CAAC;QACjB,qBAAgB,GAAG,CAAC,CAAC;QACZ,aAAQ,GAAG,OAAO,CAAC;QACnB,uBAAkB,GAAG,KAAK,CAAC;QAC3B,oBAAe,GAAG,KAAK,CAAC;QAGjC,iBAAY,GAAG,CAAC,CAAC;QACjB,mBAAc,GAAG,OAAO,CAAC;QACzB,qBAAgB,GAAG,CAAC,CAAC;QACrB,mBAAc,GAAG,KAAK,CAAC;QACvB,gBAAW,GAAyB,IAAI,CAAC;QA8L1C,uBAAkB,GAIb,KAAK,IAAI,EAAE;YACnB,IAAI,CAAC,QAAQ,CAAC,wDAAwD,CAAC,CAAC;YACxE,OAAO,IAAI,CAAC;QAChB,CAAC,CAAC;QAlME,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC;QACnD,IAAI,CAAC,QAAQ,CAAC,gDAAgD,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACnH,CAAC;IAEM,MAAM,CAAC,WAAW;QACrB,IAAI,CAAC,kBAAkB,CAAC,QAAQ,EAAE,CAAC;YAC/B,kBAAkB,CAAC,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAC3D,CAAC;QACD,OAAO,kBAAkB,CAAC,QAAQ,CAAC;IACvC,CAAC;IAKO,QAAQ,CAAC,OAAe,EAAE,GAAG,IAAe;QAChD,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;Y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