@atlaskit/media-client 26.3.0 → 27.0.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 +1044 -683
- package/dist/cjs/client/file-fetcher/index.js +2 -1
- package/dist/es2019/client/file-fetcher/index.js +2 -1
- package/dist/esm/client/file-fetcher/index.js +2 -1
- package/dist/types/client/file-fetcher/index.d.ts +11 -11
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +11 -11
- package/example-helpers/styles.ts +73 -74
- package/package.json +11 -4
- package/dist/cjs/test-helpers/MockedMediaApi/MockedMediaApi.js +0 -455
- package/dist/cjs/test-helpers/MockedMediaApi/helpers.js +0 -184
- package/dist/cjs/test-helpers/MockedMediaApi/index.js +0 -55
- package/dist/cjs/test-helpers/_numbers.js +0 -9
- package/dist/cjs/test-helpers/authProvider.js +0 -70
- package/dist/cjs/test-helpers/collectionNames.js +0 -11
- package/dist/cjs/test-helpers/exampleMediaItems.js +0 -274
- package/dist/cjs/test-helpers/fakeMediaClient.js +0 -75
- package/dist/cjs/test-helpers/index.js +0 -422
- package/dist/cjs/test-helpers/mediaClientProvider.js +0 -54
- package/dist/cjs/test-helpers/mediaPickerAuthProvider.js +0 -92
- package/dist/es2019/test-helpers/MockedMediaApi/MockedMediaApi.js +0 -166
- package/dist/es2019/test-helpers/MockedMediaApi/helpers.js +0 -167
- package/dist/es2019/test-helpers/MockedMediaApi/index.js +0 -2
- package/dist/es2019/test-helpers/_numbers.js +0 -3
- package/dist/es2019/test-helpers/authProvider.js +0 -34
- package/dist/es2019/test-helpers/collectionNames.js +0 -5
- package/dist/es2019/test-helpers/exampleMediaItems.js +0 -268
- package/dist/es2019/test-helpers/fakeMediaClient.js +0 -63
- package/dist/es2019/test-helpers/index.js +0 -8
- package/dist/es2019/test-helpers/mediaClientProvider.js +0 -42
- package/dist/es2019/test-helpers/mediaPickerAuthProvider.js +0 -56
- package/dist/esm/test-helpers/MockedMediaApi/MockedMediaApi.js +0 -448
- package/dist/esm/test-helpers/MockedMediaApi/helpers.js +0 -177
- package/dist/esm/test-helpers/MockedMediaApi/index.js +0 -2
- package/dist/esm/test-helpers/_numbers.js +0 -3
- package/dist/esm/test-helpers/authProvider.js +0 -63
- package/dist/esm/test-helpers/collectionNames.js +0 -5
- package/dist/esm/test-helpers/exampleMediaItems.js +0 -268
- package/dist/esm/test-helpers/fakeMediaClient.js +0 -69
- package/dist/esm/test-helpers/index.js +0 -8
- package/dist/esm/test-helpers/mediaClientProvider.js +0 -48
- package/dist/esm/test-helpers/mediaPickerAuthProvider.js +0 -85
- package/dist/types/test-helpers/MockedMediaApi/MockedMediaApi.d.ts +0 -16
- package/dist/types/test-helpers/MockedMediaApi/helpers.d.ts +0 -23
- package/dist/types/test-helpers/MockedMediaApi/index.d.ts +0 -3
- package/dist/types/test-helpers/_numbers.d.ts +0 -1
- package/dist/types/test-helpers/authProvider.d.ts +0 -6
- package/dist/types/test-helpers/collectionNames.d.ts +0 -5
- package/dist/types/test-helpers/exampleMediaItems.d.ts +0 -53
- package/dist/types/test-helpers/fakeMediaClient.d.ts +0 -4
- package/dist/types/test-helpers/index.d.ts +0 -9
- package/dist/types/test-helpers/mediaClientProvider.d.ts +0 -23
- package/dist/types/test-helpers/mediaPickerAuthProvider.d.ts +0 -5
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/MockedMediaApi.d.ts +0 -16
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/helpers.d.ts +0 -23
- package/dist/types-ts4.5/test-helpers/MockedMediaApi/index.d.ts +0 -3
- package/dist/types-ts4.5/test-helpers/_numbers.d.ts +0 -1
- package/dist/types-ts4.5/test-helpers/authProvider.d.ts +0 -6
- package/dist/types-ts4.5/test-helpers/collectionNames.d.ts +0 -5
- package/dist/types-ts4.5/test-helpers/exampleMediaItems.d.ts +0 -53
- package/dist/types-ts4.5/test-helpers/fakeMediaClient.d.ts +0 -4
- package/dist/types-ts4.5/test-helpers/index.d.ts +0 -9
- package/dist/types-ts4.5/test-helpers/mediaClientProvider.d.ts +0 -23
- package/dist/types-ts4.5/test-helpers/mediaPickerAuthProvider.d.ts +0 -5
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { getMediaFile, normaliseInput } from './helpers';
|
|
2
|
-
const getMediaApi = ({
|
|
3
|
-
getItem
|
|
4
|
-
}) => ({
|
|
5
|
-
// --------------------------------------------------------
|
|
6
|
-
// UPLOAD ENDPOINTS - None is supported
|
|
7
|
-
// --------------------------------------------------------
|
|
8
|
-
|
|
9
|
-
touchFiles: async ({
|
|
10
|
-
descriptors
|
|
11
|
-
}) => {
|
|
12
|
-
throw new Error('500 - MockedMediaApi.touchFiles: method not implemented');
|
|
13
|
-
},
|
|
14
|
-
uploadChunk: async (_etag, _blob, uploadId) => {
|
|
15
|
-
throw new Error('500 - MockedMediaApi.uploadChunk: method not implemented');
|
|
16
|
-
},
|
|
17
|
-
appendChunksToUpload: async () => {
|
|
18
|
-
throw new Error('500 - MockedMediaApi.appendChunksToUpload: method not implemented');
|
|
19
|
-
},
|
|
20
|
-
createFileFromUpload: async ({
|
|
21
|
-
uploadId
|
|
22
|
-
}, {
|
|
23
|
-
collection
|
|
24
|
-
}) => {
|
|
25
|
-
throw new Error('500 - MockedMediaApi.createFileFromUpload: method not implemented');
|
|
26
|
-
},
|
|
27
|
-
// Used by Media Picker as a fallback for conflicted file Ids
|
|
28
|
-
createUpload: async () => {
|
|
29
|
-
throw new Error('500 - MockedMediaApi.createUpload: method not implemented');
|
|
30
|
-
},
|
|
31
|
-
// For File size limits
|
|
32
|
-
getRejectedResponseFromDescriptor: () => {
|
|
33
|
-
throw new Error('500 - MockedMediaApi.getRejectedResponseFromDescriptor: method not implemented');
|
|
34
|
-
},
|
|
35
|
-
// --------------------------------------------------------
|
|
36
|
-
// METADATA ENDPOINTS
|
|
37
|
-
// --------------------------------------------------------
|
|
38
|
-
|
|
39
|
-
getFile: async fileId => {
|
|
40
|
-
const fileItem = getItem(fileId);
|
|
41
|
-
if (!fileItem) {
|
|
42
|
-
throw new Error('404 - MockedMediaApi.getFile: file not found');
|
|
43
|
-
}
|
|
44
|
-
return {
|
|
45
|
-
data: getMediaFile(fileItem)
|
|
46
|
-
};
|
|
47
|
-
},
|
|
48
|
-
getItems: async ids => {
|
|
49
|
-
const items = ids.map(id => getItem(id)).filter(fileState => !!fileState);
|
|
50
|
-
return {
|
|
51
|
-
data: {
|
|
52
|
-
items
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
},
|
|
56
|
-
// TODO
|
|
57
|
-
getImageMetadata: async () => {
|
|
58
|
-
throw new Error('500 - MockedMediaApi.getImageMetadata: method not implemented');
|
|
59
|
-
},
|
|
60
|
-
// --------------------------------------------------------
|
|
61
|
-
// URL ENDPOINTS
|
|
62
|
-
// --------------------------------------------------------
|
|
63
|
-
|
|
64
|
-
getFileImageURL: async id => {
|
|
65
|
-
return `image-url-${id}`;
|
|
66
|
-
},
|
|
67
|
-
getFileImageURLSync: id => {
|
|
68
|
-
return `image-url-sync-${id}`;
|
|
69
|
-
},
|
|
70
|
-
getFileBinaryURL: async id => {
|
|
71
|
-
const fileItem = getItem(id);
|
|
72
|
-
if (!fileItem) {
|
|
73
|
-
throw new Error('404 - MockedMediaApi.getFileBinaryURL: file not found');
|
|
74
|
-
}
|
|
75
|
-
if (fileItem.details.size === 0) {
|
|
76
|
-
// TODO veryify if this is the correct answer for an uploading file
|
|
77
|
-
throw new Error('404 - MockedMediaApi.getFileBinaryURL: file is empty');
|
|
78
|
-
}
|
|
79
|
-
return `/file/${id}/binary`;
|
|
80
|
-
},
|
|
81
|
-
getArtifactURL: async (artifacts, artifactName) => {
|
|
82
|
-
var _artifacts$artifactNa;
|
|
83
|
-
const artifactUrl = (_artifacts$artifactNa = artifacts[artifactName]) === null || _artifacts$artifactNa === void 0 ? void 0 : _artifacts$artifactNa.url;
|
|
84
|
-
if (!artifactUrl) {
|
|
85
|
-
throw new Error(`404 - MockedMediaApi.getArtifactURL: artifact ${artifactName} not found`);
|
|
86
|
-
}
|
|
87
|
-
return artifactUrl;
|
|
88
|
-
},
|
|
89
|
-
// --------------------------------------------------------
|
|
90
|
-
// BINARY ENDPOINTS
|
|
91
|
-
// --------------------------------------------------------
|
|
92
|
-
getImage: async fileId => {
|
|
93
|
-
const fileItem = getItem(fileId);
|
|
94
|
-
if (!fileItem) {
|
|
95
|
-
throw new Error('404 - MockedMediaApi.getImage: file not found');
|
|
96
|
-
}
|
|
97
|
-
if (!fileItem.details.representations.image) {
|
|
98
|
-
throw new Error('404 - MockedMediaApi.getImage: image not found');
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Empty Blob. Might have to change for a real one if TLR loads the image
|
|
102
|
-
return new Blob();
|
|
103
|
-
},
|
|
104
|
-
getFileBinary: async fileId => {
|
|
105
|
-
const fileItem = getItem(fileId);
|
|
106
|
-
if (!fileItem) {
|
|
107
|
-
throw new Error('404 - MockedMediaApi.getFileBinary: file not found');
|
|
108
|
-
}
|
|
109
|
-
return new Blob();
|
|
110
|
-
},
|
|
111
|
-
// --------------------------------------------------------
|
|
112
|
-
// OTHER ENDPOINTS
|
|
113
|
-
// --------------------------------------------------------
|
|
114
|
-
|
|
115
|
-
// TODO
|
|
116
|
-
copyFileWithToken: async body => {
|
|
117
|
-
const fileId = body.sourceFile.id;
|
|
118
|
-
const fileItem = getItem(fileId);
|
|
119
|
-
if (!fileItem) {
|
|
120
|
-
throw new Error('404 - MockedMediaApi.copyFileWithToken: file not found');
|
|
121
|
-
}
|
|
122
|
-
return {
|
|
123
|
-
data: getMediaFile(fileItem)
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
// TODO
|
|
127
|
-
removeCollectionFile: async () => {},
|
|
128
|
-
// --------------------------------------------------------
|
|
129
|
-
// OTHER ENDPOINTS
|
|
130
|
-
// --------------------------------------------------------
|
|
131
|
-
request: async () => new Response(),
|
|
132
|
-
resolveAuth: async () => ({
|
|
133
|
-
asapIssuer: '',
|
|
134
|
-
token: '',
|
|
135
|
-
baseUrl: ''
|
|
136
|
-
}),
|
|
137
|
-
resolveInitialAuth: () => ({
|
|
138
|
-
asapIssuer: '',
|
|
139
|
-
token: '',
|
|
140
|
-
baseUrl: ''
|
|
141
|
-
})
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Mocked Media API
|
|
146
|
-
*/
|
|
147
|
-
export const createMockedMediaApi = initialFileItems => {
|
|
148
|
-
const storedFileItems = new Map();
|
|
149
|
-
const getItem = fileId => storedFileItems.get(fileId);
|
|
150
|
-
const setItems = fileItems => {
|
|
151
|
-
const normalised = normaliseInput(fileItems);
|
|
152
|
-
normalised.forEach(fileItem => storedFileItems.set(fileItem.id, fileItem));
|
|
153
|
-
};
|
|
154
|
-
if (initialFileItems) {
|
|
155
|
-
setItems(initialFileItems);
|
|
156
|
-
}
|
|
157
|
-
const mediaApi = getMediaApi({
|
|
158
|
-
setItems,
|
|
159
|
-
getItem
|
|
160
|
-
});
|
|
161
|
-
return {
|
|
162
|
-
setItems,
|
|
163
|
-
getItem,
|
|
164
|
-
mediaApi
|
|
165
|
-
};
|
|
166
|
-
};
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import uuid from 'uuid/v4';
|
|
2
|
-
// --------------------------------------------------------
|
|
3
|
-
// Factory Utils
|
|
4
|
-
// --------------------------------------------------------
|
|
5
|
-
|
|
6
|
-
export const normaliseInput = input => !input ? [] : input instanceof Array ? input : [input];
|
|
7
|
-
|
|
8
|
-
// --------------------------------------------------------
|
|
9
|
-
// Utils for the main class
|
|
10
|
-
// --------------------------------------------------------
|
|
11
|
-
|
|
12
|
-
export const getMediaFile = fileItem => ({
|
|
13
|
-
id: fileItem.id,
|
|
14
|
-
...fileItem.details
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// --------------------------------------------------------
|
|
18
|
-
// Utils for creating file descriptors for tests
|
|
19
|
-
// --------------------------------------------------------
|
|
20
|
-
|
|
21
|
-
export const createEmptyFileItem = (id, collection) => {
|
|
22
|
-
const emptyFileItem = {
|
|
23
|
-
type: 'file',
|
|
24
|
-
id,
|
|
25
|
-
details: {
|
|
26
|
-
mediaType: 'unknown',
|
|
27
|
-
mimeType: 'binary/octet-stream',
|
|
28
|
-
name: '',
|
|
29
|
-
size: 0,
|
|
30
|
-
processingStatus: 'pending',
|
|
31
|
-
artifacts: {},
|
|
32
|
-
representations: {},
|
|
33
|
-
createdAt: 1699488941974
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
if (collection) {
|
|
37
|
-
emptyFileItem.collection = collection;
|
|
38
|
-
}
|
|
39
|
-
return emptyFileItem;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Simulates the processing of the file by updating the processing status of the artifacts by a percentage
|
|
44
|
-
* Percent must be between 0 and 1
|
|
45
|
-
*/
|
|
46
|
-
export const createProcessingFileItem = (fileItem, percent) => {
|
|
47
|
-
if (percent < 0 || percent > 1) {
|
|
48
|
-
throw new Error('Error createProcessingFileItem: percent must be between 0 and 1');
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* This behaviour has to be confirmed
|
|
53
|
-
* Artifacts show up immediately after processed or they have a
|
|
54
|
-
* "processing time"?
|
|
55
|
-
*/
|
|
56
|
-
|
|
57
|
-
if (percent === 1) {
|
|
58
|
-
return fileItem;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// No artifacts for 0% processing
|
|
62
|
-
if (percent === 0) {
|
|
63
|
-
return {
|
|
64
|
-
...fileItem,
|
|
65
|
-
details: {
|
|
66
|
-
...fileItem.details,
|
|
67
|
-
processingStatus: 'pending',
|
|
68
|
-
artifacts: {},
|
|
69
|
-
// The preview will only be ready at 100% -> TODO verify against backend
|
|
70
|
-
representations: {}
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
const artifactsKeys = Object.keys(fileItem.details.artifacts);
|
|
75
|
-
const artifactsEntries = Object.entries({
|
|
76
|
-
...fileItem.details.artifacts // Spreading to make TS happy
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
// Get a % of the total artifacts to be set as processed
|
|
80
|
-
const processedArtifactKeys = artifactsKeys.slice(0, Math.ceil(artifactsKeys.length * percent));
|
|
81
|
-
const processedArtifactEntries = artifactsEntries.map(([key, artifact]) => [key, {
|
|
82
|
-
...artifact,
|
|
83
|
-
processingStatus: processedArtifactKeys.includes(key) ? 'succeeded' : 'pending'
|
|
84
|
-
}]);
|
|
85
|
-
const artifactsProcessingPercent = Object.fromEntries(processedArtifactEntries);
|
|
86
|
-
return {
|
|
87
|
-
...fileItem,
|
|
88
|
-
details: {
|
|
89
|
-
...fileItem.details,
|
|
90
|
-
processingStatus: 'pending',
|
|
91
|
-
artifacts: artifactsProcessingPercent,
|
|
92
|
-
// The preview will only be ready at 100% -> TODO verify against backend
|
|
93
|
-
representations: {}
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Makes a copy of the provided file item with a random file id
|
|
100
|
-
* */
|
|
101
|
-
export const copy = fileItem => JSON.parse(JSON.stringify(fileItem).replace(new RegExp(fileItem.id, 'g'), uuid()));
|
|
102
|
-
/**
|
|
103
|
-
* Extracts the file identifier from the provided file item
|
|
104
|
-
*/
|
|
105
|
-
export const getIdentifier = fileItem => ({
|
|
106
|
-
mediaItemType: 'file',
|
|
107
|
-
id: fileItem.id,
|
|
108
|
-
collectionName: fileItem.collection
|
|
109
|
-
});
|
|
110
|
-
export const createFileState = ({
|
|
111
|
-
id,
|
|
112
|
-
details: {
|
|
113
|
-
name,
|
|
114
|
-
size,
|
|
115
|
-
mediaType,
|
|
116
|
-
mimeType,
|
|
117
|
-
createdAt,
|
|
118
|
-
processingStatus,
|
|
119
|
-
artifacts,
|
|
120
|
-
representations
|
|
121
|
-
}
|
|
122
|
-
}) => ({
|
|
123
|
-
status: processingStatus === 'succeeded' ? 'processed' : 'processing',
|
|
124
|
-
id,
|
|
125
|
-
name,
|
|
126
|
-
size,
|
|
127
|
-
mediaType,
|
|
128
|
-
mimeType,
|
|
129
|
-
createdAt,
|
|
130
|
-
artifacts,
|
|
131
|
-
representations
|
|
132
|
-
});
|
|
133
|
-
export const createUploadingFileState = ({
|
|
134
|
-
id,
|
|
135
|
-
details: {
|
|
136
|
-
name,
|
|
137
|
-
size,
|
|
138
|
-
mediaType,
|
|
139
|
-
mimeType,
|
|
140
|
-
createdAt
|
|
141
|
-
}
|
|
142
|
-
}, progress, binary) => ({
|
|
143
|
-
status: 'uploading',
|
|
144
|
-
progress,
|
|
145
|
-
id,
|
|
146
|
-
name,
|
|
147
|
-
size,
|
|
148
|
-
mediaType,
|
|
149
|
-
mimeType,
|
|
150
|
-
createdAt,
|
|
151
|
-
preview: {
|
|
152
|
-
value: binary || new Blob(['some-content'], {
|
|
153
|
-
type: mimeType
|
|
154
|
-
})
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
export const createErrorFileState = ({
|
|
158
|
-
id
|
|
159
|
-
}) => ({
|
|
160
|
-
status: 'error',
|
|
161
|
-
id,
|
|
162
|
-
reason: 'a random error',
|
|
163
|
-
message: 'a random error message',
|
|
164
|
-
details: {
|
|
165
|
-
some: 'mocked error detail'
|
|
166
|
-
}
|
|
167
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { defaultCollectionName } from './collectionNames';
|
|
2
|
-
const cachedAuths = {};
|
|
3
|
-
const authProviderBaseURL = 'https://media-playground.dev.atl-paas.net/';
|
|
4
|
-
export class StoryBookAuthProvider {
|
|
5
|
-
static create(isAsapEnvironment, access) {
|
|
6
|
-
const loadTenatAuth = async collectionName => {
|
|
7
|
-
const environment = isAsapEnvironment ? 'asap' : '';
|
|
8
|
-
const headers = new Headers();
|
|
9
|
-
headers.append('Content-Type', 'application/json; charset=utf-8');
|
|
10
|
-
headers.append('Accept', 'text/plain, */*; q=0.01');
|
|
11
|
-
const config = {
|
|
12
|
-
method: 'POST',
|
|
13
|
-
headers,
|
|
14
|
-
body: access ? JSON.stringify({
|
|
15
|
-
access
|
|
16
|
-
}) : undefined
|
|
17
|
-
};
|
|
18
|
-
const url = `${authProviderBaseURL}/token/tenant?collection=${collectionName}&environment=${environment}`;
|
|
19
|
-
const response = fetch(url, config);
|
|
20
|
-
|
|
21
|
-
// We leverage the fact, that our internal /toke/tenant API returns data in the same format as Auth
|
|
22
|
-
return await (await response).json();
|
|
23
|
-
};
|
|
24
|
-
return authContext => {
|
|
25
|
-
const collectionName = authContext && authContext.collectionName || defaultCollectionName;
|
|
26
|
-
const accessStr = access ? JSON.stringify(access) : '';
|
|
27
|
-
const cacheKey = `${collectionName}-${accessStr}-${isAsapEnvironment}`;
|
|
28
|
-
if (!cachedAuths[cacheKey]) {
|
|
29
|
-
cachedAuths[cacheKey] = loadTenatAuth(collectionName);
|
|
30
|
-
}
|
|
31
|
-
return cachedAuths[cacheKey];
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const defaultCollectionName = 'MediaServicesSample';
|
|
2
|
-
export const onlyAnimatedGifsCollectionName = 'only-animated-gifs';
|
|
3
|
-
export const fileCollectionName = `${defaultCollectionName}Files`;
|
|
4
|
-
export const defaultMediaPickerCollectionName = 'mediapicker-test';
|
|
5
|
-
export const collectionNames = [defaultCollectionName, 'MediaServicesSampleAtlaskit', 'MediaServicesSampleHulk', 'MediaServicesSampleFabric', fileCollectionName, onlyAnimatedGifsCollectionName, defaultMediaPickerCollectionName];
|
|
@@ -1,268 +0,0 @@
|
|
|
1
|
-
import { videoURI, videoPreviewURI } from '@atlaskit/media-common/test-helpers';
|
|
2
|
-
import { defaultCollectionName as collectionName, onlyAnimatedGifsCollectionName } from './collectionNames';
|
|
3
|
-
const fileType = 'file';
|
|
4
|
-
|
|
5
|
-
// === FILE ===
|
|
6
|
-
|
|
7
|
-
export const genericFileId = {
|
|
8
|
-
id: '2dfcc12d-04d7-46e7-9fdf-3715ff00ba40',
|
|
9
|
-
mediaItemType: fileType,
|
|
10
|
-
collectionName: collectionName
|
|
11
|
-
};
|
|
12
|
-
export const audioFileId = {
|
|
13
|
-
id: 'a965c8df-1d64-4db8-9de5-16dfa8fd2e12',
|
|
14
|
-
// mp3 audio
|
|
15
|
-
mediaItemType: fileType,
|
|
16
|
-
collectionName: collectionName
|
|
17
|
-
};
|
|
18
|
-
export const audioNoCoverFileId = {
|
|
19
|
-
id: '7a5698bb-919c-4200-8699-6041e7913b11',
|
|
20
|
-
// mp3 audio
|
|
21
|
-
mediaItemType: fileType,
|
|
22
|
-
collectionName: collectionName
|
|
23
|
-
};
|
|
24
|
-
export const videoFileId = {
|
|
25
|
-
id: '1b01a476-83b4-4f44-8192-f83b2d00913a',
|
|
26
|
-
// mp4 video
|
|
27
|
-
mediaItemType: fileType,
|
|
28
|
-
collectionName: collectionName
|
|
29
|
-
};
|
|
30
|
-
export const videoHorizontalFileId = {
|
|
31
|
-
id: '2afaf845-4385-431f-9a15-3e21520cf896',
|
|
32
|
-
// .mov video
|
|
33
|
-
mediaItemType: fileType,
|
|
34
|
-
collectionName: collectionName
|
|
35
|
-
};
|
|
36
|
-
export const videoLargeFileId = {
|
|
37
|
-
id: '3291050e-6b66-4296-94c6-12088ef6fbad',
|
|
38
|
-
mediaItemType: fileType,
|
|
39
|
-
collectionName: collectionName
|
|
40
|
-
};
|
|
41
|
-
export const videoSquareFileId = {
|
|
42
|
-
id: 'cdff20d6-2c0a-4d0d-b2a9-22cc728a0368',
|
|
43
|
-
mediaItemType: fileType,
|
|
44
|
-
collectionName: collectionName
|
|
45
|
-
};
|
|
46
|
-
export const videoProcessingFailedId = {
|
|
47
|
-
id: 'e558199f-f982-4d23-93eb-313be5998d1b',
|
|
48
|
-
mediaItemType: fileType,
|
|
49
|
-
collectionName: collectionName
|
|
50
|
-
};
|
|
51
|
-
export const imageFileId = {
|
|
52
|
-
id: '5556346b-b081-482b-bc4a-4faca8ecd2de',
|
|
53
|
-
// jpg image
|
|
54
|
-
mediaItemType: fileType,
|
|
55
|
-
collectionName: collectionName
|
|
56
|
-
};
|
|
57
|
-
export const emptyImageFileId = {
|
|
58
|
-
id: 'aa7f7a63-2b1a-4405-b585-62e375a3b40a',
|
|
59
|
-
// jpg image
|
|
60
|
-
mediaItemType: fileType,
|
|
61
|
-
collectionName: collectionName
|
|
62
|
-
};
|
|
63
|
-
export const smallImageFileId = {
|
|
64
|
-
id: 'f251bd05-4b2d-485d-a088-57d112ca7945',
|
|
65
|
-
mediaItemType: fileType,
|
|
66
|
-
collectionName: collectionName
|
|
67
|
-
};
|
|
68
|
-
export const wideImageFileId = {
|
|
69
|
-
id: '3b6621a2-5b72-400e-ad95-447610dbb770',
|
|
70
|
-
mediaItemType: fileType,
|
|
71
|
-
collectionName: collectionName
|
|
72
|
-
};
|
|
73
|
-
export const largeImageFileId = {
|
|
74
|
-
id: '0607a6a8-b2ec-49a7-b6d3-d767cb49e844',
|
|
75
|
-
mediaItemType: fileType,
|
|
76
|
-
collectionName: collectionName
|
|
77
|
-
};
|
|
78
|
-
export const verticalImageFileId = {
|
|
79
|
-
id: 'f9235f5a-d582-4740-8611-ebf3feaf28b6',
|
|
80
|
-
mediaItemType: fileType,
|
|
81
|
-
collectionName: collectionName
|
|
82
|
-
};
|
|
83
|
-
export const docFileId = {
|
|
84
|
-
id: '71cd7e7d-4e86-4b89-a0b4-7f6ffe013c94',
|
|
85
|
-
mediaItemType: fileType,
|
|
86
|
-
collectionName: collectionName
|
|
87
|
-
};
|
|
88
|
-
export const bigDocFileId = {
|
|
89
|
-
id: 'd22f7a80-a661-4518-8b0e-eba02b6dfaca',
|
|
90
|
-
mediaItemType: fileType,
|
|
91
|
-
collectionName: collectionName
|
|
92
|
-
};
|
|
93
|
-
export const largePdfFileId = {
|
|
94
|
-
id: '0a510b7f-4168-44d8-b4d7-f5639ecefa2c',
|
|
95
|
-
mediaItemType: fileType,
|
|
96
|
-
collectionName: collectionName
|
|
97
|
-
};
|
|
98
|
-
export const passwordProtectedPdfFileId = {
|
|
99
|
-
id: 'c0e5bfa5-013d-4cbc-9b87-17d7f63bcc30',
|
|
100
|
-
mediaItemType: fileType,
|
|
101
|
-
collectionName: collectionName
|
|
102
|
-
};
|
|
103
|
-
export const codeFileId = {
|
|
104
|
-
id: '4bc95dd5-a7a2-4cbd-ac46-f9b9f0e0941a',
|
|
105
|
-
mediaItemType: fileType,
|
|
106
|
-
collectionName: collectionName
|
|
107
|
-
};
|
|
108
|
-
export const emailFileId = {
|
|
109
|
-
id: '79bb7327-fa6c-4e6f-8a7a-4ebd3607f481',
|
|
110
|
-
mediaItemType: fileType,
|
|
111
|
-
collectionName: collectionName
|
|
112
|
-
};
|
|
113
|
-
export const emailUnsupportedFileId = {
|
|
114
|
-
id: '3a2ae022-212a-4dca-a7d3-86eb016a0ed2',
|
|
115
|
-
mediaItemType: fileType,
|
|
116
|
-
collectionName: collectionName
|
|
117
|
-
};
|
|
118
|
-
export const archiveFileId = {
|
|
119
|
-
id: '1abbae6b-f507-4b4f-b181-21016bf3b7cc',
|
|
120
|
-
mediaItemType: fileType,
|
|
121
|
-
collectionName: collectionName
|
|
122
|
-
};
|
|
123
|
-
export const zipJiraArchiveFileId = {
|
|
124
|
-
id: 'aa99969c-6f0e-4cdc-8a57-9d38c43b2af8',
|
|
125
|
-
mediaItemType: fileType,
|
|
126
|
-
collectionName: collectionName
|
|
127
|
-
};
|
|
128
|
-
export const zipFileWithNestedFolderId = {
|
|
129
|
-
id: 'd1730520-316c-482a-a8c8-2b34acbea00b',
|
|
130
|
-
mediaItemType: fileType,
|
|
131
|
-
collectionName: collectionName
|
|
132
|
-
};
|
|
133
|
-
export const zipFileId = {
|
|
134
|
-
id: '3822aff2-9297-4ad9-93fd-ab1709f400ad',
|
|
135
|
-
mediaItemType: fileType,
|
|
136
|
-
collectionName: collectionName
|
|
137
|
-
};
|
|
138
|
-
export const zipItemMultipleFoldersAtRootId = {
|
|
139
|
-
id: 'b2c4623b-bd84-4d90-a2ed-61d50b0bd5f4',
|
|
140
|
-
mediaItemType: fileType,
|
|
141
|
-
collectionName: collectionName
|
|
142
|
-
};
|
|
143
|
-
export const zipItemLargeInnerFileId = {
|
|
144
|
-
id: '36b7957c-2d73-4cd5-8541-103daa2619ce',
|
|
145
|
-
mediaItemType: fileType,
|
|
146
|
-
collectionName: collectionName
|
|
147
|
-
};
|
|
148
|
-
export const zipEncryptedFileId = {
|
|
149
|
-
id: 'd1569d0f-936d-46f3-b974-a285696016c0',
|
|
150
|
-
mediaItemType: fileType,
|
|
151
|
-
collectionName: collectionName
|
|
152
|
-
};
|
|
153
|
-
export const unknownFileId = {
|
|
154
|
-
id: 'e0652e68-c596-4800-8a91-1920e6b8a585',
|
|
155
|
-
mediaItemType: fileType,
|
|
156
|
-
collectionName: collectionName
|
|
157
|
-
};
|
|
158
|
-
export const errorFileId = {
|
|
159
|
-
id: 'error-file-id',
|
|
160
|
-
mediaItemType: fileType,
|
|
161
|
-
collectionName: collectionName
|
|
162
|
-
};
|
|
163
|
-
export const gifFileId = {
|
|
164
|
-
id: '26adc5af-3af4-42a8-9c24-62b6ce0f9369',
|
|
165
|
-
mediaItemType: fileType,
|
|
166
|
-
collectionName: collectionName
|
|
167
|
-
};
|
|
168
|
-
export const noMetadataFileId = {
|
|
169
|
-
id: '1adaf6f9-37f6-4171-ab6b-455ec3115381',
|
|
170
|
-
mediaItemType: fileType,
|
|
171
|
-
collectionName: collectionName
|
|
172
|
-
};
|
|
173
|
-
export const animatedFileId = {
|
|
174
|
-
id: 'af637c7a-75c3-4254-b074-d16e6ae2e04b',
|
|
175
|
-
mediaItemType: fileType,
|
|
176
|
-
collectionName: onlyAnimatedGifsCollectionName
|
|
177
|
-
};
|
|
178
|
-
// === EXTERNAL IMAGE ===
|
|
179
|
-
|
|
180
|
-
export const atlassianLogoUrl = 'https://wac-cdn.atlassian.com/assets/img/favicons/atlassian/apple-touch-icon-152x152.png';
|
|
181
|
-
export const externalImageIdentifier = {
|
|
182
|
-
mediaItemType: 'external-image',
|
|
183
|
-
dataURI: atlassianLogoUrl
|
|
184
|
-
};
|
|
185
|
-
export const externalSmallImageIdentifier = {
|
|
186
|
-
mediaItemType: 'external-image',
|
|
187
|
-
dataURI: 'https://aui-cdn.atlassian.com/media/files-icon.png'
|
|
188
|
-
};
|
|
189
|
-
export const externaBrokenlIdentifier = {
|
|
190
|
-
mediaItemType: 'external-image',
|
|
191
|
-
dataURI: 'https://some-uri'
|
|
192
|
-
};
|
|
193
|
-
export const genericFileDetails = {
|
|
194
|
-
id: 'fd4c4672-323a-4b6c-8326-223169e2a13e',
|
|
195
|
-
mediaType: 'image',
|
|
196
|
-
mimeType: 'image/gif',
|
|
197
|
-
name: 'picker-thread-leaking.gif',
|
|
198
|
-
size: 2958464,
|
|
199
|
-
processingStatus: 'succeeded',
|
|
200
|
-
artifacts: {
|
|
201
|
-
'thumb_320.jpg': {
|
|
202
|
-
url: '/file/fd4c4672-323a-4b6c-8326-223169e2a13e/artifact/thumb_320.jpg/binary',
|
|
203
|
-
processingStatus: 'succeeded'
|
|
204
|
-
},
|
|
205
|
-
'thumb_large.jpg': {
|
|
206
|
-
url: '/file/fd4c4672-323a-4b6c-8326-223169e2a13e/artifact/thumb_320.jpg/binary',
|
|
207
|
-
processingStatus: 'succeeded'
|
|
208
|
-
},
|
|
209
|
-
'thumb_120.jpg': {
|
|
210
|
-
url: '/file/fd4c4672-323a-4b6c-8326-223169e2a13e/artifact/thumb_120.jpg/binary',
|
|
211
|
-
processingStatus: 'succeeded'
|
|
212
|
-
},
|
|
213
|
-
'thumb.jpg': {
|
|
214
|
-
url: '/file/fd4c4672-323a-4b6c-8326-223169e2a13e/artifact/thumb_120.jpg/binary',
|
|
215
|
-
processingStatus: 'succeeded'
|
|
216
|
-
},
|
|
217
|
-
'meta.json': {
|
|
218
|
-
url: '/file/fd4c4672-323a-4b6c-8326-223169e2a13e/artifact/meta.json/binary',
|
|
219
|
-
processingStatus: 'succeeded'
|
|
220
|
-
},
|
|
221
|
-
'image.jpg': {
|
|
222
|
-
url: '/file/fd4c4672-323a-4b6c-8326-223169e2a13e/artifact/image.jpg/binary',
|
|
223
|
-
processingStatus: 'succeeded'
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
export const imageFileDetails = {
|
|
228
|
-
id: 'some-id',
|
|
229
|
-
mediaType: 'image',
|
|
230
|
-
name: 'image_file.jpg',
|
|
231
|
-
size: 2958464
|
|
232
|
-
};
|
|
233
|
-
export const videoFileDetails = {
|
|
234
|
-
id: 'some-id',
|
|
235
|
-
mediaType: 'video',
|
|
236
|
-
name: 'video_file.mp4',
|
|
237
|
-
size: 29584640
|
|
238
|
-
};
|
|
239
|
-
export const audioFileDetails = {
|
|
240
|
-
id: 'some-id',
|
|
241
|
-
mediaType: 'audio',
|
|
242
|
-
name: 'audio_file.mp3',
|
|
243
|
-
size: 2958464
|
|
244
|
-
};
|
|
245
|
-
export const docFileDetails = {
|
|
246
|
-
id: 'some-id',
|
|
247
|
-
mediaType: 'doc',
|
|
248
|
-
name: 'doc_file.pdf',
|
|
249
|
-
size: 2958464
|
|
250
|
-
};
|
|
251
|
-
export const unknownFileDetails = {
|
|
252
|
-
id: 'some-id',
|
|
253
|
-
mediaType: 'unknown',
|
|
254
|
-
name: 'doc_file.pdf',
|
|
255
|
-
size: 2958464
|
|
256
|
-
};
|
|
257
|
-
export const genericDataURI = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAZABkAAD/4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABkAAAAAQAAAGQAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAAKgAwAEAAAAAQAAAAIAAAAA/+0AOFBob3Rvc2hvcCAzLjAAOEJJTQQEAAAAAAAAOEJJTQQlAAAAAAAQ1B2M2Y8AsgTpgAmY7PhCfv/AABEIAAIAAgMBEQACEQEDEQH/xAAfAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgv/xAC1EAACAQMDAgQDBQUEBAAAAX0BAgMABBEFEiExQQYTUWEHInEUMoGRoQgjQrHBFVLR8CQzYnKCCQoWFxgZGiUmJygpKjQ1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4eLj5OXm5+jp6vHy8/T19vf4+fr/xAAfAQADAQEBAQEBAQEBAAAAAAAAAQIDBAUGBwgJCgv/xAC1EQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAQECAQEBAgICAgICAgICAQICAgICAgICAgL/2wBDAQEBAQEBAQEBAQECAQEBAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgL/3QAEAAH/2gAMAwEAAhEDEQA/AP0U8M2NmPDfh8C0tgBomkgAW8OAPsFvwK/lh7s+5u+/4n//2Q==';
|
|
258
|
-
|
|
259
|
-
// === VR test ids ===
|
|
260
|
-
|
|
261
|
-
export const vrVideoDetails = {
|
|
262
|
-
id: '0c3c64b9-65ad-4592-89d0-f838beebd81e',
|
|
263
|
-
name: 'video.mp4',
|
|
264
|
-
dataUri: videoURI,
|
|
265
|
-
previewDataUri: videoPreviewURI,
|
|
266
|
-
mediaType: 'video',
|
|
267
|
-
mimeType: 'video/mp4'
|
|
268
|
-
};
|