@atlaskit/media-client 17.1.2 → 18.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.
Files changed (104) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/constants/package.json +8 -1
  3. package/dist/cjs/client/media-store/resolveAuth.js +1 -1
  4. package/dist/cjs/client/mobile-upload.js +1 -1
  5. package/dist/cjs/file-streams-cache.js +2 -2
  6. package/dist/cjs/index.js +0 -9
  7. package/dist/cjs/utils/mobileUpload/servicesCache.js +2 -2
  8. package/dist/cjs/utils/request/helpers.js +4 -4
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/client/media-store/resolveAuth.js +1 -1
  11. package/dist/es2019/client/mobile-upload.js +1 -1
  12. package/dist/es2019/file-streams-cache.js +2 -2
  13. package/dist/es2019/index.js +0 -2
  14. package/dist/es2019/utils/mobileUpload/servicesCache.js +2 -2
  15. package/dist/es2019/utils/request/helpers.js +4 -4
  16. package/dist/es2019/version.json +1 -1
  17. package/dist/esm/client/media-store/resolveAuth.js +1 -1
  18. package/dist/esm/client/mobile-upload.js +1 -1
  19. package/dist/esm/file-streams-cache.js +2 -2
  20. package/dist/esm/index.js +0 -2
  21. package/dist/esm/utils/mobileUpload/servicesCache.js +2 -2
  22. package/dist/esm/utils/request/helpers.js +4 -4
  23. package/dist/esm/version.json +1 -1
  24. package/dist/types/file-streams-cache.d.ts +2 -2
  25. package/dist/types/index.d.ts +0 -1
  26. package/dist/types/utils/mobileUpload/servicesCache.d.ts +2 -2
  27. package/dist/types-ts4.0/client/__mocks__/collection-fetcher.d.ts +8 -0
  28. package/dist/types-ts4.0/client/__mocks__/file-fetcher.d.ts +10 -0
  29. package/dist/types-ts4.0/client/__mocks__/media-client.d.ts +13 -0
  30. package/dist/types-ts4.0/client/collection-fetcher.d.ts +35 -0
  31. package/dist/types-ts4.0/client/events.d.ts +14 -0
  32. package/dist/types-ts4.0/client/file-fetcher/error.d.ts +29 -0
  33. package/dist/types-ts4.0/client/file-fetcher/index.d.ts +56 -0
  34. package/dist/types-ts4.0/client/media-client.d.ts +28 -0
  35. package/dist/types-ts4.0/client/media-store/error.d.ts +16 -0
  36. package/dist/types-ts4.0/client/media-store/index.d.ts +167 -0
  37. package/dist/types-ts4.0/client/media-store/resolveAuth.d.ts +4 -0
  38. package/dist/types-ts4.0/client/mobile-upload.d.ts +11 -0
  39. package/dist/types-ts4.0/client/stargate-client.d.ts +15 -0
  40. package/dist/types-ts4.0/constants.d.ts +6 -0
  41. package/dist/types-ts4.0/file-streams-cache.d.ts +15 -0
  42. package/dist/types-ts4.0/globalMediaEventEmitter.d.ts +6 -0
  43. package/dist/types-ts4.0/identifier.d.ts +15 -0
  44. package/dist/types-ts4.0/index.d.ts +89 -0
  45. package/dist/types-ts4.0/models/artifacts.d.ts +12 -0
  46. package/dist/types-ts4.0/models/auth-headers.d.ts +11 -0
  47. package/dist/types-ts4.0/models/auth-query-parameters.d.ts +11 -0
  48. package/dist/types-ts4.0/models/errors/helpers.d.ts +6 -0
  49. package/dist/types-ts4.0/models/errors/index.d.ts +11 -0
  50. package/dist/types-ts4.0/models/errors/types.d.ts +15 -0
  51. package/dist/types-ts4.0/models/file-state.d.ts +91 -0
  52. package/dist/types-ts4.0/models/item.d.ts +25 -0
  53. package/dist/types-ts4.0/models/media-subscribable.d.ts +3 -0
  54. package/dist/types-ts4.0/models/media.d.ts +66 -0
  55. package/dist/types-ts4.0/models/mobile-upload.d.ts +28 -0
  56. package/dist/types-ts4.0/upload-controller.d.ts +7 -0
  57. package/dist/types-ts4.0/uploader/calculateChunkSize.d.ts +11 -0
  58. package/dist/types-ts4.0/uploader/error.d.ts +29 -0
  59. package/dist/types-ts4.0/uploader/index.d.ts +21 -0
  60. package/dist/types-ts4.0/utils/checkWebpSupport.d.ts +1 -0
  61. package/dist/types-ts4.0/utils/convertBase64ToBlob.d.ts +1 -0
  62. package/dist/types-ts4.0/utils/createFileDataLoader.d.ts +30 -0
  63. package/dist/types-ts4.0/utils/createMediaSubject.d.ts +3 -0
  64. package/dist/types-ts4.0/utils/detectEmptyFile.d.ts +16 -0
  65. package/dist/types-ts4.0/utils/getDimensionsFromBlob.d.ts +6 -0
  66. package/dist/types-ts4.0/utils/getImageDimensionsFromBlob.d.ts +5 -0
  67. package/dist/types-ts4.0/utils/getMediaTypeFromUploadableFile.d.ts +3 -0
  68. package/dist/types-ts4.0/utils/getVideoDimensionsFromBlob.d.ts +6 -0
  69. package/dist/types-ts4.0/utils/hashing/hasher.d.ts +3 -0
  70. package/dist/types-ts4.0/utils/hashing/hasherCreator.d.ts +3 -0
  71. package/dist/types-ts4.0/utils/hashing/simpleHasher.d.ts +4 -0
  72. package/dist/types-ts4.0/utils/hashing/workerHasher.d.ts +16 -0
  73. package/dist/types-ts4.0/utils/imageResizeModeToFileImageMode.d.ts +3 -0
  74. package/dist/types-ts4.0/utils/isImageRemote.d.ts +1 -0
  75. package/dist/types-ts4.0/utils/mediaSubscribable/fromObservable.d.ts +5 -0
  76. package/dist/types-ts4.0/utils/mediaSubscribable/index.d.ts +3 -0
  77. package/dist/types-ts4.0/utils/mediaSubscribable/toPromise.d.ts +10 -0
  78. package/dist/types-ts4.0/utils/mediaSubscribable/types.d.ts +16 -0
  79. package/dist/types-ts4.0/utils/mobileUpload/error.d.ts +29 -0
  80. package/dist/types-ts4.0/utils/mobileUpload/helpers.d.ts +8 -0
  81. package/dist/types-ts4.0/utils/mobileUpload/index.d.ts +5 -0
  82. package/dist/types-ts4.0/utils/mobileUpload/servicesCache.d.ts +4 -0
  83. package/dist/types-ts4.0/utils/mobileUpload/stateMachine/index.d.ts +7 -0
  84. package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/error.d.ts +3 -0
  85. package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/processed.d.ts +3 -0
  86. package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/processing.d.ts +3 -0
  87. package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/processingFailed.d.ts +3 -0
  88. package/dist/types-ts4.0/utils/mobileUpload/stateMachine/states/uploading.d.ts +3 -0
  89. package/dist/types-ts4.0/utils/mobileUpload/stateMachine/types.d.ts +69 -0
  90. package/dist/types-ts4.0/utils/overrideMediaTypeIfUnknown.d.ts +5 -0
  91. package/dist/types-ts4.0/utils/polling/errors.d.ts +12 -0
  92. package/dist/types-ts4.0/utils/polling/index.d.ts +33 -0
  93. package/dist/types-ts4.0/utils/polling/types.d.ts +7 -0
  94. package/dist/types-ts4.0/utils/request/errors.d.ts +20 -0
  95. package/dist/types-ts4.0/utils/request/helpers.d.ts +38 -0
  96. package/dist/types-ts4.0/utils/request/index.d.ts +5 -0
  97. package/dist/types-ts4.0/utils/request/types.d.ts +43 -0
  98. package/dist/types-ts4.0/utils/safeUnsubscribe.d.ts +2 -0
  99. package/dist/types-ts4.0/utils/setTimeoutPromise.d.ts +2 -0
  100. package/dist/types-ts4.0/utils/shouldFetchRemoteFileStates.d.ts +16 -0
  101. package/dist/types-ts4.0/utils/url.d.ts +17 -0
  102. package/dist/types-ts4.0/utils/with-media-client-hoc.d.ts +16 -0
  103. package/package.json +13 -8
  104. package/report.api.md +12 -28
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-client",
3
- "version": "17.1.2",
3
+ "version": "18.0.0",
4
4
  "description": "Media API Web Client Library",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,6 +12,13 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.ts",
17
24
  "af:exports": {
@@ -33,7 +40,7 @@
33
40
  "dataloader": "^2.0.0",
34
41
  "deep-equal": "^1.0.1",
35
42
  "eventemitter2": "^4.1.0",
36
- "lru-fast": "^0.2.2",
43
+ "lru_map": "^0.4.1",
37
44
  "rusha": "^0.8.13",
38
45
  "rxjs": "^5.5.0",
39
46
  "setimmediate": "^1.0.5",
@@ -43,7 +50,7 @@
43
50
  "xstate": "^4.20.0"
44
51
  },
45
52
  "peerDependencies": {
46
- "@atlaskit/media-core": "^33.0.2",
53
+ "@atlaskit/media-core": "^34.0.0",
47
54
  "@emotion/react": "^11.7.1",
48
55
  "react": "^16.8.0"
49
56
  },
@@ -51,7 +58,7 @@
51
58
  "@atlaskit/button": "^16.3.0",
52
59
  "@atlaskit/docs": "*",
53
60
  "@atlaskit/media-card": "^74.1.0",
54
- "@atlaskit/media-core": "^33.0.0",
61
+ "@atlaskit/media-core": "^34.0.0",
55
62
  "@atlaskit/media-test-helpers": "^30.0.0",
56
63
  "@atlaskit/ssr": "*",
57
64
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
@@ -62,11 +69,9 @@
62
69
  "fetch-mock": "^8.0.0",
63
70
  "react": "^16.8.0",
64
71
  "react-dom": "^16.8.0",
65
- "typescript": "4.3.5"
66
- },
67
- "resolutions": {
68
- "lru-fast": "0.2.2"
72
+ "typescript": "4.5.5"
69
73
  },
74
+ "resolutions": {},
70
75
  "techstack": {
71
76
  "@atlassian/frontend": {
72
77
  "circular-dependencies": [
package/report.api.md CHANGED
@@ -1,6 +1,8 @@
1
- ## API Report File for "@atlaskit/media-client"
1
+ ## API Report File for "@atlaskit/media-client".
2
2
 
3
- > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
3
+ > Do not edit this file. This report is auto-generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
4
6
 
5
7
  ```ts
6
8
  import { AsapBasedAuth } from '@atlaskit/media-core';
@@ -10,7 +12,6 @@ import { AuthProvider } from '@atlaskit/media-core';
10
12
  import { ChunkinatorFile } from '@atlaskit/chunkinator';
11
13
  import { ClientAltBasedAuth } from '@atlaskit/media-core';
12
14
  import { FileStatus as FileStatus_2 } from '@atlaskit/media-common';
13
- import { LRUCache } from 'lru-fast';
14
15
  import { MediaApiConfig } from '@atlaskit/media-core';
15
16
  import { MediaClientConfig } from '@atlaskit/media-core';
16
17
  import { MediaFeatureFlags } from '@atlaskit/media-common';
@@ -76,9 +77,8 @@ export declare class CollectionFetcher {
76
77
  ): Promise<void>;
77
78
  }
78
79
 
79
- declare type CompletionObserver<
80
- T extends MediaSubscribableItem
81
- > = PartialObserver<T> & Required<Pick<PartialObserver<T>, 'complete'>>;
80
+ declare type CompletionObserver<T> = PartialObserver<T> &
81
+ Required<Pick<PartialObserver<T>, 'complete'>>;
82
82
 
83
83
  export declare interface CopyDestination
84
84
  extends MediaStoreCopyFileWithTokenParams {
@@ -147,9 +147,7 @@ export declare interface ErrorFileState {
147
147
  message?: string;
148
148
  }
149
149
 
150
- declare type ErrorObserver<T extends MediaSubscribableItem> = PartialObserver<
151
- T
152
- > &
150
+ declare type ErrorObserver<T> = PartialObserver<T> &
153
151
  Required<Pick<PartialObserver<T>, 'error'>>;
154
152
 
155
153
  export declare type EventPayloadListener<
@@ -777,7 +775,7 @@ export declare type MediaFileProcessingStatus =
777
775
 
778
776
  export declare type MediaItemType = 'file' | 'external-image';
779
777
 
780
- export declare type MediaObserver<T extends MediaSubscribableItem> =
778
+ export declare type MediaObserver<T> =
781
779
  | NextObserver<T>
782
780
  | ErrorObserver<T>
783
781
  | CompletionObserver<T>
@@ -1003,7 +1001,7 @@ export declare interface MediaStoreTouchFileParams {
1003
1001
  readonly collection?: string;
1004
1002
  }
1005
1003
 
1006
- export declare type MediaSubscribable<T extends MediaSubscribableItem> = {
1004
+ export declare type MediaSubscribable<T> = {
1007
1005
  subscribe(observer?: MediaObserver<T>): MediaSubscription;
1008
1006
  };
1009
1007
 
@@ -1027,7 +1025,7 @@ export declare interface MediaViewedEventPayload {
1027
1025
  isUserCollection?: boolean;
1028
1026
  }
1029
1027
 
1030
- declare interface MobileUpload {
1028
+ export declare interface MobileUpload {
1031
1029
  notifyUploadStart(event: MobileUploadStartEvent): void;
1032
1030
  notifyUploadProgress(event: MobileUploadProgressEvent): void;
1033
1031
  notifyUploadEnd(event: MobileUploadEndEvent): void;
@@ -1059,9 +1057,7 @@ export declare type MobileUploadStartEvent = {
1059
1057
  createdAt?: number;
1060
1058
  };
1061
1059
 
1062
- declare type NextObserver<T extends MediaSubscribableItem> = PartialObserver<
1063
- T
1064
- > &
1060
+ declare type NextObserver<T> = PartialObserver<T> &
1065
1061
  Required<Pick<PartialObserver<T>, 'next'>>;
1066
1062
 
1067
1063
  export declare type NonErrorFileState = Exclude<FileState, ErrorFileState>;
@@ -1070,7 +1066,7 @@ export declare const objectToQueryString: (json: {
1070
1066
  [key: string]: string | number | boolean | null | undefined;
1071
1067
  }) => string;
1072
1068
 
1073
- declare type PartialObserver<T extends MediaSubscribableItem> = {
1069
+ declare type PartialObserver<T> = {
1074
1070
  next?: (value: T) => void;
1075
1071
  error?: (err: any) => void;
1076
1072
  complete?: () => void;
@@ -1287,18 +1283,6 @@ export declare class StargateClient {
1287
1283
  isTokenExpired(token: EdgeData): boolean;
1288
1284
  }
1289
1285
 
1290
- export declare class StreamsCache<T> {
1291
- private readonly streams;
1292
- constructor(streams: LRUCache<string, ReplaySubject<T>>);
1293
- has(id: string): boolean;
1294
- set(id: string, stream: ReplaySubject<T>): void;
1295
- get(id: string): ReplaySubject<T> | undefined;
1296
- getOrInsert(id: string, callback: () => ReplaySubject<T>): ReplaySubject<T>;
1297
- removeAll(): void;
1298
- remove(id: string): void;
1299
- get size(): number;
1300
- }
1301
-
1302
1286
  export declare type TouchedFiles = {
1303
1287
  created: CreatedTouchedFile[];
1304
1288
  };