cloudflare
Version:
The official TypeScript library for the Cloudflare API
59 lines • 2.16 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../../core/resource.mjs";
import * as ConfigsAPI from "./configs.mjs";
import { BaseConfigs, Configs } from "./configs.mjs";
import { SinglePage } from "../../../core/pagination.mjs";
import { path } from "../../../internal/utils/path.mjs";
export var BaseHistory = /* @__PURE__ */ (() => {
class BaseHistory extends APIResource {
/**
* Restores a historical published Zaraz configuration by ID for a zone.
*
* @example
* ```ts
* const configuration = await client.zaraz.history.update({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* body: 12345,
* });
* ```
*/
update(params, options) {
const { zone_id, body } = params;
return this._client.put(path `/zones/${zone_id}/settings/zaraz/history`, {
body: body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Lists a history of published Zaraz configuration records for a zone.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const historyListResponse of client.zaraz.history.list(
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params, options) {
const { zone_id, ...query } = params;
return this._client.getAPIList(path `/zones/${zone_id}/settings/zaraz/history`, (SinglePage), { query, ...options });
}
}
BaseHistory._key = Object.freeze(['zaraz', 'history']);
return BaseHistory;
})();
export var History = /* @__PURE__ */ (() => {
class History extends BaseHistory {
constructor() {
super(...arguments);
this.configs = new ConfigsAPI.Configs(this._client);
}
}
History.Configs = Configs;
History.BaseConfigs = BaseConfigs;
return History;
})();
//# sourceMappingURL=history.mjs.map