@juice-js/core 2.0.2 → 2.1.0-alpha.2

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.
@@ -212,6 +212,10 @@ async function loadChildrenInternal(menu, parentInjector, tenant) {
212
212
  for (let child of children) {
213
213
  if (hasChildren(child)) {
214
214
  var sub = await loadChildrenInternal(child, parentInjector, tenant);
215
+ // The nested group goes away and its pages take its place: they keep it out of the side menu if it was.
216
+ if (child.inMenu === false) {
217
+ sub.forEach(s => s.inMenu = false);
218
+ }
215
219
  if (sub.length > 0) {
216
220
  result = result.concat(sub);
217
221
  }
@@ -306,6 +310,9 @@ class MenuItem {
306
310
  this.loaded = false;
307
311
  this.rawRouterLink = menu.routerLink;
308
312
  this.canDisplay = menu.canDisplay ?? [];
313
+ this.inMenu = menu.inMenu ?? true;
314
+ this.shortcut = menu.shortcut;
315
+ this.grouping = this.children.length > 0 || !!menu.loadChildren;
309
316
  }
310
317
  static fromRoute(route) {
311
318
  var menu = new MenuItem({
@@ -317,23 +324,43 @@ class MenuItem {
317
324
  children: route.children?.filter(isMenu).map(r => MenuItem.fromRoute(r)) ?? [],
318
325
  loadChildren: route.loadChildren,
319
326
  replaceChildRouterLink: true,
320
- canDisplay: route.data['menuDisplay']
327
+ canDisplay: route.data['menuDisplay'],
328
+ inMenu: route.data['menuInMenu'],
329
+ shortcut: route.data['menuShortcut']
321
330
  });
322
331
  return menu;
323
332
  }
324
333
  hasChildren() {
325
334
  return this.children.length > 0;
326
335
  }
336
+ /** The children the side menu shows: all but those marked `inMenu: false`. */
337
+ menuChildren() {
338
+ return (this.children ?? []).filter(c => c.inMenu !== false);
339
+ }
340
+ /**
341
+ * Whether the item has a page of its own: a leaf does; a group does when it has a link that none of its children
342
+ * stands for (a group linking to its first child's page has none of its own).
343
+ */
344
+ hasOwnPage() {
345
+ if (!this.hasChildren()) {
346
+ // A leaf is a page ('' is the home page); a group left without children is one only if it has a link.
347
+ return !this.grouping || !!this.rawRouterLink;
348
+ }
349
+ const own = this.routerLink?.trimEndSlash();
350
+ return !!this.routerLink && !this.children.some(c => c.routerLink?.trimEndSlash() === own);
351
+ }
327
352
  injectTenant(tenant) {
328
353
  this.children?.forEach(item => {
329
- if (item.hasChildren()) {
354
+ if (item.grouping) {
330
355
  item.injectTenant(tenant);
331
356
  }
332
357
  else {
333
358
  item.routerLink = item.rawRouterLink.injectTenant(tenant);
334
359
  }
335
360
  });
336
- this.routerLink = this.rawRouterLink.injectTenant(tenant);
361
+ // A group without a link stays without one ('' would otherwise become '/', the home page); '/' is a link.
362
+ this.routerLink = this.grouping && !this.rawRouterLink
363
+ ? '' : this.rawRouterLink.injectTenant(tenant);
337
364
  }
338
365
  }
339
366
  const MENUS = new InjectionToken('MENUS');
@@ -1 +1 @@
1
- {"version":3,"file":"juice-js-core.mjs","sources":["../../../../projects/juice-js/core/src/lib/tenant/tenant-resolver.service.ts","../../../../projects/juice-js/core/src/lib/tenant/resolvers/config-resolver.service.ts","../../../../projects/juice-js/core/src/lib/tenant/tenant.module.ts","../../../../projects/juice-js/core/src/lib/tenant/resolvers/storage-resolver.service.ts","../../../../projects/juice-js/core/src/lib/tenant/tenant.service.ts","../../../../projects/juice-js/core/src/lib/menu/utils.ts","../../../../projects/juice-js/core/src/lib/menu/menu-loader.ts","../../../../projects/juice-js/core/src/lib/menu/menu-item.ts","../../../../projects/juice-js/core/src/lib/menu/menu.service.ts","../../../../projects/juice-js/core/src/lib/menu/menu.module.ts","../../../../projects/juice-js/core/src/lib/routing/utils.ts","../../../../projects/juice-js/core/src/lib/extensions/string.extensions.ts","../../../../projects/juice-js/core/src/lib/dialog/async-dialog.service.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.context.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.errors.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency-response.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency-key.service.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.interceptor.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.module.ts","../../../../projects/juice-js/core/src/public-api.ts","../../../../projects/juice-js/core/src/juice-js-core.ts"],"sourcesContent":["import { Injectable, InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs/internal/Observable';\nimport { TenantInfo } from './tenant-info';\n\nexport const TENANT_RESOLVER = new InjectionToken<TenantResolverService[]>('TENANT_RESOLVER');\n\n@Injectable({\n providedIn: 'root'\n})\nexport abstract class TenantResolverService {\n\n priority = 0;\n abstract getTenantByIdentifier(identifier: string): Observable<TenantInfo|null>;\n}\n","\nimport { Observable } from 'rxjs';\nimport { TenantResolverService } from '../tenant-resolver.service';\nimport { TenantInfo } from '../tenant-info';\n\nexport class ConfigResolver extends TenantResolverService{\n override priority: number = 99;\n constructor(private config: TenantInfo[]){\n super();\n }\n\n getTenantByIdentifier(identifier: string): Observable<TenantInfo|null> {\n if(identifier===''){\n return new Observable(subscriber => {\n subscriber.next({identifier:''} as TenantInfo);\n subscriber.complete();\n });\n }\n const tenant = this.config.find(tenant => tenant.identifier === identifier);\n if(tenant){\n return new Observable(subscriber => {\n subscriber.next(tenant);\n subscriber.complete();\n });\n }\n return new Observable(subscriber => {\n subscriber.next(null);\n subscriber.complete();\n });\n }\n}","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { TenantService } from './tenant.service';\nimport { TENANT_RESOLVER } from './tenant-resolver.service';\nimport { ConfigResolver } from './resolvers/config-resolver.service';\nimport { StorageResolver } from './resolvers/storage-resolver.service';\nimport { TenantInfo } from './tenant-info';\n\n@NgModule({\n})\nexport class TenantModule { \n public static forRoot(tenants: TenantInfo[] = []): ModuleWithProviders<TenantModule>{\n return {\n ngModule: TenantModule,\n providers: [\n TenantService,\n {\n provide: TENANT_RESOLVER,\n useValue: new ConfigResolver(tenants),\n multi: true\n },\n {\n provide: TENANT_RESOLVER,\n useClass: StorageResolver,\n multi: true\n }\n ]\n }\n }\n}\n","\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { TenantResolverService } from '../tenant-resolver.service';\nimport { TenantModule } from '../tenant.module';\nimport { TenantInfo } from '../tenant-info';\n\n@Injectable({\n providedIn: TenantModule\n})\nexport class StorageResolver extends TenantResolverService{\n static CURRENT_TENANT = '_TENANT_';\n override priority: number = 100;\n constructor(){\n super();\n }\n\n getTenantByIdentifier(identifier: string): Observable<TenantInfo|null> {\n var currentTenant = localStorage.getItem(StorageResolver.CURRENT_TENANT);\n var tenantInfo = currentTenant ? JSON.parse(currentTenant) as TenantInfo : null;\n if(tenantInfo && tenantInfo.identifier === identifier){\n return new Observable(subscriber => {\n subscriber.next(tenantInfo);\n subscriber.complete();\n });\n }\n return new Observable(subscriber => {\n subscriber.next(null);\n subscriber.complete();\n });\n }\n\n saveTenant(tenant: TenantInfo){\n localStorage.setItem(StorageResolver.CURRENT_TENANT, JSON.stringify(tenant));\n }\n\n clearTenant(){\n localStorage.removeItem(StorageResolver.CURRENT_TENANT);\n }\n\n getCurrentTenant(): TenantInfo|null{\n var currentTenant = localStorage.getItem(StorageResolver.CURRENT_TENANT);\n return currentTenant ? JSON.parse(currentTenant) as TenantInfo : null;\n }\n}","import { Inject, Injectable, Optional, inject } from '@angular/core';\nimport { firstValueFrom } from 'rxjs/internal/firstValueFrom';\nimport { TENANT_RESOLVER, TenantResolverService } from './tenant-resolver.service';\nimport { TenantInfo } from './tenant-info';\nimport { StorageResolver } from './resolvers/storage-resolver.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TenantService {\n currentTenant: TenantInfo|null = null;\n requestTenantIdentifier: string|null = null;\n resolvers: TenantResolverService[] = [];\n storageResolver: StorageResolver|undefined;\n constructor(\n @Optional() storageResolver: StorageResolver\n ) { \n this.resolvers = inject(TENANT_RESOLVER, {optional: true}) ?? [];\n this.storageResolver = storageResolver;\n this.currentTenant = this.storageResolver?.getCurrentTenant();\n }\n\n async getTenantIdentifier(){\n return (await this.getTenantInfo())?.identifier\n ;\n }\n\n private async getTenantByIdentifier(identifier: string): Promise<TenantInfo|null>{\n if(!this.resolvers){\n return null;\n }\n for(const resolver of this.resolvers.sort((a,b) => b.priority - a.priority)){\n // console.debug(`Resolving tenant ${identifier} by ${resolver.constructor.name}`);\n var tenant = await firstValueFrom(resolver.getTenantByIdentifier(identifier));\n if(tenant){\n tenant.resolvedBy = resolver.constructor.name;\n console.debug(`Tenant ${tenant.identifier} resolved by ${tenant.resolvedBy}`);\n if(!(resolver instanceof StorageResolver) || tenant.identifier != this.currentTenant?.identifier){\n this.storageResolver?.saveTenant(tenant);\n this.currentTenant = tenant;\n }\n return tenant;\n }\n }\n return null;\n }\n\n async getTenantInfo(): Promise<TenantInfo|null>{\n // :tenant/:module/:component\n var tenant = window.location.pathname.split('/')[1];\n this.requestTenantIdentifier = tenant;\n return (await this.getTenantByIdentifier(tenant))\n ?? this.storedTenant()\n ?? null\n ;\n }\n\n storedTenant(): TenantInfo|null|undefined{\n return this.storageResolver?.getCurrentTenant();\n }\n\n isMatched(): boolean{\n return this.currentTenant?.identifier == this.requestTenantIdentifier;\n }\n}\n","import {ɵisPromise as isPromise} from '@angular/core';\nimport {from, isObservable, Observable, of} from 'rxjs';\n\n\nexport function wrapIntoObservable<T>(value: T|Promise<T>|Observable<T>): Observable<T> {\n if (isObservable(value)) {\n return value;\n }\n \n if (isPromise(value)) {\n // Use `Promise.resolve()` to wrap promise-like instances.\n // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the\n // change detection.\n return from(Promise.resolve(value));\n }\n \n return of(value);\n }\n","\nimport { Injector, Type, createNgModule } from '@angular/core';\nimport { wrapIntoObservable} from './utils';\nimport { MENUS, MenuItem, Menus, CanDisplay } from './menu-item';\nimport { map } from 'rxjs/operators';\nimport { Observable, of, firstValueFrom } from 'rxjs';\nimport { ROUTES, Route } from '@angular/router';\n\nexport interface DefaultExport<T> {\n default: T;\n}\n\nexport async function loadChildren(menu: MenuItem, parentInjector: Injector, \n tenant: string|null|undefined): Promise<void>\n{\n if(menu.loaded){\n menu.injectTenant(tenant);\n return;\n }\n // console.debug(\"loadChildren\", menu.rawRouterLink);\n if(!hasChildren(menu)){\n return;\n }\n await loadChildrenInternal(menu, parentInjector, tenant)\n .then(children => {\n if(children!=null){\n console.debug(\"loadedChildren\", menu.rawRouterLink, children.map(c => c.rawRouterLink));\n menu.children = children;\n menu.injectTenant(tenant);\n }\n menu.loaded = true;\n })\n ;\n}\n\nasync function loadChildrenInternal(menu: MenuItem, parentInjector: Injector, tenant: string|null|undefined)\n: Promise<MenuItem[]>{\n \n var result: MenuItem[] = [];\n var children = await firstValueFrom(getChildren(menu, parentInjector, tenant));\n for(let child of children){\n if(hasChildren(child)){\n var sub = await loadChildrenInternal(child, parentInjector, tenant);\n if(sub.length > 0){\n result = result.concat(sub);\n }\n }else{\n result.push(child);\n }\n }\n \n return result.map(child => {\n child.rawRouterLink = menu.replaceChildRouterLink && menu.rawRouterLink ?\n ('/' + menu.rawRouterLink.trimSlash() + '/' + child.rawRouterLink.trimSlash()).trimEndSlash()\n : '/'+child.rawRouterLink.trimSlash();\n return child;\n });\n}\n\nfunction hasChildren(menu: MenuItem): boolean{\n return !((menu.children == null || menu.children.length==0) && !menu.loadChildren);\n}\n\nfunction getChildren(menu:MenuItem, parentInjector: Injector, tenant: string|null|undefined) \n : Observable<MenuItem[]>{\n if(menu.loadChildren){\n return wrapIntoObservable(menu.loadChildren())\n .pipe(\n map(t => loadMenus(t, parentInjector))\n );\n }else{\n return of(menu.children.filter(m => filterMenu(m, parentInjector)));\n }\n}\n\nfunction loadMenus(menusOrModule: Type<unknown>|Menus, parentInjector: Injector): MenuItem[] {\n \n if(Array.isArray(menusOrModule)){\n return menusOrModule.map(menu => new MenuItem(menu));\n }\n const module = createNgModule(menusOrModule, parentInjector);\n const injector = module.injector;\n const menus = injector.get(MENUS, [], {optional: true, self: true}).flat();\n const routes = injector.get(ROUTES, [], {optional: true, self: true});\n var routeMenus = mapRouteMenu(routes);\n // console.debug(\"loadMenus\", menus, routeMenus);\n return menus.map(menu => new MenuItem(menu)).concat(routeMenus)\n .filter(m => filterMenu(m, injector));\n}\n\nfunction filterMenu(menu: MenuItem, injector: Injector): boolean{\n\n if(menu.canDisplay instanceof Boolean){\n return menu.canDisplay as boolean;\n }\n const canDisplays = getCanDisplays(menu.canDisplay);\n\n return (canDisplays.length === 0 || canDisplays.every(\n (c: any) => {\n if(c instanceof Type){\n const service = injector.get<CanDisplay>(c as Type<CanDisplay>);\n return service.canDisplay();\n }else if(c instanceof Function){\n return c();\n }\n return true;\n }\n ))\n}\n\nfunction getCanDisplays(canDisplay: boolean|any[]): Array<any>{\n if(canDisplay instanceof Boolean){\n return [];\n }\n return Array.isArray(canDisplay) ? canDisplay : [];\n}\n\nexport function mapRouteMenu(routes: Route[][]): MenuItem[]{\n return routes\n .map(route => route.filter(isMenu).map(r => {\n if(!r.data){\n r.data = {};\n }\n return MenuItem.fromRoute(r);\n })\n ).flatMap(m => m.map(r => r!));\n}\n\nexport function isMenu(route: Route): boolean{\n return route.data && (route.data['menuDisplay'] || route.data['menuWrapper']);\n}\n","import { InjectionToken } from '@angular/core';\nimport { Route } from '@angular/router';\nimport { isMenu } from './menu-loader';\n\nexport class MenuItem {\n id: string = \"\";\n label: string = \"\";\n routerLink: string = \"\";\n rawRouterLink: string;\n icon: string = \"\";\n order: number = 0;\n children: MenuItem[];\n loadChildren?: Function;\n replaceChildRouterLink: boolean;\n loaded: boolean = false;\n canDisplay: any[] | boolean;\n \n constructor(menu: Menu){\n this.id = menu.id;\n this.label = menu.label;\n this.routerLink = menu.routerLink;\n this.icon = menu.icon;\n this.order = menu.order??0;\n this.children = menu.children?.map(m => new MenuItem(m))?? [];\n this.loadChildren = menu.loadChildren;\n this.replaceChildRouterLink = menu.replaceChildRouterLink ?? true;\n this.loaded = false;\n this.rawRouterLink = menu.routerLink;\n this.canDisplay = menu.canDisplay??[];\n }\n\n static fromRoute(route: Route): MenuItem{\n var menu = new MenuItem({\n id: route.path ?? '',\n label: route.data!['menuTitle']??route.title??route.path??'',\n routerLink: route.path??'',\n icon: route.data!['menuIcon']??'',\n order: route.data!['menuOrder']??0,\n children: route.children?.filter(isMenu).map(r => MenuItem.fromRoute(r))??[],\n loadChildren: route.loadChildren,\n replaceChildRouterLink: true,\n canDisplay: (route.data!['menuDisplay'] as boolean | any[])\n });\n return menu;\n }\n\n hasChildren(): boolean{\n return this.children.length > 0;\n }\n\n injectTenant(tenant: string|null|undefined){\n this.children?.forEach(item => {\n if(item.hasChildren()){\n item.injectTenant(tenant);\n }else{\n item.routerLink = item.rawRouterLink.injectTenant(tenant);\n }\n });\n this.routerLink = this.rawRouterLink.injectTenant(tenant);\n }\n}\n\nexport interface Menu {\n id: string,\n label: string,\n routerLink: string,\n icon: string,\n order?: number,\n children?: Menus,\n loadChildren?: any,\n replaceChildRouterLink?: boolean,\n canDisplay?: any[] | boolean\n}\n\nexport type Menus = Menu[];\n\nexport const MENUS = new InjectionToken<Menus[]>('MENUS');\n\nexport interface CanDisplay{\n canDisplay(): boolean;\n}","import { Injectable, Injector, inject } from '@angular/core';\nimport { MENUS, MenuItem } from './menu-item';\nimport { Observable, of } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\nimport { loadChildren, mapRouteMenu } from './menu-loader';\nimport { TenantService } from '../tenant/tenant.service';\nimport { ROUTES, Route } from '@angular/router';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MenuService {\n routes: Route[][] = [];\n constructor(private injector: Injector, private tenantService: TenantService) { \n this.routes = inject(ROUTES, {optional: true})??[];\n }\n\n getMenu():Observable<MenuItem[]>{\n var menus = this.injector.get(MENUS, [], {optional: true, self: true}).flat();\n var routeMenus = mapRouteMenu(this.routes);\n // console.debug(\"getMenu\", menus, routeMenus, this.routes);\n return of(menus)\n .pipe(\n map(menus => menus.map(m => new MenuItem(m))),\n map(async menus => {\n var tenant = await this.tenantService.getTenantIdentifier();\n let menuItems = [];\n for(let menu of menus.concat(routeMenus)){\n await loadChildren(menu, this.injector, tenant);\n menuItems.push(menu);\n }\n return menuItems;\n }),\n mergeMap(menus => menus),\n map(menus => menus.sort((a,b) => (a.order ?? 0) - (b.order ?? 0)))\n );\n }\n\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { MenuService } from './menu.service';\nimport { MENUS, Menus } from './menu-item';\n\n@NgModule({\n declarations: [\n\n ],\n imports: [\n \n ],\n exports: [\n\n ]\n})\nexport class MenuModule {\n\n /**\n * Creates and configures a module with all the menu providers.\n * Optionally sets up an application listener to perform an initial navigation.\n *\n * When registering the NgModule at the root, import as follows:\n *\n * ```\n * @NgModule({\n * imports: [MenuModule.forRoot(MENUS)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param menus An array of `Route` objects that define the navigation paths for the application.\n * @return The new `NgModule`.\n *\n */\n public static forRoot(menus: Menus): ModuleWithProviders<MenuModule> {\n \n return {\n ngModule: MenuModule,\n providers: [\n MenuService,\n {\n provide: MENUS,\n multi: true,\n useValue: menus\n }\n ]\n };\n }\n\n /**\n * Creates a module with all the menus, without creating a new Router service.\n * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:\n *\n * ```\n * @NgModule({\n * imports: [MenuModule.forChild(MENUS)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param menus An array of `MenuItem` objects that define the navigation paths for the submodule.\n * @return The new NgModule.\n *\n */\n public static forChild(menus: Menus): ModuleWithProviders<MenuModule> {\n return {\n ngModule: MenuModule,\n providers: [{provide: MENUS, multi: true, useValue: menus}],\n }\n }\n \n}","import { ROUTES, Routes } from \"@angular/router\";\nimport { ModuleWithProviders, Type, createNgModule } from \"@angular/core\";\n\nexport function loadChildrenRoutes(menusOrModule: ModuleWithProviders<any>): Routes {\n \n const module = createNgModule(menusOrModule.ngModule);\n const injector = module.injector;\n const menus = injector.get(ROUTES, [], {optional: true, self: true}).flat();\n return menus;\n}","export { };\ndeclare global {\n interface String {\n trimStartSlash(): string;\n trimEndSlash(): string;\n trimSlash(): string;\n injectTenant(tenant: string|null|undefined): string;\n }\n}\nString.prototype.trimStartSlash = function (): string{\n return this.replace(/^[\\/]+/, '');\n}\nString.prototype.trimEndSlash = function (): string{\n return this.replace(/[\\/]+$/, '');\n}\nString.prototype.trimSlash = function (): string{\n return this.trimStartSlash().trimEndSlash();\n}\nString.prototype.injectTenant = function (tenant: string|null|undefined): string{\n return '/' + this.replace(':tenant', tenant??'').trimStartSlash();\n}\n","import { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { Directive } from '@angular/core';\n\n@Directive()\nexport abstract class AsyncDialog<ComponentType, DataType, ReturnType = unknown> {\n constructor(protected matDialog: MatDialog) {\n }\n\n abstract open(data: DataType): Promise<MatDialogRef<ComponentType, ReturnType>>;\n}","import { HttpContext, HttpContextToken } from '@angular/common/http';\n\n/**\n * Operation identifier that groups all HTTP attempts belonging to one logical\n * state-changing operation. Requests carrying the same operation id reuse the\n * same `Idempotency-Key` (across double-clicks and retries); a `null` value\n * means the request is not opted into idempotency.\n */\nexport const IDEMPOTENCY_OPERATION = new HttpContextToken<string | null>(() => null);\n\n/**\n * Optional client-side retry horizon (in milliseconds) that bounds how long a\n * key may be reused, mirroring the backend retention window. Past this age the\n * request is surfaced as an expired condition rather than silently treated as new.\n */\nexport const IDEMPOTENCY_MAX_AGE_MS = new HttpContextToken<number | null>(() => null);\n\n/**\n * Build (or extend) an {@link HttpContext} that opts a request into idempotency\n * for the given logical operation.\n *\n * @example\n * this.http.post('/orders', body, { context: withIdempotency('create-order-42') });\n */\nexport function withIdempotency(\n operationId: string,\n maxAgeMs?: number,\n context: HttpContext = new HttpContext(),\n): HttpContext {\n context.set(IDEMPOTENCY_OPERATION, operationId);\n if (maxAgeMs != null) {\n context.set(IDEMPOTENCY_MAX_AGE_MS, maxAgeMs);\n }\n return context;\n}\n","/**\n * Raised when the backend rejects a request because the same `Idempotency-Key`\n * was reused with a materially different payload (HTTP 422).\n */\nexport class IdempotencyConflictError extends Error {\n constructor(\n public readonly operationId: string,\n message = 'Idempotency key conflict: the same key was reused with a different payload.',\n ) {\n super(message);\n this.name = 'IdempotencyConflictError';\n }\n}\n\n/**\n * Raised when an endpoint requires an `Idempotency-Key` but none was supplied\n * (HTTP 400). Should not occur in normal client flow because the interceptor\n * always attaches a key to opted-in requests.\n */\nexport class IdempotencyKeyRequiredError extends Error {\n constructor(message = 'Idempotency-Key header is required for this request.') {\n super(message);\n this.name = 'IdempotencyKeyRequiredError';\n }\n}\n\n/**\n * Raised when a key has exceeded its client-side retry horizon and can no longer\n * be safely reused for the same operation.\n */\nexport class IdempotencyExpiredError extends Error {\n constructor(\n public readonly operationId: string,\n message = 'Idempotency key expired; the operation can no longer be safely retried with the same key.',\n ) {\n super(message);\n this.name = 'IdempotencyExpiredError';\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\n\n/**\n * Classification of a backend response with respect to idempotency handling.\n */\nexport type IdempotencyOutcome = 'in-progress' | 'conflict' | 'required' | 'other';\n\n/**\n * Classify an {@link HttpErrorResponse} against the backend idempotency contract\n * (see the Juice backend `011-idempotency-key-api` feature):\n * - `409` → operation is still in progress (retry after backoff)\n * - `422` → key reused with a different payload (conflict)\n * - `400` with an idempotency-key ProblemDetails title → key required\n * - anything else → not an idempotency signal\n */\nexport function classifyError(error: HttpErrorResponse): IdempotencyOutcome {\n switch (error.status) {\n case 409:\n return 'in-progress';\n case 422:\n return 'conflict';\n case 400: {\n const title = (error.error && (error.error.title as string)) || '';\n return /idempotency[-\\s]?key/i.test(title) ? 'required' : 'other';\n }\n default:\n return 'other';\n }\n}\n","import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { TenantService } from '../../tenant/tenant.service';\n\n/**\n * Optional provider of a user-scoped identifier (e.g. the authenticated subject)\n * folded into the idempotency key scope so keys are never reused across a user\n * switch. Kept as a token so `@juice-js/core` does not depend on `@juice-js/auth`\n * (which would introduce a circular library dependency). Applications with auth\n * provide `{ provide: IDEMPOTENCY_USER_CONTEXT, useValue: () => oauth.getIdentityClaims()?.sub ?? null }`.\n */\nexport const IDEMPOTENCY_USER_CONTEXT = new InjectionToken<() => string | null>('IDEMPOTENCY_USER_CONTEXT');\n\ninterface KeyEntry {\n key: string;\n scope: string;\n createdAt: number;\n inFlight: boolean;\n}\n\n/**\n * Generates, stores, and reuses a collision-resistant `Idempotency-Key` per\n * logical operation. The same operation id yields the same key across retries\n * and double-submits; distinct operations get distinct keys; and keys are scoped\n * to the current tenant/user so they never leak across a context switch.\n */\n@Injectable({ providedIn: 'root' })\nexport class IdempotencyKeyService {\n private readonly entries = new Map<string, KeyEntry>();\n\n constructor(\n @Optional() private readonly tenant: TenantService | null,\n @Optional() @Inject(IDEMPOTENCY_USER_CONTEXT) private readonly userContext: (() => string | null) | null,\n ) {}\n\n private currentScope(): string {\n const t = this.tenant?.currentTenant?.identifier ?? this.tenant?.requestTenantIdentifier ?? '';\n const u = this.userContext?.() ?? '';\n return `${t}|${u}`;\n }\n\n private newKey(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n // Fallback RFC4122-style generator for environments without crypto.randomUUID.\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n\n /**\n * Return the existing key for this operation, or generate a new one. If the\n * current tenant/user scope differs from the stored entry, a fresh key is\n * generated (FR-010).\n */\n getKey(operationId: string): string {\n const scope = this.currentScope();\n const existing = this.entries.get(operationId);\n if (existing && existing.scope === scope) {\n return existing.key;\n }\n const entry: KeyEntry = { key: this.newKey(), scope, createdAt: Date.now(), inFlight: false };\n this.entries.set(operationId, entry);\n return entry.key;\n }\n\n /** Forget the key for a completed (or abandoned) operation. */\n release(operationId: string): void {\n this.entries.delete(operationId);\n }\n\n /**\n * Whether the stored key for the operation has exceeded the given retry\n * horizon. Returns `false` when no horizon is set or no key exists yet.\n */\n isExpired(operationId: string, maxAgeMs: number | null | undefined): boolean {\n if (maxAgeMs == null) {\n return false;\n }\n const entry = this.entries.get(operationId);\n if (!entry) {\n return false;\n }\n return Date.now() - entry.createdAt > maxAgeMs;\n }\n\n /**\n * UI-level double-submit guard (FR-009). Returns `false` if an operation is\n * already in flight, so callers can suppress a duplicate dispatch.\n */\n tryBeginInFlight(operationId: string): boolean {\n const scope = this.currentScope();\n const entry: KeyEntry =\n this.entries.get(operationId) ?? { key: this.newKey(), scope, createdAt: Date.now(), inFlight: false };\n if (entry.inFlight) {\n return false;\n }\n entry.inFlight = true;\n this.entries.set(operationId, entry);\n return true;\n }\n\n /** Clear the in-flight flag set by {@link tryBeginInFlight}. */\n endInFlight(operationId: string): void {\n const entry = this.entries.get(operationId);\n if (entry) {\n entry.inFlight = false;\n }\n }\n}\n","import {\n HttpErrorResponse,\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable, catchError, finalize, retry, shareReplay, tap, throwError, timer } from 'rxjs';\nimport { IDEMPOTENCY_MAX_AGE_MS, IDEMPOTENCY_OPERATION } from './idempotency.context';\nimport {\n IdempotencyConflictError,\n IdempotencyExpiredError,\n IdempotencyKeyRequiredError,\n} from './idempotency.errors';\nimport { IdempotencyKeyService } from './idempotency-key.service';\nimport { classifyError } from './idempotency-response';\n\n/**\n * Attaches an `Idempotency-Key` header to opted-in state-changing requests and\n * interprets the backend idempotency responses:\n * - replayed success is passed through and the key released;\n * - `409` in-progress triggers a bounded backoff retry reusing the same key;\n * - `422` conflict and `400` required surface as typed errors without resubmission;\n * - keys past their retry horizon surface as an expired error.\n *\n * On top of the shared key, it de-duplicates concurrent dispatches of the same\n * operation (FR-009): while one attempt is in flight, a second subscription to\n * the same operation is coalesced onto the first in-flight response instead of\n * issuing a parallel request, so a double-click settles on a single outcome.\n *\n * Mirrors the `@juice-js/auth` `AuthInterceptor` idiom.\n */\n@Injectable()\nexport class IdempotencyInterceptor implements HttpInterceptor {\n private readonly maxInProgressRetries = 3;\n private readonly baseBackoffMs = 500;\n\n /**\n * Shared, in-flight response streams keyed by operation id. Present only while\n * an operation is being sent; cleared when it settles (success or error).\n */\n private readonly inFlight = new Map<string, Observable<HttpEvent<unknown>>>();\n\n constructor(private readonly keys: IdempotencyKeyService) {}\n\n private isUnsafe(method: string): boolean {\n const m = method.toUpperCase();\n return m === 'POST' || m === 'PUT' || m === 'PATCH' || m === 'DELETE';\n }\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n const operationId = req.context.get(IDEMPOTENCY_OPERATION);\n\n // Not opted in, or a safe/read-only request → pass through untouched (FR-004).\n if (!operationId || !this.isUnsafe(req.method)) {\n return next.handle(req);\n }\n\n const maxAgeMs = req.context.get(IDEMPOTENCY_MAX_AGE_MS);\n if (this.keys.isExpired(operationId, maxAgeMs)) {\n this.keys.release(operationId);\n return throwError(() => new IdempotencyExpiredError(operationId));\n }\n\n // FR-009: a duplicate dispatch while the operation is in flight rides the\n // existing response instead of firing a parallel request.\n const existing = this.inFlight.get(operationId);\n if (existing) {\n return existing;\n }\n\n const key = this.keys.getKey(operationId);\n const idempotentReq = req.clone({ headers: req.headers.set('Idempotency-Key', key) });\n\n const shared = next.handle(idempotentReq).pipe(\n retry({\n count: this.maxInProgressRetries,\n delay: (error, retryCount) => {\n // Only retry the in-progress signal; every other error propagates immediately.\n if (!(error instanceof HttpErrorResponse) || classifyError(error) !== 'in-progress') {\n throw error;\n }\n return timer(this.baseBackoffMs * Math.pow(2, retryCount - 1));\n },\n }),\n tap((event) => {\n if (event instanceof HttpResponse) {\n this.keys.release(operationId);\n }\n }),\n catchError((error: unknown) => {\n if (error instanceof HttpErrorResponse) {\n switch (classifyError(error)) {\n case 'conflict':\n this.keys.release(operationId);\n return throwError(() => new IdempotencyConflictError(operationId));\n case 'required':\n this.keys.release(operationId);\n return throwError(() => new IdempotencyKeyRequiredError());\n case 'in-progress':\n // Retries exhausted while still in progress — surface the original error,\n // keeping the key so a later manual retry can reuse it within retention.\n return throwError(() => error);\n default:\n return throwError(() => error);\n }\n }\n return throwError(() => error);\n }),\n // Drop the coalescing entry once the operation settles so the next dispatch\n // starts a fresh attempt. With refCount:false below this fires on terminal\n // success or error, not on a subscriber leaving mid-flight.\n finalize(() => this.inFlight.delete(operationId)),\n // Multicast the single attempt to every coalesced subscriber; refCount:false\n // keeps the request running even if the initial subscriber unsubscribes.\n shareReplay({ bufferSize: 1, refCount: false }),\n );\n\n this.inFlight.set(operationId, shared);\n return shared;\n }\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { IdempotencyInterceptor } from './idempotency.interceptor';\n\n/**\n * Registers the {@link IdempotencyInterceptor} so opted-in state-changing\n * requests automatically carry an `Idempotency-Key` header.\n *\n * @example\n * imports: [IdempotencyModule]\n */\n@NgModule({\n providers: [\n { provide: HTTP_INTERCEPTORS, useClass: IdempotencyInterceptor, multi: true },\n ],\n})\nexport class IdempotencyModule {}\n","/*\n * Public API Surface of core\n */\n\nexport * from './lib/tenant/tenant.service';\nexport * from './lib/tenant/tenant.module';\nexport * from './lib/tenant/tenant-info';\nexport * from './lib/menu/menu.service';\nexport * from './lib/menu/menu.module';\nexport * from './lib/menu/menu-item';\nexport * from './lib/routing/utils';\nexport * from './lib/extensions/index';\nexport * from './lib/dialog/async-dialog.service';\nexport * from './lib/http/idempotency/idempotency.context';\nexport * from './lib/http/idempotency/idempotency.errors';\nexport * from './lib/http/idempotency/idempotency-response';\nexport * from './lib/http/idempotency/idempotency-key.service';\nexport * from './lib/http/idempotency/idempotency.interceptor';\nexport * from './lib/http/idempotency/idempotency.module';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.StorageResolver","isPromise","firstValueFrom","i1.TenantService","i1.IdempotencyKeyService"],"mappings":";;;;;;;;;AAIO,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;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"juice-js-core.mjs","sources":["../../../../projects/juice-js/core/src/lib/tenant/tenant-resolver.service.ts","../../../../projects/juice-js/core/src/lib/tenant/resolvers/config-resolver.service.ts","../../../../projects/juice-js/core/src/lib/tenant/tenant.module.ts","../../../../projects/juice-js/core/src/lib/tenant/resolvers/storage-resolver.service.ts","../../../../projects/juice-js/core/src/lib/tenant/tenant.service.ts","../../../../projects/juice-js/core/src/lib/menu/utils.ts","../../../../projects/juice-js/core/src/lib/menu/menu-loader.ts","../../../../projects/juice-js/core/src/lib/menu/menu-item.ts","../../../../projects/juice-js/core/src/lib/menu/menu.service.ts","../../../../projects/juice-js/core/src/lib/menu/menu.module.ts","../../../../projects/juice-js/core/src/lib/routing/utils.ts","../../../../projects/juice-js/core/src/lib/extensions/string.extensions.ts","../../../../projects/juice-js/core/src/lib/dialog/async-dialog.service.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.context.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.errors.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency-response.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency-key.service.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.interceptor.ts","../../../../projects/juice-js/core/src/lib/http/idempotency/idempotency.module.ts","../../../../projects/juice-js/core/src/public-api.ts","../../../../projects/juice-js/core/src/juice-js-core.ts"],"sourcesContent":["import { Injectable, InjectionToken } from '@angular/core';\nimport { Observable } from 'rxjs/internal/Observable';\nimport { TenantInfo } from './tenant-info';\n\nexport const TENANT_RESOLVER = new InjectionToken<TenantResolverService[]>('TENANT_RESOLVER');\n\n@Injectable({\n providedIn: 'root'\n})\nexport abstract class TenantResolverService {\n\n priority = 0;\n abstract getTenantByIdentifier(identifier: string): Observable<TenantInfo|null>;\n}\n","\nimport { Observable } from 'rxjs';\nimport { TenantResolverService } from '../tenant-resolver.service';\nimport { TenantInfo } from '../tenant-info';\n\nexport class ConfigResolver extends TenantResolverService{\n override priority: number = 99;\n constructor(private config: TenantInfo[]){\n super();\n }\n\n getTenantByIdentifier(identifier: string): Observable<TenantInfo|null> {\n if(identifier===''){\n return new Observable(subscriber => {\n subscriber.next({identifier:''} as TenantInfo);\n subscriber.complete();\n });\n }\n const tenant = this.config.find(tenant => tenant.identifier === identifier);\n if(tenant){\n return new Observable(subscriber => {\n subscriber.next(tenant);\n subscriber.complete();\n });\n }\n return new Observable(subscriber => {\n subscriber.next(null);\n subscriber.complete();\n });\n }\n}","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { TenantService } from './tenant.service';\nimport { TENANT_RESOLVER } from './tenant-resolver.service';\nimport { ConfigResolver } from './resolvers/config-resolver.service';\nimport { StorageResolver } from './resolvers/storage-resolver.service';\nimport { TenantInfo } from './tenant-info';\n\n@NgModule({\n})\nexport class TenantModule { \n public static forRoot(tenants: TenantInfo[] = []): ModuleWithProviders<TenantModule>{\n return {\n ngModule: TenantModule,\n providers: [\n TenantService,\n {\n provide: TENANT_RESOLVER,\n useValue: new ConfigResolver(tenants),\n multi: true\n },\n {\n provide: TENANT_RESOLVER,\n useClass: StorageResolver,\n multi: true\n }\n ]\n }\n }\n}\n","\nimport { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { TenantResolverService } from '../tenant-resolver.service';\nimport { TenantModule } from '../tenant.module';\nimport { TenantInfo } from '../tenant-info';\n\n@Injectable({\n providedIn: TenantModule\n})\nexport class StorageResolver extends TenantResolverService{\n static CURRENT_TENANT = '_TENANT_';\n override priority: number = 100;\n constructor(){\n super();\n }\n\n getTenantByIdentifier(identifier: string): Observable<TenantInfo|null> {\n var currentTenant = localStorage.getItem(StorageResolver.CURRENT_TENANT);\n var tenantInfo = currentTenant ? JSON.parse(currentTenant) as TenantInfo : null;\n if(tenantInfo && tenantInfo.identifier === identifier){\n return new Observable(subscriber => {\n subscriber.next(tenantInfo);\n subscriber.complete();\n });\n }\n return new Observable(subscriber => {\n subscriber.next(null);\n subscriber.complete();\n });\n }\n\n saveTenant(tenant: TenantInfo){\n localStorage.setItem(StorageResolver.CURRENT_TENANT, JSON.stringify(tenant));\n }\n\n clearTenant(){\n localStorage.removeItem(StorageResolver.CURRENT_TENANT);\n }\n\n getCurrentTenant(): TenantInfo|null{\n var currentTenant = localStorage.getItem(StorageResolver.CURRENT_TENANT);\n return currentTenant ? JSON.parse(currentTenant) as TenantInfo : null;\n }\n}","import { Inject, Injectable, Optional, inject } from '@angular/core';\nimport { firstValueFrom } from 'rxjs/internal/firstValueFrom';\nimport { TENANT_RESOLVER, TenantResolverService } from './tenant-resolver.service';\nimport { TenantInfo } from './tenant-info';\nimport { StorageResolver } from './resolvers/storage-resolver.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class TenantService {\n currentTenant: TenantInfo|null = null;\n requestTenantIdentifier: string|null = null;\n resolvers: TenantResolverService[] = [];\n storageResolver: StorageResolver|undefined;\n constructor(\n @Optional() storageResolver: StorageResolver\n ) { \n this.resolvers = inject(TENANT_RESOLVER, {optional: true}) ?? [];\n this.storageResolver = storageResolver;\n this.currentTenant = this.storageResolver?.getCurrentTenant();\n }\n\n async getTenantIdentifier(){\n return (await this.getTenantInfo())?.identifier\n ;\n }\n\n private async getTenantByIdentifier(identifier: string): Promise<TenantInfo|null>{\n if(!this.resolvers){\n return null;\n }\n for(const resolver of this.resolvers.sort((a,b) => b.priority - a.priority)){\n // console.debug(`Resolving tenant ${identifier} by ${resolver.constructor.name}`);\n var tenant = await firstValueFrom(resolver.getTenantByIdentifier(identifier));\n if(tenant){\n tenant.resolvedBy = resolver.constructor.name;\n console.debug(`Tenant ${tenant.identifier} resolved by ${tenant.resolvedBy}`);\n if(!(resolver instanceof StorageResolver) || tenant.identifier != this.currentTenant?.identifier){\n this.storageResolver?.saveTenant(tenant);\n this.currentTenant = tenant;\n }\n return tenant;\n }\n }\n return null;\n }\n\n async getTenantInfo(): Promise<TenantInfo|null>{\n // :tenant/:module/:component\n var tenant = window.location.pathname.split('/')[1];\n this.requestTenantIdentifier = tenant;\n return (await this.getTenantByIdentifier(tenant))\n ?? this.storedTenant()\n ?? null\n ;\n }\n\n storedTenant(): TenantInfo|null|undefined{\n return this.storageResolver?.getCurrentTenant();\n }\n\n isMatched(): boolean{\n return this.currentTenant?.identifier == this.requestTenantIdentifier;\n }\n}\n","import {ɵisPromise as isPromise} from '@angular/core';\nimport {from, isObservable, Observable, of} from 'rxjs';\n\n\nexport function wrapIntoObservable<T>(value: T|Promise<T>|Observable<T>): Observable<T> {\n if (isObservable(value)) {\n return value;\n }\n \n if (isPromise(value)) {\n // Use `Promise.resolve()` to wrap promise-like instances.\n // Required ie when a Resolver returns a AngularJS `$q` promise to correctly trigger the\n // change detection.\n return from(Promise.resolve(value));\n }\n \n return of(value);\n }\n","\nimport { Injector, Type, createNgModule } from '@angular/core';\nimport { wrapIntoObservable} from './utils';\nimport { MENUS, MenuItem, Menus, CanDisplay } from './menu-item';\nimport { map } from 'rxjs/operators';\nimport { Observable, of, firstValueFrom } from 'rxjs';\nimport { ROUTES, Route } from '@angular/router';\n\nexport interface DefaultExport<T> {\n default: T;\n}\n\nexport async function loadChildren(menu: MenuItem, parentInjector: Injector, \n tenant: string|null|undefined): Promise<void>\n{\n if(menu.loaded){\n menu.injectTenant(tenant);\n return;\n }\n // console.debug(\"loadChildren\", menu.rawRouterLink);\n if(!hasChildren(menu)){\n return;\n }\n await loadChildrenInternal(menu, parentInjector, tenant)\n .then(children => {\n if(children!=null){\n console.debug(\"loadedChildren\", menu.rawRouterLink, children.map(c => c.rawRouterLink));\n menu.children = children;\n menu.injectTenant(tenant);\n }\n menu.loaded = true;\n })\n ;\n}\n\nasync function loadChildrenInternal(menu: MenuItem, parentInjector: Injector, tenant: string|null|undefined)\n: Promise<MenuItem[]>{\n \n var result: MenuItem[] = [];\n var children = await firstValueFrom(getChildren(menu, parentInjector, tenant));\n for(let child of children){\n if(hasChildren(child)){\n var sub = await loadChildrenInternal(child, parentInjector, tenant);\n // The nested group goes away and its pages take its place: they keep it out of the side menu if it was.\n if(child.inMenu === false){\n sub.forEach(s => s.inMenu = false);\n }\n if(sub.length > 0){\n result = result.concat(sub);\n }\n }else{\n result.push(child);\n }\n }\n \n return result.map(child => {\n child.rawRouterLink = menu.replaceChildRouterLink && menu.rawRouterLink ?\n ('/' + menu.rawRouterLink.trimSlash() + '/' + child.rawRouterLink.trimSlash()).trimEndSlash()\n : '/'+child.rawRouterLink.trimSlash();\n return child;\n });\n}\n\nfunction hasChildren(menu: MenuItem): boolean{\n return !((menu.children == null || menu.children.length==0) && !menu.loadChildren);\n}\n\nfunction getChildren(menu:MenuItem, parentInjector: Injector, tenant: string|null|undefined) \n : Observable<MenuItem[]>{\n if(menu.loadChildren){\n return wrapIntoObservable(menu.loadChildren())\n .pipe(\n map(t => loadMenus(t, parentInjector))\n );\n }else{\n return of(menu.children.filter(m => filterMenu(m, parentInjector)));\n }\n}\n\nfunction loadMenus(menusOrModule: Type<unknown>|Menus, parentInjector: Injector): MenuItem[] {\n \n if(Array.isArray(menusOrModule)){\n return menusOrModule.map(menu => new MenuItem(menu));\n }\n const module = createNgModule(menusOrModule, parentInjector);\n const injector = module.injector;\n const menus = injector.get(MENUS, [], {optional: true, self: true}).flat();\n const routes = injector.get(ROUTES, [], {optional: true, self: true});\n var routeMenus = mapRouteMenu(routes);\n // console.debug(\"loadMenus\", menus, routeMenus);\n return menus.map(menu => new MenuItem(menu)).concat(routeMenus)\n .filter(m => filterMenu(m, injector));\n}\n\nfunction filterMenu(menu: MenuItem, injector: Injector): boolean{\n\n if(menu.canDisplay instanceof Boolean){\n return menu.canDisplay as boolean;\n }\n const canDisplays = getCanDisplays(menu.canDisplay);\n\n return (canDisplays.length === 0 || canDisplays.every(\n (c: any) => {\n if(c instanceof Type){\n const service = injector.get<CanDisplay>(c as Type<CanDisplay>);\n return service.canDisplay();\n }else if(c instanceof Function){\n return c();\n }\n return true;\n }\n ))\n}\n\nfunction getCanDisplays(canDisplay: boolean|any[]): Array<any>{\n if(canDisplay instanceof Boolean){\n return [];\n }\n return Array.isArray(canDisplay) ? canDisplay : [];\n}\n\nexport function mapRouteMenu(routes: Route[][]): MenuItem[]{\n return routes\n .map(route => route.filter(isMenu).map(r => {\n if(!r.data){\n r.data = {};\n }\n return MenuItem.fromRoute(r);\n })\n ).flatMap(m => m.map(r => r!));\n}\n\nexport function isMenu(route: Route): boolean{\n return route.data && (route.data['menuDisplay'] || route.data['menuWrapper']);\n}\n","import { InjectionToken } from '@angular/core';\nimport { Route } from '@angular/router';\nimport { isMenu } from './menu-loader';\n\nexport class MenuItem {\n id: string = \"\";\n label: string = \"\";\n routerLink: string = \"\";\n rawRouterLink: string;\n icon: string = \"\";\n order: number = 0;\n children: MenuItem[];\n loadChildren?: Function;\n replaceChildRouterLink: boolean;\n loaded: boolean = false;\n canDisplay: any[] | boolean;\n /** False keeps the item out of the side menu; it still reaches the page switcher. */\n inMenu: boolean;\n /** Go-to keys, such as `g s`. */\n shortcut?: string;\n /**\n * Whether it was made as a group (it had children, or children to load), even if none is left for this user: a\n * group without a link has no page of its own, also once empty.\n */\n readonly grouping: boolean;\n\n constructor(menu: Menu){\n this.id = menu.id;\n this.label = menu.label;\n this.routerLink = menu.routerLink;\n this.icon = menu.icon;\n this.order = menu.order??0;\n this.children = menu.children?.map(m => new MenuItem(m))?? [];\n this.loadChildren = menu.loadChildren;\n this.replaceChildRouterLink = menu.replaceChildRouterLink ?? true;\n this.loaded = false;\n this.rawRouterLink = menu.routerLink;\n this.canDisplay = menu.canDisplay??[];\n this.inMenu = menu.inMenu ?? true;\n this.shortcut = menu.shortcut;\n this.grouping = this.children.length > 0 || !!menu.loadChildren;\n }\n\n static fromRoute(route: Route): MenuItem{\n var menu = new MenuItem({\n id: route.path ?? '',\n label: route.data!['menuTitle']??route.title??route.path??'',\n routerLink: route.path??'',\n icon: route.data!['menuIcon']??'',\n order: route.data!['menuOrder']??0,\n children: route.children?.filter(isMenu).map(r => MenuItem.fromRoute(r))??[],\n loadChildren: route.loadChildren,\n replaceChildRouterLink: true,\n canDisplay: (route.data!['menuDisplay'] as boolean | any[]),\n inMenu: route.data!['menuInMenu'],\n shortcut: route.data!['menuShortcut']\n });\n return menu;\n }\n\n hasChildren(): boolean{\n return this.children.length > 0;\n }\n\n /** The children the side menu shows: all but those marked `inMenu: false`. */\n menuChildren(): MenuItem[]{\n return (this.children ?? []).filter(c => c.inMenu !== false);\n }\n\n /**\n * Whether the item has a page of its own: a leaf does; a group does when it has a link that none of its children\n * stands for (a group linking to its first child's page has none of its own).\n */\n hasOwnPage(): boolean{\n if(!this.hasChildren()){\n // A leaf is a page ('' is the home page); a group left without children is one only if it has a link.\n return !this.grouping || !!this.rawRouterLink;\n }\n const own = this.routerLink?.trimEndSlash();\n return !!this.routerLink && !this.children.some(c => c.routerLink?.trimEndSlash() === own);\n }\n\n injectTenant(tenant: string|null|undefined){\n this.children?.forEach(item => {\n if(item.grouping){\n item.injectTenant(tenant);\n }else{\n item.routerLink = item.rawRouterLink.injectTenant(tenant);\n }\n });\n // A group without a link stays without one ('' would otherwise become '/', the home page); '/' is a link.\n this.routerLink = this.grouping && !this.rawRouterLink\n ? '' : this.rawRouterLink.injectTenant(tenant);\n }\n}\n\nexport interface Menu {\n id: string,\n label: string,\n routerLink: string,\n icon: string,\n order?: number,\n children?: Menus,\n loadChildren?: any,\n replaceChildRouterLink?: boolean,\n canDisplay?: any[] | boolean,\n /**\n * False keeps the item out of the side menu but in the page switcher (Ctrl+K): a page reached from other pages.\n * Default true.\n */\n inMenu?: boolean,\n /** Go-to keys the shell binds to the item: `g` then one letter, such as `g s`. Shown in the page switcher. */\n shortcut?: string\n}\n\nexport type Menus = Menu[];\n\nexport const MENUS = new InjectionToken<Menus[]>('MENUS');\n\nexport interface CanDisplay{\n canDisplay(): boolean;\n}","import { Injectable, Injector, inject } from '@angular/core';\nimport { MENUS, MenuItem } from './menu-item';\nimport { Observable, of } from 'rxjs';\nimport { map, mergeMap } from 'rxjs/operators';\nimport { loadChildren, mapRouteMenu } from './menu-loader';\nimport { TenantService } from '../tenant/tenant.service';\nimport { ROUTES, Route } from '@angular/router';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class MenuService {\n routes: Route[][] = [];\n constructor(private injector: Injector, private tenantService: TenantService) { \n this.routes = inject(ROUTES, {optional: true})??[];\n }\n\n getMenu():Observable<MenuItem[]>{\n var menus = this.injector.get(MENUS, [], {optional: true, self: true}).flat();\n var routeMenus = mapRouteMenu(this.routes);\n // console.debug(\"getMenu\", menus, routeMenus, this.routes);\n return of(menus)\n .pipe(\n map(menus => menus.map(m => new MenuItem(m))),\n map(async menus => {\n var tenant = await this.tenantService.getTenantIdentifier();\n let menuItems = [];\n for(let menu of menus.concat(routeMenus)){\n await loadChildren(menu, this.injector, tenant);\n menuItems.push(menu);\n }\n return menuItems;\n }),\n mergeMap(menus => menus),\n map(menus => menus.sort((a,b) => (a.order ?? 0) - (b.order ?? 0)))\n );\n }\n\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { MenuService } from './menu.service';\nimport { MENUS, Menus } from './menu-item';\n\n@NgModule({\n declarations: [\n\n ],\n imports: [\n \n ],\n exports: [\n\n ]\n})\nexport class MenuModule {\n\n /**\n * Creates and configures a module with all the menu providers.\n * Optionally sets up an application listener to perform an initial navigation.\n *\n * When registering the NgModule at the root, import as follows:\n *\n * ```\n * @NgModule({\n * imports: [MenuModule.forRoot(MENUS)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param menus An array of `Route` objects that define the navigation paths for the application.\n * @return The new `NgModule`.\n *\n */\n public static forRoot(menus: Menus): ModuleWithProviders<MenuModule> {\n \n return {\n ngModule: MenuModule,\n providers: [\n MenuService,\n {\n provide: MENUS,\n multi: true,\n useValue: menus\n }\n ]\n };\n }\n\n /**\n * Creates a module with all the menus, without creating a new Router service.\n * When registering for submodules and lazy-loaded submodules, create the NgModule as follows:\n *\n * ```\n * @NgModule({\n * imports: [MenuModule.forChild(MENUS)]\n * })\n * class MyNgModule {}\n * ```\n *\n * @param menus An array of `MenuItem` objects that define the navigation paths for the submodule.\n * @return The new NgModule.\n *\n */\n public static forChild(menus: Menus): ModuleWithProviders<MenuModule> {\n return {\n ngModule: MenuModule,\n providers: [{provide: MENUS, multi: true, useValue: menus}],\n }\n }\n \n}","import { ROUTES, Routes } from \"@angular/router\";\nimport { ModuleWithProviders, Type, createNgModule } from \"@angular/core\";\n\nexport function loadChildrenRoutes(menusOrModule: ModuleWithProviders<any>): Routes {\n \n const module = createNgModule(menusOrModule.ngModule);\n const injector = module.injector;\n const menus = injector.get(ROUTES, [], {optional: true, self: true}).flat();\n return menus;\n}","export { };\ndeclare global {\n interface String {\n trimStartSlash(): string;\n trimEndSlash(): string;\n trimSlash(): string;\n injectTenant(tenant: string|null|undefined): string;\n }\n}\nString.prototype.trimStartSlash = function (): string{\n return this.replace(/^[\\/]+/, '');\n}\nString.prototype.trimEndSlash = function (): string{\n return this.replace(/[\\/]+$/, '');\n}\nString.prototype.trimSlash = function (): string{\n return this.trimStartSlash().trimEndSlash();\n}\nString.prototype.injectTenant = function (tenant: string|null|undefined): string{\n return '/' + this.replace(':tenant', tenant??'').trimStartSlash();\n}\n","import { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { Directive } from '@angular/core';\n\n@Directive()\nexport abstract class AsyncDialog<ComponentType, DataType, ReturnType = unknown> {\n constructor(protected matDialog: MatDialog) {\n }\n\n abstract open(data: DataType): Promise<MatDialogRef<ComponentType, ReturnType>>;\n}","import { HttpContext, HttpContextToken } from '@angular/common/http';\n\n/**\n * Operation identifier that groups all HTTP attempts belonging to one logical\n * state-changing operation. Requests carrying the same operation id reuse the\n * same `Idempotency-Key` (across double-clicks and retries); a `null` value\n * means the request is not opted into idempotency.\n */\nexport const IDEMPOTENCY_OPERATION = new HttpContextToken<string | null>(() => null);\n\n/**\n * Optional client-side retry horizon (in milliseconds) that bounds how long a\n * key may be reused, mirroring the backend retention window. Past this age the\n * request is surfaced as an expired condition rather than silently treated as new.\n */\nexport const IDEMPOTENCY_MAX_AGE_MS = new HttpContextToken<number | null>(() => null);\n\n/**\n * Build (or extend) an {@link HttpContext} that opts a request into idempotency\n * for the given logical operation.\n *\n * @example\n * this.http.post('/orders', body, { context: withIdempotency('create-order-42') });\n */\nexport function withIdempotency(\n operationId: string,\n maxAgeMs?: number,\n context: HttpContext = new HttpContext(),\n): HttpContext {\n context.set(IDEMPOTENCY_OPERATION, operationId);\n if (maxAgeMs != null) {\n context.set(IDEMPOTENCY_MAX_AGE_MS, maxAgeMs);\n }\n return context;\n}\n","/**\n * Raised when the backend rejects a request because the same `Idempotency-Key`\n * was reused with a materially different payload (HTTP 422).\n */\nexport class IdempotencyConflictError extends Error {\n constructor(\n public readonly operationId: string,\n message = 'Idempotency key conflict: the same key was reused with a different payload.',\n ) {\n super(message);\n this.name = 'IdempotencyConflictError';\n }\n}\n\n/**\n * Raised when an endpoint requires an `Idempotency-Key` but none was supplied\n * (HTTP 400). Should not occur in normal client flow because the interceptor\n * always attaches a key to opted-in requests.\n */\nexport class IdempotencyKeyRequiredError extends Error {\n constructor(message = 'Idempotency-Key header is required for this request.') {\n super(message);\n this.name = 'IdempotencyKeyRequiredError';\n }\n}\n\n/**\n * Raised when a key has exceeded its client-side retry horizon and can no longer\n * be safely reused for the same operation.\n */\nexport class IdempotencyExpiredError extends Error {\n constructor(\n public readonly operationId: string,\n message = 'Idempotency key expired; the operation can no longer be safely retried with the same key.',\n ) {\n super(message);\n this.name = 'IdempotencyExpiredError';\n }\n}\n","import { HttpErrorResponse } from '@angular/common/http';\n\n/**\n * Classification of a backend response with respect to idempotency handling.\n */\nexport type IdempotencyOutcome = 'in-progress' | 'conflict' | 'required' | 'other';\n\n/**\n * Classify an {@link HttpErrorResponse} against the backend idempotency contract\n * (see the Juice backend `011-idempotency-key-api` feature):\n * - `409` → operation is still in progress (retry after backoff)\n * - `422` → key reused with a different payload (conflict)\n * - `400` with an idempotency-key ProblemDetails title → key required\n * - anything else → not an idempotency signal\n */\nexport function classifyError(error: HttpErrorResponse): IdempotencyOutcome {\n switch (error.status) {\n case 409:\n return 'in-progress';\n case 422:\n return 'conflict';\n case 400: {\n const title = (error.error && (error.error.title as string)) || '';\n return /idempotency[-\\s]?key/i.test(title) ? 'required' : 'other';\n }\n default:\n return 'other';\n }\n}\n","import { Inject, Injectable, InjectionToken, Optional } from '@angular/core';\nimport { TenantService } from '../../tenant/tenant.service';\n\n/**\n * Optional provider of a user-scoped identifier (e.g. the authenticated subject)\n * folded into the idempotency key scope so keys are never reused across a user\n * switch. Kept as a token so `@juice-js/core` does not depend on `@juice-js/auth`\n * (which would introduce a circular library dependency). Applications with auth\n * provide `{ provide: IDEMPOTENCY_USER_CONTEXT, useValue: () => oauth.getIdentityClaims()?.sub ?? null }`.\n */\nexport const IDEMPOTENCY_USER_CONTEXT = new InjectionToken<() => string | null>('IDEMPOTENCY_USER_CONTEXT');\n\ninterface KeyEntry {\n key: string;\n scope: string;\n createdAt: number;\n inFlight: boolean;\n}\n\n/**\n * Generates, stores, and reuses a collision-resistant `Idempotency-Key` per\n * logical operation. The same operation id yields the same key across retries\n * and double-submits; distinct operations get distinct keys; and keys are scoped\n * to the current tenant/user so they never leak across a context switch.\n */\n@Injectable({ providedIn: 'root' })\nexport class IdempotencyKeyService {\n private readonly entries = new Map<string, KeyEntry>();\n\n constructor(\n @Optional() private readonly tenant: TenantService | null,\n @Optional() @Inject(IDEMPOTENCY_USER_CONTEXT) private readonly userContext: (() => string | null) | null,\n ) {}\n\n private currentScope(): string {\n const t = this.tenant?.currentTenant?.identifier ?? this.tenant?.requestTenantIdentifier ?? '';\n const u = this.userContext?.() ?? '';\n return `${t}|${u}`;\n }\n\n private newKey(): string {\n if (typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID();\n }\n // Fallback RFC4122-style generator for environments without crypto.randomUUID.\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {\n const r = (Math.random() * 16) | 0;\n const v = c === 'x' ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n }\n\n /**\n * Return the existing key for this operation, or generate a new one. If the\n * current tenant/user scope differs from the stored entry, a fresh key is\n * generated (FR-010).\n */\n getKey(operationId: string): string {\n const scope = this.currentScope();\n const existing = this.entries.get(operationId);\n if (existing && existing.scope === scope) {\n return existing.key;\n }\n const entry: KeyEntry = { key: this.newKey(), scope, createdAt: Date.now(), inFlight: false };\n this.entries.set(operationId, entry);\n return entry.key;\n }\n\n /** Forget the key for a completed (or abandoned) operation. */\n release(operationId: string): void {\n this.entries.delete(operationId);\n }\n\n /**\n * Whether the stored key for the operation has exceeded the given retry\n * horizon. Returns `false` when no horizon is set or no key exists yet.\n */\n isExpired(operationId: string, maxAgeMs: number | null | undefined): boolean {\n if (maxAgeMs == null) {\n return false;\n }\n const entry = this.entries.get(operationId);\n if (!entry) {\n return false;\n }\n return Date.now() - entry.createdAt > maxAgeMs;\n }\n\n /**\n * UI-level double-submit guard (FR-009). Returns `false` if an operation is\n * already in flight, so callers can suppress a duplicate dispatch.\n */\n tryBeginInFlight(operationId: string): boolean {\n const scope = this.currentScope();\n const entry: KeyEntry =\n this.entries.get(operationId) ?? { key: this.newKey(), scope, createdAt: Date.now(), inFlight: false };\n if (entry.inFlight) {\n return false;\n }\n entry.inFlight = true;\n this.entries.set(operationId, entry);\n return true;\n }\n\n /** Clear the in-flight flag set by {@link tryBeginInFlight}. */\n endInFlight(operationId: string): void {\n const entry = this.entries.get(operationId);\n if (entry) {\n entry.inFlight = false;\n }\n }\n}\n","import {\n HttpErrorResponse,\n HttpEvent,\n HttpHandler,\n HttpInterceptor,\n HttpRequest,\n HttpResponse,\n} from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable, catchError, finalize, retry, shareReplay, tap, throwError, timer } from 'rxjs';\nimport { IDEMPOTENCY_MAX_AGE_MS, IDEMPOTENCY_OPERATION } from './idempotency.context';\nimport {\n IdempotencyConflictError,\n IdempotencyExpiredError,\n IdempotencyKeyRequiredError,\n} from './idempotency.errors';\nimport { IdempotencyKeyService } from './idempotency-key.service';\nimport { classifyError } from './idempotency-response';\n\n/**\n * Attaches an `Idempotency-Key` header to opted-in state-changing requests and\n * interprets the backend idempotency responses:\n * - replayed success is passed through and the key released;\n * - `409` in-progress triggers a bounded backoff retry reusing the same key;\n * - `422` conflict and `400` required surface as typed errors without resubmission;\n * - keys past their retry horizon surface as an expired error.\n *\n * On top of the shared key, it de-duplicates concurrent dispatches of the same\n * operation (FR-009): while one attempt is in flight, a second subscription to\n * the same operation is coalesced onto the first in-flight response instead of\n * issuing a parallel request, so a double-click settles on a single outcome.\n *\n * Mirrors the `@juice-js/auth` `AuthInterceptor` idiom.\n */\n@Injectable()\nexport class IdempotencyInterceptor implements HttpInterceptor {\n private readonly maxInProgressRetries = 3;\n private readonly baseBackoffMs = 500;\n\n /**\n * Shared, in-flight response streams keyed by operation id. Present only while\n * an operation is being sent; cleared when it settles (success or error).\n */\n private readonly inFlight = new Map<string, Observable<HttpEvent<unknown>>>();\n\n constructor(private readonly keys: IdempotencyKeyService) {}\n\n private isUnsafe(method: string): boolean {\n const m = method.toUpperCase();\n return m === 'POST' || m === 'PUT' || m === 'PATCH' || m === 'DELETE';\n }\n\n intercept(req: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {\n const operationId = req.context.get(IDEMPOTENCY_OPERATION);\n\n // Not opted in, or a safe/read-only request → pass through untouched (FR-004).\n if (!operationId || !this.isUnsafe(req.method)) {\n return next.handle(req);\n }\n\n const maxAgeMs = req.context.get(IDEMPOTENCY_MAX_AGE_MS);\n if (this.keys.isExpired(operationId, maxAgeMs)) {\n this.keys.release(operationId);\n return throwError(() => new IdempotencyExpiredError(operationId));\n }\n\n // FR-009: a duplicate dispatch while the operation is in flight rides the\n // existing response instead of firing a parallel request.\n const existing = this.inFlight.get(operationId);\n if (existing) {\n return existing;\n }\n\n const key = this.keys.getKey(operationId);\n const idempotentReq = req.clone({ headers: req.headers.set('Idempotency-Key', key) });\n\n const shared = next.handle(idempotentReq).pipe(\n retry({\n count: this.maxInProgressRetries,\n delay: (error, retryCount) => {\n // Only retry the in-progress signal; every other error propagates immediately.\n if (!(error instanceof HttpErrorResponse) || classifyError(error) !== 'in-progress') {\n throw error;\n }\n return timer(this.baseBackoffMs * Math.pow(2, retryCount - 1));\n },\n }),\n tap((event) => {\n if (event instanceof HttpResponse) {\n this.keys.release(operationId);\n }\n }),\n catchError((error: unknown) => {\n if (error instanceof HttpErrorResponse) {\n switch (classifyError(error)) {\n case 'conflict':\n this.keys.release(operationId);\n return throwError(() => new IdempotencyConflictError(operationId));\n case 'required':\n this.keys.release(operationId);\n return throwError(() => new IdempotencyKeyRequiredError());\n case 'in-progress':\n // Retries exhausted while still in progress — surface the original error,\n // keeping the key so a later manual retry can reuse it within retention.\n return throwError(() => error);\n default:\n return throwError(() => error);\n }\n }\n return throwError(() => error);\n }),\n // Drop the coalescing entry once the operation settles so the next dispatch\n // starts a fresh attempt. With refCount:false below this fires on terminal\n // success or error, not on a subscriber leaving mid-flight.\n finalize(() => this.inFlight.delete(operationId)),\n // Multicast the single attempt to every coalesced subscriber; refCount:false\n // keeps the request running even if the initial subscriber unsubscribes.\n shareReplay({ bufferSize: 1, refCount: false }),\n );\n\n this.inFlight.set(operationId, shared);\n return shared;\n }\n}\n","import { HTTP_INTERCEPTORS } from '@angular/common/http';\nimport { NgModule } from '@angular/core';\nimport { IdempotencyInterceptor } from './idempotency.interceptor';\n\n/**\n * Registers the {@link IdempotencyInterceptor} so opted-in state-changing\n * requests automatically carry an `Idempotency-Key` header.\n *\n * @example\n * imports: [IdempotencyModule]\n */\n@NgModule({\n providers: [\n { provide: HTTP_INTERCEPTORS, useClass: IdempotencyInterceptor, multi: true },\n ],\n})\nexport class IdempotencyModule {}\n","/*\n * Public API Surface of core\n */\n\nexport * from './lib/tenant/tenant.service';\nexport * from './lib/tenant/tenant.module';\nexport * from './lib/tenant/tenant-info';\nexport * from './lib/menu/menu.service';\nexport * from './lib/menu/menu.module';\nexport * from './lib/menu/menu-item';\nexport * from './lib/routing/utils';\nexport * from './lib/extensions/index';\nexport * from './lib/dialog/async-dialog.service';\nexport * from './lib/http/idempotency/idempotency.context';\nexport * from './lib/http/idempotency/idempotency.errors';\nexport * from './lib/http/idempotency/idempotency-response';\nexport * from './lib/http/idempotency/idempotency-key.service';\nexport * from './lib/http/idempotency/idempotency.interceptor';\nexport * from './lib/http/idempotency/idempotency.module';","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.StorageResolver","isPromise","firstValueFrom","i1.TenantService","i1.IdempotencyKeyService"],"mappings":";;;;;;;;;AAIO,MAAM,eAAe,GAAG,IAAI,cAAc,CAA0B,iBAAiB,CAAC;MAKvE,qBAAqB,CAAA;AAH3C,IAAA,WAAA,GAAA;QAKE,IAAA,CAAA,QAAQ,GAAG,CAAC;AAEb,IAAA;8GAJqB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cAF7B,MAAM,EAAA,CAAA,CAAA;;2FAEE,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAH1C,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE;AACb,iBAAA;;;ACHK,MAAO,cAAe,SAAQ,qBAAqB,CAAA;AAErD,IAAA,WAAA,CAAoB,MAAoB,EAAA;AACpC,QAAA,KAAK,EAAE;QADS,IAAA,CAAA,MAAM,GAAN,MAAM;QADjB,IAAA,CAAA,QAAQ,GAAW,E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jB;YACT,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE;AAC9E,SAAA,EAAA,CAAA,CAAA;;2FAEU,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,SAAS,EAAE;wBACT,EAAE,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,sBAAsB,EAAE,KAAK,EAAE,IAAI,EAAE;AAC9E,qBAAA;AACF,iBAAA;;;ACfD;;AAEG;;ACFH;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juice-js/core",
3
- "version": "2.0.2",
3
+ "version": "2.1.0-alpha.2",
4
4
  "description": "Provides a set of core services for building web applications (menu, tenant etc).",
5
5
  "author": "jack@creatorflow.io",
6
6
  "license": "MIT",
@@ -69,9 +69,25 @@ declare class MenuItem {
69
69
  replaceChildRouterLink: boolean;
70
70
  loaded: boolean;
71
71
  canDisplay: any[] | boolean;
72
+ /** False keeps the item out of the side menu; it still reaches the page switcher. */
73
+ inMenu: boolean;
74
+ /** Go-to keys, such as `g s`. */
75
+ shortcut?: string;
76
+ /**
77
+ * Whether it was made as a group (it had children, or children to load), even if none is left for this user: a
78
+ * group without a link has no page of its own, also once empty.
79
+ */
80
+ readonly grouping: boolean;
72
81
  constructor(menu: Menu);
73
82
  static fromRoute(route: Route): MenuItem;
74
83
  hasChildren(): boolean;
84
+ /** The children the side menu shows: all but those marked `inMenu: false`. */
85
+ menuChildren(): MenuItem[];
86
+ /**
87
+ * Whether the item has a page of its own: a leaf does; a group does when it has a link that none of its children
88
+ * stands for (a group linking to its first child's page has none of its own).
89
+ */
90
+ hasOwnPage(): boolean;
75
91
  injectTenant(tenant: string | null | undefined): void;
76
92
  }
77
93
  interface Menu {
@@ -84,6 +100,13 @@ interface Menu {
84
100
  loadChildren?: any;
85
101
  replaceChildRouterLink?: boolean;
86
102
  canDisplay?: any[] | boolean;
103
+ /**
104
+ * False keeps the item out of the side menu but in the page switcher (Ctrl+K): a page reached from other pages.
105
+ * Default true.
106
+ */
107
+ inMenu?: boolean;
108
+ /** Go-to keys the shell binds to the item: `g` then one letter, such as `g s`. Shown in the page switcher. */
109
+ shortcut?: string;
87
110
  }
88
111
  type Menus = Menu[];
89
112
  declare const MENUS: InjectionToken<Menus[]>;