triggers.js 118 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.Types = void 0;
  6. exports._unregisterAll = _unregisterAll;
  7. exports.addConnectTrigger = addConnectTrigger;
  8. exports.addFunction = addFunction;
  9. exports.addJob = addJob;
  10. exports.addLiveQueryEventHandler = addLiveQueryEventHandler;
  11. exports.addTrigger = addTrigger;
  12. exports.getClassName = getClassName;
  13. exports.getFunction = getFunction;
  14. exports.getFunctionNames = getFunctionNames;
  15. exports.getJob = getJob;
  16. exports.getJobs = getJobs;
  17. exports.getRequestFileObject = getRequestFileObject;
  18. exports.getRequestObject = getRequestObject;
  19. exports.getRequestQueryObject = getRequestQueryObject;
  20. exports.getResponseObject = getResponseObject;
  21. exports.getTrigger = getTrigger;
  22. exports.getValidator = getValidator;
  23. exports.inflate = inflate;
  24. exports.maybeRunAfterFindTrigger = maybeRunAfterFindTrigger;
  25. exports.maybeRunFileTrigger = maybeRunFileTrigger;
  26. exports.maybeRunGlobalConfigTrigger = maybeRunGlobalConfigTrigger;
  27. exports.maybeRunQueryTrigger = maybeRunQueryTrigger;
  28. exports.maybeRunTrigger = maybeRunTrigger;
  29. exports.maybeRunValidator = maybeRunValidator;
  30. exports.removeFunction = removeFunction;
  31. exports.removeTrigger = removeTrigger;
  32. exports.resolveError = resolveError;
  33. exports.runLiveQueryEventHandlers = runLiveQueryEventHandlers;
  34. exports.runTrigger = runTrigger;
  35. exports.toJSONwithObjects = toJSONwithObjects;
  36. exports.triggerExists = triggerExists;
  37. var _node = _interopRequireDefault(require("parse/node"));
  38. var _logger = require("./logger");
  39. function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
  40. function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
  41. function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
  42. function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
  43. function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
  44. function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // triggers.js
  45. const Types = exports.Types = {
  46. beforeLogin: 'beforeLogin',
  47. afterLogin: 'afterLogin',
  48. afterLogout: 'afterLogout',
  49. beforeSave: 'beforeSave',
  50. afterSave: 'afterSave',
  51. beforeDelete: 'beforeDelete',
  52. afterDelete: 'afterDelete',
  53. beforeFind: 'beforeFind',
  54. afterFind: 'afterFind',
  55. beforeConnect: 'beforeConnect',
  56. beforeSubscribe: 'beforeSubscribe',
  57. afterEvent: 'afterEvent'
  58. };
  59. const ConnectClassName = '@Connect';
  60. const baseStore = function () {
  61. const Validators = Object.keys(Types).reduce(function (base, key) {
  62. base[key] = {};
  63. return base;
  64. }, {});
  65. const Functions = {};
  66. const Jobs = {};
  67. const LiveQuery = [];
  68. const Triggers = Object.keys(Types).reduce(function (base, key) {
  69. base[key] = {};
  70. return base;
  71. }, {});
  72. return Object.freeze({
  73. Functions,
  74. Jobs,
  75. Validators,
  76. Triggers,
  77. LiveQuery
  78. });
  79. };
  80. function getClassName(parseClass) {
  81. if (parseClass && parseClass.className) {
  82. return parseClass.className;
  83. }
  84. if (parseClass && parseClass.name) {
  85. return parseClass.name.replace('Parse', '@');
  86. }
  87. return parseClass;
  88. }
  89. function validateClassNameForTriggers(className, type) {
  90. if (type == Types.beforeSave && className === '_PushStatus') {
  91. // _PushStatus uses undocumented nested key increment ops
  92. // allowing beforeSave would mess up the objects big time
  93. // TODO: Allow proper documented way of using nested increment ops
  94. throw 'Only afterSave is allowed on _PushStatus';
  95. }
  96. if ((type === Types.beforeLogin || type === Types.afterLogin) && className !== '_User') {
  97. // TODO: check if upstream code will handle `Error` instance rather
  98. // than this anti-pattern of throwing strings
  99. throw 'Only the _User class is allowed for the beforeLogin and afterLogin triggers';
  100. }
  101. if (type === Types.afterLogout && className !== '_Session') {
  102. // TODO: check if upstream code will handle `Error` instance rather
  103. // than this anti-pattern of throwing strings
  104. throw 'Only the _Session class is allowed for the afterLogout trigger.';
  105. }
  106. if (className === '_Session' && type !== Types.afterLogout) {
  107. // TODO: check if upstream code will handle `Error` instance rather
  108. // than this anti-pattern of throwing strings
  109. throw 'Only the afterLogout trigger is allowed for the _Session class.';
  110. }
  111. return className;
  112. }
  113. const _triggerStore = {};
  114. const Category = {
  115. Functions: 'Functions',
  116. Validators: 'Validators',
  117. Jobs: 'Jobs',
  118. Triggers: 'Triggers'
  119. };
  120. function getStore(category, name, applicationId) {
  121. const invalidNameRegex = /['"`]/;
  122. if (invalidNameRegex.test(name)) {
  123. // Prevent a malicious user from injecting properties into the store
  124. return {};
  125. }
  126. const path = name.split('.');
  127. path.splice(-1); // remove last component
  128. applicationId = applicationId || _node.default.applicationId;
  129. _triggerStore[applicationId] = _triggerStore[applicationId] || baseStore();
  130. let store = _triggerStore[applicationId][category];
  131. for (const component of path) {
  132. store = store[component];
  133. if (!store) {
  134. return {};
  135. }
  136. }
  137. return store;
  138. }
  139. function add(category, name, handler, applicationId) {
  140. const lastComponent = name.split('.').splice(-1);
  141. const store = getStore(category, name, applicationId);
  142. if (store[lastComponent]) {
  143. _logger.logger.warn(`Warning: Duplicate cloud functions exist for ${lastComponent}. Only the last one will be used and the others will be ignored.`);
  144. }
  145. store[lastComponent] = handler;
  146. }
  147. function remove(category, name, applicationId) {
  148. const lastComponent = name.split('.').splice(-1);
  149. const store = getStore(category, name, applicationId);
  150. delete store[lastComponent];
  151. }
  152. function get(category, name, applicationId) {
  153. const lastComponent = name.split('.').splice(-1);
  154. const store = getStore(category, name, applicationId);
  155. return store[lastComponent];
  156. }
  157. function addFunction(functionName, handler, validationHandler, applicationId) {
  158. add(Category.Functions, functionName, handler, applicationId);
  159. add(Category.Validators, functionName, validationHandler, applicationId);
  160. }
  161. function addJob(jobName, handler, applicationId) {
  162. add(Category.Jobs, jobName, handler, applicationId);
  163. }
  164. function addTrigger(type, className, handler, applicationId, validationHandler) {
  165. validateClassNameForTriggers(className, type);
  166. add(Category.Triggers, `${type}.${className}`, handler, applicationId);
  167. add(Category.Validators, `${type}.${className}`, validationHandler, applicationId);
  168. }
  169. function addConnectTrigger(type, handler, applicationId, validationHandler) {
  170. add(Category.Triggers, `${type}.${ConnectClassName}`, handler, applicationId);
  171. add(Category.Validators, `${type}.${ConnectClassName}`, validationHandler, applicationId);
  172. }
  173. function addLiveQueryEventHandler(handler, applicationId) {
  174. applicationId = applicationId || _node.default.applicationId;
  175. _triggerStore[applicationId] = _triggerStore[applicationId] || baseStore();
  176. _triggerStore[applicationId].LiveQuery.push(handler);
  177. }
  178. function removeFunction(functionName, applicationId) {
  179. remove(Category.Functions, functionName, applicationId);
  180. }
  181. function removeTrigger(type, className, applicationId) {
  182. remove(Category.Triggers, `${type}.${className}`, applicationId);
  183. }
  184. function _unregisterAll() {
  185. Object.keys(_triggerStore).forEach(appId => delete _triggerStore[appId]);
  186. }
  187. function toJSONwithObjects(object, className) {
  188. if (!object || !object.toJSON) {
  189. return {};
  190. }
  191. const toJSON = object.toJSON();
  192. const stateController = _node.default.CoreManager.getObjectStateController();
  193. const [pending] = stateController.getPendingOps(object._getStateIdentifier());
  194. for (const key in pending) {
  195. const val = object.get(key);
  196. if (!val || !val._toFullJSON) {
  197. toJSON[key] = val;
  198. continue;
  199. }
  200. toJSON[key] = val._toFullJSON();
  201. }
  202. if (className) {
  203. toJSON.className = className;
  204. }
  205. return toJSON;
  206. }
  207. function getTrigger(className, triggerType, applicationId) {
  208. if (!applicationId) {
  209. throw 'Missing ApplicationID';
  210. }
  211. return get(Category.Triggers, `${triggerType}.${className}`, applicationId);
  212. }
  213. async function runTrigger(trigger, name, request, auth) {
  214. if (!trigger) {
  215. return;
  216. }
  217. await maybeRunValidator(request, name, auth);
  218. if (request.skipWithMasterKey) {
  219. return;
  220. }
  221. return await trigger(request);
  222. }
  223. function triggerExists(className, type, applicationId) {
  224. return getTrigger(className, type, applicationId) != undefined;
  225. }
  226. function getFunction(functionName, applicationId) {
  227. return get(Category.Functions, functionName, applicationId);
  228. }
  229. function getFunctionNames(applicationId) {
  230. const store = _triggerStore[applicationId] && _triggerStore[applicationId][Category.Functions] || {};
  231. const functionNames = [];
  232. const extractFunctionNames = (namespace, store) => {
  233. Object.keys(store).forEach(name => {
  234. const value = store[name];
  235. if (namespace) {
  236. name = `${namespace}.${name}`;
  237. }
  238. if (typeof value === 'function') {
  239. functionNames.push(name);
  240. } else {
  241. extractFunctionNames(name, value);
  242. }
  243. });
  244. };
  245. extractFunctionNames(null, store);
  246. return functionNames;
  247. }
  248. function getJob(jobName, applicationId) {
  249. return get(Category.Jobs, jobName, applicationId);
  250. }
  251. function getJobs(applicationId) {
  252. var manager = _triggerStore[applicationId];
  253. if (manager && manager.Jobs) {
  254. return manager.Jobs;
  255. }
  256. return undefined;
  257. }
  258. function getValidator(functionName, applicationId) {
  259. return get(Category.Validators, functionName, applicationId);
  260. }
  261. function getRequestObject(triggerType, auth, parseObject, originalParseObject, config, context) {
  262. const request = {
  263. triggerName: triggerType,
  264. object: parseObject,
  265. master: false,
  266. log: config.loggerController,
  267. headers: config.headers,
  268. ip: config.ip
  269. };
  270. if (originalParseObject) {
  271. request.original = originalParseObject;
  272. }
  273. if (triggerType === Types.beforeSave || triggerType === Types.afterSave || triggerType === Types.beforeDelete || triggerType === Types.afterDelete || triggerType === Types.beforeLogin || triggerType === Types.afterLogin || triggerType === Types.afterFind) {
  274. // Set a copy of the context on the request object.
  275. request.context = Object.assign({}, context);
  276. }
  277. if (!auth) {
  278. return request;
  279. }
  280. if (auth.isMaster) {
  281. request['master'] = true;
  282. }
  283. if (auth.user) {
  284. request['user'] = auth.user;
  285. }
  286. if (auth.installationId) {
  287. request['installationId'] = auth.installationId;
  288. }
  289. return request;
  290. }
  291. function getRequestQueryObject(triggerType, auth, query, count, config, context, isGet) {
  292. isGet = !!isGet;
  293. var request = {
  294. triggerName: triggerType,
  295. query,
  296. master: false,
  297. count,
  298. log: config.loggerController,
  299. isGet,
  300. headers: config.headers,
  301. ip: config.ip,
  302. context: context || {}
  303. };
  304. if (!auth) {
  305. return request;
  306. }
  307. if (auth.isMaster) {
  308. request['master'] = true;
  309. }
  310. if (auth.user) {
  311. request['user'] = auth.user;
  312. }
  313. if (auth.installationId) {
  314. request['installationId'] = auth.installationId;
  315. }
  316. return request;
  317. }
  318. // Creates the response object, and uses the request object to pass data
  319. // The API will call this with REST API formatted objects, this will
  320. // transform them to Parse.Object instances expected by Cloud Code.
  321. // Any changes made to the object in a beforeSave will be included.
  322. function getResponseObject(request, resolve, reject) {
  323. return {
  324. success: function (response) {
  325. if (request.triggerName === Types.afterFind) {
  326. if (!response) {
  327. response = request.objects;
  328. }
  329. response = response.map(object => {
  330. return toJSONwithObjects(object);
  331. });
  332. return resolve(response);
  333. }
  334. // Use the JSON response
  335. if (response && typeof response === 'object' && !request.object.equals(response) && request.triggerName === Types.beforeSave) {
  336. return resolve(response);
  337. }
  338. if (response && typeof response === 'object' && request.triggerName === Types.afterSave) {
  339. return resolve(response);
  340. }
  341. if (request.triggerName === Types.afterSave) {
  342. return resolve();
  343. }
  344. response = {};
  345. if (request.triggerName === Types.beforeSave) {
  346. response['object'] = request.object._getSaveJSON();
  347. response['object']['objectId'] = request.object.id;
  348. }
  349. return resolve(response);
  350. },
  351. error: function (error) {
  352. const e = resolveError(error, {
  353. code: _node.default.Error.SCRIPT_FAILED,
  354. message: 'Script failed. Unknown error.'
  355. });
  356. reject(e);
  357. }
  358. };
  359. }
  360. function userIdForLog(auth) {
  361. return auth && auth.user ? auth.user.id : undefined;
  362. }
  363. function logTriggerAfterHook(triggerType, className, input, auth, logLevel) {
  364. if (logLevel === 'silent') {
  365. return;
  366. }
  367. const cleanInput = _logger.logger.truncateLogMessage(JSON.stringify(input));
  368. _logger.logger[logLevel](`${triggerType} triggered for ${className} for user ${userIdForLog(auth)}:\n Input: ${cleanInput}`, {
  369. className,
  370. triggerType,
  371. user: userIdForLog(auth)
  372. });
  373. }
  374. function logTriggerSuccessBeforeHook(triggerType, className, input, result, auth, logLevel) {
  375. if (logLevel === 'silent') {
  376. return;
  377. }
  378. const cleanInput = _logger.logger.truncateLogMessage(JSON.stringify(input));
  379. const cleanResult = _logger.logger.truncateLogMessage(JSON.stringify(result));
  380. _logger.logger[logLevel](`${triggerType} triggered for ${className} for user ${userIdForLog(auth)}:\n Input: ${cleanInput}\n Result: ${cleanResult}`, {
  381. className,
  382. triggerType,
  383. user: userIdForLog(auth)
  384. });
  385. }
  386. function logTriggerErrorBeforeHook(triggerType, className, input, auth, error, logLevel) {
  387. if (logLevel === 'silent') {
  388. return;
  389. }
  390. const cleanInput = _logger.logger.truncateLogMessage(JSON.stringify(input));
  391. _logger.logger[logLevel](`${triggerType} failed for ${className} for user ${userIdForLog(auth)}:\n Input: ${cleanInput}\n Error: ${JSON.stringify(error)}`, {
  392. className,
  393. triggerType,
  394. error,
  395. user: userIdForLog(auth)
  396. });
  397. }
  398. function maybeRunAfterFindTrigger(triggerType, auth, className, objects, config, query, context) {
  399. return new Promise((resolve, reject) => {
  400. const trigger = getTrigger(className, triggerType, config.applicationId);
  401. if (!trigger) {
  402. return resolve();
  403. }
  404. const request = getRequestObject(triggerType, auth, null, null, config, context);
  405. if (query) {
  406. request.query = query;
  407. }
  408. const {
  409. success,
  410. error
  411. } = getResponseObject(request, object => {
  412. resolve(object);
  413. }, error => {
  414. reject(error);
  415. });
  416. logTriggerSuccessBeforeHook(triggerType, className, 'AfterFind', JSON.stringify(objects), auth, config.logLevels.triggerBeforeSuccess);
  417. request.objects = objects.map(object => {
  418. //setting the class name to transform into parse object
  419. object.className = className;
  420. return _node.default.Object.fromJSON(object);
  421. });
  422. return Promise.resolve().then(() => {
  423. return maybeRunValidator(request, `${triggerType}.${className}`, auth);
  424. }).then(() => {
  425. if (request.skipWithMasterKey) {
  426. return request.objects;
  427. }
  428. const response = trigger(request);
  429. if (response && typeof response.then === 'function') {
  430. return response.then(results => {
  431. return results;
  432. });
  433. }
  434. return response;
  435. }).then(success, error);
  436. }).then(results => {
  437. logTriggerAfterHook(triggerType, className, JSON.stringify(results), auth, config.logLevels.triggerAfter);
  438. return results;
  439. });
  440. }
  441. function maybeRunQueryTrigger(triggerType, className, restWhere, restOptions, config, auth, context, isGet) {
  442. const trigger = getTrigger(className, triggerType, config.applicationId);
  443. if (!trigger) {
  444. return Promise.resolve({
  445. restWhere,
  446. restOptions
  447. });
  448. }
  449. const json = Object.assign({}, restOptions);
  450. json.where = restWhere;
  451. const parseQuery = new _node.default.Query(className);
  452. parseQuery.withJSON(json);
  453. let count = false;
  454. if (restOptions) {
  455. count = !!restOptions.count;
  456. }
  457. const requestObject = getRequestQueryObject(triggerType, auth, parseQuery, count, config, context, isGet);
  458. return Promise.resolve().then(() => {
  459. return maybeRunValidator(requestObject, `${triggerType}.${className}`, auth);
  460. }).then(() => {
  461. if (requestObject.skipWithMasterKey) {
  462. return requestObject.query;
  463. }
  464. return trigger(requestObject);
  465. }).then(result => {
  466. let queryResult = parseQuery;
  467. if (result && result instanceof _node.default.Query) {
  468. queryResult = result;
  469. }
  470. const jsonQuery = queryResult.toJSON();
  471. if (jsonQuery.where) {
  472. restWhere = jsonQuery.where;
  473. }
  474. if (jsonQuery.limit) {
  475. restOptions = restOptions || {};
  476. restOptions.limit = jsonQuery.limit;
  477. }
  478. if (jsonQuery.skip) {
  479. restOptions = restOptions || {};
  480. restOptions.skip = jsonQuery.skip;
  481. }
  482. if (jsonQuery.include) {
  483. restOptions = restOptions || {};
  484. restOptions.include = jsonQuery.include;
  485. }
  486. if (jsonQuery.excludeKeys) {
  487. restOptions = restOptions || {};
  488. restOptions.excludeKeys = jsonQuery.excludeKeys;
  489. }
  490. if (jsonQuery.explain) {
  491. restOptions = restOptions || {};
  492. restOptions.explain = jsonQuery.explain;
  493. }
  494. if (jsonQuery.keys) {
  495. restOptions = restOptions || {};
  496. restOptions.keys = jsonQuery.keys;
  497. }
  498. if (jsonQuery.order) {
  499. restOptions = restOptions || {};
  500. restOptions.order = jsonQuery.order;
  501. }
  502. if (jsonQuery.hint) {
  503. restOptions = restOptions || {};
  504. restOptions.hint = jsonQuery.hint;
  505. }
  506. if (jsonQuery.comment) {
  507. restOptions = restOptions || {};
  508. restOptions.comment = jsonQuery.comment;
  509. }
  510. if (requestObject.readPreference) {
  511. restOptions = restOptions || {};
  512. restOptions.readPreference = requestObject.readPreference;
  513. }
  514. if (requestObject.includeReadPreference) {
  515. restOptions = restOptions || {};
  516. restOptions.includeReadPreference = requestObject.includeReadPreference;
  517. }
  518. if (requestObject.subqueryReadPreference) {
  519. restOptions = restOptions || {};
  520. restOptions.subqueryReadPreference = requestObject.subqueryReadPreference;
  521. }
  522. return {
  523. restWhere,
  524. restOptions
  525. };
  526. }, err => {
  527. const error = resolveError(err, {
  528. code: _node.default.Error.SCRIPT_FAILED,
  529. message: 'Script failed. Unknown error.'
  530. });
  531. throw error;
  532. });
  533. }
  534. function resolveError(message, defaultOpts) {
  535. if (!defaultOpts) {
  536. defaultOpts = {};
  537. }
  538. if (!message) {
  539. return new _node.default.Error(defaultOpts.code || _node.default.Error.SCRIPT_FAILED, defaultOpts.message || 'Script failed.');
  540. }
  541. if (message instanceof _node.default.Error) {
  542. return message;
  543. }
  544. const code = defaultOpts.code || _node.default.Error.SCRIPT_FAILED;
  545. // If it's an error, mark it as a script failed
  546. if (typeof message === 'string') {
  547. return new _node.default.Error(code, message);
  548. }
  549. const error = new _node.default.Error(code, message.message || message);
  550. if (message instanceof Error) {
  551. error.stack = message.stack;
  552. }
  553. return error;
  554. }
  555. function maybeRunValidator(request, functionName, auth) {
  556. const theValidator = getValidator(functionName, _node.default.applicationId);
  557. if (!theValidator) {
  558. return;
  559. }
  560. if (typeof theValidator === 'object' && theValidator.skipWithMasterKey && request.master) {
  561. request.skipWithMasterKey = true;
  562. }
  563. return new Promise((resolve, reject) => {
  564. return Promise.resolve().then(() => {
  565. return typeof theValidator === 'object' ? builtInTriggerValidator(theValidator, request, auth) : theValidator(request);
  566. }).then(() => {
  567. resolve();
  568. }).catch(e => {
  569. const error = resolveError(e, {
  570. code: _node.default.Error.VALIDATION_ERROR,
  571. message: 'Validation failed.'
  572. });
  573. reject(error);
  574. });
  575. });
  576. }
  577. async function builtInTriggerValidator(options, request, auth) {
  578. if (request.master && !options.validateMasterKey) {
  579. return;
  580. }
  581. let reqUser = request.user;
  582. if (!reqUser && request.object && request.object.className === '_User' && !request.object.existed()) {
  583. reqUser = request.object;
  584. }
  585. if ((options.requireUser || options.requireAnyUserRoles || options.requireAllUserRoles) && !reqUser) {
  586. throw 'Validation failed. Please login to continue.';
  587. }
  588. if (options.requireMaster && !request.master) {
  589. throw 'Validation failed. Master key is required to complete this request.';
  590. }
  591. let params = request.params || {};
  592. if (request.object) {
  593. params = request.object.toJSON();
  594. }
  595. const requiredParam = key => {
  596. const value = params[key];
  597. if (value == null) {
  598. throw `Validation failed. Please specify data for ${key}.`;
  599. }
  600. };
  601. const validateOptions = async (opt, key, val) => {
  602. let opts = opt.options;
  603. if (typeof opts === 'function') {
  604. try {
  605. const result = await opts(val);
  606. if (!result && result != null) {
  607. throw opt.error || `Validation failed. Invalid value for ${key}.`;
  608. }
  609. } catch (e) {
  610. if (!e) {
  611. throw opt.error || `Validation failed. Invalid value for ${key}.`;
  612. }
  613. throw opt.error || e.message || e;
  614. }
  615. return;
  616. }
  617. if (!Array.isArray(opts)) {
  618. opts = [opt.options];
  619. }
  620. if (!opts.includes(val)) {
  621. throw opt.error || `Validation failed. Invalid option for ${key}. Expected: ${opts.join(', ')}`;
  622. }
  623. };
  624. const getType = fn => {
  625. const match = fn && fn.toString().match(/^\s*function (\w+)/);
  626. return (match ? match[1] : '').toLowerCase();
  627. };
  628. if (Array.isArray(options.fields)) {
  629. for (const key of options.fields) {
  630. requiredParam(key);
  631. }
  632. } else {
  633. const optionPromises = [];
  634. for (const key in options.fields) {
  635. const opt = options.fields[key];
  636. let val = params[key];
  637. if (typeof opt === 'string') {
  638. requiredParam(opt);
  639. }
  640. if (typeof opt === 'object') {
  641. if (opt.default != null && val == null) {
  642. val = opt.default;
  643. params[key] = val;
  644. if (request.object) {
  645. request.object.set(key, val);
  646. }
  647. }
  648. if (opt.constant && request.object) {
  649. if (request.original) {
  650. request.object.revert(key);
  651. } else if (opt.default != null) {
  652. request.object.set(key, opt.default);
  653. }
  654. }
  655. if (opt.required) {
  656. requiredParam(key);
  657. }
  658. const optional = !opt.required && val === undefined;
  659. if (!optional) {
  660. if (opt.type) {
  661. const type = getType(opt.type);
  662. const valType = Array.isArray(val) ? 'array' : typeof val;
  663. if (valType !== type) {
  664. throw `Validation failed. Invalid type for ${key}. Expected: ${type}`;
  665. }
  666. }
  667. if (opt.options) {
  668. optionPromises.push(validateOptions(opt, key, val));
  669. }
  670. }
  671. }
  672. }
  673. await Promise.all(optionPromises);
  674. }
  675. let userRoles = options.requireAnyUserRoles;
  676. let requireAllRoles = options.requireAllUserRoles;
  677. const promises = [Promise.resolve(), Promise.resolve(), Promise.resolve()];
  678. if (userRoles || requireAllRoles) {
  679. promises[0] = auth.getUserRoles();
  680. }
  681. if (typeof userRoles === 'function') {
  682. promises[1] = userRoles();
  683. }
  684. if (typeof requireAllRoles === 'function') {
  685. promises[2] = requireAllRoles();
  686. }
  687. const [roles, resolvedUserRoles, resolvedRequireAll] = await Promise.all(promises);
  688. if (resolvedUserRoles && Array.isArray(resolvedUserRoles)) {
  689. userRoles = resolvedUserRoles;
  690. }
  691. if (resolvedRequireAll && Array.isArray(resolvedRequireAll)) {
  692. requireAllRoles = resolvedRequireAll;
  693. }
  694. if (userRoles) {
  695. const hasRole = userRoles.some(requiredRole => roles.includes(`role:${requiredRole}`));
  696. if (!hasRole) {
  697. throw `Validation failed. User does not match the required roles.`;
  698. }
  699. }
  700. if (requireAllRoles) {
  701. for (const requiredRole of requireAllRoles) {
  702. if (!roles.includes(`role:${requiredRole}`)) {
  703. throw `Validation failed. User does not match all the required roles.`;
  704. }
  705. }
  706. }
  707. const userKeys = options.requireUserKeys || [];
  708. if (Array.isArray(userKeys)) {
  709. for (const key of userKeys) {
  710. if (!reqUser) {
  711. throw 'Please login to make this request.';
  712. }
  713. if (reqUser.get(key) == null) {
  714. throw `Validation failed. Please set data for ${key} on your account.`;
  715. }
  716. }
  717. } else if (typeof userKeys === 'object') {
  718. const optionPromises = [];
  719. for (const key in options.requireUserKeys) {
  720. const opt = options.requireUserKeys[key];
  721. if (opt.options) {
  722. optionPromises.push(validateOptions(opt, key, reqUser.get(key)));
  723. }
  724. }
  725. await Promise.all(optionPromises);
  726. }
  727. }
  728. // To be used as part of the promise chain when saving/deleting an object
  729. // Will resolve successfully if no trigger is configured
  730. // Resolves to an object, empty or containing an object key. A beforeSave
  731. // trigger will set the object key to the rest format object to save.
  732. // originalParseObject is optional, we only need that for before/afterSave functions
  733. function maybeRunTrigger(triggerType, auth, parseObject, originalParseObject, config, context) {
  734. if (!parseObject) {
  735. return Promise.resolve({});
  736. }
  737. return new Promise(function (resolve, reject) {
  738. var trigger = getTrigger(parseObject.className, triggerType, config.applicationId);
  739. if (!trigger) return resolve();
  740. var request = getRequestObject(triggerType, auth, parseObject, originalParseObject, config, context);
  741. var {
  742. success,
  743. error
  744. } = getResponseObject(request, object => {
  745. logTriggerSuccessBeforeHook(triggerType, parseObject.className, parseObject.toJSON(), object, auth, triggerType.startsWith('after') ? config.logLevels.triggerAfter : config.logLevels.triggerBeforeSuccess);
  746. if (triggerType === Types.beforeSave || triggerType === Types.afterSave || triggerType === Types.beforeDelete || triggerType === Types.afterDelete) {
  747. Object.assign(context, request.context);
  748. }
  749. resolve(object);
  750. }, error => {
  751. logTriggerErrorBeforeHook(triggerType, parseObject.className, parseObject.toJSON(), auth, error, config.logLevels.triggerBeforeError);
  752. reject(error);
  753. });
  754. // AfterSave and afterDelete triggers can return a promise, which if they
  755. // do, needs to be resolved before this promise is resolved,
  756. // so trigger execution is synced with RestWrite.execute() call.
  757. // If triggers do not return a promise, they can run async code parallel
  758. // to the RestWrite.execute() call.
  759. return Promise.resolve().then(() => {
  760. return maybeRunValidator(request, `${triggerType}.${parseObject.className}`, auth);
  761. }).then(() => {
  762. if (request.skipWithMasterKey) {
  763. return Promise.resolve();
  764. }
  765. const promise = trigger(request);
  766. if (triggerType === Types.afterSave || triggerType === Types.afterDelete || triggerType === Types.afterLogin) {
  767. logTriggerAfterHook(triggerType, parseObject.className, parseObject.toJSON(), auth, config.logLevels.triggerAfter);
  768. }
  769. // beforeSave is expected to return null (nothing)
  770. if (triggerType === Types.beforeSave) {
  771. if (promise && typeof promise.then === 'function') {
  772. return promise.then(response => {
  773. // response.object may come from express routing before hook
  774. if (response && response.object) {
  775. return response;
  776. }
  777. return null;
  778. });
  779. }
  780. return null;
  781. }
  782. return promise;
  783. }).then(success, error);
  784. });
  785. }
  786. // Converts a REST-format object to a Parse.Object
  787. // data is either className or an object
  788. function inflate(data, restObject) {
  789. var copy = typeof data == 'object' ? data : {
  790. className: data
  791. };
  792. for (var key in restObject) {
  793. copy[key] = restObject[key];
  794. }
  795. return _node.default.Object.fromJSON(copy);
  796. }
  797. function runLiveQueryEventHandlers(data, applicationId = _node.default.applicationId) {
  798. if (!_triggerStore || !_triggerStore[applicationId] || !_triggerStore[applicationId].LiveQuery) {
  799. return;
  800. }
  801. _triggerStore[applicationId].LiveQuery.forEach(handler => handler(data));
  802. }
  803. function getRequestFileObject(triggerType, auth, fileObject, config) {
  804. const request = _objectSpread(_objectSpread({}, fileObject), {}, {
  805. triggerName: triggerType,
  806. master: false,
  807. log: config.loggerController,
  808. headers: config.headers,
  809. ip: config.ip
  810. });
  811. if (!auth) {
  812. return request;
  813. }
  814. if (auth.isMaster) {
  815. request['master'] = true;
  816. }
  817. if (auth.user) {
  818. request['user'] = auth.user;
  819. }
  820. if (auth.installationId) {
  821. request['installationId'] = auth.installationId;
  822. }
  823. return request;
  824. }
  825. async function maybeRunFileTrigger(triggerType, fileObject, config, auth) {
  826. const FileClassName = getClassName(_node.default.File);
  827. const fileTrigger = getTrigger(FileClassName, triggerType, config.applicationId);
  828. if (typeof fileTrigger === 'function') {
  829. try {
  830. const request = getRequestFileObject(triggerType, auth, fileObject, config);
  831. await maybeRunValidator(request, `${triggerType}.${FileClassName}`, auth);
  832. if (request.skipWithMasterKey) {
  833. return fileObject;
  834. }
  835. const result = await fileTrigger(request);
  836. logTriggerSuccessBeforeHook(triggerType, 'Parse.File', _objectSpread(_objectSpread({}, fileObject.file.toJSON()), {}, {
  837. fileSize: fileObject.fileSize
  838. }), result, auth, config.logLevels.triggerBeforeSuccess);
  839. return result || fileObject;
  840. } catch (error) {
  841. logTriggerErrorBeforeHook(triggerType, 'Parse.File', _objectSpread(_objectSpread({}, fileObject.file.toJSON()), {}, {
  842. fileSize: fileObject.fileSize
  843. }), auth, error, config.logLevels.triggerBeforeError);
  844. throw error;
  845. }
  846. }
  847. return fileObject;
  848. }
  849. async function maybeRunGlobalConfigTrigger(triggerType, auth, configObject, originalConfigObject, config, context) {
  850. const GlobalConfigClassName = getClassName(_node.default.Config);
  851. const configTrigger = getTrigger(GlobalConfigClassName, triggerType, config.applicationId);
  852. if (typeof configTrigger === 'function') {
  853. try {
  854. const request = getRequestObject(triggerType, auth, configObject, originalConfigObject, config, context);
  855. await maybeRunValidator(request, `${triggerType}.${GlobalConfigClassName}`, auth);
  856. if (request.skipWithMasterKey) {
  857. return configObject;
  858. }
  859. const result = await configTrigger(request);
  860. logTriggerSuccessBeforeHook(triggerType, 'Parse.Config', configObject, result, auth, config.logLevels.triggerBeforeSuccess);
  861. return result || configObject;
  862. } catch (error) {
  863. logTriggerErrorBeforeHook(triggerType, 'Parse.Config', configObject, auth, error, config.logLevels.triggerBeforeError);
  864. throw error;
  865. }
  866. }
  867. return configObject;
  868. }
  869. //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJfbm9kZSIsIl9pbnRlcm9wUmVxdWlyZURlZmF1bHQiLCJyZXF1aXJlIiwiX2xvZ2dlciIsImUiLCJfX2VzTW9kdWxlIiwiZGVmYXVsdCIsIm93bktleXMiLCJyIiwidCIsIk9iamVjdCIsImtleXMiLCJnZXRPd25Qcm9wZXJ0eVN5bWJvbHMiLCJvIiwiZmlsdGVyIiwiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yIiwiZW51bWVyYWJsZSIsInB1c2giLCJhcHBseSIsIl9vYmplY3RTcHJlYWQiLCJhcmd1bWVudHMiLCJsZW5ndGgiLCJmb3JFYWNoIiwiX2RlZmluZVByb3BlcnR5IiwiZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9ycyIsImRlZmluZVByb3BlcnRpZXMiLCJkZWZpbmVQcm9wZXJ0eSIsIl90b1Byb3BlcnR5S2V5IiwidmFsdWUiLCJjb25maWd1cmFibGUiLCJ3cml0YWJsZSIsImkiLCJfdG9QcmltaXRpdmUiLCJTeW1ib2wiLCJ0b1ByaW1pdGl2ZSIsImNhbGwiLCJUeXBlRXJyb3IiLCJTdHJpbmciLCJOdW1iZXIiLCJUeXBlcyIsImV4cG9ydHMiLCJiZWZvcmVMb2dpbiIsImFmdGVyTG9naW4iLCJhZnRlckxvZ291dCIsImJlZm9yZVNhdmUiLCJhZnRlclNhdmUiLCJiZWZvcmVEZWxldGUiLCJhZnRlckRlbGV0ZSIsImJlZm9yZUZpbmQiLCJhZnRlckZpbmQiLCJiZWZvcmVDb25uZWN0IiwiYmVmb3JlU3Vic2NyaWJlIiwiYWZ0ZXJFdmVudCIsIkNvbm5lY3RDbGFzc05hbWUiLCJiYXNlU3RvcmUiLCJWYWxpZGF0b3JzIiwicmVkdWNlIiwiYmFzZSIsImt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zdE9wdGlvbnMuaW5jbHVkZSA9IGpzb25RdWVyeS5pbmNsdWRlO1xuICAgICAgICB9XG4gICAgICAgIGlmIChqc29uUXVlcnkuZXhjbHVkZUtleXMpIHtcbiAgICAgICAgICByZXN0T3B0aW9ucyA9IHJlc3RPcHRpb25zIHx8IHt9O1xuICAgICAgICAgIHJlc3RPcHRpb25zLmV4Y2x1ZGVLZXlzID0ganNvblF1ZXJ5LmV4Y2x1ZGVLZXlzO1xuICAgICAgICB9XG4gICAgICAgIGlmIChqc29uUXVlcnkuZXhwbGFpbikge1xuICAgICAgICAgIHJlc3RPcHRpb25zID0gcmVzdE9wdGlvbnMgfHwge307XG4gICAgICAgICAgcmVzdE9wdGlvbnMuZXhwbGFpbiA9IGpzb25RdWVyeS5leHBsYWluO1xuICAgICAgICB9XG4gICAgICAgIGlmIChqc29uUXVlcnkua2V5cykge1xuICAgICAgICAgIHJlc3RPcHRpb25zID0gcmVzdE9wdGlvbnMgfHwge307XG4gICAgICAgICAgcmVzdE9wdGlvbnMua2V5cyA9IGpzb25RdWVyeS5rZXlzO1xuICAgICAgICB9XG4gICAgICAgIGlmIChqc29uUXVlcnkub3JkZXIpIHtcbiAgICAgICAgICByZXN0T3B0aW9ucyA9IHJlc3RPcHRpb25zIHx8IHt9O1xuICAgICAgICAgIHJlc3RPcHRpb25zLm9yZGVyID0ganNvblF1ZXJ5Lm9yZGVyO1xuICAgICAgICB9XG4gICAgICAgIGlmIChqc29uUXVlcnkuaGludCkge1xuICAgICAgICAgIHJlc3RPcHRpb25zID0gcmVzdE9wdGlvbnMgfHwge307XG4gICAgICAgICAgcmVzdE9wdGlvbnMuaGludCA9IGpzb25RdWVyeS5oaW50O1xuICAgICAgICB9XG4gICAgICAgIGlmIChqc29uUXVlcnkuY29tbWVudCkge1xuICAgICAgICAgIHJlc3RPcHRpb25zID0gcmVzdE9wdGlvbnMgfHwge307XG4gICAgICAgICAgcmVzdE9wdGlvbnMuY29tbWVudCA9IGpzb25RdWVyeS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ChyZXF1ZXN0Lm9yaWdpbmFsKSB7XG4gICAgICAgICAgICByZXF1ZXN0Lm9iamVjdC5yZXZlcnQoa2V5KTtcbiAgICAgICAgICB9IGVsc2UgaWYgKG9wdC5kZWZhdWx0ICE9IG51bGwpIHtcbiAgICAgICAgICAgIHJlcXVlc3Qub2JqZWN0LnNldChrZXksIG9wdC5kZWZhdWx0KTtcbiAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgaWYgKG9wdC5yZXF1aXJlZCkge1xuICAgICAgICAgIHJlcXVpcmVkUGFyYW0oa2V5KTtcbiAgICAgICAgfVxuICAgICAgICBjb25zdCBvcHRpb25hbCA9ICFvcHQucmVxdWlyZWQgJiYgdmFsID09PSB1bmRlZmluZWQ7XG4gICAgICAgIGlmICghb3B0aW9uYWwpIHtcbiAgICAgICAgICBpZiAob3B0LnR5cGUpIHtcbiAgICAgICAgICAgIGNvbnN0IHR5cGUgPSBnZXRUeXBlKG9wdC50eXBlKTtcbiAgICAgICAgICAgIGNvbnN0IHZhbFR5cGUgPSBBcnJheS5pc0FycmF5KHZhbCkgPyAnYXJyYXknIDogdHlwZW9mIHZhbDtcbiAgICAgICAgICAgIGlmICh2YWxUeXBlICE9PSB0eXBlKSB7XG4gICAgICAgICAgICAgIHRocm93IGBWYWxpZGF0aW9uIGZhaWxlZC4gSW52YWxpZCB0eXBlIGZvciAke2tleX0uIEV4cGVjdGVkOiAke3R5cGV9YDtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9XG4gICAgICAgICAgaWYgKG9wdC5vcHRpb25zKSB7XG4gICAgICAgICAgICBvcHRpb25Qcm9taXNlcy5wdXNoKHZhbGlkYXRlT3B0aW9ucyhvcHQsIGtleSwgdmFsKSk7XG4gICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICB9XG4gICAgfVxuICAgIGF3YWl0IFByb21pc2UuYWxsKG9wdGlvblByb21pc2VzKTtcbiAgfVxuICBsZXQgdXNlclJvbGVzID0gb3B0aW9ucy5y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