Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Commit

Permalink
Apply rights naming convention (#320)
Browse files Browse the repository at this point in the history
  • Loading branch information
ildyria authored Dec 23, 2022
1 parent f03699b commit 133271f
Show file tree
Hide file tree
Showing 17 changed files with 425 additions and 399 deletions.
198 changes: 139 additions & 59 deletions scripts/3rd-party/backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @property {string} title
* @property {?string} description
* @property {string[]} tags
* @property {number} is_public
* @property {boolean} is_public
* @property {?string} type
* @property {?string} iso
* @property {?string} aperture
Expand All @@ -49,10 +49,9 @@
* @property {?string} live_photo_content_id
* @property {?string} live_photo_checksum
* @property {SizeVariants} size_variants
* @property {boolean} is_downloadable
* @property {boolean} is_share_button_visible
* @property {?string} [next_photo_id]
* @property {?string} [previous_photo_id]
* @property {PhotoRightsDTO} rights
*/

/**
Expand Down Expand Up @@ -99,13 +98,9 @@
* @property {?string} cover_id
* @property {?Thumb} thumb
* @property {string} [owner_name] optional, only shown in authenticated mode
* @property {boolean} is_public
* @property {boolean} is_downloadable
* @property {boolean} is_share_button_visible
* @property {boolean} is_nsfw
* @property {boolean} grants_full_photo
* @property {boolean} requires_link
* @property {boolean} has_password
* @property {AlbumRightsDTO} rights
* @property {AlbumProtectionPolicy} policy
* @property {boolean} has_albums
* @property {?string} min_taken_at
* @property {?string} max_taken_at
Expand All @@ -124,13 +119,9 @@
* @property {Photo[]} photos
* @property {?Thumb} thumb
* @property {string} [owner_name] optional, only shown in authenticated mode
* @property {boolean} is_public
* @property {boolean} is_downloadable
* @property {boolean} is_share_button_visible
* @property {boolean} is_nsfw
* @property {boolean} grants_full_photo
* @property {boolean} requires_link
* @property {boolean} has_password
* @property {boolean} is_nsfw
* @property {AlbumRightsDTO} rights
* @property {AlbumProtectionPolicy} policy
* @property {?string} min_taken_at
* @property {?string} max_taken_at
* @property {?SortingCriterion} sorting
Expand All @@ -144,9 +135,8 @@
* @property {string} title
* @property {Photo[]} [photos]
* @property {?Thumb} thumb
* @property {boolean} is_public
* @property {boolean} is_downloadable
* @property {boolean} is_share_button_visible
* @property {AlbumRightsDTO} rights
* @property {AlbumProtectionPolicy} policy
*/

/**
Expand Down Expand Up @@ -218,12 +208,20 @@ const SmartAlbumID = Object.freeze({
*
* @property {number} id
* @property {string} username
* @property {?string} email
* @property {boolean} may_upload
* @property {boolean} is_locked
* @property {string} email
* @property {boolean} has_token
*/

/**
* @typedef UserWithCapabilitiesDTO
*
* @property {number} id
* @property {string} username
* @property {boolean} may_administrate
* @property {boolean} may_upload
* @property {boolean} may_edit_own_settings
*/

/**
* @typedef WebAuthnCredential
*
Expand All @@ -239,12 +237,6 @@ const SmartAlbumID = Object.freeze({
* @property {?string} track_url - URL to GPX track
*/

/**
* @typedef EMailData
*
* @property {?string} email
*/

/**
* @typedef ConfigSetting
*
Expand Down Expand Up @@ -288,7 +280,7 @@ const SmartAlbumID = Object.freeze({
* @typedef InitializationData
*
* @property {?User} user
* @property {{is_admin: boolean, is_locked: boolean, may_upload: boolean}} rights
* @property {GlobalRightsDTO} rights
* @property {boolean} update_json
* @property {boolean} update_available
* @property {Object.<string, string>} locale
Expand All @@ -307,45 +299,45 @@ const SmartAlbumID = Object.freeze({
* @typedef ConfigurationData
*
* @property {string} album_subtitle_type
* @property {string} check_for_updates - actually a boolean
* @property {string} check_for_updates - actually a boolean
* @property {string} [default_license]
* @property {string} [delete_imported] - actually a boolean
* @property {string} downloadable - actually a boolean
* @property {string} [delete_imported] - actually a boolean
* @property {string} grants_download - actually a boolean
* @property {string} [dropbox_key]
* @property {string} editor_enabled - actually a boolean
* @property {string} rss_enable - actually a boolean
* @property {Feed[]} rss_feeds - array of RSS feeds
* @property {string} full_photo - actually a boolean
* @property {string} editor_enabled - actually a boolean
* @property {string} rss_enable - actually a boolean
* @property {Feed[]} rss_feeds - array of RSS feeds
* @property {string} grants_full_photo_access - actually a boolean
* @property {string} image_overlay_type
* @property {string} landing_page_enable - actually a boolean
* @property {string} landing_page_enable - actually a boolean
* @property {string} lang
* @property {string[]} lang_available
* @property {string} layout - actually a number: `0`, `1` or `2`
* @property {string} layout - actually a number: `0`, `1` or `2`
* @property {string} [location]
* @property {string} location_decoding - actually a boolean
* @property {string} location_show - actually a boolean
* @property {string} location_show_public - actually a boolean
* @property {string} map_display - actually a boolean
* @property {string} map_display_direction - actually a boolean
* @property {string} map_display_public - actually a boolean
* @property {string} map_include_subalbums - actually a boolean
* @property {string} location_decoding - actually a boolean
* @property {string} location_show - actually a boolean
* @property {string} location_show_public - actually a boolean
* @property {string} map_display - actually a boolean
* @property {string} map_display_direction - actually a boolean
* @property {string} map_display_public - actually a boolean
* @property {string} map_include_subalbums - actually a boolean
* @property {string} map_provider
* @property {string} new_photos_notification - actually a boolean
* @property {string} nsfw_blur - actually a boolean
* @property {string} nsfw_visible - actually a boolean
* @property {string} nsfw_warning - actually a boolean
* @property {string} nsfw_warning_admin - actually a boolean
* @property {string} nsfw_banner_override - custom HTML instead of the default NSFW banner
* @property {string} public_photos_hidden - actually a boolean
* @property {string} public_search - actually a boolean
* @property {string} share_button_visible - actually a boolean
* @property {string} [skip_duplicates] - actually a boolean
* @property {string} new_photos_notification - actually a boolean
* @property {string} nsfw_blur - actually a boolean
* @property {string} nsfw_visible - actually a boolean
* @property {string} nsfw_warning - actually a boolean
* @property {string} nsfw_warning_admin - actually a boolean
* @property {string} nsfw_banner_override - custom HTML instead of the default NSFW banner
* @property {string} public_photos_hidden - actually a boolean
* @property {string} public_search - actually a boolean
* @property {string} share_button_visible - actually a boolean
* @property {string} [skip_duplicates] - actually a boolean
* @property {SortingCriterion} sorting_albums
* @property {SortingCriterion} sorting_photos
* @property {string} swipe_tolerance_x - actually a number
* @property {string} swipe_tolerance_y - actually a number
* @property {string} upload_processing_limit - actually a number
* @property {?Version} version - Version number
* @property {string} swipe_tolerance_x - actually a number
* @property {string} swipe_tolerance_y - actually a number
* @property {string} upload_processing_limit - actually a number
* @property {?Version} version - Version number
*/

/**
Expand Down Expand Up @@ -381,3 +373,91 @@ const SmartAlbumID = Object.freeze({
* @property {?string} path - the path to the affected file or directory
* @property {string} message - a message text
*/

/**
* The JSON object for Policy on Albums
*
* @typedef AlbumProtectionPolicy
*
* @property {is_nsfw} boolean
* @property {boolean} is_public
* @property {boolean} is_link_required
* @property {boolean} is_password_required
* @property {boolean} grants_full_photo_access
* @property {boolean} grants_download
*/

/**
* The JSON object for Rights on users management
*
* @typedef UserManagementRightsDTO
*
* @property {boolean} can_create
* @property {boolean} can_list
* @property {boolean} can_edit
* @property {boolean} can_delete
*/

/**
* The JSON object for Rights on a User
*
* @typedef UserRightsDTO
*
* @property {boolean} can_edit
* @property {boolean} can_use_2fa
*/

/**
* The JSON object for Rights on Settings
*
* @typedef SettingsRightsDTO
*
* @property {boolean} can_edit
* @property {boolean} can_see_logs
* @property {boolean} can_clear_logs
* @property {boolean} can_see_diagnostics
* @property {boolean} can_update
*/

/**
* The JSON object for Rights on Settings
*
* @typedef RootAlbumRightsDTO
*
* @property {boolean} can_edit
* @property {boolean} can_upload
* @property {boolean} can_download
* @property {boolean} can_import_from_server
*/

/**
* The JSON object for Rights on Photos
*
* @typedef PhotoRightsDTO
*
* @property {boolean} can_edit
* @property {boolean} can_download
* @property {boolean} can_access_full_photo
*/

/**
* The JSON object for Rights on Album
*
* @typedef AlbumRightsDTO
*
* @property {boolean} can_edit
* @property {boolean} can_share_with_users
* @property {boolean} can_download
* @property {boolean} can_upload
*/

/**
* The JSON object for Rights on Global Application
*
* @typedef GlobalRightsDTO
*
* @property {RootAlbumRightsDTO} root_album
* @property {SettingsRightsDTO} settings
* @property {UserManagementRightsDTO} user_management
* @property {UserRightsDTO} user
*/
Loading

0 comments on commit 133271f

Please sign in to comment.