@atlaskit/media-client 23.1.3 → 24.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 +23 -0
- package/dist/cjs/client/file-fetcher/index.js +112 -36
- package/dist/cjs/client/media-client.js +18 -6
- package/dist/cjs/client/media-store/index.js +3 -4
- package/dist/cjs/client/mobile-upload.js +38 -2
- package/dist/cjs/index.js +7 -0
- package/dist/cjs/models/file-state.js +2 -2
- package/dist/cjs/test-helpers/_numbers.js +9 -0
- package/dist/cjs/test-helpers/authProvider.js +71 -0
- package/dist/cjs/test-helpers/collectionNames.js +16 -0
- package/dist/cjs/test-helpers/exampleMediaItems.js +317 -0
- package/dist/cjs/test-helpers/fakeMediaClient.js +77 -0
- package/dist/cjs/test-helpers/index.js +374 -0
- package/dist/cjs/test-helpers/mediaClientProvider.js +60 -0
- package/dist/cjs/test-helpers/mediaPickerAuthProvider.js +95 -0
- package/dist/cjs/utils/createFileDataLoader.js +2 -2
- package/dist/cjs/utils/mobileUpload/stateMachine/states/uploading.js +2 -2
- package/dist/cjs/utils/polling/index.js +2 -2
- package/dist/cjs/utils/request/helpers.js +2 -2
- package/dist/cjs/utils/url.js +2 -2
- package/dist/cjs/utils/with-media-client-hoc.js +8 -16
- package/dist/es2019/client/file-fetcher/index.js +101 -28
- package/dist/es2019/client/media-client.js +15 -7
- package/dist/es2019/client/media-store/index.js +1 -2
- package/dist/es2019/client/mobile-upload.js +33 -2
- package/dist/es2019/index.js +1 -0
- package/dist/es2019/test-helpers/_numbers.js +3 -0
- package/dist/es2019/test-helpers/authProvider.js +34 -0
- package/dist/es2019/test-helpers/collectionNames.js +5 -0
- package/dist/es2019/test-helpers/exampleMediaItems.js +268 -0
- package/dist/es2019/test-helpers/fakeMediaClient.js +63 -0
- package/dist/es2019/test-helpers/index.js +7 -0
- package/dist/es2019/test-helpers/mediaClientProvider.js +42 -0
- package/dist/es2019/test-helpers/mediaPickerAuthProvider.js +56 -0
- package/dist/es2019/utils/with-media-client-hoc.js +8 -16
- package/dist/esm/client/file-fetcher/index.js +108 -32
- package/dist/esm/client/media-client.js +19 -7
- package/dist/esm/client/media-store/index.js +3 -4
- package/dist/esm/client/mobile-upload.js +38 -2
- package/dist/esm/index.js +1 -0
- package/dist/esm/models/file-state.js +2 -2
- package/dist/esm/test-helpers/_numbers.js +3 -0
- package/dist/esm/test-helpers/authProvider.js +63 -0
- package/dist/esm/test-helpers/collectionNames.js +5 -0
- package/dist/esm/test-helpers/exampleMediaItems.js +268 -0
- package/dist/esm/test-helpers/fakeMediaClient.js +69 -0
- package/dist/esm/test-helpers/index.js +7 -0
- package/dist/esm/test-helpers/mediaClientProvider.js +48 -0
- package/dist/esm/test-helpers/mediaPickerAuthProvider.js +85 -0
- package/dist/esm/utils/createFileDataLoader.js +2 -2
- package/dist/esm/utils/mobileUpload/stateMachine/states/uploading.js +2 -2
- package/dist/esm/utils/polling/index.js +2 -2
- package/dist/esm/utils/request/helpers.js +2 -2
- package/dist/esm/utils/url.js +2 -2
- package/dist/esm/utils/with-media-client-hoc.js +8 -16
- package/dist/types/client/events.d.ts +1 -1
- package/dist/types/client/file-fetcher/index.d.ts +10 -6
- package/dist/types/client/media-client.d.ts +10 -5
- package/dist/types/client/media-store/index.d.ts +3 -4
- package/dist/types/client/mobile-upload.d.ts +6 -2
- package/dist/types/file-streams-cache.d.ts +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/models/artifacts.d.ts +1 -11
- package/dist/types/models/file-state.d.ts +4 -73
- package/dist/types/models/media.d.ts +1 -1
- package/dist/types/models/mobile-upload.d.ts +1 -1
- package/dist/types/test-helpers/_numbers.d.ts +1 -0
- package/dist/types/test-helpers/authProvider.d.ts +6 -0
- package/dist/types/test-helpers/collectionNames.d.ts +5 -0
- package/dist/types/test-helpers/exampleMediaItems.d.ts +53 -0
- package/dist/types/test-helpers/fakeMediaClient.d.ts +4 -0
- package/dist/types/test-helpers/index.d.ts +7 -0
- package/dist/types/test-helpers/mediaClientProvider.d.ts +23 -0
- package/dist/types/test-helpers/mediaPickerAuthProvider.d.ts +5 -0
- package/dist/types/utils/createMediaSubject.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/fromObservable.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/toPromise.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/types.d.ts +1 -1
- package/dist/types/utils/mobileUpload/helpers.d.ts +1 -1
- package/dist/types/utils/mobileUpload/stateMachine/index.d.ts +1 -1
- package/dist/types/utils/mobileUpload/stateMachine/types.d.ts +1 -1
- package/dist/types/utils/overrideMediaTypeIfUnknown.d.ts +1 -1
- package/dist/types/utils/shouldFetchRemoteFileStates.d.ts +1 -1
- package/dist/types/utils/with-media-client-hoc.d.ts +2 -3
- package/dist/types-ts4.5/client/events.d.ts +1 -1
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +10 -6
- package/dist/types-ts4.5/client/media-client.d.ts +10 -5
- package/dist/types-ts4.5/client/media-store/index.d.ts +3 -4
- package/dist/types-ts4.5/client/mobile-upload.d.ts +6 -2
- package/dist/types-ts4.5/file-streams-cache.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +4 -2
- package/dist/types-ts4.5/models/artifacts.d.ts +1 -11
- package/dist/types-ts4.5/models/file-state.d.ts +4 -73
- package/dist/types-ts4.5/models/media.d.ts +1 -1
- package/dist/types-ts4.5/models/mobile-upload.d.ts +1 -1
- package/dist/types-ts4.5/test-helpers/_numbers.d.ts +1 -0
- package/dist/types-ts4.5/test-helpers/authProvider.d.ts +6 -0
- package/dist/types-ts4.5/test-helpers/collectionNames.d.ts +5 -0
- package/dist/types-ts4.5/test-helpers/exampleMediaItems.d.ts +53 -0
- package/dist/types-ts4.5/test-helpers/fakeMediaClient.d.ts +4 -0
- package/dist/types-ts4.5/test-helpers/index.d.ts +7 -0
- package/dist/types-ts4.5/test-helpers/mediaClientProvider.d.ts +23 -0
- package/dist/types-ts4.5/test-helpers/mediaPickerAuthProvider.d.ts +5 -0
- package/dist/types-ts4.5/utils/createMediaSubject.d.ts +1 -1
- package/dist/types-ts4.5/utils/mediaSubscribable/fromObservable.d.ts +1 -1
- package/dist/types-ts4.5/utils/mediaSubscribable/toPromise.d.ts +1 -1
- package/dist/types-ts4.5/utils/mediaSubscribable/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/mobileUpload/helpers.d.ts +1 -1
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/overrideMediaTypeIfUnknown.d.ts +1 -1
- package/dist/types-ts4.5/utils/shouldFetchRemoteFileStates.d.ts +1 -1
- package/dist/types-ts4.5/utils/with-media-client-hoc.d.ts +2 -3
- package/package.json +13 -4
- package/report.api.md +52 -162
- package/tmp/api-report-tmp.d.ts +51 -154
- package/dist/cjs/version.json +0 -5
- package/dist/es2019/version.json +0 -5
- package/dist/esm/version.json +0 -5
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MediaClient } from '../';
|
|
2
|
+
import { asMock, getJest } from '@atlaskit/media-common/test-helpers';
|
|
3
|
+
const jest = getJest();
|
|
4
|
+
export const getDefaultMediaClientConfig = () => ({
|
|
5
|
+
authProvider: jest.fn().mockReturnValue(Promise.resolve({
|
|
6
|
+
clientId: 'some-client-id',
|
|
7
|
+
token: 'some-token',
|
|
8
|
+
baseUrl: 'some-service-host'
|
|
9
|
+
}))
|
|
10
|
+
});
|
|
11
|
+
export const fakeMediaClient = (config = getDefaultMediaClientConfig()) => {
|
|
12
|
+
if (jest && jest.genMockFromModule) {
|
|
13
|
+
const {
|
|
14
|
+
MediaClient: MockMediaClient,
|
|
15
|
+
FileFetcherImpl,
|
|
16
|
+
MediaStore: MockMediaStore,
|
|
17
|
+
StargateClient
|
|
18
|
+
} = jest.genMockFromModule('@atlaskit/media-client');
|
|
19
|
+
const mediaClient = new MockMediaClient();
|
|
20
|
+
const fileFetcher = new FileFetcherImpl();
|
|
21
|
+
const mockMediaStore = new MockMediaStore({
|
|
22
|
+
authProvider: config.authProvider
|
|
23
|
+
});
|
|
24
|
+
const stargateClient = new StargateClient();
|
|
25
|
+
mediaClient.file = fileFetcher;
|
|
26
|
+
mediaClient.stargate = stargateClient;
|
|
27
|
+
mediaClient.config = config; // <- deprecated
|
|
28
|
+
mediaClient.mediaClientConfig = config;
|
|
29
|
+
mediaClient.mediaStore = mockMediaStore;
|
|
30
|
+
mediaClient.mediaStore.getItems = jest.fn().mockResolvedValue({
|
|
31
|
+
data: {
|
|
32
|
+
items: []
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
asMock(mediaClient.getImageUrl).mockResolvedValue('some-image-url');
|
|
36
|
+
asMock(mediaClient.getImageUrlSync).mockReturnValue('some-image-url');
|
|
37
|
+
asMock(mediaClient.getImage).mockImplementation(mockMediaStore.getImage);
|
|
38
|
+
asMock(mediaClient.file.copyFile).mockReturnValue({
|
|
39
|
+
id: 'copied-file-id'
|
|
40
|
+
});
|
|
41
|
+
asMock(mediaClient.file.getCurrentState).mockReturnValue(Promise.resolve({
|
|
42
|
+
id: 'file-id',
|
|
43
|
+
status: 'processed',
|
|
44
|
+
mediaType: 'image',
|
|
45
|
+
name: 'file_name'
|
|
46
|
+
}));
|
|
47
|
+
asMock(mediaClient.file.getFileState).mockImplementation(() => ({
|
|
48
|
+
subscribe: jest.fn()
|
|
49
|
+
}));
|
|
50
|
+
asMock(mediaClient.stargate.fetchToken).mockImplementation(() => Promise.resolve({
|
|
51
|
+
data: {
|
|
52
|
+
clientId: 'some-client-id-from-smart-edge',
|
|
53
|
+
token: 'some-token-from-smart-edge',
|
|
54
|
+
baseUrl: 'some-base-url-from-smart-edge',
|
|
55
|
+
expiresIn: 34000,
|
|
56
|
+
iat: new Date().getTime() / 1000
|
|
57
|
+
}
|
|
58
|
+
}));
|
|
59
|
+
return mediaClient;
|
|
60
|
+
} else {
|
|
61
|
+
return new MediaClient(config);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { StoryBookAuthProvider } from './authProvider';
|
|
2
|
+
export { createStorybookMediaClient, createStorybookMediaClientConfig, createUploadMediaClient, createUploadMediaClientConfig, defaultBaseUrl, defaultParams } from './mediaClientProvider';
|
|
3
|
+
export { collectionNames, defaultCollectionName, defaultMediaPickerCollectionName, fileCollectionName, onlyAnimatedGifsCollectionName } from './collectionNames';
|
|
4
|
+
export { animatedFileId, archiveFileId, atlassianLogoUrl, audioFileDetails, audioFileId, audioNoCoverFileId, bigDocFileId, docFileDetails, docFileId, emptyImageFileId, errorFileId, externalImageIdentifier, externalSmallImageIdentifier, externaBrokenlIdentifier, genericDataURI, genericFileDetails, genericFileId, gifFileId, imageFileDetails, imageFileId, largeImageFileId, largePdfFileId, noMetadataFileId, passwordProtectedPdfFileId, smallImageFileId, unknownFileDetails, unknownFileId, verticalImageFileId, videoFileDetails, videoFileId, videoHorizontalFileId, videoLargeFileId, videoProcessingFailedId, videoSquareFileId, wideImageFileId, zipFileId, zipFileWithNestedFolderId, zipItemLargeInnerFileId, zipItemMultipleFoldersAtRootId, zipJiraArchiveFileId, zipEncryptedFileId, codeFileId, emailFileId, emailUnsupportedFileId, vrVideoDetails } from './exampleMediaItems';
|
|
5
|
+
export const authProviderBaseURL = 'https://media.dev.atl-paas.net';
|
|
6
|
+
export { mediaPickerAuthProvider, defaultMediaPickerAuthProvider } from './mediaPickerAuthProvider';
|
|
7
|
+
export { fakeMediaClient } from './fakeMediaClient';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { MediaClient } from '../';
|
|
2
|
+
import { StoryBookAuthProvider } from './authProvider';
|
|
3
|
+
import { collectionNames } from './collectionNames';
|
|
4
|
+
import { mediaPickerAuthProvider } from './mediaPickerAuthProvider';
|
|
5
|
+
export const defaultBaseUrl = 'https://media.dev.atl-paas.net';
|
|
6
|
+
export const defaultParams = {
|
|
7
|
+
clientId: '5a9812fc-d029-4a39-8a46-d3cc36eed7ab',
|
|
8
|
+
asapIssuer: 'micros/media-playground',
|
|
9
|
+
baseUrl: defaultBaseUrl
|
|
10
|
+
};
|
|
11
|
+
const defaultAuthParameter = {
|
|
12
|
+
authType: 'client'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Creates and returns `MediaClient` (from `media-client`) based on the data provided in parameter object.
|
|
17
|
+
*
|
|
18
|
+
* @param {AuthParameter} authParameter specifies serviceName and whatever auth should be done with clientId or asapIssuer
|
|
19
|
+
* @returns {Context}
|
|
20
|
+
*/
|
|
21
|
+
export const createStorybookMediaClient = (authParameter = defaultAuthParameter) => {
|
|
22
|
+
return new MediaClient(createStorybookMediaClientConfig(authParameter));
|
|
23
|
+
};
|
|
24
|
+
export const createStorybookMediaClientConfig = (authParameter = defaultAuthParameter) => {
|
|
25
|
+
const scopes = {
|
|
26
|
+
'urn:filestore:file:*': ['read'],
|
|
27
|
+
'urn:filestore:chunk:*': ['read']
|
|
28
|
+
};
|
|
29
|
+
collectionNames.forEach(c => {
|
|
30
|
+
scopes[`urn:filestore:collection:${c}`] = ['read', 'update'];
|
|
31
|
+
});
|
|
32
|
+
const isAsapEnvironment = authParameter.authType === 'asap';
|
|
33
|
+
const authProvider = StoryBookAuthProvider.create(isAsapEnvironment, scopes);
|
|
34
|
+
return {
|
|
35
|
+
authProvider
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export const createUploadMediaClient = () => new MediaClient(createUploadMediaClientConfig());
|
|
39
|
+
export const createUploadMediaClientConfig = (stargateBaseUrl, env) => ({
|
|
40
|
+
authProvider: mediaPickerAuthProvider('asap', env),
|
|
41
|
+
stargateBaseUrl
|
|
42
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { defaultCollectionName } from './collectionNames';
|
|
2
|
+
export const authProviderBaseURL = 'https://media.dev.atl-paas.net';
|
|
3
|
+
const cachedAuths = {};
|
|
4
|
+
const accessUrns = {
|
|
5
|
+
MediaServicesSample: {
|
|
6
|
+
'urn:filestore:collection:MediaServicesSample': ['read', 'insert'],
|
|
7
|
+
'urn:filestore:chunk:*': ['create', 'read'],
|
|
8
|
+
'urn:filestore:upload': ['create'],
|
|
9
|
+
'urn:filestore:upload:*': ['read', 'update'],
|
|
10
|
+
'urn:filestore:file': ['create'],
|
|
11
|
+
'urn:filestore:file:*': ['read', 'update']
|
|
12
|
+
},
|
|
13
|
+
'mediapicker-test': {
|
|
14
|
+
'urn:filestore:collection': ['create'],
|
|
15
|
+
'urn:filestore:collection:mediapicker-test': ['read', 'insert'],
|
|
16
|
+
'urn:filestore:chunk:*': ['create', 'read'],
|
|
17
|
+
'urn:filestore:upload': ['create'],
|
|
18
|
+
'urn:filestore:upload:*': ['read', 'update'],
|
|
19
|
+
'urn:filestore:file': ['create'],
|
|
20
|
+
'urn:filestore:file:*': ['read', 'update']
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
const requestAuthProvider = async (authEnvironment, collectionName, env = 'dev') => {
|
|
24
|
+
const url = `https://media-playground.${env}.atl-paas.net/token/tenant?environment=${authEnvironment}`;
|
|
25
|
+
const body = JSON.stringify({
|
|
26
|
+
access: accessUrns[collectionName] || {}
|
|
27
|
+
});
|
|
28
|
+
const headers = new Headers();
|
|
29
|
+
headers.append('Content-Type', 'application/json; charset=utf-8');
|
|
30
|
+
headers.append('Accept', 'text/plain, */*; q=0.01');
|
|
31
|
+
const response = await fetch(url, {
|
|
32
|
+
method: 'POST',
|
|
33
|
+
body,
|
|
34
|
+
headers
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// We leverage the fact, that our internal /toke/tenant API returns data in the same format as Auth
|
|
38
|
+
return response.json();
|
|
39
|
+
};
|
|
40
|
+
export const mediaPickerAuthProvider = (authEnvironment = 'asap', env) => context => {
|
|
41
|
+
const collectionName = context && context.collectionName || defaultCollectionName;
|
|
42
|
+
authEnvironment = authEnvironment === 'asap' ? 'asap' : '';
|
|
43
|
+
const cacheKey = `${collectionName}:${authEnvironment}`;
|
|
44
|
+
if (!cachedAuths[cacheKey]) {
|
|
45
|
+
cachedAuths[cacheKey] = requestAuthProvider(authEnvironment, collectionName, env);
|
|
46
|
+
}
|
|
47
|
+
return cachedAuths[cacheKey];
|
|
48
|
+
};
|
|
49
|
+
export const defaultMediaPickerAuthProvider = () => () => {
|
|
50
|
+
const auth = {
|
|
51
|
+
clientId: 'a89be2a1-f91f-485c-9962-a8fb25ccfa13',
|
|
52
|
+
token: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhODliZTJhMS1mOTFmLTQ4NWMtOTk2Mi1hOGZiMjVjY2ZhMTMiLCJ1bnNhZmUiOnRydWUsImlhdCI6MTQ3MzIyNTEzNn0.6Isj5jKgKzWDnPqfoMLiC_LVIlGM8kg_wxG6eGGwhTw',
|
|
53
|
+
baseUrl: authProviderBaseURL
|
|
54
|
+
};
|
|
55
|
+
return Promise.resolve(auth);
|
|
56
|
+
};
|
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { MediaClient } from '../client/media-client';
|
|
4
|
-
const NO_FLAGS = 'NO_FLAGS';
|
|
5
4
|
const mediaClientsMap = new Map();
|
|
6
|
-
export const getMediaClient =
|
|
7
|
-
|
|
8
|
-
const flagsMapKey = featureFlags || NO_FLAGS;
|
|
9
|
-
let mediaClient = (_mediaClientsMap$get = mediaClientsMap.get(mediaClientConfig)) === null || _mediaClientsMap$get === void 0 ? void 0 : _mediaClientsMap$get.get(flagsMapKey);
|
|
5
|
+
export const getMediaClient = mediaClientConfig => {
|
|
6
|
+
let mediaClient = mediaClientsMap.get(mediaClientConfig);
|
|
10
7
|
if (!mediaClient) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
subMap = new Map();
|
|
14
|
-
mediaClientsMap.set(mediaClientConfig, subMap);
|
|
15
|
-
}
|
|
16
|
-
mediaClient = new MediaClient(mediaClientConfig, featureFlags);
|
|
17
|
-
subMap.set(flagsMapKey, mediaClient);
|
|
8
|
+
mediaClient = new MediaClient(mediaClientConfig);
|
|
9
|
+
mediaClientsMap.set(mediaClientConfig, mediaClient);
|
|
18
10
|
}
|
|
19
11
|
return mediaClient;
|
|
20
12
|
};
|
|
21
|
-
const createEmptyMediaClient =
|
|
13
|
+
const createEmptyMediaClient = () => {
|
|
22
14
|
const emptyConfig = {
|
|
23
15
|
authProvider: () => Promise.resolve({
|
|
24
16
|
clientId: '',
|
|
@@ -26,9 +18,9 @@ const createEmptyMediaClient = featureFlags => {
|
|
|
26
18
|
baseUrl: ''
|
|
27
19
|
})
|
|
28
20
|
};
|
|
29
|
-
return new MediaClient(emptyConfig
|
|
21
|
+
return new MediaClient(emptyConfig);
|
|
30
22
|
};
|
|
31
|
-
export const withMediaClient =
|
|
23
|
+
export const withMediaClient = Component => {
|
|
32
24
|
return class extends React.Component {
|
|
33
25
|
render() {
|
|
34
26
|
// TODO MPT-315: clean up after we move mediaClientConfig into FileIdentifier
|
|
@@ -36,7 +28,7 @@ export const withMediaClient = (Component, featureFlags) => {
|
|
|
36
28
|
mediaClientConfig,
|
|
37
29
|
...otherProps
|
|
38
30
|
} = this.props;
|
|
39
|
-
const mediaClient = !mediaClientConfig ? createEmptyMediaClient(
|
|
31
|
+
const mediaClient = !mediaClientConfig ? createEmptyMediaClient() : getMediaClient(mediaClientConfig);
|
|
40
32
|
return /*#__PURE__*/React.createElement(Component, _extends({}, otherProps, {
|
|
41
33
|
mediaClient: mediaClient
|
|
42
34
|
}));
|
|
@@ -2,8 +2,8 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
-
function ownKeys(
|
|
6
|
-
function _objectSpread(
|
|
5
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
6
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7
7
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
8
8
|
import { Subscription } from 'rxjs/Subscription';
|
|
9
9
|
import { map } from 'rxjs/operators/map';
|
|
@@ -13,7 +13,7 @@ import uuid from 'uuid/v4';
|
|
|
13
13
|
import 'setimmediate';
|
|
14
14
|
import { authToOwner } from '@atlaskit/media-core';
|
|
15
15
|
import { downloadUrl } from '@atlaskit/media-common/downloadUrl';
|
|
16
|
-
import { MediaStore } from '../media-store';
|
|
16
|
+
import { MediaStore as MediaApi } from '../media-store';
|
|
17
17
|
import { isErrorFileState, isFinalFileState, isProcessingFileState, mapMediaFileToFileState, mapMediaItemToFileState } from '../../models/file-state';
|
|
18
18
|
import { FileFetcherError } from './error';
|
|
19
19
|
import { uploadFile } from '../../uploader';
|
|
@@ -32,11 +32,34 @@ import { isMimeTypeSupportedByBrowser, getMediaTypeFromMimeType } from '@atlaski
|
|
|
32
32
|
import { shouldFetchRemoteFileStates } from '../../utils/shouldFetchRemoteFileStates';
|
|
33
33
|
import { PollingFunction } from '../../utils/polling';
|
|
34
34
|
import { isEmptyFile } from '../../utils/detectEmptyFile';
|
|
35
|
+
import { mediaStore } from '@atlaskit/media-state';
|
|
35
36
|
export { isFileFetcherError, FileFetcherError } from './error';
|
|
36
37
|
export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
37
|
-
function FileFetcherImpl(
|
|
38
|
+
function FileFetcherImpl(mediaApi) {
|
|
38
39
|
var _this = this;
|
|
40
|
+
var store = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : mediaStore;
|
|
39
41
|
_classCallCheck(this, FileFetcherImpl);
|
|
42
|
+
_defineProperty(this, "getErrorFileState", function (error, id, occurrenceKey) {
|
|
43
|
+
return typeof error === 'string' ? {
|
|
44
|
+
status: 'error',
|
|
45
|
+
id: id,
|
|
46
|
+
reason: error,
|
|
47
|
+
occurrenceKey: occurrenceKey,
|
|
48
|
+
message: error
|
|
49
|
+
} : {
|
|
50
|
+
status: 'error',
|
|
51
|
+
id: id,
|
|
52
|
+
reason: error === null || error === void 0 ? void 0 : error.reason,
|
|
53
|
+
details: error === null || error === void 0 ? void 0 : error.attributes,
|
|
54
|
+
occurrenceKey: occurrenceKey,
|
|
55
|
+
message: error === null || error === void 0 ? void 0 : error.message
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
_defineProperty(this, "setFileState", function (id, fileState) {
|
|
59
|
+
_this.store.setState(function (state) {
|
|
60
|
+
state.files[id] = fileState;
|
|
61
|
+
});
|
|
62
|
+
});
|
|
40
63
|
// TODO: ----- ADD TICKET TO PASS TRACE ID to this.dataloader.load
|
|
41
64
|
_defineProperty(this, "createDownloadFileStream", function (id, collectionName, occurrenceKey) {
|
|
42
65
|
var subject = createMediaSubject();
|
|
@@ -131,8 +154,9 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
131
154
|
preview: preview
|
|
132
155
|
};
|
|
133
156
|
});
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
157
|
+
this.mediaApi = mediaApi;
|
|
158
|
+
this.store = store;
|
|
159
|
+
this.dataloader = createFileDataloader(mediaApi);
|
|
136
160
|
}
|
|
137
161
|
_createClass(FileFetcherImpl, [{
|
|
138
162
|
key: "getFileState",
|
|
@@ -143,14 +167,34 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
143
167
|
occurrenceKey = options.occurrenceKey;
|
|
144
168
|
if (!isValidId(id)) {
|
|
145
169
|
var subject = createMediaSubject();
|
|
146
|
-
|
|
170
|
+
var err = new FileFetcherError('invalidFileId', id, {
|
|
147
171
|
collectionName: collectionName,
|
|
148
172
|
occurrenceKey: occurrenceKey
|
|
149
|
-
})
|
|
173
|
+
});
|
|
174
|
+
var errorFileState = {
|
|
175
|
+
status: 'error',
|
|
176
|
+
id: id,
|
|
177
|
+
reason: err === null || err === void 0 ? void 0 : err.reason,
|
|
178
|
+
message: err === null || err === void 0 ? void 0 : err.message,
|
|
179
|
+
occurrenceKey: occurrenceKey,
|
|
180
|
+
details: err === null || err === void 0 ? void 0 : err.attributes
|
|
181
|
+
};
|
|
182
|
+
subject.error(err);
|
|
183
|
+
this.setFileState(id, errorFileState);
|
|
150
184
|
return fromObservable(subject);
|
|
151
185
|
}
|
|
152
186
|
return fromObservable(getFileStreamsCache().getOrInsert(id, function () {
|
|
153
|
-
|
|
187
|
+
var subject = _this2.createDownloadFileStream(id, collectionName);
|
|
188
|
+
subject.subscribe({
|
|
189
|
+
next: function next(fileState) {
|
|
190
|
+
_this2.setFileState(id, fileState);
|
|
191
|
+
},
|
|
192
|
+
error: function error(err) {
|
|
193
|
+
var errorFileState = _this2.getErrorFileState(err, id, occurrenceKey);
|
|
194
|
+
_this2.setFileState(id, errorFileState);
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
return subject;
|
|
154
198
|
}));
|
|
155
199
|
}
|
|
156
200
|
}, {
|
|
@@ -161,17 +205,17 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
161
205
|
}, {
|
|
162
206
|
key: "getArtifactURL",
|
|
163
207
|
value: function getArtifactURL(artifacts, artifactName, collectionName) {
|
|
164
|
-
return this.
|
|
208
|
+
return this.mediaApi.getArtifactURL(artifacts, artifactName, collectionName);
|
|
165
209
|
}
|
|
166
210
|
}, {
|
|
167
211
|
key: "getFileBinaryURL",
|
|
168
212
|
value: function getFileBinaryURL(id, collectionName) {
|
|
169
|
-
return this.
|
|
213
|
+
return this.mediaApi.getFileBinaryURL(id, collectionName);
|
|
170
214
|
}
|
|
171
215
|
}, {
|
|
172
216
|
key: "touchFiles",
|
|
173
217
|
value: function touchFiles(descriptors, collection, traceContext) {
|
|
174
|
-
return this.
|
|
218
|
+
return this.mediaApi.touchFiles({
|
|
175
219
|
descriptors: descriptors
|
|
176
220
|
}, {
|
|
177
221
|
collection: collection
|
|
@@ -257,6 +301,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
257
301
|
subject.next(fileState);
|
|
258
302
|
// we save it into the cache as soon as possible, in case someone subscribes
|
|
259
303
|
getFileStreamsCache().set(id, subject);
|
|
304
|
+
this.setFileState(id, fileState);
|
|
260
305
|
return _context4.abrupt("return", new Promise( /*#__PURE__*/function () {
|
|
261
306
|
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(resolve, reject) {
|
|
262
307
|
var blob, type, size, file, mediaType, dimensions;
|
|
@@ -312,7 +357,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
312
357
|
return _ref4.apply(this, arguments);
|
|
313
358
|
};
|
|
314
359
|
}()));
|
|
315
|
-
case
|
|
360
|
+
case 11:
|
|
316
361
|
case "end":
|
|
317
362
|
return _context4.stop();
|
|
318
363
|
}
|
|
@@ -335,22 +380,37 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
335
380
|
var subject = createMediaSubject();
|
|
336
381
|
getFileStreamsCache().set(id, subject);
|
|
337
382
|
var onProgress = function onProgress(progress) {
|
|
338
|
-
|
|
383
|
+
var fileState = _objectSpread(_objectSpread({
|
|
339
384
|
status: 'uploading'
|
|
340
385
|
}, stateBase), {}, {
|
|
341
386
|
progress: progress
|
|
342
|
-
})
|
|
387
|
+
});
|
|
388
|
+
subject.next(fileState);
|
|
389
|
+
_this4.setFileState(id, fileState);
|
|
343
390
|
};
|
|
344
391
|
var processingSubscription = new Subscription();
|
|
345
392
|
var onUploadFinish = function onUploadFinish(error) {
|
|
346
393
|
if (error) {
|
|
394
|
+
var errorFileState = _this4.getErrorFileState(error, id, occurrenceKey);
|
|
395
|
+
_this4.setFileState(id, errorFileState);
|
|
347
396
|
return subject.error(error);
|
|
348
397
|
}
|
|
349
398
|
processingSubscription = _this4.createDownloadFileStream(id, collection, occurrenceKey).pipe(map(function (remoteFileState) {
|
|
350
399
|
return _objectSpread(_objectSpread(_objectSpread({}, stateBase), remoteFileState), overrideMediaTypeIfUnknown(remoteFileState, stateBase.mediaType));
|
|
351
|
-
})).subscribe(
|
|
400
|
+
})).subscribe({
|
|
401
|
+
next: function next(fileState) {
|
|
402
|
+
subject.next(fileState);
|
|
403
|
+
_this4.setFileState(id, fileState);
|
|
404
|
+
},
|
|
405
|
+
error: function error(err) {
|
|
406
|
+
var errorFileState = _this4.getErrorFileState(err, id, occurrenceKey);
|
|
407
|
+
subject.error(err);
|
|
408
|
+
_this4.setFileState(id, errorFileState);
|
|
409
|
+
},
|
|
410
|
+
complete: subject.complete
|
|
411
|
+
});
|
|
352
412
|
};
|
|
353
|
-
var _uploadFile = uploadFile(file, this.
|
|
413
|
+
var _uploadFile = uploadFile(file, this.mediaApi, upfrontId, {
|
|
354
414
|
onUploadFinish: onUploadFinish,
|
|
355
415
|
onProgress: onProgress
|
|
356
416
|
}, traceContext),
|
|
@@ -367,8 +427,6 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
367
427
|
setTimeout(onProgress, 0, 0);
|
|
368
428
|
return fromObservable(subject);
|
|
369
429
|
}
|
|
370
|
-
|
|
371
|
-
// TODO: ----- ADD TICKET
|
|
372
430
|
}, {
|
|
373
431
|
key: "downloadBinary",
|
|
374
432
|
value: function () {
|
|
@@ -383,7 +441,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
383
441
|
name = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : 'download';
|
|
384
442
|
collectionName = _args5.length > 2 ? _args5[2] : undefined;
|
|
385
443
|
_context5.next = 4;
|
|
386
|
-
return this.
|
|
444
|
+
return this.mediaApi.getFileBinaryURL(id, collectionName);
|
|
387
445
|
case 4:
|
|
388
446
|
url = _context5.sent;
|
|
389
447
|
downloadUrl(url, {
|
|
@@ -409,6 +467,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
409
467
|
key: "copyFile",
|
|
410
468
|
value: function () {
|
|
411
469
|
var _copyFile = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(source, destination) {
|
|
470
|
+
var _this5 = this;
|
|
412
471
|
var options,
|
|
413
472
|
traceContext,
|
|
414
473
|
authProvider,
|
|
@@ -436,7 +495,12 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
436
495
|
fileCache,
|
|
437
496
|
subject,
|
|
438
497
|
previewOverride,
|
|
498
|
+
fileState,
|
|
499
|
+
_fileState,
|
|
439
500
|
_fileCache,
|
|
501
|
+
replaceFileState,
|
|
502
|
+
key,
|
|
503
|
+
errorFileState,
|
|
440
504
|
_args6 = arguments;
|
|
441
505
|
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
442
506
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -446,7 +510,7 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
446
510
|
authProvider = source.authProvider, sourceCollection = source.collection, id = source.id;
|
|
447
511
|
destinationAuthProvider = destination.authProvider, destinationCollectionName = destination.collection, replaceFileId = destination.replaceFileId, occurrenceKey = destination.occurrenceKey;
|
|
448
512
|
preview = options.preview, mimeType = options.mimeType;
|
|
449
|
-
mediaStore = destination.mediaStore || new
|
|
513
|
+
mediaStore = destination.mediaStore || new MediaApi({
|
|
450
514
|
authProvider: destinationAuthProvider
|
|
451
515
|
});
|
|
452
516
|
_context6.t0 = authToOwner;
|
|
@@ -505,53 +569,65 @@ export var FileFetcherImpl = /*#__PURE__*/function () {
|
|
|
505
569
|
_context6.t2 = _context6.sent;
|
|
506
570
|
case 31:
|
|
507
571
|
if (!_context6.t2) {
|
|
508
|
-
_context6.next =
|
|
572
|
+
_context6.next = 38;
|
|
509
573
|
break;
|
|
510
574
|
}
|
|
511
|
-
|
|
575
|
+
fileState = _objectSpread(_objectSpread(_objectSpread({}, copiedFileState), overrideMediaTypeIfUnknown(copiedFileState, mediaType)), previewOverride);
|
|
576
|
+
subject.next(fileState);
|
|
577
|
+
this.setFileState(copiedId, fileState);
|
|
512
578
|
processingSubscription = this.createDownloadFileStream(copiedId, destinationCollectionName, occurrenceKey).subscribe({
|
|
513
579
|
next: function next(remoteFileState) {
|
|
514
|
-
|
|
580
|
+
var fileState = _objectSpread(_objectSpread(_objectSpread({}, remoteFileState), overrideMediaTypeIfUnknown(remoteFileState, mediaType)), !isErrorFileState(remoteFileState) && previewOverride);
|
|
581
|
+
_this5.setFileState(copiedId, fileState);
|
|
582
|
+
return subject.next(fileState);
|
|
515
583
|
},
|
|
516
584
|
error: function error(err) {
|
|
585
|
+
var errorFileState = _this5.getErrorFileState(err, id, occurrenceKey);
|
|
586
|
+
_this5.setFileState(copiedId, errorFileState);
|
|
517
587
|
return subject.error(err);
|
|
518
588
|
},
|
|
519
589
|
complete: function complete() {
|
|
520
590
|
return subject.complete();
|
|
521
591
|
}
|
|
522
592
|
});
|
|
523
|
-
_context6.next =
|
|
593
|
+
_context6.next = 39;
|
|
524
594
|
break;
|
|
525
|
-
case
|
|
595
|
+
case 38:
|
|
526
596
|
if (!isProcessingFileState(copiedFileState)) {
|
|
527
|
-
|
|
597
|
+
_fileState = _objectSpread(_objectSpread({}, copiedFileState), !isErrorFileState(copiedFileState) && previewOverride);
|
|
598
|
+
subject.next(_fileState);
|
|
599
|
+
this.setFileState(copiedId, _fileState);
|
|
528
600
|
}
|
|
529
|
-
case
|
|
601
|
+
case 39:
|
|
530
602
|
if (!cache.has(copiedId)) {
|
|
531
603
|
getFileStreamsCache().set(copiedId, subject);
|
|
532
604
|
}
|
|
533
605
|
return _context6.abrupt("return", copiedFile);
|
|
534
|
-
case
|
|
535
|
-
_context6.prev =
|
|
606
|
+
case 43:
|
|
607
|
+
_context6.prev = 43;
|
|
536
608
|
_context6.t3 = _context6["catch"](14);
|
|
537
609
|
if (processingSubscription) {
|
|
538
610
|
processingSubscription.unsubscribe();
|
|
539
611
|
}
|
|
540
612
|
if (replaceFileId) {
|
|
541
613
|
_fileCache = cache.get(replaceFileId);
|
|
614
|
+
replaceFileState = this.store.getState().files[replaceFileId];
|
|
542
615
|
if (_fileCache) {
|
|
543
616
|
_fileCache.error(_context6.t3);
|
|
544
617
|
} else {
|
|
545
618
|
// Create a new subject with the error state for new subscriptions
|
|
546
619
|
cache.set(id, createMediaSubject(_context6.t3));
|
|
547
620
|
}
|
|
621
|
+
key = replaceFileState ? replaceFileId : id;
|
|
622
|
+
errorFileState = this.getErrorFileState(_context6.t3, id, occurrenceKey);
|
|
623
|
+
this.setFileState(key, errorFileState);
|
|
548
624
|
}
|
|
549
625
|
throw _context6.t3;
|
|
550
|
-
case
|
|
626
|
+
case 48:
|
|
551
627
|
case "end":
|
|
552
628
|
return _context6.stop();
|
|
553
629
|
}
|
|
554
|
-
}, _callee6, this, [[14,
|
|
630
|
+
}, _callee6, this, [[14, 43]]);
|
|
555
631
|
}));
|
|
556
632
|
function copyFile(_x9, _x10) {
|
|
557
633
|
return _copyFile.apply(this, arguments);
|
|
@@ -3,28 +3,40 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
5
5
|
import { EventEmitter2 } from 'eventemitter2';
|
|
6
|
-
import { MediaStore } from './media-store';
|
|
6
|
+
import { MediaStore as MediaApi } from './media-store';
|
|
7
7
|
import { FileFetcherImpl } from './file-fetcher';
|
|
8
8
|
import { StargateClient } from './stargate-client';
|
|
9
|
+
import { mediaStore } from '@atlaskit/media-state';
|
|
9
10
|
export var MediaClient = /*#__PURE__*/function () {
|
|
10
11
|
// mobile upload is lazily loaded
|
|
11
12
|
|
|
12
13
|
// Deprecated value introduced for backward compatibility with Context
|
|
13
14
|
|
|
14
|
-
function MediaClient(mediaClientConfig
|
|
15
|
+
function MediaClient(mediaClientConfig) {
|
|
16
|
+
var store = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : mediaStore;
|
|
17
|
+
var mediaApi = arguments.length > 2 ? arguments[2] : undefined;
|
|
15
18
|
_classCallCheck(this, MediaClient);
|
|
16
19
|
this.mediaClientConfig = mediaClientConfig;
|
|
17
|
-
this.
|
|
18
|
-
this.mediaStore = new
|
|
20
|
+
this.store = store;
|
|
21
|
+
this.mediaStore = mediaApi !== null && mediaApi !== void 0 ? mediaApi : new MediaApi({
|
|
19
22
|
authProvider: mediaClientConfig.authProvider,
|
|
20
23
|
initialAuth: mediaClientConfig.initialAuth
|
|
21
|
-
}
|
|
24
|
+
});
|
|
22
25
|
this.config = mediaClientConfig;
|
|
23
|
-
this.file = new FileFetcherImpl(this.mediaStore);
|
|
26
|
+
this.file = new FileFetcherImpl(this.mediaStore, this.store);
|
|
24
27
|
this.eventEmitter = new EventEmitter2();
|
|
25
28
|
this.stargate = new StargateClient(mediaClientConfig.stargateBaseUrl);
|
|
26
29
|
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
27
34
|
_createClass(MediaClient, [{
|
|
35
|
+
key: "__DO_NOT_USE__getMediaStore",
|
|
36
|
+
value: function __DO_NOT_USE__getMediaStore() {
|
|
37
|
+
return this.store;
|
|
38
|
+
}
|
|
39
|
+
}, {
|
|
28
40
|
key: "getImage",
|
|
29
41
|
value: function getImage(id, params, controller, fetchMaxRes, traceContext) {
|
|
30
42
|
return this.mediaStore.getImage(id, params, controller, fetchMaxRes, traceContext);
|
|
@@ -79,7 +91,7 @@ export var MediaClient = /*#__PURE__*/function () {
|
|
|
79
91
|
return import( /* webpackChunkName: "@atlaskit-internal_media-client-mobile-upload" */'./mobile-upload');
|
|
80
92
|
case 4:
|
|
81
93
|
module = _context2.sent;
|
|
82
|
-
this.mobileUpload = new module.MobileUploadImpl(this.mediaStore);
|
|
94
|
+
this.mobileUpload = new module.MobileUploadImpl(this.mediaStore, this.store);
|
|
83
95
|
return _context2.abrupt("return", this.mobileUpload);
|
|
84
96
|
case 7:
|
|
85
97
|
case "end":
|
|
@@ -3,8 +3,8 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
5
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
6
|
-
function ownKeys(
|
|
7
|
-
function _objectSpread(
|
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
8
|
import { getRandomHex } from '@atlaskit/media-common';
|
|
9
9
|
import { FILE_CACHE_MAX_AGE, MAX_RESOLUTION } from '../../constants';
|
|
10
10
|
import { getArtifactUrl } from '../../models/artifacts';
|
|
@@ -31,7 +31,7 @@ var jsonHeaders = {
|
|
|
31
31
|
'Content-Type': 'application/json'
|
|
32
32
|
};
|
|
33
33
|
export var MediaStore = /*#__PURE__*/function () {
|
|
34
|
-
function MediaStore(config
|
|
34
|
+
function MediaStore(config) {
|
|
35
35
|
var _this = this;
|
|
36
36
|
_classCallCheck(this, MediaStore);
|
|
37
37
|
_defineProperty(this, "resolveAuth", function (authContext) {
|
|
@@ -41,7 +41,6 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
41
41
|
return resolveInitialAuth(_this.config.initialAuth);
|
|
42
42
|
});
|
|
43
43
|
this.config = config;
|
|
44
|
-
this.featureFlags = featureFlags;
|
|
45
44
|
}
|
|
46
45
|
_createClass(MediaStore, [{
|
|
47
46
|
key: "removeCollectionFile",
|