xlport 0.2.3 → 0.2.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.
- package/dist/lib/client.d.ts +1 -1
- package/dist/lib/client.js +9 -9
- package/package.json +1 -1
package/dist/lib/client.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare type ExcelMimeType = ExcelDefaultMimeType | 'application/vnd.open
|
|
|
12
12
|
export declare const excelDefaultMimeType = "application/vnd.ms-excel";
|
|
13
13
|
export declare const mimeTypes: MimeTypes;
|
|
14
14
|
export declare type MimeTypes = Record<ExcelFileExtension, ExcelMimeType>;
|
|
15
|
-
export declare class
|
|
15
|
+
export declare class Client {
|
|
16
16
|
private config;
|
|
17
17
|
constructor(config: ClientOptions);
|
|
18
18
|
importFromFile(file: string | Buffer, request?: Import.Request): Promise<Import.Response>;
|
package/dist/lib/client.js
CHANGED
|
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
39
|
+
exports.Client = exports.mimeTypes = exports.excelDefaultMimeType = void 0;
|
|
40
40
|
var request_promise_1 = require("request-promise");
|
|
41
41
|
var request_1 = require("request");
|
|
42
42
|
var fs_1 = require("fs");
|
|
@@ -50,14 +50,14 @@ exports.mimeTypes = {
|
|
|
50
50
|
xlsb: 'application/vnd.ms-excel.sheet.binary.macroEnabled.12',
|
|
51
51
|
xls: 'application/vnd.ms-excel',
|
|
52
52
|
};
|
|
53
|
-
var
|
|
54
|
-
function
|
|
53
|
+
var Client = /** @class */ (function () {
|
|
54
|
+
function Client(config) {
|
|
55
55
|
this.config = {
|
|
56
56
|
url: config.url ? config.url.replace(/\/$/, '') : 'https://xlport.compute.molnify.com',
|
|
57
57
|
apiKey: config.apiKey,
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
Client.prototype.importFromFile = function (file, request) {
|
|
61
61
|
if (request === void 0) { request = import_types_1.Import.defaultRequest; }
|
|
62
62
|
return __awaiter(this, void 0, void 0, function () {
|
|
63
63
|
var _a, _b;
|
|
@@ -105,7 +105,7 @@ var XlPort = /** @class */ (function () {
|
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
107
|
};
|
|
108
|
-
|
|
108
|
+
Client.prototype.exportToFile = function (body) {
|
|
109
109
|
return request_1.put({
|
|
110
110
|
url: this.config.url + "/export",
|
|
111
111
|
headers: {
|
|
@@ -135,10 +135,10 @@ var XlPort = /** @class */ (function () {
|
|
|
135
135
|
encoding: null,
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
|
-
|
|
138
|
+
Client.prototype.getExcelMimeType = function (path) {
|
|
139
139
|
return exports.mimeTypes[path_1.extname(path)] || exports.excelDefaultMimeType;
|
|
140
140
|
};
|
|
141
|
-
|
|
141
|
+
Client.prototype.loadFile = function (path) {
|
|
142
142
|
return __awaiter(this, void 0, void 0, function () {
|
|
143
143
|
var _a;
|
|
144
144
|
return __generator(this, function (_b) {
|
|
@@ -156,7 +156,7 @@ var XlPort = /** @class */ (function () {
|
|
|
156
156
|
});
|
|
157
157
|
});
|
|
158
158
|
};
|
|
159
|
-
return
|
|
159
|
+
return Client;
|
|
160
160
|
}());
|
|
161
|
-
exports.
|
|
161
|
+
exports.Client = Client;
|
|
162
162
|
//# sourceMappingURL=client.js.map
|