@atlaskit/media-client 27.0.0 → 27.0.1
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 +8 -0
- package/dist/cjs/client/file-fetcher/index.js +13 -4
- package/dist/es2019/client/file-fetcher/index.js +7 -1
- package/dist/esm/client/file-fetcher/index.js +13 -4
- package/dist/types/client/__mocks__/media-client.d.ts +2 -2
- package/dist/types/client/events.d.ts +1 -1
- package/dist/types/client/media-client.d.ts +7 -7
- package/dist/types/client/media-store/MediaStore.d.ts +4 -4
- package/dist/types/client/media-store/resolveAuth.d.ts +1 -1
- package/dist/types/client/media-store/types.d.ts +6 -6
- package/dist/types/client/mobile-upload.d.ts +3 -3
- package/dist/types/file-streams-cache.d.ts +3 -3
- package/dist/types/globalMediaEventEmitter.d.ts +1 -1
- package/dist/types/models/artifacts.d.ts +1 -1
- package/dist/types/models/auth-headers.d.ts +1 -1
- package/dist/types/models/auth-query-parameters.d.ts +1 -1
- package/dist/types/models/errors/helpers.d.ts +1 -1
- package/dist/types/models/errors/index.d.ts +1 -1
- package/dist/types/models/file-state.d.ts +4 -4
- package/dist/types/models/item.d.ts +1 -1
- package/dist/types/models/media.d.ts +2 -2
- package/dist/types/models/mobile-upload.d.ts +1 -1
- package/dist/types/uploader/index.d.ts +3 -3
- package/dist/types/utils/createFileDataLoader.d.ts +2 -2
- package/dist/types/utils/createMediaSubject.d.ts +1 -1
- package/dist/types/utils/detectEmptyFile.d.ts +1 -1
- package/dist/types/utils/getDimensionsFromBlob.d.ts +1 -1
- package/dist/types/utils/getMediaTypeFromUploadableFile.d.ts +2 -2
- package/dist/types/utils/hashing/hasherCreator.d.ts +1 -1
- package/dist/types/utils/hashing/sha256SimpleHasher.d.ts +1 -1
- package/dist/types/utils/hashing/simpleHasher.d.ts +1 -1
- package/dist/types/utils/hashing/workerHasher.d.ts +1 -1
- package/dist/types/utils/imageResizeModeToFileImageMode.d.ts +1 -1
- package/dist/types/utils/mediaSubscribable/fromObservable.d.ts +3 -3
- package/dist/types/utils/mediaSubscribable/toPromise.d.ts +2 -2
- package/dist/types/utils/mediaSubscribable/types.d.ts +1 -1
- package/dist/types/utils/mobileUpload/helpers.d.ts +5 -5
- package/dist/types/utils/mobileUpload/servicesCache.d.ts +2 -2
- package/dist/types/utils/mobileUpload/stateMachine/index.d.ts +5 -5
- package/dist/types/utils/mobileUpload/stateMachine/states/error.d.ts +2 -2
- package/dist/types/utils/mobileUpload/stateMachine/states/processed.d.ts +2 -2
- package/dist/types/utils/mobileUpload/stateMachine/states/processing.d.ts +2 -2
- package/dist/types/utils/mobileUpload/stateMachine/states/processingFailed.d.ts +2 -2
- package/dist/types/utils/mobileUpload/stateMachine/states/uploading.d.ts +2 -2
- package/dist/types/utils/mobileUpload/stateMachine/types.d.ts +2 -2
- package/dist/types/utils/overrideMediaTypeIfUnknown.d.ts +2 -2
- package/dist/types/utils/polling/errors.d.ts +1 -1
- package/dist/types/utils/polling/index.d.ts +1 -1
- package/dist/types/utils/request/errors.d.ts +1 -1
- package/dist/types/utils/request/helpers.d.ts +3 -3
- package/dist/types/utils/request/index.d.ts +1 -1
- package/dist/types/utils/request/types.d.ts +1 -1
- package/dist/types/utils/shouldFetchRemoteFileStates.d.ts +2 -2
- package/dist/types-ts4.5/client/__mocks__/media-client.d.ts +2 -2
- package/dist/types-ts4.5/client/events.d.ts +1 -1
- package/dist/types-ts4.5/client/media-client.d.ts +7 -7
- package/dist/types-ts4.5/client/media-store/MediaStore.d.ts +4 -4
- package/dist/types-ts4.5/client/media-store/resolveAuth.d.ts +1 -1
- package/dist/types-ts4.5/client/media-store/types.d.ts +6 -6
- package/dist/types-ts4.5/client/mobile-upload.d.ts +3 -3
- package/dist/types-ts4.5/file-streams-cache.d.ts +3 -3
- package/dist/types-ts4.5/globalMediaEventEmitter.d.ts +1 -1
- package/dist/types-ts4.5/models/artifacts.d.ts +1 -1
- package/dist/types-ts4.5/models/auth-headers.d.ts +1 -1
- package/dist/types-ts4.5/models/auth-query-parameters.d.ts +1 -1
- package/dist/types-ts4.5/models/errors/helpers.d.ts +1 -1
- package/dist/types-ts4.5/models/errors/index.d.ts +1 -1
- package/dist/types-ts4.5/models/file-state.d.ts +4 -4
- package/dist/types-ts4.5/models/item.d.ts +1 -1
- package/dist/types-ts4.5/models/media.d.ts +2 -2
- package/dist/types-ts4.5/models/mobile-upload.d.ts +1 -1
- package/dist/types-ts4.5/uploader/index.d.ts +3 -3
- package/dist/types-ts4.5/utils/createFileDataLoader.d.ts +2 -2
- package/dist/types-ts4.5/utils/createMediaSubject.d.ts +1 -1
- package/dist/types-ts4.5/utils/detectEmptyFile.d.ts +1 -1
- package/dist/types-ts4.5/utils/getDimensionsFromBlob.d.ts +1 -1
- package/dist/types-ts4.5/utils/getMediaTypeFromUploadableFile.d.ts +2 -2
- package/dist/types-ts4.5/utils/hashing/hasherCreator.d.ts +1 -1
- package/dist/types-ts4.5/utils/hashing/sha256SimpleHasher.d.ts +1 -1
- package/dist/types-ts4.5/utils/hashing/simpleHasher.d.ts +1 -1
- package/dist/types-ts4.5/utils/hashing/workerHasher.d.ts +1 -1
- package/dist/types-ts4.5/utils/imageResizeModeToFileImageMode.d.ts +1 -1
- package/dist/types-ts4.5/utils/mediaSubscribable/fromObservable.d.ts +3 -3
- package/dist/types-ts4.5/utils/mediaSubscribable/toPromise.d.ts +2 -2
- package/dist/types-ts4.5/utils/mediaSubscribable/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/mobileUpload/helpers.d.ts +5 -5
- package/dist/types-ts4.5/utils/mobileUpload/servicesCache.d.ts +2 -2
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/index.d.ts +5 -5
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/error.d.ts +2 -2
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processed.d.ts +2 -2
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processing.d.ts +2 -2
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/processingFailed.d.ts +2 -2
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/states/uploading.d.ts +2 -2
- package/dist/types-ts4.5/utils/mobileUpload/stateMachine/types.d.ts +2 -2
- package/dist/types-ts4.5/utils/overrideMediaTypeIfUnknown.d.ts +2 -2
- package/dist/types-ts4.5/utils/polling/errors.d.ts +1 -1
- package/dist/types-ts4.5/utils/polling/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/request/errors.d.ts +1 -1
- package/dist/types-ts4.5/utils/request/helpers.d.ts +3 -3
- package/dist/types-ts4.5/utils/request/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/request/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/shouldFetchRemoteFileStates.d.ts +2 -2
- package/example-helpers/styles.ts +1 -1
- package/example-helpers/stylesWrapper.tsx +2 -2
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Auth, AuthContext, AuthProvider } from '@atlaskit/media-core';
|
|
1
|
+
import { type Auth, type AuthContext, type AuthProvider } from '@atlaskit/media-core';
|
|
2
2
|
export declare const DEFAULT_AUTH_PROVIDER_TIMEOUT = 10000;
|
|
3
3
|
export declare const resolveAuth: (authProvider: AuthProvider, authContext?: AuthContext, authProviderTimeout?: number) => Promise<Auth>;
|
|
4
4
|
export declare const resolveInitialAuth: (auth?: Auth) => Auth;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Auth, AsapBasedAuth, AuthContext, ClientAltBasedAuth } from '@atlaskit/media-core';
|
|
2
|
-
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
-
import { MediaFileArtifacts } from '@atlaskit/media-state';
|
|
4
|
-
import { MediaItemDetails, MediaFile, MediaUpload } from '../../models/media';
|
|
5
|
-
import { ClientOptions, RequestHeaders, RequestMethod, RequestParams, RequestMetadata } from '../../utils/request/types';
|
|
6
|
-
import { ChunkHashAlgorithm } from '@atlaskit/media-core';
|
|
1
|
+
import { type Auth, type AsapBasedAuth, type AuthContext, type ClientAltBasedAuth } from '@atlaskit/media-core';
|
|
2
|
+
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
3
|
+
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
4
|
+
import { type MediaItemDetails, type MediaFile, type MediaUpload } from '../../models/media';
|
|
5
|
+
import { type ClientOptions, type RequestHeaders, type RequestMethod, type RequestParams, type RequestMetadata } from '../../utils/request/types';
|
|
6
|
+
import { type ChunkHashAlgorithm } from '@atlaskit/media-core';
|
|
7
7
|
export interface ResponseFileItem {
|
|
8
8
|
id: string;
|
|
9
9
|
type: 'file';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MediaStore } from '@atlaskit/media-state';
|
|
2
|
-
import { MobileUpload, MobileUploadStartEvent, MobileUploadProgressEvent, MobileUploadEndEvent, MobileUploadErrorEvent } from '../models/mobile-upload';
|
|
3
|
-
import { MediaStore as MediaApi } from './media-store';
|
|
1
|
+
import { type MediaStore } from '@atlaskit/media-state';
|
|
2
|
+
import { type MobileUpload, type MobileUploadStartEvent, type MobileUploadProgressEvent, type MobileUploadEndEvent, type MobileUploadErrorEvent } from '../models/mobile-upload';
|
|
3
|
+
import { type MediaStore as MediaApi } from './media-store';
|
|
4
4
|
export declare class MobileUploadImpl implements MobileUpload {
|
|
5
5
|
private readonly store;
|
|
6
6
|
private readonly dataloader;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LRUMap } from 'lru_map';
|
|
2
|
-
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
|
-
import { FileState } from '@atlaskit/media-state';
|
|
1
|
+
import { type LRUMap } from 'lru_map';
|
|
2
|
+
import { type ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
|
+
import { type FileState } from '@atlaskit/media-state';
|
|
4
4
|
export declare class StreamsCache<T> {
|
|
5
5
|
private readonly streams;
|
|
6
6
|
constructor(streams: LRUMap<string, ReplaySubject<T>>);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UploadEventPayloadMap, EventPayloadListener } from './client/events';
|
|
1
|
+
import { type UploadEventPayloadMap, type EventPayloadListener } from './client/events';
|
|
2
2
|
export declare const globalMediaEventEmitter: {
|
|
3
3
|
on<E extends keyof UploadEventPayloadMap>(event: E, listener: EventPayloadListener<UploadEventPayloadMap, E>): void;
|
|
4
4
|
off<E_1 extends keyof UploadEventPayloadMap>(event: E_1, listener: EventPayloadListener<UploadEventPayloadMap, E_1>): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MediaFileArtifacts } from '@atlaskit/media-state';
|
|
1
|
+
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
2
2
|
export declare const getArtifactUrl: (artifacts: MediaFileArtifacts, prop: keyof MediaFileArtifacts) => string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export type { MediaClientError, MediaClientErrorReason } from './types';
|
|
2
|
-
import { MediaClientError, MediaClientErrorReason } from './types';
|
|
2
|
+
import { type MediaClientError, type MediaClientErrorReason } from './types';
|
|
3
3
|
export declare function isMediaClientError(error: any): error is MediaClientError<{
|
|
4
4
|
reason: MediaClientErrorReason;
|
|
5
5
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MediaClientError, MediaClientErrorAttributes } from './types';
|
|
1
|
+
import { type MediaClientError, type MediaClientErrorAttributes } from './types';
|
|
2
2
|
export type { MediaClientError, MediaClientErrorReason, MediaClientErrorAttributes, } from './types';
|
|
3
3
|
export { isMediaClientError, getMediaClientErrorReason } from './helpers';
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { FileStatus as CommonFileStatus } from '@atlaskit/media-common';
|
|
2
|
-
import { MediaStoreResponse } from '../client/media-store';
|
|
3
|
-
import { MediaItemDetails, MediaFile } from './media';
|
|
4
|
-
import { FilePreview, FileState, ErrorFileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ProcessingFailedState } from '@atlaskit/media-state';
|
|
1
|
+
import { type FileStatus as CommonFileStatus } from '@atlaskit/media-common';
|
|
2
|
+
import { type MediaStoreResponse } from '../client/media-store';
|
|
3
|
+
import { type MediaItemDetails, type MediaFile } from './media';
|
|
4
|
+
import { type FilePreview, type FileState, type ErrorFileState, type UploadingFileState, type ProcessingFileState, type ProcessedFileState, type ProcessingFailedState } from '@atlaskit/media-state';
|
|
5
5
|
export type FileStatus = CommonFileStatus;
|
|
6
6
|
export interface PreviewOptions {
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MediaTraceContext, MediaType } from '@atlaskit/media-common';
|
|
2
|
-
import { MediaFileArtifacts } from '@atlaskit/media-state';
|
|
1
|
+
import { type MediaTraceContext, type MediaType } from '@atlaskit/media-common';
|
|
2
|
+
import { type MediaFileArtifacts } from '@atlaskit/media-state';
|
|
3
3
|
export type MediaFileProcessingStatus = 'pending' | 'succeeded' | 'failed';
|
|
4
4
|
export type { MediaType } from '@atlaskit/media-common';
|
|
5
5
|
export declare const isPreviewableType: (type: MediaType) => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ChunkinatorFile } from '@atlaskit/chunkinator';
|
|
2
|
-
import { MediaStore } from '../client/media-store';
|
|
3
|
-
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
1
|
+
import { type ChunkinatorFile } from '@atlaskit/chunkinator';
|
|
2
|
+
import { type MediaStore } from '../client/media-store';
|
|
3
|
+
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
4
4
|
export type UploadableFile = {
|
|
5
5
|
content: ChunkinatorFile;
|
|
6
6
|
name?: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import 'setimmediate';
|
|
2
2
|
import Dataloader from 'dataloader';
|
|
3
|
-
import { MediaStore, ResponseFileItem } from '../client/media-store';
|
|
4
|
-
import { MediaItemDetails } from '../models/media';
|
|
3
|
+
import { type MediaStore, type ResponseFileItem } from '../client/media-store';
|
|
4
|
+
import { type MediaItemDetails } from '../models/media';
|
|
5
5
|
export declare const MAX_BATCH_SIZE = 100;
|
|
6
6
|
export type DataloaderKey = {
|
|
7
7
|
readonly id: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MediaType } from '../models/media';
|
|
2
|
-
import { UploadableFile } from '../uploader';
|
|
1
|
+
import { type MediaType } from '../models/media';
|
|
2
|
+
import { type UploadableFile } from '../uploader';
|
|
3
3
|
export declare const getMediaTypeFromUploadableFile: (file: UploadableFile) => MediaType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Hasher } from './hasher';
|
|
1
|
+
import { type Hasher } from './hasher';
|
|
2
2
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core';
|
|
3
3
|
export declare const destroyHasher: () => null;
|
|
4
4
|
export declare const createHasher: (algorithm: ChunkHashAlgorithm) => Promise<Hasher>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MediaStoreGetFileImageParams } from '../client/media-store';
|
|
1
|
+
import { type MediaStoreGetFileImageParams } from '../client/media-store';
|
|
2
2
|
export type ImageResizeMode = 'crop' | 'fit' | 'full-fit' | 'stretchy-fit';
|
|
3
3
|
export declare const imageResizeModeToFileImageMode: (resizeMode?: ImageResizeMode) => MediaStoreGetFileImageParams['mode'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
2
|
-
import { FileState } from '@atlaskit/media-state';
|
|
3
|
-
import { MediaSubscribable } from './types';
|
|
1
|
+
import { type ReplaySubject } from 'rxjs/ReplaySubject';
|
|
2
|
+
import { type FileState } from '@atlaskit/media-state';
|
|
3
|
+
import { type MediaSubscribable } from './types';
|
|
4
4
|
export declare function fromObservable(observable: ReplaySubject<FileState>): MediaSubscribable;
|
|
5
5
|
export declare function createMediaSubscribable(item?: FileState | Error): MediaSubscribable;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Subscription } from 'rxjs/Subscription';
|
|
2
|
-
import { MediaSubscribable } from './types';
|
|
3
|
-
import { FileState } from '@atlaskit/media-state';
|
|
2
|
+
import { type MediaSubscribable } from './types';
|
|
3
|
+
import { type FileState } from '@atlaskit/media-state';
|
|
4
4
|
/**
|
|
5
5
|
* This is a helper to transform the first value emitted by an MediaSubscribable into a Promise.
|
|
6
6
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Dataloader from 'dataloader';
|
|
1
|
+
import type Dataloader from 'dataloader';
|
|
2
2
|
import { ReplaySubject } from 'rxjs/ReplaySubject';
|
|
3
|
-
import { Interpreter } from 'xstate';
|
|
4
|
-
import { FileState } from '@atlaskit/media-state';
|
|
5
|
-
import { DataloaderKey, DataloaderResult } from '../createFileDataLoader';
|
|
6
|
-
import { StateMachineContext, StateMachineEvent, StateMachineTypestate } from './stateMachine/types';
|
|
3
|
+
import { type Interpreter } from 'xstate';
|
|
4
|
+
import { type FileState } from '@atlaskit/media-state';
|
|
5
|
+
import { type DataloaderKey, type DataloaderResult } from '../createFileDataLoader';
|
|
6
|
+
import { type StateMachineContext, type StateMachineEvent, type StateMachineTypestate } from './stateMachine/types';
|
|
7
7
|
export declare const createMobileFileStateSubject: (service: Interpreter<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>) => ReplaySubject<FileState>;
|
|
8
8
|
export declare const createMobileDownloadFileStream: (dataloader: Dataloader<DataloaderKey, DataloaderResult>, id: string, collectionName?: string, occurrenceKey?: string) => ReplaySubject<FileState>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { LRUMap } from 'lru_map';
|
|
2
|
-
import { Interpreter } from 'xstate';
|
|
3
|
-
import { StateMachineContext, StateMachineEvent, StateMachineTypestate } from './stateMachine/types';
|
|
2
|
+
import { type Interpreter } from 'xstate';
|
|
3
|
+
import { type StateMachineContext, type StateMachineEvent, type StateMachineTypestate } from './stateMachine/types';
|
|
4
4
|
export declare function createServicesCache(): LRUMap<string, Interpreter<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import DataLoader from 'dataloader';
|
|
2
|
-
import { Interpreter, StateMachine } from 'xstate';
|
|
3
|
-
import { UploadingFileState } from '@atlaskit/media-state';
|
|
4
|
-
import { DataloaderKey, DataloaderResult } from '../../createFileDataLoader';
|
|
5
|
-
import { StateMachineContext, StateMachineEvent, StateMachineSchema, StateMachineTypestate } from './types';
|
|
1
|
+
import type DataLoader from 'dataloader';
|
|
2
|
+
import { type Interpreter, type StateMachine } from 'xstate';
|
|
3
|
+
import { type UploadingFileState } from '@atlaskit/media-state';
|
|
4
|
+
import { type DataloaderKey, type DataloaderResult } from '../../createFileDataLoader';
|
|
5
|
+
import { type StateMachineContext, type StateMachineEvent, type StateMachineSchema, type StateMachineTypestate } from './types';
|
|
6
6
|
export declare const createMobileUploadStateMachine: (dataloader: DataLoader<DataloaderKey, DataloaderResult>, initialState: UploadingFileState, collectionName?: string) => StateMachine<StateMachineContext, any, StateMachineEvent, StateMachineTypestate>;
|
|
7
7
|
export declare function createMobileUploadService(machine: StateMachine<StateMachineContext, StateMachineSchema, StateMachineEvent, StateMachineTypestate>): Interpreter<StateMachineContext, StateMachineSchema, StateMachineEvent, StateMachineTypestate>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StateNodeConfig } from 'xstate';
|
|
2
|
-
import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
|
|
1
|
+
import { type StateNodeConfig } from 'xstate';
|
|
2
|
+
import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
|
|
3
3
|
export declare const machineErrorState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StateNodeConfig } from 'xstate';
|
|
2
|
-
import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
|
|
1
|
+
import { type StateNodeConfig } from 'xstate';
|
|
2
|
+
import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
|
|
3
3
|
export declare const machineProcessedState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StateNodeConfig } from 'xstate';
|
|
2
|
-
import { ProcessingStateMachineSchema, StateMachineContext, StateMachineEvent } from '../types';
|
|
1
|
+
import { type StateNodeConfig } from 'xstate';
|
|
2
|
+
import { type ProcessingStateMachineSchema, type StateMachineContext, type StateMachineEvent } from '../types';
|
|
3
3
|
export declare const machineProcessingState: StateNodeConfig<StateMachineContext, ProcessingStateMachineSchema, StateMachineEvent>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StateNodeConfig } from 'xstate';
|
|
2
|
-
import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
|
|
1
|
+
import { type StateNodeConfig } from 'xstate';
|
|
2
|
+
import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
|
|
3
3
|
export declare const machineProcessingFailedState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { StateNodeConfig } from 'xstate';
|
|
2
|
-
import { StateMachineContext, StateMachineSchema, StateMachineEvent } from '../types';
|
|
1
|
+
import { type StateNodeConfig } from 'xstate';
|
|
2
|
+
import { type StateMachineContext, type StateMachineSchema, type StateMachineEvent } from '../types';
|
|
3
3
|
export declare const machineUploadingState: StateNodeConfig<StateMachineContext, StateMachineSchema, StateMachineEvent>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { StateSchema } from 'xstate';
|
|
2
|
-
import { FileState, UploadingFileState, ProcessingFileState, ProcessedFileState, ErrorFileState, ProcessingFailedState } from '@atlaskit/media-state';
|
|
1
|
+
import { type StateSchema } from 'xstate';
|
|
2
|
+
import { type FileState, type UploadingFileState, type ProcessingFileState, type ProcessedFileState, type ErrorFileState, type ProcessingFailedState } from '@atlaskit/media-state';
|
|
3
3
|
export type StateMachineContext = {
|
|
4
4
|
currentFileState: FileState;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FileState } from '@atlaskit/media-state';
|
|
2
|
-
import { MediaType } from '../models/media';
|
|
1
|
+
import { type FileState } from '@atlaskit/media-state';
|
|
2
|
+
import { type MediaType } from '../models/media';
|
|
3
3
|
export declare const overrideMediaTypeIfUnknown: (fileState: FileState, mediaType?: MediaType) => {
|
|
4
4
|
mediaType?: MediaType | undefined;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseMediaClientError } from '../../models/errors';
|
|
2
|
-
import { PollingErrorReason, PollingErrorAttributes } from './types';
|
|
2
|
+
import { type PollingErrorReason, type PollingErrorAttributes } from './types';
|
|
3
3
|
export declare class PollingError extends BaseMediaClientError<PollingErrorAttributes> {
|
|
4
4
|
readonly reason: PollingErrorReason;
|
|
5
5
|
readonly attempts: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseMediaClientError } from '../../models/errors';
|
|
2
|
-
import { RequestErrorReason, RequestErrorMetadata, RequestErrorAttributes } from './types';
|
|
2
|
+
import { type RequestErrorReason, type RequestErrorMetadata, type RequestErrorAttributes } from './types';
|
|
3
3
|
export declare class RequestError extends BaseMediaClientError<RequestErrorAttributes> {
|
|
4
4
|
readonly reason: RequestErrorReason;
|
|
5
5
|
readonly metadata?: RequestErrorMetadata | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Auth } from '@atlaskit/media-core';
|
|
2
|
-
import { MediaTraceContext } from '@atlaskit/media-common';
|
|
1
|
+
import { type Auth } from '@atlaskit/media-core';
|
|
2
|
+
import { type MediaTraceContext } from '@atlaskit/media-common';
|
|
3
3
|
import { RequestError } from './errors';
|
|
4
|
-
import { CreateUrlOptions, RequestErrorReason, RequestErrorMetadata, RequestHeaders, RequestMetadata, RetryOptions } from './types';
|
|
4
|
+
import { type CreateUrlOptions, type RequestErrorReason, type RequestErrorMetadata, type RequestHeaders, type RequestMetadata, type RetryOptions } from './types';
|
|
5
5
|
export declare function waitPromise(timeout: number): Promise<void>;
|
|
6
6
|
export declare function isAbortedRequestError(err: any): boolean;
|
|
7
7
|
export declare function isFetchNetworkError(err: any): err is TypeError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RequestOptions } from './types';
|
|
1
|
+
import { type RequestOptions } from './types';
|
|
2
2
|
export type { RequestErrorReason, RequestErrorMetadata, RequestErrorAttributes, } from './types';
|
|
3
3
|
export { RequestError, isRequestError } from './errors';
|
|
4
4
|
export { isRateLimitedError, createRequestErrorReason } from './helpers';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FilePreview } from '@atlaskit/media-state';
|
|
2
|
-
import { MediaType } from '../models/media';
|
|
1
|
+
import { type FilePreview } from '@atlaskit/media-state';
|
|
2
|
+
import { type MediaType } from '../models/media';
|
|
3
3
|
/**
|
|
4
4
|
* Async helper determining if we should fetch remote fileStates from the backend:
|
|
5
5
|
* - we poll the backend for all supported documents,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { jsx } from '@emotion/react';
|
|
3
|
-
import { ChangeEvent, ReactNode } from 'react';
|
|
3
|
+
import { type ChangeEvent, type ReactNode } from 'react';
|
|
4
4
|
import {
|
|
5
5
|
cardsWrapperStyles,
|
|
6
6
|
fileInputStyles,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
uploadTouchWrapperStyles,
|
|
16
16
|
wrapperStyles,
|
|
17
17
|
} from './styles';
|
|
18
|
-
import { FileStatus } from '../src';
|
|
18
|
+
import { type FileStatus } from '../src';
|
|
19
19
|
|
|
20
20
|
export const Wrapper = ({ children }: { children: ReactNode }) => {
|
|
21
21
|
return <div css={wrapperStyles}>{children}</div>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "27.0.
|
|
3
|
+
"version": "27.0.1",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"@atlaskit/media-core": "^34.2.0",
|
|
61
61
|
"@atlaskit/media-state": "^1.0.0",
|
|
62
62
|
"@atlaskit/ssr": "*",
|
|
63
|
-
"@atlaskit/tokens": "^1.
|
|
63
|
+
"@atlaskit/tokens": "^1.49.0",
|
|
64
64
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
65
65
|
"@atlassian/feature-flags-test-utils": "0.2.1",
|
|
66
66
|
"@emotion/react": "^11.7.1",
|