graphile-bucket-provisioner-plugin 0.11.2 → 0.13.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/README.md CHANGED
@@ -217,6 +217,21 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
217
217
  * [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
218
218
  * [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
219
219
 
220
+ ### 📚 Documentation & Skills
221
+
222
+ * [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.
223
+
224
+ Install skills for AI coding agents:
225
+
226
+ ```bash
227
+ # All platform skills (security, blueprints, codegen, billing, etc.)
228
+ npx skills add constructive-io/constructive-skills
229
+
230
+ # Individual repo skills (pgpm, testing, CLI, search, etc.)
231
+ npx skills add https://github.com/constructive-io/constructive --skill pgpm
232
+ npx skills add https://github.com/constructive-io/constructive --skill constructive-testing
233
+ ```
234
+
220
235
  ## Credits
221
236
 
222
237
  **🛠 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).**
package/esm/plugin.js CHANGED
@@ -38,12 +38,12 @@ import { BucketProvisioner, } from '@constructive-io/bucket-provisioner';
38
38
  const log = new Logger('graphile-bucket-provisioner:plugin');
39
39
  // --- Storage module queries ---
40
40
  /**
41
- * Resolve the app-level storage module (membership_type IS NULL).
41
+ * Resolve the app-level storage module (scope = 'app').
42
42
  */
43
43
  const APP_STORAGE_MODULE_QUERY = `
44
44
  SELECT
45
45
  sm.id,
46
- sm.membership_type,
46
+ sm.scope,
47
47
  sm.entity_table_id,
48
48
  bs.schema_name AS buckets_schema,
49
49
  bt.name AS buckets_table,
@@ -55,7 +55,7 @@ const APP_STORAGE_MODULE_QUERY = `
55
55
  JOIN metaschema_public.table bt ON bt.id = sm.buckets_table_id
56
56
  JOIN metaschema_public.schema bs ON bs.id = bt.schema_id
57
57
  WHERE sm.database_id = $1
58
- AND sm.membership_type IS NULL
58
+ AND sm.scope = 'app'
59
59
  LIMIT 1
60
60
  `;
61
61
  /**
@@ -64,7 +64,7 @@ const APP_STORAGE_MODULE_QUERY = `
64
64
  const ALL_STORAGE_MODULES_QUERY = `
65
65
  SELECT
66
66
  sm.id,
67
- sm.membership_type,
67
+ sm.scope,
68
68
  sm.entity_table_id,
69
69
  bs.schema_name AS buckets_schema,
70
70
  bt.name AS buckets_table,
@@ -301,7 +301,7 @@ export function createBucketProvisionerPlugin(options) {
301
301
  : 'STORAGE_MODULE_NOT_PROVISIONED');
302
302
  }
303
303
  // Look up the bucket row (RLS enforced via pgSettings)
304
- const hasOwner = ownerId && storageModule.membership_type !== null;
304
+ const hasOwner = ownerId && storageModule.scope !== 'app';
305
305
  const bucketsTable = QuoteUtils.quoteQualifiedIdentifier(storageModule.buckets_schema, storageModule.buckets_table);
306
306
  const bucketResult = await pgClient.query(hasOwner
307
307
  ? `SELECT id, key, type, is_public, allowed_origins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-bucket-provisioner-plugin",
3
- "version": "0.11.2",
3
+ "version": "0.13.0",
4
4
  "description": "Bucket provisioning plugin for PostGraphile v5 — auto-provisions S3 buckets on bucket table mutations",
5
5
  "author": "Constructive <developers@constructive.io>",
6
6
  "homepage": "https://github.com/constructive-io/constructive",
@@ -40,8 +40,8 @@
40
40
  "url": "https://github.com/constructive-io/constructive/issues"
41
41
  },
42
42
  "dependencies": {
43
- "@constructive-io/bucket-provisioner": "^0.11.2",
44
- "@pgpmjs/logger": "^2.11.1",
43
+ "@constructive-io/bucket-provisioner": "^0.13.0",
44
+ "@pgpmjs/logger": "^2.13.0",
45
45
  "@pgsql/quotes": "^17.1.0"
46
46
  },
47
47
  "peerDependencies": {
@@ -57,5 +57,5 @@
57
57
  "@types/node": "^22.19.11",
58
58
  "makage": "^0.3.0"
59
59
  },
60
- "gitHead": "423992019655cc1e780149ce3f7e6e8c9b1c6e80"
60
+ "gitHead": "958154492690368ffffef974122ea243c68055e2"
61
61
  }
package/plugin.js CHANGED
@@ -42,12 +42,12 @@ const bucket_provisioner_1 = require("@constructive-io/bucket-provisioner");
42
42
  const log = new logger_1.Logger('graphile-bucket-provisioner:plugin');
43
43
  // --- Storage module queries ---
44
44
  /**
45
- * Resolve the app-level storage module (membership_type IS NULL).
45
+ * Resolve the app-level storage module (scope = 'app').
46
46
  */
47
47
  const APP_STORAGE_MODULE_QUERY = `
48
48
  SELECT
49
49
  sm.id,
50
- sm.membership_type,
50
+ sm.scope,
51
51
  sm.entity_table_id,
52
52
  bs.schema_name AS buckets_schema,
53
53
  bt.name AS buckets_table,
@@ -59,7 +59,7 @@ const APP_STORAGE_MODULE_QUERY = `
59
59
  JOIN metaschema_public.table bt ON bt.id = sm.buckets_table_id
60
60
  JOIN metaschema_public.schema bs ON bs.id = bt.schema_id
61
61
  WHERE sm.database_id = $1
62
- AND sm.membership_type IS NULL
62
+ AND sm.scope = 'app'
63
63
  LIMIT 1
64
64
  `;
65
65
  /**
@@ -68,7 +68,7 @@ const APP_STORAGE_MODULE_QUERY = `
68
68
  const ALL_STORAGE_MODULES_QUERY = `
69
69
  SELECT
70
70
  sm.id,
71
- sm.membership_type,
71
+ sm.scope,
72
72
  sm.entity_table_id,
73
73
  bs.schema_name AS buckets_schema,
74
74
  bt.name AS buckets_table,
@@ -305,7 +305,7 @@ function createBucketProvisionerPlugin(options) {
305
305
  : 'STORAGE_MODULE_NOT_PROVISIONED');
306
306
  }
307
307
  // Look up the bucket row (RLS enforced via pgSettings)
308
- const hasOwner = ownerId && storageModule.membership_type !== null;
308
+ const hasOwner = ownerId && storageModule.scope !== 'app';
309
309
  const bucketsTable = quotes_1.QuoteUtils.quoteQualifiedIdentifier(storageModule.buckets_schema, storageModule.buckets_table);
310
310
  const bucketResult = await pgClient.query(hasOwner
311
311
  ? `SELECT id, key, type, is_public, allowed_origins