@venturialstd/workflow 0.1.86 → 0.1.89
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/dist/controllers/workflow-sse.controller.d.ts +8 -0
- package/dist/controllers/workflow-sse.controller.d.ts.map +1 -0
- package/dist/controllers/workflow-sse.controller.js +40 -0
- package/dist/controllers/workflow-sse.controller.js.map +1 -0
- package/dist/modules/fintech/actions/get-latest-remittances-by-account.action.d.ts.map +1 -1
- package/dist/modules/fintech/actions/get-latest-remittances-by-account.action.js +22 -5
- package/dist/modules/fintech/actions/get-latest-remittances-by-account.action.js.map +1 -1
- package/dist/modules/fintech/services/get-latest-remittances-by-account.service.js +2 -2
- package/dist/modules/fintech/services/get-latest-remittances-by-account.service.js.map +1 -1
- package/dist/modules/inbestgo/actions/create-transaction.action.d.ts +3 -0
- package/dist/modules/inbestgo/actions/create-transaction.action.d.ts.map +1 -0
- package/dist/modules/inbestgo/actions/create-transaction.action.js +132 -0
- package/dist/modules/inbestgo/actions/create-transaction.action.js.map +1 -0
- package/dist/modules/inbestgo/actions/index.d.ts +3 -0
- package/dist/modules/inbestgo/actions/index.d.ts.map +1 -0
- package/dist/modules/inbestgo/actions/index.js +19 -0
- package/dist/modules/inbestgo/actions/index.js.map +1 -0
- package/dist/modules/inbestgo/actions/lookup-user-by-phone.action.d.ts +3 -0
- package/dist/modules/inbestgo/actions/lookup-user-by-phone.action.d.ts.map +1 -0
- package/dist/modules/inbestgo/actions/lookup-user-by-phone.action.js +76 -0
- package/dist/modules/inbestgo/actions/lookup-user-by-phone.action.js.map +1 -0
- package/dist/modules/inbestgo/auth/inbestgo-auth.service.d.ts +8 -0
- package/dist/modules/inbestgo/auth/inbestgo-auth.service.d.ts.map +1 -0
- package/dist/modules/inbestgo/auth/inbestgo-auth.service.js +75 -0
- package/dist/modules/inbestgo/auth/inbestgo-auth.service.js.map +1 -0
- package/dist/modules/inbestgo/auth/index.d.ts +2 -0
- package/dist/modules/inbestgo/auth/index.d.ts.map +1 -0
- package/dist/modules/inbestgo/auth/index.js +18 -0
- package/dist/modules/inbestgo/auth/index.js.map +1 -0
- package/dist/modules/inbestgo/credentials.d.ts +3 -0
- package/dist/modules/inbestgo/credentials.d.ts.map +1 -0
- package/dist/modules/inbestgo/credentials.js +32 -0
- package/dist/modules/inbestgo/credentials.js.map +1 -0
- package/dist/modules/inbestgo/inbestgo-nest.module.d.ts +3 -0
- package/dist/modules/inbestgo/inbestgo-nest.module.d.ts.map +1 -0
- package/dist/modules/inbestgo/inbestgo-nest.module.js +29 -0
- package/dist/modules/inbestgo/inbestgo-nest.module.js.map +1 -0
- package/dist/modules/inbestgo/inbestgo.module.d.ts +3 -0
- package/dist/modules/inbestgo/inbestgo.module.d.ts.map +1 -0
- package/dist/modules/inbestgo/inbestgo.module.js +21 -0
- package/dist/modules/inbestgo/inbestgo.module.js.map +1 -0
- package/dist/modules/inbestgo/services/create-transaction.service.d.ts +8 -0
- package/dist/modules/inbestgo/services/create-transaction.service.d.ts.map +1 -0
- package/dist/modules/inbestgo/services/create-transaction.service.js +78 -0
- package/dist/modules/inbestgo/services/create-transaction.service.js.map +1 -0
- package/dist/modules/inbestgo/services/index.d.ts +3 -0
- package/dist/modules/inbestgo/services/index.d.ts.map +1 -0
- package/dist/modules/inbestgo/services/index.js +19 -0
- package/dist/modules/inbestgo/services/index.js.map +1 -0
- package/dist/modules/inbestgo/services/lookup-user-by-phone.service.d.ts +8 -0
- package/dist/modules/inbestgo/services/lookup-user-by-phone.service.d.ts.map +1 -0
- package/dist/modules/inbestgo/services/lookup-user-by-phone.service.js +54 -0
- package/dist/modules/inbestgo/services/lookup-user-by-phone.service.js.map +1 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +5 -1
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/user/actions/get-or-create-user.action.d.ts.map +1 -1
- package/dist/modules/user/actions/get-or-create-user.action.js +12 -2
- package/dist/modules/user/actions/get-or-create-user.action.js.map +1 -1
- package/dist/modules/user/services/get-or-create-user.service.d.ts.map +1 -1
- package/dist/modules/user/services/get-or-create-user.service.js +39 -3
- package/dist/modules/user/services/get-or-create-user.service.js.map +1 -1
- package/dist/services/workflow-sse.service.d.ts +29 -0
- package/dist/services/workflow-sse.service.d.ts.map +1 -0
- package/dist/services/workflow-sse.service.js +155 -0
- package/dist/services/workflow-sse.service.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.WorkflowSSEService = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const rxjs_1 = require("rxjs");
|
|
12
|
+
let WorkflowSSEService = class WorkflowSSEService {
|
|
13
|
+
eventSubjects = new Map();
|
|
14
|
+
getEventSubject(workflowId) {
|
|
15
|
+
if (!this.eventSubjects.has(workflowId)) {
|
|
16
|
+
this.eventSubjects.set(workflowId, new rxjs_1.Subject());
|
|
17
|
+
}
|
|
18
|
+
return this.eventSubjects.get(workflowId);
|
|
19
|
+
}
|
|
20
|
+
subscribe(workflowId) {
|
|
21
|
+
return this.getEventSubject(workflowId).asObservable();
|
|
22
|
+
}
|
|
23
|
+
emitWorkflowStarted(workflowId, workflowExecutionId, data) {
|
|
24
|
+
const event = {
|
|
25
|
+
type: 'workflow.started',
|
|
26
|
+
workflowId,
|
|
27
|
+
workflowExecutionId,
|
|
28
|
+
status: 'running',
|
|
29
|
+
timestamp: new Date(),
|
|
30
|
+
data,
|
|
31
|
+
};
|
|
32
|
+
this.emit(workflowId, event);
|
|
33
|
+
}
|
|
34
|
+
emitWorkflowCompleted(workflowId, workflowExecutionId, data) {
|
|
35
|
+
const event = {
|
|
36
|
+
type: 'workflow.completed',
|
|
37
|
+
workflowId,
|
|
38
|
+
workflowExecutionId,
|
|
39
|
+
status: 'completed',
|
|
40
|
+
timestamp: new Date(),
|
|
41
|
+
data,
|
|
42
|
+
};
|
|
43
|
+
this.emit(workflowId, event);
|
|
44
|
+
}
|
|
45
|
+
emitWorkflowFailed(workflowId, workflowExecutionId, errorMessage, data) {
|
|
46
|
+
const event = {
|
|
47
|
+
type: 'workflow.failed',
|
|
48
|
+
workflowId,
|
|
49
|
+
workflowExecutionId,
|
|
50
|
+
status: 'failed',
|
|
51
|
+
timestamp: new Date(),
|
|
52
|
+
errorMessage,
|
|
53
|
+
data,
|
|
54
|
+
};
|
|
55
|
+
this.emit(workflowId, event);
|
|
56
|
+
}
|
|
57
|
+
emitNodeStarted(workflowId, workflowExecutionId, nodeId, nodeLabel) {
|
|
58
|
+
const event = {
|
|
59
|
+
type: 'node.started',
|
|
60
|
+
workflowId,
|
|
61
|
+
workflowExecutionId,
|
|
62
|
+
nodeId,
|
|
63
|
+
nodeLabel,
|
|
64
|
+
status: 'running',
|
|
65
|
+
timestamp: new Date(),
|
|
66
|
+
};
|
|
67
|
+
this.emit(workflowId, event);
|
|
68
|
+
}
|
|
69
|
+
emitNodeRunning(workflowId, workflowExecutionId, nodeId, nodeLabel, data) {
|
|
70
|
+
const event = {
|
|
71
|
+
type: 'node.running',
|
|
72
|
+
workflowId,
|
|
73
|
+
workflowExecutionId,
|
|
74
|
+
nodeId,
|
|
75
|
+
nodeLabel,
|
|
76
|
+
status: 'running',
|
|
77
|
+
timestamp: new Date(),
|
|
78
|
+
data,
|
|
79
|
+
};
|
|
80
|
+
this.emit(workflowId, event);
|
|
81
|
+
}
|
|
82
|
+
emitNodeCompleted(workflowId, workflowExecutionId, nodeId, nodeLabel, data) {
|
|
83
|
+
const event = {
|
|
84
|
+
type: 'node.completed',
|
|
85
|
+
workflowId,
|
|
86
|
+
workflowExecutionId,
|
|
87
|
+
nodeId,
|
|
88
|
+
nodeLabel,
|
|
89
|
+
status: 'completed',
|
|
90
|
+
timestamp: new Date(),
|
|
91
|
+
data,
|
|
92
|
+
};
|
|
93
|
+
this.emit(workflowId, event);
|
|
94
|
+
}
|
|
95
|
+
emitNodeFailed(workflowId, workflowExecutionId, nodeId, nodeLabel, errorMessage, data) {
|
|
96
|
+
const event = {
|
|
97
|
+
type: 'node.failed',
|
|
98
|
+
workflowId,
|
|
99
|
+
workflowExecutionId,
|
|
100
|
+
nodeId,
|
|
101
|
+
nodeLabel,
|
|
102
|
+
status: 'failed',
|
|
103
|
+
timestamp: new Date(),
|
|
104
|
+
errorMessage,
|
|
105
|
+
data,
|
|
106
|
+
};
|
|
107
|
+
this.emit(workflowId, event);
|
|
108
|
+
}
|
|
109
|
+
emit(workflowId, event) {
|
|
110
|
+
const subject = this.eventSubjects.get(workflowId);
|
|
111
|
+
if (subject) {
|
|
112
|
+
subject.next(event);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
cleanup(workflowId) {
|
|
116
|
+
const subject = this.eventSubjects.get(workflowId);
|
|
117
|
+
if (subject) {
|
|
118
|
+
subject.complete();
|
|
119
|
+
this.eventSubjects.delete(workflowId);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
createEventStream(res, workflowId) {
|
|
123
|
+
res.setHeader('Content-Type', 'text/event-stream');
|
|
124
|
+
res.setHeader('Cache-Control', 'no-cache');
|
|
125
|
+
res.setHeader('Connection', 'keep-alive');
|
|
126
|
+
res.setHeader('X-Accel-Buffering', 'no');
|
|
127
|
+
res.write(`data: ${JSON.stringify({ type: 'connected', workflowId, timestamp: new Date() })}\n\n`);
|
|
128
|
+
const subscription = this.subscribe(workflowId).subscribe({
|
|
129
|
+
next: (event) => {
|
|
130
|
+
res.write(`data: ${JSON.stringify(event)}\n\n`);
|
|
131
|
+
},
|
|
132
|
+
error: (error) => {
|
|
133
|
+
console.error('SSE error:', error);
|
|
134
|
+
res.end();
|
|
135
|
+
},
|
|
136
|
+
complete: () => {
|
|
137
|
+
res.end();
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
res.on('close', () => {
|
|
141
|
+
subscription.unsubscribe();
|
|
142
|
+
});
|
|
143
|
+
const keepAliveInterval = setInterval(() => {
|
|
144
|
+
res.write(':keep-alive\n\n');
|
|
145
|
+
}, 30000);
|
|
146
|
+
res.on('close', () => {
|
|
147
|
+
clearInterval(keepAliveInterval);
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
exports.WorkflowSSEService = WorkflowSSEService;
|
|
152
|
+
exports.WorkflowSSEService = WorkflowSSEService = __decorate([
|
|
153
|
+
(0, common_1.Injectable)()
|
|
154
|
+
], WorkflowSSEService);
|
|
155
|
+
//# sourceMappingURL=workflow-sse.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflow-sse.service.js","sourceRoot":"","sources":["../../src/services/workflow-sse.service.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAA0D;AAE1D,+BAA2C;AAepC,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACrB,aAAa,GAAG,IAAI,GAAG,EAA2C,CAAC;IAKnE,eAAe,CAAC,UAAkB;QACxC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACxC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,cAAO,EAA0B,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,IAAI,CAAC,aAAa,CAAC,GAAG,CA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AG,CAAC,GAAG,EAAE,CAAC;YACZ,CAAC;SACF,CAAC,CAAC;QAGH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACnB,YAAY,CAAC,WAAW,EAAE,CAAC;QAC7B,CAAC,CAAC,CAAC;QAGH,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAG,EAAE;YACzC,GAAG,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAC/B,CAAC,EAAE,KAAK,CAAC,CAAC;QAEV,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACnB,aAAa,CAAC,iBAAiB,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAnMY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;GACA,kBAAkB,CAmM9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@venturialstd/workflow",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.89",
|
|
4
4
|
"description": "Workflow Module for Venturial",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"@venturialstd/circle": "^0.0.3",
|
|
78
78
|
"@venturialstd/core": "^1.0.16",
|
|
79
79
|
"@venturialstd/fintech": "^0.0.9",
|
|
80
|
+
"@venturialstd/inbestgo": "^0.0.1",
|
|
80
81
|
"@venturialstd/kira": "^0.0.1",
|
|
81
82
|
"@venturialstd/toolbox": "^0.0.1",
|
|
82
83
|
"@venturialstd/twilio": "^0.0.4",
|