1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-28 09:33:27 +02:00
immich/mobile/openapi
mgabor 2943f93098
feat: readonly album sharing (#8720)
* rename albums_shared_users_users to album_permissions and add readonly column

* disable synchronize on the original join table

* remove unnecessary FK names

* set readonly=true as default for new album shares

* separate and implement album READ and WRITE permission

* expose albumPermissions on the API, deprecate sharedUsers

* generate openapi

* create readonly view on frontend

* ??? move slideshow button out from ellipsis menu so that non-owners can have access too

* correct sharedUsers joins

* add album permission repository

* remove a log

* fix assetCount getting reset when adding users

* fix lint

* add set permission endpoint and UI

* sort users

* remove log

* Revert "??? move slideshow button out from ellipsis menu so that non-owners can have access too"

This reverts commit 1343bfa311.

* rename stuff

* fix db schema annotations

* sql generate

* change readonly default to follow migration

* fix deprecation notice

* change readonly boolean to role enum

* fix joincolumn as primary key

* rename albumUserRepository in album service

* clean up userId and albumId

* add write access to shared link

* fix existing tests

* switch to vitest

* format and fix tests on web

* add new test

* fix one e2e test

* rename new API field to albumUsers

* capitalize serverside enum

* remove unused ReadWrite type

* missed rename from previous commit

* rename to albumUsers in album entity as well

* remove outdated Equals calls

* unnecessary relation

* rename to updateUser in album service

* minor renamery

* move sorting to backend

* rename and separate ALBUM_WRITE as ADD_ASSET and REMOVE_ASSET

* fix tests

* fix "should migrate single moving picture" test failing on European system timezone

* generated changes after merge

* lint fix

* fix correct page to open after removing user from album

* fix e2e tests and some bugs

* rename updateAlbumUser rest endpoint

* add new e2e tests for updateAlbumUser endpoint

* small optimizations

* refactor album e2e test, add new album shared with viewer

* add new test to check if viewer can see the album

* add new e2e tests for readonly share

* failing test: User delete doesn't cascade to UserAlbum entity

* fix: handle deleted users

* use lodash for sort

* add role to addUsersToAlbum endpoint

* add UI for adding editors

* lint fixes

* change role back to editor as DB default

* fix server tests

* redesign user selection modal editor selector

* style tweaks

* fix type error

* Revert "style tweaks"

This reverts commit ab604f4c8f.

* Revert "redesign user selection modal editor selector"

This reverts commit e6f344856c.

* chore: cleanup and improve add user modal

* chore: open api

* small styling

---------

Co-authored-by: mgabor <>
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
2024-04-25 04:19:49 +00:00
..
.openapi-generator feat: readonly album sharing (#8720) 2024-04-25 04:19:49 +00:00
doc feat: readonly album sharing (#8720) 2024-04-25 04:19:49 +00:00
lib feat: readonly album sharing (#8720) 2024-04-25 04:19:49 +00:00
test feat: readonly album sharing (#8720) 2024-04-25 04:19:49 +00:00
.gitignore Refactor mobile to use OpenApi generated SDK (#336) 2022-07-13 07:23:48 -05:00
.openapi-generator-ignore Refactor mobile to use OpenApi generated SDK (#336) 2022-07-13 07:23:48 -05:00
.travis.yml Refactor mobile to use OpenApi generated SDK (#336) 2022-07-13 07:23:48 -05:00
git_push.sh Refactor mobile to use OpenApi generated SDK (#336) 2022-07-13 07:23:48 -05:00
pubspec.yaml deps: open-api generator (#6655) 2024-01-26 11:40:28 -05:00
README.md feat: readonly album sharing (#8720) 2024-04-25 04:19:49 +00:00

openapi

Immich API

This Dart package is automatically generated by the OpenAPI Generator project:

  • API version: 1.102.3
  • Build package: org.openapitools.codegen.languages.DartClientCodegen

Requirements

Dart 2.12 or later

Installation & Usage

Github

If this Dart package is published to Github, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    git: https://github.com/GIT_USER_ID/GIT_REPO_ID.git

Local

To use the package in your local drive, add the following dependency to your pubspec.yaml

dependencies:
  openapi:
    path: /path/to/openapi

Tests

TODO

Getting Started

Please follow the installation procedure and then run the following:

import 'package:openapi/api.dart';

// TODO Configure API key authorization: cookie
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('cookie').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: api_key
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('api_key').apiKeyPrefix = 'Bearer';
// TODO Configure HTTP Bearer authorization: bearer
// Case 1. Use String Token
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken('YOUR_ACCESS_TOKEN');
// Case 2. Use Function which generate token.
// String yourTokenGeneratorFunction() { ... }
//defaultApiClient.getAuthentication<HttpBearerAuth>('bearer').setAccessToken(yourTokenGeneratorFunction);

final api_instance = APIKeyApi();
final aPIKeyCreateDto = APIKeyCreateDto(); // APIKeyCreateDto | 

try {
    final result = api_instance.createApiKey(aPIKeyCreateDto);
    print(result);
} catch (e) {
    print('Exception when calling APIKeyApi->createApiKey: $e\n');
}

Documentation for API Endpoints

All URIs are relative to /api

Class Method HTTP request Description
APIKeyApi createApiKey POST /api-key
APIKeyApi deleteApiKey DELETE /api-key/{id}
APIKeyApi getApiKey GET /api-key/{id}
APIKeyApi getApiKeys GET /api-key
APIKeyApi updateApiKey PUT /api-key/{id}
ActivityApi createActivity POST /activity
ActivityApi deleteActivity DELETE /activity/{id}
ActivityApi getActivities GET /activity
ActivityApi getActivityStatistics GET /activity/statistics
AlbumApi addAssetsToAlbum PUT /album/{id}/assets
AlbumApi addUsersToAlbum PUT /album/{id}/users
AlbumApi createAlbum POST /album
AlbumApi deleteAlbum DELETE /album/{id}
AlbumApi getAlbumCount GET /album/count
AlbumApi getAlbumInfo GET /album/{id}
AlbumApi getAllAlbums GET /album
AlbumApi removeAssetFromAlbum DELETE /album/{id}/assets
AlbumApi removeUserFromAlbum DELETE /album/{id}/user/{userId}
AlbumApi updateAlbumInfo PATCH /album/{id}
AlbumApi updateAlbumUser PUT /album/{id}/user/{userId}
AssetApi checkBulkUpload POST /asset/bulk-upload-check
AssetApi checkExistingAssets POST /asset/exist
AssetApi deleteAssets DELETE /asset
AssetApi getAllAssets GET /asset
AssetApi getAllUserAssetsByDeviceId GET /asset/device/{deviceId}
AssetApi getAssetInfo GET /asset/{id}
AssetApi getAssetSearchTerms GET /asset/search-terms
AssetApi getAssetStatistics GET /asset/statistics
AssetApi getAssetThumbnail GET /asset/thumbnail/{id}
AssetApi getCuratedLocations GET /asset/curated-locations
AssetApi getCuratedObjects GET /asset/curated-objects
AssetApi getMapMarkers GET /asset/map-marker
AssetApi getMemoryLane GET /asset/memory-lane
AssetApi getRandom GET /asset/random
AssetApi runAssetJobs POST /asset/jobs
AssetApi searchAssets GET /assets
AssetApi serveFile GET /asset/file/{id}
AssetApi updateAsset PUT /asset/{id}
AssetApi updateAssets PUT /asset
AssetApi updateStackParent PUT /asset/stack/parent
AssetApi uploadFile POST /asset/upload
AuditApi getAuditDeletes GET /audit/deletes
AuthenticationApi changePassword POST /auth/change-password
AuthenticationApi login POST /auth/login
AuthenticationApi logout POST /auth/logout
AuthenticationApi signUpAdmin POST /auth/admin-sign-up
AuthenticationApi validateAccessToken POST /auth/validateToken
DownloadApi downloadArchive POST /download/archive
DownloadApi downloadFile POST /download/asset/{id}
DownloadApi getDownloadInfo POST /download/info
FaceApi getFaces GET /face
FaceApi reassignFacesById PUT /face/{id}
FileReportApi fixAuditFiles POST /report/fix
FileReportApi getAuditFiles GET /report
FileReportApi getFileChecksums POST /report/checksum
JobApi getAllJobsStatus GET /jobs
JobApi sendJobCommand PUT /jobs/{id}
LibraryApi createLibrary POST /library
LibraryApi deleteLibrary DELETE /library/{id}
LibraryApi getAllLibraries GET /library
LibraryApi getLibrary GET /library/{id}
LibraryApi getLibraryStatistics GET /library/{id}/statistics
LibraryApi removeOfflineFiles POST /library/{id}/removeOffline
LibraryApi scanLibrary POST /library/{id}/scan
LibraryApi updateLibrary PUT /library/{id}
LibraryApi validate POST /library/{id}/validate
MemoryApi addMemoryAssets PUT /memories/{id}/assets
MemoryApi createMemory POST /memories
MemoryApi deleteMemory DELETE /memories/{id}
MemoryApi getMemory GET /memories/{id}
MemoryApi removeMemoryAssets DELETE /memories/{id}/assets
MemoryApi searchMemories GET /memories
MemoryApi updateMemory PUT /memories/{id}
OAuthApi finishOAuth POST /oauth/callback
OAuthApi linkOAuthAccount POST /oauth/link
OAuthApi redirectOAuthToMobile GET /oauth/mobile-redirect
OAuthApi startOAuth POST /oauth/authorize
OAuthApi unlinkOAuthAccount POST /oauth/unlink
PartnerApi createPartner POST /partner/{id}
PartnerApi getPartners GET /partner
PartnerApi removePartner DELETE /partner/{id}
PartnerApi updatePartner PUT /partner/{id}
PersonApi createPerson POST /person
PersonApi getAllPeople GET /person
PersonApi getPerson GET /person/{id}
PersonApi getPersonAssets GET /person/{id}/assets
PersonApi getPersonStatistics GET /person/{id}/statistics
PersonApi getPersonThumbnail GET /person/{id}/thumbnail
PersonApi mergePerson POST /person/{id}/merge
PersonApi reassignFaces PUT /person/{id}/reassign
PersonApi updatePeople PUT /person
PersonApi updatePerson PUT /person/{id}
SearchApi getAssetsByCity GET /search/cities
SearchApi getExploreData GET /search/explore
SearchApi getSearchSuggestions GET /search/suggestions
SearchApi search GET /search
SearchApi searchMetadata POST /search/metadata
SearchApi searchPerson GET /search/person
SearchApi searchPlaces GET /search/places
SearchApi searchSmart POST /search/smart
ServerInfoApi getServerConfig GET /server-info/config
ServerInfoApi getServerFeatures GET /server-info/features
ServerInfoApi getServerInfo GET /server-info
ServerInfoApi getServerStatistics GET /server-info/statistics
ServerInfoApi getServerVersion GET /server-info/version
ServerInfoApi getSupportedMediaTypes GET /server-info/media-types
ServerInfoApi getTheme GET /server-info/theme
ServerInfoApi pingServer GET /server-info/ping
SessionsApi deleteAllSessions DELETE /sessions
SessionsApi deleteSession DELETE /sessions/{id}
SessionsApi getSessions GET /sessions
SharedLinkApi addSharedLinkAssets PUT /shared-link/{id}/assets
SharedLinkApi createSharedLink POST /shared-link
SharedLinkApi getAllSharedLinks GET /shared-link
SharedLinkApi getMySharedLink GET /shared-link/me
SharedLinkApi getSharedLinkById GET /shared-link/{id}
SharedLinkApi removeSharedLink DELETE /shared-link/{id}
SharedLinkApi removeSharedLinkAssets DELETE /shared-link/{id}/assets
SharedLinkApi updateSharedLink PATCH /shared-link/{id}
SyncApi getAllForUserFullSync GET /sync/full-sync
SyncApi getDeltaSync GET /sync/delta-sync
SystemConfigApi getConfig GET /system-config
SystemConfigApi getConfigDefaults GET /system-config/defaults
SystemConfigApi getMapStyle GET /system-config/map/style.json
SystemConfigApi getStorageTemplateOptions GET /system-config/storage-template-options
SystemConfigApi updateConfig PUT /system-config
SystemMetadataApi getAdminOnboarding GET /system-metadata/admin-onboarding
SystemMetadataApi getReverseGeocodingState GET /system-metadata/reverse-geocoding-state
SystemMetadataApi updateAdminOnboarding POST /system-metadata/admin-onboarding
TagApi createTag POST /tag
TagApi deleteTag DELETE /tag/{id}
TagApi getAllTags GET /tag
TagApi getTagAssets GET /tag/{id}/assets
TagApi getTagById GET /tag/{id}
TagApi tagAssets PUT /tag/{id}/assets
TagApi untagAssets DELETE /tag/{id}/assets
TagApi updateTag PATCH /tag/{id}
TimelineApi getTimeBucket GET /timeline/bucket
TimelineApi getTimeBuckets GET /timeline/buckets
TrashApi emptyTrash POST /trash/empty
TrashApi restoreAssets POST /trash/restore/assets
TrashApi restoreTrash POST /trash/restore
UserApi createProfileImage POST /user/profile-image
UserApi createUser POST /user
UserApi deleteProfileImage DELETE /user/profile-image
UserApi deleteUser DELETE /user/{id}
UserApi getAllUsers GET /user
UserApi getMyUserInfo GET /user/me
UserApi getProfileImage GET /user/profile-image/{id}
UserApi getUserById GET /user/info/{id}
UserApi restoreUser POST /user/{id}/restore
UserApi updateUser PUT /user

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearer

  • Type: HTTP Bearer authentication
  • Type: API key
  • API key parameter name: immich_access_token
  • Location:

api_key

  • Type: API key
  • API key parameter name: x-api-key
  • Location: HTTP header

Author