@pgpm/metaschema-modules 0.26.5 → 0.26.6
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/Makefile +1 -1
- package/README.md +19 -4
- package/deploy/schemas/metaschema_modules_public/tables/function_invocation_module/table.sql +67 -0
- package/deploy/schemas/metaschema_modules_public/tables/function_module/table.sql +1 -7
- package/deploy/schemas/metaschema_modules_public/tables/memberships_module/table.sql +4 -2
- package/deploy/schemas/metaschema_modules_public/tables/merkle_store_module/table.sql +5 -0
- package/deploy/schemas/metaschema_modules_public/tables/notifications_module/table.sql +3 -0
- package/metaschema-modules.control +1 -1
- package/package.json +4 -4
- package/pgpm.plan +1 -0
- package/revert/schemas/metaschema_modules_public/tables/function_invocation_module/table.sql +7 -0
- package/sql/{metaschema-modules--0.26.3.sql → metaschema-modules--0.26.5.sql} +260 -213
- package/verify/schemas/metaschema_modules_public/tables/function_invocation_module/table.sql +7 -0
package/Makefile
CHANGED
package/README.md
CHANGED
|
@@ -223,14 +223,29 @@ pnpm test
|
|
|
223
223
|
|
|
224
224
|
## Related Tooling
|
|
225
225
|
|
|
226
|
-
* [pgpm](https://github.com/constructive-io/constructive/tree/main/
|
|
227
|
-
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/
|
|
228
|
-
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/
|
|
229
|
-
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/
|
|
226
|
+
* [pgpm](https://github.com/constructive-io/constructive/tree/main/pgpm/pgpm): **🖥️ PostgreSQL Package Manager** for modular Postgres development. Works with database workspaces, scaffolding, migrations, seeding, and installing database packages.
|
|
227
|
+
* [pgsql-test](https://github.com/constructive-io/constructive/tree/main/postgres/pgsql-test): **📊 Isolated testing environments** with per-test transaction rollbacks—ideal for integration tests, complex migrations, and RLS simulation.
|
|
228
|
+
* [supabase-test](https://github.com/constructive-io/constructive/tree/main/postgres/supabase-test): **🧪 Supabase-native test harness** preconfigured for the local Supabase stack—per-test rollbacks, JWT/role context helpers, and CI/GitHub Actions ready.
|
|
229
|
+
* [graphile-test](https://github.com/constructive-io/constructive/tree/main/graphile/graphile-test): **🔐 Authentication mocking** for Graphile-focused test helpers and emulating row-level security contexts.
|
|
230
230
|
* [pgsql-parser](https://github.com/constructive-io/pgsql-parser): **🔄 SQL conversion engine** that interprets and converts PostgreSQL syntax.
|
|
231
231
|
* [libpg-query-node](https://github.com/constructive-io/libpg-query-node): **🌉 Node.js bindings** for `libpg_query`, converting SQL into parse trees.
|
|
232
232
|
* [pg-proto-parser](https://github.com/constructive-io/pg-proto-parser): **📦 Protobuf parser** for parsing PostgreSQL Protocol Buffers definitions to generate TypeScript interfaces, utility functions, and JSON mappings for enums.
|
|
233
233
|
|
|
234
|
+
### 📚 Documentation & Skills
|
|
235
|
+
|
|
236
|
+
* [constructive-skills](https://github.com/constructive-io/constructive-skills): **📖 Platform documentation and AI agent skills** — feature catalog, blueprint reference, SDK guides, and deployment guides.
|
|
237
|
+
|
|
238
|
+
Install skills for AI coding agents:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
# All platform skills (security, blueprints, codegen, billing, etc.)
|
|
242
|
+
npx skills add constructive-io/constructive-skills
|
|
243
|
+
|
|
244
|
+
# Individual repo skills (pgpm, testing, CLI, search, etc.)
|
|
245
|
+
npx skills add https://github.com/constructive-io/constructive --skill pgpm
|
|
246
|
+
npx skills add https://github.com/constructive-io/constructive --skill constructive-testing
|
|
247
|
+
```
|
|
248
|
+
|
|
234
249
|
## Disclaimer
|
|
235
250
|
|
|
236
251
|
AS DESCRIBED IN THE LICENSES, THE SOFTWARE IS PROVIDED "AS IS", AT YOUR OWN RISK, AND WITHOUT WARRANTIES OF ANY KIND.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
-- Deploy schemas/metaschema_modules_public/tables/function_invocation_module/table to pg
|
|
2
|
+
|
|
3
|
+
-- requires: schemas/metaschema_modules_public/schema
|
|
4
|
+
|
|
5
|
+
BEGIN;
|
|
6
|
+
|
|
7
|
+
CREATE TABLE metaschema_modules_public.function_invocation_module (
|
|
8
|
+
id uuid PRIMARY KEY DEFAULT uuidv7(),
|
|
9
|
+
database_id uuid NOT NULL,
|
|
10
|
+
|
|
11
|
+
-- Schema references (if uuid_nil, resolved from schema name or default)
|
|
12
|
+
schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
13
|
+
private_schema_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
14
|
+
|
|
15
|
+
-- Optional schema name overrides (used when schema IDs are not provided)
|
|
16
|
+
public_schema_name text,
|
|
17
|
+
private_schema_name text,
|
|
18
|
+
|
|
19
|
+
-- Generated table IDs (populated by the generator)
|
|
20
|
+
invocations_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
21
|
+
execution_logs_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
22
|
+
|
|
23
|
+
-- Table names (input to the generator — bare names without scope prefix).
|
|
24
|
+
-- The trigger prepends the scope prefix automatically.
|
|
25
|
+
invocations_table_name text NOT NULL DEFAULT 'function_invocations',
|
|
26
|
+
execution_logs_table_name text NOT NULL DEFAULT 'function_execution_logs',
|
|
27
|
+
|
|
28
|
+
-- API routing (get-or-create: if set, schema is added to this API; if NULL, no API is added)
|
|
29
|
+
api_name text,
|
|
30
|
+
private_api_name text,
|
|
31
|
+
|
|
32
|
+
-- Scope: determines the security level for this module instance.
|
|
33
|
+
scope text NOT NULL DEFAULT 'app',
|
|
34
|
+
|
|
35
|
+
-- Table name prefix. Auto-derived from scope by the trigger when empty.
|
|
36
|
+
-- Override to create multiple module instances at the same scope.
|
|
37
|
+
prefix text NOT NULL DEFAULT '',
|
|
38
|
+
|
|
39
|
+
-- Entity table for RLS and billing attribution.
|
|
40
|
+
-- When set, invocations are scoped to the entity (org, app) for billing/metering.
|
|
41
|
+
entity_table_id uuid NULL,
|
|
42
|
+
|
|
43
|
+
-- Configurable security policies (NULL = use defaults based on scope).
|
|
44
|
+
policies jsonb NULL,
|
|
45
|
+
|
|
46
|
+
-- Per-table provisions overrides from blueprint config.
|
|
47
|
+
-- Keys are table keys (invocations, execution_logs).
|
|
48
|
+
provisions jsonb NULL,
|
|
49
|
+
|
|
50
|
+
-- Default permissions: permission names auto-granted to new members.
|
|
51
|
+
default_permissions text[] DEFAULT NULL,
|
|
52
|
+
|
|
53
|
+
-- Constraints
|
|
54
|
+
CONSTRAINT function_invocation_module_db_fkey FOREIGN KEY (database_id) REFERENCES metaschema_public.database (id) ON DELETE CASCADE,
|
|
55
|
+
CONSTRAINT function_invocation_module_schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
56
|
+
CONSTRAINT function_invocation_module_private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
57
|
+
CONSTRAINT function_invocation_module_invocations_table_fkey FOREIGN KEY (invocations_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
58
|
+
CONSTRAINT function_invocation_module_logs_table_fkey FOREIGN KEY (execution_logs_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
59
|
+
CONSTRAINT function_invocation_module_entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
CREATE INDEX function_invocation_module_database_id_idx ON metaschema_modules_public.function_invocation_module ( database_id );
|
|
63
|
+
|
|
64
|
+
-- Unique constraint: one function invocation module per database per scope per prefix.
|
|
65
|
+
CREATE UNIQUE INDEX function_invocation_module_unique_scope ON metaschema_modules_public.function_invocation_module ( database_id, scope, prefix );
|
|
66
|
+
|
|
67
|
+
COMMIT;
|
|
@@ -18,15 +18,11 @@ CREATE TABLE metaschema_modules_public.function_module (
|
|
|
18
18
|
|
|
19
19
|
-- Generated table IDs (populated by the generator)
|
|
20
20
|
definitions_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
21
|
-
invocations_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
22
|
-
execution_logs_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
23
21
|
secret_definitions_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
24
22
|
|
|
25
23
|
-- Table names (input to the generator — bare names without scope prefix).
|
|
26
24
|
-- The trigger prepends the scope prefix automatically.
|
|
27
25
|
definitions_table_name text NOT NULL DEFAULT 'function_definitions',
|
|
28
|
-
invocations_table_name text NOT NULL DEFAULT 'function_invocations',
|
|
29
|
-
execution_logs_table_name text NOT NULL DEFAULT 'function_execution_logs',
|
|
30
26
|
secret_definitions_table_name text NOT NULL DEFAULT 'secret_definitions',
|
|
31
27
|
|
|
32
28
|
-- API routing (get-or-create: if set, schema is added to this API; if NULL, no API is added)
|
|
@@ -51,7 +47,7 @@ CREATE TABLE metaschema_modules_public.function_module (
|
|
|
51
47
|
policies jsonb NULL,
|
|
52
48
|
|
|
53
49
|
-- Per-table provisions overrides from blueprint config.
|
|
54
|
-
-- Keys are table keys (definitions,
|
|
50
|
+
-- Keys are table keys (definitions, secret_definitions).
|
|
55
51
|
-- When a key is present, the module trigger skips default security for that table;
|
|
56
52
|
-- secure_table_provision applies the custom grants/policies instead.
|
|
57
53
|
provisions jsonb NULL,
|
|
@@ -65,8 +61,6 @@ CREATE TABLE metaschema_modules_public.function_module (
|
|
|
65
61
|
CONSTRAINT function_module_schema_fkey FOREIGN KEY (schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
66
62
|
CONSTRAINT function_module_private_schema_fkey FOREIGN KEY (private_schema_id) REFERENCES metaschema_public.schema (id) ON DELETE CASCADE,
|
|
67
63
|
CONSTRAINT function_module_definitions_table_fkey FOREIGN KEY (definitions_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
68
|
-
CONSTRAINT function_module_invocations_table_fkey FOREIGN KEY (invocations_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
69
|
-
CONSTRAINT function_module_execution_logs_table_fkey FOREIGN KEY (execution_logs_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
70
64
|
CONSTRAINT function_module_secret_defs_table_fkey FOREIGN KEY (secret_definitions_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
71
65
|
CONSTRAINT function_module_entity_table_fkey FOREIGN KEY (entity_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE
|
|
72
66
|
);
|
|
@@ -64,8 +64,10 @@ CREATE TABLE metaschema_modules_public.memberships_module (
|
|
|
64
64
|
|
|
65
65
|
member_profiles_table_id uuid NULL,
|
|
66
66
|
|
|
67
|
-
--
|
|
68
|
-
|
|
67
|
+
-- Audit tables for permission defaults (created by memberships_module when has_permissions=true)
|
|
68
|
+
permission_default_permissions_table_id uuid NULL,
|
|
69
|
+
permission_default_grants_table_id uuid NULL,
|
|
70
|
+
|
|
69
71
|
-- API routing (configurable per-module)
|
|
70
72
|
api_name text DEFAULT 'admin',
|
|
71
73
|
private_api_name text DEFAULT NULL,
|
|
@@ -34,6 +34,11 @@ CREATE TABLE metaschema_modules_public.merkle_store_module (
|
|
|
34
34
|
-- RLS through metaschema_public.database ownership.
|
|
35
35
|
scope text NOT NULL DEFAULT 'app',
|
|
36
36
|
|
|
37
|
+
-- Function name prefix override: NULL (default) inherits from `prefix`;
|
|
38
|
+
-- '' (empty string) generates unprefixed function names (e.g., get_all instead of function_graph_get_all);
|
|
39
|
+
-- any other value is used as-is. Tables always keep their prefix regardless of this setting.
|
|
40
|
+
function_prefix text DEFAULT NULL,
|
|
41
|
+
|
|
37
42
|
-- Timestamps
|
|
38
43
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
39
44
|
|
|
@@ -19,6 +19,7 @@ CREATE TABLE metaschema_modules_public.notifications_module (
|
|
|
19
19
|
preferences_table_id uuid,
|
|
20
20
|
channels_table_id uuid,
|
|
21
21
|
delivery_log_table_id uuid,
|
|
22
|
+
suppressions_table_id uuid,
|
|
22
23
|
|
|
23
24
|
owner_table_id uuid NOT NULL DEFAULT uuid_nil(),
|
|
24
25
|
|
|
@@ -51,6 +52,7 @@ CREATE TABLE metaschema_modules_public.notifications_module (
|
|
|
51
52
|
CONSTRAINT preferences_table_fkey FOREIGN KEY (preferences_table_id) REFERENCES metaschema_public.table (id) ON DELETE SET NULL,
|
|
52
53
|
CONSTRAINT channels_table_fkey FOREIGN KEY (channels_table_id) REFERENCES metaschema_public.table (id) ON DELETE SET NULL,
|
|
53
54
|
CONSTRAINT delivery_log_table_fkey FOREIGN KEY (delivery_log_table_id) REFERENCES metaschema_public.table (id) ON DELETE SET NULL,
|
|
55
|
+
CONSTRAINT suppressions_table_fkey FOREIGN KEY (suppressions_table_id) REFERENCES metaschema_public.table (id) ON DELETE SET NULL,
|
|
54
56
|
CONSTRAINT owner_table_fkey FOREIGN KEY (owner_table_id) REFERENCES metaschema_public.table (id) ON DELETE CASCADE,
|
|
55
57
|
CONSTRAINT user_settings_table_fkey FOREIGN KEY (user_settings_table_id) REFERENCES metaschema_public.table (id) ON DELETE SET NULL,
|
|
56
58
|
CONSTRAINT organization_settings_table_fkey FOREIGN KEY (organization_settings_table_id) REFERENCES metaschema_public.table (id) ON DELETE SET NULL,
|
|
@@ -65,6 +67,7 @@ COMMENT ON CONSTRAINT read_state_table_fkey ON metaschema_modules_public.notific
|
|
|
65
67
|
COMMENT ON CONSTRAINT preferences_table_fkey ON metaschema_modules_public.notifications_module IS E'@fieldName preferencesTableByPreferencesTableId\n@omit manyToMany';
|
|
66
68
|
COMMENT ON CONSTRAINT channels_table_fkey ON metaschema_modules_public.notifications_module IS E'@fieldName channelsTableByChannelsTableId\n@omit manyToMany';
|
|
67
69
|
COMMENT ON CONSTRAINT delivery_log_table_fkey ON metaschema_modules_public.notifications_module IS E'@fieldName deliveryLogTableByDeliveryLogTableId\n@omit manyToMany';
|
|
70
|
+
COMMENT ON CONSTRAINT suppressions_table_fkey ON metaschema_modules_public.notifications_module IS E'@fieldName suppressionsTableBySuppressionsTableId';
|
|
68
71
|
COMMENT ON CONSTRAINT owner_table_fkey ON metaschema_modules_public.notifications_module IS E'@omit manyToMany';
|
|
69
72
|
COMMENT ON CONSTRAINT user_settings_table_fkey ON metaschema_modules_public.notifications_module IS E'@fieldName userSettingsTableByUserSettingsTableId\n@omit manyToMany';
|
|
70
73
|
COMMENT ON CONSTRAINT organization_settings_table_fkey ON metaschema_modules_public.notifications_module IS E'@fieldName organizationSettingsTableByOrganizationSettingsTableId\n@omit manyToMany';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# metaschema-modules extension
|
|
2
2
|
comment = 'metaschema-modules extension'
|
|
3
|
-
default_version = '0.26.
|
|
3
|
+
default_version = '0.26.5'
|
|
4
4
|
module_pathname = '$libdir/metaschema-modules'
|
|
5
5
|
requires = 'plpgsql,uuid-ossp,metaschema-schema,services,pgpm-verify'
|
|
6
6
|
relocatable = false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpm/metaschema-modules",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.6",
|
|
4
4
|
"description": "Module metadata handling and dependency tracking",
|
|
5
5
|
"author": "Dan Lynch <pyramation@gmail.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"test:watch": "jest --watch"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@pgpm/metaschema-schema": "0.26.
|
|
25
|
-
"@pgpm/verify": "0.26.
|
|
24
|
+
"@pgpm/metaschema-schema": "0.26.6",
|
|
25
|
+
"@pgpm/verify": "0.26.6"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"pgpm": "^4.23.2"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"bugs": {
|
|
36
36
|
"url": "https://github.com/constructive-io/pgpm-modules/issues"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "a87bfe1c77bfd1c627b7f7c5a92312aefc376c94"
|
|
39
39
|
}
|
package/pgpm.plan
CHANGED
|
@@ -60,6 +60,7 @@ schemas/metaschema_modules_public/tables/merkle_store_module/table [schemas/meta
|
|
|
60
60
|
schemas/metaschema_modules_public/tables/graph_module/table [schemas/metaschema_modules_public/schema schemas/metaschema_modules_public/tables/merkle_store_module/table] 2026-05-21T01:00:00Z devin <devin@cognition.ai> # add graph_module config table for FBP graph utilities on top of merkle store
|
|
61
61
|
schemas/metaschema_modules_public/tables/namespace_module/table [schemas/metaschema_modules_public/schema] 2026-05-21T02:00:00Z devin <devin@cognition.ai> # add namespace_module config table for entity-aware namespace provisioning
|
|
62
62
|
schemas/metaschema_modules_public/tables/function_module/table [schemas/metaschema_modules_public/schema] 2026-05-21T03:00:00Z devin <devin@cognition.ai> # add function_module config table for entity-aware function definitions
|
|
63
|
+
schemas/metaschema_modules_public/tables/function_invocation_module/table [schemas/metaschema_modules_public/schema] 2026-06-08T00:00:00Z devin <devin@cognition.ai> # add function_invocation_module config table for entity-scoped invocations and execution logs
|
|
63
64
|
schemas/metaschema_modules_public/tables/config_secrets_module/table [schemas/metaschema_modules_public/schema] 2026-05-29T00:00:00Z devin <devin@cognition.ai> # add entity-aware config_secrets_module (replaces config_secrets_user_module + config_secrets_org_module)
|
|
64
65
|
schemas/metaschema_modules_public/tables/user_credentials_module/table [schemas/metaschema_modules_public/schema] 2026-05-30T00:00:00Z devin <devin@cognition.ai> # add user_credentials_module for per-user bcrypt credential store (split from config_secrets_module)
|
|
65
66
|
schemas/metaschema_modules_public/tables/user_settings_module/table [schemas/metaschema_modules_public/schema] 2026-05-28T00:00:00Z devin <devin@cognition.ai> # add user_settings_module for extensible per-user preferences (1:1 with users)
|