testeranto 0.79.67 → 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "testeranto",
3
3
  "description": "teeny tiny tightly-typed typescript tests",
4
- "version": "0.79.67",
4
+ "version": "0.79.68",
5
5
  "engines": {
6
6
  "node": "18.18.0"
7
7
  },
@@ -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(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
81
- .connect()
82
- .then(async (conn) => {
83
- const db = conn.db("taskman");
84
- await mongoose.connect(
85
- `mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`
86
- );
87
-
88
- const usersModel = mongoose.model<IUser>("User", userSchema);
89
- const kanbanModel = mongoose.model<IKanban>("Kanban", kanbanSchema);
90
- const ganttModel = mongoose.model<IGantt>("Gantt", ganttSchema);
91
- const featuresModel = mongoose.model<any>("Features", featuresSchema);
92
- // const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
93
- // const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
94
-
95
- const MessagesModel = mongoose.model<any>(
96
- "Messages",
97
- chatCatMessageSchema
98
- );
99
-
100
- const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
101
- const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
102
- const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
103
-
104
- app.get("/TaskManFrontend.js", (req, res) => {
105
- res.sendFile(`${process.cwd()}/docs/TaskManFrontEnd.js`);
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.get("/TaskManFrontEnd.css", (req, res) => {
109
- res.sendFile(`${process.cwd()}/docs/TaskManFrontEnd.css`);
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
- // app.get(`/preMergeCheck`, async (req, res) => {
113
- // const commit = req.params["commit"];
114
- // // res.json(await keyedModels[key].find({}));
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
  };