@remit/backend 3.1.1 → 4.0.0

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.
@@ -1,4 +1,3 @@
1
- import { PlacementConfidence } from "@remit/domain-enums";
2
1
  /**
3
2
  * Project a Message's internal auto-move state to the public `AutoMovedInfo`
4
3
  * shape. Present only for a real, in-effect auto-move; absent otherwise, so a
@@ -38,8 +37,6 @@ export const deriveAutoMoved = (message) => {
38
37
  const verdict = message.placementVerdict;
39
38
  if (!verdict)
40
39
  return undefined;
41
- if (verdict.confidence !== PlacementConfidence.Confident)
42
- return undefined;
43
40
  if (verdict.dryRun === true)
44
41
  return undefined;
45
42
  return {
@@ -1,7 +1,7 @@
1
1
  import { parseAccountSettingValue } from "@remit/data-ports/account-settings";
2
2
  import { CLASSIFICATION_PRESETS, CLASSIFICATION_SETTING_NAMES, classificationUsageName, utcDateOf, } from "@remit/data-ports/classification-presets";
3
3
  import { readResolvedClassification, resolveClassification, resolveClassificationWith, savedClassificationApiKey, } from "@remit/data-ports/classification-resolver";
4
- import { AccountSettingName, ClassificationValueSource as ValueSource, } from "@remit/domain-enums";
4
+ import { AccountSettingName } from "@remit/domain-enums";
5
5
  import { ensureClassificationLabels, } from "@remit/mailbox-service";
6
6
  import { serializeEncryptedPayload, } from "@remit/secrets-service";
7
7
  const knownOf = (resolved) => {
@@ -175,7 +175,6 @@ export const publicClassification = (resolved, usage) => {
175
175
  presetId: resolved.presetId.value,
176
176
  model: resolved.model.value,
177
177
  baseUrl: resolved.baseUrl.value,
178
- apiKeySaved: resolved.apiKey.source !== ValueSource.Default,
179
178
  enabled: resolved.enabled.value,
180
179
  dailyLimit: resolved.dailyLimit.value,
181
180
  sources: {
@@ -280,6 +280,7 @@ export const MessageOperations = {
280
280
  mailboxId: mailbox.mailboxId,
281
281
  fullPath: mailbox.fullPath,
282
282
  initialSyncCompletedAt: mailbox.initialSyncCompletedAt,
283
+ createdAt: mailbox.createdAt,
283
284
  placement: await resolveFolderPlacement(client.mailboxSpecialUse, accountId, mailbox.mailboxId),
284
285
  };
285
286
  const scope = await client.createConnectionScope(accountId);
@@ -387,6 +388,7 @@ export const MessageOperations = {
387
388
  mailboxId: mailbox.mailboxId,
388
389
  fullPath: mailbox.fullPath,
389
390
  initialSyncCompletedAt: mailbox.initialSyncCompletedAt,
391
+ createdAt: mailbox.createdAt,
390
392
  placement: await resolveFolderPlacement(client.mailboxSpecialUse, accountId, mailbox.mailboxId),
391
393
  };
392
394
  const scope = await client.createConnectionScope(accountId);
@@ -58,7 +58,8 @@ export const organizePredicateRejection = (predicate) => bodyContentRejection(pr
58
58
  */
59
59
  const matchLiteral = async (deps, accountConfigId, predicate, limit, scope) => {
60
60
  const clauses = predicate.literalClauses;
61
- const narrowing = literalClauseTerms(clauses, predicate.matchOperator);
61
+ const { getDomain } = await import("tldts");
62
+ const narrowing = literalClauseTerms(clauses, predicate.matchOperator, getDomain);
62
63
  if (!narrowing)
63
64
  return [];
64
65
  const matched = [];
@@ -75,7 +76,7 @@ const matchLiteral = async (deps, accountConfigId, predicate, limit, scope) => {
75
76
  if (seen.has(messageId))
76
77
  continue;
77
78
  seen.add(messageId);
78
- if (!literalClausesMatch(clauses, predicate.matchOperator, message)) {
79
+ if (!literalClausesMatch(clauses, predicate.matchOperator, message, getDomain)) {
79
80
  continue;
80
81
  }
81
82
  matched.push(messageId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/backend",
3
- "version": "3.1.1",
3
+ "version": "4.0.0",
4
4
  "description": "Remit Mail Inspector API backend",
5
5
  "license": "MIT",
6
6
  "author": "",
@@ -123,6 +123,7 @@
123
123
  "expect-env": "^1.0.1",
124
124
  "openapi-backend": "^5.18.0",
125
125
  "p-map": "^2.1.0",
126
+ "tldts": "^7.4.9",
126
127
  "@types/aws-lambda": "^8.10.162",
127
128
  "@types/better-sqlite3": "^7.6.13",
128
129
  "@remit/logger": "*",