@atlaskit/media-client 18.1.0 → 19.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 +23 -0
- package/dist/cjs/client/collection-fetcher.js +8 -8
- package/dist/cjs/client/file-fetcher/index.js +40 -36
- package/dist/cjs/client/media-client.js +2 -2
- package/dist/cjs/client/media-store/index.js +69 -52
- package/dist/cjs/models/file-state.js +4 -2
- package/dist/cjs/uploader/index.js +40 -70
- package/dist/cjs/utils/createFileDataLoader.js +32 -15
- package/dist/cjs/utils/request/helpers.js +39 -22
- package/dist/cjs/utils/request/index.js +5 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/collection-fetcher.js +6 -6
- package/dist/es2019/client/file-fetcher/index.js +16 -14
- package/dist/es2019/client/media-client.js +2 -2
- package/dist/es2019/client/media-store/index.js +50 -41
- package/dist/es2019/models/file-state.js +4 -2
- package/dist/es2019/uploader/index.js +17 -21
- package/dist/es2019/utils/createFileDataLoader.js +13 -3
- package/dist/es2019/utils/request/helpers.js +26 -8
- package/dist/es2019/utils/request/index.js +6 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/collection-fetcher.js +8 -8
- package/dist/esm/client/file-fetcher/index.js +40 -36
- package/dist/esm/client/media-client.js +2 -2
- package/dist/esm/client/media-store/index.js +68 -50
- package/dist/esm/models/file-state.js +4 -2
- package/dist/esm/uploader/index.js +40 -69
- package/dist/esm/utils/createFileDataLoader.js +31 -13
- package/dist/esm/utils/request/helpers.js +36 -20
- package/dist/esm/utils/request/index.js +6 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/client/collection-fetcher.d.ts +4 -3
- package/dist/types/client/file-fetcher/index.d.ts +9 -8
- package/dist/types/client/media-client.d.ts +2 -2
- package/dist/types/client/media-store/index.d.ts +16 -21
- package/dist/types/models/file-state.d.ts +9 -6
- package/dist/types/models/media.d.ts +3 -1
- package/dist/types/uploader/index.d.ts +2 -1
- package/dist/types/utils/request/helpers.d.ts +10 -2
- package/dist/types/utils/request/types.d.ts +3 -0
- package/package.json +7 -15
- package/report.api.md +116 -75
- package/dist/types-ts4.0/client/__mocks__/collection-fetcher.d.ts +0 -8
- package/dist/types-ts4.0/client/__mocks__/file-fetcher.d.ts +0 -10
- package/dist/types-ts4.0/client/__mocks__/media-client.d.ts +0 -13
- package/dist/types-ts4.0/client/collection-fetcher.d.ts +0 -35
- package/dist/types-ts4.0/client/events.d.ts +0 -14
- package/dist/types-ts4.0/client/file-fetcher/error.d.ts +0 -29
- package/dist/types-ts4.0/client/file-fetcher/index.d.ts +0 -56
- package/dist/types-ts4.0/client/media-client.d.ts +0 -28
- package/dist/types-ts4.0/client/media-store/error.d.ts +0 -16
- package/dist/types-ts4.0/client/media-store/index.d.ts +0 -174
- package/dist/types-ts4.0/client/media-store/resolveAuth.d.ts +0 -4
- package/dist/types-ts4.0/client/mobile-upload.d.ts +0 -11
- package/dist/types-ts4.0/client/stargate-client.d.ts +0 -15
- package/dist/types-ts4.0/constants.d.ts +0 -6
- package/dist/types-ts4.0/file-streams-cache.d.ts +0 -15
- package/dist/types-ts4.0/globalMediaEventEmitter.d.ts +0 -6
- package/dist/types-ts4.0/identifier.d.ts +0 -15
- package/dist/types-ts4.0/index.d.ts +0 -89
- package/dist/types-ts4.0/models/artifacts.d.ts +0 -12
- package/dist/types-ts4.0/models/auth-headers.d.ts +0 -11
- package/dist/types-ts4.0/models/auth-query-parameters.d.ts +0 -11
- package/dist/types-ts4.0/models/errors/helpers.d.ts +0 -6
- package/dist/types-ts4.0/models/errors/index.d.ts +0 -11
- package/dist/types-ts4.0/models/errors/types.d.ts +0 -15
- package/dist/types-ts4.0/models/file-state.d.ts +0 -91
- package/dist/types-ts4.0/models/item.d.ts +0 -25
- package/dist/types-ts4.0/models/media-subscribable.d.ts +0 -3
- package/dist/types-ts4.0/models/media.d.ts +0 -66
- package/dist/types-ts4.0/models/mobile-upload.d.ts +0 -28
- package/dist/types-ts4.0/upload-controller.d.ts +0 -7
- package/dist/types-ts4.0/uploader/calculateChunkSize.d.ts +0 -11
- package/dist/types-ts4.0/uploader/error.d.ts +0 -29
- package/dist/types-ts4.0/uploader/index.d.ts +0 -21
- package/dist/types-ts4.0/utils/checkWebpSupport.d.ts +0 -1
- package/dist/types-ts4.0/utils/convertBase64ToBlob.d.ts +0 -1
- package/dist/types-ts4.0/utils/createFileDataLoader.d.ts +0 -30
- package/dist/types-ts4.0/utils/createMediaSubject.d.ts +0 -3
- package/dist/types-ts4.0/utils/detectEmptyFile.d.ts +0 -16
- package/dist/types-ts4.0/utils/getDimensionsFromBlob.d.ts +0 -6
- package/dist/types-ts4.0/utils/getImageDimensionsFromBlob.d.ts +0 -5
- package/dist/types-ts4.0/utils/getMediaTypeFromUploadableFile.d.ts +0 -3
- package/dist/types-ts4.0/utils/getVideoDimensionsFromBlob.d.ts +0 -5
- package/dist/types-ts4.0/utils/hashing/hasher.d.ts +0 -3
- package/dist/types-ts4.0/utils/hashing/hasherCreator.d.ts +0 -3
- package/dist/types-ts4.0/utils/hashing/simpleHasher.d.ts +0 -4
- package/dist/types-ts4.0/utils/hashing/workerHasher.d.ts +0 -16
- package/dist/types-ts4.0/utils/imageResizeModeToFileImageMode.d.ts +0 -3
- package/dist/types-ts4.0/utils/isImageRemote.d.ts +0 -1
- package/dist/types-ts4.0/utils/mediaSubscribable/fromObservable.d.ts +0 -5
- package/dist/types-ts4.0/utils/mediaSubscribable/index.d.ts +0 -3
- package/dist/types-ts4.0/utils/mediaSubscribable/toPromise.d.ts +0 -10
- package/dist/types-ts4.0/utils/mediaSubscribable/types.d.ts +0 -16
- package/dist/types-ts4.0/utils/mobileUpload/error.d.ts +0 -29
- package/dist/types-ts4.0/utils/mobileUpload/helpers.d.ts +0 -8
- package/dist/types-ts4.0/utils/mobileUpload/index.d.ts +0 -5
- package/dist/types-ts4.0/utils/mobileUpload/servicesCache.d.ts +0 -4
- package/dist/types-ts4.0/utils/mobileUpload/stateMachine/index.d.ts +0 -7
- package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/error.d.ts +0 -3
- package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/processed.d.ts +0 -3
- package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/processing.d.ts +0 -3
- package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/processingFailed.d.ts +0 -3
- package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/uploading.d.ts +0 -3
- package/dist/types-ts4.0/utils/mobileUpload/stateMachine/types.d.ts +0 -69
- package/dist/types-ts4.0/utils/overrideMediaTypeIfUnknown.d.ts +0 -5
- package/dist/types-ts4.0/utils/polling/errors.d.ts +0 -12
- package/dist/types-ts4.0/utils/polling/index.d.ts +0 -33
- package/dist/types-ts4.0/utils/polling/types.d.ts +0 -7
- package/dist/types-ts4.0/utils/request/errors.d.ts +0 -20
- package/dist/types-ts4.0/utils/request/helpers.d.ts +0 -38
- package/dist/types-ts4.0/utils/request/index.d.ts +0 -5
- package/dist/types-ts4.0/utils/request/types.d.ts +0 -43
- package/dist/types-ts4.0/utils/safeUnsubscribe.d.ts +0 -2
- package/dist/types-ts4.0/utils/setTimeoutPromise.d.ts +0 -2
- package/dist/types-ts4.0/utils/shouldFetchRemoteFileStates.d.ts +0 -16
- package/dist/types-ts4.0/utils/url.d.ts +0 -17
- package/dist/types-ts4.0/utils/with-media-client-hoc.d.ts +0 -16
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
2
|
-
import { FileDetails, FileItem } from '../models/item';
|
|
3
|
-
import { MediaCollectionItem } from '../models/media';
|
|
4
|
-
import { MediaStore, MediaStoreGetCollectionItemsParams } from './media-store';
|
|
5
|
-
import { MediaSubscribable } from '../utils/mediaSubscribable';
|
|
6
|
-
export interface MediaCollectionFileItemDetails extends FileDetails {
|
|
7
|
-
occurrenceKey: string;
|
|
8
|
-
}
|
|
9
|
-
export interface MediaCollectionFileItem extends FileItem {
|
|
10
|
-
details: MediaCollectionFileItemDetails;
|
|
11
|
-
}
|
|
12
|
-
export interface MediaCollection {
|
|
13
|
-
id: string;
|
|
14
|
-
items: Array<MediaCollectionItem>;
|
|
15
|
-
}
|
|
16
|
-
export interface CollectionCacheEntry {
|
|
17
|
-
items: MediaCollectionItem[];
|
|
18
|
-
subject: ReplaySubject<MediaCollectionItem[]>;
|
|
19
|
-
isLoadingNextPage: boolean;
|
|
20
|
-
nextInclusiveStartKey?: string;
|
|
21
|
-
}
|
|
22
|
-
export declare type CollectionCache = {
|
|
23
|
-
[collectionName: string]: CollectionCacheEntry;
|
|
24
|
-
};
|
|
25
|
-
export declare const collectionCache: CollectionCache;
|
|
26
|
-
export declare class CollectionFetcher {
|
|
27
|
-
readonly mediaStore: MediaStore;
|
|
28
|
-
constructor(mediaStore: MediaStore);
|
|
29
|
-
private createFileStateObserver;
|
|
30
|
-
private populateCache;
|
|
31
|
-
private removeFromCache;
|
|
32
|
-
getItems(collectionName: string, params?: MediaStoreGetCollectionItemsParams): MediaSubscribable<MediaCollectionItem[]>;
|
|
33
|
-
removeFile(id: string, collectionName: string, occurrenceKey?: string): Promise<void>;
|
|
34
|
-
loadNextPage(collectionName: string, params?: MediaStoreGetCollectionItemsParams): Promise<void>;
|
|
35
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FileState } from '../models/file-state';
|
|
2
|
-
export declare type EventPayloadMap<P> = {
|
|
3
|
-
readonly [event: string]: P;
|
|
4
|
-
};
|
|
5
|
-
export declare type EventPayloadListener<M extends EventPayloadMap<P>, E extends keyof M, P = any> = (payload: M[E]) => void;
|
|
6
|
-
export interface MediaViewedEventPayload {
|
|
7
|
-
fileId: string;
|
|
8
|
-
viewingLevel: 'minimal' | 'full' | 'download';
|
|
9
|
-
isUserCollection?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare type UploadEventPayloadMap = {
|
|
12
|
-
'file-added': FileState;
|
|
13
|
-
'media-viewed': MediaViewedEventPayload;
|
|
14
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { BaseMediaClientError } from '../../models/errors';
|
|
2
|
-
export declare type FileFetcherErrorReason = 'invalidFileId' | 'emptyItems' | 'zeroVersionFile';
|
|
3
|
-
export declare type FileFetcherErrorAttributes = {
|
|
4
|
-
readonly reason: FileFetcherErrorReason;
|
|
5
|
-
readonly id: string;
|
|
6
|
-
readonly metadata?: {
|
|
7
|
-
readonly collectionName?: string;
|
|
8
|
-
readonly occurrenceKey?: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare class FileFetcherError extends BaseMediaClientError<FileFetcherErrorAttributes> {
|
|
12
|
-
readonly reason: FileFetcherErrorReason;
|
|
13
|
-
readonly id: string;
|
|
14
|
-
readonly metadata?: {
|
|
15
|
-
readonly collectionName?: string | undefined;
|
|
16
|
-
readonly occurrenceKey?: string | undefined;
|
|
17
|
-
} | undefined;
|
|
18
|
-
constructor(reason: FileFetcherErrorReason, id: string, metadata?: {
|
|
19
|
-
readonly collectionName?: string | undefined;
|
|
20
|
-
readonly occurrenceKey?: string | undefined;
|
|
21
|
-
} | undefined);
|
|
22
|
-
get attributes(): {
|
|
23
|
-
reason: FileFetcherErrorReason;
|
|
24
|
-
id: string;
|
|
25
|
-
collectionName: string | undefined;
|
|
26
|
-
occurrenceKey: string | undefined;
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
export declare function isFileFetcherError(err: Error): err is FileFetcherError;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import 'setimmediate';
|
|
2
|
-
import { AuthProvider } from '@atlaskit/media-core';
|
|
3
|
-
import { MediaStore, MediaStoreCopyFileWithTokenParams, TouchedFiles, TouchFileDescriptor } from '../media-store';
|
|
4
|
-
import { FilePreview, FileState, GetFileOptions } from '../../models/file-state';
|
|
5
|
-
import { MediaFile } from '../../models/media';
|
|
6
|
-
import { UploadableFile, UploadableFileUpfrontIds } from '../../uploader';
|
|
7
|
-
import { MediaFileArtifacts } from '../../models/artifacts';
|
|
8
|
-
import { UploadController } from '../../upload-controller';
|
|
9
|
-
import { MediaSubscribable } from '../../utils/mediaSubscribable';
|
|
10
|
-
import { Dimensions } from '../../utils/getDimensionsFromBlob';
|
|
11
|
-
export type { FileFetcherErrorAttributes, FileFetcherErrorReason, } from './error';
|
|
12
|
-
export { isFileFetcherError, FileFetcherError } from './error';
|
|
13
|
-
export interface CopySourceFile {
|
|
14
|
-
id: string;
|
|
15
|
-
collection?: string;
|
|
16
|
-
authProvider: AuthProvider;
|
|
17
|
-
}
|
|
18
|
-
export interface CopyDestination extends MediaStoreCopyFileWithTokenParams {
|
|
19
|
-
authProvider: AuthProvider;
|
|
20
|
-
mediaStore?: MediaStore;
|
|
21
|
-
}
|
|
22
|
-
export interface CopyFileOptions {
|
|
23
|
-
preview?: FilePreview | Promise<FilePreview>;
|
|
24
|
-
mimeType?: string;
|
|
25
|
-
}
|
|
26
|
-
export declare type ExternalUploadPayload = {
|
|
27
|
-
uploadableFileUpfrontIds: UploadableFileUpfrontIds;
|
|
28
|
-
dimensions: Dimensions;
|
|
29
|
-
};
|
|
30
|
-
export interface FileFetcher {
|
|
31
|
-
getFileState(id: string, options?: GetFileOptions): MediaSubscribable<FileState>;
|
|
32
|
-
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
33
|
-
touchFiles(descriptors: TouchFileDescriptor[], collection?: string): Promise<TouchedFiles>;
|
|
34
|
-
upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds): MediaSubscribable<FileState>;
|
|
35
|
-
uploadExternal(url: string, collection?: string): Promise<ExternalUploadPayload>;
|
|
36
|
-
downloadBinary(id: string, name?: string, collectionName?: string): Promise<void>;
|
|
37
|
-
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
38
|
-
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions): Promise<MediaFile>;
|
|
39
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
40
|
-
}
|
|
41
|
-
export declare class FileFetcherImpl implements FileFetcher {
|
|
42
|
-
private readonly mediaStore;
|
|
43
|
-
private readonly dataloader;
|
|
44
|
-
constructor(mediaStore: MediaStore);
|
|
45
|
-
getFileState(id: string, options?: GetFileOptions): MediaSubscribable<FileState>;
|
|
46
|
-
getCurrentState(id: string, options?: GetFileOptions): Promise<FileState>;
|
|
47
|
-
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
48
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
49
|
-
private createDownloadFileStream;
|
|
50
|
-
touchFiles(descriptors: TouchFileDescriptor[], collection?: string): Promise<TouchedFiles>;
|
|
51
|
-
private generateUploadableFileUpfrontIds;
|
|
52
|
-
uploadExternal(url: string, collection?: string): Promise<ExternalUploadPayload>;
|
|
53
|
-
upload(file: UploadableFile, controller?: UploadController, uploadableFileUpfrontIds?: UploadableFileUpfrontIds): MediaSubscribable<FileState>;
|
|
54
|
-
downloadBinary(id: string, name?: string, collectionName?: string): Promise<void>;
|
|
55
|
-
copyFile(source: CopySourceFile, destination: CopyDestination, options?: CopyFileOptions): Promise<MediaFile>;
|
|
56
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { MediaClientConfig } from '@atlaskit/media-core';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { MediaStore, MediaStoreGetFileImageParams, ImageMetadata } from './media-store';
|
|
4
|
-
import { CollectionFetcher } from './collection-fetcher';
|
|
5
|
-
import { FileFetcher } from './file-fetcher';
|
|
6
|
-
import { UploadEventPayloadMap, EventPayloadListener } from './events';
|
|
7
|
-
import { StargateClient } from './stargate-client';
|
|
8
|
-
import { MobileUpload } from '../models/mobile-upload';
|
|
9
|
-
export declare class MediaClient {
|
|
10
|
-
readonly mediaClientConfig: MediaClientConfig;
|
|
11
|
-
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
12
|
-
readonly mediaStore: MediaStore;
|
|
13
|
-
readonly collection: CollectionFetcher;
|
|
14
|
-
readonly file: FileFetcher;
|
|
15
|
-
readonly stargate: StargateClient;
|
|
16
|
-
private readonly eventEmitter;
|
|
17
|
-
private mobileUpload?;
|
|
18
|
-
readonly config: MediaClientConfig;
|
|
19
|
-
constructor(mediaClientConfig: MediaClientConfig, featureFlags?: MediaFeatureFlags | undefined);
|
|
20
|
-
getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceId?: string): Promise<Blob>;
|
|
21
|
-
getImageUrl(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
|
|
22
|
-
getImageUrlSync(id: string, params?: MediaStoreGetFileImageParams): string;
|
|
23
|
-
getImageMetadata(id: string, params?: MediaStoreGetFileImageParams): Promise<ImageMetadata>;
|
|
24
|
-
mobileUploadPromise(): Promise<MobileUpload>;
|
|
25
|
-
on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
|
|
26
|
-
off<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
|
|
27
|
-
emit<E extends keyof UploadEventPayloadMap>(event: E, payload: UploadEventPayloadMap[E]): boolean;
|
|
28
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseMediaClientError } from '../../models/errors';
|
|
2
|
-
export declare type MediaStoreErrorReason = 'failedAuthProvider' | 'tokenExpired' | 'missingInitialAuth' | 'emptyAuth' | 'authProviderTimedOut';
|
|
3
|
-
export declare type MediaStoreErrorAttributes = {
|
|
4
|
-
readonly reason: MediaStoreErrorReason;
|
|
5
|
-
readonly innerError?: Error;
|
|
6
|
-
};
|
|
7
|
-
export declare class MediaStoreError extends BaseMediaClientError<MediaStoreErrorAttributes> {
|
|
8
|
-
readonly reason: MediaStoreErrorReason;
|
|
9
|
-
readonly innerError?: Error | undefined;
|
|
10
|
-
constructor(reason: MediaStoreErrorReason, innerError?: Error | undefined);
|
|
11
|
-
get attributes(): {
|
|
12
|
-
reason: MediaStoreErrorReason;
|
|
13
|
-
innerError: Error | undefined;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export declare function isMediaStoreError(err: Error): err is MediaStoreError;
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { AsapBasedAuth, AuthContext, ClientAltBasedAuth, MediaApiConfig, Auth } from '@atlaskit/media-core';
|
|
2
|
-
import { MediaFeatureFlags } from '@atlaskit/media-common';
|
|
3
|
-
import { MediaFileArtifacts } from '../../models/artifacts';
|
|
4
|
-
import { MediaChunksProbe, MediaCollectionItemFullDetails, MediaCollectionItems, MediaFile, MediaUpload } from '../../models/media';
|
|
5
|
-
import { ClientOptions, RequestHeaders, RequestMethod, RequestParams, RequestMetadata } from '../../utils/request/types';
|
|
6
|
-
export type { MediaStoreErrorReason, MediaStoreErrorAttributes } from './error';
|
|
7
|
-
export { MediaStoreError, isMediaStoreError } from './error';
|
|
8
|
-
export declare const ZipkinHeaderKeys: {
|
|
9
|
-
traceId: string;
|
|
10
|
-
spanId: string;
|
|
11
|
-
parentSpanId: string;
|
|
12
|
-
sampled: string;
|
|
13
|
-
flags: string;
|
|
14
|
-
};
|
|
15
|
-
export declare class MediaStore {
|
|
16
|
-
private readonly config;
|
|
17
|
-
readonly featureFlags?: MediaFeatureFlags | undefined;
|
|
18
|
-
constructor(config: MediaApiConfig, featureFlags?: MediaFeatureFlags | undefined);
|
|
19
|
-
getCollectionItems(collectionName: string, params?: MediaStoreGetCollectionItemsParams): Promise<MediaStoreResponse<MediaCollectionItems>>;
|
|
20
|
-
removeCollectionFile(id: string, collectionName: string, occurrenceKey?: string): Promise<void>;
|
|
21
|
-
createUpload(createUpTo?: number, collectionName?: string): Promise<MediaStoreResponse<MediaUpload[]>>;
|
|
22
|
-
uploadChunk(etag: string, blob: Blob, { collectionName, uploadId, partNumber, }?: {
|
|
23
|
-
collectionName?: string;
|
|
24
|
-
uploadId?: string;
|
|
25
|
-
partNumber?: number;
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
probeChunks(chunks: string[], { collectionName, uploadId, }?: {
|
|
28
|
-
collectionName?: string;
|
|
29
|
-
uploadId?: string;
|
|
30
|
-
}): Promise<MediaStoreResponse<MediaChunksProbe>>;
|
|
31
|
-
createFileFromUpload(body: MediaStoreCreateFileFromUploadBody, params?: MediaStoreCreateFileFromUploadParams): Promise<MediaStoreResponse<MediaFile>>;
|
|
32
|
-
touchFiles(body: MediaStoreTouchFileBody, params?: MediaStoreTouchFileParams): Promise<MediaStoreResponse<TouchedFiles>>;
|
|
33
|
-
getFile(fileId: string, params?: MediaStoreGetFileParams): Promise<MediaStoreResponse<MediaFile>>;
|
|
34
|
-
getFileImageURL(id: string, params?: MediaStoreGetFileImageParams): Promise<string>;
|
|
35
|
-
getFileImageURLSync(id: string, params?: MediaStoreGetFileImageParams): string;
|
|
36
|
-
private createFileImageURL;
|
|
37
|
-
getFileBinaryURL(id: string, collectionName?: string): Promise<string>;
|
|
38
|
-
getArtifactURL(artifacts: MediaFileArtifacts, artifactName: keyof MediaFileArtifacts, collectionName?: string): Promise<string>;
|
|
39
|
-
getImage(id: string, params?: MediaStoreGetFileImageParams, controller?: AbortController, fetchMaxRes?: boolean, traceId?: string): Promise<Blob>;
|
|
40
|
-
getItems(ids: string[], collectionName?: string): Promise<MediaStoreResponse<ItemsPayload>>;
|
|
41
|
-
getImageMetadata(id: string, params?: MediaStoreGetFileImageParams): Promise<{
|
|
42
|
-
metadata: ImageMetadata;
|
|
43
|
-
}>;
|
|
44
|
-
appendChunksToUpload(uploadId: string, body: AppendChunksToUploadRequestBody, collectionName?: string): Promise<void>;
|
|
45
|
-
copyFileWithToken(body: MediaStoreCopyFileWithTokenBody, params: MediaStoreCopyFileWithTokenParams): Promise<MediaStoreResponse<MediaFile>>;
|
|
46
|
-
request(path: string, options?: MediaStoreRequestOptions, controller?: AbortController): Promise<Response>;
|
|
47
|
-
resolveAuth: (authContext?: AuthContext | undefined) => Promise<Auth>;
|
|
48
|
-
resolveInitialAuth: () => Auth;
|
|
49
|
-
}
|
|
50
|
-
export declare const getMediaEnvironment: () => string | undefined;
|
|
51
|
-
export declare const getMediaRegion: () => string | undefined;
|
|
52
|
-
export interface ResponseFileItem {
|
|
53
|
-
id: string;
|
|
54
|
-
type: 'file';
|
|
55
|
-
details: MediaCollectionItemFullDetails;
|
|
56
|
-
collection?: string;
|
|
57
|
-
}
|
|
58
|
-
export interface ItemsPayload {
|
|
59
|
-
items: ResponseFileItem[];
|
|
60
|
-
}
|
|
61
|
-
export declare type ImageMetadataArtifact = {
|
|
62
|
-
url?: string;
|
|
63
|
-
width?: number;
|
|
64
|
-
height?: number;
|
|
65
|
-
size?: number;
|
|
66
|
-
};
|
|
67
|
-
export interface ImageMetadata {
|
|
68
|
-
pending: boolean;
|
|
69
|
-
preview?: ImageMetadataArtifact;
|
|
70
|
-
original?: ImageMetadataArtifact;
|
|
71
|
-
}
|
|
72
|
-
export interface MediaStoreResponse<Data> {
|
|
73
|
-
readonly data: Data;
|
|
74
|
-
}
|
|
75
|
-
export declare type MediaStoreRequestOptions = RequestMetadata & {
|
|
76
|
-
readonly method?: RequestMethod;
|
|
77
|
-
readonly authContext?: AuthContext;
|
|
78
|
-
readonly params?: RequestParams;
|
|
79
|
-
readonly headers?: RequestHeaders;
|
|
80
|
-
readonly body?: any;
|
|
81
|
-
readonly clientOptions?: ClientOptions;
|
|
82
|
-
};
|
|
83
|
-
export declare type MediaStoreCreateFileFromUploadParams = {
|
|
84
|
-
readonly collection?: string;
|
|
85
|
-
readonly occurrenceKey?: string;
|
|
86
|
-
readonly expireAfter?: number;
|
|
87
|
-
readonly replaceFileId?: string;
|
|
88
|
-
readonly skipConversions?: boolean;
|
|
89
|
-
};
|
|
90
|
-
export declare type MediaStoreCreateFileParams = {
|
|
91
|
-
readonly occurrenceKey?: string;
|
|
92
|
-
readonly collection?: string;
|
|
93
|
-
};
|
|
94
|
-
export interface MediaStoreTouchFileParams {
|
|
95
|
-
readonly collection?: string;
|
|
96
|
-
}
|
|
97
|
-
export interface TouchFileDescriptor {
|
|
98
|
-
fileId: string;
|
|
99
|
-
collection?: string;
|
|
100
|
-
occurrenceKey?: string;
|
|
101
|
-
expireAfter?: number;
|
|
102
|
-
deletable?: boolean;
|
|
103
|
-
}
|
|
104
|
-
export interface MediaStoreTouchFileBody {
|
|
105
|
-
descriptors: TouchFileDescriptor[];
|
|
106
|
-
}
|
|
107
|
-
export declare type MediaStoreCreateFileFromBinaryParams = {
|
|
108
|
-
readonly replaceFileId?: string;
|
|
109
|
-
readonly collection?: string;
|
|
110
|
-
readonly occurrenceKey?: string;
|
|
111
|
-
readonly expireAfter?: number;
|
|
112
|
-
readonly skipConversions?: boolean;
|
|
113
|
-
readonly name?: string;
|
|
114
|
-
};
|
|
115
|
-
export declare type MediaStoreCreateFileFromUploadConditions = {
|
|
116
|
-
readonly hash: string;
|
|
117
|
-
readonly size: number;
|
|
118
|
-
};
|
|
119
|
-
export declare type MediaStoreCreateFileFromUploadBody = {
|
|
120
|
-
readonly uploadId: string;
|
|
121
|
-
readonly name?: string;
|
|
122
|
-
readonly mimeType?: string;
|
|
123
|
-
readonly conditions?: MediaStoreCreateFileFromUploadConditions;
|
|
124
|
-
};
|
|
125
|
-
export declare type MediaStoreGetFileParams = {
|
|
126
|
-
readonly version?: number;
|
|
127
|
-
readonly collection?: string;
|
|
128
|
-
};
|
|
129
|
-
export declare type MediaStoreGetFileImageParams = {
|
|
130
|
-
readonly allowAnimated?: boolean;
|
|
131
|
-
readonly version?: number;
|
|
132
|
-
readonly collection?: string;
|
|
133
|
-
readonly width?: number;
|
|
134
|
-
readonly height?: number;
|
|
135
|
-
readonly mode?: 'fit' | 'full-fit' | 'crop';
|
|
136
|
-
readonly upscale?: boolean;
|
|
137
|
-
readonly 'max-age'?: number;
|
|
138
|
-
};
|
|
139
|
-
export declare type MediaStoreGetCollectionItemsParams = {
|
|
140
|
-
readonly limit?: number;
|
|
141
|
-
readonly inclusiveStartKey?: string;
|
|
142
|
-
readonly sortDirection?: 'asc' | 'desc';
|
|
143
|
-
readonly details?: 'minimal' | 'full';
|
|
144
|
-
};
|
|
145
|
-
export interface SourceFile {
|
|
146
|
-
id: string;
|
|
147
|
-
owner: ClientAltBasedAuth | AsapBasedAuth;
|
|
148
|
-
collection?: string;
|
|
149
|
-
version?: number;
|
|
150
|
-
}
|
|
151
|
-
export declare type MediaStoreCopyFileWithTokenBody = {
|
|
152
|
-
sourceFile: SourceFile;
|
|
153
|
-
};
|
|
154
|
-
export declare type MediaStoreCopyFileWithTokenParams = {
|
|
155
|
-
readonly collection?: string;
|
|
156
|
-
readonly replaceFileId?: string;
|
|
157
|
-
readonly occurrenceKey?: string;
|
|
158
|
-
};
|
|
159
|
-
export declare type AppendChunksToUploadRequestBody = {
|
|
160
|
-
readonly chunks: string[];
|
|
161
|
-
readonly hash?: string;
|
|
162
|
-
readonly offset?: number;
|
|
163
|
-
};
|
|
164
|
-
export interface CreatedTouchedFile {
|
|
165
|
-
fileId: string;
|
|
166
|
-
uploadId: string;
|
|
167
|
-
}
|
|
168
|
-
export declare type TouchedFiles = {
|
|
169
|
-
created: CreatedTouchedFile[];
|
|
170
|
-
};
|
|
171
|
-
export interface EmptyFile {
|
|
172
|
-
readonly id: string;
|
|
173
|
-
readonly createdAt: number;
|
|
174
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { Auth, AuthContext, AuthProvider } from '@atlaskit/media-core';
|
|
2
|
-
export declare const DEFAULT_AUTH_PROVIDER_TIMEOUT = 10000;
|
|
3
|
-
export declare const resolveAuth: (authProvider: AuthProvider, authContext?: AuthContext | undefined, authProviderTimeout?: number) => Promise<Auth>;
|
|
4
|
-
export declare const resolveInitialAuth: (auth?: Auth | undefined) => Auth;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MobileUpload, MobileUploadStartEvent, MobileUploadProgressEvent, MobileUploadEndEvent, MobileUploadErrorEvent } from '../models/mobile-upload';
|
|
2
|
-
import { MediaStore } from './media-store';
|
|
3
|
-
export declare class MobileUploadImpl implements MobileUpload {
|
|
4
|
-
private readonly dataloader;
|
|
5
|
-
private readonly servicesCache;
|
|
6
|
-
constructor(mediaStore: MediaStore);
|
|
7
|
-
notifyUploadStart(event: MobileUploadStartEvent): void;
|
|
8
|
-
notifyUploadProgress(event: MobileUploadProgressEvent): void;
|
|
9
|
-
notifyUploadEnd(event: MobileUploadEndEvent): void;
|
|
10
|
-
notifyUploadError(event: MobileUploadErrorEvent): void;
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export interface EdgeData {
|
|
2
|
-
data: {
|
|
3
|
-
clientId: string;
|
|
4
|
-
token: string;
|
|
5
|
-
baseUrl: string;
|
|
6
|
-
expiresIn: number;
|
|
7
|
-
iat: number;
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
export declare class StargateClient {
|
|
11
|
-
private baseUrl;
|
|
12
|
-
constructor(baseUrl: string | undefined);
|
|
13
|
-
fetchToken(clientId: string): Promise<EdgeData>;
|
|
14
|
-
isTokenExpired(token: EdgeData): boolean;
|
|
15
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const RECENTS_COLLECTION = "recents";
|
|
2
|
-
export declare const FILE_CACHE_MAX_AGE: number;
|
|
3
|
-
export declare const MAX_RESOLUTION = 4096;
|
|
4
|
-
export declare const CHUNK_SIZE: number;
|
|
5
|
-
export declare const PROCESSING_BATCH_SIZE = 1000;
|
|
6
|
-
export declare const MAX_UPLOAD_FILE_SIZE: number;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { LRUMap } from 'lru_map';
|
|
2
|
-
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
|
-
import { FileState } from './models/file-state';
|
|
4
|
-
export declare class StreamsCache<T> {
|
|
5
|
-
private readonly streams;
|
|
6
|
-
constructor(streams: LRUMap<string, ReplaySubject<T>>);
|
|
7
|
-
has(id: string): boolean;
|
|
8
|
-
set(id: string, stream: ReplaySubject<T>): void;
|
|
9
|
-
get(id: string): ReplaySubject<T> | undefined;
|
|
10
|
-
getOrInsert(id: string, callback: () => ReplaySubject<T>): ReplaySubject<T>;
|
|
11
|
-
removeAll(): void;
|
|
12
|
-
remove(id: string): void;
|
|
13
|
-
get size(): number;
|
|
14
|
-
}
|
|
15
|
-
export declare const getFileStreamsCache: () => StreamsCache<FileState>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { UploadEventPayloadMap, EventPayloadListener } from './client/events';
|
|
2
|
-
export declare const globalMediaEventEmitter: {
|
|
3
|
-
on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E, any>): void;
|
|
4
|
-
off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1, any>): void;
|
|
5
|
-
emit<E_2 extends keyof UploadEventPayloadMap>(event: E_2, payload: UploadEventPayloadMap[E_2]): boolean | undefined;
|
|
6
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type Identifier = FileIdentifier | ExternalImageIdentifier;
|
|
2
|
-
export interface FileIdentifier {
|
|
3
|
-
readonly mediaItemType: 'file';
|
|
4
|
-
readonly id: string;
|
|
5
|
-
readonly occurrenceKey?: string;
|
|
6
|
-
readonly collectionName?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface ExternalImageIdentifier {
|
|
9
|
-
readonly mediaItemType: 'external-image';
|
|
10
|
-
readonly dataURI: string;
|
|
11
|
-
readonly name?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const isFileIdentifier: (identifier: Identifier) => identifier is FileIdentifier;
|
|
14
|
-
export declare const isExternalImageIdentifier: (identifier: Identifier) => identifier is ExternalImageIdentifier;
|
|
15
|
-
export declare const isDifferentIdentifier: (a: Identifier, b: Identifier) => boolean;
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
export { MediaStore, MediaStoreError, isMediaStoreError, getMediaEnvironment, getMediaRegion, } from './client/media-store';
|
|
2
|
-
export type { ResponseFileItem, ItemsPayload, ImageMetadataArtifact, ImageMetadata, MediaStoreResponse, MediaStoreRequestOptions, MediaStoreCreateFileFromUploadParams, MediaStoreCreateFileParams, MediaStoreTouchFileParams, TouchFileDescriptor, MediaStoreTouchFileBody, MediaStoreCreateFileFromBinaryParams, MediaStoreCreateFileFromUploadConditions, MediaStoreCreateFileFromUploadBody, MediaStoreGetFileParams, MediaStoreGetFileImageParams, MediaStoreGetCollectionItemsParams, SourceFile, MediaStoreCopyFileWithTokenBody, MediaStoreCopyFileWithTokenParams, AppendChunksToUploadRequestBody, CreatedTouchedFile, TouchedFiles, EmptyFile, MediaStoreErrorReason, MediaStoreErrorAttributes, } from './client/media-store';
|
|
3
|
-
export { UploadController } from './upload-controller';
|
|
4
|
-
export type { AbortFunction } from './upload-controller';
|
|
5
|
-
export type { MediaItemType, FileItem, FileProcessingStatus, MediaArtifact, Artifacts, FileDetails, } from './models/item';
|
|
6
|
-
export { isPreviewableType, isMediaCollectionItemFullDetails, } from './models/media';
|
|
7
|
-
export type { MediaFileProcessingStatus, MediaType, MediaFile, MediaCollection, MediaCollectionItems, MediaCollectionItem, MediaCollectionItemMinimalDetails, MediaCollectionItemFullDetails, MediaRepresentations, MediaCollectionItemDetails, MediaUpload, MediaChunksProbe, } from './models/media';
|
|
8
|
-
export type { MediaSubscribableItem } from './models/media-subscribable';
|
|
9
|
-
export { getArtifactUrl } from './models/artifacts';
|
|
10
|
-
export type { MediaFileArtifact, MediaFileArtifacts } from './models/artifacts';
|
|
11
|
-
export { isMediaClientError, getMediaClientErrorReason } from './models/errors';
|
|
12
|
-
export type { MediaClientError, MediaClientErrorReason, MediaClientErrorAttributes, } from './models/errors';
|
|
13
|
-
export { isUploadingFileState, isProcessingFileState, isProcessedFileState, isErrorFileState, isPreviewableFileState, isFinalFileState, isImageRepresentationReady, mapMediaFileToFileState, mapMediaItemToFileState, } from './models/file-state';
|
|
14
|
-
export type { FileStatus, FilePreview, PreviewOptions, GetFileOptions, UploadingFileState, ProcessingFileState, ProcessedFileState, ProcessingFailedState, ErrorFileState, NonErrorFileState, PreviewableFileState, FileState, } from './models/file-state';
|
|
15
|
-
export type { MobileUpload, MobileUploadStartEvent, MobileUploadProgressEvent, MobileUploadEndEvent, MobileUploadErrorEvent, } from './models/mobile-upload';
|
|
16
|
-
export { uploadFile } from './uploader';
|
|
17
|
-
export type { UploadableFile, UploadableFileUpfrontIds, UploadFileCallbacks, UploadFileResult, } from './uploader';
|
|
18
|
-
export { request, RequestError, isRequestError, isRateLimitedError, } from './utils/request';
|
|
19
|
-
export type { RequestErrorReason, RequestErrorMetadata, RequestErrorAttributes, } from './utils/request';
|
|
20
|
-
export { isAbortedRequestError, mapResponseToJson, mapResponseToBlob, mapResponseToVoid, createUrl, } from './utils/request/helpers';
|
|
21
|
-
export { PollingFunction } from './utils/polling';
|
|
22
|
-
export { isPollingError, PollingError } from './utils/polling/errors';
|
|
23
|
-
export type { Executor, PollingErrorAttributes, PollingErrorReason, } from './utils/polling/types';
|
|
24
|
-
export type { RequestMethod, RequestParams, RequestHeaders, RetryOptions, ClientOptions, RequestMetadata, RequestOptions, CreateUrlOptions, } from './utils/request/types';
|
|
25
|
-
export type { ImageResizeMode } from './utils/imageResizeModeToFileImageMode';
|
|
26
|
-
export { imageResizeModeToFileImageMode } from './utils/imageResizeModeToFileImageMode';
|
|
27
|
-
export { FileFetcherImpl, FileFetcherError, isFileFetcherError, } from './client/file-fetcher';
|
|
28
|
-
export type { CopySourceFile, CopyDestination, CopyFileOptions, FileFetcher, FileFetcherErrorAttributes, FileFetcherErrorReason, } from './client/file-fetcher';
|
|
29
|
-
export { CollectionFetcher } from './client/collection-fetcher';
|
|
30
|
-
export { MediaClient } from './client/media-client';
|
|
31
|
-
export { StargateClient } from './client/stargate-client';
|
|
32
|
-
export type { EdgeData } from './client/stargate-client';
|
|
33
|
-
export { isImageRemote } from './utils/isImageRemote';
|
|
34
|
-
export { checkWebpSupport } from './utils/checkWebpSupport';
|
|
35
|
-
export { getDimensionsFromBlob } from './utils/getDimensionsFromBlob';
|
|
36
|
-
export type { Dimensions } from './utils/getDimensionsFromBlob';
|
|
37
|
-
export { createMediaSubject } from './utils/createMediaSubject';
|
|
38
|
-
export { safeUnsubscribe } from './utils/safeUnsubscribe';
|
|
39
|
-
export { isFileIdentifier, isExternalImageIdentifier, isDifferentIdentifier, } from './identifier';
|
|
40
|
-
export type { Identifier, FileIdentifier, ExternalImageIdentifier, } from './identifier';
|
|
41
|
-
export type { EventPayloadListener, UploadEventPayloadMap, MediaViewedEventPayload, } from './client/events';
|
|
42
|
-
export { withMediaClient, getMediaClient } from './utils/with-media-client-hoc';
|
|
43
|
-
export type { WithMediaClientConfig, WithMediaClientConfigProps, WithMediaClientFunction, WithMediaClient, } from './utils/with-media-client-hoc';
|
|
44
|
-
export { globalMediaEventEmitter } from './globalMediaEventEmitter';
|
|
45
|
-
export { isMediaBlobUrl, getAttrsFromUrl, addFileAttrsToUrl, objectToQueryString, } from './utils/url';
|
|
46
|
-
export type { MediaBlobUrlAttrs } from './utils/url';
|
|
47
|
-
export { createMediaSubscribable } from './utils/mediaSubscribable';
|
|
48
|
-
export type { MediaSubscribable, MediaSubscription, MediaObserver, } from './utils/mediaSubscribable';
|
|
49
|
-
export { RECENTS_COLLECTION, MAX_RESOLUTION } from './constants';
|
|
50
|
-
/**
|
|
51
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
52
|
-
*/
|
|
53
|
-
export declare const getMediaTypeFromMimeType: (mimeType: string) => import("@atlaskit/media-common").MediaType;
|
|
54
|
-
/**
|
|
55
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
56
|
-
*/
|
|
57
|
-
export declare const isImageMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
58
|
-
/**
|
|
59
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
60
|
-
*/
|
|
61
|
-
export declare const isDocumentMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
64
|
-
*/
|
|
65
|
-
export declare const isMimeTypeSupportedByBrowser: (mimeType: string) => boolean;
|
|
66
|
-
/**
|
|
67
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
68
|
-
*/
|
|
69
|
-
export declare const isImageMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
70
|
-
/**
|
|
71
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
72
|
-
*/
|
|
73
|
-
export declare const isDocumentMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
74
|
-
/**
|
|
75
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
76
|
-
*/
|
|
77
|
-
export declare const isAudioMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
78
|
-
/**
|
|
79
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
80
|
-
*/
|
|
81
|
-
export declare const isVideoMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
82
|
-
/**
|
|
83
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
84
|
-
*/
|
|
85
|
-
export declare const isUnknownMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated This export will be removed. Please use one from @atlaskit/media-common or @atlaskit/media-common/mediaTypeUtils
|
|
88
|
-
*/
|
|
89
|
-
export declare const isMimeTypeSupportedByServer: (mimeType: string) => boolean;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { MediaFileProcessingStatus } from './media';
|
|
2
|
-
export declare type MediaFileArtifact = {
|
|
3
|
-
readonly url: string;
|
|
4
|
-
readonly processingStatus: MediaFileProcessingStatus;
|
|
5
|
-
};
|
|
6
|
-
export interface MediaFileArtifacts {
|
|
7
|
-
'video_1280.mp4'?: MediaFileArtifact;
|
|
8
|
-
'video_640.mp4'?: MediaFileArtifact;
|
|
9
|
-
'document.pdf'?: MediaFileArtifact;
|
|
10
|
-
'audio.mp3'?: MediaFileArtifact;
|
|
11
|
-
}
|
|
12
|
-
export declare const getArtifactUrl: (artifacts: MediaFileArtifacts, prop: keyof MediaFileArtifacts) => string | undefined;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Auth } from '@atlaskit/media-core';
|
|
2
|
-
export interface ClientBasedAuthHeaders {
|
|
3
|
-
readonly 'X-Client-Id': string;
|
|
4
|
-
readonly Authorization: string;
|
|
5
|
-
}
|
|
6
|
-
export interface AsapBasedAuthHeaders {
|
|
7
|
-
readonly 'X-Issuer': string;
|
|
8
|
-
readonly Authorization: string;
|
|
9
|
-
}
|
|
10
|
-
export declare type AuthHeaders = ClientBasedAuthHeaders | AsapBasedAuthHeaders;
|
|
11
|
-
export declare function mapAuthToAuthHeaders(auth: Auth): AuthHeaders;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { Auth } from '@atlaskit/media-core';
|
|
2
|
-
export interface ClientBasedQueryParameters {
|
|
3
|
-
readonly client: string;
|
|
4
|
-
readonly token: string;
|
|
5
|
-
}
|
|
6
|
-
export interface AsapBasedQueryParameters {
|
|
7
|
-
readonly issuer: string;
|
|
8
|
-
readonly token: string;
|
|
9
|
-
}
|
|
10
|
-
export declare type AuthQueryParameters = ClientBasedQueryParameters | AsapBasedQueryParameters;
|
|
11
|
-
export declare function mapAuthToQueryParameters(auth: Auth): AuthQueryParameters;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export type { MediaClientError, MediaClientErrorReason } from './types';
|
|
2
|
-
import { MediaClientError, MediaClientErrorReason } from './types';
|
|
3
|
-
export declare function isMediaClientError(error: any): error is MediaClientError<{
|
|
4
|
-
reason: MediaClientErrorReason;
|
|
5
|
-
}>;
|
|
6
|
-
export declare function getMediaClientErrorReason(err: Error): MediaClientErrorReason | 'unknown';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MediaClientError, MediaClientErrorAttributes } from './types';
|
|
2
|
-
export type { MediaClientError, MediaClientErrorReason, MediaClientErrorAttributes, } from './types';
|
|
3
|
-
export { isMediaClientError, getMediaClientErrorReason } from './helpers';
|
|
4
|
-
/**
|
|
5
|
-
* Base class for media errors
|
|
6
|
-
*/
|
|
7
|
-
export declare abstract class BaseMediaClientError<Attributes extends MediaClientErrorAttributes> extends Error implements MediaClientError<Attributes> {
|
|
8
|
-
readonly message: string;
|
|
9
|
-
constructor(message: string);
|
|
10
|
-
abstract get attributes(): Attributes;
|
|
11
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare type MediaClientErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError' | 'failedAuthProvider' | 'tokenExpired' | 'missingInitialAuth' | 'emptyAuth' | 'authProviderTimedOut' | 'invalidFileId' | 'emptyItems' | 'zeroVersionFile' | 'pollingMaxAttemptsExceeded' | 'fileSizeExceedsLimit';
|
|
2
|
-
export interface MediaClientErrorAttributes {
|
|
3
|
-
reason: MediaClientErrorReason;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* MediaClientError is the main interface which all the errors
|
|
7
|
-
* in Media Client must implement.
|
|
8
|
-
* MediaClientErrorReason is a dictionary that restricts all the possible
|
|
9
|
-
* reasons that the erros can define. Its values are private to this file.
|
|
10
|
-
* Any new error has to define its own Error Reasons locally, and also declare them
|
|
11
|
-
* here to comply with the interface restrictions
|
|
12
|
-
*/
|
|
13
|
-
export interface MediaClientError<Attributes extends MediaClientErrorAttributes> extends Error {
|
|
14
|
-
readonly attributes: Attributes;
|
|
15
|
-
}
|