wu-framework 2.5.0 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.cts +20 -0
- package/dist/index.d.ts +20 -0
- package/dist/wu-framework.cjs +2 -2
- package/dist/wu-framework.cjs.map +1 -1
- package/dist/wu-framework.dev.js +93 -4
- package/dist/wu-framework.dev.js.map +1 -1
- package/dist/wu-framework.esm.js +2 -2
- package/dist/wu-framework.esm.js.map +1 -1
- package/dist/wu-framework.umd.js +2 -2
- package/dist/wu-framework.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -373,6 +373,16 @@ export class WuCore {
|
|
|
373
373
|
}): Promise<void>;
|
|
374
374
|
mount(appName: string, containerSelector: string): Promise<void>;
|
|
375
375
|
unmount(appName: string, options?: { force?: boolean; keepAlive?: boolean }): Promise<void>;
|
|
376
|
+
/**
|
|
377
|
+
* RBAC (v2.6+): fija el principal actual. Las apps que declaran `roles` (en su
|
|
378
|
+
* config de `init` o en su manifest `wu.roles`) solo se montan si el principal
|
|
379
|
+
* está autorizado; un `mount()` no autorizado rechaza con `code:'WU_ACCESS_DENIED'`
|
|
380
|
+
* y emite `wu:access:denied` (DOM) + `access:denied` (bus).
|
|
381
|
+
*/
|
|
382
|
+
setPrincipal(principal: WuPrincipal | null): WuPrincipal | null;
|
|
383
|
+
getPrincipal(): WuPrincipal | null;
|
|
384
|
+
/** ¿El principal actual puede montar/acceder a `appName`? Apps sin `roles` → true. */
|
|
385
|
+
can(appName: string): boolean;
|
|
376
386
|
/**
|
|
377
387
|
* Push new props into an already-mounted app without remounting (v2.2+).
|
|
378
388
|
* Resolves `true` if the app's adapter supports live props; resolves `false`
|
|
@@ -666,6 +676,16 @@ export default wu;
|
|
|
666
676
|
export function init(apps: WuAppConfig[]): Promise<void>;
|
|
667
677
|
export function mount(name: string, container: string): Promise<void>;
|
|
668
678
|
export function unmount(name: string, opts?: any): Promise<void>;
|
|
679
|
+
/** RBAC (v2.6+): principal actual (rol/permisos de quien usa el sistema). */
|
|
680
|
+
export interface WuPrincipal {
|
|
681
|
+
role?: string;
|
|
682
|
+
roles?: string[];
|
|
683
|
+
permissions?: string[];
|
|
684
|
+
[k: string]: unknown;
|
|
685
|
+
}
|
|
686
|
+
export function setPrincipal(principal: WuPrincipal | null): WuPrincipal | null;
|
|
687
|
+
export function getPrincipal(): WuPrincipal | null;
|
|
688
|
+
export function can(appName: string): boolean;
|
|
669
689
|
export function define(name: string, lifecycle: WuLifecycle): void;
|
|
670
690
|
export function app(name: string, config: Partial<WuAppConfig>): WuApp;
|
|
671
691
|
export function destroy(): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -373,6 +373,16 @@ export class WuCore {
|
|
|
373
373
|
}): Promise<void>;
|
|
374
374
|
mount(appName: string, containerSelector: string): Promise<void>;
|
|
375
375
|
unmount(appName: string, options?: { force?: boolean; keepAlive?: boolean }): Promise<void>;
|
|
376
|
+
/**
|
|
377
|
+
* RBAC (v2.6+): fija el principal actual. Las apps que declaran `roles` (en su
|
|
378
|
+
* config de `init` o en su manifest `wu.roles`) solo se montan si el principal
|
|
379
|
+
* está autorizado; un `mount()` no autorizado rechaza con `code:'WU_ACCESS_DENIED'`
|
|
380
|
+
* y emite `wu:access:denied` (DOM) + `access:denied` (bus).
|
|
381
|
+
*/
|
|
382
|
+
setPrincipal(principal: WuPrincipal | null): WuPrincipal | null;
|
|
383
|
+
getPrincipal(): WuPrincipal | null;
|
|
384
|
+
/** ¿El principal actual puede montar/acceder a `appName`? Apps sin `roles` → true. */
|
|
385
|
+
can(appName: string): boolean;
|
|
376
386
|
/**
|
|
377
387
|
* Push new props into an already-mounted app without remounting (v2.2+).
|
|
378
388
|
* Resolves `true` if the app's adapter supports live props; resolves `false`
|
|
@@ -666,6 +676,16 @@ export default wu;
|
|
|
666
676
|
export function init(apps: WuAppConfig[]): Promise<void>;
|
|
667
677
|
export function mount(name: string, container: string): Promise<void>;
|
|
668
678
|
export function unmount(name: string, opts?: any): Promise<void>;
|
|
679
|
+
/** RBAC (v2.6+): principal actual (rol/permisos de quien usa el sistema). */
|
|
680
|
+
export interface WuPrincipal {
|
|
681
|
+
role?: string;
|
|
682
|
+
roles?: string[];
|
|
683
|
+
permissions?: string[];
|
|
684
|
+
[k: string]: unknown;
|
|
685
|
+
}
|
|
686
|
+
export function setPrincipal(principal: WuPrincipal | null): WuPrincipal | null;
|
|
687
|
+
export function getPrincipal(): WuPrincipal | null;
|
|
688
|
+
export function can(appName: string): boolean;
|
|
669
689
|
export function define(name: string, lifecycle: WuLifecycle): void;
|
|
670
690
|
export function app(name: string, config: Partial<WuAppConfig>): WuApp;
|
|
671
691
|
export function destroy(): Promise<void>;
|