@digipair/skill-cron 0.20.1 → 0.20.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/index.cjs.js +15 -10
  2. package/index.esm.js +15 -10
  3. package/package.json +4 -2
package/index.cjs.js CHANGED
@@ -9999,15 +9999,17 @@ let CronService = class CronService {
9999
9999
  this.jobs[id].stop();
10000
10000
  }
10001
10001
  async crons(params, _pinsSettingsList, context) {
10002
- var _context_privates_EDITOR_PATH, _ref;
10003
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs' } = params;
10002
+ var _context_privates;
10003
+ var _context_privates_EDITOR_PATH;
10004
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs' } = params;
10004
10005
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10005
10006
  const crons = JSON.parse(`[${text}]`);
10006
10007
  return crons;
10007
10008
  }
10008
10009
  async addCron(params, _pinsSettingsList, context) {
10009
- var _context_privates_EDITOR_PATH, _ref;
10010
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', time, digipair, reasoning } = params;
10010
+ var _context_privates;
10011
+ var _context_privates_EDITOR_PATH;
10012
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', time, digipair, reasoning } = params;
10011
10013
  const cron = {
10012
10014
  id: v4(),
10013
10015
  time,
@@ -10020,8 +10022,9 @@ let CronService = class CronService {
10020
10022
  return cron;
10021
10023
  }
10022
10024
  async deleteCron(params, _pinsSettingsList, context) {
10023
- var _context_privates_EDITOR_PATH, _ref;
10024
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', id } = params;
10025
+ var _context_privates;
10026
+ var _context_privates_EDITOR_PATH;
10027
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', id } = params;
10025
10028
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10026
10029
  const crons = JSON.parse(`[${text}]`).filter((cron)=>cron.id !== id);
10027
10030
  const ndjson = crons.map(JSON.stringify).join('\n');
@@ -10032,8 +10035,9 @@ let CronService = class CronService {
10032
10035
  };
10033
10036
  }
10034
10037
  async enableCron(params, _pinsSettingsList, context) {
10035
- var _context_privates_EDITOR_PATH, _ref;
10036
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', id } = params;
10038
+ var _context_privates;
10039
+ var _context_privates_EDITOR_PATH;
10040
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', id } = params;
10037
10041
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10038
10042
  const crons = JSON.parse(`[${text}]`);
10039
10043
  const cron = crons.find((cron)=>cron.id === id);
@@ -10044,8 +10048,9 @@ let CronService = class CronService {
10044
10048
  return cron;
10045
10049
  }
10046
10050
  async disableCron(params, _pinsSettingsList, context) {
10047
- var _context_privates_EDITOR_PATH, _ref;
10048
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', id } = params;
10051
+ var _context_privates;
10052
+ var _context_privates_EDITOR_PATH;
10053
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', id } = params;
10049
10054
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10050
10055
  const crons = JSON.parse(`[${text}]`);
10051
10056
  const cron = crons.find((cron)=>cron.id === id);
package/index.esm.js CHANGED
@@ -9991,15 +9991,17 @@ let CronService = class CronService {
9991
9991
  this.jobs[id].stop();
9992
9992
  }
9993
9993
  async crons(params, _pinsSettingsList, context) {
9994
- var _context_privates_EDITOR_PATH, _ref;
9995
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs' } = params;
9994
+ var _context_privates;
9995
+ var _context_privates_EDITOR_PATH;
9996
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs' } = params;
9996
9997
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
9997
9998
  const crons = JSON.parse(`[${text}]`);
9998
9999
  return crons;
9999
10000
  }
10000
10001
  async addCron(params, _pinsSettingsList, context) {
10001
- var _context_privates_EDITOR_PATH, _ref;
10002
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', time, digipair, reasoning } = params;
10002
+ var _context_privates;
10003
+ var _context_privates_EDITOR_PATH;
10004
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', time, digipair, reasoning } = params;
10003
10005
  const cron = {
10004
10006
  id: v4(),
10005
10007
  time,
@@ -10012,8 +10014,9 @@ let CronService = class CronService {
10012
10014
  return cron;
10013
10015
  }
10014
10016
  async deleteCron(params, _pinsSettingsList, context) {
10015
- var _context_privates_EDITOR_PATH, _ref;
10016
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', id } = params;
10017
+ var _context_privates;
10018
+ var _context_privates_EDITOR_PATH;
10019
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', id } = params;
10017
10020
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10018
10021
  const crons = JSON.parse(`[${text}]`).filter((cron)=>cron.id !== id);
10019
10022
  const ndjson = crons.map(JSON.stringify).join('\n');
@@ -10024,8 +10027,9 @@ let CronService = class CronService {
10024
10027
  };
10025
10028
  }
10026
10029
  async enableCron(params, _pinsSettingsList, context) {
10027
- var _context_privates_EDITOR_PATH, _ref;
10028
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', id } = params;
10030
+ var _context_privates;
10031
+ var _context_privates_EDITOR_PATH;
10032
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', id } = params;
10029
10033
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10030
10034
  const crons = JSON.parse(`[${text}]`);
10031
10035
  const cron = crons.find((cron)=>cron.id === id);
@@ -10036,8 +10040,9 @@ let CronService = class CronService {
10036
10040
  return cron;
10037
10041
  }
10038
10042
  async disableCron(params, _pinsSettingsList, context) {
10039
- var _context_privates_EDITOR_PATH, _ref;
10040
- const { path = (_ref = (_context_privates_EDITOR_PATH = context.privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) != null ? _ref : './dist/apps/factory/assets/digipairs', id } = params;
10043
+ var _context_privates;
10044
+ var _context_privates_EDITOR_PATH;
10045
+ const { path = ((_context_privates_EDITOR_PATH = (_context_privates = context.privates) == null ? void 0 : _context_privates.EDITOR_PATH) != null ? _context_privates_EDITOR_PATH : process.env['DIGIPAIR_AGENTS_PATH']) ? `${process.env['DIGIPAIR_AGENTS_PATH']}/digipairs` : './factory/digipairs', id } = params;
10041
10046
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10042
10047
  const crons = JSON.parse(`[${text}]`);
10043
10048
  const cron = crons.find((cron)=>cron.id === id);
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@digipair/skill-cron",
3
- "version": "0.20.1",
4
- "dependencies": {},
3
+ "version": "0.20.2",
4
+ "dependencies": {
5
+ "cron": "^3.1.7"
6
+ },
5
7
  "main": "./index.cjs.js",
6
8
  "module": "./index.esm.js"
7
9
  }