@atlaskit/media-client 27.3.1 → 27.3.3

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/media-client
2
2
 
3
+ ## 27.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#121438](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121438)
8
+ [`6fc64e2707215`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fc64e2707215) -
9
+ Exported new test helpers createPollingMaxAttemptsError, createRateLimitedError,
10
+ createServerUnauthorizedError, createMediaStoreError
11
+
12
+ ## 27.3.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+
3
18
  ## 27.3.1
4
19
 
5
20
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -48,7 +48,7 @@ Object.defineProperty(exports, "MediaStoreError", {
48
48
  Object.defineProperty(exports, "PollingError", {
49
49
  enumerable: true,
50
50
  get: function get() {
51
- return _errors2.PollingError;
51
+ return _polling.PollingError;
52
52
  }
53
53
  });
54
54
  Object.defineProperty(exports, "PollingFunction", {
@@ -246,7 +246,7 @@ Object.defineProperty(exports, "isMediaStoreError", {
246
246
  Object.defineProperty(exports, "isPollingError", {
247
247
  enumerable: true,
248
248
  get: function get() {
249
- return _errors2.isPollingError;
249
+ return _polling.isPollingError;
250
250
  }
251
251
  });
252
252
  Object.defineProperty(exports, "isPreviewableFileState", {
@@ -331,7 +331,6 @@ var _uploader = require("./uploader");
331
331
  var _request = require("./utils/request");
332
332
  var _helpers = require("./utils/request/helpers");
333
333
  var _polling = require("./utils/polling");
334
- var _errors2 = require("./utils/polling/errors");
335
334
  var _imageResizeModeToFileImageMode = require("./utils/imageResizeModeToFileImageMode");
336
335
  var _fileFetcher = require("./client/file-fetcher");
337
336
  var _mediaClient = require("./client/media-client");
@@ -4,7 +4,19 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
+ Object.defineProperty(exports, "PollingError", {
8
+ enumerable: true,
9
+ get: function get() {
10
+ return _errors.PollingError;
11
+ }
12
+ });
7
13
  exports.defaultPollingOptions = exports.PollingFunction = void 0;
14
+ Object.defineProperty(exports, "isPollingError", {
15
+ enumerable: true,
16
+ get: function get() {
17
+ return _errors.isPollingError;
18
+ }
19
+ });
8
20
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
21
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
22
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
@@ -7,8 +7,7 @@ export { isUploadingFileState, isProcessingFileState, isProcessedFileState, isEr
7
7
  export { uploadFile } from './uploader';
8
8
  export { request, RequestError, isRequestError, isRateLimitedError, createRequestErrorReason } from './utils/request';
9
9
  export { isAbortedRequestError, createUrl } from './utils/request/helpers';
10
- export { PollingFunction } from './utils/polling';
11
- export { isPollingError, PollingError } from './utils/polling/errors';
10
+ export { PollingFunction, isPollingError, PollingError } from './utils/polling';
12
11
  export { imageResizeModeToFileImageMode } from './utils/imageResizeModeToFileImageMode';
13
12
  export { FileFetcherImpl, FileFetcherError, isFileFetcherError } from './client/file-fetcher';
14
13
  export { MediaClient } from './client/media-client';
@@ -1,5 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { PollingError } from './errors';
3
+ export { PollingError, isPollingError } from './errors';
3
4
  // default polling options without using feature flags
4
5
  export const defaultPollingOptions = {
5
6
  poll_intervalMs: 3000,
package/dist/esm/index.js CHANGED
@@ -7,8 +7,7 @@ export { isUploadingFileState, isProcessingFileState, isProcessedFileState, isEr
7
7
  export { uploadFile } from './uploader';
8
8
  export { request, RequestError, isRequestError, isRateLimitedError, createRequestErrorReason } from './utils/request';
9
9
  export { isAbortedRequestError, createUrl } from './utils/request/helpers';
10
- export { PollingFunction } from './utils/polling';
11
- export { isPollingError, PollingError } from './utils/polling/errors';
10
+ export { PollingFunction, isPollingError, PollingError } from './utils/polling';
12
11
  export { imageResizeModeToFileImageMode } from './utils/imageResizeModeToFileImageMode';
13
12
  export { FileFetcherImpl, FileFetcherError, isFileFetcherError } from './client/file-fetcher';
14
13
  export { MediaClient } from './client/media-client';
@@ -6,6 +6,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
7
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
8
  import { PollingError } from './errors';
9
+ export { PollingError, isPollingError } from './errors';
9
10
  // default polling options without using feature flags
10
11
  export var defaultPollingOptions = {
11
12
  poll_intervalMs: 3000,
@@ -2,7 +2,7 @@
2
2
  export declare const collectionCache: {};
3
3
  export declare class CollectionFetcher {
4
4
  constructor();
5
- getItems: jest.Mock<any, any>;
6
- removeFile: jest.Mock<any, any>;
7
- loadNextPage: jest.Mock<any, any>;
5
+ getItems: jest.Mock<any, any, any>;
6
+ removeFile: jest.Mock<any, any, any>;
7
+ loadNextPage: jest.Mock<any, any, any>;
8
8
  }
@@ -1,10 +1,10 @@
1
1
  /// <reference types="jest" />
2
2
  export declare class FileFetcher {
3
3
  constructor();
4
- getFileState: jest.Mock<any, any>;
5
- getCurrentState: jest.Mock<any, any>;
6
- getArtifactURL: jest.Mock<any, any>;
7
- touchFiles: jest.Mock<any, any>;
8
- upload: jest.Mock<any, any>;
9
- downloadBinary: jest.Mock<any, any>;
4
+ getFileState: jest.Mock<any, any, any>;
5
+ getCurrentState: jest.Mock<any, any, any>;
6
+ getArtifactURL: jest.Mock<any, any, any>;
7
+ touchFiles: jest.Mock<any, any, any>;
8
+ upload: jest.Mock<any, any, any>;
9
+ downloadBinary: jest.Mock<any, any, any>;
10
10
  }
@@ -5,7 +5,7 @@ export declare class MediaClient {
5
5
  readonly config: MediaClientConfig;
6
6
  readonly file: FileFetcher;
7
7
  constructor(config: MediaClientConfig);
8
- getImage: jest.Mock<any, any>;
9
- getImageUrl: jest.Mock<any, any>;
10
- getImageMetadata: jest.Mock<any, any>;
8
+ getImage: jest.Mock<any, any, any>;
9
+ getImageUrl: jest.Mock<any, any, any>;
10
+ getImageMetadata: jest.Mock<any, any, any>;
11
11
  }
@@ -17,8 +17,7 @@ export type { UploadableFile, UploadableFileUpfrontIds, UploadFileCallbacks, Upl
17
17
  export { request, RequestError, isRequestError, isRateLimitedError, createRequestErrorReason, } from './utils/request';
18
18
  export type { RequestErrorReason, RequestErrorMetadata, RequestErrorAttributes, } from './utils/request';
19
19
  export { isAbortedRequestError, createUrl } from './utils/request/helpers';
20
- export { PollingFunction } from './utils/polling';
21
- export { isPollingError, PollingError } from './utils/polling/errors';
20
+ export { PollingFunction, isPollingError, PollingError } from './utils/polling';
22
21
  export type { Executor, PollingErrorAttributes, PollingErrorReason } from './utils/polling/types';
23
22
  export type { RequestMethod, RequestParams, RequestHeaders, RetryOptions, ClientOptions, RequestMetadata, RequestOptions, CreateUrlOptions, } from './utils/request/types';
24
23
  export type { ImageResizeMode } from './utils/imageResizeModeToFileImageMode';
@@ -1,4 +1,5 @@
1
1
  import { type Executor } from './types';
2
+ export { PollingError, isPollingError } from './errors';
2
3
  export interface PollingOptions {
3
4
  poll_intervalMs: number;
4
5
  poll_maxAttempts: number;
@@ -2,7 +2,7 @@
2
2
  export declare const collectionCache: {};
3
3
  export declare class CollectionFetcher {
4
4
  constructor();
5
- getItems: jest.Mock<any, any>;
6
- removeFile: jest.Mock<any, any>;
7
- loadNextPage: jest.Mock<any, any>;
5
+ getItems: jest.Mock<any, any, any>;
6
+ removeFile: jest.Mock<any, any, any>;
7
+ loadNextPage: jest.Mock<any, any, any>;
8
8
  }
@@ -1,10 +1,10 @@
1
1
  /// <reference types="jest" />
2
2
  export declare class FileFetcher {
3
3
  constructor();
4
- getFileState: jest.Mock<any, any>;
5
- getCurrentState: jest.Mock<any, any>;
6
- getArtifactURL: jest.Mock<any, any>;
7
- touchFiles: jest.Mock<any, any>;
8
- upload: jest.Mock<any, any>;
9
- downloadBinary: jest.Mock<any, any>;
4
+ getFileState: jest.Mock<any, any, any>;
5
+ getCurrentState: jest.Mock<any, any, any>;
6
+ getArtifactURL: jest.Mock<any, any, any>;
7
+ touchFiles: jest.Mock<any, any, any>;
8
+ upload: jest.Mock<any, any, any>;
9
+ downloadBinary: jest.Mock<any, any, any>;
10
10
  }
@@ -5,7 +5,7 @@ export declare class MediaClient {
5
5
  readonly config: MediaClientConfig;
6
6
  readonly file: FileFetcher;
7
7
  constructor(config: MediaClientConfig);
8
- getImage: jest.Mock<any, any>;
9
- getImageUrl: jest.Mock<any, any>;
10
- getImageMetadata: jest.Mock<any, any>;
8
+ getImage: jest.Mock<any, any, any>;
9
+ getImageUrl: jest.Mock<any, any, any>;
10
+ getImageMetadata: jest.Mock<any, any, any>;
11
11
  }
@@ -17,8 +17,7 @@ export type { UploadableFile, UploadableFileUpfrontIds, UploadFileCallbacks, Upl
17
17
  export { request, RequestError, isRequestError, isRateLimitedError, createRequestErrorReason, } from './utils/request';
18
18
  export type { RequestErrorReason, RequestErrorMetadata, RequestErrorAttributes, } from './utils/request';
19
19
  export { isAbortedRequestError, createUrl } from './utils/request/helpers';
20
- export { PollingFunction } from './utils/polling';
21
- export { isPollingError, PollingError } from './utils/polling/errors';
20
+ export { PollingFunction, isPollingError, PollingError } from './utils/polling';
22
21
  export type { Executor, PollingErrorAttributes, PollingErrorReason } from './utils/polling/types';
23
22
  export type { RequestMethod, RequestParams, RequestHeaders, RetryOptions, ClientOptions, RequestMetadata, RequestOptions, CreateUrlOptions, } from './utils/request/types';
24
23
  export type { ImageResizeMode } from './utils/imageResizeModeToFileImageMode';
@@ -1,4 +1,5 @@
1
1
  import { type Executor } from './types';
2
+ export { PollingError, isPollingError } from './errors';
2
3
  export interface PollingOptions {
3
4
  poll_intervalMs: number;
4
5
  poll_maxAttempts: number;
@@ -3,29 +3,29 @@ import { token } from '@atlaskit/tokens';
3
3
  import { css } from '@emotion/react';
4
4
  import { type FileStatus } from '../src';
5
5
 
6
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
6
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
7
7
  export const wrapperStyles = css({
8
8
  display: 'flex',
9
9
  });
10
10
 
11
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
11
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
12
12
  export const imagePreviewStyles = css({
13
13
  width: '300px',
14
14
  });
15
15
 
16
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
16
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
17
17
  export const previewWrapperStyles = css({
18
18
  flex: 1,
19
19
  });
20
20
 
21
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
21
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
22
22
  export const metadataWrapperStyles = css({
23
23
  width: '400px',
24
24
  overflow: 'scroll',
25
25
  flex: 1,
26
26
  });
27
27
 
28
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
28
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
29
29
  export const fileInputStyles = css({
30
30
  color: 'transparent',
31
31
  });
@@ -54,7 +54,7 @@ export const fileWrapperStyles = (status: FileStatus) =>
54
54
  backgroundColor: statusColorMap[status],
55
55
  });
56
56
 
57
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
57
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
58
58
  export const cardsWrapperStyles = css({
59
59
  width: '900px',
60
60
  padding: '10px',
@@ -72,7 +72,7 @@ export const cardsWrapperStyles = css({
72
72
  },
73
73
  });
74
74
 
75
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
75
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
76
76
  export const headerStyles = css({
77
77
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
78
78
  button: {
@@ -80,7 +80,7 @@ export const headerStyles = css({
80
80
  },
81
81
  });
82
82
 
83
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
83
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
84
84
  export const fileStateWrapperStyles = css({
85
85
  border: `1px solid ${token('color.border', '#ccc')}`,
86
86
  margin: '10px',
@@ -88,7 +88,7 @@ export const fileStateWrapperStyles = css({
88
88
  width: '500px',
89
89
  });
90
90
 
91
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
91
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
92
92
  export const uploadTouchWrapperStyles = css({
93
93
  height: '100%',
94
94
  width: '100%',
@@ -100,7 +100,7 @@ export const uploadTouchWrapperStyles = css({
100
100
  alignContent: 'center',
101
101
  });
102
102
 
103
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
103
+ // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
104
104
  export const rowStyles = css({
105
105
  flexDirection: 'row',
106
106
  justifyContent: 'center',
@@ -110,7 +110,7 @@ export const rowStyles = css({
110
110
  },
111
111
  });
112
112
 
113
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
113
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
114
114
  export const responseStyles = css({
115
115
  fontFamily: 'monospace',
116
116
  whiteSpace: 'pre',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/media-client",
3
- "version": "27.3.1",
3
+ "version": "27.3.3",
4
4
  "description": "Media API Web Client Library",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -38,7 +38,7 @@
38
38
  "dependencies": {
39
39
  "@atlaskit/chunkinator": "^6.0.0",
40
40
  "@atlaskit/media-common": "^11.3.0",
41
- "@atlaskit/platform-feature-flags": "0.2.6",
41
+ "@atlaskit/platform-feature-flags": "0.3.0",
42
42
  "@babel/runtime": "^7.0.0",
43
43
  "dataloader": "^2.0.0",
44
44
  "deep-equal": "^1.0.1",
@@ -60,8 +60,8 @@
60
60
  "@atlaskit/media-core": "^34.2.0",
61
61
  "@atlaskit/media-state": "^1.1.0",
62
62
  "@atlaskit/ssr": "*",
63
- "@atlaskit/tokens": "^1.53.0",
64
- "@atlassian/feature-flags-test-utils": "0.2.1",
63
+ "@atlaskit/tokens": "^1.56.0",
64
+ "@atlassian/feature-flags-test-utils": "0.2.3",
65
65
  "@emotion/react": "^11.7.1",
66
66
  "@types/deep-equal": "^1.0.1",
67
67
  "@types/uuid-validate": "^0.0.2",