@atlaskit/media-client 22.0.2 → 22.0.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 +15 -0
- package/dist/cjs/client/file-fetcher/index.js +3 -103
- package/dist/cjs/client/media-client.js +1 -1
- package/dist/cjs/client/media-store/index.js +13 -80
- package/dist/cjs/models/media.js +1 -8
- package/dist/cjs/utils/shouldFetchRemoteFileStates.js +0 -5
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/file-fetcher/index.js +3 -104
- package/dist/es2019/client/media-client.js +1 -1
- package/dist/es2019/client/media-store/index.js +5 -45
- package/dist/es2019/models/media.js +1 -9
- package/dist/es2019/utils/shouldFetchRemoteFileStates.js +0 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/file-fetcher/index.js +4 -104
- package/dist/esm/client/media-client.js +1 -1
- package/dist/esm/client/media-store/index.js +13 -80
- package/dist/esm/models/media.js +1 -9
- package/dist/esm/utils/shouldFetchRemoteFileStates.js +0 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/client/file-fetcher/error.d.ts +1 -1
- package/dist/types/client/file-fetcher/index.d.ts +4 -7
- package/dist/types/client/media-store/index.d.ts +1 -2
- package/dist/types/models/errors/types.d.ts +1 -1
- package/dist/types/models/media.d.ts +1 -1
- package/dist/types/utils/shouldFetchRemoteFileStates.d.ts +0 -2
- package/dist/types-ts4.5/client/file-fetcher/error.d.ts +1 -1
- package/dist/types-ts4.5/client/file-fetcher/index.d.ts +4 -7
- package/dist/types-ts4.5/client/media-store/index.d.ts +1 -2
- package/dist/types-ts4.5/models/errors/types.d.ts +1 -1
- package/dist/types-ts4.5/models/media.d.ts +1 -1
- package/dist/types-ts4.5/utils/shouldFetchRemoteFileStates.d.ts +0 -2
- package/package.json +4 -4
- package/report.api.md +5 -9
- package/dist/cjs/utils/parseJwt.js +0 -52
- package/dist/es2019/utils/parseJwt.js +0 -46
- package/dist/esm/utils/parseJwt.js +0 -46
- package/dist/types/utils/parseJwt.d.ts +0 -1
- package/dist/types-ts4.5/utils/parseJwt.d.ts +0 -1
package/report.api.md
CHANGED
|
@@ -272,7 +272,6 @@ export interface FileFetcher {
|
|
|
272
272
|
controller?: UploadController,
|
|
273
273
|
uploadableFileUpfrontIds?: UploadableFileUpfrontIds,
|
|
274
274
|
traceContext?: MediaTraceContext,
|
|
275
|
-
featureFlags?: MediaFeatureFlags,
|
|
276
275
|
): MediaSubscribable;
|
|
277
276
|
// (undocumented)
|
|
278
277
|
uploadExternal(
|
|
@@ -326,16 +325,14 @@ export type FileFetcherErrorAttributes = {
|
|
|
326
325
|
|
|
327
326
|
// @public (undocumented)
|
|
328
327
|
export type FileFetcherErrorReason =
|
|
328
|
+
| 'emptyFileName'
|
|
329
329
|
| 'emptyItems'
|
|
330
330
|
| 'invalidFileId'
|
|
331
331
|
| 'zeroVersionFile';
|
|
332
332
|
|
|
333
333
|
// @public (undocumented)
|
|
334
334
|
export class FileFetcherImpl implements FileFetcher {
|
|
335
|
-
constructor(
|
|
336
|
-
mediaStore: MediaStore,
|
|
337
|
-
featureFlags?: MediaFeatureFlags | undefined,
|
|
338
|
-
);
|
|
335
|
+
constructor(mediaStore: MediaStore);
|
|
339
336
|
// (undocumented)
|
|
340
337
|
copyFile(
|
|
341
338
|
source: CopySourceFile,
|
|
@@ -373,7 +370,6 @@ export class FileFetcherImpl implements FileFetcher {
|
|
|
373
370
|
controller?: UploadController,
|
|
374
371
|
uploadableFileUpfrontIds?: UploadableFileUpfrontIds,
|
|
375
372
|
traceContext?: MediaTraceContext,
|
|
376
|
-
featureFlags?: MediaFeatureFlags,
|
|
377
373
|
): MediaSubscribable;
|
|
378
374
|
// (undocumented)
|
|
379
375
|
uploadExternal(
|
|
@@ -803,6 +799,7 @@ export type MediaClientErrorReason =
|
|
|
803
799
|
| 'clientTimeoutRequest'
|
|
804
800
|
| 'deprecatedEndpoint'
|
|
805
801
|
| 'emptyAuth'
|
|
802
|
+
| 'emptyFileName'
|
|
806
803
|
| 'emptyItems'
|
|
807
804
|
| 'failedAuthProvider'
|
|
808
805
|
| 'fileSizeExceedsLimit'
|
|
@@ -1115,7 +1112,6 @@ export type MediaStoreRequestOptions = RequestMetadata & {
|
|
|
1115
1112
|
readonly body?: any;
|
|
1116
1113
|
readonly clientOptions?: ClientOptions;
|
|
1117
1114
|
readonly traceContext?: MediaTraceContext;
|
|
1118
|
-
readonly resolvedAuth?: Auth;
|
|
1119
1115
|
};
|
|
1120
1116
|
|
|
1121
1117
|
// @public (undocumented)
|
|
@@ -1533,7 +1529,7 @@ export class StargateClient {
|
|
|
1533
1529
|
// @public (undocumented)
|
|
1534
1530
|
export type TouchedFiles = {
|
|
1535
1531
|
created: CreatedTouchedFile[];
|
|
1536
|
-
rejected
|
|
1532
|
+
rejected?: RejectedTouchFile[];
|
|
1537
1533
|
};
|
|
1538
1534
|
|
|
1539
1535
|
// @public (undocumented)
|
|
@@ -1670,7 +1666,7 @@ export type WithMediaClientFunction = <P extends WithMediaClient>(
|
|
|
1670
1666
|
|
|
1671
1667
|
```json
|
|
1672
1668
|
{
|
|
1673
|
-
"@atlaskit/media-core": "^34.1.
|
|
1669
|
+
"@atlaskit/media-core": "^34.1.2",
|
|
1674
1670
|
"@emotion/react": "^11.7.1",
|
|
1675
1671
|
"react": "^16.8.0"
|
|
1676
1672
|
}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = _default;
|
|
7
|
-
// Implementation obtained from https://github.com/auth0/jwt-decode
|
|
8
|
-
// Copied from https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/13080
|
|
9
|
-
|
|
10
|
-
/* Decodes base64 string into unicode */
|
|
11
|
-
var b64DecodeUnicode = function b64DecodeUnicode(str) {
|
|
12
|
-
return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) {
|
|
13
|
-
var code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
14
|
-
if (code.length < 2) {
|
|
15
|
-
code = '0' + code;
|
|
16
|
-
}
|
|
17
|
-
return '%' + code;
|
|
18
|
-
}));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
/* Decodes base64url string into unicode */
|
|
22
|
-
var b64Decode = function b64Decode(str) {
|
|
23
|
-
var output = str.replace(/-/g, '+').replace(/_/g, '/');
|
|
24
|
-
switch (output.length % 4) {
|
|
25
|
-
case 0:
|
|
26
|
-
break;
|
|
27
|
-
case 2:
|
|
28
|
-
output += '==';
|
|
29
|
-
break;
|
|
30
|
-
case 3:
|
|
31
|
-
output += '=';
|
|
32
|
-
break;
|
|
33
|
-
default:
|
|
34
|
-
throw new Error('Illegal base64url string!');
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
return b64DecodeUnicode(output);
|
|
38
|
-
} catch (err) {
|
|
39
|
-
return atob(output);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
function _default(token) {
|
|
43
|
-
try {
|
|
44
|
-
var body = token.split('.')[1];
|
|
45
|
-
return JSON.parse(b64Decode(body));
|
|
46
|
-
} catch (e) {
|
|
47
|
-
if (e instanceof Error) {
|
|
48
|
-
throw new Error('Invalid token specified: ' + e.message);
|
|
49
|
-
}
|
|
50
|
-
throw e;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Implementation obtained from https://github.com/auth0/jwt-decode
|
|
2
|
-
// Copied from https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/13080
|
|
3
|
-
|
|
4
|
-
/* Decodes base64 string into unicode */
|
|
5
|
-
const b64DecodeUnicode = str => {
|
|
6
|
-
return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) {
|
|
7
|
-
let code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
8
|
-
if (code.length < 2) {
|
|
9
|
-
code = '0' + code;
|
|
10
|
-
}
|
|
11
|
-
return '%' + code;
|
|
12
|
-
}));
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/* Decodes base64url string into unicode */
|
|
16
|
-
const b64Decode = str => {
|
|
17
|
-
let output = str.replace(/-/g, '+').replace(/_/g, '/');
|
|
18
|
-
switch (output.length % 4) {
|
|
19
|
-
case 0:
|
|
20
|
-
break;
|
|
21
|
-
case 2:
|
|
22
|
-
output += '==';
|
|
23
|
-
break;
|
|
24
|
-
case 3:
|
|
25
|
-
output += '=';
|
|
26
|
-
break;
|
|
27
|
-
default:
|
|
28
|
-
throw new Error('Illegal base64url string!');
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
return b64DecodeUnicode(output);
|
|
32
|
-
} catch (err) {
|
|
33
|
-
return atob(output);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export default function (token) {
|
|
37
|
-
try {
|
|
38
|
-
const body = token.split('.')[1];
|
|
39
|
-
return JSON.parse(b64Decode(body));
|
|
40
|
-
} catch (e) {
|
|
41
|
-
if (e instanceof Error) {
|
|
42
|
-
throw new Error('Invalid token specified: ' + e.message);
|
|
43
|
-
}
|
|
44
|
-
throw e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Implementation obtained from https://github.com/auth0/jwt-decode
|
|
2
|
-
// Copied from https://bitbucket.org/atlassian/%7Bc8e2f021-38d2-46d0-9b7a-b3f7b428f724%7D/pull-requests/13080
|
|
3
|
-
|
|
4
|
-
/* Decodes base64 string into unicode */
|
|
5
|
-
var b64DecodeUnicode = function b64DecodeUnicode(str) {
|
|
6
|
-
return decodeURIComponent(atob(str).replace(/(.)/g, function (m, p) {
|
|
7
|
-
var code = p.charCodeAt(0).toString(16).toUpperCase();
|
|
8
|
-
if (code.length < 2) {
|
|
9
|
-
code = '0' + code;
|
|
10
|
-
}
|
|
11
|
-
return '%' + code;
|
|
12
|
-
}));
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
/* Decodes base64url string into unicode */
|
|
16
|
-
var b64Decode = function b64Decode(str) {
|
|
17
|
-
var output = str.replace(/-/g, '+').replace(/_/g, '/');
|
|
18
|
-
switch (output.length % 4) {
|
|
19
|
-
case 0:
|
|
20
|
-
break;
|
|
21
|
-
case 2:
|
|
22
|
-
output += '==';
|
|
23
|
-
break;
|
|
24
|
-
case 3:
|
|
25
|
-
output += '=';
|
|
26
|
-
break;
|
|
27
|
-
default:
|
|
28
|
-
throw new Error('Illegal base64url string!');
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
return b64DecodeUnicode(output);
|
|
32
|
-
} catch (err) {
|
|
33
|
-
return atob(output);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
export default function (token) {
|
|
37
|
-
try {
|
|
38
|
-
var body = token.split('.')[1];
|
|
39
|
-
return JSON.parse(b64Decode(body));
|
|
40
|
-
} catch (e) {
|
|
41
|
-
if (e instanceof Error) {
|
|
42
|
-
throw new Error('Invalid token specified: ' + e.message);
|
|
43
|
-
}
|
|
44
|
-
throw e;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (token: string): unknown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (token: string): unknown;
|