@atlaskit/outbound-auth-flow-client
Advanced tools
Comparing version 3.3.3 to 3.4.0
# @atlaskit/outbound-auth-flow-client | ||
## 3.4.0 | ||
### Minor Changes | ||
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump | ||
## 3.3.3 | ||
@@ -4,0 +10,0 @@ |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,27 +8,15 @@ value: true | ||
exports.AuthError = void 0; | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits")); | ||
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn")); | ||
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf")); | ||
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper")); | ||
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); }; } | ||
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; } } | ||
var AuthError = /*#__PURE__*/function (_Error) { | ||
(0, _inherits2.default)(AuthError, _Error); | ||
var _super = _createSuper(AuthError); | ||
function AuthError(message, type) { | ||
var _this; | ||
(0, _classCallCheck2.default)(this, AuthError); | ||
@@ -44,6 +31,4 @@ _this = _super.call(this, message); | ||
} | ||
return (0, _createClass2.default)(AuthError); | ||
}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); | ||
exports.AuthError = AuthError; |
"use strict"; | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -15,9 +14,5 @@ value: true | ||
exports.auth = auth; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _error = require("./error"); | ||
var _types = require("./types"); | ||
function auth(startUrl, windowFeatures) { | ||
@@ -27,3 +22,2 @@ return new Promise(function (resolve, reject) { | ||
var authWindowInterval; | ||
var handleAuthWindowMessage = function handleAuthWindowMessage(event) { | ||
@@ -33,9 +27,6 @@ if (event.source !== authWindow) { | ||
} | ||
var data = event.data; | ||
if ((0, _typeof2.default)(data) !== 'object') { | ||
return; | ||
} | ||
switch (data.type) { | ||
@@ -46,7 +37,5 @@ case 'outbound-auth:success': | ||
break; | ||
case 'outbound-auth:failure': | ||
finish(); | ||
var errorType = data.errorType.toLowerCase(); | ||
if ((0, _types.isOfTypeAuthError)(errorType)) { | ||
@@ -57,7 +46,5 @@ reject(new _error.AuthError(data.message, errorType)); | ||
} | ||
break; | ||
} | ||
}; | ||
var handleAuthWindowInterval = function handleAuthWindowInterval() { | ||
@@ -69,3 +56,2 @@ if (authWindow && authWindow.closed) { | ||
}; | ||
var start = function start() { | ||
@@ -76,7 +62,5 @@ window.addEventListener('message', handleAuthWindowMessage); | ||
}; | ||
var finish = function finish() { | ||
clearInterval(authWindowInterval); | ||
window.removeEventListener('message', handleAuthWindowMessage); | ||
if (authWindow) { | ||
@@ -87,5 +71,4 @@ authWindow.close(); | ||
}; | ||
start(); | ||
}); | ||
} |
@@ -7,3 +7,2 @@ "use strict"; | ||
exports.isOfTypeAuthError = void 0; | ||
// See https://tools.ietf.org/html/rfc6749#section-4.1.2.1 | ||
@@ -14,6 +13,6 @@ // 'auth_window_closed' is returned in addition to types from this RFC, | ||
// outbound-auth | ||
var isOfTypeAuthError = function isOfTypeAuthError(inputString) { | ||
return ['auth_window_closed', 'invalid_request', 'unauthorized_client', 'access_denied', 'unsupported_response_type', 'invalid_scope', 'server_error', 'temporarily_unavailable', 'authclientoauth2.autherror'].includes(inputString); | ||
}; | ||
exports.isOfTypeAuthError = isOfTypeAuthError; |
{ | ||
"name": "@atlaskit/outbound-auth-flow-client", | ||
"version": "3.3.3" | ||
"version": "3.4.0" | ||
} |
@@ -10,3 +10,2 @@ export class AuthError extends Error { | ||
} | ||
} |
@@ -7,3 +7,2 @@ import { AuthError } from './error'; | ||
let authWindowInterval; | ||
const handleAuthWindowMessage = event => { | ||
@@ -13,11 +12,8 @@ if (event.source !== authWindow) { | ||
} | ||
const { | ||
data | ||
} = event; | ||
if (typeof data !== 'object') { | ||
return; | ||
} | ||
switch (data.type) { | ||
@@ -28,7 +24,5 @@ case 'outbound-auth:success': | ||
break; | ||
case 'outbound-auth:failure': | ||
finish(); | ||
const errorType = data.errorType.toLowerCase(); | ||
if (isOfTypeAuthError(errorType)) { | ||
@@ -39,7 +33,5 @@ reject(new AuthError(data.message, errorType)); | ||
} | ||
break; | ||
} | ||
}; | ||
const handleAuthWindowInterval = () => { | ||
@@ -51,3 +43,2 @@ if (authWindow && authWindow.closed) { | ||
}; | ||
const start = () => { | ||
@@ -58,7 +49,5 @@ window.addEventListener('message', handleAuthWindowMessage); | ||
}; | ||
const finish = () => { | ||
clearInterval(authWindowInterval); | ||
window.removeEventListener('message', handleAuthWindowMessage); | ||
if (authWindow) { | ||
@@ -69,3 +58,2 @@ authWindow.close(); | ||
}; | ||
start(); | ||
@@ -72,0 +60,0 @@ }); |
@@ -6,4 +6,5 @@ // See https://tools.ietf.org/html/rfc6749#section-4.1.2.1 | ||
// outbound-auth | ||
export const isOfTypeAuthError = inputString => { | ||
return ['auth_window_closed', 'invalid_request', 'unauthorized_client', 'access_denied', 'unsupported_response_type', 'invalid_scope', 'server_error', 'temporarily_unavailable', 'authclientoauth2.autherror'].includes(inputString); | ||
}; |
{ | ||
"name": "@atlaskit/outbound-auth-flow-client", | ||
"version": "3.3.3" | ||
"version": "3.4.0" | ||
} |
@@ -7,17 +7,10 @@ import _createClass from "@babel/runtime/helpers/createClass"; | ||
import _wrapNativeSuper from "@babel/runtime/helpers/wrapNativeSuper"; | ||
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); }; } | ||
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; } } | ||
export var AuthError = /*#__PURE__*/function (_Error) { | ||
_inherits(AuthError, _Error); | ||
var _super = _createSuper(AuthError); | ||
function AuthError(message, type) { | ||
var _this; | ||
_classCallCheck(this, AuthError); | ||
_this = _super.call(this, message); | ||
@@ -31,4 +24,3 @@ _this.message = message; | ||
} | ||
return _createClass(AuthError); | ||
}( /*#__PURE__*/_wrapNativeSuper(Error)); |
@@ -8,3 +8,2 @@ import _typeof from "@babel/runtime/helpers/typeof"; | ||
var authWindowInterval; | ||
var handleAuthWindowMessage = function handleAuthWindowMessage(event) { | ||
@@ -14,9 +13,6 @@ if (event.source !== authWindow) { | ||
} | ||
var data = event.data; | ||
if (_typeof(data) !== 'object') { | ||
return; | ||
} | ||
switch (data.type) { | ||
@@ -27,7 +23,5 @@ case 'outbound-auth:success': | ||
break; | ||
case 'outbound-auth:failure': | ||
finish(); | ||
var errorType = data.errorType.toLowerCase(); | ||
if (isOfTypeAuthError(errorType)) { | ||
@@ -38,7 +32,5 @@ reject(new AuthError(data.message, errorType)); | ||
} | ||
break; | ||
} | ||
}; | ||
var handleAuthWindowInterval = function handleAuthWindowInterval() { | ||
@@ -50,3 +42,2 @@ if (authWindow && authWindow.closed) { | ||
}; | ||
var start = function start() { | ||
@@ -57,7 +48,5 @@ window.addEventListener('message', handleAuthWindowMessage); | ||
}; | ||
var finish = function finish() { | ||
clearInterval(authWindowInterval); | ||
window.removeEventListener('message', handleAuthWindowMessage); | ||
if (authWindow) { | ||
@@ -68,3 +57,2 @@ authWindow.close(); | ||
}; | ||
start(); | ||
@@ -71,0 +59,0 @@ }); |
@@ -6,4 +6,5 @@ // See https://tools.ietf.org/html/rfc6749#section-4.1.2.1 | ||
// outbound-auth | ||
export var isOfTypeAuthError = function isOfTypeAuthError(inputString) { | ||
return ['auth_window_closed', 'invalid_request', 'unauthorized_client', 'access_denied', 'unsupported_response_type', 'invalid_scope', 'server_error', 'temporarily_unavailable', 'authclientoauth2.autherror'].includes(inputString); | ||
}; |
{ | ||
"name": "@atlaskit/outbound-auth-flow-client", | ||
"version": "3.3.3" | ||
"version": "3.4.0" | ||
} |
{ | ||
"name": "@atlaskit/outbound-auth-flow-client", | ||
"version": "3.3.3", | ||
"version": "3.4.0", | ||
"description": "Front-end library for starting outbound auth flows", | ||
@@ -15,9 +15,2 @@ "publishConfig": { | ||
"types": "dist/types/index.d.ts", | ||
"typesVersions": { | ||
">=4.0 <4.5": { | ||
"*": [ | ||
"dist/types-ts4.0/*" | ||
] | ||
} | ||
}, | ||
"atlaskit:src": "src/index.ts", | ||
@@ -24,0 +17,0 @@ "atlassian": { |
@@ -0,11 +1,17 @@ | ||
<!-- API Report Version: 2.3 --> | ||
## API Report File for "@atlaskit/outbound-auth-flow-client" | ||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
> Do not edit this file. This report is auto-generated using [API Extractor](https://api-extractor.com/). | ||
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports) | ||
<!-- | ||
Generated API Report version: 2.0 | ||
--> | ||
### Table of contents | ||
[Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports) | ||
- [Main Entry Types](#main-entry-types) | ||
- [Peer Dependencies](#peer-dependencies) | ||
### Main Entry Types | ||
<!--SECTION START: Main Entry Types--> | ||
```ts | ||
@@ -26,13 +32,25 @@ // @public (undocumented) | ||
type AuthErrorType = | ||
| 'access_denied' | ||
| 'auth_window_closed' | ||
| 'authclientoauth2.autherror' | ||
| 'invalid_request' | ||
| 'unauthorized_client' | ||
| 'access_denied' | ||
| 'unsupported_response_type' | ||
| 'invalid_scope' | ||
| 'server_error' | ||
| 'temporarily_unavailable' | ||
| 'authclientoauth2.autherror'; | ||
| 'unauthorized_client' | ||
| 'unsupported_response_type'; | ||
// (No @packageDocumentation comment for this package) | ||
``` | ||
<!--SECTION END: Main Entry Types--> | ||
### Peer Dependencies | ||
<!--SECTION START: Peer Dependencies--> | ||
```json | ||
{} | ||
``` | ||
<!--SECTION END: Peer Dependencies--> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22943
24
335