@digipair/skill-temporal 0.18.2
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/package.json +8 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +5 -0
- package/src/index.js.map +1 -0
- package/src/lib/activities.d.ts +6 -0
- package/src/lib/activities.js +12 -0
- package/src/lib/activities.js.map +1 -0
- package/src/lib/shared.d.ts +8 -0
- package/src/lib/shared.js +6 -0
- package/src/lib/shared.js.map +1 -0
- package/src/lib/skill-temporal.d.ts +4 -0
- package/src/lib/skill-temporal.js +54 -0
- package/src/lib/skill-temporal.js.map +1 -0
- package/src/lib/workflows.d.ts +2 -0
- package/src/lib/workflows.js +105 -0
- package/src/lib/workflows.js.map +1 -0
- package/src/schema.json +141 -0
package/package.json
ADDED
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './libs/skill-temporal/src/index';
|
package/src/index.js
ADDED
package/src/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/skill-temporal/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executePinsList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const engine_1 = require("@digipair/engine");
|
|
6
|
+
function executePinsList(_a) {
|
|
7
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ pinsSettingsList, context, }) {
|
|
8
|
+
return yield (0, engine_1.executePinsList)(pinsSettingsList, context);
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
exports.executePinsList = executePinsList;
|
|
12
|
+
//# sourceMappingURL=activities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activities.js","sourceRoot":"","sources":["../../../../../libs/skill-temporal/src/lib/activities.ts"],"names":[],"mappings":";;;;AAAA,6CAA0F;AAE1F,SAAsB,eAAe;iEAAC,EACpC,gBAAgB,EAChB,OAAO,GAIR;QACC,OAAO,MAAM,IAAA,wBAAqB,EAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;CAAA;AARD,0CAQC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="libs/skill-temporal/src/digipair-engine" />
|
|
2
|
+
import { PinsSettings } from '@digipair/engine';
|
|
3
|
+
export type WorkflowArgs = {
|
|
4
|
+
steps: PinsSettings[];
|
|
5
|
+
context: any;
|
|
6
|
+
};
|
|
7
|
+
export declare const taskQueue = "digipair-workflow-queue";
|
|
8
|
+
export declare const namespace = "digipair-workflow";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../libs/skill-temporal/src/lib/shared.ts"],"names":[],"mappings":";;;AAOa,QAAA,SAAS,GAAG,yBAAyB,CAAC;AACtC,QAAA,SAAS,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="libs/skill-temporal/src/digipair-engine" />
|
|
2
|
+
import { PinsSettings } from '@digipair/engine';
|
|
3
|
+
export declare const initialize: () => Promise<void>;
|
|
4
|
+
export declare const workflow: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workflow = exports.initialize = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const client_1 = require("@temporalio/client");
|
|
6
|
+
const worker_1 = require("@temporalio/worker");
|
|
7
|
+
const workflows_1 = require("./workflows");
|
|
8
|
+
const shared_1 = require("./shared");
|
|
9
|
+
const activities = require("./activities");
|
|
10
|
+
class TemporalService {
|
|
11
|
+
initialize() {
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
13
|
+
yield this.startClient();
|
|
14
|
+
yield this.startWorker();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
startClient() {
|
|
18
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const connection = yield client_1.Connection.connect();
|
|
20
|
+
this.client = new client_1.WorkflowClient({
|
|
21
|
+
connection,
|
|
22
|
+
namespace: shared_1.namespace,
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
startWorker() {
|
|
27
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const worker = yield worker_1.Worker.create({
|
|
29
|
+
workflowsPath: require.resolve('./workflows'),
|
|
30
|
+
activities,
|
|
31
|
+
namespace: shared_1.namespace,
|
|
32
|
+
taskQueue: shared_1.taskQueue,
|
|
33
|
+
});
|
|
34
|
+
// Start accepting tasks from the Task Queue.
|
|
35
|
+
worker.run();
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
workflow(params, _pinsSettingsList, context) {
|
|
39
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const { steps } = params;
|
|
41
|
+
this.client.start(workflows_1.workflow, {
|
|
42
|
+
args: [{ steps, context }],
|
|
43
|
+
taskQueue: shared_1.taskQueue,
|
|
44
|
+
workflowId: `digipair-workflow-${context.request.digipair}-${context.request.reasoning}`,
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
let instance;
|
|
50
|
+
const initialize = () => (instance = new TemporalService()).initialize();
|
|
51
|
+
exports.initialize = initialize;
|
|
52
|
+
const workflow = (params, pinsSettingsList, context) => instance.workflow(params, pinsSettingsList, context);
|
|
53
|
+
exports.workflow = workflow;
|
|
54
|
+
//# sourceMappingURL=skill-temporal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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AG,IAAI,eAAe,EAAE,CAAC,CAAC,UAAU,EAAE,CAAC;AAAnE,QAAA,UAAU,cAAyD;AAEzE,MAAM,QAAQ,GAAG,CAAC,MAAW,EAAE,gBAAgC,EAAE,OAAY,EAAE,EAAE,CACtF,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAD1C,QAAA,QAAQ,YACkC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.workflow = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const workflow_1 = require("@temporalio/workflow");
|
|
6
|
+
const common_1 = require("@temporalio/common");
|
|
7
|
+
const engine_1 = require("@digipair/engine");
|
|
8
|
+
function executePins(executePinsList, steps, state, settingsOrigin, context) {
|
|
9
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
const settings = yield (0, engine_1.preparePinsSettings)(settingsOrigin, context);
|
|
12
|
+
let result = null;
|
|
13
|
+
if ((_a = settings.conditions) === null || _a === void 0 ? void 0 : _a.each) {
|
|
14
|
+
const results = [];
|
|
15
|
+
for (let index = 0; index < settings.conditions.each.length; index++) {
|
|
16
|
+
const item = settings.conditions.each[index];
|
|
17
|
+
const itemSettingsOrigin = Object.assign(Object.assign({}, settingsOrigin), { conditions: Object.assign(Object.assign({}, settingsOrigin.conditions), { each: undefined }) });
|
|
18
|
+
const itemContext = Object.assign(Object.assign({}, context), { item,
|
|
19
|
+
index, parent: { item: context.item, index: item.index, parent: context.parent } });
|
|
20
|
+
const itemSettings = yield (0, engine_1.preparePinsSettings)(itemSettingsOrigin, itemContext);
|
|
21
|
+
if (typeof ((_b = itemSettings.conditions) === null || _b === void 0 ? void 0 : _b.if) !== 'undefined' && !itemSettings.conditions.if) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const itemResult = yield executePins(executePinsList, steps, state, itemSettingsOrigin, itemContext);
|
|
25
|
+
results.push(itemResult);
|
|
26
|
+
}
|
|
27
|
+
return results;
|
|
28
|
+
}
|
|
29
|
+
if (settings.element === 'sleep') {
|
|
30
|
+
yield (0, workflow_1.sleep)(settings.properties['duration']);
|
|
31
|
+
}
|
|
32
|
+
else if (settings.element === 'stop') {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
else if (settings.element === 'goto') {
|
|
36
|
+
const step = steps
|
|
37
|
+
.filter(current => { var _a; return !!((_a = current.properties) === null || _a === void 0 ? void 0 : _a['name']); })
|
|
38
|
+
.findIndex(current => current.properties['name'] === settings.properties['name']);
|
|
39
|
+
if (step <= -1) {
|
|
40
|
+
throw new common_1.ApplicationFailure('[SKILL-WORKFLOW] GOTO FAILED - STEP NOT FOUND', null, null, [
|
|
41
|
+
settings.properties['name'],
|
|
42
|
+
]);
|
|
43
|
+
}
|
|
44
|
+
state.step = step;
|
|
45
|
+
}
|
|
46
|
+
else if (settings.element === 'activity') {
|
|
47
|
+
try {
|
|
48
|
+
result = yield executePinsList({
|
|
49
|
+
pinsSettingsList: settings.properties['execute'],
|
|
50
|
+
context,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
throw new common_1.ApplicationFailure('[SKILL-WORKFLOW] EXECUTEPINS FAILED', null, null, [
|
|
55
|
+
error,
|
|
56
|
+
settings,
|
|
57
|
+
context,
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return result;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
function workflow(_a) {
|
|
65
|
+
return tslib_1.__awaiter(this, arguments, void 0, function* ({ steps, context }) {
|
|
66
|
+
var _b, _c;
|
|
67
|
+
let result;
|
|
68
|
+
context.variables.workflow = {};
|
|
69
|
+
const { executePinsList } = (0, workflow_1.proxyActivities)({
|
|
70
|
+
// RetryPolicy specifies how to automatically handle retries if an Activity fails.
|
|
71
|
+
// retry: {
|
|
72
|
+
// initialInterval: '1 second',
|
|
73
|
+
// maximumInterval: '1 minute',
|
|
74
|
+
// backoffCoefficient: 2,
|
|
75
|
+
// maximumAttempts: 500,
|
|
76
|
+
// nonRetryableErrorTypes: [],
|
|
77
|
+
// },
|
|
78
|
+
// startToCloseTimeout: '1 minute',
|
|
79
|
+
});
|
|
80
|
+
// vérifie si tous les pinsSettings sont bien de la librairie @digipair/skill-worflow
|
|
81
|
+
const indexSkillNoWorkflow = steps.findIndex(pinsSettings => pinsSettings.library !== '@digipair/skill-worflow');
|
|
82
|
+
if (indexSkillNoWorkflow >= 0) {
|
|
83
|
+
throw new common_1.ApplicationFailure('[SKILL-WORKFLOW] UNKNOWN STEP', null, null, [
|
|
84
|
+
steps[indexSkillNoWorkflow],
|
|
85
|
+
]);
|
|
86
|
+
}
|
|
87
|
+
// parcourir tous les pins
|
|
88
|
+
for (let state = { step: 0 }; state.step < steps.length; state.step++) {
|
|
89
|
+
const pinsSettings = steps[state.step];
|
|
90
|
+
if (typeof ((_b = pinsSettings.conditions) === null || _b === void 0 ? void 0 : _b.if) !== 'undefined') {
|
|
91
|
+
const preparedSettings = yield (0, engine_1.preparePinsSettings)(pinsSettings, context);
|
|
92
|
+
if (!preparedSettings.conditions.if) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
result = executePins(executePinsList, steps, state, pinsSettings, context);
|
|
97
|
+
if ((_c = pinsSettings.properties) === null || _c === void 0 ? void 0 : _c['name']) {
|
|
98
|
+
context.variables.workflow[pinsSettings.properties['name']] = result;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return result;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
exports.workflow = workflow;
|
|
105
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../../../libs/skill-temporal/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CAAE,gBAAgB,CAAC,UAAkB,CAAC,EAAE,EAAE,CAAC;oBAC7C,SAAS;gBACX,CAAC;YACH,CAAC;YAED,MAAM,GAAG,WAAW,CAAC,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;YAE3E,IAAI,MAAA,YAAY,CAAC,UAAU,0CAAG,MAAM,CAAC,EAAE,CAAC;gBACtC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC;YACvE,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AA9CD,4BA8CC"}
|
package/src/schema.json
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.0",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "@digipair/skill-temporal",
|
|
5
|
+
"summary": "Gestion des workflows temporal",
|
|
6
|
+
"description": "Cette compétence permet de gérer des workflows temporal",
|
|
7
|
+
"version": "0.1.0",
|
|
8
|
+
"x-icon": "👩💻"
|
|
9
|
+
},
|
|
10
|
+
"paths": {
|
|
11
|
+
"/activity": {
|
|
12
|
+
"post": {
|
|
13
|
+
"tags": ["service"],
|
|
14
|
+
"summary": "Activitée",
|
|
15
|
+
"description": "Définit une activité",
|
|
16
|
+
"parameters": [
|
|
17
|
+
{
|
|
18
|
+
"name": "name",
|
|
19
|
+
"summary": "Nom",
|
|
20
|
+
"required": false,
|
|
21
|
+
"description": "Nom de l'étape",
|
|
22
|
+
"schema": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "execute",
|
|
28
|
+
"summary": "Exécute",
|
|
29
|
+
"required": false,
|
|
30
|
+
"description": "Liste des actions à exécuter",
|
|
31
|
+
"schema": {
|
|
32
|
+
"type": "array",
|
|
33
|
+
"items": {
|
|
34
|
+
"$ref": "https://schemas.digipair.ai/pinsSettings"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"x-events": []
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"/sleep": {
|
|
43
|
+
"post": {
|
|
44
|
+
"tags": ["service"],
|
|
45
|
+
"summary": "Attente",
|
|
46
|
+
"parameters": [
|
|
47
|
+
{
|
|
48
|
+
"name": "name",
|
|
49
|
+
"summary": "Nom",
|
|
50
|
+
"required": false,
|
|
51
|
+
"description": "Nom de l'étape",
|
|
52
|
+
"schema": {
|
|
53
|
+
"type": "string"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "duration",
|
|
58
|
+
"summary": "Durée",
|
|
59
|
+
"required": true,
|
|
60
|
+
"description": "Durée de l'attente",
|
|
61
|
+
"schema": {
|
|
62
|
+
"type": "string"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
],
|
|
66
|
+
"x-events": []
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"/goto": {
|
|
70
|
+
"post": {
|
|
71
|
+
"tags": ["service"],
|
|
72
|
+
"summary": "Aller à l'étape",
|
|
73
|
+
"parameters": [
|
|
74
|
+
{
|
|
75
|
+
"name": "target",
|
|
76
|
+
"summary": "Nom de la destination",
|
|
77
|
+
"required": true,
|
|
78
|
+
"description": "Nom de l'étape de destination",
|
|
79
|
+
"schema": {
|
|
80
|
+
"type": "string"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "name",
|
|
85
|
+
"summary": "Nom",
|
|
86
|
+
"required": false,
|
|
87
|
+
"description": "Nom de l'étape",
|
|
88
|
+
"schema": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
"x-events": []
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"/stop": {
|
|
97
|
+
"post": {
|
|
98
|
+
"tags": ["service"],
|
|
99
|
+
"summary": "Arrête le workflow",
|
|
100
|
+
"description": "Arrête le workflow",
|
|
101
|
+
"parameters": [
|
|
102
|
+
{
|
|
103
|
+
"name": "name",
|
|
104
|
+
"summary": "Nom",
|
|
105
|
+
"required": false,
|
|
106
|
+
"description": "Nom de l'étape",
|
|
107
|
+
"schema": {
|
|
108
|
+
"type": "string"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"x-events": []
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"components": {
|
|
117
|
+
"schemas": {}
|
|
118
|
+
},
|
|
119
|
+
"x-scene-blocks": {
|
|
120
|
+
"/workflow": {
|
|
121
|
+
"summary": "Workflow Temporal",
|
|
122
|
+
"description": "Execute un workflow Temporal",
|
|
123
|
+
"tags": ["service"],
|
|
124
|
+
"metadata": [],
|
|
125
|
+
"parameters": [
|
|
126
|
+
{
|
|
127
|
+
"name": "steps",
|
|
128
|
+
"summary": "Exécute les étapes suivantes",
|
|
129
|
+
"required": true,
|
|
130
|
+
"description": "Contenu de la page",
|
|
131
|
+
"schema": {
|
|
132
|
+
"type": "array",
|
|
133
|
+
"items": {
|
|
134
|
+
"$ref": "https://schemas.digipair.ai/pinsSettings"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|