@atlaskit/media-client 26.2.0 → 26.2.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 +12 -0
- package/constants/package.json +1 -1
- package/dist/cjs/client/file-fetcher/error.js +1 -1
- package/dist/cjs/client/file-fetcher/index.js +2 -2
- package/dist/cjs/client/media-client.js +2 -2
- package/dist/cjs/client/media-store/MediaStore.js +9 -5
- package/dist/cjs/client/media-store/error.js +1 -1
- package/dist/cjs/models/errors/index.js +1 -1
- package/dist/cjs/models/errors/types.js +1 -5
- package/dist/cjs/uploader/error.js +1 -1
- package/dist/cjs/utils/hashing/hasher.js +1 -5
- package/dist/cjs/utils/hashing/hasherCreator.js +2 -2
- package/dist/cjs/utils/hashing/simpleHasher.js +2 -2
- package/dist/cjs/utils/mobileUpload/error.js +1 -1
- package/dist/cjs/utils/polling/errors.js +1 -1
- package/dist/cjs/utils/polling/types.js +1 -5
- package/dist/cjs/utils/request/errors.js +1 -1
- package/dist/cjs/utils/request/helpers.js +0 -1
- package/dist/es2019/client/file-fetcher/index.js +2 -2
- package/dist/es2019/client/media-store/MediaStore.js +2 -2
- package/dist/es2019/models/errors/types.js +0 -1
- package/dist/es2019/models/media.js +1 -0
- package/dist/es2019/test-helpers/MockedMediaApi/helpers.js +1 -0
- package/dist/es2019/utils/hashing/hasher.js +0 -1
- package/dist/es2019/utils/polling/types.js +0 -1
- package/dist/es2019/utils/request/helpers.js +0 -1
- package/dist/esm/client/file-fetcher/error.js +1 -1
- package/dist/esm/client/file-fetcher/index.js +2 -2
- package/dist/esm/client/media-store/MediaStore.js +9 -5
- package/dist/esm/client/media-store/error.js +1 -1
- package/dist/esm/models/errors/index.js +1 -1
- package/dist/esm/models/errors/types.js +0 -1
- package/dist/esm/models/media.js +1 -0
- package/dist/esm/test-helpers/MockedMediaApi/helpers.js +1 -0
- package/dist/esm/uploader/error.js +1 -1
- package/dist/esm/utils/hashing/hasher.js +0 -1
- package/dist/esm/utils/mobileUpload/error.js +1 -1
- package/dist/esm/utils/polling/errors.js +1 -1
- package/dist/esm/utils/polling/types.js +0 -1
- package/dist/esm/utils/request/errors.js +1 -1
- package/dist/esm/utils/request/helpers.js +0 -1
- package/dist/types/client/file-fetcher/index.d.ts +2 -2
- package/dist/types/client/media-store/MediaStore.d.ts +1 -1
- package/dist/types/globalMediaEventEmitter.d.ts +2 -2
- package/dist/types/test-helpers/MockedMediaApi/helpers.d.ts +1 -1
- package/dist/types/test-helpers/collectionNames.d.ts +1 -1
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +2 -2
- package/dist/types-ts4.5/client/media-store/MediaStore.d.ts +1 -1
- package/dist/types-ts4.5/globalMediaEventEmitter.d.ts +2 -2
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/helpers.d.ts +1 -1
- package/dist/types-ts4.5/test-helpers/collectionNames.d.ts +1 -1
- package/package.json +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 26.2.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116) [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) - Upgrade Typescript from `4.9.5` to `5.4.2`
|
|
8
|
+
|
|
9
|
+
## 26.2.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#77668](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/77668) [`c8a08df51a9f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c8a08df51a9f) - Add password protected pdf support for media viewer
|
|
14
|
+
|
|
3
15
|
## 26.2.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/constants/package.json
CHANGED
|
@@ -13,7 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _errors = require("../../models/errors");
|
|
15
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() {
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
17
|
var FileFetcherError = exports.FileFetcherError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
18
18
|
(0, _inherits2.default)(FileFetcherError, _BaseMediaClientError);
|
|
19
19
|
var _super = _createSuper(FileFetcherError);
|
|
@@ -226,8 +226,8 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
226
226
|
}
|
|
227
227
|
}, {
|
|
228
228
|
key: "getFileBinaryURL",
|
|
229
|
-
value: function getFileBinaryURL(id, collectionName) {
|
|
230
|
-
return this.mediaApi.getFileBinaryURL(id, collectionName);
|
|
229
|
+
value: function getFileBinaryURL(id, collectionName, maxAge) {
|
|
230
|
+
return this.mediaApi.getFileBinaryURL(id, collectionName, maxAge);
|
|
231
231
|
}
|
|
232
232
|
}, {
|
|
233
233
|
key: "touchFiles",
|
|
@@ -16,8 +16,8 @@ var _mediaStore = require("./media-store");
|
|
|
16
16
|
var _fileFetcher = require("./file-fetcher");
|
|
17
17
|
var _stargateClient = require("./stargate-client");
|
|
18
18
|
var _mediaState = require("@atlaskit/media-state");
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
21
|
var MediaClient = exports.MediaClient = /*#__PURE__*/function () {
|
|
22
22
|
// mobile upload is lazily loaded
|
|
23
23
|
|
|
@@ -296,26 +296,30 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
296
296
|
key: "getFileBinaryURL",
|
|
297
297
|
value: function () {
|
|
298
298
|
var _getFileBinaryURL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(id, collectionName) {
|
|
299
|
-
var
|
|
299
|
+
var maxAge,
|
|
300
|
+
auth,
|
|
301
|
+
options,
|
|
302
|
+
_args5 = arguments;
|
|
300
303
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
301
304
|
while (1) switch (_context5.prev = _context5.next) {
|
|
302
305
|
case 0:
|
|
303
|
-
|
|
306
|
+
maxAge = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : _constants.FILE_CACHE_MAX_AGE;
|
|
307
|
+
_context5.next = 3;
|
|
304
308
|
return this.resolveAuth({
|
|
305
309
|
collectionName: collectionName
|
|
306
310
|
});
|
|
307
|
-
case
|
|
311
|
+
case 3:
|
|
308
312
|
auth = _context5.sent;
|
|
309
313
|
options = {
|
|
310
314
|
params: {
|
|
311
315
|
dl: true,
|
|
312
316
|
collection: collectionName,
|
|
313
|
-
'max-age':
|
|
317
|
+
'max-age': maxAge
|
|
314
318
|
},
|
|
315
319
|
auth: auth
|
|
316
320
|
};
|
|
317
321
|
return _context5.abrupt("return", (0, _helpers.createUrl)("".concat(auth.baseUrl, "/file/").concat(id, "/binary"), options));
|
|
318
|
-
case
|
|
322
|
+
case 6:
|
|
319
323
|
case "end":
|
|
320
324
|
return _context5.stop();
|
|
321
325
|
}
|
|
@@ -13,7 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _errors = require("../../models/errors");
|
|
15
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() {
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
17
|
var MediaStoreError = exports.MediaStoreError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
18
18
|
(0, _inherits2.default)(MediaStoreError, _BaseMediaClientError);
|
|
19
19
|
var _super = _createSuper(MediaStoreError);
|
|
@@ -26,7 +26,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
|
|
|
26
26
|
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
|
|
27
27
|
var _helpers = require("./helpers");
|
|
28
28
|
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); }; }
|
|
29
|
-
function _isNativeReflectConstruct() {
|
|
29
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
30
30
|
/**
|
|
31
31
|
* Base class for media errors
|
|
32
32
|
*/
|
|
@@ -13,7 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _errors = require("../models/errors");
|
|
15
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() {
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
17
|
var UploaderError = exports.UploaderError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
18
18
|
(0, _inherits2.default)(UploaderError, _BaseMediaClientError);
|
|
19
19
|
var _super = _createSuper(UploaderError);
|
|
@@ -9,8 +9,8 @@ exports.destroyHasher = exports.createHasher = void 0;
|
|
|
9
9
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
11
11
|
var _mediaCore = require("@atlaskit/media-core");
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
var hasher = null;
|
|
15
15
|
var sha256Hasher = null;
|
|
16
16
|
var destroyHasher = exports.destroyHasher = function destroyHasher() {
|
|
@@ -9,8 +9,8 @@ exports.SimpleHasher = void 0;
|
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
10
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
11
|
var Rusha = _interopRequireWildcard(require("rusha"));
|
|
12
|
-
function _getRequireWildcardCache(
|
|
13
|
-
function _interopRequireWildcard(
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
14
|
var SimpleHasher = exports.SimpleHasher = /*#__PURE__*/function () {
|
|
15
15
|
function SimpleHasher() {
|
|
16
16
|
(0, _classCallCheck2.default)(this, SimpleHasher);
|
|
@@ -13,7 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _errors = require("../../models/errors");
|
|
15
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() {
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
17
|
var MobileUploadError = exports.MobileUploadError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
18
18
|
(0, _inherits2.default)(MobileUploadError, _BaseMediaClientError);
|
|
19
19
|
var _super = _createSuper(MobileUploadError);
|
|
@@ -13,7 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _errors = require("../../models/errors");
|
|
15
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() {
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
17
|
var PollingError = exports.PollingError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
18
18
|
(0, _inherits2.default)(PollingError, _BaseMediaClientError);
|
|
19
19
|
var _super = _createSuper(PollingError);
|
|
@@ -13,7 +13,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
13
13
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
14
|
var _errors = require("../../models/errors");
|
|
15
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() {
|
|
16
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
17
17
|
var RequestError = exports.RequestError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
18
18
|
(0, _inherits2.default)(RequestError, _BaseMediaClientError);
|
|
19
19
|
var _super = _createSuper(RequestError);
|
|
@@ -159,7 +159,6 @@ var DEFAULT_RETRY_OPTIONS = exports.DEFAULT_RETRY_OPTIONS = {
|
|
|
159
159
|
// Current test delay is 60s, so retries should finish before if a promise takes < 1s
|
|
160
160
|
factor: 2 // Good for polling, which is out main use case
|
|
161
161
|
};
|
|
162
|
-
|
|
163
162
|
function cloneRequestError(error, extraMetadata) {
|
|
164
163
|
var reason = error.reason,
|
|
165
164
|
metadata = error.metadata,
|
|
@@ -172,8 +172,8 @@ export class FileFetcherImpl {
|
|
|
172
172
|
getArtifactURL(artifacts, artifactName, collectionName) {
|
|
173
173
|
return this.mediaApi.getArtifactURL(artifacts, artifactName, collectionName);
|
|
174
174
|
}
|
|
175
|
-
getFileBinaryURL(id, collectionName) {
|
|
176
|
-
return this.mediaApi.getFileBinaryURL(id, collectionName);
|
|
175
|
+
getFileBinaryURL(id, collectionName, maxAge) {
|
|
176
|
+
return this.mediaApi.getFileBinaryURL(id, collectionName, maxAge);
|
|
177
177
|
}
|
|
178
178
|
touchFiles(descriptors, collection, traceContext) {
|
|
179
179
|
return this.mediaApi.touchFiles({
|
|
@@ -186,7 +186,7 @@ export class MediaStore {
|
|
|
186
186
|
};
|
|
187
187
|
return createUrl(`${auth.baseUrl}/file/${id}/image`, options);
|
|
188
188
|
}
|
|
189
|
-
async getFileBinaryURL(id, collectionName) {
|
|
189
|
+
async getFileBinaryURL(id, collectionName, maxAge = FILE_CACHE_MAX_AGE) {
|
|
190
190
|
const auth = await this.resolveAuth({
|
|
191
191
|
collectionName
|
|
192
192
|
});
|
|
@@ -194,7 +194,7 @@ export class MediaStore {
|
|
|
194
194
|
params: {
|
|
195
195
|
dl: true,
|
|
196
196
|
collection: collectionName,
|
|
197
|
-
'max-age':
|
|
197
|
+
'max-age': maxAge
|
|
198
198
|
},
|
|
199
199
|
auth
|
|
200
200
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Warning! You can't add new media file processing status!
|
|
2
2
|
// See packages/media/media-core/src/__tests__/cache-backward-compatibility.spec.ts
|
|
3
|
+
|
|
3
4
|
export const isPreviewableType = type => {
|
|
4
5
|
const defaultPreviewableTypes = ['audio', 'video', 'image', 'doc'];
|
|
5
6
|
return defaultPreviewableTypes.indexOf(type) > -1;
|
|
@@ -2,6 +2,7 @@ import uuid from 'uuid/v4';
|
|
|
2
2
|
// --------------------------------------------------------
|
|
3
3
|
// Factory Utils
|
|
4
4
|
// --------------------------------------------------------
|
|
5
|
+
|
|
5
6
|
export const normaliseInput = input => !input ? [] : input instanceof Array ? input : [input];
|
|
6
7
|
|
|
7
8
|
// --------------------------------------------------------
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -102,7 +102,6 @@ export const DEFAULT_RETRY_OPTIONS = {
|
|
|
102
102
|
// Current test delay is 60s, so retries should finish before if a promise takes < 1s
|
|
103
103
|
factor: 2 // Good for polling, which is out main use case
|
|
104
104
|
};
|
|
105
|
-
|
|
106
105
|
export function cloneRequestError(error, extraMetadata) {
|
|
107
106
|
const {
|
|
108
107
|
reason,
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
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() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseMediaClientError } from '../../models/errors';
|
|
9
9
|
export var FileFetcherError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
10
10
|
_inherits(FileFetcherError, _BaseMediaClientError);
|
|
@@ -209,8 +209,8 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
209
209
|
}
|
|
210
210
|
}, {
|
|
211
211
|
key: "getFileBinaryURL",
|
|
212
|
-
value: function getFileBinaryURL(id, collectionName) {
|
|
213
|
-
return this.mediaApi.getFileBinaryURL(id, collectionName);
|
|
212
|
+
value: function getFileBinaryURL(id, collectionName, maxAge) {
|
|
213
|
+
return this.mediaApi.getFileBinaryURL(id, collectionName, maxAge);
|
|
214
214
|
}
|
|
215
215
|
}, {
|
|
216
216
|
key: "touchFiles",
|
|
@@ -289,26 +289,30 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
289
289
|
key: "getFileBinaryURL",
|
|
290
290
|
value: function () {
|
|
291
291
|
var _getFileBinaryURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id, collectionName) {
|
|
292
|
-
var
|
|
292
|
+
var maxAge,
|
|
293
|
+
auth,
|
|
294
|
+
options,
|
|
295
|
+
_args5 = arguments;
|
|
293
296
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
294
297
|
while (1) switch (_context5.prev = _context5.next) {
|
|
295
298
|
case 0:
|
|
296
|
-
|
|
299
|
+
maxAge = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : FILE_CACHE_MAX_AGE;
|
|
300
|
+
_context5.next = 3;
|
|
297
301
|
return this.resolveAuth({
|
|
298
302
|
collectionName: collectionName
|
|
299
303
|
});
|
|
300
|
-
case
|
|
304
|
+
case 3:
|
|
301
305
|
auth = _context5.sent;
|
|
302
306
|
options = {
|
|
303
307
|
params: {
|
|
304
308
|
dl: true,
|
|
305
309
|
collection: collectionName,
|
|
306
|
-
'max-age':
|
|
310
|
+
'max-age': maxAge
|
|
307
311
|
},
|
|
308
312
|
auth: auth
|
|
309
313
|
};
|
|
310
314
|
return _context5.abrupt("return", createUrl("".concat(auth.baseUrl, "/file/").concat(id, "/binary"), options));
|
|
311
|
-
case
|
|
315
|
+
case 6:
|
|
312
316
|
case "end":
|
|
313
317
|
return _context5.stop();
|
|
314
318
|
}
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
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() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseMediaClientError } from '../../models/errors';
|
|
9
9
|
export var MediaStoreError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
10
10
|
_inherits(MediaStoreError, _BaseMediaClientError);
|
|
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
|
|
8
8
|
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); }; }
|
|
9
|
-
function _isNativeReflectConstruct() {
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
export { isMediaClientError, getMediaClientErrorReason } from './helpers';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/esm/models/media.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Warning! You can't add new media file processing status!
|
|
2
2
|
// See packages/media/media-core/src/__tests__/cache-backward-compatibility.spec.ts
|
|
3
|
+
|
|
3
4
|
export var isPreviewableType = function isPreviewableType(type) {
|
|
4
5
|
var defaultPreviewableTypes = ['audio', 'video', 'image', 'doc'];
|
|
5
6
|
return defaultPreviewableTypes.indexOf(type) > -1;
|
|
@@ -6,6 +6,7 @@ import uuid from 'uuid/v4';
|
|
|
6
6
|
// --------------------------------------------------------
|
|
7
7
|
// Factory Utils
|
|
8
8
|
// --------------------------------------------------------
|
|
9
|
+
|
|
9
10
|
export var normaliseInput = function normaliseInput(input) {
|
|
10
11
|
return !input ? [] : input instanceof Array ? input : [input];
|
|
11
12
|
};
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
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() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseMediaClientError } from '../models/errors';
|
|
9
9
|
export var UploaderError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
10
10
|
_inherits(UploaderError, _BaseMediaClientError);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
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() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseMediaClientError } from '../../models/errors';
|
|
9
9
|
export var MobileUploadError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
10
10
|
_inherits(MobileUploadError, _BaseMediaClientError);
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
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() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseMediaClientError } from '../../models/errors';
|
|
9
9
|
export var PollingError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
10
10
|
_inherits(PollingError, _BaseMediaClientError);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
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() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseMediaClientError } from '../../models/errors';
|
|
9
9
|
export var RequestError = /*#__PURE__*/function (_BaseMediaClientError) {
|
|
10
10
|
_inherits(RequestError, _BaseMediaClientError);
|
|
@@ -137,7 +137,6 @@ export var DEFAULT_RETRY_OPTIONS = {
|
|
|
137
137
|
// Current test delay is 60s, so retries should finish before if a promise takes < 1s
|
|
138
138
|
factor: 2 // Good for polling, which is out main use case
|
|
139
139
|
};
|
|
140
|
-
|
|
141
140
|
export function cloneRequestError(error, extraMetadata) {
|
|
142
141
|
var reason = error.reason,
|
|
143
142
|
metadata = error.metadata,
|
|
@@ -38,7 +38,7 @@ export interface FileFetcher {
|
|
|
38
38
|
downloadBinary(id: string, name?: string, collectionName?: string): Promise<void>;
|
|
39
39
|
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
40
40
|
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
|
|
41
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
41
|
+
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
42
42
|
}
|
|
43
43
|
export declare class FileFetcherImpl implements FileFetcher {
|
|
44
44
|
private readonly mediaApi;
|
|
@@ -50,7 +50,7 @@ export declare class FileFetcherImpl implements FileFetcher {
|
|
|
50
50
|
getFileState(id: string, options?: GetFileOptions): MediaSubscribable;
|
|
51
51
|
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
52
52
|
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
53
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
53
|
+
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
54
54
|
private createDownloadFileStream;
|
|
55
55
|
touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
|
|
56
56
|
private generateUploadableFileUpfrontIds;
|
|
@@ -18,7 +18,7 @@ export declare class MediaStore implements MediaApi {
|
|
|
18
18
|
getFileImageURL(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
|
|
19
19
|
getFileImageURLSync(id: string, params?: MediaStoreGetFileImageParams): string;
|
|
20
20
|
private createFileImageURL;
|
|
21
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
21
|
+
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
22
22
|
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
23
23
|
getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext): Promise<Blob>;
|
|
24
24
|
getItems(ids: string[], collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<ItemsPayload>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UploadEventPayloadMap, EventPayloadListener } from './client/events';
|
|
2
2
|
export declare const globalMediaEventEmitter: {
|
|
3
|
-
on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E
|
|
4
|
-
off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1
|
|
3
|
+
on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
|
|
4
|
+
off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1>): void;
|
|
5
5
|
emit<E_2 extends keyof UploadEventPayloadMap>(event: E_2, payload: UploadEventPayloadMap[E_2]): boolean | undefined;
|
|
6
6
|
};
|
|
@@ -2,7 +2,7 @@ import { UploadingFileState, ErrorFileState, FileState } from '@atlaskit/media-s
|
|
|
2
2
|
import { MediaFile } from '../../models/media';
|
|
3
3
|
import { ResponseFileItem } from '../../client/media-store/types';
|
|
4
4
|
import type { FileIdentifier } from '../../identifier';
|
|
5
|
-
export declare const normaliseInput: <T>(input?: T | T[]
|
|
5
|
+
export declare const normaliseInput: <T>(input?: T | T[]) => T[];
|
|
6
6
|
export declare const getMediaFile: (fileItem: ResponseFileItem) => MediaFile;
|
|
7
7
|
export declare const createEmptyFileItem: (id: string, collection?: string) => ResponseFileItem;
|
|
8
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const defaultCollectionName = "MediaServicesSample";
|
|
2
2
|
export declare const onlyAnimatedGifsCollectionName = "only-animated-gifs";
|
|
3
|
-
export declare const fileCollectionName
|
|
3
|
+
export declare const fileCollectionName = "MediaServicesSampleFiles";
|
|
4
4
|
export declare const defaultMediaPickerCollectionName = "mediapicker-test";
|
|
5
5
|
export declare const collectionNames: string[];
|
|
@@ -38,7 +38,7 @@ export interface FileFetcher {
|
|
|
38
38
|
downloadBinary(id: string, name?: string, collectionName?: string): Promise<void>;
|
|
39
39
|
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
40
40
|
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
|
|
41
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
41
|
+
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
42
42
|
}
|
|
43
43
|
export declare class FileFetcherImpl implements FileFetcher {
|
|
44
44
|
private readonly mediaApi;
|
|
@@ -50,7 +50,7 @@ export declare class FileFetcherImpl implements FileFetcher {
|
|
|
50
50
|
getFileState(id: string, options?: GetFileOptions): MediaSubscribable;
|
|
51
51
|
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
52
52
|
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
53
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
53
|
+
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
54
54
|
private createDownloadFileStream;
|
|
55
55
|
touchFiles(descriptors: TouchFileDescriptor[], collection?: string, traceContext?: MediaTraceContext): Promise<TouchedFiles>;
|
|
56
56
|
private generateUploadableFileUpfrontIds;
|
|
@@ -18,7 +18,7 @@ export declare class MediaStore implements MediaApi {
|
|
|
18
18
|
getFileImageURL(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
|
|
19
19
|
getFileImageURLSync(id: string, params?: MediaStoreGetFileImageParams): string;
|
|
20
20
|
private createFileImageURL;
|
|
21
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
21
|
+
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
22
22
|
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
23
23
|
getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext): Promise<Blob>;
|
|
24
24
|
getItems(ids: string[], collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<ItemsPayload>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UploadEventPayloadMap, EventPayloadListener } from './client/events';
|
|
2
2
|
export declare const globalMediaEventEmitter: {
|
|
3
|
-
on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E
|
|
4
|
-
off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1
|
|
3
|
+
on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
|
|
4
|
+
off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1>): void;
|
|
5
5
|
emit<E_2 extends keyof UploadEventPayloadMap>(event: E_2, payload: UploadEventPayloadMap[E_2]): boolean | undefined;
|
|
6
6
|
};
|
|
@@ -2,7 +2,7 @@ import { UploadingFileState, ErrorFileState, FileState } from '@atlaskit/media-s
|
|
|
2
2
|
import { MediaFile } from '../../models/media';
|
|
3
3
|
import { ResponseFileItem } from '../../client/media-store/types';
|
|
4
4
|
import type { FileIdentifier } from '../../identifier';
|
|
5
|
-
export declare const normaliseInput: <T>(input?: T | T[]
|
|
5
|
+
export declare const normaliseInput: <T>(input?: T | T[]) => T[];
|
|
6
6
|
export declare const getMediaFile: (fileItem: ResponseFileItem) => MediaFile;
|
|
7
7
|
export declare const createEmptyFileItem: (id: string, collection?: string) => ResponseFileItem;
|
|
8
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const defaultCollectionName = "MediaServicesSample";
|
|
2
2
|
export declare const onlyAnimatedGifsCollectionName = "only-animated-gifs";
|
|
3
|
-
export declare const fileCollectionName
|
|
3
|
+
export declare const fileCollectionName = "MediaServicesSampleFiles";
|
|
4
4
|
export declare const defaultMediaPickerCollectionName = "mediapicker-test";
|
|
5
5
|
export declare const collectionNames: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "26.2.
|
|
3
|
+
"version": "26.2.2",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@atlaskit/chunkinator": "^6.0.0",
|
|
40
|
-
"@atlaskit/media-common": "^11.
|
|
40
|
+
"@atlaskit/media-common": "^11.1.0",
|
|
41
41
|
"@babel/runtime": "^7.0.0",
|
|
42
42
|
"dataloader": "^2.0.0",
|
|
43
43
|
"deep-equal": "^1.0.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@atlaskit/media-core": "^34.2.0",
|
|
60
60
|
"@atlaskit/media-state": "^1.0.0",
|
|
61
61
|
"@atlaskit/ssr": "*",
|
|
62
|
-
"@atlaskit/tokens": "^1.
|
|
62
|
+
"@atlaskit/tokens": "^1.42.0",
|
|
63
63
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
64
64
|
"@emotion/react": "^11.7.1",
|
|
65
65
|
"@types/deep-equal": "^1.0.1",
|
|
@@ -67,9 +67,8 @@
|
|
|
67
67
|
"fetch-mock": "^8.0.0",
|
|
68
68
|
"react": "^16.8.0",
|
|
69
69
|
"react-dom": "^16.8.0",
|
|
70
|
-
"typescript": "~4.
|
|
70
|
+
"typescript": "~5.4.2"
|
|
71
71
|
},
|
|
72
|
-
"resolutions": {},
|
|
73
72
|
"techstack": {
|
|
74
73
|
"@atlassian/frontend": {
|
|
75
74
|
"circular-dependencies": [
|
|
@@ -84,4 +83,4 @@
|
|
|
84
83
|
}
|
|
85
84
|
},
|
|
86
85
|
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
87
|
-
}
|
|
86
|
+
}
|