@scality/data-browser-library 1.0.4 → 1.0.6
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.js +18 -8
- package/dist/components/__tests__/BucketCreate.test.js +60 -20
- package/dist/components/__tests__/BucketList.test.js +91 -6
- package/dist/components/__tests__/BucketNotificationFormPage.test.js +54 -19
- package/dist/components/__tests__/BucketReplicationFormPage.test.js +183 -61
- package/dist/components/__tests__/MetadataSearch.test.js +18 -12
- package/dist/components/__tests__/ObjectList.test.js +94 -2
- package/dist/components/buckets/BucketCreate.d.ts +1 -0
- package/dist/components/buckets/BucketCreate.js +57 -7
- package/dist/components/buckets/BucketDetails.js +0 -1
- package/dist/components/buckets/BucketLifecycleFormPage.js +209 -213
- package/dist/components/buckets/BucketList.js +25 -4
- package/dist/components/buckets/BucketReplicationFormPage.js +9 -3
- package/dist/components/buckets/DeleteBucketConfigRuleButton.js +1 -1
- package/dist/components/buckets/notifications/BucketNotificationList.js +1 -1
- package/dist/components/objects/DeleteObjectButton.d.ts +1 -0
- package/dist/components/objects/DeleteObjectButton.js +11 -5
- package/dist/components/objects/ObjectDetails/FormComponents.d.ts +9 -0
- package/dist/components/objects/ObjectDetails/FormComponents.js +37 -0
- package/dist/components/objects/ObjectDetails/ObjectMetadata.js +182 -204
- package/dist/components/objects/ObjectDetails/ObjectSummary.js +22 -5
- package/dist/components/objects/ObjectDetails/ObjectTags.js +109 -154
- package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +3 -3
- package/dist/components/objects/ObjectDetails/__tests__/ObjectMetadata.test.d.ts +1 -0
- package/dist/components/objects/ObjectDetails/__tests__/ObjectMetadata.test.js +230 -0
- package/dist/components/objects/ObjectDetails/__tests__/ObjectTags.test.d.ts +1 -0
- package/dist/components/objects/ObjectDetails/__tests__/ObjectTags.test.js +342 -0
- package/dist/components/objects/ObjectDetails/__tests__/formUtils.test.d.ts +1 -0
- package/dist/components/objects/ObjectDetails/__tests__/formUtils.test.js +202 -0
- package/dist/components/objects/ObjectDetails/index.d.ts +2 -1
- package/dist/components/objects/ObjectDetails/index.js +12 -16
- package/dist/components/objects/ObjectList.d.ts +3 -2
- package/dist/components/objects/ObjectList.js +204 -104
- package/dist/components/objects/ObjectLock/__tests__/ObjectLockSettings.test.js +78 -26
- package/dist/components/objects/ObjectPage.js +22 -5
- package/dist/components/ui/ArrayFieldActions.js +0 -2
- package/dist/components/ui/FilterFormSection.js +17 -36
- package/dist/components/ui/FormGrid.d.ts +7 -0
- package/dist/components/ui/FormGrid.js +37 -0
- package/dist/components/ui/Table.elements.js +1 -0
- package/dist/config/__tests__/factory.test.js +29 -1
- package/dist/config/factory.d.ts +2 -0
- package/dist/config/factory.js +3 -1
- package/dist/config/types.d.ts +45 -2
- package/dist/hooks/__tests__/usePresigningS3Client.test.d.ts +1 -0
- package/dist/hooks/__tests__/usePresigningS3Client.test.js +104 -0
- package/dist/hooks/factories/index.d.ts +1 -1
- package/dist/hooks/factories/index.js +2 -2
- package/dist/hooks/factories/useCreateS3MutationHook.d.ts +2 -1
- package/dist/hooks/factories/useCreateS3MutationHook.js +10 -3
- package/dist/hooks/factories/useCreateS3QueryHook.d.ts +1 -0
- package/dist/hooks/factories/useCreateS3QueryHook.js +9 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +2 -1
- package/dist/hooks/presignedOperations.js +4 -4
- package/dist/hooks/useBucketLocations.d.ts +6 -0
- package/dist/hooks/useBucketLocations.js +45 -0
- package/dist/hooks/usePresigningS3Client.d.ts +13 -0
- package/dist/hooks/usePresigningS3Client.js +21 -0
- package/package.json +4 -3
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { S3Client } from '@aws-sdk/client-s3';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to get an S3 client specifically for presigned URL generation.
|
|
4
|
+
*
|
|
5
|
+
* When proxy is configured, presigned URLs must use the proxy endpoint
|
|
6
|
+
* (browser-accessible) rather than the internal target. This client is
|
|
7
|
+
* created WITHOUT proxy middleware so that `getSignedUrl` produces URLs
|
|
8
|
+
* pointing to the proxy endpoint instead of the internal S3 service.
|
|
9
|
+
*
|
|
10
|
+
* For non-proxy configurations, this returns a standard S3 client
|
|
11
|
+
* identical to `useS3Client`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const usePresigningS3Client: () => S3Client;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { S3Client } from "@aws-sdk/client-s3";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useDataBrowserContext } from "../components/providers/DataBrowserProvider.js";
|
|
4
|
+
import { resolveProxyEndpoint } from "../utils/proxyMiddleware.js";
|
|
5
|
+
const usePresigningS3Client = ()=>{
|
|
6
|
+
const { s3ConfigIdentifier, getS3Config } = useDataBrowserContext();
|
|
7
|
+
if (!getS3Config) throw new Error('usePresigningS3Client: S3 config not available. Ensure DataBrowserProvider has getS3Config prop set.');
|
|
8
|
+
return useMemo(()=>{
|
|
9
|
+
const config = getS3Config();
|
|
10
|
+
const endpoint = config.proxy?.enabled ? resolveProxyEndpoint(config.proxy.endpoint) : config.endpoint;
|
|
11
|
+
return new S3Client({
|
|
12
|
+
endpoint,
|
|
13
|
+
credentials: config.credentials,
|
|
14
|
+
forcePathStyle: config.forcePathStyle ?? true,
|
|
15
|
+
region: config.region
|
|
16
|
+
});
|
|
17
|
+
}, [
|
|
18
|
+
s3ConfigIdentifier
|
|
19
|
+
]);
|
|
20
|
+
};
|
|
21
|
+
export { usePresigningS3Client };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scality/data-browser-library",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A modular React component library for browsing S3 buckets and objects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -40,10 +40,11 @@
|
|
|
40
40
|
"react-hook-form": "^7.48.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@scality/core-ui": "0.
|
|
43
|
+
"@scality/core-ui": ">=0.197.0",
|
|
44
44
|
"react": ">=18.0.0",
|
|
45
45
|
"react-dom": ">=18.0.0",
|
|
46
|
-
"react-router
|
|
46
|
+
"react-router": ">=7.1.3",
|
|
47
|
+
"react-router-dom": ">=7.1.3",
|
|
47
48
|
"styled-components": "^5.0.0"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|