@ccci/micro-server 1.0.23 → 1.0.25
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/dist/index.js
CHANGED
|
@@ -87560,6 +87560,12 @@ class DatabaseConnector {
|
|
|
87560
87560
|
static getModel(modelName) {
|
|
87561
87561
|
return DatabaseConnector.connection.models[modelName];
|
|
87562
87562
|
}
|
|
87563
|
+
static sync(modelName, force = false) {
|
|
87564
|
+
DatabaseConnector.connection.models[modelName].sync({ force });
|
|
87565
|
+
}
|
|
87566
|
+
static disconnect() {
|
|
87567
|
+
DatabaseConnector.connection.close();
|
|
87568
|
+
}
|
|
87563
87569
|
}
|
|
87564
87570
|
|
|
87565
87571
|
// src/utils/RouterFactory.ts
|
|
@@ -8,7 +8,7 @@ export default class ApplicationServer {
|
|
|
8
8
|
/**
|
|
9
9
|
* Initializes the application server
|
|
10
10
|
* @param {number} port port for the micro service
|
|
11
|
-
* @param {ApplicationOptionType
|
|
11
|
+
* @param {ApplicationOptionType} options additional server configuration
|
|
12
12
|
*/
|
|
13
13
|
static bootstrap(port: number, options?: ApplicationOptionType): Promise<void>;
|
|
14
14
|
getInstance(): express.Application;
|
|
@@ -18,5 +18,7 @@ export default class DatabaseConnector {
|
|
|
18
18
|
static getConnection(): Sequelize;
|
|
19
19
|
connect(connection: Sequelize): Promise<void>;
|
|
20
20
|
static getModel(modelName: string): ModelStatic<Model>;
|
|
21
|
+
static sync(modelName: string, force?: boolean): void;
|
|
22
|
+
static disconnect(): void;
|
|
21
23
|
}
|
|
22
24
|
//# sourceMappingURL=DatabaseConnector.d.ts.map
|