asma-types
Advanced tools
Comparing version 1.1.13 to 1.1.14
@@ -0,0 +0,0 @@ export type { IUploadedDocument } from './interfaces/api/advoca/IUploadedDocument'; |
export * from './interfaces/jwtClaims'; | ||
export * from './interfaces/enums'; | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ export interface ISaveToDataBase { |
export {}; | ||
//# sourceMappingURL=ISaveToDataBase.js.map |
@@ -0,0 +0,0 @@ export interface IUploadedDocument { |
export {}; | ||
//# sourceMappingURL=IUploadedDocument.js.map |
@@ -0,0 +0,0 @@ export declare enum InitiatorTypes { |
@@ -0,0 +0,0 @@ // deprecated, replaced with QueriesInitiator |
@@ -24,4 +24,2 @@ declare type roles_enum = 'RECIPIENT' | 'SUPER_USER' | 'THERAPIST' | 'USER'; | ||
services: IService; | ||
journal_user_id: string | null; | ||
brukerBrukerNavn: string | null; | ||
features: feature_names_enum[]; | ||
@@ -36,6 +34,6 @@ srv_urls: ISrvUrls; | ||
} | ||
export declare function isRecipientJwtClaims(claims: IBaseJwtClaims): claims is IRecipientJwtClaims; | ||
export declare function isTherapistJwtClaims(claims: IBaseJwtClaims): claims is ITherapistOrSuperUserJwtClaims; | ||
export declare function isAdminJwtClaims(claims: IBaseJwtClaims): claims is IAdminJwtClaims; | ||
export declare function isRecipientJwtClaims(claims?: IBaseJwtClaims): claims is IRecipientJwtClaims; | ||
export declare function isTherapistJwtClaims(claims?: IBaseJwtClaims): claims is ITherapistOrSuperUserJwtClaims; | ||
export declare function isAdminJwtClaims(claims?: IBaseJwtClaims): claims is IAdminJwtClaims; | ||
export {}; | ||
//# sourceMappingURL=jwtClaims.d.ts.map |
export function isRecipientJwtClaims(claims) { | ||
return claims.role === 'RECIPIENT'; | ||
return (claims === null || claims === void 0 ? void 0 : claims.role.toUpperCase()) === 'RECIPIENT'; | ||
} | ||
export function isTherapistJwtClaims(claims) { | ||
return claims.role === 'THERAPIST' || claims.role === 'SUPER_USER'; | ||
var _a; | ||
return (claims === null || claims === void 0 ? void 0 : claims.role.toUpperCase()) === 'THERAPIST' || ((_a = claims === null || claims === void 0 ? void 0 : claims.role) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'SUPER_USER'; | ||
} | ||
export function isAdminJwtClaims(claims) { | ||
return claims.role === 'ADMIN'; | ||
return (claims === null || claims === void 0 ? void 0 : claims.role.toUpperCase()) === 'ADMIN'; | ||
} | ||
//# sourceMappingURL=jwtClaims.js.map |
{ | ||
"name": "asma-types", | ||
"version": "1.1.13", | ||
"version": "1.1.14", | ||
"description": "shared ts asma types", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -0,0 +0,0 @@ export type { IUploadedDocument } from './interfaces/api/advoca/IUploadedDocument' |
@@ -0,0 +0,0 @@ export interface ISaveToDataBase { |
@@ -0,0 +0,0 @@ export interface IUploadedDocument { |
@@ -0,0 +0,0 @@ // deprecated, replaced with QueriesInitiator |
type roles_enum = 'RECIPIENT' | 'SUPER_USER' | 'THERAPIST' | 'USER' | ||
type feature_names_enum = 'autoImportableQnr' | 'dashboardTraceability' | 'ordersOverviewOnSelectedRecipientsForQnr' | 'predefinedUserForQnr' | 'rejectableQnr' | 'signByTherapistDocument' | 'test' | ||
type feature_names_enum = | ||
| 'autoImportableQnr' | ||
| 'dashboardTraceability' | ||
| 'ordersOverviewOnSelectedRecipientsForQnr' | ||
| 'predefinedUserForQnr' | ||
| 'rejectableQnr' | ||
| 'signByTherapistDocument' | ||
| 'test' | ||
@@ -27,4 +34,2 @@ export interface IBaseJwtClaims { | ||
services: IService | ||
journal_user_id: string | null | ||
brukerBrukerNavn: string | null | ||
features: feature_names_enum[] | ||
@@ -41,11 +46,11 @@ srv_urls: ISrvUrls | ||
export function isRecipientJwtClaims(claims: IBaseJwtClaims): claims is IRecipientJwtClaims { | ||
return claims.role === 'RECIPIENT' | ||
export function isRecipientJwtClaims(claims?: IBaseJwtClaims): claims is IRecipientJwtClaims { | ||
return claims?.role.toUpperCase() === 'RECIPIENT' | ||
} | ||
export function isTherapistJwtClaims(claims: IBaseJwtClaims): claims is ITherapistOrSuperUserJwtClaims { | ||
return claims.role === 'THERAPIST' || claims.role === 'SUPER_USER' | ||
export function isTherapistJwtClaims(claims?: IBaseJwtClaims): claims is ITherapistOrSuperUserJwtClaims { | ||
return claims?.role.toUpperCase() === 'THERAPIST' || claims?.role?.toUpperCase() === 'SUPER_USER' | ||
} | ||
export function isAdminJwtClaims(claims: IBaseJwtClaims): claims is IAdminJwtClaims { | ||
return claims.role === ('ADMIN' as roles_enum) | ||
} | ||
export function isAdminJwtClaims(claims?: IBaseJwtClaims): claims is IAdminJwtClaims { | ||
return claims?.role.toUpperCase() === ('ADMIN' as roles_enum) | ||
} |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
1054
0
53647