parse 5.1.1-alpha.1 → 5.2.0-alpha.2
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 +10186 -14918
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +10180 -15057
- package/dist/parse.weapp.min.js +2 -2
- package/lib/browser/Analytics.js +7 -11
- package/lib/browser/AnonymousUtils.js +17 -22
- package/lib/browser/Cloud.js +24 -46
- package/lib/browser/CoreManager.js +71 -79
- package/lib/browser/CryptoController.js +14 -9
- package/lib/browser/EventEmitter.js +9 -2
- package/lib/browser/EventuallyQueue.js +156 -357
- package/lib/browser/FacebookUtils.js +23 -28
- package/lib/browser/IndexedDBStorageController.js +18 -14
- package/lib/browser/InstallationController.js +55 -121
- package/lib/browser/LiveQueryClient.js +312 -446
- package/lib/browser/LiveQuerySubscription.js +25 -28
- package/lib/browser/LocalDatastore.js +254 -578
- package/lib/browser/LocalDatastoreController.default.js +48 -227
- package/lib/browser/LocalDatastoreController.js +11 -1
- package/lib/browser/LocalDatastoreController.react-native.js +72 -164
- package/lib/browser/LocalDatastoreUtils.js +4 -12
- package/lib/browser/ObjectStateMutations.js +89 -95
- package/lib/browser/OfflineQuery.js +106 -198
- package/lib/browser/Parse.js +45 -61
- package/lib/browser/ParseACL.js +242 -288
- package/lib/browser/ParseCLP.js +372 -580
- package/lib/browser/ParseConfig.js +115 -138
- package/lib/browser/ParseError.js +85 -182
- package/lib/browser/ParseFile.js +296 -444
- package/lib/browser/ParseGeoPoint.js +121 -140
- package/lib/browser/ParseHooks.js +12 -14
- package/lib/browser/ParseInstallation.js +226 -354
- package/lib/browser/ParseLiveQuery.js +74 -148
- package/lib/browser/ParseObject.js +2017 -2622
- package/lib/browser/ParseOp.js +343 -484
- package/lib/browser/ParsePolygon.js +101 -120
- package/lib/browser/ParseQuery.js +1722 -2068
- package/lib/browser/ParseRelation.js +99 -118
- package/lib/browser/ParseRole.js +88 -144
- package/lib/browser/ParseSchema.js +372 -434
- package/lib/browser/ParseSession.js +62 -110
- package/lib/browser/ParseUser.js +942 -1270
- package/lib/browser/Push.js +16 -44
- package/lib/browser/RESTController.js +85 -124
- package/lib/browser/SingleInstanceStateController.js +57 -86
- package/lib/browser/Socket.weapp.js +50 -33
- package/lib/browser/Storage.js +23 -28
- package/lib/browser/StorageController.browser.js +16 -13
- package/lib/browser/StorageController.default.js +15 -14
- package/lib/browser/StorageController.js +14 -1
- package/lib/browser/StorageController.react-native.js +31 -30
- package/lib/browser/StorageController.weapp.js +19 -13
- package/lib/browser/TaskQueue.js +37 -49
- package/lib/browser/UniqueInstanceStateController.js +65 -86
- package/lib/browser/WebSocketController.js +11 -4
- package/lib/browser/Xhr.weapp.js +90 -78
- package/lib/browser/arrayContainsObject.js +3 -3
- package/lib/browser/canBeSerialized.js +10 -11
- package/lib/browser/decode.js +11 -11
- package/lib/browser/encode.js +11 -11
- package/lib/browser/equals.js +9 -10
- package/lib/browser/escape.js +2 -2
- package/lib/browser/isRevocableSession.js +1 -1
- package/lib/browser/parseDate.js +10 -10
- package/lib/browser/promiseUtils.js +19 -19
- package/lib/browser/unique.js +4 -4
- package/lib/browser/unsavedChildren.js +20 -21
- package/lib/browser/uuid.js +2 -4
- package/lib/node/Analytics.js +2 -6
- package/lib/node/AnonymousUtils.js +7 -12
- package/lib/node/Cloud.js +8 -12
- package/lib/node/CoreManager.js +59 -67
- package/lib/node/CryptoController.js +8 -3
- package/lib/node/EventEmitter.js +7 -1
- package/lib/node/EventuallyQueue.js +18 -37
- package/lib/node/FacebookUtils.js +1 -5
- package/lib/node/IndexedDBStorageController.js +14 -10
- package/lib/node/InstallationController.js +7 -8
- package/lib/node/LiveQueryClient.js +20 -32
- package/lib/node/LiveQuerySubscription.js +3 -4
- package/lib/node/LocalDatastore.js +20 -24
- package/lib/node/LocalDatastoreController.default.js +12 -11
- package/lib/node/LocalDatastoreController.js +14 -1
- package/lib/node/LocalDatastoreController.react-native.js +27 -22
- package/lib/node/LocalDatastoreUtils.js +4 -12
- package/lib/node/ObjectStateMutations.js +52 -36
- package/lib/node/OfflineQuery.js +37 -23
- package/lib/node/Parse.js +35 -49
- package/lib/node/ParseACL.js +18 -27
- package/lib/node/ParseCLP.js +38 -50
- package/lib/node/ParseConfig.js +7 -14
- package/lib/node/ParseError.js +457 -458
- package/lib/node/ParseFile.js +33 -66
- package/lib/node/ParseGeoPoint.js +22 -17
- package/lib/node/ParseHooks.js +0 -2
- package/lib/node/ParseInstallation.js +21 -8
- package/lib/node/ParseLiveQuery.js +6 -11
- package/lib/node/ParseObject.js +138 -167
- package/lib/node/ParseOp.js +32 -44
- package/lib/node/ParsePolygon.js +11 -17
- package/lib/node/ParseQuery.js +118 -164
- package/lib/node/ParseRelation.js +7 -16
- package/lib/node/ParseRole.js +7 -13
- package/lib/node/ParseSchema.js +26 -39
- package/lib/node/ParseSession.js +7 -8
- package/lib/node/ParseUser.js +70 -76
- package/lib/node/Push.js +5 -15
- package/lib/node/RESTController.js +21 -33
- package/lib/node/SingleInstanceStateController.js +41 -69
- package/lib/node/Socket.weapp.js +23 -2
- package/lib/node/Storage.js +11 -16
- package/lib/node/StorageController.browser.js +10 -8
- package/lib/node/StorageController.default.js +9 -9
- package/lib/node/StorageController.js +16 -1
- package/lib/node/StorageController.react-native.js +17 -17
- package/lib/node/StorageController.weapp.js +14 -8
- package/lib/node/TaskQueue.js +8 -11
- package/lib/node/UniqueInstanceStateController.js +40 -60
- package/lib/node/WebSocketController.js +15 -2
- package/lib/node/Xhr.weapp.js +11 -2
- package/lib/node/arrayContainsObject.js +1 -1
- package/lib/node/canBeSerialized.js +2 -2
- package/lib/node/decode.js +1 -1
- package/lib/node/encode.js +2 -2
- package/lib/node/equals.js +1 -1
- package/lib/node/escape.js +1 -1
- package/lib/node/isRevocableSession.js +1 -1
- package/lib/node/parseDate.js +1 -1
- package/lib/node/promiseUtils.js +7 -7
- package/lib/node/unique.js +2 -2
- package/lib/node/unsavedChildren.js +2 -2
- package/lib/node/uuid.js +2 -4
- package/lib/react-native/Analytics.js +2 -2
- package/lib/react-native/AnonymousUtils.js +3 -4
- package/lib/react-native/Cloud.js +0 -1
- package/lib/react-native/CoreManager.js +2 -3
- package/lib/react-native/CryptoController.js +6 -1
- package/lib/react-native/EventEmitter.js +6 -1
- package/lib/react-native/EventuallyQueue.js +1 -2
- package/lib/react-native/FacebookUtils.js +1 -2
- package/lib/react-native/IndexedDBStorageController.js +11 -5
- package/lib/react-native/InstallationController.js +1 -2
- package/lib/react-native/LiveQueryClient.js +51 -36
- package/lib/react-native/LiveQuerySubscription.js +2 -4
- package/lib/react-native/LocalDatastore.js +41 -17
- package/lib/react-native/LocalDatastoreController.default.js +6 -1
- package/lib/react-native/LocalDatastoreController.js +11 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +16 -11
- package/lib/react-native/LocalDatastoreUtils.js +3 -6
- package/lib/react-native/ObjectStateMutations.js +30 -9
- package/lib/react-native/OfflineQuery.js +25 -20
- package/lib/react-native/Parse.js +24 -38
- package/lib/react-native/ParseACL.js +4 -6
- package/lib/react-native/ParseCLP.js +5 -7
- package/lib/react-native/ParseConfig.js +4 -6
- package/lib/react-native/ParseError.js +13 -31
- package/lib/react-native/ParseFile.js +10 -10
- package/lib/react-native/ParseGeoPoint.js +2 -4
- package/lib/react-native/ParseInstallation.js +13 -30
- package/lib/react-native/ParseLiveQuery.js +2 -4
- package/lib/react-native/ParseObject.js +81 -90
- package/lib/react-native/ParseOp.js +41 -79
- package/lib/react-native/ParsePolygon.js +2 -4
- package/lib/react-native/ParseQuery.js +87 -81
- package/lib/react-native/ParseRelation.js +2 -4
- package/lib/react-native/ParseRole.js +14 -31
- package/lib/react-native/ParseSchema.js +3 -5
- package/lib/react-native/ParseSession.js +12 -29
- package/lib/react-native/ParseUser.js +32 -51
- package/lib/react-native/RESTController.js +10 -4
- package/lib/react-native/SingleInstanceStateController.js +23 -37
- package/lib/react-native/Socket.weapp.js +9 -4
- package/lib/react-native/Storage.js +1 -2
- package/lib/react-native/StorageController.browser.js +6 -1
- package/lib/react-native/StorageController.default.js +6 -1
- package/lib/react-native/StorageController.js +13 -1
- package/lib/react-native/StorageController.react-native.js +11 -6
- package/lib/react-native/StorageController.weapp.js +6 -1
- package/lib/react-native/TaskQueue.js +8 -4
- package/lib/react-native/UniqueInstanceStateController.js +23 -37
- package/lib/react-native/WebSocketController.js +9 -1
- package/lib/react-native/Xhr.weapp.js +9 -4
- package/lib/react-native/unsavedChildren.js +3 -3
- package/lib/react-native/uuid.js +1 -2
- package/lib/weapp/Analytics.js +7 -11
- package/lib/weapp/AnonymousUtils.js +17 -22
- package/lib/weapp/Cloud.js +24 -46
- package/lib/weapp/CoreManager.js +71 -79
- package/lib/weapp/CryptoController.js +14 -9
- package/lib/weapp/EventEmitter.js +9 -2
- package/lib/weapp/EventuallyQueue.js +156 -357
- package/lib/weapp/FacebookUtils.js +23 -28
- package/lib/weapp/IndexedDBStorageController.js +18 -14
- package/lib/weapp/InstallationController.js +55 -121
- package/lib/weapp/LiveQueryClient.js +312 -446
- package/lib/weapp/LiveQuerySubscription.js +25 -28
- package/lib/weapp/LocalDatastore.js +254 -578
- package/lib/weapp/LocalDatastoreController.default.js +48 -227
- package/lib/weapp/LocalDatastoreController.js +11 -1
- package/lib/weapp/LocalDatastoreController.react-native.js +72 -164
- package/lib/weapp/LocalDatastoreUtils.js +4 -12
- package/lib/weapp/ObjectStateMutations.js +89 -95
- package/lib/weapp/OfflineQuery.js +106 -198
- package/lib/weapp/Parse.js +45 -60
- package/lib/weapp/ParseACL.js +242 -288
- package/lib/weapp/ParseCLP.js +372 -580
- package/lib/weapp/ParseConfig.js +115 -138
- package/lib/weapp/ParseError.js +85 -182
- package/lib/weapp/ParseFile.js +297 -446
- package/lib/weapp/ParseGeoPoint.js +121 -140
- package/lib/weapp/ParseHooks.js +12 -14
- package/lib/weapp/ParseInstallation.js +226 -354
- package/lib/weapp/ParseLiveQuery.js +74 -148
- package/lib/weapp/ParseObject.js +2017 -2622
- package/lib/weapp/ParseOp.js +343 -484
- package/lib/weapp/ParsePolygon.js +101 -120
- package/lib/weapp/ParseQuery.js +1722 -2068
- package/lib/weapp/ParseRelation.js +99 -118
- package/lib/weapp/ParseRole.js +88 -144
- package/lib/weapp/ParseSchema.js +372 -434
- package/lib/weapp/ParseSession.js +62 -110
- package/lib/weapp/ParseUser.js +942 -1270
- package/lib/weapp/Push.js +16 -44
- package/lib/weapp/RESTController.js +86 -125
- package/lib/weapp/SingleInstanceStateController.js +57 -86
- package/lib/weapp/Socket.weapp.js +50 -33
- package/lib/weapp/Storage.js +23 -28
- package/lib/weapp/StorageController.browser.js +16 -13
- package/lib/weapp/StorageController.default.js +15 -14
- package/lib/weapp/StorageController.js +14 -1
- package/lib/weapp/StorageController.react-native.js +31 -30
- package/lib/weapp/StorageController.weapp.js +19 -13
- package/lib/weapp/TaskQueue.js +37 -49
- package/lib/weapp/UniqueInstanceStateController.js +65 -86
- package/lib/weapp/WebSocketController.js +11 -4
- package/lib/weapp/Xhr.weapp.js +90 -78
- package/lib/weapp/arrayContainsObject.js +3 -3
- package/lib/weapp/canBeSerialized.js +10 -11
- package/lib/weapp/decode.js +11 -11
- package/lib/weapp/encode.js +11 -11
- package/lib/weapp/equals.js +9 -10
- package/lib/weapp/escape.js +2 -2
- package/lib/weapp/isRevocableSession.js +1 -1
- package/lib/weapp/parseDate.js +10 -10
- package/lib/weapp/promiseUtils.js +19 -19
- package/lib/weapp/unique.js +4 -4
- package/lib/weapp/unsavedChildren.js +20 -21
- package/lib/weapp/uuid.js +6 -8
- package/package.json +23 -30
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _Reflect$construct = require("@babel/runtime-corejs3/core-js-stable/reflect/construct");
|
|
4
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
@@ -8,45 +7,10 @@ _Object$defineProperty(exports, "__esModule", {
|
|
|
8
7
|
});
|
|
9
8
|
exports.default = void 0;
|
|
10
9
|
var _entries = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/entries"));
|
|
11
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
|
|
12
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/slicedToArray"));
|
|
13
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));
|
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));
|
|
15
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
16
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
17
|
-
var _get2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/get"));
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/inherits"));
|
|
19
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/possibleConstructorReturn"));
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/getPrototypeOf"));
|
|
21
10
|
var _CoreManager = _interopRequireDefault(require("./CoreManager"));
|
|
22
11
|
var _ParseError = _interopRequireDefault(require("./ParseError"));
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
26
|
-
return function () {
|
|
27
|
-
var Super = (0, _getPrototypeOf2.default)(Derived),
|
|
28
|
-
result;
|
|
29
|
-
if (hasNativeReflectConstruct) {
|
|
30
|
-
var NewTarget = (0, _getPrototypeOf2.default)(this).constructor;
|
|
31
|
-
result = _Reflect$construct(Super, arguments, NewTarget);
|
|
32
|
-
} else {
|
|
33
|
-
result = Super.apply(this, arguments);
|
|
34
|
-
}
|
|
35
|
-
return (0, _possibleConstructorReturn2.default)(this, result);
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function _isNativeReflectConstruct() {
|
|
39
|
-
if (typeof Reflect === "undefined" || !_Reflect$construct) return false;
|
|
40
|
-
if (_Reflect$construct.sham) return false;
|
|
41
|
-
if (typeof Proxy === "function") return true;
|
|
42
|
-
try {
|
|
43
|
-
Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {}));
|
|
44
|
-
return true;
|
|
45
|
-
} catch (e) {
|
|
46
|
-
return false;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
var DEVICE_TYPES /*: DeviceInterface*/ = {
|
|
12
|
+
var _ParseObject = _interopRequireDefault(require("./ParseObject"));
|
|
13
|
+
const DEVICE_TYPES = {
|
|
50
14
|
IOS: 'ios',
|
|
51
15
|
MACOS: 'macos',
|
|
52
16
|
TVOS: 'tvos',
|
|
@@ -66,22 +30,17 @@ var DEVICE_TYPES /*: DeviceInterface*/ = {
|
|
|
66
30
|
*
|
|
67
31
|
* @alias Parse.Installation
|
|
68
32
|
*/
|
|
69
|
-
|
|
70
|
-
(0, _inherits2.default)(ParseInstallation, _ParseObject);
|
|
71
|
-
var _super = _createSuper(ParseInstallation);
|
|
33
|
+
class ParseInstallation extends _ParseObject.default {
|
|
72
34
|
/**
|
|
73
35
|
* @param {object} attributes The initial set of data to store in the object.
|
|
74
36
|
*/
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
(
|
|
78
|
-
|
|
79
|
-
if (attributes && (0, _typeof2.default)(attributes) === 'object') {
|
|
80
|
-
if (!_this.set(attributes)) {
|
|
37
|
+
constructor(attributes) {
|
|
38
|
+
super('_Installation');
|
|
39
|
+
if (attributes && typeof attributes === 'object') {
|
|
40
|
+
if (!this.set(attributes)) {
|
|
81
41
|
throw new Error("Can't create an invalid Installation");
|
|
82
42
|
}
|
|
83
43
|
}
|
|
84
|
-
return _this;
|
|
85
44
|
}
|
|
86
45
|
|
|
87
46
|
/**
|
|
@@ -89,329 +48,242 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
89
48
|
*
|
|
90
49
|
* @property {string} appIdentifier
|
|
91
50
|
* @static
|
|
51
|
+
* @returns {string}
|
|
92
52
|
*/
|
|
93
|
-
(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
return this.get('appIdentifier');
|
|
97
|
-
}
|
|
53
|
+
get appIdentifier() {
|
|
54
|
+
return this.get('appIdentifier');
|
|
55
|
+
}
|
|
98
56
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
get
|
|
108
|
-
|
|
109
|
-
}
|
|
57
|
+
/**
|
|
58
|
+
* The version string of the client application to which this installation belongs.
|
|
59
|
+
*
|
|
60
|
+
* @property {string} appVersion
|
|
61
|
+
* @static
|
|
62
|
+
* @returns {string}
|
|
63
|
+
*/
|
|
64
|
+
get appVersion() {
|
|
65
|
+
return this.get('appVersion');
|
|
66
|
+
}
|
|
110
67
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
get
|
|
120
|
-
|
|
121
|
-
}
|
|
68
|
+
/**
|
|
69
|
+
* The display name of the client application to which this installation belongs.
|
|
70
|
+
*
|
|
71
|
+
* @property {string} appName
|
|
72
|
+
* @static
|
|
73
|
+
* @returns {string}
|
|
74
|
+
*/
|
|
75
|
+
get appName() {
|
|
76
|
+
return this.get('appName');
|
|
77
|
+
}
|
|
122
78
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
get
|
|
134
|
-
|
|
135
|
-
}
|
|
79
|
+
/**
|
|
80
|
+
* The current value of the icon badge for iOS apps.
|
|
81
|
+
* Changes to this value on the server will be used
|
|
82
|
+
* for future badge-increment push notifications.
|
|
83
|
+
*
|
|
84
|
+
* @property {number} badge
|
|
85
|
+
* @static
|
|
86
|
+
* @returns {number}
|
|
87
|
+
*/
|
|
88
|
+
get badge() {
|
|
89
|
+
return this.get('badge');
|
|
90
|
+
}
|
|
136
91
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
get
|
|
146
|
-
|
|
147
|
-
}
|
|
92
|
+
/**
|
|
93
|
+
* An array of the channels to which a device is currently subscribed.
|
|
94
|
+
*
|
|
95
|
+
* @property {string[]} channels
|
|
96
|
+
* @static
|
|
97
|
+
* @returns {string[]}
|
|
98
|
+
*/
|
|
99
|
+
get channels() {
|
|
100
|
+
return this.get('channels');
|
|
101
|
+
}
|
|
148
102
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
get
|
|
158
|
-
|
|
159
|
-
}
|
|
103
|
+
/**
|
|
104
|
+
* Token used to deliver push notifications to the device.
|
|
105
|
+
*
|
|
106
|
+
* @property {string} deviceToken
|
|
107
|
+
* @static
|
|
108
|
+
* @returns {string}
|
|
109
|
+
*/
|
|
110
|
+
get deviceToken() {
|
|
111
|
+
return this.get('deviceToken');
|
|
112
|
+
}
|
|
160
113
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
get
|
|
170
|
-
|
|
171
|
-
}
|
|
114
|
+
/**
|
|
115
|
+
* The type of device, “ios”, “android”, “web”, etc.
|
|
116
|
+
*
|
|
117
|
+
* @property {string} deviceType
|
|
118
|
+
* @static
|
|
119
|
+
* @returns {string}
|
|
120
|
+
*/
|
|
121
|
+
get deviceType() {
|
|
122
|
+
return this.get('deviceType');
|
|
123
|
+
}
|
|
172
124
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
get
|
|
182
|
-
|
|
183
|
-
}
|
|
125
|
+
/**
|
|
126
|
+
* Gets the GCM sender identifier for this installation
|
|
127
|
+
*
|
|
128
|
+
* @property {string} GCMSenderId
|
|
129
|
+
* @static
|
|
130
|
+
* @returns {string}
|
|
131
|
+
*/
|
|
132
|
+
get GCMSenderId() {
|
|
133
|
+
return this.get('GCMSenderId');
|
|
134
|
+
}
|
|
184
135
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
get
|
|
194
|
-
|
|
195
|
-
}
|
|
136
|
+
/**
|
|
137
|
+
* Universally Unique Identifier (UUID) for the device used by Parse. It must be unique across all of an app’s installations.
|
|
138
|
+
*
|
|
139
|
+
* @property {string} installationId
|
|
140
|
+
* @static
|
|
141
|
+
* @returns {string}
|
|
142
|
+
*/
|
|
143
|
+
get installationId() {
|
|
144
|
+
return this.get('installationId');
|
|
145
|
+
}
|
|
196
146
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
get
|
|
206
|
-
|
|
207
|
-
}
|
|
147
|
+
/**
|
|
148
|
+
* Gets the local identifier for this installation
|
|
149
|
+
*
|
|
150
|
+
* @property {string} localeIdentifier
|
|
151
|
+
* @static
|
|
152
|
+
* @returns {string}
|
|
153
|
+
*/
|
|
154
|
+
get localeIdentifier() {
|
|
155
|
+
return this.get('localeIdentifier');
|
|
156
|
+
}
|
|
208
157
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
get
|
|
218
|
-
|
|
219
|
-
}
|
|
158
|
+
/**
|
|
159
|
+
* Gets the parse server version for this installation
|
|
160
|
+
*
|
|
161
|
+
* @property {string} parseVersion
|
|
162
|
+
* @static
|
|
163
|
+
* @returns {string}
|
|
164
|
+
*/
|
|
165
|
+
get parseVersion() {
|
|
166
|
+
return this.get('parseVersion');
|
|
167
|
+
}
|
|
220
168
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
get
|
|
230
|
-
|
|
231
|
-
}
|
|
169
|
+
/**
|
|
170
|
+
* This field is reserved for directing Parse to the push delivery network to be used.
|
|
171
|
+
*
|
|
172
|
+
* @property {string} pushType
|
|
173
|
+
* @static
|
|
174
|
+
* @returns {string}
|
|
175
|
+
*/
|
|
176
|
+
get pushType() {
|
|
177
|
+
return this.get('pushType');
|
|
178
|
+
}
|
|
232
179
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
get
|
|
242
|
-
|
|
243
|
-
}
|
|
180
|
+
/**
|
|
181
|
+
* Gets the time zone for this installation
|
|
182
|
+
*
|
|
183
|
+
* @property {string} timeZone
|
|
184
|
+
* @static
|
|
185
|
+
* @returns {string}
|
|
186
|
+
*/
|
|
187
|
+
get timeZone() {
|
|
188
|
+
return this.get('timeZone');
|
|
189
|
+
}
|
|
244
190
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
}
|
|
282
|
-
_context.prev = 1;
|
|
283
|
-
_context.next = 4;
|
|
284
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "fetch", this).apply(this, args);
|
|
285
|
-
case 4:
|
|
286
|
-
_context.next = 15;
|
|
287
|
-
break;
|
|
288
|
-
case 6:
|
|
289
|
-
_context.prev = 6;
|
|
290
|
-
_context.t0 = _context["catch"](1);
|
|
291
|
-
if (!(_context.t0.code !== _ParseError.default.OBJECT_NOT_FOUND)) {
|
|
292
|
-
_context.next = 10;
|
|
293
|
-
break;
|
|
294
|
-
}
|
|
295
|
-
throw _context.t0;
|
|
296
|
-
case 10:
|
|
297
|
-
// The installation was deleted from the server.
|
|
298
|
-
// We always want fetch to succeed.
|
|
299
|
-
delete this.id;
|
|
300
|
-
this._getId(); // Generate localId
|
|
301
|
-
this._markAllFieldsDirty();
|
|
302
|
-
_context.next = 15;
|
|
303
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "save", this).apply(this, args);
|
|
304
|
-
case 15:
|
|
305
|
-
_context.next = 17;
|
|
306
|
-
return _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
|
|
307
|
-
case 17:
|
|
308
|
-
return _context.abrupt("return", this);
|
|
309
|
-
case 18:
|
|
310
|
-
case "end":
|
|
311
|
-
return _context.stop();
|
|
312
|
-
}
|
|
313
|
-
}, _callee, this, [[1, 6]]);
|
|
314
|
-
}));
|
|
315
|
-
function fetch() {
|
|
316
|
-
return _fetch.apply(this, arguments);
|
|
317
|
-
}
|
|
318
|
-
return fetch;
|
|
319
|
-
}()
|
|
320
|
-
/**
|
|
321
|
-
* Wrap the default save behavior with functionality to update the local storage.
|
|
322
|
-
* If the installation is deleted on the server, retry saving a new installation.
|
|
323
|
-
*
|
|
324
|
-
* @param {...any} args
|
|
325
|
-
* @returns {Promise}
|
|
326
|
-
*/
|
|
327
|
-
}, {
|
|
328
|
-
key: "save",
|
|
329
|
-
value: function () {
|
|
330
|
-
var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
331
|
-
var _len2,
|
|
332
|
-
args,
|
|
333
|
-
_key2,
|
|
334
|
-
_args2 = arguments;
|
|
335
|
-
return _regenerator.default.wrap(function (_context2) {
|
|
336
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
337
|
-
case 0:
|
|
338
|
-
for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
339
|
-
args[_key2] = _args2[_key2];
|
|
340
|
-
}
|
|
341
|
-
_context2.prev = 1;
|
|
342
|
-
_context2.next = 4;
|
|
343
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "save", this).apply(this, args);
|
|
344
|
-
case 4:
|
|
345
|
-
_context2.next = 15;
|
|
346
|
-
break;
|
|
347
|
-
case 6:
|
|
348
|
-
_context2.prev = 6;
|
|
349
|
-
_context2.t0 = _context2["catch"](1);
|
|
350
|
-
if (!(_context2.t0.code !== _ParseError.default.OBJECT_NOT_FOUND)) {
|
|
351
|
-
_context2.next = 10;
|
|
352
|
-
break;
|
|
353
|
-
}
|
|
354
|
-
throw _context2.t0;
|
|
355
|
-
case 10:
|
|
356
|
-
// The installation was deleted from the server.
|
|
357
|
-
// We always want save to succeed.
|
|
358
|
-
delete this.id;
|
|
359
|
-
this._getId(); // Generate localId
|
|
360
|
-
this._markAllFieldsDirty();
|
|
361
|
-
_context2.next = 15;
|
|
362
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "save", this).apply(this, args);
|
|
363
|
-
case 15:
|
|
364
|
-
_context2.next = 17;
|
|
365
|
-
return _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
|
|
366
|
-
case 17:
|
|
367
|
-
return _context2.abrupt("return", this);
|
|
368
|
-
case 18:
|
|
369
|
-
case "end":
|
|
370
|
-
return _context2.stop();
|
|
371
|
-
}
|
|
372
|
-
}, _callee2, this, [[1, 6]]);
|
|
373
|
-
}));
|
|
374
|
-
function save() {
|
|
375
|
-
return _save.apply(this, arguments);
|
|
376
|
-
}
|
|
377
|
-
return save;
|
|
378
|
-
}()
|
|
379
|
-
}, {
|
|
380
|
-
key: "_markAllFieldsDirty",
|
|
381
|
-
value: function () {
|
|
382
|
-
for (var _i = 0, _Object$entries = (0, _entries.default)(this.attributes); _i < _Object$entries.length; _i++) {
|
|
383
|
-
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
384
|
-
key = _Object$entries$_i[0],
|
|
385
|
-
value = _Object$entries$_i[1];
|
|
386
|
-
this.set(key, value);
|
|
191
|
+
/**
|
|
192
|
+
* Returns the device types for used for Push Notifications.
|
|
193
|
+
*
|
|
194
|
+
* <pre>
|
|
195
|
+
* Parse.Installation.DEVICE_TYPES.IOS
|
|
196
|
+
* Parse.Installation.DEVICE_TYPES.MACOS
|
|
197
|
+
* Parse.Installation.DEVICE_TYPES.TVOS
|
|
198
|
+
* Parse.Installation.DEVICE_TYPES.FCM
|
|
199
|
+
* Parse.Installation.DEVICE_TYPES.ANDROID
|
|
200
|
+
* Parse.Installation.DEVICE_TYPES.WEB
|
|
201
|
+
* </pre
|
|
202
|
+
*
|
|
203
|
+
* @property {object} DEVICE_TYPES
|
|
204
|
+
* @static
|
|
205
|
+
* @returns {object}
|
|
206
|
+
*/
|
|
207
|
+
static get DEVICE_TYPES() {
|
|
208
|
+
return DEVICE_TYPES;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* Wrap the default fetch behavior with functionality to update local storage.
|
|
213
|
+
* If the installation is deleted on the server, retry the fetch as a save operation.
|
|
214
|
+
*
|
|
215
|
+
* @param {...any} args
|
|
216
|
+
* @returns {Promise}
|
|
217
|
+
*/
|
|
218
|
+
async fetch() {
|
|
219
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
220
|
+
args[_key] = arguments[_key];
|
|
221
|
+
}
|
|
222
|
+
try {
|
|
223
|
+
await super.fetch.apply(this, args);
|
|
224
|
+
} catch (e) {
|
|
225
|
+
if (e.code !== _ParseError.default.OBJECT_NOT_FOUND) {
|
|
226
|
+
throw e;
|
|
387
227
|
}
|
|
228
|
+
// The installation was deleted from the server.
|
|
229
|
+
// We always want fetch to succeed.
|
|
230
|
+
delete this.id;
|
|
231
|
+
this._getId(); // Generate localId
|
|
232
|
+
this._markAllFieldsDirty();
|
|
233
|
+
await super.save.apply(this, args);
|
|
388
234
|
}
|
|
235
|
+
await _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
389
238
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
*/
|
|
401
|
-
}], [{
|
|
402
|
-
key: "DEVICE_TYPES",
|
|
403
|
-
get: function () /*: DeviceInterface*/{
|
|
404
|
-
return DEVICE_TYPES;
|
|
239
|
+
/**
|
|
240
|
+
* Wrap the default save behavior with functionality to update the local storage.
|
|
241
|
+
* If the installation is deleted on the server, retry saving a new installation.
|
|
242
|
+
*
|
|
243
|
+
* @param {...any} args
|
|
244
|
+
* @returns {Promise}
|
|
245
|
+
*/
|
|
246
|
+
async save() {
|
|
247
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
248
|
+
args[_key2] = arguments[_key2];
|
|
405
249
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
250
|
+
try {
|
|
251
|
+
await super.save.apply(this, args);
|
|
252
|
+
} catch (e) {
|
|
253
|
+
if (e.code !== _ParseError.default.OBJECT_NOT_FOUND) {
|
|
254
|
+
throw e;
|
|
255
|
+
}
|
|
256
|
+
// The installation was deleted from the server.
|
|
257
|
+
// We always want save to succeed.
|
|
258
|
+
delete this.id;
|
|
259
|
+
this._getId(); // Generate localId
|
|
260
|
+
this._markAllFieldsDirty();
|
|
261
|
+
await super.save.apply(this, args);
|
|
410
262
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
}
|
|
414
|
-
|
|
263
|
+
await _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
|
|
264
|
+
return this;
|
|
265
|
+
}
|
|
266
|
+
_markAllFieldsDirty() {
|
|
267
|
+
for (const [key, value] of (0, _entries.default)(this.attributes)) {
|
|
268
|
+
this.set(key, value);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Get the current Parse.Installation from disk. If doesn't exists, create an new installation.
|
|
274
|
+
*
|
|
275
|
+
* <pre>
|
|
276
|
+
* const installation = await Parse.Installation.currentInstallation();
|
|
277
|
+
* installation.set('deviceToken', '123');
|
|
278
|
+
* await installation.save();
|
|
279
|
+
* </pre>
|
|
280
|
+
*
|
|
281
|
+
* @returns {Promise} A promise that resolves to the local installation object.
|
|
282
|
+
*/
|
|
283
|
+
static currentInstallation() {
|
|
284
|
+
return _CoreManager.default.getInstallationController().currentInstallation();
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
_ParseObject.default.registerSubclass('_Installation', ParseInstallation);
|
|
415
288
|
module.exports = ParseInstallation;
|
|
416
|
-
var _default = ParseInstallation;
|
|
417
|
-
exports.default = _default;
|
|
289
|
+
var _default = exports.default = ParseInstallation;
|