@remit/backend 0.0.70 → 0.0.72
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
|
@@ -26,6 +26,7 @@ import type {
|
|
|
26
26
|
OutboxMessageItem,
|
|
27
27
|
UpdateOutboxMessageInput,
|
|
28
28
|
} from "@remit/data-ports";
|
|
29
|
+
import { APPENDED_UID_NONE } from "@remit/data-ports";
|
|
29
30
|
import { NotFoundError } from "@remit/data-ports/errors";
|
|
30
31
|
import { OutboxMessageStatus } from "@remit/domain-enums";
|
|
31
32
|
import {
|
|
@@ -75,6 +76,7 @@ const createInMemoryOutboxRepository = (): IOutboxMessageRepository => {
|
|
|
75
76
|
ccAddresses: input.ccAddresses ?? [],
|
|
76
77
|
bccAddresses: input.bccAddresses ?? [],
|
|
77
78
|
references: input.references ?? [],
|
|
79
|
+
appendedUid: APPENDED_UID_NONE,
|
|
78
80
|
outboxMessageId: `outbox-${sequence}`,
|
|
79
81
|
createdAt: now,
|
|
80
82
|
updatedAt: now,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import { describe, it } from "node:test";
|
|
3
|
-
import type { SemanticSearchResult } from "@remit/api-openapi-types";
|
|
4
3
|
import type {
|
|
5
4
|
SearchParams,
|
|
6
5
|
SearchResult,
|
|
7
6
|
SearchService,
|
|
8
7
|
} from "@remit/search-service";
|
|
8
|
+
import { toResponse } from "./search.js";
|
|
9
9
|
|
|
10
10
|
interface CapturedSearch {
|
|
11
11
|
calls: SearchParams[];
|
|
@@ -29,27 +29,6 @@ const buildFakeSearch = (
|
|
|
29
29
|
return { service, captured };
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
-
const toResponse = (item: SearchResult): SemanticSearchResult => {
|
|
33
|
-
const result: SemanticSearchResult = {
|
|
34
|
-
messageId: item.messageId,
|
|
35
|
-
threadId: item.threadId,
|
|
36
|
-
score: item.score,
|
|
37
|
-
matchedChunkType: item.matchedChunkType,
|
|
38
|
-
mailboxIds: item.mailboxIds,
|
|
39
|
-
sentDate: item.sentDate,
|
|
40
|
-
};
|
|
41
|
-
if (item.fromName !== undefined) {
|
|
42
|
-
result.fromName = item.fromName ?? undefined;
|
|
43
|
-
}
|
|
44
|
-
if (item.subject !== undefined) {
|
|
45
|
-
result.subject = item.subject;
|
|
46
|
-
}
|
|
47
|
-
if (item.category !== undefined) {
|
|
48
|
-
result.category = item.category;
|
|
49
|
-
}
|
|
50
|
-
return result;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
32
|
describe("SemanticSearch handler response mapping", () => {
|
|
54
33
|
it("maps SearchResult into SemanticSearchResult preserving all fields", () => {
|
|
55
34
|
const item: SearchResult = {
|
package/src/handlers/search.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { OperationHandler, SemanticSearchOperationIds } from "../types.js";
|
|
|
15
15
|
|
|
16
16
|
const DEFAULT_LIMIT = 25;
|
|
17
17
|
|
|
18
|
-
const toResponse = (item: SearchResult): SemanticSearchResult => {
|
|
18
|
+
export const toResponse = (item: SearchResult): SemanticSearchResult => {
|
|
19
19
|
const result: SemanticSearchResult = {
|
|
20
20
|
messageId: item.messageId,
|
|
21
21
|
threadId: item.threadId,
|