kinvey-js-sdk
Advanced tools
Comparing version 6.0.0-next.5 to 6.0.0
@@ -37,3 +37,2 @@ import { Query } from '../query'; | ||
timeout?: number; | ||
state?: boolean; | ||
}): Promise<KinveyUser>; | ||
@@ -40,0 +39,0 @@ static signUpWithIdentity(): Promise<void>; |
import { User } from './user'; | ||
export declare function signup(data?: object | User, options?: { | ||
timeout?: number; | ||
state?: boolean; | ||
}): Promise<User>; |
@@ -43,6 +43,4 @@ "use strict"; | ||
var isPlainObject_1 = __importDefault(require("lodash/isPlainObject")); | ||
var activeUser_1 = require("../errors/activeUser"); | ||
var kinvey_1 = require("../errors/kinvey"); | ||
var http_1 = require("../http"); | ||
var getActiveUser_1 = require("./getActiveUser"); | ||
var user_1 = require("./user"); | ||
@@ -52,15 +50,9 @@ function signup(data, options) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var activeUser, _a, state, request, response, session; | ||
return __generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: return [4 /*yield*/, getActiveUser_1.getActiveUser()]; | ||
case 1: | ||
activeUser = _b.sent(); | ||
_a = options.state, state = _a === void 0 ? true : _a; | ||
var request, response, session; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: | ||
if (data && !isPlainObject_1.default(data)) { | ||
throw new kinvey_1.KinveyError('The provided data must be an object.'); | ||
} | ||
if (state === true && activeUser) { | ||
throw new activeUser_1.ActiveUserError('An active user already exists. Please logout the active user before you signup.'); | ||
} | ||
request = new http_1.KinveyHttpRequest({ | ||
@@ -79,11 +71,6 @@ method: http_1.HttpRequestMethod.POST, | ||
return [4 /*yield*/, request.execute()]; | ||
case 2: | ||
response = _b.sent(); | ||
case 1: | ||
response = _a.sent(); | ||
session = response.data; | ||
if (!(state === true)) return [3 /*break*/, 4]; | ||
return [4 /*yield*/, http_1.setSession(session)]; | ||
case 3: | ||
_b.sent(); | ||
_b.label = 4; | ||
case 4: return [2 /*return*/, new user_1.User(session)]; | ||
return [2 /*return*/, new user_1.User(session)]; | ||
} | ||
@@ -90,0 +77,0 @@ }); |
{ | ||
"name": "kinvey-js-sdk", | ||
"description": "Kinvey JavaScript SDK for JavaScript applications.", | ||
"version": "6.0.0-next.5", | ||
"version": "6.0.0", | ||
"license": "Apache-2.0", | ||
@@ -21,3 +21,3 @@ "keywords": [ | ||
"js-base64": "2.5.1", | ||
"lodash": "4.17.21", | ||
"lodash": "4.17.15", | ||
"loglevel": "1.6.3", | ||
@@ -24,0 +24,0 @@ "loglevel-plugin-prefix": "0.8.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1
755110
11762
+ Addedlodash@4.17.15(transitive)
- Removedlodash@4.17.21(transitive)
Updatedlodash@4.17.15