tabletcommand-backend-models 5.39.5 → 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 +13 -42
- package/build/models/remote-log-stream.js.map +1 -1
- package/build/models/remote-log.js +13 -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 +3 -1
- package/definitions/models/remote-log-stream.d.ts.map +1 -1
- package/definitions/models/remote-log.d.ts +3 -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 +1 -1
- package/src/models/remote-log-stream.ts +14 -42
- package/src/models/remote-log.ts +14 -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,
|
@@ -117,7 +79,16 @@ async function RemoteLogStreamModule(mongoose) {
|
|
117
79
|
default: "",
|
118
80
|
},
|
119
81
|
file: {
|
120
|
-
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
|
121
92
|
},
|
122
93
|
}, {
|
123
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,qB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AI,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,
|
@@ -114,9 +76,18 @@ async function RemoteLogModule(mongoose) {
|
|
114
76
|
default: "",
|
115
77
|
},
|
116
78
|
files: {
|
117
|
-
type: [
|
79
|
+
type: [RemoteFile],
|
118
80
|
default: [],
|
119
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
|
+
},
|
120
91
|
}, {
|
121
92
|
autoIndex: false,
|
122
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,C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AAE,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"}
|
@@ -38,7 +38,7 @@ export declare function RemoteLogStreamModule(mongoose: MongooseModule): Promise
|
|
38
38
|
type: StringConstructor;
|
39
39
|
default: string;
|
40
40
|
};
|
41
|
-
|
41
|
+
remoteFilePath: {
|
42
42
|
type: StringConstructor;
|
43
43
|
default: string;
|
44
44
|
};
|
@@ -55,6 +55,8 @@ export declare function RemoteLogStreamModule(mongoose: MongooseModule): Promise
|
|
55
55
|
default: typeof currentDate;
|
56
56
|
};
|
57
57
|
}>;
|
58
|
+
remoteFolderPath: string;
|
59
|
+
remoteFolderId: string;
|
58
60
|
}, {}> & {
|
59
61
|
__methods?: unknown;
|
60
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"}
|
@@ -37,7 +37,7 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
|
|
37
37
|
type: StringConstructor;
|
38
38
|
default: string;
|
39
39
|
};
|
40
|
-
|
40
|
+
remoteFilePath: {
|
41
41
|
type: StringConstructor;
|
42
42
|
default: string;
|
43
43
|
};
|
@@ -54,6 +54,8 @@ export declare function RemoteLogModule(mongoose: MongooseModule): Promise<impor
|
|
54
54
|
default: typeof currentDate;
|
55
55
|
};
|
56
56
|
}>[];
|
57
|
+
remoteFolderPath: string;
|
58
|
+
remoteFolderId: string;
|
57
59
|
}, {}> & {
|
58
60
|
__methods?: unknown;
|
59
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
@@ -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,
|
@@ -125,7 +88,16 @@ export async function RemoteLogStreamModule(mongoose: MongooseModule) {
|
|
125
88
|
default: "",
|
126
89
|
},
|
127
90
|
file: {
|
128
|
-
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
|
129
101
|
},
|
130
102
|
}, {
|
131
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,
|
@@ -122,9 +85,18 @@ export async function RemoteLogModule(mongoose: MongooseModule) {
|
|
122
85
|
default: "",
|
123
86
|
},
|
124
87
|
files: {
|
125
|
-
type: [
|
88
|
+
type: [RemoteFile],
|
126
89
|
default: [],
|
127
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
|
+
},
|
128
100
|
}, {
|
129
101
|
autoIndex: false,
|
130
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
|
+
}
|