@memberjunction/graphql-dataprovider 3.1.0 → 3.2.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/dist/index.cjs +145 -61
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +314 -1
- package/dist/index.d.mts +314 -1
- package/dist/index.mjs +153 -69
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -2810,6 +2810,319 @@ declare class GraphQLComponentRegistryClient {
|
|
|
2810
2810
|
SendComponentFeedback(params: ComponentFeedbackParams): Promise<ComponentFeedbackResponse>;
|
|
2811
2811
|
}
|
|
2812
2812
|
|
|
2813
|
+
/**
|
|
2814
|
+
* Client for file storage operations through GraphQL.
|
|
2815
|
+
* This class provides an easy way to interact with file storage accounts from a client application.
|
|
2816
|
+
*
|
|
2817
|
+
* All operations use accountId (FileStorageAccount ID) as the primary identifier,
|
|
2818
|
+
* supporting the enterprise model where storage accounts are organizational resources.
|
|
2819
|
+
*
|
|
2820
|
+
* @example
|
|
2821
|
+
* ```typescript
|
|
2822
|
+
* // Create the client
|
|
2823
|
+
* const storageClient = new GraphQLFileStorageClient(graphQLProvider);
|
|
2824
|
+
*
|
|
2825
|
+
* // List objects in a directory
|
|
2826
|
+
* const objects = await storageClient.ListObjects(accountId, 'documents/');
|
|
2827
|
+
*
|
|
2828
|
+
* // Create a pre-authenticated upload URL
|
|
2829
|
+
* const uploadResult = await storageClient.CreatePreAuthUploadUrl(
|
|
2830
|
+
* accountId,
|
|
2831
|
+
* 'documents/report.pdf',
|
|
2832
|
+
* 'application/pdf'
|
|
2833
|
+
* );
|
|
2834
|
+
* ```
|
|
2835
|
+
*/
|
|
2836
|
+
declare class GraphQLFileStorageClient {
|
|
2837
|
+
/**
|
|
2838
|
+
* The GraphQLDataProvider instance used to execute GraphQL requests
|
|
2839
|
+
* @private
|
|
2840
|
+
*/
|
|
2841
|
+
private _dataProvider;
|
|
2842
|
+
/**
|
|
2843
|
+
* Creates a new GraphQLFileStorageClient instance.
|
|
2844
|
+
* @param dataProvider The GraphQL data provider to use for queries
|
|
2845
|
+
*/
|
|
2846
|
+
constructor(dataProvider: GraphQLDataProvider);
|
|
2847
|
+
/**
|
|
2848
|
+
* List objects in a storage account at the specified path.
|
|
2849
|
+
*
|
|
2850
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2851
|
+
* @param prefix The path prefix to list objects from (e.g., 'documents/')
|
|
2852
|
+
* @param delimiter Optional delimiter for grouping results (default: '/')
|
|
2853
|
+
* @returns A Promise that resolves to a StorageListResult
|
|
2854
|
+
*
|
|
2855
|
+
* @example
|
|
2856
|
+
* ```typescript
|
|
2857
|
+
* const result = await storageClient.ListObjects(accountId, 'documents/', '/');
|
|
2858
|
+
* console.log('Files:', result.objects.filter(o => !o.isDirectory));
|
|
2859
|
+
* console.log('Folders:', result.prefixes);
|
|
2860
|
+
* ```
|
|
2861
|
+
*/
|
|
2862
|
+
ListObjects(accountId: string, prefix?: string, delimiter?: string): Promise<StorageListResult>;
|
|
2863
|
+
/**
|
|
2864
|
+
* Check if a directory exists in the storage account.
|
|
2865
|
+
*
|
|
2866
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2867
|
+
* @param path The directory path to check
|
|
2868
|
+
* @returns A Promise that resolves to true if the directory exists
|
|
2869
|
+
*/
|
|
2870
|
+
DirectoryExists(accountId: string, path: string): Promise<boolean>;
|
|
2871
|
+
/**
|
|
2872
|
+
* Create a directory in the storage account.
|
|
2873
|
+
*
|
|
2874
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2875
|
+
* @param path The directory path to create
|
|
2876
|
+
* @returns A Promise that resolves to true if the directory was created successfully
|
|
2877
|
+
*/
|
|
2878
|
+
CreateDirectory(accountId: string, path: string): Promise<boolean>;
|
|
2879
|
+
/**
|
|
2880
|
+
* Check if an object exists in the storage account.
|
|
2881
|
+
*
|
|
2882
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2883
|
+
* @param objectName The name/path of the object to check
|
|
2884
|
+
* @returns A Promise that resolves to true if the object exists
|
|
2885
|
+
*/
|
|
2886
|
+
ObjectExists(accountId: string, objectName: string): Promise<boolean>;
|
|
2887
|
+
/**
|
|
2888
|
+
* Create a pre-authenticated URL for uploading a file.
|
|
2889
|
+
*
|
|
2890
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2891
|
+
* @param objectName The name/path of the object to upload
|
|
2892
|
+
* @param contentType Optional content type for the file
|
|
2893
|
+
* @returns A Promise that resolves to the upload URL and provider key
|
|
2894
|
+
*
|
|
2895
|
+
* @example
|
|
2896
|
+
* ```typescript
|
|
2897
|
+
* const result = await storageClient.CreatePreAuthUploadUrl(
|
|
2898
|
+
* accountId,
|
|
2899
|
+
* 'documents/report.pdf',
|
|
2900
|
+
* 'application/pdf'
|
|
2901
|
+
* );
|
|
2902
|
+
*
|
|
2903
|
+
* // Use the upload URL to upload the file
|
|
2904
|
+
* await fetch(result.uploadUrl, {
|
|
2905
|
+
* method: 'PUT',
|
|
2906
|
+
* body: fileContent,
|
|
2907
|
+
* headers: { 'Content-Type': 'application/pdf' }
|
|
2908
|
+
* });
|
|
2909
|
+
* ```
|
|
2910
|
+
*/
|
|
2911
|
+
CreatePreAuthUploadUrl(accountId: string, objectName: string, contentType?: string): Promise<CreatePreAuthUploadUrlResult>;
|
|
2912
|
+
/**
|
|
2913
|
+
* Create a pre-authenticated URL for downloading a file.
|
|
2914
|
+
*
|
|
2915
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2916
|
+
* @param objectName The name/path of the object to download
|
|
2917
|
+
* @returns A Promise that resolves to the download URL
|
|
2918
|
+
*
|
|
2919
|
+
* @example
|
|
2920
|
+
* ```typescript
|
|
2921
|
+
* const downloadUrl = await storageClient.CreatePreAuthDownloadUrl(
|
|
2922
|
+
* accountId,
|
|
2923
|
+
* 'documents/report.pdf'
|
|
2924
|
+
* );
|
|
2925
|
+
*
|
|
2926
|
+
* // Use the download URL
|
|
2927
|
+
* window.open(downloadUrl, '_blank');
|
|
2928
|
+
* ```
|
|
2929
|
+
*/
|
|
2930
|
+
CreatePreAuthDownloadUrl(accountId: string, objectName: string): Promise<string>;
|
|
2931
|
+
/**
|
|
2932
|
+
* Delete an object from the storage account.
|
|
2933
|
+
*
|
|
2934
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2935
|
+
* @param objectName The name/path of the object to delete
|
|
2936
|
+
* @returns A Promise that resolves to true if the object was deleted successfully
|
|
2937
|
+
*/
|
|
2938
|
+
DeleteObject(accountId: string, objectName: string): Promise<boolean>;
|
|
2939
|
+
/**
|
|
2940
|
+
* Move/rename an object within the storage account.
|
|
2941
|
+
*
|
|
2942
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2943
|
+
* @param oldName The current name/path of the object
|
|
2944
|
+
* @param newName The new name/path for the object
|
|
2945
|
+
* @returns A Promise that resolves to true if the object was moved successfully
|
|
2946
|
+
*/
|
|
2947
|
+
MoveObject(accountId: string, oldName: string, newName: string): Promise<boolean>;
|
|
2948
|
+
/**
|
|
2949
|
+
* Copy an object within the storage account.
|
|
2950
|
+
*
|
|
2951
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2952
|
+
* @param sourceName The source name/path of the object
|
|
2953
|
+
* @param destinationName The destination name/path for the copy
|
|
2954
|
+
* @returns A Promise that resolves to true if the object was copied successfully
|
|
2955
|
+
*/
|
|
2956
|
+
CopyObject(accountId: string, sourceName: string, destinationName: string): Promise<boolean>;
|
|
2957
|
+
/**
|
|
2958
|
+
* Copy an object between two different storage accounts.
|
|
2959
|
+
*
|
|
2960
|
+
* @param sourceAccountId The ID of the source FileStorageAccount
|
|
2961
|
+
* @param destinationAccountId The ID of the destination FileStorageAccount
|
|
2962
|
+
* @param sourcePath The source path of the object
|
|
2963
|
+
* @param destinationPath The destination path for the copy
|
|
2964
|
+
* @returns A Promise that resolves to the copy result
|
|
2965
|
+
*/
|
|
2966
|
+
CopyObjectBetweenAccounts(sourceAccountId: string, destinationAccountId: string, sourcePath: string, destinationPath: string): Promise<CopyBetweenAccountsResult>;
|
|
2967
|
+
/**
|
|
2968
|
+
* Search for files across one or more storage accounts.
|
|
2969
|
+
*
|
|
2970
|
+
* @param accountIds Array of FileStorageAccount IDs to search
|
|
2971
|
+
* @param query The search query
|
|
2972
|
+
* @param options Optional search options
|
|
2973
|
+
* @returns A Promise that resolves to the search results
|
|
2974
|
+
*
|
|
2975
|
+
* @example
|
|
2976
|
+
* ```typescript
|
|
2977
|
+
* const results = await storageClient.SearchFiles(
|
|
2978
|
+
* [accountId1, accountId2],
|
|
2979
|
+
* 'quarterly report',
|
|
2980
|
+
* {
|
|
2981
|
+
* maxResultsPerAccount: 10,
|
|
2982
|
+
* fileTypes: ['pdf', 'docx'],
|
|
2983
|
+
* searchContent: true
|
|
2984
|
+
* }
|
|
2985
|
+
* );
|
|
2986
|
+
*
|
|
2987
|
+
* for (const accountResult of results.accountResults) {
|
|
2988
|
+
* console.log(`Results from ${accountResult.accountName}:`);
|
|
2989
|
+
* for (const file of accountResult.results) {
|
|
2990
|
+
* console.log(` - ${file.name} (${file.relevance})`);
|
|
2991
|
+
* }
|
|
2992
|
+
* }
|
|
2993
|
+
* ```
|
|
2994
|
+
*/
|
|
2995
|
+
SearchFiles(accountIds: string[], searchQuery: string, options?: FileSearchOptions): Promise<SearchAcrossAccountsResult>;
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
* Metadata for a storage object
|
|
2999
|
+
*/
|
|
3000
|
+
interface StorageObjectMetadata {
|
|
3001
|
+
/** The name of the object (filename) */
|
|
3002
|
+
name: string;
|
|
3003
|
+
/** The path to the object (directory) */
|
|
3004
|
+
path: string;
|
|
3005
|
+
/** The full path including name */
|
|
3006
|
+
fullPath: string;
|
|
3007
|
+
/** Size in bytes */
|
|
3008
|
+
size: number;
|
|
3009
|
+
/** MIME content type */
|
|
3010
|
+
contentType: string;
|
|
3011
|
+
/** Last modification date */
|
|
3012
|
+
lastModified: Date;
|
|
3013
|
+
/** Whether this is a directory */
|
|
3014
|
+
isDirectory: boolean;
|
|
3015
|
+
/** ETag for caching */
|
|
3016
|
+
etag?: string;
|
|
3017
|
+
/** Cache control header */
|
|
3018
|
+
cacheControl?: string;
|
|
3019
|
+
}
|
|
3020
|
+
/**
|
|
3021
|
+
* Result from listing storage objects
|
|
3022
|
+
*/
|
|
3023
|
+
interface StorageListResult {
|
|
3024
|
+
/** Array of objects in the directory */
|
|
3025
|
+
objects: StorageObjectMetadata[];
|
|
3026
|
+
/** Array of subdirectory prefixes */
|
|
3027
|
+
prefixes: string[];
|
|
3028
|
+
}
|
|
3029
|
+
/**
|
|
3030
|
+
* Result from creating a pre-authenticated upload URL
|
|
3031
|
+
*/
|
|
3032
|
+
interface CreatePreAuthUploadUrlResult {
|
|
3033
|
+
/** The URL to use for uploading */
|
|
3034
|
+
uploadUrl: string;
|
|
3035
|
+
/** The provider-specific key for the object */
|
|
3036
|
+
providerKey?: string;
|
|
3037
|
+
}
|
|
3038
|
+
/**
|
|
3039
|
+
* Result from copying an object between accounts
|
|
3040
|
+
*/
|
|
3041
|
+
interface CopyBetweenAccountsResult {
|
|
3042
|
+
/** Whether the copy was successful */
|
|
3043
|
+
success: boolean;
|
|
3044
|
+
/** Human-readable message */
|
|
3045
|
+
message: string;
|
|
3046
|
+
/** Number of bytes transferred */
|
|
3047
|
+
bytesTransferred?: number;
|
|
3048
|
+
/** Name of the source account */
|
|
3049
|
+
sourceAccount: string;
|
|
3050
|
+
/** Name of the destination account */
|
|
3051
|
+
destinationAccount: string;
|
|
3052
|
+
/** Source path */
|
|
3053
|
+
sourcePath: string;
|
|
3054
|
+
/** Destination path */
|
|
3055
|
+
destinationPath: string;
|
|
3056
|
+
}
|
|
3057
|
+
/**
|
|
3058
|
+
* Options for file search operations
|
|
3059
|
+
*/
|
|
3060
|
+
interface FileSearchOptions {
|
|
3061
|
+
/** Maximum results per account */
|
|
3062
|
+
maxResultsPerAccount?: number;
|
|
3063
|
+
/** Filter by file types (extensions) */
|
|
3064
|
+
fileTypes?: string[];
|
|
3065
|
+
/** Whether to search file content (not just names) */
|
|
3066
|
+
searchContent?: boolean;
|
|
3067
|
+
}
|
|
3068
|
+
/**
|
|
3069
|
+
* A single file search result
|
|
3070
|
+
*/
|
|
3071
|
+
interface FileSearchResult {
|
|
3072
|
+
/** Path to the file */
|
|
3073
|
+
path: string;
|
|
3074
|
+
/** File name */
|
|
3075
|
+
name: string;
|
|
3076
|
+
/** File size in bytes */
|
|
3077
|
+
size: number;
|
|
3078
|
+
/** MIME content type */
|
|
3079
|
+
contentType: string;
|
|
3080
|
+
/** Last modification date */
|
|
3081
|
+
lastModified: Date;
|
|
3082
|
+
/** Relevance score (0-1) */
|
|
3083
|
+
relevance?: number;
|
|
3084
|
+
/** Text excerpt showing the match */
|
|
3085
|
+
excerpt?: string;
|
|
3086
|
+
/** Whether the match was in the filename */
|
|
3087
|
+
matchInFilename?: boolean;
|
|
3088
|
+
/** Provider-specific object ID */
|
|
3089
|
+
objectId?: string;
|
|
3090
|
+
}
|
|
3091
|
+
/**
|
|
3092
|
+
* Search results for a single account
|
|
3093
|
+
*/
|
|
3094
|
+
interface AccountSearchResult {
|
|
3095
|
+
/** The account ID */
|
|
3096
|
+
accountId: string;
|
|
3097
|
+
/** The account name */
|
|
3098
|
+
accountName: string;
|
|
3099
|
+
/** Whether the search was successful */
|
|
3100
|
+
success: boolean;
|
|
3101
|
+
/** Error message if search failed */
|
|
3102
|
+
errorMessage?: string;
|
|
3103
|
+
/** Search results */
|
|
3104
|
+
results: FileSearchResult[];
|
|
3105
|
+
/** Total matches found */
|
|
3106
|
+
totalMatches?: number;
|
|
3107
|
+
/** Whether there are more results */
|
|
3108
|
+
hasMore: boolean;
|
|
3109
|
+
/** Token for pagination */
|
|
3110
|
+
nextPageToken?: string;
|
|
3111
|
+
}
|
|
3112
|
+
/**
|
|
3113
|
+
* Result from searching across multiple accounts
|
|
3114
|
+
*/
|
|
3115
|
+
interface SearchAcrossAccountsResult {
|
|
3116
|
+
/** Results grouped by account */
|
|
3117
|
+
accountResults: AccountSearchResult[];
|
|
3118
|
+
/** Total results returned across all accounts */
|
|
3119
|
+
totalResultsReturned: number;
|
|
3120
|
+
/** Number of accounts that were searched successfully */
|
|
3121
|
+
successfulAccounts: number;
|
|
3122
|
+
/** Number of accounts that failed to search */
|
|
3123
|
+
failedAccounts: number;
|
|
3124
|
+
}
|
|
3125
|
+
|
|
2813
3126
|
/**
|
|
2814
3127
|
* In-memory storage provider using nested Map structure for category isolation.
|
|
2815
3128
|
* Used as a fallback when browser storage is not available.
|
|
@@ -2886,4 +3199,4 @@ declare class BrowserIndexedDBStorageProvider extends BrowserStorageProviderBase
|
|
|
2886
3199
|
GetCategoryKeys(category: string): Promise<string[]>;
|
|
2887
3200
|
}
|
|
2888
3201
|
|
|
2889
|
-
export { ActionItemInput, ActionItemOutput, BrowserIndexedDBStorageProvider, BrowserStorageProviderBase, type ComponentDependencyTree, type ComponentSpecWithHash, type CreateQueryInput, type CreateQueryResult, type DeleteQueryOptionsInput, type DeleteQueryResult, type EmbedTextParams, type EmbedTextResult, type ExecuteSimplePromptParams, FieldMapper, GetDataOutput, type GetQueryDataByNameSystemUserInput, type GetQueryDataSystemUserInput, type GetRegistryComponentParams, GraphQLAIClient, GraphQLActionClient, GraphQLComponentRegistryClient, GraphQLDataProvider, GraphQLProviderConfigData, GraphQLSystemUserClient, GraphQLTestingClient, GraphQLTransactionGroup, type MJ_MetadataDB, type QueryEntity, type QueryField, type QueryParameter, type QueryPermission, type QueryPermissionInput, type RegistryComponentSearchResult, RoleInput, RolesAndUsersInput, type RunAIPromptParams, type RunAIPromptResult, type RunDynamicViewSystemUserInput, type RunQuerySystemUserResult, type RunTestParams, type RunTestResult, type RunTestSuiteParams, type RunTestSuiteResult, type RunViewByIDSystemUserInput, type RunViewByNameSystemUserInput, type RunViewSystemUserInput, type RunViewSystemUserResult, type RunViewSystemUserResultRow, type SearchRegistryComponentsParams, type SimplePromptResult, SimpleRemoteEntity, SimpleRemoteEntityField, SimpleRemoteEntityOutput, SyncDataAction, SyncDataResult, SyncRolesAndUsersResult, type TestExecutionProgress, type UpdateQueryInput, type UpdateQueryResult, UserInput, setupGraphQLClient };
|
|
3202
|
+
export { type AccountSearchResult, ActionItemInput, ActionItemOutput, BrowserIndexedDBStorageProvider, BrowserStorageProviderBase, type ComponentDependencyTree, type ComponentSpecWithHash, type CopyBetweenAccountsResult, type CreatePreAuthUploadUrlResult, type CreateQueryInput, type CreateQueryResult, type DeleteQueryOptionsInput, type DeleteQueryResult, type EmbedTextParams, type EmbedTextResult, type ExecuteSimplePromptParams, FieldMapper, type FileSearchOptions, type FileSearchResult, GetDataOutput, type GetQueryDataByNameSystemUserInput, type GetQueryDataSystemUserInput, type GetRegistryComponentParams, GraphQLAIClient, GraphQLActionClient, GraphQLComponentRegistryClient, GraphQLDataProvider, GraphQLFileStorageClient, GraphQLProviderConfigData, GraphQLSystemUserClient, GraphQLTestingClient, GraphQLTransactionGroup, type MJ_MetadataDB, type QueryEntity, type QueryField, type QueryParameter, type QueryPermission, type QueryPermissionInput, type RegistryComponentSearchResult, RoleInput, RolesAndUsersInput, type RunAIPromptParams, type RunAIPromptResult, type RunDynamicViewSystemUserInput, type RunQuerySystemUserResult, type RunTestParams, type RunTestResult, type RunTestSuiteParams, type RunTestSuiteResult, type RunViewByIDSystemUserInput, type RunViewByNameSystemUserInput, type RunViewSystemUserInput, type RunViewSystemUserResult, type RunViewSystemUserResultRow, type SearchAcrossAccountsResult, type SearchRegistryComponentsParams, type SimplePromptResult, SimpleRemoteEntity, SimpleRemoteEntityField, SimpleRemoteEntityOutput, type StorageListResult, type StorageObjectMetadata, SyncDataAction, SyncDataResult, SyncRolesAndUsersResult, type TestExecutionProgress, type UpdateQueryInput, type UpdateQueryResult, UserInput, setupGraphQLClient };
|
package/dist/index.d.mts
CHANGED
|
@@ -2810,6 +2810,319 @@ declare class GraphQLComponentRegistryClient {
|
|
|
2810
2810
|
SendComponentFeedback(params: ComponentFeedbackParams): Promise<ComponentFeedbackResponse>;
|
|
2811
2811
|
}
|
|
2812
2812
|
|
|
2813
|
+
/**
|
|
2814
|
+
* Client for file storage operations through GraphQL.
|
|
2815
|
+
* This class provides an easy way to interact with file storage accounts from a client application.
|
|
2816
|
+
*
|
|
2817
|
+
* All operations use accountId (FileStorageAccount ID) as the primary identifier,
|
|
2818
|
+
* supporting the enterprise model where storage accounts are organizational resources.
|
|
2819
|
+
*
|
|
2820
|
+
* @example
|
|
2821
|
+
* ```typescript
|
|
2822
|
+
* // Create the client
|
|
2823
|
+
* const storageClient = new GraphQLFileStorageClient(graphQLProvider);
|
|
2824
|
+
*
|
|
2825
|
+
* // List objects in a directory
|
|
2826
|
+
* const objects = await storageClient.ListObjects(accountId, 'documents/');
|
|
2827
|
+
*
|
|
2828
|
+
* // Create a pre-authenticated upload URL
|
|
2829
|
+
* const uploadResult = await storageClient.CreatePreAuthUploadUrl(
|
|
2830
|
+
* accountId,
|
|
2831
|
+
* 'documents/report.pdf',
|
|
2832
|
+
* 'application/pdf'
|
|
2833
|
+
* );
|
|
2834
|
+
* ```
|
|
2835
|
+
*/
|
|
2836
|
+
declare class GraphQLFileStorageClient {
|
|
2837
|
+
/**
|
|
2838
|
+
* The GraphQLDataProvider instance used to execute GraphQL requests
|
|
2839
|
+
* @private
|
|
2840
|
+
*/
|
|
2841
|
+
private _dataProvider;
|
|
2842
|
+
/**
|
|
2843
|
+
* Creates a new GraphQLFileStorageClient instance.
|
|
2844
|
+
* @param dataProvider The GraphQL data provider to use for queries
|
|
2845
|
+
*/
|
|
2846
|
+
constructor(dataProvider: GraphQLDataProvider);
|
|
2847
|
+
/**
|
|
2848
|
+
* List objects in a storage account at the specified path.
|
|
2849
|
+
*
|
|
2850
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2851
|
+
* @param prefix The path prefix to list objects from (e.g., 'documents/')
|
|
2852
|
+
* @param delimiter Optional delimiter for grouping results (default: '/')
|
|
2853
|
+
* @returns A Promise that resolves to a StorageListResult
|
|
2854
|
+
*
|
|
2855
|
+
* @example
|
|
2856
|
+
* ```typescript
|
|
2857
|
+
* const result = await storageClient.ListObjects(accountId, 'documents/', '/');
|
|
2858
|
+
* console.log('Files:', result.objects.filter(o => !o.isDirectory));
|
|
2859
|
+
* console.log('Folders:', result.prefixes);
|
|
2860
|
+
* ```
|
|
2861
|
+
*/
|
|
2862
|
+
ListObjects(accountId: string, prefix?: string, delimiter?: string): Promise<StorageListResult>;
|
|
2863
|
+
/**
|
|
2864
|
+
* Check if a directory exists in the storage account.
|
|
2865
|
+
*
|
|
2866
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2867
|
+
* @param path The directory path to check
|
|
2868
|
+
* @returns A Promise that resolves to true if the directory exists
|
|
2869
|
+
*/
|
|
2870
|
+
DirectoryExists(accountId: string, path: string): Promise<boolean>;
|
|
2871
|
+
/**
|
|
2872
|
+
* Create a directory in the storage account.
|
|
2873
|
+
*
|
|
2874
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2875
|
+
* @param path The directory path to create
|
|
2876
|
+
* @returns A Promise that resolves to true if the directory was created successfully
|
|
2877
|
+
*/
|
|
2878
|
+
CreateDirectory(accountId: string, path: string): Promise<boolean>;
|
|
2879
|
+
/**
|
|
2880
|
+
* Check if an object exists in the storage account.
|
|
2881
|
+
*
|
|
2882
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2883
|
+
* @param objectName The name/path of the object to check
|
|
2884
|
+
* @returns A Promise that resolves to true if the object exists
|
|
2885
|
+
*/
|
|
2886
|
+
ObjectExists(accountId: string, objectName: string): Promise<boolean>;
|
|
2887
|
+
/**
|
|
2888
|
+
* Create a pre-authenticated URL for uploading a file.
|
|
2889
|
+
*
|
|
2890
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2891
|
+
* @param objectName The name/path of the object to upload
|
|
2892
|
+
* @param contentType Optional content type for the file
|
|
2893
|
+
* @returns A Promise that resolves to the upload URL and provider key
|
|
2894
|
+
*
|
|
2895
|
+
* @example
|
|
2896
|
+
* ```typescript
|
|
2897
|
+
* const result = await storageClient.CreatePreAuthUploadUrl(
|
|
2898
|
+
* accountId,
|
|
2899
|
+
* 'documents/report.pdf',
|
|
2900
|
+
* 'application/pdf'
|
|
2901
|
+
* );
|
|
2902
|
+
*
|
|
2903
|
+
* // Use the upload URL to upload the file
|
|
2904
|
+
* await fetch(result.uploadUrl, {
|
|
2905
|
+
* method: 'PUT',
|
|
2906
|
+
* body: fileContent,
|
|
2907
|
+
* headers: { 'Content-Type': 'application/pdf' }
|
|
2908
|
+
* });
|
|
2909
|
+
* ```
|
|
2910
|
+
*/
|
|
2911
|
+
CreatePreAuthUploadUrl(accountId: string, objectName: string, contentType?: string): Promise<CreatePreAuthUploadUrlResult>;
|
|
2912
|
+
/**
|
|
2913
|
+
* Create a pre-authenticated URL for downloading a file.
|
|
2914
|
+
*
|
|
2915
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2916
|
+
* @param objectName The name/path of the object to download
|
|
2917
|
+
* @returns A Promise that resolves to the download URL
|
|
2918
|
+
*
|
|
2919
|
+
* @example
|
|
2920
|
+
* ```typescript
|
|
2921
|
+
* const downloadUrl = await storageClient.CreatePreAuthDownloadUrl(
|
|
2922
|
+
* accountId,
|
|
2923
|
+
* 'documents/report.pdf'
|
|
2924
|
+
* );
|
|
2925
|
+
*
|
|
2926
|
+
* // Use the download URL
|
|
2927
|
+
* window.open(downloadUrl, '_blank');
|
|
2928
|
+
* ```
|
|
2929
|
+
*/
|
|
2930
|
+
CreatePreAuthDownloadUrl(accountId: string, objectName: string): Promise<string>;
|
|
2931
|
+
/**
|
|
2932
|
+
* Delete an object from the storage account.
|
|
2933
|
+
*
|
|
2934
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2935
|
+
* @param objectName The name/path of the object to delete
|
|
2936
|
+
* @returns A Promise that resolves to true if the object was deleted successfully
|
|
2937
|
+
*/
|
|
2938
|
+
DeleteObject(accountId: string, objectName: string): Promise<boolean>;
|
|
2939
|
+
/**
|
|
2940
|
+
* Move/rename an object within the storage account.
|
|
2941
|
+
*
|
|
2942
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2943
|
+
* @param oldName The current name/path of the object
|
|
2944
|
+
* @param newName The new name/path for the object
|
|
2945
|
+
* @returns A Promise that resolves to true if the object was moved successfully
|
|
2946
|
+
*/
|
|
2947
|
+
MoveObject(accountId: string, oldName: string, newName: string): Promise<boolean>;
|
|
2948
|
+
/**
|
|
2949
|
+
* Copy an object within the storage account.
|
|
2950
|
+
*
|
|
2951
|
+
* @param accountId The ID of the FileStorageAccount
|
|
2952
|
+
* @param sourceName The source name/path of the object
|
|
2953
|
+
* @param destinationName The destination name/path for the copy
|
|
2954
|
+
* @returns A Promise that resolves to true if the object was copied successfully
|
|
2955
|
+
*/
|
|
2956
|
+
CopyObject(accountId: string, sourceName: string, destinationName: string): Promise<boolean>;
|
|
2957
|
+
/**
|
|
2958
|
+
* Copy an object between two different storage accounts.
|
|
2959
|
+
*
|
|
2960
|
+
* @param sourceAccountId The ID of the source FileStorageAccount
|
|
2961
|
+
* @param destinationAccountId The ID of the destination FileStorageAccount
|
|
2962
|
+
* @param sourcePath The source path of the object
|
|
2963
|
+
* @param destinationPath The destination path for the copy
|
|
2964
|
+
* @returns A Promise that resolves to the copy result
|
|
2965
|
+
*/
|
|
2966
|
+
CopyObjectBetweenAccounts(sourceAccountId: string, destinationAccountId: string, sourcePath: string, destinationPath: string): Promise<CopyBetweenAccountsResult>;
|
|
2967
|
+
/**
|
|
2968
|
+
* Search for files across one or more storage accounts.
|
|
2969
|
+
*
|
|
2970
|
+
* @param accountIds Array of FileStorageAccount IDs to search
|
|
2971
|
+
* @param query The search query
|
|
2972
|
+
* @param options Optional search options
|
|
2973
|
+
* @returns A Promise that resolves to the search results
|
|
2974
|
+
*
|
|
2975
|
+
* @example
|
|
2976
|
+
* ```typescript
|
|
2977
|
+
* const results = await storageClient.SearchFiles(
|
|
2978
|
+
* [accountId1, accountId2],
|
|
2979
|
+
* 'quarterly report',
|
|
2980
|
+
* {
|
|
2981
|
+
* maxResultsPerAccount: 10,
|
|
2982
|
+
* fileTypes: ['pdf', 'docx'],
|
|
2983
|
+
* searchContent: true
|
|
2984
|
+
* }
|
|
2985
|
+
* );
|
|
2986
|
+
*
|
|
2987
|
+
* for (const accountResult of results.accountResults) {
|
|
2988
|
+
* console.log(`Results from ${accountResult.accountName}:`);
|
|
2989
|
+
* for (const file of accountResult.results) {
|
|
2990
|
+
* console.log(` - ${file.name} (${file.relevance})`);
|
|
2991
|
+
* }
|
|
2992
|
+
* }
|
|
2993
|
+
* ```
|
|
2994
|
+
*/
|
|
2995
|
+
SearchFiles(accountIds: string[], searchQuery: string, options?: FileSearchOptions): Promise<SearchAcrossAccountsResult>;
|
|
2996
|
+
}
|
|
2997
|
+
/**
|
|
2998
|
+
* Metadata for a storage object
|
|
2999
|
+
*/
|
|
3000
|
+
interface StorageObjectMetadata {
|
|
3001
|
+
/** The name of the object (filename) */
|
|
3002
|
+
name: string;
|
|
3003
|
+
/** The path to the object (directory) */
|
|
3004
|
+
path: string;
|
|
3005
|
+
/** The full path including name */
|
|
3006
|
+
fullPath: string;
|
|
3007
|
+
/** Size in bytes */
|
|
3008
|
+
size: number;
|
|
3009
|
+
/** MIME content type */
|
|
3010
|
+
contentType: string;
|
|
3011
|
+
/** Last modification date */
|
|
3012
|
+
lastModified: Date;
|
|
3013
|
+
/** Whether this is a directory */
|
|
3014
|
+
isDirectory: boolean;
|
|
3015
|
+
/** ETag for caching */
|
|
3016
|
+
etag?: string;
|
|
3017
|
+
/** Cache control header */
|
|
3018
|
+
cacheControl?: string;
|
|
3019
|
+
}
|
|
3020
|
+
/**
|
|
3021
|
+
* Result from listing storage objects
|
|
3022
|
+
*/
|
|
3023
|
+
interface StorageListResult {
|
|
3024
|
+
/** Array of objects in the directory */
|
|
3025
|
+
objects: StorageObjectMetadata[];
|
|
3026
|
+
/** Array of subdirectory prefixes */
|
|
3027
|
+
prefixes: string[];
|
|
3028
|
+
}
|
|
3029
|
+
/**
|
|
3030
|
+
* Result from creating a pre-authenticated upload URL
|
|
3031
|
+
*/
|
|
3032
|
+
interface CreatePreAuthUploadUrlResult {
|
|
3033
|
+
/** The URL to use for uploading */
|
|
3034
|
+
uploadUrl: string;
|
|
3035
|
+
/** The provider-specific key for the object */
|
|
3036
|
+
providerKey?: string;
|
|
3037
|
+
}
|
|
3038
|
+
/**
|
|
3039
|
+
* Result from copying an object between accounts
|
|
3040
|
+
*/
|
|
3041
|
+
interface CopyBetweenAccountsResult {
|
|
3042
|
+
/** Whether the copy was successful */
|
|
3043
|
+
success: boolean;
|
|
3044
|
+
/** Human-readable message */
|
|
3045
|
+
message: string;
|
|
3046
|
+
/** Number of bytes transferred */
|
|
3047
|
+
bytesTransferred?: number;
|
|
3048
|
+
/** Name of the source account */
|
|
3049
|
+
sourceAccount: string;
|
|
3050
|
+
/** Name of the destination account */
|
|
3051
|
+
destinationAccount: string;
|
|
3052
|
+
/** Source path */
|
|
3053
|
+
sourcePath: string;
|
|
3054
|
+
/** Destination path */
|
|
3055
|
+
destinationPath: string;
|
|
3056
|
+
}
|
|
3057
|
+
/**
|
|
3058
|
+
* Options for file search operations
|
|
3059
|
+
*/
|
|
3060
|
+
interface FileSearchOptions {
|
|
3061
|
+
/** Maximum results per account */
|
|
3062
|
+
maxResultsPerAccount?: number;
|
|
3063
|
+
/** Filter by file types (extensions) */
|
|
3064
|
+
fileTypes?: string[];
|
|
3065
|
+
/** Whether to search file content (not just names) */
|
|
3066
|
+
searchContent?: boolean;
|
|
3067
|
+
}
|
|
3068
|
+
/**
|
|
3069
|
+
* A single file search result
|
|
3070
|
+
*/
|
|
3071
|
+
interface FileSearchResult {
|
|
3072
|
+
/** Path to the file */
|
|
3073
|
+
path: string;
|
|
3074
|
+
/** File name */
|
|
3075
|
+
name: string;
|
|
3076
|
+
/** File size in bytes */
|
|
3077
|
+
size: number;
|
|
3078
|
+
/** MIME content type */
|
|
3079
|
+
contentType: string;
|
|
3080
|
+
/** Last modification date */
|
|
3081
|
+
lastModified: Date;
|
|
3082
|
+
/** Relevance score (0-1) */
|
|
3083
|
+
relevance?: number;
|
|
3084
|
+
/** Text excerpt showing the match */
|
|
3085
|
+
excerpt?: string;
|
|
3086
|
+
/** Whether the match was in the filename */
|
|
3087
|
+
matchInFilename?: boolean;
|
|
3088
|
+
/** Provider-specific object ID */
|
|
3089
|
+
objectId?: string;
|
|
3090
|
+
}
|
|
3091
|
+
/**
|
|
3092
|
+
* Search results for a single account
|
|
3093
|
+
*/
|
|
3094
|
+
interface AccountSearchResult {
|
|
3095
|
+
/** The account ID */
|
|
3096
|
+
accountId: string;
|
|
3097
|
+
/** The account name */
|
|
3098
|
+
accountName: string;
|
|
3099
|
+
/** Whether the search was successful */
|
|
3100
|
+
success: boolean;
|
|
3101
|
+
/** Error message if search failed */
|
|
3102
|
+
errorMessage?: string;
|
|
3103
|
+
/** Search results */
|
|
3104
|
+
results: FileSearchResult[];
|
|
3105
|
+
/** Total matches found */
|
|
3106
|
+
totalMatches?: number;
|
|
3107
|
+
/** Whether there are more results */
|
|
3108
|
+
hasMore: boolean;
|
|
3109
|
+
/** Token for pagination */
|
|
3110
|
+
nextPageToken?: string;
|
|
3111
|
+
}
|
|
3112
|
+
/**
|
|
3113
|
+
* Result from searching across multiple accounts
|
|
3114
|
+
*/
|
|
3115
|
+
interface SearchAcrossAccountsResult {
|
|
3116
|
+
/** Results grouped by account */
|
|
3117
|
+
accountResults: AccountSearchResult[];
|
|
3118
|
+
/** Total results returned across all accounts */
|
|
3119
|
+
totalResultsReturned: number;
|
|
3120
|
+
/** Number of accounts that were searched successfully */
|
|
3121
|
+
successfulAccounts: number;
|
|
3122
|
+
/** Number of accounts that failed to search */
|
|
3123
|
+
failedAccounts: number;
|
|
3124
|
+
}
|
|
3125
|
+
|
|
2813
3126
|
/**
|
|
2814
3127
|
* In-memory storage provider using nested Map structure for category isolation.
|
|
2815
3128
|
* Used as a fallback when browser storage is not available.
|
|
@@ -2886,4 +3199,4 @@ declare class BrowserIndexedDBStorageProvider extends BrowserStorageProviderBase
|
|
|
2886
3199
|
GetCategoryKeys(category: string): Promise<string[]>;
|
|
2887
3200
|
}
|
|
2888
3201
|
|
|
2889
|
-
export { ActionItemInput, ActionItemOutput, BrowserIndexedDBStorageProvider, BrowserStorageProviderBase, type ComponentDependencyTree, type ComponentSpecWithHash, type CreateQueryInput, type CreateQueryResult, type DeleteQueryOptionsInput, type DeleteQueryResult, type EmbedTextParams, type EmbedTextResult, type ExecuteSimplePromptParams, FieldMapper, GetDataOutput, type GetQueryDataByNameSystemUserInput, type GetQueryDataSystemUserInput, type GetRegistryComponentParams, GraphQLAIClient, GraphQLActionClient, GraphQLComponentRegistryClient, GraphQLDataProvider, GraphQLProviderConfigData, GraphQLSystemUserClient, GraphQLTestingClient, GraphQLTransactionGroup, type MJ_MetadataDB, type QueryEntity, type QueryField, type QueryParameter, type QueryPermission, type QueryPermissionInput, type RegistryComponentSearchResult, RoleInput, RolesAndUsersInput, type RunAIPromptParams, type RunAIPromptResult, type RunDynamicViewSystemUserInput, type RunQuerySystemUserResult, type RunTestParams, type RunTestResult, type RunTestSuiteParams, type RunTestSuiteResult, type RunViewByIDSystemUserInput, type RunViewByNameSystemUserInput, type RunViewSystemUserInput, type RunViewSystemUserResult, type RunViewSystemUserResultRow, type SearchRegistryComponentsParams, type SimplePromptResult, SimpleRemoteEntity, SimpleRemoteEntityField, SimpleRemoteEntityOutput, SyncDataAction, SyncDataResult, SyncRolesAndUsersResult, type TestExecutionProgress, type UpdateQueryInput, type UpdateQueryResult, UserInput, setupGraphQLClient };
|
|
3202
|
+
export { type AccountSearchResult, ActionItemInput, ActionItemOutput, BrowserIndexedDBStorageProvider, BrowserStorageProviderBase, type ComponentDependencyTree, type ComponentSpecWithHash, type CopyBetweenAccountsResult, type CreatePreAuthUploadUrlResult, type CreateQueryInput, type CreateQueryResult, type DeleteQueryOptionsInput, type DeleteQueryResult, type EmbedTextParams, type EmbedTextResult, type ExecuteSimplePromptParams, FieldMapper, type FileSearchOptions, type FileSearchResult, GetDataOutput, type GetQueryDataByNameSystemUserInput, type GetQueryDataSystemUserInput, type GetRegistryComponentParams, GraphQLAIClient, GraphQLActionClient, GraphQLComponentRegistryClient, GraphQLDataProvider, GraphQLFileStorageClient, GraphQLProviderConfigData, GraphQLSystemUserClient, GraphQLTestingClient, GraphQLTransactionGroup, type MJ_MetadataDB, type QueryEntity, type QueryField, type QueryParameter, type QueryPermission, type QueryPermissionInput, type RegistryComponentSearchResult, RoleInput, RolesAndUsersInput, type RunAIPromptParams, type RunAIPromptResult, type RunDynamicViewSystemUserInput, type RunQuerySystemUserResult, type RunTestParams, type RunTestResult, type RunTestSuiteParams, type RunTestSuiteResult, type RunViewByIDSystemUserInput, type RunViewByNameSystemUserInput, type RunViewSystemUserInput, type RunViewSystemUserResult, type RunViewSystemUserResultRow, type SearchAcrossAccountsResult, type SearchRegistryComponentsParams, type SimplePromptResult, SimpleRemoteEntity, SimpleRemoteEntityField, SimpleRemoteEntityOutput, type StorageListResult, type StorageObjectMetadata, SyncDataAction, SyncDataResult, SyncRolesAndUsersResult, type TestExecutionProgress, type UpdateQueryInput, type UpdateQueryResult, UserInput, setupGraphQLClient };
|