@infra-blocks/aws-dynamodb 0.37.0-alpha.0 → 0.38.0-alpha.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.
@@ -2,3 +2,4 @@ export * from "./client.js";
2
2
  export * from "./commands/index.js";
3
3
  export * from "./error.js";
4
4
  export * from "./types.js";
5
+ export * from "./utils.js";
package/lib/cjs/index.js CHANGED
@@ -18,4 +18,5 @@ __exportStar(require("./client.js"), exports);
18
18
  __exportStar(require("./commands/index.js"), exports);
19
19
  __exportStar(require("./error.js"), exports);
20
20
  __exportStar(require("./types.js"), exports);
21
+ __exportStar(require("./utils.js"), exports);
21
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,sDAAoC;AACpC,6CAA2B;AAC3B,6CAA2B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,sDAAoC;AACpC,6CAA2B;AAC3B,6CAA2B;AAC3B,6CAA2B"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts a Date object into a TTL value that AWS DynamoDB expects.
3
+ *
4
+ * The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
5
+ * This function converts the provided Date object into such a timestamp
6
+ * by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
7
+ *
8
+ * @param date - The date to convert into a TTL value.
9
+ *
10
+ * @returns The TTL value as expected by AWS DynamoDB.
11
+ *
12
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
13
+ */
14
+ export declare function dateToTtl(date: Date): number;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.dateToTtl = dateToTtl;
4
+ /**
5
+ * Converts a Date object into a TTL value that AWS DynamoDB expects.
6
+ *
7
+ * The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
8
+ * This function converts the provided Date object into such a timestamp
9
+ * by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
10
+ *
11
+ * @param date - The date to convert into a TTL value.
12
+ *
13
+ * @returns The TTL value as expected by AWS DynamoDB.
14
+ *
15
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
16
+ */
17
+ function dateToTtl(date) {
18
+ return Math.round(date.getTime() / 1000);
19
+ }
20
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":";;AAaA,8BAEC;AAfD;;;;;;;;;;;;GAYG;AACH,SAAgB,SAAS,CAAC,IAAU;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC"}
@@ -2,3 +2,4 @@ export * from "./client.js";
2
2
  export * from "./commands/index.js";
3
3
  export * from "./error.js";
4
4
  export * from "./types.js";
5
+ export * from "./utils.js";
package/lib/esm/index.js CHANGED
@@ -2,4 +2,5 @@ export * from "./client.js";
2
2
  export * from "./commands/index.js";
3
3
  export * from "./error.js";
4
4
  export * from "./types.js";
5
+ export * from "./utils.js";
5
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Converts a Date object into a TTL value that AWS DynamoDB expects.
3
+ *
4
+ * The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
5
+ * This function converts the provided Date object into such a timestamp
6
+ * by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
7
+ *
8
+ * @param date - The date to convert into a TTL value.
9
+ *
10
+ * @returns The TTL value as expected by AWS DynamoDB.
11
+ *
12
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
13
+ */
14
+ export declare function dateToTtl(date: Date): number;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Converts a Date object into a TTL value that AWS DynamoDB expects.
3
+ *
4
+ * The TTL value that DynamoDB expects is a Unix epoch timestamp in seconds.
5
+ * This function converts the provided Date object into such a timestamp
6
+ * by doing this: `Math.round(date.getTime() / 1000)`. Nuff said.
7
+ *
8
+ * @param date - The date to convert into a TTL value.
9
+ *
10
+ * @returns The TTL value as expected by AWS DynamoDB.
11
+ *
12
+ * @see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html
13
+ */
14
+ export function dateToTtl(date) {
15
+ return Math.round(date.getTime() / 1000);
16
+ }
17
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,IAAU;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infra-blocks/aws-dynamodb",
3
- "version": "0.37.0-alpha.0",
3
+ "version": "0.38.0-alpha.0",
4
4
  "description": "A convenience wrapper over @aws-sdk/client-dynamodb and @aws-sdk/lib-dynamodb.",
5
5
  "keywords": [
6
6
  "aws",