import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk'

/**
 * v1.0.0:1 — initial Proof of Work release.
 *
 * Upstream version: 1.0.0
 * Wrapper rev:      1
 *
 * This is a one-shot "seeded cutover" release for users migrating from the
 * old `workout-log` StartOS package. The Docker image bakes in a snapshot of
 * the maintainer's live /data volume under /app/seed/data; the entrypoint
 * copies that snapshot into the new StartOS-managed /data volume only on a
 * truly-fresh first boot (both /data/app.db missing AND /data/.seeded
 * absent). Every subsequent boot leaves /data untouched.
 *
 * Because StartOS treats `proof-of-work` as a brand new service (different
 * package id from `workout-log`), the old install stays running until the
 * operator confirms the cutover and stops it manually. There is no
 * downgrade path; `down` is IMPOSSIBLE.
 *
 * The post-cutover cleanup release (v1.0.0:2) will strip the baked seed and
 * the seed-copy branch from docker_entrypoint.sh.
 */
export const v_1_0_0_1 = VersionInfo.of({
  version: '1.0.0:1',
  releaseNotes: {
    en_US:
      'Initial Proof of Work release. Replaces the legacy `workout-log` package with: (1) multi-user support — anyone with the URL can sign up when admin enables it, via Settings or the new "Set new signups" StartOS action; (2) a curated exercise library shared across all users — additive on every upgrade, so new exercises shipped by the maintainer reach existing installs without overwriting users\' own custom entries; (3) one-time seeded cutover from /data on the legacy `workout-log` host so every workout, exercise, and preference comes across; (4) the `change-admin-credentials` StartOS action targeting the primary admin (User.isAdmin = 1).',
  },
  migrations: {
    up: async () => {},
    down: IMPOSSIBLE,
  },
})
