@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.
Files changed (100) hide show
  1. package/icc-api/api/IccAccesslogApi.d.ts +48 -0
  2. package/icc-api/api/IccAccesslogApi.js +100 -0
  3. package/icc-api/api/IccAccesslogApi.js.map +1 -1
  4. package/icc-api/api/IccAgendaApi.d.ts +25 -0
  5. package/icc-api/api/IccAgendaApi.js +49 -0
  6. package/icc-api/api/IccAgendaApi.js.map +1 -1
  7. package/icc-api/api/IccCalendarItemApi.d.ts +25 -0
  8. package/icc-api/api/IccCalendarItemApi.js +49 -0
  9. package/icc-api/api/IccCalendarItemApi.js.map +1 -1
  10. package/icc-api/api/IccCalendarItemTypeApi.d.ts +25 -0
  11. package/icc-api/api/IccCalendarItemTypeApi.js +49 -0
  12. package/icc-api/api/IccCalendarItemTypeApi.js.map +1 -1
  13. package/icc-api/api/IccCodeApi.d.ts +25 -0
  14. package/icc-api/api/IccCodeApi.js +49 -0
  15. package/icc-api/api/IccCodeApi.js.map +1 -1
  16. package/icc-api/api/IccContactApi.d.ts +48 -0
  17. package/icc-api/api/IccContactApi.js +100 -0
  18. package/icc-api/api/IccContactApi.js.map +1 -1
  19. package/icc-api/api/IccDeviceApi.d.ts +48 -0
  20. package/icc-api/api/IccDeviceApi.js +100 -0
  21. package/icc-api/api/IccDeviceApi.js.map +1 -1
  22. package/icc-api/api/IccDocumentApi.d.ts +48 -0
  23. package/icc-api/api/IccDocumentApi.js +100 -0
  24. package/icc-api/api/IccDocumentApi.js.map +1 -1
  25. package/icc-api/api/IccFormApi.d.ts +48 -0
  26. package/icc-api/api/IccFormApi.js +101 -4
  27. package/icc-api/api/IccFormApi.js.map +1 -1
  28. package/icc-api/api/IccHcpartyApi.d.ts +48 -0
  29. package/icc-api/api/IccHcpartyApi.js +100 -0
  30. package/icc-api/api/IccHcpartyApi.js.map +1 -1
  31. package/icc-api/api/IccHelementApi.d.ts +48 -0
  32. package/icc-api/api/IccHelementApi.js +100 -0
  33. package/icc-api/api/IccHelementApi.js.map +1 -1
  34. package/icc-api/api/IccInsuranceApi.d.ts +50 -2
  35. package/icc-api/api/IccInsuranceApi.js +100 -0
  36. package/icc-api/api/IccInsuranceApi.js.map +1 -1
  37. package/icc-api/api/IccInvoiceApi.d.ts +48 -0
  38. package/icc-api/api/IccInvoiceApi.js +100 -0
  39. package/icc-api/api/IccInvoiceApi.js.map +1 -1
  40. package/icc-api/api/IccMessageApi.d.ts +48 -0
  41. package/icc-api/api/IccMessageApi.js +100 -0
  42. package/icc-api/api/IccMessageApi.js.map +1 -1
  43. package/icc-api/api/IccPatientApi.d.ts +48 -0
  44. package/icc-api/api/IccPatientApi.js +100 -0
  45. package/icc-api/api/IccPatientApi.js.map +1 -1
  46. package/icc-api/api/IccPlaceApi.d.ts +25 -0
  47. package/icc-api/api/IccPlaceApi.js +49 -0
  48. package/icc-api/api/IccPlaceApi.js.map +1 -1
  49. package/icc-api/api/IccReceiptApi.d.ts +25 -0
  50. package/icc-api/api/IccReceiptApi.js +49 -0
  51. package/icc-api/api/IccReceiptApi.js.map +1 -1
  52. package/icc-api/api/IccTopicApi.d.ts +48 -0
  53. package/icc-api/api/IccTopicApi.js +100 -0
  54. package/icc-api/api/IccTopicApi.js.map +1 -1
  55. package/icc-api/api/IccUserApi.d.ts +25 -0
  56. package/icc-api/api/IccUserApi.js +49 -0
  57. package/icc-api/api/IccUserApi.js.map +1 -1
  58. package/icc-api/model/ConflictResolutionRequest.d.ts +18 -0
  59. package/icc-api/model/ConflictResolutionRequest.js +17 -0
  60. package/icc-api/model/ConflictResolutionRequest.js.map +1 -0
  61. package/icc-api/model/ConflictResolutionResult.d.ts +22 -0
  62. package/icc-api/model/ConflictResolutionResult.js +24 -0
  63. package/icc-api/model/ConflictResolutionResult.js.map +1 -0
  64. package/icc-api/model/models.d.ts +2 -0
  65. package/icc-api/model/models.js +2 -0
  66. package/icc-api/model/models.js.map +1 -1
  67. package/icc-x-api/icc-accesslog-x-api.d.ts +31 -0
  68. package/icc-x-api/icc-accesslog-x-api.js +57 -0
  69. package/icc-x-api/icc-accesslog-x-api.js.map +1 -1
  70. package/icc-x-api/icc-calendar-item-x-api.d.ts +15 -0
  71. package/icc-x-api/icc-calendar-item-x-api.js +28 -0
  72. package/icc-x-api/icc-calendar-item-x-api.js.map +1 -1
  73. package/icc-x-api/icc-contact-x-api.d.ts +31 -0
  74. package/icc-x-api/icc-contact-x-api.js +60 -1
  75. package/icc-x-api/icc-contact-x-api.js.map +1 -1
  76. package/icc-x-api/icc-document-x-api.d.ts +31 -0
  77. package/icc-x-api/icc-document-x-api.js +64 -0
  78. package/icc-x-api/icc-document-x-api.js.map +1 -1
  79. package/icc-x-api/icc-form-x-api.d.ts +31 -0
  80. package/icc-x-api/icc-form-x-api.js +58 -0
  81. package/icc-x-api/icc-form-x-api.js.map +1 -1
  82. package/icc-x-api/icc-helement-x-api.d.ts +31 -0
  83. package/icc-x-api/icc-helement-x-api.js +57 -0
  84. package/icc-x-api/icc-helement-x-api.js.map +1 -1
  85. package/icc-x-api/icc-invoice-x-api.d.ts +31 -0
  86. package/icc-x-api/icc-invoice-x-api.js +58 -0
  87. package/icc-x-api/icc-invoice-x-api.js.map +1 -1
  88. package/icc-x-api/icc-message-x-api.d.ts +31 -0
  89. package/icc-x-api/icc-message-x-api.js +64 -0
  90. package/icc-x-api/icc-message-x-api.js.map +1 -1
  91. package/icc-x-api/icc-patient-x-api.d.ts +31 -0
  92. package/icc-x-api/icc-patient-x-api.js +57 -0
  93. package/icc-x-api/icc-patient-x-api.js.map +1 -1
  94. package/icc-x-api/icc-topic-x-api.d.ts +31 -0
  95. package/icc-x-api/icc-topic-x-api.js +58 -0
  96. package/icc-x-api/icc-topic-x-api.js.map +1 -1
  97. package/icc-x-api/utils/formatting-util.d.ts +10 -4
  98. package/icc-x-api/utils/formatting-util.js +47 -6
  99. package/icc-x-api/utils/formatting-util.js.map +1 -1
  100. package/package.json +1 -1
@@ -27,6 +27,7 @@ const Receipt_1 = require("../model/Receipt");
27
27
  const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
28
28
  const IccRestApiPath_1 = require("./IccRestApiPath");
29
29
  const EntityBulkShareResult_1 = require("../model/requests/EntityBulkShareResult");
30
+ const ConflictResolutionResult_1 = require("../model/ConflictResolutionResult");
30
31
  class IccReceiptApi {
31
32
  get headers() {
32
33
  return Promise.resolve(this._headers);
@@ -259,6 +260,54 @@ class IccReceiptApi {
259
260
  .catch((err) => this.handleError(err));
260
261
  });
261
262
  }
263
+ /**
264
+ * Retrieves the ids of all the receipts that currently have conflicting revisions and therefore need to
265
+ * be resolved.
266
+ * @summary List the ids of the receipts that have conflicts.
267
+ * @return the ids of the receipts with unresolved conflicts.
268
+ */
269
+ getConflictingEntitiesIds() {
270
+ return __awaiter(this, void 0, void 0, function* () {
271
+ const _url = this.host + `/receipt/conflicts` + '?ts=' + new Date().getTime();
272
+ let headers = yield this.headers;
273
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
274
+ .then((doc) => doc.body)
275
+ .catch((err) => this.handleError(err));
276
+ });
277
+ }
278
+ /**
279
+ * Retrieves all the conflicting revisions of the receipt with the given id (the current revision is not
280
+ * included). The returned entities are still encrypted.
281
+ * @summary Get the conflicting revisions of a receipt.
282
+ * @param entityId the id of the receipt to retrieve the conflicts for.
283
+ * @return the conflicting revisions of the receipt.
284
+ */
285
+ getConflictsForEntity(entityId) {
286
+ return __awaiter(this, void 0, void 0, function* () {
287
+ const _url = this.host + `/receipt/conflicts/${encodeURIComponent(String(entityId))}` + '?ts=' + new Date().getTime();
288
+ let headers = yield this.headers;
289
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
290
+ .then((doc) => doc.body.map((it) => new Receipt_1.Receipt(it)))
291
+ .catch((err) => this.handleError(err));
292
+ });
293
+ }
294
+ /**
295
+ * Resolves a conflict by declaring which revision of the receipt should be kept as winner and which
296
+ * conflicting revisions should be purged. The provided document must already be encrypted.
297
+ * @summary Declare the winning revision of a conflicting receipt.
298
+ * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
299
+ * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
300
+ */
301
+ declareConflictWinner(body) {
302
+ return __awaiter(this, void 0, void 0, function* () {
303
+ const _url = this.host + `/receipt/conflicts/winner` + '?ts=' + new Date().getTime();
304
+ let headers = yield this.headers;
305
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
306
+ return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
307
+ .then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new Receipt_1.Receipt(x)))
308
+ .catch((err) => this.handleError(err));
309
+ });
310
+ }
262
311
  }
263
312
  exports.IccReceiptApi = IccReceiptApi;
264
313
  //# sourceMappingURL=IccReceiptApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IccReceiptApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccReceiptApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,8CAA0C;AAC1C,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAI/E,MAAa,aAAa;IAMxB,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;IAED,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,C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AAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAA;YACvH,OAAO,SAAG,CAAC,WAAW,CAAC,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,CAAC;iBAC3H,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAE,GAAG,CAAC,IAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,6CAAqB,CAAU,CAAC,EAAE,iBAAO,CAAC,CAAC,CAAC;iBACnG,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AA1QD,sCA0QC","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 { Receipt } from '../model/Receipt'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\n\nexport class IccReceiptApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\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 a receipt\n * @param body\n */\n async createReceipt(body?: Receipt): Promise<Receipt> {\n const _url = this.host + `/receipt` + '?ts=' + new Date().getTime()\n let headers = await 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 Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of receipts.\n *\n * @param receiptIds a ListOfIds containing the ids of the receipts to delete.\n * @return a Promise that will resolve in an array of DocIdentifiers of the successfully deleted receipts.\n */\n async deleteReceipts(receiptIds: ListOfIds): Promise<Array<DocIdentifier>> {\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand(\n 'POST',\n this.host + `/receipt/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n receiptIds,\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 * @summary Deletes a single receipt by id.\n *\n * @param receiptId the id of the receipt to delete.\n * @return a Promise that will resolve in the DocIdentifier of the deleted receipt.\n */\n async deleteReceipt(receiptId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/receipt/${encodeURIComponent(receiptId)}` + '?ts=' + new Date().getTime(),\n await this.headers,\n null,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets a receipt\n * @param receiptId\n */\n async getReceipt(receiptId: string): Promise<Receipt> {\n let _body = null\n\n const _url = this.host + `/receipt/${encodeURIComponent(String(receiptId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get an attachment\n * @param receiptId\n * @param attachmentId\n * @param enckeys\n */\n async getReceiptAttachment(receiptId: string, attachmentId: string, enckeys?: null): Promise<ArrayBuffer> {\n if (enckeys) {\n throw new Error('Server-side encryption is not supported anymore.')\n }\n let _body = null\n\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/attachment/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = await 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 receipt\n * @param ref\n */\n async listByReference(ref: string): Promise<Array<Receipt>> {\n let _body = null\n\n const _url = this.host + `/receipt/byRef/${encodeURIComponent(String(ref))}` + '?ts=' + new Date().getTime()\n let headers = await 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 Receipt(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Updates a receipt\n * @param body\n */\n async modifyReceipt(body?: Receipt): Promise<Receipt> {\n let _body = null\n _body = body\n\n const _url = this.host + `/receipt` + '?ts=' + new Date().getTime()\n let headers = await 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 Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use setReceiptAttachmentForBlobType instead\n */\n async setReceiptAttachment(receiptId: string, receiptRev: string, blobType: string, enckeys?: null, body?: ArrayBuffer): Promise<Receipt> {\n if (enckeys) {\n throw new Error('Server-side encryption is not supported anymore.')\n }\n if (!body) {\n throw new Error('Attachment content is requred')\n }\n return this.setReceiptAttachmentForBlobType(receiptId, receiptRev, blobType, body)\n }\n\n /**\n * @summary Creates a receipt's attachment\n * @param receiptId id of a receipt\n * @param receiptRev rev of the receipt\n * @param blobType receipt blob type\n * @param body content of the attachment, already encrypted\n */\n async setReceiptAttachmentForBlobType(receiptId: string, receiptRev: string, blobType: string, body: ArrayBuffer): Promise<Receipt> {\n if (!receiptRev) throw new Error('Receipt rev is required')\n\n let _body = body\n\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/attachment/${encodeURIComponent(String(blobType))}` +\n '?ts=' +\n new Date().getTime() +\n '&rev=' +\n receiptRev\n let headers = await 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 Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Creates a receipt's data attachment with compression metadata\n * @param receiptId id of a receipt\n * @param blobType receipt blob type\n * @param rev revision of the receipt\n * @param body content of the attachment\n * @param compressionAlgorithm the compression algorithm used on the client side, if any\n * @param triedCompressionAlgorithmsVersion a version string for the compression algorithms tried\n * @param realDataSize the real size of the data after decryption and decompression\n */\n async setReceiptDataAttachment(\n receiptId: string,\n blobType: string,\n rev: string,\n body: ArrayBuffer,\n compressionAlgorithm?: string,\n triedCompressionAlgorithmsVersion?: string,\n realDataSize?: number\n ): Promise<Receipt> {\n if (!rev) throw new Error('Receipt rev is required')\n\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/dataattachment/${encodeURIComponent(String(blobType))}` +\n '?ts=' +\n new Date().getTime() +\n '&rev=' +\n encodeURIComponent(String(rev)) +\n (compressionAlgorithm ? '&compressionAlgorithm=' + encodeURIComponent(String(compressionAlgorithm)) : '') +\n (triedCompressionAlgorithmsVersion\n ? '&triedCompressionAlgorithmsVersion=' + encodeURIComponent(String(triedCompressionAlgorithmsVersion))\n : '') +\n (realDataSize != null ? '&realDataSize=' + encodeURIComponent(String(realDataSize)) : '')\n let headers = await this.headers\n headers = headers\n .filter((h) => h.header !== 'Content-Type' && h.header !== 'Content-Length')\n .concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n .concat(new XHR.Header('Content-Length', String(body.byteLength)))\n return XHR.sendCommand('PUT', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Get a receipt's attachment by blob type\n * @param receiptId id of the receipt\n * @param blobType the blob type of the attachment to retrieve\n */\n async getReceiptAttachmentByBlobType(receiptId: string, blobType: string): Promise<ArrayBuffer> {\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/attachment/ofType/${encodeURIComponent(String(blobType))}` +\n '?ts=' +\n new Date().getTime()\n let headers = await 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 * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareReceipt(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Receipt>[]> {\n const _url = this.host + '/receipt/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await 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, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Receipt>(x, Receipt)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
1
+ {"version":3,"file":"IccReceiptApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccReceiptApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,8CAA0C;AAC1C,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAI/E,gFAA4E;AAE5E,MAAa,aAAa;IAMxB,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;IAED,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,QAAQ,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;QAC9E,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,QAAQ,GAAG,CAAC,CAAA;IACnB,CAAC;IAED,WAAW,CAAC,CAAe;QACzB,MAAM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;iBACrE,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;IAED;;;;;;OAMG;IACG,qBAAqB,CAAC,IAAwC;;YAClE,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,2BAA2B,GAAG,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;YACpF,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAA;YAChC,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;YACvH,OAAO,SAAG,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,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,CAAU,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,iBAAO,CAAC,CAAC,CAAC,CAAC,CAAC;iBACrF,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AAvTD,sCAuTC","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 { Receipt } from '../model/Receipt'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\nimport { ConflictResolutionRequest } from '../model/ConflictResolutionRequest'\nimport { ConflictResolutionResult } from '../model/ConflictResolutionResult'\n\nexport class IccReceiptApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\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 a receipt\n * @param body\n */\n async createReceipt(body?: Receipt): Promise<Receipt> {\n const _url = this.host + `/receipt` + '?ts=' + new Date().getTime()\n let headers = await 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 Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a batch of receipts.\n *\n * @param receiptIds a ListOfIds containing the ids of the receipts to delete.\n * @return a Promise that will resolve in an array of DocIdentifiers of the successfully deleted receipts.\n */\n async deleteReceipts(receiptIds: ListOfIds): Promise<Array<DocIdentifier>> {\n const headers = (await this.headers).filter((h) => h.header !== 'Content-Type').concat(new XHR.Header('Content-Type', 'application/json'))\n return XHR.sendCommand(\n 'POST',\n this.host + `/receipt/delete/batch` + '?ts=' + new Date().getTime(),\n headers,\n receiptIds,\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 * @summary Deletes a single receipt by id.\n *\n * @param receiptId the id of the receipt to delete.\n * @return a Promise that will resolve in the DocIdentifier of the deleted receipt.\n */\n async deleteReceipt(receiptId: string): Promise<DocIdentifier> {\n return XHR.sendCommand(\n 'DELETE',\n this.host + `/receipt/${encodeURIComponent(receiptId)}` + '?ts=' + new Date().getTime(),\n await this.headers,\n null,\n this.fetchImpl,\n undefined,\n this.authenticationProvider.getAuthService()\n )\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Gets a receipt\n * @param receiptId\n */\n async getReceipt(receiptId: string): Promise<Receipt> {\n let _body = null\n\n const _url = this.host + `/receipt/${encodeURIComponent(String(receiptId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get an attachment\n * @param receiptId\n * @param attachmentId\n * @param enckeys\n */\n async getReceiptAttachment(receiptId: string, attachmentId: string, enckeys?: null): Promise<ArrayBuffer> {\n if (enckeys) {\n throw new Error('Server-side encryption is not supported anymore.')\n }\n let _body = null\n\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/attachment/${encodeURIComponent(String(attachmentId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = await 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 receipt\n * @param ref\n */\n async listByReference(ref: string): Promise<Array<Receipt>> {\n let _body = null\n\n const _url = this.host + `/receipt/byRef/${encodeURIComponent(String(ref))}` + '?ts=' + new Date().getTime()\n let headers = await 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 Receipt(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Updates a receipt\n * @param body\n */\n async modifyReceipt(body?: Receipt): Promise<Receipt> {\n let _body = null\n _body = body\n\n const _url = this.host + `/receipt` + '?ts=' + new Date().getTime()\n let headers = await 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 Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @deprecated use setReceiptAttachmentForBlobType instead\n */\n async setReceiptAttachment(receiptId: string, receiptRev: string, blobType: string, enckeys?: null, body?: ArrayBuffer): Promise<Receipt> {\n if (enckeys) {\n throw new Error('Server-side encryption is not supported anymore.')\n }\n if (!body) {\n throw new Error('Attachment content is requred')\n }\n return this.setReceiptAttachmentForBlobType(receiptId, receiptRev, blobType, body)\n }\n\n /**\n * @summary Creates a receipt's attachment\n * @param receiptId id of a receipt\n * @param receiptRev rev of the receipt\n * @param blobType receipt blob type\n * @param body content of the attachment, already encrypted\n */\n async setReceiptAttachmentForBlobType(receiptId: string, receiptRev: string, blobType: string, body: ArrayBuffer): Promise<Receipt> {\n if (!receiptRev) throw new Error('Receipt rev is required')\n\n let _body = body\n\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/attachment/${encodeURIComponent(String(blobType))}` +\n '?ts=' +\n new Date().getTime() +\n '&rev=' +\n receiptRev\n let headers = await 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 Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Creates a receipt's data attachment with compression metadata\n * @param receiptId id of a receipt\n * @param blobType receipt blob type\n * @param rev revision of the receipt\n * @param body content of the attachment\n * @param compressionAlgorithm the compression algorithm used on the client side, if any\n * @param triedCompressionAlgorithmsVersion a version string for the compression algorithms tried\n * @param realDataSize the real size of the data after decryption and decompression\n */\n async setReceiptDataAttachment(\n receiptId: string,\n blobType: string,\n rev: string,\n body: ArrayBuffer,\n compressionAlgorithm?: string,\n triedCompressionAlgorithmsVersion?: string,\n realDataSize?: number\n ): Promise<Receipt> {\n if (!rev) throw new Error('Receipt rev is required')\n\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/dataattachment/${encodeURIComponent(String(blobType))}` +\n '?ts=' +\n new Date().getTime() +\n '&rev=' +\n encodeURIComponent(String(rev)) +\n (compressionAlgorithm ? '&compressionAlgorithm=' + encodeURIComponent(String(compressionAlgorithm)) : '') +\n (triedCompressionAlgorithmsVersion\n ? '&triedCompressionAlgorithmsVersion=' + encodeURIComponent(String(triedCompressionAlgorithmsVersion))\n : '') +\n (realDataSize != null ? '&realDataSize=' + encodeURIComponent(String(realDataSize)) : '')\n let headers = await this.headers\n headers = headers\n .filter((h) => h.header !== 'Content-Type' && h.header !== 'Content-Length')\n .concat(new XHR.Header('Content-Type', 'application/octet-stream'))\n .concat(new XHR.Header('Content-Length', String(body.byteLength)))\n return XHR.sendCommand('PUT', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Receipt(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Get a receipt's attachment by blob type\n * @param receiptId id of the receipt\n * @param blobType the blob type of the attachment to retrieve\n */\n async getReceiptAttachmentByBlobType(receiptId: string, blobType: string): Promise<ArrayBuffer> {\n const _url =\n this.host +\n `/receipt/${encodeURIComponent(String(receiptId))}/attachment/ofType/${encodeURIComponent(String(blobType))}` +\n '?ts=' +\n new Date().getTime()\n let headers = await 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 * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareReceipt(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Receipt>[]> {\n const _url = this.host + '/receipt/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await 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, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Receipt>(x, Receipt)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Retrieves the ids of all the receipts that currently have conflicting revisions and therefore need to\n * be resolved.\n * @summary List the ids of the receipts that have conflicts.\n * @return the ids of the receipts with unresolved conflicts.\n */\n async getConflictingEntitiesIds(): Promise<Array<string>> {\n const _url = this.host + `/receipt/conflicts` + '?ts=' + new Date().getTime()\n let headers = await 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 receipt with the given id (the current revision is not\n * included). The returned entities are still encrypted.\n * @summary Get the conflicting revisions of a receipt.\n * @param entityId the id of the receipt to retrieve the conflicts for.\n * @return the conflicting revisions of the receipt.\n */\n async getConflictsForEntity(entityId: string): Promise<Array<Receipt>> {\n const _url = this.host + `/receipt/conflicts/${encodeURIComponent(String(entityId))}` + '?ts=' + new Date().getTime()\n let headers = await 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 Receipt(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Resolves a conflict by declaring which revision of the receipt 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 receipt.\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<Receipt>): Promise<ConflictResolutionResult<Receipt>> {\n const _url = this.host + `/receipt/conflicts/winner` + '?ts=' + new Date().getTime()\n let headers = await 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<Receipt>(doc.body, (x) => new Receipt(x)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
@@ -20,6 +20,8 @@ import { PaginatedListTopic } from '../model/PaginatedListTopic';
20
20
  import { AbstractFilterTopic } from '../model/AbstractFilterTopic';
21
21
  import { TimingInfo } from '../model/TimingInfo';
22
22
  import { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams';
23
+ import { ConflictResolutionRequest } from '../model/ConflictResolutionRequest';
24
+ import { ConflictResolutionResult } from '../model/ConflictResolutionResult';
23
25
  export declare class IccTopicApi {
24
26
  host: string;
25
27
  _headers: Array<XHR.Header>;
@@ -95,4 +97,50 @@ export declare class IccTopicApi {
95
97
  removeParticipant(body: {
96
98
  dataOwnerId: string;
97
99
  }, topicId: string): Promise<Topic>;
100
+ /**
101
+ * Retrieves the ids of all the topics that currently have conflicting revisions and therefore need to
102
+ * be resolved.
103
+ * @summary List the ids of the topics that have conflicts.
104
+ * @return the ids of the topics with unresolved conflicts.
105
+ */
106
+ getConflictingEntitiesIds(): Promise<Array<string>>;
107
+ /**
108
+ * Retrieves all the conflicting revisions of the topic with the given id (the current revision is not
109
+ * included). The returned entities are still encrypted.
110
+ * @summary Get the conflicting revisions of a topic.
111
+ * @param entityId the id of the topic to retrieve the conflicts for.
112
+ * @return the conflicting revisions of the topic.
113
+ */
114
+ getConflictsForEntity(entityId: string): Promise<Array<Topic>>;
115
+ /**
116
+ * Resolves a conflict by declaring which revision of the topic should be kept as winner and which
117
+ * conflicting revisions should be purged. The provided document must already be encrypted.
118
+ * @summary Declare the winning revision of a conflicting topic.
119
+ * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
120
+ * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
121
+ */
122
+ declareConflictWinner(body: ConflictResolutionRequest<Topic>): Promise<ConflictResolutionResult<Topic>>;
123
+ /**
124
+ * Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id.
125
+ * @summary List the ids of the topics that have conflicts, in the given group.
126
+ * @param groupId the id of the group to look into.
127
+ * @return the ids of the topics with unresolved conflicts in the group.
128
+ */
129
+ getConflictingEntitiesIdsInGroup(groupId: string): Promise<Array<string>>;
130
+ /**
131
+ * Like {@link getConflictsForEntity} but targets the entity of the group with the given id.
132
+ * @summary Get the conflicting revisions of a topic, in the given group.
133
+ * @param groupId the id of the group the topic belongs to.
134
+ * @param entityId the id of the topic to retrieve the conflicts for.
135
+ * @return the conflicting revisions of the topic.
136
+ */
137
+ getConflictsForEntityInGroup(groupId: string, entityId: string): Promise<Array<Topic>>;
138
+ /**
139
+ * Like {@link declareConflictWinner} but targets the entity of the group with the given id.
140
+ * @summary Declare the winning revision of a conflicting topic, in the given group.
141
+ * @param groupId the id of the group the topic belongs to.
142
+ * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
143
+ * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
144
+ */
145
+ declareConflictWinnerInGroup(groupId: string, body: ConflictResolutionRequest<Topic>): Promise<ConflictResolutionResult<Topic>>;
98
146
  }
@@ -28,6 +28,7 @@ const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationPro
28
28
  const IccRestApiPath_1 = require("./IccRestApiPath");
29
29
  const EntityBulkShareResult_1 = require("../model/requests/EntityBulkShareResult");
30
30
  const PaginatedListTopic_1 = require("../model/PaginatedListTopic");
31
+ const ConflictResolutionResult_1 = require("../model/ConflictResolutionResult");
31
32
  class IccTopicApi {
32
33
  get headers() {
33
34
  return Promise.resolve(this._headers);
@@ -191,6 +192,105 @@ class IccTopicApi {
191
192
  .catch((err) => this.handleError(err));
192
193
  });
193
194
  }
195
+ /**
196
+ * Retrieves the ids of all the topics that currently have conflicting revisions and therefore need to
197
+ * be resolved.
198
+ * @summary List the ids of the topics that have conflicts.
199
+ * @return the ids of the topics with unresolved conflicts.
200
+ */
201
+ getConflictingEntitiesIds() {
202
+ return __awaiter(this, void 0, void 0, function* () {
203
+ const _url = this.host + `/topic/conflicts` + '?ts=' + new Date().getTime();
204
+ let headers = yield this.headers;
205
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
206
+ .then((doc) => doc.body)
207
+ .catch((err) => this.handleError(err));
208
+ });
209
+ }
210
+ /**
211
+ * Retrieves all the conflicting revisions of the topic with the given id (the current revision is not
212
+ * included). The returned entities are still encrypted.
213
+ * @summary Get the conflicting revisions of a topic.
214
+ * @param entityId the id of the topic to retrieve the conflicts for.
215
+ * @return the conflicting revisions of the topic.
216
+ */
217
+ getConflictsForEntity(entityId) {
218
+ return __awaiter(this, void 0, void 0, function* () {
219
+ const _url = this.host + `/topic/conflicts/${encodeURIComponent(String(entityId))}` + '?ts=' + new Date().getTime();
220
+ let headers = yield this.headers;
221
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
222
+ .then((doc) => doc.body.map((it) => new Topic_1.Topic(it)))
223
+ .catch((err) => this.handleError(err));
224
+ });
225
+ }
226
+ /**
227
+ * Resolves a conflict by declaring which revision of the topic should be kept as winner and which
228
+ * conflicting revisions should be purged. The provided document must already be encrypted.
229
+ * @summary Declare the winning revision of a conflicting topic.
230
+ * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
231
+ * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
232
+ */
233
+ declareConflictWinner(body) {
234
+ return __awaiter(this, void 0, void 0, function* () {
235
+ const _url = this.host + `/topic/conflicts/winner` + '?ts=' + new Date().getTime();
236
+ let headers = yield this.headers;
237
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
238
+ return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
239
+ .then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new Topic_1.Topic(x)))
240
+ .catch((err) => this.handleError(err));
241
+ });
242
+ }
243
+ /**
244
+ * Like {@link getConflictingEntitiesIds} but targets the entities of the group with the given id.
245
+ * @summary List the ids of the topics that have conflicts, in the given group.
246
+ * @param groupId the id of the group to look into.
247
+ * @return the ids of the topics with unresolved conflicts in the group.
248
+ */
249
+ getConflictingEntitiesIdsInGroup(groupId) {
250
+ return __awaiter(this, void 0, void 0, function* () {
251
+ const _url = this.host + `/topic/inGroup/${encodeURIComponent(String(groupId))}/conflicts` + '?ts=' + new Date().getTime();
252
+ let headers = yield this.headers;
253
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
254
+ .then((doc) => doc.body)
255
+ .catch((err) => this.handleError(err));
256
+ });
257
+ }
258
+ /**
259
+ * Like {@link getConflictsForEntity} but targets the entity of the group with the given id.
260
+ * @summary Get the conflicting revisions of a topic, in the given group.
261
+ * @param groupId the id of the group the topic belongs to.
262
+ * @param entityId the id of the topic to retrieve the conflicts for.
263
+ * @return the conflicting revisions of the topic.
264
+ */
265
+ getConflictsForEntityInGroup(groupId, entityId) {
266
+ return __awaiter(this, void 0, void 0, function* () {
267
+ const _url = this.host +
268
+ `/topic/inGroup/${encodeURIComponent(String(groupId))}/conflicts/${encodeURIComponent(String(entityId))}` +
269
+ '?ts=' +
270
+ new Date().getTime();
271
+ let headers = yield this.headers;
272
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
273
+ .then((doc) => doc.body.map((it) => new Topic_1.Topic(it)))
274
+ .catch((err) => this.handleError(err));
275
+ });
276
+ }
277
+ /**
278
+ * Like {@link declareConflictWinner} but targets the entity of the group with the given id.
279
+ * @summary Declare the winning revision of a conflicting topic, in the given group.
280
+ * @param groupId the id of the group the topic belongs to.
281
+ * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
282
+ * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
283
+ */
284
+ declareConflictWinnerInGroup(groupId, body) {
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ const _url = this.host + `/topic/inGroup/${encodeURIComponent(String(groupId))}/conflicts/winner` + '?ts=' + new Date().getTime();
287
+ let headers = yield this.headers;
288
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
289
+ return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
290
+ .then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new Topic_1.Topic(x)))
291
+ .catch((err) => this.handleError(err));
292
+ });
293
+ }
194
294
  }
195
295
  exports.IccTopicApi = IccTopicApi;
196
296
  //# sourceMappingURL=IccTopicApi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IccTopicApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccTopicApi.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,+BAA2B;AAC3B,0DAAsD;AACtD,0CAAiD;AAEjD,wFAA8G;AAC9G,qDAAiD;AAEjD,mFAA+E;AAE/E,oEAAgE;AAKhE,MAAa,WAAW;IAMtB,IAAI,OAAO;QACT,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;IAED,YACE,IAAY,EACZ,OAAY,EACZ,sBAA+C,EAC/C,SAAyE;QAEzE,IAAI,CAAC,IAAI,GAAG,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAA;QAChC,IAAI,CAAC,QAAQ,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;QAC9E,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,QAAQ,GAAG,CAAC,CAAA;IACnB,CAAC;IAED,WAAW,CAAC,CAAe;QACzB,MAAM,CAAC,CAAA;IACT,CAAC;IAED;;;;OAIG;IACG,QAAQ,CAAC,OAAe;;YAC5B,MAAM,KAAK,GAAG,IAAI,CAAA;YAElB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,UAAU,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC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AI,OAAO,GAAG,MAAM,IAAI,CAAC,OAAO,CAAA;YAChC,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;YACvH,OAAO,SAAG,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,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,aAAK,CAAC,GAAG,CAAC,IAAY,CAAC,CAAC;iBAC1C,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAA;QAC1C,CAAC;KAAA;CACF;AAzLD,kCAyLC","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 { Topic, TopicRole } from '../model/Topic'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { FilterChainTopic } from '../model/FilterChainTopic'\nimport { PaginatedListTopic } from '../model/PaginatedListTopic'\nimport { AbstractFilterTopic } from '../model/AbstractFilterTopic'\nimport { TimingInfo } from '../model/TimingInfo'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\n\nexport class IccTopicApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\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 Gets a topic\n * @param topicId\n */\n async getTopic(topicId: string): Promise<Topic> {\n const _body = null\n\n const _url = this.host + `/topic/${encodeURIComponent(String(topicId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Get a list of topics by ids\n * @param body\n */\n async getTopics(body: ListOfIds): Promise<Array<Topic>> {\n const _url = this.host + `/topic/byIds` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns an instance of created topic.\n * @summary Create a topic with the current user\n * @param body\n */\n async createTopic(body: Topic): Promise<Topic> {\n const _url = this.host + `/topic` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified topic.\n * @summary Modify a topic\n * @param body\n */\n async modifyTopic(body: Topic): Promise<Topic> {\n const _url = this.host + `/topic` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a topic by id.\n *\n * @param topicId the id of the topic to delete\n * @return a Promise that will resolve in the DocIdentifier of the deleted topic.\n */\n async deleteTopic(topicId: string): Promise<DocIdentifier> {\n const _url = this.host + `/topic/${encodeURIComponent(topicId)}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('DELETE', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Response is a set containing the ID's of deleted topics.\n * @summary Delete topics.\n * @param body\n */\n async deleteTopics(body: ListOfIds): Promise<Array<DocIdentifier>> {\n const _url = this.host + `/topic/delete/batch` + '?ts=' + new Date().getTime()\n const headers = (await this.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 DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareTopics(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Topic>[]> {\n const _url = this.host + '/topic/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await 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, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Topic>(x, Topic)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of topics along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List topics for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Topic document ID\n * @param limit Number of rows\n * @param collectTiming if true, include server-side filter timing information in the response\n */\n filterTopicsBy(body: FilterChainTopic, startDocumentId?: string, limit?: number, collectTiming?: false): Promise<PaginatedListTopic>\n filterTopicsBy(body: FilterChainTopic, startDocumentId?: string, limit?: number, collectTiming?: true): Promise<PaginatedListTopic & TimingInfo>\n async filterTopicsBy(body: FilterChainTopic, startDocumentId?: string, limit?: number, collectTiming: boolean = false): Promise<PaginatedListTopic> {\n const _url =\n this.host +\n `/topic/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await 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(new PaginatedListTopic(doc.body as JSON), collectTiming ? { responseHeaders: doc.responseHeaders } : {}))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of topics 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 matchTopicsBy(body: AbstractFilterTopic, collectTiming?: false): Promise<Array<string>>\n matchTopicsBy(body: AbstractFilterTopic, collectTiming?: true): Promise<Array<string> & TimingInfo>\n async matchTopicsBy(body: AbstractFilterTopic, collectTiming: boolean = false): Promise<Array<string>> {\n const _url = this.host + `/topic/match` + '?ts=' + new Date().getTime()\n let headers = await 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 async addParticipant(body: { dataOwnerId: string; topicRole: TopicRole }, topicId: string): Promise<Topic> {\n const _url = this.host + `/topic/${topicId}/addParticipant` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n async removeParticipant(body: { dataOwnerId: string }, topicId: string): Promise<Topic> {\n const _url = this.host + `/topic/${topicId}/removeParticipant` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
1
+ {"version":3,"file":"IccTopicApi.js","sourceRoot":"","sources":["../../../icc-api/api/IccTopic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;AAvTD,kCAuTC","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 { Topic, TopicRole } from '../model/Topic'\nimport { ListOfIds } from '../model/ListOfIds'\nimport { AuthenticationProvider, NoAuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider'\nimport { iccRestApiPath } from './IccRestApiPath'\nimport { EntityShareOrMetadataUpdateRequest } from '../model/requests/EntityShareOrMetadataUpdateRequest'\nimport { EntityBulkShareResult } from '../model/requests/EntityBulkShareResult'\nimport { FilterChainTopic } from '../model/FilterChainTopic'\nimport { PaginatedListTopic } from '../model/PaginatedListTopic'\nimport { AbstractFilterTopic } from '../model/AbstractFilterTopic'\nimport { TimingInfo } from '../model/TimingInfo'\nimport { BulkShareOrUpdateMetadataParams } from '../model/requests/BulkShareOrUpdateMetadataParams'\nimport { ConflictResolutionRequest } from '../model/ConflictResolutionRequest'\nimport { ConflictResolutionResult } from '../model/ConflictResolutionResult'\n\nexport class IccTopicApi {\n host: string\n _headers: Array<XHR.Header>\n authenticationProvider: AuthenticationProvider\n fetchImpl?: (input: RequestInfo, init?: RequestInit) => Promise<Response>\n\n get headers(): Promise<Array<XHR.Header>> {\n return Promise.resolve(this._headers)\n }\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 Gets a topic\n * @param topicId\n */\n async getTopic(topicId: string): Promise<Topic> {\n const _body = null\n\n const _url = this.host + `/topic/${encodeURIComponent(String(topicId))}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('GET', _url, headers, _body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Keys must be delimited by coma\n * @summary Get a list of topics by ids\n * @param body\n */\n async getTopics(body: ListOfIds): Promise<Array<Topic>> {\n const _url = this.host + `/topic/byIds` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns an instance of created topic.\n * @summary Create a topic with the current user\n * @param body\n */\n async createTopic(body: Topic): Promise<Topic> {\n const _url = this.host + `/topic` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns the modified topic.\n * @summary Modify a topic\n * @param body\n */\n async modifyTopic(body: Topic): Promise<Topic> {\n const _url = this.host + `/topic` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @summary Deletes a topic by id.\n *\n * @param topicId the id of the topic to delete\n * @return a Promise that will resolve in the DocIdentifier of the deleted topic.\n */\n async deleteTopic(topicId: string): Promise<DocIdentifier> {\n const _url = this.host + `/topic/${encodeURIComponent(topicId)}` + '?ts=' + new Date().getTime()\n let headers = await this.headers\n return XHR.sendCommand('DELETE', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => new DocIdentifier(doc.body))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Response is a set containing the ID's of deleted topics.\n * @summary Delete topics.\n * @param body\n */\n async deleteTopics(body: ListOfIds): Promise<Array<DocIdentifier>> {\n const _url = this.host + `/topic/delete/batch` + '?ts=' + new Date().getTime()\n const headers = (await this.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 DocIdentifier(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * @internal this method is for internal use only and may be changed without notice\n */\n async bulkShareTopics(request: BulkShareOrUpdateMetadataParams): Promise<EntityBulkShareResult<Topic>[]> {\n const _url = this.host + '/topic/bulkSharedMetadataUpdate' + '?ts=' + new Date().getTime()\n let headers = await 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, request, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())\n .then((doc) => (doc.body as Array<JSON>).map((x) => new EntityBulkShareResult<Topic>(x, Topic)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Returns a list of topics along with next start keys and Document ID. If the nextStartKey is Null it means that this is the last page.\n * @summary List topics for the current user (HcParty) or the given hcparty in the filter\n * @param body\n * @param startDocumentId A Topic document ID\n * @param limit Number of rows\n * @param collectTiming if true, include server-side filter timing information in the response\n */\n filterTopicsBy(body: FilterChainTopic, startDocumentId?: string, limit?: number, collectTiming?: false): Promise<PaginatedListTopic>\n filterTopicsBy(body: FilterChainTopic, startDocumentId?: string, limit?: number, collectTiming?: true): Promise<PaginatedListTopic & TimingInfo>\n async filterTopicsBy(\n body: FilterChainTopic,\n startDocumentId?: string,\n limit?: number,\n collectTiming: boolean = false\n ): Promise<PaginatedListTopic> {\n const _url =\n this.host +\n `/topic/filter` +\n '?ts=' +\n new Date().getTime() +\n (startDocumentId ? '&startDocumentId=' + encodeURIComponent(String(startDocumentId)) : '') +\n (limit ? '&limit=' + encodeURIComponent(String(limit)) : '')\n let headers = await 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) => Object.assign(new PaginatedListTopic(doc.body as JSON), collectTiming ? { responseHeaders: doc.responseHeaders } : {}))\n .catch((err) => this.handleError(err))\n }\n\n /**\n *\n * @summary Get ids of topics 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 matchTopicsBy(body: AbstractFilterTopic, collectTiming?: false): Promise<Array<string>>\n matchTopicsBy(body: AbstractFilterTopic, collectTiming?: true): Promise<Array<string> & TimingInfo>\n async matchTopicsBy(body: AbstractFilterTopic, collectTiming: boolean = false): Promise<Array<string>> {\n const _url = this.host + `/topic/match` + '?ts=' + new Date().getTime()\n let headers = await 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 async addParticipant(body: { dataOwnerId: string; topicRole: TopicRole }, topicId: string): Promise<Topic> {\n const _url = this.host + `/topic/${topicId}/addParticipant` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n async removeParticipant(body: { dataOwnerId: string }, topicId: string): Promise<Topic> {\n const _url = this.host + `/topic/${topicId}/removeParticipant` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(doc.body as JSON))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Retrieves the ids of all the topics that currently have conflicting revisions and therefore need to\n * be resolved.\n * @summary List the ids of the topics that have conflicts.\n * @return the ids of the topics with unresolved conflicts.\n */\n async getConflictingEntitiesIds(): Promise<Array<string>> {\n const _url = this.host + `/topic/conflicts` + '?ts=' + new Date().getTime()\n let headers = await 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 topic with the given id (the current revision is not\n * included). The returned entities are still encrypted.\n * @summary Get the conflicting revisions of a topic.\n * @param entityId the id of the topic to retrieve the conflicts for.\n * @return the conflicting revisions of the topic.\n */\n async getConflictsForEntity(entityId: string): Promise<Array<Topic>> {\n const _url = this.host + `/topic/conflicts/${encodeURIComponent(String(entityId))}` + '?ts=' + new Date().getTime()\n let headers = await 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 Topic(it)))\n .catch((err) => this.handleError(err))\n }\n\n /**\n * Resolves a conflict by declaring which revision of the topic 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 topic.\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<Topic>): Promise<ConflictResolutionResult<Topic>> {\n const _url = this.host + `/topic/conflicts/winner` + '?ts=' + new Date().getTime()\n let headers = await 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<Topic>(doc.body, (x) => new Topic(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 topics that have conflicts, in the given group.\n * @param groupId the id of the group to look into.\n * @return the ids of the topics with unresolved conflicts in the group.\n */\n async getConflictingEntitiesIdsInGroup(groupId: string): Promise<Array<string>> {\n const _url = this.host + `/topic/inGroup/${encodeURIComponent(String(groupId))}/conflicts` + '?ts=' + new Date().getTime()\n let headers = await 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 a topic, in the given group.\n * @param groupId the id of the group the topic belongs to.\n * @param entityId the id of the topic to retrieve the conflicts for.\n * @return the conflicting revisions of the topic.\n */\n async getConflictsForEntityInGroup(groupId: string, entityId: string): Promise<Array<Topic>> {\n const _url =\n this.host +\n `/topic/inGroup/${encodeURIComponent(String(groupId))}/conflicts/${encodeURIComponent(String(entityId))}` +\n '?ts=' +\n new Date().getTime()\n let headers = await 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 Topic(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 topic, in the given group.\n * @param groupId the id of the group the topic 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<Topic>): Promise<ConflictResolutionResult<Topic>> {\n const _url = this.host + `/topic/inGroup/${encodeURIComponent(String(groupId))}/conflicts/winner` + '?ts=' + new Date().getTime()\n let headers = await 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<Topic>(doc.body, (x) => new Topic(x)))\n .catch((err) => this.handleError(err))\n }\n}\n"]}
@@ -22,6 +22,8 @@ import { UserGroup } from '../model/UserGroup';
22
22
  import { AuthenticationProvider } from '../../icc-x-api/auth/AuthenticationProvider';
23
23
  import { ListOfIds } from '../model/ListOfIds';
24
24
  import { TimingInfo } from '../model/TimingInfo';
25
+ import { ConflictResolutionRequest } from '../model/ConflictResolutionRequest';
26
+ import { ConflictResolutionResult } from '../model/ConflictResolutionResult';
25
27
  export declare class IccUserApi {
26
28
  host: string;
27
29
  headers: Array<XHR.Header>;
@@ -255,4 +257,27 @@ export declare class IccUserApi {
255
257
  revokeFasAuthenticationForUser(fasJwtToken: string): Promise<User>;
256
258
  disable2fa(userId: string): Promise<void>;
257
259
  getUsers(body?: ListOfIds): Promise<Array<User>>;
260
+ /**
261
+ * Retrieves the ids of all the users that currently have conflicting revisions and therefore need to
262
+ * be resolved.
263
+ * @summary List the ids of the users that have conflicts.
264
+ * @return the ids of the users with unresolved conflicts.
265
+ */
266
+ getConflictingEntitiesIds(): Promise<Array<string>>;
267
+ /**
268
+ * Retrieves all the conflicting revisions of the user with the given id (the current revision is not
269
+ * included). The returned entities are still encrypted.
270
+ * @summary Get the conflicting revisions of a user.
271
+ * @param entityId the id of the user to retrieve the conflicts for.
272
+ * @return the conflicting revisions of the user.
273
+ */
274
+ getConflictsForEntity(entityId: string): Promise<Array<User>>;
275
+ /**
276
+ * Resolves a conflict by declaring which revision of the user should be kept as winner and which
277
+ * conflicting revisions should be purged. The provided document must already be encrypted.
278
+ * @summary Declare the winning revision of a conflicting user.
279
+ * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
280
+ * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
281
+ */
282
+ declareConflictWinner(body: ConflictResolutionRequest<User>): Promise<ConflictResolutionResult<User>>;
258
283
  }
@@ -31,6 +31,7 @@ const UserGroup_1 = require("../model/UserGroup");
31
31
  const AuthenticationProvider_1 = require("../../icc-x-api/auth/AuthenticationProvider");
32
32
  const IccRestApiPath_1 = require("./IccRestApiPath");
33
33
  const ListOfIds_1 = require("../model/ListOfIds");
34
+ const ConflictResolutionResult_1 = require("../model/ConflictResolutionResult");
34
35
  class IccUserApi {
35
36
  constructor(host, headers, authenticationProvider, fetchImpl) {
36
37
  this.host = (0, IccRestApiPath_1.iccRestApiPath)(host);
@@ -562,6 +563,54 @@ class IccUserApi {
562
563
  .catch((err) => this.handleError(err));
563
564
  });
564
565
  }
566
+ /**
567
+ * Retrieves the ids of all the users that currently have conflicting revisions and therefore need to
568
+ * be resolved.
569
+ * @summary List the ids of the users that have conflicts.
570
+ * @return the ids of the users with unresolved conflicts.
571
+ */
572
+ getConflictingEntitiesIds() {
573
+ return __awaiter(this, void 0, void 0, function* () {
574
+ const _url = this.host + `/user/conflicts` + '?ts=' + new Date().getTime();
575
+ let headers = yield this.headers;
576
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
577
+ .then((doc) => doc.body)
578
+ .catch((err) => this.handleError(err));
579
+ });
580
+ }
581
+ /**
582
+ * Retrieves all the conflicting revisions of the user with the given id (the current revision is not
583
+ * included). The returned entities are still encrypted.
584
+ * @summary Get the conflicting revisions of a user.
585
+ * @param entityId the id of the user to retrieve the conflicts for.
586
+ * @return the conflicting revisions of the user.
587
+ */
588
+ getConflictsForEntity(entityId) {
589
+ return __awaiter(this, void 0, void 0, function* () {
590
+ const _url = this.host + `/user/conflicts/${encodeURIComponent(String(entityId))}` + '?ts=' + new Date().getTime();
591
+ let headers = yield this.headers;
592
+ return XHR_1.XHR.sendCommand('GET', _url, headers, null, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
593
+ .then((doc) => doc.body.map((it) => new User_1.User(it)))
594
+ .catch((err) => this.handleError(err));
595
+ });
596
+ }
597
+ /**
598
+ * Resolves a conflict by declaring which revision of the user should be kept as winner and which
599
+ * conflicting revisions should be purged. The provided document must already be encrypted.
600
+ * @summary Declare the winning revision of a conflicting user.
601
+ * @param body the {@link ConflictResolutionRequest} carrying the winning revision and the conflicts to purge.
602
+ * @return the {@link ConflictResolutionResult} with the saved winner and the conflicts that are still unresolved.
603
+ */
604
+ declareConflictWinner(body) {
605
+ return __awaiter(this, void 0, void 0, function* () {
606
+ const _url = this.host + `/user/conflicts/winner` + '?ts=' + new Date().getTime();
607
+ let headers = yield this.headers;
608
+ headers = headers.filter((h) => h.header !== 'Content-Type').concat(new XHR_1.XHR.Header('Content-Type', 'application/json'));
609
+ return XHR_1.XHR.sendCommand('POST', _url, headers, body, this.fetchImpl, undefined, this.authenticationProvider.getAuthService())
610
+ .then((doc) => new ConflictResolutionResult_1.ConflictResolutionResult(doc.body, (x) => new User_1.User(x)))
611
+ .catch((err) => this.handleError(err));
612
+ });
613
+ }
565
614
  }
566
615
  exports.IccUserApi = IccUserApi;
567
616
  //# sourceMappingURL=IccUserApi.js.map