implement keytoken list and all-messages list
Some checks failed
Build Docker and Deploy / Build Docker Container (push) Successful in 50s
Build Docker and Deploy / Run Unit-Tests (push) Failing after 11m15s
Build Docker and Deploy / Deploy to Server (push) Has been skipped

This commit is contained in:
2025-04-13 19:47:18 +02:00
parent e9c5c5fb99
commit ab4b40ab75
11 changed files with 685 additions and 14 deletions

View File

@@ -2,7 +2,7 @@ class KeyToken {
final String keytokenID;
final String name;
final String timestampCreated;
final String? timestampLastused;
final String? timestampLastUsed;
final String ownerUserID;
final bool allChannels;
final List<String> channels;
@@ -13,7 +13,7 @@ class KeyToken {
required this.keytokenID,
required this.name,
required this.timestampCreated,
required this.timestampLastused,
required this.timestampLastUsed,
required this.ownerUserID,
required this.allChannels,
required this.channels,
@@ -26,7 +26,7 @@ class KeyToken {
keytokenID: json['keytoken_id'] as String,
name: json['name'] as String,
timestampCreated: json['timestamp_created'] as String,
timestampLastused: json['timestamp_lastused'] as String?,
timestampLastUsed: json['timestamp_lastused'] as String?,
ownerUserID: json['owner_user_id'] as String,
allChannels: json['all_channels'] as bool,
channels: (json['channels'] as List<dynamic>).map((e) => e as String).toList(),
@@ -38,6 +38,17 @@ class KeyToken {
static List<KeyToken> fromJsonArray(List<dynamic> jsonArr) {
return jsonArr.map<KeyToken>((e) => KeyToken.fromJson(e as Map<String, dynamic>)).toList();
}
KeyTokenPreview toPreview() {
return KeyTokenPreview(
keytokenID: keytokenID,
name: name,
ownerUserID: ownerUserID,
allChannels: allChannels,
channels: channels,
permissions: permissions,
);
}
}
class KeyTokenWithToken {