@selfhelp/shared 1.4.0 → 1.6.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/CHANGELOG.md +32 -0
- package/dist/index.d.mts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
- package/src/types/__tests__/distribution.test.ts +2 -2
- package/src/types/api/system.ts +45 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,38 @@ 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.0
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `IUpdateStatus.manager` (`IUpdateStatusManager`): manager-loop visibility on
|
|
17
|
+
the update status — `configured` (instance has a manager token),
|
|
18
|
+
`last_seen_at` (last authenticated manager poll, null = never), and
|
|
19
|
+
`requested_stale` (the latest operation sat in `requested` too long without
|
|
20
|
+
the manager claiming it). Additive but **required** in the response — the
|
|
21
|
+
backend schema `responses/admin/update_status.json` requires it; consumers'
|
|
22
|
+
fixtures/mocks must add the block.
|
|
23
|
+
|
|
24
|
+
## [Unreleased]
|
|
25
|
+
|
|
26
|
+
## [1.5.0]
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- `ISystemVersion.deployment` (`TSystemDeployment = 'docker' | 'source'`): the
|
|
31
|
+
backend now reports how it is deployed so the admin maintenance UI can
|
|
32
|
+
distinguish a managed Docker-image install from a source/dev checkout.
|
|
33
|
+
Additive but **required** in the response — consumers' fixtures/mocks must
|
|
34
|
+
add the field (the backend schema `responses/admin/system_version.json`
|
|
35
|
+
requires it).
|
|
36
|
+
- Update-picker contracts for `GET /admin/system/update/releases`:
|
|
37
|
+
`IUpdateRelease`, `IUpdateReleases`, `IUpdateReleasesResponse`, and the
|
|
38
|
+
`SYSTEM_ENDPOINTS.UPDATE_RELEASES` path constant. The endpoint lists
|
|
39
|
+
registry-published core versions (newest first) and fails soft to
|
|
40
|
+
`available: false` when the registry is unreachable.
|
|
41
|
+
- `check-schema-parity.mjs` now also guards
|
|
42
|
+
`responses/admin/update_releases.json` against `IUpdateReleases`.
|
|
43
|
+
|
|
12
44
|
## [1.4.0]
|
|
13
45
|
|
|
14
46
|
### Added
|
package/dist/index.d.mts
CHANGED
|
@@ -390,12 +390,19 @@ declare const SYSTEM_ENDPOINTS: {
|
|
|
390
390
|
readonly UPDATE_PREFLIGHT: "/cms-api/v1/admin/system/update/preflight";
|
|
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
|
+
readonly UPDATE_RELEASES: "/cms-api/v1/admin/system/update/releases";
|
|
393
394
|
};
|
|
394
395
|
interface ISystemInstalledPlugin {
|
|
395
396
|
id: string;
|
|
396
397
|
version: string;
|
|
397
398
|
compatible: boolean;
|
|
398
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';
|
|
399
406
|
/** GET /admin/system/version — current instance version summary. */
|
|
400
407
|
interface ISystemVersion {
|
|
401
408
|
instance_id: string;
|
|
@@ -404,6 +411,7 @@ interface ISystemVersion {
|
|
|
404
411
|
frontend_version: string;
|
|
405
412
|
plugin_api_version: string;
|
|
406
413
|
database_migration_version: string;
|
|
414
|
+
deployment: TSystemDeployment;
|
|
407
415
|
safe_mode: boolean;
|
|
408
416
|
maintenance_mode: boolean;
|
|
409
417
|
installed_plugins: ISystemInstalledPlugin[];
|
|
@@ -548,6 +556,25 @@ interface IUpdatePreflightOption {
|
|
|
548
556
|
version?: string;
|
|
549
557
|
label: string;
|
|
550
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>;
|
|
551
578
|
/** GET /admin/system/update/preflight — latest preflight for THIS instance. */
|
|
552
579
|
interface IUpdatePreflight {
|
|
553
580
|
preflight_id: string;
|
|
@@ -592,6 +619,19 @@ interface IUpdateStep {
|
|
|
592
619
|
status: string;
|
|
593
620
|
detail?: string;
|
|
594
621
|
}
|
|
622
|
+
/**
|
|
623
|
+
* Manager-loop visibility attached to the update status. `configured` is
|
|
624
|
+
* whether this instance has a manager token (empty token = loop disabled);
|
|
625
|
+
* `last_seen_at` is the last authenticated manager poll (null = never);
|
|
626
|
+
* `requested_stale` is true when the latest operation has sat in `requested`
|
|
627
|
+
* too long without the manager claiming it — the UI warns that the SelfHelp
|
|
628
|
+
* Manager may not be running.
|
|
629
|
+
*/
|
|
630
|
+
interface IUpdateStatusManager {
|
|
631
|
+
configured: boolean;
|
|
632
|
+
last_seen_at: string | null;
|
|
633
|
+
requested_stale: boolean;
|
|
634
|
+
}
|
|
595
635
|
/** GET /admin/system/update/status — status/progress for THIS instance. */
|
|
596
636
|
interface IUpdateStatus {
|
|
597
637
|
instance_id: string;
|
|
@@ -603,6 +643,7 @@ interface IUpdateStatus {
|
|
|
603
643
|
requested_at: string;
|
|
604
644
|
updated_at: string;
|
|
605
645
|
message?: string;
|
|
646
|
+
manager: IUpdateStatusManager;
|
|
606
647
|
}
|
|
607
648
|
type IUpdateStatusResponse = IBaseApiResponse<IUpdateStatus>;
|
|
608
649
|
type IUpdateRequestResponse = IBaseApiResponse<{
|
|
@@ -1312,4 +1353,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
1312
1353
|
*/
|
|
1313
1354
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
1314
1355
|
|
|
1315
|
-
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 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 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 };
|
|
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -390,12 +390,19 @@ declare const SYSTEM_ENDPOINTS: {
|
|
|
390
390
|
readonly UPDATE_PREFLIGHT: "/cms-api/v1/admin/system/update/preflight";
|
|
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
|
+
readonly UPDATE_RELEASES: "/cms-api/v1/admin/system/update/releases";
|
|
393
394
|
};
|
|
394
395
|
interface ISystemInstalledPlugin {
|
|
395
396
|
id: string;
|
|
396
397
|
version: string;
|
|
397
398
|
compatible: boolean;
|
|
398
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';
|
|
399
406
|
/** GET /admin/system/version — current instance version summary. */
|
|
400
407
|
interface ISystemVersion {
|
|
401
408
|
instance_id: string;
|
|
@@ -404,6 +411,7 @@ interface ISystemVersion {
|
|
|
404
411
|
frontend_version: string;
|
|
405
412
|
plugin_api_version: string;
|
|
406
413
|
database_migration_version: string;
|
|
414
|
+
deployment: TSystemDeployment;
|
|
407
415
|
safe_mode: boolean;
|
|
408
416
|
maintenance_mode: boolean;
|
|
409
417
|
installed_plugins: ISystemInstalledPlugin[];
|
|
@@ -548,6 +556,25 @@ interface IUpdatePreflightOption {
|
|
|
548
556
|
version?: string;
|
|
549
557
|
label: string;
|
|
550
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>;
|
|
551
578
|
/** GET /admin/system/update/preflight — latest preflight for THIS instance. */
|
|
552
579
|
interface IUpdatePreflight {
|
|
553
580
|
preflight_id: string;
|
|
@@ -592,6 +619,19 @@ interface IUpdateStep {
|
|
|
592
619
|
status: string;
|
|
593
620
|
detail?: string;
|
|
594
621
|
}
|
|
622
|
+
/**
|
|
623
|
+
* Manager-loop visibility attached to the update status. `configured` is
|
|
624
|
+
* whether this instance has a manager token (empty token = loop disabled);
|
|
625
|
+
* `last_seen_at` is the last authenticated manager poll (null = never);
|
|
626
|
+
* `requested_stale` is true when the latest operation has sat in `requested`
|
|
627
|
+
* too long without the manager claiming it — the UI warns that the SelfHelp
|
|
628
|
+
* Manager may not be running.
|
|
629
|
+
*/
|
|
630
|
+
interface IUpdateStatusManager {
|
|
631
|
+
configured: boolean;
|
|
632
|
+
last_seen_at: string | null;
|
|
633
|
+
requested_stale: boolean;
|
|
634
|
+
}
|
|
595
635
|
/** GET /admin/system/update/status — status/progress for THIS instance. */
|
|
596
636
|
interface IUpdateStatus {
|
|
597
637
|
instance_id: string;
|
|
@@ -603,6 +643,7 @@ interface IUpdateStatus {
|
|
|
603
643
|
requested_at: string;
|
|
604
644
|
updated_at: string;
|
|
605
645
|
message?: string;
|
|
646
|
+
manager: IUpdateStatusManager;
|
|
606
647
|
}
|
|
607
648
|
type IUpdateStatusResponse = IBaseApiResponse<IUpdateStatus>;
|
|
608
649
|
type IUpdateRequestResponse = IBaseApiResponse<{
|
|
@@ -1312,4 +1353,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
1312
1353
|
*/
|
|
1313
1354
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
1314
1355
|
|
|
1315
|
-
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 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 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 };
|
|
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 };
|
package/dist/index.js
CHANGED
|
@@ -146,7 +146,8 @@ var SYSTEM_ENDPOINTS = {
|
|
|
146
146
|
MAINTENANCE: `${SYSTEM_PREFIX}/maintenance`,
|
|
147
147
|
UPDATE_PREFLIGHT: `${SYSTEM_PREFIX}/update/preflight`,
|
|
148
148
|
UPDATE_REQUEST: `${SYSTEM_PREFIX}/update/request`,
|
|
149
|
-
UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status
|
|
149
|
+
UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status`,
|
|
150
|
+
UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`
|
|
150
151
|
};
|
|
151
152
|
|
|
152
153
|
// src/types/distribution.ts
|
package/dist/index.mjs
CHANGED
|
@@ -59,7 +59,8 @@ var SYSTEM_ENDPOINTS = {
|
|
|
59
59
|
MAINTENANCE: `${SYSTEM_PREFIX}/maintenance`,
|
|
60
60
|
UPDATE_PREFLIGHT: `${SYSTEM_PREFIX}/update/preflight`,
|
|
61
61
|
UPDATE_REQUEST: `${SYSTEM_PREFIX}/update/request`,
|
|
62
|
-
UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status
|
|
62
|
+
UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status`,
|
|
63
|
+
UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`
|
|
63
64
|
};
|
|
64
65
|
|
|
65
66
|
// src/types/distribution.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfhelp/shared",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
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",
|
|
@@ -117,7 +117,7 @@ describe('distribution contracts compile and are usable', () => {
|
|
|
117
117
|
scheduler: { image: 's', digest: 'sha256:3' },
|
|
118
118
|
frontendCompatibility: { requiredFrontendRange: '>=0.1.0 <0.2.0' },
|
|
119
119
|
database: { migrationRange: 'A..B', destructive: false, requiresBackup: true, manualConfirmationRequired: false },
|
|
120
|
-
security: { signature: 'sig', keyId: 'selfhelp-
|
|
120
|
+
security: { signature: 'sig', keyId: 'selfhelp-dev-fixture' },
|
|
121
121
|
};
|
|
122
122
|
expect(index.core[0]?.version).toBe('0.1.0');
|
|
123
123
|
expect(core.kind).toBe('selfhelp-core-release');
|
|
@@ -133,7 +133,7 @@ describe('distribution contracts compile and are usable', () => {
|
|
|
133
133
|
official: true,
|
|
134
134
|
compatibility: { core: '>=0.1.0 <0.2.0', pluginApi: '0.1.0' },
|
|
135
135
|
artifacts: { manifestUrl: 'm', archiveUrl: 'a', sha256: 'sha256:0' },
|
|
136
|
-
security: { signature: 'sig', keyId: 'selfhelp-
|
|
136
|
+
security: { signature: 'sig', keyId: 'selfhelp-dev-fixture' },
|
|
137
137
|
};
|
|
138
138
|
const advisories: AdvisoryFeed = {
|
|
139
139
|
schemaVersion: '1.0',
|
package/src/types/api/system.ts
CHANGED
|
@@ -26,6 +26,7 @@ export const SYSTEM_ENDPOINTS = {
|
|
|
26
26
|
UPDATE_PREFLIGHT: `${SYSTEM_PREFIX}/update/preflight`,
|
|
27
27
|
UPDATE_REQUEST: `${SYSTEM_PREFIX}/update/request`,
|
|
28
28
|
UPDATE_STATUS: `${SYSTEM_PREFIX}/update/status`,
|
|
29
|
+
UPDATE_RELEASES: `${SYSTEM_PREFIX}/update/releases`,
|
|
29
30
|
} as const;
|
|
30
31
|
|
|
31
32
|
export interface ISystemInstalledPlugin {
|
|
@@ -34,6 +35,13 @@ export interface ISystemInstalledPlugin {
|
|
|
34
35
|
compatible: boolean;
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* How the backend runtime is deployed. `docker` = the production image
|
|
40
|
+
* published by docker-release.yml (SELFHELP_DEPLOYMENT is baked into the
|
|
41
|
+
* image); `source` = composer dev / bare checkout (the default).
|
|
42
|
+
*/
|
|
43
|
+
export type TSystemDeployment = 'docker' | 'source';
|
|
44
|
+
|
|
37
45
|
/** GET /admin/system/version — current instance version summary. */
|
|
38
46
|
export interface ISystemVersion {
|
|
39
47
|
instance_id: string;
|
|
@@ -42,6 +50,7 @@ export interface ISystemVersion {
|
|
|
42
50
|
frontend_version: string;
|
|
43
51
|
plugin_api_version: string;
|
|
44
52
|
database_migration_version: string;
|
|
53
|
+
deployment: TSystemDeployment;
|
|
45
54
|
safe_mode: boolean;
|
|
46
55
|
maintenance_mode: boolean;
|
|
47
56
|
installed_plugins: ISystemInstalledPlugin[];
|
|
@@ -207,6 +216,27 @@ export interface IUpdatePreflightOption {
|
|
|
207
216
|
label: string;
|
|
208
217
|
}
|
|
209
218
|
|
|
219
|
+
/** One core version published in the official registry index. */
|
|
220
|
+
export interface IUpdateRelease {
|
|
221
|
+
version: string;
|
|
222
|
+
channel: 'stable' | 'beta' | 'nightly' | 'test';
|
|
223
|
+
/** Whether the registry marks this release as blocked (e.g. by a security advisory). */
|
|
224
|
+
blocked: boolean;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* GET /admin/system/update/releases — core versions published in the official
|
|
229
|
+
* registry (newest first) for the "Request an update" version picker.
|
|
230
|
+
* `available: false` means the registry could not be reached; the UI falls
|
|
231
|
+
* back to manual version entry instead of blocking.
|
|
232
|
+
*/
|
|
233
|
+
export interface IUpdateReleases {
|
|
234
|
+
available: boolean;
|
|
235
|
+
current_version: string;
|
|
236
|
+
releases: IUpdateRelease[];
|
|
237
|
+
}
|
|
238
|
+
export type IUpdateReleasesResponse = IBaseApiResponse<IUpdateReleases>;
|
|
239
|
+
|
|
210
240
|
/** GET /admin/system/update/preflight — latest preflight for THIS instance. */
|
|
211
241
|
export interface IUpdatePreflight {
|
|
212
242
|
preflight_id: string;
|
|
@@ -272,6 +302,20 @@ export interface IUpdateStep {
|
|
|
272
302
|
detail?: string;
|
|
273
303
|
}
|
|
274
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Manager-loop visibility attached to the update status. `configured` is
|
|
307
|
+
* whether this instance has a manager token (empty token = loop disabled);
|
|
308
|
+
* `last_seen_at` is the last authenticated manager poll (null = never);
|
|
309
|
+
* `requested_stale` is true when the latest operation has sat in `requested`
|
|
310
|
+
* too long without the manager claiming it — the UI warns that the SelfHelp
|
|
311
|
+
* Manager may not be running.
|
|
312
|
+
*/
|
|
313
|
+
export interface IUpdateStatusManager {
|
|
314
|
+
configured: boolean;
|
|
315
|
+
last_seen_at: string | null;
|
|
316
|
+
requested_stale: boolean;
|
|
317
|
+
}
|
|
318
|
+
|
|
275
319
|
/** GET /admin/system/update/status — status/progress for THIS instance. */
|
|
276
320
|
export interface IUpdateStatus {
|
|
277
321
|
instance_id: string;
|
|
@@ -283,6 +327,7 @@ export interface IUpdateStatus {
|
|
|
283
327
|
requested_at: string;
|
|
284
328
|
updated_at: string;
|
|
285
329
|
message?: string;
|
|
330
|
+
manager: IUpdateStatusManager;
|
|
286
331
|
}
|
|
287
332
|
export type IUpdateStatusResponse = IBaseApiResponse<IUpdateStatus>;
|
|
288
333
|
|