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.
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.js +16 -11
- package/lib/api/index.js +4 -2
- package/package.json +1 -1
package/dist/api/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
774
|
-
var res;
|
|
775
|
-
return __generator(this, function (
|
|
776
|
-
switch (
|
|
777
|
-
case 0: return [4 /*yield*/,
|
|
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
|
-
|
|
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
|
|
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
|
|
409
|
-
const
|
|
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 })
|