@misterhomer1992/miit-bot-payment 1.0.0 → 1.0.2
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/README.md +262 -146
- package/dist/index.d.ts +2 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -18
- package/dist/index.js.map +1 -1
- package/dist/modules/app/types.d.ts +2 -0
- package/dist/modules/app/types.d.ts.map +1 -0
- package/dist/modules/app/types.js +3 -0
- package/dist/modules/app/types.js.map +1 -0
- package/dist/modules/cancellableAPI/utils.d.ts +17 -0
- package/dist/modules/cancellableAPI/utils.d.ts.map +1 -0
- package/dist/modules/cancellableAPI/utils.js +43 -0
- package/dist/modules/cancellableAPI/utils.js.map +1 -0
- package/dist/modules/invoice/const.d.ts +4 -0
- package/dist/modules/invoice/const.d.ts.map +1 -0
- package/dist/modules/invoice/const.js +8 -0
- package/dist/modules/invoice/const.js.map +1 -0
- package/dist/modules/invoice/index.d.ts +5 -0
- package/dist/modules/invoice/index.d.ts.map +1 -0
- package/dist/modules/invoice/index.js +21 -0
- package/dist/modules/invoice/index.js.map +1 -0
- package/dist/modules/invoice/repository.d.ts +34 -0
- package/dist/modules/invoice/repository.d.ts.map +1 -0
- package/dist/modules/invoice/repository.js +68 -0
- package/dist/modules/invoice/repository.js.map +1 -0
- package/dist/modules/invoice/service.d.ts +29 -0
- package/dist/modules/invoice/service.d.ts.map +1 -0
- package/dist/modules/invoice/service.js +61 -0
- package/dist/modules/invoice/service.js.map +1 -0
- package/dist/modules/invoice/types.d.ts +14 -0
- package/dist/modules/invoice/types.d.ts.map +1 -0
- package/dist/modules/invoice/types.js +3 -0
- package/dist/modules/invoice/types.js.map +1 -0
- package/dist/modules/logger/types.d.ts +8 -0
- package/dist/modules/logger/types.d.ts.map +1 -0
- package/dist/modules/logger/types.js +3 -0
- package/dist/modules/logger/types.js.map +1 -0
- package/dist/modules/network/utils.d.ts +9 -0
- package/dist/modules/network/utils.d.ts.map +1 -0
- package/dist/modules/network/utils.js +20 -0
- package/dist/modules/network/utils.js.map +1 -0
- package/dist/modules/payments/const.d.ts +4 -0
- package/dist/modules/payments/const.d.ts.map +1 -0
- package/dist/modules/payments/const.js +11 -0
- package/dist/modules/payments/const.js.map +1 -0
- package/dist/modules/payments/index.d.ts +5 -0
- package/dist/modules/payments/index.d.ts.map +1 -0
- package/dist/modules/payments/index.js +21 -0
- package/dist/modules/payments/index.js.map +1 -0
- package/dist/modules/payments/repository.d.ts +82 -0
- package/dist/modules/payments/repository.d.ts.map +1 -0
- package/dist/modules/payments/repository.js +153 -0
- package/dist/modules/payments/repository.js.map +1 -0
- package/dist/modules/payments/service.d.ts +65 -0
- package/dist/modules/payments/service.d.ts.map +1 -0
- package/dist/modules/payments/service.js +132 -0
- package/dist/modules/payments/service.js.map +1 -0
- package/dist/modules/payments/types.d.ts +31 -0
- package/dist/modules/payments/types.d.ts.map +1 -0
- package/dist/modules/payments/types.js +3 -0
- package/dist/modules/payments/types.js.map +1 -0
- package/dist/modules/user/userModel.d.ts +78 -0
- package/dist/modules/user/userModel.d.ts.map +1 -0
- package/dist/modules/user/userModel.js +3 -0
- package/dist/modules/user/userModel.js.map +1 -0
- package/dist/modules/user/userRepository.d.ts +22 -0
- package/dist/modules/user/userRepository.d.ts.map +1 -0
- package/dist/modules/user/userRepository.js +47 -0
- package/dist/modules/user/userRepository.js.map +1 -0
- package/dist/types/function.d.ts +3 -0
- package/dist/types/function.d.ts.map +1 -0
- package/dist/types/function.js +3 -0
- package/dist/types/function.js.map +1 -0
- package/dist/types/utilities.d.ts +10 -0
- package/dist/types/utilities.d.ts.map +1 -0
- package/dist/types/utilities.js +3 -0
- package/dist/types/utilities.js.map +1 -0
- package/dist/utils.d.ts +10 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +45 -0
- package/dist/utils.js.map +1 -0
- package/package.json +55 -45
package/dist/utils.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getGoogleServiceAccount = getGoogleServiceAccount;
|
|
7
|
+
exports.isUndefined = isUndefined;
|
|
8
|
+
exports.isNull = isNull;
|
|
9
|
+
exports.isNullOrUndefined = isNullOrUndefined;
|
|
10
|
+
exports.isNumber = isNumber;
|
|
11
|
+
exports.isObject = isObject;
|
|
12
|
+
exports.isError = isError;
|
|
13
|
+
exports.isBadOrEmptyString = isBadOrEmptyString;
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
15
|
+
require('dotenv').config();
|
|
16
|
+
const path_1 = __importDefault(require("path"));
|
|
17
|
+
const firebaseAdminServiceAccountName = 'miia-telegram-bot-e3993ff1611c.json';
|
|
18
|
+
function getGoogleServiceAccount() {
|
|
19
|
+
return require(path_1.default.resolve(process.cwd(), 'keys', firebaseAdminServiceAccountName));
|
|
20
|
+
}
|
|
21
|
+
function isUndefined(val) {
|
|
22
|
+
return typeof val === 'undefined';
|
|
23
|
+
}
|
|
24
|
+
function isNull(val) {
|
|
25
|
+
return val === null;
|
|
26
|
+
}
|
|
27
|
+
function isNullOrUndefined(val) {
|
|
28
|
+
return isNull(val) || isUndefined(val);
|
|
29
|
+
}
|
|
30
|
+
function isNumber(val) {
|
|
31
|
+
return typeof val === 'number' && Number.isFinite(Number(val));
|
|
32
|
+
}
|
|
33
|
+
function isObject(val) {
|
|
34
|
+
return Object.prototype.toString.call(val).slice(8, -1).toLowerCase() === 'object';
|
|
35
|
+
}
|
|
36
|
+
function isError(val) {
|
|
37
|
+
return Object.prototype.toString.call(val).slice(8, -1).toLowerCase() === 'error';
|
|
38
|
+
}
|
|
39
|
+
function isBadOrEmptyString(val) {
|
|
40
|
+
if (isNullOrUndefined(val) || typeof val !== 'string') {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
return val.trim().length === 0;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;;;;AA4CI,0DAAuB;AACvB,kCAAW;AACX,wBAAM;AACN,8CAAiB;AACjB,4BAAQ;AACR,4BAAQ;AACR,0BAAO;AACP,gDAAkB;AAnDtB,8DAA8D;AAC9D,OAAO,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC;AAE3B,gDAAwB;AAExB,MAAM,+BAA+B,GAAG,qCAAqC,CAAC;AAE9E,SAAS,uBAAuB;IAC5B,OAAO,OAAO,CAAC,cAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,+BAA+B,CAAC,CAAC,CAAC;AACzF,CAAC;AAED,SAAS,WAAW,CAAC,GAAY;IAC7B,OAAO,OAAO,GAAG,KAAK,WAAW,CAAC;AACtC,CAAC;AAED,SAAS,MAAM,CAAC,GAAY;IACxB,OAAO,GAAG,KAAK,IAAI,CAAC;AACxB,CAAC;AAED,SAAS,iBAAiB,CAAC,GAAY;IACnC,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,WAAW,CAAC,GAAG,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,QAAQ,CAAC,GAAY;IAC1B,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,QAAQ,CAAC,GAAY;IAC1B,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,QAAQ,CAAC;AACvF,CAAC;AAED,SAAS,OAAO,CAAC,GAAY;IACzB,OAAO,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;AACtF,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAY;IACpC,IAAI,iBAAiB,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QACpD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,47 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
2
|
+
"name": "@misterhomer1992/miit-bot-payment",
|
|
3
|
+
"version": "1.0.2",
|
|
4
|
+
"description": "A TypeScript utility library for payment validation and formatting",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"prepublishOnly": "npm run build",
|
|
10
|
+
"test": "node --test dist/**/*.test.js",
|
|
11
|
+
"lint": "eslint src --ext .ts",
|
|
12
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
13
|
+
"watch": "tsc --watch",
|
|
14
|
+
"example": "ts-node example.ts",
|
|
15
|
+
"type-checking": "tsc --noEmit --project tsconfig.json --watch"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"payment",
|
|
19
|
+
"validation",
|
|
20
|
+
"formatting",
|
|
21
|
+
"typescript",
|
|
22
|
+
"utilities"
|
|
23
|
+
],
|
|
24
|
+
"author": "",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"cross-env": "10.0.0",
|
|
28
|
+
"moment": "2.30.1",
|
|
29
|
+
"dotenv": "17.2.2",
|
|
30
|
+
"axios": "1.12.2",
|
|
31
|
+
"firebase-admin": "^11.6.0"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@types/node": "^20.10.0",
|
|
35
|
+
"@typescript-eslint/eslint-plugin": "^6.13.0",
|
|
36
|
+
"@typescript-eslint/parser": "^6.13.0",
|
|
37
|
+
"ts-node": "^10.9.2",
|
|
38
|
+
"typescript": "^5.3.2",
|
|
39
|
+
"eslint": "^8.48.0",
|
|
40
|
+
"eslint-config-airbnb": "^19.0.4",
|
|
41
|
+
"eslint-config-prettier": "^9.0.0",
|
|
42
|
+
"prettier": "3.6.2"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"README.md",
|
|
47
|
+
"LICENSE"
|
|
48
|
+
],
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/misterhomer1992/miit-bot-payment.git"
|
|
52
|
+
},
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/misterhomer1992/miit-bot-payment/issues"
|
|
55
|
+
},
|
|
56
|
+
"homepage": "https://github.com/misterhomer1992/miit-bot-payment#readme"
|
|
47
57
|
}
|