@valtimo/document 4.15.2-next-main.15 → 4.15.3-next-main.16

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.
@@ -4,229 +4,229 @@
4
4
  (global = global || self, factory((global.valtimo = global.valtimo || {}, global.valtimo.document = {}), global.ng.core, global.ng.common.http, global.config));
5
5
  }(this, (function (exports, i0, i1, i2) { 'use strict';
6
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
- var DocumentService = /** @class */ (function () {
23
- function DocumentService(http, configService) {
24
- this.http = http;
25
- this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
26
- }
27
- // Document-calls
28
- DocumentService.prototype.getAllDefinitions = function () {
29
- return this.http.get(this.valtimoEndpointUri + "document-definition");
30
- };
31
- DocumentService.prototype.queryDefinitions = function (params) {
32
- return this.http.get(this.valtimoEndpointUri + "document-definition", { params: params });
33
- };
34
- DocumentService.prototype.getDocumentDefinition = function (documentDefinitionName) {
35
- return this.http.get(this.valtimoEndpointUri + "document-definition/" + documentDefinitionName);
36
- };
37
- DocumentService.prototype.getDocuments = function (documentSearchRequest) {
38
- return this.http.post(this.valtimoEndpointUri + "document-search", documentSearchRequest.asHttpBody(), { params: documentSearchRequest.asHttpParams() });
39
- };
40
- DocumentService.prototype.getDocument = function (documentId) {
41
- return this.http.get(this.valtimoEndpointUri + "document/" + documentId);
42
- };
43
- DocumentService.prototype.modifyDocument = function (document) {
44
- return this.http.put(this.valtimoEndpointUri + "document", document);
45
- };
46
- // ProcessDocument-calls
47
- DocumentService.prototype.getProcessDocumentDefinitions = function () {
48
- return this.http.get(this.valtimoEndpointUri + "process-document/definition");
49
- };
50
- DocumentService.prototype.findProcessDocumentDefinitions = function (documentDefinitionName) {
51
- return this.http.get(this.valtimoEndpointUri + "process-document/definition/document/" + documentDefinitionName);
52
- };
53
- DocumentService.prototype.findProcessDocumentInstances = function (documentId) {
54
- return this.http.get(this.valtimoEndpointUri + "process-document/instance/document/" + documentId);
55
- };
56
- DocumentService.prototype.newDocumentAndStartProcess = function (request) {
57
- return this.http.post(this.valtimoEndpointUri + "process-document/operation/new-document-and-start-process", request);
58
- };
59
- DocumentService.prototype.modifyDocumentAndCompleteTask = function (request) {
60
- return this.http.post(this.valtimoEndpointUri + "process-document/operation/modify-document-and-complete-task", request);
61
- };
62
- DocumentService.prototype.modifyDocumentAndStartProcess = function (request) {
63
- return this.http.post(this.valtimoEndpointUri + "process-document/operation/modify-document-and-start-process", request);
64
- };
65
- DocumentService.prototype.createProcessDocumentDefinition = function (request) {
66
- return this.http.post(this.valtimoEndpointUri + "process-document/definition", request);
67
- };
68
- DocumentService.prototype.createDocumentDefinition = function (documentDefinitionCreateRequest) {
69
- var options = {
70
- headers: new i1.HttpHeaders({
71
- 'Content-Type': 'application/json'
72
- })
73
- };
74
- return this.http.post(this.valtimoEndpointUri + "document-definition", documentDefinitionCreateRequest, options);
75
- };
76
- DocumentService.prototype.deleteProcessDocumentDefinition = function (request) {
77
- var options = {
78
- headers: new i1.HttpHeaders({
79
- 'Content-Type': 'application/json'
80
- }),
81
- body: request
82
- };
83
- return this.http.delete(this.valtimoEndpointUri + "process-document/definition", options);
84
- };
85
- DocumentService.prototype.getAuditLog = function (documentId, page) {
86
- if (page === void 0) { page = 0; }
87
- var params = new i1.HttpParams();
88
- params = params.set('page', page.toString());
89
- return this.http.get(this.valtimoEndpointUri + "process-document/instance/document/" + documentId + "/audit", { params: params });
90
- };
91
- DocumentService.prototype.assignResource = function (documentId, resourceId) {
92
- return this.http.post(this.valtimoEndpointUri + "document/" + documentId + "/resource/" + resourceId, {});
93
- };
94
- DocumentService.prototype.removeResource = function (documentId, resourceId) {
95
- var options = {
96
- headers: new i1.HttpHeaders({
97
- 'Content-Type': 'application/json'
98
- })
99
- };
100
- return this.http.delete(this.valtimoEndpointUri + "document/" + documentId + "/resource/" + resourceId, options);
101
- };
102
- DocumentService.prototype.removeDocumentDefinition = function (name) {
103
- return this.http.delete(this.valtimoEndpointUri + "document-definition/" + name);
104
- };
105
- DocumentService.prototype.sendMessage = function (documentId, request) {
106
- return this.http.post(this.valtimoEndpointUri + "document/" + documentId + "/message", request);
107
- };
108
- return DocumentService;
109
- }());
110
- DocumentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DocumentService_Factory() { return new DocumentService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: DocumentService, providedIn: "root" });
111
- DocumentService.decorators = [
112
- { type: i0.Injectable, args: [{
113
- providedIn: 'root'
114
- },] }
115
- ];
116
- DocumentService.ctorParameters = function () { return [
117
- { type: i1.HttpClient },
118
- { type: i2.ConfigService }
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
+ var DocumentService = /** @class */ (function () {
23
+ function DocumentService(http, configService) {
24
+ this.http = http;
25
+ this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;
26
+ }
27
+ // Document-calls
28
+ DocumentService.prototype.getAllDefinitions = function () {
29
+ return this.http.get(this.valtimoEndpointUri + "document-definition");
30
+ };
31
+ DocumentService.prototype.queryDefinitions = function (params) {
32
+ return this.http.get(this.valtimoEndpointUri + "document-definition", { params: params });
33
+ };
34
+ DocumentService.prototype.getDocumentDefinition = function (documentDefinitionName) {
35
+ return this.http.get(this.valtimoEndpointUri + "document-definition/" + documentDefinitionName);
36
+ };
37
+ DocumentService.prototype.getDocuments = function (documentSearchRequest) {
38
+ return this.http.post(this.valtimoEndpointUri + "document-search", documentSearchRequest.asHttpBody(), { params: documentSearchRequest.asHttpParams() });
39
+ };
40
+ DocumentService.prototype.getDocument = function (documentId) {
41
+ return this.http.get(this.valtimoEndpointUri + "document/" + documentId);
42
+ };
43
+ DocumentService.prototype.modifyDocument = function (document) {
44
+ return this.http.put(this.valtimoEndpointUri + "document", document);
45
+ };
46
+ // ProcessDocument-calls
47
+ DocumentService.prototype.getProcessDocumentDefinitions = function () {
48
+ return this.http.get(this.valtimoEndpointUri + "process-document/definition");
49
+ };
50
+ DocumentService.prototype.findProcessDocumentDefinitions = function (documentDefinitionName) {
51
+ return this.http.get(this.valtimoEndpointUri + "process-document/definition/document/" + documentDefinitionName);
52
+ };
53
+ DocumentService.prototype.findProcessDocumentInstances = function (documentId) {
54
+ return this.http.get(this.valtimoEndpointUri + "process-document/instance/document/" + documentId);
55
+ };
56
+ DocumentService.prototype.newDocumentAndStartProcess = function (request) {
57
+ return this.http.post(this.valtimoEndpointUri + "process-document/operation/new-document-and-start-process", request);
58
+ };
59
+ DocumentService.prototype.modifyDocumentAndCompleteTask = function (request) {
60
+ return this.http.post(this.valtimoEndpointUri + "process-document/operation/modify-document-and-complete-task", request);
61
+ };
62
+ DocumentService.prototype.modifyDocumentAndStartProcess = function (request) {
63
+ return this.http.post(this.valtimoEndpointUri + "process-document/operation/modify-document-and-start-process", request);
64
+ };
65
+ DocumentService.prototype.createProcessDocumentDefinition = function (request) {
66
+ return this.http.post(this.valtimoEndpointUri + "process-document/definition", request);
67
+ };
68
+ DocumentService.prototype.createDocumentDefinition = function (documentDefinitionCreateRequest) {
69
+ var options = {
70
+ headers: new i1.HttpHeaders({
71
+ 'Content-Type': 'application/json',
72
+ }),
73
+ };
74
+ return this.http.post(this.valtimoEndpointUri + "document-definition", documentDefinitionCreateRequest, options);
75
+ };
76
+ DocumentService.prototype.deleteProcessDocumentDefinition = function (request) {
77
+ var options = {
78
+ headers: new i1.HttpHeaders({
79
+ 'Content-Type': 'application/json',
80
+ }),
81
+ body: request,
82
+ };
83
+ return this.http.delete(this.valtimoEndpointUri + "process-document/definition", options);
84
+ };
85
+ DocumentService.prototype.getAuditLog = function (documentId, page) {
86
+ if (page === void 0) { page = 0; }
87
+ var params = new i1.HttpParams();
88
+ params = params.set('page', page.toString());
89
+ return this.http.get(this.valtimoEndpointUri + "process-document/instance/document/" + documentId + "/audit", { params: params });
90
+ };
91
+ DocumentService.prototype.assignResource = function (documentId, resourceId) {
92
+ return this.http.post(this.valtimoEndpointUri + "document/" + documentId + "/resource/" + resourceId, {});
93
+ };
94
+ DocumentService.prototype.removeResource = function (documentId, resourceId) {
95
+ var options = {
96
+ headers: new i1.HttpHeaders({
97
+ 'Content-Type': 'application/json',
98
+ }),
99
+ };
100
+ return this.http.delete(this.valtimoEndpointUri + "document/" + documentId + "/resource/" + resourceId, options);
101
+ };
102
+ DocumentService.prototype.removeDocumentDefinition = function (name) {
103
+ return this.http.delete(this.valtimoEndpointUri + "document-definition/" + name);
104
+ };
105
+ DocumentService.prototype.sendMessage = function (documentId, request) {
106
+ return this.http.post(this.valtimoEndpointUri + "document/" + documentId + "/message", request);
107
+ };
108
+ return DocumentService;
109
+ }());
110
+ DocumentService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DocumentService_Factory() { return new DocumentService(i0.ɵɵinject(i1.HttpClient), i0.ɵɵinject(i2.ConfigService)); }, token: DocumentService, providedIn: "root" });
111
+ DocumentService.decorators = [
112
+ { type: i0.Injectable, args: [{
113
+ providedIn: 'root',
114
+ },] }
115
+ ];
116
+ DocumentService.ctorParameters = function () { return [
117
+ { type: i1.HttpClient },
118
+ { type: i2.ConfigService }
119
119
  ]; };
120
120
 
121
- /*
122
- * Copyright 2015-2020 Ritense BV, the Netherlands.
123
- *
124
- * Licensed under EUPL, Version 1.2 (the "License");
125
- * you may not use this file except in compliance with the License.
126
- * You may obtain a copy of the License at
127
- *
128
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
129
- *
130
- * Unless required by applicable law or agreed to in writing, software
131
- * distributed under the License is distributed on an "AS IS" basis,
132
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133
- * See the License for the specific language governing permissions and
134
- * limitations under the License.
135
- */
136
- var DocumentModule = /** @class */ (function () {
137
- function DocumentModule() {
138
- }
139
- return DocumentModule;
140
- }());
141
- DocumentModule.decorators = [
142
- { type: i0.NgModule }
121
+ /*
122
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
123
+ *
124
+ * Licensed under EUPL, Version 1.2 (the "License");
125
+ * you may not use this file except in compliance with the License.
126
+ * You may obtain a copy of the License at
127
+ *
128
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
129
+ *
130
+ * Unless required by applicable law or agreed to in writing, software
131
+ * distributed under the License is distributed on an "AS IS" basis,
132
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
133
+ * See the License for the specific language governing permissions and
134
+ * limitations under the License.
135
+ */
136
+ var DocumentModule = /** @class */ (function () {
137
+ function DocumentModule() {
138
+ }
139
+ return DocumentModule;
140
+ }());
141
+ DocumentModule.decorators = [
142
+ { type: i0.NgModule }
143
143
  ];
144
144
 
145
- /*
146
- * Copyright 2015-2020 Ritense BV, the Netherlands.
147
- *
148
- * Licensed under EUPL, Version 1.2 (the "License");
149
- * you may not use this file except in compliance with the License.
150
- * You may obtain a copy of the License at
151
- *
152
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
153
- *
154
- * Unless required by applicable law or agreed to in writing, software
155
- * distributed under the License is distributed on an "AS IS" basis,
156
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
157
- * See the License for the specific language governing permissions and
158
- * limitations under the License.
159
- */
160
- var DocumentSearchRequestHttpBody = /** @class */ (function () {
161
- function DocumentSearchRequestHttpBody() {
162
- }
163
- return DocumentSearchRequestHttpBody;
164
- }());
165
- var DocumentSearchRequestImpl = /** @class */ (function () {
166
- function DocumentSearchRequestImpl(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
- DocumentSearchRequestImpl.prototype.asHttpBody = function () {
177
- var 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
- DocumentSearchRequestImpl.prototype.asHttpParams = function () {
194
- var params = new i1.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
- DocumentSearchRequestImpl.prototype.setPage = function (page) {
204
- this.page = page;
205
- };
206
- DocumentSearchRequestImpl.prototype.getSortString = function (sort) {
207
- return sort.state.name + "," + sort.state.direction;
208
- };
209
- return DocumentSearchRequestImpl;
145
+ /*
146
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
147
+ *
148
+ * Licensed under EUPL, Version 1.2 (the "License");
149
+ * you may not use this file except in compliance with the License.
150
+ * You may obtain a copy of the License at
151
+ *
152
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
153
+ *
154
+ * Unless required by applicable law or agreed to in writing, software
155
+ * distributed under the License is distributed on an "AS IS" basis,
156
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
157
+ * See the License for the specific language governing permissions and
158
+ * limitations under the License.
159
+ */
160
+ var DocumentSearchRequestHttpBody = /** @class */ (function () {
161
+ function DocumentSearchRequestHttpBody() {
162
+ }
163
+ return DocumentSearchRequestHttpBody;
164
+ }());
165
+ var DocumentSearchRequestImpl = /** @class */ (function () {
166
+ function DocumentSearchRequestImpl(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
+ DocumentSearchRequestImpl.prototype.asHttpBody = function () {
177
+ var 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
+ DocumentSearchRequestImpl.prototype.asHttpParams = function () {
194
+ var params = new i1.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
+ DocumentSearchRequestImpl.prototype.setPage = function (page) {
204
+ this.page = page;
205
+ };
206
+ DocumentSearchRequestImpl.prototype.getSortString = function (sort) {
207
+ return sort.state.name + "," + sort.state.direction;
208
+ };
209
+ return DocumentSearchRequestImpl;
210
210
  }());
211
211
 
212
- /*
213
- * Copyright 2015-2020 Ritense BV, the Netherlands.
214
- *
215
- * Licensed under EUPL, Version 1.2 (the "License");
216
- * you may not use this file except in compliance with the License.
217
- * You may obtain a copy of the License at
218
- *
219
- * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
220
- *
221
- * Unless required by applicable law or agreed to in writing, software
222
- * distributed under the License is distributed on an "AS IS" basis,
223
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
- * See the License for the specific language governing permissions and
225
- * limitations under the License.
212
+ /*
213
+ * Copyright 2015-2020 Ritense BV, the Netherlands.
214
+ *
215
+ * Licensed under EUPL, Version 1.2 (the "License");
216
+ * you may not use this file except in compliance with the License.
217
+ * You may obtain a copy of the License at
218
+ *
219
+ * https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12
220
+ *
221
+ * Unless required by applicable law or agreed to in writing, software
222
+ * distributed under the License is distributed on an "AS IS" basis,
223
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
+ * See the License for the specific language governing permissions and
225
+ * limitations under the License.
226
226
  */
227
227
 
228
- /**
229
- * Generated bundle index. Do not edit.
228
+ /**
229
+ * Generated bundle index. Do not edit.
230
230
  */
231
231
 
232
232
  exports.DocumentModule = DocumentModule;
@@ -1 +1 @@
1
- {"version":3,"file":"valtimo-document.umd.js","sources":["../../../../projects/valtimo/document/src/lib/document.service.ts","../../../../projects/valtimo/document/src/lib/document.module.ts","../../../../projects/valtimo/document/src/lib/document-search-request.ts","../../../../projects/valtimo/document/src/public_api.ts","../../../../projects/valtimo/document/src/valtimo-document.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 {Injectable} from '@angular/core';\nimport {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {\n AuditRecord,\n Document,\n DocumentDefinition,\n DocumentDefinitions,\n DocumentResult,\n Documents,\n ModifyDocumentAndCompleteTaskRequestImpl,\n ModifyDocumentAndCompleteTaskResult,\n ModifyDocumentAndStartProcessRequestImpl,\n ModifyDocumentAndStartProcessResult,\n NewDocumentAndStartProcessRequestImpl,\n NewDocumentAndStartProcessResult,\n Page,\n ProcessDocumentDefinition,\n ProcessDocumentDefinitionRequest,\n ProcessDocumentInstance,\n DocumentDefinitionCreateRequest,\n UndeployDocumentDefinitionResult,\n DocumentSendMessageRequest\n} from '@valtimo/contract';\nimport {DocumentSearchRequest} from './document-search-request';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DocumentService {\n private valtimoEndpointUri: string;\n\n constructor(private http: HttpClient, configService: ConfigService) {\n this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;\n }\n\n // Document-calls\n public getAllDefinitions(): Observable<DocumentDefinitions> {\n return this.http.get<DocumentDefinitions>(`${this.valtimoEndpointUri}document-definition`);\n }\n\n queryDefinitions(params?: any): Observable<Page<DocumentDefinition>> {\n return this.http.get<Page<DocumentDefinition>>(`${this.valtimoEndpointUri}document-definition`, {params: params});\n }\n\n getDocumentDefinition(documentDefinitionName: string): Observable<DocumentDefinition> {\n return this.http.get<DocumentDefinition>(`${this.valtimoEndpointUri}document-definition/${documentDefinitionName}`);\n }\n\n getDocuments(documentSearchRequest: DocumentSearchRequest): Observable<Documents> {\n return this.http.post<Documents>(`${this.valtimoEndpointUri}document-search`,\n documentSearchRequest.asHttpBody(), {params: documentSearchRequest.asHttpParams()});\n }\n\n getDocument(documentId: string): Observable<Document> {\n return this.http.get<Document>(`${this.valtimoEndpointUri}document/${documentId}`);\n }\n\n modifyDocument(document: any): Observable<DocumentResult> {\n return this.http.put<DocumentResult>(`${this.valtimoEndpointUri}document`, document);\n }\n\n // ProcessDocument-calls\n getProcessDocumentDefinitions(): Observable<ProcessDocumentDefinition> {\n return this.http.get<ProcessDocumentDefinition>(`${this.valtimoEndpointUri}process-document/definition`);\n }\n\n findProcessDocumentDefinitions(documentDefinitionName: string): Observable<ProcessDocumentDefinition[]> {\n return this.http.get<ProcessDocumentDefinition[]>(\n `${this.valtimoEndpointUri}process-document/definition/document/${documentDefinitionName}`\n );\n }\n\n findProcessDocumentInstances(documentId: string): Observable<ProcessDocumentInstance[]> {\n return this.http.get<ProcessDocumentInstance[]>(`${this.valtimoEndpointUri}process-document/instance/document/${documentId}`);\n }\n\n newDocumentAndStartProcess(request: NewDocumentAndStartProcessRequestImpl): Observable<NewDocumentAndStartProcessResult> {\n return this.http.post<NewDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/new-document-and-start-process`,\n request\n );\n }\n\n modifyDocumentAndCompleteTask(request: ModifyDocumentAndCompleteTaskRequestImpl): Observable<ModifyDocumentAndCompleteTaskResult> {\n return this.http.post<ModifyDocumentAndCompleteTaskResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-complete-task`,\n request\n );\n }\n\n modifyDocumentAndStartProcess(request: ModifyDocumentAndStartProcessRequestImpl): Observable<ModifyDocumentAndStartProcessResult> {\n return this.http.post<ModifyDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-start-process`,\n request\n );\n }\n\n createProcessDocumentDefinition(request: ProcessDocumentDefinitionRequest): Observable<ProcessDocumentDefinition> {\n return this.http.post<ProcessDocumentDefinition>(`${this.valtimoEndpointUri}process-document/definition`, request);\n }\n\n createDocumentDefinition(documentDefinitionCreateRequest: DocumentDefinitionCreateRequest): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n })\n };\n return this.http.post<void>(`${this.valtimoEndpointUri}document-definition`, documentDefinitionCreateRequest, options);\n }\n\n deleteProcessDocumentDefinition(request: ProcessDocumentDefinitionRequest): Observable<any> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n body: request\n };\n return this.http.delete(`${this.valtimoEndpointUri}process-document/definition`, options);\n }\n\n getAuditLog(documentId: string, page: number = 0): Observable<Page<AuditRecord>> {\n let params = new HttpParams();\n params = params.set('page', page.toString());\n return this.http.get<Page<AuditRecord>>(`${this.valtimoEndpointUri}process-document/instance/document/${documentId}/audit`,\n {params}\n );\n }\n\n assignResource(documentId: string, resourceId: string): Observable<void> {\n return this.http.post<void>(`${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`, {});\n }\n\n removeResource(documentId: string, resourceId: string): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n })\n };\n return this.http.delete<void>(`${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`, options);\n }\n\n removeDocumentDefinition(name: string): Observable<UndeployDocumentDefinitionResult> {\n return this.http.delete<UndeployDocumentDefinitionResult>(`${this.valtimoEndpointUri}document-definition/${name}`);\n }\n\n sendMessage(documentId: string, request: DocumentSendMessageRequest): Observable<any> {\n return this.http.post(`${this.valtimoEndpointUri}document/${documentId}/message`, request);\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';\n\n@NgModule()\nexport class DocumentModule {\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 {HttpParams} from '@angular/common/http';\nimport {SortState} from '@valtimo/contract';\n\nexport interface DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n searchCriteria?: Array<{path: string; value: string}>;\n\n asHttpBody(): DocumentSearchRequestHttpBody;\n asHttpParams(): HttpParams;\n setPage(page: number): void;\n getSortString(sort: SortState): string;\n}\n\nexport class DocumentSearchRequestHttpBody {\n documentDefinitionName?: string;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n otherFilters?: Array<{path: string; value: string}>;\n}\n\nexport class DocumentSearchRequestImpl implements DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n otherFilters?: Array<{path: string; value: string}>;\n\n constructor(\n definitionName: string,\n page: number,\n size: number,\n sequence?: number,\n createdBy?: string,\n globalSearchFilter?: string,\n sort?: SortState,\n otherFilters?: Array<{path: string; value: string}>\n ) {\n this.definitionName = definitionName;\n this.page = page;\n this.size = size;\n this.sequence = sequence;\n this.createdBy = createdBy;\n this.globalSearchFilter = globalSearchFilter;\n this.sort = sort;\n this.otherFilters = otherFilters;\n }\n\n asHttpBody(): DocumentSearchRequestHttpBody {\n const httpBody = new DocumentSearchRequestHttpBody();\n\n httpBody.documentDefinitionName = this.definitionName;\n\n if (this.sequence) {\n httpBody.sequence = this.sequence;\n }\n if (this.createdBy) {\n httpBody.createdBy = this.createdBy;\n }\n if (this.globalSearchFilter) {\n httpBody.globalSearchFilter = this.globalSearchFilter;\n }\n if (this.otherFilters) {\n httpBody.otherFilters = this.otherFilters;\n }\n\n return httpBody;\n }\n\n asHttpParams(): HttpParams {\n let params = new HttpParams()\n .set('definitionName', this.definitionName)\n .set('page', this.page.toString())\n .set('size', this.size.toString());\n if (this.sort) {\n params = params.set('sort', this.getSortString(this.sort));\n }\n return params;\n }\n\n setPage(page: number): void {\n this.page = page;\n }\n\n getSortString(sort: SortState): string {\n return `${sort.state.name},${sort.state.direction}`;\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/*\n * Public API Surface of document\n */\nexport * from './lib/document.service';\nexport * from './lib/document.module';\nexport * from './lib/document-search-request';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["HttpHeaders","HttpParams","Injectable","HttpClient","ConfigService","NgModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;;;QAiDE,yBAAoB,IAAgB,EAAE,aAA4B;YAA9C,SAAI,GAAJ,IAAI,CAAY;YAClC,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;SACvE;;QAGM,2CAAiB,GAAjB;YACL,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,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I,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YACrC,IAAI,IAAI,CAAC,IAAI,EAAE;gBACb,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;aAC5D;YACD,OAAO,MAAM,CAAC;SACf;QAED,2CAAO,GAAP,UAAQ,IAAY;YAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;SAClB;QAED,iDAAa,GAAb,UAAc,IAAe;YAC3B,OAAU,IAAI,CAAC,KAAK,CAAC,IAAI,SAAI,IAAI,CAAC,KAAK,CAAC,SAAW,CAAC;SACrD;wCACF;KAAA;;IChHD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"valtimo-document.umd.js","sources":["../../../../projects/valtimo/document/src/lib/document.service.ts","../../../../projects/valtimo/document/src/lib/document.module.ts","../../../../projects/valtimo/document/src/lib/document-search-request.ts","../../../../projects/valtimo/document/src/public_api.ts","../../../../projects/valtimo/document/src/valtimo-document.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 {Injectable} from '@angular/core';\nimport {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {\n AuditRecord,\n Document,\n DocumentDefinition,\n DocumentDefinitions,\n DocumentResult,\n Documents,\n ModifyDocumentAndCompleteTaskRequestImpl,\n ModifyDocumentAndCompleteTaskResult,\n ModifyDocumentAndStartProcessRequestImpl,\n ModifyDocumentAndStartProcessResult,\n NewDocumentAndStartProcessRequestImpl,\n NewDocumentAndStartProcessResult,\n Page,\n ProcessDocumentDefinition,\n ProcessDocumentDefinitionRequest,\n ProcessDocumentInstance,\n DocumentDefinitionCreateRequest,\n UndeployDocumentDefinitionResult,\n DocumentSendMessageRequest,\n} from '@valtimo/contract';\nimport {DocumentSearchRequest} from './document-search-request';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DocumentService {\n private valtimoEndpointUri: string;\n\n constructor(private http: HttpClient, configService: ConfigService) {\n this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;\n }\n\n // Document-calls\n public getAllDefinitions(): Observable<DocumentDefinitions> {\n return this.http.get<DocumentDefinitions>(`${this.valtimoEndpointUri}document-definition`);\n }\n\n queryDefinitions(params?: any): Observable<Page<DocumentDefinition>> {\n return this.http.get<Page<DocumentDefinition>>(\n `${this.valtimoEndpointUri}document-definition`,\n {params: params}\n );\n }\n\n getDocumentDefinition(documentDefinitionName: string): Observable<DocumentDefinition> {\n return this.http.get<DocumentDefinition>(\n `${this.valtimoEndpointUri}document-definition/${documentDefinitionName}`\n );\n }\n\n getDocuments(documentSearchRequest: DocumentSearchRequest): Observable<Documents> {\n return this.http.post<Documents>(\n `${this.valtimoEndpointUri}document-search`,\n documentSearchRequest.asHttpBody(),\n {params: documentSearchRequest.asHttpParams()}\n );\n }\n\n getDocument(documentId: string): Observable<Document> {\n return this.http.get<Document>(`${this.valtimoEndpointUri}document/${documentId}`);\n }\n\n modifyDocument(document: any): Observable<DocumentResult> {\n return this.http.put<DocumentResult>(`${this.valtimoEndpointUri}document`, document);\n }\n\n // ProcessDocument-calls\n getProcessDocumentDefinitions(): Observable<ProcessDocumentDefinition> {\n return this.http.get<ProcessDocumentDefinition>(\n `${this.valtimoEndpointUri}process-document/definition`\n );\n }\n\n findProcessDocumentDefinitions(\n documentDefinitionName: string\n ): Observable<ProcessDocumentDefinition[]> {\n return this.http.get<ProcessDocumentDefinition[]>(\n `${this.valtimoEndpointUri}process-document/definition/document/${documentDefinitionName}`\n );\n }\n\n findProcessDocumentInstances(documentId: string): Observable<ProcessDocumentInstance[]> {\n return this.http.get<ProcessDocumentInstance[]>(\n `${this.valtimoEndpointUri}process-document/instance/document/${documentId}`\n );\n }\n\n newDocumentAndStartProcess(\n request: NewDocumentAndStartProcessRequestImpl\n ): Observable<NewDocumentAndStartProcessResult> {\n return this.http.post<NewDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/new-document-and-start-process`,\n request\n );\n }\n\n modifyDocumentAndCompleteTask(\n request: ModifyDocumentAndCompleteTaskRequestImpl\n ): Observable<ModifyDocumentAndCompleteTaskResult> {\n return this.http.post<ModifyDocumentAndCompleteTaskResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-complete-task`,\n request\n );\n }\n\n modifyDocumentAndStartProcess(\n request: ModifyDocumentAndStartProcessRequestImpl\n ): Observable<ModifyDocumentAndStartProcessResult> {\n return this.http.post<ModifyDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-start-process`,\n request\n );\n }\n\n createProcessDocumentDefinition(\n request: ProcessDocumentDefinitionRequest\n ): Observable<ProcessDocumentDefinition> {\n return this.http.post<ProcessDocumentDefinition>(\n `${this.valtimoEndpointUri}process-document/definition`,\n request\n );\n }\n\n createDocumentDefinition(\n documentDefinitionCreateRequest: DocumentDefinitionCreateRequest\n ): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json',\n }),\n };\n return this.http.post<void>(\n `${this.valtimoEndpointUri}document-definition`,\n documentDefinitionCreateRequest,\n options\n );\n }\n\n deleteProcessDocumentDefinition(request: ProcessDocumentDefinitionRequest): Observable<any> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json',\n }),\n body: request,\n };\n return this.http.delete(`${this.valtimoEndpointUri}process-document/definition`, options);\n }\n\n getAuditLog(documentId: string, page: number = 0): Observable<Page<AuditRecord>> {\n let params = new HttpParams();\n params = params.set('page', page.toString());\n return this.http.get<Page<AuditRecord>>(\n `${this.valtimoEndpointUri}process-document/instance/document/${documentId}/audit`,\n {params}\n );\n }\n\n assignResource(documentId: string, resourceId: string): Observable<void> {\n return this.http.post<void>(\n `${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`,\n {}\n );\n }\n\n removeResource(documentId: string, resourceId: string): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json',\n }),\n };\n return this.http.delete<void>(\n `${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`,\n options\n );\n }\n\n removeDocumentDefinition(name: string): Observable<UndeployDocumentDefinitionResult> {\n return this.http.delete<UndeployDocumentDefinitionResult>(\n `${this.valtimoEndpointUri}document-definition/${name}`\n );\n }\n\n sendMessage(documentId: string, request: DocumentSendMessageRequest): Observable<any> {\n return this.http.post(`${this.valtimoEndpointUri}document/${documentId}/message`, request);\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';\n\n@NgModule()\nexport class DocumentModule {}\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 {HttpParams} from '@angular/common/http';\nimport {SortState} from '@valtimo/contract';\n\nexport interface DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n searchCriteria?: Array<{path: string; value: string}>;\n\n asHttpBody(): DocumentSearchRequestHttpBody;\n asHttpParams(): HttpParams;\n setPage(page: number): void;\n getSortString(sort: SortState): string;\n}\n\nexport class DocumentSearchRequestHttpBody {\n documentDefinitionName?: string;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n otherFilters?: Array<{path: string; value: string}>;\n}\n\nexport class DocumentSearchRequestImpl implements DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n otherFilters?: Array<{path: string; value: string}>;\n\n constructor(\n definitionName: string,\n page: number,\n size: number,\n sequence?: number,\n createdBy?: string,\n globalSearchFilter?: string,\n sort?: SortState,\n otherFilters?: Array<{path: string; value: string}>\n ) {\n this.definitionName = definitionName;\n this.page = page;\n this.size = size;\n this.sequence = sequence;\n this.createdBy = createdBy;\n this.globalSearchFilter = globalSearchFilter;\n this.sort = sort;\n this.otherFilters = otherFilters;\n }\n\n asHttpBody(): DocumentSearchRequestHttpBody {\n const httpBody = new DocumentSearchRequestHttpBody();\n\n httpBody.documentDefinitionName = this.definitionName;\n\n if (this.sequence) {\n httpBody.sequence = this.sequence;\n }\n if (this.createdBy) {\n httpBody.createdBy = this.createdBy;\n }\n if (this.globalSearchFilter) {\n httpBody.globalSearchFilter = this.globalSearchFilter;\n }\n if (this.otherFilters) {\n httpBody.otherFilters = this.otherFilters;\n }\n\n return httpBody;\n }\n\n asHttpParams(): HttpParams {\n let params = new HttpParams()\n .set('definitionName', this.definitionName)\n .set('page', this.page.toString())\n .set('size', this.size.toString());\n if (this.sort) {\n params = params.set('sort', this.getSortString(this.sort));\n }\n return params;\n }\n\n setPage(page: number): void {\n this.page = page;\n }\n\n getSortString(sort: SortState): string {\n return `${sort.state.name},${sort.state.direction}`;\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/*\n * Public API Surface of document\n */\nexport * from './lib/document.service';\nexport * from './lib/document.module';\nexport * from './lib/document-search-request';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["HttpHeaders","HttpParams","Injectable","HttpClient","ConfigService","NgModule"],"mappings":";;;;;;IAAA;;;;;;;;;;;;;;;;QAiDE,yBAAoB,IAAgB,EAAE,aAA4B;YAA9C,SAAI,GAAJ,IAAI,CAAY;YAClC,IAAI,CAAC,kBAAkB,GAAG,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC;SACvE;;QAGM,2CAAiB,GAAjB;YACL,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAyB,IAAI,CAAC,kBAAkB,wBAAqB,CAAC,CAAC;SAC5F;QAED,0CAAgB,GAAhB,UAAiB,MAAY;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CACf,IAAI,CAAC,kBAAkB,wBAAqB,EAC/C,EAAC,MAAM,EAAE,MAAM,EAAC,CACjB,CAAC;SACH;QAED,+CAAqB,GAArB,UAAsB,sBAA8B;YAClD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CACf,IAAI,CAAC,kBAAkB,4BAAuB,sBAAwB,CAC1E,CAAC;SACH;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,IAAI,CAAC,KAAK,CAAC,SAAW,CAAC;SACrD;wCACF;KAAA;;IChHD;;;;;;;;;;;;;;;;ICAA;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../projects/valtimo/document/src/lib/document.service.ts","../../../../projects/valtimo/document/src/lib/document.module.ts","../../../../projects/valtimo/document/src/lib/document-search-request.ts"],"names":["DocumentService","http","configService","this","valtimoEndpointUri","config","valtimoApi","endpointUri","prototype","getAllDefinitions","get","queryDefinitions","params","getDocumentDefinition","documentDefinitionName","getDocuments","documentSearchRequest","post","asHttpBody","asHttpParams","getDocument","documentId","modifyDocument","document","put","getProcessDocumentDefinitions","findProcessDocumentDefinitions","findProcessDocumentInstances","newDocumentAndStartProcess","request","modifyDocumentAndCompleteTask","modifyDocumentAndStartProcess","createProcessDocumentDefinition","createDocumentDefinition","documentDefinitionCreateRequest","options","headers","HttpHeaders","Content-Type","deleteProcessDocumentDefinition","body","delete","getAuditLog","page","HttpParams","set","toString","assignResource","resourceId","removeResource","removeDocumentDefinition","name","sendMessage","Injectable","args","providedIn","HttpClient","ConfigService","NgModule","DocumentSearchRequestImpl","definitionName","size","sequence","createdBy","globalSearchFilter","sort","otherFilters","httpBody","DocumentSearchRequestHttpBody","getSortString","setPage","state","direction"],"mappings":"ocAiDE,SAAAA,EAAoBC,EAAkBC,GAAlBC,KAAAF,KAAAA,EAClBE,KAAKC,mBAAqBF,EAAcG,OAAOC,WAAWC,mBAIrDP,EAAAQ,UAAAC,kBAAA,WACL,OAAON,KAAKF,KAAKS,IAA4BP,KAAKC,mBAAkB,wBAGtEJ,EAAAQ,UAAAG,iBAAA,SAAiBC,GACf,OAAOT,KAAKF,KAAKS,IAAiCP,KAAKC,mBAAkB,sBAAuB,CAACQ,OAAQA,KAG3GZ,EAAAQ,UAAAK,sBAAA,SAAsBC,GACpB,OAAOX,KAAKF,KAAKS,IAA2BP,KAAKC,mBAAkB,uBAAuBU,IAG5Fd,EAAAQ,UAAAO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0D,KAAOA,EACZ1D,KAAK2D,SAAWA,EAChB3D,KAAK4D,UAAYA,EACjB5D,KAAK6D,mBAAqBA,EAC1B7D,KAAK8D,KAAOA,EACZ9D,KAAK+D,aAAeA,SAGtBP,EAAAnD,UAAAU,WAAA,WACE,IAAMiD,EAAW,IAAIC,EAiBrB,OAfAD,EAASrD,uBAAyBX,KAAKyD,eAEnCzD,KAAK2D,WACPK,EAASL,SAAW3D,KAAK2D,UAEvB3D,KAAK4D,YACPI,EAASJ,UAAY5D,KAAK4D,WAExB5D,KAAK6D,qBACPG,EAASH,mBAAqB7D,KAAK6D,oBAEjC7D,KAAK+D,eACPC,EAASD,aAAe/D,KAAK+D,cAGxBC,GAGTR,EAAAnD,UAAAW,aAAA,WACE,IAAIP,GAAS,IAAIgC,EAAAA,YACdC,IAAI,iBAAkB1C,KAAKyD,gBAC3Bf,IAAI,OAAQ1C,KAAKwC,KAAKG,YACtBD,IAAI,OAAQ1C,KAAK0D,KAAKf,YAIzB,OAHI3C,KAAK8D,OACPrD,EAASA,EAAOiC,IAAI,OAAQ1C,KAAKkE,cAAclE,KAAK8D,QAE/CrD,GAGT+C,EAAAnD,UAAA8D,QAAA,SAAQ3B,GACNxC,KAAKwC,KAAOA,GAGdgB,EAAAnD,UAAA6D,cAAA,SAAcJ,GACZ,OAAUA,EAAKM,MAAMpB,KAAI,IAAIc,EAAKM,MAAMC","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 {Injectable} from '@angular/core';\nimport {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {\n AuditRecord,\n Document,\n DocumentDefinition,\n DocumentDefinitions,\n DocumentResult,\n Documents,\n ModifyDocumentAndCompleteTaskRequestImpl,\n ModifyDocumentAndCompleteTaskResult,\n ModifyDocumentAndStartProcessRequestImpl,\n ModifyDocumentAndStartProcessResult,\n NewDocumentAndStartProcessRequestImpl,\n NewDocumentAndStartProcessResult,\n Page,\n ProcessDocumentDefinition,\n ProcessDocumentDefinitionRequest,\n ProcessDocumentInstance,\n DocumentDefinitionCreateRequest,\n UndeployDocumentDefinitionResult,\n DocumentSendMessageRequest\n} from '@valtimo/contract';\nimport {DocumentSearchRequest} from './document-search-request';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DocumentService {\n private valtimoEndpointUri: string;\n\n constructor(private http: HttpClient, configService: ConfigService) {\n this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;\n }\n\n // Document-calls\n public getAllDefinitions(): Observable<DocumentDefinitions> {\n return this.http.get<DocumentDefinitions>(`${this.valtimoEndpointUri}document-definition`);\n }\n\n queryDefinitions(params?: any): Observable<Page<DocumentDefinition>> {\n return this.http.get<Page<DocumentDefinition>>(`${this.valtimoEndpointUri}document-definition`, {params: params});\n }\n\n getDocumentDefinition(documentDefinitionName: string): Observable<DocumentDefinition> {\n return this.http.get<DocumentDefinition>(`${this.valtimoEndpointUri}document-definition/${documentDefinitionName}`);\n }\n\n getDocuments(documentSearchRequest: DocumentSearchRequest): Observable<Documents> {\n return this.http.post<Documents>(`${this.valtimoEndpointUri}document-search`,\n documentSearchRequest.asHttpBody(), {params: documentSearchRequest.asHttpParams()});\n }\n\n getDocument(documentId: string): Observable<Document> {\n return this.http.get<Document>(`${this.valtimoEndpointUri}document/${documentId}`);\n }\n\n modifyDocument(document: any): Observable<DocumentResult> {\n return this.http.put<DocumentResult>(`${this.valtimoEndpointUri}document`, document);\n }\n\n // ProcessDocument-calls\n getProcessDocumentDefinitions(): Observable<ProcessDocumentDefinition> {\n return this.http.get<ProcessDocumentDefinition>(`${this.valtimoEndpointUri}process-document/definition`);\n }\n\n findProcessDocumentDefinitions(documentDefinitionName: string): Observable<ProcessDocumentDefinition[]> {\n return this.http.get<ProcessDocumentDefinition[]>(\n `${this.valtimoEndpointUri}process-document/definition/document/${documentDefinitionName}`\n );\n }\n\n findProcessDocumentInstances(documentId: string): Observable<ProcessDocumentInstance[]> {\n return this.http.get<ProcessDocumentInstance[]>(`${this.valtimoEndpointUri}process-document/instance/document/${documentId}`);\n }\n\n newDocumentAndStartProcess(request: NewDocumentAndStartProcessRequestImpl): Observable<NewDocumentAndStartProcessResult> {\n return this.http.post<NewDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/new-document-and-start-process`,\n request\n );\n }\n\n modifyDocumentAndCompleteTask(request: ModifyDocumentAndCompleteTaskRequestImpl): Observable<ModifyDocumentAndCompleteTaskResult> {\n return this.http.post<ModifyDocumentAndCompleteTaskResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-complete-task`,\n request\n );\n }\n\n modifyDocumentAndStartProcess(request: ModifyDocumentAndStartProcessRequestImpl): Observable<ModifyDocumentAndStartProcessResult> {\n return this.http.post<ModifyDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-start-process`,\n request\n );\n }\n\n createProcessDocumentDefinition(request: ProcessDocumentDefinitionRequest): Observable<ProcessDocumentDefinition> {\n return this.http.post<ProcessDocumentDefinition>(`${this.valtimoEndpointUri}process-document/definition`, request);\n }\n\n createDocumentDefinition(documentDefinitionCreateRequest: DocumentDefinitionCreateRequest): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n })\n };\n return this.http.post<void>(`${this.valtimoEndpointUri}document-definition`, documentDefinitionCreateRequest, options);\n }\n\n deleteProcessDocumentDefinition(request: ProcessDocumentDefinitionRequest): Observable<any> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n }),\n body: request\n };\n return this.http.delete(`${this.valtimoEndpointUri}process-document/definition`, options);\n }\n\n getAuditLog(documentId: string, page: number = 0): Observable<Page<AuditRecord>> {\n let params = new HttpParams();\n params = params.set('page', page.toString());\n return this.http.get<Page<AuditRecord>>(`${this.valtimoEndpointUri}process-document/instance/document/${documentId}/audit`,\n {params}\n );\n }\n\n assignResource(documentId: string, resourceId: string): Observable<void> {\n return this.http.post<void>(`${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`, {});\n }\n\n removeResource(documentId: string, resourceId: string): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n })\n };\n return this.http.delete<void>(`${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`, options);\n }\n\n removeDocumentDefinition(name: string): Observable<UndeployDocumentDefinitionResult> {\n return this.http.delete<UndeployDocumentDefinitionResult>(`${this.valtimoEndpointUri}document-definition/${name}`);\n }\n\n sendMessage(documentId: string, request: DocumentSendMessageRequest): Observable<any> {\n return this.http.post(`${this.valtimoEndpointUri}document/${documentId}/message`, request);\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';\n\n@NgModule()\nexport class DocumentModule {\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 {HttpParams} from '@angular/common/http';\nimport {SortState} from '@valtimo/contract';\n\nexport interface DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n searchCriteria?: Array<{path: string; value: string}>;\n\n asHttpBody(): DocumentSearchRequestHttpBody;\n asHttpParams(): HttpParams;\n setPage(page: number): void;\n getSortString(sort: SortState): string;\n}\n\nexport class DocumentSearchRequestHttpBody {\n documentDefinitionName?: string;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n otherFilters?: Array<{path: string; value: string}>;\n}\n\nexport class DocumentSearchRequestImpl implements DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n otherFilters?: Array<{path: string; value: string}>;\n\n constructor(\n definitionName: string,\n page: number,\n size: number,\n sequence?: number,\n createdBy?: string,\n globalSearchFilter?: string,\n sort?: SortState,\n otherFilters?: Array<{path: string; value: string}>\n ) {\n this.definitionName = definitionName;\n this.page = page;\n this.size = size;\n this.sequence = sequence;\n this.createdBy = createdBy;\n this.globalSearchFilter = globalSearchFilter;\n this.sort = sort;\n this.otherFilters = otherFilters;\n }\n\n asHttpBody(): DocumentSearchRequestHttpBody {\n const httpBody = new DocumentSearchRequestHttpBody();\n\n httpBody.documentDefinitionName = this.definitionName;\n\n if (this.sequence) {\n httpBody.sequence = this.sequence;\n }\n if (this.createdBy) {\n httpBody.createdBy = this.createdBy;\n }\n if (this.globalSearchFilter) {\n httpBody.globalSearchFilter = this.globalSearchFilter;\n }\n if (this.otherFilters) {\n httpBody.otherFilters = this.otherFilters;\n }\n\n return httpBody;\n }\n\n asHttpParams(): HttpParams {\n let params = new HttpParams()\n .set('definitionName', this.definitionName)\n .set('page', this.page.toString())\n .set('size', this.size.toString());\n if (this.sort) {\n params = params.set('sort', this.getSortString(this.sort));\n }\n return params;\n }\n\n setPage(page: number): void {\n this.page = page;\n }\n\n getSortString(sort: SortState): string {\n return `${sort.state.name},${sort.state.direction}`;\n }\n}\n"]}
1
+ {"version":3,"sources":["../../../../projects/valtimo/document/src/lib/document.service.ts","../../../../projects/valtimo/document/src/lib/document.module.ts","../../../../projects/valtimo/document/src/lib/document-search-request.ts"],"names":["DocumentService","http","configService","this","valtimoEndpointUri","config","valtimoApi","endpointUri","prototype","getAllDefinitions","get","queryDefinitions","params","getDocumentDefinition","documentDefinitionName","getDocuments","documentSearchRequest","post","asHttpBody","asHttpParams","getDocument","documentId","modifyDocument","document","put","getProcessDocumentDefinitions","findProcessDocumentDefinitions","findProcessDocumentInstances","newDocumentAndStartProcess","request","modifyDocumentAndCompleteTask","modifyDocumentAndStartProcess","createProcessDocumentDefinition","createDocumentDefinition","documentDefinitionCreateRequest","options","headers","HttpHeaders","deleteProcessDocumentDefinition","body","delete","getAuditLog","page","HttpParams","set","toString","assignResource","resourceId","removeResource","removeDocumentDefinition","name","sendMessage","Injectable","args","providedIn","HttpClient","ConfigService","NgModule","DocumentSearchRequestImpl","definitionName","size","sequence","createdBy","globalSearchFilter","sort","otherFilters","httpBody","DocumentSearchRequestHttpBody","getSortString","setPage","state","direction"],"mappings":"ocAiDE,SAAAA,EAAoBC,EAAkBC,GAAlBC,KAAAF,KAAAA,EAClBE,KAAKC,mBAAqBF,EAAcG,OAAOC,WAAWC,mBAIrDP,EAAAQ,UAAAC,kBAAA,WACL,OAAON,KAAKF,KAAKS,IAA4BP,KAAKC,mBAAkB,wBAGtEJ,EAAAQ,UAAAG,iBAAA,SAAiBC,GACf,OAAOT,KAAKF,KAAKS,IACZP,KAAKC,mBAAkB,sBAC1B,CAACQ,OAAQA,KAIbZ,EAAAQ,UAAAK,sBAAA,SAAsBC,GACpB,OAAOX,K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uC,KAAOA,EACZvC,KAAKyD,KAAOA,EACZzD,KAAK0D,SAAWA,EAChB1D,KAAK2D,UAAYA,EACjB3D,KAAK4D,mBAAqBA,EAC1B5D,KAAK6D,KAAOA,EACZ7D,KAAK8D,aAAeA,SAGtBP,EAAAlD,UAAAU,WAAA,WACE,IAAMgD,EAAW,IAAIC,EAiBrB,OAfAD,EAASpD,uBAAyBX,KAAKwD,eAEnCxD,KAAK0D,WACPK,EAASL,SAAW1D,KAAK0D,UAEvB1D,KAAK2D,YACPI,EAASJ,UAAY3D,KAAK2D,WAExB3D,KAAK4D,qBACPG,EAASH,mBAAqB5D,KAAK4D,oBAEjC5D,KAAK8D,eACPC,EAASD,aAAe9D,KAAK8D,cAGxBC,GAGTR,EAAAlD,UAAAW,aAAA,WACE,IAAIP,GAAS,IAAI+B,EAAAA,YACdC,IAAI,iBAAkBzC,KAAKwD,gBAC3Bf,IAAI,OAAQzC,KAAKuC,KAAKG,YACtBD,IAAI,OAAQzC,KAAKyD,KAAKf,YAIzB,OAHI1C,KAAK6D,OACPpD,EAASA,EAAOgC,IAAI,OAAQzC,KAAKiE,cAAcjE,KAAK6D,QAE/CpD,GAGT8C,EAAAlD,UAAA6D,QAAA,SAAQ3B,GACNvC,KAAKuC,KAAOA,GAGdgB,EAAAlD,UAAA4D,cAAA,SAAcJ,GACZ,OAAUA,EAAKM,MAAMpB,KAAI,IAAIc,EAAKM,MAAMC","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 {Injectable} from '@angular/core';\nimport {HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';\nimport {Observable} from 'rxjs';\nimport {\n AuditRecord,\n Document,\n DocumentDefinition,\n DocumentDefinitions,\n DocumentResult,\n Documents,\n ModifyDocumentAndCompleteTaskRequestImpl,\n ModifyDocumentAndCompleteTaskResult,\n ModifyDocumentAndStartProcessRequestImpl,\n ModifyDocumentAndStartProcessResult,\n NewDocumentAndStartProcessRequestImpl,\n NewDocumentAndStartProcessResult,\n Page,\n ProcessDocumentDefinition,\n ProcessDocumentDefinitionRequest,\n ProcessDocumentInstance,\n DocumentDefinitionCreateRequest,\n UndeployDocumentDefinitionResult,\n DocumentSendMessageRequest,\n} from '@valtimo/contract';\nimport {DocumentSearchRequest} from './document-search-request';\nimport {ConfigService} from '@valtimo/config';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class DocumentService {\n private valtimoEndpointUri: string;\n\n constructor(private http: HttpClient, configService: ConfigService) {\n this.valtimoEndpointUri = configService.config.valtimoApi.endpointUri;\n }\n\n // Document-calls\n public getAllDefinitions(): Observable<DocumentDefinitions> {\n return this.http.get<DocumentDefinitions>(`${this.valtimoEndpointUri}document-definition`);\n }\n\n queryDefinitions(params?: any): Observable<Page<DocumentDefinition>> {\n return this.http.get<Page<DocumentDefinition>>(\n `${this.valtimoEndpointUri}document-definition`,\n {params: params}\n );\n }\n\n getDocumentDefinition(documentDefinitionName: string): Observable<DocumentDefinition> {\n return this.http.get<DocumentDefinition>(\n `${this.valtimoEndpointUri}document-definition/${documentDefinitionName}`\n );\n }\n\n getDocuments(documentSearchRequest: DocumentSearchRequest): Observable<Documents> {\n return this.http.post<Documents>(\n `${this.valtimoEndpointUri}document-search`,\n documentSearchRequest.asHttpBody(),\n {params: documentSearchRequest.asHttpParams()}\n );\n }\n\n getDocument(documentId: string): Observable<Document> {\n return this.http.get<Document>(`${this.valtimoEndpointUri}document/${documentId}`);\n }\n\n modifyDocument(document: any): Observable<DocumentResult> {\n return this.http.put<DocumentResult>(`${this.valtimoEndpointUri}document`, document);\n }\n\n // ProcessDocument-calls\n getProcessDocumentDefinitions(): Observable<ProcessDocumentDefinition> {\n return this.http.get<ProcessDocumentDefinition>(\n `${this.valtimoEndpointUri}process-document/definition`\n );\n }\n\n findProcessDocumentDefinitions(\n documentDefinitionName: string\n ): Observable<ProcessDocumentDefinition[]> {\n return this.http.get<ProcessDocumentDefinition[]>(\n `${this.valtimoEndpointUri}process-document/definition/document/${documentDefinitionName}`\n );\n }\n\n findProcessDocumentInstances(documentId: string): Observable<ProcessDocumentInstance[]> {\n return this.http.get<ProcessDocumentInstance[]>(\n `${this.valtimoEndpointUri}process-document/instance/document/${documentId}`\n );\n }\n\n newDocumentAndStartProcess(\n request: NewDocumentAndStartProcessRequestImpl\n ): Observable<NewDocumentAndStartProcessResult> {\n return this.http.post<NewDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/new-document-and-start-process`,\n request\n );\n }\n\n modifyDocumentAndCompleteTask(\n request: ModifyDocumentAndCompleteTaskRequestImpl\n ): Observable<ModifyDocumentAndCompleteTaskResult> {\n return this.http.post<ModifyDocumentAndCompleteTaskResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-complete-task`,\n request\n );\n }\n\n modifyDocumentAndStartProcess(\n request: ModifyDocumentAndStartProcessRequestImpl\n ): Observable<ModifyDocumentAndStartProcessResult> {\n return this.http.post<ModifyDocumentAndStartProcessResult>(\n `${this.valtimoEndpointUri}process-document/operation/modify-document-and-start-process`,\n request\n );\n }\n\n createProcessDocumentDefinition(\n request: ProcessDocumentDefinitionRequest\n ): Observable<ProcessDocumentDefinition> {\n return this.http.post<ProcessDocumentDefinition>(\n `${this.valtimoEndpointUri}process-document/definition`,\n request\n );\n }\n\n createDocumentDefinition(\n documentDefinitionCreateRequest: DocumentDefinitionCreateRequest\n ): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json',\n }),\n };\n return this.http.post<void>(\n `${this.valtimoEndpointUri}document-definition`,\n documentDefinitionCreateRequest,\n options\n );\n }\n\n deleteProcessDocumentDefinition(request: ProcessDocumentDefinitionRequest): Observable<any> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json',\n }),\n body: request,\n };\n return this.http.delete(`${this.valtimoEndpointUri}process-document/definition`, options);\n }\n\n getAuditLog(documentId: string, page: number = 0): Observable<Page<AuditRecord>> {\n let params = new HttpParams();\n params = params.set('page', page.toString());\n return this.http.get<Page<AuditRecord>>(\n `${this.valtimoEndpointUri}process-document/instance/document/${documentId}/audit`,\n {params}\n );\n }\n\n assignResource(documentId: string, resourceId: string): Observable<void> {\n return this.http.post<void>(\n `${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`,\n {}\n );\n }\n\n removeResource(documentId: string, resourceId: string): Observable<void> {\n const options = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json',\n }),\n };\n return this.http.delete<void>(\n `${this.valtimoEndpointUri}document/${documentId}/resource/${resourceId}`,\n options\n );\n }\n\n removeDocumentDefinition(name: string): Observable<UndeployDocumentDefinitionResult> {\n return this.http.delete<UndeployDocumentDefinitionResult>(\n `${this.valtimoEndpointUri}document-definition/${name}`\n );\n }\n\n sendMessage(documentId: string, request: DocumentSendMessageRequest): Observable<any> {\n return this.http.post(`${this.valtimoEndpointUri}document/${documentId}/message`, request);\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';\n\n@NgModule()\nexport class DocumentModule {}\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 {HttpParams} from '@angular/common/http';\nimport {SortState} from '@valtimo/contract';\n\nexport interface DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n searchCriteria?: Array<{path: string; value: string}>;\n\n asHttpBody(): DocumentSearchRequestHttpBody;\n asHttpParams(): HttpParams;\n setPage(page: number): void;\n getSortString(sort: SortState): string;\n}\n\nexport class DocumentSearchRequestHttpBody {\n documentDefinitionName?: string;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n otherFilters?: Array<{path: string; value: string}>;\n}\n\nexport class DocumentSearchRequestImpl implements DocumentSearchRequest {\n definitionName: string;\n page: number;\n size: number;\n sequence?: number;\n createdBy?: string;\n globalSearchFilter?: string;\n sort?: SortState;\n otherFilters?: Array<{path: string; value: string}>;\n\n constructor(\n definitionName: string,\n page: number,\n size: number,\n sequence?: number,\n createdBy?: string,\n globalSearchFilter?: string,\n sort?: SortState,\n otherFilters?: Array<{path: string; value: string}>\n ) {\n this.definitionName = definitionName;\n this.page = page;\n this.size = size;\n this.sequence = sequence;\n this.createdBy = createdBy;\n this.globalSearchFilter = globalSearchFilter;\n this.sort = sort;\n this.otherFilters = otherFilters;\n }\n\n asHttpBody(): DocumentSearchRequestHttpBody {\n const httpBody = new DocumentSearchRequestHttpBody();\n\n httpBody.documentDefinitionName = this.definitionName;\n\n if (this.sequence) {\n httpBody.sequence = this.sequence;\n }\n if (this.createdBy) {\n httpBody.createdBy = this.createdBy;\n }\n if (this.globalSearchFilter) {\n httpBody.globalSearchFilter = this.globalSearchFilter;\n }\n if (this.otherFilters) {\n httpBody.otherFilters = this.otherFilters;\n }\n\n return httpBody;\n }\n\n asHttpParams(): HttpParams {\n let params = new HttpParams()\n .set('definitionName', this.definitionName)\n .set('page', this.page.toString())\n .set('size', this.size.toString());\n if (this.sort) {\n params = params.set('sort', this.getSortString(this.sort));\n }\n return params;\n }\n\n setPage(page: number): void {\n this.page = page;\n }\n\n getSortString(sort: SortState): string {\n return `${sort.state.name},${sort.state.direction}`;\n }\n}\n"]}