testeranto 0.79.32 → 0.79.34

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.
@@ -58,7 +58,6 @@ var RoomSchema = new mongoose.Schema({
58
58
  });
59
59
 
60
60
  // src/TaskManBackEnd.ts
61
- var app = express();
62
61
  var port = 3e3;
63
62
  function findTextFiles(dir, fileList = []) {
64
63
  const files = fs.readdirSync(dir);
@@ -97,30 +96,46 @@ function listToTree(fileList) {
97
96
  }
98
97
  return root.children;
99
98
  }
100
- new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`).connect().then(async (conn) => {
101
- const db = conn.db("taskman");
102
- await mongoose2.connect(
103
- `mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`
99
+ var TaskManBackEnd_default = (config) => {
100
+ fs.writeFileSync(
101
+ `${config.outdir}/testeranto.json`,
102
+ JSON.stringify(
103
+ {
104
+ ...config,
105
+ buildDir: process.cwd() + "/" + config.outdir
106
+ },
107
+ null,
108
+ 2
109
+ )
104
110
  );
105
- const usersModel = mongoose2.model("User", userSchema);
106
- const kanbanModel = mongoose2.model("Kanban", kanbanSchema);
107
- const ganttModel = mongoose2.model("Gantt", ganttSchema);
108
- const featuresModel = mongoose2.model("Features", featuresSchema);
109
- const MessagesModel = mongoose2.model("Messages", chatCatMessageSchema);
110
- const ChatChannel = mongoose2.model("ChatChannel", channelsFeature);
111
- const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
112
- const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
113
- app.get("/TaskManFrontend.js", (req, res) => {
114
- res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
115
- });
116
- app.get("/TaskManFrontEnd.css", (req, res) => {
117
- res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
118
- });
119
- app.get("/testeranto.json", (req, res) => {
120
- res.sendFile(`${process.cwd()}/docs/testeranto.json`);
121
- });
122
- app.get("/", (req, res) => {
123
- res.send(`<!DOCTYPE html>
111
+ const app = express();
112
+ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`).connect().then(async (conn) => {
113
+ const db = conn.db("taskman");
114
+ await mongoose2.connect(
115
+ `mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017/taskman`
116
+ );
117
+ const usersModel = mongoose2.model("User", userSchema);
118
+ const kanbanModel = mongoose2.model("Kanban", kanbanSchema);
119
+ const ganttModel = mongoose2.model("Gantt", ganttSchema);
120
+ const featuresModel = mongoose2.model("Features", featuresSchema);
121
+ const MessagesModel = mongoose2.model(
122
+ "Messages",
123
+ chatCatMessageSchema
124
+ );
125
+ const ChatChannel = mongoose2.model("ChatChannel", channelsFeature);
126
+ const huddleModdle = ChatChannel.discriminator("Huddle", HuddleSchema);
127
+ const roomsModel = ChatChannel.discriminator("Room", RoomSchema);
128
+ app.get("/TaskManFrontend.js", (req, res) => {
129
+ res.sendFile(`${process.cwd()}/TaskManFrontEnd.js`);
130
+ });
131
+ app.get("/TaskManFrontEnd.css", (req, res) => {
132
+ res.sendFile(`${process.cwd()}/TaskManFrontEnd.css`);
133
+ });
134
+ app.get("/testeranto.json", (req, res) => {
135
+ res.sendFile(`${process.cwd()}/docs/testeranto.json`);
136
+ });
137
+ app.get("/", (req, res) => {
138
+ res.send(`<!DOCTYPE html>
124
139
  <html lang="en">
125
140
 
126
141
  <head>
@@ -138,43 +153,47 @@ new MongoClient(`mongodb://${process.env.MONGO_HOST || "127.0.0.1"}:27017`).conn
138
153
  <body><div id="root">react is loading</div></body>
139
154
 
140
155
  </html>`);
141
- });
142
- app.listen(port, () => {
143
- console.log(`Example app listening on port ${port}`);
144
- });
145
- const keyedModels = {
146
- users: usersModel,
147
- kanbans: kanbanModel,
148
- features: featuresModel,
149
- gantts: ganttModel,
150
- rooms: roomsModel,
151
- huddles: huddleModdle,
152
- messages: MessagesModel
153
- };
154
- Object.keys(keyedModels).forEach((key) => {
155
- app.get(`/${key}.json`, async (req, res) => {
156
- console.log("GET", key, keyedModels[key]);
157
- res.json(await keyedModels[key].find({}));
158
156
  });
159
- app.get(`/${key}/:id.json`, async (req, res) => {
160
- res.json(
161
- await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
162
- );
157
+ app.listen(port, () => {
158
+ console.log(`Example app listening on port ${port}`);
163
159
  });
164
- app.post(`/${key}/:id.json`, async (req, res) => {
165
- res.json(
166
- await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
167
- );
160
+ const keyedModels = {
161
+ users: usersModel,
162
+ kanbans: kanbanModel,
163
+ features: featuresModel,
164
+ gantts: ganttModel,
165
+ rooms: roomsModel,
166
+ huddles: huddleModdle,
167
+ messages: MessagesModel
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
+ app.get(`/${key}/:id.json`, async (req, res) => {
175
+ res.json(
176
+ await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
177
+ );
178
+ });
179
+ app.post(`/${key}/:id.json`, async (req, res) => {
180
+ res.json(
181
+ await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
182
+ );
183
+ });
184
+ app.post(`/${key}.json`, async (req, res) => {
185
+ res.json(
186
+ await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
187
+ );
188
+ });
168
189
  });
169
- app.post(`/${key}.json`, async (req, res) => {
170
- res.json(
171
- await keyedModels[key].find({ id: { $eq: req.params["id"] } }).toArray()
172
- );
190
+ app.use("/docs", express.static(path.join(process.cwd(), "docs")));
191
+ app.get("/docGal/fs.json", (req, res) => {
192
+ const directoryPath = "./";
193
+ res.json(listToTree(findTextFiles(directoryPath)));
173
194
  });
174
195
  });
175
- app.use("/docs", express.static(path.join(process.cwd(), "docs")));
176
- app.get("/docGal/fs.json", (req, res) => {
177
- const directoryPath = "./";
178
- res.json(listToTree(findTextFiles(directoryPath)));
179
- });
180
- });
196
+ };
197
+ export {
198
+ TaskManBackEnd_default as default
199
+ };
@@ -1 +1,3 @@
1
- export {};
1
+ import { IBaseConfig } from "./lib/types";
2
+ declare const _default: (config: IBaseConfig) => void;
3
+ export default _default;