@icure/api 8.8.0 → 8.8.2
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 +48 -0
- package/icc-api/api/IccAccesslogApi.js +100 -0
- package/icc-api/api/IccAccesslogApi.js.map +1 -1
- package/icc-api/api/IccAgendaApi.d.ts +25 -0
- package/icc-api/api/IccAgendaApi.js +49 -0
- package/icc-api/api/IccAgendaApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemApi.d.ts +25 -0
- package/icc-api/api/IccCalendarItemApi.js +49 -0
- package/icc-api/api/IccCalendarItemApi.js.map +1 -1
- package/icc-api/api/IccCalendarItemTypeApi.d.ts +25 -0
- package/icc-api/api/IccCalendarItemTypeApi.js +49 -0
- package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
- package/icc-api/api/IccCodeApi.d.ts +25 -0
- package/icc-api/api/IccCodeApi.js +49 -0
- package/icc-api/api/IccCodeApi.js.map +1 -1
- package/icc-api/api/IccContactApi.d.ts +48 -0
- package/icc-api/api/IccContactApi.js +100 -0
- package/icc-api/api/IccContactApi.js.map +1 -1
- package/icc-api/api/IccDeviceApi.d.ts +48 -0
- package/icc-api/api/IccDeviceApi.js +100 -0
- package/icc-api/api/IccDeviceApi.js.map +1 -1
- package/icc-api/api/IccDocumentApi.d.ts +48 -0
- package/icc-api/api/IccDocumentApi.js +100 -0
- package/icc-api/api/IccDocumentApi.js.map +1 -1
- package/icc-api/api/IccFormApi.d.ts +48 -0
- package/icc-api/api/IccFormApi.js +101 -4
- package/icc-api/api/IccFormApi.js.map +1 -1
- package/icc-api/api/IccHcpartyApi.d.ts +48 -0
- package/icc-api/api/IccHcpartyApi.js +100 -0
- package/icc-api/api/IccHcpartyApi.js.map +1 -1
- package/icc-api/api/IccHelementApi.d.ts +48 -0
- package/icc-api/api/IccHelementApi.js +100 -0
- package/icc-api/api/IccHelementApi.js.map +1 -1
- package/icc-api/api/IccInsuranceApi.d.ts +50 -2
- package/icc-api/api/IccInsuranceApi.js +100 -0
- package/icc-api/api/IccInsuranceApi.js.map +1 -1
- package/icc-api/api/IccInvoiceApi.d.ts +48 -0
- package/icc-api/api/IccInvoiceApi.js +100 -0
- package/icc-api/api/IccInvoiceApi.js.map +1 -1
- package/icc-api/api/IccMessageApi.d.ts +48 -0
- package/icc-api/api/IccMessageApi.js +100 -0
- package/icc-api/api/IccMessageApi.js.map +1 -1
- package/icc-api/api/IccPatientApi.d.ts +48 -0
- package/icc-api/api/IccPatientApi.js +100 -0
- package/icc-api/api/IccPatientApi.js.map +1 -1
- package/icc-api/api/IccPlaceApi.d.ts +25 -0
- package/icc-api/api/IccPlaceApi.js +49 -0
- package/icc-api/api/IccPlaceApi.js.map +1 -1
- package/icc-api/api/IccReceiptApi.d.ts +25 -0
- package/icc-api/api/IccReceiptApi.js +49 -0
- package/icc-api/api/IccReceiptApi.js.map +1 -1
- package/icc-api/api/IccTopicApi.d.ts +48 -0
- package/icc-api/api/IccTopicApi.js +100 -0
- package/icc-api/api/IccTopicApi.js.map +1 -1
- package/icc-api/api/IccUserApi.d.ts +25 -0
- package/icc-api/api/IccUserApi.js +49 -0
- package/icc-api/api/IccUserApi.js.map +1 -1
- package/icc-api/model/ConflictResolutionRequest.d.ts +18 -0
- package/icc-api/model/ConflictResolutionRequest.js +17 -0
- package/icc-api/model/ConflictResolutionRequest.js.map +1 -0
- package/icc-api/model/ConflictResolutionResult.d.ts +22 -0
- package/icc-api/model/ConflictResolutionResult.js +24 -0
- package/icc-api/model/ConflictResolutionResult.js.map +1 -0
- package/icc-api/model/models.d.ts +2 -0
- package/icc-api/model/models.js +2 -0
- package/icc-api/model/models.js.map +1 -1
- package/icc-x-api/icc-accesslog-x-api.d.ts +31 -0
- package/icc-x-api/icc-accesslog-x-api.js +57 -0
- package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
- package/icc-x-api/icc-calendar-item-x-api.d.ts +15 -0
- package/icc-x-api/icc-calendar-item-x-api.js +28 -0
- package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
- package/icc-x-api/icc-contact-x-api.d.ts +31 -0
- package/icc-x-api/icc-contact-x-api.js +60 -1
- package/icc-x-api/icc-contact-x-api.js.map +1 -1
- package/icc-x-api/icc-document-x-api.d.ts +31 -0
- package/icc-x-api/icc-document-x-api.js +64 -0
- package/icc-x-api/icc-document-x-api.js.map +1 -1
- package/icc-x-api/icc-form-x-api.d.ts +31 -0
- package/icc-x-api/icc-form-x-api.js +58 -0
- package/icc-x-api/icc-form-x-api.js.map +1 -1
- package/icc-x-api/icc-helement-x-api.d.ts +31 -0
- package/icc-x-api/icc-helement-x-api.js +57 -0
- package/icc-x-api/icc-helement-x-api.js.map +1 -1
- package/icc-x-api/icc-invoice-x-api.d.ts +31 -0
- package/icc-x-api/icc-invoice-x-api.js +58 -0
- package/icc-x-api/icc-invoice-x-api.js.map +1 -1
- package/icc-x-api/icc-message-x-api.d.ts +31 -0
- package/icc-x-api/icc-message-x-api.js +64 -0
- package/icc-x-api/icc-message-x-api.js.map +1 -1
- package/icc-x-api/icc-patient-x-api.d.ts +31 -0
- package/icc-x-api/icc-patient-x-api.js +57 -0
- package/icc-x-api/icc-patient-x-api.js.map +1 -1
- package/icc-x-api/icc-topic-x-api.d.ts +31 -0
- package/icc-x-api/icc-topic-x-api.js +58 -0
- package/icc-x-api/icc-topic-x-api.js.map +1 -1
- package/icc-x-api/utils/formatting-util.d.ts +10 -4
- package/icc-x-api/utils/formatting-util.js +47 -6
- package/icc-x-api/utils/formatting-util.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,9 +14,11 @@ import { DocIdentifier } from '../model/DocIdentifier';
|
|
|
14
14
|
import { ListOfIds } from '../model/ListOfIds';
|
|
15
15
|
import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
|
|
16
16
|
import { PaginatedListInsurance } from '../model/PaginatedListInsurance';
|
|
17
|
-
import { Insurance } from
|
|
18
|
-
import { AbstractFilterInsurance } from
|
|
17
|
+
import { Insurance } from '../model/Insurance';
|
|
18
|
+
import { AbstractFilterInsurance } from '../model/AbstractFilterInsurance';
|
|
19
19
|
import { TimingInfo } from '../model/TimingInfo';
|
|
20
|
+
import { ConflictResolutionRequest } from '../model/ConflictResolutionRequest';
|
|
21
|
+
import { ConflictResolutionResult } from '../model/ConflictResolutionResult';
|
|
20
22
|
export declare class IccInsuranceApi {
|
|
21
23
|
host: string;
|
|
22
24
|
headers: Array<XHR.Header>;
|
|
@@ -84,4 +86,50 @@ export declare class IccInsuranceApi {
|
|
|
84
86
|
*/
|
|
85
87
|
matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming?: false): Promise<Array<string>>;
|
|
86
88
|
matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming?: true): Promise<Array<string> & TimingInfo>;
|
|
89
|
+
/**
|
|
90
|
+
* Retrieves the ids of all the insurances that currently have conflicting revisions and therefore need to
|
|
91
|
+
* be resolved.
|
|
92
|
+
* @summary List the ids of the insurances that have conflicts.
|
|
93
|
+
* @return the ids of the insurances with unresolved conflicts.
|
|
94
|
+
*/
|
|
95
|
+
getConflictingEntitiesIds(): Promise<Array<string>>;
|
|
96
|
+
/**
|
|
97
|
+
* Retrieves all the conflicting revisions of the insurance with the given id (the current revision is not
|
|
98
|
+
* included). The returned entities are still encrypted.
|
|
99
|
+
* @summary Get the conflicting revisions of an insurance.
|
|
100
|
+
* @param entityId the id of the insurance to retrieve the conflicts for.
|
|
101
|
+
* @return the conflicting revisions of the insurance.
|
|
102
|
+
*/
|
|
103
|
+
getConflictsForEntity(entityId: string): Promise<Array<Insurance>>;
|
|
104
|
+
/**
|
|
105
|
+
* Resolves a conflict by declaring which revision of the insurance should be kept as winner and which
|
|
106
|
+
* conflicting revisions should be purged. The provided document must already be encrypted.
|
|
107
|
+
* @summary Declare the winning revision of a conflicting insurance.
|
|
108
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
109
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
110
|
+
*/
|
|
111
|
+
declareConflictWinner(body: ConflictResolutionRequest<Insurance>): Promise<ConflictResolutionResult<Insurance>>;
|
|
112
|
+
/**
|
|
113
|
+
* Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id.
|
|
114
|
+
* @summary List the ids of the insurances that have conflicts, in the given group.
|
|
115
|
+
* @param groupId the id of the group to look into.
|
|
116
|
+
* @return the ids of the insurances with unresolved conflicts in the group.
|
|
117
|
+
*/
|
|
118
|
+
getConflictingEntitiesIdsInGroup(groupId: string): Promise<Array<string>>;
|
|
119
|
+
/**
|
|
120
|
+
* Like {@link getConflictsForEntity} but targets the entity of the group with the given id.
|
|
121
|
+
* @summary Get the conflicting revisions of an insurance, in the given group.
|
|
122
|
+
* @param groupId the id of the group the insurance belongs to.
|
|
123
|
+
* @param entityId the id of the insurance to retrieve the conflicts for.
|
|
124
|
+
* @return the conflicting revisions of the insurance.
|
|
125
|
+
*/
|
|
126
|
+
getConflictsForEntityInGroup(groupId: string, entityId: string): Promise<Array<Insurance>>;
|
|
127
|
+
/**
|
|
128
|
+
* Like {@link declareConflictWinner} but targets the entity of the group with the given id.
|
|
129
|
+
* @summary Declare the winning revision of a conflicting insurance, in the given group.
|
|
130
|
+
* @param groupId the id of the group the insurance belongs to.
|
|
131
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
132
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
133
|
+
*/
|
|
134
|
+
declareConflictWinnerInGroup(groupId: string, body: ConflictResolutionRequest<Insurance>): Promise<ConflictResolutionResult<Insurance>>;
|
|
87
135
|
}
|
|
@@ -28,6 +28,7 @@ const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationPro
|
|
|
28
28
|
const IccRestApiPath_1 = require("./IccRestApiPath");
|
|
29
29
|
const PaginatedListInsurance_1 = require("../model/PaginatedListInsurance");
|
|
30
30
|
const Insurance_1 = require("../model/Insurance");
|
|
31
|
+
const ConflictResolutionResult_1 = require("../model/ConflictResolutionResult");
|
|
31
32
|
class IccInsuranceApi {
|
|
32
33
|
constructor(host, headers, authenticationProvider, fetchImpl) {
|
|
33
34
|
this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
|
|
@@ -206,6 +207,105 @@ class IccInsuranceApi {
|
|
|
206
207
|
.catch((err) => this.handleError(err));
|
|
207
208
|
});
|
|
208
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Retrieves the ids of all the insurances that currently have conflicting revisions and therefore need to
|
|
212
|
+
* be resolved.
|
|
213
|
+
* @summary List the ids of the insurances that have conflicts.
|
|
214
|
+
* @return the ids of the insurances with unresolved conflicts.
|
|
215
|
+
*/
|
|
216
|
+
getConflictingEntitiesIds() {
|
|
217
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
218
|
+
const _url = this.host + `/insurance/conflicts` + '?ts=' + new Date().getTime();
|
|
219
|
+
let headers = this.headers;
|
|
220
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
221
|
+
.then((doc) => doc.body)
|
|
222
|
+
.catch((err) => this.handleError(err));
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Retrieves all the conflicting revisions of the insurance with the given id (the current revision is not
|
|
227
|
+
* included). The returned entities are still encrypted.
|
|
228
|
+
* @summary Get the conflicting revisions of an insurance.
|
|
229
|
+
* @param entityId the id of the insurance to retrieve the conflicts for.
|
|
230
|
+
* @return the conflicting revisions of the insurance.
|
|
231
|
+
*/
|
|
232
|
+
getConflictsForEntity(entityId) {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
const _url = this.host + `/insurance/conflicts/${encodeURIComponent(String(entityId))}` + '?ts=' + new Date().getTime();
|
|
235
|
+
let headers = this.headers;
|
|
236
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
237
|
+
.then((doc) => doc.body.map((it) => new Insurance_1.Insurance(it)))
|
|
238
|
+
.catch((err) => this.handleError(err));
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Resolves a conflict by declaring which revision of the insurance should be kept as winner and which
|
|
243
|
+
* conflicting revisions should be purged. The provided document must already be encrypted.
|
|
244
|
+
* @summary Declare the winning revision of a conflicting insurance.
|
|
245
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
246
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
247
|
+
*/
|
|
248
|
+
declareConflictWinner(body) {
|
|
249
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
250
|
+
const _url = this.host + `/insurance/conflicts/winner` + '?ts=' + new Date().getTime();
|
|
251
|
+
let headers = this.headers;
|
|
252
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
253
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
254
|
+
.then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new Insurance_1.Insurance(x)))
|
|
255
|
+
.catch((err) => this.handleError(err));
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id.
|
|
260
|
+
* @summary List the ids of the insurances that have conflicts, in the given group.
|
|
261
|
+
* @param groupId the id of the group to look into.
|
|
262
|
+
* @return the ids of the insurances with unresolved conflicts in the group.
|
|
263
|
+
*/
|
|
264
|
+
getConflictingEntitiesIdsInGroup(groupId) {
|
|
265
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/conflicts` + '?ts=' + new Date().getTime();
|
|
267
|
+
let headers = this.headers;
|
|
268
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
269
|
+
.then((doc) => doc.body)
|
|
270
|
+
.catch((err) => this.handleError(err));
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Like {@link getConflictsForEntity} but targets the entity of the group with the given id.
|
|
275
|
+
* @summary Get the conflicting revisions of an insurance, in the given group.
|
|
276
|
+
* @param groupId the id of the group the insurance belongs to.
|
|
277
|
+
* @param entityId the id of the insurance to retrieve the conflicts for.
|
|
278
|
+
* @return the conflicting revisions of the insurance.
|
|
279
|
+
*/
|
|
280
|
+
getConflictsForEntityInGroup(groupId, entityId) {
|
|
281
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
282
|
+
const _url = this.host +
|
|
283
|
+
`/insurance/inGroup/${encodeURIComponent(String(groupId))}/conflicts/${encodeURIComponent(String(entityId))}` +
|
|
284
|
+
'?ts=' +
|
|
285
|
+
new Date().getTime();
|
|
286
|
+
let headers = this.headers;
|
|
287
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
288
|
+
.then((doc) => doc.body.map((it) => new Insurance_1.Insurance(it)))
|
|
289
|
+
.catch((err) => this.handleError(err));
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Like {@link declareConflictWinner} but targets the entity of the group with the given id.
|
|
294
|
+
* @summary Declare the winning revision of a conflicting insurance, in the given group.
|
|
295
|
+
* @param groupId the id of the group the insurance belongs to.
|
|
296
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
297
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
298
|
+
*/
|
|
299
|
+
declareConflictWinnerInGroup(groupId, body) {
|
|
300
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/conflicts/winner` + '?ts=' + new Date().getTime();
|
|
302
|
+
let headers = this.headers;
|
|
303
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
304
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
305
|
+
.then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new Insurance_1.Insurance(x)))
|
|
306
|
+
.catch((err) => this.handleError(err));
|
|
307
|
+
});
|
|
308
|
+
}
|
|
209
309
|
}
|
|
210
310
|
exports.IccInsuranceApi = IccInsuranceApi;
|
|
211
311
|
//# sourceMappingURL=IccInsuranceApi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IccInsuranceApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccInsuranceApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,kDAA8C;AAC9C,wFAA8G;AAC9G,qDAAiD;AACjD,4EAAwE;AACxE,kDAA8C;AAI9C,MAAa,eAAe;IAM1B,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,CAA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E,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;iBACxL,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,eAAe,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;iBAClK,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AA1MD,0CA0MC","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 { ListOfIds } from '../model/ListOfIds'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { PaginatedListInsurance } from '../model/PaginatedListInsurance'\nimport { Insurance } from \"../model/Insurance\"\nimport {AbstractFilterInsurance} from \"../model/AbstractFilterInsurance\"\nimport { TimingInfo } from '../model/TimingInfo'\n\nexport class IccInsuranceApi {\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 *\n * @summary Creates an insurance\n * @param body\n */\n async createInsurance(body?: Insurance): Promise<Insurance> {\n const _url = this.host + `/insurance` + '?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 Insurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Deletes an insurance\n * @param insuranceId\n */\n async deleteInsurance(insuranceId: string): Promise<DocIdentifier> {\n let _body = null\n\n const _url = this.host + `/insurance/${encodeURIComponent(insuranceId)}` + '?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) => new DocIdentifier(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets an insurance\n * @param insuranceId\n */\n async getInsurance(insuranceId: string): Promise<Insurance> {\n let _body = null\n\n const _url = this.host + `/insurance/${encodeURIComponent(String(insuranceId))}` + '?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 Insurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets insurances by id\n * @param body\n */\n async getInsurances(body?: ListOfIds): Promise<Array<Insurance>> {\n const _url = this.host + `/insurance/byIds` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets an insurance\n * @param insuranceCode\n */\n async listInsurancesByCode(insuranceCode: string): Promise<Array<Insurance>> {\n let _body = null\n\n const _url = this.host + `/insurance/byCode/${encodeURIComponent(String(insuranceCode))}` + '?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 Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets an insurance\n * @param insuranceName\n */\n async listInsurancesByName(insuranceName: string): Promise<Array<Insurance>> {\n let _body = null\n\n const _url = this.host + `/insurance/byName/${encodeURIComponent(String(insuranceName))}` + '?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 Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Modifies an insurance\n * @param body\n */\n async modifyInsurance(body?: Insurance): Promise<Insurance> {\n const _url = this.host + `/insurance` + '?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 Insurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n getAllInsurances(startDocumentId?: string, limit?: number): Promise<PaginatedListInsurance> {\n let _body = null\n\n const _url =\n this.host +\n `/insurance?ts=` +\n new Date().getTime() +\n (!!startDocumentId ? `&startDocumentId=${encodeURIComponent(startDocumentId)}` : '') +\n (!!limit ? `&limit=${encodeURIComponent(limit)}` : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListInsurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n modifyInsurancesInGroup(groupId: string, insurances?: Array<Insurance>): Promise<Array<Insurance>> {\n let _body = null\n _body = insurances\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/batch` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n createInsurancesInGroup(groupId: string, insurances?: Array<Insurance>): Promise<Array<Insurance>> {\n let _body = null\n _body = insurances\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/batch` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get a list of insurances by ids/keys.\n * @summary Gets a list of insurances by ids\n * @param insuranceIds\n */\n async getInsurancesInGroup(groupId: string, insuranceIds: string[]): Promise<Array<Insurance>> {\n const body = new ListOfIds({ ids: insuranceIds })\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/byIds` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of code matching the provided filter for the current user (HcParty)\n * @param body\n * @param collectTiming if true, include server-side filter timing information in the response\n */\n matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming?: false): Promise<Array<string>>\n matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming?: true): Promise<Array<string> & TimingInfo>\n async matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming: boolean = false): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/match` + '?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(), undefined, false, collectTiming ? ['x-filter-timing-*'] : [])\n .then((doc) => Object.assign((doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))), collectTiming ? { responseHeaders: doc.responseHeaders } : {}))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"IccInsuranceApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccInsuranceApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,kDAA8C;AAC9C,wFAA8G;AAC9G,qDAAiD;AACjD,4EAAwE;AACxE,kDAA8C;AAI9C,gFAA4E;AAE5E,MAAa,eAAe;IAM1B,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEz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,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;iBACzH,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,mDAAwB,CAAY,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,qBAAS,CAAC,CAAC,CAAC,CAAC,CAAC;iBACzF,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AAxTD,0CAwTC","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 { ListOfIds } from '../model/ListOfIds'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { PaginatedListInsurance } from '../model/PaginatedListInsurance'\nimport { Insurance } from '../model/Insurance'\nimport { AbstractFilterInsurance } from '../model/AbstractFilterInsurance'\nimport { TimingInfo } from '../model/TimingInfo'\nimport { ConflictResolutionRequest } from '../model/ConflictResolutionRequest'\nimport { ConflictResolutionResult } from '../model/ConflictResolutionResult'\n\nexport class IccInsuranceApi {\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 *\n * @summary Creates an insurance\n * @param body\n */\n async createInsurance(body?: Insurance): Promise<Insurance> {\n const _url = this.host + `/insurance` + '?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 Insurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Deletes an insurance\n * @param insuranceId\n */\n async deleteInsurance(insuranceId: string): Promise<DocIdentifier> {\n let _body = null\n\n const _url = this.host + `/insurance/${encodeURIComponent(insuranceId)}` + '?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) => new DocIdentifier(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets an insurance\n * @param insuranceId\n */\n async getInsurance(insuranceId: string): Promise<Insurance> {\n let _body = null\n\n const _url = this.host + `/insurance/${encodeURIComponent(String(insuranceId))}` + '?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 Insurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets insurances by id\n * @param body\n */\n async getInsurances(body?: ListOfIds): Promise<Array<Insurance>> {\n const _url = this.host + `/insurance/byIds` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets an insurance\n * @param insuranceCode\n */\n async listInsurancesByCode(insuranceCode: string): Promise<Array<Insurance>> {\n let _body = null\n\n const _url = this.host + `/insurance/byCode/${encodeURIComponent(String(insuranceCode))}` + '?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 Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets an insurance\n * @param insuranceName\n */\n async listInsurancesByName(insuranceName: string): Promise<Array<Insurance>> {\n let _body = null\n\n const _url = this.host + `/insurance/byName/${encodeURIComponent(String(insuranceName))}` + '?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 Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Modifies an insurance\n * @param body\n */\n async modifyInsurance(body?: Insurance): Promise<Insurance> {\n const _url = this.host + `/insurance` + '?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 Insurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n getAllInsurances(startDocumentId?: string, limit?: number): Promise<PaginatedListInsurance> {\n let _body = null\n\n const _url =\n this.host +\n `/insurance?ts=` +\n new Date().getTime() +\n (!!startDocumentId ? `&startDocumentId=${encodeURIComponent(startDocumentId)}` : '') +\n (!!limit ? `&limit=${encodeURIComponent(limit)}` : '')\n let headers = this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new PaginatedListInsurance(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n modifyInsurancesInGroup(groupId: string, insurances?: Array<Insurance>): Promise<Array<Insurance>> {\n let _body = null\n _body = insurances\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/batch` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n createInsurancesInGroup(groupId: string, insurances?: Array<Insurance>): Promise<Array<Insurance>> {\n let _body = null\n _body = insurances\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/batch` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Get a list of insurances by ids/keys.\n * @summary Gets a list of insurances by ids\n * @param insuranceIds\n */\n async getInsurancesInGroup(groupId: string, insuranceIds: string[]): Promise<Array<Insurance>> {\n const body = new ListOfIds({ ids: insuranceIds })\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/byIds` + '?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) => (doc.body as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of code matching the provided filter for the current user (HcParty)\n * @param body\n * @param collectTiming if true, include server-side filter timing information in the response\n */\n matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming?: false): Promise<Array<string>>\n matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming?: true): Promise<Array<string> & TimingInfo>\n async matchInsurancesByInGroup(groupId: string, body?: AbstractFilterInsurance, collectTiming: boolean = false): Promise<Array<string>> {\n let _body = null\n _body = body\n\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/match` + '?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(\n 'POST',\n _url,\n headers,\n _body,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService(),\n undefined,\n false,\n collectTiming ? ['x-filter-timing-*'] : []\n )\n .then((doc) =>\n Object.assign(\n (doc.body as Array<JSON>).map((it) => JSON.parse(JSON.stringify(it))),\n collectTiming ? { responseHeaders: doc.responseHeaders } : {}\n )\n )\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Retrieves the ids of all the insurances that currently have conflicting revisions and therefore need to\n * be resolved.\n * @summary List the ids of the insurances that have conflicts.\n * @return the ids of the insurances with unresolved conflicts.\n */\n async getConflictingEntitiesIds(): Promise<Array<string>> {\n const _url = this.host + `/insurance/conflicts` + '?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<string>)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Retrieves all the conflicting revisions of the insurance with the given id (the current revision is not\n * included). The returned entities are still encrypted.\n * @summary Get the conflicting revisions of an insurance.\n * @param entityId the id of the insurance to retrieve the conflicts for.\n * @return the conflicting revisions of the insurance.\n */\n async getConflictsForEntity(entityId: string): Promise<Array<Insurance>> {\n const _url = this.host + `/insurance/conflicts/${encodeURIComponent(String(entityId))}` + '?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 Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Resolves a conflict by declaring which revision of the insurance should be kept as winner and which\n * conflicting revisions should be purged. The provided document must already be encrypted.\n * @summary Declare the winning revision of a conflicting insurance.\n * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.\n * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.\n */\n async declareConflictWinner(body: ConflictResolutionRequest<Insurance>): Promise<ConflictResolutionResult<Insurance>> {\n const _url = this.host + `/insurance/conflicts/winner` + '?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 ConflictResolutionResult<Insurance>(doc.body, (x) => new Insurance(x)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id.\n * @summary List the ids of the insurances that have conflicts, in the given group.\n * @param groupId the id of the group to look into.\n * @return the ids of the insurances with unresolved conflicts in the group.\n */\n async getConflictingEntitiesIdsInGroup(groupId: string): Promise<Array<string>> {\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/conflicts` + '?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<string>)\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Like {@link getConflictsForEntity} but targets the entity of the group with the given id.\n * @summary Get the conflicting revisions of an insurance, in the given group.\n * @param groupId the id of the group the insurance belongs to.\n * @param entityId the id of the insurance to retrieve the conflicts for.\n * @return the conflicting revisions of the insurance.\n */\n async getConflictsForEntityInGroup(groupId: string, entityId: string): Promise<Array<Insurance>> {\n const _url =\n this.host +\n `/insurance/inGroup/${encodeURIComponent(String(groupId))}/conflicts/${encodeURIComponent(String(entityId))}` +\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 as Array<JSON>).map((it) => new Insurance(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Like {@link declareConflictWinner} but targets the entity of the group with the given id.\n * @summary Declare the winning revision of a conflicting insurance, in the given group.\n * @param groupId the id of the group the insurance belongs to.\n * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.\n * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.\n */\n async declareConflictWinnerInGroup(groupId: string, body: ConflictResolutionRequest<Insurance>): Promise<ConflictResolutionResult<Insurance>> {\n const _url = this.host + `/insurance/inGroup/${encodeURIComponent(String(groupId))}/conflicts/winner` + '?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 ConflictResolutionResult<Insurance>(doc.body, (x) => new Insurance(x)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
|
|
@@ -23,6 +23,8 @@ import { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult';
|
|
|
23
23
|
import { MinimalEntityBulkShareResult } from '../model/requests/MinimalEntityBulkShareResult';
|
|
24
24
|
import { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams';
|
|
25
25
|
import { TimingInfo } from '../model/TimingInfo';
|
|
26
|
+
import { ConflictResolutionRequest } from '../model/ConflictResolutionRequest';
|
|
27
|
+
import { ConflictResolutionResult } from '../model/ConflictResolutionResult';
|
|
26
28
|
export declare class IccInvoiceApi {
|
|
27
29
|
host: string;
|
|
28
30
|
_headers: Array<XHR.Header>;
|
|
@@ -286,4 +288,50 @@ export declare class IccInvoiceApi {
|
|
|
286
288
|
* @internal this method is for internal use only and may be changed without notice
|
|
287
289
|
*/
|
|
288
290
|
bulkShareInvoicesMinimal(request: BulkShareOrUpdateMetadataParams): Promise<MinimalEntityBulkShareResult[]>;
|
|
291
|
+
/**
|
|
292
|
+
* Retrieves the ids of all the invoices that currently have conflicting revisions and therefore need to
|
|
293
|
+
* be resolved.
|
|
294
|
+
* @summary List the ids of the invoices that have conflicts.
|
|
295
|
+
* @return the ids of the invoices with unresolved conflicts.
|
|
296
|
+
*/
|
|
297
|
+
getConflictingEntitiesIds(): Promise<Array<string>>;
|
|
298
|
+
/**
|
|
299
|
+
* Retrieves all the conflicting revisions of the invoice with the given id (the current revision is not
|
|
300
|
+
* included). The returned entities are still encrypted.
|
|
301
|
+
* @summary Get the conflicting revisions of an invoice.
|
|
302
|
+
* @param entityId the id of the invoice to retrieve the conflicts for.
|
|
303
|
+
* @return the conflicting revisions of the invoice.
|
|
304
|
+
*/
|
|
305
|
+
getConflictsForEntity(entityId: string): Promise<Array<Invoice>>;
|
|
306
|
+
/**
|
|
307
|
+
* Resolves a conflict by declaring which revision of the invoice should be kept as winner and which
|
|
308
|
+
* conflicting revisions should be purged. The provided document must already be encrypted.
|
|
309
|
+
* @summary Declare the winning revision of a conflicting invoice.
|
|
310
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
311
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
312
|
+
*/
|
|
313
|
+
declareConflictWinner(body: ConflictResolutionRequest<Invoice>): Promise<ConflictResolutionResult<Invoice>>;
|
|
314
|
+
/**
|
|
315
|
+
* Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id.
|
|
316
|
+
* @summary List the ids of the invoices that have conflicts, in the given group.
|
|
317
|
+
* @param groupId the id of the group to look into.
|
|
318
|
+
* @return the ids of the invoices with unresolved conflicts in the group.
|
|
319
|
+
*/
|
|
320
|
+
getConflictingEntitiesIdsInGroup(groupId: string): Promise<Array<string>>;
|
|
321
|
+
/**
|
|
322
|
+
* Like {@link getConflictsForEntity} but targets the entity of the group with the given id.
|
|
323
|
+
* @summary Get the conflicting revisions of an invoice, in the given group.
|
|
324
|
+
* @param groupId the id of the group the invoice belongs to.
|
|
325
|
+
* @param entityId the id of the invoice to retrieve the conflicts for.
|
|
326
|
+
* @return the conflicting revisions of the invoice.
|
|
327
|
+
*/
|
|
328
|
+
getConflictsForEntityInGroup(groupId: string, entityId: string): Promise<Array<Invoice>>;
|
|
329
|
+
/**
|
|
330
|
+
* Like {@link declareConflictWinner} but targets the entity of the group with the given id.
|
|
331
|
+
* @summary Declare the winning revision of a conflicting invoice, in the given group.
|
|
332
|
+
* @param groupId the id of the group the invoice belongs to.
|
|
333
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
334
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
335
|
+
*/
|
|
336
|
+
declareConflictWinnerInGroup(groupId: string, body: ConflictResolutionRequest<Invoice>): Promise<ConflictResolutionResult<Invoice>>;
|
|
289
337
|
}
|
|
@@ -32,6 +32,7 @@ const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationPro
|
|
|
32
32
|
const IccRestApiPath_1 = require("./IccRestApiPath");
|
|
33
33
|
const EntityBulkShareResult_1 = require("../model/requests/EntityBulkShareResult");
|
|
34
34
|
const MinimalEntityBulkShareResult_1 = require("../model/requests/MinimalEntityBulkShareResult");
|
|
35
|
+
const ConflictResolutionResult_1 = require("../model/ConflictResolutionResult");
|
|
35
36
|
class IccInvoiceApi {
|
|
36
37
|
get headers() {
|
|
37
38
|
return Promise.resolve(this._headers);
|
|
@@ -715,6 +716,105 @@ class IccInvoiceApi {
|
|
|
715
716
|
.catch((err) => this.handleError(err));
|
|
716
717
|
});
|
|
717
718
|
}
|
|
719
|
+
/**
|
|
720
|
+
* Retrieves the ids of all the invoices that currently have conflicting revisions and therefore need to
|
|
721
|
+
* be resolved.
|
|
722
|
+
* @summary List the ids of the invoices that have conflicts.
|
|
723
|
+
* @return the ids of the invoices with unresolved conflicts.
|
|
724
|
+
*/
|
|
725
|
+
getConflictingEntitiesIds() {
|
|
726
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
727
|
+
const _url = this.host + `/invoice/conflicts` + '?ts=' + new Date().getTime();
|
|
728
|
+
let headers = yield this.headers;
|
|
729
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
730
|
+
.then((doc) => doc.body)
|
|
731
|
+
.catch((err) => this.handleError(err));
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Retrieves all the conflicting revisions of the invoice with the given id (the current revision is not
|
|
736
|
+
* included). The returned entities are still encrypted.
|
|
737
|
+
* @summary Get the conflicting revisions of an invoice.
|
|
738
|
+
* @param entityId the id of the invoice to retrieve the conflicts for.
|
|
739
|
+
* @return the conflicting revisions of the invoice.
|
|
740
|
+
*/
|
|
741
|
+
getConflictsForEntity(entityId) {
|
|
742
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
743
|
+
const _url = this.host + `/invoice/conflicts/${encodeURIComponent(String(entityId))}` + '?ts=' + new Date().getTime();
|
|
744
|
+
let headers = yield this.headers;
|
|
745
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
746
|
+
.then((doc) => doc.body.map((it) => new Invoice_1.Invoice(it)))
|
|
747
|
+
.catch((err) => this.handleError(err));
|
|
748
|
+
});
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Resolves a conflict by declaring which revision of the invoice should be kept as winner and which
|
|
752
|
+
* conflicting revisions should be purged. The provided document must already be encrypted.
|
|
753
|
+
* @summary Declare the winning revision of a conflicting invoice.
|
|
754
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
755
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
756
|
+
*/
|
|
757
|
+
declareConflictWinner(body) {
|
|
758
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
759
|
+
const _url = this.host + `/invoice/conflicts/winner` + '?ts=' + new Date().getTime();
|
|
760
|
+
let headers = yield this.headers;
|
|
761
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
762
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
763
|
+
.then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new Invoice_1.Invoice(x)))
|
|
764
|
+
.catch((err) => this.handleError(err));
|
|
765
|
+
});
|
|
766
|
+
}
|
|
767
|
+
/**
|
|
768
|
+
* Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id.
|
|
769
|
+
* @summary List the ids of the invoices that have conflicts, in the given group.
|
|
770
|
+
* @param groupId the id of the group to look into.
|
|
771
|
+
* @return the ids of the invoices with unresolved conflicts in the group.
|
|
772
|
+
*/
|
|
773
|
+
getConflictingEntitiesIdsInGroup(groupId) {
|
|
774
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
775
|
+
const _url = this.host + `/invoice/inGroup/${encodeURIComponent(String(groupId))}/conflicts` + '?ts=' + new Date().getTime();
|
|
776
|
+
let headers = yield this.headers;
|
|
777
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
778
|
+
.then((doc) => doc.body)
|
|
779
|
+
.catch((err) => this.handleError(err));
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Like {@link getConflictsForEntity} but targets the entity of the group with the given id.
|
|
784
|
+
* @summary Get the conflicting revisions of an invoice, in the given group.
|
|
785
|
+
* @param groupId the id of the group the invoice belongs to.
|
|
786
|
+
* @param entityId the id of the invoice to retrieve the conflicts for.
|
|
787
|
+
* @return the conflicting revisions of the invoice.
|
|
788
|
+
*/
|
|
789
|
+
getConflictsForEntityInGroup(groupId, entityId) {
|
|
790
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
791
|
+
const _url = this.host +
|
|
792
|
+
`/invoice/inGroup/${encodeURIComponent(String(groupId))}/conflicts/${encodeURIComponent(String(entityId))}` +
|
|
793
|
+
'?ts=' +
|
|
794
|
+
new Date().getTime();
|
|
795
|
+
let headers = yield this.headers;
|
|
796
|
+
return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
797
|
+
.then((doc) => doc.body.map((it) => new Invoice_1.Invoice(it)))
|
|
798
|
+
.catch((err) => this.handleError(err));
|
|
799
|
+
});
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* Like {@link declareConflictWinner} but targets the entity of the group with the given id.
|
|
803
|
+
* @summary Declare the winning revision of a conflicting invoice, in the given group.
|
|
804
|
+
* @param groupId the id of the group the invoice belongs to.
|
|
805
|
+
* @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
|
|
806
|
+
* @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
|
|
807
|
+
*/
|
|
808
|
+
declareConflictWinnerInGroup(groupId, body) {
|
|
809
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
810
|
+
const _url = this.host + `/invoice/inGroup/${encodeURIComponent(String(groupId))}/conflicts/winner` + '?ts=' + new Date().getTime();
|
|
811
|
+
let headers = yield this.headers;
|
|
812
|
+
headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
|
|
813
|
+
return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
|
|
814
|
+
.then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new Invoice_1.Invoice(x)))
|
|
815
|
+
.catch((err) => this.handleError(err));
|
|
816
|
+
});
|
|
817
|
+
}
|
|
718
818
|
}
|
|
719
819
|
exports.IccInvoiceApi = IccInvoiceApi;
|
|
720
820
|
//# sourceMappingURL=IccInvoiceApi.js.map
|