You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@netlify/blobs

Package Overview
Dependencies
Maintainers
23
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/blobs - npm Package Compare versions

Comparing version

to
7.2.0

dist/chunk-O22O2XCC.js

23

dist/main.d.ts

@@ -0,1 +1,18 @@

declare global {
var netlifyBlobsContext: unknown;
}
/**
* The context object that we expect in the environment.
*/
interface EnvironmentContext {
apiURL?: string;
deployID?: string;
edgeURL?: string;
primaryRegion?: string;
siteID?: string;
token?: string;
uncachedEdgeURL?: string;
}
declare const setEnvironmentContext: (context: EnvironmentContext) => void;
type BlobInput = string | ArrayBuffer | Blob;

@@ -18,6 +35,2 @@ type Fetcher = typeof globalThis.fetch;

declare global {
var netlifyBlobsContext: unknown;
}
type Metadata = Record<string, unknown>;

@@ -210,2 +223,2 @@

export { BlobResponseType, GetWithMetadataOptions, GetWithMetadataResult, ListOptions, ListResultBlob, SetOptions, Store, StoreOptions, connectLambda, getDeployStore, getStore, listStores };
export { BlobResponseType, GetWithMetadataOptions, GetWithMetadataResult, ListOptions, ListResultBlob, SetOptions, Store, StoreOptions, connectLambda, getDeployStore, getStore, listStores, setEnvironmentContext };

@@ -11,3 +11,3 @@ import {

setEnvironmentContext
} from "./chunk-22ENLWYG.js";
} from "./chunk-O22O2XCC.js";

@@ -377,3 +377,4 @@ // src/lambda_compat.ts

getStore,
listStores
listStores,
setEnvironmentContext
};

@@ -12,2 +12,6 @@ import http from 'node:http';

}
type OnRequestCallback = (parameters: {
type: Operation;
url: string;
}) => void;
interface BlobsServerOptions {

@@ -30,5 +34,3 @@ /**

*/
onRequest?: (parameters: {
type: Operation;
}) => void;
onRequest?: OnRequestCallback;
/**

@@ -49,3 +51,3 @@ * Port to run the server on. Defaults to a random port.

private logger;
private onRequest;
private onRequest?;
private port;

@@ -56,2 +58,3 @@ private server?;

constructor({ debug, directory, logger, onRequest, port, token }: BlobsServerOptions);
private dispatchOnRequestEvent;
logDebug(...message: unknown[]): void;

@@ -118,2 +121,2 @@ delete(req: http.IncomingMessage, res: http.ServerResponse): Promise<void>;

export { BlobsServer, Operation };
export { BlobsServer, OnRequestCallback, Operation };

@@ -7,3 +7,3 @@ import {

isNodeError
} from "./chunk-22ENLWYG.js";
} from "./chunk-O22O2XCC.js";

@@ -37,4 +37,3 @@ // src/server.ts

this.logger = logger ?? console.log;
this.onRequest = onRequest ?? (() => {
});
this.onRequest = onRequest;
this.port = port || 0;

@@ -44,2 +43,9 @@ this.token = token;

}
dispatchOnRequestEvent(type, url) {
if (!this.onRequest) {
return;
}
const urlPath = url instanceof URL ? url.pathname + url.search : url;
this.onRequest({ type, url: urlPath });
}
logDebug(...message) {

@@ -90,3 +96,3 @@ if (!this.debug) {

}
this.onRequest({ type: "get" /* GET */ });
this.dispatchOnRequestEvent("get" /* GET */, url);
const headers = {};

@@ -140,3 +146,2 @@ try {

async listBlobs(options) {
this.onRequest({ type: "list" /* LIST */ });
const { dataPath, rootPath, req, res, url } = options;

@@ -149,2 +154,3 @@ const directories = url.searchParams.get("directories") === "true";

};
this.dispatchOnRequestEvent("list" /* LIST */, url);
try {

@@ -228,3 +234,3 @@ await _BlobsServer.walk({ directories, path: dataPath, prefix, rootPath, result });

case "delete" /* DELETE */: {
this.onRequest({ type: "delete" /* DELETE */ });
this.dispatchOnRequestEvent("delete" /* DELETE */, req.url);
return this.delete(req, res);

@@ -236,7 +242,7 @@ }

case "put" /* PUT */: {
this.onRequest({ type: "set" /* SET */ });
this.dispatchOnRequestEvent("set" /* SET */, req.url);
return this.put(req, res);
}
case "head" /* HEAD */: {
this.onRequest({ type: "getMetadata" /* GET_METADATA */ });
this.dispatchOnRequestEvent("getMetadata" /* GET_METADATA */, req.url);
return this.head(req, res);

@@ -243,0 +249,0 @@ }

{
"name": "@netlify/blobs",
"version": "7.1.0",
"version": "7.2.0",
"description": "A JavaScript client for the Netlify Blob Store",

@@ -5,0 +5,0 @@ "type": "module",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet