@icure/api 8.0.30 → 8.0.32
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.
|
@@ -53,25 +53,25 @@ export declare class IccDoctemplateApi {
|
|
|
53
53
|
*
|
|
54
54
|
* @summary Gets all document templates for current user
|
|
55
55
|
*/
|
|
56
|
-
listDocumentTemplates(): Promise<Array<DocumentTemplate>>;
|
|
56
|
+
listDocumentTemplates(loadAttachment?: boolean): Promise<Array<DocumentTemplate>>;
|
|
57
57
|
/**
|
|
58
58
|
*
|
|
59
59
|
* @summary Gets all document templates by Type
|
|
60
60
|
* @param documentTypeCode
|
|
61
61
|
*/
|
|
62
|
-
findDocumentTemplatesByDocumentType(documentTypeCode: string): Promise<Array<DocumentTemplate>>;
|
|
62
|
+
findDocumentTemplatesByDocumentType(documentTypeCode: string, loadAttachment?: boolean): Promise<Array<DocumentTemplate>>;
|
|
63
63
|
/**
|
|
64
64
|
*
|
|
65
65
|
* @summary Gets all document templates by Type For currentUser
|
|
66
66
|
* @param documentTypeCode
|
|
67
67
|
*/
|
|
68
|
-
listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string): Promise<Array<DocumentTemplate>>;
|
|
68
|
+
listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string, loadAttachment?: boolean): Promise<Array<DocumentTemplate>>;
|
|
69
69
|
/**
|
|
70
70
|
*
|
|
71
71
|
* @summary Gets all document templates
|
|
72
72
|
* @param specialityCode
|
|
73
73
|
*/
|
|
74
|
-
listDocumentTemplatesBySpeciality(specialityCode: string): Promise<Array<DocumentTemplate>>;
|
|
74
|
+
listDocumentTemplatesBySpeciality(specialityCode: string, loadAttachment?: boolean): Promise<Array<DocumentTemplate>>;
|
|
75
75
|
/**
|
|
76
76
|
*
|
|
77
77
|
* @summary Download a the document template attachment
|
|
@@ -105,9 +105,10 @@ class IccDoctemplateApi {
|
|
|
105
105
|
*
|
|
106
106
|
* @summary Gets all document templates for current user
|
|
107
107
|
*/
|
|
108
|
-
listDocumentTemplates() {
|
|
108
|
+
listDocumentTemplates(loadAttachment) {
|
|
109
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime()
|
|
110
|
+
const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime() +
|
|
111
|
+
(loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '');
|
|
111
112
|
let headers = this.headers;
|
|
112
113
|
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
113
114
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
@@ -119,9 +120,10 @@ class IccDoctemplateApi {
|
|
|
119
120
|
* @summary Gets all document templates by Type
|
|
120
121
|
* @param documentTypeCode
|
|
121
122
|
*/
|
|
122
|
-
findDocumentTemplatesByDocumentType(documentTypeCode) {
|
|
123
|
+
findDocumentTemplatesByDocumentType(documentTypeCode, loadAttachment) {
|
|
123
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
const _url = this.host + `/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()
|
|
125
|
+
const _url = this.host + `/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime() +
|
|
126
|
+
(loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '');
|
|
125
127
|
let headers = this.headers;
|
|
126
128
|
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
127
129
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
@@ -133,9 +135,10 @@ class IccDoctemplateApi {
|
|
|
133
135
|
* @summary Gets all document templates by Type For currentUser
|
|
134
136
|
* @param documentTypeCode
|
|
135
137
|
*/
|
|
136
|
-
listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode) {
|
|
138
|
+
listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode, loadAttachment) {
|
|
137
139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
const _url = this.host + `/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime()
|
|
140
|
+
const _url = this.host + `/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime() +
|
|
141
|
+
(loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '');
|
|
139
142
|
let headers = this.headers;
|
|
140
143
|
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
141
144
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
@@ -147,10 +150,11 @@ class IccDoctemplateApi {
|
|
|
147
150
|
* @summary Gets all document templates
|
|
148
151
|
* @param specialityCode
|
|
149
152
|
*/
|
|
150
|
-
listDocumentTemplatesBySpeciality(specialityCode) {
|
|
153
|
+
listDocumentTemplatesBySpeciality(specialityCode, loadAttachment) {
|
|
151
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
152
155
|
let _body = null;
|
|
153
|
-
const _url = this.host + `/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime()
|
|
156
|
+
const _url = this.host + `/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime() +
|
|
157
|
+
(loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '');
|
|
154
158
|
let headers = this.headers;
|
|
155
159
|
return XHR_1.XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
156
160
|
.then((doc) => doc.body.map((it) => new DocumentTemplate_1.DocumentTemplate(it)))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IccDoctemplateApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccDoctemplateApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,gEAA4D;AAC5D,wFAA8G;AAC9G,qDAAiD;AAEjD,0FAAsF;AAEtF,MAAa,iBAAiB;IAM5B,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,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,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,iDAAwB,EAAE,CAAA;QAChH,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;IACG,sBAAsB,CAAC,IAAuB;;YAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,cAAc,GAAG,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;YACvE,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;YAC1B,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,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CAAA;YACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;iBACxH,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,mCAAgB,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;iBACrD,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AAnPD,8CAmPC","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 { DocIdentifier } from '../model/DocIdentifier'\nimport { DocumentTemplate } from '../model/DocumentTemplate'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { PaginatedListDocumentTemplate } from '../model/PaginatedListDocumentTemplate'\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 = iccRestApiPath(host)\n this.headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\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 async createDocumentTemplate(body?: DocumentTemplate): Promise<DocumentTemplate> {\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 * @summary Deletes a batch of document templates.\n *\n * @param documentTemplateIds a ListOfIds containing the ids of the document templates to delete.\n * @return a Promise that will resolve in an array of DocIdentifiers of the successfully deleted document templates.\n */\n async deleteDocumentTemplates(documentTemplateIds: ListOfIds): Promise<Array<DocIdentifier>> {\n return XHR.sendCommand(\n 'POST',\n this.host + `/doctemplate/delete/batch` + '?ts=' + new Date().getTime(),\n this.headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json')),\n documentTemplateIds,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use {@link listAllDocumentTemplatesWithPagination} instead.\n * @summary Gets all document templates for all users\n */\n async listAllDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n const _url = this.host + `/doctemplate/find/all?ts=${new Date().getTime()}&limit=1000000`\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListDocumentTemplate(doc.body as JSON).rows ?? [])\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Gets all document templates for all users with pagination.\n * @param startKey the startKey provided by the previous page or undefined for the first page.\n * @param startDocumentId the startDocumentId provided by the previous page or undefined for the first page.\n * @param limit the number of elements that the page should contain.\n * @return a promise that will resolve in a PaginatedListDocumentTemplate.\n */\n async listAllDocumentTemplatesWithPagination(startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListDocumentTemplate> {\n const _url =\n this.host +\n `/doctemplate/find/all?ts=${new Date().getTime()}` +\n (!!startKey ? `&startKey=${encodeURIComponent(startKey)}` : '') +\n (!!startDocumentId ? `&startDocumentId=${encodeURIComponent(startDocumentId)}` : '') +\n (!!limit ? `&limit=${limit}` : '')\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListDocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for current user\n */\n async listDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime()\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, 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 async findDocumentTemplatesByDocumentType(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\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, null, 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 async listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string): Promise<Array<DocumentTemplate>> {\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, null, 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 async listDocumentTemplatesBySpeciality(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 async 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 async 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 async getDocumentTemplateAttachment(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\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, null, 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 async setDocumentTemplateAttachment(documentTemplateId: string, body?: ArrayBuffer): Promise<DocumentTemplate> {\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 async setDocumentTemplateAttachmentJson(documentTemplateId: string, body?: string): Promise<DocumentTemplate> {\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 async updateDocumentTemplate(documentTemplateId: string, body?: DocumentTemplate): Promise<DocumentTemplate> {\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"]}
|
|
1
|
+
{"version":3,"file":"IccDoctemplateApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccDoctemplateApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,gEAA4D;AAC5D,wFAA8G;AAC9G,qDAAiD;AAEjD,0FAAsF;AAEtF,MAAa,iBAAiB;IAM5B,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,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,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,iDAAwB,EAAE,CAAA;QAChH,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;IACG,sBAAsB,CAAC,IAAuB;;YAClD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,cAAc,GAAG,MAAM,GAAG,IAA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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 { DocIdentifier } from '../model/DocIdentifier'\nimport { DocumentTemplate } from '../model/DocumentTemplate'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { PaginatedListDocumentTemplate } from '../model/PaginatedListDocumentTemplate'\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 = iccRestApiPath(host)\n this.headers = Object.keys(headers).map((k) => new XHR.Header(k, headers[k]))\n this.authenticationProvider = !!authenticationProvider ? authenticationProvider : new NoAuthenticationProvider()\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 async createDocumentTemplate(body?: DocumentTemplate): Promise<DocumentTemplate> {\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 * @summary Deletes a batch of document templates.\n *\n * @param documentTemplateIds a ListOfIds containing the ids of the document templates to delete.\n * @return a Promise that will resolve in an array of DocIdentifiers of the successfully deleted document templates.\n */\n async deleteDocumentTemplates(documentTemplateIds: ListOfIds): Promise<Array<DocIdentifier>> {\n return XHR.sendCommand(\n 'POST',\n this.host + `/doctemplate/delete/batch` + '?ts=' + new Date().getTime(),\n this.headers.filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json')),\n documentTemplateIds,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => (doc.body as Array<JSON>).map((it) => new DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use {@link listAllDocumentTemplatesWithPagination} instead.\n * @summary Gets all document templates for all users\n */\n async listAllDocumentTemplates(): Promise<Array<DocumentTemplate>> {\n const _url = this.host + `/doctemplate/find/all?ts=${new Date().getTime()}&limit=1000000`\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListDocumentTemplate(doc.body as JSON).rows ?? [])\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Gets all document templates for all users with pagination.\n * @param startKey the startKey provided by the previous page or undefined for the first page.\n * @param startDocumentId the startDocumentId provided by the previous page or undefined for the first page.\n * @param limit the number of elements that the page should contain.\n * @return a promise that will resolve in a PaginatedListDocumentTemplate.\n */\n async listAllDocumentTemplatesWithPagination(startKey?: string, startDocumentId?: string, limit?: number): Promise<PaginatedListDocumentTemplate> {\n const _url =\n this.host +\n `/doctemplate/find/all?ts=${new Date().getTime()}` +\n (!!startKey ? `&startKey=${encodeURIComponent(startKey)}` : '') +\n (!!startDocumentId ? `&startDocumentId=${encodeURIComponent(startDocumentId)}` : '') +\n (!!limit ? `&limit=${limit}` : '')\n const headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListDocumentTemplate(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets all document templates for current user\n */\n async listDocumentTemplates(loadAttachment?: boolean): Promise<Array<DocumentTemplate>> {\n const _url = this.host + `/doctemplate` + '?ts=' + new Date().getTime() +\n (loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, 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 async findDocumentTemplatesByDocumentType(documentTypeCode: string, loadAttachment?: boolean): Promise<Array<DocumentTemplate>> {\n const _url = this.host + `/doctemplate/byDocumentType/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime() +\n (loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, 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 async listDocumentTemplatesByDocumentTypeForCurrentUser(documentTypeCode: string, loadAttachment?: boolean): Promise<Array<DocumentTemplate>> {\n const _url =\n this.host + `/doctemplate/byDocumentTypeForCurrentUser/${encodeURIComponent(String(documentTypeCode))}` + '?ts=' + new Date().getTime() +\n (loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, null, 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 async listDocumentTemplatesBySpeciality(specialityCode: string, loadAttachment?: boolean): Promise<Array<DocumentTemplate>> {\n let _body = null\n\n const _url = this.host + `/doctemplate/bySpecialty/${encodeURIComponent(String(specialityCode))}` + '?ts=' + new Date().getTime() +\n (loadAttachment !== undefined ? '&loadAttachment=' + encodeURIComponent(String(loadAttachment)) : '')\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 async 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 async 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 async getDocumentTemplateAttachment(documentTemplateId: string, attachmentId: string): Promise<ArrayBuffer> {\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, null, 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 async setDocumentTemplateAttachment(documentTemplateId: string, body?: ArrayBuffer): Promise<DocumentTemplate> {\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 async setDocumentTemplateAttachmentJson(documentTemplateId: string, body?: string): Promise<DocumentTemplate> {\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 async updateDocumentTemplate(documentTemplateId: string, body?: DocumentTemplate): Promise<DocumentTemplate> {\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"]}
|