typespeed 0.0.1 → 2.0.2
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/LICENSE +21 -0
- package/README.md +34 -0
- package/dist/core.decorator.d.ts +18 -0
- package/dist/core.decorator.js +185 -0
- package/dist/core.decorator.js.map +1 -0
- package/dist/database.decorator.d.ts +24 -0
- package/dist/database.decorator.js +335 -0
- package/dist/database.decorator.js.map +1 -0
- package/dist/default/express-server.class.d.ts +15 -0
- package/dist/default/express-server.class.js +148 -0
- package/dist/default/express-server.class.js.map +1 -0
- package/dist/default/log-default.class.d.ts +6 -0
- package/dist/default/log-default.class.js +32 -0
- package/dist/default/log-default.class.js.map +1 -0
- package/dist/default/node-cache.class.d.ts +13 -0
- package/dist/default/node-cache.class.js +51 -0
- package/dist/default/node-cache.class.js.map +1 -0
- package/dist/default/pages/404.html +226 -0
- package/dist/default/pages/500.html +713 -0
- package/dist/default/read-write-db.class.d.ts +10 -0
- package/dist/default/read-write-db.class.js +66 -0
- package/dist/default/read-write-db.class.js.map +1 -0
- package/dist/default/redis.class.d.ts +5 -0
- package/dist/default/redis.class.js +32 -0
- package/dist/default/redis.class.js.map +1 -0
- package/dist/factory/cache-factory.class.d.ts +7 -0
- package/dist/factory/cache-factory.class.js +6 -0
- package/dist/factory/cache-factory.class.js.map +1 -0
- package/dist/factory/data-source-factory.class.d.ts +4 -0
- package/dist/factory/data-source-factory.class.js +6 -0
- package/dist/factory/data-source-factory.class.js.map +1 -0
- package/dist/factory/log-factory.class.d.ts +4 -0
- package/dist/factory/log-factory.class.js +6 -0
- package/dist/factory/log-factory.class.js.map +1 -0
- package/dist/factory/server-factory.class.d.ts +6 -0
- package/dist/factory/server-factory.class.js +9 -0
- package/dist/factory/server-factory.class.js.map +1 -0
- package/dist/route.decorator.d.ts +8 -0
- package/dist/route.decorator.js +87 -0
- package/dist/route.decorator.js.map +1 -0
- package/dist/typespeed.d.ts +12 -0
- package/dist/typespeed.js +39 -0
- package/dist/typespeed.js.map +1 -0
- package/package.json +39 -6
- package/src/core.decorator.ts +183 -0
- package/src/database.decorator.ts +342 -0
- package/src/default/express-server.class.ts +133 -0
- package/src/default/log-default.class.ts +19 -0
- package/src/default/node-cache.class.ts +39 -0
- package/src/default/pages/404.html +226 -0
- package/src/default/pages/500.html +713 -0
- package/src/default/read-write-db.class.ts +53 -0
- package/src/default/redis.class.ts +18 -0
- package/src/factory/cache-factory.class.ts +7 -0
- package/src/factory/data-source-factory.class.ts +4 -0
- package/src/factory/log-factory.class.ts +4 -0
- package/src/factory/server-factory.class.ts +6 -0
- package/src/route.decorator.ts +82 -0
- package/src/typespeed.ts +15 -0
- package/test/nodemon.json +6 -0
- package/test/package.json +18 -0
- package/test/src/aop-test.class.ts +29 -0
- package/test/src/config-development.json +15 -0
- package/test/src/config-production.json +15 -0
- package/test/src/config.json +46 -0
- package/test/src/custom-log.class.ts +26 -0
- package/test/src/entities/user-dto.class.ts +3 -0
- package/test/src/first-page.class.ts +46 -0
- package/test/src/main.ts +17 -0
- package/test/src/second-page.class.ts +43 -0
- package/test/src/test-database.class.ts +85 -0
- package/test/src/test-log.class.ts +9 -0
- package/test/src/test-orm.class.ts +74 -0
- package/test/src/user-model.class.ts +45 -0
- package/test/src/views/index.html +1 -0
- package/test/src/views/upload.html +14 -0
- package/test/static/favicon.ico +0 -0
- package/test/static/k.jpg +0 -0
- package/test/tsconfig.json +20 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { log, Model } from "../../";
|
|
2
|
+
import UserDto from "./entities/user-dto.class";
|
|
3
|
+
|
|
4
|
+
export default class UserModel extends Model {
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
async getUsers() {
|
|
8
|
+
const users = await this.findAll({
|
|
9
|
+
id: { $lt: 10, $lte: 20 }, "name": { $like: "%a%" },
|
|
10
|
+
$or: [{ id: 1 }, { id: 2 }]
|
|
11
|
+
});
|
|
12
|
+
log("users", users);
|
|
13
|
+
return "getUsers";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
async getUser(id: number) {
|
|
17
|
+
const user = await this.find({ id: id }, "");
|
|
18
|
+
log("user", user);
|
|
19
|
+
return "getUser";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async newUsers() {
|
|
23
|
+
const users = await this.create([
|
|
24
|
+
new UserDto(30, "UserDto 30"),
|
|
25
|
+
new UserDto(31, "UserDto 31"),
|
|
26
|
+
{ id: 33, name: "UserDto 33" }
|
|
27
|
+
]);
|
|
28
|
+
return "newUsers";
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async remove(id: number) {
|
|
32
|
+
const result = await this.delete({ id: id });
|
|
33
|
+
return "remove rows: " + result;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
async count() {
|
|
37
|
+
const result = await this.findCount("1");
|
|
38
|
+
return "we had users : " + result;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async editUser(id: number, name: string) {
|
|
42
|
+
const result = await this.update({ id: id }, { name: name });
|
|
43
|
+
return "edit user: " + result;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Hello {{ name }}!
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<html>
|
|
2
|
+
|
|
3
|
+
<head>
|
|
4
|
+
</head>
|
|
5
|
+
|
|
6
|
+
<body>
|
|
7
|
+
<form action="/upload" enctype="multipart/form-data" method="post">
|
|
8
|
+
<input type="text" name="title"><br>
|
|
9
|
+
<input type="file" name="upload" multiple="multiple"><br>
|
|
10
|
+
<input type="submit" value="Upload">
|
|
11
|
+
</form>
|
|
12
|
+
</body>
|
|
13
|
+
|
|
14
|
+
</html>
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "CommonJS",
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"emitDecoratorMetadata": true,
|
|
6
|
+
"experimentalDecorators": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"target": "ES2017",
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"outDir": "./dist",
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"typeRoots": [
|
|
14
|
+
"node_modules/@types"
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"./src/**/*.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"module": "CommonJS",
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"emitDecoratorMetadata": true,
|
|
6
|
+
"experimentalDecorators": true,
|
|
7
|
+
"allowSyntheticDefaultImports": true,
|
|
8
|
+
"forceConsistentCasingInFileNames": true,
|
|
9
|
+
"target": "ES2017",
|
|
10
|
+
"sourceMap": true,
|
|
11
|
+
"outDir": "./dist",
|
|
12
|
+
"baseUrl": "./",
|
|
13
|
+
"typeRoots": [
|
|
14
|
+
"node_modules/@types"
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
"include": [
|
|
18
|
+
"./src/**/*.ts"
|
|
19
|
+
],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"node_modules",
|
|
22
|
+
"dist",
|
|
23
|
+
"test"
|
|
24
|
+
]
|
|
25
|
+
}
|