@atlaskit/media-client 36.0.4 → 36.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/CHANGELOG.md +14 -0
- package/dist/cjs/client/file-fetcher/index.js +2 -1
- package/dist/es2019/client/file-fetcher/index.js +2 -1
- package/dist/esm/client/file-fetcher/index.js +2 -1
- package/dist/types/utils/createFileDataLoader.d.ts +1 -1
- package/dist/types/utils/request/errors.d.ts +4 -3
- package/dist/types-ts4.5/utils/createFileDataLoader.d.ts +1 -1
- package/dist/types-ts4.5/utils/request/errors.d.ts +4 -3
- package/example-helpers/styles.ts +13 -13
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 36.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4a6982674a571`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4a6982674a571) -
|
|
8
|
+
Anonymize filename in uploadExternal behind platform_media_upload_external_anonymize_filename
|
|
9
|
+
feature flag
|
|
10
|
+
|
|
11
|
+
## 36.0.5
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 36.0.4
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -26,6 +26,7 @@ var _Subscription = require("rxjs/Subscription");
|
|
|
26
26
|
var _map = require("rxjs/operators/map");
|
|
27
27
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
28
28
|
var _mediaCore = require("@atlaskit/media-core");
|
|
29
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
29
30
|
var _downloadUrl = require("@atlaskit/media-common/downloadUrl");
|
|
30
31
|
var _mediaStore = require("../media-store");
|
|
31
32
|
var _fileState2 = require("../../models/file-state");
|
|
@@ -585,7 +586,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
585
586
|
return _ref0.apply(this, arguments);
|
|
586
587
|
};
|
|
587
588
|
}());
|
|
588
|
-
name = url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
589
|
+
name = (0, _platformFeatureFlags.fg)('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
589
590
|
fileState = {
|
|
590
591
|
status: 'processing',
|
|
591
592
|
name: name,
|
|
@@ -4,6 +4,7 @@ import { map } from 'rxjs/operators/map';
|
|
|
4
4
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
5
5
|
import uuid from 'uuid/v4';
|
|
6
6
|
import { authToOwner } from '@atlaskit/media-core';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { downloadUrl } from '@atlaskit/media-common/downloadUrl';
|
|
8
9
|
import { MediaStore as MediaApi } from '../media-store';
|
|
9
10
|
import { isErrorFileState, isFinalFileState, isProcessingFileState, mapMediaFileToFileState, mapMediaItemToFileState } from '../../models/file-state';
|
|
@@ -358,7 +359,7 @@ export class FileFetcherImpl {
|
|
|
358
359
|
origin: 'remote'
|
|
359
360
|
});
|
|
360
361
|
});
|
|
361
|
-
const name = url.split('/').pop() || '';
|
|
362
|
+
const name = fg('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || '';
|
|
362
363
|
// we create a initial fileState with the minimum info that we have at this point
|
|
363
364
|
const fileState = {
|
|
364
365
|
status: 'processing',
|
|
@@ -10,6 +10,7 @@ import { map } from 'rxjs/operators/map';
|
|
|
10
10
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
11
11
|
import uuid from 'uuid/v4';
|
|
12
12
|
import { authToOwner } from '@atlaskit/media-core';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { downloadUrl } from '@atlaskit/media-common/downloadUrl';
|
|
14
15
|
import { MediaStore as MediaApi } from '../media-store';
|
|
15
16
|
import { isErrorFileState, isFinalFileState, isProcessingFileState, mapMediaFileToFileState, mapMediaItemToFileState } from '../../models/file-state';
|
|
@@ -568,7 +569,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
568
569
|
return _ref0.apply(this, arguments);
|
|
569
570
|
};
|
|
570
571
|
}());
|
|
571
|
-
name = url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
572
|
+
name = fg('platform_media_upload_external_anonymize_filename') ? crypto.randomUUID() : url.split('/').pop() || ''; // we create a initial fileState with the minimum info that we have at this point
|
|
572
573
|
fileState = {
|
|
573
574
|
status: 'processing',
|
|
574
575
|
name: name,
|
|
@@ -27,4 +27,4 @@ export type FileIdsByCollection = {
|
|
|
27
27
|
* @param mediaStore instance of MediaStore
|
|
28
28
|
*/
|
|
29
29
|
export declare function createBatchLoadingFunc(mediaStore: MediaStore): (keys: ReadonlyArray<DataloaderKey>) => Promise<Array<DataloaderResult | Error>>;
|
|
30
|
-
export declare function createFileDataloader(mediaStore: MediaStore): Dataloader<DataloaderKey, DataloaderResult
|
|
30
|
+
export declare function createFileDataloader(mediaStore: MediaStore): Dataloader<DataloaderKey, DataloaderResult>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
1
2
|
import { BaseMediaClientError } from '../../models/errors';
|
|
2
|
-
import { type RequestErrorReason, type RequestErrorMetadata, type RequestErrorAttributes } from './types';
|
|
3
|
+
import { type RequestErrorReason, type RequestErrorMetadata, type RequestErrorAttributes, type RequestMethod } from './types';
|
|
3
4
|
export declare class RequestError extends BaseMediaClientError<RequestErrorReason, RequestErrorMetadata | undefined, Error | undefined, RequestErrorAttributes> {
|
|
4
5
|
constructor(reason: RequestErrorReason, metadata?: RequestErrorMetadata, innerError?: Error);
|
|
5
6
|
/** Will be deprecated. Use the properties `reason` and `metadata` instead */
|
|
6
7
|
get attributes(): {
|
|
7
8
|
reason: RequestErrorReason;
|
|
8
|
-
method:
|
|
9
|
+
method: RequestMethod | undefined;
|
|
9
10
|
endpoint: string | undefined;
|
|
10
11
|
mediaRegion: string | undefined;
|
|
11
12
|
mediaEnv: string | undefined;
|
|
@@ -13,7 +14,7 @@ export declare class RequestError extends BaseMediaClientError<RequestErrorReaso
|
|
|
13
14
|
clientExhaustedRetries: boolean | undefined;
|
|
14
15
|
statusCode: number | undefined;
|
|
15
16
|
metadata: {
|
|
16
|
-
traceContext:
|
|
17
|
+
traceContext: MediaTraceContext | undefined;
|
|
17
18
|
};
|
|
18
19
|
innerError: Error | undefined;
|
|
19
20
|
};
|
|
@@ -27,4 +27,4 @@ export type FileIdsByCollection = {
|
|
|
27
27
|
* @param mediaStore instance of MediaStore
|
|
28
28
|
*/
|
|
29
29
|
export declare function createBatchLoadingFunc(mediaStore: MediaStore): (keys: ReadonlyArray<DataloaderKey>) => Promise<Array<DataloaderResult | Error>>;
|
|
30
|
-
export declare function createFileDataloader(mediaStore: MediaStore): Dataloader<DataloaderKey, DataloaderResult
|
|
30
|
+
export declare function createFileDataloader(mediaStore: MediaStore): Dataloader<DataloaderKey, DataloaderResult>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { MediaTraceContext } from '@atlaskit/media-common';
|
|
1
2
|
import { BaseMediaClientError } from '../../models/errors';
|
|
2
|
-
import { type RequestErrorReason, type RequestErrorMetadata, type RequestErrorAttributes } from './types';
|
|
3
|
+
import { type RequestErrorReason, type RequestErrorMetadata, type RequestErrorAttributes, type RequestMethod } from './types';
|
|
3
4
|
export declare class RequestError extends BaseMediaClientError<RequestErrorReason, RequestErrorMetadata | undefined, Error | undefined, RequestErrorAttributes> {
|
|
4
5
|
constructor(reason: RequestErrorReason, metadata?: RequestErrorMetadata, innerError?: Error);
|
|
5
6
|
/** Will be deprecated. Use the properties `reason` and `metadata` instead */
|
|
6
7
|
get attributes(): {
|
|
7
8
|
reason: RequestErrorReason;
|
|
8
|
-
method:
|
|
9
|
+
method: RequestMethod | undefined;
|
|
9
10
|
endpoint: string | undefined;
|
|
10
11
|
mediaRegion: string | undefined;
|
|
11
12
|
mediaEnv: string | undefined;
|
|
@@ -13,7 +14,7 @@ export declare class RequestError extends BaseMediaClientError<RequestErrorReaso
|
|
|
13
14
|
clientExhaustedRetries: boolean | undefined;
|
|
14
15
|
statusCode: number | undefined;
|
|
15
16
|
metadata: {
|
|
16
|
-
traceContext:
|
|
17
|
+
traceContext: MediaTraceContext | undefined;
|
|
17
18
|
};
|
|
18
19
|
innerError: Error | undefined;
|
|
19
20
|
};
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
import { token } from '@atlaskit/tokens';
|
|
2
2
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
|
-
import { css } from '@emotion/react';
|
|
3
|
+
import { css, type SerializedStyles } from '@emotion/react';
|
|
4
4
|
import { type FileStatus } from '../src';
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
7
|
-
export const wrapperStyles = css({
|
|
7
|
+
export const wrapperStyles: SerializedStyles = css({
|
|
8
8
|
display: 'flex',
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
12
|
-
export const imagePreviewStyles = css({
|
|
12
|
+
export const imagePreviewStyles: SerializedStyles = css({
|
|
13
13
|
width: '300px',
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
17
|
-
export const previewWrapperStyles = css({
|
|
17
|
+
export const previewWrapperStyles: SerializedStyles = css({
|
|
18
18
|
flex: 1,
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
22
|
-
export const metadataWrapperStyles = css({
|
|
22
|
+
export const metadataWrapperStyles: SerializedStyles = css({
|
|
23
23
|
width: '400px',
|
|
24
24
|
overflow: 'scroll',
|
|
25
25
|
flex: 1,
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
29
|
-
export const fileInputStyles = css({
|
|
29
|
+
export const fileInputStyles: SerializedStyles = css({
|
|
30
30
|
color: 'transparent',
|
|
31
31
|
});
|
|
32
32
|
|
|
@@ -44,7 +44,7 @@ const statusColorMap: { [key in FileStatus]: string } = {
|
|
|
44
44
|
};
|
|
45
45
|
|
|
46
46
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
47
|
-
export const fileWrapperStyles = (status: FileStatus) =>
|
|
47
|
+
export const fileWrapperStyles = (status: FileStatus): SerializedStyles =>
|
|
48
48
|
css({
|
|
49
49
|
padding: '5px',
|
|
50
50
|
margin: '10px',
|
|
@@ -55,7 +55,7 @@ export const fileWrapperStyles = (status: FileStatus) =>
|
|
|
55
55
|
});
|
|
56
56
|
|
|
57
57
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
58
|
-
export const cardsWrapperStyles = css({
|
|
58
|
+
export const cardsWrapperStyles: SerializedStyles = css({
|
|
59
59
|
width: '900px',
|
|
60
60
|
padding: '10px',
|
|
61
61
|
borderRight: `${token('border.width', '1px')} solid ${token('color.border')}`,
|
|
@@ -73,7 +73,7 @@ export const cardsWrapperStyles = css({
|
|
|
73
73
|
});
|
|
74
74
|
|
|
75
75
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
76
|
-
export const headerStyles = css({
|
|
76
|
+
export const headerStyles: SerializedStyles = css({
|
|
77
77
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
78
78
|
button: {
|
|
79
79
|
margin: '5px',
|
|
@@ -81,7 +81,7 @@ export const headerStyles = css({
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
84
|
-
export const fileStateWrapperStyles = css({
|
|
84
|
+
export const fileStateWrapperStyles: SerializedStyles = css({
|
|
85
85
|
border: `${token('border.width', '1px')} solid ${token('color.border')}`,
|
|
86
86
|
margin: '10px',
|
|
87
87
|
padding: '10px',
|
|
@@ -89,7 +89,7 @@ export const fileStateWrapperStyles = css({
|
|
|
89
89
|
});
|
|
90
90
|
|
|
91
91
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
92
|
-
export const uploadTouchWrapperStyles = css({
|
|
92
|
+
export const uploadTouchWrapperStyles: SerializedStyles = css({
|
|
93
93
|
height: '100%',
|
|
94
94
|
width: '100%',
|
|
95
95
|
display: 'flex',
|
|
@@ -101,7 +101,7 @@ export const uploadTouchWrapperStyles = css({
|
|
|
101
101
|
});
|
|
102
102
|
|
|
103
103
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
104
|
-
export const rowStyles = css({
|
|
104
|
+
export const rowStyles: SerializedStyles = css({
|
|
105
105
|
flexDirection: 'row',
|
|
106
106
|
justifyContent: 'center',
|
|
107
107
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
@@ -111,7 +111,7 @@ export const rowStyles = css({
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
114
|
-
export const responseStyles = css({
|
|
114
|
+
export const responseStyles: SerializedStyles = css({
|
|
115
115
|
// eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
|
|
116
116
|
fontFamily: 'monospace',
|
|
117
117
|
whiteSpace: 'pre',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "36.0.
|
|
3
|
+
"version": "36.0.6",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@atlaskit/atlassian-context": "^0.
|
|
32
|
+
"@atlaskit/atlassian-context": "^0.8.0",
|
|
33
33
|
"@atlaskit/chunkinator": "^7.0.0",
|
|
34
34
|
"@atlaskit/media-common": "^13.0.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/media-core": "^37.0.0",
|
|
54
54
|
"@atlaskit/media-state": "^2.0.0",
|
|
55
55
|
"@atlaskit/ssr": "workspace:^",
|
|
56
|
-
"@atlaskit/tokens": "^
|
|
56
|
+
"@atlaskit/tokens": "^12.0.0",
|
|
57
57
|
"@atlassian/a11y-jest-testing": "^0.11.0",
|
|
58
58
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
59
59
|
"@emotion/react": "^11.7.1",
|
|
@@ -77,6 +77,9 @@
|
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
79
|
"platform-feature-flags": {
|
|
80
|
+
"platform_media_upload_external_anonymize_filename": {
|
|
81
|
+
"type": "boolean"
|
|
82
|
+
},
|
|
80
83
|
"platform_media_cdn_single_host": {
|
|
81
84
|
"type": "boolean"
|
|
82
85
|
},
|