botbuilder-azure-blobs
Advanced tools
Comparing version 4.23.1 to 4.23.2-dev1
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88597
1443
2
+ Addedbotbuilder-core@4.23.2-dev1(transitive)
+ Addedbotbuilder-dialogs-adaptive-runtime-core@4.23.2-dev1.preview(transitive)
+ Addedbotbuilder-stdlib@4.23.2-dev1.internal(transitive)
+ Addedbotframework-connector@4.23.2-dev1(transitive)
+ Addedbotframework-schema@4.23.2-dev1(transitive)
+ Addedeslint-plugin-only-warn@1.1.0(transitive)
- Removedasn1.js@4.10.1(transitive)
- Removedbn.js@4.12.15.2.1(transitive)
- Removedbotbuilder-core@4.23.1(transitive)
- Removedbotbuilder-dialogs-adaptive-runtime-core@4.23.1-preview(transitive)
- Removedbotbuilder-stdlib@4.23.1-internal(transitive)
- Removedbotframework-connector@4.23.1(transitive)
- Removedbotframework-schema@4.23.1(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedbrowserify-aes@1.2.0(transitive)
- Removedbrowserify-cipher@1.0.1(transitive)
- Removedbrowserify-des@1.0.2(transitive)
- Removedbrowserify-rsa@4.1.1(transitive)
- Removedbrowserify-sign@4.2.3(transitive)
- Removedbuffer-xor@1.0.3(transitive)
- Removedbuiltin-status-codes@3.0.0(transitive)
- Removedcipher-base@1.0.6(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcreate-ecdh@4.0.4(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedcreate-hmac@1.1.7(transitive)
- Removedcrypto-browserify@3.12.1(transitive)
- Removeddes.js@1.1.0(transitive)
- Removeddiffie-hellman@5.0.3(transitive)
- Removedelliptic@6.6.1(transitive)
- Removedevp_bytestokey@1.0.3(transitive)
- Removedhash-base@3.0.5(transitive)
- Removedhash.js@1.1.7(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedhttps-browserify@1.0.0(transitive)
- Removedinherits@2.0.4(transitive)
- Removedisarray@1.0.0(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedmiller-rabin@4.0.1(transitive)
- Removedminimalistic-assert@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedparse-asn1@5.1.7(transitive)
- Removedpbkdf2@3.1.2(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedpublic-encrypt@4.0.3(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedrandomfill@1.0.4(transitive)
- Removedreadable-stream@2.3.83.6.2(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedstream-browserify@3.0.0(transitive)
- Removedstream-http@3.2.0(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedxtend@4.0.2(transitive)
Updatedbotbuilder-core@4.23.2-dev1