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.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;
|
|
@@ -1719,7 +1708,7 @@ function _isNativeReflectConstruct() {
|
|
|
1719
1708
|
} catch (e) {
|
|
1720
1709
|
return false;
|
|
1721
1710
|
}
|
|
1722
|
-
}
|
|
1711
|
+
}
|
|
1723
1712
|
// The LiveQuery client inner state
|
|
1724
1713
|
var CLIENT_STATE = {
|
|
1725
1714
|
INITIALIZED: 'initialized',
|
|
@@ -1899,25 +1888,21 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
1899
1888
|
}, {
|
|
1900
1889
|
key: "subscribe",
|
|
1901
1890
|
value: function (query /*: Object*/, sessionToken /*: ?string*/) /*: LiveQuerySubscription*/{
|
|
1902
|
-
var
|
|
1903
|
-
_queryJSON$watch,
|
|
1904
|
-
_this2 = this;
|
|
1891
|
+
var _this2 = this;
|
|
1905
1892
|
if (!query) {
|
|
1906
1893
|
return;
|
|
1907
1894
|
}
|
|
1908
1895
|
var className = query.className;
|
|
1909
1896
|
var queryJSON = query.toJSON();
|
|
1910
1897
|
var where = queryJSON.where;
|
|
1911
|
-
var fields = (
|
|
1912
|
-
var watch = (_queryJSON$watch = queryJSON.watch) === null || _queryJSON$watch === void 0 ? void 0 : _queryJSON$watch.split(',');
|
|
1898
|
+
var fields = (0, _keys.default)(queryJSON) ? (0, _keys.default)(queryJSON).split(',') : undefined;
|
|
1913
1899
|
var subscribeRequest = {
|
|
1914
1900
|
op: OP_TYPES.SUBSCRIBE,
|
|
1915
1901
|
requestId: this.requestId,
|
|
1916
1902
|
query: {
|
|
1917
1903
|
className: className,
|
|
1918
1904
|
where: where,
|
|
1919
|
-
fields: fields
|
|
1920
|
-
watch: watch
|
|
1905
|
+
fields: fields
|
|
1921
1906
|
}
|
|
1922
1907
|
};
|
|
1923
1908
|
if (sessionToken) {
|
|
@@ -2522,9 +2507,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
2522
2507
|
if (len == null || len > arr.length) len = arr.length;
|
|
2523
2508
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
2524
2509
|
return arr2;
|
|
2525
|
-
}
|
|
2526
|
-
* @flow
|
|
2527
|
-
*/ /*:: import type ParseObject from './ParseObject';*/
|
|
2510
|
+
}
|
|
2528
2511
|
/**
|
|
2529
2512
|
* Provides a local datastore which can be used to store and retrieve <code>Parse.Object</code>. <br />
|
|
2530
2513
|
* To enable this functionality, call <code>Parse.enableLocalDatastore()</code>.
|
|
@@ -3215,9 +3198,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
3215
3198
|
if (len == null || len > arr.length) len = arr.length;
|
|
3216
3199
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
3217
3200
|
return arr2;
|
|
3218
|
-
}
|
|
3219
|
-
* @flow
|
|
3220
|
-
*/
|
|
3201
|
+
}
|
|
3221
3202
|
var LocalDatastoreController = {
|
|
3222
3203
|
fromPinWithName: function (name /*: string*/) /*: Array<Object>*/{
|
|
3223
3204
|
return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
@@ -3463,20 +3444,7 @@ function _objectSpread(target) {
|
|
|
3463
3444
|
});
|
|
3464
3445
|
}
|
|
3465
3446
|
return target;
|
|
3466
|
-
}
|
|
3467
|
-
* @flow
|
|
3468
|
-
*/
|
|
3469
|
-
/*:: import type { Op } from './ParseOp';*/
|
|
3470
|
-
/*:: export type AttributeMap = { [attr: string]: any };*/
|
|
3471
|
-
/*:: export type OpsMap = { [attr: string]: Op };*/
|
|
3472
|
-
/*:: export type ObjectCache = { [attr: string]: string };*/
|
|
3473
|
-
/*:: export type State = {
|
|
3474
|
-
serverData: AttributeMap,
|
|
3475
|
-
pendingOps: Array<OpsMap>,
|
|
3476
|
-
objectCache: ObjectCache,
|
|
3477
|
-
tasks: TaskQueue,
|
|
3478
|
-
existed: boolean,
|
|
3479
|
-
};*/
|
|
3447
|
+
}
|
|
3480
3448
|
function defaultState() /*: State*/{
|
|
3481
3449
|
return {
|
|
3482
3450
|
serverData: {},
|
|
@@ -4636,8 +4604,7 @@ var _ParseUser = _interopRequireDefault(_dereq_("./ParseUser"));
|
|
|
4636
4604
|
/**
|
|
4637
4605
|
* @flow
|
|
4638
4606
|
*/
|
|
4639
|
-
|
|
4640
|
-
/*:: type ByIdMap = { [userId: string]: PermissionsMap };*/
|
|
4607
|
+
|
|
4641
4608
|
var PUBLIC_KEY = '*';
|
|
4642
4609
|
|
|
4643
4610
|
/**
|
|
@@ -5101,12 +5068,7 @@ function _arrayLikeToArray(arr, len) {
|
|
|
5101
5068
|
if (len == null || len > arr.length) len = arr.length;
|
|
5102
5069
|
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
5103
5070
|
return arr2;
|
|
5104
|
-
}
|
|
5105
|
-
* @flow
|
|
5106
|
-
*/
|
|
5107
|
-
/*:: type Entity = Entity;*/
|
|
5108
|
-
/*:: type UsersMap = { [userId: string]: boolean | any };*/
|
|
5109
|
-
/*:: export type PermissionsMap = { [permission: string]: UsersMap };*/
|
|
5071
|
+
}
|
|
5110
5072
|
var PUBLIC_KEY = '*';
|
|
5111
5073
|
var VALID_PERMISSIONS /*: Map<string, UsersMap>*/ = new _map.default(
|
|
5112
5074
|
/*:: <string, UsersMap>*/
|
|
@@ -5788,7 +5750,6 @@ var _Storage = _interopRequireDefault(_dereq_("./Storage"));
|
|
|
5788
5750
|
/**
|
|
5789
5751
|
* @flow
|
|
5790
5752
|
*/
|
|
5791
|
-
/*:: import type { RequestOptions } from './RESTController';*/
|
|
5792
5753
|
/**
|
|
5793
5754
|
* Parse.Config is a local representation of configuration data that
|
|
5794
5755
|
* can be set from the Parse dashboard.
|
|
@@ -6640,10 +6601,7 @@ function _objectSpread(target) {
|
|
|
6640
6601
|
});
|
|
6641
6602
|
}
|
|
6642
6603
|
return target;
|
|
6643
|
-
}
|
|
6644
|
-
* @flow
|
|
6645
|
-
*/ /* global XMLHttpRequest, Blob */
|
|
6646
|
-
/*:: import type { FullOptions } from './RESTController';*/
|
|
6604
|
+
}
|
|
6647
6605
|
var ParseError = _dereq_('./ParseError').default;
|
|
6648
6606
|
var XHR = null;
|
|
6649
6607
|
if (typeof XMLHttpRequest !== 'undefined') {
|
|
@@ -6964,7 +6922,6 @@ var ParseFile = /*#__PURE__*/function () {
|
|
|
6964
6922
|
key: "cancel",
|
|
6965
6923
|
value: function () {
|
|
6966
6924
|
if (this._requestTask && typeof this._requestTask.abort === 'function') {
|
|
6967
|
-
this._requestTask._aborted = true;
|
|
6968
6925
|
this._requestTask.abort();
|
|
6969
6926
|
}
|
|
6970
6927
|
this._requestTask = null;
|
|
@@ -7495,10 +7452,7 @@ function _isNativeReflectConstruct() {
|
|
|
7495
7452
|
} catch (e) {
|
|
7496
7453
|
return false;
|
|
7497
7454
|
}
|
|
7498
|
-
}
|
|
7499
|
-
* @flow
|
|
7500
|
-
*/
|
|
7501
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
7455
|
+
}
|
|
7502
7456
|
var Installation = /*#__PURE__*/function (_ParseObject) {
|
|
7503
7457
|
(0, _inherits2.default)(Installation, _ParseObject);
|
|
7504
7458
|
var _super = _createSuper(Installation);
|
|
@@ -7880,11 +7834,7 @@ function _objectSpread(target) {
|
|
|
7880
7834
|
});
|
|
7881
7835
|
}
|
|
7882
7836
|
return target;
|
|
7883
|
-
}
|
|
7884
|
-
* @flow
|
|
7885
|
-
*/
|
|
7886
|
-
/*:: import type { AttributeMap, OpsMap } from './ObjectStateMutations';*/
|
|
7887
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
7837
|
+
}
|
|
7888
7838
|
var uuidv4 = _dereq_('./uuid');
|
|
7889
7839
|
/*:: export type Pointer = {
|
|
7890
7840
|
__type: string,
|
|
@@ -7950,11 +7900,6 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
7950
7900
|
*/
|
|
7951
7901
|
function ParseObject(className /*: ?string | { className: string, [attr: string]: mixed }*/, attributes /*:: ?: { [attr: string]: mixed }*/, options /*:: ?: { ignoreValidation: boolean }*/) {
|
|
7952
7902
|
(0, _classCallCheck2.default)(this, ParseObject);
|
|
7953
|
-
/**
|
|
7954
|
-
* The ID of this object, unique within its class.
|
|
7955
|
-
*
|
|
7956
|
-
* @property {string} id
|
|
7957
|
-
*/
|
|
7958
7903
|
(0, _defineProperty2.default)(this, "id", void 0);
|
|
7959
7904
|
(0, _defineProperty2.default)(this, "_localId", void 0);
|
|
7960
7905
|
(0, _defineProperty2.default)(this, "_objCount", void 0);
|
|
@@ -7986,6 +7931,12 @@ var ParseObject = /*#__PURE__*/function () {
|
|
|
7986
7931
|
throw new Error("Can't create an invalid Parse Object");
|
|
7987
7932
|
}
|
|
7988
7933
|
}
|
|
7934
|
+
|
|
7935
|
+
/**
|
|
7936
|
+
* The ID of this object, unique within its class.
|
|
7937
|
+
*
|
|
7938
|
+
* @property {string} id
|
|
7939
|
+
*/
|
|
7989
7940
|
(0, _createClass2.default)(ParseObject, [{
|
|
7990
7941
|
key: "attributes",
|
|
7991
7942
|
get: /* Prototype getters / setters */
|
|
@@ -10791,9 +10742,7 @@ function _isNativeReflectConstruct() {
|
|
|
10791
10742
|
} catch (e) {
|
|
10792
10743
|
return false;
|
|
10793
10744
|
}
|
|
10794
|
-
}
|
|
10795
|
-
* @flow
|
|
10796
|
-
*/
|
|
10745
|
+
}
|
|
10797
10746
|
function opFromJSON(json /*: { [key: string]: any }*/) /*: ?Op*/{
|
|
10798
10747
|
if (!json || !json.__op) {
|
|
10799
10748
|
return null;
|
|
@@ -11540,29 +11489,7 @@ var _LocalDatastoreUtils = _dereq_("./LocalDatastoreUtils");
|
|
|
11540
11489
|
/*
|
|
11541
11490
|
* @flow
|
|
11542
11491
|
*/
|
|
11543
|
-
|
|
11544
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
11545
|
-
/*:: type BatchOptions = FullOptions & { batchSize?: number };*/
|
|
11546
|
-
/*:: export type WhereClause = {
|
|
11547
|
-
[attr: string]: mixed,
|
|
11548
|
-
};*/
|
|
11549
|
-
/*:: export type QueryJSON = {
|
|
11550
|
-
where: WhereClause,
|
|
11551
|
-
watch?: string,
|
|
11552
|
-
include?: string,
|
|
11553
|
-
excludeKeys?: string,
|
|
11554
|
-
keys?: string,
|
|
11555
|
-
limit?: number,
|
|
11556
|
-
skip?: number,
|
|
11557
|
-
order?: string,
|
|
11558
|
-
className?: string,
|
|
11559
|
-
count?: number,
|
|
11560
|
-
hint?: mixed,
|
|
11561
|
-
explain?: boolean,
|
|
11562
|
-
readPreference?: string,
|
|
11563
|
-
includeReadPreference?: string,
|
|
11564
|
-
subqueryReadPreference?: string,
|
|
11565
|
-
};*/
|
|
11492
|
+
|
|
11566
11493
|
/**
|
|
11567
11494
|
* Converts a string into a regex that matches it.
|
|
11568
11495
|
* Surrounding with \Q .. \E does this, we just need to escape any \E's in
|
|
@@ -11737,17 +11664,17 @@ function handleOfflineSort(a, b, sorts) {
|
|
|
11737
11664
|
* @alias Parse.Query
|
|
11738
11665
|
*/
|
|
11739
11666
|
var ParseQuery = /*#__PURE__*/function () {
|
|
11667
|
+
/**
|
|
11668
|
+
* @property {string} className
|
|
11669
|
+
*/
|
|
11670
|
+
|
|
11740
11671
|
/**
|
|
11741
11672
|
* @param {(string | Parse.Object)} objectClass An instance of a subclass of Parse.Object, or a Parse className string.
|
|
11742
11673
|
*/
|
|
11743
11674
|
function ParseQuery(objectClass /*: string | ParseObject*/) {
|
|
11744
11675
|
(0, _classCallCheck2.default)(this, ParseQuery);
|
|
11745
|
-
/**
|
|
11746
|
-
* @property {string} className
|
|
11747
|
-
*/
|
|
11748
11676
|
(0, _defineProperty2.default)(this, "className", void 0);
|
|
11749
11677
|
(0, _defineProperty2.default)(this, "_where", void 0);
|
|
11750
|
-
(0, _defineProperty2.default)(this, "_watch", void 0);
|
|
11751
11678
|
(0, _defineProperty2.default)(this, "_include", void 0);
|
|
11752
11679
|
(0, _defineProperty2.default)(this, "_exclude", void 0);
|
|
11753
11680
|
(0, _defineProperty2.default)(this, "_select", void 0);
|
|
@@ -11783,7 +11710,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
11783
11710
|
throw new TypeError('A ParseQuery must be constructed with a ParseObject or class name.');
|
|
11784
11711
|
}
|
|
11785
11712
|
this._where = {};
|
|
11786
|
-
this._watch = [];
|
|
11787
11713
|
this._include = [];
|
|
11788
11714
|
this._exclude = [];
|
|
11789
11715
|
this._count = false;
|
|
@@ -11976,9 +11902,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
11976
11902
|
var params /*: QueryJSON*/ = {
|
|
11977
11903
|
where: this._where
|
|
11978
11904
|
};
|
|
11979
|
-
if (this._watch.length) {
|
|
11980
|
-
params.watch = this._watch.join(',');
|
|
11981
|
-
}
|
|
11982
11905
|
if (this._include.length) {
|
|
11983
11906
|
params.include = this._include.join(',');
|
|
11984
11907
|
}
|
|
@@ -12048,9 +11971,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
12048
11971
|
if (json.where) {
|
|
12049
11972
|
this._where = json.where;
|
|
12050
11973
|
}
|
|
12051
|
-
if (json.watch) {
|
|
12052
|
-
this._watch = json.watch.split(',');
|
|
12053
|
-
}
|
|
12054
11974
|
if (json.include) {
|
|
12055
11975
|
this._include = json.include.split(',');
|
|
12056
11976
|
}
|
|
@@ -13640,32 +13560,6 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13640
13560
|
return this;
|
|
13641
13561
|
}
|
|
13642
13562
|
|
|
13643
|
-
/**
|
|
13644
|
-
* Restricts live query to trigger only for watched fields.
|
|
13645
|
-
*
|
|
13646
|
-
* Requires Parse Server 6.0.0+
|
|
13647
|
-
*
|
|
13648
|
-
* @param {...string|Array<string>} keys The name(s) of the key(s) to watch.
|
|
13649
|
-
* @returns {Parse.Query} Returns the query, so you can chain this call.
|
|
13650
|
-
*/
|
|
13651
|
-
}, {
|
|
13652
|
-
key: "watch",
|
|
13653
|
-
value: function () /*: ParseQuery*/{
|
|
13654
|
-
var _this14 = this;
|
|
13655
|
-
for (var _len8 = arguments.length, keys = new Array(_len8), _key12 = 0; _key12 < _len8; _key12++) {
|
|
13656
|
-
keys[_key12] = arguments[_key12];
|
|
13657
|
-
}
|
|
13658
|
-
(0, _forEach.default)(keys).call(keys, function (key) {
|
|
13659
|
-
if ((0, _isArray.default)(key)) {
|
|
13660
|
-
var _context22;
|
|
13661
|
-
_this14._watch = (0, _concat.default)(_context22 = _this14._watch).call(_context22, key);
|
|
13662
|
-
} else {
|
|
13663
|
-
_this14._watch.push(key);
|
|
13664
|
-
}
|
|
13665
|
-
});
|
|
13666
|
-
return this;
|
|
13667
|
-
}
|
|
13668
|
-
|
|
13669
13563
|
/**
|
|
13670
13564
|
* Changes the read preference that the backend will use when performing the query to the database.
|
|
13671
13565
|
*
|
|
@@ -13695,30 +13589,30 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13695
13589
|
value: function () {
|
|
13696
13590
|
var _subscribe = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(sessionToken /*:: ?: string*/) {
|
|
13697
13591
|
var currentUser, liveQueryClient, subscription;
|
|
13698
|
-
return _regenerator.default.wrap(function (
|
|
13699
|
-
while (1) switch (
|
|
13592
|
+
return _regenerator.default.wrap(function (_context22) {
|
|
13593
|
+
while (1) switch (_context22.prev = _context22.next) {
|
|
13700
13594
|
case 0:
|
|
13701
|
-
|
|
13595
|
+
_context22.next = 2;
|
|
13702
13596
|
return _CoreManager.default.getUserController().currentUserAsync();
|
|
13703
13597
|
case 2:
|
|
13704
|
-
currentUser =
|
|
13598
|
+
currentUser = _context22.sent;
|
|
13705
13599
|
if (!sessionToken) {
|
|
13706
13600
|
sessionToken = currentUser ? currentUser.getSessionToken() : undefined;
|
|
13707
13601
|
}
|
|
13708
|
-
|
|
13602
|
+
_context22.next = 6;
|
|
13709
13603
|
return _CoreManager.default.getLiveQueryController().getDefaultLiveQueryClient();
|
|
13710
13604
|
case 6:
|
|
13711
|
-
liveQueryClient =
|
|
13605
|
+
liveQueryClient = _context22.sent;
|
|
13712
13606
|
if (liveQueryClient.shouldOpen()) {
|
|
13713
13607
|
liveQueryClient.open();
|
|
13714
13608
|
}
|
|
13715
13609
|
subscription = liveQueryClient.subscribe(this, sessionToken);
|
|
13716
|
-
return
|
|
13610
|
+
return _context22.abrupt("return", subscription.subscribePromise.then(function () {
|
|
13717
13611
|
return subscription;
|
|
13718
13612
|
}));
|
|
13719
13613
|
case 10:
|
|
13720
13614
|
case "end":
|
|
13721
|
-
return
|
|
13615
|
+
return _context22.stop();
|
|
13722
13616
|
}
|
|
13723
13617
|
}, _callee7, this);
|
|
13724
13618
|
}));
|
|
@@ -13800,7 +13694,7 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13800
13694
|
}, {
|
|
13801
13695
|
key: "cancel",
|
|
13802
13696
|
value: function () /*: ParseQuery*/{
|
|
13803
|
-
var
|
|
13697
|
+
var _this14 = this;
|
|
13804
13698
|
if (this._xhrRequest.task && typeof this._xhrRequest.task.abort === 'function') {
|
|
13805
13699
|
this._xhrRequest.task._aborted = true;
|
|
13806
13700
|
this._xhrRequest.task.abort();
|
|
@@ -13809,16 +13703,16 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13809
13703
|
return this;
|
|
13810
13704
|
}
|
|
13811
13705
|
return this._xhrRequest.onchange = function () {
|
|
13812
|
-
return
|
|
13706
|
+
return _this14.cancel();
|
|
13813
13707
|
};
|
|
13814
13708
|
}
|
|
13815
13709
|
}, {
|
|
13816
13710
|
key: "_setRequestTask",
|
|
13817
13711
|
value: function (options) {
|
|
13818
|
-
var
|
|
13712
|
+
var _this15 = this;
|
|
13819
13713
|
options.requestTask = function (task) {
|
|
13820
|
-
|
|
13821
|
-
|
|
13714
|
+
_this15._xhrRequest.task = task;
|
|
13715
|
+
_this15._xhrRequest.onchange();
|
|
13822
13716
|
};
|
|
13823
13717
|
}
|
|
13824
13718
|
}], [{
|
|
@@ -13830,8 +13724,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13830
13724
|
}, {
|
|
13831
13725
|
key: "or",
|
|
13832
13726
|
value: function () /*: ParseQuery*/{
|
|
13833
|
-
for (var
|
|
13834
|
-
queries[
|
|
13727
|
+
for (var _len8 = arguments.length, queries = new Array(_len8), _key12 = 0; _key12 < _len8; _key12++) {
|
|
13728
|
+
queries[_key12] = arguments[_key12];
|
|
13835
13729
|
}
|
|
13836
13730
|
var className = _getClassNameFromQueries(queries);
|
|
13837
13731
|
var query = new ParseQuery(className);
|
|
@@ -13854,8 +13748,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13854
13748
|
}, {
|
|
13855
13749
|
key: "and",
|
|
13856
13750
|
value: function () /*: ParseQuery*/{
|
|
13857
|
-
for (var
|
|
13858
|
-
queries[
|
|
13751
|
+
for (var _len9 = arguments.length, queries = new Array(_len9), _key13 = 0; _key13 < _len9; _key13++) {
|
|
13752
|
+
queries[_key13] = arguments[_key13];
|
|
13859
13753
|
}
|
|
13860
13754
|
var className = _getClassNameFromQueries(queries);
|
|
13861
13755
|
var query = new ParseQuery(className);
|
|
@@ -13878,8 +13772,8 @@ var ParseQuery = /*#__PURE__*/function () {
|
|
|
13878
13772
|
}, {
|
|
13879
13773
|
key: "nor",
|
|
13880
13774
|
value: function () /*: ParseQuery*/{
|
|
13881
|
-
for (var
|
|
13882
|
-
queries[
|
|
13775
|
+
for (var _len10 = arguments.length, queries = new Array(_len10), _key14 = 0; _key14 < _len10; _key14++) {
|
|
13776
|
+
queries[_key14] = arguments[_key14];
|
|
13883
13777
|
}
|
|
13884
13778
|
var className = _getClassNameFromQueries(queries);
|
|
13885
13779
|
var query = new ParseQuery(className);
|
|
@@ -14112,11 +14006,7 @@ function _isNativeReflectConstruct() {
|
|
|
14112
14006
|
} catch (e) {
|
|
14113
14007
|
return false;
|
|
14114
14008
|
}
|
|
14115
|
-
}
|
|
14116
|
-
* @flow
|
|
14117
|
-
*/
|
|
14118
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14119
|
-
/*:: import type ParseRelation from './ParseRelation';*/
|
|
14009
|
+
}
|
|
14120
14010
|
/**
|
|
14121
14011
|
* Represents a Role on the Parse server. Roles represent groupings of
|
|
14122
14012
|
* Users for the purposes of granting permissions (e.g. specifying an ACL
|
|
@@ -14280,7 +14170,7 @@ var _ParseCLP = _interopRequireDefault(_dereq_("./ParseCLP"));
|
|
|
14280
14170
|
/**
|
|
14281
14171
|
* @flow
|
|
14282
14172
|
*/
|
|
14283
|
-
|
|
14173
|
+
|
|
14284
14174
|
var FIELD_TYPES = ['String', 'Number', 'Boolean', 'Date', 'File', 'GeoPoint', 'Polygon', 'Array', 'Object', 'Pointer', 'Relation'];
|
|
14285
14175
|
/*:: type FieldOptions = {
|
|
14286
14176
|
required: boolean,
|
|
@@ -14821,11 +14711,7 @@ function _isNativeReflectConstruct() {
|
|
|
14821
14711
|
} catch (e) {
|
|
14822
14712
|
return false;
|
|
14823
14713
|
}
|
|
14824
|
-
}
|
|
14825
|
-
* @flow
|
|
14826
|
-
*/
|
|
14827
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14828
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
14714
|
+
}
|
|
14829
14715
|
/**
|
|
14830
14716
|
* <p>A Parse.Session object is a local representation of a revocable session.
|
|
14831
14717
|
* This class is a subclass of a Parse.Object, and retains the same
|
|
@@ -14988,12 +14874,7 @@ function _isNativeReflectConstruct() {
|
|
|
14988
14874
|
} catch (e) {
|
|
14989
14875
|
return false;
|
|
14990
14876
|
}
|
|
14991
|
-
}
|
|
14992
|
-
* @flow
|
|
14993
|
-
*/
|
|
14994
|
-
/*:: import type { AttributeMap } from './ObjectStateMutations';*/
|
|
14995
|
-
/*:: import type { RequestOptions, FullOptions } from './RESTController';*/
|
|
14996
|
-
/*:: export type AuthData = ?{ [key: string]: mixed };*/
|
|
14877
|
+
}
|
|
14997
14878
|
var CURRENT_USER_KEY = 'currentUser';
|
|
14998
14879
|
var canUseCurrentUser = !_CoreManager.default.get('IS_NODE');
|
|
14999
14880
|
var currentUserCacheMatchesDisk = false;
|
|
@@ -15819,27 +15700,6 @@ var ParseUser = /*#__PURE__*/function (_ParseObject) {
|
|
|
15819
15700
|
return user.logIn(options);
|
|
15820
15701
|
}
|
|
15821
15702
|
|
|
15822
|
-
/**
|
|
15823
|
-
* Logs in a user with an objectId. On success, this saves the session
|
|
15824
|
-
* to disk, so you can retrieve the currently logged in user using
|
|
15825
|
-
* <code>current</code>.
|
|
15826
|
-
*
|
|
15827
|
-
* @param {string} userId The objectId for the user.
|
|
15828
|
-
* @static
|
|
15829
|
-
* @returns {Promise} A promise that is fulfilled with the user when
|
|
15830
|
-
* the login completes.
|
|
15831
|
-
*/
|
|
15832
|
-
}, {
|
|
15833
|
-
key: "loginAs",
|
|
15834
|
-
value: function (userId /*: string*/) {
|
|
15835
|
-
if (!userId) {
|
|
15836
|
-
throw new _ParseError.default(_ParseError.default.USERNAME_MISSING, 'Cannot log in as user with an empty user id');
|
|
15837
|
-
}
|
|
15838
|
-
var controller = _CoreManager.default.getUserController();
|
|
15839
|
-
var user = new this();
|
|
15840
|
-
return controller.loginAs(user, userId);
|
|
15841
|
-
}
|
|
15842
|
-
|
|
15843
15703
|
/**
|
|
15844
15704
|
* Logs in a user with a session token. On success, this saves the session
|
|
15845
15705
|
* to disk, so you can retrieve the currently logged in user using
|
|
@@ -16284,21 +16144,6 @@ var DefaultController = {
|
|
|
16284
16144
|
return DefaultController.setCurrentUser(user);
|
|
16285
16145
|
});
|
|
16286
16146
|
},
|
|
16287
|
-
loginAs: function (user /*: ParseUser*/, userId /*: string*/) /*: Promise<ParseUser>*/{
|
|
16288
|
-
var RESTController = _CoreManager.default.getRESTController();
|
|
16289
|
-
return RESTController.request('POST', 'loginAs', {
|
|
16290
|
-
userId: userId
|
|
16291
|
-
}, {
|
|
16292
|
-
useMasterKey: true
|
|
16293
|
-
}).then(function (response) {
|
|
16294
|
-
user._finishFetch(response);
|
|
16295
|
-
user._setExisted(true);
|
|
16296
|
-
if (!canUseCurrentUser) {
|
|
16297
|
-
return _promise.default.resolve(user);
|
|
16298
|
-
}
|
|
16299
|
-
return DefaultController.setCurrentUser(user);
|
|
16300
|
-
});
|
|
16301
|
-
},
|
|
16302
16147
|
become: function (user /*: ParseUser*/, options /*: RequestOptions*/) /*: Promise<ParseUser>*/{
|
|
16303
16148
|
var RESTController = _CoreManager.default.getRESTController();
|
|
16304
16149
|
return RESTController.request('GET', 'users/me', {}, options).then(function (response) {
|
|
@@ -16442,14 +16287,7 @@ var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
|
16442
16287
|
/**
|
|
16443
16288
|
* @flow
|
|
16444
16289
|
*/
|
|
16445
|
-
|
|
16446
|
-
/*:: import type { FullOptions } from './RESTController';*/
|
|
16447
|
-
/*:: export type PushData = {
|
|
16448
|
-
where?: WhereClause | ParseQuery,
|
|
16449
|
-
push_time?: Date | string,
|
|
16450
|
-
expiration_time?: Date | string,
|
|
16451
|
-
expiration_interval?: number,
|
|
16452
|
-
};*/
|
|
16290
|
+
|
|
16453
16291
|
/**
|
|
16454
16292
|
* Contains functions to deal with Push in Parse.
|
|
16455
16293
|
*
|
|
@@ -16457,6 +16295,7 @@ var _ParseQuery = _interopRequireDefault(_dereq_("./ParseQuery"));
|
|
|
16457
16295
|
* @static
|
|
16458
16296
|
* @hideconstructor
|
|
16459
16297
|
*/
|
|
16298
|
+
|
|
16460
16299
|
/**
|
|
16461
16300
|
* Sends a push notification.
|
|
16462
16301
|
* **Available in Cloud Code only.**
|
|
@@ -16587,26 +16426,6 @@ function _objectSpread(target) {
|
|
|
16587
16426
|
*/
|
|
16588
16427
|
/* global XMLHttpRequest, XDomainRequest */
|
|
16589
16428
|
var uuidv4 = _dereq_('./uuid');
|
|
16590
|
-
/*:: export type RequestOptions = {
|
|
16591
|
-
useMasterKey?: boolean,
|
|
16592
|
-
sessionToken?: string,
|
|
16593
|
-
installationId?: string,
|
|
16594
|
-
returnStatus?: boolean,
|
|
16595
|
-
batchSize?: number,
|
|
16596
|
-
include?: any,
|
|
16597
|
-
progress?: any,
|
|
16598
|
-
context?: any,
|
|
16599
|
-
usePost?: boolean,
|
|
16600
|
-
};*/
|
|
16601
|
-
/*:: export type FullOptions = {
|
|
16602
|
-
success?: any,
|
|
16603
|
-
error?: any,
|
|
16604
|
-
useMasterKey?: boolean,
|
|
16605
|
-
sessionToken?: string,
|
|
16606
|
-
installationId?: string,
|
|
16607
|
-
progress?: any,
|
|
16608
|
-
usePost?: boolean,
|
|
16609
|
-
};*/
|
|
16610
16429
|
var XHR = null;
|
|
16611
16430
|
if (typeof XMLHttpRequest !== 'undefined') {
|
|
16612
16431
|
XHR = XMLHttpRequest;
|
|
@@ -16952,12 +16771,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
16952
16771
|
/**
|
|
16953
16772
|
* @flow
|
|
16954
16773
|
*/
|
|
16955
|
-
|
|
16956
|
-
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
16957
|
-
/*:: type ObjectIdentifier = {
|
|
16958
|
-
className: string,
|
|
16959
|
-
id: string,
|
|
16960
|
-
};*/
|
|
16774
|
+
|
|
16961
16775
|
var objectState
|
|
16962
16776
|
/*: {
|
|
16963
16777
|
[className: string]: {
|
|
@@ -17197,10 +17011,6 @@ var _promiseUtils = _dereq_("./promiseUtils");
|
|
|
17197
17011
|
/**
|
|
17198
17012
|
* @flow
|
|
17199
17013
|
*/
|
|
17200
|
-
/*:: type Task = {
|
|
17201
|
-
task: () => Promise,
|
|
17202
|
-
_completion: Promise,
|
|
17203
|
-
};*/
|
|
17204
17014
|
var TaskQueue = /*#__PURE__*/function () {
|
|
17205
17015
|
function TaskQueue() {
|
|
17206
17016
|
(0, _classCallCheck2.default)(this, TaskQueue);
|
|
@@ -17319,9 +17129,7 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
17319
17129
|
/**
|
|
17320
17130
|
* @flow
|
|
17321
17131
|
*/
|
|
17322
|
-
|
|
17323
|
-
/*:: import type ParseObject from './ParseObject';*/
|
|
17324
|
-
/*:: import type { AttributeMap, ObjectCache, OpsMap, State } from './ObjectStateMutations';*/
|
|
17132
|
+
|
|
17325
17133
|
var objectState = new _weakMap.default();
|
|
17326
17134
|
function getState(obj /*: ParseObject*/) /*: ?State*/{
|
|
17327
17135
|
var classData = objectState.get(obj);
|
|
@@ -17938,10 +17746,7 @@ var _ParseRelation = _interopRequireDefault(_dereq_("./ParseRelation"));
|
|
|
17938
17746
|
/**
|
|
17939
17747
|
* @flow
|
|
17940
17748
|
*/
|
|
17941
|
-
|
|
17942
|
-
objects: { [identifier: string]: ParseObject | boolean },
|
|
17943
|
-
files: Array<ParseFile>,
|
|
17944
|
-
};*/
|
|
17749
|
+
|
|
17945
17750
|
/**
|
|
17946
17751
|
* Return an array of unsaved children, which are either Parse Objects or Files.
|
|
17947
17752
|
* If it encounters any dirty Objects without Ids, it will throw an exception.
|