@netlify/cache
Advanced tools
| 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 }; |
@@ -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 }; |
+6
-1
@@ -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
-1
@@ -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
-1
@@ -1,2 +0,2 @@ | ||
| import { N as NetlifyCache } from './cache-BHHI9pin.js'; | ||
| import { N as NetlifyCache } from './cache-Boq7iRAh.js'; | ||
@@ -3,0 +3,0 @@ /** |
+6
-1
@@ -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; |
+3
-3
| { | ||
| "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 }; |
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
59982
0.58%1446
0.7%+ Added
- Removed
Updated