testeranto 0.79.66 → 0.79.68
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/Report.Dockerfile +1 -1
- package/dist/common/TaskManBackEnd.js +7 -5
- package/dist/common/tsconfig.common.tsbuildinfo +1 -1
- package/dist/module/TaskManBackEnd.js +7 -5
- package/dist/module/tsconfig.module.tsbuildinfo +1 -1
- package/dist/prebuild/TaskManBackEnd.mjs +4 -8
- package/dist/types/tsconfig.types.tsbuildinfo +1 -1
- package/docker-compose.yml +37 -0
- package/package.json +1 -1
- package/src/TaskManBackEnd.ts +124 -126
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
version: "0.1"
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
report:
|
|
5
|
+
image: us-west1-docker.pkg.dev/dev-trail-450920-p2/testeranto-docker/report:latest
|
|
6
|
+
container_name: report
|
|
7
|
+
ports:
|
|
8
|
+
- 8080:8080
|
|
9
|
+
|
|
10
|
+
mongodb:
|
|
11
|
+
image: mongo
|
|
12
|
+
container_name: mongodb
|
|
13
|
+
environment:
|
|
14
|
+
- PUID=1000
|
|
15
|
+
- PGID=1000
|
|
16
|
+
volumes:
|
|
17
|
+
- /home/barry/mongodb/database:/data/db
|
|
18
|
+
ports:
|
|
19
|
+
- 27017:27017
|
|
20
|
+
restart: unless-stopped
|
|
21
|
+
# services:
|
|
22
|
+
|
|
23
|
+
# counter:
|
|
24
|
+
# image: gcr.io/${PROJECT_ID}/gcb-docker-compose:latest
|
|
25
|
+
# container_name: counter
|
|
26
|
+
# depends_on:
|
|
27
|
+
# - redis
|
|
28
|
+
# ports:
|
|
29
|
+
# - "50051:50051"
|
|
30
|
+
# environment:
|
|
31
|
+
# - REDIS_HOST=redis
|
|
32
|
+
# - REDIS_PORT=6379
|
|
33
|
+
|
|
34
|
+
# redis:
|
|
35
|
+
# image: redis
|
|
36
|
+
# ports:
|
|
37
|
+
# - "6379:6379"
|
package/package.json
CHANGED
package/src/TaskManBackEnd.ts
CHANGED
|
@@ -23,6 +23,8 @@ import { IBaseConfig } from "./lib/types";
|
|
|
23
23
|
console.log("hello TaskMan Backend", process.env);
|
|
24
24
|
|
|
25
25
|
const port = process.env.PORT || "8080";
|
|
26
|
+
const mongoConnect =
|
|
27
|
+
process.env.MONGO_CONNECTION || "mongodb://127.0.0.1:27017";
|
|
26
28
|
|
|
27
29
|
function findTextFiles(dir: string, fileList: string[] = []) {
|
|
28
30
|
const files = fs.readdirSync(dir);
|
|
@@ -77,62 +79,131 @@ export default (partialConfig: IBaseConfig) => {
|
|
|
77
79
|
|
|
78
80
|
const app = express();
|
|
79
81
|
|
|
80
|
-
new MongoClient(
|
|
81
|
-
.
|
|
82
|
-
.
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
82
|
+
new MongoClient(mongoConnect).connect().then(async (conn) => {
|
|
83
|
+
const db = conn.db("taskman");
|
|
84
|
+
await mongoose.connect(`${mongoConnect}/taskman`);
|
|
85
|
+
// await mongoose.connect(
|
|
86
|
+
// `mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`
|
|
87
|
+
// );
|
|
88
|
+
|
|
89
|
+
const usersModel = mongoose.model<IUser>("User", userSchema);
|
|
90
|
+
const kanbanModel = mongoose.model<IKanban>("Kanban", kanbanSchema);
|
|
91
|
+
const ganttModel = mongoose.model<IGantt>("Gantt", ganttSchema);
|
|
92
|
+
const featuresModel = mongoose.model<any>("Features", featuresSchema);
|
|
93
|
+
// const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
|
|
94
|
+
// const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
|
|
95
|
+
|
|
96
|
+
const MessagesModel = mongoose.model<any>("Messages", chatCatMessageSchema);
|
|
97
|
+
|
|
98
|
+
const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
|
|
99
|
+
const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
|
|
100
|
+
const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
|
|
101
|
+
|
|
102
|
+
app.get("/TaskManFrontend.js", (req, res) => {
|
|
103
|
+
res.sendFile(`${process.cwd()}/docs/TaskManFrontEnd.js`);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
107
|
+
res.sendFile(`${process.cwd()}/docs/TaskManFrontEnd.css`);
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
// app.get(`/preMergeCheck`, async (req, res) => {
|
|
111
|
+
// const commit = req.params["commit"];
|
|
112
|
+
// // res.json(await keyedModels[key].find({}));
|
|
113
|
+
// });
|
|
114
|
+
|
|
115
|
+
// app.get("/TaskManFrontend.js", (req, res) => {
|
|
116
|
+
// res.sendFile(
|
|
117
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
|
|
118
|
+
// );
|
|
119
|
+
// });
|
|
120
|
+
|
|
121
|
+
// app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
122
|
+
// res.sendFile(
|
|
123
|
+
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
|
|
124
|
+
// );
|
|
125
|
+
// });
|
|
126
|
+
|
|
127
|
+
// app.get("/testeranto.json", (req, res) => {
|
|
128
|
+
// // res.sendFile(`${process.cwd()}/docs/testeranto.json`);
|
|
129
|
+
// res.json(config);
|
|
130
|
+
// });
|
|
131
|
+
|
|
132
|
+
// app.get("/", (req, res) => {
|
|
133
|
+
// res.send(`<!DOCTYPE html>
|
|
134
|
+
// <html lang="en">
|
|
135
|
+
|
|
136
|
+
// <head>
|
|
137
|
+
// <meta name="description" content="Webpage description goes here" />
|
|
138
|
+
// <meta charset="utf-8" />
|
|
139
|
+
// <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
140
|
+
// <meta name="author" content="" />
|
|
141
|
+
|
|
142
|
+
// <title>TaskMan</title>
|
|
143
|
+
|
|
144
|
+
// <link rel="stylesheet" href="/TaskManFrontEnd.css" />
|
|
145
|
+
// <script type="module" src="/TaskManFrontEnd.js"></script>
|
|
146
|
+
// </head>
|
|
147
|
+
|
|
148
|
+
// <body><div id="root">react is loading</div></body>
|
|
149
|
+
|
|
150
|
+
// </html>`);
|
|
151
|
+
// });
|
|
152
|
+
|
|
153
|
+
app.listen(port, () => {
|
|
154
|
+
console.log(`Example app listening on port ${port}`);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
///////////////////////////////////////////////
|
|
158
|
+
|
|
159
|
+
const keyedModels = {
|
|
160
|
+
users: usersModel,
|
|
161
|
+
kanbans: kanbanModel,
|
|
162
|
+
features: featuresModel,
|
|
163
|
+
gantts: ganttModel,
|
|
164
|
+
rooms: roomsModel,
|
|
165
|
+
huddles: huddleModdle,
|
|
166
|
+
messages: MessagesModel,
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
Object.keys(keyedModels).forEach((key) => {
|
|
170
|
+
app.get(`/${key}.json`, async (req, res) => {
|
|
171
|
+
console.log("GET", key, keyedModels[key]);
|
|
172
|
+
res.json(await keyedModels[key].find({}));
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
app.get(`/${key}/:id.json`, async (req, res) => {
|
|
176
|
+
res.json(
|
|
177
|
+
await keyedModels[key]
|
|
178
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
179
|
+
.toArray()
|
|
180
|
+
);
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
app.post(`/${key}/:id.json`, async (req, res) => {
|
|
184
|
+
res.json(
|
|
185
|
+
await keyedModels[key]
|
|
186
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
187
|
+
.toArray()
|
|
188
|
+
);
|
|
106
189
|
});
|
|
107
190
|
|
|
108
|
-
app.
|
|
109
|
-
res.
|
|
191
|
+
app.post(`/${key}.json`, async (req, res) => {
|
|
192
|
+
res.json(
|
|
193
|
+
await keyedModels[key]
|
|
194
|
+
.find({ id: { $eq: req.params["id"] } })
|
|
195
|
+
.toArray()
|
|
196
|
+
);
|
|
110
197
|
});
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
app.use("/", express.static(path.join(process.cwd())));
|
|
111
201
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
//
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// app.get("/TaskManFrontend.js", (req, res) => {
|
|
118
|
-
// res.sendFile(
|
|
119
|
-
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
|
|
120
|
-
// );
|
|
121
|
-
// });
|
|
122
|
-
|
|
123
|
-
// app.get("/TaskManFrontEnd.css", (req, res) => {
|
|
124
|
-
// res.sendFile(
|
|
125
|
-
// `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
|
|
126
|
-
// );
|
|
127
|
-
// });
|
|
128
|
-
|
|
129
|
-
// app.get("/testeranto.json", (req, res) => {
|
|
130
|
-
// // res.sendFile(`${process.cwd()}/docs/testeranto.json`);
|
|
131
|
-
// res.json(config);
|
|
132
|
-
// });
|
|
133
|
-
|
|
134
|
-
// app.get("/", (req, res) => {
|
|
135
|
-
// res.send(`<!DOCTYPE html>
|
|
202
|
+
app.get("/docGal/fs.json", (req, res) => {
|
|
203
|
+
const directoryPath = "./"; // Replace with the desired directory path
|
|
204
|
+
// const textFiles = findTextFiles(directoryPath);
|
|
205
|
+
res.json(listToTree(findTextFiles(directoryPath)));
|
|
206
|
+
// res.send(`<!DOCTYPE html>
|
|
136
207
|
// <html lang="en">
|
|
137
208
|
|
|
138
209
|
// <head>
|
|
@@ -150,79 +221,6 @@ export default (partialConfig: IBaseConfig) => {
|
|
|
150
221
|
// <body><div id="root">react is loading</div></body>
|
|
151
222
|
|
|
152
223
|
// </html>`);
|
|
153
|
-
// });
|
|
154
|
-
|
|
155
|
-
app.listen(port, () => {
|
|
156
|
-
console.log(`Example app listening on port ${port}`);
|
|
157
|
-
});
|
|
158
|
-
|
|
159
|
-
///////////////////////////////////////////////
|
|
160
|
-
|
|
161
|
-
const keyedModels = {
|
|
162
|
-
users: usersModel,
|
|
163
|
-
kanbans: kanbanModel,
|
|
164
|
-
features: featuresModel,
|
|
165
|
-
gantts: ganttModel,
|
|
166
|
-
rooms: roomsModel,
|
|
167
|
-
huddles: huddleModdle,
|
|
168
|
-
messages: MessagesModel,
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
Object.keys(keyedModels).forEach((key) => {
|
|
172
|
-
app.get(`/${key}.json`, async (req, res) => {
|
|
173
|
-
console.log("GET", key, keyedModels[key]);
|
|
174
|
-
res.json(await keyedModels[key].find({}));
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
app.get(`/${key}/:id.json`, async (req, res) => {
|
|
178
|
-
res.json(
|
|
179
|
-
await keyedModels[key]
|
|
180
|
-
.find({ id: { $eq: req.params["id"] } })
|
|
181
|
-
.toArray()
|
|
182
|
-
);
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
app.post(`/${key}/:id.json`, async (req, res) => {
|
|
186
|
-
res.json(
|
|
187
|
-
await keyedModels[key]
|
|
188
|
-
.find({ id: { $eq: req.params["id"] } })
|
|
189
|
-
.toArray()
|
|
190
|
-
);
|
|
191
|
-
});
|
|
192
|
-
|
|
193
|
-
app.post(`/${key}.json`, async (req, res) => {
|
|
194
|
-
res.json(
|
|
195
|
-
await keyedModels[key]
|
|
196
|
-
.find({ id: { $eq: req.params["id"] } })
|
|
197
|
-
.toArray()
|
|
198
|
-
);
|
|
199
|
-
});
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
app.use("/", express.static(path.join(process.cwd())));
|
|
203
|
-
|
|
204
|
-
app.get("/docGal/fs.json", (req, res) => {
|
|
205
|
-
const directoryPath = "./"; // Replace with the desired directory path
|
|
206
|
-
// const textFiles = findTextFiles(directoryPath);
|
|
207
|
-
res.json(listToTree(findTextFiles(directoryPath)));
|
|
208
|
-
// res.send(`<!DOCTYPE html>
|
|
209
|
-
// <html lang="en">
|
|
210
|
-
|
|
211
|
-
// <head>
|
|
212
|
-
// <meta name="description" content="Webpage description goes here" />
|
|
213
|
-
// <meta charset="utf-8" />
|
|
214
|
-
// <meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
215
|
-
// <meta name="author" content="" />
|
|
216
|
-
|
|
217
|
-
// <title>TaskMan</title>
|
|
218
|
-
|
|
219
|
-
// <link rel="stylesheet" href="/TaskManFrontEnd.css" />
|
|
220
|
-
// <script type="module" src="/TaskManFrontEnd.js"></script>
|
|
221
|
-
// </head>
|
|
222
|
-
|
|
223
|
-
// <body><div id="root">react is loading</div></body>
|
|
224
|
-
|
|
225
|
-
// </html>`);
|
|
226
|
-
});
|
|
227
224
|
});
|
|
225
|
+
});
|
|
228
226
|
};
|