Creates a new GraphQLFileStorageClient instance.
The GraphQL data provider to use for queries
Copy an object within the storage account.
The ID of the FileStorageAccount
The source name/path of the object
The destination name/path for the copy
A Promise that resolves to true if the object was copied successfully
Copy an object between two different storage accounts.
The ID of the source FileStorageAccount
The ID of the destination FileStorageAccount
The source path of the object
The destination path for the copy
A Promise that resolves to the copy result
Create a directory in the storage account.
The ID of the FileStorageAccount
The directory path to create
A Promise that resolves to true if the directory was created successfully
Create a pre-authenticated URL for downloading a file.
The ID of the FileStorageAccount
The name/path of the object to download
A Promise that resolves to the download URL
Create a pre-authenticated URL for uploading a file.
The ID of the FileStorageAccount
The name/path of the object to upload
OptionalcontentType: stringOptional content type for the file
A Promise that resolves to the upload URL and provider key
Delete an object from the storage account.
The ID of the FileStorageAccount
The name/path of the object to delete
A Promise that resolves to true if the object was deleted successfully
Check if a directory exists in the storage account.
The ID of the FileStorageAccount
The directory path to check
A Promise that resolves to true if the directory exists
List objects in a storage account at the specified path.
The ID of the FileStorageAccount
The path prefix to list objects from (e.g., 'documents/')
Optionaldelimiter: stringOptional delimiter for grouping results (default: '/')
A Promise that resolves to a StorageListResult
Move/rename an object within the storage account.
The ID of the FileStorageAccount
The current name/path of the object
The new name/path for the object
A Promise that resolves to true if the object was moved successfully
Check if an object exists in the storage account.
The ID of the FileStorageAccount
The name/path of the object to check
A Promise that resolves to true if the object exists
Search for files across one or more storage accounts.
Array of FileStorageAccount IDs to search
Optionaloptions: FileSearchOptionsOptional search options
A Promise that resolves to the search results
const results = await storageClient.SearchFiles(
[accountId1, accountId2],
'quarterly report',
{
maxResultsPerAccount: 10,
fileTypes: ['pdf', 'docx'],
searchContent: true
}
);
for (const accountResult of results.accountResults) {
console.log(`Results from ${accountResult.accountName}:`);
for (const file of accountResult.results) {
console.log(` - ${file.name} (${file.relevance})`);
}
}
Client for file storage operations through GraphQL. This class provides an easy way to interact with file storage accounts from a client application.
All operations use accountId (FileStorageAccount ID) as the primary identifier, supporting the enterprise model where storage accounts are organizational resources.
Example