@dvsa/appdev-api-common 1.0.0 → 1.1.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": "@dvsa/appdev-api-common",
3
- "version": "1.0.0",
3
+ "version": "1.1.0",
4
4
  "keywords": ["dvsa", "nodejs", "typescript"],
5
5
  "author": "DVSA",
6
6
  "repository": {
@@ -160,5 +160,6 @@ export declare class DateTime {
160
160
  * @returns Object with diagnostic information
161
161
  */
162
162
  debug(): object;
163
+ static formatForDB(dateStr: Date | string): string;
163
164
  }
164
165
  export {};
@@ -269,5 +269,9 @@ class DateTime {
269
269
  utcOffset: this.instance.utcOffset(),
270
270
  };
271
271
  }
272
+ static formatForDB(dateStr) {
273
+ const date = typeof dateStr === "string" ? new Date(dateStr) : dateStr;
274
+ return date.toISOString().replace("T", " ").replace("Z", "");
275
+ }
272
276
  }
273
277
  exports.DateTime = DateTime;
@@ -1,4 +1,4 @@
1
- import type { Logger } from "@aws-lambda-powertools/logger/lib/esm";
1
+ import type { Logger } from "@aws-lambda-powertools/logger";
2
2
  import type { NextFunction, Request, Response } from "express";
3
3
  /**
4
4
  * Middleware to decode base64+gzip encoded request payloads and turn them into their JSON equivalent