@selfhelp/shared 1.6.0 → 1.6.1

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/CHANGELOG.md CHANGED
@@ -9,6 +9,30 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
9
9
 
10
10
  This project follows semantic versioning.
11
11
 
12
+ ## v1.6.1
13
+
14
+ ### Added
15
+
16
+ - Frontend-only update contracts (the frontend ships independently of the core,
17
+ so an instance on the newest core can still move to a newer compatible
18
+ frontend): the `SYSTEM_ENDPOINTS.UPDATE_FRONTEND_RELEASES` /
19
+ `UPDATE_FRONTEND_PREFLIGHT` / `UPDATE_FRONTEND_REQUEST` path constants, the
20
+ `TUpdateKind = 'core' | 'frontend'` discriminator, `IFrontendUpdateRequest`
21
+ (`target_version` + `preflight_id` — no `accepted_migration_risk`, a frontend
22
+ swap is stateless), `IFrontendUpdateRequestResponse` (carries
23
+ `kind: 'frontend'` + `target_frontend_version`), and the
24
+ `IFrontendUpdateReleases(Response)` / `IFrontendUpdatePreflight(Response)`
25
+ aliases (the frontend reuses the core releases/preflight shapes).
26
+
27
+ ### Changed
28
+
29
+ - `IUpdateStatus` gains two **required** fields: `kind` (`TUpdateKind`) and
30
+ `target_frontend_version` (`string | null`), so the status UI can label a
31
+ frontend-only operation correctly. Additive but required in the response (the
32
+ backend schema `responses/admin/update_status.json` requires both); consumers'
33
+ fixtures/mocks must add them (`kind: 'core'`, `target_frontend_version: null`
34
+ for a core/idle status).
35
+
12
36
  ## v1.6.0
13
37
 
14
38
  ### Added
package/dist/index.d.mts CHANGED
@@ -391,7 +391,12 @@ declare const SYSTEM_ENDPOINTS: {
391
391
  readonly UPDATE_REQUEST: "/cms-api/v1/admin/system/update/request";
392
392
  readonly UPDATE_STATUS: "/cms-api/v1/admin/system/update/status";
393
393
  readonly UPDATE_RELEASES: "/cms-api/v1/admin/system/update/releases";
394
+ readonly UPDATE_FRONTEND_RELEASES: "/cms-api/v1/admin/system/update/frontend/releases";
395
+ readonly UPDATE_FRONTEND_PREFLIGHT: "/cms-api/v1/admin/system/update/frontend/preflight";
396
+ readonly UPDATE_FRONTEND_REQUEST: "/cms-api/v1/admin/system/update/frontend/request";
394
397
  };
398
+ /** Discriminates a core (full-stack) update from a frontend-only update. */
399
+ type TUpdateKind = 'core' | 'frontend';
395
400
  interface ISystemInstalledPlugin {
396
401
  id: string;
397
402
  version: string;
@@ -637,7 +642,19 @@ interface IUpdateStatus {
637
642
  instance_id: string;
638
643
  operation_id: string;
639
644
  status: TUpdateOperationStatus;
645
+ /**
646
+ * Whether the latest operation is a full-stack core update or a frontend-only
647
+ * update. `idle` (no operation yet) reports `core`. Lets the status UI label a
648
+ * frontend swap correctly instead of implying a core upgrade.
649
+ */
650
+ kind: TUpdateKind;
640
651
  target_version: string;
652
+ /**
653
+ * The frontend version a `frontend`-kind operation targets; `null` for a
654
+ * core operation (the manager resolves the compatible frontend itself) and
655
+ * for the synthetic `idle` status.
656
+ */
657
+ target_frontend_version: string | null;
641
658
  progress_percent: number;
642
659
  steps: IUpdateStep[];
643
660
  requested_at: string;
@@ -651,6 +668,45 @@ type IUpdateRequestResponse = IBaseApiResponse<{
651
668
  instance_id: string;
652
669
  status: TUpdateOperationStatus;
653
670
  }>;
671
+ /**
672
+ * POST /admin/system/update/frontend/request — request a FRONTEND-only update
673
+ * for THIS instance. Like {@link IUpdateRequest} it carries no `instance_id`
674
+ * (the backend derives + verifies it), but it also omits
675
+ * `accepted_migration_risk`/`typed_confirmation`: a frontend swap is stateless,
676
+ * so there is no destructive migration to confirm. The SelfHelp Manager
677
+ * re-resolves the signed frontend release and is the final authority on
678
+ * compatibility before it swaps the container.
679
+ */
680
+ interface IFrontendUpdateRequest {
681
+ target_version: string;
682
+ preflight_id: string;
683
+ }
684
+ /**
685
+ * GET /admin/system/update/frontend/releases — frontend versions published in
686
+ * the official registry (newest first). Reuses {@link IUpdateReleases}:
687
+ * `current_version` is the instance's installed frontend version and
688
+ * `available: false` means the registry was unreachable (fall back to manual
689
+ * entry). Aliased for call-site clarity.
690
+ */
691
+ type IFrontendUpdateReleases = IUpdateReleases;
692
+ type IFrontendUpdateReleasesResponse = IUpdateReleasesResponse;
693
+ /**
694
+ * GET /admin/system/update/frontend/preflight — lightweight compatibility
695
+ * verdict for a frontend-only target. Reuses {@link IUpdatePreflight}; the
696
+ * frontend is stateless so `database.destructive`/`requires_backup` are always
697
+ * false and the authoritative frontend ⇄ core + signature checks are deferred to
698
+ * the manager. Aliased for call-site clarity.
699
+ */
700
+ type IFrontendUpdatePreflight = IUpdatePreflight;
701
+ type IFrontendUpdatePreflightResponse = IUpdatePreflightResponse;
702
+ /** POST /admin/system/update/frontend/request — accepted frontend-update record. */
703
+ type IFrontendUpdateRequestResponse = IBaseApiResponse<{
704
+ operation_id: string;
705
+ instance_id: string;
706
+ status: TUpdateOperationStatus;
707
+ kind: 'frontend';
708
+ target_frontend_version: string;
709
+ }>;
654
710
 
655
711
  /**
656
712
  * Cross-repo SelfHelp distribution contracts: registry index + release metadata
@@ -1353,4 +1409,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
1353
1409
  */
1354
1410
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
1355
1411
 
1356
- 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 IUpdateStatusManager, 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 };
1412
+ 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 IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, 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 IUpdateStatusManager, 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 TUpdateKind, 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 };
package/dist/index.d.ts CHANGED
@@ -391,7 +391,12 @@ declare const SYSTEM_ENDPOINTS: {
391
391
  readonly UPDATE_REQUEST: "/cms-api/v1/admin/system/update/request";
392
392
  readonly UPDATE_STATUS: "/cms-api/v1/admin/system/update/status";
393
393
  readonly UPDATE_RELEASES: "/cms-api/v1/admin/system/update/releases";
394
+ readonly UPDATE_FRONTEND_RELEASES: "/cms-api/v1/admin/system/update/frontend/releases";
395
+ readonly UPDATE_FRONTEND_PREFLIGHT: "/cms-api/v1/admin/system/update/frontend/preflight";
396
+ readonly UPDATE_FRONTEND_REQUEST: "/cms-api/v1/admin/system/update/frontend/request";
394
397
  };
398
+ /** Discriminates a core (full-stack) update from a frontend-only update. */
399
+ type TUpdateKind = 'core' | 'frontend';
395
400
  interface ISystemInstalledPlugin {
396
401
  id: string;
397
402
  version: string;
@@ -637,7 +642,19 @@ interface IUpdateStatus {
637
642
  instance_id: string;
638
643
  operation_id: string;
639
644
  status: TUpdateOperationStatus;
645
+ /**
646
+ * Whether the latest operation is a full-stack core update or a frontend-only
647
+ * update. `idle` (no operation yet) reports `core`. Lets the status UI label a
648
+ * frontend swap correctly instead of implying a core upgrade.
649
+ */
650
+ kind: TUpdateKind;
640
651
  target_version: string;
652
+ /**
653
+ * The frontend version a `frontend`-kind operation targets; `null` for a
654
+ * core operation (the manager resolves the compatible frontend itself) and
655
+ * for the synthetic `idle` status.
656
+ */
657
+ target_frontend_version: string | null;
641
658
  progress_percent: number;
642
659
  steps: IUpdateStep[];
643
660
  requested_at: string;
@@ -651,6 +668,45 @@ type IUpdateRequestResponse = IBaseApiResponse<{
651
668
  instance_id: string;
652
669
  status: TUpdateOperationStatus;
653
670
  }>;
671
+ /**
672
+ * POST /admin/system/update/frontend/request — request a FRONTEND-only update
673
+ * for THIS instance. Like {@link IUpdateRequest} it carries no `instance_id`
674
+ * (the backend derives + verifies it), but it also omits
675
+ * `accepted_migration_risk`/`typed_confirmation`: a frontend swap is stateless,
676
+ * so there is no destructive migration to confirm. The SelfHelp Manager
677
+ * re-resolves the signed frontend release and is the final authority on
678
+ * compatibility before it swaps the container.
679
+ */
680
+ interface IFrontendUpdateRequest {
681
+ target_version: string;
682
+ preflight_id: string;
683
+ }
684
+ /**
685
+ * GET /admin/system/update/frontend/releases — frontend versions published in
686
+ * the official registry (newest first). Reuses {@link IUpdateReleases}:
687
+ * `current_version` is the instance's installed frontend version and
688
+ * `available: false` means the registry was unreachable (fall back to manual
689
+ * entry). Aliased for call-site clarity.
690
+ */
691
+ type IFrontendUpdateReleases = IUpdateReleases;
692
+ type IFrontendUpdateReleasesResponse = IUpdateReleasesResponse;
693
+ /**
694
+ * GET /admin/system/update/frontend/preflight — lightweight compatibility
695
+ * verdict for a frontend-only target. Reuses {@link IUpdatePreflight}; the
696
+ * frontend is stateless so `database.destructive`/`requires_backup` are always
697
+ * false and the authoritative frontend ⇄ core + signature checks are deferred to
698
+ * the manager. Aliased for call-site clarity.
699
+ */
700
+ type IFrontendUpdatePreflight = IUpdatePreflight;
701
+ type IFrontendUpdatePreflightResponse = IUpdatePreflightResponse;
702
+ /** POST /admin/system/update/frontend/request — accepted frontend-update record. */
703
+ type IFrontendUpdateRequestResponse = IBaseApiResponse<{
704
+ operation_id: string;
705
+ instance_id: string;
706
+ status: TUpdateOperationStatus;
707
+ kind: 'frontend';
708
+ target_frontend_version: string;
709
+ }>;
654
710
 
655
711
  /**
656
712
  * Cross-repo SelfHelp distribution contracts: registry index + release metadata
@@ -1353,4 +1409,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
1353
1409
  */
1354
1410
  declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
1355
1411
 
1356
- 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 IUpdateStatusManager, 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 };
1412
+ 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 IFrontendUpdatePreflight, type IFrontendUpdatePreflightResponse, type IFrontendUpdateReleases, type IFrontendUpdateReleasesResponse, type IFrontendUpdateRequest, type IFrontendUpdateRequestResponse, 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 IUpdateStatusManager, 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 TUpdateKind, 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 };
package/dist/index.js CHANGED
@@ -147,7 +147,15 @@ var SYSTEM_ENDPOINTS = {
147
147
  UPDATE_PREFLIGHT: `${SYSTEM_PREFIX}/update/preflight`,
148
148
  UPDATE_REQUEST: `${SYSTEM_PREFIX}/update/request`,
149
149
  UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status`,
150
- UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`
150
+ UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`,
151
+ // Frontend-only update flow. The frontend ships independently of the core,
152
+ // so an instance already on the newest core can still move to a newer
153
+ // compatible frontend. These reuse the core preflight/releases response
154
+ // shapes; the request body omits `accepted_migration_risk` (a frontend swap
155
+ // is stateless — no destructive migration, no backup).
156
+ UPDATE_FRONTEND_RELEASES: `${SYSTEM_PREFIX}/update/frontend/releases`,
157
+ UPDATE_FRONTEND_PREFLIGHT: `${SYSTEM_PREFIX}/update/frontend/preflight`,
158
+ UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request`
151
159
  };
152
160
 
153
161
  // src/types/distribution.ts
package/dist/index.mjs CHANGED
@@ -60,7 +60,15 @@ var SYSTEM_ENDPOINTS = {
60
60
  UPDATE_PREFLIGHT: `${SYSTEM_PREFIX}/update/preflight`,
61
61
  UPDATE_REQUEST: `${SYSTEM_PREFIX}/update/request`,
62
62
  UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status`,
63
- UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`
63
+ UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`,
64
+ // Frontend-only update flow. The frontend ships independently of the core,
65
+ // so an instance already on the newest core can still move to a newer
66
+ // compatible frontend. These reuse the core preflight/releases response
67
+ // shapes; the request body omits `accepted_migration_risk` (a frontend swap
68
+ // is stateless — no destructive migration, no backup).
69
+ UPDATE_FRONTEND_RELEASES: `${SYSTEM_PREFIX}/update/frontend/releases`,
70
+ UPDATE_FRONTEND_PREFLIGHT: `${SYSTEM_PREFIX}/update/frontend/preflight`,
71
+ UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request`
64
72
  };
65
73
 
66
74
  // src/types/distribution.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@selfhelp/shared",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Shared TypeScript package for SelfHelp web frontend and mobile app: style registry, types, API contracts, Mantine theme tokens, condition + interpolation engines, CMS class allow-list.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -6,6 +6,10 @@
6
6
  import { describe, expect, it } from 'vitest';
7
7
  import { SYSTEM_ENDPOINTS } from '../system';
8
8
  import type {
9
+ IFrontendUpdatePreflight,
10
+ IFrontendUpdateReleases,
11
+ IFrontendUpdateRequest,
12
+ IFrontendUpdateRequestResponse,
9
13
  IMaintenanceSetRequest,
10
14
  ISystemAdvisories,
11
15
  ISystemAdvisoriesResponse,
@@ -19,6 +23,7 @@ import type {
19
23
  IUpdateStatus,
20
24
  IUpdateStatusResponse,
21
25
  TSystemAdvisorySeverity,
26
+ TUpdateKind,
22
27
  TUpdateOperationStatus,
23
28
  } from '../system';
24
29
 
@@ -38,6 +43,13 @@ describe('system maintenance contracts', () => {
38
43
  expect(SYSTEM_ENDPOINTS.UPDATE_PREFLIGHT).toBe('/cms-api/v1/admin/system/update/preflight');
39
44
  expect(SYSTEM_ENDPOINTS.UPDATE_REQUEST).toBe('/cms-api/v1/admin/system/update/request');
40
45
  expect(SYSTEM_ENDPOINTS.UPDATE_STATUS).toBe('/cms-api/v1/admin/system/update/status');
46
+ expect(SYSTEM_ENDPOINTS.UPDATE_RELEASES).toBe('/cms-api/v1/admin/system/update/releases');
47
+ });
48
+
49
+ it('exposes the frontend-only update endpoints under update/frontend', () => {
50
+ expect(SYSTEM_ENDPOINTS.UPDATE_FRONTEND_RELEASES).toBe('/cms-api/v1/admin/system/update/frontend/releases');
51
+ expect(SYSTEM_ENDPOINTS.UPDATE_FRONTEND_PREFLIGHT).toBe('/cms-api/v1/admin/system/update/frontend/preflight');
52
+ expect(SYSTEM_ENDPOINTS.UPDATE_FRONTEND_REQUEST).toBe('/cms-api/v1/admin/system/update/frontend/request');
41
53
  });
42
54
 
43
55
  it('advisories model the registry feed filtered to installed components', () => {
@@ -168,7 +180,9 @@ describe('system maintenance contracts', () => {
168
180
  instance_id: 'inst-a',
169
181
  operation_id: 'op-001',
170
182
  status: 'running',
183
+ kind: 'core',
171
184
  target_version: '1.5.0',
185
+ target_frontend_version: null,
172
186
  progress_percent: 42,
173
187
  steps: [{ name: 'backup', status: 'succeeded' }],
174
188
  requested_at: '2026-06-08T00:00:00Z',
@@ -231,7 +245,9 @@ describe('system maintenance contracts', () => {
231
245
  instance_id: 'inst-a',
232
246
  operation_id: 'op-term',
233
247
  status: s,
248
+ kind: 'core',
234
249
  target_version: '8.0.1',
250
+ target_frontend_version: null,
235
251
  progress_percent: 100,
236
252
  steps: [],
237
253
  requested_at: '2026-06-08T00:00:00Z',
@@ -271,7 +287,9 @@ describe('system maintenance contracts', () => {
271
287
  instance_id: 'inst-a',
272
288
  operation_id: 'op-001',
273
289
  status: 'succeeded',
290
+ kind: 'core',
274
291
  target_version: '8.0.1',
292
+ target_frontend_version: null,
275
293
  progress_percent: 100,
276
294
  steps: [{ name: 'migrate', status: 'succeeded' }],
277
295
  requested_at: '2026-06-08T00:00:00Z',
@@ -284,4 +302,82 @@ describe('system maintenance contracts', () => {
284
302
  expect(requested.status).toBe(202);
285
303
  expect(statusResponse.data.status).toBe('succeeded');
286
304
  });
305
+
306
+ it('frontend-only update request omits instance_id AND the destructive-migration risk fields', () => {
307
+ // A frontend swap is stateless: there is no destructive migration to
308
+ // confirm, so — unlike IUpdateRequest — the frontend request body has no
309
+ // `accepted_migration_risk`/`typed_confirmation`, and (like every update
310
+ // request) no `instance_id` (the backend derives + verifies it).
311
+ const req: IFrontendUpdateRequest = { target_version: '0.1.7', preflight_id: 'fe-pf-001' };
312
+ const keys = Object.keys(req);
313
+ expect(keys).not.toContain('instance_id');
314
+ expect(keys).not.toContain('accepted_migration_risk');
315
+ expect(keys).not.toContain('typed_confirmation');
316
+ expect(keys.sort()).toEqual(['preflight_id', 'target_version']);
317
+ });
318
+
319
+ it('frontend releases + preflight reuse the core shapes but the preflight is never destructive', () => {
320
+ const releases: IFrontendUpdateReleases = {
321
+ available: true,
322
+ current_version: '0.1.5',
323
+ releases: [
324
+ { version: '0.1.7', channel: 'stable', blocked: false },
325
+ { version: '0.1.5', channel: 'stable', blocked: false },
326
+ ],
327
+ };
328
+ const preflight: IFrontendUpdatePreflight = {
329
+ preflight_id: 'fe-pf-001',
330
+ status: 'ok',
331
+ instance_id: 'inst-a',
332
+ current_version: '0.1.5',
333
+ target_version: '0.1.7',
334
+ checks: [{ code: 'resource', severity: 'info', message: 'Manager performs the authoritative checks.' }],
335
+ options: [{ type: 'frontend', version: '0.1.7', label: 'SelfHelp frontend 0.1.7' }],
336
+ // The frontend is stateless: a swap is never destructive and needs no backup.
337
+ database: { destructive: false, requires_backup: false, manual_confirmation_required: false },
338
+ rollback: { automatic_before_migrations: true, automatic_after_destructive_migrations: true },
339
+ };
340
+
341
+ expect(releases.releases[0]?.version).toBe('0.1.7');
342
+ expect(preflight.database.destructive).toBe(false);
343
+ expect(preflight.database.requires_backup).toBe(false);
344
+ });
345
+
346
+ it('a frontend-kind status/response carries the targeted frontend version', () => {
347
+ const kinds: TUpdateKind[] = ['core', 'frontend'];
348
+ expect(kinds).toEqual(['core', 'frontend']);
349
+
350
+ const status: IUpdateStatus = {
351
+ instance_id: 'inst-a',
352
+ operation_id: 'op-fe-1',
353
+ status: 'update_running',
354
+ kind: 'frontend',
355
+ target_version: '0.1.7',
356
+ target_frontend_version: '0.1.7',
357
+ progress_percent: 50,
358
+ steps: [{ name: 'pull', status: 'succeeded' }],
359
+ requested_at: '2026-06-15T00:00:00Z',
360
+ updated_at: '2026-06-15T00:01:00Z',
361
+ };
362
+
363
+ const accepted: IFrontendUpdateRequestResponse = {
364
+ status: 202,
365
+ message: 'Accepted',
366
+ error: null,
367
+ logged_in: true,
368
+ meta: { version: 'v1', timestamp: '2026-06-15T00:00:00Z' },
369
+ data: {
370
+ operation_id: 'op-fe-1',
371
+ instance_id: 'inst-a',
372
+ status: 'requested',
373
+ kind: 'frontend',
374
+ target_frontend_version: '0.1.7',
375
+ },
376
+ };
377
+
378
+ expect(status.kind).toBe('frontend');
379
+ expect(status.target_frontend_version).toBe('0.1.7');
380
+ expect(accepted.data.kind).toBe('frontend');
381
+ expect(accepted.data.target_frontend_version).toBe('0.1.7');
382
+ });
287
383
  });
@@ -27,8 +27,19 @@ export const SYSTEM_ENDPOINTS = {
27
27
  UPDATE_REQUEST: `${SYSTEM_PREFIX}/update/request`,
28
28
  UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status`,
29
29
  UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`,
30
+ // Frontend-only update flow. The frontend ships independently of the core,
31
+ // so an instance already on the newest core can still move to a newer
32
+ // compatible frontend. These reuse the core preflight/releases response
33
+ // shapes; the request body omits `accepted_migration_risk` (a frontend swap
34
+ // is stateless — no destructive migration, no backup).
35
+ UPDATE_FRONTEND_RELEASES: `${SYSTEM_PREFIX}/update/frontend/releases`,
36
+ UPDATE_FRONTEND_PREFLIGHT: `${SYSTEM_PREFIX}/update/frontend/preflight`,
37
+ UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request`,
30
38
  } as const;
31
39
 
40
+ /** Discriminates a core (full-stack) update from a frontend-only update. */
41
+ export type TUpdateKind = 'core' | 'frontend';
42
+
32
43
  export interface ISystemInstalledPlugin {
33
44
  id: string;
34
45
  version: string;
@@ -321,7 +332,19 @@ export interface IUpdateStatus {
321
332
  instance_id: string;
322
333
  operation_id: string;
323
334
  status: TUpdateOperationStatus;
335
+ /**
336
+ * Whether the latest operation is a full-stack core update or a frontend-only
337
+ * update. `idle` (no operation yet) reports `core`. Lets the status UI label a
338
+ * frontend swap correctly instead of implying a core upgrade.
339
+ */
340
+ kind: TUpdateKind;
324
341
  target_version: string;
342
+ /**
343
+ * The frontend version a `frontend`-kind operation targets; `null` for a
344
+ * core operation (the manager resolves the compatible frontend itself) and
345
+ * for the synthetic `idle` status.
346
+ */
347
+ target_frontend_version: string | null;
325
348
  progress_percent: number;
326
349
  steps: IUpdateStep[];
327
350
  requested_at: string;
@@ -336,3 +359,46 @@ export type IUpdateRequestResponse = IBaseApiResponse<{
336
359
  instance_id: string;
337
360
  status: TUpdateOperationStatus;
338
361
  }>;
362
+
363
+ /**
364
+ * POST /admin/system/update/frontend/request — request a FRONTEND-only update
365
+ * for THIS instance. Like {@link IUpdateRequest} it carries no `instance_id`
366
+ * (the backend derives + verifies it), but it also omits
367
+ * `accepted_migration_risk`/`typed_confirmation`: a frontend swap is stateless,
368
+ * so there is no destructive migration to confirm. The SelfHelp Manager
369
+ * re-resolves the signed frontend release and is the final authority on
370
+ * compatibility before it swaps the container.
371
+ */
372
+ export interface IFrontendUpdateRequest {
373
+ target_version: string;
374
+ preflight_id: string;
375
+ }
376
+
377
+ /**
378
+ * GET /admin/system/update/frontend/releases — frontend versions published in
379
+ * the official registry (newest first). Reuses {@link IUpdateReleases}:
380
+ * `current_version` is the instance's installed frontend version and
381
+ * `available: false` means the registry was unreachable (fall back to manual
382
+ * entry). Aliased for call-site clarity.
383
+ */
384
+ export type IFrontendUpdateReleases = IUpdateReleases;
385
+ export type IFrontendUpdateReleasesResponse = IUpdateReleasesResponse;
386
+
387
+ /**
388
+ * GET /admin/system/update/frontend/preflight — lightweight compatibility
389
+ * verdict for a frontend-only target. Reuses {@link IUpdatePreflight}; the
390
+ * frontend is stateless so `database.destructive`/`requires_backup` are always
391
+ * false and the authoritative frontend ⇄ core + signature checks are deferred to
392
+ * the manager. Aliased for call-site clarity.
393
+ */
394
+ export type IFrontendUpdatePreflight = IUpdatePreflight;
395
+ export type IFrontendUpdatePreflightResponse = IUpdatePreflightResponse;
396
+
397
+ /** POST /admin/system/update/frontend/request — accepted frontend-update record. */
398
+ export type IFrontendUpdateRequestResponse = IBaseApiResponse<{
399
+ operation_id: string;
400
+ instance_id: string;
401
+ status: TUpdateOperationStatus;
402
+ kind: 'frontend';
403
+ target_frontend_version: string;
404
+ }>;