@atlaskit/media-client 26.0.0 → 26.1.1
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 +13 -0
- package/dist/cjs/test-helpers/MockedMediaApi/MockedMediaApi.js +15 -16
- package/dist/cjs/test-helpers/MockedMediaApi/helpers.js +2 -2
- package/dist/es2019/test-helpers/MockedMediaApi/MockedMediaApi.js +15 -16
- package/dist/es2019/test-helpers/MockedMediaApi/helpers.js +2 -2
- package/dist/esm/test-helpers/MockedMediaApi/MockedMediaApi.js +15 -16
- package/dist/esm/test-helpers/MockedMediaApi/helpers.js +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/test-helpers/MockedMediaApi/MockedMediaApi.d.ts +5 -5
- package/dist/types/test-helpers/MockedMediaApi/helpers.d.ts +1 -1
- package/dist/types/test-helpers/MockedMediaApi/index.d.ts +1 -1
- package/dist/types/test-helpers/index.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +1 -1
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/MockedMediaApi.d.ts +5 -5
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/helpers.d.ts +1 -1
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/index.d.ts +1 -1
- package/dist/types-ts4.5/test-helpers/index.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 26.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#65817](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/65817) [`3be0ec786219`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3be0ec786219) - Updated mocked Media Api mothod
|
|
8
|
+
|
|
9
|
+
## 26.1.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#60253](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60253) [`2d535695b891`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2d535695b891) - Exposed MediaApi type
|
|
14
|
+
- [#60253](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60253) [`662b6d273ec0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/662b6d273ec0) - Breaking change: Updated interface for Test Helper "createMockedMediaApi". This is not a production-code breaking change
|
|
15
|
+
|
|
3
16
|
## 26.0.0
|
|
4
17
|
|
|
5
18
|
### Major Changes
|
|
@@ -9,7 +9,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
|
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _helpers = require("./helpers");
|
|
11
11
|
var getMediaApi = function getMediaApi(_ref) {
|
|
12
|
-
var
|
|
12
|
+
var getItem = _ref.getItem;
|
|
13
13
|
return {
|
|
14
14
|
// --------------------------------------------------------
|
|
15
15
|
// UPLOAD ENDPOINTS - None is supported
|
|
@@ -120,7 +120,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
120
120
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
121
121
|
while (1) switch (_context6.prev = _context6.next) {
|
|
122
122
|
case 0:
|
|
123
|
-
fileItem =
|
|
123
|
+
fileItem = getItem(fileId);
|
|
124
124
|
if (fileItem) {
|
|
125
125
|
_context6.next = 3;
|
|
126
126
|
break;
|
|
@@ -148,7 +148,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
148
148
|
while (1) switch (_context7.prev = _context7.next) {
|
|
149
149
|
case 0:
|
|
150
150
|
items = ids.map(function (id) {
|
|
151
|
-
return
|
|
151
|
+
return getItem(id);
|
|
152
152
|
}).filter(function (fileState) {
|
|
153
153
|
return !!fileState;
|
|
154
154
|
});
|
|
@@ -208,9 +208,8 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
208
208
|
}
|
|
209
209
|
return getFileImageURL;
|
|
210
210
|
}(),
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
throw new Error('500 - MockedMediaApi.getFileImageURLSync: method not implemented');
|
|
211
|
+
getFileImageURLSync: function getFileImageURLSync(id) {
|
|
212
|
+
return "image-url-sync-".concat(id);
|
|
214
213
|
},
|
|
215
214
|
getFileBinaryURL: function () {
|
|
216
215
|
var _getFileBinaryURL = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10(id) {
|
|
@@ -218,7 +217,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
218
217
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
219
218
|
while (1) switch (_context10.prev = _context10.next) {
|
|
220
219
|
case 0:
|
|
221
|
-
fileItem =
|
|
220
|
+
fileItem = getItem(id);
|
|
222
221
|
if (fileItem) {
|
|
223
222
|
_context10.next = 3;
|
|
224
223
|
break;
|
|
@@ -278,7 +277,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
278
277
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
279
278
|
while (1) switch (_context12.prev = _context12.next) {
|
|
280
279
|
case 0:
|
|
281
|
-
fileItem =
|
|
280
|
+
fileItem = getItem(fileId);
|
|
282
281
|
if (fileItem) {
|
|
283
282
|
_context12.next = 3;
|
|
284
283
|
break;
|
|
@@ -315,7 +314,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
315
314
|
while (1) switch (_context13.prev = _context13.next) {
|
|
316
315
|
case 0:
|
|
317
316
|
fileId = body.sourceFile.id;
|
|
318
|
-
fileItem =
|
|
317
|
+
fileItem = getItem(fileId);
|
|
319
318
|
if (fileItem) {
|
|
320
319
|
_context13.next = 4;
|
|
321
320
|
break;
|
|
@@ -408,25 +407,25 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
408
407
|
*/
|
|
409
408
|
var createMockedMediaApi = exports.createMockedMediaApi = function createMockedMediaApi(initialFileItems) {
|
|
410
409
|
var storedFileItems = new Map();
|
|
411
|
-
var
|
|
410
|
+
var getItem = function getItem(fileId) {
|
|
412
411
|
return storedFileItems.get(fileId);
|
|
413
412
|
};
|
|
414
|
-
var
|
|
413
|
+
var setItems = function setItems(fileItems) {
|
|
415
414
|
var normalised = (0, _helpers.normaliseInput)(fileItems);
|
|
416
415
|
normalised.forEach(function (fileItem) {
|
|
417
416
|
return storedFileItems.set(fileItem.id, fileItem);
|
|
418
417
|
});
|
|
419
418
|
};
|
|
420
419
|
if (initialFileItems) {
|
|
421
|
-
|
|
420
|
+
setItems(initialFileItems);
|
|
422
421
|
}
|
|
423
422
|
var mediaApi = getMediaApi({
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
setItems: setItems,
|
|
424
|
+
getItem: getItem
|
|
426
425
|
});
|
|
427
426
|
return {
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
setItems: setItems,
|
|
428
|
+
getItem: getItem,
|
|
430
429
|
mediaApi: mediaApi
|
|
431
430
|
};
|
|
432
431
|
};
|
|
@@ -146,7 +146,7 @@ var createFileState = exports.createFileState = function createFileState(_ref3)
|
|
|
146
146
|
representations: representations
|
|
147
147
|
};
|
|
148
148
|
};
|
|
149
|
-
var createUploadingFileState = exports.createUploadingFileState = function createUploadingFileState(_ref4, progress) {
|
|
149
|
+
var createUploadingFileState = exports.createUploadingFileState = function createUploadingFileState(_ref4, progress, binary) {
|
|
150
150
|
var id = _ref4.id,
|
|
151
151
|
_ref4$details = _ref4.details,
|
|
152
152
|
name = _ref4$details.name,
|
|
@@ -164,7 +164,7 @@ var createUploadingFileState = exports.createUploadingFileState = function creat
|
|
|
164
164
|
mimeType: mimeType,
|
|
165
165
|
createdAt: createdAt,
|
|
166
166
|
preview: {
|
|
167
|
-
value: new Blob(['some-content'], {
|
|
167
|
+
value: binary || new Blob(['some-content'], {
|
|
168
168
|
type: mimeType
|
|
169
169
|
})
|
|
170
170
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getMediaFile, normaliseInput } from './helpers';
|
|
2
2
|
const getMediaApi = ({
|
|
3
|
-
|
|
3
|
+
getItem
|
|
4
4
|
}) => ({
|
|
5
5
|
// --------------------------------------------------------
|
|
6
6
|
// UPLOAD ENDPOINTS - None is supported
|
|
@@ -37,7 +37,7 @@ const getMediaApi = ({
|
|
|
37
37
|
// --------------------------------------------------------
|
|
38
38
|
|
|
39
39
|
getFile: async fileId => {
|
|
40
|
-
const fileItem =
|
|
40
|
+
const fileItem = getItem(fileId);
|
|
41
41
|
if (!fileItem) {
|
|
42
42
|
throw new Error('404 - MockedMediaApi.getFile: file not found');
|
|
43
43
|
}
|
|
@@ -46,7 +46,7 @@ const getMediaApi = ({
|
|
|
46
46
|
};
|
|
47
47
|
},
|
|
48
48
|
getItems: async ids => {
|
|
49
|
-
const items = ids.map(id =>
|
|
49
|
+
const items = ids.map(id => getItem(id)).filter(fileState => !!fileState);
|
|
50
50
|
return {
|
|
51
51
|
data: {
|
|
52
52
|
items
|
|
@@ -65,12 +65,11 @@ const getMediaApi = ({
|
|
|
65
65
|
getFileImageURL: async () => {
|
|
66
66
|
throw new Error('500 - MockedMediaApi.getFileImageURL: method not implemented');
|
|
67
67
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
throw new Error('500 - MockedMediaApi.getFileImageURLSync: method not implemented');
|
|
68
|
+
getFileImageURLSync: id => {
|
|
69
|
+
return `image-url-sync-${id}`;
|
|
71
70
|
},
|
|
72
71
|
getFileBinaryURL: async id => {
|
|
73
|
-
const fileItem =
|
|
72
|
+
const fileItem = getItem(id);
|
|
74
73
|
if (!fileItem) {
|
|
75
74
|
throw new Error('404 - MockedMediaApi.getFileBinaryURL: file not found');
|
|
76
75
|
}
|
|
@@ -92,7 +91,7 @@ const getMediaApi = ({
|
|
|
92
91
|
// BINARY ENDPOINTS
|
|
93
92
|
// --------------------------------------------------------
|
|
94
93
|
getImage: async fileId => {
|
|
95
|
-
const fileItem =
|
|
94
|
+
const fileItem = getItem(fileId);
|
|
96
95
|
if (!fileItem) {
|
|
97
96
|
throw new Error('404 - MockedMediaApi.getImage: file not found');
|
|
98
97
|
}
|
|
@@ -110,7 +109,7 @@ const getMediaApi = ({
|
|
|
110
109
|
// TODO
|
|
111
110
|
copyFileWithToken: async body => {
|
|
112
111
|
const fileId = body.sourceFile.id;
|
|
113
|
-
const fileItem =
|
|
112
|
+
const fileItem = getItem(fileId);
|
|
114
113
|
if (!fileItem) {
|
|
115
114
|
throw new Error('404 - MockedMediaApi.copyFileWithToken: file not found');
|
|
116
115
|
}
|
|
@@ -141,21 +140,21 @@ const getMediaApi = ({
|
|
|
141
140
|
*/
|
|
142
141
|
export const createMockedMediaApi = initialFileItems => {
|
|
143
142
|
const storedFileItems = new Map();
|
|
144
|
-
const
|
|
145
|
-
const
|
|
143
|
+
const getItem = fileId => storedFileItems.get(fileId);
|
|
144
|
+
const setItems = fileItems => {
|
|
146
145
|
const normalised = normaliseInput(fileItems);
|
|
147
146
|
normalised.forEach(fileItem => storedFileItems.set(fileItem.id, fileItem));
|
|
148
147
|
};
|
|
149
148
|
if (initialFileItems) {
|
|
150
|
-
|
|
149
|
+
setItems(initialFileItems);
|
|
151
150
|
}
|
|
152
151
|
const mediaApi = getMediaApi({
|
|
153
|
-
|
|
154
|
-
|
|
152
|
+
setItems,
|
|
153
|
+
getItem
|
|
155
154
|
});
|
|
156
155
|
return {
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
setItems,
|
|
157
|
+
getItem,
|
|
159
158
|
mediaApi
|
|
160
159
|
};
|
|
161
160
|
};
|
|
@@ -138,7 +138,7 @@ export const createUploadingFileState = ({
|
|
|
138
138
|
mimeType,
|
|
139
139
|
createdAt
|
|
140
140
|
}
|
|
141
|
-
}, progress) => ({
|
|
141
|
+
}, progress, binary) => ({
|
|
142
142
|
status: 'uploading',
|
|
143
143
|
progress,
|
|
144
144
|
id,
|
|
@@ -148,7 +148,7 @@ export const createUploadingFileState = ({
|
|
|
148
148
|
mimeType,
|
|
149
149
|
createdAt,
|
|
150
150
|
preview: {
|
|
151
|
-
value: new Blob(['some-content'], {
|
|
151
|
+
value: binary || new Blob(['some-content'], {
|
|
152
152
|
type: mimeType
|
|
153
153
|
})
|
|
154
154
|
}
|
|
@@ -2,7 +2,7 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
3
3
|
import { getMediaFile, normaliseInput } from './helpers';
|
|
4
4
|
var getMediaApi = function getMediaApi(_ref) {
|
|
5
|
-
var
|
|
5
|
+
var getItem = _ref.getItem;
|
|
6
6
|
return {
|
|
7
7
|
// --------------------------------------------------------
|
|
8
8
|
// UPLOAD ENDPOINTS - None is supported
|
|
@@ -113,7 +113,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
113
113
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
114
114
|
while (1) switch (_context6.prev = _context6.next) {
|
|
115
115
|
case 0:
|
|
116
|
-
fileItem =
|
|
116
|
+
fileItem = getItem(fileId);
|
|
117
117
|
if (fileItem) {
|
|
118
118
|
_context6.next = 3;
|
|
119
119
|
break;
|
|
@@ -141,7 +141,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
141
141
|
while (1) switch (_context7.prev = _context7.next) {
|
|
142
142
|
case 0:
|
|
143
143
|
items = ids.map(function (id) {
|
|
144
|
-
return
|
|
144
|
+
return getItem(id);
|
|
145
145
|
}).filter(function (fileState) {
|
|
146
146
|
return !!fileState;
|
|
147
147
|
});
|
|
@@ -201,9 +201,8 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
201
201
|
}
|
|
202
202
|
return getFileImageURL;
|
|
203
203
|
}(),
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
throw new Error('500 - MockedMediaApi.getFileImageURLSync: method not implemented');
|
|
204
|
+
getFileImageURLSync: function getFileImageURLSync(id) {
|
|
205
|
+
return "image-url-sync-".concat(id);
|
|
207
206
|
},
|
|
208
207
|
getFileBinaryURL: function () {
|
|
209
208
|
var _getFileBinaryURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id) {
|
|
@@ -211,7 +210,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
211
210
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
212
211
|
while (1) switch (_context10.prev = _context10.next) {
|
|
213
212
|
case 0:
|
|
214
|
-
fileItem =
|
|
213
|
+
fileItem = getItem(id);
|
|
215
214
|
if (fileItem) {
|
|
216
215
|
_context10.next = 3;
|
|
217
216
|
break;
|
|
@@ -271,7 +270,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
271
270
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
272
271
|
while (1) switch (_context12.prev = _context12.next) {
|
|
273
272
|
case 0:
|
|
274
|
-
fileItem =
|
|
273
|
+
fileItem = getItem(fileId);
|
|
275
274
|
if (fileItem) {
|
|
276
275
|
_context12.next = 3;
|
|
277
276
|
break;
|
|
@@ -308,7 +307,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
308
307
|
while (1) switch (_context13.prev = _context13.next) {
|
|
309
308
|
case 0:
|
|
310
309
|
fileId = body.sourceFile.id;
|
|
311
|
-
fileItem =
|
|
310
|
+
fileItem = getItem(fileId);
|
|
312
311
|
if (fileItem) {
|
|
313
312
|
_context13.next = 4;
|
|
314
313
|
break;
|
|
@@ -401,25 +400,25 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
401
400
|
*/
|
|
402
401
|
export var createMockedMediaApi = function createMockedMediaApi(initialFileItems) {
|
|
403
402
|
var storedFileItems = new Map();
|
|
404
|
-
var
|
|
403
|
+
var getItem = function getItem(fileId) {
|
|
405
404
|
return storedFileItems.get(fileId);
|
|
406
405
|
};
|
|
407
|
-
var
|
|
406
|
+
var setItems = function setItems(fileItems) {
|
|
408
407
|
var normalised = normaliseInput(fileItems);
|
|
409
408
|
normalised.forEach(function (fileItem) {
|
|
410
409
|
return storedFileItems.set(fileItem.id, fileItem);
|
|
411
410
|
});
|
|
412
411
|
};
|
|
413
412
|
if (initialFileItems) {
|
|
414
|
-
|
|
413
|
+
setItems(initialFileItems);
|
|
415
414
|
}
|
|
416
415
|
var mediaApi = getMediaApi({
|
|
417
|
-
|
|
418
|
-
|
|
416
|
+
setItems: setItems,
|
|
417
|
+
getItem: getItem
|
|
419
418
|
});
|
|
420
419
|
return {
|
|
421
|
-
|
|
422
|
-
|
|
420
|
+
setItems: setItems,
|
|
421
|
+
getItem: getItem,
|
|
423
422
|
mediaApi: mediaApi
|
|
424
423
|
};
|
|
425
424
|
};
|
|
@@ -138,7 +138,7 @@ export var createFileState = function createFileState(_ref3) {
|
|
|
138
138
|
representations: representations
|
|
139
139
|
};
|
|
140
140
|
};
|
|
141
|
-
export var createUploadingFileState = function createUploadingFileState(_ref4, progress) {
|
|
141
|
+
export var createUploadingFileState = function createUploadingFileState(_ref4, progress, binary) {
|
|
142
142
|
var id = _ref4.id,
|
|
143
143
|
_ref4$details = _ref4.details,
|
|
144
144
|
name = _ref4$details.name,
|
|
@@ -156,7 +156,7 @@ export var createUploadingFileState = function createUploadingFileState(_ref4, p
|
|
|
156
156
|
mimeType: mimeType,
|
|
157
157
|
createdAt: createdAt,
|
|
158
158
|
preview: {
|
|
159
|
-
value: new Blob(['some-content'], {
|
|
159
|
+
value: binary || new Blob(['some-content'], {
|
|
160
160
|
type: mimeType
|
|
161
161
|
})
|
|
162
162
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { MediaStore, MediaStoreError, isMediaStoreError, getMediaEnvironment, getMediaRegion, } from './client/media-store';
|
|
2
|
-
export type { ResponseFileItem, ItemsPayload, ImageMetadataArtifact, ImageMetadata, MediaStoreResponse, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileParams, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, MediaStoreCreateFileFromBinaryParams, MediaStoreCreateFileFromUploadConditions, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, SourceFile, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, CreatedTouchedFile, TouchedFiles, EmptyFile, MediaStoreErrorReason, MediaStoreErrorAttributes, } from './client/media-store';
|
|
2
|
+
export type { ResponseFileItem, ItemsPayload, ImageMetadataArtifact, ImageMetadata, MediaStoreResponse, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileParams, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, MediaStoreCreateFileFromBinaryParams, MediaStoreCreateFileFromUploadConditions, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, SourceFile, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, CreatedTouchedFile, TouchedFiles, EmptyFile, MediaStoreErrorReason, MediaStoreErrorAttributes, MediaApi, } from './client/media-store';
|
|
3
3
|
export { UploadController } from './upload-controller';
|
|
4
4
|
export type { AbortFunction } from './upload-controller';
|
|
5
5
|
export type { MediaItemType, FileItem, FileProcessingStatus, MediaArtifact, Artifacts, FileDetails, } from './models/item';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { MediaApi, ResponseFileItem } from '../../client/media-store';
|
|
2
|
-
export interface
|
|
3
|
-
(fileItems
|
|
2
|
+
export interface SetItems {
|
|
3
|
+
(fileItems?: ResponseFileItem | ResponseFileItem[]): void;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface GetItem {
|
|
6
6
|
(id: string): ResponseFileItem | undefined;
|
|
7
7
|
}
|
|
8
8
|
export interface CreateMockedMediaApiResult {
|
|
9
9
|
mediaApi: MediaApi;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
setItems: SetItems;
|
|
11
|
+
getItem: GetItem;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Mocked Media API
|
|
@@ -19,5 +19,5 @@ export declare const copy: (fileItem: ResponseFileItem) => ResponseFileItem;
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const getIdentifier: (fileItem: ResponseFileItem) => FileIdentifier;
|
|
21
21
|
export declare const createFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt, processingStatus, artifacts, representations, }, }: ResponseFileItem) => FileState;
|
|
22
|
-
export declare const createUploadingFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt }, }: ResponseFileItem, progress: number) => UploadingFileState;
|
|
22
|
+
export declare const createUploadingFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt }, }: ResponseFileItem, progress: number, binary?: Blob) => UploadingFileState;
|
|
23
23
|
export declare const createErrorFileState: ({ id, }: ResponseFileItem) => ErrorFileState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { CreateMockedMediaApiResult,
|
|
1
|
+
export type { CreateMockedMediaApiResult, SetItems, GetItem, } from './MockedMediaApi';
|
|
2
2
|
export { createMockedMediaApi } from './MockedMediaApi';
|
|
3
3
|
export { copy, getIdentifier, createEmptyFileItem, createUploadingFileState, createErrorFileState, createFileState, createProcessingFileItem, } from './helpers';
|
|
@@ -5,5 +5,5 @@ export { animatedFileId, archiveFileId, atlassianLogoUrl, audioFileDetails, audi
|
|
|
5
5
|
export declare const authProviderBaseURL = "https://media.dev.atl-paas.net";
|
|
6
6
|
export { mediaPickerAuthProvider, defaultMediaPickerAuthProvider, } from './mediaPickerAuthProvider';
|
|
7
7
|
export { fakeMediaClient } from './fakeMediaClient';
|
|
8
|
-
export type { CreateMockedMediaApiResult,
|
|
8
|
+
export type { CreateMockedMediaApiResult, SetItems, GetItem, } from './MockedMediaApi';
|
|
9
9
|
export { createMockedMediaApi, copy, getIdentifier, createProcessingFileItem, createEmptyFileItem, createUploadingFileState, createFileState, createErrorFileState, } from './MockedMediaApi';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { MediaStore, MediaStoreError, isMediaStoreError, getMediaEnvironment, getMediaRegion, } from './client/media-store';
|
|
2
|
-
export type { ResponseFileItem, ItemsPayload, ImageMetadataArtifact, ImageMetadata, MediaStoreResponse, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileParams, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, MediaStoreCreateFileFromBinaryParams, MediaStoreCreateFileFromUploadConditions, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, SourceFile, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, CreatedTouchedFile, TouchedFiles, EmptyFile, MediaStoreErrorReason, MediaStoreErrorAttributes, } from './client/media-store';
|
|
2
|
+
export type { ResponseFileItem, ItemsPayload, ImageMetadataArtifact, ImageMetadata, MediaStoreResponse, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileParams, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, MediaStoreCreateFileFromBinaryParams, MediaStoreCreateFileFromUploadConditions, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, SourceFile, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, CreatedTouchedFile, TouchedFiles, EmptyFile, MediaStoreErrorReason, MediaStoreErrorAttributes, MediaApi, } from './client/media-store';
|
|
3
3
|
export { UploadController } from './upload-controller';
|
|
4
4
|
export type { AbortFunction } from './upload-controller';
|
|
5
5
|
export type { MediaItemType, FileItem, FileProcessingStatus, MediaArtifact, Artifacts, FileDetails, } from './models/item';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { MediaApi, ResponseFileItem } from '../../client/media-store';
|
|
2
|
-
export interface
|
|
3
|
-
(fileItems
|
|
2
|
+
export interface SetItems {
|
|
3
|
+
(fileItems?: ResponseFileItem | ResponseFileItem[]): void;
|
|
4
4
|
}
|
|
5
|
-
export interface
|
|
5
|
+
export interface GetItem {
|
|
6
6
|
(id: string): ResponseFileItem | undefined;
|
|
7
7
|
}
|
|
8
8
|
export interface CreateMockedMediaApiResult {
|
|
9
9
|
mediaApi: MediaApi;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
setItems: SetItems;
|
|
11
|
+
getItem: GetItem;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Mocked Media API
|
|
@@ -19,5 +19,5 @@ export declare const copy: (fileItem: ResponseFileItem) => ResponseFileItem;
|
|
|
19
19
|
*/
|
|
20
20
|
export declare const getIdentifier: (fileItem: ResponseFileItem) => FileIdentifier;
|
|
21
21
|
export declare const createFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt, processingStatus, artifacts, representations, }, }: ResponseFileItem) => FileState;
|
|
22
|
-
export declare const createUploadingFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt }, }: ResponseFileItem, progress: number) => UploadingFileState;
|
|
22
|
+
export declare const createUploadingFileState: ({ id, details: { name, size, mediaType, mimeType, createdAt }, }: ResponseFileItem, progress: number, binary?: Blob) => UploadingFileState;
|
|
23
23
|
export declare const createErrorFileState: ({ id, }: ResponseFileItem) => ErrorFileState;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { CreateMockedMediaApiResult,
|
|
1
|
+
export type { CreateMockedMediaApiResult, SetItems, GetItem, } from './MockedMediaApi';
|
|
2
2
|
export { createMockedMediaApi } from './MockedMediaApi';
|
|
3
3
|
export { copy, getIdentifier, createEmptyFileItem, createUploadingFileState, createErrorFileState, createFileState, createProcessingFileItem, } from './helpers';
|
|
@@ -5,5 +5,5 @@ export { animatedFileId, archiveFileId, atlassianLogoUrl, audioFileDetails, audi
|
|
|
5
5
|
export declare const authProviderBaseURL = "https://media.dev.atl-paas.net";
|
|
6
6
|
export { mediaPickerAuthProvider, defaultMediaPickerAuthProvider, } from './mediaPickerAuthProvider';
|
|
7
7
|
export { fakeMediaClient } from './fakeMediaClient';
|
|
8
|
-
export type { CreateMockedMediaApiResult,
|
|
8
|
+
export type { CreateMockedMediaApiResult, SetItems, GetItem, } from './MockedMediaApi';
|
|
9
9
|
export { createMockedMediaApi, copy, getIdentifier, createProcessingFileItem, createEmptyFileItem, createUploadingFileState, createFileState, createErrorFileState, } from './MockedMediaApi';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.1.1",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
7
7
|
},
|
|
8
|
-
"repository": "https://bitbucket.org/atlassian/atlassian-frontend",
|
|
8
|
+
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|
|
9
9
|
"author": "Atlassian Pty Ltd",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"main": "dist/cjs/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/media-core": "^34.1.0",
|
|
59
59
|
"@atlaskit/media-state": "^1.0.0",
|
|
60
60
|
"@atlaskit/ssr": "*",
|
|
61
|
-
"@atlaskit/tokens": "^1.
|
|
61
|
+
"@atlaskit/tokens": "^1.35.0",
|
|
62
62
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
63
63
|
"@emotion/react": "^11.7.1",
|
|
64
64
|
"@types/deep-equal": "^1.0.1",
|