@atlaskit/media-client 27.3.2 → 27.3.4
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 +17 -0
- package/dist/cjs/client/media-store/MediaStore.js +8 -18
- package/dist/cjs/index.js +2 -3
- package/dist/cjs/models/artifacts.js +5 -5
- package/dist/cjs/utils/polling/index.js +12 -0
- package/dist/es2019/client/media-store/MediaStore.js +7 -7
- package/dist/es2019/index.js +1 -2
- package/dist/es2019/models/artifacts.js +6 -6
- package/dist/es2019/utils/polling/index.js +1 -0
- package/dist/esm/client/media-store/MediaStore.js +9 -19
- package/dist/esm/index.js +1 -2
- package/dist/esm/models/artifacts.js +6 -6
- package/dist/esm/utils/polling/index.js +1 -0
- package/dist/types/client/__mocks__/collection-fetcher.d.ts +3 -3
- package/dist/types/client/__mocks__/file-fetcher.d.ts +6 -6
- package/dist/types/client/__mocks__/media-client.d.ts +3 -3
- package/dist/types/index.d.ts +1 -2
- package/dist/types/utils/polling/index.d.ts +1 -0
- package/dist/types-ts4.5/client/__mocks__/collection-fetcher.d.ts +3 -3
- package/dist/types-ts4.5/client/__mocks__/file-fetcher.d.ts +6 -6
- package/dist/types-ts4.5/client/__mocks__/media-client.d.ts +3 -3
- package/dist/types-ts4.5/index.d.ts +1 -2
- package/dist/types-ts4.5/utils/polling/index.d.ts +1 -0
- package/example-helpers/styles.ts +11 -11
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 27.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#120529](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120529)
|
|
8
|
+
[`dc8b7900f9d1b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/dc8b7900f9d1b) -
|
|
9
|
+
fix artifacts cdn url
|
|
10
|
+
|
|
11
|
+
## 27.3.3
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#121438](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/121438)
|
|
16
|
+
[`6fc64e2707215`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6fc64e2707215) -
|
|
17
|
+
Exported new test helpers createPollingMaxAttemptsError, createRateLimitedError,
|
|
18
|
+
createServerUnauthorizedError, createMediaStoreError
|
|
19
|
+
|
|
3
20
|
## 27.3.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -291,7 +291,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
291
291
|
params: extendImageParams(params),
|
|
292
292
|
auth: auth
|
|
293
293
|
};
|
|
294
|
-
var imageEndpoint = (0, _platformFeatureFlags.
|
|
294
|
+
var imageEndpoint = (0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') ? 'image/cdn' : 'image';
|
|
295
295
|
return (0, _helpers.createUrl)("".concat(auth.baseUrl, "/file/").concat(id, "/").concat(imageEndpoint), options);
|
|
296
296
|
}
|
|
297
297
|
}, {
|
|
@@ -309,7 +309,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
309
309
|
case 0:
|
|
310
310
|
maxAge = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : _constants.FILE_CACHE_MAX_AGE;
|
|
311
311
|
headers = {};
|
|
312
|
-
binaryEndpoint = (0, _platformFeatureFlags.
|
|
312
|
+
binaryEndpoint = (0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') ? 'binary/cdn' : 'binary';
|
|
313
313
|
metadata = {
|
|
314
314
|
method: 'GET',
|
|
315
315
|
endpoint: "/file/{fileId}/".concat(binaryEndpoint)
|
|
@@ -363,7 +363,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
363
363
|
},
|
|
364
364
|
auth: auth
|
|
365
365
|
};
|
|
366
|
-
binaryEndpoint = (0, _platformFeatureFlags.
|
|
366
|
+
binaryEndpoint = (0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') ? 'binary/cdn' : 'binary';
|
|
367
367
|
return _context6.abrupt("return", (0, _helpers.createUrl)("".concat(auth.baseUrl, "/file/").concat(id, "/").concat(binaryEndpoint), options));
|
|
368
368
|
case 7:
|
|
369
369
|
case "end":
|
|
@@ -391,22 +391,12 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
391
391
|
}
|
|
392
392
|
throw new Error("artifact ".concat(artifactName, " not found"));
|
|
393
393
|
case 3:
|
|
394
|
-
|
|
395
|
-
_context7.next = 9;
|
|
396
|
-
break;
|
|
397
|
-
}
|
|
398
|
-
_context7.next = 6;
|
|
394
|
+
_context7.next = 5;
|
|
399
395
|
return this.resolveAuth({
|
|
400
396
|
collectionName: collectionName
|
|
401
397
|
});
|
|
402
|
-
case
|
|
403
|
-
|
|
404
|
-
_context7.next = 10;
|
|
405
|
-
break;
|
|
406
|
-
case 9:
|
|
407
|
-
_context7.t0 = undefined;
|
|
408
|
-
case 10:
|
|
409
|
-
auth = _context7.t0;
|
|
398
|
+
case 5:
|
|
399
|
+
auth = _context7.sent;
|
|
410
400
|
options = {
|
|
411
401
|
params: {
|
|
412
402
|
collection: collectionName,
|
|
@@ -415,7 +405,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
415
405
|
auth: auth
|
|
416
406
|
};
|
|
417
407
|
return _context7.abrupt("return", (0, _helpers.createUrl)(artifactUrl, options));
|
|
418
|
-
case
|
|
408
|
+
case 8:
|
|
419
409
|
case "end":
|
|
420
410
|
return _context7.stop();
|
|
421
411
|
}
|
|
@@ -440,7 +430,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
440
430
|
if (isWebpSupported) {
|
|
441
431
|
headers.accept = 'image/webp,image/*,*/*;q=0.8';
|
|
442
432
|
}
|
|
443
|
-
imageEndpoint = (0, _platformFeatureFlags.
|
|
433
|
+
imageEndpoint = (0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') ? 'image/cdn' : 'image';
|
|
444
434
|
metadata = {
|
|
445
435
|
method: 'GET',
|
|
446
436
|
endpoint: "/file/{fileId}/".concat(imageEndpoint)
|
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
|
|
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
|
|
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");
|
|
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getArtifactUrl = void 0;
|
|
7
7
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
8
|
var getArtifactUrl = exports.getArtifactUrl = function getArtifactUrl(artifacts, prop) {
|
|
9
|
-
var _artifacts$
|
|
10
|
-
if ((0, _platformFeatureFlags.
|
|
11
|
-
var _artifacts$prop
|
|
12
|
-
return ((_artifacts$prop = artifacts[prop]) === null || _artifacts$prop === void 0 ? void 0 : _artifacts$prop.
|
|
9
|
+
var _artifacts$prop2;
|
|
10
|
+
if ((0, _platformFeatureFlags.fg)('platform.media-cdn-delivery')) {
|
|
11
|
+
var _artifacts$prop;
|
|
12
|
+
return "".concat((_artifacts$prop = artifacts[prop]) === null || _artifacts$prop === void 0 ? void 0 : _artifacts$prop.url, "/cdn");
|
|
13
13
|
}
|
|
14
|
-
return (_artifacts$
|
|
14
|
+
return (_artifacts$prop2 = artifacts[prop]) === null || _artifacts$prop2 === void 0 ? void 0 : _artifacts$prop2.url;
|
|
15
15
|
};
|
|
@@ -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"));
|
|
@@ -6,7 +6,7 @@ import { request } from '../../utils/request';
|
|
|
6
6
|
import { createUrl, createMapResponseToJson, createMapResponseToBlob } from '../../utils/request/helpers';
|
|
7
7
|
import { resolveAuth, resolveInitialAuth } from './resolveAuth';
|
|
8
8
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core';
|
|
9
|
-
import {
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
10
|
const MEDIA_API_REGION = 'media-api-region';
|
|
11
11
|
const MEDIA_API_ENVIRONMENT = 'media-api-environment';
|
|
12
12
|
const extendImageParams = (params, fetchMaxRes = false) => {
|
|
@@ -185,12 +185,12 @@ export class MediaStore {
|
|
|
185
185
|
params: extendImageParams(params),
|
|
186
186
|
auth
|
|
187
187
|
};
|
|
188
|
-
const imageEndpoint =
|
|
188
|
+
const imageEndpoint = fg('platform.media-cdn-delivery') ? 'image/cdn' : 'image';
|
|
189
189
|
return createUrl(`${auth.baseUrl}/file/${id}/${imageEndpoint}`, options);
|
|
190
190
|
}
|
|
191
191
|
async getFileBinary(id, collectionName, maxAge = FILE_CACHE_MAX_AGE) {
|
|
192
192
|
const headers = {};
|
|
193
|
-
const binaryEndpoint =
|
|
193
|
+
const binaryEndpoint = fg('platform.media-cdn-delivery') ? 'binary/cdn' : 'binary';
|
|
194
194
|
const metadata = {
|
|
195
195
|
method: 'GET',
|
|
196
196
|
endpoint: `/file/{fileId}/${binaryEndpoint}`
|
|
@@ -220,7 +220,7 @@ export class MediaStore {
|
|
|
220
220
|
},
|
|
221
221
|
auth
|
|
222
222
|
};
|
|
223
|
-
const binaryEndpoint =
|
|
223
|
+
const binaryEndpoint = fg('platform.media-cdn-delivery') ? 'binary/cdn' : 'binary';
|
|
224
224
|
return createUrl(`${auth.baseUrl}/file/${id}/${binaryEndpoint}`, options);
|
|
225
225
|
}
|
|
226
226
|
async getArtifactURL(artifacts, artifactName, collectionName) {
|
|
@@ -228,9 +228,9 @@ export class MediaStore {
|
|
|
228
228
|
if (!artifactUrl) {
|
|
229
229
|
throw new Error(`artifact ${artifactName} not found`);
|
|
230
230
|
}
|
|
231
|
-
const auth =
|
|
231
|
+
const auth = await this.resolveAuth({
|
|
232
232
|
collectionName
|
|
233
|
-
})
|
|
233
|
+
});
|
|
234
234
|
const options = {
|
|
235
235
|
params: {
|
|
236
236
|
collection: collectionName,
|
|
@@ -247,7 +247,7 @@ export class MediaStore {
|
|
|
247
247
|
if (isWebpSupported) {
|
|
248
248
|
headers.accept = 'image/webp,image/*,*/*;q=0.8';
|
|
249
249
|
}
|
|
250
|
-
const imageEndpoint =
|
|
250
|
+
const imageEndpoint = fg('platform.media-cdn-delivery') ? 'image/cdn' : 'image';
|
|
251
251
|
const metadata = {
|
|
252
252
|
method: 'GET',
|
|
253
253
|
endpoint: `/file/{fileId}/${imageEndpoint}`
|
package/dist/es2019/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';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
export const getArtifactUrl = (artifacts, prop) => {
|
|
3
|
-
var _artifacts$
|
|
4
|
-
if (
|
|
5
|
-
var _artifacts$prop
|
|
6
|
-
return (
|
|
3
|
+
var _artifacts$prop2;
|
|
4
|
+
if (fg('platform.media-cdn-delivery')) {
|
|
5
|
+
var _artifacts$prop;
|
|
6
|
+
return `${(_artifacts$prop = artifacts[prop]) === null || _artifacts$prop === void 0 ? void 0 : _artifacts$prop.url}/cdn`;
|
|
7
7
|
}
|
|
8
|
-
return (_artifacts$
|
|
8
|
+
return (_artifacts$prop2 = artifacts[prop]) === null || _artifacts$prop2 === void 0 ? void 0 : _artifacts$prop2.url;
|
|
9
9
|
};
|
|
@@ -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,
|
|
@@ -12,7 +12,7 @@ import { request as _request } from '../../utils/request';
|
|
|
12
12
|
import { createUrl, createMapResponseToJson, createMapResponseToBlob } from '../../utils/request/helpers';
|
|
13
13
|
import { resolveAuth, resolveInitialAuth } from './resolveAuth';
|
|
14
14
|
import { ChunkHashAlgorithm } from '@atlaskit/media-core';
|
|
15
|
-
import {
|
|
15
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
16
|
var MEDIA_API_REGION = 'media-api-region';
|
|
17
17
|
var MEDIA_API_ENVIRONMENT = 'media-api-environment';
|
|
18
18
|
var extendImageParams = function extendImageParams(params) {
|
|
@@ -284,7 +284,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
284
284
|
params: extendImageParams(params),
|
|
285
285
|
auth: auth
|
|
286
286
|
};
|
|
287
|
-
var imageEndpoint =
|
|
287
|
+
var imageEndpoint = fg('platform.media-cdn-delivery') ? 'image/cdn' : 'image';
|
|
288
288
|
return createUrl("".concat(auth.baseUrl, "/file/").concat(id, "/").concat(imageEndpoint), options);
|
|
289
289
|
}
|
|
290
290
|
}, {
|
|
@@ -302,7 +302,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
302
302
|
case 0:
|
|
303
303
|
maxAge = _args5.length > 2 && _args5[2] !== undefined ? _args5[2] : FILE_CACHE_MAX_AGE;
|
|
304
304
|
headers = {};
|
|
305
|
-
binaryEndpoint =
|
|
305
|
+
binaryEndpoint = fg('platform.media-cdn-delivery') ? 'binary/cdn' : 'binary';
|
|
306
306
|
metadata = {
|
|
307
307
|
method: 'GET',
|
|
308
308
|
endpoint: "/file/{fileId}/".concat(binaryEndpoint)
|
|
@@ -356,7 +356,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
356
356
|
},
|
|
357
357
|
auth: auth
|
|
358
358
|
};
|
|
359
|
-
binaryEndpoint =
|
|
359
|
+
binaryEndpoint = fg('platform.media-cdn-delivery') ? 'binary/cdn' : 'binary';
|
|
360
360
|
return _context6.abrupt("return", createUrl("".concat(auth.baseUrl, "/file/").concat(id, "/").concat(binaryEndpoint), options));
|
|
361
361
|
case 7:
|
|
362
362
|
case "end":
|
|
@@ -384,22 +384,12 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
384
384
|
}
|
|
385
385
|
throw new Error("artifact ".concat(artifactName, " not found"));
|
|
386
386
|
case 3:
|
|
387
|
-
|
|
388
|
-
_context7.next = 9;
|
|
389
|
-
break;
|
|
390
|
-
}
|
|
391
|
-
_context7.next = 6;
|
|
387
|
+
_context7.next = 5;
|
|
392
388
|
return this.resolveAuth({
|
|
393
389
|
collectionName: collectionName
|
|
394
390
|
});
|
|
395
|
-
case
|
|
396
|
-
|
|
397
|
-
_context7.next = 10;
|
|
398
|
-
break;
|
|
399
|
-
case 9:
|
|
400
|
-
_context7.t0 = undefined;
|
|
401
|
-
case 10:
|
|
402
|
-
auth = _context7.t0;
|
|
391
|
+
case 5:
|
|
392
|
+
auth = _context7.sent;
|
|
403
393
|
options = {
|
|
404
394
|
params: {
|
|
405
395
|
collection: collectionName,
|
|
@@ -408,7 +398,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
408
398
|
auth: auth
|
|
409
399
|
};
|
|
410
400
|
return _context7.abrupt("return", createUrl(artifactUrl, options));
|
|
411
|
-
case
|
|
401
|
+
case 8:
|
|
412
402
|
case "end":
|
|
413
403
|
return _context7.stop();
|
|
414
404
|
}
|
|
@@ -433,7 +423,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
433
423
|
if (isWebpSupported) {
|
|
434
424
|
headers.accept = 'image/webp,image/*,*/*;q=0.8';
|
|
435
425
|
}
|
|
436
|
-
imageEndpoint =
|
|
426
|
+
imageEndpoint = fg('platform.media-cdn-delivery') ? 'image/cdn' : 'image';
|
|
437
427
|
metadata = {
|
|
438
428
|
method: 'GET',
|
|
439
429
|
endpoint: "/file/{fileId}/".concat(imageEndpoint)
|
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';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
export var getArtifactUrl = function getArtifactUrl(artifacts, prop) {
|
|
3
|
-
var _artifacts$
|
|
4
|
-
if (
|
|
5
|
-
var _artifacts$prop
|
|
6
|
-
return ((_artifacts$prop = artifacts[prop]) === null || _artifacts$prop === void 0 ? void 0 : _artifacts$prop.
|
|
3
|
+
var _artifacts$prop2;
|
|
4
|
+
if (fg('platform.media-cdn-delivery')) {
|
|
5
|
+
var _artifacts$prop;
|
|
6
|
+
return "".concat((_artifacts$prop = artifacts[prop]) === null || _artifacts$prop === void 0 ? void 0 : _artifacts$prop.url, "/cdn");
|
|
7
7
|
}
|
|
8
|
-
return (_artifacts$
|
|
8
|
+
return (_artifacts$prop2 = artifacts[prop]) === null || _artifacts$prop2 === void 0 ? void 0 : _artifacts$prop2.url;
|
|
9
9
|
};
|
|
@@ -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
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -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';
|
|
@@ -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';
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
3
|
+
"version": "27.3.4",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -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.
|
|
64
|
-
"@atlassian/feature-flags-test-utils": "0.2.
|
|
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",
|