@atlaskit/media-client 34.2.0 → 35.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 +20 -0
- package/dist/cjs/client/file-fetcher/index.js +3 -3
- package/dist/cjs/client/media-store/MediaStore.js +6 -3
- package/dist/cjs/models/file-state.js +4 -2
- package/dist/es2019/client/file-fetcher/index.js +3 -3
- package/dist/es2019/client/media-store/MediaStore.js +6 -3
- package/dist/es2019/models/file-state.js +4 -2
- package/dist/esm/client/file-fetcher/index.js +3 -3
- package/dist/esm/client/media-store/MediaStore.js +6 -3
- package/dist/esm/models/file-state.js +4 -2
- package/dist/types/client/file-fetcher/index.d.ts +2 -2
- package/dist/types/client/media-store/types.d.ts +1 -4
- package/dist/types/models/media.d.ts +5 -0
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +2 -2
- package/dist/types-ts4.5/client/media-store/types.d.ts +1 -4
- package/dist/types-ts4.5/models/media.d.ts +5 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 35.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#185135](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/185135)
|
|
8
|
+
[`3d2527a53b492`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3d2527a53b492) -
|
|
9
|
+
Add media metadata fields to relevant types/mappings
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 35.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- [#179845](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/179845)
|
|
20
|
+
[`8a03175bb502a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8a03175bb502a) -
|
|
21
|
+
Updated Delete Artifact interface
|
|
22
|
+
|
|
3
23
|
## 34.2.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -219,19 +219,19 @@ var FileFetcherImpl = exports.FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
219
219
|
};
|
|
220
220
|
}());
|
|
221
221
|
(0, _defineProperty2.default)(this, "deleteArtifact", /*#__PURE__*/function () {
|
|
222
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(id,
|
|
222
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(id, artifactName, collectionName, traceContext) {
|
|
223
223
|
var file, updatedArtifacts, updatedFileState;
|
|
224
224
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
225
225
|
while (1) switch (_context3.prev = _context3.next) {
|
|
226
226
|
case 0:
|
|
227
227
|
_context3.next = 2;
|
|
228
|
-
return _this.mediaApi.deleteArtifact(id,
|
|
228
|
+
return _this.mediaApi.deleteArtifact(id, artifactName, collectionName, traceContext);
|
|
229
229
|
case 2:
|
|
230
230
|
// Manually remove the artifact from file state instead of re-requesting the entire payload.
|
|
231
231
|
file = _this.store.getState().files[id];
|
|
232
232
|
if (file && file.status === 'processed' && file.artifacts) {
|
|
233
233
|
updatedArtifacts = _objectSpread({}, file.artifacts);
|
|
234
|
-
delete updatedArtifacts[
|
|
234
|
+
delete updatedArtifacts[artifactName];
|
|
235
235
|
updatedFileState = _objectSpread(_objectSpread({}, file), {}, {
|
|
236
236
|
artifacts: updatedArtifacts
|
|
237
237
|
});
|
|
@@ -125,7 +125,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
125
125
|
};
|
|
126
126
|
}());
|
|
127
127
|
(0, _defineProperty2.default)(this, "deleteArtifact", /*#__PURE__*/function () {
|
|
128
|
-
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(id,
|
|
128
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(id, artifactName, collectionName, traceContext) {
|
|
129
129
|
var metadata, authContext, options;
|
|
130
130
|
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
131
131
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -144,10 +144,13 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
144
144
|
};
|
|
145
145
|
options = _objectSpread(_objectSpread({}, metadata), {}, {
|
|
146
146
|
authContext: authContext,
|
|
147
|
-
traceContext: traceContext
|
|
147
|
+
traceContext: traceContext,
|
|
148
|
+
params: {
|
|
149
|
+
collection: collectionName
|
|
150
|
+
}
|
|
148
151
|
});
|
|
149
152
|
_context3.next = 5;
|
|
150
|
-
return _this.request("/file/".concat(id, "/artifact/").concat(
|
|
153
|
+
return _this.request("/file/".concat(id, "/artifact/").concat(artifactName), options);
|
|
151
154
|
case 5:
|
|
152
155
|
case "end":
|
|
153
156
|
return _context3.stop();
|
|
@@ -55,7 +55,8 @@ var mapMediaFileToFileState = exports.mapMediaFileToFileState = function mapMedi
|
|
|
55
55
|
createdAt = _mediaFile$data.createdAt,
|
|
56
56
|
metadataTraceContext = _mediaFile$data.metadataTraceContext,
|
|
57
57
|
hash = _mediaFile$data.hash,
|
|
58
|
-
abuseClassification = _mediaFile$data.abuseClassification
|
|
58
|
+
abuseClassification = _mediaFile$data.abuseClassification,
|
|
59
|
+
mediaMetadata = _mediaFile$data.mediaMetadata;
|
|
59
60
|
var baseState = {
|
|
60
61
|
id: id,
|
|
61
62
|
name: name,
|
|
@@ -67,7 +68,8 @@ var mapMediaFileToFileState = exports.mapMediaFileToFileState = function mapMedi
|
|
|
67
68
|
createdAt: createdAt,
|
|
68
69
|
hash: hash,
|
|
69
70
|
metadataTraceContext: metadataTraceContext,
|
|
70
|
-
abuseClassification: abuseClassification
|
|
71
|
+
abuseClassification: abuseClassification,
|
|
72
|
+
mediaMetadata: mediaMetadata
|
|
71
73
|
};
|
|
72
74
|
switch (processingStatus) {
|
|
73
75
|
case 'pending':
|
|
@@ -155,8 +155,8 @@ export class FileFetcherImpl {
|
|
|
155
155
|
this.setFileState(id, mapMediaItemToFileState(id, itemDetails));
|
|
156
156
|
return data;
|
|
157
157
|
});
|
|
158
|
-
_defineProperty(this, "deleteArtifact", async (id,
|
|
159
|
-
await this.mediaApi.deleteArtifact(id,
|
|
158
|
+
_defineProperty(this, "deleteArtifact", async (id, artifactName, collectionName, traceContext) => {
|
|
159
|
+
await this.mediaApi.deleteArtifact(id, artifactName, collectionName, traceContext);
|
|
160
160
|
|
|
161
161
|
// Manually remove the artifact from file state instead of re-requesting the entire payload.
|
|
162
162
|
const file = this.store.getState().files[id];
|
|
@@ -164,7 +164,7 @@ export class FileFetcherImpl {
|
|
|
164
164
|
const updatedArtifacts = {
|
|
165
165
|
...file.artifacts
|
|
166
166
|
};
|
|
167
|
-
delete updatedArtifacts[
|
|
167
|
+
delete updatedArtifacts[artifactName];
|
|
168
168
|
const updatedFileState = {
|
|
169
169
|
...file,
|
|
170
170
|
artifacts: updatedArtifacts
|
|
@@ -87,7 +87,7 @@ export class MediaStore {
|
|
|
87
87
|
};
|
|
88
88
|
return this.request(`/file/${id}/artifact/binary`, options).then(createMapResponseToJson(metadata));
|
|
89
89
|
});
|
|
90
|
-
_defineProperty(this, "deleteArtifact", async (id,
|
|
90
|
+
_defineProperty(this, "deleteArtifact", async (id, artifactName, collectionName, traceContext) => {
|
|
91
91
|
const metadata = {
|
|
92
92
|
method: 'DELETE',
|
|
93
93
|
endpoint: '/file/{fileId}/artifact/{artifactName}'
|
|
@@ -103,9 +103,12 @@ export class MediaStore {
|
|
|
103
103
|
const options = {
|
|
104
104
|
...metadata,
|
|
105
105
|
authContext,
|
|
106
|
-
traceContext
|
|
106
|
+
traceContext,
|
|
107
|
+
params: {
|
|
108
|
+
collection: collectionName
|
|
109
|
+
}
|
|
107
110
|
};
|
|
108
|
-
await this.request(`/file/${id}/artifact/${
|
|
111
|
+
await this.request(`/file/${id}/artifact/${artifactName}`, options);
|
|
109
112
|
});
|
|
110
113
|
_defineProperty(this, "resolveAuth", authContext => resolveAuth(this.config.authProvider, authContext, this.config.authProviderTimeout));
|
|
111
114
|
_defineProperty(this, "resolveInitialAuth", () => resolveInitialAuth(this.config.initialAuth));
|
|
@@ -29,7 +29,8 @@ export const mapMediaFileToFileState = mediaFile => {
|
|
|
29
29
|
createdAt,
|
|
30
30
|
metadataTraceContext,
|
|
31
31
|
hash,
|
|
32
|
-
abuseClassification
|
|
32
|
+
abuseClassification,
|
|
33
|
+
mediaMetadata
|
|
33
34
|
} = mediaFile.data;
|
|
34
35
|
const baseState = {
|
|
35
36
|
id,
|
|
@@ -42,7 +43,8 @@ export const mapMediaFileToFileState = mediaFile => {
|
|
|
42
43
|
createdAt,
|
|
43
44
|
hash,
|
|
44
45
|
metadataTraceContext,
|
|
45
|
-
abuseClassification
|
|
46
|
+
abuseClassification,
|
|
47
|
+
mediaMetadata
|
|
46
48
|
};
|
|
47
49
|
switch (processingStatus) {
|
|
48
50
|
case 'pending':
|
|
@@ -201,19 +201,19 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
201
201
|
};
|
|
202
202
|
}());
|
|
203
203
|
_defineProperty(this, "deleteArtifact", /*#__PURE__*/function () {
|
|
204
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id,
|
|
204
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, artifactName, collectionName, traceContext) {
|
|
205
205
|
var file, updatedArtifacts, updatedFileState;
|
|
206
206
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
207
207
|
while (1) switch (_context3.prev = _context3.next) {
|
|
208
208
|
case 0:
|
|
209
209
|
_context3.next = 2;
|
|
210
|
-
return _this.mediaApi.deleteArtifact(id,
|
|
210
|
+
return _this.mediaApi.deleteArtifact(id, artifactName, collectionName, traceContext);
|
|
211
211
|
case 2:
|
|
212
212
|
// Manually remove the artifact from file state instead of re-requesting the entire payload.
|
|
213
213
|
file = _this.store.getState().files[id];
|
|
214
214
|
if (file && file.status === 'processed' && file.artifacts) {
|
|
215
215
|
updatedArtifacts = _objectSpread({}, file.artifacts);
|
|
216
|
-
delete updatedArtifacts[
|
|
216
|
+
delete updatedArtifacts[artifactName];
|
|
217
217
|
updatedFileState = _objectSpread(_objectSpread({}, file), {}, {
|
|
218
218
|
artifacts: updatedArtifacts
|
|
219
219
|
});
|
|
@@ -119,7 +119,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
119
119
|
};
|
|
120
120
|
}());
|
|
121
121
|
_defineProperty(this, "deleteArtifact", /*#__PURE__*/function () {
|
|
122
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id,
|
|
122
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(id, artifactName, collectionName, traceContext) {
|
|
123
123
|
var metadata, authContext, options;
|
|
124
124
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
125
125
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -138,10 +138,13 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
138
138
|
};
|
|
139
139
|
options = _objectSpread(_objectSpread({}, metadata), {}, {
|
|
140
140
|
authContext: authContext,
|
|
141
|
-
traceContext: traceContext
|
|
141
|
+
traceContext: traceContext,
|
|
142
|
+
params: {
|
|
143
|
+
collection: collectionName
|
|
144
|
+
}
|
|
142
145
|
});
|
|
143
146
|
_context3.next = 5;
|
|
144
|
-
return _this.request("/file/".concat(id, "/artifact/").concat(
|
|
147
|
+
return _this.request("/file/".concat(id, "/artifact/").concat(artifactName), options);
|
|
145
148
|
case 5:
|
|
146
149
|
case "end":
|
|
147
150
|
return _context3.stop();
|
|
@@ -48,7 +48,8 @@ export var mapMediaFileToFileState = function mapMediaFileToFileState(mediaFile)
|
|
|
48
48
|
createdAt = _mediaFile$data.createdAt,
|
|
49
49
|
metadataTraceContext = _mediaFile$data.metadataTraceContext,
|
|
50
50
|
hash = _mediaFile$data.hash,
|
|
51
|
-
abuseClassification = _mediaFile$data.abuseClassification
|
|
51
|
+
abuseClassification = _mediaFile$data.abuseClassification,
|
|
52
|
+
mediaMetadata = _mediaFile$data.mediaMetadata;
|
|
52
53
|
var baseState = {
|
|
53
54
|
id: id,
|
|
54
55
|
name: name,
|
|
@@ -60,7 +61,8 @@ export var mapMediaFileToFileState = function mapMediaFileToFileState(mediaFile)
|
|
|
60
61
|
createdAt: createdAt,
|
|
61
62
|
hash: hash,
|
|
62
63
|
metadataTraceContext: metadataTraceContext,
|
|
63
|
-
abuseClassification: abuseClassification
|
|
64
|
+
abuseClassification: abuseClassification,
|
|
65
|
+
mediaMetadata: mediaMetadata
|
|
64
66
|
};
|
|
65
67
|
switch (processingStatus) {
|
|
66
68
|
case 'pending':
|
|
@@ -9,7 +9,7 @@ import { type MediaSubscribable } from '../../utils/mediaSubscribable';
|
|
|
9
9
|
import { type Dimensions } from '../../utils/getDimensionsFromBlob';
|
|
10
10
|
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
11
11
|
import { type FilePreview, type FileState, type MediaStore } from '@atlaskit/media-state';
|
|
12
|
-
import { type UploadArtifactParams
|
|
12
|
+
import { type UploadArtifactParams } from '../media-store/types';
|
|
13
13
|
export type { FileFetcherErrorAttributes, FileFetcherErrorReason } from './error';
|
|
14
14
|
export { isFileFetcherError, FileFetcherError } from './error';
|
|
15
15
|
export interface CopySourceFile {
|
|
@@ -42,7 +42,7 @@ export interface FileFetcher {
|
|
|
42
42
|
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
43
43
|
registerCopyIntent(id: string, collectionName?: string): Promise<void>;
|
|
44
44
|
uploadArtifact(id: string, file: File, params: UploadArtifactParams, collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaItemDetails>;
|
|
45
|
-
deleteArtifact(id: string,
|
|
45
|
+
deleteArtifact(id: string, artifactName: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
46
46
|
/** @exprimental This is exprimental for the purposes of COMMIT-18082 and is prone to breaking changes */
|
|
47
47
|
getVideoDurations(files: Array<{
|
|
48
48
|
id: string;
|
|
@@ -164,9 +164,6 @@ export type UploadArtifactCaptionsParams = {
|
|
|
164
164
|
language: string;
|
|
165
165
|
};
|
|
166
166
|
export type UploadArtifactParams = UploadArtifactCaptionsParams;
|
|
167
|
-
export type DeleteArtifactParams = {
|
|
168
|
-
artifactName: string;
|
|
169
|
-
};
|
|
170
167
|
export interface MediaApi {
|
|
171
168
|
removeCollectionFile: (id: string, collectionName: string, occurrenceKey?: string, traceContext?: MediaTraceContext) => Promise<void>;
|
|
172
169
|
createUpload: (createUpTo: number, collectionName?: string, traceContext?: MediaTraceContext, chunkChunkHashAlgorithm?: ChunkHashAlgorithm) => Promise<MediaStoreResponse<MediaUpload[]>>;
|
|
@@ -182,7 +179,7 @@ export interface MediaApi {
|
|
|
182
179
|
getArtifactURL: (artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string) => Promise<string>;
|
|
183
180
|
getArtifactBinary(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, options: GetArtifactBinaryOptions): Promise<Blob>;
|
|
184
181
|
uploadArtifact(id: string, file: File, params: UploadArtifactParams, collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaItemDetails>>;
|
|
185
|
-
deleteArtifact(id: string,
|
|
182
|
+
deleteArtifact(id: string, artifactName: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
186
183
|
getImage: (id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext) => Promise<Blob>;
|
|
187
184
|
getItems: (ids: string[], collectionName?: string, traceContext?: MediaTraceContext, includeHashForDuplicateFiles?: boolean) => Promise<MediaStoreResponse<ItemsPayload>>;
|
|
188
185
|
getImageMetadata: (id: string, params?: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext) => Promise<{
|
|
@@ -7,6 +7,9 @@ export type AbuseClassification = {
|
|
|
7
7
|
classification: 'ABHORRENT' | 'MALICIOUS' | 'ILLICIT' | 'COPYRIGHT';
|
|
8
8
|
confidence: 'HIGH' | 'MEDIUM' | 'LOW' | 'SYNTHETIC';
|
|
9
9
|
};
|
|
10
|
+
export type FileMediaMetadata = {
|
|
11
|
+
duration?: number;
|
|
12
|
+
};
|
|
10
13
|
export type MediaFile = {
|
|
11
14
|
readonly id: string;
|
|
12
15
|
readonly mediaType: MediaType;
|
|
@@ -20,6 +23,7 @@ export type MediaFile = {
|
|
|
20
23
|
readonly hash?: string;
|
|
21
24
|
readonly metadataTraceContext?: MediaTraceContext;
|
|
22
25
|
readonly abuseClassification?: AbuseClassification;
|
|
26
|
+
readonly mediaMetadata?: FileMediaMetadata;
|
|
23
27
|
};
|
|
24
28
|
export type MediaItemDetails = {
|
|
25
29
|
readonly mediaType: MediaType;
|
|
@@ -33,6 +37,7 @@ export type MediaItemDetails = {
|
|
|
33
37
|
readonly hash?: string;
|
|
34
38
|
readonly metadataTraceContext?: MediaTraceContext;
|
|
35
39
|
readonly abuseClassification?: AbuseClassification;
|
|
40
|
+
readonly mediaMetadata?: FileMediaMetadata;
|
|
36
41
|
};
|
|
37
42
|
export type NotFoundMediaItemDetails = {
|
|
38
43
|
readonly id: string;
|
|
@@ -9,7 +9,7 @@ import { type MediaSubscribable } from '../../utils/mediaSubscribable';
|
|
|
9
9
|
import { type Dimensions } from '../../utils/getDimensionsFromBlob';
|
|
10
10
|
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
11
11
|
import { type FilePreview, type FileState, type MediaStore } from '@atlaskit/media-state';
|
|
12
|
-
import { type UploadArtifactParams
|
|
12
|
+
import { type UploadArtifactParams } from '../media-store/types';
|
|
13
13
|
export type { FileFetcherErrorAttributes, FileFetcherErrorReason } from './error';
|
|
14
14
|
export { isFileFetcherError, FileFetcherError } from './error';
|
|
15
15
|
export interface CopySourceFile {
|
|
@@ -42,7 +42,7 @@ export interface FileFetcher {
|
|
|
42
42
|
getFileBinaryURL(id: string, collectionName?: string, maxAge?: number): Promise<string>;
|
|
43
43
|
registerCopyIntent(id: string, collectionName?: string): Promise<void>;
|
|
44
44
|
uploadArtifact(id: string, file: File, params: UploadArtifactParams, collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaItemDetails>;
|
|
45
|
-
deleteArtifact(id: string,
|
|
45
|
+
deleteArtifact(id: string, artifactName: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
46
46
|
/** @exprimental This is exprimental for the purposes of COMMIT-18082 and is prone to breaking changes */
|
|
47
47
|
getVideoDurations(files: Array<{
|
|
48
48
|
id: string;
|
|
@@ -164,9 +164,6 @@ export type UploadArtifactCaptionsParams = {
|
|
|
164
164
|
language: string;
|
|
165
165
|
};
|
|
166
166
|
export type UploadArtifactParams = UploadArtifactCaptionsParams;
|
|
167
|
-
export type DeleteArtifactParams = {
|
|
168
|
-
artifactName: string;
|
|
169
|
-
};
|
|
170
167
|
export interface MediaApi {
|
|
171
168
|
removeCollectionFile: (id: string, collectionName: string, occurrenceKey?: string, traceContext?: MediaTraceContext) => Promise<void>;
|
|
172
169
|
createUpload: (createUpTo: number, collectionName?: string, traceContext?: MediaTraceContext, chunkChunkHashAlgorithm?: ChunkHashAlgorithm) => Promise<MediaStoreResponse<MediaUpload[]>>;
|
|
@@ -182,7 +179,7 @@ export interface MediaApi {
|
|
|
182
179
|
getArtifactURL: (artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string) => Promise<string>;
|
|
183
180
|
getArtifactBinary(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, options: GetArtifactBinaryOptions): Promise<Blob>;
|
|
184
181
|
uploadArtifact(id: string, file: File, params: UploadArtifactParams, collectionName?: string, traceContext?: MediaTraceContext): Promise<MediaStoreResponse<MediaItemDetails>>;
|
|
185
|
-
deleteArtifact(id: string,
|
|
182
|
+
deleteArtifact(id: string, artifactName: string, collectionName?: string, traceContext?: MediaTraceContext): Promise<void>;
|
|
186
183
|
getImage: (id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceContext?: MediaTraceContext) => Promise<Blob>;
|
|
187
184
|
getItems: (ids: string[], collectionName?: string, traceContext?: MediaTraceContext, includeHashForDuplicateFiles?: boolean) => Promise<MediaStoreResponse<ItemsPayload>>;
|
|
188
185
|
getImageMetadata: (id: string, params?: MediaStoreGetFileImageParams, traceContext?: MediaTraceContext) => Promise<{
|
|
@@ -7,6 +7,9 @@ export type AbuseClassification = {
|
|
|
7
7
|
classification: 'ABHORRENT' | 'MALICIOUS' | 'ILLICIT' | 'COPYRIGHT';
|
|
8
8
|
confidence: 'HIGH' | 'MEDIUM' | 'LOW' | 'SYNTHETIC';
|
|
9
9
|
};
|
|
10
|
+
export type FileMediaMetadata = {
|
|
11
|
+
duration?: number;
|
|
12
|
+
};
|
|
10
13
|
export type MediaFile = {
|
|
11
14
|
readonly id: string;
|
|
12
15
|
readonly mediaType: MediaType;
|
|
@@ -20,6 +23,7 @@ export type MediaFile = {
|
|
|
20
23
|
readonly hash?: string;
|
|
21
24
|
readonly metadataTraceContext?: MediaTraceContext;
|
|
22
25
|
readonly abuseClassification?: AbuseClassification;
|
|
26
|
+
readonly mediaMetadata?: FileMediaMetadata;
|
|
23
27
|
};
|
|
24
28
|
export type MediaItemDetails = {
|
|
25
29
|
readonly mediaType: MediaType;
|
|
@@ -33,6 +37,7 @@ export type MediaItemDetails = {
|
|
|
33
37
|
readonly hash?: string;
|
|
34
38
|
readonly metadataTraceContext?: MediaTraceContext;
|
|
35
39
|
readonly abuseClassification?: AbuseClassification;
|
|
40
|
+
readonly mediaMetadata?: FileMediaMetadata;
|
|
36
41
|
};
|
|
37
42
|
export type NotFoundMediaItemDetails = {
|
|
38
43
|
readonly id: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.1.0",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@atlaskit/media-core": "^37.0.0",
|
|
54
|
-
"@atlaskit/media-state": "^1.
|
|
54
|
+
"@atlaskit/media-state": "^1.8.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@atlaskit/media-core": "^37.0.0",
|
|
58
|
-
"@atlaskit/media-state": "^1.
|
|
58
|
+
"@atlaskit/media-state": "^1.8.0",
|
|
59
59
|
"@atlaskit/ssr": "workspace:^",
|
|
60
|
-
"@atlaskit/tokens": "^5.
|
|
60
|
+
"@atlaskit/tokens": "^5.5.0",
|
|
61
61
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
62
62
|
"@emotion/react": "^11.7.1",
|
|
63
63
|
"@types/deep-equal": "^1.0.1",
|