parse 3.3.2-alpha.1 → 3.4.0-alpha.1

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.
@@ -224,7 +224,7 @@ var config
224
224
  SERVER_AUTH_TOKEN: null,
225
225
  LIVEQUERY_SERVER_URL: null,
226
226
  ENCRYPTED_KEY: null,
227
- VERSION: 'js' + "3.3.2-alpha.1",
227
+ VERSION: 'js' + "3.4.0-alpha.1",
228
228
  APPLICATION_ID: null,
229
229
  JAVASCRIPT_KEY: null,
230
230
  MASTER_KEY: null,
@@ -116,8 +116,6 @@ var Parse = {
116
116
  }
117
117
 
118
118
  Parse._initialize(applicationId, javaScriptKey);
119
-
120
- _EventuallyQueue.default.poll();
121
119
  },
122
120
  _initialize: function (applicationId
123
121
  /*: string*/
@@ -372,14 +370,32 @@ Parse._getInstallationId = function () {
372
370
  };
373
371
  /**
374
372
  * Enable pinning in your application.
375
- * This must be called before your application can use pinning.
373
+ * This must be called after `Parse.initialize` in your application.
376
374
  *
375
+ * @param [polling] Allow pinging the server /health endpoint. Default true
376
+ * @param [ms] Milliseconds to ping the server. Default 2000ms
377
377
  * @static
378
378
  */
379
379
 
380
380
 
381
381
  Parse.enableLocalDatastore = function () {
382
- Parse.LocalDatastore.isEnabled = true;
382
+ var polling = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
383
+ var ms
384
+ /*: number*/
385
+ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;
386
+
387
+ if (!Parse.applicationId) {
388
+ console.log("'enableLocalDataStore' must be called after 'initialize'");
389
+ return;
390
+ }
391
+
392
+ if (!Parse.LocalDatastore.isEnabled) {
393
+ Parse.LocalDatastore.isEnabled = true;
394
+
395
+ if (polling) {
396
+ _EventuallyQueue.default.poll(ms);
397
+ }
398
+ }
383
399
  };
384
400
  /**
385
401
  * Flag that indicates whether Local Datastore is enabled.
@@ -217,7 +217,7 @@ const config
217
217
  SERVER_AUTH_TOKEN: null,
218
218
  LIVEQUERY_SERVER_URL: null,
219
219
  ENCRYPTED_KEY: null,
220
- VERSION: 'js' + "3.3.2-alpha.1",
220
+ VERSION: 'js' + "3.4.0-alpha.1",
221
221
  APPLICATION_ID: null,
222
222
  JAVASCRIPT_KEY: null,
223
223
  MASTER_KEY: null,
package/lib/node/Parse.js CHANGED
@@ -105,8 +105,6 @@ const Parse = {
105
105
  /*: string*/
106
106
  ) {
107
107
  Parse._initialize(applicationId, javaScriptKey);
108
-
109
- _EventuallyQueue.default.poll();
110
108
  },
111
109
 
112
110
  _initialize(applicationId
@@ -354,14 +352,29 @@ Parse._getInstallationId = function () {
354
352
  };
355
353
  /**
356
354
  * Enable pinning in your application.
357
- * This must be called before your application can use pinning.
355
+ * This must be called after `Parse.initialize` in your application.
358
356
  *
357
+ * @param [polling] Allow pinging the server /health endpoint. Default true
358
+ * @param [ms] Milliseconds to ping the server. Default 2000ms
359
359
  * @static
360
360
  */
361
361
 
362
362
 
363
- Parse.enableLocalDatastore = function () {
364
- Parse.LocalDatastore.isEnabled = true;
363
+ Parse.enableLocalDatastore = function (polling = true, ms
364
+ /*: number*/
365
+ = 2000) {
366
+ if (!Parse.applicationId) {
367
+ console.log("'enableLocalDataStore' must be called after 'initialize'");
368
+ return;
369
+ }
370
+
371
+ if (!Parse.LocalDatastore.isEnabled) {
372
+ Parse.LocalDatastore.isEnabled = true;
373
+
374
+ if (polling) {
375
+ _EventuallyQueue.default.poll(ms);
376
+ }
377
+ }
365
378
  };
366
379
  /**
367
380
  * Flag that indicates whether Local Datastore is enabled.
@@ -8,7 +8,7 @@ var config = {
8
8
  SERVER_AUTH_TOKEN: null,
9
9
  LIVEQUERY_SERVER_URL: null,
10
10
  ENCRYPTED_KEY: null,
11
- VERSION: 'js' + "3.3.2-alpha.1",
11
+ VERSION: 'js' + "3.4.0-alpha.1",
12
12
  APPLICATION_ID: null,
13
13
  JAVASCRIPT_KEY: null,
14
14
  MASTER_KEY: null,
@@ -69,8 +69,6 @@ function _interopRequireWildcard(obj, nodeInterop) {
69
69
  var Parse = {
70
70
  initialize: function (applicationId, javaScriptKey) {
71
71
  Parse._initialize(applicationId, javaScriptKey);
72
-
73
- _EventuallyQueue.default.poll();
74
72
  },
75
73
  _initialize: function (applicationId, javaScriptKey, masterKey) {
76
74
  _CoreManager.default.set('APPLICATION_ID', applicationId);
@@ -246,7 +244,21 @@ Parse._getInstallationId = function () {
246
244
  };
247
245
 
248
246
  Parse.enableLocalDatastore = function () {
249
- Parse.LocalDatastore.isEnabled = true;
247
+ var polling = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
248
+ var ms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;
249
+
250
+ if (!Parse.applicationId) {
251
+ console.log("'enableLocalDataStore' must be called after 'initialize'");
252
+ return;
253
+ }
254
+
255
+ if (!Parse.LocalDatastore.isEnabled) {
256
+ Parse.LocalDatastore.isEnabled = true;
257
+
258
+ if (polling) {
259
+ _EventuallyQueue.default.poll(ms);
260
+ }
261
+ }
250
262
  };
251
263
 
252
264
  Parse.isLocalDatastoreEnabled = function () {
@@ -224,7 +224,7 @@ var config
224
224
  SERVER_AUTH_TOKEN: null,
225
225
  LIVEQUERY_SERVER_URL: null,
226
226
  ENCRYPTED_KEY: null,
227
- VERSION: 'js' + "3.3.2-alpha.1",
227
+ VERSION: 'js' + "3.4.0-alpha.1",
228
228
  APPLICATION_ID: null,
229
229
  JAVASCRIPT_KEY: null,
230
230
  MASTER_KEY: null,
@@ -110,8 +110,6 @@ var Parse = {
110
110
  /*: string*/
111
111
  ) {
112
112
  Parse._initialize(applicationId, javaScriptKey);
113
-
114
- _EventuallyQueue.default.poll();
115
113
  },
116
114
  _initialize: function (applicationId
117
115
  /*: string*/
@@ -366,14 +364,32 @@ Parse._getInstallationId = function () {
366
364
  };
367
365
  /**
368
366
  * Enable pinning in your application.
369
- * This must be called before your application can use pinning.
367
+ * This must be called after `Parse.initialize` in your application.
370
368
  *
369
+ * @param [polling] Allow pinging the server /health endpoint. Default true
370
+ * @param [ms] Milliseconds to ping the server. Default 2000ms
371
371
  * @static
372
372
  */
373
373
 
374
374
 
375
375
  Parse.enableLocalDatastore = function () {
376
- Parse.LocalDatastore.isEnabled = true;
376
+ var polling = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
377
+ var ms
378
+ /*: number*/
379
+ = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2000;
380
+
381
+ if (!Parse.applicationId) {
382
+ console.log("'enableLocalDataStore' must be called after 'initialize'");
383
+ return;
384
+ }
385
+
386
+ if (!Parse.LocalDatastore.isEnabled) {
387
+ Parse.LocalDatastore.isEnabled = true;
388
+
389
+ if (polling) {
390
+ _EventuallyQueue.default.poll(ms);
391
+ }
392
+ }
377
393
  };
378
394
  /**
379
395
  * Flag that indicates whether Local Datastore is enabled.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "parse",
3
- "version": "3.3.2-alpha.1",
3
+ "version": "3.4.0-alpha.1",
4
4
  "description": "The Parse JavaScript SDK",
5
5
  "homepage": "https://parseplatform.org/",
6
6
  "keywords": [