quankee-framework-common-ts 1.4.2 → 1.4.4
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/.angular/cache/19.2.15/ng-packagr/91f1f2d122acf302d104afbce6fe35663cb63aaaef20721b2ae86ea0bab5c54a +1 -1
- package/.angular/cache/19.2.15/ng-packagr/e7a7d1fd8010b7d738d17804a871e051239ab07f96a28e9282a235d0bf535001 +1 -1
- package/package.json +1 -1
- package/projects/quankee-framework-interceptor/package.json +1 -1
- package/projects/quankee-framework-keycloak/package.json +1 -1
- package/projects/quankee-framework-language/package.json +1 -1
- package/projects/quankee-framework-response/package.json +1 -1
- package/projects/quankee-framework-user/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"modules":[{"ast":{"type":"Program","start":0,"end":1112,"body":[{"type":"ExportNamedDeclaration","start":0,"end":217,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"FunctionDeclaration","start":7,"end":217,"async":false,"generator":false,"id":{"type":"Identifier","start":16,"end":32,"name":"injectAuthHeader"},"params":[{"type":"Identifier","start":33,"end":36,"name":"req"},{"type":"Identifier","start":38,"end":43,"name":"token"}],"body":{"type":"BlockStatement","start":45,"end":217,"body":[{"type":"IfStatement","start":51,"end":199,"test":{"type":"Identifier","start":55,"end":60,"name":"token"},"consequent":{"type":"BlockStatement","start":62,"end":199,"body":[{"type":"ReturnStatement","start":72,"end":193,"argument":{"type":"CallExpression","start":79,"end":192,"optional":false,"callee":{"type":"MemberExpression","start":79,"end":88,"computed":false,"optional":false,"object":{"type":"Identifier","start":79,"end":82,"name":"req"},"property":{"type":"Identifier","start":83,"end":88,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":89,"end":191,"properties":[{"type":"Property","start":103,"end":180,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":103,"end":113,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":115,"end":180,"properties":[{"type":"Property","start":133,"end":165,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":133,"end":146,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":148,"end":165,"quasis":[{"type":"TemplateElement","start":149,"end":156,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":164,"end":164,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":158,"end":163,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}]},"alternate":null},{"type":"ReturnStatement","start":204,"end":215,"argument":{"type":"Identifier","start":211,"end":214,"name":"req"}}]},"expression":false}}],"_rollupRemoved":[{"end":1112,"start":218,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","customTransformCache":false,"dependencies":[],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"originalCode":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","originalSourcemap":{"version":3,"file":"token.helper.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts"],"names":[],"mappings":[[[0,0,0,0],[6,0,0,6],[16,0,0,16],[32,0,0,32],[33,0,0,33],[36,0,0,41],[38,0,0,43],[43,0,0,53]],[[4,0,1,2],[8,0,1,6],[13,0,1,11],[15,0,1,13],[16,0,1,14]],[[8,0,2,4],[15,0,2,11],[18,0,2,14],[19,0,2,15],[24,0,2,20],[25,0,2,21]],[[12,0,3,6],[22,0,3,16],[24,0,3,18]],[[16,0,4,8],[29,0,4,21],[31,0,4,23],[41,0,4,33],[46,0,4,38],[48,0,4,40]],[[13,0,5,7]],[[9,0,6,5],[10,0,6,6],[11,0,6,7]],[[4,0,7,2],[5,0,7,3]],[[4,0,8,2],[11,0,8,9],[14,0,8,12],[15,0,8,13]],[[0,0,9,0],[1,0,9,1]]],"sourcesContent":["export function injectAuthHeader(req: any, token: any): any {\r\n if (token) {\r\n return req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n return req;\r\n}\r\n"]},"resolvedIds":{},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":5214,"body":[{"type":"ImportDeclaration","start":0,"end":43,"specifiers":[{"type":"ImportSpecifier","start":9,"end":19,"imported":{"type":"Identifier","start":9,"end":19,"name":"Injectable"},"local":{"type":"Identifier","start":9,"end":19,"name":"Injectable"}}],"source":{"type":"Literal","start":27,"end":42,"value":"@angular/core","raw":"'@angular/core'"},"attributes":[]},{"type":"ImportDeclaration","start":44,"end":90,"specifiers":[{"type":"ImportSpecifier","start":53,"end":63,"imported":{"type":"Identifier","start":53,"end":63,"name":"catchError"},"local":{"type":"Identifier","start":53,"end":63,"name":"catchError"}},{"type":"ImportSpecifier","start":65,"end":75,"imported":{"type":"Identifier","start":65,"end":75,"name":"throwError"},"local":{"type":"Identifier","start":65,"end":75,"name":"throwError"}}],"source":{"type":"Literal","start":83,"end":89,"value":"rxjs","raw":"'rxjs'"},"attributes":[]},{"type":"ImportDeclaration","start":91,"end":127,"specifiers":[{"type":"ImportNamespaceSpecifier","start":98,"end":105,"local":{"type":"Identifier","start":103,"end":105,"name":"i0"}}],"source":{"type":"Literal","start":111,"end":126,"value":"@angular/core","raw":"\"@angular/core\""},"attributes":[]},{"type":"ImportDeclaration","start":128,"end":177,"specifiers":[{"type":"ImportNamespaceSpecifier","start":135,"end":142,"local":{"type":"Identifier","start":140,"end":142,"name":"i1"}}],"source":{"type":"Literal","start":148,"end":176,"value":"quankee-framework-keycloak","raw":"\"quankee-framework-keycloak\""},"attributes":[]},{"type":"ExportNamedDeclaration","start":178,"end":1500,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"ClassDeclaration","start":185,"end":1500,"decorators":[],"id":{"type":"Identifier","start":191,"end":215,"name":"AuthorizationInterceptor"},"superClass":null,"body":{"type":"ClassBody","start":216,"end":1500,"body":[{"type":"PropertyDefinition","start":222,"end":238,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":222,"end":237,"name":"keycloakService"},"value":null},{"type":"MethodDefinition","start":243,"end":327,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":243,"end":254,"name":"constructor"},"value":{"type":"FunctionExpression","start":254,"end":327,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":255,"end":270,"name":"keycloakService"}],"body":{"type":"BlockStatement","start":272,"end":327,"body":[{"type":"ExpressionStatement","start":282,"end":321,"expression":{"type":"AssignmentExpression","start":282,"end":320,"operator":"=","left":{"type":"MemberExpression","start":282,"end":302,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":282,"end":286},"property":{"type":"Identifier","start":287,"end":302,"name":"keycloakService"}},"right":{"type":"Identifier","start":305,"end":320,"name":"keycloakService"}}}]},"expression":false},"kind":"constructor"},{"type":"MethodDefinition","start":332,"end":1150,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":332,"end":341,"name":"intercept"},"value":{"type":"FunctionExpression","start":341,"end":1150,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":342,"end":345,"name":"req"},{"type":"Identifier","start":347,"end":351,"name":"next"}],"body":{"type":"BlockStatement","start":353,"end":1150,"body":[{"type":"ExpressionStatement","start":363,"end":405,"expression":{"type":"CallExpression","start":363,"end":404,"optional":false,"callee":{"type":"MemberExpression","start":363,"end":374,"computed":false,"optional":false,"object":{"type":"Identifier","start":363,"end":370,"name":"console"},"property":{"type":"Identifier","start":371,"end":374,"name":"log"}},"arguments":[{"type":"Literal","start":375,"end":403,"value":"[Interceptor] Executing...","raw":"'[Interceptor] Executing...'"}]}},{"type":"VariableDeclaration","start":414,"end":460,"kind":"const","declarations":[{"type":"VariableDeclarator","start":420,"end":459,"id":{"type":"Identifier","start":420,"end":425,"name":"token"},"init":{"type":"CallExpression","start":428,"end":459,"optional":false,"callee":{"type":"MemberExpression","start":428,"end":457,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":428,"end":448,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":428,"end":432},"property":{"type":"Identifier","start":433,"end":448,"name":"keycloakService"}},"property":{"type":"Identifier","start":449,"end":457,"name":"getToken"}},"arguments":[]}}]},{"type":"ExpressionStatement","start":487,"end":542,"expression":{"type":"CallExpression","start":487,"end":541,"optional":false,"callee":{"type":"MemberExpression","start":487,"end":498,"computed":false,"optional":false,"object":{"type":"Identifier","start":487,"end":494,"name":"console"},"property":{"type":"Identifier","start":495,"end":498,"name":"log"}},"arguments":[{"type":"BinaryExpression","start":499,"end":540,"operator":"+","left":{"type":"Literal","start":499,"end":532,"value":"[Interceptor] is token found...","raw":"'[Interceptor] is token found...'"},"right":{"type":"Identifier","start":535,"end":540,"name":"token"}}]}},{"type":"VariableDeclaration","start":551,"end":569,"kind":"let","declarations":[{"type":"VariableDeclarator","start":555,"end":568,"id":{"type":"Identifier","start":555,"end":562,"name":"authReq"},"init":{"type":"Identifier","start":565,"end":568,"name":"req"}}]},{"type":"IfStatement","start":578,"end":818,"test":{"type":"Identifier","start":582,"end":587,"name":"token"},"consequent":{"type":"BlockStatement","start":589,"end":818,"body":[{"type":"ExpressionStatement","start":603,"end":655,"expression":{"type":"CallExpression","start":603,"end":654,"optional":false,"callee":{"type":"MemberExpression","start":603,"end":614,"computed":false,"optional":false,"object":{"type":"Identifier","start":603,"end":610,"name":"console"},"property":{"type":"Identifier","start":611,"end":614,"name":"log"}},"arguments":[{"type":"BinaryExpression","start":615,"end":653,"operator":"+","left":{"type":"Literal","start":615,"end":645,"value":"[Interceptor] token found...","raw":"'[Interceptor] token found...'"},"right":{"type":"Identifier","start":648,"end":653,"name":"token"}}]}},{"type":"ExpressionStatement","start":668,"end":808,"expression":{"type":"AssignmentExpression","start":668,"end":807,"operator":"=","left":{"type":"Identifier","start":668,"end":675,"name":"authReq"},"right":{"type":"CallExpression","start":678,"end":807,"optional":false,"callee":{"type":"MemberExpression","start":678,"end":687,"computed":false,"optional":false,"object":{"type":"Identifier","start":678,"end":681,"name":"req"},"property":{"type":"Identifier","start":682,"end":687,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":688,"end":806,"properties":[{"type":"Property","start":706,"end":791,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":706,"end":716,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":718,"end":791,"properties":[{"type":"Property","start":740,"end":772,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":740,"end":753,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":755,"end":772,"quasis":[{"type":"TemplateElement","start":756,"end":763,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":771,"end":771,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":765,"end":770,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}}]},"alternate":null},{"type":"ReturnStatement","start":827,"end":1144,"argument":{"type":"CallExpression","start":834,"end":1143,"optional":false,"callee":{"type":"MemberExpression","start":834,"end":859,"computed":false,"optional":false,"object":{"type":"CallExpression","start":834,"end":854,"optional":false,"callee":{"type":"MemberExpression","start":834,"end":845,"computed":false,"optional":false,"object":{"type":"Identifier","start":834,"end":838,"name":"next"},"property":{"type":"Identifier","start":839,"end":845,"name":"handle"}},"arguments":[{"type":"Identifier","start":846,"end":853,"name":"authReq"}]},"property":{"type":"Identifier","start":855,"end":859,"name":"pipe"}},"arguments":[{"type":"CallExpression","start":860,"end":1142,"optional":false,"callee":{"type":"Identifier","start":860,"end":870,"name":"catchError"},"arguments":[{"type":"ArrowFunctionExpression","start":871,"end":1141,"async":false,"expression":false,"generator":false,"params":[{"type":"Identifier","start":872,"end":877,"name":"error"}],"body":{"type":"BlockStatement","start":882,"end":1141,"body":[{"type":"ExpressionStatement","start":896,"end":932,"expression":{"type":"CallExpression","start":896,"end":931,"optional":false,"callee":{"type":"MemberExpression","start":896,"end":909,"computed":false,"optional":false,"object":{"type":"Identifier","start":896,"end":903,"name":"console"},"property":{"type":"Identifier","start":904,"end":909,"name":"error"}},"arguments":[{"type":"Literal","start":910,"end":923,"value":"HTTP Error:","raw":"'HTTP Error:'"},{"type":"Identifier","start":925,"end":930,"name":"error"}]}},{"type":"IfStatement","start":945,"end":1087,"test":{"type":"BinaryExpression","start":949,"end":969,"operator":"===","left":{"type":"MemberExpression","start":949,"end":961,"computed":false,"optional":false,"object":{"type":"Identifier","start":949,"end":954,"name":"error"},"property":{"type":"Identifier","start":955,"end":961,"name":"status"}},"right":{"type":"Literal","start":966,"end":969,"raw":"401","value":401}},"consequent":{"type":"BlockStatement","start":971,"end":1087,"body":[{"type":"ExpressionStatement","start":1028,"end":1073,"expression":{"type":"CallExpression","start":1028,"end":1072,"optional":false,"callee":{"type":"MemberExpression","start":1028,"end":1041,"computed":false,"optional":false,"object":{"type":"Identifier","start":1028,"end":1035,"name":"console"},"property":{"type":"Identifier","start":1036,"end":1041,"name":"error"}},"arguments":[{"type":"Literal","start":1042,"end":1071,"value":"[Interceptor] Unauthorized.","raw":"'[Interceptor] Unauthorized.'"}]}}]},"alternate":null},{"type":"ReturnStatement","start":1100,"end":1131,"argument":{"type":"CallExpression","start":1107,"end":1130,"optional":false,"callee":{"type":"Identifier","start":1107,"end":1117,"name":"throwError"},"arguments":[{"type":"ArrowFunctionExpression","start":1118,"end":1129,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"Identifier","start":1124,"end":1129,"name":"error"},"id":null}]}}]},"id":null}]}]}}]},"expression":false},"kind":"method"},{"type":"PropertyDefinition","start":1155,"end":1361,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1162,"end":1166,"name":"ɵfac"},"value":{"type":"CallExpression","start":1169,"end":1360,"optional":false,"callee":{"type":"MemberExpression","start":1169,"end":1190,"computed":false,"optional":false,"object":{"type":"Identifier","start":1169,"end":1171,"name":"i0"},"property":{"type":"Identifier","start":1172,"end":1190,"name":"ɵɵngDeclareFactory"}},"arguments":[{"type":"ObjectExpression","start":1191,"end":1359,"properties":[{"type":"Property","start":1193,"end":1213,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1193,"end":1203,"name":"minVersion"},"value":{"type":"Literal","start":1205,"end":1213,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1215,"end":1233,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1215,"end":1222,"name":"version"},"value":{"type":"Literal","start":1224,"end":1233,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1235,"end":1247,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1235,"end":1243,"name":"ngImport"},"value":{"type":"Identifier","start":1245,"end":1247,"name":"i0"},"kind":"init"},{"type":"Property","start":1249,"end":1279,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1249,"end":1253,"name":"type"},"value":{"type":"Identifier","start":1255,"end":1279,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1281,"end":1318,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1281,"end":1285,"name":"deps"},"value":{"type":"ArrayExpression","start":1287,"end":1318,"elements":[{"type":"ObjectExpression","start":1288,"end":1317,"properties":[{"type":"Property","start":1290,"end":1315,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1290,"end":1295,"name":"token"},"value":{"type":"MemberExpression","start":1297,"end":1315,"computed":false,"optional":false,"object":{"type":"Identifier","start":1297,"end":1299,"name":"i1"},"property":{"type":"Identifier","start":1300,"end":1315,"name":"KeycloakService"}},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":1320,"end":1357,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1320,"end":1326,"name":"target"},"value":{"type":"MemberExpression","start":1328,"end":1357,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":1328,"end":1346,"computed":false,"optional":false,"object":{"type":"Identifier","start":1328,"end":1330,"name":"i0"},"property":{"type":"Identifier","start":1331,"end":1346,"name":"ɵɵFactoryTarget"}},"property":{"type":"Identifier","start":1347,"end":1357,"name":"Injectable"}},"kind":"init"}]}]}},{"type":"PropertyDefinition","start":1366,"end":1498,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1373,"end":1378,"name":"ɵprov"},"value":{"type":"CallExpression","start":1381,"end":1497,"optional":false,"callee":{"type":"MemberExpression","start":1381,"end":1405,"computed":false,"optional":false,"object":{"type":"Identifier","start":1381,"end":1383,"name":"i0"},"property":{"type":"Identifier","start":1384,"end":1405,"name":"ɵɵngDeclareInjectable"}},"arguments":[{"type":"ObjectExpression","start":1406,"end":1496,"properties":[{"type":"Property","start":1408,"end":1428,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1408,"end":1418,"name":"minVersion"},"value":{"type":"Literal","start":1420,"end":1428,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1430,"end":1448,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1430,"end":1437,"name":"version"},"value":{"type":"Literal","start":1439,"end":1448,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1450,"end":1462,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1450,"end":1458,"name":"ngImport"},"value":{"type":"Identifier","start":1460,"end":1462,"name":"i0"},"kind":"init"},{"type":"Property","start":1464,"end":1494,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1464,"end":1468,"name":"type"},"value":{"type":"Identifier","start":1470,"end":1494,"name":"AuthorizationInterceptor"},"kind":"init"}]}]}}]}}},{"type":"ExpressionStatement","start":1501,"end":1731,"expression":{"type":"CallExpression","start":1501,"end":1730,"optional":false,"callee":{"type":"MemberExpression","start":1501,"end":1528,"computed":false,"optional":false,"object":{"type":"Identifier","start":1501,"end":1503,"name":"i0"},"property":{"type":"Identifier","start":1504,"end":1528,"name":"ɵɵngDeclareClassMetadata"}},"arguments":[{"type":"ObjectExpression","start":1529,"end":1729,"properties":[{"type":"Property","start":1531,"end":1551,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1531,"end":1541,"name":"minVersion"},"value":{"type":"Literal","start":1543,"end":1551,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1553,"end":1571,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1553,"end":1560,"name":"version"},"value":{"type":"Literal","start":1562,"end":1571,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1573,"end":1585,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1573,"end":1581,"name":"ngImport"},"value":{"type":"Identifier","start":1583,"end":1585,"name":"i0"},"kind":"init"},{"type":"Property","start":1587,"end":1617,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1587,"end":1591,"name":"type"},"value":{"type":"Identifier","start":1593,"end":1617,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1619,"end":1673,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1619,"end":1629,"name":"decorators"},"value":{"type":"ArrayExpression","start":1631,"end":1673,"elements":[{"type":"ObjectExpression","start":1632,"end":1672,"properties":[{"type":"Property","start":1646,"end":1662,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1646,"end":1650,"name":"type"},"value":{"type":"Identifier","start":1652,"end":1662,"name":"Injectable"},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":1675,"end":1727,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1675,"end":1689,"name":"ctorParameters"},"value":{"type":"ArrowFunctionExpression","start":1691,"end":1727,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"ArrayExpression","start":1697,"end":1727,"elements":[{"type":"ObjectExpression","start":1698,"end":1726,"properties":[{"type":"Property","start":1700,"end":1724,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1700,"end":1704,"name":"type"},"value":{"type":"MemberExpression","start":1706,"end":1724,"computed":false,"optional":false,"object":{"type":"Identifier","start":1706,"end":1708,"name":"i1"},"property":{"type":"Identifier","start":1709,"end":1724,"name":"KeycloakService"}},"kind":"init"}]}]},"id":null},"kind":"init"}]}]}}],"_rollupRemoved":[{"end":5214,"start":1732,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"import { Injectable } from '@angular/core';\nimport { catchError, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9saWIvY29yZS9hdXRob3JpemF0aW9uLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFDLFVBQVUsRUFBYyxVQUFVLEVBQUMsTUFBTSxNQUFNLENBQUM7OztBQUd4RCxNQUFNLE9BQU8sd0JBQXdCO0lBRU47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aXMgdG9rZW4gZm91bmQuLi4nICsgdG9rZW4pO1xyXG4gICAgbGV0IGF1dGhSZXEgPSByZXE7XHJcblxyXG4gICAgaWYgKHRva2VuKSB7XHJcbiAgICAgIGNvbnNvbGUubG9nKCdbSW50ZXJjZXB0b3JdIHRva2VuIGZvdW5kLi4uJyArIHRva2VuKTtcclxuICAgICAgYXV0aFJlcSA9IHJlcS5jbG9uZSh7XHJcbiAgICAgICAgc2V0SGVhZGVyczoge1xyXG4gICAgICAgICAgQXV0aG9yaXphdGlvbjogYEJlYXJlciAke3Rva2VufWAsXHJcbiAgICAgICAgfSxcclxuICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gbmV4dC5oYW5kbGUoYXV0aFJlcSkucGlwZShcclxuICAgICAgICBjYXRjaEVycm9yKChlcnJvcjogSHR0cEVycm9yUmVzcG9uc2UpID0+IHtcclxuICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ0hUVFAgRXJyb3I6JywgZXJyb3IpO1xyXG4gICAgICAgICAgaWYgKGVycm9yLnN0YXR1cyA9PT0gNDAxKSB7XHJcbiAgICAgICAgICAgIC8vIGhhbmRsZSB1bmF1dGhvcml6ZWRcclxuICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQuJylcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIHJldHVybiB0aHJvd0Vycm9yKCgpID0+IGVycm9yKTtcclxuICAgICAgICB9KVxyXG4gICAgKTtcclxuICB9XHJcbn1cclxuIl19","customTransformCache":false,"dependencies":["@angular/core","rxjs","quankee-framework-keycloak"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"import { Injectable } from '@angular/core';\nimport { catchError, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9saWIvY29yZS9hdXRob3JpemF0aW9uLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFFekMsT0FBTyxFQUFDLFVBQVUsRUFBYyxVQUFVLEVBQUMsTUFBTSxNQUFNLENBQUM7OztB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gY29uc29sZS5sb2coJ1tJbnRlcmNlcHRvcl0gaXMgdG9rZW4gZm91bmQuLi4nICsgdG9rZW4pO1xyXG4gICAgbGV0IGF1dGhSZXEgPSByZXE7XHJcblxyXG4gICAgaWYgKHRva2VuKSB7XHJcbiAgICAgIGNvbnNvbGUubG9nKCdbSW50ZXJjZXB0b3JdIHRva2VuIGZvdW5kLi4uJyArIHRva2VuKTtcclxuICAgICAgYXV0aFJlcSA9IHJlcS5jbG9uZSh7XHJcbiAgICAgICAgc2V0SGVhZGVyczoge1xyXG4gICAgICAgICAgQXV0aG9yaXphdGlvbjogYEJlYXJlciAke3Rva2VufWAsXHJcbiAgICAgICAgfSxcclxuICAgICAgfSk7XHJcbiAgICB9XHJcbiAgICByZXR1cm4gbmV4dC5oYW5kbGUoYXV0aFJlcSkucGlwZShcclxuICAgICAgICBjYXRjaEVycm9yKChlcnJvcjogSHR0cEVycm9yUmVzcG9uc2UpID0+IHtcclxuICAgICAgICAgIGNvbnNvbGUuZXJyb3IoJ0hUVFAgRXJyb3I6JywgZXJyb3IpO1xyXG4gICAgICAgICAgaWYgKGVycm9yLnN0YXR1cyA9PT0gNDAxKSB7XHJcbiAgICAgICAgICAgIC8vIGhhbmRsZSB1bmF1dGhvcml6ZWRcclxuICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQuJylcclxuICAgICAgICAgIH1cclxuICAgICAgICAgIHJldHVybiB0aHJvd0Vycm9yKCgpID0+IGVycm9yKTtcclxuICAgICAgICB9KVxyXG4gICAgKTtcclxuICB9XHJcbn1cclxuIl19","originalSourcemap":{"version":3,"file":"authorization.interceptor.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts"],"names":[],"mappings":[[[0,0,1,0],[7,0,1,7],[9,0,1,8],[19,0,1,18],[21,0,1,19],[27,0,1,25],[42,0,1,40],[43,0,1,41]],[[0,0,3,0],[7,0,3,7],[9,0,3,8],[19,0,3,18],[21,0,3,32],[31,0,3,42],[33,0,3,43],[39,0,3,49],[45,0,3,55],[46,0,3,56]],[],[],[[0,0,6,0],[6,0,6,6],[13,0,6,13],[37,0,6,37]],[[4,0,8,31]],[[4,0,8,2],[16,0,8,31],[31,0,8,63]],[[8,0,8,31],[28,0,8,46],[31,0,8,31],[46,0,8,46],[47,0,8,63]],[[4,0,8,66],[5,0,8,67]],[[4,0,10,2],[13,0,10,11],[14,0,10,12],[17,0,10,33],[19,0,10,35],[23,0,10,52]],[[8,0,11,4],[15,0,11,11],[16,0,11,12],[19,0,11,15],[20,0,11,16],[48,0,11,44],[49,0,11,45],[50,0,11,46]],[[8,0,13,4],[14,0,13,10],[19,0,13,15],[22,0,13,18],[26,0,13,22],[27,0,13,23],[42,0,13,38],[43,0,13,39],[51,0,13,47],[53,0,13,49],[54,0,13,50],[55,0,13,51],[72,0,13,68]],[[8,0,14,4],[15,0,14,11],[16,0,14,12],[19,0,14,15],[20,0,14,16],[53,0,14,49],[56,0,14,52],[61,0,14,57],[62,0,14,58],[63,0,14,59]],[[8,0,15,4],[12,0,15,8],[19,0,15,15],[22,0,15,18],[25,0,15,21],[26,0,15,22]],[[8,0,17,4],[12,0,17,8],[17,0,17,13],[19,0,17,15],[20,0,17,16]],[[12,0,18,6],[19,0,18,13],[20,0,18,14],[23,0,18,17],[24,0,18,18],[54,0,18,48],[57,0,18,51],[62,0,18,56],[63,0,18,57],[64,0,18,58]],[[12,0,19,6],[19,0,19,13],[22,0,19,16],[25,0,19,19],[26,0,19,20],[31,0,19,25],[32,0,19,26]],[[16,0,20,8],[26,0,20,18],[28,0,20,20]],[[20,0,21,10],[33,0,21,23],[35,0,21,25],[45,0,21,35],[50,0,21,40],[52,0,21,42]],[[17,0,22,9]],[[13,0,23,7],[14,0,23,8],[15,0,23,9]],[[8,0,24,4],[9,0,24,5]],[[8,0,25,4],[15,0,25,11],[19,0,25,15],[20,0,25,16],[26,0,25,22],[27,0,25,23],[34,0,25,30],[35,0,25,31],[36,0,25,32],[40,0,25,36],[41,0,26,8],[51,0,26,18],[52,0,26,19],[53,0,26,20],[58,0,26,44],[60,0,26,46],[62,0,26,48]],[[12,0,27,10],[19,0,27,17],[20,0,27,18],[25,0,27,23],[26,0,27,24],[39,0,27,37],[41,0,27,39],[46,0,27,44],[47,0,27,45],[48,0,27,46]],[[12,0,28,10],[16,0,28,14],[21,0,28,19],[22,0,28,20],[28,0,28,26],[33,0,28,31],[36,0,28,34],[38,0,28,36],[39,0,28,37]],[[16,0,29,12],[38,0,29,34]],[[16,0,30,12],[23,0,30,19],[24,0,30,20],[29,0,30,25],[30,0,30,26],[59,0,30,55],[60,0,30,56],[61,0,30,56]],[[12,0,31,10],[13,0,31,11]],[[12,0,32,10],[19,0,32,17],[29,0,32,27],[30,0,32,28],[33,0,32,31],[35,0,32,33],[36,0,32,34],[41,0,32,39],[42,0,32,40],[43,0,32,41]],[[8,0,33,8],[9,0,33,9],[10,0,33,10],[11,0,34,5],[12,0,34,6]],[[4,0,35,2],[5,0,35,3]],[[104,0,6,13],[128,0,6,37]],[[108,0,6,13],[132,0,6,37]],[],[[92,0,6,13],[116,0,6,37]],[[18,0,5,1],[28,0,5,11]]],"sourcesContent":["import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\r\nimport {Injectable} from '@angular/core';\r\nimport {KeycloakService} from 'quankee-framework-keycloak';\r\nimport {catchError, Observable, throwError} from 'rxjs';\r\n\r\n@Injectable()\r\nexport class AuthorizationInterceptor implements HttpInterceptor {\r\n\r\n constructor(private readonly keycloakService: KeycloakService) {}\r\n\r\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n console.log('[Interceptor] Executing...');\r\n\r\n const token = this.keycloakService.getToken(); // returns string\r\n console.log('[Interceptor] is token found...' + token);\r\n let authReq = req;\r\n\r\n if (token) {\r\n console.log('[Interceptor] token found...' + token);\r\n authReq = req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n return next.handle(authReq).pipe(\r\n catchError((error: HttpErrorResponse) => {\r\n console.error('HTTP Error:', error);\r\n if (error.status === 401) {\r\n // handle unauthorized\r\n console.error('[Interceptor] Unauthorized.')\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n}\r\n"]},"resolvedIds":{"@angular/core":{"attributes":{},"external":true,"id":"@angular/core","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"rxjs":{"attributes":{},"external":true,"id":"rxjs","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"quankee-framework-keycloak":{"attributes":{},"external":true,"id":"quankee-framework-keycloak","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":755,"body":[{"type":"ExportAllDeclaration","start":62,"end":102,"exported":null,"source":{"type":"Literal","start":76,"end":101,"value":"./lib/core/token.helper","raw":"'./lib/core/token.helper'"},"attributes":[]},{"type":"ExportAllDeclaration","start":103,"end":156,"exported":null,"source":{"type":"Literal","start":117,"end":155,"value":"./lib/core/authorization.interceptor","raw":"'./lib/core/authorization.interceptor'"},"attributes":[]}],"_rollupRemoved":[{"end":755,"start":157,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","originalSourcemap":{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/public-api.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[39,0,4,39],[40,0,4,40]],[[0,0,5,0],[14,0,5,14],[52,0,5,52],[53,0,5,53]]],"sourcesContent":["/*\r\n * Public API Surface of quankee-framework-interceptor\r\n */\r\n\r\nexport * from './lib/core/token.helper';\r\nexport * from './lib/core/authorization.interceptor';\r\n"]},"resolvedIds":{"./lib/core/token.helper":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false},"./lib/core/authorization.interceptor":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":572,"body":[{"type":"ExportAllDeclaration","start":48,"end":77,"exported":null,"source":{"type":"Literal","start":62,"end":76,"value":"./public-api","raw":"'./public-api'"},"attributes":[]}],"_rollupRemoved":[{"end":572,"start":78,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs"],"id":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","originalSourcemap":{"version":3,"file":"quankee-framework-interceptor.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[28,0,4,28],[29,0,4,29]]],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"]},"resolvedIds":{"./public-api":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]}],"plugins":{"file-loader":{},"json":{}}}
|
|
1
|
+
{"modules":[{"ast":{"type":"Program","start":0,"end":1112,"body":[{"type":"ExportNamedDeclaration","start":0,"end":217,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"FunctionDeclaration","start":7,"end":217,"async":false,"generator":false,"id":{"type":"Identifier","start":16,"end":32,"name":"injectAuthHeader"},"params":[{"type":"Identifier","start":33,"end":36,"name":"req"},{"type":"Identifier","start":38,"end":43,"name":"token"}],"body":{"type":"BlockStatement","start":45,"end":217,"body":[{"type":"IfStatement","start":51,"end":199,"test":{"type":"Identifier","start":55,"end":60,"name":"token"},"consequent":{"type":"BlockStatement","start":62,"end":199,"body":[{"type":"ReturnStatement","start":72,"end":193,"argument":{"type":"CallExpression","start":79,"end":192,"optional":false,"callee":{"type":"MemberExpression","start":79,"end":88,"computed":false,"optional":false,"object":{"type":"Identifier","start":79,"end":82,"name":"req"},"property":{"type":"Identifier","start":83,"end":88,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":89,"end":191,"properties":[{"type":"Property","start":103,"end":180,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":103,"end":113,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":115,"end":180,"properties":[{"type":"Property","start":133,"end":165,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":133,"end":146,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":148,"end":165,"quasis":[{"type":"TemplateElement","start":149,"end":156,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":164,"end":164,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":158,"end":163,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}]},"alternate":null},{"type":"ReturnStatement","start":204,"end":215,"argument":{"type":"Identifier","start":211,"end":214,"name":"req"}}]},"expression":false}}],"_rollupRemoved":[{"end":1112,"start":218,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","customTransformCache":false,"dependencies":[],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"originalCode":"export function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9rZW4uaGVscGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3Ivc3JjL2xpYi9jb3JlL3Rva2VuLmhlbHBlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsR0FBUSxFQUFFLEtBQVU7SUFDbkQsSUFBSSxLQUFLLEVBQUUsQ0FBQztRQUNWLE9BQU8sR0FBRyxDQUFDLEtBQUssQ0FBQztZQUNmLFVBQVUsRUFBRTtnQkFDVixhQUFhLEVBQUUsVUFBVSxLQUFLLEVBQUU7YUFDakM7U0FDRixDQUFDLENBQUM7SUFDTCxDQUFDO0lBQ0QsT0FBTyxHQUFHLENBQUM7QUFDYixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGZ1bmN0aW9uIGluamVjdEF1dGhIZWFkZXIocmVxOiBhbnksIHRva2VuOiBhbnkpOiBhbnkge1xyXG4gIGlmICh0b2tlbikge1xyXG4gICAgcmV0dXJuIHJlcS5jbG9uZSh7XHJcbiAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgfSxcclxuICAgIH0pO1xyXG4gIH1cclxuICByZXR1cm4gcmVxO1xyXG59XHJcbiJdfQ==","originalSourcemap":{"version":3,"file":"token.helper.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts"],"names":[],"mappings":[[[0,0,0,0],[6,0,0,6],[16,0,0,16],[32,0,0,32],[33,0,0,33],[36,0,0,41],[38,0,0,43],[43,0,0,53]],[[4,0,1,2],[8,0,1,6],[13,0,1,11],[15,0,1,13],[16,0,1,14]],[[8,0,2,4],[15,0,2,11],[18,0,2,14],[19,0,2,15],[24,0,2,20],[25,0,2,21]],[[12,0,3,6],[22,0,3,16],[24,0,3,18]],[[16,0,4,8],[29,0,4,21],[31,0,4,23],[41,0,4,33],[46,0,4,38],[48,0,4,40]],[[13,0,5,7]],[[9,0,6,5],[10,0,6,6],[11,0,6,7]],[[4,0,7,2],[5,0,7,3]],[[4,0,8,2],[11,0,8,9],[14,0,8,12],[15,0,8,13]],[[0,0,9,0],[1,0,9,1]]],"sourcesContent":["export function injectAuthHeader(req: any, token: any): any {\r\n if (token) {\r\n return req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n return req;\r\n}\r\n"]},"resolvedIds":{},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":6699,"body":[{"type":"ImportDeclaration","start":0,"end":43,"specifiers":[{"type":"ImportSpecifier","start":9,"end":19,"imported":{"type":"Identifier","start":9,"end":19,"name":"Injectable"},"local":{"type":"Identifier","start":9,"end":19,"name":"Injectable"}}],"source":{"type":"Literal","start":27,"end":42,"value":"@angular/core","raw":"'@angular/core'"},"attributes":[]},{"type":"ImportDeclaration","start":44,"end":107,"specifiers":[{"type":"ImportSpecifier","start":53,"end":63,"imported":{"type":"Identifier","start":53,"end":63,"name":"catchError"},"local":{"type":"Identifier","start":53,"end":63,"name":"catchError"}},{"type":"ImportSpecifier","start":65,"end":69,"imported":{"type":"Identifier","start":65,"end":69,"name":"from"},"local":{"type":"Identifier","start":65,"end":69,"name":"from"}},{"type":"ImportSpecifier","start":71,"end":80,"imported":{"type":"Identifier","start":71,"end":80,"name":"switchMap"},"local":{"type":"Identifier","start":71,"end":80,"name":"switchMap"}},{"type":"ImportSpecifier","start":82,"end":92,"imported":{"type":"Identifier","start":82,"end":92,"name":"throwError"},"local":{"type":"Identifier","start":82,"end":92,"name":"throwError"}}],"source":{"type":"Literal","start":100,"end":106,"value":"rxjs","raw":"'rxjs'"},"attributes":[]},{"type":"ImportDeclaration","start":108,"end":144,"specifiers":[{"type":"ImportNamespaceSpecifier","start":115,"end":122,"local":{"type":"Identifier","start":120,"end":122,"name":"i0"}}],"source":{"type":"Literal","start":128,"end":143,"value":"@angular/core","raw":"\"@angular/core\""},"attributes":[]},{"type":"ImportDeclaration","start":145,"end":194,"specifiers":[{"type":"ImportNamespaceSpecifier","start":152,"end":159,"local":{"type":"Identifier","start":157,"end":159,"name":"i1"}}],"source":{"type":"Literal","start":165,"end":193,"value":"quankee-framework-keycloak","raw":"\"quankee-framework-keycloak\""},"attributes":[]},{"type":"ExportNamedDeclaration","start":195,"end":1829,"specifiers":[],"source":null,"attributes":[],"declaration":{"type":"ClassDeclaration","start":202,"end":1829,"decorators":[],"id":{"type":"Identifier","start":208,"end":232,"name":"AuthorizationInterceptor"},"superClass":null,"body":{"type":"ClassBody","start":233,"end":1829,"body":[{"type":"PropertyDefinition","start":239,"end":255,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":239,"end":254,"name":"keycloakService"},"value":null},{"type":"MethodDefinition","start":260,"end":344,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":260,"end":271,"name":"constructor"},"value":{"type":"FunctionExpression","start":271,"end":344,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":272,"end":287,"name":"keycloakService"}],"body":{"type":"BlockStatement","start":289,"end":344,"body":[{"type":"ExpressionStatement","start":299,"end":338,"expression":{"type":"AssignmentExpression","start":299,"end":337,"operator":"=","left":{"type":"MemberExpression","start":299,"end":319,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":299,"end":303},"property":{"type":"Identifier","start":304,"end":319,"name":"keycloakService"}},"right":{"type":"Identifier","start":322,"end":337,"name":"keycloakService"}}}]},"expression":false},"kind":"constructor"},{"type":"MethodDefinition","start":349,"end":1479,"static":false,"computed":false,"decorators":[],"key":{"type":"Identifier","start":349,"end":358,"name":"intercept"},"value":{"type":"FunctionExpression","start":358,"end":1479,"async":false,"generator":false,"id":null,"params":[{"type":"Identifier","start":359,"end":362,"name":"req"},{"type":"Identifier","start":364,"end":368,"name":"next"}],"body":{"type":"BlockStatement","start":370,"end":1479,"body":[{"type":"ExpressionStatement","start":380,"end":422,"expression":{"type":"CallExpression","start":380,"end":421,"optional":false,"callee":{"type":"MemberExpression","start":380,"end":391,"computed":false,"optional":false,"object":{"type":"Identifier","start":380,"end":387,"name":"console"},"property":{"type":"Identifier","start":388,"end":391,"name":"log"}},"arguments":[{"type":"Literal","start":392,"end":420,"value":"[Interceptor] Executing...","raw":"'[Interceptor] Executing...'"}]}},{"type":"ReturnStatement","start":431,"end":1473,"argument":{"type":"CallExpression","start":438,"end":1472,"optional":false,"callee":{"type":"MemberExpression","start":438,"end":485,"computed":false,"optional":false,"object":{"type":"CallExpression","start":438,"end":480,"optional":false,"callee":{"type":"Identifier","start":438,"end":442,"name":"from"},"arguments":[{"type":"CallExpression","start":443,"end":479,"optional":false,"callee":{"type":"MemberExpression","start":443,"end":476,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":443,"end":463,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":443,"end":447},"property":{"type":"Identifier","start":448,"end":463,"name":"keycloakService"}},"property":{"type":"Identifier","start":464,"end":476,"name":"refreshToken"}},"arguments":[{"type":"Literal","start":477,"end":478,"raw":"5","value":5}]}]},"property":{"type":"Identifier","start":481,"end":485,"name":"pipe"}},"arguments":[{"type":"CallExpression","start":486,"end":1213,"optional":false,"callee":{"type":"Identifier","start":486,"end":495,"name":"switchMap"},"arguments":[{"type":"ArrowFunctionExpression","start":496,"end":1212,"async":false,"expression":false,"generator":false,"params":[],"body":{"type":"BlockStatement","start":502,"end":1212,"body":[{"type":"VariableDeclaration","start":516,"end":562,"kind":"const","declarations":[{"type":"VariableDeclarator","start":522,"end":561,"id":{"type":"Identifier","start":522,"end":527,"name":"token"},"init":{"type":"CallExpression","start":530,"end":561,"optional":false,"callee":{"type":"MemberExpression","start":530,"end":559,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":530,"end":550,"computed":false,"optional":false,"object":{"type":"ThisExpression","start":530,"end":534},"property":{"type":"Identifier","start":535,"end":550,"name":"keycloakService"}},"property":{"type":"Identifier","start":551,"end":559,"name":"getToken"}},"arguments":[]}}]},{"type":"ExpressionStatement","start":575,"end":630,"expression":{"type":"CallExpression","start":575,"end":629,"optional":false,"callee":{"type":"MemberExpression","start":575,"end":586,"computed":false,"optional":false,"object":{"type":"Identifier","start":575,"end":582,"name":"console"},"property":{"type":"Identifier","start":583,"end":586,"name":"log"}},"arguments":[{"type":"BinaryExpression","start":587,"end":628,"operator":"+","left":{"type":"Literal","start":587,"end":620,"value":"[Interceptor] is token found...","raw":"'[Interceptor] is token found...'"},"right":{"type":"Identifier","start":623,"end":628,"name":"token"}}]}},{"type":"VariableDeclaration","start":643,"end":661,"kind":"let","declarations":[{"type":"VariableDeclarator","start":647,"end":660,"id":{"type":"Identifier","start":647,"end":654,"name":"authReq"},"init":{"type":"Identifier","start":657,"end":660,"name":"req"}}]},{"type":"IfStatement","start":674,"end":873,"test":{"type":"Identifier","start":678,"end":683,"name":"token"},"consequent":{"type":"BlockStatement","start":685,"end":873,"body":[{"type":"ExpressionStatement","start":703,"end":859,"expression":{"type":"AssignmentExpression","start":703,"end":858,"operator":"=","left":{"type":"Identifier","start":703,"end":710,"name":"authReq"},"right":{"type":"CallExpression","start":713,"end":858,"optional":false,"callee":{"type":"MemberExpression","start":713,"end":722,"computed":false,"optional":false,"object":{"type":"Identifier","start":713,"end":716,"name":"req"},"property":{"type":"Identifier","start":717,"end":722,"name":"clone"}},"arguments":[{"type":"ObjectExpression","start":723,"end":857,"properties":[{"type":"Property","start":745,"end":838,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":745,"end":755,"name":"setHeaders"},"value":{"type":"ObjectExpression","start":757,"end":838,"properties":[{"type":"Property","start":783,"end":815,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":783,"end":796,"name":"Authorization"},"value":{"type":"TemplateLiteral","start":798,"end":815,"quasis":[{"type":"TemplateElement","start":799,"end":806,"tail":false,"value":{"cooked":"Bearer ","raw":"Bearer "}},{"type":"TemplateElement","start":814,"end":814,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":808,"end":813,"name":"token"}]},"kind":"init"}]},"kind":"init"}]}]}}}]},"alternate":null},{"type":"ExpressionStatement","start":917,"end":972,"expression":{"type":"CallExpression","start":917,"end":971,"optional":false,"callee":{"type":"MemberExpression","start":917,"end":928,"computed":false,"optional":false,"object":{"type":"Identifier","start":917,"end":924,"name":"console"},"property":{"type":"Identifier","start":925,"end":928,"name":"log"}},"arguments":[{"type":"Literal","start":929,"end":957,"value":"[Interceptor] Request URL:","raw":"'[Interceptor] Request URL:'"},{"type":"MemberExpression","start":959,"end":970,"computed":false,"optional":false,"object":{"type":"Identifier","start":959,"end":966,"name":"authReq"},"property":{"type":"Identifier","start":967,"end":970,"name":"url"}}]}},{"type":"ExpressionStatement","start":985,"end":1023,"expression":{"type":"CallExpression","start":985,"end":1022,"optional":false,"callee":{"type":"MemberExpression","start":985,"end":996,"computed":false,"optional":false,"object":{"type":"Identifier","start":985,"end":992,"name":"console"},"property":{"type":"Identifier","start":993,"end":996,"name":"log"}},"arguments":[{"type":"Literal","start":997,"end":1021,"value":"[Interceptor] Headers:","raw":"'[Interceptor] Headers:'"}]}},{"type":"ExpressionStatement","start":1036,"end":1161,"expression":{"type":"CallExpression","start":1036,"end":1160,"optional":false,"callee":{"type":"MemberExpression","start":1036,"end":1066,"computed":false,"optional":false,"object":{"type":"CallExpression","start":1036,"end":1058,"optional":false,"callee":{"type":"MemberExpression","start":1036,"end":1056,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":1036,"end":1051,"computed":false,"optional":false,"object":{"type":"Identifier","start":1036,"end":1043,"name":"authReq"},"property":{"type":"Identifier","start":1044,"end":1051,"name":"headers"}},"property":{"type":"Identifier","start":1052,"end":1056,"name":"keys"}},"arguments":[]},"property":{"type":"Identifier","start":1059,"end":1066,"name":"forEach"}},"arguments":[{"type":"ArrowFunctionExpression","start":1067,"end":1159,"async":false,"expression":false,"generator":false,"params":[{"type":"Identifier","start":1067,"end":1070,"name":"key"}],"body":{"type":"BlockStatement","start":1074,"end":1159,"body":[{"type":"ExpressionStatement","start":1092,"end":1145,"expression":{"type":"CallExpression","start":1092,"end":1144,"optional":false,"callee":{"type":"MemberExpression","start":1092,"end":1103,"computed":false,"optional":false,"object":{"type":"Identifier","start":1092,"end":1099,"name":"console"},"property":{"type":"Identifier","start":1100,"end":1103,"name":"log"}},"arguments":[{"type":"TemplateLiteral","start":1104,"end":1143,"quasis":[{"type":"TemplateElement","start":1105,"end":1107,"tail":false,"value":{"cooked":" ","raw":" "}},{"type":"TemplateElement","start":1113,"end":1115,"tail":false,"value":{"cooked":": ","raw":": "}},{"type":"TemplateElement","start":1142,"end":1142,"tail":true,"value":{"cooked":"","raw":""}}],"expressions":[{"type":"Identifier","start":1109,"end":1112,"name":"key"},{"type":"CallExpression","start":1117,"end":1141,"optional":false,"callee":{"type":"MemberExpression","start":1117,"end":1136,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":1117,"end":1132,"computed":false,"optional":false,"object":{"type":"Identifier","start":1117,"end":1124,"name":"authReq"},"property":{"type":"Identifier","start":1125,"end":1132,"name":"headers"}},"property":{"type":"Identifier","start":1133,"end":1136,"name":"get"}},"arguments":[{"type":"Identifier","start":1137,"end":1140,"name":"key"}]}]}]}}]},"id":null}]}},{"type":"ReturnStatement","start":1174,"end":1202,"argument":{"type":"CallExpression","start":1181,"end":1201,"optional":false,"callee":{"type":"MemberExpression","start":1181,"end":1192,"computed":false,"optional":false,"object":{"type":"Identifier","start":1181,"end":1185,"name":"next"},"property":{"type":"Identifier","start":1186,"end":1192,"name":"handle"}},"arguments":[{"type":"Identifier","start":1193,"end":1200,"name":"authReq"}]}}]},"id":null}]},{"type":"CallExpression","start":1215,"end":1471,"optional":false,"callee":{"type":"Identifier","start":1215,"end":1225,"name":"catchError"},"arguments":[{"type":"ArrowFunctionExpression","start":1226,"end":1470,"async":false,"expression":false,"generator":false,"params":[{"type":"Identifier","start":1227,"end":1232,"name":"error"}],"body":{"type":"BlockStatement","start":1237,"end":1470,"body":[{"type":"ExpressionStatement","start":1251,"end":1301,"expression":{"type":"CallExpression","start":1251,"end":1300,"optional":false,"callee":{"type":"MemberExpression","start":1251,"end":1264,"computed":false,"optional":false,"object":{"type":"Identifier","start":1251,"end":1258,"name":"console"},"property":{"type":"Identifier","start":1259,"end":1264,"name":"error"}},"arguments":[{"type":"Literal","start":1265,"end":1292,"value":"[Interceptor] HTTP Error:","raw":"'[Interceptor] HTTP Error:'"},{"type":"Identifier","start":1294,"end":1299,"name":"error"}]}},{"type":"IfStatement","start":1314,"end":1416,"test":{"type":"BinaryExpression","start":1318,"end":1338,"operator":"===","left":{"type":"MemberExpression","start":1318,"end":1330,"computed":false,"optional":false,"object":{"type":"Identifier","start":1318,"end":1323,"name":"error"},"property":{"type":"Identifier","start":1324,"end":1330,"name":"status"}},"right":{"type":"Literal","start":1335,"end":1338,"raw":"401","value":401}},"consequent":{"type":"BlockStatement","start":1340,"end":1416,"body":[{"type":"ExpressionStatement","start":1358,"end":1402,"expression":{"type":"CallExpression","start":1358,"end":1401,"optional":false,"callee":{"type":"MemberExpression","start":1358,"end":1371,"computed":false,"optional":false,"object":{"type":"Identifier","start":1358,"end":1365,"name":"console"},"property":{"type":"Identifier","start":1366,"end":1371,"name":"error"}},"arguments":[{"type":"Literal","start":1372,"end":1400,"value":"[Interceptor] Unauthorized","raw":"'[Interceptor] Unauthorized'"}]}}]},"alternate":null},{"type":"ReturnStatement","start":1429,"end":1460,"argument":{"type":"CallExpression","start":1436,"end":1459,"optional":false,"callee":{"type":"Identifier","start":1436,"end":1446,"name":"throwError"},"arguments":[{"type":"ArrowFunctionExpression","start":1447,"end":1458,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"Identifier","start":1453,"end":1458,"name":"error"},"id":null}]}}]},"id":null}]}]}}]},"expression":false},"kind":"method"},{"type":"PropertyDefinition","start":1484,"end":1690,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1491,"end":1495,"name":"ɵfac"},"value":{"type":"CallExpression","start":1498,"end":1689,"optional":false,"callee":{"type":"MemberExpression","start":1498,"end":1519,"computed":false,"optional":false,"object":{"type":"Identifier","start":1498,"end":1500,"name":"i0"},"property":{"type":"Identifier","start":1501,"end":1519,"name":"ɵɵngDeclareFactory"}},"arguments":[{"type":"ObjectExpression","start":1520,"end":1688,"properties":[{"type":"Property","start":1522,"end":1542,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1522,"end":1532,"name":"minVersion"},"value":{"type":"Literal","start":1534,"end":1542,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1544,"end":1562,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1544,"end":1551,"name":"version"},"value":{"type":"Literal","start":1553,"end":1562,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1564,"end":1576,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1564,"end":1572,"name":"ngImport"},"value":{"type":"Identifier","start":1574,"end":1576,"name":"i0"},"kind":"init"},{"type":"Property","start":1578,"end":1608,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1578,"end":1582,"name":"type"},"value":{"type":"Identifier","start":1584,"end":1608,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1610,"end":1647,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1610,"end":1614,"name":"deps"},"value":{"type":"ArrayExpression","start":1616,"end":1647,"elements":[{"type":"ObjectExpression","start":1617,"end":1646,"properties":[{"type":"Property","start":1619,"end":1644,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1619,"end":1624,"name":"token"},"value":{"type":"MemberExpression","start":1626,"end":1644,"computed":false,"optional":false,"object":{"type":"Identifier","start":1626,"end":1628,"name":"i1"},"property":{"type":"Identifier","start":1629,"end":1644,"name":"KeycloakService"}},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":1649,"end":1686,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1649,"end":1655,"name":"target"},"value":{"type":"MemberExpression","start":1657,"end":1686,"computed":false,"optional":false,"object":{"type":"MemberExpression","start":1657,"end":1675,"computed":false,"optional":false,"object":{"type":"Identifier","start":1657,"end":1659,"name":"i0"},"property":{"type":"Identifier","start":1660,"end":1675,"name":"ɵɵFactoryTarget"}},"property":{"type":"Identifier","start":1676,"end":1686,"name":"Injectable"}},"kind":"init"}]}]}},{"type":"PropertyDefinition","start":1695,"end":1827,"static":true,"computed":false,"decorators":[],"key":{"type":"Identifier","start":1702,"end":1707,"name":"ɵprov"},"value":{"type":"CallExpression","start":1710,"end":1826,"optional":false,"callee":{"type":"MemberExpression","start":1710,"end":1734,"computed":false,"optional":false,"object":{"type":"Identifier","start":1710,"end":1712,"name":"i0"},"property":{"type":"Identifier","start":1713,"end":1734,"name":"ɵɵngDeclareInjectable"}},"arguments":[{"type":"ObjectExpression","start":1735,"end":1825,"properties":[{"type":"Property","start":1737,"end":1757,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1737,"end":1747,"name":"minVersion"},"value":{"type":"Literal","start":1749,"end":1757,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1759,"end":1777,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1759,"end":1766,"name":"version"},"value":{"type":"Literal","start":1768,"end":1777,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1779,"end":1791,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1779,"end":1787,"name":"ngImport"},"value":{"type":"Identifier","start":1789,"end":1791,"name":"i0"},"kind":"init"},{"type":"Property","start":1793,"end":1823,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1793,"end":1797,"name":"type"},"value":{"type":"Identifier","start":1799,"end":1823,"name":"AuthorizationInterceptor"},"kind":"init"}]}]}}]}}},{"type":"ExpressionStatement","start":1830,"end":2060,"expression":{"type":"CallExpression","start":1830,"end":2059,"optional":false,"callee":{"type":"MemberExpression","start":1830,"end":1857,"computed":false,"optional":false,"object":{"type":"Identifier","start":1830,"end":1832,"name":"i0"},"property":{"type":"Identifier","start":1833,"end":1857,"name":"ɵɵngDeclareClassMetadata"}},"arguments":[{"type":"ObjectExpression","start":1858,"end":2058,"properties":[{"type":"Property","start":1860,"end":1880,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1860,"end":1870,"name":"minVersion"},"value":{"type":"Literal","start":1872,"end":1880,"value":"12.0.0","raw":"\"12.0.0\""},"kind":"init"},{"type":"Property","start":1882,"end":1900,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1882,"end":1889,"name":"version"},"value":{"type":"Literal","start":1891,"end":1900,"value":"19.2.14","raw":"\"19.2.14\""},"kind":"init"},{"type":"Property","start":1902,"end":1914,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1902,"end":1910,"name":"ngImport"},"value":{"type":"Identifier","start":1912,"end":1914,"name":"i0"},"kind":"init"},{"type":"Property","start":1916,"end":1946,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1916,"end":1920,"name":"type"},"value":{"type":"Identifier","start":1922,"end":1946,"name":"AuthorizationInterceptor"},"kind":"init"},{"type":"Property","start":1948,"end":2002,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1948,"end":1958,"name":"decorators"},"value":{"type":"ArrayExpression","start":1960,"end":2002,"elements":[{"type":"ObjectExpression","start":1961,"end":2001,"properties":[{"type":"Property","start":1975,"end":1991,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":1975,"end":1979,"name":"type"},"value":{"type":"Identifier","start":1981,"end":1991,"name":"Injectable"},"kind":"init"}]}]},"kind":"init"},{"type":"Property","start":2004,"end":2056,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":2004,"end":2018,"name":"ctorParameters"},"value":{"type":"ArrowFunctionExpression","start":2020,"end":2056,"async":false,"expression":true,"generator":false,"params":[],"body":{"type":"ArrayExpression","start":2026,"end":2056,"elements":[{"type":"ObjectExpression","start":2027,"end":2055,"properties":[{"type":"Property","start":2029,"end":2053,"method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","start":2029,"end":2033,"name":"type"},"value":{"type":"MemberExpression","start":2035,"end":2053,"computed":false,"optional":false,"object":{"type":"Identifier","start":2035,"end":2037,"name":"i1"},"property":{"type":"Identifier","start":2038,"end":2053,"name":"KeycloakService"}},"kind":"init"}]}]},"id":null},"kind":"init"}]}]}}],"_rollupRemoved":[{"end":6699,"start":2061,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"import { Injectable } from '@angular/core';\nimport { catchError, from, switchMap, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n // Log all headers\n console.log('[Interceptor] Request URL:', authReq.url);\n console.log('[Interceptor] Headers:');\n authReq.headers.keys().forEach(key => {\n console.log(` ${key}: ${authReq.headers.get(key)}`);\n });\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphdGlvbi5pbnRlcmNlcHRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9saWIvY29yZS9hdXRob3JpemF0aW9uLmludGVyY2VwdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGlu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AgICAgICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgLy8gTG9nIGFsbCBoZWFkZXJzXHJcbiAgICAgICAgICAgICAgY29uc29sZS5sb2coJ1tJbnRlcmNlcHRvcl0gUmVxdWVzdCBVUkw6JywgYXV0aFJlcS51cmwpO1xyXG4gICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdbSW50ZXJjZXB0b3JdIEhlYWRlcnM6Jyk7XHJcbiAgICAgICAgICAgICAgYXV0aFJlcS5oZWFkZXJzLmtleXMoKS5mb3JFYWNoKGtleSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGAgICR7a2V5fTogJHthdXRoUmVxLmhlYWRlcnMuZ2V0KGtleSl9YCk7XHJcbiAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICAgIHJldHVybiBuZXh0LmhhbmRsZShhdXRoUmVxKTtcclxuICAgICAgICAgIH0pLFxyXG4gICAgICAgICAgY2F0Y2hFcnJvcigoZXJyb3I6IEh0dHBFcnJvclJlc3BvbnNlKSA9PiB7XHJcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBIVFRQIEVycm9yOicsIGVycm9yKTtcclxuICAgICAgICAgICAgICBpZiAoZXJyb3Iuc3RhdHVzID09PSA0MDEpIHtcclxuICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQnKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgcmV0dXJuIHRocm93RXJyb3IoKCkgPT4gZXJyb3IpO1xyXG4gICAgICAgICAgfSlcclxuICAgICAgKTtcclxuICB9XHJcbn1cclxuXHJcbiJdfQ==","customTransformCache":false,"dependencies":["@angular/core","rxjs","quankee-framework-keycloak"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"import { Injectable } from '@angular/core';\nimport { catchError, from, switchMap, throwError } from 'rxjs';\nimport * as i0 from \"@angular/core\";\nimport * as i1 from \"quankee-framework-keycloak\";\nexport class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n // Log all headers\n console.log('[Interceptor] Request URL:', authReq.url);\n console.log('[Interceptor] Headers:');\n authReq.headers.keys().forEach(key => {\n console.log(` ${key}: ${authReq.headers.get(key)}`);\n });\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yaXphd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4uLicgKyB0b2tlbik7XHJcbiAgICAgICAgICAgICAgbGV0IGF1dGhSZXEgPSByZXE7XHJcblxyXG4gICAgICAgICAgICAgIGlmICh0b2tlbikge1xyXG4gICAgICAgICAgICAgICAgICBhdXRoUmVxID0gcmVxLmNsb25lKHtcclxuICAgICAgICAgICAgICAgICAgICAgIHNldEhlYWRlcnM6IHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICBBdXRob3JpemF0aW9uOiBgQmVhcmVyICR7dG9rZW59YCxcclxuICAgICAgICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgLy8gTG9nIGFsbCBoZWFkZXJzXHJcbiAgICAgICAgICAgICAgY29uc29sZS5sb2coJ1tJbnRlcmNlcHRvcl0gUmVxdWVzdCBVUkw6JywgYXV0aFJlcS51cmwpO1xyXG4gICAgICAgICAgICAgIGNvbnNvbGUubG9nKCdbSW50ZXJjZXB0b3JdIEhlYWRlcnM6Jyk7XHJcbiAgICAgICAgICAgICAgYXV0aFJlcS5oZWFkZXJzLmtleXMoKS5mb3JFYWNoKGtleSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGAgICR7a2V5fTogJHthdXRoUmVxLmhlYWRlcnMuZ2V0KGtleSl9YCk7XHJcbiAgICAgICAgICAgICAgfSk7XHJcblxyXG4gICAgICAgICAgICAgIHJldHVybiBuZXh0LmhhbmRsZShhdXRoUmVxKTtcclxuICAgICAgICAgIH0pLFxyXG4gICAgICAgICAgY2F0Y2hFcnJvcigoZXJyb3I6IEh0dHBFcnJvclJlc3BvbnNlKSA9PiB7XHJcbiAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBIVFRQIEVycm9yOicsIGVycm9yKTtcclxuICAgICAgICAgICAgICBpZiAoZXJyb3Iuc3RhdHVzID09PSA0MDEpIHtcclxuICAgICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcignW0ludGVyY2VwdG9yXSBVbmF1dGhvcml6ZWQnKTtcclxuICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgcmV0dXJuIHRocm93RXJyb3IoKCkgPT4gZXJyb3IpO1xyXG4gICAgICAgICAgfSlcclxuICAgICAgKTtcclxuICB9XHJcbn1cclxuXHJcbiJdfQ==","originalSourcemap":{"version":3,"file":"authorization.interceptor.js","sourceRoot":"","sources":["../../../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts"],"names":[],"mappings":[[[0,0,1,0],[7,0,1,7],[9,0,1,8],[19,0,1,18],[21,0,1,19],[27,0,1,25],[42,0,1,40],[43,0,1,41]],[[0,0,3,0],[7,0,3,7],[9,0,3,8],[19,0,3,18],[21,0,3,20],[25,0,3,24],[27,0,3,38],[36,0,3,47],[38,0,3,49],[48,0,3,59],[50,0,3,60],[56,0,3,66],[62,0,3,72],[63,0,3,73]],[],[],[[0,0,6,0],[6,0,6,6],[13,0,6,13],[37,0,6,37]],[[4,0,8,31]],[[4,0,8,2],[16,0,8,31],[31,0,8,63]],[[8,0,8,31],[28,0,8,46],[31,0,8,31],[46,0,8,46],[47,0,8,63]],[[4,0,8,66],[5,0,8,67]],[[4,0,10,2],[13,0,10,11],[14,0,10,12],[17,0,10,33],[19,0,10,35],[23,0,10,52]],[[8,0,11,4],[15,0,11,11],[16,0,11,12],[19,0,11,15],[20,0,11,16],[48,0,11,44],[49,0,11,45],[50,0,11,46]],[[8,0,13,6],[15,0,13,13],[19,0,13,17],[20,0,13,18],[24,0,13,22],[25,0,13,23],[40,0,13,38],[41,0,13,39],[53,0,13,51],[54,0,13,52],[55,0,13,53],[56,0,13,54],[57,0,13,55],[58,0,13,56],[62,0,13,60],[63,0,14,10],[72,0,14,19],[73,0,14,20],[76,0,14,23],[78,0,14,25]],[[12,0,15,14],[18,0,15,20],[23,0,15,25],[26,0,15,28],[30,0,15,32],[31,0,15,33],[46,0,15,48],[47,0,15,49],[55,0,15,57],[57,0,15,59],[58,0,15,60]],[[12,0,16,14],[19,0,16,21],[20,0,16,22],[23,0,16,25],[24,0,16,26],[57,0,16,59],[60,0,16,62],[65,0,16,67],[66,0,16,68],[67,0,16,69]],[[12,0,17,14],[16,0,17,18],[23,0,17,25],[26,0,17,28],[29,0,17,31],[30,0,17,32]],[[12,0,19,14],[16,0,19,18],[21,0,19,23],[23,0,19,25],[24,0,19,26]],[[16,0,20,18],[23,0,20,25],[26,0,20,28],[29,0,20,31],[30,0,20,32],[35,0,20,37],[36,0,20,38]],[[20,0,21,22],[30,0,21,32],[32,0,21,34]],[[24,0,22,26],[37,0,22,39],[39,0,22,41],[49,0,22,51],[54,0,22,56],[56,0,22,58]],[[21,0,23,23]],[[17,0,24,19],[18,0,24,20],[19,0,24,21]],[[12,0,25,14],[13,0,25,15]],[[12,0,27,14],[30,0,27,32]],[[12,0,28,14],[19,0,28,21],[20,0,28,22],[23,0,28,25],[24,0,28,26],[52,0,28,54],[54,0,28,56],[61,0,28,63],[62,0,28,64],[65,0,28,67],[66,0,28,68],[67,0,28,69]],[[12,0,29,14],[19,0,29,21],[20,0,29,22],[23,0,29,25],[24,0,29,26],[48,0,29,50],[49,0,29,51],[50,0,29,52]],[[12,0,30,14],[19,0,30,21],[20,0,30,22],[27,0,30,29],[28,0,30,30],[32,0,30,34],[34,0,30,36],[35,0,30,37],[42,0,30,44],[43,0,30,45],[46,0,30,48],[47,0,30,49],[49,0,30,51]],[[16,0,31,18],[23,0,31,25],[24,0,31,26],[27,0,31,29],[28,0,31,30],[33,0,31,35],[36,0,31,38],[41,0,31,43],[48,0,31,50],[49,0,31,51],[56,0,31,58],[57,0,31,59],[60,0,31,62],[61,0,31,63],[64,0,31,66],[65,0,31,67],[67,0,31,69],[68,0,31,70],[69,0,31,71]],[[12,0,32,14],[13,0,32,15],[14,0,32,16],[15,0,32,17]],[[12,0,34,14],[19,0,34,21],[23,0,34,25],[24,0,34,26],[30,0,34,32],[31,0,34,33],[38,0,34,40],[39,0,34,41],[40,0,34,42]],[[8,0,35,10],[9,0,35,11],[10,0,35,12],[12,0,36,10],[22,0,36,20],[23,0,36,21],[24,0,36,22],[29,0,36,46],[31,0,36,48],[33,0,36,50]],[[12,0,37,14],[19,0,37,21],[20,0,37,22],[25,0,37,27],[26,0,37,28],[53,0,37,55],[55,0,37,57],[60,0,37,62],[61,0,37,63],[62,0,37,64]],[[12,0,38,14],[16,0,38,18],[21,0,38,23],[22,0,38,24],[28,0,38,30],[33,0,38,35],[36,0,38,38],[38,0,38,40],[39,0,38,41]],[[16,0,39,18],[23,0,39,25],[24,0,39,26],[29,0,39,31],[30,0,39,32],[58,0,39,60],[59,0,39,61],[60,0,39,62]],[[12,0,40,14],[13,0,40,15]],[[12,0,41,14],[19,0,41,21],[29,0,41,31],[30,0,41,32],[33,0,41,35],[35,0,41,37],[36,0,41,38],[41,0,41,43],[42,0,41,44],[43,0,41,45]],[[8,0,42,10],[9,0,42,11],[10,0,42,12],[11,0,43,7],[12,0,43,8]],[[4,0,44,2],[5,0,44,3]],[[104,0,6,13],[128,0,6,37]],[[108,0,6,13],[132,0,6,37]],[],[[92,0,6,13],[116,0,6,37]],[[18,0,5,1],[28,0,5,11]]],"sourcesContent":["import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\r\nimport {Injectable} from '@angular/core';\r\nimport {KeycloakService} from 'quankee-framework-keycloak';\r\nimport {catchError, from, Observable, switchMap, throwError} from 'rxjs';\r\n\r\n@Injectable()\r\nexport class AuthorizationInterceptor implements HttpInterceptor {\r\n\r\n constructor(private readonly keycloakService: KeycloakService) {}\r\n\r\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\r\n console.log('[Interceptor] Executing...');\r\n\r\n return from(this.keycloakService.refreshToken(5)).pipe(\r\n switchMap(() => {\r\n const token = this.keycloakService.getToken();\r\n console.log('[Interceptor] is token found...' + token);\r\n let authReq = req;\r\n\r\n if (token) {\r\n authReq = req.clone({\r\n setHeaders: {\r\n Authorization: `Bearer ${token}`,\r\n },\r\n });\r\n }\r\n\r\n // Log all headers\r\n console.log('[Interceptor] Request URL:', authReq.url);\r\n console.log('[Interceptor] Headers:');\r\n authReq.headers.keys().forEach(key => {\r\n console.log(` ${key}: ${authReq.headers.get(key)}`);\r\n });\r\n\r\n return next.handle(authReq);\r\n }),\r\n catchError((error: HttpErrorResponse) => {\r\n console.error('[Interceptor] HTTP Error:', error);\r\n if (error.status === 401) {\r\n console.error('[Interceptor] Unauthorized');\r\n }\r\n return throwError(() => error);\r\n })\r\n );\r\n }\r\n}\r\n\r\n"]},"resolvedIds":{"@angular/core":{"attributes":{},"external":true,"id":"@angular/core","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"rxjs":{"attributes":{},"external":true,"id":"rxjs","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false},"quankee-framework-keycloak":{"attributes":{},"external":true,"id":"quankee-framework-keycloak","meta":{},"moduleSideEffects":true,"resolvedBy":"rollup","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":755,"body":[{"type":"ExportAllDeclaration","start":62,"end":102,"exported":null,"source":{"type":"Literal","start":76,"end":101,"value":"./lib/core/token.helper","raw":"'./lib/core/token.helper'"},"attributes":[]},{"type":"ExportAllDeclaration","start":103,"end":156,"exported":null,"source":{"type":"Literal","start":117,"end":155,"value":"./lib/core/authorization.interceptor","raw":"'./lib/core/authorization.interceptor'"},"attributes":[]}],"_rollupRemoved":[{"end":755,"start":157,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs"],"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/*\n * Public API Surface of quankee-framework-interceptor\n */\nexport * from './lib/core/token.helper';\nexport * from './lib/core/authorization.interceptor';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL3F1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yL3NyYy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyx5QkFBeUIsQ0FBQztBQUN4QyxjQUFjLHNDQUFzQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLypcclxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIHF1YW5rZWUtZnJhbWV3b3JrLWludGVyY2VwdG9yXHJcbiAqL1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvY29yZS90b2tlbi5oZWxwZXInO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9jb3JlL2F1dGhvcml6YXRpb24uaW50ZXJjZXB0b3InO1xyXG4iXX0=","originalSourcemap":{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/public-api.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[39,0,4,39],[40,0,4,40]],[[0,0,5,0],[14,0,5,14],[52,0,5,52],[53,0,5,53]]],"sourcesContent":["/*\r\n * Public API Surface of quankee-framework-interceptor\r\n */\r\n\r\nexport * from './lib/core/token.helper';\r\nexport * from './lib/core/authorization.interceptor';\r\n"]},"resolvedIds":{"./lib/core/token.helper":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false},"./lib/core/authorization.interceptor":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]},{"ast":{"type":"Program","start":0,"end":572,"body":[{"type":"ExportAllDeclaration","start":48,"end":77,"exported":null,"source":{"type":"Literal","start":62,"end":76,"value":"./public-api","raw":"'./public-api'"},"attributes":[]}],"_rollupRemoved":[{"end":572,"start":78,"type":"sourcemap"}],"sourceType":"module"},"attributes":{},"code":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","customTransformCache":false,"dependencies":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs"],"id":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","meta":{},"moduleSideEffects":true,"originalCode":"/**\n * Generated bundle index. Do not edit.\n */\nexport * from './public-api';\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9xdWFua2VlLWZyYW1ld29yay1pbnRlcmNlcHRvci9zcmMvcXVhbmtlZS1mcmFtZXdvcmstaW50ZXJjZXB0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==","originalSourcemap":{"version":3,"file":"quankee-framework-interceptor.js","sourceRoot":"","sources":["../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts"],"names":[],"mappings":[[[0,0,0,0]],[],[[3,0,2,3]],[[0,0,4,0],[14,0,4,14],[28,0,4,28],[29,0,4,29]]],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"]},"resolvedIds":{"./public-api":{"attributes":{},"external":false,"id":"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","meta":{},"moduleSideEffects":true,"resolvedBy":"file-loader","syntheticNamedExports":false}},"sourcemapChain":[],"syntheticNamedExports":false,"transformDependencies":[]}],"plugins":{"file-loader":{},"json":{}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"hash":"85398286d0e703d2d7bf617c747331c3a8219525009cb872d8da3eb53adc192c","fesm2022":[{"exports":["AuthorizationInterceptor","injectAuthHeader"],"facadeModuleId":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","isDynamicEntry":false,"isEntry":true,"isImplicitEntry":false,"moduleIds":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs"],"name":"quankee-framework-interceptor","type":"chunk","dynamicImports":[],"fileName":"quankee-framework-interceptor.mjs","implicitlyLoadedBefore":[],"importedBindings":{"@angular/core":["*","Injectable"],"rxjs":["catchError","throwError"],"quankee-framework-keycloak":["*"]},"imports":["@angular/core","rxjs","quankee-framework-keycloak"],"modules":{"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs":{"code":"function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}","originalLength":1112,"removedExports":[],"renderedExports":["injectAuthHeader"],"renderedLength":210},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs":{"code":"class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });","originalLength":5214,"removedExports":[],"renderedExports":["AuthorizationInterceptor"],"renderedLength":1546},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs":{"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */","originalLength":755,"removedExports":[],"renderedExports":[],"renderedLength":61},"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs":{"code":"/**\n * Generated bundle index. Do not edit.\n */","originalLength":572,"removedExports":[],"renderedExports":[],"renderedLength":47}},"referencedFiles":[],"code":"import * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\nimport { catchError, throwError } from 'rxjs';\nimport * as i1 from 'quankee-framework-keycloak';\n\nfunction injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n\nclass AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n const token = this.keycloakService.getToken(); // returns string\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n console.log('[Interceptor] token found...' + token);\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return next.handle(authReq).pipe(catchError((error) => {\n console.error('HTTP Error:', error);\n if (error.status === 401) {\n // handle unauthorized\n console.error('[Interceptor] Unauthorized.');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n\n/*\n * Public API Surface of quankee-framework-interceptor\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { AuthorizationInterceptor, injectAuthHeader };\n//# sourceMappingURL=quankee-framework-interceptor.mjs.map\n","map":null,"preliminaryFileName":"quankee-framework-interceptor.mjs","sourcemapFileName":"quankee-framework-interceptor.mjs.map"},{"fileName":"quankee-framework-interceptor.mjs.map","names":[],"needsCodeReference":false,"originalFileName":null,"originalFileNames":[],"source":"{\"version\":3,\"file\":\"quankee-framework-interceptor.mjs\",\"sources\":[\"../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts\",\"../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts\",\"../../../projects/quankee-framework-interceptor/src/public-api.ts\",\"../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts\"],\"sourcesContent\":[\"export function injectAuthHeader(req: any, token: any): any {\\r\\n if (token) {\\r\\n return req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n return req;\\r\\n}\\r\\n\",\"import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\\r\\nimport {Injectable} from '@angular/core';\\r\\nimport {KeycloakService} from 'quankee-framework-keycloak';\\r\\nimport {catchError, Observable, throwError} from 'rxjs';\\r\\n\\r\\n@Injectable()\\r\\nexport class AuthorizationInterceptor implements HttpInterceptor {\\r\\n\\r\\n constructor(private readonly keycloakService: KeycloakService) {}\\r\\n\\r\\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\\r\\n console.log('[Interceptor] Executing...');\\r\\n\\r\\n const token = this.keycloakService.getToken(); // returns string\\r\\n console.log('[Interceptor] is token found...' + token);\\r\\n let authReq = req;\\r\\n\\r\\n if (token) {\\r\\n console.log('[Interceptor] token found...' + token);\\r\\n authReq = req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n return next.handle(authReq).pipe(\\r\\n catchError((error: HttpErrorResponse) => {\\r\\n console.error('HTTP Error:', error);\\r\\n if (error.status === 401) {\\r\\n // handle unauthorized\\r\\n console.error('[Interceptor] Unauthorized.')\\r\\n }\\r\\n return throwError(() => error);\\r\\n })\\r\\n );\\r\\n }\\r\\n}\\r\\n\",\"/*\\r\\n * Public API Surface of quankee-framework-interceptor\\r\\n */\\r\\n\\r\\nexport * from './lib/core/token.helper';\\r\\nexport * from './lib/core/authorization.interceptor';\\r\\n\",\"/**\\n * Generated bundle index. Do not edit.\\n */\\n\\nexport * from './public-api';\\n\"],\"names\":[],\"mappings\":\";;;;;AAAgB,SAAA,gBAAgB,CAAC,GAAQ,EAAE,KAAU,EAAA;IACnD,IAAI,KAAK,EAAE;QACT,OAAO,GAAG,CAAC,KAAK,CAAC;AACf,YAAA,UAAU,EAAE;gBACV,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACjC,aAAA;AACF,SAAA,CAAC;;AAEJ,IAAA,OAAO,GAAG;AACZ;;MCHa,wBAAwB,CAAA;AAEN,IAAA,eAAA;AAA7B,IAAA,WAAA,CAA6B,eAAgC,EAAA;QAAhC,IAAe,CAAA,eAAA,GAAf,eAAe;;IAE5C,SAAS,CAAC,GAAqB,EAAE,IAAiB,EAAA;AAChD,QAAA,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;QAEzC,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;AAC9C,QAAA,OAAO,CAAC,GAAG,CAAC,iCAAiC,GAAG,KAAK,CAAC;QACtD,IAAI,OAAO,GAAG,GAAG;QAEjB,IAAI,KAAK,EAAE;AACT,YAAA,OAAO,CAAC,GAAG,CAAC,8BAA8B,GAAG,KAAK,CAAC;AACnD,YAAA,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC;AAClB,gBAAA,UAAU,EAAE;oBACV,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACjC,iBAAA;AACF,aAAA,CAAC;;AAEJ,QAAA,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAC5B,UAAU,CAAC,CAAC,KAAwB,KAAI;AACtC,YAAA,OAAO,CAAC,KAAK,CAAC,aAAa,EAAE,KAAK,CAAC;AACnC,YAAA,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE;;AAExB,gBAAA,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC;;AAE9C,YAAA,OAAO,UAAU,CAAC,MAAM,KAAK,CAAC;SAC/B,CAAC,CACL;;wGA5BQ,wBAAwB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,eAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAxB,wBAAwB,EAAA,CAAA;;4FAAxB,wBAAwB,EAAA,UAAA,EAAA,CAAA;kBADpC;;;ACLD;;AAEG;;ACFH;;AAEG;;;;\"}","type":"asset"}]}
|
|
1
|
+
{"hash":"bd631668d5cee66ea14bdf18a52b502bc4f4c495a45a27d698507fe675c96263","fesm2022":[{"exports":["AuthorizationInterceptor","injectAuthHeader"],"facadeModuleId":"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs","isDynamicEntry":false,"isEntry":true,"isImplicitEntry":false,"moduleIds":["C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs","C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs","C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs"],"name":"quankee-framework-interceptor","type":"chunk","dynamicImports":[],"fileName":"quankee-framework-interceptor.mjs","implicitlyLoadedBefore":[],"importedBindings":{"@angular/core":["*","Injectable"],"rxjs":["from","switchMap","catchError","throwError"],"quankee-framework-keycloak":["*"]},"imports":["@angular/core","rxjs","quankee-framework-keycloak"],"modules":{"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/token.helper.mjs":{"code":"function injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}","originalLength":1112,"removedExports":[],"renderedExports":["injectAuthHeader"],"renderedLength":210},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/lib/core/authorization.interceptor.mjs":{"code":"class AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n // Log all headers\n console.log('[Interceptor] Request URL:', authReq.url);\n console.log('[Interceptor] Headers:');\n authReq.headers.keys().forEach(key => {\n console.log(` ${key}: ${authReq.headers.get(key)}`);\n });\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });","originalLength":6699,"removedExports":[],"renderedExports":["AuthorizationInterceptor"],"renderedLength":1858},"C:/usr/local/workspaces/workspace-quankee/quankee-framework/quankee-framework-common-ts/dist/quankee-framework-interceptor/esm2022/public-api.mjs":{"code":"/*\n * Public API Surface of quankee-framework-interceptor\n */","originalLength":755,"removedExports":[],"renderedExports":[],"renderedLength":61},"C:\\usr\\local\\workspaces\\workspace-quankee\\quankee-framework\\quankee-framework-common-ts\\dist\\quankee-framework-interceptor\\esm2022\\quankee-framework-interceptor.mjs":{"code":"/**\n * Generated bundle index. Do not edit.\n */","originalLength":572,"removedExports":[],"renderedExports":[],"renderedLength":47}},"referencedFiles":[],"code":"import * as i0 from '@angular/core';\nimport { Injectable } from '@angular/core';\nimport { from, switchMap, catchError, throwError } from 'rxjs';\nimport * as i1 from 'quankee-framework-keycloak';\n\nfunction injectAuthHeader(req, token) {\n if (token) {\n return req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n return req;\n}\n\nclass AuthorizationInterceptor {\n keycloakService;\n constructor(keycloakService) {\n this.keycloakService = keycloakService;\n }\n intercept(req, next) {\n console.log('[Interceptor] Executing...');\n return from(this.keycloakService.refreshToken(5)).pipe(switchMap(() => {\n const token = this.keycloakService.getToken();\n console.log('[Interceptor] is token found...' + token);\n let authReq = req;\n if (token) {\n authReq = req.clone({\n setHeaders: {\n Authorization: `Bearer ${token}`,\n },\n });\n }\n // Log all headers\n console.log('[Interceptor] Request URL:', authReq.url);\n console.log('[Interceptor] Headers:');\n authReq.headers.keys().forEach(key => {\n console.log(` ${key}: ${authReq.headers.get(key)}`);\n });\n return next.handle(authReq);\n }), catchError((error) => {\n console.error('[Interceptor] HTTP Error:', error);\n if (error.status === 401) {\n console.error('[Interceptor] Unauthorized');\n }\n return throwError(() => error);\n }));\n }\n static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, deps: [{ token: i1.KeycloakService }], target: i0.ɵɵFactoryTarget.Injectable });\n static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor });\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"19.2.14\", ngImport: i0, type: AuthorizationInterceptor, decorators: [{\n type: Injectable\n }], ctorParameters: () => [{ type: i1.KeycloakService }] });\n\n/*\n * Public API Surface of quankee-framework-interceptor\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { AuthorizationInterceptor, injectAuthHeader };\n//# sourceMappingURL=quankee-framework-interceptor.mjs.map\n","map":null,"preliminaryFileName":"quankee-framework-interceptor.mjs","sourcemapFileName":"quankee-framework-interceptor.mjs.map"},{"fileName":"quankee-framework-interceptor.mjs.map","names":[],"needsCodeReference":false,"originalFileName":null,"originalFileNames":[],"source":"{\"version\":3,\"file\":\"quankee-framework-interceptor.mjs\",\"sources\":[\"../../../projects/quankee-framework-interceptor/src/lib/core/token.helper.ts\",\"../../../projects/quankee-framework-interceptor/src/lib/core/authorization.interceptor.ts\",\"../../../projects/quankee-framework-interceptor/src/public-api.ts\",\"../../../projects/quankee-framework-interceptor/src/quankee-framework-interceptor.ts\"],\"sourcesContent\":[\"export function injectAuthHeader(req: any, token: any): any {\\r\\n if (token) {\\r\\n return req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n return req;\\r\\n}\\r\\n\",\"import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from '@angular/common/http';\\r\\nimport {Injectable} from '@angular/core';\\r\\nimport {KeycloakService} from 'quankee-framework-keycloak';\\r\\nimport {catchError, from, Observable, switchMap, throwError} from 'rxjs';\\r\\n\\r\\n@Injectable()\\r\\nexport class AuthorizationInterceptor implements HttpInterceptor {\\r\\n\\r\\n constructor(private readonly keycloakService: KeycloakService) {}\\r\\n\\r\\n intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {\\r\\n console.log('[Interceptor] Executing...');\\r\\n\\r\\n return from(this.keycloakService.refreshToken(5)).pipe(\\r\\n switchMap(() => {\\r\\n const token = this.keycloakService.getToken();\\r\\n console.log('[Interceptor] is token found...' + token);\\r\\n let authReq = req;\\r\\n\\r\\n if (token) {\\r\\n authReq = req.clone({\\r\\n setHeaders: {\\r\\n Authorization: `Bearer ${token}`,\\r\\n },\\r\\n });\\r\\n }\\r\\n\\r\\n // Log all headers\\r\\n console.log('[Interceptor] Request URL:', authReq.url);\\r\\n console.log('[Interceptor] Headers:');\\r\\n authReq.headers.keys().forEach(key => {\\r\\n console.log(` ${key}: ${authReq.headers.get(key)}`);\\r\\n });\\r\\n\\r\\n return next.handle(authReq);\\r\\n }),\\r\\n catchError((error: HttpErrorResponse) => {\\r\\n console.error('[Interceptor] HTTP Error:', error);\\r\\n if (error.status === 401) {\\r\\n console.error('[Interceptor] Unauthorized');\\r\\n }\\r\\n return throwError(() => error);\\r\\n })\\r\\n );\\r\\n }\\r\\n}\\r\\n\\r\\n\",\"/*\\r\\n * Public API Surface of quankee-framework-interceptor\\r\\n */\\r\\n\\r\\nexport * from './lib/core/token.helper';\\r\\nexport * from './lib/core/authorization.interceptor';\\r\\n\",\"/**\\n * Generated bundle index. Do not edit.\\n */\\n\\nexport * from './public-api';\\n\"],\"names\":[],\"mappings\":\";;;;;AAAgB,SAAA,gBAAgB,CAAC,GAAQ,EAAE,KAAU,EAAA;IACnD,IAAI,KAAK,EAAE;QACT,OAAO,GAAG,CAAC,KAAK,CAAC;AACf,YAAA,UAAU,EAAE;gBACV,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACjC,aAAA;AACF,SAAA,CAAC;;AAEJ,IAAA,OAAO,GAAG;AACZ;;MCHa,wBAAwB,CAAA;AAEN,IAAA,eAAA;AAA7B,IAAA,WAAA,CAA6B,eAAgC,EAAA;QAAhC,IAAe,CAAA,eAAA,GAAf,eAAe;;IAE5C,SAAS,CAAC,GAAqB,EAAE,IAAiB,EAAA;AAChD,QAAA,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;AAEvC,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAClD,SAAS,CAAC,MAAK;YACX,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;AAC7C,YAAA,OAAO,CAAC,GAAG,CAAC,iCAAiC,GAAG,KAAK,CAAC;YACtD,IAAI,OAAO,GAAG,GAAG;YAEjB,IAAI,KAAK,EAAE;AACP,gBAAA,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC;AAChB,oBAAA,UAAU,EAAE;wBACR,aAAa,EAAE,CAAU,OAAA,EAAA,KAAK,CAAE,CAAA;AACnC,qBAAA;AACJ,iBAAA,CAAC;;;YAIN,OAAO,CAAC,GAAG,CAAC,4BAA4B,EAAE,OAAO,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