parse 5.2.0-alpha.1 → 5.2.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 +10519 -15246
- package/dist/parse.min.js +2 -2
- package/dist/parse.weapp.js +10499 -15371
- 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 +23 -41
- 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 -485
- package/lib/browser/LiveQuerySubscription.js +25 -28
- package/lib/browser/LocalDatastore.js +258 -624
- package/lib/browser/LocalDatastoreController.default.js +42 -226
- package/lib/browser/LocalDatastoreController.js +11 -1
- package/lib/browser/LocalDatastoreController.react-native.js +66 -160
- package/lib/browser/LocalDatastoreUtils.js +4 -7
- package/lib/browser/ObjectStateMutations.js +54 -96
- package/lib/browser/OfflineQuery.js +106 -198
- package/lib/browser/Parse.js +44 -60
- package/lib/browser/ParseACL.js +242 -288
- package/lib/browser/ParseCLP.js +372 -572
- package/lib/browser/ParseConfig.js +115 -138
- package/lib/browser/ParseError.js +85 -182
- package/lib/browser/ParseFile.js +294 -438
- package/lib/browser/ParseGeoPoint.js +121 -146
- package/lib/browser/ParseHooks.js +23 -25
- package/lib/browser/ParseInstallation.js +225 -367
- package/lib/browser/ParseLiveQuery.js +74 -148
- package/lib/browser/ParseObject.js +2014 -2621
- package/lib/browser/ParseOp.js +343 -484
- package/lib/browser/ParsePolygon.js +101 -120
- package/lib/browser/ParseQuery.js +1708 -2052
- package/lib/browser/ParseRelation.js +99 -118
- package/lib/browser/ParseRole.js +88 -140
- package/lib/browser/ParseSchema.js +372 -434
- package/lib/browser/ParseSession.js +62 -110
- package/lib/browser/ParseUser.js +941 -1284
- package/lib/browser/Push.js +15 -38
- 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 +31 -43
- 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 +5 -9
- package/lib/node/AnonymousUtils.js +10 -15
- package/lib/node/Cloud.js +11 -11
- 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 +20 -39
- package/lib/node/FacebookUtils.js +4 -8
- package/lib/node/IndexedDBStorageController.js +14 -10
- package/lib/node/InstallationController.js +12 -13
- package/lib/node/LiveQueryClient.js +23 -21
- package/lib/node/LiveQuerySubscription.js +6 -7
- package/lib/node/LocalDatastore.js +23 -23
- package/lib/node/LocalDatastoreController.default.js +11 -12
- package/lib/node/LocalDatastoreController.js +14 -1
- package/lib/node/LocalDatastoreController.react-native.js +25 -21
- package/lib/node/LocalDatastoreUtils.js +4 -7
- package/lib/node/ObjectStateMutations.js +12 -22
- package/lib/node/OfflineQuery.js +37 -23
- package/lib/node/Parse.js +36 -50
- package/lib/node/ParseACL.js +21 -30
- package/lib/node/ParseCLP.js +38 -40
- package/lib/node/ParseConfig.js +10 -17
- package/lib/node/ParseError.js +460 -461
- package/lib/node/ParseFile.js +27 -47
- package/lib/node/ParseGeoPoint.js +16 -17
- package/lib/node/ParseHooks.js +16 -18
- package/lib/node/ParseInstallation.js +10 -11
- package/lib/node/ParseLiveQuery.js +9 -14
- package/lib/node/ParseObject.js +142 -173
- package/lib/node/ParseOp.js +35 -47
- package/lib/node/ParsePolygon.js +14 -20
- package/lib/node/ParseQuery.js +100 -123
- package/lib/node/ParseRelation.js +10 -19
- package/lib/node/ParseRole.js +10 -11
- package/lib/node/ParseSchema.js +29 -42
- package/lib/node/ParseSession.js +10 -11
- package/lib/node/ParseUser.js +76 -87
- package/lib/node/Push.js +7 -12
- package/lib/node/RESTController.js +24 -36
- package/lib/node/SingleInstanceStateController.js +41 -69
- package/lib/node/Socket.weapp.js +23 -2
- package/lib/node/Storage.js +14 -19
- 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 +20 -20
- package/lib/node/StorageController.weapp.js +14 -8
- package/lib/node/TaskQueue.js +2 -3
- package/lib/node/UniqueInstanceStateController.js +43 -63
- package/lib/node/WebSocketController.js +15 -2
- package/lib/node/Xhr.weapp.js +11 -2
- package/lib/node/arrayContainsObject.js +4 -4
- package/lib/node/canBeSerialized.js +5 -5
- package/lib/node/decode.js +4 -4
- package/lib/node/encode.js +5 -5
- package/lib/node/equals.js +4 -4
- 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 +5 -5
- package/lib/node/unsavedChildren.js +5 -5
- 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/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 +8 -7
- package/lib/react-native/LiveQuerySubscription.js +2 -4
- package/lib/react-native/LocalDatastore.js +3 -3
- package/lib/react-native/LocalDatastoreController.default.js +1 -2
- package/lib/react-native/LocalDatastoreController.js +11 -1
- package/lib/react-native/LocalDatastoreController.react-native.js +11 -12
- package/lib/react-native/LocalDatastoreUtils.js +3 -6
- 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 +2 -4
- package/lib/react-native/ParseConfig.js +4 -6
- package/lib/react-native/ParseError.js +13 -31
- package/lib/react-native/ParseFile.js +3 -4
- 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 +77 -87
- package/lib/react-native/ParseOp.js +41 -79
- package/lib/react-native/ParsePolygon.js +2 -4
- package/lib/react-native/ParseQuery.js +43 -45
- package/lib/react-native/ParseRelation.js +2 -4
- package/lib/react-native/ParseRole.js +13 -30
- package/lib/react-native/ParseSchema.js +3 -5
- package/lib/react-native/ParseSession.js +12 -29
- package/lib/react-native/ParseUser.js +24 -49
- 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 +2 -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 +23 -41
- 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 -485
- package/lib/weapp/LiveQuerySubscription.js +25 -28
- package/lib/weapp/LocalDatastore.js +258 -624
- package/lib/weapp/LocalDatastoreController.default.js +42 -226
- package/lib/weapp/LocalDatastoreController.js +11 -1
- package/lib/weapp/LocalDatastoreController.react-native.js +66 -160
- package/lib/weapp/LocalDatastoreUtils.js +4 -7
- package/lib/weapp/ObjectStateMutations.js +54 -96
- package/lib/weapp/OfflineQuery.js +106 -198
- package/lib/weapp/Parse.js +44 -59
- package/lib/weapp/ParseACL.js +242 -288
- package/lib/weapp/ParseCLP.js +372 -572
- package/lib/weapp/ParseConfig.js +115 -138
- package/lib/weapp/ParseError.js +85 -182
- package/lib/weapp/ParseFile.js +295 -440
- package/lib/weapp/ParseGeoPoint.js +121 -146
- package/lib/weapp/ParseHooks.js +23 -25
- package/lib/weapp/ParseInstallation.js +225 -367
- package/lib/weapp/ParseLiveQuery.js +74 -148
- package/lib/weapp/ParseObject.js +2014 -2621
- package/lib/weapp/ParseOp.js +343 -484
- package/lib/weapp/ParsePolygon.js +101 -120
- package/lib/weapp/ParseQuery.js +1708 -2052
- package/lib/weapp/ParseRelation.js +99 -118
- package/lib/weapp/ParseRole.js +88 -140
- package/lib/weapp/ParseSchema.js +372 -434
- package/lib/weapp/ParseSession.js +62 -110
- package/lib/weapp/ParseUser.js +941 -1284
- package/lib/weapp/Push.js +15 -38
- 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 +31 -43
- 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 +24 -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
|
/**
|
|
@@ -91,341 +50,240 @@ var ParseInstallation = /*#__PURE__*/function (_ParseObject) {
|
|
|
91
50
|
* @static
|
|
92
51
|
* @returns {string}
|
|
93
52
|
*/
|
|
94
|
-
(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return this.get('appIdentifier');
|
|
98
|
-
}
|
|
53
|
+
get appIdentifier() {
|
|
54
|
+
return this.get('appIdentifier');
|
|
55
|
+
}
|
|
99
56
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
return this.get('appVersion');
|
|
111
|
-
}
|
|
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
|
+
}
|
|
112
67
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
return this.get('appName');
|
|
124
|
-
}
|
|
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
|
+
}
|
|
125
78
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
return this.get('badge');
|
|
139
|
-
}
|
|
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
|
+
}
|
|
140
91
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return this.get('channels');
|
|
152
|
-
}
|
|
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
|
+
}
|
|
153
102
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return this.get('deviceToken');
|
|
165
|
-
}
|
|
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
|
+
}
|
|
166
113
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return this.get('deviceType');
|
|
178
|
-
}
|
|
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
|
+
}
|
|
179
124
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return this.get('GCMSenderId');
|
|
191
|
-
}
|
|
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
|
+
}
|
|
192
135
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return this.get('installationId');
|
|
204
|
-
}
|
|
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
|
+
}
|
|
205
146
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
return this.get('localeIdentifier');
|
|
217
|
-
}
|
|
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
|
+
}
|
|
218
157
|
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
return this.get('parseVersion');
|
|
230
|
-
}
|
|
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
|
+
}
|
|
231
168
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
return this.get('pushType');
|
|
243
|
-
}
|
|
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
|
+
}
|
|
244
179
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
return this.get('timeZone');
|
|
256
|
-
}
|
|
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
|
+
}
|
|
257
190
|
|
|
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
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
args[_key] = _args[_key];
|
|
295
|
-
}
|
|
296
|
-
_context.prev = 1;
|
|
297
|
-
_context.next = 4;
|
|
298
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "fetch", this).apply(this, args);
|
|
299
|
-
case 4:
|
|
300
|
-
_context.next = 15;
|
|
301
|
-
break;
|
|
302
|
-
case 6:
|
|
303
|
-
_context.prev = 6;
|
|
304
|
-
_context.t0 = _context["catch"](1);
|
|
305
|
-
if (!(_context.t0.code !== _ParseError.default.OBJECT_NOT_FOUND)) {
|
|
306
|
-
_context.next = 10;
|
|
307
|
-
break;
|
|
308
|
-
}
|
|
309
|
-
throw _context.t0;
|
|
310
|
-
case 10:
|
|
311
|
-
// The installation was deleted from the server.
|
|
312
|
-
// We always want fetch to succeed.
|
|
313
|
-
delete this.id;
|
|
314
|
-
this._getId(); // Generate localId
|
|
315
|
-
this._markAllFieldsDirty();
|
|
316
|
-
_context.next = 15;
|
|
317
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "save", this).apply(this, args);
|
|
318
|
-
case 15:
|
|
319
|
-
_context.next = 17;
|
|
320
|
-
return _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
|
|
321
|
-
case 17:
|
|
322
|
-
return _context.abrupt("return", this);
|
|
323
|
-
case 18:
|
|
324
|
-
case "end":
|
|
325
|
-
return _context.stop();
|
|
326
|
-
}
|
|
327
|
-
}, _callee, this, [[1, 6]]);
|
|
328
|
-
}));
|
|
329
|
-
function fetch() {
|
|
330
|
-
return _fetch.apply(this, arguments);
|
|
331
|
-
}
|
|
332
|
-
return fetch;
|
|
333
|
-
}()
|
|
334
|
-
/**
|
|
335
|
-
* Wrap the default save behavior with functionality to update the local storage.
|
|
336
|
-
* If the installation is deleted on the server, retry saving a new installation.
|
|
337
|
-
*
|
|
338
|
-
* @param {...any} args
|
|
339
|
-
* @returns {Promise}
|
|
340
|
-
*/
|
|
341
|
-
}, {
|
|
342
|
-
key: "save",
|
|
343
|
-
value: function () {
|
|
344
|
-
var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
345
|
-
var _len2,
|
|
346
|
-
args,
|
|
347
|
-
_key2,
|
|
348
|
-
_args2 = arguments;
|
|
349
|
-
return _regenerator.default.wrap(function (_context2) {
|
|
350
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
351
|
-
case 0:
|
|
352
|
-
for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
353
|
-
args[_key2] = _args2[_key2];
|
|
354
|
-
}
|
|
355
|
-
_context2.prev = 1;
|
|
356
|
-
_context2.next = 4;
|
|
357
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "save", this).apply(this, args);
|
|
358
|
-
case 4:
|
|
359
|
-
_context2.next = 15;
|
|
360
|
-
break;
|
|
361
|
-
case 6:
|
|
362
|
-
_context2.prev = 6;
|
|
363
|
-
_context2.t0 = _context2["catch"](1);
|
|
364
|
-
if (!(_context2.t0.code !== _ParseError.default.OBJECT_NOT_FOUND)) {
|
|
365
|
-
_context2.next = 10;
|
|
366
|
-
break;
|
|
367
|
-
}
|
|
368
|
-
throw _context2.t0;
|
|
369
|
-
case 10:
|
|
370
|
-
// The installation was deleted from the server.
|
|
371
|
-
// We always want save to succeed.
|
|
372
|
-
delete this.id;
|
|
373
|
-
this._getId(); // Generate localId
|
|
374
|
-
this._markAllFieldsDirty();
|
|
375
|
-
_context2.next = 15;
|
|
376
|
-
return (0, _get2.default)((0, _getPrototypeOf2.default)(ParseInstallation.prototype), "save", this).apply(this, args);
|
|
377
|
-
case 15:
|
|
378
|
-
_context2.next = 17;
|
|
379
|
-
return _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
|
|
380
|
-
case 17:
|
|
381
|
-
return _context2.abrupt("return", this);
|
|
382
|
-
case 18:
|
|
383
|
-
case "end":
|
|
384
|
-
return _context2.stop();
|
|
385
|
-
}
|
|
386
|
-
}, _callee2, this, [[1, 6]]);
|
|
387
|
-
}));
|
|
388
|
-
function save() {
|
|
389
|
-
return _save.apply(this, arguments);
|
|
390
|
-
}
|
|
391
|
-
return save;
|
|
392
|
-
}()
|
|
393
|
-
}, {
|
|
394
|
-
key: "_markAllFieldsDirty",
|
|
395
|
-
value: function () {
|
|
396
|
-
for (var _i = 0, _Object$entries = (0, _entries.default)(this.attributes); _i < _Object$entries.length; _i++) {
|
|
397
|
-
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
|
|
398
|
-
key = _Object$entries$_i[0],
|
|
399
|
-
value = _Object$entries$_i[1];
|
|
400
|
-
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;
|
|
401
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);
|
|
402
234
|
}
|
|
235
|
+
await _CoreManager.default.getInstallationController().updateInstallationOnDisk(this);
|
|
236
|
+
return this;
|
|
237
|
+
}
|
|
403
238
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
*/
|
|
415
|
-
}], [{
|
|
416
|
-
key: "DEVICE_TYPES",
|
|
417
|
-
get: function () /*: DeviceInterface*/{
|
|
418
|
-
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];
|
|
419
249
|
}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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);
|
|
424
262
|
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
}
|
|
428
|
-
|
|
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);
|
|
429
288
|
module.exports = ParseInstallation;
|
|
430
|
-
var _default = ParseInstallation;
|
|
431
|
-
exports.default = _default;
|
|
289
|
+
var _default = exports.default = ParseInstallation;
|