graphile-presigned-url-plugin 0.20.0 → 0.20.2

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/README.md CHANGED
@@ -92,6 +92,21 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
92
92
  * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
93
93
  * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
94
94
 
95
+ ### 📚 Documentation & Skills
96
+
97
+ * [constructive-skills](https://github.com/constructive-io/constructive-skills): **📖 Platform documentation and AI agent skills** — feature catalog, blueprint reference, SDK guides (i18n, billing, limits, events, uploads, security, entities, search, AI), and deployment guides.
98
+
99
+ Install skills for AI coding agents:
100
+
101
+ ```bash
102
+ # All platform skills (security, blueprints, codegen, billing, etc.)
103
+ npx skills add constructive-io/constructive-skills
104
+
105
+ # Individual repo skills (pgpm, testing, CLI, search, etc.)
106
+ npx skills add https://github.com/constructive-io/constructive --skill pgpm
107
+ npx skills add https://github.com/constructive-io/constructive --skill constructive-testing
108
+ ```
109
+
95
110
  ## Credits
96
111
 
97
112
  **🛠 Built by the [Constructive](https://constructive.io) team — creators of modular Postgres tooling for secure, composable backends. If you like our work, contribute on [GitHub](https://github.com/constructive-io).**
@@ -115,7 +115,7 @@ function createDownloadUrlPlugin(options) {
115
115
  let downloadUrlExpirySeconds = 3600;
116
116
  try {
117
117
  if (withPgClient && pgSettings) {
118
- const resolved = await withPgClient(null, async (pgClient) => {
118
+ const resolved = await withPgClient(pgSettings, async (pgClient) => {
119
119
  const dbResult = await pgClient.query({
120
120
  text: `SELECT jwt_private.current_database_id() AS id`,
121
121
  });
@@ -149,7 +149,7 @@ function createDownloadUrlPlugin(options) {
149
149
  // Fall back to global config if lookup fails
150
150
  }
151
151
  if (isPublic && s3ForDb.publicUrlPrefix) {
152
- return `${s3ForDb.publicUrlPrefix}/${key}`;
152
+ return `${s3ForDb.publicUrlPrefix}/${s3ForDb.bucket}/${key}`;
153
153
  }
154
154
  return (0, s3_signer_1.generatePresignedGetUrl)(s3ForDb, key, downloadUrlExpirySeconds, filename || undefined);
155
155
  });
@@ -112,7 +112,7 @@ export function createDownloadUrlPlugin(options) {
112
112
  let downloadUrlExpirySeconds = 3600;
113
113
  try {
114
114
  if (withPgClient && pgSettings) {
115
- const resolved = await withPgClient(null, async (pgClient) => {
115
+ const resolved = await withPgClient(pgSettings, async (pgClient) => {
116
116
  const dbResult = await pgClient.query({
117
117
  text: `SELECT jwt_private.current_database_id() AS id`,
118
118
  });
@@ -146,7 +146,7 @@ export function createDownloadUrlPlugin(options) {
146
146
  // Fall back to global config if lookup fails
147
147
  }
148
148
  if (isPublic && s3ForDb.publicUrlPrefix) {
149
- return `${s3ForDb.publicUrlPrefix}/${key}`;
149
+ return `${s3ForDb.publicUrlPrefix}/${s3ForDb.bucket}/${key}`;
150
150
  }
151
151
  return generatePresignedGetUrl(s3ForDb, key, downloadUrlExpirySeconds, filename || undefined);
152
152
  });
@@ -275,9 +275,11 @@ export async function loadAllStorageModules(pgClient, databaseId) {
275
275
  const key = `storage:${databaseId}:scope:${config.scope}`;
276
276
  storageModuleCache.set(key, config);
277
277
  }
278
- // Store the full list under a sentinel key
279
- const sentinel = { ...configs[0] || {}, _allConfigs: configs };
280
- storageModuleCache.set(cacheKey, sentinel);
278
+ // Store the full list under a sentinel key (only if non-empty to avoid caching failed lookups)
279
+ if (configs.length > 0) {
280
+ const sentinel = { ...configs[0], _allConfigs: configs };
281
+ storageModuleCache.set(cacheKey, sentinel);
282
+ }
281
283
  return configs;
282
284
  }
283
285
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-presigned-url-plugin",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
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",
@@ -60,5 +60,5 @@
60
60
  "@types/node": "^22.19.11",
61
61
  "makage": "^0.3.0"
62
62
  },
63
- "gitHead": "0503916f414a3b8a6f6cbe46e03a59988b2f3cb5"
63
+ "gitHead": "00ebac5e8314330aa47564ed71758a4bcc8f8f8e"
64
64
  }
@@ -287,9 +287,11 @@ async function loadAllStorageModules(pgClient, databaseId) {
287
287
  const key = `storage:${databaseId}:scope:${config.scope}`;
288
288
  storageModuleCache.set(key, config);
289
289
  }
290
- // Store the full list under a sentinel key
291
- const sentinel = { ...configs[0] || {}, _allConfigs: configs };
292
- storageModuleCache.set(cacheKey, sentinel);
290
+ // Store the full list under a sentinel key (only if non-empty to avoid caching failed lookups)
291
+ if (configs.length > 0) {
292
+ const sentinel = { ...configs[0], _allConfigs: configs };
293
+ storageModuleCache.set(cacheKey, sentinel);
294
+ }
293
295
  return configs;
294
296
  }
295
297
  /**