UNPKG

@gluestack-v2/glue-plugin-service-gateway

Version:

Gluestack V2 service Gateway Plugin

58 lines (55 loc) 1.49 kB
(function (factory) { if (typeof module === "object" && typeof module.exports === "object") { var v = factory(require, exports); if (v !== undefined) module.exports = v; } else if (typeof define === "function" && define.amd) { define(["require", "exports"], factory); } })(function (require, exports) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const http = () => ` { name: // **--- Cron Name ---**, cronTime: // **--- Cron Schedule ---**, onTick: async function(){ try { const response = await axios({ method: // **--- Webhook Method ---**, url: // **--- Webhook URL ---**, data: // **--- Webhook Data ---**, }); return response.data; } catch (err) { return err.message; } }, runOnInit: async function () { console.log("// **--- Cron Name ---** Job is created"); }, }, `; const internal = () => ` { name: // **--- Cron Name ---**, cronTime: // **--- Cron Schedule ---**, onTick: async function(){ try { const response = await this.getLocalService("crons").actions.**--- Action CallMethod ---**(**--- Cron Data ---**); return response.data; } catch (err) { return err.message; } }, runOnInit: async function () { console.log("// **--- Cron Name ---** Job is created"); }, }, `; let template = { http, internal, }; exports.default = template; });