parse 4.2.0-alpha.3 → 4.2.0-alpha.5
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/dist/parse.js +293 -206
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +292 -205
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +11 -3
- package/lib/browser/EventuallyQueue.js +8 -1
- package/lib/browser/LocalDatastore.js +7 -0
- package/lib/browser/Parse.js +167 -135
- package/lib/browser/ParseQuery.js +53 -58
- package/lib/browser/ParseSession.js +2 -6
- package/lib/browser/ParseUser.js +36 -1
- package/lib/browser/Storage.js +7 -0
- package/lib/node/CoreManager.js +10 -3
- package/lib/node/EventuallyQueue.js +7 -1
- package/lib/node/LocalDatastore.js +6 -0
- package/lib/node/Parse.js +158 -126
- package/lib/node/ParseQuery.js +3 -6
- package/lib/node/ParseSession.js +1 -6
- package/lib/node/ParseUser.js +34 -1
- package/lib/node/Storage.js +6 -0
- package/lib/react-native/CoreManager.js +10 -3
- package/lib/react-native/EventuallyQueue.js +7 -1
- package/lib/react-native/LocalDatastore.js +6 -0
- package/lib/react-native/Parse.js +123 -90
- package/lib/react-native/ParseQuery.js +3 -6
- package/lib/react-native/ParseUser.js +22 -1
- package/lib/react-native/Storage.js +6 -0
- package/lib/weapp/CoreManager.js +11 -3
- package/lib/weapp/EventuallyQueue.js +8 -1
- package/lib/weapp/LocalDatastore.js +7 -0
- package/lib/weapp/Parse.js +166 -134
- package/lib/weapp/ParseQuery.js +53 -58
- package/lib/weapp/ParseSession.js +2 -6
- package/lib/weapp/ParseUser.js +36 -1
- package/lib/weapp/Storage.js +7 -0
- package/package.json +11 -7
package/lib/weapp/ParseUser.js
CHANGED
|
@@ -880,6 +880,40 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
|
|
|
880
880
|
return user.logIn(options);
|
|
881
881
|
}
|
|
882
882
|
|
|
883
|
+
/**
|
|
884
|
+
* Logs in a user with a username (or email) and password, and authData. On success, this
|
|
885
|
+
* saves the session to disk, so you can retrieve the currently logged in
|
|
886
|
+
* user using <code>current</code>.
|
|
887
|
+
*
|
|
888
|
+
* @param {string} username The username (or email) to log in with.
|
|
889
|
+
* @param {string} password The password to log in with.
|
|
890
|
+
* @param {object} authData The authData to log in with.
|
|
891
|
+
* @param {object} options
|
|
892
|
+
* @static
|
|
893
|
+
* @returns {Promise} A promise that is fulfilled with the user when
|
|
894
|
+
* the login completes.
|
|
895
|
+
*/
|
|
896
|
+
}, {
|
|
897
|
+
key: "logInWithAdditionalAuth",
|
|
898
|
+
value: function (username /*: string*/, password /*: string*/, authData /*: AuthData*/, options /*:: ?: FullOptions*/) {
|
|
899
|
+
if (typeof username !== 'string') {
|
|
900
|
+
return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Username must be a string.'));
|
|
901
|
+
}
|
|
902
|
+
if (typeof password !== 'string') {
|
|
903
|
+
return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Password must be a string.'));
|
|
904
|
+
}
|
|
905
|
+
if (Object.prototype.toString.call(authData) !== '[object Object]') {
|
|
906
|
+
return _promise.default.reject(new _ParseError.default(_ParseError.default.OTHER_CAUSE, 'Auth must be an object.'));
|
|
907
|
+
}
|
|
908
|
+
var user = new this();
|
|
909
|
+
user._finishFetch({
|
|
910
|
+
username: username,
|
|
911
|
+
password: password,
|
|
912
|
+
authData: authData
|
|
913
|
+
});
|
|
914
|
+
return user.logIn(options);
|
|
915
|
+
}
|
|
916
|
+
|
|
883
917
|
/**
|
|
884
918
|
* Logs in a user with an objectId. On success, this saves the session
|
|
885
919
|
* to disk, so you can retrieve the currently logged in user using
|
|
@@ -1329,7 +1363,8 @@ var DefaultController = {
|
|
|
1329
1363
|
var stateController = _CoreManager.default.getObjectStateController();
|
|
1330
1364
|
var auth = {
|
|
1331
1365
|
username: user.get('username'),
|
|
1332
|
-
password: user.get('password')
|
|
1366
|
+
password: user.get('password'),
|
|
1367
|
+
authData: user.get('authData')
|
|
1333
1368
|
};
|
|
1334
1369
|
return RESTController.request(options.usePost ? 'POST' : 'GET', 'login', auth, options).then(function (response) {
|
|
1335
1370
|
user._migrateId(response.objectId);
|
package/lib/weapp/Storage.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
5
|
+
_Object$defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
4
9
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));
|
|
5
10
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
6
11
|
/**
|
|
@@ -88,4 +93,6 @@ var Storage = {
|
|
|
88
93
|
}
|
|
89
94
|
};
|
|
90
95
|
module.exports = Storage;
|
|
96
|
+
var _default = Storage;
|
|
97
|
+
exports.default = _default;
|
|
91
98
|
_CoreManager.default.setStorageController(require('./StorageController.weapp'));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "parse",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.5",
|
|
4
4
|
"description": "Parse JavaScript SDK",
|
|
5
5
|
"homepage": "https://parseplatform.org",
|
|
6
6
|
"keywords": [
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"react-native": false
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@babel/runtime-corejs3": "7.22.
|
|
32
|
+
"@babel/runtime-corejs3": "7.22.6",
|
|
33
33
|
"idb-keyval": "6.2.1",
|
|
34
34
|
"react-native-crypto-js": "1.0.0",
|
|
35
35
|
"uuid": "9.0.0",
|
|
@@ -40,11 +40,13 @@
|
|
|
40
40
|
"@babel/core": "7.22.0",
|
|
41
41
|
"@babel/eslint-parser": "7.21.8",
|
|
42
42
|
"@babel/plugin-proposal-class-properties": "7.18.6",
|
|
43
|
-
"@babel/plugin-transform-flow-comments": "7.
|
|
43
|
+
"@babel/plugin-transform-flow-comments": "7.22.5",
|
|
44
44
|
"@babel/plugin-transform-flow-strip-types": "7.21.0",
|
|
45
45
|
"@babel/plugin-transform-runtime": "7.21.4",
|
|
46
46
|
"@babel/preset-env": "7.21.5",
|
|
47
|
-
"@babel/preset-react": "7.
|
|
47
|
+
"@babel/preset-react": "7.22.5",
|
|
48
|
+
"@babel/preset-typescript": "7.22.5",
|
|
49
|
+
"@definitelytyped/dtslint": "0.0.163",
|
|
48
50
|
"@parse/minami": "1.0.0",
|
|
49
51
|
"@saithodev/semantic-release-backmerge": "2.1.3",
|
|
50
52
|
"@semantic-release/changelog": "6.0.3",
|
|
@@ -82,7 +84,7 @@
|
|
|
82
84
|
"jsdoc-babel": "0.5.0",
|
|
83
85
|
"lint-staged": "13.2.2",
|
|
84
86
|
"metro-react-native-babel-preset": "0.76.4",
|
|
85
|
-
"mongodb-runner": "4.
|
|
87
|
+
"mongodb-runner": "5.4.3",
|
|
86
88
|
"parse-server": "git+https://github.com/parse-community/parse-server#alpha",
|
|
87
89
|
"prettier": "2.8.8",
|
|
88
90
|
"puppeteer": "20.4.0",
|
|
@@ -95,11 +97,13 @@
|
|
|
95
97
|
},
|
|
96
98
|
"scripts": {
|
|
97
99
|
"build": "node build_releases.js",
|
|
100
|
+
"build:types": "tsc",
|
|
98
101
|
"release": "node build_releases.js && npm publish",
|
|
99
102
|
"test": "cross-env PARSE_BUILD=node jest",
|
|
100
103
|
"test:mongodb": "npm run test:mongodb:runnerstart && npm run integration",
|
|
101
|
-
"test:mongodb:runnerstart": "mongodb-runner start",
|
|
102
|
-
"
|
|
104
|
+
"test:mongodb:runnerstart": "mongodb-runner start -- --port 27017",
|
|
105
|
+
"test:types": "dtslint --expectOnly types",
|
|
106
|
+
"posttest:mongodb": "mongodb-runner stop --all",
|
|
103
107
|
"lint": "eslint --cache src/ integration/",
|
|
104
108
|
"lint:fix": "eslint --fix --cache src/ integration/",
|
|
105
109
|
"watch": "cross-env PARSE_BUILD=${PARSE_BUILD} gulp watch",
|