tabletcommand-backend-models 5.39.4 → 5.39.6
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/build/models/remote-log-stream.js +21 -42
- package/build/models/remote-log-stream.js.map +1 -1
- package/build/models/remote-log.js +17 -42
- package/build/models/remote-log.js.map +1 -1
- package/build/models/schema/remote-file.js +50 -0
- package/build/models/schema/remote-file.js.map +1 -0
- package/definitions/models/remote-log-stream.d.ts +5 -1
- package/definitions/models/remote-log-stream.d.ts.map +1 -1
- package/definitions/models/remote-log.d.ts +4 -1
- package/definitions/models/remote-log.d.ts.map +1 -1
- package/definitions/models/schema/remote-file.d.ts +44 -0
- package/definitions/models/schema/remote-file.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/models/remote-log-stream.ts +22 -42
- package/src/models/remote-log.ts +18 -42
- package/src/models/schema/remote-file.ts +53 -0
- package/src/tsconfig.json +1 -0
@@ -3,49 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RemoteLogStreamModule = void 0;
|
4
4
|
const uuid = require("uuid");
|
5
5
|
const helpers_1 = require("../helpers");
|
6
|
+
const remote_file_1 = require("./schema/remote-file");
|
6
7
|
async function RemoteLogStreamModule(mongoose) {
|
7
8
|
const { Schema, Types } = mongoose;
|
8
|
-
const
|
9
|
-
|
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
|
-
});
|
9
|
+
const RemoteFile = (0, remote_file_1.default)(mongoose);
|
10
|
+
// This is almost identical to RemoteLog
|
49
11
|
const modelSchema = (0, helpers_1.createSchema)(Schema, {
|
50
12
|
_id: {
|
51
13
|
type: Types.ObjectId,
|
@@ -61,6 +23,10 @@ async function RemoteLogStreamModule(mongoose) {
|
|
61
23
|
type: String,
|
62
24
|
default: "",
|
63
25
|
},
|
26
|
+
isCADRequest: {
|
27
|
+
type: Boolean,
|
28
|
+
default: false,
|
29
|
+
},
|
64
30
|
session: {
|
65
31
|
type: String,
|
66
32
|
default: "",
|
@@ -88,6 +54,10 @@ async function RemoteLogStreamModule(mongoose) {
|
|
88
54
|
type: Date,
|
89
55
|
default: helpers_1.currentDate,
|
90
56
|
},
|
57
|
+
status: {
|
58
|
+
type: String,
|
59
|
+
default: "", // local, uploading, synced (uploaded to a remote storage)
|
60
|
+
},
|
91
61
|
// Formerly message.title
|
92
62
|
message: {
|
93
63
|
type: String,
|
@@ -109,7 +79,16 @@ async function RemoteLogStreamModule(mongoose) {
|
|
109
79
|
default: "",
|
110
80
|
},
|
111
81
|
file: {
|
112
|
-
type:
|
82
|
+
type: RemoteFile,
|
83
|
+
},
|
84
|
+
// Google Drive
|
85
|
+
remoteFolderPath: {
|
86
|
+
type: String,
|
87
|
+
default: "", // e.g https://drive.google.com/drive/folders/1efgEFG
|
88
|
+
},
|
89
|
+
remoteFolderId: {
|
90
|
+
type: String,
|
91
|
+
default: "", // e.g 1efgEFG
|
113
92
|
},
|
114
93
|
}, {
|
115
94
|
autoIndex: false,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"remote-log-stream.js","sourceRoot":"","sources":["../../src/models/remote-log-stream.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wCAQoB;
|
1
|
+
{"version":3,"file":"remote-log-stream.js","sourceRoot":"","sources":["../../src/models/remote-log-stream.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wCAQoB;AAEpB,sDAAoD;AAE7C,KAAK,UAAU,qBAAqB,CAAC,QAAwB;IAClE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,UAAU,GAAG,IAAA,qBAAgB,EAAC,QAAQ,CAAC,CAAC;IAE9C,wCAAwC;IACxC,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACvC,GAAG,EAAE;YACH,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,IAAI,EAAE,IAAI;SACX;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;SACZ;QACD,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;SACf;QACD,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,IAAI,CAAC,EAAE;SACjB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,IAAI;SACX;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,IAAI,CAAC,EAAE;SACjB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;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,IAAI,EAAE;YACJ,IAAI,EAAE,UAAU;SACjB;QACD,eAAe;QACf,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,qDAAqD;SACnE;QACD,cAAc,EAAE;YACd,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,cAAc;SAC5B;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;AA/FD,sDA+FC;AAID,kBAAe,qBAAmG,CAAC"}
|
@@ -3,49 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RemoteLogModule = void 0;
|
4
4
|
const uuid = require("uuid");
|
5
5
|
const helpers_1 = require("../helpers");
|
6
|
+
const remote_file_1 = require("./schema/remote-file");
|
6
7
|
async function RemoteLogModule(mongoose) {
|
7
8
|
const { Schema, Types } = mongoose;
|
8
|
-
const
|
9
|
-
|
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
|
-
});
|
9
|
+
const RemoteFile = (0, remote_file_1.default)(mongoose);
|
10
|
+
// This is almost identical to RemoteLogStream
|
49
11
|
const modelSchema = (0, helpers_1.createSchema)(Schema, {
|
50
12
|
_id: {
|
51
13
|
type: Types.ObjectId,
|
@@ -61,6 +23,10 @@ async function RemoteLogModule(mongoose) {
|
|
61
23
|
type: String,
|
62
24
|
default: "",
|
63
25
|
},
|
26
|
+
isCADRequest: {
|
27
|
+
type: Boolean,
|
28
|
+
default: false,
|
29
|
+
},
|
64
30
|
session: {
|
65
31
|
type: String,
|
66
32
|
default: "",
|
@@ -110,9 +76,18 @@ async function RemoteLogModule(mongoose) {
|
|
110
76
|
default: "",
|
111
77
|
},
|
112
78
|
files: {
|
113
|
-
type: [
|
79
|
+
type: [RemoteFile],
|
114
80
|
default: [],
|
115
81
|
},
|
82
|
+
// Google Drive
|
83
|
+
remoteFolderPath: {
|
84
|
+
type: String,
|
85
|
+
default: "", // e.g https://drive.google.com/drive/folders/1efgEFG
|
86
|
+
},
|
87
|
+
remoteFolderId: {
|
88
|
+
type: String,
|
89
|
+
default: "", // e.g 1efgEFG
|
90
|
+
},
|
116
91
|
}, {
|
117
92
|
autoIndex: false,
|
118
93
|
collection: "massive_remote_log_stream",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"remote-log.js","sourceRoot":"","sources":["../../src/models/remote-log.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wCAQoB;
|
1
|
+
{"version":3,"file":"remote-log.js","sourceRoot":"","sources":["../../src/models/remote-log.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,wCAQoB;AAEpB,sDAAoD;AAE7C,KAAK,UAAU,eAAe,CAAC,QAAwB;IAC5D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAEnC,MAAM,UAAU,GAAG,IAAA,qBAAgB,EAAC,QAAQ,CAAC,CAAC;IAE9C,8CAA8C;IAC9C,MAAM,WAAW,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QACvC,GAAG,EAAE;YACH,IAAI,EAAE,KAAK,CAAC,QAAQ;YACpB,IAAI,EAAE,IAAI;SACX;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,IAAI;SACZ;QACD,MAAM,EAAE;YACN,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;SACf;QACD,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE;SACZ;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,IAAI,CAAC,EAAE;SACjB;QACD,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,KAAK;SACf;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,IAAI,CAAC,EAAE;SACjB;QACD,SAAS,EAAE;YACT,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;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;QACD,eAAe;QACf,gBAAgB,EAAE;YAChB,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,qDAAqD;SACnE;QACD,cAAc,EAAE;YACd,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,cAAc;SAC5B;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;AA7FD,0CA6FC;AAID,kBAAe,eAAiF,CAAC"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const helpers_1 = require("../../helpers");
|
4
|
+
function RemoteFileSchema(mongoose) {
|
5
|
+
const { Schema } = mongoose;
|
6
|
+
const Item = (0, helpers_1.createSchema)(Schema, {
|
7
|
+
originalName: {
|
8
|
+
type: String,
|
9
|
+
default: "", // e.g database.sqlite
|
10
|
+
},
|
11
|
+
encoding: {
|
12
|
+
type: String,
|
13
|
+
default: "", // e.g utf8
|
14
|
+
},
|
15
|
+
mimeType: {
|
16
|
+
type: String,
|
17
|
+
default: "", // e.g application/text
|
18
|
+
},
|
19
|
+
fieldname: {
|
20
|
+
type: String,
|
21
|
+
default: "", // e.g "database" or "logs"
|
22
|
+
},
|
23
|
+
localPath: {
|
24
|
+
type: String,
|
25
|
+
default: "", // e.g /tmp/some/path
|
26
|
+
},
|
27
|
+
remoteFilePath: {
|
28
|
+
type: String,
|
29
|
+
default: "", // e.g https://drive.google.com/file/d/1abcABC/view?usp=drivesdk
|
30
|
+
},
|
31
|
+
hostname: {
|
32
|
+
type: String,
|
33
|
+
default: "", // e.g ip-10-6-56-205.ca-central-1.compute.internal
|
34
|
+
},
|
35
|
+
size: {
|
36
|
+
type: Number,
|
37
|
+
default: 0,
|
38
|
+
},
|
39
|
+
received: {
|
40
|
+
type: Date,
|
41
|
+
default: helpers_1.currentDate,
|
42
|
+
},
|
43
|
+
}, {
|
44
|
+
_id: false,
|
45
|
+
id: false,
|
46
|
+
});
|
47
|
+
return Item;
|
48
|
+
}
|
49
|
+
exports.default = RemoteFileSchema;
|
50
|
+
//# sourceMappingURL=remote-file.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"remote-file.js","sourceRoot":"","sources":["../../../src/models/schema/remote-file.ts"],"names":[],"mappings":";;AAAA,2CAIuB;AAEvB,SAAwB,gBAAgB,CAAC,QAAwB;IAC/D,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;IAE5B,MAAM,IAAI,GAAG,IAAA,sBAAY,EAAC,MAAM,EAAE;QAChC,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,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,2BAA2B;SACzC;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,qBAAqB;SACnC;QACD,cAAc,EAAE;YACd,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,gEAAgE;SAC9E;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,EAAE,EAAE,mDAAmD;SACjE;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,CAAC;SACX;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,qBAAW;SACrB;KACF,EAAE;QACD,GAAG,EAAE,KAAK;QACV,EAAE,EAAE,KAAK;KACV,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC;AA9CD,mCA8CC"}
|
@@ -4,6 +4,7 @@ export declare function RemoteLogStreamModule(mongoose: MongooseModule): Promise
|
|
4
4
|
_id: import("mongoose").Types.ObjectId;
|
5
5
|
departmentId: string;
|
6
6
|
userId: string;
|
7
|
+
isCADRequest: boolean;
|
7
8
|
session: string;
|
8
9
|
requestId: string;
|
9
10
|
requested: string;
|
@@ -11,6 +12,7 @@ export declare function RemoteLogStreamModule(mongoose: MongooseModule): Promise
|
|
11
12
|
uuid: string;
|
12
13
|
createdAt: string;
|
13
14
|
updatedAt: string;
|
15
|
+
status: string;
|
14
16
|
message: string;
|
15
17
|
manifest: string[];
|
16
18
|
userAgent: string;
|
@@ -36,7 +38,7 @@ export declare function RemoteLogStreamModule(mongoose: MongooseModule): Promise
|
|
36
38
|
type: StringConstructor;
|
37
39
|
default: string;
|
38
40
|
};
|
39
|
-
|
41
|
+
remoteFilePath: {
|
40
42
|
type: StringConstructor;
|
41
43
|
default: string;
|
42
44
|
};
|
@@ -53,6 +55,8 @@ export declare function RemoteLogStreamModule(mongoose: MongooseModule): Promise
|
|
53
55
|
default: typeof currentDate;
|
54
56
|
};
|
55
57
|
}>;
|
58
|
+
remoteFolderPath: string;
|
59
|
+
remoteFolderId: string;
|
56
60
|
}, {}> & {
|
57
61
|
__methods?: unknown;
|
58
62
|
}>;
|
@@ -1 +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;
|
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;AAIpB,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+FnE;AAED,MAAM,WAAW,eAAgB,SAAQ,8BAA8B,CAAC,OAAO,qBAAqB,CAAC;CAAI;AACzG,MAAM,WAAW,oBAAqB,SAAQ,+BAA+B,CAAC,eAAe,CAAC;CAAI;;AAClG,wBAAmH"}
|
@@ -4,6 +4,7 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
|
|
4
4
|
_id: import("mongoose").Types.ObjectId;
|
5
5
|
departmentId: string;
|
6
6
|
userId: string;
|
7
|
+
isCADRequest: boolean;
|
7
8
|
session: string;
|
8
9
|
requestId: string;
|
9
10
|
active: boolean;
|
@@ -36,7 +37,7 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
|
|
36
37
|
type: StringConstructor;
|
37
38
|
default: string;
|
38
39
|
};
|
39
|
-
|
40
|
+
remoteFilePath: {
|
40
41
|
type: StringConstructor;
|
41
42
|
default: string;
|
42
43
|
};
|
@@ -53,6 +54,8 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
|
|
53
54
|
default: typeof currentDate;
|
54
55
|
};
|
55
56
|
}>[];
|
57
|
+
remoteFolderPath: string;
|
58
|
+
remoteFolderId: string;
|
56
59
|
}, {}> & {
|
57
60
|
__methods?: unknown;
|
58
61
|
}>;
|
@@ -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;
|
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;AAIpB,wBAAsB,eAAe,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6F7D;AAED,MAAM,WAAW,SAAU,SAAQ,8BAA8B,CAAC,OAAO,eAAe,CAAC;CAAI;AAC7F,MAAM,WAAW,cAAe,SAAQ,+BAA+B,CAAC,SAAS,CAAC;CAAI;;AACtF,wBAAiG"}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
/// <reference types="mongoose" />
|
2
|
+
import { MongooseModule, currentDate } from "../../helpers";
|
3
|
+
export default function RemoteFileSchema(mongoose: MongooseModule): import("mongoose").Schema<any> & {
|
4
|
+
_interface: import("../../helpers").MongooseInterface<{
|
5
|
+
originalName: {
|
6
|
+
type: StringConstructor;
|
7
|
+
default: string;
|
8
|
+
};
|
9
|
+
encoding: {
|
10
|
+
type: StringConstructor;
|
11
|
+
default: string;
|
12
|
+
};
|
13
|
+
mimeType: {
|
14
|
+
type: StringConstructor;
|
15
|
+
default: string;
|
16
|
+
};
|
17
|
+
fieldname: {
|
18
|
+
type: StringConstructor;
|
19
|
+
default: string;
|
20
|
+
};
|
21
|
+
localPath: {
|
22
|
+
type: StringConstructor;
|
23
|
+
default: string;
|
24
|
+
};
|
25
|
+
remoteFilePath: {
|
26
|
+
type: StringConstructor;
|
27
|
+
default: string;
|
28
|
+
};
|
29
|
+
hostname: {
|
30
|
+
type: StringConstructor;
|
31
|
+
default: string;
|
32
|
+
};
|
33
|
+
size: {
|
34
|
+
type: NumberConstructor;
|
35
|
+
default: number;
|
36
|
+
};
|
37
|
+
received: {
|
38
|
+
type: DateConstructor;
|
39
|
+
default: typeof currentDate;
|
40
|
+
};
|
41
|
+
}>;
|
42
|
+
_methods: unknown;
|
43
|
+
};
|
44
|
+
//# sourceMappingURL=remote-file.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"remote-file.d.ts","sourceRoot":"","sources":["../../../src/models/schema/remote-file.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,cAAc,EAEd,WAAW,EACZ,MAAM,eAAe,CAAC;AAEvB,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,QAAQ,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA8ChE"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "tabletcommand-backend-models",
|
3
|
-
"version": "5.39.
|
3
|
+
"version": "5.39.6",
|
4
4
|
"description": "Tablet Command Backend Models",
|
5
5
|
"scripts": {
|
6
6
|
"build": "gulp build",
|
@@ -43,7 +43,7 @@
|
|
43
43
|
"gulp-shell": "^0.8.0",
|
44
44
|
"mocha": "^10.6.0",
|
45
45
|
"ts-node": "^10.9.2",
|
46
|
-
"type-coverage": "^2.29.
|
46
|
+
"type-coverage": "^2.29.1",
|
47
47
|
"typescript": "~4.7.4",
|
48
48
|
"yargs-parser": ">=21.1.1"
|
49
49
|
},
|
@@ -9,51 +9,14 @@ import {
|
|
9
9
|
currentDate,
|
10
10
|
} from "../helpers";
|
11
11
|
|
12
|
+
import RemoteFileSchema from "./schema/remote-file";
|
13
|
+
|
12
14
|
export async function RemoteLogStreamModule(mongoose: MongooseModule) {
|
13
15
|
const { Schema, Types } = mongoose;
|
14
16
|
|
15
|
-
const
|
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
|
-
});
|
17
|
+
const RemoteFile = RemoteFileSchema(mongoose);
|
56
18
|
|
19
|
+
// This is almost identical to RemoteLog
|
57
20
|
const modelSchema = createSchema(Schema, {
|
58
21
|
_id: {
|
59
22
|
type: Types.ObjectId,
|
@@ -69,6 +32,10 @@ export async function RemoteLogStreamModule(mongoose: MongooseModule) {
|
|
69
32
|
type: String,
|
70
33
|
default: "",
|
71
34
|
},
|
35
|
+
isCADRequest: {
|
36
|
+
type: Boolean,
|
37
|
+
default: false,
|
38
|
+
},
|
72
39
|
session: {
|
73
40
|
type: String,
|
74
41
|
default: "",
|
@@ -96,6 +63,10 @@ export async function RemoteLogStreamModule(mongoose: MongooseModule) {
|
|
96
63
|
type: Date,
|
97
64
|
default: currentDate,
|
98
65
|
},
|
66
|
+
status: {
|
67
|
+
type: String,
|
68
|
+
default: "", // local, uploading, synced (uploaded to a remote storage)
|
69
|
+
},
|
99
70
|
// Formerly message.title
|
100
71
|
message: {
|
101
72
|
type: String,
|
@@ -117,7 +88,16 @@ export async function RemoteLogStreamModule(mongoose: MongooseModule) {
|
|
117
88
|
default: "",
|
118
89
|
},
|
119
90
|
file: {
|
120
|
-
type:
|
91
|
+
type: RemoteFile,
|
92
|
+
},
|
93
|
+
// Google Drive
|
94
|
+
remoteFolderPath: {
|
95
|
+
type: String,
|
96
|
+
default: "", // e.g https://drive.google.com/drive/folders/1efgEFG
|
97
|
+
},
|
98
|
+
remoteFolderId: {
|
99
|
+
type: String,
|
100
|
+
default: "", // e.g 1efgEFG
|
121
101
|
},
|
122
102
|
}, {
|
123
103
|
autoIndex: false,
|
package/src/models/remote-log.ts
CHANGED
@@ -9,51 +9,14 @@ import {
|
|
9
9
|
currentDate,
|
10
10
|
} from "../helpers";
|
11
11
|
|
12
|
+
import RemoteFileSchema from "./schema/remote-file";
|
13
|
+
|
12
14
|
export async function RemoteLogModule(mongoose: MongooseModule) {
|
13
15
|
const { Schema, Types } = mongoose;
|
14
16
|
|
15
|
-
const
|
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
|
-
});
|
17
|
+
const RemoteFile = RemoteFileSchema(mongoose);
|
56
18
|
|
19
|
+
// This is almost identical to RemoteLogStream
|
57
20
|
const modelSchema = createSchema(Schema, {
|
58
21
|
_id: {
|
59
22
|
type: Types.ObjectId,
|
@@ -69,6 +32,10 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
|
|
69
32
|
type: String,
|
70
33
|
default: "",
|
71
34
|
},
|
35
|
+
isCADRequest: {
|
36
|
+
type: Boolean,
|
37
|
+
default: false,
|
38
|
+
},
|
72
39
|
session: {
|
73
40
|
type: String,
|
74
41
|
default: "",
|
@@ -118,9 +85,18 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
|
|
118
85
|
default: "",
|
119
86
|
},
|
120
87
|
files: {
|
121
|
-
type: [
|
88
|
+
type: [RemoteFile],
|
122
89
|
default: [],
|
123
90
|
},
|
91
|
+
// Google Drive
|
92
|
+
remoteFolderPath: {
|
93
|
+
type: String,
|
94
|
+
default: "", // e.g https://drive.google.com/drive/folders/1efgEFG
|
95
|
+
},
|
96
|
+
remoteFolderId: {
|
97
|
+
type: String,
|
98
|
+
default: "", // e.g 1efgEFG
|
99
|
+
},
|
124
100
|
}, {
|
125
101
|
autoIndex: false,
|
126
102
|
collection: "massive_remote_log_stream",
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import {
|
2
|
+
MongooseModule,
|
3
|
+
createSchema,
|
4
|
+
currentDate,
|
5
|
+
} from "../../helpers";
|
6
|
+
|
7
|
+
export default function RemoteFileSchema(mongoose: MongooseModule) {
|
8
|
+
const { Schema } = mongoose;
|
9
|
+
|
10
|
+
const Item = createSchema(Schema, {
|
11
|
+
originalName: {
|
12
|
+
type: String,
|
13
|
+
default: "", // e.g database.sqlite
|
14
|
+
},
|
15
|
+
encoding: {
|
16
|
+
type: String,
|
17
|
+
default: "", // e.g utf8
|
18
|
+
},
|
19
|
+
mimeType: {
|
20
|
+
type: String,
|
21
|
+
default: "", // e.g application/text
|
22
|
+
},
|
23
|
+
fieldname: {
|
24
|
+
type: String,
|
25
|
+
default: "", // e.g "database" or "logs"
|
26
|
+
},
|
27
|
+
localPath: {
|
28
|
+
type: String,
|
29
|
+
default: "", // e.g /tmp/some/path
|
30
|
+
},
|
31
|
+
remoteFilePath: {
|
32
|
+
type: String,
|
33
|
+
default: "", // e.g https://drive.google.com/file/d/1abcABC/view?usp=drivesdk
|
34
|
+
},
|
35
|
+
hostname: {
|
36
|
+
type: String,
|
37
|
+
default: "", // e.g ip-10-6-56-205.ca-central-1.compute.internal
|
38
|
+
},
|
39
|
+
size: {
|
40
|
+
type: Number,
|
41
|
+
default: 0,
|
42
|
+
},
|
43
|
+
received: {
|
44
|
+
type: Date,
|
45
|
+
default: currentDate,
|
46
|
+
},
|
47
|
+
}, {
|
48
|
+
_id: false,
|
49
|
+
id: false,
|
50
|
+
});
|
51
|
+
|
52
|
+
return Item;
|
53
|
+
}
|