@social-mail/social-mail-web-server 1.4.856 → 1.4.857

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.4.856",
3
+ "version": "1.4.857",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -5,9 +5,21 @@ import EntityAccessError from "@entity-access/entity-access/dist/common/EntityAc
5
5
  import ChangeEntry from "@entity-access/entity-access/dist/model/changes/ChangeEntry.js";
6
6
  import SocialMailContext from "../SocialMailContext.js";
7
7
  import { ServiceProvider } from "@entity-access/entity-access/dist/di/di.js";
8
+ import External from "@entity-access/server-pages/dist/decorators/External.js";
9
+ import Page from "@entity-access/server-pages/dist/Page.js";
8
10
 
9
11
  export default class StoreEvents extends AuthenticatedEvents<Store> {
10
12
 
13
+ @External
14
+ storeQuery() {
15
+ const page = ServiceProvider.resolve(this, Page as any) as Page;
16
+ const host = page.request.host;
17
+
18
+ const db = ServiceProvider.resolve(this, SocialMailContext);
19
+ const q = db.stores.where({ host }, (p) => (x) => x.storeWebsites.some((w) => w.website.hosts.some((h) => h.host === p.host)));
20
+ return q;
21
+ }
22
+
11
23
  filter(query: IEntityQuery<Store>) {
12
24
  if (!this.verify) {
13
25
  return query;
@@ -3,7 +3,7 @@ import semver from "semver";
3
3
 
4
4
  export default async function seedUI(config: DBConfig) {
5
5
 
6
- const version = "1.2.328";
6
+ const version = "1.2.329";
7
7
 
8
8
  const existing = await config.getValue(UIPackageConfig, false);
9
9
  if (existing) {