@atlaskit/outbound-auth-flow-client 3.1.1 → 3.3.0

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,31 @@
1
1
  # @atlaskit/outbound-auth-flow-client
2
2
 
3
+ ## 3.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`65cad419e85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/65cad419e85) - Add 'AuthClientOAuth2.AuthError' error type
8
+
9
+ ## 3.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
14
+
15
+ ## 3.2.0
16
+
17
+ ### Minor Changes
18
+
19
+ - [`ea1bb06612`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ea1bb06612) - Added abilitiy to pass window features when calling auth
20
+
21
+ ## 3.1.2
22
+
23
+ ### Patch Changes
24
+
25
+ - [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
26
+ This requires version 3.8 of Typescript, read more about how we handle Typescript versions here: https://atlaskit.atlassian.com/get-started
27
+ Also add `typescript` to `devDependencies` to denote version that the package was built with.
28
+
3
29
  ## 3.1.1
4
30
 
5
31
  ### Patch Changes
@@ -9,5 +9,9 @@
9
9
  "../src/**/*.ts",
10
10
  "../src/**/*.tsx"
11
11
  ],
12
- "exclude": ["../src/**/__tests__/*"]
13
- }
12
+ "exclude": [
13
+ "../src/**/__tests__/*",
14
+ "../src/**/*.test.*",
15
+ "../src/**/test.*"
16
+ ]
17
+ }
package/dist/cjs/error.js CHANGED
@@ -1,19 +1,45 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
3
8
  exports.AuthError = void 0;
4
- var tslib_1 = require("tslib");
5
- var AuthError = /** @class */ (function (_super) {
6
- tslib_1.__extends(AuthError, _super);
7
- function AuthError(message, type) {
8
- var _this = _super.call(this, message) || this;
9
- _this.message = message;
10
- _this.type = type;
11
- _this.name = 'AuthError';
12
- _this.type = type;
13
- _this.message = message;
14
- return _this;
15
- }
16
- return AuthError;
17
- }(Error));
18
- exports.AuthError = AuthError;
19
- //# sourceMappingURL=error.js.map
9
+
10
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
+
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+
14
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
15
+
16
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
17
+
18
+ var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
19
+
20
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
21
+
22
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
23
+
24
+ var AuthError = /*#__PURE__*/function (_Error) {
25
+ (0, _inherits2.default)(AuthError, _Error);
26
+
27
+ var _super = _createSuper(AuthError);
28
+
29
+ function AuthError(message, type) {
30
+ var _this;
31
+
32
+ (0, _classCallCheck2.default)(this, AuthError);
33
+ _this = _super.call(this, message);
34
+ _this.message = message;
35
+ _this.type = type;
36
+ _this.name = 'AuthError';
37
+ _this.type = type;
38
+ _this.message = message;
39
+ return _this;
40
+ }
41
+
42
+ return AuthError;
43
+ }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
44
+
45
+ exports.AuthError = AuthError;
package/dist/cjs/index.js CHANGED
@@ -1,60 +1,83 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.auth = void 0;
4
- var error_1 = require("./error");
5
- var types_1 = require("./types");
6
- function auth(startUrl) {
7
- return new Promise(function (resolve, reject) {
8
- var authWindow = null;
9
- var authWindowInterval;
10
- var handleAuthWindowMessage = function (event) {
11
- if (event.source !== authWindow) {
12
- return;
13
- }
14
- var data = event.data;
15
- if (typeof data !== 'object') {
16
- return;
17
- }
18
- switch (data.type) {
19
- case 'outbound-auth:success':
20
- finish();
21
- resolve();
22
- break;
23
- case 'outbound-auth:failure':
24
- finish();
25
- var errorType = data.errorType.toLowerCase();
26
- if (types_1.isOfTypeAuthError(errorType)) {
27
- reject(new error_1.AuthError(data.message, errorType));
28
- }
29
- else {
30
- reject(new error_1.AuthError(data.message));
31
- }
32
- break;
33
- }
34
- };
35
- var handleAuthWindowInterval = function () {
36
- if (authWindow && authWindow.closed) {
37
- finish();
38
- reject(new error_1.AuthError('The auth window was closed', 'auth_window_closed'));
39
- }
40
- };
41
- var start = function () {
42
- window.addEventListener('message', handleAuthWindowMessage);
43
- authWindow = window.open(startUrl, startUrl);
44
- authWindowInterval = window.setInterval(handleAuthWindowInterval, 500);
45
- };
46
- var finish = function () {
47
- clearInterval(authWindowInterval);
48
- window.removeEventListener('message', handleAuthWindowMessage);
49
- if (authWindow) {
50
- authWindow.close();
51
- authWindow = null;
52
- }
53
- };
54
- start();
55
- });
56
- }
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
57
8
  exports.auth = auth;
58
- var error_2 = require("./error");
59
- Object.defineProperty(exports, "AuthError", { enumerable: true, get: function () { return error_2.AuthError; } });
60
- //# sourceMappingURL=index.js.map
9
+ Object.defineProperty(exports, "AuthError", {
10
+ enumerable: true,
11
+ get: function get() {
12
+ return _error.AuthError;
13
+ }
14
+ });
15
+
16
+ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
17
+
18
+ var _error = require("./error");
19
+
20
+ var _types = require("./types");
21
+
22
+ function auth(startUrl, windowFeatures) {
23
+ return new Promise(function (resolve, reject) {
24
+ var authWindow = null;
25
+ var authWindowInterval;
26
+
27
+ var handleAuthWindowMessage = function handleAuthWindowMessage(event) {
28
+ if (event.source !== authWindow) {
29
+ return;
30
+ }
31
+
32
+ var data = event.data;
33
+
34
+ if ((0, _typeof2.default)(data) !== 'object') {
35
+ return;
36
+ }
37
+
38
+ switch (data.type) {
39
+ case 'outbound-auth:success':
40
+ finish();
41
+ resolve();
42
+ break;
43
+
44
+ case 'outbound-auth:failure':
45
+ finish();
46
+ var errorType = data.errorType.toLowerCase();
47
+
48
+ if ((0, _types.isOfTypeAuthError)(errorType)) {
49
+ reject(new _error.AuthError(data.message, errorType));
50
+ } else {
51
+ reject(new _error.AuthError(data.message));
52
+ }
53
+
54
+ break;
55
+ }
56
+ };
57
+
58
+ var handleAuthWindowInterval = function handleAuthWindowInterval() {
59
+ if (authWindow && authWindow.closed) {
60
+ finish();
61
+ reject(new _error.AuthError('The auth window was closed', 'auth_window_closed'));
62
+ }
63
+ };
64
+
65
+ var start = function start() {
66
+ window.addEventListener('message', handleAuthWindowMessage);
67
+ authWindow = window.open(startUrl, startUrl, windowFeatures);
68
+ authWindowInterval = window.setInterval(handleAuthWindowInterval, 500);
69
+ };
70
+
71
+ var finish = function finish() {
72
+ clearInterval(authWindowInterval);
73
+ window.removeEventListener('message', handleAuthWindowMessage);
74
+
75
+ if (authWindow) {
76
+ authWindow.close();
77
+ authWindow = null;
78
+ }
79
+ };
80
+
81
+ start();
82
+ });
83
+ }
package/dist/cjs/types.js CHANGED
@@ -1,16 +1,17 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
3
6
  exports.isOfTypeAuthError = void 0;
4
- exports.isOfTypeAuthError = function (inputString) {
5
- return [
6
- 'auth_window_closed',
7
- 'invalid_request',
8
- 'unauthorized_client',
9
- 'access_denied',
10
- 'unsupported_response_type',
11
- 'invalid_scope',
12
- 'server_error',
13
- 'temporarily_unavailable',
14
- ].includes(inputString);
7
+
8
+ // See https://tools.ietf.org/html/rfc6749#section-4.1.2.1
9
+ // 'auth_window_closed' is returned in addition to types from this RFC,
10
+ // representing when the authentication window is closed by the user
11
+ // 'authclientoauth2.autherror' is added to represent errors from
12
+ // outbound-auth
13
+ var isOfTypeAuthError = function isOfTypeAuthError(inputString) {
14
+ return ['auth_window_closed', 'invalid_request', 'unauthorized_client', 'access_denied', 'unsupported_response_type', 'invalid_scope', 'server_error', 'temporarily_unavailable', 'authclientoauth2.autherror'].includes(inputString);
15
15
  };
16
- //# sourceMappingURL=types.js.map
16
+
17
+ exports.isOfTypeAuthError = isOfTypeAuthError;
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/outbound-auth-flow-client",
3
- "version": "3.1.1"
3
+ "version": "3.3.0"
4
4
  }
@@ -1,11 +1,11 @@
1
1
  export class AuthError extends Error {
2
- constructor(message, type) {
3
- super(message);
4
- this.message = message;
5
- this.type = type;
6
- this.name = 'AuthError';
7
- this.type = type;
8
- this.message = message;
9
- }
10
- }
11
- //# sourceMappingURL=error.js.map
2
+ constructor(message, type) {
3
+ super(message);
4
+ this.message = message;
5
+ this.type = type;
6
+ this.name = 'AuthError';
7
+ this.type = type;
8
+ this.message = message;
9
+ }
10
+
11
+ }
@@ -1,55 +1,67 @@
1
1
  import { AuthError } from './error';
2
2
  import { isOfTypeAuthError } from './types';
3
- export function auth(startUrl) {
4
- return new Promise((resolve, reject) => {
5
- let authWindow = null;
6
- let authWindowInterval;
7
- const handleAuthWindowMessage = (event) => {
8
- if (event.source !== authWindow) {
9
- return;
10
- }
11
- const { data } = event;
12
- if (typeof data !== 'object') {
13
- return;
14
- }
15
- switch (data.type) {
16
- case 'outbound-auth:success':
17
- finish();
18
- resolve();
19
- break;
20
- case 'outbound-auth:failure':
21
- finish();
22
- const errorType = data.errorType.toLowerCase();
23
- if (isOfTypeAuthError(errorType)) {
24
- reject(new AuthError(data.message, errorType));
25
- }
26
- else {
27
- reject(new AuthError(data.message));
28
- }
29
- break;
30
- }
31
- };
32
- const handleAuthWindowInterval = () => {
33
- if (authWindow && authWindow.closed) {
34
- finish();
35
- reject(new AuthError('The auth window was closed', 'auth_window_closed'));
36
- }
37
- };
38
- const start = () => {
39
- window.addEventListener('message', handleAuthWindowMessage);
40
- authWindow = window.open(startUrl, startUrl);
41
- authWindowInterval = window.setInterval(handleAuthWindowInterval, 500);
42
- };
43
- const finish = () => {
44
- clearInterval(authWindowInterval);
45
- window.removeEventListener('message', handleAuthWindowMessage);
46
- if (authWindow) {
47
- authWindow.close();
48
- authWindow = null;
49
- }
50
- };
51
- start();
52
- });
3
+ export function auth(startUrl, windowFeatures) {
4
+ return new Promise((resolve, reject) => {
5
+ let authWindow = null;
6
+ let authWindowInterval;
7
+
8
+ const handleAuthWindowMessage = event => {
9
+ if (event.source !== authWindow) {
10
+ return;
11
+ }
12
+
13
+ const {
14
+ data
15
+ } = event;
16
+
17
+ if (typeof data !== 'object') {
18
+ return;
19
+ }
20
+
21
+ switch (data.type) {
22
+ case 'outbound-auth:success':
23
+ finish();
24
+ resolve();
25
+ break;
26
+
27
+ case 'outbound-auth:failure':
28
+ finish();
29
+ const errorType = data.errorType.toLowerCase();
30
+
31
+ if (isOfTypeAuthError(errorType)) {
32
+ reject(new AuthError(data.message, errorType));
33
+ } else {
34
+ reject(new AuthError(data.message));
35
+ }
36
+
37
+ break;
38
+ }
39
+ };
40
+
41
+ const handleAuthWindowInterval = () => {
42
+ if (authWindow && authWindow.closed) {
43
+ finish();
44
+ reject(new AuthError('The auth window was closed', 'auth_window_closed'));
45
+ }
46
+ };
47
+
48
+ const start = () => {
49
+ window.addEventListener('message', handleAuthWindowMessage);
50
+ authWindow = window.open(startUrl, startUrl, windowFeatures);
51
+ authWindowInterval = window.setInterval(handleAuthWindowInterval, 500);
52
+ };
53
+
54
+ const finish = () => {
55
+ clearInterval(authWindowInterval);
56
+ window.removeEventListener('message', handleAuthWindowMessage);
57
+
58
+ if (authWindow) {
59
+ authWindow.close();
60
+ authWindow = null;
61
+ }
62
+ };
63
+
64
+ start();
65
+ });
53
66
  }
54
- export { AuthError } from './error';
55
- //# sourceMappingURL=index.js.map
67
+ export { AuthError } from './error';
@@ -1,13 +1,8 @@
1
- export const isOfTypeAuthError = (inputString) => {
2
- return [
3
- 'auth_window_closed',
4
- 'invalid_request',
5
- 'unauthorized_client',
6
- 'access_denied',
7
- 'unsupported_response_type',
8
- 'invalid_scope',
9
- 'server_error',
10
- 'temporarily_unavailable',
11
- ].includes(inputString);
12
- };
13
- //# sourceMappingURL=types.js.map
1
+ // See https://tools.ietf.org/html/rfc6749#section-4.1.2.1
2
+ // 'auth_window_closed' is returned in addition to types from this RFC,
3
+ // representing when the authentication window is closed by the user
4
+ // 'authclientoauth2.autherror' is added to represent errors from
5
+ // outbound-auth
6
+ export const isOfTypeAuthError = inputString => {
7
+ return ['auth_window_closed', 'invalid_request', 'unauthorized_client', 'access_denied', 'unsupported_response_type', 'invalid_scope', 'server_error', 'temporarily_unavailable', 'authclientoauth2.autherror'].includes(inputString);
8
+ };
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/outbound-auth-flow-client",
3
- "version": "3.1.1"
3
+ "version": "3.3.0"
4
4
  }
package/dist/esm/error.js CHANGED
@@ -1,16 +1,31 @@
1
- import { __extends } from "tslib";
2
- var AuthError = /** @class */ (function (_super) {
3
- __extends(AuthError, _super);
4
- function AuthError(message, type) {
5
- var _this = _super.call(this, message) || this;
6
- _this.message = message;
7
- _this.type = type;
8
- _this.name = 'AuthError';
9
- _this.type = type;
10
- _this.message = message;
11
- return _this;
12
- }
13
- return AuthError;
14
- }(Error));
15
- export { AuthError };
16
- //# sourceMappingURL=error.js.map
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _inherits from "@babel/runtime/helpers/inherits";
3
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper";
6
+
7
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
8
+
9
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10
+
11
+ export var AuthError = /*#__PURE__*/function (_Error) {
12
+ _inherits(AuthError, _Error);
13
+
14
+ var _super = _createSuper(AuthError);
15
+
16
+ function AuthError(message, type) {
17
+ var _this;
18
+
19
+ _classCallCheck(this, AuthError);
20
+
21
+ _this = _super.call(this, message);
22
+ _this.message = message;
23
+ _this.type = type;
24
+ _this.name = 'AuthError';
25
+ _this.type = type;
26
+ _this.message = message;
27
+ return _this;
28
+ }
29
+
30
+ return AuthError;
31
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
package/dist/esm/index.js CHANGED
@@ -1,55 +1,66 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
1
2
  import { AuthError } from './error';
2
3
  import { isOfTypeAuthError } from './types';
3
- export function auth(startUrl) {
4
- return new Promise(function (resolve, reject) {
5
- var authWindow = null;
6
- var authWindowInterval;
7
- var handleAuthWindowMessage = function (event) {
8
- if (event.source !== authWindow) {
9
- return;
10
- }
11
- var data = event.data;
12
- if (typeof data !== 'object') {
13
- return;
14
- }
15
- switch (data.type) {
16
- case 'outbound-auth:success':
17
- finish();
18
- resolve();
19
- break;
20
- case 'outbound-auth:failure':
21
- finish();
22
- var errorType = data.errorType.toLowerCase();
23
- if (isOfTypeAuthError(errorType)) {
24
- reject(new AuthError(data.message, errorType));
25
- }
26
- else {
27
- reject(new AuthError(data.message));
28
- }
29
- break;
30
- }
31
- };
32
- var handleAuthWindowInterval = function () {
33
- if (authWindow && authWindow.closed) {
34
- finish();
35
- reject(new AuthError('The auth window was closed', 'auth_window_closed'));
36
- }
37
- };
38
- var start = function () {
39
- window.addEventListener('message', handleAuthWindowMessage);
40
- authWindow = window.open(startUrl, startUrl);
41
- authWindowInterval = window.setInterval(handleAuthWindowInterval, 500);
42
- };
43
- var finish = function () {
44
- clearInterval(authWindowInterval);
45
- window.removeEventListener('message', handleAuthWindowMessage);
46
- if (authWindow) {
47
- authWindow.close();
48
- authWindow = null;
49
- }
50
- };
51
- start();
52
- });
4
+ export function auth(startUrl, windowFeatures) {
5
+ return new Promise(function (resolve, reject) {
6
+ var authWindow = null;
7
+ var authWindowInterval;
8
+
9
+ var handleAuthWindowMessage = function handleAuthWindowMessage(event) {
10
+ if (event.source !== authWindow) {
11
+ return;
12
+ }
13
+
14
+ var data = event.data;
15
+
16
+ if (_typeof(data) !== 'object') {
17
+ return;
18
+ }
19
+
20
+ switch (data.type) {
21
+ case 'outbound-auth:success':
22
+ finish();
23
+ resolve();
24
+ break;
25
+
26
+ case 'outbound-auth:failure':
27
+ finish();
28
+ var errorType = data.errorType.toLowerCase();
29
+
30
+ if (isOfTypeAuthError(errorType)) {
31
+ reject(new AuthError(data.message, errorType));
32
+ } else {
33
+ reject(new AuthError(data.message));
34
+ }
35
+
36
+ break;
37
+ }
38
+ };
39
+
40
+ var handleAuthWindowInterval = function handleAuthWindowInterval() {
41
+ if (authWindow && authWindow.closed) {
42
+ finish();
43
+ reject(new AuthError('The auth window was closed', 'auth_window_closed'));
44
+ }
45
+ };
46
+
47
+ var start = function start() {
48
+ window.addEventListener('message', handleAuthWindowMessage);
49
+ authWindow = window.open(startUrl, startUrl, windowFeatures);
50
+ authWindowInterval = window.setInterval(handleAuthWindowInterval, 500);
51
+ };
52
+
53
+ var finish = function finish() {
54
+ clearInterval(authWindowInterval);
55
+ window.removeEventListener('message', handleAuthWindowMessage);
56
+
57
+ if (authWindow) {
58
+ authWindow.close();
59
+ authWindow = null;
60
+ }
61
+ };
62
+
63
+ start();
64
+ });
53
65
  }
54
- export { AuthError } from './error';
55
- //# sourceMappingURL=index.js.map
66
+ export { AuthError } from './error';
package/dist/esm/types.js CHANGED
@@ -1,13 +1,8 @@
1
- export var isOfTypeAuthError = function (inputString) {
2
- return [
3
- 'auth_window_closed',
4
- 'invalid_request',
5
- 'unauthorized_client',
6
- 'access_denied',
7
- 'unsupported_response_type',
8
- 'invalid_scope',
9
- 'server_error',
10
- 'temporarily_unavailable',
11
- ].includes(inputString);
12
- };
13
- //# sourceMappingURL=types.js.map
1
+ // See https://tools.ietf.org/html/rfc6749#section-4.1.2.1
2
+ // 'auth_window_closed' is returned in addition to types from this RFC,
3
+ // representing when the authentication window is closed by the user
4
+ // 'authclientoauth2.autherror' is added to represent errors from
5
+ // outbound-auth
6
+ export var isOfTypeAuthError = function isOfTypeAuthError(inputString) {
7
+ return ['auth_window_closed', 'invalid_request', 'unauthorized_client', 'access_denied', 'unsupported_response_type', 'invalid_scope', 'server_error', 'temporarily_unavailable', 'authclientoauth2.autherror'].includes(inputString);
8
+ };
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/outbound-auth-flow-client",
3
- "version": "3.1.1"
3
+ "version": "3.3.0"
4
4
  }
@@ -1,5 +1,5 @@
1
1
  export declare class AuthError extends Error {
2
2
  readonly message: string;
3
- readonly type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | undefined;
4
- constructor(message: string, type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | undefined);
3
+ readonly type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | "authclientoauth2.autherror" | undefined;
4
+ constructor(message: string, type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | "authclientoauth2.autherror" | undefined);
5
5
  }
@@ -0,0 +1,2 @@
1
+ export declare function auth(startUrl: string, windowFeatures?: string): Promise<void>;
2
+ export { AuthError } from './error';
@@ -1,2 +1,2 @@
1
- export declare type AuthErrorType = 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable';
1
+ export declare type AuthErrorType = 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable' | 'authclientoauth2.autherror';
2
2
  export declare const isOfTypeAuthError: (inputString: string) => inputString is AuthErrorType;
@@ -3,5 +3,5 @@
3
3
  "main": "../dist/cjs/error.js",
4
4
  "module": "../dist/esm/error.js",
5
5
  "module:es2019": "../dist/es2019/error.js",
6
- "types": "../dist/cjs/error.d.ts"
6
+ "types": "../dist/types/error.d.ts"
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/outbound-auth-flow-client",
3
- "version": "3.1.1",
3
+ "version": "3.3.0",
4
4
  "description": "Front-end library for starting outbound auth flows",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -11,7 +11,7 @@
11
11
  "main": "dist/cjs/index.js",
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
- "types": "dist/cjs/index.d.ts",
14
+ "types": "dist/types/index.d.ts",
15
15
  "atlaskit:src": "src/index.ts",
16
16
  "atlassian": {
17
17
  "team": "Ecosystem Capabilities",
@@ -22,13 +22,16 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
- "tslib": "^2.0.0"
25
+ "@babel/runtime": "^7.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@atlaskit/docs": "*"
28
+ "@atlaskit/docs": "*",
29
+ "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
30
+ "typescript": "3.9.6"
29
31
  },
30
32
  "keywords": [
31
33
  "fabric",
32
34
  "ui"
33
- ]
35
+ ],
36
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
34
37
  }
@@ -3,5 +3,5 @@
3
3
  "main": "../dist/cjs/types.js",
4
4
  "module": "../dist/esm/types.js",
5
5
  "module:es2019": "../dist/es2019/types.js",
6
- "types": "../dist/cjs/types.d.ts"
6
+ "types": "../dist/types/types.d.ts"
7
7
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":";;;;AAEA;IAA+B,qCAAK;IAClC,mBACkB,OAAe,EACf,IAAoB;QAFtC,YAIE,kBAAM,OAAO,CAAC,SAIf;QAPiB,aAAO,GAAP,OAAO,CAAQ;QACf,UAAI,GAAJ,IAAI,CAAgB;QAGpC,KAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,gBAAC;AAAD,CAAC,AAVD,CAA+B,KAAK,GAUnC;AAVY,8BAAS"}
@@ -1,2 +0,0 @@
1
- export declare function auth(startUrl: string): Promise<void>;
2
- export { AuthError } from './error';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,iCAAoC;AACpC,iCAA4C;AAE5C,SAAgB,IAAI,CAAC,QAAgB;IACnC,OAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;QACjC,IAAI,UAAU,GAAkB,IAAI,CAAC;QACrC,IAAI,kBAA0B,CAAC;QAE/B,IAAM,uBAAuB,GAAG,UAAC,KAAmB;YAClD,IAAI,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE;gBAC/B,OAAO;aACR;YACO,IAAA,IAAI,GAAK,KAAK,KAAV,CAAW;YACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC5B,OAAO;aACR;YAED,QAAQ,IAAI,CAAC,IAAI,EAAE;gBACjB,KAAK,uBAAuB;oBAC1B,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,CAAC;oBACV,MAAM;gBAER,KAAK,uBAAuB;oBAC1B,MAAM,EAAE,CAAC;oBACT,IAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;oBAC/C,IAAI,yBAAiB,CAAC,SAAS,CAAC,EAAE;wBAChC,MAAM,CAAC,IAAI,iBAAS,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;qBAChD;yBAAM;wBACL,MAAM,CAAC,IAAI,iBAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;qBACrC;oBACD,MAAM;aACT;QACH,CAAC,CAAC;QAEF,IAAM,wBAAwB,GAAG;YAC/B,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,EAAE;gBACnC,MAAM,EAAE,CAAC;gBACT,MAAM,CACJ,IAAI,iBAAS,CAAC,4BAA4B,EAAE,oBAAoB,CAAC,CAClE,CAAC;aACH;QACH,CAAC,CAAC;QAEF,IAAM,KAAK,GAAG;YACZ,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;YAC5D,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC7C,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;QACzE,CAAC,CAAC;QAEF,IAAM,MAAM,GAAG;YACb,aAAa,CAAC,kBAAkB,CAAC,CAAC;YAClC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;YAC/D,IAAI,UAAU,EAAE;gBACd,UAAU,CAAC,KAAK,EAAE,CAAC;gBACnB,UAAU,GAAG,IAAI,CAAC;aACnB;QACH,CAAC,CAAC;QAEF,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC;AA1DD,oBA0DC;AAED,iCAAoC;AAA3B,kGAAA,SAAS,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";;;AAaa,QAAA,iBAAiB,GAAG,UAC/B,WAAmB;IAEnB,OAAO;QACL,oBAAoB;QACpB,iBAAiB;QACjB,qBAAqB;QACrB,eAAe;QACf,2BAA2B;QAC3B,eAAe;QACf,cAAc;QACd,yBAAyB;KAC1B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC1B,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare class AuthError extends Error {
2
- readonly message: string;
3
- readonly type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | undefined;
4
- constructor(message: string, type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | undefined);
5
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClC,YACkB,OAAe,EACf,IAAoB;QAEpC,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,YAAO,GAAP,OAAO,CAAQ;QACf,SAAI,GAAJ,IAAI,CAAgB;QAGpC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF"}
@@ -1,2 +0,0 @@
1
- export declare function auth(startUrl: string): Promise<void>;
2
- export { AuthError } from './error';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,UAAU,IAAI,CAAC,QAAgB;IACnC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,UAAU,GAAkB,IAAI,CAAC;QACrC,IAAI,kBAA0B,CAAC;QAE/B,MAAM,uBAAuB,GAAG,CAAC,KAAmB,EAAE,EAAE;YACtD,IAAI,KAAK,CAAC,MAAM,KAAK,UAAU,EAAE;gBAC/B,OAAO;aACR;YACD,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;YACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;gBAC5B,OAAO;aACR;YAED,QAAQ,IAAI,CAAC,IAAI,EAAE;gBACjB,KAAK,uBAAuB;oBAC1B,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,CAAC;oBACV,MAAM;gBAER,KAAK,uBAAuB;oBAC1B,MAAM,EAAE,CAAC;oBACT,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thorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable';
2
- export declare const isOfTypeAuthError: (inputString: string) => inputString is AuthErrorType;
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,WAAmB,EACW,EAAE;IAChC,OAAO;QACL,oBAAoB;QACpB,iBAAiB;QACjB,qBAAqB;QACrB,eAAe;QACf,2BAA2B;QAC3B,eAAe;QACf,cAAc;QACd,yBAAyB;KAC1B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC1B,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare class AuthError extends Error {
2
- readonly message: string;
3
- readonly type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | undefined;
4
- constructor(message: string, type?: "auth_window_closed" | "invalid_request" | "unauthorized_client" | "access_denied" | "unsupported_response_type" | "invalid_scope" | "server_error" | "temporarily_unavailable" | undefined);
5
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/error.ts"],"names":[],"mappings":";AAEA;IAA+B,6BAAK;IAClC,mBACkB,OAAe,EACf,IAAoB;QAFtC,YAIE,kBAAM,OAAO,CAAC,SAIf;QAPiB,aAAO,GAAP,OAAO,CAAQ;QACf,UAAI,GAAJ,IAAI,CAAgB;QAGpC,KAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,gBAAC;AAAD,CAAC,AAVD,CAA+B,KAAK,GAUnC"}
@@ -1,2 +0,0 @@
1
- export declare function auth(startUrl: string): Promise<void>;
2
- export { AuthError } from './error';
@@ -1 +0,0 @@
1
- {"version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GAAG;YACZ,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;YAC5D,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC7C,kBAAkB,GAAG,MAAM,CAAC,WAAW,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;QACzE,CAAC,CAAC;QAEF,IAAM,MAAM,GAAG;YACb,aAAa,CAAC,kBAAkB,CAAC,CAAC;YAClC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC;YAC/D,IAAI,UAAU,EAAE;gBACd,UAAU,CAAC,KAAK,EAAE,CAAC;gBACnB,UAAU,GAAG,IAAI,CAAC;aACnB;QACH,CAAC,CAAC;QAEF,KAAK,EAAE,CAAC;IACV,CAAC,CAAC,CAAC;AACL,CAAC;AAED,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare type AuthErrorType = 'auth_window_closed' | 'invalid_request' | 'unauthorized_client' | 'access_denied' | 'unsupported_response_type' | 'invalid_scope' | 'server_error' | 'temporarily_unavailable';
2
- export declare const isOfTypeAuthError: (inputString: string) => inputString is AuthErrorType;
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAaA,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAC/B,WAAmB;IAEnB,OAAO;QACL,oBAAoB;QACpB,iBAAiB;QACjB,qBAAqB;QACrB,eAAe;QACf,2BAA2B;QAC3B,eAAe;QACf,cAAc;QACd,yBAAyB;KAC1B,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC1B,CAAC,CAAC"}