Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

botbuilder-azure-blobs

Package Overview
Dependencies
Maintainers
0
Versions
451
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

botbuilder-azure-blobs - npm Package Compare versions

Comparing version 4.23.1 to 4.23.2-dev1

28

lib/blobsStorage.js

@@ -150,11 +150,21 @@ "use strict";

yield this._initialize();
yield (0, p_map_1.default)(Object.entries(changes), (_a) => {
var [key, _b] = _a, { eTag = '' } = _b, change = __rest(_b, ["eTag"]);
const blob = this._containerClient.getBlockBlobClient((0, sanitizeBlobKey_1.sanitizeBlobKey)(key));
const serialized = JSON.stringify(change);
return blob.upload(serialized, serialized.length, {
conditions: typeof eTag === 'string' && eTag !== '*' ? { ifMatch: eTag } : {},
blobHTTPHeaders: { blobContentType: 'application/json' },
});
}, {
yield (0, p_map_1.default)(Object.entries(changes), (_a) => { var key, _b, eTag, change; return __awaiter(this, void 0, void 0, function* () {
[key, _b] = _a, { eTag = '' } = _b, change = __rest(_b, ["eTag"]);
try {
const blob = this._containerClient.getBlockBlobClient((0, sanitizeBlobKey_1.sanitizeBlobKey)(key));
const serialized = JSON.stringify(change);
return yield blob.upload(serialized, serialized.length, {
conditions: typeof eTag === 'string' && eTag !== '*' ? { ifMatch: eTag } : {},
blobHTTPHeaders: { blobContentType: 'application/json' },
});
}
catch (err) {
if (err.statusCode === 412) {
throw new Error(`Storage: error writing "${key}" due to eTag conflict.`);
}
else {
throw err;
}
}
}); }, {
concurrency: this._concurrency,

@@ -161,0 +171,0 @@ });

@@ -5,3 +5,3 @@ {

"description": "BotBuilder storage bindings for Azure Blobs services",
"version": "4.23.1",
"version": "4.23.2-dev1",
"license": "MIT",

@@ -32,4 +32,4 @@ "keywords": [

"@azure/storage-blob": "^12.24.0",
"botbuilder-core": "4.23.1",
"botbuilder-stdlib": "4.23.1-internal",
"botbuilder-core": "4.23.2-dev1",
"botbuilder-stdlib": "4.23.2-dev1.internal",
"p-map": "^4.0.0",

@@ -44,3 +44,3 @@ "zod": "^3.23.8",

"depcheck": "depcheck --config ../../.depcheckrc",
"lint": "eslint . --ext .js,.ts",
"lint": "eslint . --config ../../eslint.config.cjs",
"postbuild": "downlevel-dts lib _ts3.4/lib --checksum",

@@ -47,0 +47,0 @@ "test": "yarn build && nyc mocha --check-leaks tests",

@@ -57,3 +57,3 @@ // Copyright (c) Microsoft Corporation.

url = '',
credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential
credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,
) {

@@ -84,3 +84,3 @@ if (url != '' && credential != null) {

containerName,
options?.storagePipelineOptions
options?.storagePipelineOptions,
);

@@ -126,3 +126,3 @@

this._containerClient.getBlobClient(sanitizeBlobKey(key)).download(),
isStatusCodeError(404)
isStatusCodeError(404),
);

@@ -146,3 +146,3 @@

concurrency: this._concurrency,
}
},
)

@@ -165,14 +165,21 @@ ).reduce((acc, { key, value }) => (value ? { ...acc, [key]: value } : acc), {});

Object.entries(changes),
([key, { eTag = '', ...change }]) => {
const blob = this._containerClient.getBlockBlobClient(sanitizeBlobKey(key));
const serialized = JSON.stringify(change);
return blob.upload(serialized, serialized.length, {
conditions: typeof eTag === 'string' && eTag !== '*' ? { ifMatch: eTag } : {},
blobHTTPHeaders: { blobContentType: 'application/json' },
});
async ([key, { eTag = '', ...change }]) => {
try {
const blob = this._containerClient.getBlockBlobClient(sanitizeBlobKey(key));
const serialized = JSON.stringify(change);
return await blob.upload(serialized, serialized.length, {
conditions: typeof eTag === 'string' && eTag !== '*' ? { ifMatch: eTag } : {},
blobHTTPHeaders: { blobContentType: 'application/json' },
});
} catch (err: any) {
if (err.statusCode === 412) {
throw new Error(`Storage: error writing "${key}" due to eTag conflict.`);
} else {
throw err;
}
}
},
{
concurrency: this._concurrency,
}
},
);

@@ -197,5 +204,5 @@ }

concurrency: this._concurrency,
}
},
);
}
}

@@ -47,3 +47,3 @@ // Copyright (c) Microsoft Corporation.

[activity.channelId, activity.conversation.id, `${formatTicks(timestamp)}-${activity.id}.json`].join('/'),
options
options,
);

@@ -106,3 +106,3 @@ }

blobServiceUri = '',
tokenCredential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential
tokenCredential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential,
) {

@@ -121,3 +121,3 @@ if (blobServiceUri != '' && tokenCredential != null) {

tokenCredential,
options?.storagePipelineOptions
options?.storagePipelineOptions,
);

@@ -138,3 +138,3 @@

containerName,
options?.storagePipelineOptions
options?.storagePipelineOptions,
);

@@ -177,3 +177,3 @@

continuationToken?: string,
startDate?: Date
startDate?: Date,
): Promise<PagedResult<Activity>> {

@@ -203,3 +203,3 @@ z.object({ channelId: z.string(), conversationId: z.string() }).parse({ channelId, conversationId });

? blobItems.findIndex(
(blobItem) => blobItem?.properties?.createdOn && blobItem?.properties?.createdOn >= startDate
(blobItem) => blobItem?.properties?.createdOn && blobItem?.properties?.createdOn >= startDate,
)

@@ -222,3 +222,3 @@ : 0;

},
{ concurrency: this._concurrency }
{ concurrency: this._concurrency },
);

@@ -225,0 +225,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc