cloudflare
Version:
The official TypeScript library for the Cloudflare API
73 lines • 4.02 kB
JavaScript
;
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.ServerSideExcludes = void 0;
const resource_1 = require("cloudflare/resource");
const ServerSideExcludesAPI = __importStar(require("cloudflare/resources/zones/settings/server-side-excludes"));
class ServerSideExcludes extends resource_1.APIResource {
/**
* If there is sensitive content on your website that you want visible to real
* visitors, but that you want to hide from suspicious visitors, all you have to do
* is wrap the content with Cloudflare SSE tags. Wrap any content that you want to
* be excluded from suspicious visitors in the following SSE tags:
* <!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone
* number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you
* have HTML minification enabled, you won't see the SSE tags in your HTML source
* when it's served through Cloudflare. SSE will still function in this case, as
* Cloudflare's HTML minification and SSE functionality occur on-the-fly as the
* resource moves through our network to the visitor's computer.
* (https://support.cloudflare.com/hc/en-us/articles/200170036).
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(`/zones/${zone_id}/settings/server_side_exclude`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* If there is sensitive content on your website that you want visible to real
* visitors, but that you want to hide from suspicious visitors, all you have to do
* is wrap the content with Cloudflare SSE tags. Wrap any content that you want to
* be excluded from suspicious visitors in the following SSE tags:
* <!--sse--><!--/sse-->. For example: <!--sse--> Bad visitors won't see my phone
* number, 555-555-5555 <!--/sse-->. Note: SSE only will work with HTML. If you
* have HTML minification enabled, you won't see the SSE tags in your HTML source
* when it's served through Cloudflare. SSE will still function in this case, as
* Cloudflare's HTML minification and SSE functionality occur on-the-fly as the
* resource moves through our network to the visitor's computer.
* (https://support.cloudflare.com/hc/en-us/articles/200170036).
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(`/zones/${zone_id}/settings/server_side_exclude`, options)._thenUnwrap((obj) => obj.result);
}
}
exports.ServerSideExcludes = ServerSideExcludes;
(function (ServerSideExcludes) {
ServerSideExcludes.ServerSideExcludes = ServerSideExcludesAPI.ServerSideExcludes;
})(ServerSideExcludes = exports.ServerSideExcludes || (exports.ServerSideExcludes = {}));
//# sourceMappingURL=server-side-excludes.js.map