diff --git a/mobile/.gitignore b/mobile/.gitignore index 6730e3c46a..7f96c9d34c 100644 --- a/mobile/.gitignore +++ b/mobile/.gitignore @@ -32,6 +32,9 @@ .pub/ /build/ lib/**/*.drift.dart +# ...except the hand-written forwarding shims that point at package:immich_data +!lib/infrastructure/entities/*.entity.drift.dart +!lib/infrastructure/repositories/*.repository.drift.dart lib/routing/router.gr.dart test/drift/main/generated/ diff --git a/mobile/lib/constants/errors.dart b/mobile/lib/constants/errors.dart new file mode 100644 index 0000000000..1f6c3cb869 --- /dev/null +++ b/mobile/lib/constants/errors.dart @@ -0,0 +1,3 @@ +// Moved to package:immich_data. Import that instead +// TODO(agg23): Remove +export 'package:immich_data/server/errors.dart'; diff --git a/mobile/lib/domain/models/album/album.model.dart b/mobile/lib/domain/models/album/album.model.dart new file mode 100644 index 0000000000..dfbcd9b0fd --- /dev/null +++ b/mobile/lib/domain/models/album/album.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/album/album.dart'; diff --git a/mobile/lib/domain/models/album/local_album.model.dart b/mobile/lib/domain/models/album/local_album.model.dart new file mode 100644 index 0000000000..5dd7557d73 --- /dev/null +++ b/mobile/lib/domain/models/album/local_album.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/album/local_album.dart'; diff --git a/mobile/lib/domain/models/asset/base_asset.model.dart b/mobile/lib/domain/models/asset/base_asset.model.dart new file mode 100644 index 0000000000..88405fcef6 --- /dev/null +++ b/mobile/lib/domain/models/asset/base_asset.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/asset/base_asset.dart'; diff --git a/mobile/lib/domain/models/asset_edit.model.dart b/mobile/lib/domain/models/asset_edit.model.dart new file mode 100644 index 0000000000..b227f1b00d --- /dev/null +++ b/mobile/lib/domain/models/asset_edit.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/asset_edit.dart'; diff --git a/mobile/lib/domain/models/exif.model.dart b/mobile/lib/domain/models/exif.model.dart new file mode 100644 index 0000000000..00b79ca95a --- /dev/null +++ b/mobile/lib/domain/models/exif.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/exif.dart'; diff --git a/mobile/lib/domain/models/log.model.dart b/mobile/lib/domain/models/log.model.dart new file mode 100644 index 0000000000..1c93fef8e2 --- /dev/null +++ b/mobile/lib/domain/models/log.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/log.dart'; diff --git a/mobile/lib/domain/models/memory.model.dart b/mobile/lib/domain/models/memory.model.dart new file mode 100644 index 0000000000..fd4057fbba --- /dev/null +++ b/mobile/lib/domain/models/memory.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/memory.dart'; diff --git a/mobile/lib/domain/models/user.model.dart b/mobile/lib/domain/models/user.model.dart new file mode 100644 index 0000000000..e3620f1cfb --- /dev/null +++ b/mobile/lib/domain/models/user.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/user/user.dart'; diff --git a/mobile/lib/domain/models/user_metadata.model.dart b/mobile/lib/domain/models/user_metadata.model.dart new file mode 100644 index 0000000000..7de4020c78 --- /dev/null +++ b/mobile/lib/domain/models/user_metadata.model.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/model/user/user_metadata.dart'; diff --git a/mobile/lib/infrastructure/entities/asset_edit.entity.dart b/mobile/lib/infrastructure/entities/asset_edit.entity.dart new file mode 100644 index 0000000000..81776db823 --- /dev/null +++ b/mobile/lib/infrastructure/entities/asset_edit.entity.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/asset_edit.dart'; diff --git a/mobile/lib/infrastructure/entities/asset_edit.entity.drift.dart b/mobile/lib/infrastructure/entities/asset_edit.entity.drift.dart new file mode 100644 index 0000000000..08324dd596 --- /dev/null +++ b/mobile/lib/infrastructure/entities/asset_edit.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/asset_edit.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/asset_face.entity.drift.dart b/mobile/lib/infrastructure/entities/asset_face.entity.drift.dart new file mode 100644 index 0000000000..016c89e58b --- /dev/null +++ b/mobile/lib/infrastructure/entities/asset_face.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/asset_face.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/asset_ocr.entity.drift.dart b/mobile/lib/infrastructure/entities/asset_ocr.entity.drift.dart new file mode 100644 index 0000000000..b134370406 --- /dev/null +++ b/mobile/lib/infrastructure/entities/asset_ocr.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/asset_ocr.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/auth_user.entity.drift.dart b/mobile/lib/infrastructure/entities/auth_user.entity.drift.dart new file mode 100644 index 0000000000..51c0b196fb --- /dev/null +++ b/mobile/lib/infrastructure/entities/auth_user.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/auth_user.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/exif.entity.dart b/mobile/lib/infrastructure/entities/exif.entity.dart new file mode 100644 index 0000000000..242aaf158c --- /dev/null +++ b/mobile/lib/infrastructure/entities/exif.entity.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/exif.dart'; diff --git a/mobile/lib/infrastructure/entities/exif.entity.drift.dart b/mobile/lib/infrastructure/entities/exif.entity.drift.dart new file mode 100644 index 0000000000..3455d98db0 --- /dev/null +++ b/mobile/lib/infrastructure/entities/exif.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/exif.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/local_album.entity.dart b/mobile/lib/infrastructure/entities/local_album.entity.dart new file mode 100644 index 0000000000..cbf8648872 --- /dev/null +++ b/mobile/lib/infrastructure/entities/local_album.entity.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/local_album.dart'; diff --git a/mobile/lib/infrastructure/entities/local_album.entity.drift.dart b/mobile/lib/infrastructure/entities/local_album.entity.drift.dart new file mode 100644 index 0000000000..73fef29020 --- /dev/null +++ b/mobile/lib/infrastructure/entities/local_album.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/local_album.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/local_album_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/local_album_asset.entity.drift.dart new file mode 100644 index 0000000000..66c546b7a5 --- /dev/null +++ b/mobile/lib/infrastructure/entities/local_album_asset.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/local_album_asset.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/local_asset.entity.dart b/mobile/lib/infrastructure/entities/local_asset.entity.dart new file mode 100644 index 0000000000..1f82865c66 --- /dev/null +++ b/mobile/lib/infrastructure/entities/local_asset.entity.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/local_asset.dart'; diff --git a/mobile/lib/infrastructure/entities/local_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/local_asset.entity.drift.dart new file mode 100644 index 0000000000..db0513f928 --- /dev/null +++ b/mobile/lib/infrastructure/entities/local_asset.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/local_asset.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/log.entity.dart b/mobile/lib/infrastructure/entities/log.entity.dart new file mode 100644 index 0000000000..e0558f0ab1 --- /dev/null +++ b/mobile/lib/infrastructure/entities/log.entity.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/log.dart'; diff --git a/mobile/lib/infrastructure/entities/log.entity.drift.dart b/mobile/lib/infrastructure/entities/log.entity.drift.dart new file mode 100644 index 0000000000..d25e922ef6 --- /dev/null +++ b/mobile/lib/infrastructure/entities/log.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/log.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/memory.entity.drift.dart b/mobile/lib/infrastructure/entities/memory.entity.drift.dart new file mode 100644 index 0000000000..913742dce8 --- /dev/null +++ b/mobile/lib/infrastructure/entities/memory.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/memory.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/memory_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/memory_asset.entity.drift.dart new file mode 100644 index 0000000000..3546c951b1 --- /dev/null +++ b/mobile/lib/infrastructure/entities/memory_asset.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/memory_asset.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/partner.entity.drift.dart b/mobile/lib/infrastructure/entities/partner.entity.drift.dart new file mode 100644 index 0000000000..29e119ea7f --- /dev/null +++ b/mobile/lib/infrastructure/entities/partner.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/partner.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/person.entity.drift.dart b/mobile/lib/infrastructure/entities/person.entity.drift.dart new file mode 100644 index 0000000000..3e43d7f3c3 --- /dev/null +++ b/mobile/lib/infrastructure/entities/person.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/person.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/remote_album.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_album.entity.drift.dart new file mode 100644 index 0000000000..0710dbca54 --- /dev/null +++ b/mobile/lib/infrastructure/entities/remote_album.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/remote_album.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/remote_album_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_album_asset.entity.drift.dart new file mode 100644 index 0000000000..4cc9debc90 --- /dev/null +++ b/mobile/lib/infrastructure/entities/remote_album_asset.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/remote_album_asset.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/remote_album_user.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_album_user.entity.drift.dart new file mode 100644 index 0000000000..67ccd191b2 --- /dev/null +++ b/mobile/lib/infrastructure/entities/remote_album_user.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/remote_album_user.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/remote_asset.entity.dart b/mobile/lib/infrastructure/entities/remote_asset.entity.dart new file mode 100644 index 0000000000..fe151e11c4 --- /dev/null +++ b/mobile/lib/infrastructure/entities/remote_asset.entity.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/remote_asset.dart'; diff --git a/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart new file mode 100644 index 0000000000..d538e7a46b --- /dev/null +++ b/mobile/lib/infrastructure/entities/remote_asset.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/remote_asset.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart b/mobile/lib/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart new file mode 100644 index 0000000000..3923e65755 --- /dev/null +++ b/mobile/lib/infrastructure/entities/remote_asset_cloud_id.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/remote_asset_cloud_id.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/settings.entity.drift.dart b/mobile/lib/infrastructure/entities/settings.entity.drift.dart new file mode 100644 index 0000000000..4b6a755fe7 --- /dev/null +++ b/mobile/lib/infrastructure/entities/settings.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/settings.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/stack.entity.drift.dart b/mobile/lib/infrastructure/entities/stack.entity.drift.dart new file mode 100644 index 0000000000..c1bd82317c --- /dev/null +++ b/mobile/lib/infrastructure/entities/stack.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/stack.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/store.entity.drift.dart b/mobile/lib/infrastructure/entities/store.entity.drift.dart new file mode 100644 index 0000000000..3865d2ce19 --- /dev/null +++ b/mobile/lib/infrastructure/entities/store.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/store.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/trashed_local_asset.entity.dart b/mobile/lib/infrastructure/entities/trashed_local_asset.entity.dart new file mode 100644 index 0000000000..af873ce5d9 --- /dev/null +++ b/mobile/lib/infrastructure/entities/trashed_local_asset.entity.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/trashed_local_asset.dart'; diff --git a/mobile/lib/infrastructure/entities/trashed_local_asset.entity.drift.dart b/mobile/lib/infrastructure/entities/trashed_local_asset.entity.drift.dart new file mode 100644 index 0000000000..dd87ce09b1 --- /dev/null +++ b/mobile/lib/infrastructure/entities/trashed_local_asset.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/trashed_local_asset.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/user.entity.drift.dart b/mobile/lib/infrastructure/entities/user.entity.drift.dart new file mode 100644 index 0000000000..adf5833909 --- /dev/null +++ b/mobile/lib/infrastructure/entities/user.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/user.drift.dart'; diff --git a/mobile/lib/infrastructure/entities/user_metadata.entity.drift.dart b/mobile/lib/infrastructure/entities/user_metadata.entity.drift.dart new file mode 100644 index 0000000000..a5158dcd8c --- /dev/null +++ b/mobile/lib/infrastructure/entities/user_metadata.entity.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/table/user_metadata.drift.dart'; diff --git a/mobile/lib/infrastructure/repositories/db.repository.dart b/mobile/lib/infrastructure/repositories/db.repository.dart new file mode 100644 index 0000000000..25b4d39448 --- /dev/null +++ b/mobile/lib/infrastructure/repositories/db.repository.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/database.dart'; diff --git a/mobile/lib/infrastructure/repositories/db.repository.drift.dart b/mobile/lib/infrastructure/repositories/db.repository.drift.dart new file mode 100644 index 0000000000..b1c4dbe288 --- /dev/null +++ b/mobile/lib/infrastructure/repositories/db.repository.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/database.drift.dart'; diff --git a/mobile/lib/infrastructure/repositories/logger_db.repository.dart b/mobile/lib/infrastructure/repositories/logger_db.repository.dart new file mode 100644 index 0000000000..fe726f80ff --- /dev/null +++ b/mobile/lib/infrastructure/repositories/logger_db.repository.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/logger.dart'; diff --git a/mobile/lib/infrastructure/repositories/logger_db.repository.drift.dart b/mobile/lib/infrastructure/repositories/logger_db.repository.drift.dart new file mode 100644 index 0000000000..366fcffba4 --- /dev/null +++ b/mobile/lib/infrastructure/repositories/logger_db.repository.drift.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/logger.drift.dart'; diff --git a/mobile/lib/infrastructure/utils/exif.converter.dart b/mobile/lib/infrastructure/utils/exif.converter.dart new file mode 100644 index 0000000000..0c843dac24 --- /dev/null +++ b/mobile/lib/infrastructure/utils/exif.converter.dart @@ -0,0 +1,3 @@ +// MOVED to package:immich_data — this shim keeps existing imports working +// during the migration. New code should import the package path directly. +export 'package:immich_data/db/util/exif_converter.dart'; diff --git a/mobile/lib/repositories/api.repository.dart b/mobile/lib/repositories/api.repository.dart new file mode 100644 index 0000000000..8a5c690b3b --- /dev/null +++ b/mobile/lib/repositories/api.repository.dart @@ -0,0 +1,11 @@ +import 'package:immich_mobile/constants/errors.dart'; + +abstract class ApiRepository { + Future checkNull(Future future) async { + final response = await future; + if (response == null) { + throw const NoResponseDtoError(); + } + return response; + } +}