testeranto 0.79.3 → 0.79.5

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.3",
4
+ "version": "0.79.5",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.mts",
7
7
  "module": "dist/module/index.js",
@@ -72,46 +72,58 @@ function listToTree(fileList) {
72
72
  return root.children;
73
73
  }
74
74
 
75
- new MongoClient(`mongodb://localhost:27017`).connect().then(async (conn) => {
76
- const db = conn.db("taskman");
77
- await mongoose.connect("mongodb://127.0.0.1:27017/taskman");
78
-
79
- const usersModel = mongoose.model<IUser>("User", userSchema);
80
- const kanbanModel = mongoose.model<IKanban>("Kanban", kanbanSchema);
81
- const ganttModel = mongoose.model<IGantt>("Gantt", ganttSchema);
82
- const featuresModel = mongoose.model<any>("Features", featuresSchema);
83
- // const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
84
- // const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
85
-
86
- const MessagesModel = mongoose.model<any>("Messages", chatCatMessageSchema);
87
-
88
- const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
89
- const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
90
- const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
91
-
92
- app.get(`/preMergeCheck`, async (req, res) => {
93
- const commit = req.params["commit"];
94
- // res.json(await keyedModels[key].find({}));
95
- });
96
-
97
- app.get("/TaskManFrontend.js", (req, res) => {
98
- res.sendFile(
99
- `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
75
+ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`)
76
+ .connect()
77
+ .then(async (conn) => {
78
+ const db = conn.db("taskman");
79
+ await mongoose.connect(
80
+ `mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`
100
81
  );
101
- });
102
82
 
103
- app.get("/TaskManFrontEnd.css", (req, res) => {
104
- res.sendFile(
105
- `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
106
- );
107
- });
83
+ const usersModel = mongoose.model<IUser>("User", userSchema);
84
+ const kanbanModel = mongoose.model<IKanban>("Kanban", kanbanSchema);
85
+ const ganttModel = mongoose.model<IGantt>("Gantt", ganttSchema);
86
+ const featuresModel = mongoose.model<any>("Features", featuresSchema);
87
+ // const roomsModel = mongoose.model<any>("Rooms", RoomSchema);
88
+ // const huddleModdle = mongoose.model<any>("Huddles", HuddleSchema);
108
89
 
109
- app.get("/testeranto.json", (req, res) => {
110
- res.sendFile(`${process.cwd()}/docs/testeranto.json`);
111
- });
90
+ const MessagesModel = mongoose.model<any>("Messages", chatCatMessageSchema);
91
+
92
+ const ChatChannel = mongoose.model("ChatChannel", channelsFeature);
93
+ const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
94
+ const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
95
+
96
+ app.get("/TaskManFrontend.js", (req, res) => {
97
+ res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
98
+ });
99
+
100
+ app.get("/TaskManFrontEnd.css", (req, res) => {
101
+ res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
102
+ });
103
+
104
+ // app.get(`/preMergeCheck`, async (req, res) => {
105
+ // const commit = req.params["commit"];
106
+ // // res.json(await keyedModels[key].find({}));
107
+ // });
108
+
109
+ // app.get("/TaskManFrontend.js", (req, res) => {
110
+ // res.sendFile(
111
+ // `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.js`
112
+ // );
113
+ // });
114
+
115
+ // app.get("/TaskManFrontEnd.css", (req, res) => {
116
+ // res.sendFile(
117
+ // `${process.cwd()}/node_modules/testeranto/dist/prebuild/TaskManFrontEnd.css`
118
+ // );
119
+ // });
120
+
121
+ app.get("/testeranto.json", (req, res) => {
122
+ res.sendFile(`${process.cwd()}/docs/testeranto.json`);
123
+ });
112
124
 
113
- app.get("/", (req, res) => {
114
- res.send(`<!DOCTYPE html>
125
+ app.get("/", (req, res) => {
126
+ res.send(`<!DOCTYPE html>
115
127
  <html lang="en">
116
128
 
117
129
  <head>
@@ -129,72 +141,78 @@ new MongoClient(`mongodb://localhost:27017`).connect().then(async (conn) => {
129
141
  <body><div id="root">react is loading</div></body>
130
142
 
131
143
  </html>`);
132
- });
133
-
134
- app.listen(port, () => {
135
- console.log(`Example app listening on port ${port}`);
136
- });
137
-
138
- ///////////////////////////////////////////////
139
-
140
- const keyedModels = {
141
- users: usersModel,
142
- kanbans: kanbanModel,
143
- features: featuresModel,
144
- gantts: ganttModel,
145
- rooms: roomsModel,
146
- huddles: huddleModdle,
147
- messages: MessagesModel,
148
- };
149
-
150
- Object.keys(keyedModels).forEach((key) => {
151
- app.get(`/${key}.json`, async (req, res) => {
152
- console.log("GET", key, keyedModels[key]);
153
- res.json(await keyedModels[key].find({}));
154
- });
155
-
156
- app.get(`/${key}/:id.json`, async (req, res) => {
157
- res.json(
158
- await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
159
- );
160
144
  });
161
145
 
162
- app.post(`/${key}/:id.json`, async (req, res) => {
163
- res.json(
164
- await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
165
- );
146
+ app.listen(port, () => {
147
+ console.log(`Example app listening on port ${port}`);
166
148
  });
167
149
 
168
- app.post(`/${key}.json`, async (req, res) => {
169
- res.json(
170
- await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
171
- );
150
+ ///////////////////////////////////////////////
151
+
152
+ const keyedModels = {
153
+ users: usersModel,
154
+ kanbans: kanbanModel,
155
+ features: featuresModel,
156
+ gantts: ganttModel,
157
+ rooms: roomsModel,
158
+ huddles: huddleModdle,
159
+ messages: MessagesModel,
160
+ };
161
+
162
+ Object.keys(keyedModels).forEach((key) => {
163
+ app.get(`/${key}.json`, async (req, res) => {
164
+ console.log("GET", key, keyedModels[key]);
165
+ res.json(await keyedModels[key].find({}));
166
+ });
167
+
168
+ app.get(`/${key}/:id.json`, async (req, res) => {
169
+ res.json(
170
+ await keyedModels[key]
171
+ .find({ id: { $eq: req.params["id"] } })
172
+ .toArray()
173
+ );
174
+ });
175
+
176
+ app.post(`/${key}/:id.json`, async (req, res) => {
177
+ res.json(
178
+ await keyedModels[key]
179
+ .find({ id: { $eq: req.params["id"] } })
180
+ .toArray()
181
+ );
182
+ });
183
+
184
+ app.post(`/${key}.json`, async (req, res) => {
185
+ res.json(
186
+ await keyedModels[key]
187
+ .find({ id: { $eq: req.params["id"] } })
188
+ .toArray()
189
+ );
190
+ });
172
191
  });
173
- });
174
192
 
175
- app.use("/docs", express.static(path.join(process.cwd(), "docs")));
193
+ app.use("/docs", express.static(path.join(process.cwd(), "docs")));
176
194
 
177
- app.get("/docGal/fs.json", (req, res) => {
178
- const directoryPath = "./"; // Replace with the desired directory path
179
- // const textFiles = findTextFiles(directoryPath);
180
- res.json(listToTree(findTextFiles(directoryPath)));
181
- // res.send(`<!DOCTYPE html>
182
- // <html lang="en">
195
+ app.get("/docGal/fs.json", (req, res) => {
196
+ const directoryPath = "./"; // Replace with the desired directory path
197
+ // const textFiles = findTextFiles(directoryPath);
198
+ res.json(listToTree(findTextFiles(directoryPath)));
199
+ // res.send(`<!DOCTYPE html>
200
+ // <html lang="en">
183
201
 
184
- // <head>
185
- // <meta name="description" content="Webpage description goes here" />
186
- // <meta charset="utf-8" />
187
- // <meta name="viewport" content="width=device-width, initial-scale=1" />
188
- // <meta name="author" content="" />
202
+ // <head>
203
+ // <meta name="description" content="Webpage description goes here" />
204
+ // <meta charset="utf-8" />
205
+ // <meta name="viewport" content="width=device-width, initial-scale=1" />
206
+ // <meta name="author" content="" />
189
207
 
190
- // <title>TaskMan</title>
208
+ // <title>TaskMan</title>
191
209
 
192
- // <link rel="stylesheet" href="/TaskManFrontEnd.css" />
193
- // <script type="module" src="/TaskManFrontEnd.js"></script>
194
- // </head>
210
+ // <link rel="stylesheet" href="/TaskManFrontEnd.css" />
211
+ // <script type="module" src="/TaskManFrontEnd.js"></script>
212
+ // </head>
195
213
 
196
- // <body><div id="root">react is loading</div></body>
214
+ // <body><div id="root">react is loading</div></body>
197
215
 
198
- // </html>`);
216
+ // </html>`);
217
+ });
199
218
  });
200
- });