@remit/imap-worker 0.0.39 → 0.0.41

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": "@remit/imap-worker",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -20,7 +20,7 @@
20
20
  "bundle": "esbuild src/index.ts --sourcemap --bundle --platform=node --format=esm --outfile=dist/index.js",
21
21
  "cli": "node --env-file=../../localhost-dev-aws.env src/cli.ts",
22
22
  "test:typecheck": "tsgo --noEmit",
23
- "test:run": "node --env-file=../../localhost-test-unit.env --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='src/**/*.test.ts' --test-coverage-exclude='src/**/*.test.tsx' --test-coverage-lines=86 --test 'src/**/*.test.ts'",
23
+ "test:run": "node $NODE_TEST_FLAGS --env-file=../../localhost-test-unit.env --experimental-test-coverage --test-coverage-include='src/**' --test-coverage-exclude='src/**/*.test.ts' --test-coverage-exclude='src/**/*.test.tsx' --test-coverage-lines=86 --test 'src/**/*.test.ts'",
24
24
  "test": "npm run test:typecheck && npm run test:run",
25
25
  "dev": "node --import tsx src/e2e-processor-shim.ts"
26
26
  },
@@ -75,27 +75,6 @@ export const createConnectionScope = (
75
75
  return { getConnection, disconnect };
76
76
  };
77
77
 
78
- /**
79
- * Create a connection scope from account credentials using a password.
80
- */
81
- export const createConnectionScopeFromAccount = (
82
- account: {
83
- username: string;
84
- imapHost: string;
85
- imapPort: number;
86
- imapTls: boolean;
87
- },
88
- password: string,
89
- ): ConnectionScope => {
90
- return createConnectionScope({
91
- user: account.username,
92
- credentials: { kind: "password", password },
93
- host: account.imapHost,
94
- port: account.imapPort,
95
- tls: account.imapTls,
96
- });
97
- };
98
-
99
78
  /**
100
79
  * Create a connection scope from account data and a MailCredentials union.
101
80
  * Use this for all handlers that support both password and OAuth accounts.
@@ -8,10 +8,8 @@ import {
8
8
  import { SendMessageCommand, SQSClient } from "@aws-sdk/client-sqs";
9
9
  import type { Logger } from "@remit/logger-lambda";
10
10
  import { mockClient } from "aws-sdk-client-mock";
11
- import {
12
- type DeleteAccountObjectsEvent,
13
- handleDeleteAccountObjects,
14
- } from "./delete-account-objects.js";
11
+ import type { DeleteAccountObjectsEvent } from "../events.js";
12
+ import { handleDeleteAccountObjects } from "./delete-account-objects.js";
15
13
 
16
14
  const noopLog = {
17
15
  info: () => {},
@@ -7,12 +7,7 @@ import { SendMessageCommand } from "@aws-sdk/client-sqs";
7
7
  import type { Logger } from "@remit/logger-lambda";
8
8
  import { createQueueProducer } from "@remit/sqs-client/producer";
9
9
  import { env } from "expect-env";
10
-
11
- export interface DeleteAccountObjectsEvent {
12
- type: "DELETE_ACCOUNT_OBJECTS";
13
- accountConfigId: string;
14
- continuationToken?: string;
15
- }
10
+ import type { DeleteAccountObjectsEvent } from "../events.js";
16
11
 
17
12
  const s3 = new S3Client({});
18
13
 
@@ -39,7 +34,6 @@ export const handleDeleteAccountObjects = async (
39
34
  let currentToken = continuationToken;
40
35
  let totalDeleted = 0;
41
36
 
42
- // eslint-disable-next-line no-constant-condition
43
37
  while (true) {
44
38
  // Check remaining time before starting a new page
45
39
  if (getRemainingTimeMs && getRemainingTimeMs() < MIN_REMAINING_MS) {
@@ -2,8 +2,8 @@
2
2
  * Periodic mailbox-sync scheduler (#1247, restructured #1251): the tick rate
3
3
  * and the offline-sync threshold are separate, independently configured
4
4
  * knobs — never hardcode a cadence — following the repo's
5
- * env-var-with-a-safe-default convention (see `ACCOUNT_DELETION_GRACE_SECONDS`
6
- * in remit-account-worker/src/config.ts).
5
+ * env-var-with-a-safe-default convention (see `METRICS_PORT` in
6
+ * remit-logger-lambda/src/metrics.ts).
7
7
  *
8
8
  * `tickIntervalSeconds` drives how often the tick itself runs — the
9
9
  * EventBridge schedule rate on a managed deployment, the runner's loop delay
package/build.mjs DELETED
@@ -1,17 +0,0 @@
1
- import * as esbuild from "esbuild";
2
-
3
- await esbuild.build({
4
- entryPoints: ["src/index.ts", "src/cli.ts"],
5
- bundle: true,
6
- platform: "node",
7
- target: "node20",
8
- format: "esm",
9
- outdir: "dist",
10
- sourcemap: true,
11
- external: [
12
- "@aws-sdk/*", // Use Lambda-provided SDK
13
- ],
14
- banner: {
15
- js: "import { createRequire } from 'module'; const require = createRequire(import.meta.url);",
16
- },
17
- });