@atlaskit/media-common 11.3.0 → 11.3.2

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 CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/media-common
2
2
 
3
+ ## 11.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 11.3.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#122556](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122556)
14
+ [`c307772eb58c7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c307772eb58c7) -
15
+ Fixes sanitisation of analytics payload
16
+
3
17
  ## 11.3.0
4
18
 
5
19
  ### Minor Changes
@@ -10,7 +10,7 @@ var _uuidValidate = _interopRequireDefault(require("uuid-validate"));
10
10
  var _immer = require("immer");
11
11
  var sanitiseFileId = function sanitiseFileId(draft) {
12
12
  var fileId = draft.attributes.fileAttributes.fileId;
13
- draft.attributes.fileAttributes.fileId = (0, _uuidValidate.default)(fileId) ? fileId : 'INVALID_FILE_ID';
13
+ draft.attributes.fileAttributes.fileId = fileId === 'external-image' || (0, _uuidValidate.default)(fileId) ? fileId : 'INVALID_FILE_ID';
14
14
  };
15
15
  var hasFileAttributesWithFileId = function hasFileAttributesWithFileId(payload) {
16
16
  return 'attributes' in payload && !!payload.attributes && (0, _typeof2.default)(payload.attributes) === 'object' && 'fileAttributes' in payload.attributes && !!payload.attributes.fileAttributes && (0, _typeof2.default)(payload.attributes.fileAttributes) === 'object' && 'fileId' in payload.attributes.fileAttributes && typeof payload.attributes.fileAttributes.fileId === 'string';
@@ -18,7 +18,7 @@ var isAudioMimeTypeSupportedByBrowser = exports.isAudioMimeTypeSupportedByBrowse
18
18
  };
19
19
 
20
20
  /**
21
- * For backward compatilbity, we assume MP4/MOV is natively supported.
21
+ * For backward compatibility, we assume MP4/MOV is natively supported.
22
22
  * TODO: Improve detection of supported video formats by the browser.
23
23
  *
24
24
  * See related tickets:
@@ -4,7 +4,7 @@ const sanitiseFileId = draft => {
4
4
  const {
5
5
  fileId
6
6
  } = draft.attributes.fileAttributes;
7
- draft.attributes.fileAttributes.fileId = isValidId(fileId) ? fileId : 'INVALID_FILE_ID';
7
+ draft.attributes.fileAttributes.fileId = fileId === 'external-image' || isValidId(fileId) ? fileId : 'INVALID_FILE_ID';
8
8
  };
9
9
  const hasFileAttributesWithFileId = payload => 'attributes' in payload && !!payload.attributes && typeof payload.attributes === 'object' && 'fileAttributes' in payload.attributes && !!payload.attributes.fileAttributes && typeof payload.attributes.fileAttributes === 'object' && 'fileId' in payload.attributes.fileAttributes && typeof payload.attributes.fileAttributes.fileId === 'string';
10
10
  export const sanitiseAnalyticsPayload = payload => hasFileAttributesWithFileId(payload) ? produce(payload, sanitiseFileId) : payload;
@@ -6,7 +6,7 @@ export const isDocumentMimeTypeSupportedByBrowser = mimeType => mimeType.toLower
6
6
  export const isAudioMimeTypeSupportedByBrowser = mimeType => ['audio/aac', 'audio/flac', 'audio/mp4', 'audio/mpeg', 'audio/ogg', 'audio/x-ogg', 'audio/wav', 'audio/x-wav'].indexOf(mimeType.toLowerCase()) > -1;
7
7
 
8
8
  /**
9
- * For backward compatilbity, we assume MP4/MOV is natively supported.
9
+ * For backward compatibility, we assume MP4/MOV is natively supported.
10
10
  * TODO: Improve detection of supported video formats by the browser.
11
11
  *
12
12
  * See related tickets:
@@ -3,7 +3,7 @@ import isValidId from 'uuid-validate';
3
3
  import { produce } from 'immer';
4
4
  var sanitiseFileId = function sanitiseFileId(draft) {
5
5
  var fileId = draft.attributes.fileAttributes.fileId;
6
- draft.attributes.fileAttributes.fileId = isValidId(fileId) ? fileId : 'INVALID_FILE_ID';
6
+ draft.attributes.fileAttributes.fileId = fileId === 'external-image' || isValidId(fileId) ? fileId : 'INVALID_FILE_ID';
7
7
  };
8
8
  var hasFileAttributesWithFileId = function hasFileAttributesWithFileId(payload) {
9
9
  return 'attributes' in payload && !!payload.attributes && _typeof(payload.attributes) === 'object' && 'fileAttributes' in payload.attributes && !!payload.attributes.fileAttributes && _typeof(payload.attributes.fileAttributes) === 'object' && 'fileId' in payload.attributes.fileAttributes && typeof payload.attributes.fileAttributes.fileId === 'string';
@@ -12,7 +12,7 @@ export var isAudioMimeTypeSupportedByBrowser = function isAudioMimeTypeSupported
12
12
  };
13
13
 
14
14
  /**
15
- * For backward compatilbity, we assume MP4/MOV is natively supported.
15
+ * For backward compatibility, we assume MP4/MOV is natively supported.
16
16
  * TODO: Improve detection of supported video formats by the browser.
17
17
  *
18
18
  * See related tickets:
@@ -2,7 +2,7 @@ export declare const isImageMimeTypeSupportedByBrowser: (mimeType: string) => bo
2
2
  export declare const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
3
3
  export declare const isAudioMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
4
4
  /**
5
- * For backward compatilbity, we assume MP4/MOV is natively supported.
5
+ * For backward compatibility, we assume MP4/MOV is natively supported.
6
6
  * TODO: Improve detection of supported video formats by the browser.
7
7
  *
8
8
  * See related tickets:
@@ -1,7 +1,7 @@
1
1
  /// <reference types="jest" />
2
2
  export declare const asMock: (fn: Function) => jest.Mock;
3
3
  export declare const asMockFunction: <T extends (...args: any[]) => any>(fn: T) => jest.MockedFunction<T>;
4
- export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any>;
4
+ export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any, any>;
5
5
  export declare const asMockFunctionReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.MockedFunction<T>;
6
6
  export declare const asMockFunctionResolvedValue: <T extends (...args: any[]) => any>(fn: T, resolveValue: jest.ResolvedValue<ReturnType<T>>) => jest.MockedFunction<T>;
7
7
  export declare const expectToEqual: <T>(actual: T, expected: T) => void;
@@ -2,7 +2,7 @@ export declare const isImageMimeTypeSupportedByBrowser: (mimeType: string) => bo
2
2
  export declare const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
3
3
  export declare const isAudioMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
4
4
  /**
5
- * For backward compatilbity, we assume MP4/MOV is natively supported.
5
+ * For backward compatibility, we assume MP4/MOV is natively supported.
6
6
  * TODO: Improve detection of supported video formats by the browser.
7
7
  *
8
8
  * See related tickets:
@@ -1,7 +1,7 @@
1
1
  /// <reference types="jest" />
2
2
  export declare const asMock: (fn: Function) => jest.Mock;
3
3
  export declare const asMockFunction: <T extends (...args: any[]) => any>(fn: T) => jest.MockedFunction<T>;
4
- export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any>;
4
+ export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock<any, any, any>;
5
5
  export declare const asMockFunctionReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.MockedFunction<T>;
6
6
  export declare const asMockFunctionResolvedValue: <T extends (...args: any[]) => any>(fn: T, resolveValue: jest.ResolvedValue<ReturnType<T>>) => jest.MockedFunction<T>;
7
7
  export declare const expectToEqual: <T>(actual: T, expected: T) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-common",
3
- "version": "11.3.0",
3
+ "version": "11.3.2",
4
4
  "description": "Includes common utilities used by other media packages",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "dependencies": {
44
44
  "@atlaskit/analytics-gas-types": "^5.1.0",
45
45
  "@atlaskit/analytics-namespaced-context": "^6.10.0",
46
- "@atlaskit/analytics-next": "^9.3.0",
46
+ "@atlaskit/analytics-next": "^10.0.0",
47
47
  "@atlaskit/section-message": "^6.5.0",
48
48
  "@babel/runtime": "^7.0.0",
49
49
  "immer": "^9.0.12",