@fhss-web-team/frontend-utils 1.4.4 → 1.5.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.
@@ -519,10 +519,7 @@ const authGuard = (route, state) => {
519
519
  };
520
520
 
521
521
  /**
522
- * A guard function to determine if a user has the required roles to access a route.
523
- *
524
- * This guard requires the use of the authGuard before it. It also requires the
525
- * route's `allowedRoles` to be defined. See the example below.
522
+ * Generates a guard function to determine if a user has the required roles to access a route.
526
523
  *
527
524
  * @example
528
525
  * ```typescript
@@ -530,20 +527,24 @@ const authGuard = (route, state) => {
530
527
  * {
531
528
  * path: 'admin',
532
529
  * component: AdminPage,
533
- * canActivate: [authGuard, roleGuard],
534
- * data: { allowedRoles: [Roles.admin] },
530
+ * canActivate: [roleGuardFactory(Roles.admin)],
535
531
  * },
536
532
  * ];
537
533
  * ```
538
534
  */
539
- const roleGuard = (route, state) => {
540
- const roles = inject(FHSS_CONFIG).roles;
541
- const authService = inject(AuthService);
542
- const router = inject(Router);
543
- const userRoles = authService.realmAccess()?.roles;
544
- const allowedRoles = route.data['allowedRoles'] ?? [];
545
- const hasRole = userRoles?.some((role) => allowedRoles.includes(roles[role])) ?? false;
546
- return hasRole || new RedirectCommand(router.parseUrl('/forbidden'));
535
+ const roleGuardFactory = (...allowedRoles) => {
536
+ return (route, state) => {
537
+ const roles = inject(FHSS_CONFIG).roles;
538
+ const authService = inject(AuthService);
539
+ const router = inject(Router);
540
+ if (!authService.authenticated()) {
541
+ authService.login(state.url);
542
+ return false;
543
+ }
544
+ const userRoles = authService.realmAccess()?.roles;
545
+ const hasRole = userRoles?.some((role) => allowedRoles.includes(roles[role])) ?? false;
546
+ return hasRole || new RedirectCommand(router.parseUrl('/forbidden'));
547
+ };
547
548
  };
548
549
 
549
550
  class AuthCallbackPage {
@@ -599,5 +600,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
599
600
  * Generated bundle index. Do not edit.
600
601
  */
601
602
 
602
- export { AuthCallbackPage, AuthErrorPage, AuthService, ByuFooterComponent, ByuHeaderComponent, FHSS_CONFIG, ForbiddenPage, NotFoundPage, UserManagementComponent, authGuard, debounced, enumToRecord, fetchSignal, provideFhss, readMaybeSignal, roleGuard };
603
+ export { AuthCallbackPage, AuthErrorPage, AuthService, ByuFooterComponent, ByuHeaderComponent, FHSS_CONFIG, ForbiddenPage, NotFoundPage, UserManagementComponent, authGuard, debounced, enumToRecord, fetchSignal, provideFhss, readMaybeSignal, roleGuardFactory };
603
604
  //# sourceMappingURL=fhss-web-team-frontend-utils.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fhss-web-team-frontend-utils.mjs","sources":["../../../projects/frontend-utils/src/lib/components/byu-footer/byu-footer.component.ts","../../../projects/frontend-utils/src/lib/components/byu-footer/byu-footer.component.html","../../../projects/frontend-utils/src/lib/config/lib.config.ts","../../../projects/frontend-utils/src/lib/services/auth/auth.service.ts","../../../projects/frontend-utils/src/lib/components/byu-header/byu-header.component.ts","../../../projects/frontend-utils/src/lib/components/byu-header/byu-header.component.html","../../../projects/frontend-utils/src/lib/signals/debounced/debounced.ts","../../../projects/frontend-utils/src/lib/signals/fetch-signal/fetch-signal.ts","../../../projects/frontend-utils/src/lib/components/user-management/user-management.service.ts","../../../projects/frontend-utils/src/lib/components/user-management/user-management.component.ts","../../../projects/frontend-utils/src/lib/components/user-management/user-management.component.html","../../../projects/frontend-utils/src/lib/config/utils.config.ts","../../../projects/frontend-utils/src/lib/guards/auth/auth.guard.ts","../../../projects/frontend-utils/src/lib/guards/role/role.guard.ts","../../../projects/frontend-utils/src/lib/pages/auth-callback/auth-callback.page.ts","../../../projects/frontend-utils/src/lib/pages/auth-callback/auth-callback.page.html","../../../projects/frontend-utils/src/lib/pages/auth-error/auth-error.page.ts","../../../projects/frontend-utils/src/lib/pages/auth-error/auth-error.page.html","../../../projects/frontend-utils/src/lib/pages/forbidden/forbidden.page.ts","../../../projects/frontend-utils/src/lib/pages/forbidden/forbidden.page.html","../../../projects/frontend-utils/src/lib/pages/not-found/not-found.page.ts","../../../projects/frontend-utils/src/lib/pages/not-found/not-found.page.html","../../../projects/frontend-utils/src/public-api.ts","../../../projects/frontend-utils/src/fhss-web-team-frontend-utils.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'byu-footer',\n imports: [],\n templateUrl: './byu-footer.component.html',\n styleUrl: './byu-footer.component.scss'\n})\nexport class ByuFooterComponent {\n currentYear: number = new Date().getFullYear(); // Automatically updates the year\n}\n","<footer>\n <p class=\"title\"><a href=\"https://www.byu.edu/\">BRIGHAM YOUNG UNIVERSITY</a></p>\n <p>Provo, UT 84602, USA | © {{ currentYear }} All rights reserved.</p>\n <p>\n <a href=\"https://privacy.byu.edu/privacy-notice\">Privacy Notice</a> |\n <a href=\"https://privacy.byu.edu/cookie-prefs\">Cookie Preferences</a>\n </p>\n</footer>\n \n\n","import { InjectionToken } from '@angular/core';\n\nexport const FHSS_CONFIG = new InjectionToken<FhssConfig>('FHSS_CONFIG');\n\nexport interface FhssConfig {\n roles: Record<string, number>;\n roleHomePages: Record<string, string>;\n}\n","import { Injectable, inject, computed } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { KEYCLOAK_EVENT_SIGNAL } from 'keycloak-angular';\nimport Keycloak, {\n KeycloakFlow,\n KeycloakResourceAccess,\n KeycloakResponseMode,\n KeycloakResponseType,\n KeycloakRoles,\n KeycloakTokenParsed,\n} from 'keycloak-js';\nimport { FHSS_CONFIG } from '../../config/lib.config';\n\n@Injectable({\n providedIn: 'root',\n})\n/**\n * AuthService provides a wrapper around the Keycloak JavaScript adapter, exposing its properties and methods\n * as Angular signals for reactive programming. It simplifies authentication, token management, and role-based access control.\n */\nexport class AuthService {\n private keycloak = inject(Keycloak);\n private keycloakSignal = inject(KEYCLOAK_EVENT_SIGNAL);\n private router = inject(Router);\n private config = inject(FHSS_CONFIG);\n\n private readonly nextUriKey = 'nextUri';\n\n /**\n * Initiates the login process. Optionally stores a route to redirect to after login.\n * @param nextUri - The route to navigate to after successful login.\n */\n login = (nextUri?: string) => {\n if (nextUri) {\n sessionStorage.setItem(this.nextUriKey, nextUri);\n }\n this.keycloak.login({\n redirectUri: window.location.origin + '/auth-callback',\n });\n };\n\n /**\n * Gets the user's role home page\n * \n * @returns the user's role home page\n */\n getRoleHomePage = () => {\n if (!this.authenticated()) return '/';\n\n const userRoles = new Set(this.realmAccess()?.roles);\n for (const role in this.config.roleHomePages) {\n if (userRoles.has(role)) {\n return this.config.roleHomePages[role];\n }\n }\n return '/';\n };\n\n /**\n * Handles user provisioning.\n *\n * @returns the uri to which the application should navigate\n */\n handleAuthCallback = async (): Promise<void> => {\n if (!this.authenticated()) {\n sessionStorage.removeItem(this.nextUriKey);\n this.router.navigate(['/']);\n return;\n }\n\n const res = await fetch('/api/auth/callback', {\n headers: { Authorization: this.bearerToken() ?? '' },\n });\n\n if (!res.ok) {\n this.logout('/auth-error');\n return;\n }\n\n const nextRoute = sessionStorage.getItem(this.nextUriKey);\n sessionStorage.removeItem(this.nextUriKey);\n\n this.router.navigate([nextRoute ?? this.getRoleHomePage()]);\n };\n\n /**\n * Logs the user out of the application.\n */\n logout = (nextUri?: string) =>\n this.keycloak.logout({\n redirectUri: window.location.origin + (nextUri ?? '/'),\n });\n\n /**\n * Signal indicating whether the user is authenticated.\n * Returns `true` if authenticated, `false` otherwise.\n */\n authenticated = computed<boolean | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.authenticated;\n });\n\n /**\n * Signal for the base64-encoded token used in the `Authorization` header.\n */\n token = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.token;\n });\n\n /**\n * Signal for the Bearer token, prefixed with \"Bearer \".\n */\n bearerToken = computed<string | undefined>(() =>\n this.token() ? 'Bearer ' + this.token() : undefined\n );\n\n /**\n * Signal for the parsed token as a JavaScript object.\n */\n tokenParsed = computed<KeycloakTokenParsed | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.tokenParsed;\n });\n\n /**\n * Signal for the user ID (Keycloak subject).\n */\n userId = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.subject;\n });\n\n /**\n * Signal for the base64-encoded ID token.\n */\n idToken = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.idToken;\n });\n\n /**\n * Signal for the parsed ID token as a JavaScript object.\n */\n idTokenParsed = computed<KeycloakTokenParsed | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.idTokenParsed;\n });\n\n /**\n * Signal for the realm roles associated with the token.\n */\n realmAccess = computed<KeycloakRoles | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.realmAccess;\n });\n\n /**\n * Signal for the resource roles associated with the token.\n */\n resourceAccess = computed<KeycloakResourceAccess | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.resourceAccess;\n });\n\n /**\n * Signal for the base64-encoded refresh token.\n */\n refreshToken = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.refreshToken;\n });\n\n /**\n * Signal for the parsed refresh token as a JavaScript object.\n */\n refreshTokenParsed = computed<KeycloakTokenParsed | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.refreshTokenParsed;\n });\n\n /**\n * Signal for the estimated time difference between the browser and Keycloak server in seconds.\n */\n timeSkew = computed<number | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.timeSkew;\n });\n\n /**\n * Signal for the response mode passed during initialization.\n */\n responseMode = computed<KeycloakResponseMode | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.responseMode;\n });\n\n /**\n * Signal for the flow type used during initialization.\n */\n flow = computed<KeycloakFlow | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.flow;\n });\n\n /**\n * Signal for the response type sent to Keycloak during login requests.\n */\n responseType = computed<KeycloakResponseType | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.responseType;\n });\n}\n","import { Component, input, inject } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { AuthService } from '../../services/auth/auth.service';\n\ntype HeaderLink = {\n text: string;\n path: string;\n};\n\n// A HeaderMenu can be either a simple link with path,\n// OR a menu group with nested items\ntype HeaderMenu = HeaderLink | {\n text: string;\n items: HeaderLink[];\n}\n\nexport type HeaderConfig = {\n title: HeaderLink;\n subtitle?: HeaderLink;\n breadcrumbs?: HeaderLink[];\n menu?: HeaderMenu[];\n}\n\n@Component({\n selector: 'byu-header',\n imports: [RouterModule],\n templateUrl: './byu-header.component.html',\n styleUrl: './byu-header.component.scss'\n})\nexport class ByuHeaderComponent {\n auth = inject(AuthService)\n config = input<HeaderConfig>();\n\n isHeaderLink(item: HeaderMenu): item is HeaderLink {\n return 'path' in item;\n }\n\n // Track which dropdown is open (null means none are open)\n openDropdownText: string | null = null;\n \n // Toggle function — if clicking the same dropdown, close it; otherwise open it\n toggleDropdown(text: string) {\n this.openDropdownText = this.openDropdownText === text ? null : text;\n }\n \n // Check if a given dropdown is currently open\n isOpen(text: string): boolean {\n return this.openDropdownText === text;\n }\n}\n","<header>\n <div class=\"top\" >\n <img class=\"logo\" src=\"/BYU_monogram_white@2x.png\" alt=\"BYU\">\n <div class=\"titles\"> \n <div class=\"breadcrumbs\">\n @for (breadcrumb of config()?.breadcrumbs; track breadcrumb.text){\n <a [href]=\"breadcrumb.path\" >{{ breadcrumb.text }}</a>\n }\n </div>\n <a [routerLink]=\"config()?.title?.path\" class=\"title\">{{ config()?.title?.text }}</a>\n <a [routerLink]=\"config()?.subtitle?.path\" class=\"subtitle\">{{ config()?.subtitle?.text }}</a>\n </div>\n <div class=\"signin\">\n <p>{{ this.auth.tokenParsed()?.['given_name'] ?? '' }}</p>\n <svg class=\"signin-icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n <path fill=\"currentcolor\" d=\"M50 95c-26 0-34-18-34-18 3-12 8-18 17-18 5 5 10 7 17 7s12-2 17-7c9 0 14 6 17 18 0 0-7 18-34 18z\"></path>\n <circle cx=\"50\" cy=\"50\" r=\"45\" fill=\"none\" stroke=\"currentcolor\" stroke-width=\"10\"></circle>\n <circle fill=\"currentcolor\" cx=\"50\" cy=\"40\" r=\"20\"></circle>\n </svg>\n @if (auth.authenticated()) {\n <a class=\"signin-link\" (click)=\"auth.logout()\">Sign Out</a>\n } @else {\n <a class=\"signin-link\" (click)=\"auth.login()\">Sign In</a>\n }\n </div>\n </div>\n <div class=\"bottom\">\n <nav>\n @for (menuItem of config()?.menu; track menuItem.text){>\n @if (isHeaderLink(menuItem)) {\n <li class = \"nav-item\">\n <a class=\"nav-item-content\" [routerLink]=\"menuItem.path\">{{ menuItem.text }}</a>\n </li>\n } @else {\n <li class=\"nav-item dropdown\" (click)=\"toggleDropdown(menuItem.text)\">\n <div class=\"nav-item-content\" >{{ menuItem.text }}</div>\n @if (openDropdownText === menuItem.text) {\n <ul class = \"dropdown-item-menu\"> \n @for(dropItem of menuItem.items; track dropItem.text){\n <li class = \"dropdown-item\">\n <a class=\"dropdown-item-content\" [routerLink]=\"dropItem.path\">{{ dropItem.text }}</a>\n </li>\n }\n </ul>\n }\n </li>\n }\n }\n </nav>\n </div>\n</header>\n","import { effect, signal, Signal } from \"@angular/core\";\n\nexport const debounced = <T>(inputSignal: Signal<T>, wait: number = 400) => {\n const debouncedSignal = signal<T>(inputSignal());\n const setSignal = debounce((value) => debouncedSignal.set(value), wait);\n\n effect(() => {\n setSignal(inputSignal())\n })\n\n return debouncedSignal;\n}\n\nconst debounce = (callback: (...args: any[]) => void, wait: number) => {\n let timeoutId: number | undefined;\n return (...args: any[]) => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(() => {\n callback(...args);\n }, wait);\n };\n}","import { computed, effect, signal, Signal } from '@angular/core';\n\n//\n// Generic utility types\n//\ntype JsonValue = string | number | boolean | null | JsonArray | JsonObject;\nexport type JsonObject = { [key: string]: JsonValue }; // this is exported because the builder's typing gets mad if it isn't\ntype JsonArray = JsonValue[];\ntype Json = JsonObject | JsonArray;\nexport type Maybe<T> = T | undefined | null;\ntype HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\ntype DefaultError = { code?: string; message?: string; details?: Json };\n\n/**\n * A value that may be a plain value of type `T` or a reactive `Signal<T>`.\n *\n * This is useful in APIs that accept either static or reactive values,\n * allowing flexibility while maintaining type safety.\n *\n * Use `unwrapSignal` to extract the underlying value in a uniform way.\n *\n * @template T The underlying value type.\n */\nexport type MaybeSignal<T> = T | Signal<T>;\n/**\n * Reads the underlying value from a MaybeSignal.\n *\n * This function is designed for use with reactive APIs (like fetchSignal) where it's important\n * that Angular's computed methods register the dependency. If the input is a Signal, invoking it\n * not only returns its current value but also tracks the signal for reactivity. If the input is\n * a plain value, it simply returns that value.\n *\n * @template T The type of the value.\n * @param value A plain value or a Signal that yields the value.\n * @returns The current value, with dependency tracking enabled if the input is a Signal.\n */\nexport function readMaybeSignal<T>(value: MaybeSignal<T>): T {\n return typeof value === 'function' ? (value as Function)() : value;\n}\n\n//\n// Fetch Request\n//\ntype FetchSignalRequest = {\n url: string;\n body?: unknown;\n params?: Record<string, string | number | boolean | undefined>;\n headers?: Record<string, string>;\n};\n\n//\n// A function that transforms the raw fetch Response to the desired type.\n//\ntype ResponseTransformer<T> = (response: Response) => Promise<T>;\n\n/**\n * Represents the reactive result of an HTTP fetch request.\n */\nexport type FetchSignal<Response, Error = DefaultError> = {\n value: Signal<Maybe<Response>>;\n persistentValue: Signal<Maybe<Response>>;\n isLoading: Signal<boolean>;\n error: Signal<Maybe<Error>>;\n statusCode: Signal<Maybe<number>>;\n headers: Signal<Maybe<Record<string, string>>>;\n refresh: (abortSignal?: AbortSignal) => void;\n};\n\n/**\n * Creates a reactive fetch signal.\n *\n * The request function can include Signals for properties. These are unwrapped in the refresh function.\n */\nfunction createFetchSignal<Response, Error>(\n request: () => FetchSignalRequest,\n method: HttpMethod,\n transform: ResponseTransformer<Response>,\n autoRefresh: Boolean,\n): FetchSignal<Response, Error> {\n // Use a computed signal so that any changes to Signals in the request object trigger updates.\n const currentRequest = computed(request);\n\n const value = signal<Maybe<Response>>(undefined);\n const persistentValue = signal<Maybe<Response>>(undefined);\n const isLoading = signal<boolean>(false);\n const error = signal<Maybe<Error>>(undefined);\n const statusCode = signal<Maybe<number>>(undefined);\n const headers = signal<Maybe<Record<string, string>>>(undefined);\n\n const refresh = async (\n abortSignal?: AbortSignal,\n keepLoadingThroughAbort?: boolean,\n ) => {\n // Reset signals for a fresh request.\n value.set(undefined);\n isLoading.set(true);\n error.set(undefined);\n statusCode.set(undefined);\n headers.set(undefined);\n\n // Unwrap the current request.\n const req = currentRequest();\n const url = req.url;\n const params = req.params;\n const requestHeaders = req.headers;\n const body = req.body;\n\n // Build URL with query parameters.\n let uri = url;\n if (params) {\n const searchParams = new URLSearchParams();\n for (const key in params) {\n if (params[key] !== undefined)\n searchParams.append(key, String(params[key]));\n }\n uri += (uri.includes('?') ? '&' : '?') + searchParams.toString();\n }\n\n try {\n const response = await fetch(uri, {\n method,\n headers: requestHeaders,\n // Only include a body if one is provided.\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: abortSignal,\n });\n\n statusCode.set(response.status);\n\n // Extract response headers.\n const headersObj: Record<string, string> = {};\n response.headers.forEach((val, key) => {\n headersObj[key] = val;\n });\n headers.set(headersObj);\n\n // if the response is ok, transform the body\n if (response.ok) {\n value.set(await transform(response));\n error.set(null);\n } else {\n // try to parse the error as json\n // set the error to null if this fails\n try {\n error.set(await response.json());\n } catch {\n error.set(null);\n } finally {\n value.set(null);\n }\n }\n } catch (err: any) {\n if (err.name === 'AbortError' && keepLoadingThroughAbort) {\n return;\n }\n error.set(null);\n value.set(null);\n }\n persistentValue.set(value());\n isLoading.set(false);\n };\n\n if (autoRefresh) {\n effect((onCleanup) => {\n // read the current request to trigger re-run of this effect\n currentRequest();\n\n // pass abort signal to refresh on cleanup of effect\n const controller = new AbortController();\n onCleanup(() => controller.abort());\n\n // call refresh with this abort controller\n refresh(controller.signal, true);\n });\n }\n\n return {\n value,\n persistentValue,\n isLoading,\n error,\n statusCode,\n headers,\n refresh,\n };\n}\n\n//\n// The chainable API factory type.\n// Note that the default fetchSignal() (and its .json, etc.) are for GET,\n// while .post, .put, .patch require a request with a body.\n// The .delete chain is similar to GET in that no body is expected.\n//\ntype FetchSignalFactory = {\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n\n get: {\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n post: {\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n put: {\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n patch: {\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n delete: {\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n};\n\n//\n// Helpers for attaching response transforms for GET/DELETE (which don’t include a body).\n//\nconst createHelper =\n <Response, Error>(\n method: HttpMethod,\n transform: ResponseTransformer<Response>,\n ) =>\n (\n request: () => FetchSignalRequest,\n autoRefresh: boolean = false,\n ): FetchSignal<Response, Error> =>\n createFetchSignal<Response, Error>(request, method, transform, autoRefresh);\n\n// Transforms\nconst jsonTransformer = (response: Response) => response.json();\nconst textTransformer = (response: Response) => response.text();\nconst blobTransformer = (response: Response) => response.blob();\nconst arrayBufferTransformer = (response: Response) => response.arrayBuffer();\n\n//\n// Build the defaults - GET chain\n//\nconst fetchSignal = createHelper('GET', jsonTransformer) as FetchSignalFactory;\nfetchSignal.json = createHelper('GET', jsonTransformer);\nfetchSignal.text = createHelper('GET', textTransformer);\nfetchSignal.blob = createHelper('GET', blobTransformer);\nfetchSignal.arrayBuffer = createHelper('GET', arrayBufferTransformer);\n\n//\n// Build the GET chain\n//\nfetchSignal.get = createHelper(\n 'GET',\n jsonTransformer,\n) as FetchSignalFactory['get'];\nfetchSignal.get.json = createHelper('GET', jsonTransformer);\nfetchSignal.get.text = createHelper('GET', textTransformer);\nfetchSignal.get.blob = createHelper('GET', blobTransformer);\nfetchSignal.get.arrayBuffer = createHelper('GET', arrayBufferTransformer);\n\n//\n// Build the POST chain.\n//\nfetchSignal.post = createHelper(\n 'POST',\n jsonTransformer,\n) as FetchSignalFactory['post'];\nfetchSignal.post.json = createHelper('POST', jsonTransformer);\nfetchSignal.post.text = createHelper('POST', textTransformer);\nfetchSignal.post.blob = createHelper('POST', blobTransformer);\nfetchSignal.post.arrayBuffer = createHelper('POST', arrayBufferTransformer);\n\n//\n// Build the PUT chain.\n//\nfetchSignal.put = createHelper(\n 'PUT',\n jsonTransformer,\n) as FetchSignalFactory['put'];\nfetchSignal.put.json = createHelper('PUT', jsonTransformer);\nfetchSignal.put.text = createHelper('PUT', textTransformer);\nfetchSignal.put.blob = createHelper('PUT', blobTransformer);\nfetchSignal.put.arrayBuffer = createHelper('PUT', arrayBufferTransformer);\n\n//\n// Build the PATCH chain.\n//\nfetchSignal.patch = createHelper(\n 'PATCH',\n jsonTransformer,\n) as FetchSignalFactory['patch'];\nfetchSignal.patch.json = createHelper('PATCH', jsonTransformer);\nfetchSignal.patch.text = createHelper('PATCH', textTransformer);\nfetchSignal.patch.blob = createHelper('PATCH', blobTransformer);\nfetchSignal.patch.arrayBuffer = createHelper('PATCH', arrayBufferTransformer);\n\n//\n// Build the DELETE chain\n//\nfetchSignal.delete = createHelper(\n 'DELETE',\n jsonTransformer,\n) as FetchSignalFactory['delete'];\nfetchSignal.delete.json = createHelper('DELETE', jsonTransformer);\nfetchSignal.delete.text = createHelper('DELETE', textTransformer);\nfetchSignal.delete.blob = createHelper('DELETE', blobTransformer);\nfetchSignal.delete.arrayBuffer = createHelper('DELETE', arrayBufferTransformer);\n\nexport { fetchSignal };\n","import { inject, Injectable, Signal } from '@angular/core';\nimport { AuthService } from '../../services/auth/auth.service';\nimport { fetchSignal } from '../../signals/fetch-signal/fetch-signal';\n\nexport type GetUsersResponse = {\n totalCount: number,\n data: {\n id: string;\n netId: string;\n accountType: string;\n preferredFirstName: string;\n preferredLastName: string;\n roles: string[];\n created: string;\n }[]\n}\n\nexport type GetUsersAccountTypes = ('NonBYU' | 'Student' | 'Employee')[]\nexport type GetUsersSortBy = 'netId' | 'accountType' | 'preferredFirstName' | 'preferredLastName' | 'created';\nexport type GetUsersSortDirection = 'asc' | 'desc' | '';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UserManagementService {\n auth = inject(AuthService);\n\n getUsers(\n search: Signal<string>,\n accountTypes: Signal<GetUsersAccountTypes>,\n sortBy: Signal<GetUsersSortBy>,\n sortDirection: Signal<GetUsersSortDirection>,\n pageCount: Signal<number>,\n pageOffset: Signal<number>,\n createdAfter?: Signal<Date>,\n createdBefore?: Signal<Date>,\n ) {\n return fetchSignal<GetUsersResponse>(() => ({\n url: '/api/user-management',\n params: {\n search: search(),\n account_types: accountTypes().join(','),\n sort_by: sortBy(),\n sort_direction: sortDirection(),\n page_count: pageCount(),\n page_offset: pageOffset(),\n created_after: createdAfter && createdAfter().toISOString(),\n created_before: createdBefore && createdBefore().toISOString(),\n },\n headers: {\n Authorization: this.auth.bearerToken() ?? ''\n }\n }), true)\n }\n}\n","import { Component, inject, signal, ViewChild } from '@angular/core';\nimport { MatTableModule } from '@angular/material/table';\nimport { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';\nimport { MatSort, MatSortModule } from '@angular/material/sort';\nimport { DatePipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { debounced } from '../../signals/debounced/debounced';\nimport { UserManagementService } from './user-management.service';\nimport { GetUsersAccountTypes, GetUsersSortBy, GetUsersSortDirection } from './user-management.types';\n\n@Component({\n selector: 'app-user-management',\n imports: [MatTableModule, MatSortModule, MatPaginatorModule, DatePipe, FormsModule, MatInputModule, MatSelectModule],\n templateUrl: './user-management.component.html',\n styleUrl: './user-management.component.scss'\n})\nexport class UserManagementComponent {\n api = inject(UserManagementService);\n\n displayedColumns: string[] = ['netId', 'preferredFirstName', 'preferredLastName', 'roles', 'accountType', 'created'];\n accountTypeOptions = ['NonBYU', 'Student', 'Employee'];\n\n @ViewChild(MatPaginator) paginator!: MatPaginator;\n @ViewChild(MatSort) sort!: MatSort;\n\n search = signal('');\n accountTypes = signal<GetUsersAccountTypes>(['NonBYU', 'Student', 'Employee']);\n sortBy = signal<GetUsersSortBy>('netId');\n sortDirection = signal<GetUsersSortDirection>('asc');\n pageCount = signal(5);\n pageOffset = signal(0);\n\n getUsers = this.api.getUsers(\n debounced(this.search),\n this.accountTypes,\n this.sortBy,\n this.sortDirection,\n this.pageCount,\n this.pageOffset\n )\n\n ngAfterViewInit() {\n // write the observables from the sort and the paging to the signals\n this.sort.sortChange.subscribe(({active, direction}) => {\n this.sortBy.set(active as GetUsersSortBy);\n this.sortDirection.set(direction);\n this.pageOffset.set(0);\n this.paginator.pageIndex = 0;\n });\n this.paginator.page.subscribe(({pageIndex, pageSize}) => {\n this.pageOffset.set(pageIndex * pageSize)\n this.pageCount.set(pageSize)\n });\n }\n}\n","<mat-form-field>\n <mat-label>Search for User</mat-label>\n <input matInput [(ngModel)]=\"search\">\n</mat-form-field>\n<mat-form-field>\n <mat-label>Account Type</mat-label>\n <mat-select multiple [(ngModel)]=\"accountTypes\">\n @for (accountType of accountTypeOptions; track accountType) {\n <mat-option [value]=\"accountType\">{{accountType}}</mat-option>\n }\n </mat-select>\n</mat-form-field>\n\n<table mat-table [dataSource]=\"getUsers.persistentValue()?.data ?? []\" matSort matSortActive=\"netId\" matSortDisableClear matSortDirection=\"asc\">\n <!-- NetID Column -->\n <ng-container matColumnDef=\"netId\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>NetID</th>\n <td mat-cell *matCellDef=\"let user\">{{user.netId}}</td>\n </ng-container>\n\n <!-- First Name Column -->\n <ng-container matColumnDef=\"preferredFirstName\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>First Name</th>\n <td mat-cell *matCellDef=\"let user\">{{user.preferredFirstName}}</td>\n </ng-container>\n\n <!-- Last Name Column -->\n <ng-container matColumnDef=\"preferredLastName\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Last Name</th>\n <td mat-cell *matCellDef=\"let user\">{{user.preferredLastName}}</td>\n </ng-container>\n\n <!-- Roles Column -->\n <ng-container matColumnDef=\"roles\">\n <th mat-header-cell *matHeaderCellDef>Roles</th>\n <td mat-cell *matCellDef=\"let user\">{{user.roles.join(', ')}}</td>\n </ng-container>\n\n <!-- Account Type Column -->\n <ng-container matColumnDef=\"accountType\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Account Type</th>\n <td mat-cell *matCellDef=\"let user\">{{user.accountType}}</td>\n </ng-container>\n\n <!-- Created Column -->\n <ng-container matColumnDef=\"created\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>\n Created\n </th>\n <td mat-cell *matCellDef=\"let user\">{{user.created | date}}</td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n\n<mat-paginator [length]=\"getUsers.persistentValue()?.totalCount\" [pageSize]=\"pageCount()\" [pageSizeOptions]=\"[5, 10, 20]\" showFirstLastButtons></mat-paginator>\n","import { Provider } from \"@angular/core\";\nimport { FHSS_CONFIG, FhssConfig } from \"./lib.config\";\n\nexport const provideFhss = (config: FhssConfig): Provider => ({\n provide: FHSS_CONFIG,\n useValue: config,\n});\n\nexport const enumToRecord = <T extends object>(enumInput: T): Record<string, number> => {\n return Object.fromEntries(Object.entries(enumInput).filter(([key, value]) => typeof value === 'number'))\n}\n","import { inject } from '@angular/core';\nimport { CanActivateFn } from '@angular/router';\nimport { AuthService } from '../../../public-api';\n\n/**\n * This guard checks if the client is authenticated, redirecting to login if not.\n */\nexport const authGuard: CanActivateFn = (route, state) => {\n const authService = inject(AuthService);\n if(!authService.authenticated()){\n authService.login(state.url);\n return false;\n }\n return true;\n};\n","import { CanActivateFn, RedirectCommand, Router } from '@angular/router';\nimport { FHSS_CONFIG } from '../../config/lib.config';\nimport { AuthService } from '../../services/auth/auth.service';\nimport { inject } from '@angular/core';\n\n/**\n * A guard function to determine if a user has the required roles to access a route.\n * \n * This guard requires the use of the authGuard before it. It also requires the \n * route's `allowedRoles` to be defined. See the example below.\n *\n * @example\n * ```typescript\n * const routes: Routes = [\n * {\n * path: 'admin',\n * component: AdminPage,\n * canActivate: [authGuard, roleGuard],\n * data: { allowedRoles: [Roles.admin] },\n * },\n * ];\n * ```\n */\nexport const roleGuard: CanActivateFn = (route, state) => {\n const roles = inject(FHSS_CONFIG).roles;\n const authService = inject(AuthService);\n const router = inject(Router);\n\n const userRoles = authService.realmAccess()?.roles;\n const allowedRoles: number[] = route.data['allowedRoles'] ?? [];\n const hasRole =\n userRoles?.some((role) => allowedRoles.includes(roles[role])) ?? false;\n\n return hasRole || new RedirectCommand(router.parseUrl('/forbidden'));\n};\n","import { Component, inject, signal } from '@angular/core';\nimport { AuthService } from '../../services/auth/auth.service';\nimport { Router } from '@angular/router';\n\n@Component({\n selector: 'app-auth-callback',\n imports: [],\n templateUrl: './auth-callback.page.html',\n styleUrl: './auth-callback.page.scss',\n})\nexport class AuthCallbackPage {\n auth = inject(AuthService)\n router = inject(Router)\n\n message = signal('Logging you in...')\n\n constructor() {\n this.auth.handleAuthCallback();\n }\n\n goHome() {\n this.router.navigate(['/'])\n }\n}\n","<div class=\"container\">\n <p>Logging you in...</p>\n</div>","import { Component } from '@angular/core';\nimport { ByuFooterComponent, ByuHeaderComponent } from '../../../public-api';\nimport { MatButtonModule } from '@angular/material/button';\n\n@Component({\n selector: 'fhss-auth-error',\n imports: [MatButtonModule, ByuHeaderComponent, ByuFooterComponent],\n templateUrl: './auth-error.page.html',\n styleUrl: './auth-error.page.scss'\n})\nexport class AuthErrorPage {\n\n}\n","<byu-header />\n\n<div class=\"container\">\n <div class=\"not-found\">\n <img src=\"/sad-duck.jpg\" alt=\"sad duck\" />\n <h1>Login Failed</h1>\n <p>Something went wrong while trying to log you in.</p>\n <a mat-flat-button href=\"/\">Go back to home</a>\n </div>\n</div>\n\n<byu-footer />\n","import { Component } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ByuFooterComponent, ByuHeaderComponent } from '../../../public-api';\n\n@Component({\n selector: 'fhss-forbidden',\n imports: [MatButtonModule, ByuHeaderComponent, ByuFooterComponent],\n templateUrl: './forbidden.page.html',\n styleUrl: './forbidden.page.scss',\n})\nexport class ForbiddenPage {}\n","<byu-header />\n\n<div class=\"container\">\n <div class=\"not-found\">\n <img src=\"/police-duck.jpg\" alt=\"\" />\n <h1>403 - Forbidden</h1>\n <p>You don't have permission to access this page.</p>\n <a mat-flat-button href=\"/\">Go back to home</a>\n </div>\n</div>\n\n<byu-footer />\n","import { Component } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ByuFooterComponent, ByuHeaderComponent } from '../../../public-api';\n\n@Component({\n selector: 'fhss-not-found',\n imports: [MatButtonModule, ByuHeaderComponent, ByuFooterComponent],\n templateUrl: './not-found.page.html',\n styleUrl: './not-found.page.scss',\n})\nexport class NotFoundPage {}\n","<byu-header />\n\n<div class=\"container\">\n <div class=\"not-found\">\n <img src=\"/confused-duck.png\" alt=\"\" />\n <h1>404 - Page not found</h1>\n <p>The page you are looking for doesn't exist or it may have moved.</p>\n <a mat-flat-button href=\"/\">Go back to home</a>\n </div>\n</div>\n\n<byu-footer />\n","/**\n * Components\n */\nexport * from './lib/components/byu-footer/byu-footer.component'\nexport * from './lib/components/byu-header/byu-header.component'\nexport * from './lib/components/user-management/user-management.component'\n\n/**\n * Config\n */\nexport * from './lib/config/lib.config'\nexport * from './lib/config/utils.config'\n\n/**\n * Guards\n */\nexport * from './lib/guards/auth/auth.guard'\nexport * from './lib/guards/role/role.guard'\n\n/**\n * Pages\n */\nexport * from './lib/pages/auth-callback/auth-callback.page'\nexport * from './lib/pages/auth-error/auth-error.page'\nexport * from './lib/pages/forbidden/forbidden.page'\nexport * from './lib/pages/not-found/not-found.page'\n\n/**\n * Services\n */\nexport * from './lib/services/auth/auth.service'\n\n/**\n * Signals\n */\nexport * from './lib/signals/fetch-signal/fetch-signal'\nexport * from './lib/signals/debounced/debounced'","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAQa,kBAAkB,CAAA;IAC7B,WAAW,GAAW,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;wGADpC,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,sECR/B,6WAUA,EAAA,MAAA,EAAA,CAAA,+cAAA,CAAA,EAAA,CAAA;;4FDFa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAN9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,WACb,EAAE,EAAA,QAAA,EAAA,6WAAA,EAAA,MAAA,EAAA,CAAA,+cAAA,CAAA,EAAA;;;MEFA,WAAW,GAAG,IAAI,cAAc,CAAa,aAAa;;ACcvE;;;AAGG;MACU,WAAW,CAAA;AACd,IAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,IAAA,cAAc,GAAG,MAAM,CAAC,qBAAqB,CAAC;AAC9C,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC;IAEnB,UAAU,GAAG,SAAS;AAEvC;;;AAGG;AACH,IAAA,KAAK,GAAG,CAAC,OAAgB,KAAI;QAC3B,IAAI,OAAO,EAAE;YACX,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC;;AAElD,Q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kB,EAAA,QAAA,EAAA,YAAA,EAAA,CAAA,EAAA,CAAA;;4FAItD,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,WACjB,CAAC,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,wUAAA,EAAA,MAAA,EAAA,CAAA,8LAAA,CAAA,EAAA;;;AENpE;;AAEG;;ACFH;;AAEG;;;;"}
1
+ {"version":3,"file":"fhss-web-team-frontend-utils.mjs","sources":["../../../projects/frontend-utils/src/lib/components/byu-footer/byu-footer.component.ts","../../../projects/frontend-utils/src/lib/components/byu-footer/byu-footer.component.html","../../../projects/frontend-utils/src/lib/config/lib.config.ts","../../../projects/frontend-utils/src/lib/services/auth/auth.service.ts","../../../projects/frontend-utils/src/lib/components/byu-header/byu-header.component.ts","../../../projects/frontend-utils/src/lib/components/byu-header/byu-header.component.html","../../../projects/frontend-utils/src/lib/signals/debounced/debounced.ts","../../../projects/frontend-utils/src/lib/signals/fetch-signal/fetch-signal.ts","../../../projects/frontend-utils/src/lib/components/user-management/user-management.service.ts","../../../projects/frontend-utils/src/lib/components/user-management/user-management.component.ts","../../../projects/frontend-utils/src/lib/components/user-management/user-management.component.html","../../../projects/frontend-utils/src/lib/config/utils.config.ts","../../../projects/frontend-utils/src/lib/guards/auth/auth.guard.ts","../../../projects/frontend-utils/src/lib/guards/role/role.guard.ts","../../../projects/frontend-utils/src/lib/pages/auth-callback/auth-callback.page.ts","../../../projects/frontend-utils/src/lib/pages/auth-callback/auth-callback.page.html","../../../projects/frontend-utils/src/lib/pages/auth-error/auth-error.page.ts","../../../projects/frontend-utils/src/lib/pages/auth-error/auth-error.page.html","../../../projects/frontend-utils/src/lib/pages/forbidden/forbidden.page.ts","../../../projects/frontend-utils/src/lib/pages/forbidden/forbidden.page.html","../../../projects/frontend-utils/src/lib/pages/not-found/not-found.page.ts","../../../projects/frontend-utils/src/lib/pages/not-found/not-found.page.html","../../../projects/frontend-utils/src/public-api.ts","../../../projects/frontend-utils/src/fhss-web-team-frontend-utils.ts"],"sourcesContent":["import { Component } from '@angular/core';\n\n@Component({\n selector: 'byu-footer',\n imports: [],\n templateUrl: './byu-footer.component.html',\n styleUrl: './byu-footer.component.scss'\n})\nexport class ByuFooterComponent {\n currentYear: number = new Date().getFullYear(); // Automatically updates the year\n}\n","<footer>\n <p class=\"title\"><a href=\"https://www.byu.edu/\">BRIGHAM YOUNG UNIVERSITY</a></p>\n <p>Provo, UT 84602, USA | © {{ currentYear }} All rights reserved.</p>\n <p>\n <a href=\"https://privacy.byu.edu/privacy-notice\">Privacy Notice</a> |\n <a href=\"https://privacy.byu.edu/cookie-prefs\">Cookie Preferences</a>\n </p>\n</footer>\n \n\n","import { InjectionToken } from '@angular/core';\n\nexport const FHSS_CONFIG = new InjectionToken<FhssConfig>('FHSS_CONFIG');\n\nexport interface FhssConfig {\n roles: Record<string, number>;\n roleHomePages: Record<string, string>;\n}\n","import { Injectable, inject, computed } from '@angular/core';\nimport { Router } from '@angular/router';\nimport { KEYCLOAK_EVENT_SIGNAL } from 'keycloak-angular';\nimport Keycloak, {\n KeycloakFlow,\n KeycloakResourceAccess,\n KeycloakResponseMode,\n KeycloakResponseType,\n KeycloakRoles,\n KeycloakTokenParsed,\n} from 'keycloak-js';\nimport { FHSS_CONFIG } from '../../config/lib.config';\n\n@Injectable({\n providedIn: 'root',\n})\n/**\n * AuthService provides a wrapper around the Keycloak JavaScript adapter, exposing its properties and methods\n * as Angular signals for reactive programming. It simplifies authentication, token management, and role-based access control.\n */\nexport class AuthService {\n private keycloak = inject(Keycloak);\n private keycloakSignal = inject(KEYCLOAK_EVENT_SIGNAL);\n private router = inject(Router);\n private config = inject(FHSS_CONFIG);\n\n private readonly nextUriKey = 'nextUri';\n\n /**\n * Initiates the login process. Optionally stores a route to redirect to after login.\n * @param nextUri - The route to navigate to after successful login.\n */\n login = (nextUri?: string) => {\n if (nextUri) {\n sessionStorage.setItem(this.nextUriKey, nextUri);\n }\n this.keycloak.login({\n redirectUri: window.location.origin + '/auth-callback',\n });\n };\n\n /**\n * Gets the user's role home page\n * \n * @returns the user's role home page\n */\n getRoleHomePage = () => {\n if (!this.authenticated()) return '/';\n\n const userRoles = new Set(this.realmAccess()?.roles);\n for (const role in this.config.roleHomePages) {\n if (userRoles.has(role)) {\n return this.config.roleHomePages[role];\n }\n }\n return '/';\n };\n\n /**\n * Handles user provisioning.\n *\n * @returns the uri to which the application should navigate\n */\n handleAuthCallback = async (): Promise<void> => {\n if (!this.authenticated()) {\n sessionStorage.removeItem(this.nextUriKey);\n this.router.navigate(['/']);\n return;\n }\n\n const res = await fetch('/api/auth/callback', {\n headers: { Authorization: this.bearerToken() ?? '' },\n });\n\n if (!res.ok) {\n this.logout('/auth-error');\n return;\n }\n\n const nextRoute = sessionStorage.getItem(this.nextUriKey);\n sessionStorage.removeItem(this.nextUriKey);\n\n this.router.navigate([nextRoute ?? this.getRoleHomePage()]);\n };\n\n /**\n * Logs the user out of the application.\n */\n logout = (nextUri?: string) =>\n this.keycloak.logout({\n redirectUri: window.location.origin + (nextUri ?? '/'),\n });\n\n /**\n * Signal indicating whether the user is authenticated.\n * Returns `true` if authenticated, `false` otherwise.\n */\n authenticated = computed<boolean | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.authenticated;\n });\n\n /**\n * Signal for the base64-encoded token used in the `Authorization` header.\n */\n token = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.token;\n });\n\n /**\n * Signal for the Bearer token, prefixed with \"Bearer \".\n */\n bearerToken = computed<string | undefined>(() =>\n this.token() ? 'Bearer ' + this.token() : undefined\n );\n\n /**\n * Signal for the parsed token as a JavaScript object.\n */\n tokenParsed = computed<KeycloakTokenParsed | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.tokenParsed;\n });\n\n /**\n * Signal for the user ID (Keycloak subject).\n */\n userId = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.subject;\n });\n\n /**\n * Signal for the base64-encoded ID token.\n */\n idToken = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.idToken;\n });\n\n /**\n * Signal for the parsed ID token as a JavaScript object.\n */\n idTokenParsed = computed<KeycloakTokenParsed | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.idTokenParsed;\n });\n\n /**\n * Signal for the realm roles associated with the token.\n */\n realmAccess = computed<KeycloakRoles | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.realmAccess;\n });\n\n /**\n * Signal for the resource roles associated with the token.\n */\n resourceAccess = computed<KeycloakResourceAccess | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.resourceAccess;\n });\n\n /**\n * Signal for the base64-encoded refresh token.\n */\n refreshToken = computed<string | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.refreshToken;\n });\n\n /**\n * Signal for the parsed refresh token as a JavaScript object.\n */\n refreshTokenParsed = computed<KeycloakTokenParsed | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.refreshTokenParsed;\n });\n\n /**\n * Signal for the estimated time difference between the browser and Keycloak server in seconds.\n */\n timeSkew = computed<number | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.timeSkew;\n });\n\n /**\n * Signal for the response mode passed during initialization.\n */\n responseMode = computed<KeycloakResponseMode | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.responseMode;\n });\n\n /**\n * Signal for the flow type used during initialization.\n */\n flow = computed<KeycloakFlow | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.flow;\n });\n\n /**\n * Signal for the response type sent to Keycloak during login requests.\n */\n responseType = computed<KeycloakResponseType | undefined>(() => {\n this.keycloakSignal();\n return this.keycloak.responseType;\n });\n}\n","import { Component, input, inject } from '@angular/core';\nimport { RouterModule } from '@angular/router';\nimport { AuthService } from '../../services/auth/auth.service';\n\ntype HeaderLink = {\n text: string;\n path: string;\n};\n\n// A HeaderMenu can be either a simple link with path,\n// OR a menu group with nested items\ntype HeaderMenu = HeaderLink | {\n text: string;\n items: HeaderLink[];\n}\n\nexport type HeaderConfig = {\n title: HeaderLink;\n subtitle?: HeaderLink;\n breadcrumbs?: HeaderLink[];\n menu?: HeaderMenu[];\n}\n\n@Component({\n selector: 'byu-header',\n imports: [RouterModule],\n templateUrl: './byu-header.component.html',\n styleUrl: './byu-header.component.scss'\n})\nexport class ByuHeaderComponent {\n auth = inject(AuthService)\n config = input<HeaderConfig>();\n\n isHeaderLink(item: HeaderMenu): item is HeaderLink {\n return 'path' in item;\n }\n\n // Track which dropdown is open (null means none are open)\n openDropdownText: string | null = null;\n \n // Toggle function — if clicking the same dropdown, close it; otherwise open it\n toggleDropdown(text: string) {\n this.openDropdownText = this.openDropdownText === text ? null : text;\n }\n \n // Check if a given dropdown is currently open\n isOpen(text: string): boolean {\n return this.openDropdownText === text;\n }\n}\n","<header>\n <div class=\"top\" >\n <img class=\"logo\" src=\"/BYU_monogram_white@2x.png\" alt=\"BYU\">\n <div class=\"titles\"> \n <div class=\"breadcrumbs\">\n @for (breadcrumb of config()?.breadcrumbs; track breadcrumb.text){\n <a [href]=\"breadcrumb.path\" >{{ breadcrumb.text }}</a>\n }\n </div>\n <a [routerLink]=\"config()?.title?.path\" class=\"title\">{{ config()?.title?.text }}</a>\n <a [routerLink]=\"config()?.subtitle?.path\" class=\"subtitle\">{{ config()?.subtitle?.text }}</a>\n </div>\n <div class=\"signin\">\n <p>{{ this.auth.tokenParsed()?.['given_name'] ?? '' }}</p>\n <svg class=\"signin-icon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 100 100\">\n <path fill=\"currentcolor\" d=\"M50 95c-26 0-34-18-34-18 3-12 8-18 17-18 5 5 10 7 17 7s12-2 17-7c9 0 14 6 17 18 0 0-7 18-34 18z\"></path>\n <circle cx=\"50\" cy=\"50\" r=\"45\" fill=\"none\" stroke=\"currentcolor\" stroke-width=\"10\"></circle>\n <circle fill=\"currentcolor\" cx=\"50\" cy=\"40\" r=\"20\"></circle>\n </svg>\n @if (auth.authenticated()) {\n <a class=\"signin-link\" (click)=\"auth.logout()\">Sign Out</a>\n } @else {\n <a class=\"signin-link\" (click)=\"auth.login()\">Sign In</a>\n }\n </div>\n </div>\n <div class=\"bottom\">\n <nav>\n @for (menuItem of config()?.menu; track menuItem.text){>\n @if (isHeaderLink(menuItem)) {\n <li class = \"nav-item\">\n <a class=\"nav-item-content\" [routerLink]=\"menuItem.path\">{{ menuItem.text }}</a>\n </li>\n } @else {\n <li class=\"nav-item dropdown\" (click)=\"toggleDropdown(menuItem.text)\">\n <div class=\"nav-item-content\" >{{ menuItem.text }}</div>\n @if (openDropdownText === menuItem.text) {\n <ul class = \"dropdown-item-menu\"> \n @for(dropItem of menuItem.items; track dropItem.text){\n <li class = \"dropdown-item\">\n <a class=\"dropdown-item-content\" [routerLink]=\"dropItem.path\">{{ dropItem.text }}</a>\n </li>\n }\n </ul>\n }\n </li>\n }\n }\n </nav>\n </div>\n</header>\n","import { effect, signal, Signal } from \"@angular/core\";\n\nexport const debounced = <T>(inputSignal: Signal<T>, wait: number = 400) => {\n const debouncedSignal = signal<T>(inputSignal());\n const setSignal = debounce((value) => debouncedSignal.set(value), wait);\n\n effect(() => {\n setSignal(inputSignal())\n })\n\n return debouncedSignal;\n}\n\nconst debounce = (callback: (...args: any[]) => void, wait: number) => {\n let timeoutId: number | undefined;\n return (...args: any[]) => {\n window.clearTimeout(timeoutId);\n timeoutId = window.setTimeout(() => {\n callback(...args);\n }, wait);\n };\n}","import { computed, effect, signal, Signal } from '@angular/core';\n\n//\n// Generic utility types\n//\ntype JsonValue = string | number | boolean | null | JsonArray | JsonObject;\nexport type JsonObject = { [key: string]: JsonValue }; // this is exported because the builder's typing gets mad if it isn't\ntype JsonArray = JsonValue[];\ntype Json = JsonObject | JsonArray;\nexport type Maybe<T> = T | undefined | null;\ntype HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\ntype DefaultError = { code?: string; message?: string; details?: Json };\n\n/**\n * A value that may be a plain value of type `T` or a reactive `Signal<T>`.\n *\n * This is useful in APIs that accept either static or reactive values,\n * allowing flexibility while maintaining type safety.\n *\n * Use `unwrapSignal` to extract the underlying value in a uniform way.\n *\n * @template T The underlying value type.\n */\nexport type MaybeSignal<T> = T | Signal<T>;\n/**\n * Reads the underlying value from a MaybeSignal.\n *\n * This function is designed for use with reactive APIs (like fetchSignal) where it's important\n * that Angular's computed methods register the dependency. If the input is a Signal, invoking it\n * not only returns its current value but also tracks the signal for reactivity. If the input is\n * a plain value, it simply returns that value.\n *\n * @template T The type of the value.\n * @param value A plain value or a Signal that yields the value.\n * @returns The current value, with dependency tracking enabled if the input is a Signal.\n */\nexport function readMaybeSignal<T>(value: MaybeSignal<T>): T {\n return typeof value === 'function' ? (value as Function)() : value;\n}\n\n//\n// Fetch Request\n//\ntype FetchSignalRequest = {\n url: string;\n body?: unknown;\n params?: Record<string, string | number | boolean | undefined>;\n headers?: Record<string, string>;\n};\n\n//\n// A function that transforms the raw fetch Response to the desired type.\n//\ntype ResponseTransformer<T> = (response: Response) => Promise<T>;\n\n/**\n * Represents the reactive result of an HTTP fetch request.\n */\nexport type FetchSignal<Response, Error = DefaultError> = {\n value: Signal<Maybe<Response>>;\n persistentValue: Signal<Maybe<Response>>;\n isLoading: Signal<boolean>;\n error: Signal<Maybe<Error>>;\n statusCode: Signal<Maybe<number>>;\n headers: Signal<Maybe<Record<string, string>>>;\n refresh: (abortSignal?: AbortSignal) => void;\n};\n\n/**\n * Creates a reactive fetch signal.\n *\n * The request function can include Signals for properties. These are unwrapped in the refresh function.\n */\nfunction createFetchSignal<Response, Error>(\n request: () => FetchSignalRequest,\n method: HttpMethod,\n transform: ResponseTransformer<Response>,\n autoRefresh: Boolean,\n): FetchSignal<Response, Error> {\n // Use a computed signal so that any changes to Signals in the request object trigger updates.\n const currentRequest = computed(request);\n\n const value = signal<Maybe<Response>>(undefined);\n const persistentValue = signal<Maybe<Response>>(undefined);\n const isLoading = signal<boolean>(false);\n const error = signal<Maybe<Error>>(undefined);\n const statusCode = signal<Maybe<number>>(undefined);\n const headers = signal<Maybe<Record<string, string>>>(undefined);\n\n const refresh = async (\n abortSignal?: AbortSignal,\n keepLoadingThroughAbort?: boolean,\n ) => {\n // Reset signals for a fresh request.\n value.set(undefined);\n isLoading.set(true);\n error.set(undefined);\n statusCode.set(undefined);\n headers.set(undefined);\n\n // Unwrap the current request.\n const req = currentRequest();\n const url = req.url;\n const params = req.params;\n const requestHeaders = req.headers;\n const body = req.body;\n\n // Build URL with query parameters.\n let uri = url;\n if (params) {\n const searchParams = new URLSearchParams();\n for (const key in params) {\n if (params[key] !== undefined)\n searchParams.append(key, String(params[key]));\n }\n uri += (uri.includes('?') ? '&' : '?') + searchParams.toString();\n }\n\n try {\n const response = await fetch(uri, {\n method,\n headers: requestHeaders,\n // Only include a body if one is provided.\n body: body !== undefined ? JSON.stringify(body) : undefined,\n signal: abortSignal,\n });\n\n statusCode.set(response.status);\n\n // Extract response headers.\n const headersObj: Record<string, string> = {};\n response.headers.forEach((val, key) => {\n headersObj[key] = val;\n });\n headers.set(headersObj);\n\n // if the response is ok, transform the body\n if (response.ok) {\n value.set(await transform(response));\n error.set(null);\n } else {\n // try to parse the error as json\n // set the error to null if this fails\n try {\n error.set(await response.json());\n } catch {\n error.set(null);\n } finally {\n value.set(null);\n }\n }\n } catch (err: any) {\n if (err.name === 'AbortError' && keepLoadingThroughAbort) {\n return;\n }\n error.set(null);\n value.set(null);\n }\n persistentValue.set(value());\n isLoading.set(false);\n };\n\n if (autoRefresh) {\n effect((onCleanup) => {\n // read the current request to trigger re-run of this effect\n currentRequest();\n\n // pass abort signal to refresh on cleanup of effect\n const controller = new AbortController();\n onCleanup(() => controller.abort());\n\n // call refresh with this abort controller\n refresh(controller.signal, true);\n });\n }\n\n return {\n value,\n persistentValue,\n isLoading,\n error,\n statusCode,\n headers,\n refresh,\n };\n}\n\n//\n// The chainable API factory type.\n// Note that the default fetchSignal() (and its .json, etc.) are for GET,\n// while .post, .put, .patch require a request with a body.\n// The .delete chain is similar to GET in that no body is expected.\n//\ntype FetchSignalFactory = {\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n\n get: {\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP GET request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP GET request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n post: {\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP POST request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP POST request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n put: {\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP PUT request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PUT request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n patch: {\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP PATCH request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP PATCH request, which must include a body.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n\n delete: {\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object containing reactive signals for the response data, loading state, status code, error, headers, and a refresh method.\n */\n <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ): FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as JSON.\n *\n * @template Response - The expected response type.\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the JSON-parsed response.\n */\n json: <Response extends Json, Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Response, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as plain text.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the text response.\n */\n text: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<string, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as a Blob.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the Blob response.\n */\n blob: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<Blob, Error>;\n\n /**\n * Initiates a reactive HTTP DELETE request using the provided request configuration and parses the response as an ArrayBuffer.\n *\n * @template Error - The expected error shape (defaults to `DefaultError`).\n * @param request - The configuration object for the HTTP DELETE request.\n * @param autoRefresh - whether or not the request should be automatically refreshed when the request input signals have changed value\n * @returns A `FetchSignal` object with the ArrayBuffer response.\n */\n arrayBuffer: <Error extends Json = DefaultError>(\n request: () => FetchSignalRequest,\n autoRefresh?: boolean,\n ) => FetchSignal<ArrayBuffer, Error>;\n };\n};\n\n//\n// Helpers for attaching response transforms for GET/DELETE (which don’t include a body).\n//\nconst createHelper =\n <Response, Error>(\n method: HttpMethod,\n transform: ResponseTransformer<Response>,\n ) =>\n (\n request: () => FetchSignalRequest,\n autoRefresh: boolean = false,\n ): FetchSignal<Response, Error> =>\n createFetchSignal<Response, Error>(request, method, transform, autoRefresh);\n\n// Transforms\nconst jsonTransformer = (response: Response) => response.json();\nconst textTransformer = (response: Response) => response.text();\nconst blobTransformer = (response: Response) => response.blob();\nconst arrayBufferTransformer = (response: Response) => response.arrayBuffer();\n\n//\n// Build the defaults - GET chain\n//\nconst fetchSignal = createHelper('GET', jsonTransformer) as FetchSignalFactory;\nfetchSignal.json = createHelper('GET', jsonTransformer);\nfetchSignal.text = createHelper('GET', textTransformer);\nfetchSignal.blob = createHelper('GET', blobTransformer);\nfetchSignal.arrayBuffer = createHelper('GET', arrayBufferTransformer);\n\n//\n// Build the GET chain\n//\nfetchSignal.get = createHelper(\n 'GET',\n jsonTransformer,\n) as FetchSignalFactory['get'];\nfetchSignal.get.json = createHelper('GET', jsonTransformer);\nfetchSignal.get.text = createHelper('GET', textTransformer);\nfetchSignal.get.blob = createHelper('GET', blobTransformer);\nfetchSignal.get.arrayBuffer = createHelper('GET', arrayBufferTransformer);\n\n//\n// Build the POST chain.\n//\nfetchSignal.post = createHelper(\n 'POST',\n jsonTransformer,\n) as FetchSignalFactory['post'];\nfetchSignal.post.json = createHelper('POST', jsonTransformer);\nfetchSignal.post.text = createHelper('POST', textTransformer);\nfetchSignal.post.blob = createHelper('POST', blobTransformer);\nfetchSignal.post.arrayBuffer = createHelper('POST', arrayBufferTransformer);\n\n//\n// Build the PUT chain.\n//\nfetchSignal.put = createHelper(\n 'PUT',\n jsonTransformer,\n) as FetchSignalFactory['put'];\nfetchSignal.put.json = createHelper('PUT', jsonTransformer);\nfetchSignal.put.text = createHelper('PUT', textTransformer);\nfetchSignal.put.blob = createHelper('PUT', blobTransformer);\nfetchSignal.put.arrayBuffer = createHelper('PUT', arrayBufferTransformer);\n\n//\n// Build the PATCH chain.\n//\nfetchSignal.patch = createHelper(\n 'PATCH',\n jsonTransformer,\n) as FetchSignalFactory['patch'];\nfetchSignal.patch.json = createHelper('PATCH', jsonTransformer);\nfetchSignal.patch.text = createHelper('PATCH', textTransformer);\nfetchSignal.patch.blob = createHelper('PATCH', blobTransformer);\nfetchSignal.patch.arrayBuffer = createHelper('PATCH', arrayBufferTransformer);\n\n//\n// Build the DELETE chain\n//\nfetchSignal.delete = createHelper(\n 'DELETE',\n jsonTransformer,\n) as FetchSignalFactory['delete'];\nfetchSignal.delete.json = createHelper('DELETE', jsonTransformer);\nfetchSignal.delete.text = createHelper('DELETE', textTransformer);\nfetchSignal.delete.blob = createHelper('DELETE', blobTransformer);\nfetchSignal.delete.arrayBuffer = createHelper('DELETE', arrayBufferTransformer);\n\nexport { fetchSignal };\n","import { inject, Injectable, Signal } from '@angular/core';\nimport { AuthService } from '../../services/auth/auth.service';\nimport { fetchSignal } from '../../signals/fetch-signal/fetch-signal';\n\nexport type GetUsersResponse = {\n totalCount: number,\n data: {\n id: string;\n netId: string;\n accountType: string;\n preferredFirstName: string;\n preferredLastName: string;\n roles: string[];\n created: string;\n }[]\n}\n\nexport type GetUsersAccountTypes = ('NonBYU' | 'Student' | 'Employee')[]\nexport type GetUsersSortBy = 'netId' | 'accountType' | 'preferredFirstName' | 'preferredLastName' | 'created';\nexport type GetUsersSortDirection = 'asc' | 'desc' | '';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class UserManagementService {\n auth = inject(AuthService);\n\n getUsers(\n search: Signal<string>,\n accountTypes: Signal<GetUsersAccountTypes>,\n sortBy: Signal<GetUsersSortBy>,\n sortDirection: Signal<GetUsersSortDirection>,\n pageCount: Signal<number>,\n pageOffset: Signal<number>,\n createdAfter?: Signal<Date>,\n createdBefore?: Signal<Date>,\n ) {\n return fetchSignal<GetUsersResponse>(() => ({\n url: '/api/user-management',\n params: {\n search: search(),\n account_types: accountTypes().join(','),\n sort_by: sortBy(),\n sort_direction: sortDirection(),\n page_count: pageCount(),\n page_offset: pageOffset(),\n created_after: createdAfter && createdAfter().toISOString(),\n created_before: createdBefore && createdBefore().toISOString(),\n },\n headers: {\n Authorization: this.auth.bearerToken() ?? ''\n }\n }), true)\n }\n}\n","import { Component, inject, signal, ViewChild } from '@angular/core';\nimport { MatTableModule } from '@angular/material/table';\nimport { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';\nimport { MatSort, MatSortModule } from '@angular/material/sort';\nimport { DatePipe } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatSelectModule } from '@angular/material/select';\nimport { debounced } from '../../signals/debounced/debounced';\nimport { UserManagementService } from './user-management.service';\nimport { GetUsersAccountTypes, GetUsersSortBy, GetUsersSortDirection } from './user-management.types';\n\n@Component({\n selector: 'app-user-management',\n imports: [MatTableModule, MatSortModule, MatPaginatorModule, DatePipe, FormsModule, MatInputModule, MatSelectModule],\n templateUrl: './user-management.component.html',\n styleUrl: './user-management.component.scss'\n})\nexport class UserManagementComponent {\n api = inject(UserManagementService);\n\n displayedColumns: string[] = ['netId', 'preferredFirstName', 'preferredLastName', 'roles', 'accountType', 'created'];\n accountTypeOptions = ['NonBYU', 'Student', 'Employee'];\n\n @ViewChild(MatPaginator) paginator!: MatPaginator;\n @ViewChild(MatSort) sort!: MatSort;\n\n search = signal('');\n accountTypes = signal<GetUsersAccountTypes>(['NonBYU', 'Student', 'Employee']);\n sortBy = signal<GetUsersSortBy>('netId');\n sortDirection = signal<GetUsersSortDirection>('asc');\n pageCount = signal(5);\n pageOffset = signal(0);\n\n getUsers = this.api.getUsers(\n debounced(this.search),\n this.accountTypes,\n this.sortBy,\n this.sortDirection,\n this.pageCount,\n this.pageOffset\n )\n\n ngAfterViewInit() {\n // write the observables from the sort and the paging to the signals\n this.sort.sortChange.subscribe(({active, direction}) => {\n this.sortBy.set(active as GetUsersSortBy);\n this.sortDirection.set(direction);\n this.pageOffset.set(0);\n this.paginator.pageIndex = 0;\n });\n this.paginator.page.subscribe(({pageIndex, pageSize}) => {\n this.pageOffset.set(pageIndex * pageSize)\n this.pageCount.set(pageSize)\n });\n }\n}\n","<mat-form-field>\n <mat-label>Search for User</mat-label>\n <input matInput [(ngModel)]=\"search\">\n</mat-form-field>\n<mat-form-field>\n <mat-label>Account Type</mat-label>\n <mat-select multiple [(ngModel)]=\"accountTypes\">\n @for (accountType of accountTypeOptions; track accountType) {\n <mat-option [value]=\"accountType\">{{accountType}}</mat-option>\n }\n </mat-select>\n</mat-form-field>\n\n<table mat-table [dataSource]=\"getUsers.persistentValue()?.data ?? []\" matSort matSortActive=\"netId\" matSortDisableClear matSortDirection=\"asc\">\n <!-- NetID Column -->\n <ng-container matColumnDef=\"netId\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>NetID</th>\n <td mat-cell *matCellDef=\"let user\">{{user.netId}}</td>\n </ng-container>\n\n <!-- First Name Column -->\n <ng-container matColumnDef=\"preferredFirstName\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>First Name</th>\n <td mat-cell *matCellDef=\"let user\">{{user.preferredFirstName}}</td>\n </ng-container>\n\n <!-- Last Name Column -->\n <ng-container matColumnDef=\"preferredLastName\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Last Name</th>\n <td mat-cell *matCellDef=\"let user\">{{user.preferredLastName}}</td>\n </ng-container>\n\n <!-- Roles Column -->\n <ng-container matColumnDef=\"roles\">\n <th mat-header-cell *matHeaderCellDef>Roles</th>\n <td mat-cell *matCellDef=\"let user\">{{user.roles.join(', ')}}</td>\n </ng-container>\n\n <!-- Account Type Column -->\n <ng-container matColumnDef=\"accountType\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>Account Type</th>\n <td mat-cell *matCellDef=\"let user\">{{user.accountType}}</td>\n </ng-container>\n\n <!-- Created Column -->\n <ng-container matColumnDef=\"created\">\n <th mat-header-cell *matHeaderCellDef mat-sort-header>\n Created\n </th>\n <td mat-cell *matCellDef=\"let user\">{{user.created | date}}</td>\n </ng-container>\n\n <tr mat-header-row *matHeaderRowDef=\"displayedColumns\"></tr>\n <tr mat-row *matRowDef=\"let row; columns: displayedColumns;\"></tr>\n</table>\n\n<mat-paginator [length]=\"getUsers.persistentValue()?.totalCount\" [pageSize]=\"pageCount()\" [pageSizeOptions]=\"[5, 10, 20]\" showFirstLastButtons></mat-paginator>\n","import { Provider } from \"@angular/core\";\nimport { FHSS_CONFIG, FhssConfig } from \"./lib.config\";\n\nexport const provideFhss = (config: FhssConfig): Provider => ({\n provide: FHSS_CONFIG,\n useValue: config,\n});\n\nexport const enumToRecord = <T extends object>(enumInput: T): Record<string, number> => {\n return Object.fromEntries(Object.entries(enumInput).filter(([key, value]) => typeof value === 'number'))\n}\n","import { inject } from '@angular/core';\nimport { CanActivateFn } from '@angular/router';\nimport { AuthService } from '../../../public-api';\n\n/**\n * This guard checks if the client is authenticated, redirecting to login if not.\n */\nexport const authGuard: CanActivateFn = (route, state) => {\n const authService = inject(AuthService);\n if(!authService.authenticated()){\n authService.login(state.url);\n return false;\n }\n return true;\n};\n","import { CanActivateFn, RedirectCommand, Router } from '@angular/router';\nimport { FHSS_CONFIG } from '../../config/lib.config';\nimport { AuthService } from '../../services/auth/auth.service';\nimport { inject } from '@angular/core';\n\n/**\n * Generates a guard function to determine if a user has the required roles to access a route.\n *\n * @example\n * ```typescript\n * const routes: Routes = [\n * {\n * path: 'admin',\n * component: AdminPage,\n * canActivate: [roleGuardFactory(Roles.admin)],\n * },\n * ];\n * ```\n */\nexport const roleGuardFactory: (...allowedRoles: number[]) => CanActivateFn = (...allowedRoles) => {\n return (route, state) => {\n const roles = inject(FHSS_CONFIG).roles;\n const authService = inject(AuthService);\n const router = inject(Router);\n\n if (!authService.authenticated()) {\n authService.login(state.url);\n return false;\n }\n\n const userRoles = authService.realmAccess()?.roles;\n const hasRole =\n userRoles?.some((role) => allowedRoles.includes(roles[role])) ?? false;\n\n return hasRole || new RedirectCommand(router.parseUrl('/forbidden'));\n };\n};\n","import { Component, inject, signal } from '@angular/core';\nimport { AuthService } from '../../services/auth/auth.service';\nimport { Router } from '@angular/router';\n\n@Component({\n selector: 'app-auth-callback',\n imports: [],\n templateUrl: './auth-callback.page.html',\n styleUrl: './auth-callback.page.scss',\n})\nexport class AuthCallbackPage {\n auth = inject(AuthService)\n router = inject(Router)\n\n message = signal('Logging you in...')\n\n constructor() {\n this.auth.handleAuthCallback();\n }\n\n goHome() {\n this.router.navigate(['/'])\n }\n}\n","<div class=\"container\">\n <p>Logging you in...</p>\n</div>","import { Component } from '@angular/core';\nimport { ByuFooterComponent, ByuHeaderComponent } from '../../../public-api';\nimport { MatButtonModule } from '@angular/material/button';\n\n@Component({\n selector: 'fhss-auth-error',\n imports: [MatButtonModule, ByuHeaderComponent, ByuFooterComponent],\n templateUrl: './auth-error.page.html',\n styleUrl: './auth-error.page.scss'\n})\nexport class AuthErrorPage {\n\n}\n","<byu-header />\n\n<div class=\"container\">\n <div class=\"not-found\">\n <img src=\"/sad-duck.jpg\" alt=\"sad duck\" />\n <h1>Login Failed</h1>\n <p>Something went wrong while trying to log you in.</p>\n <a mat-flat-button href=\"/\">Go back to home</a>\n </div>\n</div>\n\n<byu-footer />\n","import { Component } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ByuFooterComponent, ByuHeaderComponent } from '../../../public-api';\n\n@Component({\n selector: 'fhss-forbidden',\n imports: [MatButtonModule, ByuHeaderComponent, ByuFooterComponent],\n templateUrl: './forbidden.page.html',\n styleUrl: './forbidden.page.scss',\n})\nexport class ForbiddenPage {}\n","<byu-header />\n\n<div class=\"container\">\n <div class=\"not-found\">\n <img src=\"/police-duck.jpg\" alt=\"\" />\n <h1>403 - Forbidden</h1>\n <p>You don't have permission to access this page.</p>\n <a mat-flat-button href=\"/\">Go back to home</a>\n </div>\n</div>\n\n<byu-footer />\n","import { Component } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { ByuFooterComponent, ByuHeaderComponent } from '../../../public-api';\n\n@Component({\n selector: 'fhss-not-found',\n imports: [MatButtonModule, ByuHeaderComponent, ByuFooterComponent],\n templateUrl: './not-found.page.html',\n styleUrl: './not-found.page.scss',\n})\nexport class NotFoundPage {}\n","<byu-header />\n\n<div class=\"container\">\n <div class=\"not-found\">\n <img src=\"/confused-duck.png\" alt=\"\" />\n <h1>404 - Page not found</h1>\n <p>The page you are looking for doesn't exist or it may have moved.</p>\n <a mat-flat-button href=\"/\">Go back to home</a>\n </div>\n</div>\n\n<byu-footer />\n","/**\n * Components\n */\nexport * from './lib/components/byu-footer/byu-footer.component'\nexport * from './lib/components/byu-header/byu-header.component'\nexport * from './lib/components/user-management/user-management.component'\n\n/**\n * Config\n */\nexport * from './lib/config/lib.config'\nexport * from './lib/config/utils.config'\n\n/**\n * Guards\n */\nexport * from './lib/guards/auth/auth.guard'\nexport * from './lib/guards/role/role.guard'\n\n/**\n * Pages\n */\nexport * from './lib/pages/auth-callback/auth-callback.page'\nexport * from './lib/pages/auth-error/auth-error.page'\nexport * from './lib/pages/forbidden/forbidden.page'\nexport * from './lib/pages/not-found/not-found.page'\n\n/**\n * Services\n */\nexport * from './lib/services/auth/auth.service'\n\n/**\n * Signals\n */\nexport * from './lib/signals/fetch-signal/fetch-signal'\nexport * from './lib/signals/debounced/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BAAkB,EAAA,QAAA,EAAA,YAAA,EAAA,CAAA,EAAA,CAAA;;4FAItD,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,WACjB,CAAC,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,EAAA,QAAA,EAAA,wUAAA,EAAA,MAAA,EAAA,CAAA,8LAAA,CAAA,EAAA;;;AENpE;;AAEG;;ACFH;;AAEG;;;;"}
@@ -1,9 +1,6 @@
1
1
  import { CanActivateFn } from '@angular/router';
2
2
  /**
3
- * A guard function to determine if a user has the required roles to access a route.
4
- *
5
- * This guard requires the use of the authGuard before it. It also requires the
6
- * route's `allowedRoles` to be defined. See the example below.
3
+ * Generates a guard function to determine if a user has the required roles to access a route.
7
4
  *
8
5
  * @example
9
6
  * ```typescript
@@ -11,10 +8,9 @@ import { CanActivateFn } from '@angular/router';
11
8
  * {
12
9
  * path: 'admin',
13
10
  * component: AdminPage,
14
- * canActivate: [authGuard, roleGuard],
15
- * data: { allowedRoles: [Roles.admin] },
11
+ * canActivate: [roleGuardFactory(Roles.admin)],
16
12
  * },
17
13
  * ];
18
14
  * ```
19
15
  */
20
- export declare const roleGuard: CanActivateFn;
16
+ export declare const roleGuardFactory: (...allowedRoles: number[]) => CanActivateFn;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fhss-web-team/frontend-utils",
3
- "version": "1.4.4",
3
+ "version": "1.5.0",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^19.2.0",
6
6
  "@angular/core": "^19.2.0"