express-sweet 1.0.25 → 1.0.27
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/CHANGELOG.md +26 -1
- package/README.md +1 -1
- package/dist/build.common.js +4 -4
- package/dist/build.esm.js +6 -6
- package/docs/index.html +4 -4
- package/package.json +6 -8
- package/types/database/Database.d.ts +103 -84
- package/types/handlebars_helpers/string.d.ts +1 -1
- package/types/index.d.ts +1 -2
- package/types/interfaces/ViewOptions.d.ts +2 -2
- package/types/middlewares/Environment.d.ts +1 -1
- package/types/package.d.ts +0 -93
package/docs/index.html
CHANGED
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
<!--begin::Title-->
|
|
77
77
|
<h1 class="page-heading d-flex text-dark fw-bold fs-3 justify-content-center align-items-baseline my-0">
|
|
78
78
|
<!-- <h1 class="page-heading d-flex text-dark fw-bold fs-3 flex-column justify-content-center my-0"> -->
|
|
79
|
-
DevDocs<a href="#changelog" class="badge fw-semibold fs-7 px-2 ms-2 bg-body text-dark text-hover-primary shadow-sm">v1.0.
|
|
79
|
+
DevDocs<a href="#changelog" class="badge fw-semibold fs-7 px-2 ms-2 bg-body text-dark text-hover-primary shadow-sm">v1.0.26</a>
|
|
80
80
|
</h1>
|
|
81
81
|
<!--end::Title-->
|
|
82
82
|
</div>
|
|
@@ -1782,7 +1782,7 @@ module.exports = router;</code></pre>
|
|
|
1782
1782
|
<td>Extension for templates and partials files.<br>The default is <code>.hbs</code>.</td>
|
|
1783
1783
|
</tr>
|
|
1784
1784
|
<tr>
|
|
1785
|
-
<td class="mw-250px"><code>beforeRender: (res: express.Response) => void</code></td>
|
|
1785
|
+
<td class="mw-250px"><code>beforeRender: (req: express.Request, res: express.Response) => void</code></td>
|
|
1786
1786
|
<td>
|
|
1787
1787
|
Hook function just before the view is rendered.<br>
|
|
1788
1788
|
For example, you can set your own local variables that can be used within the view.<br>
|
|
@@ -1798,13 +1798,13 @@ module.exports = router;</code></pre>
|
|
|
1798
1798
|
*
|
|
1799
1799
|
* @example
|
|
1800
1800
|
* // The message set here can be referenced in the view as {{message}}.
|
|
1801
|
-
* beforeRender: res => {
|
|
1801
|
+
* beforeRender: (req, res) => {
|
|
1802
1802
|
* res.locals.message = 'Hello World';
|
|
1803
1803
|
* }
|
|
1804
1804
|
*
|
|
1805
1805
|
* @type {(res: express.Response) => void}
|
|
1806
1806
|
*/
|
|
1807
|
-
beforeRender: res => {
|
|
1807
|
+
beforeRender: (req, res) => {
|
|
1808
1808
|
res.locals.message = 'Hello World';
|
|
1809
1809
|
}</code></pre>
|
|
1810
1810
|
</div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-sweet",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.0.27",
|
|
4
|
+
"description": "Express framework extension.",
|
|
5
5
|
"main": "dist/build.common.js",
|
|
6
6
|
"module": "dist/build.esm.js",
|
|
7
7
|
"types": "types/index.d.ts",
|
|
@@ -19,12 +19,11 @@
|
|
|
19
19
|
],
|
|
20
20
|
"scripts": {
|
|
21
21
|
"watch": "node --max-old-space-size=8192 node_modules/rollup/dist/bin/rollup -c rollup.config.js --watch",
|
|
22
|
-
"prewatch": "rm -rf dist types
|
|
22
|
+
"prewatch": "rm -rf dist types",
|
|
23
23
|
"build": "node --max-old-space-size=8192 node_modules/rollup/dist/bin/rollup -c rollup.config.js",
|
|
24
|
-
"prebuild": "rm -rf dist types
|
|
24
|
+
"prebuild": "rm -rf dist types",
|
|
25
25
|
"test": "jest",
|
|
26
|
-
"start": "ts-node -r tsconfig-paths/register -P tsconfig.json -O '{\"module\":\"commonjs\"}' -e \"import * as index from '~/index';console.log(index);\""
|
|
27
|
-
"prestart": "json2module package.json > src/package.ts"
|
|
26
|
+
"start": "ts-node -r tsconfig-paths/register -P tsconfig.json -O '{\"module\":\"commonjs\"}' -e \"import * as index from '~/index';console.log(index);\""
|
|
28
27
|
},
|
|
29
28
|
"_moduleAliases": {
|
|
30
29
|
"~": "dist"
|
|
@@ -94,7 +93,7 @@
|
|
|
94
93
|
"passport": "^0.4.1",
|
|
95
94
|
"passport-local": "^1.0.0",
|
|
96
95
|
"redis": "^4.1.0",
|
|
97
|
-
"sequelize": "^
|
|
96
|
+
"sequelize": "^6.32.0",
|
|
98
97
|
"uniqid": "^5.2.0"
|
|
99
98
|
},
|
|
100
99
|
"devDependencies": {
|
|
@@ -113,7 +112,6 @@
|
|
|
113
112
|
"@types/passport-local": "^1.0.33",
|
|
114
113
|
"@types/validator": "^13.1.3",
|
|
115
114
|
"jest": "^26.6.3",
|
|
116
|
-
"json2module": "0.0.3",
|
|
117
115
|
"rollup": "^2.51.1",
|
|
118
116
|
"rollup-plugin-commonjs": "^10.1.0",
|
|
119
117
|
"rollup-plugin-json": "^4.0.0",
|
|
@@ -15,148 +15,167 @@ declare const _default: {
|
|
|
15
15
|
* @return {Promise<boolean>} Returns true if it can connect to the database, false if it cannot.
|
|
16
16
|
*/
|
|
17
17
|
isConnect(): Promise<boolean>;
|
|
18
|
+
fn: typeof sequelize.fn;
|
|
19
|
+
col: typeof sequelize.col;
|
|
20
|
+
cast: typeof sequelize.cast;
|
|
21
|
+
literal: typeof sequelize.literal;
|
|
22
|
+
and: typeof sequelize.and;
|
|
23
|
+
or: typeof sequelize.or;
|
|
24
|
+
json: typeof sequelize.json;
|
|
25
|
+
where: typeof sequelize.where;
|
|
18
26
|
Sequelize: typeof sequelize.Sequelize;
|
|
19
27
|
readonly config: sequelize.Config;
|
|
20
|
-
readonly modelManager: import("sequelize/types/
|
|
21
|
-
readonly connectionManager: import("sequelize/types/
|
|
28
|
+
readonly modelManager: import("sequelize/types/model-manager").ModelManager;
|
|
29
|
+
readonly connectionManager: import("sequelize/types/dialects/abstract/connection-manager").ConnectionManager;
|
|
22
30
|
readonly models: {
|
|
23
31
|
[key: string]: sequelize.ModelCtor<sequelize.Model<any, any>>;
|
|
24
32
|
};
|
|
25
|
-
beforeValidate(name: string, fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/
|
|
26
|
-
beforeValidate(fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/
|
|
27
|
-
afterValidate(name: string, fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/
|
|
28
|
-
afterValidate(fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/
|
|
29
|
-
beforeCreate(name: string, fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions) => void): void;
|
|
30
|
-
beforeCreate(fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions) => void): void;
|
|
31
|
-
afterCreate(name: string, fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions) => void): void;
|
|
32
|
-
afterCreate(fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions) => void): void;
|
|
33
|
+
beforeValidate(name: string, fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
|
|
34
|
+
beforeValidate(fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
|
|
35
|
+
afterValidate(name: string, fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
|
|
36
|
+
afterValidate(fn: (instance: sequelize.Model<any, any>, options: import("sequelize/types/instance-validator").ValidationOptions) => void): void;
|
|
37
|
+
beforeCreate(name: string, fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
|
|
38
|
+
beforeCreate(fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
|
|
39
|
+
afterCreate(name: string, fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
|
|
40
|
+
afterCreate(fn: (attributes: sequelize.Model<any, any>, options: sequelize.CreateOptions<any>) => void): void;
|
|
33
41
|
beforeDestroy(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
|
|
34
42
|
beforeDestroy(fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
|
|
35
43
|
afterDestroy(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
|
|
36
44
|
afterDestroy(fn: (instance: sequelize.Model<any, any>, options: sequelize.InstanceDestroyOptions) => void): void;
|
|
37
|
-
beforeUpdate(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions) => void): void;
|
|
38
|
-
beforeUpdate(fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions) => void): void;
|
|
39
|
-
afterUpdate(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions) => void): void;
|
|
40
|
-
afterUpdate(fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions) => void): void;
|
|
41
|
-
beforeBulkCreate(name: string, fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions) => void): void;
|
|
42
|
-
beforeBulkCreate(fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions) => void): void;
|
|
43
|
-
afterBulkCreate(name: string, fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions) => void): void;
|
|
44
|
-
afterBulkCreate(fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions) => void): void;
|
|
45
|
-
beforeBulkDestroy(name: string, fn: (options: sequelize.BulkCreateOptions) => void): void;
|
|
46
|
-
beforeBulkDestroy(fn: (options: sequelize.BulkCreateOptions) => void): void;
|
|
47
|
-
afterBulkDestroy(name: string, fn: (options: sequelize.DestroyOptions) => void): void;
|
|
48
|
-
afterBulkDestroy(fn: (options: sequelize.DestroyOptions) => void): void;
|
|
49
|
-
beforeBulkUpdate(name: string, fn: (options: sequelize.UpdateOptions) => void): void;
|
|
50
|
-
beforeBulkUpdate(fn: (options: sequelize.UpdateOptions) => void): void;
|
|
51
|
-
afterBulkUpdate(name: string, fn: (options: sequelize.UpdateOptions) => void): void;
|
|
52
|
-
afterBulkUpdate(fn: (options: sequelize.UpdateOptions) => void): void;
|
|
53
|
-
beforeFind(name: string, fn: (options: sequelize.FindOptions) => void): void;
|
|
54
|
-
beforeFind(fn: (options: sequelize.FindOptions) => void): void;
|
|
55
|
-
beforeFindAfterExpandIncludeAll(name: string, fn: (options: sequelize.FindOptions) => void): void;
|
|
56
|
-
beforeFindAfterExpandIncludeAll(fn: (options: sequelize.FindOptions) => void): void;
|
|
57
|
-
beforeFindAfterOptions(name: string, fn: (options: sequelize.FindOptions) => void): void;
|
|
58
|
-
beforeFindAfterOptions(fn: (options: sequelize.FindOptions) => void): void;
|
|
59
|
-
afterFind(name: string, fn: (instancesOrInstance: sequelize.Model<any, any> | sequelize.Model<any, any>[] | null, options: sequelize.FindOptions) => void): void;
|
|
60
|
-
afterFind(fn: (instancesOrInstance: sequelize.Model<any, any> | sequelize.Model<any, any>[] | null, options: sequelize.FindOptions) => void): void;
|
|
61
|
-
beforeDefine(name: string, fn: (attributes: sequelize.ModelAttributes<sequelize.Model<any, any
|
|
62
|
-
beforeDefine(fn: (attributes: sequelize.ModelAttributes<sequelize.Model<any, any
|
|
63
|
-
afterDefine(name: string, fn: (model:
|
|
64
|
-
afterDefine(fn: (model:
|
|
45
|
+
beforeUpdate(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
|
|
46
|
+
beforeUpdate(fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
|
|
47
|
+
afterUpdate(name: string, fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
|
|
48
|
+
afterUpdate(fn: (instance: sequelize.Model<any, any>, options: sequelize.UpdateOptions<any>) => void): void;
|
|
49
|
+
beforeBulkCreate(name: string, fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
|
|
50
|
+
beforeBulkCreate(fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
|
|
51
|
+
afterBulkCreate(name: string, fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
|
|
52
|
+
afterBulkCreate(fn: (instances: sequelize.Model<any, any>[], options: sequelize.BulkCreateOptions<any>) => void): void;
|
|
53
|
+
beforeBulkDestroy(name: string, fn: (options: sequelize.BulkCreateOptions<any>) => void): void;
|
|
54
|
+
beforeBulkDestroy(fn: (options: sequelize.BulkCreateOptions<any>) => void): void;
|
|
55
|
+
afterBulkDestroy(name: string, fn: (options: sequelize.DestroyOptions<any>) => void): void;
|
|
56
|
+
afterBulkDestroy(fn: (options: sequelize.DestroyOptions<any>) => void): void;
|
|
57
|
+
beforeBulkUpdate(name: string, fn: (options: sequelize.UpdateOptions<any>) => void): void;
|
|
58
|
+
beforeBulkUpdate(fn: (options: sequelize.UpdateOptions<any>) => void): void;
|
|
59
|
+
afterBulkUpdate(name: string, fn: (options: sequelize.UpdateOptions<any>) => void): void;
|
|
60
|
+
afterBulkUpdate(fn: (options: sequelize.UpdateOptions<any>) => void): void;
|
|
61
|
+
beforeFind(name: string, fn: (options: sequelize.FindOptions<any>) => void): void;
|
|
62
|
+
beforeFind(fn: (options: sequelize.FindOptions<any>) => void): void;
|
|
63
|
+
beforeFindAfterExpandIncludeAll(name: string, fn: (options: sequelize.FindOptions<any>) => void): void;
|
|
64
|
+
beforeFindAfterExpandIncludeAll(fn: (options: sequelize.FindOptions<any>) => void): void;
|
|
65
|
+
beforeFindAfterOptions(name: string, fn: (options: sequelize.FindOptions<any>) => void): void;
|
|
66
|
+
beforeFindAfterOptions(fn: (options: sequelize.FindOptions<any>) => void): void;
|
|
67
|
+
afterFind(name: string, fn: (instancesOrInstance: sequelize.Model<any, any> | sequelize.Model<any, any>[] | null, options: sequelize.FindOptions<any>) => void): void;
|
|
68
|
+
afterFind(fn: (instancesOrInstance: sequelize.Model<any, any> | sequelize.Model<any, any>[] | null, options: sequelize.FindOptions<any>) => void): void;
|
|
69
|
+
beforeDefine(name: string, fn: (attributes: sequelize.ModelAttributes<sequelize.Model<any, any>, any>, options: sequelize.ModelOptions<sequelize.Model<any, any>>) => void): void;
|
|
70
|
+
beforeDefine(fn: (attributes: sequelize.ModelAttributes<sequelize.Model<any, any>, any>, options: sequelize.ModelOptions<sequelize.Model<any, any>>) => void): void;
|
|
71
|
+
afterDefine(name: string, fn: (model: sequelize.ModelType<any, any>) => void): void;
|
|
72
|
+
afterDefine(fn: (model: sequelize.ModelType<any, any>) => void): void;
|
|
65
73
|
beforeInit(name: string, fn: (config: sequelize.Config, options: sequelize.Options) => void): void;
|
|
66
74
|
beforeInit(fn: (config: sequelize.Config, options: sequelize.Options) => void): void;
|
|
67
75
|
afterInit(name: string, fn: (sequelize: sequelize.Sequelize) => void): void;
|
|
68
76
|
afterInit(fn: (sequelize: sequelize.Sequelize) => void): void;
|
|
69
|
-
beforeBulkSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
70
|
-
beforeBulkSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
71
|
-
afterBulkSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
72
|
-
afterBulkSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
73
|
-
beforeSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
74
|
-
beforeSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
75
|
-
afterSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
76
|
-
afterSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/
|
|
77
|
+
beforeBulkSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
78
|
+
beforeBulkSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
79
|
+
afterBulkSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
80
|
+
afterBulkSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
81
|
+
beforeSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
82
|
+
beforeSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
83
|
+
afterSync(name: string, fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
84
|
+
afterSync(fn: (options: sequelize.SyncOptions) => import("sequelize/types/hooks").HookReturn): void;
|
|
77
85
|
getDialect(): string;
|
|
86
|
+
getDatabaseName(): string;
|
|
78
87
|
getQueryInterface(): sequelize.QueryInterface;
|
|
79
|
-
define(modelName: string, attributes: sequelize.ModelAttributes<
|
|
88
|
+
define<M extends sequelize.Model<any, any>, TAttributes = sequelize.Attributes<M>>(modelName: string, attributes: sequelize.ModelAttributes<M, TAttributes>, options?: sequelize.ModelOptions<M> | undefined): sequelize.ModelCtor<M>;
|
|
80
89
|
model(modelName: string): sequelize.ModelCtor<sequelize.Model<any, any>>;
|
|
81
90
|
isDefined(modelName: string): boolean;
|
|
82
|
-
import<T extends typeof sequelize.Model>(path: string, defineFunction?: ((sequelize: sequelize.Sequelize, dataTypes: typeof sequelize.DataTypes) => T) | undefined): T;
|
|
83
91
|
query(sql: string | {
|
|
84
92
|
query: string;
|
|
85
93
|
values: unknown[];
|
|
86
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.UPDATE>):
|
|
94
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.UPDATE>): Promise<[undefined, number]>;
|
|
87
95
|
query(sql: string | {
|
|
88
96
|
query: string;
|
|
89
97
|
values: unknown[];
|
|
90
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.BULKUPDATE>):
|
|
98
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.BULKUPDATE>): Promise<number>;
|
|
91
99
|
query(sql: string | {
|
|
92
100
|
query: string;
|
|
93
101
|
values: unknown[];
|
|
94
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.INSERT>):
|
|
102
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.INSERT>): Promise<[number, number]>;
|
|
95
103
|
query(sql: string | {
|
|
96
104
|
query: string;
|
|
97
105
|
values: unknown[];
|
|
98
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.UPSERT>):
|
|
106
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.UPSERT>): Promise<number>;
|
|
99
107
|
query(sql: string | {
|
|
100
108
|
query: string;
|
|
101
109
|
values: unknown[];
|
|
102
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.DELETE>):
|
|
110
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.DELETE>): Promise<void>;
|
|
103
111
|
query(sql: string | {
|
|
104
112
|
query: string;
|
|
105
113
|
values: unknown[];
|
|
106
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.BULKDELETE>):
|
|
114
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.BULKDELETE>): Promise<number>;
|
|
107
115
|
query(sql: string | {
|
|
108
116
|
query: string;
|
|
109
117
|
values: unknown[];
|
|
110
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SHOWTABLES>):
|
|
118
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SHOWTABLES>): Promise<string[]>;
|
|
111
119
|
query(sql: string | {
|
|
112
120
|
query: string;
|
|
113
121
|
values: unknown[];
|
|
114
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.DESCRIBE>):
|
|
115
|
-
query<
|
|
122
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.DESCRIBE>): Promise<sequelize.ColumnsDescription>;
|
|
123
|
+
query<M_1 extends sequelize.Model<any, any>>(sql: string | {
|
|
116
124
|
query: string;
|
|
117
125
|
values: unknown[];
|
|
118
|
-
}, options: sequelize.QueryOptionsWithModel
|
|
119
|
-
|
|
126
|
+
}, options: sequelize.QueryOptionsWithModel<M_1> & {
|
|
127
|
+
plain: true;
|
|
128
|
+
}): Promise<M_1 | null>;
|
|
129
|
+
query<M_2 extends sequelize.Model<any, any>>(sql: string | {
|
|
130
|
+
query: string;
|
|
131
|
+
values: unknown[];
|
|
132
|
+
}, options: sequelize.QueryOptionsWithModel<M_2>): Promise<M_2[]>;
|
|
133
|
+
query<T extends object>(sql: string | {
|
|
120
134
|
query: string;
|
|
121
135
|
values: unknown[];
|
|
122
136
|
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SELECT> & {
|
|
123
137
|
plain: true;
|
|
124
|
-
}):
|
|
125
|
-
query<
|
|
138
|
+
}): Promise<T | null>;
|
|
139
|
+
query<T_1 extends object>(sql: string | {
|
|
126
140
|
query: string;
|
|
127
141
|
values: unknown[];
|
|
128
|
-
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SELECT>):
|
|
142
|
+
}, options: sequelize.QueryOptionsWithType<sequelize.QueryTypes.SELECT>): Promise<T_1[]>;
|
|
129
143
|
query(sql: string | {
|
|
130
144
|
query: string;
|
|
131
145
|
values: unknown[];
|
|
132
146
|
}, options: (sequelize.QueryOptions | sequelize.QueryOptionsWithType<sequelize.QueryTypes.RAW>) & {
|
|
133
147
|
plain: true;
|
|
134
|
-
}):
|
|
148
|
+
}): Promise<{
|
|
149
|
+
[key: string]: unknown;
|
|
150
|
+
} | null>;
|
|
135
151
|
query(sql: string | {
|
|
136
152
|
query: string;
|
|
137
153
|
values: unknown[];
|
|
138
|
-
}, options?: sequelize.QueryOptions | sequelize.QueryOptionsWithType<sequelize.QueryTypes.RAW> | undefined):
|
|
154
|
+
}, options?: sequelize.QueryOptions | sequelize.QueryOptionsWithType<sequelize.QueryTypes.RAW> | undefined): Promise<[unknown[], unknown]>;
|
|
139
155
|
random(): sequelize.Utils.Fn;
|
|
140
|
-
set(variables: object, options: sequelize.QueryOptionsTransactionRequired):
|
|
156
|
+
set(variables: object, options: sequelize.QueryOptionsTransactionRequired): Promise<unknown>;
|
|
141
157
|
escape(value: string | number | Date): string;
|
|
142
|
-
createSchema(schema: string, options: sequelize.Logging):
|
|
143
|
-
showAllSchemas(options: sequelize.Logging):
|
|
144
|
-
dropSchema(schema: string, options: sequelize.Logging):
|
|
145
|
-
dropAllSchemas(options: sequelize.Logging):
|
|
146
|
-
sync(options?: sequelize.SyncOptions | undefined):
|
|
147
|
-
truncate(options?: sequelize.DestroyOptions | undefined):
|
|
148
|
-
drop(options?: sequelize.DropOptions | undefined):
|
|
149
|
-
authenticate(options?: sequelize.QueryOptions | undefined):
|
|
150
|
-
validate(options?: sequelize.QueryOptions | undefined):
|
|
151
|
-
transaction<
|
|
152
|
-
transaction<
|
|
153
|
-
transaction(options?: sequelize.TransactionOptions | undefined):
|
|
154
|
-
close():
|
|
155
|
-
databaseVersion():
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
createSchema(schema: string, options: sequelize.Logging): Promise<unknown>;
|
|
159
|
+
showAllSchemas(options: sequelize.Logging): Promise<object[]>;
|
|
160
|
+
dropSchema(schema: string, options: sequelize.Logging): Promise<unknown[]>;
|
|
161
|
+
dropAllSchemas(options: sequelize.Logging): Promise<unknown[]>;
|
|
162
|
+
sync(options?: sequelize.SyncOptions | undefined): Promise<any>;
|
|
163
|
+
truncate(options?: sequelize.DestroyOptions<any> | undefined): Promise<unknown[]>;
|
|
164
|
+
drop(options?: sequelize.DropOptions | undefined): Promise<unknown[]>;
|
|
165
|
+
authenticate(options?: sequelize.QueryOptions | undefined): Promise<void>;
|
|
166
|
+
validate(options?: sequelize.QueryOptions | undefined): Promise<void>;
|
|
167
|
+
transaction<T_2>(options: sequelize.TransactionOptions, autoCallback: (t: sequelize.Transaction) => PromiseLike<T_2>): Promise<T_2>;
|
|
168
|
+
transaction<T_3>(autoCallback: (t: sequelize.Transaction) => PromiseLike<T_3>): Promise<T_3>;
|
|
169
|
+
transaction(options?: sequelize.TransactionOptions | undefined): Promise<sequelize.Transaction>;
|
|
170
|
+
close(): Promise<void>;
|
|
171
|
+
databaseVersion(): Promise<string>;
|
|
172
|
+
_model: sequelize.Model<any, any>;
|
|
173
|
+
_attributes: any;
|
|
174
|
+
_creationAttributes: any;
|
|
175
|
+
addHook<K extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K, name: string, fn: import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>[K]): any;
|
|
176
|
+
addHook<K_1 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_1, fn: import("sequelize/types/hooks").SequelizeHooks<sequelize.Model<any, any>, any, any>[K_1]): any;
|
|
177
|
+
removeHook<K_2 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_2, name: string): any;
|
|
178
|
+
hasHook<K_3 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_3): boolean;
|
|
179
|
+
hasHooks<K_4 extends keyof import("sequelize/types/hooks").SequelizeHooks<M_3, TModelAttributes, TCreationAttributes>>(hookType: K_4): boolean;
|
|
161
180
|
};
|
|
162
181
|
export default _default;
|
|
@@ -35,7 +35,7 @@ export declare function split(value: string, separator: string): string[];
|
|
|
35
35
|
*
|
|
36
36
|
* @example
|
|
37
37
|
* {{format_bytes 1024}} => 1 KB
|
|
38
|
-
* {{format_bytes 1234}} => 1.21 KB
|
|
38
|
+
* {{format_bytes 1234 2}} => 1.21 KB
|
|
39
39
|
* {{format_bytes 1234 3}} => 1.205 KB
|
|
40
40
|
* {{format_bytes 0}} => 0 Bytes
|
|
41
41
|
*
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { version } from '~/package';
|
|
2
1
|
import mount from './mount';
|
|
3
2
|
import * as database from './database';
|
|
4
3
|
import * as services from './services';
|
|
@@ -6,4 +5,4 @@ import * as utils from './utils';
|
|
|
6
5
|
import * as middlewares from './middlewares';
|
|
7
6
|
import * as exceptions from './exceptions';
|
|
8
7
|
import * as interfaces from './interfaces';
|
|
9
|
-
export {
|
|
8
|
+
export { mount, database, services, utils, middlewares, exceptions, interfaces };
|
|
@@ -34,11 +34,11 @@ export default interface {
|
|
|
34
34
|
*
|
|
35
35
|
* @example
|
|
36
36
|
* // The message set here can be referenced in the view as {{message}}.
|
|
37
|
-
* beforeRender: res => {
|
|
37
|
+
* beforeRender: (req, res) => {
|
|
38
38
|
* res.locals.message = 'Hello World';
|
|
39
39
|
* }
|
|
40
40
|
*
|
|
41
41
|
* @type {(res: express.Response) => void}
|
|
42
42
|
*/
|
|
43
|
-
beforeRender?: (res: express.Response) => void;
|
|
43
|
+
beforeRender?: (req: express.Request, res: express.Response) => void;
|
|
44
44
|
}
|
package/types/package.d.ts
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
export declare var name: string;
|
|
2
|
-
export declare var version: string;
|
|
3
|
-
export declare var description: string;
|
|
4
|
-
export declare var main: string;
|
|
5
|
-
export declare var module: string;
|
|
6
|
-
export declare var types: string;
|
|
7
|
-
export declare var files: string[];
|
|
8
|
-
export declare var scripts: {
|
|
9
|
-
watch: string;
|
|
10
|
-
prewatch: string;
|
|
11
|
-
build: string;
|
|
12
|
-
prebuild: string;
|
|
13
|
-
test: string;
|
|
14
|
-
start: string;
|
|
15
|
-
prestart: string;
|
|
16
|
-
};
|
|
17
|
-
export declare var _moduleAliases: {
|
|
18
|
-
"~": string;
|
|
19
|
-
};
|
|
20
|
-
export declare var repository: {
|
|
21
|
-
type: string;
|
|
22
|
-
url: string;
|
|
23
|
-
};
|
|
24
|
-
export declare var keywords: string[];
|
|
25
|
-
export declare var author: string;
|
|
26
|
-
export declare var license: string;
|
|
27
|
-
export declare var bugs: {
|
|
28
|
-
url: string;
|
|
29
|
-
email: string;
|
|
30
|
-
};
|
|
31
|
-
export declare var homepage: string;
|
|
32
|
-
export declare var dependencies: {
|
|
33
|
-
"aws-sdk": string;
|
|
34
|
-
"body-parser": string;
|
|
35
|
-
"class-transformer": string;
|
|
36
|
-
"class-validator": string;
|
|
37
|
-
"connect-redis": string;
|
|
38
|
-
"cookie-parser": string;
|
|
39
|
-
cors: string;
|
|
40
|
-
debug: string;
|
|
41
|
-
dotenv: string;
|
|
42
|
-
esm: string;
|
|
43
|
-
express: string;
|
|
44
|
-
"express-hbs": string;
|
|
45
|
-
"express-session": string;
|
|
46
|
-
"fs-extra": string;
|
|
47
|
-
glob: string;
|
|
48
|
-
hbs: string;
|
|
49
|
-
"http-errors": string;
|
|
50
|
-
ioredis: string;
|
|
51
|
-
mariadb: string;
|
|
52
|
-
"mime-types": string;
|
|
53
|
-
"module-alias": string;
|
|
54
|
-
moment: string;
|
|
55
|
-
morgan: string;
|
|
56
|
-
multer: string;
|
|
57
|
-
"nodejs-shared": string;
|
|
58
|
-
passport: string;
|
|
59
|
-
"passport-local": string;
|
|
60
|
-
redis: string;
|
|
61
|
-
sequelize: string;
|
|
62
|
-
uniqid: string;
|
|
63
|
-
};
|
|
64
|
-
export declare var devDependencies: {
|
|
65
|
-
"@types/aws-sdk": string;
|
|
66
|
-
"@types/connect-redis": string;
|
|
67
|
-
"@types/cookie-parser": string;
|
|
68
|
-
"@types/debug": string;
|
|
69
|
-
"@types/express": string;
|
|
70
|
-
"@types/express-session": string;
|
|
71
|
-
"@types/http-errors": string;
|
|
72
|
-
"@types/ioredis": string;
|
|
73
|
-
"@types/jest": string;
|
|
74
|
-
"@types/multer": string;
|
|
75
|
-
"@types/node": string;
|
|
76
|
-
"@types/passport": string;
|
|
77
|
-
"@types/passport-local": string;
|
|
78
|
-
"@types/validator": string;
|
|
79
|
-
jest: string;
|
|
80
|
-
json2module: string;
|
|
81
|
-
rollup: string;
|
|
82
|
-
"rollup-plugin-commonjs": string;
|
|
83
|
-
"rollup-plugin-json": string;
|
|
84
|
-
"rollup-plugin-node-resolve": string;
|
|
85
|
-
"rollup-plugin-terser": string;
|
|
86
|
-
"rollup-plugin-typescript2": string;
|
|
87
|
-
"ts-loader": string;
|
|
88
|
-
"ts-node": string;
|
|
89
|
-
"tsc-alias": string;
|
|
90
|
-
"tsconfig-paths": string;
|
|
91
|
-
tslint: string;
|
|
92
|
-
typescript: string;
|
|
93
|
-
};
|