@atlaskit/media-client 28.0.4 → 28.0.6
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 +19 -0
- package/dist/cjs/client/media-client.js +2 -1
- package/dist/cjs/client/media-store/MediaStore.js +2 -2
- package/dist/cjs/models/artifacts.js +1 -1
- package/dist/cjs/utils/mediaCdn.js +1 -1
- package/dist/cjs/utils/request/helpers.js +9 -2
- package/dist/es2019/client/media-client.js +2 -1
- package/dist/es2019/client/media-store/MediaStore.js +2 -2
- package/dist/es2019/models/artifacts.js +1 -1
- package/dist/es2019/utils/mediaCdn.js +1 -1
- package/dist/es2019/utils/request/helpers.js +9 -2
- package/dist/esm/client/media-client.js +2 -1
- package/dist/esm/client/media-store/MediaStore.js +2 -2
- package/dist/esm/models/artifacts.js +1 -1
- package/dist/esm/utils/mediaCdn.js +1 -1
- package/dist/esm/utils/request/helpers.js +9 -2
- package/dist/types/models/errors/types.d.ts +1 -1
- package/dist/types/utils/request/types.d.ts +1 -1
- package/dist/types-ts4.5/models/errors/types.d.ts +1 -1
- package/dist/types-ts4.5/utils/request/types.d.ts +1 -1
- package/package.json +8 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/media-client
|
|
2
2
|
|
|
3
|
+
## 28.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#156328](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/156328)
|
|
8
|
+
[`91ea9df3f02c3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/91ea9df3f02c3) -
|
|
9
|
+
migrate media CDN FFs to Statsig
|
|
10
|
+
- [#157454](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157454)
|
|
11
|
+
[`94e18b08d21d2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/94e18b08d21d2) -
|
|
12
|
+
add config for authProviderTimeout to media-client to override default timeout
|
|
13
|
+
|
|
14
|
+
## 28.0.5
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#155484](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/155484)
|
|
19
|
+
[`958e4ecdf8ab7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/958e4ecdf8ab7) -
|
|
20
|
+
add nonMediaError reason to media-client
|
|
21
|
+
|
|
3
22
|
## 28.0.4
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -32,7 +32,8 @@ var MediaClient = exports.MediaClient = /*#__PURE__*/function () {
|
|
|
32
32
|
this.mediaStore = mediaApi !== null && mediaApi !== void 0 ? mediaApi : new _mediaStore.MediaStore({
|
|
33
33
|
authProvider: mediaClientConfig.authProvider,
|
|
34
34
|
initialAuth: mediaClientConfig.initialAuth,
|
|
35
|
-
chunkHashAlgorithm: mediaClientConfig.useSha256ForUploads ? _mediaCore.ChunkHashAlgorithm.Sha256 : _mediaCore.ChunkHashAlgorithm.Sha1
|
|
35
|
+
chunkHashAlgorithm: mediaClientConfig.useSha256ForUploads ? _mediaCore.ChunkHashAlgorithm.Sha256 : _mediaCore.ChunkHashAlgorithm.Sha1,
|
|
36
|
+
authProviderTimeout: mediaClientConfig.authProviderTimeoutMs
|
|
36
37
|
});
|
|
37
38
|
this.config = mediaClientConfig;
|
|
38
39
|
this.file = new _fileFetcher.FileFetcherImpl(this.mediaStore, this.store);
|
|
@@ -42,7 +42,7 @@ var jsonHeaders = {
|
|
|
42
42
|
};
|
|
43
43
|
var cdnFeatureFlag = function cdnFeatureFlag(endpoint) {
|
|
44
44
|
var result = endpoint;
|
|
45
|
-
if ((0, _platformFeatureFlags.fg)('platform.media-cdn-delivery')) {
|
|
45
|
+
if ((0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') || (0, _platformFeatureFlags.fg)('platform_media_cdn_delivery')) {
|
|
46
46
|
if ((0, _isCommercial.isCommercial)()) {
|
|
47
47
|
result += '/cdn';
|
|
48
48
|
}
|
|
@@ -54,7 +54,7 @@ var MediaStore = exports.MediaStore = /*#__PURE__*/function () {
|
|
|
54
54
|
var _this = this;
|
|
55
55
|
(0, _classCallCheck2.default)(this, MediaStore);
|
|
56
56
|
(0, _defineProperty2.default)(this, "resolveAuth", function (authContext) {
|
|
57
|
-
return (0, _resolveAuth.resolveAuth)(_this.config.authProvider, authContext);
|
|
57
|
+
return (0, _resolveAuth.resolveAuth)(_this.config.authProvider, authContext, _this.config.authProviderTimeout);
|
|
58
58
|
});
|
|
59
59
|
(0, _defineProperty2.default)(this, "resolveInitialAuth", function () {
|
|
60
60
|
return (0, _resolveAuth.resolveInitialAuth)(_this.config.initialAuth);
|
|
@@ -9,7 +9,7 @@ var _isCommercial = require("../utils/isCommercial");
|
|
|
9
9
|
var getArtifactUrl = exports.getArtifactUrl = function getArtifactUrl(artifacts, prop) {
|
|
10
10
|
var _artifacts$prop, _artifacts$prop3;
|
|
11
11
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
12
|
-
if ((0, _isCommercial.isCommercial)() && (0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') && (_artifacts$prop = artifacts[prop]) !== null && _artifacts$prop !== void 0 && _artifacts$prop.url) {
|
|
12
|
+
if ((0, _isCommercial.isCommercial)() && ((0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') || (0, _platformFeatureFlags.fg)('platform_media_cdn_delivery')) && (_artifacts$prop = artifacts[prop]) !== null && _artifacts$prop !== void 0 && _artifacts$prop.url) {
|
|
13
13
|
var _artifacts$prop2;
|
|
14
14
|
return "".concat((_artifacts$prop2 = artifacts[prop]) === null || _artifacts$prop2 === void 0 ? void 0 : _artifacts$prop2.url, "/cdn");
|
|
15
15
|
}
|
|
@@ -23,7 +23,7 @@ function mapToMediaCdnUrl(url, token) {
|
|
|
23
23
|
return url;
|
|
24
24
|
}
|
|
25
25
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
26
|
-
if ((0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') && (0, _platformFeatureFlags.fg)('platform.media-cdn-single-host')) {
|
|
26
|
+
if (((0, _platformFeatureFlags.fg)('platform.media-cdn-delivery') || (0, _platformFeatureFlags.fg)('platform_media_cdn_delivery')) && ((0, _platformFeatureFlags.fg)('platform.media-cdn-single-host') || (0, _platformFeatureFlags.fg)('platform_media_cdn_single_host'))) {
|
|
27
27
|
try {
|
|
28
28
|
var parsedUrl = new URL(url);
|
|
29
29
|
var cdnHost = MEDIA_CDN_MAP[parsedUrl.host];
|
|
@@ -285,8 +285,15 @@ function createRequestErrorReason(statusCode) {
|
|
|
285
285
|
}
|
|
286
286
|
function createRequestErrorFromResponse(metadata, response) {
|
|
287
287
|
var statusCode = response.status;
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
|
|
289
|
+
// with media-cdn single host feature on ('platform.media-cdn-single-host'), media will make a call to Cloudfront before dt-api-filestore, where 'x-media-region' and 'x-media-env' are set. The absence of these headers indicates a Cloudfront error.
|
|
290
|
+
var _extractMediaHeaders = extractMediaHeaders(response),
|
|
291
|
+
mediaRegion = _extractMediaHeaders.mediaRegion,
|
|
292
|
+
mediaEnv = _extractMediaHeaders.mediaEnv;
|
|
293
|
+
var reason = mediaRegion === 'unknown' || mediaEnv === 'unknown' ? 'nonMediaError' : createRequestErrorReason(statusCode);
|
|
294
|
+
return new _errors.RequestError(reason, _objectSpread(_objectSpread({}, metadata), {}, {
|
|
295
|
+
mediaRegion: mediaRegion,
|
|
296
|
+
mediaEnv: mediaEnv,
|
|
290
297
|
statusCode: statusCode
|
|
291
298
|
}));
|
|
292
299
|
}
|
|
@@ -15,7 +15,8 @@ export class MediaClient {
|
|
|
15
15
|
this.mediaStore = mediaApi !== null && mediaApi !== void 0 ? mediaApi : new MediaApi({
|
|
16
16
|
authProvider: mediaClientConfig.authProvider,
|
|
17
17
|
initialAuth: mediaClientConfig.initialAuth,
|
|
18
|
-
chunkHashAlgorithm: mediaClientConfig.useSha256ForUploads ? ChunkHashAlgorithm.Sha256 : ChunkHashAlgorithm.Sha1
|
|
18
|
+
chunkHashAlgorithm: mediaClientConfig.useSha256ForUploads ? ChunkHashAlgorithm.Sha256 : ChunkHashAlgorithm.Sha1,
|
|
19
|
+
authProviderTimeout: mediaClientConfig.authProviderTimeoutMs
|
|
19
20
|
});
|
|
20
21
|
this.config = mediaClientConfig;
|
|
21
22
|
this.file = new FileFetcherImpl(this.mediaStore, this.store);
|
|
@@ -31,7 +31,7 @@ const jsonHeaders = {
|
|
|
31
31
|
};
|
|
32
32
|
const cdnFeatureFlag = endpoint => {
|
|
33
33
|
let result = endpoint;
|
|
34
|
-
if (fg('platform.media-cdn-delivery')) {
|
|
34
|
+
if (fg('platform.media-cdn-delivery') || fg('platform_media_cdn_delivery')) {
|
|
35
35
|
if (isCommercial()) {
|
|
36
36
|
result += '/cdn';
|
|
37
37
|
}
|
|
@@ -40,7 +40,7 @@ const cdnFeatureFlag = endpoint => {
|
|
|
40
40
|
};
|
|
41
41
|
export class MediaStore {
|
|
42
42
|
constructor(config) {
|
|
43
|
-
_defineProperty(this, "resolveAuth", authContext => resolveAuth(this.config.authProvider, authContext));
|
|
43
|
+
_defineProperty(this, "resolveAuth", authContext => resolveAuth(this.config.authProvider, authContext, this.config.authProviderTimeout));
|
|
44
44
|
_defineProperty(this, "resolveInitialAuth", () => resolveInitialAuth(this.config.initialAuth));
|
|
45
45
|
this.config = config;
|
|
46
46
|
this._chunkHashAlgorithm = config.chunkHashAlgorithm || ChunkHashAlgorithm.Sha1;
|
|
@@ -3,7 +3,7 @@ import { isCommercial } from '../utils/isCommercial';
|
|
|
3
3
|
export const getArtifactUrl = (artifacts, prop) => {
|
|
4
4
|
var _artifacts$prop, _artifacts$prop3;
|
|
5
5
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
6
|
-
if (isCommercial() && fg('platform.media-cdn-delivery') && (_artifacts$prop = artifacts[prop]) !== null && _artifacts$prop !== void 0 && _artifacts$prop.url) {
|
|
6
|
+
if (isCommercial() && (fg('platform.media-cdn-delivery') || fg('platform_media_cdn_delivery')) && (_artifacts$prop = artifacts[prop]) !== null && _artifacts$prop !== void 0 && _artifacts$prop.url) {
|
|
7
7
|
var _artifacts$prop2;
|
|
8
8
|
return `${(_artifacts$prop2 = artifacts[prop]) === null || _artifacts$prop2 === void 0 ? void 0 : _artifacts$prop2.url}/cdn`;
|
|
9
9
|
}
|
|
@@ -16,7 +16,7 @@ export function mapToMediaCdnUrl(url, token) {
|
|
|
16
16
|
return url;
|
|
17
17
|
}
|
|
18
18
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
19
|
-
if (fg('platform.media-cdn-delivery') && fg('platform.media-cdn-single-host')) {
|
|
19
|
+
if ((fg('platform.media-cdn-delivery') || fg('platform_media_cdn_delivery')) && (fg('platform.media-cdn-single-host') || fg('platform_media_cdn_single_host'))) {
|
|
20
20
|
try {
|
|
21
21
|
const parsedUrl = new URL(url);
|
|
22
22
|
const cdnHost = MEDIA_CDN_MAP[parsedUrl.host];
|
|
@@ -183,10 +183,17 @@ export function createRequestErrorFromResponse(metadata, response) {
|
|
|
183
183
|
const {
|
|
184
184
|
status: statusCode
|
|
185
185
|
} = response;
|
|
186
|
-
|
|
186
|
+
|
|
187
|
+
// with media-cdn single host feature on ('platform.media-cdn-single-host'), media will make a call to Cloudfront before dt-api-filestore, where 'x-media-region' and 'x-media-env' are set. The absence of these headers indicates a Cloudfront error.
|
|
188
|
+
const {
|
|
189
|
+
mediaRegion,
|
|
190
|
+
mediaEnv
|
|
191
|
+
} = extractMediaHeaders(response);
|
|
192
|
+
const reason = mediaRegion === 'unknown' || mediaEnv === 'unknown' ? 'nonMediaError' : createRequestErrorReason(statusCode);
|
|
187
193
|
return new RequestError(reason, {
|
|
188
194
|
...metadata,
|
|
189
|
-
|
|
195
|
+
mediaRegion,
|
|
196
|
+
mediaEnv,
|
|
190
197
|
statusCode
|
|
191
198
|
});
|
|
192
199
|
}
|
|
@@ -22,7 +22,8 @@ export var MediaClient = /*#__PURE__*/function () {
|
|
|
22
22
|
this.mediaStore = mediaApi !== null && mediaApi !== void 0 ? mediaApi : new MediaApi({
|
|
23
23
|
authProvider: mediaClientConfig.authProvider,
|
|
24
24
|
initialAuth: mediaClientConfig.initialAuth,
|
|
25
|
-
chunkHashAlgorithm: mediaClientConfig.useSha256ForUploads ? ChunkHashAlgorithm.Sha256 : ChunkHashAlgorithm.Sha1
|
|
25
|
+
chunkHashAlgorithm: mediaClientConfig.useSha256ForUploads ? ChunkHashAlgorithm.Sha256 : ChunkHashAlgorithm.Sha1,
|
|
26
|
+
authProviderTimeout: mediaClientConfig.authProviderTimeoutMs
|
|
26
27
|
});
|
|
27
28
|
this.config = mediaClientConfig;
|
|
28
29
|
this.file = new FileFetcherImpl(this.mediaStore, this.store);
|
|
@@ -36,7 +36,7 @@ var jsonHeaders = {
|
|
|
36
36
|
};
|
|
37
37
|
var cdnFeatureFlag = function cdnFeatureFlag(endpoint) {
|
|
38
38
|
var result = endpoint;
|
|
39
|
-
if (fg('platform.media-cdn-delivery')) {
|
|
39
|
+
if (fg('platform.media-cdn-delivery') || fg('platform_media_cdn_delivery')) {
|
|
40
40
|
if (isCommercial()) {
|
|
41
41
|
result += '/cdn';
|
|
42
42
|
}
|
|
@@ -48,7 +48,7 @@ export var MediaStore = /*#__PURE__*/function () {
|
|
|
48
48
|
var _this = this;
|
|
49
49
|
_classCallCheck(this, MediaStore);
|
|
50
50
|
_defineProperty(this, "resolveAuth", function (authContext) {
|
|
51
|
-
return resolveAuth(_this.config.authProvider, authContext);
|
|
51
|
+
return resolveAuth(_this.config.authProvider, authContext, _this.config.authProviderTimeout);
|
|
52
52
|
});
|
|
53
53
|
_defineProperty(this, "resolveInitialAuth", function () {
|
|
54
54
|
return resolveInitialAuth(_this.config.initialAuth);
|
|
@@ -3,7 +3,7 @@ import { isCommercial } from '../utils/isCommercial';
|
|
|
3
3
|
export var getArtifactUrl = function getArtifactUrl(artifacts, prop) {
|
|
4
4
|
var _artifacts$prop, _artifacts$prop3;
|
|
5
5
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
6
|
-
if (isCommercial() && fg('platform.media-cdn-delivery') && (_artifacts$prop = artifacts[prop]) !== null && _artifacts$prop !== void 0 && _artifacts$prop.url) {
|
|
6
|
+
if (isCommercial() && (fg('platform.media-cdn-delivery') || fg('platform_media_cdn_delivery')) && (_artifacts$prop = artifacts[prop]) !== null && _artifacts$prop !== void 0 && _artifacts$prop.url) {
|
|
7
7
|
var _artifacts$prop2;
|
|
8
8
|
return "".concat((_artifacts$prop2 = artifacts[prop]) === null || _artifacts$prop2 === void 0 ? void 0 : _artifacts$prop2.url, "/cdn");
|
|
9
9
|
}
|
|
@@ -16,7 +16,7 @@ export function mapToMediaCdnUrl(url, token) {
|
|
|
16
16
|
return url;
|
|
17
17
|
}
|
|
18
18
|
// eslint-disable-next-line @atlaskit/platform/no-preconditioning
|
|
19
|
-
if (fg('platform.media-cdn-delivery') && fg('platform.media-cdn-single-host')) {
|
|
19
|
+
if ((fg('platform.media-cdn-delivery') || fg('platform_media_cdn_delivery')) && (fg('platform.media-cdn-single-host') || fg('platform_media_cdn_single_host'))) {
|
|
20
20
|
try {
|
|
21
21
|
var parsedUrl = new URL(url);
|
|
22
22
|
var cdnHost = MEDIA_CDN_MAP[parsedUrl.host];
|
|
@@ -263,8 +263,15 @@ export function createRequestErrorReason(statusCode) {
|
|
|
263
263
|
}
|
|
264
264
|
export function createRequestErrorFromResponse(metadata, response) {
|
|
265
265
|
var statusCode = response.status;
|
|
266
|
-
|
|
267
|
-
|
|
266
|
+
|
|
267
|
+
// with media-cdn single host feature on ('platform.media-cdn-single-host'), media will make a call to Cloudfront before dt-api-filestore, where 'x-media-region' and 'x-media-env' are set. The absence of these headers indicates a Cloudfront error.
|
|
268
|
+
var _extractMediaHeaders = extractMediaHeaders(response),
|
|
269
|
+
mediaRegion = _extractMediaHeaders.mediaRegion,
|
|
270
|
+
mediaEnv = _extractMediaHeaders.mediaEnv;
|
|
271
|
+
var reason = mediaRegion === 'unknown' || mediaEnv === 'unknown' ? 'nonMediaError' : createRequestErrorReason(statusCode);
|
|
272
|
+
return new RequestError(reason, _objectSpread(_objectSpread({}, metadata), {}, {
|
|
273
|
+
mediaRegion: mediaRegion,
|
|
274
|
+
mediaEnv: mediaEnv,
|
|
268
275
|
statusCode: statusCode
|
|
269
276
|
}));
|
|
270
277
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type MediaClientErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError' | 'failedAuthProvider' | 'tokenExpired' | 'missingInitialAuth' | 'emptyAuth' | 'authProviderTimedOut' | 'invalidFileId' | 'emptyItems' | 'zeroVersionFile' | 'emptyFileName' | 'pollingMaxAttemptsExceeded' | 'fileSizeExceedsLimit' | 'deprecatedEndpoint';
|
|
1
|
+
export type MediaClientErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError' | 'nonMediaError' | 'failedAuthProvider' | 'tokenExpired' | 'missingInitialAuth' | 'emptyAuth' | 'authProviderTimedOut' | 'invalidFileId' | 'emptyItems' | 'zeroVersionFile' | 'emptyFileName' | 'pollingMaxAttemptsExceeded' | 'fileSizeExceedsLimit' | 'deprecatedEndpoint';
|
|
2
2
|
export interface MediaClientErrorAttributes {
|
|
3
3
|
reason: MediaClientErrorReason;
|
|
4
4
|
}
|
|
@@ -35,7 +35,7 @@ export type CreateUrlOptions = {
|
|
|
35
35
|
readonly params?: RequestParams;
|
|
36
36
|
readonly auth?: Auth;
|
|
37
37
|
};
|
|
38
|
-
export type RequestErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError';
|
|
38
|
+
export type RequestErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'nonMediaError' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError';
|
|
39
39
|
export type RequestErrorMetadata = RequestMetadata & {
|
|
40
40
|
readonly attempts?: number;
|
|
41
41
|
readonly clientExhaustedRetries?: boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type MediaClientErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError' | 'failedAuthProvider' | 'tokenExpired' | 'missingInitialAuth' | 'emptyAuth' | 'authProviderTimedOut' | 'invalidFileId' | 'emptyItems' | 'zeroVersionFile' | 'emptyFileName' | 'pollingMaxAttemptsExceeded' | 'fileSizeExceedsLimit' | 'deprecatedEndpoint';
|
|
1
|
+
export type MediaClientErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError' | 'nonMediaError' | 'failedAuthProvider' | 'tokenExpired' | 'missingInitialAuth' | 'emptyAuth' | 'authProviderTimedOut' | 'invalidFileId' | 'emptyItems' | 'zeroVersionFile' | 'emptyFileName' | 'pollingMaxAttemptsExceeded' | 'fileSizeExceedsLimit' | 'deprecatedEndpoint';
|
|
2
2
|
export interface MediaClientErrorAttributes {
|
|
3
3
|
reason: MediaClientErrorReason;
|
|
4
4
|
}
|
|
@@ -35,7 +35,7 @@ export type CreateUrlOptions = {
|
|
|
35
35
|
readonly params?: RequestParams;
|
|
36
36
|
readonly auth?: Auth;
|
|
37
37
|
};
|
|
38
|
-
export type RequestErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError';
|
|
38
|
+
export type RequestErrorReason = 'clientOffline' | 'clientAbortedRequest' | 'clientTimeoutRequest' | 'nonMediaError' | 'serverInvalidBody' | 'serverBadRequest' | 'serverUnauthorized' | 'serverForbidden' | 'serverNotFound' | 'serverRateLimited' | 'serverInternalError' | 'serverBadGateway' | 'serverUnexpectedError';
|
|
39
39
|
export type RequestErrorMetadata = RequestMetadata & {
|
|
40
40
|
readonly attempts?: number;
|
|
41
41
|
readonly clientExhaustedRetries?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/media-client",
|
|
3
|
-
"version": "28.0.
|
|
3
|
+
"version": "28.0.6",
|
|
4
4
|
"description": "Media API Web Client Library",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@atlaskit/chunkinator": "^6.1.0",
|
|
38
|
-
"@atlaskit/media-common": "^11.
|
|
38
|
+
"@atlaskit/media-common": "^11.7.0",
|
|
39
39
|
"@atlaskit/platform-feature-flags": "0.3.0",
|
|
40
40
|
"@babel/runtime": "^7.0.0",
|
|
41
41
|
"dataloader": "^2.1.0",
|
|
@@ -89,6 +89,12 @@
|
|
|
89
89
|
},
|
|
90
90
|
"platform.media-cdn-single-host": {
|
|
91
91
|
"type": "boolean"
|
|
92
|
+
},
|
|
93
|
+
"platform_media_cdn_single_host": {
|
|
94
|
+
"type": "boolean"
|
|
95
|
+
},
|
|
96
|
+
"platform_media_cdn_delivery": {
|
|
97
|
+
"type": "boolean"
|
|
92
98
|
}
|
|
93
99
|
}
|
|
94
100
|
}
|