@atlaskit/media-client 35.7.1 → 35.8.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 +12 -0
- package/dist/cjs/client/file-fetcher/index.js +3 -3
- package/dist/cjs/client/media-client.js +43 -24
- package/dist/cjs/client/media-store/MediaStore.js +189 -148
- package/dist/cjs/models/file-state.js +4 -2
- package/dist/cjs/utils/url.js +3 -1
- package/dist/es2019/client/file-fetcher/index.js +2 -2
- package/dist/es2019/client/media-client.js +3 -0
- package/dist/es2019/client/media-store/MediaStore.js +21 -2
- package/dist/es2019/models/file-state.js +4 -2
- package/dist/es2019/utils/url.js +3 -1
- package/dist/esm/client/file-fetcher/index.js +3 -3
- package/dist/esm/client/media-client.js +43 -24
- package/dist/esm/client/media-store/MediaStore.js +189 -148
- package/dist/esm/models/file-state.js +4 -2
- package/dist/esm/utils/url.js +3 -1
- package/dist/types/client/file-fetcher/index.d.ts +1 -0
- package/dist/types/client/media-client.d.ts +1 -0
- package/dist/types/client/media-store/MediaStore.d.ts +2 -1
- package/dist/types/models/item.d.ts +2 -0
- package/dist/types/models/media.d.ts +3 -1
- package/dist/types/utils/url.d.ts +1 -0
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +1 -0
- package/dist/types-ts4.5/client/media-client.d.ts +1 -0
- package/dist/types-ts4.5/client/media-store/MediaStore.d.ts +2 -1
- package/dist/types-ts4.5/models/item.d.ts +2 -0
- package/dist/types-ts4.5/models/media.d.ts +3 -1
- package/dist/types-ts4.5/utils/url.d.ts +1 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 35.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`c90ccf0c600ee`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c90ccf0c600ee) -
|
|
8
|
+
Enable cross product/cross client copy and paste of Media files by including clientId during Copy
|
|
9
|
+
operations.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 35.7.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -76,8 +76,8 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
76
76
|
var err = new _errors.CommonMediaClientError(error);
|
|
77
77
|
return (0, _errors.fromCommonMediaClientError)(id, occurrenceKey, err);
|
|
78
78
|
} else {
|
|
79
|
-
var
|
|
80
|
-
return (0, _errors.fromCommonMediaClientError)(id, occurrenceKey,
|
|
79
|
+
var _err = new _errors.CommonMediaClientError((error === null || error === void 0 ? void 0 : error.reason) || 'unknown', error === null || error === void 0 ? void 0 : error.metadata, error === null || error === void 0 ? void 0 : error.innerError);
|
|
80
|
+
return (0, _errors.fromCommonMediaClientError)(id, occurrenceKey, _err);
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
(0, _defineProperty2.default)(this, "setFileState", function (id, fileState) {
|
|
@@ -884,7 +884,7 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
884
884
|
sourceCollection: source.collection,
|
|
885
885
|
collection: destination.collection,
|
|
886
886
|
replaceFileId: destination.replaceFileId
|
|
887
|
-
}, traceContext);
|
|
887
|
+
}, traceContext, source.clientId);
|
|
888
888
|
case 2:
|
|
889
889
|
res = _context12.sent;
|
|
890
890
|
data = res.data;
|
|
@@ -64,23 +64,42 @@ var MediaClient = exports.MediaClient = /*#__PURE__*/function () {
|
|
|
64
64
|
return this.mediaStore.getFileImageURLSync(id, params);
|
|
65
65
|
}
|
|
66
66
|
}, {
|
|
67
|
-
key: "
|
|
67
|
+
key: "getClientId",
|
|
68
68
|
value: function () {
|
|
69
|
-
var
|
|
69
|
+
var _getClientId = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(collectionName) {
|
|
70
70
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
71
71
|
while (1) switch (_context.prev = _context.next) {
|
|
72
72
|
case 0:
|
|
73
|
-
_context.
|
|
73
|
+
return _context.abrupt("return", this.mediaStore.getClientId(collectionName));
|
|
74
|
+
case 1:
|
|
75
|
+
case "end":
|
|
76
|
+
return _context.stop();
|
|
77
|
+
}
|
|
78
|
+
}, _callee, this);
|
|
79
|
+
}));
|
|
80
|
+
function getClientId(_x) {
|
|
81
|
+
return _getClientId.apply(this, arguments);
|
|
82
|
+
}
|
|
83
|
+
return getClientId;
|
|
84
|
+
}()
|
|
85
|
+
}, {
|
|
86
|
+
key: "getImageMetadata",
|
|
87
|
+
value: function () {
|
|
88
|
+
var _getImageMetadata = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(id, params) {
|
|
89
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
90
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
91
|
+
case 0:
|
|
92
|
+
_context2.next = 2;
|
|
74
93
|
return this.mediaStore.getImageMetadata(id, params);
|
|
75
94
|
case 2:
|
|
76
|
-
return
|
|
95
|
+
return _context2.abrupt("return", _context2.sent.metadata);
|
|
77
96
|
case 3:
|
|
78
97
|
case "end":
|
|
79
|
-
return
|
|
98
|
+
return _context2.stop();
|
|
80
99
|
}
|
|
81
|
-
},
|
|
100
|
+
}, _callee2, this);
|
|
82
101
|
}));
|
|
83
|
-
function getImageMetadata(
|
|
102
|
+
function getImageMetadata(_x2, _x3) {
|
|
84
103
|
return _getImageMetadata.apply(this, arguments);
|
|
85
104
|
}
|
|
86
105
|
return getImageMetadata;
|
|
@@ -88,30 +107,30 @@ var MediaClient = exports.MediaClient = /*#__PURE__*/function () {
|
|
|
88
107
|
}, {
|
|
89
108
|
key: "mobileUploadPromise",
|
|
90
109
|
value: function () {
|
|
91
|
-
var _mobileUploadPromise = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
110
|
+
var _mobileUploadPromise = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
92
111
|
var module;
|
|
93
|
-
return _regenerator.default.wrap(function
|
|
94
|
-
while (1) switch (
|
|
112
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
113
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
95
114
|
case 0:
|
|
96
115
|
if (!this.mobileUpload) {
|
|
97
|
-
|
|
116
|
+
_context3.next = 2;
|
|
98
117
|
break;
|
|
99
118
|
}
|
|
100
|
-
return
|
|
119
|
+
return _context3.abrupt("return", this.mobileUpload);
|
|
101
120
|
case 2:
|
|
102
|
-
|
|
121
|
+
_context3.next = 4;
|
|
103
122
|
return Promise.resolve().then(function () {
|
|
104
123
|
return _interopRequireWildcard(require( /* webpackChunkName: "@atlaskit-internal_media-client-mobile-upload" */'./mobile-upload'));
|
|
105
124
|
});
|
|
106
125
|
case 4:
|
|
107
|
-
module =
|
|
126
|
+
module = _context3.sent;
|
|
108
127
|
this.mobileUpload = new module.MobileUploadImpl(this.mediaStore, this.store);
|
|
109
|
-
return
|
|
128
|
+
return _context3.abrupt("return", this.mobileUpload);
|
|
110
129
|
case 7:
|
|
111
130
|
case "end":
|
|
112
|
-
return
|
|
131
|
+
return _context3.stop();
|
|
113
132
|
}
|
|
114
|
-
},
|
|
133
|
+
}, _callee3, this);
|
|
115
134
|
}));
|
|
116
135
|
function mobileUploadPromise() {
|
|
117
136
|
return _mobileUploadPromise.apply(this, arguments);
|
|
@@ -121,19 +140,19 @@ var MediaClient = exports.MediaClient = /*#__PURE__*/function () {
|
|
|
121
140
|
}, {
|
|
122
141
|
key: "removeFileFromCollection",
|
|
123
142
|
value: function () {
|
|
124
|
-
var _removeFileFromCollection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
125
|
-
return _regenerator.default.wrap(function
|
|
126
|
-
while (1) switch (
|
|
143
|
+
var _removeFileFromCollection = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(id, collectionName, occurrenceKey, traceContext) {
|
|
144
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
145
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
127
146
|
case 0:
|
|
128
|
-
|
|
147
|
+
_context4.next = 2;
|
|
129
148
|
return this.mediaStore.removeCollectionFile(id, collectionName, occurrenceKey, traceContext);
|
|
130
149
|
case 2:
|
|
131
150
|
case "end":
|
|
132
|
-
return
|
|
151
|
+
return _context4.stop();
|
|
133
152
|
}
|
|
134
|
-
},
|
|
153
|
+
}, _callee4, this);
|
|
135
154
|
}));
|
|
136
|
-
function removeFileFromCollection(
|
|
155
|
+
function removeFileFromCollection(_x4, _x5, _x6, _x7) {
|
|
137
156
|
return _removeFileFromCollection.apply(this, arguments);
|
|
138
157
|
}
|
|
139
158
|
return removeFileFromCollection;
|