diff --git a/packages/cli/src/lib/services/collections/settings/data-mapper.ts b/packages/cli/src/lib/services/collections/settings/data-mapper.ts index 0b93fe01..e63e5b14 100644 --- a/packages/cli/src/lib/services/collections/settings/data-mapper.ts +++ b/packages/cli/src/lib/services/collections/settings/data-mapper.ts @@ -7,6 +7,7 @@ import { LOGGER } from '../../../constants'; import { SETTINGS_COLLECTION } from './constants'; import { DirectusSettings } from './interfaces'; import { RolesIdMapperClient } from '../roles'; +import { FoldersIdMapperClient } from '../folders'; @Service() export class SettingsDataMapper extends DataMapper { @@ -22,6 +23,7 @@ export class SettingsDataMapper extends DataMapper { protected idMappers: IdMappers = { public_registration_role: Container.get(RolesIdMapperClient), + storage_default_folder: Container.get(FoldersIdMapperClient), }; constructor(@Inject(LOGGER) baseLogger: pino.Logger) { diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/dashboards.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/dashboards.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/dashboards.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/dashboards.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/flows.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/flows.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/flows.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/flows.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/folders.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/folders.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/folders.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/folders.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/operations.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/operations.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/operations.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/operations.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/panels.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/panels.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/panels.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/panels.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/permissions.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/permissions.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/permissions.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/permissions.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/policies.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/policies.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/policies.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/policies.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/presets.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/presets.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/presets.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/presets.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/roles.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/roles.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/roles.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/roles.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/settings.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/settings.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/settings.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/settings.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/translations.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/collections/translations.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/collections/translations.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/collections/translations.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/collections/directus_sync_id_map.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/collections/directus_sync_id_map.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/collections/directus_sync_id_map.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/collections/directus_sync_id_map.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/created_at.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/created_at.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/created_at.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/created_at.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/id.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/id.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/id.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/id.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/local_id.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/local_id.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/local_id.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/local_id.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/sync_id.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/sync_id.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/sync_id.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/sync_id.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/table.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/table.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/fields/directus_sync_id_map/table.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/fields/directus_sync_id_map/table.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/info.json b/packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/info.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies-reversed/snapshot/info.json rename to packages/e2e/dumps/sources/dependencies-operations-reversed/snapshot/info.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/dashboards.json b/packages/e2e/dumps/sources/dependencies-operations/collections/dashboards.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/dashboards.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/dashboards.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/flows.json b/packages/e2e/dumps/sources/dependencies-operations/collections/flows.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/flows.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/flows.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/folders.json b/packages/e2e/dumps/sources/dependencies-operations/collections/folders.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/folders.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/folders.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/operations.json b/packages/e2e/dumps/sources/dependencies-operations/collections/operations.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/operations.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/operations.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/panels.json b/packages/e2e/dumps/sources/dependencies-operations/collections/panels.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/panels.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/panels.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/permissions.json b/packages/e2e/dumps/sources/dependencies-operations/collections/permissions.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/permissions.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/permissions.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/policies.json b/packages/e2e/dumps/sources/dependencies-operations/collections/policies.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/policies.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/policies.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/presets.json b/packages/e2e/dumps/sources/dependencies-operations/collections/presets.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/presets.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/presets.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/roles.json b/packages/e2e/dumps/sources/dependencies-operations/collections/roles.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/roles.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/roles.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/settings.json b/packages/e2e/dumps/sources/dependencies-operations/collections/settings.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/settings.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/settings.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/collections/translations.json b/packages/e2e/dumps/sources/dependencies-operations/collections/translations.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/collections/translations.json rename to packages/e2e/dumps/sources/dependencies-operations/collections/translations.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/snapshot/collections/directus_sync_id_map.json b/packages/e2e/dumps/sources/dependencies-operations/snapshot/collections/directus_sync_id_map.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/snapshot/collections/directus_sync_id_map.json rename to packages/e2e/dumps/sources/dependencies-operations/snapshot/collections/directus_sync_id_map.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/created_at.json b/packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/created_at.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/created_at.json rename to packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/created_at.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/id.json b/packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/id.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/id.json rename to packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/id.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/local_id.json b/packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/local_id.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/local_id.json rename to packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/local_id.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/sync_id.json b/packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/sync_id.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/sync_id.json rename to packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/sync_id.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/table.json b/packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/table.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/snapshot/fields/directus_sync_id_map/table.json rename to packages/e2e/dumps/sources/dependencies-operations/snapshot/fields/directus_sync_id_map/table.json diff --git a/packages/e2e/dumps/sources/multiple-dependencies/snapshot/info.json b/packages/e2e/dumps/sources/dependencies-operations/snapshot/info.json similarity index 100% rename from packages/e2e/dumps/sources/multiple-dependencies/snapshot/info.json rename to packages/e2e/dumps/sources/dependencies-operations/snapshot/info.json diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/dashboards.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/dashboards.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/dashboards.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/flows.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/flows.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/flows.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/folders.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/folders.json new file mode 100644 index 00000000..650968a4 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/folders.json @@ -0,0 +1,7 @@ +[ + { + "name": "derideo vulticulus", + "parent": null, + "_syncId": "92d60c0c-30b8-49d9-bd63-11008fa652af" + } +] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/operations.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/operations.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/operations.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/panels.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/panels.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/panels.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/permissions.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/permissions.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/permissions.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/policies.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/policies.json new file mode 100644 index 00000000..e9ddc251 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/policies.json @@ -0,0 +1,34 @@ +[ + { + "name": "Administrator", + "icon": "verified", + "description": "$t:admin_description", + "ip_access": null, + "enforce_tfa": false, + "admin_access": true, + "app_access": true, + "roles": [ + { + "role": "_sync_default_admin_role", + "sort": null + } + ], + "_syncId": "_sync_default_admin_policy" + }, + { + "name": "$t:public_label", + "icon": "public", + "description": "$t:public_description", + "ip_access": null, + "enforce_tfa": false, + "admin_access": false, + "app_access": false, + "roles": [ + { + "role": null, + "sort": 1 + } + ], + "_syncId": "_sync_default_public_policy" + } +] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/presets.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/presets.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/presets.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/roles.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/roles.json new file mode 100644 index 00000000..4973cd84 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/roles.json @@ -0,0 +1,9 @@ +[ + { + "name": "Administrator", + "icon": "verified", + "description": "$t:admin_description", + "parent": null, + "_syncId": "_sync_default_admin_role" + } +] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/settings.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/settings.json new file mode 100644 index 00000000..0b22ce2a --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/settings.json @@ -0,0 +1,36 @@ +[ + { + "project_name": "animadverto", + "project_color": "#6644FF", + "public_note": "Traho cognomen arcus abduco excepturi.", + "auth_login_attempts": 16, + "auth_password_policy": "/^.{8,}$/", + "storage_asset_transform": "none", + "storage_asset_presets": null, + "custom_css": "body {\n --v-button-background-color: #6644FF !important;\n}\n", + "storage_default_folder": "92d60c0c-30b8-49d9-bd63-11008fa652af", + "basemaps": null, + "mapbox_key": "p0l7oxn7yEUmthIaWYH8LKkyAI48fVg3", + "module_bar": null, + "project_descriptor": "Test project", + "default_language": "en-US", + "custom_aspect_ratios": null, + "default_appearance": "light", + "default_theme_light": "Directus Default", + "theme_light_overrides": { + "borderRadius": "2px" + }, + "default_theme_dark": null, + "theme_dark_overrides": { + "borderRadius": "1px" + }, + "report_error_url": null, + "report_bug_url": null, + "report_feature_url": null, + "public_registration": false, + "public_registration_verify_email": true, + "public_registration_role": null, + "public_registration_email_filter": null, + "_syncId": "26aa9eb5-11af-44cb-9f5b-073c55b57974" + } +] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/translations.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/translations.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/collections/translations.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/collections/directus_sync_id_map.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/collections/directus_sync_id_map.json new file mode 100644 index 00000000..a2c04373 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/collections/directus_sync_id_map.json @@ -0,0 +1,7 @@ +{ + "collection": "directus_sync_id_map", + "meta": null, + "schema": { + "name": "directus_sync_id_map" + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/created_at.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/created_at.json new file mode 100644 index 00000000..54d3e69f --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/created_at.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "created_at", + "type": "dateTime", + "meta": null, + "schema": { + "name": "created_at", + "table": "directus_sync_id_map", + "data_type": "datetime", + "default_value": "CURRENT_TIMESTAMP", + "max_length": null, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": true, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/id.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/id.json new file mode 100644 index 00000000..8407d417 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/id.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "id", + "type": "integer", + "meta": null, + "schema": { + "name": "id", + "table": "directus_sync_id_map", + "data_type": "integer", + "default_value": null, + "max_length": null, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": true, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": true, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/local_id.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/local_id.json new file mode 100644 index 00000000..211edbc2 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/local_id.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "local_id", + "type": "string", + "meta": null, + "schema": { + "name": "local_id", + "table": "directus_sync_id_map", + "data_type": "varchar", + "default_value": null, + "max_length": 255, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/sync_id.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/sync_id.json new file mode 100644 index 00000000..0f70b90d --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/sync_id.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "sync_id", + "type": "string", + "meta": null, + "schema": { + "name": "sync_id", + "table": "directus_sync_id_map", + "data_type": "varchar", + "default_value": null, + "max_length": 255, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/table.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/table.json new file mode 100644 index 00000000..b3606336 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/fields/directus_sync_id_map/table.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "table", + "type": "string", + "meta": null, + "schema": { + "name": "table", + "table": "directus_sync_id_map", + "data_type": "varchar", + "default_value": null, + "max_length": 255, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/info.json b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/info.json new file mode 100644 index 00000000..d99fbb89 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-folder/snapshot/info.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "directus": "11.1.0", + "vendor": "sqlite" +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/dashboards.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/dashboards.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/dashboards.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/flows.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/flows.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/flows.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/folders.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/folders.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/folders.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/operations.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/operations.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/operations.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/panels.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/panels.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/panels.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/permissions.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/permissions.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/permissions.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/policies.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/policies.json new file mode 100644 index 00000000..e9ddc251 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/policies.json @@ -0,0 +1,34 @@ +[ + { + "name": "Administrator", + "icon": "verified", + "description": "$t:admin_description", + "ip_access": null, + "enforce_tfa": false, + "admin_access": true, + "app_access": true, + "roles": [ + { + "role": "_sync_default_admin_role", + "sort": null + } + ], + "_syncId": "_sync_default_admin_policy" + }, + { + "name": "$t:public_label", + "icon": "public", + "description": "$t:public_description", + "ip_access": null, + "enforce_tfa": false, + "admin_access": false, + "app_access": false, + "roles": [ + { + "role": null, + "sort": 1 + } + ], + "_syncId": "_sync_default_public_policy" + } +] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/presets.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/presets.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/presets.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/roles.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/roles.json new file mode 100644 index 00000000..006f6e78 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/roles.json @@ -0,0 +1,16 @@ +[ + { + "name": "Administrator", + "icon": "verified", + "description": "$t:admin_description", + "parent": null, + "_syncId": "_sync_default_admin_role" + }, + { + "name": "capto", + "icon": "alarm_off", + "description": "Agnosco decipio tandem utor maxime calco sol enim vinculum vulgus tolero demo cogo.", + "parent": null, + "_syncId": "52183adc-3e8e-4746-abd2-ee8dfc58efd5" + } +] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/settings.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/settings.json new file mode 100644 index 00000000..d60f296c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/settings.json @@ -0,0 +1,36 @@ +[ + { + "project_name": "animadverto", + "project_color": "#6644FF", + "public_note": "Traho cognomen arcus abduco excepturi.", + "auth_login_attempts": 16, + "auth_password_policy": "/^.{8,}$/", + "storage_asset_transform": "none", + "storage_asset_presets": null, + "custom_css": "body {\n --v-button-background-color: #6644FF !important;\n}\n", + "storage_default_folder": null, + "basemaps": null, + "mapbox_key": "p0l7oxn7yEUmthIaWYH8LKkyAI48fVg3", + "module_bar": null, + "project_descriptor": "Test project", + "default_language": "en-US", + "custom_aspect_ratios": null, + "default_appearance": "light", + "default_theme_light": "Directus Default", + "theme_light_overrides": { + "borderRadius": "2px" + }, + "default_theme_dark": null, + "theme_dark_overrides": { + "borderRadius": "1px" + }, + "report_error_url": null, + "report_bug_url": null, + "report_feature_url": null, + "public_registration": false, + "public_registration_verify_email": true, + "public_registration_role": "52183adc-3e8e-4746-abd2-ee8dfc58efd5", + "public_registration_email_filter": null, + "_syncId": "26aa9eb5-11af-44cb-9f5b-073c55b57974" + } +] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/translations.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/translations.json new file mode 100644 index 00000000..fe51488c --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/collections/translations.json @@ -0,0 +1 @@ +[] diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/collections/directus_sync_id_map.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/collections/directus_sync_id_map.json new file mode 100644 index 00000000..a2c04373 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/collections/directus_sync_id_map.json @@ -0,0 +1,7 @@ +{ + "collection": "directus_sync_id_map", + "meta": null, + "schema": { + "name": "directus_sync_id_map" + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/created_at.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/created_at.json new file mode 100644 index 00000000..54d3e69f --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/created_at.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "created_at", + "type": "dateTime", + "meta": null, + "schema": { + "name": "created_at", + "table": "directus_sync_id_map", + "data_type": "datetime", + "default_value": "CURRENT_TIMESTAMP", + "max_length": null, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": true, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/id.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/id.json new file mode 100644 index 00000000..8407d417 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/id.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "id", + "type": "integer", + "meta": null, + "schema": { + "name": "id", + "table": "directus_sync_id_map", + "data_type": "integer", + "default_value": null, + "max_length": null, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": true, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": true, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/local_id.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/local_id.json new file mode 100644 index 00000000..211edbc2 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/local_id.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "local_id", + "type": "string", + "meta": null, + "schema": { + "name": "local_id", + "table": "directus_sync_id_map", + "data_type": "varchar", + "default_value": null, + "max_length": 255, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/sync_id.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/sync_id.json new file mode 100644 index 00000000..0f70b90d --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/sync_id.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "sync_id", + "type": "string", + "meta": null, + "schema": { + "name": "sync_id", + "table": "directus_sync_id_map", + "data_type": "varchar", + "default_value": null, + "max_length": 255, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/table.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/table.json new file mode 100644 index 00000000..b3606336 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/fields/directus_sync_id_map/table.json @@ -0,0 +1,23 @@ +{ + "collection": "directus_sync_id_map", + "field": "table", + "type": "string", + "meta": null, + "schema": { + "name": "table", + "table": "directus_sync_id_map", + "data_type": "varchar", + "default_value": null, + "max_length": 255, + "numeric_precision": null, + "numeric_scale": null, + "is_nullable": false, + "is_unique": false, + "is_primary_key": false, + "is_generated": false, + "generation_expression": null, + "has_auto_increment": false, + "foreign_key_table": null, + "foreign_key_column": null + } +} diff --git a/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/info.json b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/info.json new file mode 100644 index 00000000..d99fbb89 --- /dev/null +++ b/packages/e2e/dumps/sources/dependencies-settings-default-role/snapshot/info.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "directus": "11.1.0", + "vendor": "sqlite" +} diff --git a/packages/e2e/spec/dependencies/push-with-dependencies.ts b/packages/e2e/spec/dependencies/push-with-dependencies.ts index 9b722c18..e87d9609 100644 --- a/packages/e2e/spec/dependencies/push-with-dependencies.ts +++ b/packages/e2e/spec/dependencies/push-with-dependencies.ts @@ -3,18 +3,19 @@ import { getDefaultItemsCount, getSystemCollectionsNames, info, + readAllSystemCollections, } from '../helpers/index.js'; -const expectedAmount = (collection: string) => { - if (collection === 'flows') return 1; - if (collection === 'operations') return 3; - return 0; -}; - export const pushWithDependencies = (context: Context) => { - it('push with dependencies on an empty instance', async () => { + it('push with operations multiple dependencies on an empty instance', async () => { + const expectedAmount = (collection: string) => { + if (collection === 'flows') return 1; + if (collection === 'operations') return 3; + return 0; + }; + // Init sync client - const sync = await context.getSync('sources/multiple-dependencies'); + const sync = await context.getSync('sources/dependencies-operations'); const directus = context.getDirectus(); const collections = getSystemCollectionsNames(); @@ -87,4 +88,43 @@ export const pushWithDependencies = (context: Context) => { expect(pushOutput).not.toContain(info(`[${collection}] Deleted 1 items`)); } }); + + it('push with settings dependencies on an empty instance', async () => { + // Init sync client + const sync = await context.getSync( + 'sources/dependencies-settings-default-folder', + ); + const directus = context.getDirectus(); + const client = directus.get(); + + const pushOutput = await sync.push(); + expect(pushOutput).toContain(info('[snapshot] No changes to apply')); + expect(pushOutput).toContain(info('[folders] Created 1 items')); + expect(pushOutput).toContain(info('[settings] Created 1 items')); + + const { settings, folders } = await readAllSystemCollections(client); + expect(settings.length).toEqual(1); + expect(folders.length).toEqual(1); + expect(settings[0]?.storage_default_folder).toBeDefined(); + expect(settings[0]?.storage_default_folder).toEqual(folders[0]?.id); + }); + + it('push with settings dependencies on an empty instance', async () => { + // Init sync client + const sync = await context.getSync( + 'sources/dependencies-settings-default-role', + ); + const directus = context.getDirectus(); + const client = directus.get(); + + const pushOutput = await sync.push(); + expect(pushOutput).toContain(info('[snapshot] No changes to apply')); + expect(pushOutput).toContain(info('[roles] Created 1 items')); + expect(pushOutput).toContain(info('[settings] Created 1 items')); + + const { settings, roles } = await readAllSystemCollections(client); + expect(settings.length).toEqual(1); + expect(roles.length).toEqual(1); + expect(settings[0]?.public_registration_role).toEqual(roles[0]?.id); + }); }; diff --git a/packages/e2e/spec/helpers/sdk/interfaces/collections.ts b/packages/e2e/spec/helpers/sdk/interfaces/collections.ts index 5a0052ce..4f5f6f46 100644 --- a/packages/e2e/spec/helpers/sdk/interfaces/collections.ts +++ b/packages/e2e/spec/helpers/sdk/interfaces/collections.ts @@ -14,6 +14,7 @@ import { } from '@directus/sdk'; import { FixPolicy } from './policy'; import { FixPermission } from './permissions'; +import { FixSettings } from './settings'; export type DirectusId = number | string; export type Schema = object; @@ -41,7 +42,7 @@ export interface SystemCollectionsTypes { policies: FixPolicy>; presets: DirectusPreset; roles: DirectusRole; - settings: DirectusSettings; + settings: FixSettings>; translations: DirectusTranslation; } diff --git a/packages/e2e/spec/helpers/sdk/interfaces/index.ts b/packages/e2e/spec/helpers/sdk/interfaces/index.ts index 010b1ee6..6c2cc3d6 100644 --- a/packages/e2e/spec/helpers/sdk/interfaces/index.ts +++ b/packages/e2e/spec/helpers/sdk/interfaces/index.ts @@ -4,4 +4,5 @@ export * from './directus-sync-args.js'; export * from './collections.js'; export * from './permissions.js'; export * from './policy.js'; +export * from './settings.js'; export * from './extra.js'; diff --git a/packages/e2e/spec/helpers/sdk/interfaces/settings.ts b/packages/e2e/spec/helpers/sdk/interfaces/settings.ts new file mode 100644 index 00000000..3087d421 --- /dev/null +++ b/packages/e2e/spec/helpers/sdk/interfaces/settings.ts @@ -0,0 +1,4 @@ +// TODO: remove this once it is fixed in the SDK +export type FixSettings = T & { + public_registration_role: string | null; +}; diff --git a/packages/e2e/spec/helpers/utils/batch.ts b/packages/e2e/spec/helpers/utils/batch.ts index b48b5f8b..fc421acc 100644 --- a/packages/e2e/spec/helpers/utils/batch.ts +++ b/packages/e2e/spec/helpers/utils/batch.ts @@ -60,6 +60,7 @@ import { DirectusSettingsExtra, FixPermission, FixPolicy, + FixSettings, notDefaultPolicies, notDefaultRoles, notNullId, @@ -215,7 +216,9 @@ export async function readAllSystemCollections( policies: keepDefault ? policies : policies.filter(notDefaultPolicies), presets: await client.request(readPresets()), roles: keepDefault ? roles : roles.filter(notDefaultRoles), - settings: [await client.request(readSettings())].filter(notNullId), + settings: [await client.request(readSettings())].filter( + notNullId, + ) as unknown as FixSettings>[], translations: await client.request(readTranslations()), }; } diff --git a/packages/e2e/spec/operations/create-operations-with-conflicts.ts b/packages/e2e/spec/operations/create-operations-with-conflicts.ts index a5c79fb2..5b1cc31c 100644 --- a/packages/e2e/spec/operations/create-operations-with-conflicts.ts +++ b/packages/e2e/spec/operations/create-operations-with-conflicts.ts @@ -12,7 +12,7 @@ type OperationFromJson = SystemCollectionsContentWithSyncId['operations'][0]; export const createOperationsWithConflicts = (context: Context) => { it('create an operation that conflicts with other', async () => { // Init sync client - const sync = await context.getSync('sources/multiple-dependencies'); + const sync = await context.getSync('sources/dependencies-operations'); const directus = context.getDirectus(); const client = directus.get(); await sync.push(); diff --git a/packages/e2e/spec/operations/update-operations-with-conflicts.ts b/packages/e2e/spec/operations/update-operations-with-conflicts.ts index a8e808b9..d846441a 100644 --- a/packages/e2e/spec/operations/update-operations-with-conflicts.ts +++ b/packages/e2e/spec/operations/update-operations-with-conflicts.ts @@ -3,14 +3,14 @@ import { Context, info } from '../helpers/index.js'; export const updateOperationsWithConflicts = (context: Context) => { it('reverse 2 operations conflicts', async () => { // Init sync client - const syncInit = await context.getSync('sources/multiple-dependencies'); + const syncInit = await context.getSync('sources/dependencies-operations'); const directus = context.getDirectus(); await syncInit.push(); const beforePushDate = new Date(); const sync = await context.getSync( - 'sources/multiple-dependencies-reversed', + 'sources/dependencies-operations-reversed', ); const output = await sync.push();