@digipair/skill-basic 0.49.1 → 0.49.3

Sign up to get free protection for your applications and to get access to all the features.
package/index.cjs.js CHANGED
@@ -23,6 +23,34 @@ let BasicService = class BasicService {
23
23
  context.variables[name] = result;
24
24
  return result;
25
25
  }
26
+ async interval(params, _pinsSettingsList, context) {
27
+ var _context_protected;
28
+ const { time, execute } = params;
29
+ const signal = (_context_protected = context.protected) == null ? void 0 : _context_protected.signal;
30
+ const result = setInterval(()=>{
31
+ engine.executePinsList(execute, context);
32
+ }, time);
33
+ signal == null ? void 0 : signal.addEventListener('abort', ()=>clearInterval(result));
34
+ return result;
35
+ }
36
+ async defer(params, _pinsSettingsList, context) {
37
+ var _context_protected;
38
+ const { time, execute } = params;
39
+ const signal = (_context_protected = context.protected) == null ? void 0 : _context_protected.signal;
40
+ const result = setTimeout(()=>{
41
+ engine.executePinsList(execute, context);
42
+ }, time);
43
+ signal == null ? void 0 : signal.addEventListener('abort', ()=>clearTimeout(result));
44
+ return result;
45
+ }
46
+ async stopInterval(params, _pinsSettingsList, context) {
47
+ const { id } = params;
48
+ return clearInterval(id);
49
+ }
50
+ async stopDefer(params, _pinsSettingsList, context) {
51
+ const { id } = params;
52
+ return clearTimeout(id);
53
+ }
26
54
  async base64ToBuffer(params, _pinsSettingsList, _context) {
27
55
  const { base64 } = params;
28
56
  const data = base64.replace(/^data:.*;base64,/, '');
package/index.esm.js CHANGED
@@ -23899,14 +23899,14 @@ function indent(str, spaces) {
23899
23899
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23900
23900
  // match is required
23901
23901
  if (!match) {
23902
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23902
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23903
23903
  v: nextMatch1
23904
23904
  };
23905
23905
  }
23906
23906
  var token = match.token, offset = match.offset;
23907
23907
  i1 += offset;
23908
23908
  if (token === " ") {
23909
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23909
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23910
23910
  }
23911
23911
  tokens1 = _to_consumable_array$1(tokens1).concat([
23912
23912
  token
@@ -23925,7 +23925,7 @@ function indent(str, spaces) {
23925
23925
  if (contextKeys.some(function(el) {
23926
23926
  return el.startsWith(name);
23927
23927
  })) {
23928
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23928
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23929
23929
  }
23930
23930
  if (dateTimeIdentifiers.some(function(el) {
23931
23931
  return el === name;
@@ -23944,9 +23944,9 @@ function indent(str, spaces) {
23944
23944
  if (dateTimeIdentifiers.some(function(el) {
23945
23945
  return el.startsWith(name);
23946
23946
  })) {
23947
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, "continue";
23947
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23948
23948
  }
23949
- return tokens = tokens1, nextMatch = nextMatch1, i = i1, {
23949
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23950
23950
  v: nextMatch1
23951
23951
  };
23952
23952
  };
@@ -27972,6 +27972,34 @@ let BasicService = class BasicService {
27972
27972
  context.variables[name] = result;
27973
27973
  return result;
27974
27974
  }
27975
+ async interval(params, _pinsSettingsList, context) {
27976
+ var _context_protected;
27977
+ const { time, execute } = params;
27978
+ const signal = (_context_protected = context.protected) == null ? void 0 : _context_protected.signal;
27979
+ const result = setInterval(()=>{
27980
+ executePinsList(execute, context);
27981
+ }, time);
27982
+ signal == null ? void 0 : signal.addEventListener('abort', ()=>clearInterval(result));
27983
+ return result;
27984
+ }
27985
+ async defer(params, _pinsSettingsList, context) {
27986
+ var _context_protected;
27987
+ const { time, execute } = params;
27988
+ const signal = (_context_protected = context.protected) == null ? void 0 : _context_protected.signal;
27989
+ const result = setTimeout(()=>{
27990
+ executePinsList(execute, context);
27991
+ }, time);
27992
+ signal == null ? void 0 : signal.addEventListener('abort', ()=>clearTimeout(result));
27993
+ return result;
27994
+ }
27995
+ async stopInterval(params, _pinsSettingsList, context) {
27996
+ const { id } = params;
27997
+ return clearInterval(id);
27998
+ }
27999
+ async stopDefer(params, _pinsSettingsList, context) {
28000
+ const { id } = params;
28001
+ return clearTimeout(id);
28002
+ }
27975
28003
  async base64ToBuffer(params, _pinsSettingsList, _context) {
27976
28004
  const { base64 } = params;
27977
28005
  const data = base64.replace(/^data:.*;base64,/, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-basic",
3
- "version": "0.49.1",
3
+ "version": "0.49.3",
4
4
  "dependencies": {},
5
5
  "main": "./index.cjs.js",
6
6
  "module": "./index.esm.js"
package/schema.fr.json CHANGED
@@ -79,6 +79,106 @@
79
79
  "x-events": []
80
80
  }
81
81
  },
82
+ "/defer": {
83
+ "post": {
84
+ "tags": ["web", "service", "spatial"],
85
+ "summary": "Différer l'exécution",
86
+ "description": "Diffère l'exécution d'une action",
87
+ "parameters": [
88
+ {
89
+ "name": "time",
90
+ "summary": "Temps",
91
+ "required": true,
92
+ "description": "Temps en millisecondes avant l'exécution",
93
+ "schema": {
94
+ "type": "number"
95
+ }
96
+ },
97
+ {
98
+ "name": "execute",
99
+ "summary": "Exécute",
100
+ "required": true,
101
+ "description": "Actions à différer",
102
+ "schema": {
103
+ "type": "array",
104
+ "items": {
105
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
106
+ }
107
+ }
108
+ }
109
+ ],
110
+ "x-events": []
111
+ }
112
+ },
113
+ "/interval": {
114
+ "post": {
115
+ "tags": ["web", "service", "spatial"],
116
+ "summary": "Intervalle",
117
+ "description": "Exécute une action à intervalle régulier",
118
+ "parameters": [
119
+ {
120
+ "name": "time",
121
+ "summary": "Temps",
122
+ "required": true,
123
+ "description": "Temps en millisecondes entre chaque exécution",
124
+ "schema": {
125
+ "type": "number"
126
+ }
127
+ },
128
+ {
129
+ "name": "execute",
130
+ "summary": "Exécute",
131
+ "required": true,
132
+ "description": "Actions à exécuter",
133
+ "schema": {
134
+ "type": "array",
135
+ "items": {
136
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
137
+ }
138
+ }
139
+ }
140
+ ],
141
+ "x-events": []
142
+ }
143
+ },
144
+ "/stopInterval": {
145
+ "post": {
146
+ "tags": ["web", "service", "spatial"],
147
+ "summary": "Arrêter l'intervalle",
148
+ "description": "Arrête l'intervalle d'exécution",
149
+ "parameters": [
150
+ {
151
+ "name": "id",
152
+ "summary": "ID",
153
+ "required": true,
154
+ "description": "ID de l'intervalle à arrêter",
155
+ "schema": {
156
+ "type": "object"
157
+ }
158
+ }
159
+ ],
160
+ "x-events": []
161
+ }
162
+ },
163
+ "/stopDefer": {
164
+ "post": {
165
+ "tags": ["web", "service", "spatial"],
166
+ "summary": "Arrêter le différé",
167
+ "description": "Arrête le différé d'exécution",
168
+ "parameters": [
169
+ {
170
+ "name": "id",
171
+ "summary": "ID",
172
+ "required": true,
173
+ "description": "ID du différé à arrêter",
174
+ "schema": {
175
+ "type": "object"
176
+ }
177
+ }
178
+ ],
179
+ "x-events": []
180
+ }
181
+ },
82
182
  "/base64ToBuffer": {
83
183
  "post": {
84
184
  "tags": ["web", "service", "spatial"],
package/schema.json CHANGED
@@ -79,6 +79,106 @@
79
79
  "x-events": []
80
80
  }
81
81
  },
82
+ "/defer": {
83
+ "post": {
84
+ "tags": ["web", "service", "spatial"],
85
+ "summary": "Defer",
86
+ "description": "Executes an action after a delay",
87
+ "parameters": [
88
+ {
89
+ "name": "time",
90
+ "summary": "Time",
91
+ "required": true,
92
+ "description": "Time in milliseconds to wait before executing",
93
+ "schema": {
94
+ "type": "number"
95
+ }
96
+ },
97
+ {
98
+ "name": "execute",
99
+ "summary": "Execute",
100
+ "required": true,
101
+ "description": "Actions to execute",
102
+ "schema": {
103
+ "type": "array",
104
+ "items": {
105
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
106
+ }
107
+ }
108
+ }
109
+ ],
110
+ "x-events": []
111
+ }
112
+ },
113
+ "/interval": {
114
+ "post": {
115
+ "tags": ["web", "service", "spatial"],
116
+ "summary": "Interval",
117
+ "description": "Executes an action at regular intervals",
118
+ "parameters": [
119
+ {
120
+ "name": "time",
121
+ "summary": "Time",
122
+ "required": true,
123
+ "description": "Time in milliseconds between each execution",
124
+ "schema": {
125
+ "type": "number"
126
+ }
127
+ },
128
+ {
129
+ "name": "execute",
130
+ "summary": "Execute",
131
+ "required": true,
132
+ "description": "Actions to execute",
133
+ "schema": {
134
+ "type": "array",
135
+ "items": {
136
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
137
+ }
138
+ }
139
+ }
140
+ ],
141
+ "x-events": []
142
+ }
143
+ },
144
+ "/stopInterval": {
145
+ "post": {
146
+ "tags": ["web", "service", "spatial"],
147
+ "summary": "Stop the interval",
148
+ "description": "Stops the interval from executing",
149
+ "parameters": [
150
+ {
151
+ "name": "id",
152
+ "summary": "ID",
153
+ "required": true,
154
+ "description": "ID of the interval to stop",
155
+ "schema": {
156
+ "type": "object"
157
+ }
158
+ }
159
+ ],
160
+ "x-events": []
161
+ }
162
+ },
163
+ "/stopDefer": {
164
+ "post": {
165
+ "tags": ["web", "service", "spatial"],
166
+ "summary": "Stop the defer",
167
+ "description": "Stops the deferred action from executing",
168
+ "parameters": [
169
+ {
170
+ "name": "id",
171
+ "summary": "ID",
172
+ "required": true,
173
+ "description": "ID of the deferred action to stop",
174
+ "schema": {
175
+ "type": "object"
176
+ }
177
+ }
178
+ ],
179
+ "x-events": []
180
+ }
181
+ },
82
182
  "/base64ToBuffer": {
83
183
  "post": {
84
184
  "tags": ["web", "service", "spatial"],