parse 4.0.0-alpha.1 → 4.0.0-alpha.3
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 +43 -30
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +43 -30
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/CoreManager.js +1 -1
- package/lib/browser/LiveQueryClient.js +29 -16
- package/lib/browser/RESTController.js +11 -11
- package/lib/node/CoreManager.js +1 -1
- package/lib/node/LiveQueryClient.js +27 -14
- package/lib/node/RESTController.js +11 -11
- package/lib/react-native/CoreManager.js +1 -1
- package/lib/react-native/LiveQueryClient.js +29 -16
- package/lib/react-native/RESTController.js +11 -11
- package/lib/weapp/CoreManager.js +1 -1
- package/lib/weapp/LiveQueryClient.js +29 -16
- package/lib/weapp/RESTController.js +11 -11
- package/package.json +1 -1
package/dist/parse.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Parse JavaScript SDK v4.0.0-alpha.
|
|
2
|
+
* Parse JavaScript SDK v4.0.0-alpha.3
|
|
3
3
|
*
|
|
4
4
|
* The source tree of this library can be found at
|
|
5
5
|
* https://github.com/ParsePlatform/Parse-SDK-JS
|
|
@@ -699,7 +699,7 @@ var config
|
|
|
699
699
|
SERVER_AUTH_TOKEN: null,
|
|
700
700
|
LIVEQUERY_SERVER_URL: null,
|
|
701
701
|
ENCRYPTED_KEY: null,
|
|
702
|
-
VERSION: 'js' + "4.0.0-alpha.
|
|
702
|
+
VERSION: 'js' + "4.0.0-alpha.3",
|
|
703
703
|
APPLICATION_ID: null,
|
|
704
704
|
JAVASCRIPT_KEY: null,
|
|
705
705
|
MASTER_KEY: null,
|
|
@@ -2553,6 +2553,8 @@ var _LiveQuerySubscription = _interopRequireDefault(_dereq_("./LiveQuerySubscrip
|
|
|
2553
2553
|
|
|
2554
2554
|
var _promiseUtils = _dereq_("./promiseUtils");
|
|
2555
2555
|
|
|
2556
|
+
var _ParseError = _interopRequireDefault(_dereq_("./ParseError"));
|
|
2557
|
+
|
|
2556
2558
|
function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
2557
2559
|
var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"];
|
|
2558
2560
|
|
|
@@ -2885,6 +2887,8 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
2885
2887
|
this.requestId += 1;
|
|
2886
2888
|
this.connectPromise.then(function () {
|
|
2887
2889
|
_this2.socket.send((0, _stringify.default)(subscribeRequest));
|
|
2890
|
+
}).catch(function (error) {
|
|
2891
|
+
subscription.subscribePromise.reject(error);
|
|
2888
2892
|
});
|
|
2889
2893
|
return subscription;
|
|
2890
2894
|
}
|
|
@@ -3097,26 +3101,35 @@ var LiveQueryClient = /*#__PURE__*/function (_EventEmitter) {
|
|
|
3097
3101
|
break;
|
|
3098
3102
|
|
|
3099
3103
|
case OP_EVENTS.ERROR:
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3104
|
+
{
|
|
3105
|
+
var parseError = new _ParseError.default(data.code, data.error);
|
|
3106
|
+
|
|
3107
|
+
if (!this.id) {
|
|
3108
|
+
this.connectPromise.reject(parseError);
|
|
3109
|
+
this.state = CLIENT_STATE.DISCONNECTED;
|
|
3106
3110
|
}
|
|
3107
|
-
} else {
|
|
3108
|
-
this.emit(CLIENT_EMMITER_TYPES.ERROR, data.error);
|
|
3109
|
-
}
|
|
3110
3111
|
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3112
|
+
if (data.requestId) {
|
|
3113
|
+
if (subscription) {
|
|
3114
|
+
subscription.subscribePromise.reject(parseError);
|
|
3115
|
+
(0, _setTimeout2.default)(function () {
|
|
3116
|
+
return subscription.emit(SUBSCRIPTION_EMMITER_TYPES.ERROR, data.error);
|
|
3117
|
+
}, 200);
|
|
3118
|
+
}
|
|
3119
|
+
} else {
|
|
3120
|
+
this.emit(CLIENT_EMMITER_TYPES.ERROR, data.error);
|
|
3121
|
+
}
|
|
3114
3122
|
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3123
|
+
if (data.error === 'Additional properties not allowed') {
|
|
3124
|
+
this.additionalProperties = false;
|
|
3125
|
+
}
|
|
3118
3126
|
|
|
3119
|
-
|
|
3127
|
+
if (data.reconnect) {
|
|
3128
|
+
this._handleReconnect();
|
|
3129
|
+
}
|
|
3130
|
+
|
|
3131
|
+
break;
|
|
3132
|
+
}
|
|
3120
3133
|
|
|
3121
3134
|
case OP_EVENTS.UNSUBSCRIBED:
|
|
3122
3135
|
// We have already deleted subscription in unsubscribe(), do nothing here
|
|
@@ -3251,7 +3264,7 @@ _CoreManager.default.setWebSocketController(typeof WebSocket === 'function' || (
|
|
|
3251
3264
|
|
|
3252
3265
|
var _default = LiveQueryClient;
|
|
3253
3266
|
exports.default = _default;
|
|
3254
|
-
},{"./CoreManager":4,"./EventEmitter":6,"./LiveQuerySubscription":12,"./ParseObject":27,"./promiseUtils":51,"@babel/runtime-corejs3/core-js-stable/array/from":55,"@babel/runtime-corejs3/core-js-stable/array/is-array":56,"@babel/runtime-corejs3/core-js-stable/instance/bind":57,"@babel/runtime-corejs3/core-js-stable/instance/for-each":64,"@babel/runtime-corejs3/core-js-stable/instance/index-of":66,"@babel/runtime-corejs3/core-js-stable/instance/keys":67,"@babel/runtime-corejs3/core-js-stable/instance/slice":71,"@babel/runtime-corejs3/core-js-stable/instance/values":75,"@babel/runtime-corejs3/core-js-stable/json/stringify":76,"@babel/runtime-corejs3/core-js-stable/map":77,"@babel/runtime-corejs3/core-js-stable/object/define-property":82,"@babel/runtime-corejs3/core-js-stable/reflect/construct":93,"@babel/runtime-corejs3/core-js-stable/set-timeout":95,"@babel/runtime-corejs3/core-js-stable/symbol":97,"@babel/runtime-corejs3/core-js/get-iterator-method":101,"@babel/runtime-corejs3/helpers/assertThisInitialized":119,"@babel/runtime-corejs3/helpers/classCallCheck":121,"@babel/runtime-corejs3/helpers/createClass":123,"@babel/runtime-corejs3/helpers/defineProperty":124,"@babel/runtime-corejs3/helpers/getPrototypeOf":126,"@babel/runtime-corejs3/helpers/inherits":127,"@babel/runtime-corejs3/helpers/interopRequireDefault":128,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":135,"@babel/runtime-corejs3/helpers/typeof":140}],12:[function(_dereq_,module,exports){
|
|
3267
|
+
},{"./CoreManager":4,"./EventEmitter":6,"./LiveQuerySubscription":12,"./ParseError":22,"./ParseObject":27,"./promiseUtils":51,"@babel/runtime-corejs3/core-js-stable/array/from":55,"@babel/runtime-corejs3/core-js-stable/array/is-array":56,"@babel/runtime-corejs3/core-js-stable/instance/bind":57,"@babel/runtime-corejs3/core-js-stable/instance/for-each":64,"@babel/runtime-corejs3/core-js-stable/instance/index-of":66,"@babel/runtime-corejs3/core-js-stable/instance/keys":67,"@babel/runtime-corejs3/core-js-stable/instance/slice":71,"@babel/runtime-corejs3/core-js-stable/instance/values":75,"@babel/runtime-corejs3/core-js-stable/json/stringify":76,"@babel/runtime-corejs3/core-js-stable/map":77,"@babel/runtime-corejs3/core-js-stable/object/define-property":82,"@babel/runtime-corejs3/core-js-stable/reflect/construct":93,"@babel/runtime-corejs3/core-js-stable/set-timeout":95,"@babel/runtime-corejs3/core-js-stable/symbol":97,"@babel/runtime-corejs3/core-js/get-iterator-method":101,"@babel/runtime-corejs3/helpers/assertThisInitialized":119,"@babel/runtime-corejs3/helpers/classCallCheck":121,"@babel/runtime-corejs3/helpers/createClass":123,"@babel/runtime-corejs3/helpers/defineProperty":124,"@babel/runtime-corejs3/helpers/getPrototypeOf":126,"@babel/runtime-corejs3/helpers/inherits":127,"@babel/runtime-corejs3/helpers/interopRequireDefault":128,"@babel/runtime-corejs3/helpers/possibleConstructorReturn":135,"@babel/runtime-corejs3/helpers/typeof":140}],12:[function(_dereq_,module,exports){
|
|
3255
3268
|
"use strict";
|
|
3256
3269
|
|
|
3257
3270
|
var _interopRequireDefault = _dereq_("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
@@ -24465,8 +24478,8 @@ var RESTController = {
|
|
|
24465
24478
|
headers[key] = customHeaders[key];
|
|
24466
24479
|
}
|
|
24467
24480
|
|
|
24468
|
-
|
|
24469
|
-
|
|
24481
|
+
if (options && typeof options.progress === 'function') {
|
|
24482
|
+
var handleProgress = function handleProgress(type, event) {
|
|
24470
24483
|
if (event.lengthComputable) {
|
|
24471
24484
|
options.progress(event.loaded / event.total, event.loaded, event.total, {
|
|
24472
24485
|
type: type
|
|
@@ -24476,17 +24489,17 @@ var RESTController = {
|
|
|
24476
24489
|
type: type
|
|
24477
24490
|
});
|
|
24478
24491
|
}
|
|
24479
|
-
}
|
|
24480
|
-
}
|
|
24481
|
-
|
|
24482
|
-
xhr.onprogress = function (event) {
|
|
24483
|
-
handleProgress('download', event);
|
|
24484
|
-
};
|
|
24492
|
+
};
|
|
24485
24493
|
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
handleProgress('upload', event);
|
|
24494
|
+
xhr.onprogress = function (event) {
|
|
24495
|
+
handleProgress('download', event);
|
|
24489
24496
|
};
|
|
24497
|
+
|
|
24498
|
+
if (xhr.upload) {
|
|
24499
|
+
xhr.upload.onprogress = function (event) {
|
|
24500
|
+
handleProgress('upload', event);
|
|
24501
|
+
};
|
|
24502
|
+
}
|
|
24490
24503
|
}
|
|
24491
24504
|
|
|
24492
24505
|
xhr.open(method, url, true);
|