@pgpmjs/export 0.15.3 → 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.
- package/esm/export-graphql-meta.js +3 -2
- package/esm/export-meta.js +3 -2
- package/esm/export-utils.js +90 -40
- package/export-graphql-meta.js +3 -2
- package/export-meta.js +3 -2
- package/export-utils.d.ts +2 -2
- package/export-utils.js +90 -40
- package/package.json +5 -5
|
@@ -139,9 +139,9 @@ export const exportGraphQLMeta = async ({ client, database_id }) => {
|
|
|
139
139
|
queryAndParse('invites_module'),
|
|
140
140
|
queryAndParse('emails_module'),
|
|
141
141
|
queryAndParse('sessions_module'),
|
|
142
|
-
queryAndParse('
|
|
142
|
+
queryAndParse('user_state_module'),
|
|
143
143
|
queryAndParse('profiles_module'),
|
|
144
|
-
queryAndParse('
|
|
144
|
+
queryAndParse('config_secrets_user_module'),
|
|
145
145
|
queryAndParse('connected_accounts_module'),
|
|
146
146
|
queryAndParse('phone_numbers_module'),
|
|
147
147
|
queryAndParse('crypto_addresses_module'),
|
|
@@ -165,6 +165,7 @@ export const exportGraphQLMeta = async ({ client, database_id }) => {
|
|
|
165
165
|
queryAndParse('plans_module'),
|
|
166
166
|
queryAndParse('realtime_module'),
|
|
167
167
|
queryAndParse('session_secrets_module'),
|
|
168
|
+
queryAndParse('config_secrets_org_module'),
|
|
168
169
|
queryAndParse('webauthn_auth_module'),
|
|
169
170
|
queryAndParse('webauthn_credentials_module')
|
|
170
171
|
]);
|
package/esm/export-meta.js
CHANGED
|
@@ -151,9 +151,9 @@ export const exportMeta = async ({ opts, dbname, database_id }) => {
|
|
|
151
151
|
await queryAndParse('invites_module', `SELECT * FROM metaschema_modules_public.invites_module WHERE database_id = $1 ORDER BY id`);
|
|
152
152
|
await queryAndParse('emails_module', `SELECT * FROM metaschema_modules_public.emails_module WHERE database_id = $1 ORDER BY id`);
|
|
153
153
|
await queryAndParse('sessions_module', `SELECT * FROM metaschema_modules_public.sessions_module WHERE database_id = $1 ORDER BY id`);
|
|
154
|
-
await queryAndParse('
|
|
154
|
+
await queryAndParse('user_state_module', `SELECT * FROM metaschema_modules_public.user_state_module WHERE database_id = $1 ORDER BY id`);
|
|
155
155
|
await queryAndParse('profiles_module', `SELECT * FROM metaschema_modules_public.profiles_module WHERE database_id = $1 ORDER BY id`);
|
|
156
|
-
await queryAndParse('
|
|
156
|
+
await queryAndParse('config_secrets_user_module', `SELECT * FROM metaschema_modules_public.config_secrets_user_module WHERE database_id = $1 ORDER BY id`);
|
|
157
157
|
await queryAndParse('connected_accounts_module', `SELECT * FROM metaschema_modules_public.connected_accounts_module WHERE database_id = $1 ORDER BY id`);
|
|
158
158
|
await queryAndParse('phone_numbers_module', `SELECT * FROM metaschema_modules_public.phone_numbers_module WHERE database_id = $1 ORDER BY id`);
|
|
159
159
|
await queryAndParse('crypto_addresses_module', `SELECT * FROM metaschema_modules_public.crypto_addresses_module WHERE database_id = $1 ORDER BY id`);
|
|
@@ -177,6 +177,7 @@ export const exportMeta = async ({ opts, dbname, database_id }) => {
|
|
|
177
177
|
await queryAndParse('plans_module', `SELECT * FROM metaschema_modules_public.plans_module WHERE database_id = $1 ORDER BY id`);
|
|
178
178
|
await queryAndParse('realtime_module', `SELECT * FROM metaschema_modules_public.realtime_module WHERE database_id = $1 ORDER BY id`);
|
|
179
179
|
await queryAndParse('session_secrets_module', `SELECT * FROM metaschema_modules_public.session_secrets_module WHERE database_id = $1 ORDER BY id`);
|
|
180
|
+
await queryAndParse('config_secrets_org_module', `SELECT * FROM metaschema_modules_public.config_secrets_org_module WHERE database_id = $1 ORDER BY id`);
|
|
180
181
|
await queryAndParse('webauthn_auth_module', `SELECT * FROM metaschema_modules_public.webauthn_auth_module WHERE database_id = $1 ORDER BY id`);
|
|
181
182
|
await queryAndParse('webauthn_credentials_module', `SELECT * FROM metaschema_modules_public.webauthn_credentials_module WHERE database_id = $1 ORDER BY id`);
|
|
182
183
|
return sql;
|
package/esm/export-utils.js
CHANGED
|
@@ -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,16 +153,16 @@ export const META_TABLE_ORDER = [
|
|
|
153
153
|
'memberships_module',
|
|
154
154
|
'permissions_module',
|
|
155
155
|
'limits_module',
|
|
156
|
-
'
|
|
156
|
+
'events_module',
|
|
157
157
|
'users_module',
|
|
158
158
|
'hierarchy_module',
|
|
159
159
|
'membership_types_module',
|
|
160
160
|
'invites_module',
|
|
161
161
|
'emails_module',
|
|
162
162
|
'sessions_module',
|
|
163
|
-
'
|
|
163
|
+
'user_state_module',
|
|
164
164
|
'profiles_module',
|
|
165
|
-
'
|
|
165
|
+
'config_secrets_user_module',
|
|
166
166
|
'connected_accounts_module',
|
|
167
167
|
'phone_numbers_module',
|
|
168
168
|
'crypto_addresses_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
|
-
|
|
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',
|
|
@@ -186,8 +187,11 @@ export const META_TABLE_ORDER = [
|
|
|
186
187
|
'plans_module',
|
|
187
188
|
'realtime_module',
|
|
188
189
|
'session_secrets_module',
|
|
190
|
+
'config_secrets_org_module',
|
|
189
191
|
'webauthn_auth_module',
|
|
190
|
-
'webauthn_credentials_module'
|
|
192
|
+
'webauthn_credentials_module',
|
|
193
|
+
'inference_log_module',
|
|
194
|
+
'rate_limit_meters_module'
|
|
191
195
|
];
|
|
192
196
|
/**
|
|
193
197
|
* Shared metadata table configuration.
|
|
@@ -798,32 +802,45 @@ export const META_TABLE_CONFIG = {
|
|
|
798
802
|
actor_table_id: 'uuid'
|
|
799
803
|
}
|
|
800
804
|
},
|
|
801
|
-
|
|
805
|
+
events_module: {
|
|
802
806
|
schema: 'metaschema_modules_public',
|
|
803
|
-
table: '
|
|
807
|
+
table: 'events_module',
|
|
804
808
|
fields: {
|
|
805
809
|
id: 'uuid',
|
|
806
810
|
database_id: 'uuid',
|
|
807
811
|
schema_id: 'uuid',
|
|
808
812
|
private_schema_id: 'uuid',
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
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',
|
|
813
819
|
levels_table_id: 'uuid',
|
|
814
820
|
levels_table_name: 'text',
|
|
815
821
|
level_requirements_table_id: 'uuid',
|
|
816
822
|
level_requirements_table_name: 'text',
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
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',
|
|
825
836
|
steps_required: 'text',
|
|
826
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',
|
|
827
844
|
prefix: 'text',
|
|
828
845
|
membership_type: 'int',
|
|
829
846
|
entity_table_id: 'uuid',
|
|
@@ -929,9 +946,9 @@ export const META_TABLE_CONFIG = {
|
|
|
929
946
|
auth_settings_table: 'text'
|
|
930
947
|
}
|
|
931
948
|
},
|
|
932
|
-
|
|
949
|
+
user_state_module: {
|
|
933
950
|
schema: 'metaschema_modules_public',
|
|
934
|
-
table: '
|
|
951
|
+
table: 'user_state_module',
|
|
935
952
|
fields: {
|
|
936
953
|
id: 'uuid',
|
|
937
954
|
database_id: 'uuid',
|
|
@@ -964,9 +981,9 @@ export const META_TABLE_CONFIG = {
|
|
|
964
981
|
prefix: 'text'
|
|
965
982
|
}
|
|
966
983
|
},
|
|
967
|
-
|
|
984
|
+
config_secrets_user_module: {
|
|
968
985
|
schema: 'metaschema_modules_public',
|
|
969
|
-
table: '
|
|
986
|
+
table: 'config_secrets_user_module',
|
|
970
987
|
fields: {
|
|
971
988
|
id: 'uuid',
|
|
972
989
|
database_id: 'uuid',
|
|
@@ -1063,21 +1080,7 @@ export const META_TABLE_CONFIG = {
|
|
|
1063
1080
|
fields: 'uuid[]'
|
|
1064
1081
|
}
|
|
1065
1082
|
},
|
|
1066
|
-
|
|
1067
|
-
schema: 'metaschema_modules_public',
|
|
1068
|
-
table: 'table_template_module',
|
|
1069
|
-
fields: {
|
|
1070
|
-
id: 'uuid',
|
|
1071
|
-
database_id: 'uuid',
|
|
1072
|
-
schema_id: 'uuid',
|
|
1073
|
-
private_schema_id: 'uuid',
|
|
1074
|
-
table_id: 'uuid',
|
|
1075
|
-
owner_table_id: 'uuid',
|
|
1076
|
-
table_name: 'text',
|
|
1077
|
-
node_type: 'text',
|
|
1078
|
-
data: 'jsonb'
|
|
1079
|
-
}
|
|
1080
|
-
},
|
|
1083
|
+
// NOTE: table_template_module has been removed from pgpm-modules (superseded by blueprints)
|
|
1081
1084
|
secure_table_provision: {
|
|
1082
1085
|
schema: 'metaschema_modules_public',
|
|
1083
1086
|
table: 'secure_table_provision',
|
|
@@ -1386,6 +1389,17 @@ export const META_TABLE_CONFIG = {
|
|
|
1386
1389
|
sessions_table_id: 'uuid'
|
|
1387
1390
|
}
|
|
1388
1391
|
},
|
|
1392
|
+
config_secrets_org_module: {
|
|
1393
|
+
schema: 'metaschema_modules_public',
|
|
1394
|
+
table: 'config_secrets_org_module',
|
|
1395
|
+
fields: {
|
|
1396
|
+
id: 'uuid',
|
|
1397
|
+
database_id: 'uuid',
|
|
1398
|
+
schema_id: 'uuid',
|
|
1399
|
+
table_id: 'uuid',
|
|
1400
|
+
table_name: 'text'
|
|
1401
|
+
}
|
|
1402
|
+
},
|
|
1389
1403
|
webauthn_auth_module: {
|
|
1390
1404
|
schema: 'metaschema_modules_public',
|
|
1391
1405
|
table: 'webauthn_auth_module',
|
|
@@ -1421,6 +1435,42 @@ export const META_TABLE_CONFIG = {
|
|
|
1421
1435
|
table_name: 'text'
|
|
1422
1436
|
}
|
|
1423
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
|
+
},
|
|
1424
1474
|
spatial_relation: {
|
|
1425
1475
|
schema: 'metaschema_public',
|
|
1426
1476
|
table: 'spatial_relation',
|
package/export-graphql-meta.js
CHANGED
|
@@ -142,9 +142,9 @@ const exportGraphQLMeta = async ({ client, database_id }) => {
|
|
|
142
142
|
queryAndParse('invites_module'),
|
|
143
143
|
queryAndParse('emails_module'),
|
|
144
144
|
queryAndParse('sessions_module'),
|
|
145
|
-
queryAndParse('
|
|
145
|
+
queryAndParse('user_state_module'),
|
|
146
146
|
queryAndParse('profiles_module'),
|
|
147
|
-
queryAndParse('
|
|
147
|
+
queryAndParse('config_secrets_user_module'),
|
|
148
148
|
queryAndParse('connected_accounts_module'),
|
|
149
149
|
queryAndParse('phone_numbers_module'),
|
|
150
150
|
queryAndParse('crypto_addresses_module'),
|
|
@@ -168,6 +168,7 @@ const exportGraphQLMeta = async ({ client, database_id }) => {
|
|
|
168
168
|
queryAndParse('plans_module'),
|
|
169
169
|
queryAndParse('realtime_module'),
|
|
170
170
|
queryAndParse('session_secrets_module'),
|
|
171
|
+
queryAndParse('config_secrets_org_module'),
|
|
171
172
|
queryAndParse('webauthn_auth_module'),
|
|
172
173
|
queryAndParse('webauthn_credentials_module')
|
|
173
174
|
]);
|
package/export-meta.js
CHANGED
|
@@ -154,9 +154,9 @@ const exportMeta = async ({ opts, dbname, database_id }) => {
|
|
|
154
154
|
await queryAndParse('invites_module', `SELECT * FROM metaschema_modules_public.invites_module WHERE database_id = $1 ORDER BY id`);
|
|
155
155
|
await queryAndParse('emails_module', `SELECT * FROM metaschema_modules_public.emails_module WHERE database_id = $1 ORDER BY id`);
|
|
156
156
|
await queryAndParse('sessions_module', `SELECT * FROM metaschema_modules_public.sessions_module WHERE database_id = $1 ORDER BY id`);
|
|
157
|
-
await queryAndParse('
|
|
157
|
+
await queryAndParse('user_state_module', `SELECT * FROM metaschema_modules_public.user_state_module WHERE database_id = $1 ORDER BY id`);
|
|
158
158
|
await queryAndParse('profiles_module', `SELECT * FROM metaschema_modules_public.profiles_module WHERE database_id = $1 ORDER BY id`);
|
|
159
|
-
await queryAndParse('
|
|
159
|
+
await queryAndParse('config_secrets_user_module', `SELECT * FROM metaschema_modules_public.config_secrets_user_module WHERE database_id = $1 ORDER BY id`);
|
|
160
160
|
await queryAndParse('connected_accounts_module', `SELECT * FROM metaschema_modules_public.connected_accounts_module WHERE database_id = $1 ORDER BY id`);
|
|
161
161
|
await queryAndParse('phone_numbers_module', `SELECT * FROM metaschema_modules_public.phone_numbers_module WHERE database_id = $1 ORDER BY id`);
|
|
162
162
|
await queryAndParse('crypto_addresses_module', `SELECT * FROM metaschema_modules_public.crypto_addresses_module WHERE database_id = $1 ORDER BY id`);
|
|
@@ -180,6 +180,7 @@ const exportMeta = async ({ opts, dbname, database_id }) => {
|
|
|
180
180
|
await queryAndParse('plans_module', `SELECT * FROM metaschema_modules_public.plans_module WHERE database_id = $1 ORDER BY id`);
|
|
181
181
|
await queryAndParse('realtime_module', `SELECT * FROM metaschema_modules_public.realtime_module WHERE database_id = $1 ORDER BY id`);
|
|
182
182
|
await queryAndParse('session_secrets_module', `SELECT * FROM metaschema_modules_public.session_secrets_module WHERE database_id = $1 ORDER BY id`);
|
|
183
|
+
await queryAndParse('config_secrets_org_module', `SELECT * FROM metaschema_modules_public.config_secrets_org_module WHERE database_id = $1 ORDER BY id`);
|
|
183
184
|
await queryAndParse('webauthn_auth_module', `SELECT * FROM metaschema_modules_public.webauthn_auth_module WHERE database_id = $1 ORDER BY id`);
|
|
184
185
|
await queryAndParse('webauthn_credentials_module', `SELECT * FROM metaschema_modules_public.webauthn_credentials_module WHERE database_id = $1 ORDER BY id`);
|
|
185
186
|
return sql;
|
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-
|
|
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", "
|
|
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,16 +159,16 @@ exports.META_TABLE_ORDER = [
|
|
|
159
159
|
'memberships_module',
|
|
160
160
|
'permissions_module',
|
|
161
161
|
'limits_module',
|
|
162
|
-
'
|
|
162
|
+
'events_module',
|
|
163
163
|
'users_module',
|
|
164
164
|
'hierarchy_module',
|
|
165
165
|
'membership_types_module',
|
|
166
166
|
'invites_module',
|
|
167
167
|
'emails_module',
|
|
168
168
|
'sessions_module',
|
|
169
|
-
'
|
|
169
|
+
'user_state_module',
|
|
170
170
|
'profiles_module',
|
|
171
|
-
'
|
|
171
|
+
'config_secrets_user_module',
|
|
172
172
|
'connected_accounts_module',
|
|
173
173
|
'phone_numbers_module',
|
|
174
174
|
'crypto_addresses_module',
|
|
@@ -179,7 +179,8 @@ exports.META_TABLE_ORDER = [
|
|
|
179
179
|
'uuid_module',
|
|
180
180
|
'default_ids_module',
|
|
181
181
|
'denormalized_table_field',
|
|
182
|
-
|
|
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',
|
|
@@ -192,8 +193,11 @@ exports.META_TABLE_ORDER = [
|
|
|
192
193
|
'plans_module',
|
|
193
194
|
'realtime_module',
|
|
194
195
|
'session_secrets_module',
|
|
196
|
+
'config_secrets_org_module',
|
|
195
197
|
'webauthn_auth_module',
|
|
196
|
-
'webauthn_credentials_module'
|
|
198
|
+
'webauthn_credentials_module',
|
|
199
|
+
'inference_log_module',
|
|
200
|
+
'rate_limit_meters_module'
|
|
197
201
|
];
|
|
198
202
|
/**
|
|
199
203
|
* Shared metadata table configuration.
|
|
@@ -804,32 +808,45 @@ exports.META_TABLE_CONFIG = {
|
|
|
804
808
|
actor_table_id: 'uuid'
|
|
805
809
|
}
|
|
806
810
|
},
|
|
807
|
-
|
|
811
|
+
events_module: {
|
|
808
812
|
schema: 'metaschema_modules_public',
|
|
809
|
-
table: '
|
|
813
|
+
table: 'events_module',
|
|
810
814
|
fields: {
|
|
811
815
|
id: 'uuid',
|
|
812
816
|
database_id: 'uuid',
|
|
813
817
|
schema_id: 'uuid',
|
|
814
818
|
private_schema_id: 'uuid',
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
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',
|
|
819
825
|
levels_table_id: 'uuid',
|
|
820
826
|
levels_table_name: 'text',
|
|
821
827
|
level_requirements_table_id: 'uuid',
|
|
822
828
|
level_requirements_table_name: 'text',
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
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',
|
|
831
842
|
steps_required: 'text',
|
|
832
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',
|
|
833
850
|
prefix: 'text',
|
|
834
851
|
membership_type: 'int',
|
|
835
852
|
entity_table_id: 'uuid',
|
|
@@ -935,9 +952,9 @@ exports.META_TABLE_CONFIG = {
|
|
|
935
952
|
auth_settings_table: 'text'
|
|
936
953
|
}
|
|
937
954
|
},
|
|
938
|
-
|
|
955
|
+
user_state_module: {
|
|
939
956
|
schema: 'metaschema_modules_public',
|
|
940
|
-
table: '
|
|
957
|
+
table: 'user_state_module',
|
|
941
958
|
fields: {
|
|
942
959
|
id: 'uuid',
|
|
943
960
|
database_id: 'uuid',
|
|
@@ -970,9 +987,9 @@ exports.META_TABLE_CONFIG = {
|
|
|
970
987
|
prefix: 'text'
|
|
971
988
|
}
|
|
972
989
|
},
|
|
973
|
-
|
|
990
|
+
config_secrets_user_module: {
|
|
974
991
|
schema: 'metaschema_modules_public',
|
|
975
|
-
table: '
|
|
992
|
+
table: 'config_secrets_user_module',
|
|
976
993
|
fields: {
|
|
977
994
|
id: 'uuid',
|
|
978
995
|
database_id: 'uuid',
|
|
@@ -1069,21 +1086,7 @@ exports.META_TABLE_CONFIG = {
|
|
|
1069
1086
|
fields: 'uuid[]'
|
|
1070
1087
|
}
|
|
1071
1088
|
},
|
|
1072
|
-
|
|
1073
|
-
schema: 'metaschema_modules_public',
|
|
1074
|
-
table: 'table_template_module',
|
|
1075
|
-
fields: {
|
|
1076
|
-
id: 'uuid',
|
|
1077
|
-
database_id: 'uuid',
|
|
1078
|
-
schema_id: 'uuid',
|
|
1079
|
-
private_schema_id: 'uuid',
|
|
1080
|
-
table_id: 'uuid',
|
|
1081
|
-
owner_table_id: 'uuid',
|
|
1082
|
-
table_name: 'text',
|
|
1083
|
-
node_type: 'text',
|
|
1084
|
-
data: 'jsonb'
|
|
1085
|
-
}
|
|
1086
|
-
},
|
|
1089
|
+
// NOTE: table_template_module has been removed from pgpm-modules (superseded by blueprints)
|
|
1087
1090
|
secure_table_provision: {
|
|
1088
1091
|
schema: 'metaschema_modules_public',
|
|
1089
1092
|
table: 'secure_table_provision',
|
|
@@ -1392,6 +1395,17 @@ exports.META_TABLE_CONFIG = {
|
|
|
1392
1395
|
sessions_table_id: 'uuid'
|
|
1393
1396
|
}
|
|
1394
1397
|
},
|
|
1398
|
+
config_secrets_org_module: {
|
|
1399
|
+
schema: 'metaschema_modules_public',
|
|
1400
|
+
table: 'config_secrets_org_module',
|
|
1401
|
+
fields: {
|
|
1402
|
+
id: 'uuid',
|
|
1403
|
+
database_id: 'uuid',
|
|
1404
|
+
schema_id: 'uuid',
|
|
1405
|
+
table_id: 'uuid',
|
|
1406
|
+
table_name: 'text'
|
|
1407
|
+
}
|
|
1408
|
+
},
|
|
1395
1409
|
webauthn_auth_module: {
|
|
1396
1410
|
schema: 'metaschema_modules_public',
|
|
1397
1411
|
table: 'webauthn_auth_module',
|
|
@@ -1427,6 +1441,42 @@ exports.META_TABLE_CONFIG = {
|
|
|
1427
1441
|
table_name: 'text'
|
|
1428
1442
|
}
|
|
1429
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
|
+
},
|
|
1430
1480
|
spatial_relation: {
|
|
1431
1481
|
schema: 'metaschema_public',
|
|
1432
1482
|
table: 'spatial_relation',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/export",
|
|
3
|
-
"version": "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.
|
|
44
|
+
"pgsql-test": "^4.14.2"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@pgpmjs/core": "^6.
|
|
48
|
-
"@pgpmjs/migrate-client": "^0.13.
|
|
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": "
|
|
58
|
+
"gitHead": "7b7c25cb21fd0e97c2ab3c94b994b0ca89bd3247"
|
|
59
59
|
}
|