@atlaskit/media-client 36.0.6 → 36.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.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/client/file-fetcher/index.js +2 -2
- package/dist/es2019/client/file-fetcher/index.js +2 -2
- package/dist/esm/client/file-fetcher/index.js +2 -2
- package/dist/types/client/file-fetcher/index.d.ts +1 -1
- package/dist/types/uploader/error.d.ts +1 -1
- package/dist/types/utils/polling/errors.d.ts +1 -1
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +1 -1
- package/dist/types-ts4.5/uploader/error.d.ts +1 -1
- package/dist/types-ts4.5/utils/polling/errors.d.ts +1 -1
- package/package.json +6 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 36.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5653e8be24c05`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5653e8be24c05) -
|
|
8
|
+
Replace `uuid-validate` with an inlined, browser-only `isValidUuid` helper in
|
|
9
|
+
`@atlaskit/media-common`. Removes the `uuid-validate` dependency from `media-card`,
|
|
10
|
+
`media-client`, `media-common` and `media-picker` so consumers no longer pull in the Node `Buffer`
|
|
11
|
+
polyfill purely for a `Buffer.isBuffer` check that always returned `false` in the browser.
|
|
12
|
+
|
|
13
|
+
Adds a new `@atlaskit/media-common/isValidUuid` subpath export so consumers can import the helper
|
|
14
|
+
without going through the package's barrel file (in line with the Debarreling Platform Packages
|
|
15
|
+
initiative).
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Updated dependencies
|
|
20
|
+
|
|
3
21
|
## 36.0.6
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -27,6 +27,7 @@ var _map = require("rxjs/operators/map");
|
|
|
27
27
|
var _v = _interopRequireDefault(require("uuid/v4"));
|
|
28
28
|
var _mediaCore = require("@atlaskit/media-core");
|
|
29
29
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
|
+
var _isValidUuid = require("@atlaskit/media-common/isValidUuid");
|
|
30
31
|
var _downloadUrl = require("@atlaskit/media-common/downloadUrl");
|
|
31
32
|
var _mediaStore = require("../media-store");
|
|
32
33
|
var _fileState2 = require("../../models/file-state");
|
|
@@ -36,7 +37,6 @@ var _uploader = require("../../uploader");
|
|
|
36
37
|
var _fileStreamsCache = require("../../file-streams-cache");
|
|
37
38
|
var _globalMediaEventEmitter = require("../../globalMediaEventEmitter");
|
|
38
39
|
var _constants = require("../../constants");
|
|
39
|
-
var _uuidValidate = _interopRequireDefault(require("uuid-validate"));
|
|
40
40
|
var _createFileDataLoader = require("../../utils/createFileDataLoader");
|
|
41
41
|
var _getMediaTypeFromUploadableFile = require("../../utils/getMediaTypeFromUploadableFile");
|
|
42
42
|
var _overrideMediaTypeIfUnknown = require("../../utils/overrideMediaTypeIfUnknown");
|
|
@@ -465,7 +465,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
465
465
|
occurrenceKey = options.occurrenceKey,
|
|
466
466
|
includeHashForDuplicateFiles = options.includeHashForDuplicateFiles,
|
|
467
467
|
forceRefresh = options.forceRefresh;
|
|
468
|
-
if (!(0,
|
|
468
|
+
if (!(0, _isValidUuid.isValidUuid)(id)) {
|
|
469
469
|
var subject = (0, _createMediaSubject.createMediaSubject)();
|
|
470
470
|
var err = new _error.FileFetcherError('invalidFileId', {
|
|
471
471
|
id: id,
|
|
@@ -5,6 +5,7 @@ import { map } from 'rxjs/operators/map';
|
|
|
5
5
|
import uuid from 'uuid/v4';
|
|
6
6
|
import { authToOwner } from '@atlaskit/media-core';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { isValidUuid } from '@atlaskit/media-common/isValidUuid';
|
|
8
9
|
import { downloadUrl } from '@atlaskit/media-common/downloadUrl';
|
|
9
10
|
import { MediaStore as MediaApi } from '../media-store';
|
|
10
11
|
import { isErrorFileState, isFinalFileState, isProcessingFileState, mapMediaFileToFileState, mapMediaItemToFileState } from '../../models/file-state';
|
|
@@ -14,7 +15,6 @@ import { uploadFile } from '../../uploader';
|
|
|
14
15
|
import { getFileStreamsCache } from '../../file-streams-cache';
|
|
15
16
|
import { globalMediaEventEmitter } from '../../globalMediaEventEmitter';
|
|
16
17
|
import { RECENTS_COLLECTION } from '../../constants';
|
|
17
|
-
import isValidId from 'uuid-validate';
|
|
18
18
|
import { createFileDataloader } from '../../utils/createFileDataLoader';
|
|
19
19
|
import { getMediaTypeFromUploadableFile } from '../../utils/getMediaTypeFromUploadableFile';
|
|
20
20
|
import { overrideMediaTypeIfUnknown } from '../../utils/overrideMediaTypeIfUnknown';
|
|
@@ -277,7 +277,7 @@ export class FileFetcherImpl {
|
|
|
277
277
|
includeHashForDuplicateFiles,
|
|
278
278
|
forceRefresh
|
|
279
279
|
} = options;
|
|
280
|
-
if (!
|
|
280
|
+
if (!isValidUuid(id)) {
|
|
281
281
|
const subject = createMediaSubject();
|
|
282
282
|
const err = new FileFetcherError('invalidFileId', {
|
|
283
283
|
id,
|
|
@@ -11,6 +11,7 @@ import { map } from 'rxjs/operators/map';
|
|
|
11
11
|
import uuid from 'uuid/v4';
|
|
12
12
|
import { authToOwner } from '@atlaskit/media-core';
|
|
13
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
14
|
+
import { isValidUuid } from '@atlaskit/media-common/isValidUuid';
|
|
14
15
|
import { downloadUrl } from '@atlaskit/media-common/downloadUrl';
|
|
15
16
|
import { MediaStore as MediaApi } from '../media-store';
|
|
16
17
|
import { isErrorFileState, isFinalFileState, isProcessingFileState, mapMediaFileToFileState, mapMediaItemToFileState } from '../../models/file-state';
|
|
@@ -20,7 +21,6 @@ import { uploadFile } from '../../uploader';
|
|
|
20
21
|
import { getFileStreamsCache } from '../../file-streams-cache';
|
|
21
22
|
import { globalMediaEventEmitter } from '../../globalMediaEventEmitter';
|
|
22
23
|
import { RECENTS_COLLECTION } from '../../constants';
|
|
23
|
-
import isValidId from 'uuid-validate';
|
|
24
24
|
import { createFileDataloader } from '../../utils/createFileDataLoader';
|
|
25
25
|
import { getMediaTypeFromUploadableFile } from '../../utils/getMediaTypeFromUploadableFile';
|
|
26
26
|
import { overrideMediaTypeIfUnknown } from '../../utils/overrideMediaTypeIfUnknown';
|
|
@@ -448,7 +448,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
448
448
|
occurrenceKey = options.occurrenceKey,
|
|
449
449
|
includeHashForDuplicateFiles = options.includeHashForDuplicateFiles,
|
|
450
450
|
forceRefresh = options.forceRefresh;
|
|
451
|
-
if (!
|
|
451
|
+
if (!isValidUuid(id)) {
|
|
452
452
|
var subject = createMediaSubject();
|
|
453
453
|
var err = new FileFetcherError('invalidFileId', {
|
|
454
454
|
id: id,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AuthProvider } from '@atlaskit/media-core';
|
|
2
|
+
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
2
3
|
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
3
4
|
import { MediaStore as MediaApi, type MediaStoreCopyFileWithTokenParams, type TouchedFiles, type TouchFileDescriptor } from '../media-store';
|
|
4
5
|
import { type GetFileOptions } from '../../models/file-state';
|
|
@@ -7,7 +8,6 @@ import { type UploadableFile, type UploadableFileUpfrontIds } from '../../upload
|
|
|
7
8
|
import { type UploadController } from '../../upload-controller';
|
|
8
9
|
import { type MediaSubscribable } from '../../utils/mediaSubscribable';
|
|
9
10
|
import { type Dimensions } from '../../utils/getDimensionsFromBlob';
|
|
10
|
-
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
11
11
|
import { type FilePreview, type FileState, type MediaStore } from '@atlaskit/media-state';
|
|
12
12
|
import { type UploadArtifactParams } from '../media-store/types';
|
|
13
13
|
export type { FileFetcherErrorAttributes, FileFetcherErrorReason } from './error';
|
|
@@ -18,7 +18,7 @@ export declare class UploaderError extends BaseMediaClientError<UploaderErrorRea
|
|
|
18
18
|
constructor(reason: UploaderErrorReason, metadata: UploaderErrorMetadata);
|
|
19
19
|
/** Will be deprecated. Use the properties `reason` and `metadata` instead */
|
|
20
20
|
get attributes(): {
|
|
21
|
-
reason:
|
|
21
|
+
reason: 'fileSizeExceedsLimit';
|
|
22
22
|
id: string;
|
|
23
23
|
collectionName: string | undefined;
|
|
24
24
|
occurrenceKey: string | undefined;
|
|
@@ -4,7 +4,7 @@ export declare class PollingError extends BaseMediaClientError<PollingErrorReaso
|
|
|
4
4
|
constructor(reason: PollingErrorReason, metadata: PollingErrorMetadata);
|
|
5
5
|
/** Will be deprecated. Use the properties `reason` and `metadata` instead */
|
|
6
6
|
get attributes(): {
|
|
7
|
-
reason:
|
|
7
|
+
reason: 'pollingMaxAttemptsExceeded';
|
|
8
8
|
attempts: number;
|
|
9
9
|
};
|
|
10
10
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AuthProvider } from '@atlaskit/media-core';
|
|
2
|
+
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
2
3
|
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
3
4
|
import { MediaStore as MediaApi, type MediaStoreCopyFileWithTokenParams, type TouchedFiles, type TouchFileDescriptor } from '../media-store';
|
|
4
5
|
import { type GetFileOptions } from '../../models/file-state';
|
|
@@ -7,7 +8,6 @@ import { type UploadableFile, type UploadableFileUpfrontIds } from '../../upload
|
|
|
7
8
|
import { type UploadController } from '../../upload-controller';
|
|
8
9
|
import { type MediaSubscribable } from '../../utils/mediaSubscribable';
|
|
9
10
|
import { type Dimensions } from '../../utils/getDimensionsFromBlob';
|
|
10
|
-
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
11
11
|
import { type FilePreview, type FileState, type MediaStore } from '@atlaskit/media-state';
|
|
12
12
|
import { type UploadArtifactParams } from '../media-store/types';
|
|
13
13
|
export type { FileFetcherErrorAttributes, FileFetcherErrorReason } from './error';
|
|
@@ -18,7 +18,7 @@ export declare class UploaderError extends BaseMediaClientError<UploaderErrorRea
|
|
|
18
18
|
constructor(reason: UploaderErrorReason, metadata: UploaderErrorMetadata);
|
|
19
19
|
/** Will be deprecated. Use the properties `reason` and `metadata` instead */
|
|
20
20
|
get attributes(): {
|
|
21
|
-
reason:
|
|
21
|
+
reason: 'fileSizeExceedsLimit';
|
|
22
22
|
id: string;
|
|
23
23
|
collectionName: string | undefined;
|
|
24
24
|
occurrenceKey: string | undefined;
|
|
@@ -4,7 +4,7 @@ export declare class PollingError extends BaseMediaClientError<PollingErrorReaso
|
|
|
4
4
|
constructor(reason: PollingErrorReason, metadata: PollingErrorMetadata);
|
|
5
5
|
/** Will be deprecated. Use the properties `reason` and `metadata` instead */
|
|
6
6
|
get attributes(): {
|
|
7
|
-
reason:
|
|
7
|
+
reason: 'pollingMaxAttemptsExceeded';
|
|
8
8
|
attempts: number;
|
|
9
9
|
};
|
|
10
10
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "36.0
|
|
3
|
+
"version": "36.1.0",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@atlaskit/atlassian-context": "^0.8.0",
|
|
33
|
-
"@atlaskit/chunkinator": "^7.
|
|
34
|
-
"@atlaskit/media-common": "^13.
|
|
33
|
+
"@atlaskit/chunkinator": "^7.1.0",
|
|
34
|
+
"@atlaskit/media-common": "^13.2.0",
|
|
35
35
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
36
36
|
"@babel/runtime": "^7.0.0",
|
|
37
37
|
"dataloader": "^2.1.0",
|
|
@@ -42,23 +42,21 @@
|
|
|
42
42
|
"rusha": "^0.8.13",
|
|
43
43
|
"rxjs": "^5.5.0",
|
|
44
44
|
"uuid": "^3.1.0",
|
|
45
|
-
"uuid-validate": "^0.0.3",
|
|
46
45
|
"xstate": "4.20.0"
|
|
47
46
|
},
|
|
48
47
|
"peerDependencies": {
|
|
49
48
|
"@atlaskit/media-core": "^37.0.0",
|
|
50
|
-
"@atlaskit/media-state": "^2.
|
|
49
|
+
"@atlaskit/media-state": "^2.1.0"
|
|
51
50
|
},
|
|
52
51
|
"devDependencies": {
|
|
53
52
|
"@atlaskit/media-core": "^37.0.0",
|
|
54
|
-
"@atlaskit/media-state": "^2.
|
|
53
|
+
"@atlaskit/media-state": "^2.1.0",
|
|
55
54
|
"@atlaskit/ssr": "workspace:^",
|
|
56
|
-
"@atlaskit/tokens": "^
|
|
55
|
+
"@atlaskit/tokens": "^13.0.0",
|
|
57
56
|
"@atlassian/a11y-jest-testing": "^0.11.0",
|
|
58
57
|
"@atlassian/feature-flags-test-utils": "^1.0.0",
|
|
59
58
|
"@emotion/react": "^11.7.1",
|
|
60
59
|
"@types/deep-equal": "^1.0.1",
|
|
61
|
-
"@types/uuid-validate": "^0.0.2",
|
|
62
60
|
"fetch-mock": "^8.0.0",
|
|
63
61
|
"react": "^18.2.0",
|
|
64
62
|
"react-dom": "^18.2.0"
|