Optera.LicenseReclaim.psm1

<#
    Optera.LicenseReclaim - root module
    Dot-sources every function in src/Private and src/Public, then exports the
    public surface only. Keeping one function per file (Public/Private split) is
    the convention every future Optera AI PowerShell product follows.
#>


Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

$private = @(Get-ChildItem -Path (Join-Path $PSScriptRoot 'src/Private') -Filter '*.ps1' -ErrorAction SilentlyContinue)
$public  = @(Get-ChildItem -Path (Join-Path $PSScriptRoot 'src/Public')  -Filter '*.ps1' -ErrorAction SilentlyContinue)

foreach ($file in @($private + $public)) {
    try {
        . $file.FullName
    }
    catch {
        throw "Optera.LicenseReclaim: failed to load $($file.FullName): $_"
    }
}

# Path to bundled data (price list) so functions can resolve it without guessing.
$script:OpteraLicenseReclaimDataRoot = Join-Path $PSScriptRoot 'src/Data'

# License validation endpoint (override with $env:OPTERA_LICENSE_ENDPOINT for dev/test).
$script:OpteraLicenseEndpoint = if ($env:OPTERA_LICENSE_ENDPOINT) {
    $env:OPTERA_LICENSE_ENDPOINT
} else {
    'https://licensing.opteraai.com/api/license/validate'
}

# Product version reported to the validation endpoint (no PII).
$script:OpteraLicenseReclaimVersion = '0.2.0'

Export-ModuleMember -Function $public.BaseName