@selfhelp/shared 1.14.24 → 1.15.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 +78 -0
- package/dist/index.d.mts +204 -4
- package/dist/index.d.ts +204 -4
- package/dist/index.js +22 -1
- package/dist/index.mjs +21 -1
- package/dist/{manifest-C8sBTLJb.d.mts → manifest-8YXAk-4o.d.mts} +8 -0
- package/dist/{manifest-C8sBTLJb.d.ts → manifest-8YXAk-4o.d.ts} +8 -0
- package/dist/plugin-sdk/index.d.mts +39 -2
- package/dist/plugin-sdk/index.d.ts +39 -2
- package/dist/plugin-sdk/index.js +13 -0
- package/dist/plugin-sdk/index.mjs +11 -0
- package/dist/testing/index.d.mts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/plugin-sdk/__tests__/version.test.ts +40 -0
- package/src/plugin-sdk/index.ts +2 -0
- package/src/plugin-sdk/manifest.ts +8 -0
- package/src/plugin-sdk/registry.ts +11 -0
- package/src/plugin-sdk/version.ts +38 -0
- package/src/types/__tests__/distribution.test.ts +55 -1
- package/src/types/api/__tests__/system.test.ts +83 -0
- package/src/types/api/index.ts +1 -0
- package/src/types/api/mobile-preview.ts +71 -0
- package/src/types/api/system.ts +83 -3
- package/src/types/distribution.ts +67 -1
package/dist/index.d.ts
CHANGED
|
@@ -396,9 +396,17 @@ declare const SYSTEM_ENDPOINTS: {
|
|
|
396
396
|
readonly UPDATE_FRONTEND_RELEASES: "/cms-api/v1/admin/system/update/frontend/releases";
|
|
397
397
|
readonly UPDATE_FRONTEND_PREFLIGHT: "/cms-api/v1/admin/system/update/frontend/preflight";
|
|
398
398
|
readonly UPDATE_FRONTEND_REQUEST: "/cms-api/v1/admin/system/update/frontend/request";
|
|
399
|
+
readonly UPDATE_MOBILE_PREVIEW_RELEASES: "/cms-api/v1/admin/system/update/mobile-preview/releases";
|
|
400
|
+
readonly UPDATE_MOBILE_PREVIEW_PREFLIGHT: "/cms-api/v1/admin/system/update/mobile-preview/preflight";
|
|
401
|
+
readonly UPDATE_MOBILE_PREVIEW_REQUEST: "/cms-api/v1/admin/system/update/mobile-preview/request";
|
|
399
402
|
};
|
|
400
|
-
/**
|
|
401
|
-
|
|
403
|
+
/**
|
|
404
|
+
* Discriminates a core (full-stack) update from the stateless component-only
|
|
405
|
+
* swaps. `frontend` swaps the Next.js image; `mobile-preview` swaps the
|
|
406
|
+
* `selfhelp-mobile-preview` web image. Both are lightweight (no DB migration,
|
|
407
|
+
* no backup) and performed by the SelfHelp Manager.
|
|
408
|
+
*/
|
|
409
|
+
type TUpdateKind = 'core' | 'frontend' | 'mobile-preview';
|
|
402
410
|
interface ISystemInstalledPlugin {
|
|
403
411
|
id: string;
|
|
404
412
|
version: string;
|
|
@@ -416,6 +424,16 @@ interface ISystemVersion {
|
|
|
416
424
|
selfhelp_version: string;
|
|
417
425
|
backend_version: string;
|
|
418
426
|
frontend_version: string;
|
|
427
|
+
/**
|
|
428
|
+
* The provisioned `selfhelp-mobile-preview` web image version reported by the
|
|
429
|
+
* backend (set by the SelfHelp Manager via `SELFHELP_MOBILE_PREVIEW_VERSION`
|
|
430
|
+
* when it provisions/updates the service). `unknown` until the manager stamps
|
|
431
|
+
* it; `not_installed` when no preview service is provisioned for this
|
|
432
|
+
* instance (e.g. an instance that predates default provisioning, or a dev
|
|
433
|
+
* source checkout). The page-editor preview panel additionally probes the
|
|
434
|
+
* running image's `version.json` for the live value.
|
|
435
|
+
*/
|
|
436
|
+
mobile_preview_version: string;
|
|
419
437
|
plugin_api_version: string;
|
|
420
438
|
database_migration_version: string;
|
|
421
439
|
deployment: TSystemDeployment;
|
|
@@ -552,7 +570,7 @@ interface IUpdatePreflightCheck {
|
|
|
552
570
|
* and the plugin-specific `pinned` affordance). Snake_case is the wire contract.
|
|
553
571
|
*/
|
|
554
572
|
interface ICompatibilityError {
|
|
555
|
-
component: 'core' | 'frontend' | 'plugin';
|
|
573
|
+
component: 'core' | 'frontend' | 'mobile-preview' | 'plugin';
|
|
556
574
|
component_id: string;
|
|
557
575
|
current_version: string | null;
|
|
558
576
|
target_version: string | null;
|
|
@@ -659,6 +677,11 @@ interface IUpdateStatus {
|
|
|
659
677
|
* for the synthetic `idle` status.
|
|
660
678
|
*/
|
|
661
679
|
target_frontend_version: string | null;
|
|
680
|
+
/**
|
|
681
|
+
* The mobile-preview image version a `mobile-preview`-kind operation targets;
|
|
682
|
+
* `null` for core/frontend operations and the synthetic `idle` status.
|
|
683
|
+
*/
|
|
684
|
+
target_mobile_preview_version: string | null;
|
|
662
685
|
progress_percent: number;
|
|
663
686
|
steps: IUpdateStep[];
|
|
664
687
|
requested_at: string;
|
|
@@ -716,6 +739,112 @@ type IFrontendUpdateRequestResponse = IBaseApiResponse<{
|
|
|
716
739
|
kind: 'frontend';
|
|
717
740
|
target_frontend_version: string;
|
|
718
741
|
}>;
|
|
742
|
+
/**
|
|
743
|
+
* POST /admin/system/update/mobile-preview/request — request a MOBILE-PREVIEW
|
|
744
|
+
* update for THIS instance. Like {@link IFrontendUpdateRequest} it carries no
|
|
745
|
+
* `instance_id` (the backend derives + verifies it) and no
|
|
746
|
+
* `accepted_migration_risk` (a preview swap is stateless). Requesting it onto an
|
|
747
|
+
* instance that has no preview yet is also the enable/bootstrap path: the
|
|
748
|
+
* SelfHelp Manager provisions the `selfhelp-mobile-preview` service. The manager
|
|
749
|
+
* re-resolves the signed release and is the final authority on compatibility +
|
|
750
|
+
* signatures + image digests before it swaps the container.
|
|
751
|
+
*/
|
|
752
|
+
interface IMobilePreviewUpdateRequest {
|
|
753
|
+
target_version: string;
|
|
754
|
+
preflight_id: string;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* GET /admin/system/update/mobile-preview/releases — mobile-preview image
|
|
758
|
+
* versions published in the official registry (newest first). Reuses
|
|
759
|
+
* {@link IUpdateReleases}: `current_version` is the instance's provisioned
|
|
760
|
+
* preview version (or `not_installed`) and `available: false` means the registry
|
|
761
|
+
* was unreachable (fall back to manual entry). Aliased for call-site clarity.
|
|
762
|
+
*/
|
|
763
|
+
type IMobilePreviewUpdateReleases = IUpdateReleases;
|
|
764
|
+
type IMobilePreviewUpdateReleasesResponse = IUpdateReleasesResponse;
|
|
765
|
+
/**
|
|
766
|
+
* GET /admin/system/update/mobile-preview/preflight — compatibility verdict for
|
|
767
|
+
* a mobile-preview target. Reuses {@link IUpdatePreflight}; the preview is
|
|
768
|
+
* stateless so `database.destructive`/`requires_backup` are always false. The
|
|
769
|
+
* preview ⇄ core compatibility rule IS evaluated here (as a
|
|
770
|
+
* `mobile_preview_compatibility` check) against the same signed registry
|
|
771
|
+
* metadata the SelfHelp Manager resolves — the running core must satisfy the
|
|
772
|
+
* target preview's `backendCompatibility.requiredCoreRange` — so the CMS verdict
|
|
773
|
+
* matches the manager's instead of always reporting "OK". The manager still
|
|
774
|
+
* re-verifies signatures + image digests and re-runs the per-plugin RN/Expo
|
|
775
|
+
* twin-axis gate at execution and remains the final authority. Aliased for
|
|
776
|
+
* call-site clarity.
|
|
777
|
+
*/
|
|
778
|
+
type IMobilePreviewUpdatePreflight = IUpdatePreflight;
|
|
779
|
+
type IMobilePreviewUpdatePreflightResponse = IUpdatePreflightResponse;
|
|
780
|
+
/** POST /admin/system/update/mobile-preview/request — accepted record. */
|
|
781
|
+
type IMobilePreviewUpdateRequestResponse = IBaseApiResponse<{
|
|
782
|
+
operation_id: string;
|
|
783
|
+
instance_id: string;
|
|
784
|
+
status: TUpdateOperationStatus;
|
|
785
|
+
kind: 'mobile-preview';
|
|
786
|
+
target_mobile_preview_version: string;
|
|
787
|
+
}>;
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Mobile preview session contracts (CMS admin <-> backend <-> mobile-preview
|
|
791
|
+
* web image).
|
|
792
|
+
*
|
|
793
|
+
* Flow: the CMS admin mints a SHORT-LIVED, SINGLE-USE preview code (bound to the
|
|
794
|
+
* admin user + an optional scope). The `selfhelp-mobile-preview` web image
|
|
795
|
+
* exchanges that one-time code for an in-memory, scoped JWT
|
|
796
|
+
* (`purpose: 'mobile_preview'`) used for read-only `/cms-api` calls. The admin
|
|
797
|
+
* JWT is never exposed to the preview iframe.
|
|
798
|
+
*
|
|
799
|
+
* Snake_case is the wire contract (these mirror the backend JSON schemas under
|
|
800
|
+
* `config/schemas/api/v1/{requests,responses}/`).
|
|
801
|
+
*/
|
|
802
|
+
|
|
803
|
+
/** Mobile preview session endpoints. */
|
|
804
|
+
declare const MOBILE_PREVIEW_ENDPOINTS: {
|
|
805
|
+
/** Admin-only: mint a one-time preview session code. */
|
|
806
|
+
readonly SESSION: "/cms-api/v1/admin/mobile-preview/session";
|
|
807
|
+
/** Public: exchange a one-time code for a scoped preview JWT. */
|
|
808
|
+
readonly EXCHANGE: "/cms-api/v1/mobile-preview/session/exchange";
|
|
809
|
+
};
|
|
810
|
+
/**
|
|
811
|
+
* POST /admin/mobile-preview/session — mint a one-time preview code. No
|
|
812
|
+
* `instance_id`: the backend derives + verifies the admin server-side. The
|
|
813
|
+
* optional scope is bound into the code and enforced on exchange.
|
|
814
|
+
*/
|
|
815
|
+
interface IMobilePreviewSessionRequest {
|
|
816
|
+
/** Page keyword to preview. */
|
|
817
|
+
keyword?: string;
|
|
818
|
+
/** Page id to preview (alternative to `keyword`). */
|
|
819
|
+
page_id?: number;
|
|
820
|
+
/** Language id to render in. */
|
|
821
|
+
language_id?: number;
|
|
822
|
+
/** Whether to preview the unpublished draft version. */
|
|
823
|
+
draft?: boolean;
|
|
824
|
+
}
|
|
825
|
+
interface IMobilePreviewSessionData {
|
|
826
|
+
/** Opaque one-time code (safe in the iframe URL; invalid after exchange). */
|
|
827
|
+
code: string;
|
|
828
|
+
/** ISO-8601 expiry of the one-time code. */
|
|
829
|
+
expires_at: string;
|
|
830
|
+
}
|
|
831
|
+
type IMobilePreviewSessionResponse = IBaseApiResponse<IMobilePreviewSessionData>;
|
|
832
|
+
/**
|
|
833
|
+
* POST /mobile-preview/session/exchange — public route; the one-time code IS the
|
|
834
|
+
* credential. Consumes (deletes) the code and mints a scoped preview JWT.
|
|
835
|
+
*/
|
|
836
|
+
interface IMobilePreviewExchangeRequest {
|
|
837
|
+
code: string;
|
|
838
|
+
}
|
|
839
|
+
interface IMobilePreviewExchangeData {
|
|
840
|
+
/** Short-lived scoped JWT (`purpose: 'mobile_preview'`); held in memory only. */
|
|
841
|
+
access_token: string;
|
|
842
|
+
/** Seconds until the scoped token expires. */
|
|
843
|
+
expires_in: number;
|
|
844
|
+
/** The previewed user (the minting admin), for the preview UI. */
|
|
845
|
+
user: IUserData;
|
|
846
|
+
}
|
|
847
|
+
type IMobilePreviewExchangeResponse = IBaseApiResponse<IMobilePreviewExchangeData>;
|
|
719
848
|
|
|
720
849
|
/**
|
|
721
850
|
* Cross-repo SelfHelp distribution contracts: registry index + release metadata
|
|
@@ -783,6 +912,8 @@ interface InstanceVersions {
|
|
|
783
912
|
frontend: string;
|
|
784
913
|
scheduler: string;
|
|
785
914
|
worker: string;
|
|
915
|
+
/** Mobile-preview web image version pinned for this instance (additive). */
|
|
916
|
+
mobilePreview?: string;
|
|
786
917
|
pluginApi: string;
|
|
787
918
|
}
|
|
788
919
|
interface InstanceImages {
|
|
@@ -793,6 +924,8 @@ interface InstanceImages {
|
|
|
793
924
|
mysql: string;
|
|
794
925
|
redis: string;
|
|
795
926
|
mercure: string;
|
|
927
|
+
/** Mobile-preview web image reference (additive). */
|
|
928
|
+
mobilePreview?: string;
|
|
796
929
|
}
|
|
797
930
|
interface InstanceRouting {
|
|
798
931
|
publicFrontendUrl: string;
|
|
@@ -886,6 +1019,8 @@ interface InstanceLock {
|
|
|
886
1019
|
version: string;
|
|
887
1020
|
backendImageDigest: string;
|
|
888
1021
|
frontendImageDigest: string;
|
|
1022
|
+
/** Mobile-preview web image digest pinned for this instance (additive). */
|
|
1023
|
+
mobilePreviewImageDigest?: string;
|
|
889
1024
|
schedulerImageDigest: string;
|
|
890
1025
|
workerImageDigest: string;
|
|
891
1026
|
migrationVersion: string;
|
|
@@ -920,6 +1055,8 @@ interface RegistryIndex {
|
|
|
920
1055
|
scheduler: RegistryReleaseRef[];
|
|
921
1056
|
worker: RegistryReleaseRef[];
|
|
922
1057
|
plugins: RegistryReleaseRef[];
|
|
1058
|
+
/** Mobile-preview web image release refs (additive; older managers ignore). */
|
|
1059
|
+
mobilePreview?: RegistryReleaseRef[];
|
|
923
1060
|
advisoriesUrl?: string;
|
|
924
1061
|
compatibilityUrl?: string;
|
|
925
1062
|
trustedKeysUrl?: string;
|
|
@@ -1029,15 +1166,78 @@ interface WorkerRelease {
|
|
|
1029
1166
|
security: SignatureBlock;
|
|
1030
1167
|
blocked?: boolean;
|
|
1031
1168
|
}
|
|
1169
|
+
/**
|
|
1170
|
+
* One plugin mobile package baked into a mobile-preview image at build time.
|
|
1171
|
+
* The preview CI runs `plugins-sync.mjs` against a curated official-plugin set
|
|
1172
|
+
* and records the result here so the manager can compute coverage (which
|
|
1173
|
+
* enabled plugins render natively vs. fall back to open-on-web in the preview)
|
|
1174
|
+
* without inspecting the image.
|
|
1175
|
+
*/
|
|
1176
|
+
interface BundledPluginRef {
|
|
1177
|
+
id: string;
|
|
1178
|
+
version: string;
|
|
1179
|
+
mobilePackage: string;
|
|
1180
|
+
mobilePackageVersion: string;
|
|
1181
|
+
}
|
|
1182
|
+
/**
|
|
1183
|
+
* Mobile-preview web image release, resolved/pinned as a first-class artifact
|
|
1184
|
+
* (peer of the frontend release). The image serves the Expo web export at
|
|
1185
|
+
* `/mobile-preview` and proxies a narrow `/mobile-preview/api` allowlist to the
|
|
1186
|
+
* private backend. `mobileRendererVersion` is the mobile renderer contract the
|
|
1187
|
+
* image was built against (what plugin `compatibility.mobile` ranges target);
|
|
1188
|
+
* `bundledPlugins` is the curated official-plugin set baked into the image.
|
|
1189
|
+
*/
|
|
1190
|
+
interface MobilePreviewRelease {
|
|
1191
|
+
kind: 'selfhelp-mobile-preview-release';
|
|
1192
|
+
id: string;
|
|
1193
|
+
version: string;
|
|
1194
|
+
channel: ReleaseChannel;
|
|
1195
|
+
image: string;
|
|
1196
|
+
digest: string;
|
|
1197
|
+
builtFrom?: {
|
|
1198
|
+
sharedPackageVersion?: string;
|
|
1199
|
+
expoSdk?: string;
|
|
1200
|
+
reactNative?: string;
|
|
1201
|
+
};
|
|
1202
|
+
backendCompatibility: ServiceBackendCompatibility;
|
|
1203
|
+
/** Mobile renderer contract version advertised by this image (semver). */
|
|
1204
|
+
mobileRendererVersion: string;
|
|
1205
|
+
/**
|
|
1206
|
+
* React Native version the preview image was built with. Top-level canonical
|
|
1207
|
+
* value the SelfHelp Manager gates a plugin's `compatibility.reactNative`
|
|
1208
|
+
* range against (the `builtFrom.reactNative` provenance field mirrors it).
|
|
1209
|
+
*/
|
|
1210
|
+
reactNativeVersion?: string;
|
|
1211
|
+
/**
|
|
1212
|
+
* Expo SDK version the preview image was built with. Gated against a plugin's
|
|
1213
|
+
* `compatibility.expoSdk` range (mirrors `builtFrom.expoSdk`).
|
|
1214
|
+
*/
|
|
1215
|
+
expoSdkVersion?: string;
|
|
1216
|
+
/** Curated plugin mobile packages baked into the image. */
|
|
1217
|
+
bundledPlugins: BundledPluginRef[];
|
|
1218
|
+
security: SignatureBlock;
|
|
1219
|
+
blocked?: boolean;
|
|
1220
|
+
}
|
|
1032
1221
|
interface PluginRelease {
|
|
1033
1222
|
kind: 'selfhelp-plugin-release';
|
|
1034
1223
|
id: string;
|
|
1035
1224
|
version: string;
|
|
1036
1225
|
channel: ReleaseChannel;
|
|
1037
1226
|
official: boolean;
|
|
1227
|
+
/**
|
|
1228
|
+
* Compatibility ranges the host must satisfy. `mobile` (additive) is the
|
|
1229
|
+
* mobile-renderer axis: the range of host `mobileRendererVersion` the
|
|
1230
|
+
* plugin's mobile package supports (parallel to `pluginApi`). `reactNative`
|
|
1231
|
+
* and `expoSdk` (additive) are gated against the resolved
|
|
1232
|
+
* `selfhelp-mobile-preview` image's `reactNativeVersion` / `expoSdkVersion`.
|
|
1233
|
+
* All three are absent for web-only plugins.
|
|
1234
|
+
*/
|
|
1038
1235
|
compatibility: {
|
|
1039
1236
|
core: string;
|
|
1040
1237
|
pluginApi: string;
|
|
1238
|
+
mobile?: string;
|
|
1239
|
+
reactNative?: string;
|
|
1240
|
+
expoSdk?: string;
|
|
1041
1241
|
};
|
|
1042
1242
|
dependencies?: {
|
|
1043
1243
|
plugins: {
|
|
@@ -1694,4 +1894,4 @@ declare function transformPageData(apiPage: IRawPage): IPageItem;
|
|
|
1694
1894
|
*/
|
|
1695
1895
|
declare function transformPagesData(pages: IRawPage[] | null | undefined): IPageItem[];
|
|
1696
1896
|
|
|
1697
|
-
export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, 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 IInlineNode, 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 IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileInputProps, type IMobileModalProps, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, 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, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, TMobileSelectPresentation, 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, hasInlineFormatting, parseInlineRich, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
|
|
1897
|
+
export { API_VERSION_PREFIX, type AdvisoryAffected, type AdvisoryFeed, type AdvisorySeverity, type BackupManifest, type BackupRetentionPolicy, type BackupSchedulePolicy, type BundledPluginRef, 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 IInlineNode, 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 IMobileAdapterBaseProps, type IMobileButtonProps, type IMobileCardProps, type IMobileCheckboxProps, type IMobileContainerProps, type IMobileInputProps, type IMobileModalProps, type IMobilePreviewExchangeData, type IMobilePreviewExchangeRequest, type IMobilePreviewExchangeResponse, type IMobilePreviewSessionData, type IMobilePreviewSessionRequest, type IMobilePreviewSessionResponse, type IMobilePreviewUpdatePreflight, type IMobilePreviewUpdatePreflightResponse, type IMobilePreviewUpdateReleases, type IMobilePreviewUpdateReleasesResponse, type IMobilePreviewUpdateRequest, type IMobilePreviewUpdateRequestResponse, type IMobileSelectOption, type IMobileSelectProps, type IMobileSwitchProps, type IMobileTextProps, type IMobileTextareaProps, type IMobileUiAdapters, 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, MOBILE_PREVIEW_ENDPOINTS, type MobilePreviewRelease, 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, THeroUiButtonVariant, THeroUiSize, TMobileButtonFeedback, TMobileFieldVariant, TMobileSelectPresentation, 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, hasInlineFormatting, parseInlineRich, parseSpacing, replaceCalcedValues, resolveAssetSources, resolveAssetUrl, spacingToClasses, stripHtmlToText, transformPageData, transformPagesData };
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __export(index_exports, {
|
|
|
47
47
|
HEADER_CLIENT_TYPE: () => HEADER_CLIENT_TYPE,
|
|
48
48
|
LINE_HEIGHT: () => LINE_HEIGHT,
|
|
49
49
|
LITERAL_CLASSES: () => LITERAL_CLASSES,
|
|
50
|
+
MOBILE_PREVIEW_ENDPOINTS: () => MOBILE_PREVIEW_ENDPOINTS,
|
|
50
51
|
PERMISSIONS: () => PERMISSIONS,
|
|
51
52
|
RADIUS_PX: () => RADIUS_PX,
|
|
52
53
|
RELEASE_CHANNELS: () => RELEASE_CHANNELS,
|
|
@@ -188,7 +189,26 @@ var SYSTEM_ENDPOINTS = {
|
|
|
188
189
|
// is stateless — no destructive migration, no backup).
|
|
189
190
|
UPDATE_FRONTEND_RELEASES: `${SYSTEM_PREFIX}/update/frontend/releases`,
|
|
190
191
|
UPDATE_FRONTEND_PREFLIGHT: `${SYSTEM_PREFIX}/update/frontend/preflight`,
|
|
191
|
-
UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request
|
|
192
|
+
UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request`,
|
|
193
|
+
// Mobile-preview update flow. The `selfhelp-mobile-preview` web image is
|
|
194
|
+
// provisioned with every install and ships independently of the core (like
|
|
195
|
+
// the frontend), so an instance can move it to a newer compatible version on
|
|
196
|
+
// its own. These reuse the core preflight/releases response shapes; the
|
|
197
|
+
// request body omits `accepted_migration_risk` (a preview swap is stateless).
|
|
198
|
+
// Requesting one onto an instance that never had it doubles as the
|
|
199
|
+
// enable/bootstrap path (the SelfHelp Manager provisions it).
|
|
200
|
+
UPDATE_MOBILE_PREVIEW_RELEASES: `${SYSTEM_PREFIX}/update/mobile-preview/releases`,
|
|
201
|
+
UPDATE_MOBILE_PREVIEW_PREFLIGHT: `${SYSTEM_PREFIX}/update/mobile-preview/preflight`,
|
|
202
|
+
UPDATE_MOBILE_PREVIEW_REQUEST: `${SYSTEM_PREFIX}/update/mobile-preview/request`
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
// src/types/api/mobile-preview.ts
|
|
206
|
+
var MOBILE_PREVIEW_PREFIX = "/cms-api/v1";
|
|
207
|
+
var MOBILE_PREVIEW_ENDPOINTS = {
|
|
208
|
+
/** Admin-only: mint a one-time preview session code. */
|
|
209
|
+
SESSION: `${MOBILE_PREVIEW_PREFIX}/admin/mobile-preview/session`,
|
|
210
|
+
/** Public: exchange a one-time code for a scoped preview JWT. */
|
|
211
|
+
EXCHANGE: `${MOBILE_PREVIEW_PREFIX}/mobile-preview/session/exchange`
|
|
192
212
|
};
|
|
193
213
|
|
|
194
214
|
// src/types/distribution.ts
|
|
@@ -1521,6 +1541,7 @@ function transformPagesData(pages) {
|
|
|
1521
1541
|
HEADER_CLIENT_TYPE,
|
|
1522
1542
|
LINE_HEIGHT,
|
|
1523
1543
|
LITERAL_CLASSES,
|
|
1544
|
+
MOBILE_PREVIEW_ENDPOINTS,
|
|
1524
1545
|
PERMISSIONS,
|
|
1525
1546
|
RADIUS_PX,
|
|
1526
1547
|
RELEASE_CHANNELS,
|
package/dist/index.mjs
CHANGED
|
@@ -68,7 +68,26 @@ var SYSTEM_ENDPOINTS = {
|
|
|
68
68
|
// is stateless — no destructive migration, no backup).
|
|
69
69
|
UPDATE_FRONTEND_RELEASES: `${SYSTEM_PREFIX}/update/frontend/releases`,
|
|
70
70
|
UPDATE_FRONTEND_PREFLIGHT: `${SYSTEM_PREFIX}/update/frontend/preflight`,
|
|
71
|
-
UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request
|
|
71
|
+
UPDATE_FRONTEND_REQUEST: `${SYSTEM_PREFIX}/update/frontend/request`,
|
|
72
|
+
// Mobile-preview update flow. The `selfhelp-mobile-preview` web image is
|
|
73
|
+
// provisioned with every install and ships independently of the core (like
|
|
74
|
+
// the frontend), so an instance can move it to a newer compatible version on
|
|
75
|
+
// its own. These reuse the core preflight/releases response shapes; the
|
|
76
|
+
// request body omits `accepted_migration_risk` (a preview swap is stateless).
|
|
77
|
+
// Requesting one onto an instance that never had it doubles as the
|
|
78
|
+
// enable/bootstrap path (the SelfHelp Manager provisions it).
|
|
79
|
+
UPDATE_MOBILE_PREVIEW_RELEASES: `${SYSTEM_PREFIX}/update/mobile-preview/releases`,
|
|
80
|
+
UPDATE_MOBILE_PREVIEW_PREFLIGHT: `${SYSTEM_PREFIX}/update/mobile-preview/preflight`,
|
|
81
|
+
UPDATE_MOBILE_PREVIEW_REQUEST: `${SYSTEM_PREFIX}/update/mobile-preview/request`
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/types/api/mobile-preview.ts
|
|
85
|
+
var MOBILE_PREVIEW_PREFIX = "/cms-api/v1";
|
|
86
|
+
var MOBILE_PREVIEW_ENDPOINTS = {
|
|
87
|
+
/** Admin-only: mint a one-time preview session code. */
|
|
88
|
+
SESSION: `${MOBILE_PREVIEW_PREFIX}/admin/mobile-preview/session`,
|
|
89
|
+
/** Public: exchange a one-time code for a scoped preview JWT. */
|
|
90
|
+
EXCHANGE: `${MOBILE_PREVIEW_PREFIX}/mobile-preview/session/exchange`
|
|
72
91
|
};
|
|
73
92
|
|
|
74
93
|
// src/types/distribution.ts
|
|
@@ -1400,6 +1419,7 @@ export {
|
|
|
1400
1419
|
HEADER_CLIENT_TYPE,
|
|
1401
1420
|
LINE_HEIGHT,
|
|
1402
1421
|
LITERAL_CLASSES,
|
|
1422
|
+
MOBILE_PREVIEW_ENDPOINTS,
|
|
1403
1423
|
PERMISSIONS,
|
|
1404
1424
|
RADIUS_PX,
|
|
1405
1425
|
RELEASE_CHANNELS,
|
|
@@ -20,6 +20,14 @@ interface IPluginManifestCompatibility {
|
|
|
20
20
|
reactNative?: string;
|
|
21
21
|
/** SemVer range for Expo SDK. */
|
|
22
22
|
expoSdk?: string;
|
|
23
|
+
/**
|
|
24
|
+
* SemVer range for the host mobile renderer contract
|
|
25
|
+
* (`MOBILE_RENDERER_VERSION`) the plugin's mobile package supports. The
|
|
26
|
+
* SelfHelp Manager gates a plugin's mobile package against the selected
|
|
27
|
+
* `selfhelp-mobile-preview` image's advertised `mobileRendererVersion`.
|
|
28
|
+
* Absent for web-only plugins.
|
|
29
|
+
*/
|
|
30
|
+
mobile?: string;
|
|
23
31
|
}
|
|
24
32
|
interface IPluginManifestDependency {
|
|
25
33
|
/** Plugin id this plugin requires. */
|
|
@@ -20,6 +20,14 @@ interface IPluginManifestCompatibility {
|
|
|
20
20
|
reactNative?: string;
|
|
21
21
|
/** SemVer range for Expo SDK. */
|
|
22
22
|
expoSdk?: string;
|
|
23
|
+
/**
|
|
24
|
+
* SemVer range for the host mobile renderer contract
|
|
25
|
+
* (`MOBILE_RENDERER_VERSION`) the plugin's mobile package supports. The
|
|
26
|
+
* SelfHelp Manager gates a plugin's mobile package against the selected
|
|
27
|
+
* `selfhelp-mobile-preview` image's advertised `mobileRendererVersion`.
|
|
28
|
+
* Absent for web-only plugins.
|
|
29
|
+
*/
|
|
30
|
+
mobile?: string;
|
|
23
31
|
}
|
|
24
32
|
interface IPluginManifestDependency {
|
|
25
33
|
/** Plugin id this plugin requires. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-
|
|
1
|
+
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-8YXAk-4o.mjs';
|
|
2
2
|
import { I as IStyleRegistryEntry } from '../styles.registry-4W0LzmZB.mjs';
|
|
3
3
|
import '../common-qaDIAYS3.mjs';
|
|
4
4
|
|
|
@@ -15,6 +15,23 @@ import '../common-qaDIAYS3.mjs';
|
|
|
15
15
|
* Independent from the npm `version` of `@selfhelp/shared`.
|
|
16
16
|
*/
|
|
17
17
|
declare const PLUGIN_API_VERSION: "0.1.0";
|
|
18
|
+
/**
|
|
19
|
+
* Mobile renderer contract version. This is the SECOND, mobile-only
|
|
20
|
+
* compatibility axis (independent of `PLUGIN_API_VERSION`): it versions the
|
|
21
|
+
* mobile plugin rendering surface — the `registerMobile()` shape, `IStyleProps`
|
|
22
|
+
* / `TPluginStyleImplMap`, and the mobile host SDK primitives — that a plugin's
|
|
23
|
+
* mobile npm package compiles against.
|
|
24
|
+
*
|
|
25
|
+
* The mobile app and the `selfhelp-mobile-preview` image advertise this value
|
|
26
|
+
* (in `version.json` + the signed `mobile-preview-release.json`). A plugin
|
|
27
|
+
* declares the range it supports in `plugin.json` under `compatibility.mobile`;
|
|
28
|
+
* the SelfHelp Manager gates the plugin against the selected preview image's
|
|
29
|
+
* advertised `mobileRendererVersion` using {@see isMobileRendererCompatible}.
|
|
30
|
+
*
|
|
31
|
+
* Bump rules mirror the SDK contract: patch = additive fix, minor = additive
|
|
32
|
+
* renderer feature, major = breaking mobile renderer change.
|
|
33
|
+
*/
|
|
34
|
+
declare const MOBILE_RENDERER_VERSION: "0.1.0";
|
|
18
35
|
interface ISemver {
|
|
19
36
|
major: number;
|
|
20
37
|
minor: number;
|
|
@@ -44,6 +61,15 @@ declare function isPluginApiCompatible(required: string, host?: string): boolean
|
|
|
44
61
|
* - host minor >= plugin's required minor.
|
|
45
62
|
*/
|
|
46
63
|
declare function assertPluginApiVersion(required: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Non-throwing satisfaction check for the mobile-renderer axis: returns true
|
|
66
|
+
* when the host's `mobileRendererVersion` falls inside the plugin's declared
|
|
67
|
+
* `compatibility.mobile` range. Used by the SelfHelp Manager preflight to gate
|
|
68
|
+
* an enabled plugin's mobile package against the selected preview image, and by
|
|
69
|
+
* the mobile/preview runtime to skip an incompatible plugin instead of crashing.
|
|
70
|
+
* An empty/undefined range is treated as "no mobile support declared" → false.
|
|
71
|
+
*/
|
|
72
|
+
declare function isMobileRendererCompatible(requiredRange: string | undefined, host?: string): boolean;
|
|
47
73
|
/**
|
|
48
74
|
* Throw if the running CMS version is not in the plugin's declared
|
|
49
75
|
* compatibility range.
|
|
@@ -141,6 +167,12 @@ interface IPluginRelease {
|
|
|
141
167
|
core: string;
|
|
142
168
|
/** Semver range of host plugin-API versions this plugin runs on. */
|
|
143
169
|
pluginApi: string;
|
|
170
|
+
/**
|
|
171
|
+
* Semver range of the host mobile renderer contract
|
|
172
|
+
* (`mobileRendererVersion`) this plugin's mobile package supports.
|
|
173
|
+
* Additive; absent for web-only plugins.
|
|
174
|
+
*/
|
|
175
|
+
mobile?: string;
|
|
144
176
|
};
|
|
145
177
|
/** Optional other-plugin requirements consumed by the resolver. */
|
|
146
178
|
dependencies?: {
|
|
@@ -194,6 +226,11 @@ interface IPluginRegistry {
|
|
|
194
226
|
worker: IRegistryReleaseRef[];
|
|
195
227
|
/** Plugin release refs (CMS-installed) — multi-version, one ref per published version. */
|
|
196
228
|
plugins: IRegistryReleaseRef[];
|
|
229
|
+
/**
|
|
230
|
+
* Mobile-preview web image release refs (Manager-installed). Additive in
|
|
231
|
+
* registry `schemaVersion` 1.1 — older managers ignore the unknown array.
|
|
232
|
+
*/
|
|
233
|
+
mobilePreview?: IRegistryReleaseRef[];
|
|
197
234
|
/** Optional path to the security advisory feed. */
|
|
198
235
|
advisoriesUrl?: string;
|
|
199
236
|
/** Optional path to the cross-component compatibility feed. */
|
|
@@ -837,4 +874,4 @@ declare function isPluginRuntimeShimSpecifier(value: unknown): value is TPluginR
|
|
|
837
874
|
*/
|
|
838
875
|
declare const PLUGIN_RUNTIME_IMPORT_MAP: Readonly<Record<TPluginRuntimeShimSpecifier, string>>;
|
|
839
876
|
|
|
840
|
-
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, usePluginRealtime };
|
|
877
|
+
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, MOBILE_RENDERER_VERSION, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, isMobileRendererCompatible, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, usePluginRealtime };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-
|
|
1
|
+
export { I as IPluginManifest, a as IPluginManifestAdminPage, b as IPluginManifestApiRoute, c as IPluginManifestAsset, d as IPluginManifestCapability, e as IPluginManifestCompatibility, f as IPluginManifestConflict, g as IPluginManifestDataAccess, h as IPluginManifestDependency, i as IPluginManifestExternalHost, j as IPluginManifestFeatureFlag, k as IPluginManifestHealth, l as IPluginManifestLookupExtension, m as IPluginManifestMobile, n as IPluginManifestPermission, o as IPluginManifestRealtimeTopic, p as IPluginManifestScheduledJob, q as IPluginManifestSecurity, r as IPluginManifestStyle, s as IPluginManifestTrustLevel } from '../manifest-8YXAk-4o.js';
|
|
2
2
|
import { I as IStyleRegistryEntry } from '../styles.registry-D6xMm5VR.js';
|
|
3
3
|
import '../common-qaDIAYS3.js';
|
|
4
4
|
|
|
@@ -15,6 +15,23 @@ import '../common-qaDIAYS3.js';
|
|
|
15
15
|
* Independent from the npm `version` of `@selfhelp/shared`.
|
|
16
16
|
*/
|
|
17
17
|
declare const PLUGIN_API_VERSION: "0.1.0";
|
|
18
|
+
/**
|
|
19
|
+
* Mobile renderer contract version. This is the SECOND, mobile-only
|
|
20
|
+
* compatibility axis (independent of `PLUGIN_API_VERSION`): it versions the
|
|
21
|
+
* mobile plugin rendering surface — the `registerMobile()` shape, `IStyleProps`
|
|
22
|
+
* / `TPluginStyleImplMap`, and the mobile host SDK primitives — that a plugin's
|
|
23
|
+
* mobile npm package compiles against.
|
|
24
|
+
*
|
|
25
|
+
* The mobile app and the `selfhelp-mobile-preview` image advertise this value
|
|
26
|
+
* (in `version.json` + the signed `mobile-preview-release.json`). A plugin
|
|
27
|
+
* declares the range it supports in `plugin.json` under `compatibility.mobile`;
|
|
28
|
+
* the SelfHelp Manager gates the plugin against the selected preview image's
|
|
29
|
+
* advertised `mobileRendererVersion` using {@see isMobileRendererCompatible}.
|
|
30
|
+
*
|
|
31
|
+
* Bump rules mirror the SDK contract: patch = additive fix, minor = additive
|
|
32
|
+
* renderer feature, major = breaking mobile renderer change.
|
|
33
|
+
*/
|
|
34
|
+
declare const MOBILE_RENDERER_VERSION: "0.1.0";
|
|
18
35
|
interface ISemver {
|
|
19
36
|
major: number;
|
|
20
37
|
minor: number;
|
|
@@ -44,6 +61,15 @@ declare function isPluginApiCompatible(required: string, host?: string): boolean
|
|
|
44
61
|
* - host minor >= plugin's required minor.
|
|
45
62
|
*/
|
|
46
63
|
declare function assertPluginApiVersion(required: string): void;
|
|
64
|
+
/**
|
|
65
|
+
* Non-throwing satisfaction check for the mobile-renderer axis: returns true
|
|
66
|
+
* when the host's `mobileRendererVersion` falls inside the plugin's declared
|
|
67
|
+
* `compatibility.mobile` range. Used by the SelfHelp Manager preflight to gate
|
|
68
|
+
* an enabled plugin's mobile package against the selected preview image, and by
|
|
69
|
+
* the mobile/preview runtime to skip an incompatible plugin instead of crashing.
|
|
70
|
+
* An empty/undefined range is treated as "no mobile support declared" → false.
|
|
71
|
+
*/
|
|
72
|
+
declare function isMobileRendererCompatible(requiredRange: string | undefined, host?: string): boolean;
|
|
47
73
|
/**
|
|
48
74
|
* Throw if the running CMS version is not in the plugin's declared
|
|
49
75
|
* compatibility range.
|
|
@@ -141,6 +167,12 @@ interface IPluginRelease {
|
|
|
141
167
|
core: string;
|
|
142
168
|
/** Semver range of host plugin-API versions this plugin runs on. */
|
|
143
169
|
pluginApi: string;
|
|
170
|
+
/**
|
|
171
|
+
* Semver range of the host mobile renderer contract
|
|
172
|
+
* (`mobileRendererVersion`) this plugin's mobile package supports.
|
|
173
|
+
* Additive; absent for web-only plugins.
|
|
174
|
+
*/
|
|
175
|
+
mobile?: string;
|
|
144
176
|
};
|
|
145
177
|
/** Optional other-plugin requirements consumed by the resolver. */
|
|
146
178
|
dependencies?: {
|
|
@@ -194,6 +226,11 @@ interface IPluginRegistry {
|
|
|
194
226
|
worker: IRegistryReleaseRef[];
|
|
195
227
|
/** Plugin release refs (CMS-installed) — multi-version, one ref per published version. */
|
|
196
228
|
plugins: IRegistryReleaseRef[];
|
|
229
|
+
/**
|
|
230
|
+
* Mobile-preview web image release refs (Manager-installed). Additive in
|
|
231
|
+
* registry `schemaVersion` 1.1 — older managers ignore the unknown array.
|
|
232
|
+
*/
|
|
233
|
+
mobilePreview?: IRegistryReleaseRef[];
|
|
197
234
|
/** Optional path to the security advisory feed. */
|
|
198
235
|
advisoriesUrl?: string;
|
|
199
236
|
/** Optional path to the cross-component compatibility feed. */
|
|
@@ -837,4 +874,4 @@ declare function isPluginRuntimeShimSpecifier(value: unknown): value is TPluginR
|
|
|
837
874
|
*/
|
|
838
875
|
declare const PLUGIN_RUNTIME_IMPORT_MAP: Readonly<Record<TPluginRuntimeShimSpecifier, string>>;
|
|
839
876
|
|
|
840
|
-
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, usePluginRealtime };
|
|
877
|
+
export { type IAdminPageDefinition, type IFieldRendererDefinition, type IMenuItemDefinition, type IMobilePluginApi, type IMobilePluginRegistration, type IPluginApi, type IPluginFeatureFlag, type IPluginFieldRendererProps, type IPluginHealthCheck, type IPluginLock, type IPluginLockEntry, type IPluginLockMigration, type IPluginLockMobileEntry, type IPluginRealtimePublisher, type IPluginRealtimeTopic, type IPluginRegistration, type IPluginRegistry, type IPluginRelease, type IRealtimeTransport, type IRegistryReleaseRef, type IRegistrySignatureBlock, type IRichTextEditorAdapter, type IRichTextEditorAdapterOptions, type IRichTextEditorValue, type IStyleDefinition, type IUsePluginRealtimeOptions, type IUsePluginRealtimeResult, MOBILE_RENDERER_VERSION, PLUGIN_API_VERSION, PLUGIN_REGISTRY_CHANNELS, PLUGIN_RUNTIME_GLOBAL_KEY, PLUGIN_RUNTIME_IMPORT_MAP, PLUGIN_RUNTIME_SHIM_BASE_PATH, PLUGIN_RUNTIME_SHIM_SPECIFIERS, type TPluginRegistryChannel, type TPluginRuntimeShimSpecifier, type TRealtimeTransportFactory, assertCmsCompatibility, assertPluginApiVersion, assertPluginVersionSemantics, buildPluginRuntimeShimPath, compareSemver, defineMobilePlugin, definePlugin, definePluginRealtimeTopic, isMobileRendererCompatible, isPluginApiCompatible, isPluginRuntimeShimSpecifier, parseSemver, satisfiesSemverRange, usePluginRealtime };
|
package/dist/plugin-sdk/index.js
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/plugin-sdk/index.ts
|
|
21
21
|
var plugin_sdk_exports = {};
|
|
22
22
|
__export(plugin_sdk_exports, {
|
|
23
|
+
MOBILE_RENDERER_VERSION: () => MOBILE_RENDERER_VERSION,
|
|
23
24
|
PLUGIN_API_VERSION: () => PLUGIN_API_VERSION,
|
|
24
25
|
PLUGIN_REGISTRY_CHANNELS: () => PLUGIN_REGISTRY_CHANNELS,
|
|
25
26
|
PLUGIN_RUNTIME_GLOBAL_KEY: () => PLUGIN_RUNTIME_GLOBAL_KEY,
|
|
@@ -34,6 +35,7 @@ __export(plugin_sdk_exports, {
|
|
|
34
35
|
defineMobilePlugin: () => defineMobilePlugin,
|
|
35
36
|
definePlugin: () => definePlugin,
|
|
36
37
|
definePluginRealtimeTopic: () => definePluginRealtimeTopic,
|
|
38
|
+
isMobileRendererCompatible: () => isMobileRendererCompatible,
|
|
37
39
|
isPluginApiCompatible: () => isPluginApiCompatible,
|
|
38
40
|
isPluginRuntimeShimSpecifier: () => isPluginRuntimeShimSpecifier,
|
|
39
41
|
parseSemver: () => parseSemver,
|
|
@@ -44,6 +46,7 @@ module.exports = __toCommonJS(plugin_sdk_exports);
|
|
|
44
46
|
|
|
45
47
|
// src/plugin-sdk/version.ts
|
|
46
48
|
var PLUGIN_API_VERSION = "0.1.0";
|
|
49
|
+
var MOBILE_RENDERER_VERSION = "0.1.0";
|
|
47
50
|
var SEMVER_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/;
|
|
48
51
|
function parseSemver(version) {
|
|
49
52
|
const match = SEMVER_REGEX.exec(version);
|
|
@@ -129,6 +132,14 @@ function assertPluginApiVersion(required) {
|
|
|
129
132
|
);
|
|
130
133
|
}
|
|
131
134
|
}
|
|
135
|
+
function isMobileRendererCompatible(requiredRange, host = MOBILE_RENDERER_VERSION) {
|
|
136
|
+
if (!requiredRange) return false;
|
|
137
|
+
try {
|
|
138
|
+
return satisfiesSemverRange(host, requiredRange);
|
|
139
|
+
} catch {
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
132
143
|
function assertCmsCompatibility(cmsVersion, range) {
|
|
133
144
|
if (!satisfiesSemverRange(cmsVersion, range)) {
|
|
134
145
|
throw new Error(
|
|
@@ -522,6 +533,7 @@ var PLUGIN_RUNTIME_IMPORT_MAP = Object.freeze(
|
|
|
522
533
|
);
|
|
523
534
|
// Annotate the CommonJS export names for ESM import in node:
|
|
524
535
|
0 && (module.exports = {
|
|
536
|
+
MOBILE_RENDERER_VERSION,
|
|
525
537
|
PLUGIN_API_VERSION,
|
|
526
538
|
PLUGIN_REGISTRY_CHANNELS,
|
|
527
539
|
PLUGIN_RUNTIME_GLOBAL_KEY,
|
|
@@ -536,6 +548,7 @@ var PLUGIN_RUNTIME_IMPORT_MAP = Object.freeze(
|
|
|
536
548
|
defineMobilePlugin,
|
|
537
549
|
definePlugin,
|
|
538
550
|
definePluginRealtimeTopic,
|
|
551
|
+
isMobileRendererCompatible,
|
|
539
552
|
isPluginApiCompatible,
|
|
540
553
|
isPluginRuntimeShimSpecifier,
|
|
541
554
|
parseSemver,
|