@atlaskit/media-client 26.0.0 → 26.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 +7 -0
- package/dist/cjs/test-helpers/MockedMediaApi/MockedMediaApi.js +13 -13
- package/dist/cjs/test-helpers/MockedMediaApi/helpers.js +2 -2
- package/dist/es2019/test-helpers/MockedMediaApi/MockedMediaApi.js +13 -13
- package/dist/es2019/test-helpers/MockedMediaApi/helpers.js +2 -2
- package/dist/esm/test-helpers/MockedMediaApi/MockedMediaApi.js +13 -13
- 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 +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 26.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#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
|
|
8
|
+
- [#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
|
|
9
|
+
|
|
3
10
|
## 26.0.0
|
|
4
11
|
|
|
5
12
|
### 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
|
});
|
|
@@ -218,7 +218,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
218
218
|
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
219
219
|
while (1) switch (_context10.prev = _context10.next) {
|
|
220
220
|
case 0:
|
|
221
|
-
fileItem =
|
|
221
|
+
fileItem = getItem(id);
|
|
222
222
|
if (fileItem) {
|
|
223
223
|
_context10.next = 3;
|
|
224
224
|
break;
|
|
@@ -278,7 +278,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
278
278
|
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
279
279
|
while (1) switch (_context12.prev = _context12.next) {
|
|
280
280
|
case 0:
|
|
281
|
-
fileItem =
|
|
281
|
+
fileItem = getItem(fileId);
|
|
282
282
|
if (fileItem) {
|
|
283
283
|
_context12.next = 3;
|
|
284
284
|
break;
|
|
@@ -315,7 +315,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
315
315
|
while (1) switch (_context13.prev = _context13.next) {
|
|
316
316
|
case 0:
|
|
317
317
|
fileId = body.sourceFile.id;
|
|
318
|
-
fileItem =
|
|
318
|
+
fileItem = getItem(fileId);
|
|
319
319
|
if (fileItem) {
|
|
320
320
|
_context13.next = 4;
|
|
321
321
|
break;
|
|
@@ -408,25 +408,25 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
408
408
|
*/
|
|
409
409
|
var createMockedMediaApi = exports.createMockedMediaApi = function createMockedMediaApi(initialFileItems) {
|
|
410
410
|
var storedFileItems = new Map();
|
|
411
|
-
var
|
|
411
|
+
var getItem = function getItem(fileId) {
|
|
412
412
|
return storedFileItems.get(fileId);
|
|
413
413
|
};
|
|
414
|
-
var
|
|
414
|
+
var setItems = function setItems(fileItems) {
|
|
415
415
|
var normalised = (0, _helpers.normaliseInput)(fileItems);
|
|
416
416
|
normalised.forEach(function (fileItem) {
|
|
417
417
|
return storedFileItems.set(fileItem.id, fileItem);
|
|
418
418
|
});
|
|
419
419
|
};
|
|
420
420
|
if (initialFileItems) {
|
|
421
|
-
|
|
421
|
+
setItems(initialFileItems);
|
|
422
422
|
}
|
|
423
423
|
var mediaApi = getMediaApi({
|
|
424
|
-
|
|
425
|
-
|
|
424
|
+
setItems: setItems,
|
|
425
|
+
getItem: getItem
|
|
426
426
|
});
|
|
427
427
|
return {
|
|
428
|
-
|
|
429
|
-
|
|
428
|
+
setItems: setItems,
|
|
429
|
+
getItem: getItem,
|
|
430
430
|
mediaApi: mediaApi
|
|
431
431
|
};
|
|
432
432
|
};
|
|
@@ -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
|
|
@@ -70,7 +70,7 @@ const getMediaApi = ({
|
|
|
70
70
|
throw new Error('500 - MockedMediaApi.getFileImageURLSync: method not implemented');
|
|
71
71
|
},
|
|
72
72
|
getFileBinaryURL: async id => {
|
|
73
|
-
const fileItem =
|
|
73
|
+
const fileItem = getItem(id);
|
|
74
74
|
if (!fileItem) {
|
|
75
75
|
throw new Error('404 - MockedMediaApi.getFileBinaryURL: file not found');
|
|
76
76
|
}
|
|
@@ -92,7 +92,7 @@ const getMediaApi = ({
|
|
|
92
92
|
// BINARY ENDPOINTS
|
|
93
93
|
// --------------------------------------------------------
|
|
94
94
|
getImage: async fileId => {
|
|
95
|
-
const fileItem =
|
|
95
|
+
const fileItem = getItem(fileId);
|
|
96
96
|
if (!fileItem) {
|
|
97
97
|
throw new Error('404 - MockedMediaApi.getImage: file not found');
|
|
98
98
|
}
|
|
@@ -110,7 +110,7 @@ const getMediaApi = ({
|
|
|
110
110
|
// TODO
|
|
111
111
|
copyFileWithToken: async body => {
|
|
112
112
|
const fileId = body.sourceFile.id;
|
|
113
|
-
const fileItem =
|
|
113
|
+
const fileItem = getItem(fileId);
|
|
114
114
|
if (!fileItem) {
|
|
115
115
|
throw new Error('404 - MockedMediaApi.copyFileWithToken: file not found');
|
|
116
116
|
}
|
|
@@ -141,21 +141,21 @@ const getMediaApi = ({
|
|
|
141
141
|
*/
|
|
142
142
|
export const createMockedMediaApi = initialFileItems => {
|
|
143
143
|
const storedFileItems = new Map();
|
|
144
|
-
const
|
|
145
|
-
const
|
|
144
|
+
const getItem = fileId => storedFileItems.get(fileId);
|
|
145
|
+
const setItems = fileItems => {
|
|
146
146
|
const normalised = normaliseInput(fileItems);
|
|
147
147
|
normalised.forEach(fileItem => storedFileItems.set(fileItem.id, fileItem));
|
|
148
148
|
};
|
|
149
149
|
if (initialFileItems) {
|
|
150
|
-
|
|
150
|
+
setItems(initialFileItems);
|
|
151
151
|
}
|
|
152
152
|
const mediaApi = getMediaApi({
|
|
153
|
-
|
|
154
|
-
|
|
153
|
+
setItems,
|
|
154
|
+
getItem
|
|
155
155
|
});
|
|
156
156
|
return {
|
|
157
|
-
|
|
158
|
-
|
|
157
|
+
setItems,
|
|
158
|
+
getItem,
|
|
159
159
|
mediaApi
|
|
160
160
|
};
|
|
161
161
|
};
|
|
@@ -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
|
});
|
|
@@ -211,7 +211,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
211
211
|
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
212
212
|
while (1) switch (_context10.prev = _context10.next) {
|
|
213
213
|
case 0:
|
|
214
|
-
fileItem =
|
|
214
|
+
fileItem = getItem(id);
|
|
215
215
|
if (fileItem) {
|
|
216
216
|
_context10.next = 3;
|
|
217
217
|
break;
|
|
@@ -271,7 +271,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
271
271
|
return _regeneratorRuntime.wrap(function _callee12$(_context12) {
|
|
272
272
|
while (1) switch (_context12.prev = _context12.next) {
|
|
273
273
|
case 0:
|
|
274
|
-
fileItem =
|
|
274
|
+
fileItem = getItem(fileId);
|
|
275
275
|
if (fileItem) {
|
|
276
276
|
_context12.next = 3;
|
|
277
277
|
break;
|
|
@@ -308,7 +308,7 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
308
308
|
while (1) switch (_context13.prev = _context13.next) {
|
|
309
309
|
case 0:
|
|
310
310
|
fileId = body.sourceFile.id;
|
|
311
|
-
fileItem =
|
|
311
|
+
fileItem = getItem(fileId);
|
|
312
312
|
if (fileItem) {
|
|
313
313
|
_context13.next = 4;
|
|
314
314
|
break;
|
|
@@ -401,25 +401,25 @@ var getMediaApi = function getMediaApi(_ref) {
|
|
|
401
401
|
*/
|
|
402
402
|
export var createMockedMediaApi = function createMockedMediaApi(initialFileItems) {
|
|
403
403
|
var storedFileItems = new Map();
|
|
404
|
-
var
|
|
404
|
+
var getItem = function getItem(fileId) {
|
|
405
405
|
return storedFileItems.get(fileId);
|
|
406
406
|
};
|
|
407
|
-
var
|
|
407
|
+
var setItems = function setItems(fileItems) {
|
|
408
408
|
var normalised = normaliseInput(fileItems);
|
|
409
409
|
normalised.forEach(function (fileItem) {
|
|
410
410
|
return storedFileItems.set(fileItem.id, fileItem);
|
|
411
411
|
});
|
|
412
412
|
};
|
|
413
413
|
if (initialFileItems) {
|
|
414
|
-
|
|
414
|
+
setItems(initialFileItems);
|
|
415
415
|
}
|
|
416
416
|
var mediaApi = getMediaApi({
|
|
417
|
-
|
|
418
|
-
|
|
417
|
+
setItems: setItems,
|
|
418
|
+
getItem: getItem
|
|
419
419
|
});
|
|
420
420
|
return {
|
|
421
|
-
|
|
422
|
-
|
|
421
|
+
setItems: setItems,
|
|
422
|
+
getItem: getItem,
|
|
423
423
|
mediaApi: mediaApi
|
|
424
424
|
};
|
|
425
425
|
};
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.1.0",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -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.30.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",
|