@scality/data-browser-library 1.0.0-preview.15 → 1.0.0-preview.17
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/components/DataBrowserUI.d.ts +4 -19
- package/dist/components/__tests__/BucketDetails.test.js +4 -4
- package/dist/components/__tests__/BucketList.test.js +2 -2
- package/dist/components/__tests__/BucketOverview.test.js +4 -4
- package/dist/components/__tests__/ObjectList.test.js +4 -4
- package/dist/components/buckets/BucketOverview.js +2 -3
- package/dist/components/buckets/BucketPage.js +3 -3
- package/dist/components/buckets/notifications/EventsSection.js +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +3 -2
- package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +3 -3
- package/dist/components/objects/ObjectList.js +1 -1
- package/dist/components/objects/UploadButton.js +3 -3
- package/dist/components/providers/DataBrowserProvider.d.ts +9 -9
- package/dist/components/providers/DataBrowserProvider.js +41 -41
- package/dist/components/providers/QueryProvider.d.ts +9 -0
- package/dist/components/providers/QueryProvider.js +22 -0
- package/dist/config/__tests__/factory.test.d.ts +1 -0
- package/dist/config/__tests__/factory.test.js +311 -0
- package/dist/config/factory.d.ts +6 -65
- package/dist/config/factory.js +18 -82
- package/dist/config/types.d.ts +85 -41
- package/dist/hooks/__tests__/useISVBucketDetection.test.js +2 -2
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +3 -1
- package/dist/hooks/useDataBrowserNavigate.d.ts +16 -2
- package/dist/hooks/useFeatures.d.ts +7 -0
- package/dist/hooks/useFeatures.js +8 -0
- package/dist/hooks/useISVBucketDetection.js +2 -2
- package/dist/hooks/useS3Client.d.ts +2 -1
- package/dist/hooks/useS3Client.js +2 -2
- package/dist/{utils → hooks}/useSupportedNotificationEvents.d.ts +1 -1
- package/dist/{utils → hooks}/useSupportedNotificationEvents.js +2 -1
- package/dist/test/setup.js +0 -17
- package/dist/test/testUtils.d.ts +0 -23
- package/dist/test/testUtils.js +3 -48
- package/dist/types/index.d.ts +2 -6
- package/dist/utils/__tests__/proxyMiddleware.test.d.ts +1 -0
- package/dist/utils/__tests__/proxyMiddleware.test.js +579 -0
- package/dist/utils/__tests__/s3Client.test.d.ts +1 -0
- package/dist/utils/__tests__/s3Client.test.js +340 -0
- package/dist/utils/proxyMiddleware.d.ts +32 -13
- package/dist/utils/proxyMiddleware.js +84 -25
- package/dist/utils/s3Client.d.ts +12 -2
- package/dist/utils/s3Client.js +5 -26
- package/package.json +5 -5
- package/dist/utils/useFeatures.d.ts +0 -1
- package/dist/utils/useFeatures.js +0 -7
package/dist/hooks/index.js
CHANGED
|
@@ -7,8 +7,10 @@ import { useDeleteBucketConfigRule } from "./useDeleteBucketConfigRule.js";
|
|
|
7
7
|
import { useTableRowSelection } from "./useTableRowSelection.js";
|
|
8
8
|
import { useISVBucketStatus } from "./useISVBucketDetection.js";
|
|
9
9
|
import { useBatchObjectLegalHold } from "./useBatchObjectLegalHold.js";
|
|
10
|
+
import { useFeatures } from "./useFeatures.js";
|
|
11
|
+
import { useSupportedNotificationEvents } from "./useSupportedNotificationEvents.js";
|
|
10
12
|
import { useBuckets, useCreateBucket, useDeleteBucket, useGetBucketLocation } from "./bucketOperations.js";
|
|
11
13
|
import { useDeleteBucketCors, useDeleteBucketLifecycle, useDeleteBucketPolicy, useDeleteBucketReplication, useDeleteBucketTagging, useGetBucketAcl, useGetBucketCors, useGetBucketEncryption, useGetBucketLifecycle, useGetBucketNotification, useGetBucketObjectLockConfiguration, useGetBucketPolicy, useGetBucketReplication, useGetBucketTagging, useGetBucketVersioning, useSetBucketAcl, useSetBucketCors, useSetBucketEncryption, useSetBucketLifecycle, useSetBucketNotification, useSetBucketObjectLockConfiguration, useSetBucketPolicy, useSetBucketReplication, useSetBucketTagging, useSetBucketVersioning } from "./bucketConfiguration.js";
|
|
12
14
|
import { useCopyObject, useCreateFolder, useDeleteObject, useDeleteObjectTagging, useDeleteObjects, useGetObject, useGetObjectAttributes, useGetObjectTorrent, useListMultipartUploads, useListObjectVersions, useListObjects, useObjectAcl, useObjectLegalHold, useObjectMetadata, useObjectRetention, useObjectTagging, usePutObject, useRestoreObject, useSearchObjects, useSearchObjectsVersions, useSelectObjectContent, useSetObjectAcl, useSetObjectLegalHold, useSetObjectRetention, useSetObjectTagging, useUploadObjects } from "./objectOperations.js";
|
|
13
15
|
import { useGetPresignedDownload, useGetPresignedPost, useGetPresignedUpload } from "./presignedOperations.js";
|
|
14
|
-
export { useBatchObjectLegalHold, useBuckets, useCopyObject, useCreateBucket, useCreateFolder, useDeleteBucket, useDeleteBucketConfigRule, useDeleteBucketCors, useDeleteBucketLifecycle, useDeleteBucketPolicy, useDeleteBucketReplication, useDeleteBucketTagging, useDeleteObject, useDeleteObjectTagging, useDeleteObjects, useEmptyBucket, useGetBucketAcl, useGetBucketCors, useGetBucketEncryption, useGetBucketLifecycle, useGetBucketLocation, useGetBucketNotification, useGetBucketObjectLockConfiguration, useGetBucketPolicy, useGetBucketReplication, useGetBucketTagging, useGetBucketVersioning, useGetObject, useGetObjectAttributes, useGetObjectTorrent, useGetPresignedDownload, useGetPresignedPost, useGetPresignedUpload, useISVBucketStatus, useIsBucketEmpty, useListMultipartUploads, useListObjectVersions, useListObjects, useLoginMutation, useObjectAcl, useObjectLegalHold, useObjectMetadata, useObjectRetention, useObjectTagging, usePutObject, useRestoreObject, useS3Client, useS3ConfigSwitch, useSearchObjects, useSearchObjectsVersions, useSelectObjectContent, useSetBucketAcl, useSetBucketCors, useSetBucketEncryption, useSetBucketLifecycle, useSetBucketNotification, useSetBucketObjectLockConfiguration, useSetBucketPolicy, useSetBucketReplication, useSetBucketTagging, useSetBucketVersioning, useSetObjectAcl, useSetObjectLegalHold, useSetObjectRetention, useSetObjectTagging, useTableRowSelection, useUploadObjects };
|
|
16
|
+
export { useBatchObjectLegalHold, useBuckets, useCopyObject, useCreateBucket, useCreateFolder, useDeleteBucket, useDeleteBucketConfigRule, useDeleteBucketCors, useDeleteBucketLifecycle, useDeleteBucketPolicy, useDeleteBucketReplication, useDeleteBucketTagging, useDeleteObject, useDeleteObjectTagging, useDeleteObjects, useEmptyBucket, useFeatures, useGetBucketAcl, useGetBucketCors, useGetBucketEncryption, useGetBucketLifecycle, useGetBucketLocation, useGetBucketNotification, useGetBucketObjectLockConfiguration, useGetBucketPolicy, useGetBucketReplication, useGetBucketTagging, useGetBucketVersioning, useGetObject, useGetObjectAttributes, useGetObjectTorrent, useGetPresignedDownload, useGetPresignedPost, useGetPresignedUpload, useISVBucketStatus, useIsBucketEmpty, useListMultipartUploads, useListObjectVersions, useListObjects, useLoginMutation, useObjectAcl, useObjectLegalHold, useObjectMetadata, useObjectRetention, useObjectTagging, usePutObject, useRestoreObject, useS3Client, useS3ConfigSwitch, useSearchObjects, useSearchObjectsVersions, useSelectObjectContent, useSetBucketAcl, useSetBucketCors, useSetBucketEncryption, useSetBucketLifecycle, useSetBucketNotification, useSetBucketObjectLockConfiguration, useSetBucketPolicy, useSetBucketReplication, useSetBucketTagging, useSetBucketVersioning, useSetObjectAcl, useSetObjectLegalHold, useSetObjectRetention, useSetObjectTagging, useSupportedNotificationEvents, useTableRowSelection, useUploadObjects };
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import { NavigateOptions } from 'react-router';
|
|
2
|
+
/**
|
|
3
|
+
* Normalizes a path by prefixing it with the basePath.
|
|
4
|
+
* Handles edge cases like missing slashes, relative paths, and root paths.
|
|
5
|
+
*
|
|
6
|
+
* @param basePath - The base path prefix (e.g., "/accounts/my-account/buckets")
|
|
7
|
+
* @param to - The target path (e.g., "/my-bucket")
|
|
8
|
+
* @returns The normalized absolute path (e.g., "/accounts/my-account/buckets/my-bucket")
|
|
9
|
+
*/
|
|
2
10
|
export declare const normalizePath: (basePath: string, to: string) => string;
|
|
3
11
|
/**
|
|
4
12
|
* Hook for navigation with automatic basePath prefixing.
|
|
5
13
|
* Must be used within DataBrowserUI component.
|
|
6
14
|
*
|
|
15
|
+
* This hook wraps react-router's useNavigate and automatically prefixes all
|
|
16
|
+
* navigation paths with the basePath configured in DataBrowserUI props.
|
|
17
|
+
* This allows internal navigation to work correctly when DataBrowserUI is
|
|
18
|
+
* mounted at any route within the application.
|
|
19
|
+
*
|
|
7
20
|
* @example
|
|
8
21
|
* ```tsx
|
|
22
|
+
* // If DataBrowserUI has basePath="/accounts/my-account/buckets"
|
|
9
23
|
* const navigate = useDataBrowserNavigate();
|
|
10
|
-
* navigate('/
|
|
11
|
-
* navigate(-1); // History navigation works as normal
|
|
24
|
+
* navigate('/my-bucket'); // Navigates to "/accounts/my-account/buckets/my-bucket"
|
|
25
|
+
* navigate(-1); // History navigation works as normal (no prefixing)
|
|
12
26
|
* ```
|
|
13
27
|
*/
|
|
14
28
|
export declare const useDataBrowserNavigate: () => (to: string | number, options?: NavigateOptions) => void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to check if a feature is enabled in the S3 configuration.
|
|
3
|
+
*
|
|
4
|
+
* @param feature - The feature name to check
|
|
5
|
+
* @returns true if enabled, false if disabled, undefined if config not available
|
|
6
|
+
*/
|
|
7
|
+
export declare function useFeatures(feature: string): boolean | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useDataBrowserContext } from "../components/providers/DataBrowserProvider.js";
|
|
2
|
+
function useFeatures(feature) {
|
|
3
|
+
const { getS3Config } = useDataBrowserContext();
|
|
4
|
+
if (!getS3Config) return;
|
|
5
|
+
const config = getS3Config();
|
|
6
|
+
return config.features?.includes(feature) ?? false;
|
|
7
|
+
}
|
|
8
|
+
export { useFeatures };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useGetBucketTagging } from "./bucketConfiguration.js";
|
|
2
|
-
import { useFeatures } from "
|
|
2
|
+
import { useFeatures } from "./useFeatures.js";
|
|
3
3
|
import { BUCKET_TAG_APPLICATION, BUCKET_TAG_VEEAM_APPLICATION, COMMVAULT_APPLICATION, VEEAM_BACKUP_REPLICATION, VEEAM_OFFICE_365, VEEAM_OFFICE_365_V8, VEEAM_VBO_APPLICATION } from "../utils/constants.js";
|
|
4
4
|
const useISVBucketStatus = (bucketName)=>{
|
|
5
5
|
const isISVFeatureEnabled = useFeatures('ISV');
|
|
6
6
|
const { data: bucketTags, status: bucketTagsStatus } = useGetBucketTagging({
|
|
7
7
|
Bucket: bucketName
|
|
8
8
|
}, {
|
|
9
|
-
enabled: isISVFeatureEnabled
|
|
9
|
+
enabled: true === isISVFeatureEnabled
|
|
10
10
|
});
|
|
11
11
|
const veeamTagApplication = bucketTags?.TagSet?.find((tag)=>tag.Key === BUCKET_TAG_VEEAM_APPLICATION)?.Value;
|
|
12
12
|
const ISVApplicationTag = bucketTags?.TagSet?.find((tag)=>tag.Key === BUCKET_TAG_APPLICATION)?.Value;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hook to get the S3 client instance.
|
|
3
3
|
*
|
|
4
|
-
* Recreates client when
|
|
4
|
+
* Recreates client only when s3ConfigIdentifier changes.
|
|
5
|
+
* The client is memoized to avoid unnecessary recreations.
|
|
5
6
|
*/
|
|
6
7
|
export declare const useS3Client: () => import("@aws-sdk/client-s3").S3Client;
|
|
@@ -2,12 +2,12 @@ import { useMemo } from "react";
|
|
|
2
2
|
import { useDataBrowserContext } from "../components/providers/DataBrowserProvider.js";
|
|
3
3
|
import { createS3Client } from "../utils/s3Client.js";
|
|
4
4
|
const useS3Client = ()=>{
|
|
5
|
-
const {
|
|
5
|
+
const { s3ConfigIdentifier, getS3Config } = useDataBrowserContext();
|
|
6
|
+
if (!getS3Config) throw new Error('useS3Client: S3 config not available. Ensure DataBrowserProvider has getS3Config prop set.');
|
|
6
7
|
return useMemo(()=>{
|
|
7
8
|
const config = getS3Config();
|
|
8
9
|
return createS3Client(config);
|
|
9
10
|
}, [
|
|
10
|
-
getS3Config,
|
|
11
11
|
s3ConfigIdentifier
|
|
12
12
|
]);
|
|
13
13
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { S3EventType } from '../config/types';
|
|
2
2
|
/**
|
|
3
|
-
* Hook to get supported notification events from the
|
|
3
|
+
* Hook to get supported notification events from the DataBrowser configuration
|
|
4
4
|
* If no supported events are configured, returns undefined (meaning all events are supported)
|
|
5
5
|
*/
|
|
6
6
|
export declare function useSupportedNotificationEvents(): S3EventType[] | undefined;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { useDataBrowserContext } from "../components/
|
|
1
|
+
import { useDataBrowserContext } from "../components/providers/DataBrowserProvider.js";
|
|
2
2
|
function useSupportedNotificationEvents() {
|
|
3
3
|
const { getS3Config } = useDataBrowserContext();
|
|
4
|
+
if (!getS3Config) return;
|
|
4
5
|
const config = getS3Config();
|
|
5
6
|
return config?.supportedNotificationEvents;
|
|
6
7
|
}
|
package/dist/test/setup.js
CHANGED
|
@@ -14,23 +14,6 @@ var __webpack_require__ = {};
|
|
|
14
14
|
process.env.AWS_ACCESS_KEY_ID = 'test-access-key';
|
|
15
15
|
process.env.AWS_SECRET_ACCESS_KEY = 'test-secret-key';
|
|
16
16
|
process.env.AWS_DEFAULT_REGION = 'us-east-1';
|
|
17
|
-
const testS3Config = {
|
|
18
|
-
endpoint: 'http://localhost:8000',
|
|
19
|
-
region: 'us-east-1',
|
|
20
|
-
realHost: 's3.amazonaws.com',
|
|
21
|
-
forcePathStyle: true
|
|
22
|
-
};
|
|
23
|
-
const testDevConfig = {
|
|
24
|
-
useProxy: false,
|
|
25
|
-
proxyEndpoint: 'http://localhost:3000/api/s3',
|
|
26
|
-
proxyBasePath: '/api/s3',
|
|
27
|
-
proxyHost: 'localhost',
|
|
28
|
-
proxyPort: 3000
|
|
29
|
-
};
|
|
30
|
-
globalThis.__S3_CONFIG__ = testS3Config;
|
|
31
|
-
globalThis.__DEV_CONFIG__ = testDevConfig;
|
|
32
|
-
globalThis.__IS_DEVELOPMENT__ = true;
|
|
33
|
-
globalThis.__IS_PRODUCTION__ = false;
|
|
34
17
|
jest.setTimeout(10000);
|
|
35
18
|
Object.assign(__webpack_require__.g, {
|
|
36
19
|
TextDecoder: TextDecoder,
|
package/dist/test/testUtils.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ import React from 'react';
|
|
|
14
14
|
import { S3Client, PutObjectCommand } from '@aws-sdk/client-s3';
|
|
15
15
|
import { UseQueryResult } from '@tanstack/react-query';
|
|
16
16
|
import { S3BrowserConfig, S3Credentials } from '../types';
|
|
17
|
-
import type { S3Configuration, DevelopmentConfiguration } from '../config/types';
|
|
18
17
|
/**
|
|
19
18
|
* Default S3 configuration for tests
|
|
20
19
|
*/
|
|
@@ -64,28 +63,6 @@ export declare const renderHookWithWrapper: <TProps, TResult>(hook: (props: TPro
|
|
|
64
63
|
* Creates a test File object
|
|
65
64
|
*/
|
|
66
65
|
export declare const createTestFile: (name: string, content: string, type?: string) => File;
|
|
67
|
-
type GlobalConfigOverrides = {
|
|
68
|
-
s3?: Partial<S3Configuration>;
|
|
69
|
-
dev?: Partial<DevelopmentConfiguration>;
|
|
70
|
-
environment?: {
|
|
71
|
-
isDevelopment?: boolean;
|
|
72
|
-
isProduction?: boolean;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* Override global configuration for testing specific scenarios
|
|
77
|
-
* Useful for testing different deployment environments or proxy configurations
|
|
78
|
-
*/
|
|
79
|
-
export declare const overrideGlobalConfig: (overrides: GlobalConfigOverrides) => void;
|
|
80
|
-
/**
|
|
81
|
-
* Reset global configuration to test defaults
|
|
82
|
-
* Should be called in afterEach or afterAll to ensure test isolation
|
|
83
|
-
*/
|
|
84
|
-
export declare const resetGlobalConfig: () => void;
|
|
85
|
-
/**
|
|
86
|
-
* Test helper for running tests with specific global configuration
|
|
87
|
-
*/
|
|
88
|
-
export declare const withGlobalConfig: (overrides: GlobalConfigOverrides, testFn: () => void | Promise<void>) => () => Promise<void>;
|
|
89
66
|
/**
|
|
90
67
|
* Creates a factory test error
|
|
91
68
|
*/
|
package/dist/test/testUtils.js
CHANGED
|
@@ -4,7 +4,6 @@ import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
|
|
|
4
4
|
import { QueryClient } from "@tanstack/react-query";
|
|
5
5
|
import { fireEvent, renderHook, screen, waitFor } from "@testing-library/react";
|
|
6
6
|
import { coreUIAvailableThemes } from "@scality/core-ui/dist/style/theme";
|
|
7
|
-
import { CoreUiThemeProvider } from "@scality/core-ui/dist/next";
|
|
8
7
|
import { ToastProvider } from "@scality/core-ui";
|
|
9
8
|
import { DataBrowserProvider } from "../components/providers/DataBrowserProvider.js";
|
|
10
9
|
import { DataBrowserUICustomizationProvider } from "../contexts/DataBrowserUICustomizationContext.js";
|
|
@@ -125,11 +124,8 @@ const createTestWrapper = (config = testConfig, credentials = testCredentials)=>
|
|
|
125
124
|
config: {
|
|
126
125
|
basePath: ''
|
|
127
126
|
},
|
|
128
|
-
children: /*#__PURE__*/ jsx(
|
|
129
|
-
|
|
130
|
-
children: /*#__PURE__*/ jsx(ToastProvider, {
|
|
131
|
-
children: children
|
|
132
|
-
})
|
|
127
|
+
children: /*#__PURE__*/ jsx(ToastProvider, {
|
|
128
|
+
children: children
|
|
133
129
|
})
|
|
134
130
|
})
|
|
135
131
|
});
|
|
@@ -146,47 +142,6 @@ const createTestFile = (name, content, type = 'text/plain')=>new File([
|
|
|
146
142
|
], name, {
|
|
147
143
|
type
|
|
148
144
|
});
|
|
149
|
-
const overrideGlobalConfig = (overrides)=>{
|
|
150
|
-
const currentS3 = globalThis.__S3_CONFIG__;
|
|
151
|
-
const currentDev = globalThis.__DEV_CONFIG__;
|
|
152
|
-
if (overrides.s3) globalThis.__S3_CONFIG__ = {
|
|
153
|
-
...currentS3,
|
|
154
|
-
...overrides.s3
|
|
155
|
-
};
|
|
156
|
-
if (overrides.dev) globalThis.__DEV_CONFIG__ = {
|
|
157
|
-
...currentDev,
|
|
158
|
-
...overrides.dev
|
|
159
|
-
};
|
|
160
|
-
if (overrides.environment) {
|
|
161
|
-
if (void 0 !== overrides.environment.isDevelopment) globalThis.__IS_DEVELOPMENT__ = overrides.environment.isDevelopment;
|
|
162
|
-
if (void 0 !== overrides.environment.isProduction) globalThis.__IS_PRODUCTION__ = overrides.environment.isProduction;
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
const resetGlobalConfig = ()=>{
|
|
166
|
-
globalThis.__S3_CONFIG__ = {
|
|
167
|
-
endpoint: 'http://localhost:8000',
|
|
168
|
-
region: 'us-east-1',
|
|
169
|
-
realHost: 's3.amazonaws.com',
|
|
170
|
-
forcePathStyle: true
|
|
171
|
-
};
|
|
172
|
-
globalThis.__DEV_CONFIG__ = {
|
|
173
|
-
useProxy: false,
|
|
174
|
-
proxyEndpoint: 'http://localhost:3000/api/s3',
|
|
175
|
-
proxyBasePath: '/api/s3',
|
|
176
|
-
proxyHost: 'localhost',
|
|
177
|
-
proxyPort: 3000
|
|
178
|
-
};
|
|
179
|
-
globalThis.__IS_DEVELOPMENT__ = true;
|
|
180
|
-
globalThis.__IS_PRODUCTION__ = false;
|
|
181
|
-
};
|
|
182
|
-
const withGlobalConfig = (overrides, testFn)=>async ()=>{
|
|
183
|
-
overrideGlobalConfig(overrides);
|
|
184
|
-
try {
|
|
185
|
-
await testFn();
|
|
186
|
-
} finally{
|
|
187
|
-
resetGlobalConfig();
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
145
|
const createFactoryTestError = (testContext, operationName, details)=>new Error(`Factory Test Failure [${testContext}]: ${operationName} - ${details || 'Unknown error'}. Check factory implementation and hook usage patterns.`);
|
|
191
146
|
const validateFactoryHook = (hook, operationName)=>{
|
|
192
147
|
if ('function' != typeof hook) throw createFactoryTestError('Factory Validation', operationName, 'hook should be a function - check if useCreate*Hook factory is properly returning a hook function');
|
|
@@ -392,4 +347,4 @@ const applyBucketMocks = (mocks, mockData = {})=>{
|
|
|
392
347
|
if (mocks.useGetBucketLifecycle) mocks.useGetBucketLifecycle.mockReturnValue(data.lifecycle);
|
|
393
348
|
if (mocks.useGetBucketReplication) mocks.useGetBucketReplication.mockReturnValue(data.replication);
|
|
394
349
|
};
|
|
395
|
-
export { MockedPutObjectCommand, MockedS3Client, applyBucketMocks, createDefaultBucketMocks, createFactoryTestError, createMockMutationResult, createMockQueryResult, createTestFile, createTestWrapper, findToggleByLabel, mockErrorSubmit, mockOffsetSize, mockS3Client, mockSuccessSubmit,
|
|
350
|
+
export { MockedPutObjectCommand, MockedS3Client, applyBucketMocks, createDefaultBucketMocks, createFactoryTestError, createMockMutationResult, createMockQueryResult, createTestFile, createTestWrapper, findToggleByLabel, mockErrorSubmit, mockOffsetSize, mockS3Client, mockSuccessSubmit, overrideHandlers, renderHookWithWrapper, setupCommonMocks, setupMswServer, setupS3Mocks, submitForm, testConfig, testCredentials, validateFactoryHook, validateHookResult };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import type { S3ClientConfig } from '@aws-sdk/client-s3';
|
|
2
2
|
import type { AwsCredentialIdentity } from '@aws-sdk/types';
|
|
3
|
-
import type { S3EventType } from '../config/types';
|
|
3
|
+
import type { S3EventType, ProxyConfiguration } from '../config/types';
|
|
4
4
|
export type { Bucket, _Object, ObjectVersion, DeleteMarkerEntry, Owner, Tag, BucketCannedACL, BucketLocationConstraint, CopyObjectCommandInput, CopyObjectCommandOutput, CreateBucketCommandInput, CreateBucketCommandOutput, DeleteBucketCommandInput, DeleteBucketCommandOutput, DeleteBucketCorsCommandOutput, DeleteBucketLifecycleCommandOutput, DeleteBucketPolicyCommandOutput, DeleteBucketReplicationCommandOutput, DeleteBucketTaggingCommandOutput, DeleteObjectCommandInput, DeleteObjectCommandOutput, DeleteObjectsCommandInput, DeleteObjectsCommandOutput, DeleteObjectTaggingCommandOutput, GetBucketAclCommandOutput, GetBucketCorsCommandOutput, GetBucketEncryptionCommandOutput, GetBucketLifecycleConfigurationCommandOutput, GetBucketLocationCommandInput, GetBucketLocationCommandOutput, GetBucketNotificationConfigurationCommandOutput, GetBucketPolicyCommandOutput, GetBucketReplicationCommandOutput, GetBucketTaggingCommandOutput, GetBucketVersioningCommandOutput, GetObjectAclCommandOutput, GetObjectAttributesCommandInput, GetObjectAttributesCommandOutput, GetObjectCommandInput, GetObjectCommandOutput, GetObjectLegalHoldCommandOutput, GetObjectLockConfigurationCommandOutput, GetObjectRetentionCommandOutput, GetObjectTaggingCommandOutput, GetObjectTorrentCommandOutput, HeadObjectCommandInput, HeadObjectCommandOutput, ListBucketsCommandOutput, ListMultipartUploadsCommandInput, ListMultipartUploadsCommandOutput, ListObjectsV2CommandInput, ListObjectsV2CommandOutput, ListObjectVersionsCommandInput, ListObjectVersionsCommandOutput, ObjectCannedACL, PutBucketAclCommandInput, PutBucketCorsCommandInput, PutBucketEncryptionCommandInput, PutBucketLifecycleConfigurationCommandInput, PutBucketNotificationConfigurationCommandInput, PutBucketPolicyCommandInput, PutBucketReplicationCommandInput, PutBucketTaggingCommandInput, PutBucketTaggingCommandOutput, PutBucketVersioningCommandInput, PutObjectAclCommandInput, PutObjectCommandInput, PutObjectCommandOutput, PutObjectLegalHoldCommandInput, PutObjectLockConfigurationCommandInput, PutObjectRetentionCommandInput, PutObjectTaggingCommandInput, RestoreObjectCommandInput, RestoreObjectCommandOutput, SelectObjectContentCommandInput, SelectObjectContentCommandOutput, } from '@aws-sdk/client-s3';
|
|
5
5
|
export interface S3BrowserConfig extends Omit<S3ClientConfig, 'credentials'> {
|
|
6
6
|
endpoint?: string;
|
|
7
7
|
region: string;
|
|
8
8
|
forcePathStyle?: boolean;
|
|
9
|
-
|
|
10
|
-
realS3Host?: string;
|
|
11
|
-
proxyPath?: string;
|
|
12
|
-
proxyHost?: string;
|
|
13
|
-
proxyPort?: number;
|
|
9
|
+
proxy?: ProxyConfiguration;
|
|
14
10
|
publicAclIndicator?: string;
|
|
15
11
|
supportedNotificationEvents?: S3EventType[];
|
|
16
12
|
features?: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|