@selfhelp/shared 1.3.2 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -369,6 +369,681 @@ type IGetPageResponse = IBaseApiResponse<{
369
369
  }>;
370
370
  type IGetPagesResponse = IBaseApiResponse<IPageItem[]>;
371
371
 
372
+ /**
373
+ * System maintenance / update contracts (SelfHelp Manager <-> CMS <-> admin UI).
374
+ *
375
+ * Hard rule: the CMS admin update flow is scoped to the CURRENT instance only.
376
+ * The browser MUST NOT send an arbitrary `instance_id` for update execution; the
377
+ * backend derives and verifies the instance identity server-side. That is why
378
+ * {@link IUpdateRequest} intentionally has no `instance_id` field.
379
+ *
380
+ * These mirror the manager's `@shm/schemas` shapes and the backend JSON schemas
381
+ * under `config/schemas/api/v1/{responses,requests}/admin/`.
382
+ */
383
+
384
+ /** Admin system maintenance endpoints (web admin; not part of the mobile subset). */
385
+ declare const SYSTEM_ENDPOINTS: {
386
+ readonly VERSION: "/cms-api/v1/admin/system/version";
387
+ readonly HEALTH: "/cms-api/v1/admin/system/health";
388
+ readonly ADVISORIES: "/cms-api/v1/admin/system/advisories";
389
+ readonly MAINTENANCE: "/cms-api/v1/admin/system/maintenance";
390
+ readonly UPDATE_PREFLIGHT: "/cms-api/v1/admin/system/update/preflight";
391
+ readonly UPDATE_REQUEST: "/cms-api/v1/admin/system/update/request";
392
+ readonly UPDATE_STATUS: "/cms-api/v1/admin/system/update/status";
393
+ readonly UPDATE_RELEASES: "/cms-api/v1/admin/system/update/releases";
394
+ };
395
+ interface ISystemInstalledPlugin {
396
+ id: string;
397
+ version: string;
398
+ compatible: boolean;
399
+ }
400
+ /**
401
+ * How the backend runtime is deployed. `docker` = the production image
402
+ * published by docker-release.yml (SELFHELP_DEPLOYMENT is baked into the
403
+ * image); `source` = composer dev / bare checkout (the default).
404
+ */
405
+ type TSystemDeployment = 'docker' | 'source';
406
+ /** GET /admin/system/version — current instance version summary. */
407
+ interface ISystemVersion {
408
+ instance_id: string;
409
+ selfhelp_version: string;
410
+ backend_version: string;
411
+ frontend_version: string;
412
+ plugin_api_version: string;
413
+ database_migration_version: string;
414
+ deployment: TSystemDeployment;
415
+ safe_mode: boolean;
416
+ maintenance_mode: boolean;
417
+ installed_plugins: ISystemInstalledPlugin[];
418
+ }
419
+ type ISystemVersionResponse = IBaseApiResponse<ISystemVersion>;
420
+ /** Overall verdict for the aggregated system health endpoint. */
421
+ type TSystemHealthOverall = 'healthy' | 'degraded' | 'down';
422
+ /** Per-subsystem health status. `not_configured`/`unknown` are informational. */
423
+ type TSystemComponentStatus = 'ok' | 'down' | 'degraded' | 'configured' | 'not_configured' | 'unknown';
424
+ interface ISystemHealthComponent {
425
+ name: string;
426
+ status: TSystemComponentStatus;
427
+ detail: string;
428
+ }
429
+ /**
430
+ * GET /admin/system/health — aggregated, instance-scoped health/status.
431
+ * Never contains secrets: connection strings are reduced to configured/not.
432
+ */
433
+ interface ISystemHealth {
434
+ instance_id: string;
435
+ overall: TSystemHealthOverall;
436
+ checked_at: string;
437
+ safe_mode: boolean;
438
+ maintenance_mode: boolean;
439
+ version: {
440
+ selfhelp: string;
441
+ backend: string;
442
+ frontend: string;
443
+ plugin_api: string;
444
+ database_migration: string;
445
+ };
446
+ update: {
447
+ operation_id: string;
448
+ status: string;
449
+ progress_percent: number;
450
+ };
451
+ components: ISystemHealthComponent[];
452
+ }
453
+ type ISystemHealthResponse = IBaseApiResponse<ISystemHealth>;
454
+ /** Advisory severity, matching the registry advisory feed. */
455
+ type TSystemAdvisorySeverity = 'low' | 'medium' | 'high' | 'critical';
456
+ /** An installed component (core/frontend/plugin) an advisory affects. */
457
+ interface ISystemAdvisoryAffected {
458
+ kind: 'core' | 'frontend' | 'plugin';
459
+ id: string;
460
+ installed_version: string;
461
+ }
462
+ interface ISystemAdvisory {
463
+ id: string;
464
+ severity: TSystemAdvisorySeverity;
465
+ recommended_action: string;
466
+ /** Whether the manager blocks updates while an affected version is installed. */
467
+ blocked: boolean;
468
+ details_url: string | null;
469
+ affected: ISystemAdvisoryAffected[];
470
+ fixed_versions: string[];
471
+ }
472
+ /**
473
+ * GET /admin/system/advisories — security advisories from the registry feed,
474
+ * filtered to the components installed on THIS instance. `available: false`
475
+ * means the registry could not be reached (the UI shows "could not check").
476
+ */
477
+ interface ISystemAdvisories {
478
+ available: boolean;
479
+ advisories: ISystemAdvisory[];
480
+ }
481
+ type ISystemAdvisoriesResponse = IBaseApiResponse<ISystemAdvisories>;
482
+ /**
483
+ * GET /admin/system/maintenance — current maintenance-mode state for THIS
484
+ * instance. `forced_by_env` means the env hard switch
485
+ * (SELFHELP_MAINTENANCE_MODE) is on and the CMS cannot disable it. Never
486
+ * contains secrets — only an operator note + the acting user id.
487
+ */
488
+ interface ISystemMaintenance {
489
+ enabled: boolean;
490
+ forced_by_env: boolean;
491
+ message: string;
492
+ since: string;
493
+ updated_by: string;
494
+ safe_mode: boolean;
495
+ }
496
+ type ISystemMaintenanceResponse = IBaseApiResponse<ISystemMaintenance>;
497
+ /**
498
+ * PUT /admin/system/maintenance — enable/disable maintenance for THIS instance.
499
+ * No `instance_id`: the backend derives + verifies it server-side.
500
+ */
501
+ interface IMaintenanceSetRequest {
502
+ enabled: boolean;
503
+ message?: string;
504
+ }
505
+ type TUpdatePreflightStatus = 'ok' | 'warning' | 'blocked';
506
+ type TUpdateCheckSeverity = 'info' | 'warning' | 'error';
507
+ interface IUpdatePreflightCheck {
508
+ code: string;
509
+ severity: TUpdateCheckSeverity;
510
+ message: string;
511
+ /**
512
+ * Standardized compatibility-error fields. Version/compatibility checks
513
+ * (e.g. `plugin_compatibility`) populate these so the admin/operator sees
514
+ * exactly which component blocks which target and the range it requires.
515
+ * Absent on non-compatibility checks.
516
+ */
517
+ component?: string;
518
+ component_id?: string;
519
+ current_version?: string;
520
+ target_version?: string;
521
+ required_range?: string;
522
+ /** Whether this compatibility error blocks the update (mirrors `CompatibilityError.blocking`). */
523
+ blocking?: boolean;
524
+ /**
525
+ * For `plugin_compatibility` checks: whether the blocking plugin is pinned and
526
+ * therefore must be unpinned (or removed) before it can be updated to a
527
+ * compatible version. Absent on non-plugin checks.
528
+ */
529
+ pinned?: boolean;
530
+ }
531
+ /**
532
+ * The single, standardized compatibility-error object used by BOTH the core
533
+ * update preflight AND the plugin install/update flow, so an operator sees the
534
+ * SAME shape regardless of which installer raised it.
535
+ *
536
+ * Canonical cross-repo contract (the field set MUST match on every side):
537
+ * - backend `App\Plugin\Registry\Unified\CompatibilityError::toArray()`,
538
+ * - SelfHelp Manager `@shm/resolver` `CompatibilityError`,
539
+ * - frontend `IPluginCompatibilityError`.
540
+ *
541
+ * The compatibility fields embedded in {@link IUpdatePreflightCheck} mirror this
542
+ * shape (a preflight check additionally carries the generic `code`/`severity`
543
+ * and the plugin-specific `pinned` affordance). Snake_case is the wire contract.
544
+ */
545
+ interface ICompatibilityError {
546
+ component: 'core' | 'frontend' | 'plugin';
547
+ component_id: string;
548
+ current_version: string | null;
549
+ target_version: string | null;
550
+ required_range: string;
551
+ blocking: boolean;
552
+ message: string;
553
+ }
554
+ interface IUpdatePreflightOption {
555
+ type: string;
556
+ version?: string;
557
+ label: string;
558
+ }
559
+ /** One core version published in the official registry index. */
560
+ interface IUpdateRelease {
561
+ version: string;
562
+ channel: 'stable' | 'beta' | 'nightly' | 'test';
563
+ /** Whether the registry marks this release as blocked (e.g. by a security advisory). */
564
+ blocked: boolean;
565
+ }
566
+ /**
567
+ * GET /admin/system/update/releases — core versions published in the official
568
+ * registry (newest first) for the "Request an update" version picker.
569
+ * `available: false` means the registry could not be reached; the UI falls
570
+ * back to manual version entry instead of blocking.
571
+ */
572
+ interface IUpdateReleases {
573
+ available: boolean;
574
+ current_version: string;
575
+ releases: IUpdateRelease[];
576
+ }
577
+ type IUpdateReleasesResponse = IBaseApiResponse<IUpdateReleases>;
578
+ /** GET /admin/system/update/preflight — latest preflight for THIS instance. */
579
+ interface IUpdatePreflight {
580
+ preflight_id: string;
581
+ status: TUpdatePreflightStatus;
582
+ instance_id: string;
583
+ current_version: string;
584
+ target_version: string;
585
+ checks: IUpdatePreflightCheck[];
586
+ options: IUpdatePreflightOption[];
587
+ database: {
588
+ destructive: boolean;
589
+ requires_backup: boolean;
590
+ manual_confirmation_required: boolean;
591
+ };
592
+ rollback: {
593
+ automatic_before_migrations: boolean;
594
+ automatic_after_destructive_migrations: boolean;
595
+ };
596
+ }
597
+ type IUpdatePreflightResponse = IBaseApiResponse<IUpdatePreflight>;
598
+ /**
599
+ * POST /admin/system/update/request — request an update for THIS instance.
600
+ * No `instance_id`: the backend derives + verifies it. A destructive migration
601
+ * requires `accepted_migration_risk: true` (and the typed confirmation).
602
+ */
603
+ interface IUpdateRequest {
604
+ target_version: string;
605
+ preflight_id: string;
606
+ accepted_migration_risk: boolean;
607
+ typed_confirmation?: string;
608
+ }
609
+ /**
610
+ * Update operation lifecycle. `idle` is the synthetic state for an instance that
611
+ * has never run an update (no operation row) — the backend returns it instead of
612
+ * a misleading `succeeded`/100%. The CMS records `requested`; the SelfHelp
613
+ * Manager writes the granular execution states back through the manager loop.
614
+ * `approved` and `running` are kept as coarse legacy states for compatibility.
615
+ */
616
+ type TUpdateOperationStatus = 'idle' | 'requested' | 'approved' | 'accepted' | 'running' | 'preflight_running' | 'preflight_failed' | 'backup_running' | 'update_running' | 'migration_running' | 'health_check_running' | 'succeeded' | 'failed' | 'rollback_running' | 'rolled_back' | 'rollback_failed' | 'rejected';
617
+ interface IUpdateStep {
618
+ name: string;
619
+ status: string;
620
+ detail?: string;
621
+ }
622
+ /** GET /admin/system/update/status — status/progress for THIS instance. */
623
+ interface IUpdateStatus {
624
+ instance_id: string;
625
+ operation_id: string;
626
+ status: TUpdateOperationStatus;
627
+ target_version: string;
628
+ progress_percent: number;
629
+ steps: IUpdateStep[];
630
+ requested_at: string;
631
+ updated_at: string;
632
+ message?: string;
633
+ }
634
+ type IUpdateStatusResponse = IBaseApiResponse<IUpdateStatus>;
635
+ type IUpdateRequestResponse = IBaseApiResponse<{
636
+ operation_id: string;
637
+ instance_id: string;
638
+ status: TUpdateOperationStatus;
639
+ }>;
640
+
641
+ /**
642
+ * Cross-repo SelfHelp distribution contracts: registry index + release metadata
643
+ * (core / frontend / scheduler / worker / plugin), security advisories,
644
+ * compatibility rules, signed trusted keys, the per-instance manifest + lock +
645
+ * inventory, update preflight, backup manifest, and support-bundle metadata.
646
+ *
647
+ * `@selfhelp/shared` is the cross-repo contract SOURCE for these shapes so the
648
+ * web frontend, mobile app, and plugins can consume them without importing the
649
+ * manager. The SelfHelp Manager (`sh-manager/packages/schemas`) keeps the
650
+ * runtime Zod validators + JSON schemas; both MUST stay in parity (verified by
651
+ * `src/types/__tests__/distribution.test.ts` against the manager's example
652
+ * fixtures). The shapes mirror
653
+ * `sh-selfhelp_backend/docs/archive/core-installation-and-distribution-plan.md`.
654
+ *
655
+ * These files are written by the manager as camelCase JSON, so (unlike the
656
+ * snake_case CMS API contracts in `./api/system`) these contracts are camelCase.
657
+ */
658
+ /**
659
+ * Canonical release channels, shared verbatim across the registry wire schema
660
+ * (`sh2-plugin-registry/registry.schema.json`), the SelfHelp Manager
661
+ * (`@shm/schemas`), and the backend (`RegistryReleaseRef::CHANNELS`). `test` is
662
+ * the staging/rehearsal channel used to dry-run a publish→install→update before
663
+ * promoting to `stable`. Kept as a runtime tuple so cross-repo parity can be
664
+ * asserted (see `__tests__/channel-parity.test.ts`).
665
+ */
666
+ declare const RELEASE_CHANNELS: readonly ["stable", "beta", "nightly", "test"];
667
+ type ReleaseChannel = (typeof RELEASE_CHANNELS)[number];
668
+ type InstanceMode = 'production' | 'local';
669
+ type TrustLevel = 'official' | 'reviewed' | 'untrusted';
670
+ type AdvisorySeverity = 'low' | 'medium' | 'high' | 'critical';
671
+ /** Ed25519 detached-signature block shared by every signed registry payload. */
672
+ interface SignatureBlock {
673
+ signature: string;
674
+ keyId: string;
675
+ signedPayload?: string;
676
+ signedPayloadSha256?: string;
677
+ }
678
+ type InstanceStatus = 'active' | 'disabled' | 'removed_keep_data' | 'installing' | 'updating' | 'error';
679
+ interface InventoryInstanceEntry {
680
+ instanceId: string;
681
+ domain: string;
682
+ path: string;
683
+ composeProject: string;
684
+ status: InstanceStatus;
685
+ }
686
+ interface ServerInventory {
687
+ inventoryVersion: number;
688
+ serverId: string;
689
+ manager: {
690
+ name: string;
691
+ repository: string;
692
+ version: string;
693
+ };
694
+ proxy: {
695
+ type: 'traefik';
696
+ network: string;
697
+ composePath: string;
698
+ };
699
+ instances: InventoryInstanceEntry[];
700
+ }
701
+ interface InstanceVersions {
702
+ selfhelp: string;
703
+ backend: string;
704
+ frontend: string;
705
+ scheduler: string;
706
+ worker: string;
707
+ pluginApi: string;
708
+ }
709
+ interface InstanceImages {
710
+ backend: string;
711
+ frontend: string;
712
+ scheduler: string;
713
+ worker: string;
714
+ mysql: string;
715
+ redis: string;
716
+ mercure: string;
717
+ }
718
+ interface InstanceRouting {
719
+ publicFrontendUrl: string;
720
+ browserApiPrefix: string;
721
+ internalSymfonyUrl: string;
722
+ symfonyApiPrefix: string;
723
+ }
724
+ interface InstalledPlugin {
725
+ id: string;
726
+ version: string;
727
+ }
728
+ interface InstanceResourceConfig {
729
+ memoryLimitMb?: number;
730
+ cpuLimit?: number;
731
+ diskWarnThresholdGb?: number;
732
+ logMaxSizeMb?: number;
733
+ logMaxFiles?: number;
734
+ }
735
+ interface InstanceManifest {
736
+ manifestVersion: number;
737
+ instanceId: string;
738
+ displayName: string;
739
+ domain: string;
740
+ mode: InstanceMode;
741
+ createdAt: string;
742
+ updatedAt: string;
743
+ registry: {
744
+ id: string;
745
+ url: string;
746
+ channel: ReleaseChannel;
747
+ };
748
+ versions: InstanceVersions;
749
+ images: InstanceImages;
750
+ routing: InstanceRouting;
751
+ installedPlugins: InstalledPlugin[];
752
+ resources?: InstanceResourceConfig;
753
+ }
754
+ interface LockServiceEntry {
755
+ image: string;
756
+ digest: string;
757
+ }
758
+ interface LockPluginEntry {
759
+ version: string;
760
+ artifactSha256: string;
761
+ signature: string;
762
+ keyId: string;
763
+ compatibility: {
764
+ core: string;
765
+ pluginApi: string;
766
+ };
767
+ }
768
+ interface InstanceLock {
769
+ lockfileVersion: number;
770
+ generatedAt: string;
771
+ operationId?: string;
772
+ registry: {
773
+ id: string;
774
+ url: string;
775
+ metadataSha256: string;
776
+ };
777
+ core: {
778
+ version: string;
779
+ backendImageDigest: string;
780
+ frontendImageDigest: string;
781
+ schedulerImageDigest: string;
782
+ workerImageDigest: string;
783
+ migrationVersion: string;
784
+ pluginApiVersion: string;
785
+ signedPayloadSha256: string;
786
+ };
787
+ services: {
788
+ mysql: LockServiceEntry;
789
+ redis: LockServiceEntry;
790
+ mercure: LockServiceEntry;
791
+ };
792
+ plugins: Record<string, LockPluginEntry>;
793
+ }
794
+ interface RegistryReleaseRef {
795
+ id: string;
796
+ version: string;
797
+ channel: ReleaseChannel;
798
+ releaseUrl: string;
799
+ blocked?: boolean;
800
+ }
801
+ interface RegistryIndex {
802
+ schemaVersion: string;
803
+ requiresManager: string;
804
+ publishedAt: string;
805
+ baseUrl: string;
806
+ publisher: {
807
+ name: string;
808
+ url: string;
809
+ };
810
+ core: RegistryReleaseRef[];
811
+ frontend: RegistryReleaseRef[];
812
+ scheduler: RegistryReleaseRef[];
813
+ worker: RegistryReleaseRef[];
814
+ plugins: RegistryReleaseRef[];
815
+ advisoriesUrl?: string;
816
+ compatibilityUrl?: string;
817
+ trustedKeysUrl?: string;
818
+ }
819
+ interface DatabaseMigrationMetadata {
820
+ migrationRange: string;
821
+ destructive: boolean;
822
+ requiresBackup: boolean;
823
+ manualConfirmationRequired: boolean;
824
+ minimumSafeRollbackPoint?: string;
825
+ automaticRollback?: string;
826
+ }
827
+ interface ImageRef {
828
+ image: string;
829
+ digest: string;
830
+ phpVersion?: string;
831
+ }
832
+ interface RuntimeServiceRange {
833
+ supportedVersions: string;
834
+ minimumRequired?: string;
835
+ recommendedVersion?: string;
836
+ recommendedImage: string;
837
+ recommendedDigest?: string;
838
+ updateRequired?: boolean;
839
+ majorUpgradeRequiresManualApproval?: boolean;
840
+ }
841
+ interface RuntimeServicePolicy {
842
+ php?: {
843
+ backendImagePhpVersion: string;
844
+ };
845
+ mysql: RuntimeServiceRange;
846
+ redis: RuntimeServiceRange;
847
+ mercure: RuntimeServiceRange;
848
+ traefik?: RuntimeServiceRange;
849
+ }
850
+ interface CoreRelease {
851
+ kind: 'selfhelp-core-release';
852
+ id: string;
853
+ version: string;
854
+ channel: ReleaseChannel;
855
+ releasedAt: string;
856
+ minimumDirectUpgradeFrom: string;
857
+ pluginApiVersion: string;
858
+ backend: ImageRef;
859
+ worker: ImageRef;
860
+ scheduler: ImageRef;
861
+ frontendCompatibility: {
862
+ requiredFrontendRange: string;
863
+ };
864
+ database: DatabaseMigrationMetadata;
865
+ runtime?: RuntimeServicePolicy;
866
+ artifacts?: {
867
+ sbom?: {
868
+ url: string;
869
+ sha256: string;
870
+ };
871
+ };
872
+ security: SignatureBlock;
873
+ blocked?: boolean;
874
+ }
875
+ interface FrontendRelease {
876
+ kind: 'selfhelp-frontend-release';
877
+ id: string;
878
+ version: string;
879
+ channel: ReleaseChannel;
880
+ image: string;
881
+ digest: string;
882
+ builtFrom?: {
883
+ nextStandalone: boolean;
884
+ sharedPackageVersion: string;
885
+ };
886
+ backendCompatibility: {
887
+ requiredCoreRange: string;
888
+ requiredApiVersion: string;
889
+ };
890
+ security: SignatureBlock;
891
+ blocked?: boolean;
892
+ }
893
+ /** Compatibility descriptor shared by core-coupled service releases. */
894
+ interface ServiceBackendCompatibility {
895
+ requiredCoreRange: string;
896
+ requiredApiVersion?: string;
897
+ }
898
+ /** Scheduled-jobs runner release, resolved/pinned as a first-class artifact. */
899
+ interface SchedulerRelease {
900
+ kind: 'selfhelp-scheduler-release';
901
+ id: string;
902
+ version: string;
903
+ channel: ReleaseChannel;
904
+ image: string;
905
+ digest: string;
906
+ builtFrom?: Record<string, unknown>;
907
+ backendCompatibility: ServiceBackendCompatibility;
908
+ security: SignatureBlock;
909
+ blocked?: boolean;
910
+ }
911
+ /** Messenger worker release, resolved/pinned as a first-class artifact. */
912
+ interface WorkerRelease {
913
+ kind: 'selfhelp-worker-release';
914
+ id: string;
915
+ version: string;
916
+ channel: ReleaseChannel;
917
+ image: string;
918
+ digest: string;
919
+ builtFrom?: Record<string, unknown>;
920
+ backendCompatibility: ServiceBackendCompatibility;
921
+ security: SignatureBlock;
922
+ blocked?: boolean;
923
+ }
924
+ interface PluginRelease {
925
+ kind: 'selfhelp-plugin-release';
926
+ id: string;
927
+ version: string;
928
+ channel: ReleaseChannel;
929
+ official: boolean;
930
+ compatibility: {
931
+ core: string;
932
+ pluginApi: string;
933
+ };
934
+ dependencies?: {
935
+ plugins: {
936
+ id: string;
937
+ range: string;
938
+ }[];
939
+ };
940
+ artifacts: {
941
+ manifestUrl: string;
942
+ archiveUrl: string;
943
+ sha256: string;
944
+ };
945
+ security: SignatureBlock;
946
+ blocked?: boolean;
947
+ }
948
+ interface CompatibilityRules {
949
+ schemaVersion: string;
950
+ rules: {
951
+ selfhelp: string;
952
+ runtime: RuntimeServicePolicy;
953
+ }[];
954
+ }
955
+ interface AdvisoryAffected {
956
+ kind: 'core' | 'frontend' | 'plugin';
957
+ id?: string;
958
+ versions: string;
959
+ }
960
+ interface SecurityAdvisory {
961
+ id: string;
962
+ severity: AdvisorySeverity;
963
+ affected: AdvisoryAffected[];
964
+ fixed: {
965
+ kind: 'core' | 'frontend' | 'plugin';
966
+ id?: string;
967
+ version: string;
968
+ }[];
969
+ recommendedAction: string;
970
+ blocked: boolean;
971
+ detailsUrl?: string;
972
+ }
973
+ interface AdvisoryFeed {
974
+ schemaVersion: string;
975
+ advisories: SecurityAdvisory[];
976
+ }
977
+ interface TrustedKey {
978
+ keyId: string;
979
+ publicKey: string;
980
+ algorithm: 'ed25519';
981
+ status: 'active' | 'revoked';
982
+ }
983
+ interface TrustedKeysFile {
984
+ schemaVersion: string;
985
+ keys: TrustedKey[];
986
+ }
987
+ type PreflightStatus = 'ok' | 'warning' | 'blocked';
988
+ type CheckSeverity = 'info' | 'warning' | 'error';
989
+ interface PreflightCheck {
990
+ code: string;
991
+ severity: CheckSeverity;
992
+ message: string;
993
+ }
994
+ interface PreflightOption {
995
+ type: string;
996
+ version?: string;
997
+ label: string;
998
+ }
999
+ interface UpdatePreflightResult {
1000
+ preflightVersion: number;
1001
+ status: PreflightStatus;
1002
+ instanceId: string;
1003
+ currentVersion: string;
1004
+ targetVersion: string;
1005
+ checks: PreflightCheck[];
1006
+ options: PreflightOption[];
1007
+ database: {
1008
+ destructive: boolean;
1009
+ requiresBackup: boolean;
1010
+ manualConfirmationRequired: boolean;
1011
+ };
1012
+ rollback: {
1013
+ automaticBeforeMigrations: boolean;
1014
+ /**
1015
+ * MVP policy: automatic rollback is NEVER promised after a destructive
1016
+ * migration (the only recovery is restoring the verified backup).
1017
+ */
1018
+ automaticAfterDestructiveMigrations: boolean;
1019
+ };
1020
+ }
1021
+ interface BackupManifest {
1022
+ backupManifestVersion: number;
1023
+ backupId: string;
1024
+ instanceId: string;
1025
+ createdAt: string;
1026
+ mode: 'maintenance' | 'online';
1027
+ selfhelpVersion: string;
1028
+ migrationVersion: string;
1029
+ plugins: InstalledPlugin[];
1030
+ includedAreas: string[];
1031
+ files: {
1032
+ path: string;
1033
+ sha256: string;
1034
+ bytes: number;
1035
+ }[];
1036
+ }
1037
+ interface SupportBundleMeta {
1038
+ supportBundleVersion: number;
1039
+ instanceId: string;
1040
+ createdAt: string;
1041
+ managerVersion: string;
1042
+ schemaVersions: Record<string, number | string>;
1043
+ redactionApplied: true;
1044
+ contents: string[];
1045
+ }
1046
+
372
1047
  /**
373
1048
  * Frontend-only subset of /cms-api/v1/* endpoints. The web frontend keeps
374
1049
  * its admin endpoints local. The mobile app consumes only what's here.
@@ -664,4 +1339,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
664
1339
  */
665
1340
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
666
1341
 
667
- export { API_VERSION_PREFIX, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, COLOR_NAMES, ENDPOINTS, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type IConditionContext, IContentField, type IEvaluatedCondition, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IGetPageResponse, type IGetPagesResponse, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMeta, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type ISpacingValue, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUserData, type IUserDataResponse, LITERAL_CLASSES, PERMISSIONS, SIZE_VALUES, SPACING_VALUES, type TCalcedValues, type TClassDecision, type TClientType, type TPermission, type TPlatform, TStyleName, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, transformPageData, transformPagesData };
1342
+ export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, CLASS_PATTERNS, CLASS_REMAP, CLIENT_TYPE_MOBILE, CLIENT_TYPE_MOBILE_AND_WEB, CLIENT_TYPE_WEB, COLOR_NAMES, type CheckSeverity, type CompatibilityRules, type CoreRelease, type DatabaseMigrationMetadata, ENDPOINTS, type FrontendRelease, HEADER_CLIENT_TYPE, type IApiError, type IApiMeta, type IAssetSource, type IBaseApiResponse, type IBasePageInfo, type IBasePageSection, type IClassPattern, type IClassRemap, type ICompatibilityError, type IConditionContext, IContentField, type IEvaluatedCondition, type IForgotPasswordRequest, type IForgotPasswordResponse, type IFormDeleteRequest, type IFormDeleteResponse, type IFormResultLegacyFields, type IFormSubmitData, type IFormSubmitRequest, type IFormSubmitResponse, type IFormUpdateData, type IFormUpdateRequest, type IFormUpdateResponse, type IGetPageResponse, type IGetPagesResponse, type IJwtPayload, type ILanguage, type ILanguageItem, type ILanguagePreference, type ILanguagePreferenceUpdateResponse, type ILanguagesResponse, type ILoginRequest, type ILoginSuccessData, type ILoginSuccessResponse, type ILogoutSuccessResponse, type IMaintenanceSetRequest, type IMeta, type IPageAccessTypeInfo, type IPageContent, type IPageField, type IPageFieldTranslation, type IPageFieldsData, type IPageItem, type IPageSectionWithFields, type IPageSectionsData, type IRefreshRequest, type IRefreshSuccessResponse, type IResetPasswordRequest, type IResetPasswordResponse, type ISpacingValue, type ISystemAdvisories, type ISystemAdvisoriesResponse, type ISystemAdvisory, type ISystemAdvisoryAffected, type ISystemHealth, type ISystemHealthComponent, type ISystemHealthResponse, type ISystemInstalledPlugin, type ISystemMaintenance, type ISystemMaintenanceResponse, type ISystemVersion, type ISystemVersionResponse, type ITwoFactorRequiredData, type ITwoFactorRequiredResponse, type ITwoFactorVerifyRequest, type ITwoFactorVerifySuccessResponse, type IUpdatePreflight, type IUpdatePreflightCheck, type IUpdatePreflightOption, type IUpdatePreflightResponse, type IUpdateRelease, type IUpdateReleases, type IUpdateReleasesResponse, type IUpdateRequest, type IUpdateRequestResponse, type IUpdateStatus, type IUpdateStatusResponse, type IUpdateStep, type IUserData, type IUserDataResponse, type ImageRef, type InstalledPlugin, type InstanceImages, type InstanceLock, type InstanceManifest, type InstanceMode, type InstanceResourceConfig, type InstanceRouting, type InstanceStatus, type InstanceVersions, type InventoryInstanceEntry, LITERAL_CLASSES, type LockPluginEntry, type LockServiceEntry, PERMISSIONS, type PluginRelease, type PreflightCheck, type PreflightOption, type PreflightStatus, RELEASE_CHANNELS, type RegistryIndex, type RegistryReleaseRef, type ReleaseChannel, type RuntimeServicePolicy, type RuntimeServiceRange, SIZE_VALUES, SPACING_VALUES, SYSTEM_ENDPOINTS, type SchedulerRelease, type SecurityAdvisory, type ServerInventory, type ServiceBackendCompatibility, type SignatureBlock, type SupportBundleMeta, type TCalcedValues, type TClassDecision, type TClientType, type TPermission, type TPlatform, TStyleName, type TSystemAdvisorySeverity, type TSystemComponentStatus, type TSystemDeployment, type TSystemHealthOverall, type TUpdateCheckSeverity, type TUpdateOperationStatus, type TUpdatePreflightStatus, type TrustLevel, type TrustedKey, type TrustedKeysFile, type UpdatePreflightResult, type WorkerRelease, buildConditionContext, classifyClass, classifyClassString, evaluateCondition, findRemap, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, transformPageData, transformPagesData };