@konplit-services/common 1.0.175 → 1.0.177

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.
@@ -102,6 +102,7 @@ declare class AppConfigs {
102
102
  getActivityLogDBURI(): string;
103
103
  getAccountDBURI(): string;
104
104
  getMerchantDBURI(): string;
105
+ getMonoDBURI(): string;
105
106
  getTransferDBURI(): string;
106
107
  getVirtualAccountDBURI(): string;
107
108
  getWalletDBURI(): string;
@@ -41,6 +41,12 @@ class AppConfigs {
41
41
  }
42
42
  return this.env.MONGO_URI_MERCHANT;
43
43
  }
44
+ getMonoDBURI() {
45
+ if (!this.env.MONGO_URI_MONO) {
46
+ throw new Error("MONGO_URI_MONO is required");
47
+ }
48
+ return this.env.MONGO_URI_MONO;
49
+ }
44
50
  getTransferDBURI() {
45
51
  if (!this.env.MONGO_URI_TRANSFER) {
46
52
  throw new Error("MONGO_URI_TRANSFER is required");
@@ -8,5 +8,6 @@ export * from "./transaction-events/interfaces";
8
8
  export * from "./virtual-account-events/interfaces";
9
9
  export * from "./Settlements-events/interfaces";
10
10
  export * from "./transfers-events/interfaces";
11
+ export * from "./mono-events/interfaces";
11
12
  export * from "./base-events";
12
13
  export * from "./types";
@@ -24,5 +24,6 @@ __exportStar(require("./transaction-events/interfaces"), exports);
24
24
  __exportStar(require("./virtual-account-events/interfaces"), exports);
25
25
  __exportStar(require("./Settlements-events/interfaces"), exports);
26
26
  __exportStar(require("./transfers-events/interfaces"), exports);
27
+ __exportStar(require("./mono-events/interfaces"), exports);
27
28
  __exportStar(require("./base-events"), exports);
28
29
  __exportStar(require("./types"), exports);
@@ -0,0 +1 @@
1
+ export * from "./mono-created.interface";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./mono-created.interface"), exports);
@@ -0,0 +1,21 @@
1
+ import { ResSubjects } from "../../subjects";
2
+ export interface MonoInitiationEvent {
3
+ subject: ResSubjects.MonoInitiationTransaction;
4
+ data: {
5
+ customer: {
6
+ name: string;
7
+ email: string;
8
+ };
9
+ transaction: {
10
+ transactionId: string;
11
+ description: string;
12
+ amount: number;
13
+ redirect_url?: string;
14
+ meta: {
15
+ merchantId: string;
16
+ accountId: string;
17
+ transactionId: string;
18
+ };
19
+ };
20
+ };
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -63,5 +63,6 @@ export declare enum Subjects {
63
63
  export declare enum ResSubjects {
64
64
  VirtualDynamicAccountCreatedEvent = "res.virtual.dynamicaccount.created",
65
65
  BankListCreated = "res.bank.list.created",
66
- BankAccountNameCreated = "res.bank.account.name.created"
66
+ BankAccountNameCreated = "res.bank.account.name.created",
67
+ MonoInitiationTransaction = "res.mono.initiation"
67
68
  }
@@ -90,4 +90,6 @@ var ResSubjects;
90
90
  // BanksAccounts
91
91
  ResSubjects["BankListCreated"] = "res.bank.list.created";
92
92
  ResSubjects["BankAccountNameCreated"] = "res.bank.account.name.created";
93
+ //Mono
94
+ ResSubjects["MonoInitiationTransaction"] = "res.mono.initiation";
93
95
  })(ResSubjects = exports.ResSubjects || (exports.ResSubjects = {}));
@@ -0,0 +1,5 @@
1
+ interface QueryParams {
2
+ [key: string]: string | number | undefined;
3
+ }
4
+ export declare function generateQueryParams(params: QueryParams): string;
5
+ export {};
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateQueryParams = void 0;
4
+ function generateQueryParams(params) {
5
+ // Check if params is empty
6
+ if (Object.keys(params).length === 0) {
7
+ return "";
8
+ }
9
+ // Construct the query string
10
+ const queryString = Object.entries(params)
11
+ .filter(([_, value]) => value !== undefined) // Exclude undefined values
12
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`)
13
+ .join("&");
14
+ // Combine with the base URL
15
+ const fullUrl = `?${queryString}`;
16
+ return fullUrl;
17
+ }
18
+ exports.generateQueryParams = generateQueryParams;
@@ -43,3 +43,4 @@ export * from "./date-processing";
43
43
  export * from "./timestamp";
44
44
  export * from "./keys";
45
45
  export * from "./wallet-transaction.types";
46
+ export * from "./generate-query-params";
@@ -59,3 +59,4 @@ __exportStar(require("./date-processing"), exports);
59
59
  __exportStar(require("./timestamp"), exports);
60
60
  __exportStar(require("./keys"), exports);
61
61
  __exportStar(require("./wallet-transaction.types"), exports);
62
+ __exportStar(require("./generate-query-params"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konplit-services/common",
3
- "version": "1.0.175",
3
+ "version": "1.0.177",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",