@odx/auth 18.0.0 → 18.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @odx/auth
2
2
 
3
+ ## 18.0.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b4c0f44: Update `@odx/design-tokens` to v4 and migrate to new `token()` API
8
+ - `@odx/ui`: update `@odx/design-tokens` dependency to `^4.0.1`
9
+ - `@odx/angular-chart-js`: migrate `token()` calls to new options object signature `{ mode, eaa }`
10
+ - `@odx/auth`: fix build error by moving `declare global` augmentations into separate `.typings.ts` files
11
+
3
12
  ## 18.0.0
4
13
 
5
14
  ### Major Changes
@@ -1 +1 @@
1
- {"version":3,"file":"odx-auth-plugins-service-connect.mjs","sources":["../../../../libs/auth/plugins/service-connect/src/lib/service-connect.config.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/build-service-connect-url.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/has-roles-or-rights.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/has-roles-or-rights-handler.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/service-connect-plugin-factory.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-rights.directive.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-rights.guard.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-rights.plugin.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-user-language.plugin.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-user-profile.plugin.ts","../../../../libs/auth/plugins/service-connect/src/odx-auth-plugins-service-connect.ts"],"sourcesContent":["import { AuthEnvironment } from '@odx/auth';\n\nexport type ServiceConnectEnvironment = { custom: string };\nexport const ServiceConnectEnvironments: Record<AuthEnvironment, string> = {\n [AuthEnvironment.DEV]: 'https://api.test.connect.draeger.com',\n [AuthEnvironment.STAGE]: 'https://api.staging.connect.draeger.com',\n [AuthEnvironment.PROD]: 'https://api.connect.draeger.com',\n};\nexport const ServiceConnectScopes = {\n BASE: 'dcid',\n PROFILE: 'dcid.profile',\n RIGHTS: 'dcid.rights',\n INSTITUTION: 'dcid.institution',\n};\nexport const ServiceConnectEndpoints = {\n user: '/users/me',\n userRights: '/users/me/rights',\n};\n","import { buildUrl, isString } from '@odx/angular/utils';\nimport { AuthEnvironment } from '@odx/auth';\nimport { ServiceConnectEnvironment, ServiceConnectEnvironments } from '../service-connect.config';\n\n/**\n * Builds a service connect URL based on the provided environment and endpoints.\n *\n * @param {ServiceConnectEnvironment | AuthEnvironment} environment - The environment configuration which can be either a `ServiceConnectEnvironment` or `AuthEnvironment`.\n * @param {string[]} endpoints - A list of endpoint strings to be appended to the base URL.\n * @returns {string} - The constructed service connect URL as a string.\n */\nexport function buildServiceConnectUrl(environment: ServiceConnectEnvironment | AuthEnvironment, ...endpoints: string[]): string {\n if (isString(environment)) {\n return buildUrl(ServiceConnectEnvironments[environment], ...endpoints);\n }\n return buildUrl(environment.custom, ...endpoints);\n}\n","export type Right = string | number;\nexport type Role = Right[];\nexport type RolesOrRights = Array<Role | Right>;\n\n/**\n * Checks if the user has any of the specified roles or rights.\n *\n * @param {Right[]} userRights - An array of rights that the user possesses.\n * @param {RolesOrRights} rolesOrRights - An array of roles or rights to check against. A role is represented as an array of rights.\n * @returns {boolean} - `true` if the user has any of the specified roles or rights, otherwise `false`.\n */\nexport function hasRolesOrRights(userRights: Right[], rolesOrRights: RolesOrRights): boolean {\n return rolesOrRights.some((rights) => (Array.isArray(rights) ? rights : [rights])?.every((right) => userRights.includes(right)));\n}\n","import { AuthorizedHandler } from '@odx/auth';\nimport { hasRolesOrRights, RolesOrRights } from './has-roles-or-rights';\n\n/**\n * Creates an authorized handler that checks if the user has the specified roles or rights.\n *\n * @param {RolesOrRights} rolesOrRights - The roles or rights to check against the user's claims.\n * @returns {AuthorizedHandler} - An handler function that takes user claims and returns a boolean indicating\n * whether the user has the required roles or rights.\n */\nexport function hasRolesOrRightsHandler(rolesOrRights: RolesOrRights): AuthorizedHandler {\n return (claims) => hasRolesOrRights(claims?.rights ?? [], rolesOrRights);\n}\n","import { HttpClient, HttpContext } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { AuthPluginFactory, injectAuthConfig, requireAuthentication } from '@odx/auth';\nimport { defer, map } from 'rxjs';\nimport { ServiceConnectEnvironment } from '../service-connect.config';\nimport { buildServiceConnectUrl } from './build-service-connect-url';\n\nexport interface ServiceConnectPluginOptions<Dto = unknown> {\n environment?: ServiceConnectEnvironment;\n additionalClaims?: (dto: (Dto & Record<string, unknown>) | null) => Partial<OdxAuth.AuthPluginResult>;\n}\n\nexport interface ServiceConnectPluginFactoryOptions<Dto> {\n endpoint: string[];\n parseResponse: (res: Dto | null) => Partial<OdxAuth.AuthPluginResult>;\n defaultValue?: Partial<OdxAuth.AuthPluginResult>;\n setup?: (pluginOptions?: ServiceConnectPluginOptions<Dto>) => void;\n}\n\nexport type ServiceConnectPluginFactory<Dto = unknown> = (pluginOptions?: ServiceConnectPluginOptions<Dto>) => AuthPluginFactory;\n\n/**\n * Creates a plugin factory for fetching and parsing service connect data.\n *\n * @param {ServiceConnectPluginFactoryOptions<Dto>} options - The options for the service connect plugin factory.\n * @returns {ServiceConnectPluginFactory} - A function that creates an auth plugin factory for fetching and parsing service connect data.\n */\nexport function serviceConnectPluginFactory<Dto = unknown>(options: ServiceConnectPluginFactoryOptions<Dto>): ServiceConnectPluginFactory<Dto> {\n return (pluginOptions) => () => {\n options.setup?.(pluginOptions);\n const { environment } = injectAuthConfig();\n const httpClient = inject(HttpClient);\n const url = buildServiceConnectUrl(pluginOptions?.environment ?? environment, ...options.endpoint);\n const parseResponse = (res: Dto | null) => ({\n ...(options.parseResponse(res) ?? options.defaultValue ?? {}),\n ...(pluginOptions?.additionalClaims?.(res as Dto & Record<string, unknown>) ?? {}),\n });\n\n return () => defer(() => httpClient.get<Dto>(url, { context: new HttpContext().set(requireAuthentication, true) })).pipe(map((res) => parseResponse(res)));\n };\n}\n","import { Directive, inject, Input } from '@angular/core';\nimport { AuthDirective } from '@odx/auth';\nimport { hasRolesOrRightsHandler, RolesOrRights } from './helpers';\n\n/**\n * A directive that extends the functionality of the `AuthDirective` to handle\n * roles or rights for service connection authorization.\n *\n * @see AuthDirective\n *\n * This directive should be used on an `ng-template` element with the selector\n * `odxAuthServiceConnectRights`.\n */\n@Directive({\n standalone: true,\n selector: 'ng-template[odxAuthServiceConnectRights]',\n hostDirectives: [\n {\n directive: AuthDirective,\n inputs: ['odxAuthElse:odxAuthServiceConnectRightsElse'],\n },\n ],\n})\nexport class ServiceConnectRightsDirective {\n private readonly authDirective = inject(AuthDirective, { host: true });\n\n /**\n * Sets the roles or rights that the user must have to display the content.\n */\n @Input('odxAuthServiceConnectRights')\n public set rolesOrRights(value: RolesOrRights | null | undefined) {\n this.authDirective.authorizationHandler = hasRolesOrRightsHandler(value ?? []);\n }\n}\n","import { CanActivateFn } from '@angular/router';\nimport { authGuard } from '@odx/auth';\nimport { hasRolesOrRightsHandler, RolesOrRights } from './helpers';\n\n/**\n * A guard function to check if the user has the required roles or rights to access a route.\n *\n * @param {RolesOrRights} rolesOrRights - The roles or rights required to access the route.\n * @param {string | any[]} redirectTo - (Optional) The route to redirect to if the user does not have the required roles or rights.\n * @param {boolean} isExternal - (Optional) A flag indicating if the redirection is to an external URL. Defaults to `false`.\n * @returns {CanActivateFn} - A function that checks the user's roles or rights and handles redirection if necessary.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function serviceConnectRightsGuard(rolesOrRights: RolesOrRights, redirectTo?: string | any[], isExternal = false): CanActivateFn {\n return authGuard(hasRolesOrRightsHandler(rolesOrRights), redirectTo, isExternal);\n}\n","import { GetServiceConnectRightsResponseDto } from './dtos';\nimport { Right, serviceConnectPluginFactory } from './helpers';\nimport { ServiceConnectEndpoints } from './service-connect.config';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace OdxAuth {\n interface AuthPluginResult {\n rights: Right[];\n }\n }\n}\n\n/**\n * A plugin for fetching and parsing service connect rights.\n *\n * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches user rights\n * from the specified endpoint and parses the response to extract the rights.\n *\n * @see {serviceConnectPluginFactory}\n */\nexport const serviceConnectRightsPlugin = serviceConnectPluginFactory<GetServiceConnectRightsResponseDto>({\n endpoint: [ServiceConnectEndpoints.userRights],\n parseResponse: (res) => ({ rights: res?.rights ?? [] }),\n defaultValue: { rights: [] },\n});\n","import { getLanguageCode } from '@odx/angular/utils';\nimport { GetServiceConnectUserResponseDto } from './dtos';\nimport { serviceConnectPluginFactory } from './helpers';\nimport { ServiceConnectEndpoints } from './service-connect.config';\n\n/**\n * Gets the preferred language from a service connect user response.\n *\n * @param {GetServiceConnectUserResponseDto | null} res - The service connect user response.\n * @returns {string | undefined} - The language or undefined.\n */\nexport function getServiceConnectUserLanguage(res?: GetServiceConnectUserResponseDto | null): string | undefined {\n return res?.preferred_language || res?.language_code;\n}\n\n/**\n * Gets the language code from a service connect user response.\n *\n * @param {GetServiceConnectUserResponseDto | null} res - The service connect user response.\n * @returns {string | undefined} - The language code or undefined.\n */\nexport function getServiceConnectUserLanguageCode(res?: GetServiceConnectUserResponseDto | null): string | undefined {\n return res?.language_code ? getLanguageCode(res.language_code) : undefined;\n}\n\n/**\n * A plugin for fetching and parsing the user's preferred language from service connect.\n *\n * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches the user's preferred language\n * from the user endpoint and parses the response to extract the preferred language.\n *\n * @see {serviceConnectPluginFactory}\n */\nexport const serviceConnectUserLanguagePlugin = serviceConnectPluginFactory<GetServiceConnectUserResponseDto>({\n endpoint: [ServiceConnectEndpoints.user],\n parseResponse: (res) => ({ preferredLanguage: getServiceConnectUserLanguage(res), languageCode: getServiceConnectUserLanguageCode(res) }),\n});\n","import { GetServiceConnectUserResponseDto } from './dtos';\nimport { serviceConnectPluginFactory } from './helpers';\nimport { getServiceConnectUserLanguage, getServiceConnectUserLanguageCode } from './service-connect-user-language.plugin';\nimport { ServiceConnectEndpoints } from './service-connect.config';\n\ndeclare global {\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace OdxAuth {\n interface AuthPluginResult {\n country?: string;\n institutionId?: number;\n institutionName?: string;\n institutionName2?: string;\n institutionName3?: string;\n institutionShortname?: string;\n accountNumber?: string;\n }\n }\n}\n\n/**\n * A plugin for fetching and parsing the user's profile from service connect.\n *\n * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches the user's profile\n * from the user endpoint and parses the response to extract the user's profile information.\n *\n * @see {serviceConnectPluginFactory}\n */\nexport const serviceConnectUserProfilePlugin = serviceConnectPluginFactory<GetServiceConnectUserResponseDto>({\n endpoint: [ServiceConnectEndpoints.user],\n parseResponse: (res) => {\n return {\n country: res?.country,\n institutionId: res?.institution_id,\n institutionName: res?.institution_name,\n institutionName2: res?.institution_name_2 ?? undefined,\n institutionName3: res?.institution_name_3 ?? undefined,\n accountNumber: res?.account_number ?? undefined,\n institutionShortname: res?.institution_shortname,\n languageCode: getServiceConnectUserLanguageCode(res),\n preferredLanguage: getServiceConnectUserLanguage(res),\n };\n },\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGO,MAAM,0BAA0B,GAAoC;AACzE,IAAA,CAAC,eAAe,CAAC,GAAG,GAAG,sCAAsC;AAC7D,IAAA,CAAC,eAAe,CAAC,KAAK,GAAG,yCAAyC;AAClE,IAAA,CAAC,eAAe,CAAC,IAAI,GAAG,iCAAiC;;AAEpD,MAAM,oBAAoB,GAAG;AAClC,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,WAAW,EAAE,kBAAkB;;AAE1B,MAAM,uBAAuB,GAAG;AACrC,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,UAAU,EAAE,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CAAC;AAC1I,CAAA;;AChBD;;;;;;;AAOG;AACI,MAAM,+BAA+B,GAAG,2BAA2B,CAAmC;AAC3G,IAAA,QAAQ,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC;AACxC,IAAA,aAAa,EAAE,CAAC,GAAG,KAAI;QACrB,OAAO;YACL,OAAO,EAAE,GAAG,EAAE,OAAO;YACrB,aAAa,EAAE,GAAG,EAAE,cAAc;YAClC,eAAe,EAAE,GAAG,EAAE,gBAAgB;AACtC,YAAA,gBAAgB,EAAE,GAAG,EAAE,kBAAkB,IAAI,SAAS;AACtD,YAAA,gBAAgB,EAAE,GAAG,EAAE,kBAAkB,IAAI,SAAS;AACtD,YAAA,aAAa,EAAE,GAAG,EAAE,cAAc,IAAI,SAAS;YAC/C,oBAAoB,EAAE,GAAG,EAAE,qBAAqB;AAChD,YAAA,YAAY,EAAE,iCAAiC,CAAC,GAAG,CAAC;AACpD,YAAA,iBAAiB,EAAE,6BAA6B,CAAC,GAAG,CAAC;SACtD;IACH,CAAC;AACF,CAAA;;AC3CD;;AAEG;;;;"}
1
+ {"version":3,"file":"odx-auth-plugins-service-connect.mjs","sources":["../../../../libs/auth/plugins/service-connect/src/lib/service-connect.config.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/build-service-connect-url.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/has-roles-or-rights.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/has-roles-or-rights-handler.ts","../../../../libs/auth/plugins/service-connect/src/lib/helpers/service-connect-plugin-factory.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-rights.directive.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-rights.guard.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-rights.plugin.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-user-language.plugin.ts","../../../../libs/auth/plugins/service-connect/src/lib/service-connect-user-profile.plugin.ts","../../../../libs/auth/plugins/service-connect/src/odx-auth-plugins-service-connect.ts"],"sourcesContent":["import { AuthEnvironment } from '@odx/auth';\n\nexport type ServiceConnectEnvironment = { custom: string };\nexport const ServiceConnectEnvironments: Record<AuthEnvironment, string> = {\n [AuthEnvironment.DEV]: 'https://api.test.connect.draeger.com',\n [AuthEnvironment.STAGE]: 'https://api.staging.connect.draeger.com',\n [AuthEnvironment.PROD]: 'https://api.connect.draeger.com',\n};\nexport const ServiceConnectScopes = {\n BASE: 'dcid',\n PROFILE: 'dcid.profile',\n RIGHTS: 'dcid.rights',\n INSTITUTION: 'dcid.institution',\n};\nexport const ServiceConnectEndpoints = {\n user: '/users/me',\n userRights: '/users/me/rights',\n};\n","import { buildUrl, isString } from '@odx/angular/utils';\nimport { AuthEnvironment } from '@odx/auth';\nimport { ServiceConnectEnvironment, ServiceConnectEnvironments } from '../service-connect.config';\n\n/**\n * Builds a service connect URL based on the provided environment and endpoints.\n *\n * @param {ServiceConnectEnvironment | AuthEnvironment} environment - The environment configuration which can be either a `ServiceConnectEnvironment` or `AuthEnvironment`.\n * @param {string[]} endpoints - A list of endpoint strings to be appended to the base URL.\n * @returns {string} - The constructed service connect URL as a string.\n */\nexport function buildServiceConnectUrl(environment: ServiceConnectEnvironment | AuthEnvironment, ...endpoints: string[]): string {\n if (isString(environment)) {\n return buildUrl(ServiceConnectEnvironments[environment], ...endpoints);\n }\n return buildUrl(environment.custom, ...endpoints);\n}\n","export type Right = string | number;\nexport type Role = Right[];\nexport type RolesOrRights = Array<Role | Right>;\n\n/**\n * Checks if the user has any of the specified roles or rights.\n *\n * @param {Right[]} userRights - An array of rights that the user possesses.\n * @param {RolesOrRights} rolesOrRights - An array of roles or rights to check against. A role is represented as an array of rights.\n * @returns {boolean} - `true` if the user has any of the specified roles or rights, otherwise `false`.\n */\nexport function hasRolesOrRights(userRights: Right[], rolesOrRights: RolesOrRights): boolean {\n return rolesOrRights.some((rights) => (Array.isArray(rights) ? rights : [rights])?.every((right) => userRights.includes(right)));\n}\n","import { AuthorizedHandler } from '@odx/auth';\nimport { hasRolesOrRights, RolesOrRights } from './has-roles-or-rights';\n\n/**\n * Creates an authorized handler that checks if the user has the specified roles or rights.\n *\n * @param {RolesOrRights} rolesOrRights - The roles or rights to check against the user's claims.\n * @returns {AuthorizedHandler} - An handler function that takes user claims and returns a boolean indicating\n * whether the user has the required roles or rights.\n */\nexport function hasRolesOrRightsHandler(rolesOrRights: RolesOrRights): AuthorizedHandler {\n return (claims) => hasRolesOrRights(claims?.rights ?? [], rolesOrRights);\n}\n","import { HttpClient, HttpContext } from '@angular/common/http';\nimport { inject } from '@angular/core';\nimport { AuthPluginFactory, injectAuthConfig, requireAuthentication } from '@odx/auth';\nimport { defer, map } from 'rxjs';\nimport { ServiceConnectEnvironment } from '../service-connect.config';\nimport { buildServiceConnectUrl } from './build-service-connect-url';\n\nexport interface ServiceConnectPluginOptions<Dto = unknown> {\n environment?: ServiceConnectEnvironment;\n additionalClaims?: (dto: (Dto & Record<string, unknown>) | null) => Partial<OdxAuth.AuthPluginResult>;\n}\n\nexport interface ServiceConnectPluginFactoryOptions<Dto> {\n endpoint: string[];\n parseResponse: (res: Dto | null) => Partial<OdxAuth.AuthPluginResult>;\n defaultValue?: Partial<OdxAuth.AuthPluginResult>;\n setup?: (pluginOptions?: ServiceConnectPluginOptions<Dto>) => void;\n}\n\nexport type ServiceConnectPluginFactory<Dto = unknown> = (pluginOptions?: ServiceConnectPluginOptions<Dto>) => AuthPluginFactory;\n\n/**\n * Creates a plugin factory for fetching and parsing service connect data.\n *\n * @param {ServiceConnectPluginFactoryOptions<Dto>} options - The options for the service connect plugin factory.\n * @returns {ServiceConnectPluginFactory} - A function that creates an auth plugin factory for fetching and parsing service connect data.\n */\nexport function serviceConnectPluginFactory<Dto = unknown>(options: ServiceConnectPluginFactoryOptions<Dto>): ServiceConnectPluginFactory<Dto> {\n return (pluginOptions) => () => {\n options.setup?.(pluginOptions);\n const { environment } = injectAuthConfig();\n const httpClient = inject(HttpClient);\n const url = buildServiceConnectUrl(pluginOptions?.environment ?? environment, ...options.endpoint);\n const parseResponse = (res: Dto | null) => ({\n ...(options.parseResponse(res) ?? options.defaultValue ?? {}),\n ...(pluginOptions?.additionalClaims?.(res as Dto & Record<string, unknown>) ?? {}),\n });\n\n return () => defer(() => httpClient.get<Dto>(url, { context: new HttpContext().set(requireAuthentication, true) })).pipe(map((res) => parseResponse(res)));\n };\n}\n","import { Directive, inject, Input } from '@angular/core';\nimport { AuthDirective } from '@odx/auth';\nimport { hasRolesOrRightsHandler, RolesOrRights } from './helpers';\n\n/**\n * A directive that extends the functionality of the `AuthDirective` to handle\n * roles or rights for service connection authorization.\n *\n * @see AuthDirective\n *\n * This directive should be used on an `ng-template` element with the selector\n * `odxAuthServiceConnectRights`.\n */\n@Directive({\n standalone: true,\n selector: 'ng-template[odxAuthServiceConnectRights]',\n hostDirectives: [\n {\n directive: AuthDirective,\n inputs: ['odxAuthElse:odxAuthServiceConnectRightsElse'],\n },\n ],\n})\nexport class ServiceConnectRightsDirective {\n private readonly authDirective = inject(AuthDirective, { host: true });\n\n /**\n * Sets the roles or rights that the user must have to display the content.\n */\n @Input('odxAuthServiceConnectRights')\n public set rolesOrRights(value: RolesOrRights | null | undefined) {\n this.authDirective.authorizationHandler = hasRolesOrRightsHandler(value ?? []);\n }\n}\n","import { CanActivateFn } from '@angular/router';\nimport { authGuard } from '@odx/auth';\nimport { hasRolesOrRightsHandler, RolesOrRights } from './helpers';\n\n/**\n * A guard function to check if the user has the required roles or rights to access a route.\n *\n * @param {RolesOrRights} rolesOrRights - The roles or rights required to access the route.\n * @param {string | any[]} redirectTo - (Optional) The route to redirect to if the user does not have the required roles or rights.\n * @param {boolean} isExternal - (Optional) A flag indicating if the redirection is to an external URL. Defaults to `false`.\n * @returns {CanActivateFn} - A function that checks the user's roles or rights and handles redirection if necessary.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function serviceConnectRightsGuard(rolesOrRights: RolesOrRights, redirectTo?: string | any[], isExternal = false): CanActivateFn {\n return authGuard(hasRolesOrRightsHandler(rolesOrRights), redirectTo, isExternal);\n}\n","import { GetServiceConnectRightsResponseDto } from './dtos';\nimport { serviceConnectPluginFactory } from './helpers';\nimport { ServiceConnectEndpoints } from './service-connect.config';\n\n/**\n * A plugin for fetching and parsing service connect rights.\n *\n * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches user rights\n * from the specified endpoint and parses the response to extract the rights.\n *\n * @see {serviceConnectPluginFactory}\n */\nexport const serviceConnectRightsPlugin = serviceConnectPluginFactory<GetServiceConnectRightsResponseDto>({\n endpoint: [ServiceConnectEndpoints.userRights],\n parseResponse: (res) => ({ rights: res?.rights ?? [] }),\n defaultValue: { rights: [] },\n});\n","import { getLanguageCode } from '@odx/angular/utils';\nimport { GetServiceConnectUserResponseDto } from './dtos';\nimport { serviceConnectPluginFactory } from './helpers';\nimport { ServiceConnectEndpoints } from './service-connect.config';\n\n/**\n * Gets the preferred language from a service connect user response.\n *\n * @param {GetServiceConnectUserResponseDto | null} res - The service connect user response.\n * @returns {string | undefined} - The language or undefined.\n */\nexport function getServiceConnectUserLanguage(res?: GetServiceConnectUserResponseDto | null): string | undefined {\n return res?.preferred_language || res?.language_code;\n}\n\n/**\n * Gets the language code from a service connect user response.\n *\n * @param {GetServiceConnectUserResponseDto | null} res - The service connect user response.\n * @returns {string | undefined} - The language code or undefined.\n */\nexport function getServiceConnectUserLanguageCode(res?: GetServiceConnectUserResponseDto | null): string | undefined {\n return res?.language_code ? getLanguageCode(res.language_code) : undefined;\n}\n\n/**\n * A plugin for fetching and parsing the user's preferred language from service connect.\n *\n * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches the user's preferred language\n * from the user endpoint and parses the response to extract the preferred language.\n *\n * @see {serviceConnectPluginFactory}\n */\nexport const serviceConnectUserLanguagePlugin = serviceConnectPluginFactory<GetServiceConnectUserResponseDto>({\n endpoint: [ServiceConnectEndpoints.user],\n parseResponse: (res) => ({ preferredLanguage: getServiceConnectUserLanguage(res), languageCode: getServiceConnectUserLanguageCode(res) }),\n});\n","import { GetServiceConnectUserResponseDto } from './dtos';\nimport { serviceConnectPluginFactory } from './helpers';\nimport { getServiceConnectUserLanguage, getServiceConnectUserLanguageCode } from './service-connect-user-language.plugin';\nimport { ServiceConnectEndpoints } from './service-connect.config';\n\n/**\n * A plugin for fetching and parsing the user's profile from service connect.\n *\n * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches the user's profile\n * from the user endpoint and parses the response to extract the user's profile information.\n *\n * @see {serviceConnectPluginFactory}\n */\nexport const serviceConnectUserProfilePlugin = serviceConnectPluginFactory<GetServiceConnectUserResponseDto>({\n endpoint: [ServiceConnectEndpoints.user],\n parseResponse: (res) => {\n return {\n country: res?.country,\n institutionId: res?.institution_id,\n institutionName: res?.institution_name,\n institutionName2: res?.institution_name_2 ?? undefined,\n institutionName3: res?.institution_name_3 ?? undefined,\n accountNumber: res?.account_number ?? undefined,\n institutionShortname: res?.institution_shortname,\n languageCode: getServiceConnectUserLanguageCode(res),\n preferredLanguage: getServiceConnectUserLanguage(res),\n };\n },\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAGO,MAAM,0BAA0B,GAAoC;AACzE,IAAA,CAAC,eAAe,CAAC,GAAG,GAAG,sCAAsC;AAC7D,IAAA,CAAC,eAAe,CAAC,KAAK,GAAG,yCAAyC;AAClE,IAAA,CAAC,eAAe,CAAC,IAAI,GAAG,iCAAiC;;AAEpD,MAAM,oBAAoB,GAAG;AAClC,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,OAAO,EAAE,cAAc;AACvB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,WAAW,EAAE,kBAAkB;;AAE1B,MAAM,uBAAuB,GAAG;AACrC,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,UAAU,EAAE,kBAAkB;;;ACZhC;;;;;;AAMG;SACa,sBAAsB,CAAC,WAAwD,EAAE,GAAG,SAAm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CAAmC;AAC3G,IAAA,QAAQ,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC;AACxC,IAAA,aAAa,EAAE,CAAC,GAAG,KAAI;QACrB,OAAO;YACL,OAAO,EAAE,GAAG,EAAE,OAAO;YACrB,aAAa,EAAE,GAAG,EAAE,cAAc;YAClC,eAAe,EAAE,GAAG,EAAE,gBAAgB;AACtC,YAAA,gBAAgB,EAAE,GAAG,EAAE,kBAAkB,IAAI,SAAS;AACtD,YAAA,gBAAgB,EAAE,GAAG,EAAE,kBAAkB,IAAI,SAAS;AACtD,YAAA,aAAa,EAAE,GAAG,EAAE,cAAc,IAAI,SAAS;YAC/C,oBAAoB,EAAE,GAAG,EAAE,qBAAqB;AAChD,YAAA,YAAY,EAAE,iCAAiC,CAAC,GAAG,CAAC;AACpD,YAAA,iBAAiB,EAAE,6BAA6B,CAAC,GAAG,CAAC;SACtD;IACH,CAAC;AACF,CAAA;;AC5BD;;AAEG;;;;"}
@@ -12,7 +12,7 @@ import { LoadingSpinnerDirective, LoadingSpinnerModule } from '@odx/angular/comp
12
12
  import { TranslatePipe, provideTranslations } from '@odx/angular/internal/translate';
13
13
  import { buildUrl, isString, matchUrl, untilDestroyed, injectElement, isNumber, isNonEmptyString, createConfigTokens, Position } from '@odx/angular/utils';
14
14
  import { filter, switchMap, mergeMap, map, of, tap, BehaviorSubject, distinctUntilChanged, share, combineLatest, take, timeout, catchError, fromEvent, startWith, shareReplay, merge, EMPTY } from 'rxjs';
15
- import { OAuthErrorEvent, provideOAuthClient, OAuthStorage, OAuthService } from 'angular-oauth2-oidc';
15
+ import { OAuthErrorEvent, OAuthStorage, provideOAuthClient, OAuthService } from 'angular-oauth2-oidc';
16
16
  import { HttpRequest, HttpContextToken, provideHttpClient, withInterceptors, HttpErrorResponse } from '@angular/common/http';
17
17
  import { Router } from '@angular/router';
18
18
  import { Environment, CoreModule, WindowRef } from '@odx/angular';
package/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import * as i0 from '@angular/core';
2
- import { AfterViewInit, TemplateRef, EventEmitter, InjectionToken, Provider, EnvironmentProviders } from '@angular/core';
2
+ import { AfterViewInit, TemplateRef, EventEmitter, InjectionToken, EnvironmentProviders, Provider } from '@angular/core';
3
3
  import * as rxjs from 'rxjs';
4
4
  import { Observable, OperatorFunction } from 'rxjs';
5
5
  import * as _odx_auth from '@odx/auth';
6
6
  import { DropdownOptions } from '@odx/angular/components/dropdown';
7
7
  import * as angular_oauth2_oidc from 'angular-oauth2-oidc';
8
8
  import { OAuthErrorEvent, OAuthStorage, AuthConfig as AuthConfig$1, TokenResponse, OAuthEvent } from 'angular-oauth2-oidc';
9
- import { HttpRequest, HttpContextToken, HttpInterceptorFn } from '@angular/common/http';
9
+ import { HttpRequest, HttpInterceptorFn, HttpContextToken } from '@angular/common/http';
10
10
  import { Router, CanActivateFn } from '@angular/router';
11
11
  import * as _odx_angular_utils from '@odx/angular/utils';
12
12
  import { ConfigDependencies, ConfigProvider } from '@odx/angular/utils';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odx/auth",
3
- "version": "18.0.0",
3
+ "version": "18.0.1",
4
4
  "author": "Drägerwerk AG & Co.KGaA",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "peerDependencies": {
@@ -116,13 +116,6 @@ declare class ServiceConnectRightsDirective {
116
116
  */
117
117
  declare function serviceConnectRightsGuard(rolesOrRights: RolesOrRights, redirectTo?: string | any[], isExternal?: boolean): CanActivateFn;
118
118
 
119
- declare global {
120
- namespace OdxAuth {
121
- interface AuthPluginResult {
122
- rights: Right[];
123
- }
124
- }
125
- }
126
119
  /**
127
120
  * A plugin for fetching and parsing service connect rights.
128
121
  *
@@ -133,6 +126,14 @@ declare global {
133
126
  */
134
127
  declare const serviceConnectRightsPlugin: _odx_auth_plugins_service_connect.ServiceConnectPluginFactory<GetServiceConnectRightsResponseDto>;
135
128
 
129
+ declare global {
130
+ namespace OdxAuth {
131
+ interface AuthPluginResult {
132
+ rights: (string | number)[];
133
+ }
134
+ }
135
+ }
136
+
136
137
  /**
137
138
  * Gets the preferred language from a service connect user response.
138
139
  *
@@ -157,6 +158,16 @@ declare function getServiceConnectUserLanguageCode(res?: GetServiceConnectUserRe
157
158
  */
158
159
  declare const serviceConnectUserLanguagePlugin: _odx_auth_plugins_service_connect.ServiceConnectPluginFactory<GetServiceConnectUserResponseDto>;
159
160
 
161
+ /**
162
+ * A plugin for fetching and parsing the user's profile from service connect.
163
+ *
164
+ * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches the user's profile
165
+ * from the user endpoint and parses the response to extract the user's profile information.
166
+ *
167
+ * @see {serviceConnectPluginFactory}
168
+ */
169
+ declare const serviceConnectUserProfilePlugin: _odx_auth_plugins_service_connect.ServiceConnectPluginFactory<GetServiceConnectUserResponseDto>;
170
+
160
171
  declare global {
161
172
  namespace OdxAuth {
162
173
  interface AuthPluginResult {
@@ -170,15 +181,6 @@ declare global {
170
181
  }
171
182
  }
172
183
  }
173
- /**
174
- * A plugin for fetching and parsing the user's profile from service connect.
175
- *
176
- * This plugin uses the `serviceConnectPluginFactory` to create a plugin that fetches the user's profile
177
- * from the user endpoint and parses the response to extract the user's profile information.
178
- *
179
- * @see {serviceConnectPluginFactory}
180
- */
181
- declare const serviceConnectUserProfilePlugin: _odx_auth_plugins_service_connect.ServiceConnectPluginFactory<GetServiceConnectUserResponseDto>;
182
184
 
183
185
  export { ServiceConnectEndpoints, ServiceConnectEnvironments, ServiceConnectRightsDirective, ServiceConnectScopes, buildServiceConnectUrl, getServiceConnectUserLanguage, getServiceConnectUserLanguageCode, hasRolesOrRights, hasRolesOrRightsHandler, serviceConnectPluginFactory, serviceConnectRightsGuard, serviceConnectRightsPlugin, serviceConnectUserLanguagePlugin, serviceConnectUserProfilePlugin };
184
186
  export type { GetServiceConnectRightsResponseDto, GetServiceConnectUserResponseDto, Right, Role, RolesOrRights, ServiceConnectEnvironment, ServiceConnectPluginFactory, ServiceConnectPluginFactoryOptions, ServiceConnectPluginOptions };