@scality/data-browser-library 1.0.8 → 1.1.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.
Files changed (41) hide show
  1. package/dist/components/__tests__/BucketCorsPage.test.js +67 -9
  2. package/dist/components/__tests__/BucketDetails.test.js +1 -0
  3. package/dist/components/__tests__/BucketLifecycleFormPage.test.js +16 -11
  4. package/dist/components/__tests__/BucketNotificationFormPage.test.js +45 -0
  5. package/dist/components/__tests__/BucketOverview.test.js +92 -2
  6. package/dist/components/__tests__/BucketPolicyPage.test.js +70 -51
  7. package/dist/components/__tests__/BucketReplicationFormPage.test.js +51 -24
  8. package/dist/components/__tests__/ObjectList.test.js +43 -2
  9. package/dist/components/buckets/BucketConfigEditButton.d.ts +2 -0
  10. package/dist/components/buckets/BucketConfigEditButton.js +9 -3
  11. package/dist/components/buckets/BucketCorsPage.js +57 -20
  12. package/dist/components/buckets/BucketDetails.js +27 -2
  13. package/dist/components/buckets/BucketLifecycleFormPage.js +310 -270
  14. package/dist/components/buckets/BucketOverview.js +21 -18
  15. package/dist/components/buckets/BucketPolicyPage.js +119 -83
  16. package/dist/components/buckets/BucketReplicationFormPage.d.ts +1 -0
  17. package/dist/components/buckets/BucketReplicationFormPage.js +165 -129
  18. package/dist/components/buckets/BucketVersioning.js +16 -10
  19. package/dist/components/buckets/__tests__/BucketVersioning.test.js +76 -23
  20. package/dist/components/buckets/notifications/BucketNotificationFormPage.js +13 -5
  21. package/dist/components/index.d.ts +1 -1
  22. package/dist/components/index.js +2 -2
  23. package/dist/components/objects/ObjectDetails/__tests__/ObjectDetails.test.js +3 -3
  24. package/dist/components/objects/ObjectList.js +22 -25
  25. package/dist/components/objects/ObjectLock/EditRetentionButton.js +2 -2
  26. package/dist/config/types.d.ts +11 -0
  27. package/dist/hooks/factories/useCreateS3InfiniteQueryHook.js +2 -0
  28. package/dist/hooks/index.d.ts +1 -1
  29. package/dist/hooks/objectOperations.d.ts +3 -3
  30. package/dist/hooks/objectOperations.js +3 -3
  31. package/dist/hooks/useBucketConfigEditor.d.ts +4 -4
  32. package/dist/hooks/useBucketConfigEditor.js +16 -31
  33. package/dist/test/mocks/esmOnlyModules.js +4 -0
  34. package/dist/types/index.d.ts +0 -1
  35. package/dist/utils/__tests__/proxyMiddleware.test.js +34 -0
  36. package/dist/utils/proxyMiddleware.js +2 -0
  37. package/package.json +4 -4
  38. package/dist/components/Editor.d.ts +0 -12
  39. package/dist/components/Editor.js +0 -28
  40. package/dist/types/monaco.d.ts +0 -13
  41. package/dist/types/monaco.js +0 -0
@@ -52,6 +52,7 @@ const createProxyMiddleware = (config)=>{
52
52
  const resolvedProxyEndpoint = resolveProxyEndpoint(config.endpoint);
53
53
  const target = parseEndpoint(config.target);
54
54
  const proxy = parseEndpoint(resolvedProxyEndpoint);
55
+ const targetEndpointUrl = `${target.protocol}//${target.hostname}${80 !== target.port && 443 !== target.port ? `:${target.port}` : ''}`;
55
56
  return {
56
57
  applyToStack: (clientStack)=>{
57
58
  const preSigningMiddleware = (next)=>async (args)=>{
@@ -90,6 +91,7 @@ const createProxyMiddleware = (config)=>{
90
91
  request.protocol = proxy.protocol;
91
92
  request.path = '' === proxy.pathname || '/' === proxy.pathname ? request.path : proxy.pathname + request.path;
92
93
  request.headers.host = proxy.port && 80 !== proxy.port && 443 !== proxy.port ? `${proxy.hostname}:${proxy.port}` : proxy.hostname;
94
+ request.headers['x-s3-target-endpoint'] = targetEndpointUrl;
93
95
  request.query = queryParams;
94
96
  }
95
97
  return next(args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scality/data-browser-library",
3
- "version": "1.0.8",
3
+ "version": "1.1.0",
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",
@@ -30,8 +30,7 @@
30
30
  "@aws-sdk/s3-presigned-post": "^3.983.0",
31
31
  "@aws-sdk/s3-request-presigner": "^3.983.0",
32
32
  "@hookform/resolvers": "^5.2.2",
33
- "@monaco-editor/react": "^4.7.0",
34
- "@scality/zenkoclient": "^2.0.0-preview.1",
33
+ "@scality/cloudserverclient": "^1.0.4",
35
34
  "@tanstack/react-query": "^5.8.0",
36
35
  "@tanstack/react-query-devtools": "^5.8.0",
37
36
  "@testing-library/user-event": "^14.6.1",
@@ -40,7 +39,7 @@
40
39
  "react-hook-form": "^7.48.0"
41
40
  },
42
41
  "peerDependencies": {
43
- "@scality/core-ui": ">=0.198.0",
42
+ "@scality/core-ui": ">=0.202.0",
44
43
  "react": ">=18.0.0",
45
44
  "react-dom": ">=18.0.0",
46
45
  "react-router": ">=7.1.3",
@@ -54,6 +53,7 @@
54
53
  "@testing-library/react": "^15.0.6",
55
54
  "@testing-library/user-event": "^14.6.1",
56
55
  "@types/jest": "^30.0.0",
56
+ "@types/json-schema": "^7.0.15",
57
57
  "@types/react": "^18.2.0",
58
58
  "@types/react-dom": "^18.2.0",
59
59
  "@types/styled-components": "^5.1.34",
@@ -1,12 +0,0 @@
1
- import { type BeforeMount, type EditorProps } from '@monaco-editor/react';
2
- interface EditorComponentProps {
3
- value: string;
4
- onChange: (value: string | undefined) => void;
5
- readOnly?: boolean;
6
- language?: string;
7
- height?: string;
8
- width?: string;
9
- beforeMount?: BeforeMount;
10
- }
11
- export declare const Editor: React.FC<EditorComponentProps & EditorProps>;
12
- export {};
@@ -1,28 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import react from "@monaco-editor/react";
3
- const Editor = ({ value, onChange, readOnly = false, language = 'json', height = '400px', width = '100%', beforeMount, ...rest })=>{
4
- const editorTheme = 'vs-dark';
5
- return /*#__PURE__*/ jsx(react, {
6
- height: height,
7
- width: width,
8
- language: language,
9
- value: value,
10
- theme: editorTheme,
11
- onChange: onChange,
12
- options: {
13
- readOnly,
14
- scrollBeyondLastLine: false,
15
- minimap: {
16
- enabled: false
17
- },
18
- fontSize: 12,
19
- lineNumbers: 'on',
20
- automaticLayout: true,
21
- formatOnPaste: true,
22
- formatOnType: true
23
- },
24
- beforeMount: beforeMount,
25
- ...rest
26
- });
27
- };
28
- export { Editor };
@@ -1,13 +0,0 @@
1
- export interface MonacoJsonDefaults {
2
- setDiagnosticsOptions(options: {
3
- validate: boolean;
4
- schemas?: Array<{
5
- uri: string;
6
- fileMatch: string[];
7
- schema: unknown;
8
- }>;
9
- }): void;
10
- }
11
- export interface MonacoLanguagesJson {
12
- jsonDefaults: MonacoJsonDefaults;
13
- }
File without changes