@selfhelp/shared 1.4.0 → 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/CHANGELOG.md +18 -0
- package/dist/index.d.mts +28 -1
- package/dist/index.d.ts +28 -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 +30 -0
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,24 @@ All notable changes to `@selfhelp/shared` will be documented in this file.
|
|
|
9
9
|
|
|
10
10
|
This project follows semantic versioning.
|
|
11
11
|
|
|
12
|
+
## [1.5.0]
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- `ISystemVersion.deployment` (`TSystemDeployment = 'docker' | 'source'`): the
|
|
17
|
+
backend now reports how it is deployed so the admin maintenance UI can
|
|
18
|
+
distinguish a managed Docker-image install from a source/dev checkout.
|
|
19
|
+
Additive but **required** in the response — consumers' fixtures/mocks must
|
|
20
|
+
add the field (the backend schema `responses/admin/system_version.json`
|
|
21
|
+
requires it).
|
|
22
|
+
- Update-picker contracts for `GET /admin/system/update/releases`:
|
|
23
|
+
`IUpdateRelease`, `IUpdateReleases`, `IUpdateReleasesResponse`, and the
|
|
24
|
+
`SYSTEM_ENDPOINTS.UPDATE_RELEASES` path constant. The endpoint lists
|
|
25
|
+
registry-published core versions (newest first) and fails soft to
|
|
26
|
+
`available: false` when the registry is unreachable.
|
|
27
|
+
- `check-schema-parity.mjs` now also guards
|
|
28
|
+
`responses/admin/update_releases.json` against `IUpdateReleases`.
|
|
29
|
+
|
|
12
30
|
## [1.4.0]
|
|
13
31
|
|
|
14
32
|
### 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;
|
|
@@ -1312,4 +1339,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
1312
1339
|
*/
|
|
1313
1340
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
1314
1341
|
|
|
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 };
|
|
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 };
|
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;
|
|
@@ -1312,4 +1339,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
1312
1339
|
*/
|
|
1313
1340
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
1314
1341
|
|
|
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 };
|
|
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 };
|
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.5.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;
|