@valtimo/resource 4.21.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/esm2020/lib/models/index.mjs +21 -0
  2. package/esm2020/lib/models/open-zaak.model.mjs +76 -0
  3. package/esm2020/lib/models/upload.model.mjs +17 -0
  4. package/esm2020/lib/models/uploader.model.mjs +26 -0
  5. package/esm2020/lib/resource.module.mjs +52 -0
  6. package/esm2020/lib/services/download.service.mjs +56 -0
  7. package/esm2020/lib/services/open-zaak-upload.service.mjs +60 -0
  8. package/esm2020/lib/services/open-zaak.service.mjs +96 -0
  9. package/esm2020/lib/services/s3-upload.service.mjs +46 -0
  10. package/esm2020/lib/services/s3.service.mjs +58 -0
  11. package/esm2020/lib/services/upload-provider.service.mjs +49 -0
  12. package/esm2020/public-api.mjs +10 -0
  13. package/esm2020/valtimo-resource.mjs +5 -0
  14. package/fesm2015/valtimo-resource.mjs +517 -0
  15. package/fesm2015/valtimo-resource.mjs.map +1 -0
  16. package/{fesm2015/valtimo-resource.js → fesm2020/valtimo-resource.mjs} +81 -95
  17. package/fesm2020/valtimo-resource.mjs.map +1 -0
  18. package/lib/models/index.d.ts +1 -0
  19. package/lib/models/index.d.ts.map +1 -0
  20. package/lib/models/open-zaak.model.d.ts +1 -0
  21. package/lib/models/open-zaak.model.d.ts.map +1 -0
  22. package/lib/models/upload.model.d.ts +1 -0
  23. package/lib/models/upload.model.d.ts.map +1 -0
  24. package/lib/models/uploader.model.d.ts +1 -0
  25. package/lib/models/uploader.model.d.ts.map +1 -0
  26. package/lib/resource.module.d.ts +5 -0
  27. package/lib/resource.module.d.ts.map +1 -0
  28. package/lib/services/download.service.d.ts +4 -0
  29. package/lib/services/download.service.d.ts.map +1 -0
  30. package/lib/services/open-zaak-upload.service.d.ts +4 -0
  31. package/lib/services/open-zaak-upload.service.d.ts.map +1 -0
  32. package/lib/services/open-zaak.service.d.ts +4 -0
  33. package/lib/services/open-zaak.service.d.ts.map +1 -0
  34. package/lib/services/s3-upload.service.d.ts +4 -0
  35. package/lib/services/s3-upload.service.d.ts.map +1 -0
  36. package/lib/services/s3.service.d.ts +4 -0
  37. package/lib/services/s3.service.d.ts.map +1 -0
  38. package/lib/services/upload-provider.service.d.ts +4 -0
  39. package/lib/services/upload-provider.service.d.ts.map +1 -0
  40. package/package.json +22 -10
  41. package/public-api.d.ts +1 -0
  42. package/public-api.d.ts.map +1 -0
  43. package/valtimo-resource.d.ts +2 -2
  44. package/valtimo-resource.d.ts.map +1 -0
  45. package/bundles/valtimo-resource.umd.js +0 -570
  46. package/bundles/valtimo-resource.umd.js.map +0 -1
  47. package/bundles/valtimo-resource.umd.min.js +0 -2
  48. package/bundles/valtimo-resource.umd.min.js.map +0 -1
  49. package/esm2015/lib/models/index.js +0 -21
  50. package/esm2015/lib/models/open-zaak.model.js +0 -76
  51. package/esm2015/lib/models/upload.model.js +0 -16
  52. package/esm2015/lib/models/uploader.model.js +0 -26
  53. package/esm2015/lib/resource.module.js +0 -40
  54. package/esm2015/lib/services/download.service.js +0 -60
  55. package/esm2015/lib/services/open-zaak-upload.service.js +0 -62
  56. package/esm2015/lib/services/open-zaak.service.js +0 -100
  57. package/esm2015/lib/services/s3-upload.service.js +0 -61
  58. package/esm2015/lib/services/s3.service.js +0 -61
  59. package/esm2015/lib/services/upload-provider.service.js +0 -53
  60. package/esm2015/public-api.js +0 -10
  61. package/esm2015/valtimo-resource.js +0 -7
  62. package/fesm2015/valtimo-resource.js.map +0 -1
  63. package/valtimo-resource.metadata.json +0 -1
@@ -1,570 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common/http'), require('@valtimo/config'), require('rxjs/operators'), require('uuid'), require('ngx-logger')) :
3
- typeof define === 'function' && define.amd ? define('@valtimo/resource', ['exports', '@angular/core', '@angular/common/http', '@valtimo/config', 'rxjs/operators', 'uuid', 'ngx-logger'], factory) :
4
- (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.resource = {}), global.ng.core, global.ng.common.http, global.i2, global.rxjs.operators, global.uuid, global.i2$1));
5
- }(this, (function (exports, i0, i1, i2, operators, uuid, i2$1) { 'use strict';
6
-
7
- /*
8
- * Copyright 2015-2020 Ritense BV, the Netherlands.
9
- *
10
- * Licensed under EUPL, Version 1.2 (the "License");
11
- * you may not use this file except in compliance with the License.
12
- * You may obtain a copy of the License at
13
- *
14
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
15
- *
16
- * Unless required by applicable law or agreed to in writing, software
17
- * distributed under the License is distributed on an "AS IS" basis,
18
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- * See the License for the specific language governing permissions and
20
- * limitations under the License.
21
- */
22
-
23
- /*
24
- * Copyright 2015-2020 Ritense BV, the Netherlands.
25
- *
26
- * Licensed under EUPL, Version 1.2 (the "License");
27
- * you may not use this file except in compliance with the License.
28
- * You may obtain a copy of the License at
29
- *
30
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
31
- *
32
- * Unless required by applicable law or agreed to in writing, software
33
- * distributed under the License is distributed on an "AS IS" basis,
34
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35
- * See the License for the specific language governing permissions and
36
- * limitations under the License.
37
- */
38
- var S3Resource = /** @class */ (function () {
39
- function S3Resource(file, preSignedUrl) {
40
- this.id = null;
41
- this.extension = null;
42
- this.createdOn = null;
43
- this.key = decodeURIComponent(preSignedUrl.pathname.substring(1));
44
- this.name = file.name;
45
- this.sizeInBytes = file.size;
46
- }
47
- return S3Resource;
48
- }());
49
-
50
- /*
51
- * Copyright 2015-2020 Ritense BV, the Netherlands.
52
- *
53
- * Licensed under EUPL, Version 1.2 (the "License");
54
- * you may not use this file except in compliance with the License.
55
- * You may obtain a copy of the License at
56
- *
57
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
58
- *
59
- * Unless required by applicable law or agreed to in writing, software
60
- * distributed under the License is distributed on an "AS IS" basis,
61
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
62
- * See the License for the specific language governing permissions and
63
- * limitations under the License.
64
- */
65
- var OpenZaakConfig = /** @class */ (function () {
66
- function OpenZaakConfig() {
67
- }
68
- return OpenZaakConfig;
69
- }());
70
- (function (Archiefnominatie) {
71
- Archiefnominatie["blijvend_bewaren"] = "blijven_bewaren";
72
- Archiefnominatie["vernietigen"] = "vernietigen";
73
- })(exports.Archiefnominatie || (exports.Archiefnominatie = {}));
74
- (function (Afleidingswijze) {
75
- Afleidingswijze["afgehandeld"] = "afgehandeld";
76
- Afleidingswijze["ander_datumkenmerk"] = "ander_datumkenmerk";
77
- Afleidingswijze["eigenschap"] = "eigenschap";
78
- Afleidingswijze["gerelateerde_zaak"] = "gerelateerde_zaak";
79
- Afleidingswijze["hoofdzaak"] = "hoofdzaak";
80
- Afleidingswijze["ingangsdatum_besluit"] = "ingangsdatum_besluit";
81
- Afleidingswijze["termijn"] = "termijn";
82
- Afleidingswijze["vervaldatum_besluit"] = "vervaldatum_besluit";
83
- Afleidingswijze["zaakobject"] = "zaakobject";
84
- })(exports.Afleidingswijze || (exports.Afleidingswijze = {}));
85
- (function (Objecttype) {
86
- Objecttype["adres"] = "adres";
87
- Objecttype["besluit"] = "besluit";
88
- Objecttype["buurt"] = "buurt";
89
- Objecttype["enkelvoudig_document"] = "enkelvoudig_document";
90
- Objecttype["gemeente"] = "gemeente";
91
- Objecttype["gemeentelijke_openbare_ruimte"] = "gemeentelijke_openbare_ruimte";
92
- Objecttype["huishouden"] = "huishouden";
93
- Objecttype["inrichtingselement"] = "inrichtingselement";
94
- Objecttype["kadastrale_onroerende_zaak"] = "kadastrale_onroerende_zaak";
95
- Objecttype["kunstwerkdeel"] = "kunstwerkdeel";
96
- Objecttype["maatschappelijke_activiteit"] = "maatschappelijke_activiteit";
97
- Objecttype["medewerker"] = "medewerker";
98
- Objecttype["natuurlijk_persoon"] = "natuurlijk_persoon";
99
- Objecttype["niet_natuurlijk_persoon"] = "niet_natuurlijk_persoon";
100
- Objecttype["openbare_ruimte"] = "openbare_ruimte";
101
- Objecttype["organisatorische_eenheid"] = "organisatorische_eenheid";
102
- Objecttype["pand"] = "pand";
103
- Objecttype["spoorbaandeel"] = "spoorbaandeel";
104
- Objecttype["status"] = "status";
105
- Objecttype["terreindeel"] = "terreindeel";
106
- Objecttype["terrein_gebouwd_object"] = "terrein_gebouwd_object";
107
- Objecttype["vestiging"] = "vestiging";
108
- Objecttype["waterdeel"] = "waterdeel";
109
- Objecttype["wegdeel"] = "wegdeel";
110
- Objecttype["wijk"] = "wijk";
111
- Objecttype["woonplaats"] = "woonplaats";
112
- Objecttype["woz_deelobject"] = "woz_deelobject";
113
- Objecttype["woz_object"] = "woz_object";
114
- Objecttype["woz_waarde"] = "woz_waarde";
115
- Objecttype["zakelijk_recht"] = "zakelijk_recht";
116
- Objecttype["overige"] = "overige";
117
- })(exports.Objecttype || (exports.Objecttype = {}));
118
- (function (Operation) {
119
- Operation["CREATE_ZAAK"] = "CREATE_ZAAK";
120
- Operation["SET_RESULTAAT"] = "SET_RESULTAAT";
121
- Operation["SET_STATUS"] = "SET_STATUS";
122
- Operation["CREATE_BESLUIT"] = "CREATE_BESLUIT";
123
- })(exports.Operation || (exports.Operation = {}));
124
-
125
- /*
126
- *
127
- * * Copyright 2015-2020 Ritense BV, the Netherlands.
128
- * *
129
- * * Licensed under EUPL, Version 1.2 (the "License");
130
- * * you may not use this file except in compliance with the License.
131
- * * You may obtain a copy of the License at
132
- * *
133
- * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
134
- * *
135
- * * Unless required by applicable law or agreed to in writing, software
136
- * * distributed under the License is distributed on an "AS IS" basis,
137
- * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
138
- * * See the License for the specific language governing permissions and
139
- * * limitations under the License.
140
- *
141
- */
142
-
143
- /*
144
- * Copyright 2020 Dimpact.
145
- *
146
- * Licensed under EUPL, Version 1.2 (the "License");
147
- * you may not use this file except in compliance with the License.
148
- * You may obtain a copy of the License at
149
- *
150
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
151
- *
152
- * Unless required by applicable law or agreed to in writing, software
153
- * distributed under the License is distributed on an "AS IS" basis,
154
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
155
- * See the License for the specific language governing permissions and
156
- * limitations under the License.
157
- */
158
- var OpenZaakService = /** @class */ (function () {
159
- function OpenZaakService(http, configService) {
160
- this.http = http;
161
- this.configService = configService;
162
- this.valtimoApiConfig = configService.config.valtimoApi;
163
- this.catalogus = configService.config.openZaak.catalogus;
164
- }
165
- OpenZaakService.prototype.getOpenZaakConfig = function () {
166
- return this.http.get(this.valtimoApiConfig.endpointUri + "openzaak/config");
167
- };
168
- OpenZaakService.prototype.getResource = function (resourceId) {
169
- return this.http.get(this.valtimoApiConfig.endpointUri + "resource/" + resourceId);
170
- };
171
- OpenZaakService.prototype.getZaakTypes = function () {
172
- return this.http.get(this.valtimoApiConfig.endpointUri + "openzaak/zaaktype");
173
- };
174
- OpenZaakService.prototype.getBesluittypen = function () {
175
- return this.http.get(this.valtimoApiConfig.endpointUri + "besluittype");
176
- };
177
- OpenZaakService.prototype.getInformatieObjectTypes = function () {
178
- return this.http.get(this.valtimoApiConfig.endpointUri + "openzaak/informatie-object-typen/" + this.catalogus);
179
- };
180
- OpenZaakService.prototype.getZaakTypeLink = function (id) {
181
- return this.http.get(this.valtimoApiConfig.endpointUri + "openzaak/link/" + id);
182
- };
183
- OpenZaakService.prototype.getInformatieObjectTypeLink = function (id) {
184
- return this.http.get(this.valtimoApiConfig.endpointUri + "openzaak/informatie-object-type-link/" + id);
185
- };
186
- OpenZaakService.prototype.createZaakTypeLink = function (request) {
187
- return this.http.post(this.valtimoApiConfig.endpointUri + "openzaak/link", request);
188
- };
189
- OpenZaakService.prototype.createInformatieObjectTypeLink = function (request) {
190
- return this.http.post(this.valtimoApiConfig.endpointUri + "openzaak/informatie-object-type-link", request);
191
- };
192
- OpenZaakService.prototype.deleteZaakTypeLink = function (id) {
193
- return this.http.delete(this.valtimoApiConfig.endpointUri + "openzaak/link/" + id);
194
- };
195
- OpenZaakService.prototype.deleteInformatieObjectTypeLink = function (id) {
196
- return this.http.delete(this.valtimoApiConfig.endpointUri + "openzaak/informatie-object-type-link/" + id);
197
- };
198
- OpenZaakService.prototype.getZaakTypeLinkListByProcess = function (processDefinitionKey) {
199
- return this.http.get(this.valtimoApiConfig.endpointUri + "openzaak/link/process/" + processDefinitionKey);
200
- };
201
- OpenZaakService.prototype.getStatusTypes = function (zaakTypeRequest) {
202
- return this.http.post(this.valtimoApiConfig.endpointUri + "openzaak/status", zaakTypeRequest);
203
- };
204
- OpenZaakService.prototype.getStatusResults = function (zaakTypeRequest) {
205
- return this.http.post(this.valtimoApiConfig.endpointUri + "openzaak/resultaat", zaakTypeRequest);
206
- };
207
- OpenZaakService.prototype.createServiceTaskHandler = function (id, request) {
208
- return this.http.post(this.valtimoApiConfig.endpointUri + "openzaak/link/" + id + "/service-handler", request);
209
- };
210
- OpenZaakService.prototype.modifyServiceTaskHandler = function (id, request) {
211
- return this.http.put(this.valtimoApiConfig.endpointUri + "openzaak/link/" + id + "/service-handler", request);
212
- };
213
- OpenZaakService.prototype.deleteServiceTaskHandler = function (id, processDefinitionKey, serviceTaskId) {
214
- return this.http.delete(this.valtimoApiConfig.endpointUri + "openzaak/link/" + id + "/service-handler/" + processDefinitionKey + "/" + serviceTaskId);
215
- };
216
- OpenZaakService.prototype.upload = function (file, documentDefinitionName) {
217
- var formData = new FormData();
218
- formData.append('file', file);
219
- formData.append('documentDefinitionName', documentDefinitionName);
220
- return this.http.post(this.valtimoApiConfig.endpointUri + "resource/upload-open-zaak", formData, {
221
- reportProgress: true,
222
- responseType: 'json',
223
- });
224
- };
225
- return OpenZaakService;
226
- }());
227
- OpenZaakService.ɵprov = i0.ɵɵdefineInjectable({ factory: function OpenZaakService_Factory() { return new OpenZaakService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: OpenZaakService, providedIn: "root" });
228
- OpenZaakService.decorators = [
229
- { type: i0.Injectable, args: [{
230
- providedIn: 'root',
231
- },] }
232
- ];
233
- OpenZaakService.ctorParameters = function () { return [
234
- { type: i1.HttpClient },
235
- { type: i2.ConfigService }
236
- ]; };
237
-
238
- /*
239
- * Copyright 2015-2020 Ritense BV, the Netherlands.
240
- *
241
- * Licensed under EUPL, Version 1.2 (the "License");
242
- * you may not use this file except in compliance with the License.
243
- * You may obtain a copy of the License at
244
- *
245
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
246
- *
247
- * Unless required by applicable law or agreed to in writing, software
248
- * distributed under the License is distributed on an "AS IS" basis,
249
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
250
- * See the License for the specific language governing permissions and
251
- * limitations under the License.
252
- */
253
- var OpenZaakUploadService = /** @class */ (function () {
254
- function OpenZaakUploadService(openZaakService, http, configService) {
255
- this.openZaakService = openZaakService;
256
- this.http = http;
257
- this.configService = configService;
258
- this.valtimoApiConfig = configService.config.valtimoApi;
259
- }
260
- OpenZaakUploadService.prototype.uploadFile = function (file, documentDefinitionName) {
261
- var _this = this;
262
- return this.openZaakService
263
- .upload(new File([file], file.name, { type: file.type }), documentDefinitionName)
264
- .pipe(operators.map(function (result) { return _this.getResourceFile(result); }));
265
- };
266
- OpenZaakUploadService.prototype.getResource = function (resourceId) {
267
- return this.openZaakService.getResource(resourceId);
268
- };
269
- OpenZaakUploadService.prototype.getResourceFile = function (result) {
270
- return {
271
- customUpload: true,
272
- originalName: result.name,
273
- size: result.sizeInBytes,
274
- url: '/api/resource/' + result.resourceId + '/download',
275
- storage: 'openZaak',
276
- type: result.extension,
277
- data: {
278
- createdOn: result.createdOn,
279
- name: result.name,
280
- sizeInBytes: result.sizeInBytes,
281
- resourceId: result.resourceId,
282
- extension: result.extension,
283
- },
284
- };
285
- };
286
- return OpenZaakUploadService;
287
- }());
288
- OpenZaakUploadService.decorators = [
289
- { type: i0.Injectable }
290
- ];
291
- OpenZaakUploadService.ctorParameters = function () { return [
292
- { type: OpenZaakService },
293
- { type: i1.HttpClient },
294
- { type: i2.ConfigService }
295
- ]; };
296
-
297
- /*
298
- * Copyright 2015-2020 Ritense BV, the Netherlands.
299
- *
300
- * Licensed under EUPL, Version 1.2 (the "License");
301
- * you may not use this file except in compliance with the License.
302
- * You may obtain a copy of the License at
303
- *
304
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
305
- *
306
- * Unless required by applicable law or agreed to in writing, software
307
- * distributed under the License is distributed on an "AS IS" basis,
308
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
309
- * See the License for the specific language governing permissions and
310
- * limitations under the License.
311
- */
312
- var S3Service = /** @class */ (function () {
313
- function S3Service(http, configService) {
314
- this.http = http;
315
- this.configService = configService;
316
- this.valtimoApiConfig = configService.config.valtimoApi;
317
- }
318
- S3Service.prototype.getPreSignedUrl = function (fileName) {
319
- var headers = new i1.HttpHeaders().set('Content-Type', 'text/plain; charset=utf-8');
320
- var options = { headers: headers, responseType: 'text' };
321
- return this.http.get(this.valtimoApiConfig.endpointUri + "resource/pre-signed-url/" + fileName, options);
322
- };
323
- S3Service.prototype.upload = function (url, file) {
324
- var headers = new i1.HttpHeaders().set('Content-Type', file.type);
325
- return this.http.put(url.toString(), file, { headers: headers });
326
- };
327
- S3Service.prototype.registerResource = function (s3ResourceDTO) {
328
- return this.http.put(this.valtimoApiConfig.endpointUri + "resource", s3ResourceDTO);
329
- };
330
- S3Service.prototype.get = function (resourceId) {
331
- var headers = new i1.HttpHeaders().set('Content-Type', 'application/json;charset=UTF-8');
332
- return this.http.get(this.valtimoApiConfig.endpointUri + "resource/" + resourceId, { headers: headers });
333
- };
334
- S3Service.prototype.delete = function (resourceId) {
335
- var headers = new i1.HttpHeaders().set('Content-Type', 'application/json;charset=UTF-8');
336
- return this.http.delete(this.valtimoApiConfig.endpointUri + "resource/" + resourceId, {
337
- headers: headers,
338
- });
339
- };
340
- return S3Service;
341
- }());
342
- S3Service.ɵprov = i0.ɵɵdefineInjectable({ factory: function S3Service_Factory() { return new S3Service(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: S3Service, providedIn: "root" });
343
- S3Service.decorators = [
344
- { type: i0.Injectable, args: [{
345
- providedIn: 'root',
346
- },] }
347
- ];
348
- S3Service.ctorParameters = function () { return [
349
- { type: i1.HttpClient },
350
- { type: i2.ConfigService }
351
- ]; };
352
-
353
- /*
354
- * Copyright 2015-2020 Ritense BV, the Netherlands.
355
- *
356
- * Licensed under EUPL, Version 1.2 (the "License");
357
- * you may not use this file except in compliance with the License.
358
- * You may obtain a copy of the License at
359
- *
360
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
361
- *
362
- * Unless required by applicable law or agreed to in writing, software
363
- * distributed under the License is distributed on an "AS IS" basis,
364
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
365
- * See the License for the specific language governing permissions and
366
- * limitations under the License.
367
- */
368
- var S3UploadService = /** @class */ (function () {
369
- function S3UploadService(s3Service) {
370
- this.s3Service = s3Service;
371
- }
372
- S3UploadService.prototype.uploadFile = function (file) {
373
- var _this = this;
374
- var resourceUrl;
375
- var fileName = file.name;
376
- var splitFileName = fileName.split('.');
377
- var fileNameWithUUID = splitFileName[0] + "-" + uuid.v4() + "." + splitFileName[1];
378
- var renamedFile = new File([file], fileNameWithUUID, { type: file.type });
379
- return this.s3Service.getPreSignedUrl(renamedFile.name).pipe(operators.map(function (url) { return new URL(url); }), operators.tap(function (url) { return (resourceUrl = url); }), operators.switchMap(function (url) { return _this.s3Service.upload(url, renamedFile); }), operators.map(function () { return new S3Resource(file, resourceUrl); }), operators.switchMap(function (s3Resource) { return _this.s3Service.registerResource(s3Resource); }), operators.switchMap(function (s3Resource) { return _this.s3Service.get(s3Resource.id); }), operators.map(function (result) { return (Object.assign(Object.assign({}, result), { originalName: file.name })); }), operators.map(function (result) { return _this.getResourceFile(result); }));
380
- };
381
- S3UploadService.prototype.getResource = function (resourceId) {
382
- return this.s3Service.get(resourceId);
383
- };
384
- S3UploadService.prototype.getResourceFile = function (result) {
385
- return {
386
- customUpload: true,
387
- originalName: result.originalName,
388
- url: result.url,
389
- size: result.resource.sizeInBytes,
390
- storage: 'url',
391
- type: result.resource.extension,
392
- data: {
393
- key: result.resource.key,
394
- bucketName: result.resource.name,
395
- createdOn: result.resource.createdOn,
396
- name: result.originalName,
397
- sizeInBytes: result.resource.sizeInBytes,
398
- resourceId: result.resource.id.split('ResourceId(id=')[1].slice(0, -1),
399
- },
400
- };
401
- };
402
- return S3UploadService;
403
- }());
404
- S3UploadService.decorators = [
405
- { type: i0.Injectable }
406
- ];
407
- S3UploadService.ctorParameters = function () { return [
408
- { type: S3Service }
409
- ]; };
410
-
411
- /*
412
- * Copyright 2015-2020 Ritense BV, the Netherlands.
413
- *
414
- * Licensed under EUPL, Version 1.2 (the "License");
415
- * you may not use this file except in compliance with the License.
416
- * You may obtain a copy of the License at
417
- *
418
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
419
- *
420
- * Unless required by applicable law or agreed to in writing, software
421
- * distributed under the License is distributed on an "AS IS" basis,
422
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
423
- * See the License for the specific language governing permissions and
424
- * limitations under the License.
425
- */
426
- var UploadProviderService = /** @class */ (function () {
427
- function UploadProviderService(configService, injector, logger) {
428
- this.configService = configService;
429
- this.injector = injector;
430
- this.logger = logger;
431
- this.uploadService =
432
- configService.config.uploadProvider === i2.UploadProvider.S3
433
- ? injector.get(S3UploadService)
434
- : injector.get(OpenZaakUploadService);
435
- this.logger.debug('Loading UploadService as', this.uploadService);
436
- }
437
- UploadProviderService.prototype.uploadFile = function (file, documentDefinitionName) {
438
- return this.uploadService.uploadFile(file, documentDefinitionName);
439
- };
440
- UploadProviderService.prototype.getResource = function (resourceId) {
441
- return this.uploadService.getResource(resourceId);
442
- };
443
- return UploadProviderService;
444
- }());
445
- UploadProviderService.ɵprov = i0.ɵɵdefineInjectable({ factory: function UploadProviderService_Factory() { return new UploadProviderService(i0.ɵɵinject(i2.ConfigService), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(i2$1.NGXLogger)); }, token: UploadProviderService, providedIn: "root" });
446
- UploadProviderService.decorators = [
447
- { type: i0.Injectable, args: [{
448
- providedIn: 'root',
449
- },] }
450
- ];
451
- UploadProviderService.ctorParameters = function () { return [
452
- { type: i2.ConfigService },
453
- { type: i0.Injector },
454
- { type: i2$1.NGXLogger }
455
- ]; };
456
-
457
- /*
458
- * Copyright 2015-2020 Ritense BV, the Netherlands.
459
- *
460
- * Licensed under EUPL, Version 1.2 (the "License");
461
- * you may not use this file except in compliance with the License.
462
- * You may obtain a copy of the License at
463
- *
464
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
465
- *
466
- * Unless required by applicable law or agreed to in writing, software
467
- * distributed under the License is distributed on an "AS IS" basis,
468
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
469
- * See the License for the specific language governing permissions and
470
- * limitations under the License.
471
- */
472
- var DownloadService = /** @class */ (function () {
473
- function DownloadService(http, configService) {
474
- this.http = http;
475
- this.configService = configService;
476
- }
477
- DownloadService.prototype.downloadFile = function (url, name) {
478
- var _this = this;
479
- if (url.startsWith(this.configService.config.valtimoApi.endpointUri) ||
480
- url.startsWith(window.location.origin)) {
481
- // if download url is on backend use angular to get the content so access token is used
482
- this.http.get(url, { responseType: 'blob' }).subscribe(function (content) {
483
- var downloadUrl = window.URL.createObjectURL(content);
484
- _this.openDownloadLink(downloadUrl, name);
485
- });
486
- }
487
- else {
488
- // download links to external services (like amazon s3) open in a new window
489
- this.openDownloadLink(url, name);
490
- }
491
- };
492
- DownloadService.prototype.openDownloadLink = function (url, name) {
493
- var link = document.createElement('a');
494
- link.href = url;
495
- link.download = name;
496
- link.target = '_blank';
497
- link.click();
498
- link.remove();
499
- };
500
- return DownloadService;
501
- }());
502
- DownloadService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DownloadService_Factory() { return new DownloadService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: DownloadService, providedIn: "root" });
503
- DownloadService.decorators = [
504
- { type: i0.Injectable, args: [{
505
- providedIn: 'root',
506
- },] }
507
- ];
508
- DownloadService.ctorParameters = function () { return [
509
- { type: i1.HttpClient },
510
- { type: i2.ConfigService }
511
- ]; };
512
-
513
- /*
514
- * Copyright 2015-2020 Ritense BV, the Netherlands.
515
- *
516
- * Licensed under EUPL, Version 1.2 (the "License");
517
- * you may not use this file except in compliance with the License.
518
- * You may obtain a copy of the License at
519
- *
520
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
521
- *
522
- * Unless required by applicable law or agreed to in writing, software
523
- * distributed under the License is distributed on an "AS IS" basis,
524
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
525
- * See the License for the specific language governing permissions and
526
- * limitations under the License.
527
- */
528
- var ResourceModule = /** @class */ (function () {
529
- function ResourceModule() {
530
- }
531
- return ResourceModule;
532
- }());
533
- ResourceModule.decorators = [
534
- { type: i0.NgModule, args: [{
535
- declarations: [],
536
- imports: [],
537
- exports: [],
538
- providers: [
539
- OpenZaakUploadService,
540
- S3UploadService,
541
- UploadProviderService,
542
- OpenZaakService,
543
- S3Service,
544
- DownloadService,
545
- ],
546
- },] }
547
- ];
548
-
549
- /*
550
- * Public API Surface of upload
551
- */
552
-
553
- /**
554
- * Generated bundle index. Do not edit.
555
- */
556
-
557
- exports.DownloadService = DownloadService;
558
- exports.OpenZaakConfig = OpenZaakConfig;
559
- exports.OpenZaakService = OpenZaakService;
560
- exports.ResourceModule = ResourceModule;
561
- exports.S3Resource = S3Resource;
562
- exports.S3Service = S3Service;
563
- exports.UploadProviderService = UploadProviderService;
564
- exports.ɵa = OpenZaakUploadService;
565
- exports.ɵb = S3UploadService;
566
-
567
- Object.defineProperty(exports, '__esModule', { value: true });
568
-
569
- })));
570
- //# sourceMappingURL=valtimo-resource.umd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"valtimo-resource.umd.js","sources":["../../../../projects/valtimo/resource/src/lib/models/upload.model.ts","../../../../projects/valtimo/resource/src/lib/models/uploader.model.ts","../../../../projects/valtimo/resource/src/lib/models/open-zaak.model.ts","../../../../projects/valtimo/resource/src/lib/models/index.ts","../../../../projects/valtimo/resource/src/lib/services/open-zaak.service.ts","../../../../projects/valtimo/resource/src/lib/services/open-zaak-upload.service.ts","../../../../projects/valtimo/resource/src/lib/services/s3.service.ts","../../../../projects/valtimo/resource/src/lib/services/s3-upload.service.ts","../../../../projects/valtimo/resource/src/lib/services/upload-provider.service.ts","../../../../projects/valtimo/resource/src/lib/services/download.service.ts","../../../../projects/valtimo/resource/src/lib/resource.module.ts","../../../../projects/valtimo/resource/src/public-api.ts","../../../../projects/valtimo/resource/src/valtimo-resource.ts"],"sourcesContent":["/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Observable} from 'rxjs';\nimport {ResourceDto} from './uploader.model';\n\nexport interface ResourceFile {\n customUpload?: boolean;\n originalName: string;\n size: number;\n storage: string;\n type?: string;\n isLast?: boolean;\n url?: string;\n data: {\n baseUrl?: string;\n bucketName?: string;\n createdOn: string;\n extension?: string;\n form?: string;\n key?: string;\n name: string;\n project?: string;\n resourceId: string;\n sizeInBytes: number;\n };\n}\n\nexport interface UploadService {\n uploadFile(file: File, documentDefinitionName?: string): Observable<ResourceFile>;\n getResource(resourceId: string): Observable<ResourceDto>;\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface ResourceDto {\n url: string;\n resource: Resource;\n originalName?: string;\n}\n\nexport interface Resource {\n id?: string;\n key: string;\n name: string;\n sizeInBytes: number;\n extension?: string;\n createdOn?: Date;\n}\n\nexport interface OpenZaakResource {\n resourceId: string;\n informatieObjectUrl: string;\n createdOn: string;\n name: string;\n extension: string;\n sizeInBytes: number;\n}\n\nexport class S3Resource implements Resource {\n id?: string = null;\n key: string;\n name: string;\n sizeInBytes: number;\n extension?: string = null;\n createdOn?: Date = null;\n\n constructor(file: File, preSignedUrl: URL) {\n this.key = decodeURIComponent(preSignedUrl.pathname.substring(1));\n this.name = file.name;\n this.sizeInBytes = file.size;\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport class OpenZaakConfig {\n id: string;\n url: string;\n clientId: string;\n secret: string;\n rsin: string;\n}\n\nexport interface ZaakType {\n url: string;\n omschrijving: string;\n omschrijvingGeneriek?: string;\n}\n\nexport interface InformatieObjectType {\n url: string;\n omschrijving: string;\n}\n\nexport interface InformatieObjectTypeLink {\n informatieObjectTypeLinkId: string;\n documentDefinitionName: string;\n zaakType: string;\n informatieObjectType: string;\n}\n\nexport interface ZaakTypeLink {\n id: string;\n documentDefinitionName: string;\n zaakTypeUrl: string;\n zaakInstanceLinks: ZaakInstanceLink[];\n serviceTaskHandlers: ServiceTaskHandlerRequest[];\n createWithDossier: boolean;\n}\n\nexport interface ZaakTypeRequest {\n zaaktype: string;\n}\n\nexport interface CreateZaakTypeLinkRequest {\n documentDefinitionName: string;\n zaakTypeUrl: string;\n createWithDossier: boolean;\n}\n\nexport interface CreateInformatieObjectTypeLinkRequest {\n documentDefinitionName: string;\n zaakType: string;\n informatieObjectType: string;\n}\n\nexport interface ZaakInstanceLink {\n zaakInstanceUrl: string;\n zaakInstanceId: string;\n documentId: string;\n}\n\nexport interface ServiceTaskHandlerRequest {\n processDefinitionKey: string;\n serviceTaskId: string;\n operation: Operation;\n parameter: string;\n}\n\nexport interface PreviousSelectedZaak {\n zaakTypeLink: ZaakTypeLink;\n zaakType: ZaakType;\n serviceTaskHandler: ServiceTaskHandlerRequest;\n}\n\nexport interface ZaakOperation {\n type: string;\n label: string;\n}\n\nexport interface ZaakStatusType {\n url?: string;\n omschrijving: string;\n omschrijvingGeneriek?: string;\n statustekst?: string;\n zaakType: string;\n volgnummer: number;\n isEindStatus?: boolean;\n informeren?: boolean;\n}\n\nexport interface ZaakResultType {\n url?: string;\n zaaktype: string;\n omschrijving: string;\n resultaattypeomschrijving: string;\n omschrijvingGeneriek?: string;\n selectielijstklasse: string;\n toelichting?: string;\n archiefnominatie?: Archiefnominatie;\n archiefactietermijn?: string;\n brondatumArchiefprocedure?: BrondatumArchiefprocedure;\n}\n\nexport interface ZaakBesluitType {\n url?: string;\n omschrijving: string;\n}\n\nexport interface BrondatumArchiefprocedure {\n afleidingswijze: Afleidingswijze;\n datumkenmerk?: string;\n einddatumBekend?: boolean;\n objecttype?: Objecttype;\n registratie?: string;\n procestermijn?: string;\n}\n\nexport enum Archiefnominatie {\n blijvend_bewaren = 'blijven_bewaren',\n vernietigen = 'vernietigen',\n}\n\nexport enum Afleidingswijze {\n afgehandeld = 'afgehandeld',\n ander_datumkenmerk = 'ander_datumkenmerk',\n eigenschap = 'eigenschap',\n gerelateerde_zaak = 'gerelateerde_zaak',\n hoofdzaak = 'hoofdzaak',\n ingangsdatum_besluit = 'ingangsdatum_besluit',\n termijn = 'termijn',\n vervaldatum_besluit = 'vervaldatum_besluit',\n zaakobject = 'zaakobject',\n}\n\nexport enum Objecttype {\n adres = 'adres',\n besluit = 'besluit',\n buurt = 'buurt',\n enkelvoudig_document = 'enkelvoudig_document',\n gemeente = 'gemeente',\n gemeentelijke_openbare_ruimte = 'gemeentelijke_openbare_ruimte',\n huishouden = 'huishouden',\n inrichtingselement = 'inrichtingselement',\n kadastrale_onroerende_zaak = 'kadastrale_onroerende_zaak',\n kunstwerkdeel = 'kunstwerkdeel',\n maatschappelijke_activiteit = 'maatschappelijke_activiteit',\n medewerker = 'medewerker',\n natuurlijk_persoon = 'natuurlijk_persoon',\n niet_natuurlijk_persoon = 'niet_natuurlijk_persoon',\n openbare_ruimte = 'openbare_ruimte',\n organisatorische_eenheid = 'organisatorische_eenheid',\n pand = 'pand',\n spoorbaandeel = 'spoorbaandeel',\n status = 'status',\n terreindeel = 'terreindeel',\n terrein_gebouwd_object = 'terrein_gebouwd_object',\n vestiging = 'vestiging',\n waterdeel = 'waterdeel',\n wegdeel = 'wegdeel',\n wijk = 'wijk',\n woonplaats = 'woonplaats',\n woz_deelobject = 'woz_deelobject',\n woz_object = 'woz_object',\n woz_waarde = 'woz_waarde',\n zakelijk_recht = 'zakelijk_recht',\n overige = 'overige',\n}\n\nexport enum Operation {\n CREATE_ZAAK = 'CREATE_ZAAK',\n SET_RESULTAAT = 'SET_RESULTAAT',\n SET_STATUS = 'SET_STATUS',\n CREATE_BESLUIT = 'CREATE_BESLUIT',\n}\n","/*\n *\n * * Copyright 2015-2020 Ritense BV, the Netherlands.\n * *\n * * Licensed under EUPL, Version 1.2 (the \"License\");\n * * you may not use this file except in compliance with the License.\n * * You may obtain a copy of the License at\n * *\n * * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n * *\n * * Unless required by applicable law or agreed to in writing, software\n * * distributed under the License is distributed on an \"AS IS\" basis,\n * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * * See the License for the specific language governing permissions and\n * * limitations under the License.\n *\n */\n\nexport * from './upload.model';\nexport * from './uploader.model';\nexport * from './open-zaak.model';\n","/*\n * Copyright 2020 Dimpact.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {ConfigService} from '@valtimo/config';\nimport {Observable} from 'rxjs';\nimport {\n CreateInformatieObjectTypeLinkRequest,\n CreateZaakTypeLinkRequest,\n InformatieObjectType,\n InformatieObjectTypeLink,\n OpenZaakConfig,\n OpenZaakResource,\n ResourceDto,\n ServiceTaskHandlerRequest,\n ZaakType,\n ZaakTypeLink,\n ZaakTypeRequest,\n} from '../models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class OpenZaakService {\n private valtimoApiConfig: any;\n private catalogus: string;\n\n constructor(private http: HttpClient, private configService: ConfigService) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n this.catalogus = configService.config.openZaak.catalogus;\n }\n\n getOpenZaakConfig(): Observable<OpenZaakConfig> {\n return this.http.get<OpenZaakConfig>(`${this.valtimoApiConfig.endpointUri}openzaak/config`);\n }\n\n getResource(resourceId: string): Observable<ResourceDto> {\n return this.http.get<ResourceDto>(`${this.valtimoApiConfig.endpointUri}resource/${resourceId}`);\n }\n\n getZaakTypes(): Observable<ZaakType[]> {\n return this.http.get<ZaakType[]>(`${this.valtimoApiConfig.endpointUri}openzaak/zaaktype`);\n }\n\n getBesluittypen(): Observable<any> {\n return this.http.get(`${this.valtimoApiConfig.endpointUri}besluittype`);\n }\n\n getInformatieObjectTypes(): Observable<InformatieObjectType[]> {\n return this.http.get<InformatieObjectType[]>(\n `${this.valtimoApiConfig.endpointUri}openzaak/informatie-object-typen/${this.catalogus}`\n );\n }\n\n getZaakTypeLink(id: string): Observable<ZaakTypeLink> {\n return this.http.get<ZaakTypeLink>(`${this.valtimoApiConfig.endpointUri}openzaak/link/${id}`);\n }\n\n getInformatieObjectTypeLink(id: string): Observable<InformatieObjectTypeLink> {\n return this.http.get<InformatieObjectTypeLink>(\n `${this.valtimoApiConfig.endpointUri}openzaak/informatie-object-type-link/${id}`\n );\n }\n\n createZaakTypeLink(request: CreateZaakTypeLinkRequest): Observable<any> {\n return this.http.post<any>(`${this.valtimoApiConfig.endpointUri}openzaak/link`, request);\n }\n\n createInformatieObjectTypeLink(request: CreateInformatieObjectTypeLinkRequest): Observable<any> {\n return this.http.post<any>(\n `${this.valtimoApiConfig.endpointUri}openzaak/informatie-object-type-link`,\n request\n );\n }\n\n deleteZaakTypeLink(id: string): Observable<any> {\n return this.http.delete<any>(`${this.valtimoApiConfig.endpointUri}openzaak/link/${id}`);\n }\n\n deleteInformatieObjectTypeLink(id: string): Observable<any> {\n return this.http.delete<any>(\n `${this.valtimoApiConfig.endpointUri}openzaak/informatie-object-type-link/${id}`\n );\n }\n\n getZaakTypeLinkListByProcess(processDefinitionKey: string): Observable<any> {\n return this.http.get(\n `${this.valtimoApiConfig.endpointUri}openzaak/link/process/${processDefinitionKey}`\n );\n }\n\n getStatusTypes(zaakTypeRequest: ZaakTypeRequest): Observable<any> {\n return this.http.post(`${this.valtimoApiConfig.endpointUri}openzaak/status`, zaakTypeRequest);\n }\n\n getStatusResults(zaakTypeRequest): Observable<any> {\n return this.http.post(\n `${this.valtimoApiConfig.endpointUri}openzaak/resultaat`,\n zaakTypeRequest\n );\n }\n\n createServiceTaskHandler(id: string, request: ServiceTaskHandlerRequest): Observable<any> {\n return this.http.post<any>(\n `${this.valtimoApiConfig.endpointUri}openzaak/link/${id}/service-handler`,\n request\n );\n }\n\n modifyServiceTaskHandler(id: string, request: ServiceTaskHandlerRequest): Observable<any> {\n return this.http.put<any>(\n `${this.valtimoApiConfig.endpointUri}openzaak/link/${id}/service-handler`,\n request\n );\n }\n\n deleteServiceTaskHandler(\n id: string,\n processDefinitionKey: string,\n serviceTaskId: string\n ): Observable<any> {\n return this.http.delete<any>(\n `${this.valtimoApiConfig.endpointUri}openzaak/link/${id}/service-handler/${processDefinitionKey}/${serviceTaskId}`\n );\n }\n\n upload(file: File, documentDefinitionName: string): Observable<OpenZaakResource> {\n const formData: FormData = new FormData();\n formData.append('file', file);\n formData.append('documentDefinitionName', documentDefinitionName);\n\n return this.http.post<OpenZaakResource>(\n `${this.valtimoApiConfig.endpointUri}resource/upload-open-zaak`,\n formData,\n {\n reportProgress: true,\n responseType: 'json',\n }\n );\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient} from '@angular/common/http';\nimport {ConfigService} from '@valtimo/config';\nimport {Observable} from 'rxjs';\nimport {OpenZaakResource, ResourceFile, UploadService, ResourceDto} from '../models';\nimport {OpenZaakService} from './open-zaak.service';\nimport {map} from 'rxjs/operators';\n\n@Injectable()\nexport class OpenZaakUploadService implements UploadService {\n private valtimoApiConfig: any;\n\n constructor(\n private readonly openZaakService: OpenZaakService,\n private http: HttpClient,\n private configService: ConfigService\n ) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n }\n\n uploadFile(file: File, documentDefinitionName: string): Observable<ResourceFile> {\n return this.openZaakService\n .upload(new File([file], file.name, {type: file.type}), documentDefinitionName)\n .pipe(map(result => this.getResourceFile(result)));\n }\n\n getResource(resourceId: string): Observable<ResourceDto> {\n return this.openZaakService.getResource(resourceId);\n }\n\n private getResourceFile(result: OpenZaakResource): ResourceFile {\n return {\n customUpload: true,\n originalName: result.name,\n size: result.sizeInBytes,\n url: '/api/resource/' + result.resourceId + '/download',\n storage: 'openZaak',\n type: result.extension,\n data: {\n createdOn: result.createdOn as any as string,\n name: result.name,\n sizeInBytes: result.sizeInBytes,\n resourceId: result.resourceId,\n extension: result.extension,\n },\n };\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {HttpClient, HttpHeaders} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {ConfigService} from '@valtimo/config';\nimport {Resource, S3Resource, ResourceDto} from '../models';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class S3Service {\n private valtimoApiConfig: any;\n\n constructor(private http: HttpClient, private configService: ConfigService) {\n this.valtimoApiConfig = configService.config.valtimoApi;\n }\n\n public getPreSignedUrl(fileName: string): Observable<string> {\n const headers = new HttpHeaders().set('Content-Type', 'text/plain; charset=utf-8');\n const options = {headers, responseType: 'text' as 'text'};\n return this.http.get(\n `${this.valtimoApiConfig.endpointUri}resource/pre-signed-url/${fileName}`,\n options\n );\n }\n\n public upload(url: URL, file: File): Observable<any> {\n const headers = new HttpHeaders().set('Content-Type', file.type);\n return this.http.put(url.toString(), file, {headers: headers});\n }\n\n public registerResource(s3ResourceDTO: S3Resource): Observable<Resource> {\n return this.http.put<Resource>(`${this.valtimoApiConfig.endpointUri}resource`, s3ResourceDTO);\n }\n\n public get(resourceId: string): Observable<ResourceDto> {\n const headers = new HttpHeaders().set('Content-Type', 'application/json;charset=UTF-8');\n return this.http.get<ResourceDto>(\n `${this.valtimoApiConfig.endpointUri}resource/${resourceId}`,\n {headers: headers}\n );\n }\n\n public delete(resourceId: string): Observable<any> {\n const headers = new HttpHeaders().set('Content-Type', 'application/json;charset=UTF-8');\n return this.http.delete(`${this.valtimoApiConfig.endpointUri}resource/${resourceId}`, {\n headers: headers,\n });\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Observable} from 'rxjs';\nimport {map, switchMap, tap} from 'rxjs/operators';\nimport {ResourceDto, ResourceFile, S3Resource, UploadService} from '../models';\nimport {Injectable} from '@angular/core';\nimport {v4 as uuidv4} from 'uuid';\nimport {S3Service} from './s3.service';\n\n@Injectable()\nexport class S3UploadService implements UploadService {\n constructor(private readonly s3Service: S3Service) {}\n\n uploadFile(file: File): Observable<ResourceFile> {\n let resourceUrl: URL;\n const fileName = file.name;\n const splitFileName = fileName.split('.');\n const fileNameWithUUID = `${splitFileName[0]}-${uuidv4()}.${splitFileName[1]}`;\n const renamedFile = new File([file], fileNameWithUUID, {type: file.type});\n\n return this.s3Service.getPreSignedUrl(renamedFile.name).pipe(\n map(url => new URL(url)),\n tap(url => (resourceUrl = url)),\n switchMap(url => this.s3Service.upload(url, renamedFile)),\n map(() => new S3Resource(file, resourceUrl)),\n switchMap(s3Resource => this.s3Service.registerResource(s3Resource)),\n switchMap(s3Resource => this.s3Service.get(s3Resource.id)),\n map(result => ({...result, originalName: file.name})),\n map(result => this.getResourceFile(result))\n );\n }\n\n getResource(resourceId: string): Observable<ResourceDto> {\n return this.s3Service.get(resourceId);\n }\n\n private getResourceFile(result: ResourceDto): ResourceFile {\n return {\n customUpload: true,\n originalName: result.originalName,\n url: result.url,\n size: result.resource.sizeInBytes,\n storage: 'url',\n type: result.resource.extension,\n data: {\n key: result.resource.key,\n bucketName: result.resource.name,\n createdOn: result.resource.createdOn as any as string,\n name: result.originalName,\n sizeInBytes: result.resource.sizeInBytes,\n resourceId: result.resource.id.split('ResourceId(id=')[1].slice(0, -1),\n },\n };\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable, Injector} from '@angular/core';\nimport {NGXLogger} from 'ngx-logger';\nimport {ResourceFile, UploadService, ResourceDto} from '../models';\nimport {ConfigService, UploadProvider} from '@valtimo/config';\nimport {Observable} from 'rxjs';\nimport {OpenZaakUploadService} from './open-zaak-upload.service';\nimport {S3UploadService} from './s3-upload.service';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class UploadProviderService implements UploadService {\n private readonly uploadService: UploadService;\n\n constructor(\n private configService: ConfigService,\n private injector: Injector,\n private logger: NGXLogger\n ) {\n this.uploadService =\n configService.config.uploadProvider === UploadProvider.S3\n ? injector.get<UploadService>(S3UploadService)\n : injector.get<UploadService>(OpenZaakUploadService);\n this.logger.debug('Loading UploadService as', this.uploadService);\n }\n\n uploadFile(file: File, documentDefinitionName?: string): Observable<ResourceFile> {\n return this.uploadService.uploadFile(file, documentDefinitionName);\n }\n\n getResource(resourceId: string): Observable<ResourceDto> {\n return this.uploadService.getResource(resourceId);\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {Injectable} from '@angular/core';\nimport {ConfigService} from '@valtimo/config';\nimport {HttpClient} from '@angular/common/http';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DownloadService {\n constructor(private http: HttpClient, private configService: ConfigService) {}\n\n downloadFile(url: string, name: string) {\n if (\n url.startsWith(this.configService.config.valtimoApi.endpointUri) ||\n url.startsWith(window.location.origin)\n ) {\n // if download url is on backend use angular to get the content so access token is used\n this.http.get(url, {responseType: 'blob'}).subscribe(content => {\n const downloadUrl = window.URL.createObjectURL(content);\n this.openDownloadLink(downloadUrl, name);\n });\n } else {\n // download links to external services (like amazon s3) open in a new window\n this.openDownloadLink(url, name);\n }\n }\n\n private openDownloadLink(url: string, name: string) {\n const link = document.createElement('a');\n link.href = url;\n link.download = name;\n link.target = '_blank';\n link.click();\n link.remove();\n }\n}\n","/*\n * Copyright 2015-2020 Ritense BV, the Netherlands.\n *\n * Licensed under EUPL, Version 1.2 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" basis,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {NgModule} from '@angular/core';\nimport {OpenZaakUploadService} from './services/open-zaak-upload.service';\nimport {S3UploadService} from './services/s3-upload.service';\nimport {UploadProviderService} from './services/upload-provider.service';\nimport {OpenZaakService} from './services/open-zaak.service';\nimport {S3Service} from './services/s3.service';\nimport {DownloadService} from './services/download.service';\n\n@NgModule({\n declarations: [],\n imports: [],\n exports: [],\n providers: [\n OpenZaakUploadService,\n S3UploadService,\n UploadProviderService,\n OpenZaakService,\n S3Service,\n DownloadService,\n ],\n})\nexport class ResourceModule {}\n","/*\n * Public API Surface of upload\n */\n\nexport * from './lib/models';\nexport * from './lib/resource.module';\nexport * from './lib/services/open-zaak.service';\nexport * from './lib/services/upload-provider.service';\nexport * from './lib/services/s3.service';\nexport * from './lib/services/download.service';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n\nexport {OpenZaakUploadService as ɵa} from './lib/services/open-zaak-upload.service';\nexport {S3UploadService as ɵb} from './lib/services/s3-upload.service';"],"names":["Archiefnominatie","Afleidingswijze","Objecttype","Operation","Injectable","HttpClient","ConfigService","map","HttpHeaders","uuidv4","tap","switchMap","UploadProvider","Injector","NGXLogger","NgModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;QAgDE,oBAAY,IAAU,EAAE,YAAiB;YAPz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