refactor(server)!: remove changeExpiryTime

refactor/drop-changeExpiryTime
timonrieger 2026-06-03 23:30:36 +02:00
parent e98201232a
commit bd0fc2cc86
No known key found for this signature in database
5 changed files with 2 additions and 31 deletions

View File

@ -15,7 +15,6 @@ class SharedLinkEditDto {
SharedLinkEditDto({
this.allowDownload = const Optional.absent(),
this.allowUpload = const Optional.absent(),
this.changeExpiryTime = const Optional.absent(),
this.description = const Optional.absent(),
this.expiresAt = const Optional.absent(),
this.password = const Optional.absent(),
@ -41,15 +40,6 @@ class SharedLinkEditDto {
///
Optional<bool?> allowUpload;
/// Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this.
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
Optional<bool?> changeExpiryTime;
/// Link description
Optional<String?> description;
@ -75,7 +65,6 @@ class SharedLinkEditDto {
bool operator ==(Object other) => identical(this, other) || other is SharedLinkEditDto &&
other.allowDownload == allowDownload &&
other.allowUpload == allowUpload &&
other.changeExpiryTime == changeExpiryTime &&
other.description == description &&
other.expiresAt == expiresAt &&
other.password == password &&
@ -87,7 +76,6 @@ class SharedLinkEditDto {
// ignore: unnecessary_parenthesis
(allowDownload == null ? 0 : allowDownload!.hashCode) +
(allowUpload == null ? 0 : allowUpload!.hashCode) +
(changeExpiryTime == null ? 0 : changeExpiryTime!.hashCode) +
(description == null ? 0 : description!.hashCode) +
(expiresAt == null ? 0 : expiresAt!.hashCode) +
(password == null ? 0 : password!.hashCode) +
@ -95,7 +83,7 @@ class SharedLinkEditDto {
(slug == null ? 0 : slug!.hashCode);
@override
String toString() => 'SharedLinkEditDto[allowDownload=$allowDownload, allowUpload=$allowUpload, changeExpiryTime=$changeExpiryTime, description=$description, expiresAt=$expiresAt, password=$password, showMetadata=$showMetadata, slug=$slug]';
String toString() => 'SharedLinkEditDto[allowDownload=$allowDownload, allowUpload=$allowUpload, description=$description, expiresAt=$expiresAt, password=$password, showMetadata=$showMetadata, slug=$slug]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
@ -107,10 +95,6 @@ class SharedLinkEditDto {
final value = this.allowUpload.value;
json[r'allowUpload'] = value;
}
if (this.changeExpiryTime.isPresent) {
final value = this.changeExpiryTime.value;
json[r'changeExpiryTime'] = value;
}
if (this.description.isPresent) {
final value = this.description.value;
json[r'description'] = value;
@ -147,7 +131,6 @@ class SharedLinkEditDto {
return SharedLinkEditDto(
allowDownload: json.containsKey(r'allowDownload') ? Optional.present(mapValueOfType<bool>(json, r'allowDownload')) : const Optional.absent(),
allowUpload: json.containsKey(r'allowUpload') ? Optional.present(mapValueOfType<bool>(json, r'allowUpload')) : const Optional.absent(),
changeExpiryTime: json.containsKey(r'changeExpiryTime') ? Optional.present(mapValueOfType<bool>(json, r'changeExpiryTime')) : const Optional.absent(),
description: json.containsKey(r'description') ? Optional.present(mapValueOfType<String>(json, r'description')) : const Optional.absent(),
expiresAt: json.containsKey(r'expiresAt') ? Optional.present(mapDateTime(json, r'expiresAt', r'/^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$/')) : const Optional.absent(),
password: json.containsKey(r'password') ? Optional.present(mapValueOfType<String>(json, r'password')) : const Optional.absent(),

View File

@ -22197,10 +22197,6 @@
"description": "Allow uploads",
"type": "boolean"
},
"changeExpiryTime": {
"description": "Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this.",
"type": "boolean"
},
"description": {
"description": "Link description",
"nullable": true,

View File

@ -2192,8 +2192,6 @@ export type SharedLinkEditDto = {
allowDownload?: boolean;
/** Allow uploads */
allowUpload?: boolean;
/** Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this. */
changeExpiryTime?: boolean;
/** Link description */
description?: string | null;
/** Expiration date */

View File

@ -42,12 +42,6 @@ const SharedLinkEditSchema = z
allowUpload: z.boolean().optional().describe('Allow uploads'),
allowDownload: z.boolean().optional().describe('Allow downloads'),
showMetadata: z.boolean().optional().describe('Show metadata'),
changeExpiryTime: z
.boolean()
.optional()
.describe(
'Whether to change the expiry time. Few clients cannot send null to set the expiryTime to never. Setting this flag and not sending expiryAt is considered as null instead. Clients that can send null values can ignore this.',
),
})
.meta({ id: 'SharedLinkEditDto' });

View File

@ -124,7 +124,7 @@ export class SharedLinkService extends BaseService {
userId: auth.user.id,
description: dto.description,
password: dto.password,
expiresAt: dto.changeExpiryTime && !dto.expiresAt ? null : dto.expiresAt,
expiresAt: dto.expiresAt,
allowUpload: dto.allowUpload,
allowDownload: dto.allowDownload,
showExif: dto.showMetadata,