@digipair/skill-temporal 0.89.0 → 0.91.0-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/.swcrc ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "jsc": {
3
+ "target": "es2017",
4
+ "parser": {
5
+ "syntax": "typescript",
6
+ "decorators": true,
7
+ "dynamicImport": true
8
+ },
9
+ "transform": {
10
+ "decoratorMetadata": true,
11
+ "legacyDecorator": true
12
+ },
13
+ "keepClassNames": true,
14
+ "externalHelpers": true,
15
+ "loose": true
16
+ },
17
+ "module": {
18
+ "type": "es6"
19
+ },
20
+ "sourceMaps": true,
21
+ "exclude": [
22
+ "jest.config.ts",
23
+ ".*\\.spec.tsx?$",
24
+ ".*\\.test.tsx?$",
25
+ "./src/jest-setup.ts$",
26
+ "./**/jest-setup.ts$"
27
+ ]
28
+ }
package/README.md ADDED
@@ -0,0 +1,7 @@
1
+ # mylib
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build mylib` to build the library.
@@ -0,0 +1,22 @@
1
+ import baseConfig from '../../eslint.config.mjs';
2
+
3
+ export default [
4
+ ...baseConfig,
5
+ {
6
+ files: ['**/*.json'],
7
+ rules: {
8
+ '@nx/dependency-checks': [
9
+ 'error',
10
+ {
11
+ ignoredFiles: [
12
+ '{projectRoot}/eslint.config.{js,cjs,mjs}',
13
+ '{projectRoot}/rollup.config.{js,ts,mjs,mts,cjs,cts}',
14
+ ],
15
+ },
16
+ ],
17
+ },
18
+ languageOptions: {
19
+ parser: await import('jsonc-eslint-parser'),
20
+ },
21
+ },
22
+ ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-temporal",
3
- "version": "0.89.0",
3
+ "version": "0.91.0-0",
4
4
  "keywords": [
5
5
  "digipair",
6
6
  "service",
@@ -13,7 +13,6 @@
13
13
  "@temporalio/workflow": "^1.10.1",
14
14
  "feelin": "^3.1.0"
15
15
  },
16
- "main": "./src/index.js",
17
- "module": "./index.esm.js",
18
- "type": "commonjs"
19
- }
16
+ "main": "./index.cjs.js",
17
+ "module": "./index.esm.js"
18
+ }
package/project.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "skill-temporal",
3
+ "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
+ "sourceRoot": "libs/skill-temporal/src",
5
+ "projectType": "library",
6
+ "targets": {
7
+ "build": {
8
+ "executor": "@nx/js:tsc",
9
+ "outputs": ["{options.outputPath}"],
10
+ "options": {
11
+ "outputPath": "dist/libs/skill-temporal",
12
+ "main": "libs/skill-temporal/src/index.ts",
13
+ "tsConfig": "libs/skill-temporal/tsconfig.lib.json",
14
+ "assets": [
15
+ "libs/skill-temporal/index.d.ts",
16
+ "libs/skill-temporal/schema.json",
17
+ "libs/skill-temporal/schema.fr.json"
18
+ ]
19
+ }
20
+ },
21
+ "publish": {
22
+ "command": "node tools/scripts/publish.mjs skill-temporal {args.ver} {args.tag}",
23
+ "dependsOn": ["build"]
24
+ }
25
+ },
26
+ "tags": []
27
+ }
@@ -0,0 +1,23 @@
1
+ declare module '@digipair/engine' {
2
+ export type PinsSettings = any;
3
+
4
+ type CONFIG_KEY = 'BASE_URL' | 'LIBRARIES';
5
+ export declare const config: {
6
+ set: (key: CONFIG_KEY, value: any) => void;
7
+ };
8
+ export declare const applyTemplate: (value: any, context: any) => any;
9
+ export declare const executePinsList: (
10
+ pinsSettingsList: PinsSettings[],
11
+ context: any,
12
+ ) => Promise<any>;
13
+ export declare const generateElementFromPins: (
14
+ pinsSettings: PinsSettings,
15
+ parent: Element,
16
+ context: any,
17
+ ) => Promise<Element | void>;
18
+ export declare const preparePinsSettings: (
19
+ settings: PinsSettings,
20
+ context: any,
21
+ ) => Promise<PinsSettings>;
22
+ export {};
23
+ }
@@ -0,0 +1 @@
1
+ declare module 'handlebars/dist/handlebars.min.js';
@@ -0,0 +1,11 @@
1
+ import { executePinsList as executePinsListEngine, PinsSettings } from '@digipair/engine';
2
+
3
+ export async function executePinsList({
4
+ pinsSettingsList,
5
+ context,
6
+ }: {
7
+ pinsSettingsList: PinsSettings[];
8
+ context: any;
9
+ }): Promise<string> {
10
+ return await executePinsListEngine(pinsSettingsList, context);
11
+ }
@@ -0,0 +1,11 @@
1
+ import { PinsSettings } from '@digipair/engine';
2
+
3
+ export type WorkflowArgs = {
4
+ steps: PinsSettings[];
5
+ context: any;
6
+ data: any;
7
+ options: any;
8
+ };
9
+
10
+ export const taskQueue = 'DIGIPAIR_WORKFLOW_TASK_QUEUE';
11
+ export const namespace = 'default';
@@ -0,0 +1,126 @@
1
+ /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3
+ import { PinsSettings } from '@digipair/engine';
4
+ import { Connection, WorkflowClient, WorkflowExecutionInfo } from '@temporalio/client';
5
+ import { NativeConnection, Worker } from '@temporalio/worker';
6
+
7
+ import { dataSignal, workflow as workflowJob } from './workflows';
8
+ import { namespace, taskQueue } from './shared';
9
+ import * as activities from './activities';
10
+
11
+ class TemporalService {
12
+ private client!: WorkflowClient;
13
+
14
+ async initialize(address = 'localhost:7233') {
15
+ await this.startClient(address);
16
+ await this.startWorker(address);
17
+ }
18
+
19
+ private async startClient(address: string) {
20
+ const connection = await Connection.connect({
21
+ address,
22
+ });
23
+
24
+ this.client = new WorkflowClient({
25
+ connection,
26
+ namespace,
27
+ });
28
+ }
29
+
30
+ private async startWorker(address: string) {
31
+ const connection = await NativeConnection.connect({
32
+ address,
33
+ });
34
+
35
+ const worker = await Worker.create({
36
+ connection,
37
+ namespace,
38
+ workflowsPath: require.resolve('./workflows'),
39
+ activities,
40
+ taskQueue,
41
+ });
42
+
43
+ // Start accepting tasks from the Task Queue.
44
+ worker.run();
45
+ }
46
+
47
+ async workflow(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
48
+ const { id, steps, data = {}, options = context.privates.TEMPORAL_OPTIONS ?? {} } = params;
49
+ const prefix =
50
+ context.privates.TEMPORAL_PREFIX ??
51
+ process.env['TEMPORAL_PREFIX'] ??
52
+ `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
53
+ const workflowOptions = {
54
+ // RetryPolicy specifies how to automatically handle retries if an Activity fails.
55
+ retry: {
56
+ initialInterval: '1 second',
57
+ maximumInterval: '1 minute',
58
+ backoffCoefficient: 2,
59
+ maximumAttempts: 50,
60
+ nonRetryableErrorTypes: [],
61
+ ...(options.retry || {}),
62
+ },
63
+ startToCloseTimeout: '1 minute',
64
+ ...options,
65
+ };
66
+
67
+ this.client.start(workflowJob, {
68
+ args: [{ steps, context: { ...context, protected: undefined, requester: { ...context.requester, protected: undefined } }, data, options: workflowOptions }],
69
+ taskQueue,
70
+ workflowId: `${prefix}${id}`,
71
+ });
72
+ }
73
+
74
+ async push(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
75
+ const { id, data } = params;
76
+ const prefix =
77
+ context.privates.TEMPORAL_PREFIX ??
78
+ process.env['TEMPORAL_PREFIX'] ??
79
+ `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
80
+ const handle = this.client.getHandle(`${prefix}${id}`);
81
+ await handle.signal(dataSignal, data);
82
+ }
83
+
84
+ async terminate(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
85
+ const { id } = params;
86
+ const prefix =
87
+ context.privates.TEMPORAL_PREFIX ??
88
+ process.env['TEMPORAL_PREFIX'] ??
89
+ `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
90
+ const handle = this.client.getHandle(`${prefix}${id}`);
91
+ await handle.terminate();
92
+ }
93
+
94
+ async list(params: any, _pinsSettingsList: PinsSettings[], context: any): Promise<any> {
95
+ const { query = `ExecutionStatus = "Running"` } = params;
96
+ const prefix =
97
+ context.privates.TEMPORAL_PREFIX ??
98
+ process.env['TEMPORAL_PREFIX'] ??
99
+ `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
100
+
101
+ const workflowIterator = this.client.list({ query: `(WorkflowId > '${prefix}' and WorkflowId < '${prefix}~') and (${query})` });
102
+ const workflows = [] as WorkflowExecutionInfo[];
103
+ for await (const workflow of workflowIterator) {
104
+ workflows.push(workflow);
105
+ }
106
+
107
+ return workflows;
108
+ }
109
+ }
110
+
111
+ let instance: TemporalService;
112
+
113
+ export const initialize = (adresse: string) =>
114
+ (instance = new TemporalService()).initialize(adresse);
115
+
116
+ export const workflow = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
117
+ instance.workflow(params, pinsSettingsList, context);
118
+
119
+ export const push = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
120
+ instance.push(params, pinsSettingsList, context);
121
+
122
+ export const terminate = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
123
+ instance.terminate(params, pinsSettingsList, context);
124
+
125
+ export const list = (params: any, pinsSettingsList: PinsSettings[], context: any) =>
126
+ instance.list(params, pinsSettingsList, context);
@@ -0,0 +1,152 @@
1
+ import { sleep, proxyActivities, condition, setHandler, defineSignal } from '@temporalio/workflow';
2
+ import { ApplicationFailure } from '@temporalio/common';
3
+ import { PinsSettings, preparePinsSettings } from '@digipair/engine';
4
+ import { evaluate } from 'feelin';
5
+
6
+ import type * as activities from './activities';
7
+ import { WorkflowArgs } from './shared';
8
+
9
+ export const dataSignal = defineSignal<[any]>('data');
10
+
11
+ async function executePins(
12
+ executePinsList: any,
13
+ steps: PinsSettings[],
14
+ state: { step: number },
15
+ settingsOrigin: PinsSettings,
16
+ context: any,
17
+ ) {
18
+ const settings = await preparePinsSettings(settingsOrigin, context);
19
+ let result = null;
20
+
21
+ if (settings.conditions?.each) {
22
+ const results = [] as any[];
23
+
24
+ for (let index = 0; index < settings.conditions.each.length; index++) {
25
+ const item = settings.conditions.each[index];
26
+ const itemSettingsOrigin = {
27
+ ...settingsOrigin,
28
+ conditions: { ...settingsOrigin.conditions, each: undefined },
29
+ };
30
+ const itemContext = {
31
+ ...context,
32
+ item,
33
+ index,
34
+ parent: { item: context.item, index: item.index, parent: context.parent },
35
+ };
36
+ const itemSettings = await preparePinsSettings(itemSettingsOrigin, itemContext);
37
+
38
+ if (typeof itemSettings.conditions?.if !== 'undefined' && !itemSettings.conditions.if) {
39
+ continue;
40
+ }
41
+
42
+ let itemResult = null;
43
+ try {
44
+ itemResult = await executePins(
45
+ executePinsList,
46
+ steps,
47
+ state,
48
+ itemSettingsOrigin,
49
+ itemContext,
50
+ );
51
+ } catch (error) {
52
+ if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
53
+ continue;
54
+ }
55
+
56
+ throw error;
57
+ }
58
+
59
+ results.push(itemResult);
60
+ }
61
+
62
+ return results;
63
+ }
64
+
65
+ if (typeof settings.conditions?.if !== 'undefined' && !settings.conditions.if) {
66
+ throw 'DIGIPAIR_CONDITIONS_IF_FALSE';
67
+ }
68
+
69
+ if (settings.element === 'sleep') {
70
+ result = await sleep((settings.properties as any)['duration']);
71
+ } else if (settings.element === 'condition') {
72
+ result = await condition(
73
+ () => evaluate(settings.properties.condition, context),
74
+ settings.properties.timeout,
75
+ );
76
+ } else if (settings.element === 'stop') {
77
+ throw 'DIGIPAIR_WORKFLOW_STOP';
78
+ } else if (settings.element === 'goto') {
79
+ const step = steps
80
+ .filter(current => !!current.properties?.['name'])
81
+ .findIndex(
82
+ current => (current.properties as any)['name'] === (settings.properties as any)['name'],
83
+ );
84
+
85
+ if (step <= -1) {
86
+ throw new ApplicationFailure('[SKILL-TEMPORAL] GOTO FAILED - STEP NOT FOUND', null, null, [
87
+ (settings.properties as any)['name'],
88
+ ]);
89
+ }
90
+ result = state.step = step;
91
+ } else if (settings.element === 'activity') {
92
+ try {
93
+ result = await executePinsList({
94
+ pinsSettingsList: (settings.properties as any)['execute'],
95
+ context,
96
+ });
97
+ } catch (error) {
98
+ throw new ApplicationFailure('[SKILL-TEMPORAL] EXECUTEPINS FAILED', null, null, [
99
+ error,
100
+ settings,
101
+ context,
102
+ ]);
103
+ }
104
+ }
105
+
106
+ return result;
107
+ }
108
+
109
+ export async function workflow({ steps, context, data, options }: WorkflowArgs): Promise<any> {
110
+ let result: any;
111
+
112
+ context.workflow = { steps: {}, data };
113
+ context.protected = {};
114
+
115
+ const { executePinsList } = proxyActivities<typeof activities>(options);
116
+ setHandler(dataSignal, (data: any) => {
117
+ context.workflow.data = { ...context.workflow.data, ...data };
118
+ });
119
+
120
+ // vérifie si tous les pinsSettings sont bien de la librairie @digipair/skill-temporal
121
+ const indexSkillNoWorkflow = steps.findIndex(
122
+ pinsSettings => pinsSettings.library !== '@digipair/skill-temporal',
123
+ );
124
+ if (indexSkillNoWorkflow >= 0) {
125
+ throw new ApplicationFailure('[SKILL-TEMPORAL] UNKNOWN STEP', null, null, [
126
+ steps[indexSkillNoWorkflow],
127
+ ]);
128
+ }
129
+
130
+ // parcourir tous les pins
131
+ for (let state = { step: 0 }; state.step < steps.length; state.step++) {
132
+ const pinsSettings = steps[state.step];
133
+
134
+ try {
135
+ result = await executePins(executePinsList, steps, state, pinsSettings, context);
136
+ } catch (error) {
137
+ if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
138
+ continue;
139
+ } else if (error === 'DIGIPAIR_WORKFLOW_STOP') {
140
+ return result;
141
+ }
142
+
143
+ throw error;
144
+ }
145
+
146
+ if (pinsSettings.properties?.['name']) {
147
+ context.workflow.steps[pinsSettings.properties['name']] = result;
148
+ }
149
+ }
150
+
151
+ return result;
152
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "files": [],
4
+ "include": [],
5
+ "references": [
6
+ {
7
+ "path": "../engine"
8
+ },
9
+ {
10
+ "path": "./tsconfig.lib.json"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "outDir": "dist",
6
+ "tsBuildInfoFile": "dist/tsconfig.lib.tsbuildinfo",
7
+ "emitDeclarationOnly": true,
8
+ "module": "esnext",
9
+ "moduleResolution": "node",
10
+ "forceConsistentCasingInFileNames": true,
11
+ "types": ["node"]
12
+ },
13
+ "include": ["src/**/*.ts"],
14
+ "references": [
15
+ {
16
+ "path": "../engine/tsconfig.lib.json"
17
+ }
18
+ ]
19
+ }
package/src/index.js DELETED
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./lib/skill-temporal"), exports);
5
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/skill-temporal/src/index.ts"],"names":[],"mappings":";;;AAAA,+DAAqC"}
@@ -1,6 +0,0 @@
1
- /// <reference types="libs/skill-temporal/src/digipair-engine" />
2
- import { PinsSettings } from '@digipair/engine';
3
- export declare function executePinsList({ pinsSettingsList, context, }: {
4
- pinsSettingsList: PinsSettings[];
5
- context: any;
6
- }): Promise<string>;
@@ -1,12 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,10 +0,0 @@
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
- data: any;
7
- options: any;
8
- };
9
- export declare const taskQueue = "DIGIPAIR_WORKFLOW_TASK_QUEUE";
10
- export declare const namespace = "default";
package/src/lib/shared.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.namespace = exports.taskQueue = void 0;
4
- exports.taskQueue = 'DIGIPAIR_WORKFLOW_TASK_QUEUE';
5
- exports.namespace = 'default';
6
- //# sourceMappingURL=shared.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../../libs/skill-temporal/src/lib/shared.ts"],"names":[],"mappings":";;;AASa,QAAA,SAAS,GAAG,8BAA8B,CAAC;AAC3C,QAAA,SAAS,GAAG,SAAS,CAAC"}
@@ -1,7 +0,0 @@
1
- /// <reference types="libs/skill-temporal/src/digipair-engine" />
2
- import { PinsSettings } from '@digipair/engine';
3
- export declare const initialize: (adresse: string) => Promise<void>;
4
- export declare const workflow: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
5
- export declare const push: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
6
- export declare const terminate: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
7
- export declare const list: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.list = exports.terminate = exports.push = 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, arguments, void 0, function* (address = 'localhost:7233') {
13
- yield this.startClient(address);
14
- yield this.startWorker(address);
15
- });
16
- }
17
- startClient(address) {
18
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
19
- const connection = yield client_1.Connection.connect({
20
- address,
21
- });
22
- this.client = new client_1.WorkflowClient({
23
- connection,
24
- namespace: shared_1.namespace,
25
- });
26
- });
27
- }
28
- startWorker(address) {
29
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
30
- const connection = yield worker_1.NativeConnection.connect({
31
- address,
32
- });
33
- const worker = yield worker_1.Worker.create({
34
- connection,
35
- namespace: shared_1.namespace,
36
- workflowsPath: require.resolve('./workflows'),
37
- activities,
38
- taskQueue: shared_1.taskQueue,
39
- });
40
- // Start accepting tasks from the Task Queue.
41
- worker.run();
42
- });
43
- }
44
- workflow(params, _pinsSettingsList, context) {
45
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
- var _a, _b, _c;
47
- const { id, steps, data = {}, options = (_a = context.privates.TEMPORAL_OPTIONS) !== null && _a !== void 0 ? _a : {} } = params;
48
- const prefix = (_c = (_b = context.privates.TEMPORAL_PREFIX) !== null && _b !== void 0 ? _b : process.env['TEMPORAL_PREFIX']) !== null && _c !== void 0 ? _c : `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
49
- const workflowOptions = Object.assign({
50
- // RetryPolicy specifies how to automatically handle retries if an Activity fails.
51
- retry: Object.assign({ initialInterval: '1 second', maximumInterval: '1 minute', backoffCoefficient: 2, maximumAttempts: 50, nonRetryableErrorTypes: [] }, (options.retry || {})), startToCloseTimeout: '1 minute' }, options);
52
- this.client.start(workflows_1.workflow, {
53
- args: [{ steps, context: Object.assign(Object.assign({}, context), { protected: undefined, requester: Object.assign(Object.assign({}, context.requester), { protected: undefined }) }), data, options: workflowOptions }],
54
- taskQueue: shared_1.taskQueue,
55
- workflowId: `${prefix}${id}`,
56
- });
57
- });
58
- }
59
- push(params, _pinsSettingsList, context) {
60
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
- var _a, _b;
62
- const { id, data } = params;
63
- const prefix = (_b = (_a = context.privates.TEMPORAL_PREFIX) !== null && _a !== void 0 ? _a : process.env['TEMPORAL_PREFIX']) !== null && _b !== void 0 ? _b : `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
64
- const handle = this.client.getHandle(`${prefix}${id}`);
65
- yield handle.signal(workflows_1.dataSignal, data);
66
- });
67
- }
68
- terminate(params, _pinsSettingsList, context) {
69
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
70
- var _a, _b;
71
- const { id } = params;
72
- const prefix = (_b = (_a = context.privates.TEMPORAL_PREFIX) !== null && _a !== void 0 ? _a : process.env['TEMPORAL_PREFIX']) !== null && _b !== void 0 ? _b : `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
73
- const handle = this.client.getHandle(`${prefix}${id}`);
74
- yield handle.terminate();
75
- });
76
- }
77
- list(params, _pinsSettingsList, context) {
78
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
- var _a, e_1, _b, _c;
80
- var _d, _e;
81
- const { query = `ExecutionStatus = "Running"` } = params;
82
- const prefix = (_e = (_d = context.privates.TEMPORAL_PREFIX) !== null && _d !== void 0 ? _d : process.env['TEMPORAL_PREFIX']) !== null && _e !== void 0 ? _e : `digipair-workflow-${context.request.digipair}-${context.request.reasoning}-`;
83
- const workflowIterator = this.client.list({ query: `(WorkflowId > '${prefix}' and WorkflowId < '${prefix}~') and (${query})` });
84
- const workflows = [];
85
- try {
86
- for (var _f = true, workflowIterator_1 = tslib_1.__asyncValues(workflowIterator), workflowIterator_1_1; workflowIterator_1_1 = yield workflowIterator_1.next(), _a = workflowIterator_1_1.done, !_a; _f = true) {
87
- _c = workflowIterator_1_1.value;
88
- _f = false;
89
- const workflow = _c;
90
- workflows.push(workflow);
91
- }
92
- }
93
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
94
- finally {
95
- try {
96
- if (!_f && !_a && (_b = workflowIterator_1.return)) yield _b.call(workflowIterator_1);
97
- }
98
- finally { if (e_1) throw e_1.error; }
99
- }
100
- return workflows;
101
- });
102
- }
103
- }
104
- let instance;
105
- const initialize = (adresse) => (instance = new TemporalService()).initialize(adresse);
106
- exports.initialize = initialize;
107
- const workflow = (params, pinsSettingsList, context) => instance.workflow(params, pinsSettingsList, context);
108
- exports.workflow = workflow;
109
- const push = (params, pinsSettingsList, context) => instance.push(params, pinsSettingsList, context);
110
- exports.push = push;
111
- const terminate = (params, pinsSettingsList, context) => instance.terminate(params, pinsSettingsList, context);
112
- exports.terminate = terminate;
113
- const list = (params, pinsSettingsList, context) => instance.list(params, pinsSettingsList, context);
114
- exports.list = list;
115
- //# sourceMappingURL=skill-temporal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"skill-temporal.js","sourceRoot":"","sources":["../../../../../libs/skill-temporal/src/lib/skill-temporal.ts"],"names":[],"mappings":";;;;AAGA,+CAAuF;AACvF,+CAA8D;AAE9D,2CAAkE;AAClE,qCAAgD;AAChD,2CAA2C;AAE3C,MAAM,eAAe;IAGb,UAAU;qEAAC,OAAO,GAAG,gBAAgB;YACzC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;YAChC,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAClC,CAAC;KAAA;IAEa,WAAW,CAAC,OAAe;;YACvC,MAAM,UAAU,GAAG,MAAM,mBAAU,CAAC,OAAO,CAAC;gBAC1C,OAAO;aACR,CAAC,CAAC;YAEH,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAc,CAAC;gBAC/B,UAAU;gBACV,SAAS,EAAT,kBAAS;aACV,CAAC,CAAC;QACL,CAAC;KAAA;IAEa,WAAW,CAAC,OAAe;;YACvC,MAAM,UAAU,GAAG,MAAM,yBAAgB,CAAC,OAAO,CAAC;gBAChD,OAAO;aACR,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,MAAM,eAAM,CAAC,MAA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AE,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAD3C,QAAA,SAAS,aACkC;AAEjD,MAAM,IAAI,GAAG,CAAC,MAAW,EAAE,gBAAgC,EAAE,OAAY,EAAE,EAAE,CAClF,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAC;AADtC,QAAA,IAAI,QACkC"}
@@ -1,3 +0,0 @@
1
- import { WorkflowArgs } from './shared';
2
- export declare const dataSignal: import("@temporalio/workflow").SignalDefinition<[any], string>;
3
- export declare function workflow({ steps, context, data, options }: WorkflowArgs): Promise<any>;
@@ -1,121 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.workflow = exports.dataSignal = 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
- const feelin_1 = require("feelin");
9
- exports.dataSignal = (0, workflow_1.defineSignal)('data');
10
- function executePins(executePinsList, steps, state, settingsOrigin, context) {
11
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
- var _a, _b, _c;
13
- const settings = yield (0, engine_1.preparePinsSettings)(settingsOrigin, context);
14
- let result = null;
15
- if ((_a = settings.conditions) === null || _a === void 0 ? void 0 : _a.each) {
16
- const results = [];
17
- for (let index = 0; index < settings.conditions.each.length; index++) {
18
- const item = settings.conditions.each[index];
19
- const itemSettingsOrigin = Object.assign(Object.assign({}, settingsOrigin), { conditions: Object.assign(Object.assign({}, settingsOrigin.conditions), { each: undefined }) });
20
- const itemContext = Object.assign(Object.assign({}, context), { item,
21
- index, parent: { item: context.item, index: item.index, parent: context.parent } });
22
- const itemSettings = yield (0, engine_1.preparePinsSettings)(itemSettingsOrigin, itemContext);
23
- if (typeof ((_b = itemSettings.conditions) === null || _b === void 0 ? void 0 : _b.if) !== 'undefined' && !itemSettings.conditions.if) {
24
- continue;
25
- }
26
- let itemResult = null;
27
- try {
28
- itemResult = yield executePins(executePinsList, steps, state, itemSettingsOrigin, itemContext);
29
- }
30
- catch (error) {
31
- if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
32
- continue;
33
- }
34
- throw error;
35
- }
36
- results.push(itemResult);
37
- }
38
- return results;
39
- }
40
- if (typeof ((_c = settings.conditions) === null || _c === void 0 ? void 0 : _c.if) !== 'undefined' && !settings.conditions.if) {
41
- throw 'DIGIPAIR_CONDITIONS_IF_FALSE';
42
- }
43
- if (settings.element === 'sleep') {
44
- result = yield (0, workflow_1.sleep)(settings.properties['duration']);
45
- }
46
- else if (settings.element === 'condition') {
47
- result = yield (0, workflow_1.condition)(() => (0, feelin_1.evaluate)(settings.properties.condition, context), settings.properties.timeout);
48
- }
49
- else if (settings.element === 'stop') {
50
- throw 'DIGIPAIR_WORKFLOW_STOP';
51
- }
52
- else if (settings.element === 'goto') {
53
- const step = steps
54
- .filter(current => { var _a; return !!((_a = current.properties) === null || _a === void 0 ? void 0 : _a['name']); })
55
- .findIndex(current => current.properties['name'] === settings.properties['name']);
56
- if (step <= -1) {
57
- throw new common_1.ApplicationFailure('[SKILL-TEMPORAL] GOTO FAILED - STEP NOT FOUND', null, null, [
58
- settings.properties['name'],
59
- ]);
60
- }
61
- result = state.step = step;
62
- }
63
- else if (settings.element === 'activity') {
64
- try {
65
- result = yield executePinsList({
66
- pinsSettingsList: settings.properties['execute'],
67
- context,
68
- });
69
- }
70
- catch (error) {
71
- throw new common_1.ApplicationFailure('[SKILL-TEMPORAL] EXECUTEPINS FAILED', null, null, [
72
- error,
73
- settings,
74
- context,
75
- ]);
76
- }
77
- }
78
- return result;
79
- });
80
- }
81
- function workflow(_a) {
82
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ steps, context, data, options }) {
83
- var _b;
84
- let result;
85
- context.workflow = { steps: {}, data };
86
- context.protected = {};
87
- const { executePinsList } = (0, workflow_1.proxyActivities)(options);
88
- (0, workflow_1.setHandler)(exports.dataSignal, (data) => {
89
- context.workflow.data = Object.assign(Object.assign({}, context.workflow.data), data);
90
- });
91
- // vérifie si tous les pinsSettings sont bien de la librairie @digipair/skill-temporal
92
- const indexSkillNoWorkflow = steps.findIndex(pinsSettings => pinsSettings.library !== '@digipair/skill-temporal');
93
- if (indexSkillNoWorkflow >= 0) {
94
- throw new common_1.ApplicationFailure('[SKILL-TEMPORAL] UNKNOWN STEP', null, null, [
95
- steps[indexSkillNoWorkflow],
96
- ]);
97
- }
98
- // parcourir tous les pins
99
- for (let state = { step: 0 }; state.step < steps.length; state.step++) {
100
- const pinsSettings = steps[state.step];
101
- try {
102
- result = yield executePins(executePinsList, steps, state, pinsSettings, context);
103
- }
104
- catch (error) {
105
- if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
106
- continue;
107
- }
108
- else if (error === 'DIGIPAIR_WORKFLOW_STOP') {
109
- return result;
110
- }
111
- throw error;
112
- }
113
- if ((_b = pinsSettings.properties) === null || _b === void 0 ? void 0 : _b['name']) {
114
- context.workflow.steps[pinsSettings.properties['name']] = result;
115
- }
116
- }
117
- return result;
118
- });
119
- }
120
- exports.workflow = workflow;
121
- //# sourceMappingURL=workflows.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../../../../libs/skill-temporal/src/lib/workflows.ts"],"names":[],"mappings":";;;;AAAA,mDAAmG;AACnG,+CAAwD;AACxD,6CAAqE;AACrE,mCAAkC;AAKrB,QAAA,UAAU,GAAG,IAAA,uBAAY,EAAQ,MAAM,CAAC,CAAC;AAEtD,SAAe,WAAW,CACxB,eAAoB,EACpB,KAAqB,EACrB,KAAuB,EACvB,cAA4B,EAC5B,OAAY;;;QAEZ,MAAM,QAAQ,GAAG,MAAM,IAAA,4BAAmB,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACpE,IAAI,MAAM,GAAG,IAAI,CAAC;QAElB,IAAI,MAAA,QAAQ,CAAC,UAAU,0CAAE,IAAI,EAAE,CAAC;YAC9B,MAAM,O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