cloudflare
Version:
The official TypeScript library for the Cloudflare API
53 lines • 2.19 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseTransformationsC2paResource = /* @__PURE__ */ (() => {
class BaseTransformationsC2paResource extends APIResource {
/**
* C2PA (Coalition for Content Provenance and Authenticity) signing adds
* cryptographic metadata to images processed through Cloudflare Image
* Transformations, enabling verification of image authenticity and provenance.
*
* @example
* ```ts
* const transformationsC2pa =
* await client.zones.transformationsC2pa.edit({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* value: 'off',
* });
* ```
*/
edit(params, options) {
const { zone_id, ...body } = params;
return this._client.patch(path `/zones/${zone_id}/settings/transformations_c2pa`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* C2PA (Coalition for Content Provenance and Authenticity) signing adds
* cryptographic metadata to images processed through Cloudflare Image
* Transformations, enabling verification of image authenticity and provenance.
*
* @example
* ```ts
* const transformationsC2pa =
* await client.zones.transformationsC2pa.get({
* zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
* });
* ```
*/
get(params, options) {
const { zone_id } = params;
return this._client.get(path `/zones/${zone_id}/settings/transformations_c2pa`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseTransformationsC2paResource._key = Object.freeze([
'zones',
'transformationsC2pa',
]);
return BaseTransformationsC2paResource;
})();
export class TransformationsC2paResource extends BaseTransformationsC2paResource {
}
//# sourceMappingURL=transformations-c2pa.mjs.map