@6thbridge/utils 0.3.8 → 0.3.9-0
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 +0 -18
- package/lib/actions/charge.action.js +3 -34
- package/lib/actions/charge.action.js.map +1 -1
- package/lib/actions/charge.action.test.js +0 -42
- package/lib/actions/charge.action.test.js.map +1 -1
- package/lib/actions/index.d.ts +5 -11
- package/lib/actions/index.js +7 -34
- package/lib/actions/index.js.map +1 -1
- package/lib/actions/permission.action.js +2 -2
- package/lib/actions/permission.action.js.map +1 -1
- package/lib/actions/route.action.js +4 -3
- package/lib/actions/route.action.js.map +1 -1
- package/lib/{translations/index.d.ts → actions/translation.action.d.ts} +3 -1
- package/lib/{translations/index.js → actions/translation.action.js} +15 -12
- package/lib/actions/translation.action.js.map +1 -0
- package/lib/brokers/index.d.ts +1 -2
- package/lib/brokers/index.js +1 -3
- package/lib/brokers/index.js.map +1 -1
- package/lib/brokers/rabbitmq.d.ts +102 -5
- package/lib/brokers/rabbitmq.js +111 -6
- package/lib/brokers/rabbitmq.js.map +1 -1
- package/lib/data/index.d.ts +2 -0
- package/lib/data/index.js +19 -0
- package/lib/data/index.js.map +1 -0
- package/lib/data/rabbitmq/index.d.ts +57 -0
- package/lib/data/rabbitmq/index.js +231 -0
- package/lib/data/rabbitmq/index.js.map +1 -0
- package/lib/data/rabbitmq/rabbitmq.test.js +71 -0
- package/lib/data/rabbitmq/rabbitmq.test.js.map +1 -0
- package/lib/data/redis/index.d.ts +32 -0
- package/lib/data/redis/index.js +70 -0
- package/lib/data/redis/index.js.map +1 -0
- package/lib/{actions/queue.action.js → data/redis/redis-example.js} +14 -6
- package/lib/data/redis/redis-example.js.map +1 -0
- package/lib/database/MongoDBRepository.d.ts +5 -3
- package/lib/database/MongoDBRepository.js +2 -2
- package/lib/database/MongoDBRepository.js.map +1 -1
- package/lib/database/index.d.ts +2 -3
- package/lib/database/index.js +4 -16
- package/lib/database/index.js.map +1 -1
- package/lib/index.d.ts +13 -17
- package/lib/index.js +18 -40
- package/lib/index.js.map +1 -1
- package/lib/logger/index.d.ts +2 -0
- package/lib/logger/index.js +16 -0
- package/lib/logger/index.js.map +1 -1
- package/lib/logger/logger-test.js +2 -2
- package/lib/logger/logger-test.js.map +1 -1
- package/lib/logger/logger.d.ts +3 -3
- package/lib/logger/logger.js +2 -2
- package/lib/logger/logger.js.map +1 -1
- package/lib/{test/logger → logger}/test.spec.js +1 -1
- package/lib/logger/test.spec.js.map +1 -0
- package/lib/middlewares/common.js +3 -4
- package/lib/middlewares/common.js.map +1 -1
- package/lib/middlewares/index.d.ts +1 -2
- package/lib/middlewares/index.js +1 -3
- package/lib/middlewares/index.js.map +1 -1
- package/lib/monitoring/index.js +3 -2
- package/lib/monitoring/index.js.map +1 -1
- package/lib/responses/express.d.ts +2 -0
- package/lib/responses/express.js +7 -31
- package/lib/responses/express.js.map +1 -1
- package/lib/responses/index.d.ts +1 -2
- package/lib/responses/index.js +1 -3
- package/lib/responses/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/broker.entity.d.ts +1 -0
- package/lib/types/index.d.ts +13 -13
- package/lib/types/index.js +13 -17
- package/lib/types/index.js.map +1 -1
- package/lib/types/wallet.entity.d.ts +9 -0
- package/lib/{actions/currency.action.d.ts → utils/amount.d.ts} +12 -10
- package/lib/{actions/currency.action.js → utils/amount.js} +42 -38
- package/lib/utils/amount.js.map +1 -0
- package/lib/{test/actions/amount.action.test.js → utils/amount.test.js} +17 -17
- package/lib/utils/amount.test.js.map +1 -0
- package/lib/{actions/database.action.d.ts → utils/database.d.ts} +1 -1
- package/lib/{actions/database.action.js → utils/database.js} +10 -7
- package/lib/utils/database.js.map +1 -0
- package/lib/{actions/database.action.spec.js → utils/database.spec.js} +35 -39
- package/lib/utils/database.spec.js.map +1 -0
- package/lib/{actions/file.action.d.ts → utils/file.d.ts} +1 -1
- package/lib/{actions/file.action.js → utils/file.js} +4 -4
- package/lib/utils/file.js.map +1 -0
- package/lib/utils/helper.d.ts +10 -0
- package/lib/utils/helper.js +86 -0
- package/lib/utils/helper.js.map +1 -0
- package/lib/utils/helper.spec.js +203 -0
- package/lib/utils/helper.spec.js.map +1 -0
- package/lib/{http/axios.d.ts → utils/http.d.ts} +4 -0
- package/lib/{http/axios.js → utils/http.js} +12 -3
- package/lib/utils/http.js.map +1 -0
- package/lib/utils/index.d.ts +8 -0
- package/lib/utils/index.js +25 -0
- package/lib/utils/index.js.map +1 -0
- package/lib/{actions/phone-number.action.d.ts → utils/phoneNumber.d.ts} +22 -19
- package/lib/{actions/phone-number.action.js → utils/phoneNumber.js} +41 -41
- package/lib/utils/phoneNumber.js.map +1 -0
- package/lib/utils/phoneNumber.spec.js +60 -0
- package/lib/utils/phoneNumber.spec.js.map +1 -0
- package/lib/utils/reference.d.ts +7 -0
- package/lib/utils/reference.js +44 -0
- package/lib/utils/reference.js.map +1 -0
- package/lib/utils/reference.spec.d.ts +1 -0
- package/lib/utils/reference.spec.js +34 -0
- package/lib/utils/reference.spec.js.map +1 -0
- package/lib/utils/validator.d.ts +20 -0
- package/lib/utils/validator.js +56 -0
- package/lib/utils/validator.js.map +1 -0
- package/package.json +4 -3
- package/lib/actions/amount.action.d.ts +0 -10
- package/lib/actions/amount.action.js +0 -40
- package/lib/actions/amount.action.js.map +0 -1
- package/lib/actions/currency.action.js.map +0 -1
- package/lib/actions/database.action.js.map +0 -1
- package/lib/actions/database.action.spec.js.map +0 -1
- package/lib/actions/file.action.js.map +0 -1
- package/lib/actions/phone-number.action.js.map +0 -1
- package/lib/actions/queue.action.d.ts +0 -3
- package/lib/actions/queue.action.js.map +0 -1
- package/lib/brokers/kafka.d.ts +0 -84
- package/lib/brokers/kafka.js +0 -275
- package/lib/brokers/kafka.js.map +0 -1
- package/lib/brokers/kafka.test.js +0 -117
- package/lib/brokers/kafka.test.js.map +0 -1
- package/lib/database/MongoDBTypeRepository.d.ts +0 -77
- package/lib/database/MongoDBTypeRepository.js +0 -85
- package/lib/database/MongoDBTypeRepository.js.map +0 -1
- package/lib/database/query.d.ts +0 -18
- package/lib/database/query.js +0 -30
- package/lib/database/query.js.map +0 -1
- package/lib/helpers/errors.d.ts +0 -15
- package/lib/helpers/errors.js +0 -29
- package/lib/helpers/errors.js.map +0 -1
- package/lib/helpers/index.d.ts +0 -58
- package/lib/helpers/index.js +0 -226
- package/lib/helpers/index.js.map +0 -1
- package/lib/helpers/utils.d.ts +0 -9
- package/lib/helpers/utils.js +0 -17
- package/lib/helpers/utils.js.map +0 -1
- package/lib/http/axios.js.map +0 -1
- package/lib/middlewares/fastify.d.ts +0 -4
- package/lib/middlewares/fastify.js +0 -73
- package/lib/middlewares/fastify.js.map +0 -1
- package/lib/responses/fastify.d.ts +0 -4
- package/lib/responses/fastify.js +0 -25
- package/lib/responses/fastify.js.map +0 -1
- package/lib/secrets/aws-secret.d.ts +0 -4
- package/lib/secrets/aws-secret.js +0 -55
- package/lib/secrets/aws-secret.js.map +0 -1
- package/lib/secrets/index.d.ts +0 -8
- package/lib/secrets/index.js +0 -18
- package/lib/secrets/index.js.map +0 -1
- package/lib/test/actions/amount.action.test.js.map +0 -1
- package/lib/test/database/test.spec.js +0 -91
- package/lib/test/database/test.spec.js.map +0 -1
- package/lib/test/helpers/PhoneNumber.spec.js +0 -82
- package/lib/test/helpers/PhoneNumber.spec.js.map +0 -1
- package/lib/test/logger/test.spec.js.map +0 -1
- package/lib/test/types/context.entity.test.js +0 -29
- package/lib/test/types/context.entity.test.js.map +0 -1
- package/lib/translations/index.js.map +0 -1
- /package/lib/{actions/database.action.spec.d.ts → data/rabbitmq/rabbitmq.test.d.ts} +0 -0
- /package/lib/{brokers/kafka.test.d.ts → data/redis/redis-example.d.ts} +0 -0
- /package/lib/{test/database → logger}/test.spec.d.ts +0 -0
- /package/lib/{test/actions/amount.action.test.d.ts → utils/amount.test.d.ts} +0 -0
- /package/lib/{test/helpers/PhoneNumber.spec.d.ts → utils/database.spec.d.ts} +0 -0
- /package/lib/{test/logger/test.spec.d.ts → utils/helper.spec.d.ts} +0 -0
- /package/lib/{test/types/context.entity.test.d.ts → utils/phoneNumber.spec.d.ts} +0 -0
package/lib/database/query.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description resolveRequestQueryToMongoDBQuery
|
|
3
|
-
* @param {object} requestQuery
|
|
4
|
-
* @returns {{filter: {}, limit: number, page: number, sort: {_id: number}}}
|
|
5
|
-
*/
|
|
6
|
-
export declare class ObjectToMongoDBQueryOption {
|
|
7
|
-
dateField?: string;
|
|
8
|
-
dateFormat?: string;
|
|
9
|
-
searchFields?: string[];
|
|
10
|
-
}
|
|
11
|
-
export declare class ObjectToMongoDBQueryResult {
|
|
12
|
-
page?: number;
|
|
13
|
-
limit?: number;
|
|
14
|
-
expand?: string[];
|
|
15
|
-
filter: any;
|
|
16
|
-
sort: any;
|
|
17
|
-
}
|
|
18
|
-
export declare function resolveObjectToMongoDBQuery(requestQuery: any, options?: ObjectToMongoDBQueryOption): import("../actions/database.action").ObjectToMongoDBQueryResult;
|
package/lib/database/query.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveObjectToMongoDBQuery = exports.ObjectToMongoDBQueryResult = exports.ObjectToMongoDBQueryOption = void 0;
|
|
4
|
-
const database_action_1 = require("../actions/database.action");
|
|
5
|
-
/**
|
|
6
|
-
* @description resolveRequestQueryToMongoDBQuery
|
|
7
|
-
* @param {object} requestQuery
|
|
8
|
-
* @returns {{filter: {}, limit: number, page: number, sort: {_id: number}}}
|
|
9
|
-
*/
|
|
10
|
-
class ObjectToMongoDBQueryOption {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.dateField = 'createdAt';
|
|
13
|
-
this.dateFormat = 'X';
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.ObjectToMongoDBQueryOption = ObjectToMongoDBQueryOption;
|
|
17
|
-
class ObjectToMongoDBQueryResult {
|
|
18
|
-
constructor() {
|
|
19
|
-
this.page = 1;
|
|
20
|
-
this.limit = 50;
|
|
21
|
-
this.filter = {};
|
|
22
|
-
this.sort = { _id: -1 };
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.ObjectToMongoDBQueryResult = ObjectToMongoDBQueryResult;
|
|
26
|
-
function resolveObjectToMongoDBQuery(requestQuery, options) {
|
|
27
|
-
return database_action_1.DatabaseAction.resolveObjectToMongoDBQuery(requestQuery, options);
|
|
28
|
-
}
|
|
29
|
-
exports.resolveObjectToMongoDBQuery = resolveObjectToMongoDBQuery;
|
|
30
|
-
//# sourceMappingURL=query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../../src/database/query.ts"],"names":[],"mappings":";;;AAEA,gEAA4D;AAE5D;;;;GAIG;AAEH,MAAa,0BAA0B;IAAvC;QACE,cAAS,GAAY,WAAW,CAAC;QACjC,eAAU,GAAY,GAAG,CAAA;IAE3B,CAAC;CAAA;AAJD,gEAIC;AAED,MAAa,0BAA0B;IAAvC;QACE,SAAI,GAAY,CAAC,CAAC;QAClB,UAAK,GAAY,EAAE,CAAC;QAEpB,WAAM,GAAQ,EAAE,CAAC;QACjB,SAAI,GAAQ,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC;IAC1B,CAAC;CAAA;AAND,gEAMC;AAED,SAAgB,2BAA2B,CACzC,YAAiB,EACjB,OAAoC;IAEpC,OAAO,gCAAc,CAAC,2BAA2B,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAC3E,CAAC;AALD,kEAKC"}
|
package/lib/helpers/errors.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { AxiosError } from 'axios';
|
|
2
|
-
export interface FormattedAxiosError {
|
|
3
|
-
status: number;
|
|
4
|
-
statusText: string;
|
|
5
|
-
message: string;
|
|
6
|
-
url: string;
|
|
7
|
-
params?: any;
|
|
8
|
-
data?: any;
|
|
9
|
-
headers?: any;
|
|
10
|
-
raw: any;
|
|
11
|
-
stack?: string | undefined;
|
|
12
|
-
trace?: string | undefined;
|
|
13
|
-
[x: string]: any;
|
|
14
|
-
}
|
|
15
|
-
export declare function resolveAxiosError(error: Error | AxiosError | any): FormattedAxiosError;
|
package/lib/helpers/errors.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveAxiosError = void 0;
|
|
4
|
-
;
|
|
5
|
-
function resolveAxiosError(error) {
|
|
6
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
7
|
-
let formattedError;
|
|
8
|
-
try {
|
|
9
|
-
const response = (_a = error === null || error === void 0 ? void 0 : error.response) !== null && _a !== void 0 ? _a : {};
|
|
10
|
-
formattedError = {
|
|
11
|
-
status: (_b = response === null || response === void 0 ? void 0 : response.status) !== null && _b !== void 0 ? _b : undefined,
|
|
12
|
-
statusText: (_c = response === null || response === void 0 ? void 0 : response.statusText) !== null && _c !== void 0 ? _c : error.message,
|
|
13
|
-
message: (_f = (_e = (_d = response === null || response === void 0 ? void 0 : response.data) === null || _d === void 0 ? void 0 : _d.error) !== null && _e !== void 0 ? _e : error.message) !== null && _f !== void 0 ? _f : "Unknown Error",
|
|
14
|
-
url: (_h = (_g = response === null || response === void 0 ? void 0 : response.config) === null || _g === void 0 ? void 0 : _g.url) !== null && _h !== void 0 ? _h : "",
|
|
15
|
-
params: (_k = (_j = response === null || response === void 0 ? void 0 : response.config) === null || _j === void 0 ? void 0 : _j.params) !== null && _k !== void 0 ? _k : {},
|
|
16
|
-
data: (_m = (_l = response === null || response === void 0 ? void 0 : response.config) === null || _l === void 0 ? void 0 : _l.data) !== null && _m !== void 0 ? _m : {},
|
|
17
|
-
headers: response === null || response === void 0 ? void 0 : response.headers,
|
|
18
|
-
raw: (_o = response === null || response === void 0 ? void 0 : response.data) !== null && _o !== void 0 ? _o : {},
|
|
19
|
-
stack: new Error().stack,
|
|
20
|
-
trace: (_p = error.stack) !== null && _p !== void 0 ? _p : "",
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
catch (ex) {
|
|
24
|
-
formattedError = {};
|
|
25
|
-
}
|
|
26
|
-
return formattedError;
|
|
27
|
-
}
|
|
28
|
-
exports.resolveAxiosError = resolveAxiosError;
|
|
29
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/helpers/errors.ts"],"names":[],"mappings":";;;AAcC,CAAC;AACF,SAAgB,iBAAiB,CAAC,KAA+B;;IAC/D,IAAI,cAAmC,CAAC;IACxC,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,QAAQ,mCAAI,EAAE,CAAA;QACtC,cAAc,GAAG;YACf,MAAM,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,mCAAI,SAAS;YACrC,UAAU,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,mCAAI,KAAK,CAAC,OAAO;YACjD,OAAO,EAAE,MAAA,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,KAAK,mCAAI,KAAK,CAAC,OAAO,mCAAI,eAAe;YAClE,GAAG,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,0CAAE,GAAG,mCAAI,EAAE;YAChC,MAAM,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,0CAAE,MAAM,mCAAI,EAAE;YACtC,IAAI,EAAE,MAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,MAAM,0CAAE,IAAI,mCAAI,EAAE;YAClC,OAAO,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO;YAC1B,GAAG,EAAE,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,mCAAI,EAAE;YACzB,KAAK,EAAE,IAAI,KAAK,EAAE,CAAC,KAAK;YACxB,KAAK,EAAE,MAAA,KAAK,CAAC,KAAK,mCAAI,EAAE;SACzB,CAAC;IACJ,CAAC;IAAC,OAAO,EAAO,EAAE,CAAC;QACjB,cAAc,GAAG,EAAyB,CAAA;IAC5C,CAAC;IACD,OAAO,cAAc,CAAC;AACxB,CAAC;AApBD,8CAoBC"}
|
package/lib/helpers/index.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import * as Joi from 'joi';
|
|
2
|
-
import randomstring from 'randomstring';
|
|
3
|
-
import dayjs from 'dayjs';
|
|
4
|
-
import { isEmpty } from 'lodash';
|
|
5
|
-
import { CountryCode } from 'libphonenumber-js';
|
|
6
|
-
import * as errors from './errors';
|
|
7
|
-
import { resolveObjectToMongoDBQuery } from '../database/query';
|
|
8
|
-
import { CreateAxiosDefaults } from 'axios';
|
|
9
|
-
import { SaveActivityLogDTO } from '../types';
|
|
10
|
-
export declare const ACTIVITY_LOG_QUEUE = "activity.log";
|
|
11
|
-
export declare function removeFieldsWithEmptyValue(value: any): any;
|
|
12
|
-
export declare function validate(schema: any, payload: any): any;
|
|
13
|
-
export declare function validateStrict(schema: any, payload: any, options?: any): {
|
|
14
|
-
error: any;
|
|
15
|
-
data?: undefined;
|
|
16
|
-
} | {
|
|
17
|
-
data: any;
|
|
18
|
-
error?: undefined;
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* This method formats a Nigerian Phone number
|
|
22
|
-
* @param {string|Array} phoneNumber
|
|
23
|
-
* @param {string|undefined} countryCode
|
|
24
|
-
* @return "+234xxxxxxxxx"|undefined|array
|
|
25
|
-
*/
|
|
26
|
-
export declare function formatPhoneNumber(phoneNumber: string, countryCode?: string): string | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* @deprecated User phone number function in actions
|
|
29
|
-
* @param phoneNumber
|
|
30
|
-
* @param countryCode
|
|
31
|
-
*/
|
|
32
|
-
export declare function isPhoneNumberValid(phoneNumber: string, countryCode: CountryCode | string): boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated User phone number function in actions
|
|
35
|
-
* @param phoneNumber
|
|
36
|
-
* @param countryCode
|
|
37
|
-
*/
|
|
38
|
-
export declare function isPhoneNumberPossible(phoneNumber: string, countryCode: CountryCode | string): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* This method formats a Nigerian Phone number
|
|
41
|
-
* @param {Array} phoneNumbers
|
|
42
|
-
* @param {string|undefined} countryCode
|
|
43
|
-
* @return "+234xxxxxxxxx"|undefined|array
|
|
44
|
-
*/
|
|
45
|
-
export declare function formatPhoneNumberArray(phoneNumbers: (string | undefined)[], countryCode?: string): (string | undefined)[];
|
|
46
|
-
export declare function format(phoneNumber: string | undefined, countryCode: CountryCode): string | undefined;
|
|
47
|
-
export declare const resolveRequestQueryToMongoDBQuery: typeof resolveObjectToMongoDBQuery;
|
|
48
|
-
declare function saveActivityLog(activityLog: SaveActivityLogDTO, options?: any): Promise<void>;
|
|
49
|
-
declare const generateReference: (env: string) => string;
|
|
50
|
-
declare function generateUUID(options?: any): `${string}-${string}-${string}-${string}-${string}`;
|
|
51
|
-
declare function sleep(durationInMs?: number): Promise<unknown>;
|
|
52
|
-
export declare function getAxiosInstance(config?: CreateAxiosDefaults): import("axios").AxiosInstance;
|
|
53
|
-
export { Joi, isEmpty, dayjs, errors, saveActivityLog, randomstring, generateUUID, generateReference, sleep, };
|
|
54
|
-
export declare class Helpers {
|
|
55
|
-
static sleep(durationInMs?: number): Promise<unknown>;
|
|
56
|
-
static generateReference(env: string): string;
|
|
57
|
-
static generateUUID(options?: any): `${string}-${string}-${string}-${string}-${string}`;
|
|
58
|
-
}
|
package/lib/helpers/index.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.Helpers = exports.sleep = exports.generateReference = exports.generateUUID = exports.randomstring = exports.saveActivityLog = exports.errors = exports.dayjs = exports.isEmpty = exports.Joi = exports.getAxiosInstance = exports.resolveRequestQueryToMongoDBQuery = exports.format = exports.formatPhoneNumberArray = exports.isPhoneNumberPossible = exports.isPhoneNumberValid = exports.formatPhoneNumber = exports.validateStrict = exports.validate = exports.removeFieldsWithEmptyValue = exports.ACTIVITY_LOG_QUEUE = void 0;
|
|
39
|
-
const crypto_1 = require("crypto");
|
|
40
|
-
const Joi = __importStar(require("joi"));
|
|
41
|
-
exports.Joi = Joi;
|
|
42
|
-
const randomstring_1 = __importDefault(require("randomstring"));
|
|
43
|
-
exports.randomstring = randomstring_1.default;
|
|
44
|
-
const dayjs_1 = __importDefault(require("dayjs"));
|
|
45
|
-
exports.dayjs = dayjs_1.default;
|
|
46
|
-
const lodash_1 = require("lodash");
|
|
47
|
-
Object.defineProperty(exports, "isEmpty", { enumerable: true, get: function () { return lodash_1.isEmpty; } });
|
|
48
|
-
const localizedFormat_1 = __importDefault(require("dayjs/plugin/localizedFormat"));
|
|
49
|
-
const timezone_1 = __importDefault(require("dayjs/plugin/timezone"));
|
|
50
|
-
const customParseFormat_1 = __importDefault(require("dayjs/plugin/customParseFormat"));
|
|
51
|
-
const libphonenumber_js_1 = require("libphonenumber-js");
|
|
52
|
-
const errors = __importStar(require("./errors"));
|
|
53
|
-
exports.errors = errors;
|
|
54
|
-
const query_1 = require("../database/query");
|
|
55
|
-
const axios_1 = __importDefault(require("axios"));
|
|
56
|
-
const logger_1 = require("../logger/logger");
|
|
57
|
-
const axios_2 = require("../http/axios");
|
|
58
|
-
dayjs_1.default.extend(localizedFormat_1.default);
|
|
59
|
-
dayjs_1.default.extend(timezone_1.default);
|
|
60
|
-
dayjs_1.default.extend(customParseFormat_1.default);
|
|
61
|
-
dayjs_1.default.tz.setDefault(process.env.TZ || 'Africa/Lagos');
|
|
62
|
-
/**
|
|
63
|
-
* @param {object} value
|
|
64
|
-
* @returns {object}
|
|
65
|
-
*/
|
|
66
|
-
const dataToBeRemovedArray = ['', null, undefined];
|
|
67
|
-
exports.ACTIVITY_LOG_QUEUE = 'activity.log';
|
|
68
|
-
function removeFieldsWithEmptyValue(value) {
|
|
69
|
-
const objectTobeWorkingOn = Object.assign({}, value);
|
|
70
|
-
if (typeof value != 'object')
|
|
71
|
-
return value;
|
|
72
|
-
for (const key in objectTobeWorkingOn) {
|
|
73
|
-
if (dataToBeRemovedArray.includes(objectTobeWorkingOn[key])) {
|
|
74
|
-
delete objectTobeWorkingOn[key];
|
|
75
|
-
continue;
|
|
76
|
-
}
|
|
77
|
-
if (Array.isArray(objectTobeWorkingOn[key])) {
|
|
78
|
-
objectTobeWorkingOn[key] = objectTobeWorkingOn[key].map(removeFieldsWithEmptyValue);
|
|
79
|
-
continue;
|
|
80
|
-
}
|
|
81
|
-
if (typeof objectTobeWorkingOn[key] === 'object') {
|
|
82
|
-
objectTobeWorkingOn[key] = removeFieldsWithEmptyValue(objectTobeWorkingOn[key]);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return objectTobeWorkingOn;
|
|
86
|
-
}
|
|
87
|
-
exports.removeFieldsWithEmptyValue = removeFieldsWithEmptyValue;
|
|
88
|
-
function validate(schema, payload) {
|
|
89
|
-
schema = Joi.object(schema);
|
|
90
|
-
const { error } = schema.validate(payload, {
|
|
91
|
-
allowUnknown: true,
|
|
92
|
-
});
|
|
93
|
-
if (error)
|
|
94
|
-
return error.details[0].message.replace(/['"]/g, '');
|
|
95
|
-
return null;
|
|
96
|
-
}
|
|
97
|
-
exports.validate = validate;
|
|
98
|
-
function validateStrict(schema, payload, options = {}) {
|
|
99
|
-
schema = Joi.object(schema);
|
|
100
|
-
const { error, value } = schema.validate(payload, Object.assign({ allowUnknown: true }, options));
|
|
101
|
-
if (error)
|
|
102
|
-
return { error: error.details[0].message.replace(/['"]/g, '') };
|
|
103
|
-
return { data: value };
|
|
104
|
-
}
|
|
105
|
-
exports.validateStrict = validateStrict;
|
|
106
|
-
/**
|
|
107
|
-
* This method formats a Nigerian Phone number
|
|
108
|
-
* @param {string|Array} phoneNumber
|
|
109
|
-
* @param {string|undefined} countryCode
|
|
110
|
-
* @return "+234xxxxxxxxx"|undefined|array
|
|
111
|
-
*/
|
|
112
|
-
function formatPhoneNumber(phoneNumber, countryCode = 'NG') {
|
|
113
|
-
if ((0, lodash_1.isEmpty)(phoneNumber))
|
|
114
|
-
return phoneNumber;
|
|
115
|
-
return format(phoneNumber, countryCode);
|
|
116
|
-
}
|
|
117
|
-
exports.formatPhoneNumber = formatPhoneNumber;
|
|
118
|
-
/**
|
|
119
|
-
* @deprecated User phone number function in actions
|
|
120
|
-
* @param phoneNumber
|
|
121
|
-
* @param countryCode
|
|
122
|
-
*/
|
|
123
|
-
function isPhoneNumberValid(phoneNumber, countryCode) {
|
|
124
|
-
return (0, libphonenumber_js_1.isValidNumberForRegion)(phoneNumber, countryCode);
|
|
125
|
-
}
|
|
126
|
-
exports.isPhoneNumberValid = isPhoneNumberValid;
|
|
127
|
-
/**
|
|
128
|
-
* @deprecated User phone number function in actions
|
|
129
|
-
* @param phoneNumber
|
|
130
|
-
* @param countryCode
|
|
131
|
-
*/
|
|
132
|
-
function isPhoneNumberPossible(phoneNumber, countryCode) {
|
|
133
|
-
return (0, libphonenumber_js_1.isPossiblePhoneNumber)(phoneNumber, countryCode);
|
|
134
|
-
}
|
|
135
|
-
exports.isPhoneNumberPossible = isPhoneNumberPossible;
|
|
136
|
-
/**
|
|
137
|
-
* This method formats a Nigerian Phone number
|
|
138
|
-
* @param {Array} phoneNumbers
|
|
139
|
-
* @param {string|undefined} countryCode
|
|
140
|
-
* @return "+234xxxxxxxxx"|undefined|array
|
|
141
|
-
*/
|
|
142
|
-
function formatPhoneNumberArray(phoneNumbers, countryCode = 'NG') {
|
|
143
|
-
if ((0, lodash_1.isEmpty)(phoneNumbers))
|
|
144
|
-
return phoneNumbers;
|
|
145
|
-
return phoneNumbers.filter(Boolean).map((phone) => {
|
|
146
|
-
return format(phone, countryCode);
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
exports.formatPhoneNumberArray = formatPhoneNumberArray;
|
|
150
|
-
function format(phoneNumber, countryCode) {
|
|
151
|
-
if (!phoneNumber)
|
|
152
|
-
return undefined;
|
|
153
|
-
phoneNumber = phoneNumber.toString().replace(/\D/g, '');
|
|
154
|
-
const response = (0, libphonenumber_js_1.parsePhoneNumberFromString)(phoneNumber, countryCode);
|
|
155
|
-
if (!response || (0, lodash_1.isEmpty)(response))
|
|
156
|
-
return undefined;
|
|
157
|
-
return `${response.countryCallingCode}${response.nationalNumber}`;
|
|
158
|
-
}
|
|
159
|
-
exports.format = format;
|
|
160
|
-
exports.resolveRequestQueryToMongoDBQuery = query_1.resolveObjectToMongoDBQuery;
|
|
161
|
-
function saveActivityLog(activityLog_1) {
|
|
162
|
-
return __awaiter(this, arguments, void 0, function* (activityLog, options = {}) {
|
|
163
|
-
var _a;
|
|
164
|
-
if (!options.broker && !process.env.USER_SERVICE_URL)
|
|
165
|
-
throw Error('ActivityLog: cant post activity log, Broker and USER_SERVICE_URL is missing');
|
|
166
|
-
if (options.broker) {
|
|
167
|
-
(_a = options.broker) === null || _a === void 0 ? void 0 : _a.sendToQueue(exports.ACTIVITY_LOG_QUEUE, {
|
|
168
|
-
event: exports.ACTIVITY_LOG_QUEUE,
|
|
169
|
-
data: activityLog,
|
|
170
|
-
});
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
axios_1.default
|
|
174
|
-
.post(`${process.env.USER_SERVICE_URL}/v1/activity-logs`, activityLog, {
|
|
175
|
-
headers: {
|
|
176
|
-
source: 'internal',
|
|
177
|
-
},
|
|
178
|
-
})
|
|
179
|
-
.catch(logger_1.logger.exception);
|
|
180
|
-
return;
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
exports.saveActivityLog = saveActivityLog;
|
|
184
|
-
const generateReference = (env) => {
|
|
185
|
-
return Helpers.generateReference(env);
|
|
186
|
-
};
|
|
187
|
-
exports.generateReference = generateReference;
|
|
188
|
-
function generateUUID(options) {
|
|
189
|
-
return Helpers.generateUUID(options);
|
|
190
|
-
}
|
|
191
|
-
exports.generateUUID = generateUUID;
|
|
192
|
-
function sleep() {
|
|
193
|
-
return __awaiter(this, arguments, void 0, function* (durationInMs = 1000) {
|
|
194
|
-
return Helpers.sleep(durationInMs);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
exports.sleep = sleep;
|
|
198
|
-
function getAxiosInstance(config) {
|
|
199
|
-
return axios_2.AxiosClass.getAxiosInstance(config);
|
|
200
|
-
}
|
|
201
|
-
exports.getAxiosInstance = getAxiosInstance;
|
|
202
|
-
class Helpers {
|
|
203
|
-
static sleep() {
|
|
204
|
-
return __awaiter(this, arguments, void 0, function* (durationInMs = 1000) {
|
|
205
|
-
return new Promise((resolve) => setTimeout(resolve, durationInMs));
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
|
-
static generateReference(env) {
|
|
209
|
-
const envCode = env == 'production' ? 'L' : 'D';
|
|
210
|
-
// return clientId.toUpperCase() + envCode + dayjs().format("YYYYMMDDHHmmss").toString() +
|
|
211
|
-
return (envCode +
|
|
212
|
-
(0, dayjs_1.default)().format('YYYYMMDDHHmmss').toString() +
|
|
213
|
-
randomstring_1.default
|
|
214
|
-
.generate({
|
|
215
|
-
length: 5,
|
|
216
|
-
charset: 'alphabetic',
|
|
217
|
-
})
|
|
218
|
-
.toUpperCase());
|
|
219
|
-
}
|
|
220
|
-
;
|
|
221
|
-
static generateUUID(options) {
|
|
222
|
-
return (0, crypto_1.randomUUID)(options);
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
exports.Helpers = Helpers;
|
|
226
|
-
//# sourceMappingURL=index.js.map
|
package/lib/helpers/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/helpers/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,mCAAoC;AACpC,yCAA2B;AAiMzB,kBAAG;AAhML,gEAAwC;AAqMtC,uBArMK,sBAAY,CAqML;AApMd,kDAA0B;AAiMxB,gBAjMK,eAAK,CAiML;AAhMP,mCAAiC;AA+L/B,wFA/LO,gBAAO,OA+LP;AA9LT,mFAA2D;AAC3D,qEAA6C;AAC7C,uFAA+D;AAC/D,yDAK2B;AAE3B,iDAAmC;AAsLjC,wBAAM;AArLR,6CAAgE;AAChE,kDAAmD;AACnD,6CAA0C;AAE1C,yCAA2C;AAE3C,eAAK,CAAC,MAAM,CAAC,yBAAe,CAAC,CAAC;AAC9B,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AACvB,eAAK,CAAC,MAAM,CAAC,2BAAiB,CAAC,CAAC;AAChC,eAAK,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,cAAc,CAAC,CAAC;AAEtD;;;GAGG;AACH,MAAM,oBAAoB,GAAG,CAAC,EAAE,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAEtC,QAAA,kBAAkB,GAAG,cAAc,CAAC;AAEjD,SAAgB,0BAA0B,CAAC,KAAU;IACnD,MAAM,mBAAmB,qBAAQ,KAAK,CAAE,CAAC;IAEzC,IAAI,OAAO,KAAK,IAAI,QAAQ;QAAE,OAAO,KAAK,CAAC;IAE3C,KAAK,MAAM,GAAG,IAAI,mBAAmB,EAAE,CAAC;QACtC,IAAI,oBAAoB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eAAuB,IAAI;QAC9C,OAAO,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACrC,CAAC;CAAA;AAgBC,sBAAK;AAbP,SAAgB,gBAAgB,CAAC,MAA4B;IAC3D,OAAO,kBAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAC7C,CAAC;AAFD,4CAEC;AAeD,MAAa,OAAO;IAClB,MAAM,CAAO,KAAK;6DAAC,eAAuB,IAAI;YAC5C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QACrE,CAAC;KAAA;IAED,MAAM,CAAC,iBAAiB,CAAE,GAAW;QACnC,MAAM,OAAO,GAAG,GAAG,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QAChD,0FAA0F;QAE1F,OAAO,CACL,OAAO;YACP,IAAA,eAAK,GAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE;YAC3C,sBAAY;iBACT,QAAQ,CAAC;gBACR,MAAM,EAAE,CAAC;gBACT,OAAO,EAAE,YAAY;aACtB,CAAC;iBACD,WAAW,EAAE,CACjB,CAAC;IACJ,CAAC;IAAA,CAAC;IACF,MAAM,CAAC,YAAY,CAAC,OAAa;QAC/B,OAAO,IAAA,mBAAU,EAAC,OAAO,CAAC,CAAC;IAC7B,CAAC;CACF;AAvBD,0BAuBC"}
|
package/lib/helpers/utils.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RequestUserEntity, UserEntity } from '../types';
|
|
2
|
-
declare function getUserFirstName(user: RequestUserEntity | UserEntity): string | undefined;
|
|
3
|
-
export declare class FormatUserOrGetUserByIdPayload {
|
|
4
|
-
userServiceURL?: string;
|
|
5
|
-
userId?: string;
|
|
6
|
-
user?: UserEntity | RequestUserEntity;
|
|
7
|
-
}
|
|
8
|
-
declare function formatUserOrGetUserById(payload: FormatUserOrGetUserByIdPayload): void;
|
|
9
|
-
export { getUserFirstName, formatUserOrGetUserById };
|
package/lib/helpers/utils.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatUserOrGetUserById = exports.getUserFirstName = exports.FormatUserOrGetUserByIdPayload = void 0;
|
|
4
|
-
function getUserFirstName(user) {
|
|
5
|
-
var _a;
|
|
6
|
-
return user.firstName || ((_a = user.name) === null || _a === void 0 ? void 0 : _a.split(' ')[0]) || user.name;
|
|
7
|
-
}
|
|
8
|
-
exports.getUserFirstName = getUserFirstName;
|
|
9
|
-
class FormatUserOrGetUserByIdPayload {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.userServiceURL = 'http://user-service';
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
exports.FormatUserOrGetUserByIdPayload = FormatUserOrGetUserByIdPayload;
|
|
15
|
-
function formatUserOrGetUserById(payload) { }
|
|
16
|
-
exports.formatUserOrGetUserById = formatUserOrGetUserById;
|
|
17
|
-
//# sourceMappingURL=utils.js.map
|
package/lib/helpers/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":";;;AAEA,SAAS,gBAAgB,CAAC,IAAoC;;IAC5D,OAAO,IAAI,CAAC,SAAS,KAAI,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA,IAAI,IAAI,CAAC,IAAI,CAAC;AACjE,CAAC;AASQ,4CAAgB;AAPzB,MAAa,8BAA8B;IAA3C;QACE,mBAAc,GAAY,qBAAqB,CAAC;IAGlD,CAAC;CAAA;AAJD,wEAIC;AACD,SAAS,uBAAuB,CAAC,OAAuC,IAAG,CAAC;AAEjD,0DAAuB"}
|
package/lib/http/axios.js.map
DELET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AI,EAAE;aACzB,CAAC;QACJ,CAAC;QAAC,OAAO,EAAO,EAAE,CAAC;YACjB,cAAc,GAAG,EAAyB,CAAA;QAC5C,CAAC;QACD,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,MAAM,CAAC,gBAAgB,CAAC,MAA4B;QAClD,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtC,IAAA,iCAAqB,EAAC,QAAQ,CAAC,CAAC;QAChC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AA3BD,gCA2BC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.registerLogger = exports.can = void 0;
|
|
36
|
-
const response = __importStar(require("../responses/fastify"));
|
|
37
|
-
const common_1 = require("./common");
|
|
38
|
-
const logger_1 = require("../logger/logger");
|
|
39
|
-
const can = (supportedAuthenticationType = [], permissions = [], options = {
|
|
40
|
-
matchAll: true,
|
|
41
|
-
}) => {
|
|
42
|
-
if (permissions.constructor.name === 'IncomingMessage') {
|
|
43
|
-
throw new Error('It appears you have done something like `app.use(can)`, but it should be `app.use(can())`.');
|
|
44
|
-
}
|
|
45
|
-
return (req, res) => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
|
-
const { error, data } = yield (0, common_1.getContext)(req, supportedAuthenticationType, permissions);
|
|
47
|
-
if (error) {
|
|
48
|
-
return response.error(res, error || 'You are not authorized to access this resource!!!');
|
|
49
|
-
}
|
|
50
|
-
res.locals = data;
|
|
51
|
-
req.context = data;
|
|
52
|
-
res.header('x-request-id', data.requestId);
|
|
53
|
-
return;
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
exports.can = can;
|
|
57
|
-
const registerLogger = (req, res) => {
|
|
58
|
-
if (res.locals.logger)
|
|
59
|
-
return;
|
|
60
|
-
const params = {
|
|
61
|
-
requestId: req.header('x-request-id') || Math.random().toString(),
|
|
62
|
-
requestClientId: req.header('request-client-id') || req.header('client-id'),
|
|
63
|
-
contextClientId: req.header('context-client-id') || req.header('client-id'),
|
|
64
|
-
ip: req.headers['cf-connecting-ip'] || req.ip,
|
|
65
|
-
url: req.url,
|
|
66
|
-
requestSource: req.header('source'),
|
|
67
|
-
};
|
|
68
|
-
res.locals.logger = new logger_1.Logger(params);
|
|
69
|
-
res.header('x-request-id', params.requestId);
|
|
70
|
-
return;
|
|
71
|
-
};
|
|
72
|
-
exports.registerLogger = registerLogger;
|
|
73
|
-
//# sourceMappingURL=fastify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../../src/middlewares/fastify.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,+DAAiD;AACjD,qCAAsC;AACtC,6CAA0C;AAEnC,MAAM,GAAG,GAAG,CACjB,2BAA2B,GAAG,EAAE,EAChC,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG;IACR,QAAQ,EAAE,IAAI;CACf,EACD,EAAE;IACF,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,4FAA4F,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,CAAO,GAAQ,EAAE,GAAQ,EAAE,EAAE;QAClC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,MAAM,IAAA,mBAAU,EAAC,GAAG,EAAE,2BAA2B,EAAE,WAAW,CAAC,CAAC;QAExF,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,IAAI,mDAAmD,CAAC,CAAC;QAC3F,CAAC;QAED,GAAG,CAAC,MAAM,GAAG,IAAI,CAAC;QAClB,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;QACnB,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAE3C,OAAO;IACT,CAAC,CAAA,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,GAAG,OA0Bd;AAEK,MAAM,cAAc,GAAG,CAAC,GAAQ,EAAE,GAAQ,EAAE,EAAE;IACnD,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO;IAE9B,MAAM,MAAM,GAAQ;QAClB,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACjE,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3E,eAAe,EAAE,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3E,EAAE,EAAE,GAAG,CAAC,OAAO,CAAC,kBAAkB,CAAC,IAAI,GAAG,CAAC,EAAE;QAC7C,GAAG,EAAE,GAAG,CAAC,GAAG;QACZ,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;KACpC,CAAC;IAEF,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,IAAI,eAAM,CAAC,MAAM,CAAC,CAAC;IACvC,GAAG,CAAC,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;IAC7C,OAAO;AACT,CAAC,CAAC;AAfW,QAAA,cAAc,kBAezB"}
|
package/lib/responses/fastify.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.success = exports.paginated = exports.error = void 0;
|
|
4
|
-
const success = (res, data, code = 200) => {
|
|
5
|
-
return res.status(code).send({ data });
|
|
6
|
-
};
|
|
7
|
-
exports.success = success;
|
|
8
|
-
const paginated = (res, data, code = 200) => {
|
|
9
|
-
data.page = parseInt(data.page);
|
|
10
|
-
return res.status(code).send({
|
|
11
|
-
total: data.totalDocs || data.total || 0,
|
|
12
|
-
page: data.page || 1,
|
|
13
|
-
pages: data.totalPages || data.pages || 0,
|
|
14
|
-
limit: data.limit || 50,
|
|
15
|
-
data: data.docs,
|
|
16
|
-
});
|
|
17
|
-
};
|
|
18
|
-
exports.paginated = paginated;
|
|
19
|
-
const error = (res, error = 'Oops. An Error Occurred', code = 500) => {
|
|
20
|
-
return res.status(code).send({
|
|
21
|
-
error,
|
|
22
|
-
});
|
|
23
|
-
};
|
|
24
|
-
exports.error = error;
|
|
25
|
-
//# sourceMappingURL=fastify.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.js","sourceRoot":"","sources":["../../src/responses/fastify.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;;;AAEb,MAAM,OAAO,GAAG,CAAC,GAAQ,EAAE,IAAS,EAAE,OAAe,GAAG,EAAE,EAAE;IAC1D,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC,CAAC;AAmByB,0BAAO;AAjBlC,MAAM,SAAS,GAAG,CAAC,GAAQ,EAAE,IAAS,EAAE,OAAe,GAAG,EAAE,EAAE;IAC5D,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEhC,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;QAC3B,KAAK,EAAE,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC;QACxC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;QACpB,KAAK,EAAE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,KAAK,IAAI,CAAC;QACzC,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;QACvB,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC,CAAC;AACL,CAAC,CAAC;AAOc,8BAAS;AALzB,MAAM,KAAK,GAAG,CAAC,GAAQ,EAAE,QAAsB,yBAAyB,EAAE,OAAe,GAAG,EAAE,EAAE;IAC9F,OAAO,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC;QAC3B,KAAK;KACN,CAAC,CAAC;AACL,CAAC,CAAC;AACO,sBAAK"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AWSSecrets = void 0;
|
|
13
|
-
const client_secrets_manager_1 = require("@aws-sdk/client-secrets-manager");
|
|
14
|
-
class AWSSecrets {
|
|
15
|
-
loadSecretsToEnv(props) {
|
|
16
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
let response;
|
|
18
|
-
try {
|
|
19
|
-
const client = new client_secrets_manager_1.SecretsManagerClient({
|
|
20
|
-
region: props.reqion || process.env.AWS_REGION || 'us-east-1',
|
|
21
|
-
});
|
|
22
|
-
response = yield client.send(new client_secrets_manager_1.GetSecretValueCommand({
|
|
23
|
-
SecretId: props.secretName || process.env.AWS_SECRET_NAME,
|
|
24
|
-
VersionStage: 'AWSCURRENT', // VersionStage defaults to AWSCURRENT if unspecified
|
|
25
|
-
}));
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
// For a list of exceptions thrown, see
|
|
29
|
-
// https://docs.aws.amazon.com/secretsmanager/latest/apireference/API_GetSecretValue.html
|
|
30
|
-
console.log('Error fetching secrets', error);
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (!response.SecretString)
|
|
34
|
-
return;
|
|
35
|
-
const secrets = JSON.parse(response.SecretString);
|
|
36
|
-
for (const key in secrets) {
|
|
37
|
-
if (!process.env[key]) {
|
|
38
|
-
let val = secrets[key].trim();
|
|
39
|
-
if (val === 'false')
|
|
40
|
-
val = false;
|
|
41
|
-
if (val === 'true')
|
|
42
|
-
val = true;
|
|
43
|
-
process.env[key] = val;
|
|
44
|
-
console.log(`env ${key} loaded from AWS Secrets Manager`);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
console.log(`env ${key} loaded from AWS but not used because it is already set`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
console.log('loaded all config from AWS');
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.AWSSecrets = AWSSecrets;
|
|
55
|
-
//# sourceMappingURL=aws-secret.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aws-secret.js","sourceRoot":"","sources":["../../src/secrets/aws-secret.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4EAA8F;AAE9F,MAAa,UAAU;IACf,gBAAgB,CAAC,KAAuB;;YAC5C,IAAI,QAAQ,CAAC;YAEb,IAAI,CAAC;gBACH,MAAM,MAAM,GAAG,IAAI,6CAAoB,CAAC;oBACtC,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,WAAW;iBAC9D,CAAC,CAAC;gBACH,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAC1B,IAAI,8CAAqB,CAAC;oBACxB,QAAQ,EAAE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