@atlaskit/media-client 38.1.1 → 38.1.3
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 +12 -0
- package/dist/cjs/file-streams-cache.js +3 -50
- package/dist/cjs/media-core.js +2 -2
- package/dist/cjs/streams-cache.js +54 -0
- package/dist/es2019/file-streams-cache.js +1 -29
- package/dist/es2019/media-core.js +8 -1
- package/dist/es2019/streams-cache.js +29 -0
- package/dist/esm/file-streams-cache.js +1 -47
- package/dist/esm/media-core.js +8 -1
- package/dist/esm/streams-cache.js +47 -0
- package/dist/types/file-streams-cache.d.ts +1 -13
- package/dist/types/media-core.d.ts +8 -2
- package/dist/types/streams-cache.d.ts +13 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,64 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports.getFileStreamsCache =
|
|
8
|
-
var
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var StreamsCache = exports.StreamsCache = /*#__PURE__*/function () {
|
|
11
|
-
function StreamsCache(streams) {
|
|
12
|
-
(0, _classCallCheck2.default)(this, StreamsCache);
|
|
13
|
-
this.streams = streams;
|
|
14
|
-
}
|
|
15
|
-
return (0, _createClass2.default)(StreamsCache, [{
|
|
16
|
-
key: "has",
|
|
17
|
-
value: function has(id) {
|
|
18
|
-
return !!this.streams.find(id);
|
|
19
|
-
}
|
|
20
|
-
}, {
|
|
21
|
-
key: "set",
|
|
22
|
-
value: function set(id, stream) {
|
|
23
|
-
this.streams.set(id, stream);
|
|
24
|
-
}
|
|
25
|
-
}, {
|
|
26
|
-
key: "get",
|
|
27
|
-
value: function get(id) {
|
|
28
|
-
return this.streams.get(id);
|
|
29
|
-
}
|
|
30
|
-
}, {
|
|
31
|
-
key: "getOrInsert",
|
|
32
|
-
value: function getOrInsert(id, callback) {
|
|
33
|
-
if (!this.has(id)) {
|
|
34
|
-
this.set(id, callback());
|
|
35
|
-
}
|
|
36
|
-
return this.get(id);
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
key: "removeAll",
|
|
40
|
-
value: function removeAll() {
|
|
41
|
-
this.streams.clear();
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
key: "remove",
|
|
45
|
-
value: function remove(id) {
|
|
46
|
-
this.streams.delete(id);
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
key: "size",
|
|
50
|
-
get: function get() {
|
|
51
|
-
return this.streams.size;
|
|
52
|
-
}
|
|
53
|
-
}]);
|
|
54
|
-
}();
|
|
6
|
+
exports.getFileStreamsCache = void 0;
|
|
7
|
+
var _streamsCache = require("./streams-cache");
|
|
55
8
|
var streamCache;
|
|
56
9
|
var getFileStreamsCache = exports.getFileStreamsCache = function getFileStreamsCache() {
|
|
57
10
|
if (!streamCache) {
|
|
58
11
|
// TODO: we can move this into a static import like
|
|
59
12
|
// import {mediaState} from '@atlaskit/media-core'
|
|
60
13
|
var mediaState = require('@atlaskit/media-core/cache').mediaState;
|
|
61
|
-
streamCache = new StreamsCache(mediaState.streams);
|
|
14
|
+
streamCache = new _streamsCache.StreamsCache(mediaState.streams);
|
|
62
15
|
}
|
|
63
16
|
return streamCache;
|
|
64
17
|
};
|
package/dist/cjs/media-core.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "ChunkHashAlgorithm", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _chunkHashAlgorithm.ChunkHashAlgorithm;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
var
|
|
12
|
+
var _chunkHashAlgorithm = require("@atlaskit/media-core/chunk-hash-algorithm");
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.StreamsCache = void 0;
|
|
8
|
+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
+
var StreamsCache = exports.StreamsCache = /*#__PURE__*/function () {
|
|
11
|
+
function StreamsCache(streams) {
|
|
12
|
+
(0, _classCallCheck2.default)(this, StreamsCache);
|
|
13
|
+
this.streams = streams;
|
|
14
|
+
}
|
|
15
|
+
return (0, _createClass2.default)(StreamsCache, [{
|
|
16
|
+
key: "has",
|
|
17
|
+
value: function has(id) {
|
|
18
|
+
return !!this.streams.find(id);
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
key: "set",
|
|
22
|
+
value: function set(id, stream) {
|
|
23
|
+
this.streams.set(id, stream);
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
key: "get",
|
|
27
|
+
value: function get(id) {
|
|
28
|
+
return this.streams.get(id);
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
key: "getOrInsert",
|
|
32
|
+
value: function getOrInsert(id, callback) {
|
|
33
|
+
if (!this.has(id)) {
|
|
34
|
+
this.set(id, callback());
|
|
35
|
+
}
|
|
36
|
+
return this.get(id);
|
|
37
|
+
}
|
|
38
|
+
}, {
|
|
39
|
+
key: "removeAll",
|
|
40
|
+
value: function removeAll() {
|
|
41
|
+
this.streams.clear();
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
key: "remove",
|
|
45
|
+
value: function remove(id) {
|
|
46
|
+
this.streams.delete(id);
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
key: "size",
|
|
50
|
+
get: function get() {
|
|
51
|
+
return this.streams.size;
|
|
52
|
+
}
|
|
53
|
+
}]);
|
|
54
|
+
}();
|
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
constructor(streams) {
|
|
3
|
-
this.streams = streams;
|
|
4
|
-
}
|
|
5
|
-
has(id) {
|
|
6
|
-
return !!this.streams.find(id);
|
|
7
|
-
}
|
|
8
|
-
set(id, stream) {
|
|
9
|
-
this.streams.set(id, stream);
|
|
10
|
-
}
|
|
11
|
-
get(id) {
|
|
12
|
-
return this.streams.get(id);
|
|
13
|
-
}
|
|
14
|
-
getOrInsert(id, callback) {
|
|
15
|
-
if (!this.has(id)) {
|
|
16
|
-
this.set(id, callback());
|
|
17
|
-
}
|
|
18
|
-
return this.get(id);
|
|
19
|
-
}
|
|
20
|
-
removeAll() {
|
|
21
|
-
this.streams.clear();
|
|
22
|
-
}
|
|
23
|
-
remove(id) {
|
|
24
|
-
this.streams.delete(id);
|
|
25
|
-
}
|
|
26
|
-
get size() {
|
|
27
|
-
return this.streams.size;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
1
|
+
import { StreamsCache } from './streams-cache';
|
|
30
2
|
let streamCache;
|
|
31
3
|
export const getFileStreamsCache = () => {
|
|
32
4
|
if (!streamCache) {
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm'` instead.
|
|
4
|
+
*/
|
|
5
|
+
export { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `import type { MediaClientConfig } from '@atlaskit/media-core/auth'` instead.
|
|
8
|
+
*/
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export class StreamsCache {
|
|
2
|
+
constructor(streams) {
|
|
3
|
+
this.streams = streams;
|
|
4
|
+
}
|
|
5
|
+
has(id) {
|
|
6
|
+
return !!this.streams.find(id);
|
|
7
|
+
}
|
|
8
|
+
set(id, stream) {
|
|
9
|
+
this.streams.set(id, stream);
|
|
10
|
+
}
|
|
11
|
+
get(id) {
|
|
12
|
+
return this.streams.get(id);
|
|
13
|
+
}
|
|
14
|
+
getOrInsert(id, callback) {
|
|
15
|
+
if (!this.has(id)) {
|
|
16
|
+
this.set(id, callback());
|
|
17
|
+
}
|
|
18
|
+
return this.get(id);
|
|
19
|
+
}
|
|
20
|
+
removeAll() {
|
|
21
|
+
this.streams.clear();
|
|
22
|
+
}
|
|
23
|
+
remove(id) {
|
|
24
|
+
this.streams.delete(id);
|
|
25
|
+
}
|
|
26
|
+
get size() {
|
|
27
|
+
return this.streams.size;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -1,50 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
export var StreamsCache = /*#__PURE__*/function () {
|
|
4
|
-
function StreamsCache(streams) {
|
|
5
|
-
_classCallCheck(this, StreamsCache);
|
|
6
|
-
this.streams = streams;
|
|
7
|
-
}
|
|
8
|
-
return _createClass(StreamsCache, [{
|
|
9
|
-
key: "has",
|
|
10
|
-
value: function has(id) {
|
|
11
|
-
return !!this.streams.find(id);
|
|
12
|
-
}
|
|
13
|
-
}, {
|
|
14
|
-
key: "set",
|
|
15
|
-
value: function set(id, stream) {
|
|
16
|
-
this.streams.set(id, stream);
|
|
17
|
-
}
|
|
18
|
-
}, {
|
|
19
|
-
key: "get",
|
|
20
|
-
value: function get(id) {
|
|
21
|
-
return this.streams.get(id);
|
|
22
|
-
}
|
|
23
|
-
}, {
|
|
24
|
-
key: "getOrInsert",
|
|
25
|
-
value: function getOrInsert(id, callback) {
|
|
26
|
-
if (!this.has(id)) {
|
|
27
|
-
this.set(id, callback());
|
|
28
|
-
}
|
|
29
|
-
return this.get(id);
|
|
30
|
-
}
|
|
31
|
-
}, {
|
|
32
|
-
key: "removeAll",
|
|
33
|
-
value: function removeAll() {
|
|
34
|
-
this.streams.clear();
|
|
35
|
-
}
|
|
36
|
-
}, {
|
|
37
|
-
key: "remove",
|
|
38
|
-
value: function remove(id) {
|
|
39
|
-
this.streams.delete(id);
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
key: "size",
|
|
43
|
-
get: function get() {
|
|
44
|
-
return this.streams.size;
|
|
45
|
-
}
|
|
46
|
-
}]);
|
|
47
|
-
}();
|
|
1
|
+
import { StreamsCache } from './streams-cache';
|
|
48
2
|
var streamCache;
|
|
49
3
|
export var getFileStreamsCache = function getFileStreamsCache() {
|
|
50
4
|
if (!streamCache) {
|
package/dist/esm/media-core.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @repo/internal/deprecations/deprecation-ticket-required -- VOLTC-139 tracks removal of these deprecated re-export shims. */
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use `import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm'` instead.
|
|
4
|
+
*/
|
|
5
|
+
export { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use `import type { MediaClientConfig } from '@atlaskit/media-core/auth'` instead.
|
|
8
|
+
*/
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
+
export var StreamsCache = /*#__PURE__*/function () {
|
|
4
|
+
function StreamsCache(streams) {
|
|
5
|
+
_classCallCheck(this, StreamsCache);
|
|
6
|
+
this.streams = streams;
|
|
7
|
+
}
|
|
8
|
+
return _createClass(StreamsCache, [{
|
|
9
|
+
key: "has",
|
|
10
|
+
value: function has(id) {
|
|
11
|
+
return !!this.streams.find(id);
|
|
12
|
+
}
|
|
13
|
+
}, {
|
|
14
|
+
key: "set",
|
|
15
|
+
value: function set(id, stream) {
|
|
16
|
+
this.streams.set(id, stream);
|
|
17
|
+
}
|
|
18
|
+
}, {
|
|
19
|
+
key: "get",
|
|
20
|
+
value: function get(id) {
|
|
21
|
+
return this.streams.get(id);
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
key: "getOrInsert",
|
|
25
|
+
value: function getOrInsert(id, callback) {
|
|
26
|
+
if (!this.has(id)) {
|
|
27
|
+
this.set(id, callback());
|
|
28
|
+
}
|
|
29
|
+
return this.get(id);
|
|
30
|
+
}
|
|
31
|
+
}, {
|
|
32
|
+
key: "removeAll",
|
|
33
|
+
value: function removeAll() {
|
|
34
|
+
this.streams.clear();
|
|
35
|
+
}
|
|
36
|
+
}, {
|
|
37
|
+
key: "remove",
|
|
38
|
+
value: function remove(id) {
|
|
39
|
+
this.streams.delete(id);
|
|
40
|
+
}
|
|
41
|
+
}, {
|
|
42
|
+
key: "size",
|
|
43
|
+
get: function get() {
|
|
44
|
+
return this.streams.size;
|
|
45
|
+
}
|
|
46
|
+
}]);
|
|
47
|
+
}();
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
import { type LRUMap } from 'lru_map';
|
|
2
|
-
import { type ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
1
|
import type { FileState } from '@atlaskit/media-state/file-state';
|
|
4
|
-
|
|
5
|
-
private readonly streams;
|
|
6
|
-
constructor(streams: LRUMap<string, ReplaySubject<T>>);
|
|
7
|
-
has(id: string): boolean;
|
|
8
|
-
set(id: string, stream: ReplaySubject<T>): void;
|
|
9
|
-
get(id: string): ReplaySubject<T> | undefined;
|
|
10
|
-
getOrInsert(id: string, callback: () => ReplaySubject<T>): ReplaySubject<T>;
|
|
11
|
-
removeAll(): void;
|
|
12
|
-
remove(id: string): void;
|
|
13
|
-
get size(): number;
|
|
14
|
-
}
|
|
2
|
+
import { StreamsCache } from './streams-cache';
|
|
15
3
|
export declare const getFileStreamsCache: () => StreamsCache<FileState>;
|
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Use `import { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm'` instead.
|
|
3
|
+
*/
|
|
4
|
+
export { ChunkHashAlgorithm } from '@atlaskit/media-core/chunk-hash-algorithm';
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Use `import type { MediaClientConfig } from '@atlaskit/media-core/auth'` instead.
|
|
7
|
+
*/
|
|
8
|
+
export type { MediaClientConfig } from '@atlaskit/media-core/auth';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type LRUMap } from 'lru_map';
|
|
2
|
+
import { type ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
|
+
export declare class StreamsCache<T> {
|
|
4
|
+
private readonly streams;
|
|
5
|
+
constructor(streams: LRUMap<string, ReplaySubject<T>>);
|
|
6
|
+
has(id: string): boolean;
|
|
7
|
+
set(id: string, stream: ReplaySubject<T>): void;
|
|
8
|
+
get(id: string): ReplaySubject<T> | undefined;
|
|
9
|
+
getOrInsert(id: string, callback: () => ReplaySubject<T>): ReplaySubject<T>;
|
|
10
|
+
removeAll(): void;
|
|
11
|
+
remove(id: string): void;
|
|
12
|
+
get size(): number;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "38.1.
|
|
3
|
+
"version": "38.1.3",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@atlaskit/atlassian-context": "^1.1.0",
|
|
25
|
-
"@atlaskit/chunkinator": "^8.
|
|
25
|
+
"@atlaskit/chunkinator": "^8.2.0",
|
|
26
26
|
"@atlaskit/media-common": "^14.6.0",
|
|
27
27
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
28
28
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
29
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
29
|
+
"@atlaskit/tmp-editor-statsig": "^185.0.0",
|
|
30
30
|
"@babel/runtime": "^7.0.0",
|
|
31
31
|
"dataloader": "^2.1.0",
|
|
32
32
|
"deep-equal": "^1.0.1",
|