graphile-settings 4.33.2 → 5.0.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.
@@ -19,6 +19,7 @@ export interface ConstructivePresetOptions {
19
19
  enableLtree?: boolean;
20
20
  enableLlm?: boolean;
21
21
  enableRealtime?: boolean;
22
+ enableBulk?: boolean;
22
23
  }
23
24
  /**
24
25
  * Create a Constructive PostGraphile v5 Preset.
@@ -51,6 +52,7 @@ export interface ConstructivePresetOptions {
51
52
  * - enablePresignedUploads -> PresignedUrlPreset, BucketProvisionerPreset
52
53
  * - enableAggregates -> PgAggregatesPreset (off by default)
53
54
  * - enableRealtime -> RealtimeSubscriptionsPreset (off by default)
55
+ * - enableBulk -> BulkMutationPreset (off by default)
54
56
  * - enableLlm -> (no plugin yet, reserved for future use)
55
57
  *
56
58
  * RELATION FILTERS (when enableConnectionFilter is true):
@@ -1,4 +1,5 @@
1
1
  import { BucketProvisionerPreset } from 'graphile-bucket-provisioner-plugin';
2
+ import { BulkMutationPreset } from 'graphile-bulk-mutations';
2
3
  import { ConnectionFilterPreset } from 'graphile-connection-filter';
3
4
  import { createFolderOperatorFactory, GraphileLtreePreset } from 'graphile-ltree';
4
5
  import { createPostgisOperatorFactory, GraphilePostgisPreset } from 'graphile-postgis';
@@ -23,6 +24,7 @@ const DEFAULTS = {
23
24
  enableLtree: true,
24
25
  enableLlm: false,
25
26
  enableRealtime: false,
27
+ enableBulk: false,
26
28
  };
27
29
  /**
28
30
  * Create a Constructive PostGraphile v5 Preset.
@@ -55,6 +57,7 @@ const DEFAULTS = {
55
57
  * - enablePresignedUploads -> PresignedUrlPreset, BucketProvisionerPreset
56
58
  * - enableAggregates -> PgAggregatesPreset (off by default)
57
59
  * - enableRealtime -> RealtimeSubscriptionsPreset (off by default)
60
+ * - enableBulk -> BulkMutationPreset (off by default)
58
61
  * - enableLlm -> (no plugin yet, reserved for future use)
59
62
  *
60
63
  * RELATION FILTERS (when enableConnectionFilter is true):
@@ -130,6 +133,9 @@ export function createConstructivePreset(options) {
130
133
  if (opts.enableRealtime) {
131
134
  presets.push(RealtimeSubscriptionsPreset());
132
135
  }
136
+ if (opts.enableBulk) {
137
+ presets.push(BulkMutationPreset());
138
+ }
133
139
  // ----- connectionFilterOperatorFactories -----
134
140
  // Only include operator factories for features that are actually enabled.
135
141
  // graphile-config replaces (not concatenates) arrays when merging presets,
@@ -24,17 +24,14 @@ import type { S3Config, BucketNameResolver, EnsureBucketProvisioned } from 'grap
24
24
  */
25
25
  export declare function getPresignedUrlS3Config(): S3Config;
26
26
  /**
27
- * Create a per-database bucket name resolver.
27
+ * Create a per-(database, bucketKey) bucket name resolver.
28
28
  *
29
- * Uses the BUCKET_NAME env var as a prefix. For each database, the S3 bucket
30
- * name becomes `{prefix}-{databaseId}` (e.g., "myapp-abc123def456").
29
+ * Uses the BUCKET_NAME env var as a prefix. For each (database, bucketKey)
30
+ * pair, the S3 bucket name becomes `{prefix}-{bucketKey}-{databaseId}`
31
+ * (e.g., "myapp-public-abc123def456").
31
32
  *
32
- * In local development with MinIO (default BUCKET_NAME="test-bucket"),
33
- * all databases share the same bucket for simplicity — the resolver
34
- * returns the prefix as-is when it looks like a local dev bucket.
35
- *
36
- * In production, set BUCKET_NAME to your org prefix (e.g., "myapp")
37
- * and each database gets its own isolated S3 bucket.
33
+ * This aligns with the bucket provisioner plugin which creates separate
34
+ * S3 buckets per logical bucket key.
38
35
  */
39
36
  export declare function createBucketNameResolver(): BucketNameResolver;
40
37
  /**
@@ -64,23 +64,20 @@ export function getPresignedUrlS3Config() {
64
64
  return s3Config;
65
65
  }
66
66
  /**
67
- * Create a per-database bucket name resolver.
67
+ * Create a per-(database, bucketKey) bucket name resolver.
68
68
  *
69
- * Uses the BUCKET_NAME env var as a prefix. For each database, the S3 bucket
70
- * name becomes `{prefix}-{databaseId}` (e.g., "myapp-abc123def456").
69
+ * Uses the BUCKET_NAME env var as a prefix. For each (database, bucketKey)
70
+ * pair, the S3 bucket name becomes `{prefix}-{bucketKey}-{databaseId}`
71
+ * (e.g., "myapp-public-abc123def456").
71
72
  *
72
- * In local development with MinIO (default BUCKET_NAME="test-bucket"),
73
- * all databases share the same bucket for simplicity — the resolver
74
- * returns the prefix as-is when it looks like a local dev bucket.
75
- *
76
- * In production, set BUCKET_NAME to your org prefix (e.g., "myapp")
77
- * and each database gets its own isolated S3 bucket.
73
+ * This aligns with the bucket provisioner plugin which creates separate
74
+ * S3 buckets per logical bucket key.
78
75
  */
79
76
  export function createBucketNameResolver() {
80
77
  const { cdn } = getEnvOptions();
81
78
  const prefix = cdn?.bucketName || 'test-bucket';
82
- return (databaseId) => {
83
- return `${prefix}-${databaseId}`;
79
+ return (databaseId, bucketKey) => {
80
+ return `${prefix}-${bucketKey}-${databaseId}`;
84
81
  };
85
82
  }
86
83
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "4.33.2",
3
+ "version": "5.0.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -49,12 +49,13 @@
49
49
  "graphile-bucket-provisioner-plugin": "0.10.1",
50
50
  "graphile-build": "5.0.0",
51
51
  "graphile-build-pg": "5.0.0",
52
+ "graphile-bulk-mutations": "^0.2.1",
52
53
  "graphile-config": "1.0.0",
53
54
  "graphile-connection-filter": "^1.9.2",
54
55
  "graphile-ltree": "^1.6.2",
55
56
  "graphile-pg-aggregates": "^1.2.2",
56
57
  "graphile-postgis": "^2.15.2",
57
- "graphile-presigned-url-plugin": "^0.17.1",
58
+ "graphile-presigned-url-plugin": "^0.18.0",
58
59
  "graphile-realtime-subscriptions": "^0.5.2",
59
60
  "graphile-search": "^1.11.2",
60
61
  "graphile-sql-expression-validator": "^2.11.1",
@@ -87,5 +88,5 @@
87
88
  "constructive",
88
89
  "graphql"
89
90
  ],
90
- "gitHead": "ea590e1b9e1ee38c267f8dbbb37aa3f83a5d3fb7"
91
+ "gitHead": "28b0b236e65b2a2228acad4fd840543c04b24825"
91
92
  }
@@ -19,6 +19,7 @@ export interface ConstructivePresetOptions {
19
19
  enableLtree?: boolean;
20
20
  enableLlm?: boolean;
21
21
  enableRealtime?: boolean;
22
+ enableBulk?: boolean;
22
23
  }
23
24
  /**
24
25
  * Create a Constructive PostGraphile v5 Preset.
@@ -51,6 +52,7 @@ export interface ConstructivePresetOptions {
51
52
  * - enablePresignedUploads -> PresignedUrlPreset, BucketProvisionerPreset
52
53
  * - enableAggregates -> PgAggregatesPreset (off by default)
53
54
  * - enableRealtime -> RealtimeSubscriptionsPreset (off by default)
55
+ * - enableBulk -> BulkMutationPreset (off by default)
54
56
  * - enableLlm -> (no plugin yet, reserved for future use)
55
57
  *
56
58
  * RELATION FILTERS (when enableConnectionFilter is true):
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConstructivePreset = void 0;
4
4
  exports.createConstructivePreset = createConstructivePreset;
5
5
  const graphile_bucket_provisioner_plugin_1 = require("graphile-bucket-provisioner-plugin");
6
+ const graphile_bulk_mutations_1 = require("graphile-bulk-mutations");
6
7
  const graphile_connection_filter_1 = require("graphile-connection-filter");
7
8
  const graphile_ltree_1 = require("graphile-ltree");
8
9
  const graphile_postgis_1 = require("graphile-postgis");
@@ -27,6 +28,7 @@ const DEFAULTS = {
27
28
  enableLtree: true,
28
29
  enableLlm: false,
29
30
  enableRealtime: false,
31
+ enableBulk: false,
30
32
  };
31
33
  /**
32
34
  * Create a Constructive PostGraphile v5 Preset.
@@ -59,6 +61,7 @@ const DEFAULTS = {
59
61
  * - enablePresignedUploads -> PresignedUrlPreset, BucketProvisionerPreset
60
62
  * - enableAggregates -> PgAggregatesPreset (off by default)
61
63
  * - enableRealtime -> RealtimeSubscriptionsPreset (off by default)
64
+ * - enableBulk -> BulkMutationPreset (off by default)
62
65
  * - enableLlm -> (no plugin yet, reserved for future use)
63
66
  *
64
67
  * RELATION FILTERS (when enableConnectionFilter is true):
@@ -134,6 +137,9 @@ function createConstructivePreset(options) {
134
137
  if (opts.enableRealtime) {
135
138
  presets.push((0, graphile_realtime_subscriptions_1.RealtimeSubscriptionsPreset)());
136
139
  }
140
+ if (opts.enableBulk) {
141
+ presets.push((0, graphile_bulk_mutations_1.BulkMutationPreset)());
142
+ }
137
143
  // ----- connectionFilterOperatorFactories -----
138
144
  // Only include operator factories for features that are actually enabled.
139
145
  // graphile-config replaces (not concatenates) arrays when merging presets,
@@ -24,17 +24,14 @@ import type { S3Config, BucketNameResolver, EnsureBucketProvisioned } from 'grap
24
24
  */
25
25
  export declare function getPresignedUrlS3Config(): S3Config;
26
26
  /**
27
- * Create a per-database bucket name resolver.
27
+ * Create a per-(database, bucketKey) bucket name resolver.
28
28
  *
29
- * Uses the BUCKET_NAME env var as a prefix. For each database, the S3 bucket
30
- * name becomes `{prefix}-{databaseId}` (e.g., "myapp-abc123def456").
29
+ * Uses the BUCKET_NAME env var as a prefix. For each (database, bucketKey)
30
+ * pair, the S3 bucket name becomes `{prefix}-{bucketKey}-{databaseId}`
31
+ * (e.g., "myapp-public-abc123def456").
31
32
  *
32
- * In local development with MinIO (default BUCKET_NAME="test-bucket"),
33
- * all databases share the same bucket for simplicity — the resolver
34
- * returns the prefix as-is when it looks like a local dev bucket.
35
- *
36
- * In production, set BUCKET_NAME to your org prefix (e.g., "myapp")
37
- * and each database gets its own isolated S3 bucket.
33
+ * This aligns with the bucket provisioner plugin which creates separate
34
+ * S3 buckets per logical bucket key.
38
35
  */
39
36
  export declare function createBucketNameResolver(): BucketNameResolver;
40
37
  /**
@@ -70,23 +70,20 @@ function getPresignedUrlS3Config() {
70
70
  return s3Config;
71
71
  }
72
72
  /**
73
- * Create a per-database bucket name resolver.
73
+ * Create a per-(database, bucketKey) bucket name resolver.
74
74
  *
75
- * Uses the BUCKET_NAME env var as a prefix. For each database, the S3 bucket
76
- * name becomes `{prefix}-{databaseId}` (e.g., "myapp-abc123def456").
75
+ * Uses the BUCKET_NAME env var as a prefix. For each (database, bucketKey)
76
+ * pair, the S3 bucket name becomes `{prefix}-{bucketKey}-{databaseId}`
77
+ * (e.g., "myapp-public-abc123def456").
77
78
  *
78
- * In local development with MinIO (default BUCKET_NAME="test-bucket"),
79
- * all databases share the same bucket for simplicity — the resolver
80
- * returns the prefix as-is when it looks like a local dev bucket.
81
- *
82
- * In production, set BUCKET_NAME to your org prefix (e.g., "myapp")
83
- * and each database gets its own isolated S3 bucket.
79
+ * This aligns with the bucket provisioner plugin which creates separate
80
+ * S3 buckets per logical bucket key.
84
81
  */
85
82
  function createBucketNameResolver() {
86
83
  const { cdn } = (0, graphql_env_1.getEnvOptions)();
87
84
  const prefix = cdn?.bucketName || 'test-bucket';
88
- return (databaseId) => {
89
- return `${prefix}-${databaseId}`;
85
+ return (databaseId, bucketKey) => {
86
+ return `${prefix}-${bucketKey}-${databaseId}`;
90
87
  };
91
88
  }
92
89
  /**