mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
bffb3dbd90
no issue Support for http://resthooks.org style webhooks that can be used with Zapier triggers. This can currently be used in two ways: a) adding a webhook record to the DB manually b) using the API with password auth and POSTing to /webhooks/ (this is private API so not documented) ⚠️ only _https_ URLs are supported in the webhook `target_url` field 🚨 - add `webhooks` table to store event names and target urls - add `POST` and `DELETE` endpoints for `/webhooks/` - configure `subscribers.added` and `subscribers.deleted` events to trigger registered webhooks
49 lines
662 B
JavaScript
49 lines
662 B
JavaScript
/**
|
|
* Dependencies
|
|
*/
|
|
|
|
var _ = require('lodash'),
|
|
exports,
|
|
models;
|
|
|
|
// enable event listeners
|
|
require('./base/listeners');
|
|
|
|
/**
|
|
* Expose all models
|
|
*/
|
|
exports = module.exports;
|
|
|
|
models = [
|
|
'accesstoken',
|
|
'app-field',
|
|
'app-setting',
|
|
'app',
|
|
'client-trusted-domain',
|
|
'client',
|
|
'permission',
|
|
'post',
|
|
'refreshtoken',
|
|
'role',
|
|
'settings',
|
|
'subscriber',
|
|
'tag',
|
|
'user',
|
|
'invite',
|
|
'webhook'
|
|
];
|
|
|
|
function init() {
|
|
exports.Base = require('./base');
|
|
|
|
models.forEach(function (name) {
|
|
_.extend(exports, require('./' + name));
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Expose `init`
|
|
*/
|
|
|
|
exports.init = init;
|