@pgpmjs/export 0.10.2 → 0.11.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 +7 -1
- package/esm/export-meta.js +6 -0
- package/esm/export-utils.js +108 -0
- package/export-graphql-meta.js +7 -1
- package/export-meta.js +6 -0
- package/export-utils.d.ts +1 -1
- package/export-utils.js +108 -0
- package/package.json +3 -3
|
@@ -116,7 +116,13 @@ export const exportGraphQLMeta = async ({ client, database_id }) => {
|
|
|
116
116
|
queryAndParse('site_metadata'),
|
|
117
117
|
queryAndParse('api_modules'),
|
|
118
118
|
queryAndParse('api_extensions'),
|
|
119
|
-
queryAndParse('api_schemas')
|
|
119
|
+
queryAndParse('api_schemas'),
|
|
120
|
+
queryAndParse('database_settings'),
|
|
121
|
+
queryAndParse('api_settings'),
|
|
122
|
+
queryAndParse('rls_settings'),
|
|
123
|
+
queryAndParse('cors_settings'),
|
|
124
|
+
queryAndParse('pubkey_settings'),
|
|
125
|
+
queryAndParse('webauthn_settings')
|
|
120
126
|
]);
|
|
121
127
|
// metaschema_modules_public tables
|
|
122
128
|
await Promise.all([
|
package/esm/export-meta.js
CHANGED
|
@@ -129,6 +129,12 @@ export const exportMeta = async ({ opts, dbname, database_id }) => {
|
|
|
129
129
|
await queryAndParse('api_modules', `SELECT * FROM services_public.api_modules WHERE database_id = $1 ORDER BY id`);
|
|
130
130
|
await queryAndParse('api_extensions', `SELECT * FROM services_public.api_extensions WHERE database_id = $1 ORDER BY id`);
|
|
131
131
|
await queryAndParse('api_schemas', `SELECT * FROM services_public.api_schemas WHERE database_id = $1 ORDER BY id`);
|
|
132
|
+
await queryAndParse('database_settings', `SELECT * FROM services_public.database_settings WHERE database_id = $1 ORDER BY id`);
|
|
133
|
+
await queryAndParse('api_settings', `SELECT * FROM services_public.api_settings WHERE database_id = $1 ORDER BY id`);
|
|
134
|
+
await queryAndParse('rls_settings', `SELECT * FROM services_public.rls_settings WHERE database_id = $1 ORDER BY id`);
|
|
135
|
+
await queryAndParse('cors_settings', `SELECT * FROM services_public.cors_settings WHERE database_id = $1 ORDER BY id`);
|
|
136
|
+
await queryAndParse('pubkey_settings', `SELECT * FROM services_public.pubkey_settings WHERE database_id = $1 ORDER BY id`);
|
|
137
|
+
await queryAndParse('webauthn_settings', `SELECT * FROM services_public.webauthn_settings WHERE database_id = $1 ORDER BY id`);
|
|
132
138
|
// =============================================================================
|
|
133
139
|
// metaschema_modules_public tables
|
|
134
140
|
// =============================================================================
|
package/esm/export-utils.js
CHANGED
|
@@ -140,6 +140,12 @@ export const META_TABLE_ORDER = [
|
|
|
140
140
|
'api_modules',
|
|
141
141
|
'api_extensions',
|
|
142
142
|
'api_schemas',
|
|
143
|
+
'database_settings',
|
|
144
|
+
'api_settings',
|
|
145
|
+
'rls_settings',
|
|
146
|
+
'cors_settings',
|
|
147
|
+
'pubkey_settings',
|
|
148
|
+
'webauthn_settings',
|
|
143
149
|
'rls_module',
|
|
144
150
|
'user_auth_module',
|
|
145
151
|
'memberships_module',
|
|
@@ -536,6 +542,108 @@ export const META_TABLE_CONFIG = {
|
|
|
536
542
|
api_id: 'uuid'
|
|
537
543
|
}
|
|
538
544
|
},
|
|
545
|
+
database_settings: {
|
|
546
|
+
schema: 'services_public',
|
|
547
|
+
table: 'database_settings',
|
|
548
|
+
fields: {
|
|
549
|
+
id: 'uuid',
|
|
550
|
+
database_id: 'uuid',
|
|
551
|
+
enable_aggregates: 'boolean',
|
|
552
|
+
enable_postgis: 'boolean',
|
|
553
|
+
enable_search: 'boolean',
|
|
554
|
+
enable_direct_uploads: 'boolean',
|
|
555
|
+
enable_presigned_uploads: 'boolean',
|
|
556
|
+
enable_many_to_many: 'boolean',
|
|
557
|
+
enable_connection_filter: 'boolean',
|
|
558
|
+
enable_ltree: 'boolean',
|
|
559
|
+
enable_llm: 'boolean',
|
|
560
|
+
options: 'jsonb'
|
|
561
|
+
}
|
|
562
|
+
},
|
|
563
|
+
api_settings: {
|
|
564
|
+
schema: 'services_public',
|
|
565
|
+
table: 'api_settings',
|
|
566
|
+
fields: {
|
|
567
|
+
id: 'uuid',
|
|
568
|
+
database_id: 'uuid',
|
|
569
|
+
api_id: 'uuid',
|
|
570
|
+
enable_aggregates: 'boolean',
|
|
571
|
+
enable_postgis: 'boolean',
|
|
572
|
+
enable_search: 'boolean',
|
|
573
|
+
enable_direct_uploads: 'boolean',
|
|
574
|
+
enable_presigned_uploads: 'boolean',
|
|
575
|
+
enable_many_to_many: 'boolean',
|
|
576
|
+
enable_connection_filter: 'boolean',
|
|
577
|
+
enable_ltree: 'boolean',
|
|
578
|
+
enable_llm: 'boolean',
|
|
579
|
+
options: 'jsonb'
|
|
580
|
+
}
|
|
581
|
+
},
|
|
582
|
+
rls_settings: {
|
|
583
|
+
schema: 'services_public',
|
|
584
|
+
table: 'rls_settings',
|
|
585
|
+
fields: {
|
|
586
|
+
id: 'uuid',
|
|
587
|
+
database_id: 'uuid',
|
|
588
|
+
authenticate_schema_id: 'uuid',
|
|
589
|
+
role_schema_id: 'uuid',
|
|
590
|
+
authenticate_function_id: 'uuid',
|
|
591
|
+
authenticate_strict_function_id: 'uuid',
|
|
592
|
+
current_role_function_id: 'uuid',
|
|
593
|
+
current_role_id_function_id: 'uuid',
|
|
594
|
+
current_user_agent_function_id: 'uuid',
|
|
595
|
+
current_ip_address_function_id: 'uuid'
|
|
596
|
+
}
|
|
597
|
+
},
|
|
598
|
+
cors_settings: {
|
|
599
|
+
schema: 'services_public',
|
|
600
|
+
table: 'cors_settings',
|
|
601
|
+
fields: {
|
|
602
|
+
id: 'uuid',
|
|
603
|
+
database_id: 'uuid',
|
|
604
|
+
api_id: 'uuid',
|
|
605
|
+
allowed_origins: 'text[]'
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
pubkey_settings: {
|
|
609
|
+
schema: 'services_public',
|
|
610
|
+
table: 'pubkey_settings',
|
|
611
|
+
fields: {
|
|
612
|
+
id: 'uuid',
|
|
613
|
+
database_id: 'uuid',
|
|
614
|
+
schema_id: 'uuid',
|
|
615
|
+
crypto_network: 'text',
|
|
616
|
+
user_field: 'text',
|
|
617
|
+
sign_up_with_key_function_id: 'uuid',
|
|
618
|
+
sign_in_request_challenge_function_id: 'uuid',
|
|
619
|
+
sign_in_record_failure_function_id: 'uuid',
|
|
620
|
+
sign_in_with_challenge_function_id: 'uuid'
|
|
621
|
+
}
|
|
622
|
+
},
|
|
623
|
+
webauthn_settings: {
|
|
624
|
+
schema: 'services_public',
|
|
625
|
+
table: 'webauthn_settings',
|
|
626
|
+
fields: {
|
|
627
|
+
id: 'uuid',
|
|
628
|
+
database_id: 'uuid',
|
|
629
|
+
schema_id: 'uuid',
|
|
630
|
+
credentials_schema_id: 'uuid',
|
|
631
|
+
sessions_schema_id: 'uuid',
|
|
632
|
+
session_secrets_schema_id: 'uuid',
|
|
633
|
+
credentials_table_id: 'uuid',
|
|
634
|
+
sessions_table_id: 'uuid',
|
|
635
|
+
session_credentials_table_id: 'uuid',
|
|
636
|
+
session_secrets_table_id: 'uuid',
|
|
637
|
+
user_field_id: 'uuid',
|
|
638
|
+
rp_id: 'text',
|
|
639
|
+
rp_name: 'text',
|
|
640
|
+
origin_allowlist: 'text[]',
|
|
641
|
+
attestation_type: 'text',
|
|
642
|
+
require_user_verification: 'boolean',
|
|
643
|
+
resident_key: 'text',
|
|
644
|
+
challenge_expiry_seconds: 'int'
|
|
645
|
+
}
|
|
646
|
+
},
|
|
539
647
|
// =============================================================================
|
|
540
648
|
// metaschema_modules_public tables
|
|
541
649
|
// =============================================================================
|
package/export-graphql-meta.js
CHANGED
|
@@ -119,7 +119,13 @@ const exportGraphQLMeta = async ({ client, database_id }) => {
|
|
|
119
119
|
queryAndParse('site_metadata'),
|
|
120
120
|
queryAndParse('api_modules'),
|
|
121
121
|
queryAndParse('api_extensions'),
|
|
122
|
-
queryAndParse('api_schemas')
|
|
122
|
+
queryAndParse('api_schemas'),
|
|
123
|
+
queryAndParse('database_settings'),
|
|
124
|
+
queryAndParse('api_settings'),
|
|
125
|
+
queryAndParse('rls_settings'),
|
|
126
|
+
queryAndParse('cors_settings'),
|
|
127
|
+
queryAndParse('pubkey_settings'),
|
|
128
|
+
queryAndParse('webauthn_settings')
|
|
123
129
|
]);
|
|
124
130
|
// metaschema_modules_public tables
|
|
125
131
|
await Promise.all([
|
package/export-meta.js
CHANGED
|
@@ -132,6 +132,12 @@ const exportMeta = async ({ opts, dbname, database_id }) => {
|
|
|
132
132
|
await queryAndParse('api_modules', `SELECT * FROM services_public.api_modules WHERE database_id = $1 ORDER BY id`);
|
|
133
133
|
await queryAndParse('api_extensions', `SELECT * FROM services_public.api_extensions WHERE database_id = $1 ORDER BY id`);
|
|
134
134
|
await queryAndParse('api_schemas', `SELECT * FROM services_public.api_schemas WHERE database_id = $1 ORDER BY id`);
|
|
135
|
+
await queryAndParse('database_settings', `SELECT * FROM services_public.database_settings WHERE database_id = $1 ORDER BY id`);
|
|
136
|
+
await queryAndParse('api_settings', `SELECT * FROM services_public.api_settings WHERE database_id = $1 ORDER BY id`);
|
|
137
|
+
await queryAndParse('rls_settings', `SELECT * FROM services_public.rls_settings WHERE database_id = $1 ORDER BY id`);
|
|
138
|
+
await queryAndParse('cors_settings', `SELECT * FROM services_public.cors_settings WHERE database_id = $1 ORDER BY id`);
|
|
139
|
+
await queryAndParse('pubkey_settings', `SELECT * FROM services_public.pubkey_settings WHERE database_id = $1 ORDER BY id`);
|
|
140
|
+
await queryAndParse('webauthn_settings', `SELECT * FROM services_public.webauthn_settings WHERE database_id = $1 ORDER BY id`);
|
|
135
141
|
// =============================================================================
|
|
136
142
|
// metaschema_modules_public tables
|
|
137
143
|
// =============================================================================
|
package/export-utils.d.ts
CHANGED
|
@@ -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", "table", "field", "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", "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", "secrets_module", "profiles_module", "encrypted_secrets_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"];
|
|
26
|
+
export declare const META_TABLE_ORDER: readonly ["database", "schema", "table", "field", "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", "secrets_module", "profiles_module", "encrypted_secrets_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"];
|
|
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
|
@@ -146,6 +146,12 @@ exports.META_TABLE_ORDER = [
|
|
|
146
146
|
'api_modules',
|
|
147
147
|
'api_extensions',
|
|
148
148
|
'api_schemas',
|
|
149
|
+
'database_settings',
|
|
150
|
+
'api_settings',
|
|
151
|
+
'rls_settings',
|
|
152
|
+
'cors_settings',
|
|
153
|
+
'pubkey_settings',
|
|
154
|
+
'webauthn_settings',
|
|
149
155
|
'rls_module',
|
|
150
156
|
'user_auth_module',
|
|
151
157
|
'memberships_module',
|
|
@@ -542,6 +548,108 @@ exports.META_TABLE_CONFIG = {
|
|
|
542
548
|
api_id: 'uuid'
|
|
543
549
|
}
|
|
544
550
|
},
|
|
551
|
+
database_settings: {
|
|
552
|
+
schema: 'services_public',
|
|
553
|
+
table: 'database_settings',
|
|
554
|
+
fields: {
|
|
555
|
+
id: 'uuid',
|
|
556
|
+
database_id: 'uuid',
|
|
557
|
+
enable_aggregates: 'boolean',
|
|
558
|
+
enable_postgis: 'boolean',
|
|
559
|
+
enable_search: 'boolean',
|
|
560
|
+
enable_direct_uploads: 'boolean',
|
|
561
|
+
enable_presigned_uploads: 'boolean',
|
|
562
|
+
enable_many_to_many: 'boolean',
|
|
563
|
+
enable_connection_filter: 'boolean',
|
|
564
|
+
enable_ltree: 'boolean',
|
|
565
|
+
enable_llm: 'boolean',
|
|
566
|
+
options: 'jsonb'
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
api_settings: {
|
|
570
|
+
schema: 'services_public',
|
|
571
|
+
table: 'api_settings',
|
|
572
|
+
fields: {
|
|
573
|
+
id: 'uuid',
|
|
574
|
+
database_id: 'uuid',
|
|
575
|
+
api_id: 'uuid',
|
|
576
|
+
enable_aggregates: 'boolean',
|
|
577
|
+
enable_postgis: 'boolean',
|
|
578
|
+
enable_search: 'boolean',
|
|
579
|
+
enable_direct_uploads: 'boolean',
|
|
580
|
+
enable_presigned_uploads: 'boolean',
|
|
581
|
+
enable_many_to_many: 'boolean',
|
|
582
|
+
enable_connection_filter: 'boolean',
|
|
583
|
+
enable_ltree: 'boolean',
|
|
584
|
+
enable_llm: 'boolean',
|
|
585
|
+
options: 'jsonb'
|
|
586
|
+
}
|
|
587
|
+
},
|
|
588
|
+
rls_settings: {
|
|
589
|
+
schema: 'services_public',
|
|
590
|
+
table: 'rls_settings',
|
|
591
|
+
fields: {
|
|
592
|
+
id: 'uuid',
|
|
593
|
+
database_id: 'uuid',
|
|
594
|
+
authenticate_schema_id: 'uuid',
|
|
595
|
+
role_schema_id: 'uuid',
|
|
596
|
+
authenticate_function_id: 'uuid',
|
|
597
|
+
authenticate_strict_function_id: 'uuid',
|
|
598
|
+
current_role_function_id: 'uuid',
|
|
599
|
+
current_role_id_function_id: 'uuid',
|
|
600
|
+
current_user_agent_function_id: 'uuid',
|
|
601
|
+
current_ip_address_function_id: 'uuid'
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
cors_settings: {
|
|
605
|
+
schema: 'services_public',
|
|
606
|
+
table: 'cors_settings',
|
|
607
|
+
fields: {
|
|
608
|
+
id: 'uuid',
|
|
609
|
+
database_id: 'uuid',
|
|
610
|
+
api_id: 'uuid',
|
|
611
|
+
allowed_origins: 'text[]'
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
pubkey_settings: {
|
|
615
|
+
schema: 'services_public',
|
|
616
|
+
table: 'pubkey_settings',
|
|
617
|
+
fields: {
|
|
618
|
+
id: 'uuid',
|
|
619
|
+
database_id: 'uuid',
|
|
620
|
+
schema_id: 'uuid',
|
|
621
|
+
crypto_network: 'text',
|
|
622
|
+
user_field: 'text',
|
|
623
|
+
sign_up_with_key_function_id: 'uuid',
|
|
624
|
+
sign_in_request_challenge_function_id: 'uuid',
|
|
625
|
+
sign_in_record_failure_function_id: 'uuid',
|
|
626
|
+
sign_in_with_challenge_function_id: 'uuid'
|
|
627
|
+
}
|
|
628
|
+
},
|
|
629
|
+
webauthn_settings: {
|
|
630
|
+
schema: 'services_public',
|
|
631
|
+
table: 'webauthn_settings',
|
|
632
|
+
fields: {
|
|
633
|
+
id: 'uuid',
|
|
634
|
+
database_id: 'uuid',
|
|
635
|
+
schema_id: 'uuid',
|
|
636
|
+
credentials_schema_id: 'uuid',
|
|
637
|
+
sessions_schema_id: 'uuid',
|
|
638
|
+
session_secrets_schema_id: 'uuid',
|
|
639
|
+
credentials_table_id: 'uuid',
|
|
640
|
+
sessions_table_id: 'uuid',
|
|
641
|
+
session_credentials_table_id: 'uuid',
|
|
642
|
+
session_secrets_table_id: 'uuid',
|
|
643
|
+
user_field_id: 'uuid',
|
|
644
|
+
rp_id: 'text',
|
|
645
|
+
rp_name: 'text',
|
|
646
|
+
origin_allowlist: 'text[]',
|
|
647
|
+
attestation_type: 'text',
|
|
648
|
+
require_user_verification: 'boolean',
|
|
649
|
+
resident_key: 'text',
|
|
650
|
+
challenge_expiry_seconds: 'int'
|
|
651
|
+
}
|
|
652
|
+
},
|
|
545
653
|
// =============================================================================
|
|
546
654
|
// metaschema_modules_public tables
|
|
547
655
|
// =============================================================================
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgpmjs/export",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.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",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@pgpmjs/core": "^6.16.0",
|
|
48
|
-
"@pgpmjs/migrate-client": "^0.11.
|
|
48
|
+
"@pgpmjs/migrate-client": "^0.11.3",
|
|
49
49
|
"@pgpmjs/types": "^2.25.0",
|
|
50
50
|
"csv-to-pg": "^3.15.0",
|
|
51
51
|
"glob": "^13.0.6",
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"pg-cache": "^3.8.0",
|
|
56
56
|
"pg-env": "^1.12.0"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "97ec8e14f2b0855b0ee0bc732a082e1a91301b64"
|
|
59
59
|
}
|