@atlaskit/media-client 22.0.2 → 22.0.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 +9 -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/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/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/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/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/utils/shouldFetchRemoteFileStates.d.ts +0 -2
- package/package.json +3 -3
- 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
|
@@ -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;
|