UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

51 lines • 2.23 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Received = exports.BaseReceived = void 0; const tslib_1 = require("../../../internal/tslib.js"); // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. const resource_1 = require("../../../core/resource.js"); const FieldsAPI = tslib_1.__importStar(require("./fields.js")); const fields_1 = require("./fields.js"); const path_1 = require("../../../internal/utils/path.js"); var BaseReceived = /* @__PURE__ */ (() => { class BaseReceived extends resource_1.APIResource { /** * The `/received` api route allows customers to retrieve their edge HTTP logs. The * basic access pattern is "give me all the logs for zone Z for minute M", where * the minute M refers to the time records were received at Cloudflare's central * data center. `start` is inclusive, and `end` is exclusive. Because of that, to * get all data, at minutely cadence, starting at 10AM, the proper values are: * `start=2018-05-20T10:00:00Z&end=2018-05-20T10:01:00Z`, then * `start=2018-05-20T10:01:00Z&end=2018-05-20T10:02:00Z` and so on; the overlap * will be handled properly. * * @example * ```ts * const received = await client.logs.received.get({ * zone_id: '023e105f4ecef8ad9ca31a8372d0c353', * end: '2018-05-20T10:01:00Z', * }); * ``` */ get(params, options) { const { zone_id, ...query } = params; return this._client.get((0, path_1.path) `/zones/${zone_id}/logs/received`, { query, ...options }); } } BaseReceived._key = Object.freeze(['logs', 'received']); return BaseReceived; })(); exports.BaseReceived = BaseReceived; var Received = /* @__PURE__ */ (() => { class Received extends BaseReceived { constructor() { super(...arguments); this.fields = new FieldsAPI.Fields(this._client); } } Received.Fields = fields_1.Fields; Received.BaseFields = fields_1.BaseFields; return Received; })(); exports.Received = Received; //# sourceMappingURL=received.js.map