graphile-presigned-url-plugin 1.19.0 → 1.20.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/esm/plugin.js CHANGED
@@ -89,12 +89,13 @@ export function createPresignedUrlPlugin(options) {
89
89
  const { scope: { isRootMutation }, } = context;
90
90
  if (!isRootMutation)
91
91
  return fields;
92
- const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, }, } = build;
92
+ const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, isOutputType, }, } = build;
93
93
  // The projection document is jsonb-shaped. PostGraphile registers a JSON
94
94
  // scalar whenever the schema has a jsonb column, which any storage-equipped
95
95
  // database does; if it is absent the payload simply omits the field rather
96
96
  // than failing schema build over a field nothing can have asked for yet.
97
- const jsonType = build.getTypeByName('JSON') ?? null;
97
+ const jsonNamedType = build.getTypeByName('JSON');
98
+ const jsonType = jsonNamedType && isOutputType(jsonNamedType) ? jsonNamedType : null;
98
99
  if (!jsonType) {
99
100
  log.warn('No JSON scalar in this schema; upload payloads will omit the `file` projection');
100
101
  }
package/esm/types.d.ts CHANGED
@@ -12,7 +12,7 @@ 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 by reconciliation. NULL until
15
+ * The physical S3-compatible (RustFS, MinIO) bucket name recorded by reconciliation. NULL until
16
16
  * reconciliation completes. Once set, it is the source of truth for the
17
17
  * physical bucket — reads never reconstruct the name.
18
18
  */
@@ -161,11 +161,11 @@ export interface S3Config {
161
161
  client: S3Client;
162
162
  /** S3 bucket name (the actual S3 bucket, not the logical bucket key) */
163
163
  bucket: string;
164
- /** S3 endpoint URL (for MinIO/custom S3) */
164
+ /** S3 endpoint URL (for RustFS, MinIO, or custom S3) */
165
165
  endpoint?: string;
166
166
  /** S3 region */
167
167
  region?: string;
168
- /** Whether to use path-style URLs (required for MinIO) */
168
+ /** Whether to use path-style URLs (required for path-style S3-compatible storage) */
169
169
  forcePathStyle?: boolean;
170
170
  /** Public URL prefix for generating download URLs */
171
171
  publicUrlPrefix?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-presigned-url-plugin",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Presigned URL upload plugin for PostGraphile v5 — requestUploadUrl mutation and downloadUrl computed field",
5
5
  "author": "Constructive <developers@constructive.io>",
6
6
  "homepage": "https://github.com/constructive-io/constructive",
@@ -42,12 +42,12 @@
42
42
  "dependencies": {
43
43
  "@aws-sdk/client-s3": "^3.1052.0",
44
44
  "@aws-sdk/s3-request-presigner": "^3.1052.0",
45
- "@pgpmjs/logger": "^2.25.1",
45
+ "@pgpmjs/logger": "^2.26.0",
46
46
  "@pgsql/quotes": "^18.2.4",
47
47
  "graphile-plugin-utils": "^1.12.2",
48
- "graphile-storage-registry": "^0.1.2",
48
+ "graphile-storage-registry": "^0.2.0",
49
49
  "lru-cache": "^11.2.7",
50
- "mime-bytes": "^0.32.1"
50
+ "mime-bytes": "^0.33.0"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "grafast": "^1.1.1",
@@ -59,9 +59,9 @@
59
59
  "postgraphile": "^5.1.3"
60
60
  },
61
61
  "devDependencies": {
62
- "@constructive-io/s3-utils": "^2.33.0",
62
+ "@constructive-io/s3-utils": "^2.34.0",
63
63
  "@types/node": "^22.19.11",
64
64
  "makage": "^0.8.0"
65
65
  },
66
- "gitHead": "01e073830677c0587bab564b7d575a06b5156f0c"
66
+ "gitHead": "baa84094b8541eb5000701b0060aa5b298032dc7"
67
67
  }
package/plugin.js CHANGED
@@ -93,12 +93,13 @@ function createPresignedUrlPlugin(options) {
93
93
  const { scope: { isRootMutation }, } = context;
94
94
  if (!isRootMutation)
95
95
  return fields;
96
- const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, }, } = build;
96
+ const { graphql: { GraphQLString, GraphQLNonNull, GraphQLInt, GraphQLBoolean, GraphQLObjectType, GraphQLInputObjectType, GraphQLList, isOutputType, }, } = build;
97
97
  // The projection document is jsonb-shaped. PostGraphile registers a JSON
98
98
  // scalar whenever the schema has a jsonb column, which any storage-equipped
99
99
  // database does; if it is absent the payload simply omits the field rather
100
100
  // than failing schema build over a field nothing can have asked for yet.
101
- const jsonType = build.getTypeByName('JSON') ?? null;
101
+ const jsonNamedType = build.getTypeByName('JSON');
102
+ const jsonType = jsonNamedType && isOutputType(jsonNamedType) ? jsonNamedType : null;
102
103
  if (!jsonType) {
103
104
  log.warn('No JSON scalar in this schema; upload payloads will omit the `file` projection');
104
105
  }
package/types.d.ts CHANGED
@@ -12,7 +12,7 @@ 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 by reconciliation. NULL until
15
+ * The physical S3-compatible (RustFS, MinIO) bucket name recorded by reconciliation. NULL until
16
16
  * reconciliation completes. Once set, it is the source of truth for the
17
17
  * physical bucket — reads never reconstruct the name.
18
18
  */
@@ -161,11 +161,11 @@ export interface S3Config {
161
161
  client: S3Client;
162
162
  /** S3 bucket name (the actual S3 bucket, not the logical bucket key) */
163
163
  bucket: string;
164
- /** S3 endpoint URL (for MinIO/custom S3) */
164
+ /** S3 endpoint URL (for RustFS, MinIO, or custom S3) */
165
165
  endpoint?: string;
166
166
  /** S3 region */
167
167
  region?: string;
168
- /** Whether to use path-style URLs (required for MinIO) */
168
+ /** Whether to use path-style URLs (required for path-style S3-compatible storage) */
169
169
  forcePathStyle?: boolean;
170
170
  /** Public URL prefix for generating download URLs */
171
171
  publicUrlPrefix?: string;