@colijnit/mainapi 259.1.2 → 259.1.4

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.
@@ -51,8 +51,15 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
51
51
  return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
52
52
  }
53
53
  getDocumentContent(id, thumbnail) {
54
- console.warn('getDocumentContent not implemented');
55
- return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
54
+ if (id === undefined || id === null) {
55
+ return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
56
+ }
57
+ const params = {
58
+ documentId: id,
59
+ thumbnail: thumbnail
60
+ };
61
+ const data = Object.assign(Object.assign({}, this.createServiceRequestData()), { parameterValues: params });
62
+ return this._call(public_service_method_1.PublicServiceMethod.GetDocumentContent, data);
56
63
  }
57
64
  loadDocuments(key, table) {
58
65
  return __awaiter(this, void 0, void 0, function* () {
@@ -330,8 +337,12 @@ class MainPublic extends main_api_connection_1.MainApiConnection {
330
337
  });
331
338
  }
332
339
  getImageForCoDocument(document, thumb = false) {
333
- console.warn('getImageForCoDocument not implemented');
334
- return Promise.resolve(new data_service_response_data_1.DataServiceResponseData());
340
+ if (document) {
341
+ const type = document.documentType;
342
+ const fileType = document.fileType;
343
+ const hasPublicAccess = document.hasPublicAccess;
344
+ return this._handleCoDocumentRequest(type, fileType, hasPublicAccess, document.documentId, document.mimeTypeInternal, thumb, document.filePath);
345
+ }
335
346
  }
336
347
  createServiceRequestData() {
337
348
  const data = { languageCode: this.languageCode };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@colijnit/mainapi",
3
- "version": "259.1.2",
3
+ "version": "259.1.4",
4
4
  "scripts": {
5
5
  "build": "grunt clean && tsc",
6
6
  "browserify": "browserify build/connector.js --s colijn -o dist/out-tsc/bundle.js",