idea-aws 4.4.10 → 4.4.11

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.
@@ -46,6 +46,10 @@ export declare abstract class ResourceController extends GenericController {
46
46
  * Force the parsing of a query parameter as an array of strings.
47
47
  */
48
48
  protected getQueryParamAsArray(paramName: string): string[];
49
+ /**
50
+ * Force the parsing of a query parameter as a boolean.
51
+ */
52
+ protected getQueryParamAsBoolean(paramName: string): boolean;
49
53
  handleRequest: () => Promise<void>;
50
54
  protected done(error?: Error | any, rawResult?: any, statusCode?: number): void;
51
55
  /**
@@ -227,6 +227,12 @@ class ResourceController extends genericController_1.GenericController {
227
227
  else
228
228
  return String(this.queryParams[paramName]).split(',');
229
229
  }
230
+ /**
231
+ * Force the parsing of a query parameter as a boolean.
232
+ */
233
+ getQueryParamAsBoolean(paramName) {
234
+ return this.queryParams[paramName] && this.queryParams[paramName].toLowerCase() !== 'false';
235
+ }
230
236
  done(error, rawResult, statusCode = this.returnStatusCode ?? (error ? 400 : 200)) {
231
237
  const result = error ? { message: error.message } : rawResult ?? {};
232
238
  const responseTrace = { result: Array.isArray(result) ? { array: result.length } : result };
package/dist/src/s3.js CHANGED
@@ -153,7 +153,7 @@ class S3 {
153
153
  */
154
154
  async listObjectsKeys(options) {
155
155
  const result = await this.listObjects(options);
156
- return result.Contents.map(obj => obj.Key);
156
+ return result.Contents ? result.Contents.map(obj => obj.Key) : [];
157
157
  }
158
158
  /**
159
159
  * Check whether an object exists in an S3 bucket.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "idea-aws",
3
- "version": "4.4.10",
3
+ "version": "4.4.11",
4
4
  "description": "AWS wrappers to use in IDEA's back-ends",
5
5
  "license": "MPL-2.0",
6
6
  "main": "dist/index.js",
@@ -37,11 +37,11 @@
37
37
  },
38
38
  "homepage": "https://iter-idea.github.io/IDEA-AWS",
39
39
  "dependencies": {
40
- "@aws-lambda-powertools/metrics": "^1.17.0",
41
- "@aws-lambda-powertools/tracer": "^1.18.0",
40
+ "@aws-lambda-powertools/metrics": "^1.18.1",
41
+ "@aws-lambda-powertools/tracer": "^1.18.1",
42
42
  "idea-toolbox": "^7.0.6",
43
43
  "nanoid": "^3.3.7",
44
- "nodemailer": "^6.9.8",
44
+ "nodemailer": "^6.9.13",
45
45
  "source-map-support": "^0.5.21"
46
46
  },
47
47
  "peerDependencies": {