graphile-presigned-url-plugin 1.16.1 → 1.18.0

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/types.d.ts CHANGED
@@ -12,10 +12,9 @@ export interface BucketConfig {
12
12
  max_file_size: number | null;
13
13
  allow_custom_keys: boolean;
14
14
  /**
15
- * The physical S3/MinIO bucket name recorded when the physical bucket was
16
- * first provisioned. NULL until the first upload provisions it. Once set,
17
- * it is the source of truth for the physical bucket — reads never
18
- * reconstruct the name from a prefix convention.
15
+ * The physical S3/MinIO bucket name recorded by reconciliation. NULL until
16
+ * reconciliation completes. Once set, it is the source of truth for the
17
+ * physical bucket — reads never reconstruct the name.
19
18
  */
20
19
  physical_name: string | null;
21
20
  }
@@ -35,6 +34,8 @@ export interface StorageModuleConfig {
35
34
  bucketsTableName: string;
36
35
  /** Files table name */
37
36
  filesTableName: string;
37
+ /** Qualified generated managed-file recorder, or null when unavailable */
38
+ recorderQualifiedName: string | null;
38
39
  /** Scope name (e.g., 'app', 'org', 'team') */
39
40
  scope: string;
40
41
  /** Entity table ID for entity-scoped storage (NULL for app-level) */
@@ -67,6 +68,8 @@ export interface StorageModuleConfig {
67
68
  * without it every row is treated as live, because there is nothing to read.
68
69
  */
69
70
  hasConfirmUpload: boolean;
71
+ /** Whether the files table carries the versioning chain. */
72
+ hasVersioning: boolean;
70
73
  /** Max files per requestBulkUploadUrls batch (default: 100) */
71
74
  maxBulkFiles: number;
72
75
  /** Max total size per bulk upload batch in bytes (default: 1GB) */
@@ -174,51 +177,10 @@ export interface S3Config {
174
177
  * env-var reads and S3Client creation at module import time.
175
178
  */
176
179
  export type S3ConfigOrGetter = S3Config | (() => S3Config);
177
- /**
178
- * Function to derive the actual S3 bucket name for a given database and bucket key.
179
- *
180
- * When provided, the presigned URL plugin calls this on every request
181
- * to determine which S3 bucket to use — enabling per-(database, bucketKey)
182
- * isolation. If not provided, falls back to `s3Config.bucket` (global).
183
- *
184
- * @param databaseId - The metaschema database UUID
185
- * @param bucketKey - The logical bucket key (e.g., "public", "private")
186
- * @returns The S3 bucket name for this database + bucket key
187
- */
188
- export type BucketNameResolver = (databaseId: string, bucketKey: string) => string;
189
- /**
190
- * Callback to lazily provision an S3 bucket on first use.
191
- *
192
- * Called by the presigned URL plugin before generating a presigned PUT URL
193
- * when the bucket has not been seen before (tracked in an in-memory cache).
194
- * The implementation should create and fully configure the S3 bucket
195
- * (privacy policies, CORS, lifecycle rules, etc.) — or no-op if the
196
- * bucket already exists.
197
- *
198
- * @param bucketName - The S3 bucket name to provision
199
- * @param accessType - The logical bucket type ('public', 'private', 'temp')
200
- * @param databaseId - The metaschema database UUID
201
- * @param allowedOrigins - Per-database CORS origins (from storage_module), or null to use global fallback
202
- */
203
- export type EnsureBucketProvisioned = (bucketName: string, accessType: 'public' | 'private' | 'temp', databaseId: string, allowedOrigins: string[] | null) => Promise<void>;
204
180
  /**
205
181
  * Plugin options for the presigned URL plugin.
206
182
  */
207
183
  export interface PresignedUrlPluginOptions {
208
184
  /** S3 configuration (concrete or lazy getter) */
209
185
  s3: S3ConfigOrGetter;
210
- /**
211
- * Optional function to resolve S3 bucket name per-database.
212
- * When set, each database gets its own S3 bucket instead of sharing
213
- * the global `s3Config.bucket`. The S3 credentials (client) remain shared.
214
- */
215
- resolveBucketName?: BucketNameResolver;
216
- /**
217
- * Optional callback to lazily provision an S3 bucket on first upload.
218
- * When set, the plugin calls this before generating a presigned PUT URL
219
- * for any S3 bucket it hasn't seen yet (tracked in an in-memory cache).
220
- * This enables graceful bucket creation without requiring buckets to
221
- * exist at database provisioning time.
222
- */
223
- ensureBucketProvisioned?: EnsureBucketProvisioned;
224
186
  }