@powerhousedao/reactor-attachments 6.2.2-dev.8 → 6.2.2-dev.80

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/index.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- import { A as ReserveAttachmentOptions, B as SizeMismatch, C as AttachmentMetadata, D as AttachmentUploadResult, E as AttachmentTransportConfig, F as AttachmentNotFound, I as AttachmentPending, L as HashMismatch, M as TransportResponse, N as UploadFirstReserveAttachmentOptions, O as HashFirstReserveAttachmentOptions, P as AttachmentAlreadyExists, R as InvalidAttachmentRef, S as AttachmentHeader, T as AttachmentStatus, V as UploadTooLarge, _ as IAttachmentTransport, a as RemoteAttachmentUpload, b as IAttachmentUploadFactory, c as SwitchboardAttachmentTransport, d as createRef, f as parseRef, g as IAttachmentStore, h as IAttachmentService, i as RemoteAttachmentUploadFactory, j as TransportFetchResult, k as Reservation, l as SwitchboardTransportConfig, m as IAttachmentReader, n as createRemoteAttachmentService, o as RemoteReservationStore, p as AttachmentService, r as RemoteAttachmentStore, s as SwitchboardClientConfig, t as NullAttachmentTransport, u as ParsedRef, v as IAttachmentTransportFactory, w as AttachmentResponse, x as IReservationStore, y as IAttachmentUpload, z as ReservationNotFound } from "./null-attachment-transport-BBhQIk5A.js";
1
+ import { $ as AttachmentPending, A as IReservationStore, B as AttachmentStatus, C as IAttachmentReader, D as IAttachmentTransportFactory, E as IAttachmentTransport, G as HashFirstReserveAttachmentOptions, H as AttachmentTransportConfig, I as AttachmentHeader, J as TransportFetchResult, K as Reservation, L as AttachmentMetadata, M as AttachmentBackendKind, N as AttachmentDownloadOptions, O as IAttachmentUpload, P as AttachmentDownloadTarget, Q as AttachmentNotFound, R as AttachmentResponse, S as IAttachmentBackend, T as IAttachmentStore, U as AttachmentUploadResult, V as AttachmentTargetHeaders, W as AttachmentUploadTarget, X as UploadFirstReserveAttachmentOptions, Y as TransportResponse, Z as AttachmentAlreadyExists, _ as createRef, a as RemoteAttachmentUpload, at as SizeMismatch, b as parseAttachmentDownloadTarget, c as XhrUploadTransportOptions, d as AttachmentUploadResponse, et as AttachmentTransferError, f as AttachmentUploadTransport, g as ParsedRef, h as SwitchboardTransportConfig, i as RemoteAttachmentUploadFactory, it as ReservationNotFound, j as AttachmentBackendHealth, k as IAttachmentUploadFactory, l as createXhrUploadTransport, m as SwitchboardAttachmentTransport, n as createRemoteAttachmentService, nt as HashMismatch, o as RemoteReservationStore, ot as UploadTooLarge, p as createFetchUploadTransport, q as ReserveAttachmentOptions, r as RemoteAttachmentStore, rt as InvalidAttachmentRef, s as SwitchboardClientConfig, t as NullAttachmentTransport, tt as AttachmentTransferStage, u as AttachmentUploadRequest, v as parseRef, w as IAttachmentService, x as parseAttachmentUploadTarget, y as AttachmentService, z as AttachmentSendOptions } from "./null-attachment-transport-CMrO_ZKA.js";
2
+ import * as kysely from "kysely";
2
3
  import { Kysely } from "kysely";
3
- import { AttachmentHash, AttachmentRef } from "@powerhousedao/reactor";
4
+ import { AttachmentHash, AttachmentRef, BaseReadModel, DocumentViewDatabase, IConsistencyTracker, IDocumentModelRegistry, IOperationIndex, IWriteCache } from "@powerhousedao/reactor";
5
+ import { Action, DocumentModelModule, OperationWithContext } from "@powerhousedao/shared/document-model";
4
6
 
5
7
  //#region src/storage/kysely/types.d.ts
6
8
  interface AttachmentTable {
@@ -82,7 +84,7 @@ declare class DirectAttachmentUpload implements IAttachmentUpload {
82
84
  readonly ref: AttachmentRef | null;
83
85
  readonly expiresAtUtc: string;
84
86
  constructor(reservation: Reservation, db: Kysely<AttachmentDatabase>, basePath: string, reservations: IReservationStore, maxBytes?: number | undefined);
85
- send(data: ReadableStream<Uint8Array>): Promise<AttachmentUploadResult>;
87
+ send(data: ReadableStream<Uint8Array>, options?: AttachmentSendOptions): Promise<AttachmentUploadResult>;
86
88
  }
87
89
  //#endregion
88
90
  //#region src/direct/direct-attachment-upload-factory.d.ts
@@ -95,12 +97,35 @@ declare class DirectAttachmentUploadFactory implements IAttachmentUploadFactory
95
97
  createUpload(reservation: Reservation): IAttachmentUpload;
96
98
  }
97
99
  //#endregion
100
+ //#region src/direct/filesystem-attachment-backend.d.ts
101
+ type FilesystemAttachmentBackendConfig = {
102
+ uploadTarget: (reservation: Reservation) => unknown;
103
+ downloadTarget: (hash: AttachmentHash) => unknown;
104
+ readiness?: () => boolean | Promise<boolean>;
105
+ };
106
+ /**
107
+ * Filesystem keeps byte transfer behind Switchboard. URL construction stays
108
+ * at the server edge, while this adapter validates that a filesystem backend
109
+ * can never accidentally return a direct-provider target.
110
+ */
111
+ declare class FilesystemAttachmentBackend implements IAttachmentBackend {
112
+ private readonly store;
113
+ private readonly config;
114
+ readonly kind: "filesystem";
115
+ constructor(store: Pick<IAttachmentStore, "has">, config: FilesystemAttachmentBackendConfig);
116
+ prepareUploadTarget(reservation: Reservation): Promise<AttachmentUploadTarget>;
117
+ prepareDownloadTarget(hash: AttachmentHash): Promise<AttachmentDownloadTarget>;
118
+ exists(hash: AttachmentHash): Promise<boolean>;
119
+ health(): Promise<AttachmentBackendHealth>;
120
+ }
121
+ //#endregion
98
122
  //#region src/attachment-builder.d.ts
99
123
  type AttachmentBuildResult = {
100
124
  service: AttachmentService;
101
125
  store: KyselyAttachmentStore;
102
126
  reservations: KyselyReservationStore;
103
- uploadFactory: IAttachmentUploadFactory; /** Stops the reservation sweep timer, if one was configured via withReservationSweepMs(). */
127
+ uploadFactory: IAttachmentUploadFactory; /** Selected direct-transfer backend, when startup configured one. */
128
+ backend?: IAttachmentBackend; /** Stops the reservation sweep timer, if one was configured via withReservationSweepMs(). */
104
129
  destroy: () => void;
105
130
  };
106
131
  declare class AttachmentBuilder {
@@ -110,9 +135,11 @@ declare class AttachmentBuilder {
110
135
  private customUploadFactory?;
111
136
  private maxUploadBytes?;
112
137
  private reservationSweepMs?;
138
+ private backend?;
113
139
  constructor(db: Kysely<any>, storagePath: string);
114
140
  withTransport(transport: IAttachmentTransport): this;
115
141
  withUploadFactory(factory: IAttachmentUploadFactory): this;
142
+ withBackend(backend: IAttachmentBackend): this;
116
143
  withMaxUploadBytes(maxBytes: number): this;
117
144
  /**
118
145
  * Configure a recurring sweep that deletes expired reservations.
@@ -126,5 +153,184 @@ declare class AttachmentBuilder {
126
153
  build(): Promise<AttachmentBuildResult>;
127
154
  }
128
155
  //#endregion
129
- export { ATTACHMENT_SCHEMA, AttachmentAlreadyExists, type AttachmentBuildResult, AttachmentBuilder, type AttachmentDatabase, type AttachmentHeader, type AttachmentMetadata, AttachmentNotFound, AttachmentPending, type AttachmentResponse, AttachmentService, type AttachmentStatus, type AttachmentTransportConfig, type AttachmentUploadResult, DEFAULT_RESERVATION_TTL_MS, DirectAttachmentUpload, DirectAttachmentUploadFactory, type HashFirstReserveAttachmentOptions, HashMismatch, type IAttachmentReader, type IAttachmentService, type IAttachmentStore, type IAttachmentTransport, type IAttachmentTransportFactory, type IAttachmentUpload, type IAttachmentUploadFactory, type IReservationStore, InvalidAttachmentRef, KyselyAttachmentStore, KyselyReservationStore, NullAttachmentTransport, type ParsedRef, RemoteAttachmentStore, RemoteAttachmentUpload, RemoteAttachmentUploadFactory, RemoteReservationStore, type Reservation, ReservationNotFound, type ReserveAttachmentOptions, SizeMismatch, SwitchboardAttachmentTransport, type SwitchboardClientConfig, type SwitchboardTransportConfig, type TransportFetchResult, type TransportResponse, type UploadFirstReserveAttachmentOptions, UploadTooLarge, createRef, createRemoteAttachmentService, parseRef, runAttachmentMigrations };
156
+ //#region src/reference-index/types.d.ts
157
+ interface CompiledAttachmentExtractor {
158
+ extract(action: Action): AttachmentRef[];
159
+ }
160
+ interface IAttachmentSchemaCompiler {
161
+ forModuleAction(module: DocumentModelModule, actionType: string): CompiledAttachmentExtractor;
162
+ }
163
+ //#endregion
164
+ //#region src/reference-index/attachment-schema-compiler.d.ts
165
+ declare class AttachmentSchemaCompiler implements IAttachmentSchemaCompiler {
166
+ private readonly cache;
167
+ forModuleAction(module: DocumentModelModule, actionType: string): CompiledAttachmentExtractor;
168
+ }
169
+ //#endregion
170
+ //#region src/read-models/attachment-reference/types.d.ts
171
+ interface AttachmentReferenceInput {
172
+ documentId: string;
173
+ ref: AttachmentRef;
174
+ operationId: string;
175
+ branch: string;
176
+ scope: string;
177
+ ordinal: number;
178
+ }
179
+ interface IAttachmentReferenceReader {
180
+ hasReference(documentId: string, ref: AttachmentRef): Promise<boolean>;
181
+ }
182
+ interface IAttachmentReferenceWriter {
183
+ addReferences(references: readonly AttachmentReferenceInput[]): Promise<void>;
184
+ }
185
+ //#endregion
186
+ //#region src/read-models/attachment-reference/index-builder.d.ts
187
+ type AttachmentReferenceIndexBuildResult = {
188
+ store: IAttachmentReferenceReader & IAttachmentReferenceWriter;
189
+ };
190
+ declare class AttachmentReferenceIndexBuilder {
191
+ private readonly db;
192
+ constructor(db: Kysely<unknown>);
193
+ build(): Promise<AttachmentReferenceIndexBuildResult>;
194
+ }
195
+ //#endregion
196
+ //#region src/read-models/attachment-reference/attachment-reference-read-model.d.ts
197
+ declare const ATTACHMENT_REFERENCE_READ_MODEL_ID = "attachment-reference-read-model";
198
+ declare class AttachmentReferenceReadModel extends BaseReadModel {
199
+ private readonly documentModelRegistry;
200
+ private readonly schemaCompiler;
201
+ private readonly referenceWriter;
202
+ private indexingQueue;
203
+ constructor(db: Kysely<DocumentViewDatabase>, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker, documentModelRegistry: IDocumentModelRegistry, schemaCompiler: IAttachmentSchemaCompiler, referenceWriter: IAttachmentReferenceWriter);
204
+ indexOperations(items: OperationWithContext[]): Promise<void>;
205
+ init(): Promise<void>;
206
+ private enqueue;
207
+ protected commitOperations(items: OperationWithContext[]): Promise<void>;
208
+ private indexOperationsInOrdinalOrder;
209
+ private isContiguousThrough;
210
+ private loadThroughOrdinal;
211
+ private sortAndDedupe;
212
+ }
213
+ //#endregion
214
+ //#region src/read-models/attachment-reference/storage/types.d.ts
215
+ interface AttachmentReferenceTable {
216
+ document_id: string;
217
+ attachment_ref: string;
218
+ attachment_hash: string;
219
+ first_operation_id: string;
220
+ branch: string;
221
+ scope: string;
222
+ first_seen_ordinal: number;
223
+ created_at_utc: string;
224
+ }
225
+ interface AttachmentReferenceDatabase {
226
+ attachment_reference: AttachmentReferenceTable;
227
+ }
228
+ //#endregion
229
+ //#region src/read-models/attachment-reference/kysely-attachment-reference-store.d.ts
230
+ declare class KyselyAttachmentReferenceStore implements IAttachmentReferenceReader, IAttachmentReferenceWriter {
231
+ private readonly db;
232
+ constructor(db: Kysely<AttachmentReferenceDatabase>);
233
+ hasReference(documentId: string, ref: AttachmentRef): Promise<boolean>;
234
+ addReferences(references: readonly AttachmentReferenceInput[]): Promise<void>;
235
+ }
236
+ //#endregion
237
+ //#region src/read-models/attachment-reference/storage/migrations/migrator.d.ts
238
+ declare const ATTACHMENT_REFERENCE_SCHEMA = "attachment_reference_read_model";
239
+ declare const ATTACHMENT_REFERENCE_MIGRATION_TABLE = "kysely_migration_attachment_reference_read_model";
240
+ declare const ATTACHMENT_REFERENCE_MIGRATION_LOCK_TABLE = "kysely_migration_attachment_reference_read_model_lock";
241
+ interface AttachmentReferenceMigrationResult {
242
+ success: boolean;
243
+ migrationsExecuted: string[];
244
+ error?: Error;
245
+ }
246
+ declare function runAttachmentReferenceMigrations(db: Kysely<unknown>, schema?: string): Promise<AttachmentReferenceMigrationResult>;
247
+ declare function rollbackAttachmentReferenceMigration(db: Kysely<unknown>, schema?: string): Promise<AttachmentReferenceMigrationResult>;
248
+ declare function getAttachmentReferenceMigrationStatus(db: Kysely<unknown>, schema?: string): Promise<readonly kysely.MigrationInfo[]>;
249
+ //#endregion
250
+ //#region src/storage/s3/config.d.ts
251
+ declare const DEFAULT_S3_ATTACHMENT_PREFIX = "attachments";
252
+ declare const DEFAULT_S3_UPLOAD_TTL_SECONDS = 900;
253
+ declare const DEFAULT_S3_DOWNLOAD_TTL_SECONDS = 300;
254
+ declare const MAX_S3_PRESIGN_TTL_SECONDS = 604800;
255
+ type S3AttachmentConfig = {
256
+ endpoint: string;
257
+ region: string;
258
+ bucket: string;
259
+ accessKeyId: string;
260
+ secretAccessKey: string;
261
+ prefix: string;
262
+ forcePathStyle: boolean;
263
+ uploadTtlSeconds: number;
264
+ downloadTtlSeconds: number;
265
+ };
266
+ type AttachmentStorageConfig = {
267
+ kind: "filesystem";
268
+ } | {
269
+ kind: "s3";
270
+ s3: S3AttachmentConfig;
271
+ };
272
+ type Environment = Readonly<Record<string, string | undefined>>;
273
+ declare function normalizeS3AttachmentPrefix(prefix: string): string;
274
+ declare function parseAttachmentStorageConfig(env?: Environment): AttachmentStorageConfig;
275
+ //#endregion
276
+ //#region src/storage/s3/keying.d.ts
277
+ declare function deriveS3AttachmentKey(hash: string, prefix: string): string;
278
+ declare function sha256HexToBase64(hash: string): string;
279
+ //#endregion
280
+ //#region src/storage/s3/primitives.d.ts
281
+ interface S3CommandClient {
282
+ send(command: object): Promise<unknown>;
283
+ }
284
+ type S3Presigner = (client: object, command: object, expiresInSeconds: number) => Promise<string>;
285
+ type Dependencies = {
286
+ client?: S3CommandClient;
287
+ presign?: S3Presigner;
288
+ now?: () => Date;
289
+ };
290
+ declare class S3AttachmentPrimitives {
291
+ readonly config: S3AttachmentConfig;
292
+ readonly client: S3CommandClient;
293
+ readonly presign: S3Presigner;
294
+ readonly now: () => Date;
295
+ constructor(config: S3AttachmentConfig, dependencies?: Dependencies);
296
+ buildHeadObjectCommand(hash: string): object;
297
+ buildPutObjectCommand(hash: string, mimeType: string): object;
298
+ buildGetObjectCommand(hash: string): object;
299
+ headObject(hash: string): Promise<unknown>;
300
+ createUploadTarget(hash: string, mimeType: string, ttlSeconds?: number): Promise<AttachmentUploadTarget>;
301
+ createDownloadTarget(hash: string, ttlSeconds?: number): Promise<AttachmentDownloadTarget>;
302
+ }
303
+ declare function createS3AttachmentPrimitives(config: S3AttachmentConfig, dependencies?: Dependencies): S3AttachmentPrimitives;
304
+ //#endregion
305
+ //#region src/storage/s3/backend.d.ts
306
+ type S3AttachmentBackendDependencies = {
307
+ client?: S3CommandClient;
308
+ presign?: S3Presigner;
309
+ now?: () => Date;
310
+ uploadTtlSeconds?: number;
311
+ downloadTtlSeconds?: number;
312
+ };
313
+ /** Server-only S3 capability. Callers complete authorization before download. */
314
+ declare class S3AttachmentBackend implements IAttachmentBackend {
315
+ private readonly db;
316
+ readonly config: S3AttachmentConfig;
317
+ readonly kind: "s3";
318
+ private readonly primitives;
319
+ private readonly now;
320
+ private readonly uploadTtlSeconds;
321
+ private readonly downloadTtlSeconds;
322
+ constructor(db: Kysely<AttachmentDatabase>, config: S3AttachmentConfig, dependencies?: S3AttachmentBackendDependencies);
323
+ prepareUploadTarget(reservation: Reservation): Promise<AttachmentUploadTarget>;
324
+ prepareDownloadTarget(hash: AttachmentHash, ttlSeconds?: number): Promise<AttachmentDownloadTarget>;
325
+ exists(hash: AttachmentHash): Promise<boolean>;
326
+ health(): Promise<AttachmentBackendHealth>;
327
+ }
328
+ declare function createS3AttachmentBackend(db: Kysely<AttachmentDatabase>, config: S3AttachmentConfig, dependencies?: S3AttachmentBackendDependencies): S3AttachmentBackend;
329
+ //#endregion
330
+ //#region src/storage/s3/upload-factory.d.ts
331
+ declare class S3AttachmentUploadFactory implements IAttachmentUploadFactory {
332
+ createUpload(reservation: Reservation): IAttachmentUpload;
333
+ }
334
+ //#endregion
335
+ export { ATTACHMENT_REFERENCE_MIGRATION_LOCK_TABLE, ATTACHMENT_REFERENCE_MIGRATION_TABLE, ATTACHMENT_REFERENCE_READ_MODEL_ID, ATTACHMENT_REFERENCE_SCHEMA, ATTACHMENT_SCHEMA, AttachmentAlreadyExists, type AttachmentBackendHealth, type AttachmentBackendKind, type AttachmentBuildResult, AttachmentBuilder, type AttachmentDatabase, type AttachmentDownloadOptions, type AttachmentDownloadTarget, type AttachmentHeader, type AttachmentMetadata, AttachmentNotFound, AttachmentPending, type AttachmentReferenceIndexBuildResult, AttachmentReferenceIndexBuilder, type AttachmentReferenceInput, type AttachmentReferenceMigrationResult, AttachmentReferenceReadModel, type AttachmentResponse, AttachmentSchemaCompiler, type AttachmentSendOptions, AttachmentService, type AttachmentStatus, type AttachmentStorageConfig, type AttachmentTargetHeaders, AttachmentTransferError, type AttachmentTransferStage, type AttachmentTransportConfig, type AttachmentUploadRequest, type AttachmentUploadResponse, type AttachmentUploadResult, type AttachmentUploadTarget, type AttachmentUploadTransport, type CompiledAttachmentExtractor, DEFAULT_RESERVATION_TTL_MS, DEFAULT_S3_ATTACHMENT_PREFIX, DEFAULT_S3_DOWNLOAD_TTL_SECONDS, DEFAULT_S3_UPLOAD_TTL_SECONDS, DirectAttachmentUpload, DirectAttachmentUploadFactory, FilesystemAttachmentBackend, type FilesystemAttachmentBackendConfig, type HashFirstReserveAttachmentOptions, HashMismatch, type IAttachmentBackend, type IAttachmentReader, type IAttachmentReferenceReader, type IAttachmentReferenceWriter, type IAttachmentSchemaCompiler, type IAttachmentService, type IAttachmentStore, type IAttachmentTransport, type IAttachmentTransportFactory, type IAttachmentUpload, type IAttachmentUploadFactory, type IReservationStore, InvalidAttachmentRef, KyselyAttachmentReferenceStore, KyselyAttachmentStore, KyselyReservationStore, MAX_S3_PRESIGN_TTL_SECONDS, NullAttachmentTransport, type ParsedRef, RemoteAttachmentStore, RemoteAttachmentUpload, RemoteAttachmentUploadFactory, RemoteReservationStore, type Reservation, ReservationNotFound, type ReserveAttachmentOptions, S3AttachmentBackend, type S3AttachmentBackendDependencies, type S3AttachmentConfig, S3AttachmentPrimitives, S3AttachmentUploadFactory, type S3CommandClient, type S3Presigner, SizeMismatch, SwitchboardAttachmentTransport, type SwitchboardClientConfig, type SwitchboardTransportConfig, type TransportFetchResult, type TransportResponse, type UploadFirstReserveAttachmentOptions, UploadTooLarge, type XhrUploadTransportOptions, createFetchUploadTransport, createRef, createRemoteAttachmentService, createS3AttachmentBackend, createS3AttachmentPrimitives, createXhrUploadTransport, deriveS3AttachmentKey, getAttachmentReferenceMigrationStatus, normalizeS3AttachmentPrefix, parseAttachmentDownloadTarget, parseAttachmentStorageConfig, parseAttachmentUploadTarget, parseRef, rollbackAttachmentReferenceMigration, runAttachmentMigrations, runAttachmentReferenceMigrations, sha256HexToBase64 };
130
336
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/storage/kysely/types.ts","../src/storage/kysely/attachment-store.ts","../src/storage/kysely/reservation-store.ts","../src/storage/migrations/migrator.ts","../src/direct/direct-attachment-upload.ts","../src/direct/direct-attachment-upload-factory.ts","../src/attachment-builder.ts"],"mappings":";;;;;UAEiB,eAAA;EACf,IAAA;EACA,SAAA;EACA,SAAA;EACA,UAAA;EACA,SAAA;EACA,MAAA;EACA,YAAA;EACA,MAAA;EACA,cAAA;EACA,oBAAA;AAAA;AAAA,UAGe,0BAAA;EACf,cAAA;EACA,SAAA;EACA,SAAA;EACA,SAAA;EACA,cAAA;EACA,cAAA;EACA,cAAA;EACA,WAAA;EACA,UAAA;AAAA;AAAA,UAGe,kBAAA;EACf,UAAA,EAAY,eAAA;EACZ,sBAAA,EAAwB,0BAAA;AAAA;;;cC4Cb,qBAAA,YAAiC,gBAAA;EAAA,iBAIzB,EAAA;EAAA,iBACA,SAAA;EAAA,iBACA,QAAA;EAAA,iBALF,aAAA;cAGE,EAAA,EAAI,MAAA,CAAO,kBAAA,GACX,SAAA,EAAW,oBAAA,EACX,QAAA;EAGb,IAAA,CAAK,IAAA,EAAM,cAAA,GAAiB,OAAA,CAAQ,gBAAA;EAgCpC,GAAA,CAAI,IAAA,EAAM,cAAA,GAAiB,OAAA;EAU3B,GAAA,CACJ,IAAA,EAAM,cAAA,EACN,MAAA,GAAS,WAAA,GACR,OAAA,CAAQ,kBAAA;EA+DL,GAAA,CACJ,IAAA,EAAM,cAAA,EACN,QAAA,EAAU,kBAAA,EACV,IAAA,EAAM,cAAA,CAAe,UAAA,IACpB,OAAA;EAiDG,KAAA,CAAM,IAAA,EAAM,cAAA,GAAiB,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WAAA,GAAc,iBAAA;AAAA;;;KCF9B,qBAAA;EACV,OAAA,EAAS,iBAAA;EACT,KAAA,EAAO,qBAAA;EACP,YAAA,EAAc,sBAAA;EACd,aAAA,EAAe,wBAAA,ENhBf;EMkBA,OAAA;AAAA;AAAA,cAGW,iBAAA;EAAA,iBAOQ,EAAA;EAAA,iBACA,WAAA;EAAA,QAPX,SAAA;EAAA,QACA,mBAAA;EAAA,QACA,cAAA;EAAA,QACA,kBAAA;cAGW,EAAA,EAAI,MAAA,OACJ,WAAA;EAGnB,aAAA,CAAc,SAAA,EAAW,oBAAA;EAKzB,iBAAA,CAAkB,OAAA,EAAS,wBAAA;EAK3B,kBAAA,CAAmB,QAAA;EN/BsB;;;;;;;;EM4CzC,sBAAA,CAAuB,UAAA;EAKjB,KAAA,CAAA,GAAS,OAAA,CAAQ,qBAAA;AAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/storage/kysely/types.ts","../src/storage/kysely/attachment-store.ts","../src/storage/kysely/reservation-store.ts","../src/storage/migrations/migrator.ts","../src/direct/direct-attachment-upload.ts","../src/direct/direct-attachment-upload-factory.ts","../src/direct/filesystem-attachment-backend.ts","../src/attachment-builder.ts","../src/reference-index/types.ts","../src/reference-index/attachment-schema-compiler.ts","../src/read-models/attachment-reference/types.ts","../src/read-models/attachment-reference/index-builder.ts","../src/read-models/attachment-reference/attachment-reference-read-model.ts","../src/read-models/attachment-reference/storage/types.ts","../src/read-models/attachment-reference/kysely-attachment-reference-store.ts","../src/read-models/attachment-reference/storage/migrations/migrator.ts","../src/storage/s3/config.ts","../src/storage/s3/keying.ts","../src/storage/s3/primitives.ts","../src/storage/s3/backend.ts","../src/storage/s3/upload-factory.ts"],"mappings":";;;;;;;UAEiB,eAAA;EACf,IAAA;EACA,SAAA;EACA,SAAA;EACA,UAAA;EACA,SAAA;EACA,MAAA;EACA,YAAA;EACA,MAAA;EACA,cAAA;EACA,oBAAA;AAAA;AAAA,UAGe,0BAAA;EACf,c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