@happyvertical/smrt-messages 0.62.6 → 0.62.8

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.
Files changed (83) hide show
  1. package/AGENTS.md +102 -0
  2. package/dist/access-enforcement.d.ts +20 -0
  3. package/dist/access-enforcement.d.ts.map +1 -0
  4. package/dist/access.d.ts +203 -0
  5. package/dist/access.d.ts.map +1 -0
  6. package/dist/chunks/AttachmentCollection-DhCoruwp.js +308 -0
  7. package/dist/chunks/AttachmentCollection-DhCoruwp.js.map +1 -0
  8. package/dist/chunks/{Email-ChfbMCSF.js → Email-CmNoK1lj.js} +9 -6
  9. package/dist/chunks/Email-CmNoK1lj.js.map +1 -0
  10. package/dist/chunks/EmailAccountCollection-CHizpsxL.js +1555 -0
  11. package/dist/chunks/EmailAccountCollection-CHizpsxL.js.map +1 -0
  12. package/dist/chunks/EmailCollection-Yo2wBv_1.js +181 -0
  13. package/dist/chunks/EmailCollection-Yo2wBv_1.js.map +1 -0
  14. package/dist/chunks/{EmailFolder-XH5eH4Ed.js → EmailFolder-Dks5clxA.js} +25 -6
  15. package/dist/chunks/EmailFolder-Dks5clxA.js.map +1 -0
  16. package/dist/chunks/EmailFolderCollection-nIR4Kpcr.js +177 -0
  17. package/dist/chunks/EmailFolderCollection-nIR4Kpcr.js.map +1 -0
  18. package/dist/chunks/EmailSender-B-Rtq9du.js +147 -0
  19. package/dist/chunks/EmailSender-B-Rtq9du.js.map +1 -0
  20. package/dist/chunks/{Message-C6P1V5C_.js → Message-e99HkbG8.js} +30 -6
  21. package/dist/chunks/Message-e99HkbG8.js.map +1 -0
  22. package/dist/chunks/{MessageCollection-CjCT06XE.js → MessageCollection-t8cLUSNJ.js} +2 -2
  23. package/dist/chunks/{MessageCollection-CjCT06XE.js.map → MessageCollection-t8cLUSNJ.js.map} +1 -1
  24. package/dist/chunks/MessagingEndpointCollection-CGtAL77R.js +97 -0
  25. package/dist/chunks/MessagingEndpointCollection-CGtAL77R.js.map +1 -0
  26. package/dist/chunks/{SlackSender-CjSvwY1K.js → SlackSender-CetlSe6D.js} +2 -2
  27. package/dist/chunks/{SlackSender-CjSvwY1K.js.map → SlackSender-CetlSe6D.js.map} +1 -1
  28. package/dist/chunks/{TweetSender-CcLPNNi1.js → TweetSender-Dw-TDxIB.js} +2 -2
  29. package/dist/chunks/{TweetSender-CcLPNNi1.js.map → TweetSender-Dw-TDxIB.js.map} +1 -1
  30. package/dist/chunks/{providers-4iLula-V.js → providers-Bz_F_ywF.js} +36 -1
  31. package/dist/chunks/{providers-4iLula-V.js.map → providers-Bz_F_ywF.js.map} +1 -1
  32. package/dist/collections/AttachmentCollection.d.ts +6 -0
  33. package/dist/collections/AttachmentCollection.d.ts.map +1 -1
  34. package/dist/collections/EmailAccountCollection.d.ts.map +1 -1
  35. package/dist/connect.d.ts +82 -0
  36. package/dist/connect.d.ts.map +1 -0
  37. package/dist/connect.js +126 -0
  38. package/dist/connect.js.map +1 -0
  39. package/dist/index.d.ts +3 -0
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +507 -1402
  42. package/dist/index.js.map +1 -1
  43. package/dist/mail-sync-jobs.d.ts +48 -0
  44. package/dist/mail-sync-jobs.d.ts.map +1 -0
  45. package/dist/mail-sync.d.ts +58 -0
  46. package/dist/mail-sync.d.ts.map +1 -0
  47. package/dist/manifest.json +1040 -56
  48. package/dist/models/Account.d.ts +23 -0
  49. package/dist/models/Account.d.ts.map +1 -1
  50. package/dist/models/Attachment.d.ts +14 -0
  51. package/dist/models/Attachment.d.ts.map +1 -1
  52. package/dist/models/Email.d.ts +1 -0
  53. package/dist/models/Email.d.ts.map +1 -1
  54. package/dist/models/EmailAccount.d.ts +32 -2
  55. package/dist/models/EmailAccount.d.ts.map +1 -1
  56. package/dist/models/EmailFolder.d.ts +7 -0
  57. package/dist/models/EmailFolder.d.ts.map +1 -1
  58. package/dist/models/Message.d.ts +7 -0
  59. package/dist/models/Message.d.ts.map +1 -1
  60. package/dist/permissions.d.ts +11 -0
  61. package/dist/permissions.d.ts.map +1 -1
  62. package/dist/providers/email.js +3 -2
  63. package/dist/providers/email.js.map +1 -1
  64. package/dist/providers/slack.js +2 -2
  65. package/dist/providers/twitter.js +2 -2
  66. package/dist/providers.d.ts.map +1 -1
  67. package/dist/recipes.d.ts +1 -1
  68. package/dist/services/MessagingSettingsService.d.ts +86 -0
  69. package/dist/services/MessagingSettingsService.d.ts.map +1 -1
  70. package/dist/services/NotificationOutboxService.d.ts +3 -0
  71. package/dist/services/NotificationOutboxService.d.ts.map +1 -1
  72. package/dist/smrt-knowledge.json +826 -29
  73. package/dist/smrt-knowledge.okf.md +4 -2
  74. package/dist/types.d.ts +10 -1
  75. package/dist/types.d.ts.map +1 -1
  76. package/package.json +21 -16
  77. package/dist/chunks/AccountCollection-RP_hLf6L.js +0 -257
  78. package/dist/chunks/AccountCollection-RP_hLf6L.js.map +0 -1
  79. package/dist/chunks/Email-ChfbMCSF.js.map +0 -1
  80. package/dist/chunks/EmailFolder-XH5eH4Ed.js.map +0 -1
  81. package/dist/chunks/Message-C6P1V5C_.js.map +0 -1
  82. package/dist/chunks/__smrt-register__-CfOb1uCN.js +0 -6
  83. package/dist/chunks/__smrt-register__-CfOb1uCN.js.map +0 -1
package/AGENTS.md CHANGED
@@ -34,6 +34,78 @@ Multi-channel messaging with STI hierarchies for both messages and accounts. Cre
34
34
  generated mutations around the settings service or make secret fields writable.
35
35
  - **Recipe `messages.slack`** (`src/recipes.ts`, help in `src/help/slack.md`): lists Slack messages and workspaces beside the Mailbox and Notifications recipes; workspaces stay read-only and sending goes through the senders, not generated routes. Fields it shows carry `@field({ description })` in plain words; keep them when editing the models.
36
36
 
37
+ ## Per-account mail access (owner + grants)
38
+
39
+ Optional by default: `Account.ownerUserId` is nullable, and an account without
40
+ an owner stays tenant-wide. Apps that want private or shared mailboxes set
41
+ owners and call `configureMailAccess({ options, resolvePrincipal })` at startup
42
+ (`access.ts`); smrt never knows the host's credential model, the host returns a
43
+ `MailPrincipal` (`userId` + tenant, optional `scopes` / `accountIds` ceilings).
44
+
45
+ - Scopes `read`, `triage`, `draft`, `send` are `ResourceGrant` rows (resource
46
+ type `messages:account`, permission `messages.<scope>`) checked by
47
+ `checkResourceOperationPermission`, so the grantee also needs the tenant
48
+ `messages.<scope>` permission (the ceiling). The owner holds every scope
49
+ implicitly. Agents are `User` rows the host maps its credential to; the
50
+ principal ceilings are intersected with the grant, never added to it.
51
+ - `access-enforcement.ts` is a `GlobalInterceptors` entry registered at package
52
+ load. Emails, folders and attachments (matched by STI ancestry) are filtered
53
+ in `beforeList`/`afterList`/`afterGet`; raw `query()` on them is refused while
54
+ any account is closed to the principal. Fail closed: no principal, no
55
+ resolver or a foreign tenant means owned accounts are invisible. No tenant
56
+ admin or super-admin bypass; trusted work (sync, outbox) uses
57
+ `runWithMailSystemAccess()`. `EmailAccount.syncFrom()` does so itself.
58
+ - Attachments carry a denormalized `accountId` (always derived from the message in a
59
+ `beforeSave` interceptor, never caller-supplied) so lists, projections and counts filter in SQL; run
60
+ `AttachmentCollection.backfillAccountIds()` once after upgrading (legacy rows
61
+ without it are hidden from every read until then).
62
+ - `connectMailbox` refuses by default: give the service `allowedMailHosts`
63
+ (and optionally `allowedMailPorts`) or your own `validateMailbox`. The
64
+ built-in validator never connects to private, loopback or link-local
65
+ addresses and returns only a generic error. Policy lookups use the
66
+ configured db handle, not a caller's transaction.
67
+ - `Message.send()` needs the `send` scope on an owned account. Account rows are
68
+ not filtered (senders, routes and the outbox read them without a principal).
69
+ - `MailAccessService` (`grant`, `revoke`, `list`, `setOwner`) needs tenant
70
+ `messages.manage-access` AND ownership (or delegation); an administrator
71
+ cannot read, self-grant or take over an owned mailbox. Unowned accounts can be
72
+ claimed once with `messages.manage-credentials`.
73
+ - Before `configureMailAccess` is called the policy still fails closed on
74
+ owned accounts: every collection operation on a mail class (the core `onCollectionReady`
75
+ interceptor hook, so STI subclasses on a default collection are covered) registers its
76
+ database, per database, and the policy hides every owned account's mail
77
+ through list, count, projections, facets and raw queries; it learns the database from the first mail or account row it
78
+ sees and, with no principal resolver, hides every owned account's mail.
79
+ Direct hydration (`new Email({ id }).initialize()`, `loadRelated()`) is gated
80
+ in the models' `loadFromId`/`loadFromSlug`.
81
+ - `connectionStatus` (`connected` / `needs_reconnect`) and `statusMessage` mark
82
+ an account whose sign-in the server refused; `syncFrom()` sets it.
83
+
84
+ ## Mailbox connect (provider-neutral)
85
+
86
+ Credentials reach smrt-secrets in two ways; neither writes the plaintext `settings` fallback.
87
+
88
+ - **Write-only app password**: `MessagingSettingsService.connectMailbox()`
89
+ (permission `messages.manage-credentials`). The candidate credential is
90
+ validated by opening a session first (`validateMailbox` option, default the
91
+ provider's email client); a refusal leaves no account and no secret, and the
92
+ error text has the secret redacted. The connecting user becomes the owner;
93
+ `label` and the per-account endpoint (`configuration`) are stored; reconnect
94
+ replaces the secret and is owner-only. `setAccountActive()` pauses/resumes
95
+ (`isActive`), `removeAccount()` deletes the secret, the synced mail and the
96
+ account. IMAP/POP3 are admitted here (receive-only), not by `saveAccount`.
97
+ - **Generic OAuth 2.0 / OIDC**: `@happyvertical/smrt-messages/connect`
98
+ (`startMailOAuthConnect`, `completeMailOAuthConnect`, `MailOAuthProvider`)
99
+ on the shared kernel `@happyvertical/smrt-secrets/connect` (single-use
100
+ tenant- and user-bound `ConnectState`, PKCE, safe return path, OIDC
101
+ discovery with issuer check). The signed-in user becomes the owner; an
102
+ account owned by someone else or by no one is never taken over. No role
103
+ checks in the flow: authorize before calling.
104
+ - **Reconnect**: `syncFrom()` marks an auth failure `connectionStatus =
105
+ 'needs_reconnect'` (`Account.markNeedsReconnect/markConnected`) instead of
106
+ failing silently.
107
+ - The Google provider is a later step (sdk#1405), not part of this flow.
108
+
37
109
  ## In-app notifications (`UserNotification`)
38
110
 
39
111
  The in-app channel: one stored row per person, with read state.
@@ -168,3 +240,33 @@ handoff suite (SQLite and migrated PostgreSQL).
168
240
  ## Protected external contacts
169
241
 
170
242
  Profile email uses exclusive `recipientProfileId` plus `resolveProfileRecipient`, a reserved `profileNotificationPolicy` and exact current tenant-owned public Profile email. No User account is required. Before activating profiles, run normal framework schema migration and public `planNotificationProfileRecipients` / `migrateNotificationProfileRecipients`; runtime verifies physical constraints and never applies DDL. Legacy User notification and opt-out paths remain User-only. See [profile recipient contract and matrix](agents/profile-recipients.md).
243
+
244
+ ## Incremental mail sync (change feed)
245
+
246
+ `EmailAccount.syncChanges({ limit?, maxBatches? })` (`mail-sync.ts`) drives
247
+ `EmailClient.getChanges()` (JMAP provider `jmap`; `@happyvertical/email` 0.114+).
248
+ `syncFrom()` stays the polling path for IMAP/POP3.
249
+
250
+ - `EmailAccount.syncCursor` is the opaque feed cursor (sensitive + readonly, never
251
+ on generated surfaces). It is saved only after its batch is applied; a failure
252
+ anywhere leaves it where it was, so the job just retries.
253
+ - Rows are keyed on `Email.providerMessageId` (the server's own id, per account),
254
+ so applying a batch twice changes nothing. Added/changed messages upsert,
255
+ `removed` deletes, `folders` upserts `EmailFolder` by path and counts are
256
+ recomputed for touched folders. Metadata-only changes keep stored bodies.
257
+ - `resync-required` clears the cursor and runs a full pass in the same run; a
258
+ full pass from no cursor deletes stored messages (with a `providerMessageId`)
259
+ the server no longer has. A second resync request in one run throws.
260
+ - One lane per account: runs queue behind each other in-process, work on the
261
+ stored (revision-guarded) row, and the job is deduplicated per tenant+account.
262
+ Inactive and `needs_reconnect` accounts, and clients without `getChanges`,
263
+ return `{ status: 'skipped' }`. Auth failures call `markNeedsReconnect()` and
264
+ throw with `retryable: false`. The sync runs under `runWithMailSystemAccess()`.
265
+ - Job: `enqueueMailSync(account)` / `enqueueDueMailSyncs(accounts)`
266
+ (`mail-sync-jobs.ts`, queue `mail-sync`, dedupe key `mail-sync:<accountId>`)
267
+ target `EmailAccount.syncChanges` through `@happyvertical/smrt-jobs` (optional
268
+ peer). The host runs the `TaskRunner` and schedules `enqueueDueMailSyncs`.
269
+ - Known gaps: attachment rows are not created (only `hasAttachments`/`size`);
270
+ a renamed server folder creates a new folder row (stored messages keep the old
271
+ path until they change); `jmap` has no connect-flow validator yet and is not an
272
+ outbound transport.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Collection-layer enforcement of per-account mail access (see `access.ts`).
3
+ *
4
+ * Registered once at package load as a `GlobalInterceptors` entry, so every
5
+ * list/get/count/raw read of an owned account's emails, folders and
6
+ * attachments is filtered in the collection, not in a component. Matching is
7
+ * by STI ancestry, so an app subclass of `Email` is governed too.
8
+ *
9
+ * Account rows themselves are not filtered here: senders, routes and the
10
+ * outbox read them without a principal, and the content (emails, folders,
11
+ * attachments) is what an account grant protects.
12
+ *
13
+ * @packageDocumentation
14
+ */
15
+ import { type CollectionInterceptor } from '@happyvertical/smrt-core';
16
+ export declare const MAIL_ACCESS_INTERCEPTOR_NAME = "smrt-messages-account-access";
17
+ export declare function createMailAccessInterceptor(): CollectionInterceptor;
18
+ /** Idempotent; called at package load. */
19
+ export declare function ensureMailAccessEnforcementRegistered(): void;
20
+ //# sourceMappingURL=access-enforcement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access-enforcement.d.ts","sourceRoot":"","sources":["../src/access-enforcement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EACL,KAAK,qBAAqB,EAQ3B,MAAM,0BAA0B,CAAC;AA8FlC,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAE3E,wBAAgB,2BAA2B,IAAI,qBAAqB,CAyHnE;AAID,0CAA0C;AAC1C,wBAAgB,qCAAqC,IAAI,IAAI,CAI5D"}
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Per-account mail access: an optional owner plus grants (read, triage, draft,
3
+ * send) for people and host-mapped agent accounts, on smrt-users
4
+ * `ResourceGrant`.
5
+ *
6
+ * Optional by default: a mail account with no `ownerUserId` keeps today's
7
+ * tenant-wide behavior. An app that wants private or shared mailboxes sets an
8
+ * owner and calls {@link configureMailAccess} once at startup; from then on
9
+ * reads of an owned account's emails, folders and attachments are limited to
10
+ * the owner and read grantees (enforced in the collection layer by
11
+ * `access-enforcement.ts`, never by UI), and sending through an owned account
12
+ * needs the `send` scope.
13
+ *
14
+ * The acting principal comes from the host through `resolvePrincipal`, so
15
+ * smrt never knows the host's credential model (a session cookie, an agent
16
+ * bearer token). Fail closed: an owned account is invisible to a missing,
17
+ * foreign-tenant or ceiling-excluded principal. There is no tenant-admin or
18
+ * super-admin bypass on content; trusted server work (sync, outbox) opts in
19
+ * explicitly with {@link runWithMailSystemAccess}.
20
+ *
21
+ * Grants live in `ResourceGrant` (resource type {@link MAIL_ACCOUNT_RESOURCE_TYPE},
22
+ * permission `messages.<scope>`). smrt-users composes them after tenant RBAC:
23
+ * the grantee must also hold the tenant-level `messages.<scope>` permission,
24
+ * which acts as the tenant's ceiling; the exact grant then narrows it per
25
+ * account. The owner implicitly holds every scope on their own accounts and
26
+ * needs no grant.
27
+ *
28
+ * @packageDocumentation
29
+ */
30
+ import type { SmrtClassOptions } from '@happyvertical/smrt-core';
31
+ import { MANAGE_MAIL_ACCESS_PERMISSION } from './permissions.js';
32
+ export declare const MAIL_SCOPES: readonly ["read", "triage", "draft", "send"];
33
+ export type MailScope = (typeof MAIL_SCOPES)[number];
34
+ /** `ResourceGrant.resourceType` for a mail account. */
35
+ export declare const MAIL_ACCOUNT_RESOURCE_TYPE = "messages:account";
36
+ /** The tenant permission slug that is the ceiling for a mail scope. */
37
+ export declare function mailScopePermission(scope: MailScope): string;
38
+ export declare function isMailScope(value: unknown): value is MailScope;
39
+ /** The acting principal, as the host knows it. */
40
+ export interface MailPrincipal {
41
+ /** Host identity recorded for audit (a user id, an agent credential id). */
42
+ id: string;
43
+ /** Tenant the principal authenticated into. Must equal the account's. */
44
+ tenantId: string;
45
+ /**
46
+ * The smrt-users `User` id that owns accounts and holds `ResourceGrant`
47
+ * rows. People are their own user; an agent account is a `User` row the host
48
+ * maps its credential to.
49
+ */
50
+ userId: string;
51
+ /** `'person'`, `'agent'`, or any host label; informational. */
52
+ kind?: string;
53
+ /**
54
+ * Host ceiling on scopes (for example an agent credential's mail scopes).
55
+ * Intersected with the owner/grant decision; omit for no ceiling. An empty
56
+ * list grants nothing.
57
+ */
58
+ scopes?: readonly MailScope[];
59
+ /**
60
+ * Host ceiling on account ids (for example `allowedMailAccountIds`).
61
+ * Intersected with the owner/grant decision; omit for no ceiling. An empty
62
+ * list grants nothing.
63
+ */
64
+ accountIds?: readonly string[];
65
+ }
66
+ export interface MailAccessResolverContext {
67
+ tenantId: string | null;
68
+ }
69
+ /** Returns the acting principal for the current request or job, or null. */
70
+ export type MailAccessResolver = (context: MailAccessResolverContext) => MailPrincipal | null | undefined | Promise<MailPrincipal | null | undefined>;
71
+ export interface MailAccessConfig {
72
+ /** Database options used to read accounts and grants. Required. */
73
+ options: SmrtClassOptions;
74
+ /** The host's access-check hook. Without it every owned account is closed. */
75
+ resolvePrincipal?: MailAccessResolver;
76
+ }
77
+ /**
78
+ * Turn on mail access enforcement for this process. Call once at startup,
79
+ * after the database is available. Calling again replaces the configuration.
80
+ */
81
+ export declare function configureMailAccess(config: MailAccessConfig): void;
82
+ /** Remove the configuration (tests). Owned accounts then fail closed. */
83
+ export declare function resetMailAccess(): void;
84
+ /**
85
+ * Remember the database a mail row was read with. Until the host calls
86
+ * {@link configureMailAccess}, this lets the policy still find owned accounts
87
+ * and hide their mail (no principal resolver means no one is a principal).
88
+ */
89
+ /**
90
+ * The options with their list bounds removed. `create()` forwards
91
+ * `defaultListLimit`/`maxListLimit` from any options bag, and an access
92
+ * decision needs every account: a truncated read would leave owned accounts
93
+ * out of the denied set and leak their mail.
94
+ */
95
+ export declare function withoutListBounds<T extends object>(options: T): T;
96
+ export declare function learnMailAccessOptions(options: SmrtClassOptions | undefined): void;
97
+ /** Every policy in force: the configured one, else one per learned database. */
98
+ export declare function getEffectiveMailAccessConfigs(): MailAccessConfig[];
99
+ /** The configured policy, else a closed one over the learned database. */
100
+ export declare function getEffectiveMailAccessConfig(): MailAccessConfig | null;
101
+ export declare function getMailAccessConfig(): MailAccessConfig | null;
102
+ /**
103
+ * Run trusted server work (mailbox sync, the notification outbox) with the
104
+ * per-account policy lifted. This is the only bypass; tenant-admin and
105
+ * super-admin contexts do not lift it.
106
+ */
107
+ export declare function runWithMailSystemAccess<T>(fn: () => T): T;
108
+ export declare function inMailSystemAccess(): boolean;
109
+ /** The minimal account shape the policy reads. */
110
+ export interface MailAccessSubject {
111
+ id?: string | null;
112
+ tenantId?: string | null;
113
+ ownerUserId?: string | null;
114
+ }
115
+ export type MailAccessReason = 'unowned' | 'system' | 'owner' | 'grant' | 'not_configured' | 'no_principal' | 'tenant_mismatch' | 'ceiling' | 'denied';
116
+ export interface MailAccessDecision {
117
+ allowed: boolean;
118
+ reason: MailAccessReason;
119
+ }
120
+ /** Thrown by {@link assertMailAccess}; carries a 403-class status. */
121
+ export declare class MailAccessError extends Error {
122
+ readonly scope: MailScope;
123
+ readonly reason: MailAccessReason;
124
+ readonly status = 403;
125
+ constructor(scope: MailScope, reason: MailAccessReason);
126
+ }
127
+ /**
128
+ * Decide whether the current principal holds `scope` on `account`. Never
129
+ * throws for a denial; a lookup failure denies.
130
+ */
131
+ export declare function decideMailAccess(account: MailAccessSubject, scope: MailScope, principalOverride?: MailPrincipal | null): Promise<MailAccessDecision>;
132
+ export declare function canAccessMailAccount(account: MailAccessSubject, scope: MailScope): Promise<boolean>;
133
+ export declare function assertMailAccess(account: MailAccessSubject, scope: MailScope): Promise<void>;
134
+ /**
135
+ * Ids of accounts in the current tenant context on which the current
136
+ * principal lacks `scope`. Empty when nothing is configured or the call runs
137
+ * in {@link runWithMailSystemAccess}.
138
+ */
139
+ export declare function deniedMailAccountIds(scope: MailScope): Promise<string[]>;
140
+ /** Whether the current principal may read mail of `accountId` (empty: yes). */
141
+ export declare function accountReadable(accountId: string | null | undefined, options: SmrtClassOptions | undefined): Promise<boolean>;
142
+ /**
143
+ * Gate for direct hydration (`new Email({ id }).initialize()`,
144
+ * `loadRelated('messageId')`), which bypasses collection read hooks: throws
145
+ * when the loaded row belongs to an account closed to the principal.
146
+ */
147
+ export declare function assertHydratedMailAccess(row: {
148
+ accountId?: string | null;
149
+ messageId?: string | null;
150
+ options?: unknown;
151
+ }): Promise<void>;
152
+ export interface MailAccessAdmin {
153
+ /** The acting user (`MailPrincipal.userId`). */
154
+ userId: string;
155
+ tenantId: string;
156
+ }
157
+ export interface GrantMailAccessInput {
158
+ accountId: string;
159
+ /** The grantee's smrt-users `User` id (a person, or a host-mapped agent). */
160
+ userId: string;
161
+ scope: MailScope;
162
+ effect?: 'grant' | 'deny';
163
+ canDelegate?: boolean;
164
+ /** For a delegated grant: the actor's own delegable grant. */
165
+ parentGrantId?: string | null;
166
+ }
167
+ /**
168
+ * Owner-controlled grant administration. Tenant RBAC (`messages.manage-access`)
169
+ * is necessary but never sufficient: the actor must also own the account, or
170
+ * delegate from their own delegable grant. A tenant administrator therefore
171
+ * cannot read, grant themselves, or take over someone else's mailbox.
172
+ */
173
+ export declare class MailAccessService {
174
+ private readonly options;
175
+ private readonly actor;
176
+ constructor(options: SmrtClassOptions, actor: MailAccessAdmin);
177
+ private account;
178
+ /** Tenant RBAC ceiling for administering mail access (grants, owner). */
179
+ private assertManageAccess;
180
+ /** The new owner must be a real, active member of this tenant. */
181
+ private assertTenantMember;
182
+ private inTenant;
183
+ private resourceFor;
184
+ private grantsApi;
185
+ grant(input: GrantMailAccessInput): Promise<import("@happyvertical/smrt-users").ResourceGrant>;
186
+ revoke(grantId: string): Promise<void>;
187
+ list(accountId: string): Promise<import("@happyvertical/smrt-users").ResourceGrant[]>;
188
+ setOwner(accountId: string, ownerUserId: string): Promise<void>;
189
+ private grantImpl;
190
+ /** Revoke a grant. Delegated children stop working with their ancestor. */
191
+ private revokeImpl;
192
+ /** Owner-only listing of who holds what on one account. */
193
+ private listImpl;
194
+ /**
195
+ * Set or change the owner. An owned account changes hands only by its
196
+ * owner. An unowned account can be claimed by a tenant administrator
197
+ * holding `messages.manage-credentials` (the migration path from
198
+ * tenant-wide to owned).
199
+ */
200
+ private setOwnerImpl;
201
+ }
202
+ export { MANAGE_MAIL_ACCESS_PERMISSION };
203
+ //# sourceMappingURL=access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,EAEL,6BAA6B,EAG9B,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,WAAW,8CAA+C,CAAC;AACxE,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAErD,uDAAuD;AACvD,eAAO,MAAM,0BAA0B,qBAAqB,CAAC;AAS7D,uEAAuE;AACvE,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAE5D;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,SAAS,CAE9D;AAED,kDAAkD;AAClD,MAAM,WAAW,aAAa;IAC5B,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,yEAAyE;IACzE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,+DAA+D;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAC/B,OAAO,EAAE,yBAAyB,KAEhC,aAAa,GACb,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAE9C,MAAM,WAAW,gBAAgB;IAC/B,mEAAmE;IACnE,OAAO,EAAE,gBAAgB,CAAC;IAC1B,8EAA8E;IAC9E,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;CACvC;AA2BD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAElE;AAED,yEAAyE;AACzE,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AAED;;;;GAIG;AACH;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAEjE;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,gBAAgB,GAAG,SAAS,GACpC,IAAI,CAWN;AAED,gFAAgF;AAChF,wBAAgB,6BAA6B,IAAI,gBAAgB,EAAE,CAIlE;AAED,0EAA0E;AAC1E,wBAAgB,4BAA4B,IAAI,gBAAgB,GAAG,IAAI,CAKtE;AAED,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAEzD;AAED,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED,kDAAkD;AAClD,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,MAAM,MAAM,gBAAgB,GACxB,SAAS,GACT,QAAQ,GACR,OAAO,GACP,OAAO,GACP,gBAAgB,GAChB,cAAc,GACd,iBAAiB,GACjB,SAAS,GACT,QAAQ,CAAC;AAEb,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,sEAAsE;AACtE,qBAAa,eAAgB,SAAQ,KAAK;IAGtC,QAAQ,CAAC,KAAK,EAAE,SAAS;IACzB,QAAQ,CAAC,MAAM,EAAE,gBAAgB;IAHnC,QAAQ,CAAC,MAAM,OAAO;gBAEX,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,gBAAgB;CAKpC;AA0DD;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,SAAS,EAChB,iBAAiB,CAAC,EAAE,aAAa,GAAG,IAAI,GACvC,OAAO,CAAC,kBAAkB,CAAC,CA+C7B;AAED,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,SAAS,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAyCnB;AAED,+EAA+E;AAC/E,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACpC,OAAO,EAAE,gBAAgB,GAAG,SAAS,GACpC,OAAO,CAAC,OAAO,CAAC,CAyBlB;AAED;;;;GAIG;AACH,wBAAsB,wBAAwB,CAAC,GAAG,EAAE;IAClD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiBhB;AAMD,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,8DAA8D;IAC9D,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B;AAED;;;;;GAKG;AACH,qBAAa,iBAAiB;IAE1B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBADL,OAAO,EAAE,gBAAgB,EACzB,KAAK,EAAE,eAAe;YAG3B,OAAO;IAiBrB,yEAAyE;YAC3D,kBAAkB;IAgBhC,kEAAkE;YACpD,kBAAkB;YAYlB,QAAQ;IAKtB,OAAO,CAAC,WAAW;YAQL,SAAS;IAYvB,KAAK,CAAC,KAAK,EAAE,oBAAoB;IAIjC,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAItC,IAAI,CAAC,SAAS,EAAE,MAAM;IAItB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAIjD,SAAS;IAwDvB,2EAA2E;YAC7D,UAAU;IA8BxB,2DAA2D;YAC7C,QAAQ;IAoBtB;;;;;OAKG;YACW,YAAY;CA8B3B;AAED,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
@@ -0,0 +1,308 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
2
+ import { C as runWithMailSystemAccess, d as assertHydratedMailAccess } from "./EmailAccountCollection-CHizpsxL.js";
3
+ import { queryGlobal, queryWithGlobals } from "../host.js";
4
+ import { SmrtCollection, SmrtObject, foreignKey, importOptionalDependency, smrt } from "@happyvertical/smrt-core";
5
+ import { TenantScoped, tenantId } from "@happyvertical/smrt-tenancy/decorators";
6
+ //#region src/models/Attachment.ts
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
9
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
10
+ enumerable: true,
11
+ configurable: true,
12
+ writable: true,
13
+ value
14
+ }) : obj[key] = value;
15
+ var __decorateClass = (decorators, target, key, kind) => {
16
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
17
+ for (var i = decorators.length - 1, decorator; i >= 0; i--) if (decorator = decorators[i]) result = (kind ? decorator(target, key, result) : decorator(result)) || result;
18
+ if (kind && result) __defProp(target, key, result);
19
+ return result;
20
+ };
21
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
22
+ function splitAbsolutePath(filePath) {
23
+ const windows = /^[A-Za-z]:[\\/]/.test(filePath);
24
+ if (!windows && !filePath.startsWith("/")) return null;
25
+ const cut = windows ? Math.max(filePath.lastIndexOf("/"), filePath.lastIndexOf("\\")) : filePath.lastIndexOf("/");
26
+ return {
27
+ dir: filePath.slice(0, cut) || filePath.slice(0, cut + 1),
28
+ base: filePath.slice(cut + 1)
29
+ };
30
+ }
31
+ var Attachment = class extends SmrtObject {
32
+ tenantId = null;
33
+ messageId = "";
34
+ accountId = null;
35
+ filename = "";
36
+ contentType = "";
37
+ size = 0;
38
+ contentId = "";
39
+ contentDisposition = "attachment";
40
+ filePath = "";
41
+ sourceUrl = "";
42
+ createdAt = /* @__PURE__ */ new Date();
43
+ constructor(options = {}) {
44
+ super(options);
45
+ if (options.tenantId !== void 0) this.tenantId = options.tenantId;
46
+ if (options.messageId !== void 0) this.messageId = options.messageId;
47
+ if (options.accountId !== void 0) this.accountId = options.accountId || null;
48
+ if (options.filename !== void 0) this.filename = options.filename;
49
+ if (options.contentType !== void 0) this.contentType = options.contentType;
50
+ if (options.size !== void 0) this.size = options.size;
51
+ if (options.contentId !== void 0) this.contentId = options.contentId;
52
+ if (options.contentDisposition !== void 0) this.contentDisposition = options.contentDisposition;
53
+ if (options.filePath !== void 0) this.filePath = options.filePath;
54
+ if (options.sourceUrl !== void 0) this.sourceUrl = options.sourceUrl;
55
+ if (options.createdAt) this.createdAt = options.createdAt;
56
+ }
57
+ /**
58
+ * Direct hydration (`new X({ id }).initialize()`, `loadRelated()`) bypasses
59
+ * the collection read hooks, so the per-account mail policy is applied here
60
+ * too: a row of an account closed to the principal never hydrates.
61
+ */
62
+ async loadFromId() {
63
+ await super.loadFromId();
64
+ await assertHydratedMailAccess(this);
65
+ }
66
+ async loadFromSlug() {
67
+ await super.loadFromSlug();
68
+ await assertHydratedMailAccess(this);
69
+ }
70
+ /**
71
+ * Get the message this attachment belongs to
72
+ */
73
+ async getMessage() {
74
+ if (!this.messageId) return null;
75
+ const { MessageCollection } = await import("./MessageCollection-t8cLUSNJ.js").then((n) => n.n);
76
+ return await (await MessageCollection.create(this.options)).get({ id: this.messageId });
77
+ }
78
+ /**
79
+ * Check if attachment is an image
80
+ */
81
+ isImage() {
82
+ return this.contentType.startsWith("image/");
83
+ }
84
+ /**
85
+ * Check if attachment is a PDF
86
+ */
87
+ isPdf() {
88
+ return this.contentType === "application/pdf";
89
+ }
90
+ /**
91
+ * Check if attachment is inline (embedded in message body)
92
+ */
93
+ isInline() {
94
+ return this.contentDisposition === "inline";
95
+ }
96
+ /**
97
+ * Get file extension from filename
98
+ */
99
+ getExtension() {
100
+ if (!this.filename) return "";
101
+ const parts = this.filename.split(".");
102
+ return parts.length > 1 ? parts[parts.length - 1].toLowerCase() : "";
103
+ }
104
+ /**
105
+ * Get human-readable file size
106
+ */
107
+ getFormattedSize() {
108
+ const units = [
109
+ "B",
110
+ "KB",
111
+ "MB",
112
+ "GB"
113
+ ];
114
+ let size = this.size;
115
+ let unitIndex = 0;
116
+ while (size >= 1024 && unitIndex < units.length - 1) {
117
+ size /= 1024;
118
+ unitIndex++;
119
+ }
120
+ return `${size.toFixed(1)} ${units[unitIndex]}`;
121
+ }
122
+ /**
123
+ * Check if file is stored externally
124
+ */
125
+ hasExternalFile() {
126
+ return !!this.filePath;
127
+ }
128
+ /**
129
+ * Read file content (if stored externally)
130
+ *
131
+ * The files SDK is loaded through core's bundler-invisible optional-import
132
+ * boundary so it never enters provider-neutral consumer bundles (#1979).
133
+ * Absence of the SDK at runtime degrades to the existing null contract.
134
+ *
135
+ * The local provider joins every path onto its base path (the process cwd
136
+ * by default), so an absolute `filePath` is rooted at its own directory, and
137
+ * the bytes are read raw: decoding a PDF as UTF-8 corrupts it (#3808).
138
+ */
139
+ async readContent() {
140
+ if (!this.filePath) return null;
141
+ try {
142
+ const { getFilesystem, initializeProviders } = await importOptionalDependency("@happyvertical/files", "Import '@happyvertical/smrt-core/filesystem' (or '@happyvertical/smrt-assets/filesystem') during server startup to read externally-stored attachments in bundled builds.");
143
+ await initializeProviders?.();
144
+ const split = splitAbsolutePath(this.filePath);
145
+ const data = await (await getFilesystem(split ? {
146
+ type: "local",
147
+ basePath: split.dir
148
+ } : { type: "local" })).read(split ? split.base : this.filePath, { raw: true });
149
+ return data instanceof Buffer ? data : Buffer.from(data);
150
+ } catch {
151
+ return null;
152
+ }
153
+ }
154
+ };
155
+ __publicField(Attachment, "__smrtPackage__", "@happyvertical/smrt-messages");
156
+ __decorateClass([tenantId({ nullable: true })], Attachment.prototype, "tenantId", 2);
157
+ __decorateClass([foreignKey("Message")], Attachment.prototype, "messageId", 2);
158
+ __decorateClass([foreignKey("Account")], Attachment.prototype, "accountId", 2);
159
+ Attachment = __decorateClass([TenantScoped({ mode: "optional" }), smrt({
160
+ api: { include: [
161
+ "list",
162
+ "get",
163
+ "create",
164
+ "delete"
165
+ ] },
166
+ mcp: { include: ["list", "get"] },
167
+ cli: { skipApiCheck: true }
168
+ })], Attachment);
169
+ //#endregion
170
+ //#region src/collections/AttachmentCollection.ts
171
+ var AttachmentCollection_exports = /* @__PURE__ */ __exportAll({ AttachmentCollection: () => AttachmentCollection });
172
+ var AttachmentCollection = class extends SmrtCollection {
173
+ static _itemClass = Attachment;
174
+ /**
175
+ * Fill `accountId` on attachments saved before the column existed, from
176
+ * their message. Run once per tenant after upgrading; safe to repeat.
177
+ * Returns the number of rows updated.
178
+ */
179
+ async backfillAccountIds() {
180
+ return runWithMailSystemAccess(async () => {
181
+ const { MessageCollection } = await import("./MessageCollection-t8cLUSNJ.js").then((n) => n.n);
182
+ const messages = await MessageCollection.create(this.options);
183
+ let updated = 0;
184
+ for (const attachment of await this.list({ where: { accountId: null } })) {
185
+ if (!attachment.messageId) continue;
186
+ const message = await messages.get({ id: attachment.messageId });
187
+ if (!message?.accountId) continue;
188
+ attachment.accountId = message.accountId;
189
+ await attachment.save();
190
+ updated++;
191
+ }
192
+ return updated;
193
+ });
194
+ }
195
+ /**
196
+ * Get attachments for a message
197
+ */
198
+ async getByMessage(messageId) {
199
+ return await this.list({ where: { messageId } });
200
+ }
201
+ /**
202
+ * Get attachments by content type
203
+ */
204
+ async getByContentType(contentType) {
205
+ return await this.list({ where: { contentType } });
206
+ }
207
+ /**
208
+ * Get image attachments
209
+ */
210
+ async getImages(messageId) {
211
+ return (messageId ? await this.getByMessage(messageId) : await this.list({})).filter((a) => a.isImage());
212
+ }
213
+ /**
214
+ * Get PDF attachments
215
+ */
216
+ async getPdfs(messageId) {
217
+ return (messageId ? await this.getByMessage(messageId) : await this.list({})).filter((a) => a.isPdf());
218
+ }
219
+ /**
220
+ * Get inline attachments (embedded in message body)
221
+ */
222
+ async getInline(messageId) {
223
+ return (await this.getByMessage(messageId)).filter((a) => a.isInline());
224
+ }
225
+ /**
226
+ * Get regular attachments (not inline)
227
+ */
228
+ async getRegular(messageId) {
229
+ return (await this.getByMessage(messageId)).filter((a) => !a.isInline());
230
+ }
231
+ /**
232
+ * Get attachments with external files
233
+ */
234
+ async getWithExternalFiles() {
235
+ return (await this.list({})).filter((a) => a.hasExternalFile());
236
+ }
237
+ /**
238
+ * Get total size of attachments for a message
239
+ */
240
+ async getTotalSize(messageId) {
241
+ return (await this.getByMessage(messageId)).reduce((sum, a) => sum + a.size, 0);
242
+ }
243
+ /**
244
+ * Get largest attachments
245
+ */
246
+ async getLargest(limit = 10) {
247
+ return (await this.list({})).sort((a, b) => b.size - a.size).slice(0, limit);
248
+ }
249
+ /**
250
+ * Search attachments by filename
251
+ */
252
+ async searchByFilename(query) {
253
+ const attachments = await this.list({});
254
+ const lowerQuery = query.toLowerCase();
255
+ return attachments.filter((a) => a.filename?.toLowerCase().includes(lowerQuery));
256
+ }
257
+ /**
258
+ * Get attachments by extension
259
+ */
260
+ async getByExtension(extension) {
261
+ const attachments = await this.list({});
262
+ const lowerExt = extension.toLowerCase().replace(/^\./, "");
263
+ return attachments.filter((a) => a.getExtension() === lowerExt);
264
+ }
265
+ /**
266
+ * Get attachment statistics
267
+ */
268
+ async getStats() {
269
+ const attachments = await this.list({});
270
+ const byType = {};
271
+ for (const attachment of attachments) {
272
+ const type = attachment.contentType.split("/")[0] || "other";
273
+ byType[type] = (byType[type] || 0) + 1;
274
+ }
275
+ return {
276
+ total: attachments.length,
277
+ totalSize: attachments.reduce((sum, a) => sum + a.size, 0),
278
+ byType,
279
+ inline: attachments.filter((a) => a.isInline()).length,
280
+ regular: attachments.filter((a) => !a.isInline()).length
281
+ };
282
+ }
283
+ /**
284
+ * Delete all attachments for a message
285
+ */
286
+ async deleteByMessage(messageId) {
287
+ const attachments = await this.getByMessage(messageId);
288
+ let count = 0;
289
+ for (const attachment of attachments) {
290
+ await attachment.delete();
291
+ count++;
292
+ }
293
+ return count;
294
+ }
295
+ async findByTenant(tenantId) {
296
+ return this.list({ where: { tenantId } });
297
+ }
298
+ async findGlobal() {
299
+ return queryGlobal(this);
300
+ }
301
+ async findWithGlobals(tenantId) {
302
+ return queryWithGlobals(this, tenantId, "Attachment.findWithGlobals");
303
+ }
304
+ };
305
+ //#endregion
306
+ export { AttachmentCollection_exports as n, Attachment as r, AttachmentCollection as t };
307
+
308
+ //# sourceMappingURL=AttachmentCollection-DhCoruwp.js.map