zapier-platform-core 18.1.1 → 18.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zapier-platform-core",
3
- "version": "18.1.1",
3
+ "version": "18.2.1",
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/",
@@ -41,7 +41,7 @@
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.1"
44
+ "zapier-platform-schema": "18.2.1"
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
  };
@@ -21,8 +21,9 @@ const applyEnvironment = (event) => {
21
21
  const cleanEnvironment = () => {
22
22
  // not really a security measure - just prevent useless security bounty emails
23
23
  if (
24
- process.env.AWS_LAMBDA_FUNCTION_VERSION ||
25
- process.env.AWS_LAMBDA_FUNCTION_NAME
24
+ !process.env.ZAPIER_SUPPRESS_CLEAN_ENVIRONMENT &&
25
+ (process.env.AWS_LAMBDA_FUNCTION_VERSION ||
26
+ process.env.AWS_LAMBDA_FUNCTION_NAME)
26
27
  ) {
27
28
  delete process.env.AWS_ACCESS_KEY_ID;
28
29
  delete process.env.AWS_SECURITY_TOKEN;
@@ -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.1
7
+ * zapier-platform-schema version: 18.2.1
8
8
  * schema-to-ts compiler version: 0.1.0
9
9
  */
10
10
  import type {