@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.
@@ -0,0 +1,329 @@
1
+ import { InjectionToken, makeEnvironmentProviders } from '@angular/core';
2
+ import { provideAppPreferences, provideRuntimeThemeDevice } from '@edsis/angular/block/themes';
3
+ import { provideEdsisAuth } from '@edsis/angular/module/auth';
4
+ import { provideEdsisRuntime } from '@edsis/angular/services/runtime';
5
+ import { provideUiTheme } from '@edsis/theme/styles';
6
+
7
+ const APPLICATION_PROFILE_NAMES = ['mfe-standalone'];
8
+ const DEFAULT_APPLICATION_PROFILE_NAME = 'mfe-standalone';
9
+
10
+ const MFE_STANDALONE_APPLICATION_PROFILE = deepFreezeProfile({
11
+ name: 'mfe-standalone',
12
+ defaults: {
13
+ theme: {
14
+ mode: 'light',
15
+ space: 'compact',
16
+ radius: 'medium',
17
+ appearance: 'desktop',
18
+ color: 'default',
19
+ brand: 'default',
20
+ },
21
+ layout: {
22
+ surface: 'base',
23
+ type: 'horizontal',
24
+ width: 'full',
25
+ },
26
+ navigation: {
27
+ orientation: 'horizontal',
28
+ type: 'flyout',
29
+ position: 'top',
30
+ collapsed: false,
31
+ dockbarMode: 'default',
32
+ },
33
+ },
34
+ });
35
+ const APPLICATION_PROFILES = Object.freeze({
36
+ 'mfe-standalone': MFE_STANDALONE_APPLICATION_PROFILE,
37
+ });
38
+ const MFE_APPLICATION_PROFILE = new InjectionToken('MFE_APPLICATION_PROFILE');
39
+ function applicationProfile(name = DEFAULT_APPLICATION_PROFILE_NAME) {
40
+ const profiles = APPLICATION_PROFILES;
41
+ const profile = profiles[name];
42
+ if (!profile) {
43
+ throw new Error(`Unknown EDSIS application profile "${String(name)}".`);
44
+ }
45
+ return profile;
46
+ }
47
+ /**
48
+ * Composes the global providers used only by a standalone MFE application.
49
+ * Federated feature routes must inherit these singletons from their host and
50
+ * therefore must never call this provider.
51
+ */
52
+ function provideStandaloneMfe(config) {
53
+ const profile = applicationProfile(config.standaloneProfile);
54
+ return makeEnvironmentProviders([
55
+ { provide: MFE_APPLICATION_PROFILE, useValue: profile },
56
+ provideEdsisRuntime(config.runtime),
57
+ provideUiTheme(themeOptionsForProfile(profile)),
58
+ provideAppPreferences({ defaults: profile.defaults }),
59
+ provideRuntimeThemeDevice({ appearanceFallback: false }),
60
+ provideEdsisAuth(config.auth),
61
+ ]);
62
+ }
63
+ function themeOptionsForProfile(profile) {
64
+ return {
65
+ mode: profile.defaults.theme.mode,
66
+ space: profile.defaults.theme.space,
67
+ radius: profile.defaults.theme.radius,
68
+ appearance: profile.defaults.theme.appearance,
69
+ color: profile.defaults.theme.color,
70
+ brand: profile.defaults.theme.brand,
71
+ };
72
+ }
73
+ function deepFreezeProfile(profile) {
74
+ Object.freeze(profile.defaults.theme);
75
+ Object.freeze(profile.defaults.layout);
76
+ Object.freeze(profile.defaults.navigation);
77
+ Object.freeze(profile.defaults);
78
+ return Object.freeze(profile);
79
+ }
80
+
81
+ const MFE_CONTRACT_VERSION = 1;
82
+ const MFE_ENTRY_EXPOSURE = './Mfe';
83
+ const MFE_EXPOSURE_KINDS = ['contract', 'routes', 'page', 'component'];
84
+ const MFE_CAPABILITY_MODES = ['required', 'optional', 'provided'];
85
+ const MFE_PLATFORM_CAPABILITIES = {
86
+ auth: 'edsis.auth',
87
+ loading: 'edsis.loading',
88
+ navigation: 'edsis.navigation',
89
+ runtime: 'edsis.runtime',
90
+ theme: 'edsis.theme',
91
+ };
92
+ class MfeContractValidationError extends Error {
93
+ issues;
94
+ constructor(issuesOrMessage) {
95
+ const issues = typeof issuesOrMessage === 'string' ? [] : issuesOrMessage;
96
+ super(typeof issuesOrMessage === 'string'
97
+ ? issuesOrMessage
98
+ : `Invalid EDSIS MFE contract: ${issues
99
+ .map((issue) => `${issue.path} ${issue.message}`)
100
+ .join('; ')}`);
101
+ this.name = 'MfeContractValidationError';
102
+ this.issues = issues;
103
+ }
104
+ }
105
+ /** Keeps literal inference while rejecting an invalid contract during remote evaluation. */
106
+ function defineMfe(contract) {
107
+ assertMfeContract(contract);
108
+ return contract;
109
+ }
110
+ function isMfeContract(value) {
111
+ return validateMfeContract(value).valid;
112
+ }
113
+ function assertMfeContract(value) {
114
+ const result = validateMfeContract(value);
115
+ if (!result.valid) {
116
+ throw new MfeContractValidationError(result.issues);
117
+ }
118
+ }
119
+ /**
120
+ * Reads the exact named `mfe` export from an untrusted federation namespace.
121
+ * Shape validation runs before registry identity and supported-major checks.
122
+ */
123
+ function readMfeContract(remoteModule, expectation) {
124
+ if (!isRecord(remoteModule) || !('mfe' in remoteModule)) {
125
+ throw new MfeContractValidationError('The remote module does not export a named "mfe" contract.');
126
+ }
127
+ const result = validateMfeContract(remoteModule['mfe']);
128
+ if (!result.valid) {
129
+ throw new MfeContractValidationError(result.issues);
130
+ }
131
+ const contract = result.contract;
132
+ if (contract.id !== expectation.id) {
133
+ throw new MfeContractValidationError(`Expected MFE id "${expectation.id}" but received "${contract.id}".`);
134
+ }
135
+ if (!expectation.supportedContractVersions.includes(contract.contractVersion)) {
136
+ throw new MfeContractValidationError(`MFE "${expectation.id}" uses unsupported contract version "${contract.contractVersion}".`);
137
+ }
138
+ return contract;
139
+ }
140
+ /** Validates an untrusted remote value before the host reads routes or exposures from it. */
141
+ function validateMfeContract(value) {
142
+ if (!isRecord(value)) {
143
+ return invalid([issue('invalid_contract', '$', 'must be a non-null object')]);
144
+ }
145
+ const issues = [];
146
+ validateContractIdentity(value, issues);
147
+ validateRouteAndNavigationContributions(value, issues);
148
+ const capabilityIds = validateCapabilities(value['capabilities'], issues);
149
+ validateExposures(value['exposures'], capabilityIds, issues);
150
+ if (issues.length > 0) {
151
+ return invalid(issues);
152
+ }
153
+ return {
154
+ valid: true,
155
+ contract: value,
156
+ issues: [],
157
+ };
158
+ }
159
+ function validateContractIdentity(candidate, issues) {
160
+ if (candidate['contractVersion'] !== MFE_CONTRACT_VERSION) {
161
+ issues.push(issue('unsupported_version', '$.contractVersion', `must equal the supported major ${MFE_CONTRACT_VERSION}`));
162
+ }
163
+ const id = candidate['id'];
164
+ if (typeof id !== 'string' || !MFE_ID_PATTERN.test(id)) {
165
+ issues.push(issue('invalid_id', '$.id', 'must be a lower-kebab identifier such as "developer" or "sales-activity"'));
166
+ }
167
+ if (!isNonEmptyString(candidate['displayName'])) {
168
+ issues.push(issue('invalid_contract', '$.displayName', 'must be a non-empty string'));
169
+ }
170
+ }
171
+ function validateRouteAndNavigationContributions(candidate, issues) {
172
+ const routes = candidate['featureRoutes'];
173
+ if (!Array.isArray(routes) || routes.length === 0) {
174
+ issues.push(issue('invalid_routes', '$.featureRoutes', 'must be a non-empty route array'));
175
+ }
176
+ else {
177
+ routes.forEach((route, index) => {
178
+ if (!isRecord(route)) {
179
+ issues.push(issue('invalid_routes', `$.featureRoutes[${index}]`, 'must be an Angular route object'));
180
+ }
181
+ });
182
+ }
183
+ const navigation = candidate['navigation'];
184
+ if (!Array.isArray(navigation)) {
185
+ issues.push(issue('invalid_navigation', '$.navigation', 'must be an array'));
186
+ }
187
+ else {
188
+ navigation.forEach((item, index) => {
189
+ if (!isRecord(item)) {
190
+ issues.push(issue('invalid_navigation', `$.navigation[${index}]`, 'must be a navigation item object'));
191
+ }
192
+ });
193
+ }
194
+ }
195
+ function validateCapabilities(value, issues) {
196
+ if (!Array.isArray(value)) {
197
+ issues.push(issue('invalid_capability', '$.capabilities', 'must be an array'));
198
+ return new Set();
199
+ }
200
+ const capabilityIds = new Set();
201
+ value.forEach((capability, index) => {
202
+ const path = `$.capabilities[${index}]`;
203
+ if (!isRecord(capability)) {
204
+ issues.push(issue('invalid_capability', path, 'must be a capability descriptor object'));
205
+ return;
206
+ }
207
+ const id = capability['id'];
208
+ if (typeof id !== 'string' || !MFE_CAPABILITY_ID_PATTERN.test(id)) {
209
+ issues.push(issue('invalid_capability', `${path}.id`, 'must be a lowercase dotted, colon, or kebab capability identifier'));
210
+ }
211
+ else if (capabilityIds.has(id)) {
212
+ issues.push(issue('duplicate_capability', `${path}.id`, `duplicates capability "${id}"`));
213
+ }
214
+ else {
215
+ capabilityIds.add(id);
216
+ }
217
+ const version = capability['version'];
218
+ if (!Number.isInteger(version) || version < 1) {
219
+ issues.push(issue('invalid_capability', `${path}.version`, 'must be a positive integer major'));
220
+ }
221
+ if (!includes(MFE_CAPABILITY_MODES, capability['mode'])) {
222
+ issues.push(issue('invalid_capability', `${path}.mode`, `must be one of ${MFE_CAPABILITY_MODES.join(', ')}`));
223
+ }
224
+ validateOptionalString(capability, 'description', path, 'invalid_capability', issues);
225
+ });
226
+ return capabilityIds;
227
+ }
228
+ function validateExposures(value, capabilityIds, issues) {
229
+ if (!Array.isArray(value)) {
230
+ issues.push(issue('invalid_exposure', '$.exposures', 'must be an array'));
231
+ return;
232
+ }
233
+ const exposureKeys = new Set();
234
+ let entryExposureCount = 0;
235
+ value.forEach((exposure, index) => {
236
+ const path = `$.exposures[${index}]`;
237
+ if (!isRecord(exposure)) {
238
+ issues.push(issue('invalid_exposure', path, 'must be an exposure descriptor object'));
239
+ return;
240
+ }
241
+ const key = exposure['key'];
242
+ if (typeof key !== 'string' || !MFE_EXPOSURE_KEY_PATTERN.test(key)) {
243
+ issues.push(issue('invalid_exposure', `${path}.key`, 'must start with "./" and contain no empty or unsafe path segments'));
244
+ }
245
+ else if (exposureKeys.has(key)) {
246
+ issues.push(issue('duplicate_exposure', `${path}.key`, `duplicates exposure "${key}"`));
247
+ }
248
+ else {
249
+ exposureKeys.add(key);
250
+ }
251
+ if (!includes(MFE_EXPOSURE_KINDS, exposure['kind'])) {
252
+ issues.push(issue('invalid_exposure', `${path}.kind`, `must be one of ${MFE_EXPOSURE_KINDS.join(', ')}`));
253
+ }
254
+ if (key === MFE_ENTRY_EXPOSURE) {
255
+ entryExposureCount += 1;
256
+ if (exposure['kind'] !== 'contract') {
257
+ issues.push(issue('invalid_exposure', `${path}.kind`, `must be "contract" for ${MFE_ENTRY_EXPOSURE}`));
258
+ }
259
+ }
260
+ else if (exposure['kind'] === 'contract') {
261
+ issues.push(issue('invalid_exposure', `${path}.kind`, `the contract kind is reserved for ${MFE_ENTRY_EXPOSURE}`));
262
+ }
263
+ if (exposure['since'] !== MFE_CONTRACT_VERSION) {
264
+ issues.push(issue('invalid_exposure', `${path}.since`, `must equal contract major ${MFE_CONTRACT_VERSION}`));
265
+ }
266
+ validateOptionalString(exposure, 'exportName', path, 'invalid_exposure', issues);
267
+ validateOptionalString(exposure, 'description', path, 'invalid_exposure', issues);
268
+ validateExposureCapabilities(exposure['capabilities'], path, capabilityIds, issues);
269
+ });
270
+ if (entryExposureCount === 0) {
271
+ issues.push(issue('missing_entry_exposure', '$.exposures', `must declare the ${MFE_ENTRY_EXPOSURE} contract exposure`));
272
+ }
273
+ }
274
+ function validateExposureCapabilities(value, path, capabilityIds, issues) {
275
+ if (value === undefined) {
276
+ return;
277
+ }
278
+ if (!Array.isArray(value)) {
279
+ issues.push(issue('invalid_exposure', `${path}.capabilities`, 'must be an array'));
280
+ return;
281
+ }
282
+ const referencedIds = new Set();
283
+ value.forEach((capabilityId, index) => {
284
+ const capabilityPath = `${path}.capabilities[${index}]`;
285
+ if (typeof capabilityId !== 'string' || !MFE_CAPABILITY_ID_PATTERN.test(capabilityId)) {
286
+ issues.push(issue('invalid_exposure', capabilityPath, 'must be a valid capability identifier'));
287
+ return;
288
+ }
289
+ if (referencedIds.has(capabilityId)) {
290
+ issues.push(issue('invalid_exposure', capabilityPath, `duplicates capability "${capabilityId}"`));
291
+ return;
292
+ }
293
+ referencedIds.add(capabilityId);
294
+ if (!capabilityIds.has(capabilityId)) {
295
+ issues.push(issue('unknown_capability', capabilityPath, `references undeclared capability "${capabilityId}"`));
296
+ }
297
+ });
298
+ }
299
+ function validateOptionalString(candidate, key, path, code, issues) {
300
+ const value = candidate[key];
301
+ if (value !== undefined && !isNonEmptyString(value)) {
302
+ issues.push(issue(code, `${path}.${key}`, 'must be a non-empty string when provided'));
303
+ }
304
+ }
305
+ function issue(code, path, message) {
306
+ return { code, path, message };
307
+ }
308
+ function invalid(issues) {
309
+ return { valid: false, issues };
310
+ }
311
+ function isRecord(value) {
312
+ return typeof value === 'object' && value !== null && !Array.isArray(value);
313
+ }
314
+ function isNonEmptyString(value) {
315
+ return typeof value === 'string' && value.trim().length > 0;
316
+ }
317
+ function includes(values, value) {
318
+ return typeof value === 'string' && values.includes(value);
319
+ }
320
+ const MFE_ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
321
+ const MFE_EXPOSURE_KEY_PATTERN = /^\.\/[A-Za-z0-9][A-Za-z0-9._-]*(?:\/[A-Za-z0-9][A-Za-z0-9._-]*)*$/u;
322
+ const MFE_CAPABILITY_ID_PATTERN = /^[a-z][a-z0-9]*(?:[.:-][a-z0-9]+(?:-[a-z0-9]+)*)*$/u;
323
+
324
+ /**
325
+ * Generated bundle index. Do not edit.
326
+ */
327
+
328
+ 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 };
329
+ //# sourceMappingURL=edsis-angular-platform-mfe.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edsis-angular-platform-mfe.mjs","sources":["../../../library/angular/platform/mfe/application-profile-name.ts","../../../library/angular/platform/mfe/application-profile.ts","../../../library/angular/platform/mfe/mfe-contract.ts","../../../library/angular/platform/mfe/edsis-angular-platform-mfe.ts"],"sourcesContent":["export const APPLICATION_PROFILE_NAMES = ['mfe-standalone'] as const;\nexport const DEFAULT_APPLICATION_PROFILE_NAME = 'mfe-standalone' as const;\n\nexport type ApplicationProfileName = (typeof APPLICATION_PROFILE_NAMES)[number];\n","import { InjectionToken, makeEnvironmentProviders, type EnvironmentProviders } from '@angular/core';\nimport {\n provideAppPreferences,\n provideRuntimeThemeDevice,\n type AppPreferencesDefaults,\n} from '@edsis/angular/block/themes';\nimport { provideEdsisAuth, type EdsisAuthConfig } from '@edsis/angular/module/auth';\nimport { provideEdsisRuntime, type EdsisRuntimeConfig } from '@edsis/angular/services/runtime';\nimport { provideUiTheme, type ThemeOptions } from '@edsis/theme/styles';\n\nimport {\n DEFAULT_APPLICATION_PROFILE_NAME,\n type ApplicationProfileName,\n} from './application-profile-name';\n\nexport {\n APPLICATION_PROFILE_NAMES,\n DEFAULT_APPLICATION_PROFILE_NAME,\n type ApplicationProfileName,\n} from './application-profile-name';\n\n/** Centrally managed visual and structural defaults for a standalone MFE. */\nexport interface ApplicationProfile {\n readonly name: ApplicationProfileName;\n readonly defaults: AppPreferencesDefaults;\n}\n\nexport const MFE_STANDALONE_APPLICATION_PROFILE: ApplicationProfile = deepFreezeProfile({\n name: 'mfe-standalone',\n defaults: {\n theme: {\n mode: 'light',\n space: 'compact',\n radius: 'medium',\n appearance: 'desktop',\n color: 'default',\n brand: 'default',\n },\n layout: {\n surface: 'base',\n type: 'horizontal',\n width: 'full',\n },\n navigation: {\n orientation: 'horizontal',\n type: 'flyout',\n position: 'top',\n collapsed: false,\n dockbarMode: 'default',\n },\n },\n});\n\nexport const APPLICATION_PROFILES = Object.freeze({\n 'mfe-standalone': MFE_STANDALONE_APPLICATION_PROFILE,\n}) satisfies Readonly<Record<ApplicationProfileName, ApplicationProfile>>;\n\nexport const MFE_APPLICATION_PROFILE = new InjectionToken<ApplicationProfile>(\n 'MFE_APPLICATION_PROFILE',\n);\n\nexport interface StandaloneMfeConfig {\n readonly auth: EdsisAuthConfig;\n readonly runtime?: EdsisRuntimeConfig;\n /** Exact registry field; MFEs cannot invent per-app global profiles. */\n readonly standaloneProfile: ApplicationProfileName;\n}\n\nexport function applicationProfile(\n name: ApplicationProfileName = DEFAULT_APPLICATION_PROFILE_NAME,\n): ApplicationProfile {\n const profiles: Readonly<Record<string, ApplicationProfile | undefined>> = APPLICATION_PROFILES;\n const profile = profiles[name];\n\n if (!profile) {\n throw new Error(`Unknown EDSIS application profile \"${String(name)}\".`);\n }\n\n return profile;\n}\n\n/**\n * Composes the global providers used only by a standalone MFE application.\n * Federated feature routes must inherit these singletons from their host and\n * therefore must never call this provider.\n */\nexport function provideStandaloneMfe(config: StandaloneMfeConfig): EnvironmentProviders {\n const profile = applicationProfile(config.standaloneProfile);\n\n return makeEnvironmentProviders([\n { provide: MFE_APPLICATION_PROFILE, useValue: profile },\n provideEdsisRuntime(config.runtime),\n provideUiTheme(themeOptionsForProfile(profile)),\n provideAppPreferences({ defaults: profile.defaults }),\n provideRuntimeThemeDevice({ appearanceFallback: false }),\n provideEdsisAuth(config.auth),\n ]);\n}\n\nfunction themeOptionsForProfile(profile: ApplicationProfile): ThemeOptions {\n return {\n mode: profile.defaults.theme.mode,\n space: profile.defaults.theme.space,\n radius: profile.defaults.theme.radius,\n appearance: profile.defaults.theme.appearance,\n color: profile.defaults.theme.color,\n brand: profile.defaults.theme.brand,\n };\n}\n\nfunction deepFreezeProfile(profile: ApplicationProfile): ApplicationProfile {\n Object.freeze(profile.defaults.theme);\n Object.freeze(profile.defaults.layout);\n Object.freeze(profile.defaults.navigation);\n Object.freeze(profile.defaults);\n return Object.freeze(profile);\n}\n","import type { Routes } from '@angular/router';\nimport type { NavigationItem } from '@edsis/navigation';\n\nexport const MFE_CONTRACT_VERSION = 1 as const;\nexport const MFE_ENTRY_EXPOSURE = './Mfe' as const;\n\nexport const MFE_EXPOSURE_KINDS = ['contract', 'routes', 'page', 'component'] as const;\nexport const MFE_CAPABILITY_MODES = ['required', 'optional', 'provided'] as const;\n\nexport const MFE_PLATFORM_CAPABILITIES = {\n auth: 'edsis.auth',\n loading: 'edsis.loading',\n navigation: 'edsis.navigation',\n runtime: 'edsis.runtime',\n theme: 'edsis.theme',\n} as const;\n\nexport type MfeContractVersion = typeof MFE_CONTRACT_VERSION;\nexport type MfeExposureKind = (typeof MFE_EXPOSURE_KINDS)[number];\nexport type MfeCapabilityMode = (typeof MFE_CAPABILITY_MODES)[number];\nexport type MfeId = string;\nexport type MfeExposureKey = `./${string}`;\nexport type MfeCapabilityId = string;\n\n/** A host capability consumed or supplied by the MFE contract. */\nexport interface MfeCapabilityDescriptor {\n readonly id: MfeCapabilityId;\n /** Capability compatibility is versioned by a positive major number. */\n readonly version: number;\n readonly mode: MfeCapabilityMode;\n readonly description?: string;\n}\n\n/** Metadata for every module exposed in the remote federation configuration. */\nexport interface MfeExposureDescriptor {\n readonly key: MfeExposureKey;\n readonly kind: MfeExposureKind;\n /** Contract major in which this exposure became public. */\n readonly since: MfeContractVersion;\n /** Export to read from the loaded module. Omit for its default export. */\n readonly exportName?: string;\n /** Capability IDs associated with this exposure when it is rendered directly. */\n readonly capabilities?: readonly MfeCapabilityId[];\n readonly description?: string;\n}\n\n/**\n * Public, shell-free contract exposed from `./Mfe` by every EDSIS remote.\n *\n * The host owns global shell, theme, authentication, navigation state, runtime,\n * and loading services. The remote contributes only feature routes,\n * navigation metadata, capabilities, and optional direct exposures.\n */\nexport interface MfeContractV1 {\n readonly contractVersion: MfeContractVersion;\n readonly id: MfeId;\n readonly displayName: string;\n readonly featureRoutes: Routes;\n readonly navigation: readonly NavigationItem[];\n readonly capabilities: readonly MfeCapabilityDescriptor[];\n readonly exposures: readonly MfeExposureDescriptor[];\n}\n\nexport type MfeContract = MfeContractV1;\n\nexport type MfeContractIssueCode =\n | 'duplicate_capability'\n | 'duplicate_exposure'\n | 'invalid_capability'\n | 'invalid_contract'\n | 'invalid_exposure'\n | 'invalid_id'\n | 'invalid_navigation'\n | 'invalid_routes'\n | 'missing_entry_exposure'\n | 'unknown_capability'\n | 'unsupported_version';\n\nexport interface MfeContractIssue {\n readonly code: MfeContractIssueCode;\n readonly path: string;\n readonly message: string;\n}\n\n/** Host-side registry expectations applied after the remote shape is trusted. */\nexport interface MfeContractExpectation {\n readonly id: string;\n readonly supportedContractVersions: readonly number[];\n}\n\nexport type MfeContractValidationResult =\n | {\n readonly valid: true;\n readonly contract: MfeContract;\n readonly issues: readonly [];\n }\n | {\n readonly valid: false;\n readonly issues: readonly MfeContractIssue[];\n };\n\nexport class MfeContractValidationError extends Error {\n readonly issues: readonly MfeContractIssue[];\n\n constructor(issuesOrMessage: readonly MfeContractIssue[] | string) {\n const issues = typeof issuesOrMessage === 'string' ? [] : issuesOrMessage;\n super(\n typeof issuesOrMessage === 'string'\n ? issuesOrMessage\n : `Invalid EDSIS MFE contract: ${issues\n .map((issue) => `${issue.path} ${issue.message}`)\n .join('; ')}`,\n );\n this.name = 'MfeContractValidationError';\n this.issues = issues;\n }\n}\n\n/** Keeps literal inference while rejecting an invalid contract during remote evaluation. */\nexport function defineMfe<const Contract extends MfeContractV1>(contract: Contract): Contract {\n assertMfeContract(contract);\n return contract;\n}\n\nexport function isMfeContract(value: unknown): value is MfeContract {\n return validateMfeContract(value).valid;\n}\n\nexport function assertMfeContract(value: unknown): asserts value is MfeContract {\n const result = validateMfeContract(value);\n\n if (!result.valid) {\n throw new MfeContractValidationError(result.issues);\n }\n}\n\n/**\n * Reads the exact named `mfe` export from an untrusted federation namespace.\n * Shape validation runs before registry identity and supported-major checks.\n */\nexport function readMfeContract(\n remoteModule: unknown,\n expectation: MfeContractExpectation,\n): MfeContractV1 {\n if (!isRecord(remoteModule) || !('mfe' in remoteModule)) {\n throw new MfeContractValidationError(\n 'The remote module does not export a named \"mfe\" contract.',\n );\n }\n\n const result = validateMfeContract(remoteModule['mfe']);\n\n if (!result.valid) {\n throw new MfeContractValidationError(result.issues);\n }\n\n const contract = result.contract;\n if (contract.id !== expectation.id) {\n throw new MfeContractValidationError(\n `Expected MFE id \"${expectation.id}\" but received \"${contract.id}\".`,\n );\n }\n\n if (!expectation.supportedContractVersions.includes(contract.contractVersion)) {\n throw new MfeContractValidationError(\n `MFE \"${expectation.id}\" uses unsupported contract version \"${contract.contractVersion}\".`,\n );\n }\n\n return contract;\n}\n\n/** Validates an untrusted remote value before the host reads routes or exposures from it. */\nexport function validateMfeContract(value: unknown): MfeContractValidationResult {\n if (!isRecord(value)) {\n return invalid([issue('invalid_contract', '$', 'must be a non-null object')]);\n }\n\n const issues: MfeContractIssue[] = [];\n validateContractIdentity(value, issues);\n validateRouteAndNavigationContributions(value, issues);\n const capabilityIds = validateCapabilities(value['capabilities'], issues);\n validateExposures(value['exposures'], capabilityIds, issues);\n\n if (issues.length > 0) {\n return invalid(issues);\n }\n\n return {\n valid: true,\n contract: value as unknown as MfeContract,\n issues: [],\n };\n}\n\nfunction validateContractIdentity(\n candidate: Record<string, unknown>,\n issues: MfeContractIssue[],\n): void {\n if (candidate['contractVersion'] !== MFE_CONTRACT_VERSION) {\n issues.push(\n issue(\n 'unsupported_version',\n '$.contractVersion',\n `must equal the supported major ${MFE_CONTRACT_VERSION}`,\n ),\n );\n }\n\n const id = candidate['id'];\n if (typeof id !== 'string' || !MFE_ID_PATTERN.test(id)) {\n issues.push(\n issue(\n 'invalid_id',\n '$.id',\n 'must be a lower-kebab identifier such as \"developer\" or \"sales-activity\"',\n ),\n );\n }\n\n if (!isNonEmptyString(candidate['displayName'])) {\n issues.push(issue('invalid_contract', '$.displayName', 'must be a non-empty string'));\n }\n}\n\nfunction validateRouteAndNavigationContributions(\n candidate: Record<string, unknown>,\n issues: MfeContractIssue[],\n): void {\n const routes = candidate['featureRoutes'];\n if (!Array.isArray(routes) || routes.length === 0) {\n issues.push(issue('invalid_routes', '$.featureRoutes', 'must be a non-empty route array'));\n } else {\n routes.forEach((route, index) => {\n if (!isRecord(route)) {\n issues.push(\n issue('invalid_routes', `$.featureRoutes[${index}]`, 'must be an Angular route object'),\n );\n }\n });\n }\n\n const navigation = candidate['navigation'];\n if (!Array.isArray(navigation)) {\n issues.push(issue('invalid_navigation', '$.navigation', 'must be an array'));\n } else {\n navigation.forEach((item, index) => {\n if (!isRecord(item)) {\n issues.push(\n issue('invalid_navigation', `$.navigation[${index}]`, 'must be a navigation item object'),\n );\n }\n });\n }\n}\n\nfunction validateCapabilities(value: unknown, issues: MfeContractIssue[]): ReadonlySet<string> {\n if (!Array.isArray(value)) {\n issues.push(issue('invalid_capability', '$.capabilities', 'must be an array'));\n return new Set<string>();\n }\n\n const capabilityIds = new Set<string>();\n\n value.forEach((capability, index) => {\n const path = `$.capabilities[${index}]`;\n if (!isRecord(capability)) {\n issues.push(issue('invalid_capability', path, 'must be a capability descriptor object'));\n return;\n }\n\n const id = capability['id'];\n if (typeof id !== 'string' || !MFE_CAPABILITY_ID_PATTERN.test(id)) {\n issues.push(\n issue(\n 'invalid_capability',\n `${path}.id`,\n 'must be a lowercase dotted, colon, or kebab capability identifier',\n ),\n );\n } else if (capabilityIds.has(id)) {\n issues.push(issue('duplicate_capability', `${path}.id`, `duplicates capability \"${id}\"`));\n } else {\n capabilityIds.add(id);\n }\n\n const version = capability['version'];\n if (!Number.isInteger(version) || (version as number) < 1) {\n issues.push(\n issue('invalid_capability', `${path}.version`, 'must be a positive integer major'),\n );\n }\n\n if (!includes(MFE_CAPABILITY_MODES, capability['mode'])) {\n issues.push(\n issue(\n 'invalid_capability',\n `${path}.mode`,\n `must be one of ${MFE_CAPABILITY_MODES.join(', ')}`,\n ),\n );\n }\n\n validateOptionalString(capability, 'description', path, 'invalid_capability', issues);\n });\n\n return capabilityIds;\n}\n\nfunction validateExposures(\n value: unknown,\n capabilityIds: ReadonlySet<string>,\n issues: MfeContractIssue[],\n): void {\n if (!Array.isArray(value)) {\n issues.push(issue('invalid_exposure', '$.exposures', 'must be an array'));\n return;\n }\n\n const exposureKeys = new Set<string>();\n let entryExposureCount = 0;\n\n value.forEach((exposure, index) => {\n const path = `$.exposures[${index}]`;\n if (!isRecord(exposure)) {\n issues.push(issue('invalid_exposure', path, 'must be an exposure descriptor object'));\n return;\n }\n\n const key = exposure['key'];\n if (typeof key !== 'string' || !MFE_EXPOSURE_KEY_PATTERN.test(key)) {\n issues.push(\n issue(\n 'invalid_exposure',\n `${path}.key`,\n 'must start with \"./\" and contain no empty or unsafe path segments',\n ),\n );\n } else if (exposureKeys.has(key)) {\n issues.push(issue('duplicate_exposure', `${path}.key`, `duplicates exposure \"${key}\"`));\n } else {\n exposureKeys.add(key);\n }\n\n if (!includes(MFE_EXPOSURE_KINDS, exposure['kind'])) {\n issues.push(\n issue(\n 'invalid_exposure',\n `${path}.kind`,\n `must be one of ${MFE_EXPOSURE_KINDS.join(', ')}`,\n ),\n );\n }\n\n if (key === MFE_ENTRY_EXPOSURE) {\n entryExposureCount += 1;\n if (exposure['kind'] !== 'contract') {\n issues.push(\n issue('invalid_exposure', `${path}.kind`, `must be \"contract\" for ${MFE_ENTRY_EXPOSURE}`),\n );\n }\n } else if (exposure['kind'] === 'contract') {\n issues.push(\n issue(\n 'invalid_exposure',\n `${path}.kind`,\n `the contract kind is reserved for ${MFE_ENTRY_EXPOSURE}`,\n ),\n );\n }\n\n if (exposure['since'] !== MFE_CONTRACT_VERSION) {\n issues.push(\n issue(\n 'invalid_exposure',\n `${path}.since`,\n `must equal contract major ${MFE_CONTRACT_VERSION}`,\n ),\n );\n }\n\n validateOptionalString(exposure, 'exportName', path, 'invalid_exposure', issues);\n validateOptionalString(exposure, 'description', path, 'invalid_exposure', issues);\n validateExposureCapabilities(exposure['capabilities'], path, capabilityIds, issues);\n });\n\n if (entryExposureCount === 0) {\n issues.push(\n issue(\n 'missing_entry_exposure',\n '$.exposures',\n `must declare the ${MFE_ENTRY_EXPOSURE} contract exposure`,\n ),\n );\n }\n}\n\nfunction validateExposureCapabilities(\n value: unknown,\n path: string,\n capabilityIds: ReadonlySet<string>,\n issues: MfeContractIssue[],\n): void {\n if (value === undefined) {\n return;\n }\n if (!Array.isArray(value)) {\n issues.push(issue('invalid_exposure', `${path}.capabilities`, 'must be an array'));\n return;\n }\n\n const referencedIds = new Set<string>();\n value.forEach((capabilityId, index) => {\n const capabilityPath = `${path}.capabilities[${index}]`;\n if (typeof capabilityId !== 'string' || !MFE_CAPABILITY_ID_PATTERN.test(capabilityId)) {\n issues.push(\n issue('invalid_exposure', capabilityPath, 'must be a valid capability identifier'),\n );\n return;\n }\n if (referencedIds.has(capabilityId)) {\n issues.push(\n issue('invalid_exposure', capabilityPath, `duplicates capability \"${capabilityId}\"`),\n );\n return;\n }\n referencedIds.add(capabilityId);\n\n if (!capabilityIds.has(capabilityId)) {\n issues.push(\n issue(\n 'unknown_capability',\n capabilityPath,\n `references undeclared capability \"${capabilityId}\"`,\n ),\n );\n }\n });\n}\n\nfunction validateOptionalString(\n candidate: Record<string, unknown>,\n key: string,\n path: string,\n code: MfeContractIssueCode,\n issues: MfeContractIssue[],\n): void {\n const value = candidate[key];\n if (value !== undefined && !isNonEmptyString(value)) {\n issues.push(issue(code, `${path}.${key}`, 'must be a non-empty string when provided'));\n }\n}\n\nfunction issue(code: MfeContractIssueCode, path: string, message: string): MfeContractIssue {\n return { code, path, message };\n}\n\nfunction invalid(issues: readonly MfeContractIssue[]): MfeContractValidationResult {\n return { valid: false, issues };\n}\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isNonEmptyString(value: unknown): value is string {\n return typeof value === 'string' && value.trim().length > 0;\n}\n\nfunction includes<const Values extends readonly string[]>(values: Values, value: unknown): boolean {\n return typeof value === 'string' && (values as readonly string[]).includes(value);\n}\n\nconst MFE_ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;\nconst MFE_EXPOSURE_KEY_PATTERN =\n /^\\.\\/[A-Za-z0-9][A-Za-z0-9._-]*(?:\\/[A-Za-z0-9][A-Za-z0-9._-]*)*$/u;\nconst MFE_CAPABILITY_ID_PATTERN = /^[a-z][a-z0-9]*(?:[.:-][a-z0-9]+(?:-[a-z0-9]+)*)*$/u;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names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AAM,EAAE;AACjC;AAEA,SAAS,QAAQ,CAAC,KAAc,EAAA;AAC9B,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;AAC7E;AAEA,SAAS,gBAAgB,CAAC,KAAc,EAAA;AACtC,IAAA,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC;AAC7D;AAEA,SAAS,QAAQ,CAAyC,MAAc,EAAE,KAAc,EAAA;IACtF,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAK,MAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC;AACnF;AAEA,MAAM,cAAc,GAAG,kCAAkC;AACzD,MAAM,wBAAwB,GAC5B,oEAAoE;AACtE,MAAM,yBAAyB,GAAG,qDAAqD;;AC5dvF;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@edsis/angular",
3
- "version": "22.0.91",
3
+ "version": "22.0.93",
4
4
  "peerDependencies": {
5
5
  "@angular/common": ">=22.0.0",
6
6
  "@angular/core": ">=22.0.0",
7
7
  "@angular/forms": ">=22.0.0",
8
8
  "@angular/router": ">=22.0.0",
9
9
  "@tauri-apps/api": ">=2.0.0",
10
- "@edsis/navigation": "^22.0.91",
11
- "@edsis/sdk": "^22.0.91",
12
- "@edsis/theme": "^22.0.91",
13
- "@edsis/component": "^22.0.91",
10
+ "@edsis/navigation": "^22.0.93",
11
+ "@edsis/sdk": "^22.0.93",
12
+ "@edsis/theme": "^22.0.93",
13
+ "@edsis/component": "^22.0.93",
14
14
  "rxjs": ">=7.8.0"
15
15
  },
16
16
  "peerDependenciesMeta": {
@@ -69,6 +69,10 @@
69
69
  "types": "./types/edsis-angular-module-auth.d.ts",
70
70
  "default": "./fesm2022/edsis-angular-module-auth.mjs"
71
71
  },
72
+ "./platform/mfe": {
73
+ "types": "./types/edsis-angular-platform-mfe.d.ts",
74
+ "default": "./fesm2022/edsis-angular-platform-mfe.mjs"
75
+ },
72
76
  "./services/runtime": {
73
77
  "types": "./types/edsis-angular-services-runtime.d.ts",
74
78
  "default": "./fesm2022/edsis-angular-services-runtime.mjs"
@@ -83,8 +83,12 @@ declare class AppPreferencesTriggerDirective {
83
83
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AppPreferencesTriggerDirective, "[appPreferencesTrigger]", never, {}, {}, never, never, true, never>;
84
84
  }
85
85
 
86
+ interface RuntimeThemeDeviceOptions {
87
+ /** Default true. Disable when a named application profile owns appearance. */
88
+ readonly appearanceFallback?: boolean;
89
+ }
86
90
  /** Registers immutable runtime fallbacks without replacing stored theme preferences. */
87
- declare function provideRuntimeThemeDevice(): EnvironmentProviders;
91
+ declare function provideRuntimeThemeDevice(options?: RuntimeThemeDeviceOptions): EnvironmentProviders;
88
92
 
89
93
  export { APP_PREFERENCES_CONFIG, AppPreferencesComponent, AppPreferencesPanelService, AppPreferencesTriggerDirective, provideAppPreferences, provideRuntimeThemeDevice };
90
- export type { AppPreferencesConfig, AppPreferencesDefaults };
94
+ export type { AppPreferencesConfig, AppPreferencesDefaults, RuntimeThemeDeviceOptions };
@@ -46,6 +46,9 @@ interface EdsisAuthMessages {
46
46
  readonly signInAria: string;
47
47
  /** Status di halaman login selama full-page redirect ke Google berlangsung. */
48
48
  readonly googleRedirecting: string;
49
+ readonly gatewayStartFailed: string;
50
+ readonly gatewayHandoffInProgress: string;
51
+ readonly gatewaySessionMissing: string;
49
52
  readonly nativeSignInInProgress: string;
50
53
  readonly nativeSignInUnavailable: string;
51
54
  readonly nativeSignInFailed: string;
@@ -94,6 +97,8 @@ type EdsisAuthMessagesOverride = {
94
97
  declare const EDSIS_AUTH_MESSAGES: InjectionToken<EdsisAuthMessages>;
95
98
  declare function mergeEdsisAuthMessages(override?: EdsisAuthMessagesOverride): EdsisAuthMessages;
96
99
 
100
+ declare const GOOGLE_AUTH_GATEWAY_DEFAULT_START_ENDPOINT: "/v1/auth/google/start";
101
+ declare const GOOGLE_AUTH_GATEWAY_DEFAULT_HANDOFF_ENDPOINT: "/v1/auth/google/handoff";
97
102
  /**
98
103
  * Path route callback Google di dalam `authRoutes`; juga menjadi sumber
99
104
  * derivasi `redirectUri` (`${appUrl}/auth/google/callback`), sehingga URL yang
@@ -114,10 +119,12 @@ interface EdsisAuthHealthCheckConfig {
114
119
  }
115
120
  /**
116
121
  * Google Sign-In dengan authorization-code flow. Exchange code dilakukan
117
- * backend (`POST {apiUrl}/auth/google`) sehingga client secret tidak pernah
122
+ * backend (`POST {apiUrl}/v1/auth/google`) sehingga client secret tidak pernah
118
123
  * menyentuh frontend.
119
124
  */
120
- interface EdsisAuthGoogleOauthConfig {
125
+ interface EdsisAuthGoogleDirectOauthConfig {
126
+ /** Optional for backward compatibility; omitting it selects direct mode. */
127
+ mode?: 'direct';
121
128
  /**
122
129
  * OAuth 2.0 client ID dari Google Cloud Console. String kosong dianggap
123
130
  * tidak dikonfigurasi (tombol Google tetap placeholder), sehingga aman
@@ -125,6 +132,30 @@ interface EdsisAuthGoogleOauthConfig {
125
132
  */
126
133
  clientId: string;
127
134
  }
135
+ interface EdsisAuthGoogleGatewayEndpointsConfig {
136
+ /**
137
+ * Base URL Auth Gateway. Default `apiUrl`; jika diisi, origin-nya wajib
138
+ * sama dengan `apiUrl` agar seluruh cookie/session auth tetap satu origin.
139
+ */
140
+ baseUrl?: string;
141
+ /** Default `/v1/auth/google/start`; harus path relatif terhadap `baseUrl`. */
142
+ startEndpoint?: string;
143
+ /** Default `/v1/auth/google/handoff`; harus path relatif terhadap `baseUrl`. */
144
+ handoffEndpoint?: string;
145
+ }
146
+ /**
147
+ * Google Sign-In terpusat untuk MFE. Gateway memiliki konfigurasi Google dan
148
+ * refresh cookie; MFE hanya memiliki ID allowlist dan PKCE verifier sekali pakai.
149
+ */
150
+ interface EdsisAuthGoogleGatewayOauthConfig {
151
+ mode: 'gateway';
152
+ /** ID lower-kebab-case yang terdaftar bersama return URL pada Auth Gateway. */
153
+ mfeId: string;
154
+ /** Optional jika Gateway memakai base URL dan endpoint auth standar dari `apiUrl`. */
155
+ gateway?: EdsisAuthGoogleGatewayEndpointsConfig;
156
+ }
157
+ /** `{ clientId }` lama tetap memilih direct mode tanpa perubahan konsumer. */
158
+ type EdsisAuthGoogleOauthConfig = EdsisAuthGoogleDirectOauthConfig | EdsisAuthGoogleGatewayOauthConfig;
128
159
  interface EdsisAuthNativeGoogleConfig {
129
160
  /** Default `true` saat blok konfigurasi ini diberikan. */
130
161
  enabled?: boolean;
@@ -152,9 +183,9 @@ interface EdsisAuthConfig {
152
183
  httpInterceptors?: readonly HttpInterceptorFn[];
153
184
  healthCheck?: EdsisAuthHealthCheckConfig;
154
185
  /**
155
- * Provider OAuth di halaman login (saat ini hanya Google). `redirectUri`
156
- * tidak dikonfigurasi konsumer; library menurunkannya dari `appUrl`:
157
- * `${appUrl}/auth/google/callback`.
186
+ * Provider OAuth di halaman login (saat ini hanya Google). Callback direct
187
+ * maupun Gateway tidak dikonfigurasi konsumer; library menurunkannya dari
188
+ * `appUrl` sebagai `${appUrl}/auth/google/callback`.
158
189
  */
159
190
  oauth?: EdsisAuthOauthConfig;
160
191
  }
@@ -163,11 +194,24 @@ interface ResolvedEdsisAuthHealthCheck {
163
194
  url: string;
164
195
  timeoutMs: number;
165
196
  }
166
- interface ResolvedEdsisAuthGoogleOauth {
197
+ interface ResolvedEdsisAuthGoogleDirectOauth {
198
+ mode: 'direct';
167
199
  clientId: string;
168
200
  /** Diturunkan dari `appUrl`: `${appUrl}/auth/google/callback`. */
169
201
  redirectUri: string;
170
202
  }
203
+ interface ResolvedEdsisAuthGoogleGatewayOauth {
204
+ mode: 'gateway';
205
+ mfeId: string;
206
+ /** Callback MFE exact yang didaftarkan pada allowlist Gateway. */
207
+ returnUrl: string;
208
+ gateway: {
209
+ baseUrl: string;
210
+ startUrl: string;
211
+ handoffUrl: string;
212
+ };
213
+ }
214
+ type ResolvedEdsisAuthGoogleOauth = ResolvedEdsisAuthGoogleDirectOauth | ResolvedEdsisAuthGoogleGatewayOauth;
171
215
  interface ResolvedEdsisAuthOauth {
172
216
  /** `null` saat Google Sign-In tidak dikonfigurasi (perilaku placeholder lama). */
173
217
  google: ResolvedEdsisAuthGoogleOauth | null;
@@ -278,6 +322,47 @@ declare class NativeGoogleAuthService {
278
322
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<NativeGoogleAuthService>;
279
323
  }
280
324
 
325
+ declare const GOOGLE_GATEWAY_SESSION_STORAGE_KEY = "auth-google-gateway-session";
326
+ declare const GOOGLE_GATEWAY_SESSION_VERSION: 1;
327
+ interface GoogleGatewaySession {
328
+ readonly version: typeof GOOGLE_GATEWAY_SESSION_VERSION;
329
+ readonly mfeId: string;
330
+ readonly returnUrl: string;
331
+ readonly codeVerifier: string;
332
+ readonly expiresAt: number;
333
+ }
334
+ interface GoogleGatewaySessionExpectation {
335
+ readonly mfeId: string;
336
+ readonly returnUrl: string;
337
+ readonly now?: number;
338
+ }
339
+ /** RFC 7636 verifier with 256 bits of entropy and no persisted token material. */
340
+ declare function createGooglePkceVerifier(windowRef: Window): string;
341
+ /** RFC 7636 S256 challenge for the verifier retained in the one-time session. */
342
+ declare function createGooglePkceChallenge(windowRef: Window, codeVerifier: string): Promise<string>;
343
+ /** Stores only the verifier and short-lived correlation metadata. */
344
+ declare function storeGoogleGatewaySession(documentRef: Document, session: GoogleGatewaySession): void;
345
+ declare function clearGoogleGatewaySession(documentRef: Document): void;
346
+ /**
347
+ * Consumes the PKCE session exactly once. Malformed, expired, or cross-MFE
348
+ * records fail closed after removal so they cannot be replayed.
349
+ */
350
+ declare function consumeGoogleGatewaySession(documentRef: Document, expected: GoogleGatewaySessionExpectation): GoogleGatewaySession | null;
351
+
352
+ /** HTTP client for the central Google Auth Gateway mode. */
353
+ declare class GoogleGatewayAuthService {
354
+ private readonly config;
355
+ private readonly documentRef;
356
+ private readonly http;
357
+ start(): Promise<string>;
358
+ consumeSession(): GoogleGatewaySession | null;
359
+ exchangeHandoff(handoffCode: string, session: GoogleGatewaySession): Promise<unknown>;
360
+ private requireGatewayConfig;
361
+ private requireWindow;
362
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GoogleGatewayAuthService, never>;
363
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<GoogleGatewayAuthService>;
364
+ }
365
+
281
366
  declare const GOOGLE_OAUTH_STATE_STORAGE_KEY = "auth-google-state";
282
367
  declare const GOOGLE_OAUTH_AUTHORIZE_URL = "https://accounts.google.com/o/oauth2/v2/auth";
283
368
  interface GoogleAuthorizeUrlOptions {
@@ -319,6 +404,7 @@ declare class AuthGoogleCallbackPage {
319
404
  private readonly authSessionService;
320
405
  private readonly authService;
321
406
  private readonly authConfig;
407
+ private readonly googleGateway;
322
408
  protected readonly messages: _edsis_angular_module_auth.EdsisAuthMessages;
323
409
  protected readonly loginPath: `/${string}`;
324
410
  protected readonly authenticatedHomePath: `/${string}`;
@@ -328,7 +414,10 @@ declare class AuthGoogleCallbackPage {
328
414
  constructor();
329
415
  private handleCallback;
330
416
  private clearCallbackParamsFromAddressBar;
331
- private exchange;
417
+ private exchangeDirectCode;
418
+ private exchangeGatewayHandoff;
419
+ private complete;
420
+ private callbackErrorMessage;
332
421
  private fail;
333
422
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<AuthGoogleCallbackPage, never>;
334
423
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuthGoogleCallbackPage, "AuthGoogleCallbackPage", never, {}, {}, never, never, true, never>;
@@ -361,6 +450,7 @@ declare class AuthLoginPage {
361
450
  private readonly injector;
362
451
  private readonly authMagicLinkService;
363
452
  private readonly authConfig;
453
+ private readonly googleGateway;
364
454
  private readonly nativeGoogle;
365
455
  private readonly router;
366
456
  protected readonly messages: _edsis_angular_module_auth.EdsisAuthMessages;
@@ -393,6 +483,7 @@ declare class AuthLoginPage {
393
483
  protected readonly emailFieldClasses: _angular_core.Signal<"flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base!" | "flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base! border-destructive focus-within:border-destructive focus-within:ring-destructive/20" | "flex-nowrap bg-background/70 shadow-sm [&>[data-slot=input-group-control]]:h-12! [&>[data-slot=input-group-control]]:px-4! [&>[data-slot=input-group-control]]:text-base! border-emerald-500 focus-within:border-emerald-500 focus-within:ring-emerald-500/20">;
394
484
  protected retryHealth(): void;
395
485
  protected signInWithGoogle(): void;
486
+ private signInWithGatewayGoogle;
396
487
  private signInWithNativeGoogle;
397
488
  protected redirectTo(url: string): void;
398
489
  protected submit(): Promise<void>;
@@ -441,5 +532,5 @@ declare class AuthVerifyPage {
441
532
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AuthVerifyPage, "edsis-auth-verify-page", never, { "token": { "alias": "token"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
442
533
  }
443
534
 
444
- export { AuthGoogleCallbackPage, AuthLoginPage, AuthLogoutPage, AuthService, AuthShellPage, AuthVerifyPage, DEFAULT_EDSIS_AUTH_MESSAGES, EDSIS_AUTH_CONFIG, EDSIS_AUTH_MESSAGES, EDSIS_NATIVE_GOOGLE_AUTH_ADAPTER, EDSIS_SKIP_AUTH, GOOGLE_OAUTH_AUTHORIZE_URL, GOOGLE_OAUTH_CALLBACK_ROUTE_PATH, GOOGLE_OAUTH_STATE_STORAGE_KEY, NativeGoogleAuthService, TauriNativeGoogleAuthAdapter, authRoutes, authenticatedGuard, buildGoogleAuthorizeUrl, consumeGoogleOauthState, createGoogleOauthState, edsisAuthInterceptor, guestOnlyGuard, homeRedirectGuard, isNativeGoogleSignInResult, mergeEdsisAuthMessages, provideEdsisAuth, resolveEdsisAuthConfig, setAuthNotificationBadge, storeGoogleOauthState };
445
- export type { AuthUser, EdsisAuthConfig, EdsisAuthGoogleOauthConfig, EdsisAuthHealthCheckConfig, EdsisAuthMessages, EdsisAuthMessagesOverride, EdsisAuthNativeGoogleConfig, EdsisAuthOauthConfig, EdsisNativeGoogleAuthAdapter, GoogleAuthorizeUrlOptions, NativeGooglePlatform, NativeGoogleSignInResult, ResolvedEdsisAuthConfig, ResolvedEdsisAuthGoogleOauth, ResolvedEdsisAuthHealthCheck, ResolvedEdsisAuthOauth };
535
+ export { AuthGoogleCallbackPage, AuthLoginPage, AuthLogoutPage, AuthService, AuthShellPage, AuthVerifyPage, DEFAULT_EDSIS_AUTH_MESSAGES, EDSIS_AUTH_CONFIG, EDSIS_AUTH_MESSAGES, EDSIS_NATIVE_GOOGLE_AUTH_ADAPTER, EDSIS_SKIP_AUTH, GOOGLE_AUTH_GATEWAY_DEFAULT_HANDOFF_ENDPOINT, GOOGLE_AUTH_GATEWAY_DEFAULT_START_ENDPOINT, GOOGLE_GATEWAY_SESSION_STORAGE_KEY, GOOGLE_GATEWAY_SESSION_VERSION, GOOGLE_OAUTH_AUTHORIZE_URL, GOOGLE_OAUTH_CALLBACK_ROUTE_PATH, GOOGLE_OAUTH_STATE_STORAGE_KEY, GoogleGatewayAuthService, NativeGoogleAuthService, TauriNativeGoogleAuthAdapter, authRoutes, authenticatedGuard, buildGoogleAuthorizeUrl, clearGoogleGatewaySession, consumeGoogleGatewaySession, consumeGoogleOauthState, createGoogleOauthState, createGooglePkceChallenge, createGooglePkceVerifier, edsisAuthInterceptor, guestOnlyGuard, homeRedirectGuard, isNativeGoogleSignInResult, mergeEdsisAuthMessages, provideEdsisAuth, resolveEdsisAuthConfig, setAuthNotificationBadge, storeGoogleGatewaySession, storeGoogleOauthState };
536
+ export type { AuthUser, EdsisAuthConfig, EdsisAuthGoogleDirectOauthConfig, EdsisAuthGoogleGatewayEndpointsConfig, EdsisAuthGoogleGatewayOauthConfig, EdsisAuthGoogleOauthConfig, EdsisAuthHealthCheckConfig, EdsisAuthMessages, EdsisAuthMessagesOverride, EdsisAuthNativeGoogleConfig, EdsisAuthOauthConfig, EdsisNativeGoogleAuthAdapter, GoogleAuthorizeUrlOptions, GoogleGatewaySession, GoogleGatewaySessionExpectation, NativeGooglePlatform, NativeGoogleSignInResult, ResolvedEdsisAuthConfig, ResolvedEdsisAuthGoogleDirectOauth, ResolvedEdsisAuthGoogleGatewayOauth, ResolvedEdsisAuthGoogleOauth, ResolvedEdsisAuthHealthCheck, ResolvedEdsisAuthOauth };