123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- "use strict";
- Object.defineProperty(exports, "__esModule", {
- value: true
- });
- exports.default = exports.HooksController = void 0;
- var triggers = _interopRequireWildcard(require("../triggers"));
- var Parse = _interopRequireWildcard(require("parse/node"));
- var _request = _interopRequireDefault(require("../request"));
- var _logger = require("../logger");
- var _http = _interopRequireDefault(require("http"));
- var _https = _interopRequireDefault(require("https"));
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
- // -disable-next
- // -disable-next
- const DefaultHooksCollectionName = '_Hooks';
- const HTTPAgents = {
- http: new _http.default.Agent({
- keepAlive: true
- }),
- https: new _https.default.Agent({
- keepAlive: true
- })
- };
- class HooksController {
- constructor(applicationId, databaseController, webhookKey) {
- this._applicationId = applicationId;
- this._webhookKey = webhookKey;
- this.database = databaseController;
- }
- load() {
- return this._getHooks().then(hooks => {
- hooks = hooks || [];
- hooks.forEach(hook => {
- this.addHookToTriggers(hook);
- });
- });
- }
- getFunction(functionName) {
- return this._getHooks({
- functionName: functionName
- }).then(results => results[0]);
- }
- getFunctions() {
- return this._getHooks({
- functionName: {
- $exists: true
- }
- });
- }
- getTrigger(className, triggerName) {
- return this._getHooks({
- className: className,
- triggerName: triggerName
- }).then(results => results[0]);
- }
- getTriggers() {
- return this._getHooks({
- className: {
- $exists: true
- },
- triggerName: {
- $exists: true
- }
- });
- }
- deleteFunction(functionName) {
- triggers.removeFunction(functionName, this._applicationId);
- return this._removeHooks({
- functionName: functionName
- });
- }
- deleteTrigger(className, triggerName) {
- triggers.removeTrigger(triggerName, className, this._applicationId);
- return this._removeHooks({
- className: className,
- triggerName: triggerName
- });
- }
- _getHooks(query = {}) {
- return this.database.find(DefaultHooksCollectionName, query).then(results => {
- return results.map(result => {
- delete result.objectId;
- return result;
- });
- });
- }
- _removeHooks(query) {
- return this.database.destroy(DefaultHooksCollectionName, query).then(() => {
- return Promise.resolve({});
- });
- }
- saveHook(hook) {
- var query;
- if (hook.functionName && hook.url) {
- query = {
- functionName: hook.functionName
- };
- } else if (hook.triggerName && hook.className && hook.url) {
- query = {
- className: hook.className,
- triggerName: hook.triggerName
- };
- } else {
- throw new Parse.Error(143, 'invalid hook declaration');
- }
- return this.database.update(DefaultHooksCollectionName, query, hook, {
- upsert: true
- }).then(() => {
- return Promise.resolve(hook);
- });
- }
- addHookToTriggers(hook) {
- var wrappedFunction = wrapToHTTPRequest(hook, this._webhookKey);
- wrappedFunction.url = hook.url;
- if (hook.className) {
- triggers.addTrigger(hook.triggerName, hook.className, wrappedFunction, this._applicationId);
- } else {
- triggers.addFunction(hook.functionName, wrappedFunction, null, this._applicationId);
- }
- }
- addHook(hook) {
- this.addHookToTriggers(hook);
- return this.saveHook(hook);
- }
- createOrUpdateHook(aHook) {
- var hook;
- if (aHook && aHook.functionName && aHook.url) {
- hook = {};
- hook.functionName = aHook.functionName;
- hook.url = aHook.url;
- } else if (aHook && aHook.className && aHook.url && aHook.triggerName && triggers.Types[aHook.triggerName]) {
- hook = {};
- hook.className = aHook.className;
- hook.url = aHook.url;
- hook.triggerName = aHook.triggerName;
- } else {
- throw new Parse.Error(143, 'invalid hook declaration');
- }
- return this.addHook(hook);
- }
- createHook(aHook) {
- if (aHook.functionName) {
- return this.getFunction(aHook.functionName).then(result => {
- if (result) {
- throw new Parse.Error(143, `function name: ${aHook.functionName} already exists`);
- } else {
- return this.createOrUpdateHook(aHook);
- }
- });
- } else if (aHook.className && aHook.triggerName) {
- return this.getTrigger(aHook.className, aHook.triggerName).then(result => {
- if (result) {
- throw new Parse.Error(143, `class ${aHook.className} already has trigger ${aHook.triggerName}`);
- }
- return this.createOrUpdateHook(aHook);
- });
- }
- throw new Parse.Error(143, 'invalid hook declaration');
- }
- updateHook(aHook) {
- if (aHook.functionName) {
- return this.getFunction(aHook.functionName).then(result => {
- if (result) {
- return this.createOrUpdateHook(aHook);
- }
- throw new Parse.Error(143, `no function named: ${aHook.functionName} is defined`);
- });
- } else if (aHook.className && aHook.triggerName) {
- return this.getTrigger(aHook.className, aHook.triggerName).then(result => {
- if (result) {
- return this.createOrUpdateHook(aHook);
- }
- throw new Parse.Error(143, `class ${aHook.className} does not exist`);
- });
- }
- throw new Parse.Error(143, 'invalid hook declaration');
- }
- }
- exports.HooksController = HooksController;
- function wrapToHTTPRequest(hook, key) {
- return req => {
- const jsonBody = {};
- for (var i in req) {
- jsonBody[i] = req[i];
- }
- if (req.object) {
- jsonBody.object = req.object.toJSON();
- jsonBody.object.className = req.object.className;
- }
- if (req.original) {
- jsonBody.original = req.original.toJSON();
- jsonBody.original.className = req.original.className;
- }
- const jsonRequest = {
- url: hook.url,
- headers: {
- 'Content-Type': 'application/json'
- },
- body: jsonBody,
- method: 'POST'
- };
- const agent = hook.url.startsWith('https') ? HTTPAgents['https'] : HTTPAgents['http'];
- jsonRequest.agent = agent;
- if (key) {
- jsonRequest.headers['X-Parse-Webhook-Key'] = key;
- } else {
- _logger.logger.warn('Making outgoing webhook request without webhookKey being set!');
- }
- return (0, _request.default)(jsonRequest).then(response => {
- let err;
- let result;
- let body = response.data;
- if (body) {
- if (typeof body === 'string') {
- try {
- body = JSON.parse(body);
- } catch (e) {
- err = {
- error: 'Malformed response',
- code: -1,
- partialResponse: body.substring(0, 100)
- };
- }
- }
- if (!err) {
- result = body.success;
- err = body.error;
- }
- }
- if (err) {
- throw err;
- } else if (hook.triggerName === 'beforeSave') {
- if (typeof result === 'object') {
- delete result.createdAt;
- delete result.updatedAt;
- delete result.className;
- }
- return {
- object: result
- };
- } else {
- return result;
- }
- });
- };
- }
- var _default = exports.default = HooksController;
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJ0cmlnZ2VycyIsIl9pbnRlcm9wUmVxdWlyZVdpbGRjYXJkIiwicmVxdWlyZSIsIlBhcnNlIiwiX3JlcXVlc3QiLCJfaW50ZXJvcFJlcXVpcmVEZWZhdWx0IiwiX2xvZ2dlciIsIl9odHRwIiwiX2h0dHBzIiwiZSIsIl9fZXNNb2R1bGUiLCJkZWZhdWx0IiwiX2dldFJlcXVpcmVXaWxkY2FyZENhY2hlIiwiV2Vha01hcCIsInIiLCJ0IiwiaGFzIiwiZ2V0IiwibiIsIl9fcHJvdG9fXyIsImEiLCJPYmplY3QiLCJkZWZpbmVQcm9wZXJ0eSIsImdldE93blByb3BlcnR5RGVzY3JpcHRvciIsInUiLCJoYXNPd25Qcm9wZXJ0eSIsImNhbGwiLCJpIiwic2V0IiwiRGVmYXVsdEhvb2tzQ29sbGVjdGlvbk5hbWUiLCJIVFRQQWdlbnRzIiwiaHR0cCIsIkFnZW50Iiwia2VlcEFsaXZlIiwiaHR0cHMiLCJIb29rc0NvbnRyb2xsZXIiLCJjb25zdHJ1Y3RvciIsImFwcGxpY2F0aW9uSWQiLCJkYXRhYmFzZUNvbnRyb2xsZXIiLCJ3ZWJob29rS2V5IiwiX2FwcGxpY2F0aW9uSWQi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