@spreeloop/orange_money 1.0.6 → 1.0.8

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 (214) hide show
  1. package/dist/logging/src/log_level.d.ts +24 -0
  2. package/dist/logging/src/log_level.d.ts.map +1 -0
  3. package/dist/logging/src/log_level.js +34 -0
  4. package/dist/logging/src/log_level.js.map +1 -0
  5. package/dist/logging/src/logging.d.ts +50 -0
  6. package/dist/logging/src/logging.d.ts.map +1 -0
  7. package/dist/logging/src/logging.js +87 -0
  8. package/dist/logging/src/logging.js.map +1 -0
  9. package/dist/logging/src/printer.d.ts +10 -0
  10. package/dist/logging/src/printer.d.ts.map +1 -0
  11. package/dist/logging/src/printer.js +3 -0
  12. package/dist/logging/src/printer.js.map +1 -0
  13. package/dist/orange_money/index.d.ts +2 -0
  14. package/dist/orange_money/index.d.ts.map +1 -0
  15. package/dist/orange_money/index.js +18 -0
  16. package/dist/orange_money/index.js.map +1 -0
  17. package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts +62 -0
  18. package/dist/orange_money/src/disbursements/implementations/disbursement_service.d.ts.map +1 -0
  19. package/dist/orange_money/src/disbursements/implementations/disbursement_service.js +84 -0
  20. package/dist/orange_money/src/disbursements/implementations/disbursement_service.js.map +1 -0
  21. package/dist/orange_money/src/disbursements/implementations/src/live.d.ts +40 -0
  22. package/dist/orange_money/src/disbursements/implementations/src/live.d.ts.map +1 -0
  23. package/dist/orange_money/src/disbursements/implementations/src/live.js +61 -0
  24. package/dist/orange_money/src/disbursements/implementations/src/live.js.map +1 -0
  25. package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts +40 -0
  26. package/dist/orange_money/src/disbursements/implementations/src/sandbox.d.ts.map +1 -0
  27. package/dist/orange_money/src/disbursements/implementations/src/sandbox.js +110 -0
  28. package/dist/orange_money/src/disbursements/implementations/src/sandbox.js.map +1 -0
  29. package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts +28 -0
  30. package/dist/orange_money/src/disbursements/operations/create_access_token.d.ts.map +1 -0
  31. package/dist/orange_money/src/disbursements/operations/create_access_token.js +45 -0
  32. package/dist/orange_money/src/disbursements/operations/create_access_token.js.map +1 -0
  33. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts +2 -0
  34. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.d.ts.map +1 -0
  35. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js +106 -0
  36. package/dist/orange_money/src/disbursements/operations/create_access_token.spec.js.map +1 -0
  37. package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts +114 -0
  38. package/dist/orange_money/src/disbursements/operations/get_transfer_status.d.ts.map +1 -0
  39. package/dist/orange_money/src/disbursements/operations/get_transfer_status.js +128 -0
  40. package/dist/orange_money/src/disbursements/operations/get_transfer_status.js.map +1 -0
  41. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts +2 -0
  42. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.d.ts.map +1 -0
  43. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js +148 -0
  44. package/dist/orange_money/src/disbursements/operations/get_transfer_status.spec.js.map +1 -0
  45. package/dist/orange_money/src/disbursements/operations/transfer.d.ts +44 -0
  46. package/dist/orange_money/src/disbursements/operations/transfer.d.ts.map +1 -0
  47. package/dist/orange_money/src/disbursements/operations/transfer.js +74 -0
  48. package/dist/orange_money/src/disbursements/operations/transfer.js.map +1 -0
  49. package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts +2 -0
  50. package/dist/orange_money/src/disbursements/operations/transfer.spec.d.ts.map +1 -0
  51. package/dist/orange_money/src/disbursements/operations/transfer.spec.js +178 -0
  52. package/dist/orange_money/src/disbursements/operations/transfer.spec.js.map +1 -0
  53. package/dist/orange_money/src/disbursements/routes/routes.d.ts +38 -0
  54. package/dist/orange_money/src/disbursements/routes/routes.d.ts.map +1 -0
  55. package/dist/orange_money/src/disbursements/routes/routes.js +53 -0
  56. package/dist/orange_money/src/disbursements/routes/routes.js.map +1 -0
  57. package/dist/orange_money/src/disbursements/utils/constants.d.ts +5 -0
  58. package/dist/orange_money/src/disbursements/utils/constants.d.ts.map +1 -0
  59. package/dist/orange_money/src/disbursements/utils/constants.js +9 -0
  60. package/dist/orange_money/src/disbursements/utils/constants.js.map +1 -0
  61. package/{src/disbursements/utils/regex.ts → dist/orange_money/src/disbursements/utils/regex.d.ts} +3 -4
  62. package/dist/orange_money/src/disbursements/utils/regex.d.ts.map +1 -0
  63. package/dist/orange_money/src/disbursements/utils/regex.js +12 -0
  64. package/dist/orange_money/src/disbursements/utils/regex.js.map +1 -0
  65. package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts +2 -0
  66. package/dist/orange_money/src/disbursements/utils/regex.spec.d.ts.map +1 -0
  67. package/dist/orange_money/src/disbursements/utils/regex.spec.js +32 -0
  68. package/dist/orange_money/src/disbursements/utils/regex.spec.js.map +1 -0
  69. package/dist/orange_money/src/disbursements/utils/status.d.ts +53 -0
  70. package/dist/orange_money/src/disbursements/utils/status.d.ts.map +1 -0
  71. package/dist/orange_money/src/disbursements/utils/status.js +58 -0
  72. package/dist/orange_money/src/disbursements/utils/status.js.map +1 -0
  73. package/dist/orange_money/src/disbursements/utils/utils.d.ts +9 -0
  74. package/dist/orange_money/src/disbursements/utils/utils.d.ts.map +1 -0
  75. package/dist/orange_money/src/disbursements/utils/utils.js +26 -0
  76. package/dist/orange_money/src/disbursements/utils/utils.js.map +1 -0
  77. package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts +2 -0
  78. package/dist/orange_money/src/disbursements/utils/utils.spec.d.ts.map +1 -0
  79. package/dist/orange_money/src/disbursements/utils/utils.spec.js +43 -0
  80. package/dist/orange_money/src/disbursements/utils/utils.spec.js.map +1 -0
  81. package/{src/index.ts → dist/orange_money/src/index.d.ts} +3 -8
  82. package/dist/orange_money/src/index.d.ts.map +1 -0
  83. package/dist/orange_money/src/index.js +15 -0
  84. package/dist/orange_money/src/index.js.map +1 -0
  85. package/dist/orange_money/src/payments/implementations/fake.d.ts +33 -0
  86. package/dist/orange_money/src/payments/implementations/fake.d.ts.map +1 -0
  87. package/dist/orange_money/src/payments/implementations/fake.js +110 -0
  88. package/dist/orange_money/src/payments/implementations/fake.js.map +1 -0
  89. package/dist/orange_money/src/payments/implementations/live.d.ts +45 -0
  90. package/dist/orange_money/src/payments/implementations/live.d.ts.map +1 -0
  91. package/dist/orange_money/src/payments/implementations/live.js +69 -0
  92. package/dist/orange_money/src/payments/implementations/live.js.map +1 -0
  93. package/dist/orange_money/src/payments/operations/get_access_token.d.ts +11 -0
  94. package/dist/orange_money/src/payments/operations/get_access_token.d.ts.map +1 -0
  95. package/dist/orange_money/src/payments/operations/get_access_token.js +47 -0
  96. package/dist/orange_money/src/payments/operations/get_access_token.js.map +1 -0
  97. package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts +2 -0
  98. package/dist/orange_money/src/payments/operations/get_access_token.spec.d.ts.map +1 -0
  99. package/dist/orange_money/src/payments/operations/get_access_token.spec.js +74 -0
  100. package/dist/orange_money/src/payments/operations/get_access_token.spec.js.map +1 -0
  101. package/dist/orange_money/src/payments/operations/get_pay_token.d.ts +12 -0
  102. package/dist/orange_money/src/payments/operations/get_pay_token.d.ts.map +1 -0
  103. package/dist/orange_money/src/payments/operations/get_pay_token.js +43 -0
  104. package/dist/orange_money/src/payments/operations/get_pay_token.js.map +1 -0
  105. package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts +2 -0
  106. package/dist/orange_money/src/payments/operations/get_pay_token.spec.d.ts.map +1 -0
  107. package/dist/orange_money/src/payments/operations/get_pay_token.spec.js +74 -0
  108. package/dist/orange_money/src/payments/operations/get_pay_token.spec.js.map +1 -0
  109. package/dist/orange_money/src/payments/operations/get_payment_status.d.ts +23 -0
  110. package/dist/orange_money/src/payments/operations/get_payment_status.d.ts.map +1 -0
  111. package/dist/orange_money/src/payments/operations/get_payment_status.js +51 -0
  112. package/dist/orange_money/src/payments/operations/get_payment_status.js.map +1 -0
  113. package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts +2 -0
  114. package/dist/orange_money/src/payments/operations/get_payment_status.spec.d.ts.map +1 -0
  115. package/dist/orange_money/src/payments/operations/get_payment_status.spec.js +101 -0
  116. package/dist/orange_money/src/payments/operations/get_payment_status.spec.js.map +1 -0
  117. package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts +22 -0
  118. package/dist/orange_money/src/payments/operations/initialize_om_payment.d.ts.map +1 -0
  119. package/dist/orange_money/src/payments/operations/initialize_om_payment.js +124 -0
  120. package/dist/orange_money/src/payments/operations/initialize_om_payment.js.map +1 -0
  121. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts +2 -0
  122. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.d.ts.map +1 -0
  123. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js +245 -0
  124. package/dist/orange_money/src/payments/operations/initialize_om_payment.spec.js.map +1 -0
  125. package/dist/orange_money/src/payments/payments.d.ts +57 -0
  126. package/dist/orange_money/src/payments/payments.d.ts.map +1 -0
  127. package/dist/orange_money/src/payments/payments.js +36 -0
  128. package/dist/orange_money/src/payments/payments.js.map +1 -0
  129. package/dist/orange_money/src/payments/routes/routes.d.ts +48 -0
  130. package/dist/orange_money/src/payments/routes/routes.d.ts.map +1 -0
  131. package/dist/orange_money/src/payments/routes/routes.js +61 -0
  132. package/dist/orange_money/src/payments/routes/routes.js.map +1 -0
  133. package/dist/orange_money/src/payments/utils/constants.d.ts +96 -0
  134. package/dist/orange_money/src/payments/utils/constants.d.ts.map +1 -0
  135. package/dist/orange_money/src/payments/utils/constants.js +112 -0
  136. package/dist/orange_money/src/payments/utils/constants.js.map +1 -0
  137. package/dist/orange_money/src/payments/utils/joi_schema.d.ts +70 -0
  138. package/dist/orange_money/src/payments/utils/joi_schema.d.ts.map +1 -0
  139. package/dist/orange_money/src/payments/utils/joi_schema.js +44 -0
  140. package/dist/orange_money/src/payments/utils/joi_schema.js.map +1 -0
  141. package/dist/orange_money/src/payments/utils/request_model.d.ts +75 -0
  142. package/dist/orange_money/src/payments/utils/request_model.d.ts.map +1 -0
  143. package/dist/orange_money/src/payments/utils/request_model.js +3 -0
  144. package/dist/orange_money/src/payments/utils/request_model.js.map +1 -0
  145. package/dist/orange_money/src/payments/utils/utils.d.ts +15 -0
  146. package/dist/orange_money/src/payments/utils/utils.d.ts.map +1 -0
  147. package/dist/orange_money/src/payments/utils/utils.js +27 -0
  148. package/dist/orange_money/src/payments/utils/utils.js.map +1 -0
  149. package/dist/orange_money/src/utils/https.d.ts +77 -0
  150. package/dist/orange_money/src/utils/https.d.ts.map +1 -0
  151. package/dist/orange_money/src/utils/https.js +240 -0
  152. package/dist/orange_money/src/utils/https.js.map +1 -0
  153. package/dist/orange_money/src/utils/https.spec.d.ts +2 -0
  154. package/dist/orange_money/src/utils/https.spec.d.ts.map +1 -0
  155. package/dist/orange_money/src/utils/https.spec.js +77 -0
  156. package/dist/orange_money/src/utils/https.spec.js.map +1 -0
  157. package/dist/orange_money/src/utils/logging_interface.d.ts +23 -0
  158. package/dist/orange_money/src/utils/logging_interface.d.ts.map +1 -0
  159. package/dist/orange_money/src/utils/logging_interface.js +3 -0
  160. package/dist/orange_money/src/utils/logging_interface.js.map +1 -0
  161. package/{src/utils/operation_response.ts → dist/orange_money/src/utils/operation_response.d.ts} +9 -10
  162. package/dist/orange_money/src/utils/operation_response.d.ts.map +1 -0
  163. package/dist/orange_money/src/utils/operation_response.js +3 -0
  164. package/dist/orange_money/src/utils/operation_response.js.map +1 -0
  165. package/dist/orange_money/src/utils/utils.d.ts +6 -0
  166. package/dist/orange_money/src/utils/utils.d.ts.map +1 -0
  167. package/dist/orange_money/src/utils/utils.js +10 -0
  168. package/dist/orange_money/src/utils/utils.js.map +1 -0
  169. package/package.json +9 -3
  170. package/.eslintrc.js +0 -47
  171. package/.prettierrc +0 -6
  172. package/babel.config.js +0 -3
  173. package/index.spec.ts +0 -9
  174. package/index.ts +0 -1
  175. package/jest.before-test.ts +0 -3
  176. package/jest.config.ts +0 -54
  177. package/src/disbursements/implementations/disbursement_service.ts +0 -133
  178. package/src/disbursements/implementations/src/live.ts +0 -79
  179. package/src/disbursements/implementations/src/sandbox.ts +0 -124
  180. package/src/disbursements/operations/create_access_token.spec.ts +0 -87
  181. package/src/disbursements/operations/create_access_token.ts +0 -83
  182. package/src/disbursements/operations/get_transfer_status.spec.ts +0 -132
  183. package/src/disbursements/operations/get_transfer_status.ts +0 -265
  184. package/src/disbursements/operations/transfer.spec.ts +0 -158
  185. package/src/disbursements/operations/transfer.ts +0 -125
  186. package/src/disbursements/routes/routes.ts +0 -54
  187. package/src/disbursements/utils/constants.ts +0 -4
  188. package/src/disbursements/utils/regex.spec.ts +0 -39
  189. package/src/disbursements/utils/status.ts +0 -62
  190. package/src/disbursements/utils/utils.spec.ts +0 -42
  191. package/src/disbursements/utils/utils.ts +0 -24
  192. package/src/payments/implementations/fake.ts +0 -133
  193. package/src/payments/implementations/live.ts +0 -87
  194. package/src/payments/operations/get_access_token.spec.ts +0 -60
  195. package/src/payments/operations/get_access_token.ts +0 -77
  196. package/src/payments/operations/get_pay_token.spec.ts +0 -65
  197. package/src/payments/operations/get_pay_token.ts +0 -66
  198. package/src/payments/operations/get_payment_status.spec.ts +0 -82
  199. package/src/payments/operations/get_payment_status.ts +0 -78
  200. package/src/payments/operations/initialize_om_payment.spec.ts +0 -234
  201. package/src/payments/operations/initialize_om_payment.ts +0 -191
  202. package/src/payments/payments.ts +0 -86
  203. package/src/payments/routes/routes.ts +0 -61
  204. package/src/payments/utils/constants.ts +0 -120
  205. package/src/payments/utils/joi_schema.ts +0 -117
  206. package/src/payments/utils/request_model.ts +0 -103
  207. package/src/payments/utils/utils.ts +0 -31
  208. package/src/utils/https.spec.ts +0 -101
  209. package/src/utils/https.ts +0 -266
  210. package/src/utils/logging_interface.ts +0 -25
  211. package/src/utils/utils.ts +0 -5
  212. package/tsconfig.build.json +0 -4
  213. package/tsconfig.dev.json +0 -4
  214. package/tsconfig.json +0 -27
@@ -0,0 +1,24 @@
1
+ export declare enum LogLevel {
2
+ /**
3
+ * Development verbose information.
4
+ */
5
+ DEBUG = 0,
6
+ /**
7
+ * Significant messages.
8
+ */
9
+ INFO = 1,
10
+ /**
11
+ * Really important stuff.
12
+ */
13
+ WARN = 2,
14
+ /**
15
+ * General purpose error.
16
+ */
17
+ ERROR = 3,
18
+ /**
19
+ * Disable the logging system.
20
+ */
21
+ SILENT = 4
22
+ }
23
+ export declare const LevelName: Record<LogLevel, string>;
24
+ //# sourceMappingURL=log_level.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log_level.d.ts","sourceRoot":"","sources":["../../../../logging/src/log_level.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB;;OAEG;IACH,KAAK,IAAA;IACL;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,IAAI,IAAA;IACJ;;OAEG;IACH,KAAK,IAAA;IACL;;OAEG;IACH,MAAM,IAAA;CACP;AAED,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAM9C,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LevelName = exports.LogLevel = void 0;
4
+ var LogLevel;
5
+ (function (LogLevel) {
6
+ /**
7
+ * Development verbose information.
8
+ */
9
+ LogLevel[LogLevel["DEBUG"] = 0] = "DEBUG";
10
+ /**
11
+ * Significant messages.
12
+ */
13
+ LogLevel[LogLevel["INFO"] = 1] = "INFO";
14
+ /**
15
+ * Really important stuff.
16
+ */
17
+ LogLevel[LogLevel["WARN"] = 2] = "WARN";
18
+ /**
19
+ * General purpose error.
20
+ */
21
+ LogLevel[LogLevel["ERROR"] = 3] = "ERROR";
22
+ /**
23
+ * Disable the logging system.
24
+ */
25
+ LogLevel[LogLevel["SILENT"] = 4] = "SILENT";
26
+ })(LogLevel || (exports.LogLevel = LogLevel = {}));
27
+ exports.LevelName = {
28
+ [LogLevel.DEBUG]: 'DEBUG',
29
+ [LogLevel.INFO]: 'INFO',
30
+ [LogLevel.WARN]: 'WARN',
31
+ [LogLevel.ERROR]: 'ERROR',
32
+ [LogLevel.SILENT]: 'SILENT',
33
+ };
34
+ //# sourceMappingURL=log_level.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log_level.js","sourceRoot":"","sources":["../../../../logging/src/log_level.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAqBX;AArBD,WAAY,QAAQ;IAClB;;OAEG;IACH,yCAAK,CAAA;IACL;;OAEG;IACH,uCAAI,CAAA;IACJ;;OAEG;IACH,uCAAI,CAAA;IACJ;;OAEG;IACH,yCAAK,CAAA;IACL;;OAEG;IACH,2CAAM,CAAA;AACR,CAAC,EArBW,QAAQ,wBAAR,QAAQ,QAqBnB;AAEY,QAAA,SAAS,GAA6B;IACjD,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM;IACvB,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO;IACzB,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ;CAC5B,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { LogLevel } from './log_level';
2
+ import { LogPrinter } from './printer';
3
+ /**
4
+ * The main class of our logging system.
5
+ */
6
+ export declare class Logger {
7
+ private name;
8
+ /**
9
+ * The lowest log level to use.
10
+ * Use LogLevel.SILENT to disable printing.
11
+ */
12
+ static level: LogLevel;
13
+ /**
14
+ * A variable that contains a printer configuration that will be
15
+ * called for debugging some message to the output.
16
+ */
17
+ static printer: LogPrinter;
18
+ /**
19
+ * Constructs a new [Logger] implementation.
20
+ * @param {string} name
21
+ */
22
+ constructor(name?: string);
23
+ /**
24
+ * Sends a print message to a registered printer.
25
+ * @param {Object} props
26
+ * @return {void}
27
+ */
28
+ private print;
29
+ /**
30
+ * Log a debug level message.
31
+ * @param {string[]} args
32
+ */
33
+ log(...args: string[]): void;
34
+ /**
35
+ * Log an info level message.
36
+ * @param {string[]} args
37
+ */
38
+ info(...args: string[]): void;
39
+ /**
40
+ * Log a waning level message.
41
+ * @param {string[]} args
42
+ */
43
+ warn(...args: string[]): void;
44
+ /**
45
+ * Log an error level message.
46
+ * @param {string[]} args
47
+ */
48
+ error(...args: string[]): void;
49
+ }
50
+ //# sourceMappingURL=logging.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.d.ts","sourceRoot":"","sources":["../../../../logging/src/logging.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC;;GAEG;AACH,qBAAa,MAAM;IAmBL,OAAO,CAAC,IAAI;IAlBxB;;;OAGG;IACH,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAkB;IAExC;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,UAAU,CAExB;IAEF;;;OAGG;gBACiB,IAAI,GAAE,MAAW;IAErC;;;;OAIG;IACH,OAAO,CAAC,KAAK;IA0Bb;;;OAGG;IACH,GAAG,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAG5B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAG7B;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;IAG7B;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI;CAG/B"}
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Logger = void 0;
4
+ const log_level_1 = require("./log_level");
5
+ /**
6
+ * The main class of our logging system.
7
+ */
8
+ class Logger {
9
+ /**
10
+ * Constructs a new [Logger] implementation.
11
+ * @param {string} name
12
+ */
13
+ constructor(name = '') {
14
+ this.name = name;
15
+ }
16
+ /**
17
+ * Sends a print message to a registered printer.
18
+ * @param {Object} props
19
+ * @return {void}
20
+ */
21
+ print(props) {
22
+ if (props.level < Logger.level) {
23
+ return;
24
+ }
25
+ Logger.printer({
26
+ name: this.name,
27
+ level: props.level,
28
+ message: props.message,
29
+ });
30
+ switch (props.level) {
31
+ case log_level_1.LogLevel.DEBUG:
32
+ console.log(props.message);
33
+ break;
34
+ case log_level_1.LogLevel.INFO:
35
+ console.info(props.message);
36
+ break;
37
+ case log_level_1.LogLevel.ERROR:
38
+ console.error(props.message);
39
+ break;
40
+ case log_level_1.LogLevel.WARN:
41
+ console.warn(props.message);
42
+ break;
43
+ }
44
+ }
45
+ /**
46
+ * Log a debug level message.
47
+ * @param {string[]} args
48
+ */
49
+ log(...args) {
50
+ this.print({ level: log_level_1.LogLevel.DEBUG, message: args.join('\n') });
51
+ }
52
+ /**
53
+ * Log an info level message.
54
+ * @param {string[]} args
55
+ */
56
+ info(...args) {
57
+ this.print({ level: log_level_1.LogLevel.INFO, message: args.join('\n') });
58
+ }
59
+ /**
60
+ * Log a waning level message.
61
+ * @param {string[]} args
62
+ */
63
+ warn(...args) {
64
+ this.print({ level: log_level_1.LogLevel.WARN, message: args.join('\n') });
65
+ }
66
+ /**
67
+ * Log an error level message.
68
+ * @param {string[]} args
69
+ */
70
+ error(...args) {
71
+ this.print({ level: log_level_1.LogLevel.ERROR, message: args.join('\n') });
72
+ }
73
+ }
74
+ exports.Logger = Logger;
75
+ /**
76
+ * The lowest log level to use.
77
+ * Use LogLevel.SILENT to disable printing.
78
+ */
79
+ Logger.level = log_level_1.LogLevel.DEBUG;
80
+ /**
81
+ * A variable that contains a printer configuration that will be
82
+ * called for debugging some message to the output.
83
+ */
84
+ Logger.printer = () => {
85
+ return;
86
+ };
87
+ //# sourceMappingURL=logging.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logging.js","sourceRoot":"","sources":["../../../../logging/src/logging.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAGvC;;GAEG;AACH,MAAa,MAAM;IAejB;;;OAGG;IACH,YAAoB,OAAe,EAAE;QAAjB,SAAI,GAAJ,IAAI,CAAa;IAAG,CAAC;IAEzC;;;;OAIG;IACK,KAAK,CAAC,KAA2C;QACvD,IAAI,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;YAC/B,OAAO;QACT,CAAC;QAED,MAAM,CAAC,OAAO,CAAC;YACb,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAC,CAAC;QACH,QAAQ,KAAK,CAAC,KAAK,EAAE,CAAC;YACpB,KAAK,oBAAQ,CAAC,KAAK;gBACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC3B,MAAM;YACR,KAAK,oBAAQ,CAAC,IAAI;gBAChB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM;YACR,KAAK,oBAAQ,CAAC,KAAK;gBACjB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC7B,MAAM;YACR,KAAK,oBAAQ,CAAC,IAAI;gBAChB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM;QACV,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,GAAG,CAAC,GAAG,IAAc;QACnB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;IACD;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAc;QACpB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IACD;;;OAGG;IACH,IAAI,CAAC,GAAG,IAAc;QACpB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IACD;;;OAGG;IACH,KAAK,CAAC,GAAG,IAAc;QACrB,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,oBAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClE,CAAC;;AA/EH,wBAgFC;AA/EC;;;GAGG;AACI,YAAK,GAAa,oBAAQ,CAAC,KAAK,CAAC;AAExC;;;GAGG;AACI,cAAO,GAAe,GAAG,EAAE;IAChC,OAAO;AACT,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { LogLevel } from './log_level';
2
+ export type LogPrinterArgs = {
3
+ name: string;
4
+ level: LogLevel;
5
+ message: string;
6
+ errorObject?: object;
7
+ stackTrace?: string;
8
+ };
9
+ export type LogPrinter = (param: LogPrinterArgs) => void;
10
+ //# sourceMappingURL=printer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../../../../logging/src/printer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=printer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"printer.js","sourceRoot":"","sources":["../../../../logging/src/printer.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export * from './src/index';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -0,0 +1,18 @@
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("./src/index"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B"}
@@ -0,0 +1,62 @@
1
+ import { DisbursementXTargetEnvironmentType } from '../utils/constants';
2
+ import { LoggerInterface } from '../../utils/logging_interface';
3
+ import { CreateAccessTokenResponse } from '../operations/create_access_token';
4
+ import { TransferRequest, TransferResponse } from '../operations/transfer';
5
+ import { GetTransferStatusRequest, GetTransferStatusResponse } from '../operations/get_transfer_status';
6
+ /**
7
+ * Interface for DisbursementServiceConfig.
8
+ */
9
+ export interface DisbursementServiceConfig {
10
+ clientId: string;
11
+ clientSecret: string;
12
+ customerKey: string;
13
+ customerSecret: string;
14
+ channelUserMsisdn: string;
15
+ pin: string;
16
+ environment: DisbursementXTargetEnvironmentType;
17
+ logger: LoggerInterface;
18
+ }
19
+ /**
20
+ * Joi schema for DisbursementServiceConfigSchema.
21
+ */
22
+ export declare const DisbursementServiceConfigSchema: any;
23
+ /**
24
+ * Orange Money API Disbursement.
25
+ * @class
26
+ */
27
+ export interface DisbursementInterface {
28
+ /**
29
+ * Creates an access token.
30
+ *
31
+ * @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
32
+ */
33
+ createAccessToken(): Promise<CreateAccessTokenResponse>;
34
+ /**
35
+ * Transfers the specified amount of money from one account to another.
36
+ *
37
+ * @param {TransferRequest} params - The parameters for the transfer.
38
+ * @return {Promise<TransferResponse>} - The response from the transfer method.
39
+ */
40
+ transfer(params: TransferRequest): Promise<TransferResponse>;
41
+ /**
42
+ * Retrieves the status of a transfer.
43
+ *
44
+ * @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
45
+ * @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
46
+ */
47
+ getTransferStatus(params: GetTransferStatusRequest): Promise<GetTransferStatusResponse>;
48
+ }
49
+ /**
50
+ * Orange Money API Disbursement.
51
+ * @class
52
+ */
53
+ export declare class Disbursement {
54
+ /**
55
+ * Creates a new Disbursement object based on the provided configuration.
56
+ *
57
+ * @param {DisbursementServiceConfig} config - The configuration for the Disbursement object.
58
+ * @return {Disbursement} A new Disbursement object based on the provided configuration.
59
+ */
60
+ static createDisbursement(config: DisbursementServiceConfig): DisbursementInterface;
61
+ }
62
+ //# sourceMappingURL=disbursement_service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disbursement_service.d.ts","sourceRoot":"","sources":["../../../../../src/disbursements/implementations/disbursement_service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kCAAkC,EAAE,MAAM,oBAAoB,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,mCAAmC,CAAC;AAI3C;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,kCAAkC,CAAC;IAChD,MAAM,EAAE,eAAe,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,+BAA+B,KAgDxC,CAAC;AAEL;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,iBAAiB,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAExD;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE7D;;;;;OAKG;IACH,iBAAiB,CACf,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACvC;AAED;;;GAGG;AACH,qBAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CACvB,MAAM,EAAE,yBAAyB,GAChC,qBAAqB;CAQzB"}
@@ -0,0 +1,84 @@
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.Disbursement = exports.DisbursementServiceConfigSchema = void 0;
7
+ const joi_1 = __importDefault(require("joi"));
8
+ const constants_1 = require("../utils/constants");
9
+ const regex_1 = require("../utils/regex");
10
+ const live_1 = require("./src/live");
11
+ const sandbox_1 = require("./src/sandbox");
12
+ /**
13
+ * Joi schema for DisbursementServiceConfigSchema.
14
+ */
15
+ exports.DisbursementServiceConfigSchema = joi_1.default.object({
16
+ clientId: joi_1.default.string().required().messages({
17
+ 'string.base': '"clientId" should be a type of \'text\'',
18
+ 'string.empty': '"clientId" cannot be an empty field',
19
+ 'any.required': '"clientId" is a required field',
20
+ }),
21
+ clientSecret: joi_1.default.string().required().messages({
22
+ 'string.base': '"clientSecret" should be a type of \'text\'',
23
+ 'string.empty': '"clientSecret" cannot be an empty field',
24
+ 'any.required': '"clientSecret" is a required field',
25
+ }),
26
+ customerKey: joi_1.default.string().required().messages({
27
+ 'string.base': '"customerKey" should be a type of \'text\'',
28
+ 'string.empty': '"customerKey" cannot be an empty field',
29
+ 'any.required': '"customerKey" is a required field',
30
+ }),
31
+ customerSecret: joi_1.default.string().required().messages({
32
+ 'string.base': '"customerSecret" should be a type of \'text\'',
33
+ 'string.empty': '"customerSecret" cannot be an empty field',
34
+ 'any.required': '"customerSecret" is a required field',
35
+ }),
36
+ channelUserMsisdn: joi_1.default.string()
37
+ .pattern(regex_1.merchantPhoneNumberRegex)
38
+ .required()
39
+ .messages({
40
+ 'string.base': '"channelUserMsisdn" should be a type of \'text\'',
41
+ 'string.empty': '"channelUserMsisdn" cannot be an empty field',
42
+ 'any.required': '"channelUserMsisdn" is a required field',
43
+ }),
44
+ pin: joi_1.default.string().required().messages({
45
+ 'string.base': '"pin" should be a type of \'text\'',
46
+ 'string.empty': '"pin" cannot be an empty field',
47
+ 'any.required': '"pin" is a required field',
48
+ }),
49
+ environment: joi_1.default.string()
50
+ .valid(...Object.values(constants_1.DisbursementXTargetEnvironmentType))
51
+ .required()
52
+ .messages({
53
+ 'string.base': '"environment" should be a type of \'text\'',
54
+ 'string.empty': '"environment" cannot be an empty field',
55
+ 'any.required': '"environment" is a required field',
56
+ }),
57
+ logger: joi_1.default.object().required().messages({
58
+ 'string.base': '"logger" should be a type of \'object\'',
59
+ 'string.empty': '"logger" cannot be an empty field',
60
+ 'any.required': '"logger" is a required field',
61
+ }),
62
+ });
63
+ /**
64
+ * Orange Money API Disbursement.
65
+ * @class
66
+ */
67
+ class Disbursement {
68
+ /**
69
+ * Creates a new Disbursement object based on the provided configuration.
70
+ *
71
+ * @param {DisbursementServiceConfig} config - The configuration for the Disbursement object.
72
+ * @return {Disbursement} A new Disbursement object based on the provided configuration.
73
+ */
74
+ static createDisbursement(config) {
75
+ switch (config.environment) {
76
+ case constants_1.DisbursementXTargetEnvironmentType.prod:
77
+ return new live_1.DisbursementLive(config);
78
+ case constants_1.DisbursementXTargetEnvironmentType.sandbox:
79
+ return new sandbox_1.DisbursementFake(config);
80
+ }
81
+ }
82
+ }
83
+ exports.Disbursement = Disbursement;
84
+ //# sourceMappingURL=disbursement_service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disbursement_service.js","sourceRoot":"","sources":["../../../../../src/disbursements/implementations/disbursement_service.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AACtB,kDAAwE;AAExE,0CAA0D;AAO1D,qCAA8C;AAC9C,2CAAiD;AAgBjD;;GAEG;AACU,QAAA,+BAA+B,GAC1C,aAAG,CAAC,MAAM,CAA4B;IACpC,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;QACzC,aAAa,EAAE,yCAAyC;QACxD,cAAc,EAAE,qCAAqC;QACrD,cAAc,EAAE,gCAAgC;KACjD,CAAC;IACF,YAAY,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;QAC7C,aAAa,EAAE,6CAA6C;QAC5D,cAAc,EAAE,yCAAyC;QACzD,cAAc,EAAE,oCAAoC;KACrD,CAAC;IACF,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;QAC5C,aAAa,EAAE,4CAA4C;QAC3D,cAAc,EAAE,wCAAwC;QACxD,cAAc,EAAE,mCAAmC;KACpD,CAAC;IACF,cAAc,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;QAC/C,aAAa,EAAE,+CAA+C;QAC9D,cAAc,EAAE,2CAA2C;QAC3D,cAAc,EAAE,sCAAsC;KACvD,CAAC;IACF,iBAAiB,EAAE,aAAG,CAAC,MAAM,EAAE;SAC5B,OAAO,CAAC,gCAAwB,CAAC;SACjC,QAAQ,EAAE;SACV,QAAQ,CAAC;QACR,aAAa,EAAE,kDAAkD;QACjE,cAAc,EAAE,8CAA8C;QAC9D,cAAc,EAAE,yCAAyC;KAC1D,CAAC;IACJ,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;QACpC,aAAa,EAAE,oCAAoC;QACnD,cAAc,EAAE,gCAAgC;QAChD,cAAc,EAAE,2BAA2B;KAC5C,CAAC;IACF,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE;SACtB,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,8CAAkC,CAAC,CAAC;SAC3D,QAAQ,EAAE;SACV,QAAQ,CAAC;QACR,aAAa,EAAE,4CAA4C;QAC3D,cAAc,EAAE,wCAAwC;QACxD,cAAc,EAAE,mCAAmC;KACpD,CAAC;IACJ,MAAM,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;QACvC,aAAa,EAAE,yCAAyC;QACxD,cAAc,EAAE,mCAAmC;QACnD,cAAc,EAAE,8BAA8B;KAC/C,CAAC;CACH,CAAC,CAAC;AAiCL;;;GAGG;AACH,MAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,kBAAkB,CACvB,MAAiC;QAEjC,QAAQ,MAAM,CAAC,WAAW,EAAE,CAAC;YAC3B,KAAK,8CAAkC,CAAC,IAAI;gBAC1C,OAAO,IAAI,uBAAgB,CAAC,MAAM,CAAC,CAAC;YACtC,KAAK,8CAAkC,CAAC,OAAO;gBAC7C,OAAO,IAAI,0BAAgB,CAAC,MAAM,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;CACF;AAjBD,oCAiBC"}
@@ -0,0 +1,40 @@
1
+ import { TransferRequest, TransferResponse } from '../../operations/transfer';
2
+ import { CreateAccessTokenResponse } from '../../operations/create_access_token';
3
+ import { Routes } from '../../routes/routes';
4
+ import { DisbursementInterface, DisbursementServiceConfig } from '../disbursement_service';
5
+ import { GetTransferStatusRequest, GetTransferStatusResponse } from '../../operations/get_transfer_status';
6
+ /**
7
+ * Orange Money API Live Disbursement.
8
+ * @class
9
+ */
10
+ export declare class DisbursementLive implements DisbursementInterface {
11
+ protected readonly config: DisbursementServiceConfig;
12
+ protected readonly routes: Routes;
13
+ /**
14
+ * Constructs a new {Disbursement}.
15
+ * @constructor
16
+ * @param {DisbursementServiceConfig} config - The required global route configuration.
17
+ */
18
+ constructor(config: DisbursementServiceConfig);
19
+ /**
20
+ * Creates an access token.
21
+ *
22
+ * @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
23
+ */
24
+ createAccessToken(): Promise<CreateAccessTokenResponse>;
25
+ /**
26
+ * Transfers the specified amount of money from one account to another.
27
+ *
28
+ * @param {TransferRequest} params - The parameters for the transfer.
29
+ * @return {Promise<TransferResponse>} - The response from the transfer method.
30
+ */
31
+ transfer(params: TransferRequest): Promise<TransferResponse>;
32
+ /**
33
+ * Retrieves the status of a transfer.
34
+ *
35
+ * @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
36
+ * @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
37
+ */
38
+ getTransferStatus(params: GetTransferStatusRequest): Promise<GetTransferStatusResponse>;
39
+ }
40
+ //# sourceMappingURL=live.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../../../../src/disbursements/implementations/src/live.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,yBAAyB,EAE1B,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EAE1B,MAAM,sCAAsC,CAAC;AAE9C;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,qBAAqB;IAC5D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IACrD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAClC;;;;OAIG;gBACS,MAAM,EAAE,yBAAyB;IAK7C;;;;OAIG;IACG,iBAAiB,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAO7D;;;;;OAKG;IACG,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAQlE;;;;;OAKG;IACG,iBAAiB,CACrB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,yBAAyB,CAAC;CAOtC"}
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DisbursementLive = void 0;
4
+ const transfer_1 = require("../../operations/transfer");
5
+ const create_access_token_1 = require("../../operations/create_access_token");
6
+ const routes_1 = require("../../routes/routes");
7
+ const get_transfer_status_1 = require("../../operations/get_transfer_status");
8
+ /**
9
+ * Orange Money API Live Disbursement.
10
+ * @class
11
+ */
12
+ class DisbursementLive {
13
+ /**
14
+ * Constructs a new {Disbursement}.
15
+ * @constructor
16
+ * @param {DisbursementServiceConfig} config - The required global route configuration.
17
+ */
18
+ constructor(config) {
19
+ this.routes = new routes_1.Routes();
20
+ this.config = config;
21
+ }
22
+ /**
23
+ * Creates an access token.
24
+ *
25
+ * @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
26
+ */
27
+ async createAccessToken() {
28
+ return await (0, create_access_token_1.createAccessToken)({
29
+ configs: this.config,
30
+ endPoint: this.routes.createAccessToken(),
31
+ });
32
+ }
33
+ /**
34
+ * Transfers the specified amount of money from one account to another.
35
+ *
36
+ * @param {TransferRequest} params - The parameters for the transfer.
37
+ * @return {Promise<TransferResponse>} - The response from the transfer method.
38
+ */
39
+ async transfer(params) {
40
+ return await (0, transfer_1.transfer)({
41
+ configs: this.config,
42
+ params: params,
43
+ endPoint: this.routes.transfer(),
44
+ });
45
+ }
46
+ /**
47
+ * Retrieves the status of a transfer.
48
+ *
49
+ * @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
50
+ * @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
51
+ */
52
+ async getTransferStatus(params) {
53
+ return await (0, get_transfer_status_1.getTransferStatus)({
54
+ configs: this.config,
55
+ params: params,
56
+ endPoint: this.routes.transferStatus(params.messageId),
57
+ });
58
+ }
59
+ }
60
+ exports.DisbursementLive = DisbursementLive;
61
+ //# sourceMappingURL=live.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"live.js","sourceRoot":"","sources":["../../../../../../src/disbursements/implementations/src/live.ts"],"names":[],"mappings":";;;AAAA,wDAImC;AACnC,8EAG8C;AAC9C,gDAA6C;AAK7C,8EAI8C;AAE9C;;;GAGG;AACH,MAAa,gBAAgB;IAG3B;;;;OAIG;IACH,YAAY,MAAiC;QAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,eAAM,EAAE,CAAC;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,iBAAiB;QACrB,OAAO,MAAM,IAAA,uCAAiB,EAAC;YAC7B,OAAO,EAAE,IAAI,CAAC,MAAM;YACpB,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,iBAAiB,EAAE;SAC1C,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,CAAC,MAAuB;QACpC,OAAO,MAAM,IAAA,mBAAQ,EAAC;YACpB,OAAO,EAAE,IAAI,CAAC,MAAM;YACpB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CACrB,MAAgC;QAEhC,OAAO,MAAM,IAAA,uCAAiB,EAAC;YAC7B,OAAO,EAAE,IAAI,CAAC,MAAM;YACpB,MAAM,EAAE,MAAM;YACd,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,SAAS,CAAC;SACvD,CAAC,CAAC;IACL,CAAC;CACF;AAtDD,4CAsDC"}
@@ -0,0 +1,40 @@
1
+ import { TransferResponse } from '../../operations/transfer';
2
+ import { CreateAccessTokenResponse } from '../../operations/create_access_token';
3
+ import { Routes } from '../../routes/routes';
4
+ import { DisbursementInterface, DisbursementServiceConfig } from '../disbursement_service';
5
+ import { GetTransferStatusResponse } from '../../operations/get_transfer_status';
6
+ /**
7
+ * Orange Money API Fake Disbursement.
8
+ * @class
9
+ */
10
+ export declare class DisbursementFake implements DisbursementInterface {
11
+ protected readonly config: DisbursementServiceConfig;
12
+ protected readonly routes: Routes;
13
+ /**
14
+ * Constructs a new {Disbursement}.
15
+ * @constructor
16
+ * @param {DisbursementServiceConfig} config - The required global route configuration.
17
+ */
18
+ constructor(config: DisbursementServiceConfig);
19
+ /**
20
+ * Creates an access token.
21
+ *
22
+ * @return {Promise<CreateAccessTokenResponse>} The method response containing a string and a token.
23
+ */
24
+ createAccessToken(): Promise<CreateAccessTokenResponse>;
25
+ /**
26
+ * Transfers the specified amount of money from one account to another.
27
+ *
28
+ * @param {TransferRequest} params - The parameters for the transfer.
29
+ * @return {Promise<TransferResponse>} - The response from the transfer method.
30
+ */
31
+ transfer(): Promise<TransferResponse>;
32
+ /**
33
+ * Retrieves the status of a transfer.
34
+ *
35
+ * @param {GetTransferStatusRequest} params - The parameters for retrieving the transfer status.
36
+ * @return {Promise<GetTransferStatusResponse>} - The method response containing the status and transfer status response.
37
+ */
38
+ getTransferStatus(): Promise<GetTransferStatusResponse>;
39
+ }
40
+ //# sourceMappingURL=sandbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../../../../../src/disbursements/implementations/src/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAEL,yBAAyB,EAC1B,MAAM,sCAAsC,CAAC;AAM9C;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,qBAAqB;IAC5D,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,yBAAyB,CAAC;IACrD,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAClC;;;;OAIG;gBACS,MAAM,EAAE,yBAAyB;IAK7C;;;;OAIG;IACG,iBAAiB,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAW7D;;;;;OAKG;IACG,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAwB3C;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,yBAAyB,CAAC;CAsC9D"}