@konplit-services/common 1.0.155 → 1.0.156
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/build/app.configs.d.ts
CHANGED
package/build/app.configs.js
CHANGED
|
@@ -41,6 +41,12 @@ class AppConfigs {
|
|
|
41
41
|
}
|
|
42
42
|
return this.env.MONGO_URI_MERCHANT;
|
|
43
43
|
}
|
|
44
|
+
getTransferDBURI() {
|
|
45
|
+
if (!this.env.MONGO_URI_TRANSFER) {
|
|
46
|
+
throw new Error("MONGO_URI_TRANSFER is required");
|
|
47
|
+
}
|
|
48
|
+
return this.env.MONGO_URI_TRANSFER;
|
|
49
|
+
}
|
|
44
50
|
getVirtualAccountDBURI() {
|
|
45
51
|
if (!this.env.MONGO_URI_VIRTUAL_ACCOUNT) {
|
|
46
52
|
throw new Error("MONGO_URI_VIRTUAL_ACCOUNT is required");
|
|
@@ -81,26 +81,33 @@ class Listener {
|
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
listenForRequests() {
|
|
84
|
-
var e_1,
|
|
85
|
-
var
|
|
84
|
+
var _a, e_1, _b, _c;
|
|
85
|
+
var _d;
|
|
86
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
const subscription = (
|
|
87
|
+
const subscription = (_d = this.nc) === null || _d === void 0 ? void 0 : _d.subscribe(this.subject);
|
|
88
88
|
try {
|
|
89
|
-
for (var subscription_1 = __asyncValues(subscription), subscription_1_1; subscription_1_1 = yield subscription_1.next(),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
for (var _e = true, subscription_1 = __asyncValues(subscription), subscription_1_1; subscription_1_1 = yield subscription_1.next(), _a = subscription_1_1.done, !_a;) {
|
|
90
|
+
_c = subscription_1_1.value;
|
|
91
|
+
_e = false;
|
|
92
|
+
try {
|
|
93
|
+
const msg = _c;
|
|
94
|
+
// Decode the request data
|
|
95
|
+
const decodedRequest = this.jc.decode(msg.data);
|
|
96
|
+
console.log("Received Request:", decodedRequest);
|
|
97
|
+
const response = yield this.onMessageResponse(decodedRequest, msg);
|
|
98
|
+
console.log("Respons comming here", response);
|
|
99
|
+
// Send a reply back
|
|
100
|
+
msg.respond(this.jc.encode({ data: response }));
|
|
101
|
+
}
|
|
102
|
+
finally {
|
|
103
|
+
_e = true;
|
|
104
|
+
}
|
|
98
105
|
}
|
|
99
106
|
}
|
|
100
107
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
101
108
|
finally {
|
|
102
109
|
try {
|
|
103
|
-
if (
|
|
110
|
+
if (!_e && !_a && (_b = subscription_1.return)) yield _b.call(subscription_1);
|
|
104
111
|
}
|
|
105
112
|
finally { if (e_1) throw e_1.error; }
|
|
106
113
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Usage } from "../../../helper";
|
|
2
2
|
import { StreamEvent, StreamName, Subjects } from "../../subjects";
|
|
3
|
-
export
|
|
3
|
+
export type DurationTypes = "2hours" | "1day" | "now" | "2days" | "custom";
|
|
4
4
|
export interface KeyUpdateTimerEvent {
|
|
5
5
|
subject: Subjects.KeysUpdated;
|
|
6
6
|
streamName: StreamName.name;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PLAN_INTERVAL } from "./plan-types";
|
|
2
2
|
export declare const formatDate: (dataString: string) => string;
|
|
3
3
|
export declare const formatDateTime: (dataString: string) => string;
|
|
4
|
-
|
|
4
|
+
type PlanInterval = keyof typeof PLAN_INTERVAL;
|
|
5
5
|
export declare const getDuration: (duration: PlanInterval) => number;
|
|
6
6
|
export {};
|