@social-mail/social-mail-web-server 1.4.877 → 1.4.879

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.877",
3
+ "version": "1.4.879",
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.348",
24
+ "@entity-access/entity-access": "^1.0.349",
25
25
  "@entity-access/server-pages": "^1.1.222",
26
26
  "@otplib/preset-v11": "^12.0.1",
27
27
  "@social-mail/noto-emoji-svg": "^2.0.42",
@@ -1,6 +1,6 @@
1
1
  import { tokenizeRegex } from "../protocols/core/tokenizer.js";
2
2
 
3
- const tags = /(#\p{L}[\p{L}\d\-_\/]+)/gmiu;
3
+ const tags = /((?<=\s)|^)(#\p{L}[\p{L}\d\-_\/]+)/gmiu;
4
4
 
5
5
  export default class Hashtags {
6
6
 
@@ -23,6 +23,7 @@ const addTag = async (c: SocialMailContext, tag: ITagLike) => {
23
23
  if (!t) {
24
24
  t = c.tags.add({
25
25
  name,
26
+ label: name,
26
27
  lowerCaseName,
27
28
  contentTypes: contentTypes?.join(",")
28
29
  });
@@ -35,12 +35,12 @@ export default class TagService {
35
35
  using scope = ServiceProvider.createScope(this);
36
36
  const db = scope.resolve(SocialMailContext);
37
37
 
38
- (db as any).logger = new (class extends ConsoleLogger {
39
- debug(a: any): this {
40
- console.log(a);
41
- return this;
42
- }
43
- } )();
38
+ // (db as any).logger = new (class extends ConsoleLogger {
39
+ // debug(a: any): this {
40
+ // console.log(a);
41
+ // return this;
42
+ // }
43
+ // } )();
44
44
  const tag = await db.tags.statements.selectOrInsert({
45
45
  parentID,
46
46
  name,
@@ -11,21 +11,28 @@ export default async function() {
11
11
 
12
12
  const ts = scope.resolve(TagService);
13
13
 
14
+ const db = scope.resolve(SocialMailContext);
15
+ let all = await db.tags.asQuery().toArray();
16
+
17
+ const last = Number(all.pop().tagID) as any;
18
+
14
19
  const tags = await ts.getTagID("A/B/C");
15
20
 
16
21
  assert.strictEqual(3, tags.length);
17
22
 
18
- assert.strictEqual(3, tags[2]);
19
-
20
- const db = scope.resolve(SocialMailContext);
21
- const all = await db.tags.asQuery().toArray();
23
+ all = await db.tags.where( { last }, (p) => (x) => x.tagID > p.last ).toArray();
22
24
 
23
- assert.equal(1, all[0].tagID);
25
+ assert.equal(last + 1, all[0].tagID);
24
26
  assert.equal("a", all[0].name);
25
27
 
26
- assert.equal(2, all[0].tagID);
27
- assert.equal("b", all[0].name);
28
+ assert.equal(last + 2, all[1].tagID);
29
+ assert.equal("b", all[1].name);
30
+
31
+ assert.equal(last + 3, all[2].tagID);
32
+ assert.equal("c", all[2].name);
33
+
34
+ const tags1 = await ts.getTagID("A/B/C");
35
+
36
+ assert.equal(tags.join(","), tags1.join(","));
28
37
 
29
- assert.equal(3, all[0].tagID);
30
- assert.equal("c", all[0].name);
31
38
  }
@@ -126,6 +126,7 @@ export class testScope {
126
126
  const webServer = new WebServer();
127
127
 
128
128
  const s = await webServer.create(true, false);
129
+ await globalServices.resolve(WorkflowContext).storage.seed(globalEnv.version);
129
130
  webServer.runWorkflows();
130
131
 
131
132
  globalServices.add(BaseStorage, new VolumeStorage(join(tmpdir(), "sm" + Date.now())));