polyapi 0.24.4 → 0.24.5

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.
@@ -73,7 +73,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => {
73
73
  }
74
74
  ).then(({ headers, data }) => {
75
75
  polyHeaders = headers;
76
- if (data && (data.status < 200 || data.status >= 300)) {
76
+ if (data && (data.status < 200 || data.status >= 300) && process.env.LOGS_ENABLED) {
77
77
  let responseData = data.data;
78
78
  try {
79
79
  responseData = JSON.stringify(data.data);
@@ -95,7 +95,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => {
95
95
  httpsAgent,
96
96
  })
97
97
  }).then(({ headers, data, status }) => {
98
- if (status && (status < 200 || status >= 300)) {
98
+ if (status && (status < 200 || status >= 300) && process.env.LOGS_ENABLED) {
99
99
  console.error('Error direct executing api function with id:', id, 'Status code:', status, 'Request data:', requestArgs, 'Response data:', data.data);
100
100
  }
101
101
  const apiExecutionTimeMs = Date.now() - requestApiStartTime;
@@ -122,7 +122,7 @@ const executeApiFunction = (id, clientID, polyCustom, requestArgs) => {
122
122
  }
123
123
  }
124
124
  ).then(({ headers, data }) => {
125
- if (data && (data.status < 200 || data.status >= 300)) {
125
+ if (data && (data.status < 200 || data.status >= 300) && process.env.LOGS_ENABLED) {
126
126
  let responseData = data.data;
127
127
  try {
128
128
  responseData = JSON.stringify(data.data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "polyapi",
3
- "version": "0.24.4",
3
+ "version": "0.24.5",
4
4
  "description": "Poly is a CLI tool to help create and manage your Poly definitions.",
5
5
  "license": "MIT",
6
6
  "repository": {