@mastra/azure 0.0.0
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.
- package/CHANGELOG.md +12 -0
- package/dist/blob/filesystem/index.d.ts +119 -0
- package/dist/blob/filesystem/index.d.ts.map +1 -0
- package/dist/blob/index.cjs +16 -0
- package/dist/blob/index.cjs.map +1 -0
- package/dist/blob/index.d.ts +8 -0
- package/dist/blob/index.d.ts.map +1 -0
- package/dist/blob/index.js +3 -0
- package/dist/blob/index.js.map +1 -0
- package/dist/blob/provider.d.ts +4 -0
- package/dist/blob/provider.d.ts.map +1 -0
- package/dist/chunk-LLH5EI3J.cjs +573 -0
- package/dist/chunk-LLH5EI3J.cjs.map +1 -0
- package/dist/chunk-VFZDLQDB.js +570 -0
- package/dist/chunk-VFZDLQDB.js.map +1 -0
- package/dist/index.cjs +16 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/package.json +86 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# @mastra/azure
|
|
2
|
+
|
|
3
|
+
## 0.2.0-alpha.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add `@mastra/azure`, exporting an Azure Blob Storage `WorkspaceFilesystem` provider via `@mastra/azure/blob` with support for connection string, account key, SAS token, `DefaultAzureCredential`, and anonymous auth, plus prefix namespacing and read-only mode. ([#15217](https://github.com/mastra-ai/mastra/pull/15217))
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`c04417b`](https://github.com/mastra-ai/mastra/commit/c04417ba0a2e4ded66da4352331ef29cd4bd1d79), [`cf25a03`](https://github.com/mastra-ai/mastra/commit/cf25a03132164b9dc1e5dccf7394824e33007c51), [`ba6b0c5`](https://github.com/mastra-ai/mastra/commit/ba6b0c51bfce358554fd33c7f2bcd5593633f2ff)]:
|
|
12
|
+
- @mastra/core@1.29.0-alpha.3
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Azure Blob Storage Filesystem Provider
|
|
3
|
+
*
|
|
4
|
+
* A filesystem implementation backed by Azure Blob Storage.
|
|
5
|
+
*/
|
|
6
|
+
import type { ContainerClient } from '@azure/storage-blob';
|
|
7
|
+
import type { FileContent, FileStat, FileEntry, ReadOptions, WriteOptions, ListOptions, RemoveOptions, CopyOptions, FilesystemInfo, FilesystemMountConfig, FilesystemIcon, ProviderStatus, MastraFilesystemOptions } from '@mastra/core/workspace';
|
|
8
|
+
import { MastraFilesystem } from '@mastra/core/workspace';
|
|
9
|
+
/**
|
|
10
|
+
* Azure Blob mount configuration.
|
|
11
|
+
* Returned by AzureBlobFilesystem.getMountConfig() for FUSE mounting in sandboxes.
|
|
12
|
+
*/
|
|
13
|
+
export interface AzureBlobMountConfig extends FilesystemMountConfig {
|
|
14
|
+
type: 'azure-blob';
|
|
15
|
+
container: string;
|
|
16
|
+
accountName?: string;
|
|
17
|
+
accountKey?: string;
|
|
18
|
+
sasToken?: string;
|
|
19
|
+
connectionString?: string;
|
|
20
|
+
useDefaultCredential?: boolean;
|
|
21
|
+
endpoint?: string;
|
|
22
|
+
readOnly?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface AzureBlobFilesystemOptions extends MastraFilesystemOptions {
|
|
25
|
+
/** Unique identifier for this filesystem instance */
|
|
26
|
+
id?: string;
|
|
27
|
+
/** Azure Blob container name */
|
|
28
|
+
container: string;
|
|
29
|
+
/** Human-friendly display name for the UI */
|
|
30
|
+
displayName?: string;
|
|
31
|
+
/** Icon identifier for the UI (defaults to 'azure-blob') */
|
|
32
|
+
icon?: FilesystemIcon;
|
|
33
|
+
/** Description shown in tooltips */
|
|
34
|
+
description?: string;
|
|
35
|
+
/** Storage account name (required unless using connectionString) */
|
|
36
|
+
accountName?: string;
|
|
37
|
+
/** Storage account key */
|
|
38
|
+
accountKey?: string;
|
|
39
|
+
/** SAS token for authentication */
|
|
40
|
+
sasToken?: string;
|
|
41
|
+
/** Full connection string (takes priority over accountName/accountKey) */
|
|
42
|
+
connectionString?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Use DefaultAzureCredential from @azure/identity for authentication.
|
|
45
|
+
* Supports Managed Identity, Azure CLI, environment variables, etc.
|
|
46
|
+
* Requires @azure/identity to be installed as a peer dependency.
|
|
47
|
+
*/
|
|
48
|
+
useDefaultCredential?: boolean;
|
|
49
|
+
/** Optional prefix for all keys (acts like a subdirectory) */
|
|
50
|
+
prefix?: string;
|
|
51
|
+
/** Mount as read-only (blocks write operations, mounts read-only in sandboxes) */
|
|
52
|
+
readOnly?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Custom endpoint URL.
|
|
55
|
+
* Used for local development with Azurite emulator.
|
|
56
|
+
*/
|
|
57
|
+
endpoint?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare class AzureBlobFilesystem extends MastraFilesystem {
|
|
60
|
+
readonly id: string;
|
|
61
|
+
readonly name = "AzureBlobFilesystem";
|
|
62
|
+
readonly provider = "azure-blob";
|
|
63
|
+
readonly readOnly?: boolean;
|
|
64
|
+
status: ProviderStatus;
|
|
65
|
+
readonly displayName?: string;
|
|
66
|
+
readonly icon: FilesystemIcon;
|
|
67
|
+
readonly description?: string;
|
|
68
|
+
private readonly containerName;
|
|
69
|
+
private readonly accountName?;
|
|
70
|
+
private readonly accountKey?;
|
|
71
|
+
private readonly sasToken?;
|
|
72
|
+
private readonly connectionString?;
|
|
73
|
+
private readonly useDefaultCredential;
|
|
74
|
+
private readonly prefix;
|
|
75
|
+
private readonly endpoint?;
|
|
76
|
+
private _containerClient;
|
|
77
|
+
constructor(options: AzureBlobFilesystemOptions);
|
|
78
|
+
/**
|
|
79
|
+
* Get the underlying ContainerClient for direct access to Azure Blob APIs.
|
|
80
|
+
*
|
|
81
|
+
* Use this when you need features not exposed through the WorkspaceFilesystem
|
|
82
|
+
* interface (e.g., SAS URL generation, lease management, etc.).
|
|
83
|
+
*
|
|
84
|
+
* This is async because DefaultAzureCredential requires a dynamic import.
|
|
85
|
+
* For non-DefaultAzureCredential auth methods, the promise resolves immediately.
|
|
86
|
+
*/
|
|
87
|
+
getContainer(): Promise<ContainerClient>;
|
|
88
|
+
getMountConfig(): AzureBlobMountConfig;
|
|
89
|
+
getInfo(): FilesystemInfo<{
|
|
90
|
+
container: string;
|
|
91
|
+
endpoint?: string;
|
|
92
|
+
prefix?: string;
|
|
93
|
+
}>;
|
|
94
|
+
getInstructions(): string;
|
|
95
|
+
private getContainerClient;
|
|
96
|
+
private getReadyContainer;
|
|
97
|
+
private toKey;
|
|
98
|
+
private handleError;
|
|
99
|
+
private assertWritable;
|
|
100
|
+
readFile(path: string, options?: ReadOptions): Promise<string | Buffer>;
|
|
101
|
+
writeFile(path: string, content: FileContent, options?: WriteOptions): Promise<void>;
|
|
102
|
+
appendFile(path: string, content: FileContent): Promise<void>;
|
|
103
|
+
deleteFile(path: string, options?: RemoveOptions): Promise<void>;
|
|
104
|
+
copyFile(src: string, dest: string, options?: CopyOptions): Promise<void>;
|
|
105
|
+
moveFile(src: string, dest: string, options?: CopyOptions): Promise<void>;
|
|
106
|
+
mkdir(_path: string, _options?: {
|
|
107
|
+
recursive?: boolean;
|
|
108
|
+
}): Promise<void>;
|
|
109
|
+
rmdir(path: string, options?: RemoveOptions): Promise<void>;
|
|
110
|
+
private deleteBlobBatch;
|
|
111
|
+
readdir(path: string, options?: ListOptions): Promise<FileEntry[]>;
|
|
112
|
+
exists(path: string): Promise<boolean>;
|
|
113
|
+
stat(path: string): Promise<FileStat>;
|
|
114
|
+
isFile(path: string): Promise<boolean>;
|
|
115
|
+
isDirectory(path: string): Promise<boolean>;
|
|
116
|
+
init(): Promise<void>;
|
|
117
|
+
destroy(): Promise<void>;
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=index.d.ts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OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAsFlE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAiBtC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiDrC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAStC,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe3C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA+BrB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkLLH5EI3J_cjs = require('../chunk-LLH5EI3J.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "AzureBlobFilesystem", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function () { return chunkLLH5EI3J_cjs.AzureBlobFilesystem; }
|
|
10
|
+
});
|
|
11
|
+
Object.defineProperty(exports, "azureBlobFilesystemProvider", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () { return chunkLLH5EI3J_cjs.azureBlobFilesystemProvider; }
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=index.cjs.map
|
|
16
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @mastra/azure/blob - Azure Blob Storage Filesystem Provider
|
|
3
|
+
*
|
|
4
|
+
* A filesystem implementation backed by Azure Blob Storage.
|
|
5
|
+
*/
|
|
6
|
+
export { AzureBlobFilesystem, type AzureBlobFilesystemOptions, type AzureBlobMountConfig } from './filesystem/index.js';
|
|
7
|
+
export { azureBlobFilesystemProvider } from './provider.js';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/blob/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,KAAK,0BAA0B,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC/G,OAAO,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { FilesystemProvider } from '@mastra/core/editor';
|
|
2
|
+
import type { AzureBlobFilesystemOptions } from './filesystem/index.js';
|
|
3
|
+
export declare const azureBlobFilesystemProvider: FilesystemProvider<AzureBlobFilesystemOptions>;
|
|
4
|
+
//# sourceMappingURL=provider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/blob/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAE/D,eAAO,MAAM,2BAA2B,EAAE,kBAAkB,CAAC,0BAA0B,CAwBtF,CAAC"}
|