@pgpmjs/export 0.16.0 → 0.17.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.
@@ -25,7 +25,6 @@ export const DB_REQUIRED_EXTENSIONS = [
25
25
  'ltree',
26
26
  'metaschema-schema',
27
27
  'pgpm-inflection',
28
- 'pgpm-uuid',
29
28
  'pgpm-utils',
30
29
  'pgpm-database-jobs',
31
30
  'pgpm-jwt-claims',
@@ -33,7 +32,8 @@ export const DB_REQUIRED_EXTENSIONS = [
33
32
  'pgpm-base32',
34
33
  'pgpm-totp',
35
34
  'pgpm-types',
36
- 'pgpm-ltree-helpers'
35
+ 'pgpm-ltree-helpers',
36
+ 'pgpm-partman'
37
37
  ];
38
38
  /**
39
39
  * Map PostgreSQL data types to FieldType values.
@@ -153,7 +153,7 @@ export const META_TABLE_ORDER = [
153
153
  'memberships_module',
154
154
  'permissions_module',
155
155
  'limits_module',
156
- 'levels_module',
156
+ 'events_module',
157
157
  'users_module',
158
158
  'hierarchy_module',
159
159
  'membership_types_module',
@@ -173,7 +173,8 @@ export const META_TABLE_ORDER = [
173
173
  'uuid_module',
174
174
  'default_ids_module',
175
175
  'denormalized_table_field',
176
- 'table_template_module',
176
+ // NOTE: blueprint_template, blueprint, and blueprint_construction are intentionally
177
+ // excluded from the export flow — they are runtime-only tables not exported as metadata.
177
178
  'relation_provision',
178
179
  'entity_type_provision',
179
180
  'rate_limits_module',
@@ -188,7 +189,9 @@ export const META_TABLE_ORDER = [
188
189
  'session_secrets_module',
189
190
  'config_secrets_org_module',
190
191
  'webauthn_auth_module',
191
- 'webauthn_credentials_module'
192
+ 'webauthn_credentials_module',
193
+ 'inference_log_module',
194
+ 'rate_limit_meters_module'
192
195
  ];
193
196
  /**
194
197
  * Shared metadata table configuration.
@@ -799,32 +802,45 @@ export const META_TABLE_CONFIG = {
799
802
  actor_table_id: 'uuid'
800
803
  }
801
804
  },
802
- levels_module: {
805
+ events_module: {
803
806
  schema: 'metaschema_modules_public',
804
- table: 'levels_module',
807
+ table: 'events_module',
805
808
  fields: {
806
809
  id: 'uuid',
807
810
  database_id: 'uuid',
808
811
  schema_id: 'uuid',
809
812
  private_schema_id: 'uuid',
810
- steps_table_id: 'uuid',
811
- steps_table_name: 'text',
812
- achievements_table_id: 'uuid',
813
- achievements_table_name: 'text',
813
+ events_table_id: 'uuid',
814
+ events_table_name: 'text',
815
+ event_aggregates_table_id: 'uuid',
816
+ event_aggregates_table_name: 'text',
817
+ event_types_table_id: 'uuid',
818
+ event_types_table_name: 'text',
814
819
  levels_table_id: 'uuid',
815
820
  levels_table_name: 'text',
816
821
  level_requirements_table_id: 'uuid',
817
822
  level_requirements_table_name: 'text',
818
- completed_step: 'text',
819
- incompleted_step: 'text',
820
- tg_achievement: 'text',
821
- tg_achievement_toggle: 'text',
822
- tg_achievement_toggle_boolean: 'text',
823
- tg_achievement_boolean: 'text',
824
- upsert_achievement: 'text',
825
- tg_update_achievements: 'text',
823
+ level_grants_table_id: 'uuid',
824
+ level_grants_table_name: 'text',
825
+ achievement_rewards_table_id: 'uuid',
826
+ achievement_rewards_table_name: 'text',
827
+ record_event: 'text',
828
+ remove_event: 'text',
829
+ tg_event: 'text',
830
+ tg_event_toggle: 'text',
831
+ tg_event_toggle_bool: 'text',
832
+ tg_event_bool: 'text',
833
+ upsert_aggregate: 'text',
834
+ tg_update_aggregates: 'text',
835
+ prune_events: 'text',
826
836
  steps_required: 'text',
827
837
  level_achieved: 'text',
838
+ tg_check_achievements: 'text',
839
+ grant_achievement: 'text',
840
+ tg_achievement_reward: 'text',
841
+ interval: 'text',
842
+ retention: 'text',
843
+ premake: 'int',
828
844
  prefix: 'text',
829
845
  membership_type: 'int',
830
846
  entity_table_id: 'uuid',
@@ -1064,21 +1080,7 @@ export const META_TABLE_CONFIG = {
1064
1080
  fields: 'uuid[]'
1065
1081
  }
1066
1082
  },
1067
- table_template_module: {
1068
- schema: 'metaschema_modules_public',
1069
- table: 'table_template_module',
1070
- fields: {
1071
- id: 'uuid',
1072
- database_id: 'uuid',
1073
- schema_id: 'uuid',
1074
- private_schema_id: 'uuid',
1075
- table_id: 'uuid',
1076
- owner_table_id: 'uuid',
1077
- table_name: 'text',
1078
- node_type: 'text',
1079
- data: 'jsonb'
1080
- }
1081
- },
1083
+ // NOTE: table_template_module has been removed from pgpm-modules (superseded by blueprints)
1082
1084
  secure_table_provision: {
1083
1085
  schema: 'metaschema_modules_public',
1084
1086
  table: 'secure_table_provision',
@@ -1433,6 +1435,42 @@ export const META_TABLE_CONFIG = {
1433
1435
  table_name: 'text'
1434
1436
  }
1435
1437
  },
1438
+ inference_log_module: {
1439
+ schema: 'metaschema_modules_public',
1440
+ table: 'inference_log_module',
1441
+ fields: {
1442
+ id: 'uuid',
1443
+ database_id: 'uuid',
1444
+ schema_id: 'uuid',
1445
+ private_schema_id: 'uuid',
1446
+ inference_log_table_id: 'uuid',
1447
+ inference_log_table_name: 'text',
1448
+ usage_daily_table_id: 'uuid',
1449
+ usage_daily_table_name: 'text',
1450
+ interval: 'text',
1451
+ retention: 'text',
1452
+ premake: 'int',
1453
+ prefix: 'text'
1454
+ }
1455
+ },
1456
+ rate_limit_meters_module: {
1457
+ schema: 'metaschema_modules_public',
1458
+ table: 'rate_limit_meters_module',
1459
+ fields: {
1460
+ id: 'uuid',
1461
+ database_id: 'uuid',
1462
+ schema_id: 'uuid',
1463
+ private_schema_id: 'uuid',
1464
+ rate_limit_state_table_id: 'uuid',
1465
+ rate_limit_state_table_name: 'text',
1466
+ rate_limit_overrides_table_id: 'uuid',
1467
+ rate_limit_overrides_table_name: 'text',
1468
+ rate_window_limits_table_id: 'uuid',
1469
+ rate_window_limits_table_name: 'text',
1470
+ check_rate_limit_function: 'text',
1471
+ prefix: 'text'
1472
+ }
1473
+ },
1436
1474
  spatial_relation: {
1437
1475
  schema: 'metaschema_public',
1438
1476
  table: 'spatial_relation',
package/export-utils.d.ts CHANGED
@@ -4,7 +4,7 @@ import { PgpmPackage } from '@pgpmjs/core';
4
4
  * Required extensions for database schema exports.
5
5
  * Includes native PostgreSQL extensions and pgpm modules.
6
6
  */
7
- export declare const DB_REQUIRED_EXTENSIONS: readonly ["plpgsql", "uuid-ossp", "citext", "pgcrypto", "btree_gin", "btree_gist", "pg_textsearch", "pg_trgm", "postgis", "hstore", "vector", "ltree", "metaschema-schema", "pgpm-inflection", "pgpm-uuid", "pgpm-utils", "pgpm-database-jobs", "pgpm-jwt-claims", "pgpm-stamps", "pgpm-base32", "pgpm-totp", "pgpm-types", "pgpm-ltree-helpers"];
7
+ export declare const DB_REQUIRED_EXTENSIONS: readonly ["plpgsql", "uuid-ossp", "citext", "pgcrypto", "btree_gin", "btree_gist", "pg_textsearch", "pg_trgm", "postgis", "hstore", "vector", "ltree", "metaschema-schema", "pgpm-inflection", "pgpm-utils", "pgpm-database-jobs", "pgpm-jwt-claims", "pgpm-stamps", "pgpm-base32", "pgpm-totp", "pgpm-types", "pgpm-ltree-helpers", "pgpm-partman"];
8
8
  /**
9
9
  * Required extensions for service/meta exports.
10
10
  * Includes native PostgreSQL extensions and pgpm modules for metadata management.
@@ -23,7 +23,7 @@ export declare const META_COMMON_FOOTER = "\nSET session_replication_role TO DEF
23
23
  * Ordered list of meta tables for export.
24
24
  * Tables are processed in this order to satisfy foreign key dependencies.
25
25
  */
26
- export declare const META_TABLE_ORDER: readonly ["database", "schema", "function", "table", "field", "spatial_relation", "policy", "index", "trigger", "trigger_function", "rls_function", "foreign_key_constraint", "primary_key_constraint", "unique_constraint", "check_constraint", "full_text_search", "schema_grant", "table_grant", "default_privilege", "domains", "sites", "apis", "apps", "site_modules", "site_themes", "site_metadata", "api_modules", "api_extensions", "api_schemas", "database_settings", "api_settings", "rls_settings", "cors_settings", "pubkey_settings", "webauthn_settings", "rls_module", "user_auth_module", "memberships_module", "permissions_module", "limits_module", "levels_module", "users_module", "hierarchy_module", "membership_types_module", "invites_module", "emails_module", "sessions_module", "user_state_module", "profiles_module", "config_secrets_user_module", "connected_accounts_module", "phone_numbers_module", "crypto_addresses_module", "crypto_auth_module", "field_module", "table_module", "secure_table_provision", "uuid_module", "default_ids_module", "denormalized_table_field", "table_template_module", "relation_provision", "entity_type_provision", "rate_limits_module", "storage_module", "billing_module", "billing_provider_module", "devices_module", "identity_providers_module", "notifications_module", "plans_module", "realtime_module", "session_secrets_module", "config_secrets_org_module", "webauthn_auth_module", "webauthn_credentials_module"];
26
+ export declare const META_TABLE_ORDER: readonly ["database", "schema", "function", "table", "field", "spatial_relation", "policy", "index", "trigger", "trigger_function", "rls_function", "foreign_key_constraint", "primary_key_constraint", "unique_constraint", "check_constraint", "full_text_search", "schema_grant", "table_grant", "default_privilege", "domains", "sites", "apis", "apps", "site_modules", "site_themes", "site_metadata", "api_modules", "api_extensions", "api_schemas", "database_settings", "api_settings", "rls_settings", "cors_settings", "pubkey_settings", "webauthn_settings", "rls_module", "user_auth_module", "memberships_module", "permissions_module", "limits_module", "events_module", "users_module", "hierarchy_module", "membership_types_module", "invites_module", "emails_module", "sessions_module", "user_state_module", "profiles_module", "config_secrets_user_module", "connected_accounts_module", "phone_numbers_module", "crypto_addresses_module", "crypto_auth_module", "field_module", "table_module", "secure_table_provision", "uuid_module", "default_ids_module", "denormalized_table_field", "relation_provision", "entity_type_provision", "rate_limits_module", "storage_module", "billing_module", "billing_provider_module", "devices_module", "identity_providers_module", "notifications_module", "plans_module", "realtime_module", "session_secrets_module", "config_secrets_org_module", "webauthn_auth_module", "webauthn_credentials_module", "inference_log_module", "rate_limit_meters_module"];
27
27
  export type FieldType = 'uuid' | 'uuid[]' | 'text' | 'text[]' | 'boolean' | 'image' | 'upload' | 'url' | 'jsonb' | 'jsonb[]' | 'int' | 'interval' | 'timestamptz';
28
28
  export interface TableConfig {
29
29
  schema: string;
package/export-utils.js CHANGED
@@ -31,7 +31,6 @@ exports.DB_REQUIRED_EXTENSIONS = [
31
31
  'ltree',
32
32
  'metaschema-schema',
33
33
  'pgpm-inflection',
34
- 'pgpm-uuid',
35
34
  'pgpm-utils',
36
35
  'pgpm-database-jobs',
37
36
  'pgpm-jwt-claims',
@@ -39,7 +38,8 @@ exports.DB_REQUIRED_EXTENSIONS = [
39
38
  'pgpm-base32',
40
39
  'pgpm-totp',
41
40
  'pgpm-types',
42
- 'pgpm-ltree-helpers'
41
+ 'pgpm-ltree-helpers',
42
+ 'pgpm-partman'
43
43
  ];
44
44
  /**
45
45
  * Map PostgreSQL data types to FieldType values.
@@ -159,7 +159,7 @@ exports.META_TABLE_ORDER = [
159
159
  'memberships_module',
160
160
  'permissions_module',
161
161
  'limits_module',
162
- 'levels_module',
162
+ 'events_module',
163
163
  'users_module',
164
164
  'hierarchy_module',
165
165
  'membership_types_module',
@@ -179,7 +179,8 @@ exports.META_TABLE_ORDER = [
179
179
  'uuid_module',
180
180
  'default_ids_module',
181
181
  'denormalized_table_field',
182
- 'table_template_module',
182
+ // NOTE: blueprint_template, blueprint, and blueprint_construction are intentionally
183
+ // excluded from the export flow — they are runtime-only tables not exported as metadata.
183
184
  'relation_provision',
184
185
  'entity_type_provision',
185
186
  'rate_limits_module',
@@ -194,7 +195,9 @@ exports.META_TABLE_ORDER = [
194
195
  'session_secrets_module',
195
196
  'config_secrets_org_module',
196
197
  'webauthn_auth_module',
197
- 'webauthn_credentials_module'
198
+ 'webauthn_credentials_module',
199
+ 'inference_log_module',
200
+ 'rate_limit_meters_module'
198
201
  ];
199
202
  /**
200
203
  * Shared metadata table configuration.
@@ -805,32 +808,45 @@ exports.META_TABLE_CONFIG = {
805
808
  actor_table_id: 'uuid'
806
809
  }
807
810
  },
808
- levels_module: {
811
+ events_module: {
809
812
  schema: 'metaschema_modules_public',
810
- table: 'levels_module',
813
+ table: 'events_module',
811
814
  fields: {
812
815
  id: 'uuid',
813
816
  database_id: 'uuid',
814
817
  schema_id: 'uuid',
815
818
  private_schema_id: 'uuid',
816
- steps_table_id: 'uuid',
817
- steps_table_name: 'text',
818
- achievements_table_id: 'uuid',
819
- achievements_table_name: 'text',
819
+ events_table_id: 'uuid',
820
+ events_table_name: 'text',
821
+ event_aggregates_table_id: 'uuid',
822
+ event_aggregates_table_name: 'text',
823
+ event_types_table_id: 'uuid',
824
+ event_types_table_name: 'text',
820
825
  levels_table_id: 'uuid',
821
826
  levels_table_name: 'text',
822
827
  level_requirements_table_id: 'uuid',
823
828
  level_requirements_table_name: 'text',
824
- completed_step: 'text',
825
- incompleted_step: 'text',
826
- tg_achievement: 'text',
827
- tg_achievement_toggle: 'text',
828
- tg_achievement_toggle_boolean: 'text',
829
- tg_achievement_boolean: 'text',
830
- upsert_achievement: 'text',
831
- tg_update_achievements: 'text',
829
+ level_grants_table_id: 'uuid',
830
+ level_grants_table_name: 'text',
831
+ achievement_rewards_table_id: 'uuid',
832
+ achievement_rewards_table_name: 'text',
833
+ record_event: 'text',
834
+ remove_event: 'text',
835
+ tg_event: 'text',
836
+ tg_event_toggle: 'text',
837
+ tg_event_toggle_bool: 'text',
838
+ tg_event_bool: 'text',
839
+ upsert_aggregate: 'text',
840
+ tg_update_aggregates: 'text',
841
+ prune_events: 'text',
832
842
  steps_required: 'text',
833
843
  level_achieved: 'text',
844
+ tg_check_achievements: 'text',
845
+ grant_achievement: 'text',
846
+ tg_achievement_reward: 'text',
847
+ interval: 'text',
848
+ retention: 'text',
849
+ premake: 'int',
834
850
  prefix: 'text',
835
851
  membership_type: 'int',
836
852
  entity_table_id: 'uuid',
@@ -1070,21 +1086,7 @@ exports.META_TABLE_CONFIG = {
1070
1086
  fields: 'uuid[]'
1071
1087
  }
1072
1088
  },
1073
- table_template_module: {
1074
- schema: 'metaschema_modules_public',
1075
- table: 'table_template_module',
1076
- fields: {
1077
- id: 'uuid',
1078
- database_id: 'uuid',
1079
- schema_id: 'uuid',
1080
- private_schema_id: 'uuid',
1081
- table_id: 'uuid',
1082
- owner_table_id: 'uuid',
1083
- table_name: 'text',
1084
- node_type: 'text',
1085
- data: 'jsonb'
1086
- }
1087
- },
1089
+ // NOTE: table_template_module has been removed from pgpm-modules (superseded by blueprints)
1088
1090
  secure_table_provision: {
1089
1091
  schema: 'metaschema_modules_public',
1090
1092
  table: 'secure_table_provision',
@@ -1439,6 +1441,42 @@ exports.META_TABLE_CONFIG = {
1439
1441
  table_name: 'text'
1440
1442
  }
1441
1443
  },
1444
+ inference_log_module: {
1445
+ schema: 'metaschema_modules_public',
1446
+ table: 'inference_log_module',
1447
+ fields: {
1448
+ id: 'uuid',
1449
+ database_id: 'uuid',
1450
+ schema_id: 'uuid',
1451
+ private_schema_id: 'uuid',
1452
+ inference_log_table_id: 'uuid',
1453
+ inference_log_table_name: 'text',
1454
+ usage_daily_table_id: 'uuid',
1455
+ usage_daily_table_name: 'text',
1456
+ interval: 'text',
1457
+ retention: 'text',
1458
+ premake: 'int',
1459
+ prefix: 'text'
1460
+ }
1461
+ },
1462
+ rate_limit_meters_module: {
1463
+ schema: 'metaschema_modules_public',
1464
+ table: 'rate_limit_meters_module',
1465
+ fields: {
1466
+ id: 'uuid',
1467
+ database_id: 'uuid',
1468
+ schema_id: 'uuid',
1469
+ private_schema_id: 'uuid',
1470
+ rate_limit_state_table_id: 'uuid',
1471
+ rate_limit_state_table_name: 'text',
1472
+ rate_limit_overrides_table_id: 'uuid',
1473
+ rate_limit_overrides_table_name: 'text',
1474
+ rate_window_limits_table_id: 'uuid',
1475
+ rate_window_limits_table_name: 'text',
1476
+ check_rate_limit_function: 'text',
1477
+ prefix: 'text'
1478
+ }
1479
+ },
1442
1480
  spatial_relation: {
1443
1481
  schema: 'metaschema_public',
1444
1482
  table: 'spatial_relation',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pgpmjs/export",
3
- "version": "0.16.0",
3
+ "version": "0.17.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "PGPM export tools for SQL and GraphQL database migration extraction",
6
6
  "main": "index.js",
@@ -41,11 +41,11 @@
41
41
  "@pgsql/types": "^17.6.2",
42
42
  "@types/pg": "^8.18.0",
43
43
  "makage": "^0.3.0",
44
- "pgsql-test": "^4.14.1"
44
+ "pgsql-test": "^4.14.2"
45
45
  },
46
46
  "dependencies": {
47
- "@pgpmjs/core": "^6.18.1",
48
- "@pgpmjs/migrate-client": "^0.13.4",
47
+ "@pgpmjs/core": "^6.19.0",
48
+ "@pgpmjs/migrate-client": "^0.13.5",
49
49
  "@pgpmjs/types": "^2.27.0",
50
50
  "csv-to-pg": "^3.17.0",
51
51
  "glob": "^13.0.6",
@@ -55,5 +55,5 @@
55
55
  "pg-cache": "^3.10.0",
56
56
  "pg-env": "^1.14.0"
57
57
  },
58
- "gitHead": "1aaafe14a8ba4eeeaab099f5fdc69865ce4e2a2e"
58
+ "gitHead": "7b7c25cb21fd0e97c2ab3c94b994b0ca89bd3247"
59
59
  }