somod-chat-service 0.7.2 → 0.7.3

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.
@@ -7,6 +7,7 @@ export type ThreadSessionRequired = {
7
7
  };
8
8
  export type Thread = {
9
9
  id: string;
10
+ createdAt?: number;
10
11
  } & ThreadInput & ThreadSessionRequired;
11
12
  export type MessageInput = {
12
13
  threadId: string;
@@ -6,11 +6,12 @@ import { v1 as v1uuid } from "uuid";
6
6
  var builder = new RouteBuilder();
7
7
  var dynamodb = new DynamoDBClient();
8
8
  var createThread = function (request) { return __awaiter(void 0, void 0, void 0, function () {
9
- var thread, putItemCommand;
9
+ var now, thread, putItemCommand;
10
10
  return __generator(this, function (_a) {
11
11
  switch (_a.label) {
12
12
  case 0:
13
- thread = __assign(__assign({}, request.body), { id: v1uuid().split("-").join("") });
13
+ now = Date.now();
14
+ thread = __assign(__assign({}, request.body), { id: v1uuid().split("-").join(""), createdAt: now });
14
15
  putItemCommand = new PutItemCommand({
15
16
  TableName: process.env.THREAD_TABLE_NAME + "",
16
17
  Item: marshall(thread),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "somod-chat-service",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "Serverless Chat Service from SOMOD",
5
5
  "scripts": {
6
6
  "prettier": "npx prettier --check --ignore-unknown --no-error-on-unmatched-pattern ./**/*",