@social-mail/social-mail-web-server 1.7.355 → 1.7.357

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.7.355",
3
+ "version": "1.7.357",
4
4
  "description": "## Phase 1",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,8 +21,8 @@
21
21
  "dependencies": {
22
22
  "@aws-sdk/client-s3": "^3.717.0",
23
23
  "@azure/storage-blob": "^12.25.0",
24
- "@entity-access/entity-access": "^1.0.405",
25
- "@entity-access/server-pages": "^1.1.416",
24
+ "@entity-access/entity-access": "^1.0.407",
25
+ "@entity-access/server-pages": "^1.1.417",
26
26
  "@ffmpeg/core-mt": "^0.12.6",
27
27
  "@ffmpeg/ffmpeg": "^0.12.10",
28
28
  "@ffmpeg/util": "^0.12.1",
@@ -28,6 +28,18 @@ export default class HostedDomainEvents extends AuthenticatedEvents<HostedDomain
28
28
  @Inject
29
29
  private context: WorkflowContext;
30
30
 
31
+ @ExternalQuery
32
+ async hosted(query: IEntityQuery<HostedDomain>) {
33
+ if (this.verify) {
34
+ this.sessionUser.ensureLoggedIn();
35
+ }
36
+ if (this.sessionUser.isAdmin) {
37
+ return query;
38
+ }
39
+ const { userID } = this.sessionUser;
40
+ return query.where({ userID }, (p) => (x) => x.domainUsers.some((d) => d.userID === p.userID));
41
+ }
42
+
31
43
  @ExternalInvoke
32
44
  async deleteDomain (entity: HostedDomain, password: string) {
33
45
 
@@ -48,8 +48,9 @@ export default class AppTempFileService {
48
48
  .where({rootID, path: `${path}%`, pathLength: path.length }, (p) => (x) =>
49
49
  x.rootID === p.rootID
50
50
  && Sql.text.like(x.path, p.path)
51
- && !Sql.text.includes("/", Sql.text.substring(x.path, p.pathLength ))
51
+ && !Sql.text.includes(Sql.text.substring(x.path, p.pathLength), "/")
52
52
  )
53
+ .trace(console.log)
53
54
  .toArray();
54
55
 
55
56
  for (const child of children) {
@@ -156,8 +157,7 @@ export default class AppTempFileService {
156
157
 
157
158
  // if transform
158
159
  // do the transform here...
159
- let contentType = mime.contentType(name) || "application/octet-stream";
160
- contentType = contentType.split(":")[0];
160
+ const contentType = mime.lookup(name) || "application/octet-stream";
161
161
  if (/\/html$/i.test(contentType)) {
162
162
  localFile = await this.transformFile(localFile, transform);
163
163
  }