@zuplo/runtime 6.40.20 → 6.40.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/esm/index.js +25 -25
- package/out/types/index.d.ts +54 -0
- package/package.json +1 -1
package/out/types/index.d.ts
CHANGED
|
@@ -5076,6 +5076,60 @@ export declare interface SleepInboundPolicyOptions {
|
|
|
5076
5076
|
|
|
5077
5077
|
/* Excluded from this release type: StandardEnv */
|
|
5078
5078
|
|
|
5079
|
+
/**
|
|
5080
|
+
* The StreamingZoneCache is a wrapper around the zone cache that allows
|
|
5081
|
+
* storing a ReadableStream by wrapping it in a Response. The key
|
|
5082
|
+
* is stored as the request URL for retrieval later.
|
|
5083
|
+
* @beta This is a beta feature and may change in the future.
|
|
5084
|
+
*/
|
|
5085
|
+
export declare class StreamingZoneCache {
|
|
5086
|
+
#private;
|
|
5087
|
+
/**
|
|
5088
|
+
* Construct a new StreamingZoneCache with a ZuploContext.
|
|
5089
|
+
* This will log debug messages using the provided context.
|
|
5090
|
+
* @param name - The name of the cache
|
|
5091
|
+
* @param context - The ZuploContext to use
|
|
5092
|
+
*/
|
|
5093
|
+
constructor(name: string, context: ZuploContext);
|
|
5094
|
+
/**
|
|
5095
|
+
* Construct a new StreamingZoneCache with CacheOptions.
|
|
5096
|
+
* Useful if the system is constructing this behind the scenes.
|
|
5097
|
+
* @param name - The name of the cache
|
|
5098
|
+
* @param context - The CacheOptions to use
|
|
5099
|
+
*/
|
|
5100
|
+
constructor(name: string, options: CacheOptions);
|
|
5101
|
+
/**
|
|
5102
|
+
* Retrieve a stream from the cache. If not found or expired, returns undefined.
|
|
5103
|
+
* Otherwise, returns the ReadableStream from the cached Response body.
|
|
5104
|
+
* @param key - The key to retrieve from the cache
|
|
5105
|
+
*/
|
|
5106
|
+
get(key: string): Promise<ReadableStream<Uint8Array> | undefined>;
|
|
5107
|
+
/**
|
|
5108
|
+
* Store a stream in the cache for a given TTL (in seconds). We wrap it in a Response
|
|
5109
|
+
* with a custom expiry header so we can handle local expiry.
|
|
5110
|
+
* @param key - The key to store in the cache
|
|
5111
|
+
* @param stream - The stream to store
|
|
5112
|
+
* @param ttlSeconds - The time-to-live in seconds
|
|
5113
|
+
*/
|
|
5114
|
+
put(key: string, stream: ReadableStream<Uint8Array>, ttlSeconds: number): Promise<void>;
|
|
5115
|
+
/**
|
|
5116
|
+
* Remove an entry from the cache if it exists. If there's an error, we try a fallback
|
|
5117
|
+
* approach that sets the local expiry to now.
|
|
5118
|
+
* @param key - The key to delete from the cache
|
|
5119
|
+
*/
|
|
5120
|
+
delete(key: string): Promise<void>;
|
|
5121
|
+
/**
|
|
5122
|
+
* In case we can't properly delete from the cache,
|
|
5123
|
+
* we overwrite it with an empty, immediately-expired Response.
|
|
5124
|
+
* @param key - The key to delete from the cache
|
|
5125
|
+
*/
|
|
5126
|
+
private deleteFallback;
|
|
5127
|
+
/**
|
|
5128
|
+
* Log internal debug messages to either the ZuploContext logger or the console.
|
|
5129
|
+
*/
|
|
5130
|
+
private logDebug;
|
|
5131
|
+
}
|
|
5132
|
+
|
|
5079
5133
|
/**
|
|
5080
5134
|
* Adds stripe monetization routes and configuration
|
|
5081
5135
|
* @beta
|