@microsoft/agents-hosting-storage-blob 0.5.12-g2d752e9b13 → 0.5.16-g6bdf69cc43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TokenCredential } from '@azure/core-auth';
|
|
1
2
|
import { AnonymousCredential, StoragePipelineOptions, StorageSharedKeyCredential } from '@azure/storage-blob';
|
|
2
3
|
import { Storage, StoreItems } from '@microsoft/agents-hosting';
|
|
3
4
|
/**
|
|
@@ -20,13 +21,13 @@ export declare class BlobsStorage implements Storage {
|
|
|
20
21
|
/**
|
|
21
22
|
* Creates a new instance of the BlobsStorage class.
|
|
22
23
|
*
|
|
23
|
-
* @param connectionString The Azure Storage connection string
|
|
24
24
|
* @param containerName The name of the Blob container to use
|
|
25
|
+
* @param connectionString Optional, The Azure Storage connection string
|
|
25
26
|
* @param options Optional configuration settings for the storage provider
|
|
26
27
|
* @param url Optional URL to the blob service (used instead of connectionString if provided)
|
|
27
28
|
* @param credential Optional credential for authentication (used with url if provided)
|
|
28
29
|
*/
|
|
29
|
-
constructor(
|
|
30
|
+
constructor(containerName: string, connectionString?: string, options?: BlobsStorageOptions, url?: string, credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential);
|
|
30
31
|
private toJSON;
|
|
31
32
|
private _initialize;
|
|
32
33
|
/**
|
package/dist/src/blobsStorage.js
CHANGED
|
@@ -50,13 +50,13 @@ class BlobsStorage {
|
|
|
50
50
|
/**
|
|
51
51
|
* Creates a new instance of the BlobsStorage class.
|
|
52
52
|
*
|
|
53
|
-
* @param connectionString The Azure Storage connection string
|
|
54
53
|
* @param containerName The name of the Blob container to use
|
|
54
|
+
* @param connectionString Optional, The Azure Storage connection string
|
|
55
55
|
* @param options Optional configuration settings for the storage provider
|
|
56
56
|
* @param url Optional URL to the blob service (used instead of connectionString if provided)
|
|
57
57
|
* @param credential Optional credential for authentication (used with url if provided)
|
|
58
58
|
*/
|
|
59
|
-
constructor(
|
|
59
|
+
constructor(containerName, connectionString, options, url = '', credential) {
|
|
60
60
|
this._concurrency = Infinity;
|
|
61
61
|
if (url !== '' && credential != null) {
|
|
62
62
|
z.object({ url: z.string() }).parse({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blobsStorage.js","sourceRoot":"","sources":["../../src/blobsStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,iEAA8C;
|
|
1
|
+
{"version":3,"file":"blobsStorage.js","sourceRoot":"","sources":["../../src/blobsStorage.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAwB;AACxB,iEAA8C;AAE9C,sDAK4B;AAE5B,iEAAwD;AACxD,+CAA8D;AAY9D;;;GAGG;AACH,MAAa,YAAY;IAKvB;;;;;;;;OAQG;IACH,YACE,aAAqB,EACrB,gBAAyB,EACzB,OAA6B,EAC7B,GAAG,GAAG,EAAE,EACR,UAA+E;QAjBhE,iBAAY,GAAG,QAAQ,CAAA;QAmBtC,IAAI,GAAG,KAAK,EAAE,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YACrC,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC;gBAClC,GAAG;aACJ,CAAC,CAAA;YAEF,IAAI,CAAC,gBAAgB,GAAG,IAAI,8BAAe,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,sBAAsB,CAAC,CAAA;YAE7F,IAAI,GAAG,CAAC,IAAI,EAAE,KAAK,6BAA6B,EAAE,CAAC;gBACjD,IAAI,CAAC,YAAY,GAAG,CAAC,CAAA;YACvB,CAAC;QACH,CAAC;aAAM,CAAC;YACN,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE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D,oCAkJC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@microsoft/agents-hosting-storage-blob",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.16-g6bdf69cc43",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"types": "dist/src/index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@azure/storage-blob": "^12.27.0",
|
|
20
|
-
"@microsoft/agents-hosting": "0.5.
|
|
20
|
+
"@microsoft/agents-hosting": "0.5.16-g6bdf69cc43"
|
|
21
21
|
},
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"files": [
|
|
@@ -33,6 +33,6 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
36
|
+
"node": ">=20.0.0"
|
|
37
37
|
}
|
|
38
38
|
}
|
package/src/blobsStorage.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod'
|
|
2
2
|
import StreamConsumers from 'stream/consumers'
|
|
3
|
+
import { TokenCredential } from '@azure/core-auth'
|
|
3
4
|
import {
|
|
4
5
|
AnonymousCredential,
|
|
5
6
|
ContainerClient,
|
|
@@ -32,18 +33,18 @@ export class BlobsStorage implements Storage {
|
|
|
32
33
|
/**
|
|
33
34
|
* Creates a new instance of the BlobsStorage class.
|
|
34
35
|
*
|
|
35
|
-
* @param connectionString The Azure Storage connection string
|
|
36
36
|
* @param containerName The name of the Blob container to use
|
|
37
|
+
* @param connectionString Optional, The Azure Storage connection string
|
|
37
38
|
* @param options Optional configuration settings for the storage provider
|
|
38
39
|
* @param url Optional URL to the blob service (used instead of connectionString if provided)
|
|
39
40
|
* @param credential Optional credential for authentication (used with url if provided)
|
|
40
41
|
*/
|
|
41
42
|
constructor (
|
|
42
|
-
connectionString: string,
|
|
43
43
|
containerName: string,
|
|
44
|
+
connectionString?: string,
|
|
44
45
|
options?: BlobsStorageOptions,
|
|
45
46
|
url = '',
|
|
46
|
-
credential?: StorageSharedKeyCredential | AnonymousCredential
|
|
47
|
+
credential?: StorageSharedKeyCredential | AnonymousCredential | TokenCredential
|
|
47
48
|
) {
|
|
48
49
|
if (url !== '' && credential != null) {
|
|
49
50
|
z.object({ url: z.string() }).parse({
|
|
@@ -62,12 +63,12 @@ export class BlobsStorage implements Storage {
|
|
|
62
63
|
})
|
|
63
64
|
|
|
64
65
|
this._containerClient = new ContainerClient(
|
|
65
|
-
connectionString
|
|
66
|
+
connectionString!,
|
|
66
67
|
containerName,
|
|
67
68
|
options?.storagePipelineOptions
|
|
68
69
|
)
|
|
69
70
|
|
|
70
|
-
if (connectionString
|
|
71
|
+
if (connectionString!.trim() === 'UseDevelopmentStorage=true;') {
|
|
71
72
|
this._concurrency = 1
|
|
72
73
|
}
|
|
73
74
|
}
|