Skip to content

Commit 17fdff7

Browse files
committed
build
1 parent ede83bd commit 17fdff7

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

dist/index.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ export declare class SensibleSDK {
66
extract(params: ExtractParams): Promise<ExtractionRequest>;
77
classify(params: ClassificationParams): Promise<ClassificationRequest>;
88
waitFor(request: ClassificationRequest | ExtractionRequest): Promise<ExtractionResult | ClassificationResult>;
9+
generateExcel(requests: ExtractionRequest | ExtractionRequest[]): Promise<{
10+
url: string;
11+
}>;
912
}
1013
type FileDefinition = {
1114
file: Buffer;

dist/index.js

+30
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,36 @@ var SensibleSDK = /** @class */ (function () {
205205
});
206206
});
207207
};
208+
// requested extractions must be completed
209+
SensibleSDK.prototype.generateExcel = function (requests) {
210+
return __awaiter(this, void 0, void 0, function () {
211+
var extractions, url, e_5;
212+
return __generator(this, function (_a) {
213+
switch (_a.label) {
214+
case 0:
215+
extractions = Array.isArray(requests) ? requests : [requests];
216+
url = baseUrl +
217+
"/generate_excel/" +
218+
extractions.map(function (extraction) { return extraction.id; }).join(",");
219+
_a.label = 1;
220+
case 1:
221+
_a.trys.push([1, 3, , 4]);
222+
return [4 /*yield*/, got_1.default
223+
.get(url, {
224+
headers: { authorization: "Bearer ".concat(this.apiKey) },
225+
})
226+
.json()];
227+
case 2: return [2 /*return*/, _a.sent()];
228+
case 3:
229+
e_5 = _a.sent();
230+
throwError(e_5);
231+
// HACK: keep TS happy
232+
throw null;
233+
case 4: return [2 /*return*/];
234+
}
235+
});
236+
});
237+
};
208238
return SensibleSDK;
209239
}());
210240
exports.SensibleSDK = SensibleSDK;

0 commit comments

Comments
 (0)