@icure/api 8.6.5 → 8.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/api/IccFormApi.d.ts +89 -0
- package/icc-api/api/IccFormApi.js +234 -0
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.d.ts +93 -0
- package/icc-x-api/icc-accesslog-x-api.js +93 -0
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +122 -0
- package/icc-x-api/icc-calendar-item-x-api.js +122 -0
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +20 -0
- package/icc-x-api/icc-classification-x-api.js +20 -0
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-code-x-api.d.ts +23 -0
- package/icc-x-api/icc-code-x-api.js +23 -0
- package/icc-x-api/icc-code-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +219 -1
- package/icc-x-api/icc-contact-x-api.js +219 -2
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-data-owner-x-api.d.ts +14 -3
- package/icc-x-api/icc-data-owner-x-api.js +14 -3
- package/icc-x-api/icc-data-owner-x-api.js.map +1 -1
- package/icc-x-api/icc-device-x-api.d.ts +8 -0
- package/icc-x-api/icc-device-x-api.js +8 -0
- package/icc-x-api/icc-device-x-api.js.map +1 -1
- package/icc-x-api/icc-doctemplate-x-api.d.ts +26 -0
- package/icc-x-api/icc-doctemplate-x-api.js +26 -0
- package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +114 -1
- package/icc-x-api/icc-document-x-api.js +127 -1
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +34 -4
- package/icc-x-api/icc-form-x-api.js +34 -4
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-hcparty-x-api.d.ts +67 -0
- package/icc-x-api/icc-hcparty-x-api.js +67 -0
- package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +141 -0
- package/icc-x-api/icc-helement-x-api.js +141 -0
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +54 -0
- package/icc-x-api/icc-invoice-x-api.js +54 -0
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +162 -0
- package/icc-x-api/icc-message-x-api.js +162 -0
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +245 -0
- package/icc-x-api/icc-patient-x-api.js +245 -1
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +25 -0
- package/icc-x-api/icc-receipt-x-api.js +25 -0
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-user-x-api.d.ts +25 -0
- package/icc-x-api/icc-user-x-api.js +25 -0
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/package.json +1 -1
- package/test/icc-x-api/icc-form-x-api.js +316 -1
- package/test/icc-x-api/icc-form-x-api.js.map +1 -1
- package/test/utils/roles.js +5 -0
- package/test/utils/roles.js.map +1 -1
- package/test/utils/test_utils.js +1 -21
- package/test/utils/test_utils.js.map +1 -1
|
@@ -15,6 +15,7 @@ import { Form } from '../model/Form';
|
|
|
15
15
|
import { FormTemplate } from '../model/FormTemplate';
|
|
16
16
|
import { IcureStub } from '../model/IcureStub';
|
|
17
17
|
import { ListOfIds } from '../model/ListOfIds';
|
|
18
|
+
import { IdWithRev } from '../model/IdWithRev';
|
|
18
19
|
import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
|
|
19
20
|
import { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult';
|
|
20
21
|
import { MinimalEntityBulkShareResult } from '../model/requests/MinimalEntityBulkShareResult';
|
|
@@ -217,6 +218,94 @@ export declare class IccFormApi {
|
|
|
217
218
|
* @param formTemplateId
|
|
218
219
|
*/
|
|
219
220
|
updateFormTemplate(formTemplateId: string, body?: FormTemplate): Promise<FormTemplate>;
|
|
221
|
+
/**
|
|
222
|
+
* Returns a list of form templates for the specified user in a group.
|
|
223
|
+
* @summary Get form templates by user in a group
|
|
224
|
+
* @param groupId the id of the group
|
|
225
|
+
* @param userId the id of the user
|
|
226
|
+
* @param loadLayout whether to load the layout of the form templates
|
|
227
|
+
*/
|
|
228
|
+
getFormTemplatesByUserInGroup(groupId: string, userId: string, loadLayout?: boolean): Promise<Array<FormTemplate>>;
|
|
229
|
+
/**
|
|
230
|
+
* Returns a list of form templates for the specified specialty in a group.
|
|
231
|
+
* @summary Get form templates by specialty in a group
|
|
232
|
+
* @param groupId the id of the group
|
|
233
|
+
* @param specialityCode the specialty code to filter templates by
|
|
234
|
+
* @param loadLayout whether to load the layout of the form templates
|
|
235
|
+
*/
|
|
236
|
+
getFormTemplatesBySpecialtyInGroup(groupId: string, specialityCode: string, loadLayout?: boolean): Promise<Array<FormTemplate>>;
|
|
237
|
+
/**
|
|
238
|
+
* Returns an instance of created form template.
|
|
239
|
+
* @summary Create a form template in a group
|
|
240
|
+
* @param groupId the id of the group
|
|
241
|
+
* @param body the form template to create
|
|
242
|
+
*/
|
|
243
|
+
createFormTemplateInGroup(groupId: string, body?: FormTemplate): Promise<FormTemplate>;
|
|
244
|
+
/**
|
|
245
|
+
* @summary Delete a form template in a group
|
|
246
|
+
* @param groupId the id of the group
|
|
247
|
+
* @param formTemplateId the id of the form template to delete
|
|
248
|
+
* @param rev the revision of the form template to delete
|
|
249
|
+
*/
|
|
250
|
+
deleteFormTemplateInGroup(groupId: string, formTemplateId: string, rev: string): Promise<DocIdentifier>;
|
|
251
|
+
/**
|
|
252
|
+
* Returns an instance of modified form template.
|
|
253
|
+
* @summary Modify a form template in a group
|
|
254
|
+
* @param groupId the id of the group
|
|
255
|
+
* @param formTemplateId the id of the form template to modify
|
|
256
|
+
* @param body the form template with updated data
|
|
257
|
+
*/
|
|
258
|
+
updateFormTemplateInGroup(groupId: string, formTemplateId: string, body?: FormTemplate): Promise<FormTemplate>;
|
|
259
|
+
/**
|
|
260
|
+
* @summary Update a form template's layout in a group using multipart upload
|
|
261
|
+
* @param groupId the id of the group
|
|
262
|
+
* @param attachment the layout data
|
|
263
|
+
* @param formTemplateId the id of the form template
|
|
264
|
+
*/
|
|
265
|
+
setTemplateAttachmentMultiInGroup(groupId: string, attachment: ArrayBuffer, formTemplateId: string): Promise<string>;
|
|
266
|
+
/**
|
|
267
|
+
* @summary Update a form template's layout in a group
|
|
268
|
+
* @param groupId the id of the group
|
|
269
|
+
* @param formTemplateId the id of the form template
|
|
270
|
+
* @param payload the layout data as binary
|
|
271
|
+
*/
|
|
272
|
+
setTemplateAttachmentInGroup(groupId: string, formTemplateId: string, payload: ArrayBuffer): Promise<string>;
|
|
273
|
+
/**
|
|
274
|
+
* @summary Create a batch of form templates in a group
|
|
275
|
+
* @param groupId the id of the group
|
|
276
|
+
* @param formTemplates the form templates to create
|
|
277
|
+
*/
|
|
278
|
+
createFormTemplatesInGroup(groupId: string, formTemplates: FormTemplate[]): Promise<FormTemplate[]>;
|
|
279
|
+
/**
|
|
280
|
+
* @summary Modify a batch of form templates in a group
|
|
281
|
+
* @param groupId the id of the group
|
|
282
|
+
* @param formTemplates the form templates to modify
|
|
283
|
+
*/
|
|
284
|
+
modifyFormTemplatesInGroup(groupId: string, formTemplates: FormTemplate[]): Promise<FormTemplate[]>;
|
|
285
|
+
/**
|
|
286
|
+
* @summary Get form templates in a group by their ids
|
|
287
|
+
* @param groupId the id of the group
|
|
288
|
+
* @param formTemplateIds the list of form template ids
|
|
289
|
+
*/
|
|
290
|
+
getFormTemplatesInGroup(groupId: string, formTemplateIds: string[]): Promise<FormTemplate[]>;
|
|
291
|
+
/**
|
|
292
|
+
* @summary Delete a batch of form templates in a group
|
|
293
|
+
* @param groupId the id of the group
|
|
294
|
+
* @param formTemplateIdsAndRevs the list of form template ids and revisions
|
|
295
|
+
*/
|
|
296
|
+
deleteFormTemplatesInGroup(groupId: string, formTemplateIdsAndRevs: IdWithRev[]): Promise<DocIdentifier[]>;
|
|
297
|
+
/**
|
|
298
|
+
* @summary Undelete a batch of form templates in a group
|
|
299
|
+
* @param groupId the id of the group
|
|
300
|
+
* @param formTemplateIdsAndRevs the list of form template ids and revisions
|
|
301
|
+
*/
|
|
302
|
+
undeleteFormTemplatesInGroup(groupId: string, formTemplateIdsAndRevs: IdWithRev[]): Promise<FormTemplate[]>;
|
|
303
|
+
/**
|
|
304
|
+
* @summary Purge a batch of form templates in a group
|
|
305
|
+
* @param groupId the id of the group
|
|
306
|
+
* @param formTemplateIdsAndRevs the list of form template ids and revisions
|
|
307
|
+
*/
|
|
308
|
+
purgeFormTemplatesInGroup(groupId: string, formTemplateIdsAndRevs: IdWithRev[]): Promise<DocIdentifier[]>;
|
|
220
309
|
/**
|
|
221
310
|
* @internal this method is for internal use only and may be changed without notice
|
|
222
311
|
*/
|
|
@@ -541,6 +541,240 @@ class IccFormApi {
|
|
|
541
541
|
.catch((err) => this.handleError(err));
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
|
+
/**
|
|
545
|
+
* Returns a list of form templates for the specified user in a group.
|
|
546
|
+
* @summary Get form templates by user in a group
|
|
547
|
+
* @param groupId the id of the group
|
|
548
|
+
* @param userId the id of the user
|
|
549
|
+
* @param loadLayout whether to load the layout of the form templates
|
|
550
|
+
*/
|
|
551
|
+
getFormTemplatesByUserInGroup(groupId, userId, loadLayout) {
|
|
552
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
553
|
+
let _body = null;
|
|
554
|
+
const _url = this.host +
|
|
555
|
+
`/form/template/inGroup/${encodeURIComponent(String(groupId))}/byUser/${encodeURIComponent(String(userId))}` +
|
|
556
|
+
'?ts=' +
|
|
557
|
+
new Date().getTime() +
|
|
558
|
+
(loadLayout !== undefined ? '&loadLayout=' + encodeURIComponent(String(loadLayout)) : '');
|
|
559
|
+
let headers = yield this.headers;
|
|
560
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
561
|
+
.then((doc) => doc.body.map((it) => new FormTemplate_1.FormTemplate(it)))
|
|
562
|
+
.catch((err) => this.handleError(err));
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Returns a list of form templates for the specified specialty in a group.
|
|
567
|
+
* @summary Get form templates by specialty in a group
|
|
568
|
+
* @param groupId the id of the group
|
|
569
|
+
* @param specialityCode the specialty code to filter templates by
|
|
570
|
+
* @param loadLayout whether to load the layout of the form templates
|
|
571
|
+
*/
|
|
572
|
+
getFormTemplatesBySpecialtyInGroup(groupId, specialityCode, loadLayout) {
|
|
573
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
574
|
+
let _body = null;
|
|
575
|
+
const _url = this.host +
|
|
576
|
+
`/form/template/inGroup/${encodeURIComponent(String(groupId))}/bySpecialty/${encodeURIComponent(String(specialityCode))}` +
|
|
577
|
+
'?ts=' +
|
|
578
|
+
new Date().getTime() +
|
|
579
|
+
(loadLayout !== undefined ? '&loadLayout=' + encodeURIComponent(String(loadLayout)) : '');
|
|
580
|
+
let headers = yield this.headers;
|
|
581
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
582
|
+
.then((doc) => doc.body.map((it) => new FormTemplate_1.FormTemplate(it)))
|
|
583
|
+
.catch((err) => this.handleError(err));
|
|
584
|
+
});
|
|
585
|
+
}
|
|
586
|
+
/**
|
|
587
|
+
* Returns an instance of created form template.
|
|
588
|
+
* @summary Create a form template in a group
|
|
589
|
+
* @param groupId the id of the group
|
|
590
|
+
* @param body the form template to create
|
|
591
|
+
*/
|
|
592
|
+
createFormTemplateInGroup(groupId, body) {
|
|
593
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
594
|
+
const _url = this.host + `/form/template/inGroup/${encodeURIComponent(String(groupId))}` + '?ts=' + new Date().getTime();
|
|
595
|
+
let headers = yield this.headers;
|
|
596
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
597
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
598
|
+
.then((doc) => new FormTemplate_1.FormTemplate(doc.body))
|
|
599
|
+
.catch((err) => this.handleError(err));
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
/**
|
|
603
|
+
* @summary Delete a form template in a group
|
|
604
|
+
* @param groupId the id of the group
|
|
605
|
+
* @param formTemplateId the id of the form template to delete
|
|
606
|
+
* @param rev the revision of the form template to delete
|
|
607
|
+
*/
|
|
608
|
+
deleteFormTemplateInGroup(groupId, formTemplateId, rev) {
|
|
609
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
610
|
+
let _body = null;
|
|
611
|
+
const _url = this.host +
|
|
612
|
+
`/form/template/inGroup/${encodeURIComponent(String(groupId))}/${encodeURIComponent(String(formTemplateId))}?rev=${encodeURIComponent(String(rev))}` +
|
|
613
|
+
'&ts=' +
|
|
614
|
+
new Date().getTime();
|
|
615
|
+
let headers = yield this.headers;
|
|
616
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
617
|
+
.then((doc) => new DocIdentifier_1.DocIdentifier(doc.body))
|
|
618
|
+
.catch((err) => this.handleError(err));
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
/**
|
|
622
|
+
* Returns an instance of modified form template.
|
|
623
|
+
* @summary Modify a form template in a group
|
|
624
|
+
* @param groupId the id of the group
|
|
625
|
+
* @param formTemplateId the id of the form template to modify
|
|
626
|
+
* @param body the form template with updated data
|
|
627
|
+
*/
|
|
628
|
+
updateFormTemplateInGroup(groupId, formTemplateId, body) {
|
|
629
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
630
|
+
let _body = null;
|
|
631
|
+
_body = body;
|
|
632
|
+
const _url = this.host +
|
|
633
|
+
`/form/template/inGroup/${encodeURIComponent(String(groupId))}` +
|
|
634
|
+
'?ts=' +
|
|
635
|
+
new Date().getTime();
|
|
636
|
+
let headers = yield this.headers;
|
|
637
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
638
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
639
|
+
.then((doc) => new FormTemplate_1.FormTemplate(doc.body))
|
|
640
|
+
.catch((err) => this.handleError(err));
|
|
641
|
+
});
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* @summary Update a form template's layout in a group using multipart upload
|
|
645
|
+
* @param groupId the id of the group
|
|
646
|
+
* @param attachment the layout data
|
|
647
|
+
* @param formTemplateId the id of the form template
|
|
648
|
+
*/
|
|
649
|
+
setTemplateAttachmentMultiInGroup(groupId, attachment, formTemplateId) {
|
|
650
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
651
|
+
let _body = null;
|
|
652
|
+
if (attachment && !_body) {
|
|
653
|
+
const parts = Array.isArray(attachment) ? attachment : [attachment];
|
|
654
|
+
const _blob = new Blob(parts, { type: 'application/octet-stream' });
|
|
655
|
+
_body = new FormData();
|
|
656
|
+
_body.append('attachment', _blob);
|
|
657
|
+
}
|
|
658
|
+
const _url = this.host +
|
|
659
|
+
`/form/template/inGroup/${encodeURIComponent(String(groupId))}/${encodeURIComponent(String(formTemplateId))}/attachment/multipart` +
|
|
660
|
+
'?ts=' +
|
|
661
|
+
new Date().getTime();
|
|
662
|
+
let headers = yield this.headers;
|
|
663
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'multipart/form-data'));
|
|
664
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
665
|
+
.then((doc) => JSON.parse(JSON.stringify(doc.body)))
|
|
666
|
+
.catch((err) => this.handleError(err));
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* @summary Update a form template's layout in a group
|
|
671
|
+
* @param groupId the id of the group
|
|
672
|
+
* @param formTemplateId the id of the form template
|
|
673
|
+
* @param payload the layout data as binary
|
|
674
|
+
*/
|
|
675
|
+
setTemplateAttachmentInGroup(groupId, formTemplateId, payload) {
|
|
676
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
677
|
+
const _url = this.host +
|
|
678
|
+
`/form/template/inGroup/${encodeURIComponent(String(groupId))}/${encodeURIComponent(String(formTemplateId))}/attachment` +
|
|
679
|
+
'?ts=' +
|
|
680
|
+
new Date().getTime();
|
|
681
|
+
let headers = yield this.headers;
|
|
682
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
683
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, payload, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
684
|
+
.then((doc) => JSON.parse(JSON.stringify(doc.body)))
|
|
685
|
+
.catch((err) => this.handleError(err));
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
/**
|
|
689
|
+
* @summary Create a batch of form templates in a group
|
|
690
|
+
* @param groupId the id of the group
|
|
691
|
+
* @param formTemplates the form templates to create
|
|
692
|
+
*/
|
|
693
|
+
createFormTemplatesInGroup(groupId, formTemplates) {
|
|
694
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
695
|
+
const _url = this.host + `/form/template/inGroup/${encodeURIComponent(String(groupId))}/batch` + '?ts=' + new Date().getTime();
|
|
696
|
+
let headers = yield this.headers;
|
|
697
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
698
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, formTemplates, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
699
|
+
.then((doc) => doc.body.map((it) => new FormTemplate_1.FormTemplate(it)))
|
|
700
|
+
.catch((err) => this.handleError(err));
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* @summary Modify a batch of form templates in a group
|
|
705
|
+
* @param groupId the id of the group
|
|
706
|
+
* @param formTemplates the form templates to modify
|
|
707
|
+
*/
|
|
708
|
+
modifyFormTemplatesInGroup(groupId, formTemplates) {
|
|
709
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
710
|
+
const _url = this.host + `/form/template/inGroup/${encodeURIComponent(String(groupId))}/batch` + '?ts=' + new Date().getTime();
|
|
711
|
+
let headers = yield this.headers;
|
|
712
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
713
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, formTemplates, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
714
|
+
.then((doc) => doc.body.map((it) => new FormTemplate_1.FormTemplate(it)))
|
|
715
|
+
.catch((err) => this.handleError(err));
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* @summary Get form templates in a group by their ids
|
|
720
|
+
* @param groupId the id of the group
|
|
721
|
+
* @param formTemplateIds the list of form template ids
|
|
722
|
+
*/
|
|
723
|
+
getFormTemplatesInGroup(groupId, formTemplateIds) {
|
|
724
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
725
|
+
const _url = this.host + `/form/template/inGroup/${encodeURIComponent(String(groupId))}/byIds` + '?ts=' + new Date().getTime();
|
|
726
|
+
let headers = yield this.headers;
|
|
727
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
728
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, { ids: formTemplateIds }, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
729
|
+
.then((doc) => doc.body.map((it) => new FormTemplate_1.FormTemplate(it)))
|
|
730
|
+
.catch((err) => this.handleError(err));
|
|
731
|
+
});
|
|
732
|
+
}
|
|
733
|
+
/**
|
|
734
|
+
* @summary Delete a batch of form templates in a group
|
|
735
|
+
* @param groupId the id of the group
|
|
736
|
+
* @param formTemplateIdsAndRevs the list of form template ids and revisions
|
|
737
|
+
*/
|
|
738
|
+
deleteFormTemplatesInGroup(groupId, formTemplateIdsAndRevs) {
|
|
739
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
740
|
+
const _url = this.host + `/form/template/inGroup/${encodeURIComponent(String(groupId))}/delete/batch` + '?ts=' + new Date().getTime();
|
|
741
|
+
let headers = yield this.headers;
|
|
742
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
743
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, { ids: formTemplateIdsAndRevs }, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
744
|
+
.then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
|
|
745
|
+
.catch((err) => this.handleError(err));
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
/**
|
|
749
|
+
* @summary Undelete a batch of form templates in a group
|
|
750
|
+
* @param groupId the id of the group
|
|
751
|
+
* @param formTemplateIdsAndRevs the list of form template ids and revisions
|
|
752
|
+
*/
|
|
753
|
+
undeleteFormTemplatesInGroup(groupId, formTemplateIdsAndRevs) {
|
|
754
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
755
|
+
const _url = this.host + `/form/template/inGroup/${encodeURIComponent(String(groupId))}/undelete/batch` + '?ts=' + new Date().getTime();
|
|
756
|
+
let headers = yield this.headers;
|
|
757
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
758
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, { ids: formTemplateIdsAndRevs }, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
759
|
+
.then((doc) => doc.body.map((it) => new FormTemplate_1.FormTemplate(it)))
|
|
760
|
+
.catch((err) => this.handleError(err));
|
|
761
|
+
});
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* @summary Purge a batch of form templates in a group
|
|
765
|
+
* @param groupId the id of the group
|
|
766
|
+
* @param formTemplateIdsAndRevs the list of form template ids and revisions
|
|
767
|
+
*/
|
|
768
|
+
purgeFormTemplatesInGroup(groupId, formTemplateIdsAndRevs) {
|
|
769
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
770
|
+
const _url = this.host + `/form/template/inGroup/${encodeURIComponent(String(groupId))}/purge/batch` + '?ts=' + new Date().getTime();
|
|
771
|
+
let headers = yield this.headers;
|
|
772
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
773
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, { ids: formTemplateIdsAndRevs }, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
774
|
+
.then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
|
|
775
|
+
.catch((err) => this.handleError(err));
|
|
776
|
+
});
|
|
777
|
+
}
|
|
544
778
|
/**
|
|
545
779
|
* @internal this method is for internal use only and may be changed without notice
|
|
546
780
|
*/
|