@social-mail/social-mail-web-server 1.4.779 → 1.4.780
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/WebServer.js +1 -1
- package/dist/WebServer.js.map +1 -1
- package/dist/common/globalEnv.d.ts +1 -0
- package/dist/common/globalEnv.d.ts.map +1 -1
- package/dist/common/globalEnv.js +7 -0
- package/dist/common/globalEnv.js.map +1 -1
- package/dist/server/seed/seed.d.ts.map +1 -1
- package/dist/server/seed/seed.js +3 -2
- package/dist/server/seed/seed.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/WebServer.ts +1 -1
- package/src/common/globalEnv.ts +9 -0
- package/src/server/seed/seed.ts +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@social-mail/social-mail-web-server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.780",
|
|
4
4
|
"description": "## Phase 1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@aws-sdk/client-s3": "^3.609.0",
|
|
23
23
|
"@azure/storage-blob": "^12.23.0",
|
|
24
|
-
"@entity-access/entity-access": "^1.0.
|
|
24
|
+
"@entity-access/entity-access": "^1.0.341",
|
|
25
25
|
"@entity-access/server-pages": "^1.1.220",
|
|
26
26
|
"@otplib/preset-v11": "^12.0.1",
|
|
27
27
|
"@social-mail/noto-emoji-svg": "^2.0.42",
|
package/src/WebServer.ts
CHANGED
|
@@ -182,7 +182,7 @@ export default class WebServer {
|
|
|
182
182
|
|
|
183
183
|
async seed() {
|
|
184
184
|
await seed();
|
|
185
|
-
await globalServices.resolve(WorkflowContext).storage.seed();
|
|
185
|
+
await globalServices.resolve(WorkflowContext).storage.seed(globalEnv.version);
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
registerRoutes(server: ServerPages) {
|
package/src/common/globalEnv.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
1
2
|
import { availableParallelism } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
|
|
6
|
+
const packageJsonPath = join(fileURLToPath(import.meta.url), "../../../package.json");
|
|
7
|
+
|
|
8
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath , "utf8"));
|
|
9
|
+
|
|
10
|
+
const { version } = packageJson;
|
|
3
11
|
|
|
4
12
|
const isTestMode = (process.env.LOGGER_SERVER_TEST_MODE ?? "false") === "true";
|
|
5
13
|
|
|
@@ -10,6 +18,7 @@ if (Number.isNaN(port)) {
|
|
|
10
18
|
|
|
11
19
|
export const globalEnv = {
|
|
12
20
|
protocol: void 0,
|
|
21
|
+
version,
|
|
13
22
|
host: process.env.SOCIAL_MAIL_HOST,
|
|
14
23
|
cdn: process.env.SOCIAL_MAIL_CDN,
|
|
15
24
|
path: process.env.SOCIAL_MAIL_PATH || "/",
|
package/src/server/seed/seed.ts
CHANGED
|
@@ -17,13 +17,15 @@ export default async function seed() {
|
|
|
17
17
|
// making sure multiple workers don't interfere
|
|
18
18
|
using fl = await LockFile.lock(`seed-lock-${globalEnv.serverID}.lock`);
|
|
19
19
|
|
|
20
|
+
const migrationConfig = { version: globalEnv.version };
|
|
21
|
+
|
|
20
22
|
const lc = scope.resolve(DbLockContext);
|
|
21
23
|
await lc.connection.ensureDatabase();
|
|
22
|
-
await lc.connection.automaticMigrations().migrate(lc);
|
|
24
|
+
await lc.connection.automaticMigrations().migrate(lc, migrationConfig);
|
|
23
25
|
|
|
24
26
|
const context = scope.resolve(SocialMailContext);
|
|
25
27
|
await context.connection.ensureDatabase();
|
|
26
|
-
await context.connection.automaticMigrations().migrate(context);
|
|
28
|
+
await context.connection.automaticMigrations().migrate(context, migrationConfig);
|
|
27
29
|
|
|
28
30
|
|
|
29
31
|
context.verifyFilters = false;
|