@smartsheet-extensions/handler 1.1.5 → 1.1.6-beta.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleBigPayLoad.d.ts","sourceRoot":"","sources":["../../src/enhancers/handleBigPayLoad.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"handleBigPayLoad.d.ts","sourceRoot":"","sources":["../../src/enhancers/handleBigPayLoad.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,WAAW,CAAC;AAKjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAgBtD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb;AA0UD,eAAO,MAAM,gBAAgB,sHAa5B,CAAC"}
|
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
2
21
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
22
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
23
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -15,6 +34,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
34
|
exports.handleBigPayLoad = void 0;
|
|
16
35
|
const axios_1 = __importDefault(require("axios"));
|
|
17
36
|
const form_data_1 = __importDefault(require("form-data"));
|
|
37
|
+
const https = __importStar(require("https"));
|
|
18
38
|
const PayloadFetchError_1 = require("../errors/PayloadFetchError");
|
|
19
39
|
const PayloadLimitExceedError_1 = require("../errors/PayloadLimitExceedError");
|
|
20
40
|
const PayloadPostError_1 = require("../errors/PayloadPostError");
|
|
@@ -22,23 +42,95 @@ const PlatformResponse_1 = require("../responses/PlatformResponse");
|
|
|
22
42
|
const constants_1 = require("../utils/constants");
|
|
23
43
|
const normalizeError_1 = require("../utils/normalizeError");
|
|
24
44
|
const xorHandler_1 = require("./xorHandler");
|
|
25
|
-
|
|
45
|
+
// Create a custom https agent with keepAlive enabled for stable connections during large uploads
|
|
46
|
+
const httpsAgent = new https.Agent({
|
|
47
|
+
keepAlive: true,
|
|
48
|
+
keepAliveMsecs: 300000,
|
|
49
|
+
maxSockets: 50,
|
|
50
|
+
maxFreeSockets: 10,
|
|
51
|
+
timeout: 300000,
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Helper function to determine if an error is retryable
|
|
55
|
+
*/
|
|
56
|
+
const isRetryableError = (error) => {
|
|
57
|
+
var _a, _b, _c, _d;
|
|
58
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
59
|
+
// Retry network errors
|
|
60
|
+
if (error.code === 'ECONNRESET' ||
|
|
61
|
+
error.code === 'ETIMEDOUT' ||
|
|
62
|
+
error.code === 'ECONNABORTED' ||
|
|
63
|
+
error.code === 'EPIPE' ||
|
|
64
|
+
error.code === 'ENOTFOUND' ||
|
|
65
|
+
error.code === 'ESOCKETTIMEDOUT') {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
// Retry 5xx server errors and 429 rate limiting
|
|
69
|
+
if (((_a = error.response) === null || _a === void 0 ? void 0 : _a.status) >= 500 || ((_b = error.response) === null || _b === void 0 ? void 0 : _b.status) === 429) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
// Don't retry 4xx client errors
|
|
73
|
+
if (((_c = error.response) === null || _c === void 0 ? void 0 : _c.status) >= 400 && ((_d = error.response) === null || _d === void 0 ? void 0 : _d.status) < 500) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return true; // Retry unknown errors
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Helper function to extract detailed error information for logging
|
|
81
|
+
*/
|
|
82
|
+
const getErrorDetails = (error) => {
|
|
83
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
84
|
+
if (axios_1.default.isAxiosError(error)) {
|
|
85
|
+
return {
|
|
86
|
+
code: error.code,
|
|
87
|
+
message: error.message,
|
|
88
|
+
statusCode: (_a = error.response) === null || _a === void 0 ? void 0 : _a.status,
|
|
89
|
+
statusText: (_b = error.response) === null || _b === void 0 ? void 0 : _b.statusText,
|
|
90
|
+
responseData: (_c = error.response) === null || _c === void 0 ? void 0 : _c.data,
|
|
91
|
+
requestUrl: (_e = (_d = error.config) === null || _d === void 0 ? void 0 : _d.url) === null || _e === void 0 ? void 0 : _e.substring(0, 100),
|
|
92
|
+
requestMethod: (_f = error.config) === null || _f === void 0 ? void 0 : _f.method,
|
|
93
|
+
requestTimeout: (_g = error.config) === null || _g === void 0 ? void 0 : _g.timeout,
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
message: (error === null || error === void 0 ? void 0 : error.message) || String(error),
|
|
98
|
+
stack: error === null || error === void 0 ? void 0 : error.stack,
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
const retryWrapper = (func, retryTimes, operationType = 'POST') => __awaiter(void 0, void 0, void 0, function* () {
|
|
26
102
|
for (let counter = retryTimes - 1; counter >= 0; counter -= 1) {
|
|
103
|
+
const attemptNumber = retryTimes - counter;
|
|
104
|
+
const startTime = Date.now();
|
|
27
105
|
try {
|
|
28
106
|
// eslint-disable-next-line no-await-in-loop
|
|
29
107
|
const resp = yield func();
|
|
108
|
+
const duration = Date.now() - startTime;
|
|
109
|
+
// eslint-disable-next-line no-console
|
|
110
|
+
console.log(`S3 ${operationType} succeeded in ${duration}ms on attempt ${attemptNumber}/${retryTimes}`);
|
|
30
111
|
return resp.data;
|
|
31
112
|
}
|
|
32
113
|
catch (error) {
|
|
33
|
-
|
|
114
|
+
const duration = Date.now() - startTime;
|
|
115
|
+
const isRetryable = isRetryableError(error);
|
|
116
|
+
const errorDetails = getErrorDetails(error);
|
|
117
|
+
// eslint-disable-next-line no-console
|
|
118
|
+
console.error(`S3 ${operationType} failed after ${duration}ms on attempt ${attemptNumber}/${retryTimes}:`, Object.assign(Object.assign({}, errorDetails), { isRetryable, retriesRemaining: counter }));
|
|
119
|
+
if (counter === 0 || !isRetryable) {
|
|
120
|
+
// eslint-disable-next-line no-console
|
|
121
|
+
console.error(`S3 ${operationType} exhausted all retries or encountered non-retryable error`);
|
|
34
122
|
throw error;
|
|
35
123
|
}
|
|
124
|
+
// Exponential backoff with jitter
|
|
125
|
+
const baseDelay = constants_1.S3_REQUEST_DELAY_MS * Math.pow(2, (attemptNumber - 1));
|
|
126
|
+
const maxDelay = 30000; // 30 seconds max
|
|
127
|
+
const jitter = 0.5 + Math.random() * 0.5;
|
|
128
|
+
const delay = Math.min(baseDelay * jitter, maxDelay);
|
|
36
129
|
// eslint-disable-next-line no-console
|
|
37
|
-
console.
|
|
38
|
-
console.warn(`Request to s3 failed. Retry attempts remaining ${counter} (of ${retryTimes})`);
|
|
130
|
+
console.warn(`Retrying S3 ${operationType} in ${Math.round(delay)}ms (${counter} attempts remaining)`);
|
|
39
131
|
// eslint-disable-next-line no-await-in-loop
|
|
40
132
|
yield new Promise(resolve => {
|
|
41
|
-
setTimeout(resolve,
|
|
133
|
+
setTimeout(resolve, delay);
|
|
42
134
|
});
|
|
43
135
|
}
|
|
44
136
|
}
|
|
@@ -47,7 +139,9 @@ const getPayloadFromS3 = (url) => __awaiter(void 0, void 0, void 0, function* ()
|
|
|
47
139
|
const config = {
|
|
48
140
|
timeout: constants_1.S3_REQUEST_TIMEOUT_MS,
|
|
49
141
|
};
|
|
50
|
-
|
|
142
|
+
// eslint-disable-next-line no-console
|
|
143
|
+
console.log(`Fetching payload from S3...`);
|
|
144
|
+
const resp = yield retryWrapper(() => __awaiter(void 0, void 0, void 0, function* () { return axios_1.default.get(url, config); }), constants_1.S3_GET_RETRY_LIMIT, 'GET');
|
|
51
145
|
return resp;
|
|
52
146
|
});
|
|
53
147
|
const preparePostData = (urlObj, payload) => {
|
|
@@ -70,18 +164,37 @@ const postPayloadToS3 = (url, result) => __awaiter(void 0, void 0, void 0, funct
|
|
|
70
164
|
const resp = yield retryWrapper(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
71
165
|
const urlObj = new URL(decodeURI(url));
|
|
72
166
|
const data = preparePostData(urlObj, result);
|
|
167
|
+
// Calculate Content-Length once to avoid consuming FormData stream
|
|
168
|
+
const payloadSize = data.getLengthSync();
|
|
169
|
+
// Timeout set to 5 minutes which is max lambda execution time
|
|
170
|
+
const timeout = 300000;
|
|
171
|
+
let urlParamsCount = 0;
|
|
172
|
+
urlObj.searchParams.forEach(() => {
|
|
173
|
+
urlParamsCount += 1;
|
|
174
|
+
});
|
|
175
|
+
// eslint-disable-next-line no-console
|
|
176
|
+
console.log(`Uploading payload to S3:`, {
|
|
177
|
+
size: `${payloadSize} bytes (${Math.round(payloadSize / 1024)} KB)`,
|
|
178
|
+
timeout: `${Math.round(timeout / 1000)} seconds`,
|
|
179
|
+
urlHost: urlObj.hostname,
|
|
180
|
+
formDataFields: urlParamsCount + 1,
|
|
181
|
+
});
|
|
73
182
|
const config = {
|
|
74
183
|
headers: {
|
|
75
184
|
'Content-Type': 'multipart/form-data',
|
|
76
|
-
'Content-Length':
|
|
185
|
+
'Content-Length': payloadSize,
|
|
77
186
|
},
|
|
78
187
|
maxContentLength: Infinity,
|
|
79
188
|
maxBodyLength: Infinity,
|
|
80
|
-
timeout
|
|
189
|
+
timeout,
|
|
190
|
+
httpsAgent,
|
|
191
|
+
maxRedirects: 0,
|
|
192
|
+
decompress: false,
|
|
193
|
+
validateStatus: status => status >= 200 && status < 300,
|
|
81
194
|
};
|
|
82
195
|
const postUrl = preparePostUrl(urlObj);
|
|
83
196
|
return axios_1.default.post(postUrl, data, config);
|
|
84
|
-
}), constants_1.S3_POST_RETRY_LIMIT);
|
|
197
|
+
}), constants_1.S3_POST_RETRY_LIMIT, 'POST');
|
|
85
198
|
return resp;
|
|
86
199
|
});
|
|
87
200
|
const isS3Execution = (payload) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleBigPayLoad.js","sourceRoot":"","sources":["../../src/enhancers/handleBigPayLoad.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handleBigPayLoad.js","sourceRoot":"","sources":["../../src/enhancers/handleBigPayLoad.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAiE;AACjE,0DAAiC;AACjC,6CAA+B;AAC/B,mEAAgE;AAChE,+EAA4E;AAC5E,iEAA8D;AAE9D,oEAGuC;AACvC,kDAO4B;AAC5B,4DAAyD;AACzD,6CAA0C;AAO1C,iGAAiG;AACjG,MAAM,UAAU,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC;IACjC,SAAS,EAAE,IAAI;IACf,cAAc,EAAE,MAAM;IACtB,UAAU,EAAE,EAAE;IACd,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AAE,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;oBAC3C,CAAC,EACD,OAAO,CAAC,EAAE;wBACR,4BAA4B;wBAC5B,QAAQ,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC;oBACrC,CAAC,CACF,CAAC;gBACJ,CAAC,CAAC,CAAC;YACP,CAAC,EACD,QAAQ,CAAC,EAAE;gBACT,8BAA8B;gBAC9B,QAAQ,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;YACrC,CAAC,CACF,CAAC;QACJ,CAAC,CAAA,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AAEW,QAAA,gBAAgB,GAAG,uBAAU,CACxC;IACE,kBAAkB,EAAE,wBAAwB;IAC5C,SAAS,EAAE,eAAe;CAC3B,EACD;IACE,cAAc,EAAE,CAAC,OAAgB,EAAE,EAAE;QACnC,IAAI,aAAa,CAAC,OAAO,CAAC,EAAE;YAC1B,OAAO,WAAW,CAAC;SACpB;QACD,OAAO,oBAAoB,CAAC;IAC9B,CAAC;CACF,CACF,CAAC"}
|
package/lib/utils/constants.js
CHANGED
|
@@ -6,5 +6,5 @@ exports.PAYLOAD_LIMIT = 48 * 1024 * 1024;
|
|
|
6
6
|
exports.S3_GET_RETRY_LIMIT = 10;
|
|
7
7
|
exports.S3_POST_RETRY_LIMIT = 10;
|
|
8
8
|
exports.S3_REQUEST_DELAY_MS = 200;
|
|
9
|
-
exports.S3_REQUEST_TIMEOUT_MS =
|
|
9
|
+
exports.S3_REQUEST_TIMEOUT_MS = 40 * 1000; // 40 seconds
|
|
10
10
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,aAAa,CAAC;AAC7B,QAAA,aAAa,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjC,QAAA,kBAAkB,GAAW,EAAE,CAAC;AAChC,QAAA,mBAAmB,GAAW,EAAE,CAAC;AACjC,QAAA,mBAAmB,GAAW,GAAG,CAAC;AAClC,QAAA,qBAAqB,GAAW,EAAE,GAAG,IAAI,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,aAAa,CAAC;AAC7B,QAAA,aAAa,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjC,QAAA,kBAAkB,GAAW,EAAE,CAAC;AAChC,QAAA,mBAAmB,GAAW,EAAE,CAAC;AACjC,QAAA,mBAAmB,GAAW,GAAG,CAAC;AAClC,QAAA,qBAAqB,GAAW,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa"}
|