tabletcommand-backend-models 5.38.7 → 5.39.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.
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RemoteLogStreamModule = void 0;
4
+ const uuid = require("uuid");
5
+ const helpers_1 = require("../helpers");
6
+ async function RemoteLogStreamModule(mongoose) {
7
+ const { Schema, Types } = mongoose;
8
+ const FileSchema = (0, helpers_1.createSchema)(Schema, {
9
+ originalName: {
10
+ type: String,
11
+ default: "", // e.g database.sqlite
12
+ },
13
+ encoding: {
14
+ type: String,
15
+ default: "", // e.g utf8
16
+ },
17
+ mimeType: {
18
+ type: String,
19
+ default: "", // e.g application/text
20
+ },
21
+ fieldname: {
22
+ type: String,
23
+ default: "", // e.g "database" or "logs"
24
+ },
25
+ localPath: {
26
+ type: String,
27
+ default: "", // e.g /tmp/some/path
28
+ },
29
+ remotePath: {
30
+ type: String,
31
+ default: "", // e.g https://google.com?
32
+ },
33
+ hostname: {
34
+ type: String,
35
+ default: "", // e.g ip-10-6-56-205.ca-central-1.compute.internal
36
+ },
37
+ size: {
38
+ type: Number,
39
+ default: 0,
40
+ },
41
+ received: {
42
+ type: Date,
43
+ default: helpers_1.currentDate,
44
+ },
45
+ }, {
46
+ _id: false,
47
+ id: false,
48
+ });
49
+ const modelSchema = (0, helpers_1.createSchema)(Schema, {
50
+ _id: {
51
+ type: Types.ObjectId,
52
+ auto: true,
53
+ },
54
+ departmentId: {
55
+ type: String,
56
+ default: "",
57
+ required: true,
58
+ index: true,
59
+ },
60
+ userId: {
61
+ type: String,
62
+ default: "",
63
+ },
64
+ session: {
65
+ type: String,
66
+ default: "",
67
+ },
68
+ requestId: {
69
+ type: String,
70
+ default: uuid.v4,
71
+ },
72
+ requested: {
73
+ type: Date,
74
+ },
75
+ active: {
76
+ type: Boolean,
77
+ default: false,
78
+ },
79
+ uuid: {
80
+ type: String,
81
+ default: uuid.v4,
82
+ },
83
+ createdAt: {
84
+ type: Date,
85
+ default: helpers_1.currentDate,
86
+ },
87
+ updatedAt: {
88
+ type: Date,
89
+ default: helpers_1.currentDate,
90
+ },
91
+ // Formerly message.title
92
+ message: {
93
+ type: String,
94
+ default: "",
95
+ },
96
+ // Formerly message.body
97
+ manifest: {
98
+ type: [String],
99
+ default: [],
100
+ },
101
+ // Formerly message.type.typeOpts.userAgent
102
+ userAgent: {
103
+ type: String,
104
+ default: "",
105
+ },
106
+ // Formerly message.type.typeOpts.appVersion
107
+ appVersion: {
108
+ type: String,
109
+ default: "",
110
+ },
111
+ files: {
112
+ type: [FileSchema],
113
+ default: [],
114
+ },
115
+ }, {
116
+ autoIndex: false,
117
+ collection: "massive_remote_log_stream",
118
+ timestamps: true,
119
+ });
120
+ return (0, helpers_1.createModel)(mongoose, "RemoteLogStream", modelSchema);
121
+ }
122
+ exports.RemoteLogStreamModule = RemoteLogStreamModule;
123
+ exports.default = RemoteLogStreamModule;
124
+ //# sourceMappingURL=remote-log-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-log-stream.js","sourceRoot":"","sources":["../../src/models/remote-log-stream.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wCAQoB;AAEb,KAAK,UAAU,qBAAqB,CAAC,QAAwB;IAClE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,UAAU,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACtC,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,sBAAsB;SACpC;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,WAAW;SACzB;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,uBAAuB;SACrC;QACD,SAAS,EAAE;YACT,IAAI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IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,yBAAyB;QACzB,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,wBAAwB;QACxB,QAAQ,EAAE;YACR,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,OAAO,EAAE,EAAE;SACZ;QACD,2CAA2C;QAC3C,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,4CAA4C;QAC5C,UAAU,EAAE;YACV,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,IAAI,EAAE,CAAC,UAAU,CAAC;YAClB,OAAO,EAAE,EAAE;SACZ;KACF,EAAE;QACD,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,2BAA2B;QACvC,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IAEH,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,iBAAiB,EAAE,WAAW,CAAC,CAAC;AAC/D,CAAC;AAtHD,sDAsHC;AAID,kBAAe,qBAAmG,CAAC"}
@@ -18,6 +18,10 @@ async function RemoteLogModule(mongoose) {
18
18
  type: String,
19
19
  default: "", // e.g application/text
20
20
  },
21
+ fieldname: {
22
+ type: String,
23
+ default: "", // e.g "database" or "logs"
24
+ },
21
25
  localPath: {
22
26
  type: String,
23
27
  default: "", // e.g /tmp/some/path
@@ -26,6 +30,10 @@ async function RemoteLogModule(mongoose) {
26
30
  type: String,
27
31
  default: "", // e.g https://google.com?
28
32
  },
33
+ hostname: {
34
+ type: String,
35
+ default: "", // e.g ip-10-6-56-205.ca-central-1.compute.internal
36
+ },
29
37
  size: {
30
38
  type: Number,
31
39
  default: 0,
@@ -57,6 +65,10 @@ async function RemoteLogModule(mongoose) {
57
65
  type: String,
58
66
  default: "",
59
67
  },
68
+ requestId: {
69
+ type: String,
70
+ default: uuid.v4,
71
+ },
60
72
  active: {
61
73
  type: Boolean,
62
74
  default: false,
@@ -65,34 +77,47 @@ async function RemoteLogModule(mongoose) {
65
77
  type: String,
66
78
  default: uuid.v4,
67
79
  },
68
- requestId: {
69
- type: String,
70
- default: uuid.v4,
80
+ createdAt: {
81
+ type: Date,
82
+ default: helpers_1.currentDate,
71
83
  },
72
- received: {
84
+ updatedAt: {
73
85
  type: Date,
74
86
  default: helpers_1.currentDate,
75
87
  },
76
- hostname: {
88
+ status: {
89
+ type: String,
90
+ default: "", // local, uploading, synced (uploaded to a remote storage)
91
+ },
92
+ // Formerly message.title
93
+ message: {
77
94
  type: String,
78
95
  default: "",
79
96
  },
80
- status: {
97
+ // Formerly message.body
98
+ manifest: {
99
+ type: [String],
100
+ default: [],
101
+ },
102
+ // Formerly message.type.typeOpts.userAgent
103
+ userAgent: {
81
104
  type: String,
82
- default: "", // local, uploading, synced (uploaded to a remote storage)
105
+ default: "",
83
106
  },
84
- lastStatusChange: {
85
- type: Date,
86
- default: helpers_1.currentDate,
107
+ // Formerly message.type.typeOpts.appVersion
108
+ appVersion: {
109
+ type: String,
110
+ default: "",
87
111
  },
88
112
  files: {
89
113
  type: [FileSchema],
90
114
  default: [],
91
115
  },
92
116
  }, {
93
- collection: "massive_remote_log",
117
+ autoIndex: false,
118
+ collection: "massive_remote_log_stream",
119
+ timestamps: true,
94
120
  });
95
- modelSchema.set("autoIndex", false);
96
121
  return (0, helpers_1.createModel)(mongoose, "RemoteLog", modelSchema);
97
122
  }
98
123
  exports.RemoteLogModule = RemoteLogModule;
@@ -1 +1 @@
1
- {"version":3,"file":"remote-log.js","sourceRoot":"","sources":["../../src/models/remote-log.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wCAQoB;AAEb,KAAK,UAAU,eAAe,CAAC,QAAwB;IAC5D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC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BAAW;SACrB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,2DAA2D;SACzE;QACD,yBAAyB;QACzB,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,wBAAwB;QACxB,QAAQ,EAAE;YACR,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,OAAO,EAAE,EAAE;SACZ;QACD,2CAA2C;QAC3C,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,4CAA4C;QAC5C,UAAU,EAAE;YACV,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,KAAK,EAAE;YACL,IAAI,EAAE,CAAC,UAAU,CAAC;YAClB,OAAO,EAAE,EAAE;SACZ;KACF,EAAE;QACD,SAAS,EAAE,KAAK;QAChB,UAAU,EAAE,2BAA2B;QACvC,UAAU,EAAE,IAAI;KACjB,CAAC,CAAC;IAEH,OAAO,IAAA,qBAAW,EAAC,QAAQ,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AACzD,CAAC;AAvHD,0CAuHC;AAID,kBAAe,eAAiF,CAAC"}
package/cspell.json CHANGED
@@ -16,6 +16,7 @@
16
16
  "Enroute",
17
17
  "Esri",
18
18
  "fdid",
19
+ "fieldname",
19
20
  "firefront",
20
21
  "firemap",
21
22
  "firemapper",
@@ -0,0 +1,65 @@
1
+ /// <reference types="mongoose" />
2
+ import { MongooseModule, ItemTypeFromTypeSchemaFunction, ModelTypeFromTypeSchemaFunction, ReplaceModelReturnType, currentDate } from "../helpers";
3
+ export declare function RemoteLogStreamModule(mongoose: MongooseModule): Promise<import("mongoose").Model<import("mongoose").Document & Record<string, unknown> & {
4
+ _id: import("mongoose").Types.ObjectId;
5
+ departmentId: string;
6
+ userId: string;
7
+ session: string;
8
+ requestId: string;
9
+ requested: string;
10
+ active: boolean;
11
+ uuid: string;
12
+ createdAt: string;
13
+ updatedAt: string;
14
+ message: string;
15
+ manifest: string[];
16
+ userAgent: string;
17
+ appVersion: string;
18
+ files: import("../helpers").MongooseInterface<{
19
+ originalName: {
20
+ type: StringConstructor;
21
+ default: string;
22
+ };
23
+ encoding: {
24
+ type: StringConstructor;
25
+ default: string;
26
+ };
27
+ mimeType: {
28
+ type: StringConstructor;
29
+ default: string;
30
+ };
31
+ fieldname: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
35
+ localPath: {
36
+ type: StringConstructor;
37
+ default: string;
38
+ };
39
+ remotePath: {
40
+ type: StringConstructor;
41
+ default: string;
42
+ };
43
+ hostname: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
47
+ size: {
48
+ type: NumberConstructor;
49
+ default: number;
50
+ };
51
+ received: {
52
+ type: DateConstructor;
53
+ default: typeof currentDate;
54
+ };
55
+ }>[];
56
+ }, {}> & {
57
+ __methods?: unknown;
58
+ }>;
59
+ export interface RemoteLogStream extends ItemTypeFromTypeSchemaFunction<typeof RemoteLogStreamModule> {
60
+ }
61
+ export interface RemoteLogStreamModel extends ModelTypeFromTypeSchemaFunction<RemoteLogStream> {
62
+ }
63
+ declare const _default: ReplaceModelReturnType<typeof RemoteLogStreamModule, RemoteLogStreamModel>;
64
+ export default _default;
65
+ //# sourceMappingURL=remote-log-stream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remote-log-stream.d.ts","sourceRoot":"","sources":["../../src/models/remote-log-stream.ts"],"names":[],"mappings":";AACA,OAAO,EACL,cAAc,EAGd,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACtB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsHnE;AAED,MAAM,WAAW,eAAgB,SAAQ,8BAA8B,CAAC,OAAO,qBAAqB,CAAC;CAAI;AACzG,MAAM,WAAW,oBAAqB,SAAQ,+BAA+B,CAAC,eAAe,CAAC;CAAI;;AAClG,wBAAmH"}
@@ -5,13 +5,16 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
5
5
  departmentId: string;
6
6
  userId: string;
7
7
  session: string;
8
+ requestId: string;
8
9
  active: boolean;
9
10
  uuid: string;
10
- requestId: string;
11
- received: string;
12
- hostname: string;
11
+ createdAt: string;
12
+ updatedAt: string;
13
13
  status: string;
14
- lastStatusChange: string;
14
+ message: string;
15
+ manifest: string[];
16
+ userAgent: string;
17
+ appVersion: string;
15
18
  files: import("../helpers").MongooseInterface<{
16
19
  originalName: {
17
20
  type: StringConstructor;
@@ -25,6 +28,10 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
25
28
  type: StringConstructor;
26
29
  default: string;
27
30
  };
31
+ fieldname: {
32
+ type: StringConstructor;
33
+ default: string;
34
+ };
28
35
  localPath: {
29
36
  type: StringConstructor;
30
37
  default: string;
@@ -33,6 +40,10 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
33
40
  type: StringConstructor;
34
41
  default: string;
35
42
  };
43
+ hostname: {
44
+ type: StringConstructor;
45
+ default: string;
46
+ };
36
47
  size: {
37
48
  type: NumberConstructor;
38
49
  default: number;
@@ -1 +1 @@
1
- {"version":3,"file":"remote-log.d.ts","sourceRoot":"","sources":["../../src/models/remote-log.ts"],"names":[],"mappings":";AACA,OAAO,EACL,cAAc,EAGd,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACtB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAsB,eAAe,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8F7D;AAED,MAAM,WAAW,SAAU,SAAQ,8BAA8B,CAAC,OAAO,eAAe,CAAC;CAAI;AAC7F,MAAM,WAAW,cAAe,SAAQ,+BAA+B,CAAC,SAAS,CAAC;CAAI;;AACtF,wBAAiG"}
1
+ {"version":3,"file":"remote-log.d.ts","sourceRoot":"","sources":["../../src/models/remote-log.ts"],"names":[],"mappings":";AACA,OAAO,EACL,cAAc,EAGd,8BAA8B,EAC9B,+BAA+B,EAC/B,sBAAsB,EACtB,WAAW,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAsB,eAAe,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuH7D;AAED,MAAM,WAAW,SAAU,SAAQ,8BAA8B,CAAC,OAAO,eAAe,CAAC;CAAI;AAC7F,MAAM,WAAW,cAAe,SAAQ,+BAA+B,CAAC,SAAS,CAAC;CAAI;;AACtF,wBAAiG"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tabletcommand-backend-models",
3
- "version": "5.38.7",
3
+ "version": "5.39.0",
4
4
  "description": "Tablet Command Backend Models",
5
5
  "scripts": {
6
6
  "build": "gulp build",
@@ -23,7 +23,7 @@
23
23
  "moment-timezone": "^0.5.45",
24
24
  "mongoose": "=5.10.19",
25
25
  "mongoose-lean-virtuals": "^0.7.6",
26
- "uuid": "~9.0.1"
26
+ "uuid": "~10.0.0"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/bluebird": "^3.5.42",
@@ -32,7 +32,7 @@
32
32
  "@types/mocha": "^10.0.7",
33
33
  "@types/mongodb": "^3.6.20",
34
34
  "@types/mongoose": "~5.10.5",
35
- "@types/uuid": "~9.0.8",
35
+ "@types/uuid": "~10.0.0",
36
36
  "@typescript-eslint/eslint-plugin": "~6.20.0",
37
37
  "@typescript-eslint/parser": "~6.20.0",
38
38
  "chai": "^4.3.10",
@@ -41,7 +41,7 @@
41
41
  "eslint": "^8.57.0",
42
42
  "gulp": "^4.0.2",
43
43
  "gulp-shell": "^0.8.0",
44
- "mocha": "^10.5.0",
44
+ "mocha": "^10.6.0",
45
45
  "ts-node": "^10.9.2",
46
46
  "type-coverage": "^2.29.0",
47
47
  "typescript": "~4.7.4",
@@ -0,0 +1,134 @@
1
+ import * as uuid from "uuid";
2
+ import {
3
+ MongooseModule,
4
+ createSchema,
5
+ createModel,
6
+ ItemTypeFromTypeSchemaFunction,
7
+ ModelTypeFromTypeSchemaFunction,
8
+ ReplaceModelReturnType,
9
+ currentDate,
10
+ } from "../helpers";
11
+
12
+ export async function RemoteLogStreamModule(mongoose: MongooseModule) {
13
+ const { Schema, Types } = mongoose;
14
+
15
+ const FileSchema = createSchema(Schema, {
16
+ originalName: {
17
+ type: String,
18
+ default: "", // e.g database.sqlite
19
+ },
20
+ encoding: {
21
+ type: String,
22
+ default: "", // e.g utf8
23
+ },
24
+ mimeType: {
25
+ type: String,
26
+ default: "", // e.g application/text
27
+ },
28
+ fieldname: {
29
+ type: String,
30
+ default: "", // e.g "database" or "logs"
31
+ },
32
+ localPath: {
33
+ type: String,
34
+ default: "", // e.g /tmp/some/path
35
+ },
36
+ remotePath: {
37
+ type: String,
38
+ default: "", // e.g https://google.com?
39
+ },
40
+ hostname: {
41
+ type: String,
42
+ default: "", // e.g ip-10-6-56-205.ca-central-1.compute.internal
43
+ },
44
+ size: {
45
+ type: Number,
46
+ default: 0,
47
+ },
48
+ received: {
49
+ type: Date,
50
+ default: currentDate,
51
+ },
52
+ }, {
53
+ _id: false,
54
+ id: false,
55
+ });
56
+
57
+ const modelSchema = createSchema(Schema, {
58
+ _id: {
59
+ type: Types.ObjectId,
60
+ auto: true,
61
+ },
62
+ departmentId: {
63
+ type: String,
64
+ default: "",
65
+ required: true,
66
+ index: true,
67
+ },
68
+ userId: {
69
+ type: String,
70
+ default: "",
71
+ },
72
+ session: {
73
+ type: String,
74
+ default: "",
75
+ },
76
+ requestId: {
77
+ type: String,
78
+ default: uuid.v4,
79
+ },
80
+ requested: {
81
+ type: Date,
82
+ },
83
+ active: {
84
+ type: Boolean,
85
+ default: false,
86
+ },
87
+ uuid: {
88
+ type: String,
89
+ default: uuid.v4,
90
+ },
91
+ createdAt: {
92
+ type: Date,
93
+ default: currentDate,
94
+ },
95
+ updatedAt: {
96
+ type: Date,
97
+ default: currentDate,
98
+ },
99
+ // Formerly message.title
100
+ message: {
101
+ type: String,
102
+ default: "",
103
+ },
104
+ // Formerly message.body
105
+ manifest: {
106
+ type: [String],
107
+ default: [],
108
+ },
109
+ // Formerly message.type.typeOpts.userAgent
110
+ userAgent: {
111
+ type: String,
112
+ default: "",
113
+ },
114
+ // Formerly message.type.typeOpts.appVersion
115
+ appVersion: {
116
+ type: String,
117
+ default: "",
118
+ },
119
+ files: {
120
+ type: [FileSchema],
121
+ default: [],
122
+ },
123
+ }, {
124
+ autoIndex: false,
125
+ collection: "massive_remote_log_stream",
126
+ timestamps: true,
127
+ });
128
+
129
+ return createModel(mongoose, "RemoteLogStream", modelSchema);
130
+ }
131
+
132
+ export interface RemoteLogStream extends ItemTypeFromTypeSchemaFunction<typeof RemoteLogStreamModule> { }
133
+ export interface RemoteLogStreamModel extends ModelTypeFromTypeSchemaFunction<RemoteLogStream> { }
134
+ export default RemoteLogStreamModule as ReplaceModelReturnType<typeof RemoteLogStreamModule, RemoteLogStreamModel>;
@@ -25,6 +25,10 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
25
25
  type: String,
26
26
  default: "", // e.g application/text
27
27
  },
28
+ fieldname: {
29
+ type: String,
30
+ default: "", // e.g "database" or "logs"
31
+ },
28
32
  localPath: {
29
33
  type: String,
30
34
  default: "", // e.g /tmp/some/path
@@ -33,6 +37,10 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
33
37
  type: String,
34
38
  default: "", // e.g https://google.com?
35
39
  },
40
+ hostname: {
41
+ type: String,
42
+ default: "", // e.g ip-10-6-56-205.ca-central-1.compute.internal
43
+ },
36
44
  size: {
37
45
  type: Number,
38
46
  default: 0,
@@ -65,6 +73,10 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
65
73
  type: String,
66
74
  default: "",
67
75
  },
76
+ requestId: {
77
+ type: String,
78
+ default: uuid.v4,
79
+ },
68
80
  active: {
69
81
  type: Boolean,
70
82
  default: false,
@@ -73,34 +85,47 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
73
85
  type: String,
74
86
  default: uuid.v4,
75
87
  },
76
- requestId: {
77
- type: String,
78
- default: uuid.v4,
88
+ createdAt: {
89
+ type: Date,
90
+ default: currentDate,
79
91
  },
80
- received: {
92
+ updatedAt: {
81
93
  type: Date,
82
94
  default: currentDate,
83
95
  },
84
- hostname: {
96
+ status: {
97
+ type: String,
98
+ default: "", // local, uploading, synced (uploaded to a remote storage)
99
+ },
100
+ // Formerly message.title
101
+ message: {
85
102
  type: String,
86
103
  default: "",
87
104
  },
88
- status: {
105
+ // Formerly message.body
106
+ manifest: {
107
+ type: [String],
108
+ default: [],
109
+ },
110
+ // Formerly message.type.typeOpts.userAgent
111
+ userAgent: {
89
112
  type: String,
90
- default: "", // local, uploading, synced (uploaded to a remote storage)
113
+ default: "",
91
114
  },
92
- lastStatusChange: {
93
- type: Date,
94
- default: currentDate,
115
+ // Formerly message.type.typeOpts.appVersion
116
+ appVersion: {
117
+ type: String,
118
+ default: "",
95
119
  },
96
120
  files: {
97
121
  type: [FileSchema],
98
122
  default: [],
99
123
  },
100
124
  }, {
101
- collection: "massive_remote_log",
125
+ autoIndex: false,
126
+ collection: "massive_remote_log_stream",
127
+ timestamps: true,
102
128
  });
103
- modelSchema.set("autoIndex", false);
104
129
 
105
130
  return createModel(mongoose, "RemoteLog", modelSchema);
106
131
  }