@atlaskit/media-test-helpers 41.1.0 → 42.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/AGENTS.md +58 -0
- package/CHANGELOG.md +37 -0
- package/I18nWrapper/package.json +1 -8
- package/MockGlobalImage/package.json +1 -8
- package/authProvider/package.json +1 -8
- package/await-error/package.json +1 -8
- package/clipboardEventMocks/package.json +1 -8
- package/collectionNames/package.json +1 -8
- package/createFileState/package.json +1 -8
- package/createMouseEvent/package.json +1 -8
- package/createTouchEvent/package.json +1 -8
- package/dist/cjs/authProvider.js +6 -6
- package/dist/cjs/await-error.js +13 -12
- package/dist/cjs/featureFlagsWrapper/dropdown.js +1 -2
- package/dist/cjs/fileStateFactory/factory/factory.js +7 -7
- package/dist/cjs/fileStateFactory/fileSimulation/simulations.js +66 -66
- package/dist/cjs/getAuthFromContextProvider.js +4 -4
- package/dist/cjs/getMediaAuthProvider.js +4 -4
- package/dist/cjs/mediaPickerAuthProvider.js +4 -4
- package/dist/cjs/mocks/routers/api-router.js +11 -11
- package/dist/cjs/waitUntil.js +2 -2
- package/dist/es2019/featureFlagsWrapper/dropdown.js +1 -2
- package/dist/esm/authProvider.js +6 -6
- package/dist/esm/await-error.js +13 -12
- package/dist/esm/featureFlagsWrapper/dropdown.js +1 -2
- package/dist/esm/fileStateFactory/factory/factory.js +7 -7
- package/dist/esm/fileStateFactory/fileSimulation/simulations.js +66 -66
- package/dist/esm/getAuthFromContextProvider.js +4 -4
- package/dist/esm/getMediaAuthProvider.js +4 -4
- package/dist/esm/mediaPickerAuthProvider.js +4 -4
- package/dist/esm/mocks/routers/api-router.js +11 -11
- package/dist/esm/waitUntil.js +2 -2
- package/docs-content-tabs/package.json +1 -8
- package/exampleMediaFeatureFlags/package.json +1 -8
- package/exampleMediaItems/package.json +1 -8
- package/factory/package.json +1 -8
- package/fakeI18n/package.json +1 -8
- package/fakeMediaClient/package.json +1 -8
- package/featureFlagsWrapper/package.json +1 -8
- package/fileReader/package.json +1 -8
- package/fileSimulation/package.json +1 -8
- package/flushPromises/package.json +1 -8
- package/getAuthFromContextProvider/package.json +1 -8
- package/getMediaAuthProvider/package.json +1 -8
- package/globalEventEmitterListeners/package.json +1 -8
- package/helpers/package.json +1 -8
- package/images/package.json +1 -8
- package/jestHelpers/package.json +1 -8
- package/keyboardEventWithKeyCode/package.json +1 -8
- package/media-mock/package.json +1 -8
- package/mediaBaseURLS/package.json +1 -8
- package/mediaClientProvider/package.json +1 -8
- package/mediaPickerAuthProvider/package.json +1 -8
- package/mock-data-utils/package.json +1 -8
- package/mockCanvas/package.json +1 -8
- package/mockData/package.json +1 -8
- package/mockLoadImage/package.json +1 -8
- package/nextTick/package.json +1 -8
- package/package.json +22 -33
- package/renderWithIntl/package.json +1 -8
- package/simulations/package.json +1 -8
- package/smallImageURI/package.json +1 -8
- package/smallTransparentImageURI/package.json +1 -8
- package/smart-card-state/package.json +1 -8
- package/story-list/package.json +1 -8
- package/story-styles/package.json +1 -8
- package/tallImageURI/package.json +1 -8
- package/timeoutPromise/package.json +1 -8
- package/ufoLogger/package.json +1 -8
- package/utils/package.json +1 -8
- package/videoPreviewURI/package.json +1 -8
- package/videoURI/package.json +1 -8
- package/vr-test-small-image/package.json +1 -8
- package/waitUntil/package.json +1 -8
- package/wideImageURI/package.json +1 -8
- package/wideTransparentImageURI/package.json +1 -8
- package/dist/types-ts4.5/I18nWrapper.d.ts +0 -10
- package/dist/types-ts4.5/MockGlobalImage.d.ts +0 -2
- package/dist/types-ts4.5/authProvider.d.ts +0 -6
- package/dist/types-ts4.5/await-error.d.ts +0 -1
- package/dist/types-ts4.5/clipboardEventMocks.d.ts +0 -122
- package/dist/types-ts4.5/collectionNames.d.ts +0 -5
- package/dist/types-ts4.5/createMouseEvent.d.ts +0 -8
- package/dist/types-ts4.5/createTouchEvent.d.ts +0 -4
- package/dist/types-ts4.5/dataURIs/smallImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/smallTransparentImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/tallImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/videoPreviewURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/videoURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/vr_test_small_image.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/wideImageURI.d.ts +0 -1
- package/dist/types-ts4.5/dataURIs/wideTransparentImageURI.d.ts +0 -1
- package/dist/types-ts4.5/docs-content-tabs.d.ts +0 -14
- package/dist/types-ts4.5/example-mediaFeatureFlags.d.ts +0 -2
- package/dist/types-ts4.5/exampleMediaItems.d.ts +0 -56
- package/dist/types-ts4.5/fakeI18n.d.ts +0 -1
- package/dist/types-ts4.5/fakeMediaClient.d.ts +0 -4
- package/dist/types-ts4.5/featureFlagsWrapper/dropdown.d.ts +0 -6
- package/dist/types-ts4.5/featureFlagsWrapper/helpers.d.ts +0 -5
- package/dist/types-ts4.5/featureFlagsWrapper/index.d.ts +0 -5
- package/dist/types-ts4.5/fileReader.d.ts +0 -19
- package/dist/types-ts4.5/fileStateFactory/factory/createFileState.d.ts +0 -10
- package/dist/types-ts4.5/fileStateFactory/factory/factory.d.ts +0 -45
- package/dist/types-ts4.5/fileStateFactory/factory/helpers.d.ts +0 -7
- package/dist/types-ts4.5/fileStateFactory/factory/index.d.ts +0 -4
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/fileSimulation.d.ts +0 -18
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/index.d.ts +0 -4
- package/dist/types-ts4.5/fileStateFactory/fileSimulation/simulations.d.ts +0 -36
- package/dist/types-ts4.5/fileStateFactory/index.d.ts +0 -8
- package/dist/types-ts4.5/flushPromises.d.ts +0 -2
- package/dist/types-ts4.5/getAuthFromContextProvider.d.ts +0 -1
- package/dist/types-ts4.5/getJest.d.ts +0 -15
- package/dist/types-ts4.5/getMediaAuthProvider.d.ts +0 -3
- package/dist/types-ts4.5/globalEventEmitterListeners.d.ts +0 -1
- package/dist/types-ts4.5/images.d.ts +0 -7
- package/dist/types-ts4.5/index.d.ts +0 -48
- package/dist/types-ts4.5/jestHelpers.d.ts +0 -12
- package/dist/types-ts4.5/keyboardEventWithKeyCode.d.ts +0 -2
- package/dist/types-ts4.5/mediaBaseURLS.d.ts +0 -2
- package/dist/types-ts4.5/mediaClientProvider.d.ts +0 -23
- package/dist/types-ts4.5/mediaPickerAuthProvider.d.ts +0 -3
- package/dist/types-ts4.5/mockCanvas.d.ts +0 -10
- package/dist/types-ts4.5/mockData/handlers/copyWithToken.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/getFile.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/getFileImage.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/index.d.ts +0 -5
- package/dist/types-ts4.5/mockData/handlers/tenantAuth.d.ts +0 -3
- package/dist/types-ts4.5/mockData/handlers/userCollectionFetch.d.ts +0 -3
- package/dist/types-ts4.5/mockData/index.d.ts +0 -50
- package/dist/types-ts4.5/mockData/matchers.d.ts +0 -7
- package/dist/types-ts4.5/mockData/staticCommon.d.ts +0 -4
- package/dist/types-ts4.5/mockData/utils.d.ts +0 -4
- package/dist/types-ts4.5/mockLoadImage.d.ts +0 -4
- package/dist/types-ts4.5/mocks/database/chunk.d.ts +0 -6
- package/dist/types-ts4.5/mocks/database/collection-item.d.ts +0 -29
- package/dist/types-ts4.5/mocks/database/collection.d.ts +0 -5
- package/dist/types-ts4.5/mocks/database/index.d.ts +0 -21
- package/dist/types-ts4.5/mocks/database/upload.d.ts +0 -6
- package/dist/types-ts4.5/mocks/fileAndDirectoriesUtils.d.ts +0 -16
- package/dist/types-ts4.5/mocks/media-mock.d.ts +0 -36
- package/dist/types-ts4.5/mocks/routers/api-router.d.ts +0 -3
- package/dist/types-ts4.5/mocks/routers/index.d.ts +0 -2
- package/dist/types-ts4.5/mocks/routers/media-playground-router.d.ts +0 -3
- package/dist/types-ts4.5/mocks/websockets/index.d.ts +0 -3
- package/dist/types-ts4.5/mocks/websockets/messages.d.ts +0 -34
- package/dist/types-ts4.5/mocks/websockets/remote-upload-server.d.ts +0 -14
- package/dist/types-ts4.5/mocks/websockets/types.d.ts +0 -4
- package/dist/types-ts4.5/nextTick.d.ts +0 -2
- package/dist/types-ts4.5/renderWithIntl.d.ts +0 -7
- package/dist/types-ts4.5/smart-card-state.d.ts +0 -4
- package/dist/types-ts4.5/story-list.d.ts +0 -13
- package/dist/types-ts4.5/story-styles.d.ts +0 -7
- package/dist/types-ts4.5/timeoutPromise.d.ts +0 -1
- package/dist/types-ts4.5/ufoLogger.d.ts +0 -5
- package/dist/types-ts4.5/utils/index.d.ts +0 -2
- package/dist/types-ts4.5/utils/logging.d.ts +0 -23
- package/dist/types-ts4.5/utils/mockData.d.ts +0 -11
- package/dist/types-ts4.5/waitUntil.d.ts +0 -2
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
export { StoryBookAuthProvider } from './authProvider';
|
|
2
|
-
export { fakeMediaClient, getDefaultMediaClientConfig } from './fakeMediaClient';
|
|
3
|
-
export { createStorybookMediaClient, createStorybookMediaClientConfig, createUploadMediaClient, createUploadMediaClientConfig, defaultBaseUrl, defaultParams, } from './mediaClientProvider';
|
|
4
|
-
export { StoryList } from './story-list';
|
|
5
|
-
export type { StoryListItem, StoryListProps } from './story-list';
|
|
6
|
-
export { remoteImage, smallImage, smallTransparentImage, tallImage, wideImage, wideTransparentImage, VRTestSmallImage, } from './images';
|
|
7
|
-
export { videoURI } from './dataURIs/videoURI';
|
|
8
|
-
export { videoPreviewURI } from './dataURIs/videoPreviewURI';
|
|
9
|
-
export { waitUntil } from './waitUntil';
|
|
10
|
-
export { flushPromises } from './flushPromises';
|
|
11
|
-
export { Matrix } from './story-styles';
|
|
12
|
-
export { collectionNames, defaultCollectionName, defaultMediaPickerCollectionName, fileCollectionName, onlyAnimatedGifsCollectionName, } from './collectionNames';
|
|
13
|
-
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, zipFileWithHtmlId, codeFileId, emailFileId, emailUnsupportedFileId, htmlFileId, videoMp4SaganAliensId, vrVideoDetails, } from './exampleMediaItems';
|
|
14
|
-
export { createMouseEvent } from './createMouseEvent';
|
|
15
|
-
export type { MouseEventProps } from './createMouseEvent';
|
|
16
|
-
export { createTouchEvent } from './createTouchEvent';
|
|
17
|
-
export type { TouchEventProps } from './createTouchEvent';
|
|
18
|
-
export declare const authProviderBaseURL = "https://media.staging.atl-paas.net/items";
|
|
19
|
-
export { MEDIA_BASE_URL, MEDIA_PLAYGROUND_BASE_URL } from './mediaBaseURLS';
|
|
20
|
-
export { mediaPickerAuthProvider } from './mediaPickerAuthProvider';
|
|
21
|
-
export { generateFilesFromTestData, MediaMock, mediaMock, isMediaMockOptedIn, mediaMockQueryOptInFlag, } from './mocks/media-mock';
|
|
22
|
-
export type { MockCollections, MockFile, MockFileInputParams, MediaMockConfig, MediaMockControlsBackdoor, } from './mocks/media-mock';
|
|
23
|
-
export { awaitError } from './await-error';
|
|
24
|
-
export { nextTick, sleep } from './nextTick';
|
|
25
|
-
export { timeoutPromise } from './timeoutPromise';
|
|
26
|
-
export { asMock, asMockFunction, asMockReturnValue, asMockFunctionReturnValue, asMockFunctionResolvedValue, expectConstructorToHaveBeenCalledWith, expectFunctionToHaveBeenCalledWith, expectToEqual, } from './jestHelpers';
|
|
27
|
-
export type { ExpectConstructorToHaveBeenCalledWith, ExpectFunctionToHaveBeenCalledWith, JestSpy, JestFunction, } from './jestHelpers';
|
|
28
|
-
export { I18NWrapper } from './I18nWrapper';
|
|
29
|
-
export type { I18NWrapperProps, I18NWrapperState } from './I18nWrapper';
|
|
30
|
-
export { renderWithIntl } from './renderWithIntl';
|
|
31
|
-
export { fakeIntl } from './fakeI18n';
|
|
32
|
-
export { mockCanvas } from './mockCanvas';
|
|
33
|
-
export { default as KeyboardEventWithKeyCode } from './keyboardEventWithKeyCode';
|
|
34
|
-
export { mockFileReader, mockFileReaderError, mockFileReaderWithError, unmockFileReader, } from './fileReader';
|
|
35
|
-
export { loadImageMockSetup, mockLoadImage, mockLoadImageError, unMockLoadImage, } from './mockLoadImage';
|
|
36
|
-
export { ClipboardMockFile, MockDataTransfer, MockDragEvent, MockFileList, getMockClipboardEvent, } from './clipboardEventMocks';
|
|
37
|
-
export { getMediaAuthProvider } from './getMediaAuthProvider';
|
|
38
|
-
export { addGlobalEventEmitterListeners } from './globalEventEmitterListeners';
|
|
39
|
-
export { fakeImage } from './utils/mockData';
|
|
40
|
-
export { enableMediaUfoLogger } from './ufoLogger';
|
|
41
|
-
export { enableMockGlobalImage, disableMockGlobalImage } from './MockGlobalImage';
|
|
42
|
-
export { exampleMediaFeatureFlags } from './example-mediaFeatureFlags';
|
|
43
|
-
export { dataURItoBlob } from './mockData/utils';
|
|
44
|
-
export { mapDataUriToBlob } from './utils/index';
|
|
45
|
-
export { default as FeatureFlagsWrapper } from './featureFlagsWrapper';
|
|
46
|
-
export { FileStateFactory, MediaClientMock, createIdentifier, createFileDetails, createFileState, useRunSimulation, simulateProcessed, simulateProcessing, simulateImmediateFailProcessing, simulateUpload, simulateError, simulateErrorState, simulateManyProcessed, simulateEmptyDetails, simulateUpdateFileId, simulateAlwaysLoading, simulateAlwaysProcessing, } from './fileStateFactory';
|
|
47
|
-
export type { FileStateFactoryOptions, MediaClientMockOptions, Simulation, SimulationUtils, SimulationSettings, SimulationFactory, StandardSimulation, } from './fileStateFactory';
|
|
48
|
-
export { DocsContentTabs } from './docs-content-tabs';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const asMock: (fn: Function) => jest.Mock;
|
|
2
|
-
export declare const asMockFunction: <T extends (...args: any[]) => any>(fn: T) => jest.MockedFunction<T>;
|
|
3
|
-
export declare const asMockReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.Mock;
|
|
4
|
-
export declare const asMockFunctionReturnValue: <T extends (...args: any[]) => any>(fn: T, returnValue: ReturnType<T>) => jest.MockedFunction<T>;
|
|
5
|
-
export declare const asMockFunctionResolvedValue: <T extends (...args: any[]) => any>(fn: T, resolveValue: jest.ResolvedValue<ReturnType<T>>) => jest.MockedFunction<T>;
|
|
6
|
-
export declare const expectToEqual: <T>(actual: T, expected: T) => void;
|
|
7
|
-
export type ExpectFunctionToHaveBeenCalledWith = <T extends (...args: any[]) => any>(func: T, expectedArgs: Parameters<T>) => void;
|
|
8
|
-
export type ExpectConstructorToHaveBeenCalledWith = <T extends new (...args: any[]) => any>(func: T, expectedArgs: ConstructorParameters<T>) => void;
|
|
9
|
-
export declare const expectConstructorToHaveBeenCalledWith: ExpectConstructorToHaveBeenCalledWith;
|
|
10
|
-
export declare const expectFunctionToHaveBeenCalledWith: ExpectFunctionToHaveBeenCalledWith;
|
|
11
|
-
export type JestSpy<T extends (...args: any) => any> = jest.SpyInstance<ReturnType<T>, Parameters<T>>;
|
|
12
|
-
export type JestFunction<T extends (...args: any) => any> = jest.Mock<ReturnType<T>, Parameters<T>>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { MediaClient } from '@atlaskit/media-client';
|
|
2
|
-
import { type MediaClientConfig } from '@atlaskit/media-core';
|
|
3
|
-
import { type MediaEnv } from './mediaPickerAuthProvider';
|
|
4
|
-
export declare const defaultBaseUrl: 'https://media.staging.atl-paas.net';
|
|
5
|
-
export declare const defaultParams: {
|
|
6
|
-
clientId: string;
|
|
7
|
-
asapIssuer: string;
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
};
|
|
10
|
-
interface AuthParameter {
|
|
11
|
-
authType: 'client' | 'asap';
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Creates and returns `MediaClient` (from `media-client`) based on the data provided in parameter object.
|
|
15
|
-
*
|
|
16
|
-
* @param {AuthParameter} authParameter specifies serviceName and whatever auth should be done with clientId or asapIssuer
|
|
17
|
-
* @returns {Context}
|
|
18
|
-
*/
|
|
19
|
-
export declare const createStorybookMediaClient: (authParameter?: AuthParameter) => MediaClient;
|
|
20
|
-
export declare const createStorybookMediaClientConfig: (authParameter?: AuthParameter) => MediaClientConfig;
|
|
21
|
-
export declare const createUploadMediaClient: () => MediaClient;
|
|
22
|
-
export declare const createUploadMediaClientConfig: (stargateBaseUrl?: string, env?: MediaEnv) => MediaClientConfig;
|
|
23
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { type MockStub } from './getJest';
|
|
2
|
-
export declare function mockCanvas(width?: number, height?: number): {
|
|
3
|
-
canvas: {
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
toDataURL: jest.Mock<any, any, any> | MockStub<unknown, unknown>;
|
|
7
|
-
getContext: unknown;
|
|
8
|
-
};
|
|
9
|
-
context: Partial<CanvasRenderingContext2D>;
|
|
10
|
-
};
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { type MockURL } from 'xhr-mock/lib/MockURL';
|
|
2
|
-
import { type MockHeaders } from 'xhr-mock/lib/types';
|
|
3
|
-
import { type ClientBasedAuth } from '@atlaskit/media-core';
|
|
4
|
-
export { exactMatch, exactMatchBody, exactMatchHeaders, exactMatchUrl, matchMethod, } from './matchers';
|
|
5
|
-
export { dataURItoBlob, fillInResponse } from './utils';
|
|
6
|
-
export { copyWithToken, getFile, getFileImage, userCollectionFetch } from './handlers';
|
|
7
|
-
export interface RequestData {
|
|
8
|
-
method?: string;
|
|
9
|
-
url?: MockURL;
|
|
10
|
-
headers?: MockHeaders;
|
|
11
|
-
body?: any;
|
|
12
|
-
}
|
|
13
|
-
export interface ResponseData {
|
|
14
|
-
status?: number;
|
|
15
|
-
reason?: string;
|
|
16
|
-
headers?: MockHeaders;
|
|
17
|
-
body?: any;
|
|
18
|
-
}
|
|
19
|
-
export interface MockContextItem {
|
|
20
|
-
auth: ClientBasedAuth;
|
|
21
|
-
collection: Array<MediaCollectionFile>;
|
|
22
|
-
collectionName: string;
|
|
23
|
-
}
|
|
24
|
-
export declare class MockContext {
|
|
25
|
-
userContext: MockContextItem;
|
|
26
|
-
tenantContext: MockContextItem;
|
|
27
|
-
}
|
|
28
|
-
export interface InternalFile {
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
size: number;
|
|
32
|
-
occurrenceKey: string;
|
|
33
|
-
dataUri: string;
|
|
34
|
-
}
|
|
35
|
-
export interface MediaCollectionFile {
|
|
36
|
-
id: string;
|
|
37
|
-
occurrenceKey: string;
|
|
38
|
-
type: string;
|
|
39
|
-
details: {
|
|
40
|
-
size: number;
|
|
41
|
-
name: string;
|
|
42
|
-
};
|
|
43
|
-
author: {
|
|
44
|
-
id: string;
|
|
45
|
-
userName: string;
|
|
46
|
-
displayName: string;
|
|
47
|
-
active: boolean;
|
|
48
|
-
};
|
|
49
|
-
insertedAt: number;
|
|
50
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type MockRequest } from 'xhr-mock';
|
|
2
|
-
import { type RequestData } from '.';
|
|
3
|
-
export declare const matchMethod: (req: MockRequest, data: RequestData) => boolean;
|
|
4
|
-
export declare const exactMatchUrl: (req: MockRequest, data: RequestData) => boolean;
|
|
5
|
-
export declare const exactMatchHeaders: (req: MockRequest, data: RequestData) => boolean;
|
|
6
|
-
export declare const exactMatchBody: (req: MockRequest, data: RequestData) => boolean;
|
|
7
|
-
export declare const exactMatch: (req: MockRequest, data: RequestData) => boolean;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type InternalFile, type MediaCollectionFile } from '.';
|
|
2
|
-
export declare const fileUri = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAsCAYAAAAXb/p7AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAABYlAAAWJQFJUiTwAAAAB3RJTUUH4gMGFh4MMM+ZEwAABIJJREFUWMPN2FuM3VMUx/HPmU4702lnOtoStDFuVdek0UGnF0pvtCqMqrvwQL0oDxJJ40lISIoHIRJKNa5pDEEVkUi8IBpRCRppBKFBqduUVi/jYe3j/DsznTn//zkP3cnkzH9f1v7t776ttUvqlbo3wTQ8h/exUk/nnlrNNtRRXBPuwKlYhs6UfwgIjDQX3en/ibgFI2sVWS+BzUlQaybvEpxdq+HaBQahM3FBv5LxSfSoWijWg2AJl6J9kLKlOKcW4/UQOB7zDlJ2mBop1kPgKZgyRPnF6CpqvDaBlbNv7BC12gXFpiIUayVYwunpd6i0BDOLdFCrwFHoqKLeOAUp1iqwWRzK1aTFmJ23g3oQbKmybhtWoDkPxVoFNmBEjvqLMCdvB9Wn7k2Vv0j7kMdjKVMcXS3F6gVWDJYy37vRm2uQLMS51VbOO8Wz8JTKzbELP+W00SoHxeoEhqExWIUb8Tg6xfR+nVMgLBDuWZ0ERpqfMXoiHhD38GbszylwrKDYMhzF4QWGgbG41YFHytzUyafYkVNgecDn14vgQpw3SNsVwtXfXEDgmNR+zFAUhxYYDSuLemDqEJ7zRvQVEDnPQEc3N8FFhj4WLhMEvysgsMUwFA8uMBpUrqeDpyniPl5fQCCxDucfrHA4ghca/oIfKQivww8FBJYpjh2M4uACo+K4KuiV03QxxS8WEEicCAsGKxiK4EXi5qgmTRbTvAbfFxA4Whxjrf0pDhQYFdpVjpBqUhuOxBa8UEAgsUwWVktwsXyBTpNYEn1Yq9iObhYU27IUDxRYjB7h4YzU06lGirPFxhyS4FLMyGl4v3C9yv+vxbcFKa7AuDLFisDIqATa+dI/yvdxUPwKzyt2u8wSG3RQgkUffH7Btn5EnylIsSlLMStwQkF68Dl+/v+rQvHZghS7RCx9gMBFij309OFt/DtI/jp8U5DiTWhtzGT2iuOhJeeot+D1Abk9nXRv2opHxcvryCrtllK9bejLCtyAz8ROyiNwB7anaR2M7iN4NafA/SLW6c1GaIdkKiVxo4Rj+mdS367yILQ75ZX0dPZmBtQqgvY/MmQmJlu/iaOnEYen9r+m3zaxnPb263dP+m7DX6l8XHmTXIX3cKXwkp/Hu3gTK8W2vyszsDbhGKzHpJR3rZjKl3FvGuR96MEruCKJXYPTUpvrU7/L0/ec9H03TsL6BrEputPoluF33C920ga8hKNwTIbedJwhvJhyrLJcxMkP4i1xbC3HB1iNL5LNqanP5ky/l4s12o6jcbVwHk5uEA+QJ+Ax4R134KM0dV9iazKyL7NWl4ho7h1xNTbi6fR7pzjHtuNJ8S54O45PbcNWUOxI/U5NffeJ8OET3IzGBvEAPjlN0SRxHo5Ia7AhszuPEK/5x4pAZ1oaZVfqYC8exoe4IQ16q4if9+IalYemknAKJmX6Lbtau8TRNAkTGkVMsB5vJBpdicbOZBj+Fg7EQ3giTdXqtNhXiVeGs0QAVcJrqf1tOC7ZuSdthJ3CQZ0hPPCNCdJM/Cg25cdp3V73H5C3AqXr3FVlAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE4LTAzLTA2VDIyOjMwOjEyLTA1OjAwkZ+D/QAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxOC0wMy0wNlQyMjozMDoxMi0wNTowMODCO0EAAAAASUVORK5CYII=";
|
|
3
|
-
export declare const files: Array<InternalFile>;
|
|
4
|
-
export declare const userCollection: Array<MediaCollectionFile>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const loadImageMockSetup: () => void;
|
|
2
|
-
export declare const mockLoadImage: (naturalWidth?: number, naturalHeight?: number, orientation?: number) => void;
|
|
3
|
-
export declare const mockLoadImageError: (errorMessage?: string) => void;
|
|
4
|
-
export declare const unMockLoadImage: () => void;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type MediaType, type MediaItemDetails, type MediaFileProcessingStatus } from '@atlaskit/media-client';
|
|
2
|
-
export type MediaItemMinimalDetails = {
|
|
3
|
-
readonly name: string;
|
|
4
|
-
readonly size: number;
|
|
5
|
-
};
|
|
6
|
-
type MediaCollectionItem = {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly insertedAt: number;
|
|
9
|
-
readonly occurrenceKey: string;
|
|
10
|
-
readonly details: MediaItemDetails | MediaItemMinimalDetails;
|
|
11
|
-
};
|
|
12
|
-
export declare const isMediaItemDetails: (mediaCollectionItem: MediaItemDetails | MediaItemMinimalDetails) => mediaCollectionItem is MediaItemDetails;
|
|
13
|
-
export type CollectionItem = MediaCollectionItem & {
|
|
14
|
-
readonly collectionName?: string;
|
|
15
|
-
readonly blob?: Blob;
|
|
16
|
-
};
|
|
17
|
-
export type CreateCollectionItemOptions = {
|
|
18
|
-
readonly name?: string;
|
|
19
|
-
readonly mediaType?: MediaType;
|
|
20
|
-
readonly mimeType?: string;
|
|
21
|
-
readonly collectionName?: string;
|
|
22
|
-
readonly occurrenceKey?: string;
|
|
23
|
-
readonly blob?: Blob;
|
|
24
|
-
readonly id?: string;
|
|
25
|
-
readonly processingStatus?: MediaFileProcessingStatus;
|
|
26
|
-
};
|
|
27
|
-
export declare function createEmptyCollectionItem({ id, collectionName, occurrenceKey, }: CreateCollectionItemOptions): CollectionItem;
|
|
28
|
-
export declare function createCollectionItem({ name, mediaType, mimeType, collectionName, occurrenceKey, blob, id, processingStatus, }?: CreateCollectionItemOptions): CollectionItem;
|
|
29
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Database } from 'kakapo';
|
|
2
|
-
import { type ClientBasedAuth } from '@atlaskit/media-core';
|
|
3
|
-
import { type MediaCollection } from './collection';
|
|
4
|
-
import { type CollectionItem } from './collection-item';
|
|
5
|
-
import { type Upload } from './upload';
|
|
6
|
-
import { type Chunk } from './chunk';
|
|
7
|
-
import { type MockCollections } from '../media-mock';
|
|
8
|
-
export { createCollection } from './collection';
|
|
9
|
-
export { createCollectionItem, createEmptyCollectionItem, isMediaItemDetails, } from './collection-item';
|
|
10
|
-
export type { CollectionItem, CreateCollectionItemOptions } from './collection-item';
|
|
11
|
-
export declare const tenantAuth: ClientBasedAuth;
|
|
12
|
-
export declare const userAuth: ClientBasedAuth;
|
|
13
|
-
export declare const userAuthProvider: () => Promise<ClientBasedAuth>;
|
|
14
|
-
export declare const tenantAuthProvider: () => Promise<ClientBasedAuth>;
|
|
15
|
-
export type MediaDatabaseSchema = {
|
|
16
|
-
collection: MediaCollection;
|
|
17
|
-
collectionItem: CollectionItem;
|
|
18
|
-
upload: Upload;
|
|
19
|
-
chunk: Chunk;
|
|
20
|
-
};
|
|
21
|
-
export declare function createDatabase(collections?: MockCollections): Database<MediaDatabaseSchema>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Some utilities and types around this API -
|
|
3
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/File_and_Directory_Entries_API/Introduction
|
|
4
|
-
*/
|
|
5
|
-
interface FileSystemEntry {
|
|
6
|
-
isDirectory: boolean;
|
|
7
|
-
isFile: boolean;
|
|
8
|
-
name: string;
|
|
9
|
-
fullPath: string;
|
|
10
|
-
}
|
|
11
|
-
interface FileSystemFileEntry extends FileSystemEntry {
|
|
12
|
-
file: (resolve: (file: File) => void) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare const createFileSystemFileEntry: (name: string, fullPath: string, imageFile: File) => FileSystemFileEntry;
|
|
15
|
-
export declare const createDropEventWithFiles: (fileSystemEntry: FileSystemEntry, files: File[]) => DragEvent;
|
|
16
|
-
export {};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { type MediaFile } from '@atlaskit/media-client';
|
|
2
|
-
export type MockCollections = {
|
|
3
|
-
[key: string]: Array<MediaFile & {
|
|
4
|
-
blob?: Blob;
|
|
5
|
-
}>;
|
|
6
|
-
};
|
|
7
|
-
export interface MediaMockConfig {
|
|
8
|
-
isSlowServer?: boolean;
|
|
9
|
-
urlsReturnErrorsTo?: string[];
|
|
10
|
-
mockRemoteUploadActivity?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare class MediaMock {
|
|
13
|
-
readonly collections?: MockCollections | undefined;
|
|
14
|
-
private server;
|
|
15
|
-
private routers;
|
|
16
|
-
private dbs;
|
|
17
|
-
private websockets;
|
|
18
|
-
constructor(collections?: MockCollections | undefined);
|
|
19
|
-
enable(config?: MediaMockConfig): void;
|
|
20
|
-
disable(): void;
|
|
21
|
-
}
|
|
22
|
-
export type MockFileInputParams = Partial<MediaFile> & {
|
|
23
|
-
dataUri?: string;
|
|
24
|
-
};
|
|
25
|
-
export type MockFile = MediaFile & {
|
|
26
|
-
blob?: Blob;
|
|
27
|
-
};
|
|
28
|
-
export declare function generateFilesFromTestData(files: MockFileInputParams[]): MockFile[];
|
|
29
|
-
export declare const mediaMock: MediaMock;
|
|
30
|
-
export interface MediaMockControlsBackdoor {
|
|
31
|
-
resetMediaMock: (config?: MediaMockConfig) => void;
|
|
32
|
-
shouldWaitUpload?: boolean;
|
|
33
|
-
uploadImageFromDrag: () => void;
|
|
34
|
-
}
|
|
35
|
-
export declare const mediaMockQueryOptInFlag = "mediaMock=true";
|
|
36
|
-
export declare const isMediaMockOptedIn: () => boolean;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export declare const notifyMetadataPayload: (tenantFileId: string, fileSize: number) => {
|
|
2
|
-
type: string;
|
|
3
|
-
uploadId: string;
|
|
4
|
-
metadata: {
|
|
5
|
-
pending: boolean;
|
|
6
|
-
preview: {
|
|
7
|
-
url: string;
|
|
8
|
-
width: number;
|
|
9
|
-
height: number;
|
|
10
|
-
size: number;
|
|
11
|
-
};
|
|
12
|
-
original: {
|
|
13
|
-
url: string;
|
|
14
|
-
width: number;
|
|
15
|
-
height: number;
|
|
16
|
-
size: number;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare const remoteUploadStartPayload: (tenantFileId: string) => {
|
|
21
|
-
type: string;
|
|
22
|
-
uploadId: string;
|
|
23
|
-
};
|
|
24
|
-
export declare const remoteUploadProgressPayload: (tenantFileId: string, fileSize: number) => {
|
|
25
|
-
type: string;
|
|
26
|
-
uploadId: string;
|
|
27
|
-
currentAmount: number;
|
|
28
|
-
totalAmount: number;
|
|
29
|
-
};
|
|
30
|
-
export declare const remoteUploadEndPayload: (tenantFileId: string, userFileId: string) => {
|
|
31
|
-
type: string;
|
|
32
|
-
uploadId: string;
|
|
33
|
-
fileId: string;
|
|
34
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type Database } from 'kakapo';
|
|
2
|
-
import { type WebSocketServer } from './types';
|
|
3
|
-
import { type MediaDatabaseSchema } from '../database';
|
|
4
|
-
export type RemoteUploadActivityServerParams = {
|
|
5
|
-
database: Database<MediaDatabaseSchema>;
|
|
6
|
-
isSlowServer?: boolean;
|
|
7
|
-
};
|
|
8
|
-
export declare class RemoteUploadActivityServer implements WebSocketServer {
|
|
9
|
-
private wsServer;
|
|
10
|
-
private msgSubscription;
|
|
11
|
-
constructor(params: RemoteUploadActivityServerParams);
|
|
12
|
-
start(): void;
|
|
13
|
-
stop(): void;
|
|
14
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { RenderResult } from '@testing-library/react';
|
|
3
|
-
/**
|
|
4
|
-
* Lazy require to avoid loading @testing-library/react during SSR tests.
|
|
5
|
-
* jest.resetModules() clears the cache, so RTL would register its hooks inside tests.
|
|
6
|
-
*/
|
|
7
|
-
export declare const renderWithIntl: (component: React.ReactNode) => RenderResult;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const url = "https://bitbucket.org/atlassian/incredible-monorepo/pull-requests/42";
|
|
2
|
-
export declare const atlassianProjectUrl = "https://team.atlassian.com/project/CGFCFBKQ-45/about";
|
|
3
|
-
export declare const atlassianProjectCardState: any;
|
|
4
|
-
export declare const cardState: any;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Component, type ReactNode } from 'react';
|
|
3
|
-
export type StoryListItem = {
|
|
4
|
-
readonly title: string;
|
|
5
|
-
readonly content: ReactNode;
|
|
6
|
-
};
|
|
7
|
-
export interface StoryListProps {
|
|
8
|
-
readonly display?: 'row' | 'column';
|
|
9
|
-
readonly children?: StoryListItem[];
|
|
10
|
-
}
|
|
11
|
-
export declare class StoryList extends Component<StoryListProps, {}> {
|
|
12
|
-
render(): React.JSX.Element;
|
|
13
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type StyledComponent } from '@emotion/styled';
|
|
2
|
-
import type { Theme } from '@emotion/react';
|
|
3
|
-
import type { DetailedHTMLProps, TableHTMLAttributes } from 'react';
|
|
4
|
-
export declare const Matrix: StyledComponent<{
|
|
5
|
-
theme?: Theme;
|
|
6
|
-
as?: React.ElementType;
|
|
7
|
-
}, DetailedHTMLProps<TableHTMLAttributes<HTMLTableElement>, HTMLTableElement>, {}>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function timeoutPromise(timeout: number, errorMessage: string): Promise<string>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type Database, type KakapoResponse } from 'kakapo';
|
|
2
|
-
import { type MediaDatabaseSchema } from '../mocks/database';
|
|
3
|
-
export interface LogRequestParams {
|
|
4
|
-
path: string;
|
|
5
|
-
method: string;
|
|
6
|
-
request: any;
|
|
7
|
-
response: KakapoResponse;
|
|
8
|
-
error?: any;
|
|
9
|
-
database?: any;
|
|
10
|
-
}
|
|
11
|
-
export declare enum WsDirection {
|
|
12
|
-
Upstream = "UP",
|
|
13
|
-
Downstream = "DOWN"
|
|
14
|
-
}
|
|
15
|
-
export interface LogWsMessageParams {
|
|
16
|
-
url: string;
|
|
17
|
-
dir: WsDirection;
|
|
18
|
-
type: string;
|
|
19
|
-
payload?: any;
|
|
20
|
-
database?: Database<MediaDatabaseSchema>;
|
|
21
|
-
}
|
|
22
|
-
export declare function logRequest(params: LogRequestParams): void;
|
|
23
|
-
export declare function logWsMessage(params: LogWsMessageParams): void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare const getHackerNoun: () => string;
|
|
2
|
-
export declare const imageFileTypes: string[];
|
|
3
|
-
export declare const textFileTypes: string[];
|
|
4
|
-
export declare const getTextFileType: () => string;
|
|
5
|
-
export declare const getFakeFileName: (ext?: string) => string;
|
|
6
|
-
export declare const getFakeFileSize: (maxSize?: number) => number;
|
|
7
|
-
export declare const fakeImage = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgYmFzZVByb2ZpbGU9ImZ1bGwiIHdpZHRoPSIzMjAiIGhlaWdodD0iMjQwIj4gPHJlY3Qgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgZmlsbD0iZ3JleSIvPiAgPHRleHQgeD0iMCIgeT0iMjAiIGZvbnQtc2l6ZT0iMjAiIHRleHQtYW5jaG9yPSJzdGFydCIgZmlsbD0id2hpdGUiPjMyMHgyNDA8L3RleHQ+IDwvc3ZnPg==";
|
|
8
|
-
export declare const getDateWithOffset: (offset: number) => Date;
|
|
9
|
-
export declare const getPastDate: () => Date;
|
|
10
|
-
export declare const getFutureDate: () => Date;
|
|
11
|
-
export declare const mockDataUri: (width: string, height: string) => string;
|