parse 4.1.0-alpha.4 → 4.1.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/dist/parse.js +58 -253
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +58 -253
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/AnonymousUtils.js +1 -1
- package/lib/browser/Cloud.js +2 -1
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/EventuallyQueue.js +1 -13
- package/lib/browser/LiveQueryClient.js +4 -8
- package/lib/browser/LocalDatastore.js +1 -3
- package/lib/browser/LocalDatastoreController.js +1 -3
- package/lib/browser/ObjectStateMutations.js +1 -14
- package/lib/browser/ParseACL.js +1 -2
- package/lib/browser/ParseCLP.js +1 -6
- package/lib/browser/ParseConfig.js +0 -1
- package/lib/browser/ParseFile.js +1 -5
- package/lib/browser/ParseInstallation.js +1 -4
- package/lib/browser/ParseObject.js +7 -10
- package/lib/browser/ParseOp.js +1 -3
- package/lib/browser/ParseQuery.js +24 -79
- package/lib/browser/ParseRole.js +1 -5
- package/lib/browser/ParseSchema.js +1 -1
- package/lib/browser/ParseSession.js +1 -5
- package/lib/browser/ParseUser.js +1 -42
- package/lib/browser/Push.js +2 -8
- package/lib/browser/RESTController.js +0 -20
- package/lib/browser/SingleInstanceStateController.js +1 -6
- package/lib/browser/TaskQueue.js +0 -4
- package/lib/browser/UniqueInstanceStateController.js +1 -3
- package/lib/browser/unsavedChildren.js +1 -4
- package/lib/node/AnonymousUtils.js +1 -1
- package/lib/node/Cloud.js +2 -1
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/EventuallyQueue.js +1 -13
- package/lib/node/LiveQueryClient.js +2 -5
- package/lib/node/LocalDatastore.js +1 -1
- package/lib/node/ObjectStateMutations.js +1 -11
- package/lib/node/ParseACL.js +1 -2
- package/lib/node/ParseCLP.js +1 -3
- package/lib/node/ParseConfig.js +2 -1
- package/lib/node/ParseFile.js +1 -2
- package/lib/node/ParseInstallation.js +1 -1
- package/lib/node/ParseObject.js +1 -2
- package/lib/node/ParseQuery.js +1 -50
- package/lib/node/ParseRole.js +1 -2
- package/lib/node/ParseSchema.js +1 -1
- package/lib/node/ParseSession.js +1 -2
- package/lib/node/ParseUser.js +1 -37
- package/lib/node/Push.js +2 -8
- package/lib/node/RESTController.js +0 -20
- package/lib/node/SingleInstanceStateController.js +1 -6
- package/lib/node/TaskQueue.js +1 -4
- package/lib/node/UniqueInstanceStateController.js +1 -3
- package/lib/node/unsavedChildren.js +1 -4
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +3 -7
- package/lib/react-native/ParseCLP.js +2 -2
- package/lib/react-native/ParseFile.js +0 -1
- package/lib/react-native/ParseQuery.js +11 -34
- package/lib/react-native/ParseUser.js +0 -25
- package/lib/weapp/AnonymousUtils.js +1 -1
- package/lib/weapp/Cloud.js +2 -1
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/EventuallyQueue.js +1 -13
- package/lib/weapp/LiveQueryClient.js +4 -8
- package/lib/weapp/LocalDatastore.js +1 -3
- package/lib/weapp/LocalDatastoreController.js +1 -3
- package/lib/weapp/ObjectStateMutations.js +1 -14
- package/lib/weapp/ParseACL.js +1 -2
- package/lib/weapp/ParseCLP.js +1 -6
- package/lib/weapp/ParseConfig.js +0 -1
- package/lib/weapp/ParseFile.js +1 -5
- package/lib/weapp/ParseInstallation.js +1 -4
- package/lib/weapp/ParseObject.js +7 -10
- package/lib/weapp/ParseOp.js +1 -3
- package/lib/weapp/ParseQuery.js +24 -79
- package/lib/weapp/ParseRole.js +1 -5
- package/lib/weapp/ParseSchema.js +1 -1
- package/lib/weapp/ParseSession.js +1 -5
- package/lib/weapp/ParseUser.js +1 -42
- package/lib/weapp/Push.js +2 -8
- package/lib/weapp/RESTController.js +0 -20
- package/lib/weapp/SingleInstanceStateController.js +1 -6
- package/lib/weapp/TaskQueue.js +0 -4
- package/lib/weapp/UniqueInstanceStateController.js +1 -3
- package/lib/weapp/unsavedChildren.js +1 -4
- package/package.json +18 -18
package/dist/parse.weapp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Parse JavaScript SDK v4.1.0
|
|
2
|
+
* Parse JavaScript SDK v4.1.0
|
|
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
|
+
|
|
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
|
+
|
|
233
233
|
/**
|
|
234
234
|
* Contains functions for calling and declaring
|
|
235
235
|
* <a href="/docs/cloud_code_guide#functions">cloud functions</a>.
|
|
@@ -241,6 +241,7 @@ var _ParseObject = _interopRequireDefault(_dereq_("./ParseObject"));
|
|
|
241
241
|
* @static
|
|
242
242
|
* @hideconstructor
|
|
243
243
|
*/
|
|
244
|
+
|
|
244
245
|
/**
|
|
245
246
|
* Makes a call to a cloud function.
|
|
246
247
|
*
|
|
@@ -530,7 +531,7 @@ var config /*: Config & { [key: string]: mixed }*/ = {
|
|
|
530
531
|
SERVER_AUTH_TOKEN: null,
|
|
531
532
|
LIVEQUERY_SERVER_URL: null,
|
|
532
533
|
ENCRYPTED_KEY: null,
|
|
533
|
-
VERSION: 'js' + "4.1.0
|
|
534
|
+
VERSION: 'js' + "4.1.0",
|
|
534
535
|
APPLICATION_ID: null,
|
|
535
536
|
JAVASCRIPT_KEY: null,
|
|
536
537
|
MASTER_KEY: null,
|
|
@@ -759,19 +760,7 @@ var _Storage = _interopRequireDefault(_dereq_("./Storage"));
|
|
|
759
760
|
*
|
|
760
761
|
* @flow
|
|
761
762
|
*/
|
|
762
|
-
|
|
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>;*/
|
|
763
|
+
|
|
775
764
|
var QUEUE_KEY = 'Parse/Eventually/Queue';
|
|
776
765
|
var queueCache = [];
|
|
777
766
|
var dirtyCache = true;
|
|
@@ -1684,7 +1673,7 @@ function _isNativeReflectConstruct() {
|
|
|
1684
1673
|
} catch (e) {
|
|
1685
1674
|
return false;
|
|
1686
1675
|
}
|
|
1687
|
-
}
|
|
1676
|
+
}
|
|
1688
1677
|
// The LiveQuery client inner state
|
|
1689
1678
|
var CLIENT_STATE = {
|
|
1690
1679
|
INITIALIZED: 'initialized',
|
|
@@ -1864,25 +1853,21 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
1864
1853
|
}, {
|
|
1865
1854
|
key: "subscribe",
|
|
1866
1855
|
value: function (query /*: Object*/, sessionToken /*: ?string*/) /*: LiveQuerySubscription*/{
|
|
1867
|
-
var
|
|
1868
|
-
_queryJSON$watch,
|
|
1869
|
-
_this2 = this;
|
|
1856
|
+
var _this2 = this;
|
|
1870
1857
|
if (!query) {
|
|
1871
1858
|
return;
|
|
1872
1859
|
}
|
|
1873
1860
|
var className = query.className;
|
|
1874
1861
|
var queryJSON = query.toJSON();
|
|
1875
1862
|
var where = queryJSON.where;
|
|
1876
|
-
var fields = (
|
|
1877
|
-
var watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
|
|
1863
|
+
var fields = (0, _keys.default)(queryJSON) ? (0, _keys.default)(queryJSON).split(',') : undefined;
|
|
1878
1864
|
var subscribeRequest = {
|
|
1879
1865
|
op: OP_TYPES.SUBSCRIBE,
|
|
1880
1866
|
requestId: this.requestId,
|
|
1881
1867
|
query: {
|
|
1882
1868
|
className: className,
|
|
1883
1869
|
where: where,
|
|
1884
|
-
fields: fields
|
|
1885
|
-
watch: watch
|
|
1870
|
+
fields: fields
|
|
1886
1871
|
}
|
|
1887
1872
|
};
|
|
1888
1873
|
if (sessionToken) {
|
|
@@ -2487,9 +2472,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
2487
2472
|
if (len == null || len > arr.length) len = arr.length;
|
|
2488
2473
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
2489
2474
|
return arr2;
|
|
2490
|
-
}
|
|
2491
|
-
* @flow
|
|
2492
|
-
*/ /*:: import type ParseObject from './ParseObject';*/
|
|
2475
|
+
}
|
|
2493
2476
|
/**
|
|
2494
2477
|
* Provides a local datastore which can be used to store and retrieve <code>Parse.Object</code>. <br />
|
|
2495
2478
|
* To enable this functionality, call <code>Parse.enableLocalDatastore()</code>.
|
|
@@ -3180,9 +3163,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
3180
3163
|
if (len == null || len > arr.length) len = arr.length;
|
|
3181
3164
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
3182
3165
|
return arr2;
|
|
3183
|
-
}
|
|
3184
|
-
* @flow
|
|
3185
|
-
*/
|
|
3166
|
+
}
|
|
3186
3167
|
var LocalDatastoreController = {
|
|
3187
3168
|
fromPinWithName: function (name /*: string*/) /*: Array<Object>*/{
|
|
3188
3169
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -3428,20 +3409,7 @@ function _objectSpread(target) {
|
|
|
3428
3409
|
});
|
|
3429
3410
|
}
|
|
3430
3411
|
return target;
|
|
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
|
-
};*/
|
|
3412
|
+
}
|
|
3445
3413
|
function defaultState() /*: State*/{
|
|
3446
3414
|
return {
|
|
3447
3415
|
serverData: {},
|
|
@@ -4592,8 +4560,7 @@ var _ParseUser = _interopRequireDefault(_dereq_("./ParseUser"));
|
|
|
4592
4560
|
/**
|
|
4593
4561
|
* @flow
|
|
4594
4562
|
*/
|
|
4595
|
-
|
|
4596
|
-
/*:: type ByIdMap = { [userId: string]: PermissionsMap };*/
|
|
4563
|
+
|
|
4597
4564
|
var PUBLIC_KEY = '*';
|
|
4598
4565
|
|
|
4599
4566
|
/**
|
|
@@ -5057,12 +5024,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
5057
5024
|
if (len == null || len > arr.length) len = arr.length;
|
|
5058
5025
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
5059
5026
|
return arr2;
|
|
5060
|
-
}
|
|
5061
|
-
* @flow
|
|
5062
|
-
*/
|
|
5063
|
-
/*:: type Entity = Entity;*/
|
|
5064
|
-
/*:: type UsersMap = { [userId: string]: boolean | any };*/
|
|
5065
|
-
/*:: export type PermissionsMap = { [permission: string]: UsersMap };*/
|
|
5027
|
+
}
|
|
5066
5028
|
var PUBLIC_KEY = '*';
|
|
5067
5029
|
var VALID_PERMISSIONS /*: Map<string, UsersMap>*/ = new _map.default(
|
|
5068
5030
|
/*:: <string, UsersMap>*/
|
|
@@ -5744,7 +5706,6 @@ var _Storage = _interopRequireDefault(_dereq_("./Storage"));
|
|
|
5744
5706
|
/**
|
|
5745
5707
|
* @flow
|
|
5746
5708
|
*/
|
|
5747
|
-
/*:: import type { RequestOptions } from './RESTController';*/
|
|
5748
5709
|
/**
|
|
5749
5710
|
* Parse.Config is a local representation of configuration data that
|
|
5750
5711
|
* can be set from the Parse dashboard.
|
|
@@ -6596,10 +6557,7 @@ function _objectSpread(target) {
|
|
|
6596
6557
|
});
|
|
6597
6558
|
}
|
|
6598
6559
|
return target;
|
|
6599
|
-
}
|
|
6600
|
-
* @flow
|
|
6601
|
-
*/ /* global XMLHttpRequest, Blob */
|
|
6602
|
-
/*:: import type { FullOptions } from './RESTController';*/
|
|
6560
|
+
}
|
|
6603
6561
|
var ParseError = _dereq_('./ParseError').default;
|
|
6604
6562
|
var XHR = null;
|
|
6605
6563
|
if (typeof XMLHttpRequest !== 'undefined') {
|
|
@@ -6922,7 +6880,6 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
6922
6880
|
key: "cancel",
|
|
6923
6881
|
value: function () {
|
|
6924
6882
|
if (this._requestTask && typeof this._requestTask.abort === 'function') {
|
|
6925
|
-
this._requestTask._aborted = true;
|
|
6926
6883
|
this._requestTask.abort();
|
|
6927
6884
|
}
|
|
6928
6885
|
this._requestTask = null;
|
|
@@ -7453,10 +7410,7 @@ function _isNativeReflectConstruct() {
|
|
|
7453
7410
|
} catch (e) {
|
|
7454
7411
|
return false;
|
|
7455
7412
|
}
|
|
7456
|
-
}
|
|
7457
|
-
* @flow
|
|
7458
|
-
*/
|
|
7459
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
7413
|
+
}
|
|
7460
7414
|
var Installation = /*#__PURE__*/function (_ParseObject) {
|
|
7461
7415
|
(0, _inherits2.default)(Installation, _ParseObject);
|
|
7462
7416
|
var _super = _createSuper(Installation);
|
|
@@ -7838,11 +7792,7 @@ function _objectSpread(target) {
|
|
|
7838
7792
|
});
|
|
7839
7793
|
}
|
|
7840
7794
|
return target;
|
|
7841
|
-
}
|
|
7842
|
-
* @flow
|
|
7843
|
-
*/
|
|
7844
|
-
/*:: import type { AttributeMap, OpsMap } from './ObjectStateMutations';*/
|
|
7845
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
7795
|
+
}
|
|
7846
7796
|
var uuidv4 = _dereq_('./uuid');
|
|
7847
7797
|
/*:: export type Pointer = {
|
|
7848
7798
|
__type: string,
|
|
@@ -7908,11 +7858,6 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
7908
7858
|
*/
|
|
7909
7859
|
function ParseObject(className /*: ?string | { className: string, [attr: string]: mixed }*/, attributes /*:: ?: { [attr: string]: mixed }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
|
|
7910
7860
|
(0, _classCallCheck2.default)(this, ParseObject);
|
|
7911
|
-
/**
|
|
7912
|
-
* The ID of this object, unique within its class.
|
|
7913
|
-
*
|
|
7914
|
-
* @property {string} id
|
|
7915
|
-
*/
|
|
7916
7861
|
(0, _defineProperty2.default)(this, "id", void 0);
|
|
7917
7862
|
(0, _defineProperty2.default)(this, "_localId", void 0);
|
|
7918
7863
|
(0, _defineProperty2.default)(this, "_objCount", void 0);
|
|
@@ -7944,6 +7889,12 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
7944
7889
|
throw new Error("Can't create an invalid Parse Object");
|
|
7945
7890
|
}
|
|
7946
7891
|
}
|
|
7892
|
+
|
|
7893
|
+
/**
|
|
7894
|
+
* The ID of this object, unique within its class.
|
|
7895
|
+
*
|
|
7896
|
+
* @property {string} id
|
|
7897
|
+
*/
|
|
7947
7898
|
(0, _createClass2.default)(ParseObject, [{
|
|
7948
7899
|
key: "attributes",
|
|
7949
7900
|
get: /* Prototype getters / setters */
|
|
@@ -10749,9 +10700,7 @@ function _isNativeReflectConstruct() {
|
|
|
10749
10700
|
} catch (e) {
|
|
10750
10701
|
return false;
|
|
10751
10702
|
}
|
|
10752
|
-
}
|
|
10753
|
-
* @flow
|
|
10754
|
-
*/
|
|
10703
|
+
}
|
|
10755
10704
|
function opFromJSON(json /*: { [key: string]: any }*/) /*: ?Op*/{
|
|
10756
10705
|
if (!json || !json.__op) {
|
|
10757
10706
|
return null;
|
|
@@ -11498,29 +11447,7 @@ var _LocalDatastoreUtils = _dereq_("./LocalDatastoreUtils");
|
|
|
11498
11447
|
/*
|
|
11499
11448
|
* @flow
|
|
11500
11449
|
*/
|
|
11501
|
-
|
|
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
|
-
};*/
|
|
11450
|
+
|
|
11524
11451
|
/**
|
|
11525
11452
|
* Converts a string into a regex that matches it.
|
|
11526
11453
|
* Surrounding with \Q .. \E does this, we just need to escape any \E's in
|
|
@@ -11695,17 +11622,17 @@ function handleOfflineSort(a, b, sorts) {
|
|
|
11695
11622
|
* @alias Parse.Query
|
|
11696
11623
|
*/
|
|
11697
11624
|
var ParseQuery = /*#__PURE__*/function () {
|
|
11625
|
+
/**
|
|
11626
|
+
* @property {string} className
|
|
11627
|
+
*/
|
|
11628
|
+
|
|
11698
11629
|
/**
|
|
11699
11630
|
* @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string.
|
|
11700
11631
|
*/
|
|
11701
11632
|
function ParseQuery(objectClass /*: string | ParseObject*/) {
|
|
11702
11633
|
(0, _classCallCheck2.default)(this, ParseQuery);
|
|
11703
|
-
/**
|
|
11704
|
-
* @property {string} className
|
|
11705
|
-
*/
|
|
11706
11634
|
(0, _defineProperty2.default)(this, "className", void 0);
|
|
11707
11635
|
(0, _defineProperty2.default)(this, "_where", void 0);
|
|
11708
|
-
(0, _defineProperty2.default)(this, "_watch", void 0);
|
|
11709
11636
|
(0, _defineProperty2.default)(this, "_include", void 0);
|
|
11710
11637
|
(0, _defineProperty2.default)(this, "_exclude", void 0);
|
|
11711
11638
|
(0, _defineProperty2.default)(this, "_select", void 0);
|
|
@@ -11741,7 +11668,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
11741
11668
|
throw new TypeError('A ParseQuery must be constructed with a ParseObject or class name.');
|
|
11742
11669
|
}
|
|
11743
11670
|
this._where = {};
|
|
11744
|
-
this._watch = [];
|
|
11745
11671
|
this._include = [];
|
|
11746
11672
|
this._exclude = [];
|
|
11747
11673
|
this._count = false;
|
|
@@ -11934,9 +11860,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
11934
11860
|
var params /*: QueryJSON*/ = {
|
|
11935
11861
|
where: this._where
|
|
11936
11862
|
};
|
|
11937
|
-
if (this._watch.length) {
|
|
11938
|
-
params.watch = this._watch.join(',');
|
|
11939
|
-
}
|
|
11940
11863
|
if (this._include.length) {
|
|
11941
11864
|
params.include = this._include.join(',');
|
|
11942
11865
|
}
|
|
@@ -12006,9 +11929,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
12006
11929
|
if (json.where) {
|
|
12007
11930
|
this._where = json.where;
|
|
12008
11931
|
}
|
|
12009
|
-
if (json.watch) {
|
|
12010
|
-
this._watch = json.watch.split(',');
|
|
12011
|
-
}
|
|
12012
11932
|
if (json.include) {
|
|
12013
11933
|
this._include = json.include.split(',');
|
|
12014
11934
|
}
|
|
@@ -13598,32 +13518,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13598
13518
|
return this;
|
|
13599
13519
|
}
|
|
13600
13520
|
|
|
13601
|
-
/**
|
|
13602
|
-
* Restricts live query to trigger only for watched fields.
|
|
13603
|
-
*
|
|
13604
|
-
* Requires Parse Server 6.0.0+
|
|
13605
|
-
*
|
|
13606
|
-
* @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
|
|
13607
|
-
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
13608
|
-
*/
|
|
13609
|
-
}, {
|
|
13610
|
-
key: "watch",
|
|
13611
|
-
value: function () /*: ParseQuery*/{
|
|
13612
|
-
var _this14 = this;
|
|
13613
|
-
for (var _len8 = arguments.length, keys = new Array(_len8), _key12 = 0; _key12 < _len8; _key12++) {
|
|
13614
|
-
keys[_key12] = arguments[_key12];
|
|
13615
|
-
}
|
|
13616
|
-
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
13617
|
-
if ((0, _isArray.default)(key)) {
|
|
13618
|
-
var _context22;
|
|
13619
|
-
_this14._watch = (0, _concat.default)(_context22 = _this14._watch).call(_context22, key);
|
|
13620
|
-
} else {
|
|
13621
|
-
_this14._watch.push(key);
|
|
13622
|
-
}
|
|
13623
|
-
});
|
|
13624
|
-
return this;
|
|
13625
|
-
}
|
|
13626
|
-
|
|
13627
13521
|
/**
|
|
13628
13522
|
* Changes the read preference that the backend will use when performing the query to the database.
|
|
13629
13523
|
*
|
|
@@ -13653,30 +13547,30 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13653
13547
|
value: function () {
|
|
13654
13548
|
var _subscribe = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(sessionToken /*:: ?: string*/) {
|
|
13655
13549
|
var currentUser, liveQueryClient, subscription;
|
|
13656
|
-
return _regenerator.default.wrap(function (
|
|
13657
|
-
while (1) switch (
|
|
13550
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
13551
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
13658
13552
|
case 0:
|
|
13659
|
-
|
|
13553
|
+
_context22.next = 2;
|
|
13660
13554
|
return _CoreManager.default.getUserController().currentUserAsync();
|
|
13661
13555
|
case 2:
|
|
13662
|
-
currentUser =
|
|
13556
|
+
currentUser = _context22.sent;
|
|
13663
13557
|
if (!sessionToken) {
|
|
13664
13558
|
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
13665
13559
|
}
|
|
13666
|
-
|
|
13560
|
+
_context22.next = 6;
|
|
13667
13561
|
return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient();
|
|
13668
13562
|
case 6:
|
|
13669
|
-
liveQueryClient =
|
|
13563
|
+
liveQueryClient = _context22.sent;
|
|
13670
13564
|
if (liveQueryClient.shouldOpen()) {
|
|
13671
13565
|
liveQueryClient.open();
|
|
13672
13566
|
}
|
|
13673
13567
|
subscription = liveQueryClient.subscribe(this, sessionToken);
|
|
13674
|
-
return
|
|
13568
|
+
return _context22.abrupt("return", subscription.subscribePromise.then(function () {
|
|
13675
13569
|
return subscription;
|
|
13676
13570
|
}));
|
|
13677
13571
|
case 10:
|
|
13678
13572
|
case "end":
|
|
13679
|
-
return
|
|
13573
|
+
return _context22.stop();
|
|
13680
13574
|
}
|
|
13681
13575
|
}, _callee7, this);
|
|
13682
13576
|
}));
|
|
@@ -13758,7 +13652,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13758
13652
|
}, {
|
|
13759
13653
|
key: "cancel",
|
|
13760
13654
|
value: function () /*: ParseQuery*/{
|
|
13761
|
-
var
|
|
13655
|
+
var _this14 = this;
|
|
13762
13656
|
if (this._xhrRequest.task && typeof this._xhrRequest.task.abort === 'function') {
|
|
13763
13657
|
this._xhrRequest.task._aborted = true;
|
|
13764
13658
|
this._xhrRequest.task.abort();
|
|
@@ -13767,16 +13661,16 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13767
13661
|
return this;
|
|
13768
13662
|
}
|
|
13769
13663
|
return this._xhrRequest.onchange = function () {
|
|
13770
|
-
return
|
|
13664
|
+
return _this14.cancel();
|
|
13771
13665
|
};
|
|
13772
13666
|
}
|
|
13773
13667
|
}, {
|
|
13774
13668
|
key: "_setRequestTask",
|
|
13775
13669
|
value: function (options) {
|
|
13776
|
-
var
|
|
13670
|
+
var _this15 = this;
|
|
13777
13671
|
options.requestTask = function (task) {
|
|
13778
|
-
|
|
13779
|
-
|
|
13672
|
+
_this15._xhrRequest.task = task;
|
|
13673
|
+
_this15._xhrRequest.onchange();
|
|
13780
13674
|
};
|
|
13781
13675
|
}
|
|
13782
13676
|
}], [{
|
|
@@ -13788,8 +13682,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13788
13682
|
}, {
|
|
13789
13683
|
key: "or",
|
|
13790
13684
|
value: function () /*: ParseQuery*/{
|
|
13791
|
-
for (var
|
|
13792
|
-
queries[
|
|
13685
|
+
for (var _len8 = arguments.length, queries = new Array(_len8), _key12 = 0; _key12 < _len8; _key12++) {
|
|
13686
|
+
queries[_key12] = arguments[_key12];
|
|
13793
13687
|
}
|
|
13794
13688
|
var className = _getClassNameFromQueries(queries);
|
|
13795
13689
|
var query = new ParseQuery(className);
|
|
@@ -13812,8 +13706,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13812
13706
|
}, {
|
|
13813
13707
|
key: "and",
|
|
13814
13708
|
value: function () /*: ParseQuery*/{
|
|
13815
|
-
for (var
|
|
13816
|
-
queries[
|
|
13709
|
+
for (var _len9 = arguments.length, queries = new Array(_len9), _key13 = 0; _key13 < _len9; _key13++) {
|
|
13710
|
+
queries[_key13] = arguments[_key13];
|
|
13817
13711
|
}
|
|
13818
13712
|
var className = _getClassNameFromQueries(queries);
|
|
13819
13713
|
var query = new ParseQuery(className);
|
|
@@ -13836,8 +13730,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13836
13730
|
}, {
|
|
13837
13731
|
key: "nor",
|
|
13838
13732
|
value: function () /*: ParseQuery*/{
|
|
13839
|
-
for (var
|
|
13840
|
-
queries[
|
|
13733
|
+
for (var _len10 = arguments.length, queries = new Array(_len10), _key14 = 0; _key14 < _len10; _key14++) {
|
|
13734
|
+
queries[_key14] = arguments[_key14];
|
|
13841
13735
|
}
|
|
13842
13736
|
var className = _getClassNameFromQueries(queries);
|
|
13843
13737
|
var query = new ParseQuery(className);
|
|
@@ -14070,11 +13964,7 @@ function _isNativeReflectConstruct() {
|
|
|
14070
13964
|
} catch (e) {
|
|
14071
13965
|
return false;
|
|
14072
13966
|
}
|
|
14073
|
-
}
|
|
14074
|
-
* @flow
|
|
14075
|
-
*/
|
|
14076
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14077
|
-
/*:: import type ParseRelation from './ParseRelation';*/
|
|
13967
|
+
}
|
|
14078
13968
|
/**
|
|
14079
13969
|
* Represents a Role on the Parse server. Roles represent groupings of
|
|
14080
13970
|
* Users for the purposes of granting permissions (e.g. specifying an ACL
|
|
@@ -14238,7 +14128,7 @@ var _ParseCLP = _interopRequireDefault(_dereq_("./ParseCLP"));
|
|
|
14238
14128
|
/**
|
|
14239
14129
|
* @flow
|
|
14240
14130
|
*/
|
|
14241
|
-
|
|
14131
|
+
|
|
14242
14132
|
var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
|
|
14243
14133
|
/*:: type FieldOptions = {
|
|
14244
14134
|
required: boolean,
|
|
@@ -14779,11 +14669,7 @@ function _isNativeReflectConstruct() {
|
|
|
14779
14669
|
} catch (e) {
|
|
14780
14670
|
return false;
|
|
14781
14671
|
}
|
|
14782
|
-
}
|
|
14783
|
-
* @flow
|
|
14784
|
-
*/
|
|
14785
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14786
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
14672
|
+
}
|
|
14787
14673
|
/**
|
|
14788
14674
|
* <p>A Parse.Session object is a local representation of a revocable session.
|
|
14789
14675
|
* This class is a subclass of a Parse.Object, and retains the same
|
|
@@ -14946,12 +14832,7 @@ function _isNativeReflectConstruct() {
|
|
|
14946
14832
|
} catch (e) {
|
|
14947
14833
|
return false;
|
|
14948
14834
|
}
|
|
14949
|
-
}
|
|
14950
|
-
* @flow
|
|
14951
|
-
*/
|
|
14952
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14953
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
14954
|
-
/*:: export type AuthData = ?{ [key: string]: mixed };*/
|
|
14835
|
+
}
|
|
14955
14836
|
var CURRENT_USER_KEY = 'currentUser';
|
|
14956
14837
|
var canUseCurrentUser = !_CoreManager.default.get('IS_NODE');
|
|
14957
14838
|
var currentUserCacheMatchesDisk = false;
|
|
@@ -15777,27 +15658,6 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
|
|
|
15777
15658
|
return user.logIn(options);
|
|
15778
15659
|
}
|
|
15779
15660
|
|
|
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
|
-
|
|
15801
15661
|
/**
|
|
15802
15662
|
* Logs in a user with a session token. On success, this saves the session
|
|
15803
15663
|
* to disk, so you can retrieve the currently logged in user using
|
|
@@ -16242,21 +16102,6 @@ var DefaultController = {
|
|
|
16242
16102
|
return DefaultController.setCurrentUser(user);
|
|
16243
16103
|
});
|
|
16244
16104
|
},
|
|
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
|
-
},
|
|
16260
16105
|
become: function (user /*: ParseUser*/, options /*: RequestOptions*/) /*: Promise<ParseUser>*/{
|
|
16261
16106
|
var RESTController = _CoreManager.default.getRESTController();
|
|
16262
16107
|
return RESTController.request('GET', 'users/me', {}, options).then(function (response) {
|
|
@@ -16400,14 +16245,7 @@ var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
|
16400
16245
|
/**
|
|
16401
16246
|
* @flow
|
|
16402
16247
|
*/
|
|
16403
|
-
|
|
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
|
-
};*/
|
|
16248
|
+
|
|
16411
16249
|
/**
|
|
16412
16250
|
* Contains functions to deal with Push in Parse.
|
|
16413
16251
|
*
|
|
@@ -16415,6 +16253,7 @@ var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
|
16415
16253
|
* @static
|
|
16416
16254
|
* @hideconstructor
|
|
16417
16255
|
*/
|
|
16256
|
+
|
|
16418
16257
|
/**
|
|
16419
16258
|
* Sends a push notification.
|
|
16420
16259
|
* **Available in Cloud Code only.**
|
|
@@ -16545,26 +16384,6 @@ function _objectSpread(target) {
|
|
|
16545
16384
|
*/
|
|
16546
16385
|
/* global XMLHttpRequest, XDomainRequest */
|
|
16547
16386
|
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
|
-
};*/
|
|
16568
16387
|
var XHR = null;
|
|
16569
16388
|
if (typeof XMLHttpRequest !== 'undefined') {
|
|
16570
16389
|
XHR = XMLHttpRequest;
|
|
@@ -16911,12 +16730,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
16911
16730
|
/**
|
|
16912
16731
|
* @flow
|
|
16913
16732
|
*/
|
|
16914
|
-
|
|
16915
|
-
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
16916
|
-
/*:: type ObjectIdentifier = {
|
|
16917
|
-
className: string,
|
|
16918
|
-
id: string,
|
|
16919
|
-
};*/
|
|
16733
|
+
|
|
16920
16734
|
var objectState
|
|
16921
16735
|
/*: {
|
|
16922
16736
|
[className: string]: {
|
|
@@ -17199,10 +17013,6 @@ var _promiseUtils = _dereq_("./promiseUtils");
|
|
|
17199
17013
|
/**
|
|
17200
17014
|
* @flow
|
|
17201
17015
|
*/
|
|
17202
|
-
/*:: type Task = {
|
|
17203
|
-
task: () => Promise,
|
|
17204
|
-
_completion: Promise,
|
|
17205
|
-
};*/
|
|
17206
17016
|
var TaskQueue = /*#__PURE__*/function () {
|
|
17207
17017
|
function TaskQueue() {
|
|
17208
17018
|
(0, _classCallCheck2.default)(this, TaskQueue);
|
|
@@ -17321,9 +17131,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
17321
17131
|
/**
|
|
17322
17132
|
* @flow
|
|
17323
17133
|
*/
|
|
17324
|
-
|
|
17325
|
-
/*:: import type ParseObject from './ParseObject';*/
|
|
17326
|
-
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
17134
|
+
|
|
17327
17135
|
var objectState = new _weakMap.default();
|
|
17328
17136
|
function getState(obj /*: ParseObject*/) /*: ?State*/{
|
|
17329
17137
|
var classData = objectState.get(obj);
|
|
@@ -18042,10 +17850,7 @@ var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
|
18042
17850
|
/**
|
|
18043
17851
|
* @flow
|
|
18044
17852
|
*/
|
|
18045
|
-
|
|
18046
|
-
objects: { [identifier: string]: ParseObject | boolean },
|
|
18047
|
-
files: Array<ParseFile>,
|
|
18048
|
-
};*/
|
|
17853
|
+
|
|
18049
17854
|
/**
|
|
18050
17855
|
* Return an array of unsaved children, which are either Parse Objects or Files.
|
|
18051
17856
|
* If it encounters any dirty Objects without Ids, it will throw an exception.
|