@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.
Files changed (82) hide show
  1. package/README.md +262 -146
  2. package/dist/index.d.ts +2 -7
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +2 -18
  5. package/dist/index.js.map +1 -1
  6. package/dist/modules/app/types.d.ts +2 -0
  7. package/dist/modules/app/types.d.ts.map +1 -0
  8. package/dist/modules/app/types.js +3 -0
  9. package/dist/modules/app/types.js.map +1 -0
  10. package/dist/modules/cancellableAPI/utils.d.ts +17 -0
  11. package/dist/modules/cancellableAPI/utils.d.ts.map +1 -0
  12. package/dist/modules/cancellableAPI/utils.js +43 -0
  13. package/dist/modules/cancellableAPI/utils.js.map +1 -0
  14. package/dist/modules/invoice/const.d.ts +4 -0
  15. package/dist/modules/invoice/const.d.ts.map +1 -0
  16. package/dist/modules/invoice/const.js +8 -0
  17. package/dist/modules/invoice/const.js.map +1 -0
  18. package/dist/modules/invoice/index.d.ts +5 -0
  19. package/dist/modules/invoice/index.d.ts.map +1 -0
  20. package/dist/modules/invoice/index.js +21 -0
  21. package/dist/modules/invoice/index.js.map +1 -0
  22. package/dist/modules/invoice/repository.d.ts +34 -0
  23. package/dist/modules/invoice/repository.d.ts.map +1 -0
  24. package/dist/modules/invoice/repository.js +68 -0
  25. package/dist/modules/invoice/repository.js.map +1 -0
  26. package/dist/modules/invoice/service.d.ts +29 -0
  27. package/dist/modules/invoice/service.d.ts.map +1 -0
  28. package/dist/modules/invoice/service.js +61 -0
  29. package/dist/modules/invoice/service.js.map +1 -0
  30. package/dist/modules/invoice/types.d.ts +14 -0
  31. package/dist/modules/invoice/types.d.ts.map +1 -0
  32. package/dist/modules/invoice/types.js +3 -0
  33. package/dist/modules/invoice/types.js.map +1 -0
  34. package/dist/modules/logger/types.d.ts +8 -0
  35. package/dist/modules/logger/types.d.ts.map +1 -0
  36. package/dist/modules/logger/types.js +3 -0
  37. package/dist/modules/logger/types.js.map +1 -0
  38. package/dist/modules/network/utils.d.ts +9 -0
  39. package/dist/modules/network/utils.d.ts.map +1 -0
  40. package/dist/modules/network/utils.js +20 -0
  41. package/dist/modules/network/utils.js.map +1 -0
  42. package/dist/modules/payments/const.d.ts +4 -0
  43. package/dist/modules/payments/const.d.ts.map +1 -0
  44. package/dist/modules/payments/const.js +11 -0
  45. package/dist/modules/payments/const.js.map +1 -0
  46. package/dist/modules/payments/index.d.ts +5 -0
  47. package/dist/modules/payments/index.d.ts.map +1 -0
  48. package/dist/modules/payments/index.js +21 -0
  49. package/dist/modules/payments/index.js.map +1 -0
  50. package/dist/modules/payments/repository.d.ts +82 -0
  51. package/dist/modules/payments/repository.d.ts.map +1 -0
  52. package/dist/modules/payments/repository.js +153 -0
  53. package/dist/modules/payments/repository.js.map +1 -0
  54. package/dist/modules/payments/service.d.ts +65 -0
  55. package/dist/modules/payments/service.d.ts.map +1 -0
  56. package/dist/modules/payments/service.js +132 -0
  57. package/dist/modules/payments/service.js.map +1 -0
  58. package/dist/modules/payments/types.d.ts +31 -0
  59. package/dist/modules/payments/types.d.ts.map +1 -0
  60. package/dist/modules/payments/types.js +3 -0
  61. package/dist/modules/payments/types.js.map +1 -0
  62. package/dist/modules/user/userModel.d.ts +78 -0
  63. package/dist/modules/user/userModel.d.ts.map +1 -0
  64. package/dist/modules/user/userModel.js +3 -0
  65. package/dist/modules/user/userModel.js.map +1 -0
  66. package/dist/modules/user/userRepository.d.ts +22 -0
  67. package/dist/modules/user/userRepository.d.ts.map +1 -0
  68. package/dist/modules/user/userRepository.js +47 -0
  69. package/dist/modules/user/userRepository.js.map +1 -0
  70. package/dist/types/function.d.ts +3 -0
  71. package/dist/types/function.d.ts.map +1 -0
  72. package/dist/types/function.js +3 -0
  73. package/dist/types/function.js.map +1 -0
  74. package/dist/types/utilities.d.ts +10 -0
  75. package/dist/types/utilities.d.ts.map +1 -0
  76. package/dist/types/utilities.js +3 -0
  77. package/dist/types/utilities.js.map +1 -0
  78. package/dist/utils.d.ts +10 -0
  79. package/dist/utils.d.ts.map +1 -0
  80. package/dist/utils.js +45 -0
  81. package/dist/utils.js.map +1 -0
  82. 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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AAW,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
- "name": "@misterhomer1992/miit-bot-payment",
3
- "version": "1.0.0",
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
- },
16
- "keywords": [
17
- "payment",
18
- "validation",
19
- "formatting",
20
- "typescript",
21
- "utilities"
22
- ],
23
- "author": "",
24
- "license": "MIT",
25
- "devDependencies": {
26
- "@types/node": "^20.10.0",
27
- "@typescript-eslint/eslint-plugin": "^6.13.0",
28
- "@typescript-eslint/parser": "^6.13.0",
29
- "eslint": "^8.54.0",
30
- "prettier": "^3.1.0",
31
- "ts-node": "^10.9.2",
32
- "typescript": "^5.3.2"
33
- },
34
- "files": [
35
- "dist",
36
- "README.md",
37
- "LICENSE"
38
- ],
39
- "repository": {
40
- "type": "git",
41
- "url": "git+https://github.com/misterhomer1992/miit-bot-payment.git"
42
- },
43
- "bugs": {
44
- "url": "https://github.com/misterhomer1992/miit-bot-payment/issues"
45
- },
46
- "homepage": "https://github.com/misterhomer1992/miit-bot-payment#readme"
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
  }