@6thbridge/utils 0.2.14 → 0.2.16
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/lib/actions/charge.action.d.ts +1 -2
- package/lib/actions/charge.action.js +1 -73
- package/lib/actions/charge.action.js.map +1 -1
- package/lib/actions/queue.action.d.ts +3 -0
- package/lib/actions/queue.action.js +20 -0
- package/lib/actions/queue.action.js.map +1 -0
- package/lib/database/MongoDBRepository.js.map +1 -1
- package/lib/database/MongoDBTypeRepository.d.ts +1 -0
- package/lib/database/MongoDBTypeRepository.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/logger/logger.js +4 -0
- package/lib/logger/logger.js.map +1 -1
- package/lib/monitoring/index.d.ts +3 -3
- package/lib/monitoring/index.js +4 -1
- package/lib/monitoring/index.js.map +1 -1
- package/lib/monitoring/rollbar.d.ts +15 -0
- package/lib/monitoring/rollbar.js +23 -0
- package/lib/monitoring/rollbar.js.map +1 -0
- package/lib/test/actions/charge.action.test.js +0 -41
- package/lib/test/actions/charge.action.test.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/broker.entity.d.ts +12 -0
- package/lib/types/broker.entity.js +7 -1
- package/lib/types/broker.entity.js.map +1 -1
- package/lib/types/custom.exception.d.ts +14 -0
- package/lib/types/custom.exception.js +16 -0
- package/lib/types/custom.exception.js.map +1 -0
- package/lib/types/index.d.ts +6 -80
- package/lib/types/index.js +19 -37
- package/lib/types/index.js.map +1 -1
- package/lib/types/integration.entity.d.ts +97 -0
- package/lib/types/integration.entity.js +61 -0
- package/lib/types/integration.entity.js.map +1 -0
- package/lib/types/wallet.entity.d.ts +34 -0
- package/lib/types/wallet.entity.js +24 -0
- package/lib/types/wallet.entity.js.map +1 -0
- package/package.json +14 -13
- package/readme.md +1 -1
|
@@ -13,3 +13,15 @@ export declare class BrokerRetryEntity {
|
|
|
13
13
|
retryInMinutes?: number;
|
|
14
14
|
retryCount?: number;
|
|
15
15
|
}
|
|
16
|
+
export declare class EventBrokerPayloadEntity<T> {
|
|
17
|
+
webhook?: string;
|
|
18
|
+
clientId: string;
|
|
19
|
+
event: string;
|
|
20
|
+
data: T;
|
|
21
|
+
}
|
|
22
|
+
export declare class EventBrokerPayloadBackwardCompatibilityEntity {
|
|
23
|
+
webhook?: string;
|
|
24
|
+
clientId: string;
|
|
25
|
+
event: string;
|
|
26
|
+
data: any;
|
|
27
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BrokerRetryEntity = exports.BrokerDeadLetterPayloadEntity = void 0;
|
|
3
|
+
exports.EventBrokerPayloadBackwardCompatibilityEntity = exports.EventBrokerPayloadEntity = exports.BrokerRetryEntity = exports.BrokerDeadLetterPayloadEntity = void 0;
|
|
4
4
|
class BrokerDeadLetterPayloadEntity {
|
|
5
5
|
}
|
|
6
6
|
exports.BrokerDeadLetterPayloadEntity = BrokerDeadLetterPayloadEntity;
|
|
@@ -10,4 +10,10 @@ class BrokerRetryEntity {
|
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.BrokerRetryEntity = BrokerRetryEntity;
|
|
13
|
+
class EventBrokerPayloadEntity {
|
|
14
|
+
}
|
|
15
|
+
exports.EventBrokerPayloadEntity = EventBrokerPayloadEntity;
|
|
16
|
+
class EventBrokerPayloadBackwardCompatibilityEntity {
|
|
17
|
+
}
|
|
18
|
+
exports.EventBrokerPayloadBackwardCompatibilityEntity = EventBrokerPayloadBackwardCompatibilityEntity;
|
|
13
19
|
//# sourceMappingURL=broker.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"broker.entity.js","sourceRoot":"","sources":["../../src/types/broker.entity.ts"],"names":[],"mappings":";;;AAAA,MAAa,6BAA6B;CAMzC;AAND,sEAMC;AAED,MAAa,iBAAiB;IAA9B;QAME,eAAU,GAAY,CAAC,CAAC;IAC1B,CAAC;CAAA;AAPD,8CAOC"}
|
|
1
|
+
{"version":3,"file":"broker.entity.js","sourceRoot":"","sources":["../../src/types/broker.entity.ts"],"names":[],"mappings":";;;AAAA,MAAa,6BAA6B;CAMzC;AAND,sEAMC;AAED,MAAa,iBAAiB;IAA9B;QAME,eAAU,GAAY,CAAC,CAAC;IAC1B,CAAC;CAAA;AAPD,8CAOC;AAGD,MAAa,wBAAwB;CAKpC;AALD,4DAKC;AAED,MAAa,6CAA6C;CAKzD;AALD,sGAKC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare class CustomExceptionParams {
|
|
2
|
+
message: string;
|
|
3
|
+
errorCode?: string;
|
|
4
|
+
statusCode?: number;
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export declare class CustomException extends Error {
|
|
8
|
+
message: string;
|
|
9
|
+
statusCode: string | number;
|
|
10
|
+
errorCode: string;
|
|
11
|
+
params: CustomExceptionParams;
|
|
12
|
+
constructor(params: CustomExceptionParams);
|
|
13
|
+
}
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomException = void 0;
|
|
4
|
+
class CustomExceptionParams {
|
|
5
|
+
}
|
|
6
|
+
class CustomException extends Error {
|
|
7
|
+
constructor(params) {
|
|
8
|
+
super(params.message);
|
|
9
|
+
this.message = params.message;
|
|
10
|
+
this.errorCode = params.errorCode || 'error';
|
|
11
|
+
this.statusCode = params.statusCode || 500;
|
|
12
|
+
this.params = params;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.CustomException = CustomException;
|
|
16
|
+
//# sourceMappingURL=custom.exception.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom.exception.js","sourceRoot":"","sources":["../../src/types/custom.exception.ts"],"names":[],"mappings":";;;AAAA,MAAM,qBAAqB;CAM1B;AAED,MAAa,eAAgB,SAAQ,KAAK;IAMxC,YAAY,MAA6B;QACvC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAEtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,OAAO,CAAC;QAC7C,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,GAAG,CAAC;QAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;CACF;AAdD,0CAcC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -23,47 +23,7 @@ declare class FunctionResponseDTO<T> {
|
|
|
23
23
|
error?: string;
|
|
24
24
|
statusCode?: number;
|
|
25
25
|
data?: T;
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
declare enum TransactionChargeBearer {
|
|
29
|
-
merchant = "merchant",
|
|
30
|
-
customer = "customer"
|
|
31
|
-
}
|
|
32
|
-
declare class TransactionCharge {
|
|
33
|
-
chargeBearer?: TransactionChargeBearer;
|
|
34
|
-
platform?: {
|
|
35
|
-
percentage: number;
|
|
36
|
-
fixed: number;
|
|
37
|
-
};
|
|
38
|
-
provider?: {
|
|
39
|
-
percentage: number;
|
|
40
|
-
fixed: number;
|
|
41
|
-
};
|
|
42
|
-
tax?: {
|
|
43
|
-
percentage: number;
|
|
44
|
-
fixed: number;
|
|
45
|
-
};
|
|
46
|
-
cap?: {
|
|
47
|
-
minimum: number;
|
|
48
|
-
maximum: number;
|
|
49
|
-
};
|
|
50
|
-
custom?: {
|
|
51
|
-
percentage: number;
|
|
52
|
-
fixed: number;
|
|
53
|
-
};
|
|
54
|
-
VATOnChargeAndFees?: number;
|
|
55
|
-
providerPercentageFee?: number;
|
|
56
|
-
providerFixedFee?: number;
|
|
57
|
-
percentageAmount?: number;
|
|
58
|
-
fixedAmount?: number;
|
|
59
|
-
minimumCap?: number;
|
|
60
|
-
maximumCap?: number;
|
|
61
|
-
fixedTax?: number;
|
|
62
|
-
percentageTax?: number;
|
|
63
|
-
platformFixedAmount?: number;
|
|
64
|
-
platformPercentageAmount?: number;
|
|
65
|
-
chargeAmount?: number;
|
|
66
|
-
chargeType?: string;
|
|
26
|
+
errorCode?: string;
|
|
67
27
|
[x: string]: any;
|
|
68
28
|
}
|
|
69
29
|
interface TransactionFee {
|
|
@@ -87,43 +47,9 @@ interface TransactionFee {
|
|
|
87
47
|
roundUpFinalValue?: boolean;
|
|
88
48
|
[x: string]: any;
|
|
89
49
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
percentage?: number;
|
|
96
|
-
fixed?: number;
|
|
97
|
-
}
|
|
98
|
-
interface TierIntegrationCharge {
|
|
99
|
-
lowerBound?: number;
|
|
100
|
-
upperBound?: number;
|
|
101
|
-
percentage?: number;
|
|
102
|
-
fixed?: number;
|
|
103
|
-
}
|
|
104
|
-
declare class IntegrationChargeEntity {
|
|
105
|
-
type?: IntegrationChargeType;
|
|
106
|
-
value?: FlatIntegrationCharge | TierIntegrationCharge[];
|
|
107
|
-
}
|
|
108
|
-
declare class IntegrationPartnerChargeEntity extends IntegrationChargeEntity {
|
|
109
|
-
clientId?: string;
|
|
110
|
-
}
|
|
111
|
-
declare class IntegrationChargeBearer {
|
|
112
|
-
customer?: number;
|
|
113
|
-
merchant?: number;
|
|
114
|
-
}
|
|
115
|
-
declare class IntegrationCharge {
|
|
116
|
-
bearer?: IntegrationChargeBearer;
|
|
117
|
-
platform?: IntegrationChargeEntity;
|
|
118
|
-
provider?: IntegrationChargeEntity;
|
|
119
|
-
partner?: IntegrationPartnerChargeEntity;
|
|
120
|
-
tax?: IntegrationChargeEntity;
|
|
121
|
-
cap?: {
|
|
122
|
-
minimum: number;
|
|
123
|
-
maximum: number;
|
|
124
|
-
};
|
|
125
|
-
custom?: IntegrationChargeEntity;
|
|
126
|
-
VATOnChargeAndFees?: IntegrationChargeEntity;
|
|
127
|
-
}
|
|
128
|
-
export { INTERNAL_REQUEST_SOURCE, ContextEntity, RequestUserEntity, RequestClientEntity, SaveActivityLogDTO, ClientEntity, UserEntity, FunctionResponseDTO, BrokerRetryEntity, BrokerDeadLetterPayloadEntity, LoggerInterface, TransactionCharge, TransactionChargeBearer, TransactionFee, OkResponse, ErrorResponse, IntegrationChargeType, IntegrationCharge, IntegrationChargeBearer, FlatIntegrationCharge, IntegrationChargeEntity, TierIntegrationCharge, };
|
|
50
|
+
export { INTERNAL_REQUEST_SOURCE, ContextEntity, RequestUserEntity, RequestClientEntity, SaveActivityLogDTO, ClientEntity, UserEntity, FunctionResponseDTO, BrokerRetryEntity, BrokerDeadLetterPayloadEntity, LoggerInterface, TransactionFee, OkResponse, ErrorResponse, };
|
|
51
|
+
export * from "./integration.entity";
|
|
52
|
+
export * from "./wallet.entity";
|
|
53
|
+
export * from "./broker.entity";
|
|
54
|
+
export * from "./custom.exception";
|
|
129
55
|
export { CountryCode } from 'libphonenumber-js';
|
package/lib/types/index.js
CHANGED
|
@@ -1,6 +1,20 @@
|
|
|
1
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
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
17
|
+
exports.BrokerDeadLetterPayloadEntity = exports.BrokerRetryEntity = exports.FunctionResponseDTO = exports.UserEntity = exports.ClientEntity = exports.RequestUserEntity = exports.ContextEntity = exports.INTERNAL_REQUEST_SOURCE = void 0;
|
|
4
18
|
const context_entity_1 = require("./context.entity");
|
|
5
19
|
Object.defineProperty(exports, "ContextEntity", { enumerable: true, get: function () { return context_entity_1.ContextEntity; } });
|
|
6
20
|
Object.defineProperty(exports, "INTERNAL_REQUEST_SOURCE", { enumerable: true, get: function () { return context_entity_1.INTERNAL_REQUEST_SOURCE; } });
|
|
@@ -15,40 +29,8 @@ Object.defineProperty(exports, "BrokerRetryEntity", { enumerable: true, get: fun
|
|
|
15
29
|
class FunctionResponseDTO {
|
|
16
30
|
}
|
|
17
31
|
exports.FunctionResponseDTO = FunctionResponseDTO;
|
|
18
|
-
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})(TransactionChargeBearer || (exports.TransactionChargeBearer = TransactionChargeBearer = {}));
|
|
23
|
-
class TransactionCharge {
|
|
24
|
-
constructor() {
|
|
25
|
-
this.VATOnChargeAndFees = 0; //in percentage
|
|
26
|
-
this.providerPercentageFee = 0;
|
|
27
|
-
this.percentageAmount = 0; //deprecated
|
|
28
|
-
this.fixedAmount = 0; //deprecated
|
|
29
|
-
this.minimumCap = 0;
|
|
30
|
-
this.maximumCap = 0;
|
|
31
|
-
this.fixedTax = 0;
|
|
32
|
-
this.percentageTax = 0;
|
|
33
|
-
this.platformFixedAmount = 0;
|
|
34
|
-
this.platformPercentageAmount = 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
exports.TransactionCharge = TransactionCharge;
|
|
38
|
-
var IntegrationChargeType;
|
|
39
|
-
(function (IntegrationChargeType) {
|
|
40
|
-
IntegrationChargeType["flat"] = "flat";
|
|
41
|
-
IntegrationChargeType["tier"] = "tier";
|
|
42
|
-
})(IntegrationChargeType || (exports.IntegrationChargeType = IntegrationChargeType = {}));
|
|
43
|
-
class IntegrationChargeEntity {
|
|
44
|
-
}
|
|
45
|
-
exports.IntegrationChargeEntity = IntegrationChargeEntity;
|
|
46
|
-
class IntegrationPartnerChargeEntity extends IntegrationChargeEntity {
|
|
47
|
-
}
|
|
48
|
-
class IntegrationChargeBearer {
|
|
49
|
-
}
|
|
50
|
-
exports.IntegrationChargeBearer = IntegrationChargeBearer;
|
|
51
|
-
class IntegrationCharge {
|
|
52
|
-
}
|
|
53
|
-
exports.IntegrationCharge = IntegrationCharge;
|
|
32
|
+
__exportStar(require("./integration.entity"), exports);
|
|
33
|
+
__exportStar(require("./wallet.entity"), exports);
|
|
34
|
+
__exportStar(require("./broker.entity"), exports);
|
|
35
|
+
__exportStar(require("./custom.exception"), exports);
|
|
54
36
|
//# sourceMappingURL=index.js.map
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qDAA0E;AAyDxE,8FAzDO,8BAAa,OAyDP;AADb,wGAxDsB,wCAAuB,OAwDtB;AAvDzB,+CAA8D;AAyD5D,kGAzDO,+BAAiB,OAyDP;AAIjB,2FA7D0B,wBAAU,OA6D1B;AA5DZ,mDAAoE;AA2DlE,6FA3DO,4BAAY,OA2DP;AA1Dd,mDAAmF;AA8DjF,8GA9DO,6CAA6B,OA8DP;AAD7B,kGA7DsC,iCAAiB,OA6DtC;AAxCnB,MAAM,mBAAmB;CAOxB;AAgCC,kDAAmB;AASrB,uDAAoC;AACpC,kDAAgC;AAChC,kDAAgC;AAChC,qDAAmC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export declare enum IntegrationPaymentMode {
|
|
2
|
+
POSTPAID = "postpaid",
|
|
3
|
+
PREPAID = "prepaid"
|
|
4
|
+
}
|
|
5
|
+
export declare enum IntegrationChargeBearerEnum {
|
|
6
|
+
merchant = "merchant",
|
|
7
|
+
customer = "customer"
|
|
8
|
+
}
|
|
9
|
+
export declare enum IntegrationType {
|
|
10
|
+
Notification = "notification",
|
|
11
|
+
File = "file",
|
|
12
|
+
Payment = "payment",
|
|
13
|
+
Authentication = "authentication",
|
|
14
|
+
Disbursement = "disbursement"
|
|
15
|
+
}
|
|
16
|
+
export declare enum IntegrationStatus {
|
|
17
|
+
active = "active",
|
|
18
|
+
suspended = "suspended",
|
|
19
|
+
deleted = "deleted"
|
|
20
|
+
}
|
|
21
|
+
export type IntegrationEntity = {
|
|
22
|
+
clientId: string;
|
|
23
|
+
type: IntegrationType;
|
|
24
|
+
logo?: string;
|
|
25
|
+
channel: string;
|
|
26
|
+
provider: string;
|
|
27
|
+
label: string;
|
|
28
|
+
fields: any[];
|
|
29
|
+
integrationType: string;
|
|
30
|
+
integrationId?: string;
|
|
31
|
+
integrationOwnerClientId?: string;
|
|
32
|
+
channels?: string[];
|
|
33
|
+
currencies?: string[];
|
|
34
|
+
country?: string;
|
|
35
|
+
paymentMode: IntegrationPaymentMode;
|
|
36
|
+
webhook: string;
|
|
37
|
+
isDefault: boolean;
|
|
38
|
+
description?: string;
|
|
39
|
+
providerWebhook: string;
|
|
40
|
+
providerWebhookId: string;
|
|
41
|
+
authorization?: any;
|
|
42
|
+
status: IntegrationStatus;
|
|
43
|
+
[x: string]: any;
|
|
44
|
+
isProviderWebhookEnabled: boolean;
|
|
45
|
+
providerWebhookEnabled: boolean;
|
|
46
|
+
};
|
|
47
|
+
export declare enum IntegrationChargeType {
|
|
48
|
+
fixed = "fixed",
|
|
49
|
+
percentage = "percentage"
|
|
50
|
+
}
|
|
51
|
+
export declare enum IntegrationChargeType {
|
|
52
|
+
flat = "flat",
|
|
53
|
+
tier = "tier"
|
|
54
|
+
}
|
|
55
|
+
export interface FlatIntegrationCharge {
|
|
56
|
+
percentage?: number;
|
|
57
|
+
fixed?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface TierIntegrationCharge {
|
|
60
|
+
lowerBound?: number;
|
|
61
|
+
upperBound?: number;
|
|
62
|
+
percentage?: number;
|
|
63
|
+
fixed?: number;
|
|
64
|
+
}
|
|
65
|
+
export declare class IntegrationChargeEntity {
|
|
66
|
+
type: IntegrationChargeType;
|
|
67
|
+
value: FlatIntegrationCharge | TierIntegrationCharge[];
|
|
68
|
+
}
|
|
69
|
+
export declare class IntegrationChargeBearer {
|
|
70
|
+
customer?: number;
|
|
71
|
+
merchant?: number;
|
|
72
|
+
}
|
|
73
|
+
export declare class IntegrationCharge {
|
|
74
|
+
bearer: IntegrationChargeBearer;
|
|
75
|
+
platform?: {
|
|
76
|
+
percentage: number;
|
|
77
|
+
fixed: number;
|
|
78
|
+
} | IntegrationChargeEntity;
|
|
79
|
+
provider?: {
|
|
80
|
+
percentage: number;
|
|
81
|
+
fixed: number;
|
|
82
|
+
} | IntegrationChargeEntity;
|
|
83
|
+
partner?: IntegrationChargeEntity & {
|
|
84
|
+
clientId?: string;
|
|
85
|
+
};
|
|
86
|
+
tax?: IntegrationChargeEntity;
|
|
87
|
+
cap?: {
|
|
88
|
+
minimum: number;
|
|
89
|
+
maximum: number;
|
|
90
|
+
};
|
|
91
|
+
custom?: {
|
|
92
|
+
percentage: number;
|
|
93
|
+
fixed: number;
|
|
94
|
+
} | IntegrationChargeEntity;
|
|
95
|
+
VATOnChargeAndFees?: IntegrationChargeEntity;
|
|
96
|
+
static getEmptyChargeEntity(override?: Record<string, any>): IntegrationCharge;
|
|
97
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IntegrationCharge = exports.IntegrationChargeBearer = exports.IntegrationChargeEntity = exports.IntegrationChargeType = exports.IntegrationStatus = exports.IntegrationType = exports.IntegrationChargeBearerEnum = exports.IntegrationPaymentMode = void 0;
|
|
4
|
+
var IntegrationPaymentMode;
|
|
5
|
+
(function (IntegrationPaymentMode) {
|
|
6
|
+
IntegrationPaymentMode["POSTPAID"] = "postpaid";
|
|
7
|
+
IntegrationPaymentMode["PREPAID"] = "prepaid";
|
|
8
|
+
})(IntegrationPaymentMode || (exports.IntegrationPaymentMode = IntegrationPaymentMode = {}));
|
|
9
|
+
var IntegrationChargeBearerEnum;
|
|
10
|
+
(function (IntegrationChargeBearerEnum) {
|
|
11
|
+
IntegrationChargeBearerEnum["merchant"] = "merchant";
|
|
12
|
+
IntegrationChargeBearerEnum["customer"] = "customer";
|
|
13
|
+
})(IntegrationChargeBearerEnum || (exports.IntegrationChargeBearerEnum = IntegrationChargeBearerEnum = {}));
|
|
14
|
+
var IntegrationType;
|
|
15
|
+
(function (IntegrationType) {
|
|
16
|
+
IntegrationType["Notification"] = "notification";
|
|
17
|
+
IntegrationType["File"] = "file";
|
|
18
|
+
IntegrationType["Payment"] = "payment";
|
|
19
|
+
IntegrationType["Authentication"] = "authentication";
|
|
20
|
+
IntegrationType["Disbursement"] = "disbursement";
|
|
21
|
+
})(IntegrationType || (exports.IntegrationType = IntegrationType = {}));
|
|
22
|
+
var IntegrationStatus;
|
|
23
|
+
(function (IntegrationStatus) {
|
|
24
|
+
IntegrationStatus["active"] = "active";
|
|
25
|
+
IntegrationStatus["suspended"] = "suspended";
|
|
26
|
+
IntegrationStatus["deleted"] = "deleted";
|
|
27
|
+
})(IntegrationStatus || (exports.IntegrationStatus = IntegrationStatus = {}));
|
|
28
|
+
var IntegrationChargeType;
|
|
29
|
+
(function (IntegrationChargeType) {
|
|
30
|
+
IntegrationChargeType["fixed"] = "fixed";
|
|
31
|
+
IntegrationChargeType["percentage"] = "percentage";
|
|
32
|
+
})(IntegrationChargeType || (exports.IntegrationChargeType = IntegrationChargeType = {}));
|
|
33
|
+
(function (IntegrationChargeType) {
|
|
34
|
+
IntegrationChargeType["flat"] = "flat";
|
|
35
|
+
IntegrationChargeType["tier"] = "tier";
|
|
36
|
+
})(IntegrationChargeType || (exports.IntegrationChargeType = IntegrationChargeType = {}));
|
|
37
|
+
class IntegrationChargeEntity {
|
|
38
|
+
}
|
|
39
|
+
exports.IntegrationChargeEntity = IntegrationChargeEntity;
|
|
40
|
+
class IntegrationChargeBearer {
|
|
41
|
+
}
|
|
42
|
+
exports.IntegrationChargeBearer = IntegrationChargeBearer;
|
|
43
|
+
class IntegrationCharge {
|
|
44
|
+
static getEmptyChargeEntity(override) {
|
|
45
|
+
return Object.assign({ bearer: { merchant: 100, customer: 0 }, platform: {
|
|
46
|
+
type: IntegrationChargeType.flat,
|
|
47
|
+
value: {
|
|
48
|
+
percentage: 0.5,
|
|
49
|
+
fixed: 0,
|
|
50
|
+
},
|
|
51
|
+
}, provider: {
|
|
52
|
+
type: IntegrationChargeType.flat,
|
|
53
|
+
value: {
|
|
54
|
+
percentage: 0,
|
|
55
|
+
fixed: 0,
|
|
56
|
+
},
|
|
57
|
+
} }, override);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.IntegrationCharge = IntegrationCharge;
|
|
61
|
+
//# sourceMappingURL=integration.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"integration.entity.js","sourceRoot":"","sources":["../../src/types/integration.entity.ts"],"names":[],"mappings":";;;AAAA,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAChC,+CAAqB,CAAA;IACrB,6CAAmB,CAAA;AACrB,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC;AAED,IAAY,2BAGX;AAHD,WAAY,2BAA2B;IACrC,oDAAqB,CAAA;IACrB,oDAAqB,CAAA;AACvB,CAAC,EAHW,2BAA2B,2CAA3B,2BAA2B,QAGtC;AAED,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,gDAA6B,CAAA;IAC7B,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,oDAAiC,CAAA;IACjC,gDAA6B,CAAA;AAC/B,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAED,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,4CAAuB,CAAA;IACvB,wCAAmB,CAAA;AACrB,CAAC,EAJW,iBAAiB,iCAAjB,iBAAiB,QAI5B;AA+BD,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,wCAAe,CAAA;IACf,kDAAyB,CAAA;AAC3B,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAGD,WAAY,qBAAqB;IAC/B,sCAAa,CAAA;IACb,sCAAa,CAAA;AACf,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC;AAcD,MAAa,uBAAuB;CAGnC;AAHD,0DAGC;AAED,MAAa,uBAAuB;CAGnC;AAHD,0DAGC;AAED,MAAa,iBAAiB;IAY5B,MAAM,CAAC,oBAAoB,CAAC,QAA8B;QACxD,uBACE,MAAM,EAAE,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,EAAE,EACtC,QAAQ,EAAE;gBACR,IAAI,EAAE,qBAAqB,CAAC,IAAI;gBAChC,KAAK,EAAE;oBACL,UAAU,EAAE,GAAG;oBACf,KAAK,EAAE,CAAC;iBACT;aACF,EACD,QAAQ,EAAE;gBACR,IAAI,EAAE,qBAAqB,CAAC,IAAI;gBAChC,KAAK,EAAE;oBACL,UAAU,EAAE,CAAC;oBACb,KAAK,EAAE,CAAC;iBACT;aACF,IACE,QAAQ,EACX;IACJ,CAAC;CACF;AAhCD,8CAgCC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare enum WalletStatus {
|
|
2
|
+
active = "active",
|
|
3
|
+
suspended = "suspended",
|
|
4
|
+
postNoDebit = "post-no-debit"
|
|
5
|
+
}
|
|
6
|
+
export declare enum WalletOwnerType {
|
|
7
|
+
client = "client",
|
|
8
|
+
user = "user",
|
|
9
|
+
charge = "charge",
|
|
10
|
+
platform = "platform"
|
|
11
|
+
}
|
|
12
|
+
export declare enum WalletType {
|
|
13
|
+
main = "main",
|
|
14
|
+
deposit = "deposit",
|
|
15
|
+
payout = "payout",
|
|
16
|
+
charge = "charge"
|
|
17
|
+
}
|
|
18
|
+
export type WalletEntity = {
|
|
19
|
+
clientId: string;
|
|
20
|
+
ownerType: string;
|
|
21
|
+
ownerId: string;
|
|
22
|
+
owner?: any;
|
|
23
|
+
type: WalletType;
|
|
24
|
+
currency: string;
|
|
25
|
+
country: string;
|
|
26
|
+
balance: number;
|
|
27
|
+
availableBalance: number;
|
|
28
|
+
lastSyncTime: number;
|
|
29
|
+
settlementDelayInDays?: number;
|
|
30
|
+
status: WalletStatus;
|
|
31
|
+
notificationLimit?: number;
|
|
32
|
+
notificationLimitEmailNextSentAt?: number;
|
|
33
|
+
[x: string]: any;
|
|
34
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WalletType = exports.WalletOwnerType = exports.WalletStatus = void 0;
|
|
4
|
+
var WalletStatus;
|
|
5
|
+
(function (WalletStatus) {
|
|
6
|
+
WalletStatus["active"] = "active";
|
|
7
|
+
WalletStatus["suspended"] = "suspended";
|
|
8
|
+
WalletStatus["postNoDebit"] = "post-no-debit";
|
|
9
|
+
})(WalletStatus || (exports.WalletStatus = WalletStatus = {}));
|
|
10
|
+
var WalletOwnerType;
|
|
11
|
+
(function (WalletOwnerType) {
|
|
12
|
+
WalletOwnerType["client"] = "client";
|
|
13
|
+
WalletOwnerType["user"] = "user";
|
|
14
|
+
WalletOwnerType["charge"] = "charge";
|
|
15
|
+
WalletOwnerType["platform"] = "platform";
|
|
16
|
+
})(WalletOwnerType || (exports.WalletOwnerType = WalletOwnerType = {}));
|
|
17
|
+
var WalletType;
|
|
18
|
+
(function (WalletType) {
|
|
19
|
+
WalletType["main"] = "main";
|
|
20
|
+
WalletType["deposit"] = "deposit";
|
|
21
|
+
WalletType["payout"] = "payout";
|
|
22
|
+
WalletType["charge"] = "charge";
|
|
23
|
+
})(WalletType || (exports.WalletType = WalletType = {}));
|
|
24
|
+
//# sourceMappingURL=wallet.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.entity.js","sourceRoot":"","sources":["../../src/types/wallet.entity.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,iCAAgB,CAAA;IAChB,uCAAqB,CAAA;IACrB,6CAA6B,CAAA;AAC/B,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AACD,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;AACvB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B;AACD,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACnB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@6thbridge/utils",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"description": "simple interface for the our commonly used functions",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -20,25 +20,26 @@
|
|
|
20
20
|
},
|
|
21
21
|
"license": "ISC",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@aws-sdk/client-secrets-manager": "^3.
|
|
23
|
+
"@aws-sdk/client-secrets-manager": "^3.687.0",
|
|
24
24
|
"amqp-connection-manager": "^4.1.14",
|
|
25
|
-
"amqplib": "^0.10.
|
|
26
|
-
"apitoolkit-express": "^2.
|
|
27
|
-
"axios": "^1.
|
|
25
|
+
"amqplib": "^0.10.4",
|
|
26
|
+
"apitoolkit-express": "^2.4.6",
|
|
27
|
+
"axios": "^1.7.4",
|
|
28
28
|
"bignumber.js": "^9.1.2",
|
|
29
|
-
"dayjs": "^1.11.
|
|
30
|
-
"ioredis": "^5.
|
|
31
|
-
"joi": "^17.
|
|
29
|
+
"dayjs": "^1.11.13",
|
|
30
|
+
"ioredis": "^5.4.1",
|
|
31
|
+
"joi": "^17.13.3",
|
|
32
32
|
"kafkajs": "^2.2.4",
|
|
33
|
-
"libphonenumber-js": "^1.
|
|
33
|
+
"libphonenumber-js": "^1.11.14",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
|
-
"mongoose-paginate-v2": "^1.8.
|
|
35
|
+
"mongoose-paginate-v2": "^1.8.5",
|
|
36
36
|
"node-cache": "^5.1.2",
|
|
37
|
-
"path-to-regexp": "^6.
|
|
38
|
-
"randomstring": "^1.3.0"
|
|
37
|
+
"path-to-regexp": "^6.3.0",
|
|
38
|
+
"randomstring": "^1.3.0",
|
|
39
|
+
"rollbar": "^2.26.4"
|
|
39
40
|
},
|
|
40
41
|
"devDependencies": {
|
|
41
|
-
"@types/express": "^4.17.
|
|
42
|
+
"@types/express": "^4.17.21",
|
|
42
43
|
"@types/jest": "^29.5.12",
|
|
43
44
|
"@types/lodash": "^4.14.184",
|
|
44
45
|
"@types/randomstring": "^1.1.8",
|