@venturialstd/workflow 0.1.67 → 0.1.70

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.
Files changed (26) hide show
  1. package/dist/modules/session/actions/index.d.ts +1 -0
  2. package/dist/modules/session/actions/index.d.ts.map +1 -1
  3. package/dist/modules/session/actions/index.js +1 -0
  4. package/dist/modules/session/actions/index.js.map +1 -1
  5. package/dist/modules/session/actions/save-context-by-key.action.d.ts +3 -0
  6. package/dist/modules/session/actions/save-context-by-key.action.d.ts.map +1 -0
  7. package/dist/modules/session/actions/save-context-by-key.action.js +62 -0
  8. package/dist/modules/session/actions/save-context-by-key.action.js.map +1 -0
  9. package/dist/modules/session/services/get-session-by-key.service.d.ts.map +1 -1
  10. package/dist/modules/session/services/get-session-by-key.service.js +0 -1
  11. package/dist/modules/session/services/get-session-by-key.service.js.map +1 -1
  12. package/dist/modules/session/services/index.d.ts +1 -0
  13. package/dist/modules/session/services/index.d.ts.map +1 -1
  14. package/dist/modules/session/services/index.js +1 -0
  15. package/dist/modules/session/services/index.js.map +1 -1
  16. package/dist/modules/session/services/save-context-by-key.service.d.ts +10 -0
  17. package/dist/modules/session/services/save-context-by-key.service.d.ts.map +1 -0
  18. package/dist/modules/session/services/save-context-by-key.service.js +58 -0
  19. package/dist/modules/session/services/save-context-by-key.service.js.map +1 -0
  20. package/dist/modules/session/session-nest.module.d.ts.map +1 -1
  21. package/dist/modules/session/session-nest.module.js +2 -2
  22. package/dist/modules/session/session-nest.module.js.map +1 -1
  23. package/dist/modules/session/session.module.d.ts.map +1 -1
  24. package/dist/modules/session/session.module.js +1 -1
  25. package/dist/modules/session/session.module.js.map +1 -1
  26. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
1
  export * from './get-session-by-key.action';
2
+ export * from './save-context-by-key.action';
2
3
  export * from './set-session-variable.action';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC"}
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-session-by-key.action"), exports);
18
+ __exportStar(require("./save-context-by-key.action"), exports);
18
19
  __exportStar(require("./set-session-variable.action"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/session/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,gEAA8C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/session/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA4C;AAC5C,+DAA6C;AAC7C,gEAA8C"}
@@ -0,0 +1,3 @@
1
+ import { WorkflowActionTrigger } from '../../types';
2
+ export declare const saveContextByKeyAction: WorkflowActionTrigger;
3
+ //# sourceMappingURL=save-context-by-key.action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-context-by-key.action.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/actions/save-context-by-key.action.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAGrB,eAAO,MAAM,sBAAsB,EAAE,qBAuDpC,CAAC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.saveContextByKeyAction = void 0;
4
+ const types_1 = require("../../types");
5
+ const save_context_by_key_service_1 = require("../services/save-context-by-key.service");
6
+ exports.saveContextByKeyAction = {
7
+ key: 'save-context-by-key',
8
+ name: 'Save Context By Key',
9
+ description: 'Save the current workflow execution context with a specific key for later retrieval',
10
+ category: types_1.NODE_CATEGORY.ACTION,
11
+ icon: '💾',
12
+ serviceClass: save_context_by_key_service_1.SaveContextByKeyService,
13
+ inputs: [
14
+ {
15
+ id: 'contextKey',
16
+ name: 'Context Key',
17
+ description: 'The key to use for storing the context (used for retrieval later)',
18
+ type: types_1.FIELD_TYPE.STRING,
19
+ validation: {
20
+ required: true,
21
+ },
22
+ placeholder: 'e.g., user-onboarding-state, checkout-data',
23
+ },
24
+ {
25
+ id: 'ttl',
26
+ name: 'TTL (Time To Live)',
27
+ description: 'Optional: Time to live in seconds (default: 1 hour). Leave empty to use default.',
28
+ type: types_1.FIELD_TYPE.NUMBER,
29
+ validation: {
30
+ required: false,
31
+ },
32
+ placeholder: 'e.g., 3600 (1 hour), 86400 (24 hours)',
33
+ },
34
+ ],
35
+ outputs: [
36
+ {
37
+ id: 'success',
38
+ name: 'Success',
39
+ description: 'Whether the context was saved successfully',
40
+ type: types_1.FIELD_TYPE.BOOLEAN,
41
+ },
42
+ {
43
+ id: 'contextKey',
44
+ name: 'Context Key',
45
+ description: 'The key that was used to save the context',
46
+ type: types_1.FIELD_TYPE.STRING,
47
+ },
48
+ {
49
+ id: 'savedAt',
50
+ name: 'Saved At',
51
+ description: 'Timestamp when the context was saved',
52
+ type: types_1.FIELD_TYPE.STRING,
53
+ },
54
+ {
55
+ id: 'message',
56
+ name: 'Message',
57
+ description: 'Success message',
58
+ type: types_1.FIELD_TYPE.STRING,
59
+ },
60
+ ],
61
+ };
62
+ //# sourceMappingURL=save-context-by-key.action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-context-by-key.action.js","sourceRoot":"","sources":["../../../../src/modules/session/actions/save-context-by-key.action.ts"],"names":[],"mappings":";;;AAAA,uCAKqB;AACrB,yFAAkF;AAErE,QAAA,sBAAsB,GAA0B;IAC3D,GAAG,EAAE,qBAAqB;IAC1B,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qFAAqF;IAClG,QAAQ,EAAE,qBAAa,CAAC,MAAM;IAC9B,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,qDAA6E;IAC3F,MAAM,EAAE;QACN;YACE,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,mEAAmE;YAChF,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE;gBACV,QAAQ,EAAE,IAAI;aACf;YACD,WAAW,EAAE,4CAA4C;SAC1D;QACD;YACE,EAAE,EAAE,KAAK;YACT,IAAI,EAAE,oBAAoB;YAC1B,WAAW,EAAE,kFAAkF;YAC/F,IAAI,EAAE,kBAAU,CAAC,MAAM;YACvB,UAAU,EAAE;gBACV,QAAQ,EAAE,KAAK;aAChB;YACD,WAAW,EAAE,uCAAuC;SACrD;KACF;IACD,OAAO,EAAE;QACP;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,4CAA4C;YACzD,IAAI,EAAE,kBAAU,CAAC,OAAO;SACzB;QACD;YACE,EAAE,EAAE,YAAY;YAChB,IAAI,EAAE,aAAa;YACnB,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;QACD;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,sCAAsC;YACnD,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;QACD;YACE,EAAE,EAAE,SAAS;YACb,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,kBAAU,CAAC,MAAM;SACxB;KACF;CACF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-session-by-key.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/services/get-session-by-key.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAK5E,UAAU,mBAAmB;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,qBACa,sBAAuB,YAAW,sBAAsB;IAEjE,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,wBAAwB;gBAFxB,YAAY,EAAE,YAAY,EAC1B,sBAAsB,EAAE,sBAAsB,EAC9C,wBAAwB,EAAE,wBAAwB;IAI/D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;KAAE,CAAC;CAmCrF"}
1
+ {"version":3,"file":"get-session-by-key.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/services/get-session-by-key.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAK5E,UAAU,mBAAmB;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC/B;AAED,qBACa,sBAAuB,YAAW,sBAAsB;IAEjE,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,wBAAwB;gBAFxB,YAAY,EAAE,YAAY,EAC1B,sBAAsB,EAAE,sBAAsB,EAC9C,wBAAwB,EAAE,wBAAwB;IAI/D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAAA;KAAE,CAAC;CAiCrF"}
@@ -42,7 +42,6 @@ let GetSessionByKeyService = class GetSessionByKeyService {
42
42
  response.error = `Session with key "${sessionKey}" not found in cache`;
43
43
  return response;
44
44
  }
45
- await this.cacheService.set(sessionKey, cachedSessionData, undefined, core_1.CACHE_TTL.FIFTEEN_MINUTES);
46
45
  response.error = '';
47
46
  response.success = true;
48
47
  response.session = {
@@ -1 +1 @@
1
- {"version":3,"file":"get-session-by-key.service.js","sourceRoot":"","sources":["../../../../src/modules/session/services/get-session-by-key.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAA6D;AAE7D,6FAAwF;AACxF,yFAAoF;AAa7E,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAEd;IACA;IACA;IAHnB,YACmB,YAA0B,EAC1B,sBAA8C,EAC9C,wBAAkD;QAFlD,iBAAY,GAAZ,YAAY,CAAc;QAC1B,2BAAsB,GAAtB,sBAAsB,CAAwB;QAC9C,6BAAwB,GAAxB,wBAAwB,CAA0B;IAClE,CAAC;IAGJ,KAAK,CAAC,OAAO,CACX,MAA+B,EAC/B,OAA8B;QAE9B,MAAM,QAAQ,GAAG;YACf,OAAO,EAAE,KAAK;YACd,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE;gBACP,aAAa,EAAE,EAAE;gBACjB,WAAW,EAAE,EAAE;gBACf,IAAI,EAAE,EAAE;aACc;SACzB,CAAC;QACF,MAAM,UAAU,GAAG,MAAM,CAAC,UAAoB,CAAC;QAE/C,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC7C,CAAC;QAGD,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAA6B,UAAU,CAAC,CAAC;QAE9F,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,QAAQ,CAAC,KAAK,GAAG,qBAAqB,UAAU,sBAAsB,CAAC;YACvE,OAAO,QAAQ,CAAC;QAClB,CAAC;QAED,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAS,CAAC,eAAe,CAAC,CAAC;QAEjG,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;QACpB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;QACxB,QAAQ,CAAC,OAAO,GAAG;YACjB,aAAa,EAAE,iBAAiB,CAAC,aAAa;YAC9C,WAAW,EAAE,iBAAiB,CAAC,WAAW;YAC1C,IAAI,EAAE,iBAAiB,CAAC,IAAI;SAC7B,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAA;AA9CY,wDAAsB;iCAAtB,sBAAsB;IADlC,IAAA,mBAAU,GAAE;qCAGsB,mBAAY;QACF,iDAAsB;QACpB,qDAAwB;GAJ1D,sBAAsB,CA8ClC"}
1
+ {"version":3,"file":"get-session-by-key.service.js","sourceRoot":"","sources":["../../../../src/modules/session/services/get-session-by-key.service.ts"],"names":[],"mappings":";;;;;;;;;;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;IADlC,IAAA,mBAAU,GAAE;qCAGsB,mBAAY;QACF,iDAAsB;QACpB,qDAAwB;GAJ1D,sBAAsB,CA4ClC"}
@@ -1,3 +1,4 @@
1
1
  export * from './get-session-by-key.service';
2
+ export * from './save-context-by-key.service';
2
3
  export * from './set-session-variable.service';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC"}
@@ -15,5 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./get-session-by-key.service"), exports);
18
+ __exportStar(require("./save-context-by-key.service"), exports);
18
19
  __exportStar(require("./set-session-variable.service"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/session/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,iEAA+C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/session/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+DAA6C;AAC7C,gEAA8C;AAC9C,iEAA+C"}
@@ -0,0 +1,10 @@
1
+ import { CacheService } from '@venturialstd/core';
2
+ import { WorkflowExecutionService } from '../../../services/workflow-execution.service';
3
+ import { IWorkflowActionService, WorkflowActionContext } from '../../types';
4
+ export declare class SaveContextByKeyService implements IWorkflowActionService {
5
+ private readonly cacheService;
6
+ private readonly workflowExecutionService;
7
+ constructor(cacheService: CacheService, workflowExecutionService: WorkflowExecutionService);
8
+ perform(inputs: Record<string, unknown>, context: WorkflowActionContext): Promise<Record<string, unknown>>;
9
+ }
10
+ //# sourceMappingURL=save-context-by-key.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-context-by-key.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/session/services/save-context-by-key.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAW5E,qBACa,uBAAwB,YAAW,sBAAsB;IAElE,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,wBAAwB;gBADxB,YAAY,EAAE,YAAY,EAC1B,wBAAwB,EAAE,wBAAwB;IAG/D,OAAO,CACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAsCpC"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SaveContextByKeyService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const core_1 = require("@venturialstd/core");
15
+ const workflow_execution_service_1 = require("../../../services/workflow-execution.service");
16
+ let SaveContextByKeyService = class SaveContextByKeyService {
17
+ cacheService;
18
+ workflowExecutionService;
19
+ constructor(cacheService, workflowExecutionService) {
20
+ this.cacheService = cacheService;
21
+ this.workflowExecutionService = workflowExecutionService;
22
+ }
23
+ async perform(inputs, context) {
24
+ const contextKey = inputs.contextKey;
25
+ const ttl = inputs.ttl;
26
+ if (!contextKey) {
27
+ throw new Error('Context key is required');
28
+ }
29
+ if (!context.executionId) {
30
+ throw new Error('Execution ID is required in context');
31
+ }
32
+ const execution = await this.workflowExecutionService.findOne({
33
+ where: { id: context.executionId },
34
+ });
35
+ if (!execution) {
36
+ throw new Error(`Execution with ID "${context.executionId}" not found`);
37
+ }
38
+ const contextData = {
39
+ currentNodeId: execution.currentNodeId || '',
40
+ executionId: context.executionId,
41
+ data: context.previousOutputs || {},
42
+ };
43
+ await this.cacheService.set(contextKey, contextData, undefined, ttl);
44
+ return {
45
+ success: true,
46
+ contextKey,
47
+ savedAt: new Date().toISOString(),
48
+ message: `Context saved successfully with key "${contextKey}"`,
49
+ };
50
+ }
51
+ };
52
+ exports.SaveContextByKeyService = SaveContextByKeyService;
53
+ exports.SaveContextByKeyService = SaveContextByKeyService = __decorate([
54
+ (0, common_1.Injectable)(),
55
+ __metadata("design:paramtypes", [core_1.CacheService,
56
+ workflow_execution_service_1.WorkflowExecutionService])
57
+ ], SaveContextByKeyService);
58
+ //# sourceMappingURL=save-context-by-key.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-context-by-key.service.js","sourceRoot":"","sources":["../../../../src/modules/session/services/save-context-by-key.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6CAAkD;AAElD,6FAAwF;AAajF,IAAM,uBAAuB,GAA7B,MAAM,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B;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;qCAGsB,mBAAY;QACA,qDAAwB;GAH1D,uBAAuB,CA+CnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"session-nest.module.d.ts","sourceRoot":"","sources":["../../../src/modules/session/session-nest.module.ts"],"names":[],"mappings":"AAKA,qBAKa,iBAAiB;CAAG"}
1
+ {"version":3,"file":"session-nest.module.d.ts","sourceRoot":"","sources":["../../../src/modules/session/session-nest.module.ts"],"names":[],"mappings":"AASA,qBAKa,iBAAiB;CAAG"}
@@ -16,8 +16,8 @@ exports.SessionNestModule = SessionNestModule;
16
16
  exports.SessionNestModule = SessionNestModule = __decorate([
17
17
  (0, common_1.Module)({
18
18
  imports: [workflow_core_module_1.WorkflowCoreModule],
19
- providers: [services_1.GetSessionByKeyService, services_1.SetSessionVariableService],
20
- exports: [services_1.GetSessionByKeyService, services_1.SetSessionVariableService],
19
+ providers: [services_1.GetSessionByKeyService, services_1.SaveContextByKeyService, services_1.SetSessionVariableService],
20
+ exports: [services_1.GetSessionByKeyService, services_1.SaveContextByKeyService, services_1.SetSessionVariableService],
21
21
  })
22
22
  ], SessionNestModule);
23
23
  //# sourceMappingURL=session-nest.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session-nest.module.js","sourceRoot":"","sources":["../../../src/modules/session/session-nest.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,qEAAgE;AAChE,yCAA+E;AAOxE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAL7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yCAAkB,CAAC;QAC7B,SAAS,EAAE,CAAC,iCAAsB,EAAE,oCAAyB,CAAC;QAC9D,OAAO,EAAE,CAAC,iCAAsB,EAAE,oCAAyB,CAAC;KAC7D,CAAC;GACW,iBAAiB,CAAG"}
1
+ {"version":3,"file":"session-nest.module.js","sourceRoot":"","sources":["../../../src/modules/session/session-nest.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AAExC,qEAAgE;AAChE,yCAIoB;AAOb,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CAAG,CAAA;AAApB,8CAAiB;4BAAjB,iBAAiB;IAL7B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yCAAkB,CAAC;QAC7B,SAAS,EAAE,CAAC,iCAAsB,EAAE,kCAAuB,EAAE,oCAAyB,CAAC;QACvF,OAAO,EAAE,CAAC,iCAAsB,EAAE,kCAAuB,EAAE,oCAAyB,CAAC;KACtF,CAAC;GACW,iBAAiB,CAAG"}
@@ -1 +1 @@
1
- {"version":3,"file":"session.module.d.ts","sourceRoot":"","sources":["../../../src/modules/session/session.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAGpD,eAAO,MAAM,aAAa,EAAE,wBAQ3B,CAAC"}
1
+ {"version":3,"file":"session.module.d.ts","sourceRoot":"","sources":["../../../src/modules/session/session.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAOpD,eAAO,MAAM,aAAa,EAAE,wBAQ3B,CAAC"}
@@ -8,7 +8,7 @@ exports.sessionModule = {
8
8
  description: 'Manage workflow session variables and context',
9
9
  icon: '💾',
10
10
  version: '1.0.0',
11
- actions: [actions_1.getSessionByKeyAction, actions_1.setSessionVariableAction],
11
+ actions: [actions_1.getSessionByKeyAction, actions_1.saveContextByKeyAction, actions_1.setSessionVariableAction],
12
12
  triggers: [],
13
13
  };
14
14
  //# sourceMappingURL=session.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"session.module.js","sourceRoot":"","sources":["../../../src/modules/session/session.module.ts"],"names":[],"mappings":";;;AACA,uCAA4E;AAE/D,QAAA,aAAa,GAA6B;IACrD,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,CAAC,+BAAqB,EAAE,kCAAwB,CAAC;IAC1D,QAAQ,EAAE,EAAE;CACb,CAAC"}
1
+ {"version":3,"file":"session.module.js","sourceRoot":"","sources":["../../../src/modules/session/session.module.ts"],"names":[],"mappings":";;;AACA,uCAImB;AAEN,QAAA,aAAa,GAA6B;IACrD,GAAG,EAAE,SAAS;IACd,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,+CAA+C;IAC5D,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE,CAAC,+BAAqB,EAAE,gCAAsB,EAAE,kCAAwB,CAAC;IAClF,QAAQ,EAAE,EAAE;CACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venturialstd/workflow",
3
- "version": "0.1.67",
3
+ "version": "0.1.70",
4
4
  "description": "Workflow Module for Venturial",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",