mirror of
https://github.com/saltbo/zpan.git
synced 2026-09-21 04:59:47 +08:00
refactor(usecases): consolidate licensing into one file, merge tiny usecases, drop dead code (#434)
Group all license application logic into a single usecases/licensing.ts (certificate/token verification, binding-state, cloud refresh, license-gated policy) and collapse small single-purpose usecases that belonged together. - delete license-entitlement.ts: a write-only cache nobody read (loadEntitlement had zero live consumers); remove its invalidate* call-sites - merge licensing-refresh-runner -> license-refresh, then fold license-certificate + license-refresh + license-policy + binding-state into one licensing.ts (internal cert<-state<-refresh<-policy edges become in-file) - merge team-count + signup-mode -> license-policy (then into licensing.ts) - merge trash-retention -> purge (manual purge + scheduled retention sweep) Tests follow the source: the runner tests are rewritten against a fake LicensingCloud port (the old module-spy on performRefresh can't survive a same-module call), and the team-limit test seeds a real pro license instead of mocking the licensing module. Net 486+/861-. typecheck clean; unit+integration green (158 files / 3797 tests). Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
191ee0a07d
commit
fbec74747e
@@ -5,9 +5,9 @@ import { createDeps } from '../server/composition'
|
||||
import { createCloudflarePlatform } from '../server/platform/cloudflare'
|
||||
import { syncPendingCloudTrafficReports } from '../server/usecases/cloud-traffic-metering'
|
||||
import { INSTANCE_TELEMETRY_CRON, reportInstanceTelemetry } from '../server/usecases/instance-telemetry'
|
||||
import { runLicensingRefresh } from '../server/usecases/licensing-refresh-runner'
|
||||
import { runLicensingRefresh } from '../server/usecases/licensing'
|
||||
import { purgeExpiredTrash, resolveTrashRetentionDays } from '../server/usecases/purge'
|
||||
import { syncPendingRemoteDownloadUsageReports } from '../server/usecases/remote-download-usage'
|
||||
import { purgeExpiredTrash, resolveTrashRetentionDays } from '../server/usecases/trash-retention'
|
||||
import { ZPAN_CLOUD_URL_DEFAULT } from '../shared/constants'
|
||||
|
||||
// Subset of the worker Env used by the scheduled handler.
|
||||
|
||||
Reference in New Issue
Block a user