__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
import 'package:freezed_annotation/freezed_annotation.dart';

part 'prompting_models.freezed.dart';
part 'prompting_models.g.dart';

enum Action { allow, deny }

enum HomePatternType {
  customPath,
  requestedDirectory,
  requestedFile,
  topLevelDirectory,
  containingDirectory,
  homeDirectory,
  matchingFileExtension,
  requestedDirectoryContents,
}

// Technically there is also a 'timespan' variant of this enum (on the
// snapd side) but it isn't something that we are currently supporting
// through the prompt UI.
enum Lifespan { single, session, forever }

enum HomePermission { read, write, execute }

@freezed
class MetaData with _$MetaData {
  factory MetaData({
    required String promptId,
    required String snapName,
    DateTime? updatedAt,
    String? storeUrl,
    String? publisher,
  }) = _MetaData;

  factory MetaData.fromJson(Map<String, dynamic> json) =>
      _$MetaDataFromJson(json);
}

@freezed
class PatternOption with _$PatternOption {
  factory PatternOption({
    required HomePatternType homePatternType,
    required String pathPattern,
    @Default(false) bool showInitially,
  }) = _PatternOption;

  factory PatternOption.fromJson(Map<String, dynamic> json) =>
      _$PatternOptionFromJson(json);
}

@freezed
sealed class EnrichedPathKind with _$EnrichedPathKind {
  factory EnrichedPathKind.homeDir() = EnrichedPathKindHomeDir;

  factory EnrichedPathKind.topLevelDir({
    required String dirname,
  }) = EnrichedPathKindTopLevelDir;

  factory EnrichedPathKind.subDir() = EnrichedPathKindSubDir;

  factory EnrichedPathKind.homeDirFile({
    required String filename,
  }) = EnrichedPathKindHomeDirFile;

  factory EnrichedPathKind.topLevelDirFile({
    required String dirname,
    required String filename,
  }) = EnrichedPathKindTopLevelDirFile;

  factory EnrichedPathKind.subDirFile() = EnrichedPathKindSubDirFile;

  factory EnrichedPathKind.fromJson(Map<String, dynamic> json) =>
      _$EnrichedPathKindFromJson(json);
}

@freezed
sealed class PromptDetails with _$PromptDetails {
  factory PromptDetails.home({
    required MetaData metaData,
    required String requestedPath,
    required String homeDir,
    required Set<HomePermission> requestedPermissions,
    required Set<HomePermission> availablePermissions,
    required Set<HomePermission> suggestedPermissions,
    required Set<PatternOption> patternOptions,
    required EnrichedPathKind enrichedPathKind,
    @Default(0) int initialPatternOption,
  }) = PromptDetailsHome;

  factory PromptDetails.fromJson(Map<String, dynamic> json) =>
      _$PromptDetailsFromJson(json);
}

@freezed
sealed class PromptReply with _$PromptReply {
  factory PromptReply.home({
    required String promptId,
    required Action action,
    required Lifespan lifespan,
    required String pathPattern,
    required Set<HomePermission> permissions,
  }) = PromptReplyHome;

  factory PromptReply.fromJson(Map<String, dynamic> json) =>
      _$PromptReplyFromJson(json);
}

@freezed
sealed class PromptReplyResponse with _$PromptReplyResponse {
  factory PromptReplyResponse.success() = PromptReplyResponseSuccess;
  factory PromptReplyResponse.promptNotFound({required String message}) =
      PromptReplyResponsePromptNotFound;
  factory PromptReplyResponse.unknown({required String message}) =
      PromptReplyResponseUnknown;
}

Filemanager

Name Type Size Permission Actions
generated Folder 0755
prompting_client.dart File 7.83 KB 0644
prompting_models.dart File 3.25 KB 0644
Filemanager