zapier-platform-core 18.1.0 → 18.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapier-platform-core",
3
- "version": "18.1.0",
3
+ "version": "18.2.0",
4
4
  "description": "The core SDK for CLI apps in the Zapier Developer Platform.",
5
5
  "repository": "zapier/zapier-platform",
6
6
  "homepage": "https://platform.zapier.com/",
@@ -35,13 +35,13 @@
35
35
  "dotenv": "17.2.1",
36
36
  "fernet": "^0.3.3",
37
37
  "form-data": "4.0.5",
38
- "lodash": "4.17.21",
38
+ "lodash": "4.17.23",
39
39
  "mime-types": "3.0.1",
40
40
  "node-abort-controller": "3.1.1",
41
41
  "node-fetch": "2.7.0",
42
42
  "oauth-sign": "0.9.0",
43
43
  "semver": "7.7.2",
44
- "zapier-platform-schema": "18.1.0"
44
+ "zapier-platform-schema": "18.2.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/node-fetch": "^2.6.11",
@@ -17,7 +17,6 @@ const largeResponseCachePointer = async (output) => {
17
17
 
18
18
  // If autostash limit is defined, and is within the range, stash the response
19
19
  // If it is -1, stash the response regardless of size
20
- // If the limit is defined and is out of range, let lambda deal with it
21
20
  if (
22
21
  (autostashLimit &&
23
22
  size >= constants.RESPONSE_SIZE_LIMIT &&
@@ -27,6 +26,12 @@ const largeResponseCachePointer = async (output) => {
27
26
  const url = await responseStasher(output.input, payload);
28
27
  output.resultsUrl = url;
29
28
  output.results = Array.isArray(output.results) ? [] : {};
29
+ } else if (autostashLimit && size > autostashLimit) {
30
+ // If the limit is defined and is out of range, throw a descriptive error
31
+ // indicating the size of the response and the autostash limit
32
+ throw new Error(
33
+ `Response size of ${size} bytes exceeds maximum allowed size: ${autostashLimit}`,
34
+ );
30
35
  }
31
36
  return output;
32
37
  };
@@ -227,6 +227,7 @@ const createLambdaHandler = (appRawOrPath) => {
227
227
  }`;
228
228
  const logData = { err, log_type: 'error' };
229
229
  const loggedErr = await logErrorAndReturn(logMsg, logData, err);
230
+ await logger.end();
230
231
  reject(loggedErr);
231
232
  });
232
233
 
@@ -258,6 +259,7 @@ const createLambdaHandler = (appRawOrPath) => {
258
259
  const input = createInput(compiledApp, event, logger, logBuffer, rpc);
259
260
  const output = await app(input);
260
261
  const result = cleaner.maskOutput(output);
262
+ await logger.end();
261
263
  resolve(result);
262
264
  } catch (err) {
263
265
  const logMsg = `Unhandled error: ${err}\n${
@@ -265,9 +267,8 @@ const createLambdaHandler = (appRawOrPath) => {
265
267
  }`;
266
268
  const logData = { err, log_type: 'error' };
267
269
  const loggedErr = await logErrorAndReturn(logMsg, logData, err);
268
- reject(loggedErr);
269
- } finally {
270
270
  await logger.end();
271
+ reject(loggedErr);
271
272
  }
272
273
  });
273
274
  });
@@ -4,7 +4,7 @@
4
4
  * files, and/or the schema-to-ts tool and run its CLI to regenerate
5
5
  * these typings.
6
6
  *
7
- * zapier-platform-schema version: 18.1.0
7
+ * zapier-platform-schema version: 18.1.1
8
8
  * schema-to-ts compiler version: 0.1.0
9
9
  */
10
10
  import type {