argous 1.2.168 → 1.2.169

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.
@@ -61,4 +61,4 @@ export function getFileFromLink({ URL: link }?: {
61
61
  URL?: string | undefined;
62
62
  }): Promise<string>;
63
63
  export function getLink(idDocumento: any, nrRevisao: any, timeout: any): Promise<any>;
64
- export function scanDocument(idDocumento: any, nrRevisao: any, url: any): Promise<any>;
64
+ export function scanDocument(idDocumento: any, nrRevisao: any): Promise<any>;
package/dist/api/index.js CHANGED
@@ -770,19 +770,24 @@ var getLink = function (idDocumento, nrRevisao, timeout) { return __awaiter(void
770
770
  });
771
771
  }); };
772
772
  exports.getLink = getLink;
773
- var scanDocument = function (idDocumento, nrRevisao, url) { return __awaiter(void 0, void 0, void 0, function () {
774
- var res;
775
- return __generator(this, function (_a) {
776
- switch (_a.label) {
777
- case 0: return [4 /*yield*/, fetch(url + "argous/docs/scan.agdoc", {
778
- method: 'post',
779
- headers: exports.headers(),
780
- body: JSON.stringify({ idDocumento: idDocumento, nrRevisao: nrRevisao })
781
- })];
773
+ var scanDocument = function (idDocumento, nrRevisao) { return __awaiter(void 0, void 0, void 0, function () {
774
+ var _a, status, docsUrl, res;
775
+ return __generator(this, function (_b) {
776
+ switch (_b.label) {
777
+ case 0: return [4 /*yield*/, exports.getDocsUrl()];
782
778
  case 1:
783
- res = _a.sent();
779
+ _a = _b.sent(), status = _a.status, docsUrl = _a.docsUrl;
780
+ if (!status)
781
+ return [2 /*return*/];
782
+ return [4 /*yield*/, fetch(docsUrl + "argous/docs/scan.agdoc", {
783
+ method: 'post',
784
+ headers: exports.headers(),
785
+ body: JSON.stringify({ idDocumento: idDocumento, nrRevisao: nrRevisao })
786
+ })];
787
+ case 2:
788
+ res = _b.sent();
784
789
  return [4 /*yield*/, res.json()];
785
- case 2: return [2 /*return*/, _a.sent()];
790
+ case 3: return [2 /*return*/, _b.sent()];
786
791
  }
787
792
  });
788
793
  }); };
package/lib/api/index.js CHANGED
@@ -405,8 +405,10 @@ export const getLink = async (idDocumento, nrRevisao, timeout) => {
405
405
  })).json();
406
406
  };
407
407
 
408
- export const scanDocument = async (idDocumento, nrRevisao, url) => {
409
- const res = await fetch(`${url}argous/docs/scan.agdoc`, {
408
+ export const scanDocument = async (idDocumento, nrRevisao) => {
409
+ const { status, docsUrl } = await getDocsUrl();
410
+ if (!status) return;
411
+ const res = await fetch(`${docsUrl}argous/docs/scan.agdoc`, {
410
412
  method: 'post',
411
413
  headers: headers(),
412
414
  body: JSON.stringify({ idDocumento, nrRevisao })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "argous",
3
- "version": "1.2.168",
3
+ "version": "1.2.169",
4
4
  "description": "Argous.",
5
5
  "main": "lib/index.js",
6
6
  "author": "Carlos Schneider",