UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

43 lines 1.77 kB
"use strict"; // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. Object.defineProperty(exports, "__esModule", { value: true }); exports.Scans = void 0; const resource_1 = require("cloudflare/resource"); const core_1 = require("cloudflare/core"); class Scans extends resource_1.APIResource { /** * Submit a URL to scan. You can also set some options, like the visibility level * and custom headers. Accounts are limited to 1 new scan every 10 seconds and 8000 * per month. If you need more, please reach out. */ create(accountId, body, options) { return this._client.post(`/accounts/${accountId}/urlscanner/scan`, { body, ...options })._thenUnwrap((obj) => obj.result); } /** * Get URL scan by uuid */ get(accountId, scanId, options) { return this._client.get(`/accounts/${accountId}/urlscanner/scan/${scanId}`, options)._thenUnwrap((obj) => obj.result); } /** * Get a URL scan's HAR file. See HAR spec at * http://www.softwareishard.com/blog/har-12-spec/. */ har(accountId, scanId, options) { return this._client.get(`/accounts/${accountId}/urlscanner/scan/${scanId}/har`, options)._thenUnwrap((obj) => obj.result); } screenshot(accountId, scanId, query = {}, options) { if ((0, core_1.isRequestOptions)(query)) { return this.screenshot(accountId, scanId, {}, query); } return this._client.get(`/accounts/${accountId}/urlscanner/scan/${scanId}/screenshot`, { query, ...options, __binaryResponse: true, }); } } exports.Scans = Scans; (function (Scans) { })(Scans = exports.Scans || (exports.Scans = {})); //# sourceMappingURL=scans.js.map