dinocollab-core 2.0.2 → 2.0.4
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/dist/api-context.d.ts +2 -0
- package/dist/api-context.js +2 -0
- package/dist/api-context.mjs +2 -0
- package/dist/components.d.ts +2 -0
- package/dist/components.js +2 -0
- package/dist/components.mjs +2 -0
- package/dist/data-view.d.ts +2 -0
- package/dist/data-view.js +2 -0
- package/dist/data-view.mjs +2 -0
- package/dist/form.d.ts +2 -0
- package/dist/form.js +2 -0
- package/dist/form.mjs +2 -0
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +2 -0
- package/dist/hooks.mjs +2 -0
- package/dist/http-service.d.ts +2 -0
- package/dist/http-service.js +2 -0
- package/dist/http-service.mjs +2 -0
- package/dist/mfe-shared/auth.js +2 -0
- package/dist/mfe-shared/auth.js.map +1 -0
- package/dist/mfe-shared/auth.ssr.js +2 -0
- package/dist/mfe-shared/auth.ssr.js.map +1 -0
- package/dist/mfe-shared/auth.types.js +2 -0
- package/dist/mfe-shared/auth.types.js.map +1 -0
- package/dist/mfe-shared/cart.js +2 -0
- package/dist/mfe-shared/cart.js.map +1 -0
- package/dist/mfe-shared/cart.ssr.js +2 -0
- package/dist/mfe-shared/cart.ssr.js.map +1 -0
- package/dist/mfe-shared/environment.js +2 -0
- package/dist/mfe-shared/environment.js.map +1 -0
- package/dist/mfe-shared/hydration-helper.js +2 -0
- package/dist/mfe-shared/hydration-helper.js.map +1 -0
- package/dist/mfe-shared/index.js +2 -0
- package/dist/mfe-shared/mfe-bridge.js +2 -0
- package/dist/mfe-shared/mfe-bridge.js.map +1 -0
- package/dist/mfe-shared/navigation.js +2 -0
- package/dist/mfe-shared/navigation.js.map +1 -0
- package/dist/mfe-shared.d.ts +2 -0
- package/dist/mfe-shared.js +2 -0
- package/dist/mfe-shared.mjs +2 -0
- package/dist/redux.d.ts +2 -0
- package/dist/redux.js +2 -0
- package/dist/redux.mjs +2 -0
- package/dist/table-grid.d.ts +2 -0
- package/dist/table-grid.js +2 -0
- package/dist/table-grid.mjs +2 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.js +2 -0
- package/dist/table.mjs +2 -0
- package/dist/types/mfe-shared/auth.d.ts +50 -0
- package/dist/types/mfe-shared/auth.ssr.d.ts +53 -0
- package/dist/types/mfe-shared/auth.types.d.ts +53 -0
- package/dist/types/mfe-shared/cart.d.ts +59 -0
- package/dist/types/mfe-shared/cart.debug.d.ts +8 -0
- package/dist/types/mfe-shared/cart.ssr.d.ts +39 -0
- package/dist/types/mfe-shared/environment.d.ts +18 -0
- package/dist/types/mfe-shared/hydration-helper.d.ts +46 -0
- package/dist/types/mfe-shared/index.d.ts +23 -0
- package/dist/types/mfe-shared/mfe-bridge.d.ts +46 -0
- package/dist/types/mfe-shared/navigation.d.ts +31 -0
- package/dist/types/mfe-shared/types.d.ts +11 -0
- package/dist/utils.d.ts +2 -0
- package/dist/utils.js +2 -0
- package/dist/utils.mjs +2 -0
- package/package.json +94 -33
- package/dist/mfe-auth/auth-enums.js +0 -2
- package/dist/mfe-auth/auth-enums.js.map +0 -1
- package/dist/mfe-auth/auth-mfe-manager.js +0 -2
- package/dist/mfe-auth/auth-mfe-manager.js.map +0 -1
- package/dist/mfe-auth/auth-mfe-provider.js +0 -2
- package/dist/mfe-auth/auth-mfe-provider.js.map +0 -1
- package/dist/mfe-auth/auth-types.js +0 -2
- package/dist/mfe-auth/auth-types.js.map +0 -1
- package/dist/mfe-auth/index.js +0 -2
- package/dist/mfe-auth/micro-frontend-auth-hooks.js +0 -2
- package/dist/mfe-auth/micro-frontend-auth-hooks.js.map +0 -1
- package/dist/mfe-navigate/index.js +0 -2
- package/dist/mfe-navigate/index.js.map +0 -1
- package/dist/mfe-navigate/mfe-navigate.debug.js +0 -2
- package/dist/mfe-navigate/mfe-navigate.debug.js.map +0 -1
- package/dist/mfe-navigate/mfe-navigate.remote.js +0 -2
- package/dist/mfe-navigate/mfe-navigate.remote.js.map +0 -1
- package/dist/mfe-navigate/nextjs/index.js +0 -2
- package/dist/mfe-navigate/nextjs/index.js.map +0 -1
- package/dist/mfe-navigate/nextjs/provider.js +0 -2
- package/dist/mfe-navigate/nextjs/provider.js.map +0 -1
- package/dist/mfe-navigate/react/index.js +0 -2
- package/dist/mfe-navigate/react/index.js.map +0 -1
- package/dist/mfe-navigate/react/provider.js +0 -2
- package/dist/mfe-navigate/react/provider.js.map +0 -1
- package/dist/types/mfe-auth/auth-enums.d.ts +0 -40
- package/dist/types/mfe-auth/auth-mfe-manager.d.ts +0 -68
- package/dist/types/mfe-auth/auth-mfe-provider.d.ts +0 -19
- package/dist/types/mfe-auth/auth-types.d.ts +0 -33
- package/dist/types/mfe-auth/index.d.ts +0 -6
- package/dist/types/mfe-auth/micro-frontend-auth-hooks.d.ts +0 -164
- package/dist/types/mfe-navigate/index.d.ts +0 -2
- package/dist/types/mfe-navigate/mfe-navigate.remote.d.ts +0 -11
- package/dist/types/mfe-navigate/nextjs/index.d.ts +0 -1
- package/dist/types/mfe-navigate/nextjs/provider.d.ts +0 -2
- package/dist/types/mfe-navigate/react/index.d.ts +0 -1
- package/dist/types/mfe-navigate/react/provider.d.ts +0 -3
- package/dist/types/mfe-navigate/types.d.ts +0 -13
- /package/dist/{mfe-auth → mfe-shared}/index.js.map +0 -0
- /package/dist/types/{mfe-navigate/mfe-navigate.debug.d.ts → mfe-shared/navigation.debug.d.ts} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-navigate.debug.js","sources":["../../src/mfe-navigate/mfe-navigate.debug.tsx"],"sourcesContent":["import { useEffect, useState } from 'react'\r\nimport type { FC } from 'react'\r\nimport type { MfeNavigate } from './types'\r\n\r\nconst MAX_EVENTS = 10\r\n\r\nexport const MfeNavigateDebugPanel: FC<{ style?: React.CSSProperties }> = ({ style }) => {\r\n const [debugEvents, setDebugEvents] = useState<MfeNavigate[]>([])\r\n\r\n useEffect(() => {\r\n const handleNavigate = (e: CustomEvent) => {\r\n const { primaryHref, secondaryHref, internal, options } = e.detail as MfeNavigate\r\n setDebugEvents((events) => [{ primaryHref, secondaryHref, internal, options }, ...events.slice(0, MAX_EVENTS - 1)])\r\n }\r\n globalThis.addEventListener('mfe:navigate', handleNavigate as EventListener)\r\n return () => globalThis.removeEventListener('mfe:navigate', handleNavigate as EventListener)\r\n }, [])\r\n\r\n return (\r\n <div\r\n style={{\r\n position: 'fixed',\r\n background: 'rgba(0,0,0,0.8)',\r\n color: '#fff',\r\n padding: 12,\r\n borderRadius: 8,\r\n fontSize: 12,\r\n zIndex: 9999,\r\n maxWidth: 320,\r\n maxHeight: 240,\r\n overflowY: 'auto',\r\n boxShadow: '0 2px 8px rgba(0,0,0,0.2)',\r\n ...(style ?? { bottom: 16, left: 16 })\r\n }}\r\n >\r\n <div style={{ fontWeight: 'bold', marginBottom: 8 }}>MFE Navigate Debug</div>\r\n {debugEvents.length === 0 ? (\r\n <div style={{ opacity: 0.7 }}>No navigation events</div>\r\n ) : (\r\n <ul style={{ margin: 0, padding: 0, listStyle: 'none' }}>\r\n {debugEvents.map((ev, idx) => (\r\n <li key={idx} style={{ marginBottom: 4 }}>\r\n <span style={{ color: '#90ee90' }}>{ev.primaryHref}</span>\r\n {ev.secondaryHref && <span style={{ color: '#ffa500', marginLeft: 8 }}>→ {ev.secondaryHref}</span>}\r\n {ev.internal && <span style={{ color: '#87ceeb', marginLeft: 8 }}>[internal]</span>}\r\n {ev.options?.target && <span style={{ color: '#ffb6c1', marginLeft: 8 }}>({ev.options.target})</span>}\r\n </li>\r\n ))}\r\n </ul>\r\n )}\r\n </div>\r\n )\r\n}\r\n"],"names":["MfeNavigateDebugPanel","_ref","style","_useState","useState","_useState2","_slicedToArray","debugEvents","setDebugEvents","useEffect","handleNavigate","e","_e$detail","detail","primaryHref","secondaryHref","internal","options","events","concat","_toConsumableArray","slice","MAX_EVENTS","globalThis","addEventListener","removeEventListener","_jsxs","_objectSpread","position","background","color","padding","borderRadius","fontSize","zIndex","maxWidth","maxHeight","overflowY","boxShadow","bottom","left","children","_jsx","fontWeight","marginBottom","length","opacity","margin","listStyle","map","ev","idx","_ev$options","marginLeft","target"],"mappings":"qNAIA,IAEaA,EAA6D,SAAxCC,GAAsD,IAAXC,EAAKD,EAALC,MAC3EC,EAAsCC,EAAwB,IAAGC,EAAAC,EAAAH,EAAA,GAA1DI,EAAWF,EAAA,GAAEG,EAAcH,EAAA,GAWlC,OATAI,GAAU,WACR,IAAMC,EAAiB,SAACC,GACtB,IAAAC,EAA0DD,EAAEE,OAApDC,EAAWF,EAAXE,YAAaC,EAAaH,EAAbG,cAAeC,EAAQJ,EAARI,SAAUC,EAAOL,EAAPK,QAC9CT,GAAe,SAACU,GAAM,MAAM,CAAA,CAAEJ,YAAAA,EAAaC,cAAAA,EAAeC,SAAAA,EAAUC,QAAAA,IAASE,OAAAC,EAAKF,EAAOG,MAAM,EAAGC,IAAe,GAClH,EAED,OADAC,WAAWC,iBAAiB,eAAgBd,GACrC,WAAA,OAAMa,WAAWE,oBAAoB,eAAgBf,EAAgC,CAC7F,GAAE,IAGDgB,EACE,MAAA,CAAAxB,MAAKyB,EAAA,CACHC,SAAU,QACVC,WAAY,kBACZC,MAAO,OACPC,QAAS,GACTC,aAAc,EACdC,SAAU,GACVC,OAAQ,KACRC,SAAU,IACVC,UAAW,IACXC,UAAW,OACXC,UAAW,6BACPpC,QAAAA,EAAS,CAAEqC,OAAQ,GAAIC,KAAM,KAClCC,SAAA,CAEDC,SAAKxC,MAAO,CAAEyC,WAAY,OAAQC,aAAc,GAAGH,SAAA,uBAC3B,IAAvBlC,EAAYsC,OACXH,EAAK,MAAA,CAAAxC,MAAO,CAAE4C,QAAS,IAAiCL,SAAA,yBAExDC,EAAI,KAAA,CAAAxC,MAAO,CAAE6C,OAAQ,EAAGhB,QAAS,EAAGiB,UAAW,QAAQP,SACpDlC,EAAY0C,KAAI,SAACC,EAAIC,GAAG,IAAAC,EAAA,OACvB1B,EAAA,KAAA,CAAcxB,MAAO,CAAE0C,aAAc,GAAGH,SAAA,CACtCC,UAAMxC,MAAO,CAAE4B,MAAO,oBAAcoB,EAAGpC,cACtCoC,EAAGnC,eAAiBW,UAAMxB,MAAO,CAAE4B,MAAO,UAAWuB,WAAY,GAAQZ,SAAA,CAAA,KAAAS,EAAGnC,iBAC5EmC,EAAGlC,UAAY0B,EAAM,OAAA,CAAAxC,MAAO,CAAE4B,MAAO,UAAWuB,WAAY,GAAGZ,SAAA,gBACrD,QAAVW,EAAAF,EAAGjC,eAAO,IAAAmC,OAAA,EAAVA,EAAYE,SAAU5B,UAAMxB,MAAO,CAAE4B,MAAO,UAAWuB,WAAY,GAAOZ,SAAA,CAAA,IAAAS,EAAGjC,QAAQqC,OAAM,SAJrFH,EAMV,QAKX"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{objectWithoutProperties as e,objectSpread2 as r}from"../_virtual/_rollupPluginBabelHelpers.js";import{jsx as n}from"react/jsx-runtime";var t=["internal","primaryHref","secondaryHref","onClick"],a=function(){return{navigate:function(e){globalThis.dispatchEvent(new CustomEvent("mfe:navigate",{detail:e}))}}},i=function(i){var o=i.internal,f=i.primaryHref,l=i.secondaryHref,u=i.onClick,c=e(i,t),p=a().navigate;return n("a",r(r({},c),{},{href:f,onClick:function(e){if(u&&u(e),!e.defaultPrevented)return o&&l?(e.preventDefault(),void p({primaryHref:f,secondaryHref:l,internal:o})):void 0}}))};export{i as MfeLink,a as useMfeNavigate};
|
|
2
|
-
//# sourceMappingURL=mfe-navigate.remote.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mfe-navigate.remote.js","sources":["../../src/mfe-navigate/mfe-navigate.remote.tsx"],"sourcesContent":["import type { AnchorHTMLAttributes, FC } from 'react'\r\nimport type { MfeNavigate } from './types'\r\n\r\nexport const useMfeNavigate = () => {\r\n const navigate = (params: MfeNavigate) => {\r\n globalThis.dispatchEvent(new CustomEvent('mfe:navigate', { detail: params }))\r\n }\r\n return { navigate }\r\n}\r\n\r\nexport interface IMfeLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {\r\n internal?: boolean\r\n primaryHref: string\r\n secondaryHref?: string\r\n}\r\n\r\nexport const MfeLink: FC<IMfeLinkProps> = (props) => {\r\n const { internal, primaryHref, secondaryHref, onClick, ...rest } = props\r\n const { navigate } = useMfeNavigate()\r\n\r\n const handleClick = (e: React.MouseEvent<HTMLAnchorElement>) => {\r\n if (onClick) onClick(e)\r\n if (e.defaultPrevented) return\r\n if (internal && secondaryHref) {\r\n e.preventDefault()\r\n navigate({ primaryHref, secondaryHref, internal })\r\n return\r\n }\r\n // If not internal or no secondaryHref, let the anchor tag handle it\r\n }\r\n\r\n return <a {...rest} href={primaryHref} onClick={handleClick} />\r\n}\r\n"],"names":["useMfeNavigate","navigate","params","globalThis","dispatchEvent","CustomEvent","detail","MfeLink","props","internal","primaryHref","secondaryHref","onClick","rest","_objectWithoutProperties","_excluded","_jsx","_objectSpread","href","e","defaultPrevented","preventDefault"],"mappings":"yMAGaA,EAAiB,WAI5B,MAAO,CAAEC,SAHQ,SAACC,GAChBC,WAAWC,cAAc,IAAIC,YAAY,eAAgB,CAAEC,OAAQJ,IACpE,EAEH,EAQaK,EAA6B,SAACC,GACzC,IAAQC,EAA2DD,EAA3DC,SAAUC,EAAiDF,EAAjDE,YAAaC,EAAoCH,EAApCG,cAAeC,EAAqBJ,EAArBI,QAAYC,EAAIC,EAAKN,EAAKO,GAChEd,EAAaD,IAAbC,SAaR,OAAOe,EAAA,IAAAC,EAAAA,KAAOJ,GAAI,GAAA,CAAEK,KAAMR,EAAaE,QAXnB,SAACO,GAEnB,GADIP,GAASA,EAAQO,IACjBA,EAAEC,iBACN,OAAIX,GAAYE,GACdQ,EAAEE,sBACFpB,EAAS,CAAES,YAAAA,EAAaC,cAAAA,EAAeF,SAAAA,UAFzC,CAMD,IAGH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sources":["../../../src/mfe-navigate/nextjs/provider.tsx"],"sourcesContent":["import { FC } from 'react'\r\n\r\nexport const MfeNavigateNextProvider: FC = () => {\r\n return <>Next Provider</>\r\n}\r\n"],"names":["MfeNavigateNextProvider","_jsx"],"mappings":"0DAEaA,EAA8B,WACzC,OAAOC,+BACT"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,Fragment as r}from"react/jsx-runtime";import{useEffect as a}from"react";var n=function(){var n=function(){try{return require("react-router-dom").useNavigate()}catch(e){return console.warn("react-router-dom not available, using fallback"),function(){console.warn("Navigate function is not available. Please ensure react-router-dom is installed.")}}}();return a((function(){var e=function(e){var r=e.detail,a=r.primaryHref,t=r.secondaryHref,o=r.options;if(a){var i=t||a||"/";"_blank"!==(null==o?void 0:o.target)?n(i,o):globalThis.open("".concat(i),"_blank")}};return globalThis.addEventListener("mfe:navigate",e),function(){return globalThis.removeEventListener("mfe:navigate",e)}}),[n]),e(r,{})};export{n as MfeNavigateReactProvider};
|
|
2
|
-
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sources":["../../../src/mfe-navigate/react/provider.tsx"],"sourcesContent":["import { useEffect } from 'react'\r\nimport type { FC } from 'react'\r\nimport type { MfeNavigate } from '../types'\r\n\r\n// Define types to avoid direct imports\r\nexport type NavigateFunction = (path: string, options?: any) => void\r\n\r\n// Use hook-style functions that don't directly import from react-router-dom\r\nfunction useReactNavigate(): NavigateFunction {\r\n try {\r\n // @ts-ignore - Ignore TS errors during build time\r\n return require('react-router-dom').useNavigate()\r\n } catch (error) {\r\n console.warn('react-router-dom not available, using fallback')\r\n // Provide fallback implementation\r\n return () => {\r\n console.warn('Navigate function is not available. Please ensure react-router-dom is installed.')\r\n }\r\n }\r\n}\r\n\r\nexport const MfeNavigateReactProvider: FC = () => {\r\n const navigate = useReactNavigate()\r\n\r\n useEffect(() => {\r\n const handleNavigate = (e: CustomEvent) => {\r\n const { primaryHref, secondaryHref, options } = e.detail as MfeNavigate\r\n if (!primaryHref) return\r\n // Navigate to secondaryHref if available, otherwise fallback to primaryHref\r\n const url = secondaryHref || primaryHref || '/'\r\n if (options?.target === '_blank') {\r\n globalThis.open(`${url}`, '_blank')\r\n return\r\n }\r\n navigate(url, options)\r\n }\r\n globalThis.addEventListener('mfe:navigate', handleNavigate as EventListener)\r\n return () => globalThis.removeEventListener('mfe:navigate', handleNavigate as EventListener)\r\n }, [navigate])\r\n return <></>\r\n}\r\n"],"names":["MfeNavigateReactProvider","navigate","require","useNavigate","error","console","warn","useReactNavigate","useEffect","handleNavigate","e","_e$detail","detail","primaryHref","secondaryHref","options","url","target","globalThis","open","concat","addEventListener","removeEventListener","_jsx"],"mappings":"4FAqBaA,EAA+B,WAC1C,IAAMC,EAdR,WACE,IAEE,OAAOC,QAAQ,oBAAoBC,aACpC,CAAC,MAAOC,GAGP,OAFAC,QAAQC,KAAK,kDAEN,WACLD,QAAQC,KAAK,mFACd,CACF,CACH,CAGmBC,GAiBjB,OAfAC,GAAU,WACR,IAAMC,EAAiB,SAACC,GACtB,IAAAC,EAAgDD,EAAEE,OAA1CC,EAAWF,EAAXE,YAAaC,EAAaH,EAAbG,cAAeC,EAAOJ,EAAPI,QACpC,GAAKF,EAAL,CAEA,IAAMG,EAAMF,GAAiBD,GAAe,IACpB,YAApBE,aAAO,EAAPA,EAASE,QAIbhB,EAASe,EAAKD,GAHZG,WAAWC,KAAIC,GAAAA,OAAIJ,GAAO,SAJV,CAQnB,EAED,OADAE,WAAWG,iBAAiB,eAAgBZ,GACrC,WAAA,OAAMS,WAAWI,oBAAoB,eAAgBb,EAAgC,CAC9F,GAAG,CAACR,IACGsB,OACT"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authentication Status Enumeration
|
|
3
|
-
* Defines possible states of user authentication
|
|
4
|
-
*/
|
|
5
|
-
export declare enum AuthStatus {
|
|
6
|
-
/** User is not authenticated */
|
|
7
|
-
UNAUTHENTICATED = "UNAUTHENTICATED",
|
|
8
|
-
/** User is successfully authenticated */
|
|
9
|
-
AUTHENTICATED = "AUTHENTICATED",
|
|
10
|
-
/** Authentication process is in progress */
|
|
11
|
-
AUTHENTICATING = "AUTHENTICATING",
|
|
12
|
-
/** Loading authentication state or user data */
|
|
13
|
-
LOADING = "LOADING",
|
|
14
|
-
/** Authentication error occurred */
|
|
15
|
-
ERROR = "ERROR"
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Micro Frontend Type Enumeration
|
|
19
|
-
* Identifies different types of micro frontend components
|
|
20
|
-
*/
|
|
21
|
-
export declare enum MicroFrontendType {
|
|
22
|
-
/** Main dashboard component */
|
|
23
|
-
DASHBOARD = "DASHBOARD",
|
|
24
|
-
/** User profile component */
|
|
25
|
-
PROFILE = "PROFILE",
|
|
26
|
-
/** Settings and configuration component */
|
|
27
|
-
SETTINGS = "SETTINGS",
|
|
28
|
-
/** Media store and gallery component */
|
|
29
|
-
MEDIA_STORE = "MEDIA_STORE",
|
|
30
|
-
/** Application header component */
|
|
31
|
-
APP_HEADER = "APP_HEADER",
|
|
32
|
-
/** Application footer component */
|
|
33
|
-
APP_FOOTER = "APP_FOOTER",
|
|
34
|
-
/** Video player and gallery component */
|
|
35
|
-
VIDEO_GROUP = "VIDEO_GROUP",
|
|
36
|
-
/** Audio track and playlist component */
|
|
37
|
-
TRACK_GROUP = "TRACK_GROUP",
|
|
38
|
-
/** Generic or custom micro frontend component */
|
|
39
|
-
GENERIC = "GENERIC"
|
|
40
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { AuthEventData, AuthEventListener } from './auth-types';
|
|
2
|
-
/**
|
|
3
|
-
* Global Authentication Manager for Module Federation
|
|
4
|
-
* Manages authentication state across host and micro frontend applications
|
|
5
|
-
*/
|
|
6
|
-
declare class AuthMFEManager {
|
|
7
|
-
private static instance;
|
|
8
|
-
private authData;
|
|
9
|
-
private listeners;
|
|
10
|
-
private isInitialized;
|
|
11
|
-
private constructor();
|
|
12
|
-
/**
|
|
13
|
-
* Get singleton instance
|
|
14
|
-
*/
|
|
15
|
-
static getInstance(): AuthMFEManager;
|
|
16
|
-
/**
|
|
17
|
-
* Initialize global window object for cross-component communication
|
|
18
|
-
*/
|
|
19
|
-
private initializeGlobalWindow;
|
|
20
|
-
/**
|
|
21
|
-
* Setup event listeners for authentication events
|
|
22
|
-
*/
|
|
23
|
-
private setupEventListeners;
|
|
24
|
-
/**
|
|
25
|
-
* Handle authentication state requests
|
|
26
|
-
*/
|
|
27
|
-
private handleAuthRequest;
|
|
28
|
-
/**
|
|
29
|
-
* Handle login requests from micro frontends
|
|
30
|
-
*/
|
|
31
|
-
private handleLoginRequest;
|
|
32
|
-
/**
|
|
33
|
-
* Handle logout requests from micro frontends
|
|
34
|
-
*/
|
|
35
|
-
private handleLogoutRequest;
|
|
36
|
-
/**
|
|
37
|
-
* Update authentication data and notify all subscribers
|
|
38
|
-
*/
|
|
39
|
-
updateAuthData(newData: Partial<AuthEventData>): void;
|
|
40
|
-
/**
|
|
41
|
-
* Subscribe to authentication changes
|
|
42
|
-
*/
|
|
43
|
-
subscribe(microFrontendId: string, callback: AuthEventListener): void;
|
|
44
|
-
/**
|
|
45
|
-
* Unsubscribe from authentication changes
|
|
46
|
-
*/
|
|
47
|
-
unsubscribe(microFrontendId: string, callback: AuthEventListener): void;
|
|
48
|
-
/**
|
|
49
|
-
* Get current authentication data
|
|
50
|
-
*/
|
|
51
|
-
getAuthData(): AuthEventData;
|
|
52
|
-
/**
|
|
53
|
-
* Check if manager is initialized
|
|
54
|
-
*/
|
|
55
|
-
isReady(): boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Get debug information
|
|
58
|
-
*/
|
|
59
|
-
getDebugInfo(): {
|
|
60
|
-
isInitialized: boolean;
|
|
61
|
-
authData: AuthEventData;
|
|
62
|
-
subscriberCount: number;
|
|
63
|
-
subscribers: string[];
|
|
64
|
-
windowAvailable: boolean;
|
|
65
|
-
globalObjectAvailable: boolean;
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
export default AuthMFEManager;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties, FC } from 'react';
|
|
2
|
-
export interface AuthMFEProviderProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Authentication MFE Provider Component
|
|
7
|
-
* Provides authentication state management for the host application
|
|
8
|
-
* Handles communication with micro frontends via global window object
|
|
9
|
-
*/
|
|
10
|
-
declare const AuthMFEProvider: FC<AuthMFEProviderProps>;
|
|
11
|
-
export default AuthMFEProvider;
|
|
12
|
-
export interface IAuthMFEProviderDebugProps {
|
|
13
|
-
position?: Pick<CSSProperties, 'top' | 'left' | 'right' | 'bottom'>;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Debug component to show current authentication state
|
|
17
|
-
* Only renders in development mode
|
|
18
|
-
*/
|
|
19
|
-
export declare const AuthMFEProviderDebug: FC<IAuthMFEProviderDebugProps>;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { AuthStatus } from './auth-enums';
|
|
2
|
-
/**
|
|
3
|
-
* Authentication Event Data Interface
|
|
4
|
-
* Structure for communication between host and micro frontends
|
|
5
|
-
*/
|
|
6
|
-
export interface AuthEventData {
|
|
7
|
-
/** Current authentication status */
|
|
8
|
-
status: AuthStatus;
|
|
9
|
-
/** User display name (if authenticated) */
|
|
10
|
-
displayName?: string;
|
|
11
|
-
/** User avatar URL (if authenticated) */
|
|
12
|
-
avatar?: string;
|
|
13
|
-
/** Unique user identifier (if authenticated) */
|
|
14
|
-
userId?: string;
|
|
15
|
-
/** User email address (if authenticated) */
|
|
16
|
-
email?: string;
|
|
17
|
-
/** Additional user profile data */
|
|
18
|
-
profile?: Record<string, any>;
|
|
19
|
-
/** Error message (if status is ERROR) */
|
|
20
|
-
error?: string;
|
|
21
|
-
/** Timestamp of the authentication event */
|
|
22
|
-
timestamp: number;
|
|
23
|
-
/** Source micro frontend identifier */
|
|
24
|
-
microFrontendId?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Authentication Event Listener Type
|
|
28
|
-
*/
|
|
29
|
-
export type AuthEventListener = (data: AuthEventData) => void;
|
|
30
|
-
/**
|
|
31
|
-
* Default authentication data for unauthenticated state
|
|
32
|
-
*/
|
|
33
|
-
export declare const defaultAuthData: AuthEventData;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export * from './auth-enums';
|
|
2
|
-
export * from './auth-types';
|
|
3
|
-
export { default as AuthMFEManager } from './auth-mfe-manager';
|
|
4
|
-
export { default as AuthMFEProvider, AuthMFEProviderDebug } from './auth-mfe-provider';
|
|
5
|
-
export { MicroFrontendAuth, MicroFrontendAuthConsumer, MicroFrontendAuthDebug } from './micro-frontend-auth-hooks';
|
|
6
|
-
export { useMicroFrontendAuth, useMicroFrontendAuthActions, withMicroFrontendAuth, microFrontendAuthUtils } from './micro-frontend-auth-hooks';
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import React, { FC, CSSProperties } from 'react';
|
|
2
|
-
import { AuthEventData, AuthEventListener } from './auth-types';
|
|
3
|
-
import { AuthStatus } from './auth-enums';
|
|
4
|
-
/**
|
|
5
|
-
* Authentication Manager for Micro Frontends
|
|
6
|
-
* Manages connection to global auth state via window object
|
|
7
|
-
*/
|
|
8
|
-
declare class MicroFrontendAuth {
|
|
9
|
-
private microFrontendId;
|
|
10
|
-
private authData;
|
|
11
|
-
private listeners;
|
|
12
|
-
private retryCount;
|
|
13
|
-
private isInitialized;
|
|
14
|
-
private initPromise;
|
|
15
|
-
constructor(microFrontendId: string);
|
|
16
|
-
/**
|
|
17
|
-
* Initialize connection to global auth manager
|
|
18
|
-
*/
|
|
19
|
-
private initialize;
|
|
20
|
-
private tryInitialize;
|
|
21
|
-
/**
|
|
22
|
-
* Setup connection to global auth manager
|
|
23
|
-
*/
|
|
24
|
-
private setupConnection;
|
|
25
|
-
/**
|
|
26
|
-
* Handle authentication state changes from global manager
|
|
27
|
-
*/
|
|
28
|
-
private handleAuthChange;
|
|
29
|
-
/**
|
|
30
|
-
* Handle auth response events
|
|
31
|
-
*/
|
|
32
|
-
private handleAuthResponse;
|
|
33
|
-
/**
|
|
34
|
-
* Handle global auth state changes
|
|
35
|
-
*/
|
|
36
|
-
private handleStateChanged;
|
|
37
|
-
/**
|
|
38
|
-
* Request current authentication state
|
|
39
|
-
*/
|
|
40
|
-
private requestAuthState;
|
|
41
|
-
/**
|
|
42
|
-
* Notify all listeners of auth changes
|
|
43
|
-
*/
|
|
44
|
-
private notifyListeners;
|
|
45
|
-
/**
|
|
46
|
-
* Subscribe to authentication changes
|
|
47
|
-
*/
|
|
48
|
-
subscribe(listener: AuthEventListener): () => void;
|
|
49
|
-
/**
|
|
50
|
-
* Get current authentication data
|
|
51
|
-
*/
|
|
52
|
-
getAuthData(): AuthEventData;
|
|
53
|
-
/**
|
|
54
|
-
* Request login from host application
|
|
55
|
-
*/
|
|
56
|
-
requestLogin(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Request logout from host application
|
|
59
|
-
*/
|
|
60
|
-
requestLogout(): void;
|
|
61
|
-
/**
|
|
62
|
-
* Check if connected to global auth manager
|
|
63
|
-
*/
|
|
64
|
-
isConnected(): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Get debug information
|
|
67
|
-
*/
|
|
68
|
-
getDebugInfo(): {
|
|
69
|
-
microFrontendId: string;
|
|
70
|
-
isInitialized: boolean;
|
|
71
|
-
isConnected: boolean;
|
|
72
|
-
retryCount: number;
|
|
73
|
-
authData: AuthEventData;
|
|
74
|
-
listenerCount: number;
|
|
75
|
-
globalAvailable: boolean;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Cleanup when component unmounts
|
|
79
|
-
*/
|
|
80
|
-
destroy(): void;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* React Hook for Micro Frontend Authentication
|
|
84
|
-
* Primary hook for function components
|
|
85
|
-
*/
|
|
86
|
-
export declare function useMicroFrontendAuth(microFrontendId: string): {
|
|
87
|
-
isAuthenticated: boolean;
|
|
88
|
-
isLoading: boolean;
|
|
89
|
-
isAuthenticating: boolean;
|
|
90
|
-
hasError: boolean;
|
|
91
|
-
displayName: string | undefined;
|
|
92
|
-
email: string | undefined;
|
|
93
|
-
userId: string | undefined;
|
|
94
|
-
avatar: string | undefined;
|
|
95
|
-
profile: Record<string, any> | undefined;
|
|
96
|
-
status: AuthStatus;
|
|
97
|
-
error: string | undefined;
|
|
98
|
-
timestamp: number;
|
|
99
|
-
login: () => void;
|
|
100
|
-
logout: () => void;
|
|
101
|
-
authData: AuthEventData;
|
|
102
|
-
isConnected: boolean;
|
|
103
|
-
debugInfo: {
|
|
104
|
-
microFrontendId: string;
|
|
105
|
-
isInitialized: boolean;
|
|
106
|
-
isConnected: boolean;
|
|
107
|
-
retryCount: number;
|
|
108
|
-
authData: AuthEventData;
|
|
109
|
-
listenerCount: number;
|
|
110
|
-
globalAvailable: boolean;
|
|
111
|
-
};
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* React Hook for Authentication Actions Only
|
|
115
|
-
* Lightweight hook for components that only need actions
|
|
116
|
-
*/
|
|
117
|
-
export declare function useMicroFrontendAuthActions(microFrontendId: string): {
|
|
118
|
-
login: () => void;
|
|
119
|
-
logout: () => void;
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* Consumer Component for Class Components or Render Props Pattern
|
|
123
|
-
*/
|
|
124
|
-
interface MicroFrontendAuthConsumerProps {
|
|
125
|
-
microFrontendId: string;
|
|
126
|
-
children: (authData: ReturnType<typeof useMicroFrontendAuth>) => React.ReactNode;
|
|
127
|
-
}
|
|
128
|
-
export declare function MicroFrontendAuthConsumer({ microFrontendId, children }: MicroFrontendAuthConsumerProps): import("react/jsx-runtime").JSX.Element;
|
|
129
|
-
/**
|
|
130
|
-
* Higher-Order Component for Class Components
|
|
131
|
-
*/
|
|
132
|
-
export declare function withMicroFrontendAuth<P extends object>(Component: React.ComponentType<P & {
|
|
133
|
-
auth: ReturnType<typeof useMicroFrontendAuth>;
|
|
134
|
-
}>, microFrontendId: string): (props: P) => import("react/jsx-runtime").JSX.Element;
|
|
135
|
-
/**
|
|
136
|
-
* Utility functions for non-React contexts
|
|
137
|
-
*/
|
|
138
|
-
export declare const microFrontendAuthUtils: {
|
|
139
|
-
/**
|
|
140
|
-
* Get current auth state synchronously
|
|
141
|
-
*/
|
|
142
|
-
getCurrentAuth: (microFrontendId: string) => AuthEventData;
|
|
143
|
-
/**
|
|
144
|
-
* Request login from any context
|
|
145
|
-
*/
|
|
146
|
-
requestLogin: (microFrontendId: string) => void;
|
|
147
|
-
/**
|
|
148
|
-
* Request logout from any context
|
|
149
|
-
*/
|
|
150
|
-
requestLogout: (microFrontendId: string) => void;
|
|
151
|
-
/**
|
|
152
|
-
* Create or get auth instance
|
|
153
|
-
*/
|
|
154
|
-
createAuthInstance: (microFrontendId: string) => MicroFrontendAuth;
|
|
155
|
-
};
|
|
156
|
-
/**
|
|
157
|
-
* Debug component for micro frontends
|
|
158
|
-
*/
|
|
159
|
-
interface MicroFrontendAuthDebugProps {
|
|
160
|
-
microFrontendId: string;
|
|
161
|
-
position?: Pick<CSSProperties, 'top' | 'left' | 'right' | 'bottom'>;
|
|
162
|
-
}
|
|
163
|
-
export declare const MicroFrontendAuthDebug: FC<MicroFrontendAuthDebugProps>;
|
|
164
|
-
export { MicroFrontendAuth };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { AnchorHTMLAttributes, FC } from 'react';
|
|
2
|
-
import type { MfeNavigate } from './types';
|
|
3
|
-
export declare const useMfeNavigate: () => {
|
|
4
|
-
navigate: (params: MfeNavigate) => void;
|
|
5
|
-
};
|
|
6
|
-
export interface IMfeLinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
7
|
-
internal?: boolean;
|
|
8
|
-
primaryHref: string;
|
|
9
|
-
secondaryHref?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare const MfeLink: FC<IMfeLinkProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './provider';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './provider';
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type AppSite = 'client' | 'home' | 'music';
|
|
2
|
-
export type IMfeNavigateHref = {
|
|
3
|
-
primaryHref: string;
|
|
4
|
-
secondaryHref?: string;
|
|
5
|
-
};
|
|
6
|
-
export interface MfeNavigate {
|
|
7
|
-
primaryHref: string;
|
|
8
|
-
secondaryHref?: string;
|
|
9
|
-
internal?: boolean;
|
|
10
|
-
site?: AppSite;
|
|
11
|
-
options?: any;
|
|
12
|
-
target?: '_self' | '_blank';
|
|
13
|
-
}
|
|
File without changes
|
/package/dist/types/{mfe-navigate/mfe-navigate.debug.d.ts → mfe-shared/navigation.debug.d.ts}
RENAMED
|
File without changes
|