@remit/data-ports 0.0.83 → 0.0.85
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/account-settings.d.ts +371 -0
- package/dist/account-settings.js +114 -0
- package/dist/conformance/account.d.ts +3 -0
- package/dist/conformance/account.js +118 -0
- package/dist/conformance/calendar-collection.d.ts +3 -0
- package/dist/conformance/calendar-collection.js +251 -0
- package/dist/conformance/calendar-event-index.d.ts +3 -0
- package/dist/conformance/calendar-event-index.js +114 -0
- package/dist/conformance/calendar-feed-token.d.ts +3 -0
- package/dist/conformance/calendar-feed-token.js +97 -0
- package/dist/conformance/calendar-object.d.ts +3 -0
- package/dist/conformance/calendar-object.js +156 -0
- package/dist/conformance/calendar-suggestion.d.ts +3 -0
- package/dist/conformance/calendar-suggestion.js +255 -0
- package/{src/conformance/harness.ts → dist/conformance/harness.d.ts} +4 -4
- package/dist/conformance/harness.js +1 -0
- package/dist/conformance/index.js +8 -0
- package/dist/conformance/label.d.ts +3 -0
- package/dist/conformance/label.js +92 -0
- package/dist/conformance/sender-signer-standing.d.ts +3 -0
- package/dist/conformance/sender-signer-standing.js +81 -0
- package/dist/display-name.d.ts +1 -0
- package/dist/display-name.js +26 -0
- package/dist/errors.d.ts +150 -0
- package/dist/errors.js +181 -0
- package/dist/filter-ttl.d.ts +7 -0
- package/{src/filter-ttl.ts → dist/filter-ttl.js} +8 -11
- package/dist/folder-role.d.ts +239 -0
- package/dist/folder-role.js +276 -0
- package/dist/id.d.ts +124 -0
- package/{src/id.ts → dist/id.js} +41 -127
- package/dist/index.d.ts +37 -0
- package/dist/index.js +5 -0
- package/dist/interfaces/account-config.d.ts +15 -0
- package/dist/interfaces/account-config.js +1 -0
- package/dist/interfaces/account-export-request.d.ts +10 -0
- package/dist/interfaces/account-export-request.js +1 -0
- package/dist/interfaces/account-setting.d.ts +8 -0
- package/dist/interfaces/account-setting.js +1 -0
- package/dist/interfaces/account.d.ts +29 -0
- package/dist/interfaces/account.js +1 -0
- package/dist/interfaces/address.d.ts +70 -0
- package/dist/interfaces/address.js +1 -0
- package/dist/interfaces/calendar-collection.d.ts +38 -0
- package/dist/interfaces/calendar-collection.js +1 -0
- package/dist/interfaces/calendar-event-index.d.ts +19 -0
- package/dist/interfaces/calendar-event-index.js +1 -0
- package/dist/interfaces/calendar-feed-token.d.ts +31 -0
- package/dist/interfaces/calendar-feed-token.js +1 -0
- package/dist/interfaces/calendar-object.d.ts +36 -0
- package/dist/interfaces/calendar-object.js +1 -0
- package/dist/interfaces/calendar-store.d.ts +93 -0
- package/dist/interfaces/calendar-store.js +1 -0
- package/dist/interfaces/calendar-suggestion.d.ts +62 -0
- package/dist/interfaces/calendar-suggestion.js +1 -0
- package/dist/interfaces/config-import.d.ts +8 -0
- package/dist/interfaces/config-import.js +1 -0
- package/dist/interfaces/envelope.d.ts +24 -0
- package/dist/interfaces/envelope.js +1 -0
- package/dist/interfaces/filter.d.ts +28 -0
- package/dist/interfaces/filter.js +1 -0
- package/dist/interfaces/label.d.ts +17 -0
- package/dist/interfaces/label.js +1 -0
- package/dist/interfaces/mailbox-lock.d.ts +12 -0
- package/dist/interfaces/mailbox-lock.js +1 -0
- package/dist/interfaces/mailbox-special-use.d.ts +54 -0
- package/dist/interfaces/mailbox-special-use.js +1 -0
- package/dist/interfaces/mailbox.d.ts +79 -0
- package/dist/interfaces/mailbox.js +1 -0
- package/dist/interfaces/message-flag-push.d.ts +9 -0
- package/dist/interfaces/message-flag-push.js +1 -0
- package/dist/interfaces/message-flag.d.ts +14 -0
- package/dist/interfaces/message-flag.js +1 -0
- package/dist/interfaces/message-label.d.ts +21 -0
- package/dist/interfaces/message-label.js +1 -0
- package/dist/interfaces/message-placement-move.d.ts +8 -0
- package/dist/interfaces/message-placement-move.js +1 -0
- package/dist/interfaces/message.d.ts +60 -0
- package/dist/interfaces/message.js +1 -0
- package/dist/interfaces/organize-job-request.d.ts +10 -0
- package/dist/interfaces/organize-job-request.js +1 -0
- package/dist/interfaces/outbox-attachment.d.ts +101 -0
- package/dist/interfaces/outbox-attachment.js +7 -0
- package/dist/interfaces/outbox-message.d.ts +70 -0
- package/dist/interfaces/outbox-message.js +20 -0
- package/dist/interfaces/quarantine.d.ts +20 -0
- package/dist/interfaces/quarantine.js +1 -0
- package/dist/interfaces/sender-signer-standing.d.ts +26 -0
- package/dist/interfaces/sender-signer-standing.js +1 -0
- package/dist/interfaces/sync-warning.d.ts +11 -0
- package/dist/interfaces/sync-warning.js +1 -0
- package/dist/interfaces/thread-message.d.ts +202 -0
- package/dist/interfaces/thread-message.js +1 -0
- package/dist/mailbox-name.d.ts +35 -0
- package/dist/mailbox-name.js +68 -0
- package/dist/message-parts.d.ts +22 -0
- package/dist/message-parts.js +18 -0
- package/dist/message-settlement.d.ts +35 -0
- package/{src/message-settlement.ts → dist/message-settlement.js} +5 -19
- package/dist/mutation-events.d.ts +19 -0
- package/{src/mutation-events.ts → dist/mutation-events.js} +2 -5
- package/dist/sender-mute.d.ts +26 -0
- package/{src/sender-mute.ts → dist/sender-mute.js} +12 -34
- package/dist/sync-warning-state.d.ts +3 -0
- package/dist/sync-warning-state.js +5 -0
- package/dist/types.d.ts +491 -0
- package/dist/types.js +1 -0
- package/dist/update-manifest.d.ts +24 -0
- package/dist/update-manifest.js +20 -0
- package/dist/virtual-copy.d.ts +8 -0
- package/{src/virtual-copy.ts → dist/virtual-copy.js} +10 -15
- package/dist/wellknown.d.ts +47 -0
- package/{src/wellknown.ts → dist/wellknown.js} +26 -49
- package/package.json +44 -79
- package/src/account-settings.ts +0 -194
- package/src/conformance/account.ts +0 -104
- package/src/conformance/calendar-collection.ts +0 -342
- package/src/conformance/calendar-event-index.ts +0 -203
- package/src/conformance/calendar-feed-token.ts +0 -148
- package/src/conformance/calendar-object.ts +0 -269
- package/src/conformance/calendar-suggestion.ts +0 -490
- package/src/conformance/label.ts +0 -136
- package/src/conformance/sender-signer-standing.ts +0 -117
- package/src/display-name.test.ts +0 -101
- package/src/display-name.ts +0 -40
- package/src/errors.ts +0 -244
- package/src/folder-role.test.ts +0 -422
- package/src/folder-role.ts +0 -447
- package/src/id.test.ts +0 -352
- package/src/index.ts +0 -170
- package/src/interfaces/account-config.ts +0 -25
- package/src/interfaces/account-export-request.ts +0 -21
- package/src/interfaces/account-setting.ts +0 -14
- package/src/interfaces/account.ts +0 -43
- package/src/interfaces/address.ts +0 -122
- package/src/interfaces/calendar-collection.ts +0 -60
- package/src/interfaces/calendar-event-index.ts +0 -34
- package/src/interfaces/calendar-feed-token.ts +0 -38
- package/src/interfaces/calendar-object.ts +0 -58
- package/src/interfaces/calendar-suggestion.ts +0 -93
- package/src/interfaces/calendar-unit-of-work.ts +0 -47
- package/src/interfaces/config-import.ts +0 -16
- package/src/interfaces/envelope.ts +0 -32
- package/src/interfaces/filter-anchor-transaction.ts +0 -23
- package/src/interfaces/filter-anchor.ts +0 -11
- package/src/interfaces/filter.ts +0 -41
- package/src/interfaces/label.ts +0 -30
- package/src/interfaces/mailbox-lock.ts +0 -32
- package/src/interfaces/mailbox-special-use.ts +0 -60
- package/src/interfaces/mailbox.ts +0 -115
- package/src/interfaces/message-flag-push.ts +0 -17
- package/src/interfaces/message-flag.ts +0 -15
- package/src/interfaces/message-label.ts +0 -25
- package/src/interfaces/message-placement-move.ts +0 -15
- package/src/interfaces/message.ts +0 -65
- package/src/interfaces/organize-job-request.ts +0 -19
- package/src/interfaces/outbox-attachment.ts +0 -132
- package/src/interfaces/outbox-message.ts +0 -106
- package/src/interfaces/quarantine.ts +0 -22
- package/src/interfaces/sender-signer-standing.ts +0 -37
- package/src/interfaces/thread-message.ts +0 -264
- package/src/interfaces/unit-of-work.ts +0 -28
- package/src/mailbox-name.test.ts +0 -106
- package/src/mailbox-name.ts +0 -90
- package/src/mailbox-state-doors.test.ts +0 -104
- package/src/message-placement-doors.test.ts +0 -100
- package/src/message-settlement.test.ts +0 -132
- package/src/sender-mute.test.ts +0 -76
- package/src/types.ts +0 -820
- package/src/update-manifest.test.ts +0 -130
- package/src/update-manifest.ts +0 -22
- package/src/virtual-copy.test.ts +0 -34
- package/tsconfig.json +0 -8
- /package/{src/conformance/index.ts → dist/conformance/index.d.ts} +0 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export { deriveFilterTtl } from "./filter-ttl.js";
|
|
2
|
+
export type { IAccountRepository } from "./interfaces/account.js";
|
|
3
|
+
export type { IAccountConfigRepository } from "./interfaces/account-config.js";
|
|
4
|
+
export type { IAccountExportRequestRepository } from "./interfaces/account-export-request.js";
|
|
5
|
+
export type { IAccountSettingRepository } from "./interfaces/account-setting.js";
|
|
6
|
+
export type { IAddressRepository } from "./interfaces/address.js";
|
|
7
|
+
export type { ICalendarCollectionRepository } from "./interfaces/calendar-collection.js";
|
|
8
|
+
export type { ICalendarEventIndexRepository } from "./interfaces/calendar-event-index.js";
|
|
9
|
+
export type { ICalendarFeedTokenRepository } from "./interfaces/calendar-feed-token.js";
|
|
10
|
+
export type { ICalendarObjectRepository } from "./interfaces/calendar-object.js";
|
|
11
|
+
export type { CalendarRepositories, CalendarWrite, DeleteCalendarCollectionWrite, DeleteCalendarObjectWrite, ICalendarStore, PutCalendarObjectWrite, ReprojectCalendarObjectWrite, SettleCalendarSuggestionWrite, UpdateCalendarCollectionWrite, } from "./interfaces/calendar-store.js";
|
|
12
|
+
export type { ICalendarSuggestionRepository, SettleCalendarSuggestionInput, } from "./interfaces/calendar-suggestion.js";
|
|
13
|
+
export type { IConfigImportRepository } from "./interfaces/config-import.js";
|
|
14
|
+
export type { IEnvelopeRepository } from "./interfaces/envelope.js";
|
|
15
|
+
export type { IFilterRepository } from "./interfaces/filter.js";
|
|
16
|
+
export type { ILabelRepository } from "./interfaces/label.js";
|
|
17
|
+
export type { IMailboxRepository } from "./interfaces/mailbox.js";
|
|
18
|
+
export type { IMailboxLockRepository } from "./interfaces/mailbox-lock.js";
|
|
19
|
+
export type { IMailboxSpecialUseRepository } from "./interfaces/mailbox-special-use.js";
|
|
20
|
+
export type { IMessageRepository } from "./interfaces/message.js";
|
|
21
|
+
export type { IMessageFlagRepository } from "./interfaces/message-flag.js";
|
|
22
|
+
export type { IMessageFlagPushRepository } from "./interfaces/message-flag-push.js";
|
|
23
|
+
export type { IMessageLabelRepository } from "./interfaces/message-label.js";
|
|
24
|
+
export type { IMessagePlacementMoveRepository } from "./interfaces/message-placement-move.js";
|
|
25
|
+
export type { IOrganizeJobRequestRepository } from "./interfaces/organize-job-request.js";
|
|
26
|
+
export type { CreateOutboxAttachmentInput, IOutboxAttachmentRepository, OutboxAttachmentCap, ReserveOutboxAttachmentResult, } from "./interfaces/outbox-attachment.js";
|
|
27
|
+
export { holdsRoom } from "./interfaces/outbox-attachment.js";
|
|
28
|
+
export type { IOutboxMessageRepository } from "./interfaces/outbox-message.js";
|
|
29
|
+
export { APPENDED_UID_NONE, APPENDED_UID_UNREPORTED, isSentCopyFiled, } from "./interfaces/outbox-message.js";
|
|
30
|
+
export type { IQuarantineRepository } from "./interfaces/quarantine.js";
|
|
31
|
+
export type { ISenderSignerStandingRepository } from "./interfaces/sender-signer-standing.js";
|
|
32
|
+
export type { ISyncWarningRepository, SurfacedSyncWarnings, } from "./interfaces/sync-warning.js";
|
|
33
|
+
export type { IThreadMessageRepository } from "./interfaces/thread-message.js";
|
|
34
|
+
export type { MessageSettlementFields } from "./message-settlement.js";
|
|
35
|
+
export { abandonedMutationOf, hasAbandonedDelete, hasAbandonedMove, } from "./message-settlement.js";
|
|
36
|
+
export { FILTER_NO_ACTION, isSenderMuted, isSenderMuteFilter, } from "./sender-mute.js";
|
|
37
|
+
export type { AccountConfigDescription, AccountConfigItem, AccountDescription, AccountExportRequestItem, AccountItem, AccountSchedulerPage, AccountSettingItem, AccountSettingValue, AddressFlags, AddressItem, BodyPartItem, BodyPartParameterItem, BodyPartParameterUpsertInput, BodyPartStorageItem, BodyPartUpsertInput, CalendarCollectionItem, CalendarEventIndexItem, CalendarFeedTokenItem, CalendarObjectItem, CalendarOccurrenceInput, CalendarSuggestionItem, ConfigImportItem, ConfigImportUnresolvedRefItem, CreateAccountConfigInput, CreateAccountExportRequestInput, CreateAccountInput, CreateAddressInput, CreateCalendarCollectionInput, CreateConfigImportInput, CreateEnvelopeAddressInput, CreateEnvelopeInput, CreateFilterInput, CreateLabelInput, CreateMailboxInput, CreateMailboxResult, CreateMessageFlagInput, CreateMessageInput, CreateMessageLabelInput, CreateOrganizeJobRequestInput, CreateOutboxMessageInput, CreateThreadMessageInput, EnvelopeAddressItem, EnvelopeItem, FilterItem, FlagsMergePatch, LabelItem, ListOptions, MailboxItem, MailboxLockItem, MailboxSpecialUseItem, MailboxSpecialUseValue, MailboxStatePredicate, MailboxSubtreeTransitionIntent, MailboxTransitionIntent, MailboxTransitionWrite, MessageData, MessageDescription, MessageFlagItem, MessageFlagPushItem, MessageIdSource, MessageItem, MessageLabelItem, MessagePlacementMoveItem, MessageReferenceInput, MessageReferenceItem, ObserveSenderSignerStandingInput, OrganizeJobRequestItem, OutboxAttachmentItem, OutboxMessageItem, PlacementPredicate, PlacementTransitionInput, PutCalendarFeedTokenInput, PutCalendarObjectInput, PutCalendarSuggestionInput, PutMessageFlagPushInput, PutMessagePlacementMoveInput, QuarantineItem, QuarantineMimeNodeItem, QuarantineUpsertInput, RawMessageStorageItem, RemovableAccountField, ResultList, SearchOptions, SenderSignerStandingItem, SyncWarningItem, SyncWarningKey, ThreadMessageFieldTerm, ThreadMessageItem, UpdateAccountConfigInput, UpdateAccountExportRequestInput, UpdateAccountInput, UpdateAddressInput, UpdateCalendarCollectionInput, UpdateConfigImportInput, UpdateEnvelopeInput, UpdateFilterInput, UpdateLabelInput, UpdateMailboxInput, UpdateMessageInput, UpdateOrganizeJobRequestInput, UpdateOutboxMessageInput, UpdateThreadMessageInput, UpsertAccountSettingInput, WithMailboxLockResult, } from "./types.js";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { deriveFilterTtl } from "./filter-ttl.js";
|
|
2
|
+
export { holdsRoom } from "./interfaces/outbox-attachment.js";
|
|
3
|
+
export { APPENDED_UID_NONE, APPENDED_UID_UNREPORTED, isSentCopyFiled, } from "./interfaces/outbox-message.js";
|
|
4
|
+
export { abandonedMutationOf, hasAbandonedDelete, hasAbandonedMove, } from "./message-settlement.js";
|
|
5
|
+
export { FILTER_NO_ACTION, isSenderMuted, isSenderMuteFilter, } from "./sender-mute.js";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AccountConfigDescription, AccountConfigItem, CreateAccountConfigInput, ResultList, UpdateAccountConfigInput } from "../types.js";
|
|
2
|
+
export interface IAccountConfigRepository {
|
|
3
|
+
create(input: CreateAccountConfigInput): Promise<AccountConfigItem>;
|
|
4
|
+
get(accountConfigId: string): Promise<AccountConfigItem>;
|
|
5
|
+
get(accountConfigIds: string[]): Promise<AccountConfigItem[]>;
|
|
6
|
+
update(accountConfigId: string, input: UpdateAccountConfigInput): Promise<AccountConfigItem>;
|
|
7
|
+
delete(accountConfigId: string): Promise<void>;
|
|
8
|
+
deleteMany(accountConfigIds: string[]): Promise<void>;
|
|
9
|
+
listByUser(userId: string, options?: {
|
|
10
|
+
limit?: number;
|
|
11
|
+
continuationToken?: string;
|
|
12
|
+
}): Promise<ResultList<AccountConfigItem>>;
|
|
13
|
+
describe(accountConfigId: string): Promise<AccountConfigDescription>;
|
|
14
|
+
listAll(): Promise<AccountConfigItem[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AccountExportRequestItem, CreateAccountExportRequestInput, ResultList, UpdateAccountExportRequestInput } from "../types.js";
|
|
2
|
+
export interface IAccountExportRequestRepository {
|
|
3
|
+
create(input: CreateAccountExportRequestInput): Promise<AccountExportRequestItem>;
|
|
4
|
+
get(accountExportRequestId: string): Promise<AccountExportRequestItem>;
|
|
5
|
+
update(accountExportRequestId: string, input: UpdateAccountExportRequestInput): Promise<AccountExportRequestItem>;
|
|
6
|
+
listByAccountConfig(accountConfigId: string, options?: {
|
|
7
|
+
limit?: number;
|
|
8
|
+
continuationToken?: string;
|
|
9
|
+
}): Promise<ResultList<AccountExportRequestItem>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AccountSettingItem, UpsertAccountSettingInput } from "../types.js";
|
|
2
|
+
export interface IAccountSettingRepository {
|
|
3
|
+
get(accountConfigId: string, name: string): Promise<AccountSettingItem | null>;
|
|
4
|
+
getMany(accountConfigIds: readonly string[], names: readonly string[]): Promise<AccountSettingItem[]>;
|
|
5
|
+
listByAccountConfig(accountConfigId: string): Promise<AccountSettingItem[]>;
|
|
6
|
+
upsert(input: UpsertAccountSettingInput): Promise<AccountSettingItem>;
|
|
7
|
+
delete(accountConfigId: string, name: string): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AccountDescription, AccountItem, AccountSchedulerPage, CreateAccountInput, RemovableAccountField, ResultList, UpdateAccountInput } from "../types.js";
|
|
2
|
+
export interface IAccountRepository {
|
|
3
|
+
create(input: CreateAccountInput): Promise<AccountItem>;
|
|
4
|
+
get(accountId: string): Promise<AccountItem>;
|
|
5
|
+
get(accountIds: string[]): Promise<AccountItem[]>;
|
|
6
|
+
update(accountId: string, input: UpdateAccountInput, remove?: RemovableAccountField[]): Promise<AccountItem>;
|
|
7
|
+
markAuthenticated(accountId: string): Promise<AccountItem>;
|
|
8
|
+
delete(accountId: string): Promise<void>;
|
|
9
|
+
deleteMany(accountIds: string[]): Promise<void>;
|
|
10
|
+
list(accountConfigId: string, options?: {
|
|
11
|
+
limit?: number;
|
|
12
|
+
continuationToken?: string;
|
|
13
|
+
}): Promise<ResultList<AccountItem>>;
|
|
14
|
+
listAllByAccountConfig(accountConfigId: string): Promise<AccountItem[]>;
|
|
15
|
+
listMailSourcesByAccountConfig(accountConfigId: string): Promise<AccountItem[]>;
|
|
16
|
+
describe(accountId: string): Promise<AccountDescription>;
|
|
17
|
+
listAll(): Promise<AccountItem[]>;
|
|
18
|
+
incrementMailboxSynced(accountId: string): Promise<AccountItem>;
|
|
19
|
+
/**
|
|
20
|
+
* Page through every account system-wide, oldest-created first, for the
|
|
21
|
+
* scheduled-sync tick (#1247). Unlike `list()` this is not accountConfig
|
|
22
|
+
* scoped and the cursor is a raw backend-native token (no salt/tamper
|
|
23
|
+
* checking) — internal use only, never exposed over the API.
|
|
24
|
+
*/
|
|
25
|
+
listAllAccountsPage(options?: {
|
|
26
|
+
limit?: number;
|
|
27
|
+
cursor?: string;
|
|
28
|
+
}): Promise<AccountSchedulerPage>;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { JunkRoleMailboxes } from "../folder-role.js";
|
|
2
|
+
import type { AddressItem, CreateAddressInput, CreateEnvelopeAddressInput, EnvelopeAddressItem, FlagsMergePatch, ResultList, UpdateAddressInput } from "../types.js";
|
|
3
|
+
export interface IAddressRepository {
|
|
4
|
+
createAddress(input: CreateAddressInput): Promise<AddressItem>;
|
|
5
|
+
upsertAddress(input: CreateAddressInput): Promise<AddressItem>;
|
|
6
|
+
upsertCorrespondentAddress(input: CreateAddressInput): Promise<AddressItem>;
|
|
7
|
+
upsertJunkAddress(input: CreateAddressInput): Promise<AddressItem>;
|
|
8
|
+
/**
|
|
9
|
+
* `roles` covers every account under the message's config, resolved by the
|
|
10
|
+
* caller once per batch: this runs inside the per-message sync loop, and
|
|
11
|
+
* role resolution is deliberately uncached.
|
|
12
|
+
*/
|
|
13
|
+
reconcileJunkOnlyForMessage(messageId: string, roles: JunkRoleMailboxes): Promise<void>;
|
|
14
|
+
getAddress(accountConfigId: string, addressId: string): Promise<AddressItem>;
|
|
15
|
+
getAddress(accountConfigId: string, addressIds: string[]): Promise<AddressItem[]>;
|
|
16
|
+
updateAddress(accountConfigId: string, addressId: string, input: UpdateAddressInput): Promise<AddressItem>;
|
|
17
|
+
mergeFlags(accountConfigId: string, addressId: string, patch: FlagsMergePatch): Promise<AddressItem>;
|
|
18
|
+
promoteWellknownByUser(accountConfigId: string, addressId: string, now: number): Promise<AddressItem>;
|
|
19
|
+
demoteSenderTrust(accountConfigId: string, addressId: string, now: number): Promise<AddressItem>;
|
|
20
|
+
deleteAddress(accountConfigId: string, addressId: string): Promise<void>;
|
|
21
|
+
incrementInboundCount(accountConfigId: string, addressId: string, now: number, isBulk?: boolean): Promise<void>;
|
|
22
|
+
incrementOutboundCount(accountConfigId: string, addressId: string, now: number): Promise<void>;
|
|
23
|
+
incrementReplyCount(accountConfigId: string, addressId: string, now: number): Promise<void>;
|
|
24
|
+
deleteManyAddresses(accountConfigId: string, addressIds: string[]): Promise<void>;
|
|
25
|
+
listSuggestedVips(input: {
|
|
26
|
+
accountConfigId: string;
|
|
27
|
+
limit?: number;
|
|
28
|
+
}): Promise<AddressItem[]>;
|
|
29
|
+
/**
|
|
30
|
+
* The account's addresses, most worth suggesting first: where the search term
|
|
31
|
+
* hit — the start of a value before the middle of one, and the display name
|
|
32
|
+
* before the local part, the domain and the whole address — then the account's
|
|
33
|
+
* standing for the sender, how much it corresponds with it, how recently, and
|
|
34
|
+
* the stored compound and id last so the order is total. Without a term every
|
|
35
|
+
* row scores the same match, so the remaining keys decide and the listing comes
|
|
36
|
+
* back by standing, correspondence and recency rather than alphabetically.
|
|
37
|
+
*/
|
|
38
|
+
listByAccountConfig(input: {
|
|
39
|
+
accountConfigId: string;
|
|
40
|
+
/**
|
|
41
|
+
* Matched as a substring of the display name, the local part, the domain
|
|
42
|
+
* and the whole address, so `po`, `locatie`, `amsterdam`, `pocahondas.nl`
|
|
43
|
+
* and `amsterdam@pocahondas.nl` all resolve
|
|
44
|
+
* `Pocahondas locatie amsterdam <amsterdam@pocahondas.nl>`. A name outside
|
|
45
|
+
* ASCII (`Öz` for `Özcan Bakker`) resolves through the folded compound.
|
|
46
|
+
*/
|
|
47
|
+
search?: string;
|
|
48
|
+
cursor?: string;
|
|
49
|
+
limit?: number;
|
|
50
|
+
}): Promise<ResultList<AddressItem>>;
|
|
51
|
+
/**
|
|
52
|
+
* Every address stored under the configuration, for a reader that must see
|
|
53
|
+
* the whole set: nothing is hidden, so a row the machine marked `junkOnly`
|
|
54
|
+
* still comes back with whatever the user decided about it. Ordered by
|
|
55
|
+
* `addressId`, which no write moves, so a page boundary cannot skip a row
|
|
56
|
+
* while message sync updates counts and timestamps underneath the read.
|
|
57
|
+
*/
|
|
58
|
+
listAllByAccountConfigPage(input: {
|
|
59
|
+
accountConfigId: string;
|
|
60
|
+
cursor?: string;
|
|
61
|
+
limit?: number;
|
|
62
|
+
}): Promise<ResultList<AddressItem>>;
|
|
63
|
+
listAllByAccountConfig(accountConfigId: string): Promise<AddressItem[]>;
|
|
64
|
+
createEnvelopeAddress(input: CreateEnvelopeAddressInput): Promise<EnvelopeAddressItem>;
|
|
65
|
+
upsertEnvelopeAddress(input: CreateEnvelopeAddressInput): Promise<EnvelopeAddressItem>;
|
|
66
|
+
getEnvelopeAddress(envelopeAddressId: string): Promise<EnvelopeAddressItem>;
|
|
67
|
+
getEnvelopeAddress(envelopeAddressIds: string[]): Promise<EnvelopeAddressItem[]>;
|
|
68
|
+
deleteEnvelopeAddress(envelopeAddressId: string): Promise<void>;
|
|
69
|
+
deleteManyEnvelopeAddresses(envelopeAddressIds: string[]): Promise<void>;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CalendarCollectionItem, CreateCalendarCollectionInput, UpdateCalendarCollectionInput } from "../types.js";
|
|
2
|
+
export interface ICalendarCollectionRepository {
|
|
3
|
+
/**
|
|
4
|
+
* Writes the collection under its derived `calendarId`. Provisioning the
|
|
5
|
+
* same `(accountConfigId, urlSegment)` twice returns the existing row rather
|
|
6
|
+
* than a second one, so first-use provisioning is safe to run on every
|
|
7
|
+
* request without a prior read.
|
|
8
|
+
*/
|
|
9
|
+
create(input: CreateCalendarCollectionInput): Promise<CalendarCollectionItem>;
|
|
10
|
+
/**
|
|
11
|
+
* Writes the collection, or answers `null` when its `urlSegment` is already
|
|
12
|
+
* taken in this account config.
|
|
13
|
+
*
|
|
14
|
+
* The distinction from `create` is who asked. Provisioning wants the row
|
|
15
|
+
* whoever got there first wrote; a person naming a calendar wants to be told
|
|
16
|
+
* the name is taken, and handing them somebody else's calendar instead is a
|
|
17
|
+
* silent merge of two things they meant to keep apart.
|
|
18
|
+
*/
|
|
19
|
+
createExclusive(input: CreateCalendarCollectionInput): Promise<CalendarCollectionItem | null>;
|
|
20
|
+
get(accountConfigId: string, calendarId: string): Promise<CalendarCollectionItem>;
|
|
21
|
+
update(accountConfigId: string, calendarId: string, input: UpdateCalendarCollectionInput): Promise<CalendarCollectionItem>;
|
|
22
|
+
delete(accountConfigId: string, calendarId: string): Promise<void>;
|
|
23
|
+
listByAccountConfig(accountConfigId: string): Promise<CalendarCollectionItem[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Every `Subscribed` collection whose refresh is on, across all account
|
|
26
|
+
* configs. The scheduled refresh walks this; a disabled subscription is
|
|
27
|
+
* absent, which is what stops its refresh.
|
|
28
|
+
*/
|
|
29
|
+
listEnabledSubscriptions(): Promise<CalendarCollectionItem[]>;
|
|
30
|
+
findByUrlSegment(accountConfigId: string, urlSegment: string): Promise<CalendarCollectionItem | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Advances the collection's change counter by one and returns the new value,
|
|
33
|
+
* which the caller stamps on the object it just wrote. Atomic with respect
|
|
34
|
+
* to concurrent writers: a read-then-write here would hand two writers the
|
|
35
|
+
* same sequence and lose one of them from every later sync report.
|
|
36
|
+
*/
|
|
37
|
+
bumpSyncSequence(accountConfigId: string, calendarId: string): Promise<number>;
|
|
38
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CalendarEventIndexItem, CalendarOccurrenceInput } from "../types.js";
|
|
2
|
+
export interface ICalendarEventIndexRepository {
|
|
3
|
+
/**
|
|
4
|
+
* Replaces every occurrence row of one resource with `occurrences`. Whole
|
|
5
|
+
* replacement rather than a merge: an edit that shortens a series must
|
|
6
|
+
* remove the occurrences it dropped, and a diff would leave them behind as
|
|
7
|
+
* events the calendar view still shows but the resource no longer has.
|
|
8
|
+
*/
|
|
9
|
+
replaceForObject(calendarId: string, calendarObjectId: string, occurrences: CalendarOccurrenceInput[]): Promise<void>;
|
|
10
|
+
deleteForObject(calendarId: string, calendarObjectId: string): Promise<void>;
|
|
11
|
+
listForObject(calendarId: string, calendarObjectId: string): Promise<CalendarEventIndexItem[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Occurrences starting within `[startAt, endAt)`, in start order — the
|
|
14
|
+
* calendar-view read. Bounded by start rather than by overlap: an
|
|
15
|
+
* occurrence that began before the window and runs into it is not returned,
|
|
16
|
+
* so a caller that must show those widens the window by its longest event.
|
|
17
|
+
*/
|
|
18
|
+
listByStartRange(calendarId: string, startAt: string, endAt: string): Promise<CalendarEventIndexItem[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CalendarFeedTokenItem, PutCalendarFeedTokenInput } from "../types.js";
|
|
2
|
+
export interface ICalendarFeedTokenRepository {
|
|
3
|
+
/**
|
|
4
|
+
* Mints the calendar's feed address, or replaces the token it already has.
|
|
5
|
+
*
|
|
6
|
+
* One statement, and an upsert on the derived `feedTokenId`: a calendar holds
|
|
7
|
+
* exactly one active address, so there is no state in which a revoked token
|
|
8
|
+
* still resolves alongside its replacement. `createdAt` survives a
|
|
9
|
+
* replacement — the feed is the same feed under a new secret — and
|
|
10
|
+
* `rotatedAt` is stamped only when a row was already there, so a caller can
|
|
11
|
+
* tell a fresh address from a rotated one without a prior read.
|
|
12
|
+
*/
|
|
13
|
+
put(input: PutCalendarFeedTokenInput): Promise<CalendarFeedTokenItem>;
|
|
14
|
+
/**
|
|
15
|
+
* The address a calendar holds, or `null` when it has none. Scoped by account
|
|
16
|
+
* config: a management read is always somebody's, and an unscoped one would
|
|
17
|
+
* answer for a calendar the caller does not own.
|
|
18
|
+
*/
|
|
19
|
+
findByCalendar(accountConfigId: string, calendarId: string): Promise<CalendarFeedTokenItem | null>;
|
|
20
|
+
/**
|
|
21
|
+
* The row a token hash names, or `null` when nothing answers to it.
|
|
22
|
+
*
|
|
23
|
+
* Deliberately unscoped, and the only read that is: a subscriber arrives with
|
|
24
|
+
* no session at all, so the hash is the whole lookup key and the row it finds
|
|
25
|
+
* is what names the owner. The caller still compares the stored hash against
|
|
26
|
+
* the presented one before serving anything.
|
|
27
|
+
*/
|
|
28
|
+
findByTokenHash(tokenHash: string): Promise<CalendarFeedTokenItem | null>;
|
|
29
|
+
/** Revokes the calendar's address. Every subscribed client stops resolving. */
|
|
30
|
+
delete(accountConfigId: string, calendarId: string): Promise<void>;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { CalendarObjectItem, PutCalendarObjectInput } from "../types.js";
|
|
2
|
+
export interface ICalendarObjectRepository {
|
|
3
|
+
put(input: PutCalendarObjectInput): Promise<CalendarObjectItem>;
|
|
4
|
+
get(calendarId: string, calendarObjectId: string): Promise<CalendarObjectItem>;
|
|
5
|
+
/**
|
|
6
|
+
* The resource under an id, or `null` when the collection does not hold it.
|
|
7
|
+
* `get` throws instead, which is right for a caller that already knows the
|
|
8
|
+
* resource exists; a request naming one is asking whether it does, and that
|
|
9
|
+
* is an answer rather than a fault.
|
|
10
|
+
*/
|
|
11
|
+
find(calendarId: string, calendarObjectId: string): Promise<CalendarObjectItem | null>;
|
|
12
|
+
delete(calendarId: string, calendarObjectId: string): Promise<void>;
|
|
13
|
+
findByResourceName(calendarId: string, resourceName: string): Promise<CalendarObjectItem | null>;
|
|
14
|
+
/**
|
|
15
|
+
* The resource carrying an iCalendar UID, which is how a scheduling message
|
|
16
|
+
* or a calendar-query REPORT addresses an event — a client that has the UID
|
|
17
|
+
* generally does not have the resource name.
|
|
18
|
+
*/
|
|
19
|
+
findByUid(calendarId: string, icalUid: string): Promise<CalendarObjectItem | null>;
|
|
20
|
+
listByUidPrefix(calendarId: string, prefix: string): Promise<CalendarObjectItem[]>;
|
|
21
|
+
listByCalendar(calendarId: string): Promise<CalendarObjectItem[]>;
|
|
22
|
+
/**
|
|
23
|
+
* The resources whose occurrence rows stop before `instant` — the series a
|
|
24
|
+
* range read has to expand for itself because the index does not reach that
|
|
25
|
+
* far. Narrow by construction: a resource that fits inside the expansion
|
|
26
|
+
* horizon carries no `expandedThrough` and never appears here, so a view of
|
|
27
|
+
* an ordinary calendar reads no iCalendar text at all.
|
|
28
|
+
*/
|
|
29
|
+
listIncompleteExpansions(calendarId: string, instant: string): Promise<CalendarObjectItem[]>;
|
|
30
|
+
/**
|
|
31
|
+
* Everything written to the collection after `syncSequence`, in change
|
|
32
|
+
* order — the read behind a WebDAV-Sync report. Exclusive of the token
|
|
33
|
+
* itself, so replaying a token returns only what the client has not seen.
|
|
34
|
+
*/
|
|
35
|
+
listChangedSince(calendarId: string, syncSequence: number): Promise<CalendarObjectItem[]>;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { CalendarOccurrenceInput, PutCalendarObjectInput, UpdateCalendarCollectionInput } from "../types.js";
|
|
2
|
+
import type { ICalendarCollectionRepository } from "./calendar-collection.js";
|
|
3
|
+
import type { ICalendarEventIndexRepository } from "./calendar-event-index.js";
|
|
4
|
+
import type { ICalendarFeedTokenRepository } from "./calendar-feed-token.js";
|
|
5
|
+
import type { ICalendarObjectRepository } from "./calendar-object.js";
|
|
6
|
+
import type { ICalendarSuggestionRepository, SettleCalendarSuggestionInput } from "./calendar-suggestion.js";
|
|
7
|
+
/** The repositories a calendar write set reads before it commits. */
|
|
8
|
+
export interface CalendarRepositories {
|
|
9
|
+
calendarCollection: ICalendarCollectionRepository;
|
|
10
|
+
calendarObject: ICalendarObjectRepository;
|
|
11
|
+
calendarEventIndex: ICalendarEventIndexRepository;
|
|
12
|
+
calendarSuggestion: ICalendarSuggestionRepository;
|
|
13
|
+
calendarFeedToken: ICalendarFeedTokenRepository;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Writes one resource: bumps the collection's sequence, stores the object at
|
|
17
|
+
* the bumped value and replaces its occurrence rows. The object's id derives
|
|
18
|
+
* from `(calendarId, resourceName)`, so the write needs no read of its own.
|
|
19
|
+
*/
|
|
20
|
+
export interface PutCalendarObjectWrite {
|
|
21
|
+
kind: "PutObject";
|
|
22
|
+
accountConfigId: string;
|
|
23
|
+
object: Omit<PutCalendarObjectInput, "syncSequence">;
|
|
24
|
+
occurrences: CalendarOccurrenceInput[];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Rewrites a resource that is already stored, the way a put does, but only
|
|
28
|
+
* while it is still the version that was read: a resource edited or deleted
|
|
29
|
+
* since stays as that edit left it.
|
|
30
|
+
* A collection whose timezone changed re-projects every resource this way.
|
|
31
|
+
*/
|
|
32
|
+
export interface ReprojectCalendarObjectWrite extends Omit<PutCalendarObjectWrite, "kind"> {
|
|
33
|
+
kind: "ReprojectObject";
|
|
34
|
+
/** The etag the resource carried when it was read; a later edit wins. */
|
|
35
|
+
readEtag: string;
|
|
36
|
+
}
|
|
37
|
+
/** Removes a resource with its occurrence rows, and bumps the sequence. */
|
|
38
|
+
export interface DeleteCalendarObjectWrite {
|
|
39
|
+
kind: "DeleteObject";
|
|
40
|
+
accountConfigId: string;
|
|
41
|
+
calendarId: string;
|
|
42
|
+
calendarObjectId: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Settles a suggestion card. Present so accepting a suggestion settles the card
|
|
46
|
+
* in the same commit that writes the resource (issue #1033): a card still
|
|
47
|
+
* asking with the event already in the calendar, or a card marked accepted with
|
|
48
|
+
* no event behind it, is a state nothing later can repair.
|
|
49
|
+
*/
|
|
50
|
+
export interface SettleCalendarSuggestionWrite {
|
|
51
|
+
kind: "SettleSuggestion";
|
|
52
|
+
accountConfigId: string;
|
|
53
|
+
suggestionId: string;
|
|
54
|
+
settle: SettleCalendarSuggestionInput;
|
|
55
|
+
}
|
|
56
|
+
export interface UpdateCalendarCollectionWrite {
|
|
57
|
+
kind: "UpdateCollection";
|
|
58
|
+
accountConfigId: string;
|
|
59
|
+
calendarId: string;
|
|
60
|
+
patch: UpdateCalendarCollectionInput;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Removes a collection with every resource, occurrence and its feed address
|
|
64
|
+
* (issue #1067). A token row outliving its collection is a credential pointing
|
|
65
|
+
* at nothing: it answers 404, but nobody can see it to revoke it, and a later
|
|
66
|
+
* calendar under the same derived id would inherit it.
|
|
67
|
+
*/
|
|
68
|
+
export interface DeleteCalendarCollectionWrite {
|
|
69
|
+
kind: "DeleteCollection";
|
|
70
|
+
accountConfigId: string;
|
|
71
|
+
calendarId: string;
|
|
72
|
+
}
|
|
73
|
+
export type CalendarWrite = PutCalendarObjectWrite | ReprojectCalendarObjectWrite | DeleteCalendarObjectWrite | SettleCalendarSuggestionWrite | UpdateCalendarCollectionWrite | DeleteCalendarCollectionWrite;
|
|
74
|
+
/**
|
|
75
|
+
* The calendar store (issue #15). Reads go through `repos`; a write set is a
|
|
76
|
+
* list of writes that `commit` applies in order: the calendar writes as one
|
|
77
|
+
* atomic batch, then the suggestion settlements, which live with the mail
|
|
78
|
+
* (#1420). A commit that fails between the two is repaired by repeating it,
|
|
79
|
+
* since every write in it converges on a rerun. Writing a
|
|
80
|
+
* resource is three writes — the object, its replaced occurrence rows and the
|
|
81
|
+
* collection's sequence bump — and none of them is meaningful without the
|
|
82
|
+
* others: an object with stale occurrences is a calendar showing events the
|
|
83
|
+
* resource no longer has, and an object written without the bump is a change
|
|
84
|
+
* no sync report will ever hand a client.
|
|
85
|
+
*
|
|
86
|
+
* Nothing inside a commit reads: every decision is made against what `repos`
|
|
87
|
+
* returned before it, and a write that a stale read would get wrong is keyed so
|
|
88
|
+
* that repeating or racing it converges (derived ids, upserts).
|
|
89
|
+
*/
|
|
90
|
+
export interface ICalendarStore {
|
|
91
|
+
readonly repos: CalendarRepositories;
|
|
92
|
+
commit(writes: readonly CalendarWrite[]): Promise<void>;
|
|
93
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { CalendarSuggestionItem, PutCalendarSuggestionInput, ResultList } from "../types.js";
|
|
2
|
+
/**
|
|
3
|
+
* The two fields that record what a person decided about a suggestion. They
|
|
4
|
+
* move together and only through {@link ICalendarSuggestionRepository.settle},
|
|
5
|
+
* so no producer write can walk an answered card back to `Pending`, and no
|
|
6
|
+
* state can name a calendar object that was never written.
|
|
7
|
+
*
|
|
8
|
+
* `acceptedCalendarObjectId` is `""` for every outcome but `Accepted` — the
|
|
9
|
+
* named absent state, never a missing attribute.
|
|
10
|
+
*/
|
|
11
|
+
export interface SettleCalendarSuggestionInput {
|
|
12
|
+
state: CalendarSuggestionItem["state"];
|
|
13
|
+
acceptedCalendarObjectId: string;
|
|
14
|
+
}
|
|
15
|
+
export interface ICalendarSuggestionRepository {
|
|
16
|
+
/**
|
|
17
|
+
* Writes the suggestion under its derived `suggestionId`. An upsert: the
|
|
18
|
+
* producer re-reading the same message rewrites the row it already wrote.
|
|
19
|
+
*
|
|
20
|
+
* Never touches `state` or `acceptedCalendarObjectId` on a row that already
|
|
21
|
+
* exists, so a re-sync of a message whose invitation the user accepted
|
|
22
|
+
* leaves the acceptance intact. A row it creates starts `Pending`.
|
|
23
|
+
*/
|
|
24
|
+
put(input: PutCalendarSuggestionInput): Promise<CalendarSuggestionItem>;
|
|
25
|
+
get(accountConfigId: string, suggestionId: string): Promise<CalendarSuggestionItem>;
|
|
26
|
+
/** Every suggestion one message produced, superseded revisions included. */
|
|
27
|
+
listByMessage(accountConfigId: string, messageId: string): Promise<CalendarSuggestionItem[]>;
|
|
28
|
+
listByAcceptedCalendarObjects(accountConfigId: string, calendarObjectIds: string[]): Promise<CalendarSuggestionItem[]>;
|
|
29
|
+
/**
|
|
30
|
+
* The account's suggestions in one state, newest first. Also how the
|
|
31
|
+
* producer finds the revision a new message supersedes: only a `Pending`
|
|
32
|
+
* suggestion can be superseded, so the candidate set is this one.
|
|
33
|
+
*/
|
|
34
|
+
listByState(accountConfigId: string, state: CalendarSuggestionItem["state"], options: {
|
|
35
|
+
endsAfter: string;
|
|
36
|
+
limit?: number;
|
|
37
|
+
continuationToken?: string;
|
|
38
|
+
}): Promise<ResultList<CalendarSuggestionItem>>;
|
|
39
|
+
/**
|
|
40
|
+
* Records the outcome of a person's decision. Returns the settled row.
|
|
41
|
+
*/
|
|
42
|
+
settle(accountConfigId: string, suggestionId: string, input: SettleCalendarSuggestionInput): Promise<CalendarSuggestionItem>;
|
|
43
|
+
/**
|
|
44
|
+
* Retires a card as `Superseded`, but only while it is still `Pending`, and
|
|
45
|
+
* records the message whose revision retired it so the card can open that
|
|
46
|
+
* one. Returns the retired row, or `null` when the card had already been
|
|
47
|
+
* answered and nothing was written.
|
|
48
|
+
*
|
|
49
|
+
* A compare-and-set rather than a plain `settle` because the producer reads
|
|
50
|
+
* the pending set and writes to it in two steps, and a person can accept a
|
|
51
|
+
* card in between. An unconditional write there would overwrite their
|
|
52
|
+
* acceptance with `Superseded` and blank `acceptedCalendarObjectId`,
|
|
53
|
+
* severing the card from the event it put in their calendar.
|
|
54
|
+
*/
|
|
55
|
+
supersedeIfPending(accountConfigId: string, suggestionId: string, supersededByMessageId: string): Promise<CalendarSuggestionItem | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Points a card already `Superseded` at a later revision, so every retired
|
|
58
|
+
* revision of an event opens the newest one. Returns the updated row, or
|
|
59
|
+
* `null` when the card is not superseded and nothing was written.
|
|
60
|
+
*/
|
|
61
|
+
repointSuperseded(accountConfigId: string, suggestionId: string, supersededByMessageId: string): Promise<CalendarSuggestionItem | null>;
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ConfigImportItem, CreateConfigImportInput, UpdateConfigImportInput } from "../types.js";
|
|
2
|
+
export interface IConfigImportRepository {
|
|
3
|
+
create(input: CreateConfigImportInput): Promise<ConfigImportItem>;
|
|
4
|
+
get(importId: string): Promise<ConfigImportItem>;
|
|
5
|
+
update(importId: string, input: UpdateConfigImportInput): Promise<ConfigImportItem>;
|
|
6
|
+
/** Newest first, so the caller reads the import a person just ran. */
|
|
7
|
+
listByAccountConfig(accountConfigId: string): Promise<ConfigImportItem[]>;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { BodyPartItem, BodyPartUpsertInput, CreateEnvelopeInput, EnvelopeItem, MessageData, MessageReferenceInput, UpdateEnvelopeInput } from "../types.js";
|
|
2
|
+
export interface IEnvelopeRepository {
|
|
3
|
+
createEnvelope(input: CreateEnvelopeInput): Promise<EnvelopeItem>;
|
|
4
|
+
upsertEnvelope(input: CreateEnvelopeInput): Promise<EnvelopeItem>;
|
|
5
|
+
getEnvelope(envelopeId: string): Promise<EnvelopeItem>;
|
|
6
|
+
getEnvelope(envelopeIds: string[]): Promise<EnvelopeItem[]>;
|
|
7
|
+
updateEnvelope(envelopeId: string, input: UpdateEnvelopeInput): Promise<EnvelopeItem>;
|
|
8
|
+
deleteEnvelope(envelopeId: string): Promise<void>;
|
|
9
|
+
deleteManyEnvelopes(envelopeIds: string[]): Promise<void>;
|
|
10
|
+
upsertBodyParts(messageId: string, parts: BodyPartUpsertInput[]): Promise<void>;
|
|
11
|
+
replaceMessageReferences(messageId: string, references: MessageReferenceInput[]): Promise<void>;
|
|
12
|
+
getMessageData(messageId: string): Promise<MessageData>;
|
|
13
|
+
listBodyParts(messageId: string): Promise<BodyPartItem[]>;
|
|
14
|
+
/**
|
|
15
|
+
* Up to `limit` messages now in the folder that are queued to have their
|
|
16
|
+
* structure read again from the mail server.
|
|
17
|
+
*/
|
|
18
|
+
listQueuedStructureRefetches(mailboxId: string, limit: number): Promise<Array<{
|
|
19
|
+
messageId: string;
|
|
20
|
+
uid: number;
|
|
21
|
+
}>>;
|
|
22
|
+
/** Take messages off that queue, once each. */
|
|
23
|
+
clearStructureRefetches(messageIds: string[]): Promise<void>;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { CreateFilterInput, FilterItem, ResultList, UpdateFilterInput } from "../types.js";
|
|
2
|
+
export interface IFilterRepository {
|
|
3
|
+
create(input: CreateFilterInput): Promise<FilterItem>;
|
|
4
|
+
get(accountConfigId: string, filterId: string): Promise<FilterItem>;
|
|
5
|
+
update(accountConfigId: string, filterId: string, input: UpdateFilterInput): Promise<FilterItem>;
|
|
6
|
+
delete(accountConfigId: string, filterId: string): Promise<void>;
|
|
7
|
+
listByAccountConfig(accountConfigId: string): Promise<FilterItem[]>;
|
|
8
|
+
/**
|
|
9
|
+
* A single signed page of an account config's filters via the primary index —
|
|
10
|
+
* the settings-page/API list (RFC 034). Mirrors
|
|
11
|
+
* `IMailboxRepository.listByAccount`, so the API surface paginates identically
|
|
12
|
+
* to `listMailboxes`; `continuationToken` round-trips a backend-native cursor.
|
|
13
|
+
*/
|
|
14
|
+
listPageByAccountConfig(accountConfigId: string, options?: {
|
|
15
|
+
limit?: number;
|
|
16
|
+
continuationToken?: string;
|
|
17
|
+
}): Promise<ResultList<FilterItem>>;
|
|
18
|
+
listByAccountAndState(accountConfigId: string, state: FilterItem["state"]): Promise<FilterItem[]>;
|
|
19
|
+
/**
|
|
20
|
+
* Lazily patch a Temporary filter read past its `expiresAt` to `Expired` and
|
|
21
|
+
* return the refreshed row (RFC 034 Decision 1.2). `expiresAt`/`now` are the
|
|
22
|
+
* source of truth for whether a filter is still active — `state` is only a
|
|
23
|
+
* cache of that comparison, refreshed here on whatever read touches the row
|
|
24
|
+
* next. A no-op (returns the item unchanged) for a Standing filter or one
|
|
25
|
+
* already Expired.
|
|
26
|
+
*/
|
|
27
|
+
refreshExpiry(item: FilterItem): Promise<FilterItem>;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CreateLabelInput, LabelItem, ResultList, UpdateLabelInput } from "../types.js";
|
|
2
|
+
export interface ILabelRepository {
|
|
3
|
+
create(input: CreateLabelInput): Promise<LabelItem>;
|
|
4
|
+
get(accountConfigId: string, labelId: string): Promise<LabelItem>;
|
|
5
|
+
update(accountConfigId: string, labelId: string, input: UpdateLabelInput): Promise<LabelItem>;
|
|
6
|
+
delete(accountConfigId: string, labelId: string): Promise<void>;
|
|
7
|
+
listByAccountConfig(accountConfigId: string): Promise<LabelItem[]>;
|
|
8
|
+
/**
|
|
9
|
+
* A single signed page of an account config's labels (issue #26), mirroring
|
|
10
|
+
* `IFilterRepository.listPageByAccountConfig` — the settings-page/API list.
|
|
11
|
+
*/
|
|
12
|
+
listPageByAccountConfig(accountConfigId: string, options?: {
|
|
13
|
+
limit?: number;
|
|
14
|
+
continuationToken?: string;
|
|
15
|
+
}): Promise<ResultList<LabelItem>>;
|
|
16
|
+
findByNormalizedName(accountConfigId: string, normalizedName: string): Promise<LabelItem | null>;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MailboxLockItem, WithMailboxLockResult } from "../types.js";
|
|
2
|
+
export interface IMailboxLockRepository {
|
|
3
|
+
tryAcquireLock(mailboxId: string, eventName: string, accountId: string, lockId: string, ttlSeconds: number): Promise<boolean>;
|
|
4
|
+
releaseLock(accountId: string, mailboxId: string, eventName: string, lockId: string): Promise<void>;
|
|
5
|
+
withMailboxLock<T>(mailboxId: string, eventName: string, accountId: string, operation: () => Promise<T>, options?: {
|
|
6
|
+
lockId?: string;
|
|
7
|
+
}): Promise<WithMailboxLockResult<T>>;
|
|
8
|
+
get(accountId: string, mailboxId: string, eventName: string): Promise<MailboxLockItem | null>;
|
|
9
|
+
listAllLocks(): Promise<MailboxLockItem[]>;
|
|
10
|
+
listByAccount(accountId: string): Promise<MailboxLockItem[]>;
|
|
11
|
+
deleteByAccount(accountId: string): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|