@social-mail/social-mail-web-server 1.8.26 → 1.8.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@social-mail/social-mail-web-server",
3
- "version": "1.8.26",
3
+ "version": "1.8.28",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -44,7 +44,8 @@ export const Convert = {
44
44
  "--headless",
45
45
  ... args,
46
46
  "--outdir", dir.folder,
47
- path.path
47
+ path.path,
48
+ "--invisible"
48
49
  ]);
49
50
  for(const child of await readdir(dir.folder, { withFileTypes: true })) {
50
51
  const o = join(dir.folder, child.name);
@@ -1,4 +1,5 @@
1
- import Inject from "@entity-access/entity-access/dist/di/di.js";
1
+ /* eslint-disable no-console */
2
+ import Inject, { ServiceProvider } from "@entity-access/entity-access/dist/di/di.js";
2
3
  import Workflow, { UniqueActivity } from "@entity-access/entity-access/dist/workflows/Workflow.js";
3
4
  import SocialMailContext from "../../model/SocialMailContext.js";
4
5
  import Sql from "@entity-access/entity-access/dist/sql/Sql.js";
@@ -12,6 +13,8 @@ import WebSite from "../../model/entities/WebSite.js";
12
13
  import FetchBuilder from "@web-atoms/fetch-builder";
13
14
  import AppTempFileService from "../../services/app-temp-file/AppTempFileService.js";
14
15
  import sleep from "../../../common/sleep.js";
16
+ import { globalEnv } from "../../../common/globalEnv.js";
17
+ import PuppeteerService from "../../services/puppeteer/PuppeteerService.js";
15
18
 
16
19
 
17
20
  export default class CopyTemplateWorkflow extends Workflow<{ folderID, templateID, publish?: boolean }> {
@@ -36,7 +39,7 @@ export default class CopyTemplateWorkflow extends Workflow<{ folderID, templateI
36
39
  const currentPath = `${folderID}/%`;
37
40
 
38
41
  const site = await db.websiteFolders.where(this.input, (p) => (x) => x.folderID === p.folderID)
39
- .include((x) => x.folder)
42
+ .include((x) => [x.folder, x.hosts])
40
43
  .first();
41
44
 
42
45
  while(true) {
@@ -147,6 +150,17 @@ export default class CopyTemplateWorkflow extends Workflow<{ folderID, templateI
147
150
 
148
151
  await db.saveChanges();
149
152
  await this.context.queue(UpdateFolderSize, folderID);
153
+
154
+
155
+ if (globalEnv.wildcardDomain) {
156
+ const host = `.${globalEnv.wildcardDomain}`;
157
+ const siteHost = site.hosts?.find((h) => h.host.endsWith(host));
158
+ if (siteHost) {
159
+ const ps = ServiceProvider.resolve(this, PuppeteerService);
160
+ const url = `https://${siteHost.host}/`;
161
+ ps.generate({ url }).catch(console.error);
162
+ }
163
+ }
150
164
  }
151
165
  async copyRemoteTemplate(db: SocialMailContext, site: WebSite, remoteUrl: string, ... path: string[]) {
152
166
  const r = await fetch(remoteUrl + path.join("/"));