@valtimo/document 0.0.0-test

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 (43) hide show
  1. package/fesm2022/valtimo-document.mjs +832 -0
  2. package/fesm2022/valtimo-document.mjs.map +1 -0
  3. package/index.d.ts +6 -0
  4. package/lib/document.module.d.ts +7 -0
  5. package/lib/document.module.d.ts.map +1 -0
  6. package/lib/models/advanced-document-search-request.d.ts +35 -0
  7. package/lib/models/advanced-document-search-request.d.ts.map +1 -0
  8. package/lib/models/audit.model.d.ts +19 -0
  9. package/lib/models/audit.model.d.ts.map +1 -0
  10. package/lib/models/case-tags.model.d.ts +12 -0
  11. package/lib/models/case-tags.model.d.ts.map +1 -0
  12. package/lib/models/document-search-request.d.ts +51 -0
  13. package/lib/models/document-search-request.d.ts.map +1 -0
  14. package/lib/models/document.model.d.ts +314 -0
  15. package/lib/models/document.model.d.ts.map +1 -0
  16. package/lib/models/index.d.ts +9 -0
  17. package/lib/models/index.d.ts.map +1 -0
  18. package/lib/models/internal-case-status.model.d.ts +14 -0
  19. package/lib/models/internal-case-status.model.d.ts.map +1 -0
  20. package/lib/models/list-sorting.model.d.ts +10 -0
  21. package/lib/models/list-sorting.model.d.ts.map +1 -0
  22. package/lib/models/process-document-definition-search.model.d.ts +5 -0
  23. package/lib/models/process-document-definition-search.model.d.ts.map +1 -0
  24. package/lib/services/case-status.service.d.ts +19 -0
  25. package/lib/services/case-status.service.d.ts.map +1 -0
  26. package/lib/services/document.service.d.ts +77 -0
  27. package/lib/services/document.service.d.ts.map +1 -0
  28. package/lib/services/file-sort.service.d.ts +11 -0
  29. package/lib/services/file-sort.service.d.ts.map +1 -0
  30. package/lib/services/index.d.ts +5 -0
  31. package/lib/services/index.d.ts.map +1 -0
  32. package/lib/services/tags.service.d.ts +19 -0
  33. package/lib/services/tags.service.d.ts.map +1 -0
  34. package/lib/utils/case-tags.utils.d.ts +7 -0
  35. package/lib/utils/case-tags.utils.d.ts.map +1 -0
  36. package/lib/utils/index.d.ts +3 -0
  37. package/lib/utils/index.d.ts.map +1 -0
  38. package/lib/utils/internal-case-status.utils.d.ts +7 -0
  39. package/lib/utils/internal-case-status.utils.d.ts.map +1 -0
  40. package/package.json +24 -0
  41. package/public_api.d.ts +5 -0
  42. package/public_api.d.ts.map +1 -0
  43. package/valtimo-document.d.ts.map +1 -0
@@ -0,0 +1,832 @@
1
+ import * as i1 from '@angular/common/http';
2
+ import { HttpParams, HttpHeaders } from '@angular/common/http';
3
+ import * as i0 from '@angular/core';
4
+ import { Injectable, NgModule } from '@angular/core';
5
+ import * as i2 from '@valtimo/shared';
6
+ import { BaseApiService, InterceptorSkip, TagColor } from '@valtimo/shared';
7
+ import { catchError, of, switchMap } from 'rxjs';
8
+
9
+ /*
10
+ * Copyright 2015-2026 Ritense BV, the Netherlands.
11
+ *
12
+ * Licensed under EUPL, Version 1.2 (the "License");
13
+ * you may not use this file except in compliance with the License.
14
+ * You may obtain a copy of the License at
15
+ *
16
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software
19
+ * distributed under the License is distributed on an "AS IS" basis,
20
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ * See the License for the specific language governing permissions and
22
+ * limitations under the License.
23
+ */
24
+ class ModifyDocumentRequestImpl {
25
+ constructor(documentId, content, versionBasedOn) {
26
+ this.documentId = documentId;
27
+ this.content = content;
28
+ this.versionBasedOn = versionBasedOn;
29
+ }
30
+ }
31
+ class ModifyDocumentAndCompleteTaskRequestImpl {
32
+ constructor(taskId, request) {
33
+ this.taskId = taskId;
34
+ this.request = request;
35
+ }
36
+ }
37
+ class NewDocumentRequestImpl {
38
+ constructor(definition, content) {
39
+ this.definition = definition;
40
+ this.content = content;
41
+ }
42
+ }
43
+ class NewDocumentAndStartProcessRequestImpl {
44
+ constructor(processDefinitionKey, request) {
45
+ this.processDefinitionKey = processDefinitionKey;
46
+ this.request = request;
47
+ }
48
+ }
49
+ class ModifyDocumentAndStartProcessRequestImpl {
50
+ constructor(processDefinitionKey, request) {
51
+ this.processDefinitionKey = processDefinitionKey;
52
+ this.request = request;
53
+ }
54
+ }
55
+ class DocumentDefinitionCreateRequest {
56
+ constructor(definition) {
57
+ this.definition = definition;
58
+ }
59
+ }
60
+
61
+ /*
62
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
63
+ *
64
+ * Licensed under EUPL, Version 1.2 (the "License");
65
+ * you may not use this file except in compliance with the License.
66
+ * You may obtain a copy of the License at
67
+ *
68
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
69
+ *
70
+ * Unless required by applicable law or agreed to in writing, software
71
+ * distributed under the License is distributed on an "AS IS" basis,
72
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
73
+ * See the License for the specific language governing permissions and
74
+ * limitations under the License.
75
+ */
76
+
77
+ /*
78
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
79
+ *
80
+ * Licensed under EUPL, Version 1.2 (the "License");
81
+ * you may not use this file except in compliance with the License.
82
+ * You may obtain a copy of the License at
83
+ *
84
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
85
+ *
86
+ * Unless required by applicable law or agreed to in writing, software
87
+ * distributed under the License is distributed on an "AS IS" basis,
88
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
+ * See the License for the specific language governing permissions and
90
+ * limitations under the License.
91
+ */
92
+
93
+ /*
94
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
95
+ *
96
+ * Licensed under EUPL, Version 1.2 (the "License");
97
+ * you may not use this file except in compliance with the License.
98
+ * You may obtain a copy of the License at
99
+ *
100
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
101
+ *
102
+ * Unless required by applicable law or agreed to in writing, software
103
+ * distributed under the License is distributed on an "AS IS" basis,
104
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
105
+ * See the License for the specific language governing permissions and
106
+ * limitations under the License.
107
+ */
108
+ class AdvancedDocumentSearchRequestHttpBody {
109
+ }
110
+ class AdvancedDocumentSearchRequestImpl {
111
+ constructor(definitionName, page, size, sort, searchOperator, otherFilters) {
112
+ this.definitionName = definitionName;
113
+ this.page = page;
114
+ this.size = size;
115
+ this.sort = sort;
116
+ this.otherFilters = otherFilters;
117
+ this.searchOperator = searchOperator;
118
+ }
119
+ asHttpBody() {
120
+ const httpBody = new AdvancedDocumentSearchRequestHttpBody();
121
+ httpBody.documentDefinitionName = this.definitionName;
122
+ if (this.otherFilters) {
123
+ httpBody.otherFilters = this.otherFilters;
124
+ }
125
+ if (this.searchOperator) {
126
+ httpBody.searchOperator = this.searchOperator;
127
+ }
128
+ return httpBody;
129
+ }
130
+ asHttpParams() {
131
+ let params = new HttpParams()
132
+ .set('definitionName', this.definitionName)
133
+ .set('page', this.page.toString())
134
+ .set('size', this.size.toString());
135
+ if (this.sort) {
136
+ params = params.set('sort', this.getSortString(this.sort));
137
+ }
138
+ return params;
139
+ }
140
+ setPage(page) {
141
+ this.page = page;
142
+ }
143
+ getSortString(sort) {
144
+ return `${sort.state.name},${sort.state.direction}`;
145
+ }
146
+ }
147
+
148
+ /*
149
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
150
+ *
151
+ * Licensed under EUPL, Version 1.2 (the "License");
152
+ * you may not use this file except in compliance with the License.
153
+ * You may obtain a copy of the License at
154
+ *
155
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
156
+ *
157
+ * Unless required by applicable law or agreed to in writing, software
158
+ * distributed under the License is distributed on an "AS IS" basis,
159
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
160
+ * See the License for the specific language governing permissions and
161
+ * limitations under the License.
162
+ */
163
+ class DocumentSearchRequestHttpBody {
164
+ }
165
+ class DocumentSearchRequestImpl {
166
+ constructor(definitionName, page, size, sequence, createdBy, globalSearchFilter, sort, otherFilters) {
167
+ this.definitionName = definitionName;
168
+ this.page = page;
169
+ this.size = size;
170
+ this.sequence = sequence;
171
+ this.createdBy = createdBy;
172
+ this.globalSearchFilter = globalSearchFilter;
173
+ this.sort = sort;
174
+ this.otherFilters = otherFilters;
175
+ }
176
+ asHttpBody() {
177
+ const httpBody = new DocumentSearchRequestHttpBody();
178
+ httpBody.documentDefinitionName = this.definitionName;
179
+ if (this.sequence) {
180
+ httpBody.sequence = this.sequence;
181
+ }
182
+ if (this.createdBy) {
183
+ httpBody.createdBy = this.createdBy;
184
+ }
185
+ if (this.globalSearchFilter) {
186
+ httpBody.globalSearchFilter = this.globalSearchFilter;
187
+ }
188
+ if (this.otherFilters) {
189
+ httpBody.otherFilters = this.otherFilters;
190
+ }
191
+ return httpBody;
192
+ }
193
+ asHttpParams() {
194
+ let params = new HttpParams()
195
+ .set('definitionName', this.definitionName)
196
+ .set('page', this.page.toString())
197
+ .set('size', this.size.toString());
198
+ if (this.sort) {
199
+ params = params.set('sort', this.getSortString(this.sort));
200
+ }
201
+ return params;
202
+ }
203
+ setPage(page) {
204
+ this.page = page;
205
+ }
206
+ getSortString(sort) {
207
+ return `${sort.state.name},${sort.state.direction}`;
208
+ }
209
+ }
210
+
211
+ /*
212
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
213
+ *
214
+ * Licensed under EUPL, Version 1.2 (the "License");
215
+ * you may not use this file except in compliance with the License.
216
+ * You may obtain a copy of the License at
217
+ *
218
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
219
+ *
220
+ * Unless required by applicable law or agreed to in writing, software
221
+ * distributed under the License is distributed on an "AS IS" basis,
222
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
223
+ * See the License for the specific language governing permissions and
224
+ * limitations under the License.
225
+ */
226
+
227
+ /*
228
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
229
+ *
230
+ * Licensed under EUPL, Version 1.2 (the "License");
231
+ * you may not use this file except in compliance with the License.
232
+ * You may obtain a copy of the License at
233
+ *
234
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
235
+ *
236
+ * Unless required by applicable law or agreed to in writing, software
237
+ * distributed under the License is distributed on an "AS IS" basis,
238
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
+ * See the License for the specific language governing permissions and
240
+ * limitations under the License.
241
+ */
242
+
243
+ /*
244
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
245
+ *
246
+ * Licensed under EUPL, Version 1.2 (the "License");
247
+ * you may not use this file except in compliance with the License.
248
+ * You may obtain a copy of the License at
249
+ *
250
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
251
+ *
252
+ * Unless required by applicable law or agreed to in writing, software
253
+ * distributed under the License is distributed on an "AS IS" basis,
254
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
255
+ * See the License for the specific language governing permissions and
256
+ * limitations under the License.
257
+ */
258
+
259
+ /*
260
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
261
+ *
262
+ * Licensed under EUPL, Version 1.2 (the "License");
263
+ * you may not use this file except in compliance with the License.
264
+ * You may obtain a copy of the License at
265
+ *
266
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
267
+ *
268
+ * Unless required by applicable law or agreed to in writing, software
269
+ * distributed under the License is distributed on an "AS IS" basis,
270
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
271
+ * See the License for the specific language governing permissions and
272
+ * limitations under the License.
273
+ */
274
+
275
+ /*
276
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
277
+ *
278
+ * Licensed under EUPL, Version 1.2 (the "License");
279
+ * you may not use this file except in compliance with the License.
280
+ * You may obtain a copy of the License at
281
+ *
282
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
283
+ *
284
+ * Unless required by applicable law or agreed to in writing, software
285
+ * distributed under the License is distributed on an "AS IS" basis,
286
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
287
+ * See the License for the specific language governing permissions and
288
+ * limitations under the License.
289
+ */
290
+ class CaseStatusService extends BaseApiService {
291
+ constructor(httpClient, configService) {
292
+ super(httpClient, configService);
293
+ this.httpClient = httpClient;
294
+ this.configService = configService;
295
+ }
296
+ getInternalCaseStatuses(caseDefinitionKey) {
297
+ return this.httpClient.get(this.getApiUrl(`/v1/case-definition/${caseDefinitionKey}/internal-status`));
298
+ }
299
+ getInternalCaseStatusesManagement(caseDefinitionKey) {
300
+ return this.httpClient.get(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/internal-status`));
301
+ }
302
+ createInternalCaseStatus(caseDefinitionKey, internalCaseStatus) {
303
+ return this.httpClient.post(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/internal-status`), internalCaseStatus);
304
+ }
305
+ updateInternalCaseStatuses(caseDefinitionKey, internalCaseStatuses) {
306
+ return this.httpClient.put(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/internal-status`), internalCaseStatuses);
307
+ }
308
+ updateInternalCaseStatus(caseDefinitionKey, internalStatusKey, internalCaseStatus) {
309
+ return this.httpClient.put(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/internal-status/${internalStatusKey}`), internalCaseStatus);
310
+ }
311
+ deleteInternalCaseStatus(caseDefinitionKey, internalStatusKey) {
312
+ return this.httpClient.delete(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/internal-status/${internalStatusKey}`));
313
+ }
314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CaseStatusService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
315
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CaseStatusService, providedIn: 'root' }); }
316
+ }
317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CaseStatusService, decorators: [{
318
+ type: Injectable,
319
+ args: [{
320
+ providedIn: 'root',
321
+ }]
322
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
323
+
324
+ /*
325
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
326
+ *
327
+ * Licensed under EUPL, Version 1.2 (the "License");
328
+ * you may not use this file except in compliance with the License.
329
+ * You may obtain a copy of the License at
330
+ *
331
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
332
+ *
333
+ * Unless required by applicable law or agreed to in writing, software
334
+ * distributed under the License is distributed on an "AS IS" basis,
335
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
336
+ * See the License for the specific language governing permissions and
337
+ * limitations under the License.
338
+ */
339
+ class DocumentService {
340
+ constructor(http, configService) {
341
+ this.http = http;
342
+ this.configService = configService;
343
+ this.EMPTY_DOCUMENTS_RESPONSE = {
344
+ content: [],
345
+ empty: true,
346
+ first: false,
347
+ last: false,
348
+ number: 0,
349
+ numberOfElements: 0,
350
+ size: 0,
351
+ sort: false,
352
+ totalElements: 0,
353
+ totalPages: 0,
354
+ };
355
+ this.valtimoEndpointUri = this.configService.config.valtimoApi.endpointUri;
356
+ }
357
+ // Document-calls
358
+ getAllDefinitions() {
359
+ return this.http.get(`${this.valtimoEndpointUri}v1/document-definition?size=1000`);
360
+ }
361
+ queryDefinitions(params) {
362
+ return this.http.get(`${this.valtimoEndpointUri}v1/document-definition`, { params });
363
+ }
364
+ queryDefinitionsForManagement(params) {
365
+ return this.http.get(`${this.valtimoEndpointUri}management/v1/document-definition`, { params });
366
+ }
367
+ getDocumentDefinition(documentDefinitionName, skipNotFound = false) {
368
+ return skipNotFound
369
+ ? this.http.get(`${this.valtimoEndpointUri}v1/document-definition/${documentDefinitionName}`, { headers: new HttpHeaders().set(InterceptorSkip, '404') })
370
+ : this.http.get(`${this.valtimoEndpointUri}v1/document-definition/${documentDefinitionName}`);
371
+ }
372
+ getDocumentDefinitionForManagement(documentDefinitionName) {
373
+ return this.http.get(`${this.valtimoEndpointUri}management/v1/document-definition/${documentDefinitionName}`);
374
+ }
375
+ getDocuments(documentSearchRequest) {
376
+ return this.http.post(`${this.valtimoEndpointUri}v1/document-search`, documentSearchRequest.asHttpBody(), {
377
+ params: documentSearchRequest.asHttpParams(),
378
+ });
379
+ }
380
+ getDocumentsSearch(documentSearchRequest, searchOperator, assigneeFilter, otherFilters, statusFilter, caseTagsFilter) {
381
+ const body = {
382
+ ...documentSearchRequest.asHttpBody(),
383
+ ...(searchOperator && { searchOperator }),
384
+ ...(assigneeFilter && { assigneeFilter }),
385
+ ...(otherFilters && { otherFilters }),
386
+ ...(statusFilter && { statusFilter }),
387
+ ...(caseTagsFilter && { caseTagsFilter }),
388
+ };
389
+ return this.http
390
+ .post(`${this.valtimoEndpointUri}v1/document-definition/${documentSearchRequest.definitionName}/search`, body, { params: documentSearchRequest.asHttpParams() })
391
+ .pipe(catchError(() => of(this.EMPTY_DOCUMENTS_RESPONSE)));
392
+ }
393
+ getSpecifiedDocumentsSearch(documentSearchRequest, searchOperator, assigneeFilter, otherFilters, statusFilter, caseTagsFilter) {
394
+ const body = {
395
+ ...documentSearchRequest.asHttpBody(),
396
+ ...(searchOperator && { searchOperator }),
397
+ ...(assigneeFilter && { assigneeFilter }),
398
+ ...(otherFilters && { otherFilters }),
399
+ ...(statusFilter && { statusFilter }),
400
+ ...(caseTagsFilter && { caseTagsFilter }),
401
+ };
402
+ return this.http
403
+ .post(`${this.valtimoEndpointUri}v1/case/${documentSearchRequest.definitionName}/search`, body, { params: documentSearchRequest.asHttpParams() })
404
+ .pipe(catchError(() => of(this.EMPTY_DOCUMENTS_RESPONSE)));
405
+ }
406
+ getDocumentSearchFields(caseDefinitionKey) {
407
+ return this.http.get(`${this.valtimoEndpointUri}v1/document-search/${caseDefinitionKey}/fields`);
408
+ }
409
+ putDocumentSearch(caseDefinitionKey, request) {
410
+ return this.http.put(`${this.valtimoEndpointUri}v1/document-search/${caseDefinitionKey}/fields`, request);
411
+ }
412
+ postDocumentSearch(caseDefinitionKey, request) {
413
+ return this.http.post(`${this.valtimoEndpointUri}v1/document-search/${caseDefinitionKey}/fields`, { ...request });
414
+ }
415
+ deleteDocumentSearch(caseDefinitionKey, key) {
416
+ const options = {
417
+ headers: new HttpHeaders({
418
+ 'Content-Type': 'application/json',
419
+ }),
420
+ };
421
+ return this.http.delete(`${this.valtimoEndpointUri}v1/document-search/${caseDefinitionKey}/fields?key=${key}`, options);
422
+ }
423
+ getDropdownDataProviders() {
424
+ return this.http.get(`${this.valtimoEndpointUri}v1/data/dropdown-list/provider`);
425
+ }
426
+ getDropdownData(provider, caseDefinitionKey, fieldKey) {
427
+ const dropdownListKey = encodeURI(caseDefinitionKey + '_' + fieldKey);
428
+ return this.http.get(`${this.valtimoEndpointUri}v1/data/dropdown-list?provider=${provider}&key=${dropdownListKey}`);
429
+ }
430
+ postDropdownData(provider, caseDefinitionKey, fieldKey, dropdownData) {
431
+ const dropdownListKey = encodeURI(caseDefinitionKey + '_' + fieldKey);
432
+ return this.http.post(`${this.valtimoEndpointUri}v1/data/dropdown-list?provider=${provider}&key=${dropdownListKey}`, dropdownData);
433
+ }
434
+ deleteDropdownData(provider, caseDefinitionKey, fieldKey) {
435
+ const dropdownListKey = encodeURI(caseDefinitionKey + '_' + fieldKey);
436
+ return this.http.delete(`${this.valtimoEndpointUri}v1/data/dropdown-list?provider=${provider}&key=${dropdownListKey}`);
437
+ }
438
+ getDocument(documentId) {
439
+ return this.http.get(`${this.valtimoEndpointUri}v1/document/${documentId}`);
440
+ }
441
+ modifyDocument(document) {
442
+ return this.http.put(`${this.valtimoEndpointUri}v1/document`, document);
443
+ }
444
+ deleteDocument(documentId) {
445
+ return this.http.delete(`${this.valtimoEndpointUri}v1/document/${documentId}`);
446
+ }
447
+ findProcessDefinitionCaseDefinitionsByCanInitializeDocument(caseDefinitionKey, canInitializeDocument) {
448
+ return this.http.get(`${this.valtimoEndpointUri}v1/case-definition/${caseDefinitionKey}/case-process-link?canInitializeDocument=${canInitializeDocument}`);
449
+ }
450
+ getStartableItems(params) {
451
+ const httpParams = new HttpParams({
452
+ fromObject: Object.fromEntries(Object.entries(params).filter(([_, v]) => v != null)),
453
+ });
454
+ return this.http.get(`${this.valtimoEndpointUri}v1/case/startable-item`, {
455
+ params: httpParams,
456
+ });
457
+ }
458
+ // Case definition calls
459
+ getCaseDefinitions(params) {
460
+ return this.http.get(`${this.valtimoEndpointUri}v1/case-definition`, {
461
+ params,
462
+ });
463
+ }
464
+ getCaseDefinitionsManagement(params) {
465
+ return this.http.get(`${this.valtimoEndpointUri}management/v1/case-definition`, {
466
+ params,
467
+ });
468
+ }
469
+ findProcessDocumentDefinitionsByVersion(documentDefinitionName, version) {
470
+ return this.http.get(`${this.valtimoEndpointUri}v1/process-document/definition/document/${documentDefinitionName}/version/${version}`);
471
+ }
472
+ findProcessDocumentInstances(documentId) {
473
+ return this.http.get(`${this.valtimoEndpointUri}v2/process-document/instance/document/${documentId}`);
474
+ }
475
+ createDocumentDefinitionTemplate(payload) {
476
+ return this.http
477
+ .post(`${this.valtimoEndpointUri}management/v1/document-definition-template`, payload)
478
+ .pipe(switchMap((definition) => this.createDocumentDefinitionForManagement({ definition: JSON.stringify(definition) })));
479
+ }
480
+ newDocumentAndStartProcess(request) {
481
+ return this.http.post(`${this.valtimoEndpointUri}v1/process-document/operation/new-document-and-start-process`, request);
482
+ }
483
+ modifyDocumentAndCompleteTask(request) {
484
+ return this.http.post(`${this.valtimoEndpointUri}v1/process-document/operation/modify-document-and-complete-task`, request);
485
+ }
486
+ modifyDocumentAndStartProcess(request) {
487
+ return this.http.post(`${this.valtimoEndpointUri}v1/process-document/operation/modify-document-and-start-process`, request);
488
+ }
489
+ createProcessDocumentDefinition(request) {
490
+ return this.http.post(`${this.valtimoEndpointUri}v1/process-document/definition`, request);
491
+ }
492
+ createDocumentDefinitionForManagement(documentDefinitionCreateRequest) {
493
+ const options = {
494
+ headers: new HttpHeaders({
495
+ 'Content-Type': 'application/json',
496
+ }),
497
+ };
498
+ return this.http.post(`${this.valtimoEndpointUri}management/v1/document-definition`, documentDefinitionCreateRequest, options);
499
+ }
500
+ updateDocumentDefinitionForManagement(caseDefinitionKey, caseDefinitionVersionTag, request) {
501
+ const options = {
502
+ headers: new HttpHeaders({
503
+ 'Content-Type': 'application/json',
504
+ }),
505
+ };
506
+ return this.http.put(`${this.valtimoEndpointUri}management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/document-definition`, request, options);
507
+ }
508
+ deleteProcessDocumentDefinition(request) {
509
+ const options = {
510
+ headers: new HttpHeaders({
511
+ 'Content-Type': 'application/json',
512
+ }),
513
+ body: request,
514
+ };
515
+ return this.http.delete(`${this.valtimoEndpointUri}v1/process-document/definition`, options);
516
+ }
517
+ getAuditLog(documentId, page = 0) {
518
+ let params = new HttpParams();
519
+ params = params.set('page', page.toString());
520
+ return this.http.get(`${this.valtimoEndpointUri}v1/process-document/instance/document/${documentId}/audit`, { params });
521
+ }
522
+ assignResource(documentId, resourceId) {
523
+ return this.http.post(`${this.valtimoEndpointUri}v1/document/${documentId}/resource/${resourceId}`, {});
524
+ }
525
+ removeResource(documentId, resourceId) {
526
+ const options = {
527
+ headers: new HttpHeaders({
528
+ 'Content-Type': 'application/json',
529
+ }),
530
+ };
531
+ return this.http.delete(`${this.valtimoEndpointUri}v1/document/${documentId}/resource/${resourceId}`, options);
532
+ }
533
+ removeDocumentDefinitionForManagement(name) {
534
+ return this.http.delete(`${this.valtimoEndpointUri}management/v1/document-definition/${name}`);
535
+ }
536
+ sendMessage(documentId, request) {
537
+ return this.http.post(`${this.valtimoEndpointUri}v1/document/${documentId}/message`, request);
538
+ }
539
+ getDocumentTypesForCase(caseDefinitionKey, versionTag) {
540
+ return this.http.get(`${this.valtimoEndpointUri}v1/case-definition/${caseDefinitionKey}/version/${versionTag}/zaaktype/documenttype`);
541
+ }
542
+ getDocumentTypesForDocument(documentId) {
543
+ return this.http.get(`${this.valtimoEndpointUri}v1/document/${documentId}/zaaktype/documenttype`);
544
+ }
545
+ getProcessDefinitionCaseDefinitionFromProcessInstanceId(processInstanceId) {
546
+ return this.configService.getFeatureToggle('enableSuppressDocumentError')
547
+ ? this.http.get(`${this.valtimoEndpointUri}v1/process-instance/${processInstanceId}/case-process-link`, {
548
+ headers: new HttpHeaders().set(InterceptorSkip, '400'),
549
+ })
550
+ : this.http.get(`${this.valtimoEndpointUri}v1/process-instance/${processInstanceId}/case-process-link`);
551
+ }
552
+ assignHandlerToDocument(documentId, assigneeId, assignedTeamKey) {
553
+ return this.http.post(`${this.valtimoEndpointUri}v1/document/${documentId}/assign`, { assigneeId, assignedTeamKey });
554
+ }
555
+ unassignHandlerFromDocument(documentId) {
556
+ return this.http.post(`${this.valtimoEndpointUri}v1/document/${documentId}/unassign`, {});
557
+ }
558
+ getCandidateUsers(documentId) {
559
+ return this.http.get(`${this.valtimoEndpointUri}v1/document/${documentId}/candidate-user`);
560
+ }
561
+ getCandidateTeams(documentId) {
562
+ return this.http.get(`${this.valtimoEndpointUri}v1/document/${documentId}/candidate-team`, { params: { size: '1000' } });
563
+ }
564
+ getOpenDocumentCount() {
565
+ return this.http.get(`${this.valtimoEndpointUri}v1/document-definition/open/count`);
566
+ }
567
+ patchCaseSettingsForManagement(caseDefinitionKey, caseDefinitionVersionTag, request) {
568
+ return this.http.patch(`${this.valtimoEndpointUri}management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/settings`, { ...request });
569
+ }
570
+ getCaseSettings(caseDefinitionKey) {
571
+ return this.http.get(`${this.valtimoEndpointUri}v1/case-definition/${caseDefinitionKey}/settings`);
572
+ }
573
+ getCaseSettingsForManagement(caseDefinitionKey, caseDefinitionVersionTag) {
574
+ return this.http.get(`${this.valtimoEndpointUri}management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/settings`);
575
+ }
576
+ getCaseList(documentDefinitionName) {
577
+ return this.http.get(`${this.valtimoEndpointUri}v1/case/${documentDefinitionName}/list-column`);
578
+ }
579
+ getCaseListForManagement(documentDefinitionName) {
580
+ return this.http.get(`${this.valtimoEndpointUri}management/v1/case/${documentDefinitionName}/list-column`);
581
+ }
582
+ postCaseListForManagement(documentDefinitionName, request) {
583
+ return this.http.post(`${this.valtimoEndpointUri}management/v1/case/${documentDefinitionName}/list-column`, { ...request });
584
+ }
585
+ putCaseListForManagement(documentDefinitionName, request) {
586
+ return this.http.put(`${this.valtimoEndpointUri}management/v1/case/${documentDefinitionName}/list-column`, [...request]);
587
+ }
588
+ deleteCaseListForManagement(documentDefinitionName, columnKey) {
589
+ return this.http.delete(`${this.valtimoEndpointUri}management/v1/case/${documentDefinitionName}/list-column/${columnKey}`);
590
+ }
591
+ getDocumentDefinitionVersions(documentDefinitionName) {
592
+ return this.http.get(`${this.valtimoEndpointUri}management/v1/document-definition/${documentDefinitionName}/version`);
593
+ }
594
+ getDocumentDefinitionByVersion(caseDefinitionKey, caseDefinitionVersionTag) {
595
+ return this.http.get(`${this.valtimoEndpointUri}management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/document-definition`);
596
+ }
597
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DocumentService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
598
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DocumentService, providedIn: 'root' }); }
599
+ }
600
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DocumentService, decorators: [{
601
+ type: Injectable,
602
+ args: [{
603
+ providedIn: 'root',
604
+ }]
605
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
606
+
607
+ /*
608
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
609
+ *
610
+ * Licensed under EUPL, Version 1.2 (the "License");
611
+ * you may not use this file except in compliance with the License.
612
+ * You may obtain a copy of the License at
613
+ *
614
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
615
+ *
616
+ * Unless required by applicable law or agreed to in writing, software
617
+ * distributed under the License is distributed on an "AS IS" basis,
618
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
619
+ * See the License for the specific language governing permissions and
620
+ * limitations under the License.
621
+ */
622
+ class FileSortService {
623
+ constructor(configService) {
624
+ this.configService = configService;
625
+ }
626
+ sortRelatedFilesByDateDescending(relatedFiles) {
627
+ const sortByDate = this.configService.config?.featureToggles?.sortFilesByDate;
628
+ if (sortByDate) {
629
+ return relatedFiles.sort((a, b) => new Date(b.createdOn).getTime() - new Date(a.createdOn).getTime());
630
+ }
631
+ return relatedFiles;
632
+ }
633
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FileSortService, deps: [{ token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
634
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FileSortService, providedIn: 'root' }); }
635
+ }
636
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FileSortService, decorators: [{
637
+ type: Injectable,
638
+ args: [{
639
+ providedIn: 'root',
640
+ }]
641
+ }], ctorParameters: () => [{ type: i2.ConfigService }] });
642
+
643
+ /*
644
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
645
+ *
646
+ * Licensed under EUPL, Version 1.2 (the "License");
647
+ * you may not use this file except in compliance with the License.
648
+ * You may obtain a copy of the License at
649
+ *
650
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
651
+ *
652
+ * Unless required by applicable law or agreed to in writing, software
653
+ * distributed under the License is distributed on an "AS IS" basis,
654
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
655
+ * See the License for the specific language governing permissions and
656
+ * limitations under the License.
657
+ */
658
+ class CaseTagService extends BaseApiService {
659
+ constructor(httpClient, configService) {
660
+ super(httpClient, configService);
661
+ this.httpClient = httpClient;
662
+ this.configService = configService;
663
+ }
664
+ getCaseTagsManagement(caseDefinitionKey, caseDefinitionVersionTag) {
665
+ return this.httpClient.get(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/case-tag`));
666
+ }
667
+ getCaseTags(caseDefinitionKey) {
668
+ return this.httpClient.get(this.getApiUrl(`/v1/case-definition/${caseDefinitionKey}/case-tag`));
669
+ }
670
+ saveCaseTag(caseDefinitionKey, caseDefinitionVersionTag, tag) {
671
+ return this.httpClient.post(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/case-tag`), tag);
672
+ }
673
+ updateCaseTag(caseDefinitionKey, caseDefinitionVersionTag, currentTag, updatedTag) {
674
+ return this.httpClient.put(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/case-tag/${currentTag}`), updatedTag);
675
+ }
676
+ deleteCaseTag(caseDefinitionKey, caseDefinitionVersionTag, tag) {
677
+ return this.httpClient.delete(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/case-tag/${tag}`));
678
+ }
679
+ updateCaseTags(caseDefinitionKey, caseDefinitionVersionTag, reorderedTags) {
680
+ return this.httpClient.put(this.getApiUrl(`/management/v1/case-definition/${caseDefinitionKey}/version/${caseDefinitionVersionTag}/case-tag`), reorderedTags);
681
+ }
682
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CaseTagService, deps: [{ token: i1.HttpClient }, { token: i2.ConfigService }], target: i0.ɵɵFactoryTarget.Injectable }); }
683
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CaseTagService, providedIn: 'root' }); }
684
+ }
685
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CaseTagService, decorators: [{
686
+ type: Injectable,
687
+ args: [{
688
+ providedIn: 'root',
689
+ }]
690
+ }], ctorParameters: () => [{ type: i1.HttpClient }, { type: i2.ConfigService }] });
691
+
692
+ /*
693
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
694
+ *
695
+ * Licensed under EUPL, Version 1.2 (the "License");
696
+ * you may not use this file except in compliance with the License.
697
+ * You may obtain a copy of the License at
698
+ *
699
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
700
+ *
701
+ * Unless required by applicable law or agreed to in writing, software
702
+ * distributed under the License is distributed on an "AS IS" basis,
703
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
704
+ * See the License for the specific language governing permissions and
705
+ * limitations under the License.
706
+ */
707
+
708
+ /*
709
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
710
+ *
711
+ * Licensed under EUPL, Version 1.2 (the "License");
712
+ * you may not use this file except in compliance with the License.
713
+ * You may obtain a copy of the License at
714
+ *
715
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
716
+ *
717
+ * Unless required by applicable law or agreed to in writing, software
718
+ * distributed under the License is distributed on an "AS IS" basis,
719
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
720
+ * See the License for the specific language governing permissions and
721
+ * limitations under the License.
722
+ */
723
+ class DocumentModule {
724
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DocumentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
725
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.20", ngImport: i0, type: DocumentModule }); }
726
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DocumentModule }); }
727
+ }
728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: DocumentModule, decorators: [{
729
+ type: NgModule
730
+ }] });
731
+
732
+ /*
733
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
734
+ *
735
+ * Licensed under EUPL, Version 1.2 (the "License");
736
+ * you may not use this file except in compliance with the License.
737
+ * You may obtain a copy of the License at
738
+ *
739
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
740
+ *
741
+ * Unless required by applicable law or agreed to in writing, software
742
+ * distributed under the License is distributed on an "AS IS" basis,
743
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
744
+ * See the License for the specific language governing permissions and
745
+ * limitations under the License.
746
+ */
747
+ class InternalCaseStatusUtils {
748
+ static getTagTypeFromInternalCaseStatusColor(internalCaseStatusColor) {
749
+ switch (internalCaseStatusColor) {
750
+ case TagColor.HighContrast:
751
+ return 'high-contrast';
752
+ case TagColor.CoolGray:
753
+ return 'cool-gray';
754
+ case TagColor.WarmGray:
755
+ return 'warm-gray';
756
+ default:
757
+ return internalCaseStatusColor?.toLowerCase();
758
+ }
759
+ }
760
+ }
761
+
762
+ /*
763
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
764
+ *
765
+ * Licensed under EUPL, Version 1.2 (the "License");
766
+ * you may not use this file except in compliance with the License.
767
+ * You may obtain a copy of the License at
768
+ *
769
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
770
+ *
771
+ * Unless required by applicable law or agreed to in writing, software
772
+ * distributed under the License is distributed on an "AS IS" basis,
773
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
774
+ * See the License for the specific language governing permissions and
775
+ * limitations under the License.
776
+ */
777
+ class CaseTagsUtils {
778
+ static getTagTypeFromCaseTagColor(caseTagColor) {
779
+ switch (caseTagColor) {
780
+ case TagColor.HighContrast:
781
+ return 'high-contrast';
782
+ case TagColor.CoolGray:
783
+ return 'cool-gray';
784
+ case TagColor.WarmGray:
785
+ return 'warm-gray';
786
+ default:
787
+ return caseTagColor?.toLowerCase();
788
+ }
789
+ }
790
+ }
791
+
792
+ /*
793
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
794
+ *
795
+ * Licensed under EUPL, Version 1.2 (the "License");
796
+ * you may not use this file except in compliance with the License.
797
+ * You may obtain a copy of the License at
798
+ *
799
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
800
+ *
801
+ * Unless required by applicable law or agreed to in writing, software
802
+ * distributed under the License is distributed on an "AS IS" basis,
803
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
804
+ * See the License for the specific language governing permissions and
805
+ * limitations under the License.
806
+ */
807
+
808
+ /*
809
+ * Copyright 2015-2025 Ritense BV, the Netherlands.
810
+ *
811
+ * Licensed under EUPL, Version 1.2 (the "License");
812
+ * you may not use this file except in compliance with the License.
813
+ * You may obtain a copy of the License at
814
+ *
815
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
816
+ *
817
+ * Unless required by applicable law or agreed to in writing, software
818
+ * distributed under the License is distributed on an "AS IS" basis,
819
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
820
+ * See the License for the specific language governing permissions and
821
+ * limitations under the License.
822
+ */
823
+ /*
824
+ * Public API Surface of document
825
+ */
826
+
827
+ /**
828
+ * Generated bundle index. Do not edit.
829
+ */
830
+
831
+ export { AdvancedDocumentSearchRequestHttpBody, AdvancedDocumentSearchRequestImpl, CaseStatusService, CaseTagService, CaseTagsUtils, DocumentDefinitionCreateRequest, DocumentModule, DocumentSearchRequestHttpBody, DocumentSearchRequestImpl, DocumentService, FileSortService, InternalCaseStatusUtils, ModifyDocumentAndCompleteTaskRequestImpl, ModifyDocumentAndStartProcessRequestImpl, ModifyDocumentRequestImpl, NewDocumentAndStartProcessRequestImpl, NewDocumentRequestImpl };
832
+ //# sourceMappingURL=valtimo-document.mjs.map