@remit/backend 0.0.145 → 0.0.146
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/dist/src/handlers/account-oauth.d.ts +7 -2
- package/dist/src/handlers/account.d.ts +11 -3
- package/dist/src/handlers/address.d.ts +11 -3
- package/dist/src/handlers/config.d.ts +12 -2
- package/dist/src/handlers/filter.d.ts +16 -3
- package/dist/src/handlers/index.d.ts +148 -49
- package/dist/src/handlers/mailbox.d.ts +20 -4
- package/dist/src/handlers/me.d.ts +10 -2
- package/dist/src/handlers/message.d.ts +77 -3
- package/dist/src/handlers/organize.d.ts +10 -4
- package/dist/src/handlers/outbox-attachment.d.ts +1 -2
- package/dist/src/handlers/outbox.d.ts +25 -4
- package/dist/src/handlers/sync.d.ts +15 -2
- package/dist/src/service/create-remit-client.js +2 -2
- package/dist/src/service/queues.d.ts +1 -1
- package/dist/src/service/shared-deps.js +8 -6
- package/package.json +5 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AccountService as AccountServiceName } from "@remit/api-openapi-types";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Context } from "openapi-backend";
|
|
3
|
+
import type { HandlerContext, PublicOperationHandler } from "../types.js";
|
|
3
4
|
export interface OAuthState {
|
|
4
5
|
accountConfigId: string;
|
|
5
6
|
nonce: string;
|
|
@@ -12,4 +13,8 @@ export declare function verifyState(state: string, clientSecret: string): Promis
|
|
|
12
13
|
export declare function parseJwtClaims(token: string): Promise<Record<string, unknown> | null>;
|
|
13
14
|
export declare function getWebOrigin(origins: readonly string[]): string;
|
|
14
15
|
export declare const microsoftOAuthCallback: PublicOperationHandler<"sync">;
|
|
15
|
-
export declare const MicrosoftOAuthOperations:
|
|
16
|
+
export declare const MicrosoftOAuthOperations: {
|
|
17
|
+
MicrosoftOAuthOperations_microsoftOAuthStart: (context: Context, ctx: HandlerContext) => Promise<{
|
|
18
|
+
authorizationUrl: string;
|
|
19
|
+
}>;
|
|
20
|
+
};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import type { AccountResponse, DeleteAccountResponse, TestConnectionResponse } from "@remit/api-openapi-types";
|
|
2
|
+
import type { Context } from "openapi-backend";
|
|
1
3
|
import type { RemitClient } from "../service/data-client.js";
|
|
2
|
-
import type {
|
|
4
|
+
import type { HandlerContext } from "../types.js";
|
|
3
5
|
import { assertNotOAuthCreate, assertPasswordProvided, toAccountResponse } from "./account-guards.js";
|
|
4
6
|
export { assertNotOAuthCreate, assertPasswordProvided, toAccountResponse };
|
|
5
7
|
export declare const triggerAccountSyncSafe: (client: RemitClient<"sync">, accountId: string) => Promise<void>;
|
|
6
|
-
export declare const AccountOperations:
|
|
7
|
-
|
|
8
|
+
export declare const AccountOperations: {
|
|
9
|
+
AccountOperations_createAccount: (context: Context, ctx: HandlerContext<"sync">) => Promise<AccountResponse>;
|
|
10
|
+
AccountOperations_testConnection: (context: Context, ctx: HandlerContext) => Promise<TestConnectionResponse>;
|
|
11
|
+
};
|
|
12
|
+
export declare const AccountDetailOperations: {
|
|
13
|
+
AccountDetailOperations_updateAccount: (context: Context, ctx: HandlerContext) => Promise<AccountResponse>;
|
|
14
|
+
AccountDetailOperations_deleteAccount: (context: Context, ctx: HandlerContext<"accountFanout">) => Promise<DeleteAccountResponse>;
|
|
15
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AddressResponse, UpdateAddressInput } from "@remit/api-openapi-types";
|
|
2
2
|
import type { AddressFlags, AddressItem, FlagsMergePatch } from "@remit/data-ports";
|
|
3
|
-
import type {
|
|
3
|
+
import type { Context } from "openapi-backend";
|
|
4
|
+
import type { HandlerContext } from "../types.js";
|
|
4
5
|
export declare const toAddressResponse: (item: AddressItem) => AddressResponse;
|
|
5
6
|
/**
|
|
6
7
|
* Translate the wire-format `UpdateAddressInput` into a service-level
|
|
@@ -31,5 +32,12 @@ export declare const buildFlagsPatch: (input: UpdateAddressInput | undefined) =>
|
|
|
31
32
|
* one standing on the Address.
|
|
32
33
|
*/
|
|
33
34
|
export declare const backApplyCategoryFlag: (patch: FlagsMergePatch) => NonNullable<AddressFlags["category"]> | undefined;
|
|
34
|
-
export declare const AddressOperations:
|
|
35
|
-
|
|
35
|
+
export declare const AddressOperations: {
|
|
36
|
+
AddressOperations_searchAddresses: (context: Context, ctx: HandlerContext) => Promise<{
|
|
37
|
+
items: import("@remit/api-openapi-types").Components.Schemas.AddressResponse[];
|
|
38
|
+
continuationToken: string | undefined;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
export declare const AddressDetailOperations: {
|
|
42
|
+
AddressDetailOperations_updateAddress: (context: Context, ctx: HandlerContext<"accountFanout">) => Promise<import("@remit/api-openapi-types").Components.Schemas.AddressResponse>;
|
|
43
|
+
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import type { ConfigDescriptionResponse, ConfigImportReport } from "@remit/api-openapi-types";
|
|
2
|
+
import type { ReaderConfigDocument } from "@remit/config-format";
|
|
1
3
|
import type { FifoQueueProducer } from "@remit/data-ports";
|
|
2
4
|
import { type StoredCredentialFields } from "@remit/mailbox-service/account-credentials";
|
|
5
|
+
import type { Context } from "openapi-backend";
|
|
3
6
|
import { type SyncMailboxesEvent } from "../service/trigger-sync.js";
|
|
4
|
-
import type {
|
|
7
|
+
import type { HandlerContext } from "../types.js";
|
|
5
8
|
type StructuredLog = (fields: Record<string, unknown>, message: string) => void;
|
|
6
9
|
interface ConfigSyncTriggerDeps {
|
|
7
10
|
queue: FifoQueueProducer<SyncMailboxesEvent>;
|
|
@@ -39,5 +42,12 @@ interface ConfigSyncTriggerDeps {
|
|
|
39
42
|
export declare const triggerConfigLoadSyncs: (accountConfigId: string, accounts: ReadonlyArray<{
|
|
40
43
|
accountId: string;
|
|
41
44
|
} & StoredCredentialFields>, deps: ConfigSyncTriggerDeps) => Promise<void>;
|
|
42
|
-
export declare const ConfigOperations:
|
|
45
|
+
export declare const ConfigOperations: {
|
|
46
|
+
ConfigOperations_getConfig: (_context: Context, ctx: HandlerContext<"sync">) => Promise<ConfigDescriptionResponse>;
|
|
47
|
+
ConfigOperations_exportConfig: (_context: Context, ctx: HandlerContext) => Promise<{
|
|
48
|
+
schemaVersion: number;
|
|
49
|
+
document: ReaderConfigDocument;
|
|
50
|
+
}>;
|
|
51
|
+
ConfigOperations_importConfig: (context: Context, ctx: HandlerContext) => Promise<ConfigImportReport>;
|
|
52
|
+
};
|
|
43
53
|
export {};
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
1
|
+
import type { CreateFilterResponse } from "@remit/api-openapi-types";
|
|
2
|
+
import type { HandlerContext } from "../types.js";
|
|
3
|
+
export declare const FilterOperations: {
|
|
4
|
+
FilterOperations_listFilters: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<{
|
|
5
|
+
items: import("@remit/api-openapi-types").Components.Schemas.FilterResponse[];
|
|
6
|
+
continuationToken: string | undefined;
|
|
7
|
+
}>;
|
|
8
|
+
FilterOperations_createFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"accountFanout">) => Promise<CreateFilterResponse>;
|
|
9
|
+
};
|
|
10
|
+
export declare const FilterDetailOperations: {
|
|
11
|
+
FilterDetailOperations_getFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<import("@remit/api-openapi-types").Components.Schemas.FilterResponse>;
|
|
12
|
+
FilterDetailOperations_updateFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<import("@remit/api-openapi-types").Components.Schemas.FilterResponse>;
|
|
13
|
+
FilterDetailOperations_deleteFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<{
|
|
14
|
+
statusCode: number;
|
|
15
|
+
}>;
|
|
16
|
+
};
|
|
@@ -6,33 +6,117 @@ export declare const handlers: {
|
|
|
6
6
|
CalendarSuggestionActionOperations_reopenCalendarSuggestion: OperationHandler<import("../types.js").CalendarSuggestionActionOperationIds>;
|
|
7
7
|
MessageCalendarSuggestionOperations_listMessageCalendarSuggestions: OperationHandler<"MessageCalendarSuggestionOperations_listMessageCalendarSuggestions">;
|
|
8
8
|
CalendarSuggestionOperations_listCalendarSuggestions: OperationHandler<"CalendarSuggestionOperations_listCalendarSuggestions">;
|
|
9
|
-
AddressDetailOperations_updateAddress:
|
|
10
|
-
AddressOperations_searchAddresses:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
9
|
+
AddressDetailOperations_updateAddress: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"accountFanout">) => Promise<import("@remit/api-openapi-types").Components.Schemas.AddressResponse>;
|
|
10
|
+
AddressOperations_searchAddresses: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
11
|
+
items: import("@remit/api-openapi-types").Components.Schemas.AddressResponse[];
|
|
12
|
+
continuationToken: string | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
OutboxAttachmentOperations_completeOutboxAttachment: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").OutboxAttachmentResponse | import("./outbox-attachment.js").RejectionResponse>;
|
|
15
|
+
OutboxDetailOperations_getOutboxMessage: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").OutboxMessageResponse>;
|
|
16
|
+
OutboxDetailOperations_updateOutboxMessage: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"smtp">) => Promise<import("@remit/api-openapi-types").OutboxMessageResponse>;
|
|
17
|
+
OutboxDetailOperations_deleteOutboxMessage: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"smtp">) => Promise<{
|
|
18
|
+
statusCode: number;
|
|
19
|
+
}>;
|
|
20
|
+
OutboxDetailOperations_sendOutboxMessage: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"smtp">) => Promise<import("@remit/api-openapi-types").OutboxMessageResponse>;
|
|
21
|
+
OutboxDetailOperations_mintOutboxAttachment: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").MintOutboxAttachmentResponse | import("./outbox-attachment.js").RejectionResponse>;
|
|
22
|
+
OutboxOperations_createOutboxMessage: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"smtp">) => Promise<import("@remit/api-openapi-types").OutboxMessageResponse>;
|
|
23
|
+
OutboxOperations_listOutboxMessages: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
24
|
+
items: never[];
|
|
25
|
+
continuationToken: null;
|
|
26
|
+
} | {
|
|
27
|
+
items: import("@remit/api-openapi-types").Components.Schemas.OutboxMessageResponse[];
|
|
28
|
+
continuationToken: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
MessageBulkOperations_updateFlags: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
31
|
+
successCount: number;
|
|
32
|
+
failureCount: number;
|
|
33
|
+
}>;
|
|
34
|
+
MessageBulkOperations_deleteMessages: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
35
|
+
successCount: number;
|
|
36
|
+
failureCount: number;
|
|
37
|
+
}>;
|
|
38
|
+
MessageBulkOperations_moveMessages: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
39
|
+
successCount: number;
|
|
40
|
+
failureCount: number;
|
|
41
|
+
}>;
|
|
42
|
+
MessageBulkOperations_copyMessages: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
43
|
+
successCount: number;
|
|
44
|
+
failureCount: number;
|
|
45
|
+
}>;
|
|
46
|
+
MessageBulkOperations_updateMessageLabels: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
47
|
+
successCount: number;
|
|
48
|
+
failureCount: number;
|
|
49
|
+
}>;
|
|
50
|
+
MessageBulkOperations_reportSpam: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<import("./message.js").SpamReportBulkOutcome>;
|
|
51
|
+
MessageBulkOperations_notSpam: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<import("./message.js").SpamReportBulkOutcome>;
|
|
52
|
+
MessageOperations_describeMessage: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"sync" | "messageManagement" | "body">) => Promise<{
|
|
53
|
+
message: {
|
|
54
|
+
spamReport?: {
|
|
55
|
+
reportedAt: number;
|
|
56
|
+
} | undefined;
|
|
57
|
+
labels?: {
|
|
58
|
+
labelId: string;
|
|
59
|
+
name: string;
|
|
60
|
+
color: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
|
|
61
|
+
}[] | undefined;
|
|
62
|
+
autoMoved?: import("@remit/api-openapi-types").Components.Schemas.AutoMovedInfo | undefined;
|
|
63
|
+
messageId: string;
|
|
64
|
+
mailboxId: string;
|
|
65
|
+
uid: number;
|
|
66
|
+
rfc822Size: number;
|
|
67
|
+
internalDate: number;
|
|
68
|
+
messageIdHeader: string | undefined;
|
|
69
|
+
authenticity: {
|
|
70
|
+
fromDomain: string;
|
|
71
|
+
dkimMismatch: boolean;
|
|
72
|
+
dkimDomain?: string | undefined;
|
|
73
|
+
displayNameCorrespondence?: "Corresponds" | "Lookalike" | "ForeignAddress" | "Unrelated" | "NoClaim" | undefined;
|
|
74
|
+
offDomainLinkDomains?: string[] | undefined;
|
|
75
|
+
signerDomain?: string | undefined;
|
|
76
|
+
envelopeDomain?: string | undefined;
|
|
77
|
+
signerMessageCount?: number | undefined;
|
|
78
|
+
signerFirstSeenAt?: number | undefined;
|
|
79
|
+
} | undefined;
|
|
80
|
+
status: "active" | "deleting" | "deleted" | "moving";
|
|
81
|
+
syncStatus: "failed" | "synced" | "pending" | "abandoned";
|
|
82
|
+
abandonedMutation: "none" | "move" | "delete" | "copy";
|
|
83
|
+
};
|
|
84
|
+
envelope: import("@remit/api-openapi-types").Components.Schemas.EnvelopeResponse;
|
|
85
|
+
flags: string[];
|
|
86
|
+
bodyParts: import("@remit/api-openapi-types").Components.Schemas.BodyPartResponse[];
|
|
87
|
+
references: {
|
|
88
|
+
messageIdValue: string;
|
|
89
|
+
referenceType: string;
|
|
90
|
+
referenceOrder: number;
|
|
91
|
+
}[];
|
|
92
|
+
}>;
|
|
93
|
+
MessageOperations_getRawMessage: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"sync" | "messageManagement">) => Promise<{
|
|
94
|
+
raw: string;
|
|
95
|
+
}>;
|
|
96
|
+
MessageOperations_updateMessageFlags: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
97
|
+
messageId: string;
|
|
98
|
+
isRead: boolean;
|
|
99
|
+
isStarred: boolean;
|
|
100
|
+
}>;
|
|
29
101
|
ThreadOperations_listThreads: OperationHandler<import("../types.js").ThreadOperationIds>;
|
|
30
102
|
ThreadOperations_searchThreads: OperationHandler<import("../types.js").ThreadOperationIds>;
|
|
31
103
|
UnifiedThreadOperations_listAllThreads: OperationHandler<"UnifiedThreadOperations_listAllThreads">;
|
|
32
104
|
ThreadDetailOperations_listThreadMessages: OperationHandler<"ThreadDetailOperations_listThreadMessages">;
|
|
33
|
-
SyncOperations_triggerSync:
|
|
34
|
-
|
|
35
|
-
|
|
105
|
+
SyncOperations_triggerSync: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
106
|
+
triggered: boolean;
|
|
107
|
+
message: string;
|
|
108
|
+
}>;
|
|
109
|
+
SyncOperations_getSyncStatus: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
110
|
+
accountId: string;
|
|
111
|
+
syncPhase: "error" | "idle" | "discovering_mailboxes" | "syncing_inbox" | "syncing_others" | "complete" | undefined;
|
|
112
|
+
mailboxCountTotal: number | undefined;
|
|
113
|
+
mailboxCountSynced: number | undefined;
|
|
114
|
+
lastSyncAt: number | undefined;
|
|
115
|
+
mailboxes: import("./sync-progress.js").MailboxSyncProgress[];
|
|
116
|
+
}>;
|
|
117
|
+
TrashOperations_emptyTrash: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
118
|
+
deletedCount: number;
|
|
119
|
+
}>;
|
|
36
120
|
CalendarFreeBusyOperations_listCalendarFreeBusy: OperationHandler<"CalendarFreeBusyOperations_listCalendarFreeBusy">;
|
|
37
121
|
CalendarEventDetailOperations_getCalendarEvent: OperationHandler<import("../types.js").CalendarEventDetailOperationIds>;
|
|
38
122
|
CalendarEventDetailOperations_updateCalendarEvent: OperationHandler<import("../types.js").CalendarEventDetailOperationIds>;
|
|
@@ -47,40 +131,55 @@ export declare const handlers: {
|
|
|
47
131
|
CalendarDetailOperations_deleteCalendar: OperationHandler<import("../types.js").CalendarDetailOperationIds>;
|
|
48
132
|
CalendarOperations_listCalendars: OperationHandler<import("../types.js").CalendarOperationIds>;
|
|
49
133
|
CalendarOperations_createCalendar: OperationHandler<import("../types.js").CalendarOperationIds>;
|
|
50
|
-
OrganizeJobDetailOperations_getOrganizeJob:
|
|
51
|
-
OrganizeOperations_createOrganizeJob:
|
|
52
|
-
OrganizeOperations_previewOrganize:
|
|
134
|
+
OrganizeJobDetailOperations_getOrganizeJob: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").OrganizeJobResponse>;
|
|
135
|
+
OrganizeOperations_createOrganizeJob: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"accountFanout">) => Promise<import("@remit/api-openapi-types").CreateOrganizeJobResponse>;
|
|
136
|
+
OrganizeOperations_previewOrganize: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").OrganizePreviewResponse>;
|
|
53
137
|
LabelDetailOperations_getLabel: OperationHandler<import("../types.js").LabelDetailOperationIds>;
|
|
54
138
|
LabelDetailOperations_updateLabel: OperationHandler<import("../types.js").LabelDetailOperationIds>;
|
|
55
139
|
LabelDetailOperations_deleteLabel: OperationHandler<import("../types.js").LabelDetailOperationIds>;
|
|
56
140
|
LabelOperations_listLabels: OperationHandler<import("../types.js").LabelOperationIds>;
|
|
57
141
|
LabelOperations_createLabel: OperationHandler<import("../types.js").LabelOperationIds>;
|
|
58
|
-
FilterDetailOperations_getFilter:
|
|
59
|
-
FilterDetailOperations_updateFilter:
|
|
60
|
-
FilterDetailOperations_deleteFilter:
|
|
61
|
-
|
|
62
|
-
|
|
142
|
+
FilterDetailOperations_getFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").Components.Schemas.FilterResponse>;
|
|
143
|
+
FilterDetailOperations_updateFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").Components.Schemas.FilterResponse>;
|
|
144
|
+
FilterDetailOperations_deleteFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
145
|
+
statusCode: number;
|
|
146
|
+
}>;
|
|
147
|
+
FilterOperations_listFilters: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
148
|
+
items: import("@remit/api-openapi-types").Components.Schemas.FilterResponse[];
|
|
149
|
+
continuationToken: string | undefined;
|
|
150
|
+
}>;
|
|
151
|
+
FilterOperations_createFilter: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"accountFanout">) => Promise<import("@remit/api-openapi-types").CreateFilterResponse>;
|
|
63
152
|
FolderRoleOperations_appointFolderRole: OperationHandler<"FolderRoleOperations_appointFolderRole">;
|
|
64
|
-
MailboxDetailOperations_getMailbox:
|
|
65
|
-
MailboxDetailOperations_renameMailbox:
|
|
66
|
-
MailboxDetailOperations_deleteMailbox:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
153
|
+
MailboxDetailOperations_getMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").Components.Schemas.MailboxResponse>;
|
|
154
|
+
MailboxDetailOperations_renameMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<import("@remit/api-openapi-types").Components.Schemas.MailboxResponse>;
|
|
155
|
+
MailboxDetailOperations_deleteMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<{
|
|
156
|
+
statusCode: number;
|
|
157
|
+
}>;
|
|
158
|
+
MailboxOperations_listMailboxes: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
159
|
+
items: import("@remit/api-openapi-types").Components.Schemas.MailboxResponse[];
|
|
160
|
+
continuationToken: string | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
MailboxOperations_createMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: import("../types.js").HandlerContext<"sync">) => Promise<import("@remit/api-openapi-types").Components.Schemas.MailboxResponse>;
|
|
163
|
+
MicrosoftOAuthOperations_microsoftOAuthStart: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
164
|
+
authorizationUrl: string;
|
|
165
|
+
}>;
|
|
166
|
+
AccountDetailOperations_updateAccount: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").AccountResponse>;
|
|
167
|
+
AccountDetailOperations_deleteAccount: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"accountFanout">) => Promise<import("@remit/api-openapi-types").DeleteAccountResponse>;
|
|
168
|
+
AccountOperations_createAccount: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"sync">) => Promise<import("@remit/api-openapi-types").AccountResponse>;
|
|
169
|
+
AccountOperations_testConnection: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").TestConnectionResponse>;
|
|
74
170
|
SystemOperations_getSystemUpdate: OperationHandler<import("../types.js").SystemOperationIds>;
|
|
75
171
|
SystemOperations_applySystemUpdate: OperationHandler<import("../types.js").SystemOperationIds>;
|
|
76
|
-
ConfigOperations_getConfig:
|
|
77
|
-
ConfigOperations_exportConfig:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
172
|
+
ConfigOperations_getConfig: (_context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"sync">) => Promise<import("@remit/api-openapi-types").ConfigDescriptionResponse>;
|
|
173
|
+
ConfigOperations_exportConfig: (_context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<{
|
|
174
|
+
schemaVersion: number;
|
|
175
|
+
document: import("@remit/config-format").ReaderConfigDocument;
|
|
176
|
+
}>;
|
|
177
|
+
ConfigOperations_importConfig: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").ConfigImportReport>;
|
|
178
|
+
MeOperations_listVipSuggestions: (_context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").VipSuggestionsResponse>;
|
|
179
|
+
MeOperations_listQuarantine: (_context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").QuarantineListResponse>;
|
|
180
|
+
MeOperations_deleteMe: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"accountFanout">) => Promise<import("@remit/api-openapi-types").DeleteAccountConfigResponse>;
|
|
181
|
+
MeOperations_createExport: (_context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext<"accountFanout">) => Promise<import("@remit/api-openapi-types").CreateExportResponse>;
|
|
182
|
+
MeOperations_getExport: (context: import("openapi-backend").Context, ctx: import("../types.js").HandlerContext) => Promise<import("@remit/api-openapi-types").AccountExportRequestResponse>;
|
|
84
183
|
};
|
|
85
184
|
export declare const publicHandlers: {
|
|
86
185
|
MicrosoftOAuthOperations_microsoftOAuthCallback: PublicOperationHandler<"sync">;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { RenameMailboxInput } from "@remit/api-openapi-types";
|
|
2
2
|
import type { IAccountSettingRepository, MailboxItem } from "@remit/data-ports";
|
|
3
3
|
import { type FolderPathDeps } from "@remit/mailbox-service";
|
|
4
|
-
import type {
|
|
4
|
+
import type { HandlerContext } from "../types.js";
|
|
5
5
|
/**
|
|
6
6
|
* The mute flag and the display-name override are user preferences that live
|
|
7
7
|
* in per-mailbox AccountSetting rows (RFC 032), not on the Mailbox entity.
|
|
@@ -18,6 +18,22 @@ export type MailboxPatchClient = FolderPathDeps & {
|
|
|
18
18
|
accountSetting: Pick<IAccountSettingRepository, "get" | "upsert" | "delete">;
|
|
19
19
|
};
|
|
20
20
|
export declare const applyMailboxPatch: (client: MailboxPatchClient, accountConfigId: string, mailboxId: string, accountId: string, body: RenameMailboxInput) => Promise<MailboxItem>;
|
|
21
|
-
export declare const MailboxOperations:
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
export declare const MailboxOperations: {
|
|
22
|
+
MailboxOperations_listMailboxes: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<{
|
|
23
|
+
items: import("@remit/api-openapi-types").Components.Schemas.MailboxResponse[];
|
|
24
|
+
continuationToken: string | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
MailboxOperations_createMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<import("@remit/api-openapi-types").Components.Schemas.MailboxResponse>;
|
|
27
|
+
};
|
|
28
|
+
export declare const MailboxDetailOperations: {
|
|
29
|
+
MailboxDetailOperations_getMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<import("@remit/api-openapi-types").Components.Schemas.MailboxResponse>;
|
|
30
|
+
MailboxDetailOperations_renameMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<import("@remit/api-openapi-types").Components.Schemas.MailboxResponse>;
|
|
31
|
+
MailboxDetailOperations_deleteMailbox: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
32
|
+
statusCode: number;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export declare const TrashOperations: {
|
|
36
|
+
TrashOperations_emptyTrash: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
37
|
+
deletedCount: number;
|
|
38
|
+
}>;
|
|
39
|
+
};
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { AccountExportRequestResponse, CreateExportResponse, DeleteAccountConfigResponse, QuarantineListResponse, VipSuggestionsResponse } from "@remit/api-openapi-types";
|
|
2
|
+
import type { Context } from "openapi-backend";
|
|
3
|
+
import type { HandlerContext } from "../types.js";
|
|
4
|
+
export declare const MeOperations: {
|
|
5
|
+
MeOperations_listVipSuggestions: (_context: Context, ctx: HandlerContext) => Promise<VipSuggestionsResponse>;
|
|
6
|
+
MeOperations_listQuarantine: (_context: Context, ctx: HandlerContext) => Promise<QuarantineListResponse>;
|
|
7
|
+
MeOperations_deleteMe: (context: Context, ctx: HandlerContext<"accountFanout">) => Promise<DeleteAccountConfigResponse>;
|
|
8
|
+
MeOperations_createExport: (_context: Context, ctx: HandlerContext<"accountFanout">) => Promise<CreateExportResponse>;
|
|
9
|
+
MeOperations_getExport: (context: Context, ctx: HandlerContext) => Promise<AccountExportRequestResponse>;
|
|
10
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BodyPartResponse } from "@remit/api-openapi-types";
|
|
2
|
+
import type { Context } from "openapi-backend";
|
|
2
3
|
import { type ContentSigner } from "../derive/contentSignature.js";
|
|
3
|
-
import type {
|
|
4
|
+
import type { HandlerContext } from "../types.js";
|
|
4
5
|
export declare const isStorageNotFoundError: (error: unknown) => boolean;
|
|
5
6
|
/**
|
|
6
7
|
* Decode the raw `.eml` bytes into a string for inspection. RFC822/MIME
|
|
@@ -78,5 +79,78 @@ export declare const GENERIC_FAILURE_REASON = "This message could not be process
|
|
|
78
79
|
* regardless of batch size.
|
|
79
80
|
*/
|
|
80
81
|
export declare const settleSpamReportBulk: (messageIds: string[], run: (messageId: string) => Promise<void>) => Promise<SpamReportBulkOutcome>;
|
|
81
|
-
export declare const MessageOperations:
|
|
82
|
-
|
|
82
|
+
export declare const MessageOperations: {
|
|
83
|
+
MessageOperations_describeMessage: (context: Context, ctx: HandlerContext<"sync" | "messageManagement" | "body">) => Promise<{
|
|
84
|
+
message: {
|
|
85
|
+
spamReport?: {
|
|
86
|
+
reportedAt: number;
|
|
87
|
+
} | undefined;
|
|
88
|
+
labels?: {
|
|
89
|
+
labelId: string;
|
|
90
|
+
name: string;
|
|
91
|
+
color: "Default" | "Red" | "Orange" | "Yellow" | "Green" | "Teal" | "Blue" | "Purple" | "Gray";
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
autoMoved?: import("@remit/api-openapi-types").Components.Schemas.AutoMovedInfo | undefined;
|
|
94
|
+
messageId: string;
|
|
95
|
+
mailboxId: string;
|
|
96
|
+
uid: number;
|
|
97
|
+
rfc822Size: number;
|
|
98
|
+
internalDate: number;
|
|
99
|
+
messageIdHeader: string | undefined;
|
|
100
|
+
authenticity: {
|
|
101
|
+
fromDomain: string;
|
|
102
|
+
dkimMismatch: boolean;
|
|
103
|
+
dkimDomain?: string | undefined;
|
|
104
|
+
displayNameCorrespondence?: "Corresponds" | "Lookalike" | "ForeignAddress" | "Unrelated" | "NoClaim" | undefined;
|
|
105
|
+
offDomainLinkDomains?: string[] | undefined;
|
|
106
|
+
signerDomain?: string | undefined;
|
|
107
|
+
envelopeDomain?: string | undefined;
|
|
108
|
+
signerMessageCount?: number | undefined;
|
|
109
|
+
signerFirstSeenAt?: number | undefined;
|
|
110
|
+
} | undefined;
|
|
111
|
+
status: "active" | "deleting" | "deleted" | "moving";
|
|
112
|
+
syncStatus: "failed" | "synced" | "pending" | "abandoned";
|
|
113
|
+
abandonedMutation: "none" | "move" | "delete" | "copy";
|
|
114
|
+
};
|
|
115
|
+
envelope: import("@remit/api-openapi-types").Components.Schemas.EnvelopeResponse;
|
|
116
|
+
flags: string[];
|
|
117
|
+
bodyParts: import("@remit/api-openapi-types").Components.Schemas.BodyPartResponse[];
|
|
118
|
+
references: {
|
|
119
|
+
messageIdValue: string;
|
|
120
|
+
referenceType: string;
|
|
121
|
+
referenceOrder: number;
|
|
122
|
+
}[];
|
|
123
|
+
}>;
|
|
124
|
+
MessageOperations_getRawMessage: (context: Context, ctx: HandlerContext<"sync" | "messageManagement">) => Promise<{
|
|
125
|
+
raw: string;
|
|
126
|
+
}>;
|
|
127
|
+
MessageOperations_updateMessageFlags: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
128
|
+
messageId: string;
|
|
129
|
+
isRead: boolean;
|
|
130
|
+
isStarred: boolean;
|
|
131
|
+
}>;
|
|
132
|
+
};
|
|
133
|
+
export declare const MessageBulkOperations: {
|
|
134
|
+
MessageBulkOperations_updateFlags: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
135
|
+
successCount: number;
|
|
136
|
+
failureCount: number;
|
|
137
|
+
}>;
|
|
138
|
+
MessageBulkOperations_deleteMessages: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
139
|
+
successCount: number;
|
|
140
|
+
failureCount: number;
|
|
141
|
+
}>;
|
|
142
|
+
MessageBulkOperations_moveMessages: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
143
|
+
successCount: number;
|
|
144
|
+
failureCount: number;
|
|
145
|
+
}>;
|
|
146
|
+
MessageBulkOperations_copyMessages: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
147
|
+
successCount: number;
|
|
148
|
+
failureCount: number;
|
|
149
|
+
}>;
|
|
150
|
+
MessageBulkOperations_updateMessageLabels: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<{
|
|
151
|
+
successCount: number;
|
|
152
|
+
failureCount: number;
|
|
153
|
+
}>;
|
|
154
|
+
MessageBulkOperations_reportSpam: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<SpamReportBulkOutcome>;
|
|
155
|
+
MessageBulkOperations_notSpam: (context: Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<SpamReportBulkOutcome>;
|
|
156
|
+
};
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import type { OrganizeInput } from "@remit/api-openapi-types";
|
|
1
|
+
import type { CreateOrganizeJobResponse, OrganizeInput, OrganizeJobResponse, OrganizePreviewResponse } from "@remit/api-openapi-types";
|
|
2
|
+
import type { Context } from "openapi-backend";
|
|
2
3
|
import { type OrganizePredicate } from "../service/organize.js";
|
|
3
|
-
import type {
|
|
4
|
+
import type { HandlerContext } from "../types.js";
|
|
4
5
|
/**
|
|
5
6
|
* Normalize the request body into the flattened predicate the job row and the
|
|
6
7
|
* matcher share.
|
|
7
8
|
*/
|
|
8
9
|
export declare const predicateFromInput: (input: OrganizeInput) => OrganizePredicate;
|
|
9
|
-
export declare const OrganizeOperations:
|
|
10
|
-
|
|
10
|
+
export declare const OrganizeOperations: {
|
|
11
|
+
OrganizeOperations_createOrganizeJob: (context: Context, ctx: HandlerContext<"accountFanout">) => Promise<CreateOrganizeJobResponse>;
|
|
12
|
+
OrganizeOperations_previewOrganize: (context: Context, ctx: HandlerContext) => Promise<OrganizePreviewResponse>;
|
|
13
|
+
};
|
|
14
|
+
export declare const OrganizeJobDetailOperations: {
|
|
15
|
+
OrganizeJobDetailOperations_getOrganizeJob: (context: Context, ctx: HandlerContext) => Promise<OrganizeJobResponse>;
|
|
16
|
+
};
|
|
@@ -4,7 +4,7 @@ import type { Context } from "openapi-backend";
|
|
|
4
4
|
import type { ApiConfig } from "../config/api-config.js";
|
|
5
5
|
import type { HandlerContext } from "../types.js";
|
|
6
6
|
export declare const toOutboxAttachmentResponse: (config: ApiConfig) => (item: OutboxAttachmentItem) => OutboxAttachmentResponse;
|
|
7
|
-
interface RejectionResponse {
|
|
7
|
+
export interface RejectionResponse {
|
|
8
8
|
statusCode: number;
|
|
9
9
|
body: OutboxAttachmentRejection;
|
|
10
10
|
}
|
|
@@ -22,4 +22,3 @@ export declare const mintOutboxAttachment: (context: Context, ctx: HandlerContex
|
|
|
22
22
|
* how many there are is not evidence.
|
|
23
23
|
*/
|
|
24
24
|
export declare const completeOutboxAttachment: (context: Context, ctx: HandlerContext) => Promise<OutboxAttachmentResponse | RejectionResponse>;
|
|
25
|
-
export {};
|
|
@@ -1,4 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
1
|
+
import type { OutboxMessageResponse } from "@remit/api-openapi-types";
|
|
2
|
+
import type { Context } from "openapi-backend";
|
|
3
|
+
import type { HandlerContext } from "../types.js";
|
|
4
|
+
export declare const OutboxOperations: {
|
|
5
|
+
OutboxOperations_createOutboxMessage: (context: Context, ctx: HandlerContext<"smtp">) => Promise<OutboxMessageResponse>;
|
|
6
|
+
OutboxOperations_listOutboxMessages: (context: Context, ctx: HandlerContext) => Promise<{
|
|
7
|
+
items: never[];
|
|
8
|
+
continuationToken: null;
|
|
9
|
+
} | {
|
|
10
|
+
items: import("@remit/api-openapi-types").Components.Schemas.OutboxMessageResponse[];
|
|
11
|
+
continuationToken: string | undefined;
|
|
12
|
+
}>;
|
|
13
|
+
};
|
|
14
|
+
export declare const OutboxDetailOperations: {
|
|
15
|
+
OutboxDetailOperations_getOutboxMessage: (context: Context, ctx: HandlerContext) => Promise<OutboxMessageResponse>;
|
|
16
|
+
OutboxDetailOperations_updateOutboxMessage: (context: Context, ctx: HandlerContext<"smtp">) => Promise<OutboxMessageResponse>;
|
|
17
|
+
OutboxDetailOperations_deleteOutboxMessage: (context: Context, ctx: HandlerContext<"smtp">) => Promise<{
|
|
18
|
+
statusCode: number;
|
|
19
|
+
}>;
|
|
20
|
+
OutboxDetailOperations_sendOutboxMessage: (context: Context, ctx: HandlerContext<"smtp">) => Promise<OutboxMessageResponse>;
|
|
21
|
+
OutboxDetailOperations_mintOutboxAttachment: (context: Context, ctx: HandlerContext) => Promise<import("@remit/api-openapi-types").MintOutboxAttachmentResponse | import("./outbox-attachment.js").RejectionResponse>;
|
|
22
|
+
};
|
|
23
|
+
export declare const OutboxAttachmentOperations: {
|
|
24
|
+
OutboxAttachmentOperations_completeOutboxAttachment: (context: Context, ctx: HandlerContext) => Promise<import("@remit/api-openapi-types").OutboxAttachmentResponse | import("./outbox-attachment.js").RejectionResponse>;
|
|
25
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FifoQueueProducer } from "@remit/data-ports";
|
|
2
2
|
import { type FireAndForgetLogger } from "../service/fire-and-forget.js";
|
|
3
3
|
import { type SyncMailboxesEvent } from "../service/trigger-sync.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { HandlerContext } from "../types.js";
|
|
5
5
|
interface SyncTriggerDeps {
|
|
6
6
|
queue: FifoQueueProducer<SyncMailboxesEvent>;
|
|
7
7
|
logger: FireAndForgetLogger & {
|
|
@@ -24,5 +24,18 @@ interface SyncTriggerDeps {
|
|
|
24
24
|
* account-lookup / ownership failure still propagates and 500s as normal.
|
|
25
25
|
*/
|
|
26
26
|
export declare const triggerSyncSafe: (accountId: string, accountConfigId: string, deps: SyncTriggerDeps) => Promise<void>;
|
|
27
|
-
export declare const SyncOperations:
|
|
27
|
+
export declare const SyncOperations: {
|
|
28
|
+
SyncOperations_triggerSync: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext<"sync">) => Promise<{
|
|
29
|
+
triggered: boolean;
|
|
30
|
+
message: string;
|
|
31
|
+
}>;
|
|
32
|
+
SyncOperations_getSyncStatus: (context: import("openapi-backend").Context<any, any, any, any, any, import("openapi-backend").Document>, ctx: HandlerContext) => Promise<{
|
|
33
|
+
accountId: string;
|
|
34
|
+
syncPhase: "error" | "idle" | "discovering_mailboxes" | "syncing_inbox" | "syncing_others" | "complete" | undefined;
|
|
35
|
+
mailboxCountTotal: number | undefined;
|
|
36
|
+
mailboxCountSynced: number | undefined;
|
|
37
|
+
lastSyncAt: number | undefined;
|
|
38
|
+
mailboxes: import("./sync-progress.js").MailboxSyncProgress[];
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
28
41
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { logger } from "@remit/logger";
|
|
2
|
-
import { BodySyncQueueService, BodySyncService, createConnection, FlagPushService, FlagQueueService, MailboxQueueService, MessageMoveService, OutboxAttachmentService, OutboxQueueService, PlacementMoveService, SpamReportService, SyncWarningService, } from "@remit/mailbox-service";
|
|
2
|
+
import { BodySyncQueueService, BodySyncService, createConnection, FlagPushService, FlagQueueService, fifoMailboxManagement, MailboxQueueService, MessageMoveService, OutboxAttachmentService, OutboxQueueService, PlacementMoveService, SpamReportService, SyncWarningService, } from "@remit/mailbox-service";
|
|
3
3
|
import { buildFilterConfig } from "@remit/mailbox-service/filter-config";
|
|
4
4
|
import { deserializeEncryptedPayload, } from "@remit/secrets-service";
|
|
5
5
|
const buildConnectionScope = (accountService, secretsService) => async (accountId) => {
|
|
@@ -131,7 +131,7 @@ export const composeSyncServices = (core, queues) => {
|
|
|
131
131
|
}),
|
|
132
132
|
mailboxQueue: new MailboxQueueService({
|
|
133
133
|
mailboxService: core.mailbox,
|
|
134
|
-
|
|
134
|
+
enqueue: fifoMailboxManagement(queues.sync),
|
|
135
135
|
logger,
|
|
136
136
|
}),
|
|
137
137
|
messageMove,
|
|
@@ -5,7 +5,7 @@ export type SyncQueueEvent = SyncMailboxesEvent | FlagPushEvent | MailboxManagem
|
|
|
5
5
|
export interface RemitClientQueues {
|
|
6
6
|
sync: FifoQueueProducer<SyncQueueEvent>;
|
|
7
7
|
accountFanout: QueueProducer<AccountFanoutEvent>;
|
|
8
|
-
smtp:
|
|
8
|
+
smtp: QueueProducer<SendMessageEvent>;
|
|
9
9
|
messageManagement: QueueProducer<PlacementMovePushEvent>;
|
|
10
10
|
body: QueueProducer<SyncMessageBodyEvent>;
|
|
11
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createCachedDataKeyProvider, createSecretsService, } from "@remit/secrets-service";
|
|
2
2
|
import { createKmsDataKeyProvider, FAKE_KMS_KEY_ID, } from "@remit/secrets-service/kms";
|
|
3
|
-
import {
|
|
3
|
+
import { createFifoQueueProducer, createStandardQueueProducer, } from "@remit/sqs-client/producer";
|
|
4
4
|
import { createStorageService } from "@remit/storage-service/s3";
|
|
5
5
|
import { env } from "expect-env";
|
|
6
6
|
export const sqsQueueUrlsFromEnv = () => ({
|
|
@@ -11,11 +11,13 @@ export const sqsQueueUrlsFromEnv = () => ({
|
|
|
11
11
|
body: env.SQS_QUEUE_URL_BODY,
|
|
12
12
|
});
|
|
13
13
|
export const sqsQueues = (urls) => ({
|
|
14
|
-
sync:
|
|
15
|
-
accountFanout:
|
|
16
|
-
smtp:
|
|
17
|
-
messageManagement:
|
|
18
|
-
|
|
14
|
+
sync: createFifoQueueProducer({ queueUrl: urls.sync }),
|
|
15
|
+
accountFanout: createStandardQueueProducer({ queueUrl: urls.accountFanout }),
|
|
16
|
+
smtp: createStandardQueueProducer({ queueUrl: urls.smtp }),
|
|
17
|
+
messageManagement: createStandardQueueProducer({
|
|
18
|
+
queueUrl: urls.messageManagement,
|
|
19
|
+
}),
|
|
20
|
+
body: createStandardQueueProducer({ queueUrl: urls.body }),
|
|
19
21
|
});
|
|
20
22
|
export const buildSharedDeps = (queues) => ({
|
|
21
23
|
storage: createStorageService(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remit/backend",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.146",
|
|
4
4
|
"description": "Remit Mail Inspector API backend",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "",
|
|
@@ -19,6 +19,10 @@
|
|
|
19
19
|
"types": "./dist/src/serve.d.ts",
|
|
20
20
|
"default": "./dist/src/serve.js"
|
|
21
21
|
},
|
|
22
|
+
"./handlers": {
|
|
23
|
+
"types": "./dist/src/handlers/index.d.ts",
|
|
24
|
+
"default": "./dist/src/handlers/index.js"
|
|
25
|
+
},
|
|
22
26
|
"./client": {
|
|
23
27
|
"types": "./dist/src/service/data-client.d.ts",
|
|
24
28
|
"default": "./dist/src/service/data-client.js"
|