@atlaskit/media-client 20.2.1 → 21.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 +35 -0
- package/dist/cjs/client/file-fetcher/error.js +4 -4
- package/dist/cjs/client/file-fetcher/index.js +275 -287
- package/dist/cjs/client/media-client.js +48 -34
- package/dist/cjs/client/media-store/index.js +367 -314
- package/dist/cjs/client/media-store/resolveAuth.js +30 -32
- package/dist/cjs/client/stargate-client.js +14 -16
- package/dist/cjs/index.js +6 -13
- package/dist/cjs/models/media.js +8 -9
- package/dist/cjs/uploader/error.js +4 -4
- package/dist/cjs/uploader/index.js +88 -96
- package/dist/cjs/utils/convertBase64ToBlob.js +2 -2
- package/dist/cjs/utils/createFileDataLoader.js +67 -70
- package/dist/cjs/utils/getDimensionsFromBlob.js +23 -25
- package/dist/cjs/utils/getVideoDimensionsFromBlob.js +24 -26
- package/dist/cjs/utils/hashing/hasherCreator.js +32 -34
- package/dist/cjs/utils/mediaSubscribable/fromObservable.js +2 -2
- package/dist/cjs/utils/mobileUpload/error.js +4 -4
- package/dist/cjs/utils/mobileUpload/helpers.js +41 -43
- package/dist/cjs/utils/mobileUpload/stateMachine/index.js +14 -16
- package/dist/cjs/utils/parseJwt.js +52 -0
- package/dist/cjs/utils/polling/index.js +40 -42
- package/dist/cjs/utils/request/errors.js +9 -9
- package/dist/cjs/utils/request/helpers.js +143 -155
- package/dist/cjs/utils/request/index.js +24 -26
- package/dist/cjs/utils/shouldFetchRemoteFileStates.js +39 -41
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/file-fetcher/index.js +1 -3
- package/dist/es2019/client/media-client.js +3 -2
- package/dist/es2019/client/media-store/index.js +58 -15
- package/dist/es2019/index.js +2 -3
- package/dist/es2019/models/media.js +6 -4
- package/dist/es2019/uploader/index.js +3 -0
- package/dist/es2019/utils/mediaSubscribable/fromObservable.js +2 -2
- package/dist/es2019/utils/mediaSubscribable/toPromise.js +10 -12
- package/dist/es2019/utils/parseJwt.js +46 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/file-fetcher/error.js +4 -4
- package/dist/esm/client/file-fetcher/index.js +273 -286
- package/dist/esm/client/media-client.js +46 -32
- package/dist/esm/client/media-store/index.js +367 -314
- package/dist/esm/client/media-store/resolveAuth.js +30 -32
- package/dist/esm/client/stargate-client.js +14 -16
- package/dist/esm/index.js +2 -3
- package/dist/esm/models/media.js +6 -6
- package/dist/esm/uploader/error.js +4 -4
- package/dist/esm/uploader/index.js +89 -96
- package/dist/esm/utils/convertBase64ToBlob.js +2 -2
- package/dist/esm/utils/createFileDataLoader.js +65 -69
- package/dist/esm/utils/getDimensionsFromBlob.js +23 -25
- package/dist/esm/utils/getVideoDimensionsFromBlob.js +24 -26
- package/dist/esm/utils/hashing/hasherCreator.js +28 -30
- package/dist/esm/utils/mediaSubscribable/fromObservable.js +2 -2
- package/dist/esm/utils/mobileUpload/error.js +4 -4
- package/dist/esm/utils/mobileUpload/helpers.js +41 -43
- package/dist/esm/utils/mobileUpload/stateMachine/index.js +14 -16
- package/dist/esm/utils/parseJwt.js +46 -0
- package/dist/esm/utils/polling/index.js +40 -42
- package/dist/esm/utils/request/errors.js +9 -9
- package/dist/esm/utils/request/helpers.js +143 -155
- package/dist/esm/utils/request/index.js +24 -26
- package/dist/esm/utils/shouldFetchRemoteFileStates.js +39 -41
- package/dist/esm/version.json +1 -1
- package/dist/types/client/__mocks__/media-client.d.ts +0 -2
- package/dist/types/client/file-fetcher/index.d.ts +4 -4
- package/dist/types/client/media-client.d.ts +1 -2
- package/dist/types/client/media-store/index.d.ts +17 -13
- package/dist/types/index.d.ts +4 -6
- package/dist/types/models/file-state.d.ts +2 -2
- package/dist/types/models/media.d.ts +1 -21
- package/dist/types/utils/createFileDataLoader.d.ts +2 -2
- package/dist/types/utils/createMediaSubject.d.ts +2 -2
- package/dist/types/utils/detectEmptyFile.d.ts +2 -2
- package/dist/types/utils/mediaSubscribable/fromObservable.d.ts +3 -3
- package/dist/types/utils/mediaSubscribable/toPromise.d.ts +2 -2
- package/dist/types/utils/mediaSubscribable/types.d.ts +9 -8
- package/dist/types/utils/parseJwt.d.ts +1 -0
- package/package.json +2 -2
- package/report.api.md +77 -126
- package/dist/cjs/client/collection-fetcher.js +0 -98
- package/dist/cjs/models/media-subscribable.js +0 -5
- package/dist/cjs/utils/deprecatedEndpointError.js +0 -43
- package/dist/es2019/client/collection-fetcher.js +0 -38
- package/dist/es2019/models/media-subscribable.js +0 -1
- package/dist/es2019/utils/deprecatedEndpointError.js +0 -20
- package/dist/esm/client/collection-fetcher.js +0 -89
- package/dist/esm/models/media-subscribable.js +0 -1
- package/dist/esm/utils/deprecatedEndpointError.js +0 -34
- package/dist/types/client/collection-fetcher.d.ts +0 -42
- package/dist/types/models/media-subscribable.d.ts +0 -3
- package/dist/types/utils/deprecatedEndpointError.d.ts +0 -16
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.collectionCache = exports.CollectionFetcher = void 0;
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
|
-
var _fileStreamsCache = require("../file-streams-cache");
|
|
13
|
-
var _deprecatedEndpointError = require("../utils/deprecatedEndpointError");
|
|
14
|
-
var collectionCache = {};
|
|
15
|
-
exports.collectionCache = collectionCache;
|
|
16
|
-
var CollectionFetcher = /*#__PURE__*/function () {
|
|
17
|
-
function CollectionFetcher(mediaStore) {
|
|
18
|
-
(0, _classCallCheck2.default)(this, CollectionFetcher);
|
|
19
|
-
this.mediaStore = mediaStore;
|
|
20
|
-
}
|
|
21
|
-
(0, _createClass2.default)(CollectionFetcher, [{
|
|
22
|
-
key: "removeFromCache",
|
|
23
|
-
value: function removeFromCache(id, collectionName) {
|
|
24
|
-
var collectionCacheIndex = collectionCache[collectionName].items.findIndex(function (item) {
|
|
25
|
-
return item.id === id;
|
|
26
|
-
});
|
|
27
|
-
if (collectionCacheIndex === -1) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
(0, _fileStreamsCache.getFileStreamsCache)().remove(id);
|
|
31
|
-
collectionCache[collectionName].items.splice(collectionCacheIndex, 1);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
36
|
-
* This method is no longer working. Will be removed in the next release
|
|
37
|
-
*/
|
|
38
|
-
}, {
|
|
39
|
-
key: "getItems",
|
|
40
|
-
value: function getItems(collectionName, params, traceContext) {
|
|
41
|
-
throw new _deprecatedEndpointError.DeprecatedError('collection/:name/items');
|
|
42
|
-
}
|
|
43
|
-
}, {
|
|
44
|
-
key: "removeFile",
|
|
45
|
-
value: function () {
|
|
46
|
-
var _removeFile = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(id, collectionName, occurrenceKey, traceContext) {
|
|
47
|
-
var collection;
|
|
48
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
49
|
-
while (1) {
|
|
50
|
-
switch (_context.prev = _context.next) {
|
|
51
|
-
case 0:
|
|
52
|
-
_context.next = 2;
|
|
53
|
-
return this.mediaStore.removeCollectionFile(id, collectionName, occurrenceKey, traceContext);
|
|
54
|
-
case 2:
|
|
55
|
-
this.removeFromCache(id, collectionName);
|
|
56
|
-
collection = collectionCache[collectionName];
|
|
57
|
-
collection.subject.next(collection.items);
|
|
58
|
-
case 5:
|
|
59
|
-
case "end":
|
|
60
|
-
return _context.stop();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}, _callee, this);
|
|
64
|
-
}));
|
|
65
|
-
function removeFile(_x, _x2, _x3, _x4) {
|
|
66
|
-
return _removeFile.apply(this, arguments);
|
|
67
|
-
}
|
|
68
|
-
return removeFile;
|
|
69
|
-
}()
|
|
70
|
-
/**
|
|
71
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
72
|
-
* This method is no longer working. Will be removed in the next release
|
|
73
|
-
*/
|
|
74
|
-
}, {
|
|
75
|
-
key: "loadNextPage",
|
|
76
|
-
value: function () {
|
|
77
|
-
var _loadNextPage = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(collectionName, params, traceContext) {
|
|
78
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
79
|
-
while (1) {
|
|
80
|
-
switch (_context2.prev = _context2.next) {
|
|
81
|
-
case 0:
|
|
82
|
-
throw new _deprecatedEndpointError.DeprecatedError('collection/:name/items');
|
|
83
|
-
case 1:
|
|
84
|
-
case "end":
|
|
85
|
-
return _context2.stop();
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}, _callee2);
|
|
89
|
-
}));
|
|
90
|
-
function loadNextPage(_x5, _x6, _x7) {
|
|
91
|
-
return _loadNextPage.apply(this, arguments);
|
|
92
|
-
}
|
|
93
|
-
return loadNextPage;
|
|
94
|
-
}()
|
|
95
|
-
}]);
|
|
96
|
-
return CollectionFetcher;
|
|
97
|
-
}();
|
|
98
|
-
exports.CollectionFetcher = CollectionFetcher;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.DeprecatedError = void 0;
|
|
8
|
-
exports.isDeprecatedError = isDeprecatedError;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
|
-
var _errors = require("../models/errors");
|
|
15
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
16
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
17
|
-
var reason = 'deprecatedEndpoint';
|
|
18
|
-
var DeprecatedError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
19
|
-
(0, _inherits2.default)(DeprecatedError, _BaseMediaClientError);
|
|
20
|
-
var _super = _createSuper(DeprecatedError);
|
|
21
|
-
function DeprecatedError(endpointName) {
|
|
22
|
-
var _this;
|
|
23
|
-
(0, _classCallCheck2.default)(this, DeprecatedError);
|
|
24
|
-
_this = _super.call(this, reason);
|
|
25
|
-
_this.endpointName = endpointName;
|
|
26
|
-
return _this;
|
|
27
|
-
}
|
|
28
|
-
(0, _createClass2.default)(DeprecatedError, [{
|
|
29
|
-
key: "attributes",
|
|
30
|
-
get: function get() {
|
|
31
|
-
var endpointName = this.endpointName;
|
|
32
|
-
return {
|
|
33
|
-
reason: reason,
|
|
34
|
-
endpointName: endpointName
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}]);
|
|
38
|
-
return DeprecatedError;
|
|
39
|
-
}(_errors.BaseMediaClientError);
|
|
40
|
-
exports.DeprecatedError = DeprecatedError;
|
|
41
|
-
function isDeprecatedError(err) {
|
|
42
|
-
return err instanceof DeprecatedError;
|
|
43
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { getFileStreamsCache } from '../file-streams-cache';
|
|
2
|
-
import { DeprecatedError } from '../utils/deprecatedEndpointError';
|
|
3
|
-
export const collectionCache = {};
|
|
4
|
-
export class CollectionFetcher {
|
|
5
|
-
constructor(mediaStore) {
|
|
6
|
-
this.mediaStore = mediaStore;
|
|
7
|
-
}
|
|
8
|
-
removeFromCache(id, collectionName) {
|
|
9
|
-
const collectionCacheIndex = collectionCache[collectionName].items.findIndex(item => item.id === id);
|
|
10
|
-
if (collectionCacheIndex === -1) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
getFileStreamsCache().remove(id);
|
|
14
|
-
collectionCache[collectionName].items.splice(collectionCacheIndex, 1);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
19
|
-
* This method is no longer working. Will be removed in the next release
|
|
20
|
-
*/
|
|
21
|
-
getItems(collectionName, params, traceContext) {
|
|
22
|
-
throw new DeprecatedError('collection/:name/items');
|
|
23
|
-
}
|
|
24
|
-
async removeFile(id, collectionName, occurrenceKey, traceContext) {
|
|
25
|
-
await this.mediaStore.removeCollectionFile(id, collectionName, occurrenceKey, traceContext);
|
|
26
|
-
this.removeFromCache(id, collectionName);
|
|
27
|
-
const collection = collectionCache[collectionName];
|
|
28
|
-
collection.subject.next(collection.items);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
33
|
-
* This method is no longer working. Will be removed in the next release
|
|
34
|
-
*/
|
|
35
|
-
async loadNextPage(collectionName, params, traceContext) {
|
|
36
|
-
throw new DeprecatedError('collection/:name/items');
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { BaseMediaClientError } from '../models/errors';
|
|
2
|
-
const reason = 'deprecatedEndpoint';
|
|
3
|
-
export class DeprecatedError extends BaseMediaClientError {
|
|
4
|
-
constructor(endpointName) {
|
|
5
|
-
super(reason);
|
|
6
|
-
this.endpointName = endpointName;
|
|
7
|
-
}
|
|
8
|
-
get attributes() {
|
|
9
|
-
const {
|
|
10
|
-
endpointName
|
|
11
|
-
} = this;
|
|
12
|
-
return {
|
|
13
|
-
reason,
|
|
14
|
-
endpointName
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function isDeprecatedError(err) {
|
|
19
|
-
return err instanceof DeprecatedError;
|
|
20
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
|
-
import { getFileStreamsCache } from '../file-streams-cache';
|
|
6
|
-
import { DeprecatedError } from '../utils/deprecatedEndpointError';
|
|
7
|
-
export var collectionCache = {};
|
|
8
|
-
export var CollectionFetcher = /*#__PURE__*/function () {
|
|
9
|
-
function CollectionFetcher(mediaStore) {
|
|
10
|
-
_classCallCheck(this, CollectionFetcher);
|
|
11
|
-
this.mediaStore = mediaStore;
|
|
12
|
-
}
|
|
13
|
-
_createClass(CollectionFetcher, [{
|
|
14
|
-
key: "removeFromCache",
|
|
15
|
-
value: function removeFromCache(id, collectionName) {
|
|
16
|
-
var collectionCacheIndex = collectionCache[collectionName].items.findIndex(function (item) {
|
|
17
|
-
return item.id === id;
|
|
18
|
-
});
|
|
19
|
-
if (collectionCacheIndex === -1) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
getFileStreamsCache().remove(id);
|
|
23
|
-
collectionCache[collectionName].items.splice(collectionCacheIndex, 1);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
28
|
-
* This method is no longer working. Will be removed in the next release
|
|
29
|
-
*/
|
|
30
|
-
}, {
|
|
31
|
-
key: "getItems",
|
|
32
|
-
value: function getItems(collectionName, params, traceContext) {
|
|
33
|
-
throw new DeprecatedError('collection/:name/items');
|
|
34
|
-
}
|
|
35
|
-
}, {
|
|
36
|
-
key: "removeFile",
|
|
37
|
-
value: function () {
|
|
38
|
-
var _removeFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(id, collectionName, occurrenceKey, traceContext) {
|
|
39
|
-
var collection;
|
|
40
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
41
|
-
while (1) {
|
|
42
|
-
switch (_context.prev = _context.next) {
|
|
43
|
-
case 0:
|
|
44
|
-
_context.next = 2;
|
|
45
|
-
return this.mediaStore.removeCollectionFile(id, collectionName, occurrenceKey, traceContext);
|
|
46
|
-
case 2:
|
|
47
|
-
this.removeFromCache(id, collectionName);
|
|
48
|
-
collection = collectionCache[collectionName];
|
|
49
|
-
collection.subject.next(collection.items);
|
|
50
|
-
case 5:
|
|
51
|
-
case "end":
|
|
52
|
-
return _context.stop();
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}, _callee, this);
|
|
56
|
-
}));
|
|
57
|
-
function removeFile(_x, _x2, _x3, _x4) {
|
|
58
|
-
return _removeFile.apply(this, arguments);
|
|
59
|
-
}
|
|
60
|
-
return removeFile;
|
|
61
|
-
}()
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
64
|
-
* This method is no longer working. Will be removed in the next release
|
|
65
|
-
*/
|
|
66
|
-
}, {
|
|
67
|
-
key: "loadNextPage",
|
|
68
|
-
value: function () {
|
|
69
|
-
var _loadNextPage = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(collectionName, params, traceContext) {
|
|
70
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
71
|
-
while (1) {
|
|
72
|
-
switch (_context2.prev = _context2.next) {
|
|
73
|
-
case 0:
|
|
74
|
-
throw new DeprecatedError('collection/:name/items');
|
|
75
|
-
case 1:
|
|
76
|
-
case "end":
|
|
77
|
-
return _context2.stop();
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}, _callee2);
|
|
81
|
-
}));
|
|
82
|
-
function loadNextPage(_x5, _x6, _x7) {
|
|
83
|
-
return _loadNextPage.apply(this, arguments);
|
|
84
|
-
}
|
|
85
|
-
return loadNextPage;
|
|
86
|
-
}()
|
|
87
|
-
}]);
|
|
88
|
-
return CollectionFetcher;
|
|
89
|
-
}();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
4
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
8
|
-
import { BaseMediaClientError } from '../models/errors';
|
|
9
|
-
var reason = 'deprecatedEndpoint';
|
|
10
|
-
export var DeprecatedError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
11
|
-
_inherits(DeprecatedError, _BaseMediaClientError);
|
|
12
|
-
var _super = _createSuper(DeprecatedError);
|
|
13
|
-
function DeprecatedError(endpointName) {
|
|
14
|
-
var _this;
|
|
15
|
-
_classCallCheck(this, DeprecatedError);
|
|
16
|
-
_this = _super.call(this, reason);
|
|
17
|
-
_this.endpointName = endpointName;
|
|
18
|
-
return _this;
|
|
19
|
-
}
|
|
20
|
-
_createClass(DeprecatedError, [{
|
|
21
|
-
key: "attributes",
|
|
22
|
-
get: function get() {
|
|
23
|
-
var endpointName = this.endpointName;
|
|
24
|
-
return {
|
|
25
|
-
reason: reason,
|
|
26
|
-
endpointName: endpointName
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}]);
|
|
30
|
-
return DeprecatedError;
|
|
31
|
-
}(BaseMediaClientError);
|
|
32
|
-
export function isDeprecatedError(err) {
|
|
33
|
-
return err instanceof DeprecatedError;
|
|
34
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
2
|
-
import { FileDetails, FileItem } from '../models/item';
|
|
3
|
-
import { MediaCollectionItem } from '../models/media';
|
|
4
|
-
import { MediaStore, MediaStoreGetCollectionItemsParams } from './media-store';
|
|
5
|
-
import { MediaSubscribable } from '../utils/mediaSubscribable';
|
|
6
|
-
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
7
|
-
export interface MediaCollectionFileItemDetails extends FileDetails {
|
|
8
|
-
occurrenceKey: string;
|
|
9
|
-
}
|
|
10
|
-
export interface MediaCollectionFileItem extends FileItem {
|
|
11
|
-
details: MediaCollectionFileItemDetails;
|
|
12
|
-
}
|
|
13
|
-
export interface MediaCollection {
|
|
14
|
-
id: string;
|
|
15
|
-
items: Array<MediaCollectionItem>;
|
|
16
|
-
}
|
|
17
|
-
export interface CollectionCacheEntry {
|
|
18
|
-
items: MediaCollectionItem[];
|
|
19
|
-
subject: ReplaySubject<MediaCollectionItem[]>;
|
|
20
|
-
isLoadingNextPage: boolean;
|
|
21
|
-
nextInclusiveStartKey?: string;
|
|
22
|
-
}
|
|
23
|
-
export declare type CollectionCache = {
|
|
24
|
-
[collectionName: string]: CollectionCacheEntry;
|
|
25
|
-
};
|
|
26
|
-
export declare const collectionCache: CollectionCache;
|
|
27
|
-
export declare class CollectionFetcher {
|
|
28
|
-
readonly mediaStore: MediaStore;
|
|
29
|
-
constructor(mediaStore: MediaStore);
|
|
30
|
-
private removeFromCache;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
33
|
-
* This method is no longer working. Will be removed in the next release
|
|
34
|
-
*/
|
|
35
|
-
getItems(collectionName: string, params?: MediaStoreGetCollectionItemsParams, traceContext?: MediaTraceContext): MediaSubscribable<MediaCollectionItem[]>;
|
|
36
|
-
removeFile(id: string, collectionName: string, occurrenceKey?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-170 Internal documentation for deprecation (no external access)}
|
|
39
|
-
* This method is no longer working. Will be removed in the next release
|
|
40
|
-
*/
|
|
41
|
-
loadNextPage(collectionName: string, params?: MediaStoreGetCollectionItemsParams, traceContext?: MediaTraceContext): Promise<void>;
|
|
42
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseMediaClientError } from '../models/errors';
|
|
2
|
-
declare const reason: "deprecatedEndpoint";
|
|
3
|
-
export declare type DeprecatedErrorAttributes = {
|
|
4
|
-
readonly reason: typeof reason;
|
|
5
|
-
readonly endpointName: string;
|
|
6
|
-
};
|
|
7
|
-
export declare class DeprecatedError extends BaseMediaClientError<DeprecatedErrorAttributes> {
|
|
8
|
-
readonly endpointName: string;
|
|
9
|
-
constructor(endpointName: string);
|
|
10
|
-
get attributes(): {
|
|
11
|
-
reason: "deprecatedEndpoint";
|
|
12
|
-
endpointName: string;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
export declare function isDeprecatedError(err: Error): err is DeprecatedError;
|
|
16
|
-
export {};
|