@edsis/angular 22.0.91 → 22.0.93
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/README.md +121 -3
- package/fesm2022/edsis-angular-block-themes.mjs +4 -2
- package/fesm2022/edsis-angular-block-themes.mjs.map +1 -1
- package/fesm2022/edsis-angular-module-auth.mjs +374 -33
- package/fesm2022/edsis-angular-module-auth.mjs.map +1 -1
- package/fesm2022/edsis-angular-platform-mfe.mjs +329 -0
- package/fesm2022/edsis-angular-platform-mfe.mjs.map +1 -0
- package/package.json +9 -5
- package/types/edsis-angular-block-themes.d.ts +6 -2
- package/types/edsis-angular-module-auth.d.ts +100 -9
- package/types/edsis-angular-platform-mfe.d.ts +126 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
2
|
+
import { AppPreferencesDefaults } from '@edsis/angular/block/themes';
|
|
3
|
+
import { EdsisAuthConfig } from '@edsis/angular/module/auth';
|
|
4
|
+
import { EdsisRuntimeConfig } from '@edsis/angular/services/runtime';
|
|
5
|
+
import { Routes } from '@angular/router';
|
|
6
|
+
import { NavigationItem } from '@edsis/navigation';
|
|
7
|
+
|
|
8
|
+
declare const APPLICATION_PROFILE_NAMES: readonly ["mfe-standalone"];
|
|
9
|
+
declare const DEFAULT_APPLICATION_PROFILE_NAME: "mfe-standalone";
|
|
10
|
+
type ApplicationProfileName = (typeof APPLICATION_PROFILE_NAMES)[number];
|
|
11
|
+
|
|
12
|
+
/** Centrally managed visual and structural defaults for a standalone MFE. */
|
|
13
|
+
interface ApplicationProfile {
|
|
14
|
+
readonly name: ApplicationProfileName;
|
|
15
|
+
readonly defaults: AppPreferencesDefaults;
|
|
16
|
+
}
|
|
17
|
+
declare const MFE_STANDALONE_APPLICATION_PROFILE: ApplicationProfile;
|
|
18
|
+
declare const APPLICATION_PROFILES: Readonly<{
|
|
19
|
+
'mfe-standalone': ApplicationProfile;
|
|
20
|
+
}>;
|
|
21
|
+
declare const MFE_APPLICATION_PROFILE: InjectionToken<ApplicationProfile>;
|
|
22
|
+
interface StandaloneMfeConfig {
|
|
23
|
+
readonly auth: EdsisAuthConfig;
|
|
24
|
+
readonly runtime?: EdsisRuntimeConfig;
|
|
25
|
+
/** Exact registry field; MFEs cannot invent per-app global profiles. */
|
|
26
|
+
readonly standaloneProfile: ApplicationProfileName;
|
|
27
|
+
}
|
|
28
|
+
declare function applicationProfile(name?: ApplicationProfileName): ApplicationProfile;
|
|
29
|
+
/**
|
|
30
|
+
* Composes the global providers used only by a standalone MFE application.
|
|
31
|
+
* Federated feature routes must inherit these singletons from their host and
|
|
32
|
+
* therefore must never call this provider.
|
|
33
|
+
*/
|
|
34
|
+
declare function provideStandaloneMfe(config: StandaloneMfeConfig): EnvironmentProviders;
|
|
35
|
+
|
|
36
|
+
declare const MFE_CONTRACT_VERSION: 1;
|
|
37
|
+
declare const MFE_ENTRY_EXPOSURE: "./Mfe";
|
|
38
|
+
declare const MFE_EXPOSURE_KINDS: readonly ["contract", "routes", "page", "component"];
|
|
39
|
+
declare const MFE_CAPABILITY_MODES: readonly ["required", "optional", "provided"];
|
|
40
|
+
declare const MFE_PLATFORM_CAPABILITIES: {
|
|
41
|
+
readonly auth: "edsis.auth";
|
|
42
|
+
readonly loading: "edsis.loading";
|
|
43
|
+
readonly navigation: "edsis.navigation";
|
|
44
|
+
readonly runtime: "edsis.runtime";
|
|
45
|
+
readonly theme: "edsis.theme";
|
|
46
|
+
};
|
|
47
|
+
type MfeContractVersion = typeof MFE_CONTRACT_VERSION;
|
|
48
|
+
type MfeExposureKind = (typeof MFE_EXPOSURE_KINDS)[number];
|
|
49
|
+
type MfeCapabilityMode = (typeof MFE_CAPABILITY_MODES)[number];
|
|
50
|
+
type MfeId = string;
|
|
51
|
+
type MfeExposureKey = `./${string}`;
|
|
52
|
+
type MfeCapabilityId = string;
|
|
53
|
+
/** A host capability consumed or supplied by the MFE contract. */
|
|
54
|
+
interface MfeCapabilityDescriptor {
|
|
55
|
+
readonly id: MfeCapabilityId;
|
|
56
|
+
/** Capability compatibility is versioned by a positive major number. */
|
|
57
|
+
readonly version: number;
|
|
58
|
+
readonly mode: MfeCapabilityMode;
|
|
59
|
+
readonly description?: string;
|
|
60
|
+
}
|
|
61
|
+
/** Metadata for every module exposed in the remote federation configuration. */
|
|
62
|
+
interface MfeExposureDescriptor {
|
|
63
|
+
readonly key: MfeExposureKey;
|
|
64
|
+
readonly kind: MfeExposureKind;
|
|
65
|
+
/** Contract major in which this exposure became public. */
|
|
66
|
+
readonly since: MfeContractVersion;
|
|
67
|
+
/** Export to read from the loaded module. Omit for its default export. */
|
|
68
|
+
readonly exportName?: string;
|
|
69
|
+
/** Capability IDs associated with this exposure when it is rendered directly. */
|
|
70
|
+
readonly capabilities?: readonly MfeCapabilityId[];
|
|
71
|
+
readonly description?: string;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Public, shell-free contract exposed from `./Mfe` by every EDSIS remote.
|
|
75
|
+
*
|
|
76
|
+
* The host owns global shell, theme, authentication, navigation state, runtime,
|
|
77
|
+
* and loading services. The remote contributes only feature routes,
|
|
78
|
+
* navigation metadata, capabilities, and optional direct exposures.
|
|
79
|
+
*/
|
|
80
|
+
interface MfeContractV1 {
|
|
81
|
+
readonly contractVersion: MfeContractVersion;
|
|
82
|
+
readonly id: MfeId;
|
|
83
|
+
readonly displayName: string;
|
|
84
|
+
readonly featureRoutes: Routes;
|
|
85
|
+
readonly navigation: readonly NavigationItem[];
|
|
86
|
+
readonly capabilities: readonly MfeCapabilityDescriptor[];
|
|
87
|
+
readonly exposures: readonly MfeExposureDescriptor[];
|
|
88
|
+
}
|
|
89
|
+
type MfeContract = MfeContractV1;
|
|
90
|
+
type MfeContractIssueCode = 'duplicate_capability' | 'duplicate_exposure' | 'invalid_capability' | 'invalid_contract' | 'invalid_exposure' | 'invalid_id' | 'invalid_navigation' | 'invalid_routes' | 'missing_entry_exposure' | 'unknown_capability' | 'unsupported_version';
|
|
91
|
+
interface MfeContractIssue {
|
|
92
|
+
readonly code: MfeContractIssueCode;
|
|
93
|
+
readonly path: string;
|
|
94
|
+
readonly message: string;
|
|
95
|
+
}
|
|
96
|
+
/** Host-side registry expectations applied after the remote shape is trusted. */
|
|
97
|
+
interface MfeContractExpectation {
|
|
98
|
+
readonly id: string;
|
|
99
|
+
readonly supportedContractVersions: readonly number[];
|
|
100
|
+
}
|
|
101
|
+
type MfeContractValidationResult = {
|
|
102
|
+
readonly valid: true;
|
|
103
|
+
readonly contract: MfeContract;
|
|
104
|
+
readonly issues: readonly [];
|
|
105
|
+
} | {
|
|
106
|
+
readonly valid: false;
|
|
107
|
+
readonly issues: readonly MfeContractIssue[];
|
|
108
|
+
};
|
|
109
|
+
declare class MfeContractValidationError extends Error {
|
|
110
|
+
readonly issues: readonly MfeContractIssue[];
|
|
111
|
+
constructor(issuesOrMessage: readonly MfeContractIssue[] | string);
|
|
112
|
+
}
|
|
113
|
+
/** Keeps literal inference while rejecting an invalid contract during remote evaluation. */
|
|
114
|
+
declare function defineMfe<const Contract extends MfeContractV1>(contract: Contract): Contract;
|
|
115
|
+
declare function isMfeContract(value: unknown): value is MfeContract;
|
|
116
|
+
declare function assertMfeContract(value: unknown): asserts value is MfeContract;
|
|
117
|
+
/**
|
|
118
|
+
* Reads the exact named `mfe` export from an untrusted federation namespace.
|
|
119
|
+
* Shape validation runs before registry identity and supported-major checks.
|
|
120
|
+
*/
|
|
121
|
+
declare function readMfeContract(remoteModule: unknown, expectation: MfeContractExpectation): MfeContractV1;
|
|
122
|
+
/** Validates an untrusted remote value before the host reads routes or exposures from it. */
|
|
123
|
+
declare function validateMfeContract(value: unknown): MfeContractValidationResult;
|
|
124
|
+
|
|
125
|
+
export { APPLICATION_PROFILES, APPLICATION_PROFILE_NAMES, DEFAULT_APPLICATION_PROFILE_NAME, MFE_APPLICATION_PROFILE, MFE_CAPABILITY_MODES, MFE_CONTRACT_VERSION, MFE_ENTRY_EXPOSURE, MFE_EXPOSURE_KINDS, MFE_PLATFORM_CAPABILITIES, MFE_STANDALONE_APPLICATION_PROFILE, MfeContractValidationError, applicationProfile, assertMfeContract, defineMfe, isMfeContract, provideStandaloneMfe, readMfeContract, validateMfeContract };
|
|
126
|
+
export type { ApplicationProfile, ApplicationProfileName, MfeCapabilityDescriptor, MfeCapabilityId, MfeCapabilityMode, MfeContract, MfeContractExpectation, MfeContractIssue, MfeContractIssueCode, MfeContractV1, MfeContractValidationResult, MfeContractVersion, MfeExposureDescriptor, MfeExposureKey, MfeExposureKind, MfeId, StandaloneMfeConfig };
|