source/Private/Constants.ps1

New-Variable -Name "MSGraphAppId" -Value "00000003-0000-0000-c000-000000000000" -Scope "Script" -Option ReadOnly

# RealmJoin Portal URL
function Get-RJPortalUrl {
    [OutputType([string])]
    param()
    if (Get-RJUseStagingEndpoint) { return "https://portal-staging.realmjoin.com/" }
    return "https://portal.realmjoin.com/"
}

# RealmJoin Customer API URL
function Get-RJCustomerApiUrl {
    [OutputType([string])]
    param()
    if (Get-RJUseStagingEndpoint) { return "https://customer-api-staging.realmjoin.com/tenant/connect" }
    return "https://customer-api.realmjoin.com/tenant/connect"
}

# RealmJoin Portal Features URL
function Get-RJPortalFeaturesUrl {
    [OutputType([string])]
    param()
    if (Get-RJUseStagingEndpoint) { return "https://portal-staging.realmjoin.com/organization/features" }
    return "https://portal.realmjoin.com/organization/features"
}

# Required Microsoft Graph PowerShell modules
New-Variable -Name "RequiredGraphModules" -Value @{
    "Microsoft.Graph.Authentication" = "2.38.1"
    "Microsoft.Graph.Applications" = "2.38.1"
    "Microsoft.Graph.Identity.DirectoryManagement" = "2.38.1"
} -Scope "Script" -Option ReadOnly

# Required Microsoft Graph scopes
New-Variable -Name "RequiredGraphScopes" -Value @(
    "Organization.Read.All",
    "Application.ReadWrite.All",
    "AppRoleAssignment.ReadWrite.All"
) -Scope "Script" -Option ReadOnly

# Default selected features for new tenant setup
New-Variable -Name "DefaultSelectedFeatures" -Value @(
    'RealmJoinPortal',
    'IntuneLAPS',
    'ShowSignin',
    'Autopilot',
    'DeviceIntuneActions',
    'DeviceHealthScript',
    'BitLockerRecoveryKeys',
    'WindowsDeviceUpdateEnrollment',
    'IntuneLicenseCount'
) -Scope "Script" -Option ReadOnly

# Main menu options
New-Variable -Name "MainMenuOptions" -Value @(
    [PSCustomObject]@{ Key = 'NewTenant'; Display = '[1] New Tenant Setup'; Description = 'Initial configuration for new tenants' }
    [PSCustomObject]@{ Key = 'UpdateTenant'; Display = '[2] Modify Configuration'; Description = 'View and modify existing setup' }
    [PSCustomObject]@{ Key = 'ShowFeatures'; Display = '[3] Show Available Features'; Description = 'View feature information (no changes)' }
    [PSCustomObject]@{ Key = 'Exit'; Display = '[4] Exit'; Description = 'Exit the configuration tool' }
) -Scope "Script" -Option ReadOnly

# Permission mode options
New-Variable -Name "PermissionModeOptions" -Value @(
    [PSCustomObject]@{ Key = 'Full'; Display = '[1] Read/Write Permissions'; Description = 'Grant read/write permissions (recommended)' }
    [PSCustomObject]@{ Key = 'ReadOnly'; Display = '[2] Read-Only Permissions'; Description = 'Grant read-only permissions where possible' }
) -Scope "Script" -Option ReadOnly

# Update options menu
New-Variable -Name "UpdateMenuOptions" -Value @(
    [PSCustomObject]@{ Key = 'AddFeatures'; Display = '[1] Add New Features'; Description = 'Enable additional RealmJoin features' }
    [PSCustomObject]@{ Key = 'RemoveFeatures'; Display = '[2] Remove Features'; Description = 'Disable existing features' }
    [PSCustomObject]@{ Key = 'ChangePermissions'; Display = '[3] Change Permission Mode'; Description = 'Switch between Read/Write and Read-Only' }
) -Scope "Script" -Option ReadOnly

# Tenant already configured options
New-Variable -Name "TenantConfiguredOptions" -Value @(
    [PSCustomObject]@{ Key = 'UpdateTenant'; Display = '[1] Switch to Update Configuration'; Description = 'Modify existing tenant configuration' }
    [PSCustomObject]@{ Key = 'MainMenu'; Display = '[2] Return to Main Menu'; Description = 'Go back to the main menu' }
) -Scope "Script" -Option ReadOnly

# Token retry options
New-Variable -Name "TokenRetryOptions" -Value @(
    [PSCustomObject]@{ Key = 'Manual'; Display = '[1] Enter token manually'; Description = 'Input a new token' }
    [PSCustomObject]@{ Key = 'Portal'; Display = '[2] Open portal to get token'; Description = 'Open features page in browser' }
    [PSCustomObject]@{ Key = 'Skip'; Display = '[3] Skip token verification'; Description = 'Continue without sending token' }
) -Scope "Script" -Option ReadOnly