@digipair/skill-cron 0.16.1 → 0.16.3

Sign up to get free protection for your applications and to get access to all the features.
package/index.cjs.js CHANGED
@@ -23517,14 +23517,14 @@ function indent(str, spaces) {
23517
23517
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23518
23518
  // match is required
23519
23519
  if (!match) {
23520
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23520
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23521
23521
  v: nextMatch1
23522
23522
  };
23523
23523
  }
23524
23524
  var token = match.token, offset = match.offset;
23525
23525
  i1 += offset;
23526
23526
  if (token === " ") {
23527
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23527
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23528
23528
  }
23529
23529
  tokens1 = _to_consumable_array$3(tokens1).concat([
23530
23530
  token
@@ -23543,7 +23543,7 @@ function indent(str, spaces) {
23543
23543
  if (contextKeys.some(function(el) {
23544
23544
  return el.startsWith(name);
23545
23545
  })) {
23546
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23546
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23547
23547
  }
23548
23548
  if (dateTimeIdentifiers.some(function(el) {
23549
23549
  return el === name;
@@ -23562,9 +23562,9 @@ function indent(str, spaces) {
23562
23562
  if (dateTimeIdentifiers.some(function(el) {
23563
23563
  return el.startsWith(name);
23564
23564
  })) {
23565
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23565
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23566
23566
  }
23567
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23567
+ return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23568
23568
  v: nextMatch1
23569
23569
  };
23570
23570
  };
@@ -37424,7 +37424,7 @@ let CronService = class CronService {
37424
37424
  for (const plan of planning){
37425
37425
  const job = new dist.CronJob(plan.time, async ()=>{
37426
37426
  await this.startTask(path, plan.digipair, plan.reasoning);
37427
- }, null, !!plan.enable, 'Europe/Paris');
37427
+ }, null, !!plan.enabled, 'Europe/Paris');
37428
37428
  if (this.jobs[plan.id]) {
37429
37429
  this.jobs[plan.id].stop();
37430
37430
  }
@@ -37474,7 +37474,7 @@ let CronService = class CronService {
37474
37474
  time,
37475
37475
  digipair,
37476
37476
  reasoning,
37477
- enable: false
37477
+ enabled: true
37478
37478
  };
37479
37479
  await fs.promises.appendFile(`${path}/planning.json`, '\n' + JSON.stringify(cron), 'utf8');
37480
37480
  this.addJob(path, cron.id, digipair, reasoning, time);
@@ -37496,9 +37496,9 @@ let CronService = class CronService {
37496
37496
  var _context_privates_EDITOR_PATH, _ref;
37497
37497
  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;
37498
37498
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
37499
- const crons = JSON.parse(`[${text}]`).filter((cron)=>cron.id !== id);
37499
+ const crons = JSON.parse(`[${text}]`);
37500
37500
  const cron = crons.find((cron)=>cron.id === id);
37501
- cron.enable = true;
37501
+ cron.enabled = true;
37502
37502
  const ndjson = crons.map(JSON.stringify).join('\n');
37503
37503
  await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
37504
37504
  this.enableJob(id);
@@ -37508,9 +37508,9 @@ let CronService = class CronService {
37508
37508
  var _context_privates_EDITOR_PATH, _ref;
37509
37509
  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;
37510
37510
  const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
37511
- const crons = JSON.parse(`[${text}]`).filter((cron)=>cron.id !== id);
37511
+ const crons = JSON.parse(`[${text}]`);
37512
37512
  const cron = crons.find((cron)=>cron.id === id);
37513
- cron.enable = false;
37513
+ cron.enabled = false;
37514
37514
  this.disableJob(id);
37515
37515
  const ndjson = crons.map(JSON.stringify).join('\n');
37516
37516
  await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
package/index.esm.js CHANGED
@@ -23491,14 +23491,14 @@ function indent(str, spaces) {
23491
23491
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23492
23492
  // match is required
23493
23493
  if (!match) {
23494
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23494
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23495
23495
  v: nextMatch1
23496
23496
  };
23497
23497
  }
23498
23498
  var token = match.token, offset = match.offset;
23499
23499
  i1 += offset;
23500
23500
  if (token === " ") {
23501
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23501
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23502
23502
  }
23503
23503
  tokens1 = _to_consumable_array$3(tokens1).concat([
23504
23504
  token
@@ -23517,7 +23517,7 @@ function indent(str, spaces) {
23517
23517
  if (contextKeys.some(function(el) {
23518
23518
  return el.startsWith(name);
23519
23519
  })) {
23520
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23520
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23521
23521
  }
23522
23522
  if (dateTimeIdentifiers.some(function(el) {
23523
23523
  return el === name;
@@ -23536,9 +23536,9 @@ function indent(str, spaces) {
23536
23536
  if (dateTimeIdentifiers.some(function(el) {
23537
23537
  return el.startsWith(name);
23538
23538
  })) {
23539
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23539
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23540
23540
  }
23541
- return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23541
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23542
23542
  v: nextMatch1
23543
23543
  };
23544
23544
  };
@@ -37398,7 +37398,7 @@ let CronService = class CronService {
37398
37398
  for (const plan of planning){
37399
37399
  const job = new dist.CronJob(plan.time, async ()=>{
37400
37400
  await this.startTask(path, plan.digipair, plan.reasoning);
37401
- }, null, !!plan.enable, 'Europe/Paris');
37401
+ }, null, !!plan.enabled, 'Europe/Paris');
37402
37402
  if (this.jobs[plan.id]) {
37403
37403
  this.jobs[plan.id].stop();
37404
37404
  }
@@ -37448,7 +37448,7 @@ let CronService = class CronService {
37448
37448
  time,
37449
37449
  digipair,
37450
37450
  reasoning,
37451
- enable: false
37451
+ enabled: true
37452
37452
  };
37453
37453
  await promises.appendFile(`${path}/planning.json`, '\n' + JSON.stringify(cron), 'utf8');
37454
37454
  this.addJob(path, cron.id, digipair, reasoning, time);
@@ -37470,9 +37470,9 @@ let CronService = class CronService {
37470
37470
  var _context_privates_EDITOR_PATH, _ref;
37471
37471
  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;
37472
37472
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
37473
- const crons = JSON.parse(`[${text}]`).filter((cron)=>cron.id !== id);
37473
+ const crons = JSON.parse(`[${text}]`);
37474
37474
  const cron = crons.find((cron)=>cron.id === id);
37475
- cron.enable = true;
37475
+ cron.enabled = true;
37476
37476
  const ndjson = crons.map(JSON.stringify).join('\n');
37477
37477
  await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
37478
37478
  this.enableJob(id);
@@ -37482,9 +37482,9 @@ let CronService = class CronService {
37482
37482
  var _context_privates_EDITOR_PATH, _ref;
37483
37483
  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;
37484
37484
  const text = await promises.readFile(`${path}/planning.json`, 'utf8');
37485
- const crons = JSON.parse(`[${text}]`).filter((cron)=>cron.id !== id);
37485
+ const crons = JSON.parse(`[${text}]`);
37486
37486
  const cron = crons.find((cron)=>cron.id === id);
37487
- cron.enable = false;
37487
+ cron.enabled = false;
37488
37488
  this.disableJob(id);
37489
37489
  const ndjson = crons.map(JSON.stringify).join('\n');
37490
37490
  await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
@@ -7,7 +7,7 @@ export declare const addCron: (params: any, pinsSettingsList: PinsSettings[], co
7
7
  time: any;
8
8
  digipair: any;
9
9
  reasoning: any;
10
- enable: boolean;
10
+ enabled: boolean;
11
11
  }>;
12
12
  export declare const deleteCron: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<{
13
13
  id: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-cron",
3
- "version": "0.16.1",
3
+ "version": "0.16.3",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"