@icure/api 5.0.37 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icc-api/api/IccAccesslogApi.d.ts +3 -1
- package/icc-api/api/IccAccesslogApi.js +9 -8
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccAgendaApi.d.ts +3 -1
- package/icc-api/api/IccAgendaApi.js +9 -8
- package/icc-api/api/IccAgendaApi.js.map +1 -1
- package/icc-api/api/IccAnonymousAccessApi.d.ts +3 -1
- package/icc-api/api/IccAnonymousAccessApi.js +5 -4
- package/icc-api/api/IccAnonymousAccessApi.js.map +1 -1
- package/icc-api/api/IccApplicationsettingsApi.d.ts +3 -1
- package/icc-api/api/IccApplicationsettingsApi.js +5 -4
- package/icc-api/api/IccApplicationsettingsApi.js.map +1 -1
- package/icc-api/api/IccArticleApi.d.ts +3 -1
- package/icc-api/api/IccArticleApi.js +7 -6
- package/icc-api/api/IccArticleApi.js.map +1 -1
- package/icc-api/api/IccAuthApi.d.ts +10 -0
- package/icc-api/api/IccAuthApi.js +25 -1
- package/icc-api/api/IccAuthApi.js.map +1 -1
- package/icc-api/api/IccBeefactApi.d.ts +3 -1
- package/icc-api/api/IccBeefactApi.js +3 -2
- package/icc-api/api/IccBeefactApi.js.map +1 -1
- package/icc-api/api/IccBekmehrApi.d.ts +3 -1
- package/icc-api/api/IccBekmehrApi.js +29 -28
- package/icc-api/api/IccBekmehrApi.js.map +1 -1
- package/icc-api/api/IccBemikronoApi.d.ts +3 -1
- package/icc-api/api/IccBemikronoApi.js +10 -9
- package/icc-api/api/IccBemikronoApi.js.map +1 -1
- package/icc-api/api/IccBeresultexportApi.d.ts +3 -1
- package/icc-api/api/IccBeresultexportApi.js +5 -4
- package/icc-api/api/IccBeresultexportApi.js.map +1 -1
- package/icc-api/api/IccBeresultimportApi.d.ts +3 -1
- package/icc-api/api/IccBeresultimportApi.js +5 -4
- package/icc-api/api/IccBeresultimportApi.js.map +1 -1
- package/icc-api/api/IccBesamv2Api.d.ts +3 -1
- package/icc-api/api/IccBesamv2Api.js +35 -34
- package/icc-api/api/IccBesamv2Api.js.map +1 -1
- package/icc-api/api/IccCalendarItemApi.d.ts +3 -1
- package/icc-api/api/IccCalendarItemApi.js +14 -13
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemTypeApi.d.ts +3 -1
- package/icc-api/api/IccCalendarItemTypeApi.js +8 -7
- package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
- package/icc-api/api/IccClassificationApi.d.ts +3 -1
- package/icc-api/api/IccClassificationApi.js +10 -9
- package/icc-api/api/IccClassificationApi.js.map +1 -1
- package/icc-api/api/IccClassificationTemplateApi.d.ts +3 -1
- package/icc-api/api/IccClassificationTemplateApi.js +10 -9
- package/icc-api/api/IccClassificationTemplateApi.js.map +1 -1
- package/icc-api/api/IccCodeApi.d.ts +3 -1
- package/icc-api/api/IccCodeApi.js +18 -17
- package/icc-api/api/IccCodeApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +3 -2
- package/icc-api/api/IccContactApi.js +30 -32
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDeviceApi.d.ts +3 -1
- package/icc-api/api/IccDeviceApi.js +20 -19
- package/icc-api/api/IccDeviceApi.js.map +1 -1
- package/icc-api/api/IccDoctemplateApi.d.ts +3 -1
- package/icc-api/api/IccDoctemplateApi.js +15 -14
- package/icc-api/api/IccDoctemplateApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +33 -1
- package/icc-api/api/IccDocumentApi.js +86 -18
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccDocumentTemplateApi.d.ts +3 -1
- package/icc-api/api/IccDocumentTemplateApi.js +15 -14
- package/icc-api/api/IccDocumentTemplateApi.js.map +1 -1
- package/icc-api/api/IccEntityrefApi.d.ts +3 -1
- package/icc-api/api/IccEntityrefApi.js +4 -3
- package/icc-api/api/IccEntityrefApi.js.map +1 -1
- package/icc-api/api/IccEntitytemplateApi.d.ts +3 -1
- package/icc-api/api/IccEntitytemplateApi.js +13 -12
- package/icc-api/api/IccEntitytemplateApi.js.map +1 -1
- package/icc-api/api/IccFormApi.d.ts +3 -1
- package/icc-api/api/IccFormApi.js +26 -25
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccFrontendmigrationApi.d.ts +3 -1
- package/icc-api/api/IccFrontendmigrationApi.js +8 -7
- package/icc-api/api/IccFrontendmigrationApi.js.map +1 -1
- package/icc-api/api/IccGroupApi.d.ts +3 -1
- package/icc-api/api/IccGroupApi.js +18 -17
- package/icc-api/api/IccGroupApi.js.map +1 -1
- package/icc-api/api/IccHcpartyApi.d.ts +3 -1
- package/icc-api/api/IccHcpartyApi.js +24 -23
- package/icc-api/api/IccHcpartyApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +3 -1
- package/icc-api/api/IccHelementApi.js +15 -14
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccIcureApi.d.ts +3 -1
- package/icc-api/api/IccIcureApi.js +18 -17
- package/icc-api/api/IccIcureApi.js.map +1 -1
- package/icc-api/api/IccInsuranceApi.d.ts +3 -1
- package/icc-api/api/IccInsuranceApi.js +9 -8
- package/icc-api/api/IccInsuranceApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +3 -1
- package/icc-api/api/IccInvoiceApi.js +33 -32
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccKeywordApi.d.ts +3 -1
- package/icc-api/api/IccKeywordApi.js +8 -7
- package/icc-api/api/IccKeywordApi.js.map +1 -1
- package/icc-api/api/IccMaintenanceTaskApi.d.ts +3 -1
- package/icc-api/api/IccMaintenanceTaskApi.js +7 -6
- package/icc-api/api/IccMaintenanceTaskApi.js.map +1 -1
- package/icc-api/api/IccMedexApi.d.ts +3 -1
- package/icc-api/api/IccMedexApi.js +3 -2
- package/icc-api/api/IccMedexApi.js.map +1 -1
- package/icc-api/api/IccMedicallocationApi.d.ts +3 -1
- package/icc-api/api/IccMedicallocationApi.js +7 -6
- package/icc-api/api/IccMedicallocationApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +3 -1
- package/icc-api/api/IccMessageApi.js +21 -20
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-api/api/IccPatientApi.d.ts +3 -1
- package/icc-api/api/IccPatientApi.js +36 -35
- package/icc-api/api/IccPatientApi.js.map +1 -1
- package/icc-api/api/IccPermissionApi.d.ts +3 -1
- package/icc-api/api/IccPermissionApi.js +3 -2
- package/icc-api/api/IccPermissionApi.js.map +1 -1
- package/icc-api/api/IccPlaceApi.d.ts +3 -1
- package/icc-api/api/IccPlaceApi.js +7 -6
- package/icc-api/api/IccPlaceApi.js.map +1 -1
- package/icc-api/api/IccPubsubApi.d.ts +3 -1
- package/icc-api/api/IccPubsubApi.js +6 -5
- package/icc-api/api/IccPubsubApi.js.map +1 -1
- package/icc-api/api/IccReceiptApi.d.ts +3 -1
- package/icc-api/api/IccReceiptApi.js +9 -8
- package/icc-api/api/IccReceiptApi.js.map +1 -1
- package/icc-api/api/IccReplicationApi.d.ts +3 -1
- package/icc-api/api/IccReplicationApi.js +6 -5
- package/icc-api/api/IccReplicationApi.js.map +1 -1
- package/icc-api/api/IccTarificationApi.d.ts +3 -1
- package/icc-api/api/IccTarificationApi.js +10 -9
- package/icc-api/api/IccTarificationApi.js.map +1 -1
- package/icc-api/api/IccTimeTableApi.d.ts +3 -1
- package/icc-api/api/IccTimeTableApi.js +8 -7
- package/icc-api/api/IccTimeTableApi.js.map +1 -1
- package/icc-api/api/IccTmpApi.d.ts +3 -1
- package/icc-api/api/IccTmpApi.js +73 -72
- package/icc-api/api/IccTmpApi.js.map +1 -1
- package/icc-api/api/IccUserApi.d.ts +3 -1
- package/icc-api/api/IccUserApi.js +28 -27
- package/icc-api/api/IccUserApi.js.map +1 -1
- package/icc-api/api/XHR.d.ts +2 -1
- package/icc-api/api/XHR.js +45 -59
- package/icc-api/api/XHR.js.map +1 -1
- package/icc-api/model/AuthenticationResponse.d.ts +2 -0
- package/icc-api/model/AuthenticationResponse.js.map +1 -1
- package/icc-api/model/DataAttachment.d.ts +30 -0
- package/icc-api/model/DataAttachment.js +24 -0
- package/icc-api/model/DataAttachment.js.map +1 -0
- package/icc-api/model/DeletedAttachment.d.ts +33 -0
- package/icc-api/model/DeletedAttachment.js +24 -0
- package/icc-api/model/DeletedAttachment.js.map +1 -0
- package/icc-api/model/Document.d.ts +17 -5
- package/icc-api/model/Document.js.map +1 -1
- package/icc-api/model/RefreshTokenExpiredError.d.ts +3 -0
- package/icc-api/model/RefreshTokenExpiredError.js +10 -0
- package/icc-api/model/RefreshTokenExpiredError.js.map +1 -0
- package/icc-x-api/auth/AuthService.d.ts +16 -0
- package/icc-x-api/auth/AuthService.js +3 -0
- package/icc-x-api/auth/AuthService.js.map +1 -0
- package/icc-x-api/auth/AuthenticationProvider.d.ts +22 -0
- package/icc-x-api/auth/AuthenticationProvider.js +41 -0
- package/icc-x-api/auth/AuthenticationProvider.js.map +1 -0
- package/icc-x-api/auth/BasicAuthService.d.ts +12 -0
- package/icc-x-api/auth/BasicAuthService.js +26 -0
- package/icc-x-api/auth/BasicAuthService.js.map +1 -0
- package/icc-x-api/auth/EnsembleAuthService.d.ts +17 -0
- package/icc-x-api/auth/EnsembleAuthService.js +60 -0
- package/icc-x-api/auth/EnsembleAuthService.js.map +1 -0
- package/icc-x-api/auth/JwtAuthService.d.ts +19 -0
- package/icc-x-api/auth/JwtAuthService.js +96 -0
- package/icc-x-api/auth/JwtAuthService.js.map +1 -0
- package/icc-x-api/auth/NoAuthService.d.ts +8 -0
- package/icc-x-api/auth/NoAuthService.js +30 -0
- package/icc-x-api/auth/NoAuthService.js.map +1 -0
- package/icc-x-api/icc-accesslog-x-api.d.ts +2 -1
- package/icc-x-api/icc-accesslog-x-api.js +2 -2
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-bekmehr-x-api.d.ts +2 -1
- package/icc-x-api/icc-bekmehr-x-api.js +2 -2
- package/icc-x-api/icc-bekmehr-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +2 -1
- package/icc-x-api/icc-calendar-item-x-api.js +2 -2
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-classification-x-api.d.ts +2 -1
- package/icc-x-api/icc-classification-x-api.js +2 -2
- package/icc-x-api/icc-classification-x-api.js.map +1 -1
- package/icc-x-api/icc-code-x-api.d.ts +2 -1
- package/icc-x-api/icc-code-x-api.js +2 -2
- package/icc-x-api/icc-code-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +2 -1
- package/icc-x-api/icc-contact-x-api.js +2 -2
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-doctemplate-x-api.d.ts +3 -1
- package/icc-x-api/icc-doctemplate-x-api.js +4 -3
- package/icc-x-api/icc-doctemplate-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +3 -1
- package/icc-x-api/icc-document-x-api.js +4 -3
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +2 -1
- package/icc-x-api/icc-form-x-api.js +2 -2
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-hcparty-x-api.d.ts +2 -1
- package/icc-x-api/icc-hcparty-x-api.js +2 -2
- package/icc-x-api/icc-hcparty-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +2 -1
- package/icc-x-api/icc-helement-x-api.js +2 -2
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +2 -1
- package/icc-x-api/icc-invoice-x-api.js +2 -2
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-maintenance-task-x-api.d.ts +2 -1
- package/icc-x-api/icc-maintenance-task-x-api.js +2 -2
- package/icc-x-api/icc-maintenance-task-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +2 -1
- package/icc-x-api/icc-message-x-api.js +2 -2
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +2 -1
- package/icc-x-api/icc-patient-x-api.js +2 -2
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-receipt-x-api.d.ts +2 -1
- package/icc-x-api/icc-receipt-x-api.js +2 -2
- package/icc-x-api/icc-receipt-x-api.js.map +1 -1
- package/icc-x-api/icc-time-table-x-api.d.ts +2 -1
- package/icc-x-api/icc-time-table-x-api.js +2 -2
- package/icc-x-api/icc-time-table-x-api.js.map +1 -1
- package/icc-x-api/icc-user-x-api.d.ts +2 -1
- package/icc-x-api/icc-user-x-api.js +2 -2
- package/icc-x-api/icc-user-x-api.js.map +1 -1
- package/icc-x-api/index.d.ts +0 -4
- package/icc-x-api/index.js +30 -33
- package/icc-x-api/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -16,9 +16,10 @@ const XHR_1 = require("./XHR");
|
|
|
16
16
|
const DocIdentifier_1 = require("../model/DocIdentifier");
|
|
17
17
|
const DocumentTemplate_1 = require("../model/DocumentTemplate");
|
|
18
18
|
class IccDoctemplateApi {
|
|
19
|
-
constructor(host, headers, fetchImpl) {
|
|
19
|
+
constructor(host, headers, authenticationProvider, fetchImpl) {
|
|
20
20
|
this.host = host;
|
|
21
21
|
this.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
|
|
22
|
+
this.authenticationProvider = authenticationProvider;
|
|
22
23
|
this.fetchImpl = fetchImpl;
|
|
23
24
|
}
|
|
24
25
|
setHeaders(h) {
|
|
@@ -38,7 +39,7 @@ class IccDoctemplateApi {
|
|
|
38
39
|
const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime();
|
|
39
40
|
let headers = this.headers;
|
|
40
41
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
41
|
-
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl)
|
|
42
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
42
43
|
.then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
|
|
43
44
|
.catch((err) => this.handleError(err));
|
|
44
45
|
}
|
|
@@ -51,7 +52,7 @@ class IccDoctemplateApi {
|
|
|
51
52
|
let _body = null;
|
|
52
53
|
const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateIds))}` + '?ts=' + new Date().getTime();
|
|
53
54
|
let headers = this.headers;
|
|
54
|
-
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl)
|
|
55
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
55
56
|
.then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
|
|
56
57
|
.catch((err) => this.handleError(err));
|
|
57
58
|
}
|
|
@@ -63,7 +64,7 @@ class IccDoctemplateApi {
|
|
|
63
64
|
let _body = null;
|
|
64
65
|
const _url = this.host + `/doctemplate/find/all` + '?ts=' + new Date().getTime();
|
|
65
66
|
let headers = this.headers;
|
|
66
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
67
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
67
68
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
68
69
|
.catch((err) => this.handleError(err));
|
|
69
70
|
}
|
|
@@ -75,7 +76,7 @@ class IccDoctemplateApi {
|
|
|
75
76
|
let _body = null;
|
|
76
77
|
const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime();
|
|
77
78
|
let headers = this.headers;
|
|
78
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
79
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
79
80
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
80
81
|
.catch((err) => this.handleError(err));
|
|
81
82
|
}
|
|
@@ -88,7 +89,7 @@ class IccDoctemplateApi {
|
|
|
88
89
|
let _body = null;
|
|
89
90
|
const _url = this.host + `/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime();
|
|
90
91
|
let headers = this.headers;
|
|
91
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
92
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
92
93
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
93
94
|
.catch((err) => this.handleError(err));
|
|
94
95
|
}
|
|
@@ -101,7 +102,7 @@ class IccDoctemplateApi {
|
|
|
101
102
|
let _body = null;
|
|
102
103
|
const _url = this.host + `/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime();
|
|
103
104
|
let headers = this.headers;
|
|
104
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
105
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
105
106
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
106
107
|
.catch((err) => this.handleError(err));
|
|
107
108
|
}
|
|
@@ -114,7 +115,7 @@ class IccDoctemplateApi {
|
|
|
114
115
|
let _body = null;
|
|
115
116
|
const _url = this.host + `/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime();
|
|
116
117
|
let headers = this.headers;
|
|
117
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
118
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
118
119
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
119
120
|
.catch((err) => this.handleError(err));
|
|
120
121
|
}
|
|
@@ -131,7 +132,7 @@ class IccDoctemplateApi {
|
|
|
131
132
|
'?ts=' +
|
|
132
133
|
new Date().getTime();
|
|
133
134
|
let headers = this.headers;
|
|
134
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
135
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
135
136
|
.then((doc) => doc.body)
|
|
136
137
|
.catch((err) => this.handleError(err));
|
|
137
138
|
}
|
|
@@ -144,7 +145,7 @@ class IccDoctemplateApi {
|
|
|
144
145
|
let _body = null;
|
|
145
146
|
const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime();
|
|
146
147
|
let headers = this.headers;
|
|
147
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
148
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
148
149
|
.then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
|
|
149
150
|
.catch((err) => this.handleError(err));
|
|
150
151
|
}
|
|
@@ -161,7 +162,7 @@ class IccDoctemplateApi {
|
|
|
161
162
|
'?ts=' +
|
|
162
163
|
new Date().getTime();
|
|
163
164
|
let headers = this.headers;
|
|
164
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
165
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
165
166
|
.then((doc) => doc.body)
|
|
166
167
|
.catch((err) => this.handleError(err));
|
|
167
168
|
}
|
|
@@ -177,7 +178,7 @@ class IccDoctemplateApi {
|
|
|
177
178
|
const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment` + '?ts=' + new Date().getTime();
|
|
178
179
|
let headers = this.headers;
|
|
179
180
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
180
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
181
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
181
182
|
.then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
|
|
182
183
|
.catch((err) => this.handleError(err));
|
|
183
184
|
}
|
|
@@ -193,7 +194,7 @@ class IccDoctemplateApi {
|
|
|
193
194
|
const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentJson` + '?ts=' + new Date().getTime();
|
|
194
195
|
let headers = this.headers;
|
|
195
196
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
196
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
197
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
197
198
|
.then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
|
|
198
199
|
.catch((err) => this.handleError(err));
|
|
199
200
|
}
|
|
@@ -209,7 +210,7 @@ class IccDoctemplateApi {
|
|
|
209
210
|
const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime();
|
|
210
211
|
let headers = this.headers;
|
|
211
212
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
212
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
213
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
213
214
|
.then((doc) => new DocumentTemplate_1.DocumentTemplate(doc.body))
|
|
214
215
|
.catch((err) => this.handleError(err));
|
|
215
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IccDoctemplateApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccDoctemplateApi.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,0DAAsD;AACtD,gEAA4D;AAE5D,MAAa,iBAAiB;IAK5B,YAAY,IAAY,EAAE,OAAY,EAAE,SAAyE;QAC/G,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7E,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,UAAU,CAAC,CAAoB;QAC7B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;IAClB,CAAC;IAED,WAAW,CAAC,CAAe;QACzB,MAAM,CAAC,CAAA;IACT,CAAC;IAED;;;;OAIG;IACH,sBAAsB,CAAC,IAAuB;QAC5C,IAAI,KAAK,GAAG,IAAI,CAAA;QAChB,KAAK,GAAG,IAAI,CAAA;QAEZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,cAAc,GAAG,MAAM,G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M,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;QACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC;aAChE,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,mCAAgB,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;aACrD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAzOD,8CAyOC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { XHR } from './XHR'\nimport { ByteArray } from '../model/ByteArray'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { DocumentTemplate } from '../model/DocumentTemplate'\n\nexport class IccDoctemplateApi {\n host: string\n headers: Array<XHR.Header>\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(host: string, headers: any, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>) {\n this.host = host\n this.headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.fetchImpl = fetchImpl\n }\n\n setHeaders(h: Array<XHR.Header>) {\n this.headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * Returns an instance of created document template.\n * @summary Create a document template with the current user\n * @param body\n */\n createDocumentTemplate(body?: DocumentTemplate): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl)\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Deletes a document template\n * @param documentTemplateIds\n */\n deleteDocumentTemplate(documentTemplateIds: string): Promise<Array<DocIdentifier>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateIds))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for all users\n */\n findAllDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/find/all` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for current user\n */\n findDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates by Type\n * @param documentTypeCode\n */\n findDocumentTemplatesByDocumentType(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates by Type For currentUser\n * @param documentTypeCode\n */\n findDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url =\n this.host + `/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates\n * @param specialityCode\n */\n findDocumentTemplatesBySpeciality(specialityCode: string): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Download a the document template attachment\n * @param documentTemplateId\n * @param attachmentId\n */\n getAttachmentText(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url =\n this.host +\n `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentText/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets a document template\n * @param documentTemplateId\n */\n getDocumentTemplate(documentTemplateId: string): Promise<DocumentTemplate> {\n let _body = null\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Download a the document template attachment\n * @param documentTemplateId\n * @param attachmentId\n */\n getDocumentTemplateAttachment(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url =\n this.host +\n `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a document's attachment\n * @param body\n * @param documentTemplateId\n */\n setDocumentTemplateAttachment(documentTemplateId: string, body?: ArrayBuffer): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a document's attachment\n * @param body\n * @param documentTemplateId\n */\n setDocumentTemplateAttachmentJson(documentTemplateId: string, body?: string): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentJson` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns an instance of created document template.\n * @summary Modify a document template with the current user\n * @param body\n * @param documentTemplateId\n */\n updateDocumentTemplate(documentTemplateId: string, body?: DocumentTemplate): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IccDoctemplateApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccDoctemplateApi.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAE3B,0DAAsD;AACtD,gEAA4D;AAG5D,MAAa,iBAAiB;IAM5B,YACE,IAAY,EACZ,OAAY,EACZ,sBAA8C,EAC9C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC7E,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAA;QACpD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAED,UAAU,CAAC,CAAoB;QAC7B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAA;IAClB,CAAC;IAED,WAAW,CAAC,CAAe;QACzB,MAAM,CAAC,CAAA;IACT,CAAC;IAED;;;;OAIG;IACH,sBAAsB,CAAC,IAAuB;QAC5C,IAAI,KAAK,GAAG,IAAI,CAAA;QAChB,KAAK,GAAG,IAAI,CAAA;QAEZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,cAAc,GAAG,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,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,GAAG,EAAE,EAAE,CAAC,IAAI,mCAAgB,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;aACrD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;IAED;;;;;OAKG;IACH,sBAAsB,CAAC,kBAA0B,EAAE,IAAuB;QACxE,IAAI,KAAK,GAAG,IAAI,CAAA;QAChB,KAAK,GAAG,IAAI,CAAA;QAEZ,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC,EAAE,GAAG,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;QACzH,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;QAC1B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,cAAc,CAAC,CAAC,MAAM,CAAC,IAAI,SAAG,CAAC,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;QACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;aACzH,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,mCAAgB,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;aACrD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AAhPD,8CAgPC","sourcesContent":["/**\n * iCure Data Stack API Documentation\n * The iCure Data Stack Application API is the native interface to iCure. This version is obsolete, please use v2.\n *\n * OpenAPI spec version: v1\n *\n *\n * NOTE: This class is auto generated by the swagger code generator program.\n * https://github.com/swagger-api/swagger-codegen.git\n * Do not edit the class manually.\n */\nimport { XHR } from './XHR'\nimport { ByteArray } from '../model/ByteArray'\nimport { DocIdentifier } from '../model/DocIdentifier'\nimport { DocumentTemplate } from '../model/DocumentTemplate'\nimport { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\n\nexport class IccDoctemplateApi {\n host: string\n headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n constructor(\n host: string,\n headers: any,\n authenticationProvider: AuthenticationProvider,\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n ) {\n this.host = host\n this.headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = authenticationProvider\n this.fetchImpl = fetchImpl\n }\n\n setHeaders(h: Array<XHR.Header>) {\n this.headers = h\n }\n\n handleError(e: XHR.XHRError): never {\n throw e\n }\n\n /**\n * Returns an instance of created document template.\n * @summary Create a document template with the current user\n * @param body\n */\n createDocumentTemplate(body?: DocumentTemplate): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Deletes a document template\n * @param documentTemplateIds\n */\n deleteDocumentTemplate(documentTemplateIds: string): Promise<Array<DocIdentifier>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateIds))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for all users\n */\n findAllDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/find/all` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for current user\n */\n findDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates by Type\n * @param documentTypeCode\n */\n findDocumentTemplatesByDocumentType(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates by Type For currentUser\n * @param documentTypeCode\n */\n findDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url =\n this.host + `/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates\n * @param specialityCode\n */\n findDocumentTemplatesBySpeciality(specialityCode: string): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocumentTemplate(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Download a the document template attachment\n * @param documentTemplateId\n * @param attachmentId\n */\n getAttachmentText(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url =\n this.host +\n `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentText/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets a document template\n * @param documentTemplateId\n */\n getDocumentTemplate(documentTemplateId: string): Promise<DocumentTemplate> {\n let _body = null\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Download a the document template attachment\n * @param documentTemplateId\n * @param attachmentId\n */\n getDocumentTemplateAttachment(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\n let _body = null\n\n const _url =\n this.host +\n `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => doc.body)\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a document's attachment\n * @param body\n * @param documentTemplateId\n */\n setDocumentTemplateAttachment(documentTemplateId: string, body?: ArrayBuffer): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachment` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Creates a document's attachment\n * @param body\n * @param documentTemplateId\n */\n setDocumentTemplateAttachmentJson(documentTemplateId: string, body?: string): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}/attachmentJson` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns an instance of created document template.\n * @summary Modify a document template with the current user\n * @param body\n * @param documentTemplateId\n */\n updateDocumentTemplate(documentTemplateId: string, body?: DocumentTemplate): Promise<DocumentTemplate> {\n let _body = null\n _body = body\n\n const _url = this.host + `/doctemplate/${encodeURIComponent(String(documentTemplateId))}` + '?ts=' + new Date().getTime()\n let headers = this.headers\n headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
@@ -14,11 +14,13 @@ import { DocIdentifier } from '../model/DocIdentifier';
|
|
|
14
14
|
import { Document } from '../model/Document';
|
|
15
15
|
import { IcureStub } from '../model/IcureStub';
|
|
16
16
|
import { ListOfIds } from '../model/ListOfIds';
|
|
17
|
+
import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
|
|
17
18
|
export declare class IccDocumentApi {
|
|
18
19
|
host: string;
|
|
19
20
|
headers: Array<XHR.Header>;
|
|
21
|
+
authenticationProvider: AuthenticationProvider;
|
|
20
22
|
fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>;
|
|
21
|
-
constructor(host: string, headers: any, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
23
|
+
constructor(host: string, headers: any, authenticationProvider: AuthenticationProvider, fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>);
|
|
22
24
|
setHeaders(h: Array<XHR.Header>): void;
|
|
23
25
|
handleError(e: XHR.XHRError): never;
|
|
24
26
|
/**
|
|
@@ -135,4 +137,34 @@ export declare class IccDocumentApi {
|
|
|
135
137
|
* @param body
|
|
136
138
|
*/
|
|
137
139
|
setDocumentsDelegations(body?: Array<IcureStub>): Promise<Array<IcureStub>>;
|
|
140
|
+
/**
|
|
141
|
+
* Creates a secondary attachment for a document and returns the modified document instance afterward
|
|
142
|
+
* @summary Creates or modifies a secondary attachment for a document
|
|
143
|
+
* @param documentId id of the document to update
|
|
144
|
+
* @param key Key of the secondary attachment to update
|
|
145
|
+
* @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method
|
|
146
|
+
* will fail with CONFLICT status
|
|
147
|
+
* @param attachment
|
|
148
|
+
* @param utis Utis for the attachment
|
|
149
|
+
* @return the updated document
|
|
150
|
+
*/
|
|
151
|
+
setSecondaryAttachment(documentId: string, key: string, rev: string, attachment: Object, utis?: Array<string>): Promise<Document>;
|
|
152
|
+
/**
|
|
153
|
+
* Get the secondary attachment with the provided key for a document
|
|
154
|
+
* @summary Retrieve a secondary attachment of a document
|
|
155
|
+
* @param documentId id of the document
|
|
156
|
+
* @param key Key of the secondary attachment to retrieve
|
|
157
|
+
* @param fileName
|
|
158
|
+
* @return the content of the attachment
|
|
159
|
+
*/
|
|
160
|
+
getSecondaryAttachment(documentId: string, key: string, fileName?: string): Promise<ArrayBuffer>;
|
|
161
|
+
/**
|
|
162
|
+
* Deletes a document's attachment and returns the modified document instance afterward
|
|
163
|
+
* @summary Delete a document's attachment
|
|
164
|
+
* @param documentId id of the document
|
|
165
|
+
* @param key Key of the secondary attachment to delete
|
|
166
|
+
* @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method will fail with CONFLICT status
|
|
167
|
+
* @return the updated document
|
|
168
|
+
*/
|
|
169
|
+
deleteSecondaryAttachment(documentId: string, key: string, rev: string): Promise<Document>;
|
|
138
170
|
}
|
|
@@ -17,9 +17,10 @@ const DocIdentifier_1 = require("../model/DocIdentifier");
|
|
|
17
17
|
const Document_1 = require("../model/Document");
|
|
18
18
|
const IcureStub_1 = require("../model/IcureStub");
|
|
19
19
|
class IccDocumentApi {
|
|
20
|
-
constructor(host, headers, fetchImpl) {
|
|
20
|
+
constructor(host, headers, authenticationProvider, fetchImpl) {
|
|
21
21
|
this.host = host;
|
|
22
22
|
this.headers = Object.keys(headers).map((k) => new XHR_1.XHR.Header(k, headers[k]));
|
|
23
|
+
this.authenticationProvider = authenticationProvider;
|
|
23
24
|
this.fetchImpl = fetchImpl;
|
|
24
25
|
}
|
|
25
26
|
setHeaders(h) {
|
|
@@ -39,7 +40,7 @@ class IccDocumentApi {
|
|
|
39
40
|
const _url = this.host + `/document` + '?ts=' + new Date().getTime();
|
|
40
41
|
let headers = this.headers;
|
|
41
42
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
42
|
-
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl)
|
|
43
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
43
44
|
.then((doc) => new Document_1.Document(doc.body))
|
|
44
45
|
.catch((err) => this.handleError(err));
|
|
45
46
|
}
|
|
@@ -52,7 +53,7 @@ class IccDocumentApi {
|
|
|
52
53
|
let _body = null;
|
|
53
54
|
const _url = this.host + `/document/${encodeURIComponent(String(documentId))}/attachment` + '?ts=' + new Date().getTime();
|
|
54
55
|
let headers = this.headers;
|
|
55
|
-
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl)
|
|
56
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
56
57
|
.then((doc) => new Document_1.Document(doc.body))
|
|
57
58
|
.catch((err) => this.handleError(err));
|
|
58
59
|
}
|
|
@@ -65,7 +66,7 @@ class IccDocumentApi {
|
|
|
65
66
|
let _body = null;
|
|
66
67
|
const _url = this.host + `/document/${encodeURIComponent(String(documentIds))}` + '?ts=' + new Date().getTime();
|
|
67
68
|
let headers = this.headers;
|
|
68
|
-
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl)
|
|
69
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
69
70
|
.then((doc) => doc.body.map((it) => new DocIdentifier_1.DocIdentifier(it)))
|
|
70
71
|
.catch((err) => this.handleError(err));
|
|
71
72
|
}
|
|
@@ -86,7 +87,7 @@ class IccDocumentApi {
|
|
|
86
87
|
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
87
88
|
(secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '');
|
|
88
89
|
let headers = this.headers;
|
|
89
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
90
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
90
91
|
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
91
92
|
.catch((err) => this.handleError(err));
|
|
92
93
|
}
|
|
@@ -105,7 +106,7 @@ class IccDocumentApi {
|
|
|
105
106
|
(hcPartyId ? '&hcPartyId=' + encodeURIComponent(String(hcPartyId)) : '') +
|
|
106
107
|
(secretFKeys ? '&secretFKeys=' + encodeURIComponent(String(secretFKeys)) : '');
|
|
107
108
|
let headers = this.headers;
|
|
108
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
109
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
109
110
|
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
110
111
|
.catch((err) => this.handleError(err));
|
|
111
112
|
}
|
|
@@ -118,7 +119,7 @@ class IccDocumentApi {
|
|
|
118
119
|
let _body = null;
|
|
119
120
|
const _url = this.host + `/document/woDelegation` + '?ts=' + new Date().getTime() + (limit ? '&limit=' + encodeURIComponent(String(limit)) : '');
|
|
120
121
|
let headers = this.headers;
|
|
121
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
122
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
122
123
|
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
123
124
|
.catch((err) => this.handleError(err));
|
|
124
125
|
}
|
|
@@ -131,7 +132,7 @@ class IccDocumentApi {
|
|
|
131
132
|
let _body = null;
|
|
132
133
|
const _url = this.host + `/document/${encodeURIComponent(String(documentId))}` + '?ts=' + new Date().getTime();
|
|
133
134
|
let headers = this.headers;
|
|
134
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
135
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
135
136
|
.then((doc) => new Document_1.Document(doc.body))
|
|
136
137
|
.catch((err) => this.handleError(err));
|
|
137
138
|
}
|
|
@@ -152,7 +153,7 @@ class IccDocumentApi {
|
|
|
152
153
|
(enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '') +
|
|
153
154
|
(fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '');
|
|
154
155
|
let headers = this.headers;
|
|
155
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
156
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
156
157
|
.then((doc) => doc.body)
|
|
157
158
|
.catch((err) => this.handleError(err));
|
|
158
159
|
}
|
|
@@ -165,7 +166,7 @@ class IccDocumentApi {
|
|
|
165
166
|
let _body = null;
|
|
166
167
|
const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}` + '?ts=' + new Date().getTime();
|
|
167
168
|
let headers = this.headers;
|
|
168
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
169
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
169
170
|
.then((doc) => new Document_1.Document(doc.body))
|
|
170
171
|
.catch((err) => this.handleError(err));
|
|
171
172
|
}
|
|
@@ -180,7 +181,7 @@ class IccDocumentApi {
|
|
|
180
181
|
const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime();
|
|
181
182
|
let headers = this.headers;
|
|
182
183
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
183
|
-
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl)
|
|
184
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
184
185
|
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
185
186
|
.catch((err) => this.handleError(err));
|
|
186
187
|
}
|
|
@@ -193,7 +194,7 @@ class IccDocumentApi {
|
|
|
193
194
|
let _body = null;
|
|
194
195
|
const _url = this.host + `/document/externaluuid/${encodeURIComponent(String(externalUuid))}/all` + '?ts=' + new Date().getTime();
|
|
195
196
|
let headers = this.headers;
|
|
196
|
-
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl)
|
|
197
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
197
198
|
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
198
199
|
.catch((err) => this.handleError(err));
|
|
199
200
|
}
|
|
@@ -208,7 +209,7 @@ class IccDocumentApi {
|
|
|
208
209
|
const _url = this.host + `/document` + '?ts=' + new Date().getTime();
|
|
209
210
|
let headers = this.headers;
|
|
210
211
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
211
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
212
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
212
213
|
.then((doc) => new Document_1.Document(doc.body))
|
|
213
214
|
.catch((err) => this.handleError(err));
|
|
214
215
|
}
|
|
@@ -223,7 +224,7 @@ class IccDocumentApi {
|
|
|
223
224
|
const _url = this.host + `/document/batch` + '?ts=' + new Date().getTime();
|
|
224
225
|
let headers = this.headers;
|
|
225
226
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
226
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
227
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
227
228
|
.then((doc) => doc.body.map((it) => new Document_1.Document(it)))
|
|
228
229
|
.catch((err) => this.handleError(err));
|
|
229
230
|
}
|
|
@@ -244,7 +245,7 @@ class IccDocumentApi {
|
|
|
244
245
|
(enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '');
|
|
245
246
|
let headers = this.headers;
|
|
246
247
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
247
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
248
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
248
249
|
.then((doc) => new Document_1.Document(doc.body))
|
|
249
250
|
.catch((err) => this.handleError(err));
|
|
250
251
|
}
|
|
@@ -266,7 +267,7 @@ class IccDocumentApi {
|
|
|
266
267
|
(enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '');
|
|
267
268
|
let headers = this.headers;
|
|
268
269
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
269
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
270
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
270
271
|
.then((doc) => new Document_1.Document(doc.body))
|
|
271
272
|
.catch((err) => this.handleError(err));
|
|
272
273
|
}
|
|
@@ -292,7 +293,7 @@ class IccDocumentApi {
|
|
|
292
293
|
(enckeys ? '&enckeys=' + encodeURIComponent(String(enckeys)) : '');
|
|
293
294
|
let headers = this.headers;
|
|
294
295
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'multipart/form-data'));
|
|
295
|
-
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl)
|
|
296
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
296
297
|
.then((doc) => new Document_1.Document(doc.body))
|
|
297
298
|
.catch((err) => this.handleError(err));
|
|
298
299
|
}
|
|
@@ -307,10 +308,77 @@ class IccDocumentApi {
|
|
|
307
308
|
const _url = this.host + `/document/delegations` + '?ts=' + new Date().getTime();
|
|
308
309
|
let headers = this.headers;
|
|
309
310
|
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
310
|
-
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl)
|
|
311
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
311
312
|
.then((doc) => doc.body.map((it) => new IcureStub_1.IcureStub(it)))
|
|
312
313
|
.catch((err) => this.handleError(err));
|
|
313
314
|
}
|
|
315
|
+
/**
|
|
316
|
+
* Creates a secondary attachment for a document and returns the modified document instance afterward
|
|
317
|
+
* @summary Creates or modifies a secondary attachment for a document
|
|
318
|
+
* @param documentId id of the document to update
|
|
319
|
+
* @param key Key of the secondary attachment to update
|
|
320
|
+
* @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method
|
|
321
|
+
* will fail with CONFLICT status
|
|
322
|
+
* @param attachment
|
|
323
|
+
* @param utis Utis for the attachment
|
|
324
|
+
* @return the updated document
|
|
325
|
+
*/
|
|
326
|
+
setSecondaryAttachment(documentId, key, rev, attachment, utis) {
|
|
327
|
+
const _url = this.host +
|
|
328
|
+
`/document/` +
|
|
329
|
+
encodeURIComponent(String(documentId)) +
|
|
330
|
+
'/secondaryAttachments/' +
|
|
331
|
+
encodeURIComponent(String(key)) +
|
|
332
|
+
'?ts=' +
|
|
333
|
+
new Date().getTime() +
|
|
334
|
+
(rev ? '&rev=' + encodeURIComponent(String(rev)) : '') +
|
|
335
|
+
(utis ? utis.map((x) => '&utis=' + encodeURIComponent(String(x))).join('') : '');
|
|
336
|
+
let headers = this.headers;
|
|
337
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/octet-stream'));
|
|
338
|
+
return XHR_1.XHR.sendCommand('PUT', _url, headers, attachment, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
339
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
340
|
+
.catch((err) => this.handleError(err));
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Get the secondary attachment with the provided key for a document
|
|
344
|
+
* @summary Retrieve a secondary attachment of a document
|
|
345
|
+
* @param documentId id of the document
|
|
346
|
+
* @param key Key of the secondary attachment to retrieve
|
|
347
|
+
* @param fileName
|
|
348
|
+
* @return the content of the attachment
|
|
349
|
+
*/
|
|
350
|
+
getSecondaryAttachment(documentId, key, fileName) {
|
|
351
|
+
let _body = null;
|
|
352
|
+
const _url = this.host +
|
|
353
|
+
`/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
|
|
354
|
+
'?ts=' +
|
|
355
|
+
new Date().getTime() +
|
|
356
|
+
(fileName ? '&fileName=' + encodeURIComponent(String(fileName)) : '');
|
|
357
|
+
let headers = this.headers;
|
|
358
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
359
|
+
.then((doc) => doc.body)
|
|
360
|
+
.catch((err) => this.handleError(err));
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Deletes a document's attachment and returns the modified document instance afterward
|
|
364
|
+
* @summary Delete a document's attachment
|
|
365
|
+
* @param documentId id of the document
|
|
366
|
+
* @param key Key of the secondary attachment to delete
|
|
367
|
+
* @param rev Revision of the latest known version of the document. If the revision does not match the current version of the document the method will fail with CONFLICT status
|
|
368
|
+
* @return the updated document
|
|
369
|
+
*/
|
|
370
|
+
deleteSecondaryAttachment(documentId, key, rev) {
|
|
371
|
+
let _body = null;
|
|
372
|
+
const _url = this.host +
|
|
373
|
+
`/document/${encodeURIComponent(String(documentId))}/secondaryAttachments/${encodeURIComponent(String(key))}` +
|
|
374
|
+
'?ts=' +
|
|
375
|
+
new Date().getTime() +
|
|
376
|
+
(rev ? '&rev=' + encodeURIComponent(String(rev)) : '');
|
|
377
|
+
let headers = this.headers;
|
|
378
|
+
return XHR_1.XHR.sendCommand('DELETE', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
379
|
+
.then((doc) => new Document_1.Document(doc.body))
|
|
380
|
+
.catch((err) => this.handleError(err));
|
|
381
|
+
}
|
|
314
382
|
}
|
|
315
383
|
exports.IccDocumentApi = IccDocumentApi;
|
|
316
384
|
//# sourceMappingURL=IccDocumentApi.js.map
|