@digipair/skill-cron 0.25.6 → 0.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.cjs.js CHANGED
@@ -9958,7 +9958,7 @@ let CronService = class CronService {
9958
9958
  this.startTask = startTask;
9959
9959
  }
9960
9960
  async start(path) {
9961
- const content = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
9961
+ const content = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
9962
9962
  const lines = content.split('\n').filter((line)=>line !== '');
9963
9963
  const planning = lines.map((line)=>JSON.parse(line));
9964
9964
  for (const plan of planning){
@@ -10003,7 +10003,7 @@ let CronService = class CronService {
10003
10003
  var _context_privates;
10004
10004
  var _context_privates_EDITOR_PATH;
10005
10005
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs' } = params;
10006
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10006
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10007
10007
  const lines = text.split('\n').filter((line)=>line !== '');
10008
10008
  const crons = lines.map((line)=>JSON.parse(line));
10009
10009
  return crons;
@@ -10019,7 +10019,7 @@ let CronService = class CronService {
10019
10019
  reasoning,
10020
10020
  enabled: true
10021
10021
  };
10022
- await fs.promises.appendFile(`${path}/planning.json`, '\n' + JSON.stringify(cron), 'utf8');
10022
+ await fs.promises.appendFile(`${path}/planning.jsonl`, '\n' + JSON.stringify(cron), 'utf8');
10023
10023
  this.addJob(path, cron.id, digipair, reasoning, time);
10024
10024
  return cron;
10025
10025
  }
@@ -10027,12 +10027,12 @@ let CronService = class CronService {
10027
10027
  var _context_privates;
10028
10028
  var _context_privates_EDITOR_PATH;
10029
10029
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10030
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10030
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10031
10031
  const lines = text.split('\n').filter((line)=>line !== '');
10032
10032
  const crons = lines.map((line)=>JSON.parse(line)).filter((cron)=>cron.id !== id);
10033
10033
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10034
10034
  this.deleteJob(id);
10035
- await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10035
+ await fs.promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10036
10036
  return {
10037
10037
  id
10038
10038
  };
@@ -10041,13 +10041,13 @@ let CronService = class CronService {
10041
10041
  var _context_privates;
10042
10042
  var _context_privates_EDITOR_PATH;
10043
10043
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10044
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10044
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10045
10045
  const lines = text.split('\n').filter((line)=>line !== '');
10046
10046
  const crons = lines.map((line)=>JSON.parse(line));
10047
10047
  const cron = crons.find((cron)=>cron.id === id);
10048
10048
  cron.enabled = true;
10049
10049
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10050
- await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10050
+ await fs.promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10051
10051
  this.enableJob(id);
10052
10052
  return cron;
10053
10053
  }
@@ -10055,14 +10055,14 @@ let CronService = class CronService {
10055
10055
  var _context_privates;
10056
10056
  var _context_privates_EDITOR_PATH;
10057
10057
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10058
- const text = await fs.promises.readFile(`${path}/planning.json`, 'utf8');
10058
+ const text = await fs.promises.readFile(`${path}/planning.jsonl`, 'utf8');
10059
10059
  const lines = text.split('\n').filter((line)=>line !== '');
10060
10060
  const crons = lines.map((line)=>JSON.parse(line));
10061
10061
  const cron = crons.find((cron)=>cron.id === id);
10062
10062
  cron.enabled = false;
10063
10063
  this.disableJob(id);
10064
10064
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10065
- await fs.promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10065
+ await fs.promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10066
10066
  return cron;
10067
10067
  }
10068
10068
  constructor(){
package/index.esm.js CHANGED
@@ -9950,7 +9950,7 @@ let CronService = class CronService {
9950
9950
  this.startTask = startTask;
9951
9951
  }
9952
9952
  async start(path) {
9953
- const content = await promises.readFile(`${path}/planning.json`, 'utf8');
9953
+ const content = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
9954
9954
  const lines = content.split('\n').filter((line)=>line !== '');
9955
9955
  const planning = lines.map((line)=>JSON.parse(line));
9956
9956
  for (const plan of planning){
@@ -9995,7 +9995,7 @@ let CronService = class CronService {
9995
9995
  var _context_privates;
9996
9996
  var _context_privates_EDITOR_PATH;
9997
9997
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs' } = params;
9998
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
9998
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
9999
9999
  const lines = text.split('\n').filter((line)=>line !== '');
10000
10000
  const crons = lines.map((line)=>JSON.parse(line));
10001
10001
  return crons;
@@ -10011,7 +10011,7 @@ let CronService = class CronService {
10011
10011
  reasoning,
10012
10012
  enabled: true
10013
10013
  };
10014
- await promises.appendFile(`${path}/planning.json`, '\n' + JSON.stringify(cron), 'utf8');
10014
+ await promises.appendFile(`${path}/planning.jsonl`, '\n' + JSON.stringify(cron), 'utf8');
10015
10015
  this.addJob(path, cron.id, digipair, reasoning, time);
10016
10016
  return cron;
10017
10017
  }
@@ -10019,12 +10019,12 @@ let CronService = class CronService {
10019
10019
  var _context_privates;
10020
10020
  var _context_privates_EDITOR_PATH;
10021
10021
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10022
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10022
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
10023
10023
  const lines = text.split('\n').filter((line)=>line !== '');
10024
10024
  const crons = lines.map((line)=>JSON.parse(line)).filter((cron)=>cron.id !== id);
10025
10025
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10026
10026
  this.deleteJob(id);
10027
- await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10027
+ await promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10028
10028
  return {
10029
10029
  id
10030
10030
  };
@@ -10033,13 +10033,13 @@ let CronService = class CronService {
10033
10033
  var _context_privates;
10034
10034
  var _context_privates_EDITOR_PATH;
10035
10035
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10036
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10036
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
10037
10037
  const lines = text.split('\n').filter((line)=>line !== '');
10038
10038
  const crons = lines.map((line)=>JSON.parse(line));
10039
10039
  const cron = crons.find((cron)=>cron.id === id);
10040
10040
  cron.enabled = true;
10041
10041
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10042
- await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10042
+ await promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10043
10043
  this.enableJob(id);
10044
10044
  return cron;
10045
10045
  }
@@ -10047,14 +10047,14 @@ let CronService = class CronService {
10047
10047
  var _context_privates;
10048
10048
  var _context_privates_EDITOR_PATH;
10049
10049
  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_FACTORY_PATH'] ? `${process.env['DIGIPAIR_FACTORY_PATH']}/digipairs` : './factory/digipairs', id } = params;
10050
- const text = await promises.readFile(`${path}/planning.json`, 'utf8');
10050
+ const text = await promises.readFile(`${path}/planning.jsonl`, 'utf8');
10051
10051
  const lines = text.split('\n').filter((line)=>line !== '');
10052
10052
  const crons = lines.map((line)=>JSON.parse(line));
10053
10053
  const cron = crons.find((cron)=>cron.id === id);
10054
10054
  cron.enabled = false;
10055
10055
  this.disableJob(id);
10056
10056
  const ndjson = crons.map((line)=>JSON.stringify(line)).join('\n');
10057
- await promises.writeFile(`${path}/planning.json`, ndjson, 'utf8');
10057
+ await promises.writeFile(`${path}/planning.jsonl`, ndjson, 'utf8');
10058
10058
  return cron;
10059
10059
  }
10060
10060
  constructor(){
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-cron",
3
- "version": "0.25.6",
3
+ "version": "0.27.0",
4
4
  "dependencies": {
5
5
  "cron": "^3.1.7"
6
6
  },
package/schema.fr.json ADDED
@@ -0,0 +1,160 @@
1
+ {
2
+ "openapi": "3.0.0",
3
+ "info": {
4
+ "title": "@digipair/skill-cron",
5
+ "summary": "Gestion des taches planifiées",
6
+ "description": "La compétence permet de gérer l'exécutions des taches planifiées",
7
+ "version": "0.1.0",
8
+ "x-icon": "📆"
9
+ },
10
+ "paths": {
11
+ "/crons": {
12
+ "post": {
13
+ "tags": ["service"],
14
+ "summary": "Liste des taches planifiées",
15
+ "parameters": [
16
+ {
17
+ "name": "path",
18
+ "summary": "Chemin d'accès",
19
+ "required": false,
20
+ "description": "Chemin d'accès vers le répertoire des digipairs",
21
+ "schema": {
22
+ "type": "string"
23
+ }
24
+ }
25
+ ],
26
+ "x-events": []
27
+ }
28
+ },
29
+ "/addCron": {
30
+ "post": {
31
+ "tags": ["service"],
32
+ "summary": "Ajoute une plannification",
33
+ "parameters": [
34
+ {
35
+ "name": "path",
36
+ "summary": "Chemin d'accès",
37
+ "required": false,
38
+ "description": "Chemin d'accès vers le répertoire des digipairs",
39
+ "schema": {
40
+ "type": "string"
41
+ }
42
+ },
43
+ {
44
+ "name": "time",
45
+ "summary": "Plannification",
46
+ "required": true,
47
+ "description": "Plannification au format cron",
48
+ "schema": {
49
+ "type": "string"
50
+ }
51
+ },
52
+ {
53
+ "name": "digipair",
54
+ "summary": "Digipair",
55
+ "required": true,
56
+ "description": "Nom du digipair qui exécute le raisonnement",
57
+ "schema": {
58
+ "type": "string"
59
+ }
60
+ },
61
+ {
62
+ "name": "reasoning",
63
+ "summary": "Raisonnement",
64
+ "required": true,
65
+ "description": "Nom du raisonnement à exécuter",
66
+ "schema": {
67
+ "type": "string"
68
+ }
69
+ }
70
+ ],
71
+ "x-events": []
72
+ }
73
+ },
74
+ "/deleteCron": {
75
+ "post": {
76
+ "tags": ["service"],
77
+ "summary": "Supprime une plannification",
78
+ "parameters": [
79
+ {
80
+ "name": "path",
81
+ "summary": "Chemin d'accès",
82
+ "required": false,
83
+ "description": "Chemin d'accès vers le répertoire des digipairs",
84
+ "schema": {
85
+ "type": "string"
86
+ }
87
+ },
88
+ {
89
+ "name": "id",
90
+ "summary": "Identifiant",
91
+ "required": true,
92
+ "description": "Identifiant de la plannification",
93
+ "schema": {
94
+ "type": "string"
95
+ }
96
+ }
97
+ ],
98
+ "x-events": []
99
+ }
100
+ },
101
+ "/enableCron": {
102
+ "post": {
103
+ "tags": ["service"],
104
+ "summary": "Active une plannification",
105
+ "parameters": [
106
+ {
107
+ "name": "path",
108
+ "summary": "Chemin d'accès",
109
+ "required": false,
110
+ "description": "Chemin d'accès vers le répertoire des digipairs",
111
+ "schema": {
112
+ "type": "string"
113
+ }
114
+ },
115
+ {
116
+ "name": "id",
117
+ "summary": "Identifiant",
118
+ "required": true,
119
+ "description": "Identifiant de la plannification",
120
+ "schema": {
121
+ "type": "string"
122
+ }
123
+ }
124
+ ],
125
+ "x-events": []
126
+ }
127
+ },
128
+ "/disableCron": {
129
+ "post": {
130
+ "tags": ["service"],
131
+ "summary": "Désactive une plannification",
132
+ "parameters": [
133
+ {
134
+ "name": "path",
135
+ "summary": "Chemin d'accès",
136
+ "required": false,
137
+ "description": "Chemin d'accès vers le répertoire des digipairs",
138
+ "schema": {
139
+ "type": "string"
140
+ }
141
+ },
142
+ {
143
+ "name": "id",
144
+ "summary": "Identifiant",
145
+ "required": true,
146
+ "description": "Identifiant de la plannification",
147
+ "schema": {
148
+ "type": "string"
149
+ }
150
+ }
151
+ ],
152
+ "x-events": []
153
+ }
154
+ }
155
+ },
156
+ "components": {
157
+ "schemas": {}
158
+ },
159
+ "x-scene-blocks": {}
160
+ }
package/schema.json CHANGED
@@ -2,8 +2,8 @@
2
2
  "openapi": "3.0.0",
3
3
  "info": {
4
4
  "title": "@digipair/skill-cron",
5
- "summary": "Gestion des taches planifiées",
6
- "description": "La compétence permet de gérer l'exécutions des taches planifiées",
5
+ "summary": "Scheduled Task Management",
6
+ "description": "The skill allows for the management of scheduled task executions.",
7
7
  "version": "0.1.0",
8
8
  "x-icon": "📆"
9
9
  },
@@ -11,13 +11,13 @@
11
11
  "/crons": {
12
12
  "post": {
13
13
  "tags": ["service"],
14
- "summary": "Liste des taches planifiées",
14
+ "summary": "List of Scheduled Tasks",
15
15
  "parameters": [
16
16
  {
17
17
  "name": "path",
18
- "summary": "Chemin d'accès",
18
+ "summary": "Access Path",
19
19
  "required": false,
20
- "description": "Chemin d'accès vers le répertoire des digipairs",
20
+ "description": "Access path to the digipairs directory",
21
21
  "schema": {
22
22
  "type": "string"
23
23
  }
@@ -29,22 +29,22 @@
29
29
  "/addCron": {
30
30
  "post": {
31
31
  "tags": ["service"],
32
- "summary": "Ajoute une plannification",
32
+ "summary": "Adds a Schedule",
33
33
  "parameters": [
34
34
  {
35
35
  "name": "path",
36
- "summary": "Chemin d'accès",
36
+ "summary": "Access Path",
37
37
  "required": false,
38
- "description": "Chemin d'accès vers le répertoire des digipairs",
38
+ "description": "Access path to the digipairs directory",
39
39
  "schema": {
40
40
  "type": "string"
41
41
  }
42
42
  },
43
43
  {
44
44
  "name": "time",
45
- "summary": "Plannification",
45
+ "summary": "Schedule",
46
46
  "required": true,
47
- "description": "Plannification au format cron",
47
+ "description": "Schedule in cron format",
48
48
  "schema": {
49
49
  "type": "string"
50
50
  }
@@ -53,16 +53,16 @@
53
53
  "name": "digipair",
54
54
  "summary": "Digipair",
55
55
  "required": true,
56
- "description": "Nom du digipair qui exécute le raisonnement",
56
+ "description": "Name of the digipair executing the reasoning",
57
57
  "schema": {
58
58
  "type": "string"
59
59
  }
60
60
  },
61
61
  {
62
62
  "name": "reasoning",
63
- "summary": "Raisonnement",
63
+ "summary": "Reasoning",
64
64
  "required": true,
65
- "description": "Nom du raisonnement à exécuter",
65
+ "description": "Name of the reasoning to be executed",
66
66
  "schema": {
67
67
  "type": "string"
68
68
  }
@@ -74,22 +74,22 @@
74
74
  "/deleteCron": {
75
75
  "post": {
76
76
  "tags": ["service"],
77
- "summary": "Supprime une plannification",
77
+ "summary": "Deletes a Schedule",
78
78
  "parameters": [
79
79
  {
80
80
  "name": "path",
81
- "summary": "Chemin d'accès",
81
+ "summary": "Access Path",
82
82
  "required": false,
83
- "description": "Chemin d'accès vers le répertoire des digipairs",
83
+ "description": "Access path to the digipairs directory",
84
84
  "schema": {
85
85
  "type": "string"
86
86
  }
87
87
  },
88
88
  {
89
89
  "name": "id",
90
- "summary": "Identifiant",
90
+ "summary": "Identifier",
91
91
  "required": true,
92
- "description": "Identifiant de la plannification",
92
+ "description": "Identifier of the schedule",
93
93
  "schema": {
94
94
  "type": "string"
95
95
  }
@@ -101,22 +101,22 @@
101
101
  "/enableCron": {
102
102
  "post": {
103
103
  "tags": ["service"],
104
- "summary": "Active une plannification",
104
+ "summary": "Enables a Schedule",
105
105
  "parameters": [
106
106
  {
107
107
  "name": "path",
108
- "summary": "Chemin d'accès",
108
+ "summary": "Access Path",
109
109
  "required": false,
110
- "description": "Chemin d'accès vers le répertoire des digipairs",
110
+ "description": "Access path to the digipairs directory",
111
111
  "schema": {
112
112
  "type": "string"
113
113
  }
114
114
  },
115
115
  {
116
116
  "name": "id",
117
- "summary": "Identifiant",
117
+ "summary": "Identifier",
118
118
  "required": true,
119
- "description": "Identifiant de la plannification",
119
+ "description": "Identifier of the schedule",
120
120
  "schema": {
121
121
  "type": "string"
122
122
  }
@@ -128,22 +128,22 @@
128
128
  "/disableCron": {
129
129
  "post": {
130
130
  "tags": ["service"],
131
- "summary": "Désactive une plannification",
131
+ "summary": "Disables a Schedule",
132
132
  "parameters": [
133
133
  {
134
134
  "name": "path",
135
- "summary": "Chemin d'accès",
135
+ "summary": "Access Path",
136
136
  "required": false,
137
- "description": "Chemin d'accès vers le répertoire des digipairs",
137
+ "description": "Access path to the digipairs directory",
138
138
  "schema": {
139
139
  "type": "string"
140
140
  }
141
141
  },
142
142
  {
143
143
  "name": "id",
144
- "summary": "Identifiant",
144
+ "summary": "Identifier",
145
145
  "required": true,
146
- "description": "Identifiant de la plannification",
146
+ "description": "Identifier of the schedule",
147
147
  "schema": {
148
148
  "type": "string"
149
149
  }