Skip to content

Commit

Permalink
merge 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
davimacedo committed Jan 18, 2024
1 parent e20793a commit 8321bbc
Show file tree
Hide file tree
Showing 253 changed files with 117,887 additions and 33,340 deletions.
45,148 changes: 30,760 additions & 14,388 deletions dist/parse.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/parse.min.js

Large diffs are not rendered by default.

35,862 changes: 35,862 additions & 0 deletions dist/parse.weapp.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions dist/parse.weapp.min.js

Large diffs are not rendered by default.

67 changes: 35 additions & 32 deletions lib/browser/Analytics.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

_Object$defineProperty(exports, "__esModule", {
value: true
});

exports.track = track;

var _CoreManager = _interopRequireDefault(require("./CoreManager"));
Expand All @@ -29,36 +32,36 @@ var _CoreManager = _interopRequireDefault(require("./CoreManager"));
*/

/**
* Tracks the occurrence of a custom event with additional dimensions.
* Parse will store a data point at the time of invocation with the given
* event name.
*
* Dimensions will allow segmentation of the occurrences of this custom
* event. Keys and values should be {@code String}s, and will throw
* otherwise.
*
* To track a user signup along with additional metadata, consider the
* following:
* <pre>
* var dimensions = {
* gender: 'm',
* source: 'web',
* dayType: 'weekend'
* };
* Parse.Analytics.track('signup', dimensions);
* </pre>
*
* There is a default limit of 8 dimensions per event tracked.
*
* @method track
* @name Parse.Analytics.track
* @param {String} name The name of the custom event to report to Parse as
* having happened.
* @param {Object} dimensions The dictionary of information by which to
* segment this event.
* @return {Promise} A promise that is resolved when the round-trip
* to the server completes.
*/
* Tracks the occurrence of a custom event with additional dimensions.
* Parse will store a data point at the time of invocation with the given
* event name.
*
* Dimensions will allow segmentation of the occurrences of this custom
* event. Keys and values should be {@code String}s, and will throw
* otherwise.
*
* To track a user signup along with additional metadata, consider the
* following:
* <pre>
* var dimensions = {
* gender: 'm',
* source: 'web',
* dayType: 'weekend'
* };
* Parse.Analytics.track('signup', dimensions);
* </pre>
*
* There is a default limit of 8 dimensions per event tracked.
*
* @function track
* @name Parse.Analytics.track
* @param {string} name The name of the custom event to report to Parse as
* having happened.
* @param {object} dimensions The dictionary of information by which to
* segment this event.
* @returns {Promise} A promise that is resolved when the round-trip
* to the server completes.
*/


function track(name
Expand Down
54 changes: 41 additions & 13 deletions lib/browser/AnonymousUtils.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

_Object$defineProperty(exports, "__esModule", {
value: true
});

exports.default = void 0;

var _ParseUser = _interopRequireDefault(require("./ParseUser"));
Expand All @@ -20,7 +23,7 @@ var _ParseUser = _interopRequireDefault(require("./ParseUser"));
*/


var uuidv4 = require('uuid/v4');
var uuidv4 = require('./uuid');

var registered = false;
/**
Expand All @@ -47,6 +50,7 @@ var registered = false;
* <li>Service linking (e.g. Facebook, Twitter) will convert the anonymous user
* into a standard user by linking it to the service.</li>
* </ul>
*
* @class Parse.AnonymousUtils
* @static
*/
Expand All @@ -55,11 +59,11 @@ var AnonymousUtils = {
/**
* Gets whether the user has their account linked to anonymous user.
*
* @method isLinked
* @function isLinked
* @name Parse.AnonymousUtils.isLinked
* @param {Parse.User} user User to check for.
* The user must be logged in on this device.
* @return {Boolean} <code>true</code> if the user has their account
* @returns {boolean} <code>true</code> if the user has their account
* linked to an anonymous user.
* @static
*/
Expand All @@ -74,32 +78,56 @@ var AnonymousUtils = {
/**
* Logs in a user Anonymously.
*
* @method logIn
* @function logIn
* @name Parse.AnonymousUtils.logIn
* @returns {Promise}
* @param {object} options MasterKey / SessionToken.
* @returns {Promise} Logged in user
* @static
*/
logIn: function () {
logIn: function (options
/*:: ?: RequestOptions*/
)
/*: Promise<ParseUser>*/
{
var provider = this._getAuthProvider();

return _ParseUser.default._logInWith(provider.getAuthType(), provider.getAuthData());
return _ParseUser.default.logInWith(provider.getAuthType(), provider.getAuthData(), options);
},

/**
* Links Anonymous User to an existing PFUser.
*
* @method link
* @function link
* @name Parse.AnonymousUtils.link
* @param {Parse.User} user User to link. This must be the current user.
* @returns {Promise}
* @param {object} options MasterKey / SessionToken.
* @returns {Promise} Linked with User
* @static
*/
link: function (user
/*: ParseUser*/
) {
, options
/*:: ?: RequestOptions*/
)
/*: Promise<ParseUser>*/
{
var provider = this._getAuthProvider();

return user._linkWith(provider.getAuthType(), provider.getAuthData());
return user.linkWith(provider.getAuthType(), provider.getAuthData(), options);
},

/**
* Returns true if Authentication Provider has been registered for use.
*
* @function isRegistered
* @name Parse.AnonymousUtils.isRegistered
* @returns {boolean}
* @static
*/
isRegistered: function ()
/*: boolean*/
{
return registered;
},
_getAuthProvider: function () {
var provider = {
Expand Down
89 changes: 52 additions & 37 deletions lib/browser/Cloud.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

_Object$defineProperty(exports, "__esModule", {
value: true
});
exports.run = run;

exports.getJobStatus = getJobStatus;
exports.getJobsData = getJobsData;
exports.run = run;
exports.startJob = startJob;
exports.getJobStatus = getJobStatus;

var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));

var _keys = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/object/keys"));

var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/typeof"));

var _CoreManager = _interopRequireDefault(require("./CoreManager"));

Expand Down Expand Up @@ -47,15 +54,16 @@ var _ParseObject = _interopRequireDefault(require("./ParseObject"));
*/

/**
* Makes a call to a cloud function.
* @method run
* @name Parse.Cloud.run
* @param {String} name The function name.
* @param {Object} data The parameters to send to the cloud function.
* @param {Object} options
* @return {Promise} A promise that will be resolved with the result
* of the function.
*/
* Makes a call to a cloud function.
*
* @function run
* @name Parse.Cloud.run
* @param {string} name The function name.
* @param {object} data The parameters to send to the cloud function.
* @param {object} options
* @returns {Promise} A promise that will be resolved with the result
* of the function.
*/


function run(name
Expand Down Expand Up @@ -83,15 +91,20 @@ function run(name
requestOptions.sessionToken = options.sessionToken;
}

if (options.context && (0, _typeof2.default)(options.context) === 'object') {
requestOptions.context = options.context;
}

return _CoreManager.default.getCloudController().run(name, data, requestOptions);
}
/**
* Gets data for the current set of cloud jobs.
* @method getJobsData
* @name Parse.Cloud.getJobsData
* @return {Promise} A promise that will be resolved with the result
* of the function.
*/
* Gets data for the current set of cloud jobs.
*
* @function getJobsData
* @name Parse.Cloud.getJobsData
* @returns {Promise} A promise that will be resolved with the result
* of the function.
*/


function getJobsData()
Expand All @@ -102,14 +115,15 @@ function getJobsData()
});
}
/**
* Starts a given cloud job, which will process asynchronously.
* @method startJob
* @name Parse.Cloud.startJob
* @param {String} name The function name.
* @param {Object} data The parameters to send to the cloud function.
* @return {Promise} A promise that will be resolved with the jobStatusId
* of the job.
*/
* Starts a given cloud job, which will process asynchronously.
*
* @function startJob
* @name Parse.Cloud.startJob
* @param {string} name The function name.
* @param {object} data The parameters to send to the cloud function.
* @returns {Promise} A promise that will be resolved with the jobStatusId
* of the job.
*/


function startJob(name
Expand All @@ -128,12 +142,13 @@ function startJob(name
});
}
/**
* Gets job status by Id
* @method getJobStatus
* @name Parse.Cloud.getJobStatus
* @param {String} jobStatusId The Id of Job Status.
* @return {Parse.Object} Status of Job.
*/
* Gets job status by Id
*
* @function getJobStatus
* @name Parse.Cloud.getJobStatus
* @param {string} jobStatusId The Id of Job Status.
* @returns {Parse.Object} Status of Job.
*/


function getJobStatus(jobStatusId
Expand All @@ -156,17 +171,17 @@ var DefaultController = {
var payload = (0, _encode.default)(data, true);
var request = RESTController.request('POST', 'functions/' + name, payload, options);
return request.then(function (res) {
if ((0, _typeof2.default)(res) === 'object' && Object.keys(res).length > 0 && !res.hasOwnProperty('result')) {
if ((0, _typeof2.default)(res) === 'object' && (0, _keys.default)(res).length > 0 && !res.hasOwnProperty('result')) {
throw new _ParseError.default(_ParseError.default.INVALID_JSON, 'The server returned an invalid response.');
}

var decoded = (0, _decode.default)(res);

if (decoded && decoded.hasOwnProperty('result')) {
return Promise.resolve(decoded.result);
return _promise.default.resolve(decoded.result);
}

return Promise.resolve(undefined);
return _promise.default.resolve(undefined);
});
},
getJobsData: function (options
Expand Down
Loading

0 comments on commit 8321bbc

Please sign in to comment.