UNPKG

@vercel/sdk

Version:

<p align="center"> <a href="https://vercel.com"> <img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96"> <h3 align="center">Vercel</h3> </a> <p align="center">Develop. Preview. Ship.</p> </p>

85 lines (79 loc) 3.31 kB
/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { edgeCacheDangerouslyDeleteBySrcImages } from "../funcs/edgeCacheDangerouslyDeleteBySrcImages.js"; import { edgeCacheDangerouslyDeleteByTags } from "../funcs/edgeCacheDangerouslyDeleteByTags.js"; import { edgeCacheInvalidateBySrcImages } from "../funcs/edgeCacheInvalidateBySrcImages.js"; import { edgeCacheInvalidateByTags } from "../funcs/edgeCacheInvalidateByTags.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import { DangerouslyDeleteBySrcImagesRequest } from "../models/dangerouslydeletebysrcimagesop.js"; import { DangerouslyDeleteByTagsRequest } from "../models/dangerouslydeletebytagsop.js"; import { InvalidateBySrcImagesRequest } from "../models/invalidatebysrcimagesop.js"; import { InvalidateByTagsRequest } from "../models/invalidatebytagsop.js"; import { unwrapAsync } from "../types/fp.js"; export class EdgeCache extends ClientSDK { /** * Invalidate by tag * * @remarks * Marks a cache tag as stale, causing cache entries associated with that tag to be revalidated in the background on the next request. */ async invalidateByTags( request: InvalidateByTagsRequest, options?: RequestOptions, ): Promise<void> { return unwrapAsync(edgeCacheInvalidateByTags( this, request, options, )); } /** * Dangerously delete by tag * * @remarks * Marks a cache tag as deleted, causing cache entries associated with that tag to be revalidated in the foreground on the next request. Use this method with caution because one tag can be associated with many paths and deleting the cache can cause many concurrent requests to the origin leading to cache stampede problem. This method is for advanced use cases and is not recommended; prefer using `invalidateByTag` instead. */ async dangerouslyDeleteByTags( request: DangerouslyDeleteByTagsRequest, options?: RequestOptions, ): Promise<void> { return unwrapAsync(edgeCacheDangerouslyDeleteByTags( this, request, options, )); } /** * Invalidate by source image * * @remarks * Marks a source image as stale, causing its corresponding transformed images to be revalidated in the background on the next request. */ async invalidateBySrcImages( request: InvalidateBySrcImagesRequest, options?: RequestOptions, ): Promise<void> { return unwrapAsync(edgeCacheInvalidateBySrcImages( this, request, options, )); } /** * Dangerously delete by source image * * @remarks * Marks a source image as deleted, causing cache entries associated with that source image to be revalidated in the foreground on the next request. Use this method with caution because one source image can be associated with many paths and deleting the cache can cause many concurrent requests to the origin leading to cache stampede problem. This method is for advanced use cases and is not recommended; prefer using `invalidateBySrcImage` instead. */ async dangerouslyDeleteBySrcImages( request: DangerouslyDeleteBySrcImagesRequest, options?: RequestOptions, ): Promise<void> { return unwrapAsync(edgeCacheDangerouslyDeleteBySrcImages( this, request, options, )); } }