<commit_before>import { ProcessDetails, gqlProcessFragments } from "../process/processinterfaces";
import { UserDetails } from "../user/userinterfaces";
import gql from "graphql-tag";

// WorkspaceType
export enum WorkspaceType {
  Demo = 0,
  Free = 100,
  Team = 200,
  Business = 300,
  Enterprise = 400
}

export interface WorkspaceDetails {
  // Changes must also be reflected in gqlTypes and gqlFragments below!

  workspaceId: string;
  workspaceType: WorkspaceType;
  urlName?: string; // displayName converted to Uri segment
  fullUrl?: string; // @urlname
  displayName: string;
  description?: string;
  userRole?: WorkspaceRole;  // Rolle des angemeldeten Users im Workspace  
  extras: {
    // New Extras must be added to cache-handling in workspaceactions -> loadWorkspace!
    members?: WorkspaceMember[];
    processes?: ProcessDetails[];  // Nur Prozesse, auf die der angemeldete User Zugriff hat
    settings?: WorkspaceSettings;
  };
}
export const gqlWorkspaceTypes = `     
  type WorkspaceDetails {
    workspaceId: String!
    workspaceType: String
    urlName: String
    fullUrl: String
    displayName: String<commit_msg>getWorkspaceTypeName<commit_after>import { ProcessDetails, gqlProcessFragments } from "../process/processinterfaces";
import { UserDetails } from "../user/userinterfaces";
import gql from "graphql-tag";
import { tl } from "../tl";

// WorkspaceType
export enum WorkspaceType {
  Demo = 0,
  Free = 100,
  Team = 200,
  Business = 300,
  Enterprise = 400
}
export function getWorkspaceTypeName(workspaceType: WorkspaceType) {
  switch (workspaceType) {
    case WorkspaceType.Demo:
      return tl("Demo");
    case WorkspaceType.Free:
      return tl("Free");      
    case WorkspaceType.Team:
      return tl("Team");
    case WorkspaceType.Business:
      return tl("Business");
    case WorkspaceType.Enterprise:
      return tl("Enterprise");
    default:
      return "???";            
  }
}

export interface WorkspaceDetails {
  // Changes must also be reflected in gqlTypes and gqlFragments below!

  workspaceId: string;
  workspaceType: WorkspaceType;
  urlName?: string; // displayName converted to Uri segment
  fullUrl?: string; // @urlname
  displayName: string;
  description?: string;
  userRole?: WorkspaceRole;  // Rolle des angemeldeten Users im Workspace  
  extras: {
    // New Extras must be added to cache-handling in workspaceactions -> loadWorkspace!
    members?: WorkspaceMember[];
    processes?: ProcessDetails[];  // Nur Prozesse, auf die der angemeldete User Zugriff hat
    settings?: WorkspaceSettings;
  };
}
export const gqlWorkspaceTypes = `     
  type WorkspaceDetails {
    workspaceId: String!
    workspaceType: String
    urlName: String
    fullUrl: String
    displayName: String
{'fraction_non_alphanumeric': 0.0962509012256669, 'fraction_numerical': 0.009372746935832732, 'mean_word_length': 3.5943708609271523, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1440626', 'n_tokens_mistral': 831, 'n_tokens_neox': 820, 'n_words': 245}