parse 4.1.0-alpha.3 → 4.1.0-alpha.4
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 +192 -36
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +192 -36
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/AnonymousUtils.js +1 -1
- package/lib/browser/Cloud.js +1 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/EventuallyQueue.js +13 -1
- package/lib/browser/LiveQueryClient.js +1 -1
- package/lib/browser/LocalDatastore.js +3 -1
- package/lib/browser/LocalDatastoreController.js +3 -1
- package/lib/browser/ObjectStateMutations.js +14 -1
- package/lib/browser/ParseACL.js +2 -1
- package/lib/browser/ParseCLP.js +6 -1
- package/lib/browser/ParseConfig.js +1 -0
- package/lib/browser/ParseFile.js +4 -1
- package/lib/browser/ParseInstallation.js +4 -1
- package/lib/browser/ParseObject.js +10 -7
- package/lib/browser/ParseOp.js +3 -1
- package/lib/browser/ParseQuery.js +26 -5
- package/lib/browser/ParseRole.js +5 -1
- package/lib/browser/ParseSchema.js +1 -1
- package/lib/browser/ParseSession.js +5 -1
- package/lib/browser/ParseUser.js +42 -1
- package/lib/browser/Push.js +8 -2
- package/lib/browser/RESTController.js +20 -0
- package/lib/browser/SingleInstanceStateController.js +6 -1
- package/lib/browser/TaskQueue.js +4 -0
- package/lib/browser/UniqueInstanceStateController.js +3 -1
- package/lib/browser/unsavedChildren.js +4 -1
- package/lib/node/AnonymousUtils.js +1 -1
- package/lib/node/Cloud.js +1 -2
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/EventuallyQueue.js +13 -1
- package/lib/node/LocalDatastore.js +1 -1
- package/lib/node/ObjectStateMutations.js +11 -1
- package/lib/node/ParseACL.js +2 -1
- package/lib/node/ParseCLP.js +3 -1
- package/lib/node/ParseConfig.js +1 -2
- package/lib/node/ParseFile.js +1 -1
- package/lib/node/ParseInstallation.js +1 -1
- package/lib/node/ParseObject.js +2 -1
- package/lib/node/ParseQuery.js +23 -1
- package/lib/node/ParseRole.js +2 -1
- package/lib/node/ParseSchema.js +1 -1
- package/lib/node/ParseSession.js +2 -1
- package/lib/node/ParseUser.js +37 -1
- package/lib/node/Push.js +8 -2
- package/lib/node/RESTController.js +20 -0
- package/lib/node/SingleInstanceStateController.js +6 -1
- package/lib/node/TaskQueue.js +4 -1
- package/lib/node/UniqueInstanceStateController.js +3 -1
- package/lib/node/unsavedChildren.js +4 -1
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/ParseCLP.js +2 -2
- package/lib/react-native/ParseUser.js +25 -0
- package/lib/weapp/AnonymousUtils.js +1 -1
- package/lib/weapp/Cloud.js +1 -2
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/EventuallyQueue.js +13 -1
- package/lib/weapp/LiveQueryClient.js +1 -1
- package/lib/weapp/LocalDatastore.js +3 -1
- package/lib/weapp/LocalDatastoreController.js +3 -1
- package/lib/weapp/ObjectStateMutations.js +14 -1
- package/lib/weapp/ParseACL.js +2 -1
- package/lib/weapp/ParseCLP.js +6 -1
- package/lib/weapp/ParseConfig.js +1 -0
- package/lib/weapp/ParseFile.js +4 -1
- package/lib/weapp/ParseInstallation.js +4 -1
- package/lib/weapp/ParseObject.js +10 -7
- package/lib/weapp/ParseOp.js +3 -1
- package/lib/weapp/ParseQuery.js +26 -5
- package/lib/weapp/ParseRole.js +5 -1
- package/lib/weapp/ParseSchema.js +1 -1
- package/lib/weapp/ParseSession.js +5 -1
- package/lib/weapp/ParseUser.js +42 -1
- package/lib/weapp/Push.js +8 -2
- package/lib/weapp/RESTController.js +20 -0
- package/lib/weapp/SingleInstanceStateController.js +6 -1
- package/lib/weapp/TaskQueue.js +4 -0
- package/lib/weapp/UniqueInstanceStateController.js +3 -1
- package/lib/weapp/unsavedChildren.js +4 -1
- package/package.json +12 -12
package/dist/parse.weapp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Parse JavaScript SDK v4.1.0-alpha.
|
|
2
|
+
* Parse JavaScript SDK v4.1.0-alpha.4
|
|
3
3
|
*
|
|
4
4
|
* The source tree of this library can be found at
|
|
5
5
|
* https://github.com/ParsePlatform/Parse-SDK-JS
|
|
@@ -94,7 +94,7 @@ var _ParseUser = _interopRequireDefault(_dereq_("./ParseUser"));
|
|
|
94
94
|
/**
|
|
95
95
|
* @flow-weak
|
|
96
96
|
*/
|
|
97
|
-
|
|
97
|
+
/*:: import type { RequestOptions } from './RESTController';*/
|
|
98
98
|
var uuidv4 = _dereq_('./uuid');
|
|
99
99
|
var registered = false;
|
|
100
100
|
|
|
@@ -229,7 +229,7 @@ var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
|
229
229
|
/**
|
|
230
230
|
* @flow
|
|
231
231
|
*/
|
|
232
|
-
|
|
232
|
+
/*:: import type { RequestOptions } from './RESTController';*/
|
|
233
233
|
/**
|
|
234
234
|
* Contains functions for calling and declaring
|
|
235
235
|
* <a href="/docs/cloud_code_guide#functions">cloud functions</a>.
|
|
@@ -241,7 +241,6 @@ var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
|
241
241
|
* @static
|
|
242
242
|
* @hideconstructor
|
|
243
243
|
*/
|
|
244
|
-
|
|
245
244
|
/**
|
|
246
245
|
* Makes a call to a cloud function.
|
|
247
246
|
*
|
|
@@ -531,7 +530,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
531
530
|
SERVER_AUTH_TOKEN: null,
|
|
532
531
|
LIVEQUERY_SERVER_URL: null,
|
|
533
532
|
ENCRYPTED_KEY: null,
|
|
534
|
-
VERSION: 'js' + "4.1.0-alpha.
|
|
533
|
+
VERSION: 'js' + "4.1.0-alpha.4",
|
|
535
534
|
APPLICATION_ID: null,
|
|
536
535
|
JAVASCRIPT_KEY: null,
|
|
537
536
|
MASTER_KEY: null,
|
|
@@ -760,7 +759,19 @@ var _Storage = _interopRequireDefault(_dereq_("./Storage"));
|
|
|
760
759
|
*
|
|
761
760
|
* @flow
|
|
762
761
|
*/
|
|
763
|
-
|
|
762
|
+
/*:: import type { SaveOptions } from './ParseObject';*/
|
|
763
|
+
/*:: import type { RequestOptions } from './RESTController';*/
|
|
764
|
+
/*:: type QueueObject = {
|
|
765
|
+
queueId: string,
|
|
766
|
+
action: string,
|
|
767
|
+
object: ParseObject,
|
|
768
|
+
serverOptions: SaveOptions | RequestOptions,
|
|
769
|
+
id: string,
|
|
770
|
+
className: string,
|
|
771
|
+
hash: string,
|
|
772
|
+
createdAt: Date,
|
|
773
|
+
};*/
|
|
774
|
+
/*:: type Queue = Array<QueueObject>;*/
|
|
764
775
|
var QUEUE_KEY = 'Parse/Eventually/Queue';
|
|
765
776
|
var queueCache = [];
|
|
766
777
|
var dirtyCache = true;
|
|
@@ -1673,7 +1684,7 @@ function _isNativeReflectConstruct() {
|
|
|
1673
1684
|
} catch (e) {
|
|
1674
1685
|
return false;
|
|
1675
1686
|
}
|
|
1676
|
-
}
|
|
1687
|
+
} /* global WebSocket */
|
|
1677
1688
|
// The LiveQuery client inner state
|
|
1678
1689
|
var CLIENT_STATE = {
|
|
1679
1690
|
INITIALIZED: 'initialized',
|
|
@@ -2476,7 +2487,9 @@ function _arrayLikeToArray(arr, len) {
|
|
|
2476
2487
|
if (len == null || len > arr.length) len = arr.length;
|
|
2477
2488
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
2478
2489
|
return arr2;
|
|
2479
|
-
}
|
|
2490
|
+
} /**
|
|
2491
|
+
* @flow
|
|
2492
|
+
*/ /*:: import type ParseObject from './ParseObject';*/
|
|
2480
2493
|
/**
|
|
2481
2494
|
* Provides a local datastore which can be used to store and retrieve <code>Parse.Object</code>. <br />
|
|
2482
2495
|
* To enable this functionality, call <code>Parse.enableLocalDatastore()</code>.
|
|
@@ -3167,7 +3180,9 @@ function _arrayLikeToArray(arr, len) {
|
|
|
3167
3180
|
if (len == null || len > arr.length) len = arr.length;
|
|
3168
3181
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
3169
3182
|
return arr2;
|
|
3170
|
-
}
|
|
3183
|
+
} /**
|
|
3184
|
+
* @flow
|
|
3185
|
+
*/
|
|
3171
3186
|
var LocalDatastoreController = {
|
|
3172
3187
|
fromPinWithName: function (name /*: string*/) /*: Array<Object>*/{
|
|
3173
3188
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -3413,7 +3428,20 @@ function _objectSpread(target) {
|
|
|
3413
3428
|
});
|
|
3414
3429
|
}
|
|
3415
3430
|
return target;
|
|
3416
|
-
}
|
|
3431
|
+
} /**
|
|
3432
|
+
* @flow
|
|
3433
|
+
*/
|
|
3434
|
+
/*:: import type { Op } from './ParseOp';*/
|
|
3435
|
+
/*:: export type AttributeMap = { [attr: string]: any };*/
|
|
3436
|
+
/*:: export type OpsMap = { [attr: string]: Op };*/
|
|
3437
|
+
/*:: export type ObjectCache = { [attr: string]: string };*/
|
|
3438
|
+
/*:: export type State = {
|
|
3439
|
+
serverData: AttributeMap,
|
|
3440
|
+
pendingOps: Array<OpsMap>,
|
|
3441
|
+
objectCache: ObjectCache,
|
|
3442
|
+
tasks: TaskQueue,
|
|
3443
|
+
existed: boolean,
|
|
3444
|
+
};*/
|
|
3417
3445
|
function defaultState() /*: State*/{
|
|
3418
3446
|
return {
|
|
3419
3447
|
serverData: {},
|
|
@@ -4564,7 +4592,8 @@ var _ParseUser = _interopRequireDefault(_dereq_("./ParseUser"));
|
|
|
4564
4592
|
/**
|
|
4565
4593
|
* @flow
|
|
4566
4594
|
*/
|
|
4567
|
-
|
|
4595
|
+
/*:: type PermissionsMap = { [permission: string]: boolean };*/
|
|
4596
|
+
/*:: type ByIdMap = { [userId: string]: PermissionsMap };*/
|
|
4568
4597
|
var PUBLIC_KEY = '*';
|
|
4569
4598
|
|
|
4570
4599
|
/**
|
|
@@ -5028,7 +5057,12 @@ function _arrayLikeToArray(arr, len) {
|
|
|
5028
5057
|
if (len == null || len > arr.length) len = arr.length;
|
|
5029
5058
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
5030
5059
|
return arr2;
|
|
5031
|
-
}
|
|
5060
|
+
} /**
|
|
5061
|
+
* @flow
|
|
5062
|
+
*/
|
|
5063
|
+
/*:: type Entity = Entity;*/
|
|
5064
|
+
/*:: type UsersMap = { [userId: string]: boolean | any };*/
|
|
5065
|
+
/*:: export type PermissionsMap = { [permission: string]: UsersMap };*/
|
|
5032
5066
|
var PUBLIC_KEY = '*';
|
|
5033
5067
|
var VALID_PERMISSIONS /*: Map<string, UsersMap>*/ = new _map.default(
|
|
5034
5068
|
/*:: <string, UsersMap>*/
|
|
@@ -5710,6 +5744,7 @@ var _Storage = _interopRequireDefault(_dereq_("./Storage"));
|
|
|
5710
5744
|
/**
|
|
5711
5745
|
* @flow
|
|
5712
5746
|
*/
|
|
5747
|
+
/*:: import type { RequestOptions } from './RESTController';*/
|
|
5713
5748
|
/**
|
|
5714
5749
|
* Parse.Config is a local representation of configuration data that
|
|
5715
5750
|
* can be set from the Parse dashboard.
|
|
@@ -6561,7 +6596,10 @@ function _objectSpread(target) {
|
|
|
6561
6596
|
});
|
|
6562
6597
|
}
|
|
6563
6598
|
return target;
|
|
6564
|
-
}
|
|
6599
|
+
} /**
|
|
6600
|
+
* @flow
|
|
6601
|
+
*/ /* global XMLHttpRequest, Blob */
|
|
6602
|
+
/*:: import type { FullOptions } from './RESTController';*/
|
|
6565
6603
|
var ParseError = _dereq_('./ParseError').default;
|
|
6566
6604
|
var XHR = null;
|
|
6567
6605
|
if (typeof XMLHttpRequest !== 'undefined') {
|
|
@@ -7415,7 +7453,10 @@ function _isNativeReflectConstruct() {
|
|
|
7415
7453
|
} catch (e) {
|
|
7416
7454
|
return false;
|
|
7417
7455
|
}
|
|
7418
|
-
}
|
|
7456
|
+
} /**
|
|
7457
|
+
* @flow
|
|
7458
|
+
*/
|
|
7459
|
+
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
7419
7460
|
var Installation = /*#__PURE__*/function (_ParseObject) {
|
|
7420
7461
|
(0, _inherits2.default)(Installation, _ParseObject);
|
|
7421
7462
|
var _super = _createSuper(Installation);
|
|
@@ -7797,7 +7838,11 @@ function _objectSpread(target) {
|
|
|
7797
7838
|
});
|
|
7798
7839
|
}
|
|
7799
7840
|
return target;
|
|
7800
|
-
}
|
|
7841
|
+
} /**
|
|
7842
|
+
* @flow
|
|
7843
|
+
*/
|
|
7844
|
+
/*:: import type { AttributeMap, OpsMap } from './ObjectStateMutations';*/
|
|
7845
|
+
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
7801
7846
|
var uuidv4 = _dereq_('./uuid');
|
|
7802
7847
|
/*:: export type Pointer = {
|
|
7803
7848
|
__type: string,
|
|
@@ -7863,6 +7908,11 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
7863
7908
|
*/
|
|
7864
7909
|
function ParseObject(className /*: ?string | { className: string, [attr: string]: mixed }*/, attributes /*:: ?: { [attr: string]: mixed }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
|
|
7865
7910
|
(0, _classCallCheck2.default)(this, ParseObject);
|
|
7911
|
+
/**
|
|
7912
|
+
* The ID of this object, unique within its class.
|
|
7913
|
+
*
|
|
7914
|
+
* @property {string} id
|
|
7915
|
+
*/
|
|
7866
7916
|
(0, _defineProperty2.default)(this, "id", void 0);
|
|
7867
7917
|
(0, _defineProperty2.default)(this, "_localId", void 0);
|
|
7868
7918
|
(0, _defineProperty2.default)(this, "_objCount", void 0);
|
|
@@ -7894,12 +7944,6 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
7894
7944
|
throw new Error("Can't create an invalid Parse Object");
|
|
7895
7945
|
}
|
|
7896
7946
|
}
|
|
7897
|
-
|
|
7898
|
-
/**
|
|
7899
|
-
* The ID of this object, unique within its class.
|
|
7900
|
-
*
|
|
7901
|
-
* @property {string} id
|
|
7902
|
-
*/
|
|
7903
7947
|
(0, _createClass2.default)(ParseObject, [{
|
|
7904
7948
|
key: "attributes",
|
|
7905
7949
|
get: /* Prototype getters / setters */
|
|
@@ -10705,7 +10749,9 @@ function _isNativeReflectConstruct() {
|
|
|
10705
10749
|
} catch (e) {
|
|
10706
10750
|
return false;
|
|
10707
10751
|
}
|
|
10708
|
-
}
|
|
10752
|
+
} /**
|
|
10753
|
+
* @flow
|
|
10754
|
+
*/
|
|
10709
10755
|
function opFromJSON(json /*: { [key: string]: any }*/) /*: ?Op*/{
|
|
10710
10756
|
if (!json || !json.__op) {
|
|
10711
10757
|
return null;
|
|
@@ -11452,7 +11498,29 @@ var _LocalDatastoreUtils = _dereq_("./LocalDatastoreUtils");
|
|
|
11452
11498
|
/*
|
|
11453
11499
|
* @flow
|
|
11454
11500
|
*/
|
|
11455
|
-
|
|
11501
|
+
/*:: import type LiveQuerySubscription from './LiveQuerySubscription';*/
|
|
11502
|
+
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
11503
|
+
/*:: type BatchOptions = FullOptions & { batchSize?: number };*/
|
|
11504
|
+
/*:: export type WhereClause = {
|
|
11505
|
+
[attr: string]: mixed,
|
|
11506
|
+
};*/
|
|
11507
|
+
/*:: export type QueryJSON = {
|
|
11508
|
+
where: WhereClause,
|
|
11509
|
+
watch?: string,
|
|
11510
|
+
include?: string,
|
|
11511
|
+
excludeKeys?: string,
|
|
11512
|
+
keys?: string,
|
|
11513
|
+
limit?: number,
|
|
11514
|
+
skip?: number,
|
|
11515
|
+
order?: string,
|
|
11516
|
+
className?: string,
|
|
11517
|
+
count?: number,
|
|
11518
|
+
hint?: mixed,
|
|
11519
|
+
explain?: boolean,
|
|
11520
|
+
readPreference?: string,
|
|
11521
|
+
includeReadPreference?: string,
|
|
11522
|
+
subqueryReadPreference?: string,
|
|
11523
|
+
};*/
|
|
11456
11524
|
/**
|
|
11457
11525
|
* Converts a string into a regex that matches it.
|
|
11458
11526
|
* Surrounding with \Q .. \E does this, we just need to escape any \E's in
|
|
@@ -11627,15 +11695,14 @@ function handleOfflineSort(a, b, sorts) {
|
|
|
11627
11695
|
* @alias Parse.Query
|
|
11628
11696
|
*/
|
|
11629
11697
|
var ParseQuery = /*#__PURE__*/function () {
|
|
11630
|
-
/**
|
|
11631
|
-
* @property {string} className
|
|
11632
|
-
*/
|
|
11633
|
-
|
|
11634
11698
|
/**
|
|
11635
11699
|
* @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string.
|
|
11636
11700
|
*/
|
|
11637
11701
|
function ParseQuery(objectClass /*: string | ParseObject*/) {
|
|
11638
11702
|
(0, _classCallCheck2.default)(this, ParseQuery);
|
|
11703
|
+
/**
|
|
11704
|
+
* @property {string} className
|
|
11705
|
+
*/
|
|
11639
11706
|
(0, _defineProperty2.default)(this, "className", void 0);
|
|
11640
11707
|
(0, _defineProperty2.default)(this, "_where", void 0);
|
|
11641
11708
|
(0, _defineProperty2.default)(this, "_watch", void 0);
|
|
@@ -14003,7 +14070,11 @@ function _isNativeReflectConstruct() {
|
|
|
14003
14070
|
} catch (e) {
|
|
14004
14071
|
return false;
|
|
14005
14072
|
}
|
|
14006
|
-
}
|
|
14073
|
+
} /**
|
|
14074
|
+
* @flow
|
|
14075
|
+
*/
|
|
14076
|
+
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14077
|
+
/*:: import type ParseRelation from './ParseRelation';*/
|
|
14007
14078
|
/**
|
|
14008
14079
|
* Represents a Role on the Parse server. Roles represent groupings of
|
|
14009
14080
|
* Users for the purposes of granting permissions (e.g. specifying an ACL
|
|
@@ -14167,7 +14238,7 @@ var _ParseCLP = _interopRequireDefault(_dereq_("./ParseCLP"));
|
|
|
14167
14238
|
/**
|
|
14168
14239
|
* @flow
|
|
14169
14240
|
*/
|
|
14170
|
-
|
|
14241
|
+
/*:: import type { PermissionsMap } from './ParseCLP';*/
|
|
14171
14242
|
var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
|
|
14172
14243
|
/*:: type FieldOptions = {
|
|
14173
14244
|
required: boolean,
|
|
@@ -14708,7 +14779,11 @@ function _isNativeReflectConstruct() {
|
|
|
14708
14779
|
} catch (e) {
|
|
14709
14780
|
return false;
|
|
14710
14781
|
}
|
|
14711
|
-
}
|
|
14782
|
+
} /**
|
|
14783
|
+
* @flow
|
|
14784
|
+
*/
|
|
14785
|
+
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14786
|
+
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
14712
14787
|
/**
|
|
14713
14788
|
* <p>A Parse.Session object is a local representation of a revocable session.
|
|
14714
14789
|
* This class is a subclass of a Parse.Object, and retains the same
|
|
@@ -14871,7 +14946,12 @@ function _isNativeReflectConstruct() {
|
|
|
14871
14946
|
} catch (e) {
|
|
14872
14947
|
return false;
|
|
14873
14948
|
}
|
|
14874
|
-
}
|
|
14949
|
+
} /**
|
|
14950
|
+
* @flow
|
|
14951
|
+
*/
|
|
14952
|
+
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14953
|
+
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
14954
|
+
/*:: export type AuthData = ?{ [key: string]: mixed };*/
|
|
14875
14955
|
var CURRENT_USER_KEY = 'currentUser';
|
|
14876
14956
|
var canUseCurrentUser = !_CoreManager.default.get('IS_NODE');
|
|
14877
14957
|
var currentUserCacheMatchesDisk = false;
|
|
@@ -15697,6 +15777,27 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
|
|
|
15697
15777
|
return user.logIn(options);
|
|
15698
15778
|
}
|
|
15699
15779
|
|
|
15780
|
+
/**
|
|
15781
|
+
* Logs in a user with an objectId. On success, this saves the session
|
|
15782
|
+
* to disk, so you can retrieve the currently logged in user using
|
|
15783
|
+
* <code>current</code>.
|
|
15784
|
+
*
|
|
15785
|
+
* @param {string} userId The objectId for the user.
|
|
15786
|
+
* @static
|
|
15787
|
+
* @returns {Promise} A promise that is fulfilled with the user when
|
|
15788
|
+
* the login completes.
|
|
15789
|
+
*/
|
|
15790
|
+
}, {
|
|
15791
|
+
key: "loginAs",
|
|
15792
|
+
value: function (userId /*: string*/) {
|
|
15793
|
+
if (!userId) {
|
|
15794
|
+
throw new _ParseError.default(_ParseError.default.USERNAME_MISSING, 'Cannot log in as user with an empty user id');
|
|
15795
|
+
}
|
|
15796
|
+
var controller = _CoreManager.default.getUserController();
|
|
15797
|
+
var user = new this();
|
|
15798
|
+
return controller.loginAs(user, userId);
|
|
15799
|
+
}
|
|
15800
|
+
|
|
15700
15801
|
/**
|
|
15701
15802
|
* Logs in a user with a session token. On success, this saves the session
|
|
15702
15803
|
* to disk, so you can retrieve the currently logged in user using
|
|
@@ -16141,6 +16242,21 @@ var DefaultController = {
|
|
|
16141
16242
|
return DefaultController.setCurrentUser(user);
|
|
16142
16243
|
});
|
|
16143
16244
|
},
|
|
16245
|
+
loginAs: function (user /*: ParseUser*/, userId /*: string*/) /*: Promise<ParseUser>*/{
|
|
16246
|
+
var RESTController = _CoreManager.default.getRESTController();
|
|
16247
|
+
return RESTController.request('POST', 'loginAs', {
|
|
16248
|
+
userId: userId
|
|
16249
|
+
}, {
|
|
16250
|
+
useMasterKey: true
|
|
16251
|
+
}).then(function (response) {
|
|
16252
|
+
user._finishFetch(response);
|
|
16253
|
+
user._setExisted(true);
|
|
16254
|
+
if (!canUseCurrentUser) {
|
|
16255
|
+
return _promise.default.resolve(user);
|
|
16256
|
+
}
|
|
16257
|
+
return DefaultController.setCurrentUser(user);
|
|
16258
|
+
});
|
|
16259
|
+
},
|
|
16144
16260
|
become: function (user /*: ParseUser*/, options /*: RequestOptions*/) /*: Promise<ParseUser>*/{
|
|
16145
16261
|
var RESTController = _CoreManager.default.getRESTController();
|
|
16146
16262
|
return RESTController.request('GET', 'users/me', {}, options).then(function (response) {
|
|
@@ -16284,7 +16400,14 @@ var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
|
16284
16400
|
/**
|
|
16285
16401
|
* @flow
|
|
16286
16402
|
*/
|
|
16287
|
-
|
|
16403
|
+
/*:: import type { WhereClause } from './ParseQuery';*/
|
|
16404
|
+
/*:: import type { FullOptions } from './RESTController';*/
|
|
16405
|
+
/*:: export type PushData = {
|
|
16406
|
+
where?: WhereClause | ParseQuery,
|
|
16407
|
+
push_time?: Date | string,
|
|
16408
|
+
expiration_time?: Date | string,
|
|
16409
|
+
expiration_interval?: number,
|
|
16410
|
+
};*/
|
|
16288
16411
|
/**
|
|
16289
16412
|
* Contains functions to deal with Push in Parse.
|
|
16290
16413
|
*
|
|
@@ -16292,7 +16415,6 @@ var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
|
16292
16415
|
* @static
|
|
16293
16416
|
* @hideconstructor
|
|
16294
16417
|
*/
|
|
16295
|
-
|
|
16296
16418
|
/**
|
|
16297
16419
|
* Sends a push notification.
|
|
16298
16420
|
* **Available in Cloud Code only.**
|
|
@@ -16423,6 +16545,26 @@ function _objectSpread(target) {
|
|
|
16423
16545
|
*/
|
|
16424
16546
|
/* global XMLHttpRequest, XDomainRequest */
|
|
16425
16547
|
var uuidv4 = _dereq_('./uuid');
|
|
16548
|
+
/*:: export type RequestOptions = {
|
|
16549
|
+
useMasterKey?: boolean,
|
|
16550
|
+
sessionToken?: string,
|
|
16551
|
+
installationId?: string,
|
|
16552
|
+
returnStatus?: boolean,
|
|
16553
|
+
batchSize?: number,
|
|
16554
|
+
include?: any,
|
|
16555
|
+
progress?: any,
|
|
16556
|
+
context?: any,
|
|
16557
|
+
usePost?: boolean,
|
|
16558
|
+
};*/
|
|
16559
|
+
/*:: export type FullOptions = {
|
|
16560
|
+
success?: any,
|
|
16561
|
+
error?: any,
|
|
16562
|
+
useMasterKey?: boolean,
|
|
16563
|
+
sessionToken?: string,
|
|
16564
|
+
installationId?: string,
|
|
16565
|
+
progress?: any,
|
|
16566
|
+
usePost?: boolean,
|
|
16567
|
+
};*/
|
|
16426
16568
|
var XHR = null;
|
|
16427
16569
|
if (typeof XMLHttpRequest !== 'undefined') {
|
|
16428
16570
|
XHR = XMLHttpRequest;
|
|
@@ -16769,7 +16911,12 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
16769
16911
|
/**
|
|
16770
16912
|
* @flow
|
|
16771
16913
|
*/
|
|
16772
|
-
|
|
16914
|
+
/*:: import type { Op } from './ParseOp';*/
|
|
16915
|
+
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
16916
|
+
/*:: type ObjectIdentifier = {
|
|
16917
|
+
className: string,
|
|
16918
|
+
id: string,
|
|
16919
|
+
};*/
|
|
16773
16920
|
var objectState
|
|
16774
16921
|
/*: {
|
|
16775
16922
|
[className: string]: {
|
|
@@ -17052,6 +17199,10 @@ var _promiseUtils = _dereq_("./promiseUtils");
|
|
|
17052
17199
|
/**
|
|
17053
17200
|
* @flow
|
|
17054
17201
|
*/
|
|
17202
|
+
/*:: type Task = {
|
|
17203
|
+
task: () => Promise,
|
|
17204
|
+
_completion: Promise,
|
|
17205
|
+
};*/
|
|
17055
17206
|
var TaskQueue = /*#__PURE__*/function () {
|
|
17056
17207
|
function TaskQueue() {
|
|
17057
17208
|
(0, _classCallCheck2.default)(this, TaskQueue);
|
|
@@ -17170,7 +17321,9 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
17170
17321
|
/**
|
|
17171
17322
|
* @flow
|
|
17172
17323
|
*/
|
|
17173
|
-
|
|
17324
|
+
/*:: import type { Op } from './ParseOp';*/
|
|
17325
|
+
/*:: import type ParseObject from './ParseObject';*/
|
|
17326
|
+
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
17174
17327
|
var objectState = new _weakMap.default();
|
|
17175
17328
|
function getState(obj /*: ParseObject*/) /*: ?State*/{
|
|
17176
17329
|
var classData = objectState.get(obj);
|
|
@@ -17889,7 +18042,10 @@ var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
|
17889
18042
|
/**
|
|
17890
18043
|
* @flow
|
|
17891
18044
|
*/
|
|
17892
|
-
|
|
18045
|
+
/*:: type EncounterMap = {
|
|
18046
|
+
objects: { [identifier: string]: ParseObject | boolean },
|
|
18047
|
+
files: Array<ParseFile>,
|
|
18048
|
+
};*/
|
|
17893
18049
|
/**
|
|
17894
18050
|
* Return an array of unsaved children, which are either Parse Objects or Files.
|
|
17895
18051
|
* If it encounters any dirty Objects without Ids, it will throw an exception.
|