@powerhousedao/reactor-attachments 6.2.3-dev.3 → 6.2.3-dev.30
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/client.d.ts +51 -36
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +20 -4
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +92 -42
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +151 -50
- package/dist/index.js.map +1 -1
- package/dist/{null-attachment-transport-CMrO_ZKA.d.ts → null-attachment-transport-BkM6rq4R.d.ts} +30 -18
- package/dist/null-attachment-transport-BkM6rq4R.d.ts.map +1 -0
- package/dist/{null-attachment-transport-CrsUafCi.js → null-attachment-transport-D53Rz9lE.js} +20 -13
- package/dist/null-attachment-transport-D53Rz9lE.js.map +1 -0
- package/package.json +6 -6
- package/dist/null-attachment-transport-CMrO_ZKA.d.ts.map +0 -1
- package/dist/null-attachment-transport-CrsUafCi.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
import
|
|
3
|
-
import { Kysely } from "kysely";
|
|
1
|
+
import { $ as AttachmentNotFound, A as IReservationStore, B as AttachmentStatOptions, C as IAttachmentReader, D as IAttachmentTransportFactory, E as IAttachmentTransport, G as AttachmentUploadTarget, H as AttachmentTargetHeaders, I as AttachmentHeader, J as ReserveAttachmentOptions, K as HashFirstReserveAttachmentOptions, L as AttachmentMetadata, M as AttachmentBackendKind, N as AttachmentDownloadOptions, O as IAttachmentUpload, P as AttachmentDownloadTarget, Q as AttachmentAlreadyExists, R as AttachmentResponse, S as IAttachmentBackend, T as IAttachmentStore, U as AttachmentTransportConfig, V as AttachmentStatus, W as AttachmentUploadResult, X as TransportResponse, Y as TransportFetchResult, Z as UploadFirstReserveAttachmentOptions, _ as createRef, a as RemoteAttachmentUpload, at as ReservationNotFound, b as parseAttachmentDownloadTarget, c as XhrUploadTransportOptions, d as AttachmentUploadResponse, et as AttachmentPending, f as AttachmentUploadTransport, g as ParsedRef, h as SwitchboardTransportConfig, i as RemoteAttachmentUploadFactory, it as InvalidAttachmentRef, j as AttachmentBackendHealth, k as IAttachmentUploadFactory, l as createXhrUploadTransport, m as SwitchboardAttachmentTransport, n as createRemoteAttachmentService, nt as AttachmentTransferStage, o as RemoteReservationStore, ot as SizeMismatch, p as createFetchUploadTransport, q as Reservation, r as RemoteAttachmentStore, rt as HashMismatch, s as SwitchboardClientConfig, st as UploadTooLarge, t as NullAttachmentTransport, tt as AttachmentTransferError, u as AttachmentUploadRequest, v as parseRef, w as IAttachmentService, x as parseAttachmentUploadTarget, y as AttachmentService, z as AttachmentSendOptions } from "./null-attachment-transport-BkM6rq4R.js";
|
|
2
|
+
import { Kysely, Transaction } from "kysely";
|
|
4
3
|
import { AttachmentHash, AttachmentRef, BaseReadModel, DocumentViewDatabase, IConsistencyTracker, IDocumentModelRegistry, IOperationIndex, IWriteCache } from "@powerhousedao/reactor";
|
|
5
4
|
import { Action, DocumentModelModule, OperationWithContext } from "@powerhousedao/shared/document-model";
|
|
6
|
-
|
|
7
5
|
//#region src/storage/kysely/types.d.ts
|
|
8
6
|
interface AttachmentTable {
|
|
9
7
|
hash: string;
|
|
@@ -34,7 +32,7 @@ interface AttachmentDatabase {
|
|
|
34
32
|
}
|
|
35
33
|
//#endregion
|
|
36
34
|
//#region src/storage/kysely/attachment-store.d.ts
|
|
37
|
-
declare class KyselyAttachmentStore implements IAttachmentStore {
|
|
35
|
+
export declare class KyselyAttachmentStore implements IAttachmentStore {
|
|
38
36
|
private readonly db;
|
|
39
37
|
private readonly transport;
|
|
40
38
|
private readonly basePath;
|
|
@@ -42,10 +40,11 @@ declare class KyselyAttachmentStore implements IAttachmentStore {
|
|
|
42
40
|
constructor(db: Kysely<AttachmentDatabase>, transport: IAttachmentTransport, basePath: string);
|
|
43
41
|
stat(hash: AttachmentHash): Promise<AttachmentHeader>;
|
|
44
42
|
has(hash: AttachmentHash): Promise<boolean>;
|
|
45
|
-
get(hash: AttachmentHash, signal?: AbortSignal): Promise<AttachmentResponse>;
|
|
43
|
+
get(hash: AttachmentHash, signal?: AbortSignal, documentId?: string): Promise<AttachmentResponse>;
|
|
46
44
|
put(hash: AttachmentHash, metadata: AttachmentMetadata, data: ReadableStream<Uint8Array>): Promise<void>;
|
|
47
45
|
evict(hash: AttachmentHash): Promise<void>;
|
|
48
46
|
storageUsed(): Promise<number>;
|
|
47
|
+
private fetchRemote;
|
|
49
48
|
private findPendingReservation;
|
|
50
49
|
private acquireReader;
|
|
51
50
|
private releaseReader;
|
|
@@ -53,8 +52,8 @@ declare class KyselyAttachmentStore implements IAttachmentStore {
|
|
|
53
52
|
}
|
|
54
53
|
//#endregion
|
|
55
54
|
//#region src/storage/kysely/reservation-store.d.ts
|
|
56
|
-
declare const DEFAULT_RESERVATION_TTL_MS: number;
|
|
57
|
-
declare class KyselyReservationStore implements IReservationStore {
|
|
55
|
+
export declare const DEFAULT_RESERVATION_TTL_MS: number;
|
|
56
|
+
export declare class KyselyReservationStore implements IReservationStore {
|
|
58
57
|
private readonly db;
|
|
59
58
|
private readonly ttlMs;
|
|
60
59
|
constructor(db: Kysely<AttachmentDatabase>, ttlMs?: number);
|
|
@@ -65,16 +64,16 @@ declare class KyselyReservationStore implements IReservationStore {
|
|
|
65
64
|
}
|
|
66
65
|
//#endregion
|
|
67
66
|
//#region src/storage/migrations/migrator.d.ts
|
|
68
|
-
declare const ATTACHMENT_SCHEMA = "attachments";
|
|
67
|
+
export declare const ATTACHMENT_SCHEMA = "attachments";
|
|
69
68
|
interface MigrationResult {
|
|
70
69
|
success: boolean;
|
|
71
70
|
migrationsExecuted: string[];
|
|
72
71
|
error?: Error;
|
|
73
72
|
}
|
|
74
|
-
declare function runAttachmentMigrations(db: Kysely<any>, schema?: string): Promise<MigrationResult>;
|
|
73
|
+
export declare function runAttachmentMigrations(db: Kysely<any>, schema?: string): Promise<MigrationResult>;
|
|
75
74
|
//#endregion
|
|
76
75
|
//#region src/direct/direct-attachment-upload.d.ts
|
|
77
|
-
declare class DirectAttachmentUpload implements IAttachmentUpload {
|
|
76
|
+
export declare class DirectAttachmentUpload implements IAttachmentUpload {
|
|
78
77
|
private readonly reservation;
|
|
79
78
|
private readonly db;
|
|
80
79
|
private readonly basePath;
|
|
@@ -88,7 +87,7 @@ declare class DirectAttachmentUpload implements IAttachmentUpload {
|
|
|
88
87
|
}
|
|
89
88
|
//#endregion
|
|
90
89
|
//#region src/direct/direct-attachment-upload-factory.d.ts
|
|
91
|
-
declare class DirectAttachmentUploadFactory implements IAttachmentUploadFactory {
|
|
90
|
+
export declare class DirectAttachmentUploadFactory implements IAttachmentUploadFactory {
|
|
92
91
|
private readonly db;
|
|
93
92
|
private readonly basePath;
|
|
94
93
|
private readonly reservations;
|
|
@@ -108,7 +107,7 @@ type FilesystemAttachmentBackendConfig = {
|
|
|
108
107
|
* at the server edge, while this adapter validates that a filesystem backend
|
|
109
108
|
* can never accidentally return a direct-provider target.
|
|
110
109
|
*/
|
|
111
|
-
declare class FilesystemAttachmentBackend implements IAttachmentBackend {
|
|
110
|
+
export declare class FilesystemAttachmentBackend implements IAttachmentBackend {
|
|
112
111
|
private readonly store;
|
|
113
112
|
private readonly config;
|
|
114
113
|
readonly kind: "filesystem";
|
|
@@ -124,11 +123,13 @@ type AttachmentBuildResult = {
|
|
|
124
123
|
service: AttachmentService;
|
|
125
124
|
store: KyselyAttachmentStore;
|
|
126
125
|
reservations: KyselyReservationStore;
|
|
127
|
-
uploadFactory: IAttachmentUploadFactory;
|
|
128
|
-
|
|
126
|
+
uploadFactory: IAttachmentUploadFactory;
|
|
127
|
+
/** Selected direct-transfer backend, when startup configured one. */
|
|
128
|
+
backend?: IAttachmentBackend;
|
|
129
|
+
/** Stops the reservation sweep timer, if one was configured via withReservationSweepMs(). */
|
|
129
130
|
destroy: () => void;
|
|
130
131
|
};
|
|
131
|
-
declare class AttachmentBuilder {
|
|
132
|
+
export declare class AttachmentBuilder {
|
|
132
133
|
private readonly db;
|
|
133
134
|
private readonly storagePath;
|
|
134
135
|
private transport;
|
|
@@ -162,7 +163,7 @@ interface IAttachmentSchemaCompiler {
|
|
|
162
163
|
}
|
|
163
164
|
//#endregion
|
|
164
165
|
//#region src/reference-index/attachment-schema-compiler.d.ts
|
|
165
|
-
declare class AttachmentSchemaCompiler implements IAttachmentSchemaCompiler {
|
|
166
|
+
export declare class AttachmentSchemaCompiler implements IAttachmentSchemaCompiler {
|
|
166
167
|
private readonly cache;
|
|
167
168
|
forModuleAction(module: DocumentModelModule, actionType: string): CompiledAttachmentExtractor;
|
|
168
169
|
}
|
|
@@ -178,6 +179,8 @@ interface AttachmentReferenceInput {
|
|
|
178
179
|
}
|
|
179
180
|
interface IAttachmentReferenceReader {
|
|
180
181
|
hasReference(documentId: string, ref: AttachmentRef): Promise<boolean>;
|
|
182
|
+
/** The scopes whose operations reference the attachment; empty when none. */
|
|
183
|
+
referencingScopes(documentId: string, ref: AttachmentRef): Promise<string[]>;
|
|
181
184
|
}
|
|
182
185
|
interface IAttachmentReferenceWriter {
|
|
183
186
|
addReferences(references: readonly AttachmentReferenceInput[]): Promise<void>;
|
|
@@ -187,26 +190,71 @@ interface IAttachmentReferenceWriter {
|
|
|
187
190
|
type AttachmentReferenceIndexBuildResult = {
|
|
188
191
|
store: IAttachmentReferenceReader & IAttachmentReferenceWriter;
|
|
189
192
|
};
|
|
190
|
-
declare class AttachmentReferenceIndexBuilder {
|
|
193
|
+
export declare class AttachmentReferenceIndexBuilder {
|
|
191
194
|
private readonly db;
|
|
192
195
|
constructor(db: Kysely<unknown>);
|
|
193
196
|
build(): Promise<AttachmentReferenceIndexBuildResult>;
|
|
194
197
|
}
|
|
195
198
|
//#endregion
|
|
196
199
|
//#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
|
-
|
|
200
|
+
export declare const ATTACHMENT_REFERENCE_READ_MODEL_ID = "attachment-reference-read-model";
|
|
201
|
+
/**
|
|
202
|
+
* Indexes attachment references in chunks.
|
|
203
|
+
*
|
|
204
|
+
* Each reference row stands on its own and is written insert-or-do-nothing, so
|
|
205
|
+
* a batch that commits in pieces exposes no partial structure: a reader either
|
|
206
|
+
* sees a reference or does not, and re-indexing the same range writes nothing
|
|
207
|
+
* new. Batches here are the largest in the system, which is what chunking is
|
|
208
|
+
* for.
|
|
209
|
+
*/
|
|
210
|
+
export declare class AttachmentReferenceReadModel extends BaseReadModel {
|
|
199
211
|
private readonly documentModelRegistry;
|
|
200
212
|
private readonly schemaCompiler;
|
|
201
213
|
private readonly referenceWriter;
|
|
202
214
|
private indexingQueue;
|
|
215
|
+
private checkpointTarget;
|
|
216
|
+
/**
|
|
217
|
+
* How far a replay may skip ahead of the cursor: the highest ordinal already
|
|
218
|
+
* pulled from the index while the cursor was parked.
|
|
219
|
+
*
|
|
220
|
+
* NOT a claim that every ordinal below it committed -- the parked ordinal is
|
|
221
|
+
* precisely the one that did not -- so it is a hint, and {@link replayFrom}
|
|
222
|
+
* re-probes the gap before honouring it.
|
|
223
|
+
*/
|
|
224
|
+
private replayedThrough;
|
|
225
|
+
private warnedCheckpoint;
|
|
203
226
|
constructor(db: Kysely<DocumentViewDatabase>, operationIndex: IOperationIndex, writeCache: IWriteCache, consistencyTracker: IConsistencyTracker, documentModelRegistry: IDocumentModelRegistry, schemaCompiler: IAttachmentSchemaCompiler, referenceWriter: IAttachmentReferenceWriter);
|
|
204
227
|
indexOperations(items: OperationWithContext[]): Promise<void>;
|
|
205
228
|
init(): Promise<void>;
|
|
206
229
|
private enqueue;
|
|
207
230
|
protected commitOperations(items: OperationWithContext[]): Promise<void>;
|
|
208
231
|
private indexOperationsInOrdinalOrder;
|
|
209
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Writes the cursor parked by indexOperationsInOrdinalOrder instead of the
|
|
234
|
+
* batch maximum, so indexing an operation above a gap never advances past it.
|
|
235
|
+
*/
|
|
236
|
+
protected saveState(trx: Transaction<DocumentViewDatabase>, items: OperationWithContext[]): Promise<void>;
|
|
237
|
+
/** Last ordinal of the contiguous run starting at lastOrdinal + 1. */
|
|
238
|
+
private contiguousEnd;
|
|
239
|
+
/**
|
|
240
|
+
* Opens a replay at the lowest ordinal still worth reading.
|
|
241
|
+
*
|
|
242
|
+
* {@link replayedThrough} is what keeps a permanently held hole -- a
|
|
243
|
+
* rolled-back insert, which never fills -- from re-reading the whole tail on
|
|
244
|
+
* every batch. It cannot be trusted on its own: a hole that fills without
|
|
245
|
+
* being delivered here is visible only in the index, and a mark that is
|
|
246
|
+
* never questioned would hide that operation for the life of the process.
|
|
247
|
+
* That happens whenever another writer commits the gap (a second reactor on
|
|
248
|
+
* the same database), and it leaves the cursor parked below an operation
|
|
249
|
+
* whose references were never written -- `hasReference` then answers false
|
|
250
|
+
* for an attachment that is genuinely referenced.
|
|
251
|
+
*
|
|
252
|
+
* So a parked batch spends one page probing the gap: the first row above the
|
|
253
|
+
* cursor is the missing ordinal itself once it commits. Finding it drops the
|
|
254
|
+
* mark and replays from the cursor; not finding it leaves the mark standing,
|
|
255
|
+
* which is the cheap path and the common one.
|
|
256
|
+
*/
|
|
257
|
+
private replayFrom;
|
|
210
258
|
private loadThroughOrdinal;
|
|
211
259
|
private sortAndDedupe;
|
|
212
260
|
}
|
|
@@ -227,31 +275,32 @@ interface AttachmentReferenceDatabase {
|
|
|
227
275
|
}
|
|
228
276
|
//#endregion
|
|
229
277
|
//#region src/read-models/attachment-reference/kysely-attachment-reference-store.d.ts
|
|
230
|
-
declare class KyselyAttachmentReferenceStore implements IAttachmentReferenceReader, IAttachmentReferenceWriter {
|
|
278
|
+
export declare class KyselyAttachmentReferenceStore implements IAttachmentReferenceReader, IAttachmentReferenceWriter {
|
|
231
279
|
private readonly db;
|
|
232
280
|
constructor(db: Kysely<AttachmentReferenceDatabase>);
|
|
233
281
|
hasReference(documentId: string, ref: AttachmentRef): Promise<boolean>;
|
|
282
|
+
referencingScopes(documentId: string, ref: AttachmentRef): Promise<string[]>;
|
|
234
283
|
addReferences(references: readonly AttachmentReferenceInput[]): Promise<void>;
|
|
235
284
|
}
|
|
236
285
|
//#endregion
|
|
237
286
|
//#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";
|
|
287
|
+
export declare const ATTACHMENT_REFERENCE_SCHEMA = "attachment_reference_read_model";
|
|
288
|
+
export declare const ATTACHMENT_REFERENCE_MIGRATION_TABLE = "kysely_migration_attachment_reference_read_model";
|
|
289
|
+
export declare const ATTACHMENT_REFERENCE_MIGRATION_LOCK_TABLE = "kysely_migration_attachment_reference_read_model_lock";
|
|
241
290
|
interface AttachmentReferenceMigrationResult {
|
|
242
291
|
success: boolean;
|
|
243
292
|
migrationsExecuted: string[];
|
|
244
293
|
error?: Error;
|
|
245
294
|
}
|
|
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[]>;
|
|
295
|
+
export declare function runAttachmentReferenceMigrations(db: Kysely<unknown>, schema?: string): Promise<AttachmentReferenceMigrationResult>;
|
|
296
|
+
export declare function rollbackAttachmentReferenceMigration(db: Kysely<unknown>, schema?: string): Promise<AttachmentReferenceMigrationResult>;
|
|
297
|
+
export declare function getAttachmentReferenceMigrationStatus(db: Kysely<unknown>, schema?: string): Promise<readonly import("kysely").MigrationInfo[]>;
|
|
249
298
|
//#endregion
|
|
250
299
|
//#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;
|
|
300
|
+
export declare const DEFAULT_S3_ATTACHMENT_PREFIX = "attachments";
|
|
301
|
+
export declare const DEFAULT_S3_UPLOAD_TTL_SECONDS = 900;
|
|
302
|
+
export declare const DEFAULT_S3_DOWNLOAD_TTL_SECONDS = 300;
|
|
303
|
+
export declare const MAX_S3_PRESIGN_TTL_SECONDS = 604800;
|
|
255
304
|
type S3AttachmentConfig = {
|
|
256
305
|
endpoint: string;
|
|
257
306
|
region: string;
|
|
@@ -270,12 +319,12 @@ type AttachmentStorageConfig = {
|
|
|
270
319
|
s3: S3AttachmentConfig;
|
|
271
320
|
};
|
|
272
321
|
type Environment = Readonly<Record<string, string | undefined>>;
|
|
273
|
-
declare function normalizeS3AttachmentPrefix(prefix: string): string;
|
|
274
|
-
declare function parseAttachmentStorageConfig(env?: Environment): AttachmentStorageConfig;
|
|
322
|
+
export declare function normalizeS3AttachmentPrefix(prefix: string): string;
|
|
323
|
+
export declare function parseAttachmentStorageConfig(env?: Environment): AttachmentStorageConfig;
|
|
275
324
|
//#endregion
|
|
276
325
|
//#region src/storage/s3/keying.d.ts
|
|
277
|
-
declare function deriveS3AttachmentKey(hash: string, prefix: string): string;
|
|
278
|
-
declare function sha256HexToBase64(hash: string): string;
|
|
326
|
+
export declare function deriveS3AttachmentKey(hash: string, prefix: string): string;
|
|
327
|
+
export declare function sha256HexToBase64(hash: string): string;
|
|
279
328
|
//#endregion
|
|
280
329
|
//#region src/storage/s3/primitives.d.ts
|
|
281
330
|
interface S3CommandClient {
|
|
@@ -287,7 +336,7 @@ type Dependencies = {
|
|
|
287
336
|
presign?: S3Presigner;
|
|
288
337
|
now?: () => Date;
|
|
289
338
|
};
|
|
290
|
-
declare class S3AttachmentPrimitives {
|
|
339
|
+
export declare class S3AttachmentPrimitives {
|
|
291
340
|
readonly config: S3AttachmentConfig;
|
|
292
341
|
readonly client: S3CommandClient;
|
|
293
342
|
readonly presign: S3Presigner;
|
|
@@ -300,7 +349,7 @@ declare class S3AttachmentPrimitives {
|
|
|
300
349
|
createUploadTarget(hash: string, mimeType: string, ttlSeconds?: number): Promise<AttachmentUploadTarget>;
|
|
301
350
|
createDownloadTarget(hash: string, ttlSeconds?: number): Promise<AttachmentDownloadTarget>;
|
|
302
351
|
}
|
|
303
|
-
declare function createS3AttachmentPrimitives(config: S3AttachmentConfig, dependencies?: Dependencies): S3AttachmentPrimitives;
|
|
352
|
+
export declare function createS3AttachmentPrimitives(config: S3AttachmentConfig, dependencies?: Dependencies): S3AttachmentPrimitives;
|
|
304
353
|
//#endregion
|
|
305
354
|
//#region src/storage/s3/backend.d.ts
|
|
306
355
|
type S3AttachmentBackendDependencies = {
|
|
@@ -311,7 +360,7 @@ type S3AttachmentBackendDependencies = {
|
|
|
311
360
|
downloadTtlSeconds?: number;
|
|
312
361
|
};
|
|
313
362
|
/** Server-only S3 capability. Callers complete authorization before download. */
|
|
314
|
-
declare class S3AttachmentBackend implements IAttachmentBackend {
|
|
363
|
+
export declare class S3AttachmentBackend implements IAttachmentBackend {
|
|
315
364
|
private readonly db;
|
|
316
365
|
readonly config: S3AttachmentConfig;
|
|
317
366
|
readonly kind: "s3";
|
|
@@ -325,12 +374,13 @@ declare class S3AttachmentBackend implements IAttachmentBackend {
|
|
|
325
374
|
exists(hash: AttachmentHash): Promise<boolean>;
|
|
326
375
|
health(): Promise<AttachmentBackendHealth>;
|
|
327
376
|
}
|
|
328
|
-
declare function createS3AttachmentBackend(db: Kysely<AttachmentDatabase>, config: S3AttachmentConfig, dependencies?: S3AttachmentBackendDependencies): S3AttachmentBackend;
|
|
377
|
+
export declare function createS3AttachmentBackend(db: Kysely<AttachmentDatabase>, config: S3AttachmentConfig, dependencies?: S3AttachmentBackendDependencies): S3AttachmentBackend;
|
|
329
378
|
//#endregion
|
|
330
379
|
//#region src/storage/s3/upload-factory.d.ts
|
|
331
|
-
declare class S3AttachmentUploadFactory implements IAttachmentUploadFactory {
|
|
380
|
+
export declare class S3AttachmentUploadFactory implements IAttachmentUploadFactory {
|
|
332
381
|
createUpload(reservation: Reservation): IAttachmentUpload;
|
|
333
382
|
}
|
|
334
383
|
//#endregion
|
|
335
|
-
export {
|
|
384
|
+
export { AttachmentAlreadyExists, type AttachmentBackendHealth, type AttachmentBackendKind, type AttachmentBuildResult, type AttachmentDatabase, type AttachmentDownloadOptions, type AttachmentDownloadTarget, type AttachmentHeader, type AttachmentMetadata, AttachmentNotFound, AttachmentPending, type AttachmentReferenceIndexBuildResult, type AttachmentReferenceInput, type AttachmentReferenceMigrationResult, type AttachmentResponse, type AttachmentSendOptions, AttachmentService, type AttachmentStatOptions, type AttachmentStatus, type AttachmentStorageConfig, type AttachmentTargetHeaders, AttachmentTransferError, type AttachmentTransferStage, type AttachmentTransportConfig, type AttachmentUploadRequest, type AttachmentUploadResponse, type AttachmentUploadResult, type AttachmentUploadTarget, type AttachmentUploadTransport, type CompiledAttachmentExtractor, 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, NullAttachmentTransport, type ParsedRef, RemoteAttachmentStore, RemoteAttachmentUpload, RemoteAttachmentUploadFactory, RemoteReservationStore, type Reservation, ReservationNotFound, type ReserveAttachmentOptions, type S3AttachmentBackendDependencies, type S3AttachmentConfig, type S3CommandClient, type S3Presigner, SizeMismatch, SwitchboardAttachmentTransport, type SwitchboardClientConfig, type SwitchboardTransportConfig, type TransportFetchResult, type TransportResponse, type UploadFirstReserveAttachmentOptions, UploadTooLarge, type XhrUploadTransportOptions, createFetchUploadTransport, createRef, createRemoteAttachmentService, createXhrUploadTransport, parseAttachmentDownloadTarget, parseAttachmentUploadTarget, parseRef };
|
|
385
|
+
export {};
|
|
336
386
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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/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":"
|
|
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;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,YAAY;EACZ,wBAAwB;;;;qBC4Cb,iCAAiC;mBAIzB;mBACA;mBACA;mBALF;EAEjB,YACmB,IAAI,OAAO,qBACX,WAAW,sBACX;EAGb,KAAK,MAAM,iBAAiB,QAAQ;EAgCpC,IAAI,MAAM,iBAAiB;EAU3B,IACJ,MAAM,gBACN,SAAS,aACT,sBACC,QAAQ;EA+CL,IACJ,MAAM,gBACN,UAAU,oBACV,MAAM,eAAe,cACpB;EAiDG,MAAM,MAAM,iBAAiB;EAyB7B,eAAe;UAYP;UAmBA;UAyCN;UAIA;UASA;;;;qBC3UG;qBAeA,kCAAkC;mBAI1B;mBAHF;EAEjB,YACmB,IAAI,OAAO,qBAC5B;EAKI,OAAO,SAAS,2BAA2B,QAAQ;EAwBnD,IAAI,wBAAwB,QAAQ;EAepC,OAAO,wBAAwB;EAS/B,cAAc,MAAK,OAAoB;;;;qBCtElC;UAEI;EACf;EACA;EACA,QAAQ;;wBAkBY,wBACpB,IAAI,aACJ,kBACC,QAAQ;;;qBCEE,kCAAkC;mBAM1B;mBACA;mBACA;mBACA;mBACA;WATV;WACA,KAAK;WACL;EAET,YACmB,aAAa,aACb,IAAI,OAAO,qBACX,kBACA,cAAc,mBACd;EAQb,KACJ,MAAM,eAAe,aACrB,UAAU,wBACT,QAAQ;;;;qBCjDA,yCAAyC;mBAEjC;mBACA;mBACA;mBACA;EAJnB,YACmB,IAAI,OAAO,qBACX,kBACA,cAAc,mBACd;EAGnB,aAAa,aAAa,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