@digipair/skill-worker 0.79.1 → 0.80.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
@@ -23921,14 +23921,14 @@ function indent(str, spaces) {
23921
23921
  var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
23922
23922
  // match is required
23923
23923
  if (!match) {
23924
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23924
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23925
23925
  v: nextMatch1
23926
23926
  };
23927
23927
  }
23928
23928
  var token = match.token, offset = match.offset;
23929
23929
  i1 += offset;
23930
23930
  if (token === " ") {
23931
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23931
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23932
23932
  }
23933
23933
  tokens1 = _to_consumable_array$1(tokens1).concat([
23934
23934
  token
@@ -23947,7 +23947,7 @@ function indent(str, spaces) {
23947
23947
  if (contextKeys.some(function(el) {
23948
23948
  return el.startsWith(name);
23949
23949
  })) {
23950
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23950
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23951
23951
  }
23952
23952
  if (dateTimeIdentifiers.some(function(el) {
23953
23953
  return el === name;
@@ -23966,9 +23966,9 @@ function indent(str, spaces) {
23966
23966
  if (dateTimeIdentifiers.some(function(el) {
23967
23967
  return el.startsWith(name);
23968
23968
  })) {
23969
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23969
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
23970
23970
  }
23971
- return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23971
+ return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
23972
23972
  v: nextMatch1
23973
23973
  };
23974
23974
  };
@@ -28011,6 +28011,17 @@ let WorkerService = class WorkerService {
28011
28011
  const { execute } = params;
28012
28012
  return await executePinsList(execute, context, `${context.__PATH__}.execute`);
28013
28013
  }
28014
+ async activity(params, _pinsSettingsList, context) {
28015
+ const { name, execute } = params;
28016
+ const result = await executePinsList(execute, context, `${context.__PATH__}.execute`);
28017
+ if (!context.workflow) {
28018
+ context.workflow = {
28019
+ steps: []
28020
+ };
28021
+ }
28022
+ context.workflow.steps[name] = result;
28023
+ return result;
28024
+ }
28014
28025
  async stop(params, _pinsSettingsList, context) {
28015
28026
  const { value = {} } = params;
28016
28027
  throw {
@@ -28021,8 +28032,10 @@ let WorkerService = class WorkerService {
28021
28032
  };
28022
28033
  const task = (params, pinsSettingsList, context)=>new WorkerService().task(params, pinsSettingsList, context);
28023
28034
  const action = (params, pinsSettingsList, context)=>new WorkerService().action(params, pinsSettingsList, context);
28035
+ const activity = (params, pinsSettingsList, context)=>new WorkerService().activity(params, pinsSettingsList, context);
28024
28036
  const stop = (params, pinsSettingsList, context)=>new WorkerService().stop(params, pinsSettingsList, context);
28025
28037
 
28026
28038
  exports.action = action;
28039
+ exports.activity = activity;
28027
28040
  exports.stop = stop;
28028
28041
  exports.task = task;
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 nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23902
+ return i = i1, tokens = tokens1, 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 nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23909
+ return i = i1, tokens = tokens1, 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 nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23928
+ return i = i1, tokens = tokens1, 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 nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
23947
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
23948
23948
  }
23949
- return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
23949
+ return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
23950
23950
  v: nextMatch1
23951
23951
  };
23952
23952
  };
@@ -27989,6 +27989,17 @@ let WorkerService = class WorkerService {
27989
27989
  const { execute } = params;
27990
27990
  return await executePinsList(execute, context, `${context.__PATH__}.execute`);
27991
27991
  }
27992
+ async activity(params, _pinsSettingsList, context) {
27993
+ const { name, execute } = params;
27994
+ const result = await executePinsList(execute, context, `${context.__PATH__}.execute`);
27995
+ if (!context.workflow) {
27996
+ context.workflow = {
27997
+ steps: []
27998
+ };
27999
+ }
28000
+ context.workflow.steps[name] = result;
28001
+ return result;
28002
+ }
27992
28003
  async stop(params, _pinsSettingsList, context) {
27993
28004
  const { value = {} } = params;
27994
28005
  throw {
@@ -27999,6 +28010,7 @@ let WorkerService = class WorkerService {
27999
28010
  };
28000
28011
  const task = (params, pinsSettingsList, context)=>new WorkerService().task(params, pinsSettingsList, context);
28001
28012
  const action = (params, pinsSettingsList, context)=>new WorkerService().action(params, pinsSettingsList, context);
28013
+ const activity = (params, pinsSettingsList, context)=>new WorkerService().activity(params, pinsSettingsList, context);
28002
28014
  const stop = (params, pinsSettingsList, context)=>new WorkerService().stop(params, pinsSettingsList, context);
28003
28015
 
28004
- export { action, stop, task };
28016
+ export { action, activity, stop, task };
@@ -1,4 +1,5 @@
1
1
  import { PinsSettings } from '@digipair/engine';
2
2
  export declare const task: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
3
3
  export declare const action: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
4
+ export declare const activity: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
4
5
  export declare const stop: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-worker",
3
- "version": "0.79.1",
3
+ "version": "0.80.0",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "service"
package/schema.fr.json CHANGED
@@ -8,6 +8,35 @@
8
8
  "x-icon": "🛠"
9
9
  },
10
10
  "paths": {
11
+ "/activity": {
12
+ "summary": "Activité",
13
+ "description": "Exécute une activité.",
14
+ "tags": ["service"],
15
+ "metadata": [],
16
+ "parameters": [
17
+ {
18
+ "name": "name",
19
+ "summary": "Nom",
20
+ "required": true,
21
+ "description": "Nom de l'activité",
22
+ "schema": {
23
+ "type": "string"
24
+ }
25
+ },
26
+ {
27
+ "name": "execute",
28
+ "summary": "Execute",
29
+ "required": true,
30
+ "description": "Commandes à exécuter",
31
+ "schema": {
32
+ "type": "array",
33
+ "items": {
34
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
35
+ }
36
+ }
37
+ }
38
+ ]
39
+ },
11
40
  "/stop": {
12
41
  "post": {
13
42
  "tags": ["service"],
package/schema.json CHANGED
@@ -8,6 +8,35 @@
8
8
  "x-icon": "🛠"
9
9
  },
10
10
  "paths": {
11
+ "/activity": {
12
+ "summary": "Activity",
13
+ "description": "Execution of an activity.",
14
+ "tags": ["service"],
15
+ "metadata": [],
16
+ "parameters": [
17
+ {
18
+ "name": "name",
19
+ "summary": "Name",
20
+ "required": true,
21
+ "description": "Name of the activity",
22
+ "schema": {
23
+ "type": "string"
24
+ }
25
+ },
26
+ {
27
+ "name": "execute",
28
+ "summary": "Execute",
29
+ "required": true,
30
+ "description": "Commands to execute",
31
+ "schema": {
32
+ "type": "array",
33
+ "items": {
34
+ "$ref": "https://schemas.digipair.ai/pinsSettings"
35
+ }
36
+ }
37
+ }
38
+ ]
39
+ },
11
40
  "/stop": {
12
41
  "post": {
13
42
  "tags": ["service"],