@atlaskit/media-client 33.1.0 → 33.2.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 +17 -0
- package/dist/cjs/client/file-fetcher/index.js +311 -116
- package/dist/es2019/client/file-fetcher/index.js +84 -0
- package/dist/esm/client/file-fetcher/index.js +311 -116
- package/dist/types/client/file-fetcher/index.d.ts +15 -2
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +15 -2
- package/package.json +1 -1
|
@@ -2,14 +2,14 @@ import { type AuthProvider } from '@atlaskit/media-core';
|
|
|
2
2
|
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
3
3
|
import { MediaStore as MediaApi, type MediaStoreCopyFileWithTokenParams, type TouchedFiles, type TouchFileDescriptor } from '../media-store';
|
|
4
4
|
import { type GetFileOptions } from '../../models/file-state';
|
|
5
|
-
import { MediaItemDetails, type MediaFile } from '../../models/media';
|
|
5
|
+
import { type MediaItemDetails, type MediaFile } from '../../models/media';
|
|
6
6
|
import { type UploadableFile, type UploadableFileUpfrontIds } from '../../uploader';
|
|
7
7
|
import { type UploadController } from '../../upload-controller';
|
|
8
8
|
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 { UploadArtifactParams } from '../media-store/types';
|
|
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,6 +42,13 @@ 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
|
+
/** @exprimental This is exprimental for the purposes of COMMIT-18082 and is prone to breaking changes */
|
|
46
|
+
getVideoDurations(files: Array<{
|
|
47
|
+
id: string;
|
|
48
|
+
collectionName?: string;
|
|
49
|
+
}>): Promise<{
|
|
50
|
+
[key: string]: number;
|
|
51
|
+
}>;
|
|
45
52
|
}
|
|
46
53
|
export declare class FileFetcherImpl implements FileFetcher {
|
|
47
54
|
private readonly mediaApi;
|
|
@@ -67,4 +74,10 @@ export declare class FileFetcherImpl implements FileFetcher {
|
|
|
67
74
|
private copyFileWithIntent;
|
|
68
75
|
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
|
|
69
76
|
uploadArtifact: FileFetcher['uploadArtifact'];
|
|
77
|
+
private getOrFetchFileState;
|
|
78
|
+
private getDurationOfVideo;
|
|
79
|
+
getVideoDurations: (files: Array<{
|
|
80
|
+
id: string;
|
|
81
|
+
collectionName?: string;
|
|
82
|
+
}>) => Promise<Record<string, number>>;
|
|
70
83
|
}
|
|
@@ -2,14 +2,14 @@ import { type AuthProvider } from '@atlaskit/media-core';
|
|
|
2
2
|
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
3
3
|
import { MediaStore as MediaApi, type MediaStoreCopyFileWithTokenParams, type TouchedFiles, type TouchFileDescriptor } from '../media-store';
|
|
4
4
|
import { type GetFileOptions } from '../../models/file-state';
|
|
5
|
-
import { MediaItemDetails, type MediaFile } from '../../models/media';
|
|
5
|
+
import { type MediaItemDetails, type MediaFile } from '../../models/media';
|
|
6
6
|
import { type UploadableFile, type UploadableFileUpfrontIds } from '../../uploader';
|
|
7
7
|
import { type UploadController } from '../../upload-controller';
|
|
8
8
|
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 { UploadArtifactParams } from '../media-store/types';
|
|
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,6 +42,13 @@ 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
|
+
/** @exprimental This is exprimental for the purposes of COMMIT-18082 and is prone to breaking changes */
|
|
46
|
+
getVideoDurations(files: Array<{
|
|
47
|
+
id: string;
|
|
48
|
+
collectionName?: string;
|
|
49
|
+
}>): Promise<{
|
|
50
|
+
[key: string]: number;
|
|
51
|
+
}>;
|
|
45
52
|
}
|
|
46
53
|
export declare class FileFetcherImpl implements FileFetcher {
|
|
47
54
|
private readonly mediaApi;
|
|
@@ -67,4 +74,10 @@ export declare class FileFetcherImpl implements FileFetcher {
|
|
|
67
74
|
private copyFileWithIntent;
|
|
68
75
|
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions, traceContext?: MediaTraceContext): Promise<MediaFile>;
|
|
69
76
|
uploadArtifact: FileFetcher['uploadArtifact'];
|
|
77
|
+
private getOrFetchFileState;
|
|
78
|
+
private getDurationOfVideo;
|
|
79
|
+
getVideoDurations: (files: Array<{
|
|
80
|
+
id: string;
|
|
81
|
+
collectionName?: string;
|
|
82
|
+
}>) => Promise<Record<string, number>>;
|
|
70
83
|
}
|