diff --git a/dist/commonjs/services/id-service.api-service.d.ts.map b/dist/commonjs/services/id-service.api-service.d.ts.map index 3c338cbd..61c67fe4 100644 --- a/dist/commonjs/services/id-service.api-service.d.ts.map +++ b/dist/commonjs/services/id-service.api-service.d.ts.map @@ -1 +1 @@ -{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,qBACa,mBAAmB;IAI5B,OAAO,CAAC,IAAI;IAHP,QAAQ,EAAE,MAAM,CAAC;gBAGd,IAAI,EAAE,UAAU;IAcnB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAavC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CA6BhG","file":"id-service.api-service.d.ts","sourceRoot":"../../../src/"} \ No newline at end of file +{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,qBACa,mBAAmB;IAI5B,OAAO,CAAC,IAAI;IAHP,QAAQ,EAAE,MAAM,CAAC;gBAGd,IAAI,EAAE,UAAU;IAcnB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAavC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAuBhG","file":"id-service.api-service.d.ts","sourceRoot":"../../../src/"} \ No newline at end of file diff --git a/dist/commonjs/services/id-service.api-service.js b/dist/commonjs/services/id-service.api-service.js index a128645f..5855828e 100644 --- a/dist/commonjs/services/id-service.api-service.js +++ b/dist/commonjs/services/id-service.api-service.js @@ -89,12 +89,10 @@ var IdServiceApiService = (function () { }; IdServiceApiService.prototype.getByUri = function (uri, getSso) { return __awaiter(this, void 0, void 0, function () { - var sso, response, locationResponse, content, etag, e_1, e_2; + var sso, response, locationResponse, content, etag; return __generator(this, function (_a) { switch (_a.label) { - case 0: - _a.trys.push([0, 7, , 8]); - return [4, getSso()]; + case 0: return [4, getSso()]; case 1: sso = _a.sent(); return [4, this.http.createRequest("" + (oeAppConfig.idServiceUrl + '/uris?uri=' + uri)) @@ -103,30 +101,21 @@ var IdServiceApiService = (function () { .send()]; case 2: response = _a.sent(); - if (!response.content.location) return [3, 6]; - _a.label = 3; - case 3: - _a.trys.push([3, 5, , 6]); + if (!response.content.location) { + message_1.Message.error({ + title: 'Fout', + message: "Er ging iets mis bij het ophalen van uri: " + uri + }); + throw "Could not retrieve uri " + uri; + } return [4, this.http.createRequest(response.content.location).asGet() .withHeader('Authorization', 'Bearer ' + sso) .send()]; - case 4: + case 3: locationResponse = _a.sent(); content = locationResponse.content; etag = locationResponse.headers.get('ETag'); return [2, __assign(__assign({}, locationResponse), { content: __assign(__assign({}, content), { etag: etag }) })]; - case 5: - e_1 = _a.sent(); - return [2]; - case 6: return [3, 8]; - case 7: - e_2 = _a.sent(); - message_1.Message.error({ - title: 'Fout', - message: 'Er ging iets mis bij het ophalen van uri: ' + uri - }); - return [2]; - case 8: return [2]; } }); }); diff --git a/dist/commonjs/services/id-service.api-service.js.map b/dist/commonjs/services/id-service.api-service.js.map index 087aefe4..5127b051 100644 --- a/dist/commonjs/services/id-service.api-service.js.map +++ b/dist/commonjs/services/id-service.api-service.js.map @@ -1 +1 @@ -{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAG,GAAG,CAAE,CAAC;iCACjG,KAAK,EAAE;iCACP,UAAU,CAAC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;iCAC5C,IAAI,EAAE,EAAA;;wBAHD,QAAQ,GAAG,SAG2B;6BAExC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAzB,cAAyB;;;;wBAEA,WAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE;iCACxF,UAAU,CAAC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;iCAC5C,IAAI,EAAE,EAAA;;wBAFD,gBAAgB,GAAG,SAEE;wBAErB,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;wBACnC,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBAClD,iCAAY,gBAAgB,KAAE,OAAO,wBAAO,OAAO,KAAE,IAAI,MAAA,QAAK;;;wBAE9D,WAAO;;;;wBAIX,iBAAO,CAAC,KAAK,CAAC;4BACZ,KAAK,EAAE,MAAM;4BACb,OAAO,EAAE,4CAA4C,GAAG,GAAG;yBAC5D,CAAC,CAAC;wBACH,WAAO;;;;;KAEV;IA3DU,mBAAmB;QAD/B,8BAAU;yCAKO,gCAAU;OAJf,mBAAmB,CA4D/B;IAAD,0BAAC;CA5DD,AA4DC,IAAA;AA5DY,kDAAmB","file":"id-service.api-service.js","sourceRoot":"../../../src/"} \ No newline at end of file +{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA+C;AAC/C,2DAAiD;AACjD,gEAA+D;AAC/D,oEAAmE;AACnE,wDAAuD;AAOvD;IAGE,6BACU,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QAExB,IAAI,CAAC,IAAI,GAAG,IAAI,gCAAU,E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AAO,CAAC,QAAQ,EAAE;4BAC9B,iBAAO,CAAC,KAAK,CAAC;gCACZ,KAAK,EAAE,MAAM;gCACb,OAAO,EAAE,+CAA6C,GAAK;6BAC5D,CAAC,CAAC;4BACH,MAAM,4BAA0B,GAAK,CAAC;yBACvC;wBAEwB,WAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE;iCACtF,UAAU,CAAC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;iCAC5C,IAAI,EAAE,EAAA;;wBAFH,gBAAgB,GAAG,SAEI;wBAEvB,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;wBACnC,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBAClD,iCAAW,gBAAgB,KAAE,OAAO,wBAAM,OAAO,KAAE,IAAI,MAAA,QAAG;;;;KAC3D;IArDU,mBAAmB;QAD/B,8BAAU;yCAKO,gCAAU;OAJf,mBAAmB,CAsD/B;IAAD,0BAAC;CAtDD,AAsDC,IAAA;AAtDY,kDAAmB","file":"id-service.api-service.js","sourceRoot":"../../../src/"} \ No newline at end of file diff --git a/dist/native-modules/services/id-service.api-service.d.ts.map b/dist/native-modules/services/id-service.api-service.d.ts.map index 3c338cbd..61c67fe4 100644 --- a/dist/native-modules/services/id-service.api-service.d.ts.map +++ b/dist/native-modules/services/id-service.api-service.d.ts.map @@ -1 +1 @@ -{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,qBACa,mBAAmB;IAI5B,OAAO,CAAC,IAAI;IAHP,QAAQ,EAAE,MAAM,CAAC;gBAGd,IAAI,EAAE,UAAU;IAcnB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAavC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CA6BhG","file":"id-service.api-service.d.ts","sourceRoot":"../../../src/"} \ No newline at end of file +{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAKrD,qBACa,mBAAmB;IAI5B,OAAO,CAAC,IAAI;IAHP,QAAQ,EAAE,MAAM,CAAC;gBAGd,IAAI,EAAE,UAAU;IAcnB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAavC,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;CAuBhG","file":"id-service.api-service.d.ts","sourceRoot":"../../../src/"} \ No newline at end of file diff --git a/dist/native-modules/services/id-service.api-service.js b/dist/native-modules/services/id-service.api-service.js index 71e5f52f..3a56b422 100644 --- a/dist/native-modules/services/id-service.api-service.js +++ b/dist/native-modules/services/id-service.api-service.js @@ -87,12 +87,10 @@ var IdServiceApiService = (function () { }; IdServiceApiService.prototype.getByUri = function (uri, getSso) { return __awaiter(this, void 0, void 0, function () { - var sso, response, locationResponse, content, etag, e_1, e_2; + var sso, response, locationResponse, content, etag; return __generator(this, function (_a) { switch (_a.label) { - case 0: - _a.trys.push([0, 7, , 8]); - return [4, getSso()]; + case 0: return [4, getSso()]; case 1: sso = _a.sent(); return [4, this.http.createRequest("" + (oeAppConfig.idServiceUrl + '/uris?uri=' + uri)) @@ -101,30 +99,21 @@ var IdServiceApiService = (function () { .send()]; case 2: response = _a.sent(); - if (!response.content.location) return [3, 6]; - _a.label = 3; - case 3: - _a.trys.push([3, 5, , 6]); + if (!response.content.location) { + Message.error({ + title: 'Fout', + message: "Er ging iets mis bij het ophalen van uri: " + uri + }); + throw "Could not retrieve uri " + uri; + } return [4, this.http.createRequest(response.content.location).asGet() .withHeader('Authorization', 'Bearer ' + sso) .send()]; - case 4: + case 3: locationResponse = _a.sent(); content = locationResponse.content; etag = locationResponse.headers.get('ETag'); return [2, __assign(__assign({}, locationResponse), { content: __assign(__assign({}, content), { etag: etag }) })]; - case 5: - e_1 = _a.sent(); - return [2]; - case 6: return [3, 8]; - case 7: - e_2 = _a.sent(); - Message.error({ - title: 'Fout', - message: 'Er ging iets mis bij het ophalen van uri: ' + uri - }); - return [2]; - case 8: return [2]; } }); }); diff --git a/dist/native-modules/services/id-service.api-service.js.map b/dist/native-modules/services/id-service.api-service.js.map index aa64d7ec..0871a0bb 100644 --- a/dist/native-modules/services/id-service.api-service.js.map +++ b/dist/native-modules/services/id-service.api-service.js.map @@ -1 +1 @@ -{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAOvD;IAGE,6BACU,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QAExB,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAA,CAAC;YACnB,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,kBA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,KAAK,EAAE;iCACxF,UAAU,CAAC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;iCAC5C,IAAI,EAAE,EAAA;;wBAFD,gBAAgB,GAAG,SAEE;wBAErB,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;wBACnC,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBAClD,iCAAY,gBAAgB,KAAE,OAAO,wBAAO,OAAO,KAAE,IAAI,MAAA,QAAK;;;wBAE9D,WAAO;;;;wBAIX,OAAO,CAAC,KAAK,CAAC;4BACZ,KAAK,EAAE,MAAM;4BACb,OAAO,EAAE,4CAA4C,GAAG,GAAG;yBAC5D,CAAC,CAAC;wBACH,WAAO;;;;;KAEV;IA3DU,mBAAmB;QAD/B,UAAU;yCAKO,UAAU;OAJf,mBAAmB,CA4D/B;IAAD,0BAAC;CA5DD,AA4DC,IAAA;SA5DY,mBAAmB","file":"id-service.api-service.js","sourceRoot":"../../../src/"} \ No newline at end of file +{"version":3,"sources":["services/id-service.api-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAOvD;IAGE,6BACU,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QAExB,IAAI,CAAC,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,UAAA,CAAC;YACnB,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC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;4BACH,MAAM,4BAA0B,GAAK,CAAC;yBACvC;wBAEwB,WAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,EAAE;iCACtF,UAAU,CAAC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;iCAC5C,IAAI,EAAE,EAAA;;wBAFH,gBAAgB,GAAG,SAEI;wBAEvB,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC;wBACnC,IAAI,GAAG,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;wBAClD,iCAAW,gBAAgB,KAAE,OAAO,wBAAM,OAAO,KAAE,IAAI,MAAA,QAAG;;;;KAC3D;IArDU,mBAAmB;QAD/B,UAAU;yCAKO,UAAU;OAJf,mBAAmB,CAsD/B;IAAD,0BAAC;CAtDD,AAsDC,IAAA;SAtDY,mBAAmB","file":"id-service.api-service.js","sourceRoot":"../../../src/"} \ No newline at end of file diff --git a/package.json b/package.json index e066bcea..07d6a8c3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "oerelia", "description": "Onroerend Erfgoed Aurelia component library", - "version": "0.24.1", + "version": "0.24.2", "repository": { "type": "git", "url": "https://github.com/OnroerendErfgoed/oerelia.git" diff --git a/src/services/id-service.api-service.ts b/src/services/id-service.api-service.ts index 88369ded..00ed9d03 100644 --- a/src/services/id-service.api-service.ts +++ b/src/services/id-service.api-service.ts @@ -33,7 +33,7 @@ export class IdServiceApiService { .withHeader('OpenAmSSOID', this.ssoToken) .send() .then(response => { - RestMessage.display({ result: MessageParser.parseHttpResponseMessage(response) }); + RestMessage.display({result: MessageParser.parseHttpResponseMessage(response)}); if (response.isSuccess) { return response.content; } @@ -41,32 +41,26 @@ export class IdServiceApiService { } public async getByUri(uri: string, getSso: () => Promise): Promise> { - try { - const sso = await getSso(); - const response = await this.http.createRequest(`${oeAppConfig.idServiceUrl + '/uris?uri=' + uri}`) + const sso = await getSso(); + const response = await this.http.createRequest(`${oeAppConfig.idServiceUrl + '/uris?uri=' + uri}`) .asGet() .withHeader('Authorization', 'Bearer ' + sso) - .send() as IHttpResponse; + .send() as IHttpResponse; - if (response.content.location) { - try { - const locationResponse = await this.http.createRequest(response.content.location).asGet() - .withHeader('Authorization', 'Bearer ' + sso) - .send() as IHttpResponse; - - const content = locationResponse.content; - const etag = locationResponse.headers.get('ETag'); - return { ...locationResponse, content: { ...content, etag } }; - } catch (e) { - return; - } - } - } catch(e) { + if (!response.content.location) { Message.error({ title: 'Fout', - message: 'Er ging iets mis bij het ophalen van uri: ' + uri + message: `Er ging iets mis bij het ophalen van uri: ${uri}` }); - return; + throw `Could not retrieve uri ${uri}`; } + + const locationResponse = await this.http.createRequest(response.content.location).asGet() + .withHeader('Authorization', 'Bearer ' + sso) + .send() as IHttpResponse; + + const content = locationResponse.content; + const etag = locationResponse.headers.get('ETag'); + return {...locationResponse, content: {...content, etag}}; } }