"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
var hooks = {
  /***************** express *****************/
  beforeExpress: function beforeExpress(port, abe) {
    return port;
  },
  afterExpress: function afterExpress(app, express, abe) {
    return app;
  },
  beforeRoute: function beforeRoute(req, res, next, abe) {
    return req;
  },
  beforeAddRoute: function beforeAddRoute(router, abe) {
    return router;
  },
  afterAddRoute: function afterAddRoute(router, abe) {
    return router;
  },

  /***************** preview *****************/
  beforePreview: function beforePreview(html, req, res, next, abe) {
    return html;
  },

  /***************** create *****************/
  beforeDeleteFile: function beforeDeleteFile(filePath, abe) {
    return filePath;
  },
  afterDeleteFile: function afterDeleteFile(path, json, abe) {
    return path;
  },

  /***************** publish *****************/
  beforeReject: function beforeReject(json, filePath, tplPath, abe) {
    return json;
  },
  afterReject: function afterReject(result, abe) {
    return result;
  },

  /***************** publish *****************/
  beforePublish: function beforePublish(json, filePath, tplPath, abe) {
    return json;
  },
  afterPublish: function afterPublish(result, abe) {
    return result;
  },

  /***************** unpublish *****************/
  beforeUnpublish: function beforeUnpublish(filePath, abe) {
    return filePath;
  },
  afterUnpublish: function afterUnpublish(path, json, abe) {
    return path;
  },

  /***************** create *****************/
  beforeCreate: function beforeCreate(filePath, template, path, name, req, forceJson, abe) {
    return filePath;
  },
  afterCreate: function afterCreate(json, text, path, name, req, forceJson, abe) {
    return json;
  },

  /***************** duplicate *****************/
  beforeDuplicate: function beforeDuplicate(oldFilePath, template, path, name, req, deleteFiles, abe) {
    // if deleteFiles this is an update not a duplicate
    return oldFilePath;
  },
  afterDuplicate: function afterDuplicate(json, oldFilePath, template, path, name, req, deleteFiles, abe) {
    return json;
  },

  /***************** update *****************/
  beforeUpdate: function beforeUpdate(json, oldFilePath, template, path, name, req, deleteFiles, abe) {
    return json;
  },

  /***************** save *****************/
  beforeFirstSave: function beforeFirstSave(postUrl, body, json, abe) {
    return {
      postUrl: postUrl,
      json: json
    };
  },
  beforeSave: function beforeSave(obj, abe) {
    return obj;
  },
  afterSave: function afterSave(obj, abe) {
    return obj;
  },
  beforeSaveImage: function beforeSaveImage(folderWebPath, abe) {
    return folderWebPath;
  },
  afterSaveImage: function afterSaveImage(resp, abe) {
    return resp;
  },
  afterPageSaveCompile: function afterPageSaveCompile(tmp, json, abe) {
    return tmp;
  },
  afterPageEditorCompile: function afterPageEditorCompile(tmp, json, abe) {
    return tmp;
  },

  /***************** Manager *****************/
  beforeGetAllFilesDraft: function beforeGetAllFilesDraft(drafted, abe) {
    return drafted;
  },
  beforeGetAllFilesPublished: function beforeGetAllFilesPublished(published, abe) {
    return published;
  },
  afterGetAllFiles: function afterGetAllFiles(merged, abe) {
    return merged;
  },

  /***************** Editor *****************/
  beforeImport: function beforeImport(file, config, ctx, abe) {
    return file;
  },
  afterImport: function afterImport(res, file, config, ctx, abe) {
    return res;
  },
  afterHandlebarsHelpers: function afterHandlebarsHelpers(Handlebars, abe) {
    return Handlebars;
  },
  beforeEditorInput: function beforeEditorInput(params, abe) {
    return params;
  },
  afterEditorInput: function afterEditorInput(htmlString, params, abe) {
    return htmlString;
  },

  beforeAbeAttributes: function beforeAbeAttributes(str, json, abe) {
    return str;
  },
  afterAbeAttributes: function afterAbeAttributes(obj, str, json, abe) {
    return obj;
  },
  beforeEditorFormBlocks: function beforeEditorFormBlocks(json, text, abe) {
    return json;
  },
  afterEditorFormBlocks: function afterEditorFormBlocks(blocks, json, text, abe) {
    return blocks;
  },
  beforeListPage: function beforeListPage(file, index, text) {
    return file;
  },
  afterListPageDraft: function afterListPageDraft(workflow, file, index, text) {
    return workflow;
  },
  afterListPage: function afterListPage(res, file, index, text) {
    return res;
  },
  afterVariables: function afterVariables(EditorVariables, abe) {
    return EditorVariables;
  },

  /***************** json *****************/
  beforeGetJson: function beforeGetJson(path, abe) {
    return path;
  },
  afterGetJson: function afterGetJson(json, abe) {
    return json;
  },
  beforeUpdateJson: function beforeUpdateJson(jsonFilesArray, abe) {
    return jsonFilesArray;
  },

  /***************** text *****************/
  beforeGetTemplate: function beforeGetTemplate(file, abe) {
    return file;
  },
  afterGetTemplate: function afterGetTemplate(text, abe) {
    return text;
  },

  /***************** Page *****************/
  afterAddSourcePage: function afterAddSourcePage(json, text, abe) {
    return json;
  },

  beforePageJson: function beforePageJson(json, abe) {
    return json;
  }
};

exports.default = hooks;