Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@netlify/cache

Package Overview
Dependencies
Maintainers
16
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/cache - npm Package Compare versions

Comparing version
1.9.0
to
1.10.0
+40
dist/cache-Boq7iRAh.d.cts
type Logger = (...args: any[]) => void;
interface EnvironmentOptions {
getContext: RequestContextFactory;
userAgent?: string;
}
declare enum Operation {
Delete = "delete",
Read = "read",
Write = "write"
}
type RequestContextFactory = (options: {
operation: Operation;
}) => RequestContext | null;
interface RequestContext {
host: string;
logger?: Logger;
token: string;
url: string;
}
type NetlifyCacheOptions = EnvironmentOptions & {
name: string;
};
declare const getInternalHeaders: unique symbol;
declare const serializeResourceHeaders: unique symbol;
declare class NetlifyCache implements Cache {
#private;
constructor({ getContext, name, userAgent }: NetlifyCacheOptions);
private [getInternalHeaders];
private [serializeResourceHeaders];
add(request: RequestInfo | URL): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
delete(request: RequestInfo | URL): Promise<boolean>;
keys(_request?: Request | URL): Promise<never[]>;
match(request: RequestInfo | URL): Promise<Response | undefined>;
matchAll(request?: RequestInfo | URL, _options?: CacheQueryOptions): Promise<readonly Response[]>;
put(request: RequestInfo | URL, response: Response): Promise<void>;
}
export { type EnvironmentOptions as E, NetlifyCache as N, Operation as O, type RequestContextFactory as R };
type Logger = (...args: any[]) => void;
interface EnvironmentOptions {
getContext: RequestContextFactory;
userAgent?: string;
}
declare enum Operation {
Delete = "delete",
Read = "read",
Write = "write"
}
type RequestContextFactory = (options: {
operation: Operation;
}) => RequestContext | null;
interface RequestContext {
host: string;
logger?: Logger;
token: string;
url: string;
}
type NetlifyCacheOptions = EnvironmentOptions & {
name: string;
};
declare const getInternalHeaders: unique symbol;
declare const serializeResourceHeaders: unique symbol;
declare class NetlifyCache implements Cache {
#private;
constructor({ getContext, name, userAgent }: NetlifyCacheOptions);
private [getInternalHeaders];
private [serializeResourceHeaders];
add(request: RequestInfo | URL): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
delete(request: RequestInfo | URL): Promise<boolean>;
keys(_request?: Request | URL): Promise<never[]>;
match(request: RequestInfo | URL): Promise<Response | undefined>;
matchAll(request?: RequestInfo | URL, _options?: CacheQueryOptions): Promise<readonly Response[]>;
put(request: RequestInfo | URL, response: Response): Promise<void>;
}
export { type EnvironmentOptions as E, NetlifyCache as N, Operation as O, type RequestContextFactory as R };
+3
-3

@@ -1,3 +0,3 @@

import { E as EnvironmentOptions } from '../cache-BHHI9pin.cjs';
export { N as NetlifyCache, O as Operation, R as RequestContextFactory } from '../cache-BHHI9pin.cjs';
import { E as EnvironmentOptions } from '../cache-Boq7iRAh.cjs';
export { N as NetlifyCache, O as Operation, R as RequestContextFactory } from '../cache-Boq7iRAh.cjs';

@@ -11,5 +11,5 @@ declare class NetlifyCacheStorage {

keys(): Promise<string[]>;
match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
}
export { NetlifyCacheStorage };

@@ -1,3 +0,3 @@

import { E as EnvironmentOptions } from '../cache-BHHI9pin.js';
export { N as NetlifyCache, O as Operation, R as RequestContextFactory } from '../cache-BHHI9pin.js';
import { E as EnvironmentOptions } from '../cache-Boq7iRAh.js';
export { N as NetlifyCache, O as Operation, R as RequestContextFactory } from '../cache-Boq7iRAh.js';

@@ -11,5 +11,5 @@ declare class NetlifyCacheStorage {

keys(): Promise<string[]>;
match(request: RequestInfo, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
match(request: RequestInfo | URL, options?: MultiCacheQueryOptions): Promise<Response | undefined>;
}
export { NetlifyCacheStorage };

@@ -354,3 +354,8 @@ "use strict";

} else {
await cachePut;
const requestContext = globalThis.Netlify?.context;
if (requestContext) {
requestContext.waitUntil(cachePut);
} else {
await cachePut;
}
}

@@ -357,0 +362,0 @@ return clientResponse;

@@ -1,2 +0,2 @@

import { N as NetlifyCache } from './cache-BHHI9pin.cjs';
import { N as NetlifyCache } from './cache-Boq7iRAh.cjs';

@@ -3,0 +3,0 @@ /**

@@ -1,2 +0,2 @@

import { N as NetlifyCache } from './cache-BHHI9pin.js';
import { N as NetlifyCache } from './cache-Boq7iRAh.js';

@@ -3,0 +3,0 @@ /**

@@ -320,3 +320,8 @@ // src/polyfill.ts

} else {
await cachePut;
const requestContext = globalThis.Netlify?.context;
if (requestContext) {
requestContext.waitUntil(cachePut);
} else {
await cachePut;
}
}

@@ -323,0 +328,0 @@ return clientResponse;

{
"name": "@netlify/cache",
"version": "1.9.0",
"version": "1.10.0",
"description": "TypeScript utilities for interacting with the Netlify cache",

@@ -70,3 +70,3 @@ "type": "module",

"devDependencies": {
"@netlify/dev-utils": "2.0.0",
"@netlify/dev-utils": "2.1.0",
"npm-run-all2": "^7.0.2",

@@ -79,4 +79,4 @@ "semver": "^7.5.3",

"dependencies": {
"@netlify/runtime-utils": "1.1.0"
"@netlify/runtime-utils": "1.2.0"
}
}
type Logger = (...args: any[]) => void;
interface EnvironmentOptions {
getContext: RequestContextFactory;
userAgent?: string;
}
declare enum Operation {
Delete = "delete",
Read = "read",
Write = "write"
}
type RequestContextFactory = (options: {
operation: Operation;
}) => RequestContext | null;
interface RequestContext {
host: string;
logger?: Logger;
token: string;
url: string;
}
type NetlifyCacheOptions = EnvironmentOptions & {
name: string;
};
declare const getInternalHeaders: unique symbol;
declare const serializeResourceHeaders: unique symbol;
declare class NetlifyCache implements Cache {
#private;
constructor({ getContext, name, userAgent }: NetlifyCacheOptions);
private [getInternalHeaders];
private [serializeResourceHeaders];
add(request: RequestInfo): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
delete(request: RequestInfo): Promise<boolean>;
keys(_request?: Request): Promise<never[]>;
match(request: RequestInfo): Promise<Response | undefined>;
matchAll(request?: RequestInfo, _options?: CacheQueryOptions): Promise<readonly Response[]>;
put(request: RequestInfo | URL | string, response: Response): Promise<void>;
}
export { type EnvironmentOptions as E, NetlifyCache as N, Operation as O, type RequestContextFactory as R };
type Logger = (...args: any[]) => void;
interface EnvironmentOptions {
getContext: RequestContextFactory;
userAgent?: string;
}
declare enum Operation {
Delete = "delete",
Read = "read",
Write = "write"
}
type RequestContextFactory = (options: {
operation: Operation;
}) => RequestContext | null;
interface RequestContext {
host: string;
logger?: Logger;
token: string;
url: string;
}
type NetlifyCacheOptions = EnvironmentOptions & {
name: string;
};
declare const getInternalHeaders: unique symbol;
declare const serializeResourceHeaders: unique symbol;
declare class NetlifyCache implements Cache {
#private;
constructor({ getContext, name, userAgent }: NetlifyCacheOptions);
private [getInternalHeaders];
private [serializeResourceHeaders];
add(request: RequestInfo): Promise<void>;
addAll(requests: RequestInfo[]): Promise<void>;
delete(request: RequestInfo): Promise<boolean>;
keys(_request?: Request): Promise<never[]>;
match(request: RequestInfo): Promise<Response | undefined>;
matchAll(request?: RequestInfo, _options?: CacheQueryOptions): Promise<readonly Response[]>;
put(request: RequestInfo | URL | string, response: Response): Promise<void>;
}
export { type EnvironmentOptions as E, NetlifyCache as N, Operation as O, type RequestContextFactory as R };