"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
const _axios = /*#__PURE__*/ _interop_require_default(require("axios"));
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
const key = "key";
const fileUrl = "FILE.gcode";
async function getFileMetadata(url) {
    try {
        const response = await _axios.default.head(url, {
            headers: {
                "X-API-Key": key
            }
        });
        return {
            contentLength: response.headers["content-length"],
            contentType: response.headers["content-type"],
            lastModified: response.headers["last-modified"]
        };
    } catch (error) {
        console.error("Error fetching file metadata:", error.message);
        return null;
    }
}
async function fetchGCodeMetadata(url, maxLines = 50) {
    try {
        const response = await _axios.default.get(url, {
            headers: {
                Range: "bytes=1900-2000",
                "X-API-Key": key
            }
        });
        const lines = response.data.split("\n").slice(0, maxLines);
        return lines;
    } catch (error) {
        console.error("Error fetching file:", error.message);
        return [];
    }
}
fetchGCodeMetadata(fileUrl).then((metadata)=>{
    console.log(metadata);
});
getFileMetadata(fileUrl).then((metadata)=>{
    console.log(metadata);
});

//# sourceMappingURL=gcode-scanner-poc.console.js.map