argous 1.2.221 → 1.2.222

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.
@@ -59,8 +59,9 @@ export function createDocument({ idUnidade, cdUnidade, idDocPai, path, dsKeyWord
59
59
  dsSubCategoria: any;
60
60
  snSensivel: any;
61
61
  }): Promise<any>;
62
- export function getFileFromLink({ URL: link }?: {
62
+ export function getFileFromLink({ URL: link, token }?: {
63
63
  URL?: string | undefined;
64
+ token?: string | undefined;
64
65
  }): Promise<string>;
65
66
  export function getLink(idDocumento: any, nrRevisao: any, timeout: any): Promise<any>;
66
67
  export function scanDocument(idDocumento: any, nrRevisao: any): Promise<any>;
package/dist/api/index.js CHANGED
@@ -766,21 +766,21 @@ var createDocument = function (_a) {
766
766
  };
767
767
  exports.createDocument = createDocument;
768
768
  var getFileFromLink = function (_a) {
769
- var _b = _a === void 0 ? {} : _a, _c = _b.URL, link = _c === void 0 ? '' : _c;
769
+ var _b = _a === void 0 ? {} : _a, _c = _b.URL, link = _c === void 0 ? '' : _c, _d = _b.token, token = _d === void 0 ? '' : _d;
770
770
  return __awaiter(void 0, void 0, void 0, function () {
771
771
  var file;
772
- return __generator(this, function (_d) {
773
- switch (_d.label) {
772
+ return __generator(this, function (_e) {
773
+ switch (_e.label) {
774
774
  case 0:
775
775
  if (!link)
776
776
  return [2 /*return*/, ''];
777
777
  return [4 /*yield*/, fetch(link, {
778
778
  method: 'post',
779
- headers: exports.headers()
779
+ headers: exports.headers(token)
780
780
  })];
781
- case 1: return [4 /*yield*/, (_d.sent()).blob()];
781
+ case 1: return [4 /*yield*/, (_e.sent()).blob()];
782
782
  case 2:
783
- file = _d.sent();
783
+ file = _e.sent();
784
784
  return [2 /*return*/, URL.createObjectURL(file)];
785
785
  }
786
786
  });
package/lib/api/index.js CHANGED
@@ -405,11 +405,11 @@ export const createDocument = async ({
405
405
  })).json();
406
406
  };
407
407
 
408
- export const getFileFromLink = async ({ URL: link = '' } = {}) => {
408
+ export const getFileFromLink = async ({ URL: link = '', token = '' } = {}) => {
409
409
  if (!link) return '';
410
410
  const file = await (await fetch(link, {
411
411
  method: 'post',
412
- headers: headers()
412
+ headers: headers(token)
413
413
  })).blob();
414
414
  return URL.createObjectURL(file);
415
415
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argous",
3
- "version": "1.2.221",
3
+ "version": "1.2.222",
4
4
  "description": "Argous.",
5
5
  "main": "lib/index.js",
6
6
  "author": "Carlos Schneider",